@marimo-team/frontend 0.24.3-dev3 → 0.24.3-dev4

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 (94) hide show
  1. package/dist/assets/{CellStatus-LoTwk7fR.js → CellStatus-0QNZS4By.js} +1 -1
  2. package/dist/assets/{JsonOutput-CzIGPEZQ.js → JsonOutput-D2ZWLZs4.js} +7 -7
  3. package/dist/assets/{MarimoErrorOutput-DqpoYOvw.js → MarimoErrorOutput-BlmIJ9WY.js} +2 -2
  4. package/dist/assets/{RenderHTML-DwhMAd9l.js → RenderHTML-DnPB4qpJ.js} +1 -1
  5. package/dist/assets/{RunButton-BlpbweyH.js → RunButton-C7TxE07w.js} +1 -1
  6. package/dist/assets/{add-cell-with-ai-R-3DS79K.js → add-cell-with-ai-OQ4sSXg4.js} +12 -12
  7. package/dist/assets/{add-connection-dialog-BGfpw5lC.js → add-connection-dialog-MTOC2ycO.js} +73 -73
  8. package/dist/assets/{agent-panel-Cgt_K0tD.js → agent-panel-BdEDIHdc.js} +4 -4
  9. package/dist/assets/ai-model-dropdown-CmJEEhSC.js +3 -0
  10. package/dist/assets/app-config-button-W8Pytgb5.js +1 -0
  11. package/dist/assets/{blob-B2d_dHwI.js → blob-BrVH7IJp.js} +1 -1
  12. package/dist/assets/{cell-editor-Dw09J9yD.js → cell-editor-C7IiingQ.js} +8 -8
  13. package/dist/assets/{cell-link-6burT2XF.js → cell-link-CbHXmrt8.js} +1 -1
  14. package/dist/assets/{cells-Cp-G34Rz.js → cells-BBhW3FXj.js} +1 -1
  15. package/dist/assets/{chat-display-Bu405iyc.js → chat-display-CIpYPLlF.js} +1 -1
  16. package/dist/assets/{chat-panel-BlUwNY5j.js → chat-panel-CK3X_KPy.js} +2 -2
  17. package/dist/assets/{chat-ui-DGiVDzNh.js → chat-ui-BJwtx1SR.js} +4 -4
  18. package/dist/assets/{column-preview-riSXbYe_.js → column-preview-Coa5PyHk.js} +1 -1
  19. package/dist/assets/{command-palette-CCVzJcyf.js → command-palette-_xpwMniA.js} +1 -1
  20. package/dist/assets/{common-CHR7w7aQ.js → common-KqtqJsml.js} +1 -1
  21. package/dist/assets/{components-C7mWrmXr.js → components-Cpv2z-yV.js} +1 -1
  22. package/dist/assets/{datasource-DrODSIs0.js → datasource-B3qF2oaW.js} +2 -2
  23. package/dist/assets/{dependency-graph-panel-AY5BEVH2.js → dependency-graph-panel-Av1CMZ61.js} +3 -3
  24. package/dist/assets/{documentation-panel-CaJF7e-j.js → documentation-panel-BEz3Hjfu.js} +1 -1
  25. package/dist/assets/{download-DMxOzI7b.js → download-BgO9EN-W.js} +1 -1
  26. package/dist/assets/edit-page-DslcxB67.js +9 -0
  27. package/dist/assets/error-entries-BFzSRy80.js +5 -0
  28. package/dist/assets/{error-panel-Bhlvt6_H.js → error-panel-BtLTJDUq.js} +1 -1
  29. package/dist/assets/{file-explorer-panel-s0ohSG_L.js → file-explorer-panel-DEyChgqS.js} +1 -1
  30. package/dist/assets/{file-icons-DdGYuADJ.js → file-icons-BhotQqrU.js} +1 -1
  31. package/dist/assets/{file-name-input-K4MKESI_.js → file-name-input-CH-hNP6F.js} +1 -1
  32. package/dist/assets/{floating-outline-DaUHnl_e.js → floating-outline-Cmk3XDJi.js} +1 -1
  33. package/dist/assets/{home-page-BLd6rnbk.js → home-page-CUBuu5Go.js} +1 -1
  34. package/dist/assets/index-C5h1aWhw.js +29 -0
  35. package/dist/assets/{layout-DWnrxIo2.js → layout-CsLuqwD3.js} +5 -5
  36. package/dist/assets/{logs-panel-BGS2v3ba.js → logs-panel-BV4VZ_uH.js} +1 -1
  37. package/dist/assets/{markdown-renderer-BZKlbm2Q.js → markdown-renderer-751VNlrQ.js} +1 -1
  38. package/dist/assets/{name-cell-input-BMCdK-el.js → name-cell-input-DexJ7ZIH.js} +1 -1
  39. package/dist/assets/{outline-panel-Dr5u73V6.js → outline-panel-QU3nj1VW.js} +1 -1
  40. package/dist/assets/packages-panel-D7oDuI6v.js +1 -0
  41. package/dist/assets/panel-accordion-state-Dl0VcB79.js +1 -0
  42. package/dist/assets/panels-nM4QKfEI.js +4 -0
  43. package/dist/assets/process-output-CPUOlFhp.js +1 -0
  44. package/dist/assets/readonly-code-display-DP7DxRA1.js +1 -0
  45. package/dist/assets/{readonly-python-code-DpIyjHqY.js → readonly-python-code-CAYyabaV.js} +1 -1
  46. package/dist/assets/{reveal-component-nZIAapoD.js → reveal-component-D9DygPds.js} +2 -2
  47. package/dist/assets/rotate-cw-CESctpLh.js +1 -0
  48. package/dist/assets/{run-page-9pl8qhQR.js → run-page-CzO-uMUn.js} +1 -1
  49. package/dist/assets/{scratchpad-panel-BleGt2KM.js → scratchpad-panel-7YBL6E95.js} +1 -1
  50. package/dist/assets/session-panel-hnFaUP0Y.js +1 -0
  51. package/dist/assets/share-BZW3tzEX.js +1 -0
  52. package/dist/assets/{skeleton-BKeh8hf3.js → skeleton-CM7HxSva.js} +1 -1
  53. package/dist/assets/{snippets-panel-D5yy7kj0.js → snippets-panel-AdjuR23O.js} +1 -1
  54. package/dist/assets/state-DOrY1Jyf.js +1 -0
  55. package/dist/assets/state-DQHafeTV.js +3 -0
  56. package/dist/assets/{tracing-DNk3gmWv.js → tracing-CUlvXr_H.js} +1 -1
  57. package/dist/assets/{tracing-panel-Yqazr6w_.js → tracing-panel-CjyayE-l.js} +2 -2
  58. package/dist/assets/{tree-actions-CG5g7aUQ.js → tree-actions-mfuAcK1x.js} +1 -1
  59. package/dist/assets/{useAddCell-DdB_uBif.js → useAddCell-BR8kYnb6.js} +1 -1
  60. package/dist/assets/{useCellActionButton-B31neI3m.js → useCellActionButton-BhREXvvn.js} +1 -1
  61. package/dist/assets/{useDeleteCell-Bz49_cFj.js → useDeleteCell-DwaN6KAw.js} +1 -1
  62. package/dist/assets/useDependencyPanelTab-I-7B78cW.js +1 -0
  63. package/dist/assets/useInstallPackage-IUt497GC.js +1 -0
  64. package/dist/assets/useNotebookActions-D5_YLR42.js +10 -0
  65. package/dist/assets/useRunCells-BMQuitYY.js +1 -0
  66. package/dist/assets/{useSplitCell-Dy2_DmJR.js → useSplitCell-B7AvHoya.js} +1 -1
  67. package/dist/index.html +22 -22
  68. package/package.json +1 -1
  69. package/src/__mocks__/requests.ts +7 -2
  70. package/src/components/editor/chrome/panels/__tests__/packages-panel.test.tsx +143 -0
  71. package/src/components/editor/chrome/panels/packages-panel.tsx +145 -51
  72. package/src/components/editor/package-alert.tsx +25 -1
  73. package/src/core/packages/__tests__/useInstallPackage.test.tsx +47 -1
  74. package/src/core/packages/toast-components.tsx +26 -0
  75. package/src/core/packages/useInstallPackage.ts +7 -2
  76. package/src/core/wasm/bridge.ts +1 -0
  77. package/dist/assets/ai-model-dropdown-DCmiuk7x.js +0 -3
  78. package/dist/assets/app-config-button-DUJC6b6x.js +0 -1
  79. package/dist/assets/edit-page-xlMlcLnI.js +0 -9
  80. package/dist/assets/error-entries-Cv2m1yhc.js +0 -5
  81. package/dist/assets/index-4n22QjCD.js +0 -29
  82. package/dist/assets/packages-panel-BdpRg9tX.js +0 -1
  83. package/dist/assets/panel-accordion-state-DjUTN7i5.js +0 -1
  84. package/dist/assets/panels-CWn0Yh1D.js +0 -4
  85. package/dist/assets/process-output-Ck7-P_xp.js +0 -1
  86. package/dist/assets/readonly-code-display--S2daDa6.js +0 -1
  87. package/dist/assets/session-panel-DRGPlL5J.js +0 -1
  88. package/dist/assets/share-CPtBiNgr.js +0 -1
  89. package/dist/assets/state-B6AklCzD.js +0 -1
  90. package/dist/assets/state-Di9TbuV9.js +0 -3
  91. package/dist/assets/useDependencyPanelTab-C_ps0r--.js +0 -1
  92. package/dist/assets/useInstallPackage-DsD08SLK.js +0 -1
  93. package/dist/assets/useNotebookActions-CQtbk9CB.js +0 -10
  94. package/dist/assets/useRunCells-CX7oW5zy.js +0 -1
@@ -1,3 +0,0 @@
1
- import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{a as t,c as n,f as r,l as i,r as a,t as o,u as s}from"./useEvent-xfs0Sn4r.js";import{t as c}from"./react-CBDbhulC.js";import{$a as l,Ar as u,Co as d,Cr as f,Dr as p,Fr as m,G as h,In as g,Ir as _,Jr as v,Kn as y,Mn as b,Na as x,Or as S,Pa as C,Pn as w,Pr as T,Vi as E,Xi as D,Zi as O,_n as k,an as A,ar as j,ca as M,cn as N,gn as P,go as F,ii as I,in as L,ir as R,mn as z,nn as B,no as V,nr as H,on as U,ra as ee,rn as W,ro as te,rr as ne,sa as re,sn as G,tn as ie}from"./cells-Cp-G34Rz.js";import{t as K}from"./react-dom-BQrReHnR.js";import{t as ae}from"./compiler-runtime-CYIjoINj.js";import{t as oe}from"./isObject-BCaOs5rp.js";import{t as se}from"./get-DjNf4SIX.js";import{t as ce}from"./debounce-aFmHgJZY.js";import{A as le,E as ue,M as de,S as fe,b as pe,d as me,g as he,h as ge,j as _e,n as ve,u as ye,w as be}from"./utils-D5Ywm7-q.js";import{t as xe}from"./has-sKqQhP6r.js";import{_ as Se,f as Ce,g as q,l as we,m as Te,t as Ee}from"./useEventListener-92uWqz-P.js";import{t as De}from"./invariant-Ci2dTZ72.js";import{M as Oe,N as ke,S as Ae,r as je}from"./config-BlNM0caL.js";import{i as Me,n as Ne,t as Pe}from"./switch-DjXr9Y9D.js";import{t as Fe}from"./cn-ldLVeaqm.js";import{t as Ie}from"./jsx-runtime-B74pBk57.js";import{a as Le,i as Re,n as ze,o as Be,r as Ve,t as He}from"./config-B-r81uZ6.js";import{a as Ue,i as We,n as Ge,r as Ke,t as qe}from"./tabs-Cy1qXLzH.js";import{d as Je,i as Ye,l as Xe,n as Ze,r as Qe,s as $e,t as et}from"./select-nLt2y0Sw.js";import{a as tt,c as nt,d as rt,f as it,p as at,r as ot,s as st,t as ct,u as lt}from"./dropdown-menu-C40jM9o4.js";import{t as ut}from"./tooltip-BUtPzKB4.js";import{n as dt,r as ft,t as pt}from"./button-Dh8EwhsF.js";import{Tt as mt,qt as ht,st as gt,ut as _t}from"./dist-BtC9ym6k.js";import{F as vt,L as yt,M as bt,N as xt,P as St,R as Ct,b as wt,f as Tt,g as Et,h as Dt,k as Ot,p as kt,x as At,y as jt}from"./dist-CZNULd6Z.js";import{s as Mt}from"./arrays-BqUx5USx.js";import{n as Nt}from"./once-Haz_uxEL.js";import{i as Pt,n as Ft,t as It}from"./strings-CReV1AYG.js";import{r as Lt,t as Rt}from"./requests-C6_IaFh7.js";import{t as zt}from"./createLucideIcon-B7HeEoG2.js";import{t as Bt}from"./check-BoA6XBpj.js";import{a as Vt,r as Ht}from"./useNumberFormatter-DHJ9s6Vk.js";import{t as Ut}from"./chevron-right-CKA5zVsM.js";import{u as Wt}from"./toDate-hGYJX0Ha.js";import{t as Gt}from"./copy-BMXKNElG.js";import{A as Kt,C as qt,O as Jt,T as Yt,j as Xt,k as Zt,p as Qt,w as $t}from"./write-secret-modal-D6zoZgLY.js";import{n as en,t as tn}from"./spinner-Ck-Hgfvj.js";import{t as nn}from"./plus-C4J9gIE1.js";import{t as rn}from"./refresh-cw-Bf-rx_aV.js";import{$ as an,At as on,Bt as sn,F as cn,Ft as ln,H as un,Ht as dn,It as fn,J as pn,M as mn,Mt as hn,N as gn,Nt as _n,Ot as vn,Pt as yn,Q as bn,R as xn,Rt as Sn,S as Cn,St as wn,U as Tn,Ut as En,V as Dn,Vt as On,Z as kn,_ as An,_t as jn,bt as Mn,ct as Nn,et as Pn,g as Fn,gt as In,ht as Ln,it as Rn,jt as zn,mt as Bn,o as Vn,r as Hn,rt as Un,ut as Wn,vt as Gn,xt as Kn,z as qn}from"./input-DEbY281O.js";import{t as Jn}from"./trash-2-D_HX-0qx.js";import{t as Yn}from"./triangle-alert-MihykDYG.js";import{t as Xn}from"./badge-BSgtkC2e.js";import{t as Zn}from"./use-toast-DpWHUGuF.js";import{t as Qn}from"./useTheme-C-ri8BtY.js";import{_ as $n,a as er,c as tr,d as nr,h as rr,i as ir,l as ar,m as or,n as sr,p as cr,s as lr,u as ur}from"./VisuallyHidden-CBMDmozt.js";import{r as dr,t as fr}from"./context-Do8M9TDF.js";import{t as pr}from"./SelectionIndicator-DPl6HPLh.js";import{r as mr}from"./useDebounce-DgpSQhrP.js";import{n as hr}from"./useAsyncData-Buhk-UgR.js";import{n as gr}from"./copy-DlEomWzI.js";import{a as _r}from"./errors-DzO-nXy-.js";import{t as vr}from"./kbd-Cwh96ZBE.js";import{n as yr,r as br,t as xr}from"./alert-dmKwNsrp.js";import{n as Sr,t as Cr}from"./error-banner-Dw5YY9wq.js";import{a as wr,i as Tr,n as Er,o as Dr,r as Or,t as kr}from"./table-DmqOOjfe.js";import{t as Ar}from"./renderShortcut-X-CJUSM8.js";import{n as jr,t as Mr}from"./azure-Dcn397wY.js";import{a as Nr,i as Pr,n as Fr,r as Ir,t as Lr}from"./card-dYXwy2mo.js";var Rr=`Expected a function`;function zr(e,t,n){var r=!0,i=!0;if(typeof e!=`function`)throw TypeError(Rr);return oe(n)&&(r=`leading`in n?!!n.leading:r,i=`trailing`in n?!!n.trailing:i),ce(e,t,{leading:r,maxWait:t,trailing:i})}var Br=zt(`brain`,[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`,key:`1e3is1`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,key:`1gqd8o`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`,key:`iwvgf7`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`,key:`efp6ie`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,key:`1gq6am`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`,key:`k1g0md`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`,key:`q97ue3`}]]),Vr=zt(`circle-check-big`,[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),Hr=zt(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),Ur=zt(`flask-conical`,[[`path`,{d:`M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2`,key:`18mbvz`}],[`path`,{d:`M6.453 15h11.094`,key:`3shlmq`}],[`path`,{d:`M8.5 2h7`,key:`csnxdl`}]]),Wr=zt(`folder-cog`,[[`path`,{d:`M10.3 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.98a2 2 0 0 1 1.69.9l.66 1.2A2 2 0 0 0 12 6h8a2 2 0 0 1 2 2v3.3`,key:`128dxu`}],[`path`,{d:`m14.305 19.53.923-.382`,key:`3m78fa`}],[`path`,{d:`m15.228 16.852-.923-.383`,key:`npixar`}],[`path`,{d:`m16.852 15.228-.383-.923`,key:`5xggr7`}],[`path`,{d:`m16.852 20.772-.383.924`,key:`dpfhf9`}],[`path`,{d:`m19.148 15.228.383-.923`,key:`1reyyz`}],[`path`,{d:`m19.53 21.696-.382-.924`,key:`1goivc`}],[`path`,{d:`m20.772 16.852.924-.383`,key:`htqkph`}],[`path`,{d:`m20.772 19.148.924.383`,key:`9w9pjp`}],[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}]]),Gr=zt(`monitor`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]),Kr=zt(`plug`,[[`path`,{d:`M12 22v-5`,key:`1ega77`}],[`path`,{d:`M15 8V2`,key:`18g5xt`}],[`path`,{d:`M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z`,key:`1xoxul`}],[`path`,{d:`M9 8V2`,key:`14iosj`}]]),qr=zt(`square-check-big`,[[`path`,{d:`M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344`,key:`2acyp4`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),J=e(c(),1);function Jr(e,t){let n=(0,J.useRef)(!0),r=(0,J.useRef)(null);En(()=>(n.current=!0,()=>{n.current=!1}),[]),En(()=>{n.current?n.current=!1:(!r.current||t.some((e,t)=>!Object.is(e,r[t])))&&e(),r.current=t},t)}function Yr(e,t){let{collection:n,onLoadMore:r,scrollOffset:i=1}=e,a=(0,J.useRef)(null),o=Ln(e=>{for(let t of e)t.isIntersecting&&r&&r()});En(()=>(t.current&&(a.current=new IntersectionObserver(o,{root:cr(t?.current),rootMargin:`0px ${100*i}% ${100*i}% ${100*i}%`}),a.current.observe(t.current)),()=>{a.current&&a.current.disconnect()}),[n,t,i])}function Xr(e){let t=J.version.split(`.`);return parseInt(t[0],10)>=19?e:e?`true`:void 0}var Zr=`react-aria-clear-focus`,Qr=`react-aria-focus`,$r=500;function ei(e){let{isDisabled:t,onLongPressStart:n,onLongPressEnd:r,onLongPress:i,threshold:a=$r,accessibilityDescription:o}=e,s=(0,J.useRef)(void 0),{addGlobalListener:c,removeGlobalListener:l}=Gn(),{pressProps:u}=Tn({isDisabled:t,onPressStart(e){if(e.continuePropagation(),(e.pointerType===`mouse`||e.pointerType===`touch`)&&(n&&n({...e,type:`longpressstart`}),s.current=setTimeout(()=>{e.target.dispatchEvent(new PointerEvent(`pointercancel`,{bubbles:!0})),Sn(e.target).activeElement!==e.target&&on(e.target),i&&i({...e,type:`longpress`}),s.current=void 0},a),e.pointerType===`touch`)){let t=e=>{e.preventDefault()};c(e.target,`contextmenu`,t,{once:!0}),c(window,`pointerup`,()=>{setTimeout(()=>{l(e.target,`contextmenu`,t)},30)},{once:!0})}},onPressEnd(e){s.current&&clearTimeout(s.current),r&&(e.pointerType===`mouse`||e.pointerType===`touch`)&&r({...e,type:`longpressend`})}}),d=ur(i&&!t?o:void 0);return{longPressProps:hn(u,d)}}function ti(e,t){let n=t?.isDisabled,[r,i]=(0,J.useState)(!1);return En(()=>{if(e?.current&&!n){let t=()=>{if(e.current){let t=er(e.current,{tabbable:!0});i(!!t.nextNode())}};t();let n=new MutationObserver(t);return n.observe(e.current,{subtree:!0,childList:!0,attributes:!0,attributeFilter:[`tabIndex`,`disabled`]}),()=>{n.disconnect()}}}),!n&&r}function ni(e){let t=ai(Sn(e));t!==e&&(t&&ri(t,e),e&&ii(e,t))}function ri(e,t){e.dispatchEvent(new FocusEvent(`blur`,{relatedTarget:t})),e.dispatchEvent(new FocusEvent(`focusout`,{bubbles:!0,relatedTarget:t}))}function ii(e,t){e.dispatchEvent(new FocusEvent(`focus`,{relatedTarget:t})),e.dispatchEvent(new FocusEvent(`focusin`,{bubbles:!0,relatedTarget:t}))}function ai(e){let t=ln(e),n=t?.getAttribute(`aria-activedescendant`);return n&&e.getElementById(n)||t}function oi(e){return vn()?e.altKey:e.ctrlKey}function si(e,t){let n=`[data-key="${CSS.escape(String(t))}"]`,r=e.current?.dataset.collection;return r&&(n=`[data-collection="${CSS.escape(r)}"]${n}`),e.current?.querySelector(n)}var ci=new WeakMap;function li(e){let t=dn();return ci.set(e,t),t}function ui(e){return ci.get(e)}var di=1e3;function fi(e){let{keyboardDelegate:t,selectionManager:n,onTypeSelect:r}=e,i=(0,J.useRef)({search:``,timeout:void 0}).current;return{typeSelectProps:{onKeyDownCapture:t.getKeyForSearch?e=>{let a=pi(e.key);if(!(!a||e.ctrlKey||e.metaKey||!_n(e.currentTarget,fn(e))||i.search.length===0&&a===` `)){if(a===` `&&i.search.trim().length>0&&(e.preventDefault(),`continuePropagation`in e||e.stopPropagation()),i.search+=a,t.getKeyForSearch!=null){let e=t.getKeyForSearch(i.search,n.focusedKey);e??=t.getKeyForSearch(i.search),e!=null&&(n.setFocusedKey(e),r&&r(e))}clearTimeout(i.timeout),i.timeout=setTimeout(()=>{i.search=``},di)}}:void 0}}}function pi(e){return e.length===1||!/^[A-Z]/i.test(e)?e:``}var mi=e(K(),1);function hi(e){let{selectionManager:t,keyboardDelegate:n,ref:r,autoFocus:i=!1,shouldFocusWrap:a=!1,disallowEmptySelection:o=!1,disallowSelectAll:s=!1,escapeKeyBehavior:c=`clearSelection`,selectOnFocus:l=t.selectionBehavior===`replace`,disallowTypeAhead:u=!1,shouldUseVirtualFocus:d,allowsTabNavigation:f=!1,scrollRef:p=r,linkBehavior:m=`action`}=e,{direction:h}=fr(),g=Kn(),_=e=>{if(e.altKey&&e.key===`Tab`&&e.preventDefault(),!r.current||!_n(r.current,fn(e)))return;let i=(n,i)=>{if(n!=null){if(t.isLink(n)&&m===`selection`&&l&&!oi(e)){(0,mi.flushSync)(()=>{t.setFocusedKey(n,i)});let a=si(r,n),o=t.getItemProps(n);a&&g.open(a,e,o.href,o.routerOptions);return}if(t.setFocusedKey(n,i),t.isLink(n)&&m===`override`)return;e.shiftKey&&t.selectionMode===`multiple`?t.extendSelection(n):l&&!oi(e)&&t.replaceSelection(n)}};switch(e.key){case`ArrowDown`:if(n.getKeyBelow){let r=t.focusedKey==null?n.getFirstKey?.call(n):n.getKeyBelow?.call(n,t.focusedKey);r==null&&a&&(r=n.getFirstKey?.call(n,t.focusedKey)),r!=null&&(e.preventDefault(),i(r))}break;case`ArrowUp`:if(n.getKeyAbove){let r=t.focusedKey==null?n.getLastKey?.call(n):n.getKeyAbove?.call(n,t.focusedKey);r==null&&a&&(r=n.getLastKey?.call(n,t.focusedKey)),r!=null&&(e.preventDefault(),i(r))}break;case`ArrowLeft`:if(n.getKeyLeftOf){let r=t.focusedKey==null?null:n.getKeyLeftOf?.call(n,t.focusedKey);r==null&&a&&(r=h===`rtl`?n.getFirstKey?.call(n,t.focusedKey):n.getLastKey?.call(n,t.focusedKey)),r!=null&&(e.preventDefault(),i(r,h===`rtl`?`first`:`last`))}break;case`ArrowRight`:if(n.getKeyRightOf){let r=t.focusedKey==null?null:n.getKeyRightOf?.call(n,t.focusedKey);r==null&&a&&(r=h===`rtl`?n.getLastKey?.call(n,t.focusedKey):n.getFirstKey?.call(n,t.focusedKey)),r!=null&&(e.preventDefault(),i(r,h===`rtl`?`last`:`first`))}break;case`Home`:if(n.getFirstKey){if(t.focusedKey===null&&e.shiftKey)return;e.preventDefault();let r=n.getFirstKey(t.focusedKey,nr(e));t.setFocusedKey(r),r!=null&&(nr(e)&&e.shiftKey&&t.selectionMode===`multiple`?t.extendSelection(r):l&&t.replaceSelection(r))}break;case`End`:if(n.getLastKey){if(t.focusedKey===null&&e.shiftKey)return;e.preventDefault();let r=n.getLastKey(t.focusedKey,nr(e));t.setFocusedKey(r),r!=null&&(nr(e)&&e.shiftKey&&t.selectionMode===`multiple`?t.extendSelection(r):l&&t.replaceSelection(r))}break;case`PageDown`:if(n.getKeyPageBelow&&t.focusedKey!=null){let r=n.getKeyPageBelow(t.focusedKey);r!=null&&(e.preventDefault(),i(r))}break;case`PageUp`:if(n.getKeyPageAbove&&t.focusedKey!=null){let r=n.getKeyPageAbove(t.focusedKey);r!=null&&(e.preventDefault(),i(r))}break;case`a`:nr(e)&&t.selectionMode===`multiple`&&s!==!0&&(e.preventDefault(),t.selectAll());break;case`Escape`:c===`clearSelection`&&!o&&t.selectedKeys.size!==0&&(e.stopPropagation(),e.preventDefault(),t.clearSelection());break;case`Tab`:if(!f){if(e.shiftKey)r.current.focus();else{let e=er(r.current,{tabbable:!0}),t,n;do n=e.lastChild(),n&&(t=n);while(n);let i=ln();t&&(!yn(t)||i&&!Wn(i))&&on(t)}break}}},v=(0,J.useRef)({top:0,left:0});Bn(p,`scroll`,()=>{v.current={top:p.current?.scrollTop??0,left:p.current?.scrollLeft??0}});let y=e=>{if(t.isFocused){_n(e.currentTarget,fn(e))||t.setFocused(!1);return}if(_n(e.currentTarget,fn(e))){if(t.setFocused(!0),t.focusedKey==null){let r=e=>{e!=null&&(t.setFocusedKey(e),l&&!t.isSelected(e)&&t.replaceSelection(e))},i=e.relatedTarget;i&&e.currentTarget.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_FOLLOWING?r(t.lastSelectedKey??n.getLastKey?.call(n)):r(t.firstSelectedKey??n.getFirstKey?.call(n))}else p.current&&(p.current.scrollTop=v.current.top,p.current.scrollLeft=v.current.left);if(t.focusedKey!=null&&p.current){let e=si(r,t.focusedKey);e instanceof HTMLElement&&(!yn(e)&&!d&&on(e),qn()===`keyboard`&&ar(e,{containingElement:r.current}))}}},b=e=>{_n(e.currentTarget,e.relatedTarget)||t.setFocused(!1)},x=(0,J.useRef)(!1);Bn(r,Qr,d?e=>{let{detail:n}=e;e.stopPropagation(),t.setFocused(!0),n?.focusStrategy===`first`&&(x.current=!0)}:void 0),Jr(()=>{if(x.current){let e=n.getFirstKey?.call(n)??null;if(e==null){let e=ln();ni(r.current),ii(e,null),t.collection.size>0&&(x.current=!1)}else t.setFocusedKey(e),x.current=!1}},[t.collection]),Jr(()=>{t.collection.size>0&&(x.current=!1)},[t.focusedKey]),Bn(r,Zr,d?e=>{e.stopPropagation(),t.setFocused(!1),e.detail?.clearFocusKey&&t.setFocusedKey(null)}:void 0);let S=(0,J.useRef)(i),C=(0,J.useRef)(!1);(0,J.useEffect)(()=>{if(S.current){let e=null;i===`first`&&(e=n.getFirstKey?.call(n)??null),i===`last`&&(e=n.getLastKey?.call(n)??null);let a=t.selectedKeys;if(a.size){for(let n of a)if(t.canSelectItem(n)){e=n;break}}t.setFocused(!0),t.setFocusedKey(e),e==null&&!d&&r.current&&xn(r.current),t.collection.size>0&&(S.current=!1,C.current=!0)}});let w=(0,J.useRef)(t.focusedKey),T=(0,J.useRef)(null);(0,J.useEffect)(()=>{if(t.isFocused&&t.focusedKey!=null&&(t.focusedKey!==w.current||C.current)&&p.current&&r.current){let e=qn(),n=si(r,t.focusedKey);if(!(n instanceof HTMLElement))return;(e===`keyboard`||C.current)&&(T.current&&cancelAnimationFrame(T.current),T.current=requestAnimationFrame(()=>{p.current&&(tr(p.current,n),e!==`virtual`&&ar(n,{containingElement:r.current}))}))}!d&&t.isFocused&&t.focusedKey==null&&w.current!=null&&r.current&&xn(r.current),w.current=t.focusedKey,C.current=!1}),(0,J.useEffect)(()=>()=>{T.current&&cancelAnimationFrame(T.current)},[]),Bn(r,`react-aria-focus-scope-restore`,e=>{e.preventDefault(),t.setFocused(!0)});let E={onKeyDown:_,onFocus:y,onBlur:b,onMouseDown(e){p.current===fn(e)&&e.preventDefault()}},{typeSelectProps:D}=fi({keyboardDelegate:n,selectionManager:t});u||(E=hn(D,E));let O;d||(O=t.focusedKey==null?0:-1);let k=li(t.collection);return{collectionProps:hn(E,{tabIndex:O,"data-collection":k})}}function gi(e){let{id:t,selectionManager:n,key:r,ref:i,shouldSelectOnPressUp:a,shouldUseVirtualFocus:o,focus:s,isDisabled:c,onAction:l,allowsDifferentPressOrigin:u,linkBehavior:d=`action`}=e,f=Kn();t=dn(t);let p=e=>{if(e.pointerType===`keyboard`&&oi(e))n.toggleSelection(r);else{if(n.selectionMode===`none`)return;if(n.isLink(r)){if(d===`selection`&&i.current){let t=n.getItemProps(r);f.open(i.current,e,t.href,t.routerOptions),n.setSelectedKeys(n.selectedKeys);return}if(d===`override`||d===`none`)return}n.selectionMode===`single`?n.isSelected(r)&&!n.disallowEmptySelection?n.toggleSelection(r):n.replaceSelection(r):e&&e.shiftKey?n.extendSelection(r):n.selectionBehavior===`toggle`||e&&(nr(e)||e.pointerType===`touch`||e.pointerType===`virtual`)?n.toggleSelection(r):n.replaceSelection(r)}};(0,J.useEffect)(()=>{r===n.focusedKey&&n.isFocused&&(o?ni(i.current):s?s():ln()!==i.current&&i.current&&xn(i.current))},[i,r,n.focusedKey,n.childFocusStrategy,n.isFocused,o]),c||=n.isDisabled(r);let m={};!o&&!c?m={tabIndex:r===n.focusedKey?0:-1,onFocus(e){fn(e)===i.current&&n.setFocusedKey(r)}}:c&&(m.onMouseDown=e=>{e.preventDefault()}),(0,J.useEffect)(()=>{c&&n.focusedKey===r&&n.setFocusedKey(null)},[n,c,r]);let h=n.isLink(r)&&d===`override`,g=l&&e.UNSTABLE_itemBehavior===`action`,_=n.isLink(r)&&d!==`selection`&&d!==`none`,v=!c&&n.canSelectItem(r)&&!h&&!g,y=(l||_)&&!c,b=y&&(n.selectionBehavior===`replace`?!v:!v||n.isEmpty),x=y&&v&&n.selectionBehavior===`replace`,S=b||x,C=(0,J.useRef)(null),w=S&&v,T=(0,J.useRef)(!1),E=(0,J.useRef)(!1),D=n.getItemProps(r),O=e=>{if(l){var t;l(),(t=i.current)==null||t.dispatchEvent(new CustomEvent(`react-aria-item-action`,{bubbles:!0}))}_&&i.current&&f.open(i.current,e,D.href,D.routerOptions)},k={ref:i};if(a?(k.onPressStart=e=>{C.current=e.pointerType,T.current=w,e.pointerType===`keyboard`&&(!S||vi(e.key))&&p(e)},u?(k.onPressUp=b?void 0:e=>{e.pointerType===`mouse`&&v&&p(e)},k.onPress=b?O:e=>{e.pointerType!==`keyboard`&&e.pointerType!==`mouse`&&v&&p(e)}):k.onPress=e=>{if(b||x&&e.pointerType!==`mouse`){if(e.pointerType===`keyboard`&&!_i(e.key))return;O(e)}else e.pointerType!==`keyboard`&&v&&p(e)}):(k.onPressStart=e=>{C.current=e.pointerType,T.current=w,E.current=b,v&&(e.pointerType===`mouse`&&!b||e.pointerType===`keyboard`&&(!y||vi(e.key)))&&p(e)},k.onPress=e=>{(e.pointerType===`touch`||e.pointerType===`pen`||e.pointerType===`virtual`||e.pointerType===`keyboard`&&S&&_i(e.key)||e.pointerType===`mouse`&&E.current)&&(S?O(e):v&&p(e))}),m[`data-collection`]=ui(n.collection),m[`data-key`]=r,k.preventFocusOnPress=o,o&&(k=hn(k,{onPressStart(e){e.pointerType!==`touch`&&(n.setFocused(!0),n.setFocusedKey(r))},onPress(e){e.pointerType===`touch`&&(n.setFocused(!0),n.setFocusedKey(r))}})),D)for(let e of[`onPressStart`,`onPressEnd`,`onPressChange`,`onPress`,`onPressUp`,`onClick`])D[e]&&(k[e]=sn(k[e],D[e]));let{pressProps:A,isPressed:j}=Tn(k),M=x?e=>{C.current===`mouse`&&(e.stopPropagation(),e.preventDefault(),O(e))}:void 0,{longPressProps:N}=ei({isDisabled:!w,onLongPress(e){e.pointerType===`touch`&&(p(e),n.setSelectionBehavior(`toggle`))}}),P=e=>{C.current===`touch`&&T.current&&e.preventDefault()},F=d!==`none`&&n.isLink(r)?e=>{Mn.isOpening||e.preventDefault()}:void 0;return{itemProps:hn(m,v||b||o&&!c?A:{},w?N:{},{onDoubleClick:M,onDragStartCapture:P,onClick:F,id:t},o?{onMouseDown:e=>e.preventDefault()}:void 0),isPressed:j,isSelected:n.isSelected(r),isFocused:n.isFocused&&n.focusedKey===r,isDisabled:c,allowsSelection:v,hasAction:S}}function _i(e){return e===`Enter`}function vi(e){return e===` `}var yi=class{getItemRect(e){let t=this.ref.current;if(!t)return null;let n=e==null?null:si(this.ref,e);if(!n)return null;let r=t.getBoundingClientRect(),i=n.getBoundingClientRect();return{x:i.left-r.left-t.clientLeft+t.scrollLeft,y:i.top-r.top-t.clientTop+t.scrollTop,width:i.width,height:i.height}}getContentSize(){let e=this.ref.current;return{width:e?.scrollWidth??0,height:e?.scrollHeight??0}}getVisibleRect(){let e=this.ref.current;return{x:e?.scrollLeft??0,y:e?.scrollTop??0,width:e?.clientWidth??0,height:e?.clientHeight??0}}constructor(e){this.ref=e}},bi=class{isDisabled(e){return this.disabledBehavior===`all`&&(e.props?.isDisabled||this.disabledKeys.has(e.key))}findNextNonDisabled(e,t){let n=e;for(;n!=null;){let e=this.collection.getItem(n);if(e?.type===`item`&&!this.isDisabled(e))return n;n=t(n)}return null}getNextKey(e){let t=e;return t=this.collection.getKeyAfter(t),this.findNextNonDisabled(t,e=>this.collection.getKeyAfter(e))}getPreviousKey(e){let t=e;return t=this.collection.getKeyBefore(t),this.findNextNonDisabled(t,e=>this.collection.getKeyBefore(e))}findKey(e,t,n){let r=e,i=this.layoutDelegate.getItemRect(r);if(!i||r==null)return null;let a=i;do{if(r=t(r),r==null)break;i=this.layoutDelegate.getItemRect(r)}while(i&&n(a,i)&&r!=null);return r}isSameRow(e,t){return e.y===t.y||e.x!==t.x}isSameColumn(e,t){return e.x===t.x||e.y!==t.y}getKeyBelow(e){return this.layout===`grid`&&this.orientation===`vertical`?this.findKey(e,e=>this.getNextKey(e),this.isSameRow):this.getNextKey(e)}getKeyAbove(e){return this.layout===`grid`&&this.orientation===`vertical`?this.findKey(e,e=>this.getPreviousKey(e),this.isSameRow):this.getPreviousKey(e)}getNextColumn(e,t){return t?this.getPreviousKey(e):this.getNextKey(e)}getKeyRightOf(e){let t=this.direction===`ltr`?`getKeyRightOf`:`getKeyLeftOf`;return this.layoutDelegate[t]?(e=this.layoutDelegate[t](e),this.findNextNonDisabled(e,e=>this.layoutDelegate[t](e))):this.layout===`grid`?this.orientation===`vertical`?this.getNextColumn(e,this.direction===`rtl`):this.findKey(e,e=>this.getNextColumn(e,this.direction===`rtl`),this.isSameColumn):this.orientation===`horizontal`?this.getNextColumn(e,this.direction===`rtl`):null}getKeyLeftOf(e){let t=this.direction===`ltr`?`getKeyLeftOf`:`getKeyRightOf`;return this.layoutDelegate[t]?(e=this.layoutDelegate[t](e),this.findNextNonDisabled(e,e=>this.layoutDelegate[t](e))):this.layout===`grid`?this.orientation===`vertical`?this.getNextColumn(e,this.direction===`ltr`):this.findKey(e,e=>this.getNextColumn(e,this.direction===`ltr`),this.isSameColumn):this.orientation===`horizontal`?this.getNextColumn(e,this.direction===`ltr`):null}getFirstKey(){let e=this.collection.getFirstKey();return this.findNextNonDisabled(e,e=>this.collection.getKeyAfter(e))}getLastKey(){let e=this.collection.getLastKey();return this.findNextNonDisabled(e,e=>this.collection.getKeyBefore(e))}getKeyPageAbove(e){let t=this.ref.current,n=this.layoutDelegate.getItemRect(e);if(!n)return null;if(t&&!or(t))return this.getFirstKey();let r=e;if(this.orientation===`horizontal`){let e=Math.max(0,n.x+n.width-this.layoutDelegate.getVisibleRect().width);for(;n&&n.x>e&&r!=null;)r=this.getKeyAbove(r),n=r==null?null:this.layoutDelegate.getItemRect(r)}else{let e=Math.max(0,n.y+n.height-this.layoutDelegate.getVisibleRect().height);for(;n&&n.y>e&&r!=null;)r=this.getKeyAbove(r),n=r==null?null:this.layoutDelegate.getItemRect(r)}return r??this.getFirstKey()}getKeyPageBelow(e){let t=this.ref.current,n=this.layoutDelegate.getItemRect(e);if(!n)return null;if(t&&!or(t))return this.getLastKey();let r=e;if(this.orientation===`horizontal`){let e=Math.min(this.layoutDelegate.getContentSize().width,n.y-n.width+this.layoutDelegate.getVisibleRect().width);for(;n&&n.x<e&&r!=null;)r=this.getKeyBelow(r),n=r==null?null:this.layoutDelegate.getItemRect(r)}else{let e=Math.min(this.layoutDelegate.getContentSize().height,n.y-n.height+this.layoutDelegate.getVisibleRect().height);for(;n&&n.y<e&&r!=null;)r=this.getKeyBelow(r),n=r==null?null:this.layoutDelegate.getItemRect(r)}return r??this.getLastKey()}getKeyForSearch(e,t){if(!this.collator)return null;let n=this.collection,r=t||this.getFirstKey();for(;r!=null;){let t=n.getItem(r);if(!t)return null;let i=t.textValue.slice(0,e.length);if(t.textValue&&this.collator.compare(i,e)===0)return r;r=this.getNextKey(r)}return null}constructor(...e){if(e.length===1){let t=e[0];this.collection=t.collection,this.ref=t.ref,this.collator=t.collator,this.disabledKeys=t.disabledKeys||new Set,this.disabledBehavior=t.disabledBehavior||`all`,this.orientation=t.orientation||`vertical`,this.direction=t.direction,this.layout=t.layout||`stack`,this.layoutDelegate=t.layoutDelegate||new yi(t.ref)}else this.collection=e[0],this.disabledKeys=e[1],this.ref=e[2],this.collator=e[3],this.layout=`stack`,this.orientation=`vertical`,this.disabledBehavior=`all`,this.layoutDelegate=new yi(this.ref);this.layout===`stack`&&this.orientation===`vertical`&&(this.getKeyLeftOf=void 0,this.getKeyRightOf=void 0)}};function xi(e){let{selectionManager:t,collection:n,disabledKeys:r,ref:i,keyboardDelegate:a,layoutDelegate:o}=e,s=lr({usage:`search`,sensitivity:`base`}),c=t.disabledBehavior,l=(0,J.useMemo)(()=>a||new bi({collection:n,disabledKeys:r,disabledBehavior:c,ref:i,collator:s,layoutDelegate:o}),[a,o,n,r,i,s,c]),{collectionProps:u}=hi({...e,ref:i,selectionManager:t,keyboardDelegate:l});return{listProps:u}}var Si=class{build(e,t){return this.context=t,Ci(()=>this.iterateCollection(e))}*iterateCollection(e){let{children:t,items:n}=e;if(J.isValidElement(t)&&t.type===J.Fragment)yield*this.iterateCollection({children:t.props.children,items:n});else if(typeof t==`function`){if(!n)throw Error(`props.children was a function but props.items is missing`);let e=0;for(let r of n)yield*this.getFullNode({value:r,index:e},{renderer:t}),e++}else{let e=[];J.Children.forEach(t,t=>{t&&e.push(t)});let n=0;for(let t of e){let e=this.getFullNode({element:t,index:n},{});for(let t of e)n++,yield t}}}getKey(e,t,n,r){if(e.key!=null)return e.key;if(t.type===`cell`&&t.key!=null)return`${r}${t.key}`;let i=t.value;if(i!=null){let e=i.key??i.id;if(e==null)throw Error(`No key found for item`);return e}return r?`${r}.${t.index}`:`$.${t.index}`}getChildState(e,t){return{renderer:t.renderer||e.renderer}}*getFullNode(e,t,n,r){if(J.isValidElement(e.element)&&e.element.type===J.Fragment){let i=[];J.Children.forEach(e.element.props.children,e=>{i.push(e)});let a=e.index??0;for(let e of i)yield*this.getFullNode({element:e,index:a++},t,n,r);return}let i=e.element;if(!i&&e.value&&t&&t.renderer){let n=this.cache.get(e.value);if(n&&(!n.shouldInvalidate||!n.shouldInvalidate(this.context))){n.index=e.index,n.parentKey=r?r.key:null,yield n;return}i=t.renderer(e.value)}if(J.isValidElement(i)){let a=i.type;if(typeof a!=`function`&&typeof a.getCollectionNode!=`function`){let e=i.type;throw Error(`Unknown element <${e}> in collection.`)}let o=a.getCollectionNode(i.props,this.context),s=e.index??0,c=o.next();for(;!c.done&&c.value;){let a=c.value;e.index=s;let l=a.key??null;l??=a.element?null:this.getKey(i,e,t,n);let u=[...this.getFullNode({...a,key:l,index:s,wrapper:wi(e.wrapper,a.wrapper)},this.getChildState(t,a),n?`${n}${i.key}`:i.key,r)];for(let t of u){if(t.value=a.value??e.value??null,t.value&&this.cache.set(t.value,t),e.type&&t.type!==e.type)throw Error(`Unsupported type <${Ti(t.type)}> in <${Ti(r?.type??`unknown parent type`)}>. Only <${Ti(e.type)}> is supported.`);s++,yield t}c=o.next(u)}return}if(e.key==null||e.type==null)return;let a=this,o={type:e.type,props:e.props,key:e.key,parentKey:r?r.key:null,value:e.value??null,level:r?r.level+1:0,index:e.index,rendered:e.rendered,textValue:e.textValue??``,"aria-label":e[`aria-label`],wrapper:e.wrapper,shouldInvalidate:e.shouldInvalidate,hasChildNodes:e.hasChildNodes||!1,childNodes:Ci(function*(){if(!e.hasChildNodes||!e.childNodes)return;let n=0;for(let r of e.childNodes()){r.key!=null&&(r.key=`${o.key}${r.key}`);let e=a.getFullNode({...r,index:n},a.getChildState(t,r),o.key,o);for(let t of e)n++,yield t}})};yield o}constructor(){this.cache=new WeakMap}};function Ci(e){let t=[],n=null;return{*[Symbol.iterator](){for(let e of t)yield e;n||=e();for(let e of n)t.push(e),yield e}}}function wi(e,t){if(e&&t)return n=>e(t(n));if(e)return e;if(t)return t}function Ti(e){return e[0].toUpperCase()+e.slice(1)}function Ei(e,t,n){let r=(0,J.useMemo)(()=>new Si,[]),{children:i,items:a,collection:o}=e;return(0,J.useMemo)(()=>o||t(r.build({children:i,items:a},n)),[r,i,a,o,n,t])}function Di(e,t){return typeof t.getChildren==`function`?t.getChildren(e.key):e.childNodes}function Oi(e){return ki(e,0)}function ki(e,t){if(t<0)return;let n=0;for(let r of e){if(n===t)return r;n++}}function Ai(e,t,n){if(t.parentKey===n.parentKey)return t.index-n.index;let r=[...ji(e,t),t],i=[...ji(e,n),n],a=r.slice(0,i.length).findIndex((e,t)=>e!==i[t]);return a===-1?r.findIndex(e=>e===n)>=0?1:(i.findIndex(e=>e===t),-1):(t=r[a],n=i[a],t.index-n.index)}function ji(e,t){let n=[],r=t;for(;r?.parentKey!=null;)r=e.getItem(r.parentKey),r&&n.unshift(r);return n}var Mi=class{get childNodes(){throw Error(`childNodes is not supported`)}clone(){let e=new this.constructor(this.key);return e.value=this.value,e.level=this.level,e.hasChildNodes=this.hasChildNodes,e.rendered=this.rendered,e.textValue=this.textValue,e[`aria-label`]=this[`aria-label`],e.index=this.index,e.parentKey=this.parentKey,e.prevKey=this.prevKey,e.nextKey=this.nextKey,e.firstChildKey=this.firstChildKey,e.lastChildKey=this.lastChildKey,e.props=this.props,e.render=this.render,e.colSpan=this.colSpan,e.colIndex=this.colIndex,e}filter(e,t,n){let r=this.clone();return t.addDescendants(r,e),r}constructor(e){this.value=null,this.level=0,this.hasChildNodes=!1,this.rendered=null,this.textValue=``,this[`aria-label`]=void 0,this.index=0,this.parentKey=null,this.prevKey=null,this.nextKey=null,this.firstChildKey=null,this.lastChildKey=null,this.props={},this.colSpan=null,this.colIndex=null,this.type=this.constructor.type,this.key=e}},Ni=class extends Mi{filter(e,t,n){let[r,i]=zi(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}},Pi=class extends Mi{};Pi.type=`header`;var Fi=class extends Mi{};Fi.type=`loader`;var Ii=class extends Ni{filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};Ii.type=`item`;var Li=class extends Ni{filter(e,t,n){let r=super.filter(e,t,n);if(r&&r.lastChildKey!==null){let t=e.getItem(r.lastChildKey);if(t&&t.type!==`header`)return r}return null}};Li.type=`section`;var Ri=class{get size(){return this.itemCount}getKeys(){return this.keyMap.keys()}*[Symbol.iterator](){let e=this.firstKey==null?void 0:this.keyMap.get(this.firstKey);for(;e;)yield e,e=e.nextKey==null?void 0:this.keyMap.get(e.nextKey)}getChildren(e){let t=this.keyMap;return{*[Symbol.iterator](){let n=t.get(e),r=n?.firstChildKey==null?null:t.get(n.firstChildKey);for(;r;)yield r,r=r.nextKey==null?void 0:t.get(r.nextKey)}}}getKeyBefore(e){let t=this.keyMap.get(e);if(!t)return null;if(t.prevKey!=null){for(t=this.keyMap.get(t.prevKey);t&&t.type!==`item`&&t.lastChildKey!=null;)t=this.keyMap.get(t.lastChildKey);return t?.key??null}return t.parentKey}getKeyAfter(e){let t=this.keyMap.get(e);if(!t)return null;if(t.type!==`item`&&t.firstChildKey!=null)return t.firstChildKey;for(;t;){if(t.nextKey!=null)return t.nextKey;if(t.parentKey!=null)t=this.keyMap.get(t.parentKey);else return null}return null}getFirstKey(){return this.firstKey}getLastKey(){let e=this.lastKey==null?null:this.keyMap.get(this.lastKey);for(;e?.lastChildKey!=null;)e=this.keyMap.get(e.lastChildKey);return e?.key??null}getItem(e){return this.keyMap.get(e)??null}at(){throw Error(`Not implemented`)}clone(){let e=this.constructor,t=new e;return t.keyMap=new Map(this.keyMap),t.firstKey=this.firstKey,t.lastKey=this.lastKey,t.itemCount=this.itemCount,t}addNode(e){if(this.frozen)throw Error(`Cannot add a node to a frozen collection`);e.type===`item`&&this.keyMap.get(e.key)==null&&this.itemCount++,this.keyMap.set(e.key,e)}addDescendants(e,t){this.addNode(e);let n=t.getChildren(e.key);for(let e of n)this.addDescendants(e,t)}removeNode(e){if(this.frozen)throw Error(`Cannot remove a node to a frozen collection`);let t=this.keyMap.get(e);t!=null&&t.type===`item`&&this.itemCount--,this.keyMap.delete(e)}commit(e,t,n=!1){if(this.frozen)throw Error(`Cannot commit a frozen collection`);this.firstKey=e,this.lastKey=t,this.frozen=!n}filter(e){let t=new this.constructor,[n,r]=zi(this,t,this.firstKey,e);return t?.commit(n,r),t}constructor(){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.frozen=!1,this.itemCount=0}};function zi(e,t,n,r){if(n==null)return[null,null];let i=null,a=null,o=e.getItem(n);for(;o!=null;){let n=o.filter(e,t,r);n!=null&&(n.nextKey=null,a&&(n.prevKey=a.key,a.nextKey=n.key),i??=n,t.addNode(n),a=n),o=o.nextKey?e.getItem(o.nextKey):null}if(a&&a.type===`separator`){let e=a.prevKey;t.removeNode(a.key),e?(a=t.getItem(e),a.nextKey=null):a=null}return[i?.key??null,a?.key??null]}var Bi=class{*[Symbol.iterator](){let e=this.firstChild;for(;e;)yield e,e=e.nextSibling}get firstChild(){return this._firstChild}set firstChild(e){this._firstChild=e,this.ownerDocument.markDirty(this)}get lastChild(){return this._lastChild}set lastChild(e){this._lastChild=e,this.ownerDocument.markDirty(this)}get previousSibling(){return this._previousSibling}set previousSibling(e){this._previousSibling=e,this.ownerDocument.markDirty(this)}get nextSibling(){return this._nextSibling}set nextSibling(e){this._nextSibling=e,this.ownerDocument.markDirty(this)}get parentNode(){return this._parentNode}set parentNode(e){this._parentNode=e,this.ownerDocument.markDirty(this)}get isConnected(){return this.parentNode?.isConnected||!1}invalidateChildIndices(e){(this._minInvalidChildIndex==null||!this._minInvalidChildIndex.isConnected||e.index<this._minInvalidChildIndex.index)&&(this._minInvalidChildIndex=e,this.ownerDocument.markDirty(this))}updateChildIndices(){let e=this._minInvalidChildIndex;for(;e;)e.index=e.previousSibling?e.previousSibling.index+1:0,e=e.nextSibling;this._minInvalidChildIndex=null}appendChild(e){e.parentNode&&e.parentNode.removeChild(e),this.firstChild??=e,this.lastChild?(this.lastChild.nextSibling=e,e.index=this.lastChild.index+1,e.previousSibling=this.lastChild):(e.previousSibling=null,e.index=0),e.parentNode=this,e.nextSibling=null,this.lastChild=e,this.ownerDocument.markDirty(this),this.isConnected&&this.ownerDocument.queueUpdate()}insertBefore(e,t){if(t==null)return this.appendChild(e);e.parentNode&&e.parentNode.removeChild(e),e.nextSibling=t,e.previousSibling=t.previousSibling,e.index=t.index-1,this.firstChild===t?this.firstChild=e:t.previousSibling&&(t.previousSibling.nextSibling=e),t.previousSibling=e,e.parentNode=t.parentNode,this.invalidateChildIndices(e),this.isConnected&&this.ownerDocument.queueUpdate()}removeChild(e){e.parentNode===this&&(this._minInvalidChildIndex===e&&(this._minInvalidChildIndex=null),e.nextSibling&&(this.invalidateChildIndices(e.nextSibling),e.nextSibling.previousSibling=e.previousSibling),e.previousSibling&&(e.previousSibling.nextSibling=e.nextSibling),this.firstChild===e&&(this.firstChild=e.nextSibling),this.lastChild===e&&(this.lastChild=e.previousSibling),e.parentNode=null,e.nextSibling=null,e.previousSibling=null,e.index=0,this.ownerDocument.markDirty(e),this.isConnected&&this.ownerDocument.queueUpdate())}addEventListener(){}removeEventListener(){}get previousVisibleSibling(){let e=this.previousSibling;for(;e&&e.isHidden;)e=e.previousSibling;return e}get nextVisibleSibling(){let e=this.nextSibling;for(;e&&e.isHidden;)e=e.nextSibling;return e}get firstVisibleChild(){let e=this.firstChild;for(;e&&e.isHidden;)e=e.nextSibling;return e}get lastVisibleChild(){let e=this.lastChild;for(;e&&e.isHidden;)e=e.previousSibling;return e}constructor(e){this._firstChild=null,this._lastChild=null,this._previousSibling=null,this._nextSibling=null,this._parentNode=null,this._minInvalidChildIndex=null,this.ownerDocument=e}},Vi=class e extends Bi{get index(){return this._index}set index(e){this._index=e,this.ownerDocument.markDirty(this)}get level(){return this.parentNode instanceof e?this.parentNode.level+ +(this.parentNode.node?.type===`item`):0}getMutableNode(){return this.node==null?null:(this.isMutated||=(this.node=this.node.clone(),!0),this.ownerDocument.markDirty(this),this.node)}updateNode(){let t=this.nextVisibleSibling,n=this.getMutableNode();if(n!=null&&(n.index=this.index,n.level=this.level,n.parentKey=this.parentNode instanceof e?this.parentNode.node?.key??null:null,n.prevKey=this.previousVisibleSibling?.node?.key??null,n.nextKey=t?.node?.key??null,n.hasChildNodes=!!this.firstChild,n.firstChildKey=this.firstVisibleChild?.node?.key??null,n.lastChildKey=this.lastVisibleChild?.node?.key??null,(n.colSpan!=null||n.colIndex!=null)&&t)){let e=(n.colIndex??n.index)+(n.colSpan??1);if(t.node!=null&&e!==t.node.colIndex){let n=t.getMutableNode();n.colIndex=e}}}setProps(e,t,n,r,i){let a,{value:o,textValue:s,id:c,...l}=e;if(this.node==null?(a=new n(c??`react-aria-${++this.ownerDocument.nodeId}`),this.node=a):a=this.getMutableNode(),l.ref=t,a.props=l,a.rendered=r,a.render=i,a.value=o,e[`aria-label`]&&(a[`aria-label`]=e[`aria-label`]),a.textValue=s||(typeof l.children==`string`?l.children:``)||e[`aria-label`]||``,c!=null&&c!==a.key)throw Error(`Cannot change the id of an item`);l.colSpan!=null&&(a.colSpan=l.colSpan),this.isConnected&&this.ownerDocument.queueUpdate()}get style(){let e=this;return{get display(){return e.isHidden?`none`:``},set display(t){let n=t===`none`;if(e.isHidden!==n){(e.parentNode?.firstVisibleChild===e||e.parentNode?.lastVisibleChild===e)&&e.ownerDocument.markDirty(e.parentNode);let t=e.previousVisibleSibling,r=e.nextVisibleSibling;t&&e.ownerDocument.markDirty(t),r&&e.ownerDocument.markDirty(r),e.isHidden=n,e.ownerDocument.markDirty(e)}}}}hasAttribute(){}setAttribute(){}setAttributeNS(){}removeAttribute(){}constructor(e,t){super(t),this.nodeType=8,this.isMutated=!0,this._index=0,this.isHidden=!1,this.node=null}},Hi=class extends Bi{get isConnected(){return!0}createElement(e){return new Vi(e,this)}getMutableCollection(){return this.nextCollection||=this.collection.clone(),this.nextCollection}markDirty(e){this.dirtyNodes.add(e)}addNode(e){if(e.isHidden||e.node==null)return;let t=this.getMutableCollection();if(!t.getItem(e.node.key))for(let t of e)this.addNode(t);t.addNode(e.node)}removeNode(e){for(let t of e)this.removeNode(t);e.node&&this.getMutableCollection().removeNode(e.node.key)}getCollection(){return this.inSubscription?this.collection:(this.queuedRender=!1,this.updateCollection(),this.collection)}updateCollection(){for(let e of this.dirtyNodes)e instanceof Vi&&(!e.isConnected||e.isHidden)?this.removeNode(e):e.updateChildIndices();for(let e of this.dirtyNodes)e instanceof Vi?(e.isConnected&&!e.isHidden&&(e.updateNode(),this.addNode(e)),e.node&&this.dirtyNodes.delete(e),e.isMutated=!1):this.dirtyNodes.delete(e);this.nextCollection&&(this.nextCollection.commit(this.firstVisibleChild?.node?.key??null,this.lastVisibleChild?.node?.key??null,this.isSSR),this.isSSR||(this.collection=this.nextCollection,this.nextCollection=null))}queueUpdate(){if(!(this.dirtyNodes.size===0||this.queuedRender)){this.queuedRender=!0,this.inSubscription=!0,this.isSSR||(this.collection=this.collection.clone());for(let e of this.subscriptions)e();this.inSubscription=!1}}subscribe(e){return this.subscriptions.add(e),()=>this.subscriptions.delete(e)}resetAfterSSR(){this.isSSR&&(this.isSSR=!1,this.firstChild=null,this.lastChild=null,this.nodeId=0)}constructor(e){super(null),this.nodeType=11,this.ownerDocument=this,this.dirtyNodes=new Set,this.isSSR=!1,this.nodeId=0,this.nodesByProps=new WeakMap,this.nextCollection=null,this.subscriptions=new Set,this.queuedRender=!1,this.inSubscription=!1,this.collection=e,this.nextCollection=e}};function Ui(e){let{children:t,items:n,idScope:r,addIdAndValue:i,dependencies:a=[]}=e,o=(0,J.useMemo)(()=>new WeakMap,a);return(0,J.useMemo)(()=>{if(n&&typeof t==`function`){let e=[];for(let a of n){let n=o.get(a);if(!n){n=t(a);let e=n.props.id??a.key??a.id;if(e==null)throw Error(`Could not determine key for item`);r!=null&&(e=r+`:`+e),n=(0,J.cloneElement)(n,i?{key:e,id:e,value:a}:{key:e}),o.set(a,n)}e.push(n)}return e}if(typeof t!=`function`)return t},[t,n,o,r,i])}var Wi=Ue(),Gi=(0,J.createContext)(!1),Ki=(0,J.createContext)(null);function qi(e){if((0,J.useContext)(Ki))return e.content;let{collection:t,document:n}=Zi(e.createCollection);return J.createElement(J.Fragment,null,J.createElement(Cn,null,J.createElement(Ki.Provider,{value:n},e.content)),J.createElement(Ji,{render:e.children,collection:t}))}function Ji({collection:e,render:t}){return t(e)}function Yi(e,t,n){let r=dr(),i=(0,J.useRef)(r);i.current=r;let a=(0,J.useCallback)(()=>i.current?n():t(),[t,n]);return(0,Wi.useSyncExternalStore)(e,a)}var Xi=typeof J.useSyncExternalStore==`function`?J.useSyncExternalStore:Yi;function Zi(e){let[t]=(0,J.useState)(()=>new Hi(e?.()||new Ri));return{collection:Xi((0,J.useCallback)(e=>t.subscribe(e),[t]),(0,J.useCallback)(()=>{let e=t.getCollection();return t.isSSR&&t.resetAfterSSR(),e},[t]),(0,J.useCallback)(()=>(t.isSSR=!0,t.getCollection()),[t])),document:t}}var Qi=(0,J.createContext)(null);function $i(e){var t;return t=class extends Mi{},t.type=e,t}function ea(e,t,n,r,i,a){typeof e==`string`&&(e=$i(e));let o=(0,J.useCallback)(i=>{i?.setProps(t,n,e,r,a)},[t,n,r,a,e]),s=(0,J.useContext)(Qi);if(s){let o=s.ownerDocument.nodesByProps.get(t);return o||(o=s.ownerDocument.createElement(e.type),o.setProps(t,n,e,r,a),s.appendChild(o),s.ownerDocument.updateCollection(),s.ownerDocument.nodesByProps.set(t,o)),i?J.createElement(Qi.Provider,{value:o},i):null}return J.createElement(e.type,{ref:o},i)}function ta(e,t){let n=({node:e})=>t(e.props,e.props.ref,e),r=(0,J.forwardRef)((r,i)=>{let a=(0,J.useContext)(cn);if(!(0,J.useContext)(Gi)){if(t.length>=3)throw Error(t.name+` cannot be rendered outside a collection.`);return t(r,i)}return ea(e,r,i,`children`in r?r.children:null,null,e=>J.createElement(cn.Provider,{value:a},J.createElement(n,{node:e})))});return r.displayName=t.name,r}function na(e,t,n=ra){let r=({node:e})=>t(e.props,e.props.ref,e),i=(0,J.forwardRef)((t,i)=>ea(e,t,i,null,n(t),e=>J.createElement(r,{node:e}))??J.createElement(J.Fragment,null));return i.displayName=t.name,i}function ra(e){return Ui({...e,addIdAndValue:!0})}var ia=(0,J.createContext)(null);function aa(e){let t=(0,J.useContext)(ia),n=(t?.dependencies||[]).concat(e.dependencies),r=e.idScope??t?.idScope,i=ra({...e,idScope:r,dependencies:n});return(0,J.useContext)(Ki)&&(i=J.createElement(oa,null,i)),t=(0,J.useMemo)(()=>({dependencies:n,idScope:r}),[r,...n]),J.createElement(ia.Provider,{value:t},i)}function oa({children:e}){let t=(0,J.useContext)(Ki),n=(0,J.useMemo)(()=>J.createElement(Ki.Provider,{value:null},J.createElement(Gi.Provider,{value:!0},e)),[e]);return dr()?J.createElement(Qi.Provider,{value:t},n):(0,mi.createPortal)(n,t)}var sa=(0,J.createContext)(null),ca={CollectionRoot({collection:e,renderDropIndicator:t}){return la(e,null,t)},CollectionBranch({collection:e,parent:t,renderDropIndicator:n}){return la(e,t,n)}};function la(e,t,n){return Ui({items:t?e.getChildren(t.key):e,dependencies:[n],children(t){if(t.type===`content`)return J.createElement(J.Fragment,null);let r=t.render(t);return!n||t.type!==`item`?r:J.createElement(J.Fragment,null,n({type:`item`,key:t.key,dropPosition:`before`}),r,ua(e,t,n))}})}function ua(e,t,n){let r=t.key,i=e.getKeyAfter(r),a=i==null?null:e.getItem(i);for(;a!=null&&a.type!==`item`;)i=e.getKeyAfter(a.key),a=i==null?null:e.getItem(i);let o=t.nextKey==null?null:e.getItem(t.nextKey);for(;o!=null&&o.type!==`item`;)o=o.nextKey==null?null:e.getItem(o.nextKey);let s=[];if(o==null){let r=t;for(;r?.type===`item`&&(!a||r.parentKey!==a.parentKey&&a.level<r.level);){let t=n({type:`item`,key:r.key,dropPosition:`after`});(0,J.isValidElement)(t)&&s.push((0,J.cloneElement)(t,{key:`${r.key}-after`})),r=r.parentKey==null?null:e.getItem(r.parentKey)}}return s}var da=(0,J.createContext)(ca),fa=new WeakMap;function pa(e,t){let{id:n}=fa.get(e)??{};if(!n)throw Error(`Unknown list`);return`${n}-${ma(t)}`}function ma(e){return typeof e==`string`?e.replace(/\s*/g,``):``+e}var ha={};ha={deselectedItem:e=>`${e.item} \u{63A}\u{64A}\u{631} \u{627}\u{644}\u{645}\u{62D}\u{62F}\u{62F}`,longPressToSelect:`اضغط مطولًا للدخول إلى وضع التحديد.`,select:`تحديد`,selectedAll:`جميع العناصر المحددة.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`لم يتم تحديد عناصر`,one:()=>`${t.number(e.count)} \u{639}\u{646}\u{635}\u{631} \u{645}\u{62D}\u{62F}\u{62F}`,other:()=>`${t.number(e.count)} \u{639}\u{646}\u{635}\u{631} \u{645}\u{62D}\u{62F}\u{62F}`})}.`,selectedItem:e=>`${e.item} \u{627}\u{644}\u{645}\u{62D}\u{62F}\u{62F}`};var ga={};ga={deselectedItem:e=>`${e.item} \u{43D}\u{435} \u{435} \u{438}\u{437}\u{431}\u{440}\u{430}\u{43D}.`,longPressToSelect:`Натиснете и задръжте за да влезете в избирателен режим.`,select:`Изберете`,selectedAll:`Всички елементи са избрани.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Няма избрани елементи`,one:()=>`${t.number(e.count)} \u{438}\u{437}\u{431}\u{440}\u{430}\u{43D} \u{435}\u{43B}\u{435}\u{43C}\u{435}\u{43D}\u{442}`,other:()=>`${t.number(e.count)} \u{438}\u{437}\u{431}\u{440}\u{430}\u{43D}\u{438} \u{435}\u{43B}\u{435}\u{43C}\u{435}\u{43D}\u{442}\u{438}`})}.`,selectedItem:e=>`${e.item} \u{438}\u{437}\u{431}\u{440}\u{430}\u{43D}.`};var _a={};_a={deselectedItem:e=>`Polo\u{17E}ka ${e.item} nen\xed vybr\xe1na.`,longPressToSelect:`Dlouhým stisknutím přejdete do režimu výběru.`,select:`Vybrat`,selectedAll:`Vybrány všechny položky.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Nevybrány žádné položky`,one:()=>`Vybr\xe1na ${t.number(e.count)} polo\u{17E}ka`,other:()=>`Vybr\xe1no ${t.number(e.count)} polo\u{17E}ek`})}.`,selectedItem:e=>`Vybr\xe1na polo\u{17E}ka ${e.item}.`};var va={};va={deselectedItem:e=>`${e.item} ikke valgt.`,longPressToSelect:`Lav et langt tryk for at aktivere valgtilstand.`,select:`Vælg`,selectedAll:`Alle elementer valgt.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Ingen elementer valgt`,one:()=>`${t.number(e.count)} element valgt`,other:()=>`${t.number(e.count)} elementer valgt`})}.`,selectedItem:e=>`${e.item} valgt.`};var ya={};ya={deselectedItem:e=>`${e.item} nicht ausgew\xe4hlt.`,longPressToSelect:`Gedrückt halten, um Auswahlmodus zu öffnen.`,select:`Auswählen`,selectedAll:`Alle Elemente ausgewählt.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Keine Elemente ausgewählt`,one:()=>`${t.number(e.count)} Element ausgew\xe4hlt`,other:()=>`${t.number(e.count)} Elemente ausgew\xe4hlt`})}.`,selectedItem:e=>`${e.item} ausgew\xe4hlt.`};var ba={};ba={deselectedItem:e=>`\u{394}\u{3B5}\u{3BD} \u{3B5}\u{3C0}\u{3B9}\u{3BB}\u{3AD}\u{3C7}\u{3B8}\u{3B7}\u{3BA}\u{3B5} \u{3C4}\u{3BF} \u{3C3}\u{3C4}\u{3BF}\u{3B9}\u{3C7}\u{3B5}\u{3AF}\u{3BF} ${e.item}.`,longPressToSelect:`Πατήστε παρατεταμένα για να μπείτε σε λειτουργία επιλογής.`,select:`Επιλογή`,selectedAll:`Επιλέχθηκαν όλα τα στοιχεία.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Δεν επιλέχθηκαν στοιχεία`,one:()=>`\u{395}\u{3C0}\u{3B9}\u{3BB}\u{3AD}\u{3C7}\u{3B8}\u{3B7}\u{3BA}\u{3B5} ${t.number(e.count)} \u{3C3}\u{3C4}\u{3BF}\u{3B9}\u{3C7}\u{3B5}\u{3AF}\u{3BF}`,other:()=>`\u{395}\u{3C0}\u{3B9}\u{3BB}\u{3AD}\u{3C7}\u{3B8}\u{3B7}\u{3BA}\u{3B1}\u{3BD} ${t.number(e.count)} \u{3C3}\u{3C4}\u{3BF}\u{3B9}\u{3C7}\u{3B5}\u{3AF}\u{3B1}`})}.`,selectedItem:e=>`\u{395}\u{3C0}\u{3B9}\u{3BB}\u{3AD}\u{3C7}\u{3B8}\u{3B7}\u{3BA}\u{3B5} \u{3C4}\u{3BF} \u{3C3}\u{3C4}\u{3BF}\u{3B9}\u{3C7}\u{3B5}\u{3AF}\u{3BF} ${e.item}.`};var xa={};xa={deselectedItem:e=>`${e.item} not selected.`,select:`Select`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`No items selected`,one:()=>`${t.number(e.count)} item selected`,other:()=>`${t.number(e.count)} items selected`})}.`,selectedAll:`All items selected.`,selectedItem:e=>`${e.item} selected.`,longPressToSelect:`Long press to enter selection mode.`};var Sa={};Sa={deselectedItem:e=>`${e.item} no seleccionado.`,longPressToSelect:`Mantenga pulsado para abrir el modo de selección.`,select:`Seleccionar`,selectedAll:`Todos los elementos seleccionados.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Ningún elemento seleccionado`,one:()=>`${t.number(e.count)} elemento seleccionado`,other:()=>`${t.number(e.count)} elementos seleccionados`})}.`,selectedItem:e=>`${e.item} seleccionado.`};var Ca={};Ca={deselectedItem:e=>`${e.item} pole valitud.`,longPressToSelect:`Valikurežiimi sisenemiseks vajutage pikalt.`,select:`Vali`,selectedAll:`Kõik üksused valitud.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Üksusi pole valitud`,one:()=>`${t.number(e.count)} \xfcksus valitud`,other:()=>`${t.number(e.count)} \xfcksust valitud`})}.`,selectedItem:e=>`${e.item} valitud.`};var wa={};wa={deselectedItem:e=>`Kohdetta ${e.item} ei valittu.`,longPressToSelect:`Siirry valintatilaan painamalla pitkään.`,select:`Valitse`,selectedAll:`Kaikki kohteet valittu.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Ei yhtään kohdetta valittu`,one:()=>`${t.number(e.count)} kohde valittu`,other:()=>`${t.number(e.count)} kohdetta valittu`})}.`,selectedItem:e=>`${e.item} valittu.`};var Ta={};Ta={deselectedItem:e=>`${e.item} non s\xe9lectionn\xe9.`,longPressToSelect:`Appuyez de manière prolongée pour passer en mode de sélection.`,select:`Sélectionner`,selectedAll:`Tous les éléments sélectionnés.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Aucun élément sélectionné`,one:()=>`${t.number(e.count)} \xe9l\xe9ment s\xe9lectionn\xe9`,other:()=>`${t.number(e.count)} \xe9l\xe9ments s\xe9lectionn\xe9s`})}.`,selectedItem:e=>`${e.item} s\xe9lectionn\xe9.`};var Ea={};Ea={deselectedItem:e=>`${e.item} \u{5DC}\u{5D0} \u{5E0}\u{5D1}\u{5D7}\u{5E8}.`,longPressToSelect:`הקשה ארוכה לכניסה למצב בחירה.`,select:`בחר`,selectedAll:`כל הפריטים נבחרו.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`לא נבחרו פריטים`,one:()=>`\u{5E4}\u{5E8}\u{5D9}\u{5D8} ${t.number(e.count)} \u{5E0}\u{5D1}\u{5D7}\u{5E8}`,other:()=>`${t.number(e.count)} \u{5E4}\u{5E8}\u{5D9}\u{5D8}\u{5D9}\u{5DD} \u{5E0}\u{5D1}\u{5D7}\u{5E8}\u{5D5}`})}.`,selectedItem:e=>`${e.item} \u{5E0}\u{5D1}\u{5D7}\u{5E8}.`};var Da={};Da={deselectedItem:e=>`Stavka ${e.item} nije odabrana.`,longPressToSelect:`Dugo pritisnite za ulazak u način odabira.`,select:`Odaberite`,selectedAll:`Odabrane su sve stavke.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Nije odabrana nijedna stavka`,one:()=>`Odabrana je ${t.number(e.count)} stavka`,other:()=>`Odabrano je ${t.number(e.count)} stavki`})}.`,selectedItem:e=>`Stavka ${e.item} je odabrana.`};var Oa={};Oa={deselectedItem:e=>`${e.item} nincs kijel\xf6lve.`,longPressToSelect:`Nyomja hosszan a kijelöléshez.`,select:`Kijelölés`,selectedAll:`Az összes elem kijelölve.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Egy elem sincs kijelölve`,one:()=>`${t.number(e.count)} elem kijel\xf6lve`,other:()=>`${t.number(e.count)} elem kijel\xf6lve`})}.`,selectedItem:e=>`${e.item} kijel\xf6lve.`};var ka={};ka={deselectedItem:e=>`${e.item} non selezionato.`,longPressToSelect:`Premi a lungo per passare alla modalità di selezione.`,select:`Seleziona`,selectedAll:`Tutti gli elementi selezionati.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Nessun elemento selezionato`,one:()=>`${t.number(e.count)} elemento selezionato`,other:()=>`${t.number(e.count)} elementi selezionati`})}.`,selectedItem:e=>`${e.item} selezionato.`};var Aa={};Aa={deselectedItem:e=>`${e.item} \u{304C}\u{9078}\u{629E}\u{3055}\u{308C}\u{3066}\u{3044}\u{307E}\u{305B}\u{3093}\u{3002}`,longPressToSelect:`長押しして選択モードを開きます。`,select:`選択`,selectedAll:`すべての項目を選択しました。`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`項目が選択されていません`,one:()=>`${t.number(e.count)} \u{9805}\u{76EE}\u{3092}\u{9078}\u{629E}\u{3057}\u{307E}\u{3057}\u{305F}`,other:()=>`${t.number(e.count)} \u{9805}\u{76EE}\u{3092}\u{9078}\u{629E}\u{3057}\u{307E}\u{3057}\u{305F}`})}\u{3002}`,selectedItem:e=>`${e.item} \u{3092}\u{9078}\u{629E}\u{3057}\u{307E}\u{3057}\u{305F}\u{3002}`};var ja={};ja={deselectedItem:e=>`${e.item}\u{C774}(\u{AC00}) \u{C120}\u{D0DD}\u{B418}\u{C9C0} \u{C54A}\u{C558}\u{C2B5}\u{B2C8}\u{B2E4}.`,longPressToSelect:`선택 모드로 들어가려면 길게 누르십시오.`,select:`선택`,selectedAll:`모든 항목이 선택되었습니다.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`선택된 항목이 없습니다`,one:()=>`${t.number(e.count)}\u{AC1C} \u{D56D}\u{BAA9}\u{C774} \u{C120}\u{D0DD}\u{B418}\u{C5C8}\u{C2B5}\u{B2C8}\u{B2E4}`,other:()=>`${t.number(e.count)}\u{AC1C} \u{D56D}\u{BAA9}\u{C774} \u{C120}\u{D0DD}\u{B418}\u{C5C8}\u{C2B5}\u{B2C8}\u{B2E4}`})}.`,selectedItem:e=>`${e.item}\u{C774}(\u{AC00}) \u{C120}\u{D0DD}\u{B418}\u{C5C8}\u{C2B5}\u{B2C8}\u{B2E4}.`};var Ma={};Ma={deselectedItem:e=>`${e.item} nepasirinkta.`,longPressToSelect:`Norėdami įjungti pasirinkimo režimą, paspauskite ir palaikykite.`,select:`Pasirinkti`,selectedAll:`Pasirinkti visi elementai.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Nepasirinktas nė vienas elementas`,one:()=>`Pasirinktas ${t.number(e.count)} elementas`,other:()=>`Pasirinkta element\u{173}: ${t.number(e.count)}`})}.`,selectedItem:e=>`Pasirinkta: ${e.item}.`};var Na={};Na={deselectedItem:e=>`Vienums ${e.item} nav atlas\u{12B}ts.`,longPressToSelect:`Ilgi turiet nospiestu. lai ieslēgtu atlases režīmu.`,select:`Atlasīt`,selectedAll:`Atlasīti visi vienumi.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Nav atlasīts neviens vienums`,one:()=>`Atlas\u{12B}to vienumu skaits: ${t.number(e.count)}`,other:()=>`Atlas\u{12B}to vienumu skaits: ${t.number(e.count)}`})}.`,selectedItem:e=>`Atlas\u{12B}ts vienums ${e.item}.`};var Pa={};Pa={deselectedItem:e=>`${e.item} er ikke valgt.`,longPressToSelect:`Bruk et langt trykk for å gå inn i valgmodus.`,select:`Velg`,selectedAll:`Alle elementer er valgt.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Ingen elementer er valgt`,one:()=>`${t.number(e.count)} element er valgt`,other:()=>`${t.number(e.count)} elementer er valgt`})}.`,selectedItem:e=>`${e.item} er valgt.`};var Fa={};Fa={deselectedItem:e=>`${e.item} niet geselecteerd.`,longPressToSelect:`Druk lang om de selectiemodus te openen.`,select:`Selecteren`,selectedAll:`Alle items geselecteerd.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Geen items geselecteerd`,one:()=>`${t.number(e.count)} item geselecteerd`,other:()=>`${t.number(e.count)} items geselecteerd`})}.`,selectedItem:e=>`${e.item} geselecteerd.`};var Ia={};Ia={deselectedItem:e=>`Nie zaznaczono ${e.item}.`,longPressToSelect:`Naciśnij i przytrzymaj, aby wejść do trybu wyboru.`,select:`Zaznacz`,selectedAll:`Wszystkie zaznaczone elementy.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Nie zaznaczono żadnych elementów`,one:()=>`${t.number(e.count)} zaznaczony element`,other:()=>`${t.number(e.count)} zaznaczonych element\xf3w`})}.`,selectedItem:e=>`Zaznaczono ${e.item}.`};var La={};La={deselectedItem:e=>`${e.item} n\xe3o selecionado.`,longPressToSelect:`Mantenha pressionado para entrar no modo de seleção.`,select:`Selecionar`,selectedAll:`Todos os itens selecionados.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Nenhum item selecionado`,one:()=>`${t.number(e.count)} item selecionado`,other:()=>`${t.number(e.count)} itens selecionados`})}.`,selectedItem:e=>`${e.item} selecionado.`};var Ra={};Ra={deselectedItem:e=>`${e.item} n\xe3o selecionado.`,longPressToSelect:`Prima continuamente para entrar no modo de seleção.`,select:`Selecionar`,selectedAll:`Todos os itens selecionados.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Nenhum item selecionado`,one:()=>`${t.number(e.count)} item selecionado`,other:()=>`${t.number(e.count)} itens selecionados`})}.`,selectedItem:e=>`${e.item} selecionado.`};var za={};za={deselectedItem:e=>`${e.item} neselectat.`,longPressToSelect:`Apăsați lung pentru a intra în modul de selectare.`,select:`Selectare`,selectedAll:`Toate elementele selectate.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Niciun element selectat`,one:()=>`${t.number(e.count)} element selectat`,other:()=>`${t.number(e.count)} elemente selectate`})}.`,selectedItem:e=>`${e.item} selectat.`};var Ba={};Ba={deselectedItem:e=>`${e.item} \u{43D}\u{435} \u{432}\u{44B}\u{431}\u{440}\u{430}\u{43D}\u{43E}.`,longPressToSelect:`Нажмите и удерживайте для входа в режим выбора.`,select:`Выбрать`,selectedAll:`Выбраны все элементы.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Нет выбранных элементов`,one:()=>`${t.number(e.count)} \u{44D}\u{43B}\u{435}\u{43C}\u{435}\u{43D}\u{442} \u{432}\u{44B}\u{431}\u{440}\u{430}\u{43D}`,other:()=>`${t.number(e.count)} \u{44D}\u{43B}\u{435}\u{43C}\u{435}\u{43D}\u{442}\u{43E}\u{432} \u{432}\u{44B}\u{431}\u{440}\u{430}\u{43D}\u{43E}`})}.`,selectedItem:e=>`${e.item} \u{432}\u{44B}\u{431}\u{440}\u{430}\u{43D}\u{43E}.`};var Va={};Va={deselectedItem:e=>`Nevybrat\xe9 polo\u{17E}ky: ${e.item}.`,longPressToSelect:`Dlhším stlačením prejdite do režimu výberu.`,select:`Vybrať`,selectedAll:`Všetky vybraté položky.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Žiadne vybraté položky`,one:()=>`${t.number(e.count)} vybrat\xe1 polo\u{17E}ka`,other:()=>`Po\u{10D}et vybrat\xfdch polo\u{17E}iek:${t.number(e.count)}`})}.`,selectedItem:e=>`Vybrat\xe9 polo\u{17E}ky: ${e.item}.`};var Ha={};Ha={deselectedItem:e=>`Element ${e.item} ni izbran.`,longPressToSelect:`Za izbirni način pritisnite in dlje časa držite.`,select:`Izberite`,selectedAll:`Vsi elementi so izbrani.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Noben element ni izbran`,one:()=>`${t.number(e.count)} element je izbran`,other:()=>`${t.number(e.count)} elementov je izbranih`})}.`,selectedItem:e=>`Element ${e.item} je izbran.`};var Ua={};Ua={deselectedItem:e=>`${e.item} nije izabrano.`,longPressToSelect:`Dugo pritisnite za ulazak u režim biranja.`,select:`Izaberite`,selectedAll:`Izabrane su sve stavke.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Nije izabrana nijedna stavka`,one:()=>`Izabrana je ${t.number(e.count)} stavka`,other:()=>`Izabrano je ${t.number(e.count)} stavki`})}.`,selectedItem:e=>`${e.item} je izabrano.`};var Wa={};Wa={deselectedItem:e=>`${e.item} ej markerat.`,longPressToSelect:`Tryck länge när du vill öppna väljarläge.`,select:`Markera`,selectedAll:`Alla markerade objekt.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Inga markerade objekt`,one:()=>`${t.number(e.count)} markerat objekt`,other:()=>`${t.number(e.count)} markerade objekt`})}.`,selectedItem:e=>`${e.item} markerat.`};var Ga={};Ga={deselectedItem:e=>`${e.item} se\xe7ilmedi.`,longPressToSelect:`Seçim moduna girmek için uzun basın.`,select:`Seç`,selectedAll:`Tüm ögeler seçildi.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Hiçbir öge seçilmedi`,one:()=>`${t.number(e.count)} \xf6ge se\xe7ildi`,other:()=>`${t.number(e.count)} \xf6ge se\xe7ildi`})}.`,selectedItem:e=>`${e.item} se\xe7ildi.`};var Ka={};Ka={deselectedItem:e=>`${e.item} \u{43D}\u{435} \u{432}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{43E}.`,longPressToSelect:`Виконайте довге натиснення, щоб перейти в режим вибору.`,select:`Вибрати`,selectedAll:`Усі елементи вибрано.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Жодних елементів не вибрано`,one:()=>`${t.number(e.count)} \u{435}\u{43B}\u{435}\u{43C}\u{435}\u{43D}\u{442} \u{432}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{43E}`,other:()=>`\u{412}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{43E} \u{435}\u{43B}\u{435}\u{43C}\u{435}\u{43D}\u{442}\u{456}\u{432}: ${t.number(e.count)}`})}.`,selectedItem:e=>`${e.item} \u{432}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{43E}.`};var qa={};qa={deselectedItem:e=>`\u{672A}\u{9009}\u{62E9} ${e.item}\u{3002}`,longPressToSelect:`长按以进入选择模式。`,select:`选择`,selectedAll:`已选择所有项目。`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`未选择项目`,one:()=>`\u{5DF2}\u{9009}\u{62E9} ${t.number(e.count)} \u{4E2A}\u{9879}\u{76EE}`,other:()=>`\u{5DF2}\u{9009}\u{62E9} ${t.number(e.count)} \u{4E2A}\u{9879}\u{76EE}`})}\u{3002}`,selectedItem:e=>`\u{5DF2}\u{9009}\u{62E9} ${e.item}\u{3002}`};var Ja={};Ja={deselectedItem:e=>`\u{672A}\u{9078}\u{53D6}\u{300C}${e.item}\u{300D}\u{3002}`,longPressToSelect:`長按以進入選擇模式。`,select:`選取`,selectedAll:`已選取所有項目。`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`未選取任何項目`,one:()=>`\u{5DF2}\u{9078}\u{53D6} ${t.number(e.count)} \u{500B}\u{9805}\u{76EE}`,other:()=>`\u{5DF2}\u{9078}\u{53D6} ${t.number(e.count)} \u{500B}\u{9805}\u{76EE}`})}\u{3002}`,selectedItem:e=>`\u{5DF2}\u{9078}\u{53D6}\u{300C}${e.item}\u{300D}\u{3002}`};var Ya={};Ya={"ar-AE":ha,"bg-BG":ga,"cs-CZ":_a,"da-DK":va,"de-DE":ya,"el-GR":ba,"en-US":xa,"es-ES":Sa,"et-EE":Ca,"fi-FI":wa,"fr-FR":Ta,"he-IL":Ea,"hr-HR":Da,"hu-HU":Oa,"it-IT":ka,"ja-JP":Aa,"ko-KR":ja,"lt-LT":Ma,"lv-LV":Na,"nb-NO":Pa,"nl-NL":Fa,"pl-PL":Ia,"pt-BR":La,"pt-PT":Ra,"ro-RO":za,"ru-RU":Ba,"sk-SK":Va,"sl-SI":Ha,"sr-SP":Ua,"sv-SE":Wa,"tr-TR":Ga,"uk-UA":Ka,"zh-CN":qa,"zh-TW":Ja};function Xa(e){return e&&e.__esModule?e.default:e}function Za(e,t){let{getRowText:n=e=>{var n;return(n=t.collection).getTextValue?.call(n,e)??t.collection.getItem(e)?.textValue}}=e,r=pn(Xa(Ya),`@react-aria/grid`),i=t.selectionManager.rawSelection,a=(0,J.useRef)(i),o=(0,J.useCallback)(()=>{if(!t.selectionManager.isFocused||i===a.current){a.current=i;return}let e=Qa(i,a.current),o=Qa(a.current,i),s=t.selectionManager.selectionBehavior===`replace`,c=[];if(t.selectionManager.selectedKeys.size===1&&s){let e=t.selectionManager.selectedKeys.keys().next().value;if(e!=null&&t.collection.getItem(e)){let t=n(e);t&&c.push(r.format(`selectedItem`,{item:t}))}}else if(e.size===1&&o.size===0){let t=e.keys().next().value;if(t!=null){let e=n(t);e&&c.push(r.format(`selectedItem`,{item:e}))}}else if(o.size===1&&e.size===0){let e=o.keys().next().value;if(e!=null&&t.collection.getItem(e)){let t=n(e);t&&c.push(r.format(`deselectedItem`,{item:t}))}}t.selectionManager.selectionMode===`multiple`&&(c.length===0||i===`all`||i.size>1||a.current===`all`||a.current?.size>1)&&c.push(i===`all`?r.format(`selectedAll`):r.format(`selectedCount`,{count:i.size})),c.length>0&&kn(c.join(` `)),a.current=i},[i,t.selectionManager.selectedKeys,t.selectionManager.isFocused,t.selectionManager.selectionBehavior,t.selectionManager.selectionMode,t.collection,n,r]);rr(()=>{if(t.selectionManager.isFocused)o();else{let e=requestAnimationFrame(o);return()=>cancelAnimationFrame(e)}},[i,t.selectionManager.isFocused])}function Qa(e,t){let n=new Set;if(e===`all`||t===`all`)return n;for(let r of e.keys())t.has(r)||n.add(r);return n}function $a(e){return e&&e.__esModule?e.default:e}function eo(e){let t=pn($a(Ya),`@react-aria/grid`),n=Dn(),r=(n===`pointer`||n===`virtual`||n==null)&&typeof window<`u`&&`ontouchstart`in window,i=(0,J.useMemo)(()=>{let n=e.selectionManager.selectionMode,i=e.selectionManager.selectionBehavior,a;return r&&(a=t.format(`longPressToSelect`)),i===`replace`&&n!==`none`&&e.hasItemActions?a:void 0},[e.selectionManager.selectionMode,e.selectionManager.selectionBehavior,e.hasItemActions,t,r]);return ur(i)}function to(e){return e&&e.__esModule?e.default:e}function no(e,t){let{key:n}=e,r=t.selectionManager,i=dn(),a=!t.selectionManager.canSelectItem(n),o=t.selectionManager.isSelected(n);return{checkboxProps:{id:i,"aria-label":pn(to(Ya),`@react-aria/grid`).format(`select`),isSelected:o,isDisabled:a,onChange:()=>r.toggleSelection(n)}}}function ro(e,t,n){let{isVirtualized:r,keyboardDelegate:i,layoutDelegate:a,onAction:o,disallowTypeAhead:s,linkBehavior:c=`action`,keyboardNavigationBehavior:l=`arrow`,escapeKeyBehavior:u=`clearSelection`,shouldSelectOnPressUp:d}=e;!e[`aria-label`]&&!e[`aria-labelledby`]&&console.warn(`An aria-label or aria-labelledby prop is required for accessibility.`);let{listProps:f}=xi({selectionManager:t.selectionManager,collection:t.collection,disabledKeys:t.disabledKeys,ref:n,keyboardDelegate:i,layoutDelegate:a,isVirtualized:r,selectOnFocus:t.selectionManager.selectionBehavior===`replace`,shouldFocusWrap:e.shouldFocusWrap,linkBehavior:c,disallowTypeAhead:s,autoFocus:e.autoFocus,escapeKeyBehavior:u}),p=dn(e.id);fa.set(t,{id:p,onAction:o,linkBehavior:c,keyboardNavigationBehavior:l,shouldSelectOnPressUp:d});let m=eo({selectionManager:t.selectionManager,hasItemActions:!!o}),h=ti(n,{isDisabled:t.collection.size!==0}),g=zn(e,{labelable:!0}),_=hn(g,{role:`grid`,id:p,"aria-multiselectable":t.selectionManager.selectionMode===`multiple`?`true`:void 0},t.collection.size===0?{tabIndex:h?-1:0}:f,m);return r&&(_[`aria-rowcount`]=t.collection.size,_[`aria-colcount`]=1),Za({},t),{gridProps:_}}var io={expand:{ltr:`ArrowRight`,rtl:`ArrowLeft`},collapse:{ltr:`ArrowLeft`,rtl:`ArrowRight`}};function ao(e,t,n){let{node:r,isVirtualized:i}=e,{direction:a}=fr(),{onAction:o,linkBehavior:s,keyboardNavigationBehavior:c,shouldSelectOnPressUp:l}=fa.get(t),u=On(),d=(0,J.useRef)(null),f=()=>{n.current!==null&&(d.current!=null&&r.key!==d.current||!yn(n.current))&&xn(n.current)},p={},m=e.hasChildItems,h=t.selectionManager.isLink(r.key);if(r!=null&&`expandedKeys`in t){var g;let e=(g=t.collection).getChildren?.call(g,r.key);m||=[...e??[]].length>1,o==null&&!h&&t.selectionManager.selectionMode===`none`&&m&&(o=()=>t.toggleKey(r.key));let n=m?t.expandedKeys.has(r.key):void 0,i=1,a=r.index;if(r.level>=0&&r?.parentKey!=null){let e=t.collection.getItem(r.parentKey);if(e){let n=so(e,t.collection);i=[...n].filter(e=>e.type===`item`).length,a>0&&n[0].type!==`item`&&--a}}else i=[...t.collection].filter(e=>e.level===0&&e.type===`item`).length;p={"aria-expanded":n,"aria-level":r.level+1,"aria-posinset":a+1,"aria-setsize":i}}let{itemProps:_,...v}=gi({selectionManager:t.selectionManager,key:r.key,ref:n,isVirtualized:i,shouldSelectOnPressUp:e.shouldSelectOnPressUp||l,onAction:o||r.props?.onAction?sn(r.props?.onAction,o?()=>o(r.key):void 0):void 0,focus:f,linkBehavior:s}),y=e=>{let i=ln();if(!_n(e.currentTarget,fn(e))||!n.current||!i)return;let o=er(n.current);if(o.currentNode=i,`expandedKeys`in t&&i===n.current){if(e.key===io.expand[a]&&t.selectionManager.focusedKey===r.key&&m&&!t.expandedKeys.has(r.key)){t.toggleKey(r.key),e.stopPropagation();return}if(e.key===io.collapse[a]&&t.selectionManager.focusedKey===r.key&&m&&t.expandedKeys.has(r.key)){t.toggleKey(r.key),e.stopPropagation();return}}switch(e.key){case`ArrowLeft`:if(c===`arrow`){let t=a===`rtl`?o.nextNode():o.previousNode();if(t)e.preventDefault(),e.stopPropagation(),xn(t),ar(t,{containingElement:cr(n.current)});else if(e.preventDefault(),e.stopPropagation(),a===`rtl`)xn(n.current),ar(n.current,{containingElement:cr(n.current)});else{o.currentNode=n.current;let e=oo(o);e&&(xn(e),ar(e,{containingElement:cr(n.current)}))}}break;case`ArrowRight`:if(c===`arrow`){let t=a===`rtl`?o.previousNode():o.nextNode();if(t)e.preventDefault(),e.stopPropagation(),xn(t),ar(t,{containingElement:cr(n.current)});else if(e.preventDefault(),e.stopPropagation(),a===`ltr`)xn(n.current),ar(n.current,{containingElement:cr(n.current)});else{o.currentNode=n.current;let e=oo(o);e&&(xn(e),ar(e,{containingElement:cr(n.current)}))}}break;case`ArrowUp`:case`ArrowDown`:if(!e.altKey&&_n(n.current,fn(e))){var s;e.stopPropagation(),e.preventDefault(),(s=n.current.parentElement)==null||s.dispatchEvent(new KeyboardEvent(e.nativeEvent.type,e.nativeEvent))}}},b=e=>{if(d.current=r.key,fn(e)!==n.current){un()||t.selectionManager.setFocusedKey(r.key);return}},x=e=>{let t=ln();if(!(!_n(e.currentTarget,fn(e))||!n.current||!t)&&e.key===`Tab`&&c===`tab`){let r=er(n.current,{tabbable:!0});r.currentNode=t,(e.shiftKey?r.previousNode():r.nextNode())&&e.stopPropagation()}},S=wn(r.props),C=v.hasAction?S:{},w=hn(_,C,{role:`row`,onKeyDownCapture:y,onKeyDown:x,onFocus:b,"aria-label":r[`aria-label`]||r.textValue||void 0,"aria-selected":t.selectionManager.canSelectItem(r.key)?t.selectionManager.isSelected(r.key):void 0,"aria-disabled":t.selectionManager.isDisabled(r.key)||void 0,"aria-labelledby":u&&(r[`aria-label`]||r.textValue)?`${pa(t,r.key)} ${u}`:void 0,id:pa(t,r.key)});if(i){let{collection:e}=t;w[`aria-rowindex`]=[...e].find(e=>e.type===`section`)?[...e.getKeys()].filter(t=>e.getItem(t)?.type!==`section`).findIndex(e=>e===r.key)+1:r.index+1}let T={role:`gridcell`,"aria-colindex":1};return{rowProps:{...hn(w,p)},gridCellProps:T,descriptionProps:{id:u},...v}}function oo(e){let t=null,n=null;do n=e.lastChild(),n&&(t=n);while(n);return t}function so(e,t){let n=t.getChildren?.call(t,e.key),r=n?Array.from(n):[],i=r.length>0?r[0]:null,a=[];for(;i;)a.push(i),i=i.nextKey==null?null:t.getItem(i.nextKey);return a}function co(e,t){let{key:n}=e,{checkboxProps:r}=no(e,t);return{checkboxProps:{...r,"aria-labelledby":`${r.id} ${pa(t,n)}`}}}function lo(e,t,n){let{gridProps:r}=ro(e,t,n);return r.role=`treegrid`,{gridProps:r}}var uo={};uo={collapse:`طي`,expand:`تمديد`};var fo={};fo={collapse:`Свиване`,expand:`Разширяване`};var po={};po={collapse:`Sbalit`,expand:`Roztáhnout`};var mo={};mo={collapse:`Skjul`,expand:`Udvid`};var ho={};ho={collapse:`Reduzieren`,expand:`Erweitern`};var go={};go={collapse:`Σύμπτυξη`,expand:`Ανάπτυξη`};var _o={};_o={expand:`Expand`,collapse:`Collapse`};var vo={};vo={collapse:`Contraer`,expand:`Ampliar`};var yo={};yo={collapse:`Ahenda`,expand:`Laienda`};var bo={};bo={collapse:`Pienennä`,expand:`Laajenna`};var xo={};xo={collapse:`Réduire`,expand:`Développer`};var So={};So={collapse:`כווץ`,expand:`הרחב`};var Co={};Co={collapse:`Sažmi`,expand:`Proširi`};var wo={};wo={collapse:`Összecsukás`,expand:`Kibontás`};var To={};To={collapse:`Comprimi`,expand:`Espandi`};var Eo={};Eo={collapse:`折りたたむ`,expand:`展開`};var Do={};Do={collapse:`접기`,expand:`펼치기`};var Oo={};Oo={collapse:`Sutraukti`,expand:`Išskleisti`};var ko={};ko={collapse:`Sakļaut`,expand:`Izvērst`};var Ao={};Ao={collapse:`Skjul`,expand:`Utvid`};var jo={};jo={collapse:`Samenvouwen`,expand:`Uitvouwen`};var Mo={};Mo={collapse:`Zwiń`,expand:`Rozwiń`};var No={};No={collapse:`Recolher`,expand:`Expandir`};var Po={};Po={collapse:`Colapsar`,expand:`Expandir`};var Fo={};Fo={collapse:`Restrângeți`,expand:`Extindeți`};var Io={};Io={collapse:`Свернуть`,expand:`Развернуть`};var Lo={};Lo={collapse:`Zbaliť`,expand:`Rozbaliť`};var Ro={};Ro={collapse:`Strni`,expand:`Razširi`};var zo={};zo={collapse:` Skupi`,expand:`Proširi`};var Bo={};Bo={collapse:`Dölj`,expand:`Expandera`};var Vo={};Vo={collapse:`Daralt`,expand:`Genişlet`};var Ho={};Ho={collapse:`Згорнути`,expand:`Розгорнути`};var Uo={};Uo={collapse:`折叠`,expand:`扩展`};var Wo={};Wo={collapse:`收合`,expand:`展開`};var Go={};Go={"ar-AE":uo,"bg-BG":fo,"cs-CZ":po,"da-DK":mo,"de-DE":ho,"el-GR":go,"en-US":_o,"es-ES":vo,"et-EE":yo,"fi-FI":bo,"fr-FR":xo,"he-IL":So,"hr-HR":Co,"hu-HU":wo,"it-IT":To,"ja-JP":Eo,"ko-KR":Do,"lt-LT":Oo,"lv-LV":ko,"nb-NO":Ao,"nl-NL":jo,"pl-PL":Mo,"pt-BR":No,"pt-PT":Po,"ro-RO":Fo,"ru-RU":Io,"sk-SK":Lo,"sl-SI":Ro,"sr-SP":zo,"sv-SE":Bo,"tr-TR":Vo,"uk-UA":Ho,"zh-CN":Uo,"zh-TW":Wo};function Ko(e){return e&&e.__esModule?e.default:e}function qo(e,t,n){let{node:r}=e,i=ao(e,t,n),a=i.rowProps[`aria-expanded`]===!0,o=pn(Ko(Go),`@react-aria/tree`),s={onPress:()=>{i.isDisabled||(t.toggleKey(r.key),t.selectionManager.setFocused(!0),t.selectionManager.setFocusedKey(r.key))},excludeFromTabOrder:!0,preventFocusOnPress:!0,"data-react-aria-prevent-focus":!0,...jn({"aria-label":a?o.format(`collapse`):o.format(`expand`),"aria-labelledby":i.rowProps.id})};return{...i,expandButtonProps:s}}var Jo=class e extends Set{constructor(t,n,r){super(t),t instanceof e?(this.anchorKey=n??t.anchorKey,this.currentKey=r??t.currentKey):(this.anchorKey=n??null,this.currentKey=r??null)}};function Yo(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function Xo(e){let{selectionMode:t=`none`,disallowEmptySelection:n=!1,allowDuplicateSelectionEvents:r,selectionBehavior:i=`toggle`,disabledBehavior:a=`all`}=e,o=(0,J.useRef)(!1),[,s]=(0,J.useState)(!1),c=(0,J.useRef)(null),l=(0,J.useRef)(null),[,u]=(0,J.useState)(null),d=(0,J.useMemo)(()=>Zo(e.selectedKeys),[e.selectedKeys]),f=(0,J.useMemo)(()=>Zo(e.defaultSelectedKeys,new Jo),[e.defaultSelectedKeys]),[p,m]=Nn(d,f,e.onSelectionChange),h=(0,J.useMemo)(()=>e.disabledKeys?new Set(e.disabledKeys):new Set,[e.disabledKeys]),[g,_]=(0,J.useState)(i);i===`replace`&&g===`toggle`&&typeof p==`object`&&p.size===0&&_(`replace`);let v=(0,J.useRef)(i);return(0,J.useEffect)(()=>{i!==v.current&&(_(i),v.current=i)},[i]),{selectionMode:t,disallowEmptySelection:n,selectionBehavior:g,setSelectionBehavior:_,get isFocused(){return o.current},setFocused(e){o.current=e,s(e)},get focusedKey(){return c.current},get childFocusStrategy(){return l.current},setFocusedKey(e,t=`first`){c.current=e,l.current=t,u(e)},selectedKeys:p,setSelectedKeys(e){(r||!Yo(e,p))&&m(e)},disabledKeys:h,disabledBehavior:a}}function Zo(e,t){return e?e===`all`?`all`:new Jo(e):t}var Qo=class e{get selectionMode(){return this.state.selectionMode}get disallowEmptySelection(){return this.state.disallowEmptySelection}get selectionBehavior(){return this.state.selectionBehavior}setSelectionBehavior(e){this.state.setSelectionBehavior(e)}get isFocused(){return this.state.isFocused}setFocused(e){this.state.setFocused(e)}get focusedKey(){return this.state.focusedKey}get childFocusStrategy(){return this.state.childFocusStrategy}setFocusedKey(e,t){(e==null||this.collection.getItem(e))&&this.state.setFocusedKey(e,t)}get selectedKeys(){return this.state.selectedKeys===`all`?new Set(this.getSelectAllKeys()):this.state.selectedKeys}get rawSelection(){return this.state.selectedKeys}isSelected(e){if(this.state.selectionMode===`none`)return!1;let t=this.getKey(e);return t==null?!1:this.state.selectedKeys===`all`?this.canSelectItem(t):this.state.selectedKeys.has(t)}get isEmpty(){return this.state.selectedKeys!==`all`&&this.state.selectedKeys.size===0}get isSelectAll(){if(this.isEmpty)return!1;if(this.state.selectedKeys===`all`)return!0;if(this._isSelectAll!=null)return this._isSelectAll;let e=this.getSelectAllKeys(),t=this.state.selectedKeys;return this._isSelectAll=e.every(e=>t.has(e)),this._isSelectAll}get firstSelectedKey(){let e=null;for(let t of this.state.selectedKeys){let n=this.collection.getItem(t);(!e||n&&Ai(this.collection,n,e)<0)&&(e=n)}return e?.key??null}get lastSelectedKey(){let e=null;for(let t of this.state.selectedKeys){let n=this.collection.getItem(t);(!e||n&&Ai(this.collection,n,e)>0)&&(e=n)}return e?.key??null}get disabledKeys(){return this.state.disabledKeys}get disabledBehavior(){return this.state.disabledBehavior}extendSelection(e){if(this.selectionMode===`none`)return;if(this.selectionMode===`single`){this.replaceSelection(e);return}let t=this.getKey(e);if(t==null)return;let n;if(this.state.selectedKeys===`all`)n=new Jo([t],t,t);else{let e=this.state.selectedKeys,r=e.anchorKey??t;n=new Jo(e,r,t);for(let i of this.getKeyRange(r,e.currentKey??t))n.delete(i);for(let e of this.getKeyRange(t,r))this.canSelectItem(e)&&n.add(e)}this.state.setSelectedKeys(n)}getKeyRange(e,t){let n=this.collection.getItem(e),r=this.collection.getItem(t);return n&&r?Ai(this.collection,n,r)<=0?this.getKeyRangeInternal(e,t):this.getKeyRangeInternal(t,e):[]}getKeyRangeInternal(e,t){if(this.layoutDelegate?.getKeyRange)return this.layoutDelegate.getKeyRange(e,t);let n=[],r=e;for(;r!=null;){let e=this.collection.getItem(r);if(e&&(e.type===`item`||e.type===`cell`&&this.allowsCellSelection)&&n.push(r),r===t)return n;r=this.collection.getKeyAfter(r)}return[]}getKey(e){let t=this.collection.getItem(e);if(!t||t.type===`cell`&&this.allowsCellSelection)return e;for(;t&&t.type!==`item`&&t.parentKey!=null;)t=this.collection.getItem(t.parentKey);return!t||t.type!==`item`?null:t.key}toggleSelection(e){if(this.selectionMode===`none`)return;if(this.selectionMode===`single`&&!this.isSelected(e)){this.replaceSelection(e);return}let t=this.getKey(e);if(t==null)return;let n=new Jo(this.state.selectedKeys===`all`?this.getSelectAllKeys():this.state.selectedKeys);n.has(t)?n.delete(t):this.canSelectItem(t)&&(n.add(t),n.anchorKey=t,n.currentKey=t),!(this.disallowEmptySelection&&n.size===0)&&this.state.setSelectedKeys(n)}replaceSelection(e){if(this.selectionMode===`none`)return;let t=this.getKey(e);if(t==null)return;let n=this.canSelectItem(t)?new Jo([t],t,t):new Jo;this.state.setSelectedKeys(n)}setSelectedKeys(e){if(this.selectionMode===`none`)return;let t=new Jo;for(let n of e){let e=this.getKey(n);if(e!=null&&(t.add(e),this.selectionMode===`single`))break}this.state.setSelectedKeys(t)}getSelectAllKeys(){let e=[],t=n=>{for(;n!=null;){if(this.canSelectItem(n)){let r=this.collection.getItem(n);r?.type===`item`&&e.push(n),r?.hasChildNodes&&(this.allowsCellSelection||r.type!==`item`)&&t(Oi(Di(r,this.collection))?.key??null)}n=this.collection.getKeyAfter(n)}};return t(this.collection.getFirstKey()),e}selectAll(){!this.isSelectAll&&this.selectionMode===`multiple`&&this.state.setSelectedKeys(`all`)}clearSelection(){!this.disallowEmptySelection&&(this.state.selectedKeys===`all`||this.state.selectedKeys.size>0)&&this.state.setSelectedKeys(new Jo)}toggleSelectAll(){this.isSelectAll?this.clearSelection():this.selectAll()}select(e,t){this.selectionMode!==`none`&&(this.selectionMode===`single`?this.isSelected(e)&&!this.disallowEmptySelection?this.toggleSelection(e):this.replaceSelection(e):this.selectionBehavior===`toggle`||t&&(t.pointerType===`touch`||t.pointerType===`virtual`)?this.toggleSelection(e):this.replaceSelection(e))}isSelectionEqual(e){if(e===this.state.selectedKeys)return!0;let t=this.selectedKeys;if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;for(let n of t)if(!e.has(n))return!1;return!0}canSelectItem(e){if(this.state.selectionMode===`none`||this.state.disabledKeys.has(e))return!1;let t=this.collection.getItem(e);return!(!t||t!=null&&t.props?.isDisabled||t.type===`cell`&&!this.allowsCellSelection)}isDisabled(e){var t;return this.state.disabledBehavior===`all`&&(this.state.disabledKeys.has(e)||!!((t=this.collection.getItem(e))!=null&&t.props?.isDisabled))}isLink(e){var t;return!!((t=this.collection.getItem(e))!=null&&t.props?.href)}getItemProps(e){return this.collection.getItem(e)?.props}withCollection(t){return new e(t,this.state,{allowsCellSelection:this.allowsCellSelection,layoutDelegate:this.layoutDelegate||void 0})}constructor(e,t,n){this.collection=e,this.state=t,this.allowsCellSelection=n?.allowsCellSelection??!1,this._isSelectAll=null,this.layoutDelegate=n?.layoutDelegate||null}},$o=class{*[Symbol.iterator](){yield*this.iterable}get size(){return this.keyMap.size}getKeys(){return this.keyMap.keys()}getKeyBefore(e){let t=this.keyMap.get(e);return t?t.prevKey??null:null}getKeyAfter(e){let t=this.keyMap.get(e);return t?t.nextKey??null:null}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(e){return this.keyMap.get(e)??null}at(e){let t=[...this.getKeys()];return this.getItem(t[e])}constructor(e,{expandedKeys:t}={}){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.iterable=e,t||=new Set;let n=e=>{if(this.keyMap.set(e.key,e),e.childNodes&&(e.type===`section`||t.has(e.key)))for(let t of e.childNodes)n(t)};for(let t of e)n(t);let r=null,i=0;for(let[e,t]of this.keyMap)r?(r.nextKey=e,t.prevKey=r.key):(this.firstKey=e,t.prevKey=void 0),t.type===`item`&&(t.index=i++),r=t,r.nextKey=void 0;this.lastKey=r?.key??null}};function es(e){let{onExpandedChange:t}=e,[n,r]=Nn(e.expandedKeys?new Set(e.expandedKeys):void 0,e.defaultExpandedKeys?new Set(e.defaultExpandedKeys):new Set,t),i=Xo(e),a=(0,J.useMemo)(()=>e.disabledKeys?new Set(e.disabledKeys):new Set,[e.disabledKeys]),o=Ei(e,(0,J.useCallback)(e=>new $o(e,{expandedKeys:n}),[n]),null);return(0,J.useEffect)(()=>{i.focusedKey!=null&&!o.getItem(i.focusedKey)&&i.setFocusedKey(null)},[o,i.focusedKey]),{collection:o,expandedKeys:n,disabledKeys:a,toggleKey:e=>{r(ts(n,e))},setExpandedKeys:r,selectionManager:new Qo(o,i)}}function ts(e,t){let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n}var ns=(0,J.createContext)({}),rs=(0,J.createContext)(null),is=(0,J.forwardRef)(function(e,t){let{render:n}=(0,J.useContext)(rs);return J.createElement(J.Fragment,null,n(e,t))});function as(e,t){let n=e?.renderDropIndicator,r=e?.isVirtualDragging?.call(e),i=(0,J.useCallback)(e=>{if(r||t?.isDropTarget(e))return n?n(e):J.createElement(is,{target:e})},[t?.target,r,n]);return e?.useDropIndicator?i:void 0}function os(e,t,n){let r=e.focusedKey,i=null;if(t!=null&&t.isVirtualDragging?.call(t)&&n?.target?.type===`item`&&(i=n.target.key,n.target.dropPosition===`after`)){let e=n.collection.getKeyAfter(i),t=null;if(e!=null){let r=n.collection.getItem(i)?.level??0;for(;e;){let i=n.collection.getItem(e);if(!i)break;if(i.type!==`item`){e=n.collection.getKeyAfter(e);continue}if((i.level??0)<=r)break;t=e,e=n.collection.getKeyAfter(e)}}i=e??t??i}return(0,J.useMemo)(()=>new Set([r,i].filter(e=>e!=null)),[r,i])}var ss=(0,J.createContext)(null);function cs(e){let t=(0,J.useRef)({});return J.createElement(ss.Provider,{value:t},e.children)}var ls=10,us=5,ds=class{setup(e,t,n){this.delegate=e,this.state=t,this.direction=n}getDropTargetFromPoint(e,t,n){let r=this.delegate.getDropTargetFromPoint(e,t,n);return!r||r.type===`root`?r:this.resolveDropTarget(r,e,t,n)}resolveDropTarget(e,t,n,r){let i=this.pointerTracking,a=n-i.lastY,o=t-i.lastX,s=i.yDirection,c=i.xDirection;if(Math.abs(a)>us&&(s=a>0?`down`:`up`,i.yDirection=s,i.lastY=n),Math.abs(o)>ls&&(c=o>0?`right`:`left`,i.xDirection=c,i.lastX=t),e.dropPosition===`before`){let t=this.state.collection.getKeyBefore(e.key);if(t!=null){let n={type:`item`,key:t,dropPosition:`after`};r(n)&&(e=n)}}let l=this.getPotentialTargets(e,r);if(l.length===0)return{type:`root`};let u;return l.length>1?u=this.selectTarget(l,e,t,n,s,c):(u=l[0],i.boundaryContext=null),u}getPotentialTargets(e,t){if(e.dropPosition===`on`)return[e];let n=e,r=this.state.collection,i=r.getItem(n.key);for(;i&&i?.type!==`item`&&i.nextKey!=null;)n.key=i.nextKey,i=r.getItem(i.nextKey);let a=[n];if(i&&i.hasChildNodes&&this.state.expandedKeys.has(i.key)&&r.getChildren&&n.dropPosition===`after`){let e=null;for(let t of r.getChildren(i.key))if(t.type===`item`){e=t;break}if(e){let n={type:`item`,key:e.key,dropPosition:`before`};return t(n)?[n]:[]}}if(i?.nextKey!=null)return[e];let o=i?.parentKey,s=[];for(;o;){let e=r.getItem(o),n=e?.nextKey?r.getItem(e.nextKey):null;if(!n||n.parentKey!==o){let e={type:`item`,key:o,dropPosition:`after`};if(t(e)&&s.push(e),n)break}o=e?.parentKey}if(s.length>0&&a.push(...s),a.length===1){let e=r.getKeyAfter(n.key),a=e?r.getItem(e):null;if(e!=null&&a&&i&&a.level!=null&&i.level!=null&&a.level>i.level){let n={type:`item`,key:e,dropPosition:`before`};if(t(n))return[n]}}return a.filter(t)}selectTarget(e,t,n,r,i,a){if(e.length<2)return e[0];let o=this.pointerTracking,s=this.state.collection.getItem(t.key)?.parentKey;if(!s)return e[0];(!o.boundaryContext||o.boundaryContext.parentKey!==s)&&(o.boundaryContext={parentKey:s,preferredTargetIndex:o.yDirection===`up`?e.length-1:0,lastSwitchY:r,lastSwitchX:n});let c=o.boundaryContext,l=Math.abs(n-c.lastSwitchX);if(Math.abs(r-c.lastSwitchY)>us&&i){let t=c.preferredTargetIndex||0;i===`down`&&t===0?c.preferredTargetIndex=e.length-1:i===`up`&&t===e.length-1&&(c.preferredTargetIndex=0),o.xDirection=null}if(l>ls&&a){let t=c.preferredTargetIndex||0;a===`left`?this.direction===`ltr`?t<e.length-1&&(c.preferredTargetIndex=t+1,c.lastSwitchX=n):t>0&&(c.preferredTargetIndex=t-1,c.lastSwitchX=n):a===`right`&&(this.direction===`ltr`?t>0&&(c.preferredTargetIndex=t-1,c.lastSwitchX=n):t<e.length-1&&(c.preferredTargetIndex=t+1,c.lastSwitchX=n)),o.yDirection=null}return e[Math.max(0,Math.min(c.preferredTargetIndex||0,e.length-1))]}constructor(){this.delegate=null,this.state=null,this.direction=`ltr`,this.pointerTracking={lastY:0,lastX:0,yDirection:null,xDirection:null,boundaryContext:null}}},fs=class e extends Ri{withExpandedKeys(t,n){let r=this.clone();return r.expandedKeys=n,e.cloneAncestorSections(n,t,r),e.cloneAncestorSections(t,n,r),r.frozen=this.frozen,r}static cloneAncestorSections(e,t,n){for(let r of e)if(!t.has(r)){let e=r;for(;e!=null;){let t=n.getItem(e);if(t?.type===`section`){n.keyMap.set(e,t.clone());break}e=t?.parentKey??null}}}*[Symbol.iterator](){let e=this.getFirstKey(),t=e==null?null:this.getItem(e);for(;t;)if(yield t,t.type===`section`)t=t.nextKey?this.getItem(t.nextKey):null;else{let e=this.getKeyAfter(t.key);t=e?this.getItem(e):null}}getLastKey(){let e=this.lastKey;if(e==null)return null;let t=this.getItem(e);for(;t?.lastChildKey!=null&&(t.type!==`item`||this.expandedKeys.has(t.key));)t=this.getItem(t.lastChildKey);return t?.key}getKeyAfter(e){let t=this.getItem(e);if(!t)return null;if((this.expandedKeys.has(t.key)||t.type!==`item`)&&t.firstChildKey!=null)return t.firstChildKey;for(;t;){if(t.nextKey!=null)return t.nextKey;if(t.parentKey!=null)t=this.getItem(t.parentKey);else return null}return null}getKeyBefore(e){let t=this.getItem(e);if(!t)return null;if(t.prevKey!=null){for(t=this.getItem(t.prevKey);t&&(t.type!==`item`||this.expandedKeys.has(t.key))&&t.lastChildKey!=null;)t=this.getItem(t.lastChildKey);return t?.key??null}return t.parentKey}getChildren(e){let t=this;return{*[Symbol.iterator](){let n=t.getItem(e),r=n?.firstChildKey==null?null:t.getItem(n.firstChildKey);if(n&&n.type===`section`&&r)for(;r&&r.key!==n.nextKey;){yield t.getItem(r.key);let e=t.getKeyAfter(r.key);r=e==null?null:t.getItem(e)}else for(;r;)yield r,r=r.nextKey==null?null:t.getItem(r.nextKey)}}}getTextValue(e){let t=this.getItem(e);return t?t.textValue:``}constructor(...e){super(...e),this.expandedKeys=new Set}},ps=(0,J.createContext)(null),ms=(0,J.createContext)(null),hs=(0,J.forwardRef)(function(e,t){return[e,t]=an(e,t,ps),J.createElement(qi,{content:J.createElement(aa,e),createCollection:()=>new fs},n=>J.createElement(_s,{props:e,collection:n,treeRef:t}))}),gs={expand:{ltr:`ArrowRight`,rtl:`ArrowLeft`},collapse:{ltr:`ArrowLeft`,rtl:`ArrowRight`}};function _s({props:e,collection:t,treeRef:n}){let{dragAndDropHooks:r}=e,{direction:i}=fr(),a=lr({usage:`search`,sensitivity:`base`}),o=!!r?.useDraggableCollectionState,s=!!r?.useDroppableCollectionState,c=(0,J.useRef)(o),l=(0,J.useRef)(s);(0,J.useEffect)(()=>{c.current!==o&&console.warn(`Drag hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior.`),l.current!==s&&console.warn(`Drop hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior.`)},[o,s]);let{selectionMode:u=`none`,expandedKeys:d,defaultExpandedKeys:f,onExpandedChange:p,disabledBehavior:m=`all`}=e,{CollectionRoot:h,isVirtualized:g,layoutDelegate:_,dropTargetDelegate:v}=(0,J.useContext)(da),[y,b]=Nn(d?new Set(d):void 0,f?new Set(f):new Set,p),[x,S]=(0,J.useState)(t),[C,w]=(0,J.useState)(y),[T,E]=(0,J.useState)(()=>t.withExpandedKeys(C,y));(!Ds(C,y)||t!==x)&&(E(t.withExpandedKeys(C,y)),S(t),w(y));let D=es({...e,selectionMode:u,expandedKeys:y,onExpandedChange:b,collection:T,children:void 0,disabledBehavior:m}),{gridProps:O}=lo({...e,isVirtualized:g,layoutDelegate:_},D,n),k,A,j,M=!1,N=null,P=(0,J.useRef)(null);if(o&&r){k=r.useDraggableCollectionState({collection:D.collection,selectionManager:D.selectionManager,preview:r.renderDragPreview?P:void 0}),r.useDraggableCollection({},k,n);let e=r.DragPreview;N=r.renderDragPreview?J.createElement(e,{ref:P},r.renderDragPreview):null}let[F]=(0,J.useState)(()=>new ds);if(s&&r){A=r.useDroppableCollectionState({collection:D.collection,selectionManager:D.selectionManager});let e=r.dropTargetDelegate||v||new r.ListDropTargetDelegate(D.collection,n,{direction:i});F.setup(e,D,i);let t=new bi({collection:D.collection,collator:a,ref:n,disabledKeys:D.selectionManager.disabledKeys,disabledBehavior:D.selectionManager.disabledBehavior,direction:i,layoutDelegate:_});j=r.useDroppableCollection({keyboardDelegate:t,dropTargetDelegate:F,onDropActivate:e=>{if(e.target.type===`item`){let t=e.target.key,n=D.collection.getItem(t),i=y.has(t);n&&n.hasChildNodes&&(!i||r!=null&&r.isVirtualDragging?.call(r))&&D.toggleKey(t)}},onKeyDown:e=>{let t=A?.target;if(t&&t.type===`item`&&t.dropPosition===`on`){let n=D.collection.getItem(t.key);(e.key===gs.expand[i]&&n?.hasChildNodes&&!D.expandedKeys.has(t.key)||e.key===gs.collapse[i]&&n?.hasChildNodes&&D.expandedKeys.has(t.key))&&D.toggleKey(t.key)}}},A,n);let o=A.getDropOperation;A.getDropOperation=e=>{let{target:t,isInternal:n}=e,r=k?.draggingKeys??new Set;if(n&&t.type===`item`&&r.size>0){if(r.has(t.key)&&t.dropPosition===`on`)return`cancel`;let e=t.key;for(;e!=null;){let t=D.collection.getItem(e)?.parentKey;if(t!=null&&r.has(t))return`cancel`;e=t??null}}return o(e)},M=A.isDropTarget({type:`root`})}let I=!!(o&&!k?.isDisabled),{focusProps:L,isFocused:R,isFocusVisible:z}=mn(),B={isEmpty:D.collection.size===0,isFocused:R,isFocusVisible:z,isDropTarget:M,selectionMode:D.selectionManager.selectionMode,allowsDragging:!!I,state:D},V=Pn({...e,children:void 0,defaultClassName:`react-aria-Tree`,values:B}),H=null;if(D.collection.size===0&&e.renderEmptyState){let{isEmpty:t,...n}=B,r=e.renderEmptyState({...n});H=J.createElement(`div`,{role:`row`,style:{display:`contents`},"aria-level":1},J.createElement(`div`,{role:`gridcell`,style:{display:`contents`}},r))}let U=zn(e,{global:!0});return J.createElement(J.Fragment,null,J.createElement(ir,null,J.createElement(Rn.div,{...hn(U,V,O,L,j?.collectionProps),ref:n,slot:e.slot||void 0,"data-empty":D.collection.size===0||void 0,"data-focused":R||void 0,"data-drop-target":M||void 0,"data-focus-visible":z||void 0,"data-selection-mode":D.selectionManager.selectionMode===`none`?void 0:D.selectionManager.selectionMode,"data-allows-dragging":!!I||void 0},J.createElement(bn,{values:[[ms,D],[ns,{dragAndDropHooks:r,dragState:k,dropState:A}],[rs,{render:Cs}]]},s&&J.createElement(Es,null),J.createElement(cs,null,J.createElement(h,{collection:D.collection,persistedKeys:os(D.selectionManager,r,A),scrollRef:n,renderDropIndicator:as(r,A)}))),H)),N)}var vs=class extends Mi{};vs.type=`content`;var ys=ta(vs,function(e){let t=(0,J.useContext)(bs),n=Pn({children:e.children,values:t});return J.createElement(da.Provider,{value:ca},n.children)}),bs=(0,J.createContext)(null),xs=class extends Mi{};xs.type=`item`;var Ss=na(xs,(e,t,n)=>{let r=(0,J.useContext)(ms);t=In(t);let{dragAndDropHooks:i,dragState:a,dropState:o}=(0,J.useContext)(ns),{rowProps:s,gridCellProps:c,expandButtonProps:l,descriptionProps:u,...d}=qo({node:n,shouldSelectOnPressUp:!!a},r,t),f=s[`aria-expanded`]===!0,p=e.hasChildItems||[...r.collection.getChildren(n.key)].length>1,m=s[`aria-level`]||1,{hoverProps:h,isHovered:g}=gn({isDisabled:!d.allowsSelection&&!d.hasAction,onHoverStart:e.onHoverStart,onHoverChange:e.onHoverChange,onHoverEnd:e.onHoverEnd}),{isFocusVisible:_,focusProps:v}=mn(),{isFocusVisible:y,focusProps:b}=mn({within:!0}),{checkboxProps:x}=co({key:n.key},r),S=null;a&&i&&(S=i.useDraggableItem({key:n.key,hasDragButton:!0},a));let C=null,w=(0,J.useRef)(null),T=(0,J.useRef)(null),E=(0,J.useRef)(null),{visuallyHiddenProps:D}=sr();o&&i&&(C=i.useDropIndicator({target:{type:`item`,key:n.key,dropPosition:`on`},activateButtonRef:E},o,T));let O=a&&a.isDragging(n.key),k=C?.isDropTarget,A=r.selectionManager.selectionMode,j=r.selectionManager.selectionBehavior,M=J.useMemo(()=>({...d,isHovered:g,isFocusVisible:_,isExpanded:f,hasChildItems:p,level:m,selectionMode:A,selectionBehavior:j,isFocusVisibleWithin:y,state:r,id:n.key,allowsDragging:!!a,isDragging:O,isDropTarget:k}),[d,g,_,f,p,m,y,r,n.key,a,O,k,j,A]),N=Pn({...e,id:void 0,children:n.rendered,defaultClassName:`react-aria-TreeItem`,defaultStyle:{"--tree-item-level":m},values:M});(0,J.useEffect)(()=>{n.textValue},[n.textValue]),(0,J.useEffect)(()=>{p&&w.current},[]);let P=(0,J.useRef)(null);(0,J.useEffect)(()=>{a&&P.current},[]);let F=Ui({items:r.collection.getChildren(n.key),children:e=>{switch(e.type){case`content`:return e.render(e);case`loader`:case`item`:return J.createElement(J.Fragment,null);default:throw Error(`Unsupported element type in TreeRow: `+e.type)}}}),I=dn(),L=zn(e,{global:!0});return delete L.id,delete L.onClick,J.createElement(J.Fragment,null,C&&!C.isHidden&&J.createElement(`div`,{role:`row`,"aria-level":s[`aria-level`],"aria-expanded":s[`aria-expanded`],"aria-label":C.dropIndicatorProps[`aria-label`]},J.createElement(`div`,{role:`gridcell`,"aria-colindex":1,style:{display:`contents`}},J.createElement(`div`,{role:`button`,...D,...C.dropIndicatorProps,ref:T}),s[`aria-expanded`]==null?null:J.createElement(`div`,{role:`button`,...D,id:I,"aria-label":l[`aria-label`],"aria-labelledby":`${I} ${s.id}`,tabIndex:-1,ref:E}))),J.createElement(Rn.div,{...hn(L,s,v,h,b,S?.dragProps),...N,ref:t,"data-expanded":p&&f||void 0,"data-has-child-items":p||void 0,"data-level":m,"data-selected":d.isSelected||void 0,"data-disabled":d.isDisabled||void 0,"data-hovered":g||void 0,"data-focused":d.isFocused||void 0,"data-focus-visible":_||void 0,"data-pressed":d.isPressed||void 0,"data-selection-mode":r.selectionManager.selectionMode===`none`?void 0:r.selectionManager.selectionMode,"data-allows-dragging":!!a||void 0,"data-dragging":O||void 0,"data-drop-target":k||void 0},J.createElement(`div`,{...c,style:{display:`contents`}},J.createElement(bn,{values:[[$n,{slots:{selection:x}}],[Fn,{slots:{[Un]:{},chevron:{...l,ref:w},drag:{...S?.dragButtonProps,ref:P,style:{pointerEvents:`none`}}}}],[bs,{...M}],[pr,{isSelected:d.isSelected}]]},F))))});ta(Fi,function(e,t,n){let{isVirtualized:r}=(0,J.useContext)(da),i=(0,J.useContext)(ms),{isLoading:a,onLoadMore:o,scrollOffset:s,...c}=e,l=(0,J.useRef)(null);Yr((0,J.useMemo)(()=>({onLoadMore:o,collection:i?.collection,sentinelRef:l,scrollOffset:s}),[o,s,i?.collection]),l),t=In(t);let{rowProps:u,gridCellProps:d}=qo({node:n},i,t),f=u[`aria-level`]||1,p={role:`row`,"aria-level":u[`aria-level`]},m=Pn({...c,id:void 0,children:n.rendered,defaultClassName:`react-aria-TreeLoader`,values:{level:f}}),h={};return r&&(h={display:`contents`}),J.createElement(J.Fragment,null,J.createElement(`div`,{style:{position:`relative`,width:0,height:0},inert:Xr(!0)},J.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:l,style:{position:`absolute`,height:1,width:1}})),a&&m.children&&J.createElement(Rn.div,{ref:t,...hn(zn(e),p),...m,"data-level":f},J.createElement(`div`,{...d,style:h},m.children)))});function Cs(e,t){t=In(t);let{dragAndDropHooks:n,dropState:r}=(0,J.useContext)(ns),i=(0,J.useRef)(null),{dropIndicatorProps:a,isHidden:o,isDropTarget:s}=n.useDropIndicator(e,r,i);if(o)return null;let c=r&&e.target.type===`item`?(r.collection.getItem(e.target.key)?.level||0)+1:1;return J.createElement(Ts,{...e,dropIndicatorProps:a,isDropTarget:s,ref:t,buttonRef:i,level:c})}function ws(e,t){let{dropIndicatorProps:n,isDropTarget:r,buttonRef:i,level:a,...o}=e,{visuallyHiddenProps:s}=sr(),c=Pn({...o,defaultClassName:`react-aria-DropIndicator`,defaultStyle:{position:`relative`,"--tree-item-level":a},values:{isDropTarget:r}});return J.createElement(Rn.div,{...c,role:`row`,"aria-level":a,ref:t,"data-drop-target":r||void 0},J.createElement(`div`,{role:`gridcell`},J.createElement(`div`,{...s,role:`button`,...n,ref:i}),c.children))}var Ts=(0,J.forwardRef)(ws);function Es(){let{dragAndDropHooks:e,dropState:t}=(0,J.useContext)(ns),n=(0,J.useRef)(null),{dropIndicatorProps:r}=e.useDropIndicator({target:{type:`root`}},t,n),i=t.isDropTarget({type:`root`}),{visuallyHiddenProps:a}=sr();return!i&&r[`aria-hidden`]?null:J.createElement(`div`,{role:`row`,"aria-hidden":r[`aria-hidden`],style:{position:`absolute`}},J.createElement(`div`,{role:`gridcell`},J.createElement(`div`,{role:`button`,...a,...r,ref:n})))}function Ds(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}var Os=[`openai`,`github`,`anthropic`,`google`,`ollama`,`bedrock`,`deepseek`,`azure`,`openrouter`,`wandb`,`opencode-go`,`marimo`],ks=class e{providerId;shortModelId;constructor(e,t){this.providerId=e,this.shortModelId=t}get id(){return`${this.providerId}/${this.shortModelId}`}static parse(t){if(!t.includes(`/`)){let n=As(t);return new e(n,t)}let[n,...r]=t.split(`/`);return new e(n,r.join(`/`))}};function As(e){return e.startsWith(`gpt`)||e.startsWith(`o3`)||e.startsWith(`o1`)?`openai`:e.startsWith(`claude`)?`anthropic`:e.startsWith(`gemini`)||e.startsWith(`google`)?`google`:e.startsWith(`deepseek`)?`deepseek`:`ollama`}function js(e){return Os.includes(e)}var Ms=JSON.parse(`{"anthropic":[{"name":"Claude Fable 5.1","model":"claude-fable-5-1","description":"Anthropic's most capable generally available model for ambitious, long-running coding, agentic, research, and enterprise workflows","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image","pdf"],"output_types":["text"],"release_date":"2026-09-01","cost":{"input":10,"output":50}},{"name":"Claude Opus 5","model":"claude-opus-5","description":"Anthropic's flagship model for demanding reasoning, coding, and long-horizon agentic work","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image","pdf"],"output_types":["text"],"release_date":"2026-07-24","cost":{"input":5,"output":25}},{"name":"Claude Fable 5","model":"claude-fable-5","description":"Anthropic's Mythos-class model built for demanding reasoning, coding, and long-horizon agentic work","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image","pdf"],"output_types":["text"],"release_date":"2026-06-09","cost":{"input":10,"output":50}},{"name":"Claude Sonnet 5","model":"claude-sonnet-5","description":"Anthropic's most agentic Sonnet model yet, built for planning, tool use, and autonomous multi-step work at Sonnet pricing","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image","pdf"],"output_types":["text"],"release_date":"2026-06-30","cost":{"input":2,"output":10}},{"name":"Claude Opus 4.8","model":"claude-opus-4-8","description":"Modest but tangible improvement over Claude Opus 4.7","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image","pdf"],"output_types":["text"],"release_date":"2026-05-28","cost":{"input":5,"output":25}},{"name":"Claude Opus 4.7","model":"claude-opus-4-7","description":"Anthropic Opus model built for long-running, asynchronous agents","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image","pdf"],"output_types":["text"],"release_date":"2026-04-16","cost":{"input":5,"output":25}},{"name":"Claude Sonnet 4.6","model":"claude-sonnet-4-6","description":"Anthropic Sonnet model for coding, agents, and professional work","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image","pdf"],"output_types":["text"],"release_date":"2026-02-17","cost":{"input":3,"output":15}},{"name":"Claude Opus 4.6","model":"claude-opus-4-6","description":"Anthropic Opus model for coding and long-running professional tasks","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image","pdf"],"output_types":["text"],"release_date":"2026-02-05","cost":{"input":5,"output":25}},{"name":"Claude Opus 4.5","model":"claude-opus-4-5","description":"Anthropic Opus reasoning model for complex software engineering, agentic workflows, and long-horizon computer use","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image","pdf"],"output_types":["text"],"release_date":"2025-11-24","cost":{"input":5,"output":25}},{"name":"Claude Haiku 4.5","model":"claude-haiku-4-5","description":"Anthropic's fastest and most efficient model, delivering near-frontier intelligence at a fraction of the cost and latency of larger Claude models","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image","pdf"],"output_types":["text"],"release_date":"2025-10-15","cost":{"input":1,"output":5}},{"name":"Claude Sonnet 4.5","model":"claude-sonnet-4-5","description":"Anthropic Sonnet model optimized for real-world agents and coding workflows","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image","pdf"],"output_types":["text"],"release_date":"2025-09-29","cost":{"input":3,"output":15}}],"openai":[{"name":"GPT-5.6","model":"gpt-5.6","description":"OpenAI's GPT-5.6 flagship tier for frontier reasoning, coding, and agentic workflows","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image","pdf"],"output_types":["text"],"release_date":"2026-07-09","cost":{"input":5,"output":30}},{"name":"GPT-5.6 Luna","model":"gpt-5.6-luna","description":"Fast, cost-efficient model in OpenAI's GPT-5.6 series, suited for high-volume, latency-sensitive chat and lightweight agentic workflows","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image","pdf"],"output_types":["text"],"release_date":"2026-07-09","cost":{"input":1,"output":6}},{"name":"GPT-5.6 Sol","model":"gpt-5.6-sol","description":"Flagship model in OpenAI's GPT-5.6 series, suited for complex reasoning, coding, and agentic workflows","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image","pdf"],"output_types":["text"],"release_date":"2026-07-09","cost":{"input":5,"output":30}},{"name":"GPT-5.6 Terra","model":"gpt-5.6-terra","description":"Balanced model in OpenAI's GPT-5.6 series, suited for everyday coding, reasoning, and agentic workflows","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image","pdf"],"output_types":["text"],"release_date":"2026-07-09","cost":{"input":2.5,"output":15}},{"name":"GPT-5.5","model":"gpt-5.5","description":"OpenAI model for complex professional workloads, with stronger reasoning, reliability, and token efficiency than GPT-5.4 on hard tasks","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image","pdf"],"output_types":["text"],"release_date":"2026-04-23","cost":{"input":5,"output":30}},{"name":"GPT-5.4 mini","model":"gpt-5.4-mini","description":"GPT-5.4 mini brings the core capabilities of GPT-5.4 to a faster, more efficient model optimized for high-throughput workloads","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image"],"output_types":["text"],"release_date":"2026-03-17","cost":{"input":0.75,"output":4.5}},{"name":"GPT-5.4 nano","model":"gpt-5.4-nano","description":"Most lightweight and cost-efficient variant of the GPT-5.4 family, optimized for speed-critical and high-volume tasks","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image"],"output_types":["text"],"release_date":"2026-03-17","cost":{"input":0.2,"output":1.25}},{"name":"GPT-5.4","model":"gpt-5.4","description":"OpenAI model that unified the Codex and GPT lines into a single system","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image","pdf"],"output_types":["text"],"release_date":"2026-03-05","cost":{"input":2.5,"output":15}},{"name":"GPT-5.3 Codex","model":"gpt-5.3-codex","description":"Agentic coding model that combines GPT-5.2-Codex software engineering performance with GPT-5.2 reasoning and professional knowledge","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image","pdf"],"output_types":["text"],"release_date":"2026-02-05","cost":{"input":1.75,"output":14}},{"name":"ChatGPT Image","model":"chatgpt-image-latest","description":"Previous-generation image model used in ChatGPT for image generation and editing from text and image inputs","roles":["chat","edit"],"capabilities":[],"input_types":["text","image"],"output_types":["text","image"],"release_date":"2025-12-16"}],"google":[{"name":"Gemini 3.8 Flash","model":"gemini-3.8-flash","description":"Google's most intelligent Flash model, with gains in software engineering, agentic tasks, and multi-step reasoning","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image","pdf"],"output_types":["text"],"release_date":"2026-09-02","cost":{"input":0.75,"output":3.75}},{"name":"Claude Fable 5.1","model":"claude-fable-5-1@default","description":"Anthropic's most capable generally available model for ambitious, long-running coding, agentic, research, and enterprise workflows, available through Vertex AI only","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image","pdf"],"output_types":["text"],"release_date":"2026-09-01","cost":{"input":10,"output":50}},{"name":"Gemini Flash Latest","model":"gemini-flash-latest","description":"Alias that points to the latest Gemini Flash release and can change when Google updates the model family","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image","pdf"],"output_types":["text"],"release_date":"2026-08-13","cost":{"input":0.75,"output":3.75}},{"name":"Gemini 3.7 Flash","model":"gemini-3.7-flash","description":"High-efficiency Gemini model for agentic workflows, coding, and multimodal reasoning","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image","pdf"],"output_types":["text"],"release_date":"2026-08-13","cost":{"input":0.75,"output":3.75}},{"name":"Gemini 3.6 Flash","model":"gemini-3.6-flash","description":"Google's high-efficiency model for coding, agentic workflows, and web and app development","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image","pdf"],"output_types":["text"],"release_date":"2026-07-21","cost":{"input":1.5,"output":7.5}},{"name":"Gemini 3.5 Flash Lite","model":"gemini-3.5-flash-lite","description":"Google's high-efficiency model with upgraded agentic capabilities, suited for focused subagent tasks in multi-agent workflows","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image","pdf"],"output_types":["text"],"release_date":"2026-07-21","cost":{"input":0.3,"output":2.5}},{"name":"Gemini 3.5 Flash","model":"gemini-3.5-flash","description":"Google's high-efficiency multimodal model, bringing near-Pro level coding and reasoning at Flash-tier cost and speed","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image","pdf"],"output_types":["text"],"release_date":"2026-05-19","cost":{"input":1.5,"output":9}},{"name":"Gemini 3.1 Flash Lite","model":"gemini-3.1-flash-lite","description":"Google's GA high-efficiency multimodal model optimized for low-latency, high-volume workloads","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image","pdf"],"output_types":["text"],"release_date":"2026-05-07","cost":{"input":0.25,"output":1.5}},{"name":"Gemma 4 26B A4B IT","model":"gemma-4-26b-a4b-it","description":"Instruction-tuned Mixture-of-Experts (MoE) model from Google DeepMind","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image"],"output_types":["text"],"release_date":"2026-04-02"},{"name":"Gemma 4 31B IT","model":"gemma-4-31b-it","description":"Google DeepMind's 30.7B dense multimodal model supporting text and image input with text output","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image"],"output_types":["text"],"release_date":"2026-04-02"},{"name":"Nano Banana 2 Lite","model":"gemini-3.1-flash-lite-image","description":"Google's fastest, most cost-efficient Gemini image model for high-velocity text-to-image generation and visual exploration","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image"],"output_types":["text","image"],"release_date":"2026-06-30","cost":{"input":0.25,"output":30}},{"name":"Nano Banana 2","model":"gemini-3.1-flash-image","description":"Google's image generation and editing model, delivering Pro-level visual quality at Flash speed","roles":["chat","edit"],"capabilities":["thinking"],"input_types":["text","image","pdf"],"output_types":["text","image"],"release_date":"2026-05-28","cost":{"input":0.5,"output":60}},{"name":"Gemini 3.1 Pro Preview","model":"gemini-3.1-pro-preview","description":"Google's frontier reasoning model, delivering enhanced software engineering performance, improved agentic reliability, and more efficient token usage across complex workflows","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image","pdf"],"output_types":["text"],"release_date":"2026-02-19","cost":{"input":2,"output":12}},{"name":"Gemini 3.1 Pro Preview Custom Tools","model":"gemini-3.1-pro-preview-customtools","description":"Variant of Gemini 3.1 Pro with refined tool selection that avoids overusing a generic bash tool","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image","pdf"],"output_types":["text"],"release_date":"2026-02-19","cost":{"input":2,"output":12}},{"name":"Claude Opus 5","model":"claude-opus-5@default","description":"Anthropic Claude Opus 5 on Google Vertex AI only (not available via the Gemini API)","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image","pdf"],"output_types":["text"],"release_date":"2026-07-24","cost":{"input":5,"output":25}},{"name":"Claude Sonnet 5","model":"claude-sonnet-5@default","description":"Anthropic Claude Sonnet 5 on Google Vertex AI only (not available via the Gemini API)","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image","pdf"],"output_types":["text"],"release_date":"2026-06-30","cost":{"input":2,"output":10}},{"name":"Claude Opus 4.8","model":"claude-opus-4-8@default","description":"Anthropic Claude Opus 4.8 on Google Vertex AI only (not available via the Gemini API)","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image","pdf"],"output_types":["text"],"release_date":"2026-05-28","cost":{"input":5,"output":25}}],"bedrock":[{"name":"Claude Fable 5.1 (Global)","model":"global.anthropic.claude-fable-5-1","description":"Anthropic's most capable generally available model for ambitious, long-running coding, agentic, research, and enterprise workflows","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image","pdf"],"output_types":["text"],"release_date":"2026-09-01","cost":{"input":10,"output":50}},{"name":"Grok 4.6","model":"xai.grok-4.6","description":"xAI's frontier model for coding, agentic tasks, knowledge work, and visual reasoning","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image"],"output_types":["text"],"release_date":"2026-08-12","cost":{"input":2.2,"output":6.6}},{"name":"GPT-5.6 Luna (Global)","model":"global.openai.gpt-5.6-luna","description":"Fast, cost-efficient model in OpenAI's GPT-5.6 series, suited for high-volume, latency-sensitive chat and lightweight agentic workflows","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image","pdf"],"output_types":["text"],"release_date":"2026-07-09","cost":{"input":0.22,"output":1.32}},{"name":"GPT-5.6 Sol (Global)","model":"global.openai.gpt-5.6-sol","description":"Flagship model in OpenAI's GPT-5.6 series, suited for complex reasoning, coding, and agentic workflows","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image","pdf"],"output_types":["text"],"release_date":"2026-07-09","cost":{"input":5.5,"output":33}},{"name":"Claude Opus 5 (Global)","model":"global.anthropic.claude-opus-5","description":"Anthropic's flagship model for demanding reasoning, coding, and long-horizon agentic work","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image","pdf"],"output_types":["text"],"release_date":"2026-07-24","cost":{"input":5,"output":25}},{"name":"GPT-5.6 Luna","model":"openai.gpt-5.6-luna","description":"Fast, cost-efficient model in OpenAI's GPT-5.6 series, suited for high-volume, latency-sensitive chat and lightweight agentic workflows","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image","pdf"],"output_types":["text"],"release_date":"2026-07-09","cost":{"input":1,"output":6}},{"name":"GPT-5.6 Sol","model":"openai.gpt-5.6-sol","description":"Flagship model in OpenAI's GPT-5.6 series, suited for complex reasoning, coding, and agentic workflows","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image","pdf"],"output_types":["text"],"release_date":"2026-07-09","cost":{"input":5,"output":30}},{"name":"GPT-5.6 Terra","model":"openai.gpt-5.6-terra","description":"Balanced model in OpenAI's GPT-5.6 series, suited for everyday coding, reasoning, and agentic workflows","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image","pdf"],"output_types":["text"],"release_date":"2026-07-09","cost":{"input":2.5,"output":15}},{"name":"Claude Fable 5 (Global)","model":"global.anthropic.claude-fable-5","description":"Anthropic's Mythos-class model built for demanding reasoning, coding, and long-horizon agentic work","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image","pdf"],"output_types":["text"],"release_date":"2026-06-09","cost":{"input":10,"output":50}},{"name":"Claude Sonnet 5 (Global)","model":"global.anthropic.claude-sonnet-5","description":"Anthropic's most agentic Sonnet model yet, built for planning, tool use, and autonomous multi-step work at Sonnet pricing","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image","pdf"],"output_types":["text"],"release_date":"2026-06-30","cost":{"input":2,"output":10}},{"name":"Claude Fable 5 (Global)","model":"global.anthropic.claude-fable-5","description":"Anthropic's Mythos-class model built for demanding reasoning, coding, and long-horizon agentic work","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image","pdf"],"output_types":["text"],"release_date":"2026-06-09","cost":{"input":10,"output":50}},{"name":"Claude Sonnet 5 (Global)","model":"global.anthropic.claude-sonnet-5","description":"Anthropic's most agentic Sonnet model yet, built for planning, tool use, and autonomous multi-step work at Sonnet pricing","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image","pdf"],"output_types":["text"],"release_date":"2026-06-30","cost":{"input":2,"output":10}},{"name":"Claude Opus 4.8 (Global)","model":"global.anthropic.claude-opus-4-8","description":"Modest but tangible improvement over Claude Opus 4.7","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image","pdf"],"output_types":["text"],"release_date":"2026-05-28","cost":{"input":5,"output":25}},{"name":"Claude Opus 4.7","model":"anthropic.claude-opus-4-7","description":"Anthropic Opus model built for long-running, asynchronous agents","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image","pdf"],"output_types":["text"],"release_date":"2026-04-16","cost":{"input":5,"output":25}},{"name":"Claude Opus 4.7 (Global)","model":"global.anthropic.claude-opus-4-7","description":"Anthropic Opus model built for long-running, asynchronous agents","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image","pdf"],"output_types":["text"],"release_date":"2026-04-16","cost":{"input":5,"output":25}},{"name":"MiniMax M2.5","model":"minimax.minimax-m2.5","description":"Large language model designed for real-world productivity","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text"],"output_types":["text"],"release_date":"2026-03-18","cost":{"input":0.3,"output":1.2}},{"name":"GLM-5","model":"zai.glm-5","description":"Z.ai's flagship open-source foundation model engineered for complex systems design and long-horizon agent workflows","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text"],"output_types":["text"],"release_date":"2026-03-18","cost":{"input":1,"output":3.2}},{"name":"NVIDIA Nemotron 3 Super 120B A12B","model":"nvidia.nemotron-super-3-120b","description":"120B-parameter open hybrid MoE model, activating just 12B parameters for maximum compute efficiency and accuracy in complex multi-agent applications","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text"],"output_types":["text"],"release_date":"2026-03-11","cost":{"input":0.15,"output":0.65}},{"name":"Claude Sonnet 4.6","model":"anthropic.claude-sonnet-4-6","description":"Anthropic Sonnet model for coding, agents, and professional work","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image","pdf"],"output_types":["text"],"release_date":"2026-02-17","cost":{"input":3,"output":15}}],"azure":[{"name":"Claude Fable 5.1","model":"claude-fable-5-1","description":"Anthropic's most capable generally available model for ambitious, long-running coding, agentic, research, and enterprise workflows","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image","pdf"],"output_types":["text"],"release_date":"2026-09-01","cost":{"input":10,"output":50}},{"name":"Grok 4.6","model":"grok-4.6","description":"xAI frontier model for coding, knowledge work, and STEM","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image"],"output_types":["text"],"release_date":"2026-08-12"},{"name":"Claude Opus 5","model":"claude-opus-5","description":"Anthropic's flagship model for demanding reasoning, coding, and long-horizon agentic work","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image","pdf"],"output_types":["text"],"release_date":"2026-07-24","cost":{"input":5,"output":25}},{"name":"GPT-5.6 Luna","model":"gpt-5.6-luna","description":"Fast, cost-efficient model in OpenAI's GPT-5.6 series, suited for high-volume, latency-sensitive chat and lightweight agentic workflows","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image","pdf"],"output_types":["text"],"release_date":"2026-07-09","cost":{"input":1,"output":6}},{"name":"GPT-5.6 Sol","model":"gpt-5.6-sol","description":"Flagship model in OpenAI's GPT-5.6 series, suited for complex reasoning, coding, and agentic workflows","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image","pdf"],"output_types":["text"],"release_date":"2026-07-09","cost":{"input":5,"output":30}},{"name":"GPT-5.6 Terra","model":"gpt-5.6-terra","description":"Balanced model in OpenAI's GPT-5.6 series, suited for everyday coding, reasoning, and agentic workflows","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image","pdf"],"output_types":["text"],"release_date":"2026-07-09","cost":{"input":2.5,"output":15}},{"name":"GPT Chat Latest","model":"gpt-chat-latest","description":"OpenAI's stable chat-latest alias that always resolves to the latest Instant chat model used in ChatGPT","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image","pdf"],"output_types":["text"],"release_date":"2026-05-05","cost":{"input":5,"output":30}},{"name":"Claude Fable 5","model":"claude-fable-5","description":"Anthropic's Mythos-class model built for demanding reasoning, coding, and long-horizon agentic work","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image","pdf"],"output_types":["text"],"release_date":"2026-06-09","cost":{"input":10,"output":50}},{"name":"Claude Sonnet 5","model":"claude-sonnet-5","description":"Anthropic's most agentic Sonnet model yet, built for planning, tool use, and autonomous multi-step work at Sonnet pricing","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image","pdf"],"output_types":["text"],"release_date":"2026-06-30","cost":{"input":2,"output":10}},{"name":"GPT-5.5","model":"gpt-5.5","description":"OpenAI model for complex professional workloads, with stronger reasoning, reliability, and token efficiency than GPT-5.4 on hard tasks","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image","pdf"],"output_types":["text"],"release_date":"2026-04-24","cost":{"input":5,"output":30}},{"name":"Kimi K2.6","model":"kimi-k2.6","description":"Moonshot AI multimodal model for long-horizon coding, coding-driven UI/UX generation, and multi-agent orchestration","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image"],"output_types":["text"],"release_date":"2026-04-22","cost":{"input":0.95,"output":4}},{"name":"Grok 4.20 (Non-Reasoning)","model":"grok-4-20-non-reasoning","description":"Reasoning model from xAI with industry-leading speed and agentic tool calling capabilities","roles":["chat","edit"],"capabilities":["tool_calling"],"input_types":["text"],"output_types":["text"],"release_date":"2026-04-08","cost":{"input":2,"output":6}},{"name":"Grok 4.20 (Reasoning)","model":"grok-4-20-reasoning","description":"Reasoning model from xAI with industry-leading speed and agentic tool calling capabilities","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text"],"output_types":["text"],"release_date":"2026-04-08","cost":{"input":2,"output":6}},{"name":"GPT-5.4 Mini","model":"gpt-5.4-mini","description":"GPT-5.4 mini brings the core capabilities of GPT-5.4 to a faster, more efficient model optimized for high-throughput workloads","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image","pdf"],"output_types":["text"],"release_date":"2026-03-17","cost":{"input":0.75,"output":4.5}},{"name":"GPT-5.4 Nano","model":"gpt-5.4-nano","description":"Most lightweight and cost-efficient variant of the GPT-5.4 family, optimized for speed-critical and high-volume tasks","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image","pdf"],"output_types":["text"],"release_date":"2026-03-17","cost":{"input":0.2,"output":1.25}},{"name":"GPT-5.4","model":"gpt-5.4","description":"OpenAI model that unified the Codex and GPT lines into a single system","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image","pdf"],"output_types":["text"],"release_date":"2026-03-05","cost":{"input":2.5,"output":15}},{"name":"GPT-5.3 Codex","model":"gpt-5.3-codex","description":"Agentic coding model that combines GPT-5.2-Codex software engineering performance with GPT-5.2 reasoning and professional knowledge","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image"],"output_types":["text"],"release_date":"2026-02-24","cost":{"input":1.75,"output":14}},{"name":"Claude Opus 4.8","model":"claude-opus-4-8","description":"Modest but tangible improvement over Claude Opus 4.7","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image","pdf"],"output_types":["text"],"release_date":"2026-05-28","cost":{"input":5,"output":25}},{"name":"Claude Sonnet 4.6","model":"claude-sonnet-4-6","description":"Anthropic Sonnet model for coding, agents, and professional work","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image","pdf"],"output_types":["text"],"release_date":"2026-02-17","cost":{"input":3,"output":15}},{"name":"DeepSeek-V4-Flash","model":"deepseek-v4-flash","description":"Efficiency-optimized Mixture-of-Experts model from DeepSeek with 284B total parameters and 13B activated parameters, supporting a 1M-token context window","roles":["chat","edit"],"capabilities":["thinking"],"input_types":["text"],"output_types":["text"],"release_date":"2026-04-24","cost":{"input":0.19,"output":0.51}},{"name":"DeepSeek-V4-Pro","model":"deepseek-v4-pro","description":"Large-scale Mixture-of-Experts model from DeepSeek with 1.6T total parameters and 49B activated parameters, supporting a 1M-token context window","roles":["chat","edit"],"capabilities":["thinking"],"input_types":["text"],"output_types":["text"],"release_date":"2026-04-24","cost":{"input":1.74,"output":3.48}}],"ollama":[{"name":"GLM-5.3-Flash","model":"glm-5.3-flash","description":"Native multimodal model from Z.ai optimized for efficient coding and long-horizon agent tasks","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image","pdf"],"output_types":["text"],"release_date":"2026-08-26"},{"name":"GLM-5.3","model":"glm-5.3","description":"Large-scale reasoning model from Z.ai built for complex software engineering and long-horizon agent tasks","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text"],"output_types":["text"],"release_date":"2026-08-14"},{"name":"DeepSeek V4 Flash 0731","model":"deepseek-v4-flash:0731","description":"DeepSeek V4 Flash 0731 is a sparse mixture-of-experts model from DeepSeek, with 13B active parameters out of 284B total","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text"],"output_types":["text"],"release_date":"2026-07-31"},{"name":"kimi-k3","model":"kimi-k3","description":"Moonshot AI's 2.8T-parameter open-weight multimodal reasoning model for complex coding, knowledge work, and long-horizon agentic workflows","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image"],"output_types":["text"],"release_date":"2026-07-16"},{"name":"DeepSeek V4 Flash","model":"deepseek-v4-flash","description":"Efficiency-optimized Mixture-of-Experts model from DeepSeek with 284B total parameters and 13B activated parameters, supporting a 1M-token context window","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text"],"output_types":["text"],"release_date":"2026-04-24"},{"name":"DeepSeek V4 Pro","model":"deepseek-v4-pro","description":"Large-scale Mixture-of-Experts model from DeepSeek with 1.6T total parameters and 49B activated parameters, supporting a 1M-token context window","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text"],"output_types":["text"],"release_date":"2026-04-24"},{"name":"Kimi K2.7 Code","model":"kimi-k2.7-code","description":"Coding-focused model in Moonshot AI's Kimi K2 family, built to complete end-to-end programming tasks reliably over long contexts","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image"],"output_types":["text"],"release_date":"2026-06-12"},{"name":"Kimi K2.6","model":"kimi-k2.6","description":"Moonshot AI multimodal model for long-horizon coding, coding-driven UI/UX generation, and multi-agent orchestration","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image"],"output_types":["text"],"release_date":"2026-04-20"},{"name":"Gemma 4 31B","model":"gemma4:31b","description":"Google DeepMind's 30.7B dense multimodal model supporting text and image input with text output","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image"],"output_types":["text"],"release_date":"2026-04-02"},{"name":"GLM 5.2","model":"glm-5.2","description":"Large-scale reasoning model from Z.ai with a 1M-token context window, suited for long-horizon agent workflows and project-level software engineering","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text"],"output_types":["text"],"release_date":"2026-06-13"},{"name":"GLM 5.1","model":"glm-5.1","description":"GLM-5.1 delivers a major leap in coding capability, with particularly significant gains in handling long-horizon tasks","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text"],"output_types":["text"],"release_date":"2026-03-27"},{"name":"MiniMax M3","model":"minimax-m3","description":"Multimodal foundation model from MiniMax with a 1M-token context window, suited for long-horizon agentic work and coding","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image"],"output_types":["text"],"release_date":"2026-05-31"},{"name":"MiniMax M2.7","model":"minimax-m2.7","description":"Large language model designed for autonomous, real-world productivity and continuous improvement","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text"],"output_types":["text"],"release_date":"2026-03-18"},{"name":"NVIDIA Nemotron 3 Ultra","model":"nemotron-3-ultra","description":"Open reasoning and orchestration model from NVIDIA with 55B active parameters out of 550B total (MoE)","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text"],"output_types":["text"],"release_date":"2026-06-04"},{"name":"NVIDIA Nemotron 3 Super 120B","model":"nemotron-3-super","description":"120B-parameter open hybrid MoE model, activating just 12B parameters for maximum compute efficiency and accuracy in complex multi-agent applications","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text"],"output_types":["text"],"release_date":"2026-03-11"},{"name":"Qwen 3.5 397B","model":"qwen3.5:397b","description":"Built on a hybrid architecture that integrates a linear attention mechanism with a sparse mixture-of-experts model, achieving higher inference efficiency","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image"],"output_types":["text"],"release_date":"2026-02-15"}],"wandb":[{"name":"Granite 4.2 8B","model":"ibm-granite/granite-4.2-8b","description":"Dense reasoning model from IBM for mathematics, code generation, multilingual dialogue, and multi-step agentic workflows","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text"],"output_types":["text"],"release_date":"2026-08-24","cost":{"input":0.1,"output":0.15}},{"name":"DeepSeek V4 Pro 0813","model":"deepseek-ai/DeepSeek-V4-Pro-0813","description":"Large-scale Mixture-of-Experts model and generally available release of DeepSeek V4 Pro","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text"],"output_types":["text"],"release_date":"2026-08-13","cost":{"input":1.31,"output":3.96}},{"name":"Qwen3.8 27B","model":"Qwen/Qwen3.8-27B","description":"Alibaba's 27B dense multimodal model for coding, professional work, research, and long-horizon agentic tasks","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image"],"output_types":["text"],"release_date":"2026-08-14","cost":{"input":0.4,"output":3}},{"name":"Nemotron 3.5 Lightning","model":"nvidia/NVIDIA-Nemotron-3.5-Lightning-30B-A3B","description":"MoE model built for fast, reliable agentic tasks across financial services, cybersecurity, telecom, and retail","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text"],"output_types":["text"],"release_date":"2026-08-11","cost":{"input":0.1,"output":0.25}},{"name":"DeepSeek V4 Flash 0731","model":"deepseek-ai/DeepSeek-V4-Flash-0731","description":"DeepSeek V4 Flash 0731 is a sparse mixture-of-experts model from DeepSeek, with 13B active parameters out of 284B total","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text"],"output_types":["text"],"release_date":"2026-07-31","cost":{"input":0.13,"output":0.28}},{"name":"MiniMax M3","model":"MiniMaxAI/MiniMax-M3","description":"Multimodal foundation model from MiniMax with a 1M-token context window, suited for long-horizon agentic work and coding","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image"],"output_types":["text"],"release_date":"2026-06-12","cost":{"input":0.23,"output":0.96}},{"name":"Granite 4.1 8B","model":"ibm-granite/granite-4.1-8b","description":"Dense 8B decoder-only model from IBM's Granite 4.1 family with a 131K-token context window, designed for enterprise tasks","roles":["chat","edit"],"capabilities":["tool_calling"],"input_types":["text"],"output_types":["text"],"release_date":"2026-04-29","cost":{"input":0.05,"output":0.1}},{"name":"DeepSeek V4-Flash","model":"deepseek-ai/DeepSeek-V4-Flash","description":"DeepSeek V4-Flash is an MoE model with 1M context length great for coding, reasoning, and agentic workloads","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text"],"output_types":["text"],"release_date":"2026-04-24","cost":{"input":0.14,"output":0.28}},{"name":"DeepSeek V4 Pro","model":"deepseek-ai/DeepSeek-V4-Pro","description":"DeepSeek V4-Pro is a 1.6T-parameter MoE model with 49B active parameters excelling at advanced reasoning, coding, and complex agentic workloads","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text"],"output_types":["text"],"release_date":"2026-04-24","cost":{"input":1.15,"output":2.55}},{"name":"GLM 5.2","model":"zai-org/GLM-5.2","description":"GLM-5.2 is a Mixture-of-Experts language model featuring 40 billion activated parameters and a total of 744 billion parameters","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text"],"output_types":["text"],"release_date":"2026-06-16","cost":{"input":0.76,"output":2.42}},{"name":"Z.AI GLM-5.1","model":"zai-org/GLM-5.1","description":"GLM-5.1 delivers a major leap in coding capability, with particularly significant gains in handling long-horizon tasks","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text"],"output_types":["text"],"release_date":"2026-04-07","cost":{"input":1.4,"output":4.4}},{"name":"Nemotron 3 Ultra","model":"nvidia/NVIDIA-Nemotron-3-Ultra-550B-A55B","description":"Open reasoning and orchestration model from NVIDIA with 55B active parameters out of 550B total (MoE)","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text"],"output_types":["text"],"release_date":"2026-06-04","cost":{"input":0.75,"output":2.75}},{"name":"NVIDIA Nemotron 3 Super 120B","model":"nvidia/NVIDIA-Nemotron-3-Super-120B-A12B-FP8","description":"120B-parameter open hybrid MoE model, activating just 12B parameters for maximum compute efficiency and accuracy in complex multi-agent applications","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text"],"output_types":["text"],"release_date":"2026-03-11","cost":{"input":0.2,"output":0.8}},{"name":"MiniMax M2.5","model":"MiniMaxAI/MiniMax-M2.5","description":"Large language model designed for real-world productivity","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text"],"output_types":["text"],"release_date":"2026-02-12","cost":{"input":0.3,"output":1.2}},{"name":"Kimi K2.7 Code","model":"moonshotai/Kimi-K2.7-Code","description":"Kimi K2.7 Code is a 1T-parameter MoE model with 32B active parameters purpose-built for long-horizon agentic coding and software engineering","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text"],"output_types":["text"],"release_date":"2026-06-12","cost":{"input":0.71,"output":3.5}},{"name":"Moonshot AI Kimi K2.6","model":"moonshotai/Kimi-K2.6","description":"Kimi K2.6 is a multimodal Mixture-of-Experts language model featuring 32 billion activated parameters and a total of 1 trillion parameters","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image"],"output_types":["text"],"release_date":"2026-04-20","cost":{"input":0.95,"output":4}},{"name":"gpt-oss-120b","model":"openai/gpt-oss-120b","description":"Open-weight, 117B-parameter Mixture-of-Experts (MoE) language model from OpenAI designed for high-reasoning, agentic, and general-purpose production use cases","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text"],"output_types":["text"],"release_date":"2025-08-05","cost":{"input":0.04,"output":0.14}},{"name":"gpt-oss-20b","model":"openai/gpt-oss-20b","description":"Open-weight 21B parameter model released by OpenAI under the Apache 2.0 license","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text"],"output_types":["text"],"release_date":"2025-08-05","cost":{"input":0.03,"output":0.13}},{"name":"Qwen3.6 35B A3B","model":"Qwen/Qwen3.6-35B-A3B","description":"Qwen3.6-35B-A3B is an MoE multimodal model with 262K context optimized for agentic coding workflows","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image"],"output_types":["text"],"release_date":"2026-04-16","cost":{"input":0.25,"output":1.25}},{"name":"Qwen3.6 27B","model":"Qwen/Qwen3.6-27B","description":"Qwen3.6-27B is a 27B dense multimodal model with 262K context built for flagship-level agentic coding","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image"],"output_types":["text"],"release_date":"2026-04-22","cost":{"input":0.6,"output":3.6}},{"name":"Mellum2 12B A2.5B","model":"JetBrains/Mellum2-12B-A2.5B-Instruct","description":"Mellum2-12B-A2.5B-Instruct is a fast MoE model with 131K context built for coding, tool use, and low-latency AI workflows","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text"],"output_types":["text"],"release_date":"2026-06-01","cost":{"input":0.05,"output":0.1}}],"opencode-go":[{"name":"Muse Spark 1.3 Contributor","model":"muse-spark-1.3-contributor","description":"Cost-efficient contributor tier of Meta's multimodal reasoning model for experimentation, learning, and early-stage agentic, multi-agent, and coding workflows","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image","pdf"],"output_types":["text"],"release_date":"2026-09-02","cost":{"input":0.1,"output":0.2}},{"name":"Hy4 preview","model":"hy4-preview","description":"Mixture-of-Experts model from Tencent designed for coding agents, complex tool use, and productivity tasks","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text"],"output_types":["text"],"release_date":"2026-08-28","cost":{"input":0.834,"output":2.501}},{"name":"GLM-5.3-Flash (2x usage)","model":"glm-5.3-flash","description":"Native multimodal model from Z.ai optimized for efficient coding and long-horizon agent tasks","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image","pdf"],"output_types":["text"],"release_date":"2026-08-26","cost":{"input":0.075,"output":0.25}},{"name":"Qwen3.8 Flash","model":"qwen3.8-flash","description":"Multimodal reasoning model from Alibaba for coding, agentic workflows, visual understanding, document and codebase analysis, and desktop interaction","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image"],"output_types":["text"],"release_date":"2026-08-26","cost":{"input":0.15,"output":0.47}},{"name":"DeepSeek V4 Flash Vision Exp","model":"deepseek-v4-flash-vision-exp","description":"Experimental multimodal variant of DeepSeek V4 Flash that adds image understanding while retaining its text and agent capabilities","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image"],"output_types":["text"],"release_date":"2026-08-21","cost":{"input":0.22,"output":0.66}},{"name":"Muse Spark 1.2 Contributor","model":"muse-spark-1.2-contributor","description":"Discounted Meta coding model that permits prompts and completions to train future Meta models","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image","pdf"],"output_types":["text"],"release_date":"2026-08-05","cost":{"input":0.1,"output":0.2}},{"name":"GLM-5.3","model":"glm-5.3","description":"Flagship GLM model for long-horizon coding, agents, and complex project delivery","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text"],"output_types":["text"],"release_date":"2026-08-14","cost":{"input":1.4,"output":4.4}},{"name":"Qwen3.8 Max","model":"qwen3.8-max","description":"Flagship multimodal reasoning model in Alibaba's Qwen3.8 series, intended for complex reasoning, visual understanding, and agentic workflows","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image"],"output_types":["text"],"release_date":"2026-08-03","cost":{"input":2,"output":6}},{"name":"GPT-5.6 Luna (2x usage)","model":"gpt-5.6-luna","description":"Fast, cost-efficient model in OpenAI's GPT-5.6 series, suited for high-volume, latency-sensitive chat and lightweight agentic workflows","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image","pdf"],"output_types":["text"],"release_date":"2026-07-09","cost":{"input":0.1,"output":0.6}},{"name":"Kimi K3 (2x usage)","model":"kimi-k3","description":"Moonshot AI's 2.8T-parameter open-weight multimodal reasoning model for complex coding, knowledge work, and long-horizon agentic workflows","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image"],"output_types":["text"],"release_date":"2026-07-16","cost":{"input":3,"output":15}},{"name":"DeepSeek V4 Flash","model":"deepseek-v4-flash","description":"Efficiency-optimized Mixture-of-Experts model from DeepSeek with 284B total parameters and 13B activated parameters, supporting a 1M-token context window","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text"],"output_types":["text"],"release_date":"2026-04-24","cost":{"input":0.14,"output":0.28}},{"name":"DeepSeek V4 Pro","model":"deepseek-v4-pro","description":"Large-scale Mixture-of-Experts model from DeepSeek with 1.6T total parameters and 49B activated parameters, supporting a 1M-token context window","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text"],"output_types":["text"],"release_date":"2026-04-24","cost":{"input":1.74,"output":3.48}},{"name":"Kimi K2.7 Code","model":"kimi-k2.7-code","description":"Coding-focused model in Moonshot AI's Kimi K2 family, built to complete end-to-end programming tasks reliably over long contexts","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image"],"output_types":["text"],"release_date":"2026-06-12","cost":{"input":0.95,"output":4}},{"name":"Kimi K2.6","model":"kimi-k2.6","description":"Moonshot AI multimodal model for long-horizon coding, coding-driven UI/UX generation, and multi-agent orchestration","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image"],"output_types":["text"],"release_date":"2026-04-21","cost":{"input":0.95,"output":4}},{"name":"GLM 5.2","model":"glm-5.2","description":"Large-scale reasoning model from Z.ai with a 1M-token context window, suited for long-horizon agent workflows and project-level software engineering","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text"],"output_types":["text"],"release_date":"2026-06-13","cost":{"input":1.4,"output":4.4}},{"name":"Qwen3.7 Plus","model":"qwen3.7-plus","description":"Cost-effective model in Alibaba's Qwen3.7 series supporting text and image input with upgraded text capabilities","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image"],"output_types":["text"],"release_date":"2026-06-02","cost":{"input":0.4,"output":1.6}},{"name":"Qwen3.7 Max","model":"qwen3.7-max","description":"Capable of writing and debugging code, and sustaining autonomous execution across hundreds or thousands of steps","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text"],"output_types":["text"],"release_date":"2026-05-21","cost":{"input":2.5,"output":7.5}},{"name":"MiniMax M3 (3x usage)","model":"minimax-m3","description":"Multimodal foundation model from MiniMax with a 1M-token context window, suited for long-horizon agentic work and coding","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image"],"output_types":["text"],"release_date":"2026-05-31","cost":{"input":0.1,"output":0.4}},{"name":"MiMo V2.5","model":"mimo-v2.5","description":"Native omnimodal model from Xiaomi delivering Pro-level agentic performance at roughly half the inference cost","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image"],"output_types":["text"],"release_date":"2026-04-22","cost":{"input":0.4,"output":2}},{"name":"MiMo V2.5 Pro","model":"mimo-v2.5-pro","description":"Xiaomi's flagship model, delivering strong performance in general agentic capabilities, complex software engineering, and long-horizon tasks, with top rankings on benchmarks such as ClawEval, GDPVal,…","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text"],"output_types":["text"],"release_date":"2026-04-22","cost":{"input":1,"output":3}}]}`),Ns=[{name:`OpenAI`,id:`openai`,description:`OpenAI's API for GPT models, including GPT-3.5 and GPT-4.`,url:`https://platform.openai.com/`},{name:`GitHub Copilot`,id:`github`,description:`GitHub Copilot provides model inference through a Copilot subscription.`,url:`https://pydantic.dev/docs/ai/models/github-copilot/`},{name:`Amazon Bedrock`,id:`bedrock`,description:`Amazon Bedrock provides access to foundation models from Amazon and leading AI startups via a unified API.`,url:`https://aws.amazon.com/bedrock/`},{name:`Azure`,id:`azure`,description:`Azure provides access to models via the Azure cloud.`,url:`https://azure.microsoft.com/en-us/products/ai-services/`},{name:`Anthropic`,id:`anthropic`,description:`Anthropic's Claude models for conversational and completion tasks.`,url:`https://www.anthropic.com/`},{name:`Google AI`,id:`google`,description:`Google's Vertex AI and PaLM APIs for generative and conversational models.`,url:`https://cloud.google.com/vertex-ai/docs/generative-ai/learn/overview`},{name:`Ollama`,id:`ollama`,description:`Ollama is a lightweight, open-source model server for running and sharing LLMs.`,url:`https://ollama.ai/`},{name:`marimo`,id:`marimo`,description:`marimo's hosted models.`,url:`https://docs.marimo.io/guides/editor_features/ai_completion/`},{name:`DeepSeek`,id:`deepseek`,description:`DeepSeek's API for GPT models.`,url:`https://deepseek.com/`},{name:`LM Studio`,id:`lmstudio`,description:`LM Studio's API for GPT models.`,url:`https://lmstudio.ai/`},{name:`OpenRouter`,id:`openrouter`,description:`OpenRouter's API for GPT models.`,url:`https://openrouter.ai/`},{name:`Mistral`,id:`mistral`,description:`Mistral's API for GPT models.`,url:`https://mistral.ai/`},{name:`Vercel v0`,id:`vercel`,description:`Vercel's API for GPT models.`,url:`https://vercel.com/`},{name:`Together AI`,id:`together`,description:`Together AI's API for GPT models.`,url:`https://together.ai/`},{name:`xAI`,id:`xai`,description:`xAI's API for GPT models.`,url:`https://x.ai/`},{name:`Weights & Biases`,id:`wandb`,description:`Weights & Biases' hosted models for ML development and AI inference.`,url:`https://wandb.ai/`},{name:`OpenCode Go`,id:`opencode-go`,description:`Low-cost subscription for reliable access to popular open coding models.`,url:`https://opencode.ai/docs/go/`}],Ps=Ms,Fs=Ns,Is=Nt(()=>{let e=new Map,t=new Map;for(let[n,r]of Object.entries(Ps)){if(!r)continue;let i=n;for(let n of r){let r=n.model,a={...n,model:r,provider:i,custom:!1},o=`${i}/${r}`;e.set(o,a),(a.roles.includes(`chat`)||a.roles.includes(`edit`))&&!t.has(i)&&t.set(i,o)}}return{modelMap:e,defaultModelByProvider:t}}),Ls=Nt(()=>{let e=new Map,t=new Map;return Fs.forEach((n,r)=>{e.set(n.id,n),t.set(n.id,r)}),{providerMap:e,providerToOrderIdx:t}}),Rs=class e{modelsByProviderMap=new ze;modelsMap;customModels;displayedModels;constructor(e,t){this.customModels=new Set(e),this.displayedModels=new Set(t),this.modelsMap=new Map,this.buildMaps()}static getProviderInfo(e){let{providerMap:t}=Ls();return t.get(e)}static create(t){let{customModels:n=[],displayedModels:r=[]}=t;return new e(n.map(e=>ks.parse(e).id),r.map(e=>ks.parse(e).id))}buildMaps(){let t=e.buildMapsFromConfig({displayedModels:this.displayedModels,customModels:this.customModels});t.modelsMap.size===0&&(q.error(`The configured displayed_models have filtered out all registered models. Reverting back to showing all models.`,[...this.displayedModels]),t=e.buildMapsFromConfig({displayedModels:new Set,customModels:this.customModels})),this.modelsByProviderMap=t.modelsByProviderMap,this.modelsMap=t.modelsMap}static buildMapsFromConfig(e){let{displayedModels:t,customModels:n}=e,r=t.size>0,i=Is().modelMap,a=new Map,o=new Map,s=new ze;for(let e of n){if(r&&!t.has(e))continue;let n=ks.parse(e),i={name:n.shortModelId,model:n.shortModelId,description:`Custom model`,provider:n.providerId,roles:[],capabilities:[],input_types:[],output_types:[],release_date:`1970-01-01`,custom:!0};a.set(e,i)}if(r)for(let e of t){let t=i.get(e);t&&o.set(e,t)}else o=new Map(i);o=new Map([...a,...o]);for(let[e,t]of o.entries()){let n=ks.parse(e);s.add(n.providerId,t)}return{modelsByProviderMap:s,modelsMap:o}}getDisplayedModels(){return this.displayedModels}getCustomModels(){return this.customModels}getModelsByProvider(e){return this.modelsByProviderMap.get(e)||[]}getGroupedModelsByProvider(){return this.modelsByProviderMap}getListModelsByProvider(){let e=[...this.getGroupedModelsByProvider().entries()],t=Ls().providerToOrderIdx;return e.sort((e,n)=>{let r=e[0],i=n[0];return(t.get(r)??0)-(t.get(i)??0)}),e}getModelsMap(){return this.modelsMap}getModel(e){return this.modelsMap.get(e)}},zs=d(`marimo:accept-completion-on-enter`,!0,I,{getOnInit:!0});function Bs(e){`scheduler`in window?window.scheduler.postTask(e,{priority:`background`}):`requestIdleCallback`in window?requestIdleCallback(e):setTimeout(e,0)}var Vs=null,Hs=class{view;abortController=new AbortController;constructor(e){this.view=e.view,this.view.dom.addEventListener(`focus`,()=>{Vs=new WeakRef(this.view)},{signal:this.abortController.signal,capture:!0}),this.update()}update(){let e=this.view.dom.querySelector(`.cm-vimCursorLayer`);if(e instanceof HTMLElement){if(h())e.style.display=`none`;else{let t=Vs?.deref()===this.view;e.style.display=t?``:`none`}}}destroy(){this.abortController.abort()}},Us={map:{args:[`lhs`,`rhs`]},nmap:{mode:`normal`,args:[`lhs`,`rhs`]},vmap:{mode:`visual`,args:[`lhs`,`rhs`]},imap:{mode:`insert`,args:[`lhs`,`rhs`]},noremap:{args:[`lhs`,`rhs`]},nnoremap:{mode:`normal`,args:[`lhs`,`rhs`]},vnoremap:{mode:`visual`,args:[`lhs`,`rhs`]},inoremap:{mode:`insert`,args:[`lhs`,`rhs`]},unmap:{args:[`lhs`]},nunmap:{mode:`normal`,args:[`lhs`]},vunmap:{mode:`visual`,args:[`lhs`]},iunmap:{mode:`insert`,args:[`lhs`]},mapclear:{},nmapclear:{mode:`normal`},vmapclear:{mode:`visual`},imapclear:{mode:`insert`}};function Ws(e,t){let n=[];for(let r of e.split(`
2
- `)){if(r.startsWith(`"`)||r.trim()===``)continue;let e=Gs(r,t);e&&n.push(e)}return n}function Gs(e,t){let n=e.split(/\s+/),r=n[0],i=0;if(r in Us){let a=Us[r],o={};for(let s of a.args||[])if(i+=1,i<n.length)o[s]=n[i];else{t&&t(`Not enough arguments for "${r}" command: "${e}"`);return}let s={name:r};return`args`in a&&(s.args=o),`mode`in a&&(s.mode=a.mode),s}t&&t(`Unknown vimrc command: "${e}"`)}function Ks(){return Js(),Ys(),[mt.of([{key:`j`,run:e=>{if(p(e,!0)&&u(e)){let t=e.state.facet(x),n=e.state.facet(C);return t.moveToNextCell({cellId:n,before:!1,noCreate:!0}),!0}return!1}}]),mt.of([{key:`k`,run:e=>{if(S(e)&&u(e)){let t=e.state.facet(x),n=e.state.facet(C);return t.moveToNextCell({cellId:n,before:!0,noCreate:!0}),!0}return!1}}]),mt.of([{linux:`Ctrl-[`,win:`Ctrl-[`,run:e=>{let t=m(e);return t?ec(t)?t.state.vim.insertMode?(T.exitInsertMode(t,!0),!0):!1:(q.warn(`Expected CodeMirror instance to have Vim state`),!1):(q.warn(`Expected CodeMirror instance to have CodeMirror instance state`),!1)}}]),_t.define(e=>(requestAnimationFrame(()=>{$s.INSTANCES.addInstance(e)}),{destroy(){$s.INSTANCES.removeInstance(e)}})),_t.define(e=>new Hs({view:e})),gt.domEventHandlers({keydown(e,t){return e.ctrlKey&&e.key===`Escape`?(t.dom.dispatchEvent(new KeyboardEvent(e.type,e)),!0):!1}})]}function qs(e,t){let n=e.cm6;if(!n)return;let r=n.coordsAtPos(n.state.selection.main.head);if(!r)return;let i=document.getElementById(`App`);if(!i)return;let a=i.clientHeight,o;switch(t){case`center`:o=(r.top+r.bottom)/2-a/2;break;case`start`:o=r.top;break;case`end`:o=r.bottom-a}i.scrollBy({top:o,behavior:`smooth`})}var Js=Nt(()=>{T.defineAction(`goToDefinition`,e=>{let t=e.cm6;return f(t)}),T.mapCommand(`gd`,`action`,`goToDefinition`,{},{context:`normal`}),T.defineAction(`scrollCursorToCenter`,e=>qs(e,`center`)),T.mapCommand(`zz`,`action`,`scrollCursorToCenter`,{},{context:`normal`}),T.defineAction(`scrollCursorToTop`,e=>qs(e,`start`)),T.mapCommand(`zt`,`action`,`scrollCursorToTop`,{},{context:`normal`}),T.defineAction(`scrollCursorToBottom`,e=>qs(e,`end`)),T.mapCommand(`zb`,`action`,`scrollCursorToBottom`,{},{context:`normal`}),T.defineEx(`write`,`w`,e=>{let t=e.cm6;t&&t.state.facet(x).saveNotebook()})}),Ys=Nt(async()=>{let e=a.get(fe).keymap?.vimrc;if(e)try{q.log(`Loading vimrc from ${e}`);let t=(await Rt().sendFileDetails({path:e})).contents;if(!t){q.error(`Failed to load vimrc from ${e}`);return}Xs(Ws(t,q.warn))}catch(e){q.error(`Failed to load vimrc:`,e)}});function Xs(e){function t(e){if(!e.args){q.warn(`Could not execute vimrc command "${e.name}: expected arguments"`);return}if(!e.args.lhs||!e.args.rhs){q.warn(`Could not execute vimrc command "${e.name}: expected arguments"`);return}e.mode?T.map(e.args.lhs,e.args.rhs,e.mode):T.map(e.args.lhs,e.args.rhs)}function n(e){if(!e.args){q.warn(`Could not execute vimrc command "${e.name}: expected arguments"`);return}if(!e.args.lhs||!e.args.rhs){q.warn(`Could not execute vimrc command "${e.name}: expected arguments"`);return}e.mode?T.noremap(e.args.lhs,e.args.rhs,e.mode):T.noremap(e.args.lhs,e.args.rhs)}function r(e){if(!e.args){q.warn(`Could not execute vimrc command "${e.name}: expected arguments"`);return}if(!e.args.lhs){q.warn(`Could not execute vimrc command "${e.name}: expected arguments"`);return}e.mode?T.unmap(e.args.lhs,e.mode):T.unmap(e.args.lhs)}function i(e){e.mode?T.mapclear(e.mode):T.mapclear()}for(let a of e)`map|nmap|vmap|imap`.split(`|`).includes(a.name)?t(a):`noremap|nnoremap|vnoremap|inoremap`.split(`|`).includes(a.name)?n(a):`unmap|nunmap|vunmap|iunmap`.split(`|`).includes(a.name)?r(a):`mapclear|nmapclear|vmapclear|imapclear`.split(`|`).includes(a.name)?i(a):q.warn(`Could not execute vimrc command "${a.name}: unknown command"`)}function Zs(e){return`getVimGlobalState_`in e&&typeof e.getVimGlobalState_==`function`}function Qs(){if(!Zs(T))return!1;let e=T.getVimGlobalState_()?.macroModeState;return e?!!(e.isRecording||e.isPlaying):!1}var $s=class e{instances=new Set;isBroadcasting=!1;static INSTANCES=new e;constructor(){}addInstance(e){this.instances.add(e);let t=m(e);if(!t){q.warn(`Expected CodeMirror instance to have CodeMirror instance state`);return}t.on(`vim-mode-change`,t=>{if(this.isBroadcasting)return;De(`mode`in t,`Expected event to have a "mode" property`);let n=Qs();this.isBroadcasting=!0,Bs(()=>{n||this.broadcastModeChange(e,t.mode,t.subMode),this.isBroadcasting=!1})})}removeInstance(e){this.instances.delete(e)}broadcastModeChange(e,t,n){De(`exitInsertMode`in T,`Vim does not have an exitInsertMode method`),De(`exitVisualMode`in T,`Vim does not have an exitVisualMode method`);for(let n of this.instances)if(n!==e){let e=m(n);if(!e){q.warn(`Expected CodeMirror instance to have CodeMirror instance state`);continue}let r=e.setSelections.bind(e);if(e.setSelections=()=>[],!ec(e)){q.warn(`Expected CodeMirror instance to have Vim state`);continue}let i=e.state.vim;switch(t){case`normal`:i.insertMode&&T.exitInsertMode(e,!0),i.visualMode&&T.exitVisualMode(e,!0);break;case`insert`:i.insertMode||T.handleKey(e,`i`,`mapping`)}e.setSelections=r}}};function ec(e){return e.state.vim!==void 0}var tc=[`default`,`vim`];function nc(e,t){switch(e.preset){case`default`:return[mt.of(ic()),mt.of(ac(t))];case`vim`:return[mt.of(oc()),mt.of(ac(t)),mt.of([{key:`Enter`,run:e=>m(e)?.state.vim?.insertMode?Ot(e):!1}]),ht.high(sc(`d`,e=>e.state.doc.toString()===``,e=>e.state.doc.toString()===``&&(e.state.facet(x).deleteCell(),!0))),mt.of(lc()),_({status:!1}),ht.high(Ks())];default:return Pt(e.preset),[]}}var rc=new Set([Ct,yt,kt,Tt]),ic=Nt(()=>At.filter(e=>!rc.has(e.run))),ac=e=>[{key:e.getHotkey(`cell.toggleComment`).key,run:Ct},{key:e.getHotkey(`cell.toggleBlockComment`).key,run:yt},{key:e.getHotkey(`cell.copyLineUp`).key,run:kt},{key:e.getHotkey(`cell.copyLineDown`).key,run:Tt}],oc=Nt(()=>{let e=new Set([`Enter`,`Ctrl-v`,`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`]);return ic().filter(t=>!e.has(t.key||t.mac||t.linux||t.win||``))});function sc(e,t,n){let r=``,i=0;return mt.of([{any:(a,o)=>{let s=o.key,c=o.timeStamp;return s!==e||!t(a)?(r=``,i=0,!1):r===e&&c-i<500&&n(a)?(r=``,i=0,!0):(r=s,i=c,!1)}}])}function cc(e){return e?.state.vim?.visualMode===!0}function lc(){let e=e=>t=>!cc(m(t))&&e(t);return[{key:`ArrowDown`,run:e(jt),shift:e(St)},{key:`ArrowUp`,run:e(wt),shift:e(vt)},{key:`ArrowLeft`,run:e(Dt),shift:e(bt)},{key:`ArrowRight`,run:e(Et),shift:e(xt)}]}function uc(){return[`compact`,`medium`,`full`,`columns`]}var dc={openai:e=>!!e?.open_ai?.api_key,github:e=>!!e?.github?.api_key,anthropic:e=>!!e?.anthropic?.api_key,google:e=>!!e?.google?.api_key,openrouter:e=>!!e?.openrouter?.api_key,azure:e=>!!(e?.azure?.api_key&&e?.azure?.base_url),wandb:e=>!!e?.wandb?.api_key,"opencode-go":e=>!!e?.opencode_go?.api_key,bedrock:e=>!!e?.bedrock?.region_name,ollama:e=>!!e?.ollama?.base_url,deepseek:()=>!1,marimo:e=>!!e?.open_ai_compatible?.base_url};function fc(e){let t=Os.filter(t=>dc[t](e)),n=Object.entries(e?.custom_providers??{}).filter(([,e])=>!!e?.base_url).map(([e])=>e);return[...t,...n]}function pc(e,t){let n=new Set(fc(t));return e.filter(([e])=>n.has(e))}function mc(e,t){return t?.allow_provider_config===!1?pc(e,t):[...e]}function hc(e){let t=fc(e)[0];if(t)return Is().defaultModelByProvider.get(t)}function gc(e){let t={chatModel:void 0,editModel:void 0},n=!e?.models?.chat_model,r=!e?.models?.edit_model;if(!n&&!r)return t;let i=hc(e);return i?(n&&(t.chatModel=i),r&&(t.editModel=i),t):t}var Y=ae();function _c(e){return e.toLowerCase().replaceAll(`+`,`-`).trim()}function vc(e,t){let n=e.getHotkeyGroups(),r=t?new Set(n[t]||[]):new Set,i=new Map;for(let t of e.iterate()){if(r.has(t))continue;let n=e.getHotkey(t);if(!n.key||n.key.trim()===``)continue;let a=_c(n.key);i.has(a)||i.set(a,[]);let o=i.get(a);o&&o.push({action:t,name:n.name})}let a=[],o=new Set;for(let[e,t]of i.entries())if(t.length>1){a.push({key:e,actions:t});for(let{action:e}of t)o.add(e)}return{duplicates:a,hasDuplicate:e=>o.has(e),getDuplicatesFor:t=>{let n=e.getHotkey(t);if(!n.key||n.key.trim()===``)return[];let r=_c(n.key),i=a.find(e=>e.key===r);return!i||i.actions.length<=1?[]:i.actions.filter(e=>e.action!==t).map(e=>e.action)}}}function yc(e,t){let n=(0,Y.c)(3),r;return n[0]!==e||n[1]!==t?(r=vc(e,t),n[0]=e,n[1]=t,n[2]=r):r=n[2],r}var bc=r({});function xc(){return i(bc)}function Sc(){let e=s(bc);return{registerAction:o((t,n)=>{e(e=>({...e,[t]:n}))}),unregisterAction:o(t=>{e(e=>{let{[t]:n,...r}=e;return r})})}}function Cc(e,t,n){let r=(0,Y.c)(17),a;r[0]===n?a=r[1]:(a=n===void 0?{}:n,r[0]=n,r[1]=a);let{disabled:s}=a,c=s!==void 0&&s,{registerAction:l,unregisterAction:u}=Sc(),d=i(he),f=t===Se.NOOP,p;r[2]===t?p=r[3]:(p=e=>t(e),r[2]=t,r[3]=p);let m=o(p),h;r[4]!==t||r[5]!==c||r[6]!==d||r[7]!==e?(h=n=>{if(c||n.defaultPrevented)return;let r=d.getHotkey(e).key;Te(r)(n)&&t(n)!==!1&&(n.preventDefault(),n.stopPropagation())},r[4]=t,r[5]=c,r[6]=d,r[7]=e,r[8]=h):h=r[8];let g=o(h);Ee(document,`keydown`,g);let _,v;r[9]!==c||r[10]!==f||r[11]!==m||r[12]!==l||r[13]!==e||r[14]!==u?(_=()=>{if(!f&&!c)return l(e,m),()=>u(e)},v=[m,e,f,c,l,u],r[9]=c,r[10]=f,r[11]=m,r[12]=l,r[13]=e,r[14]=u,r[15]=_,r[16]=v):(_=r[15],v=r[16]),(0,J.useEffect)(_,v)}var X=Ie(),wc=e=>{let t=(0,Y.c)(7),{duplicates:n}=e;if(n.length===0)return null;let r,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,X.jsx)(Yn,{className:`h-4 w-4`}),i=(0,X.jsx)(br,{children:`Duplicate shortcuts`}),t[0]=r,t[1]=i):(r=t[0],i=t[1]);let a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,X.jsx)(`p`,{className:`mb-2`,children:`Multiple actions are assigned to the same keyboard shortcut:`}),t[2]=a):a=t[2];let o;t[3]===n?o=t[4]:(o=n.map(Ec),t[3]=n,t[4]=o);let s;return t[5]===o?s=t[6]:(s=(0,X.jsxs)(xr,{variant:`warning`,className:`mb-4`,children:[r,i,(0,X.jsxs)(yr,{children:[a,(0,X.jsx)(`ul`,{className:`space-y-2`,children:o})]})]}),t[5]=o,t[6]=s),s};function Tc(e){let{action:t,name:n}=e;return(0,X.jsx)(`li`,{children:n},t)}function Ec(e){let{key:t,actions:n}=e;return(0,X.jsxs)(`li`,{className:`text-xs`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[(0,X.jsx)(Ar,{shortcut:t}),(0,X.jsx)(`span`,{className:`font-semibold`,children:`is used by:`})]}),(0,X.jsx)(`ul`,{className:`ml-6 list-disc`,children:n.map(Tc)})]},t)}var Dc=r(!1),Oc=()=>{let e=(0,Y.c)(89),[t,r]=n(Dc),[a,o]=(0,J.useState)(null),s;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=[],e[0]=s):s=e[0];let[c,l]=(0,J.useState)(s),[u,d]=be(),f=i(he),{saveUserConfig:p}=Lt(),{duplicates:m,hasDuplicate:h,getDuplicatesFor:g}=yc(f,`Markdown`),_;e[1]===r?_=e[2]:(_=()=>r(kc),e[1]=r,e[2]=_),Cc(`global.showHelp`,_);let v;e[3]!==u||e[4]!==p||e[5]!==d?(v=async e=>{let t={...u};d(t=>({...t,...e})),await p({config:e}).catch(e=>{throw d(t),e})},e[3]=u,e[4]=p,e[5]=d,e[6]=v):v=e[6];let y=v,b;e[7]!==u||e[8]!==a||e[9]!==y?(b=async e=>{if(!a)return;let t=e.join(`-`),n={keymap:{...u.keymap,overrides:{...u.keymap.overrides,[a]:t}}};o(null),l([]),await y(n)},e[7]=u,e[8]=a,e[9]=y,e[10]=b):b=e[10];let x=b,S;e[11]!==u||e[12]!==a||e[13]!==y?(S=async()=>{if(!a)return;let e={keymap:{...u.keymap,overrides:{...u.keymap.overrides}}};delete e.keymap.overrides[a],o(null),l([]),await y(e)},e[11]=u,e[12]=a,e[13]=y,e[14]=S):S=e[14];let C=S,w;e[15]!==u||e[16]!==y?(w=async()=>{if(!window.confirm(`Are you sure you want to reset all shortcuts to their default values?`))return;let e={keymap:{...u.keymap,overrides:{}}};o(null),l([]),await y(e)},e[15]=u,e[16]=y,e[17]=w):w=e[17];let T=w;if(!t)return null;let D;e[18]!==a||e[19]!==g||e[20]!==x||e[21]!==C||e[22]!==h||e[23]!==f||e[24]!==c?(D=e=>{let t=f.getHotkey(e);if(a===e){let n=we(e);return(0,X.jsxs)(`div`,{children:[(0,X.jsx)(Hn,{defaultValue:c.join(`+`),placeholder:t.name,onKeyDown:e=>{e.preventDefault();let t=[];if(e.key===`Meta`||e.key===`Control`||e.key===`Alt`||e.key===`Shift`||(e.metaKey&&t.push(Ce()?`Cmd`:`Meta`),e.ctrlKey&&t.push(`Ctrl`),e.altKey&&t.push(`Alt`),e.shiftKey&&t.push(`Shift`),e.key===`-`))return;if(e.key===`Escape`&&t.length===0){o(null),l([]);return}let n=e.key.length===1?e.key.toLowerCase():e.key;e.key===` `&&(n=`Space`),t.push(n),x(t)},autoFocus:!0,endAdornment:(0,X.jsx)(pt,{variant:`text`,size:`xs`,className:`mb-0`,onClick:()=>{o(null),l([])},children:(0,X.jsx)(Ht,{className:`w-4 h-4`})})}),(0,X.jsxs)(`div`,{className:`flex items-center justify-between w-full`,children:[(0,X.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:`Press a key combination`}),n.key!==t.key&&(0,X.jsxs)(`span`,{className:`text-xs cursor-pointer text-primary`,onClick:C,children:[`Reset to default:`,` `,(0,X.jsx)(`span`,{className:`font-mono`,children:n.key})]})]})]},e)}let n=h(e),r=n?g(e):[];return(0,X.jsxs)(`div`,{className:`grid grid-cols-[auto_2fr_3fr] gap-2 items-center`,children:[f.isEditable(e)?(0,X.jsx)(E,{className:`cursor-pointer opacity-60 hover:opacity-100 text-muted-foreground w-3 h-3`,onClick:()=>{l([]),o(e)}}):(0,X.jsx)(`div`,{className:`w-3 h-3`}),(0,X.jsx)(Ar,{className:`justify-end`,shortcut:t.key}),(0,X.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,X.jsx)(`span`,{children:t.name.toLowerCase()}),n&&(0,X.jsxs)(`div`,{className:`group relative inline-flex`,children:[(0,X.jsx)(Yn,{className:`w-3 h-3 text-(--yellow-11)`}),(0,X.jsxs)(`div`,{className:`invisible group-hover:visible absolute left-0 top-5 z-10 w-max max-w-xs rounded-md bg-(--yellow-2) border border-(--yellow-7) p-2 text-xs text-(--yellow-11) shadow-md`,children:[`Also used by:`,` `,r.map(e=>f.getHotkey(e).name.toLowerCase()).join(`, `)]})]})]})]},e)},e[18]=a,e[19]=g,e[20]=x,e[21]=C,e[22]=h,e[23]=f,e[24]=c,e[25]=D):D=e[25];let O=D,k,A,j,M,N,P,F,I,L,R,z,B,V,H,U,ee,W,te,ne;if(e[26]!==u.keymap.preset||e[27]!==m||e[28]!==f||e[29]!==t||e[30]!==O||e[31]!==r){let n=f.getHotkeyGroups(),i=(e,t)=>{let r=n[e];return(0,X.jsxs)(`div`,{className:`mb-[40px] gap-2 flex flex-col`,children:[(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h3`,{className:`text-lg font-medium`,children:e}),t]}),r.map(O)]})};j=$t,U=t,e[51]===r?ee=e[52]:(ee=e=>r(e),e[51]=r,e[52]=ee),A=Kt,V=`sm:items-center sm:top-0`,e[53]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,X.jsx)(Zt,{}),e[53]=H):H=e[53],k=Yt,L=!1,R=`max-h-screen sm:max-h-[90vh] overflow-y-auto sm:max-w-[850px]`,e[54]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,X.jsx)(Jt,{children:(0,X.jsx)(Xt,{children:`Shortcuts`})}),e[54]=z):z=e[54],e[55]===m?B=e[56]:(B=(0,X.jsx)(wc,{duplicates:m}),e[55]=m,e[56]=B),F=`flex flex-row gap-3`,I=(0,X.jsxs)(`div`,{className:`w-1/2`,children:[i(`Editing`),i(`Markdown`)]}),W=`w-1/2`,te=i(`Navigation`),ne=i(`Running Cells`),M=i(`Creation and Ordering`),N=(e=>i(e,(0,X.jsxs)(`p`,{className:`text-xs text-muted-foreground flex items-center gap-1`,children:[`Press`,` `,u.keymap.preset===`vim`?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Ar,{shortcut:Ce()?`Cmd`:`Ctrl`}),(0,X.jsx)(vr,{children:`Esc`})]}):(0,X.jsx)(vr,{children:`Esc`}),` `,`in a cell to enter command mode`]})))(`Command`),P=i(`Other`),e[26]=u.keymap.preset,e[27]=m,e[28]=f,e[29]=t,e[30]=O,e[31]=r,e[32]=k,e[33]=A,e[34]=j,e[35]=M,e[36]=N,e[37]=P,e[38]=F,e[39]=I,e[40]=L,e[41]=R,e[42]=z,e[43]=B,e[44]=V,e[45]=H,e[46]=U,e[47]=ee,e[48]=W,e[49]=te,e[50]=ne}else k=e[32],A=e[33],j=e[34],M=e[35],N=e[36],P=e[37],F=e[38],I=e[39],L=e[40],R=e[41],z=e[42],B=e[43],V=e[44],H=e[45],U=e[46],ee=e[47],W=e[48],te=e[49],ne=e[50];let re;e[57]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,X.jsx)(`span`,{className:`text-destructive`,children:`Reset all to default`}),e[57]=re):re=e[57];let G;e[58]===T?G=e[59]:(G=(0,X.jsx)(pt,{className:`mt-4 hover:bg-destructive/10 border-destructive hover:border-destructive`,variant:`outline`,size:`xs`,onClick:T,tabIndex:-1,children:re}),e[58]=T,e[59]=G);let ie;e[60]!==M||e[61]!==N||e[62]!==P||e[63]!==G||e[64]!==W||e[65]!==te||e[66]!==ne?(ie=(0,X.jsxs)(`div`,{className:W,children:[te,ne,M,N,P,G]}),e[60]=M,e[61]=N,e[62]=P,e[63]=G,e[64]=W,e[65]=te,e[66]=ne,e[67]=ie):ie=e[67];let K;e[68]!==F||e[69]!==I||e[70]!==ie?(K=(0,X.jsxs)(`div`,{className:F,children:[I,ie]}),e[68]=F,e[69]=I,e[70]=ie,e[71]=K):K=e[71];let ae;e[72]!==k||e[73]!==L||e[74]!==R||e[75]!==z||e[76]!==B||e[77]!==K?(ae=(0,X.jsxs)(k,{usePortal:L,className:R,children:[z,B,K]}),e[72]=k,e[73]=L,e[74]=R,e[75]=z,e[76]=B,e[77]=K,e[78]=ae):ae=e[78];let oe;e[79]!==A||e[80]!==V||e[81]!==H||e[82]!==ae?(oe=(0,X.jsxs)(A,{className:V,children:[H,ae]}),e[79]=A,e[80]=V,e[81]=H,e[82]=ae,e[83]=oe):oe=e[83];let se;return e[84]!==j||e[85]!==U||e[86]!==ee||e[87]!==oe?(se=(0,X.jsx)(j,{open:U,onOpenChange:ee,children:oe}),e[84]=j,e[85]=U,e[86]=ee,e[87]=oe,e[88]=se):se=e[88],se};function kc(e){return!e}var Ac=`marimo:copilot:signedIn`,jc=d(Ac,null,I,{getOnInit:!0}),Mc=r(null),Nc=r(null),Pc=r({busy:!1,kind:null,message:null});function Fc(e){a.set(Nc,e)}function Ic(e){a.get(Nc)===e&&a.set(Nc,null)}function Lc(){return F.getItem(Ac)===`true`}function Rc(){let e=Lc(),t=ge();return e&&t.completion.copilot===`github`}function zc(){return t(fe,e=>e.completion.copilot===`github`)}var Bc=te(),Vc=q.get(`@github/copilot-language-server`),Hc=1e4,Uc=`python`;function Wc(e){De(j(e)&&R(e,`request`)&&R(e,`notify`),`LanguageServerClient is missing request/notify`)}function Gc(e){if(!j(e))return null;let{busy:t,kind:n,message:r,status:i}=e;return{busy:typeof t==`boolean`&&t,kind:typeof n==`string`?n:null,message:typeof r==`string`?r:null,status:typeof i==`string`?i:void 0}}function Kc(e){return j(e)&&typeof e.type==`number`&&typeof e.message==`string`}var qc=class extends V{documentVersion=0;openDocumentCount=0;lastOpenedDocument;copilotSettings={};constructor(e){super(e),this.copilotSettings=e.copilotSettings??{},this.onNotification(this.handleNotification),this.attachInitializeListener()}attachInitializeListener(){this.initializePromise.then(()=>this.sendConfiguration()).catch(e=>{Vc.warn(`#initialize: Failed to send configuration`,e)})}async reInitialize(){Vc.log(`#reInitialize: Re-initializing LSP connection`),this.initializePromise=this.initialize(),await this.initializePromise,await this.sendConfiguration(),this.openDocumentCount>0&&this.lastOpenedDocument&&await this.sendNotification(`textDocument/didOpen`,this.lastOpenedDocument)}async sendConfiguration(){let e=this.copilotSettings;!e||Object.keys(e).length===0||(await this.sendNotification(`workspace/didChangeConfiguration`,{settings:e}),Vc.debug(`#sendConfiguration: Configuration sent`,e))}async _request(e,t){return Wc(this),await this.request(e,t,Hc)}async sendNotification(e,t){return Vc.debug(`#notify`,e,t),Wc(this),this.notify(e,t)}getInitializationOptions(){let e={name:`marimo`,version:`0.1.0`};return{...super.getInitializationOptions(),workspaceFolders:[],capabilities:{workspace:{workspaceFolders:!1}},initializationOptions:{editorInfo:e,editorPluginInfo:e}}}isDisabled(){return!Rc()}async textDocumentDidOpen(e){return!this.isDisabled()&&(this.openDocumentCount++,this.lastOpenedDocument=e,this.documentVersion=Math.max(this.documentVersion,e.textDocument.version),super.textDocumentDidOpen(e))}async textDocumentDidClose(e){if(this.openDocumentCount!==0)return this.openDocumentCount--,super.textDocumentDidClose(e)}async textDocumentCompletion(e){return[]}async textDocumentDidChange(e){if(this.isDisabled())return;let t=e.contentChanges[0];if(!t){Vc.warn(`#textDocumentDidChange: Ignoring an update with no content changes.`,e);return}this.openDocumentCount===0&&await this.textDocumentDidOpen({textDocument:{uri:e.textDocument.uri,languageId:Uc,version:e.textDocument.version,text:t.text}});let n=e.contentChanges;n.length!==1&&Vc.warn(`#textDocumentDidChange: Multiple changes detected. This is not supported.`,n),`range`in t&&Vc.warn(`#textDocumentDidChange: Copilot doesn't support range changes.`,t);let r=ne(t.text),i=++this.documentVersion;return this.lastOpenedDocument={textDocument:{uri:e.textDocument.uri,languageId:this.lastOpenedDocument?.textDocument.languageId??Uc,version:i,text:r}},super.textDocumentDidChange({...e,contentChanges:[{text:r}],textDocument:Bc.VersionedTextDocumentIdentifier.create(e.textDocument.uri,i)})}textDocumentHover(e){return Promise.resolve({contents:[]})}signOut(){return this._request(`signOut`,{})}async signInInitiate(){Vc.log(`#signInInitiate: Starting sign-in flow`);try{let e=await this._request(`signIn`,{});return Vc.log(`#signInInitiate: Sign-in flow started successfully`),e}catch(e){throw Vc.warn(`#signInInitiate: Failed to start sign-in flow`,e),e}}async signInConfirm(e){Vc.log(`#signInConfirm: Confirming sign-in`);try{let t=await this._request(`signInConfirm`,e);return Vc.log(`#signInConfirm: Sign-in confirmed successfully`),t}catch(e){throw Vc.warn(`#signInConfirm: Failed to confirm sign-in`,e),e}}async signedIn(){try{let{status:e}=await this._request(`checkStatus`,{});return Vc.log(`#checkStatus: Status check completed`,{status:e}),e===`SignedIn`||e===`AlreadySignedIn`||e===`OK`}catch(e){throw Vc.warn(`#signedIn: Failed to check sign-in status`,e),e}}getCompletionInternal=async(e,t)=>await this._request(`textDocument/inlineCompletion`,{...e,textDocument:{...Bc.VersionedTextDocumentIdentifier.create(e.textDocument.uri,t)}});throttledGetCompletionInternal=zr(this.getCompletionInternal,200);async getCompletion(e){if(this.isDisabled())return null;let t=this.documentVersion;if(t===0)return null;Fc(t);let n;try{n=await this.throttledGetCompletionInternal({...e,textDocument:Bc.VersionedTextDocumentIdentifier.create(e.textDocument.uri,t)},t)}catch(e){return Vc.warn(`#getCompletion: Failed to fetch completions`,e),null}finally{Ic(t)}return t===this.documentVersion?n??null:null}handleNotification=e=>{if(!(!j(e)||typeof e.method!=`string`)){if(e.method===`statusNotification`||e.method===`didChangeStatus`){let t=Gc(e.params);t?a.set(Pc,t):Vc.warn(`#statusNotification: Ignoring a status update with no params`,e.params);return}if(e.method===`window/logMessage`&&Kc(e.params)){let{type:t,message:n}=e.params;switch(t){case 1:Vc.error(`[GitHub Copilot]`,n);break;case 2:Vc.warn(`[GitHub Copilot]`,n);break;case 3:Vc.debug(`[GitHub Copilot]`,n);break;default:Vc.log(`[GitHub Copilot]`,n)}}}}},Jc=class extends H{constructor(e){super({getWsUrl:e.getWsUrl,waitForConnection:e.waitForReady,retries:e.retries??3,retryDelayMs:e.retryDelayMs??1e3,onConnectionFailure:t=>{e.showError(`GitHub Copilot Connection Error`,`Failed to connect to GitHub Copilot. Please check your settings and try again.\n\n${_r(t)}`)}})}},Yc=`/__marimo_copilot__.py`,Xc=`copilot`,Zc=`file://${Yc}`,Qc=Nt(()=>{let e=je();return new Jc({getWsUrl:()=>e.getLSPURL(`copilot`).toString(),waitForReady:async()=>{await zc(),await Ae()},showError:(e,t)=>{Zn({variant:`danger`,title:e,description:t})}})}),$c=Nt(()=>{let e=a.get(fe).ai?.github?.copilot_settings??{},t=Qc(),n=new qc({rootUri:Zc,workspaceFolders:null,transport:t,copilotSettings:e});return t.onReconnect=()=>n.reInitialize(),n});function el(){return l({documentUri:Zc,client:$c(),languageId:Xc,hoverEnabled:!1,completionEnabled:!1,definitionEnabled:!1,renameEnabled:!1,codeActionsEnabled:!1,signatureHelpEnabled:!1,diagnosticsEnabled:!1,sendIncrementalChanges:!1})}var tl=(0,J.memo)(()=>{let[e,t]=n(jc),[r,i]=n(Mc),[a,o]=(0,J.useState)(),[s,c]=(0,J.useState)(!1),l=async e=>{e.preventDefault(),c(!0);try{let e=await il();if(!e?.verificationUri||!e.userCode){q.error(`Copilot#trySignIn: Invalid response from sign-in`,{result:e}),i(`connectionError`),Zn({title:`GitHub Copilot Connection Error`,description:`Unable to connect to GitHub Copilot. Please check your settings and try again.`,variant:`danger`});return}let{verificationUri:n,status:r,userCode:a}=e;ll(r)?t(!0):(i(`signingIn`),o({url:n,code:a}))}catch(e){q.error(`Copilot#trySignIn: Error during sign-in`,e),i(`connectionError`),Zn({title:`GitHub Copilot Connection Error`,description:e instanceof Error?e.message:`Unable to connect to GitHub Copilot. Please check your settings and try again.`,variant:`danger`})}finally{c(!1)}},u=async e=>{if(e.preventDefault(),a){c(!0);try{let e=await al(a.code);e.success?(t(!0),i(`signedIn`)):e.error===`connection`?(i(`connectionError`),Zn({title:`GitHub Copilot Connection Error`,description:`Lost connection during sign-in. Please try again.`,variant:`danger`,action:(0,X.jsx)(pt,{onClick:l,children:`Retry`})})):i(`signInFailed`)}finally{c(!1)}}},d=async e=>{e.preventDefault(),await sl(),t(!1),i(`signedOut`)};return(()=>{switch(r??(e?`signedIn`:`connecting`)){case`connecting`:return(0,X.jsx)(Je,{className:`font-normal flex`,children:`Connecting...`});case`signedOut`:return(0,X.jsx)(pt,{onClick:l,size:`xs`,variant:`link`,children:`Sign in to GitHub Copilot`});case`signingIn`:return(0,X.jsxs)(`ol`,{className:`ml-4 text-sm list-decimal [&>li]:mt-2`,children:[(0,X.jsx)(`li`,{children:(0,X.jsxs)(`div`,{className:`flex items-center`,children:[`Copy this code:`,(0,X.jsx)(`strong`,{className:`ml-2`,children:a?.code}),(0,X.jsx)(Gt,{className:`ml-2 cursor-pointer opacity-60 hover:opacity-100 h-3 w-3`,onClick:async()=>{a&&(await gr(a.code),Zn({description:`Copied to clipboard`}))}})]})}),(0,X.jsxs)(`li`,{children:[`Enter the code at this link:`,(0,X.jsx)(`a`,{href:a?.url,target:`_blank`,rel:`noreferrer`,className:dt({variant:`link`,size:`xs`}),children:a?.url})]}),(0,X.jsxs)(`li`,{children:[`Click here when done:`,(0,X.jsxs)(pt,{size:`xs`,onClick:u,className:`ml-1`,children:[s&&(0,X.jsx)(en,{className:`h-3 w-3 mr-1 animate-spin`}),`Done`]})]})]});case`signInFailed`:return(0,X.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,X.jsx)(`div`,{className:`text-destructive text-sm`,children:`Sign in failed. Please try again.`}),s?(0,X.jsx)(en,{className:`h-3 w-3 mr-1 animate-spin`}):(0,X.jsx)(pt,{onClick:l,size:`xs`,variant:`link`,children:`Connect to GitHub Copilot`})]});case`signedIn`:return(0,X.jsxs)(`div`,{className:`flex items-center gap-5`,children:[(0,X.jsxs)(Je,{className:`font-normal flex items-center`,children:[(0,X.jsx)(`div`,{className:`inline-flex items-center justify-center bg-(--grass-7) rounded-full p-1 mr-2`,children:(0,X.jsx)(Bt,{className:`h-3 w-3 text-white`})}),`Connected`]}),(0,X.jsx)(pt,{onClick:d,size:`xs`,variant:`text`,children:`Disconnect`})]});case`connectionError`:return(0,X.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,X.jsxs)(Je,{className:`font-normal flex`,children:[(0,X.jsx)(Ht,{className:`h-4 w-4 mr-1`}),`Connection Error`]}),(0,X.jsx)(`div`,{className:`text-sm`,children:`Unable to connect to GitHub Copilot.`}),(0,X.jsx)(pt,{onClick:l,size:`xs`,variant:`link`,children:`Retry Connection`})]});case`notConnected`:return(0,X.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,X.jsxs)(Je,{className:`font-normal flex`,children:[(0,X.jsx)(Ht,{className:`h-4 w-4 mr-1`}),`Unable to connect`]}),(0,X.jsxs)(`div`,{className:`text-sm`,children:[`For troubleshooting, see the`,` `,(0,X.jsx)(Qt,{href:`https://docs.marimo.io/getting_started/index.html#github-copilot`,children:`docs`}),`.`]})]})}})()});tl.displayName=`CopilotConfig`;var nl=5,rl=3e3;async function il(){return await $c().signInInitiate()}async function al(e){let t=$c();try{q.log(`Copilot#tryFinishSignIn: Attempting to confirm sign-in`);let{status:n}=await t.signInConfirm({userCode:e});return ll(n)?(q.log(`Copilot#tryFinishSignIn: Sign-in confirmed successfully`),{success:!0}):(q.warn(`Copilot#tryFinishSignIn: Sign-in confirmation returned unexpected status`,{status:n}),{success:!1})}catch(e){return cl(e)?(q.error(`Copilot#tryFinishSignIn: Connection error during sign-in`,e),{success:!1,error:`connection`}):await ol(t)}}async function ol(e){for(let t=0;t<nl;t++)try{if(await new Promise(e=>setTimeout(e,rl)),await e.signedIn())return q.log(`Copilot#tryFinishSignIn: Successfully signed in after retry`),{success:!0}}catch(e){if(q.warn(`Copilot#tryFinishSignIn: Retry attempt failed`,{attempt:t+1,maxRetries:nl}),cl(e))return{success:!1,error:`connection`}}return q.error(`Copilot#tryFinishSignIn: All sign-in attempts failed`),{success:!1}}async function sl(){await $c().signOut()}function cl(e){return e instanceof Error&&(e.message.includes(`ECONNREFUSED`)||e.message.includes(`WebSocket`)||e.message.includes(`network`))}function ll(e){return e===`SignedIn`||e===`AlreadySignedIn`||e===`OK`}var ul=`data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eAnthropic%3c/title%3e%3cpath%20d='M17.3041%203.541h-3.6718l6.696%2016.918H24Zm-10.6082%200L0%2020.459h3.7442l1.3693-3.5527h7.0052l1.3693%203.5528h3.7442L10.5363%203.5409Zm-.3712%2010.2232%202.2914-5.9456%202.2914%205.9456Z'/%3e%3c/svg%3e`,dl=`data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20id='Ebene_1'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%20viewBox='0%200%20466.73%20532.09'%3e%3c!--%20Generator:%20Adobe%20Illustrator%2029.6.1,%20SVG%20Export%20Plug-In%20.%20SVG%20Version:%202.1.1%20Build%209)%20--%3e%3cdefs%3e%3cstyle%3e%20.st0%20{%20fill:%20%2326251e;%20}%20%3c/style%3e%3c/defs%3e%3cpath%20class='st0'%20d='M457.43,125.94L244.42,2.96c-6.84-3.95-15.28-3.95-22.12,0L9.3,125.94c-5.75,3.32-9.3,9.46-9.3,16.11v247.99c0,6.65,3.55,12.79,9.3,16.11l213.01,122.98c6.84,3.95,15.28,3.95,22.12,0l213.01-122.98c5.75-3.32,9.3-9.46,9.3-16.11v-247.99c0-6.65-3.55-12.79-9.3-16.11h-.01ZM444.05,151.99l-205.63,356.16c-1.39,2.4-5.06,1.42-5.06-1.36v-233.21c0-4.66-2.49-8.97-6.53-11.31L24.87,145.67c-2.4-1.39-1.42-5.06,1.36-5.06h411.26c5.84,0,9.49,6.33,6.57,11.39h-.01Z'/%3e%3c/svg%3e`,fl=`data:image/svg+xml,%3csvg%20fill='currentColor'%20fill-rule='evenodd'%20height='1em'%20style='flex:none;line-height:1'%20viewBox='0%200%2024%2024'%20width='1em'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eDeepSeek%3c/title%3e%3cpath%20d='M23.748%204.482c-.254-.124-.364.113-.512.234-.051.039-.094.09-.137.136-.372.397-.806.657-1.373.626-.829-.046-1.537.214-2.163.848-.133-.782-.575-1.248-1.247-1.548-.352-.156-.708-.311-.955-.65-.172-.241-.219-.51-.305-.774-.055-.16-.11-.323-.293-.35-.2-.031-.278.136-.356.276-.313.572-.434%201.202-.422%201.84.027%201.436.633%202.58%201.838%203.393.137.093.172.187.129.323-.082.28-.18.552-.266.833-.055.179-.137.217-.329.14a5.526%205.526%200%2001-1.736-1.18c-.857-.828-1.631-1.742-2.597-2.458a11.365%2011.365%200%2000-.689-.471c-.985-.957.13-1.743.388-1.836.27-.098.093-.432-.779-.428-.872.004-1.67.295-2.687.684a3.055%203.055%200%2001-.465.137%209.597%209.597%200%2000-2.883-.102c-1.885.21-3.39%201.102-4.497%202.623C.082%208.606-.231%2010.684.152%2012.85c.403%202.284%201.569%204.175%203.36%205.653%201.858%201.533%203.997%202.284%206.438%202.14%201.482-.085%203.133-.284%204.994-1.86.47.234.962.327%201.78.397.63.059%201.236-.03%201.705-.128.735-.156.684-.837.419-.961-2.155-1.004-1.682-.595-2.113-.926%201.096-1.296%202.746-2.642%203.392-7.003.05-.347.007-.565%200-.845-.004-.17.035-.237.23-.256a4.173%204.173%200%20001.545-.475c1.396-.763%201.96-2.015%202.093-3.517.02-.23-.004-.467-.247-.588zM11.581%2018c-2.089-1.642-3.102-2.183-3.52-2.16-.392.024-.321.471-.235.763.09.288.207.486.371.739.114.167.192.416-.113.603-.673.416-1.842-.14-1.897-.167-1.361-.802-2.5-1.86-3.301-3.307-.774-1.393-1.224-2.887-1.298-4.482-.02-.386.093-.522.477-.592a4.696%204.696%200%20011.529-.039c2.132.312%203.946%201.265%205.468%202.774.868.86%201.525%201.887%202.202%202.891.72%201.066%201.494%202.082%202.48%202.914.348.292.625.514.891.677-.802.09-2.14.11-3.054-.614zm1-6.44a.306.306%200%2001.415-.287.302.302%200%2001.2.288.306.306%200%2001-.31.307.303.303%200%2001-.304-.308zm3.11%201.596c-.2.081-.399.151-.59.16a1.245%201.245%200%2001-.798-.254c-.274-.23-.47-.358-.552-.758a1.73%201.73%200%2001.016-.588c.07-.327-.008-.537-.239-.727-.187-.156-.426-.199-.688-.199a.559.559%200%2001-.254-.078c-.11-.054-.2-.19-.114-.358.028-.054.16-.186.192-.21.356-.202.767-.136%201.146.016.352.144.618.408%201.001.782.391.451.462.576.685.914.176.265.336.537.445.848.067.195-.019.354-.25.452z'%3e%3c/path%3e%3c/svg%3e`,pl=`data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eGoogle%20Gemini%3c/title%3e%3cpath%20d='M11.04%2019.32Q12%2021.51%2012%2024q0-2.49.93-4.68.96-2.19%202.58-3.81t3.81-2.55Q21.51%2012%2024%2012q-2.49%200-4.68-.93a12.3%2012.3%200%200%201-3.81-2.58%2012.3%2012.3%200%200%201-2.58-3.81Q12%202.49%2012%200q0%202.49-.96%204.68-.93%202.19-2.55%203.81a12.3%2012.3%200%200%201-3.81%202.58Q2.49%2012%200%2012q2.49%200%204.68.96%202.19.93%203.81%202.55t2.55%203.81'/%3e%3c/svg%3e`,ml=`data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eGitHub%3c/title%3e%3cpath%20d='M12%20.297c-6.63%200-12%205.373-12%2012%200%205.303%203.438%209.8%208.205%2011.385.6.113.82-.258.82-.577%200-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422%2018.07%203.633%2017.7%203.633%2017.7c-1.087-.744.084-.729.084-.729%201.205.084%201.838%201.236%201.838%201.236%201.07%201.835%202.809%201.305%203.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93%200-1.31.465-2.38%201.235-3.22-.135-.303-.54-1.523.105-3.176%200%200%201.005-.322%203.3%201.23.96-.267%201.98-.399%203-.405%201.02.006%202.04.138%203%20.405%202.28-1.552%203.285-1.23%203.285-1.23.645%201.653.24%202.873.12%203.176.765.84%201.23%201.91%201.23%203.22%200%204.61-2.805%205.625-5.475%205.92.42.36.81%201.096.81%202.22%200%201.606-.015%202.896-.015%203.286%200%20.315.21.69.825.57C20.565%2022.092%2024%2017.592%2024%2012.297c0-6.627-5.373-12-12-12'/%3e%3c/svg%3e`,hl=`data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eOllama%3c/title%3e%3cpath%20d='M16.361%2010.26a.894.894%200%200%200-.558.47l-.072.148.001.207c0%20.193.004.217.059.353.076.193.152.312.291.448.24.238.51.3.872.205a.86.86%200%200%200%20.517-.436.752.752%200%200%200%20.08-.498c-.064-.453-.33-.782-.724-.897a1.06%201.06%200%200%200-.466%200zm-9.203.005c-.305.096-.533.32-.65.639a1.187%201.187%200%200%200-.06.52c.057.309.31.59.598.667.362.095.632.033.872-.205.14-.136.215-.255.291-.448.055-.136.059-.16.059-.353l.001-.207-.072-.148a.894.894%200%200%200-.565-.472%201.02%201.02%200%200%200-.474.007Zm4.184%202c-.131.071-.223.25-.195.383.031.143.157.288.353.407.105.063.112.072.117.136.004.038-.01.146-.029.243-.02.094-.036.194-.036.222.002.074.07.195.143.253.064.052.076.054.255.059.164.005.198.001.264-.03.169-.082.212-.234.15-.525-.052-.243-.042-.28.087-.355.137-.08.281-.219.324-.314a.365.365%200%200%200-.175-.48.394.394%200%200%200-.181-.033c-.126%200-.207.03-.355.124l-.085.053-.053-.032c-.219-.13-.259-.145-.391-.143a.396.396%200%200%200-.193.032zm.39-2.195c-.373.036-.475.05-.654.086-.291.06-.68.195-.951.328-.94.46-1.589%201.226-1.787%202.114-.04.176-.045.234-.045.53%200%20.294.005.357.043.524.264%201.16%201.332%202.017%202.714%202.173.3.033%201.596.033%201.896%200%201.11-.125%202.064-.727%202.493-1.571.114-.226.169-.372.22-.602.039-.167.044-.23.044-.523%200-.297-.005-.355-.045-.531-.288-1.29-1.539-2.304-3.072-2.497a6.873%206.873%200%200%200-.855-.031zm.645.937a3.283%203.283%200%200%201%201.44.514c.223.148.537.458.671.662.166.251.26.508.303.82.02.143.01.251-.043.482-.08.345-.332.705-.672.957a3.115%203.115%200%200%201-.689.348c-.382.122-.632.144-1.525.138-.582-.006-.686-.01-.853-.042-.57-.107-1.022-.334-1.35-.68-.264-.28-.385-.535-.45-.946-.03-.192.025-.509.137-.776.136-.326.488-.73.836-.963.403-.269.934-.46%201.422-.512.187-.02.586-.02.773-.002zm-5.503-11a1.653%201.653%200%200%200-.683.298C5.617.74%205.173%201.666%204.985%202.819c-.07.436-.119%201.04-.119%201.503%200%20.544.064%201.24.155%201.721.02.107.031.202.023.208a8.12%208.12%200%200%201-.187.152%205.324%205.324%200%200%200-.949%201.02%205.49%205.49%200%200%200-.94%202.339%206.625%206.625%200%200%200-.023%201.357c.091.78.325%201.438.727%202.04l.13.195-.037.064c-.269.452-.498%201.105-.605%201.732-.084.496-.095.629-.095%201.294%200%20.67.009.803.088%201.266.095.555.288%201.143.503%201.534.071.128.243.393.264.407.007.003-.014.067-.046.141a7.405%207.405%200%200%200-.548%201.873c-.062.417-.071.552-.071.991%200%20.56.031.832.148%201.279L3.42%2024h1.478l-.05-.091c-.297-.552-.325-1.575-.068-2.597.117-.472.25-.819.498-1.296l.148-.29v-.177c0-.165-.003-.184-.057-.293a.915.915%200%200%200-.194-.25%201.74%201.74%200%200%201-.385-.543c-.424-.92-.506-2.286-.208-3.451.124-.486.329-.918.544-1.154a.787.787%200%200%200%20.223-.531c0-.195-.07-.355-.224-.522a3.136%203.136%200%200%201-.817-1.729c-.14-.96.114-2.005.69-2.834.563-.814%201.353-1.336%202.237-1.475.199-.033.57-.028.776.01.226.04.367.028.512-.041.179-.085.268-.19.374-.431.093-.215.165-.333.36-.576.234-.29.46-.489.822-.729.413-.27.884-.467%201.352-.561.17-.035.25-.04.569-.04.319%200%20.398.005.569.04a4.07%204.07%200%200%201%201.914.997c.117.109.398.457.488.602.034.057.095.177.132.267.105.241.195.346.374.43.14.068.286.082.503.045.343-.058.607-.053.943.016%201.144.23%202.14%201.173%202.581%202.437.385%201.108.276%202.267-.296%203.153-.097.15-.193.27-.333.419-.301.322-.301.722-.001%201.053.493.539.801%201.866.708%203.036-.062.772-.26%201.463-.533%201.854a2.096%202.096%200%200%201-.224.258.916.916%200%200%200-.194.25c-.054.109-.057.128-.057.293v.178l.148.29c.248.476.38.823.498%201.295.253%201.008.231%202.01-.059%202.581a.845.845%200%200%200-.044.098c0%20.006.329.009.732.009h.73l.02-.074.036-.134c.019-.076.057-.3.088-.516.029-.217.029-1.016%200-1.258-.11-.875-.295-1.57-.597-2.226-.032-.074-.053-.138-.046-.141.008-.005.057-.074.108-.152.376-.569.607-1.284.724-2.228.031-.26.031-1.378%200-1.628-.083-.645-.182-1.082-.348-1.525a6.083%206.083%200%200%200-.329-.7l-.038-.064.131-.194c.402-.604.636-1.262.727-2.04a6.625%206.625%200%200%200-.024-1.358%205.512%205.512%200%200%200-.939-2.339%205.325%205.325%200%200%200-.95-1.02%208.097%208.097%200%200%201-.186-.152.692.692%200%200%201%20.023-.208c.208-1.087.201-2.443-.017-3.503-.19-.924-.535-1.658-.98-2.082-.354-.338-.716-.482-1.15-.455-.996.059-1.8%201.205-2.116%203.01a6.805%206.805%200%200%200-.097.726c0%20.036-.007.066-.015.066a.96.96%200%200%201-.149-.078A4.857%204.857%200%200%200%2012%203.03c-.832%200-1.687.243-2.456.698a.958.958%200%200%201-.148.078c-.008%200-.015-.03-.015-.066a6.71%206.71%200%200%200-.097-.725C8.997%201.392%208.337.319%207.46.048a2.096%202.096%200%200%200-.585-.041Zm.293%201.402c.248.197.523.759.682%201.388.03.113.06.244.069.292.007.047.026.152.041.233.067.365.098.76.102%201.24l.002.475-.12.175-.118.178h-.278c-.324%200-.646.041-.954.124l-.238.06c-.033.007-.038-.003-.057-.144a8.438%208.438%200%200%201%20.016-2.323c.124-.788.413-1.501.696-1.711.067-.05.079-.049.157.013zm9.825-.012c.17.126.358.46.498.888.28.854.36%202.028.212%203.145-.019.14-.024.151-.057.144l-.238-.06a3.693%203.693%200%200%200-.954-.124h-.278l-.119-.178-.119-.175.002-.474c.004-.669.066-1.19.214-1.772.157-.623.434-1.185.68-1.382.078-.062.09-.063.159-.012z'/%3e%3c/svg%3e`,gl=`data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eOpenAI%3c/title%3e%3cpath%20d='M22.2819%209.8211a5.9847%205.9847%200%200%200-.5157-4.9108%206.0462%206.0462%200%200%200-6.5098-2.9A6.0651%206.0651%200%200%200%204.9807%204.1818a5.9847%205.9847%200%200%200-3.9977%202.9%206.0462%206.0462%200%200%200%20.7427%207.0966%205.98%205.98%200%200%200%20.511%204.9107%206.051%206.051%200%200%200%206.5146%202.9001A5.9847%205.9847%200%200%200%2013.2599%2024a6.0557%206.0557%200%200%200%205.7718-4.2058%205.9894%205.9894%200%200%200%203.9977-2.9001%206.0557%206.0557%200%200%200-.7475-7.0729zm-9.022%2012.6081a4.4755%204.4755%200%200%201-2.8764-1.0408l.1419-.0804%204.7783-2.7582a.7948.7948%200%200%200%20.3927-.6813v-6.7369l2.02%201.1686a.071.071%200%200%201%20.038.052v5.5826a4.504%204.504%200%200%201-4.4945%204.4944zm-9.6607-4.1254a4.4708%204.4708%200%200%201-.5346-3.0137l.142.0852%204.783%202.7582a.7712.7712%200%200%200%20.7806%200l5.8428-3.3685v2.3324a.0804.0804%200%200%201-.0332.0615L9.74%2019.9502a4.4992%204.4992%200%200%201-6.1408-1.6464zM2.3408%207.8956a4.485%204.485%200%200%201%202.3655-1.9728V11.6a.7664.7664%200%200%200%20.3879.6765l5.8144%203.3543-2.0201%201.1685a.0757.0757%200%200%201-.071%200l-4.8303-2.7865A4.504%204.504%200%200%201%202.3408%207.872zm16.5963%203.8558L13.1038%208.364%2015.1192%207.2a.0757.0757%200%200%201%20.071%200l4.8303%202.7913a4.4944%204.4944%200%200%201-.6765%208.1042v-5.6772a.79.79%200%200%200-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759%200%200%200-.7854%200L9.409%209.2297V6.8974a.0662.0662%200%200%201%20.0284-.0615l4.8303-2.7866a4.4992%204.4992%200%200%201%206.6802%204.66zM8.3065%2012.863l-2.02-1.1638a.0804.0804%200%200%201-.038-.0567V6.0742a4.4992%204.4992%200%200%201%207.3757-3.4537l-.142.0805L8.704%205.459a.7948.7948%200%200%200-.3927.6813zm1.0976-2.3654l2.602-1.4998%202.6069%201.4998v2.9994l-2.5974%201.4997-2.6067-1.4997Z'/%3e%3c/svg%3e`,_l=`data:image/svg+xml,%3csvg%20width='240'%20height='300'%20viewBox='0%200%20240%20300'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1401_86274)'%3e%3cmask%20id='mask0_1401_86274'%20style='mask-type:luminance'%20maskUnits='userSpaceOnUse'%20x='0'%20y='0'%20width='240'%20height='300'%3e%3cpath%20d='M240%200H0V300H240V0Z'%20fill='white'/%3e%3c/mask%3e%3cg%20mask='url(%23mask0_1401_86274)'%3e%3cpath%20d='M180%20240H60V120H180V240Z'%20fill='%23CFCECD'/%3e%3cpath%20d='M180%2060H60V240H180V60ZM240%20300H0V0H240V300Z'%20fill='%23211E1E'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_1401_86274'%3e%3crect%20width='240'%20height='300'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e`,vl={openai:gl,github:ml,anthropic:ul,claude:ul,gemini:pl,google:pl,codex:gl,ollama:hl,azure:Mr,bedrock:jr,deepseek:fl,openrouter:`data:image/svg+xml,%3csvg%20fill='currentColor'%20fill-rule='evenodd'%20height='1em'%20style='flex:none;line-height:1'%20viewBox='0%200%2024%2024'%20width='1em'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eOpenRouter%3c/title%3e%3cpath%20d='M16.804%201.957l7.22%204.105v.087L16.73%2010.21l.017-2.117-.821-.03c-1.059-.028-1.611.002-2.268.11-1.064.175-2.038.577-3.147%201.352L8.345%2011.03c-.284.195-.495.336-.68.455l-.515.322-.397.234.385.23.53.338c.476.314%201.17.796%202.701%201.866%201.11.775%202.083%201.177%203.147%201.352l.3.045c.694.091%201.375.094%202.825.033l.022-2.159%207.22%204.105v.087L16.589%2022l.014-1.862-.635.022c-1.386.042-2.137.002-3.138-.162-1.694-.28-3.26-.926-4.881-2.059l-2.158-1.5a21.997%2021.997%200%2000-.755-.498l-.467-.28a55.927%2055.927%200%2000-.76-.43C2.908%2014.73.563%2014.116%200%2014.116V9.888l.14.004c.564-.007%202.91-.622%203.809-1.124l1.016-.58.438-.274c.428-.28%201.072-.726%202.686-1.853%201.621-1.133%203.186-1.78%204.881-2.059%201.152-.19%201.974-.213%203.814-.138l.02-1.907z'%3e%3c/path%3e%3c/svg%3e`,wandb:`data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eWeights%20&amp;%20Biases%3c/title%3e%3cpath%20d='M2.48%200a1.55%201.55%200%201%200%200%203.1%201.55%201.55%200%200%200%200-3.1zm19.04%200a1.55%201.55%200%201%200%200%203.101%201.55%201.55%200%200%200%200-3.101zM12%202.295a1.55%201.55%200%201%200%200%203.1%201.55%201.55%200%200%200%200-3.1zM2.48%205.272a2.48%202.48%200%201%200%200%204.96%202.48%202.48%200%200%200%200-4.96zm19.04%200a2.48%202.48%200%201%200%200%204.96%202.48%202.48%200%200%200%200-4.96zM12%208.496a1.55%201.55%200%201%200%200%203.1%201.55%201.55%200%200%200%200-3.1zm-9.52%203.907a1.55%201.55%200%201%200%200%203.1%201.55%201.55%200%200%200%200-3.1zm19.04%200a1.55%201.55%200%201%200%200%203.102%201.55%201.55%200%200%200%200-3.102zM12%2013.767a2.48%202.48%200%201%200%200%204.962%202.48%202.48%200%200%200%200-4.962zm-9.52%203.907a2.48%202.48%200%201%200%20.001%204.962%202.48%202.48%200%200%200%200-4.962zm19.04.93a1.55%201.55%200%201%200%200%203.102%201.55%201.55%200%200%200%200-3.101zM12%2020.9a1.55%201.55%200%201%200%200%203.1%201.55%201.55%200%200%200%200-3.1Z'/%3e%3c/svg%3e`,"opencode-go":_l,marimo:`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAABtlJREFUWEetV21QlNcVfs67y67KV/EjJIRdBIxJrB9BotFqAtERTIKkk8SxNiGt7Ipa46DsxvjR0rVTKuKKJFYTE1SIxmhFbR0Kwc4YNSraqmNswhSFIrBUBD8QVGTZfU/nvrDLroqQ4Pm179nnnvvc5557zr2EXlj05hSfhgvO10AUB/A4AOHEFMCADOJrBFQx0zki+ajkkA9eyslr6kVYBUIPA8ZaLOr/ttQtYJKXgRHSy6B2EBVKwMZqa+6hnsZ0S2DY8jlD2uxSIYDxPQVx/S+CSZIEpyx3rI5wXIZsslm3neouxoMJMEhvNv6JwcvcwYkw8kk9xoZFYOjgYAT2HwBZlnH99i1UNtbj9KVKVDZcho9KhX4+GtgdDrQ52sVwGYQcbduAFRUbNrTdS+R+AhaLpL9Vu4kZ8wTYV6vFrydNxTsTY/Bk0KCHinHxymVsP/E1vjz1jRvXSQIEOqGxO39esWFbo2cQbwIzZ6r0QwPSWUa6APlp++GgyYLgwCB8dqQEs8a/iEF+/j3uSPW1RqTt2orTVRfBHmgCyjQaObZidRcJLwJPL032b3XSEQaixMqTJr6s7GlDcxNOVpZj13wz9IOG9EhAABxOJ5buyUfB6RNeeCKU+vnpYsssFrvXKYhImzvcQfJXDISH/GQg5kyeiqzifYh5eiSss+ZgoK9fryb2BMnMeG/HZhR+e/peEmtqrFuU/OpQwGKRdC21pSLjJZKwMuEtZBbtw6ujx+LDXxohfD/WWu12JH6UgfL6OncIAtpVKh5VlbW1XCGgMxlnA7xT/H4zeiLO26oVCUtMv1cyuq/2na0aMz7KcB/PzjO6rdaam6wQ0JuNx5h5EhFhybQZyD54AJuS5iNhzPN9nds9fsXeHdhRetgz3m2nv+ox6ig4qnqAped04UqWn6utwr/SrVBLKmWAkPHClS4Jw4c8jsbmmzheUYaA/r6YPjJKUcp24yqOlH8PiQgvDv8pQj2Obf3NG5i8erlSH9wmcTyFmQ2vyQxR8ZASE48vTh7BlGdGYWOSUgYU+76uBtPXW9zfyZOnYnvpYbQ7nYovSh+BJXGvY27en13FB1ofH+Qlp2LyUyPc4xZ/uQX7zohUcxmvJJ05OQ1M64TrMf9ANLTcxOK4RKTFJXZLQKxQZLin9ffRoLVdOVluGxsWib8tWun+/uZCGd7+NNsTkk+hJkMOAanCK2S8225HeuIsGF+a1i2B0KDBGB4cgkP/Oe/GaNRqxI14DkcvlqG59Y7iF/Eurv7EjRGKjU5Pxe22uy7fYdKZjflgfteT1gevvIGFU1/tlsCnv1qIV0ZFY8If30dd0zUFN2PMOGxKWoDMogJsPFSk+IRS1Wu3eKky6+O1KK0sV3xEKBdNZzszv+OJSvpZLDLe6HLdmwP5hsWY8uxoxK5ZoTQiYTOfn4TsXxiw/h8HkF3y124JLCv4HDtPHu2YjtBIOpNhI4DfeBKIDovE/kXLu1WgLwQy/74Xm74udsVuIr3JsJSBNZ4EREs9tyoH/v36K+5HqUBG4R5sPlzSqQDZSG8yTmPwQReBwX7+uHqrBetnG5Sq+KgJpO7Mxf6zJztzgI5TsDnJV8PaRoCV5Y4bOkyp2888EYqChR8owLob15TG5LJ5sdMxIkSHjMK/oKH5puIeHzEcb0+IwVffnUXx+TOuCZAz2+iVhFOyfoeKhsudKUAbOkuxoYAZbwqvODqvR43H7n8ew/73liN6aKRXgL58VDbU4+Ws37pDSISEDgL3bIOQvvjfZ/FsSCj2LlymHKdHYaZdW7Gn835AwBU//2a9KzLpTMYTAE8QE4kJxfWr9vpVrEyYiXmx8X2ev+j8GSzY/gm4s4ISsaXGunWVe2mh5pQXiJ3i+uLV/EVD+vjd+YgfGfWjSYjtFN2w3dnZiAg2lZ9z1CVLXpOXtnqzIZMZHZnnYYLEkvhEpMTEQav26TWR/zVdxx8O7IZYvYexxJRQnZ2rlEsvAuIhUtliKwK4qxF4jBStetqIMYgKi0TEkGA8ERiEwf4BGKDRulFCYtHOd586hr1nSt3d0QUgolU11lx3a70vu8TF9I5MxWBM8qT9eEAQ1CoJthsdtd9LIfEWUPsouWN3OnC3XXkP3G+E7FrrFjPQdVl+YHqHWFIGqG/J+cz8lmcUX41WSU5R/12vn17uRxskMtWuzRVl38sedr5It3TuPJI5k5kDe5yIqAqACoyBAHtcoamE4EyrWbet7MGi9BA5PNUY7FDjfYCTAQT1SKQDcAmMQiLKq1mX65WBP0QBL+ywRYu0dk3rSwx+AUAkCEFg8eLCHWJcYeYaSVKXOyT527qsXFsvieL/FjzLIPLjeMUAAAAASUVORK5CYII=`,opencode:_l,cursor:dl},yl=e=>{let t=(0,Y.c)(15),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({provider:r,className:i,...n}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?``:i;if(r===`openai-compatible`||!(r in vl)){let e;t[4]===a?e=t[5]:(e=Fe(`h-4 w-4`,a),t[4]=a,t[5]=e);let n;return t[6]===e?n=t[7]:(n=(0,X.jsx)(M,{className:e}),t[6]=e,t[7]=n),n}let o=vl[r],s;t[8]===a?s=t[9]:(s=Fe(`h-4 w-4 grayscale dark:invert`,a),t[8]=a,t[9]=s);let c;return t[10]!==o||t[11]!==n||t[12]!==r||t[13]!==s?(c=(0,X.jsx)(`img`,{src:o,alt:r,className:s,...n}),t[10]=o,t[11]=n,t[12]=r,t[13]=s,t[14]=c):c=t[14],c};function bl(e){switch(e){case`chat`:return`bg-(--purple-3) text-(--purple-11)`;case`autocomplete`:return`bg-(--green-3) text-(--green-11)`;case`edit`:return`bg-(--blue-3) text-(--blue-11)`;case`thinking`:return`bg-(--purple-4) text-(--purple-12)`}return`bg-(--mauve-3) text-(--mauve-11)`}function xl(e){switch(e){case`chat`:return`Current model used for chat conversations`;case`autocomplete`:return`Current model used for autocomplete autocomplete`;case`edit`:return`Current model used for code edits`;case`rerank`:return`Current model used for reranking completions`;case`embed`:return`Current model used for embedding`}}var Z=`flex flex-row items-center space-x-1 space-y-0`,Sl=e=>{let t=(0,Y.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,X.jsx)(`div`,{className:`text-md font-semibold text-muted-foreground uppercase tracking-wide mb-1`,children:n}),t[0]=n,t[1]=r),r},Cl=e=>{let t=(0,Y.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({children:n,className:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===r?a=t[5]:(a=Fe(`text-base font-semibold underline-offset-2 text-accent-foreground uppercase tracking-wide`,r),t[4]=r,t[5]=a);let o;return t[6]!==n||t[7]!==i||t[8]!==a?(o=(0,X.jsx)(`div`,{...i,className:a,children:n}),t[6]=n,t[7]=i,t[8]=a,t[9]=o):o=t[9],o},wl=e=>{let t=(0,Y.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,X.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n}),t[0]=n,t[1]=r),r},Tl=e=>{let t=(0,Y.c)(5),{title:n,children:r}=e,i;t[0]===n?i=t[1]:(i=(0,X.jsx)(Cl,{children:n}),t[0]=n,t[1]=i);let a;return t[2]!==r||t[3]!==i?(a=(0,X.jsxs)(`div`,{className:`flex flex-col gap-4 pb-4`,children:[i,r]}),t[2]=r,t[3]=i,t[4]=a):a=t[4],a},El=[{label:`Auto (Default)`,value:`auto`},{label:`Native`,value:`native`},{label:`Polars`,value:`polars`},{label:`Lazy Polars`,value:`lazy-polars`},{label:`Pandas`,value:`pandas`}],Dl=`us-east-1.us-east-2.us-west-1.us-west-2.ap-northeast-1.ap-northeast-2.ap-northeast-3.ap-south-1.ap-south-2.ap-southeast-1.ap-southeast-2.ap-southeast-3.ap-southeast-4.ap-southeast-5.ap-southeast-7.ap-east-2.ca-central-1.eu-central-1.eu-central-2.eu-north-1.eu-south-1.eu-south-2.eu-west-1.eu-west-2.eu-west-3.il-central-1.me-central-1.sa-east-1.us-gov-east-1.us-gov-west-1`.split(`.`),Ol=e=>{let t=(0,Y.c)(12),{value:n,includeSuggestion:r}=e,i=r===void 0||r;if(!n||n.includes(`/`))return null;let a;t[0]===n?a=t[1]:(a=ks.parse(n),t[0]=n,t[1]=a);let o=a.id,s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,X.jsx)(`code`,{className:`font-bold`,children:`provider/model`}),t[2]=s):s=t[2];let c;t[3]===n?c=t[4]:(c=(0,X.jsxs)(`span`,{children:[`Model id should be in the form`,` `,s,`. `,n,` is missing a provider.`]}),t[3]=n,t[4]=c);let l;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,X.jsx)(`br`,{}),t[5]=l):l=t[5];let u;t[6]!==i||t[7]!==o?(u=i&&o&&(0,X.jsxs)(`span`,{children:[`Did you mean `,(0,X.jsx)(`code`,{className:`font-bold`,children:o}),`?`]}),t[6]=i,t[7]=o,t[8]=u):u=t[8];let d;return t[9]!==c||t[10]!==u?(d=(0,X.jsxs)(Cr,{kind:`danger`,className:`mt-1`,children:[c,l,u]}),t[9]=c,t[10]=u,t[11]=d):d=t[11],d};function kl({userConfig:e,overrides:t,name:n,value:r}){let i=se(e,n),a=se(t,n),o=xe(t,n);return{isOverridden:o,userValue:i,projectValue:a,value:o?a:r}}function Al(){let e=(0,Y.c)(3),[t]=ue(),n=i(me),r;return e[0]!==n||e[1]!==t?(r=(e,r)=>kl({userConfig:t,overrides:n,name:e,value:r}),e[0]=n,e[1]=t,e[2]=r):r=e[2],r}function Q(e){let t=(0,Y.c)(9),{control:n,name:r,disabled:i,render:a}=e,o=Al(),s;t[0]!==o||t[1]!==r||t[2]!==a?(s=e=>{let{field:t}=e;return a({field:t,override:o(r,t.value)})},t[0]=o,t[1]=r,t[2]=a,t[3]=s):s=t[3];let c;return t[4]!==n||t[5]!==i||t[6]!==r||t[7]!==s?(c=(0,X.jsx)(A,{control:n,name:r,disabled:i,render:s}),t[4]=n,t[5]=i,t[6]=r,t[7]=s,t[8]=c):c=t[8],c}var jl=()=>{let e=(0,Y.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,X.jsxs)(`p`,{children:[`This setting is overridden by the`,` `,(0,X.jsx)(vr,{className:`inline mx-px`,children:`pyproject.toml`}),` config.`]}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,X.jsxs)(X.Fragment,{children:[t,(0,X.jsxs)(`p`,{children:[`To change it, edit the project config`,` `,(0,X.jsx)(vr,{className:`inline mx-px`,children:`pyproject.toml`}),` directly.`]})]}),e[1]=n):n=e[1],n},Ml=e=>{let t=(0,Y.c)(6),{name:n,children:r}=e,i=Al(),a;t[0]!==n||t[1]!==i?(a=i(n,void 0),t[0]=n,t[1]=i,t[2]=a):a=t[2];let{isOverridden:o}=a,s;return t[3]!==r||t[4]!==o?(s=o?(0,X.jsx)(ut,{delayDuration:200,content:(0,X.jsx)(`div`,{className:`flex flex-col gap-2`,children:(0,X.jsx)(jl,{})}),children:(0,X.jsx)(`div`,{className:`text-muted-foreground opacity-80 cursor-not-allowed *:pointer-events-none`,children:r})}):r,t[3]=r,t[4]=o,t[5]=s):s=t[5],s},$=e=>{let t=(0,Y.c)(12),{override:n}=e;if(!n.isOverridden)return null;let r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,X.jsx)(jl,{}),t[0]=r):r=t[0];let i=String(n.userValue),a;t[1]===i?a=t[2]:(a=(0,X.jsx)(`strong`,{children:i}),t[1]=i,t[2]=a);let o;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,X.jsx)(`br`,{}),t[3]=o):o=t[3];let s=String(n.projectValue),c;t[4]===s?c=t[5]:(c=(0,X.jsx)(`strong`,{children:s}),t[4]=s,t[5]=c);let l;t[6]!==a||t[7]!==c?(l=(0,X.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[r,(0,X.jsxs)(`p`,{children:[`User value: `,a,o,`Project value: `,c]})]}),t[6]=a,t[7]=c,t[8]=l):l=t[8];let u;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,X.jsxs)(`span`,{className:`text-(--amber-12) text-xs flex items-center gap-1 border rounded px-2 py-1 bg-(--amber-2) border-(--amber-6) ml-1`,children:[(0,X.jsx)(Wr,{className:`w-3 h-3`}),`Overridden by pyproject.toml`]}),t[9]=u):u=t[9];let d;return t[10]===l?d=t[11]:(d=(0,X.jsx)(ut,{content:l,children:u}),t[10]=l,t[11]=d),d};function Nl(){let e=(0,Y.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=[],e[0]=t):t=e[0],hr(Pl,t)}async function Pl(){return Ne.get(`/ai/mcp/status`)}function Fl(){let[e,t]=(0,J.useState)(!1);return{refresh:async()=>{t(!0);try{await Ne.post(`/ai/mcp/refresh`,{}),Zn({title:`MCP refreshed`,description:`MCP server configuration has been refreshed successfully`})}catch(e){Zn({title:`Refresh failed`,description:e instanceof Error?e.message:`Failed to refresh MCP`,variant:`danger`})}finally{t(!1)}},isRefreshing:e}}var Il=()=>{let e=(0,Y.c)(29),{data:t,refetch:n,isFetching:r}=Nl(),i;e[0]===n?i=e[1]:(i=async()=>{try{await Ne.post(`/ai/mcp/refresh`,{}),Zn({title:`MCP refreshed`,description:`MCP server configuration has been refreshed`}),n()}catch(e){let t=e;Zn({title:`Refresh failed`,description:t instanceof Error?t.message:`Failed to refresh MCP`,variant:`danger`})}},e[0]=n,e[1]=i);let a=i,o;e[2]===t?.servers?o=e[3]:(o=t?.servers||{},e[2]=t?.servers,e[3]=o);let s=o,c;e[4]===s?c=e[5]:(c=Object.keys(s),e[4]=s,e[5]=c);let l=c.length>0,u=t?.status===`ok`&&`text-green-500`,d=t?.status===`partial`&&`text-yellow-500`,f=t?.status===`error`&&l&&`text-red-500`,p;e[6]!==u||e[7]!==d||e[8]!==f?(p=Fe(`h-4 w-4`,u,d,f),e[6]=u,e[7]=d,e[8]=f,e[9]=p):p=e[9];let m;e[10]===p?m=e[11]:(m=(0,X.jsx)(ut,{content:`MCP Status`,children:(0,X.jsx)(k,{asChild:!0,children:(0,X.jsx)(pt,{variant:`text`,size:`icon`,children:(0,X.jsx)(Kr,{className:p})})})}),e[10]=p,e[11]=m);let h;e[12]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,X.jsx)(`h4`,{className:`font-medium text-sm`,children:`MCP Server Status`}),e[12]=h):h=e[12];let g;e[13]===r?g=e[14]:(g=r?(0,X.jsx)(en,{className:`h-3 w-3 animate-spin`}):(0,X.jsx)(rn,{className:`h-3 w-3`}),e[13]=r,e[14]=g);let _;e[15]!==a||e[16]!==r||e[17]!==g?(_=(0,X.jsxs)(`div`,{className:`flex items-center justify-between`,children:[h,(0,X.jsx)(pt,{variant:`ghost`,size:`xs`,onClick:a,disabled:r,children:g})]}),e[15]=a,e[16]=r,e[17]=g,e[18]=_):_=e[18];let v;e[19]!==l||e[20]!==s||e[21]!==t?(v=t&&(0,X.jsxs)(`div`,{className:`text-xs space-y-2`,children:[l&&(0,X.jsxs)(`div`,{className:`flex justify-between items-center`,children:[(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:`Overall:`}),(0,X.jsx)(Ll,{status:t.status})]}),t.error&&(0,X.jsx)(`div`,{className:`text-xs text-red-500 bg-red-50 dark:bg-red-950/20 p-2 rounded`,children:t.error}),l&&(0,X.jsxs)(`div`,{className:`space-y-1`,children:[(0,X.jsx)(`div`,{className:`text-muted-foreground font-medium`,children:`Servers:`}),Object.entries(s).map(Rl)]}),!l&&(0,X.jsxs)(`div`,{className:`text-muted-foreground text-center py-2`,children:[`No MCP servers configured. `,(0,X.jsx)(`br`,{}),` Configure under`,` `,(0,X.jsx)(`b`,{children:`Settings > AI > MCP`})]})]}),e[19]=l,e[20]=s,e[21]=t,e[22]=v):v=e[22];let y;e[23]!==_||e[24]!==v?(y=(0,X.jsx)(P,{className:`w-[320px]`,align:`start`,side:`right`,children:(0,X.jsxs)(`div`,{className:`space-y-3`,children:[_,v]})}),e[23]=_,e[24]=v,e[25]=y):y=e[25];let b;return e[26]!==y||e[27]!==m?(b=(0,X.jsxs)(z,{children:[m,y]}),e[26]=y,e[27]=m,e[28]=b):b=e[28],b},Ll=e=>{let t=(0,Y.c)(11),{status:n}=e,r=n===`ok`&&`text-green-500`,i=n===`partial`&&`text-yellow-500`,a=n===`error`&&`text-red-500`,o=n===`failed`&&`text-red-500`,s=n===`disconnected`&&`text-gray-500`,c=n===`pending`&&`text-yellow-500`,l=n===`connected`&&`text-green-500`,u;t[0]!==r||t[1]!==i||t[2]!==a||t[3]!==o||t[4]!==s||t[5]!==c||t[6]!==l?(u=Fe(`text-xs font-medium`,r,i,a,o,s,c,l),t[0]=r,t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=c,t[6]=l,t[7]=u):u=t[7];let d;return t[8]!==n||t[9]!==u?(d=(0,X.jsx)(`span`,{className:u,children:n}),t[8]=n,t[9]=u,t[10]=d):d=t[10],d};function Rl(e){let[t,n]=e;return(0,X.jsxs)(`div`,{className:`flex justify-between items-center pl-2`,children:[(0,X.jsx)(`span`,{className:`text-muted-foreground truncate max-w-[180px]`,children:t}),(0,X.jsx)(Ll,{status:n})]},t)}var zl=[{id:`marimo`,title:`marimo (docs)`,description:`Access marimo documentation`},{id:`context7`,title:`Context7`,description:`Connect to Context7 MCP server`}],Bl=e=>{let t=(0,Y.c)(36),{form:n,onSubmit:r}=e,{handleClick:i}=Ed(),{data:a,refetch:o,isFetching:s}=Nl(),{refresh:c,isRefreshing:l}=Fl(),u;t[0]!==o||t[1]!==c?(u=async()=>{await c(),o()},t[0]=o,t[1]=c,t[2]=u):u=t[2];let d=u,f;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,X.jsx)(Cl,{children:`MCP Servers`}),t[3]=f):f=t[3];let p;t[4]===a?p=t[5]:(p=a&&(0,X.jsx)(Ll,{status:a.status}),t[4]=a,t[5]=p);let m=l||s,h;t[6]!==s||t[7]!==l?(h=l||s?(0,X.jsx)(en,{className:`h-3 w-3 animate-spin`}):(0,X.jsx)(rn,{className:`h-3 w-3`}),t[6]=s,t[7]=l,t[8]=h):h=t[8];let g;t[9]!==d||t[10]!==m||t[11]!==h?(g=(0,X.jsx)(pt,{variant:`outline`,size:`xs`,onClick:d,disabled:m,children:h}),t[9]=d,t[10]=m,t[11]=h,t[12]=g):g=t[12];let _;t[13]!==p||t[14]!==g?(_=(0,X.jsxs)(`div`,{className:`flex items-center justify-between`,children:[f,(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[p,g]})]}),t[13]=p,t[14]=g,t[15]=_):_=t[15];let v;t[16]===a?v=t[17]:(v=a?.error&&(0,X.jsx)(`div`,{className:`text-xs text-red-600 dark:text-red-400 bg-red-50 dark:bg-red-950/20 p-2 rounded`,children:a.error}),t[16]=a,t[17]=v);let y;t[18]===a?y=t[19]:(y=a?.servers&&(0,X.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:Object.entries(a.servers).map(Vl)}),t[18]=a,t[19]=y);let b;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,X.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Enable Model Context Protocol (MCP) servers to provide additional capabilities and data sources for AI features.`}),t[20]=b):b=t[20];let x;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,X.jsx)(vr,{className:`inline`,children:`marimo[mcp]`}),t[21]=x):x=t[21];let S;t[22]===i?S=t[23]:(S=(0,X.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`This feature requires the `,x,` `,`package. See`,` `,(0,X.jsx)(pt,{variant:`link`,onClick:()=>i(`optionalDeps`),size:`xs`,children:`Optional Features`}),` `,`for more details.`]}),t[22]=i,t[23]=S);let C;t[24]!==n||t[25]!==r?(C=e=>{let{field:t}=e,i=t.value||[],a=e=>{let a=i.includes(e)?i.filter(t=>t!==e):[...i,e];t.onChange(a),r(n.getValues())};return(0,X.jsx)(U,{children:(0,X.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-4`,children:zl.map(e=>{let t=i.includes(e.id);return(0,X.jsxs)(Lr,{className:`cursor-pointer transition-all ${t?`border-(--blue-9) bg-(--blue-2)`:`hover:border-(--blue-7)`}`,onClick:()=>a(e.id),children:[(0,X.jsx)(Pr,{children:(0,X.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,X.jsx)(Nr,{className:`text-base`,children:e.title}),(0,X.jsx)(`span`,{className:`h-5 w-5 flex items-center justify-center rounded border ${t?`border-(--blue-7) bg-(--blue-7) text-foreground`:`border-muted bg-background text-muted-foreground`}`,children:t?(0,X.jsx)(qr,{}):null})]})}),(0,X.jsx)(Fr,{children:(0,X.jsx)(Ir,{children:e.description})})]},e.id)})})})},t[24]=n,t[25]=r,t[26]=C):C=t[26];let w;t[27]!==n.control||t[28]!==C?(w=(0,X.jsx)(A,{control:n.control,name:`mcp.presets`,render:C}),t[27]=n.control,t[28]=C,t[29]=w):w=t[29];let T;return t[30]!==S||t[31]!==w||t[32]!==_||t[33]!==v||t[34]!==y?(T=(0,X.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[_,v,y,b,S,w]}),t[30]=S,t[31]=w,t[32]=_,t[33]=v,t[34]=y,t[35]=T):T=t[35],T};function Vl(e){let[t,n]=e;return(0,X.jsxs)(`div`,{children:[t,`: `,(0,X.jsx)(Ll,{status:n})]},t)}var Hl=new Set(Os);Hl.delete(`deepseek`);var Ul=e=>{let t=(0,Y.c)(5),{provider:n,children:r}=e,i;t[0]===n?i=t[1]:(i=n&&(0,X.jsx)(yl,{provider:n,className:`mr-2`}),t[0]=n,t[1]=i);let a;return t[2]!==r||t[3]!==i?(a=(0,X.jsxs)(`div`,{className:`flex items-center text-base font-semibold`,children:[i,r]}),t[2]=r,t[3]=i,t[4]=a):a=t[4],a},Wl=e=>{let t=(0,Y.c)(9),{form:n,name:r,placeholder:i,testId:a,description:o,onChange:s}=e,c;t[0]!==o||t[1]!==s||t[2]!==i||t[3]!==a?(c=e=>{let{field:t,override:n}=e;return(0,X.jsxs)(`div`,{className:`flex flex-col space-y-1`,children:[(0,X.jsxs)(U,{className:Z,children:[(0,X.jsx)(G,{children:`API Key`}),(0,X.jsx)(B,{children:(0,X.jsx)(Hn,{"data-testid":a,rootClassName:`flex-1`,className:`m-0 inline-flex h-7`,placeholder:i,type:`password`,...t,value:Gl(n.value),disabled:n.isOverridden,onChange:e=>{let n=e.target.value;n.includes(`*`)||(t.onChange(n),s?.(n))}})}),(0,X.jsx)(N,{}),(0,X.jsx)($,{override:n})]}),o&&(0,X.jsx)(W,{children:o})]})},t[0]=o,t[1]=s,t[2]=i,t[3]=a,t[4]=c):c=t[4];let l;return t[5]!==n.control||t[6]!==r||t[7]!==c?(l=(0,X.jsx)(Q,{control:n.control,name:r,render:c}),t[5]=n.control,t[6]=r,t[7]=c,t[8]=l):l=t[8],l};function Gl(e){return e==null?``:typeof e==`string`?e:String(e)}var Kl=e=>{let t=(0,Y.c)(10),{form:n,name:r,placeholder:i,testId:a,description:o,disabled:s,onChange:c}=e,l=s!==void 0&&s,u;t[0]!==o||t[1]!==l||t[2]!==c||t[3]!==i||t[4]!==a?(u=e=>{let{field:t,override:n}=e;return(0,X.jsxs)(`div`,{className:`flex flex-col space-y-1`,children:[(0,X.jsxs)(U,{className:Z,children:[(0,X.jsx)(G,{children:`Base URL`}),(0,X.jsx)(B,{children:(0,X.jsx)(Hn,{"data-testid":a,rootClassName:`flex-1`,className:`m-0 inline-flex h-7`,placeholder:i,...t,value:Gl(n.value),disabled:l||n.isOverridden,onChange:e=>{t.onChange(e.target.value),c?.(e.target.value)}})}),(0,X.jsx)(N,{}),(0,X.jsx)($,{override:n})]}),o&&(0,X.jsx)(W,{children:o})]})},t[0]=o,t[1]=l,t[2]=c,t[3]=i,t[4]=a,t[5]=u):u=t[5];let d;return t[6]!==n.control||t[7]!==r||t[8]!==u?(d=(0,X.jsx)(Q,{control:n.control,name:r,render:u}),t[6]=n.control,t[7]=r,t[8]=u,t[9]=d):d=t[9],d},ql=e=>{let t=(0,Y.c)(11),{form:n,name:r,placeholder:i,description:a,label:o,forRole:s,onSubmit:c}=e,l;t[0]!==a||t[1]!==s||t[2]!==n||t[3]!==o||t[4]!==c||t[5]!==i?(l=e=>{let{field:t,override:r}=e,l=Gl(r.value),u=r.isOverridden;return(0,X.jsxs)(`div`,{className:`flex flex-col space-y-1`,children:[(0,X.jsxs)(U,{className:Z,children:[(0,X.jsx)(G,{children:o}),(0,X.jsx)(B,{children:(0,X.jsx)(Dd,{value:l,placeholder:i,onSelect:e=>{t.onChange(e),c(n.getValues())},disabled:u,triggerClassName:`text-sm`,customDropdownContent:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(nt,{}),(0,X.jsxs)(`p`,{className:`px-2 py-1.5 text-sm text-muted-secondary flex items-center gap-1`,children:[`Enter a custom model`,(0,X.jsx)(ut,{content:`Models should include the provider prefix, e.g. 'openai/gpt-4o'`,children:(0,X.jsx)(O,{className:`h-3 w-3`})})]}),(0,X.jsxs)(`div`,{className:`px-2 py-1`,children:[(0,X.jsx)(Hn,{className:`w-full border-border shadow-none focus-visible:shadow-xs`,placeholder:i,...t,value:l,disabled:u,onKeyDown:ft.stopPropagation()}),l&&(0,X.jsx)(Ol,{value:l,includeSuggestion:!1})]})]}),forRole:s})}),(0,X.jsx)(N,{})]}),(0,X.jsx)($,{override:r}),(0,X.jsx)(Ol,{value:l}),a&&(0,X.jsx)(W,{children:a})]})},t[0]=a,t[1]=s,t[2]=n,t[3]=o,t[4]=c,t[5]=i,t[6]=l):l=t[6];let u;return t[7]!==n.control||t[8]!==r||t[9]!==l?(u=(0,X.jsx)(Q,{control:n.control,name:r,render:l}),t[7]=n.control,t[8]=r,t[9]=l,t[10]=u):u=t[10],u},Jl=e=>{let t=(0,Y.c)(8),{form:n,name:r,options:i,testId:a,disabled:o}=e,s=o!==void 0&&o,c;t[0]!==s||t[1]!==i||t[2]!==a?(c=e=>{let{field:t,override:n}=e;return(0,X.jsx)(`div`,{className:`flex flex-col space-y-1`,children:(0,X.jsxs)(U,{className:Z,children:[(0,X.jsx)(G,{children:`Provider`}),(0,X.jsx)(B,{children:(0,X.jsx)(Xe,{"data-testid":a,onChange:e=>{e.target.value===`none`?t.onChange(!1):t.onChange(e.target.value)},value:Gl(n.value===!0?`github`:n.value===!1?`none`:n.value),disabled:s||n.isOverridden,className:`inline-flex mr-2`,children:i.map(fu)})}),(0,X.jsx)(N,{}),(0,X.jsx)($,{override:n})]})})},t[0]=s,t[1]=i,t[2]=a,t[3]=c):c=t[3];let l;return t[4]!==n.control||t[5]!==r||t[6]!==c?(l=(0,X.jsx)(Q,{control:n.control,name:r,render:c}),t[4]=n.control,t[5]=r,t[6]=c,t[7]=l):l=t[7],l},Yl=({form:e,config:t,onSubmit:n,copilot:r})=>{if(r===!1)return null;if(r===`codeium`)return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`p`,{className:`text-sm text-muted-secondary`,children:[`To get a Windsurf API key, follow`,` `,(0,X.jsx)(Qt,{href:`https://docs.marimo.io/guides/editor_features/ai_completion.html#windsurf-copilot`,children:`these instructions`}),`.`]}),(0,X.jsx)(Wl,{form:e,config:t,name:`completion.codeium_api_key`,placeholder:`key`,testId:`codeium-api-key-input`})]});if(r===`github`)return(0,X.jsx)(tl,{});if(r===`custom`)return(0,X.jsx)(ql,{label:`Autocomplete Model`,form:e,config:t,name:`ai.models.autocomplete_model`,placeholder:`ollama/qwen2.5-coder:1.5b`,description:`Model to use for code completion when using a custom provider.`,onSubmit:n,forRole:`autocomplete`})},Xl=e=>{let t=(0,Y.c)(5),{children:n,className:r}=e,i;t[0]===r?i=t[1]:(i=Fe(`flex flex-col gap-4 pb-4`,r),t[0]=r,t[1]=i);let a;return t[2]!==n||t[3]!==i?(a=(0,X.jsx)(`div`,{className:i,children:n}),t[2]=n,t[3]=i,t[4]=a):a=t[4],a},Zl=e=>{let t=(0,Y.c)(23),{qualifiedId:n,model:r,isEnabled:i,onToggle:a,onDelete:o}=e,s;t[0]!==a||t[1]!==n?(s=()=>{a(n)},t[0]=a,t[1]=n,t[2]=s):s=t[2];let c=s,l;t[3]!==o||t[4]!==n?(l=e=>{e.stopPropagation(),e.preventDefault(),o(n)},t[3]=o,t[4]=n,t[5]=l):l=t[5];let u=l,d;t[6]===r?d=t[7]:(d=(0,X.jsx)(Ql,{model:r}),t[6]=r,t[7]=d);let f;t[8]!==u||t[9]!==r.custom?(f=r.custom&&(0,X.jsx)(pt,{variant:`ghost`,size:`icon`,onClick:u,className:`mr-2 hover:bg-transparent`,children:(0,X.jsx)(Jn,{className:`h-3.5 w-3.5 text-muted-foreground`})}),t[8]=u,t[9]=r.custom,t[10]=f):f=t[10];let p;t[11]!==c||t[12]!==i?(p=(0,X.jsx)(Pe,{checked:i,onClick:c,size:`sm`}),t[11]=c,t[12]=i,t[13]=p):p=t[13];let m;t[14]!==d||t[15]!==f||t[16]!==p?(m=(0,X.jsx)(ys,{children:(0,X.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-2.5 border-b last:border-b-0 cursor-pointer outline-hidden`,children:[d,f,p]})}),t[14]=d,t[15]=f,t[16]=p,t[17]=m):m=t[17];let h;return t[18]!==c||t[19]!==r.name||t[20]!==n||t[21]!==m?(h=(0,X.jsx)(Ss,{id:n,textValue:r.name,className:`pl-6 outline-hidden data-focused:bg-muted/50 hover:bg-muted/50`,onAction:c,children:m}),t[18]=c,t[19]=r.name,t[20]=n,t[21]=m,t[22]=h):h=t[22],h},Ql=e=>{let t=(0,Y.c)(18),{model:n}=e,r;t[0]===n.name?r=t[1]:(r=(0,X.jsx)(`h3`,{className:`font-medium text-sm`,children:n.name}),t[0]=n.name,t[1]=r);let i;t[2]===n.custom?i=t[3]:(i=n.custom&&(0,X.jsx)(M,{className:`h-4 w-4`}),t[2]=n.custom,t[3]=i);let a;t[4]===i?a=t[5]:(a=(0,X.jsx)(ut,{content:`Custom model`,children:i}),t[4]=i,t[5]=a);let o;t[6]===n.capabilities?o=t[7]:(o=n.capabilities.includes(`thinking`)&&(0,X.jsxs)(`div`,{className:Fe(`flex items-center gap-1 rounded px-1 py-0.5 w-fit`,bl(`thinking`)),children:[(0,X.jsx)(Br,{className:`h-3 w-3`}),(0,X.jsx)(`span`,{className:`text-xs font-medium`,children:`Reasoning`})]}),t[6]=n.capabilities,t[7]=o);let s;t[8]!==r||t[9]!==a||t[10]!==o?(s=(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[r,a,o]}),t[8]=r,t[9]=a,t[10]=o,t[11]=s):s=t[11];let c;t[12]!==n.custom||t[13]!==n.description?(c=n.description&&!n.custom&&(0,X.jsx)(`p`,{className:`text-sm text-muted-foreground line-clamp-2`,children:n.description}),t[12]=n.custom,t[13]=n.description,t[14]=c):c=t[14];let l;return t[15]!==s||t[16]!==c?(l=(0,X.jsxs)(`div`,{className:`flex flex-col flex-1 gap-0.5`,children:[s,c]}),t[15]=s,t[16]=c,t[17]=l):l=t[17],l},$l=e=>{let t=(0,Y.c)(14),{form:n,config:r,onSubmit:i}=e,a=Al(),o;t[0]===n.control?o=t[1]:(o={control:n.control,name:`completion.copilot`},t[0]=n.control,t[1]=o);let s=g(o),c;if(t[2]!==r||t[3]!==n||t[4]!==a||t[5]!==i||t[6]!==s){let{value:e}=a(`completion.copilot`,s),o,l;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,X.jsx)(Cl,{children:`Code Completion`}),l=(0,X.jsx)(`p`,{className:`text-sm text-muted-secondary`,children:`Choose GitHub Copilot, Codeium, or a custom provider (such as Ollama) to enable AI-powered code completion.`}),t[8]=o,t[9]=l):(o=t[8],l=t[9]);let u;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(u=[`none`,`github`,`codeium`,`custom`],t[10]=u):u=t[10];let d;t[11]!==r||t[12]!==n?(d=(0,X.jsx)(Jl,{form:n,config:r,name:`completion.copilot`,options:u,testId:`copilot-select`}),t[11]=r,t[12]=n,t[13]=d):d=t[13],c=(0,X.jsxs)(Xl,{children:[o,l,d,Yl({form:n,config:r,onSubmit:i,copilot:e})]}),t[2]=r,t[3]=n,t[4]=a,t[5]=i,t[6]=s,t[7]=c}else c=t[7];return c};function eu(){return i(fe).ai?.allow_provider_config!==!1}var tu=e=>{let t=(0,Y.c)(15),{title:n,triggerClassName:r,provider:i,children:a,isConfigured:o,value:s}=e,c=s??i,l;t[0]===o?l=t[1]:(l=o&&(0,X.jsx)(`span`,{className:`ml-2 px-1 rounded bg-muted text-xs font-medium border`,children:`Configured`}),t[0]=o,t[1]=l);let u;t[2]!==i||t[3]!==l||t[4]!==n?(u=(0,X.jsxs)(Ul,{provider:i,children:[n,l]}),t[2]=i,t[3]=l,t[4]=n,t[5]=u):u=t[5];let d;t[6]!==u||t[7]!==r?(d=(0,X.jsx)(Be,{className:r,children:u}),t[6]=u,t[7]=r,t[8]=d):d=t[8];let f;t[9]===a?f=t[10]:(f=(0,X.jsx)(Re,{wrapperClassName:`flex flex-col gap-4`,children:a}),t[9]=a,t[10]=f);let p;return t[11]!==c||t[12]!==d||t[13]!==f?(p=(0,X.jsxs)(Le,{value:c,children:[d,f]}),t[11]=c,t[12]=d,t[13]=f,t[14]=p):p=t[14],p},nu=({form:e,config:t,onSubmit:n})=>{let[r,i]=(0,J.useState)(!1),[a,o]=(0,J.useState)(``),[s,c]=(0,J.useState)(``),[l,u]=(0,J.useState)(``),d=(0,J.useId)(),f=(0,J.useId)(),p=(0,J.useId)(),m=a.toLowerCase().replaceAll(/\s+/g,`_`),h=e.watch(`ai.custom_providers`),g=Hl.has(m)||h&&Object.keys(h).includes(m),_=m.includes(`.`),v=m.trim()&&l.trim()&&!g&&!_,y=()=>{o(``),c(``),u(``),i(!1)};return(0,X.jsx)(A,{control:e.control,name:`ai.custom_providers`,render:({field:h})=>{let b=h.value||{},x=Object.entries(b),S=()=>{v&&(h.onChange({...b,[m]:{api_key:s||void 0,base_url:l}}),n(e.getValues()),y())},C=t=>{let{[t]:r,...i}=b;e.resetField(`ai.custom_providers`),e.setValue(`ai.custom_providers`,i,{shouldDirty:!0}),n(e.getValues())},w=(0,X.jsxs)(`div`,{className:`flex flex-col gap-3 p-4 border border-border rounded-md bg-muted/20`,children:[(0,X.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,X.jsx)(Je,{htmlFor:d,children:`Provider Name`}),(0,X.jsx)(Hn,{id:d,placeholder:`e.g., together, groq, mistral`,value:a,onChange:e=>o(e.target.value)}),g&&(0,X.jsx)(`p`,{className:`text-xs text-destructive`,children:`A provider with this name already exists.`}),_&&(0,X.jsx)(`p`,{className:`text-xs text-destructive`,children:`Provider names cannot contain '.' characters.`}),a&&!_&&(0,X.jsxs)(`p`,{className:`text-xs text-muted-secondary`,children:[`Use models with prefix:`,` `,(0,X.jsxs)(vr,{className:`inline text-xs`,children:[m,`/`]})]})]}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,X.jsxs)(Je,{htmlFor:p,children:[`Base URL `,(0,X.jsx)(`span`,{className:`text-destructive`,children:`*`})]}),(0,X.jsx)(Hn,{id:p,placeholder:`e.g., https://api.together.xyz/v1`,value:l,onChange:e=>u(e.target.value)})]}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,X.jsx)(Je,{htmlFor:f,children:`API Key (optional)`}),(0,X.jsx)(Hn,{id:f,placeholder:`sk-...`,type:`password`,value:s,onChange:e=>c(e.target.value)})]}),(0,X.jsxs)(`div`,{className:`flex gap-2 mt-1`,children:[(0,X.jsx)(pt,{onClick:S,disabled:!v,size:`xs`,children:`Add Provider`}),(0,X.jsx)(pt,{variant:`outline`,onClick:y,size:`xs`,children:`Cancel`})]})]}),T=e=>{h.onChange({...b,[e.providerName]:{...b[e.providerName],[e.fieldName]:e.value||void 0}})},E=({providerName:n,providerConfig:r,onRemove:i})=>{let a=It.startCase(n),o=!!r.api_key||!!r.base_url;return(0,X.jsxs)(tu,{title:a,provider:n,value:`custom-${n}`,isConfigured:o,children:[(0,X.jsx)(Wl,{form:e,config:t,name:`ai.custom_providers.${n}.api_key`,placeholder:`sk-...`,testId:`custom-provider-${n}-api-key`,onChange:e=>T({providerName:n,fieldName:`api_key`,value:e})}),(0,X.jsx)(Kl,{form:e,config:t,name:`ai.custom_providers.${n}.base_url`,placeholder:`https://api.example.com/v1`,testId:`custom-provider-${n}-base-url`,onChange:e=>T({providerName:n,fieldName:`base_url`,value:e})}),(0,X.jsxs)(pt,{variant:`destructive`,size:`xs`,onClick:e=>{e.stopPropagation(),e.preventDefault(),i(n)},className:`w-fit self-end`,children:[(0,X.jsx)(Jn,{className:`h-4 w-4 mr-2`}),`Remove Provider`]})]},`custom-${n}`)};return(0,X.jsxs)(Xl,{children:[(0,X.jsx)(Cl,{children:`Custom Providers`}),(0,X.jsx)(`p`,{className:`text-sm text-muted-secondary`,children:`Add your own OpenAI-compatible provider. Once added, you can configure models in the AI Models tab.`}),x.length>0&&(0,X.jsx)(Ve,{type:`multiple`,className:`-mt-4`,children:x.map(([e,t])=>E({providerName:e,providerConfig:t,onRemove:C}))}),r?w:(0,X.jsx)(lu,{className:`self-start`,isFormOpen:r,setIsFormOpen:i,label:`Add Provider`})]})}})},ru=()=>{let e=(0,Y.c)(3),t=i(fe).ai,n;if(e[0]!==t){let r=fc(t),i;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,X.jsx)(`p`,{className:`text-sm text-muted-secondary`,children:`AI providers are configured for this environment. You cannot add your own keys or custom providers.`}),e[2]=i):i=e[2],n=(0,X.jsxs)(Xl,{children:[i,r.length===0?(0,X.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No AI providers are configured.`}):(0,X.jsx)(`div`,{className:`flex flex-col divide-y border rounded-md`,children:r.map(pu)})]}),e[0]=t,e[1]=n}else n=e[1];return n},iu=e=>{let t=(0,Y.c)(121),{form:n,config:r,onSubmit:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=ke(),t[0]=a):a=t[0];let o=a,s=eu(),c;t[1]===n?c=t[2]:(c=e=>!!n.getValues(e),t[1]=n,t[2]=c);let l=c;if(!s){let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(ru,{}),t[3]=e):e=t[3],e}let u;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,X.jsx)(vr,{className:`inline`,children:`marimo.toml`}),t[4]=u):u=t[4];let d;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,X.jsxs)(`p`,{className:`text-sm text-muted-secondary`,children:[`Add your API keys below or to `,u,` `,`to set up a provider for the Code Completion and Assistant features; see`,` `,(0,X.jsx)(Qt,{href:`https://docs.marimo.io/guides/editor_features/ai_completion/#connecting-to-an-llm`,children:`docs`}),` `,`for more info.`]}),t[5]=d):d=t[5];let f=l(`ai.open_ai.api_key`),p;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,X.jsxs)(X.Fragment,{children:[`Your OpenAI API key from`,` `,(0,X.jsx)(Qt,{href:`https://platform.openai.com/account/api-keys`,children:`platform.openai.com`}),`.`]}),t[6]=p):p=t[6];let m,h;t[7]!==r||t[8]!==n?(m=(0,X.jsx)(Wl,{form:n,config:r,name:`ai.open_ai.api_key`,placeholder:`sk-proj...`,testId:`ai-openai-api-key-input`,description:p}),h=(0,X.jsx)(Kl,{form:n,config:r,name:`ai.open_ai.base_url`,placeholder:`https://api.openai.com/v1`,testId:`ai-base-url-input`,disabled:o}),t[7]=r,t[8]=n,t[9]=m,t[10]=h):(m=t[9],h=t[10]);let g;t[11]!==f||t[12]!==m||t[13]!==h?(g=(0,X.jsxs)(tu,{title:`OpenAI`,provider:`openai`,triggerClassName:`pt-0`,isConfigured:f,children:[m,h]}),t[11]=f,t[12]=m,t[13]=h,t[14]=g):g=t[14];let _=l(`ai.github.api_key`),v;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,X.jsx)(vr,{className:`inline`,children:`gh auth token`}),t[15]=v):v=t[15];let y;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,X.jsxs)(X.Fragment,{children:[`Your GitHub OAuth token. Run`,` `,v,` after you sign in with the GitHub CLI. A GitHub Copilot subscription is required. See the`,` `,(0,X.jsx)(Qt,{href:`https://pydantic.dev/docs/ai/models/github-copilot/`,children:`authentication guide`}),`.`]}),t[16]=y):y=t[16];let b,x;t[17]!==r||t[18]!==n?(b=(0,X.jsx)(Wl,{form:n,config:r,name:`ai.github.api_key`,placeholder:`gho_...`,testId:`ai-github-copilot-api-key-input`,description:y}),x=(0,X.jsx)(Kl,{form:n,config:r,name:`ai.github.base_url`,placeholder:`https://api.githubcopilot.com`,testId:`ai-github-copilot-base-url-input`}),t[17]=r,t[18]=n,t[19]=b,t[20]=x):(b=t[19],x=t[20]);let S;t[21]!==_||t[22]!==b||t[23]!==x?(S=(0,X.jsxs)(tu,{title:`GitHub Copilot`,provider:`github`,isConfigured:_,children:[b,x]}),t[21]=_,t[22]=b,t[23]=x,t[24]=S):S=t[24];let C=l(`ai.anthropic.api_key`),w;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,X.jsxs)(X.Fragment,{children:[`Your Anthropic API key from`,` `,(0,X.jsx)(Qt,{href:`https://console.anthropic.com/settings/keys`,children:`console.anthropic.com`}),`.`]}),t[25]=w):w=t[25];let T;t[26]!==r||t[27]!==n?(T=(0,X.jsx)(Wl,{form:n,config:r,name:`ai.anthropic.api_key`,placeholder:`sk-ant...`,testId:`ai-anthropic-api-key-input`,description:w}),t[26]=r,t[27]=n,t[28]=T):T=t[28];let E;t[29]!==C||t[30]!==T?(E=(0,X.jsx)(tu,{title:`Anthropic`,provider:`anthropic`,isConfigured:C,children:T}),t[29]=C,t[30]=T,t[31]=E):E=t[31];let D=l(`ai.google.api_key`),O;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,X.jsxs)(X.Fragment,{children:[`Your Google AI API key from`,` `,(0,X.jsx)(Qt,{href:`https://aistudio.google.com/app/apikey`,children:`aistudio.google.com`}),`.`]}),t[32]=O):O=t[32];let k;t[33]!==r||t[34]!==n?(k=(0,X.jsx)(Wl,{form:n,config:r,name:`ai.google.api_key`,placeholder:`AI...`,testId:`ai-google-api-key-input`,description:O}),t[33]=r,t[34]=n,t[35]=k):k=t[35];let A;t[36]!==D||t[37]!==k?(A=(0,X.jsx)(tu,{title:`Google`,provider:`google`,isConfigured:D,children:k}),t[36]=D,t[37]=k,t[38]=A):A=t[38];let j=l(`ai.ollama.base_url`),M;t[39]!==r||t[40]!==n?(M=(0,X.jsx)(Kl,{form:n,config:r,name:`ai.ollama.base_url`,placeholder:`http://localhost:11434/v1`,testId:`ollama-base-url-input`}),t[39]=r,t[40]=n,t[41]=M):M=t[41];let N;t[42]!==j||t[43]!==M?(N=(0,X.jsx)(tu,{title:`Ollama`,provider:`ollama`,isConfigured:j,children:M}),t[42]=j,t[43]=M,t[44]=N):N=t[44];let P=l(`ai.openrouter.api_key`),F;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,X.jsxs)(X.Fragment,{children:[`Your OpenRouter API key from `,``,(0,X.jsx)(Qt,{href:`https://openrouter.ai/keys`,children:`openrouter.ai`}),`.`]}),t[45]=F):F=t[45];let I,L;t[46]!==r||t[47]!==n?(I=(0,X.jsx)(Wl,{form:n,config:r,name:`ai.openrouter.api_key`,placeholder:`or-...`,testId:`ai-openrouter-api-key-input`,description:F}),L=(0,X.jsx)(Kl,{form:n,config:r,name:`ai.openrouter.base_url`,placeholder:`https://openrouter.ai/api/v1/`,testId:`ai-openrouter-base-url-input`}),t[46]=r,t[47]=n,t[48]=I,t[49]=L):(I=t[48],L=t[49]);let R;t[50]!==P||t[51]!==I||t[52]!==L?(R=(0,X.jsxs)(tu,{title:`OpenRouter`,provider:`openrouter`,isConfigured:P,children:[I,L]}),t[50]=P,t[51]=I,t[52]=L,t[53]=R):R=t[53];let z=l(`ai.wandb.api_key`),B;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,X.jsxs)(X.Fragment,{children:[`Your Weights & Biases API key from`,` `,(0,X.jsx)(Qt,{href:`https://wandb.ai/authorize`,children:`wandb.ai`}),`.`]}),t[54]=B):B=t[54];let V,H;t[55]!==r||t[56]!==n?(V=(0,X.jsx)(Wl,{form:n,config:r,name:`ai.wandb.api_key`,placeholder:`your-wandb-api-key`,testId:`ai-wandb-api-key-input`,description:B}),H=(0,X.jsx)(Kl,{form:n,config:r,name:`ai.wandb.base_url`,placeholder:`https://api.inference.wandb.ai/v1/`,testId:`ai-wandb-base-url-input`}),t[55]=r,t[56]=n,t[57]=V,t[58]=H):(V=t[57],H=t[58]);let U;t[59]!==z||t[60]!==V||t[61]!==H?(U=(0,X.jsxs)(tu,{title:`Weights & Biases`,provider:`wandb`,isConfigured:z,children:[V,H]}),t[59]=z,t[60]=V,t[61]=H,t[62]=U):U=t[62];let ee=l(`ai.opencode_go.api_key`),W;t[63]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,X.jsxs)(X.Fragment,{children:[`Your OpenCode API key from`,` `,(0,X.jsx)(Qt,{href:`https://opencode.ai/auth`,children:`opencode.ai`}),`. OpenCode Go is a low-cost subscription for open coding models.`]}),t[63]=W):W=t[63];let te,ne;t[64]!==r||t[65]!==n?(te=(0,X.jsx)(Wl,{form:n,config:r,name:`ai.opencode_go.api_key`,placeholder:`your-opencode-api-key`,testId:`ai-opencode-go-api-key-input`,description:W}),ne=(0,X.jsx)(Kl,{form:n,config:r,name:`ai.opencode_go.base_url`,placeholder:`https://opencode.ai/zen/go/v1/`,testId:`ai-opencode-go-base-url-input`}),t[64]=r,t[65]=n,t[66]=te,t[67]=ne):(te=t[66],ne=t[67]);let re;t[68]!==ee||t[69]!==te||t[70]!==ne?(re=(0,X.jsxs)(tu,{title:`OpenCode Go`,provider:`opencode-go`,isConfigured:ee,children:[te,ne]}),t[68]=ee,t[69]=te,t[70]=ne,t[71]=re):re=t[71];let G=l(`ai.azure.api_key`)&&l(`ai.azure.base_url`),ie;t[72]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,X.jsxs)(X.Fragment,{children:[`Your Azure API key from`,` `,(0,X.jsx)(Qt,{href:`https://portal.azure.com/`,children:`portal.azure.com`}),`.`]}),t[72]=ie):ie=t[72];let K,ae;t[73]!==r||t[74]!==n?(K=(0,X.jsx)(Wl,{form:n,config:r,name:`ai.azure.api_key`,placeholder:`sk-proj...`,testId:`ai-azure-api-key-input`,description:ie}),ae=(0,X.jsx)(Kl,{form:n,config:r,name:`ai.azure.base_url`,placeholder:`https://<your-resource-name>.openai.azure.com/openai/deployments/<deployment-name>?api-version=<api-version>`,testId:`ai-azure-base-url-input`}),t[73]=r,t[74]=n,t[75]=K,t[76]=ae):(K=t[75],ae=t[76]);let oe;t[77]!==G||t[78]!==K||t[79]!==ae?(oe=(0,X.jsxs)(tu,{title:`Azure`,provider:`azure`,isConfigured:G,children:[K,ae]}),t[77]=G,t[78]=K,t[79]=ae,t[80]=oe):oe=t[80];let se=l(`ai.bedrock.region_name`),ce;t[81]===Symbol.for(`react.memo_cache_sentinel`)?(ce=(0,X.jsxs)(`p`,{className:`text-sm text-muted-secondary mb-2`,children:[`To use AWS Bedrock, you need to configure AWS credentials and region. See the`,` `,(0,X.jsx)(Qt,{href:`https://docs.marimo.io/guides/editor_features/ai_completion.html#aws-bedrock`,children:`documentation`}),` `,`for more details.`]}),t[81]=ce):ce=t[81];let le,ue;t[82]===n.control?(le=t[83],ue=t[84]):(le=(0,X.jsx)(Q,{control:n.control,disabled:o,name:`ai.bedrock.region_name`,render:hu}),ue=(0,X.jsx)(Q,{control:n.control,disabled:o,name:`ai.bedrock.profile_name`,render:gu}),t[82]=n.control,t[83]=le,t[84]=ue);let de;t[85]!==se||t[86]!==le||t[87]!==ue?(de=(0,X.jsxs)(tu,{title:`AWS Bedrock`,provider:`bedrock`,isConfigured:se,children:[ce,le,ue]}),t[85]=se,t[86]=le,t[87]=ue,t[88]=de):de=t[88];let fe=l(`ai.open_ai_compatible.api_key`)&&l(`ai.open_ai_compatible.base_url`),pe;t[89]===Symbol.for(`react.memo_cache_sentinel`)?(pe=(0,X.jsx)(`p`,{className:`text-sm text-amber-600 dark:text-amber-400 mb-2`,children:`Consider using Custom Providers instead, which allows you to add multiple providers with distinct names.`}),t[89]=pe):pe=t[89];let me;t[90]===Symbol.for(`react.memo_cache_sentinel`)?(me=(0,X.jsx)(X.Fragment,{children:`API key for any OpenAI-compatible provider (e.g., Together, Groq, Mistral, Perplexity, etc).`}),t[90]=me):me=t[90];let he;t[91]!==r||t[92]!==n?(he=(0,X.jsx)(Wl,{form:n,config:r,name:`ai.open_ai_compatible.api_key`,placeholder:`sk-...`,testId:`ai-openai-compatible-api-key-input`,description:me}),t[91]=r,t[92]=n,t[93]=he):he=t[93];let ge;t[94]===Symbol.for(`react.memo_cache_sentinel`)?(ge=(0,X.jsx)(X.Fragment,{children:`Base URL for your OpenAI-compatible provider.`}),t[94]=ge):ge=t[94];let _e;t[95]!==r||t[96]!==n?(_e=(0,X.jsx)(Kl,{form:n,config:r,name:`ai.open_ai_compatible.base_url`,placeholder:`https://api.together.xyz/v1`,testId:`ai-openai-compatible-base-url-input`,description:ge}),t[95]=r,t[96]=n,t[97]=_e):_e=t[97];let ve;t[98]!==fe||t[99]!==he||t[100]!==_e?(ve=(0,X.jsxs)(tu,{title:`OpenAI-Compatible (Legacy)`,provider:`openai-compatible`,isConfigured:fe,children:[pe,he,_e]}),t[98]=fe,t[99]=he,t[100]=_e,t[101]=ve):ve=t[101];let ye;t[102]!==S||t[103]!==E||t[104]!==A||t[105]!==N||t[106]!==R||t[107]!==U||t[108]!==re||t[109]!==oe||t[110]!==de||t[111]!==ve||t[112]!==g?(ye=(0,X.jsxs)(Ve,{type:`multiple`,children:[g,S,E,A,N,R,U,re,oe,de,ve]}),t[102]=S,t[103]=E,t[104]=A,t[105]=N,t[106]=R,t[107]=U,t[108]=re,t[109]=oe,t[110]=de,t[111]=ve,t[112]=g,t[113]=ye):ye=t[113];let be;t[114]!==r||t[115]!==n||t[116]!==i?(be=(0,X.jsx)(nu,{form:n,config:r,onSubmit:i}),t[114]=r,t[115]=n,t[116]=i,t[117]=be):be=t[117];let xe;return t[118]!==ye||t[119]!==be?(xe=(0,X.jsxs)(Xl,{children:[d,ye,be]}),t[118]=ye,t[119]=be,t[120]=xe):xe=t[120],xe},au=e=>{let t=(0,Y.c)(29),{form:n,config:r,onSubmit:i}=e,[a,o]=(0,J.useState)(r.ai?.max_tokens!=null),s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,X.jsx)(Cl,{children:`AI Assistant`}),t[0]=s):s=t[0];let c;t[1]===n.control?c=t[2]:(c=(0,X.jsx)(A,{control:n.control,name:`ai.inline_tooltip`,render:_u}),t[1]=n.control,t[2]=c);let l;t[3]!==n||t[4]!==a||t[5]!==i?(l=e=>{let{field:t}=e;return(0,X.jsxs)(`div`,{className:`flex flex-col gap-y-1`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-x-2`,children:[(0,X.jsxs)(U,{className:Z,children:[(0,X.jsx)(G,{className:`font-normal`,children:`Max output tokens`}),(0,X.jsx)(B,{children:(0,X.jsx)(Hn,{"data-testid":`ai-max-tokens-input`,type:`number`,min:1,disabled:!a,className:`w-28 h-6`,value:t.value??(a?``:32768),onChange:e=>{let n=Number.parseInt(e.target.value,10);t.onChange(Number.isFinite(n)&&n>0?n:null)}})})]}),(0,X.jsxs)(U,{className:Z,children:[(0,X.jsx)(y,{"data-testid":`ai-max-tokens-checkbox`,checked:a,onCheckedChange:e=>{let r=e===!0;o(r);let a=r?t.value??32768:null;n.setValue(`ai.max_tokens`,a,{shouldDirty:!0,shouldTouch:!0}),i(n.getValues())}}),(0,X.jsx)(G,{className:`font-normal`,children:`Override`})]})]}),(0,X.jsx)(W,{children:`Each provider sets its own max output tokens (Anthropic uses a recommended default). Adjust to control costs or enable more output.`})]})},t[3]=n,t[4]=a,t[5]=i,t[6]=l):l=t[6];let u;t[7]!==n.control||t[8]!==l?(u=(0,X.jsx)(A,{control:n.control,name:`ai.max_tokens`,render:l}),t[7]=n.control,t[8]=l,t[9]=u):u=t[9];let d;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,X.jsx)(L,{}),t[10]=d):d=t[10];let f;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,X.jsx)(`span`,{children:`Model to use for chat conversations in the Chat panel.`}),t[11]=f):f=t[11];let p;t[12]!==r||t[13]!==n||t[14]!==i?(p=(0,X.jsx)(ql,{label:`Chat Model`,form:n,config:r,name:`ai.models.chat_model`,placeholder:le,description:f,forRole:`chat`,onSubmit:i}),t[12]=r,t[13]=n,t[14]=i,t[15]=p):p=t[15];let m;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,X.jsxs)(`span`,{children:[`Model to use for code editing with the`,` `,(0,X.jsx)(vr,{className:`inline`,children:`Generate with AI`}),` button.`]}),t[16]=m):m=t[16];let h;t[17]!==r||t[18]!==n||t[19]!==i?(h=(0,X.jsx)(ql,{label:`Edit Model`,form:n,config:r,name:`ai.models.edit_model`,placeholder:le,description:m,forRole:`edit`,onSubmit:i}),t[17]=r,t[18]=n,t[19]=i,t[20]=h):h=t[20];let g;t[21]===n.control?g=t[22]:(g=(0,X.jsx)(Q,{control:n.control,name:`ai.rules`,render:vu}),t[21]=n.control,t[22]=g);let _;return t[23]!==g||t[24]!==c||t[25]!==u||t[26]!==p||t[27]!==h?(_=(0,X.jsxs)(Xl,{children:[s,c,u,d,p,h,g]}),t[23]=g,t[24]=c,t[25]=u,t[26]=p,t[27]=h,t[28]=_):_=t[28],_},ou=e=>{let t=(0,Y.c)(51),{providerId:n,models:r,enabledModels:i,onToggleModel:a,onToggleProvider:s,onDeleteModel:c}=e,l;if(t[0]!==i||t[1]!==r||t[2]!==n){let e;t[4]!==i||t[5]!==n?(e=e=>i.has(new ks(n,e.model).id),t[4]=i,t[5]=n,t[6]=e):e=t[6],l=r.filter(e),t[0]=i,t[1]=r,t[2]=n,t[3]=l}else l=t[3];let u=l.length,d=r.length,f;t[7]===n?f=t[8]:(f=Rs.getProviderInfo(n),t[7]=n,t[8]=f);let p=f,m;t[9]!==p?.name||t[10]!==n?(m=p?.name||It.startCase(n),t[9]=p?.name,t[10]=n,t[11]=m):m=t[11];let h=m,g=u===0?!1:u===d||`indeterminate`,_;t[12]!==u||t[13]!==s||t[14]!==n||t[15]!==d?(_=()=>{let e=u<d/2;s(n,e)},t[12]=u,t[13]=s,t[14]=n,t[15]=d,t[16]=_):_=t[16];let v=o(_),b;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(b=ft.stopPropagation(),t[17]=b):b=t[17];let x;t[18]!==g||t[19]!==v?(x=(0,X.jsx)(y,{checked:g,onCheckedChange:v,onClick:b}),t[18]=g,t[19]=v,t[20]=x):x=t[20];let S;t[21]===n?S=t[22]:(S=(0,X.jsx)(yl,{provider:n,className:`h-5 w-5`}),t[21]=n,t[22]=S);let C;t[23]===h?C=t[24]:(C=(0,X.jsx)(`h2`,{className:`font-semibold`,children:h}),t[23]=h,t[24]=C);let w;t[25]!==u||t[26]!==d?(w=(0,X.jsxs)(`p`,{className:`text-sm text-muted-secondary`,children:[u,`/`,d,` models`]}),t[25]=u,t[26]=d,t[27]=w):w=t[27];let T;t[28]!==C||t[29]!==w?(T=(0,X.jsxs)(`div`,{className:`flex items-center justify-between w-full`,children:[C,w]}),t[28]=C,t[29]=w,t[30]=T):T=t[30];let E;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,X.jsx)(An,{slot:`chevron`,children:(0,X.jsx)(Ut,{className:`h-4 w-4 text-muted-foreground shrink-0 transition-transform duration-200 group-data-expanded:rotate-90`})}),t[31]=E):E=t[31];let D;t[32]!==T||t[33]!==x||t[34]!==S?(D=(0,X.jsx)(ys,{children:(0,X.jsxs)(`div`,{className:`flex items-center gap-3 px-2 py-3 hover:bg-muted/50 cursor-pointer outline-hidden focus-visible:outline-hidden border-b group-data-expanded:border-b-0 rounded-sm`,children:[x,S,T,E]})}),t[32]=T,t[33]=x,t[34]=S,t[35]=D):D=t[35];let O;if(t[36]!==i||t[37]!==r||t[38]!==c||t[39]!==a||t[40]!==n){let e;t[42]!==i||t[43]!==c||t[44]!==a||t[45]!==n?(e=e=>{let t=new ks(n,e.model).id;return(0,X.jsx)(Zl,{qualifiedId:t,model:e,isEnabled:i.has(t),onToggle:a,onDelete:c},t)},t[42]=i,t[43]=c,t[44]=a,t[45]=n,t[46]=e):e=t[46],O=r.map(e),t[36]=i,t[37]=r,t[38]=c,t[39]=a,t[40]=n,t[41]=O}else O=t[41];let k;return t[47]!==n||t[48]!==D||t[49]!==O?(k=(0,X.jsxs)(Ss,{id:n,hasChildItems:!0,textValue:n,className:`outline-hidden data-focused:bg-muted/50 group`,children:[D,O]}),t[47]=n,t[48]=D,t[49]=O,t[50]=k):k=t[50],k},su=e=>{let t=(0,Y.c)(56),{form:n,onSubmit:r}=e,a=i(fe).ai,s;t[0]===n.control?s=t[1]:(s={control:n.control,name:`ai.models.custom_models`},t[0]=n.control,t[1]=s);let c=g(s),l;t[2]===n.control?l=t[3]:(l={control:n.control,name:`ai.custom_providers`},t[2]=n.control,t[3]=l);let u=g(l),d;t[4]===u?d=t[5]:(d=Object.keys(u||{}),t[4]=u,t[5]=d);let f;t[6]===a?.custom_providers?f=t[7]:(f=Object.keys(a?.custom_providers||{}),t[6]=a?.custom_providers,t[7]=f);let p;t[8]!==d||t[9]!==f?(p=new Set([...d,...f]),t[8]=d,t[9]=f,t[10]=p):p=t[10];let m;t[11]===p?m=t[12]:(m=[...p],t[11]=p,t[12]=m);let h=m,_;t[13]===c?_=t[14]:(_=Rs.create({displayedModels:[],customModels:c}),t[13]=c,t[14]=_);let v=_,y;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(y=[],t[15]=y):y=t[15];let b;t[16]===n.control?b=t[17]:(b={control:n.control,name:`ai.models.displayed_models`,defaultValue:y},t[16]=n.control,t[17]=b);let x=g(b),S;t[18]===x?S=t[19]:(S=new Set(x),t[18]=x,t[19]=S);let C=S,w;t[20]===v?w=t[21]:(w=v.getGroupedModelsByProvider(),t[20]=v,t[21]=w);let T=w,E=mc(v.getListModelsByProvider(),a),D;t[22]!==x||t[23]!==C||t[24]!==n||t[25]!==r?(D=e=>{let t=C.has(e)?x.filter(t=>t!==e):[...x,e];n.setValue(`ai.models.displayed_models`,t,{shouldDirty:!0,shouldTouch:!0}),r(n.getValues())},t[22]=x,t[23]=C,t[24]=n,t[25]=r,t[26]=D):D=t[26];let O=o(D),k;t[27]!==x||t[28]!==n||t[29]!==T||t[30]!==r?(k=async(e,t)=>{let i=T.get(e)||[],a=new Set(i.map(t=>new ks(e,t.model).id)),o=t?[...new Set([...x,...a])]:x.filter(e=>!a.has(e));n.setValue(`ai.models.displayed_models`,o,{shouldDirty:!0,shouldTouch:!0}),r(n.getValues())},t[27]=x,t[28]=n,t[29]=T,t[30]=r,t[31]=k):k=t[31];let A=o(k),j;t[32]!==x||t[33]!==c||t[34]!==n||t[35]!==r?(j=e=>{let t=c.filter(t=>t!==e),i=x.filter(t=>t!==e);n.setValue(`ai.models.displayed_models`,i,{shouldDirty:!0,shouldTouch:!0}),n.setValue(`ai.models.custom_models`,t,{shouldDirty:!0,shouldTouch:!0}),r(n.getValues())},t[32]=x,t[33]=c,t[34]=n,t[35]=r,t[36]=j):j=t[36];let M=o(j),N=Xl,P;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,X.jsx)(`p`,{className:`text-sm text-muted-secondary`,children:`Control which AI models are displayed in model selection dropdowns. When no models are selected, all available models will be shown.`}),t[37]=P):P=t[37];let F=hs,I;t[38]!==C||t[39]!==M||t[40]!==O||t[41]!==A?(I=e=>{let[t,n]=e;return(0,X.jsx)(ou,{providerId:t,models:n,enabledModels:C,onToggleModel:O,onToggleProvider:A,onDeleteModel:M},t)},t[38]=C,t[39]=M,t[40]=O,t[41]=A,t[42]=I):I=t[42];let L=E.map(I),R;t[43]!==F||t[44]!==L?(R=(0,X.jsx)(`div`,{className:`bg-background`,children:(0,X.jsx)(F,{"aria-label":`AI Models by Provider`,className:`flex-1 overflow-auto outline-hidden focus-visible:outline-hidden`,selectionMode:`none`,children:L})}),t[43]=F,t[44]=L,t[45]=R):R=t[45];let z;t[46]!==c||t[47]!==h||t[48]!==n||t[49]!==r?(z=(0,X.jsx)(cu,{form:n,customModels:c,customProviderNames:h,onSubmit:r}),t[46]=c,t[47]=h,t[48]=n,t[49]=r,t[50]=z):z=t[50];let B;return t[51]!==N||t[52]!==P||t[53]!==R||t[54]!==z?(B=(0,X.jsxs)(N,{className:`gap-2`,children:[P,R,z]}),t[51]=N,t[52]=P,t[53]=R,t[54]=z,t[55]=B):B=t[55],B},cu=e=>{let t=(0,Y.c)(97),{form:n,customModels:r,customProviderNames:i,onSubmit:a}=e,[o,s]=(0,J.useState)(!1),[c,l]=(0,J.useState)(!1),[u,d]=(0,J.useState)(null),[f,p]=(0,J.useState)(``),[m,h]=(0,J.useState)(``),g=(0,J.useId)(),_=(0,J.useId)(),v=(0,J.useId)(),y=u===`custom`,b=y?f:u,x;t[0]!==m||t[1]!==b?(x=b?.trim()&&m?.trim(),t[0]=m,t[1]=b,t[2]=x):x=t[2];let S=x,C;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(C=()=>{d(null),p(``),h(``),s(!1)},t[3]=C):C=t[3];let w=C,T;t[4]!==r||t[5]!==n||t[6]!==S||t[7]!==m||t[8]!==a||t[9]!==b?(T=()=>{if(!S)return;let e=new ks(b,m);n.setValue(`ai.models.custom_models`,[e.id,...r],{shouldDirty:!0,shouldTouch:!0}),a(n.getValues()),w(),l(!0),setTimeout(()=>l(!1),2e3)},t[4]=r,t[5]=n,t[6]=S,t[7]=m,t[8]=a,t[9]=b,t[10]=T):T=t[10];let E=T,D,O,k,A,j,M,N,P,F,I,L;if(t[11]!==i||t[12]!==u||t[13]!==g){let e;t[25]===i?e=t[26]:(e=e=>e!==`marimo`&&!i.includes(e),t[25]=i,t[26]=e);let n=Os.filter(e);j=`flex flex-col gap-2`,L=`flex items-center gap-2`,t[27]===g?A=t[28]:(A=(0,X.jsx)(Je,{htmlFor:g,className:`text-sm font-medium text-muted-foreground min-w-12`,children:`Provider`}),t[27]=g,t[28]=A),k=et,P=u||``,t[29]===Symbol.for(`react.memo_cache_sentinel`)?(F=e=>d(e),t[29]=F):F=t[29];let r;t[30]===u?r=t[31]:(r=u?(0,X.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,X.jsx)(yl,{provider:u,className:`h-3.5 w-3.5`}),(0,X.jsx)(`span`,{children:jd(u)})]}):(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:`Select...`}),t[30]=u,t[31]=r),t[32]!==g||t[33]!==r?(I=(0,X.jsx)($e,{id:g,className:`w-40 truncate`,children:r}),t[32]=g,t[33]=r,t[34]=I):I=t[34],O=Ze,D=Qe,M=i.length>0&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`p`,{className:`px-2 py-1 text-xs text-muted-secondary font-medium`,children:`Custom Providers`}),i.map(yu),n.length>0&&(0,X.jsx)(`p`,{className:`px-2 py-1 text-xs text-muted-secondary font-medium mt-1`,children:`Built-in Providers`})]}),N=n.map(bu),t[11]=i,t[12]=u,t[13]=g,t[14]=D,t[15]=O,t[16]=k,t[17]=A,t[18]=j,t[19]=M,t[20]=N,t[21]=P,t[22]=F,t[23]=I,t[24]=L}else D=t[14],O=t[15],k=t[16],A=t[17],j=t[18],M=t[19],N=t[20],P=t[21],F=t[22],I=t[23],L=t[24];let R;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,X.jsx)(`p`,{className:`px-2 py-1 text-xs text-muted-secondary font-medium mt-1`,children:`Other`}),t[35]=R):R=t[35];let z;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,X.jsxs)(X.Fragment,{children:[R,(0,X.jsx)(Ye,{value:`custom`,children:(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(yl,{provider:`openai-compatible`,className:`h-4 w-4`}),(0,X.jsx)(`span`,{children:`Enter provider name`})]})})]}),t[36]=z):z=t[36];let B;t[37]!==D||t[38]!==M||t[39]!==N?(B=(0,X.jsxs)(D,{children:[M,N,z]}),t[37]=D,t[38]=M,t[39]=N,t[40]=B):B=t[40];let V;t[41]!==O||t[42]!==B?(V=(0,X.jsx)(O,{children:B}),t[41]=O,t[42]=B,t[43]=V):V=t[43];let H;t[44]!==k||t[45]!==V||t[46]!==P||t[47]!==F||t[48]!==I?(H=(0,X.jsxs)(k,{value:P,onValueChange:F,children:[I,V]}),t[44]=k,t[45]=V,t[46]=P,t[47]=F,t[48]=I,t[49]=H):H=t[49];let U;t[50]!==A||t[51]!==H||t[52]!==L?(U=(0,X.jsxs)(`div`,{className:L,children:[A,H]}),t[50]=A,t[51]=H,t[52]=L,t[53]=U):U=t[53];let ee;t[54]!==_||t[55]!==f||t[56]!==y?(ee=y&&(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(Je,{htmlFor:_,className:`text-sm font-medium text-muted-foreground min-w-12`,children:`Name`}),(0,X.jsx)(Hn,{id:_,value:f,onChange:e=>p(e.target.value),placeholder:`openrouter`,className:`w-40 truncate`})]}),t[54]=_,t[55]=f,t[56]=y,t[57]=ee):ee=t[57];let W;t[58]!==j||t[59]!==U||t[60]!==ee?(W=(0,X.jsxs)(`div`,{className:j,children:[U,ee]}),t[58]=j,t[59]=U,t[60]=ee,t[61]=W):W=t[61];let te=W,ne=y&&`self-start`,re;t[62]===ne?re=t[63]:(re=Fe(`flex items-center gap-2`,ne),t[62]=ne,t[63]=re);let G;t[64]===v?G=t[65]:(G=(0,X.jsx)(Je,{htmlFor:v,className:`text-sm font-medium text-muted-foreground`,children:`Model`}),t[64]=v,t[65]=G);let ie;t[66]===Symbol.for(`react.memo_cache_sentinel`)?(ie=e=>h(e.target.value),t[66]=ie):ie=t[66];let K;t[67]!==m||t[68]!==v?(K=(0,X.jsx)(Hn,{id:v,value:m,onChange:ie,placeholder:`gpt-4`,className:`text-xs mb-0`}),t[67]=m,t[68]=v,t[69]=K):K=t[69];let ae;t[70]!==re||t[71]!==G||t[72]!==K?(ae=(0,X.jsxs)(`div`,{className:re,children:[G,K]}),t[70]=re,t[71]=G,t[72]=K,t[73]=ae):ae=t[73];let oe=ae,se=y&&`self-end`,ce;t[74]===se?ce=t[75]:(ce=Fe(`flex gap-1.5 ml-auto`,se),t[74]=se,t[75]=ce);let le=!S,ue;t[76]!==E||t[77]!==le?(ue=(0,X.jsx)(pt,{onClick:E,disabled:le,size:`xs`,children:`Add`}),t[76]=E,t[77]=le,t[78]=ue):ue=t[78];let de;t[79]===Symbol.for(`react.memo_cache_sentinel`)?(de=(0,X.jsx)(pt,{variant:`outline`,onClick:w,size:`xs`,children:`Cancel`}),t[79]=de):de=t[79];let fe;t[80]!==ce||t[81]!==ue?(fe=(0,X.jsxs)(`div`,{className:ce,children:[ue,de]}),t[80]=ce,t[81]=ue,t[82]=fe):fe=t[82];let pe;t[83]!==oe||t[84]!==te||t[85]!==fe?(pe=(0,X.jsxs)(`div`,{className:`flex items-center gap-3 p-3 border border-border rounded-md`,children:[te,oe,fe]}),t[83]=oe,t[84]=te,t[85]=fe,t[86]=pe):pe=t[86];let me=o&&pe,he;t[87]===o?he=t[88]:(he=(0,X.jsx)(lu,{isFormOpen:o,setIsFormOpen:s,label:`Add Model`,className:`pl-2`}),t[87]=o,t[88]=he);let ge;t[89]===c?ge=t[90]:(ge=c&&(0,X.jsx)(`div`,{className:`flex items-center gap-1 text-green-700 bg-green-500/10 px-2 py-1 rounded-md ml-auto`,children:`✓ Model added`}),t[89]=c,t[90]=ge);let _e;t[91]!==he||t[92]!==ge?(_e=(0,X.jsxs)(`div`,{className:`flex flex-row text-sm`,children:[he,ge]}),t[91]=he,t[92]=ge,t[93]=_e):_e=t[93];let ve;return t[94]!==me||t[95]!==_e?(ve=(0,X.jsxs)(`div`,{children:[me,_e]}),t[94]=me,t[95]=_e,t[96]=ve):ve=t[96],ve},lu=e=>{let t=(0,Y.c)(10),{isFormOpen:n,setIsFormOpen:r,label:i,className:a}=e,o;t[0]===r?o=t[1]:(o=e=>{e.stopPropagation(),e.preventDefault(),r(!0)},t[0]=r,t[1]=o);let s;t[2]===a?s=t[3]:(s=Fe(`px-0`,a),t[2]=a,t[3]=s);let c;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,X.jsx)(nn,{className:`h-4 w-4 mr-2 mb-0.5`}),t[4]=c):c=t[4];let l;return t[5]!==n||t[6]!==i||t[7]!==o||t[8]!==s?(l=(0,X.jsxs)(pt,{onClick:o,variant:`link`,disabled:n,className:s,children:[c,i]}),t[5]=n,t[6]=i,t[7]=o,t[8]=s,t[9]=l):l=t[9],l},uu=e=>{let t=(0,Y.c)(2),{form:n}=e,r;return t[0]===n.control?r=t[1]:(r=(0,X.jsx)(Xl,{children:(0,X.jsx)(Q,{control:n.control,name:`ai.enabled`,render:xu})}),t[0]=n.control,t[1]=r),r},du=e=>{let t=(0,Y.c)(38),{form:r,config:i,onSubmit:a}=e,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=ke(),t[0]=o):o=t[0];let s=o,[c,l]=n(wd),u=Al(),d;t[1]===r.control?d=t[2]:(d={control:r.control,name:`ai.enabled`},t[1]=r.control,t[2]=d);let f=g(d),p;t[3]!==u||t[4]!==f?(p=u(`ai.enabled`,f),t[3]=u,t[4]=f,t[5]=p):p=t[5];let{value:m}=p,h=m===!1&&c!==`ai-features`?`ai-features`:c,_;t[6]===l?_=t[7]:(_=e=>l(e),t[6]=l,t[7]=_);let v;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,X.jsx)(We,{value:`ai-features`,children:`AI Features`}),t[8]=v):v=t[8];let y;t[9]===m?y=t[10]:(y=m!==!1&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(We,{value:`ai-providers`,children:`AI Providers`}),(0,X.jsx)(We,{value:`ai-models`,children:`AI Models`}),!s&&(0,X.jsx)(We,{value:`mcp`,children:`MCP`})]}),t[9]=m,t[10]=y);let b;t[11]===y?b=t[12]:(b=(0,X.jsxs)(Ke,{className:`mb-2`,children:[v,y]}),t[11]=y,t[12]=b);let x,S;t[13]!==i||t[14]!==r||t[15]!==a?(x=(0,X.jsx)($l,{form:r,config:i,onSubmit:a}),S=(0,X.jsx)(uu,{form:r,config:i,onSubmit:a}),t[13]=i,t[14]=r,t[15]=a,t[16]=x,t[17]=S):(x=t[16],S=t[17]);let C;t[18]!==m||t[19]!==i||t[20]!==r||t[21]!==a?(C=m!==!1&&(0,X.jsx)(au,{form:r,config:i,onSubmit:a}),t[18]=m,t[19]=i,t[20]=r,t[21]=a,t[22]=C):C=t[22];let w;t[23]!==C||t[24]!==x||t[25]!==S?(w=(0,X.jsxs)(Ge,{value:`ai-features`,children:[x,S,C]}),t[23]=C,t[24]=x,t[25]=S,t[26]=w):w=t[26];let T;t[27]!==m||t[28]!==i||t[29]!==r||t[30]!==a?(T=m!==!1&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Ge,{value:`ai-providers`,children:(0,X.jsx)(iu,{form:r,config:i,onSubmit:a})}),(0,X.jsx)(Ge,{value:`ai-models`,children:(0,X.jsx)(su,{form:r,config:i,onSubmit:a})}),!s&&(0,X.jsx)(Ge,{value:`mcp`,children:(0,X.jsx)(Bl,{form:r,onSubmit:a})})]}),t[27]=m,t[28]=i,t[29]=r,t[30]=a,t[31]=T):T=t[31];let E;return t[32]!==h||t[33]!==w||t[34]!==T||t[35]!==_||t[36]!==b?(E=(0,X.jsxs)(qe,{value:h,onValueChange:_,className:`flex-1`,children:[b,w,T]}),t[32]=h,t[33]=w,t[34]=T,t[35]=_,t[36]=b,t[37]=E):E=t[37],E};function fu(e){return(0,X.jsx)(`option`,{value:e,children:e},e)}function pu(e){return(0,X.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2`,children:[(0,X.jsx)(yl,{provider:e,className:`h-4 w-4`}),(0,X.jsx)(`span`,{className:`text-sm font-medium`,children:jd(e)}),(0,X.jsx)(`span`,{className:`ml-auto px-1 rounded bg-muted text-xs font-medium border`,children:`Configured`})]},e)}function mu(e){return(0,X.jsx)(`option`,{value:e,children:e},e)}function hu(e){let{field:t,override:n}=e;return(0,X.jsxs)(`div`,{className:`flex flex-col space-y-1`,children:[(0,X.jsxs)(U,{className:Z,children:[(0,X.jsx)(G,{children:`AWS Region`}),(0,X.jsx)(B,{children:(0,X.jsx)(Xe,{"data-testid":`bedrock-region-select`,onChange:e=>t.onChange(e.target.value),value:typeof n.value==`string`?n.value:`us-east-1`,disabled:t.disabled||n.isOverridden,className:`inline-flex mr-2`,children:Dl.map(mu)})}),(0,X.jsx)(N,{}),(0,X.jsx)($,{override:n})]}),(0,X.jsx)(W,{children:`The AWS region where Bedrock service is available.`})]})}function gu(e){let{field:t,override:n}=e;return(0,X.jsxs)(`div`,{className:`flex flex-col space-y-1`,children:[(0,X.jsxs)(U,{className:Z,children:[(0,X.jsx)(G,{children:`AWS Profile Name (Optional)`}),(0,X.jsx)(B,{children:(0,X.jsx)(Hn,{"data-testid":`bedrock-profile-input`,rootClassName:`flex-1`,className:`m-0 inline-flex h-7`,placeholder:`default`,...t,value:n.value||``,disabled:t.disabled||n.isOverridden})}),(0,X.jsx)(N,{}),(0,X.jsx)($,{override:n})]}),(0,X.jsx)(W,{children:`The AWS profile name from your ~/.aws/credentials file. Leave blank to use your default AWS credentials.`})]})}function _u(e){let{field:t}=e;return(0,X.jsxs)(`div`,{className:`flex flex-col gap-y-1`,children:[(0,X.jsxs)(U,{className:Z,children:[(0,X.jsx)(G,{className:`font-normal`,children:`AI Edit Tooltip`}),(0,X.jsx)(B,{children:(0,X.jsx)(y,{"data-testid":`inline-ai-checkbox`,checked:t.value===!0,onCheckedChange:t.onChange})})]}),(0,X.jsx)(W,{children:`Enable "Edit with AI" tooltip when selecting code.`})]})}function vu(e){let{field:t,override:n}=e;return(0,X.jsxs)(`div`,{className:`flex flex-col`,children:[(0,X.jsxs)(U,{children:[(0,X.jsx)(G,{children:`Custom Rules`}),(0,X.jsx)(B,{children:(0,X.jsx)(qt,{"data-testid":`ai-rules-input`,className:`m-0 inline-flex w-full h-32 p-2 text-sm`,placeholder:`e.g. Always use type hints; prefer polars over pandas`,...t,value:n.value,disabled:n.isOverridden})}),(0,X.jsx)(N,{}),(0,X.jsx)($,{override:n})]}),(0,X.jsx)(W,{children:`Custom rules to include in all AI completion prompts.`})]})}function yu(e){return(0,X.jsx)(Ye,{value:e,children:(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(yl,{provider:e,className:`h-4 w-4`}),(0,X.jsx)(`span`,{children:It.startCase(e)})]})},e)}function bu(e){return(0,X.jsx)(Ye,{value:e,children:(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(yl,{provider:e,className:`h-4 w-4`}),(0,X.jsx)(`span`,{children:jd(e)})]})},e)}function xu(e){let{field:t,override:n}=e;return(0,X.jsxs)(`div`,{className:`flex flex-col gap-y-1`,children:[(0,X.jsxs)(U,{className:Z,children:[(0,X.jsx)(G,{className:`font-normal`,children:`Enable AI features`}),(0,X.jsx)(B,{children:(0,X.jsx)(y,{"data-testid":`ai-enabled-checkbox`,checked:n.value!==!1,disabled:n.isOverridden,onCheckedChange:e=>t.onChange(e===!0)})}),(0,X.jsx)($,{override:n})]}),(0,X.jsx)(W,{children:`When disabled, AI actions and panels are hidden from the marimo UI.`})]})}var Su=[`auto`,`true`,`false`],Cu=e=>{let t=(0,Y.c)(34),{form:n,onSubmit:r}=e,i;t[0]===n.control?i=t[1]:(i=(e,t)=>(0,X.jsx)(Q,{control:n.control,name:e,render:e=>{let{field:n,override:r}=e;return(0,X.jsxs)(U,{className:Z,children:[(0,X.jsx)(G,{className:`text-sm font-normal w-16`,children:t}),(0,X.jsx)(B,{children:(0,X.jsx)(Xe,{"data-testid":`auto-discover-schemas-select`,onChange:e=>{let t=e.target.value;n.onChange(t===`true`||t!==`false`&&t)},value:r.value===void 0?`auto`:r.value.toString(),disabled:n.disabled||r.isOverridden,className:`w-[100px]`,children:Su.map(wu)})}),(0,X.jsx)($,{override:r})]})}}),t[0]=n.control,t[1]=i);let a=i,o;t[2]===n.control?o=t[3]:(o=(0,X.jsx)(Q,{control:n.control,name:`display.dataframes`,render:Eu}),t[2]=n.control,t[3]=o);let s;t[4]!==n||t[5]!==r?(s=e=>{let{field:t,override:i}=e;return(0,X.jsxs)(`div`,{className:`flex flex-col space-y-1`,children:[(0,X.jsxs)(U,{className:Z,children:[(0,X.jsx)(G,{children:`Default table page size`}),(0,X.jsx)(B,{children:(0,X.jsx)(Vn,{"aria-label":`Default table page size`,"data-testid":`default-table-page-size-input`,className:`m-0 w-24`,...t,value:i.value,isDisabled:i.isOverridden,minValue:1,step:1,onChange:e=>{t.onChange(e),Number.isNaN(e)||r(n.getValues())}})}),(0,X.jsx)(N,{}),(0,X.jsx)($,{override:i})]}),(0,X.jsx)(W,{children:`The default number of rows displayed in dataframes and SQL results.`})]})},t[4]=n,t[5]=r,t[6]=s):s=t[6];let c;t[7]!==n.control||t[8]!==s?(c=(0,X.jsx)(Q,{control:n.control,name:`display.default_table_page_size`,render:s}),t[7]=n.control,t[8]=s,t[9]=c):c=t[9];let l;t[10]!==n||t[11]!==r?(l=e=>{let{field:t,override:i}=e;return(0,X.jsxs)(`div`,{className:`flex flex-col space-y-1`,children:[(0,X.jsxs)(U,{className:Z,children:[(0,X.jsx)(G,{children:`Default table max columns`}),(0,X.jsx)(B,{children:(0,X.jsx)(Vn,{"aria-label":`Default table max columns`,"data-testid":`default-table-max-columns-input`,className:`m-0 w-24`,...t,value:i.value,isDisabled:i.isOverridden,minValue:1,step:1,onChange:e=>{t.onChange(e),Number.isNaN(e)||r(n.getValues())}})}),(0,X.jsx)(N,{}),(0,X.jsx)($,{override:i})]}),(0,X.jsx)(W,{children:`The default maximum number of columns displayed in dataframes and SQL results.`})]})},t[10]=n,t[11]=r,t[12]=l):l=t[12];let u;t[13]!==n.control||t[14]!==l?(u=(0,X.jsx)(Q,{control:n.control,name:`display.default_table_max_columns`,render:l}),t[13]=n.control,t[14]=l,t[15]=u):u=t[15];let d;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,X.jsx)(`div`,{className:`text-sm text-foreground`,children:`Database Schema Discovery`}),t[16]=d):d=t[16];let f,p;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,X.jsx)(`br`,{}),p=(0,X.jsx)(`span`,{className:`font-semibold`,children:`Can be expensive for large databases.`}),t[17]=f,t[18]=p):(f=t[17],p=t[18]);let m;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,X.jsxs)(`div`,{className:`text-sm text-muted-foreground mb-2`,children:[`Whether database schemas, tables, and columns are automatically discovered.`,f,p,` `,`Use 'auto' to determine introspection based on the`,` `,(0,X.jsx)(`a`,{className:`text-link hover:underline`,rel:`noopener noreferrer`,target:`_blank`,href:`https://docs.marimo.io/guides/working_with_data/sql/?h=database#database-schema-and-table-auto-discovery`,children:`database`}),`.`]}),t[19]=m):m=t[19];let h;t[20]===a?h=t[21]:(h=(0,X.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[d,m,a(`datasources.auto_discover_schemas`,`Schemas`),a(`datasources.auto_discover_tables`,`Tables`),a(`datasources.auto_discover_columns`,`Columns`)]}),t[20]=a,t[21]=h);let g,_;t[22]===n.control?(g=t[23],_=t[24]):(g=(0,X.jsx)(Q,{control:n.control,name:`diagnostics.sql_linter`,render:Du}),_=(0,X.jsx)(Q,{control:n.control,name:`runtime.default_sql_output`,render:ku}),t[22]=n.control,t[23]=g,t[24]=_);let v;t[25]!==h||t[26]!==g||t[27]!==_?(v=(0,X.jsxs)(Tl,{title:`SQL`,children:[h,g,_]}),t[25]=h,t[26]=g,t[27]=_,t[28]=v):v=t[28];let y;return t[29]!==v||t[30]!==o||t[31]!==c||t[32]!==u?(y=(0,X.jsxs)(X.Fragment,{children:[o,c,u,v]}),t[29]=v,t[30]=o,t[31]=c,t[32]=u,t[33]=y):y=t[33],y};function wu(e){return(0,X.jsx)(`option`,{value:e,children:e},e)}function Tu(e){return(0,X.jsx)(`option`,{value:e,children:e},e)}function Eu(e){let{field:t,override:n}=e;return(0,X.jsxs)(`div`,{className:`flex flex-col space-y-1`,children:[(0,X.jsxs)(U,{className:Z,children:[(0,X.jsx)(G,{children:`Dataframe viewer`}),(0,X.jsx)(B,{children:(0,X.jsx)(Xe,{"data-testid":`display-dataframes-select`,onChange:e=>t.onChange(e.target.value),value:n.value,disabled:t.disabled||n.isOverridden,className:`inline-flex mr-2`,children:[`rich`,`plain`].map(Tu)})}),(0,X.jsx)(N,{}),(0,X.jsx)($,{override:n})]}),(0,X.jsx)(W,{children:`Whether to use marimo's rich dataframe viewer or a plain HTML table. This requires restarting your notebook to take effect.`})]})}function Du(e){let{field:t,override:n}=e;return(0,X.jsxs)(`div`,{className:`flex flex-col space-y-1`,children:[(0,X.jsxs)(U,{className:Z,children:[(0,X.jsx)(G,{children:`SQL Linter`}),(0,X.jsx)(B,{children:(0,X.jsx)(y,{"data-testid":`sql-linter-checkbox`,checked:n.value,disabled:n.isOverridden,onCheckedChange:t.onChange})}),(0,X.jsx)(N,{}),(0,X.jsx)($,{override:n})]}),(0,X.jsx)(W,{children:`Better linting and autocompletions for SQL cells.`})]})}function Ou(e){return(0,X.jsx)(`option`,{value:e.value,children:e.label},e.value)}function ku(e){let{field:t,override:n}=e;return(0,X.jsxs)(`div`,{className:`flex flex-col space-y-1`,children:[(0,X.jsxs)(U,{className:Z,children:[(0,X.jsx)(G,{children:`Default SQL output`}),(0,X.jsx)(B,{children:(0,X.jsx)(Xe,{"data-testid":`user-config-sql-output-select`,onChange:e=>t.onChange(e.target.value),value:n.value,disabled:t.disabled||n.isOverridden,className:`inline-flex mr-2`,children:El.map(Ou)})}),(0,X.jsx)(N,{}),(0,X.jsx)($,{override:n})]}),(0,X.jsx)(W,{children:`The default SQL output type for new notebooks; overridden by "sql_output" in the application config.`})]})}function Au(e,t){let n={};for(let r of Object.keys(t)){let i=t[r],a=e[r];if(a!==void 0){if(i===!0)n[r]=a;else if(typeof i==`object`&&i){let e=Au(a,i);Object.keys(e).length>0&&(n[r]=e)}}}return n}var ju=(e,t)=>{t.ai={...t.ai,models:{...t.ai?.models,displayed_models:e.ai?.models?.displayed_models??[],custom_models:e.ai?.models?.custom_models??[]}}},Mu=new Map([[`ai.models.displayed_models`,ju],[`ai.models.custom_models`,ju]]),Nu=(e,t)=>{if(!e)return!1;let n=e;for(let e of t.split(`.`)){if(typeof n!=`object`||!n)return!1;n=n[e]}return n===!0},Pu=e=>{let{values:t,dirtyValues:n,touchedFields:r}=e;for(let[e,i]of Mu)Nu(r,e)&&i(t,n)};function Fu(e,t){let n=/^(\d+)\.(\d+)\.(\d+)(?:-([\w.-]+))?(?:\+([\w.-]+))?$/,r=e=>{let t=e.match(n);if(!t)return null;let[,r,i,a,o]=t;return{major:Number.parseInt(r,10),minor:Number.parseInt(i,10),patch:Number.parseInt(a,10),preRelease:o||``}};try{let n=r(e),i=r(t);return!n||!i?e.localeCompare(t,void 0,{numeric:!0,sensitivity:`base`}):n.major===i.major?n.minor===i.minor?n.patch===i.patch?n.preRelease===``&&i.preRelease!==``?1:n.preRelease!==``&&i.preRelease===``?-1:n.preRelease.localeCompare(i.preRelease):n.patch-i.patch:n.minor-i.minor:n.major-i.major}catch{return e.localeCompare(t,void 0,{numeric:!0,sensitivity:`base`})}}var Iu=(e,t)=>Fu(t,e);function Lu(e){return e.replaceAll(/\[.*]/g,``).trim()}var Ru=/^((?:\d+!)?\d+(?:\.\d+)*)(?:[-_.]?(?:a|b|c|rc|alpha|beta|pre|preview|dev)\d*)/i;function zu(e,t){let n=e.name.split(`[`)[0],r=t.find(e=>e.name===n);if(!r)return!1;if(!e.minVersion)return!0;let i=r.version.match(Ru);return i?Fu(i[1],e.minVersion)>0:Fu(r.version,e.minVersion)>=0}var Bu=[{id:`sql`,packagesRequired:[{name:`duckdb`},{name:`sqlglot`}],additionalPackageInstalls:[{name:`polars[pyarrow]`}],description:`SQL cells`},{id:`charts`,packagesRequired:[{name:`altair`}],additionalPackageInstalls:[],description:`Charts in datasource viewer`},{id:`fast-charts`,packagesRequired:[{name:`vegafusion`},{name:`vl-convert-python`}],additionalPackageInstalls:[],description:`Fast server-side charts`},{id:`formatting`,packagesRequired:[ke()?{name:`black`}:{name:`ruff`}],additionalPackageInstalls:[],description:`Formatting`},{id:`ai`,packagesRequired:[{name:`openai`}],additionalPackageInstalls:[],description:`AI features`},{id:`mcp`,packagesRequired:[{name:`mcp`,minVersion:`2.0.0`}],additionalPackageInstalls:[],description:`Connect to MCP servers`},{id:`ipy-export`,packagesRequired:[{name:`nbformat`}],additionalPackageInstalls:[],description:`Export as IPYNB`},{id:`testing`,packagesRequired:[{name:`pytest`}],additionalPackageInstalls:[],description:`Autorun unit tests`}];ke()||Bu.push({id:`lsp`,packagesRequired:[{name:`python-lsp-server`},{name:`websockets`}],additionalPackageInstalls:[{name:`python-lsp-ruff`}],description:`Language Server Protocol*`});var Vu=()=>{let e=(0,Y.c)(21),[t]=be(),n=t.package_management.manager,{getPackageList:r}=Lt(),i;e[0]===r?i=e[1]:(i=()=>r(),e[0]=r,e[1]=i);let a;e[2]===n?a=e[3]:(a=[n],e[2]=n,e[3]=a);let{data:o,error:s,refetch:c,isPending:l}=hr(i,a);if(l){let t;return e[4]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,X.jsx)(tn,{size:`medium`,centered:!0}),e[4]=t):t=e[4],t}if(s){let t;return e[5]===s?t=e[6]:(t=(0,X.jsx)(Sr,{error:s}),e[5]=s,e[6]=t),t}let u;e[7]===o?.packages?u=e[8]:(u=o?.packages||[],e[7]=o?.packages,e[8]=u);let d=u,f;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,X.jsx)(Cl,{children:`Optional Features`}),e[9]=f):f=e[9];let p;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,X.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`marimo is lightweight, with few dependencies, to maximize compatibility with your own environments.`,(0,X.jsx)(`br`,{}),`To unlock additional features in the marimo editor, you can install these optional dependencies:`]}),e[10]=p):p=e[10];let m;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,X.jsx)(wr,{children:(0,X.jsxs)(Dr,{children:[(0,X.jsx)(Tr,{children:`Dependency`}),(0,X.jsx)(Tr,{children:`Feature`}),(0,X.jsx)(Tr,{children:`Status`}),(0,X.jsx)(Tr,{})]})}),e[11]=m):m=e[11];let h;e[12]!==d||e[13]!==n||e[14]!==c?(h=Bu.map(e=>{let t=e.packagesRequired.every(e=>zu(e,d)),r=e.packagesRequired.map(Uu).join(`, `);return(0,X.jsxs)(Dr,{className:`text-sm`,children:[(0,X.jsx)(Or,{children:e.description}),(0,X.jsx)(Or,{className:`font-mono text-xs`,children:r}),(0,X.jsx)(Or,{children:t?(0,X.jsxs)(`div`,{className:`flex items-center`,children:[(0,X.jsx)(Vr,{className:`h-4 w-4 text-(--grass-10) mr-2`}),(0,X.jsx)(`span`,{children:`Installed`})]}):(0,X.jsxs)(`div`,{className:`flex items-center`,children:[(0,X.jsx)(ee,{className:`h-4 w-4 text-(--red-10) mr-2`}),(0,X.jsx)(Hu,{packageSpecs:[...e.packagesRequired,...e.additionalPackageInstalls],packageManager:n,onSuccess:c})]})})]},e.id)}),e[12]=d,e[13]=n,e[14]=c,e[15]=h):h=e[15];let g;e[16]===h?g=e[17]:(g=(0,X.jsxs)(kr,{children:[m,(0,X.jsx)(Er,{children:h})]}),e[16]=h,e[17]=g);let _;e[18]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,X.jsx)(`p`,{className:`text-muted-foreground mt-2`,children:`*Requires server restart`}),e[18]=_):_=e[18];let v;return e[19]===g?v=e[20]:(v=(0,X.jsxs)(`div`,{className:`flex-1 flex flex-col overflow-hidden gap-2`,children:[f,p,g,_]}),e[19]=g,e[20]=v),v},Hu=({packageSpecs:e,packageManager:t,onSuccess:n})=>{let[r,i]=J.useState(!1),{addPackage:a}=Lt();return(0,X.jsxs)(pt,{size:`xs`,variant:`outline`,className:Fe(`text-xs`,r&&`opacity-50 cursor-not-allowed`),onClick:async()=>{try{i(!0);let t=e.map(e=>e.minVersion?`${e.name}>=${e.minVersion}`:e.name).join(` `),r=await a({package:t,group:`dev`});r.success?(n(),Zn({title:`Package installed`,description:(0,X.jsxs)(`span`,{children:[`The packages`,` `,(0,X.jsx)(vr,{className:`inline`,children:e.map(e=>e.name).join(`, `)}),` `,`have been added to your environment.`]})})):Zn({title:`Failed to install package`,description:r.error,variant:`danger`})}finally{i(!1)}},disabled:r,children:[r?(0,X.jsx)(tn,{size:`small`,className:`mr-2 h-3 w-3`}):(0,X.jsx)(re,{className:`mr-2 h-3 w-3`}),`Install with `,t]})};function Uu(e){return e.name}var Wu=[{id:`editor`,label:`Editor`,Icon:E,className:`bg-(--blue-4)`},{id:`display`,label:`Display`,Icon:Gr,className:`bg-(--grass-4)`},{id:`packageManagementAndData`,label:`Packages & Data`,Icon:D,className:`bg-(--red-4)`},{id:`runtime`,label:`Runtime`,Icon:Hr,className:`bg-(--amber-4)`},{id:`ai`,label:`AI`,Icon:Br,className:`bg-[linear-gradient(45deg,var(--purple-5),var(--cyan-5))]`},{id:`optionalDeps`,label:`Optional Dependencies`,Icon:Wr,className:`bg-(--orange-4)`},{id:`labs`,label:`Labs`,Icon:Ur,className:`bg-(--slate-4)`}],Gu=r(Wu[0].id),Ku=100,qu=`__system__`,Ju=()=>{let e=(0,Y.c)(62),[t,r]=ue(),[a,o]=n(zs),c=(0,J.useRef)(null),l=s(Dc),[u,d]=n(Gu),f=i(v);i(Oe).mode===`home`&&(f={terminal:!0,pylsp:!0,ty:!0,basedpyright:!0,pyrefly:!0});let p=i(Me),{locale:m}=fr(),{saveUserConfig:h}=Lt(),g;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(g=b(de),e[0]=g):g=e[0];let _;e[1]===t?_=e[2]:(_={resolver:g,defaultValues:t},e[1]=t,e[2]=_);let x=w(_),S;e[3]===x?S=e[4]:(S=(e,t)=>{let{chatModel:n,editModel:r}=gc(e);return(n||r)&&(t={...t,models:{...t?.models,...n&&{chat_model:n},...r&&{edit_model:r}}},n&&x.setValue(`ai.models.chat_model`,n),r&&x.setValue(`ai.models.edit_model`,r)),t},e[3]=x,e[4]=S);let C=S,T;e[5]!==x.formState.dirtyFields||e[6]!==x.formState.touchedFields||e[7]!==h||e[8]!==C||e[9]!==r?(T=async e=>{let t=Au(e,x.formState.dirtyFields);Pu({values:e,dirtyValues:t,touchedFields:x.formState.touchedFields}),Object.keys(t).length!==0&&(t.ai&&=C(e.ai,t.ai),await h({config:t}),r(e=>pe(e,t)))},e[5]=x.formState.dirtyFields,e[6]=x.formState.touchedFields,e[7]=h,e[8]=C,e[9]=r,e[10]=T):T=e[10];let E=mr(T,Ku),D;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(D=ke(),e[11]=D):D=e[11];let O=D,k=Al(),j=(0,J.useId)(),M=(0,J.useId)(),P;e[12]!==a||e[13]!==u||e[14]!==f||e[15]!==t||e[16]!==x||e[17]!==k||e[18]!==j||e[19]!==M||e[20]!==E||e[21]!==o||e[22]!==d||e[23]!==l?(P=()=>{switch(u){case`editor`:return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(Tl,{title:`Autosave`,children:[(0,X.jsx)(Q,{control:x.control,name:`save.autosave`,render:Yu}),(0,X.jsx)(Q,{control:x.control,name:`save.autosave_delay`,render:e=>{let{field:t,override:n}=e,r=k(`save.autosave`,x.getValues(`save.autosave`));return(0,X.jsxs)(U,{className:Z,children:[(0,X.jsx)(G,{children:`Autosave delay (seconds)`}),(0,X.jsx)(B,{children:(0,X.jsx)(Vn,{"aria-label":`Autosave delay`,"data-testid":`autosave-delay-input`,className:`m-0 w-24`,isDisabled:r.value!==`after_delay`||n.isOverridden,...t,value:n.value/1e3,minValue:1,onChange:e=>{t.onChange(e*1e3),Number.isNaN(e)||E(x.getValues())}})}),(0,X.jsx)(N,{}),(0,X.jsx)($,{override:n})]})}}),(0,X.jsx)(Q,{control:x.control,name:`runtime.default_auto_download`,render:e=>{let{field:t,override:n}=e;return(0,X.jsxs)(`div`,{className:`flex flex-col gap-y-1`,children:[(0,X.jsxs)(U,{className:Z,children:[(0,X.jsx)(G,{children:`Save cell outputs as`}),(0,X.jsx)(B,{children:(0,X.jsxs)(`div`,{className:`flex gap-4`,children:[(0,X.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,X.jsx)(y,{id:j,checked:Array.isArray(n.value)&&n.value.includes(`html`),disabled:n.isOverridden,onCheckedChange:()=>{let e=Array.isArray(t.value)?t.value:[];t.onChange(Mt(e,`html`))}}),(0,X.jsx)(G,{htmlFor:j,children:`HTML`})]}),(0,X.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,X.jsx)(y,{id:M,checked:Array.isArray(n.value)&&n.value.includes(`ipynb`),disabled:n.isOverridden,onCheckedChange:()=>{let e=Array.isArray(t.value)?t.value:[];t.onChange(Mt(e,`ipynb`))}}),(0,X.jsx)(G,{htmlFor:M,children:`IPYNB`})]})]})}),(0,X.jsx)(N,{}),(0,X.jsx)($,{override:n})]}),(0,X.jsxs)(W,{children:[`When enabled, marimo will periodically save notebooks in your selected formats (HTML, IPYNB) to a folder named`,` `,(0,X.jsx)(vr,{className:`inline`,children:`__marimo__`}),` next to your notebook file.`]})]})}})]}),(0,X.jsxs)(Tl,{title:`Formatting`,children:[(0,X.jsx)(Q,{control:x.control,name:`save.format_on_save`,render:Xu}),(0,X.jsx)(Q,{control:x.control,name:`formatting.line_length`,render:e=>{let{field:t,override:n}=e;return(0,X.jsxs)(`div`,{className:`flex flex-col space-y-1`,children:[(0,X.jsxs)(U,{className:Z,children:[(0,X.jsx)(G,{children:`Line length`}),(0,X.jsx)(B,{children:(0,X.jsx)(Vn,{"aria-label":`Line length`,"data-testid":`line-length-input`,className:`m-0 w-24`,...t,value:n.value,isDisabled:n.isOverridden,minValue:1,maxValue:1e3,onChange:e=>{t.onChange(e),Number.isNaN(e)||E(x.getValues())}})}),(0,X.jsx)(N,{}),(0,X.jsx)($,{override:n})]}),(0,X.jsx)(W,{children:`Maximum line length when formatting code.`})]})}})]}),(0,X.jsxs)(Tl,{title:`Autocomplete`,children:[(0,X.jsx)(Q,{control:x.control,name:`completion.activate_on_typing`,render:e=>{let{field:t,override:n}=e;return(0,X.jsxs)(`div`,{className:`flex flex-col space-y-1`,children:[(0,X.jsxs)(U,{className:Z,children:[(0,X.jsx)(G,{className:`font-normal`,children:`Autocomplete`}),(0,X.jsx)(B,{children:(0,X.jsx)(y,{"data-testid":`autocomplete-checkbox`,checked:n.value,disabled:t.disabled||n.isOverridden,onCheckedChange:e=>{t.onChange(!!e)}})}),(0,X.jsx)(N,{}),(0,X.jsx)($,{override:n})]}),(0,X.jsx)(W,{children:`When unchecked, code completion is still available through a hotkey.`}),(0,X.jsx)(`div`,{children:(0,X.jsx)(pt,{variant:`link`,className:`mb-0 px-0`,type:`button`,onClick:e=>{e.preventDefault(),e.stopPropagation(),d(`ai`)},children:`Edit AI autocomplete`})})]})}}),(0,X.jsxs)(`div`,{className:`flex flex-col space-y-1`,children:[(0,X.jsxs)(U,{className:Z,children:[(0,X.jsx)(G,{className:`font-normal`,children:`Accept suggestion on Enter`}),(0,X.jsx)(B,{children:(0,X.jsx)(y,{"data-testid":`accept-completion-on-enter-checkbox`,checked:a,onCheckedChange:e=>o(!!e)})})]}),(0,X.jsx)(W,{children:`When unchecked, pressing Enter inserts a new line instead of accepting an autocomplete suggestion. Use Tab to accept suggestions.`})]}),(0,X.jsx)(Q,{control:x.control,name:`completion.signature_hint_on_typing`,render:Zu}),(0,X.jsx)(Q,{control:x.control,name:`completion.auto_close_pairs`,render:Qu})]}),(0,X.jsxs)(Tl,{title:`Language Servers`,children:[(0,X.jsxs)(W,{children:[`See the`,` `,(0,X.jsx)(Qt,{href:`https://docs.marimo.io/guides/editor_features/language_server/`,children:`docs`}),` `,`for more information about language server support.`]}),(0,X.jsxs)(W,{children:[(0,X.jsx)(`strong`,{children:`Note:`}),` When using multiple language servers, different features may conflict.`]}),(0,X.jsx)(Q,{control:x.control,name:`language_servers.pylsp.enabled`,render:e=>{let{field:t,override:n}=e;return(0,X.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,X.jsxs)(U,{className:Z,children:[(0,X.jsxs)(G,{children:[(0,X.jsx)(Xn,{variant:`defaultOutline`,className:`mr-2`,children:`Beta`}),`Python Language Server (`,(0,X.jsx)(Qt,{href:`https://github.com/python-lsp/python-lsp-server`,children:`docs`}),`)`]}),(0,X.jsx)(B,{children:(0,X.jsx)(y,{"data-testid":`pylsp-checkbox`,checked:n.value,disabled:t.disabled||n.isOverridden,onCheckedChange:e=>{t.onChange(!!e)}})}),(0,X.jsx)(N,{}),(0,X.jsx)($,{override:n})]}),n.value&&!f.pylsp&&(0,X.jsxs)(Cr,{kind:`danger`,children:[`The Python Language Server is not available in your current environment. Please install`,` `,(0,X.jsx)(vr,{className:`inline`,children:`python-lsp-server`}),` in your environment.`]})]})}}),(0,X.jsx)(Q,{control:x.control,name:`language_servers.basedpyright.enabled`,render:e=>{let{field:t,override:n}=e;return(0,X.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,X.jsxs)(U,{className:Z,children:[(0,X.jsxs)(G,{children:[(0,X.jsx)(Xn,{variant:`defaultOutline`,className:`mr-2`,children:`Beta`}),`basedpyright (`,(0,X.jsx)(Qt,{href:`https://github.com/DetachHead/basedpyright`,children:`docs`}),`)`]}),(0,X.jsx)(B,{children:(0,X.jsx)(y,{"data-testid":`basedpyright-checkbox`,checked:n.value,disabled:t.disabled||n.isOverridden,onCheckedChange:e=>{t.onChange(!!e)}})}),(0,X.jsx)(N,{}),(0,X.jsx)($,{override:n})]}),n.value&&!f.basedpyright&&(0,X.jsxs)(Cr,{kind:`danger`,children:[`basedpyright is not available in your current environment. Please install`,` `,(0,X.jsx)(vr,{className:`inline`,children:`basedpyright`}),` in your environment.`]})]})}}),(0,X.jsx)(Q,{control:x.control,name:`language_servers.pyrefly.enabled`,render:e=>{let{field:t,override:n}=e;return(0,X.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,X.jsxs)(U,{className:Z,children:[(0,X.jsxs)(G,{children:[(0,X.jsx)(Xn,{variant:`defaultOutline`,className:`mr-2`,children:`Beta`}),`Pyrefly (`,(0,X.jsx)(Qt,{href:`https://github.com/facebook/pyrefly`,children:`docs`}),`)`]}),(0,X.jsx)(B,{children:(0,X.jsx)(y,{"data-testid":`pyrefly-checkbox`,checked:n.value,disabled:t.disabled||n.isOverridden,onCheckedChange:e=>{t.onChange(!!e)}})}),(0,X.jsx)(N,{}),(0,X.jsx)($,{override:n})]}),n.value&&!f.pyrefly&&(0,X.jsxs)(Cr,{kind:`danger`,children:[`Pyrefly is not available in your current environment. Please install `,(0,X.jsx)(vr,{className:`inline`,children:`pyrefly`}),` in your environment.`]})]})}}),(0,X.jsx)(Q,{control:x.control,name:`language_servers.ty.enabled`,render:e=>{let{field:t,override:n}=e;return(0,X.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,X.jsxs)(U,{className:Z,children:[(0,X.jsxs)(G,{children:[(0,X.jsx)(Xn,{variant:`defaultOutline`,className:`mr-2`,children:`Beta`}),`ty (`,(0,X.jsx)(Qt,{href:`https://github.com/astral-sh/ty`,children:`docs`}),`)`]}),(0,X.jsx)(B,{children:(0,X.jsx)(y,{"data-testid":`ty-checkbox`,checked:n.value,disabled:t.disabled||n.isOverridden,onCheckedChange:e=>{t.onChange(!!e)}})}),(0,X.jsx)(N,{}),(0,X.jsx)($,{override:n})]}),n.value&&!f.ty&&(0,X.jsxs)(Cr,{kind:`danger`,children:[`ty is not available in your current environment. Please install `,(0,X.jsx)(vr,{className:`inline`,children:`ty`}),` in your environment.`]})]})}}),(0,X.jsx)(Q,{control:x.control,name:`diagnostics.enabled`,render:$u})]}),(0,X.jsxs)(Tl,{title:`Keymap`,children:[(0,X.jsx)(Q,{control:x.control,name:`keymap.preset`,render:td}),(0,X.jsx)(Q,{control:x.control,name:`keymap.destructive_delete`,render:e=>{let{field:t,override:n}=e;return(0,X.jsxs)(`div`,{className:`flex flex-col space-y-1`,children:[(0,X.jsxs)(U,{className:Z,children:[(0,X.jsx)(G,{className:`font-normal`,children:`Destructive delete`}),(0,X.jsx)(B,{children:(0,X.jsx)(y,{"data-testid":`destructive-delete-checkbox`,checked:n.value,disabled:t.disabled||n.isOverridden,onCheckedChange:e=>{t.onChange(!!e)}})}),(0,X.jsx)(N,{}),(0,X.jsx)($,{override:n})]}),(0,X.jsxs)(W,{className:`flex items-center gap-1`,children:[`Allow deleting non-empty cells`,(0,X.jsx)(ut,{content:(0,X.jsxs)(`div`,{className:`max-w-xs`,children:[(0,X.jsx)(`strong`,{children:`Use with caution:`}),` Deleting cells with code can lose work and computed results since variables are removed from memory.`]}),children:(0,X.jsx)(Yn,{className:`w-3 h-3 text-(--amber-11)`})})]}),(0,X.jsx)(`div`,{children:(0,X.jsx)(pt,{variant:`link`,className:`mb-0 px-0`,type:`button`,onClick:e=>{e.preventDefault(),e.stopPropagation(),l(!0)},children:`Edit Keyboard Shortcuts`})})]})}})]})]});case`display`:return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(Tl,{title:`Display`,children:[(0,X.jsx)(Q,{control:x.control,name:`display.default_width`,render:rd}),(0,X.jsx)(Q,{control:x.control,name:`display.theme`,render:ad}),(0,X.jsx)(Q,{control:x.control,name:`display.code_editor_font_size`,render:e=>{let{field:t,override:n}=e;return(0,X.jsxs)(U,{className:Z,children:[(0,X.jsx)(G,{children:`Code editor font size (px)`}),(0,X.jsx)(B,{children:(0,X.jsx)(`span`,{className:`inline-flex mr-2`,children:(0,X.jsx)(Vn,{"aria-label":`Code editor font size`,"data-testid":`code-editor-font-size-input`,className:`m-0 w-24`,...t,value:n.value,isDisabled:n.isOverridden,minValue:8,maxValue:32,onChange:e=>{t.onChange(e),E(x.getValues())}})})}),(0,X.jsx)(N,{}),(0,X.jsx)($,{override:n})]})}}),(0,X.jsx)(Q,{control:x.control,name:`display.locale`,render:sd}),(0,X.jsx)(Q,{control:x.control,name:`display.reference_highlighting`,render:cd}),(0,X.jsx)(Q,{control:x.control,name:`display.code_lens`,render:ld})]}),(0,X.jsx)(Tl,{title:`Outputs`,children:(0,X.jsx)(Q,{control:x.control,name:`display.cell_output`,render:dd})})]});case`packageManagementAndData`:return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Tl,{title:`Package Management`,children:(0,X.jsx)(Q,{control:x.control,disabled:O,name:`package_management.manager`,render:pd})}),(0,X.jsx)(Tl,{title:`Data`,children:(0,X.jsx)(Cu,{form:x,onSubmit:E})})]});case`runtime`:return(0,X.jsxs)(Tl,{title:`Runtime configuration`,children:[(0,X.jsx)(Q,{control:x.control,name:`runtime.auto_instantiate`,render:md}),(0,X.jsx)(Q,{control:x.control,name:`runtime.on_cell_change`,render:gd}),(0,X.jsx)(Q,{control:x.control,name:`runtime.auto_reload`,render:e=>{let{field:t,override:n}=e;return(0,X.jsxs)(`div`,{className:`flex flex-col gap-y-1`,children:[(0,X.jsxs)(U,{className:Z,children:[(0,X.jsx)(G,{className:`font-normal`,children:`On module change`}),(0,X.jsx)(B,{children:(0,X.jsx)(Xe,{"data-testid":`auto-reload-select`,onChange:e=>t.onChange(e.target.value),value:n.value,disabled:O||n.isOverridden,className:`inline-flex mr-2`,children:[`off`,`lazy`,`autorun`].map(_d)})}),(0,X.jsx)(N,{}),(0,X.jsx)($,{override:n})]}),(0,X.jsx)(W,{children:`Whether marimo should automatically reload modules before executing cells. If "lazy", marimo will mark cells affected by module modifications as stale; if "autorun", affected cells will be automatically re-run.`})]})}}),(0,X.jsx)(Q,{control:x.control,name:`runtime.reactive_tests`,render:vd}),(0,X.jsxs)(W,{children:[`Learn more in the`,` `,(0,X.jsx)(Qt,{href:`https://docs.marimo.io/guides/reactivity/#configuring-how-marimo-runs-cells`,children:`docs`}),`.`]})]});case`ai`:return(0,X.jsx)(du,{form:x,config:t,onSubmit:E});case`optionalDeps`:return(0,X.jsx)(Vu,{});case`labs`:return(0,X.jsxs)(Tl,{title:`Experimental Features`,children:[(0,X.jsx)(`p`,{className:`text-sm text-muted-secondary mb-4`,children:`⚠️ These features are experimental and may require restarting your notebook to take effect.`}),(0,X.jsx)(A,{control:x.control,name:`experimental.rtc_v2`,render:yd}),(0,X.jsx)(Q,{control:x.control,name:`experimental.external_agents`,render:bd}),(0,X.jsx)(Q,{control:x.control,name:`experimental.debugger`,render:xd}),(0,X.jsx)(Q,{control:x.control,name:`experimental.line_timing`,render:Sd})]})}},e[12]=a,e[13]=u,e[14]=f,e[15]=t,e[16]=x,e[17]=k,e[18]=j,e[19]=M,e[20]=E,e[21]=o,e[22]=d,e[23]=l,e[24]=P):P=e[24];let F=P,I,L;e[25]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,X.jsx)(vr,{className:`inline`,children:`marimo.toml`}),L=(0,X.jsx)(`br`,{}),e[25]=I,e[26]=L):(I=e[25],L=e[26]);let R;e[27]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,X.jsxs)(`p`,{className:`text-muted-secondary`,children:[`User configuration is stored in `,I,L,`Run `,(0,X.jsx)(vr,{className:`inline`,children:`marimo config show`}),` in your terminal to show your current configuration and file location.`]}),e[27]=R):R=e[27];let z=R,V;if(e[28]!==x||e[29]!==E){let t;e[31]===E?t=e[32]:(t=e=>E(e),e[31]=E,e[32]=t),V=x.handleSubmit(t),e[28]=x,e[29]=E,e[30]=V}else V=e[30];let H;e[33]===d?H=e[34]:(H=e=>d(e),e[33]=d,e[34]=H);let ee;e[35]===Symbol.for(`react.memo_cache_sentinel`)?(ee=Wu.map(Cd),e[35]=ee):ee=e[35];let te;e[36]===p?te=e[37]:(te=(0,X.jsxs)(`span`,{children:[`Version: `,p]}),e[36]=p,e[37]=te);let ne;e[38]===m?ne=e[39]:(ne=(0,X.jsxs)(`span`,{children:[`Locale: `,m]}),e[38]=m,e[39]=ne);let re;e[40]!==te||e[41]!==ne?(re=(0,X.jsxs)(`div`,{className:`p-2 text-xs text-muted-foreground self-start flex flex-col gap-1`,children:[te,ne]}),e[40]=te,e[41]=ne,e[42]=re):re=e[42];let K,ae;e[43]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,X.jsx)(`div`,{className:`flex-1`}),ae=!ke()&&z,e[43]=K,e[44]=ae):(K=e[43],ae=e[44]);let oe;e[45]===re?oe=e[46]:(oe=(0,X.jsxs)(Ke,{className:`self-start max-h-none flex flex-col gap-2 shrink-0 bg-background flex-1 min-h-full`,children:[ee,re,K,ae]}),e[45]=re,e[46]=oe);let se;e[47]!==u||e[48]!==H||e[49]!==oe?(se=(0,X.jsx)(qe,{value:u,onValueChange:H,orientation:`vertical`,className:`w-1/3 border-r h-full overflow-auto p-3`,children:oe}),e[47]=u,e[48]=H,e[49]=oe,e[50]=se):se=e[50];let ce;e[51]===F?ce=e[52]:(ce=F(),e[51]=F,e[52]=ce);let le;e[53]===ce?le=e[54]:(le=(0,X.jsx)(`div`,{className:`w-2/3 pl-6 gap-2 flex flex-col overflow-auto p-6`,children:ce}),e[53]=ce,e[54]=le);let fe;e[55]!==se||e[56]!==le||e[57]!==V?(fe=(0,X.jsxs)(`form`,{ref:c,onChange:V,className:`flex text-pretty overflow-hidden`,children:[se,le]}),e[55]=se,e[56]=le,e[57]=V,e[58]=fe):fe=e[58];let me;return e[59]!==x||e[60]!==fe?(me=(0,X.jsx)(ie,{...x,children:fe}),e[59]=x,e[60]=fe,e[61]=me):me=e[61],me};function Yu(e){let{field:t,override:n}=e;return(0,X.jsxs)(U,{className:Z,children:[(0,X.jsx)(G,{className:`font-normal`,children:`Autosave enabled`}),(0,X.jsx)(B,{children:(0,X.jsx)(y,{"data-testid":`autosave-checkbox`,checked:n.value===`after_delay`,disabled:t.disabled||n.isOverridden,onCheckedChange:e=>{t.onChange(e?`after_delay`:`off`)}})}),(0,X.jsx)(N,{}),(0,X.jsx)($,{override:n})]})}function Xu(e){let{field:t,override:n}=e;return(0,X.jsxs)(U,{className:Z,children:[(0,X.jsx)(G,{className:`font-normal`,children:`Format on save`}),(0,X.jsx)(B,{children:(0,X.jsx)(y,{"data-testid":`format-on-save-checkbox`,checked:n.value,disabled:t.disabled||n.isOverridden,onCheckedChange:e=>{t.onChange(e)}})}),(0,X.jsx)(N,{}),(0,X.jsx)($,{override:n})]})}function Zu(e){let{field:t,override:n}=e;return(0,X.jsxs)(`div`,{className:`flex flex-col space-y-1`,children:[(0,X.jsxs)(U,{className:Z,children:[(0,X.jsx)(G,{className:`font-normal`,children:`Signature hints`}),(0,X.jsx)(B,{children:(0,X.jsx)(y,{"data-testid":`signature-hint-on-type-checkbox`,checked:n.value??!1,disabled:t.disabled||n.isOverridden,onCheckedChange:e=>{t.onChange(!!e)}})}),(0,X.jsx)(N,{}),(0,X.jsx)($,{override:n})]}),(0,X.jsx)(W,{children:`Display signature hints while typing within function calls.`})]})}function Qu(e){let{field:t,override:n}=e;return(0,X.jsxs)(`div`,{className:`flex flex-col space-y-1`,children:[(0,X.jsxs)(U,{className:Z,children:[(0,X.jsx)(G,{className:`font-normal`,children:`Auto-close pairs`}),(0,X.jsx)(B,{children:(0,X.jsx)(y,{"data-testid":`auto-close-pairs-checkbox`,checked:n.value??!0,disabled:t.disabled||n.isOverridden,onCheckedChange:e=>{t.onChange(!!e)}})}),(0,X.jsx)(N,{}),(0,X.jsx)($,{override:n})]}),(0,X.jsxs)(W,{children:[`Automatically insert closing brackets`,` `,(0,X.jsx)(`code`,{className:`text-xs`,children:`()`}),`,`,` `,(0,X.jsx)(`code`,{className:`text-xs`,children:`[]`}),`,`,` `,(0,X.jsx)(`code`,{className:`text-xs`,children:`{}`}),`, and quotes`,` `,(0,X.jsx)(`code`,{className:`text-xs`,children:`""`}),`,`,` `,(0,X.jsx)(`code`,{className:`text-xs`,children:`''`}),` when opening one.`]})]})}function $u(e){let{field:t,override:n}=e;return(0,X.jsxs)(U,{className:Z,children:[(0,X.jsxs)(G,{children:[(0,X.jsx)(Xn,{variant:`defaultOutline`,className:`mr-2`,children:`Beta`}),`Diagnostics`]}),(0,X.jsx)(B,{children:(0,X.jsx)(y,{"data-testid":`diagnostics-checkbox`,checked:n.value,disabled:t.disabled||n.isOverridden,onCheckedChange:e=>{t.onChange(!!e)}})}),(0,X.jsx)(N,{}),(0,X.jsx)($,{override:n})]})}function ed(e){return(0,X.jsx)(`option`,{value:e,children:e},e)}function td(e){let{field:t,override:n}=e;return(0,X.jsx)(`div`,{className:`flex flex-col space-y-1`,children:(0,X.jsxs)(U,{className:Z,children:[(0,X.jsx)(G,{children:`Keymap`}),(0,X.jsx)(B,{children:(0,X.jsx)(Xe,{"data-testid":`keymap-select`,onChange:e=>t.onChange(e.target.value),value:n.value,disabled:t.disabled||n.isOverridden,className:`inline-flex mr-2`,children:tc.map(ed)})}),(0,X.jsx)(N,{}),(0,X.jsx)($,{override:n})]})})}function nd(e){return(0,X.jsx)(`option`,{value:e,children:e},e)}function rd(e){let{field:t,override:n}=e;return(0,X.jsxs)(`div`,{className:`flex flex-col space-y-1`,children:[(0,X.jsxs)(U,{className:Z,children:[(0,X.jsx)(G,{children:`Default width`}),(0,X.jsx)(B,{children:(0,X.jsx)(Xe,{"data-testid":`user-config-width-select`,onChange:e=>t.onChange(e.target.value),value:n.value,disabled:t.disabled||n.isOverridden,className:`inline-flex mr-2`,children:uc().map(nd)})}),(0,X.jsx)(N,{}),(0,X.jsx)($,{override:n})]}),(0,X.jsx)(W,{children:`The default app width for new notebooks; overridden by "width" in the application config.`})]})}function id(e){return(0,X.jsx)(`option`,{value:e,children:e},e)}function ad(e){let{field:t,override:n}=e;return(0,X.jsxs)(`div`,{className:`flex flex-col space-y-1`,children:[(0,X.jsxs)(U,{className:Z,children:[(0,X.jsx)(G,{children:`Theme`}),(0,X.jsx)(B,{children:(0,X.jsx)(Xe,{"data-testid":`theme-select`,onChange:e=>t.onChange(e.target.value),value:n.value,disabled:t.disabled||n.isOverridden,className:`inline-flex mr-2`,children:Qn.map(id)})}),(0,X.jsx)(N,{}),(0,X.jsx)($,{override:n})]}),(0,X.jsx)(W,{children:`This theme will be applied to the user's configuration; it does not affect theme when sharing the notebook.`})]})}function od(e){return(0,X.jsx)(`option`,{value:e,children:e},e)}function sd(e){let{field:t,override:n}=e;return(0,X.jsxs)(`div`,{className:`flex flex-col space-y-1`,children:[(0,X.jsxs)(U,{className:Z,children:[(0,X.jsx)(G,{children:`Locale`}),(0,X.jsx)(B,{children:(0,X.jsxs)(Xe,{"data-testid":`locale-select`,onChange:e=>{e.target.value===qu?t.onChange(void 0):t.onChange(e.target.value)},value:n.value||qu,disabled:t.disabled||n.isOverridden,className:`inline-flex mr-2`,children:[(0,X.jsx)(`option`,{value:qu,children:`System`}),navigator.languages.map(od)]})}),(0,X.jsx)(N,{}),(0,X.jsx)($,{override:n})]}),(0,X.jsxs)(W,{children:[`The locale to use for the notebook. If your desired locale is not listed, you can change it manually via`,` `,(0,X.jsx)(vr,{className:`inline`,children:`marimo config show`}),`.`]})]})}function cd(e){let{field:t,override:n}=e;return(0,X.jsxs)(`div`,{className:`flex flex-col space-y-1`,children:[(0,X.jsxs)(U,{className:Z,children:[(0,X.jsx)(G,{children:`Reference highlighting`}),(0,X.jsx)(B,{children:(0,X.jsx)(y,{"data-testid":`reference-highlighting-checkbox`,checked:n.value,disabled:n.isOverridden,onCheckedChange:t.onChange})}),(0,X.jsx)(N,{}),(0,X.jsx)($,{override:n})]}),(0,X.jsx)(W,{children:`Visually emphasizes variables in a cell that are defined elsewhere in the notebook.`})]})}function ld(e){let{field:t,override:n}=e;return(0,X.jsxs)(`div`,{className:`flex flex-col space-y-1`,children:[(0,X.jsxs)(U,{className:Z,children:[(0,X.jsx)(G,{children:`Code lens`}),(0,X.jsx)(B,{children:(0,X.jsx)(y,{"data-testid":`code-lens-checkbox`,checked:n.value,disabled:n.isOverridden,onCheckedChange:t.onChange})}),(0,X.jsx)(N,{}),(0,X.jsx)($,{override:n})]}),(0,X.jsx)(W,{children:`Shows inline icons in cell editors for datasources and storage buckets.`})]})}function ud(e){return(0,X.jsx)(`option`,{value:e,children:e},e)}function dd(e){let{field:t,override:n}=e;return(0,X.jsxs)(`div`,{className:`flex flex-col space-y-1`,children:[(0,X.jsxs)(U,{className:Z,children:[(0,X.jsx)(G,{children:`Cell output area`}),(0,X.jsx)(B,{children:(0,X.jsx)(Xe,{"data-testid":`cell-output-select`,onChange:e=>t.onChange(e.target.value),value:n.value,disabled:t.disabled||n.isOverridden,className:`inline-flex mr-2`,children:[`above`,`below`].map(ud)})}),(0,X.jsx)(N,{}),(0,X.jsx)($,{override:n})]}),(0,X.jsx)(W,{children:`Where to display cell's output.`})]})}function fd(e){return(0,X.jsx)(`option`,{value:e,children:e},e)}function pd(e){let{field:t,override:n}=e;return(0,X.jsxs)(`div`,{className:`flex flex-col space-y-1`,children:[(0,X.jsxs)(U,{className:Z,children:[(0,X.jsx)(G,{children:`Manager`}),(0,X.jsx)(B,{children:(0,X.jsx)(Xe,{"data-testid":`package-manager-select`,onChange:e=>t.onChange(e.target.value),value:n.value,disabled:t.disabled||n.isOverridden,className:`inline-flex mr-2`,children:_e.map(fd)})}),(0,X.jsx)(N,{}),(0,X.jsx)($,{override:n})]}),(0,X.jsxs)(W,{children:[`When marimo comes across a module that is not installed, you will be prompted to install it using your preferred package manager. Learn more in the`,` `,(0,X.jsx)(Qt,{href:`https://docs.marimo.io/guides/editor_features/package_management.html`,children:`docs`}),`.`,(0,X.jsx)(`br`,{}),(0,X.jsx)(`br`,{}),`Running marimo in a`,` `,(0,X.jsx)(Qt,{href:`https://docs.marimo.io/guides/package_management/inlining_dependencies.html`,children:`sandboxed environment`}),` `,`is only supported by `,(0,X.jsx)(vr,{className:`inline`,children:`uv`})]})]})}function md(e){let{field:t,override:n}=e;return(0,X.jsxs)(`div`,{className:`flex flex-col gap-y-1`,children:[(0,X.jsxs)(U,{className:Z,children:[(0,X.jsx)(G,{className:`font-normal`,children:`Autorun on startup`}),(0,X.jsx)(B,{children:(0,X.jsx)(y,{"data-testid":`auto-instantiate-checkbox`,disabled:t.disabled||n.isOverridden,checked:n.value,onCheckedChange:t.onChange})}),(0,X.jsx)(N,{}),(0,X.jsx)($,{override:n})]}),(0,X.jsx)(W,{children:`Whether to automatically run all cells on startup.`})]})}function hd(e){return(0,X.jsx)(`option`,{value:e,children:e},e)}function gd(e){let{field:t,override:n}=e;return(0,X.jsxs)(`div`,{className:`flex flex-col gap-y-1`,children:[(0,X.jsxs)(U,{className:Z,children:[(0,X.jsx)(G,{className:`font-normal`,children:`On cell change`}),(0,X.jsx)(B,{children:(0,X.jsx)(Xe,{"data-testid":`on-cell-change-select`,onChange:e=>t.onChange(e.target.value),value:n.value,disabled:n.isOverridden,className:`inline-flex mr-2`,children:[`lazy`,`autorun`].map(hd)})}),(0,X.jsx)(N,{}),(0,X.jsx)($,{override:n})]}),(0,X.jsx)(W,{children:`Whether marimo should automatically run cells or just mark them as stale. If "autorun", marimo will automatically run affected cells when a cell is run or a UI element is interacted with; if "lazy", marimo will mark affected cells as stale but won't re-run them.`})]})}function _d(e){return(0,X.jsx)(`option`,{value:e,children:e},e)}function vd(e){let{field:t,override:n}=e;return(0,X.jsxs)(`div`,{className:`flex flex-col gap-y-1`,children:[(0,X.jsxs)(U,{className:Z,children:[(0,X.jsx)(G,{className:`font-normal`,children:`Autorun Unit Tests`}),(0,X.jsx)(B,{children:(0,X.jsx)(y,{"data-testid":`reactive-test-checkbox`,checked:n.value,disabled:n.isOverridden,onCheckedChange:t.onChange})})]}),(0,X.jsx)($,{override:n}),(0,X.jsx)(N,{}),(0,X.jsx)(W,{children:`Enable reactive pytest tests in notebook. When a cell contains only test functions (test_*) and classes (Test_*), marimo will automatically run them with pytest (requires notebook restart).`}),` `]})}function yd(e){let{field:t}=e;return(0,X.jsxs)(`div`,{className:`flex flex-col gap-y-1`,children:[(0,X.jsxs)(U,{className:Z,children:[(0,X.jsx)(G,{className:`font-normal`,children:`Real-Time Collaboration`}),(0,X.jsx)(B,{children:(0,X.jsx)(y,{"data-testid":`rtc-checkbox`,checked:t.value===!0,onCheckedChange:t.onChange})})]}),(0,X.jsx)(W,{children:`Enable experimental real-time collaboration. This change requires a page refresh to take effect.`})]})}function bd(e){let{field:t,override:n}=e;return(0,X.jsxs)(`div`,{className:`flex flex-col gap-y-1`,children:[(0,X.jsxs)(U,{className:Z,children:[(0,X.jsx)(G,{className:`font-normal`,children:`External Agents`}),(0,X.jsx)(B,{children:(0,X.jsx)(y,{"data-testid":`external-agents-checkbox`,checked:n.value===!0,disabled:n.isOverridden,onCheckedChange:t.onChange})})]}),(0,X.jsx)($,{override:n}),(0,X.jsxs)(W,{children:[`Enable experimental external agents such as Claude Code and Codex. Learn more in the`,` `,(0,X.jsx)(Qt,{href:`https://docs.marimo.io/guides/editor_features/agents/`,children:`docs`}),`.`]})]})}function xd(e){let{field:t,override:n}=e;return(0,X.jsxs)(`div`,{className:`flex flex-col gap-y-1`,children:[(0,X.jsxs)(U,{className:Z,children:[(0,X.jsx)(G,{className:`font-normal`,children:`Debugger`}),(0,X.jsx)(B,{children:(0,X.jsx)(y,{"data-testid":`debugger-checkbox`,checked:n.value===!0,disabled:n.isOverridden,onCheckedChange:t.onChange})})]}),(0,X.jsx)($,{override:n}),(0,X.jsxs)(W,{children:[`Enable the live debugger: a clickable breakpoint gutter, current-line highlighting while a cell runs, and dropping into `,(0,X.jsx)(vr,{className:`inline`,children:`pdb`}),` at breakpoints. This change requires a page refresh to take effect.`]})]})}function Sd(e){let{field:t,override:n}=e;return(0,X.jsxs)(`div`,{className:`flex flex-col gap-y-1`,children:[(0,X.jsxs)(U,{className:Z,children:[(0,X.jsx)(G,{className:`font-normal`,children:`Line Timing`}),(0,X.jsx)(B,{children:(0,X.jsx)(y,{"data-testid":`line-timing-checkbox`,checked:n.value===!0,disabled:n.isOverridden,onCheckedChange:t.onChange})})]}),(0,X.jsx)($,{override:n}),(0,X.jsx)(W,{children:`Highlight the line a cell is currently executing in green, with an elapsed timer next to long-running lines. Adds tracing overhead to every run while enabled. This change requires a page refresh to take effect.`})]})}function Cd(e){return(0,X.jsx)(We,{value:e.id,className:`w-full text-left p-2 data-[state=active]:bg-primary data-[state=active]:text-primary-foreground justify-start`,children:(0,X.jsxs)(`div`,{className:`flex gap-4 items-center text-lg overflow-hidden`,children:[(0,X.jsx)(`span`,{className:Fe(e.className,`w-8 h-8 rounded flex items-center justify-center text-muted-foreground shrink-0`),children:(0,X.jsx)(e.Icon,{className:`w-4 h-4`})}),(0,X.jsx)(`span`,{className:`truncate`,children:e.label})]})},e.id)}var wd=r(`ai-features`),Td=r(!1);function Ed(){let e=(0,Y.c)(4),t=s(Gu),n=s(Td),r=s(wd),i;return e[0]!==t||e[1]!==r||e[2]!==n?(i={handleClick:(e,i)=>{t(e),e===`ai`&&r(i??`ai-features`),n(!0)}},e[0]=t,e[1]=r,e[2]=n,e[3]=i):i=e[3],i}var Dd=e=>{let t=(0,Y.c)(58),{value:n,placeholder:r,onSelect:a,triggerClassName:o,customDropdownContent:s,iconSize:c,showAddCustomModelDocs:l,forRole:u,displayIconOnly:d,disabled:f}=e,p=c===void 0?`medium`:c,m=l!==void 0&&l,h=d!==void 0&&d,g=f!==void 0&&f,[_,v]=J.useState(!1),y=i(ve),b=i(ye),{saveModelChange:x}=He(),{handleClick:S}=Ed(),C=b.copilot===`custom`?y?.models?.autocomplete_model:void 0,w,T,E,D,O,k,A,j,M;if(t[0]!==y||t[1]!==C||t[2]!==g||t[3]!==h||t[4]!==u||t[5]!==p||t[6]!==_||t[7]!==a||t[8]!==r||t[9]!==x||t[10]!==o||t[11]!==n){let e=Rs.create({customModels:[...y?.models?.custom_models??[],y?.models?.chat_model,C,y?.models?.edit_model].filter(Boolean),displayedModels:y?.models?.displayed_models}),i=mc(e.getListModelsByProvider(),y),s=u===`autocomplete`?y?.models?.autocomplete_model:u===`chat`?y?.models?.chat_model:u===`edit`?y?.models?.edit_model:void 0,c=n?ks.parse(n):s?ks.parse(s):void 0,l=p===`medium`?`h-4 w-4`:`h-3 w-3`,d=(t,n)=>{let r=e.getModel(t.id);return(0,X.jsxs)(`div`,{className:`flex items-center gap-2 w-full px-2 py-1`,children:[(0,X.jsx)(yl,{provider:t.providerId,className:l}),(0,X.jsxs)(`div`,{className:`flex flex-col`,children:[(0,X.jsx)(`span`,{children:r?.name||t.shortModelId}),(0,X.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:t.id})]}),(0,X.jsx)(`div`,{className:`ml-auto flex gap-1`,children:(0,X.jsx)(ut,{content:xl(n),children:(0,X.jsx)(`span`,{className:`text-xs px-1.5 py-0.5 rounded font-medium ${bl(n)}`,children:n},n)})})]})},f;t[21]!==g||t[22]!==u||t[23]!==a||t[24]!==x?(f=e=>{g||(a?a(e):x(e,u),v(!1))},t[21]=g,t[22]=u,t[23]=a,t[24]=x,t[25]=f):f=t[25];let m=f;T=ct,M=_,E=v;let b=`flex items-center justify-between px-2 py-0.5 border rounded-md
3
- hover:bg-accent hover:text-accent-foreground ${o}`,S=c?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(yl,{provider:c.providerId,className:l}),h?null:(0,X.jsx)(`span`,{className:`truncate`,children:js(c.providerId)?c.shortModelId:c.id})]}):(0,X.jsx)(`span`,{className:`text-muted-foreground truncate`,children:r}),N;t[26]===S?N=t[27]:(N=(0,X.jsx)(`div`,{className:`flex items-center gap-2 truncate`,children:S}),t[26]=S,t[27]=N);let P=`${l} ml-1`,F;t[28]===P?F=t[29]:(F=(0,X.jsx)(Vt,{className:P}),t[28]=P,t[29]=F),t[30]!==g||t[31]!==b||t[32]!==N||t[33]!==F?(D=(0,X.jsxs)(at,{disabled:g,className:b,children:[N,F]}),t[30]=g,t[31]=b,t[32]=N,t[33]=F,t[34]=D):D=t[34],w=ot,O=`w-[300px]`,k=s&&u&&d(ks.parse(s),u),t[35]!==s||t[36]!==u?(A=s&&u&&(0,X.jsx)(nt,{}),t[35]=s,t[36]=u,t[37]=A):A=t[37];let I;t[38]!==m||t[39]!==l?(I=e=>{let[t,n]=e;return(0,X.jsx)(Od,{provider:t,onSelect:m,models:n,iconSizeClass:l},t)},t[38]=m,t[39]=l,t[40]=I):I=t[40],j=i.map(I),t[0]=y,t[1]=C,t[2]=g,t[3]=h,t[4]=u,t[5]=p,t[6]=_,t[7]=a,t[8]=r,t[9]=x,t[10]=o,t[11]=n,t[12]=w,t[13]=T,t[14]=E,t[15]=D,t[16]=O,t[17]=k,t[18]=A,t[19]=j,t[20]=M}else w=t[12],T=t[13],E=t[14],D=t[15],O=t[16],k=t[17],A=t[18],j=t[19],M=t[20];let N;t[41]!==S||t[42]!==m?(N=m&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(nt,{}),(0,X.jsxs)(tt,{className:`h-7 flex items-center gap-2`,onClick:()=>S(`ai`,`ai-models`),children:[(0,X.jsx)(Wt,{className:`h-3 w-3`}),(0,X.jsx)(`span`,{className:`cursor-pointer text-link`,children:`Add custom model`})]})]}),t[41]=S,t[42]=m,t[43]=N):N=t[43];let P;t[44]!==w||t[45]!==s||t[46]!==N||t[47]!==O||t[48]!==k||t[49]!==A||t[50]!==j?(P=(0,X.jsxs)(w,{className:O,children:[k,A,j,s,N]}),t[44]=w,t[45]=s,t[46]=N,t[47]=O,t[48]=k,t[49]=A,t[50]=j,t[51]=P):P=t[51];let F;return t[52]!==T||t[53]!==E||t[54]!==D||t[55]!==P||t[56]!==M?(F=(0,X.jsxs)(T,{open:M,onOpenChange:E,children:[D,P]}),t[52]=T,t[53]=E,t[54]=D,t[55]=P,t[56]=M,t[57]=F):F=t[57],F},Od=e=>{let t=(0,Y.c)(26),{provider:n,onSelect:r,models:i,iconSizeClass:a}=e,o=js(n)?n:`openai-compatible`,s;t[0]===n?s=t[1]:(s=Rs.getProviderInfo(n),t[0]=n,t[1]=s);let c=s;if(i.length===0)return null;let l;t[2]!==o||t[3]!==a?(l=(0,X.jsx)(yl,{provider:o,className:a}),t[2]=o,t[3]=a,t[4]=l):l=t[4];let u;t[5]===n?u=t[6]:(u=jd(n),t[5]=n,t[6]=u);let d;t[7]!==l||t[8]!==u?(d=(0,X.jsx)(it,{children:(0,X.jsxs)(`p`,{className:`flex items-center gap-2`,children:[l,u]})}),t[7]=l,t[8]=u,t[9]=d):d=t[9];let f=c?-90:0,p;t[10]===c?p=t[11]:(p=c&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`p`,{className:`text-sm text-muted-foreground p-2 max-w-[300px]`,children:[c.description,(0,X.jsx)(`br`,{})]}),(0,X.jsxs)(`p`,{className:`text-sm text-muted-foreground p-2 pt-0`,children:[`For more information, see the`,` `,(0,X.jsx)(`a`,{href:c.url,target:`_blank`,className:`underline`,rel:`noreferrer`,"aria-label":`Provider details`,children:`provider details`}),`.`]}),(0,X.jsx)(nt,{})]}),t[10]=c,t[11]=p);let m;if(t[12]!==i||t[13]!==r||t[14]!==n){let e;t[16]!==r||t[17]!==n?(e=e=>{let t=`${n}/${e.model}`;return(0,X.jsxs)(lt,{children:[(0,X.jsx)(it,{showChevron:!1,className:`py-2`,children:(0,X.jsx)(`div`,{className:`flex items-center gap-2 w-full cursor-pointer`,onClick:()=>{r(t)},children:(0,X.jsx)(kd,{model:e,provider:n})})}),(0,X.jsx)(rt,{className:`p-4 w-80`,children:(0,X.jsx)(Ad,{model:e,provider:n})})]},t)},t[16]=r,t[17]=n,t[18]=e):e=t[18],m=i.map(e),t[12]=i,t[13]=r,t[14]=n,t[15]=m}else m=t[15];let h;t[19]!==f||t[20]!==p||t[21]!==m?(h=(0,X.jsx)(st,{children:(0,X.jsxs)(rt,{className:`max-h-[40vh] overflow-y-auto`,alignOffset:f,sideOffset:5,children:[p,m]})}),t[19]=f,t[20]=p,t[21]=m,t[22]=h):h=t[22];let g;return t[23]!==d||t[24]!==h?(g=(0,X.jsxs)(lt,{children:[d,h]}),t[23]=d,t[24]=h,t[25]=g):g=t[25],g},kd=e=>{let t=(0,Y.c)(17),{model:n,provider:r}=e,i=js(r)?r:`openai-compatible`,a;t[0]===i?a=t[1]:(a=(0,X.jsx)(yl,{provider:i,className:`h-4 w-4`}),t[0]=i,t[1]=a);let o;t[2]===n.name?o=t[3]:(o=(0,X.jsx)(`span`,{children:n.name}),t[2]=n.name,t[3]=o);let s;t[4]===n.capabilities?s=t[5]:(s=n.capabilities.includes(`thinking`)&&(0,X.jsx)(ut,{content:`Reasoning model`,children:(0,X.jsx)(Br,{className:`h-5 w-5 rounded-md p-1 ${bl(`thinking`)}`})}),t[4]=n.capabilities,t[5]=s);let c;t[6]===s?c=t[7]:(c=(0,X.jsx)(`div`,{className:`ml-auto`,children:s}),t[6]=s,t[7]=c);let l;t[8]!==o||t[9]!==c?(l=(0,X.jsxs)(`div`,{className:`flex flex-row w-full items-center`,children:[o,c]}),t[8]=o,t[9]=c,t[10]=l):l=t[10];let u;t[11]===n.custom?u=t[12]:(u=n.custom&&(0,X.jsx)(ut,{content:`Custom model`,children:(0,X.jsx)(M,{className:`h-5 w-5`})}),t[11]=n.custom,t[12]=u);let d;return t[13]!==a||t[14]!==l||t[15]!==u?(d=(0,X.jsxs)(X.Fragment,{children:[a,l,u]}),t[13]=a,t[14]=l,t[15]=u,t[16]=d):d=t[16],d},Ad=e=>{let t=(0,Y.c)(28),{model:n,provider:r}=e,i;t[0]===n.name?i=t[1]:(i=(0,X.jsx)(`h4`,{className:`font-semibold text-base text-foreground`,children:n.name}),t[0]=n.name,t[1]=i);let a;t[2]===n.model?a=t[3]:(a=(0,X.jsx)(`p`,{className:`text-xs text-muted-foreground font-mono`,children:n.model}),t[2]=n.model,t[3]=a);let o;t[4]!==i||t[5]!==a?(o=(0,X.jsxs)(`div`,{children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6];let s;t[7]===n.description?s=t[8]:(s=(0,X.jsx)(`p`,{className:`text-sm text-muted-foreground leading-relaxed`,children:n.description}),t[7]=n.description,t[8]=s);let c;t[9]===n.roles?c=t[10]:(c=n.roles.length>0&&(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`p`,{className:`text-xs font-medium text-muted-foreground mb-2`,children:`Capabilities:`}),(0,X.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:n.roles.map(Md)})]}),t[9]=n.roles,t[10]=c);let l;t[11]===n.capabilities?l=t[12]:(l=n.capabilities.includes(`thinking`)&&(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(`div`,{className:`w-2 h-2 bg-purple-500 rounded-full animate-pulse`}),(0,X.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Supports thinking mode`})]}),t[11]=n.capabilities,t[12]=l);let u;t[13]===r?u=t[14]:(u=(0,X.jsx)(yl,{provider:r,className:`h-4 w-4`}),t[13]=r,t[14]=u);let d;t[15]===r?d=t[16]:(d=jd(r),t[15]=r,t[16]=d);let f;t[17]===d?f=t[18]:(f=(0,X.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:d}),t[17]=d,t[18]=f);let p;t[19]!==u||t[20]!==f?(p=(0,X.jsxs)(`div`,{className:`flex items-center gap-2 pt-2 border-t border-border`,children:[u,f]}),t[19]=u,t[20]=f,t[21]=p):p=t[21];let m;return t[22]!==p||t[23]!==o||t[24]!==s||t[25]!==c||t[26]!==l?(m=(0,X.jsxs)(`div`,{className:`space-y-3`,children:[o,s,c,l,p]}),t[22]=p,t[23]=o,t[24]=s,t[25]=c,t[26]=l,t[27]=m):m=t[27],m};function jd(e){let t=Rs.getProviderInfo(e);return t?t.name:Ft(e)}function Md(e){return(0,X.jsx)(`span`,{className:`px-2 py-1 text-xs rounded-md font-medium ${bl(e)}`,title:xl(e),children:e},e)}export{Hr as $,cs as A,qi as B,Dc as C,nc as D,uc as E,Qo as F,Di as G,Fi as H,Xo as I,bi as J,Ei as K,da as L,ns as M,os as N,zs as O,rs as P,Kr as Q,sa as R,Oc as S,xc as T,Mi as U,aa as V,Ii as W,Xr as X,gi as Y,Yr as Z,Mc as _,Lu as a,Rc as b,Il as c,wl as d,Vr as et,Sl as f,$c as g,el as h,Ju as i,as as j,ks as k,Ml as l,Yc as m,Td as n,Iu as o,yl as p,xi as q,Ed as r,Au as s,Dd as t,El as u,Pc as v,Cc as w,jc as x,Nc as y,ta as z};