@marimo-team/frontend 0.23.16-dev51 → 0.23.16-dev52

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 (99) hide show
  1. package/dist/assets/{CellStatus-DciB5rbr.js → CellStatus-BT88_2jw.js} +1 -1
  2. package/dist/assets/{JsonOutput-BM3vve9F.js → JsonOutput-0XYUxjxO.js} +12 -12
  3. package/dist/assets/{MarimoErrorOutput-Bh0y53Du.js → MarimoErrorOutput-DuwnzR5D.js} +4 -4
  4. package/dist/assets/{RenderHTML-B9jx7Dsm.js → RenderHTML-BPdXbewN.js} +1 -1
  5. package/dist/assets/{RunButton-DMtHbFuA.js → RunButton-DJyvIhMO.js} +1 -1
  6. package/dist/assets/{add-cell-with-ai-BcRYriMM.js → add-cell-with-ai-Dspw1-mO.js} +12 -12
  7. package/dist/assets/add-connection-dialog-B1fFBVqJ.js +178 -0
  8. package/dist/assets/{agent-panel-B31W_VwU.js → agent-panel-iPdDqSEd.js} +4 -4
  9. package/dist/assets/{ai-model-dropdown-B3D05oQh.js → ai-model-dropdown-BC1SNLKb.js} +3 -3
  10. package/dist/assets/{app-config-button-D_mjovwU.js → app-config-button-CuE-bLFn.js} +1 -1
  11. package/dist/assets/{blob-BJREJiQp.js → blob-C23KHI9W.js} +1 -1
  12. package/dist/assets/{cell-editor-BOhZHoLm.js → cell-editor-D8UAfiUa.js} +11 -11
  13. package/dist/assets/cell-link-Bu5k33_H.js +1 -0
  14. package/dist/assets/{cells-Jr-5Pc9f.js → cells-C3V6s-g5.js} +53 -53
  15. package/dist/assets/{chat-display-Djy1Jt6b.js → chat-display-DSMFTDiK.js} +1 -1
  16. package/dist/assets/{chat-panel-B2nYSE_l.js → chat-panel-DuGaXa17.js} +4 -4
  17. package/dist/assets/{chat-ui-DlG0En7w.js → chat-ui-TD66NC03.js} +4 -4
  18. package/dist/assets/{column-preview-BUHlI5va.js → column-preview-Dqt5ygdi.js} +1 -1
  19. package/dist/assets/{command-palette-rEJmXCZM.js → command-palette-DgyUILpb.js} +1 -1
  20. package/dist/assets/{common-CZc3fQI4.js → common-CIJsW5yR.js} +1 -1
  21. package/dist/assets/{components-GAYCj6Mx.js → components-CniQJAsf.js} +1 -1
  22. package/dist/assets/{datasource-AWkkAeiS.js → datasource-YLl5kKpx.js} +2 -2
  23. package/dist/assets/{dependency-graph-panel-wcqTPq6b.js → dependency-graph-panel-MPHqARlX.js} +4 -4
  24. package/dist/assets/{documentation-panel-Eu8MIkoU.js → documentation-panel-DZnNktBv.js} +1 -1
  25. package/dist/assets/{download-CQ7iZFJL.js → download-CSWknseP.js} +2 -2
  26. package/dist/assets/{edit-page-Cw7nN6HC.js → edit-page-DVXg8Ibp.js} +6 -6
  27. package/dist/assets/error-entries-DIjVQBFa.js +8 -0
  28. package/dist/assets/{error-panel-BZzr0PA1.js → error-panel-CJSBDHOq.js} +1 -1
  29. package/dist/assets/{file-explorer-panel-C1W7g_Wp.js → file-explorer-panel-sHVZyshk.js} +4 -4
  30. package/dist/assets/{file-icons-BAqZR08W.js → file-icons-DDUQU--N.js} +1 -1
  31. package/dist/assets/{file-name-input-0MiZVw5r.js → file-name-input-CQjQP_zG.js} +1 -1
  32. package/dist/assets/{floating-outline-C6g75zrP.js → floating-outline-D1iQUiR_.js} +1 -1
  33. package/dist/assets/{focus-C0HXXg3V.js → focus-D_UTw9HF.js} +1 -1
  34. package/dist/assets/{form-C051zAev.js → form-B6jUSJBp.js} +1 -1
  35. package/dist/assets/{form-DT44Rmhp.js → form-Bp7lk3pm.js} +1 -1
  36. package/dist/assets/{home-page-CJz9IHZ2.js → home-page-CX6IV-hM.js} +2 -2
  37. package/dist/assets/{html-to-image-CfjhKLA4.js → html-to-image-kpOREGyr.js} +2 -2
  38. package/dist/assets/index-8Nlyq3mV.css +2 -0
  39. package/dist/assets/{index-CrEgp1mR.js → index-CrJhpWGp.js} +6 -6
  40. package/dist/assets/{layout-D4bpsgVD.js → layout-DdPE4xZU.js} +5 -5
  41. package/dist/assets/{logs-panel-CsaY3O1m.js → logs-panel-DnNiJzUQ.js} +1 -1
  42. package/dist/assets/{markdown-renderer-BgqeO4JR.js → markdown-renderer-CqljiwGm.js} +2 -2
  43. package/dist/assets/{name-cell-input-DcU8Rfrz.js → name-cell-input-BQzQI3Ja.js} +1 -1
  44. package/dist/assets/{outline-panel-D-CHPZQM.js → outline-panel-BIgVnAC7.js} +1 -1
  45. package/dist/assets/{packages-panel-dq7QVZl1.js → packages-panel-_HiSQVV7.js} +1 -1
  46. package/dist/assets/panels-b-OL36p2.js +4 -0
  47. package/dist/assets/{process-output-NbwnUu05.js → process-output-CJkR5qgD.js} +1 -1
  48. package/dist/assets/{radio-group-rhQpGwU-.js → radio-group-Dm-ZV-tP.js} +1 -1
  49. package/dist/assets/readonly-code-display-BiNt9i32.js +1 -0
  50. package/dist/assets/{readonly-python-code-Q_1Y3VyZ.js → readonly-python-code-DMKb3G0K.js} +1 -1
  51. package/dist/assets/{reveal-component-CedpDwM8.js → reveal-component-DN6-mIsb.js} +2 -2
  52. package/dist/assets/{run-page-CGoux5cj.js → run-page-BKCqJ0uJ.js} +1 -1
  53. package/dist/assets/scratchpad-panel-DwZEAfW1.js +1 -0
  54. package/dist/assets/{session-panel-OIot3eyB.js → session-panel-B-9BnZxS.js} +1 -1
  55. package/dist/assets/{skeleton-BRvjFlRu.js → skeleton-B72xXZAF.js} +1 -1
  56. package/dist/assets/{snippets-panel-YFyH2hUM.js → snippets-panel-Brc_pmTk.js} +1 -1
  57. package/dist/assets/{state-bHyw5u3R.js → state-BTAocii6.js} +1 -1
  58. package/dist/assets/state-D9oG57zx.js +3 -0
  59. package/dist/assets/{tracing-CDMM1BB2.js → tracing-Cn9cTT65.js} +1 -1
  60. package/dist/assets/{tracing-panel-BH5Zbvl9.js → tracing-panel-FWoe3_eY.js} +2 -2
  61. package/dist/assets/{tree-actions-DDveUIHK.js → tree-actions-rPl1v1gM.js} +1 -1
  62. package/dist/assets/useCellActionButton-Du3JXpNf.js +1 -0
  63. package/dist/assets/{useDeleteCell-BIopCngo.js → useDeleteCell-DHOwR-CG.js} +1 -1
  64. package/dist/assets/{useDependencyPanelTab-snM337f9.js → useDependencyPanelTab-B2PCtSi6.js} +1 -1
  65. package/dist/assets/{useNotebookActions-CsZfWFKy.js → useNotebookActions-DfQAtofT.js} +4 -4
  66. package/dist/assets/useRunCells-Dg11M4pT.js +1 -0
  67. package/dist/assets/{useSplitCell-BTmKY1CU.js → useSplitCell-BwWVHida.js} +1 -1
  68. package/dist/index.html +24 -24
  69. package/package.json +1 -1
  70. package/src/__mocks__/requests.ts +1 -0
  71. package/src/components/editor/connections/__tests__/quick-add-data-sources.test.tsx +113 -0
  72. package/src/components/editor/connections/add-connection-dialog.tsx +2 -0
  73. package/src/components/editor/connections/quick-add-data-sources.tsx +106 -0
  74. package/src/core/datasets/data-source-discovery.ts +5 -0
  75. package/src/core/datasets/request-registry.ts +11 -0
  76. package/src/core/islands/bootstrap.ts +1 -0
  77. package/src/core/islands/bridge.ts +1 -0
  78. package/src/core/kernel/messages.ts +2 -0
  79. package/src/core/network/__tests__/requests-lazy.test.ts +15 -0
  80. package/src/core/network/__tests__/requests-network.test.ts +14 -0
  81. package/src/core/network/requests-lazy.ts +1 -0
  82. package/src/core/network/requests-network.ts +8 -0
  83. package/src/core/network/requests-static.ts +1 -0
  84. package/src/core/network/requests-toasting.tsx +1 -0
  85. package/src/core/network/types.ts +2 -0
  86. package/src/core/wasm/bridge.ts +10 -0
  87. package/src/core/websocket/useMarimoKernelConnection.tsx +4 -0
  88. package/src/hooks/__tests__/useDataSourceDiscovery.test.ts +80 -0
  89. package/src/hooks/useDataSourceDiscovery.ts +18 -0
  90. package/dist/assets/add-connection-dialog-syjRSNPT.js +0 -178
  91. package/dist/assets/cell-link-DqNEv3f9.js +0 -1
  92. package/dist/assets/error-entries-Cr8uVukN.js +0 -8
  93. package/dist/assets/index-D6Dp_PFj.css +0 -2
  94. package/dist/assets/panels-DWoniKhE.js +0 -4
  95. package/dist/assets/readonly-code-display-CVY2f7EZ.js +0 -1
  96. package/dist/assets/scratchpad-panel-BLuF25yR.js +0 -1
  97. package/dist/assets/state-DB_fxbhn.js +0 -3
  98. package/dist/assets/useCellActionButton-D5ix_g2a.js +0 -1
  99. package/dist/assets/useRunCells-CF_V8X2K.js +0 -1
@@ -1,5 +1,5 @@
1
- var Va=Object.defineProperty;var Ra=(t,e,i)=>e in t?Va(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;var Ae=(t,e,i)=>Ra(t,typeof e!="symbol"?e+"":e,i);var at;import{s as Ui}from"./chunk-LvLJmgfZ.js";import{d as Kt,i as ot,l as rt,n as Dt,o as $a,p as it,u as nt}from"./useEvent-D91BmmQi.js";import{t as La}from"./react-Bj1aDYRI.js";import{An as Ga,Ci as Ha,Cn as Ua,Ei as qa,G as Wa,Gt as At,Ht as Qa,Li as Ya,Mr as ai,Nt as ee,Or as Za,Sn as ft,Sr as Xa,Ut as Ja,Wi as qi,Wt as Wi,_n as Qi,hn as eo,ii as Yi,jr as to,mn as io,ri as Pt,un as no,xn as te,xr as lo,zn as Zi}from"./cells-Jr-5Pc9f.js";import{t as Xi}from"./react-dom-CSu739Rf.js";import{t as Ce}from"./compiler-runtime-B3qBwwSJ.js";import{t as so}from"./isObject-DvLSfCY5.js";import{t as Ji}from"./get-C-qh_et5.js";import{t as ao}from"./merge-_9WLTEyt.js";import{t as oo}from"./debounce-OiXznToA.js";import{t as ro}from"./has-CMvx-Y7P.js";import{f as en,g as Z,l as co}from"./useEventListener-C0195JsF.js";import{t as Et}from"./invariant-CkiqGLcK.js";import{A as uo,C as tn,T as nn,d as mo,g as po,h as ho,j as go,k as ln,n as fo,u as xo,x as oi}from"./utils-BWBBpCkT.js";import{M as ct,S as yo,j as vo,r as bo}from"./config-B-Q7J_6d.js";import{i as ko,n as ri,t as jo}from"./switch-OVajJBPR.js";import{t as Pe}from"./cn-DYvqRARy.js";import{t as wo}from"./jsx-runtime-Blw4afVn.js";import{a as Co,i as _o,n as sn,o as So,r as an,t as No}from"./config-BJVx3eBW.js";import{a as on,c as xt,d as Io,i as Mo,o as Tt,r as Ko,s as rn,t as Do}from"./popover-Bcz1Zikb.js";import{i as ci,l as Me,n as Ao,r as Po,s as Eo,t as To}from"./select-BP75_5jJ.js";import{a as Bo,c as Bt,d as cn,f as dn,p as Fo,r as zo,s as Oo,t as Vo,u as un}from"./dropdown-menu-dHmZR8bI.js";import{t as Le}from"./label-CqjrpwRC.js";import{t as We}from"./tooltip-4bZlU7jl.js";import{n as Ro,r as mn,t as se}from"./button-DDGiD1NW.js";import{Tt as Ge,qt as pn,st as $o,ut as hn}from"./dist-12S8I4CH.js";import{F as Lo,L as gn,M as Go,N as Ho,P as Uo,R as fn,b as qo,f as xn,g as Wo,h as Qo,k as Yo,p as yn,x as Zo,y as Xo}from"./dist-CiVShZKM.js";import{s as vn}from"./arrays-DbOq36rN.js";import{n as Xe}from"./once-CGKw_kwj.js";import{t as Jo}from"./main-BNL5rxQw.js";import{i as er,n as tr,t as di}from"./strings--BknHX9C.js";import{r as Ft,t as ir}from"./requests-9-v2bhoi.js";import{t as Je}from"./createLucideIcon-w-Qo9n0R.js";import{t as nr}from"./check-rzLRd0j9.js";import{r as lr,t as ui}from"./x-C-Eq0ag8.js";import{t as sr}from"./chevron-right-BS_NcSch.js";import{u as ar}from"./toDate-Ct2FT81-.js";import{t as or}from"./copy-3iHFdt22.js";import{n as zt,t as bn}from"./spinner-D-V4psAa.js";import{t as rr}from"./plus-AgXtozBz.js";import{t as kn}from"./refresh-cw-CYq4mK5a.js";import{$ as He,B as cr,C as dr,D as ur,G as Ot,J as mr,O as Vt,S as jn,V as mi,X as wn,_ as pr,at as pi,b as hr,ct as hi,et as Cn,g as gr,lt as fr,nt as xr,o as yt,r as ze,rt as yr,st as Rt,ut as $t,w as vt}from"./input-JxFwu-3G.js";import{a as dt,c as G,g as _n,h as bt,i as vr,n as V,o as O,p as br,r as H,s as z,t as kr,u as jr}from"./form-C051zAev.js";import{t as Sn}from"./trash-2-72W0TZ3L.js";import{t as gi}from"./triangle-alert-BL4YVsPy.js";import{t as kt}from"./badge-B92a4ePY.js";import{t as Oe}from"./use-toast-BwJoaaDM.js";import{t as wr}from"./useTheme-Bxv9B31g.js";import{n as Cr}from"./copy-Bxb1_Gtw.js";import{B as jt,E as _r,I as Nn,M as fi,N as ut,O as xi,P as Ue,R as In,V as Lt,_ as Sr,j as et,k as Ve,l as Nr,m as Ir,p as Mr,t as Mn,v as Kn,y as Kr,z as Dr}from"./usePress-5hBv4sjD.js";import{t as Dn}from"./SSRProvider-BUSmWJKC.js";import{_ as An,a as yi,c as Gt,d as Ar,f as tt,g as lt,m as mt,p as Pn,s as Pr,t as Er,u as En,v as Tr}from"./RSPContexts-WiCgGm__.js";import{t as Ht}from"./context-BFPaAUK_.js";import{n as Br}from"./useDebounce-JDKr83KO.js";import{a as Fr,c as zr,n as Or,o as Vr,s as Rr,t as $r}from"./dialog-BCVepWLJ.js";import{i as Lr,r as Gr,t as Hr}from"./useHotkey-DLZvrRZT.js";import{a as Ur}from"./errors-PgHhDa-M.js";import{t as pe}from"./kbd-C5HnBH5U.js";import{t as oe}from"./links-wcQA1Np1.js";import{n as Tn,r as qr,t as Bn}from"./alert-jlwhGxSb.js";import{n as Wr,t as wt}from"./error-banner-BSxEOIn2.js";import{n as Fn}from"./useAsyncData-Bg5iAViP.js";import{a as Qr,i as Ut,n as Yr,o as zn,r as vi,t as Zr}from"./table-CH2plyy9.js";import{t as bi}from"./renderShortcut-Bl8_FVn8.js";import{r as Xr}from"./textarea-DZB2bzVL.js";import{n as Jr,t as ec}from"./azure-BjL5s4-w.js";import{a as tc,i as ic,n as nc,r as lc,t as sc}from"./card-DIbLM4TA.js";var ac="Expected a function";function oc(t,e,i){var l=!0,s=!0;if(typeof t!="function")throw TypeError(ac);return so(i)&&(l="leading"in i?!!i.leading:l,s="trailing"in i?!!i.trailing:s),oo(t,e,{leading:l,maxWait:e,trailing:s})}var rc=oc,ki=Je("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"}]]),On=Je("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"}]]),Vn=Je("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"}]]),cc=Je("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"}]]),Rn=Je("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"}]]),dc=Je("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"}]]),$n=Je("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"}]]),uc=Je("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"}]]),h=Ui(La(),1);function Ln(t,e){let i=(0,h.useRef)(!0),l=(0,h.useRef)(null);Lt(()=>(i.current=!0,()=>{i.current=!1}),[]),Lt(()=>{i.current?i.current=!1:(!l.current||e.some((s,a)=>!Object.is(s,l[a])))&&t(),l.current=e},e)}function Gn(t,e){let{collection:i,onLoadMore:l,scrollOffset:s=1}=t,a=(0,h.useRef)(null),o=Mr(c=>{for(let r of c)r.isIntersecting&&l&&l()});Lt(()=>(e.current&&(a.current=new IntersectionObserver(o,{root:lt(e==null?void 0:e.current),rootMargin:`0px ${100*s}% ${100*s}% ${100*s}%`}),a.current.observe(e.current)),()=>{a.current&&a.current.disconnect()}),[i,e,s])}function Hn(t){let e=h.version.split(".");return parseInt(e[0],10)>=19?t:t?"true":void 0}var mc="react-aria-clear-focus",pc="react-aria-focus",hc=500;function gc(t){let{isDisabled:e,onLongPressStart:i,onLongPressEnd:l,onLongPress:s,threshold:a=hc,accessibilityDescription:o}=t,c=(0,h.useRef)(void 0),{addGlobalListener:r,removeGlobalListener:d}=Ir(),{pressProps:u}=Mn({isDisabled:e,onPressStart(p){if(p.continuePropagation(),(p.pointerType==="mouse"||p.pointerType==="touch")&&(i&&i({...p,type:"longpressstart"}),c.current=setTimeout(()=>{p.target.dispatchEvent(new PointerEvent("pointercancel",{bubbles:!0})),Nn(p.target).activeElement!==p.target&&xi(p.target),s&&s({...p,type:"longpress"}),c.current=void 0},a),p.pointerType==="touch")){let g=x=>{x.preventDefault()};r(p.target,"contextmenu",g,{once:!0}),r(window,"pointerup",()=>{setTimeout(()=>{d(p.target,"contextmenu",g)},30)},{once:!0})}},onPressEnd(p){c.current&&clearTimeout(c.current),l&&(p.pointerType==="mouse"||p.pointerType==="touch")&&l({...p,type:"longpressend"})}});return{longPressProps:Ve(u,Pn(s&&!e?o:void 0))}}function fc(t,e){let i=e==null?void 0:e.isDisabled,[l,s]=(0,h.useState)(!1);return Lt(()=>{if(t!=null&&t.current&&!i){let a=()=>{t.current&&s(!!Gt(t.current,{tabbable:!0}).nextNode())};a();let o=new MutationObserver(a);return o.observe(t.current,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabIndex","disabled"]}),()=>{o.disconnect()}}}),i?!1:l}function Un(t){let e=yc(Nn(t));e!==t&&(e&&xc(e,t),t&&qn(t,e))}function xc(t,e){t.dispatchEvent(new FocusEvent("blur",{relatedTarget:e})),t.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:e}))}function qn(t,e){t.dispatchEvent(new FocusEvent("focus",{relatedTarget:e})),t.dispatchEvent(new FocusEvent("focusin",{bubbles:!0,relatedTarget:e}))}function yc(t){let e=ut(t),i=e==null?void 0:e.getAttribute("aria-activedescendant");return i&&t.getElementById(i)||e}function ji(t){return _r()?t.altKey:t.ctrlKey}function qt(t,e){var s,a;let i=`[data-key="${CSS.escape(String(e))}"]`,l=(s=t.current)==null?void 0:s.dataset.collection;return l&&(i=`[data-collection="${CSS.escape(l)}"]${i}`),(a=t.current)==null?void 0:a.querySelector(i)}var Wn=new WeakMap;function vc(t){let e=jt();return Wn.set(t,e),e}function bc(t){return Wn.get(t)}var kc=1e3;function jc(t){let{keyboardDelegate:e,selectionManager:i,onTypeSelect:l}=t,s=(0,h.useRef)({search:"",timeout:void 0}).current;return{typeSelectProps:{onKeyDownCapture:e.getKeyForSearch?a=>{let o=wc(a.key);if(!(!o||a.ctrlKey||a.metaKey||!et(a.currentTarget,Ue(a))||s.search.length===0&&o===" ")){if(o===" "&&s.search.trim().length>0&&(a.preventDefault(),"continuePropagation"in a||a.stopPropagation()),s.search+=o,e.getKeyForSearch!=null){let c=e.getKeyForSearch(s.search,i.focusedKey);c??(c=e.getKeyForSearch(s.search)),c!=null&&(i.setFocusedKey(c),l&&l(c))}clearTimeout(s.timeout),s.timeout=setTimeout(()=>{s.search=""},kc)}}:void 0}}}function wc(t){return t.length===1||!/^[A-Z]/i.test(t)?t:""}var Cc=Xi();function _c(t){let{selectionManager:e,keyboardDelegate:i,ref:l,autoFocus:s=!1,shouldFocusWrap:a=!1,disallowEmptySelection:o=!1,disallowSelectAll:c=!1,escapeKeyBehavior:r="clearSelection",selectOnFocus:d=e.selectionBehavior==="replace",disallowTypeAhead:u=!1,shouldUseVirtualFocus:p,allowsTabNavigation:g=!1,scrollRef:x=l,linkBehavior:v="action"}=t,{direction:j}=Ht(),C=Kn(),I=k=>{var T,F,U,W,N,q,ie,ce,de,fe,he,xe;if(k.altKey&&k.key==="Tab"&&k.preventDefault(),!l.current||!et(l.current,Ue(k)))return;let D=(E,X)=>{if(E!=null){if(e.isLink(E)&&v==="selection"&&d&&!ji(k)){(0,Cc.flushSync)(()=>{e.setFocusedKey(E,X)});let Y=qt(l,E),Q=e.getItemProps(E);Y&&C.open(Y,k,Q.href,Q.routerOptions);return}if(e.setFocusedKey(E,X),e.isLink(E)&&v==="override")return;k.shiftKey&&e.selectionMode==="multiple"?e.extendSelection(E):d&&!ji(k)&&e.replaceSelection(E)}};switch(k.key){case"ArrowDown":if(i.getKeyBelow){let E=e.focusedKey==null?(T=i.getFirstKey)==null?void 0:T.call(i):(F=i.getKeyBelow)==null?void 0:F.call(i,e.focusedKey);E==null&&a&&(E=(U=i.getFirstKey)==null?void 0:U.call(i,e.focusedKey)),E!=null&&(k.preventDefault(),D(E))}break;case"ArrowUp":if(i.getKeyAbove){let E=e.focusedKey==null?(W=i.getLastKey)==null?void 0:W.call(i):(N=i.getKeyAbove)==null?void 0:N.call(i,e.focusedKey);E==null&&a&&(E=(q=i.getLastKey)==null?void 0:q.call(i,e.focusedKey)),E!=null&&(k.preventDefault(),D(E))}break;case"ArrowLeft":if(i.getKeyLeftOf){let E=e.focusedKey==null?null:(ie=i.getKeyLeftOf)==null?void 0:ie.call(i,e.focusedKey);E==null&&a&&(E=j==="rtl"?(ce=i.getFirstKey)==null?void 0:ce.call(i,e.focusedKey):(de=i.getLastKey)==null?void 0:de.call(i,e.focusedKey)),E!=null&&(k.preventDefault(),D(E,j==="rtl"?"first":"last"))}break;case"ArrowRight":if(i.getKeyRightOf){let E=e.focusedKey==null?null:(fe=i.getKeyRightOf)==null?void 0:fe.call(i,e.focusedKey);E==null&&a&&(E=j==="rtl"?(he=i.getLastKey)==null?void 0:he.call(i,e.focusedKey):(xe=i.getFirstKey)==null?void 0:xe.call(i,e.focusedKey)),E!=null&&(k.preventDefault(),D(E,j==="rtl"?"last":"first"))}break;case"Home":if(i.getFirstKey){if(e.focusedKey===null&&k.shiftKey)return;k.preventDefault();let E=i.getFirstKey(e.focusedKey,mt(k));e.setFocusedKey(E),E!=null&&(mt(k)&&k.shiftKey&&e.selectionMode==="multiple"?e.extendSelection(E):d&&e.replaceSelection(E))}break;case"End":if(i.getLastKey){if(e.focusedKey===null&&k.shiftKey)return;k.preventDefault();let E=i.getLastKey(e.focusedKey,mt(k));e.setFocusedKey(E),E!=null&&(mt(k)&&k.shiftKey&&e.selectionMode==="multiple"?e.extendSelection(E):d&&e.replaceSelection(E))}break;case"PageDown":if(i.getKeyPageBelow&&e.focusedKey!=null){let E=i.getKeyPageBelow(e.focusedKey);E!=null&&(k.preventDefault(),D(E))}break;case"PageUp":if(i.getKeyPageAbove&&e.focusedKey!=null){let E=i.getKeyPageAbove(e.focusedKey);E!=null&&(k.preventDefault(),D(E))}break;case"a":mt(k)&&e.selectionMode==="multiple"&&c!==!0&&(k.preventDefault(),e.selectAll());break;case"Escape":r==="clearSelection"&&!o&&e.selectedKeys.size!==0&&(k.stopPropagation(),k.preventDefault(),e.clearSelection());break;case"Tab":if(!g){if(k.shiftKey)l.current.focus();else{let E=Gt(l.current,{tabbable:!0}),X,Y;do Y=E.lastChild(),Y&&(X=Y);while(Y);let Q=ut();X&&(!fi(X)||Q&&!Nr(Q))&&xi(X)}break}}},b=(0,h.useRef)({top:0,left:0});Rt(x,"scroll",()=>{var k,D;b.current={top:((k=x.current)==null?void 0:k.scrollTop)??0,left:((D=x.current)==null?void 0:D.scrollLeft)??0}});let _=k=>{var D,T;if(e.isFocused){et(k.currentTarget,Ue(k))||e.setFocused(!1);return}if(et(k.currentTarget,Ue(k))){if(e.setFocused(!0),e.focusedKey==null){let F=W=>{W!=null&&(e.setFocusedKey(W),d&&!e.isSelected(W)&&e.replaceSelection(W))},U=k.relatedTarget;U&&k.currentTarget.compareDocumentPosition(U)&Node.DOCUMENT_POSITION_FOLLOWING?F(e.lastSelectedKey??((D=i.getLastKey)==null?void 0:D.call(i))):F(e.firstSelectedKey??((T=i.getFirstKey)==null?void 0:T.call(i)))}else x.current&&(x.current.scrollTop=b.current.top,x.current.scrollLeft=b.current.left);if(e.focusedKey!=null&&x.current){let F=qt(l,e.focusedKey);F instanceof HTMLElement&&(!fi(F)&&!p&&xi(F),Cn()==="keyboard"&&tt(F,{containingElement:l.current}))}}},S=k=>{et(k.currentTarget,k.relatedTarget)||e.setFocused(!1)},f=(0,h.useRef)(!1);Rt(l,pc,p?k=>{let{detail:D}=k;k.stopPropagation(),e.setFocused(!0),(D==null?void 0:D.focusStrategy)==="first"&&(f.current=!0)}:void 0),Ln(()=>{var k;if(f.current){let D=((k=i.getFirstKey)==null?void 0:k.call(i))??null;if(D==null){let T=ut();Un(l.current),qn(T,null),e.collection.size>0&&(f.current=!1)}else e.setFocusedKey(D),f.current=!1}},[e.collection]),Ln(()=>{e.collection.size>0&&(f.current=!1)},[e.focusedKey]),Rt(l,mc,p?k=>{var D;k.stopPropagation(),e.setFocused(!1),(D=k.detail)!=null&&D.clearFocusKey&&e.setFocusedKey(null)}:void 0);let m=(0,h.useRef)(s),y=(0,h.useRef)(!1);(0,h.useEffect)(()=>{var k,D;if(m.current){let T=null;s==="first"&&(T=((k=i.getFirstKey)==null?void 0:k.call(i))??null),s==="last"&&(T=((D=i.getLastKey)==null?void 0:D.call(i))??null);let F=e.selectedKeys;if(F.size){for(let U of F)if(e.canSelectItem(U)){T=U;break}}e.setFocused(!0),e.setFocusedKey(T),T==null&&!p&&l.current&&He(l.current),e.collection.size>0&&(m.current=!1,y.current=!0)}});let P=(0,h.useRef)(e.focusedKey),A=(0,h.useRef)(null);(0,h.useEffect)(()=>{if(e.isFocused&&e.focusedKey!=null&&(e.focusedKey!==P.current||y.current)&&x.current&&l.current){let k=Cn(),D=qt(l,e.focusedKey);if(!(D instanceof HTMLElement))return;(k==="keyboard"||y.current)&&(A.current&&cancelAnimationFrame(A.current),A.current=requestAnimationFrame(()=>{x.current&&(Ar(x.current,D),k!=="virtual"&&tt(D,{containingElement:l.current}))}))}!p&&e.isFocused&&e.focusedKey==null&&P.current!=null&&l.current&&He(l.current),P.current=e.focusedKey,y.current=!1}),(0,h.useEffect)(()=>()=>{A.current&&cancelAnimationFrame(A.current)},[]),Rt(l,"react-aria-focus-scope-restore",k=>{k.preventDefault(),e.setFocused(!0)});let B={onKeyDown:I,onFocus:_,onBlur:S,onMouseDown(k){x.current===Ue(k)&&k.preventDefault()}},{typeSelectProps:M}=jc({keyboardDelegate:i,selectionManager:e});u||(B=Ve(M,B));let w;p||(w=e.focusedKey==null?0:-1);let K=vc(e.collection);return{collectionProps:Ve(B,{tabIndex:w,"data-collection":K})}}function Qn(t){let{id:e,selectionManager:i,key:l,ref:s,shouldSelectOnPressUp:a,shouldUseVirtualFocus:o,focus:c,isDisabled:r,onAction:d,allowsDifferentPressOrigin:u,linkBehavior:p="action"}=t,g=Kn();e=jt(e);let x=N=>{if(N.pointerType==="keyboard"&&ji(N))i.toggleSelection(l);else{if(i.selectionMode==="none")return;if(i.isLink(l)){if(p==="selection"&&s.current){let q=i.getItemProps(l);g.open(s.current,N,q.href,q.routerOptions),i.setSelectedKeys(i.selectedKeys);return}else if(p==="override"||p==="none")return}i.selectionMode==="single"?i.isSelected(l)&&!i.disallowEmptySelection?i.toggleSelection(l):i.replaceSelection(l):N&&N.shiftKey?i.extendSelection(l):i.selectionBehavior==="toggle"||N&&(mt(N)||N.pointerType==="touch"||N.pointerType==="virtual")?i.toggleSelection(l):i.replaceSelection(l)}};(0,h.useEffect)(()=>{l===i.focusedKey&&i.isFocused&&(o?Un(s.current):c?c():ut()!==s.current&&s.current&&He(s.current))},[s,l,i.focusedKey,i.childFocusStrategy,i.isFocused,o]),r||(r=i.isDisabled(l));let v={};!o&&!r?v={tabIndex:l===i.focusedKey?0:-1,onFocus(N){Ue(N)===s.current&&i.setFocusedKey(l)}}:r&&(v.onMouseDown=N=>{N.preventDefault()}),(0,h.useEffect)(()=>{r&&i.focusedKey===l&&i.setFocusedKey(null)},[i,r,l]);let j=i.isLink(l)&&p==="override",C=d&&t.UNSTABLE_itemBehavior==="action",I=i.isLink(l)&&p!=="selection"&&p!=="none",b=!r&&i.canSelectItem(l)&&!j&&!C,_=(d||I)&&!r,S=_&&(i.selectionBehavior==="replace"?!b:!b||i.isEmpty),f=_&&b&&i.selectionBehavior==="replace",m=S||f,y=(0,h.useRef)(null),P=m&&b,A=(0,h.useRef)(!1),B=(0,h.useRef)(!1),M=i.getItemProps(l),w=N=>{if(d){var q;d(),(q=s.current)==null||q.dispatchEvent(new CustomEvent("react-aria-item-action",{bubbles:!0}))}I&&s.current&&g.open(s.current,N,M.href,M.routerOptions)},K={ref:s};if(a?(K.onPressStart=N=>{y.current=N.pointerType,A.current=P,N.pointerType==="keyboard"&&(!m||Zn(N.key))&&x(N)},u?(K.onPressUp=S?void 0:N=>{N.pointerType==="mouse"&&b&&x(N)},K.onPress=S?w:N=>{N.pointerType!=="keyboard"&&N.pointerType!=="mouse"&&b&&x(N)}):K.onPress=N=>{if(S||f&&N.pointerType!=="mouse"){if(N.pointerType==="keyboard"&&!Yn(N.key))return;w(N)}else N.pointerType!=="keyboard"&&b&&x(N)}):(K.onPressStart=N=>{y.current=N.pointerType,A.current=P,B.current=S,b&&(N.pointerType==="mouse"&&!S||N.pointerType==="keyboard"&&(!_||Zn(N.key)))&&x(N)},K.onPress=N=>{(N.pointerType==="touch"||N.pointerType==="pen"||N.pointerType==="virtual"||N.pointerType==="keyboard"&&m&&Yn(N.key)||N.pointerType==="mouse"&&B.current)&&(m?w(N):b&&x(N))}),v["data-collection"]=bc(i.collection),v["data-key"]=l,K.preventFocusOnPress=o,o&&(K=Ve(K,{onPressStart(N){N.pointerType!=="touch"&&(i.setFocused(!0),i.setFocusedKey(l))},onPress(N){N.pointerType==="touch"&&(i.setFocused(!0),i.setFocusedKey(l))}})),M)for(let N of["onPressStart","onPressEnd","onPressChange","onPress","onPressUp","onClick"])M[N]&&(K[N]=In(K[N],M[N]));let{pressProps:k,isPressed:D}=Mn(K),T=f?N=>{y.current==="mouse"&&(N.stopPropagation(),N.preventDefault(),w(N))}:void 0,{longPressProps:F}=gc({isDisabled:!P,onLongPress(N){N.pointerType==="touch"&&(x(N),i.setSelectionBehavior("toggle"))}}),U=N=>{y.current==="touch"&&A.current&&N.preventDefault()},W=p!=="none"&&i.isLink(l)?N=>{Sr.isOpening||N.preventDefault()}:void 0;return{itemProps:Ve(v,b||S||o&&!r?k:{},P?F:{},{onDoubleClick:T,onDragStartCapture:U,onClick:W,id:e},o?{onMouseDown:N=>N.preventDefault()}:void 0),isPressed:D,isSelected:i.isSelected(l),isFocused:i.isFocused&&i.focusedKey===l,isDisabled:r,allowsSelection:b,hasAction:m}}function Yn(t){return t==="Enter"}function Zn(t){return t===" "}var Xn=class{getItemRect(t){let e=this.ref.current;if(!e)return null;let i=t==null?null:qt(this.ref,t);if(!i)return null;let l=e.getBoundingClientRect(),s=i.getBoundingClientRect();return{x:s.left-l.left-e.clientLeft+e.scrollLeft,y:s.top-l.top-e.clientTop+e.scrollTop,width:s.width,height:s.height}}getContentSize(){let t=this.ref.current;return{width:(t==null?void 0:t.scrollWidth)??0,height:(t==null?void 0:t.scrollHeight)??0}}getVisibleRect(){let t=this.ref.current;return{x:(t==null?void 0:t.scrollLeft)??0,y:(t==null?void 0:t.scrollTop)??0,width:(t==null?void 0:t.clientWidth)??0,height:(t==null?void 0:t.clientHeight)??0}}constructor(t){this.ref=t}},wi=class{isDisabled(t){var e;return this.disabledBehavior==="all"&&(((e=t.props)==null?void 0:e.isDisabled)||this.disabledKeys.has(t.key))}findNextNonDisabled(t,e){let i=t;for(;i!=null;){let l=this.collection.getItem(i);if((l==null?void 0:l.type)==="item"&&!this.isDisabled(l))return i;i=e(i)}return null}getNextKey(t){let e=t;return e=this.collection.getKeyAfter(e),this.findNextNonDisabled(e,i=>this.collection.getKeyAfter(i))}getPreviousKey(t){let e=t;return e=this.collection.getKeyBefore(e),this.findNextNonDisabled(e,i=>this.collection.getKeyBefore(i))}findKey(t,e,i){let l=t,s=this.layoutDelegate.getItemRect(l);if(!s||l==null)return null;let a=s;do{if(l=e(l),l==null)break;s=this.layoutDelegate.getItemRect(l)}while(s&&i(a,s)&&l!=null);return l}isSameRow(t,e){return t.y===e.y||t.x!==e.x}isSameColumn(t,e){return t.x===e.x||t.y!==e.y}getKeyBelow(t){return this.layout==="grid"&&this.orientation==="vertical"?this.findKey(t,e=>this.getNextKey(e),this.isSameRow):this.getNextKey(t)}getKeyAbove(t){return this.layout==="grid"&&this.orientation==="vertical"?this.findKey(t,e=>this.getPreviousKey(e),this.isSameRow):this.getPreviousKey(t)}getNextColumn(t,e){return e?this.getPreviousKey(t):this.getNextKey(t)}getKeyRightOf(t){let e=this.direction==="ltr"?"getKeyRightOf":"getKeyLeftOf";return this.layoutDelegate[e]?(t=this.layoutDelegate[e](t),this.findNextNonDisabled(t,i=>this.layoutDelegate[e](i))):this.layout==="grid"?this.orientation==="vertical"?this.getNextColumn(t,this.direction==="rtl"):this.findKey(t,i=>this.getNextColumn(i,this.direction==="rtl"),this.isSameColumn):this.orientation==="horizontal"?this.getNextColumn(t,this.direction==="rtl"):null}getKeyLeftOf(t){let e=this.direction==="ltr"?"getKeyLeftOf":"getKeyRightOf";return this.layoutDelegate[e]?(t=this.layoutDelegate[e](t),this.findNextNonDisabled(t,i=>this.layoutDelegate[e](i))):this.layout==="grid"?this.orientation==="vertical"?this.getNextColumn(t,this.direction==="ltr"):this.findKey(t,i=>this.getNextColumn(i,this.direction==="ltr"),this.isSameColumn):this.orientation==="horizontal"?this.getNextColumn(t,this.direction==="ltr"):null}getFirstKey(){let t=this.collection.getFirstKey();return this.findNextNonDisabled(t,e=>this.collection.getKeyAfter(e))}getLastKey(){let t=this.collection.getLastKey();return this.findNextNonDisabled(t,e=>this.collection.getKeyBefore(e))}getKeyPageAbove(t){let e=this.ref.current,i=this.layoutDelegate.getItemRect(t);if(!i)return null;if(e&&!An(e))return this.getFirstKey();let l=t;if(this.orientation==="horizontal"){let s=Math.max(0,i.x+i.width-this.layoutDelegate.getVisibleRect().width);for(;i&&i.x>s&&l!=null;)l=this.getKeyAbove(l),i=l==null?null:this.layoutDelegate.getItemRect(l)}else{let s=Math.max(0,i.y+i.height-this.layoutDelegate.getVisibleRect().height);for(;i&&i.y>s&&l!=null;)l=this.getKeyAbove(l),i=l==null?null:this.layoutDelegate.getItemRect(l)}return l??this.getFirstKey()}getKeyPageBelow(t){let e=this.ref.current,i=this.layoutDelegate.getItemRect(t);if(!i)return null;if(e&&!An(e))return this.getLastKey();let l=t;if(this.orientation==="horizontal"){let s=Math.min(this.layoutDelegate.getContentSize().width,i.y-i.width+this.layoutDelegate.getVisibleRect().width);for(;i&&i.x<s&&l!=null;)l=this.getKeyBelow(l),i=l==null?null:this.layoutDelegate.getItemRect(l)}else{let s=Math.min(this.layoutDelegate.getContentSize().height,i.y-i.height+this.layoutDelegate.getVisibleRect().height);for(;i&&i.y<s&&l!=null;)l=this.getKeyBelow(l),i=l==null?null:this.layoutDelegate.getItemRect(l)}return l??this.getLastKey()}getKeyForSearch(t,e){if(!this.collator)return null;let i=this.collection,l=e||this.getFirstKey();for(;l!=null;){let s=i.getItem(l);if(!s)return null;let a=s.textValue.slice(0,t.length);if(s.textValue&&this.collator.compare(a,t)===0)return l;l=this.getNextKey(l)}return null}constructor(...t){if(t.length===1){let e=t[0];this.collection=e.collection,this.ref=e.ref,this.collator=e.collator,this.disabledKeys=e.disabledKeys||new Set,this.disabledBehavior=e.disabledBehavior||"all",this.orientation=e.orientation||"vertical",this.direction=e.direction,this.layout=e.layout||"stack",this.layoutDelegate=e.layoutDelegate||new Xn(e.ref)}else this.collection=t[0],this.disabledKeys=t[1],this.ref=t[2],this.collator=t[3],this.layout="stack",this.orientation="vertical",this.disabledBehavior="all",this.layoutDelegate=new Xn(this.ref);this.layout==="stack"&&this.orientation==="vertical"&&(this.getKeyLeftOf=void 0,this.getKeyRightOf=void 0)}};function Jn(t){let{selectionManager:e,collection:i,disabledKeys:l,ref:s,keyboardDelegate:a,layoutDelegate:o}=t,c=En({usage:"search",sensitivity:"base"}),r=e.disabledBehavior,d=(0,h.useMemo)(()=>a||new wi({collection:i,disabledKeys:l,disabledBehavior:r,ref:s,collator:c,layoutDelegate:o}),[a,o,i,l,s,c,r]),{collectionProps:u}=_c({...t,ref:s,selectionManager:e,keyboardDelegate:d});return{listProps:u}}var Sc=class{build(t,e){return this.context=e,el(()=>this.iterateCollection(t))}*iterateCollection(t){let{children:e,items:i}=t;if(h.isValidElement(e)&&e.type===h.Fragment)yield*this.iterateCollection({children:e.props.children,items:i});else if(typeof e=="function"){if(!i)throw Error("props.children was a function but props.items is missing");let l=0;for(let s of i)yield*this.getFullNode({value:s,index:l},{renderer:e}),l++}else{let l=[];h.Children.forEach(e,a=>{a&&l.push(a)});let s=0;for(let a of l){let o=this.getFullNode({element:a,index:s},{});for(let c of o)s++,yield c}}}getKey(t,e,i,l){if(t.key!=null)return t.key;if(e.type==="cell"&&e.key!=null)return`${l}${e.key}`;let s=e.value;if(s!=null){let a=s.key??s.id;if(a==null)throw Error("No key found for item");return a}return l?`${l}.${e.index}`:`$.${e.index}`}getChildState(t,e){return{renderer:e.renderer||t.renderer}}*getFullNode(t,e,i,l){if(h.isValidElement(t.element)&&t.element.type===h.Fragment){let c=[];h.Children.forEach(t.element.props.children,d=>{c.push(d)});let r=t.index??0;for(let d of c)yield*this.getFullNode({element:d,index:r++},e,i,l);return}let s=t.element;if(!s&&t.value&&e&&e.renderer){let c=this.cache.get(t.value);if(c&&(!c.shouldInvalidate||!c.shouldInvalidate(this.context))){c.index=t.index,c.parentKey=l?l.key:null,yield c;return}s=e.renderer(t.value)}if(h.isValidElement(s)){let c=s.type;if(typeof c!="function"&&typeof c.getCollectionNode!="function"){let p=s.type;throw Error(`Unknown element <${p}> in collection.`)}let r=c.getCollectionNode(s.props,this.context),d=t.index??0,u=r.next();for(;!u.done&&u.value;){let p=u.value;t.index=d;let g=p.key??null;g??(g=p.element?null:this.getKey(s,t,e,i));let x=[...this.getFullNode({...p,key:g,index:d,wrapper:Nc(t.wrapper,p.wrapper)},this.getChildState(e,p),i?`${i}${s.key}`:s.key,l)];for(let v of x){if(v.value=p.value??t.value??null,v.value&&this.cache.set(v.value,v),t.type&&v.type!==t.type)throw Error(`Unsupported type <${Ci(v.type)}> in <${Ci((l==null?void 0:l.type)??"unknown parent type")}>. Only <${Ci(t.type)}> is supported.`);d++,yield v}u=r.next(x)}return}if(t.key==null||t.type==null)return;let a=this,o={type:t.type,props:t.props,key:t.key,parentKey:l?l.key:null,value:t.value??null,level:l?l.level+1:0,index:t.index,rendered:t.rendered,textValue:t.textValue??"","aria-label":t["aria-label"],wrapper:t.wrapper,shouldInvalidate:t.shouldInvalidate,hasChildNodes:t.hasChildNodes||!1,childNodes:el(function*(){if(!t.hasChildNodes||!t.childNodes)return;let c=0;for(let r of t.childNodes()){r.key!=null&&(r.key=`${o.key}${r.key}`);let d=a.getFullNode({...r,index:c},a.getChildState(e,r),o.key,o);for(let u of d)c++,yield u}})};yield o}constructor(){this.cache=new WeakMap}};function el(t){let e=[],i=null;return{*[Symbol.iterator](){for(let l of e)yield l;i||(i=t());for(let l of i)e.push(l),yield l}}}function Nc(t,e){if(t&&e)return i=>t(e(i));if(t)return t;if(e)return e}function Ci(t){return t[0].toUpperCase()+t.slice(1)}function tl(t,e,i){let l=(0,h.useMemo)(()=>new Sc,[]),{children:s,items:a,collection:o}=t;return(0,h.useMemo)(()=>o||e(l.build({children:s,items:a},i)),[l,s,a,o,i,e])}function il(t,e){return typeof e.getChildren=="function"?e.getChildren(t.key):t.childNodes}function Ic(t){return Mc(t,0)}function Mc(t,e){if(e<0)return;let i=0;for(let l of t){if(i===e)return l;i++}}function _i(t,e,i){if(e.parentKey===i.parentKey)return e.index-i.index;let l=[...nl(t,e),e],s=[...nl(t,i),i],a=l.slice(0,s.length).findIndex((o,c)=>o!==s[c]);return a===-1?l.findIndex(o=>o===i)>=0?1:(s.findIndex(o=>o===e),-1):(e=l[a],i=s[a],e.index-i.index)}function nl(t,e){let i=[],l=e;for(;(l==null?void 0:l.parentKey)!=null;)l=t.getItem(l.parentKey),l&&i.unshift(l);return i}var Si=new WeakMap;function Ni(t,e){let{id:i}=Si.get(t)??{};if(!i)throw Error("Unknown list");return`${i}-${Kc(e)}`}function Kc(t){return typeof t=="string"?t.replace(/\s*/g,""):""+t}var ll={};ll={deselectedItem:t=>`${t.item} \u063A\u064A\u0631 \u0627\u0644\u0645\u062D\u062F\u062F`,longPressToSelect:"\u0627\u0636\u063A\u0637 \u0645\u0637\u0648\u0644\u064B\u0627 \u0644\u0644\u062F\u062E\u0648\u0644 \u0625\u0644\u0649 \u0648\u0636\u0639 \u0627\u0644\u062A\u062D\u062F\u064A\u062F.",select:"\u062A\u062D\u062F\u064A\u062F",selectedAll:"\u062C\u0645\u064A\u0639 \u0627\u0644\u0639\u0646\u0627\u0635\u0631 \u0627\u0644\u0645\u062D\u062F\u062F\u0629.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"\u0644\u0645 \u064A\u062A\u0645 \u062A\u062D\u062F\u064A\u062F \u0639\u0646\u0627\u0635\u0631",one:()=>`${e.number(t.count)} \u0639\u0646\u0635\u0631 \u0645\u062D\u062F\u062F`,other:()=>`${e.number(t.count)} \u0639\u0646\u0635\u0631 \u0645\u062D\u062F\u062F`})}.`,selectedItem:t=>`${t.item} \u0627\u0644\u0645\u062D\u062F\u062F`};var sl={};sl={deselectedItem:t=>`${t.item} \u043D\u0435 \u0435 \u0438\u0437\u0431\u0440\u0430\u043D.`,longPressToSelect:"\u041D\u0430\u0442\u0438\u0441\u043D\u0435\u0442\u0435 \u0438 \u0437\u0430\u0434\u0440\u044A\u0436\u0442\u0435 \u0437\u0430 \u0434\u0430 \u0432\u043B\u0435\u0437\u0435\u0442\u0435 \u0432 \u0438\u0437\u0431\u0438\u0440\u0430\u0442\u0435\u043B\u0435\u043D \u0440\u0435\u0436\u0438\u043C.",select:"\u0418\u0437\u0431\u0435\u0440\u0435\u0442\u0435",selectedAll:"\u0412\u0441\u0438\u0447\u043A\u0438 \u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438 \u0441\u0430 \u0438\u0437\u0431\u0440\u0430\u043D\u0438.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"\u041D\u044F\u043C\u0430 \u0438\u0437\u0431\u0440\u0430\u043D\u0438 \u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438",one:()=>`${e.number(t.count)} \u0438\u0437\u0431\u0440\u0430\u043D \u0435\u043B\u0435\u043C\u0435\u043D\u0442`,other:()=>`${e.number(t.count)} \u0438\u0437\u0431\u0440\u0430\u043D\u0438 \u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438`})}.`,selectedItem:t=>`${t.item} \u0438\u0437\u0431\u0440\u0430\u043D.`};var al={};al={deselectedItem:t=>`Polo\u017Eka ${t.item} nen\xED vybr\xE1na.`,longPressToSelect:"Dlouh\xFDm stisknut\xEDm p\u0159ejdete do re\u017Eimu v\xFDb\u011Bru.",select:"Vybrat",selectedAll:"Vybr\xE1ny v\u0161echny polo\u017Eky.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Nevybr\xE1ny \u017E\xE1dn\xE9 polo\u017Eky",one:()=>`Vybr\xE1na ${e.number(t.count)} polo\u017Eka`,other:()=>`Vybr\xE1no ${e.number(t.count)} polo\u017Eek`})}.`,selectedItem:t=>`Vybr\xE1na polo\u017Eka ${t.item}.`};var ol={};ol={deselectedItem:t=>`${t.item} ikke valgt.`,longPressToSelect:"Lav et langt tryk for at aktivere valgtilstand.",select:"V\xE6lg",selectedAll:"Alle elementer valgt.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Ingen elementer valgt",one:()=>`${e.number(t.count)} element valgt`,other:()=>`${e.number(t.count)} elementer valgt`})}.`,selectedItem:t=>`${t.item} valgt.`};var rl={};rl={deselectedItem:t=>`${t.item} nicht ausgew\xE4hlt.`,longPressToSelect:"Gedr\xFCckt halten, um Auswahlmodus zu \xF6ffnen.",select:"Ausw\xE4hlen",selectedAll:"Alle Elemente ausgew\xE4hlt.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Keine Elemente ausgew\xE4hlt",one:()=>`${e.number(t.count)} Element ausgew\xE4hlt`,other:()=>`${e.number(t.count)} Elemente ausgew\xE4hlt`})}.`,selectedItem:t=>`${t.item} ausgew\xE4hlt.`};var cl={};cl={deselectedItem:t=>`\u0394\u03B5\u03BD \u03B5\u03C0\u03B9\u03BB\u03AD\u03C7\u03B8\u03B7\u03BA\u03B5 \u03C4\u03BF \u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03BF ${t.item}.`,longPressToSelect:"\u03A0\u03B1\u03C4\u03AE\u03C3\u03C4\u03B5 \u03C0\u03B1\u03C1\u03B1\u03C4\u03B5\u03C4\u03B1\u03BC\u03AD\u03BD\u03B1 \u03B3\u03B9\u03B1 \u03BD\u03B1 \u03BC\u03C0\u03B5\u03AF\u03C4\u03B5 \u03C3\u03B5 \u03BB\u03B5\u03B9\u03C4\u03BF\u03C5\u03C1\u03B3\u03AF\u03B1 \u03B5\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE\u03C2.",select:"\u0395\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE",selectedAll:"\u0395\u03C0\u03B9\u03BB\u03AD\u03C7\u03B8\u03B7\u03BA\u03B1\u03BD \u03CC\u03BB\u03B1 \u03C4\u03B1 \u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"\u0394\u03B5\u03BD \u03B5\u03C0\u03B9\u03BB\u03AD\u03C7\u03B8\u03B7\u03BA\u03B1\u03BD \u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",one:()=>`\u0395\u03C0\u03B9\u03BB\u03AD\u03C7\u03B8\u03B7\u03BA\u03B5 ${e.number(t.count)} \u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03BF`,other:()=>`\u0395\u03C0\u03B9\u03BB\u03AD\u03C7\u03B8\u03B7\u03BA\u03B1\u03BD ${e.number(t.count)} \u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1`})}.`,selectedItem:t=>`\u0395\u03C0\u03B9\u03BB\u03AD\u03C7\u03B8\u03B7\u03BA\u03B5 \u03C4\u03BF \u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03BF ${t.item}.`};var dl={};dl={deselectedItem:t=>`${t.item} not selected.`,select:"Select",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"No items selected",one:()=>`${e.number(t.count)} item selected`,other:()=>`${e.number(t.count)} items selected`})}.`,selectedAll:"All items selected.",selectedItem:t=>`${t.item} selected.`,longPressToSelect:"Long press to enter selection mode."};var ul={};ul={deselectedItem:t=>`${t.item} no seleccionado.`,longPressToSelect:"Mantenga pulsado para abrir el modo de selecci\xF3n.",select:"Seleccionar",selectedAll:"Todos los elementos seleccionados.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Ning\xFAn elemento seleccionado",one:()=>`${e.number(t.count)} elemento seleccionado`,other:()=>`${e.number(t.count)} elementos seleccionados`})}.`,selectedItem:t=>`${t.item} seleccionado.`};var ml={};ml={deselectedItem:t=>`${t.item} pole valitud.`,longPressToSelect:"Valikure\u017Eiimi sisenemiseks vajutage pikalt.",select:"Vali",selectedAll:"K\xF5ik \xFCksused valitud.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"\xDCksusi pole valitud",one:()=>`${e.number(t.count)} \xFCksus valitud`,other:()=>`${e.number(t.count)} \xFCksust valitud`})}.`,selectedItem:t=>`${t.item} valitud.`};var pl={};pl={deselectedItem:t=>`Kohdetta ${t.item} ei valittu.`,longPressToSelect:"Siirry valintatilaan painamalla pitk\xE4\xE4n.",select:"Valitse",selectedAll:"Kaikki kohteet valittu.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Ei yht\xE4\xE4n kohdetta valittu",one:()=>`${e.number(t.count)} kohde valittu`,other:()=>`${e.number(t.count)} kohdetta valittu`})}.`,selectedItem:t=>`${t.item} valittu.`};var hl={};hl={deselectedItem:t=>`${t.item} non s\xE9lectionn\xE9.`,longPressToSelect:"Appuyez de mani\xE8re prolong\xE9e pour passer en mode de s\xE9lection.",select:"S\xE9lectionner",selectedAll:"Tous les \xE9l\xE9ments s\xE9lectionn\xE9s.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Aucun \xE9l\xE9ment s\xE9lectionn\xE9",one:()=>`${e.number(t.count)} \xE9l\xE9ment s\xE9lectionn\xE9`,other:()=>`${e.number(t.count)} \xE9l\xE9ments s\xE9lectionn\xE9s`})}.`,selectedItem:t=>`${t.item} s\xE9lectionn\xE9.`};var gl={};gl={deselectedItem:t=>`${t.item} \u05DC\u05D0 \u05E0\u05D1\u05D7\u05E8.`,longPressToSelect:"\u05D4\u05E7\u05E9\u05D4 \u05D0\u05E8\u05D5\u05DB\u05D4 \u05DC\u05DB\u05E0\u05D9\u05E1\u05D4 \u05DC\u05DE\u05E6\u05D1 \u05D1\u05D7\u05D9\u05E8\u05D4.",select:"\u05D1\u05D7\u05E8",selectedAll:"\u05DB\u05DC \u05D4\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD \u05E0\u05D1\u05D7\u05E8\u05D5.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"\u05DC\u05D0 \u05E0\u05D1\u05D7\u05E8\u05D5 \u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",one:()=>`\u05E4\u05E8\u05D9\u05D8 ${e.number(t.count)} \u05E0\u05D1\u05D7\u05E8`,other:()=>`${e.number(t.count)} \u05E4\u05E8\u05D9\u05D8\u05D9\u05DD \u05E0\u05D1\u05D7\u05E8\u05D5`})}.`,selectedItem:t=>`${t.item} \u05E0\u05D1\u05D7\u05E8.`};var fl={};fl={deselectedItem:t=>`Stavka ${t.item} nije odabrana.`,longPressToSelect:"Dugo pritisnite za ulazak u na\u010Din odabira.",select:"Odaberite",selectedAll:"Odabrane su sve stavke.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Nije odabrana nijedna stavka",one:()=>`Odabrana je ${e.number(t.count)} stavka`,other:()=>`Odabrano je ${e.number(t.count)} stavki`})}.`,selectedItem:t=>`Stavka ${t.item} je odabrana.`};var xl={};xl={deselectedItem:t=>`${t.item} nincs kijel\xF6lve.`,longPressToSelect:"Nyomja hosszan a kijel\xF6l\xE9shez.",select:"Kijel\xF6l\xE9s",selectedAll:"Az \xF6sszes elem kijel\xF6lve.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Egy elem sincs kijel\xF6lve",one:()=>`${e.number(t.count)} elem kijel\xF6lve`,other:()=>`${e.number(t.count)} elem kijel\xF6lve`})}.`,selectedItem:t=>`${t.item} kijel\xF6lve.`};var yl={};yl={deselectedItem:t=>`${t.item} non selezionato.`,longPressToSelect:"Premi a lungo per passare alla modalit\xE0 di selezione.",select:"Seleziona",selectedAll:"Tutti gli elementi selezionati.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Nessun elemento selezionato",one:()=>`${e.number(t.count)} elemento selezionato`,other:()=>`${e.number(t.count)} elementi selezionati`})}.`,selectedItem:t=>`${t.item} selezionato.`};var vl={};vl={deselectedItem:t=>`${t.item} \u304C\u9078\u629E\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002`,longPressToSelect:"\u9577\u62BC\u3057\u3057\u3066\u9078\u629E\u30E2\u30FC\u30C9\u3092\u958B\u304D\u307E\u3059\u3002",select:"\u9078\u629E",selectedAll:"\u3059\u3079\u3066\u306E\u9805\u76EE\u3092\u9078\u629E\u3057\u307E\u3057\u305F\u3002",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"\u9805\u76EE\u304C\u9078\u629E\u3055\u308C\u3066\u3044\u307E\u305B\u3093",one:()=>`${e.number(t.count)} \u9805\u76EE\u3092\u9078\u629E\u3057\u307E\u3057\u305F`,other:()=>`${e.number(t.count)} \u9805\u76EE\u3092\u9078\u629E\u3057\u307E\u3057\u305F`})}\u3002`,selectedItem:t=>`${t.item} \u3092\u9078\u629E\u3057\u307E\u3057\u305F\u3002`};var bl={};bl={deselectedItem:t=>`${t.item}\uC774(\uAC00) \uC120\uD0DD\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4.`,longPressToSelect:"\uC120\uD0DD \uBAA8\uB4DC\uB85C \uB4E4\uC5B4\uAC00\uB824\uBA74 \uAE38\uAC8C \uB204\uB974\uC2ED\uC2DC\uC624.",select:"\uC120\uD0DD",selectedAll:"\uBAA8\uB4E0 \uD56D\uBAA9\uC774 \uC120\uD0DD\uB418\uC5C8\uC2B5\uB2C8\uB2E4.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"\uC120\uD0DD\uB41C \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4",one:()=>`${e.number(t.count)}\uAC1C \uD56D\uBAA9\uC774 \uC120\uD0DD\uB418\uC5C8\uC2B5\uB2C8\uB2E4`,other:()=>`${e.number(t.count)}\uAC1C \uD56D\uBAA9\uC774 \uC120\uD0DD\uB418\uC5C8\uC2B5\uB2C8\uB2E4`})}.`,selectedItem:t=>`${t.item}\uC774(\uAC00) \uC120\uD0DD\uB418\uC5C8\uC2B5\uB2C8\uB2E4.`};var kl={};kl={deselectedItem:t=>`${t.item} nepasirinkta.`,longPressToSelect:"Nor\u0117dami \u012Fjungti pasirinkimo re\u017Eim\u0105, paspauskite ir palaikykite.",select:"Pasirinkti",selectedAll:"Pasirinkti visi elementai.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Nepasirinktas n\u0117 vienas elementas",one:()=>`Pasirinktas ${e.number(t.count)} elementas`,other:()=>`Pasirinkta element\u0173: ${e.number(t.count)}`})}.`,selectedItem:t=>`Pasirinkta: ${t.item}.`};var jl={};jl={deselectedItem:t=>`Vienums ${t.item} nav atlas\u012Bts.`,longPressToSelect:"Ilgi turiet nospiestu. lai iesl\u0113gtu atlases re\u017E\u012Bmu.",select:"Atlas\u012Bt",selectedAll:"Atlas\u012Bti visi vienumi.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Nav atlas\u012Bts neviens vienums",one:()=>`Atlas\u012Bto vienumu skaits: ${e.number(t.count)}`,other:()=>`Atlas\u012Bto vienumu skaits: ${e.number(t.count)}`})}.`,selectedItem:t=>`Atlas\u012Bts vienums ${t.item}.`};var wl={};wl={deselectedItem:t=>`${t.item} er ikke valgt.`,longPressToSelect:"Bruk et langt trykk for \xE5 g\xE5 inn i valgmodus.",select:"Velg",selectedAll:"Alle elementer er valgt.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Ingen elementer er valgt",one:()=>`${e.number(t.count)} element er valgt`,other:()=>`${e.number(t.count)} elementer er valgt`})}.`,selectedItem:t=>`${t.item} er valgt.`};var Cl={};Cl={deselectedItem:t=>`${t.item} niet geselecteerd.`,longPressToSelect:"Druk lang om de selectiemodus te openen.",select:"Selecteren",selectedAll:"Alle items geselecteerd.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Geen items geselecteerd",one:()=>`${e.number(t.count)} item geselecteerd`,other:()=>`${e.number(t.count)} items geselecteerd`})}.`,selectedItem:t=>`${t.item} geselecteerd.`};var _l={};_l={deselectedItem:t=>`Nie zaznaczono ${t.item}.`,longPressToSelect:"Naci\u015Bnij i przytrzymaj, aby wej\u015B\u0107 do trybu wyboru.",select:"Zaznacz",selectedAll:"Wszystkie zaznaczone elementy.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Nie zaznaczono \u017Cadnych element\xF3w",one:()=>`${e.number(t.count)} zaznaczony element`,other:()=>`${e.number(t.count)} zaznaczonych element\xF3w`})}.`,selectedItem:t=>`Zaznaczono ${t.item}.`};var Sl={};Sl={deselectedItem:t=>`${t.item} n\xE3o selecionado.`,longPressToSelect:"Mantenha pressionado para entrar no modo de sele\xE7\xE3o.",select:"Selecionar",selectedAll:"Todos os itens selecionados.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Nenhum item selecionado",one:()=>`${e.number(t.count)} item selecionado`,other:()=>`${e.number(t.count)} itens selecionados`})}.`,selectedItem:t=>`${t.item} selecionado.`};var Nl={};Nl={deselectedItem:t=>`${t.item} n\xE3o selecionado.`,longPressToSelect:"Prima continuamente para entrar no modo de sele\xE7\xE3o.",select:"Selecionar",selectedAll:"Todos os itens selecionados.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Nenhum item selecionado",one:()=>`${e.number(t.count)} item selecionado`,other:()=>`${e.number(t.count)} itens selecionados`})}.`,selectedItem:t=>`${t.item} selecionado.`};var Il={};Il={deselectedItem:t=>`${t.item} neselectat.`,longPressToSelect:"Ap\u0103sa\u021Bi lung pentru a intra \xEEn modul de selectare.",select:"Selectare",selectedAll:"Toate elementele selectate.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Niciun element selectat",one:()=>`${e.number(t.count)} element selectat`,other:()=>`${e.number(t.count)} elemente selectate`})}.`,selectedItem:t=>`${t.item} selectat.`};var Ml={};Ml={deselectedItem:t=>`${t.item} \u043D\u0435 \u0432\u044B\u0431\u0440\u0430\u043D\u043E.`,longPressToSelect:"\u041D\u0430\u0436\u043C\u0438\u0442\u0435 \u0438 \u0443\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0439\u0442\u0435 \u0434\u043B\u044F \u0432\u0445\u043E\u0434\u0430 \u0432 \u0440\u0435\u0436\u0438\u043C \u0432\u044B\u0431\u043E\u0440\u0430.",select:"\u0412\u044B\u0431\u0440\u0430\u0442\u044C",selectedAll:"\u0412\u044B\u0431\u0440\u0430\u043D\u044B \u0432\u0441\u0435 \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"\u041D\u0435\u0442 \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0445 \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432",one:()=>`${e.number(t.count)} \u044D\u043B\u0435\u043C\u0435\u043D\u0442 \u0432\u044B\u0431\u0440\u0430\u043D`,other:()=>`${e.number(t.count)} \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432 \u0432\u044B\u0431\u0440\u0430\u043D\u043E`})}.`,selectedItem:t=>`${t.item} \u0432\u044B\u0431\u0440\u0430\u043D\u043E.`};var Kl={};Kl={deselectedItem:t=>`Nevybrat\xE9 polo\u017Eky: ${t.item}.`,longPressToSelect:"Dlh\u0161\xEDm stla\u010Den\xEDm prejdite do re\u017Eimu v\xFDberu.",select:"Vybra\u0165",selectedAll:"V\u0161etky vybrat\xE9 polo\u017Eky.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"\u017Diadne vybrat\xE9 polo\u017Eky",one:()=>`${e.number(t.count)} vybrat\xE1 polo\u017Eka`,other:()=>`Po\u010Det vybrat\xFDch polo\u017Eiek:${e.number(t.count)}`})}.`,selectedItem:t=>`Vybrat\xE9 polo\u017Eky: ${t.item}.`};var Dl={};Dl={deselectedItem:t=>`Element ${t.item} ni izbran.`,longPressToSelect:"Za izbirni na\u010Din pritisnite in dlje \u010Dasa dr\u017Eite.",select:"Izberite",selectedAll:"Vsi elementi so izbrani.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Noben element ni izbran",one:()=>`${e.number(t.count)} element je izbran`,other:()=>`${e.number(t.count)} elementov je izbranih`})}.`,selectedItem:t=>`Element ${t.item} je izbran.`};var Al={};Al={deselectedItem:t=>`${t.item} nije izabrano.`,longPressToSelect:"Dugo pritisnite za ulazak u re\u017Eim biranja.",select:"Izaberite",selectedAll:"Izabrane su sve stavke.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Nije izabrana nijedna stavka",one:()=>`Izabrana je ${e.number(t.count)} stavka`,other:()=>`Izabrano je ${e.number(t.count)} stavki`})}.`,selectedItem:t=>`${t.item} je izabrano.`};var Pl={};Pl={deselectedItem:t=>`${t.item} ej markerat.`,longPressToSelect:"Tryck l\xE4nge n\xE4r du vill \xF6ppna v\xE4ljarl\xE4ge.",select:"Markera",selectedAll:"Alla markerade objekt.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Inga markerade objekt",one:()=>`${e.number(t.count)} markerat objekt`,other:()=>`${e.number(t.count)} markerade objekt`})}.`,selectedItem:t=>`${t.item} markerat.`};var El={};El={deselectedItem:t=>`${t.item} se\xE7ilmedi.`,longPressToSelect:"Se\xE7im moduna girmek i\xE7in uzun bas\u0131n.",select:"Se\xE7",selectedAll:"T\xFCm \xF6geler se\xE7ildi.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Hi\xE7bir \xF6ge se\xE7ilmedi",one:()=>`${e.number(t.count)} \xF6ge se\xE7ildi`,other:()=>`${e.number(t.count)} \xF6ge se\xE7ildi`})}.`,selectedItem:t=>`${t.item} se\xE7ildi.`};var Tl={};Tl={deselectedItem:t=>`${t.item} \u043D\u0435 \u0432\u0438\u0431\u0440\u0430\u043D\u043E.`,longPressToSelect:"\u0412\u0438\u043A\u043E\u043D\u0430\u0439\u0442\u0435 \u0434\u043E\u0432\u0433\u0435 \u043D\u0430\u0442\u0438\u0441\u043D\u0435\u043D\u043D\u044F, \u0449\u043E\u0431 \u043F\u0435\u0440\u0435\u0439\u0442\u0438 \u0432 \u0440\u0435\u0436\u0438\u043C \u0432\u0438\u0431\u043E\u0440\u0443.",select:"\u0412\u0438\u0431\u0440\u0430\u0442\u0438",selectedAll:"\u0423\u0441\u0456 \u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438 \u0432\u0438\u0431\u0440\u0430\u043D\u043E.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"\u0416\u043E\u0434\u043D\u0438\u0445 \u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432 \u043D\u0435 \u0432\u0438\u0431\u0440\u0430\u043D\u043E",one:()=>`${e.number(t.count)} \u0435\u043B\u0435\u043C\u0435\u043D\u0442 \u0432\u0438\u0431\u0440\u0430\u043D\u043E`,other:()=>`\u0412\u0438\u0431\u0440\u0430\u043D\u043E \u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432: ${e.number(t.count)}`})}.`,selectedItem:t=>`${t.item} \u0432\u0438\u0431\u0440\u0430\u043D\u043E.`};var Bl={};Bl={deselectedItem:t=>`\u672A\u9009\u62E9 ${t.item}\u3002`,longPressToSelect:"\u957F\u6309\u4EE5\u8FDB\u5165\u9009\u62E9\u6A21\u5F0F\u3002",select:"\u9009\u62E9",selectedAll:"\u5DF2\u9009\u62E9\u6240\u6709\u9879\u76EE\u3002",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"\u672A\u9009\u62E9\u9879\u76EE",one:()=>`\u5DF2\u9009\u62E9 ${e.number(t.count)} \u4E2A\u9879\u76EE`,other:()=>`\u5DF2\u9009\u62E9 ${e.number(t.count)} \u4E2A\u9879\u76EE`})}\u3002`,selectedItem:t=>`\u5DF2\u9009\u62E9 ${t.item}\u3002`};var Fl={};Fl={deselectedItem:t=>`\u672A\u9078\u53D6\u300C${t.item}\u300D\u3002`,longPressToSelect:"\u9577\u6309\u4EE5\u9032\u5165\u9078\u64C7\u6A21\u5F0F\u3002",select:"\u9078\u53D6",selectedAll:"\u5DF2\u9078\u53D6\u6240\u6709\u9805\u76EE\u3002",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"\u672A\u9078\u53D6\u4EFB\u4F55\u9805\u76EE",one:()=>`\u5DF2\u9078\u53D6 ${e.number(t.count)} \u500B\u9805\u76EE`,other:()=>`\u5DF2\u9078\u53D6 ${e.number(t.count)} \u500B\u9805\u76EE`})}\u3002`,selectedItem:t=>`\u5DF2\u9078\u53D6\u300C${t.item}\u300D\u3002`};var Wt={};Wt={"ar-AE":ll,"bg-BG":sl,"cs-CZ":al,"da-DK":ol,"de-DE":rl,"el-GR":cl,"en-US":dl,"es-ES":ul,"et-EE":ml,"fi-FI":pl,"fr-FR":hl,"he-IL":gl,"hr-HR":fl,"hu-HU":xl,"it-IT":yl,"ja-JP":vl,"ko-KR":bl,"lt-LT":kl,"lv-LV":jl,"nb-NO":wl,"nl-NL":Cl,"pl-PL":_l,"pt-BR":Sl,"pt-PT":Nl,"ro-RO":Il,"ru-RU":Ml,"sk-SK":Kl,"sl-SI":Dl,"sr-SP":Al,"sv-SE":Pl,"tr-TR":El,"uk-UA":Tl,"zh-CN":Bl,"zh-TW":Fl};function Dc(t){return t&&t.__esModule?t.default:t}function Ac(t,e){let{getRowText:i=c=>{var d,u;var r;return((d=(r=e.collection).getTextValue)==null?void 0:d.call(r,c))??((u=e.collection.getItem(c))==null?void 0:u.textValue)}}=t,l=Ot(Dc(Wt),"@react-aria/grid"),s=e.selectionManager.rawSelection,a=(0,h.useRef)(s),o=(0,h.useCallback)(()=>{var p;if(!e.selectionManager.isFocused||s===a.current){a.current=s;return}let c=zl(s,a.current),r=zl(a.current,s),d=e.selectionManager.selectionBehavior==="replace",u=[];if(e.selectionManager.selectedKeys.size===1&&d){let g=e.selectionManager.selectedKeys.keys().next().value;if(g!=null&&e.collection.getItem(g)){let x=i(g);x&&u.push(l.format("selectedItem",{item:x}))}}else if(c.size===1&&r.size===0){let g=c.keys().next().value;if(g!=null){let x=i(g);x&&u.push(l.format("selectedItem",{item:x}))}}else if(r.size===1&&c.size===0){let g=r.keys().next().value;if(g!=null&&e.collection.getItem(g)){let x=i(g);x&&u.push(l.format("deselectedItem",{item:x}))}}e.selectionManager.selectionMode==="multiple"&&(u.length===0||s==="all"||s.size>1||a.current==="all"||((p=a.current)==null?void 0:p.size)>1)&&u.push(s==="all"?l.format("selectedAll"):l.format("selectedCount",{count:s.size})),u.length>0&&cr(u.join(" ")),a.current=s},[s,e.selectionManager.selectedKeys,e.selectionManager.isFocused,e.selectionManager.selectionBehavior,e.selectionManager.selectionMode,e.collection,i,l]);Tr(()=>{if(e.selectionManager.isFocused)o();else{let c=requestAnimationFrame(o);return()=>cancelAnimationFrame(c)}},[s,e.selectionManager.isFocused])}function zl(t,e){let i=new Set;if(t==="all"||e==="all")return i;for(let l of t.keys())e.has(l)||i.add(l);return i}function Pc(t){return t&&t.__esModule?t.default:t}function Ec(t){let e=Ot(Pc(Wt),"@react-aria/grid"),i=xr(),l=(i==="pointer"||i==="virtual"||i==null)&&typeof window<"u"&&"ontouchstart"in window;return Pn((0,h.useMemo)(()=>{let s=t.selectionManager.selectionMode,a=t.selectionManager.selectionBehavior,o;return l&&(o=e.format("longPressToSelect")),a==="replace"&&s!=="none"&&t.hasItemActions?o:void 0},[t.selectionManager.selectionMode,t.selectionManager.selectionBehavior,t.hasItemActions,e,l]))}function Tc(t){return t&&t.__esModule?t.default:t}function Bc(t,e){let{key:i}=t,l=e.selectionManager,s=jt(),a=!e.selectionManager.canSelectItem(i),o=e.selectionManager.isSelected(i),c=()=>l.toggleSelection(i),r=Ot(Tc(Wt),"@react-aria/grid");return{checkboxProps:{id:s,"aria-label":r.format("select"),isSelected:o,isDisabled:a,onChange:c}}}function Fc(t,e,i){let{isVirtualized:l,keyboardDelegate:s,layoutDelegate:a,onAction:o,disallowTypeAhead:c,linkBehavior:r="action",keyboardNavigationBehavior:d="arrow",escapeKeyBehavior:u="clearSelection",shouldSelectOnPressUp:p}=t;!t["aria-label"]&&!t["aria-labelledby"]&&console.warn("An aria-label or aria-labelledby prop is required for accessibility.");let{listProps:g}=Jn({selectionManager:e.selectionManager,collection:e.collection,disabledKeys:e.disabledKeys,ref:i,keyboardDelegate:s,layoutDelegate:a,isVirtualized:l,selectOnFocus:e.selectionManager.selectionBehavior==="replace",shouldFocusWrap:t.shouldFocusWrap,linkBehavior:r,disallowTypeAhead:c,autoFocus:t.autoFocus,escapeKeyBehavior:u}),x=jt(t.id);Si.set(e,{id:x,onAction:o,linkBehavior:r,keyboardNavigationBehavior:d,shouldSelectOnPressUp:p});let v=Ec({selectionManager:e.selectionManager,hasItemActions:!!o}),j=fc(i,{isDisabled:e.collection.size!==0}),C=Ve($t(t,{labelable:!0}),{role:"grid",id:x,"aria-multiselectable":e.selectionManager.selectionMode==="multiple"?"true":void 0},e.collection.size===0?{tabIndex:j?-1:0}:g,v);return l&&(C["aria-rowcount"]=e.collection.size,C["aria-colcount"]=1),Ac({},e),{gridProps:C}}var Ol={expand:{ltr:"ArrowRight",rtl:"ArrowLeft"},collapse:{ltr:"ArrowLeft",rtl:"ArrowRight"}};function zc(t,e,i){var A,B,M;let{node:l,isVirtualized:s}=t,{direction:a}=Ht(),{onAction:o,linkBehavior:c,keyboardNavigationBehavior:r,shouldSelectOnPressUp:d}=Si.get(e),u=Dr(),p=(0,h.useRef)(null),g=()=>{i.current!==null&&(p.current!=null&&l.key!==p.current||!fi(i.current))&&He(i.current)},x={},v=t.hasChildItems,j=e.selectionManager.isLink(l.key);if(l!=null&&"expandedKeys"in e){var C;let w=(A=(C=e.collection).getChildren)==null?void 0:A.call(C,l.key);v||(v=[...w??[]].length>1),o==null&&!j&&e.selectionManager.selectionMode==="none"&&v&&(o=()=>e.toggleKey(l.key));let K=v?e.expandedKeys.has(l.key):void 0,k=1,D=l.index;if(l.level>=0&&(l==null?void 0:l.parentKey)!=null){let T=e.collection.getItem(l.parentKey);if(T){let F=Oc(T,e.collection);k=[...F].filter(U=>U.type==="item").length,D>0&&F[0].type!=="item"&&--D}}else k=[...e.collection].filter(T=>T.level===0&&T.type==="item").length;x={"aria-expanded":K,"aria-level":l.level+1,"aria-posinset":D+1,"aria-setsize":k}}let{itemProps:I,...b}=Qn({selectionManager:e.selectionManager,key:l.key,ref:i,isVirtualized:s,shouldSelectOnPressUp:t.shouldSelectOnPressUp||d,onAction:o||(B=l.props)!=null&&B.onAction?In((M=l.props)==null?void 0:M.onAction,o?()=>o(l.key):void 0):void 0,focus:g,linkBehavior:c}),_=w=>{let K=ut();if(!et(w.currentTarget,Ue(w))||!i.current||!K)return;let k=Gt(i.current);if(k.currentNode=K,"expandedKeys"in e&&K===i.current){if(w.key===Ol.expand[a]&&e.selectionManager.focusedKey===l.key&&v&&!e.expandedKeys.has(l.key)){e.toggleKey(l.key),w.stopPropagation();return}else if(w.key===Ol.collapse[a]&&e.selectionManager.focusedKey===l.key&&v&&e.expandedKeys.has(l.key)){e.toggleKey(l.key),w.stopPropagation();return}}switch(w.key){case"ArrowLeft":if(r==="arrow"){let T=a==="rtl"?k.nextNode():k.previousNode();if(T)w.preventDefault(),w.stopPropagation(),He(T),tt(T,{containingElement:lt(i.current)});else if(w.preventDefault(),w.stopPropagation(),a==="rtl")He(i.current),tt(i.current,{containingElement:lt(i.current)});else{k.currentNode=i.current;let F=Vl(k);F&&(He(F),tt(F,{containingElement:lt(i.current)}))}}break;case"ArrowRight":if(r==="arrow"){let T=a==="rtl"?k.previousNode():k.nextNode();if(T)w.preventDefault(),w.stopPropagation(),He(T),tt(T,{containingElement:lt(i.current)});else if(w.preventDefault(),w.stopPropagation(),a==="ltr")He(i.current),tt(i.current,{containingElement:lt(i.current)});else{k.currentNode=i.current;let F=Vl(k);F&&(He(F),tt(F,{containingElement:lt(i.current)}))}}break;case"ArrowUp":case"ArrowDown":if(!w.altKey&&et(i.current,Ue(w))){var D;w.stopPropagation(),w.preventDefault(),(D=i.current.parentElement)==null||D.dispatchEvent(new KeyboardEvent(w.nativeEvent.type,w.nativeEvent))}break}},S=w=>{if(p.current=l.key,Ue(w)!==i.current){yr()||e.selectionManager.setFocusedKey(l.key);return}},f=w=>{let K=ut();if(!(!et(w.currentTarget,Ue(w))||!i.current||!K))switch(w.key){case"Tab":if(r==="tab"){let k=Gt(i.current,{tabbable:!0});k.currentNode=K,(w.shiftKey?k.previousNode():k.nextNode())&&w.stopPropagation()}}},m=Kr(l.props),y=Ve(I,b.hasAction?m:{},{role:"row",onKeyDownCapture:_,onKeyDown:f,onFocus:S,"aria-label":l["aria-label"]||l.textValue||void 0,"aria-selected":e.selectionManager.canSelectItem(l.key)?e.selectionManager.isSelected(l.key):void 0,"aria-disabled":e.selectionManager.isDisabled(l.key)||void 0,"aria-labelledby":u&&(l["aria-label"]||l.textValue)?`${Ni(e,l.key)} ${u}`:void 0,id:Ni(e,l.key)});if(s){let{collection:w}=e;y["aria-rowindex"]=[...w].find(K=>K.type==="section")?[...w.getKeys()].filter(K=>{var k;return((k=w.getItem(K))==null?void 0:k.type)!=="section"}).findIndex(K=>K===l.key)+1:l.index+1}let P={role:"gridcell","aria-colindex":1};return{rowProps:{...Ve(y,x)},gridCellProps:P,descriptionProps:{id:u},...b}}function Vl(t){let e=null,i=null;do i=t.lastChild(),i&&(e=i);while(i);return e}function Oc(t,e){var o;let i=(o=e.getChildren)==null?void 0:o.call(e,t.key),l=i?Array.from(i):[],s=l.length>0?l[0]:null,a=[];for(;s;)a.push(s),s=s.nextKey==null?null:e.getItem(s.nextKey);return a}function Vc(t,e){let{key:i}=t,{checkboxProps:l}=Bc(t,e);return{checkboxProps:{...l,"aria-labelledby":`${l.id} ${Ni(e,i)}`}}}function Rc(t,e,i){let{gridProps:l}=Fc(t,e,i);return l.role="treegrid",{gridProps:l}}var Rl={};Rl={collapse:"\u0637\u064A",expand:"\u062A\u0645\u062F\u064A\u062F"};var $l={};$l={collapse:"\u0421\u0432\u0438\u0432\u0430\u043D\u0435",expand:"\u0420\u0430\u0437\u0448\u0438\u0440\u044F\u0432\u0430\u043D\u0435"};var Ll={};Ll={collapse:"Sbalit",expand:"Rozt\xE1hnout"};var Gl={};Gl={collapse:"Skjul",expand:"Udvid"};var Hl={};Hl={collapse:"Reduzieren",expand:"Erweitern"};var Ul={};Ul={collapse:"\u03A3\u03CD\u03BC\u03C0\u03C4\u03C5\u03BE\u03B7",expand:"\u0391\u03BD\u03AC\u03C0\u03C4\u03C5\u03BE\u03B7"};var ql={};ql={expand:"Expand",collapse:"Collapse"};var Wl={};Wl={collapse:"Contraer",expand:"Ampliar"};var Ql={};Ql={collapse:"Ahenda",expand:"Laienda"};var Yl={};Yl={collapse:"Pienenn\xE4",expand:"Laajenna"};var Zl={};Zl={collapse:"R\xE9duire",expand:"D\xE9velopper"};var Xl={};Xl={collapse:"\u05DB\u05D5\u05D5\u05E5",expand:"\u05D4\u05E8\u05D7\u05D1"};var Jl={};Jl={collapse:"Sa\u017Emi",expand:"Pro\u0161iri"};var es={};es={collapse:"\xD6sszecsuk\xE1s",expand:"Kibont\xE1s"};var ts={};ts={collapse:"Comprimi",expand:"Espandi"};var is={};is={collapse:"\u6298\u308A\u305F\u305F\u3080",expand:"\u5C55\u958B"};var ns={};ns={collapse:"\uC811\uAE30",expand:"\uD3BC\uCE58\uAE30"};var ls={};ls={collapse:"Sutraukti",expand:"I\u0161skleisti"};var ss={};ss={collapse:"Sak\u013Caut",expand:"Izv\u0113rst"};var as={};as={collapse:"Skjul",expand:"Utvid"};var os={};os={collapse:"Samenvouwen",expand:"Uitvouwen"};var rs={};rs={collapse:"Zwi\u0144",expand:"Rozwi\u0144"};var cs={};cs={collapse:"Recolher",expand:"Expandir"};var ds={};ds={collapse:"Colapsar",expand:"Expandir"};var us={};us={collapse:"Restr\xE2nge\u021Bi",expand:"Extinde\u021Bi"};var ms={};ms={collapse:"\u0421\u0432\u0435\u0440\u043D\u0443\u0442\u044C",expand:"\u0420\u0430\u0437\u0432\u0435\u0440\u043D\u0443\u0442\u044C"};var ps={};ps={collapse:"Zbali\u0165",expand:"Rozbali\u0165"};var hs={};hs={collapse:"Strni",expand:"Raz\u0161iri"};var gs={};gs={collapse:" Skupi",expand:"Pro\u0161iri"};var fs={};fs={collapse:"D\xF6lj",expand:"Expandera"};var xs={};xs={collapse:"Daralt",expand:"Geni\u015Flet"};var ys={};ys={collapse:"\u0417\u0433\u043E\u0440\u043D\u0443\u0442\u0438",expand:"\u0420\u043E\u0437\u0433\u043E\u0440\u043D\u0443\u0442\u0438"};var vs={};vs={collapse:"\u6298\u53E0",expand:"\u6269\u5C55"};var bs={};bs={collapse:"\u6536\u5408",expand:"\u5C55\u958B"};var ks={};ks={"ar-AE":Rl,"bg-BG":$l,"cs-CZ":Ll,"da-DK":Gl,"de-DE":Hl,"el-GR":Ul,"en-US":ql,"es-ES":Wl,"et-EE":Ql,"fi-FI":Yl,"fr-FR":Zl,"he-IL":Xl,"hr-HR":Jl,"hu-HU":es,"it-IT":ts,"ja-JP":is,"ko-KR":ns,"lt-LT":ls,"lv-LV":ss,"nb-NO":as,"nl-NL":os,"pl-PL":rs,"pt-BR":cs,"pt-PT":ds,"ro-RO":us,"ru-RU":ms,"sk-SK":ps,"sl-SI":hs,"sr-SP":gs,"sv-SE":fs,"tr-TR":xs,"uk-UA":ys,"zh-CN":vs,"zh-TW":bs};function $c(t){return t&&t.__esModule?t.default:t}function js(t,e,i){let{node:l}=t,s=zc(t,e,i),a=s.rowProps["aria-expanded"]===!0,o=Ot($c(ks),"@react-aria/tree"),c=fr({"aria-label":a?o.format("collapse"):o.format("expand"),"aria-labelledby":s.rowProps.id}),r={onPress:()=>{s.isDisabled||(e.toggleKey(l.key),e.selectionManager.setFocused(!0),e.selectionManager.setFocusedKey(l.key))},excludeFromTabOrder:!0,preventFocusOnPress:!0,"data-react-aria-prevent-focus":!0,...c};return{...s,expandButtonProps:r}}var st=class{get childNodes(){throw Error("childNodes is not supported")}clone(){let t=new this.constructor(this.key);return t.value=this.value,t.level=this.level,t.hasChildNodes=this.hasChildNodes,t.rendered=this.rendered,t.textValue=this.textValue,t["aria-label"]=this["aria-label"],t.index=this.index,t.parentKey=this.parentKey,t.prevKey=this.prevKey,t.nextKey=this.nextKey,t.firstChildKey=this.firstChildKey,t.lastChildKey=this.lastChildKey,t.props=this.props,t.render=this.render,t.colSpan=this.colSpan,t.colIndex=this.colIndex,t}filter(t,e,i){let l=this.clone();return e.addDescendants(l,t),l}constructor(t){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=t}},ws=class extends st{filter(t,e,i){let[l,s]=Ss(t,e,this.firstChildKey,i),a=this.clone();return a.firstChildKey=l,a.lastChildKey=s,a}},Lc=class extends st{};Lc.type="header";var Ii=class extends st{};Ii.type="loader";var Cs=class extends ws{filter(t,e,i){if(i(this.textValue,this)){let l=this.clone();return e.addDescendants(l,t),l}return null}};Cs.type="item";var Gc=class extends ws{filter(t,e,i){let l=super.filter(t,e,i);if(l&&l.lastChildKey!==null){let s=t.getItem(l.lastChildKey);if(s&&s.type!=="header")return l}return null}};Gc.type="section";var _s=class{get size(){return this.itemCount}getKeys(){return this.keyMap.keys()}*[Symbol.iterator](){let t=this.firstKey==null?void 0:this.keyMap.get(this.firstKey);for(;t;)yield t,t=t.nextKey==null?void 0:this.keyMap.get(t.nextKey)}getChildren(t){let e=this.keyMap;return{*[Symbol.iterator](){let i=e.get(t),l=(i==null?void 0:i.firstChildKey)==null?null:e.get(i.firstChildKey);for(;l;)yield l,l=l.nextKey==null?void 0:e.get(l.nextKey)}}}getKeyBefore(t){let e=this.keyMap.get(t);if(!e)return null;if(e.prevKey!=null){for(e=this.keyMap.get(e.prevKey);e&&e.type!=="item"&&e.lastChildKey!=null;)e=this.keyMap.get(e.lastChildKey);return(e==null?void 0:e.key)??null}return e.parentKey}getKeyAfter(t){let e=this.keyMap.get(t);if(!e)return null;if(e.type!=="item"&&e.firstChildKey!=null)return e.firstChildKey;for(;e;){if(e.nextKey!=null)return e.nextKey;if(e.parentKey!=null)e=this.keyMap.get(e.parentKey);else return null}return null}getFirstKey(){return this.firstKey}getLastKey(){let t=this.lastKey==null?null:this.keyMap.get(this.lastKey);for(;(t==null?void 0:t.lastChildKey)!=null;)t=this.keyMap.get(t.lastChildKey);return(t==null?void 0:t.key)??null}getItem(t){return this.keyMap.get(t)??null}at(){throw Error("Not implemented")}clone(){let t=this.constructor,e=new t;return e.keyMap=new Map(this.keyMap),e.firstKey=this.firstKey,e.lastKey=this.lastKey,e.itemCount=this.itemCount,e}addNode(t){if(this.frozen)throw Error("Cannot add a node to a frozen collection");t.type==="item"&&this.keyMap.get(t.key)==null&&this.itemCount++,this.keyMap.set(t.key,t)}addDescendants(t,e){this.addNode(t);let i=e.getChildren(t.key);for(let l of i)this.addDescendants(l,e)}removeNode(t){if(this.frozen)throw Error("Cannot remove a node to a frozen collection");let e=this.keyMap.get(t);e!=null&&e.type==="item"&&this.itemCount--,this.keyMap.delete(t)}commit(t,e,i=!1){if(this.frozen)throw Error("Cannot commit a frozen collection");this.firstKey=t,this.lastKey=e,this.frozen=!i}filter(t){let e=new this.constructor,[i,l]=Ss(this,e,this.firstKey,t);return e==null||e.commit(i,l),e}constructor(){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.frozen=!1,this.itemCount=0}};function Ss(t,e,i,l){if(i==null)return[null,null];let s=null,a=null,o=t.getItem(i);for(;o!=null;){let c=o.filter(t,e,l);c!=null&&(c.nextKey=null,a&&(c.prevKey=a.key,a.nextKey=c.key),s??(s=c),e.addNode(c),a=c),o=o.nextKey?t.getItem(o.nextKey):null}if(a&&a.type==="separator"){let c=a.prevKey;e.removeNode(a.key),c?(a=e.getItem(c),a.nextKey=null):a=null}return[(s==null?void 0:s.key)??null,(a==null?void 0:a.key)??null]}var Ns=class{*[Symbol.iterator](){let t=this.firstChild;for(;t;)yield t,t=t.nextSibling}get firstChild(){return this._firstChild}set firstChild(t){this._firstChild=t,this.ownerDocument.markDirty(this)}get lastChild(){return this._lastChild}set lastChild(t){this._lastChild=t,this.ownerDocument.markDirty(this)}get previousSibling(){return this._previousSibling}set previousSibling(t){this._previousSibling=t,this.ownerDocument.markDirty(this)}get nextSibling(){return this._nextSibling}set nextSibling(t){this._nextSibling=t,this.ownerDocument.markDirty(this)}get parentNode(){return this._parentNode}set parentNode(t){this._parentNode=t,this.ownerDocument.markDirty(this)}get isConnected(){var t;return((t=this.parentNode)==null?void 0:t.isConnected)||!1}invalidateChildIndices(t){(this._minInvalidChildIndex==null||!this._minInvalidChildIndex.isConnected||t.index<this._minInvalidChildIndex.index)&&(this._minInvalidChildIndex=t,this.ownerDocument.markDirty(this))}updateChildIndices(){let t=this._minInvalidChildIndex;for(;t;)t.index=t.previousSibling?t.previousSibling.index+1:0,t=t.nextSibling;this._minInvalidChildIndex=null}appendChild(t){t.parentNode&&t.parentNode.removeChild(t),this.firstChild??(this.firstChild=t),this.lastChild?(this.lastChild.nextSibling=t,t.index=this.lastChild.index+1,t.previousSibling=this.lastChild):(t.previousSibling=null,t.index=0),t.parentNode=this,t.nextSibling=null,this.lastChild=t,this.ownerDocument.markDirty(this),this.isConnected&&this.ownerDocument.queueUpdate()}insertBefore(t,e){if(e==null)return this.appendChild(t);t.parentNode&&t.parentNode.removeChild(t),t.nextSibling=e,t.previousSibling=e.previousSibling,t.index=e.index-1,this.firstChild===e?this.firstChild=t:e.previousSibling&&(e.previousSibling.nextSibling=t),e.previousSibling=t,t.parentNode=e.parentNode,this.invalidateChildIndices(t),this.isConnected&&this.ownerDocument.queueUpdate()}removeChild(t){t.parentNode===this&&(this._minInvalidChildIndex===t&&(this._minInvalidChildIndex=null),t.nextSibling&&(this.invalidateChildIndices(t.nextSibling),t.nextSibling.previousSibling=t.previousSibling),t.previousSibling&&(t.previousSibling.nextSibling=t.nextSibling),this.firstChild===t&&(this.firstChild=t.nextSibling),this.lastChild===t&&(this.lastChild=t.previousSibling),t.parentNode=null,t.nextSibling=null,t.previousSibling=null,t.index=0,this.ownerDocument.markDirty(t),this.isConnected&&this.ownerDocument.queueUpdate())}addEventListener(){}removeEventListener(){}get previousVisibleSibling(){let t=this.previousSibling;for(;t&&t.isHidden;)t=t.previousSibling;return t}get nextVisibleSibling(){let t=this.nextSibling;for(;t&&t.isHidden;)t=t.nextSibling;return t}get firstVisibleChild(){let t=this.firstChild;for(;t&&t.isHidden;)t=t.nextSibling;return t}get lastVisibleChild(){let t=this.lastChild;for(;t&&t.isHidden;)t=t.previousSibling;return t}constructor(t){this._firstChild=null,this._lastChild=null,this._previousSibling=null,this._nextSibling=null,this._parentNode=null,this._minInvalidChildIndex=null,this.ownerDocument=t}},Mi=class Li extends Ns{get index(){return this._index}set index(e){this._index=e,this.ownerDocument.markDirty(this)}get level(){var e;return this.parentNode instanceof Li?this.parentNode.level+(((e=this.parentNode.node)==null?void 0:e.type)==="item"?1:0):0}getMutableNode(){return this.node==null?null:(this.isMutated||(this.isMutated=(this.node=this.node.clone(),!0)),this.ownerDocument.markDirty(this),this.node)}updateNode(){var l,s,a,o,c,r,d,u;let e=this.nextVisibleSibling,i=this.getMutableNode();if(i!=null&&(i.index=this.index,i.level=this.level,i.parentKey=this.parentNode instanceof Li?((l=this.parentNode.node)==null?void 0:l.key)??null:null,i.prevKey=((a=(s=this.previousVisibleSibling)==null?void 0:s.node)==null?void 0:a.key)??null,i.nextKey=((o=e==null?void 0:e.node)==null?void 0:o.key)??null,i.hasChildNodes=!!this.firstChild,i.firstChildKey=((r=(c=this.firstVisibleChild)==null?void 0:c.node)==null?void 0:r.key)??null,i.lastChildKey=((u=(d=this.lastVisibleChild)==null?void 0:d.node)==null?void 0:u.key)??null,(i.colSpan!=null||i.colIndex!=null)&&e)){let p=(i.colIndex??i.index)+(i.colSpan??1);if(e.node!=null&&p!==e.node.colIndex){let g=e.getMutableNode();g.colIndex=p}}}setProps(e,i,l,s,a){let o,{value:c,textValue:r,id:d,...u}=e;if(this.node==null?(o=new l(d??`react-aria-${++this.ownerDocument.nodeId}`),this.node=o):o=this.getMutableNode(),u.ref=i,o.props=u,o.rendered=s,o.render=a,o.value=c,e["aria-label"]&&(o["aria-label"]=e["aria-label"]),o.textValue=r||(typeof u.children=="string"?u.children:"")||e["aria-label"]||"",d!=null&&d!==o.key)throw Error("Cannot change the id of an item");u.colSpan!=null&&(o.colSpan=u.colSpan),this.isConnected&&this.ownerDocument.queueUpdate()}get style(){let e=this;return{get display(){return e.isHidden?"none":""},set display(i){var s,a;let l=i==="none";if(e.isHidden!==l){(((s=e.parentNode)==null?void 0:s.firstVisibleChild)===e||((a=e.parentNode)==null?void 0:a.lastVisibleChild)===e)&&e.ownerDocument.markDirty(e.parentNode);let o=e.previousVisibleSibling,c=e.nextVisibleSibling;o&&e.ownerDocument.markDirty(o),c&&e.ownerDocument.markDirty(c),e.isHidden=l,e.ownerDocument.markDirty(e)}}}}hasAttribute(){}setAttribute(){}setAttributeNS(){}removeAttribute(){}constructor(e,i){super(i),this.nodeType=8,this.isMutated=!0,this._index=0,this.isHidden=!1,this.node=null}},Hc=class extends Ns{get isConnected(){return!0}createElement(t){return new Mi(t,this)}getMutableCollection(){return this.nextCollection||(this.nextCollection=this.collection.clone()),this.nextCollection}markDirty(t){this.dirtyNodes.add(t)}addNode(t){if(t.isHidden||t.node==null)return;let e=this.getMutableCollection();if(!e.getItem(t.node.key))for(let i of t)this.addNode(i);e.addNode(t.node)}removeNode(t){for(let e of t)this.removeNode(e);t.node&&this.getMutableCollection().removeNode(t.node.key)}getCollection(){return this.inSubscription?this.collection:(this.queuedRender=!1,this.updateCollection(),this.collection)}updateCollection(){var t,e,i,l;for(let s of this.dirtyNodes)s instanceof Mi&&(!s.isConnected||s.isHidden)?this.removeNode(s):s.updateChildIndices();for(let s of this.dirtyNodes)s instanceof Mi?(s.isConnected&&!s.isHidden&&(s.updateNode(),this.addNode(s)),s.node&&this.dirtyNodes.delete(s),s.isMutated=!1):this.dirtyNodes.delete(s);this.nextCollection&&(this.nextCollection.commit(((e=(t=this.firstVisibleChild)==null?void 0:t.node)==null?void 0:e.key)??null,((l=(i=this.lastVisibleChild)==null?void 0:i.node)==null?void 0:l.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 t of this.subscriptions)t();this.inSubscription=!1}}subscribe(t){return this.subscriptions.add(t),()=>this.subscriptions.delete(t)}resetAfterSSR(){this.isSSR&&(this.isSSR=!1,this.firstChild=null,this.lastChild=null,this.nodeId=0)}constructor(t){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=t,this.nextCollection=t}};function Ki(t){let{children:e,items:i,idScope:l,addIdAndValue:s,dependencies:a=[]}=t,o=(0,h.useMemo)(()=>new WeakMap,a);return(0,h.useMemo)(()=>{if(i&&typeof e=="function"){let c=[];for(let r of i){let d=o.get(r);if(!d){d=e(r);let u=d.props.id??r.key??r.id;if(u==null)throw Error("Could not determine key for item");l!=null&&(u=l+":"+u),d=(0,h.cloneElement)(d,s?{key:u,id:u,value:r}:{key:u}),o.set(r,d)}c.push(d)}return c}else if(typeof e!="function")return e},[e,i,o,l,s])}var Uc=Xi(),qc=Io(),Is=(0,h.createContext)(!1),Ct=(0,h.createContext)(null);function Ms(t){if((0,h.useContext)(Ct))return t.content;let{collection:e,document:i}=Zc(t.createCollection);return h.createElement(h.Fragment,null,h.createElement(hr,null,h.createElement(Ct.Provider,{value:i},t.content)),h.createElement(Wc,{render:t.children,collection:e}))}function Wc({collection:t,render:e}){return e(t)}function Qc(t,e,i){let l=Dn(),s=(0,h.useRef)(l);return s.current=l,(0,qc.useSyncExternalStore)(t,(0,h.useCallback)(()=>s.current?i():e(),[e,i]))}var Yc=typeof h.useSyncExternalStore=="function"?h.useSyncExternalStore:Qc;function Zc(t){let[e]=(0,h.useState)(()=>new Hc((t==null?void 0:t())||new _s));return{collection:Yc((0,h.useCallback)(i=>e.subscribe(i),[e]),(0,h.useCallback)(()=>{let i=e.getCollection();return e.isSSR&&e.resetAfterSSR(),i},[e]),(0,h.useCallback)(()=>(e.isSSR=!0,e.getCollection()),[e])),document:e}}var Di=(0,h.createContext)(null);function Xc(t){var e;return e=class extends st{},e.type=t,e}function Ks(t,e,i,l,s,a){typeof t=="string"&&(t=Xc(t));let o=(0,h.useCallback)(r=>{r==null||r.setProps(e,i,t,l,a)},[e,i,l,a,t]),c=(0,h.useContext)(Di);if(c){let r=c.ownerDocument.nodesByProps.get(e);return r||(r=c.ownerDocument.createElement(t.type),r.setProps(e,i,t,l,a),c.appendChild(r),c.ownerDocument.updateCollection(),c.ownerDocument.nodesByProps.set(e,r)),s?h.createElement(Di.Provider,{value:r},s):null}return h.createElement(t.type,{ref:o},s)}function Ai(t,e){let i=({node:s})=>e(s.props,s.props.ref,s),l=(0,h.forwardRef)((s,a)=>{let o=(0,h.useContext)(wn);if(!(0,h.useContext)(Is)){if(e.length>=3)throw Error(e.name+" cannot be rendered outside a collection.");return e(s,a)}return Ks(t,s,a,"children"in s?s.children:null,null,c=>h.createElement(wn.Provider,{value:o},h.createElement(i,{node:c})))});return l.displayName=e.name,l}function Jc(t,e,i=Ds){let l=({node:a})=>e(a.props,a.props.ref,a),s=(0,h.forwardRef)((a,o)=>Ks(t,a,o,null,i(a),c=>h.createElement(l,{node:c}))??h.createElement(h.Fragment,null));return s.displayName=e.name,s}function Ds(t){return Ki({...t,addIdAndValue:!0})}var As=(0,h.createContext)(null);function Ps(t){let e=(0,h.useContext)(As),i=((e==null?void 0:e.dependencies)||[]).concat(t.dependencies),l=t.idScope??(e==null?void 0:e.idScope),s=Ds({...t,idScope:l,dependencies:i});return(0,h.useContext)(Ct)&&(s=h.createElement(ed,null,s)),e=(0,h.useMemo)(()=>({dependencies:i,idScope:l}),[l,...i]),h.createElement(As.Provider,{value:e},s)}function ed({children:t}){let e=(0,h.useContext)(Ct),i=(0,h.useMemo)(()=>h.createElement(Ct.Provider,{value:null},h.createElement(Is.Provider,{value:!0},t)),[t]);return Dn()?h.createElement(Di.Provider,{value:e},i):(0,Uc.createPortal)(i,e)}var td=(0,h.createContext)(null),Es={CollectionRoot({collection:t,renderDropIndicator:e}){return Ts(t,null,e)},CollectionBranch({collection:t,parent:e,renderDropIndicator:i}){return Ts(t,e,i)}};function Ts(t,e,i){return Ki({items:e?t.getChildren(e.key):t,dependencies:[i],children(l){if(l.type==="content")return h.createElement(h.Fragment,null);let s=l.render(l);return!i||l.type!=="item"?s:h.createElement(h.Fragment,null,i({type:"item",key:l.key,dropPosition:"before"}),s,id(t,l,i))}})}function id(t,e,i){let l=e.key,s=t.getKeyAfter(l),a=s==null?null:t.getItem(s);for(;a!=null&&a.type!=="item";)s=t.getKeyAfter(a.key),a=s==null?null:t.getItem(s);let o=e.nextKey==null?null:t.getItem(e.nextKey);for(;o!=null&&o.type!=="item";)o=o.nextKey==null?null:t.getItem(o.nextKey);let c=[];if(o==null){let r=e;for(;(r==null?void 0:r.type)==="item"&&(!a||r.parentKey!==a.parentKey&&a.level<r.level);){let d=i({type:"item",key:r.key,dropPosition:"after"});(0,h.isValidElement)(d)&&c.push((0,h.cloneElement)(d,{key:`${r.key}-after`})),r=r.parentKey==null?null:t.getItem(r.parentKey)}}return c}var Qt=(0,h.createContext)(Es),Qe=class za extends Set{constructor(e,i,l){super(e),e instanceof za?(this.anchorKey=i??e.anchorKey,this.currentKey=l??e.currentKey):(this.anchorKey=i??null,this.currentKey=l??null)}};function nd(t,e){if(t.size!==e.size)return!1;for(let i of t)if(!e.has(i))return!1;return!0}function Bs(t){let{selectionMode:e="none",disallowEmptySelection:i=!1,allowDuplicateSelectionEvents:l,selectionBehavior:s="toggle",disabledBehavior:a="all"}=t,o=(0,h.useRef)(!1),[,c]=(0,h.useState)(!1),r=(0,h.useRef)(null),d=(0,h.useRef)(null),[,u]=(0,h.useState)(null),[p,g]=pi((0,h.useMemo)(()=>Fs(t.selectedKeys),[t.selectedKeys]),(0,h.useMemo)(()=>Fs(t.defaultSelectedKeys,new Qe),[t.defaultSelectedKeys]),t.onSelectionChange),x=(0,h.useMemo)(()=>t.disabledKeys?new Set(t.disabledKeys):new Set,[t.disabledKeys]),[v,j]=(0,h.useState)(s);s==="replace"&&v==="toggle"&&typeof p=="object"&&p.size===0&&j("replace");let C=(0,h.useRef)(s);return(0,h.useEffect)(()=>{s!==C.current&&(j(s),C.current=s)},[s]),{selectionMode:e,disallowEmptySelection:i,selectionBehavior:v,setSelectionBehavior:j,get isFocused(){return o.current},setFocused(I){o.current=I,c(I)},get focusedKey(){return r.current},get childFocusStrategy(){return d.current},setFocusedKey(I,b="first"){r.current=I,d.current=b,u(I)},selectedKeys:p,setSelectedKeys(I){(l||!nd(I,p))&&g(I)},disabledKeys:x,disabledBehavior:a}}function Fs(t,e){return t?t==="all"?"all":new Qe(t):e}var zs=class Oa{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,i){(e==null||this.collection.getItem(e))&&this.state.setFocusedKey(e,i)}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 i=this.getKey(e);return i==null?!1:this.state.selectedKeys==="all"?this.canSelectItem(i):this.state.selectedKeys.has(i)}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(),i=this.state.selectedKeys;return this._isSelectAll=e.every(l=>i.has(l)),this._isSelectAll}get firstSelectedKey(){let e=null;for(let i of this.state.selectedKeys){let l=this.collection.getItem(i);(!e||l&&_i(this.collection,l,e)<0)&&(e=l)}return(e==null?void 0:e.key)??null}get lastSelectedKey(){let e=null;for(let i of this.state.selectedKeys){let l=this.collection.getItem(i);(!e||l&&_i(this.collection,l,e)>0)&&(e=l)}return(e==null?void 0: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 i=this.getKey(e);if(i==null)return;let l;if(this.state.selectedKeys==="all")l=new Qe([i],i,i);else{let s=this.state.selectedKeys,a=s.anchorKey??i;l=new Qe(s,a,i);for(let o of this.getKeyRange(a,s.currentKey??i))l.delete(o);for(let o of this.getKeyRange(i,a))this.canSelectItem(o)&&l.add(o)}this.state.setSelectedKeys(l)}getKeyRange(e,i){let l=this.collection.getItem(e),s=this.collection.getItem(i);return l&&s?_i(this.collection,l,s)<=0?this.getKeyRangeInternal(e,i):this.getKeyRangeInternal(i,e):[]}getKeyRangeInternal(e,i){var a;if((a=this.layoutDelegate)!=null&&a.getKeyRange)return this.layoutDelegate.getKeyRange(e,i);let l=[],s=e;for(;s!=null;){let o=this.collection.getItem(s);if(o&&(o.type==="item"||o.type==="cell"&&this.allowsCellSelection)&&l.push(s),s===i)return l;s=this.collection.getKeyAfter(s)}return[]}getKey(e){let i=this.collection.getItem(e);if(!i||i.type==="cell"&&this.allowsCellSelection)return e;for(;i&&i.type!=="item"&&i.parentKey!=null;)i=this.collection.getItem(i.parentKey);return!i||i.type!=="item"?null:i.key}toggleSelection(e){if(this.selectionMode==="none")return;if(this.selectionMode==="single"&&!this.isSelected(e)){this.replaceSelection(e);return}let i=this.getKey(e);if(i==null)return;let l=new Qe(this.state.selectedKeys==="all"?this.getSelectAllKeys():this.state.selectedKeys);l.has(i)?l.delete(i):this.canSelectItem(i)&&(l.add(i),l.anchorKey=i,l.currentKey=i),!(this.disallowEmptySelection&&l.size===0)&&this.state.setSelectedKeys(l)}replaceSelection(e){if(this.selectionMode==="none")return;let i=this.getKey(e);if(i==null)return;let l=this.canSelectItem(i)?new Qe([i],i,i):new Qe;this.state.setSelectedKeys(l)}setSelectedKeys(e){if(this.selectionMode==="none")return;let i=new Qe;for(let l of e){let s=this.getKey(l);if(s!=null&&(i.add(s),this.selectionMode==="single"))break}this.state.setSelectedKeys(i)}getSelectAllKeys(){let e=[],i=l=>{var s;for(;l!=null;){if(this.canSelectItem(l)){let a=this.collection.getItem(l);(a==null?void 0:a.type)==="item"&&e.push(l),a!=null&&a.hasChildNodes&&(this.allowsCellSelection||a.type!=="item")&&i(((s=Ic(il(a,this.collection)))==null?void 0:s.key)??null)}l=this.collection.getKeyAfter(l)}};return i(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 Qe)}toggleSelectAll(){this.isSelectAll?this.clearSelection():this.selectAll()}select(e,i){this.selectionMode!=="none"&&(this.selectionMode==="single"?this.isSelected(e)&&!this.disallowEmptySelection?this.toggleSelection(e):this.replaceSelection(e):this.selectionBehavior==="toggle"||i&&(i.pointerType==="touch"||i.pointerType==="virtual")?this.toggleSelection(e):this.replaceSelection(e))}isSelectionEqual(e){if(e===this.state.selectedKeys)return!0;let i=this.selectedKeys;if(e.size!==i.size)return!1;for(let l of e)if(!i.has(l))return!1;for(let l of i)if(!e.has(l))return!1;return!0}canSelectItem(e){var l;if(this.state.selectionMode==="none"||this.state.disabledKeys.has(e))return!1;let i=this.collection.getItem(e);return!(!i||i!=null&&((l=i.props)!=null&&l.isDisabled)||i.type==="cell"&&!this.allowsCellSelection)}isDisabled(e){var l;var i;return this.state.disabledBehavior==="all"&&(this.state.disabledKeys.has(e)||!!((i=this.collection.getItem(e))!=null&&((l=i.props)!=null&&l.isDisabled)))}isLink(e){var l;var i;return!!((i=this.collection.getItem(e))!=null&&((l=i.props)!=null&&l.href))}getItemProps(e){var i;return(i=this.collection.getItem(e))==null?void 0:i.props}withCollection(e){return new Oa(e,this.state,{allowsCellSelection:this.allowsCellSelection,layoutDelegate:this.layoutDelegate||void 0})}constructor(e,i,l){this.collection=e,this.state=i,this.allowsCellSelection=(l==null?void 0:l.allowsCellSelection)??!1,this._isSelectAll=null,this.layoutDelegate=(l==null?void 0:l.layoutDelegate)||null}},ld=class{*[Symbol.iterator](){yield*this.iterable}get size(){return this.keyMap.size}getKeys(){return this.keyMap.keys()}getKeyBefore(t){let e=this.keyMap.get(t);return e?e.prevKey??null:null}getKeyAfter(t){let e=this.keyMap.get(t);return e?e.nextKey??null:null}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(t){return this.keyMap.get(t)??null}at(t){let e=[...this.getKeys()];return this.getItem(e[t])}constructor(t,{expandedKeys:e}={}){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.iterable=t,e||(e=new Set);let i=a=>{if(this.keyMap.set(a.key,a),a.childNodes&&(a.type==="section"||e.has(a.key)))for(let o of a.childNodes)i(o)};for(let a of t)i(a);let l=null,s=0;for(let[a,o]of this.keyMap)l?(l.nextKey=a,o.prevKey=l.key):(this.firstKey=a,o.prevKey=void 0),o.type==="item"&&(o.index=s++),l=o,l.nextKey=void 0;this.lastKey=(l==null?void 0:l.key)??null}};function sd(t){let{onExpandedChange:e}=t,[i,l]=pi(t.expandedKeys?new Set(t.expandedKeys):void 0,t.defaultExpandedKeys?new Set(t.defaultExpandedKeys):new Set,e),s=Bs(t),a=(0,h.useMemo)(()=>t.disabledKeys?new Set(t.disabledKeys):new Set,[t.disabledKeys]),o=tl(t,(0,h.useCallback)(c=>new ld(c,{expandedKeys:i}),[i]),null);return(0,h.useEffect)(()=>{s.focusedKey!=null&&!o.getItem(s.focusedKey)&&s.setFocusedKey(null)},[o,s.focusedKey]),{collection:o,expandedKeys:i,disabledKeys:a,toggleKey:c=>{l(ad(i,c))},setExpandedKeys:l,selectionManager:new zs(o,s)}}function ad(t,e){let i=new Set(t);return i.has(e)?i.delete(e):i.add(e),i}var _t=(0,h.createContext)({}),Pi=(0,h.createContext)(null),od=(0,h.forwardRef)(function(t,e){let{render:i}=(0,h.useContext)(Pi);return h.createElement(h.Fragment,null,i(t,e))});function Os(t,e){var a;let i=t==null?void 0:t.renderDropIndicator,l=(a=t==null?void 0:t.isVirtualDragging)==null?void 0:a.call(t),s=(0,h.useCallback)(o=>{if(l||e!=null&&e.isDropTarget(o))return i?i(o):h.createElement(od,{target:o})},[e==null?void 0:e.target,l,i]);return t!=null&&t.useDropIndicator?s:void 0}function Vs(t,e,i){var a,o,c;let l=t.focusedKey,s=null;if(e!=null&&((a=e.isVirtualDragging)!=null&&a.call(e))&&((o=i==null?void 0:i.target)==null?void 0:o.type)==="item"&&(s=i.target.key,i.target.dropPosition==="after")){let r=i.collection.getKeyAfter(s),d=null;if(r!=null){let u=((c=i.collection.getItem(s))==null?void 0:c.level)??0;for(;r;){let p=i.collection.getItem(r);if(!p)break;if(p.type!=="item"){r=i.collection.getKeyAfter(r);continue}if((p.level??0)<=u)break;d=r,r=i.collection.getKeyAfter(r)}}s=r??d??s}return(0,h.useMemo)(()=>new Set([l,s].filter(r=>r!=null)),[l,s])}var Rs=10,$s=5,rd=class{setup(t,e,i){this.delegate=t,this.state=e,this.direction=i}getDropTargetFromPoint(t,e,i){let l=this.delegate.getDropTargetFromPoint(t,e,i);return!l||l.type==="root"?l:this.resolveDropTarget(l,t,e,i)}resolveDropTarget(t,e,i,l){let s=this.pointerTracking,a=i-s.lastY,o=e-s.lastX,c=s.yDirection,r=s.xDirection;if(Math.abs(a)>$s&&(c=a>0?"down":"up",s.yDirection=c,s.lastY=i),Math.abs(o)>Rs&&(r=o>0?"right":"left",s.xDirection=r,s.lastX=e),t.dropPosition==="before"){let p=this.state.collection.getKeyBefore(t.key);if(p!=null){let g={type:"item",key:p,dropPosition:"after"};l(g)&&(t=g)}}let d=this.getPotentialTargets(t,l);if(d.length===0)return{type:"root"};let u;return d.length>1?u=this.selectTarget(d,t,e,i,c,r):(u=d[0],s.boundaryContext=null),u}getPotentialTargets(t,e){if(t.dropPosition==="on")return[t];let i=t,l=this.state.collection,s=l.getItem(i.key);for(;s&&(s==null?void 0:s.type)!=="item"&&s.nextKey!=null;)i.key=s.nextKey,s=l.getItem(s.nextKey);let a=[i];if(s&&s.hasChildNodes&&this.state.expandedKeys.has(s.key)&&l.getChildren&&i.dropPosition==="after"){let r=null;for(let d of l.getChildren(s.key))if(d.type==="item"){r=d;break}if(r){let d={type:"item",key:r.key,dropPosition:"before"};return e(d)?[d]:[]}}if((s==null?void 0:s.nextKey)!=null)return[t];let o=s==null?void 0:s.parentKey,c=[];for(;o;){let r=l.getItem(o),d=r!=null&&r.nextKey?l.getItem(r.nextKey):null;if(!d||d.parentKey!==o){let u={type:"item",key:o,dropPosition:"after"};if(e(u)&&c.push(u),d)break}o=r==null?void 0:r.parentKey}if(c.length>0&&a.push(...c),a.length===1){let r=l.getKeyAfter(i.key),d=r?l.getItem(r):null;if(r!=null&&d&&s&&d.level!=null&&s.level!=null&&d.level>s.level){let u={type:"item",key:r,dropPosition:"before"};if(e(u))return[u]}}return a.filter(e)}selectTarget(t,e,i,l,s,a){var u;if(t.length<2)return t[0];let o=this.pointerTracking,c=(u=this.state.collection.getItem(e.key))==null?void 0:u.parentKey;if(!c)return t[0];(!o.boundaryContext||o.boundaryContext.parentKey!==c)&&(o.boundaryContext={parentKey:c,preferredTargetIndex:o.yDirection==="up"?t.length-1:0,lastSwitchY:l,lastSwitchX:i});let r=o.boundaryContext,d=Math.abs(i-r.lastSwitchX);if(Math.abs(l-r.lastSwitchY)>$s&&s){let p=r.preferredTargetIndex||0;s==="down"&&p===0?r.preferredTargetIndex=t.length-1:s==="up"&&p===t.length-1&&(r.preferredTargetIndex=0),o.xDirection=null}if(d>Rs&&a){let p=r.preferredTargetIndex||0;a==="left"?this.direction==="ltr"?p<t.length-1&&(r.preferredTargetIndex=p+1,r.lastSwitchX=i):p>0&&(r.preferredTargetIndex=p-1,r.lastSwitchX=i):a==="right"&&(this.direction==="ltr"?p>0&&(r.preferredTargetIndex=p-1,r.lastSwitchX=i):p<t.length-1&&(r.preferredTargetIndex=p+1,r.lastSwitchX=i)),o.yDirection=null}return t[Math.max(0,Math.min(r.preferredTargetIndex||0,t.length-1))]}constructor(){this.delegate=null,this.state=null,this.direction="ltr",this.pointerTracking={lastY:0,lastX:0,yDirection:null,xDirection:null,boundaryContext:null}}},cd=class Gi extends _s{withExpandedKeys(e,i){let l=this.clone();return l.expandedKeys=i,Gi.cloneAncestorSections(i,e,l),Gi.cloneAncestorSections(e,i,l),l.frozen=this.frozen,l}static cloneAncestorSections(e,i,l){for(let s of e)if(!i.has(s)){let a=s;for(;a!=null;){let o=l.getItem(a);if((o==null?void 0:o.type)==="section"){l.keyMap.set(a,o.clone());break}else a=(o==null?void 0:o.parentKey)??null}}}*[Symbol.iterator](){let e=this.getFirstKey(),i=e==null?null:this.getItem(e);for(;i;)if(yield i,i.type==="section")i=i.nextKey?this.getItem(i.nextKey):null;else{let l=this.getKeyAfter(i.key);i=l?this.getItem(l):null}}getLastKey(){let e=this.lastKey;if(e==null)return null;let i=this.getItem(e);for(;(i==null?void 0:i.lastChildKey)!=null&&(i.type!=="item"||this.expandedKeys.has(i.key));)i=this.getItem(i.lastChildKey);return i==null?void 0:i.key}getKeyAfter(e){let i=this.getItem(e);if(!i)return null;if((this.expandedKeys.has(i.key)||i.type!=="item")&&i.firstChildKey!=null)return i.firstChildKey;for(;i;){if(i.nextKey!=null)return i.nextKey;if(i.parentKey!=null)i=this.getItem(i.parentKey);else return null}return null}getKeyBefore(e){let i=this.getItem(e);if(!i)return null;if(i.prevKey!=null){for(i=this.getItem(i.prevKey);i&&(i.type!=="item"||this.expandedKeys.has(i.key))&&i.lastChildKey!=null;)i=this.getItem(i.lastChildKey);return(i==null?void 0:i.key)??null}return i.parentKey}getChildren(e){let i=this;return{*[Symbol.iterator](){let l=i.getItem(e),s=(l==null?void 0:l.firstChildKey)==null?null:i.getItem(l.firstChildKey);if(l&&l.type==="section"&&s)for(;s&&s.key!==l.nextKey;){yield i.getItem(s.key);let a=i.getKeyAfter(s.key);s=a==null?null:i.getItem(a)}else for(;s;)yield s,s=s.nextKey==null?null:i.getItem(s.nextKey)}}}getTextValue(e){let i=this.getItem(e);return i?i.textValue:""}constructor(...e){super(...e),this.expandedKeys=new Set}},dd=(0,h.createContext)(null),Ei=(0,h.createContext)(null),ud=(0,h.forwardRef)(function(t,e){return[t,e]=dr(t,e,dd),h.createElement(Ms,{content:h.createElement(Ps,t),createCollection:()=>new cd},i=>h.createElement(md,{props:t,collection:i,treeRef:e}))}),Ls={expand:{ltr:"ArrowRight",rtl:"ArrowLeft"},collapse:{ltr:"ArrowLeft",rtl:"ArrowRight"}};function md({props:t,collection:e,treeRef:i}){let{dragAndDropHooks:l}=t,{direction:s}=Ht(),a=En({usage:"search",sensitivity:"base"}),o=!!(l!=null&&l.useDraggableCollectionState),c=!!(l!=null&&l.useDroppableCollectionState),r=(0,h.useRef)(o),d=(0,h.useRef)(c);(0,h.useEffect)(()=>{r.current!==o&&console.warn("Drag hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior."),d.current!==c&&console.warn("Drop hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior.")},[o,c]);let{selectionMode:u="none",expandedKeys:p,defaultExpandedKeys:g,onExpandedChange:x,disabledBehavior:v="all"}=t,{CollectionRoot:j,isVirtualized:C,layoutDelegate:I,dropTargetDelegate:b}=(0,h.useContext)(Qt),[_,S]=pi(p?new Set(p):void 0,g?new Set(g):new Set,x),[f,m]=(0,h.useState)(e),[y,P]=(0,h.useState)(_),[A,B]=(0,h.useState)(()=>e.withExpandedKeys(y,_));(!xd(y,_)||e!==f)&&(B(e.withExpandedKeys(y,_)),m(e),P(_));let M=sd({...t,selectionMode:u,expandedKeys:_,onExpandedChange:S,collection:A,children:void 0,disabledBehavior:v}),{gridProps:w}=Rc({...t,isVirtualized:C,layoutDelegate:I},M,i),K,k,D,T=!1,F=null,U=(0,h.useRef)(null);if(o&&l){K=l.useDraggableCollectionState({collection:M.collection,selectionManager:M.selectionManager,preview:l.renderDragPreview?U:void 0}),l.useDraggableCollection({},K,i);let E=l.DragPreview;F=l.renderDragPreview?h.createElement(E,{ref:U},l.renderDragPreview):null}let[W]=(0,h.useState)(()=>new rd);if(c&&l){k=l.useDroppableCollectionState({collection:M.collection,selectionManager:M.selectionManager});let E=l.dropTargetDelegate||b||new l.ListDropTargetDelegate(M.collection,i,{direction:s});W.setup(E,M,s);let X=new wi({collection:M.collection,collator:a,ref:i,disabledKeys:M.selectionManager.disabledKeys,disabledBehavior:M.selectionManager.disabledBehavior,direction:s,layoutDelegate:I});D=l.useDroppableCollection({keyboardDelegate:X,dropTargetDelegate:W,onDropActivate:Q=>{var J;if(Q.target.type==="item"){let ne=Q.target.key,le=M.collection.getItem(ne),ye=_.has(ne);le&&le.hasChildNodes&&(!ye||l!=null&&((J=l.isVirtualDragging)!=null&&J.call(l)))&&M.toggleKey(ne)}},onKeyDown:Q=>{let J=k==null?void 0:k.target;if(J&&J.type==="item"&&J.dropPosition==="on"){let ne=M.collection.getItem(J.key);(Q.key===Ls.expand[s]&&(ne!=null&&ne.hasChildNodes)&&!M.expandedKeys.has(J.key)||Q.key===Ls.collapse[s]&&(ne!=null&&ne.hasChildNodes)&&M.expandedKeys.has(J.key))&&M.toggleKey(J.key)}}},k,i);let Y=k.getDropOperation;k.getDropOperation=Q=>{var ye;let{target:J,isInternal:ne}=Q,le=(K==null?void 0:K.draggingKeys)??new Set;if(ne&&J.type==="item"&&le.size>0){if(le.has(J.key)&&J.dropPosition==="on")return"cancel";let ue=J.key;for(;ue!=null;){let je=(ye=M.collection.getItem(ue))==null?void 0:ye.parentKey;if(je!=null&&le.has(je))return"cancel";ue=je??null}}return Y(Q)},T=k.isDropTarget({type:"root"})}let N=!!(o&&!(K!=null&&K.isDisabled)),{focusProps:q,isFocused:ie,isFocusVisible:ce}=mi(),de={isEmpty:M.collection.size===0,isFocused:ie,isFocusVisible:ce,isDropTarget:T,selectionMode:M.selectionManager.selectionMode,allowsDragging:!!N,state:M},fe=vt({...t,children:void 0,defaultClassName:"react-aria-Tree",values:de}),he=null;if(M.collection.size===0&&t.renderEmptyState){let{isEmpty:E,...X}=de,Y=t.renderEmptyState({...X});he=h.createElement("div",{role:"row",style:{display:"contents"},"aria-level":1},h.createElement("div",{role:"gridcell",style:{display:"contents"}},Y))}let xe=$t(t,{global:!0});return h.createElement(h.Fragment,null,h.createElement(Pr,null,h.createElement(Vt.div,{...Ve(xe,fe,w,q,D==null?void 0:D.collectionProps),ref:i,slot:t.slot||void 0,"data-empty":M.collection.size===0||void 0,"data-focused":ie||void 0,"data-drop-target":T||void 0,"data-focus-visible":ce||void 0,"data-selection-mode":M.selectionManager.selectionMode==="none"?void 0:M.selectionManager.selectionMode,"data-allows-dragging":!!N||void 0},h.createElement(jn,{values:[[Ei,M],[_t,{dragAndDropHooks:l,dragState:K,dropState:k}],[Pi,{render:pd}]]},c&&h.createElement(fd,null),h.createElement(Lr,null,h.createElement(j,{collection:M.collection,persistedKeys:Vs(M.selectionManager,l,k),scrollRef:i,renderDropIndicator:Os(l,k)}))),he)),F)}var Gs=class extends st{};Gs.type="content";var Hs=Ai(Gs,function(t){let e=(0,h.useContext)(Us),i=vt({children:t.children,values:e});return h.createElement(Qt.Provider,{value:Es},i.children)}),Us=(0,h.createContext)(null),qs=class extends st{};qs.type="item";var Ws=Jc(qs,(t,e,i)=>{let l=(0,h.useContext)(Ei);e=hi(e);let{dragAndDropHooks:s,dragState:a,dropState:o}=(0,h.useContext)(_t),{rowProps:c,gridCellProps:r,expandButtonProps:d,descriptionProps:u,...p}=js({node:i,shouldSelectOnPressUp:!!a},l,e),g=c["aria-expanded"]===!0,x=t.hasChildItems||[...l.collection.getChildren(i.key)].length>1,v=c["aria-level"]||1,{hoverProps:j,isHovered:C}=mr({isDisabled:!p.allowsSelection&&!p.hasAction,onHoverStart:t.onHoverStart,onHoverChange:t.onHoverChange,onHoverEnd:t.onHoverEnd}),{isFocusVisible:I,focusProps:b}=mi(),{isFocusVisible:_,focusProps:S}=mi({within:!0}),{checkboxProps:f}=Vc({key:i.key},l),m=null;a&&s&&(m=s.useDraggableItem({key:i.key,hasDragButton:!0},a));let y=null,P=(0,h.useRef)(null),A=(0,h.useRef)(null),B=(0,h.useRef)(null),{visuallyHiddenProps:M}=yi();o&&s&&(y=s.useDropIndicator({target:{type:"item",key:i.key,dropPosition:"on"},activateButtonRef:B},o,A));let w=a&&a.isDragging(i.key),K=y==null?void 0:y.isDropTarget,k=l.selectionManager.selectionMode,D=l.selectionManager.selectionBehavior,T=h.useMemo(()=>({...p,isHovered:C,isFocusVisible:I,isExpanded:g,hasChildItems:x,level:v,selectionMode:k,selectionBehavior:D,isFocusVisibleWithin:_,state:l,id:i.key,allowsDragging:!!a,isDragging:w,isDropTarget:K}),[p,C,I,g,x,v,_,l,i.key,a,w,K,D,k]),F=vt({...t,id:void 0,children:i.rendered,defaultClassName:"react-aria-TreeItem",defaultStyle:{"--tree-item-level":v},values:T});(0,h.useEffect)(()=>{i.textValue},[i.textValue]),(0,h.useEffect)(()=>{x&&P.current},[]);let U=(0,h.useRef)(null);(0,h.useEffect)(()=>{a&&U.current},[]);let W=Ki({items:l.collection.getChildren(i.key),children:ie=>{switch(ie.type){case"content":return ie.render(ie);case"loader":case"item":return h.createElement(h.Fragment,null);default:throw Error("Unsupported element type in TreeRow: "+ie.type)}}}),N=jt(),q=$t(t,{global:!0});return delete q.id,delete q.onClick,h.createElement(h.Fragment,null,y&&!y.isHidden&&h.createElement("div",{role:"row","aria-level":c["aria-level"],"aria-expanded":c["aria-expanded"],"aria-label":y.dropIndicatorProps["aria-label"]},h.createElement("div",{role:"gridcell","aria-colindex":1,style:{display:"contents"}},h.createElement("div",{role:"button",...M,...y.dropIndicatorProps,ref:A}),c["aria-expanded"]==null?null:h.createElement("div",{role:"button",...M,id:N,"aria-label":d["aria-label"],"aria-labelledby":`${N} ${c.id}`,tabIndex:-1,ref:B}))),h.createElement(Vt.div,{...Ve(q,c,b,j,S,m==null?void 0:m.dragProps),...F,ref:e,"data-expanded":x&&g||void 0,"data-has-child-items":x||void 0,"data-level":v,"data-selected":p.isSelected||void 0,"data-disabled":p.isDisabled||void 0,"data-hovered":C||void 0,"data-focused":p.isFocused||void 0,"data-focus-visible":I||void 0,"data-pressed":p.isPressed||void 0,"data-selection-mode":l.selectionManager.selectionMode==="none"?void 0:l.selectionManager.selectionMode,"data-allows-dragging":!!a||void 0,"data-dragging":w||void 0,"data-drop-target":K||void 0},h.createElement("div",{...r,style:{display:"contents"}},h.createElement(jn,{values:[[Er,{slots:{selection:f}}],[gr,{slots:{[ur]:{},chevron:{...d,ref:P},drag:{...m==null?void 0:m.dragButtonProps,ref:U,style:{pointerEvents:"none"}}}}],[Us,{...T}],[Gr,{isSelected:p.isSelected}]]},W))))});Ai(Ii,function(t,e,i){let{isVirtualized:l}=(0,h.useContext)(Qt),s=(0,h.useContext)(Ei),{isLoading:a,onLoadMore:o,scrollOffset:c,...r}=t,d=(0,h.useRef)(null);Gn((0,h.useMemo)(()=>({onLoadMore:o,collection:s==null?void 0:s.collection,sentinelRef:d,scrollOffset:c}),[o,c,s==null?void 0:s.collection]),d),e=hi(e);let{rowProps:u,gridCellProps:p}=js({node:i},s,e),g=u["aria-level"]||1,x={role:"row","aria-level":u["aria-level"]},v=vt({...r,id:void 0,children:i.rendered,defaultClassName:"react-aria-TreeLoader",values:{level:g}}),j={};return l&&(j={display:"contents"}),h.createElement(h.Fragment,null,h.createElement("div",{style:{position:"relative",width:0,height:0},inert:Hn(!0)},h.createElement("div",{"data-testid":"loadMoreSentinel",ref:d,style:{position:"absolute",height:1,width:1}})),a&&v.children&&h.createElement(Vt.div,{ref:e,...Ve($t(t),x),...v,"data-level":g},h.createElement("div",{...p,style:j},v.children)))});function pd(t,e){var d;e=hi(e);let{dragAndDropHooks:i,dropState:l}=(0,h.useContext)(_t),s=(0,h.useRef)(null),{dropIndicatorProps:a,isHidden:o,isDropTarget:c}=i.useDropIndicator(t,l,s);if(o)return null;let r=l&&t.target.type==="item"?(((d=l.collection.getItem(t.target.key))==null?void 0:d.level)||0)+1:1;return h.createElement(gd,{...t,dropIndicatorProps:a,isDropTarget:c,ref:e,buttonRef:s,level:r})}function hd(t,e){let{dropIndicatorProps:i,isDropTarget:l,buttonRef:s,level:a,...o}=t,{visuallyHiddenProps:c}=yi(),r=vt({...o,defaultClassName:"react-aria-DropIndicator",defaultStyle:{position:"relative","--tree-item-level":a},values:{isDropTarget:l}});return h.createElement(Vt.div,{...r,role:"row","aria-level":a,ref:e,"data-drop-target":l||void 0},h.createElement("div",{role:"gridcell"},h.createElement("div",{...c,role:"button",...i,ref:s}),r.children))}var gd=(0,h.forwardRef)(hd);function fd(){let{dragAndDropHooks:t,dropState:e}=(0,h.useContext)(_t),i=(0,h.useRef)(null),{dropIndicatorProps:l}=t.useDropIndicator({target:{type:"root"}},e,i),s=e.isDropTarget({type:"root"}),{visuallyHiddenProps:a}=yi();return!s&&l["aria-hidden"]?null:h.createElement("div",{role:"row","aria-hidden":l["aria-hidden"],style:{position:"absolute"}},h.createElement("div",{role:"gridcell"},h.createElement("div",{role:"button",...a,...l,ref:i})))}function xd(t,e){if(t.size!==e.size)return!1;for(let i of t)if(!e.has(i))return!1;return!0}const Yt=["openai","anthropic","google","ollama","bedrock","deepseek","azure","github","openrouter","wandb","opencode-go","marimo"];var Ke=class Hi{constructor(e,i){this.providerId=e,this.shortModelId=i}get id(){return`${this.providerId}/${this.shortModelId}`}static parse(e){if(!e.includes("/"))return new Hi(yd(e),e);let[i,...l]=e.split("/");return new Hi(i,l.join("/"))}};function yd(t){return t.startsWith("gpt")||t.startsWith("o3")||t.startsWith("o1")?"openai":t.startsWith("claude")?"anthropic":t.startsWith("gemini")||t.startsWith("google")?"google":t.startsWith("deepseek")?"deepseek":"ollama"}function Ti(t){return Yt.includes(t)}const vd=JSON.parse(`{"anthropic":[{"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 most capable widely released Mythos-class model, built for the most demanding reasoning 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":"Next generation of Anthropic's Opus family, 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's most capable Sonnet-class model yet, with frontier performance across 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's strongest 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's frontier reasoning model optimized 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's most advanced Sonnet model to date, 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's frontier model designed for complex professional workloads, building on GPT-5.4 with stronger reasoning, higher reliability, and improved token efficiency 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's latest frontier model, unifying 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 Chat","model":"gpt-5.3-chat-latest","description":"Update to ChatGPT's most-used model that makes everyday conversations smoother, more useful, and more directly helpful","roles":["chat","edit"],"capabilities":["tool_calling"],"input_types":["text","image"],"output_types":["text"],"release_date":"2026-03-03","cost":{"input":1.75,"output":14}},{"name":"GPT-5.3 Codex","model":"gpt-5.3-codex","description":"OpenAI's most advanced agentic coding model, combining the frontier software engineering performance of GPT-5.2-Codex with the broader reasoning and professional knowledge capabilities of GPT-5.2","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.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 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 most capable widely released Mythos-class model, built for the most demanding reasoning 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 most capable widely released Mythos-class model, built for the most demanding reasoning 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":"Next generation of Anthropic's Opus family, 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":"Next generation of Anthropic's Opus family, 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":"SOTA 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's most capable Sonnet-class model yet, with frontier performance across 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 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 most capable widely released Mythos-class model, built for the most demanding reasoning 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's frontier model designed for complex professional workloads, building on GPT-5.4 with stronger reasoning, higher reliability, and improved token efficiency 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's next-generation multimodal model, designed 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's latest frontier model, unifying 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 Chat","model":"gpt-5.3-chat","description":"Update to ChatGPT's most-used model that makes everyday conversations smoother, more useful, and more directly helpful","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image"],"output_types":["text"],"release_date":"2026-03-03","cost":{"input":1.75,"output":14}},{"name":"GPT-5.3 Codex","model":"gpt-5.3-codex","description":"OpenAI's most advanced agentic coding model, combining the frontier software engineering performance of GPT-5.2-Codex with the broader reasoning and professional knowledge capabilities of GPT-5.2","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's most capable Sonnet-class model yet, with frontier performance across 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}}],"github":[{"name":"DeepSeek-R1-0528","model":"deepseek/deepseek-r1-0528","description":"May 28th update to DeepSeek R1, with performance on par with OpenAI o1 but open-sourced and with fully open reasoning tokens","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text"],"output_types":["text"],"release_date":"2025-05-28","cost":{"input":0,"output":0}},{"name":"Mistral Medium 3 (25.05)","model":"mistral-ai/mistral-medium-2505","description":"High-performance enterprise-grade language model designed to deliver frontier-level capabilities at significantly reduced operational cost","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image"],"output_types":["text"],"release_date":"2025-05-01","cost":{"input":0,"output":0}},{"name":"GPT-4.1","model":"openai/gpt-4.1","description":"Flagship large language model optimized for advanced instruction following, real-world software engineering, and long-context reasoning","roles":["chat","edit"],"capabilities":["tool_calling"],"input_types":["text","image"],"output_types":["text"],"release_date":"2025-04-14","cost":{"input":0,"output":0}},{"name":"GPT-4.1-mini","model":"openai/gpt-4.1-mini","description":"Mid-sized model delivering performance competitive with GPT-4o at substantially lower latency and cost","roles":["chat","edit"],"capabilities":["tool_calling"],"input_types":["text","image"],"output_types":["text"],"release_date":"2025-04-14","cost":{"input":0,"output":0}},{"name":"GPT-4.1-nano","model":"openai/gpt-4.1-nano","description":"For tasks that demand low latency, GPT\u20114.1 nano is the fastest and cheapest model in the GPT-4.1 series","roles":["chat","edit"],"capabilities":["tool_calling"],"input_types":["text","image"],"output_types":["text"],"release_date":"2025-04-14","cost":{"input":0,"output":0}},{"name":"DeepSeek-V3-0324","model":"deepseek/deepseek-v3-0324","description":"Latest model from the DeepSeek team, building upon the instruction following and coding abilities of the previous versions","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text"],"output_types":["text"],"release_date":"2025-03-24","cost":{"input":0,"output":0}},{"name":"Mistral Small 3.1","model":"mistral-ai/mistral-small-2503","description":"Upgraded variant of Mistral Small 3 (2501), featuring 24 billion parameters with advanced multimodal capabilities","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image"],"output_types":["text"],"release_date":"2025-03-01","cost":{"input":0,"output":0}},{"name":"Llama 4 Maverick 17B 128E Instruct FP8","model":"meta/llama-4-maverick-17b-128e-instruct-fp8","description":"High-capacity multimodal language model from Meta, built on a mixture-of-experts (MoE) architecture with 128 experts and 17 billion active parameters per forward","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image"],"output_types":["text"],"release_date":"2025-01-31","cost":{"input":0,"output":0}},{"name":"Llama 4 Scout 17B 16E Instruct","model":"meta/llama-4-scout-17b-16e-instruct","description":"Mixture-of-experts (MoE) language model developed by Meta, activating 17 billion parameters out of a total of 109B","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image"],"output_types":["text"],"release_date":"2025-01-31","cost":{"input":0,"output":0}},{"name":"OpenAI o3","model":"openai/o3","description":"Well-rounded reasoning model setting a new standard for math, science, coding, and visual reasoning tasks","roles":["chat","edit"],"capabilities":["thinking"],"input_types":["text","image"],"output_types":["text"],"release_date":"2025-01-31","cost":{"input":0,"output":0}}],"ollama":[{"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's next-generation multimodal model, designed 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":"Next-generation 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 frontier-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":"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.74,"output":3.46}},{"name":"Z.AI 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-13","cost":{"input":1.39,"output":4.4}},{"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 frontier-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":"SOTA 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":"Moonshot AI 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.94,"output":4}},{"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":"JetBrains 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":"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":"Grok 4.5","model":"grok-4.5","description":"xAI's smartest model with frontier performance on coding, knowledge work, and STEM","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image"],"output_types":["text"],"release_date":"2026-07-08","cost":{"input":2,"output":6}},{"name":"Hy3","model":"hy3","description":"Tencent's 295B-parameter Mixture-of-Experts model (21B active) built for reasoning, agentic workflows, and production use","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text"],"output_types":["text"],"release_date":"2026-07-06","cost":{"input":0.14,"output":0.58}},{"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's next-generation multimodal model, designed 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":"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-04-07","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":"Qwen3.6 Plus","model":"qwen3.6-plus","description":"Qwen 3.6 Plus builds on a hybrid architecture that combines efficient linear attention with sparse mixture-of-experts routing, enabling strong scalability and high-performance inference","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image"],"output_types":["text"],"release_date":"2026-04-02","cost":{"input":0.5,"output":3}},{"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":"MiniMax M2.7","model":"minimax-m2.7","description":"Next-generation 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","cost":{"input":0.3,"output":1.2}},{"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,\u2026","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text"],"output_types":["text"],"release_date":"2026-04-22","cost":{"input":1,"output":3}}]}`),bd=[{name:"OpenAI",id:"openai",description:"OpenAI's API for GPT models, including GPT-3.5 and GPT-4.",url:"https://platform.openai.com/"},{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:"GitHub",id:"github",description:"GitHub's API for GPT models with GitHub-hosted models.",url:"https://github.com/features/copilot"},{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/"}];var kd=vd,jd=bd;const Qs=Xe(()=>{let t=new Map,e=new Map;for(let[i,l]of Object.entries(kd)){if(!l)continue;let s=i;for(let a of l){let o=a.model,c={...a,model:o,provider:s,custom:!1},r=`${s}/${o}`;t.set(r,c),(c.roles.includes("chat")||c.roles.includes("edit"))&&!e.has(s)&&e.set(s,r)}}return{modelMap:t,defaultModelByProvider:e}});var Ys=Xe(()=>{let t=new Map,e=new Map;return jd.forEach((i,l)=>{t.set(i.id,i),e.set(i.id,l)}),{providerMap:t,providerToOrderIdx:e}}),St=class si{constructor(e,i){Ae(this,"modelsByProviderMap",new sn);this.customModels=new Set(e),this.displayedModels=new Set(i),this.modelsMap=new Map,this.buildMaps()}static getProviderInfo(e){let{providerMap:i}=Ys();return i.get(e)}static create(e){let{customModels:i=[],displayedModels:l=[]}=e;return new si(i.map(s=>Ke.parse(s).id),l.map(s=>Ke.parse(s).id))}buildMaps(){let e=si.buildMapsFromConfig({displayedModels:this.displayedModels,customModels:this.customModels});e.modelsMap.size===0&&(Z.error("The configured displayed_models have filtered out all registered models. Reverting back to showing all models.",[...this.displayedModels]),e=si.buildMapsFromConfig({displayedModels:new Set,customModels:this.customModels})),this.modelsByProviderMap=e.modelsByProviderMap,this.modelsMap=e.modelsMap}static buildMapsFromConfig(e){let{displayedModels:i,customModels:l}=e,s=i.size>0,a=Qs().modelMap,o=new Map,c=new Map,r=new sn;for(let d of l){if(s&&!i.has(d))continue;let u=Ke.parse(d),p={name:u.shortModelId,model:u.shortModelId,description:"Custom model",provider:u.providerId,roles:[],capabilities:[],input_types:[],output_types:[],release_date:"1970-01-01",custom:!0};o.set(d,p)}if(s)for(let d of i){let u=a.get(d);u&&c.set(d,u)}else c=new Map(a);c=new Map([...o,...c]);for(let[d,u]of c.entries()){let p=Ke.parse(d);r.add(p.providerId,u)}return{modelsByProviderMap:r,modelsMap:c}}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()],i=Ys().providerToOrderIdx;return e.sort((l,s)=>{let a=l[0],o=s[0];return(i.get(a)??0)-(i.get(o)??0)}),e}getModelsMap(){return this.modelsMap}getModel(e){return this.modelsMap.get(e)}};const Zs=qi("marimo:accept-completion-on-enter",!0,Zi,{getOnInit:!0});function wd(t){"scheduler"in window?window.scheduler.postTask(t,{priority:"background"}):"requestIdleCallback"in window?requestIdleCallback(t):setTimeout(t,0)}var Zt=null,Cd=class{constructor(t){Ae(this,"abortController",new AbortController);this.view=t.view,this.view.dom.addEventListener("focus",()=>{Zt=new WeakRef(this.view)},{signal:this.abortController.signal,capture:!0}),this.update()}update(){let t=this.view.dom.querySelector(".cm-vimCursorLayer");if(t instanceof HTMLElement)if(Wa())t.style.display="none";else{let e=(Zt==null?void 0:Zt.deref())===this.view;t.style.display=e?"":"none"}}destroy(){this.abortController.abort()}};const Xs={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 _d(t,e){let i=[];for(let l of t.split(`
2
- `)){if(l.startsWith('"')||l.trim()==="")continue;let s=Sd(l,e);s&&i.push(s)}return i}function Sd(t,e){let i=t.split(/\s+/),l=i[0],s=0;if(l in Xs){let a=Xs[l],o={};for(let r of a.args||[])if(s+=1,s<i.length)o[r]=i[s];else{e&&e(`Not enough arguments for "${l}" command: "${t}"`);return}let c={name:l};return"args"in a&&(c.args=o),"mode"in a&&(c.mode=a.mode),c}e&&e(`Unknown vimrc command: "${t}"`)}function Nd(){return Id(),Md(),[Ge.of([{key:"j",run:t=>{if(io(t,!0)&&Qi(t)){let e=t.state.facet(Pt),i=t.state.facet(Yi);return e.moveToNextCell({cellId:i,before:!1,noCreate:!0}),!0}return!1}}]),Ge.of([{key:"k",run:t=>{if(eo(t)&&Qi(t)){let e=t.state.facet(Pt),i=t.state.facet(Yi);return e.moveToNextCell({cellId:i,before:!0,noCreate:!0}),!0}return!1}}]),Ge.of([{linux:"Ctrl-[",win:"Ctrl-[",run:t=>{let e=ft(t);return e?ea(e)?e.state.vim.insertMode?(te.exitInsertMode(e,!0),!0):!1:(Z.warn("Expected CodeMirror instance to have Vim state"),!1):(Z.warn("Expected CodeMirror instance to have CodeMirror instance state"),!1)}}]),hn.define(t=>(requestAnimationFrame(()=>{Js.INSTANCES.addInstance(t)}),{destroy(){Js.INSTANCES.removeInstance(t)}})),hn.define(t=>new Cd({view:t})),$o.domEventHandlers({keydown(t,e){return t.ctrlKey&&t.key==="Escape"?(e.dom.dispatchEvent(new KeyboardEvent(t.type,t)),!0):!1}})]}function Bi(t,e){let i=t.cm6;if(!i)return;let l=i.coordsAtPos(i.state.selection.main.head);if(!l)return;let s=document.getElementById("App");if(!s)return;let a=s.clientHeight,o;switch(e){case"center":o=(l.top+l.bottom)/2-a/2;break;case"start":o=l.top;break;case"end":o=l.bottom-a;break}s.scrollBy({top:o,behavior:"smooth"})}var Id=Xe(()=>{te.defineAction("goToDefinition",t=>{let e=t.cm6;return no(e)}),te.mapCommand("gd","action","goToDefinition",{},{context:"normal"}),te.defineAction("scrollCursorToCenter",t=>Bi(t,"center")),te.mapCommand("zz","action","scrollCursorToCenter",{},{context:"normal"}),te.defineAction("scrollCursorToTop",t=>Bi(t,"start")),te.mapCommand("zt","action","scrollCursorToTop",{},{context:"normal"}),te.defineAction("scrollCursorToBottom",t=>Bi(t,"end")),te.mapCommand("zb","action","scrollCursorToBottom",{},{context:"normal"}),te.defineEx("write","w",t=>{let e=t.cm6;e&&e.state.facet(Pt).saveNotebook()})}),Md=Xe(async()=>{var e;let t=(e=ot.get(oi).keymap)==null?void 0:e.vimrc;if(t)try{Z.log(`Loading vimrc from ${t}`);let i=(await ir().sendFileDetails({path:t})).contents;if(!i){Z.error(`Failed to load vimrc from ${t}`);return}Kd(_d(i,Z.warn))}catch(i){Z.error("Failed to load vimrc:",i)}});function Kd(t){function e(a){if(!a.args){Z.warn(`Could not execute vimrc command "${a.name}: expected arguments"`);return}if(!a.args.lhs||!a.args.rhs){Z.warn(`Could not execute vimrc command "${a.name}: expected arguments"`);return}a.mode?te.map(a.args.lhs,a.args.rhs,a.mode):te.map(a.args.lhs,a.args.rhs)}function i(a){if(!a.args){Z.warn(`Could not execute vimrc command "${a.name}: expected arguments"`);return}if(!a.args.lhs||!a.args.rhs){Z.warn(`Could not execute vimrc command "${a.name}: expected arguments"`);return}a.mode?te.noremap(a.args.lhs,a.args.rhs,a.mode):te.noremap(a.args.lhs,a.args.rhs)}function l(a){if(!a.args){Z.warn(`Could not execute vimrc command "${a.name}: expected arguments"`);return}if(!a.args.lhs){Z.warn(`Could not execute vimrc command "${a.name}: expected arguments"`);return}a.mode?te.unmap(a.args.lhs,a.mode):te.unmap(a.args.lhs)}function s(a){a.mode?te.mapclear(a.mode):te.mapclear()}for(let a of t)"map|nmap|vmap|imap".split("|").includes(a.name)?e(a):"noremap|nnoremap|vnoremap|inoremap".split("|").includes(a.name)?i(a):"unmap|nunmap|vunmap|iunmap".split("|").includes(a.name)?l(a):"mapclear|nmapclear|vmapclear|imapclear".split("|").includes(a.name)?s(a):Z.warn(`Could not execute vimrc command "${a.name}: unknown command"`)}function Dd(t){return"getVimGlobalState_"in t&&typeof t.getVimGlobalState_=="function"}function Ad(){var e;if(!Dd(te))return!1;let t=(e=te.getVimGlobalState_())==null?void 0:e.macroModeState;return t?!!(t.isRecording||t.isPlaying):!1}var Js=(at=class{constructor(){Ae(this,"instances",new Set);Ae(this,"isBroadcasting",!1)}addInstance(e){this.instances.add(e);let i=ft(e);if(!i){Z.warn("Expected CodeMirror instance to have CodeMirror instance state");return}i.on("vim-mode-change",l=>{if(this.isBroadcasting)return;Et("mode"in l,'Expected event to have a "mode" property');let s=Ad();this.isBroadcasting=!0,wd(()=>{s||this.broadcastModeChange(e,l.mode,l.subMode),this.isBroadcasting=!1})})}removeInstance(e){this.instances.delete(e)}broadcastModeChange(e,i,l){Et("exitInsertMode"in te,"Vim does not have an exitInsertMode method"),Et("exitVisualMode"in te,"Vim does not have an exitVisualMode method");for(let s of this.instances)if(s!==e){let a=ft(s);if(!a){Z.warn("Expected CodeMirror instance to have CodeMirror instance state");continue}let o=a.setSelections.bind(a);if(a.setSelections=()=>[],!ea(a)){Z.warn("Expected CodeMirror instance to have Vim state");continue}let c=a.state.vim;switch(i){case"normal":c.insertMode&&te.exitInsertMode(a,!0),c.visualMode&&te.exitVisualMode(a,!0);break;case"insert":c.insertMode||te.handleKey(a,"i","mapping");break;case"visual":break}a.setSelections=o}}},Ae(at,"INSTANCES",new at),at);function ea(t){return t.state.vim!==void 0}const Pd=["default","vim"];function Ed(t,e){switch(t.preset){case"default":return[Ge.of(ta()),Ge.of(ia(e))];case"vim":return[Ge.of(Bd()),Ge.of(ia(e)),Ge.of([{key:"Enter",run:i=>{var l,s;return(s=(l=ft(i))==null?void 0:l.state.vim)!=null&&s.insertMode?Yo(i):!1}}]),pn.high(Fd("d",i=>i.state.doc.toString()==="",i=>i.state.doc.toString()===""?(i.state.facet(Pt).deleteCell(),!0):!1)),Ge.of(Od()),Ua({status:!1}),pn.high(Nd())];default:return er(t.preset),[]}}var Td=new Set([fn,gn,yn,xn]),ta=Xe(()=>Zo.filter(t=>!Td.has(t.run))),ia=t=>[{key:t.getHotkey("cell.toggleComment").key,run:fn},{key:t.getHotkey("cell.toggleBlockComment").key,run:gn},{key:t.getHotkey("cell.copyLineUp").key,run:yn},{key:t.getHotkey("cell.copyLineDown").key,run:xn}],Bd=Xe(()=>{let t=new Set(["Enter","Ctrl-v","ArrowUp","ArrowDown","ArrowLeft","ArrowRight"]);return ta().filter(e=>!t.has(e.key||e.mac||e.linux||e.win||""))});function Fd(t,e,i){let l="",s=0;return Ge.of([{any:(a,o)=>{let c=o.key,r=o.timeStamp;return c!==t||!e(a)?(l="",s=0,!1):l===t&&r-s<500&&i(a)?(l="",s=0,!0):(l=c,s=r,!1)}}])}function zd(t){var e;return((e=t==null?void 0:t.state.vim)==null?void 0:e.visualMode)===!0}function Od(){let t=e=>i=>zd(ft(i))?!1:e(i);return[{key:"ArrowDown",run:t(Xo),shift:t(Uo)},{key:"ArrowUp",run:t(qo),shift:t(Lo)},{key:"ArrowLeft",run:t(Qo),shift:t(Go)},{key:"ArrowRight",run:t(Wo),shift:t(Ho)}]}function na(){return["compact","medium","full","columns"]}var Vd={openai:t=>{var e;return!!((e=t==null?void 0:t.open_ai)!=null&&e.api_key)},anthropic:t=>{var e;return!!((e=t==null?void 0:t.anthropic)!=null&&e.api_key)},google:t=>{var e;return!!((e=t==null?void 0:t.google)!=null&&e.api_key)},github:t=>{var e;return!!((e=t==null?void 0:t.github)!=null&&e.api_key)},openrouter:t=>{var e;return!!((e=t==null?void 0:t.openrouter)!=null&&e.api_key)},azure:t=>{var e,i;return!!((e=t==null?void 0:t.azure)!=null&&e.api_key&&((i=t==null?void 0:t.azure)!=null&&i.base_url))},wandb:t=>{var e;return!!((e=t==null?void 0:t.wandb)!=null&&e.api_key)},"opencode-go":t=>{var e;return!!((e=t==null?void 0:t.opencode_go)!=null&&e.api_key)},bedrock:t=>{var e;return!!((e=t==null?void 0:t.bedrock)!=null&&e.region_name)},ollama:t=>{var e;return!!((e=t==null?void 0:t.ollama)!=null&&e.base_url)},deepseek:()=>!1,marimo:()=>!1};function Rd(t){for(let i of Yt)if(Vd[i](t))return i;let e=t==null?void 0:t.custom_providers;if(e){let i=Object.entries(e).find(([l,s])=>s==null?void 0:s.base_url);if(i)return i[0]}}function $d(t){let e=Rd(t);if(e)return Qs().defaultModelByProvider.get(e)}function Ld(t){var a,o;let e={chatModel:void 0,editModel:void 0},i=!((a=t==null?void 0:t.models)!=null&&a.chat_model),l=!((o=t==null?void 0:t.models)!=null&&o.edit_model);if(!i&&!l)return e;let s=$d(t);return s&&(i&&(e.chatModel=s),l&&(e.editModel=s)),e}var Gd=Ce();function la(t){return t.toLowerCase().replaceAll("+","-").trim()}function Hd(t,e){let i=t.getHotkeyGroups(),l=e?new Set(i[e]||[]):new Set,s=new Map;for(let c of t.iterate()){if(l.has(c))continue;let r=t.getHotkey(c);if(!r.key||r.key.trim()==="")continue;let d=la(r.key);s.has(d)||s.set(d,[]);let u=s.get(d);u&&u.push({action:c,name:r.name})}let a=[],o=new Set;for(let[c,r]of s.entries())if(r.length>1){a.push({key:c,actions:r});for(let{action:d}of r)o.add(d)}return{duplicates:a,hasDuplicate:c=>o.has(c),getDuplicatesFor:c=>{let r=t.getHotkey(c);if(!r.key||r.key.trim()==="")return[];let d=la(r.key),u=a.find(p=>p.key===d);return!u||u.actions.length<=1?[]:u.actions.filter(p=>p.action!==c).map(p=>p.action)}}}function Ud(t,e){let i=(0,Gd.c)(3),l;return i[0]!==t||i[1]!==e?(l=Hd(t,e),i[0]=t,i[1]=e,i[2]=l):l=i[2],l}var qd=Ce(),n=Ui(wo(),1);const Wd=t=>{let e=(0,qd.c)(7),{duplicates:i}=t;if(i.length===0)return null;let l,s;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=(0,n.jsx)(gi,{className:"h-4 w-4"}),s=(0,n.jsx)(qr,{children:"Duplicate shortcuts"}),e[0]=l,e[1]=s):(l=e[0],s=e[1]);let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=(0,n.jsx)("p",{className:"mb-2",children:"Multiple actions are assigned to the same keyboard shortcut:"}),e[2]=a):a=e[2];let o;e[3]===i?o=e[4]:(o=i.map(Yd),e[3]=i,e[4]=o);let c;return e[5]===o?c=e[6]:(c=(0,n.jsxs)(Bn,{variant:"warning",className:"mb-4",children:[l,s,(0,n.jsxs)(Tn,{children:[a,(0,n.jsx)("ul",{className:"space-y-2",children:o})]})]}),e[5]=o,e[6]=c),c};function Qd(t){let{action:e,name:i}=t;return(0,n.jsx)("li",{children:i},e)}function Yd(t){let{key:e,actions:i}=t;return(0,n.jsxs)("li",{className:"text-xs",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,n.jsx)(bi,{shortcut:e}),(0,n.jsx)("span",{className:"font-semibold",children:"is used by:"})]}),(0,n.jsx)("ul",{className:"ml-6 list-disc",children:i.map(Qd)})]},e)}const Fi=it(!1),Zd=()=>{let[t,e]=rt(Fi),[i,l]=(0,h.useState)(null),[s,a]=(0,h.useState)([]),[o,c]=tn(),r=nt(po),{saveUserConfig:d}=Ft(),{duplicates:u,hasDuplicate:p,getDuplicatesFor:g}=Ud(r,"Markdown");Hr("global.showHelp",()=>e(S=>!S));let x=async S=>{let f={...o};c(m=>({...m,...S})),await d({config:S}).catch(m=>{throw c(f),m})},v=async S=>{if(!i)return;let f=S.join("-"),m={keymap:{...o.keymap,overrides:{...o.keymap.overrides,[i]:f}}};l(null),a([]),await x(m)},j=async()=>{if(!i)return;let S={keymap:{...o.keymap,overrides:{...o.keymap.overrides}}};delete S.keymap.overrides[i],l(null),a([]),await x(S)},C=async()=>{if(!window.confirm("Are you sure you want to reset all shortcuts to their default values?"))return;let S={keymap:{...o.keymap,overrides:{}}};l(null),a([]),await x(S)};if(!t)return null;let I=S=>{let f=r.getHotkey(S);if(i===S){let P=co(S);return(0,n.jsxs)("div",{children:[(0,n.jsx)(ze,{defaultValue:s.join("+"),placeholder:f.name,onKeyDown:A=>{A.preventDefault();let B=[];if(A.key==="Meta"||A.key==="Control"||A.key==="Alt"||A.key==="Shift"||(A.metaKey&&B.push(en()?"Cmd":"Meta"),A.ctrlKey&&B.push("Ctrl"),A.altKey&&B.push("Alt"),A.shiftKey&&B.push("Shift"),A.key==="-"))return;if(A.key==="Escape"&&B.length===0){l(null),a([]);return}let M=A.key.length===1?A.key.toLowerCase():A.key;A.key===" "&&(M="Space"),B.push(M),v(B)},autoFocus:!0,endAdornment:(0,n.jsx)(se,{variant:"text",size:"xs",className:"mb-0",onClick:()=>{l(null),a([])},children:(0,n.jsx)(ui,{className:"w-4 h-4"})})}),(0,n.jsxs)("div",{className:"flex items-center justify-between w-full",children:[(0,n.jsx)("span",{className:"text-muted-foreground text-xs",children:"Press a key combination"}),P.key!==f.key&&(0,n.jsxs)("span",{className:"text-xs cursor-pointer text-primary",onClick:j,children:["Reset to default:"," ",(0,n.jsx)("span",{className:"font-mono",children:P.key})]})]})]},S)}let m=p(S),y=m?g(S):[];return(0,n.jsxs)("div",{className:"grid grid-cols-[auto_2fr_3fr] gap-2 items-center",children:[r.isEditable(S)?(0,n.jsx)(_n,{className:"cursor-pointer opacity-60 hover:opacity-100 text-muted-foreground w-3 h-3",onClick:()=>{a([]),l(S)}}):(0,n.jsx)("div",{className:"w-3 h-3"}),(0,n.jsx)(bi,{className:"justify-end",shortcut:f.key}),(0,n.jsxs)("div",{className:"flex items-center gap-1",children:[(0,n.jsx)("span",{children:f.name.toLowerCase()}),m&&(0,n.jsxs)("div",{className:"group relative inline-flex",children:[(0,n.jsx)(gi,{className:"w-3 h-3 text-(--yellow-11)"}),(0,n.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:"," ",y.map(P=>r.getHotkey(P).name.toLowerCase()).join(", ")]})]})]})]},S)},b=r.getHotkeyGroups(),_=(S,f)=>{let m=b[S];return(0,n.jsxs)("div",{className:"mb-[40px] gap-2 flex flex-col",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h3",{className:"text-lg font-medium",children:S}),f]}),m.map(I)]})};return(0,n.jsx)($r,{open:t,onOpenChange:S=>e(S),children:(0,n.jsxs)(Rr,{className:"sm:items-center sm:top-0",children:[(0,n.jsx)(Vr,{}),(0,n.jsxs)(Or,{usePortal:!1,className:"max-h-screen sm:max-h-[90vh] overflow-y-auto sm:max-w-[850px]",children:[(0,n.jsx)(Fr,{children:(0,n.jsx)(zr,{children:"Shortcuts"})}),(0,n.jsx)(Wd,{duplicates:u}),(0,n.jsxs)("div",{className:"flex flex-row gap-3",children:[(0,n.jsxs)("div",{className:"w-1/2",children:[_("Editing"),_("Markdown")]}),(0,n.jsxs)("div",{className:"w-1/2",children:[_("Navigation"),_("Running Cells"),_("Creation and Ordering"),(S=>_(S,(0,n.jsxs)("p",{className:"text-xs text-muted-foreground flex items-center gap-1",children:["Press"," ",o.keymap.preset==="vim"?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(bi,{shortcut:en()?"Cmd":"Ctrl"}),(0,n.jsx)(pe,{children:"Esc"})]}):(0,n.jsx)(pe,{children:"Esc"})," ","in a cell to enter command mode"]})))("Command"),_("Other"),(0,n.jsx)(se,{className:"mt-4 hover:bg-destructive/10 border-destructive hover:border-destructive",variant:"outline",size:"xs",onClick:C,tabIndex:-1,children:(0,n.jsx)("span",{className:"text-destructive",children:"Reset all to default"})})]})]})]})]})})};var sa="marimo:copilot:signedIn";const aa=qi(sa,null,Zi,{getOnInit:!0}),oa=it(null),Xt=it(null),ra=it({busy:!1,kind:null,message:null});function Xd(t){ot.set(Xt,t)}function Jd(t){ot.get(Xt)===t&&ot.set(Xt,null)}function eu(){return Ya.getItem(sa)==="true"}function ca(){let t=eu(),e=ho();return t&&e.completion.copilot==="github"}function tu(){return $a(oi,t=>t.completion.copilot==="github")}var zi=Jo(),re=Z.get("@github/copilot-language-server"),iu=1e4,da="python";function ua(t){Et(At(t)&&Wi(t,"request")&&Wi(t,"notify"),"LanguageServerClient is missing request/notify")}function nu(t){if(!At(t))return null;let{busy:e,kind:i,message:l,status:s}=t;return{busy:typeof e=="boolean"?e:!1,kind:typeof i=="string"?i:null,message:typeof l=="string"?l:null,status:typeof s=="string"?s:void 0}}function lu(t){return At(t)&&typeof t.type=="number"&&typeof t.message=="string"}var su=class extends qa{constructor(e){super(e);Ae(this,"documentVersion",0);Ae(this,"openDocumentCount",0);Ae(this,"copilotSettings",{});Ae(this,"getCompletionInternal",async(e,i)=>await this._request("textDocument/inlineCompletion",{...e,textDocument:{...zi.VersionedTextDocumentIdentifier.create(e.textDocument.uri,i)}}));Ae(this,"throttledGetCompletionInternal",rc(this.getCompletionInternal,200));Ae(this,"handleNotification",e=>{if(!(!At(e)||typeof e.method!="string")){if(e.method==="statusNotification"||e.method==="didChangeStatus"){let i=nu(e.params);i?ot.set(ra,i):re.warn("#statusNotification: Ignoring a status update with no params",e.params);return}if(e.method==="window/logMessage"&&lu(e.params)){let{type:i,message:l}=e.params;switch(i){case 1:re.error("[GitHub Copilot]",l);break;case 2:re.warn("[GitHub Copilot]",l);break;case 3:re.debug("[GitHub Copilot]",l);break;default:re.log("[GitHub Copilot]",l);break}}}});this.copilotSettings=e.copilotSettings??{},this.onNotification(this.handleNotification),this.attachInitializeListener()}attachInitializeListener(){this.initializePromise.then(()=>this.sendConfiguration()).catch(e=>{re.warn("#initialize: Failed to send configuration",e)})}async reInitialize(){re.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}),re.debug("#sendConfiguration: Configuration sent",e))}async _request(e,i){return ua(this),await this.request(e,i,iu)}async sendNotification(e,i){return re.debug("#notify",e,i),ua(this),this.notify(e,i)}getInitializationOptions(){let e={name:"marimo",version:"0.1.0"};return{...super.getInitializationOptions(),workspaceFolders:[],capabilities:{workspace:{workspaceFolders:!1}},initializationOptions:{editorInfo:e,editorPluginInfo:e}}}isDisabled(){return!ca()}async textDocumentDidOpen(e){return this.isDisabled()?!1:(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){var o;if(this.isDisabled())return;let i=e.contentChanges[0];if(!i){re.warn("#textDocumentDidChange: Ignoring an update with no content changes.",e);return}this.openDocumentCount===0&&await this.textDocumentDidOpen({textDocument:{uri:e.textDocument.uri,languageId:da,version:e.textDocument.version,text:i.text}});let l=e.contentChanges;l.length!==1&&re.warn("#textDocumentDidChange: Multiple changes detected. This is not supported.",l),"range"in i&&re.warn("#textDocumentDidChange: Copilot doesn't support range changes.",i);let s=Ja(i.text),a=++this.documentVersion;return this.lastOpenedDocument={textDocument:{uri:e.textDocument.uri,languageId:((o=this.lastOpenedDocument)==null?void 0:o.textDocument.languageId)??da,version:a,text:s}},super.textDocumentDidChange({...e,contentChanges:[{text:s}],textDocument:zi.VersionedTextDocumentIdentifier.create(e.textDocument.uri,a)})}textDocumentHover(e){return Promise.resolve({contents:[]})}signOut(){return this._request("signOut",{})}async signInInitiate(){re.log("#signInInitiate: Starting sign-in flow");try{let e=await this._request("signIn",{});return re.log("#signInInitiate: Sign-in flow started successfully"),e}catch(e){throw re.warn("#signInInitiate: Failed to start sign-in flow",e),e}}async signInConfirm(e){re.log("#signInConfirm: Confirming sign-in");try{let i=await this._request("signInConfirm",e);return re.log("#signInConfirm: Sign-in confirmed successfully"),i}catch(i){throw re.warn("#signInConfirm: Failed to confirm sign-in",i),i}}async signedIn(){try{let{status:e}=await this._request("checkStatus",{});return re.log("#checkStatus: Status check completed",{status:e}),e==="SignedIn"||e==="AlreadySignedIn"||e==="OK"}catch(e){throw re.warn("#signedIn: Failed to check sign-in status",e),e}}async getCompletion(e){if(this.isDisabled())return null;let i=this.documentVersion;if(i===0)return null;Xd(i);let l;try{l=await this.throttledGetCompletionInternal({...e,textDocument:zi.VersionedTextDocumentIdentifier.create(e.textDocument.uri,i)},i)}catch(s){return re.warn("#getCompletion: Failed to fetch completions",s),null}finally{Jd(i)}return i===this.documentVersion?l??null:null}},au=class extends Qa{constructor(t){super({getWsUrl:t.getWsUrl,waitForConnection:t.waitForReady,retries:t.retries??3,retryDelayMs:t.retryDelayMs??1e3,onConnectionFailure:e=>{t.showError("GitHub Copilot Connection Error",`Failed to connect to GitHub Copilot. Please check your settings and try again.
1
+ var Va=Object.defineProperty;var Ra=(t,e,i)=>e in t?Va(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;var Ae=(t,e,i)=>Ra(t,typeof e!="symbol"?e+"":e,i);var at;import{s as Ui}from"./chunk-LvLJmgfZ.js";import{d as Kt,i as ot,l as rt,n as Dt,o as $a,p as it,u as nt}from"./useEvent-D91BmmQi.js";import{t as La}from"./react-Bj1aDYRI.js";import{Bn as qi,Cn as ft,Cr as Ga,Di as Ha,G as Ua,Gi as Wi,Gt as Qi,Kt as At,Mr as qa,Nr as ai,Nt as ee,Ri as Wa,Sn as te,Sr as Qa,Ut as Ya,Wt as Za,ai as Yi,dn as Xa,gn as Ja,hn as eo,ii as Pt,jn as to,kr as io,vn as Zi,wi as no,wn as lo}from"./cells-C3V6s-g5.js";import{t as Xi}from"./react-dom-CSu739Rf.js";import{t as Ce}from"./compiler-runtime-B3qBwwSJ.js";import{t as so}from"./isObject-DvLSfCY5.js";import{t as Ji}from"./get-C-qh_et5.js";import{t as ao}from"./merge-_9WLTEyt.js";import{t as oo}from"./debounce-OiXznToA.js";import{t as ro}from"./has-CMvx-Y7P.js";import{f as en,g as Z,l as co}from"./useEventListener-C0195JsF.js";import{t as Et}from"./invariant-CkiqGLcK.js";import{A as uo,C as tn,T as nn,d as mo,g as po,h as ho,j as go,k as ln,n as fo,u as xo,x as oi}from"./utils-BWBBpCkT.js";import{M as ct,S as yo,j as vo,r as bo}from"./config-B-Q7J_6d.js";import{i as ko,n as ri,t as jo}from"./switch-OVajJBPR.js";import{t as Pe}from"./cn-DYvqRARy.js";import{t as wo}from"./jsx-runtime-Blw4afVn.js";import{a as Co,i as _o,n as sn,o as So,r as an,t as No}from"./config-BJVx3eBW.js";import{a as on,c as xt,d as Io,i as Mo,o as Tt,r as Ko,s as rn,t as Do}from"./popover-Bcz1Zikb.js";import{i as ci,l as Me,n as Ao,r as Po,s as Eo,t as To}from"./select-BP75_5jJ.js";import{a as Bo,c as Bt,d as cn,f as dn,p as Fo,r as zo,s as Oo,t as Vo,u as un}from"./dropdown-menu-dHmZR8bI.js";import{t as Le}from"./label-CqjrpwRC.js";import{t as We}from"./tooltip-4bZlU7jl.js";import{n as Ro,r as mn,t as se}from"./button-DDGiD1NW.js";import{Tt as Ge,qt as pn,st as $o,ut as hn}from"./dist-12S8I4CH.js";import{F as Lo,L as gn,M as Go,N as Ho,P as Uo,R as fn,b as qo,f as xn,g as Wo,h as Qo,k as Yo,p as yn,x as Zo,y as Xo}from"./dist-CiVShZKM.js";import{s as vn}from"./arrays-DbOq36rN.js";import{n as Xe}from"./once-CGKw_kwj.js";import{t as Jo}from"./main-BNL5rxQw.js";import{i as er,n as tr,t as di}from"./strings--BknHX9C.js";import{r as Ft,t as ir}from"./requests-9-v2bhoi.js";import{t as Je}from"./createLucideIcon-w-Qo9n0R.js";import{t as nr}from"./check-rzLRd0j9.js";import{r as lr,t as ui}from"./x-C-Eq0ag8.js";import{t as sr}from"./chevron-right-BS_NcSch.js";import{u as ar}from"./toDate-Ct2FT81-.js";import{t as or}from"./copy-3iHFdt22.js";import{n as zt,t as bn}from"./spinner-D-V4psAa.js";import{t as rr}from"./plus-AgXtozBz.js";import{t as kn}from"./refresh-cw-CYq4mK5a.js";import{$ as He,B as cr,C as dr,D as ur,G as Ot,J as mr,O as Vt,S as jn,V as mi,X as wn,_ as pr,at as pi,b as hr,ct as hi,et as Cn,g as gr,lt as fr,nt as xr,o as yt,r as ze,rt as yr,st as Rt,ut as $t,w as vt}from"./input-JxFwu-3G.js";import{a as dt,c as G,g as _n,h as bt,i as vr,n as V,o as O,p as br,r as H,s as z,t as kr,u as jr}from"./form-B6jUSJBp.js";import{t as Sn}from"./trash-2-72W0TZ3L.js";import{t as gi}from"./triangle-alert-BL4YVsPy.js";import{t as kt}from"./badge-B92a4ePY.js";import{t as Oe}from"./use-toast-BwJoaaDM.js";import{t as wr}from"./useTheme-Bxv9B31g.js";import{n as Cr}from"./copy-Bxb1_Gtw.js";import{B as jt,E as _r,I as Nn,M as fi,N as ut,O as xi,P as Ue,R as In,V as Lt,_ as Sr,j as et,k as Ve,l as Nr,m as Ir,p as Mr,t as Mn,v as Kn,y as Kr,z as Dr}from"./usePress-5hBv4sjD.js";import{t as Dn}from"./SSRProvider-BUSmWJKC.js";import{_ as An,a as yi,c as Gt,d as Ar,f as tt,g as lt,m as mt,p as Pn,s as Pr,t as Er,u as En,v as Tr}from"./RSPContexts-WiCgGm__.js";import{t as Ht}from"./context-BFPaAUK_.js";import{n as Br}from"./useDebounce-JDKr83KO.js";import{a as Fr,c as zr,n as Or,o as Vr,s as Rr,t as $r}from"./dialog-BCVepWLJ.js";import{i as Lr,r as Gr,t as Hr}from"./useHotkey-DLZvrRZT.js";import{a as Ur}from"./errors-PgHhDa-M.js";import{t as pe}from"./kbd-C5HnBH5U.js";import{t as oe}from"./links-wcQA1Np1.js";import{n as Tn,r as qr,t as Bn}from"./alert-jlwhGxSb.js";import{n as Wr,t as wt}from"./error-banner-BSxEOIn2.js";import{n as Fn}from"./useAsyncData-Bg5iAViP.js";import{a as Qr,i as Ut,n as Yr,o as zn,r as vi,t as Zr}from"./table-CH2plyy9.js";import{t as bi}from"./renderShortcut-Bl8_FVn8.js";import{r as Xr}from"./textarea-DZB2bzVL.js";import{n as Jr,t as ec}from"./azure-BjL5s4-w.js";import{a as tc,i as ic,n as nc,r as lc,t as sc}from"./card-DIbLM4TA.js";var ac="Expected a function";function oc(t,e,i){var l=!0,s=!0;if(typeof t!="function")throw TypeError(ac);return so(i)&&(l="leading"in i?!!i.leading:l,s="trailing"in i?!!i.trailing:s),oo(t,e,{leading:l,maxWait:e,trailing:s})}var rc=oc,ki=Je("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"}]]),On=Je("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"}]]),Vn=Je("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"}]]),cc=Je("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"}]]),Rn=Je("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"}]]),dc=Je("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"}]]),$n=Je("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"}]]),uc=Je("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"}]]),h=Ui(La(),1);function Ln(t,e){let i=(0,h.useRef)(!0),l=(0,h.useRef)(null);Lt(()=>(i.current=!0,()=>{i.current=!1}),[]),Lt(()=>{i.current?i.current=!1:(!l.current||e.some((s,a)=>!Object.is(s,l[a])))&&t(),l.current=e},e)}function Gn(t,e){let{collection:i,onLoadMore:l,scrollOffset:s=1}=t,a=(0,h.useRef)(null),o=Mr(c=>{for(let r of c)r.isIntersecting&&l&&l()});Lt(()=>(e.current&&(a.current=new IntersectionObserver(o,{root:lt(e==null?void 0:e.current),rootMargin:`0px ${100*s}% ${100*s}% ${100*s}%`}),a.current.observe(e.current)),()=>{a.current&&a.current.disconnect()}),[i,e,s])}function Hn(t){let e=h.version.split(".");return parseInt(e[0],10)>=19?t:t?"true":void 0}var mc="react-aria-clear-focus",pc="react-aria-focus",hc=500;function gc(t){let{isDisabled:e,onLongPressStart:i,onLongPressEnd:l,onLongPress:s,threshold:a=hc,accessibilityDescription:o}=t,c=(0,h.useRef)(void 0),{addGlobalListener:r,removeGlobalListener:d}=Ir(),{pressProps:u}=Mn({isDisabled:e,onPressStart(p){if(p.continuePropagation(),(p.pointerType==="mouse"||p.pointerType==="touch")&&(i&&i({...p,type:"longpressstart"}),c.current=setTimeout(()=>{p.target.dispatchEvent(new PointerEvent("pointercancel",{bubbles:!0})),Nn(p.target).activeElement!==p.target&&xi(p.target),s&&s({...p,type:"longpress"}),c.current=void 0},a),p.pointerType==="touch")){let g=x=>{x.preventDefault()};r(p.target,"contextmenu",g,{once:!0}),r(window,"pointerup",()=>{setTimeout(()=>{d(p.target,"contextmenu",g)},30)},{once:!0})}},onPressEnd(p){c.current&&clearTimeout(c.current),l&&(p.pointerType==="mouse"||p.pointerType==="touch")&&l({...p,type:"longpressend"})}});return{longPressProps:Ve(u,Pn(s&&!e?o:void 0))}}function fc(t,e){let i=e==null?void 0:e.isDisabled,[l,s]=(0,h.useState)(!1);return Lt(()=>{if(t!=null&&t.current&&!i){let a=()=>{t.current&&s(!!Gt(t.current,{tabbable:!0}).nextNode())};a();let o=new MutationObserver(a);return o.observe(t.current,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabIndex","disabled"]}),()=>{o.disconnect()}}}),i?!1:l}function Un(t){let e=yc(Nn(t));e!==t&&(e&&xc(e,t),t&&qn(t,e))}function xc(t,e){t.dispatchEvent(new FocusEvent("blur",{relatedTarget:e})),t.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:e}))}function qn(t,e){t.dispatchEvent(new FocusEvent("focus",{relatedTarget:e})),t.dispatchEvent(new FocusEvent("focusin",{bubbles:!0,relatedTarget:e}))}function yc(t){let e=ut(t),i=e==null?void 0:e.getAttribute("aria-activedescendant");return i&&t.getElementById(i)||e}function ji(t){return _r()?t.altKey:t.ctrlKey}function qt(t,e){var s,a;let i=`[data-key="${CSS.escape(String(e))}"]`,l=(s=t.current)==null?void 0:s.dataset.collection;return l&&(i=`[data-collection="${CSS.escape(l)}"]${i}`),(a=t.current)==null?void 0:a.querySelector(i)}var Wn=new WeakMap;function vc(t){let e=jt();return Wn.set(t,e),e}function bc(t){return Wn.get(t)}var kc=1e3;function jc(t){let{keyboardDelegate:e,selectionManager:i,onTypeSelect:l}=t,s=(0,h.useRef)({search:"",timeout:void 0}).current;return{typeSelectProps:{onKeyDownCapture:e.getKeyForSearch?a=>{let o=wc(a.key);if(!(!o||a.ctrlKey||a.metaKey||!et(a.currentTarget,Ue(a))||s.search.length===0&&o===" ")){if(o===" "&&s.search.trim().length>0&&(a.preventDefault(),"continuePropagation"in a||a.stopPropagation()),s.search+=o,e.getKeyForSearch!=null){let c=e.getKeyForSearch(s.search,i.focusedKey);c??(c=e.getKeyForSearch(s.search)),c!=null&&(i.setFocusedKey(c),l&&l(c))}clearTimeout(s.timeout),s.timeout=setTimeout(()=>{s.search=""},kc)}}:void 0}}}function wc(t){return t.length===1||!/^[A-Z]/i.test(t)?t:""}var Cc=Xi();function _c(t){let{selectionManager:e,keyboardDelegate:i,ref:l,autoFocus:s=!1,shouldFocusWrap:a=!1,disallowEmptySelection:o=!1,disallowSelectAll:c=!1,escapeKeyBehavior:r="clearSelection",selectOnFocus:d=e.selectionBehavior==="replace",disallowTypeAhead:u=!1,shouldUseVirtualFocus:p,allowsTabNavigation:g=!1,scrollRef:x=l,linkBehavior:v="action"}=t,{direction:j}=Ht(),C=Kn(),I=k=>{var T,F,U,W,N,q,ie,ce,de,fe,he,xe;if(k.altKey&&k.key==="Tab"&&k.preventDefault(),!l.current||!et(l.current,Ue(k)))return;let D=(E,X)=>{if(E!=null){if(e.isLink(E)&&v==="selection"&&d&&!ji(k)){(0,Cc.flushSync)(()=>{e.setFocusedKey(E,X)});let Y=qt(l,E),Q=e.getItemProps(E);Y&&C.open(Y,k,Q.href,Q.routerOptions);return}if(e.setFocusedKey(E,X),e.isLink(E)&&v==="override")return;k.shiftKey&&e.selectionMode==="multiple"?e.extendSelection(E):d&&!ji(k)&&e.replaceSelection(E)}};switch(k.key){case"ArrowDown":if(i.getKeyBelow){let E=e.focusedKey==null?(T=i.getFirstKey)==null?void 0:T.call(i):(F=i.getKeyBelow)==null?void 0:F.call(i,e.focusedKey);E==null&&a&&(E=(U=i.getFirstKey)==null?void 0:U.call(i,e.focusedKey)),E!=null&&(k.preventDefault(),D(E))}break;case"ArrowUp":if(i.getKeyAbove){let E=e.focusedKey==null?(W=i.getLastKey)==null?void 0:W.call(i):(N=i.getKeyAbove)==null?void 0:N.call(i,e.focusedKey);E==null&&a&&(E=(q=i.getLastKey)==null?void 0:q.call(i,e.focusedKey)),E!=null&&(k.preventDefault(),D(E))}break;case"ArrowLeft":if(i.getKeyLeftOf){let E=e.focusedKey==null?null:(ie=i.getKeyLeftOf)==null?void 0:ie.call(i,e.focusedKey);E==null&&a&&(E=j==="rtl"?(ce=i.getFirstKey)==null?void 0:ce.call(i,e.focusedKey):(de=i.getLastKey)==null?void 0:de.call(i,e.focusedKey)),E!=null&&(k.preventDefault(),D(E,j==="rtl"?"first":"last"))}break;case"ArrowRight":if(i.getKeyRightOf){let E=e.focusedKey==null?null:(fe=i.getKeyRightOf)==null?void 0:fe.call(i,e.focusedKey);E==null&&a&&(E=j==="rtl"?(he=i.getLastKey)==null?void 0:he.call(i,e.focusedKey):(xe=i.getFirstKey)==null?void 0:xe.call(i,e.focusedKey)),E!=null&&(k.preventDefault(),D(E,j==="rtl"?"last":"first"))}break;case"Home":if(i.getFirstKey){if(e.focusedKey===null&&k.shiftKey)return;k.preventDefault();let E=i.getFirstKey(e.focusedKey,mt(k));e.setFocusedKey(E),E!=null&&(mt(k)&&k.shiftKey&&e.selectionMode==="multiple"?e.extendSelection(E):d&&e.replaceSelection(E))}break;case"End":if(i.getLastKey){if(e.focusedKey===null&&k.shiftKey)return;k.preventDefault();let E=i.getLastKey(e.focusedKey,mt(k));e.setFocusedKey(E),E!=null&&(mt(k)&&k.shiftKey&&e.selectionMode==="multiple"?e.extendSelection(E):d&&e.replaceSelection(E))}break;case"PageDown":if(i.getKeyPageBelow&&e.focusedKey!=null){let E=i.getKeyPageBelow(e.focusedKey);E!=null&&(k.preventDefault(),D(E))}break;case"PageUp":if(i.getKeyPageAbove&&e.focusedKey!=null){let E=i.getKeyPageAbove(e.focusedKey);E!=null&&(k.preventDefault(),D(E))}break;case"a":mt(k)&&e.selectionMode==="multiple"&&c!==!0&&(k.preventDefault(),e.selectAll());break;case"Escape":r==="clearSelection"&&!o&&e.selectedKeys.size!==0&&(k.stopPropagation(),k.preventDefault(),e.clearSelection());break;case"Tab":if(!g){if(k.shiftKey)l.current.focus();else{let E=Gt(l.current,{tabbable:!0}),X,Y;do Y=E.lastChild(),Y&&(X=Y);while(Y);let Q=ut();X&&(!fi(X)||Q&&!Nr(Q))&&xi(X)}break}}},b=(0,h.useRef)({top:0,left:0});Rt(x,"scroll",()=>{var k,D;b.current={top:((k=x.current)==null?void 0:k.scrollTop)??0,left:((D=x.current)==null?void 0:D.scrollLeft)??0}});let _=k=>{var D,T;if(e.isFocused){et(k.currentTarget,Ue(k))||e.setFocused(!1);return}if(et(k.currentTarget,Ue(k))){if(e.setFocused(!0),e.focusedKey==null){let F=W=>{W!=null&&(e.setFocusedKey(W),d&&!e.isSelected(W)&&e.replaceSelection(W))},U=k.relatedTarget;U&&k.currentTarget.compareDocumentPosition(U)&Node.DOCUMENT_POSITION_FOLLOWING?F(e.lastSelectedKey??((D=i.getLastKey)==null?void 0:D.call(i))):F(e.firstSelectedKey??((T=i.getFirstKey)==null?void 0:T.call(i)))}else x.current&&(x.current.scrollTop=b.current.top,x.current.scrollLeft=b.current.left);if(e.focusedKey!=null&&x.current){let F=qt(l,e.focusedKey);F instanceof HTMLElement&&(!fi(F)&&!p&&xi(F),Cn()==="keyboard"&&tt(F,{containingElement:l.current}))}}},S=k=>{et(k.currentTarget,k.relatedTarget)||e.setFocused(!1)},f=(0,h.useRef)(!1);Rt(l,pc,p?k=>{let{detail:D}=k;k.stopPropagation(),e.setFocused(!0),(D==null?void 0:D.focusStrategy)==="first"&&(f.current=!0)}:void 0),Ln(()=>{var k;if(f.current){let D=((k=i.getFirstKey)==null?void 0:k.call(i))??null;if(D==null){let T=ut();Un(l.current),qn(T,null),e.collection.size>0&&(f.current=!1)}else e.setFocusedKey(D),f.current=!1}},[e.collection]),Ln(()=>{e.collection.size>0&&(f.current=!1)},[e.focusedKey]),Rt(l,mc,p?k=>{var D;k.stopPropagation(),e.setFocused(!1),(D=k.detail)!=null&&D.clearFocusKey&&e.setFocusedKey(null)}:void 0);let m=(0,h.useRef)(s),y=(0,h.useRef)(!1);(0,h.useEffect)(()=>{var k,D;if(m.current){let T=null;s==="first"&&(T=((k=i.getFirstKey)==null?void 0:k.call(i))??null),s==="last"&&(T=((D=i.getLastKey)==null?void 0:D.call(i))??null);let F=e.selectedKeys;if(F.size){for(let U of F)if(e.canSelectItem(U)){T=U;break}}e.setFocused(!0),e.setFocusedKey(T),T==null&&!p&&l.current&&He(l.current),e.collection.size>0&&(m.current=!1,y.current=!0)}});let P=(0,h.useRef)(e.focusedKey),A=(0,h.useRef)(null);(0,h.useEffect)(()=>{if(e.isFocused&&e.focusedKey!=null&&(e.focusedKey!==P.current||y.current)&&x.current&&l.current){let k=Cn(),D=qt(l,e.focusedKey);if(!(D instanceof HTMLElement))return;(k==="keyboard"||y.current)&&(A.current&&cancelAnimationFrame(A.current),A.current=requestAnimationFrame(()=>{x.current&&(Ar(x.current,D),k!=="virtual"&&tt(D,{containingElement:l.current}))}))}!p&&e.isFocused&&e.focusedKey==null&&P.current!=null&&l.current&&He(l.current),P.current=e.focusedKey,y.current=!1}),(0,h.useEffect)(()=>()=>{A.current&&cancelAnimationFrame(A.current)},[]),Rt(l,"react-aria-focus-scope-restore",k=>{k.preventDefault(),e.setFocused(!0)});let B={onKeyDown:I,onFocus:_,onBlur:S,onMouseDown(k){x.current===Ue(k)&&k.preventDefault()}},{typeSelectProps:M}=jc({keyboardDelegate:i,selectionManager:e});u||(B=Ve(M,B));let w;p||(w=e.focusedKey==null?0:-1);let K=vc(e.collection);return{collectionProps:Ve(B,{tabIndex:w,"data-collection":K})}}function Qn(t){let{id:e,selectionManager:i,key:l,ref:s,shouldSelectOnPressUp:a,shouldUseVirtualFocus:o,focus:c,isDisabled:r,onAction:d,allowsDifferentPressOrigin:u,linkBehavior:p="action"}=t,g=Kn();e=jt(e);let x=N=>{if(N.pointerType==="keyboard"&&ji(N))i.toggleSelection(l);else{if(i.selectionMode==="none")return;if(i.isLink(l)){if(p==="selection"&&s.current){let q=i.getItemProps(l);g.open(s.current,N,q.href,q.routerOptions),i.setSelectedKeys(i.selectedKeys);return}else if(p==="override"||p==="none")return}i.selectionMode==="single"?i.isSelected(l)&&!i.disallowEmptySelection?i.toggleSelection(l):i.replaceSelection(l):N&&N.shiftKey?i.extendSelection(l):i.selectionBehavior==="toggle"||N&&(mt(N)||N.pointerType==="touch"||N.pointerType==="virtual")?i.toggleSelection(l):i.replaceSelection(l)}};(0,h.useEffect)(()=>{l===i.focusedKey&&i.isFocused&&(o?Un(s.current):c?c():ut()!==s.current&&s.current&&He(s.current))},[s,l,i.focusedKey,i.childFocusStrategy,i.isFocused,o]),r||(r=i.isDisabled(l));let v={};!o&&!r?v={tabIndex:l===i.focusedKey?0:-1,onFocus(N){Ue(N)===s.current&&i.setFocusedKey(l)}}:r&&(v.onMouseDown=N=>{N.preventDefault()}),(0,h.useEffect)(()=>{r&&i.focusedKey===l&&i.setFocusedKey(null)},[i,r,l]);let j=i.isLink(l)&&p==="override",C=d&&t.UNSTABLE_itemBehavior==="action",I=i.isLink(l)&&p!=="selection"&&p!=="none",b=!r&&i.canSelectItem(l)&&!j&&!C,_=(d||I)&&!r,S=_&&(i.selectionBehavior==="replace"?!b:!b||i.isEmpty),f=_&&b&&i.selectionBehavior==="replace",m=S||f,y=(0,h.useRef)(null),P=m&&b,A=(0,h.useRef)(!1),B=(0,h.useRef)(!1),M=i.getItemProps(l),w=N=>{if(d){var q;d(),(q=s.current)==null||q.dispatchEvent(new CustomEvent("react-aria-item-action",{bubbles:!0}))}I&&s.current&&g.open(s.current,N,M.href,M.routerOptions)},K={ref:s};if(a?(K.onPressStart=N=>{y.current=N.pointerType,A.current=P,N.pointerType==="keyboard"&&(!m||Zn(N.key))&&x(N)},u?(K.onPressUp=S?void 0:N=>{N.pointerType==="mouse"&&b&&x(N)},K.onPress=S?w:N=>{N.pointerType!=="keyboard"&&N.pointerType!=="mouse"&&b&&x(N)}):K.onPress=N=>{if(S||f&&N.pointerType!=="mouse"){if(N.pointerType==="keyboard"&&!Yn(N.key))return;w(N)}else N.pointerType!=="keyboard"&&b&&x(N)}):(K.onPressStart=N=>{y.current=N.pointerType,A.current=P,B.current=S,b&&(N.pointerType==="mouse"&&!S||N.pointerType==="keyboard"&&(!_||Zn(N.key)))&&x(N)},K.onPress=N=>{(N.pointerType==="touch"||N.pointerType==="pen"||N.pointerType==="virtual"||N.pointerType==="keyboard"&&m&&Yn(N.key)||N.pointerType==="mouse"&&B.current)&&(m?w(N):b&&x(N))}),v["data-collection"]=bc(i.collection),v["data-key"]=l,K.preventFocusOnPress=o,o&&(K=Ve(K,{onPressStart(N){N.pointerType!=="touch"&&(i.setFocused(!0),i.setFocusedKey(l))},onPress(N){N.pointerType==="touch"&&(i.setFocused(!0),i.setFocusedKey(l))}})),M)for(let N of["onPressStart","onPressEnd","onPressChange","onPress","onPressUp","onClick"])M[N]&&(K[N]=In(K[N],M[N]));let{pressProps:k,isPressed:D}=Mn(K),T=f?N=>{y.current==="mouse"&&(N.stopPropagation(),N.preventDefault(),w(N))}:void 0,{longPressProps:F}=gc({isDisabled:!P,onLongPress(N){N.pointerType==="touch"&&(x(N),i.setSelectionBehavior("toggle"))}}),U=N=>{y.current==="touch"&&A.current&&N.preventDefault()},W=p!=="none"&&i.isLink(l)?N=>{Sr.isOpening||N.preventDefault()}:void 0;return{itemProps:Ve(v,b||S||o&&!r?k:{},P?F:{},{onDoubleClick:T,onDragStartCapture:U,onClick:W,id:e},o?{onMouseDown:N=>N.preventDefault()}:void 0),isPressed:D,isSelected:i.isSelected(l),isFocused:i.isFocused&&i.focusedKey===l,isDisabled:r,allowsSelection:b,hasAction:m}}function Yn(t){return t==="Enter"}function Zn(t){return t===" "}var Xn=class{getItemRect(t){let e=this.ref.current;if(!e)return null;let i=t==null?null:qt(this.ref,t);if(!i)return null;let l=e.getBoundingClientRect(),s=i.getBoundingClientRect();return{x:s.left-l.left-e.clientLeft+e.scrollLeft,y:s.top-l.top-e.clientTop+e.scrollTop,width:s.width,height:s.height}}getContentSize(){let t=this.ref.current;return{width:(t==null?void 0:t.scrollWidth)??0,height:(t==null?void 0:t.scrollHeight)??0}}getVisibleRect(){let t=this.ref.current;return{x:(t==null?void 0:t.scrollLeft)??0,y:(t==null?void 0:t.scrollTop)??0,width:(t==null?void 0:t.clientWidth)??0,height:(t==null?void 0:t.clientHeight)??0}}constructor(t){this.ref=t}},wi=class{isDisabled(t){var e;return this.disabledBehavior==="all"&&(((e=t.props)==null?void 0:e.isDisabled)||this.disabledKeys.has(t.key))}findNextNonDisabled(t,e){let i=t;for(;i!=null;){let l=this.collection.getItem(i);if((l==null?void 0:l.type)==="item"&&!this.isDisabled(l))return i;i=e(i)}return null}getNextKey(t){let e=t;return e=this.collection.getKeyAfter(e),this.findNextNonDisabled(e,i=>this.collection.getKeyAfter(i))}getPreviousKey(t){let e=t;return e=this.collection.getKeyBefore(e),this.findNextNonDisabled(e,i=>this.collection.getKeyBefore(i))}findKey(t,e,i){let l=t,s=this.layoutDelegate.getItemRect(l);if(!s||l==null)return null;let a=s;do{if(l=e(l),l==null)break;s=this.layoutDelegate.getItemRect(l)}while(s&&i(a,s)&&l!=null);return l}isSameRow(t,e){return t.y===e.y||t.x!==e.x}isSameColumn(t,e){return t.x===e.x||t.y!==e.y}getKeyBelow(t){return this.layout==="grid"&&this.orientation==="vertical"?this.findKey(t,e=>this.getNextKey(e),this.isSameRow):this.getNextKey(t)}getKeyAbove(t){return this.layout==="grid"&&this.orientation==="vertical"?this.findKey(t,e=>this.getPreviousKey(e),this.isSameRow):this.getPreviousKey(t)}getNextColumn(t,e){return e?this.getPreviousKey(t):this.getNextKey(t)}getKeyRightOf(t){let e=this.direction==="ltr"?"getKeyRightOf":"getKeyLeftOf";return this.layoutDelegate[e]?(t=this.layoutDelegate[e](t),this.findNextNonDisabled(t,i=>this.layoutDelegate[e](i))):this.layout==="grid"?this.orientation==="vertical"?this.getNextColumn(t,this.direction==="rtl"):this.findKey(t,i=>this.getNextColumn(i,this.direction==="rtl"),this.isSameColumn):this.orientation==="horizontal"?this.getNextColumn(t,this.direction==="rtl"):null}getKeyLeftOf(t){let e=this.direction==="ltr"?"getKeyLeftOf":"getKeyRightOf";return this.layoutDelegate[e]?(t=this.layoutDelegate[e](t),this.findNextNonDisabled(t,i=>this.layoutDelegate[e](i))):this.layout==="grid"?this.orientation==="vertical"?this.getNextColumn(t,this.direction==="ltr"):this.findKey(t,i=>this.getNextColumn(i,this.direction==="ltr"),this.isSameColumn):this.orientation==="horizontal"?this.getNextColumn(t,this.direction==="ltr"):null}getFirstKey(){let t=this.collection.getFirstKey();return this.findNextNonDisabled(t,e=>this.collection.getKeyAfter(e))}getLastKey(){let t=this.collection.getLastKey();return this.findNextNonDisabled(t,e=>this.collection.getKeyBefore(e))}getKeyPageAbove(t){let e=this.ref.current,i=this.layoutDelegate.getItemRect(t);if(!i)return null;if(e&&!An(e))return this.getFirstKey();let l=t;if(this.orientation==="horizontal"){let s=Math.max(0,i.x+i.width-this.layoutDelegate.getVisibleRect().width);for(;i&&i.x>s&&l!=null;)l=this.getKeyAbove(l),i=l==null?null:this.layoutDelegate.getItemRect(l)}else{let s=Math.max(0,i.y+i.height-this.layoutDelegate.getVisibleRect().height);for(;i&&i.y>s&&l!=null;)l=this.getKeyAbove(l),i=l==null?null:this.layoutDelegate.getItemRect(l)}return l??this.getFirstKey()}getKeyPageBelow(t){let e=this.ref.current,i=this.layoutDelegate.getItemRect(t);if(!i)return null;if(e&&!An(e))return this.getLastKey();let l=t;if(this.orientation==="horizontal"){let s=Math.min(this.layoutDelegate.getContentSize().width,i.y-i.width+this.layoutDelegate.getVisibleRect().width);for(;i&&i.x<s&&l!=null;)l=this.getKeyBelow(l),i=l==null?null:this.layoutDelegate.getItemRect(l)}else{let s=Math.min(this.layoutDelegate.getContentSize().height,i.y-i.height+this.layoutDelegate.getVisibleRect().height);for(;i&&i.y<s&&l!=null;)l=this.getKeyBelow(l),i=l==null?null:this.layoutDelegate.getItemRect(l)}return l??this.getLastKey()}getKeyForSearch(t,e){if(!this.collator)return null;let i=this.collection,l=e||this.getFirstKey();for(;l!=null;){let s=i.getItem(l);if(!s)return null;let a=s.textValue.slice(0,t.length);if(s.textValue&&this.collator.compare(a,t)===0)return l;l=this.getNextKey(l)}return null}constructor(...t){if(t.length===1){let e=t[0];this.collection=e.collection,this.ref=e.ref,this.collator=e.collator,this.disabledKeys=e.disabledKeys||new Set,this.disabledBehavior=e.disabledBehavior||"all",this.orientation=e.orientation||"vertical",this.direction=e.direction,this.layout=e.layout||"stack",this.layoutDelegate=e.layoutDelegate||new Xn(e.ref)}else this.collection=t[0],this.disabledKeys=t[1],this.ref=t[2],this.collator=t[3],this.layout="stack",this.orientation="vertical",this.disabledBehavior="all",this.layoutDelegate=new Xn(this.ref);this.layout==="stack"&&this.orientation==="vertical"&&(this.getKeyLeftOf=void 0,this.getKeyRightOf=void 0)}};function Jn(t){let{selectionManager:e,collection:i,disabledKeys:l,ref:s,keyboardDelegate:a,layoutDelegate:o}=t,c=En({usage:"search",sensitivity:"base"}),r=e.disabledBehavior,d=(0,h.useMemo)(()=>a||new wi({collection:i,disabledKeys:l,disabledBehavior:r,ref:s,collator:c,layoutDelegate:o}),[a,o,i,l,s,c,r]),{collectionProps:u}=_c({...t,ref:s,selectionManager:e,keyboardDelegate:d});return{listProps:u}}var Sc=class{build(t,e){return this.context=e,el(()=>this.iterateCollection(t))}*iterateCollection(t){let{children:e,items:i}=t;if(h.isValidElement(e)&&e.type===h.Fragment)yield*this.iterateCollection({children:e.props.children,items:i});else if(typeof e=="function"){if(!i)throw Error("props.children was a function but props.items is missing");let l=0;for(let s of i)yield*this.getFullNode({value:s,index:l},{renderer:e}),l++}else{let l=[];h.Children.forEach(e,a=>{a&&l.push(a)});let s=0;for(let a of l){let o=this.getFullNode({element:a,index:s},{});for(let c of o)s++,yield c}}}getKey(t,e,i,l){if(t.key!=null)return t.key;if(e.type==="cell"&&e.key!=null)return`${l}${e.key}`;let s=e.value;if(s!=null){let a=s.key??s.id;if(a==null)throw Error("No key found for item");return a}return l?`${l}.${e.index}`:`$.${e.index}`}getChildState(t,e){return{renderer:e.renderer||t.renderer}}*getFullNode(t,e,i,l){if(h.isValidElement(t.element)&&t.element.type===h.Fragment){let c=[];h.Children.forEach(t.element.props.children,d=>{c.push(d)});let r=t.index??0;for(let d of c)yield*this.getFullNode({element:d,index:r++},e,i,l);return}let s=t.element;if(!s&&t.value&&e&&e.renderer){let c=this.cache.get(t.value);if(c&&(!c.shouldInvalidate||!c.shouldInvalidate(this.context))){c.index=t.index,c.parentKey=l?l.key:null,yield c;return}s=e.renderer(t.value)}if(h.isValidElement(s)){let c=s.type;if(typeof c!="function"&&typeof c.getCollectionNode!="function"){let p=s.type;throw Error(`Unknown element <${p}> in collection.`)}let r=c.getCollectionNode(s.props,this.context),d=t.index??0,u=r.next();for(;!u.done&&u.value;){let p=u.value;t.index=d;let g=p.key??null;g??(g=p.element?null:this.getKey(s,t,e,i));let x=[...this.getFullNode({...p,key:g,index:d,wrapper:Nc(t.wrapper,p.wrapper)},this.getChildState(e,p),i?`${i}${s.key}`:s.key,l)];for(let v of x){if(v.value=p.value??t.value??null,v.value&&this.cache.set(v.value,v),t.type&&v.type!==t.type)throw Error(`Unsupported type <${Ci(v.type)}> in <${Ci((l==null?void 0:l.type)??"unknown parent type")}>. Only <${Ci(t.type)}> is supported.`);d++,yield v}u=r.next(x)}return}if(t.key==null||t.type==null)return;let a=this,o={type:t.type,props:t.props,key:t.key,parentKey:l?l.key:null,value:t.value??null,level:l?l.level+1:0,index:t.index,rendered:t.rendered,textValue:t.textValue??"","aria-label":t["aria-label"],wrapper:t.wrapper,shouldInvalidate:t.shouldInvalidate,hasChildNodes:t.hasChildNodes||!1,childNodes:el(function*(){if(!t.hasChildNodes||!t.childNodes)return;let c=0;for(let r of t.childNodes()){r.key!=null&&(r.key=`${o.key}${r.key}`);let d=a.getFullNode({...r,index:c},a.getChildState(e,r),o.key,o);for(let u of d)c++,yield u}})};yield o}constructor(){this.cache=new WeakMap}};function el(t){let e=[],i=null;return{*[Symbol.iterator](){for(let l of e)yield l;i||(i=t());for(let l of i)e.push(l),yield l}}}function Nc(t,e){if(t&&e)return i=>t(e(i));if(t)return t;if(e)return e}function Ci(t){return t[0].toUpperCase()+t.slice(1)}function tl(t,e,i){let l=(0,h.useMemo)(()=>new Sc,[]),{children:s,items:a,collection:o}=t;return(0,h.useMemo)(()=>o||e(l.build({children:s,items:a},i)),[l,s,a,o,i,e])}function il(t,e){return typeof e.getChildren=="function"?e.getChildren(t.key):t.childNodes}function Ic(t){return Mc(t,0)}function Mc(t,e){if(e<0)return;let i=0;for(let l of t){if(i===e)return l;i++}}function _i(t,e,i){if(e.parentKey===i.parentKey)return e.index-i.index;let l=[...nl(t,e),e],s=[...nl(t,i),i],a=l.slice(0,s.length).findIndex((o,c)=>o!==s[c]);return a===-1?l.findIndex(o=>o===i)>=0?1:(s.findIndex(o=>o===e),-1):(e=l[a],i=s[a],e.index-i.index)}function nl(t,e){let i=[],l=e;for(;(l==null?void 0:l.parentKey)!=null;)l=t.getItem(l.parentKey),l&&i.unshift(l);return i}var Si=new WeakMap;function Ni(t,e){let{id:i}=Si.get(t)??{};if(!i)throw Error("Unknown list");return`${i}-${Kc(e)}`}function Kc(t){return typeof t=="string"?t.replace(/\s*/g,""):""+t}var ll={};ll={deselectedItem:t=>`${t.item} \u063A\u064A\u0631 \u0627\u0644\u0645\u062D\u062F\u062F`,longPressToSelect:"\u0627\u0636\u063A\u0637 \u0645\u0637\u0648\u0644\u064B\u0627 \u0644\u0644\u062F\u062E\u0648\u0644 \u0625\u0644\u0649 \u0648\u0636\u0639 \u0627\u0644\u062A\u062D\u062F\u064A\u062F.",select:"\u062A\u062D\u062F\u064A\u062F",selectedAll:"\u062C\u0645\u064A\u0639 \u0627\u0644\u0639\u0646\u0627\u0635\u0631 \u0627\u0644\u0645\u062D\u062F\u062F\u0629.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"\u0644\u0645 \u064A\u062A\u0645 \u062A\u062D\u062F\u064A\u062F \u0639\u0646\u0627\u0635\u0631",one:()=>`${e.number(t.count)} \u0639\u0646\u0635\u0631 \u0645\u062D\u062F\u062F`,other:()=>`${e.number(t.count)} \u0639\u0646\u0635\u0631 \u0645\u062D\u062F\u062F`})}.`,selectedItem:t=>`${t.item} \u0627\u0644\u0645\u062D\u062F\u062F`};var sl={};sl={deselectedItem:t=>`${t.item} \u043D\u0435 \u0435 \u0438\u0437\u0431\u0440\u0430\u043D.`,longPressToSelect:"\u041D\u0430\u0442\u0438\u0441\u043D\u0435\u0442\u0435 \u0438 \u0437\u0430\u0434\u0440\u044A\u0436\u0442\u0435 \u0437\u0430 \u0434\u0430 \u0432\u043B\u0435\u0437\u0435\u0442\u0435 \u0432 \u0438\u0437\u0431\u0438\u0440\u0430\u0442\u0435\u043B\u0435\u043D \u0440\u0435\u0436\u0438\u043C.",select:"\u0418\u0437\u0431\u0435\u0440\u0435\u0442\u0435",selectedAll:"\u0412\u0441\u0438\u0447\u043A\u0438 \u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438 \u0441\u0430 \u0438\u0437\u0431\u0440\u0430\u043D\u0438.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"\u041D\u044F\u043C\u0430 \u0438\u0437\u0431\u0440\u0430\u043D\u0438 \u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438",one:()=>`${e.number(t.count)} \u0438\u0437\u0431\u0440\u0430\u043D \u0435\u043B\u0435\u043C\u0435\u043D\u0442`,other:()=>`${e.number(t.count)} \u0438\u0437\u0431\u0440\u0430\u043D\u0438 \u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438`})}.`,selectedItem:t=>`${t.item} \u0438\u0437\u0431\u0440\u0430\u043D.`};var al={};al={deselectedItem:t=>`Polo\u017Eka ${t.item} nen\xED vybr\xE1na.`,longPressToSelect:"Dlouh\xFDm stisknut\xEDm p\u0159ejdete do re\u017Eimu v\xFDb\u011Bru.",select:"Vybrat",selectedAll:"Vybr\xE1ny v\u0161echny polo\u017Eky.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Nevybr\xE1ny \u017E\xE1dn\xE9 polo\u017Eky",one:()=>`Vybr\xE1na ${e.number(t.count)} polo\u017Eka`,other:()=>`Vybr\xE1no ${e.number(t.count)} polo\u017Eek`})}.`,selectedItem:t=>`Vybr\xE1na polo\u017Eka ${t.item}.`};var ol={};ol={deselectedItem:t=>`${t.item} ikke valgt.`,longPressToSelect:"Lav et langt tryk for at aktivere valgtilstand.",select:"V\xE6lg",selectedAll:"Alle elementer valgt.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Ingen elementer valgt",one:()=>`${e.number(t.count)} element valgt`,other:()=>`${e.number(t.count)} elementer valgt`})}.`,selectedItem:t=>`${t.item} valgt.`};var rl={};rl={deselectedItem:t=>`${t.item} nicht ausgew\xE4hlt.`,longPressToSelect:"Gedr\xFCckt halten, um Auswahlmodus zu \xF6ffnen.",select:"Ausw\xE4hlen",selectedAll:"Alle Elemente ausgew\xE4hlt.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Keine Elemente ausgew\xE4hlt",one:()=>`${e.number(t.count)} Element ausgew\xE4hlt`,other:()=>`${e.number(t.count)} Elemente ausgew\xE4hlt`})}.`,selectedItem:t=>`${t.item} ausgew\xE4hlt.`};var cl={};cl={deselectedItem:t=>`\u0394\u03B5\u03BD \u03B5\u03C0\u03B9\u03BB\u03AD\u03C7\u03B8\u03B7\u03BA\u03B5 \u03C4\u03BF \u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03BF ${t.item}.`,longPressToSelect:"\u03A0\u03B1\u03C4\u03AE\u03C3\u03C4\u03B5 \u03C0\u03B1\u03C1\u03B1\u03C4\u03B5\u03C4\u03B1\u03BC\u03AD\u03BD\u03B1 \u03B3\u03B9\u03B1 \u03BD\u03B1 \u03BC\u03C0\u03B5\u03AF\u03C4\u03B5 \u03C3\u03B5 \u03BB\u03B5\u03B9\u03C4\u03BF\u03C5\u03C1\u03B3\u03AF\u03B1 \u03B5\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE\u03C2.",select:"\u0395\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE",selectedAll:"\u0395\u03C0\u03B9\u03BB\u03AD\u03C7\u03B8\u03B7\u03BA\u03B1\u03BD \u03CC\u03BB\u03B1 \u03C4\u03B1 \u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"\u0394\u03B5\u03BD \u03B5\u03C0\u03B9\u03BB\u03AD\u03C7\u03B8\u03B7\u03BA\u03B1\u03BD \u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",one:()=>`\u0395\u03C0\u03B9\u03BB\u03AD\u03C7\u03B8\u03B7\u03BA\u03B5 ${e.number(t.count)} \u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03BF`,other:()=>`\u0395\u03C0\u03B9\u03BB\u03AD\u03C7\u03B8\u03B7\u03BA\u03B1\u03BD ${e.number(t.count)} \u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1`})}.`,selectedItem:t=>`\u0395\u03C0\u03B9\u03BB\u03AD\u03C7\u03B8\u03B7\u03BA\u03B5 \u03C4\u03BF \u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03BF ${t.item}.`};var dl={};dl={deselectedItem:t=>`${t.item} not selected.`,select:"Select",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"No items selected",one:()=>`${e.number(t.count)} item selected`,other:()=>`${e.number(t.count)} items selected`})}.`,selectedAll:"All items selected.",selectedItem:t=>`${t.item} selected.`,longPressToSelect:"Long press to enter selection mode."};var ul={};ul={deselectedItem:t=>`${t.item} no seleccionado.`,longPressToSelect:"Mantenga pulsado para abrir el modo de selecci\xF3n.",select:"Seleccionar",selectedAll:"Todos los elementos seleccionados.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Ning\xFAn elemento seleccionado",one:()=>`${e.number(t.count)} elemento seleccionado`,other:()=>`${e.number(t.count)} elementos seleccionados`})}.`,selectedItem:t=>`${t.item} seleccionado.`};var ml={};ml={deselectedItem:t=>`${t.item} pole valitud.`,longPressToSelect:"Valikure\u017Eiimi sisenemiseks vajutage pikalt.",select:"Vali",selectedAll:"K\xF5ik \xFCksused valitud.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"\xDCksusi pole valitud",one:()=>`${e.number(t.count)} \xFCksus valitud`,other:()=>`${e.number(t.count)} \xFCksust valitud`})}.`,selectedItem:t=>`${t.item} valitud.`};var pl={};pl={deselectedItem:t=>`Kohdetta ${t.item} ei valittu.`,longPressToSelect:"Siirry valintatilaan painamalla pitk\xE4\xE4n.",select:"Valitse",selectedAll:"Kaikki kohteet valittu.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Ei yht\xE4\xE4n kohdetta valittu",one:()=>`${e.number(t.count)} kohde valittu`,other:()=>`${e.number(t.count)} kohdetta valittu`})}.`,selectedItem:t=>`${t.item} valittu.`};var hl={};hl={deselectedItem:t=>`${t.item} non s\xE9lectionn\xE9.`,longPressToSelect:"Appuyez de mani\xE8re prolong\xE9e pour passer en mode de s\xE9lection.",select:"S\xE9lectionner",selectedAll:"Tous les \xE9l\xE9ments s\xE9lectionn\xE9s.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Aucun \xE9l\xE9ment s\xE9lectionn\xE9",one:()=>`${e.number(t.count)} \xE9l\xE9ment s\xE9lectionn\xE9`,other:()=>`${e.number(t.count)} \xE9l\xE9ments s\xE9lectionn\xE9s`})}.`,selectedItem:t=>`${t.item} s\xE9lectionn\xE9.`};var gl={};gl={deselectedItem:t=>`${t.item} \u05DC\u05D0 \u05E0\u05D1\u05D7\u05E8.`,longPressToSelect:"\u05D4\u05E7\u05E9\u05D4 \u05D0\u05E8\u05D5\u05DB\u05D4 \u05DC\u05DB\u05E0\u05D9\u05E1\u05D4 \u05DC\u05DE\u05E6\u05D1 \u05D1\u05D7\u05D9\u05E8\u05D4.",select:"\u05D1\u05D7\u05E8",selectedAll:"\u05DB\u05DC \u05D4\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD \u05E0\u05D1\u05D7\u05E8\u05D5.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"\u05DC\u05D0 \u05E0\u05D1\u05D7\u05E8\u05D5 \u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",one:()=>`\u05E4\u05E8\u05D9\u05D8 ${e.number(t.count)} \u05E0\u05D1\u05D7\u05E8`,other:()=>`${e.number(t.count)} \u05E4\u05E8\u05D9\u05D8\u05D9\u05DD \u05E0\u05D1\u05D7\u05E8\u05D5`})}.`,selectedItem:t=>`${t.item} \u05E0\u05D1\u05D7\u05E8.`};var fl={};fl={deselectedItem:t=>`Stavka ${t.item} nije odabrana.`,longPressToSelect:"Dugo pritisnite za ulazak u na\u010Din odabira.",select:"Odaberite",selectedAll:"Odabrane su sve stavke.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Nije odabrana nijedna stavka",one:()=>`Odabrana je ${e.number(t.count)} stavka`,other:()=>`Odabrano je ${e.number(t.count)} stavki`})}.`,selectedItem:t=>`Stavka ${t.item} je odabrana.`};var xl={};xl={deselectedItem:t=>`${t.item} nincs kijel\xF6lve.`,longPressToSelect:"Nyomja hosszan a kijel\xF6l\xE9shez.",select:"Kijel\xF6l\xE9s",selectedAll:"Az \xF6sszes elem kijel\xF6lve.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Egy elem sincs kijel\xF6lve",one:()=>`${e.number(t.count)} elem kijel\xF6lve`,other:()=>`${e.number(t.count)} elem kijel\xF6lve`})}.`,selectedItem:t=>`${t.item} kijel\xF6lve.`};var yl={};yl={deselectedItem:t=>`${t.item} non selezionato.`,longPressToSelect:"Premi a lungo per passare alla modalit\xE0 di selezione.",select:"Seleziona",selectedAll:"Tutti gli elementi selezionati.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Nessun elemento selezionato",one:()=>`${e.number(t.count)} elemento selezionato`,other:()=>`${e.number(t.count)} elementi selezionati`})}.`,selectedItem:t=>`${t.item} selezionato.`};var vl={};vl={deselectedItem:t=>`${t.item} \u304C\u9078\u629E\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002`,longPressToSelect:"\u9577\u62BC\u3057\u3057\u3066\u9078\u629E\u30E2\u30FC\u30C9\u3092\u958B\u304D\u307E\u3059\u3002",select:"\u9078\u629E",selectedAll:"\u3059\u3079\u3066\u306E\u9805\u76EE\u3092\u9078\u629E\u3057\u307E\u3057\u305F\u3002",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"\u9805\u76EE\u304C\u9078\u629E\u3055\u308C\u3066\u3044\u307E\u305B\u3093",one:()=>`${e.number(t.count)} \u9805\u76EE\u3092\u9078\u629E\u3057\u307E\u3057\u305F`,other:()=>`${e.number(t.count)} \u9805\u76EE\u3092\u9078\u629E\u3057\u307E\u3057\u305F`})}\u3002`,selectedItem:t=>`${t.item} \u3092\u9078\u629E\u3057\u307E\u3057\u305F\u3002`};var bl={};bl={deselectedItem:t=>`${t.item}\uC774(\uAC00) \uC120\uD0DD\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4.`,longPressToSelect:"\uC120\uD0DD \uBAA8\uB4DC\uB85C \uB4E4\uC5B4\uAC00\uB824\uBA74 \uAE38\uAC8C \uB204\uB974\uC2ED\uC2DC\uC624.",select:"\uC120\uD0DD",selectedAll:"\uBAA8\uB4E0 \uD56D\uBAA9\uC774 \uC120\uD0DD\uB418\uC5C8\uC2B5\uB2C8\uB2E4.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"\uC120\uD0DD\uB41C \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4",one:()=>`${e.number(t.count)}\uAC1C \uD56D\uBAA9\uC774 \uC120\uD0DD\uB418\uC5C8\uC2B5\uB2C8\uB2E4`,other:()=>`${e.number(t.count)}\uAC1C \uD56D\uBAA9\uC774 \uC120\uD0DD\uB418\uC5C8\uC2B5\uB2C8\uB2E4`})}.`,selectedItem:t=>`${t.item}\uC774(\uAC00) \uC120\uD0DD\uB418\uC5C8\uC2B5\uB2C8\uB2E4.`};var kl={};kl={deselectedItem:t=>`${t.item} nepasirinkta.`,longPressToSelect:"Nor\u0117dami \u012Fjungti pasirinkimo re\u017Eim\u0105, paspauskite ir palaikykite.",select:"Pasirinkti",selectedAll:"Pasirinkti visi elementai.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Nepasirinktas n\u0117 vienas elementas",one:()=>`Pasirinktas ${e.number(t.count)} elementas`,other:()=>`Pasirinkta element\u0173: ${e.number(t.count)}`})}.`,selectedItem:t=>`Pasirinkta: ${t.item}.`};var jl={};jl={deselectedItem:t=>`Vienums ${t.item} nav atlas\u012Bts.`,longPressToSelect:"Ilgi turiet nospiestu. lai iesl\u0113gtu atlases re\u017E\u012Bmu.",select:"Atlas\u012Bt",selectedAll:"Atlas\u012Bti visi vienumi.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Nav atlas\u012Bts neviens vienums",one:()=>`Atlas\u012Bto vienumu skaits: ${e.number(t.count)}`,other:()=>`Atlas\u012Bto vienumu skaits: ${e.number(t.count)}`})}.`,selectedItem:t=>`Atlas\u012Bts vienums ${t.item}.`};var wl={};wl={deselectedItem:t=>`${t.item} er ikke valgt.`,longPressToSelect:"Bruk et langt trykk for \xE5 g\xE5 inn i valgmodus.",select:"Velg",selectedAll:"Alle elementer er valgt.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Ingen elementer er valgt",one:()=>`${e.number(t.count)} element er valgt`,other:()=>`${e.number(t.count)} elementer er valgt`})}.`,selectedItem:t=>`${t.item} er valgt.`};var Cl={};Cl={deselectedItem:t=>`${t.item} niet geselecteerd.`,longPressToSelect:"Druk lang om de selectiemodus te openen.",select:"Selecteren",selectedAll:"Alle items geselecteerd.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Geen items geselecteerd",one:()=>`${e.number(t.count)} item geselecteerd`,other:()=>`${e.number(t.count)} items geselecteerd`})}.`,selectedItem:t=>`${t.item} geselecteerd.`};var _l={};_l={deselectedItem:t=>`Nie zaznaczono ${t.item}.`,longPressToSelect:"Naci\u015Bnij i przytrzymaj, aby wej\u015B\u0107 do trybu wyboru.",select:"Zaznacz",selectedAll:"Wszystkie zaznaczone elementy.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Nie zaznaczono \u017Cadnych element\xF3w",one:()=>`${e.number(t.count)} zaznaczony element`,other:()=>`${e.number(t.count)} zaznaczonych element\xF3w`})}.`,selectedItem:t=>`Zaznaczono ${t.item}.`};var Sl={};Sl={deselectedItem:t=>`${t.item} n\xE3o selecionado.`,longPressToSelect:"Mantenha pressionado para entrar no modo de sele\xE7\xE3o.",select:"Selecionar",selectedAll:"Todos os itens selecionados.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Nenhum item selecionado",one:()=>`${e.number(t.count)} item selecionado`,other:()=>`${e.number(t.count)} itens selecionados`})}.`,selectedItem:t=>`${t.item} selecionado.`};var Nl={};Nl={deselectedItem:t=>`${t.item} n\xE3o selecionado.`,longPressToSelect:"Prima continuamente para entrar no modo de sele\xE7\xE3o.",select:"Selecionar",selectedAll:"Todos os itens selecionados.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Nenhum item selecionado",one:()=>`${e.number(t.count)} item selecionado`,other:()=>`${e.number(t.count)} itens selecionados`})}.`,selectedItem:t=>`${t.item} selecionado.`};var Il={};Il={deselectedItem:t=>`${t.item} neselectat.`,longPressToSelect:"Ap\u0103sa\u021Bi lung pentru a intra \xEEn modul de selectare.",select:"Selectare",selectedAll:"Toate elementele selectate.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Niciun element selectat",one:()=>`${e.number(t.count)} element selectat`,other:()=>`${e.number(t.count)} elemente selectate`})}.`,selectedItem:t=>`${t.item} selectat.`};var Ml={};Ml={deselectedItem:t=>`${t.item} \u043D\u0435 \u0432\u044B\u0431\u0440\u0430\u043D\u043E.`,longPressToSelect:"\u041D\u0430\u0436\u043C\u0438\u0442\u0435 \u0438 \u0443\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0439\u0442\u0435 \u0434\u043B\u044F \u0432\u0445\u043E\u0434\u0430 \u0432 \u0440\u0435\u0436\u0438\u043C \u0432\u044B\u0431\u043E\u0440\u0430.",select:"\u0412\u044B\u0431\u0440\u0430\u0442\u044C",selectedAll:"\u0412\u044B\u0431\u0440\u0430\u043D\u044B \u0432\u0441\u0435 \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"\u041D\u0435\u0442 \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0445 \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432",one:()=>`${e.number(t.count)} \u044D\u043B\u0435\u043C\u0435\u043D\u0442 \u0432\u044B\u0431\u0440\u0430\u043D`,other:()=>`${e.number(t.count)} \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432 \u0432\u044B\u0431\u0440\u0430\u043D\u043E`})}.`,selectedItem:t=>`${t.item} \u0432\u044B\u0431\u0440\u0430\u043D\u043E.`};var Kl={};Kl={deselectedItem:t=>`Nevybrat\xE9 polo\u017Eky: ${t.item}.`,longPressToSelect:"Dlh\u0161\xEDm stla\u010Den\xEDm prejdite do re\u017Eimu v\xFDberu.",select:"Vybra\u0165",selectedAll:"V\u0161etky vybrat\xE9 polo\u017Eky.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"\u017Diadne vybrat\xE9 polo\u017Eky",one:()=>`${e.number(t.count)} vybrat\xE1 polo\u017Eka`,other:()=>`Po\u010Det vybrat\xFDch polo\u017Eiek:${e.number(t.count)}`})}.`,selectedItem:t=>`Vybrat\xE9 polo\u017Eky: ${t.item}.`};var Dl={};Dl={deselectedItem:t=>`Element ${t.item} ni izbran.`,longPressToSelect:"Za izbirni na\u010Din pritisnite in dlje \u010Dasa dr\u017Eite.",select:"Izberite",selectedAll:"Vsi elementi so izbrani.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Noben element ni izbran",one:()=>`${e.number(t.count)} element je izbran`,other:()=>`${e.number(t.count)} elementov je izbranih`})}.`,selectedItem:t=>`Element ${t.item} je izbran.`};var Al={};Al={deselectedItem:t=>`${t.item} nije izabrano.`,longPressToSelect:"Dugo pritisnite za ulazak u re\u017Eim biranja.",select:"Izaberite",selectedAll:"Izabrane su sve stavke.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Nije izabrana nijedna stavka",one:()=>`Izabrana je ${e.number(t.count)} stavka`,other:()=>`Izabrano je ${e.number(t.count)} stavki`})}.`,selectedItem:t=>`${t.item} je izabrano.`};var Pl={};Pl={deselectedItem:t=>`${t.item} ej markerat.`,longPressToSelect:"Tryck l\xE4nge n\xE4r du vill \xF6ppna v\xE4ljarl\xE4ge.",select:"Markera",selectedAll:"Alla markerade objekt.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Inga markerade objekt",one:()=>`${e.number(t.count)} markerat objekt`,other:()=>`${e.number(t.count)} markerade objekt`})}.`,selectedItem:t=>`${t.item} markerat.`};var El={};El={deselectedItem:t=>`${t.item} se\xE7ilmedi.`,longPressToSelect:"Se\xE7im moduna girmek i\xE7in uzun bas\u0131n.",select:"Se\xE7",selectedAll:"T\xFCm \xF6geler se\xE7ildi.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Hi\xE7bir \xF6ge se\xE7ilmedi",one:()=>`${e.number(t.count)} \xF6ge se\xE7ildi`,other:()=>`${e.number(t.count)} \xF6ge se\xE7ildi`})}.`,selectedItem:t=>`${t.item} se\xE7ildi.`};var Tl={};Tl={deselectedItem:t=>`${t.item} \u043D\u0435 \u0432\u0438\u0431\u0440\u0430\u043D\u043E.`,longPressToSelect:"\u0412\u0438\u043A\u043E\u043D\u0430\u0439\u0442\u0435 \u0434\u043E\u0432\u0433\u0435 \u043D\u0430\u0442\u0438\u0441\u043D\u0435\u043D\u043D\u044F, \u0449\u043E\u0431 \u043F\u0435\u0440\u0435\u0439\u0442\u0438 \u0432 \u0440\u0435\u0436\u0438\u043C \u0432\u0438\u0431\u043E\u0440\u0443.",select:"\u0412\u0438\u0431\u0440\u0430\u0442\u0438",selectedAll:"\u0423\u0441\u0456 \u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438 \u0432\u0438\u0431\u0440\u0430\u043D\u043E.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"\u0416\u043E\u0434\u043D\u0438\u0445 \u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432 \u043D\u0435 \u0432\u0438\u0431\u0440\u0430\u043D\u043E",one:()=>`${e.number(t.count)} \u0435\u043B\u0435\u043C\u0435\u043D\u0442 \u0432\u0438\u0431\u0440\u0430\u043D\u043E`,other:()=>`\u0412\u0438\u0431\u0440\u0430\u043D\u043E \u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432: ${e.number(t.count)}`})}.`,selectedItem:t=>`${t.item} \u0432\u0438\u0431\u0440\u0430\u043D\u043E.`};var Bl={};Bl={deselectedItem:t=>`\u672A\u9009\u62E9 ${t.item}\u3002`,longPressToSelect:"\u957F\u6309\u4EE5\u8FDB\u5165\u9009\u62E9\u6A21\u5F0F\u3002",select:"\u9009\u62E9",selectedAll:"\u5DF2\u9009\u62E9\u6240\u6709\u9879\u76EE\u3002",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"\u672A\u9009\u62E9\u9879\u76EE",one:()=>`\u5DF2\u9009\u62E9 ${e.number(t.count)} \u4E2A\u9879\u76EE`,other:()=>`\u5DF2\u9009\u62E9 ${e.number(t.count)} \u4E2A\u9879\u76EE`})}\u3002`,selectedItem:t=>`\u5DF2\u9009\u62E9 ${t.item}\u3002`};var Fl={};Fl={deselectedItem:t=>`\u672A\u9078\u53D6\u300C${t.item}\u300D\u3002`,longPressToSelect:"\u9577\u6309\u4EE5\u9032\u5165\u9078\u64C7\u6A21\u5F0F\u3002",select:"\u9078\u53D6",selectedAll:"\u5DF2\u9078\u53D6\u6240\u6709\u9805\u76EE\u3002",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"\u672A\u9078\u53D6\u4EFB\u4F55\u9805\u76EE",one:()=>`\u5DF2\u9078\u53D6 ${e.number(t.count)} \u500B\u9805\u76EE`,other:()=>`\u5DF2\u9078\u53D6 ${e.number(t.count)} \u500B\u9805\u76EE`})}\u3002`,selectedItem:t=>`\u5DF2\u9078\u53D6\u300C${t.item}\u300D\u3002`};var Wt={};Wt={"ar-AE":ll,"bg-BG":sl,"cs-CZ":al,"da-DK":ol,"de-DE":rl,"el-GR":cl,"en-US":dl,"es-ES":ul,"et-EE":ml,"fi-FI":pl,"fr-FR":hl,"he-IL":gl,"hr-HR":fl,"hu-HU":xl,"it-IT":yl,"ja-JP":vl,"ko-KR":bl,"lt-LT":kl,"lv-LV":jl,"nb-NO":wl,"nl-NL":Cl,"pl-PL":_l,"pt-BR":Sl,"pt-PT":Nl,"ro-RO":Il,"ru-RU":Ml,"sk-SK":Kl,"sl-SI":Dl,"sr-SP":Al,"sv-SE":Pl,"tr-TR":El,"uk-UA":Tl,"zh-CN":Bl,"zh-TW":Fl};function Dc(t){return t&&t.__esModule?t.default:t}function Ac(t,e){let{getRowText:i=c=>{var d,u;var r;return((d=(r=e.collection).getTextValue)==null?void 0:d.call(r,c))??((u=e.collection.getItem(c))==null?void 0:u.textValue)}}=t,l=Ot(Dc(Wt),"@react-aria/grid"),s=e.selectionManager.rawSelection,a=(0,h.useRef)(s),o=(0,h.useCallback)(()=>{var p;if(!e.selectionManager.isFocused||s===a.current){a.current=s;return}let c=zl(s,a.current),r=zl(a.current,s),d=e.selectionManager.selectionBehavior==="replace",u=[];if(e.selectionManager.selectedKeys.size===1&&d){let g=e.selectionManager.selectedKeys.keys().next().value;if(g!=null&&e.collection.getItem(g)){let x=i(g);x&&u.push(l.format("selectedItem",{item:x}))}}else if(c.size===1&&r.size===0){let g=c.keys().next().value;if(g!=null){let x=i(g);x&&u.push(l.format("selectedItem",{item:x}))}}else if(r.size===1&&c.size===0){let g=r.keys().next().value;if(g!=null&&e.collection.getItem(g)){let x=i(g);x&&u.push(l.format("deselectedItem",{item:x}))}}e.selectionManager.selectionMode==="multiple"&&(u.length===0||s==="all"||s.size>1||a.current==="all"||((p=a.current)==null?void 0:p.size)>1)&&u.push(s==="all"?l.format("selectedAll"):l.format("selectedCount",{count:s.size})),u.length>0&&cr(u.join(" ")),a.current=s},[s,e.selectionManager.selectedKeys,e.selectionManager.isFocused,e.selectionManager.selectionBehavior,e.selectionManager.selectionMode,e.collection,i,l]);Tr(()=>{if(e.selectionManager.isFocused)o();else{let c=requestAnimationFrame(o);return()=>cancelAnimationFrame(c)}},[s,e.selectionManager.isFocused])}function zl(t,e){let i=new Set;if(t==="all"||e==="all")return i;for(let l of t.keys())e.has(l)||i.add(l);return i}function Pc(t){return t&&t.__esModule?t.default:t}function Ec(t){let e=Ot(Pc(Wt),"@react-aria/grid"),i=xr(),l=(i==="pointer"||i==="virtual"||i==null)&&typeof window<"u"&&"ontouchstart"in window;return Pn((0,h.useMemo)(()=>{let s=t.selectionManager.selectionMode,a=t.selectionManager.selectionBehavior,o;return l&&(o=e.format("longPressToSelect")),a==="replace"&&s!=="none"&&t.hasItemActions?o:void 0},[t.selectionManager.selectionMode,t.selectionManager.selectionBehavior,t.hasItemActions,e,l]))}function Tc(t){return t&&t.__esModule?t.default:t}function Bc(t,e){let{key:i}=t,l=e.selectionManager,s=jt(),a=!e.selectionManager.canSelectItem(i),o=e.selectionManager.isSelected(i),c=()=>l.toggleSelection(i),r=Ot(Tc(Wt),"@react-aria/grid");return{checkboxProps:{id:s,"aria-label":r.format("select"),isSelected:o,isDisabled:a,onChange:c}}}function Fc(t,e,i){let{isVirtualized:l,keyboardDelegate:s,layoutDelegate:a,onAction:o,disallowTypeAhead:c,linkBehavior:r="action",keyboardNavigationBehavior:d="arrow",escapeKeyBehavior:u="clearSelection",shouldSelectOnPressUp:p}=t;!t["aria-label"]&&!t["aria-labelledby"]&&console.warn("An aria-label or aria-labelledby prop is required for accessibility.");let{listProps:g}=Jn({selectionManager:e.selectionManager,collection:e.collection,disabledKeys:e.disabledKeys,ref:i,keyboardDelegate:s,layoutDelegate:a,isVirtualized:l,selectOnFocus:e.selectionManager.selectionBehavior==="replace",shouldFocusWrap:t.shouldFocusWrap,linkBehavior:r,disallowTypeAhead:c,autoFocus:t.autoFocus,escapeKeyBehavior:u}),x=jt(t.id);Si.set(e,{id:x,onAction:o,linkBehavior:r,keyboardNavigationBehavior:d,shouldSelectOnPressUp:p});let v=Ec({selectionManager:e.selectionManager,hasItemActions:!!o}),j=fc(i,{isDisabled:e.collection.size!==0}),C=Ve($t(t,{labelable:!0}),{role:"grid",id:x,"aria-multiselectable":e.selectionManager.selectionMode==="multiple"?"true":void 0},e.collection.size===0?{tabIndex:j?-1:0}:g,v);return l&&(C["aria-rowcount"]=e.collection.size,C["aria-colcount"]=1),Ac({},e),{gridProps:C}}var Ol={expand:{ltr:"ArrowRight",rtl:"ArrowLeft"},collapse:{ltr:"ArrowLeft",rtl:"ArrowRight"}};function zc(t,e,i){var A,B,M;let{node:l,isVirtualized:s}=t,{direction:a}=Ht(),{onAction:o,linkBehavior:c,keyboardNavigationBehavior:r,shouldSelectOnPressUp:d}=Si.get(e),u=Dr(),p=(0,h.useRef)(null),g=()=>{i.current!==null&&(p.current!=null&&l.key!==p.current||!fi(i.current))&&He(i.current)},x={},v=t.hasChildItems,j=e.selectionManager.isLink(l.key);if(l!=null&&"expandedKeys"in e){var C;let w=(A=(C=e.collection).getChildren)==null?void 0:A.call(C,l.key);v||(v=[...w??[]].length>1),o==null&&!j&&e.selectionManager.selectionMode==="none"&&v&&(o=()=>e.toggleKey(l.key));let K=v?e.expandedKeys.has(l.key):void 0,k=1,D=l.index;if(l.level>=0&&(l==null?void 0:l.parentKey)!=null){let T=e.collection.getItem(l.parentKey);if(T){let F=Oc(T,e.collection);k=[...F].filter(U=>U.type==="item").length,D>0&&F[0].type!=="item"&&--D}}else k=[...e.collection].filter(T=>T.level===0&&T.type==="item").length;x={"aria-expanded":K,"aria-level":l.level+1,"aria-posinset":D+1,"aria-setsize":k}}let{itemProps:I,...b}=Qn({selectionManager:e.selectionManager,key:l.key,ref:i,isVirtualized:s,shouldSelectOnPressUp:t.shouldSelectOnPressUp||d,onAction:o||(B=l.props)!=null&&B.onAction?In((M=l.props)==null?void 0:M.onAction,o?()=>o(l.key):void 0):void 0,focus:g,linkBehavior:c}),_=w=>{let K=ut();if(!et(w.currentTarget,Ue(w))||!i.current||!K)return;let k=Gt(i.current);if(k.currentNode=K,"expandedKeys"in e&&K===i.current){if(w.key===Ol.expand[a]&&e.selectionManager.focusedKey===l.key&&v&&!e.expandedKeys.has(l.key)){e.toggleKey(l.key),w.stopPropagation();return}else if(w.key===Ol.collapse[a]&&e.selectionManager.focusedKey===l.key&&v&&e.expandedKeys.has(l.key)){e.toggleKey(l.key),w.stopPropagation();return}}switch(w.key){case"ArrowLeft":if(r==="arrow"){let T=a==="rtl"?k.nextNode():k.previousNode();if(T)w.preventDefault(),w.stopPropagation(),He(T),tt(T,{containingElement:lt(i.current)});else if(w.preventDefault(),w.stopPropagation(),a==="rtl")He(i.current),tt(i.current,{containingElement:lt(i.current)});else{k.currentNode=i.current;let F=Vl(k);F&&(He(F),tt(F,{containingElement:lt(i.current)}))}}break;case"ArrowRight":if(r==="arrow"){let T=a==="rtl"?k.previousNode():k.nextNode();if(T)w.preventDefault(),w.stopPropagation(),He(T),tt(T,{containingElement:lt(i.current)});else if(w.preventDefault(),w.stopPropagation(),a==="ltr")He(i.current),tt(i.current,{containingElement:lt(i.current)});else{k.currentNode=i.current;let F=Vl(k);F&&(He(F),tt(F,{containingElement:lt(i.current)}))}}break;case"ArrowUp":case"ArrowDown":if(!w.altKey&&et(i.current,Ue(w))){var D;w.stopPropagation(),w.preventDefault(),(D=i.current.parentElement)==null||D.dispatchEvent(new KeyboardEvent(w.nativeEvent.type,w.nativeEvent))}break}},S=w=>{if(p.current=l.key,Ue(w)!==i.current){yr()||e.selectionManager.setFocusedKey(l.key);return}},f=w=>{let K=ut();if(!(!et(w.currentTarget,Ue(w))||!i.current||!K))switch(w.key){case"Tab":if(r==="tab"){let k=Gt(i.current,{tabbable:!0});k.currentNode=K,(w.shiftKey?k.previousNode():k.nextNode())&&w.stopPropagation()}}},m=Kr(l.props),y=Ve(I,b.hasAction?m:{},{role:"row",onKeyDownCapture:_,onKeyDown:f,onFocus:S,"aria-label":l["aria-label"]||l.textValue||void 0,"aria-selected":e.selectionManager.canSelectItem(l.key)?e.selectionManager.isSelected(l.key):void 0,"aria-disabled":e.selectionManager.isDisabled(l.key)||void 0,"aria-labelledby":u&&(l["aria-label"]||l.textValue)?`${Ni(e,l.key)} ${u}`:void 0,id:Ni(e,l.key)});if(s){let{collection:w}=e;y["aria-rowindex"]=[...w].find(K=>K.type==="section")?[...w.getKeys()].filter(K=>{var k;return((k=w.getItem(K))==null?void 0:k.type)!=="section"}).findIndex(K=>K===l.key)+1:l.index+1}let P={role:"gridcell","aria-colindex":1};return{rowProps:{...Ve(y,x)},gridCellProps:P,descriptionProps:{id:u},...b}}function Vl(t){let e=null,i=null;do i=t.lastChild(),i&&(e=i);while(i);return e}function Oc(t,e){var o;let i=(o=e.getChildren)==null?void 0:o.call(e,t.key),l=i?Array.from(i):[],s=l.length>0?l[0]:null,a=[];for(;s;)a.push(s),s=s.nextKey==null?null:e.getItem(s.nextKey);return a}function Vc(t,e){let{key:i}=t,{checkboxProps:l}=Bc(t,e);return{checkboxProps:{...l,"aria-labelledby":`${l.id} ${Ni(e,i)}`}}}function Rc(t,e,i){let{gridProps:l}=Fc(t,e,i);return l.role="treegrid",{gridProps:l}}var Rl={};Rl={collapse:"\u0637\u064A",expand:"\u062A\u0645\u062F\u064A\u062F"};var $l={};$l={collapse:"\u0421\u0432\u0438\u0432\u0430\u043D\u0435",expand:"\u0420\u0430\u0437\u0448\u0438\u0440\u044F\u0432\u0430\u043D\u0435"};var Ll={};Ll={collapse:"Sbalit",expand:"Rozt\xE1hnout"};var Gl={};Gl={collapse:"Skjul",expand:"Udvid"};var Hl={};Hl={collapse:"Reduzieren",expand:"Erweitern"};var Ul={};Ul={collapse:"\u03A3\u03CD\u03BC\u03C0\u03C4\u03C5\u03BE\u03B7",expand:"\u0391\u03BD\u03AC\u03C0\u03C4\u03C5\u03BE\u03B7"};var ql={};ql={expand:"Expand",collapse:"Collapse"};var Wl={};Wl={collapse:"Contraer",expand:"Ampliar"};var Ql={};Ql={collapse:"Ahenda",expand:"Laienda"};var Yl={};Yl={collapse:"Pienenn\xE4",expand:"Laajenna"};var Zl={};Zl={collapse:"R\xE9duire",expand:"D\xE9velopper"};var Xl={};Xl={collapse:"\u05DB\u05D5\u05D5\u05E5",expand:"\u05D4\u05E8\u05D7\u05D1"};var Jl={};Jl={collapse:"Sa\u017Emi",expand:"Pro\u0161iri"};var es={};es={collapse:"\xD6sszecsuk\xE1s",expand:"Kibont\xE1s"};var ts={};ts={collapse:"Comprimi",expand:"Espandi"};var is={};is={collapse:"\u6298\u308A\u305F\u305F\u3080",expand:"\u5C55\u958B"};var ns={};ns={collapse:"\uC811\uAE30",expand:"\uD3BC\uCE58\uAE30"};var ls={};ls={collapse:"Sutraukti",expand:"I\u0161skleisti"};var ss={};ss={collapse:"Sak\u013Caut",expand:"Izv\u0113rst"};var as={};as={collapse:"Skjul",expand:"Utvid"};var os={};os={collapse:"Samenvouwen",expand:"Uitvouwen"};var rs={};rs={collapse:"Zwi\u0144",expand:"Rozwi\u0144"};var cs={};cs={collapse:"Recolher",expand:"Expandir"};var ds={};ds={collapse:"Colapsar",expand:"Expandir"};var us={};us={collapse:"Restr\xE2nge\u021Bi",expand:"Extinde\u021Bi"};var ms={};ms={collapse:"\u0421\u0432\u0435\u0440\u043D\u0443\u0442\u044C",expand:"\u0420\u0430\u0437\u0432\u0435\u0440\u043D\u0443\u0442\u044C"};var ps={};ps={collapse:"Zbali\u0165",expand:"Rozbali\u0165"};var hs={};hs={collapse:"Strni",expand:"Raz\u0161iri"};var gs={};gs={collapse:" Skupi",expand:"Pro\u0161iri"};var fs={};fs={collapse:"D\xF6lj",expand:"Expandera"};var xs={};xs={collapse:"Daralt",expand:"Geni\u015Flet"};var ys={};ys={collapse:"\u0417\u0433\u043E\u0440\u043D\u0443\u0442\u0438",expand:"\u0420\u043E\u0437\u0433\u043E\u0440\u043D\u0443\u0442\u0438"};var vs={};vs={collapse:"\u6298\u53E0",expand:"\u6269\u5C55"};var bs={};bs={collapse:"\u6536\u5408",expand:"\u5C55\u958B"};var ks={};ks={"ar-AE":Rl,"bg-BG":$l,"cs-CZ":Ll,"da-DK":Gl,"de-DE":Hl,"el-GR":Ul,"en-US":ql,"es-ES":Wl,"et-EE":Ql,"fi-FI":Yl,"fr-FR":Zl,"he-IL":Xl,"hr-HR":Jl,"hu-HU":es,"it-IT":ts,"ja-JP":is,"ko-KR":ns,"lt-LT":ls,"lv-LV":ss,"nb-NO":as,"nl-NL":os,"pl-PL":rs,"pt-BR":cs,"pt-PT":ds,"ro-RO":us,"ru-RU":ms,"sk-SK":ps,"sl-SI":hs,"sr-SP":gs,"sv-SE":fs,"tr-TR":xs,"uk-UA":ys,"zh-CN":vs,"zh-TW":bs};function $c(t){return t&&t.__esModule?t.default:t}function js(t,e,i){let{node:l}=t,s=zc(t,e,i),a=s.rowProps["aria-expanded"]===!0,o=Ot($c(ks),"@react-aria/tree"),c=fr({"aria-label":a?o.format("collapse"):o.format("expand"),"aria-labelledby":s.rowProps.id}),r={onPress:()=>{s.isDisabled||(e.toggleKey(l.key),e.selectionManager.setFocused(!0),e.selectionManager.setFocusedKey(l.key))},excludeFromTabOrder:!0,preventFocusOnPress:!0,"data-react-aria-prevent-focus":!0,...c};return{...s,expandButtonProps:r}}var st=class{get childNodes(){throw Error("childNodes is not supported")}clone(){let t=new this.constructor(this.key);return t.value=this.value,t.level=this.level,t.hasChildNodes=this.hasChildNodes,t.rendered=this.rendered,t.textValue=this.textValue,t["aria-label"]=this["aria-label"],t.index=this.index,t.parentKey=this.parentKey,t.prevKey=this.prevKey,t.nextKey=this.nextKey,t.firstChildKey=this.firstChildKey,t.lastChildKey=this.lastChildKey,t.props=this.props,t.render=this.render,t.colSpan=this.colSpan,t.colIndex=this.colIndex,t}filter(t,e,i){let l=this.clone();return e.addDescendants(l,t),l}constructor(t){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=t}},ws=class extends st{filter(t,e,i){let[l,s]=Ss(t,e,this.firstChildKey,i),a=this.clone();return a.firstChildKey=l,a.lastChildKey=s,a}},Lc=class extends st{};Lc.type="header";var Ii=class extends st{};Ii.type="loader";var Cs=class extends ws{filter(t,e,i){if(i(this.textValue,this)){let l=this.clone();return e.addDescendants(l,t),l}return null}};Cs.type="item";var Gc=class extends ws{filter(t,e,i){let l=super.filter(t,e,i);if(l&&l.lastChildKey!==null){let s=t.getItem(l.lastChildKey);if(s&&s.type!=="header")return l}return null}};Gc.type="section";var _s=class{get size(){return this.itemCount}getKeys(){return this.keyMap.keys()}*[Symbol.iterator](){let t=this.firstKey==null?void 0:this.keyMap.get(this.firstKey);for(;t;)yield t,t=t.nextKey==null?void 0:this.keyMap.get(t.nextKey)}getChildren(t){let e=this.keyMap;return{*[Symbol.iterator](){let i=e.get(t),l=(i==null?void 0:i.firstChildKey)==null?null:e.get(i.firstChildKey);for(;l;)yield l,l=l.nextKey==null?void 0:e.get(l.nextKey)}}}getKeyBefore(t){let e=this.keyMap.get(t);if(!e)return null;if(e.prevKey!=null){for(e=this.keyMap.get(e.prevKey);e&&e.type!=="item"&&e.lastChildKey!=null;)e=this.keyMap.get(e.lastChildKey);return(e==null?void 0:e.key)??null}return e.parentKey}getKeyAfter(t){let e=this.keyMap.get(t);if(!e)return null;if(e.type!=="item"&&e.firstChildKey!=null)return e.firstChildKey;for(;e;){if(e.nextKey!=null)return e.nextKey;if(e.parentKey!=null)e=this.keyMap.get(e.parentKey);else return null}return null}getFirstKey(){return this.firstKey}getLastKey(){let t=this.lastKey==null?null:this.keyMap.get(this.lastKey);for(;(t==null?void 0:t.lastChildKey)!=null;)t=this.keyMap.get(t.lastChildKey);return(t==null?void 0:t.key)??null}getItem(t){return this.keyMap.get(t)??null}at(){throw Error("Not implemented")}clone(){let t=this.constructor,e=new t;return e.keyMap=new Map(this.keyMap),e.firstKey=this.firstKey,e.lastKey=this.lastKey,e.itemCount=this.itemCount,e}addNode(t){if(this.frozen)throw Error("Cannot add a node to a frozen collection");t.type==="item"&&this.keyMap.get(t.key)==null&&this.itemCount++,this.keyMap.set(t.key,t)}addDescendants(t,e){this.addNode(t);let i=e.getChildren(t.key);for(let l of i)this.addDescendants(l,e)}removeNode(t){if(this.frozen)throw Error("Cannot remove a node to a frozen collection");let e=this.keyMap.get(t);e!=null&&e.type==="item"&&this.itemCount--,this.keyMap.delete(t)}commit(t,e,i=!1){if(this.frozen)throw Error("Cannot commit a frozen collection");this.firstKey=t,this.lastKey=e,this.frozen=!i}filter(t){let e=new this.constructor,[i,l]=Ss(this,e,this.firstKey,t);return e==null||e.commit(i,l),e}constructor(){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.frozen=!1,this.itemCount=0}};function Ss(t,e,i,l){if(i==null)return[null,null];let s=null,a=null,o=t.getItem(i);for(;o!=null;){let c=o.filter(t,e,l);c!=null&&(c.nextKey=null,a&&(c.prevKey=a.key,a.nextKey=c.key),s??(s=c),e.addNode(c),a=c),o=o.nextKey?t.getItem(o.nextKey):null}if(a&&a.type==="separator"){let c=a.prevKey;e.removeNode(a.key),c?(a=e.getItem(c),a.nextKey=null):a=null}return[(s==null?void 0:s.key)??null,(a==null?void 0:a.key)??null]}var Ns=class{*[Symbol.iterator](){let t=this.firstChild;for(;t;)yield t,t=t.nextSibling}get firstChild(){return this._firstChild}set firstChild(t){this._firstChild=t,this.ownerDocument.markDirty(this)}get lastChild(){return this._lastChild}set lastChild(t){this._lastChild=t,this.ownerDocument.markDirty(this)}get previousSibling(){return this._previousSibling}set previousSibling(t){this._previousSibling=t,this.ownerDocument.markDirty(this)}get nextSibling(){return this._nextSibling}set nextSibling(t){this._nextSibling=t,this.ownerDocument.markDirty(this)}get parentNode(){return this._parentNode}set parentNode(t){this._parentNode=t,this.ownerDocument.markDirty(this)}get isConnected(){var t;return((t=this.parentNode)==null?void 0:t.isConnected)||!1}invalidateChildIndices(t){(this._minInvalidChildIndex==null||!this._minInvalidChildIndex.isConnected||t.index<this._minInvalidChildIndex.index)&&(this._minInvalidChildIndex=t,this.ownerDocument.markDirty(this))}updateChildIndices(){let t=this._minInvalidChildIndex;for(;t;)t.index=t.previousSibling?t.previousSibling.index+1:0,t=t.nextSibling;this._minInvalidChildIndex=null}appendChild(t){t.parentNode&&t.parentNode.removeChild(t),this.firstChild??(this.firstChild=t),this.lastChild?(this.lastChild.nextSibling=t,t.index=this.lastChild.index+1,t.previousSibling=this.lastChild):(t.previousSibling=null,t.index=0),t.parentNode=this,t.nextSibling=null,this.lastChild=t,this.ownerDocument.markDirty(this),this.isConnected&&this.ownerDocument.queueUpdate()}insertBefore(t,e){if(e==null)return this.appendChild(t);t.parentNode&&t.parentNode.removeChild(t),t.nextSibling=e,t.previousSibling=e.previousSibling,t.index=e.index-1,this.firstChild===e?this.firstChild=t:e.previousSibling&&(e.previousSibling.nextSibling=t),e.previousSibling=t,t.parentNode=e.parentNode,this.invalidateChildIndices(t),this.isConnected&&this.ownerDocument.queueUpdate()}removeChild(t){t.parentNode===this&&(this._minInvalidChildIndex===t&&(this._minInvalidChildIndex=null),t.nextSibling&&(this.invalidateChildIndices(t.nextSibling),t.nextSibling.previousSibling=t.previousSibling),t.previousSibling&&(t.previousSibling.nextSibling=t.nextSibling),this.firstChild===t&&(this.firstChild=t.nextSibling),this.lastChild===t&&(this.lastChild=t.previousSibling),t.parentNode=null,t.nextSibling=null,t.previousSibling=null,t.index=0,this.ownerDocument.markDirty(t),this.isConnected&&this.ownerDocument.queueUpdate())}addEventListener(){}removeEventListener(){}get previousVisibleSibling(){let t=this.previousSibling;for(;t&&t.isHidden;)t=t.previousSibling;return t}get nextVisibleSibling(){let t=this.nextSibling;for(;t&&t.isHidden;)t=t.nextSibling;return t}get firstVisibleChild(){let t=this.firstChild;for(;t&&t.isHidden;)t=t.nextSibling;return t}get lastVisibleChild(){let t=this.lastChild;for(;t&&t.isHidden;)t=t.previousSibling;return t}constructor(t){this._firstChild=null,this._lastChild=null,this._previousSibling=null,this._nextSibling=null,this._parentNode=null,this._minInvalidChildIndex=null,this.ownerDocument=t}},Mi=class Li extends Ns{get index(){return this._index}set index(e){this._index=e,this.ownerDocument.markDirty(this)}get level(){var e;return this.parentNode instanceof Li?this.parentNode.level+(((e=this.parentNode.node)==null?void 0:e.type)==="item"?1:0):0}getMutableNode(){return this.node==null?null:(this.isMutated||(this.isMutated=(this.node=this.node.clone(),!0)),this.ownerDocument.markDirty(this),this.node)}updateNode(){var l,s,a,o,c,r,d,u;let e=this.nextVisibleSibling,i=this.getMutableNode();if(i!=null&&(i.index=this.index,i.level=this.level,i.parentKey=this.parentNode instanceof Li?((l=this.parentNode.node)==null?void 0:l.key)??null:null,i.prevKey=((a=(s=this.previousVisibleSibling)==null?void 0:s.node)==null?void 0:a.key)??null,i.nextKey=((o=e==null?void 0:e.node)==null?void 0:o.key)??null,i.hasChildNodes=!!this.firstChild,i.firstChildKey=((r=(c=this.firstVisibleChild)==null?void 0:c.node)==null?void 0:r.key)??null,i.lastChildKey=((u=(d=this.lastVisibleChild)==null?void 0:d.node)==null?void 0:u.key)??null,(i.colSpan!=null||i.colIndex!=null)&&e)){let p=(i.colIndex??i.index)+(i.colSpan??1);if(e.node!=null&&p!==e.node.colIndex){let g=e.getMutableNode();g.colIndex=p}}}setProps(e,i,l,s,a){let o,{value:c,textValue:r,id:d,...u}=e;if(this.node==null?(o=new l(d??`react-aria-${++this.ownerDocument.nodeId}`),this.node=o):o=this.getMutableNode(),u.ref=i,o.props=u,o.rendered=s,o.render=a,o.value=c,e["aria-label"]&&(o["aria-label"]=e["aria-label"]),o.textValue=r||(typeof u.children=="string"?u.children:"")||e["aria-label"]||"",d!=null&&d!==o.key)throw Error("Cannot change the id of an item");u.colSpan!=null&&(o.colSpan=u.colSpan),this.isConnected&&this.ownerDocument.queueUpdate()}get style(){let e=this;return{get display(){return e.isHidden?"none":""},set display(i){var s,a;let l=i==="none";if(e.isHidden!==l){(((s=e.parentNode)==null?void 0:s.firstVisibleChild)===e||((a=e.parentNode)==null?void 0:a.lastVisibleChild)===e)&&e.ownerDocument.markDirty(e.parentNode);let o=e.previousVisibleSibling,c=e.nextVisibleSibling;o&&e.ownerDocument.markDirty(o),c&&e.ownerDocument.markDirty(c),e.isHidden=l,e.ownerDocument.markDirty(e)}}}}hasAttribute(){}setAttribute(){}setAttributeNS(){}removeAttribute(){}constructor(e,i){super(i),this.nodeType=8,this.isMutated=!0,this._index=0,this.isHidden=!1,this.node=null}},Hc=class extends Ns{get isConnected(){return!0}createElement(t){return new Mi(t,this)}getMutableCollection(){return this.nextCollection||(this.nextCollection=this.collection.clone()),this.nextCollection}markDirty(t){this.dirtyNodes.add(t)}addNode(t){if(t.isHidden||t.node==null)return;let e=this.getMutableCollection();if(!e.getItem(t.node.key))for(let i of t)this.addNode(i);e.addNode(t.node)}removeNode(t){for(let e of t)this.removeNode(e);t.node&&this.getMutableCollection().removeNode(t.node.key)}getCollection(){return this.inSubscription?this.collection:(this.queuedRender=!1,this.updateCollection(),this.collection)}updateCollection(){var t,e,i,l;for(let s of this.dirtyNodes)s instanceof Mi&&(!s.isConnected||s.isHidden)?this.removeNode(s):s.updateChildIndices();for(let s of this.dirtyNodes)s instanceof Mi?(s.isConnected&&!s.isHidden&&(s.updateNode(),this.addNode(s)),s.node&&this.dirtyNodes.delete(s),s.isMutated=!1):this.dirtyNodes.delete(s);this.nextCollection&&(this.nextCollection.commit(((e=(t=this.firstVisibleChild)==null?void 0:t.node)==null?void 0:e.key)??null,((l=(i=this.lastVisibleChild)==null?void 0:i.node)==null?void 0:l.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 t of this.subscriptions)t();this.inSubscription=!1}}subscribe(t){return this.subscriptions.add(t),()=>this.subscriptions.delete(t)}resetAfterSSR(){this.isSSR&&(this.isSSR=!1,this.firstChild=null,this.lastChild=null,this.nodeId=0)}constructor(t){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=t,this.nextCollection=t}};function Ki(t){let{children:e,items:i,idScope:l,addIdAndValue:s,dependencies:a=[]}=t,o=(0,h.useMemo)(()=>new WeakMap,a);return(0,h.useMemo)(()=>{if(i&&typeof e=="function"){let c=[];for(let r of i){let d=o.get(r);if(!d){d=e(r);let u=d.props.id??r.key??r.id;if(u==null)throw Error("Could not determine key for item");l!=null&&(u=l+":"+u),d=(0,h.cloneElement)(d,s?{key:u,id:u,value:r}:{key:u}),o.set(r,d)}c.push(d)}return c}else if(typeof e!="function")return e},[e,i,o,l,s])}var Uc=Xi(),qc=Io(),Is=(0,h.createContext)(!1),Ct=(0,h.createContext)(null);function Ms(t){if((0,h.useContext)(Ct))return t.content;let{collection:e,document:i}=Zc(t.createCollection);return h.createElement(h.Fragment,null,h.createElement(hr,null,h.createElement(Ct.Provider,{value:i},t.content)),h.createElement(Wc,{render:t.children,collection:e}))}function Wc({collection:t,render:e}){return e(t)}function Qc(t,e,i){let l=Dn(),s=(0,h.useRef)(l);return s.current=l,(0,qc.useSyncExternalStore)(t,(0,h.useCallback)(()=>s.current?i():e(),[e,i]))}var Yc=typeof h.useSyncExternalStore=="function"?h.useSyncExternalStore:Qc;function Zc(t){let[e]=(0,h.useState)(()=>new Hc((t==null?void 0:t())||new _s));return{collection:Yc((0,h.useCallback)(i=>e.subscribe(i),[e]),(0,h.useCallback)(()=>{let i=e.getCollection();return e.isSSR&&e.resetAfterSSR(),i},[e]),(0,h.useCallback)(()=>(e.isSSR=!0,e.getCollection()),[e])),document:e}}var Di=(0,h.createContext)(null);function Xc(t){var e;return e=class extends st{},e.type=t,e}function Ks(t,e,i,l,s,a){typeof t=="string"&&(t=Xc(t));let o=(0,h.useCallback)(r=>{r==null||r.setProps(e,i,t,l,a)},[e,i,l,a,t]),c=(0,h.useContext)(Di);if(c){let r=c.ownerDocument.nodesByProps.get(e);return r||(r=c.ownerDocument.createElement(t.type),r.setProps(e,i,t,l,a),c.appendChild(r),c.ownerDocument.updateCollection(),c.ownerDocument.nodesByProps.set(e,r)),s?h.createElement(Di.Provider,{value:r},s):null}return h.createElement(t.type,{ref:o},s)}function Ai(t,e){let i=({node:s})=>e(s.props,s.props.ref,s),l=(0,h.forwardRef)((s,a)=>{let o=(0,h.useContext)(wn);if(!(0,h.useContext)(Is)){if(e.length>=3)throw Error(e.name+" cannot be rendered outside a collection.");return e(s,a)}return Ks(t,s,a,"children"in s?s.children:null,null,c=>h.createElement(wn.Provider,{value:o},h.createElement(i,{node:c})))});return l.displayName=e.name,l}function Jc(t,e,i=Ds){let l=({node:a})=>e(a.props,a.props.ref,a),s=(0,h.forwardRef)((a,o)=>Ks(t,a,o,null,i(a),c=>h.createElement(l,{node:c}))??h.createElement(h.Fragment,null));return s.displayName=e.name,s}function Ds(t){return Ki({...t,addIdAndValue:!0})}var As=(0,h.createContext)(null);function Ps(t){let e=(0,h.useContext)(As),i=((e==null?void 0:e.dependencies)||[]).concat(t.dependencies),l=t.idScope??(e==null?void 0:e.idScope),s=Ds({...t,idScope:l,dependencies:i});return(0,h.useContext)(Ct)&&(s=h.createElement(ed,null,s)),e=(0,h.useMemo)(()=>({dependencies:i,idScope:l}),[l,...i]),h.createElement(As.Provider,{value:e},s)}function ed({children:t}){let e=(0,h.useContext)(Ct),i=(0,h.useMemo)(()=>h.createElement(Ct.Provider,{value:null},h.createElement(Is.Provider,{value:!0},t)),[t]);return Dn()?h.createElement(Di.Provider,{value:e},i):(0,Uc.createPortal)(i,e)}var td=(0,h.createContext)(null),Es={CollectionRoot({collection:t,renderDropIndicator:e}){return Ts(t,null,e)},CollectionBranch({collection:t,parent:e,renderDropIndicator:i}){return Ts(t,e,i)}};function Ts(t,e,i){return Ki({items:e?t.getChildren(e.key):t,dependencies:[i],children(l){if(l.type==="content")return h.createElement(h.Fragment,null);let s=l.render(l);return!i||l.type!=="item"?s:h.createElement(h.Fragment,null,i({type:"item",key:l.key,dropPosition:"before"}),s,id(t,l,i))}})}function id(t,e,i){let l=e.key,s=t.getKeyAfter(l),a=s==null?null:t.getItem(s);for(;a!=null&&a.type!=="item";)s=t.getKeyAfter(a.key),a=s==null?null:t.getItem(s);let o=e.nextKey==null?null:t.getItem(e.nextKey);for(;o!=null&&o.type!=="item";)o=o.nextKey==null?null:t.getItem(o.nextKey);let c=[];if(o==null){let r=e;for(;(r==null?void 0:r.type)==="item"&&(!a||r.parentKey!==a.parentKey&&a.level<r.level);){let d=i({type:"item",key:r.key,dropPosition:"after"});(0,h.isValidElement)(d)&&c.push((0,h.cloneElement)(d,{key:`${r.key}-after`})),r=r.parentKey==null?null:t.getItem(r.parentKey)}}return c}var Qt=(0,h.createContext)(Es),Qe=class za extends Set{constructor(e,i,l){super(e),e instanceof za?(this.anchorKey=i??e.anchorKey,this.currentKey=l??e.currentKey):(this.anchorKey=i??null,this.currentKey=l??null)}};function nd(t,e){if(t.size!==e.size)return!1;for(let i of t)if(!e.has(i))return!1;return!0}function Bs(t){let{selectionMode:e="none",disallowEmptySelection:i=!1,allowDuplicateSelectionEvents:l,selectionBehavior:s="toggle",disabledBehavior:a="all"}=t,o=(0,h.useRef)(!1),[,c]=(0,h.useState)(!1),r=(0,h.useRef)(null),d=(0,h.useRef)(null),[,u]=(0,h.useState)(null),[p,g]=pi((0,h.useMemo)(()=>Fs(t.selectedKeys),[t.selectedKeys]),(0,h.useMemo)(()=>Fs(t.defaultSelectedKeys,new Qe),[t.defaultSelectedKeys]),t.onSelectionChange),x=(0,h.useMemo)(()=>t.disabledKeys?new Set(t.disabledKeys):new Set,[t.disabledKeys]),[v,j]=(0,h.useState)(s);s==="replace"&&v==="toggle"&&typeof p=="object"&&p.size===0&&j("replace");let C=(0,h.useRef)(s);return(0,h.useEffect)(()=>{s!==C.current&&(j(s),C.current=s)},[s]),{selectionMode:e,disallowEmptySelection:i,selectionBehavior:v,setSelectionBehavior:j,get isFocused(){return o.current},setFocused(I){o.current=I,c(I)},get focusedKey(){return r.current},get childFocusStrategy(){return d.current},setFocusedKey(I,b="first"){r.current=I,d.current=b,u(I)},selectedKeys:p,setSelectedKeys(I){(l||!nd(I,p))&&g(I)},disabledKeys:x,disabledBehavior:a}}function Fs(t,e){return t?t==="all"?"all":new Qe(t):e}var zs=class Oa{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,i){(e==null||this.collection.getItem(e))&&this.state.setFocusedKey(e,i)}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 i=this.getKey(e);return i==null?!1:this.state.selectedKeys==="all"?this.canSelectItem(i):this.state.selectedKeys.has(i)}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(),i=this.state.selectedKeys;return this._isSelectAll=e.every(l=>i.has(l)),this._isSelectAll}get firstSelectedKey(){let e=null;for(let i of this.state.selectedKeys){let l=this.collection.getItem(i);(!e||l&&_i(this.collection,l,e)<0)&&(e=l)}return(e==null?void 0:e.key)??null}get lastSelectedKey(){let e=null;for(let i of this.state.selectedKeys){let l=this.collection.getItem(i);(!e||l&&_i(this.collection,l,e)>0)&&(e=l)}return(e==null?void 0: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 i=this.getKey(e);if(i==null)return;let l;if(this.state.selectedKeys==="all")l=new Qe([i],i,i);else{let s=this.state.selectedKeys,a=s.anchorKey??i;l=new Qe(s,a,i);for(let o of this.getKeyRange(a,s.currentKey??i))l.delete(o);for(let o of this.getKeyRange(i,a))this.canSelectItem(o)&&l.add(o)}this.state.setSelectedKeys(l)}getKeyRange(e,i){let l=this.collection.getItem(e),s=this.collection.getItem(i);return l&&s?_i(this.collection,l,s)<=0?this.getKeyRangeInternal(e,i):this.getKeyRangeInternal(i,e):[]}getKeyRangeInternal(e,i){var a;if((a=this.layoutDelegate)!=null&&a.getKeyRange)return this.layoutDelegate.getKeyRange(e,i);let l=[],s=e;for(;s!=null;){let o=this.collection.getItem(s);if(o&&(o.type==="item"||o.type==="cell"&&this.allowsCellSelection)&&l.push(s),s===i)return l;s=this.collection.getKeyAfter(s)}return[]}getKey(e){let i=this.collection.getItem(e);if(!i||i.type==="cell"&&this.allowsCellSelection)return e;for(;i&&i.type!=="item"&&i.parentKey!=null;)i=this.collection.getItem(i.parentKey);return!i||i.type!=="item"?null:i.key}toggleSelection(e){if(this.selectionMode==="none")return;if(this.selectionMode==="single"&&!this.isSelected(e)){this.replaceSelection(e);return}let i=this.getKey(e);if(i==null)return;let l=new Qe(this.state.selectedKeys==="all"?this.getSelectAllKeys():this.state.selectedKeys);l.has(i)?l.delete(i):this.canSelectItem(i)&&(l.add(i),l.anchorKey=i,l.currentKey=i),!(this.disallowEmptySelection&&l.size===0)&&this.state.setSelectedKeys(l)}replaceSelection(e){if(this.selectionMode==="none")return;let i=this.getKey(e);if(i==null)return;let l=this.canSelectItem(i)?new Qe([i],i,i):new Qe;this.state.setSelectedKeys(l)}setSelectedKeys(e){if(this.selectionMode==="none")return;let i=new Qe;for(let l of e){let s=this.getKey(l);if(s!=null&&(i.add(s),this.selectionMode==="single"))break}this.state.setSelectedKeys(i)}getSelectAllKeys(){let e=[],i=l=>{var s;for(;l!=null;){if(this.canSelectItem(l)){let a=this.collection.getItem(l);(a==null?void 0:a.type)==="item"&&e.push(l),a!=null&&a.hasChildNodes&&(this.allowsCellSelection||a.type!=="item")&&i(((s=Ic(il(a,this.collection)))==null?void 0:s.key)??null)}l=this.collection.getKeyAfter(l)}};return i(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 Qe)}toggleSelectAll(){this.isSelectAll?this.clearSelection():this.selectAll()}select(e,i){this.selectionMode!=="none"&&(this.selectionMode==="single"?this.isSelected(e)&&!this.disallowEmptySelection?this.toggleSelection(e):this.replaceSelection(e):this.selectionBehavior==="toggle"||i&&(i.pointerType==="touch"||i.pointerType==="virtual")?this.toggleSelection(e):this.replaceSelection(e))}isSelectionEqual(e){if(e===this.state.selectedKeys)return!0;let i=this.selectedKeys;if(e.size!==i.size)return!1;for(let l of e)if(!i.has(l))return!1;for(let l of i)if(!e.has(l))return!1;return!0}canSelectItem(e){var l;if(this.state.selectionMode==="none"||this.state.disabledKeys.has(e))return!1;let i=this.collection.getItem(e);return!(!i||i!=null&&((l=i.props)!=null&&l.isDisabled)||i.type==="cell"&&!this.allowsCellSelection)}isDisabled(e){var l;var i;return this.state.disabledBehavior==="all"&&(this.state.disabledKeys.has(e)||!!((i=this.collection.getItem(e))!=null&&((l=i.props)!=null&&l.isDisabled)))}isLink(e){var l;var i;return!!((i=this.collection.getItem(e))!=null&&((l=i.props)!=null&&l.href))}getItemProps(e){var i;return(i=this.collection.getItem(e))==null?void 0:i.props}withCollection(e){return new Oa(e,this.state,{allowsCellSelection:this.allowsCellSelection,layoutDelegate:this.layoutDelegate||void 0})}constructor(e,i,l){this.collection=e,this.state=i,this.allowsCellSelection=(l==null?void 0:l.allowsCellSelection)??!1,this._isSelectAll=null,this.layoutDelegate=(l==null?void 0:l.layoutDelegate)||null}},ld=class{*[Symbol.iterator](){yield*this.iterable}get size(){return this.keyMap.size}getKeys(){return this.keyMap.keys()}getKeyBefore(t){let e=this.keyMap.get(t);return e?e.prevKey??null:null}getKeyAfter(t){let e=this.keyMap.get(t);return e?e.nextKey??null:null}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(t){return this.keyMap.get(t)??null}at(t){let e=[...this.getKeys()];return this.getItem(e[t])}constructor(t,{expandedKeys:e}={}){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.iterable=t,e||(e=new Set);let i=a=>{if(this.keyMap.set(a.key,a),a.childNodes&&(a.type==="section"||e.has(a.key)))for(let o of a.childNodes)i(o)};for(let a of t)i(a);let l=null,s=0;for(let[a,o]of this.keyMap)l?(l.nextKey=a,o.prevKey=l.key):(this.firstKey=a,o.prevKey=void 0),o.type==="item"&&(o.index=s++),l=o,l.nextKey=void 0;this.lastKey=(l==null?void 0:l.key)??null}};function sd(t){let{onExpandedChange:e}=t,[i,l]=pi(t.expandedKeys?new Set(t.expandedKeys):void 0,t.defaultExpandedKeys?new Set(t.defaultExpandedKeys):new Set,e),s=Bs(t),a=(0,h.useMemo)(()=>t.disabledKeys?new Set(t.disabledKeys):new Set,[t.disabledKeys]),o=tl(t,(0,h.useCallback)(c=>new ld(c,{expandedKeys:i}),[i]),null);return(0,h.useEffect)(()=>{s.focusedKey!=null&&!o.getItem(s.focusedKey)&&s.setFocusedKey(null)},[o,s.focusedKey]),{collection:o,expandedKeys:i,disabledKeys:a,toggleKey:c=>{l(ad(i,c))},setExpandedKeys:l,selectionManager:new zs(o,s)}}function ad(t,e){let i=new Set(t);return i.has(e)?i.delete(e):i.add(e),i}var _t=(0,h.createContext)({}),Pi=(0,h.createContext)(null),od=(0,h.forwardRef)(function(t,e){let{render:i}=(0,h.useContext)(Pi);return h.createElement(h.Fragment,null,i(t,e))});function Os(t,e){var a;let i=t==null?void 0:t.renderDropIndicator,l=(a=t==null?void 0:t.isVirtualDragging)==null?void 0:a.call(t),s=(0,h.useCallback)(o=>{if(l||e!=null&&e.isDropTarget(o))return i?i(o):h.createElement(od,{target:o})},[e==null?void 0:e.target,l,i]);return t!=null&&t.useDropIndicator?s:void 0}function Vs(t,e,i){var a,o,c;let l=t.focusedKey,s=null;if(e!=null&&((a=e.isVirtualDragging)!=null&&a.call(e))&&((o=i==null?void 0:i.target)==null?void 0:o.type)==="item"&&(s=i.target.key,i.target.dropPosition==="after")){let r=i.collection.getKeyAfter(s),d=null;if(r!=null){let u=((c=i.collection.getItem(s))==null?void 0:c.level)??0;for(;r;){let p=i.collection.getItem(r);if(!p)break;if(p.type!=="item"){r=i.collection.getKeyAfter(r);continue}if((p.level??0)<=u)break;d=r,r=i.collection.getKeyAfter(r)}}s=r??d??s}return(0,h.useMemo)(()=>new Set([l,s].filter(r=>r!=null)),[l,s])}var Rs=10,$s=5,rd=class{setup(t,e,i){this.delegate=t,this.state=e,this.direction=i}getDropTargetFromPoint(t,e,i){let l=this.delegate.getDropTargetFromPoint(t,e,i);return!l||l.type==="root"?l:this.resolveDropTarget(l,t,e,i)}resolveDropTarget(t,e,i,l){let s=this.pointerTracking,a=i-s.lastY,o=e-s.lastX,c=s.yDirection,r=s.xDirection;if(Math.abs(a)>$s&&(c=a>0?"down":"up",s.yDirection=c,s.lastY=i),Math.abs(o)>Rs&&(r=o>0?"right":"left",s.xDirection=r,s.lastX=e),t.dropPosition==="before"){let p=this.state.collection.getKeyBefore(t.key);if(p!=null){let g={type:"item",key:p,dropPosition:"after"};l(g)&&(t=g)}}let d=this.getPotentialTargets(t,l);if(d.length===0)return{type:"root"};let u;return d.length>1?u=this.selectTarget(d,t,e,i,c,r):(u=d[0],s.boundaryContext=null),u}getPotentialTargets(t,e){if(t.dropPosition==="on")return[t];let i=t,l=this.state.collection,s=l.getItem(i.key);for(;s&&(s==null?void 0:s.type)!=="item"&&s.nextKey!=null;)i.key=s.nextKey,s=l.getItem(s.nextKey);let a=[i];if(s&&s.hasChildNodes&&this.state.expandedKeys.has(s.key)&&l.getChildren&&i.dropPosition==="after"){let r=null;for(let d of l.getChildren(s.key))if(d.type==="item"){r=d;break}if(r){let d={type:"item",key:r.key,dropPosition:"before"};return e(d)?[d]:[]}}if((s==null?void 0:s.nextKey)!=null)return[t];let o=s==null?void 0:s.parentKey,c=[];for(;o;){let r=l.getItem(o),d=r!=null&&r.nextKey?l.getItem(r.nextKey):null;if(!d||d.parentKey!==o){let u={type:"item",key:o,dropPosition:"after"};if(e(u)&&c.push(u),d)break}o=r==null?void 0:r.parentKey}if(c.length>0&&a.push(...c),a.length===1){let r=l.getKeyAfter(i.key),d=r?l.getItem(r):null;if(r!=null&&d&&s&&d.level!=null&&s.level!=null&&d.level>s.level){let u={type:"item",key:r,dropPosition:"before"};if(e(u))return[u]}}return a.filter(e)}selectTarget(t,e,i,l,s,a){var u;if(t.length<2)return t[0];let o=this.pointerTracking,c=(u=this.state.collection.getItem(e.key))==null?void 0:u.parentKey;if(!c)return t[0];(!o.boundaryContext||o.boundaryContext.parentKey!==c)&&(o.boundaryContext={parentKey:c,preferredTargetIndex:o.yDirection==="up"?t.length-1:0,lastSwitchY:l,lastSwitchX:i});let r=o.boundaryContext,d=Math.abs(i-r.lastSwitchX);if(Math.abs(l-r.lastSwitchY)>$s&&s){let p=r.preferredTargetIndex||0;s==="down"&&p===0?r.preferredTargetIndex=t.length-1:s==="up"&&p===t.length-1&&(r.preferredTargetIndex=0),o.xDirection=null}if(d>Rs&&a){let p=r.preferredTargetIndex||0;a==="left"?this.direction==="ltr"?p<t.length-1&&(r.preferredTargetIndex=p+1,r.lastSwitchX=i):p>0&&(r.preferredTargetIndex=p-1,r.lastSwitchX=i):a==="right"&&(this.direction==="ltr"?p>0&&(r.preferredTargetIndex=p-1,r.lastSwitchX=i):p<t.length-1&&(r.preferredTargetIndex=p+1,r.lastSwitchX=i)),o.yDirection=null}return t[Math.max(0,Math.min(r.preferredTargetIndex||0,t.length-1))]}constructor(){this.delegate=null,this.state=null,this.direction="ltr",this.pointerTracking={lastY:0,lastX:0,yDirection:null,xDirection:null,boundaryContext:null}}},cd=class Gi extends _s{withExpandedKeys(e,i){let l=this.clone();return l.expandedKeys=i,Gi.cloneAncestorSections(i,e,l),Gi.cloneAncestorSections(e,i,l),l.frozen=this.frozen,l}static cloneAncestorSections(e,i,l){for(let s of e)if(!i.has(s)){let a=s;for(;a!=null;){let o=l.getItem(a);if((o==null?void 0:o.type)==="section"){l.keyMap.set(a,o.clone());break}else a=(o==null?void 0:o.parentKey)??null}}}*[Symbol.iterator](){let e=this.getFirstKey(),i=e==null?null:this.getItem(e);for(;i;)if(yield i,i.type==="section")i=i.nextKey?this.getItem(i.nextKey):null;else{let l=this.getKeyAfter(i.key);i=l?this.getItem(l):null}}getLastKey(){let e=this.lastKey;if(e==null)return null;let i=this.getItem(e);for(;(i==null?void 0:i.lastChildKey)!=null&&(i.type!=="item"||this.expandedKeys.has(i.key));)i=this.getItem(i.lastChildKey);return i==null?void 0:i.key}getKeyAfter(e){let i=this.getItem(e);if(!i)return null;if((this.expandedKeys.has(i.key)||i.type!=="item")&&i.firstChildKey!=null)return i.firstChildKey;for(;i;){if(i.nextKey!=null)return i.nextKey;if(i.parentKey!=null)i=this.getItem(i.parentKey);else return null}return null}getKeyBefore(e){let i=this.getItem(e);if(!i)return null;if(i.prevKey!=null){for(i=this.getItem(i.prevKey);i&&(i.type!=="item"||this.expandedKeys.has(i.key))&&i.lastChildKey!=null;)i=this.getItem(i.lastChildKey);return(i==null?void 0:i.key)??null}return i.parentKey}getChildren(e){let i=this;return{*[Symbol.iterator](){let l=i.getItem(e),s=(l==null?void 0:l.firstChildKey)==null?null:i.getItem(l.firstChildKey);if(l&&l.type==="section"&&s)for(;s&&s.key!==l.nextKey;){yield i.getItem(s.key);let a=i.getKeyAfter(s.key);s=a==null?null:i.getItem(a)}else for(;s;)yield s,s=s.nextKey==null?null:i.getItem(s.nextKey)}}}getTextValue(e){let i=this.getItem(e);return i?i.textValue:""}constructor(...e){super(...e),this.expandedKeys=new Set}},dd=(0,h.createContext)(null),Ei=(0,h.createContext)(null),ud=(0,h.forwardRef)(function(t,e){return[t,e]=dr(t,e,dd),h.createElement(Ms,{content:h.createElement(Ps,t),createCollection:()=>new cd},i=>h.createElement(md,{props:t,collection:i,treeRef:e}))}),Ls={expand:{ltr:"ArrowRight",rtl:"ArrowLeft"},collapse:{ltr:"ArrowLeft",rtl:"ArrowRight"}};function md({props:t,collection:e,treeRef:i}){let{dragAndDropHooks:l}=t,{direction:s}=Ht(),a=En({usage:"search",sensitivity:"base"}),o=!!(l!=null&&l.useDraggableCollectionState),c=!!(l!=null&&l.useDroppableCollectionState),r=(0,h.useRef)(o),d=(0,h.useRef)(c);(0,h.useEffect)(()=>{r.current!==o&&console.warn("Drag hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior."),d.current!==c&&console.warn("Drop hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior.")},[o,c]);let{selectionMode:u="none",expandedKeys:p,defaultExpandedKeys:g,onExpandedChange:x,disabledBehavior:v="all"}=t,{CollectionRoot:j,isVirtualized:C,layoutDelegate:I,dropTargetDelegate:b}=(0,h.useContext)(Qt),[_,S]=pi(p?new Set(p):void 0,g?new Set(g):new Set,x),[f,m]=(0,h.useState)(e),[y,P]=(0,h.useState)(_),[A,B]=(0,h.useState)(()=>e.withExpandedKeys(y,_));(!xd(y,_)||e!==f)&&(B(e.withExpandedKeys(y,_)),m(e),P(_));let M=sd({...t,selectionMode:u,expandedKeys:_,onExpandedChange:S,collection:A,children:void 0,disabledBehavior:v}),{gridProps:w}=Rc({...t,isVirtualized:C,layoutDelegate:I},M,i),K,k,D,T=!1,F=null,U=(0,h.useRef)(null);if(o&&l){K=l.useDraggableCollectionState({collection:M.collection,selectionManager:M.selectionManager,preview:l.renderDragPreview?U:void 0}),l.useDraggableCollection({},K,i);let E=l.DragPreview;F=l.renderDragPreview?h.createElement(E,{ref:U},l.renderDragPreview):null}let[W]=(0,h.useState)(()=>new rd);if(c&&l){k=l.useDroppableCollectionState({collection:M.collection,selectionManager:M.selectionManager});let E=l.dropTargetDelegate||b||new l.ListDropTargetDelegate(M.collection,i,{direction:s});W.setup(E,M,s);let X=new wi({collection:M.collection,collator:a,ref:i,disabledKeys:M.selectionManager.disabledKeys,disabledBehavior:M.selectionManager.disabledBehavior,direction:s,layoutDelegate:I});D=l.useDroppableCollection({keyboardDelegate:X,dropTargetDelegate:W,onDropActivate:Q=>{var J;if(Q.target.type==="item"){let ne=Q.target.key,le=M.collection.getItem(ne),ye=_.has(ne);le&&le.hasChildNodes&&(!ye||l!=null&&((J=l.isVirtualDragging)!=null&&J.call(l)))&&M.toggleKey(ne)}},onKeyDown:Q=>{let J=k==null?void 0:k.target;if(J&&J.type==="item"&&J.dropPosition==="on"){let ne=M.collection.getItem(J.key);(Q.key===Ls.expand[s]&&(ne!=null&&ne.hasChildNodes)&&!M.expandedKeys.has(J.key)||Q.key===Ls.collapse[s]&&(ne!=null&&ne.hasChildNodes)&&M.expandedKeys.has(J.key))&&M.toggleKey(J.key)}}},k,i);let Y=k.getDropOperation;k.getDropOperation=Q=>{var ye;let{target:J,isInternal:ne}=Q,le=(K==null?void 0:K.draggingKeys)??new Set;if(ne&&J.type==="item"&&le.size>0){if(le.has(J.key)&&J.dropPosition==="on")return"cancel";let ue=J.key;for(;ue!=null;){let je=(ye=M.collection.getItem(ue))==null?void 0:ye.parentKey;if(je!=null&&le.has(je))return"cancel";ue=je??null}}return Y(Q)},T=k.isDropTarget({type:"root"})}let N=!!(o&&!(K!=null&&K.isDisabled)),{focusProps:q,isFocused:ie,isFocusVisible:ce}=mi(),de={isEmpty:M.collection.size===0,isFocused:ie,isFocusVisible:ce,isDropTarget:T,selectionMode:M.selectionManager.selectionMode,allowsDragging:!!N,state:M},fe=vt({...t,children:void 0,defaultClassName:"react-aria-Tree",values:de}),he=null;if(M.collection.size===0&&t.renderEmptyState){let{isEmpty:E,...X}=de,Y=t.renderEmptyState({...X});he=h.createElement("div",{role:"row",style:{display:"contents"},"aria-level":1},h.createElement("div",{role:"gridcell",style:{display:"contents"}},Y))}let xe=$t(t,{global:!0});return h.createElement(h.Fragment,null,h.createElement(Pr,null,h.createElement(Vt.div,{...Ve(xe,fe,w,q,D==null?void 0:D.collectionProps),ref:i,slot:t.slot||void 0,"data-empty":M.collection.size===0||void 0,"data-focused":ie||void 0,"data-drop-target":T||void 0,"data-focus-visible":ce||void 0,"data-selection-mode":M.selectionManager.selectionMode==="none"?void 0:M.selectionManager.selectionMode,"data-allows-dragging":!!N||void 0},h.createElement(jn,{values:[[Ei,M],[_t,{dragAndDropHooks:l,dragState:K,dropState:k}],[Pi,{render:pd}]]},c&&h.createElement(fd,null),h.createElement(Lr,null,h.createElement(j,{collection:M.collection,persistedKeys:Vs(M.selectionManager,l,k),scrollRef:i,renderDropIndicator:Os(l,k)}))),he)),F)}var Gs=class extends st{};Gs.type="content";var Hs=Ai(Gs,function(t){let e=(0,h.useContext)(Us),i=vt({children:t.children,values:e});return h.createElement(Qt.Provider,{value:Es},i.children)}),Us=(0,h.createContext)(null),qs=class extends st{};qs.type="item";var Ws=Jc(qs,(t,e,i)=>{let l=(0,h.useContext)(Ei);e=hi(e);let{dragAndDropHooks:s,dragState:a,dropState:o}=(0,h.useContext)(_t),{rowProps:c,gridCellProps:r,expandButtonProps:d,descriptionProps:u,...p}=js({node:i,shouldSelectOnPressUp:!!a},l,e),g=c["aria-expanded"]===!0,x=t.hasChildItems||[...l.collection.getChildren(i.key)].length>1,v=c["aria-level"]||1,{hoverProps:j,isHovered:C}=mr({isDisabled:!p.allowsSelection&&!p.hasAction,onHoverStart:t.onHoverStart,onHoverChange:t.onHoverChange,onHoverEnd:t.onHoverEnd}),{isFocusVisible:I,focusProps:b}=mi(),{isFocusVisible:_,focusProps:S}=mi({within:!0}),{checkboxProps:f}=Vc({key:i.key},l),m=null;a&&s&&(m=s.useDraggableItem({key:i.key,hasDragButton:!0},a));let y=null,P=(0,h.useRef)(null),A=(0,h.useRef)(null),B=(0,h.useRef)(null),{visuallyHiddenProps:M}=yi();o&&s&&(y=s.useDropIndicator({target:{type:"item",key:i.key,dropPosition:"on"},activateButtonRef:B},o,A));let w=a&&a.isDragging(i.key),K=y==null?void 0:y.isDropTarget,k=l.selectionManager.selectionMode,D=l.selectionManager.selectionBehavior,T=h.useMemo(()=>({...p,isHovered:C,isFocusVisible:I,isExpanded:g,hasChildItems:x,level:v,selectionMode:k,selectionBehavior:D,isFocusVisibleWithin:_,state:l,id:i.key,allowsDragging:!!a,isDragging:w,isDropTarget:K}),[p,C,I,g,x,v,_,l,i.key,a,w,K,D,k]),F=vt({...t,id:void 0,children:i.rendered,defaultClassName:"react-aria-TreeItem",defaultStyle:{"--tree-item-level":v},values:T});(0,h.useEffect)(()=>{i.textValue},[i.textValue]),(0,h.useEffect)(()=>{x&&P.current},[]);let U=(0,h.useRef)(null);(0,h.useEffect)(()=>{a&&U.current},[]);let W=Ki({items:l.collection.getChildren(i.key),children:ie=>{switch(ie.type){case"content":return ie.render(ie);case"loader":case"item":return h.createElement(h.Fragment,null);default:throw Error("Unsupported element type in TreeRow: "+ie.type)}}}),N=jt(),q=$t(t,{global:!0});return delete q.id,delete q.onClick,h.createElement(h.Fragment,null,y&&!y.isHidden&&h.createElement("div",{role:"row","aria-level":c["aria-level"],"aria-expanded":c["aria-expanded"],"aria-label":y.dropIndicatorProps["aria-label"]},h.createElement("div",{role:"gridcell","aria-colindex":1,style:{display:"contents"}},h.createElement("div",{role:"button",...M,...y.dropIndicatorProps,ref:A}),c["aria-expanded"]==null?null:h.createElement("div",{role:"button",...M,id:N,"aria-label":d["aria-label"],"aria-labelledby":`${N} ${c.id}`,tabIndex:-1,ref:B}))),h.createElement(Vt.div,{...Ve(q,c,b,j,S,m==null?void 0:m.dragProps),...F,ref:e,"data-expanded":x&&g||void 0,"data-has-child-items":x||void 0,"data-level":v,"data-selected":p.isSelected||void 0,"data-disabled":p.isDisabled||void 0,"data-hovered":C||void 0,"data-focused":p.isFocused||void 0,"data-focus-visible":I||void 0,"data-pressed":p.isPressed||void 0,"data-selection-mode":l.selectionManager.selectionMode==="none"?void 0:l.selectionManager.selectionMode,"data-allows-dragging":!!a||void 0,"data-dragging":w||void 0,"data-drop-target":K||void 0},h.createElement("div",{...r,style:{display:"contents"}},h.createElement(jn,{values:[[Er,{slots:{selection:f}}],[gr,{slots:{[ur]:{},chevron:{...d,ref:P},drag:{...m==null?void 0:m.dragButtonProps,ref:U,style:{pointerEvents:"none"}}}}],[Us,{...T}],[Gr,{isSelected:p.isSelected}]]},W))))});Ai(Ii,function(t,e,i){let{isVirtualized:l}=(0,h.useContext)(Qt),s=(0,h.useContext)(Ei),{isLoading:a,onLoadMore:o,scrollOffset:c,...r}=t,d=(0,h.useRef)(null);Gn((0,h.useMemo)(()=>({onLoadMore:o,collection:s==null?void 0:s.collection,sentinelRef:d,scrollOffset:c}),[o,c,s==null?void 0:s.collection]),d),e=hi(e);let{rowProps:u,gridCellProps:p}=js({node:i},s,e),g=u["aria-level"]||1,x={role:"row","aria-level":u["aria-level"]},v=vt({...r,id:void 0,children:i.rendered,defaultClassName:"react-aria-TreeLoader",values:{level:g}}),j={};return l&&(j={display:"contents"}),h.createElement(h.Fragment,null,h.createElement("div",{style:{position:"relative",width:0,height:0},inert:Hn(!0)},h.createElement("div",{"data-testid":"loadMoreSentinel",ref:d,style:{position:"absolute",height:1,width:1}})),a&&v.children&&h.createElement(Vt.div,{ref:e,...Ve($t(t),x),...v,"data-level":g},h.createElement("div",{...p,style:j},v.children)))});function pd(t,e){var d;e=hi(e);let{dragAndDropHooks:i,dropState:l}=(0,h.useContext)(_t),s=(0,h.useRef)(null),{dropIndicatorProps:a,isHidden:o,isDropTarget:c}=i.useDropIndicator(t,l,s);if(o)return null;let r=l&&t.target.type==="item"?(((d=l.collection.getItem(t.target.key))==null?void 0:d.level)||0)+1:1;return h.createElement(gd,{...t,dropIndicatorProps:a,isDropTarget:c,ref:e,buttonRef:s,level:r})}function hd(t,e){let{dropIndicatorProps:i,isDropTarget:l,buttonRef:s,level:a,...o}=t,{visuallyHiddenProps:c}=yi(),r=vt({...o,defaultClassName:"react-aria-DropIndicator",defaultStyle:{position:"relative","--tree-item-level":a},values:{isDropTarget:l}});return h.createElement(Vt.div,{...r,role:"row","aria-level":a,ref:e,"data-drop-target":l||void 0},h.createElement("div",{role:"gridcell"},h.createElement("div",{...c,role:"button",...i,ref:s}),r.children))}var gd=(0,h.forwardRef)(hd);function fd(){let{dragAndDropHooks:t,dropState:e}=(0,h.useContext)(_t),i=(0,h.useRef)(null),{dropIndicatorProps:l}=t.useDropIndicator({target:{type:"root"}},e,i),s=e.isDropTarget({type:"root"}),{visuallyHiddenProps:a}=yi();return!s&&l["aria-hidden"]?null:h.createElement("div",{role:"row","aria-hidden":l["aria-hidden"],style:{position:"absolute"}},h.createElement("div",{role:"gridcell"},h.createElement("div",{role:"button",...a,...l,ref:i})))}function xd(t,e){if(t.size!==e.size)return!1;for(let i of t)if(!e.has(i))return!1;return!0}const Yt=["openai","anthropic","google","ollama","bedrock","deepseek","azure","github","openrouter","wandb","opencode-go","marimo"];var Ke=class Hi{constructor(e,i){this.providerId=e,this.shortModelId=i}get id(){return`${this.providerId}/${this.shortModelId}`}static parse(e){if(!e.includes("/"))return new Hi(yd(e),e);let[i,...l]=e.split("/");return new Hi(i,l.join("/"))}};function yd(t){return t.startsWith("gpt")||t.startsWith("o3")||t.startsWith("o1")?"openai":t.startsWith("claude")?"anthropic":t.startsWith("gemini")||t.startsWith("google")?"google":t.startsWith("deepseek")?"deepseek":"ollama"}function Ti(t){return Yt.includes(t)}const vd=JSON.parse(`{"anthropic":[{"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 most capable widely released Mythos-class model, built for the most demanding reasoning 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":"Next generation of Anthropic's Opus family, 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's most capable Sonnet-class model yet, with frontier performance across 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's strongest 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's frontier reasoning model optimized 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's most advanced Sonnet model to date, 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's frontier model designed for complex professional workloads, building on GPT-5.4 with stronger reasoning, higher reliability, and improved token efficiency 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's latest frontier model, unifying 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 Chat","model":"gpt-5.3-chat-latest","description":"Update to ChatGPT's most-used model that makes everyday conversations smoother, more useful, and more directly helpful","roles":["chat","edit"],"capabilities":["tool_calling"],"input_types":["text","image"],"output_types":["text"],"release_date":"2026-03-03","cost":{"input":1.75,"output":14}},{"name":"GPT-5.3 Codex","model":"gpt-5.3-codex","description":"OpenAI's most advanced agentic coding model, combining the frontier software engineering performance of GPT-5.2-Codex with the broader reasoning and professional knowledge capabilities of GPT-5.2","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.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 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 most capable widely released Mythos-class model, built for the most demanding reasoning 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 most capable widely released Mythos-class model, built for the most demanding reasoning 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":"Next generation of Anthropic's Opus family, 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":"Next generation of Anthropic's Opus family, 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":"SOTA 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's most capable Sonnet-class model yet, with frontier performance across 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 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 most capable widely released Mythos-class model, built for the most demanding reasoning 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's frontier model designed for complex professional workloads, building on GPT-5.4 with stronger reasoning, higher reliability, and improved token efficiency 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's next-generation multimodal model, designed 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's latest frontier model, unifying 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 Chat","model":"gpt-5.3-chat","description":"Update to ChatGPT's most-used model that makes everyday conversations smoother, more useful, and more directly helpful","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image"],"output_types":["text"],"release_date":"2026-03-03","cost":{"input":1.75,"output":14}},{"name":"GPT-5.3 Codex","model":"gpt-5.3-codex","description":"OpenAI's most advanced agentic coding model, combining the frontier software engineering performance of GPT-5.2-Codex with the broader reasoning and professional knowledge capabilities of GPT-5.2","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's most capable Sonnet-class model yet, with frontier performance across 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}}],"github":[{"name":"DeepSeek-R1-0528","model":"deepseek/deepseek-r1-0528","description":"May 28th update to DeepSeek R1, with performance on par with OpenAI o1 but open-sourced and with fully open reasoning tokens","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text"],"output_types":["text"],"release_date":"2025-05-28","cost":{"input":0,"output":0}},{"name":"Mistral Medium 3 (25.05)","model":"mistral-ai/mistral-medium-2505","description":"High-performance enterprise-grade language model designed to deliver frontier-level capabilities at significantly reduced operational cost","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image"],"output_types":["text"],"release_date":"2025-05-01","cost":{"input":0,"output":0}},{"name":"GPT-4.1","model":"openai/gpt-4.1","description":"Flagship large language model optimized for advanced instruction following, real-world software engineering, and long-context reasoning","roles":["chat","edit"],"capabilities":["tool_calling"],"input_types":["text","image"],"output_types":["text"],"release_date":"2025-04-14","cost":{"input":0,"output":0}},{"name":"GPT-4.1-mini","model":"openai/gpt-4.1-mini","description":"Mid-sized model delivering performance competitive with GPT-4o at substantially lower latency and cost","roles":["chat","edit"],"capabilities":["tool_calling"],"input_types":["text","image"],"output_types":["text"],"release_date":"2025-04-14","cost":{"input":0,"output":0}},{"name":"GPT-4.1-nano","model":"openai/gpt-4.1-nano","description":"For tasks that demand low latency, GPT\u20114.1 nano is the fastest and cheapest model in the GPT-4.1 series","roles":["chat","edit"],"capabilities":["tool_calling"],"input_types":["text","image"],"output_types":["text"],"release_date":"2025-04-14","cost":{"input":0,"output":0}},{"name":"DeepSeek-V3-0324","model":"deepseek/deepseek-v3-0324","description":"Latest model from the DeepSeek team, building upon the instruction following and coding abilities of the previous versions","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text"],"output_types":["text"],"release_date":"2025-03-24","cost":{"input":0,"output":0}},{"name":"Mistral Small 3.1","model":"mistral-ai/mistral-small-2503","description":"Upgraded variant of Mistral Small 3 (2501), featuring 24 billion parameters with advanced multimodal capabilities","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image"],"output_types":["text"],"release_date":"2025-03-01","cost":{"input":0,"output":0}},{"name":"Llama 4 Maverick 17B 128E Instruct FP8","model":"meta/llama-4-maverick-17b-128e-instruct-fp8","description":"High-capacity multimodal language model from Meta, built on a mixture-of-experts (MoE) architecture with 128 experts and 17 billion active parameters per forward","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image"],"output_types":["text"],"release_date":"2025-01-31","cost":{"input":0,"output":0}},{"name":"Llama 4 Scout 17B 16E Instruct","model":"meta/llama-4-scout-17b-16e-instruct","description":"Mixture-of-experts (MoE) language model developed by Meta, activating 17 billion parameters out of a total of 109B","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image"],"output_types":["text"],"release_date":"2025-01-31","cost":{"input":0,"output":0}},{"name":"OpenAI o3","model":"openai/o3","description":"Well-rounded reasoning model setting a new standard for math, science, coding, and visual reasoning tasks","roles":["chat","edit"],"capabilities":["thinking"],"input_types":["text","image"],"output_types":["text"],"release_date":"2025-01-31","cost":{"input":0,"output":0}}],"ollama":[{"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's next-generation multimodal model, designed 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":"Next-generation 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 frontier-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":"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.74,"output":3.46}},{"name":"Z.AI 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-13","cost":{"input":1.39,"output":4.4}},{"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 frontier-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":"SOTA 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":"Moonshot AI 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.94,"output":4}},{"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":"JetBrains 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":"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":"Grok 4.5","model":"grok-4.5","description":"xAI's smartest model with frontier performance on coding, knowledge work, and STEM","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image"],"output_types":["text"],"release_date":"2026-07-08","cost":{"input":2,"output":6}},{"name":"Hy3","model":"hy3","description":"Tencent's 295B-parameter Mixture-of-Experts model (21B active) built for reasoning, agentic workflows, and production use","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text"],"output_types":["text"],"release_date":"2026-07-06","cost":{"input":0.14,"output":0.58}},{"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's next-generation multimodal model, designed 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":"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-04-07","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":"Qwen3.6 Plus","model":"qwen3.6-plus","description":"Qwen 3.6 Plus builds on a hybrid architecture that combines efficient linear attention with sparse mixture-of-experts routing, enabling strong scalability and high-performance inference","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image"],"output_types":["text"],"release_date":"2026-04-02","cost":{"input":0.5,"output":3}},{"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":"MiniMax M2.7","model":"minimax-m2.7","description":"Next-generation 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","cost":{"input":0.3,"output":1.2}},{"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,\u2026","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text"],"output_types":["text"],"release_date":"2026-04-22","cost":{"input":1,"output":3}}]}`),bd=[{name:"OpenAI",id:"openai",description:"OpenAI's API for GPT models, including GPT-3.5 and GPT-4.",url:"https://platform.openai.com/"},{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:"GitHub",id:"github",description:"GitHub's API for GPT models with GitHub-hosted models.",url:"https://github.com/features/copilot"},{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/"}];var kd=vd,jd=bd;const Qs=Xe(()=>{let t=new Map,e=new Map;for(let[i,l]of Object.entries(kd)){if(!l)continue;let s=i;for(let a of l){let o=a.model,c={...a,model:o,provider:s,custom:!1},r=`${s}/${o}`;t.set(r,c),(c.roles.includes("chat")||c.roles.includes("edit"))&&!e.has(s)&&e.set(s,r)}}return{modelMap:t,defaultModelByProvider:e}});var Ys=Xe(()=>{let t=new Map,e=new Map;return jd.forEach((i,l)=>{t.set(i.id,i),e.set(i.id,l)}),{providerMap:t,providerToOrderIdx:e}}),St=class si{constructor(e,i){Ae(this,"modelsByProviderMap",new sn);this.customModels=new Set(e),this.displayedModels=new Set(i),this.modelsMap=new Map,this.buildMaps()}static getProviderInfo(e){let{providerMap:i}=Ys();return i.get(e)}static create(e){let{customModels:i=[],displayedModels:l=[]}=e;return new si(i.map(s=>Ke.parse(s).id),l.map(s=>Ke.parse(s).id))}buildMaps(){let e=si.buildMapsFromConfig({displayedModels:this.displayedModels,customModels:this.customModels});e.modelsMap.size===0&&(Z.error("The configured displayed_models have filtered out all registered models. Reverting back to showing all models.",[...this.displayedModels]),e=si.buildMapsFromConfig({displayedModels:new Set,customModels:this.customModels})),this.modelsByProviderMap=e.modelsByProviderMap,this.modelsMap=e.modelsMap}static buildMapsFromConfig(e){let{displayedModels:i,customModels:l}=e,s=i.size>0,a=Qs().modelMap,o=new Map,c=new Map,r=new sn;for(let d of l){if(s&&!i.has(d))continue;let u=Ke.parse(d),p={name:u.shortModelId,model:u.shortModelId,description:"Custom model",provider:u.providerId,roles:[],capabilities:[],input_types:[],output_types:[],release_date:"1970-01-01",custom:!0};o.set(d,p)}if(s)for(let d of i){let u=a.get(d);u&&c.set(d,u)}else c=new Map(a);c=new Map([...o,...c]);for(let[d,u]of c.entries()){let p=Ke.parse(d);r.add(p.providerId,u)}return{modelsByProviderMap:r,modelsMap:c}}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()],i=Ys().providerToOrderIdx;return e.sort((l,s)=>{let a=l[0],o=s[0];return(i.get(a)??0)-(i.get(o)??0)}),e}getModelsMap(){return this.modelsMap}getModel(e){return this.modelsMap.get(e)}};const Zs=Wi("marimo:accept-completion-on-enter",!0,qi,{getOnInit:!0});function wd(t){"scheduler"in window?window.scheduler.postTask(t,{priority:"background"}):"requestIdleCallback"in window?requestIdleCallback(t):setTimeout(t,0)}var Zt=null,Cd=class{constructor(t){Ae(this,"abortController",new AbortController);this.view=t.view,this.view.dom.addEventListener("focus",()=>{Zt=new WeakRef(this.view)},{signal:this.abortController.signal,capture:!0}),this.update()}update(){let t=this.view.dom.querySelector(".cm-vimCursorLayer");if(t instanceof HTMLElement)if(Ua())t.style.display="none";else{let e=(Zt==null?void 0:Zt.deref())===this.view;t.style.display=e?"":"none"}}destroy(){this.abortController.abort()}};const Xs={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 _d(t,e){let i=[];for(let l of t.split(`
2
+ `)){if(l.startsWith('"')||l.trim()==="")continue;let s=Sd(l,e);s&&i.push(s)}return i}function Sd(t,e){let i=t.split(/\s+/),l=i[0],s=0;if(l in Xs){let a=Xs[l],o={};for(let r of a.args||[])if(s+=1,s<i.length)o[r]=i[s];else{e&&e(`Not enough arguments for "${l}" command: "${t}"`);return}let c={name:l};return"args"in a&&(c.args=o),"mode"in a&&(c.mode=a.mode),c}e&&e(`Unknown vimrc command: "${t}"`)}function Nd(){return Id(),Md(),[Ge.of([{key:"j",run:t=>{if(eo(t,!0)&&Zi(t)){let e=t.state.facet(Pt),i=t.state.facet(Yi);return e.moveToNextCell({cellId:i,before:!1,noCreate:!0}),!0}return!1}}]),Ge.of([{key:"k",run:t=>{if(Ja(t)&&Zi(t)){let e=t.state.facet(Pt),i=t.state.facet(Yi);return e.moveToNextCell({cellId:i,before:!0,noCreate:!0}),!0}return!1}}]),Ge.of([{linux:"Ctrl-[",win:"Ctrl-[",run:t=>{let e=ft(t);return e?ea(e)?e.state.vim.insertMode?(te.exitInsertMode(e,!0),!0):!1:(Z.warn("Expected CodeMirror instance to have Vim state"),!1):(Z.warn("Expected CodeMirror instance to have CodeMirror instance state"),!1)}}]),hn.define(t=>(requestAnimationFrame(()=>{Js.INSTANCES.addInstance(t)}),{destroy(){Js.INSTANCES.removeInstance(t)}})),hn.define(t=>new Cd({view:t})),$o.domEventHandlers({keydown(t,e){return t.ctrlKey&&t.key==="Escape"?(e.dom.dispatchEvent(new KeyboardEvent(t.type,t)),!0):!1}})]}function Bi(t,e){let i=t.cm6;if(!i)return;let l=i.coordsAtPos(i.state.selection.main.head);if(!l)return;let s=document.getElementById("App");if(!s)return;let a=s.clientHeight,o;switch(e){case"center":o=(l.top+l.bottom)/2-a/2;break;case"start":o=l.top;break;case"end":o=l.bottom-a;break}s.scrollBy({top:o,behavior:"smooth"})}var Id=Xe(()=>{te.defineAction("goToDefinition",t=>{let e=t.cm6;return Xa(e)}),te.mapCommand("gd","action","goToDefinition",{},{context:"normal"}),te.defineAction("scrollCursorToCenter",t=>Bi(t,"center")),te.mapCommand("zz","action","scrollCursorToCenter",{},{context:"normal"}),te.defineAction("scrollCursorToTop",t=>Bi(t,"start")),te.mapCommand("zt","action","scrollCursorToTop",{},{context:"normal"}),te.defineAction("scrollCursorToBottom",t=>Bi(t,"end")),te.mapCommand("zb","action","scrollCursorToBottom",{},{context:"normal"}),te.defineEx("write","w",t=>{let e=t.cm6;e&&e.state.facet(Pt).saveNotebook()})}),Md=Xe(async()=>{var e;let t=(e=ot.get(oi).keymap)==null?void 0:e.vimrc;if(t)try{Z.log(`Loading vimrc from ${t}`);let i=(await ir().sendFileDetails({path:t})).contents;if(!i){Z.error(`Failed to load vimrc from ${t}`);return}Kd(_d(i,Z.warn))}catch(i){Z.error("Failed to load vimrc:",i)}});function Kd(t){function e(a){if(!a.args){Z.warn(`Could not execute vimrc command "${a.name}: expected arguments"`);return}if(!a.args.lhs||!a.args.rhs){Z.warn(`Could not execute vimrc command "${a.name}: expected arguments"`);return}a.mode?te.map(a.args.lhs,a.args.rhs,a.mode):te.map(a.args.lhs,a.args.rhs)}function i(a){if(!a.args){Z.warn(`Could not execute vimrc command "${a.name}: expected arguments"`);return}if(!a.args.lhs||!a.args.rhs){Z.warn(`Could not execute vimrc command "${a.name}: expected arguments"`);return}a.mode?te.noremap(a.args.lhs,a.args.rhs,a.mode):te.noremap(a.args.lhs,a.args.rhs)}function l(a){if(!a.args){Z.warn(`Could not execute vimrc command "${a.name}: expected arguments"`);return}if(!a.args.lhs){Z.warn(`Could not execute vimrc command "${a.name}: expected arguments"`);return}a.mode?te.unmap(a.args.lhs,a.mode):te.unmap(a.args.lhs)}function s(a){a.mode?te.mapclear(a.mode):te.mapclear()}for(let a of t)"map|nmap|vmap|imap".split("|").includes(a.name)?e(a):"noremap|nnoremap|vnoremap|inoremap".split("|").includes(a.name)?i(a):"unmap|nunmap|vunmap|iunmap".split("|").includes(a.name)?l(a):"mapclear|nmapclear|vmapclear|imapclear".split("|").includes(a.name)?s(a):Z.warn(`Could not execute vimrc command "${a.name}: unknown command"`)}function Dd(t){return"getVimGlobalState_"in t&&typeof t.getVimGlobalState_=="function"}function Ad(){var e;if(!Dd(te))return!1;let t=(e=te.getVimGlobalState_())==null?void 0:e.macroModeState;return t?!!(t.isRecording||t.isPlaying):!1}var Js=(at=class{constructor(){Ae(this,"instances",new Set);Ae(this,"isBroadcasting",!1)}addInstance(e){this.instances.add(e);let i=ft(e);if(!i){Z.warn("Expected CodeMirror instance to have CodeMirror instance state");return}i.on("vim-mode-change",l=>{if(this.isBroadcasting)return;Et("mode"in l,'Expected event to have a "mode" property');let s=Ad();this.isBroadcasting=!0,wd(()=>{s||this.broadcastModeChange(e,l.mode,l.subMode),this.isBroadcasting=!1})})}removeInstance(e){this.instances.delete(e)}broadcastModeChange(e,i,l){Et("exitInsertMode"in te,"Vim does not have an exitInsertMode method"),Et("exitVisualMode"in te,"Vim does not have an exitVisualMode method");for(let s of this.instances)if(s!==e){let a=ft(s);if(!a){Z.warn("Expected CodeMirror instance to have CodeMirror instance state");continue}let o=a.setSelections.bind(a);if(a.setSelections=()=>[],!ea(a)){Z.warn("Expected CodeMirror instance to have Vim state");continue}let c=a.state.vim;switch(i){case"normal":c.insertMode&&te.exitInsertMode(a,!0),c.visualMode&&te.exitVisualMode(a,!0);break;case"insert":c.insertMode||te.handleKey(a,"i","mapping");break;case"visual":break}a.setSelections=o}}},Ae(at,"INSTANCES",new at),at);function ea(t){return t.state.vim!==void 0}const Pd=["default","vim"];function Ed(t,e){switch(t.preset){case"default":return[Ge.of(ta()),Ge.of(ia(e))];case"vim":return[Ge.of(Bd()),Ge.of(ia(e)),Ge.of([{key:"Enter",run:i=>{var l,s;return(s=(l=ft(i))==null?void 0:l.state.vim)!=null&&s.insertMode?Yo(i):!1}}]),pn.high(Fd("d",i=>i.state.doc.toString()==="",i=>i.state.doc.toString()===""?(i.state.facet(Pt).deleteCell(),!0):!1)),Ge.of(Od()),lo({status:!1}),pn.high(Nd())];default:return er(t.preset),[]}}var Td=new Set([fn,gn,yn,xn]),ta=Xe(()=>Zo.filter(t=>!Td.has(t.run))),ia=t=>[{key:t.getHotkey("cell.toggleComment").key,run:fn},{key:t.getHotkey("cell.toggleBlockComment").key,run:gn},{key:t.getHotkey("cell.copyLineUp").key,run:yn},{key:t.getHotkey("cell.copyLineDown").key,run:xn}],Bd=Xe(()=>{let t=new Set(["Enter","Ctrl-v","ArrowUp","ArrowDown","ArrowLeft","ArrowRight"]);return ta().filter(e=>!t.has(e.key||e.mac||e.linux||e.win||""))});function Fd(t,e,i){let l="",s=0;return Ge.of([{any:(a,o)=>{let c=o.key,r=o.timeStamp;return c!==t||!e(a)?(l="",s=0,!1):l===t&&r-s<500&&i(a)?(l="",s=0,!0):(l=c,s=r,!1)}}])}function zd(t){var e;return((e=t==null?void 0:t.state.vim)==null?void 0:e.visualMode)===!0}function Od(){let t=e=>i=>zd(ft(i))?!1:e(i);return[{key:"ArrowDown",run:t(Xo),shift:t(Uo)},{key:"ArrowUp",run:t(qo),shift:t(Lo)},{key:"ArrowLeft",run:t(Qo),shift:t(Go)},{key:"ArrowRight",run:t(Wo),shift:t(Ho)}]}function na(){return["compact","medium","full","columns"]}var Vd={openai:t=>{var e;return!!((e=t==null?void 0:t.open_ai)!=null&&e.api_key)},anthropic:t=>{var e;return!!((e=t==null?void 0:t.anthropic)!=null&&e.api_key)},google:t=>{var e;return!!((e=t==null?void 0:t.google)!=null&&e.api_key)},github:t=>{var e;return!!((e=t==null?void 0:t.github)!=null&&e.api_key)},openrouter:t=>{var e;return!!((e=t==null?void 0:t.openrouter)!=null&&e.api_key)},azure:t=>{var e,i;return!!((e=t==null?void 0:t.azure)!=null&&e.api_key&&((i=t==null?void 0:t.azure)!=null&&i.base_url))},wandb:t=>{var e;return!!((e=t==null?void 0:t.wandb)!=null&&e.api_key)},"opencode-go":t=>{var e;return!!((e=t==null?void 0:t.opencode_go)!=null&&e.api_key)},bedrock:t=>{var e;return!!((e=t==null?void 0:t.bedrock)!=null&&e.region_name)},ollama:t=>{var e;return!!((e=t==null?void 0:t.ollama)!=null&&e.base_url)},deepseek:()=>!1,marimo:()=>!1};function Rd(t){for(let i of Yt)if(Vd[i](t))return i;let e=t==null?void 0:t.custom_providers;if(e){let i=Object.entries(e).find(([l,s])=>s==null?void 0:s.base_url);if(i)return i[0]}}function $d(t){let e=Rd(t);if(e)return Qs().defaultModelByProvider.get(e)}function Ld(t){var a,o;let e={chatModel:void 0,editModel:void 0},i=!((a=t==null?void 0:t.models)!=null&&a.chat_model),l=!((o=t==null?void 0:t.models)!=null&&o.edit_model);if(!i&&!l)return e;let s=$d(t);return s&&(i&&(e.chatModel=s),l&&(e.editModel=s)),e}var Gd=Ce();function la(t){return t.toLowerCase().replaceAll("+","-").trim()}function Hd(t,e){let i=t.getHotkeyGroups(),l=e?new Set(i[e]||[]):new Set,s=new Map;for(let c of t.iterate()){if(l.has(c))continue;let r=t.getHotkey(c);if(!r.key||r.key.trim()==="")continue;let d=la(r.key);s.has(d)||s.set(d,[]);let u=s.get(d);u&&u.push({action:c,name:r.name})}let a=[],o=new Set;for(let[c,r]of s.entries())if(r.length>1){a.push({key:c,actions:r});for(let{action:d}of r)o.add(d)}return{duplicates:a,hasDuplicate:c=>o.has(c),getDuplicatesFor:c=>{let r=t.getHotkey(c);if(!r.key||r.key.trim()==="")return[];let d=la(r.key),u=a.find(p=>p.key===d);return!u||u.actions.length<=1?[]:u.actions.filter(p=>p.action!==c).map(p=>p.action)}}}function Ud(t,e){let i=(0,Gd.c)(3),l;return i[0]!==t||i[1]!==e?(l=Hd(t,e),i[0]=t,i[1]=e,i[2]=l):l=i[2],l}var qd=Ce(),n=Ui(wo(),1);const Wd=t=>{let e=(0,qd.c)(7),{duplicates:i}=t;if(i.length===0)return null;let l,s;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=(0,n.jsx)(gi,{className:"h-4 w-4"}),s=(0,n.jsx)(qr,{children:"Duplicate shortcuts"}),e[0]=l,e[1]=s):(l=e[0],s=e[1]);let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=(0,n.jsx)("p",{className:"mb-2",children:"Multiple actions are assigned to the same keyboard shortcut:"}),e[2]=a):a=e[2];let o;e[3]===i?o=e[4]:(o=i.map(Yd),e[3]=i,e[4]=o);let c;return e[5]===o?c=e[6]:(c=(0,n.jsxs)(Bn,{variant:"warning",className:"mb-4",children:[l,s,(0,n.jsxs)(Tn,{children:[a,(0,n.jsx)("ul",{className:"space-y-2",children:o})]})]}),e[5]=o,e[6]=c),c};function Qd(t){let{action:e,name:i}=t;return(0,n.jsx)("li",{children:i},e)}function Yd(t){let{key:e,actions:i}=t;return(0,n.jsxs)("li",{className:"text-xs",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,n.jsx)(bi,{shortcut:e}),(0,n.jsx)("span",{className:"font-semibold",children:"is used by:"})]}),(0,n.jsx)("ul",{className:"ml-6 list-disc",children:i.map(Qd)})]},e)}const Fi=it(!1),Zd=()=>{let[t,e]=rt(Fi),[i,l]=(0,h.useState)(null),[s,a]=(0,h.useState)([]),[o,c]=tn(),r=nt(po),{saveUserConfig:d}=Ft(),{duplicates:u,hasDuplicate:p,getDuplicatesFor:g}=Ud(r,"Markdown");Hr("global.showHelp",()=>e(S=>!S));let x=async S=>{let f={...o};c(m=>({...m,...S})),await d({config:S}).catch(m=>{throw c(f),m})},v=async S=>{if(!i)return;let f=S.join("-"),m={keymap:{...o.keymap,overrides:{...o.keymap.overrides,[i]:f}}};l(null),a([]),await x(m)},j=async()=>{if(!i)return;let S={keymap:{...o.keymap,overrides:{...o.keymap.overrides}}};delete S.keymap.overrides[i],l(null),a([]),await x(S)},C=async()=>{if(!window.confirm("Are you sure you want to reset all shortcuts to their default values?"))return;let S={keymap:{...o.keymap,overrides:{}}};l(null),a([]),await x(S)};if(!t)return null;let I=S=>{let f=r.getHotkey(S);if(i===S){let P=co(S);return(0,n.jsxs)("div",{children:[(0,n.jsx)(ze,{defaultValue:s.join("+"),placeholder:f.name,onKeyDown:A=>{A.preventDefault();let B=[];if(A.key==="Meta"||A.key==="Control"||A.key==="Alt"||A.key==="Shift"||(A.metaKey&&B.push(en()?"Cmd":"Meta"),A.ctrlKey&&B.push("Ctrl"),A.altKey&&B.push("Alt"),A.shiftKey&&B.push("Shift"),A.key==="-"))return;if(A.key==="Escape"&&B.length===0){l(null),a([]);return}let M=A.key.length===1?A.key.toLowerCase():A.key;A.key===" "&&(M="Space"),B.push(M),v(B)},autoFocus:!0,endAdornment:(0,n.jsx)(se,{variant:"text",size:"xs",className:"mb-0",onClick:()=>{l(null),a([])},children:(0,n.jsx)(ui,{className:"w-4 h-4"})})}),(0,n.jsxs)("div",{className:"flex items-center justify-between w-full",children:[(0,n.jsx)("span",{className:"text-muted-foreground text-xs",children:"Press a key combination"}),P.key!==f.key&&(0,n.jsxs)("span",{className:"text-xs cursor-pointer text-primary",onClick:j,children:["Reset to default:"," ",(0,n.jsx)("span",{className:"font-mono",children:P.key})]})]})]},S)}let m=p(S),y=m?g(S):[];return(0,n.jsxs)("div",{className:"grid grid-cols-[auto_2fr_3fr] gap-2 items-center",children:[r.isEditable(S)?(0,n.jsx)(_n,{className:"cursor-pointer opacity-60 hover:opacity-100 text-muted-foreground w-3 h-3",onClick:()=>{a([]),l(S)}}):(0,n.jsx)("div",{className:"w-3 h-3"}),(0,n.jsx)(bi,{className:"justify-end",shortcut:f.key}),(0,n.jsxs)("div",{className:"flex items-center gap-1",children:[(0,n.jsx)("span",{children:f.name.toLowerCase()}),m&&(0,n.jsxs)("div",{className:"group relative inline-flex",children:[(0,n.jsx)(gi,{className:"w-3 h-3 text-(--yellow-11)"}),(0,n.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:"," ",y.map(P=>r.getHotkey(P).name.toLowerCase()).join(", ")]})]})]})]},S)},b=r.getHotkeyGroups(),_=(S,f)=>{let m=b[S];return(0,n.jsxs)("div",{className:"mb-[40px] gap-2 flex flex-col",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h3",{className:"text-lg font-medium",children:S}),f]}),m.map(I)]})};return(0,n.jsx)($r,{open:t,onOpenChange:S=>e(S),children:(0,n.jsxs)(Rr,{className:"sm:items-center sm:top-0",children:[(0,n.jsx)(Vr,{}),(0,n.jsxs)(Or,{usePortal:!1,className:"max-h-screen sm:max-h-[90vh] overflow-y-auto sm:max-w-[850px]",children:[(0,n.jsx)(Fr,{children:(0,n.jsx)(zr,{children:"Shortcuts"})}),(0,n.jsx)(Wd,{duplicates:u}),(0,n.jsxs)("div",{className:"flex flex-row gap-3",children:[(0,n.jsxs)("div",{className:"w-1/2",children:[_("Editing"),_("Markdown")]}),(0,n.jsxs)("div",{className:"w-1/2",children:[_("Navigation"),_("Running Cells"),_("Creation and Ordering"),(S=>_(S,(0,n.jsxs)("p",{className:"text-xs text-muted-foreground flex items-center gap-1",children:["Press"," ",o.keymap.preset==="vim"?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(bi,{shortcut:en()?"Cmd":"Ctrl"}),(0,n.jsx)(pe,{children:"Esc"})]}):(0,n.jsx)(pe,{children:"Esc"})," ","in a cell to enter command mode"]})))("Command"),_("Other"),(0,n.jsx)(se,{className:"mt-4 hover:bg-destructive/10 border-destructive hover:border-destructive",variant:"outline",size:"xs",onClick:C,tabIndex:-1,children:(0,n.jsx)("span",{className:"text-destructive",children:"Reset all to default"})})]})]})]})]})})};var sa="marimo:copilot:signedIn";const aa=Wi(sa,null,qi,{getOnInit:!0}),oa=it(null),Xt=it(null),ra=it({busy:!1,kind:null,message:null});function Xd(t){ot.set(Xt,t)}function Jd(t){ot.get(Xt)===t&&ot.set(Xt,null)}function eu(){return Wa.getItem(sa)==="true"}function ca(){let t=eu(),e=ho();return t&&e.completion.copilot==="github"}function tu(){return $a(oi,t=>t.completion.copilot==="github")}var zi=Jo(),re=Z.get("@github/copilot-language-server"),iu=1e4,da="python";function ua(t){Et(At(t)&&Qi(t,"request")&&Qi(t,"notify"),"LanguageServerClient is missing request/notify")}function nu(t){if(!At(t))return null;let{busy:e,kind:i,message:l,status:s}=t;return{busy:typeof e=="boolean"?e:!1,kind:typeof i=="string"?i:null,message:typeof l=="string"?l:null,status:typeof s=="string"?s:void 0}}function lu(t){return At(t)&&typeof t.type=="number"&&typeof t.message=="string"}var su=class extends Ha{constructor(e){super(e);Ae(this,"documentVersion",0);Ae(this,"openDocumentCount",0);Ae(this,"copilotSettings",{});Ae(this,"getCompletionInternal",async(e,i)=>await this._request("textDocument/inlineCompletion",{...e,textDocument:{...zi.VersionedTextDocumentIdentifier.create(e.textDocument.uri,i)}}));Ae(this,"throttledGetCompletionInternal",rc(this.getCompletionInternal,200));Ae(this,"handleNotification",e=>{if(!(!At(e)||typeof e.method!="string")){if(e.method==="statusNotification"||e.method==="didChangeStatus"){let i=nu(e.params);i?ot.set(ra,i):re.warn("#statusNotification: Ignoring a status update with no params",e.params);return}if(e.method==="window/logMessage"&&lu(e.params)){let{type:i,message:l}=e.params;switch(i){case 1:re.error("[GitHub Copilot]",l);break;case 2:re.warn("[GitHub Copilot]",l);break;case 3:re.debug("[GitHub Copilot]",l);break;default:re.log("[GitHub Copilot]",l);break}}}});this.copilotSettings=e.copilotSettings??{},this.onNotification(this.handleNotification),this.attachInitializeListener()}attachInitializeListener(){this.initializePromise.then(()=>this.sendConfiguration()).catch(e=>{re.warn("#initialize: Failed to send configuration",e)})}async reInitialize(){re.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}),re.debug("#sendConfiguration: Configuration sent",e))}async _request(e,i){return ua(this),await this.request(e,i,iu)}async sendNotification(e,i){return re.debug("#notify",e,i),ua(this),this.notify(e,i)}getInitializationOptions(){let e={name:"marimo",version:"0.1.0"};return{...super.getInitializationOptions(),workspaceFolders:[],capabilities:{workspace:{workspaceFolders:!1}},initializationOptions:{editorInfo:e,editorPluginInfo:e}}}isDisabled(){return!ca()}async textDocumentDidOpen(e){return this.isDisabled()?!1:(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){var o;if(this.isDisabled())return;let i=e.contentChanges[0];if(!i){re.warn("#textDocumentDidChange: Ignoring an update with no content changes.",e);return}this.openDocumentCount===0&&await this.textDocumentDidOpen({textDocument:{uri:e.textDocument.uri,languageId:da,version:e.textDocument.version,text:i.text}});let l=e.contentChanges;l.length!==1&&re.warn("#textDocumentDidChange: Multiple changes detected. This is not supported.",l),"range"in i&&re.warn("#textDocumentDidChange: Copilot doesn't support range changes.",i);let s=Za(i.text),a=++this.documentVersion;return this.lastOpenedDocument={textDocument:{uri:e.textDocument.uri,languageId:((o=this.lastOpenedDocument)==null?void 0:o.textDocument.languageId)??da,version:a,text:s}},super.textDocumentDidChange({...e,contentChanges:[{text:s}],textDocument:zi.VersionedTextDocumentIdentifier.create(e.textDocument.uri,a)})}textDocumentHover(e){return Promise.resolve({contents:[]})}signOut(){return this._request("signOut",{})}async signInInitiate(){re.log("#signInInitiate: Starting sign-in flow");try{let e=await this._request("signIn",{});return re.log("#signInInitiate: Sign-in flow started successfully"),e}catch(e){throw re.warn("#signInInitiate: Failed to start sign-in flow",e),e}}async signInConfirm(e){re.log("#signInConfirm: Confirming sign-in");try{let i=await this._request("signInConfirm",e);return re.log("#signInConfirm: Sign-in confirmed successfully"),i}catch(i){throw re.warn("#signInConfirm: Failed to confirm sign-in",i),i}}async signedIn(){try{let{status:e}=await this._request("checkStatus",{});return re.log("#checkStatus: Status check completed",{status:e}),e==="SignedIn"||e==="AlreadySignedIn"||e==="OK"}catch(e){throw re.warn("#signedIn: Failed to check sign-in status",e),e}}async getCompletion(e){if(this.isDisabled())return null;let i=this.documentVersion;if(i===0)return null;Xd(i);let l;try{l=await this.throttledGetCompletionInternal({...e,textDocument:zi.VersionedTextDocumentIdentifier.create(e.textDocument.uri,i)},i)}catch(s){return re.warn("#getCompletion: Failed to fetch completions",s),null}finally{Jd(i)}return i===this.documentVersion?l??null:null}},au=class extends Ya{constructor(t){super({getWsUrl:t.getWsUrl,waitForConnection:t.waitForReady,retries:t.retries??3,retryDelayMs:t.retryDelayMs??1e3,onConnectionFailure:e=>{t.showError("GitHub Copilot Connection Error",`Failed to connect to GitHub Copilot. Please check your settings and try again.
3
3
 
4
- ${Ur(e)}`)}})}};const ma="/__marimo_copilot__.py";var pa=`file://${ma}`;const ou=Xe(()=>{let t=bo();return new au({getWsUrl:()=>t.getLSPURL("copilot").toString(),waitForReady:async()=>{await tu(),await yo()},showError:(e,i)=>{Oe({variant:"danger",title:e,description:i})}})}),Nt=Xe(()=>{var l,s;let t=((s=(l=ot.get(oi).ai)==null?void 0:l.github)==null?void 0:s.copilot_settings)??{},e=ou(),i=new su({rootUri:pa,workspaceFolders:null,transport:e,copilotSettings:t});return e.onReconnect=()=>i.reInitialize(),i});function ru(){return Ha({documentUri:pa,client:Nt(),languageId:"copilot",hoverEnabled:!1,completionEnabled:!1,definitionEnabled:!1,renameEnabled:!1,codeActionsEnabled:!1,signatureHelpEnabled:!1,diagnosticsEnabled:!1,sendIncrementalChanges:!1})}const ha=(0,h.memo)(()=>{let[t,e]=rt(aa),[i,l]=rt(oa),[s,a]=(0,h.useState)(),[o,c]=(0,h.useState)(!1),r=async p=>{p.preventDefault(),c(!0);try{let g=await du();if(!(g!=null&&g.verificationUri)||!g.userCode){Z.error("Copilot#trySignIn: Invalid response from sign-in",{result:g}),l("connectionError"),Oe({title:"GitHub Copilot Connection Error",description:"Unable to connect to GitHub Copilot. Please check your settings and try again.",variant:"danger"});return}let{verificationUri:x,status:v,userCode:j}=g;xa(v)?e(!0):(l("signingIn"),a({url:x,code:j}))}catch(g){Z.error("Copilot#trySignIn: Error during sign-in",g),l("connectionError"),Oe({title:"GitHub Copilot Connection Error",description:g instanceof Error?g.message:"Unable to connect to GitHub Copilot. Please check your settings and try again.",variant:"danger"})}finally{c(!1)}},d=async p=>{if(p.preventDefault(),s){c(!0);try{let g=await uu(s.code);g.success?(e(!0),l("signedIn")):g.error==="connection"?(l("connectionError"),Oe({title:"GitHub Copilot Connection Error",description:"Lost connection during sign-in. Please try again.",variant:"danger",action:(0,n.jsx)(se,{onClick:r,children:"Retry"})})):l("signInFailed")}finally{c(!1)}}},u=async p=>{p.preventDefault(),await pu(),e(!1),l("signedOut")};return(()=>{switch(i??(t?"signedIn":"connecting")){case"connecting":return(0,n.jsx)(Le,{className:"font-normal flex",children:"Connecting..."});case"signedOut":return(0,n.jsx)(se,{onClick:r,size:"xs",variant:"link",children:"Sign in to GitHub Copilot"});case"signingIn":return(0,n.jsxs)("ol",{className:"ml-4 text-sm list-decimal [&>li]:mt-2",children:[(0,n.jsx)("li",{children:(0,n.jsxs)("div",{className:"flex items-center",children:["Copy this code:",(0,n.jsx)("strong",{className:"ml-2",children:s==null?void 0:s.code}),(0,n.jsx)(or,{className:"ml-2 cursor-pointer opacity-60 hover:opacity-100 h-3 w-3",onClick:async()=>{s&&(await Cr(s.code),Oe({description:"Copied to clipboard"}))}})]})}),(0,n.jsxs)("li",{children:["Enter the code at this link:",(0,n.jsx)("a",{href:s==null?void 0:s.url,target:"_blank",rel:"noreferrer",className:Ro({variant:"link",size:"xs"}),children:s==null?void 0:s.url})]}),(0,n.jsxs)("li",{children:["Click here when done:",(0,n.jsxs)(se,{size:"xs",onClick:d,className:"ml-1",children:[o&&(0,n.jsx)(zt,{className:"h-3 w-3 mr-1 animate-spin"}),"Done"]})]})]});case"signInFailed":return(0,n.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,n.jsx)("div",{className:"text-destructive text-sm",children:"Sign in failed. Please try again."}),o?(0,n.jsx)(zt,{className:"h-3 w-3 mr-1 animate-spin"}):(0,n.jsx)(se,{onClick:r,size:"xs",variant:"link",children:"Connect to GitHub Copilot"})]});case"signedIn":return(0,n.jsxs)("div",{className:"flex items-center gap-5",children:[(0,n.jsxs)(Le,{className:"font-normal flex items-center",children:[(0,n.jsx)("div",{className:"inline-flex items-center justify-center bg-(--grass-7) rounded-full p-1 mr-2",children:(0,n.jsx)(nr,{className:"h-3 w-3 text-white"})}),"Connected"]}),(0,n.jsx)(se,{onClick:u,size:"xs",variant:"text",children:"Disconnect"})]});case"connectionError":return(0,n.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,n.jsxs)(Le,{className:"font-normal flex",children:[(0,n.jsx)(ui,{className:"h-4 w-4 mr-1"}),"Connection Error"]}),(0,n.jsx)("div",{className:"text-sm",children:"Unable to connect to GitHub Copilot."}),(0,n.jsx)(se,{onClick:r,size:"xs",variant:"link",children:"Retry Connection"})]});case"notConnected":return(0,n.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,n.jsxs)(Le,{className:"font-normal flex",children:[(0,n.jsx)(ui,{className:"h-4 w-4 mr-1"}),"Unable to connect"]}),(0,n.jsxs)("div",{className:"text-sm",children:["For troubleshooting, see the"," ",(0,n.jsx)(oe,{href:"https://docs.marimo.io/getting_started/index.html#github-copilot",children:"docs"}),"."]})]})}})()});ha.displayName="CopilotConfig";var ga=5,cu=3e3;async function du(){return await Nt().signInInitiate()}async function uu(t){let e=Nt();try{Z.log("Copilot#tryFinishSignIn: Attempting to confirm sign-in");let{status:i}=await e.signInConfirm({userCode:t});return xa(i)?(Z.log("Copilot#tryFinishSignIn: Sign-in confirmed successfully"),{success:!0}):(Z.warn("Copilot#tryFinishSignIn: Sign-in confirmation returned unexpected status",{status:i}),{success:!1})}catch(i){return fa(i)?(Z.error("Copilot#tryFinishSignIn: Connection error during sign-in",i),{success:!1,error:"connection"}):await mu(e)}}async function mu(t){for(let e=0;e<ga;e++)try{if(await new Promise(i=>setTimeout(i,cu)),await t.signedIn())return Z.log("Copilot#tryFinishSignIn: Successfully signed in after retry"),{success:!0}}catch(i){if(Z.warn("Copilot#tryFinishSignIn: Retry attempt failed",{attempt:e+1,maxRetries:ga}),fa(i))return{success:!1,error:"connection"}}return Z.error("Copilot#tryFinishSignIn: All sign-in attempts failed"),{success:!1}}async function pu(){await Nt().signOut()}function fa(t){return t instanceof Error&&(t.message.includes("ECONNREFUSED")||t.message.includes("WebSocket")||t.message.includes("network"))}function xa(t){return t==="SignedIn"||t==="AlreadySignedIn"||t==="OK"}var ya="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",hu="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",gu="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",fu="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",va="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",xu="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",ba="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",ka="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",yu="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",vu="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",bu="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=",ku=Ce(),ja={openai:ba,anthropic:ya,claude:ya,gemini:va,google:va,codex:ba,ollama:xu,azure:ec,bedrock:Jr,deepseek:gu,github:fu,openrouter:yu,wandb:vu,"opencode-go":ka,marimo:bu,opencode:ka,cursor:hu};const Ee=t=>{let e=(0,ku.c)(15),i,l,s;e[0]===t?(i=e[1],l=e[2],s=e[3]):({provider:l,className:s,...i}=t,e[0]=t,e[1]=i,e[2]=l,e[3]=s);let a=s===void 0?"":s;if(l==="openai-compatible"||!(l in ja)){let d;e[4]===a?d=e[5]:(d=Pe("h-4 w-4",a),e[4]=a,e[5]=d);let u;return e[6]===d?u=e[7]:(u=(0,n.jsx)(ai,{className:d}),e[6]=d,e[7]=u),u}let o=ja[l],c;e[8]===a?c=e[9]:(c=Pe("h-4 w-4 grayscale dark:invert",a),e[8]=a,e[9]=c);let r;return e[10]!==o||e[11]!==i||e[12]!==l||e[13]!==c?(r=(0,n.jsx)("img",{src:o,alt:l,className:c,...i}),e[10]=o,e[11]=i,e[12]=l,e[13]=c,e[14]=r):r=e[14],r};function Jt(t){switch(t){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 wa(t){switch(t){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 ei=Ce();const R="flex flex-row items-center space-x-1 space-y-0",ju=t=>{let e=(0,ei.c)(2),{children:i}=t,l;return e[0]===i?l=e[1]:(l=(0,n.jsx)("div",{className:"text-md font-semibold text-muted-foreground uppercase tracking-wide mb-1",children:i}),e[0]=i,e[1]=l),l},pt=t=>{let e=(0,ei.c)(10),i,l,s;e[0]===t?(i=e[1],l=e[2],s=e[3]):({children:i,className:l,...s}=t,e[0]=t,e[1]=i,e[2]=l,e[3]=s);let a;e[4]===l?a=e[5]:(a=Pe("text-base font-semibold underline-offset-2 text-accent-foreground uppercase tracking-wide",l),e[4]=l,e[5]=a);let o;return e[6]!==i||e[7]!==s||e[8]!==a?(o=(0,n.jsx)("div",{...s,className:a,children:i}),e[6]=i,e[7]=s,e[8]=a,e[9]=o):o=e[9],o},wu=t=>{let e=(0,ei.c)(2),{children:i}=t,l;return e[0]===i?l=e[1]:(l=(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:i}),e[0]=i,e[1]=l),l},Te=t=>{let e=(0,ei.c)(5),{title:i,children:l}=t,s;e[0]===i?s=e[1]:(s=(0,n.jsx)(pt,{children:i}),e[0]=i,e[1]=s);let a;return e[2]!==l||e[3]!==s?(a=(0,n.jsxs)("div",{className:"flex flex-col gap-4 pb-4",children:[s,l]}),e[2]=l,e[3]=s,e[4]=a):a=e[4],a},Ca=[{label:"Auto (Default)",value:"auto"},{label:"Native",value:"native"},{label:"Polars",value:"polars"},{label:"Lazy Polars",value:"lazy-polars"},{label:"Pandas",value:"pandas"}],Cu="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(".");var _u=Ce();const _a=t=>{let e=(0,_u.c)(12),{value:i,includeSuggestion:l}=t,s=l===void 0?!0:l;if(!i||i.includes("/"))return null;let a;e[0]===i?a=e[1]:(a=Ke.parse(i),e[0]=i,e[1]=a);let o=a.id,c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=(0,n.jsx)("code",{className:"font-bold",children:"provider/model"}),e[2]=c):c=e[2];let r;e[3]===i?r=e[4]:(r=(0,n.jsxs)("span",{children:["Model id should be in the form"," ",c,". ",i," is missing a provider."]}),e[3]=i,e[4]=r);let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=(0,n.jsx)("br",{}),e[5]=d):d=e[5];let u;e[6]!==s||e[7]!==o?(u=s&&o&&(0,n.jsxs)("span",{children:["Did you mean ",(0,n.jsx)("code",{className:"font-bold",children:o}),"?"]}),e[6]=s,e[7]=o,e[8]=u):u=e[8];let p;return e[9]!==r||e[10]!==u?(p=(0,n.jsxs)(wt,{kind:"danger",className:"mt-1",children:[r,d,u]}),e[9]=r,e[10]=u,e[11]=p):p=e[11],p};var It=Ce();function Su({userConfig:t,overrides:e,name:i,value:l}){let s=Ji(t,i),a=Ji(e,i),o=ro(e,i);return{isOverridden:o,userValue:s,projectValue:a,value:o?a:l}}function Mt(){let t=(0,It.c)(3),[e]=nn(),i=nt(mo),l;return t[0]!==i||t[1]!==e?(l=(s,a)=>Su({userConfig:e,overrides:i,name:s,value:a}),t[0]=i,t[1]=e,t[2]=l):l=t[2],l}function $(t){let e=(0,It.c)(9),{control:i,name:l,disabled:s,render:a}=t,o=Mt(),c;e[0]!==o||e[1]!==l||e[2]!==a?(c=d=>{let{field:u}=d;return a({field:u,override:o(l,u.value)})},e[0]=o,e[1]=l,e[2]=a,e[3]=c):c=e[3];let r;return e[4]!==i||e[5]!==s||e[6]!==l||e[7]!==c?(r=(0,n.jsx)(dt,{control:i,name:l,disabled:s,render:c}),e[4]=i,e[5]=s,e[6]=l,e[7]=c,e[8]=r):r=e[8],r}var Sa=()=>{let t=(0,It.c)(2),e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,n.jsxs)("p",{children:["This setting is overridden by the"," ",(0,n.jsx)(pe,{className:"inline mx-px",children:"pyproject.toml"})," config."]}),t[0]=e):e=t[0];let i;return t[1]===Symbol.for("react.memo_cache_sentinel")?(i=(0,n.jsxs)(n.Fragment,{children:[e,(0,n.jsxs)("p",{children:["To change it, edit the project config"," ",(0,n.jsx)(pe,{className:"inline mx-px",children:"pyproject.toml"})," directly."]})]}),t[1]=i):i=t[1],i};const Nu=t=>{let e=(0,It.c)(6),{name:i,children:l}=t,s=Mt(),a;e[0]!==i||e[1]!==s?(a=s(i,void 0),e[0]=i,e[1]=s,e[2]=a):a=e[2];let{isOverridden:o}=a,c;return e[3]!==l||e[4]!==o?(c=o?(0,n.jsx)(We,{delayDuration:200,content:(0,n.jsx)("div",{className:"flex flex-col gap-2",children:(0,n.jsx)(Sa,{})}),children:(0,n.jsx)("div",{className:"text-muted-foreground opacity-80 cursor-not-allowed *:pointer-events-none",children:l})}):l,e[3]=l,e[4]=o,e[5]=c):c=e[5],c},L=t=>{let e=(0,It.c)(12),{override:i}=t;if(!i.isOverridden)return null;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=(0,n.jsx)(Sa,{}),e[0]=l):l=e[0];let s=String(i.userValue),a;e[1]===s?a=e[2]:(a=(0,n.jsx)("strong",{children:s}),e[1]=s,e[2]=a);let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=(0,n.jsx)("br",{}),e[3]=o):o=e[3];let c=String(i.projectValue),r;e[4]===c?r=e[5]:(r=(0,n.jsx)("strong",{children:c}),e[4]=c,e[5]=r);let d;e[6]!==a||e[7]!==r?(d=(0,n.jsxs)("div",{className:"flex flex-col gap-2",children:[l,(0,n.jsxs)("p",{children:["User value: ",a,o,"Project value: ",r]})]}),e[6]=a,e[7]=r,e[8]=d):d=e[8];let u;e[9]===Symbol.for("react.memo_cache_sentinel")?(u=(0,n.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,n.jsx)(Rn,{className:"w-3 h-3"}),"Overridden by pyproject.toml"]}),e[9]=u):u=e[9];let p;return e[10]===d?p=e[11]:(p=(0,n.jsx)(We,{content:d,children:u}),e[10]=d,e[11]=p),p};var Iu=Ce();function Na(){let t=(0,Iu.c)(1),e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=[],t[0]=e):e=t[0],Fn(Mu,e)}async function Mu(){return ri.get("/ai/mcp/status")}function Ku(){let[t,e]=(0,h.useState)(!1);return{refresh:async()=>{e(!0);try{await ri.post("/ai/mcp/refresh",{}),Oe({title:"MCP refreshed",description:"MCP server configuration has been refreshed successfully"})}catch(i){Oe({title:"Refresh failed",description:i instanceof Error?i.message:"Failed to refresh MCP",variant:"danger"})}finally{e(!1)}},isRefreshing:t}}var Ia=Ce();const Du=()=>{let t=(0,Ia.c)(27),{data:e,refetch:i,isFetching:l}=Na(),s;t[0]===i?s=t[1]:(s=async()=>{try{await ri.post("/ai/mcp/refresh",{}),Oe({title:"MCP refreshed",description:"MCP server configuration has been refreshed"}),i()}catch(S){let f=S;Oe({title:"Refresh failed",description:f instanceof Error?f.message:"Failed to refresh MCP",variant:"danger"})}},t[0]=i,t[1]=s);let a=s,o;t[2]===(e==null?void 0:e.servers)?o=t[3]:(o=(e==null?void 0:e.servers)||{},t[2]=e==null?void 0:e.servers,t[3]=o);let c=o,r=Object.keys(c).length>0,d=(e==null?void 0:e.status)==="ok"&&"text-green-500",u=(e==null?void 0:e.status)==="partial"&&"text-yellow-500",p=(e==null?void 0:e.status)==="error"&&r&&"text-red-500",g;t[4]!==d||t[5]!==u||t[6]!==p?(g=Pe("h-4 w-4",d,u,p),t[4]=d,t[5]=u,t[6]=p,t[7]=g):g=t[7];let x;t[8]===g?x=t[9]:(x=(0,n.jsx)(We,{content:"MCP Status",children:(0,n.jsx)(Mo,{asChild:!0,children:(0,n.jsx)(se,{variant:"text",size:"icon",children:(0,n.jsx)($n,{className:g})})})}),t[8]=g,t[9]=x);let v;t[10]===Symbol.for("react.memo_cache_sentinel")?(v=(0,n.jsx)("h4",{className:"font-medium text-sm",children:"MCP Server Status"}),t[10]=v):v=t[10];let j;t[11]===l?j=t[12]:(j=l?(0,n.jsx)(zt,{className:"h-3 w-3 animate-spin"}):(0,n.jsx)(kn,{className:"h-3 w-3"}),t[11]=l,t[12]=j);let C;t[13]!==a||t[14]!==l||t[15]!==j?(C=(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[v,(0,n.jsx)(se,{variant:"ghost",size:"xs",onClick:a,disabled:l,children:j})]}),t[13]=a,t[14]=l,t[15]=j,t[16]=C):C=t[16];let I;t[17]!==r||t[18]!==c||t[19]!==e?(I=e&&(0,n.jsxs)("div",{className:"text-xs space-y-2",children:[r&&(0,n.jsxs)("div",{className:"flex justify-between items-center",children:[(0,n.jsx)("span",{className:"text-muted-foreground",children:"Overall:"}),(0,n.jsx)(ti,{status:e.status})]}),e.error&&(0,n.jsx)("div",{className:"text-xs text-red-500 bg-red-50 dark:bg-red-950/20 p-2 rounded",children:e.error}),r&&(0,n.jsxs)("div",{className:"space-y-1",children:[(0,n.jsx)("div",{className:"text-muted-foreground font-medium",children:"Servers:"}),Object.entries(c).map(Au)]}),!r&&(0,n.jsxs)("div",{className:"text-muted-foreground text-center py-2",children:["No MCP servers configured. ",(0,n.jsx)("br",{})," Configure under"," ",(0,n.jsx)("b",{children:"Settings > AI > MCP"})]})]}),t[17]=r,t[18]=c,t[19]=e,t[20]=I):I=t[20];let b;t[21]!==I||t[22]!==C?(b=(0,n.jsx)(Ko,{className:"w-[320px]",align:"start",side:"right",children:(0,n.jsxs)("div",{className:"space-y-3",children:[C,I]})}),t[21]=I,t[22]=C,t[23]=b):b=t[23];let _;return t[24]!==b||t[25]!==x?(_=(0,n.jsxs)(Do,{children:[x,b]}),t[24]=b,t[25]=x,t[26]=_):_=t[26],_},ti=t=>{let e=(0,Ia.c)(11),{status:i}=t,l=i==="ok"&&"text-green-500",s=i==="partial"&&"text-yellow-500",a=i==="error"&&"text-red-500",o=i==="failed"&&"text-red-500",c=i==="disconnected"&&"text-gray-500",r=i==="pending"&&"text-yellow-500",d=i==="connected"&&"text-green-500",u;e[0]!==l||e[1]!==s||e[2]!==a||e[3]!==o||e[4]!==c||e[5]!==r||e[6]!==d?(u=Pe("text-xs font-medium",l,s,a,o,c,r,d),e[0]=l,e[1]=s,e[2]=a,e[3]=o,e[4]=c,e[5]=r,e[6]=d,e[7]=u):u=e[7];let p;return e[8]!==i||e[9]!==u?(p=(0,n.jsx)("span",{className:u,children:i}),e[8]=i,e[9]=u,e[10]=p):p=e[10],p};function Au(t){let[e,i]=t;return(0,n.jsxs)("div",{className:"flex justify-between items-center pl-2",children:[(0,n.jsx)("span",{className:"text-muted-foreground truncate max-w-[180px]",children:e}),(0,n.jsx)(ti,{status:i})]},e)}var Pu=Ce(),Eu=[{id:"marimo",title:"marimo (docs)",description:"Access marimo documentation"},{id:"context7",title:"Context7",description:"Connect to Context7 MCP server"}];const Tu=t=>{let e=(0,Pu.c)(36),{form:i,onSubmit:l}=t,{handleClick:s}=$i(),{data:a,refetch:o,isFetching:c}=Na(),{refresh:r,isRefreshing:d}=Ku(),u;e[0]!==o||e[1]!==r?(u=async()=>{await r(),o()},e[0]=o,e[1]=r,e[2]=u):u=e[2];let p=u,g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g=(0,n.jsx)(pt,{children:"MCP Servers"}),e[3]=g):g=e[3];let x;e[4]===a?x=e[5]:(x=a&&(0,n.jsx)(ti,{status:a.status}),e[4]=a,e[5]=x);let v=d||c,j;e[6]!==c||e[7]!==d?(j=d||c?(0,n.jsx)(zt,{className:"h-3 w-3 animate-spin"}):(0,n.jsx)(kn,{className:"h-3 w-3"}),e[6]=c,e[7]=d,e[8]=j):j=e[8];let C;e[9]!==p||e[10]!==v||e[11]!==j?(C=(0,n.jsx)(se,{variant:"outline",size:"xs",onClick:p,disabled:v,children:j}),e[9]=p,e[10]=v,e[11]=j,e[12]=C):C=e[12];let I;e[13]!==x||e[14]!==C?(I=(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[g,(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[x,C]})]}),e[13]=x,e[14]=C,e[15]=I):I=e[15];let b;e[16]===a?b=e[17]:(b=(a==null?void 0:a.error)&&(0,n.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}),e[16]=a,e[17]=b);let _;e[18]===a?_=e[19]:(_=(a==null?void 0:a.servers)&&(0,n.jsx)("div",{className:"text-xs text-muted-foreground",children:Object.entries(a.servers).map(Bu)}),e[18]=a,e[19]=_);let S;e[20]===Symbol.for("react.memo_cache_sentinel")?(S=(0,n.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."}),e[20]=S):S=e[20];let f;e[21]===Symbol.for("react.memo_cache_sentinel")?(f=(0,n.jsx)(pe,{className:"inline",children:"marimo[mcp]"}),e[21]=f):f=e[21];let m;e[22]===s?m=e[23]:(m=(0,n.jsxs)("p",{className:"text-sm text-muted-foreground",children:["This feature requires the ",f," ","package. See"," ",(0,n.jsx)(se,{variant:"link",onClick:()=>s("optionalDeps"),size:"xs",children:"Optional Features"})," ","for more details."]}),e[22]=s,e[23]=m);let y;e[24]!==i||e[25]!==l?(y=B=>{let{field:M}=B,w=M.value||[],K=k=>{let D=w.includes(k)?w.filter(T=>T!==k):[...w,k];M.onChange(D),l(i.getValues())};return(0,n.jsx)(O,{children:(0,n.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:Eu.map(k=>{let D=w.includes(k.id);return(0,n.jsxs)(sc,{className:`cursor-pointer transition-all ${D?"border-(--blue-9) bg-(--blue-2)":"hover:border-(--blue-7)"}`,onClick:()=>K(k.id),children:[(0,n.jsx)(ic,{children:(0,n.jsxs)("div",{className:"flex items-start justify-between",children:[(0,n.jsx)(tc,{className:"text-base",children:k.title}),(0,n.jsx)("span",{className:`h-5 w-5 flex items-center justify-center rounded border ${D?"border-(--blue-7) bg-(--blue-7) text-foreground":"border-muted bg-background text-muted-foreground"}`,children:D?(0,n.jsx)(uc,{}):null})]})}),(0,n.jsx)(nc,{children:(0,n.jsx)(lc,{children:k.description})})]},k.id)})})})},e[24]=i,e[25]=l,e[26]=y):y=e[26];let P;e[27]!==i.control||e[28]!==y?(P=(0,n.jsx)(dt,{control:i.control,name:"mcp.presets",render:y}),e[27]=i.control,e[28]=y,e[29]=P):P=e[29];let A;return e[30]!==m||e[31]!==P||e[32]!==I||e[33]!==b||e[34]!==_?(A=(0,n.jsxs)("div",{className:"flex flex-col gap-4",children:[I,b,_,S,m,P]}),e[30]=m,e[31]=P,e[32]=I,e[33]=b,e[34]=_,e[35]=A):A=e[35],A};function Bu(t){let[e,i]=t;return(0,n.jsxs)("div",{children:[e,": ",(0,n.jsx)(ti,{status:i})]},e)}var ve=Ce(),Ma=new Set(Yt);Ma.delete("deepseek");const Fu=t=>{let e=(0,ve.c)(5),{provider:i,children:l}=t,s;e[0]===i?s=e[1]:(s=i&&(0,n.jsx)(Ee,{provider:i,className:"mr-2"}),e[0]=i,e[1]=s);let a;return e[2]!==l||e[3]!==s?(a=(0,n.jsxs)("div",{className:"flex items-center text-base font-semibold",children:[s,l]}),e[2]=l,e[3]=s,e[4]=a):a=e[4],a},Re=t=>{let e=(0,ve.c)(9),{form:i,name:l,placeholder:s,testId:a,description:o,onChange:c}=t,r;e[0]!==o||e[1]!==c||e[2]!==s||e[3]!==a?(r=u=>{let{field:p,override:g}=u;return(0,n.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{children:"API Key"}),(0,n.jsx)(V,{children:(0,n.jsx)(ze,{"data-testid":a,rootClassName:"flex-1",className:"m-0 inline-flex h-7",placeholder:s,type:"password",...p,value:ii(g.value),disabled:g.isOverridden,onChange:x=>{let v=x.target.value;v.includes("*")||(p.onChange(v),c==null||c(v))}})}),(0,n.jsx)(G,{}),(0,n.jsx)(L,{override:g})]}),o&&(0,n.jsx)(H,{children:o})]})},e[0]=o,e[1]=c,e[2]=s,e[3]=a,e[4]=r):r=e[4];let d;return e[5]!==i.control||e[6]!==l||e[7]!==r?(d=(0,n.jsx)($,{control:i.control,name:l,render:r}),e[5]=i.control,e[6]=l,e[7]=r,e[8]=d):d=e[8],d};function ii(t){return t==null?"":typeof t=="string"?t:String(t)}const Ye=t=>{let e=(0,ve.c)(10),{form:i,name:l,placeholder:s,testId:a,description:o,disabled:c,onChange:r}=t,d=c===void 0?!1:c,u;e[0]!==o||e[1]!==d||e[2]!==r||e[3]!==s||e[4]!==a?(u=g=>{let{field:x,override:v}=g;return(0,n.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{children:"Base URL"}),(0,n.jsx)(V,{children:(0,n.jsx)(ze,{"data-testid":a,rootClassName:"flex-1",className:"m-0 inline-flex h-7",placeholder:s,...x,value:ii(v.value),disabled:d||v.isOverridden,onChange:j=>{x.onChange(j.target.value),r==null||r(j.target.value)}})}),(0,n.jsx)(G,{}),(0,n.jsx)(L,{override:v})]}),o&&(0,n.jsx)(H,{children:o})]})},e[0]=o,e[1]=d,e[2]=r,e[3]=s,e[4]=a,e[5]=u):u=e[5];let p;return e[6]!==i.control||e[7]!==l||e[8]!==u?(p=(0,n.jsx)($,{control:i.control,name:l,render:u}),e[6]=i.control,e[7]=l,e[8]=u,e[9]=p):p=e[9],p},Oi=t=>{let e=(0,ve.c)(11),{form:i,name:l,placeholder:s,description:a,label:o,forRole:c,onSubmit:r}=t,d;e[0]!==a||e[1]!==c||e[2]!==i||e[3]!==o||e[4]!==r||e[5]!==s?(d=p=>{let{field:g,override:x}=p,v=ii(x.value),j=x.isOverridden,C=I=>{g.onChange(I),r(i.getValues())};return(0,n.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{children:o}),(0,n.jsx)(V,{children:(0,n.jsx)(Fa,{value:v,placeholder:s,onSelect:C,disabled:j,triggerClassName:"text-sm",customDropdownContent:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Bt,{}),(0,n.jsxs)("p",{className:"px-2 py-1.5 text-sm text-muted-secondary flex items-center gap-1",children:["Enter a custom model",(0,n.jsx)(We,{content:"Models should include the provider prefix, e.g. 'openai/gpt-4o'",children:(0,n.jsx)(Xa,{className:"h-3 w-3"})})]}),(0,n.jsxs)("div",{className:"px-2 py-1",children:[(0,n.jsx)(ze,{className:"w-full border-border shadow-none focus-visible:shadow-xs",placeholder:s,...g,value:v,disabled:j,onKeyDown:mn.stopPropagation()}),v&&(0,n.jsx)(_a,{value:v,includeSuggestion:!1})]})]}),forRole:c})}),(0,n.jsx)(G,{})]}),(0,n.jsx)(L,{override:x}),(0,n.jsx)(_a,{value:v}),a&&(0,n.jsx)(H,{children:a})]})},e[0]=a,e[1]=c,e[2]=i,e[3]=o,e[4]=r,e[5]=s,e[6]=d):d=e[6];let u;return e[7]!==i.control||e[8]!==l||e[9]!==d?(u=(0,n.jsx)($,{control:i.control,name:l,render:d}),e[7]=i.control,e[8]=l,e[9]=d,e[10]=u):u=e[10],u},zu=t=>{let e=(0,ve.c)(8),{form:i,name:l,options:s,testId:a,disabled:o}=t,c=o===void 0?!1:o,r;e[0]!==c||e[1]!==s||e[2]!==a?(r=u=>{let{field:p,override:g}=u;return(0,n.jsx)("div",{className:"flex flex-col space-y-1",children:(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{children:"Provider"}),(0,n.jsx)(V,{children:(0,n.jsx)(Me,{"data-testid":a,onChange:x=>{x.target.value==="none"?p.onChange(!1):p.onChange(x.target.value)},value:ii(g.value===!0?"github":g.value===!1?"none":g.value),disabled:c||g.isOverridden,className:"inline-flex mr-2",children:s.map(Zu)})}),(0,n.jsx)(G,{}),(0,n.jsx)(L,{override:g})]})})},e[0]=c,e[1]=s,e[2]=a,e[3]=r):r=e[3];let d;return e[4]!==i.control||e[5]!==l||e[6]!==r?(d=(0,n.jsx)($,{control:i.control,name:l,render:r}),e[4]=i.control,e[5]=l,e[6]=r,e[7]=d):d=e[7],d};var Ou=({form:t,config:e,onSubmit:i,copilot:l})=>{if(l===!1)return null;if(l==="codeium")return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("p",{className:"text-sm text-muted-secondary",children:["To get a Windsurf API key, follow"," ",(0,n.jsx)(oe,{href:"https://docs.marimo.io/guides/editor_features/ai_completion.html#windsurf-copilot",children:"these instructions"}),"."]}),(0,n.jsx)(Re,{form:t,config:e,name:"completion.codeium_api_key",placeholder:"key",testId:"codeium-api-key-input"})]});if(l==="github")return(0,n.jsx)(ha,{});if(l==="custom")return(0,n.jsx)(Oi,{label:"Autocomplete Model",form:t,config:e,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:i,forRole:"autocomplete"})},ht=t=>{let e=(0,ve.c)(5),{children:i,className:l}=t,s;e[0]===l?s=e[1]:(s=Pe("flex flex-col gap-4 pb-4",l),e[0]=l,e[1]=s);let a;return e[2]!==i||e[3]!==s?(a=(0,n.jsx)("div",{className:s,children:i}),e[2]=i,e[3]=s,e[4]=a):a=e[4],a},Vu=t=>{let e=(0,ve.c)(23),{qualifiedId:i,model:l,isEnabled:s,onToggle:a,onDelete:o}=t,c;e[0]!==a||e[1]!==i?(c=()=>{a(i)},e[0]=a,e[1]=i,e[2]=c):c=e[2];let r=c,d;e[3]!==o||e[4]!==i?(d=C=>{C.stopPropagation(),C.preventDefault(),o(i)},e[3]=o,e[4]=i,e[5]=d):d=e[5];let u=d,p;e[6]===l?p=e[7]:(p=(0,n.jsx)(Ru,{model:l}),e[6]=l,e[7]=p);let g;e[8]!==u||e[9]!==l.custom?(g=l.custom&&(0,n.jsx)(se,{variant:"ghost",size:"icon",onClick:u,className:"mr-2 hover:bg-transparent",children:(0,n.jsx)(Sn,{className:"h-3.5 w-3.5 text-muted-foreground"})}),e[8]=u,e[9]=l.custom,e[10]=g):g=e[10];let x;e[11]!==r||e[12]!==s?(x=(0,n.jsx)(jo,{checked:s,onClick:r,size:"sm"}),e[11]=r,e[12]=s,e[13]=x):x=e[13];let v;e[14]!==p||e[15]!==g||e[16]!==x?(v=(0,n.jsx)(Hs,{children:(0,n.jsxs)("div",{className:"flex items-center justify-between px-3 py-2.5 border-b last:border-b-0 cursor-pointer outline-hidden",children:[p,g,x]})}),e[14]=p,e[15]=g,e[16]=x,e[17]=v):v=e[17];let j;return e[18]!==r||e[19]!==l.name||e[20]!==i||e[21]!==v?(j=(0,n.jsx)(Ws,{id:i,textValue:l.name,className:"pl-6 outline-hidden data-focused:bg-muted/50 hover:bg-muted/50",onAction:r,children:v}),e[18]=r,e[19]=l.name,e[20]=i,e[21]=v,e[22]=j):j=e[22],j},Ru=t=>{let e=(0,ve.c)(18),{model:i}=t,l;e[0]===i.name?l=e[1]:(l=(0,n.jsx)("h3",{className:"font-medium text-sm",children:i.name}),e[0]=i.name,e[1]=l);let s;e[2]===i.custom?s=e[3]:(s=i.custom&&(0,n.jsx)(ai,{className:"h-4 w-4"}),e[2]=i.custom,e[3]=s);let a;e[4]===s?a=e[5]:(a=(0,n.jsx)(We,{content:"Custom model",children:s}),e[4]=s,e[5]=a);let o;e[6]===i.capabilities?o=e[7]:(o=i.capabilities.includes("thinking")&&(0,n.jsxs)("div",{className:Pe("flex items-center gap-1 rounded px-1 py-0.5 w-fit",Jt("thinking")),children:[(0,n.jsx)(ki,{className:"h-3 w-3"}),(0,n.jsx)("span",{className:"text-xs font-medium",children:"Reasoning"})]}),e[6]=i.capabilities,e[7]=o);let c;e[8]!==l||e[9]!==a||e[10]!==o?(c=(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[l,a,o]}),e[8]=l,e[9]=a,e[10]=o,e[11]=c):c=e[11];let r;e[12]!==i.custom||e[13]!==i.description?(r=i.description&&!i.custom&&(0,n.jsx)("p",{className:"text-sm text-muted-foreground line-clamp-2",children:i.description}),e[12]=i.custom,e[13]=i.description,e[14]=r):r=e[14];let d;return e[15]!==c||e[16]!==r?(d=(0,n.jsxs)("div",{className:"flex flex-col flex-1 gap-0.5",children:[c,r]}),e[15]=c,e[16]=r,e[17]=d):d=e[17],d};const $u=t=>{let e=(0,ve.c)(14),{form:i,config:l,onSubmit:s}=t,a=Mt(),o;e[0]===i.control?o=e[1]:(o={control:i.control,name:"completion.copilot"},e[0]=i.control,e[1]=o);let c=bt(o),r;if(e[2]!==l||e[3]!==i||e[4]!==a||e[5]!==s||e[6]!==c){let{value:d}=a("completion.copilot",c),u,p;e[8]===Symbol.for("react.memo_cache_sentinel")?(u=(0,n.jsx)(pt,{children:"Code Completion"}),p=(0,n.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."}),e[8]=u,e[9]=p):(u=e[8],p=e[9]);let g;e[10]===Symbol.for("react.memo_cache_sentinel")?(g=["none","github","codeium","custom"],e[10]=g):g=e[10];let x;e[11]!==l||e[12]!==i?(x=(0,n.jsx)(zu,{form:i,config:l,name:"completion.copilot",options:g,testId:"copilot-select"}),e[11]=l,e[12]=i,e[13]=x):x=e[13],r=(0,n.jsxs)(ht,{children:[u,p,x,Ou({form:i,config:l,onSubmit:s,copilot:d})]}),e[2]=l,e[3]=i,e[4]=a,e[5]=s,e[6]=c,e[7]=r}else r=e[7];return r};var Be=t=>{let e=(0,ve.c)(15),{title:i,triggerClassName:l,provider:s,children:a,isConfigured:o,value:c}=t,r=c??s,d;e[0]===o?d=e[1]:(d=o&&(0,n.jsx)("span",{className:"ml-2 px-1 rounded bg-muted text-xs font-medium border",children:"Configured"}),e[0]=o,e[1]=d);let u;e[2]!==s||e[3]!==d||e[4]!==i?(u=(0,n.jsxs)(Fu,{provider:s,children:[i,d]}),e[2]=s,e[3]=d,e[4]=i,e[5]=u):u=e[5];let p;e[6]!==u||e[7]!==l?(p=(0,n.jsx)(So,{className:l,children:u}),e[6]=u,e[7]=l,e[8]=p):p=e[8];let g;e[9]===a?g=e[10]:(g=(0,n.jsx)(_o,{wrapperClassName:"flex flex-col gap-4",children:a}),e[9]=a,e[10]=g);let x;return e[11]!==r||e[12]!==p||e[13]!==g?(x=(0,n.jsxs)(Co,{value:r,children:[p,g]}),e[11]=r,e[12]=p,e[13]=g,e[14]=x):x=e[14],x};const Lu=({form:t,config:e,onSubmit:i})=>{let[l,s]=(0,h.useState)(!1),[a,o]=(0,h.useState)(""),[c,r]=(0,h.useState)(""),[d,u]=(0,h.useState)(""),p=(0,h.useId)(),g=(0,h.useId)(),x=(0,h.useId)(),v=a.toLowerCase().replaceAll(/\s+/g,"_"),j=t.watch("ai.custom_providers"),C=Ma.has(v)||j&&Object.keys(j).includes(v),I=v.includes("."),b=v.trim()&&d.trim()&&!C&&!I,_=()=>{o(""),r(""),u(""),s(!1)};return(0,n.jsx)(dt,{control:t.control,name:"ai.custom_providers",render:({field:S})=>{let f=S.value||{},m=Object.entries(f),y=()=>{b&&(S.onChange({...f,[v]:{api_key:c||void 0,base_url:d}}),i(t.getValues()),_())},P=w=>{let{[w]:K,...k}=f;t.resetField("ai.custom_providers"),t.setValue("ai.custom_providers",k,{shouldDirty:!0}),i(t.getValues())},A=(0,n.jsxs)("div",{className:"flex flex-col gap-3 p-4 border border-border rounded-md bg-muted/20",children:[(0,n.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,n.jsx)(Le,{htmlFor:p,children:"Provider Name"}),(0,n.jsx)(ze,{id:p,placeholder:"e.g., together, groq, mistral",value:a,onChange:w=>o(w.target.value)}),C&&(0,n.jsx)("p",{className:"text-xs text-destructive",children:"A provider with this name already exists."}),I&&(0,n.jsx)("p",{className:"text-xs text-destructive",children:"Provider names cannot contain '.' characters."}),a&&!I&&(0,n.jsxs)("p",{className:"text-xs text-muted-secondary",children:["Use models with prefix:"," ",(0,n.jsxs)(pe,{className:"inline text-xs",children:[v,"/"]})]})]}),(0,n.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,n.jsxs)(Le,{htmlFor:x,children:["Base URL ",(0,n.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,n.jsx)(ze,{id:x,placeholder:"e.g., https://api.together.xyz/v1",value:d,onChange:w=>u(w.target.value)})]}),(0,n.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,n.jsx)(Le,{htmlFor:g,children:"API Key (optional)"}),(0,n.jsx)(ze,{id:g,placeholder:"sk-...",type:"password",value:c,onChange:w=>r(w.target.value)})]}),(0,n.jsxs)("div",{className:"flex gap-2 mt-1",children:[(0,n.jsx)(se,{onClick:y,disabled:!b,size:"xs",children:"Add Provider"}),(0,n.jsx)(se,{variant:"outline",onClick:_,size:"xs",children:"Cancel"})]})]}),B=w=>{S.onChange({...f,[w.providerName]:{...f[w.providerName],[w.fieldName]:w.value||void 0}})},M=({providerName:w,providerConfig:K,onRemove:k})=>{let D=di.startCase(w),T=!!K.api_key||!!K.base_url;return(0,n.jsxs)(Be,{title:D,provider:w,value:`custom-${w}`,isConfigured:T,children:[(0,n.jsx)(Re,{form:t,config:e,name:`ai.custom_providers.${w}.api_key`,placeholder:"sk-...",testId:`custom-provider-${w}-api-key`,onChange:F=>B({providerName:w,fieldName:"api_key",value:F})}),(0,n.jsx)(Ye,{form:t,config:e,name:`ai.custom_providers.${w}.base_url`,placeholder:"https://api.example.com/v1",testId:`custom-provider-${w}-base-url`,onChange:F=>B({providerName:w,fieldName:"base_url",value:F})}),(0,n.jsxs)(se,{variant:"destructive",size:"xs",onClick:F=>{F.stopPropagation(),F.preventDefault(),k(w)},className:"w-fit self-end",children:[(0,n.jsx)(Sn,{className:"h-4 w-4 mr-2"}),"Remove Provider"]})]},`custom-${w}`)};return(0,n.jsxs)(ht,{children:[(0,n.jsx)(pt,{children:"Custom Providers"}),(0,n.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."}),m.length>0&&(0,n.jsx)(an,{type:"multiple",className:"-mt-4",children:m.map(([w,K])=>M({providerName:w,providerConfig:K,onRemove:P}))}),l?A:(0,n.jsx)(Ka,{className:"self-start",isFormOpen:l,setIsFormOpen:s,label:"Add Provider"})]})}})},Gu=t=>{let e=(0,ve.c)(120),{form:i,config:l,onSubmit:s}=t,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=ct(),e[0]=a):a=e[0];let o=a,c;e[1]===i?c=e[2]:(c=qe=>!!i.getValues(qe),e[1]=i,e[2]=c);let r=c,d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=(0,n.jsx)(pe,{className:"inline",children:"marimo.toml"}),e[3]=d):d=e[3];let u;e[4]===Symbol.for("react.memo_cache_sentinel")?(u=(0,n.jsxs)("p",{className:"text-sm text-muted-secondary",children:["Add your API keys below or to ",d," ","to set up a provider for the Code Completion and Assistant features; see"," ",(0,n.jsx)(oe,{href:"https://docs.marimo.io/guides/editor_features/ai_completion/#connecting-to-an-llm",children:"docs"})," ","for more info."]}),e[4]=u):u=e[4];let p=r("ai.open_ai.api_key"),g;e[5]===Symbol.for("react.memo_cache_sentinel")?(g=(0,n.jsxs)(n.Fragment,{children:["Your OpenAI API key from"," ",(0,n.jsx)(oe,{href:"https://platform.openai.com/account/api-keys",children:"platform.openai.com"}),"."]}),e[5]=g):g=e[5];let x,v;e[6]!==l||e[7]!==i?(x=(0,n.jsx)(Re,{form:i,config:l,name:"ai.open_ai.api_key",placeholder:"sk-proj...",testId:"ai-openai-api-key-input",description:g}),v=(0,n.jsx)(Ye,{form:i,config:l,name:"ai.open_ai.base_url",placeholder:"https://api.openai.com/v1",testId:"ai-base-url-input",disabled:o}),e[6]=l,e[7]=i,e[8]=x,e[9]=v):(x=e[8],v=e[9]);let j;e[10]!==p||e[11]!==x||e[12]!==v?(j=(0,n.jsxs)(Be,{title:"OpenAI",provider:"openai",triggerClassName:"pt-0",isConfigured:p,children:[x,v]}),e[10]=p,e[11]=x,e[12]=v,e[13]=j):j=e[13];let C=r("ai.anthropic.api_key"),I;e[14]===Symbol.for("react.memo_cache_sentinel")?(I=(0,n.jsxs)(n.Fragment,{children:["Your Anthropic API key from"," ",(0,n.jsx)(oe,{href:"https://console.anthropic.com/settings/keys",children:"console.anthropic.com"}),"."]}),e[14]=I):I=e[14];let b;e[15]!==l||e[16]!==i?(b=(0,n.jsx)(Re,{form:i,config:l,name:"ai.anthropic.api_key",placeholder:"sk-ant...",testId:"ai-anthropic-api-key-input",description:I}),e[15]=l,e[16]=i,e[17]=b):b=e[17];let _;e[18]!==C||e[19]!==b?(_=(0,n.jsx)(Be,{title:"Anthropic",provider:"anthropic",isConfigured:C,children:b}),e[18]=C,e[19]=b,e[20]=_):_=e[20];let S=r("ai.google.api_key"),f;e[21]===Symbol.for("react.memo_cache_sentinel")?(f=(0,n.jsxs)(n.Fragment,{children:["Your Google AI API key from"," ",(0,n.jsx)(oe,{href:"https://aistudio.google.com/app/apikey",children:"aistudio.google.com"}),"."]}),e[21]=f):f=e[21];let m;e[22]!==l||e[23]!==i?(m=(0,n.jsx)(Re,{form:i,config:l,name:"ai.google.api_key",placeholder:"AI...",testId:"ai-google-api-key-input",description:f}),e[22]=l,e[23]=i,e[24]=m):m=e[24];let y;e[25]!==S||e[26]!==m?(y=(0,n.jsx)(Be,{title:"Google",provider:"google",isConfigured:S,children:m}),e[25]=S,e[26]=m,e[27]=y):y=e[27];let P=r("ai.ollama.base_url"),A;e[28]!==l||e[29]!==i?(A=(0,n.jsx)(Ye,{form:i,config:l,name:"ai.ollama.base_url",placeholder:"http://localhost:11434/v1",testId:"ollama-base-url-input"}),e[28]=l,e[29]=i,e[30]=A):A=e[30];let B;e[31]!==P||e[32]!==A?(B=(0,n.jsx)(Be,{title:"Ollama",provider:"ollama",isConfigured:P,children:A}),e[31]=P,e[32]=A,e[33]=B):B=e[33];let M=r("ai.github.api_key"),w;e[34]===Symbol.for("react.memo_cache_sentinel")?(w=(0,n.jsx)(Bn,{variant:"warning",className:"py-1.5 px-3 text-xs",children:(0,n.jsxs)(Tn,{children:["Free tier models have low token limits which can cause errors with larger prompts."," ",(0,n.jsx)(oe,{href:"https://docs.github.com/en/github-models/prototyping-with-ai-models#rate-limits",children:"Learn more"})]})}),e[34]=w):w=e[34];let K;e[35]===Symbol.for("react.memo_cache_sentinel")?(K=(0,n.jsxs)(n.Fragment,{children:["Your GitHub API token from"," ",(0,n.jsx)(pe,{className:"inline",children:"gh auth token"}),"."]}),e[35]=K):K=e[35];let k,D;e[36]!==l||e[37]!==i?(k=(0,n.jsx)(Re,{form:i,config:l,name:"ai.github.api_key",placeholder:"gho_...",testId:"ai-github-api-key-input",description:K}),D=(0,n.jsx)(Ye,{form:i,config:l,name:"ai.github.base_url",placeholder:"https://models.github.ai/inference",testId:"ai-github-base-url-input"}),e[36]=l,e[37]=i,e[38]=k,e[39]=D):(k=e[38],D=e[39]);let T;e[40]!==M||e[41]!==k||e[42]!==D?(T=(0,n.jsxs)(Be,{title:"GitHub",provider:"github",isConfigured:M,children:[w,k,D]}),e[40]=M,e[41]=k,e[42]=D,e[43]=T):T=e[43];let F=r("ai.openrouter.api_key"),U;e[44]===Symbol.for("react.memo_cache_sentinel")?(U=(0,n.jsxs)(n.Fragment,{children:["Your OpenRouter API key from ","",(0,n.jsx)(oe,{href:"https://openrouter.ai/keys",children:"openrouter.ai"}),"."]}),e[44]=U):U=e[44];let W,N;e[45]!==l||e[46]!==i?(W=(0,n.jsx)(Re,{form:i,config:l,name:"ai.openrouter.api_key",placeholder:"or-...",testId:"ai-openrouter-api-key-input",description:U}),N=(0,n.jsx)(Ye,{form:i,config:l,name:"ai.openrouter.base_url",placeholder:"https://openrouter.ai/api/v1/",testId:"ai-openrouter-base-url-input"}),e[45]=l,e[46]=i,e[47]=W,e[48]=N):(W=e[47],N=e[48]);let q;e[49]!==F||e[50]!==W||e[51]!==N?(q=(0,n.jsxs)(Be,{title:"OpenRouter",provider:"openrouter",isConfigured:F,children:[W,N]}),e[49]=F,e[50]=W,e[51]=N,e[52]=q):q=e[52];let ie=r("ai.wandb.api_key"),ce;e[53]===Symbol.for("react.memo_cache_sentinel")?(ce=(0,n.jsxs)(n.Fragment,{children:["Your Weights & Biases API key from"," ",(0,n.jsx)(oe,{href:"https://wandb.ai/authorize",children:"wandb.ai"}),"."]}),e[53]=ce):ce=e[53];let de,fe;e[54]!==l||e[55]!==i?(de=(0,n.jsx)(Re,{form:i,config:l,name:"ai.wandb.api_key",placeholder:"your-wandb-api-key",testId:"ai-wandb-api-key-input",description:ce}),fe=(0,n.jsx)(Ye,{form:i,config:l,name:"ai.wandb.base_url",placeholder:"https://api.inference.wandb.ai/v1/",testId:"ai-wandb-base-url-input"}),e[54]=l,e[55]=i,e[56]=de,e[57]=fe):(de=e[56],fe=e[57]);let he;e[58]!==ie||e[59]!==de||e[60]!==fe?(he=(0,n.jsxs)(Be,{title:"Weights & Biases",provider:"wandb",isConfigured:ie,children:[de,fe]}),e[58]=ie,e[59]=de,e[60]=fe,e[61]=he):he=e[61];let xe=r("ai.opencode_go.api_key"),E;e[62]===Symbol.for("react.memo_cache_sentinel")?(E=(0,n.jsxs)(n.Fragment,{children:["Your OpenCode API key from"," ",(0,n.jsx)(oe,{href:"https://opencode.ai/auth",children:"opencode.ai"}),". OpenCode Go is a low-cost subscription for open coding models."]}),e[62]=E):E=e[62];let X,Y;e[63]!==l||e[64]!==i?(X=(0,n.jsx)(Re,{form:i,config:l,name:"ai.opencode_go.api_key",placeholder:"your-opencode-api-key",testId:"ai-opencode-go-api-key-input",description:E}),Y=(0,n.jsx)(Ye,{form:i,config:l,name:"ai.opencode_go.base_url",placeholder:"https://opencode.ai/zen/go/v1/",testId:"ai-opencode-go-base-url-input"}),e[63]=l,e[64]=i,e[65]=X,e[66]=Y):(X=e[65],Y=e[66]);let Q;e[67]!==xe||e[68]!==X||e[69]!==Y?(Q=(0,n.jsxs)(Be,{title:"OpenCode Go",provider:"opencode-go",isConfigured:xe,children:[X,Y]}),e[67]=xe,e[68]=X,e[69]=Y,e[70]=Q):Q=e[70];let J=r("ai.azure.api_key")&&r("ai.azure.base_url"),ne;e[71]===Symbol.for("react.memo_cache_sentinel")?(ne=(0,n.jsxs)(n.Fragment,{children:["Your Azure API key from"," ",(0,n.jsx)(oe,{href:"https://portal.azure.com/",children:"portal.azure.com"}),"."]}),e[71]=ne):ne=e[71];let le,ye;e[72]!==l||e[73]!==i?(le=(0,n.jsx)(Re,{form:i,config:l,name:"ai.azure.api_key",placeholder:"sk-proj...",testId:"ai-azure-api-key-input",description:ne}),ye=(0,n.jsx)(Ye,{form:i,config:l,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"}),e[72]=l,e[73]=i,e[74]=le,e[75]=ye):(le=e[74],ye=e[75]);let ue;e[76]!==J||e[77]!==le||e[78]!==ye?(ue=(0,n.jsxs)(Be,{title:"Azure",provider:"azure",isConfigured:J,children:[le,ye]}),e[76]=J,e[77]=le,e[78]=ye,e[79]=ue):ue=e[79];let je=r("ai.bedrock.region_name"),_e;e[80]===Symbol.for("react.memo_cache_sentinel")?(_e=(0,n.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,n.jsx)(oe,{href:"https://docs.marimo.io/guides/editor_features/ai_completion.html#aws-bedrock",children:"documentation"})," ","for more details."]}),e[80]=_e):_e=e[80];let ge,be;e[81]===i.control?(ge=e[82],be=e[83]):(ge=(0,n.jsx)($,{control:i.control,disabled:o,name:"ai.bedrock.region_name",render:Ju}),be=(0,n.jsx)($,{control:i.control,disabled:o,name:"ai.bedrock.profile_name",render:e0}),e[81]=i.control,e[82]=ge,e[83]=be);let me;e[84]!==je||e[85]!==ge||e[86]!==be?(me=(0,n.jsxs)(Be,{title:"AWS Bedrock",provider:"bedrock",isConfigured:je,children:[_e,ge,be]}),e[84]=je,e[85]=ge,e[86]=be,e[87]=me):me=e[87];let De=r("ai.open_ai_compatible.api_key")&&r("ai.open_ai_compatible.base_url"),ke;e[88]===Symbol.for("react.memo_cache_sentinel")?(ke=(0,n.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."}),e[88]=ke):ke=e[88];let Se;e[89]===Symbol.for("react.memo_cache_sentinel")?(Se=(0,n.jsx)(n.Fragment,{children:"API key for any OpenAI-compatible provider (e.g., Together, Groq, Mistral, Perplexity, etc)."}),e[89]=Se):Se=e[89];let ae;e[90]!==l||e[91]!==i?(ae=(0,n.jsx)(Re,{form:i,config:l,name:"ai.open_ai_compatible.api_key",placeholder:"sk-...",testId:"ai-openai-compatible-api-key-input",description:Se}),e[90]=l,e[91]=i,e[92]=ae):ae=e[92];let Ze;e[93]===Symbol.for("react.memo_cache_sentinel")?(Ze=(0,n.jsx)(n.Fragment,{children:"Base URL for your OpenAI-compatible provider."}),e[93]=Ze):Ze=e[93];let Ne;e[94]!==l||e[95]!==i?(Ne=(0,n.jsx)(Ye,{form:i,config:l,name:"ai.open_ai_compatible.base_url",placeholder:"https://api.together.xyz/v1",testId:"ai-openai-compatible-base-url-input",description:Ze}),e[94]=l,e[95]=i,e[96]=Ne):Ne=e[96];let $e;e[97]!==De||e[98]!==ae||e[99]!==Ne?($e=(0,n.jsxs)(Be,{title:"OpenAI-Compatible (Legacy)",provider:"openai-compatible",isConfigured:De,children:[ke,ae,Ne]}),e[97]=De,e[98]=ae,e[99]=Ne,e[100]=$e):$e=e[100];let Ie;e[101]!==_||e[102]!==y||e[103]!==B||e[104]!==T||e[105]!==q||e[106]!==he||e[107]!==Q||e[108]!==ue||e[109]!==me||e[110]!==$e||e[111]!==j?(Ie=(0,n.jsxs)(an,{type:"multiple",children:[j,_,y,B,T,q,he,Q,ue,me,$e]}),e[101]=_,e[102]=y,e[103]=B,e[104]=T,e[105]=q,e[106]=he,e[107]=Q,e[108]=ue,e[109]=me,e[110]=$e,e[111]=j,e[112]=Ie):Ie=e[112];let Fe;e[113]!==l||e[114]!==i||e[115]!==s?(Fe=(0,n.jsx)(Lu,{form:i,config:l,onSubmit:s}),e[113]=l,e[114]=i,e[115]=s,e[116]=Fe):Fe=e[116];let we;return e[117]!==Ie||e[118]!==Fe?(we=(0,n.jsxs)(ht,{children:[u,Ie,Fe]}),e[117]=Ie,e[118]=Fe,e[119]=we):we=e[119],we},Hu=t=>{var b;let e=(0,ve.c)(29),{form:i,config:l,onSubmit:s}=t,[a,o]=(0,h.useState)(((b=l.ai)==null?void 0:b.max_tokens)!=null),c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=(0,n.jsx)(pt,{children:"AI Assistant"}),e[0]=c):c=e[0];let r;e[1]===i.control?r=e[2]:(r=(0,n.jsx)(dt,{control:i.control,name:"ai.inline_tooltip",render:t0}),e[1]=i.control,e[2]=r);let d;e[3]!==i||e[4]!==a||e[5]!==s?(d=_=>{let{field:S}=_;return(0,n.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,n.jsxs)("div",{className:"flex items-center gap-x-2",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{className:"font-normal",children:"Max output tokens"}),(0,n.jsx)(V,{children:(0,n.jsx)(ze,{"data-testid":"ai-max-tokens-input",type:"number",min:1,disabled:!a,className:"w-28 h-6",value:S.value??(a?"":32768),onChange:f=>{let m=Number.parseInt(f.target.value,10);S.onChange(Number.isFinite(m)&&m>0?m:null)}})})]}),(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(ee,{"data-testid":"ai-max-tokens-checkbox",checked:a,onCheckedChange:f=>{let m=f===!0;o(m);let y=m?S.value??32768:null;i.setValue("ai.max_tokens",y,{shouldDirty:!0,shouldTouch:!0}),s(i.getValues())}}),(0,n.jsx)(z,{className:"font-normal",children:"Override"})]})]}),(0,n.jsx)(H,{children:"Each provider sets its own max output tokens (Anthropic uses a recommended default). Adjust to control costs or enable more output."})]})},e[3]=i,e[4]=a,e[5]=s,e[6]=d):d=e[6];let u;e[7]!==i.control||e[8]!==d?(u=(0,n.jsx)(dt,{control:i.control,name:"ai.max_tokens",render:d}),e[7]=i.control,e[8]=d,e[9]=u):u=e[9];let p;e[10]===Symbol.for("react.memo_cache_sentinel")?(p=(0,n.jsx)(vr,{}),e[10]=p):p=e[10];let g;e[11]===Symbol.for("react.memo_cache_sentinel")?(g=(0,n.jsx)("span",{children:"Model to use for chat conversations in the Chat panel."}),e[11]=g):g=e[11];let x;e[12]!==l||e[13]!==i||e[14]!==s?(x=(0,n.jsx)(Oi,{label:"Chat Model",form:i,config:l,name:"ai.models.chat_model",placeholder:ln,description:g,forRole:"chat",onSubmit:s}),e[12]=l,e[13]=i,e[14]=s,e[15]=x):x=e[15];let v;e[16]===Symbol.for("react.memo_cache_sentinel")?(v=(0,n.jsxs)("span",{children:["Model to use for code editing with the"," ",(0,n.jsx)(pe,{className:"inline",children:"Generate with AI"})," button."]}),e[16]=v):v=e[16];let j;e[17]!==l||e[18]!==i||e[19]!==s?(j=(0,n.jsx)(Oi,{label:"Edit Model",form:i,config:l,name:"ai.models.edit_model",placeholder:ln,description:v,forRole:"edit",onSubmit:s}),e[17]=l,e[18]=i,e[19]=s,e[20]=j):j=e[20];let C;e[21]===i.control?C=e[22]:(C=(0,n.jsx)($,{control:i.control,name:"ai.rules",render:i0}),e[21]=i.control,e[22]=C);let I;return e[23]!==C||e[24]!==r||e[25]!==u||e[26]!==x||e[27]!==j?(I=(0,n.jsxs)(ht,{children:[c,r,u,p,x,j,C]}),e[23]=C,e[24]=r,e[25]=u,e[26]=x,e[27]=j,e[28]=I):I=e[28],I};var Uu=t=>{let e=(0,ve.c)(51),{providerId:i,models:l,enabledModels:s,onToggleModel:a,onToggleProvider:o,onDeleteModel:c}=t,r;if(e[0]!==s||e[1]!==l||e[2]!==i){let w;e[4]!==s||e[5]!==i?(w=K=>s.has(new Ke(i,K.model).id),e[4]=s,e[5]=i,e[6]=w):w=e[6],r=l.filter(w),e[0]=s,e[1]=l,e[2]=i,e[3]=r}else r=e[3];let d=r.length,u=l.length,p;e[7]===i?p=e[8]:(p=St.getProviderInfo(i),e[7]=i,e[8]=p);let g=p,x;e[9]!==(g==null?void 0:g.name)||e[10]!==i?(x=(g==null?void 0:g.name)||di.startCase(i),e[9]=g==null?void 0:g.name,e[10]=i,e[11]=x):x=e[11];let v=x,j=d===0?!1:d===u?!0:"indeterminate",C;e[12]!==d||e[13]!==o||e[14]!==i||e[15]!==u?(C=()=>{o(i,d<u/2)},e[12]=d,e[13]=o,e[14]=i,e[15]=u,e[16]=C):C=e[16];let I=Dt(C),b;e[17]===Symbol.for("react.memo_cache_sentinel")?(b=mn.stopPropagation(),e[17]=b):b=e[17];let _;e[18]!==j||e[19]!==I?(_=(0,n.jsx)(ee,{checked:j,onCheckedChange:I,onClick:b}),e[18]=j,e[19]=I,e[20]=_):_=e[20];let S;e[21]===i?S=e[22]:(S=(0,n.jsx)(Ee,{provider:i,className:"h-5 w-5"}),e[21]=i,e[22]=S);let f;e[23]===v?f=e[24]:(f=(0,n.jsx)("h2",{className:"font-semibold",children:v}),e[23]=v,e[24]=f);let m;e[25]!==d||e[26]!==u?(m=(0,n.jsxs)("p",{className:"text-sm text-muted-secondary",children:[d,"/",u," models"]}),e[25]=d,e[26]=u,e[27]=m):m=e[27];let y;e[28]!==f||e[29]!==m?(y=(0,n.jsxs)("div",{className:"flex items-center justify-between w-full",children:[f,m]}),e[28]=f,e[29]=m,e[30]=y):y=e[30];let P;e[31]===Symbol.for("react.memo_cache_sentinel")?(P=(0,n.jsx)(pr,{slot:"chevron",children:(0,n.jsx)(sr,{className:"h-4 w-4 text-muted-foreground shrink-0 transition-transform duration-200 group-data-expanded:rotate-90"})}),e[31]=P):P=e[31];let A;e[32]!==y||e[33]!==_||e[34]!==S?(A=(0,n.jsx)(Hs,{children:(0,n.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:[_,S,y,P]})}),e[32]=y,e[33]=_,e[34]=S,e[35]=A):A=e[35];let B;if(e[36]!==s||e[37]!==l||e[38]!==c||e[39]!==a||e[40]!==i){let w;e[42]!==s||e[43]!==c||e[44]!==a||e[45]!==i?(w=K=>{let k=new Ke(i,K.model).id;return(0,n.jsx)(Vu,{qualifiedId:k,model:K,isEnabled:s.has(k),onToggle:a,onDelete:c},k)},e[42]=s,e[43]=c,e[44]=a,e[45]=i,e[46]=w):w=e[46],B=l.map(w),e[36]=s,e[37]=l,e[38]=c,e[39]=a,e[40]=i,e[41]=B}else B=e[41];let M;return e[47]!==i||e[48]!==A||e[49]!==B?(M=(0,n.jsxs)(Ws,{id:i,hasChildItems:!0,textValue:i,className:"outline-hidden data-focused:bg-muted/50 group",children:[A,B]}),e[47]=i,e[48]=A,e[49]=B,e[50]=M):M=e[50],M};const qu=({form:t,onSubmit:e})=>{let i=bt({control:t.control,name:"ai.models.custom_models"}),l=bt({control:t.control,name:"ai.custom_providers"}),s=(0,h.useMemo)(()=>Object.keys(l||{}),[l]),a=(0,h.useMemo)(()=>St.create({displayedModels:[],customModels:i}),[i]),o=bt({control:t.control,name:"ai.models.displayed_models",defaultValue:[]}),c=new Set(o),r=a.getGroupedModelsByProvider(),d=a.getListModelsByProvider(),u=Dt(x=>{let v=c.has(x)?o.filter(j=>j!==x):[...o,x];t.setValue("ai.models.displayed_models",v,{shouldDirty:!0,shouldTouch:!0}),e(t.getValues())}),p=Dt(async(x,v)=>{let j=r.get(x)||[],C=new Set(j.map(b=>new Ke(x,b.model).id)),I=v?[...new Set([...o,...C])]:o.filter(b=>!C.has(b));t.setValue("ai.models.displayed_models",I,{shouldDirty:!0,shouldTouch:!0}),e(t.getValues())}),g=Dt(x=>{let v=i.filter(C=>C!==x),j=o.filter(C=>C!==x);t.setValue("ai.models.displayed_models",j,{shouldDirty:!0,shouldTouch:!0}),t.setValue("ai.models.custom_models",v,{shouldDirty:!0,shouldTouch:!0}),e(t.getValues())});return(0,n.jsxs)(ht,{className:"gap-2",children:[(0,n.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."}),(0,n.jsx)("div",{className:"bg-background",children:(0,n.jsx)(ud,{"aria-label":"AI Models by Provider",className:"flex-1 overflow-auto outline-hidden focus-visible:outline-hidden",selectionMode:"none",children:d.map(([x,v])=>(0,n.jsx)(Uu,{providerId:x,models:v,enabledModels:c,onToggleModel:u,onToggleProvider:p,onDeleteModel:g},x))})}),(0,n.jsx)(Wu,{form:t,customModels:i,customProviderNames:s,onSubmit:e})]})},Wu=t=>{let e=(0,ve.c)(77),{form:i,customModels:l,customProviderNames:s,onSubmit:a}=t,[o,c]=(0,h.useState)(!1),[r,d]=(0,h.useState)(!1),[u,p]=(0,h.useState)(null),[g,x]=(0,h.useState)(""),[v,j]=(0,h.useState)(""),C=(0,h.useId)(),I=(0,h.useId)(),b=(0,h.useId)(),_=u==="custom",S=_?g:u,f;e[0]!==v||e[1]!==S?(f=(S==null?void 0:S.trim())&&(v==null?void 0:v.trim()),e[0]=v,e[1]=S,e[2]=f):f=e[2];let m=f,y;e[3]===Symbol.for("react.memo_cache_sentinel")?(y=()=>{p(null),x(""),j(""),c(!1)},e[3]=y):y=e[3];let P=y,A;e[4]!==l||e[5]!==i||e[6]!==m||e[7]!==v||e[8]!==a||e[9]!==S?(A=()=>{if(!m)return;let ae=new Ke(S,v);i.setValue("ai.models.custom_models",[ae.id,...l],{shouldDirty:!0,shouldTouch:!0}),a(i.getValues()),P(),d(!0),setTimeout(()=>d(!1),2e3)},e[4]=l,e[5]=i,e[6]=m,e[7]=v,e[8]=a,e[9]=S,e[10]=A):A=e[10];let B=A,M;e[11]===C?M=e[12]:(M=(0,n.jsx)(Le,{htmlFor:C,className:"text-sm font-medium text-muted-foreground min-w-12",children:"Provider"}),e[11]=C,e[12]=M);let w=u||"",K;e[13]===Symbol.for("react.memo_cache_sentinel")?(K=ae=>p(ae),e[13]=K):K=e[13];let k;e[14]===u?k=e[15]:(k=u?(0,n.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,n.jsx)(Ee,{provider:u,className:"h-3.5 w-3.5"}),(0,n.jsx)("span",{children:li(u)})]}):(0,n.jsx)("span",{className:"text-muted-foreground",children:"Select..."}),e[14]=u,e[15]=k);let D;e[16]!==C||e[17]!==k?(D=(0,n.jsx)(Eo,{id:C,className:"w-40 truncate",children:k}),e[16]=C,e[17]=k,e[18]=D):D=e[18];let T;e[19]===s?T=e[20]:(T=s.length>0&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("p",{className:"px-2 py-1 text-xs text-muted-secondary font-medium",children:"Custom Providers"}),s.map(n0),(0,n.jsx)("p",{className:"px-2 py-1 text-xs text-muted-secondary font-medium mt-1",children:"Built-in Providers"})]}),e[19]=s,e[20]=T);let F;e[21]===s?F=e[22]:(F=Yt.filter(ae=>ae!=="marimo"&&!s.includes(ae)).map(l0),e[21]=s,e[22]=F);let U;e[23]===Symbol.for("react.memo_cache_sentinel")?(U=(0,n.jsx)("p",{className:"px-2 py-1 text-xs text-muted-secondary font-medium mt-1",children:"Other"}),e[23]=U):U=e[23];let W;e[24]===Symbol.for("react.memo_cache_sentinel")?(W=(0,n.jsx)(ci,{value:"custom",children:(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(Ee,{provider:"openai-compatible",className:"h-4 w-4"}),(0,n.jsx)("span",{children:"Enter provider name"})]})}),e[24]=W):W=e[24];let N;e[25]!==F||e[26]!==T?(N=(0,n.jsx)(Ao,{children:(0,n.jsxs)(Po,{children:[T,F,U,W]})}),e[25]=F,e[26]=T,e[27]=N):N=e[27];let q;e[28]!==N||e[29]!==w||e[30]!==D?(q=(0,n.jsxs)(To,{value:w,onValueChange:K,children:[D,N]}),e[28]=N,e[29]=w,e[30]=D,e[31]=q):q=e[31];let ie;e[32]!==q||e[33]!==M?(ie=(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[M,q]}),e[32]=q,e[33]=M,e[34]=ie):ie=e[34];let ce;e[35]!==I||e[36]!==g||e[37]!==_?(ce=_&&(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(Le,{htmlFor:I,className:"text-sm font-medium text-muted-foreground min-w-12",children:"Name"}),(0,n.jsx)(ze,{id:I,value:g,onChange:ae=>x(ae.target.value),placeholder:"openrouter",className:"w-40 truncate"})]}),e[35]=I,e[36]=g,e[37]=_,e[38]=ce):ce=e[38];let de;e[39]!==ie||e[40]!==ce?(de=(0,n.jsxs)("div",{className:"flex flex-col gap-2",children:[ie,ce]}),e[39]=ie,e[40]=ce,e[41]=de):de=e[41];let fe=de,he=_&&"self-start",xe;e[42]===he?xe=e[43]:(xe=Pe("flex items-center gap-2",he),e[42]=he,e[43]=xe);let E;e[44]===b?E=e[45]:(E=(0,n.jsx)(Le,{htmlFor:b,className:"text-sm font-medium text-muted-foreground",children:"Model"}),e[44]=b,e[45]=E);let X;e[46]===Symbol.for("react.memo_cache_sentinel")?(X=ae=>j(ae.target.value),e[46]=X):X=e[46];let Y;e[47]!==v||e[48]!==b?(Y=(0,n.jsx)(ze,{id:b,value:v,onChange:X,placeholder:"gpt-4",className:"text-xs mb-0"}),e[47]=v,e[48]=b,e[49]=Y):Y=e[49];let Q;e[50]!==xe||e[51]!==E||e[52]!==Y?(Q=(0,n.jsxs)("div",{className:xe,children:[E,Y]}),e[50]=xe,e[51]=E,e[52]=Y,e[53]=Q):Q=e[53];let J=Q,ne=_&&"self-end",le;e[54]===ne?le=e[55]:(le=Pe("flex gap-1.5 ml-auto",ne),e[54]=ne,e[55]=le);let ye=!m,ue;e[56]!==B||e[57]!==ye?(ue=(0,n.jsx)(se,{onClick:B,disabled:ye,size:"xs",children:"Add"}),e[56]=B,e[57]=ye,e[58]=ue):ue=e[58];let je;e[59]===Symbol.for("react.memo_cache_sentinel")?(je=(0,n.jsx)(se,{variant:"outline",onClick:P,size:"xs",children:"Cancel"}),e[59]=je):je=e[59];let _e;e[60]!==le||e[61]!==ue?(_e=(0,n.jsxs)("div",{className:le,children:[ue,je]}),e[60]=le,e[61]=ue,e[62]=_e):_e=e[62];let ge;e[63]!==J||e[64]!==fe||e[65]!==_e?(ge=(0,n.jsxs)("div",{className:"flex items-center gap-3 p-3 border border-border rounded-md",children:[fe,J,_e]}),e[63]=J,e[64]=fe,e[65]=_e,e[66]=ge):ge=e[66];let be=o&&ge,me;e[67]===o?me=e[68]:(me=(0,n.jsx)(Ka,{isFormOpen:o,setIsFormOpen:c,label:"Add Model",className:"pl-2"}),e[67]=o,e[68]=me);let De;e[69]===r?De=e[70]:(De=r&&(0,n.jsx)("div",{className:"flex items-center gap-1 text-green-700 bg-green-500/10 px-2 py-1 rounded-md ml-auto",children:"\u2713 Model added"}),e[69]=r,e[70]=De);let ke;e[71]!==me||e[72]!==De?(ke=(0,n.jsxs)("div",{className:"flex flex-row text-sm",children:[me,De]}),e[71]=me,e[72]=De,e[73]=ke):ke=e[73];let Se;return e[74]!==be||e[75]!==ke?(Se=(0,n.jsxs)("div",{children:[be,ke]}),e[74]=be,e[75]=ke,e[76]=Se):Se=e[76],Se};var Ka=t=>{let e=(0,ve.c)(10),{isFormOpen:i,setIsFormOpen:l,label:s,className:a}=t,o;e[0]===l?o=e[1]:(o=u=>{u.stopPropagation(),u.preventDefault(),l(!0)},e[0]=l,e[1]=o);let c;e[2]===a?c=e[3]:(c=Pe("px-0",a),e[2]=a,e[3]=c);let r;e[4]===Symbol.for("react.memo_cache_sentinel")?(r=(0,n.jsx)(rr,{className:"h-4 w-4 mr-2 mb-0.5"}),e[4]=r):r=e[4];let d;return e[5]!==i||e[6]!==s||e[7]!==o||e[8]!==c?(d=(0,n.jsxs)(se,{onClick:o,variant:"link",disabled:i,className:c,children:[r,s]}),e[5]=i,e[6]=s,e[7]=o,e[8]=c,e[9]=d):d=e[9],d},Qu=t=>{let e=(0,ve.c)(2),{form:i}=t,l;return e[0]===i.control?l=e[1]:(l=(0,n.jsx)(ht,{children:(0,n.jsx)($,{control:i.control,name:"ai.enabled",render:s0})}),e[0]=i.control,e[1]=l),l};const Yu=t=>{let e=(0,ve.c)(38),{form:i,config:l,onSubmit:s}=t,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=ct(),e[0]=a):a=e[0];let o=a,[c,r]=rt(Ta),d=Mt(),u;e[1]===i.control?u=e[2]:(u={control:i.control,name:"ai.enabled"},e[1]=i.control,e[2]=u);let p=bt(u),g;e[3]!==d||e[4]!==p?(g=d("ai.enabled",p),e[3]=d,e[4]=p,e[5]=g):g=e[5];let{value:x}=g,v=x===!1&&c!=="ai-features"?"ai-features":c,j;e[6]===r?j=e[7]:(j=A=>r(A),e[6]=r,e[7]=j);let C;e[8]===Symbol.for("react.memo_cache_sentinel")?(C=(0,n.jsx)(xt,{value:"ai-features",children:"AI Features"}),e[8]=C):C=e[8];let I;e[9]===x?I=e[10]:(I=x!==!1&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(xt,{value:"ai-providers",children:"AI Providers"}),(0,n.jsx)(xt,{value:"ai-models",children:"AI Models"}),!o&&(0,n.jsx)(xt,{value:"mcp",children:"MCP"})]}),e[9]=x,e[10]=I);let b;e[11]===I?b=e[12]:(b=(0,n.jsxs)(rn,{className:"mb-2",children:[C,I]}),e[11]=I,e[12]=b);let _,S;e[13]!==l||e[14]!==i||e[15]!==s?(_=(0,n.jsx)($u,{form:i,config:l,onSubmit:s}),S=(0,n.jsx)(Qu,{form:i,config:l,onSubmit:s}),e[13]=l,e[14]=i,e[15]=s,e[16]=_,e[17]=S):(_=e[16],S=e[17]);let f;e[18]!==x||e[19]!==l||e[20]!==i||e[21]!==s?(f=x!==!1&&(0,n.jsx)(Hu,{form:i,config:l,onSubmit:s}),e[18]=x,e[19]=l,e[20]=i,e[21]=s,e[22]=f):f=e[22];let m;e[23]!==f||e[24]!==_||e[25]!==S?(m=(0,n.jsxs)(Tt,{value:"ai-features",children:[_,S,f]}),e[23]=f,e[24]=_,e[25]=S,e[26]=m):m=e[26];let y;e[27]!==x||e[28]!==l||e[29]!==i||e[30]!==s?(y=x!==!1&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Tt,{value:"ai-providers",children:(0,n.jsx)(Gu,{form:i,config:l,onSubmit:s})}),(0,n.jsx)(Tt,{value:"ai-models",children:(0,n.jsx)(qu,{form:i,config:l,onSubmit:s})}),!o&&(0,n.jsx)(Tt,{value:"mcp",children:(0,n.jsx)(Tu,{form:i,onSubmit:s})})]}),e[27]=x,e[28]=l,e[29]=i,e[30]=s,e[31]=y):y=e[31];let P;return e[32]!==v||e[33]!==m||e[34]!==y||e[35]!==j||e[36]!==b?(P=(0,n.jsxs)(on,{value:v,onValueChange:j,className:"flex-1",children:[b,m,y]}),e[32]=v,e[33]=m,e[34]=y,e[35]=j,e[36]=b,e[37]=P):P=e[37],P};function Zu(t){return(0,n.jsx)("option",{value:t,children:t},t)}function Xu(t){return(0,n.jsx)("option",{value:t,children:t},t)}function Ju(t){let{field:e,override:i}=t;return(0,n.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{children:"AWS Region"}),(0,n.jsx)(V,{children:(0,n.jsx)(Me,{"data-testid":"bedrock-region-select",onChange:l=>e.onChange(l.target.value),value:typeof i.value=="string"?i.value:"us-east-1",disabled:e.disabled||i.isOverridden,className:"inline-flex mr-2",children:Cu.map(Xu)})}),(0,n.jsx)(G,{}),(0,n.jsx)(L,{override:i})]}),(0,n.jsx)(H,{children:"The AWS region where Bedrock service is available."})]})}function e0(t){let{field:e,override:i}=t;return(0,n.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{children:"AWS Profile Name (Optional)"}),(0,n.jsx)(V,{children:(0,n.jsx)(ze,{"data-testid":"bedrock-profile-input",rootClassName:"flex-1",className:"m-0 inline-flex h-7",placeholder:"default",...e,value:i.value||"",disabled:e.disabled||i.isOverridden})}),(0,n.jsx)(G,{}),(0,n.jsx)(L,{override:i})]}),(0,n.jsx)(H,{children:"The AWS profile name from your ~/.aws/credentials file. Leave blank to use your default AWS credentials."})]})}function t0(t){let{field:e}=t;return(0,n.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{className:"font-normal",children:"AI Edit Tooltip"}),(0,n.jsx)(V,{children:(0,n.jsx)(ee,{"data-testid":"inline-ai-checkbox",checked:e.value===!0,onCheckedChange:e.onChange})})]}),(0,n.jsx)(H,{children:'Enable "Edit with AI" tooltip when selecting code.'})]})}function i0(t){let{field:e,override:i}=t;return(0,n.jsxs)("div",{className:"flex flex-col",children:[(0,n.jsxs)(O,{children:[(0,n.jsx)(z,{children:"Custom Rules"}),(0,n.jsx)(V,{children:(0,n.jsx)(Xr,{"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",...e,value:i.value,disabled:i.isOverridden})}),(0,n.jsx)(G,{}),(0,n.jsx)(L,{override:i})]}),(0,n.jsx)(H,{children:"Custom rules to include in all AI completion prompts."})]})}function n0(t){return(0,n.jsx)(ci,{value:t,children:(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(Ee,{provider:t,className:"h-4 w-4"}),(0,n.jsx)("span",{children:di.startCase(t)})]})},t)}function l0(t){return(0,n.jsx)(ci,{value:t,children:(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(Ee,{provider:t,className:"h-4 w-4"}),(0,n.jsx)("span",{children:li(t)})]})},t)}function s0(t){let{field:e,override:i}=t;return(0,n.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{className:"font-normal",children:"Enable AI features"}),(0,n.jsx)(V,{children:(0,n.jsx)(ee,{"data-testid":"ai-enabled-checkbox",checked:i.value!==!1,disabled:i.isOverridden,onCheckedChange:l=>e.onChange(l===!0)})}),(0,n.jsx)(L,{override:i})]}),(0,n.jsx)(H,{children:"When disabled, AI actions and panels are hidden from the marimo UI."})]})}var a0=Ce(),o0=["auto","true","false"];const r0=t=>{let e=(0,a0.c)(34),{form:i,onSubmit:l}=t,s;e[0]===i.control?s=e[1]:(s=(S,f)=>(0,n.jsx)($,{control:i.control,name:S,render:m=>{let{field:y,override:P}=m,A=B=>{let M=B.target.value;y.onChange(M==="true"?!0:M==="false"?!1:M)};return(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{className:"text-sm font-normal w-16",children:f}),(0,n.jsx)(V,{children:(0,n.jsx)(Me,{"data-testid":"auto-discover-schemas-select",onChange:A,value:P.value===void 0?"auto":P.value.toString(),disabled:y.disabled||P.isOverridden,className:"w-[100px]",children:o0.map(c0)})}),(0,n.jsx)(L,{override:P})]})}}),e[0]=i.control,e[1]=s);let a=s,o;e[2]===i.control?o=e[3]:(o=(0,n.jsx)($,{control:i.control,name:"display.dataframes",render:u0}),e[2]=i.control,e[3]=o);let c;e[4]!==i||e[5]!==l?(c=S=>{let{field:f,override:m}=S;return(0,n.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{children:"Default table page size"}),(0,n.jsx)(V,{children:(0,n.jsx)(yt,{"aria-label":"Default table page size","data-testid":"default-table-page-size-input",className:"m-0 w-24",...f,value:m.value,isDisabled:m.isOverridden,minValue:1,step:1,onChange:y=>{f.onChange(y),Number.isNaN(y)||l(i.getValues())}})}),(0,n.jsx)(G,{}),(0,n.jsx)(L,{override:m})]}),(0,n.jsx)(H,{children:"The default number of rows displayed in dataframes and SQL results."})]})},e[4]=i,e[5]=l,e[6]=c):c=e[6];let r;e[7]!==i.control||e[8]!==c?(r=(0,n.jsx)($,{control:i.control,name:"display.default_table_page_size",render:c}),e[7]=i.control,e[8]=c,e[9]=r):r=e[9];let d;e[10]!==i||e[11]!==l?(d=S=>{let{field:f,override:m}=S;return(0,n.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{children:"Default table max columns"}),(0,n.jsx)(V,{children:(0,n.jsx)(yt,{"aria-label":"Default table max columns","data-testid":"default-table-max-columns-input",className:"m-0 w-24",...f,value:m.value,isDisabled:m.isOverridden,minValue:1,step:1,onChange:y=>{f.onChange(y),Number.isNaN(y)||l(i.getValues())}})}),(0,n.jsx)(G,{}),(0,n.jsx)(L,{override:m})]}),(0,n.jsx)(H,{children:"The default maximum number of columns displayed in dataframes and SQL results."})]})},e[10]=i,e[11]=l,e[12]=d):d=e[12];let u;e[13]!==i.control||e[14]!==d?(u=(0,n.jsx)($,{control:i.control,name:"display.default_table_max_columns",render:d}),e[13]=i.control,e[14]=d,e[15]=u):u=e[15];let p;e[16]===Symbol.for("react.memo_cache_sentinel")?(p=(0,n.jsx)("div",{className:"text-sm text-foreground",children:"Database Schema Discovery"}),e[16]=p):p=e[16];let g,x;e[17]===Symbol.for("react.memo_cache_sentinel")?(g=(0,n.jsx)("br",{}),x=(0,n.jsx)("span",{className:"font-semibold",children:"Can be expensive for large databases."}),e[17]=g,e[18]=x):(g=e[17],x=e[18]);let v;e[19]===Symbol.for("react.memo_cache_sentinel")?(v=(0,n.jsxs)("div",{className:"text-sm text-muted-foreground mb-2",children:["Whether database schemas, tables, and columns are automatically discovered.",g,x," ","Use 'auto' to determine introspection based on the"," ",(0,n.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"}),"."]}),e[19]=v):v=e[19];let j;e[20]===a?j=e[21]:(j=(0,n.jsxs)("div",{className:"flex flex-col gap-1",children:[p,v,a("datasources.auto_discover_schemas","Schemas"),a("datasources.auto_discover_tables","Tables"),a("datasources.auto_discover_columns","Columns")]}),e[20]=a,e[21]=j);let C,I;e[22]===i.control?(C=e[23],I=e[24]):(C=(0,n.jsx)($,{control:i.control,name:"diagnostics.sql_linter",render:m0}),I=(0,n.jsx)($,{control:i.control,name:"runtime.default_sql_output",render:h0}),e[22]=i.control,e[23]=C,e[24]=I);let b;e[25]!==j||e[26]!==C||e[27]!==I?(b=(0,n.jsxs)(Te,{title:"SQL",children:[j,C,I]}),e[25]=j,e[26]=C,e[27]=I,e[28]=b):b=e[28];let _;return e[29]!==b||e[30]!==o||e[31]!==r||e[32]!==u?(_=(0,n.jsxs)(n.Fragment,{children:[o,r,u,b]}),e[29]=b,e[30]=o,e[31]=r,e[32]=u,e[33]=_):_=e[33],_};function c0(t){return(0,n.jsx)("option",{value:t,children:t},t)}function d0(t){return(0,n.jsx)("option",{value:t,children:t},t)}function u0(t){let{field:e,override:i}=t;return(0,n.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{children:"Dataframe viewer"}),(0,n.jsx)(V,{children:(0,n.jsx)(Me,{"data-testid":"display-dataframes-select",onChange:l=>e.onChange(l.target.value),value:i.value,disabled:e.disabled||i.isOverridden,className:"inline-flex mr-2",children:["rich","plain"].map(d0)})}),(0,n.jsx)(G,{}),(0,n.jsx)(L,{override:i})]}),(0,n.jsx)(H,{children:"Whether to use marimo's rich dataframe viewer or a plain HTML table. This requires restarting your notebook to take effect."})]})}function m0(t){let{field:e,override:i}=t;return(0,n.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{children:"SQL Linter"}),(0,n.jsx)(V,{children:(0,n.jsx)(ee,{"data-testid":"sql-linter-checkbox",checked:i.value,disabled:i.isOverridden,onCheckedChange:e.onChange})}),(0,n.jsx)(G,{}),(0,n.jsx)(L,{override:i})]}),(0,n.jsx)(H,{children:"Better linting and autocompletions for SQL cells."})]})}function p0(t){return(0,n.jsx)("option",{value:t.value,children:t.label},t.value)}function h0(t){let{field:e,override:i}=t;return(0,n.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{children:"Default SQL output"}),(0,n.jsx)(V,{children:(0,n.jsx)(Me,{"data-testid":"user-config-sql-output-select",onChange:l=>e.onChange(l.target.value),value:i.value,disabled:e.disabled||i.isOverridden,className:"inline-flex mr-2",children:Ca.map(p0)})}),(0,n.jsx)(G,{}),(0,n.jsx)(L,{override:i})]}),(0,n.jsx)(H,{children:'The default SQL output type for new notebooks; overridden by "sql_output" in the application config.'})]})}function Vi(t,e){let i={};for(let l of Object.keys(e)){let s=e[l],a=t[l];if(a!==void 0){if(s===!0)i[l]=a;else if(typeof s=="object"&&s){let o=Vi(a,s);Object.keys(o).length>0&&(i[l]=o)}}}return i}var Da=(t,e)=>{var i,l,s,a,o;e.ai={...e.ai,models:{...(i=e.ai)==null?void 0:i.models,displayed_models:((s=(l=t.ai)==null?void 0:l.models)==null?void 0:s.displayed_models)??[],custom_models:((o=(a=t.ai)==null?void 0:a.models)==null?void 0:o.custom_models)??[]}}},g0=[["ai.models.displayed_models",Da],["ai.models.custom_models",Da]],f0=new Map(g0),x0=(t,e)=>{if(!t)return!1;let i=t;for(let l of e.split(".")){if(typeof i!="object"||!i)return!1;i=i[l]}return i===!0};const y0=t=>{let{values:e,dirtyValues:i,touchedFields:l}=t;for(let[s,a]of f0)x0(l,s)&&a(e,i)};var v0=Ce(),Aa=[{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:[ct()?{name:"black"}:{name:"ruff"}],additionalPackageInstalls:[],description:"Formatting"},{id:"ai",packagesRequired:[{name:"openai"}],additionalPackageInstalls:[],description:"AI features"},{id:"mcp",packagesRequired:[{name:"mcp",minVersion:"1"}],additionalPackageInstalls:[{name:"pydantic",minVersion:"2"}],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"}];ct()||Aa.push({id:"lsp",packagesRequired:[{name:"python-lsp-server"},{name:"websockets"}],additionalPackageInstalls:[{name:"python-lsp-ruff"}],description:"Language Server Protocol*"});const b0=()=>{let t=(0,v0.c)(21),[e]=tn(),i=e.package_management.manager,{getPackageList:l}=Ft(),s;t[0]===l?s=t[1]:(s=()=>l(),t[0]=l,t[1]=s);let a;t[2]===i?a=t[3]:(a=[i],t[2]=i,t[3]=a);let{data:o,error:c,refetch:r,isPending:d}=Fn(s,a);if(d){let _;return t[4]===Symbol.for("react.memo_cache_sentinel")?(_=(0,n.jsx)(bn,{size:"medium",centered:!0}),t[4]=_):_=t[4],_}if(c){let _;return t[5]===c?_=t[6]:(_=(0,n.jsx)(Wr,{error:c}),t[5]=c,t[6]=_),_}let u;if(t[7]!==(o==null?void 0:o.packages)){let _=(o==null?void 0:o.packages)||[];u=new Set(_.map(j0)),t[7]=o==null?void 0:o.packages,t[8]=u}else u=t[8];let p=u,g;t[9]===Symbol.for("react.memo_cache_sentinel")?(g=(0,n.jsx)(pt,{children:"Optional Features"}),t[9]=g):g=t[9];let x;t[10]===Symbol.for("react.memo_cache_sentinel")?(x=(0,n.jsxs)("p",{className:"text-sm text-muted-foreground",children:["marimo is lightweight, with few dependencies, to maximize compatibility with your own environments.",(0,n.jsx)("br",{}),"To unlock additional features in the marimo editor, you can install these optional dependencies:"]}),t[10]=x):x=t[10];let v;t[11]===Symbol.for("react.memo_cache_sentinel")?(v=(0,n.jsx)(Qr,{children:(0,n.jsxs)(zn,{children:[(0,n.jsx)(Ut,{children:"Dependency"}),(0,n.jsx)(Ut,{children:"Feature"}),(0,n.jsx)(Ut,{children:"Status"}),(0,n.jsx)(Ut,{})]})}),t[11]=v):v=t[11];let j;t[12]!==p||t[13]!==i||t[14]!==r?(j=Aa.map(_=>{let S=_.packagesRequired.every(m=>p.has(m.name.split("[")[0])),f=_.packagesRequired.map(w0).join(", ");return(0,n.jsxs)(zn,{className:"text-sm",children:[(0,n.jsx)(vi,{children:_.description}),(0,n.jsx)(vi,{className:"font-mono text-xs",children:f}),(0,n.jsx)(vi,{children:S?(0,n.jsxs)("div",{className:"flex items-center",children:[(0,n.jsx)(On,{className:"h-4 w-4 text-(--grass-10) mr-2"}),(0,n.jsx)("span",{children:"Installed"})]}):(0,n.jsxs)("div",{className:"flex items-center",children:[(0,n.jsx)(Za,{className:"h-4 w-4 text-(--red-10) mr-2"}),(0,n.jsx)(k0,{packageSpecs:[..._.packagesRequired,..._.additionalPackageInstalls],packageManager:i,onSuccess:r})]})})]},_.id)}),t[12]=p,t[13]=i,t[14]=r,t[15]=j):j=t[15];let C;t[16]===j?C=t[17]:(C=(0,n.jsxs)(Zr,{children:[v,(0,n.jsx)(Yr,{children:j})]}),t[16]=j,t[17]=C);let I;t[18]===Symbol.for("react.memo_cache_sentinel")?(I=(0,n.jsx)("p",{className:"text-muted-foreground mt-2",children:"*Requires server restart"}),t[18]=I):I=t[18];let b;return t[19]===C?b=t[20]:(b=(0,n.jsxs)("div",{className:"flex-1 flex flex-col overflow-hidden gap-2",children:[g,x,C,I]}),t[19]=C,t[20]=b),b};var k0=({packageSpecs:t,packageManager:e,onSuccess:i})=>{let[l,s]=h.useState(!1),{addPackage:a}=Ft();return(0,n.jsxs)(se,{size:"xs",variant:"outline",className:Pe("text-xs",l&&"opacity-50 cursor-not-allowed"),onClick:async()=>{try{s(!0);let o=await a({package:t.map(c=>c.minVersion?`${c.name}>=${c.minVersion}`:c.name).join(" "),group:"dev"});o.success?(i(),Oe({title:"Package installed",description:(0,n.jsxs)("span",{children:["The packages"," ",(0,n.jsx)(pe,{className:"inline",children:t.map(c=>c.name).join(", ")})," ","have been added to your environment."]})})):Oe({title:"Failed to install package",description:o.error,variant:"danger"})}finally{s(!1)}},disabled:l,children:[l?(0,n.jsx)(bn,{size:"small",className:"mr-2 h-3 w-3"}):(0,n.jsx)(to,{className:"mr-2 h-3 w-3"}),"Install with ",e]})};function j0(t){return t.name}function w0(t){return t.name}var Pa=[{id:"editor",label:"Editor",Icon:_n,className:"bg-(--blue-4)"},{id:"display",label:"Display",Icon:dc,className:"bg-(--grass-4)"},{id:"packageManagementAndData",label:"Packages & Data",Icon:lo,className:"bg-(--red-4)"},{id:"runtime",label:"Runtime",Icon:Vn,className:"bg-(--amber-4)"},{id:"ai",label:"AI",Icon:ki,className:"bg-[linear-gradient(45deg,var(--purple-5),var(--cyan-5))]"},{id:"optionalDeps",label:"Optional Dependencies",Icon:Rn,className:"bg-(--orange-4)"},{id:"labs",label:"Labs",Icon:cc,className:"bg-(--slate-4)"}];const Ea=it(Pa[0].id);var C0=100,Ri="__system__";const _0=()=>{let[t,e]=nn(),[i,l]=rt(Zs),s=(0,h.useRef)(null),a=Kt(Fi),[o,c]=rt(Ea),r=nt(Ga);nt(vo).mode==="home"&&(r={terminal:!0,pylsp:!0,ty:!0,basedpyright:!0,pyrefly:!0});let d=nt(ko),{locale:u}=Ht(),{saveUserConfig:p}=Ft(),g=br({resolver:jr(go),defaultValues:t}),x=(f,m)=>{let{chatModel:y,editModel:P}=Ld(f);return(y||P)&&(m={...m,models:{...m==null?void 0:m.models,...y&&{chat_model:y},...P&&{edit_model:P}}},y&&g.setValue("ai.models.chat_model",y),P&&g.setValue("ai.models.edit_model",P)),m},v=Br(async f=>{let m=Vi(f,g.formState.dirtyFields);y0({values:f,dirtyValues:m,touchedFields:g.formState.touchedFields}),Object.keys(m).length!==0&&(m.ai&&(m.ai=x(f.ai,m.ai)),await p({config:m}),e(y=>ao({},y,m)))},C0),j=ct(),C=Mt(),I=(0,h.useId)(),b=(0,h.useId)(),_=()=>{switch(o){case"editor":return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(Te,{title:"Autosave",children:[(0,n.jsx)($,{control:g.control,name:"save.autosave",render:({field:f,override:m})=>(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{className:"font-normal",children:"Autosave enabled"}),(0,n.jsx)(V,{children:(0,n.jsx)(ee,{"data-testid":"autosave-checkbox",checked:m.value==="after_delay",disabled:f.disabled||m.isOverridden,onCheckedChange:y=>{f.onChange(y?"after_delay":"off")}})}),(0,n.jsx)(G,{}),(0,n.jsx)(L,{override:m})]})}),(0,n.jsx)($,{control:g.control,name:"save.autosave_delay",render:({field:f,override:m})=>{let y=C("save.autosave",g.getValues("save.autosave"));return(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{children:"Autosave delay (seconds)"}),(0,n.jsx)(V,{children:(0,n.jsx)(yt,{"aria-label":"Autosave delay","data-testid":"autosave-delay-input",className:"m-0 w-24",isDisabled:y.value!=="after_delay"||m.isOverridden,...f,value:m.value/1e3,minValue:1,onChange:P=>{f.onChange(P*1e3),Number.isNaN(P)||v(g.getValues())}})}),(0,n.jsx)(G,{}),(0,n.jsx)(L,{override:m})]})}}),(0,n.jsx)($,{control:g.control,name:"runtime.default_auto_download",render:({field:f,override:m})=>(0,n.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{children:"Save cell outputs as"}),(0,n.jsx)(V,{children:(0,n.jsxs)("div",{className:"flex gap-4",children:[(0,n.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,n.jsx)(ee,{id:I,checked:Array.isArray(m.value)&&m.value.includes("html"),disabled:m.isOverridden,onCheckedChange:()=>{let y=Array.isArray(f.value)?f.value:[];f.onChange(vn(y,"html"))}}),(0,n.jsx)(z,{htmlFor:I,children:"HTML"})]}),(0,n.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,n.jsx)(ee,{id:b,checked:Array.isArray(m.value)&&m.value.includes("ipynb"),disabled:m.isOverridden,onCheckedChange:()=>{let y=Array.isArray(f.value)?f.value:[];f.onChange(vn(y,"ipynb"))}}),(0,n.jsx)(z,{htmlFor:b,children:"IPYNB"})]})]})}),(0,n.jsx)(G,{}),(0,n.jsx)(L,{override:m})]}),(0,n.jsxs)(H,{children:["When enabled, marimo will periodically save notebooks in your selected formats (HTML, IPYNB) to a folder named"," ",(0,n.jsx)(pe,{className:"inline",children:"__marimo__"})," next to your notebook file."]})]})})]}),(0,n.jsxs)(Te,{title:"Formatting",children:[(0,n.jsx)($,{control:g.control,name:"save.format_on_save",render:({field:f,override:m})=>(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{className:"font-normal",children:"Format on save"}),(0,n.jsx)(V,{children:(0,n.jsx)(ee,{"data-testid":"format-on-save-checkbox",checked:m.value,disabled:f.disabled||m.isOverridden,onCheckedChange:y=>{f.onChange(y)}})}),(0,n.jsx)(G,{}),(0,n.jsx)(L,{override:m})]})}),(0,n.jsx)($,{control:g.control,name:"formatting.line_length",render:({field:f,override:m})=>(0,n.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{children:"Line length"}),(0,n.jsx)(V,{children:(0,n.jsx)(yt,{"aria-label":"Line length","data-testid":"line-length-input",className:"m-0 w-24",...f,value:m.value,isDisabled:m.isOverridden,minValue:1,maxValue:1e3,onChange:y=>{f.onChange(y),Number.isNaN(y)||v(g.getValues())}})}),(0,n.jsx)(G,{}),(0,n.jsx)(L,{override:m})]}),(0,n.jsx)(H,{children:"Maximum line length when formatting code."})]})})]}),(0,n.jsxs)(Te,{title:"Autocomplete",children:[(0,n.jsx)($,{control:g.control,name:"completion.activate_on_typing",render:({field:f,override:m})=>(0,n.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{className:"font-normal",children:"Autocomplete"}),(0,n.jsx)(V,{children:(0,n.jsx)(ee,{"data-testid":"autocomplete-checkbox",checked:m.value,disabled:f.disabled||m.isOverridden,onCheckedChange:y=>{f.onChange(!!y)}})}),(0,n.jsx)(G,{}),(0,n.jsx)(L,{override:m})]}),(0,n.jsx)(H,{children:"When unchecked, code completion is still available through a hotkey."}),(0,n.jsx)("div",{children:(0,n.jsx)(se,{variant:"link",className:"mb-0 px-0",type:"button",onClick:y=>{y.preventDefault(),y.stopPropagation(),c("ai")},children:"Edit AI autocomplete"})})]})}),(0,n.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{className:"font-normal",children:"Accept suggestion on Enter"}),(0,n.jsx)(V,{children:(0,n.jsx)(ee,{"data-testid":"accept-completion-on-enter-checkbox",checked:i,onCheckedChange:f=>l(!!f)})})]}),(0,n.jsx)(H,{children:"When unchecked, pressing Enter inserts a new line instead of accepting an autocomplete suggestion. Use Tab to accept suggestions."})]}),(0,n.jsx)($,{control:g.control,name:"completion.signature_hint_on_typing",render:({field:f,override:m})=>(0,n.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{className:"font-normal",children:"Signature hints"}),(0,n.jsx)(V,{children:(0,n.jsx)(ee,{"data-testid":"signature-hint-on-type-checkbox",checked:m.value??!1,disabled:f.disabled||m.isOverridden,onCheckedChange:y=>{f.onChange(!!y)}})}),(0,n.jsx)(G,{}),(0,n.jsx)(L,{override:m})]}),(0,n.jsx)(H,{children:"Display signature hints while typing within function calls."})]})}),(0,n.jsx)($,{control:g.control,name:"completion.auto_close_pairs",render:({field:f,override:m})=>(0,n.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{className:"font-normal",children:"Auto-close pairs"}),(0,n.jsx)(V,{children:(0,n.jsx)(ee,{"data-testid":"auto-close-pairs-checkbox",checked:m.value??!0,disabled:f.disabled||m.isOverridden,onCheckedChange:y=>{f.onChange(!!y)}})}),(0,n.jsx)(G,{}),(0,n.jsx)(L,{override:m})]}),(0,n.jsxs)(H,{children:["Automatically insert closing brackets"," ",(0,n.jsx)("code",{className:"text-xs",children:"()"}),","," ",(0,n.jsx)("code",{className:"text-xs",children:"[]"}),","," ",(0,n.jsx)("code",{className:"text-xs",children:"{}"}),", and quotes"," ",(0,n.jsx)("code",{className:"text-xs",children:'""'}),","," ",(0,n.jsx)("code",{className:"text-xs",children:"''"})," when opening one."]})]})})]}),(0,n.jsxs)(Te,{title:"Language Servers",children:[(0,n.jsxs)(H,{children:["See the"," ",(0,n.jsx)(oe,{href:"https://docs.marimo.io/guides/editor_features/language_server/",children:"docs"})," ","for more information about language server support."]}),(0,n.jsxs)(H,{children:[(0,n.jsx)("strong",{children:"Note:"})," When using multiple language servers, different features may conflict."]}),(0,n.jsx)($,{control:g.control,name:"language_servers.pylsp.enabled",render:({field:f,override:m})=>(0,n.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsxs)(z,{children:[(0,n.jsx)(kt,{variant:"defaultOutline",className:"mr-2",children:"Beta"}),"Python Language Server (",(0,n.jsx)(oe,{href:"https://github.com/python-lsp/python-lsp-server",children:"docs"}),")"]}),(0,n.jsx)(V,{children:(0,n.jsx)(ee,{"data-testid":"pylsp-checkbox",checked:m.value,disabled:f.disabled||m.isOverridden,onCheckedChange:y=>{f.onChange(!!y)}})}),(0,n.jsx)(G,{}),(0,n.jsx)(L,{override:m})]}),m.value&&!r.pylsp&&(0,n.jsxs)(wt,{kind:"danger",children:["The Python Language Server is not available in your current environment. Please install"," ",(0,n.jsx)(pe,{className:"inline",children:"python-lsp-server"})," in your environment."]})]})}),(0,n.jsx)($,{control:g.control,name:"language_servers.basedpyright.enabled",render:({field:f,override:m})=>(0,n.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsxs)(z,{children:[(0,n.jsx)(kt,{variant:"defaultOutline",className:"mr-2",children:"Beta"}),"basedpyright (",(0,n.jsx)(oe,{href:"https://github.com/DetachHead/basedpyright",children:"docs"}),")"]}),(0,n.jsx)(V,{children:(0,n.jsx)(ee,{"data-testid":"basedpyright-checkbox",checked:m.value,disabled:f.disabled||m.isOverridden,onCheckedChange:y=>{f.onChange(!!y)}})}),(0,n.jsx)(G,{}),(0,n.jsx)(L,{override:m})]}),m.value&&!r.basedpyright&&(0,n.jsxs)(wt,{kind:"danger",children:["basedpyright is not available in your current environment. Please install"," ",(0,n.jsx)(pe,{className:"inline",children:"basedpyright"})," in your environment."]})]})}),(0,n.jsx)($,{control:g.control,name:"language_servers.pyrefly.enabled",render:({field:f,override:m})=>(0,n.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsxs)(z,{children:[(0,n.jsx)(kt,{variant:"defaultOutline",className:"mr-2",children:"Beta"}),"Pyrefly (",(0,n.jsx)(oe,{href:"https://github.com/facebook/pyrefly",children:"docs"}),")"]}),(0,n.jsx)(V,{children:(0,n.jsx)(ee,{"data-testid":"pyrefly-checkbox",checked:m.value,disabled:f.disabled||m.isOverridden,onCheckedChange:y=>{f.onChange(!!y)}})}),(0,n.jsx)(G,{}),(0,n.jsx)(L,{override:m})]}),m.value&&!r.pyrefly&&(0,n.jsxs)(wt,{kind:"danger",children:["Pyrefly is not available in your current environment. Please install ",(0,n.jsx)(pe,{className:"inline",children:"pyrefly"})," in your environment."]})]})}),(0,n.jsx)($,{control:g.control,name:"language_servers.ty.enabled",render:({field:f,override:m})=>(0,n.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsxs)(z,{children:[(0,n.jsx)(kt,{variant:"defaultOutline",className:"mr-2",children:"Beta"}),"ty (",(0,n.jsx)(oe,{href:"https://github.com/astral-sh/ty",children:"docs"}),")"]}),(0,n.jsx)(V,{children:(0,n.jsx)(ee,{"data-testid":"ty-checkbox",checked:m.value,disabled:f.disabled||m.isOverridden,onCheckedChange:y=>{f.onChange(!!y)}})}),(0,n.jsx)(G,{}),(0,n.jsx)(L,{override:m})]}),m.value&&!r.ty&&(0,n.jsxs)(wt,{kind:"danger",children:["ty is not available in your current environment. Please install ",(0,n.jsx)(pe,{className:"inline",children:"ty"})," in your environment."]})]})}),(0,n.jsx)($,{control:g.control,name:"diagnostics.enabled",render:({field:f,override:m})=>(0,n.jsxs)(O,{className:R,children:[(0,n.jsxs)(z,{children:[(0,n.jsx)(kt,{variant:"defaultOutline",className:"mr-2",children:"Beta"}),"Diagnostics"]}),(0,n.jsx)(V,{children:(0,n.jsx)(ee,{"data-testid":"diagnostics-checkbox",checked:m.value,disabled:f.disabled||m.isOverridden,onCheckedChange:y=>{f.onChange(!!y)}})}),(0,n.jsx)(G,{}),(0,n.jsx)(L,{override:m})]})})]}),(0,n.jsxs)(Te,{title:"Keymap",children:[(0,n.jsx)($,{control:g.control,name:"keymap.preset",render:({field:f,override:m})=>(0,n.jsx)("div",{className:"flex flex-col space-y-1",children:(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{children:"Keymap"}),(0,n.jsx)(V,{children:(0,n.jsx)(Me,{"data-testid":"keymap-select",onChange:y=>f.onChange(y.target.value),value:m.value,disabled:f.disabled||m.isOverridden,className:"inline-flex mr-2",children:Pd.map(y=>(0,n.jsx)("option",{value:y,children:y},y))})}),(0,n.jsx)(G,{}),(0,n.jsx)(L,{override:m})]})})}),(0,n.jsx)($,{control:g.control,name:"keymap.destructive_delete",render:({field:f,override:m})=>(0,n.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{className:"font-normal",children:"Destructive delete"}),(0,n.jsx)(V,{children:(0,n.jsx)(ee,{"data-testid":"destructive-delete-checkbox",checked:m.value,disabled:f.disabled||m.isOverridden,onCheckedChange:y=>{f.onChange(!!y)}})}),(0,n.jsx)(G,{}),(0,n.jsx)(L,{override:m})]}),(0,n.jsxs)(H,{className:"flex items-center gap-1",children:["Allow deleting non-empty cells",(0,n.jsx)(We,{content:(0,n.jsxs)("div",{className:"max-w-xs",children:[(0,n.jsx)("strong",{children:"Use with caution:"})," Deleting cells with code can lose work and computed results since variables are removed from memory."]}),children:(0,n.jsx)(gi,{className:"w-3 h-3 text-(--amber-11)"})})]}),(0,n.jsx)("div",{children:(0,n.jsx)(se,{variant:"link",className:"mb-0 px-0",type:"button",onClick:y=>{y.preventDefault(),y.stopPropagation(),a(!0)},children:"Edit Keyboard Shortcuts"})})]})})]})]});case"display":return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(Te,{title:"Display",children:[(0,n.jsx)($,{control:g.control,name:"display.default_width",render:({field:f,override:m})=>(0,n.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{children:"Default width"}),(0,n.jsx)(V,{children:(0,n.jsx)(Me,{"data-testid":"user-config-width-select",onChange:y=>f.onChange(y.target.value),value:m.value,disabled:f.disabled||m.isOverridden,className:"inline-flex mr-2",children:na().map(y=>(0,n.jsx)("option",{value:y,children:y},y))})}),(0,n.jsx)(G,{}),(0,n.jsx)(L,{override:m})]}),(0,n.jsx)(H,{children:'The default app width for new notebooks; overridden by "width" in the application config.'})]})}),(0,n.jsx)($,{control:g.control,name:"display.theme",render:({field:f,override:m})=>(0,n.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{children:"Theme"}),(0,n.jsx)(V,{children:(0,n.jsx)(Me,{"data-testid":"theme-select",onChange:y=>f.onChange(y.target.value),value:m.value,disabled:f.disabled||m.isOverridden,className:"inline-flex mr-2",children:wr.map(y=>(0,n.jsx)("option",{value:y,children:y},y))})}),(0,n.jsx)(G,{}),(0,n.jsx)(L,{override:m})]}),(0,n.jsx)(H,{children:"This theme will be applied to the user's configuration; it does not affect theme when sharing the notebook."})]})}),(0,n.jsx)($,{control:g.control,name:"display.code_editor_font_size",render:({field:f,override:m})=>(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{children:"Code editor font size (px)"}),(0,n.jsx)(V,{children:(0,n.jsx)("span",{className:"inline-flex mr-2",children:(0,n.jsx)(yt,{"aria-label":"Code editor font size","data-testid":"code-editor-font-size-input",className:"m-0 w-24",...f,value:m.value,isDisabled:m.isOverridden,minValue:8,maxValue:32,onChange:y=>{f.onChange(y),v(g.getValues())}})})}),(0,n.jsx)(G,{}),(0,n.jsx)(L,{override:m})]})}),(0,n.jsx)($,{control:g.control,name:"display.locale",render:({field:f,override:m})=>(0,n.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{children:"Locale"}),(0,n.jsx)(V,{children:(0,n.jsxs)(Me,{"data-testid":"locale-select",onChange:y=>{y.target.value===Ri?f.onChange(void 0):f.onChange(y.target.value)},value:m.value||Ri,disabled:f.disabled||m.isOverridden,className:"inline-flex mr-2",children:[(0,n.jsx)("option",{value:Ri,children:"System"}),navigator.languages.map(y=>(0,n.jsx)("option",{value:y,children:y},y))]})}),(0,n.jsx)(G,{}),(0,n.jsx)(L,{override:m})]}),(0,n.jsxs)(H,{children:["The locale to use for the notebook. If your desired locale is not listed, you can change it manually via"," ",(0,n.jsx)(pe,{className:"inline",children:"marimo config show"}),"."]})]})}),(0,n.jsx)($,{control:g.control,name:"display.reference_highlighting",render:({field:f,override:m})=>(0,n.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{children:"Reference highlighting"}),(0,n.jsx)(V,{children:(0,n.jsx)(ee,{"data-testid":"reference-highlighting-checkbox",checked:m.value,disabled:m.isOverridden,onCheckedChange:f.onChange})}),(0,n.jsx)(G,{}),(0,n.jsx)(L,{override:m})]}),(0,n.jsx)(H,{children:"Visually emphasizes variables in a cell that are defined elsewhere in the notebook."})]})})]}),(0,n.jsx)(Te,{title:"Outputs",children:(0,n.jsx)($,{control:g.control,name:"display.cell_output",render:({field:f,override:m})=>(0,n.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{children:"Cell output area"}),(0,n.jsx)(V,{children:(0,n.jsx)(Me,{"data-testid":"cell-output-select",onChange:y=>f.onChange(y.target.value),value:m.value,disabled:f.disabled||m.isOverridden,className:"inline-flex mr-2",children:["above","below"].map(y=>(0,n.jsx)("option",{value:y,children:y},y))})}),(0,n.jsx)(G,{}),(0,n.jsx)(L,{override:m})]}),(0,n.jsx)(H,{children:"Where to display cell's output."})]})})})]});case"packageManagementAndData":return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Te,{title:"Package Management",children:(0,n.jsx)($,{control:g.control,disabled:j,name:"package_management.manager",render:({field:f,override:m})=>(0,n.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{children:"Manager"}),(0,n.jsx)(V,{children:(0,n.jsx)(Me,{"data-testid":"package-manager-select",onChange:y=>f.onChange(y.target.value),value:m.value,disabled:f.disabled||m.isOverridden,className:"inline-flex mr-2",children:uo.map(y=>(0,n.jsx)("option",{value:y,children:y},y))})}),(0,n.jsx)(G,{}),(0,n.jsx)(L,{override:m})]}),(0,n.jsxs)(H,{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,n.jsx)(oe,{href:"https://docs.marimo.io/guides/editor_features/package_management.html",children:"docs"}),".",(0,n.jsx)("br",{}),(0,n.jsx)("br",{}),"Running marimo in a"," ",(0,n.jsx)(oe,{href:"https://docs.marimo.io/guides/package_management/inlining_dependencies.html",children:"sandboxed environment"})," ","is only supported by ",(0,n.jsx)(pe,{className:"inline",children:"uv"})]})]})})}),(0,n.jsx)(Te,{title:"Data",children:(0,n.jsx)(r0,{form:g,onSubmit:v})})]});case"runtime":return(0,n.jsxs)(Te,{title:"Runtime configuration",children:[(0,n.jsx)($,{control:g.control,name:"runtime.auto_instantiate",render:({field:f,override:m})=>(0,n.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{className:"font-normal",children:"Autorun on startup"}),(0,n.jsx)(V,{children:(0,n.jsx)(ee,{"data-testid":"auto-instantiate-checkbox",disabled:f.disabled||m.isOverridden,checked:m.value,onCheckedChange:f.onChange})}),(0,n.jsx)(G,{}),(0,n.jsx)(L,{override:m})]}),(0,n.jsx)(H,{children:"Whether to automatically run all cells on startup."})]})}),(0,n.jsx)($,{control:g.control,name:"runtime.on_cell_change",render:({field:f,override:m})=>(0,n.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{className:"font-normal",children:"On cell change"}),(0,n.jsx)(V,{children:(0,n.jsx)(Me,{"data-testid":"on-cell-change-select",onChange:y=>f.onChange(y.target.value),value:m.value,disabled:m.isOverridden,className:"inline-flex mr-2",children:["lazy","autorun"].map(y=>(0,n.jsx)("option",{value:y,children:y},y))})}),(0,n.jsx)(G,{}),(0,n.jsx)(L,{override:m})]}),(0,n.jsx)(H,{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.`})]})}),(0,n.jsx)($,{control:g.control,name:"runtime.auto_reload",render:({field:f,override:m})=>(0,n.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{className:"font-normal",children:"On module change"}),(0,n.jsx)(V,{children:(0,n.jsx)(Me,{"data-testid":"auto-reload-select",onChange:y=>f.onChange(y.target.value),value:m.value,disabled:j||m.isOverridden,className:"inline-flex mr-2",children:["off","lazy","autorun"].map(y=>(0,n.jsx)("option",{value:y,children:y},y))})}),(0,n.jsx)(G,{}),(0,n.jsx)(L,{override:m})]}),(0,n.jsx)(H,{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,n.jsx)($,{control:g.control,name:"runtime.reactive_tests",render:({field:f,override:m})=>(0,n.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{className:"font-normal",children:"Autorun Unit Tests"}),(0,n.jsx)(V,{children:(0,n.jsx)(ee,{"data-testid":"reactive-test-checkbox",checked:m.value,disabled:m.isOverridden,onCheckedChange:f.onChange})})]}),(0,n.jsx)(L,{override:m}),(0,n.jsx)(G,{}),(0,n.jsx)(H,{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)."})," "]})}),(0,n.jsxs)(H,{children:["Learn more in the"," ",(0,n.jsx)(oe,{href:"https://docs.marimo.io/guides/reactivity/#configuring-how-marimo-runs-cells",children:"docs"}),"."]})]});case"ai":return(0,n.jsx)(Yu,{form:g,config:t,onSubmit:v});case"optionalDeps":return(0,n.jsx)(b0,{});case"labs":return(0,n.jsxs)(Te,{title:"Experimental Features",children:[(0,n.jsx)("p",{className:"text-sm text-muted-secondary mb-4",children:"\u26A0\uFE0F These features are experimental and may require restarting your notebook to take effect."}),(0,n.jsx)(dt,{control:g.control,name:"experimental.rtc_v2",render:({field:f})=>(0,n.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{className:"font-normal",children:"Real-Time Collaboration"}),(0,n.jsx)(V,{children:(0,n.jsx)(ee,{"data-testid":"rtc-checkbox",checked:f.value===!0,onCheckedChange:f.onChange})})]}),(0,n.jsx)(H,{children:"Enable experimental real-time collaboration. This change requires a page refresh to take effect."})]})}),(0,n.jsx)($,{control:g.control,name:"experimental.external_agents",render:({field:f,override:m})=>(0,n.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{className:"font-normal",children:"External Agents"}),(0,n.jsx)(V,{children:(0,n.jsx)(ee,{"data-testid":"external-agents-checkbox",checked:m.value===!0,disabled:m.isOverridden,onCheckedChange:f.onChange})})]}),(0,n.jsx)(L,{override:m}),(0,n.jsxs)(H,{children:["Enable experimental external agents such as Claude Code and Gemini CLI. Learn more in the"," ",(0,n.jsx)(oe,{href:"https://docs.marimo.io/guides/editor_features/agents/",children:"docs"}),"."]})]})}),(0,n.jsx)($,{control:g.control,name:"experimental.debugger",render:({field:f,override:m})=>(0,n.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{className:"font-normal",children:"Debugger"}),(0,n.jsx)(V,{children:(0,n.jsx)(ee,{"data-testid":"debugger-checkbox",checked:m.value===!0,disabled:m.isOverridden,onCheckedChange:f.onChange})})]}),(0,n.jsx)(L,{override:m}),(0,n.jsxs)(H,{children:["Enable the live debugger: a clickable breakpoint gutter, current-line highlighting while a cell runs, and dropping into ",(0,n.jsx)(pe,{className:"inline",children:"pdb"})," at breakpoints. This change requires a page refresh to take effect."]})]})}),(0,n.jsx)($,{control:g.control,name:"experimental.line_timing",render:({field:f,override:m})=>(0,n.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{className:"font-normal",children:"Line Timing"}),(0,n.jsx)(V,{children:(0,n.jsx)(ee,{"data-testid":"line-timing-checkbox",checked:m.value===!0,disabled:m.isOverridden,onCheckedChange:f.onChange})})]}),(0,n.jsx)(L,{override:m}),(0,n.jsx)(H,{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."})]})})]})}},S=(0,n.jsxs)("p",{className:"text-muted-secondary",children:["User configuration is stored in ",(0,n.jsx)(pe,{className:"inline",children:"marimo.toml"}),(0,n.jsx)("br",{}),"Run ",(0,n.jsx)(pe,{className:"inline",children:"marimo config show"})," in your terminal to show your current configuration and file location."]});return(0,n.jsx)(kr,{...g,children:(0,n.jsxs)("form",{ref:s,onChange:g.handleSubmit(f=>v(f)),className:"flex text-pretty overflow-hidden",children:[(0,n.jsx)(on,{value:o,onValueChange:f=>c(f),orientation:"vertical",className:"w-1/3 border-r h-full overflow-auto p-3",children:(0,n.jsxs)(rn,{className:"self-start max-h-none flex flex-col gap-2 shrink-0 bg-background flex-1 min-h-full",children:[Pa.map(f=>(0,n.jsx)(xt,{value:f.id,className:"w-full text-left p-2 data-[state=active]:bg-primary data-[state=active]:text-primary-foreground justify-start",children:(0,n.jsxs)("div",{className:"flex gap-4 items-center text-lg overflow-hidden",children:[(0,n.jsx)("span",{className:Pe(f.className,"w-8 h-8 rounded flex items-center justify-center text-muted-foreground shrink-0"),children:(0,n.jsx)(f.Icon,{className:"w-4 h-4"})}),(0,n.jsx)("span",{className:"truncate",children:f.label})]})},f.id)),(0,n.jsxs)("div",{className:"p-2 text-xs text-muted-foreground self-start flex flex-col gap-1",children:[(0,n.jsxs)("span",{children:["Version: ",d]}),(0,n.jsxs)("span",{children:["Locale: ",u]})]}),(0,n.jsx)("div",{className:"flex-1"}),!ct()&&S]})}),(0,n.jsx)("div",{className:"w-2/3 pl-6 gap-2 flex flex-col overflow-auto p-6",children:_()})]})})};var S0=Ce();const Ta=it("ai-features"),Ba=it(!1);function $i(){let t=(0,S0.c)(4),e=Kt(Ea),i=Kt(Ba),l=Kt(Ta),s;return t[0]!==e||t[1]!==l||t[2]!==i?(s={handleClick:(a,o)=>{e(a),a==="ai"&&l(o??"ai-features"),i(!0)}},t[0]=e,t[1]=l,t[2]=i,t[3]=s):s=t[3],s}var ni=Ce();const Fa=t=>{var W,N,q,ie,ce,de,fe,he,xe,E,X,Y,Q,J,ne,le,ye,ue;let e=(0,ni.c)(62),{value:i,placeholder:l,onSelect:s,triggerClassName:a,customDropdownContent:o,iconSize:c,showAddCustomModelDocs:r,forRole:d,displayIconOnly:u,disabled:p}=t,g=c===void 0?"medium":c,x=r===void 0?!1:r,v=u===void 0?!1:u,j=p===void 0?!1:p,[C,I]=h.useState(!1),b=nt(fo),_=nt(xo),{saveModelChange:S}=No(),{handleClick:f}=$i(),m=_.copilot==="custom"?(W=b==null?void 0:b.models)==null?void 0:W.autocomplete_model:void 0,y,P,A,B,M,w,K,k,D;if(e[0]!==((N=b==null?void 0:b.models)==null?void 0:N.autocomplete_model)||e[1]!==((q=b==null?void 0:b.models)==null?void 0:q.chat_model)||e[2]!==((ie=b==null?void 0:b.models)==null?void 0:ie.custom_models)||e[3]!==((ce=b==null?void 0:b.models)==null?void 0:ce.displayed_models)||e[4]!==((de=b==null?void 0:b.models)==null?void 0:de.edit_model)||e[5]!==m||e[6]!==j||e[7]!==v||e[8]!==d||e[9]!==g||e[10]!==C||e[11]!==s||e[12]!==l||e[13]!==S||e[14]!==a||e[15]!==i){let je=St.create({customModels:[...((fe=b==null?void 0:b.models)==null?void 0:fe.custom_models)??[],(he=b==null?void 0:b.models)==null?void 0:he.chat_model,m,(xe=b==null?void 0:b.models)==null?void 0:xe.edit_model].filter(Boolean),displayedModels:(E=b==null?void 0:b.models)==null?void 0:E.displayed_models}),_e=je.getListModelsByProvider(),ge=d==="autocomplete"?(X=b==null?void 0:b.models)==null?void 0:X.autocomplete_model:d==="chat"?(Y=b==null?void 0:b.models)==null?void 0:Y.chat_model:d==="edit"?(Q=b==null?void 0:b.models)==null?void 0:Q.edit_model:void 0,be=i?Ke.parse(i):ge?Ke.parse(ge):void 0,me=g==="medium"?"h-4 w-4":"h-3 w-3",De=(we,qe)=>{let gt=je.getModel(we.id);return(0,n.jsxs)("div",{className:"flex items-center gap-2 w-full px-2 py-1",children:[(0,n.jsx)(Ee,{provider:we.providerId,className:me}),(0,n.jsxs)("div",{className:"flex flex-col",children:[(0,n.jsx)("span",{children:(gt==null?void 0:gt.name)||we.shortModelId}),(0,n.jsx)("span",{className:"text-xs text-muted-foreground",children:we.id})]}),(0,n.jsx)("div",{className:"ml-auto flex gap-1",children:(0,n.jsx)(We,{content:wa(qe),children:(0,n.jsx)("span",{className:`text-xs px-1.5 py-0.5 rounded font-medium ${Jt(qe)}`,children:qe},qe)})})]})},ke;e[25]!==j||e[26]!==d||e[27]!==s||e[28]!==S?(ke=we=>{j||(s?s(we):S(we,d),I(!1))},e[25]=j,e[26]=d,e[27]=s,e[28]=S,e[29]=ke):ke=e[29];let Se=ke;P=Vo,D=C,A=I;let ae=`flex items-center justify-between px-2 py-0.5 border rounded-md
4
+ ${Ur(e)}`)}})}};const ma="/__marimo_copilot__.py";var pa=`file://${ma}`;const ou=Xe(()=>{let t=bo();return new au({getWsUrl:()=>t.getLSPURL("copilot").toString(),waitForReady:async()=>{await tu(),await yo()},showError:(e,i)=>{Oe({variant:"danger",title:e,description:i})}})}),Nt=Xe(()=>{var l,s;let t=((s=(l=ot.get(oi).ai)==null?void 0:l.github)==null?void 0:s.copilot_settings)??{},e=ou(),i=new su({rootUri:pa,workspaceFolders:null,transport:e,copilotSettings:t});return e.onReconnect=()=>i.reInitialize(),i});function ru(){return no({documentUri:pa,client:Nt(),languageId:"copilot",hoverEnabled:!1,completionEnabled:!1,definitionEnabled:!1,renameEnabled:!1,codeActionsEnabled:!1,signatureHelpEnabled:!1,diagnosticsEnabled:!1,sendIncrementalChanges:!1})}const ha=(0,h.memo)(()=>{let[t,e]=rt(aa),[i,l]=rt(oa),[s,a]=(0,h.useState)(),[o,c]=(0,h.useState)(!1),r=async p=>{p.preventDefault(),c(!0);try{let g=await du();if(!(g!=null&&g.verificationUri)||!g.userCode){Z.error("Copilot#trySignIn: Invalid response from sign-in",{result:g}),l("connectionError"),Oe({title:"GitHub Copilot Connection Error",description:"Unable to connect to GitHub Copilot. Please check your settings and try again.",variant:"danger"});return}let{verificationUri:x,status:v,userCode:j}=g;xa(v)?e(!0):(l("signingIn"),a({url:x,code:j}))}catch(g){Z.error("Copilot#trySignIn: Error during sign-in",g),l("connectionError"),Oe({title:"GitHub Copilot Connection Error",description:g instanceof Error?g.message:"Unable to connect to GitHub Copilot. Please check your settings and try again.",variant:"danger"})}finally{c(!1)}},d=async p=>{if(p.preventDefault(),s){c(!0);try{let g=await uu(s.code);g.success?(e(!0),l("signedIn")):g.error==="connection"?(l("connectionError"),Oe({title:"GitHub Copilot Connection Error",description:"Lost connection during sign-in. Please try again.",variant:"danger",action:(0,n.jsx)(se,{onClick:r,children:"Retry"})})):l("signInFailed")}finally{c(!1)}}},u=async p=>{p.preventDefault(),await pu(),e(!1),l("signedOut")};return(()=>{switch(i??(t?"signedIn":"connecting")){case"connecting":return(0,n.jsx)(Le,{className:"font-normal flex",children:"Connecting..."});case"signedOut":return(0,n.jsx)(se,{onClick:r,size:"xs",variant:"link",children:"Sign in to GitHub Copilot"});case"signingIn":return(0,n.jsxs)("ol",{className:"ml-4 text-sm list-decimal [&>li]:mt-2",children:[(0,n.jsx)("li",{children:(0,n.jsxs)("div",{className:"flex items-center",children:["Copy this code:",(0,n.jsx)("strong",{className:"ml-2",children:s==null?void 0:s.code}),(0,n.jsx)(or,{className:"ml-2 cursor-pointer opacity-60 hover:opacity-100 h-3 w-3",onClick:async()=>{s&&(await Cr(s.code),Oe({description:"Copied to clipboard"}))}})]})}),(0,n.jsxs)("li",{children:["Enter the code at this link:",(0,n.jsx)("a",{href:s==null?void 0:s.url,target:"_blank",rel:"noreferrer",className:Ro({variant:"link",size:"xs"}),children:s==null?void 0:s.url})]}),(0,n.jsxs)("li",{children:["Click here when done:",(0,n.jsxs)(se,{size:"xs",onClick:d,className:"ml-1",children:[o&&(0,n.jsx)(zt,{className:"h-3 w-3 mr-1 animate-spin"}),"Done"]})]})]});case"signInFailed":return(0,n.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,n.jsx)("div",{className:"text-destructive text-sm",children:"Sign in failed. Please try again."}),o?(0,n.jsx)(zt,{className:"h-3 w-3 mr-1 animate-spin"}):(0,n.jsx)(se,{onClick:r,size:"xs",variant:"link",children:"Connect to GitHub Copilot"})]});case"signedIn":return(0,n.jsxs)("div",{className:"flex items-center gap-5",children:[(0,n.jsxs)(Le,{className:"font-normal flex items-center",children:[(0,n.jsx)("div",{className:"inline-flex items-center justify-center bg-(--grass-7) rounded-full p-1 mr-2",children:(0,n.jsx)(nr,{className:"h-3 w-3 text-white"})}),"Connected"]}),(0,n.jsx)(se,{onClick:u,size:"xs",variant:"text",children:"Disconnect"})]});case"connectionError":return(0,n.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,n.jsxs)(Le,{className:"font-normal flex",children:[(0,n.jsx)(ui,{className:"h-4 w-4 mr-1"}),"Connection Error"]}),(0,n.jsx)("div",{className:"text-sm",children:"Unable to connect to GitHub Copilot."}),(0,n.jsx)(se,{onClick:r,size:"xs",variant:"link",children:"Retry Connection"})]});case"notConnected":return(0,n.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,n.jsxs)(Le,{className:"font-normal flex",children:[(0,n.jsx)(ui,{className:"h-4 w-4 mr-1"}),"Unable to connect"]}),(0,n.jsxs)("div",{className:"text-sm",children:["For troubleshooting, see the"," ",(0,n.jsx)(oe,{href:"https://docs.marimo.io/getting_started/index.html#github-copilot",children:"docs"}),"."]})]})}})()});ha.displayName="CopilotConfig";var ga=5,cu=3e3;async function du(){return await Nt().signInInitiate()}async function uu(t){let e=Nt();try{Z.log("Copilot#tryFinishSignIn: Attempting to confirm sign-in");let{status:i}=await e.signInConfirm({userCode:t});return xa(i)?(Z.log("Copilot#tryFinishSignIn: Sign-in confirmed successfully"),{success:!0}):(Z.warn("Copilot#tryFinishSignIn: Sign-in confirmation returned unexpected status",{status:i}),{success:!1})}catch(i){return fa(i)?(Z.error("Copilot#tryFinishSignIn: Connection error during sign-in",i),{success:!1,error:"connection"}):await mu(e)}}async function mu(t){for(let e=0;e<ga;e++)try{if(await new Promise(i=>setTimeout(i,cu)),await t.signedIn())return Z.log("Copilot#tryFinishSignIn: Successfully signed in after retry"),{success:!0}}catch(i){if(Z.warn("Copilot#tryFinishSignIn: Retry attempt failed",{attempt:e+1,maxRetries:ga}),fa(i))return{success:!1,error:"connection"}}return Z.error("Copilot#tryFinishSignIn: All sign-in attempts failed"),{success:!1}}async function pu(){await Nt().signOut()}function fa(t){return t instanceof Error&&(t.message.includes("ECONNREFUSED")||t.message.includes("WebSocket")||t.message.includes("network"))}function xa(t){return t==="SignedIn"||t==="AlreadySignedIn"||t==="OK"}var ya="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",hu="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",gu="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",fu="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",va="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",xu="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",ba="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",ka="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",yu="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",vu="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",bu="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=",ku=Ce(),ja={openai:ba,anthropic:ya,claude:ya,gemini:va,google:va,codex:ba,ollama:xu,azure:ec,bedrock:Jr,deepseek:gu,github:fu,openrouter:yu,wandb:vu,"opencode-go":ka,marimo:bu,opencode:ka,cursor:hu};const Ee=t=>{let e=(0,ku.c)(15),i,l,s;e[0]===t?(i=e[1],l=e[2],s=e[3]):({provider:l,className:s,...i}=t,e[0]=t,e[1]=i,e[2]=l,e[3]=s);let a=s===void 0?"":s;if(l==="openai-compatible"||!(l in ja)){let d;e[4]===a?d=e[5]:(d=Pe("h-4 w-4",a),e[4]=a,e[5]=d);let u;return e[6]===d?u=e[7]:(u=(0,n.jsx)(ai,{className:d}),e[6]=d,e[7]=u),u}let o=ja[l],c;e[8]===a?c=e[9]:(c=Pe("h-4 w-4 grayscale dark:invert",a),e[8]=a,e[9]=c);let r;return e[10]!==o||e[11]!==i||e[12]!==l||e[13]!==c?(r=(0,n.jsx)("img",{src:o,alt:l,className:c,...i}),e[10]=o,e[11]=i,e[12]=l,e[13]=c,e[14]=r):r=e[14],r};function Jt(t){switch(t){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 wa(t){switch(t){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 ei=Ce();const R="flex flex-row items-center space-x-1 space-y-0",ju=t=>{let e=(0,ei.c)(2),{children:i}=t,l;return e[0]===i?l=e[1]:(l=(0,n.jsx)("div",{className:"text-md font-semibold text-muted-foreground uppercase tracking-wide mb-1",children:i}),e[0]=i,e[1]=l),l},pt=t=>{let e=(0,ei.c)(10),i,l,s;e[0]===t?(i=e[1],l=e[2],s=e[3]):({children:i,className:l,...s}=t,e[0]=t,e[1]=i,e[2]=l,e[3]=s);let a;e[4]===l?a=e[5]:(a=Pe("text-base font-semibold underline-offset-2 text-accent-foreground uppercase tracking-wide",l),e[4]=l,e[5]=a);let o;return e[6]!==i||e[7]!==s||e[8]!==a?(o=(0,n.jsx)("div",{...s,className:a,children:i}),e[6]=i,e[7]=s,e[8]=a,e[9]=o):o=e[9],o},wu=t=>{let e=(0,ei.c)(2),{children:i}=t,l;return e[0]===i?l=e[1]:(l=(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:i}),e[0]=i,e[1]=l),l},Te=t=>{let e=(0,ei.c)(5),{title:i,children:l}=t,s;e[0]===i?s=e[1]:(s=(0,n.jsx)(pt,{children:i}),e[0]=i,e[1]=s);let a;return e[2]!==l||e[3]!==s?(a=(0,n.jsxs)("div",{className:"flex flex-col gap-4 pb-4",children:[s,l]}),e[2]=l,e[3]=s,e[4]=a):a=e[4],a},Ca=[{label:"Auto (Default)",value:"auto"},{label:"Native",value:"native"},{label:"Polars",value:"polars"},{label:"Lazy Polars",value:"lazy-polars"},{label:"Pandas",value:"pandas"}],Cu="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(".");var _u=Ce();const _a=t=>{let e=(0,_u.c)(12),{value:i,includeSuggestion:l}=t,s=l===void 0?!0:l;if(!i||i.includes("/"))return null;let a;e[0]===i?a=e[1]:(a=Ke.parse(i),e[0]=i,e[1]=a);let o=a.id,c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=(0,n.jsx)("code",{className:"font-bold",children:"provider/model"}),e[2]=c):c=e[2];let r;e[3]===i?r=e[4]:(r=(0,n.jsxs)("span",{children:["Model id should be in the form"," ",c,". ",i," is missing a provider."]}),e[3]=i,e[4]=r);let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=(0,n.jsx)("br",{}),e[5]=d):d=e[5];let u;e[6]!==s||e[7]!==o?(u=s&&o&&(0,n.jsxs)("span",{children:["Did you mean ",(0,n.jsx)("code",{className:"font-bold",children:o}),"?"]}),e[6]=s,e[7]=o,e[8]=u):u=e[8];let p;return e[9]!==r||e[10]!==u?(p=(0,n.jsxs)(wt,{kind:"danger",className:"mt-1",children:[r,d,u]}),e[9]=r,e[10]=u,e[11]=p):p=e[11],p};var It=Ce();function Su({userConfig:t,overrides:e,name:i,value:l}){let s=Ji(t,i),a=Ji(e,i),o=ro(e,i);return{isOverridden:o,userValue:s,projectValue:a,value:o?a:l}}function Mt(){let t=(0,It.c)(3),[e]=nn(),i=nt(mo),l;return t[0]!==i||t[1]!==e?(l=(s,a)=>Su({userConfig:e,overrides:i,name:s,value:a}),t[0]=i,t[1]=e,t[2]=l):l=t[2],l}function $(t){let e=(0,It.c)(9),{control:i,name:l,disabled:s,render:a}=t,o=Mt(),c;e[0]!==o||e[1]!==l||e[2]!==a?(c=d=>{let{field:u}=d;return a({field:u,override:o(l,u.value)})},e[0]=o,e[1]=l,e[2]=a,e[3]=c):c=e[3];let r;return e[4]!==i||e[5]!==s||e[6]!==l||e[7]!==c?(r=(0,n.jsx)(dt,{control:i,name:l,disabled:s,render:c}),e[4]=i,e[5]=s,e[6]=l,e[7]=c,e[8]=r):r=e[8],r}var Sa=()=>{let t=(0,It.c)(2),e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,n.jsxs)("p",{children:["This setting is overridden by the"," ",(0,n.jsx)(pe,{className:"inline mx-px",children:"pyproject.toml"})," config."]}),t[0]=e):e=t[0];let i;return t[1]===Symbol.for("react.memo_cache_sentinel")?(i=(0,n.jsxs)(n.Fragment,{children:[e,(0,n.jsxs)("p",{children:["To change it, edit the project config"," ",(0,n.jsx)(pe,{className:"inline mx-px",children:"pyproject.toml"})," directly."]})]}),t[1]=i):i=t[1],i};const Nu=t=>{let e=(0,It.c)(6),{name:i,children:l}=t,s=Mt(),a;e[0]!==i||e[1]!==s?(a=s(i,void 0),e[0]=i,e[1]=s,e[2]=a):a=e[2];let{isOverridden:o}=a,c;return e[3]!==l||e[4]!==o?(c=o?(0,n.jsx)(We,{delayDuration:200,content:(0,n.jsx)("div",{className:"flex flex-col gap-2",children:(0,n.jsx)(Sa,{})}),children:(0,n.jsx)("div",{className:"text-muted-foreground opacity-80 cursor-not-allowed *:pointer-events-none",children:l})}):l,e[3]=l,e[4]=o,e[5]=c):c=e[5],c},L=t=>{let e=(0,It.c)(12),{override:i}=t;if(!i.isOverridden)return null;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=(0,n.jsx)(Sa,{}),e[0]=l):l=e[0];let s=String(i.userValue),a;e[1]===s?a=e[2]:(a=(0,n.jsx)("strong",{children:s}),e[1]=s,e[2]=a);let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=(0,n.jsx)("br",{}),e[3]=o):o=e[3];let c=String(i.projectValue),r;e[4]===c?r=e[5]:(r=(0,n.jsx)("strong",{children:c}),e[4]=c,e[5]=r);let d;e[6]!==a||e[7]!==r?(d=(0,n.jsxs)("div",{className:"flex flex-col gap-2",children:[l,(0,n.jsxs)("p",{children:["User value: ",a,o,"Project value: ",r]})]}),e[6]=a,e[7]=r,e[8]=d):d=e[8];let u;e[9]===Symbol.for("react.memo_cache_sentinel")?(u=(0,n.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,n.jsx)(Rn,{className:"w-3 h-3"}),"Overridden by pyproject.toml"]}),e[9]=u):u=e[9];let p;return e[10]===d?p=e[11]:(p=(0,n.jsx)(We,{content:d,children:u}),e[10]=d,e[11]=p),p};var Iu=Ce();function Na(){let t=(0,Iu.c)(1),e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=[],t[0]=e):e=t[0],Fn(Mu,e)}async function Mu(){return ri.get("/ai/mcp/status")}function Ku(){let[t,e]=(0,h.useState)(!1);return{refresh:async()=>{e(!0);try{await ri.post("/ai/mcp/refresh",{}),Oe({title:"MCP refreshed",description:"MCP server configuration has been refreshed successfully"})}catch(i){Oe({title:"Refresh failed",description:i instanceof Error?i.message:"Failed to refresh MCP",variant:"danger"})}finally{e(!1)}},isRefreshing:t}}var Ia=Ce();const Du=()=>{let t=(0,Ia.c)(27),{data:e,refetch:i,isFetching:l}=Na(),s;t[0]===i?s=t[1]:(s=async()=>{try{await ri.post("/ai/mcp/refresh",{}),Oe({title:"MCP refreshed",description:"MCP server configuration has been refreshed"}),i()}catch(S){let f=S;Oe({title:"Refresh failed",description:f instanceof Error?f.message:"Failed to refresh MCP",variant:"danger"})}},t[0]=i,t[1]=s);let a=s,o;t[2]===(e==null?void 0:e.servers)?o=t[3]:(o=(e==null?void 0:e.servers)||{},t[2]=e==null?void 0:e.servers,t[3]=o);let c=o,r=Object.keys(c).length>0,d=(e==null?void 0:e.status)==="ok"&&"text-green-500",u=(e==null?void 0:e.status)==="partial"&&"text-yellow-500",p=(e==null?void 0:e.status)==="error"&&r&&"text-red-500",g;t[4]!==d||t[5]!==u||t[6]!==p?(g=Pe("h-4 w-4",d,u,p),t[4]=d,t[5]=u,t[6]=p,t[7]=g):g=t[7];let x;t[8]===g?x=t[9]:(x=(0,n.jsx)(We,{content:"MCP Status",children:(0,n.jsx)(Mo,{asChild:!0,children:(0,n.jsx)(se,{variant:"text",size:"icon",children:(0,n.jsx)($n,{className:g})})})}),t[8]=g,t[9]=x);let v;t[10]===Symbol.for("react.memo_cache_sentinel")?(v=(0,n.jsx)("h4",{className:"font-medium text-sm",children:"MCP Server Status"}),t[10]=v):v=t[10];let j;t[11]===l?j=t[12]:(j=l?(0,n.jsx)(zt,{className:"h-3 w-3 animate-spin"}):(0,n.jsx)(kn,{className:"h-3 w-3"}),t[11]=l,t[12]=j);let C;t[13]!==a||t[14]!==l||t[15]!==j?(C=(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[v,(0,n.jsx)(se,{variant:"ghost",size:"xs",onClick:a,disabled:l,children:j})]}),t[13]=a,t[14]=l,t[15]=j,t[16]=C):C=t[16];let I;t[17]!==r||t[18]!==c||t[19]!==e?(I=e&&(0,n.jsxs)("div",{className:"text-xs space-y-2",children:[r&&(0,n.jsxs)("div",{className:"flex justify-between items-center",children:[(0,n.jsx)("span",{className:"text-muted-foreground",children:"Overall:"}),(0,n.jsx)(ti,{status:e.status})]}),e.error&&(0,n.jsx)("div",{className:"text-xs text-red-500 bg-red-50 dark:bg-red-950/20 p-2 rounded",children:e.error}),r&&(0,n.jsxs)("div",{className:"space-y-1",children:[(0,n.jsx)("div",{className:"text-muted-foreground font-medium",children:"Servers:"}),Object.entries(c).map(Au)]}),!r&&(0,n.jsxs)("div",{className:"text-muted-foreground text-center py-2",children:["No MCP servers configured. ",(0,n.jsx)("br",{})," Configure under"," ",(0,n.jsx)("b",{children:"Settings > AI > MCP"})]})]}),t[17]=r,t[18]=c,t[19]=e,t[20]=I):I=t[20];let b;t[21]!==I||t[22]!==C?(b=(0,n.jsx)(Ko,{className:"w-[320px]",align:"start",side:"right",children:(0,n.jsxs)("div",{className:"space-y-3",children:[C,I]})}),t[21]=I,t[22]=C,t[23]=b):b=t[23];let _;return t[24]!==b||t[25]!==x?(_=(0,n.jsxs)(Do,{children:[x,b]}),t[24]=b,t[25]=x,t[26]=_):_=t[26],_},ti=t=>{let e=(0,Ia.c)(11),{status:i}=t,l=i==="ok"&&"text-green-500",s=i==="partial"&&"text-yellow-500",a=i==="error"&&"text-red-500",o=i==="failed"&&"text-red-500",c=i==="disconnected"&&"text-gray-500",r=i==="pending"&&"text-yellow-500",d=i==="connected"&&"text-green-500",u;e[0]!==l||e[1]!==s||e[2]!==a||e[3]!==o||e[4]!==c||e[5]!==r||e[6]!==d?(u=Pe("text-xs font-medium",l,s,a,o,c,r,d),e[0]=l,e[1]=s,e[2]=a,e[3]=o,e[4]=c,e[5]=r,e[6]=d,e[7]=u):u=e[7];let p;return e[8]!==i||e[9]!==u?(p=(0,n.jsx)("span",{className:u,children:i}),e[8]=i,e[9]=u,e[10]=p):p=e[10],p};function Au(t){let[e,i]=t;return(0,n.jsxs)("div",{className:"flex justify-between items-center pl-2",children:[(0,n.jsx)("span",{className:"text-muted-foreground truncate max-w-[180px]",children:e}),(0,n.jsx)(ti,{status:i})]},e)}var Pu=Ce(),Eu=[{id:"marimo",title:"marimo (docs)",description:"Access marimo documentation"},{id:"context7",title:"Context7",description:"Connect to Context7 MCP server"}];const Tu=t=>{let e=(0,Pu.c)(36),{form:i,onSubmit:l}=t,{handleClick:s}=$i(),{data:a,refetch:o,isFetching:c}=Na(),{refresh:r,isRefreshing:d}=Ku(),u;e[0]!==o||e[1]!==r?(u=async()=>{await r(),o()},e[0]=o,e[1]=r,e[2]=u):u=e[2];let p=u,g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g=(0,n.jsx)(pt,{children:"MCP Servers"}),e[3]=g):g=e[3];let x;e[4]===a?x=e[5]:(x=a&&(0,n.jsx)(ti,{status:a.status}),e[4]=a,e[5]=x);let v=d||c,j;e[6]!==c||e[7]!==d?(j=d||c?(0,n.jsx)(zt,{className:"h-3 w-3 animate-spin"}):(0,n.jsx)(kn,{className:"h-3 w-3"}),e[6]=c,e[7]=d,e[8]=j):j=e[8];let C;e[9]!==p||e[10]!==v||e[11]!==j?(C=(0,n.jsx)(se,{variant:"outline",size:"xs",onClick:p,disabled:v,children:j}),e[9]=p,e[10]=v,e[11]=j,e[12]=C):C=e[12];let I;e[13]!==x||e[14]!==C?(I=(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[g,(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[x,C]})]}),e[13]=x,e[14]=C,e[15]=I):I=e[15];let b;e[16]===a?b=e[17]:(b=(a==null?void 0:a.error)&&(0,n.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}),e[16]=a,e[17]=b);let _;e[18]===a?_=e[19]:(_=(a==null?void 0:a.servers)&&(0,n.jsx)("div",{className:"text-xs text-muted-foreground",children:Object.entries(a.servers).map(Bu)}),e[18]=a,e[19]=_);let S;e[20]===Symbol.for("react.memo_cache_sentinel")?(S=(0,n.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."}),e[20]=S):S=e[20];let f;e[21]===Symbol.for("react.memo_cache_sentinel")?(f=(0,n.jsx)(pe,{className:"inline",children:"marimo[mcp]"}),e[21]=f):f=e[21];let m;e[22]===s?m=e[23]:(m=(0,n.jsxs)("p",{className:"text-sm text-muted-foreground",children:["This feature requires the ",f," ","package. See"," ",(0,n.jsx)(se,{variant:"link",onClick:()=>s("optionalDeps"),size:"xs",children:"Optional Features"})," ","for more details."]}),e[22]=s,e[23]=m);let y;e[24]!==i||e[25]!==l?(y=B=>{let{field:M}=B,w=M.value||[],K=k=>{let D=w.includes(k)?w.filter(T=>T!==k):[...w,k];M.onChange(D),l(i.getValues())};return(0,n.jsx)(O,{children:(0,n.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:Eu.map(k=>{let D=w.includes(k.id);return(0,n.jsxs)(sc,{className:`cursor-pointer transition-all ${D?"border-(--blue-9) bg-(--blue-2)":"hover:border-(--blue-7)"}`,onClick:()=>K(k.id),children:[(0,n.jsx)(ic,{children:(0,n.jsxs)("div",{className:"flex items-start justify-between",children:[(0,n.jsx)(tc,{className:"text-base",children:k.title}),(0,n.jsx)("span",{className:`h-5 w-5 flex items-center justify-center rounded border ${D?"border-(--blue-7) bg-(--blue-7) text-foreground":"border-muted bg-background text-muted-foreground"}`,children:D?(0,n.jsx)(uc,{}):null})]})}),(0,n.jsx)(nc,{children:(0,n.jsx)(lc,{children:k.description})})]},k.id)})})})},e[24]=i,e[25]=l,e[26]=y):y=e[26];let P;e[27]!==i.control||e[28]!==y?(P=(0,n.jsx)(dt,{control:i.control,name:"mcp.presets",render:y}),e[27]=i.control,e[28]=y,e[29]=P):P=e[29];let A;return e[30]!==m||e[31]!==P||e[32]!==I||e[33]!==b||e[34]!==_?(A=(0,n.jsxs)("div",{className:"flex flex-col gap-4",children:[I,b,_,S,m,P]}),e[30]=m,e[31]=P,e[32]=I,e[33]=b,e[34]=_,e[35]=A):A=e[35],A};function Bu(t){let[e,i]=t;return(0,n.jsxs)("div",{children:[e,": ",(0,n.jsx)(ti,{status:i})]},e)}var ve=Ce(),Ma=new Set(Yt);Ma.delete("deepseek");const Fu=t=>{let e=(0,ve.c)(5),{provider:i,children:l}=t,s;e[0]===i?s=e[1]:(s=i&&(0,n.jsx)(Ee,{provider:i,className:"mr-2"}),e[0]=i,e[1]=s);let a;return e[2]!==l||e[3]!==s?(a=(0,n.jsxs)("div",{className:"flex items-center text-base font-semibold",children:[s,l]}),e[2]=l,e[3]=s,e[4]=a):a=e[4],a},Re=t=>{let e=(0,ve.c)(9),{form:i,name:l,placeholder:s,testId:a,description:o,onChange:c}=t,r;e[0]!==o||e[1]!==c||e[2]!==s||e[3]!==a?(r=u=>{let{field:p,override:g}=u;return(0,n.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{children:"API Key"}),(0,n.jsx)(V,{children:(0,n.jsx)(ze,{"data-testid":a,rootClassName:"flex-1",className:"m-0 inline-flex h-7",placeholder:s,type:"password",...p,value:ii(g.value),disabled:g.isOverridden,onChange:x=>{let v=x.target.value;v.includes("*")||(p.onChange(v),c==null||c(v))}})}),(0,n.jsx)(G,{}),(0,n.jsx)(L,{override:g})]}),o&&(0,n.jsx)(H,{children:o})]})},e[0]=o,e[1]=c,e[2]=s,e[3]=a,e[4]=r):r=e[4];let d;return e[5]!==i.control||e[6]!==l||e[7]!==r?(d=(0,n.jsx)($,{control:i.control,name:l,render:r}),e[5]=i.control,e[6]=l,e[7]=r,e[8]=d):d=e[8],d};function ii(t){return t==null?"":typeof t=="string"?t:String(t)}const Ye=t=>{let e=(0,ve.c)(10),{form:i,name:l,placeholder:s,testId:a,description:o,disabled:c,onChange:r}=t,d=c===void 0?!1:c,u;e[0]!==o||e[1]!==d||e[2]!==r||e[3]!==s||e[4]!==a?(u=g=>{let{field:x,override:v}=g;return(0,n.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{children:"Base URL"}),(0,n.jsx)(V,{children:(0,n.jsx)(ze,{"data-testid":a,rootClassName:"flex-1",className:"m-0 inline-flex h-7",placeholder:s,...x,value:ii(v.value),disabled:d||v.isOverridden,onChange:j=>{x.onChange(j.target.value),r==null||r(j.target.value)}})}),(0,n.jsx)(G,{}),(0,n.jsx)(L,{override:v})]}),o&&(0,n.jsx)(H,{children:o})]})},e[0]=o,e[1]=d,e[2]=r,e[3]=s,e[4]=a,e[5]=u):u=e[5];let p;return e[6]!==i.control||e[7]!==l||e[8]!==u?(p=(0,n.jsx)($,{control:i.control,name:l,render:u}),e[6]=i.control,e[7]=l,e[8]=u,e[9]=p):p=e[9],p},Oi=t=>{let e=(0,ve.c)(11),{form:i,name:l,placeholder:s,description:a,label:o,forRole:c,onSubmit:r}=t,d;e[0]!==a||e[1]!==c||e[2]!==i||e[3]!==o||e[4]!==r||e[5]!==s?(d=p=>{let{field:g,override:x}=p,v=ii(x.value),j=x.isOverridden,C=I=>{g.onChange(I),r(i.getValues())};return(0,n.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{children:o}),(0,n.jsx)(V,{children:(0,n.jsx)(Fa,{value:v,placeholder:s,onSelect:C,disabled:j,triggerClassName:"text-sm",customDropdownContent:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Bt,{}),(0,n.jsxs)("p",{className:"px-2 py-1.5 text-sm text-muted-secondary flex items-center gap-1",children:["Enter a custom model",(0,n.jsx)(We,{content:"Models should include the provider prefix, e.g. 'openai/gpt-4o'",children:(0,n.jsx)(Ga,{className:"h-3 w-3"})})]}),(0,n.jsxs)("div",{className:"px-2 py-1",children:[(0,n.jsx)(ze,{className:"w-full border-border shadow-none focus-visible:shadow-xs",placeholder:s,...g,value:v,disabled:j,onKeyDown:mn.stopPropagation()}),v&&(0,n.jsx)(_a,{value:v,includeSuggestion:!1})]})]}),forRole:c})}),(0,n.jsx)(G,{})]}),(0,n.jsx)(L,{override:x}),(0,n.jsx)(_a,{value:v}),a&&(0,n.jsx)(H,{children:a})]})},e[0]=a,e[1]=c,e[2]=i,e[3]=o,e[4]=r,e[5]=s,e[6]=d):d=e[6];let u;return e[7]!==i.control||e[8]!==l||e[9]!==d?(u=(0,n.jsx)($,{control:i.control,name:l,render:d}),e[7]=i.control,e[8]=l,e[9]=d,e[10]=u):u=e[10],u},zu=t=>{let e=(0,ve.c)(8),{form:i,name:l,options:s,testId:a,disabled:o}=t,c=o===void 0?!1:o,r;e[0]!==c||e[1]!==s||e[2]!==a?(r=u=>{let{field:p,override:g}=u;return(0,n.jsx)("div",{className:"flex flex-col space-y-1",children:(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{children:"Provider"}),(0,n.jsx)(V,{children:(0,n.jsx)(Me,{"data-testid":a,onChange:x=>{x.target.value==="none"?p.onChange(!1):p.onChange(x.target.value)},value:ii(g.value===!0?"github":g.value===!1?"none":g.value),disabled:c||g.isOverridden,className:"inline-flex mr-2",children:s.map(Zu)})}),(0,n.jsx)(G,{}),(0,n.jsx)(L,{override:g})]})})},e[0]=c,e[1]=s,e[2]=a,e[3]=r):r=e[3];let d;return e[4]!==i.control||e[5]!==l||e[6]!==r?(d=(0,n.jsx)($,{control:i.control,name:l,render:r}),e[4]=i.control,e[5]=l,e[6]=r,e[7]=d):d=e[7],d};var Ou=({form:t,config:e,onSubmit:i,copilot:l})=>{if(l===!1)return null;if(l==="codeium")return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("p",{className:"text-sm text-muted-secondary",children:["To get a Windsurf API key, follow"," ",(0,n.jsx)(oe,{href:"https://docs.marimo.io/guides/editor_features/ai_completion.html#windsurf-copilot",children:"these instructions"}),"."]}),(0,n.jsx)(Re,{form:t,config:e,name:"completion.codeium_api_key",placeholder:"key",testId:"codeium-api-key-input"})]});if(l==="github")return(0,n.jsx)(ha,{});if(l==="custom")return(0,n.jsx)(Oi,{label:"Autocomplete Model",form:t,config:e,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:i,forRole:"autocomplete"})},ht=t=>{let e=(0,ve.c)(5),{children:i,className:l}=t,s;e[0]===l?s=e[1]:(s=Pe("flex flex-col gap-4 pb-4",l),e[0]=l,e[1]=s);let a;return e[2]!==i||e[3]!==s?(a=(0,n.jsx)("div",{className:s,children:i}),e[2]=i,e[3]=s,e[4]=a):a=e[4],a},Vu=t=>{let e=(0,ve.c)(23),{qualifiedId:i,model:l,isEnabled:s,onToggle:a,onDelete:o}=t,c;e[0]!==a||e[1]!==i?(c=()=>{a(i)},e[0]=a,e[1]=i,e[2]=c):c=e[2];let r=c,d;e[3]!==o||e[4]!==i?(d=C=>{C.stopPropagation(),C.preventDefault(),o(i)},e[3]=o,e[4]=i,e[5]=d):d=e[5];let u=d,p;e[6]===l?p=e[7]:(p=(0,n.jsx)(Ru,{model:l}),e[6]=l,e[7]=p);let g;e[8]!==u||e[9]!==l.custom?(g=l.custom&&(0,n.jsx)(se,{variant:"ghost",size:"icon",onClick:u,className:"mr-2 hover:bg-transparent",children:(0,n.jsx)(Sn,{className:"h-3.5 w-3.5 text-muted-foreground"})}),e[8]=u,e[9]=l.custom,e[10]=g):g=e[10];let x;e[11]!==r||e[12]!==s?(x=(0,n.jsx)(jo,{checked:s,onClick:r,size:"sm"}),e[11]=r,e[12]=s,e[13]=x):x=e[13];let v;e[14]!==p||e[15]!==g||e[16]!==x?(v=(0,n.jsx)(Hs,{children:(0,n.jsxs)("div",{className:"flex items-center justify-between px-3 py-2.5 border-b last:border-b-0 cursor-pointer outline-hidden",children:[p,g,x]})}),e[14]=p,e[15]=g,e[16]=x,e[17]=v):v=e[17];let j;return e[18]!==r||e[19]!==l.name||e[20]!==i||e[21]!==v?(j=(0,n.jsx)(Ws,{id:i,textValue:l.name,className:"pl-6 outline-hidden data-focused:bg-muted/50 hover:bg-muted/50",onAction:r,children:v}),e[18]=r,e[19]=l.name,e[20]=i,e[21]=v,e[22]=j):j=e[22],j},Ru=t=>{let e=(0,ve.c)(18),{model:i}=t,l;e[0]===i.name?l=e[1]:(l=(0,n.jsx)("h3",{className:"font-medium text-sm",children:i.name}),e[0]=i.name,e[1]=l);let s;e[2]===i.custom?s=e[3]:(s=i.custom&&(0,n.jsx)(ai,{className:"h-4 w-4"}),e[2]=i.custom,e[3]=s);let a;e[4]===s?a=e[5]:(a=(0,n.jsx)(We,{content:"Custom model",children:s}),e[4]=s,e[5]=a);let o;e[6]===i.capabilities?o=e[7]:(o=i.capabilities.includes("thinking")&&(0,n.jsxs)("div",{className:Pe("flex items-center gap-1 rounded px-1 py-0.5 w-fit",Jt("thinking")),children:[(0,n.jsx)(ki,{className:"h-3 w-3"}),(0,n.jsx)("span",{className:"text-xs font-medium",children:"Reasoning"})]}),e[6]=i.capabilities,e[7]=o);let c;e[8]!==l||e[9]!==a||e[10]!==o?(c=(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[l,a,o]}),e[8]=l,e[9]=a,e[10]=o,e[11]=c):c=e[11];let r;e[12]!==i.custom||e[13]!==i.description?(r=i.description&&!i.custom&&(0,n.jsx)("p",{className:"text-sm text-muted-foreground line-clamp-2",children:i.description}),e[12]=i.custom,e[13]=i.description,e[14]=r):r=e[14];let d;return e[15]!==c||e[16]!==r?(d=(0,n.jsxs)("div",{className:"flex flex-col flex-1 gap-0.5",children:[c,r]}),e[15]=c,e[16]=r,e[17]=d):d=e[17],d};const $u=t=>{let e=(0,ve.c)(14),{form:i,config:l,onSubmit:s}=t,a=Mt(),o;e[0]===i.control?o=e[1]:(o={control:i.control,name:"completion.copilot"},e[0]=i.control,e[1]=o);let c=bt(o),r;if(e[2]!==l||e[3]!==i||e[4]!==a||e[5]!==s||e[6]!==c){let{value:d}=a("completion.copilot",c),u,p;e[8]===Symbol.for("react.memo_cache_sentinel")?(u=(0,n.jsx)(pt,{children:"Code Completion"}),p=(0,n.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."}),e[8]=u,e[9]=p):(u=e[8],p=e[9]);let g;e[10]===Symbol.for("react.memo_cache_sentinel")?(g=["none","github","codeium","custom"],e[10]=g):g=e[10];let x;e[11]!==l||e[12]!==i?(x=(0,n.jsx)(zu,{form:i,config:l,name:"completion.copilot",options:g,testId:"copilot-select"}),e[11]=l,e[12]=i,e[13]=x):x=e[13],r=(0,n.jsxs)(ht,{children:[u,p,x,Ou({form:i,config:l,onSubmit:s,copilot:d})]}),e[2]=l,e[3]=i,e[4]=a,e[5]=s,e[6]=c,e[7]=r}else r=e[7];return r};var Be=t=>{let e=(0,ve.c)(15),{title:i,triggerClassName:l,provider:s,children:a,isConfigured:o,value:c}=t,r=c??s,d;e[0]===o?d=e[1]:(d=o&&(0,n.jsx)("span",{className:"ml-2 px-1 rounded bg-muted text-xs font-medium border",children:"Configured"}),e[0]=o,e[1]=d);let u;e[2]!==s||e[3]!==d||e[4]!==i?(u=(0,n.jsxs)(Fu,{provider:s,children:[i,d]}),e[2]=s,e[3]=d,e[4]=i,e[5]=u):u=e[5];let p;e[6]!==u||e[7]!==l?(p=(0,n.jsx)(So,{className:l,children:u}),e[6]=u,e[7]=l,e[8]=p):p=e[8];let g;e[9]===a?g=e[10]:(g=(0,n.jsx)(_o,{wrapperClassName:"flex flex-col gap-4",children:a}),e[9]=a,e[10]=g);let x;return e[11]!==r||e[12]!==p||e[13]!==g?(x=(0,n.jsxs)(Co,{value:r,children:[p,g]}),e[11]=r,e[12]=p,e[13]=g,e[14]=x):x=e[14],x};const Lu=({form:t,config:e,onSubmit:i})=>{let[l,s]=(0,h.useState)(!1),[a,o]=(0,h.useState)(""),[c,r]=(0,h.useState)(""),[d,u]=(0,h.useState)(""),p=(0,h.useId)(),g=(0,h.useId)(),x=(0,h.useId)(),v=a.toLowerCase().replaceAll(/\s+/g,"_"),j=t.watch("ai.custom_providers"),C=Ma.has(v)||j&&Object.keys(j).includes(v),I=v.includes("."),b=v.trim()&&d.trim()&&!C&&!I,_=()=>{o(""),r(""),u(""),s(!1)};return(0,n.jsx)(dt,{control:t.control,name:"ai.custom_providers",render:({field:S})=>{let f=S.value||{},m=Object.entries(f),y=()=>{b&&(S.onChange({...f,[v]:{api_key:c||void 0,base_url:d}}),i(t.getValues()),_())},P=w=>{let{[w]:K,...k}=f;t.resetField("ai.custom_providers"),t.setValue("ai.custom_providers",k,{shouldDirty:!0}),i(t.getValues())},A=(0,n.jsxs)("div",{className:"flex flex-col gap-3 p-4 border border-border rounded-md bg-muted/20",children:[(0,n.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,n.jsx)(Le,{htmlFor:p,children:"Provider Name"}),(0,n.jsx)(ze,{id:p,placeholder:"e.g., together, groq, mistral",value:a,onChange:w=>o(w.target.value)}),C&&(0,n.jsx)("p",{className:"text-xs text-destructive",children:"A provider with this name already exists."}),I&&(0,n.jsx)("p",{className:"text-xs text-destructive",children:"Provider names cannot contain '.' characters."}),a&&!I&&(0,n.jsxs)("p",{className:"text-xs text-muted-secondary",children:["Use models with prefix:"," ",(0,n.jsxs)(pe,{className:"inline text-xs",children:[v,"/"]})]})]}),(0,n.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,n.jsxs)(Le,{htmlFor:x,children:["Base URL ",(0,n.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,n.jsx)(ze,{id:x,placeholder:"e.g., https://api.together.xyz/v1",value:d,onChange:w=>u(w.target.value)})]}),(0,n.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,n.jsx)(Le,{htmlFor:g,children:"API Key (optional)"}),(0,n.jsx)(ze,{id:g,placeholder:"sk-...",type:"password",value:c,onChange:w=>r(w.target.value)})]}),(0,n.jsxs)("div",{className:"flex gap-2 mt-1",children:[(0,n.jsx)(se,{onClick:y,disabled:!b,size:"xs",children:"Add Provider"}),(0,n.jsx)(se,{variant:"outline",onClick:_,size:"xs",children:"Cancel"})]})]}),B=w=>{S.onChange({...f,[w.providerName]:{...f[w.providerName],[w.fieldName]:w.value||void 0}})},M=({providerName:w,providerConfig:K,onRemove:k})=>{let D=di.startCase(w),T=!!K.api_key||!!K.base_url;return(0,n.jsxs)(Be,{title:D,provider:w,value:`custom-${w}`,isConfigured:T,children:[(0,n.jsx)(Re,{form:t,config:e,name:`ai.custom_providers.${w}.api_key`,placeholder:"sk-...",testId:`custom-provider-${w}-api-key`,onChange:F=>B({providerName:w,fieldName:"api_key",value:F})}),(0,n.jsx)(Ye,{form:t,config:e,name:`ai.custom_providers.${w}.base_url`,placeholder:"https://api.example.com/v1",testId:`custom-provider-${w}-base-url`,onChange:F=>B({providerName:w,fieldName:"base_url",value:F})}),(0,n.jsxs)(se,{variant:"destructive",size:"xs",onClick:F=>{F.stopPropagation(),F.preventDefault(),k(w)},className:"w-fit self-end",children:[(0,n.jsx)(Sn,{className:"h-4 w-4 mr-2"}),"Remove Provider"]})]},`custom-${w}`)};return(0,n.jsxs)(ht,{children:[(0,n.jsx)(pt,{children:"Custom Providers"}),(0,n.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."}),m.length>0&&(0,n.jsx)(an,{type:"multiple",className:"-mt-4",children:m.map(([w,K])=>M({providerName:w,providerConfig:K,onRemove:P}))}),l?A:(0,n.jsx)(Ka,{className:"self-start",isFormOpen:l,setIsFormOpen:s,label:"Add Provider"})]})}})},Gu=t=>{let e=(0,ve.c)(120),{form:i,config:l,onSubmit:s}=t,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=ct(),e[0]=a):a=e[0];let o=a,c;e[1]===i?c=e[2]:(c=qe=>!!i.getValues(qe),e[1]=i,e[2]=c);let r=c,d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=(0,n.jsx)(pe,{className:"inline",children:"marimo.toml"}),e[3]=d):d=e[3];let u;e[4]===Symbol.for("react.memo_cache_sentinel")?(u=(0,n.jsxs)("p",{className:"text-sm text-muted-secondary",children:["Add your API keys below or to ",d," ","to set up a provider for the Code Completion and Assistant features; see"," ",(0,n.jsx)(oe,{href:"https://docs.marimo.io/guides/editor_features/ai_completion/#connecting-to-an-llm",children:"docs"})," ","for more info."]}),e[4]=u):u=e[4];let p=r("ai.open_ai.api_key"),g;e[5]===Symbol.for("react.memo_cache_sentinel")?(g=(0,n.jsxs)(n.Fragment,{children:["Your OpenAI API key from"," ",(0,n.jsx)(oe,{href:"https://platform.openai.com/account/api-keys",children:"platform.openai.com"}),"."]}),e[5]=g):g=e[5];let x,v;e[6]!==l||e[7]!==i?(x=(0,n.jsx)(Re,{form:i,config:l,name:"ai.open_ai.api_key",placeholder:"sk-proj...",testId:"ai-openai-api-key-input",description:g}),v=(0,n.jsx)(Ye,{form:i,config:l,name:"ai.open_ai.base_url",placeholder:"https://api.openai.com/v1",testId:"ai-base-url-input",disabled:o}),e[6]=l,e[7]=i,e[8]=x,e[9]=v):(x=e[8],v=e[9]);let j;e[10]!==p||e[11]!==x||e[12]!==v?(j=(0,n.jsxs)(Be,{title:"OpenAI",provider:"openai",triggerClassName:"pt-0",isConfigured:p,children:[x,v]}),e[10]=p,e[11]=x,e[12]=v,e[13]=j):j=e[13];let C=r("ai.anthropic.api_key"),I;e[14]===Symbol.for("react.memo_cache_sentinel")?(I=(0,n.jsxs)(n.Fragment,{children:["Your Anthropic API key from"," ",(0,n.jsx)(oe,{href:"https://console.anthropic.com/settings/keys",children:"console.anthropic.com"}),"."]}),e[14]=I):I=e[14];let b;e[15]!==l||e[16]!==i?(b=(0,n.jsx)(Re,{form:i,config:l,name:"ai.anthropic.api_key",placeholder:"sk-ant...",testId:"ai-anthropic-api-key-input",description:I}),e[15]=l,e[16]=i,e[17]=b):b=e[17];let _;e[18]!==C||e[19]!==b?(_=(0,n.jsx)(Be,{title:"Anthropic",provider:"anthropic",isConfigured:C,children:b}),e[18]=C,e[19]=b,e[20]=_):_=e[20];let S=r("ai.google.api_key"),f;e[21]===Symbol.for("react.memo_cache_sentinel")?(f=(0,n.jsxs)(n.Fragment,{children:["Your Google AI API key from"," ",(0,n.jsx)(oe,{href:"https://aistudio.google.com/app/apikey",children:"aistudio.google.com"}),"."]}),e[21]=f):f=e[21];let m;e[22]!==l||e[23]!==i?(m=(0,n.jsx)(Re,{form:i,config:l,name:"ai.google.api_key",placeholder:"AI...",testId:"ai-google-api-key-input",description:f}),e[22]=l,e[23]=i,e[24]=m):m=e[24];let y;e[25]!==S||e[26]!==m?(y=(0,n.jsx)(Be,{title:"Google",provider:"google",isConfigured:S,children:m}),e[25]=S,e[26]=m,e[27]=y):y=e[27];let P=r("ai.ollama.base_url"),A;e[28]!==l||e[29]!==i?(A=(0,n.jsx)(Ye,{form:i,config:l,name:"ai.ollama.base_url",placeholder:"http://localhost:11434/v1",testId:"ollama-base-url-input"}),e[28]=l,e[29]=i,e[30]=A):A=e[30];let B;e[31]!==P||e[32]!==A?(B=(0,n.jsx)(Be,{title:"Ollama",provider:"ollama",isConfigured:P,children:A}),e[31]=P,e[32]=A,e[33]=B):B=e[33];let M=r("ai.github.api_key"),w;e[34]===Symbol.for("react.memo_cache_sentinel")?(w=(0,n.jsx)(Bn,{variant:"warning",className:"py-1.5 px-3 text-xs",children:(0,n.jsxs)(Tn,{children:["Free tier models have low token limits which can cause errors with larger prompts."," ",(0,n.jsx)(oe,{href:"https://docs.github.com/en/github-models/prototyping-with-ai-models#rate-limits",children:"Learn more"})]})}),e[34]=w):w=e[34];let K;e[35]===Symbol.for("react.memo_cache_sentinel")?(K=(0,n.jsxs)(n.Fragment,{children:["Your GitHub API token from"," ",(0,n.jsx)(pe,{className:"inline",children:"gh auth token"}),"."]}),e[35]=K):K=e[35];let k,D;e[36]!==l||e[37]!==i?(k=(0,n.jsx)(Re,{form:i,config:l,name:"ai.github.api_key",placeholder:"gho_...",testId:"ai-github-api-key-input",description:K}),D=(0,n.jsx)(Ye,{form:i,config:l,name:"ai.github.base_url",placeholder:"https://models.github.ai/inference",testId:"ai-github-base-url-input"}),e[36]=l,e[37]=i,e[38]=k,e[39]=D):(k=e[38],D=e[39]);let T;e[40]!==M||e[41]!==k||e[42]!==D?(T=(0,n.jsxs)(Be,{title:"GitHub",provider:"github",isConfigured:M,children:[w,k,D]}),e[40]=M,e[41]=k,e[42]=D,e[43]=T):T=e[43];let F=r("ai.openrouter.api_key"),U;e[44]===Symbol.for("react.memo_cache_sentinel")?(U=(0,n.jsxs)(n.Fragment,{children:["Your OpenRouter API key from ","",(0,n.jsx)(oe,{href:"https://openrouter.ai/keys",children:"openrouter.ai"}),"."]}),e[44]=U):U=e[44];let W,N;e[45]!==l||e[46]!==i?(W=(0,n.jsx)(Re,{form:i,config:l,name:"ai.openrouter.api_key",placeholder:"or-...",testId:"ai-openrouter-api-key-input",description:U}),N=(0,n.jsx)(Ye,{form:i,config:l,name:"ai.openrouter.base_url",placeholder:"https://openrouter.ai/api/v1/",testId:"ai-openrouter-base-url-input"}),e[45]=l,e[46]=i,e[47]=W,e[48]=N):(W=e[47],N=e[48]);let q;e[49]!==F||e[50]!==W||e[51]!==N?(q=(0,n.jsxs)(Be,{title:"OpenRouter",provider:"openrouter",isConfigured:F,children:[W,N]}),e[49]=F,e[50]=W,e[51]=N,e[52]=q):q=e[52];let ie=r("ai.wandb.api_key"),ce;e[53]===Symbol.for("react.memo_cache_sentinel")?(ce=(0,n.jsxs)(n.Fragment,{children:["Your Weights & Biases API key from"," ",(0,n.jsx)(oe,{href:"https://wandb.ai/authorize",children:"wandb.ai"}),"."]}),e[53]=ce):ce=e[53];let de,fe;e[54]!==l||e[55]!==i?(de=(0,n.jsx)(Re,{form:i,config:l,name:"ai.wandb.api_key",placeholder:"your-wandb-api-key",testId:"ai-wandb-api-key-input",description:ce}),fe=(0,n.jsx)(Ye,{form:i,config:l,name:"ai.wandb.base_url",placeholder:"https://api.inference.wandb.ai/v1/",testId:"ai-wandb-base-url-input"}),e[54]=l,e[55]=i,e[56]=de,e[57]=fe):(de=e[56],fe=e[57]);let he;e[58]!==ie||e[59]!==de||e[60]!==fe?(he=(0,n.jsxs)(Be,{title:"Weights & Biases",provider:"wandb",isConfigured:ie,children:[de,fe]}),e[58]=ie,e[59]=de,e[60]=fe,e[61]=he):he=e[61];let xe=r("ai.opencode_go.api_key"),E;e[62]===Symbol.for("react.memo_cache_sentinel")?(E=(0,n.jsxs)(n.Fragment,{children:["Your OpenCode API key from"," ",(0,n.jsx)(oe,{href:"https://opencode.ai/auth",children:"opencode.ai"}),". OpenCode Go is a low-cost subscription for open coding models."]}),e[62]=E):E=e[62];let X,Y;e[63]!==l||e[64]!==i?(X=(0,n.jsx)(Re,{form:i,config:l,name:"ai.opencode_go.api_key",placeholder:"your-opencode-api-key",testId:"ai-opencode-go-api-key-input",description:E}),Y=(0,n.jsx)(Ye,{form:i,config:l,name:"ai.opencode_go.base_url",placeholder:"https://opencode.ai/zen/go/v1/",testId:"ai-opencode-go-base-url-input"}),e[63]=l,e[64]=i,e[65]=X,e[66]=Y):(X=e[65],Y=e[66]);let Q;e[67]!==xe||e[68]!==X||e[69]!==Y?(Q=(0,n.jsxs)(Be,{title:"OpenCode Go",provider:"opencode-go",isConfigured:xe,children:[X,Y]}),e[67]=xe,e[68]=X,e[69]=Y,e[70]=Q):Q=e[70];let J=r("ai.azure.api_key")&&r("ai.azure.base_url"),ne;e[71]===Symbol.for("react.memo_cache_sentinel")?(ne=(0,n.jsxs)(n.Fragment,{children:["Your Azure API key from"," ",(0,n.jsx)(oe,{href:"https://portal.azure.com/",children:"portal.azure.com"}),"."]}),e[71]=ne):ne=e[71];let le,ye;e[72]!==l||e[73]!==i?(le=(0,n.jsx)(Re,{form:i,config:l,name:"ai.azure.api_key",placeholder:"sk-proj...",testId:"ai-azure-api-key-input",description:ne}),ye=(0,n.jsx)(Ye,{form:i,config:l,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"}),e[72]=l,e[73]=i,e[74]=le,e[75]=ye):(le=e[74],ye=e[75]);let ue;e[76]!==J||e[77]!==le||e[78]!==ye?(ue=(0,n.jsxs)(Be,{title:"Azure",provider:"azure",isConfigured:J,children:[le,ye]}),e[76]=J,e[77]=le,e[78]=ye,e[79]=ue):ue=e[79];let je=r("ai.bedrock.region_name"),_e;e[80]===Symbol.for("react.memo_cache_sentinel")?(_e=(0,n.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,n.jsx)(oe,{href:"https://docs.marimo.io/guides/editor_features/ai_completion.html#aws-bedrock",children:"documentation"})," ","for more details."]}),e[80]=_e):_e=e[80];let ge,be;e[81]===i.control?(ge=e[82],be=e[83]):(ge=(0,n.jsx)($,{control:i.control,disabled:o,name:"ai.bedrock.region_name",render:Ju}),be=(0,n.jsx)($,{control:i.control,disabled:o,name:"ai.bedrock.profile_name",render:e0}),e[81]=i.control,e[82]=ge,e[83]=be);let me;e[84]!==je||e[85]!==ge||e[86]!==be?(me=(0,n.jsxs)(Be,{title:"AWS Bedrock",provider:"bedrock",isConfigured:je,children:[_e,ge,be]}),e[84]=je,e[85]=ge,e[86]=be,e[87]=me):me=e[87];let De=r("ai.open_ai_compatible.api_key")&&r("ai.open_ai_compatible.base_url"),ke;e[88]===Symbol.for("react.memo_cache_sentinel")?(ke=(0,n.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."}),e[88]=ke):ke=e[88];let Se;e[89]===Symbol.for("react.memo_cache_sentinel")?(Se=(0,n.jsx)(n.Fragment,{children:"API key for any OpenAI-compatible provider (e.g., Together, Groq, Mistral, Perplexity, etc)."}),e[89]=Se):Se=e[89];let ae;e[90]!==l||e[91]!==i?(ae=(0,n.jsx)(Re,{form:i,config:l,name:"ai.open_ai_compatible.api_key",placeholder:"sk-...",testId:"ai-openai-compatible-api-key-input",description:Se}),e[90]=l,e[91]=i,e[92]=ae):ae=e[92];let Ze;e[93]===Symbol.for("react.memo_cache_sentinel")?(Ze=(0,n.jsx)(n.Fragment,{children:"Base URL for your OpenAI-compatible provider."}),e[93]=Ze):Ze=e[93];let Ne;e[94]!==l||e[95]!==i?(Ne=(0,n.jsx)(Ye,{form:i,config:l,name:"ai.open_ai_compatible.base_url",placeholder:"https://api.together.xyz/v1",testId:"ai-openai-compatible-base-url-input",description:Ze}),e[94]=l,e[95]=i,e[96]=Ne):Ne=e[96];let $e;e[97]!==De||e[98]!==ae||e[99]!==Ne?($e=(0,n.jsxs)(Be,{title:"OpenAI-Compatible (Legacy)",provider:"openai-compatible",isConfigured:De,children:[ke,ae,Ne]}),e[97]=De,e[98]=ae,e[99]=Ne,e[100]=$e):$e=e[100];let Ie;e[101]!==_||e[102]!==y||e[103]!==B||e[104]!==T||e[105]!==q||e[106]!==he||e[107]!==Q||e[108]!==ue||e[109]!==me||e[110]!==$e||e[111]!==j?(Ie=(0,n.jsxs)(an,{type:"multiple",children:[j,_,y,B,T,q,he,Q,ue,me,$e]}),e[101]=_,e[102]=y,e[103]=B,e[104]=T,e[105]=q,e[106]=he,e[107]=Q,e[108]=ue,e[109]=me,e[110]=$e,e[111]=j,e[112]=Ie):Ie=e[112];let Fe;e[113]!==l||e[114]!==i||e[115]!==s?(Fe=(0,n.jsx)(Lu,{form:i,config:l,onSubmit:s}),e[113]=l,e[114]=i,e[115]=s,e[116]=Fe):Fe=e[116];let we;return e[117]!==Ie||e[118]!==Fe?(we=(0,n.jsxs)(ht,{children:[u,Ie,Fe]}),e[117]=Ie,e[118]=Fe,e[119]=we):we=e[119],we},Hu=t=>{var b;let e=(0,ve.c)(29),{form:i,config:l,onSubmit:s}=t,[a,o]=(0,h.useState)(((b=l.ai)==null?void 0:b.max_tokens)!=null),c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=(0,n.jsx)(pt,{children:"AI Assistant"}),e[0]=c):c=e[0];let r;e[1]===i.control?r=e[2]:(r=(0,n.jsx)(dt,{control:i.control,name:"ai.inline_tooltip",render:t0}),e[1]=i.control,e[2]=r);let d;e[3]!==i||e[4]!==a||e[5]!==s?(d=_=>{let{field:S}=_;return(0,n.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,n.jsxs)("div",{className:"flex items-center gap-x-2",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{className:"font-normal",children:"Max output tokens"}),(0,n.jsx)(V,{children:(0,n.jsx)(ze,{"data-testid":"ai-max-tokens-input",type:"number",min:1,disabled:!a,className:"w-28 h-6",value:S.value??(a?"":32768),onChange:f=>{let m=Number.parseInt(f.target.value,10);S.onChange(Number.isFinite(m)&&m>0?m:null)}})})]}),(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(ee,{"data-testid":"ai-max-tokens-checkbox",checked:a,onCheckedChange:f=>{let m=f===!0;o(m);let y=m?S.value??32768:null;i.setValue("ai.max_tokens",y,{shouldDirty:!0,shouldTouch:!0}),s(i.getValues())}}),(0,n.jsx)(z,{className:"font-normal",children:"Override"})]})]}),(0,n.jsx)(H,{children:"Each provider sets its own max output tokens (Anthropic uses a recommended default). Adjust to control costs or enable more output."})]})},e[3]=i,e[4]=a,e[5]=s,e[6]=d):d=e[6];let u;e[7]!==i.control||e[8]!==d?(u=(0,n.jsx)(dt,{control:i.control,name:"ai.max_tokens",render:d}),e[7]=i.control,e[8]=d,e[9]=u):u=e[9];let p;e[10]===Symbol.for("react.memo_cache_sentinel")?(p=(0,n.jsx)(vr,{}),e[10]=p):p=e[10];let g;e[11]===Symbol.for("react.memo_cache_sentinel")?(g=(0,n.jsx)("span",{children:"Model to use for chat conversations in the Chat panel."}),e[11]=g):g=e[11];let x;e[12]!==l||e[13]!==i||e[14]!==s?(x=(0,n.jsx)(Oi,{label:"Chat Model",form:i,config:l,name:"ai.models.chat_model",placeholder:ln,description:g,forRole:"chat",onSubmit:s}),e[12]=l,e[13]=i,e[14]=s,e[15]=x):x=e[15];let v;e[16]===Symbol.for("react.memo_cache_sentinel")?(v=(0,n.jsxs)("span",{children:["Model to use for code editing with the"," ",(0,n.jsx)(pe,{className:"inline",children:"Generate with AI"})," button."]}),e[16]=v):v=e[16];let j;e[17]!==l||e[18]!==i||e[19]!==s?(j=(0,n.jsx)(Oi,{label:"Edit Model",form:i,config:l,name:"ai.models.edit_model",placeholder:ln,description:v,forRole:"edit",onSubmit:s}),e[17]=l,e[18]=i,e[19]=s,e[20]=j):j=e[20];let C;e[21]===i.control?C=e[22]:(C=(0,n.jsx)($,{control:i.control,name:"ai.rules",render:i0}),e[21]=i.control,e[22]=C);let I;return e[23]!==C||e[24]!==r||e[25]!==u||e[26]!==x||e[27]!==j?(I=(0,n.jsxs)(ht,{children:[c,r,u,p,x,j,C]}),e[23]=C,e[24]=r,e[25]=u,e[26]=x,e[27]=j,e[28]=I):I=e[28],I};var Uu=t=>{let e=(0,ve.c)(51),{providerId:i,models:l,enabledModels:s,onToggleModel:a,onToggleProvider:o,onDeleteModel:c}=t,r;if(e[0]!==s||e[1]!==l||e[2]!==i){let w;e[4]!==s||e[5]!==i?(w=K=>s.has(new Ke(i,K.model).id),e[4]=s,e[5]=i,e[6]=w):w=e[6],r=l.filter(w),e[0]=s,e[1]=l,e[2]=i,e[3]=r}else r=e[3];let d=r.length,u=l.length,p;e[7]===i?p=e[8]:(p=St.getProviderInfo(i),e[7]=i,e[8]=p);let g=p,x;e[9]!==(g==null?void 0:g.name)||e[10]!==i?(x=(g==null?void 0:g.name)||di.startCase(i),e[9]=g==null?void 0:g.name,e[10]=i,e[11]=x):x=e[11];let v=x,j=d===0?!1:d===u?!0:"indeterminate",C;e[12]!==d||e[13]!==o||e[14]!==i||e[15]!==u?(C=()=>{o(i,d<u/2)},e[12]=d,e[13]=o,e[14]=i,e[15]=u,e[16]=C):C=e[16];let I=Dt(C),b;e[17]===Symbol.for("react.memo_cache_sentinel")?(b=mn.stopPropagation(),e[17]=b):b=e[17];let _;e[18]!==j||e[19]!==I?(_=(0,n.jsx)(ee,{checked:j,onCheckedChange:I,onClick:b}),e[18]=j,e[19]=I,e[20]=_):_=e[20];let S;e[21]===i?S=e[22]:(S=(0,n.jsx)(Ee,{provider:i,className:"h-5 w-5"}),e[21]=i,e[22]=S);let f;e[23]===v?f=e[24]:(f=(0,n.jsx)("h2",{className:"font-semibold",children:v}),e[23]=v,e[24]=f);let m;e[25]!==d||e[26]!==u?(m=(0,n.jsxs)("p",{className:"text-sm text-muted-secondary",children:[d,"/",u," models"]}),e[25]=d,e[26]=u,e[27]=m):m=e[27];let y;e[28]!==f||e[29]!==m?(y=(0,n.jsxs)("div",{className:"flex items-center justify-between w-full",children:[f,m]}),e[28]=f,e[29]=m,e[30]=y):y=e[30];let P;e[31]===Symbol.for("react.memo_cache_sentinel")?(P=(0,n.jsx)(pr,{slot:"chevron",children:(0,n.jsx)(sr,{className:"h-4 w-4 text-muted-foreground shrink-0 transition-transform duration-200 group-data-expanded:rotate-90"})}),e[31]=P):P=e[31];let A;e[32]!==y||e[33]!==_||e[34]!==S?(A=(0,n.jsx)(Hs,{children:(0,n.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:[_,S,y,P]})}),e[32]=y,e[33]=_,e[34]=S,e[35]=A):A=e[35];let B;if(e[36]!==s||e[37]!==l||e[38]!==c||e[39]!==a||e[40]!==i){let w;e[42]!==s||e[43]!==c||e[44]!==a||e[45]!==i?(w=K=>{let k=new Ke(i,K.model).id;return(0,n.jsx)(Vu,{qualifiedId:k,model:K,isEnabled:s.has(k),onToggle:a,onDelete:c},k)},e[42]=s,e[43]=c,e[44]=a,e[45]=i,e[46]=w):w=e[46],B=l.map(w),e[36]=s,e[37]=l,e[38]=c,e[39]=a,e[40]=i,e[41]=B}else B=e[41];let M;return e[47]!==i||e[48]!==A||e[49]!==B?(M=(0,n.jsxs)(Ws,{id:i,hasChildItems:!0,textValue:i,className:"outline-hidden data-focused:bg-muted/50 group",children:[A,B]}),e[47]=i,e[48]=A,e[49]=B,e[50]=M):M=e[50],M};const qu=({form:t,onSubmit:e})=>{let i=bt({control:t.control,name:"ai.models.custom_models"}),l=bt({control:t.control,name:"ai.custom_providers"}),s=(0,h.useMemo)(()=>Object.keys(l||{}),[l]),a=(0,h.useMemo)(()=>St.create({displayedModels:[],customModels:i}),[i]),o=bt({control:t.control,name:"ai.models.displayed_models",defaultValue:[]}),c=new Set(o),r=a.getGroupedModelsByProvider(),d=a.getListModelsByProvider(),u=Dt(x=>{let v=c.has(x)?o.filter(j=>j!==x):[...o,x];t.setValue("ai.models.displayed_models",v,{shouldDirty:!0,shouldTouch:!0}),e(t.getValues())}),p=Dt(async(x,v)=>{let j=r.get(x)||[],C=new Set(j.map(b=>new Ke(x,b.model).id)),I=v?[...new Set([...o,...C])]:o.filter(b=>!C.has(b));t.setValue("ai.models.displayed_models",I,{shouldDirty:!0,shouldTouch:!0}),e(t.getValues())}),g=Dt(x=>{let v=i.filter(C=>C!==x),j=o.filter(C=>C!==x);t.setValue("ai.models.displayed_models",j,{shouldDirty:!0,shouldTouch:!0}),t.setValue("ai.models.custom_models",v,{shouldDirty:!0,shouldTouch:!0}),e(t.getValues())});return(0,n.jsxs)(ht,{className:"gap-2",children:[(0,n.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."}),(0,n.jsx)("div",{className:"bg-background",children:(0,n.jsx)(ud,{"aria-label":"AI Models by Provider",className:"flex-1 overflow-auto outline-hidden focus-visible:outline-hidden",selectionMode:"none",children:d.map(([x,v])=>(0,n.jsx)(Uu,{providerId:x,models:v,enabledModels:c,onToggleModel:u,onToggleProvider:p,onDeleteModel:g},x))})}),(0,n.jsx)(Wu,{form:t,customModels:i,customProviderNames:s,onSubmit:e})]})},Wu=t=>{let e=(0,ve.c)(77),{form:i,customModels:l,customProviderNames:s,onSubmit:a}=t,[o,c]=(0,h.useState)(!1),[r,d]=(0,h.useState)(!1),[u,p]=(0,h.useState)(null),[g,x]=(0,h.useState)(""),[v,j]=(0,h.useState)(""),C=(0,h.useId)(),I=(0,h.useId)(),b=(0,h.useId)(),_=u==="custom",S=_?g:u,f;e[0]!==v||e[1]!==S?(f=(S==null?void 0:S.trim())&&(v==null?void 0:v.trim()),e[0]=v,e[1]=S,e[2]=f):f=e[2];let m=f,y;e[3]===Symbol.for("react.memo_cache_sentinel")?(y=()=>{p(null),x(""),j(""),c(!1)},e[3]=y):y=e[3];let P=y,A;e[4]!==l||e[5]!==i||e[6]!==m||e[7]!==v||e[8]!==a||e[9]!==S?(A=()=>{if(!m)return;let ae=new Ke(S,v);i.setValue("ai.models.custom_models",[ae.id,...l],{shouldDirty:!0,shouldTouch:!0}),a(i.getValues()),P(),d(!0),setTimeout(()=>d(!1),2e3)},e[4]=l,e[5]=i,e[6]=m,e[7]=v,e[8]=a,e[9]=S,e[10]=A):A=e[10];let B=A,M;e[11]===C?M=e[12]:(M=(0,n.jsx)(Le,{htmlFor:C,className:"text-sm font-medium text-muted-foreground min-w-12",children:"Provider"}),e[11]=C,e[12]=M);let w=u||"",K;e[13]===Symbol.for("react.memo_cache_sentinel")?(K=ae=>p(ae),e[13]=K):K=e[13];let k;e[14]===u?k=e[15]:(k=u?(0,n.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,n.jsx)(Ee,{provider:u,className:"h-3.5 w-3.5"}),(0,n.jsx)("span",{children:li(u)})]}):(0,n.jsx)("span",{className:"text-muted-foreground",children:"Select..."}),e[14]=u,e[15]=k);let D;e[16]!==C||e[17]!==k?(D=(0,n.jsx)(Eo,{id:C,className:"w-40 truncate",children:k}),e[16]=C,e[17]=k,e[18]=D):D=e[18];let T;e[19]===s?T=e[20]:(T=s.length>0&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("p",{className:"px-2 py-1 text-xs text-muted-secondary font-medium",children:"Custom Providers"}),s.map(n0),(0,n.jsx)("p",{className:"px-2 py-1 text-xs text-muted-secondary font-medium mt-1",children:"Built-in Providers"})]}),e[19]=s,e[20]=T);let F;e[21]===s?F=e[22]:(F=Yt.filter(ae=>ae!=="marimo"&&!s.includes(ae)).map(l0),e[21]=s,e[22]=F);let U;e[23]===Symbol.for("react.memo_cache_sentinel")?(U=(0,n.jsx)("p",{className:"px-2 py-1 text-xs text-muted-secondary font-medium mt-1",children:"Other"}),e[23]=U):U=e[23];let W;e[24]===Symbol.for("react.memo_cache_sentinel")?(W=(0,n.jsx)(ci,{value:"custom",children:(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(Ee,{provider:"openai-compatible",className:"h-4 w-4"}),(0,n.jsx)("span",{children:"Enter provider name"})]})}),e[24]=W):W=e[24];let N;e[25]!==F||e[26]!==T?(N=(0,n.jsx)(Ao,{children:(0,n.jsxs)(Po,{children:[T,F,U,W]})}),e[25]=F,e[26]=T,e[27]=N):N=e[27];let q;e[28]!==N||e[29]!==w||e[30]!==D?(q=(0,n.jsxs)(To,{value:w,onValueChange:K,children:[D,N]}),e[28]=N,e[29]=w,e[30]=D,e[31]=q):q=e[31];let ie;e[32]!==q||e[33]!==M?(ie=(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[M,q]}),e[32]=q,e[33]=M,e[34]=ie):ie=e[34];let ce;e[35]!==I||e[36]!==g||e[37]!==_?(ce=_&&(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(Le,{htmlFor:I,className:"text-sm font-medium text-muted-foreground min-w-12",children:"Name"}),(0,n.jsx)(ze,{id:I,value:g,onChange:ae=>x(ae.target.value),placeholder:"openrouter",className:"w-40 truncate"})]}),e[35]=I,e[36]=g,e[37]=_,e[38]=ce):ce=e[38];let de;e[39]!==ie||e[40]!==ce?(de=(0,n.jsxs)("div",{className:"flex flex-col gap-2",children:[ie,ce]}),e[39]=ie,e[40]=ce,e[41]=de):de=e[41];let fe=de,he=_&&"self-start",xe;e[42]===he?xe=e[43]:(xe=Pe("flex items-center gap-2",he),e[42]=he,e[43]=xe);let E;e[44]===b?E=e[45]:(E=(0,n.jsx)(Le,{htmlFor:b,className:"text-sm font-medium text-muted-foreground",children:"Model"}),e[44]=b,e[45]=E);let X;e[46]===Symbol.for("react.memo_cache_sentinel")?(X=ae=>j(ae.target.value),e[46]=X):X=e[46];let Y;e[47]!==v||e[48]!==b?(Y=(0,n.jsx)(ze,{id:b,value:v,onChange:X,placeholder:"gpt-4",className:"text-xs mb-0"}),e[47]=v,e[48]=b,e[49]=Y):Y=e[49];let Q;e[50]!==xe||e[51]!==E||e[52]!==Y?(Q=(0,n.jsxs)("div",{className:xe,children:[E,Y]}),e[50]=xe,e[51]=E,e[52]=Y,e[53]=Q):Q=e[53];let J=Q,ne=_&&"self-end",le;e[54]===ne?le=e[55]:(le=Pe("flex gap-1.5 ml-auto",ne),e[54]=ne,e[55]=le);let ye=!m,ue;e[56]!==B||e[57]!==ye?(ue=(0,n.jsx)(se,{onClick:B,disabled:ye,size:"xs",children:"Add"}),e[56]=B,e[57]=ye,e[58]=ue):ue=e[58];let je;e[59]===Symbol.for("react.memo_cache_sentinel")?(je=(0,n.jsx)(se,{variant:"outline",onClick:P,size:"xs",children:"Cancel"}),e[59]=je):je=e[59];let _e;e[60]!==le||e[61]!==ue?(_e=(0,n.jsxs)("div",{className:le,children:[ue,je]}),e[60]=le,e[61]=ue,e[62]=_e):_e=e[62];let ge;e[63]!==J||e[64]!==fe||e[65]!==_e?(ge=(0,n.jsxs)("div",{className:"flex items-center gap-3 p-3 border border-border rounded-md",children:[fe,J,_e]}),e[63]=J,e[64]=fe,e[65]=_e,e[66]=ge):ge=e[66];let be=o&&ge,me;e[67]===o?me=e[68]:(me=(0,n.jsx)(Ka,{isFormOpen:o,setIsFormOpen:c,label:"Add Model",className:"pl-2"}),e[67]=o,e[68]=me);let De;e[69]===r?De=e[70]:(De=r&&(0,n.jsx)("div",{className:"flex items-center gap-1 text-green-700 bg-green-500/10 px-2 py-1 rounded-md ml-auto",children:"\u2713 Model added"}),e[69]=r,e[70]=De);let ke;e[71]!==me||e[72]!==De?(ke=(0,n.jsxs)("div",{className:"flex flex-row text-sm",children:[me,De]}),e[71]=me,e[72]=De,e[73]=ke):ke=e[73];let Se;return e[74]!==be||e[75]!==ke?(Se=(0,n.jsxs)("div",{children:[be,ke]}),e[74]=be,e[75]=ke,e[76]=Se):Se=e[76],Se};var Ka=t=>{let e=(0,ve.c)(10),{isFormOpen:i,setIsFormOpen:l,label:s,className:a}=t,o;e[0]===l?o=e[1]:(o=u=>{u.stopPropagation(),u.preventDefault(),l(!0)},e[0]=l,e[1]=o);let c;e[2]===a?c=e[3]:(c=Pe("px-0",a),e[2]=a,e[3]=c);let r;e[4]===Symbol.for("react.memo_cache_sentinel")?(r=(0,n.jsx)(rr,{className:"h-4 w-4 mr-2 mb-0.5"}),e[4]=r):r=e[4];let d;return e[5]!==i||e[6]!==s||e[7]!==o||e[8]!==c?(d=(0,n.jsxs)(se,{onClick:o,variant:"link",disabled:i,className:c,children:[r,s]}),e[5]=i,e[6]=s,e[7]=o,e[8]=c,e[9]=d):d=e[9],d},Qu=t=>{let e=(0,ve.c)(2),{form:i}=t,l;return e[0]===i.control?l=e[1]:(l=(0,n.jsx)(ht,{children:(0,n.jsx)($,{control:i.control,name:"ai.enabled",render:s0})}),e[0]=i.control,e[1]=l),l};const Yu=t=>{let e=(0,ve.c)(38),{form:i,config:l,onSubmit:s}=t,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=ct(),e[0]=a):a=e[0];let o=a,[c,r]=rt(Ta),d=Mt(),u;e[1]===i.control?u=e[2]:(u={control:i.control,name:"ai.enabled"},e[1]=i.control,e[2]=u);let p=bt(u),g;e[3]!==d||e[4]!==p?(g=d("ai.enabled",p),e[3]=d,e[4]=p,e[5]=g):g=e[5];let{value:x}=g,v=x===!1&&c!=="ai-features"?"ai-features":c,j;e[6]===r?j=e[7]:(j=A=>r(A),e[6]=r,e[7]=j);let C;e[8]===Symbol.for("react.memo_cache_sentinel")?(C=(0,n.jsx)(xt,{value:"ai-features",children:"AI Features"}),e[8]=C):C=e[8];let I;e[9]===x?I=e[10]:(I=x!==!1&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(xt,{value:"ai-providers",children:"AI Providers"}),(0,n.jsx)(xt,{value:"ai-models",children:"AI Models"}),!o&&(0,n.jsx)(xt,{value:"mcp",children:"MCP"})]}),e[9]=x,e[10]=I);let b;e[11]===I?b=e[12]:(b=(0,n.jsxs)(rn,{className:"mb-2",children:[C,I]}),e[11]=I,e[12]=b);let _,S;e[13]!==l||e[14]!==i||e[15]!==s?(_=(0,n.jsx)($u,{form:i,config:l,onSubmit:s}),S=(0,n.jsx)(Qu,{form:i,config:l,onSubmit:s}),e[13]=l,e[14]=i,e[15]=s,e[16]=_,e[17]=S):(_=e[16],S=e[17]);let f;e[18]!==x||e[19]!==l||e[20]!==i||e[21]!==s?(f=x!==!1&&(0,n.jsx)(Hu,{form:i,config:l,onSubmit:s}),e[18]=x,e[19]=l,e[20]=i,e[21]=s,e[22]=f):f=e[22];let m;e[23]!==f||e[24]!==_||e[25]!==S?(m=(0,n.jsxs)(Tt,{value:"ai-features",children:[_,S,f]}),e[23]=f,e[24]=_,e[25]=S,e[26]=m):m=e[26];let y;e[27]!==x||e[28]!==l||e[29]!==i||e[30]!==s?(y=x!==!1&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Tt,{value:"ai-providers",children:(0,n.jsx)(Gu,{form:i,config:l,onSubmit:s})}),(0,n.jsx)(Tt,{value:"ai-models",children:(0,n.jsx)(qu,{form:i,config:l,onSubmit:s})}),!o&&(0,n.jsx)(Tt,{value:"mcp",children:(0,n.jsx)(Tu,{form:i,onSubmit:s})})]}),e[27]=x,e[28]=l,e[29]=i,e[30]=s,e[31]=y):y=e[31];let P;return e[32]!==v||e[33]!==m||e[34]!==y||e[35]!==j||e[36]!==b?(P=(0,n.jsxs)(on,{value:v,onValueChange:j,className:"flex-1",children:[b,m,y]}),e[32]=v,e[33]=m,e[34]=y,e[35]=j,e[36]=b,e[37]=P):P=e[37],P};function Zu(t){return(0,n.jsx)("option",{value:t,children:t},t)}function Xu(t){return(0,n.jsx)("option",{value:t,children:t},t)}function Ju(t){let{field:e,override:i}=t;return(0,n.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{children:"AWS Region"}),(0,n.jsx)(V,{children:(0,n.jsx)(Me,{"data-testid":"bedrock-region-select",onChange:l=>e.onChange(l.target.value),value:typeof i.value=="string"?i.value:"us-east-1",disabled:e.disabled||i.isOverridden,className:"inline-flex mr-2",children:Cu.map(Xu)})}),(0,n.jsx)(G,{}),(0,n.jsx)(L,{override:i})]}),(0,n.jsx)(H,{children:"The AWS region where Bedrock service is available."})]})}function e0(t){let{field:e,override:i}=t;return(0,n.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{children:"AWS Profile Name (Optional)"}),(0,n.jsx)(V,{children:(0,n.jsx)(ze,{"data-testid":"bedrock-profile-input",rootClassName:"flex-1",className:"m-0 inline-flex h-7",placeholder:"default",...e,value:i.value||"",disabled:e.disabled||i.isOverridden})}),(0,n.jsx)(G,{}),(0,n.jsx)(L,{override:i})]}),(0,n.jsx)(H,{children:"The AWS profile name from your ~/.aws/credentials file. Leave blank to use your default AWS credentials."})]})}function t0(t){let{field:e}=t;return(0,n.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{className:"font-normal",children:"AI Edit Tooltip"}),(0,n.jsx)(V,{children:(0,n.jsx)(ee,{"data-testid":"inline-ai-checkbox",checked:e.value===!0,onCheckedChange:e.onChange})})]}),(0,n.jsx)(H,{children:'Enable "Edit with AI" tooltip when selecting code.'})]})}function i0(t){let{field:e,override:i}=t;return(0,n.jsxs)("div",{className:"flex flex-col",children:[(0,n.jsxs)(O,{children:[(0,n.jsx)(z,{children:"Custom Rules"}),(0,n.jsx)(V,{children:(0,n.jsx)(Xr,{"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",...e,value:i.value,disabled:i.isOverridden})}),(0,n.jsx)(G,{}),(0,n.jsx)(L,{override:i})]}),(0,n.jsx)(H,{children:"Custom rules to include in all AI completion prompts."})]})}function n0(t){return(0,n.jsx)(ci,{value:t,children:(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(Ee,{provider:t,className:"h-4 w-4"}),(0,n.jsx)("span",{children:di.startCase(t)})]})},t)}function l0(t){return(0,n.jsx)(ci,{value:t,children:(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(Ee,{provider:t,className:"h-4 w-4"}),(0,n.jsx)("span",{children:li(t)})]})},t)}function s0(t){let{field:e,override:i}=t;return(0,n.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{className:"font-normal",children:"Enable AI features"}),(0,n.jsx)(V,{children:(0,n.jsx)(ee,{"data-testid":"ai-enabled-checkbox",checked:i.value!==!1,disabled:i.isOverridden,onCheckedChange:l=>e.onChange(l===!0)})}),(0,n.jsx)(L,{override:i})]}),(0,n.jsx)(H,{children:"When disabled, AI actions and panels are hidden from the marimo UI."})]})}var a0=Ce(),o0=["auto","true","false"];const r0=t=>{let e=(0,a0.c)(34),{form:i,onSubmit:l}=t,s;e[0]===i.control?s=e[1]:(s=(S,f)=>(0,n.jsx)($,{control:i.control,name:S,render:m=>{let{field:y,override:P}=m,A=B=>{let M=B.target.value;y.onChange(M==="true"?!0:M==="false"?!1:M)};return(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{className:"text-sm font-normal w-16",children:f}),(0,n.jsx)(V,{children:(0,n.jsx)(Me,{"data-testid":"auto-discover-schemas-select",onChange:A,value:P.value===void 0?"auto":P.value.toString(),disabled:y.disabled||P.isOverridden,className:"w-[100px]",children:o0.map(c0)})}),(0,n.jsx)(L,{override:P})]})}}),e[0]=i.control,e[1]=s);let a=s,o;e[2]===i.control?o=e[3]:(o=(0,n.jsx)($,{control:i.control,name:"display.dataframes",render:u0}),e[2]=i.control,e[3]=o);let c;e[4]!==i||e[5]!==l?(c=S=>{let{field:f,override:m}=S;return(0,n.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{children:"Default table page size"}),(0,n.jsx)(V,{children:(0,n.jsx)(yt,{"aria-label":"Default table page size","data-testid":"default-table-page-size-input",className:"m-0 w-24",...f,value:m.value,isDisabled:m.isOverridden,minValue:1,step:1,onChange:y=>{f.onChange(y),Number.isNaN(y)||l(i.getValues())}})}),(0,n.jsx)(G,{}),(0,n.jsx)(L,{override:m})]}),(0,n.jsx)(H,{children:"The default number of rows displayed in dataframes and SQL results."})]})},e[4]=i,e[5]=l,e[6]=c):c=e[6];let r;e[7]!==i.control||e[8]!==c?(r=(0,n.jsx)($,{control:i.control,name:"display.default_table_page_size",render:c}),e[7]=i.control,e[8]=c,e[9]=r):r=e[9];let d;e[10]!==i||e[11]!==l?(d=S=>{let{field:f,override:m}=S;return(0,n.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{children:"Default table max columns"}),(0,n.jsx)(V,{children:(0,n.jsx)(yt,{"aria-label":"Default table max columns","data-testid":"default-table-max-columns-input",className:"m-0 w-24",...f,value:m.value,isDisabled:m.isOverridden,minValue:1,step:1,onChange:y=>{f.onChange(y),Number.isNaN(y)||l(i.getValues())}})}),(0,n.jsx)(G,{}),(0,n.jsx)(L,{override:m})]}),(0,n.jsx)(H,{children:"The default maximum number of columns displayed in dataframes and SQL results."})]})},e[10]=i,e[11]=l,e[12]=d):d=e[12];let u;e[13]!==i.control||e[14]!==d?(u=(0,n.jsx)($,{control:i.control,name:"display.default_table_max_columns",render:d}),e[13]=i.control,e[14]=d,e[15]=u):u=e[15];let p;e[16]===Symbol.for("react.memo_cache_sentinel")?(p=(0,n.jsx)("div",{className:"text-sm text-foreground",children:"Database Schema Discovery"}),e[16]=p):p=e[16];let g,x;e[17]===Symbol.for("react.memo_cache_sentinel")?(g=(0,n.jsx)("br",{}),x=(0,n.jsx)("span",{className:"font-semibold",children:"Can be expensive for large databases."}),e[17]=g,e[18]=x):(g=e[17],x=e[18]);let v;e[19]===Symbol.for("react.memo_cache_sentinel")?(v=(0,n.jsxs)("div",{className:"text-sm text-muted-foreground mb-2",children:["Whether database schemas, tables, and columns are automatically discovered.",g,x," ","Use 'auto' to determine introspection based on the"," ",(0,n.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"}),"."]}),e[19]=v):v=e[19];let j;e[20]===a?j=e[21]:(j=(0,n.jsxs)("div",{className:"flex flex-col gap-1",children:[p,v,a("datasources.auto_discover_schemas","Schemas"),a("datasources.auto_discover_tables","Tables"),a("datasources.auto_discover_columns","Columns")]}),e[20]=a,e[21]=j);let C,I;e[22]===i.control?(C=e[23],I=e[24]):(C=(0,n.jsx)($,{control:i.control,name:"diagnostics.sql_linter",render:m0}),I=(0,n.jsx)($,{control:i.control,name:"runtime.default_sql_output",render:h0}),e[22]=i.control,e[23]=C,e[24]=I);let b;e[25]!==j||e[26]!==C||e[27]!==I?(b=(0,n.jsxs)(Te,{title:"SQL",children:[j,C,I]}),e[25]=j,e[26]=C,e[27]=I,e[28]=b):b=e[28];let _;return e[29]!==b||e[30]!==o||e[31]!==r||e[32]!==u?(_=(0,n.jsxs)(n.Fragment,{children:[o,r,u,b]}),e[29]=b,e[30]=o,e[31]=r,e[32]=u,e[33]=_):_=e[33],_};function c0(t){return(0,n.jsx)("option",{value:t,children:t},t)}function d0(t){return(0,n.jsx)("option",{value:t,children:t},t)}function u0(t){let{field:e,override:i}=t;return(0,n.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{children:"Dataframe viewer"}),(0,n.jsx)(V,{children:(0,n.jsx)(Me,{"data-testid":"display-dataframes-select",onChange:l=>e.onChange(l.target.value),value:i.value,disabled:e.disabled||i.isOverridden,className:"inline-flex mr-2",children:["rich","plain"].map(d0)})}),(0,n.jsx)(G,{}),(0,n.jsx)(L,{override:i})]}),(0,n.jsx)(H,{children:"Whether to use marimo's rich dataframe viewer or a plain HTML table. This requires restarting your notebook to take effect."})]})}function m0(t){let{field:e,override:i}=t;return(0,n.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{children:"SQL Linter"}),(0,n.jsx)(V,{children:(0,n.jsx)(ee,{"data-testid":"sql-linter-checkbox",checked:i.value,disabled:i.isOverridden,onCheckedChange:e.onChange})}),(0,n.jsx)(G,{}),(0,n.jsx)(L,{override:i})]}),(0,n.jsx)(H,{children:"Better linting and autocompletions for SQL cells."})]})}function p0(t){return(0,n.jsx)("option",{value:t.value,children:t.label},t.value)}function h0(t){let{field:e,override:i}=t;return(0,n.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{children:"Default SQL output"}),(0,n.jsx)(V,{children:(0,n.jsx)(Me,{"data-testid":"user-config-sql-output-select",onChange:l=>e.onChange(l.target.value),value:i.value,disabled:e.disabled||i.isOverridden,className:"inline-flex mr-2",children:Ca.map(p0)})}),(0,n.jsx)(G,{}),(0,n.jsx)(L,{override:i})]}),(0,n.jsx)(H,{children:'The default SQL output type for new notebooks; overridden by "sql_output" in the application config.'})]})}function Vi(t,e){let i={};for(let l of Object.keys(e)){let s=e[l],a=t[l];if(a!==void 0){if(s===!0)i[l]=a;else if(typeof s=="object"&&s){let o=Vi(a,s);Object.keys(o).length>0&&(i[l]=o)}}}return i}var Da=(t,e)=>{var i,l,s,a,o;e.ai={...e.ai,models:{...(i=e.ai)==null?void 0:i.models,displayed_models:((s=(l=t.ai)==null?void 0:l.models)==null?void 0:s.displayed_models)??[],custom_models:((o=(a=t.ai)==null?void 0:a.models)==null?void 0:o.custom_models)??[]}}},g0=[["ai.models.displayed_models",Da],["ai.models.custom_models",Da]],f0=new Map(g0),x0=(t,e)=>{if(!t)return!1;let i=t;for(let l of e.split(".")){if(typeof i!="object"||!i)return!1;i=i[l]}return i===!0};const y0=t=>{let{values:e,dirtyValues:i,touchedFields:l}=t;for(let[s,a]of f0)x0(l,s)&&a(e,i)};var v0=Ce(),Aa=[{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:[ct()?{name:"black"}:{name:"ruff"}],additionalPackageInstalls:[],description:"Formatting"},{id:"ai",packagesRequired:[{name:"openai"}],additionalPackageInstalls:[],description:"AI features"},{id:"mcp",packagesRequired:[{name:"mcp",minVersion:"1"}],additionalPackageInstalls:[{name:"pydantic",minVersion:"2"}],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"}];ct()||Aa.push({id:"lsp",packagesRequired:[{name:"python-lsp-server"},{name:"websockets"}],additionalPackageInstalls:[{name:"python-lsp-ruff"}],description:"Language Server Protocol*"});const b0=()=>{let t=(0,v0.c)(21),[e]=tn(),i=e.package_management.manager,{getPackageList:l}=Ft(),s;t[0]===l?s=t[1]:(s=()=>l(),t[0]=l,t[1]=s);let a;t[2]===i?a=t[3]:(a=[i],t[2]=i,t[3]=a);let{data:o,error:c,refetch:r,isPending:d}=Fn(s,a);if(d){let _;return t[4]===Symbol.for("react.memo_cache_sentinel")?(_=(0,n.jsx)(bn,{size:"medium",centered:!0}),t[4]=_):_=t[4],_}if(c){let _;return t[5]===c?_=t[6]:(_=(0,n.jsx)(Wr,{error:c}),t[5]=c,t[6]=_),_}let u;if(t[7]!==(o==null?void 0:o.packages)){let _=(o==null?void 0:o.packages)||[];u=new Set(_.map(j0)),t[7]=o==null?void 0:o.packages,t[8]=u}else u=t[8];let p=u,g;t[9]===Symbol.for("react.memo_cache_sentinel")?(g=(0,n.jsx)(pt,{children:"Optional Features"}),t[9]=g):g=t[9];let x;t[10]===Symbol.for("react.memo_cache_sentinel")?(x=(0,n.jsxs)("p",{className:"text-sm text-muted-foreground",children:["marimo is lightweight, with few dependencies, to maximize compatibility with your own environments.",(0,n.jsx)("br",{}),"To unlock additional features in the marimo editor, you can install these optional dependencies:"]}),t[10]=x):x=t[10];let v;t[11]===Symbol.for("react.memo_cache_sentinel")?(v=(0,n.jsx)(Qr,{children:(0,n.jsxs)(zn,{children:[(0,n.jsx)(Ut,{children:"Dependency"}),(0,n.jsx)(Ut,{children:"Feature"}),(0,n.jsx)(Ut,{children:"Status"}),(0,n.jsx)(Ut,{})]})}),t[11]=v):v=t[11];let j;t[12]!==p||t[13]!==i||t[14]!==r?(j=Aa.map(_=>{let S=_.packagesRequired.every(m=>p.has(m.name.split("[")[0])),f=_.packagesRequired.map(w0).join(", ");return(0,n.jsxs)(zn,{className:"text-sm",children:[(0,n.jsx)(vi,{children:_.description}),(0,n.jsx)(vi,{className:"font-mono text-xs",children:f}),(0,n.jsx)(vi,{children:S?(0,n.jsxs)("div",{className:"flex items-center",children:[(0,n.jsx)(On,{className:"h-4 w-4 text-(--grass-10) mr-2"}),(0,n.jsx)("span",{children:"Installed"})]}):(0,n.jsxs)("div",{className:"flex items-center",children:[(0,n.jsx)(io,{className:"h-4 w-4 text-(--red-10) mr-2"}),(0,n.jsx)(k0,{packageSpecs:[..._.packagesRequired,..._.additionalPackageInstalls],packageManager:i,onSuccess:r})]})})]},_.id)}),t[12]=p,t[13]=i,t[14]=r,t[15]=j):j=t[15];let C;t[16]===j?C=t[17]:(C=(0,n.jsxs)(Zr,{children:[v,(0,n.jsx)(Yr,{children:j})]}),t[16]=j,t[17]=C);let I;t[18]===Symbol.for("react.memo_cache_sentinel")?(I=(0,n.jsx)("p",{className:"text-muted-foreground mt-2",children:"*Requires server restart"}),t[18]=I):I=t[18];let b;return t[19]===C?b=t[20]:(b=(0,n.jsxs)("div",{className:"flex-1 flex flex-col overflow-hidden gap-2",children:[g,x,C,I]}),t[19]=C,t[20]=b),b};var k0=({packageSpecs:t,packageManager:e,onSuccess:i})=>{let[l,s]=h.useState(!1),{addPackage:a}=Ft();return(0,n.jsxs)(se,{size:"xs",variant:"outline",className:Pe("text-xs",l&&"opacity-50 cursor-not-allowed"),onClick:async()=>{try{s(!0);let o=await a({package:t.map(c=>c.minVersion?`${c.name}>=${c.minVersion}`:c.name).join(" "),group:"dev"});o.success?(i(),Oe({title:"Package installed",description:(0,n.jsxs)("span",{children:["The packages"," ",(0,n.jsx)(pe,{className:"inline",children:t.map(c=>c.name).join(", ")})," ","have been added to your environment."]})})):Oe({title:"Failed to install package",description:o.error,variant:"danger"})}finally{s(!1)}},disabled:l,children:[l?(0,n.jsx)(bn,{size:"small",className:"mr-2 h-3 w-3"}):(0,n.jsx)(qa,{className:"mr-2 h-3 w-3"}),"Install with ",e]})};function j0(t){return t.name}function w0(t){return t.name}var Pa=[{id:"editor",label:"Editor",Icon:_n,className:"bg-(--blue-4)"},{id:"display",label:"Display",Icon:dc,className:"bg-(--grass-4)"},{id:"packageManagementAndData",label:"Packages & Data",Icon:Qa,className:"bg-(--red-4)"},{id:"runtime",label:"Runtime",Icon:Vn,className:"bg-(--amber-4)"},{id:"ai",label:"AI",Icon:ki,className:"bg-[linear-gradient(45deg,var(--purple-5),var(--cyan-5))]"},{id:"optionalDeps",label:"Optional Dependencies",Icon:Rn,className:"bg-(--orange-4)"},{id:"labs",label:"Labs",Icon:cc,className:"bg-(--slate-4)"}];const Ea=it(Pa[0].id);var C0=100,Ri="__system__";const _0=()=>{let[t,e]=nn(),[i,l]=rt(Zs),s=(0,h.useRef)(null),a=Kt(Fi),[o,c]=rt(Ea),r=nt(to);nt(vo).mode==="home"&&(r={terminal:!0,pylsp:!0,ty:!0,basedpyright:!0,pyrefly:!0});let d=nt(ko),{locale:u}=Ht(),{saveUserConfig:p}=Ft(),g=br({resolver:jr(go),defaultValues:t}),x=(f,m)=>{let{chatModel:y,editModel:P}=Ld(f);return(y||P)&&(m={...m,models:{...m==null?void 0:m.models,...y&&{chat_model:y},...P&&{edit_model:P}}},y&&g.setValue("ai.models.chat_model",y),P&&g.setValue("ai.models.edit_model",P)),m},v=Br(async f=>{let m=Vi(f,g.formState.dirtyFields);y0({values:f,dirtyValues:m,touchedFields:g.formState.touchedFields}),Object.keys(m).length!==0&&(m.ai&&(m.ai=x(f.ai,m.ai)),await p({config:m}),e(y=>ao({},y,m)))},C0),j=ct(),C=Mt(),I=(0,h.useId)(),b=(0,h.useId)(),_=()=>{switch(o){case"editor":return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(Te,{title:"Autosave",children:[(0,n.jsx)($,{control:g.control,name:"save.autosave",render:({field:f,override:m})=>(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{className:"font-normal",children:"Autosave enabled"}),(0,n.jsx)(V,{children:(0,n.jsx)(ee,{"data-testid":"autosave-checkbox",checked:m.value==="after_delay",disabled:f.disabled||m.isOverridden,onCheckedChange:y=>{f.onChange(y?"after_delay":"off")}})}),(0,n.jsx)(G,{}),(0,n.jsx)(L,{override:m})]})}),(0,n.jsx)($,{control:g.control,name:"save.autosave_delay",render:({field:f,override:m})=>{let y=C("save.autosave",g.getValues("save.autosave"));return(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{children:"Autosave delay (seconds)"}),(0,n.jsx)(V,{children:(0,n.jsx)(yt,{"aria-label":"Autosave delay","data-testid":"autosave-delay-input",className:"m-0 w-24",isDisabled:y.value!=="after_delay"||m.isOverridden,...f,value:m.value/1e3,minValue:1,onChange:P=>{f.onChange(P*1e3),Number.isNaN(P)||v(g.getValues())}})}),(0,n.jsx)(G,{}),(0,n.jsx)(L,{override:m})]})}}),(0,n.jsx)($,{control:g.control,name:"runtime.default_auto_download",render:({field:f,override:m})=>(0,n.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{children:"Save cell outputs as"}),(0,n.jsx)(V,{children:(0,n.jsxs)("div",{className:"flex gap-4",children:[(0,n.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,n.jsx)(ee,{id:I,checked:Array.isArray(m.value)&&m.value.includes("html"),disabled:m.isOverridden,onCheckedChange:()=>{let y=Array.isArray(f.value)?f.value:[];f.onChange(vn(y,"html"))}}),(0,n.jsx)(z,{htmlFor:I,children:"HTML"})]}),(0,n.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,n.jsx)(ee,{id:b,checked:Array.isArray(m.value)&&m.value.includes("ipynb"),disabled:m.isOverridden,onCheckedChange:()=>{let y=Array.isArray(f.value)?f.value:[];f.onChange(vn(y,"ipynb"))}}),(0,n.jsx)(z,{htmlFor:b,children:"IPYNB"})]})]})}),(0,n.jsx)(G,{}),(0,n.jsx)(L,{override:m})]}),(0,n.jsxs)(H,{children:["When enabled, marimo will periodically save notebooks in your selected formats (HTML, IPYNB) to a folder named"," ",(0,n.jsx)(pe,{className:"inline",children:"__marimo__"})," next to your notebook file."]})]})})]}),(0,n.jsxs)(Te,{title:"Formatting",children:[(0,n.jsx)($,{control:g.control,name:"save.format_on_save",render:({field:f,override:m})=>(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{className:"font-normal",children:"Format on save"}),(0,n.jsx)(V,{children:(0,n.jsx)(ee,{"data-testid":"format-on-save-checkbox",checked:m.value,disabled:f.disabled||m.isOverridden,onCheckedChange:y=>{f.onChange(y)}})}),(0,n.jsx)(G,{}),(0,n.jsx)(L,{override:m})]})}),(0,n.jsx)($,{control:g.control,name:"formatting.line_length",render:({field:f,override:m})=>(0,n.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{children:"Line length"}),(0,n.jsx)(V,{children:(0,n.jsx)(yt,{"aria-label":"Line length","data-testid":"line-length-input",className:"m-0 w-24",...f,value:m.value,isDisabled:m.isOverridden,minValue:1,maxValue:1e3,onChange:y=>{f.onChange(y),Number.isNaN(y)||v(g.getValues())}})}),(0,n.jsx)(G,{}),(0,n.jsx)(L,{override:m})]}),(0,n.jsx)(H,{children:"Maximum line length when formatting code."})]})})]}),(0,n.jsxs)(Te,{title:"Autocomplete",children:[(0,n.jsx)($,{control:g.control,name:"completion.activate_on_typing",render:({field:f,override:m})=>(0,n.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{className:"font-normal",children:"Autocomplete"}),(0,n.jsx)(V,{children:(0,n.jsx)(ee,{"data-testid":"autocomplete-checkbox",checked:m.value,disabled:f.disabled||m.isOverridden,onCheckedChange:y=>{f.onChange(!!y)}})}),(0,n.jsx)(G,{}),(0,n.jsx)(L,{override:m})]}),(0,n.jsx)(H,{children:"When unchecked, code completion is still available through a hotkey."}),(0,n.jsx)("div",{children:(0,n.jsx)(se,{variant:"link",className:"mb-0 px-0",type:"button",onClick:y=>{y.preventDefault(),y.stopPropagation(),c("ai")},children:"Edit AI autocomplete"})})]})}),(0,n.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{className:"font-normal",children:"Accept suggestion on Enter"}),(0,n.jsx)(V,{children:(0,n.jsx)(ee,{"data-testid":"accept-completion-on-enter-checkbox",checked:i,onCheckedChange:f=>l(!!f)})})]}),(0,n.jsx)(H,{children:"When unchecked, pressing Enter inserts a new line instead of accepting an autocomplete suggestion. Use Tab to accept suggestions."})]}),(0,n.jsx)($,{control:g.control,name:"completion.signature_hint_on_typing",render:({field:f,override:m})=>(0,n.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{className:"font-normal",children:"Signature hints"}),(0,n.jsx)(V,{children:(0,n.jsx)(ee,{"data-testid":"signature-hint-on-type-checkbox",checked:m.value??!1,disabled:f.disabled||m.isOverridden,onCheckedChange:y=>{f.onChange(!!y)}})}),(0,n.jsx)(G,{}),(0,n.jsx)(L,{override:m})]}),(0,n.jsx)(H,{children:"Display signature hints while typing within function calls."})]})}),(0,n.jsx)($,{control:g.control,name:"completion.auto_close_pairs",render:({field:f,override:m})=>(0,n.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{className:"font-normal",children:"Auto-close pairs"}),(0,n.jsx)(V,{children:(0,n.jsx)(ee,{"data-testid":"auto-close-pairs-checkbox",checked:m.value??!0,disabled:f.disabled||m.isOverridden,onCheckedChange:y=>{f.onChange(!!y)}})}),(0,n.jsx)(G,{}),(0,n.jsx)(L,{override:m})]}),(0,n.jsxs)(H,{children:["Automatically insert closing brackets"," ",(0,n.jsx)("code",{className:"text-xs",children:"()"}),","," ",(0,n.jsx)("code",{className:"text-xs",children:"[]"}),","," ",(0,n.jsx)("code",{className:"text-xs",children:"{}"}),", and quotes"," ",(0,n.jsx)("code",{className:"text-xs",children:'""'}),","," ",(0,n.jsx)("code",{className:"text-xs",children:"''"})," when opening one."]})]})})]}),(0,n.jsxs)(Te,{title:"Language Servers",children:[(0,n.jsxs)(H,{children:["See the"," ",(0,n.jsx)(oe,{href:"https://docs.marimo.io/guides/editor_features/language_server/",children:"docs"})," ","for more information about language server support."]}),(0,n.jsxs)(H,{children:[(0,n.jsx)("strong",{children:"Note:"})," When using multiple language servers, different features may conflict."]}),(0,n.jsx)($,{control:g.control,name:"language_servers.pylsp.enabled",render:({field:f,override:m})=>(0,n.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsxs)(z,{children:[(0,n.jsx)(kt,{variant:"defaultOutline",className:"mr-2",children:"Beta"}),"Python Language Server (",(0,n.jsx)(oe,{href:"https://github.com/python-lsp/python-lsp-server",children:"docs"}),")"]}),(0,n.jsx)(V,{children:(0,n.jsx)(ee,{"data-testid":"pylsp-checkbox",checked:m.value,disabled:f.disabled||m.isOverridden,onCheckedChange:y=>{f.onChange(!!y)}})}),(0,n.jsx)(G,{}),(0,n.jsx)(L,{override:m})]}),m.value&&!r.pylsp&&(0,n.jsxs)(wt,{kind:"danger",children:["The Python Language Server is not available in your current environment. Please install"," ",(0,n.jsx)(pe,{className:"inline",children:"python-lsp-server"})," in your environment."]})]})}),(0,n.jsx)($,{control:g.control,name:"language_servers.basedpyright.enabled",render:({field:f,override:m})=>(0,n.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsxs)(z,{children:[(0,n.jsx)(kt,{variant:"defaultOutline",className:"mr-2",children:"Beta"}),"basedpyright (",(0,n.jsx)(oe,{href:"https://github.com/DetachHead/basedpyright",children:"docs"}),")"]}),(0,n.jsx)(V,{children:(0,n.jsx)(ee,{"data-testid":"basedpyright-checkbox",checked:m.value,disabled:f.disabled||m.isOverridden,onCheckedChange:y=>{f.onChange(!!y)}})}),(0,n.jsx)(G,{}),(0,n.jsx)(L,{override:m})]}),m.value&&!r.basedpyright&&(0,n.jsxs)(wt,{kind:"danger",children:["basedpyright is not available in your current environment. Please install"," ",(0,n.jsx)(pe,{className:"inline",children:"basedpyright"})," in your environment."]})]})}),(0,n.jsx)($,{control:g.control,name:"language_servers.pyrefly.enabled",render:({field:f,override:m})=>(0,n.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsxs)(z,{children:[(0,n.jsx)(kt,{variant:"defaultOutline",className:"mr-2",children:"Beta"}),"Pyrefly (",(0,n.jsx)(oe,{href:"https://github.com/facebook/pyrefly",children:"docs"}),")"]}),(0,n.jsx)(V,{children:(0,n.jsx)(ee,{"data-testid":"pyrefly-checkbox",checked:m.value,disabled:f.disabled||m.isOverridden,onCheckedChange:y=>{f.onChange(!!y)}})}),(0,n.jsx)(G,{}),(0,n.jsx)(L,{override:m})]}),m.value&&!r.pyrefly&&(0,n.jsxs)(wt,{kind:"danger",children:["Pyrefly is not available in your current environment. Please install ",(0,n.jsx)(pe,{className:"inline",children:"pyrefly"})," in your environment."]})]})}),(0,n.jsx)($,{control:g.control,name:"language_servers.ty.enabled",render:({field:f,override:m})=>(0,n.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsxs)(z,{children:[(0,n.jsx)(kt,{variant:"defaultOutline",className:"mr-2",children:"Beta"}),"ty (",(0,n.jsx)(oe,{href:"https://github.com/astral-sh/ty",children:"docs"}),")"]}),(0,n.jsx)(V,{children:(0,n.jsx)(ee,{"data-testid":"ty-checkbox",checked:m.value,disabled:f.disabled||m.isOverridden,onCheckedChange:y=>{f.onChange(!!y)}})}),(0,n.jsx)(G,{}),(0,n.jsx)(L,{override:m})]}),m.value&&!r.ty&&(0,n.jsxs)(wt,{kind:"danger",children:["ty is not available in your current environment. Please install ",(0,n.jsx)(pe,{className:"inline",children:"ty"})," in your environment."]})]})}),(0,n.jsx)($,{control:g.control,name:"diagnostics.enabled",render:({field:f,override:m})=>(0,n.jsxs)(O,{className:R,children:[(0,n.jsxs)(z,{children:[(0,n.jsx)(kt,{variant:"defaultOutline",className:"mr-2",children:"Beta"}),"Diagnostics"]}),(0,n.jsx)(V,{children:(0,n.jsx)(ee,{"data-testid":"diagnostics-checkbox",checked:m.value,disabled:f.disabled||m.isOverridden,onCheckedChange:y=>{f.onChange(!!y)}})}),(0,n.jsx)(G,{}),(0,n.jsx)(L,{override:m})]})})]}),(0,n.jsxs)(Te,{title:"Keymap",children:[(0,n.jsx)($,{control:g.control,name:"keymap.preset",render:({field:f,override:m})=>(0,n.jsx)("div",{className:"flex flex-col space-y-1",children:(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{children:"Keymap"}),(0,n.jsx)(V,{children:(0,n.jsx)(Me,{"data-testid":"keymap-select",onChange:y=>f.onChange(y.target.value),value:m.value,disabled:f.disabled||m.isOverridden,className:"inline-flex mr-2",children:Pd.map(y=>(0,n.jsx)("option",{value:y,children:y},y))})}),(0,n.jsx)(G,{}),(0,n.jsx)(L,{override:m})]})})}),(0,n.jsx)($,{control:g.control,name:"keymap.destructive_delete",render:({field:f,override:m})=>(0,n.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{className:"font-normal",children:"Destructive delete"}),(0,n.jsx)(V,{children:(0,n.jsx)(ee,{"data-testid":"destructive-delete-checkbox",checked:m.value,disabled:f.disabled||m.isOverridden,onCheckedChange:y=>{f.onChange(!!y)}})}),(0,n.jsx)(G,{}),(0,n.jsx)(L,{override:m})]}),(0,n.jsxs)(H,{className:"flex items-center gap-1",children:["Allow deleting non-empty cells",(0,n.jsx)(We,{content:(0,n.jsxs)("div",{className:"max-w-xs",children:[(0,n.jsx)("strong",{children:"Use with caution:"})," Deleting cells with code can lose work and computed results since variables are removed from memory."]}),children:(0,n.jsx)(gi,{className:"w-3 h-3 text-(--amber-11)"})})]}),(0,n.jsx)("div",{children:(0,n.jsx)(se,{variant:"link",className:"mb-0 px-0",type:"button",onClick:y=>{y.preventDefault(),y.stopPropagation(),a(!0)},children:"Edit Keyboard Shortcuts"})})]})})]})]});case"display":return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(Te,{title:"Display",children:[(0,n.jsx)($,{control:g.control,name:"display.default_width",render:({field:f,override:m})=>(0,n.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{children:"Default width"}),(0,n.jsx)(V,{children:(0,n.jsx)(Me,{"data-testid":"user-config-width-select",onChange:y=>f.onChange(y.target.value),value:m.value,disabled:f.disabled||m.isOverridden,className:"inline-flex mr-2",children:na().map(y=>(0,n.jsx)("option",{value:y,children:y},y))})}),(0,n.jsx)(G,{}),(0,n.jsx)(L,{override:m})]}),(0,n.jsx)(H,{children:'The default app width for new notebooks; overridden by "width" in the application config.'})]})}),(0,n.jsx)($,{control:g.control,name:"display.theme",render:({field:f,override:m})=>(0,n.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{children:"Theme"}),(0,n.jsx)(V,{children:(0,n.jsx)(Me,{"data-testid":"theme-select",onChange:y=>f.onChange(y.target.value),value:m.value,disabled:f.disabled||m.isOverridden,className:"inline-flex mr-2",children:wr.map(y=>(0,n.jsx)("option",{value:y,children:y},y))})}),(0,n.jsx)(G,{}),(0,n.jsx)(L,{override:m})]}),(0,n.jsx)(H,{children:"This theme will be applied to the user's configuration; it does not affect theme when sharing the notebook."})]})}),(0,n.jsx)($,{control:g.control,name:"display.code_editor_font_size",render:({field:f,override:m})=>(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{children:"Code editor font size (px)"}),(0,n.jsx)(V,{children:(0,n.jsx)("span",{className:"inline-flex mr-2",children:(0,n.jsx)(yt,{"aria-label":"Code editor font size","data-testid":"code-editor-font-size-input",className:"m-0 w-24",...f,value:m.value,isDisabled:m.isOverridden,minValue:8,maxValue:32,onChange:y=>{f.onChange(y),v(g.getValues())}})})}),(0,n.jsx)(G,{}),(0,n.jsx)(L,{override:m})]})}),(0,n.jsx)($,{control:g.control,name:"display.locale",render:({field:f,override:m})=>(0,n.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{children:"Locale"}),(0,n.jsx)(V,{children:(0,n.jsxs)(Me,{"data-testid":"locale-select",onChange:y=>{y.target.value===Ri?f.onChange(void 0):f.onChange(y.target.value)},value:m.value||Ri,disabled:f.disabled||m.isOverridden,className:"inline-flex mr-2",children:[(0,n.jsx)("option",{value:Ri,children:"System"}),navigator.languages.map(y=>(0,n.jsx)("option",{value:y,children:y},y))]})}),(0,n.jsx)(G,{}),(0,n.jsx)(L,{override:m})]}),(0,n.jsxs)(H,{children:["The locale to use for the notebook. If your desired locale is not listed, you can change it manually via"," ",(0,n.jsx)(pe,{className:"inline",children:"marimo config show"}),"."]})]})}),(0,n.jsx)($,{control:g.control,name:"display.reference_highlighting",render:({field:f,override:m})=>(0,n.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{children:"Reference highlighting"}),(0,n.jsx)(V,{children:(0,n.jsx)(ee,{"data-testid":"reference-highlighting-checkbox",checked:m.value,disabled:m.isOverridden,onCheckedChange:f.onChange})}),(0,n.jsx)(G,{}),(0,n.jsx)(L,{override:m})]}),(0,n.jsx)(H,{children:"Visually emphasizes variables in a cell that are defined elsewhere in the notebook."})]})})]}),(0,n.jsx)(Te,{title:"Outputs",children:(0,n.jsx)($,{control:g.control,name:"display.cell_output",render:({field:f,override:m})=>(0,n.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{children:"Cell output area"}),(0,n.jsx)(V,{children:(0,n.jsx)(Me,{"data-testid":"cell-output-select",onChange:y=>f.onChange(y.target.value),value:m.value,disabled:f.disabled||m.isOverridden,className:"inline-flex mr-2",children:["above","below"].map(y=>(0,n.jsx)("option",{value:y,children:y},y))})}),(0,n.jsx)(G,{}),(0,n.jsx)(L,{override:m})]}),(0,n.jsx)(H,{children:"Where to display cell's output."})]})})})]});case"packageManagementAndData":return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Te,{title:"Package Management",children:(0,n.jsx)($,{control:g.control,disabled:j,name:"package_management.manager",render:({field:f,override:m})=>(0,n.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{children:"Manager"}),(0,n.jsx)(V,{children:(0,n.jsx)(Me,{"data-testid":"package-manager-select",onChange:y=>f.onChange(y.target.value),value:m.value,disabled:f.disabled||m.isOverridden,className:"inline-flex mr-2",children:uo.map(y=>(0,n.jsx)("option",{value:y,children:y},y))})}),(0,n.jsx)(G,{}),(0,n.jsx)(L,{override:m})]}),(0,n.jsxs)(H,{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,n.jsx)(oe,{href:"https://docs.marimo.io/guides/editor_features/package_management.html",children:"docs"}),".",(0,n.jsx)("br",{}),(0,n.jsx)("br",{}),"Running marimo in a"," ",(0,n.jsx)(oe,{href:"https://docs.marimo.io/guides/package_management/inlining_dependencies.html",children:"sandboxed environment"})," ","is only supported by ",(0,n.jsx)(pe,{className:"inline",children:"uv"})]})]})})}),(0,n.jsx)(Te,{title:"Data",children:(0,n.jsx)(r0,{form:g,onSubmit:v})})]});case"runtime":return(0,n.jsxs)(Te,{title:"Runtime configuration",children:[(0,n.jsx)($,{control:g.control,name:"runtime.auto_instantiate",render:({field:f,override:m})=>(0,n.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{className:"font-normal",children:"Autorun on startup"}),(0,n.jsx)(V,{children:(0,n.jsx)(ee,{"data-testid":"auto-instantiate-checkbox",disabled:f.disabled||m.isOverridden,checked:m.value,onCheckedChange:f.onChange})}),(0,n.jsx)(G,{}),(0,n.jsx)(L,{override:m})]}),(0,n.jsx)(H,{children:"Whether to automatically run all cells on startup."})]})}),(0,n.jsx)($,{control:g.control,name:"runtime.on_cell_change",render:({field:f,override:m})=>(0,n.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{className:"font-normal",children:"On cell change"}),(0,n.jsx)(V,{children:(0,n.jsx)(Me,{"data-testid":"on-cell-change-select",onChange:y=>f.onChange(y.target.value),value:m.value,disabled:m.isOverridden,className:"inline-flex mr-2",children:["lazy","autorun"].map(y=>(0,n.jsx)("option",{value:y,children:y},y))})}),(0,n.jsx)(G,{}),(0,n.jsx)(L,{override:m})]}),(0,n.jsx)(H,{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.`})]})}),(0,n.jsx)($,{control:g.control,name:"runtime.auto_reload",render:({field:f,override:m})=>(0,n.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{className:"font-normal",children:"On module change"}),(0,n.jsx)(V,{children:(0,n.jsx)(Me,{"data-testid":"auto-reload-select",onChange:y=>f.onChange(y.target.value),value:m.value,disabled:j||m.isOverridden,className:"inline-flex mr-2",children:["off","lazy","autorun"].map(y=>(0,n.jsx)("option",{value:y,children:y},y))})}),(0,n.jsx)(G,{}),(0,n.jsx)(L,{override:m})]}),(0,n.jsx)(H,{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,n.jsx)($,{control:g.control,name:"runtime.reactive_tests",render:({field:f,override:m})=>(0,n.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{className:"font-normal",children:"Autorun Unit Tests"}),(0,n.jsx)(V,{children:(0,n.jsx)(ee,{"data-testid":"reactive-test-checkbox",checked:m.value,disabled:m.isOverridden,onCheckedChange:f.onChange})})]}),(0,n.jsx)(L,{override:m}),(0,n.jsx)(G,{}),(0,n.jsx)(H,{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)."})," "]})}),(0,n.jsxs)(H,{children:["Learn more in the"," ",(0,n.jsx)(oe,{href:"https://docs.marimo.io/guides/reactivity/#configuring-how-marimo-runs-cells",children:"docs"}),"."]})]});case"ai":return(0,n.jsx)(Yu,{form:g,config:t,onSubmit:v});case"optionalDeps":return(0,n.jsx)(b0,{});case"labs":return(0,n.jsxs)(Te,{title:"Experimental Features",children:[(0,n.jsx)("p",{className:"text-sm text-muted-secondary mb-4",children:"\u26A0\uFE0F These features are experimental and may require restarting your notebook to take effect."}),(0,n.jsx)(dt,{control:g.control,name:"experimental.rtc_v2",render:({field:f})=>(0,n.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{className:"font-normal",children:"Real-Time Collaboration"}),(0,n.jsx)(V,{children:(0,n.jsx)(ee,{"data-testid":"rtc-checkbox",checked:f.value===!0,onCheckedChange:f.onChange})})]}),(0,n.jsx)(H,{children:"Enable experimental real-time collaboration. This change requires a page refresh to take effect."})]})}),(0,n.jsx)($,{control:g.control,name:"experimental.external_agents",render:({field:f,override:m})=>(0,n.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{className:"font-normal",children:"External Agents"}),(0,n.jsx)(V,{children:(0,n.jsx)(ee,{"data-testid":"external-agents-checkbox",checked:m.value===!0,disabled:m.isOverridden,onCheckedChange:f.onChange})})]}),(0,n.jsx)(L,{override:m}),(0,n.jsxs)(H,{children:["Enable experimental external agents such as Claude Code and Gemini CLI. Learn more in the"," ",(0,n.jsx)(oe,{href:"https://docs.marimo.io/guides/editor_features/agents/",children:"docs"}),"."]})]})}),(0,n.jsx)($,{control:g.control,name:"experimental.debugger",render:({field:f,override:m})=>(0,n.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{className:"font-normal",children:"Debugger"}),(0,n.jsx)(V,{children:(0,n.jsx)(ee,{"data-testid":"debugger-checkbox",checked:m.value===!0,disabled:m.isOverridden,onCheckedChange:f.onChange})})]}),(0,n.jsx)(L,{override:m}),(0,n.jsxs)(H,{children:["Enable the live debugger: a clickable breakpoint gutter, current-line highlighting while a cell runs, and dropping into ",(0,n.jsx)(pe,{className:"inline",children:"pdb"})," at breakpoints. This change requires a page refresh to take effect."]})]})}),(0,n.jsx)($,{control:g.control,name:"experimental.line_timing",render:({field:f,override:m})=>(0,n.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,n.jsxs)(O,{className:R,children:[(0,n.jsx)(z,{className:"font-normal",children:"Line Timing"}),(0,n.jsx)(V,{children:(0,n.jsx)(ee,{"data-testid":"line-timing-checkbox",checked:m.value===!0,disabled:m.isOverridden,onCheckedChange:f.onChange})})]}),(0,n.jsx)(L,{override:m}),(0,n.jsx)(H,{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."})]})})]})}},S=(0,n.jsxs)("p",{className:"text-muted-secondary",children:["User configuration is stored in ",(0,n.jsx)(pe,{className:"inline",children:"marimo.toml"}),(0,n.jsx)("br",{}),"Run ",(0,n.jsx)(pe,{className:"inline",children:"marimo config show"})," in your terminal to show your current configuration and file location."]});return(0,n.jsx)(kr,{...g,children:(0,n.jsxs)("form",{ref:s,onChange:g.handleSubmit(f=>v(f)),className:"flex text-pretty overflow-hidden",children:[(0,n.jsx)(on,{value:o,onValueChange:f=>c(f),orientation:"vertical",className:"w-1/3 border-r h-full overflow-auto p-3",children:(0,n.jsxs)(rn,{className:"self-start max-h-none flex flex-col gap-2 shrink-0 bg-background flex-1 min-h-full",children:[Pa.map(f=>(0,n.jsx)(xt,{value:f.id,className:"w-full text-left p-2 data-[state=active]:bg-primary data-[state=active]:text-primary-foreground justify-start",children:(0,n.jsxs)("div",{className:"flex gap-4 items-center text-lg overflow-hidden",children:[(0,n.jsx)("span",{className:Pe(f.className,"w-8 h-8 rounded flex items-center justify-center text-muted-foreground shrink-0"),children:(0,n.jsx)(f.Icon,{className:"w-4 h-4"})}),(0,n.jsx)("span",{className:"truncate",children:f.label})]})},f.id)),(0,n.jsxs)("div",{className:"p-2 text-xs text-muted-foreground self-start flex flex-col gap-1",children:[(0,n.jsxs)("span",{children:["Version: ",d]}),(0,n.jsxs)("span",{children:["Locale: ",u]})]}),(0,n.jsx)("div",{className:"flex-1"}),!ct()&&S]})}),(0,n.jsx)("div",{className:"w-2/3 pl-6 gap-2 flex flex-col overflow-auto p-6",children:_()})]})})};var S0=Ce();const Ta=it("ai-features"),Ba=it(!1);function $i(){let t=(0,S0.c)(4),e=Kt(Ea),i=Kt(Ba),l=Kt(Ta),s;return t[0]!==e||t[1]!==l||t[2]!==i?(s={handleClick:(a,o)=>{e(a),a==="ai"&&l(o??"ai-features"),i(!0)}},t[0]=e,t[1]=l,t[2]=i,t[3]=s):s=t[3],s}var ni=Ce();const Fa=t=>{var W,N,q,ie,ce,de,fe,he,xe,E,X,Y,Q,J,ne,le,ye,ue;let e=(0,ni.c)(62),{value:i,placeholder:l,onSelect:s,triggerClassName:a,customDropdownContent:o,iconSize:c,showAddCustomModelDocs:r,forRole:d,displayIconOnly:u,disabled:p}=t,g=c===void 0?"medium":c,x=r===void 0?!1:r,v=u===void 0?!1:u,j=p===void 0?!1:p,[C,I]=h.useState(!1),b=nt(fo),_=nt(xo),{saveModelChange:S}=No(),{handleClick:f}=$i(),m=_.copilot==="custom"?(W=b==null?void 0:b.models)==null?void 0:W.autocomplete_model:void 0,y,P,A,B,M,w,K,k,D;if(e[0]!==((N=b==null?void 0:b.models)==null?void 0:N.autocomplete_model)||e[1]!==((q=b==null?void 0:b.models)==null?void 0:q.chat_model)||e[2]!==((ie=b==null?void 0:b.models)==null?void 0:ie.custom_models)||e[3]!==((ce=b==null?void 0:b.models)==null?void 0:ce.displayed_models)||e[4]!==((de=b==null?void 0:b.models)==null?void 0:de.edit_model)||e[5]!==m||e[6]!==j||e[7]!==v||e[8]!==d||e[9]!==g||e[10]!==C||e[11]!==s||e[12]!==l||e[13]!==S||e[14]!==a||e[15]!==i){let je=St.create({customModels:[...((fe=b==null?void 0:b.models)==null?void 0:fe.custom_models)??[],(he=b==null?void 0:b.models)==null?void 0:he.chat_model,m,(xe=b==null?void 0:b.models)==null?void 0:xe.edit_model].filter(Boolean),displayedModels:(E=b==null?void 0:b.models)==null?void 0:E.displayed_models}),_e=je.getListModelsByProvider(),ge=d==="autocomplete"?(X=b==null?void 0:b.models)==null?void 0:X.autocomplete_model:d==="chat"?(Y=b==null?void 0:b.models)==null?void 0:Y.chat_model:d==="edit"?(Q=b==null?void 0:b.models)==null?void 0:Q.edit_model:void 0,be=i?Ke.parse(i):ge?Ke.parse(ge):void 0,me=g==="medium"?"h-4 w-4":"h-3 w-3",De=(we,qe)=>{let gt=je.getModel(we.id);return(0,n.jsxs)("div",{className:"flex items-center gap-2 w-full px-2 py-1",children:[(0,n.jsx)(Ee,{provider:we.providerId,className:me}),(0,n.jsxs)("div",{className:"flex flex-col",children:[(0,n.jsx)("span",{children:(gt==null?void 0:gt.name)||we.shortModelId}),(0,n.jsx)("span",{className:"text-xs text-muted-foreground",children:we.id})]}),(0,n.jsx)("div",{className:"ml-auto flex gap-1",children:(0,n.jsx)(We,{content:wa(qe),children:(0,n.jsx)("span",{className:`text-xs px-1.5 py-0.5 rounded font-medium ${Jt(qe)}`,children:qe},qe)})})]})},ke;e[25]!==j||e[26]!==d||e[27]!==s||e[28]!==S?(ke=we=>{j||(s?s(we):S(we,d),I(!1))},e[25]=j,e[26]=d,e[27]=s,e[28]=S,e[29]=ke):ke=e[29];let Se=ke;P=Vo,D=C,A=I;let ae=`flex items-center justify-between px-2 py-0.5 border rounded-md
5
5
  hover:bg-accent hover:text-accent-foreground ${a}`,Ze=be?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Ee,{provider:be.providerId,className:me}),v?null:(0,n.jsx)("span",{className:"truncate",children:Ti(be.providerId)?be.shortModelId:be.id})]}):(0,n.jsx)("span",{className:"text-muted-foreground truncate",children:l}),Ne;e[30]===Ze?Ne=e[31]:(Ne=(0,n.jsx)("div",{className:"flex items-center gap-2 truncate",children:Ze}),e[30]=Ze,e[31]=Ne);let $e=`${me} ml-1`,Ie;e[32]===$e?Ie=e[33]:(Ie=(0,n.jsx)(lr,{className:$e}),e[32]=$e,e[33]=Ie),e[34]!==j||e[35]!==ae||e[36]!==Ne||e[37]!==Ie?(B=(0,n.jsxs)(Fo,{disabled:j,className:ae,children:[Ne,Ie]}),e[34]=j,e[35]=ae,e[36]=Ne,e[37]=Ie,e[38]=B):B=e[38],y=zo,M="w-[300px]",w=ge&&d&&De(Ke.parse(ge),d),e[39]!==ge||e[40]!==d?(K=ge&&d&&(0,n.jsx)(Bt,{}),e[39]=ge,e[40]=d,e[41]=K):K=e[41];let Fe;e[42]!==Se||e[43]!==me?(Fe=we=>{let[qe,gt]=we;return(0,n.jsx)(N0,{provider:qe,onSelect:Se,models:gt,iconSizeClass:me},qe)},e[42]=Se,e[43]=me,e[44]=Fe):Fe=e[44],k=_e.map(Fe),e[0]=(J=b==null?void 0:b.models)==null?void 0:J.autocomplete_model,e[1]=(ne=b==null?void 0:b.models)==null?void 0:ne.chat_model,e[2]=(le=b==null?void 0:b.models)==null?void 0:le.custom_models,e[3]=(ye=b==null?void 0:b.models)==null?void 0:ye.displayed_models,e[4]=(ue=b==null?void 0:b.models)==null?void 0:ue.edit_model,e[5]=m,e[6]=j,e[7]=v,e[8]=d,e[9]=g,e[10]=C,e[11]=s,e[12]=l,e[13]=S,e[14]=a,e[15]=i,e[16]=y,e[17]=P,e[18]=A,e[19]=B,e[20]=M,e[21]=w,e[22]=K,e[23]=k,e[24]=D}else y=e[16],P=e[17],A=e[18],B=e[19],M=e[20],w=e[21],K=e[22],k=e[23],D=e[24];let T;e[45]!==f||e[46]!==x?(T=x&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Bt,{}),(0,n.jsxs)(Bo,{className:"h-7 flex items-center gap-2",onClick:()=>f("ai","ai-models"),children:[(0,n.jsx)(ar,{className:"h-3 w-3"}),(0,n.jsx)("span",{className:"cursor-pointer text-link",children:"Add custom model"})]})]}),e[45]=f,e[46]=x,e[47]=T):T=e[47];let F;e[48]!==y||e[49]!==o||e[50]!==T||e[51]!==M||e[52]!==w||e[53]!==K||e[54]!==k?(F=(0,n.jsxs)(y,{className:M,children:[w,K,k,o,T]}),e[48]=y,e[49]=o,e[50]=T,e[51]=M,e[52]=w,e[53]=K,e[54]=k,e[55]=F):F=e[55];let U;return e[56]!==P||e[57]!==A||e[58]!==B||e[59]!==F||e[60]!==D?(U=(0,n.jsxs)(P,{open:D,onOpenChange:A,children:[B,F]}),e[56]=P,e[57]=A,e[58]=B,e[59]=F,e[60]=D,e[61]=U):U=e[61],U};var N0=t=>{let e=(0,ni.c)(26),{provider:i,onSelect:l,models:s,iconSizeClass:a}=t,o=Ti(i)?i:"openai-compatible",c;e[0]===i?c=e[1]:(c=St.getProviderInfo(i),e[0]=i,e[1]=c);let r=c;if(s.length===0)return null;let d;e[2]!==o||e[3]!==a?(d=(0,n.jsx)(Ee,{provider:o,className:a}),e[2]=o,e[3]=a,e[4]=d):d=e[4];let u;e[5]===i?u=e[6]:(u=li(i),e[5]=i,e[6]=u);let p;e[7]!==d||e[8]!==u?(p=(0,n.jsx)(dn,{children:(0,n.jsxs)("p",{className:"flex items-center gap-2",children:[d,u]})}),e[7]=d,e[8]=u,e[9]=p):p=e[9];let g=r?-90:0,x;e[10]===r?x=e[11]:(x=r&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("p",{className:"text-sm text-muted-foreground p-2 max-w-[300px]",children:[r.description,(0,n.jsx)("br",{})]}),(0,n.jsxs)("p",{className:"text-sm text-muted-foreground p-2 pt-0",children:["For more information, see the"," ",(0,n.jsx)("a",{href:r.url,target:"_blank",className:"underline",rel:"noreferrer","aria-label":"Provider details",children:"provider details"}),"."]}),(0,n.jsx)(Bt,{})]}),e[10]=r,e[11]=x);let v;if(e[12]!==s||e[13]!==l||e[14]!==i){let I;e[16]!==l||e[17]!==i?(I=b=>{let _=`${i}/${b.model}`;return(0,n.jsxs)(un,{children:[(0,n.jsx)(dn,{showChevron:!1,className:"py-2",children:(0,n.jsx)("div",{className:"flex items-center gap-2 w-full cursor-pointer",onClick:()=>{l(_)},children:(0,n.jsx)(I0,{model:b,provider:i})})}),(0,n.jsx)(cn,{className:"p-4 w-80",children:(0,n.jsx)(M0,{model:b,provider:i})})]},_)},e[16]=l,e[17]=i,e[18]=I):I=e[18],v=s.map(I),e[12]=s,e[13]=l,e[14]=i,e[15]=v}else v=e[15];let j;e[19]!==g||e[20]!==x||e[21]!==v?(j=(0,n.jsx)(Oo,{children:(0,n.jsxs)(cn,{className:"max-h-[40vh] overflow-y-auto",alignOffset:g,sideOffset:5,children:[x,v]})}),e[19]=g,e[20]=x,e[21]=v,e[22]=j):j=e[22];let C;return e[23]!==p||e[24]!==j?(C=(0,n.jsxs)(un,{children:[p,j]}),e[23]=p,e[24]=j,e[25]=C):C=e[25],C},I0=t=>{let e=(0,ni.c)(17),{model:i,provider:l}=t,s=Ti(l)?l:"openai-compatible",a;e[0]===s?a=e[1]:(a=(0,n.jsx)(Ee,{provider:s,className:"h-4 w-4"}),e[0]=s,e[1]=a);let o;e[2]===i.name?o=e[3]:(o=(0,n.jsx)("span",{children:i.name}),e[2]=i.name,e[3]=o);let c;e[4]===i.capabilities?c=e[5]:(c=i.capabilities.includes("thinking")&&(0,n.jsx)(We,{content:"Reasoning model",children:(0,n.jsx)(ki,{className:`h-5 w-5 rounded-md p-1 ${Jt("thinking")}`})}),e[4]=i.capabilities,e[5]=c);let r;e[6]===c?r=e[7]:(r=(0,n.jsx)("div",{className:"ml-auto",children:c}),e[6]=c,e[7]=r);let d;e[8]!==o||e[9]!==r?(d=(0,n.jsxs)("div",{className:"flex flex-row w-full items-center",children:[o,r]}),e[8]=o,e[9]=r,e[10]=d):d=e[10];let u;e[11]===i.custom?u=e[12]:(u=i.custom&&(0,n.jsx)(We,{content:"Custom model",children:(0,n.jsx)(ai,{className:"h-5 w-5"})}),e[11]=i.custom,e[12]=u);let p;return e[13]!==a||e[14]!==d||e[15]!==u?(p=(0,n.jsxs)(n.Fragment,{children:[a,d,u]}),e[13]=a,e[14]=d,e[15]=u,e[16]=p):p=e[16],p};const M0=t=>{let e=(0,ni.c)(28),{model:i,provider:l}=t,s;e[0]===i.name?s=e[1]:(s=(0,n.jsx)("h4",{className:"font-semibold text-base text-foreground",children:i.name}),e[0]=i.name,e[1]=s);let a;e[2]===i.model?a=e[3]:(a=(0,n.jsx)("p",{className:"text-xs text-muted-foreground font-mono",children:i.model}),e[2]=i.model,e[3]=a);let o;e[4]!==s||e[5]!==a?(o=(0,n.jsxs)("div",{children:[s,a]}),e[4]=s,e[5]=a,e[6]=o):o=e[6];let c;e[7]===i.description?c=e[8]:(c=(0,n.jsx)("p",{className:"text-sm text-muted-foreground leading-relaxed",children:i.description}),e[7]=i.description,e[8]=c);let r;e[9]===i.roles?r=e[10]:(r=i.roles.length>0&&(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Capabilities:"}),(0,n.jsx)("div",{className:"flex flex-wrap gap-1",children:i.roles.map(K0)})]}),e[9]=i.roles,e[10]=r);let d;e[11]===i.capabilities?d=e[12]:(d=i.capabilities.includes("thinking")&&(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("div",{className:"w-2 h-2 bg-purple-500 rounded-full animate-pulse"}),(0,n.jsx)("span",{className:"text-xs text-muted-foreground",children:"Supports thinking mode"})]}),e[11]=i.capabilities,e[12]=d);let u;e[13]===l?u=e[14]:(u=(0,n.jsx)(Ee,{provider:l,className:"h-4 w-4"}),e[13]=l,e[14]=u);let p;e[15]===l?p=e[16]:(p=li(l),e[15]=l,e[16]=p);let g;e[17]===p?g=e[18]:(g=(0,n.jsx)("span",{className:"text-xs text-muted-foreground",children:p}),e[17]=p,e[18]=g);let x;e[19]!==u||e[20]!==g?(x=(0,n.jsxs)("div",{className:"flex items-center gap-2 pt-2 border-t border-border",children:[u,g]}),e[19]=u,e[20]=g,e[21]=x):x=e[21];let v;return e[22]!==x||e[23]!==o||e[24]!==c||e[25]!==r||e[26]!==d?(v=(0,n.jsxs)("div",{className:"space-y-3",children:[o,c,r,d,x]}),e[22]=x,e[23]=o,e[24]=c,e[25]=r,e[26]=d,e[27]=v):v=e[27],v};function li(t){let e=St.getProviderInfo(t);return e?e.name:tr(t)}function K0(t){return(0,n.jsx)("span",{className:`px-2 py-1 text-xs rounded-md font-medium ${Jt(t)}`,title:wa(t),children:t},t)}export{zs as A,il as B,Ed as C,_t as D,Os as E,Ms as F,Hn as G,Jn as H,Ps as I,Vn as J,Gn as K,Ii as L,Qt as M,td as N,Vs as O,Ai as P,st as R,na as S,Ke as T,wi as U,tl as V,Qn as W,On as Y,Xt as _,Vi as a,Zd as b,Ca as c,Ee as d,ma as f,ra as g,oa as h,_0 as i,Bs as j,Pi as k,wu as l,Nt as m,Ba as n,Du as o,ru as p,$n as q,$i as r,Nu as s,Fa as t,ju as u,ca as v,Zs as w,Fi as x,aa as y,Cs as z};