@marimo-team/frontend 0.23.9-dev27 → 0.23.9-dev29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{add-cell-with-ai-CV7qdXZ6.js → add-cell-with-ai-B5jWlbIH.js} +1 -1
- package/dist/assets/{agent-panel-DYVyd4UE.js → agent-panel-CehLh_al.js} +1 -1
- package/dist/assets/{ai-model-dropdown-guVuz4cU.js → ai-model-dropdown-u9kAVPoC.js} +4 -4
- package/dist/assets/{app-config-button-Cj07FGsj.js → app-config-button-BQvjGWVa.js} +1 -1
- package/dist/assets/{cell-editor-BywT88U0.js → cell-editor-BbiDYw12.js} +1 -1
- package/dist/assets/{chat-display-DJxt1jsL.js → chat-display-BBHybkk0.js} +1 -1
- package/dist/assets/{chat-panel-3ypvib3G.js → chat-panel-Bjb-M1nv.js} +1 -1
- package/dist/assets/{chat-ui-S-G1Rvuu.js → chat-ui-CVQTsFar.js} +1 -1
- package/dist/assets/{command-palette-D4WQward.js → command-palette-BkFnC3Nv.js} +1 -1
- package/dist/assets/{edit-page-CH2TkWIz.js → edit-page-DTbeJWXJ.js} +3 -3
- package/dist/assets/{home-page-NUz6SvL1.js → home-page-D9Mzwagr.js} +1 -1
- package/dist/assets/{hooks-CVNeEUPq.js → hooks-BKuSi_n0.js} +1 -1
- package/dist/assets/{index-YNy0h9bn.js → index-BSE7OhrF.js} +3 -3
- package/dist/assets/{layout-ooVjwxI3.js → layout-CDfwu3nB.js} +2 -2
- package/dist/assets/{packages-panel-6hStEQik.js → packages-panel-9N1gJnGd.js} +1 -1
- package/dist/assets/{panels-B7B07kKj.js → panels-BKxP31m5.js} +1 -1
- package/dist/assets/{reveal-component-CLDiB0FE.js → reveal-component-DepUw5UA.js} +1 -1
- package/dist/assets/{run-page-C9kZJeAX.js → run-page-DyXjgwh0.js} +1 -1
- package/dist/assets/{scratchpad-panel-DgE90Alx.js → scratchpad-panel-BNItGF7P.js} +1 -1
- package/dist/assets/{useNotebookActions-DTRYRUIW.js → useNotebookActions-BKUkQmSx.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/src/core/codemirror/keymaps/vim.ts +63 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
var Pa=Object.defineProperty;var Ea=(t,e,i)=>e in t?Pa(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;var Ne=(t,e,i)=>Ea(t,typeof e!="symbol"?e+"":e,i);var ot;import{s as Gi}from"./chunk-LvLJmgfZ.js";import{d as Mt,i as it,l as lt,n as Dt,o as Ta,p as nt,u as st}from"./useEvent-D91BmmQi.js";import{t as za}from"./react-Bj1aDYRI.js";import{Bt as le,Er as ii,Fn as Hi,G as Fa,Gr as At,Kr as Ui,Oi as qi,Sr as Ba,Tr as Ra,Yt as $a,ai as Va,an as Oa,ci as La,cn as Wi,dn as pe,fn as gt,gn as Ga,gr as Ha,hr as Ua,li as qa,on as Wa,pn as Ya,ui as Qa,ut as Za,wn as Xa,xi as Ja}from"./cells-1XaQzJBc.js";import{t as Yi}from"./react-dom-CSu739Rf.js";import{t as Se}from"./compiler-runtime-B3qBwwSJ.js";import{t as er}from"./isObject-DvLSfCY5.js";import{t as Qi}from"./get-C-qh_et5.js";import{t as tr}from"./merge-_9WLTEyt.js";import{t as ir}from"./debounce-DhnxH9Rh.js";import{_ as U,l as lr,p as Zi}from"./useEventListener-DvoEXWke.js";import{t as li}from"./invariant-BUdrueMv.js";import{D as nr,E as sr,S as ar,T as Xi,_ as ni,c as rr,f as or,l as cr,n as dr,p as ur,x as Ji,y as el}from"./utils-Bok_hGT2.js";import{S as mr,T as dt,r as pr}from"./config-hed0CaQL.js";import{i as hr,n as si,t as gr}from"./switch-YcZLs0mS.js";import{t as Ee}from"./cn-DCUzRj2J.js";import{t as fr}from"./jsx-runtime-BqBOg78p.js";import{a as xr,i as yr,n as tl,r as vr,t as il}from"./multi-map-CUuNtzHt.js";import{a as ll,c as ft,d as br,i as jr,o as Pt,r as kr,s as nl,t as wr}from"./popover-Bz_0Vkyf.js";import{i as ai,l as Ke,n as Cr,r as Sr,s as _r,t as Nr}from"./select-DZcFyKFQ.js";import{a as Ir,c as Et,d as sl,f as al,p as Kr,r as Mr,s as Dr,t as Ar,u as rl}from"./dropdown-menu-CR7cnzLX.js";import{t as Oe}from"./label-xHqFtfdz.js";import{t as qe}from"./tooltip-DTV9tlSr.js";import{n as Pr,r as ol,t as se}from"./button-BbCh-29a.js";import{St as Le,Wt as cl,at as Er,ct as dl}from"./dist-BrR4M-k3.js";import{A as Tr,D as zr,F as ul,I as ml,M as Fr,N as Br,_ as Rr,j as $r,m as Vr,p as Or,v as Lr,y as Gr}from"./dist-CHcznzB-.js";import{s as pl}from"./arrays-DYDL-3-i.js";import{n as Ze}from"./once-DRroIaBz.js";import{t as Hr}from"./main-B0OX4z33.js";import{i as Ur,n as qr,t as ri}from"./strings-wdPMRf6Z.js";import{r as xt,t as Wr}from"./requests-DIwGYs0l.js";import{t as Xe}from"./createLucideIcon-D5guW7EU.js";import{t as Yr}from"./check-BH35Ndha.js";import{r as Qr,t as oi}from"./x-C-6liIBr.js";import{t as Zr}from"./chevron-right-CG5QYXYk.js";import{u as Xr}from"./toDate-B5A0DFEz.js";import{t as Jr}from"./copy-BwrPA9zQ.js";import{n as Tt,t as hl}from"./spinner-Bhir8k53.js";import{t as eo}from"./plus-BgB18UzY.js";import{t as gl}from"./refresh-cw-DHwG4Mac.js";import{$ as Ge,B as to,C as io,D as lo,G as zt,J as no,O as Ft,S as fl,V as ci,X as xl,_ as so,at as di,b as ao,ct as ui,et as yl,g as ro,lt as oo,nt as co,o as yt,r as Be,rt as uo,st as Bt,ut as Rt,w as vt}from"./input-C3Hrdlqq.js";import{a as V,c as $,d as G,g as mo,i as po,l as R,o as H,p as ho,r as go,s as fo,u as B,v as mi,y as vl}from"./textarea-CTiWTiw-.js";import{t as bl}from"./trash-2-rVklqqFF.js";import{t as pi}from"./triangle-alert-D2p96PEF.js";import{t as bt}from"./badge-j3NGjqhR.js";import{t as Re}from"./use-toast-IPAtJGea.js";import{t as xo}from"./useTheme-KJ1rGmnj.js";import{n as yo}from"./copy-LK56fFow.js";import{B as jt,E as vo,I as jl,M as hi,N as ut,O as gi,P as He,R as kl,V as $t,_ as bo,j as Je,k as $e,l as jo,m as ko,p as wo,t as wl,v as Cl,y as Co,z as So}from"./usePress-DQ_tAz5W.js";import{t as Sl}from"./SSRProvider-CkFAAHXw.js";import{_ as _l,a as fi,c as Vt,d as _o,f as et,g as at,m as mt,p as Nl,s as No,t as Io,u as Il,v as Ko}from"./RSPContexts-CdN1NyAt.js";import{t as Ot}from"./context-QkTujrKn.js";import{n as Mo}from"./useDebounce-7xZwVnnu.js";import{a as Do,c as Ao,n as Po,o as Eo,s as To,t as zo}from"./dialog-DzC_QCtT.js";import{i as Fo,r as Bo,t as Ro}from"./useHotkey-BtqYcnxQ.js";import{r as $o}from"./errors-vr57w7Ul.js";import{t as ae}from"./kbd-CTUAEnEx.js";import{t as re}from"./links-D1JoyKTt.js";import{n as Kl,r as Vo,t as Ml}from"./alert-yTS3WpF4.js";import{n as Oo,t as kt}from"./error-banner-LdWZDbqd.js";import{n as Dl}from"./useAsyncData-bgszE9F0.js";import{a as Lo,i as Lt,n as Go,o as Al,r as xi,t as Ho}from"./table-BGPSHfig.js";import{t as yi}from"./renderShortcut-CzUfgpdJ.js";import{n as Uo,t as qo}from"./azure-B42ls0Ui.js";import{a as Wo,i as Yo,n as Qo,r as Zo,t as Xo}from"./card--6HRj4T9.js";var Jo="Expected a function";function ec(t,e,i){var n=!0,s=!0;if(typeof t!="function")throw TypeError(Jo);return er(i)&&(n="leading"in i?!!i.leading:n,s="trailing"in i?!!i.trailing:s),ir(t,e,{leading:n,maxWait:e,trailing:s})}var tc=ec,vi=Xe("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"}]]),Pl=Xe("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"}]]),El=Xe("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"}]]),ic=Xe("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"}]]),Tl=Xe("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"}]]),lc=Xe("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"}]]),zl=Xe("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"}]]),nc=Xe("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"}]]),g=Gi(za(),1);function Fl(t,e){let i=(0,g.useRef)(!0),n=(0,g.useRef)(null);$t(()=>(i.current=!0,()=>{i.current=!1}),[]),$t(()=>{i.current?i.current=!1:(!n.current||e.some((s,a)=>!Object.is(s,n[a])))&&t(),n.current=e},e)}function Bl(t,e){let{collection:i,onLoadMore:n,scrollOffset:s=1}=t,a=(0,g.useRef)(null),r=wo(c=>{for(let o of c)o.isIntersecting&&n&&n()});$t(()=>(e.current&&(a.current=new IntersectionObserver(r,{root:at(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 Rl(t){let e=g.version.split(".");return parseInt(e[0],10)>=19?t:t?"true":void 0}var sc="react-aria-clear-focus",ac="react-aria-focus",rc=500;function oc(t){let{isDisabled:e,onLongPressStart:i,onLongPressEnd:n,onLongPress:s,threshold:a=rc,accessibilityDescription:r}=t,c=(0,g.useRef)(void 0),{addGlobalListener:o,removeGlobalListener:d}=ko(),{pressProps:u}=wl({isDisabled:e,onPressStart(m){if(m.continuePropagation(),(m.pointerType==="mouse"||m.pointerType==="touch")&&(i&&i({...m,type:"longpressstart"}),c.current=setTimeout(()=>{m.target.dispatchEvent(new PointerEvent("pointercancel",{bubbles:!0})),jl(m.target).activeElement!==m.target&&gi(m.target),s&&s({...m,type:"longpress"}),c.current=void 0},a),m.pointerType==="touch")){let h=x=>{x.preventDefault()};o(m.target,"contextmenu",h,{once:!0}),o(window,"pointerup",()=>{setTimeout(()=>{d(m.target,"contextmenu",h)},30)},{once:!0})}},onPressEnd(m){c.current&&clearTimeout(c.current),n&&(m.pointerType==="mouse"||m.pointerType==="touch")&&n({...m,type:"longpressend"})}});return{longPressProps:$e(u,Nl(s&&!e?r:void 0))}}function cc(t,e){let i=e==null?void 0:e.isDisabled,[n,s]=(0,g.useState)(!1);return $t(()=>{if(t!=null&&t.current&&!i){let a=()=>{t.current&&s(!!Vt(t.current,{tabbable:!0}).nextNode())};a();let r=new MutationObserver(a);return r.observe(t.current,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabIndex","disabled"]}),()=>{r.disconnect()}}}),i?!1:n}function $l(t){let e=uc(jl(t));e!==t&&(e&&dc(e,t),t&&Vl(t,e))}function dc(t,e){t.dispatchEvent(new FocusEvent("blur",{relatedTarget:e})),t.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:e}))}function Vl(t,e){t.dispatchEvent(new FocusEvent("focus",{relatedTarget:e})),t.dispatchEvent(new FocusEvent("focusin",{bubbles:!0,relatedTarget:e}))}function uc(t){let e=ut(t),i=e==null?void 0:e.getAttribute("aria-activedescendant");return i&&t.getElementById(i)||e}function bi(t){return vo()?t.altKey:t.ctrlKey}function Gt(t,e){var s,a;let i=`[data-key="${CSS.escape(String(e))}"]`,n=(s=t.current)==null?void 0:s.dataset.collection;return n&&(i=`[data-collection="${CSS.escape(n)}"]${i}`),(a=t.current)==null?void 0:a.querySelector(i)}var Ol=new WeakMap;function mc(t){let e=jt();return Ol.set(t,e),e}function pc(t){return Ol.get(t)}var hc=1e3;function gc(t){let{keyboardDelegate:e,selectionManager:i,onTypeSelect:n}=t,s=(0,g.useRef)({search:"",timeout:void 0}).current;return{typeSelectProps:{onKeyDownCapture:e.getKeyForSearch?a=>{let r=fc(a.key);if(!(!r||a.ctrlKey||a.metaKey||!Je(a.currentTarget,He(a))||s.search.length===0&&r===" ")){if(r===" "&&s.search.trim().length>0&&(a.preventDefault(),"continuePropagation"in a||a.stopPropagation()),s.search+=r,e.getKeyForSearch!=null){let c=e.getKeyForSearch(s.search,i.focusedKey);c??(c=e.getKeyForSearch(s.search)),c!=null&&(i.setFocusedKey(c),n&&n(c))}clearTimeout(s.timeout),s.timeout=setTimeout(()=>{s.search=""},hc)}}:void 0}}}function fc(t){return t.length===1||!/^[A-Z]/i.test(t)?t:""}var xc=Yi();function yc(t){let{selectionManager:e,keyboardDelegate:i,ref:n,autoFocus:s=!1,shouldFocusWrap:a=!1,disallowEmptySelection:r=!1,disallowSelectAll:c=!1,escapeKeyBehavior:o="clearSelection",selectOnFocus:d=e.selectionBehavior==="replace",disallowTypeAhead:u=!1,shouldUseVirtualFocus:m,allowsTabNavigation:h=!1,scrollRef:x=n,linkBehavior:y="action"}=t,{direction:j}=Ot(),v=Cl(),_=b=>{var z,F,q,Y,S,W,ee,oe,ce,he,ue,ge;if(b.altKey&&b.key==="Tab"&&b.preventDefault(),!n.current||!Je(n.current,He(b)))return;let A=(P,X)=>{if(P!=null){if(e.isLink(P)&&y==="selection"&&d&&!bi(b)){(0,xc.flushSync)(()=>{e.setFocusedKey(P,X)});let Z=Gt(n,P),Q=e.getItemProps(P);Z&&v.open(Z,b,Q.href,Q.routerOptions);return}if(e.setFocusedKey(P,X),e.isLink(P)&&y==="override")return;b.shiftKey&&e.selectionMode==="multiple"?e.extendSelection(P):d&&!bi(b)&&e.replaceSelection(P)}};switch(b.key){case"ArrowDown":if(i.getKeyBelow){let P=e.focusedKey==null?(z=i.getFirstKey)==null?void 0:z.call(i):(F=i.getKeyBelow)==null?void 0:F.call(i,e.focusedKey);P==null&&a&&(P=(q=i.getFirstKey)==null?void 0:q.call(i,e.focusedKey)),P!=null&&(b.preventDefault(),A(P))}break;case"ArrowUp":if(i.getKeyAbove){let P=e.focusedKey==null?(Y=i.getLastKey)==null?void 0:Y.call(i):(S=i.getKeyAbove)==null?void 0:S.call(i,e.focusedKey);P==null&&a&&(P=(W=i.getLastKey)==null?void 0:W.call(i,e.focusedKey)),P!=null&&(b.preventDefault(),A(P))}break;case"ArrowLeft":if(i.getKeyLeftOf){let P=e.focusedKey==null?null:(ee=i.getKeyLeftOf)==null?void 0:ee.call(i,e.focusedKey);P==null&&a&&(P=j==="rtl"?(oe=i.getFirstKey)==null?void 0:oe.call(i,e.focusedKey):(ce=i.getLastKey)==null?void 0:ce.call(i,e.focusedKey)),P!=null&&(b.preventDefault(),A(P,j==="rtl"?"first":"last"))}break;case"ArrowRight":if(i.getKeyRightOf){let P=e.focusedKey==null?null:(he=i.getKeyRightOf)==null?void 0:he.call(i,e.focusedKey);P==null&&a&&(P=j==="rtl"?(ue=i.getLastKey)==null?void 0:ue.call(i,e.focusedKey):(ge=i.getFirstKey)==null?void 0:ge.call(i,e.focusedKey)),P!=null&&(b.preventDefault(),A(P,j==="rtl"?"last":"first"))}break;case"Home":if(i.getFirstKey){if(e.focusedKey===null&&b.shiftKey)return;b.preventDefault();let P=i.getFirstKey(e.focusedKey,mt(b));e.setFocusedKey(P),P!=null&&(mt(b)&&b.shiftKey&&e.selectionMode==="multiple"?e.extendSelection(P):d&&e.replaceSelection(P))}break;case"End":if(i.getLastKey){if(e.focusedKey===null&&b.shiftKey)return;b.preventDefault();let P=i.getLastKey(e.focusedKey,mt(b));e.setFocusedKey(P),P!=null&&(mt(b)&&b.shiftKey&&e.selectionMode==="multiple"?e.extendSelection(P):d&&e.replaceSelection(P))}break;case"PageDown":if(i.getKeyPageBelow&&e.focusedKey!=null){let P=i.getKeyPageBelow(e.focusedKey);P!=null&&(b.preventDefault(),A(P))}break;case"PageUp":if(i.getKeyPageAbove&&e.focusedKey!=null){let P=i.getKeyPageAbove(e.focusedKey);P!=null&&(b.preventDefault(),A(P))}break;case"a":mt(b)&&e.selectionMode==="multiple"&&c!==!0&&(b.preventDefault(),e.selectAll());break;case"Escape":o==="clearSelection"&&!r&&e.selectedKeys.size!==0&&(b.stopPropagation(),b.preventDefault(),e.clearSelection());break;case"Tab":if(!h){if(b.shiftKey)n.current.focus();else{let P=Vt(n.current,{tabbable:!0}),X,Z;do Z=P.lastChild(),Z&&(X=Z);while(Z);let Q=ut();X&&(!hi(X)||Q&&!jo(Q))&&gi(X)}break}}},C=(0,g.useRef)({top:0,left:0});Bt(x,"scroll",()=>{var b,A;C.current={top:((b=x.current)==null?void 0:b.scrollTop)??0,left:((A=x.current)==null?void 0:A.scrollLeft)??0}});let w=b=>{var A,z;if(e.isFocused){Je(b.currentTarget,He(b))||e.setFocused(!1);return}if(Je(b.currentTarget,He(b))){if(e.setFocused(!0),e.focusedKey==null){let F=Y=>{Y!=null&&(e.setFocusedKey(Y),d&&!e.isSelected(Y)&&e.replaceSelection(Y))},q=b.relatedTarget;q&&b.currentTarget.compareDocumentPosition(q)&Node.DOCUMENT_POSITION_FOLLOWING?F(e.lastSelectedKey??((A=i.getLastKey)==null?void 0:A.call(i))):F(e.firstSelectedKey??((z=i.getFirstKey)==null?void 0:z.call(i)))}else x.current&&(x.current.scrollTop=C.current.top,x.current.scrollLeft=C.current.left);if(e.focusedKey!=null&&x.current){let F=Gt(n,e.focusedKey);F instanceof HTMLElement&&(!hi(F)&&!m&&gi(F),yl()==="keyboard"&&et(F,{containingElement:n.current}))}}},p=b=>{Je(b.currentTarget,b.relatedTarget)||e.setFocused(!1)},f=(0,g.useRef)(!1);Bt(n,ac,m?b=>{let{detail:A}=b;b.stopPropagation(),e.setFocused(!0),(A==null?void 0:A.focusStrategy)==="first"&&(f.current=!0)}:void 0),Fl(()=>{var b;if(f.current){let A=((b=i.getFirstKey)==null?void 0:b.call(i))??null;if(A==null){let z=ut();$l(n.current),Vl(z,null),e.collection.size>0&&(f.current=!1)}else e.setFocusedKey(A),f.current=!1}},[e.collection]),Fl(()=>{e.collection.size>0&&(f.current=!1)},[e.focusedKey]),Bt(n,sc,m?b=>{var A;b.stopPropagation(),e.setFocused(!1),(A=b.detail)!=null&&A.clearFocusKey&&e.setFocusedKey(null)}:void 0);let N=(0,g.useRef)(s),K=(0,g.useRef)(!1);(0,g.useEffect)(()=>{var b,A;if(N.current){let z=null;s==="first"&&(z=((b=i.getFirstKey)==null?void 0:b.call(i))??null),s==="last"&&(z=((A=i.getLastKey)==null?void 0:A.call(i))??null);let F=e.selectedKeys;if(F.size){for(let q of F)if(e.canSelectItem(q)){z=q;break}}e.setFocused(!0),e.setFocusedKey(z),z==null&&!m&&n.current&&Ge(n.current),e.collection.size>0&&(N.current=!1,K.current=!0)}});let T=(0,g.useRef)(e.focusedKey),I=(0,g.useRef)(null);(0,g.useEffect)(()=>{if(e.isFocused&&e.focusedKey!=null&&(e.focusedKey!==T.current||K.current)&&x.current&&n.current){let b=yl(),A=Gt(n,e.focusedKey);if(!(A instanceof HTMLElement))return;(b==="keyboard"||K.current)&&(I.current&&cancelAnimationFrame(I.current),I.current=requestAnimationFrame(()=>{x.current&&(_o(x.current,A),b!=="virtual"&&et(A,{containingElement:n.current}))}))}!m&&e.isFocused&&e.focusedKey==null&&T.current!=null&&n.current&&Ge(n.current),T.current=e.focusedKey,K.current=!1}),(0,g.useEffect)(()=>()=>{I.current&&cancelAnimationFrame(I.current)},[]),Bt(n,"react-aria-focus-scope-restore",b=>{b.preventDefault(),e.setFocused(!0)});let E={onKeyDown:_,onFocus:w,onBlur:p,onMouseDown(b){x.current===He(b)&&b.preventDefault()}},{typeSelectProps:M}=gc({keyboardDelegate:i,selectionManager:e});u||(E=$e(M,E));let k;m||(k=e.focusedKey==null?0:-1);let D=mc(e.collection);return{collectionProps:$e(E,{tabIndex:k,"data-collection":D})}}function Ll(t){let{id:e,selectionManager:i,key:n,ref:s,shouldSelectOnPressUp:a,shouldUseVirtualFocus:r,focus:c,isDisabled:o,onAction:d,allowsDifferentPressOrigin:u,linkBehavior:m="action"}=t,h=Cl();e=jt(e);let x=S=>{if(S.pointerType==="keyboard"&&bi(S))i.toggleSelection(n);else{if(i.selectionMode==="none")return;if(i.isLink(n)){if(m==="selection"&&s.current){let W=i.getItemProps(n);h.open(s.current,S,W.href,W.routerOptions),i.setSelectedKeys(i.selectedKeys);return}else if(m==="override"||m==="none")return}i.selectionMode==="single"?i.isSelected(n)&&!i.disallowEmptySelection?i.toggleSelection(n):i.replaceSelection(n):S&&S.shiftKey?i.extendSelection(n):i.selectionBehavior==="toggle"||S&&(mt(S)||S.pointerType==="touch"||S.pointerType==="virtual")?i.toggleSelection(n):i.replaceSelection(n)}};(0,g.useEffect)(()=>{n===i.focusedKey&&i.isFocused&&(r?$l(s.current):c?c():ut()!==s.current&&s.current&&Ge(s.current))},[s,n,i.focusedKey,i.childFocusStrategy,i.isFocused,r]),o||(o=i.isDisabled(n));let y={};!r&&!o?y={tabIndex:n===i.focusedKey?0:-1,onFocus(S){He(S)===s.current&&i.setFocusedKey(n)}}:o&&(y.onMouseDown=S=>{S.preventDefault()}),(0,g.useEffect)(()=>{o&&i.focusedKey===n&&i.setFocusedKey(null)},[i,o,n]);let j=i.isLink(n)&&m==="override",v=d&&t.UNSTABLE_itemBehavior==="action",_=i.isLink(n)&&m!=="selection"&&m!=="none",C=!o&&i.canSelectItem(n)&&!j&&!v,w=(d||_)&&!o,p=w&&(i.selectionBehavior==="replace"?!C:!C||i.isEmpty),f=w&&C&&i.selectionBehavior==="replace",N=p||f,K=(0,g.useRef)(null),T=N&&C,I=(0,g.useRef)(!1),E=(0,g.useRef)(!1),M=i.getItemProps(n),k=S=>{if(d){var W;d(),(W=s.current)==null||W.dispatchEvent(new CustomEvent("react-aria-item-action",{bubbles:!0}))}_&&s.current&&h.open(s.current,S,M.href,M.routerOptions)},D={ref:s};if(a?(D.onPressStart=S=>{K.current=S.pointerType,I.current=T,S.pointerType==="keyboard"&&(!N||Hl(S.key))&&x(S)},u?(D.onPressUp=p?void 0:S=>{S.pointerType==="mouse"&&C&&x(S)},D.onPress=p?k:S=>{S.pointerType!=="keyboard"&&S.pointerType!=="mouse"&&C&&x(S)}):D.onPress=S=>{if(p||f&&S.pointerType!=="mouse"){if(S.pointerType==="keyboard"&&!Gl(S.key))return;k(S)}else S.pointerType!=="keyboard"&&C&&x(S)}):(D.onPressStart=S=>{K.current=S.pointerType,I.current=T,E.current=p,C&&(S.pointerType==="mouse"&&!p||S.pointerType==="keyboard"&&(!w||Hl(S.key)))&&x(S)},D.onPress=S=>{(S.pointerType==="touch"||S.pointerType==="pen"||S.pointerType==="virtual"||S.pointerType==="keyboard"&&N&&Gl(S.key)||S.pointerType==="mouse"&&E.current)&&(N?k(S):C&&x(S))}),y["data-collection"]=pc(i.collection),y["data-key"]=n,D.preventFocusOnPress=r,r&&(D=$e(D,{onPressStart(S){S.pointerType!=="touch"&&(i.setFocused(!0),i.setFocusedKey(n))},onPress(S){S.pointerType==="touch"&&(i.setFocused(!0),i.setFocusedKey(n))}})),M)for(let S of["onPressStart","onPressEnd","onPressChange","onPress","onPressUp","onClick"])M[S]&&(D[S]=kl(D[S],M[S]));let{pressProps:b,isPressed:A}=wl(D),z=f?S=>{K.current==="mouse"&&(S.stopPropagation(),S.preventDefault(),k(S))}:void 0,{longPressProps:F}=oc({isDisabled:!T,onLongPress(S){S.pointerType==="touch"&&(x(S),i.setSelectionBehavior("toggle"))}}),q=S=>{K.current==="touch"&&I.current&&S.preventDefault()},Y=m!=="none"&&i.isLink(n)?S=>{bo.isOpening||S.preventDefault()}:void 0;return{itemProps:$e(y,C||p||r&&!o?b:{},T?F:{},{onDoubleClick:z,onDragStartCapture:q,onClick:Y,id:e},r?{onMouseDown:S=>S.preventDefault()}:void 0),isPressed:A,isSelected:i.isSelected(n),isFocused:i.isFocused&&i.focusedKey===n,isDisabled:o,allowsSelection:C,hasAction:N}}function Gl(t){return t==="Enter"}function Hl(t){return t===" "}var Ul=class{getItemRect(t){let e=this.ref.current;if(!e)return null;let i=t==null?null:Gt(this.ref,t);if(!i)return null;let n=e.getBoundingClientRect(),s=i.getBoundingClientRect();return{x:s.left-n.left-e.clientLeft+e.scrollLeft,y:s.top-n.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}},ji=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 n=this.collection.getItem(i);if((n==null?void 0:n.type)==="item"&&!this.isDisabled(n))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 n=t,s=this.layoutDelegate.getItemRect(n);if(!s||n==null)return null;let a=s;do{if(n=e(n),n==null)break;s=this.layoutDelegate.getItemRect(n)}while(s&&i(a,s)&&n!=null);return n}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&&!_l(e))return this.getFirstKey();let n=t;if(this.orientation==="horizontal"){let s=Math.max(0,i.x+i.width-this.layoutDelegate.getVisibleRect().width);for(;i&&i.x>s&&n!=null;)n=this.getKeyAbove(n),i=n==null?null:this.layoutDelegate.getItemRect(n)}else{let s=Math.max(0,i.y+i.height-this.layoutDelegate.getVisibleRect().height);for(;i&&i.y>s&&n!=null;)n=this.getKeyAbove(n),i=n==null?null:this.layoutDelegate.getItemRect(n)}return n??this.getFirstKey()}getKeyPageBelow(t){let e=this.ref.current,i=this.layoutDelegate.getItemRect(t);if(!i)return null;if(e&&!_l(e))return this.getLastKey();let n=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&&n!=null;)n=this.getKeyBelow(n),i=n==null?null:this.layoutDelegate.getItemRect(n)}else{let s=Math.min(this.layoutDelegate.getContentSize().height,i.y-i.height+this.layoutDelegate.getVisibleRect().height);for(;i&&i.y<s&&n!=null;)n=this.getKeyBelow(n),i=n==null?null:this.layoutDelegate.getItemRect(n)}return n??this.getLastKey()}getKeyForSearch(t,e){if(!this.collator)return null;let i=this.collection,n=e||this.getFirstKey();for(;n!=null;){let s=i.getItem(n);if(!s)return null;let a=s.textValue.slice(0,t.length);if(s.textValue&&this.collator.compare(a,t)===0)return n;n=this.getNextKey(n)}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 Ul(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 Ul(this.ref);this.layout==="stack"&&this.orientation==="vertical"&&(this.getKeyLeftOf=void 0,this.getKeyRightOf=void 0)}};function ql(t){let{selectionManager:e,collection:i,disabledKeys:n,ref:s,keyboardDelegate:a,layoutDelegate:r}=t,c=Il({usage:"search",sensitivity:"base"}),o=e.disabledBehavior,d=(0,g.useMemo)(()=>a||new ji({collection:i,disabledKeys:n,disabledBehavior:o,ref:s,collator:c,layoutDelegate:r}),[a,r,i,n,s,c,o]),{collectionProps:u}=yc({...t,ref:s,selectionManager:e,keyboardDelegate:d});return{listProps:u}}var vc=class{build(t,e){return this.context=e,Wl(()=>this.iterateCollection(t))}*iterateCollection(t){let{children:e,items:i}=t;if(g.isValidElement(e)&&e.type===g.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 n=0;for(let s of i)yield*this.getFullNode({value:s,index:n},{renderer:e}),n++}else{let n=[];g.Children.forEach(e,a=>{a&&n.push(a)});let s=0;for(let a of n){let r=this.getFullNode({element:a,index:s},{});for(let c of r)s++,yield c}}}getKey(t,e,i,n){if(t.key!=null)return t.key;if(e.type==="cell"&&e.key!=null)return`${n}${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 n?`${n}.${e.index}`:`$.${e.index}`}getChildState(t,e){return{renderer:e.renderer||t.renderer}}*getFullNode(t,e,i,n){if(g.isValidElement(t.element)&&t.element.type===g.Fragment){let c=[];g.Children.forEach(t.element.props.children,d=>{c.push(d)});let o=t.index??0;for(let d of c)yield*this.getFullNode({element:d,index:o++},e,i,n);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=n?n.key:null,yield c;return}s=e.renderer(t.value)}if(g.isValidElement(s)){let c=s.type;if(typeof c!="function"&&typeof c.getCollectionNode!="function"){let m=s.type;throw Error(`Unknown element <${m}> in collection.`)}let o=c.getCollectionNode(s.props,this.context),d=t.index??0,u=o.next();for(;!u.done&&u.value;){let m=u.value;t.index=d;let h=m.key??null;h??(h=m.element?null:this.getKey(s,t,e,i));let x=[...this.getFullNode({...m,key:h,index:d,wrapper:bc(t.wrapper,m.wrapper)},this.getChildState(e,m),i?`${i}${s.key}`:s.key,n)];for(let y of x){if(y.value=m.value??t.value??null,y.value&&this.cache.set(y.value,y),t.type&&y.type!==t.type)throw Error(`Unsupported type <${ki(y.type)}> in <${ki((n==null?void 0:n.type)??"unknown parent type")}>. Only <${ki(t.type)}> is supported.`);d++,yield y}u=o.next(x)}return}if(t.key==null||t.type==null)return;let a=this,r={type:t.type,props:t.props,key:t.key,parentKey:n?n.key:null,value:t.value??null,level:n?n.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:Wl(function*(){if(!t.hasChildNodes||!t.childNodes)return;let c=0;for(let o of t.childNodes()){o.key!=null&&(o.key=`${r.key}${o.key}`);let d=a.getFullNode({...o,index:c},a.getChildState(e,o),r.key,r);for(let u of d)c++,yield u}})};yield r}constructor(){this.cache=new WeakMap}};function Wl(t){let e=[],i=null;return{*[Symbol.iterator](){for(let n of e)yield n;i||(i=t());for(let n of i)e.push(n),yield n}}}function bc(t,e){if(t&&e)return i=>t(e(i));if(t)return t;if(e)return e}function ki(t){return t[0].toUpperCase()+t.slice(1)}function Yl(t,e,i){let n=(0,g.useMemo)(()=>new vc,[]),{children:s,items:a,collection:r}=t;return(0,g.useMemo)(()=>r||e(n.build({children:s,items:a},i)),[n,s,a,r,i,e])}function Ql(t,e){return typeof e.getChildren=="function"?e.getChildren(t.key):t.childNodes}function jc(t){return kc(t,0)}function kc(t,e){if(e<0)return;let i=0;for(let n of t){if(i===e)return n;i++}}function wi(t,e,i){if(e.parentKey===i.parentKey)return e.index-i.index;let n=[...Zl(t,e),e],s=[...Zl(t,i),i],a=n.slice(0,s.length).findIndex((r,c)=>r!==s[c]);return a===-1?n.findIndex(r=>r===i)>=0?1:(s.findIndex(r=>r===e),-1):(e=n[a],i=s[a],e.index-i.index)}function Zl(t,e){let i=[],n=e;for(;(n==null?void 0:n.parentKey)!=null;)n=t.getItem(n.parentKey),n&&i.unshift(n);return i}var Ci=new WeakMap;function Si(t,e){let{id:i}=Ci.get(t)??{};if(!i)throw Error("Unknown list");return`${i}-${wc(e)}`}function wc(t){return typeof t=="string"?t.replace(/\s*/g,""):""+t}var Xl={};Xl={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 Jl={};Jl={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 en={};en={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 tn={};tn={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 ln={};ln={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 nn={};nn={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 sn={};sn={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 an={};an={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 rn={};rn={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 on={};on={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 cn={};cn={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 dn={};dn={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 un={};un={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 mn={};mn={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 pn={};pn={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 hn={};hn={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 gn={};gn={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 fn={};fn={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 xn={};xn={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 yn={};yn={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 vn={};vn={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 bn={};bn={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 jn={};jn={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 kn={};kn={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 wn={};wn={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 Cn={};Cn={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 Sn={};Sn={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 _n={};_n={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 Nn={};Nn={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 In={};In={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 Kn={};Kn={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 Mn={};Mn={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 Dn={};Dn={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 An={};An={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 Ht={};Ht={"ar-AE":Xl,"bg-BG":Jl,"cs-CZ":en,"da-DK":tn,"de-DE":ln,"el-GR":nn,"en-US":sn,"es-ES":an,"et-EE":rn,"fi-FI":on,"fr-FR":cn,"he-IL":dn,"hr-HR":un,"hu-HU":mn,"it-IT":pn,"ja-JP":hn,"ko-KR":gn,"lt-LT":fn,"lv-LV":xn,"nb-NO":yn,"nl-NL":vn,"pl-PL":bn,"pt-BR":jn,"pt-PT":kn,"ro-RO":wn,"ru-RU":Cn,"sk-SK":Sn,"sl-SI":_n,"sr-SP":Nn,"sv-SE":In,"tr-TR":Kn,"uk-UA":Mn,"zh-CN":Dn,"zh-TW":An};function Cc(t){return t&&t.__esModule?t.default:t}function Sc(t,e){let{getRowText:i=c=>{var d,u;var o;return((d=(o=e.collection).getTextValue)==null?void 0:d.call(o,c))??((u=e.collection.getItem(c))==null?void 0:u.textValue)}}=t,n=zt(Cc(Ht),"@react-aria/grid"),s=e.selectionManager.rawSelection,a=(0,g.useRef)(s),r=(0,g.useCallback)(()=>{var m;if(!e.selectionManager.isFocused||s===a.current){a.current=s;return}let c=Pn(s,a.current),o=Pn(a.current,s),d=e.selectionManager.selectionBehavior==="replace",u=[];if(e.selectionManager.selectedKeys.size===1&&d){let h=e.selectionManager.selectedKeys.keys().next().value;if(h!=null&&e.collection.getItem(h)){let x=i(h);x&&u.push(n.format("selectedItem",{item:x}))}}else if(c.size===1&&o.size===0){let h=c.keys().next().value;if(h!=null){let x=i(h);x&&u.push(n.format("selectedItem",{item:x}))}}else if(o.size===1&&c.size===0){let h=o.keys().next().value;if(h!=null&&e.collection.getItem(h)){let x=i(h);x&&u.push(n.format("deselectedItem",{item:x}))}}e.selectionManager.selectionMode==="multiple"&&(u.length===0||s==="all"||s.size>1||a.current==="all"||((m=a.current)==null?void 0:m.size)>1)&&u.push(s==="all"?n.format("selectedAll"):n.format("selectedCount",{count:s.size})),u.length>0&&to(u.join(" ")),a.current=s},[s,e.selectionManager.selectedKeys,e.selectionManager.isFocused,e.selectionManager.selectionBehavior,e.selectionManager.selectionMode,e.collection,i,n]);Ko(()=>{if(e.selectionManager.isFocused)r();else{let c=requestAnimationFrame(r);return()=>cancelAnimationFrame(c)}},[s,e.selectionManager.isFocused])}function Pn(t,e){let i=new Set;if(t==="all"||e==="all")return i;for(let n of t.keys())e.has(n)||i.add(n);return i}function _c(t){return t&&t.__esModule?t.default:t}function Nc(t){let e=zt(_c(Ht),"@react-aria/grid"),i=co(),n=(i==="pointer"||i==="virtual"||i==null)&&typeof window<"u"&&"ontouchstart"in window;return Nl((0,g.useMemo)(()=>{let s=t.selectionManager.selectionMode,a=t.selectionManager.selectionBehavior,r;return n&&(r=e.format("longPressToSelect")),a==="replace"&&s!=="none"&&t.hasItemActions?r:void 0},[t.selectionManager.selectionMode,t.selectionManager.selectionBehavior,t.hasItemActions,e,n]))}function Ic(t){return t&&t.__esModule?t.default:t}function Kc(t,e){let{key:i}=t,n=e.selectionManager,s=jt(),a=!e.selectionManager.canSelectItem(i),r=e.selectionManager.isSelected(i),c=()=>n.toggleSelection(i),o=zt(Ic(Ht),"@react-aria/grid");return{checkboxProps:{id:s,"aria-label":o.format("select"),isSelected:r,isDisabled:a,onChange:c}}}function Mc(t,e,i){let{isVirtualized:n,keyboardDelegate:s,layoutDelegate:a,onAction:r,disallowTypeAhead:c,linkBehavior:o="action",keyboardNavigationBehavior:d="arrow",escapeKeyBehavior:u="clearSelection",shouldSelectOnPressUp:m}=t;!t["aria-label"]&&!t["aria-labelledby"]&&console.warn("An aria-label or aria-labelledby prop is required for accessibility.");let{listProps:h}=ql({selectionManager:e.selectionManager,collection:e.collection,disabledKeys:e.disabledKeys,ref:i,keyboardDelegate:s,layoutDelegate:a,isVirtualized:n,selectOnFocus:e.selectionManager.selectionBehavior==="replace",shouldFocusWrap:t.shouldFocusWrap,linkBehavior:o,disallowTypeAhead:c,autoFocus:t.autoFocus,escapeKeyBehavior:u}),x=jt(t.id);Ci.set(e,{id:x,onAction:r,linkBehavior:o,keyboardNavigationBehavior:d,shouldSelectOnPressUp:m});let y=Nc({selectionManager:e.selectionManager,hasItemActions:!!r}),j=cc(i,{isDisabled:e.collection.size!==0}),v=$e(Rt(t,{labelable:!0}),{role:"grid",id:x,"aria-multiselectable":e.selectionManager.selectionMode==="multiple"?"true":void 0},e.collection.size===0?{tabIndex:j?-1:0}:h,y);return n&&(v["aria-rowcount"]=e.collection.size,v["aria-colcount"]=1),Sc({},e),{gridProps:v}}var En={expand:{ltr:"ArrowRight",rtl:"ArrowLeft"},collapse:{ltr:"ArrowLeft",rtl:"ArrowRight"}};function Dc(t,e,i){var I,E,M;let{node:n,isVirtualized:s}=t,{direction:a}=Ot(),{onAction:r,linkBehavior:c,keyboardNavigationBehavior:o,shouldSelectOnPressUp:d}=Ci.get(e),u=So(),m=(0,g.useRef)(null),h=()=>{i.current!==null&&(m.current!=null&&n.key!==m.current||!hi(i.current))&&Ge(i.current)},x={},y=t.hasChildItems,j=e.selectionManager.isLink(n.key);if(n!=null&&"expandedKeys"in e){var v;let k=(I=(v=e.collection).getChildren)==null?void 0:I.call(v,n.key);y||(y=[...k??[]].length>1),r==null&&!j&&e.selectionManager.selectionMode==="none"&&y&&(r=()=>e.toggleKey(n.key));let D=y?e.expandedKeys.has(n.key):void 0,b=1,A=n.index;if(n.level>=0&&(n==null?void 0:n.parentKey)!=null){let z=e.collection.getItem(n.parentKey);if(z){let F=Ac(z,e.collection);b=[...F].filter(q=>q.type==="item").length,A>0&&F[0].type!=="item"&&--A}}else b=[...e.collection].filter(z=>z.level===0&&z.type==="item").length;x={"aria-expanded":D,"aria-level":n.level+1,"aria-posinset":A+1,"aria-setsize":b}}let{itemProps:_,...C}=Ll({selectionManager:e.selectionManager,key:n.key,ref:i,isVirtualized:s,shouldSelectOnPressUp:t.shouldSelectOnPressUp||d,onAction:r||(E=n.props)!=null&&E.onAction?kl((M=n.props)==null?void 0:M.onAction,r?()=>r(n.key):void 0):void 0,focus:h,linkBehavior:c}),w=k=>{let D=ut();if(!Je(k.currentTarget,He(k))||!i.current||!D)return;let b=Vt(i.current);if(b.currentNode=D,"expandedKeys"in e&&D===i.current){if(k.key===En.expand[a]&&e.selectionManager.focusedKey===n.key&&y&&!e.expandedKeys.has(n.key)){e.toggleKey(n.key),k.stopPropagation();return}else if(k.key===En.collapse[a]&&e.selectionManager.focusedKey===n.key&&y&&e.expandedKeys.has(n.key)){e.toggleKey(n.key),k.stopPropagation();return}}switch(k.key){case"ArrowLeft":if(o==="arrow"){let z=a==="rtl"?b.nextNode():b.previousNode();if(z)k.preventDefault(),k.stopPropagation(),Ge(z),et(z,{containingElement:at(i.current)});else if(k.preventDefault(),k.stopPropagation(),a==="rtl")Ge(i.current),et(i.current,{containingElement:at(i.current)});else{b.currentNode=i.current;let F=Tn(b);F&&(Ge(F),et(F,{containingElement:at(i.current)}))}}break;case"ArrowRight":if(o==="arrow"){let z=a==="rtl"?b.previousNode():b.nextNode();if(z)k.preventDefault(),k.stopPropagation(),Ge(z),et(z,{containingElement:at(i.current)});else if(k.preventDefault(),k.stopPropagation(),a==="ltr")Ge(i.current),et(i.current,{containingElement:at(i.current)});else{b.currentNode=i.current;let F=Tn(b);F&&(Ge(F),et(F,{containingElement:at(i.current)}))}}break;case"ArrowUp":case"ArrowDown":if(!k.altKey&&Je(i.current,He(k))){var A;k.stopPropagation(),k.preventDefault(),(A=i.current.parentElement)==null||A.dispatchEvent(new KeyboardEvent(k.nativeEvent.type,k.nativeEvent))}break}},p=k=>{if(m.current=n.key,He(k)!==i.current){uo()||e.selectionManager.setFocusedKey(n.key);return}},f=k=>{let D=ut();if(!(!Je(k.currentTarget,He(k))||!i.current||!D))switch(k.key){case"Tab":if(o==="tab"){let b=Vt(i.current,{tabbable:!0});b.currentNode=D,(k.shiftKey?b.previousNode():b.nextNode())&&k.stopPropagation()}}},N=Co(n.props),K=$e(_,C.hasAction?N:{},{role:"row",onKeyDownCapture:w,onKeyDown:f,onFocus:p,"aria-label":n["aria-label"]||n.textValue||void 0,"aria-selected":e.selectionManager.canSelectItem(n.key)?e.selectionManager.isSelected(n.key):void 0,"aria-disabled":e.selectionManager.isDisabled(n.key)||void 0,"aria-labelledby":u&&(n["aria-label"]||n.textValue)?`${Si(e,n.key)} ${u}`:void 0,id:Si(e,n.key)});if(s){let{collection:k}=e;K["aria-rowindex"]=[...k].find(D=>D.type==="section")?[...k.getKeys()].filter(D=>{var b;return((b=k.getItem(D))==null?void 0:b.type)!=="section"}).findIndex(D=>D===n.key)+1:n.index+1}let T={role:"gridcell","aria-colindex":1};return{rowProps:{...$e(K,x)},gridCellProps:T,descriptionProps:{id:u},...C}}function Tn(t){let e=null,i=null;do i=t.lastChild(),i&&(e=i);while(i);return e}function Ac(t,e){var r;let i=(r=e.getChildren)==null?void 0:r.call(e,t.key),n=i?Array.from(i):[],s=n.length>0?n[0]:null,a=[];for(;s;)a.push(s),s=s.nextKey==null?null:e.getItem(s.nextKey);return a}function Pc(t,e){let{key:i}=t,{checkboxProps:n}=Kc(t,e);return{checkboxProps:{...n,"aria-labelledby":`${n.id} ${Si(e,i)}`}}}function Ec(t,e,i){let{gridProps:n}=Mc(t,e,i);return n.role="treegrid",{gridProps:n}}var zn={};zn={collapse:"\u0637\u064A",expand:"\u062A\u0645\u062F\u064A\u062F"};var Fn={};Fn={collapse:"\u0421\u0432\u0438\u0432\u0430\u043D\u0435",expand:"\u0420\u0430\u0437\u0448\u0438\u0440\u044F\u0432\u0430\u043D\u0435"};var Bn={};Bn={collapse:"Sbalit",expand:"Rozt\xE1hnout"};var Rn={};Rn={collapse:"Skjul",expand:"Udvid"};var $n={};$n={collapse:"Reduzieren",expand:"Erweitern"};var Vn={};Vn={collapse:"\u03A3\u03CD\u03BC\u03C0\u03C4\u03C5\u03BE\u03B7",expand:"\u0391\u03BD\u03AC\u03C0\u03C4\u03C5\u03BE\u03B7"};var On={};On={expand:"Expand",collapse:"Collapse"};var Ln={};Ln={collapse:"Contraer",expand:"Ampliar"};var Gn={};Gn={collapse:"Ahenda",expand:"Laienda"};var Hn={};Hn={collapse:"Pienenn\xE4",expand:"Laajenna"};var Un={};Un={collapse:"R\xE9duire",expand:"D\xE9velopper"};var qn={};qn={collapse:"\u05DB\u05D5\u05D5\u05E5",expand:"\u05D4\u05E8\u05D7\u05D1"};var Wn={};Wn={collapse:"Sa\u017Emi",expand:"Pro\u0161iri"};var Yn={};Yn={collapse:"\xD6sszecsuk\xE1s",expand:"Kibont\xE1s"};var Qn={};Qn={collapse:"Comprimi",expand:"Espandi"};var Zn={};Zn={collapse:"\u6298\u308A\u305F\u305F\u3080",expand:"\u5C55\u958B"};var Xn={};Xn={collapse:"\uC811\uAE30",expand:"\uD3BC\uCE58\uAE30"};var Jn={};Jn={collapse:"Sutraukti",expand:"I\u0161skleisti"};var es={};es={collapse:"Sak\u013Caut",expand:"Izv\u0113rst"};var ts={};ts={collapse:"Skjul",expand:"Utvid"};var is={};is={collapse:"Samenvouwen",expand:"Uitvouwen"};var ls={};ls={collapse:"Zwi\u0144",expand:"Rozwi\u0144"};var ns={};ns={collapse:"Recolher",expand:"Expandir"};var ss={};ss={collapse:"Colapsar",expand:"Expandir"};var as={};as={collapse:"Restr\xE2nge\u021Bi",expand:"Extinde\u021Bi"};var rs={};rs={collapse:"\u0421\u0432\u0435\u0440\u043D\u0443\u0442\u044C",expand:"\u0420\u0430\u0437\u0432\u0435\u0440\u043D\u0443\u0442\u044C"};var os={};os={collapse:"Zbali\u0165",expand:"Rozbali\u0165"};var cs={};cs={collapse:"Strni",expand:"Raz\u0161iri"};var ds={};ds={collapse:" Skupi",expand:"Pro\u0161iri"};var us={};us={collapse:"D\xF6lj",expand:"Expandera"};var ms={};ms={collapse:"Daralt",expand:"Geni\u015Flet"};var ps={};ps={collapse:"\u0417\u0433\u043E\u0440\u043D\u0443\u0442\u0438",expand:"\u0420\u043E\u0437\u0433\u043E\u0440\u043D\u0443\u0442\u0438"};var hs={};hs={collapse:"\u6298\u53E0",expand:"\u6269\u5C55"};var gs={};gs={collapse:"\u6536\u5408",expand:"\u5C55\u958B"};var fs={};fs={"ar-AE":zn,"bg-BG":Fn,"cs-CZ":Bn,"da-DK":Rn,"de-DE":$n,"el-GR":Vn,"en-US":On,"es-ES":Ln,"et-EE":Gn,"fi-FI":Hn,"fr-FR":Un,"he-IL":qn,"hr-HR":Wn,"hu-HU":Yn,"it-IT":Qn,"ja-JP":Zn,"ko-KR":Xn,"lt-LT":Jn,"lv-LV":es,"nb-NO":ts,"nl-NL":is,"pl-PL":ls,"pt-BR":ns,"pt-PT":ss,"ro-RO":as,"ru-RU":rs,"sk-SK":os,"sl-SI":cs,"sr-SP":ds,"sv-SE":us,"tr-TR":ms,"uk-UA":ps,"zh-CN":hs,"zh-TW":gs};function Tc(t){return t&&t.__esModule?t.default:t}function xs(t,e,i){let{node:n}=t,s=Dc(t,e,i),a=s.rowProps["aria-expanded"]===!0,r=zt(Tc(fs),"@react-aria/tree"),c=oo({"aria-label":a?r.format("collapse"):r.format("expand"),"aria-labelledby":s.rowProps.id}),o={onPress:()=>{s.isDisabled||(e.toggleKey(n.key),e.selectionManager.setFocused(!0),e.selectionManager.setFocusedKey(n.key))},excludeFromTabOrder:!0,preventFocusOnPress:!0,"data-react-aria-prevent-focus":!0,...c};return{...s,expandButtonProps:o}}var rt=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 n=this.clone();return e.addDescendants(n,t),n}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}},ys=class extends rt{filter(t,e,i){let[n,s]=js(t,e,this.firstChildKey,i),a=this.clone();return a.firstChildKey=n,a.lastChildKey=s,a}},zc=class extends rt{};zc.type="header";var _i=class extends rt{};_i.type="loader";var vs=class extends ys{filter(t,e,i){if(i(this.textValue,this)){let n=this.clone();return e.addDescendants(n,t),n}return null}};vs.type="item";var Fc=class extends ys{filter(t,e,i){let n=super.filter(t,e,i);if(n&&n.lastChildKey!==null){let s=t.getItem(n.lastChildKey);if(s&&s.type!=="header")return n}return null}};Fc.type="section";var bs=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),n=(i==null?void 0:i.firstChildKey)==null?null:e.get(i.firstChildKey);for(;n;)yield n,n=n.nextKey==null?void 0:e.get(n.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 n of i)this.addDescendants(n,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,n]=js(this,e,this.firstKey,t);return e==null||e.commit(i,n),e}constructor(){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.frozen=!1,this.itemCount=0}};function js(t,e,i,n){if(i==null)return[null,null];let s=null,a=null,r=t.getItem(i);for(;r!=null;){let c=r.filter(t,e,n);c!=null&&(c.nextKey=null,a&&(c.prevKey=a.key,a.nextKey=c.key),s??(s=c),e.addNode(c),a=c),r=r.nextKey?t.getItem(r.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 ks=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}},Ni=class Vi extends ks{get index(){return this._index}set index(e){this._index=e,this.ownerDocument.markDirty(this)}get level(){var e;return this.parentNode instanceof Vi?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 n,s,a,r,c,o,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 Vi?((n=this.parentNode.node)==null?void 0:n.key)??null:null,i.prevKey=((a=(s=this.previousVisibleSibling)==null?void 0:s.node)==null?void 0:a.key)??null,i.nextKey=((r=e==null?void 0:e.node)==null?void 0:r.key)??null,i.hasChildNodes=!!this.firstChild,i.firstChildKey=((o=(c=this.firstVisibleChild)==null?void 0:c.node)==null?void 0:o.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 m=(i.colIndex??i.index)+(i.colSpan??1);if(e.node!=null&&m!==e.node.colIndex){let h=e.getMutableNode();h.colIndex=m}}}setProps(e,i,n,s,a){let r,{value:c,textValue:o,id:d,...u}=e;if(this.node==null?(r=new n(d??`react-aria-${++this.ownerDocument.nodeId}`),this.node=r):r=this.getMutableNode(),u.ref=i,r.props=u,r.rendered=s,r.render=a,r.value=c,e["aria-label"]&&(r["aria-label"]=e["aria-label"]),r.textValue=o||(typeof u.children=="string"?u.children:"")||e["aria-label"]||"",d!=null&&d!==r.key)throw Error("Cannot change the id of an item");u.colSpan!=null&&(r.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 n=i==="none";if(e.isHidden!==n){(((s=e.parentNode)==null?void 0:s.firstVisibleChild)===e||((a=e.parentNode)==null?void 0:a.lastVisibleChild)===e)&&e.ownerDocument.markDirty(e.parentNode);let r=e.previousVisibleSibling,c=e.nextVisibleSibling;r&&e.ownerDocument.markDirty(r),c&&e.ownerDocument.markDirty(c),e.isHidden=n,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}},Bc=class extends ks{get isConnected(){return!0}createElement(t){return new Ni(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,n;for(let s of this.dirtyNodes)s instanceof Ni&&(!s.isConnected||s.isHidden)?this.removeNode(s):s.updateChildIndices();for(let s of this.dirtyNodes)s instanceof Ni?(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,((n=(i=this.lastVisibleChild)==null?void 0:i.node)==null?void 0:n.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 Ii(t){let{children:e,items:i,idScope:n,addIdAndValue:s,dependencies:a=[]}=t,r=(0,g.useMemo)(()=>new WeakMap,a);return(0,g.useMemo)(()=>{if(i&&typeof e=="function"){let c=[];for(let o of i){let d=r.get(o);if(!d){d=e(o);let u=d.props.id??o.key??o.id;if(u==null)throw Error("Could not determine key for item");n!=null&&(u=n+":"+u),d=(0,g.cloneElement)(d,s?{key:u,id:u,value:o}:{key:u}),r.set(o,d)}c.push(d)}return c}else if(typeof e!="function")return e},[e,i,r,n,s])}var Rc=Yi(),$c=br(),ws=(0,g.createContext)(!1),wt=(0,g.createContext)(null);function Cs(t){if((0,g.useContext)(wt))return t.content;let{collection:e,document:i}=Gc(t.createCollection);return g.createElement(g.Fragment,null,g.createElement(ao,null,g.createElement(wt.Provider,{value:i},t.content)),g.createElement(Vc,{render:t.children,collection:e}))}function Vc({collection:t,render:e}){return e(t)}function Oc(t,e,i){let n=Sl(),s=(0,g.useRef)(n);return s.current=n,(0,$c.useSyncExternalStore)(t,(0,g.useCallback)(()=>s.current?i():e(),[e,i]))}var Lc=typeof g.useSyncExternalStore=="function"?g.useSyncExternalStore:Oc;function Gc(t){let[e]=(0,g.useState)(()=>new Bc((t==null?void 0:t())||new bs));return{collection:Lc((0,g.useCallback)(i=>e.subscribe(i),[e]),(0,g.useCallback)(()=>{let i=e.getCollection();return e.isSSR&&e.resetAfterSSR(),i},[e]),(0,g.useCallback)(()=>(e.isSSR=!0,e.getCollection()),[e])),document:e}}var Ki=(0,g.createContext)(null);function Hc(t){var e;return e=class extends rt{},e.type=t,e}function Ss(t,e,i,n,s,a){typeof t=="string"&&(t=Hc(t));let r=(0,g.useCallback)(o=>{o==null||o.setProps(e,i,t,n,a)},[e,i,n,a,t]),c=(0,g.useContext)(Ki);if(c){let o=c.ownerDocument.nodesByProps.get(e);return o||(o=c.ownerDocument.createElement(t.type),o.setProps(e,i,t,n,a),c.appendChild(o),c.ownerDocument.updateCollection(),c.ownerDocument.nodesByProps.set(e,o)),s?g.createElement(Ki.Provider,{value:o},s):null}return g.createElement(t.type,{ref:r},s)}function Mi(t,e){let i=({node:s})=>e(s.props,s.props.ref,s),n=(0,g.forwardRef)((s,a)=>{let r=(0,g.useContext)(xl);if(!(0,g.useContext)(ws)){if(e.length>=3)throw Error(e.name+" cannot be rendered outside a collection.");return e(s,a)}return Ss(t,s,a,"children"in s?s.children:null,null,c=>g.createElement(xl.Provider,{value:r},g.createElement(i,{node:c})))});return n.displayName=e.name,n}function Uc(t,e,i=_s){let n=({node:a})=>e(a.props,a.props.ref,a),s=(0,g.forwardRef)((a,r)=>Ss(t,a,r,null,i(a),c=>g.createElement(n,{node:c}))??g.createElement(g.Fragment,null));return s.displayName=e.name,s}function _s(t){return Ii({...t,addIdAndValue:!0})}var Ns=(0,g.createContext)(null);function Is(t){let e=(0,g.useContext)(Ns),i=((e==null?void 0:e.dependencies)||[]).concat(t.dependencies),n=t.idScope??(e==null?void 0:e.idScope),s=_s({...t,idScope:n,dependencies:i});return(0,g.useContext)(wt)&&(s=g.createElement(qc,null,s)),e=(0,g.useMemo)(()=>({dependencies:i,idScope:n}),[n,...i]),g.createElement(Ns.Provider,{value:e},s)}function qc({children:t}){let e=(0,g.useContext)(wt),i=(0,g.useMemo)(()=>g.createElement(wt.Provider,{value:null},g.createElement(ws.Provider,{value:!0},t)),[t]);return Sl()?g.createElement(Ki.Provider,{value:e},i):(0,Rc.createPortal)(i,e)}var Wc=(0,g.createContext)(null),Ks={CollectionRoot({collection:t,renderDropIndicator:e}){return Ms(t,null,e)},CollectionBranch({collection:t,parent:e,renderDropIndicator:i}){return Ms(t,e,i)}};function Ms(t,e,i){return Ii({items:e?t.getChildren(e.key):t,dependencies:[i],children(n){if(n.type==="content")return g.createElement(g.Fragment,null);let s=n.render(n);return!i||n.type!=="item"?s:g.createElement(g.Fragment,null,i({type:"item",key:n.key,dropPosition:"before"}),s,Yc(t,n,i))}})}function Yc(t,e,i){let n=e.key,s=t.getKeyAfter(n),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 r=e.nextKey==null?null:t.getItem(e.nextKey);for(;r!=null&&r.type!=="item";)r=r.nextKey==null?null:t.getItem(r.nextKey);let c=[];if(r==null){let o=e;for(;(o==null?void 0:o.type)==="item"&&(!a||o.parentKey!==a.parentKey&&a.level<o.level);){let d=i({type:"item",key:o.key,dropPosition:"after"});(0,g.isValidElement)(d)&&c.push((0,g.cloneElement)(d,{key:`${o.key}-after`})),o=o.parentKey==null?null:t.getItem(o.parentKey)}}return c}var Ut=(0,g.createContext)(Ks),We=class Ma extends Set{constructor(e,i,n){super(e),e instanceof Ma?(this.anchorKey=i??e.anchorKey,this.currentKey=n??e.currentKey):(this.anchorKey=i??null,this.currentKey=n??null)}};function Qc(t,e){if(t.size!==e.size)return!1;for(let i of t)if(!e.has(i))return!1;return!0}function Ds(t){let{selectionMode:e="none",disallowEmptySelection:i=!1,allowDuplicateSelectionEvents:n,selectionBehavior:s="toggle",disabledBehavior:a="all"}=t,r=(0,g.useRef)(!1),[,c]=(0,g.useState)(!1),o=(0,g.useRef)(null),d=(0,g.useRef)(null),[,u]=(0,g.useState)(null),[m,h]=di((0,g.useMemo)(()=>As(t.selectedKeys),[t.selectedKeys]),(0,g.useMemo)(()=>As(t.defaultSelectedKeys,new We),[t.defaultSelectedKeys]),t.onSelectionChange),x=(0,g.useMemo)(()=>t.disabledKeys?new Set(t.disabledKeys):new Set,[t.disabledKeys]),[y,j]=(0,g.useState)(s);s==="replace"&&y==="toggle"&&typeof m=="object"&&m.size===0&&j("replace");let v=(0,g.useRef)(s);return(0,g.useEffect)(()=>{s!==v.current&&(j(s),v.current=s)},[s]),{selectionMode:e,disallowEmptySelection:i,selectionBehavior:y,setSelectionBehavior:j,get isFocused(){return r.current},setFocused(_){r.current=_,c(_)},get focusedKey(){return o.current},get childFocusStrategy(){return d.current},setFocusedKey(_,C="first"){o.current=_,d.current=C,u(_)},selectedKeys:m,setSelectedKeys(_){(n||!Qc(_,m))&&h(_)},disabledKeys:x,disabledBehavior:a}}function As(t,e){return t?t==="all"?"all":new We(t):e}var Ps=class Da{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(n=>i.has(n)),this._isSelectAll}get firstSelectedKey(){let e=null;for(let i of this.state.selectedKeys){let n=this.collection.getItem(i);(!e||n&&wi(this.collection,n,e)<0)&&(e=n)}return(e==null?void 0:e.key)??null}get lastSelectedKey(){let e=null;for(let i of this.state.selectedKeys){let n=this.collection.getItem(i);(!e||n&&wi(this.collection,n,e)>0)&&(e=n)}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 n;if(this.state.selectedKeys==="all")n=new We([i],i,i);else{let s=this.state.selectedKeys,a=s.anchorKey??i;n=new We(s,a,i);for(let r of this.getKeyRange(a,s.currentKey??i))n.delete(r);for(let r of this.getKeyRange(i,a))this.canSelectItem(r)&&n.add(r)}this.state.setSelectedKeys(n)}getKeyRange(e,i){let n=this.collection.getItem(e),s=this.collection.getItem(i);return n&&s?wi(this.collection,n,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 n=[],s=e;for(;s!=null;){let r=this.collection.getItem(s);if(r&&(r.type==="item"||r.type==="cell"&&this.allowsCellSelection)&&n.push(s),s===i)return n;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 n=new We(this.state.selectedKeys==="all"?this.getSelectAllKeys():this.state.selectedKeys);n.has(i)?n.delete(i):this.canSelectItem(i)&&(n.add(i),n.anchorKey=i,n.currentKey=i),!(this.disallowEmptySelection&&n.size===0)&&this.state.setSelectedKeys(n)}replaceSelection(e){if(this.selectionMode==="none")return;let i=this.getKey(e);if(i==null)return;let n=this.canSelectItem(i)?new We([i],i,i):new We;this.state.setSelectedKeys(n)}setSelectedKeys(e){if(this.selectionMode==="none")return;let i=new We;for(let n of e){let s=this.getKey(n);if(s!=null&&(i.add(s),this.selectionMode==="single"))break}this.state.setSelectedKeys(i)}getSelectAllKeys(){let e=[],i=n=>{var s;for(;n!=null;){if(this.canSelectItem(n)){let a=this.collection.getItem(n);(a==null?void 0:a.type)==="item"&&e.push(n),a!=null&&a.hasChildNodes&&(this.allowsCellSelection||a.type!=="item")&&i(((s=jc(Ql(a,this.collection)))==null?void 0:s.key)??null)}n=this.collection.getKeyAfter(n)}};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 We)}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 n of e)if(!i.has(n))return!1;for(let n of i)if(!e.has(n))return!1;return!0}canSelectItem(e){var n;if(this.state.selectionMode==="none"||this.state.disabledKeys.has(e))return!1;let i=this.collection.getItem(e);return!(!i||i!=null&&((n=i.props)!=null&&n.isDisabled)||i.type==="cell"&&!this.allowsCellSelection)}isDisabled(e){var n;var i;return this.state.disabledBehavior==="all"&&(this.state.disabledKeys.has(e)||!!((i=this.collection.getItem(e))!=null&&((n=i.props)!=null&&n.isDisabled)))}isLink(e){var n;var i;return!!((i=this.collection.getItem(e))!=null&&((n=i.props)!=null&&n.href))}getItemProps(e){var i;return(i=this.collection.getItem(e))==null?void 0:i.props}withCollection(e){return new Da(e,this.state,{allowsCellSelection:this.allowsCellSelection,layoutDelegate:this.layoutDelegate||void 0})}constructor(e,i,n){this.collection=e,this.state=i,this.allowsCellSelection=(n==null?void 0:n.allowsCellSelection)??!1,this._isSelectAll=null,this.layoutDelegate=(n==null?void 0:n.layoutDelegate)||null}},Zc=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 r of a.childNodes)i(r)};for(let a of t)i(a);let n=null,s=0;for(let[a,r]of this.keyMap)n?(n.nextKey=a,r.prevKey=n.key):(this.firstKey=a,r.prevKey=void 0),r.type==="item"&&(r.index=s++),n=r,n.nextKey=void 0;this.lastKey=(n==null?void 0:n.key)??null}};function Xc(t){let{onExpandedChange:e}=t,[i,n]=di(t.expandedKeys?new Set(t.expandedKeys):void 0,t.defaultExpandedKeys?new Set(t.defaultExpandedKeys):new Set,e),s=Ds(t),a=(0,g.useMemo)(()=>t.disabledKeys?new Set(t.disabledKeys):new Set,[t.disabledKeys]),r=Yl(t,(0,g.useCallback)(c=>new Zc(c,{expandedKeys:i}),[i]),null);return(0,g.useEffect)(()=>{s.focusedKey!=null&&!r.getItem(s.focusedKey)&&s.setFocusedKey(null)},[r,s.focusedKey]),{collection:r,expandedKeys:i,disabledKeys:a,toggleKey:c=>{n(Jc(i,c))},setExpandedKeys:n,selectionManager:new Ps(r,s)}}function Jc(t,e){let i=new Set(t);return i.has(e)?i.delete(e):i.add(e),i}var Ct=(0,g.createContext)({}),Di=(0,g.createContext)(null),ed=(0,g.forwardRef)(function(t,e){let{render:i}=(0,g.useContext)(Di);return g.createElement(g.Fragment,null,i(t,e))});function Es(t,e){var a;let i=t==null?void 0:t.renderDropIndicator,n=(a=t==null?void 0:t.isVirtualDragging)==null?void 0:a.call(t),s=(0,g.useCallback)(r=>{if(n||e!=null&&e.isDropTarget(r))return i?i(r):g.createElement(ed,{target:r})},[e==null?void 0:e.target,n,i]);return t!=null&&t.useDropIndicator?s:void 0}function Ts(t,e,i){var a,r,c;let n=t.focusedKey,s=null;if(e!=null&&((a=e.isVirtualDragging)!=null&&a.call(e))&&((r=i==null?void 0:i.target)==null?void 0:r.type)==="item"&&(s=i.target.key,i.target.dropPosition==="after")){let o=i.collection.getKeyAfter(s),d=null;if(o!=null){let u=((c=i.collection.getItem(s))==null?void 0:c.level)??0;for(;o;){let m=i.collection.getItem(o);if(!m)break;if(m.type!=="item"){o=i.collection.getKeyAfter(o);continue}if((m.level??0)<=u)break;d=o,o=i.collection.getKeyAfter(o)}}s=o??d??s}return(0,g.useMemo)(()=>new Set([n,s].filter(o=>o!=null)),[n,s])}var zs=10,Fs=5,td=class{setup(t,e,i){this.delegate=t,this.state=e,this.direction=i}getDropTargetFromPoint(t,e,i){let n=this.delegate.getDropTargetFromPoint(t,e,i);return!n||n.type==="root"?n:this.resolveDropTarget(n,t,e,i)}resolveDropTarget(t,e,i,n){let s=this.pointerTracking,a=i-s.lastY,r=e-s.lastX,c=s.yDirection,o=s.xDirection;if(Math.abs(a)>Fs&&(c=a>0?"down":"up",s.yDirection=c,s.lastY=i),Math.abs(r)>zs&&(o=r>0?"right":"left",s.xDirection=o,s.lastX=e),t.dropPosition==="before"){let m=this.state.collection.getKeyBefore(t.key);if(m!=null){let h={type:"item",key:m,dropPosition:"after"};n(h)&&(t=h)}}let d=this.getPotentialTargets(t,n);if(d.length===0)return{type:"root"};let u;return d.length>1?u=this.selectTarget(d,t,e,i,c,o):(u=d[0],s.boundaryContext=null),u}getPotentialTargets(t,e){if(t.dropPosition==="on")return[t];let i=t,n=this.state.collection,s=n.getItem(i.key);for(;s&&(s==null?void 0:s.type)!=="item"&&s.nextKey!=null;)i.key=s.nextKey,s=n.getItem(s.nextKey);let a=[i];if(s&&s.hasChildNodes&&this.state.expandedKeys.has(s.key)&&n.getChildren&&i.dropPosition==="after"){let o=null;for(let d of n.getChildren(s.key))if(d.type==="item"){o=d;break}if(o){let d={type:"item",key:o.key,dropPosition:"before"};return e(d)?[d]:[]}}if((s==null?void 0:s.nextKey)!=null)return[t];let r=s==null?void 0:s.parentKey,c=[];for(;r;){let o=n.getItem(r),d=o!=null&&o.nextKey?n.getItem(o.nextKey):null;if(!d||d.parentKey!==r){let u={type:"item",key:r,dropPosition:"after"};if(e(u)&&c.push(u),d)break}r=o==null?void 0:o.parentKey}if(c.length>0&&a.push(...c),a.length===1){let o=n.getKeyAfter(i.key),d=o?n.getItem(o):null;if(o!=null&&d&&s&&d.level!=null&&s.level!=null&&d.level>s.level){let u={type:"item",key:o,dropPosition:"before"};if(e(u))return[u]}}return a.filter(e)}selectTarget(t,e,i,n,s,a){var u;if(t.length<2)return t[0];let r=this.pointerTracking,c=(u=this.state.collection.getItem(e.key))==null?void 0:u.parentKey;if(!c)return t[0];(!r.boundaryContext||r.boundaryContext.parentKey!==c)&&(r.boundaryContext={parentKey:c,preferredTargetIndex:r.yDirection==="up"?t.length-1:0,lastSwitchY:n,lastSwitchX:i});let o=r.boundaryContext,d=Math.abs(i-o.lastSwitchX);if(Math.abs(n-o.lastSwitchY)>Fs&&s){let m=o.preferredTargetIndex||0;s==="down"&&m===0?o.preferredTargetIndex=t.length-1:s==="up"&&m===t.length-1&&(o.preferredTargetIndex=0),r.xDirection=null}if(d>zs&&a){let m=o.preferredTargetIndex||0;a==="left"?this.direction==="ltr"?m<t.length-1&&(o.preferredTargetIndex=m+1,o.lastSwitchX=i):m>0&&(o.preferredTargetIndex=m-1,o.lastSwitchX=i):a==="right"&&(this.direction==="ltr"?m>0&&(o.preferredTargetIndex=m-1,o.lastSwitchX=i):m<t.length-1&&(o.preferredTargetIndex=m+1,o.lastSwitchX=i)),r.yDirection=null}return t[Math.max(0,Math.min(o.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}}},id=class Oi extends bs{withExpandedKeys(e,i){let n=this.clone();return n.expandedKeys=i,Oi.cloneAncestorSections(i,e,n),Oi.cloneAncestorSections(e,i,n),n.frozen=this.frozen,n}static cloneAncestorSections(e,i,n){for(let s of e)if(!i.has(s)){let a=s;for(;a!=null;){let r=n.getItem(a);if((r==null?void 0:r.type)==="section"){n.keyMap.set(a,r.clone());break}else a=(r==null?void 0:r.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 n=this.getKeyAfter(i.key);i=n?this.getItem(n):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 n=i.getItem(e),s=(n==null?void 0:n.firstChildKey)==null?null:i.getItem(n.firstChildKey);if(n&&n.type==="section"&&s)for(;s&&s.key!==n.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}},ld=(0,g.createContext)(null),Ai=(0,g.createContext)(null),nd=(0,g.forwardRef)(function(t,e){return[t,e]=io(t,e,ld),g.createElement(Cs,{content:g.createElement(Is,t),createCollection:()=>new id},i=>g.createElement(sd,{props:t,collection:i,treeRef:e}))}),Bs={expand:{ltr:"ArrowRight",rtl:"ArrowLeft"},collapse:{ltr:"ArrowLeft",rtl:"ArrowRight"}};function sd({props:t,collection:e,treeRef:i}){let{dragAndDropHooks:n}=t,{direction:s}=Ot(),a=Il({usage:"search",sensitivity:"base"}),r=!!(n!=null&&n.useDraggableCollectionState),c=!!(n!=null&&n.useDroppableCollectionState),o=(0,g.useRef)(r),d=(0,g.useRef)(c);(0,g.useEffect)(()=>{o.current!==r&&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.")},[r,c]);let{selectionMode:u="none",expandedKeys:m,defaultExpandedKeys:h,onExpandedChange:x,disabledBehavior:y="all"}=t,{CollectionRoot:j,isVirtualized:v,layoutDelegate:_,dropTargetDelegate:C}=(0,g.useContext)(Ut),[w,p]=di(m?new Set(m):void 0,h?new Set(h):new Set,x),[f,N]=(0,g.useState)(e),[K,T]=(0,g.useState)(w),[I,E]=(0,g.useState)(()=>e.withExpandedKeys(K,w));(!dd(K,w)||e!==f)&&(E(e.withExpandedKeys(K,w)),N(e),T(w));let M=Xc({...t,selectionMode:u,expandedKeys:w,onExpandedChange:p,collection:I,children:void 0,disabledBehavior:y}),{gridProps:k}=Ec({...t,isVirtualized:v,layoutDelegate:_},M,i),D,b,A,z=!1,F=null,q=(0,g.useRef)(null);if(r&&n){D=n.useDraggableCollectionState({collection:M.collection,selectionManager:M.selectionManager,preview:n.renderDragPreview?q:void 0}),n.useDraggableCollection({},D,i);let P=n.DragPreview;F=n.renderDragPreview?g.createElement(P,{ref:q},n.renderDragPreview):null}let[Y]=(0,g.useState)(()=>new td);if(c&&n){b=n.useDroppableCollectionState({collection:M.collection,selectionManager:M.selectionManager});let P=n.dropTargetDelegate||C||new n.ListDropTargetDelegate(M.collection,i,{direction:s});Y.setup(P,M,s);let X=new ji({collection:M.collection,collator:a,ref:i,disabledKeys:M.selectionManager.disabledKeys,disabledBehavior:M.selectionManager.disabledBehavior,direction:s,layoutDelegate:_});A=n.useDroppableCollection({keyboardDelegate:X,dropTargetDelegate:Y,onDropActivate:Q=>{var J;if(Q.target.type==="item"){let te=Q.target.key,ie=M.collection.getItem(te),fe=w.has(te);ie&&ie.hasChildNodes&&(!fe||n!=null&&((J=n.isVirtualDragging)!=null&&J.call(n)))&&M.toggleKey(te)}},onKeyDown:Q=>{let J=b==null?void 0:b.target;if(J&&J.type==="item"&&J.dropPosition==="on"){let te=M.collection.getItem(J.key);(Q.key===Bs.expand[s]&&(te!=null&&te.hasChildNodes)&&!M.expandedKeys.has(J.key)||Q.key===Bs.collapse[s]&&(te!=null&&te.hasChildNodes)&&M.expandedKeys.has(J.key))&&M.toggleKey(J.key)}}},b,i);let Z=b.getDropOperation;b.getDropOperation=Q=>{var fe;let{target:J,isInternal:te}=Q,ie=(D==null?void 0:D.draggingKeys)??new Set;if(te&&J.type==="item"&&ie.size>0){if(ie.has(J.key)&&J.dropPosition==="on")return"cancel";let me=J.key;for(;me!=null;){let de=(fe=M.collection.getItem(me))==null?void 0:fe.parentKey;if(de!=null&&ie.has(de))return"cancel";me=de??null}}return Z(Q)},z=b.isDropTarget({type:"root"})}let S=!!(r&&!(D!=null&&D.isDisabled)),{focusProps:W,isFocused:ee,isFocusVisible:oe}=ci(),ce={isEmpty:M.collection.size===0,isFocused:ee,isFocusVisible:oe,isDropTarget:z,selectionMode:M.selectionManager.selectionMode,allowsDragging:!!S,state:M},he=vt({...t,children:void 0,defaultClassName:"react-aria-Tree",values:ce}),ue=null;if(M.collection.size===0&&t.renderEmptyState){let{isEmpty:P,...X}=ce,Z=t.renderEmptyState({...X});ue=g.createElement("div",{role:"row",style:{display:"contents"},"aria-level":1},g.createElement("div",{role:"gridcell",style:{display:"contents"}},Z))}let ge=Rt(t,{global:!0});return g.createElement(g.Fragment,null,g.createElement(No,null,g.createElement(Ft.div,{...$e(ge,he,k,W,A==null?void 0:A.collectionProps),ref:i,slot:t.slot||void 0,"data-empty":M.collection.size===0||void 0,"data-focused":ee||void 0,"data-drop-target":z||void 0,"data-focus-visible":oe||void 0,"data-selection-mode":M.selectionManager.selectionMode==="none"?void 0:M.selectionManager.selectionMode,"data-allows-dragging":!!S||void 0},g.createElement(fl,{values:[[Ai,M],[Ct,{dragAndDropHooks:n,dragState:D,dropState:b}],[Di,{render:ad}]]},c&&g.createElement(cd,null),g.createElement(Fo,null,g.createElement(j,{collection:M.collection,persistedKeys:Ts(M.selectionManager,n,b),scrollRef:i,renderDropIndicator:Es(n,b)}))),ue)),F)}var Rs=class extends rt{};Rs.type="content";var $s=Mi(Rs,function(t){let e=(0,g.useContext)(Vs),i=vt({children:t.children,values:e});return g.createElement(Ut.Provider,{value:Ks},i.children)}),Vs=(0,g.createContext)(null),Os=class extends rt{};Os.type="item";var Ls=Uc(Os,(t,e,i)=>{let n=(0,g.useContext)(Ai);e=ui(e);let{dragAndDropHooks:s,dragState:a,dropState:r}=(0,g.useContext)(Ct),{rowProps:c,gridCellProps:o,expandButtonProps:d,descriptionProps:u,...m}=xs({node:i,shouldSelectOnPressUp:!!a},n,e),h=c["aria-expanded"]===!0,x=t.hasChildItems||[...n.collection.getChildren(i.key)].length>1,y=c["aria-level"]||1,{hoverProps:j,isHovered:v}=no({isDisabled:!m.allowsSelection&&!m.hasAction,onHoverStart:t.onHoverStart,onHoverChange:t.onHoverChange,onHoverEnd:t.onHoverEnd}),{isFocusVisible:_,focusProps:C}=ci(),{isFocusVisible:w,focusProps:p}=ci({within:!0}),{checkboxProps:f}=Pc({key:i.key},n),N=null;a&&s&&(N=s.useDraggableItem({key:i.key,hasDragButton:!0},a));let K=null,T=(0,g.useRef)(null),I=(0,g.useRef)(null),E=(0,g.useRef)(null),{visuallyHiddenProps:M}=fi();r&&s&&(K=s.useDropIndicator({target:{type:"item",key:i.key,dropPosition:"on"},activateButtonRef:E},r,I));let k=a&&a.isDragging(i.key),D=K==null?void 0:K.isDropTarget,b=n.selectionManager.selectionMode,A=n.selectionManager.selectionBehavior,z=g.useMemo(()=>({...m,isHovered:v,isFocusVisible:_,isExpanded:h,hasChildItems:x,level:y,selectionMode:b,selectionBehavior:A,isFocusVisibleWithin:w,state:n,id:i.key,allowsDragging:!!a,isDragging:k,isDropTarget:D}),[m,v,_,h,x,y,w,n,i.key,a,k,D,A,b]),F=vt({...t,id:void 0,children:i.rendered,defaultClassName:"react-aria-TreeItem",defaultStyle:{"--tree-item-level":y},values:z});(0,g.useEffect)(()=>{i.textValue},[i.textValue]),(0,g.useEffect)(()=>{x&&T.current},[]);let q=(0,g.useRef)(null);(0,g.useEffect)(()=>{a&&q.current},[]);let Y=Ii({items:n.collection.getChildren(i.key),children:ee=>{switch(ee.type){case"content":return ee.render(ee);case"loader":case"item":return g.createElement(g.Fragment,null);default:throw Error("Unsupported element type in TreeRow: "+ee.type)}}}),S=jt(),W=Rt(t,{global:!0});return delete W.id,delete W.onClick,g.createElement(g.Fragment,null,K&&!K.isHidden&&g.createElement("div",{role:"row","aria-level":c["aria-level"],"aria-expanded":c["aria-expanded"],"aria-label":K.dropIndicatorProps["aria-label"]},g.createElement("div",{role:"gridcell","aria-colindex":1,style:{display:"contents"}},g.createElement("div",{role:"button",...M,...K.dropIndicatorProps,ref:I}),c["aria-expanded"]==null?null:g.createElement("div",{role:"button",...M,id:S,"aria-label":d["aria-label"],"aria-labelledby":`${S} ${c.id}`,tabIndex:-1,ref:E}))),g.createElement(Ft.div,{...$e(W,c,C,j,p,N==null?void 0:N.dragProps),...F,ref:e,"data-expanded":x&&h||void 0,"data-has-child-items":x||void 0,"data-level":y,"data-selected":m.isSelected||void 0,"data-disabled":m.isDisabled||void 0,"data-hovered":v||void 0,"data-focused":m.isFocused||void 0,"data-focus-visible":_||void 0,"data-pressed":m.isPressed||void 0,"data-selection-mode":n.selectionManager.selectionMode==="none"?void 0:n.selectionManager.selectionMode,"data-allows-dragging":!!a||void 0,"data-dragging":k||void 0,"data-drop-target":D||void 0},g.createElement("div",{...o,style:{display:"contents"}},g.createElement(fl,{values:[[Io,{slots:{selection:f}}],[ro,{slots:{[lo]:{},chevron:{...d,ref:T},drag:{...N==null?void 0:N.dragButtonProps,ref:q,style:{pointerEvents:"none"}}}}],[Vs,{...z}],[Bo,{isSelected:m.isSelected}]]},Y))))});Mi(_i,function(t,e,i){let{isVirtualized:n}=(0,g.useContext)(Ut),s=(0,g.useContext)(Ai),{isLoading:a,onLoadMore:r,scrollOffset:c,...o}=t,d=(0,g.useRef)(null);Bl((0,g.useMemo)(()=>({onLoadMore:r,collection:s==null?void 0:s.collection,sentinelRef:d,scrollOffset:c}),[r,c,s==null?void 0:s.collection]),d),e=ui(e);let{rowProps:u,gridCellProps:m}=xs({node:i},s,e),h=u["aria-level"]||1,x={role:"row","aria-level":u["aria-level"]},y=vt({...o,id:void 0,children:i.rendered,defaultClassName:"react-aria-TreeLoader",values:{level:h}}),j={};return n&&(j={display:"contents"}),g.createElement(g.Fragment,null,g.createElement("div",{style:{position:"relative",width:0,height:0},inert:Rl(!0)},g.createElement("div",{"data-testid":"loadMoreSentinel",ref:d,style:{position:"absolute",height:1,width:1}})),a&&y.children&&g.createElement(Ft.div,{ref:e,...$e(Rt(t),x),...y,"data-level":h},g.createElement("div",{...m,style:j},y.children)))});function ad(t,e){var d;e=ui(e);let{dragAndDropHooks:i,dropState:n}=(0,g.useContext)(Ct),s=(0,g.useRef)(null),{dropIndicatorProps:a,isHidden:r,isDropTarget:c}=i.useDropIndicator(t,n,s);if(r)return null;let o=n&&t.target.type==="item"?(((d=n.collection.getItem(t.target.key))==null?void 0:d.level)||0)+1:1;return g.createElement(od,{...t,dropIndicatorProps:a,isDropTarget:c,ref:e,buttonRef:s,level:o})}function rd(t,e){let{dropIndicatorProps:i,isDropTarget:n,buttonRef:s,level:a,...r}=t,{visuallyHiddenProps:c}=fi(),o=vt({...r,defaultClassName:"react-aria-DropIndicator",defaultStyle:{position:"relative","--tree-item-level":a},values:{isDropTarget:n}});return g.createElement(Ft.div,{...o,role:"row","aria-level":a,ref:e,"data-drop-target":n||void 0},g.createElement("div",{role:"gridcell"},g.createElement("div",{...c,role:"button",...i,ref:s}),o.children))}var od=(0,g.forwardRef)(rd);function cd(){let{dragAndDropHooks:t,dropState:e}=(0,g.useContext)(Ct),i=(0,g.useRef)(null),{dropIndicatorProps:n}=t.useDropIndicator({target:{type:"root"}},e,i),s=e.isDropTarget({type:"root"}),{visuallyHiddenProps:a}=fi();return!s&&n["aria-hidden"]?null:g.createElement("div",{role:"row","aria-hidden":n["aria-hidden"],style:{position:"absolute"}},g.createElement("div",{role:"gridcell"},g.createElement("div",{role:"button",...a,...n,ref:i})))}function dd(t,e){if(t.size!==e.size)return!1;for(let i of t)if(!e.has(i))return!1;return!0}var ud=Se(),md=t=>{switch(t){case"chat":return"chat_model";case"autocomplete":return"autocomplete_model";case"edit":return"edit_model"}};const Gs=()=>{let t=(0,ud.c)(12),[e,i]=lt(ar),{saveUserConfig:n}=xt(),s;t[0]!==n||t[1]!==i?(s=async m=>{await n({config:m}).then(()=>{i(h=>({...h,...m}))})},t[0]=n,t[1]=i,t[2]=s):s=t[2];let a=s,r;t[3]!==a||t[4]!==e?(r=async(m,h)=>{var y,j,v,_,C;let x=md(h);x&&a({ai:{...e.ai,models:{custom_models:((j=(y=e.ai)==null?void 0:y.models)==null?void 0:j.custom_models)??[],displayed_models:((_=(v=e.ai)==null?void 0:v.models)==null?void 0:_.displayed_models)??[],...(C=e.ai)==null?void 0:C.models,[x]:m}}})},t[3]=a,t[4]=e,t[5]=r):r=t[5];let c=r,o;t[6]!==a||t[7]!==e?(o=async m=>{a({ai:{...e.ai,mode:m}})},t[6]=a,t[7]=e,t[8]=o):o=t[8];let d=o,u;return t[9]!==d||t[10]!==c?(u={saveModelChange:c,saveModeChange:d},t[9]=d,t[10]=c,t[11]=u):u=t[11],u},qt=["openai","anthropic","google","ollama","bedrock","deepseek","azure","github","openrouter","wandb","opencode-go","marimo"];var Me=class Li{constructor(e,i){this.providerId=e,this.shortModelId=i}get id(){return`${this.providerId}/${this.shortModelId}`}static parse(e){if(!e.includes("/"))return new Li(pd(e),e);let[i,...n]=e.split("/");return new Li(i,n.join("/"))}};function pd(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 Pi(t){return qt.includes(t)}const hd=JSON.parse(`{"anthropic":[{"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.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.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","model":"gemini-3.1-flash-image-preview","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-02-26","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}}],"bedrock":[{"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":"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 Sonnet 4.6","model":"claude-sonnet-4-6","description":"","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}}],"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":"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.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.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 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 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"},{"name":"MiniMax M2.5","model":"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"},{"name":"GLM 5","model":"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-02-11"}],"wandb":[{"name":"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-03-27","cost":{"input":1.4,"output":4.4}},{"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":["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":["tool_calling"],"input_types":["text"],"output_types":["text"],"release_date":"2026-02-12","cost":{"input":0.3,"output":1.2}},{"name":"GLM 5","model":"zai-org/GLM-5-FP8","description":"Z.ai's flagship open-source foundation model engineered for complex systems design and long-horizon agent workflows","roles":["chat","edit"],"capabilities":["tool_calling"],"input_types":["text"],"output_types":["text"],"release_date":"2026-02-11","cost":{"input":1,"output":3.2}},{"name":"Kimi K2.5","model":"moonshotai/Kimi-K2.5","description":"Moonshot AI's native multimodal model, delivering state-of-the-art visual coding capability and a self-directed agent swarm paradigm","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image"],"output_types":["text"],"release_date":"2026-01-27","cost":{"input":0.5,"output":2.85}},{"name":"DeepSeek V3.1","model":"deepseek-ai/DeepSeek-V3.1","description":"Large hybrid reasoning model (671B parameters, 37B active) that supports both thinking and non-thinking modes via prompt templates","roles":["chat","edit"],"capabilities":["tool_calling"],"input_types":["text"],"output_types":["text"],"release_date":"2025-08-21","cost":{"input":0.55,"output":1.65}},{"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":["tool_calling"],"input_types":["text"],"output_types":["text"],"release_date":"2025-08-05","cost":{"input":0.15,"output":0.6}},{"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":["tool_calling"],"input_types":["text"],"output_types":["text"],"release_date":"2025-08-05","cost":{"input":0.05,"output":0.2}},{"name":"Qwen3 30B A3B Instruct 2507","model":"Qwen/Qwen3-30B-A3B-Instruct-2507","description":"30.5B-parameter mixture-of-experts language model from Qwen, with 3.3B active parameters per inference","roles":["chat","edit"],"capabilities":["tool_calling"],"input_types":["text"],"output_types":["text"],"release_date":"2025-07-29","cost":{"input":0.1,"output":0.3}},{"name":"Qwen3-235B-A22B-Thinking-2507","model":"Qwen/Qwen3-235B-A22B-Thinking-2507","description":"High-performance, open-weight Mixture-of-Experts (MoE) language model optimized for complex reasoning tasks","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text"],"output_types":["text"],"release_date":"2025-07-25","cost":{"input":0.1,"output":0.1}}],"opencode-go":[{"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":"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}},{"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.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.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":"MiMo V2 Omni","model":"mimo-v2-omni","description":"Frontier omni-modal model that natively processes image, video, and audio inputs within a unified architecture","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image","pdf"],"output_types":["text"],"release_date":"2026-03-18","cost":{"input":0.4,"output":2}},{"name":"MiMo V2 Pro","model":"mimo-v2-pro","description":"Xiaomi's flagship foundation model, featuring over 1T total parameters and a 1M context length, deeply optimized for agentic scenarios","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text"],"output_types":["text"],"release_date":"2026-03-18","cost":{"input":1,"output":3}},{"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}}]}`),gd=[{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 fd=hd,xd=gd;const Hs=Ze(()=>{let t=new Map,e=new Map;for(let[i,n]of Object.entries(fd)){if(!n)continue;let s=i;for(let a of n){let r=a.model,c={...a,model:r,provider:s,custom:!1},o=`${s}/${r}`;t.set(o,c),(c.roles.includes("chat")||c.roles.includes("edit"))&&!e.has(s)&&e.set(s,o)}}return{modelMap:t,defaultModelByProvider:e}});var Us=Ze(()=>{let t=new Map,e=new Map;return xd.forEach((i,n)=>{t.set(i.id,i),e.set(i.id,n)}),{providerMap:t,providerToOrderIdx:e}}),St=class ti{constructor(e,i){Ne(this,"modelsByProviderMap",new il);this.customModels=new Set(e),this.displayedModels=new Set(i),this.modelsMap=new Map,this.buildMaps()}static getProviderInfo(e){let{providerMap:i}=Us();return i.get(e)}static create(e){let{customModels:i=[],displayedModels:n=[]}=e;return new ti(i.map(s=>Me.parse(s).id),n.map(s=>Me.parse(s).id))}buildMaps(){let e=ti.buildMapsFromConfig({displayedModels:this.displayedModels,customModels:this.customModels});e.modelsMap.size===0&&(U.error("The configured displayed_models have filtered out all registered models. Reverting back to showing all models.",[...this.displayedModels]),e=ti.buildMapsFromConfig({displayedModels:new Set,customModels:this.customModels})),this.modelsByProviderMap=e.modelsByProviderMap,this.modelsMap=e.modelsMap}static buildMapsFromConfig(e){let{displayedModels:i,customModels:n}=e,s=i.size>0,a=Hs().modelMap,r=new Map,c=new Map,o=new il;for(let d of n){if(s&&!i.has(d))continue;let u=Me.parse(d),m={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};r.set(d,m)}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([...r,...c]);for(let[d,u]of c.entries()){let m=Me.parse(d);o.add(m.providerId,u)}return{modelsByProviderMap:o,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=Us().providerToOrderIdx;return e.sort((n,s)=>{let a=n[0],r=s[0];return(i.get(a)??0)-(i.get(r)??0)}),e}getModelsMap(){return this.modelsMap}getModel(e){return this.modelsMap.get(e)}};const qs=qi("marimo:accept-completion-on-enter",!0,Hi,{getOnInit:!0});function yd(t){"scheduler"in window?window.scheduler.postTask(t,{priority:"background"}):"requestIdleCallback"in window?requestIdleCallback(t):setTimeout(t,0)}var Wt=null,vd=class{constructor(t){Ne(this,"abortController",new AbortController);this.view=t.view,this.view.dom.addEventListener("focus",()=>{Wt=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(Fa())t.style.display="none";else{let e=(Wt==null?void 0:Wt.deref())===this.view;t.style.display=e?"":"none"}}destroy(){this.abortController.abort()}};const Ws={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 bd(t,e){let i=[];for(let n of t.split(`
|
|
2
|
-
`)){if(n.startsWith('"')||n.trim()==="")continue;let s=jd(n,e);s&&i.push(s)}return i}function jd(t,e){let i=t.split(/\s+/),n=i[0],s=0;if(n in Ws){let a=Ws[n],r={};for(let o of a.args||[])if(s+=1,s<i.length)r[o]=i[s];else{e&&e(`Not enough arguments for "${n}" command: "${t}"`);return}let c={name:n};return"args"in a&&(c.args=r),"mode"in a&&(c.mode=a.mode),c}e&&e(`Unknown vimrc command: "${t}"`)}function kd(){return wd(),Cd(),[Le.of([{key:"j",run:t=>{if(Oa(t,!0)&&Wi(t)){let e=t.state.facet(At),i=t.state.facet(Ui);return e.moveToNextCell({cellId:i,before:!1,noCreate:!0}),!0}return!1}}]),Le.of([{key:"k",run:t=>{if(Wa(t)&&Wi(t)){let e=t.state.facet(At),i=t.state.facet(Ui);return e.moveToNextCell({cellId:i,before:!0,noCreate:!0}),!0}return!1}}]),Le.of([{linux:"Ctrl-[",win:"Ctrl-[",run:t=>{let e=gt(t);return e?Qs(e)?e.state.vim.insertMode?(pe.exitInsertMode(e,!0),!0):!1:(U.warn("Expected CodeMirror instance to have Vim state"),!1):(U.warn("Expected CodeMirror instance to have CodeMirror instance state"),!1)}}]),dl.define(t=>(requestAnimationFrame(()=>{Ys.INSTANCES.addInstance(t)}),{destroy(){Ys.INSTANCES.removeInstance(t)}})),dl.define(t=>new vd({view:t})),Er.domEventHandlers({keydown(t,e){return t.ctrlKey&&t.key==="Escape"?(e.dom.dispatchEvent(new KeyboardEvent(t.type,t)),!0):!1}})]}var wd=Ze(()=>{pe.defineAction("goToDefinition",t=>{let e=t.cm6;return Ga(e)}),pe.mapCommand("gd","action","goToDefinition",{},{context:"normal"}),pe.defineEx("write","w",t=>{let e=t.cm6;e&&e.state.facet(At).saveNotebook()})}),Cd=Ze(async()=>{var e;let t=(e=it.get(ni).keymap)==null?void 0:e.vimrc;if(t)try{U.log(`Loading vimrc from ${t}`);let i=(await Wr().sendFileDetails({path:t})).contents;if(!i){U.error(`Failed to load vimrc from ${t}`);return}Sd(bd(i,U.warn))}catch(i){U.error("Failed to load vimrc:",i)}});function Sd(t){function e(a){if(!a.args){U.warn(`Could not execute vimrc command "${a.name}: expected arguments"`);return}if(!a.args.lhs||!a.args.rhs){U.warn(`Could not execute vimrc command "${a.name}: expected arguments"`);return}a.mode?pe.map(a.args.lhs,a.args.rhs,a.mode):pe.map(a.args.lhs,a.args.rhs)}function i(a){if(!a.args){U.warn(`Could not execute vimrc command "${a.name}: expected arguments"`);return}if(!a.args.lhs||!a.args.rhs){U.warn(`Could not execute vimrc command "${a.name}: expected arguments"`);return}a.mode?pe.noremap(a.args.lhs,a.args.rhs,a.mode):pe.noremap(a.args.lhs,a.args.rhs)}function n(a){if(!a.args){U.warn(`Could not execute vimrc command "${a.name}: expected arguments"`);return}if(!a.args.lhs){U.warn(`Could not execute vimrc command "${a.name}: expected arguments"`);return}a.mode?pe.unmap(a.args.lhs,a.mode):pe.unmap(a.args.lhs)}function s(a){a.mode?pe.mapclear(a.mode):pe.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)?n(a):"mapclear|nmapclear|vmapclear|imapclear".split("|").includes(a.name)?s(a):U.warn(`Could not execute vimrc command "${a.name}: unknown command"`)}function _d(t){return"getVimGlobalState_"in t&&typeof t.getVimGlobalState_=="function"}function Nd(){var e;if(!_d(pe))return!1;let t=(e=pe.getVimGlobalState_())==null?void 0:e.macroModeState;return t?!!(t.isRecording||t.isPlaying):!1}var Ys=(ot=class{constructor(){Ne(this,"instances",new Set);Ne(this,"isBroadcasting",!1)}addInstance(e){this.instances.add(e);let i=gt(e);if(!i){U.warn("Expected CodeMirror instance to have CodeMirror instance state");return}i.on("vim-mode-change",n=>{if(this.isBroadcasting)return;li("mode"in n,'Expected event to have a "mode" property');let s=Nd();this.isBroadcasting=!0,yd(()=>{s||this.broadcastModeChange(e,n.mode,n.subMode),this.isBroadcasting=!1})})}removeInstance(e){this.instances.delete(e)}broadcastModeChange(e,i,n){li("exitInsertMode"in pe,"Vim does not have an exitInsertMode method"),li("exitVisualMode"in pe,"Vim does not have an exitVisualMode method");for(let s of this.instances)if(s!==e){let a=gt(s);if(!a){U.warn("Expected CodeMirror instance to have CodeMirror instance state");continue}let r=a.setSelections.bind(a);if(a.setSelections=()=>[],!Qs(a)){U.warn("Expected CodeMirror instance to have Vim state");continue}let c=a.state.vim;switch(i){case"normal":c.insertMode&&pe.exitInsertMode(a,!0),c.visualMode&&pe.exitVisualMode(a,!0);break;case"insert":c.insertMode||pe.handleKey(a,"i","mapping");break;case"visual":break}a.setSelections=r}}},Ne(ot,"INSTANCES",new ot),ot);function Qs(t){return t.state.vim!==void 0}const Id=["default","vim"];function Kd(t,e){switch(t.preset){case"default":return[Le.of(Zs()),Le.of(Xs(e))];case"vim":return[Le.of(Dd()),Le.of(Xs(e)),Le.of([{key:"Enter",run:i=>{var n,s;return(s=(n=gt(i))==null?void 0:n.state.vim)!=null&&s.insertMode?zr(i):!1}}]),cl.high(Ad("d",i=>i.state.doc.toString()==="",i=>i.state.doc.toString()===""?(i.state.facet(At).deleteCell(),!0):!1)),Le.of(Ed()),Ya({status:!1}),cl.high(kd())];default:return Ur(t.preset),[]}}var Md=new Set([ml,ul]),Zs=Ze(()=>Gr.filter(t=>!Md.has(t.run))),Xs=t=>[{key:t.getHotkey("cell.toggleComment").key,run:ml},{key:t.getHotkey("cell.toggleBlockComment").key,run:ul}],Dd=Ze(()=>{let t=new Set(["Enter","Ctrl-v","ArrowUp","ArrowDown","ArrowLeft","ArrowRight"]);return Zs().filter(e=>!t.has(e.key||e.mac||e.linux||e.win||""))});function Ad(t,e,i){let n="",s=0;return Le.of([{any:(a,r)=>{let c=r.key,o=r.timeStamp;return c!==t||!e(a)?(n="",s=0,!1):n===t&&o-s<500&&i(a)?(n="",s=0,!0):(n=c,s=o,!1)}}])}function Pd(t){var e;return((e=t==null?void 0:t.state.vim)==null?void 0:e.visualMode)===!0}function Ed(){let t=e=>i=>Pd(gt(i))?!1:e(i);return[{key:"ArrowDown",run:t(Rr),shift:t(Fr)},{key:"ArrowUp",run:t(Lr),shift:t(Br)},{key:"ArrowLeft",run:t(Or),shift:t(Tr)},{key:"ArrowRight",run:t(Vr),shift:t($r)}]}function Js(){return["compact","medium","full","columns"]}var Td={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 zd(t){for(let i of qt)if(Td[i](t))return i;let e=t==null?void 0:t.custom_providers;if(e){let i=Object.entries(e).find(([n,s])=>s==null?void 0:s.base_url);if(i)return i[0]}}function Fd(t){let e=zd(t);if(e)return Hs().defaultModelByProvider.get(e)}function Bd(t){var a,r;let e={chatModel:void 0,editModel:void 0},i=!((a=t==null?void 0:t.models)!=null&&a.chat_model),n=!((r=t==null?void 0:t.models)!=null&&r.edit_model);if(!i&&!n)return e;let s=Fd(t);return s&&(i&&(e.chatModel=s),n&&(e.editModel=s)),e}var Rd=Se();function ea(t){return t.toLowerCase().replaceAll("+","-").trim()}function $d(t,e){let i=t.getHotkeyGroups(),n=e?new Set(i[e]||[]):new Set,s=new Map;for(let c of t.iterate()){if(n.has(c))continue;let o=t.getHotkey(c);if(!o.key||o.key.trim()==="")continue;let d=ea(o.key);s.has(d)||s.set(d,[]);let u=s.get(d);u&&u.push({action:c,name:o.name})}let a=[],r=new Set;for(let[c,o]of s.entries())if(o.length>1){a.push({key:c,actions:o});for(let{action:d}of o)r.add(d)}return{duplicates:a,hasDuplicate:c=>r.has(c),getDuplicatesFor:c=>{let o=t.getHotkey(c);if(!o.key||o.key.trim()==="")return[];let d=ea(o.key),u=a.find(m=>m.key===d);return!u||u.actions.length<=1?[]:u.actions.filter(m=>m.action!==c).map(m=>m.action)}}}function Vd(t,e){let i=(0,Rd.c)(3),n;return i[0]!==t||i[1]!==e?(n=$d(t,e),i[0]=t,i[1]=e,i[2]=n):n=i[2],n}var Od=Se(),l=Gi(fr(),1);const Ld=t=>{let e=(0,Od.c)(7),{duplicates:i}=t;if(i.length===0)return null;let n,s;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=(0,l.jsx)(pi,{className:"h-4 w-4"}),s=(0,l.jsx)(Vo,{children:"Duplicate shortcuts"}),e[0]=n,e[1]=s):(n=e[0],s=e[1]);let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=(0,l.jsx)("p",{className:"mb-2",children:"Multiple actions are assigned to the same keyboard shortcut:"}),e[2]=a):a=e[2];let r;e[3]===i?r=e[4]:(r=i.map(Hd),e[3]=i,e[4]=r);let c;return e[5]===r?c=e[6]:(c=(0,l.jsxs)(Ml,{variant:"warning",className:"mb-4",children:[n,s,(0,l.jsxs)(Kl,{children:[a,(0,l.jsx)("ul",{className:"space-y-2",children:r})]})]}),e[5]=r,e[6]=c),c};function Gd(t){let{action:e,name:i}=t;return(0,l.jsx)("li",{children:i},e)}function Hd(t){let{key:e,actions:i}=t;return(0,l.jsxs)("li",{className:"text-xs",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,l.jsx)(yi,{shortcut:e}),(0,l.jsx)("span",{className:"font-semibold",children:"is used by:"})]}),(0,l.jsx)("ul",{className:"ml-6 list-disc",children:i.map(Gd)})]},e)}const Ei=nt(!1),Ud=()=>{let[t,e]=lt(Ei),[i,n]=(0,g.useState)(null),[s,a]=(0,g.useState)([]),[r,c]=el(),o=st(ur),{saveUserConfig:d}=xt(),{duplicates:u,hasDuplicate:m,getDuplicatesFor:h}=Vd(o,"Markdown");Ro("global.showHelp",()=>e(p=>!p));let x=async p=>{let f={...r};c(N=>({...N,...p})),await d({config:p}).catch(N=>{throw c(f),N})},y=async p=>{if(!i)return;let f=p.join("-"),N={keymap:{...r.keymap,overrides:{...r.keymap.overrides,[i]:f}}};n(null),a([]),await x(N)},j=async()=>{if(!i)return;let p={keymap:{...r.keymap,overrides:{...r.keymap.overrides}}};delete p.keymap.overrides[i],n(null),a([]),await x(p)},v=async()=>{if(!window.confirm("Are you sure you want to reset all shortcuts to their default values?"))return;let p={keymap:{...r.keymap,overrides:{}}};n(null),a([]),await x(p)};if(!t)return null;let _=p=>{let f=o.getHotkey(p);if(i===p){let T=lr(p);return(0,l.jsxs)("div",{children:[(0,l.jsx)(Be,{defaultValue:s.join("+"),placeholder:f.name,onKeyDown:I=>{I.preventDefault();let E=[];if(I.key==="Meta"||I.key==="Control"||I.key==="Alt"||I.key==="Shift"||(I.metaKey&&E.push(Zi()?"Cmd":"Meta"),I.ctrlKey&&E.push("Ctrl"),I.altKey&&E.push("Alt"),I.shiftKey&&E.push("Shift"),I.key==="-"))return;if(I.key==="Escape"&&E.length===0){n(null),a([]);return}let M=I.key.length===1?I.key.toLowerCase():I.key;I.key===" "&&(M="Space"),E.push(M),y(E)},autoFocus:!0,endAdornment:(0,l.jsx)(se,{variant:"text",size:"xs",className:"mb-0",onClick:()=>{n(null),a([])},children:(0,l.jsx)(oi,{className:"w-4 h-4"})})}),(0,l.jsxs)("div",{className:"flex items-center justify-between w-full",children:[(0,l.jsx)("span",{className:"text-muted-foreground text-xs",children:"Press a key combination"}),T.key!==f.key&&(0,l.jsxs)("span",{className:"text-xs cursor-pointer text-primary",onClick:j,children:["Reset to default:"," ",(0,l.jsx)("span",{className:"font-mono",children:T.key})]})]})]},p)}let N=m(p),K=N?h(p):[];return(0,l.jsxs)("div",{className:"grid grid-cols-[auto_2fr_3fr] gap-2 items-center",children:[o.isEditable(p)?(0,l.jsx)(vl,{className:"cursor-pointer opacity-60 hover:opacity-100 text-muted-foreground w-3 h-3",onClick:()=>{a([]),n(p)}}):(0,l.jsx)("div",{className:"w-3 h-3"}),(0,l.jsx)(yi,{className:"justify-end",shortcut:f.key}),(0,l.jsxs)("div",{className:"flex items-center gap-1",children:[(0,l.jsx)("span",{children:f.name.toLowerCase()}),N&&(0,l.jsxs)("div",{className:"group relative inline-flex",children:[(0,l.jsx)(pi,{className:"w-3 h-3 text-(--yellow-11)"}),(0,l.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:"," ",K.map(T=>o.getHotkey(T).name.toLowerCase()).join(", ")]})]})]})]},p)},C=o.getHotkeyGroups(),w=(p,f)=>{let N=C[p];return(0,l.jsxs)("div",{className:"mb-[40px] gap-2 flex flex-col",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("h3",{className:"text-lg font-medium",children:p}),f]}),N.map(_)]})};return(0,l.jsx)(zo,{open:t,onOpenChange:p=>e(p),children:(0,l.jsxs)(To,{className:"sm:items-center sm:top-0",children:[(0,l.jsx)(Eo,{}),(0,l.jsxs)(Po,{usePortal:!1,className:"max-h-screen sm:max-h-[90vh] overflow-y-auto sm:max-w-[850px]",children:[(0,l.jsx)(Do,{children:(0,l.jsx)(Ao,{children:"Shortcuts"})}),(0,l.jsx)(Ld,{duplicates:u}),(0,l.jsxs)("div",{className:"flex flex-row gap-3",children:[(0,l.jsxs)("div",{className:"w-1/2",children:[w("Editing"),w("Markdown")]}),(0,l.jsxs)("div",{className:"w-1/2",children:[w("Navigation"),w("Running Cells"),w("Creation and Ordering"),(p=>w(p,(0,l.jsxs)("p",{className:"text-xs text-muted-foreground flex items-center gap-1",children:["Press"," ",r.keymap.preset==="vim"?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(yi,{shortcut:Zi()?"Cmd":"Ctrl"}),(0,l.jsx)(ae,{children:"Esc"})]}):(0,l.jsx)(ae,{children:"Esc"})," ","in a cell to enter command mode"]})))("Command"),w("Other"),(0,l.jsx)(se,{className:"mt-4 hover:bg-destructive/10 border-destructive hover:border-destructive",variant:"outline",size:"xs",onClick:v,tabIndex:-1,children:(0,l.jsx)("span",{className:"text-destructive",children:"Reset all to default"})})]})]})]})]})})};var ta="marimo:copilot:signedIn";const ia=qi(ta,null,Hi,{getOnInit:!0}),la=nt(null),Yt=nt(null),Ti=nt({busy:!1,kind:null,message:null});function qd(t){it.set(Yt,t)}function Wd(t){it.get(Yt)===t&&it.set(Yt,null)}function Yd(){return Ja.getItem(ta)==="true"}function na(){let t=Yd(),e=or();return t&&e.completion.copilot==="github"}function Qd(){return Ta(ni,t=>t.completion.copilot==="github")}var Zd=Hr(),ke=U.get("@github/copilot-language-server"),Xd=class extends La{constructor(e){super(e);Ne(this,"documentVersion",0);Ne(this,"hasOpenedDocument",!1);Ne(this,"copilotSettings",{});Ne(this,"getCompletionInternal",async(e,i)=>await this._request("textDocument/inlineCompletion",{...e,textDocument:{...e.textDocument,version:i}}));Ne(this,"throttledGetCompletionInternal",tc(this.getCompletionInternal,200));Ne(this,"handleNotification",e=>{if(!e.params)return;let i=e;if(i.method==="statusNotification"&&it.set(Ti,i.params),i.method==="didChangeStatus"&&it.set(Ti,i.params),i.method==="window/logMessage"){let{type:n,message:s}=i.params;switch(n){case 1:ke.error("[GitHub Copilot]",s);break;case 2:ke.warn("[GitHub Copilot]",s);break;case 3:ke.debug("[GitHub Copilot]",s);break;default:ke.log("[GitHub Copilot]",s);break}}});this.copilotSettings=e.copilotSettings??{},this.onNotification(this.handleNotification),this.attachInitializeListener()}attachInitializeListener(){this.initializePromise.then(()=>{this.sendConfiguration()})}async reInitialize(){ke.log("#reInitialize: Re-initializing LSP connection"),this.initializePromise=this.initialize(),await this.initializePromise,await this.sendConfiguration()}async sendConfiguration(){let e=this.copilotSettings;!e||Object.keys(e).length===0||(await this.notify("workspace/didChangeConfiguration",{settings:e}),ke.debug("#sendConfiguration: Configuration sent",e))}async _request(e,i){return await this.request(e,i)}async notify(e,i){return ke.debug("#notify",e,i),super.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!na()}async textDocumentDidOpen(e){return this.isDisabled()?e:(this.hasOpenedDocument=!0,super.textDocumentDidOpen(e))}async textDocumentCompletion(e){return[]}async textDocumentDidChange(e){if(this.isDisabled())return e;this.hasOpenedDocument||await this.textDocumentDidOpen({textDocument:{uri:e.textDocument.uri,languageId:"python",version:e.textDocument.version,text:e.contentChanges[0].text}});let i=e.contentChanges;i.length!==1&&ke.warn("#textDocumentDidChange: Multiple changes detected. This is not supported.",i);let n=i[0];"range"in n&&ke.warn("#textDocumentDidChange: Copilot doesn't support range changes.",n);let s=$a(n.text);return super.textDocumentDidChange({...e,contentChanges:[{text:s}],textDocument:Zd.VersionedTextDocumentIdentifier.create(e.textDocument.uri,++this.documentVersion)})}textDocumentHover(e){return Promise.resolve({contents:[]})}signOut(){return this._request("signOut",{})}async signInInitiate(){ke.log("#signInInitiate: Starting sign-in flow");try{let e=await this._request("signIn",{});return ke.log("#signInInitiate: Sign-in flow started successfully"),e}catch(e){throw ke.warn("#signInInitiate: Failed to start sign-in flow",e),e}}async signInConfirm(e){ke.log("#signInConfirm: Confirming sign-in");try{let i=await this._request("signInConfirm",e);return ke.log("#signInConfirm: Sign-in confirmed successfully"),i}catch(i){throw ke.warn("#signInConfirm: Failed to confirm sign-in",i),i}}async signedIn(){try{let{status:e}=await this._request("checkStatus",{});return ke.log("#checkStatus: Status check completed",{status:e}),e==="SignedIn"||e==="AlreadySignedIn"||e==="OK"}catch(e){throw ke.warn("#signedIn: Failed to check sign-in status",e),e}}async getCompletion(e){if(this.isDisabled())return null;let i=this.documentVersion;if(e.textDocument.version=i,i===0)return null;qd(i);let n=await this.throttledGetCompletionInternal(e,i);return Wd(i),i===this.documentVersion?n??null:null}},Jd=qa(),eu=Qa(),tu=class extends eu.Transport{constructor(e){super();Ne(this,"pendingSubscriptions",[]);Ne(this,"needsReInitialization",!1);this.delegate=void 0,this.pendingSubscriptions=[],this.options={retries:e.retries??3,retryDelayMs:e.retryDelayMs??1e3,maxTimeoutMs:e.maxTimeoutMs??5e3,getWsUrl:e.getWsUrl,waitForReady:e.waitForReady,showError:e.showError}}subscribe(...e){super.subscribe(...e);let[i,n]=e;this.pendingSubscriptions.push({event:i,handler:n}),this.delegate&&this.delegate.subscribe(i,n)}unsubscribe(...e){let i=super.unsubscribe(...e),[n,s]=e;if(this.delegate&&this.delegate.unsubscribe(n,s),s)if(n){let a=this.pendingSubscriptions.findIndex(r=>r.event===n&&r.handler===s);a>-1&&this.pendingSubscriptions.splice(a,1)}else this.pendingSubscriptions=this.pendingSubscriptions.filter(a=>a.handler!==s);else n?this.pendingSubscriptions=this.pendingSubscriptions.filter(a=>a.event!==n):this.pendingSubscriptions=[];return i}createDelegate(){let e=new Jd.WebSocketTransport(this.options.getWsUrl());for(let{event:i,handler:n}of this.pendingSubscriptions)e.subscribe(i,n);return e}async tryConnect(){for(let e=1;e<=this.options.retries;e++)try{this.delegate||(this.delegate=this.createDelegate()),await this.delegate.connect(),U.log("Copilot#connect: Connected successfully");return}catch(i){if(U.warn(`Copilot#connect: Connection attempt ${e}/${this.options.retries} failed`,i),e===this.options.retries)throw this.delegate=void 0,this.needsReInitialization=!0,this.options.showError("GitHub Copilot Connection Error",`Failed to connect to GitHub Copilot. Please check your settings and try again.
|
|
1
|
+
var Ea=Object.defineProperty;var Ta=(t,e,i)=>e in t?Ea(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;var Ne=(t,e,i)=>Ta(t,typeof e!="symbol"?e+"":e,i);var ot;import{s as Hi}from"./chunk-LvLJmgfZ.js";import{d as Mt,i as it,l as lt,n as Dt,o as za,p as nt,u as st}from"./useEvent-D91BmmQi.js";import{t as Ba}from"./react-Bj1aDYRI.js";import{Bt as ne,Er as ii,Fn as Ui,G as Fa,Gr as At,Kr as qi,Oi as Wi,Sr as Ra,Tr as $a,Yt as Va,ai as Oa,an as La,ci as Ga,cn as Yi,dn as ee,fn as gt,gn as Ha,gr as Ua,hr as qa,li as Wa,on as Ya,pn as Qa,ui as Za,ut as Xa,wn as Ja,xi as er}from"./cells-1XaQzJBc.js";import{t as Qi}from"./react-dom-CSu739Rf.js";import{t as Se}from"./compiler-runtime-B3qBwwSJ.js";import{t as tr}from"./isObject-DvLSfCY5.js";import{t as Zi}from"./get-C-qh_et5.js";import{t as ir}from"./merge-_9WLTEyt.js";import{t as lr}from"./debounce-DhnxH9Rh.js";import{_ as U,l as nr,p as Xi}from"./useEventListener-DvoEXWke.js";import{t as li}from"./invariant-BUdrueMv.js";import{D as sr,E as ar,S as rr,T as Ji,_ as ni,c as or,f as cr,l as dr,n as ur,p as mr,x as el,y as tl}from"./utils-Bok_hGT2.js";import{S as pr,T as dt,r as hr}from"./config-hed0CaQL.js";import{i as gr,n as si,t as fr}from"./switch-YcZLs0mS.js";import{t as Ee}from"./cn-DCUzRj2J.js";import{t as xr}from"./jsx-runtime-BqBOg78p.js";import{a as yr,i as vr,n as il,r as br,t as ll}from"./multi-map-CUuNtzHt.js";import{a as nl,c as ft,d as jr,i as kr,o as Pt,r as wr,s as sl,t as Cr}from"./popover-Bz_0Vkyf.js";import{i as ai,l as Ke,n as Sr,r as _r,s as Nr,t as Ir}from"./select-DZcFyKFQ.js";import{a as Kr,c as Et,d as al,f as rl,p as Mr,r as Dr,s as Ar,t as Pr,u as ol}from"./dropdown-menu-CR7cnzLX.js";import{t as Oe}from"./label-xHqFtfdz.js";import{t as qe}from"./tooltip-DTV9tlSr.js";import{n as Er,r as cl,t as ae}from"./button-BbCh-29a.js";import{St as Le,Wt as dl,at as Tr,ct as ul}from"./dist-BrR4M-k3.js";import{A as zr,D as Br,F as ml,I as pl,M as Fr,N as Rr,_ as $r,j as Vr,m as Or,p as Lr,v as Gr,y as Hr}from"./dist-CHcznzB-.js";import{s as hl}from"./arrays-DYDL-3-i.js";import{n as Ze}from"./once-DRroIaBz.js";import{t as Ur}from"./main-B0OX4z33.js";import{i as qr,n as Wr,t as ri}from"./strings-wdPMRf6Z.js";import{r as xt,t as Yr}from"./requests-DIwGYs0l.js";import{t as Xe}from"./createLucideIcon-D5guW7EU.js";import{t as Qr}from"./check-BH35Ndha.js";import{r as Zr,t as oi}from"./x-C-6liIBr.js";import{t as Xr}from"./chevron-right-CG5QYXYk.js";import{u as Jr}from"./toDate-B5A0DFEz.js";import{t as eo}from"./copy-BwrPA9zQ.js";import{n as Tt,t as gl}from"./spinner-Bhir8k53.js";import{t as to}from"./plus-BgB18UzY.js";import{t as fl}from"./refresh-cw-DHwG4Mac.js";import{$ as Ge,B as io,C as lo,D as no,G as zt,J as so,O as Bt,S as xl,V as ci,X as yl,_ as ao,at as di,b as ro,ct as ui,et as vl,g as oo,lt as co,nt as uo,o as yt,r as Fe,rt as mo,st as Ft,ut as Rt,w as vt}from"./input-C3Hrdlqq.js";import{a as V,c as $,d as G,g as po,i as ho,l as R,o as H,p as go,r as fo,s as xo,u as F,v as mi,y as bl}from"./textarea-CTiWTiw-.js";import{t as jl}from"./trash-2-rVklqqFF.js";import{t as pi}from"./triangle-alert-D2p96PEF.js";import{t as bt}from"./badge-j3NGjqhR.js";import{t as Re}from"./use-toast-IPAtJGea.js";import{t as yo}from"./useTheme-KJ1rGmnj.js";import{n as vo}from"./copy-LK56fFow.js";import{B as jt,E as bo,I as kl,M as hi,N as ut,O as gi,P as He,R as wl,V as $t,_ as jo,j as Je,k as $e,l as ko,m as wo,p as Co,t as Cl,v as Sl,y as So,z as _o}from"./usePress-DQ_tAz5W.js";import{t as _l}from"./SSRProvider-CkFAAHXw.js";import{_ as Nl,a as fi,c as Vt,d as No,f as et,g as at,m as mt,p as Il,s as Io,t as Ko,u as Kl,v as Mo}from"./RSPContexts-CdN1NyAt.js";import{t as Ot}from"./context-QkTujrKn.js";import{n as Do}from"./useDebounce-7xZwVnnu.js";import{a as Ao,c as Po,n as Eo,o as To,s as zo,t as Bo}from"./dialog-DzC_QCtT.js";import{i as Fo,r as Ro,t as $o}from"./useHotkey-BtqYcnxQ.js";import{r as Vo}from"./errors-vr57w7Ul.js";import{t as re}from"./kbd-CTUAEnEx.js";import{t as oe}from"./links-D1JoyKTt.js";import{n as Ml,r as Oo,t as Dl}from"./alert-yTS3WpF4.js";import{n as Lo,t as kt}from"./error-banner-LdWZDbqd.js";import{n as Al}from"./useAsyncData-bgszE9F0.js";import{a as Go,i as Lt,n as Ho,o as Pl,r as xi,t as Uo}from"./table-BGPSHfig.js";import{t as yi}from"./renderShortcut-CzUfgpdJ.js";import{n as qo,t as Wo}from"./azure-B42ls0Ui.js";import{a as Yo,i as Qo,n as Zo,r as Xo,t as Jo}from"./card--6HRj4T9.js";var ec="Expected a function";function tc(t,e,i){var n=!0,s=!0;if(typeof t!="function")throw TypeError(ec);return tr(i)&&(n="leading"in i?!!i.leading:n,s="trailing"in i?!!i.trailing:s),lr(t,e,{leading:n,maxWait:e,trailing:s})}var ic=tc,vi=Xe("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"}]]),El=Xe("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"}]]),Tl=Xe("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"}]]),lc=Xe("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"}]]),zl=Xe("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"}]]),nc=Xe("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"}]]),Bl=Xe("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"}]]),sc=Xe("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"}]]),g=Hi(Ba(),1);function Fl(t,e){let i=(0,g.useRef)(!0),n=(0,g.useRef)(null);$t(()=>(i.current=!0,()=>{i.current=!1}),[]),$t(()=>{i.current?i.current=!1:(!n.current||e.some((s,a)=>!Object.is(s,n[a])))&&t(),n.current=e},e)}function Rl(t,e){let{collection:i,onLoadMore:n,scrollOffset:s=1}=t,a=(0,g.useRef)(null),r=Co(c=>{for(let o of c)o.isIntersecting&&n&&n()});$t(()=>(e.current&&(a.current=new IntersectionObserver(r,{root:at(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 $l(t){let e=g.version.split(".");return parseInt(e[0],10)>=19?t:t?"true":void 0}var ac="react-aria-clear-focus",rc="react-aria-focus",oc=500;function cc(t){let{isDisabled:e,onLongPressStart:i,onLongPressEnd:n,onLongPress:s,threshold:a=oc,accessibilityDescription:r}=t,c=(0,g.useRef)(void 0),{addGlobalListener:o,removeGlobalListener:d}=wo(),{pressProps:u}=Cl({isDisabled:e,onPressStart(m){if(m.continuePropagation(),(m.pointerType==="mouse"||m.pointerType==="touch")&&(i&&i({...m,type:"longpressstart"}),c.current=setTimeout(()=>{m.target.dispatchEvent(new PointerEvent("pointercancel",{bubbles:!0})),kl(m.target).activeElement!==m.target&&gi(m.target),s&&s({...m,type:"longpress"}),c.current=void 0},a),m.pointerType==="touch")){let h=x=>{x.preventDefault()};o(m.target,"contextmenu",h,{once:!0}),o(window,"pointerup",()=>{setTimeout(()=>{d(m.target,"contextmenu",h)},30)},{once:!0})}},onPressEnd(m){c.current&&clearTimeout(c.current),n&&(m.pointerType==="mouse"||m.pointerType==="touch")&&n({...m,type:"longpressend"})}});return{longPressProps:$e(u,Il(s&&!e?r:void 0))}}function dc(t,e){let i=e==null?void 0:e.isDisabled,[n,s]=(0,g.useState)(!1);return $t(()=>{if(t!=null&&t.current&&!i){let a=()=>{t.current&&s(!!Vt(t.current,{tabbable:!0}).nextNode())};a();let r=new MutationObserver(a);return r.observe(t.current,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabIndex","disabled"]}),()=>{r.disconnect()}}}),i?!1:n}function Vl(t){let e=mc(kl(t));e!==t&&(e&&uc(e,t),t&&Ol(t,e))}function uc(t,e){t.dispatchEvent(new FocusEvent("blur",{relatedTarget:e})),t.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:e}))}function Ol(t,e){t.dispatchEvent(new FocusEvent("focus",{relatedTarget:e})),t.dispatchEvent(new FocusEvent("focusin",{bubbles:!0,relatedTarget:e}))}function mc(t){let e=ut(t),i=e==null?void 0:e.getAttribute("aria-activedescendant");return i&&t.getElementById(i)||e}function bi(t){return bo()?t.altKey:t.ctrlKey}function Gt(t,e){var s,a;let i=`[data-key="${CSS.escape(String(e))}"]`,n=(s=t.current)==null?void 0:s.dataset.collection;return n&&(i=`[data-collection="${CSS.escape(n)}"]${i}`),(a=t.current)==null?void 0:a.querySelector(i)}var Ll=new WeakMap;function pc(t){let e=jt();return Ll.set(t,e),e}function hc(t){return Ll.get(t)}var gc=1e3;function fc(t){let{keyboardDelegate:e,selectionManager:i,onTypeSelect:n}=t,s=(0,g.useRef)({search:"",timeout:void 0}).current;return{typeSelectProps:{onKeyDownCapture:e.getKeyForSearch?a=>{let r=xc(a.key);if(!(!r||a.ctrlKey||a.metaKey||!Je(a.currentTarget,He(a))||s.search.length===0&&r===" ")){if(r===" "&&s.search.trim().length>0&&(a.preventDefault(),"continuePropagation"in a||a.stopPropagation()),s.search+=r,e.getKeyForSearch!=null){let c=e.getKeyForSearch(s.search,i.focusedKey);c??(c=e.getKeyForSearch(s.search)),c!=null&&(i.setFocusedKey(c),n&&n(c))}clearTimeout(s.timeout),s.timeout=setTimeout(()=>{s.search=""},gc)}}:void 0}}}function xc(t){return t.length===1||!/^[A-Z]/i.test(t)?t:""}var yc=Qi();function vc(t){let{selectionManager:e,keyboardDelegate:i,ref:n,autoFocus:s=!1,shouldFocusWrap:a=!1,disallowEmptySelection:r=!1,disallowSelectAll:c=!1,escapeKeyBehavior:o="clearSelection",selectOnFocus:d=e.selectionBehavior==="replace",disallowTypeAhead:u=!1,shouldUseVirtualFocus:m,allowsTabNavigation:h=!1,scrollRef:x=n,linkBehavior:y="action"}=t,{direction:j}=Ot(),v=Sl(),_=b=>{var z,B,q,Y,S,W,te,ce,de,he,me,ge;if(b.altKey&&b.key==="Tab"&&b.preventDefault(),!n.current||!Je(n.current,He(b)))return;let A=(P,X)=>{if(P!=null){if(e.isLink(P)&&y==="selection"&&d&&!bi(b)){(0,yc.flushSync)(()=>{e.setFocusedKey(P,X)});let Z=Gt(n,P),Q=e.getItemProps(P);Z&&v.open(Z,b,Q.href,Q.routerOptions);return}if(e.setFocusedKey(P,X),e.isLink(P)&&y==="override")return;b.shiftKey&&e.selectionMode==="multiple"?e.extendSelection(P):d&&!bi(b)&&e.replaceSelection(P)}};switch(b.key){case"ArrowDown":if(i.getKeyBelow){let P=e.focusedKey==null?(z=i.getFirstKey)==null?void 0:z.call(i):(B=i.getKeyBelow)==null?void 0:B.call(i,e.focusedKey);P==null&&a&&(P=(q=i.getFirstKey)==null?void 0:q.call(i,e.focusedKey)),P!=null&&(b.preventDefault(),A(P))}break;case"ArrowUp":if(i.getKeyAbove){let P=e.focusedKey==null?(Y=i.getLastKey)==null?void 0:Y.call(i):(S=i.getKeyAbove)==null?void 0:S.call(i,e.focusedKey);P==null&&a&&(P=(W=i.getLastKey)==null?void 0:W.call(i,e.focusedKey)),P!=null&&(b.preventDefault(),A(P))}break;case"ArrowLeft":if(i.getKeyLeftOf){let P=e.focusedKey==null?null:(te=i.getKeyLeftOf)==null?void 0:te.call(i,e.focusedKey);P==null&&a&&(P=j==="rtl"?(ce=i.getFirstKey)==null?void 0:ce.call(i,e.focusedKey):(de=i.getLastKey)==null?void 0:de.call(i,e.focusedKey)),P!=null&&(b.preventDefault(),A(P,j==="rtl"?"first":"last"))}break;case"ArrowRight":if(i.getKeyRightOf){let P=e.focusedKey==null?null:(he=i.getKeyRightOf)==null?void 0:he.call(i,e.focusedKey);P==null&&a&&(P=j==="rtl"?(me=i.getLastKey)==null?void 0:me.call(i,e.focusedKey):(ge=i.getFirstKey)==null?void 0:ge.call(i,e.focusedKey)),P!=null&&(b.preventDefault(),A(P,j==="rtl"?"last":"first"))}break;case"Home":if(i.getFirstKey){if(e.focusedKey===null&&b.shiftKey)return;b.preventDefault();let P=i.getFirstKey(e.focusedKey,mt(b));e.setFocusedKey(P),P!=null&&(mt(b)&&b.shiftKey&&e.selectionMode==="multiple"?e.extendSelection(P):d&&e.replaceSelection(P))}break;case"End":if(i.getLastKey){if(e.focusedKey===null&&b.shiftKey)return;b.preventDefault();let P=i.getLastKey(e.focusedKey,mt(b));e.setFocusedKey(P),P!=null&&(mt(b)&&b.shiftKey&&e.selectionMode==="multiple"?e.extendSelection(P):d&&e.replaceSelection(P))}break;case"PageDown":if(i.getKeyPageBelow&&e.focusedKey!=null){let P=i.getKeyPageBelow(e.focusedKey);P!=null&&(b.preventDefault(),A(P))}break;case"PageUp":if(i.getKeyPageAbove&&e.focusedKey!=null){let P=i.getKeyPageAbove(e.focusedKey);P!=null&&(b.preventDefault(),A(P))}break;case"a":mt(b)&&e.selectionMode==="multiple"&&c!==!0&&(b.preventDefault(),e.selectAll());break;case"Escape":o==="clearSelection"&&!r&&e.selectedKeys.size!==0&&(b.stopPropagation(),b.preventDefault(),e.clearSelection());break;case"Tab":if(!h){if(b.shiftKey)n.current.focus();else{let P=Vt(n.current,{tabbable:!0}),X,Z;do Z=P.lastChild(),Z&&(X=Z);while(Z);let Q=ut();X&&(!hi(X)||Q&&!ko(Q))&&gi(X)}break}}},C=(0,g.useRef)({top:0,left:0});Ft(x,"scroll",()=>{var b,A;C.current={top:((b=x.current)==null?void 0:b.scrollTop)??0,left:((A=x.current)==null?void 0:A.scrollLeft)??0}});let w=b=>{var A,z;if(e.isFocused){Je(b.currentTarget,He(b))||e.setFocused(!1);return}if(Je(b.currentTarget,He(b))){if(e.setFocused(!0),e.focusedKey==null){let B=Y=>{Y!=null&&(e.setFocusedKey(Y),d&&!e.isSelected(Y)&&e.replaceSelection(Y))},q=b.relatedTarget;q&&b.currentTarget.compareDocumentPosition(q)&Node.DOCUMENT_POSITION_FOLLOWING?B(e.lastSelectedKey??((A=i.getLastKey)==null?void 0:A.call(i))):B(e.firstSelectedKey??((z=i.getFirstKey)==null?void 0:z.call(i)))}else x.current&&(x.current.scrollTop=C.current.top,x.current.scrollLeft=C.current.left);if(e.focusedKey!=null&&x.current){let B=Gt(n,e.focusedKey);B instanceof HTMLElement&&(!hi(B)&&!m&&gi(B),vl()==="keyboard"&&et(B,{containingElement:n.current}))}}},p=b=>{Je(b.currentTarget,b.relatedTarget)||e.setFocused(!1)},f=(0,g.useRef)(!1);Ft(n,rc,m?b=>{let{detail:A}=b;b.stopPropagation(),e.setFocused(!0),(A==null?void 0:A.focusStrategy)==="first"&&(f.current=!0)}:void 0),Fl(()=>{var b;if(f.current){let A=((b=i.getFirstKey)==null?void 0:b.call(i))??null;if(A==null){let z=ut();Vl(n.current),Ol(z,null),e.collection.size>0&&(f.current=!1)}else e.setFocusedKey(A),f.current=!1}},[e.collection]),Fl(()=>{e.collection.size>0&&(f.current=!1)},[e.focusedKey]),Ft(n,ac,m?b=>{var A;b.stopPropagation(),e.setFocused(!1),(A=b.detail)!=null&&A.clearFocusKey&&e.setFocusedKey(null)}:void 0);let N=(0,g.useRef)(s),K=(0,g.useRef)(!1);(0,g.useEffect)(()=>{var b,A;if(N.current){let z=null;s==="first"&&(z=((b=i.getFirstKey)==null?void 0:b.call(i))??null),s==="last"&&(z=((A=i.getLastKey)==null?void 0:A.call(i))??null);let B=e.selectedKeys;if(B.size){for(let q of B)if(e.canSelectItem(q)){z=q;break}}e.setFocused(!0),e.setFocusedKey(z),z==null&&!m&&n.current&&Ge(n.current),e.collection.size>0&&(N.current=!1,K.current=!0)}});let T=(0,g.useRef)(e.focusedKey),I=(0,g.useRef)(null);(0,g.useEffect)(()=>{if(e.isFocused&&e.focusedKey!=null&&(e.focusedKey!==T.current||K.current)&&x.current&&n.current){let b=vl(),A=Gt(n,e.focusedKey);if(!(A instanceof HTMLElement))return;(b==="keyboard"||K.current)&&(I.current&&cancelAnimationFrame(I.current),I.current=requestAnimationFrame(()=>{x.current&&(No(x.current,A),b!=="virtual"&&et(A,{containingElement:n.current}))}))}!m&&e.isFocused&&e.focusedKey==null&&T.current!=null&&n.current&&Ge(n.current),T.current=e.focusedKey,K.current=!1}),(0,g.useEffect)(()=>()=>{I.current&&cancelAnimationFrame(I.current)},[]),Ft(n,"react-aria-focus-scope-restore",b=>{b.preventDefault(),e.setFocused(!0)});let E={onKeyDown:_,onFocus:w,onBlur:p,onMouseDown(b){x.current===He(b)&&b.preventDefault()}},{typeSelectProps:M}=fc({keyboardDelegate:i,selectionManager:e});u||(E=$e(M,E));let k;m||(k=e.focusedKey==null?0:-1);let D=pc(e.collection);return{collectionProps:$e(E,{tabIndex:k,"data-collection":D})}}function Gl(t){let{id:e,selectionManager:i,key:n,ref:s,shouldSelectOnPressUp:a,shouldUseVirtualFocus:r,focus:c,isDisabled:o,onAction:d,allowsDifferentPressOrigin:u,linkBehavior:m="action"}=t,h=Sl();e=jt(e);let x=S=>{if(S.pointerType==="keyboard"&&bi(S))i.toggleSelection(n);else{if(i.selectionMode==="none")return;if(i.isLink(n)){if(m==="selection"&&s.current){let W=i.getItemProps(n);h.open(s.current,S,W.href,W.routerOptions),i.setSelectedKeys(i.selectedKeys);return}else if(m==="override"||m==="none")return}i.selectionMode==="single"?i.isSelected(n)&&!i.disallowEmptySelection?i.toggleSelection(n):i.replaceSelection(n):S&&S.shiftKey?i.extendSelection(n):i.selectionBehavior==="toggle"||S&&(mt(S)||S.pointerType==="touch"||S.pointerType==="virtual")?i.toggleSelection(n):i.replaceSelection(n)}};(0,g.useEffect)(()=>{n===i.focusedKey&&i.isFocused&&(r?Vl(s.current):c?c():ut()!==s.current&&s.current&&Ge(s.current))},[s,n,i.focusedKey,i.childFocusStrategy,i.isFocused,r]),o||(o=i.isDisabled(n));let y={};!r&&!o?y={tabIndex:n===i.focusedKey?0:-1,onFocus(S){He(S)===s.current&&i.setFocusedKey(n)}}:o&&(y.onMouseDown=S=>{S.preventDefault()}),(0,g.useEffect)(()=>{o&&i.focusedKey===n&&i.setFocusedKey(null)},[i,o,n]);let j=i.isLink(n)&&m==="override",v=d&&t.UNSTABLE_itemBehavior==="action",_=i.isLink(n)&&m!=="selection"&&m!=="none",C=!o&&i.canSelectItem(n)&&!j&&!v,w=(d||_)&&!o,p=w&&(i.selectionBehavior==="replace"?!C:!C||i.isEmpty),f=w&&C&&i.selectionBehavior==="replace",N=p||f,K=(0,g.useRef)(null),T=N&&C,I=(0,g.useRef)(!1),E=(0,g.useRef)(!1),M=i.getItemProps(n),k=S=>{if(d){var W;d(),(W=s.current)==null||W.dispatchEvent(new CustomEvent("react-aria-item-action",{bubbles:!0}))}_&&s.current&&h.open(s.current,S,M.href,M.routerOptions)},D={ref:s};if(a?(D.onPressStart=S=>{K.current=S.pointerType,I.current=T,S.pointerType==="keyboard"&&(!N||Ul(S.key))&&x(S)},u?(D.onPressUp=p?void 0:S=>{S.pointerType==="mouse"&&C&&x(S)},D.onPress=p?k:S=>{S.pointerType!=="keyboard"&&S.pointerType!=="mouse"&&C&&x(S)}):D.onPress=S=>{if(p||f&&S.pointerType!=="mouse"){if(S.pointerType==="keyboard"&&!Hl(S.key))return;k(S)}else S.pointerType!=="keyboard"&&C&&x(S)}):(D.onPressStart=S=>{K.current=S.pointerType,I.current=T,E.current=p,C&&(S.pointerType==="mouse"&&!p||S.pointerType==="keyboard"&&(!w||Ul(S.key)))&&x(S)},D.onPress=S=>{(S.pointerType==="touch"||S.pointerType==="pen"||S.pointerType==="virtual"||S.pointerType==="keyboard"&&N&&Hl(S.key)||S.pointerType==="mouse"&&E.current)&&(N?k(S):C&&x(S))}),y["data-collection"]=hc(i.collection),y["data-key"]=n,D.preventFocusOnPress=r,r&&(D=$e(D,{onPressStart(S){S.pointerType!=="touch"&&(i.setFocused(!0),i.setFocusedKey(n))},onPress(S){S.pointerType==="touch"&&(i.setFocused(!0),i.setFocusedKey(n))}})),M)for(let S of["onPressStart","onPressEnd","onPressChange","onPress","onPressUp","onClick"])M[S]&&(D[S]=wl(D[S],M[S]));let{pressProps:b,isPressed:A}=Cl(D),z=f?S=>{K.current==="mouse"&&(S.stopPropagation(),S.preventDefault(),k(S))}:void 0,{longPressProps:B}=cc({isDisabled:!T,onLongPress(S){S.pointerType==="touch"&&(x(S),i.setSelectionBehavior("toggle"))}}),q=S=>{K.current==="touch"&&I.current&&S.preventDefault()},Y=m!=="none"&&i.isLink(n)?S=>{jo.isOpening||S.preventDefault()}:void 0;return{itemProps:$e(y,C||p||r&&!o?b:{},T?B:{},{onDoubleClick:z,onDragStartCapture:q,onClick:Y,id:e},r?{onMouseDown:S=>S.preventDefault()}:void 0),isPressed:A,isSelected:i.isSelected(n),isFocused:i.isFocused&&i.focusedKey===n,isDisabled:o,allowsSelection:C,hasAction:N}}function Hl(t){return t==="Enter"}function Ul(t){return t===" "}var ql=class{getItemRect(t){let e=this.ref.current;if(!e)return null;let i=t==null?null:Gt(this.ref,t);if(!i)return null;let n=e.getBoundingClientRect(),s=i.getBoundingClientRect();return{x:s.left-n.left-e.clientLeft+e.scrollLeft,y:s.top-n.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}},ji=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 n=this.collection.getItem(i);if((n==null?void 0:n.type)==="item"&&!this.isDisabled(n))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 n=t,s=this.layoutDelegate.getItemRect(n);if(!s||n==null)return null;let a=s;do{if(n=e(n),n==null)break;s=this.layoutDelegate.getItemRect(n)}while(s&&i(a,s)&&n!=null);return n}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&&!Nl(e))return this.getFirstKey();let n=t;if(this.orientation==="horizontal"){let s=Math.max(0,i.x+i.width-this.layoutDelegate.getVisibleRect().width);for(;i&&i.x>s&&n!=null;)n=this.getKeyAbove(n),i=n==null?null:this.layoutDelegate.getItemRect(n)}else{let s=Math.max(0,i.y+i.height-this.layoutDelegate.getVisibleRect().height);for(;i&&i.y>s&&n!=null;)n=this.getKeyAbove(n),i=n==null?null:this.layoutDelegate.getItemRect(n)}return n??this.getFirstKey()}getKeyPageBelow(t){let e=this.ref.current,i=this.layoutDelegate.getItemRect(t);if(!i)return null;if(e&&!Nl(e))return this.getLastKey();let n=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&&n!=null;)n=this.getKeyBelow(n),i=n==null?null:this.layoutDelegate.getItemRect(n)}else{let s=Math.min(this.layoutDelegate.getContentSize().height,i.y-i.height+this.layoutDelegate.getVisibleRect().height);for(;i&&i.y<s&&n!=null;)n=this.getKeyBelow(n),i=n==null?null:this.layoutDelegate.getItemRect(n)}return n??this.getLastKey()}getKeyForSearch(t,e){if(!this.collator)return null;let i=this.collection,n=e||this.getFirstKey();for(;n!=null;){let s=i.getItem(n);if(!s)return null;let a=s.textValue.slice(0,t.length);if(s.textValue&&this.collator.compare(a,t)===0)return n;n=this.getNextKey(n)}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 ql(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 ql(this.ref);this.layout==="stack"&&this.orientation==="vertical"&&(this.getKeyLeftOf=void 0,this.getKeyRightOf=void 0)}};function Wl(t){let{selectionManager:e,collection:i,disabledKeys:n,ref:s,keyboardDelegate:a,layoutDelegate:r}=t,c=Kl({usage:"search",sensitivity:"base"}),o=e.disabledBehavior,d=(0,g.useMemo)(()=>a||new ji({collection:i,disabledKeys:n,disabledBehavior:o,ref:s,collator:c,layoutDelegate:r}),[a,r,i,n,s,c,o]),{collectionProps:u}=vc({...t,ref:s,selectionManager:e,keyboardDelegate:d});return{listProps:u}}var bc=class{build(t,e){return this.context=e,Yl(()=>this.iterateCollection(t))}*iterateCollection(t){let{children:e,items:i}=t;if(g.isValidElement(e)&&e.type===g.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 n=0;for(let s of i)yield*this.getFullNode({value:s,index:n},{renderer:e}),n++}else{let n=[];g.Children.forEach(e,a=>{a&&n.push(a)});let s=0;for(let a of n){let r=this.getFullNode({element:a,index:s},{});for(let c of r)s++,yield c}}}getKey(t,e,i,n){if(t.key!=null)return t.key;if(e.type==="cell"&&e.key!=null)return`${n}${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 n?`${n}.${e.index}`:`$.${e.index}`}getChildState(t,e){return{renderer:e.renderer||t.renderer}}*getFullNode(t,e,i,n){if(g.isValidElement(t.element)&&t.element.type===g.Fragment){let c=[];g.Children.forEach(t.element.props.children,d=>{c.push(d)});let o=t.index??0;for(let d of c)yield*this.getFullNode({element:d,index:o++},e,i,n);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=n?n.key:null,yield c;return}s=e.renderer(t.value)}if(g.isValidElement(s)){let c=s.type;if(typeof c!="function"&&typeof c.getCollectionNode!="function"){let m=s.type;throw Error(`Unknown element <${m}> in collection.`)}let o=c.getCollectionNode(s.props,this.context),d=t.index??0,u=o.next();for(;!u.done&&u.value;){let m=u.value;t.index=d;let h=m.key??null;h??(h=m.element?null:this.getKey(s,t,e,i));let x=[...this.getFullNode({...m,key:h,index:d,wrapper:jc(t.wrapper,m.wrapper)},this.getChildState(e,m),i?`${i}${s.key}`:s.key,n)];for(let y of x){if(y.value=m.value??t.value??null,y.value&&this.cache.set(y.value,y),t.type&&y.type!==t.type)throw Error(`Unsupported type <${ki(y.type)}> in <${ki((n==null?void 0:n.type)??"unknown parent type")}>. Only <${ki(t.type)}> is supported.`);d++,yield y}u=o.next(x)}return}if(t.key==null||t.type==null)return;let a=this,r={type:t.type,props:t.props,key:t.key,parentKey:n?n.key:null,value:t.value??null,level:n?n.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:Yl(function*(){if(!t.hasChildNodes||!t.childNodes)return;let c=0;for(let o of t.childNodes()){o.key!=null&&(o.key=`${r.key}${o.key}`);let d=a.getFullNode({...o,index:c},a.getChildState(e,o),r.key,r);for(let u of d)c++,yield u}})};yield r}constructor(){this.cache=new WeakMap}};function Yl(t){let e=[],i=null;return{*[Symbol.iterator](){for(let n of e)yield n;i||(i=t());for(let n of i)e.push(n),yield n}}}function jc(t,e){if(t&&e)return i=>t(e(i));if(t)return t;if(e)return e}function ki(t){return t[0].toUpperCase()+t.slice(1)}function Ql(t,e,i){let n=(0,g.useMemo)(()=>new bc,[]),{children:s,items:a,collection:r}=t;return(0,g.useMemo)(()=>r||e(n.build({children:s,items:a},i)),[n,s,a,r,i,e])}function Zl(t,e){return typeof e.getChildren=="function"?e.getChildren(t.key):t.childNodes}function kc(t){return wc(t,0)}function wc(t,e){if(e<0)return;let i=0;for(let n of t){if(i===e)return n;i++}}function wi(t,e,i){if(e.parentKey===i.parentKey)return e.index-i.index;let n=[...Xl(t,e),e],s=[...Xl(t,i),i],a=n.slice(0,s.length).findIndex((r,c)=>r!==s[c]);return a===-1?n.findIndex(r=>r===i)>=0?1:(s.findIndex(r=>r===e),-1):(e=n[a],i=s[a],e.index-i.index)}function Xl(t,e){let i=[],n=e;for(;(n==null?void 0:n.parentKey)!=null;)n=t.getItem(n.parentKey),n&&i.unshift(n);return i}var Ci=new WeakMap;function Si(t,e){let{id:i}=Ci.get(t)??{};if(!i)throw Error("Unknown list");return`${i}-${Cc(e)}`}function Cc(t){return typeof t=="string"?t.replace(/\s*/g,""):""+t}var Jl={};Jl={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 en={};en={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 tn={};tn={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 ln={};ln={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 nn={};nn={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 sn={};sn={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 an={};an={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 rn={};rn={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 on={};on={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 cn={};cn={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 dn={};dn={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 un={};un={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 mn={};mn={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 pn={};pn={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 hn={};hn={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 gn={};gn={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 fn={};fn={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 xn={};xn={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 yn={};yn={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 vn={};vn={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 bn={};bn={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 jn={};jn={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 kn={};kn={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 wn={};wn={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 Cn={};Cn={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 Sn={};Sn={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 _n={};_n={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 Nn={};Nn={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 In={};In={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 Kn={};Kn={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 Mn={};Mn={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 Dn={};Dn={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 An={};An={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 Pn={};Pn={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 Ht={};Ht={"ar-AE":Jl,"bg-BG":en,"cs-CZ":tn,"da-DK":ln,"de-DE":nn,"el-GR":sn,"en-US":an,"es-ES":rn,"et-EE":on,"fi-FI":cn,"fr-FR":dn,"he-IL":un,"hr-HR":mn,"hu-HU":pn,"it-IT":hn,"ja-JP":gn,"ko-KR":fn,"lt-LT":xn,"lv-LV":yn,"nb-NO":vn,"nl-NL":bn,"pl-PL":jn,"pt-BR":kn,"pt-PT":wn,"ro-RO":Cn,"ru-RU":Sn,"sk-SK":_n,"sl-SI":Nn,"sr-SP":In,"sv-SE":Kn,"tr-TR":Mn,"uk-UA":Dn,"zh-CN":An,"zh-TW":Pn};function Sc(t){return t&&t.__esModule?t.default:t}function _c(t,e){let{getRowText:i=c=>{var d,u;var o;return((d=(o=e.collection).getTextValue)==null?void 0:d.call(o,c))??((u=e.collection.getItem(c))==null?void 0:u.textValue)}}=t,n=zt(Sc(Ht),"@react-aria/grid"),s=e.selectionManager.rawSelection,a=(0,g.useRef)(s),r=(0,g.useCallback)(()=>{var m;if(!e.selectionManager.isFocused||s===a.current){a.current=s;return}let c=En(s,a.current),o=En(a.current,s),d=e.selectionManager.selectionBehavior==="replace",u=[];if(e.selectionManager.selectedKeys.size===1&&d){let h=e.selectionManager.selectedKeys.keys().next().value;if(h!=null&&e.collection.getItem(h)){let x=i(h);x&&u.push(n.format("selectedItem",{item:x}))}}else if(c.size===1&&o.size===0){let h=c.keys().next().value;if(h!=null){let x=i(h);x&&u.push(n.format("selectedItem",{item:x}))}}else if(o.size===1&&c.size===0){let h=o.keys().next().value;if(h!=null&&e.collection.getItem(h)){let x=i(h);x&&u.push(n.format("deselectedItem",{item:x}))}}e.selectionManager.selectionMode==="multiple"&&(u.length===0||s==="all"||s.size>1||a.current==="all"||((m=a.current)==null?void 0:m.size)>1)&&u.push(s==="all"?n.format("selectedAll"):n.format("selectedCount",{count:s.size})),u.length>0&&io(u.join(" ")),a.current=s},[s,e.selectionManager.selectedKeys,e.selectionManager.isFocused,e.selectionManager.selectionBehavior,e.selectionManager.selectionMode,e.collection,i,n]);Mo(()=>{if(e.selectionManager.isFocused)r();else{let c=requestAnimationFrame(r);return()=>cancelAnimationFrame(c)}},[s,e.selectionManager.isFocused])}function En(t,e){let i=new Set;if(t==="all"||e==="all")return i;for(let n of t.keys())e.has(n)||i.add(n);return i}function Nc(t){return t&&t.__esModule?t.default:t}function Ic(t){let e=zt(Nc(Ht),"@react-aria/grid"),i=uo(),n=(i==="pointer"||i==="virtual"||i==null)&&typeof window<"u"&&"ontouchstart"in window;return Il((0,g.useMemo)(()=>{let s=t.selectionManager.selectionMode,a=t.selectionManager.selectionBehavior,r;return n&&(r=e.format("longPressToSelect")),a==="replace"&&s!=="none"&&t.hasItemActions?r:void 0},[t.selectionManager.selectionMode,t.selectionManager.selectionBehavior,t.hasItemActions,e,n]))}function Kc(t){return t&&t.__esModule?t.default:t}function Mc(t,e){let{key:i}=t,n=e.selectionManager,s=jt(),a=!e.selectionManager.canSelectItem(i),r=e.selectionManager.isSelected(i),c=()=>n.toggleSelection(i),o=zt(Kc(Ht),"@react-aria/grid");return{checkboxProps:{id:s,"aria-label":o.format("select"),isSelected:r,isDisabled:a,onChange:c}}}function Dc(t,e,i){let{isVirtualized:n,keyboardDelegate:s,layoutDelegate:a,onAction:r,disallowTypeAhead:c,linkBehavior:o="action",keyboardNavigationBehavior:d="arrow",escapeKeyBehavior:u="clearSelection",shouldSelectOnPressUp:m}=t;!t["aria-label"]&&!t["aria-labelledby"]&&console.warn("An aria-label or aria-labelledby prop is required for accessibility.");let{listProps:h}=Wl({selectionManager:e.selectionManager,collection:e.collection,disabledKeys:e.disabledKeys,ref:i,keyboardDelegate:s,layoutDelegate:a,isVirtualized:n,selectOnFocus:e.selectionManager.selectionBehavior==="replace",shouldFocusWrap:t.shouldFocusWrap,linkBehavior:o,disallowTypeAhead:c,autoFocus:t.autoFocus,escapeKeyBehavior:u}),x=jt(t.id);Ci.set(e,{id:x,onAction:r,linkBehavior:o,keyboardNavigationBehavior:d,shouldSelectOnPressUp:m});let y=Ic({selectionManager:e.selectionManager,hasItemActions:!!r}),j=dc(i,{isDisabled:e.collection.size!==0}),v=$e(Rt(t,{labelable:!0}),{role:"grid",id:x,"aria-multiselectable":e.selectionManager.selectionMode==="multiple"?"true":void 0},e.collection.size===0?{tabIndex:j?-1:0}:h,y);return n&&(v["aria-rowcount"]=e.collection.size,v["aria-colcount"]=1),_c({},e),{gridProps:v}}var Tn={expand:{ltr:"ArrowRight",rtl:"ArrowLeft"},collapse:{ltr:"ArrowLeft",rtl:"ArrowRight"}};function Ac(t,e,i){var I,E,M;let{node:n,isVirtualized:s}=t,{direction:a}=Ot(),{onAction:r,linkBehavior:c,keyboardNavigationBehavior:o,shouldSelectOnPressUp:d}=Ci.get(e),u=_o(),m=(0,g.useRef)(null),h=()=>{i.current!==null&&(m.current!=null&&n.key!==m.current||!hi(i.current))&&Ge(i.current)},x={},y=t.hasChildItems,j=e.selectionManager.isLink(n.key);if(n!=null&&"expandedKeys"in e){var v;let k=(I=(v=e.collection).getChildren)==null?void 0:I.call(v,n.key);y||(y=[...k??[]].length>1),r==null&&!j&&e.selectionManager.selectionMode==="none"&&y&&(r=()=>e.toggleKey(n.key));let D=y?e.expandedKeys.has(n.key):void 0,b=1,A=n.index;if(n.level>=0&&(n==null?void 0:n.parentKey)!=null){let z=e.collection.getItem(n.parentKey);if(z){let B=Pc(z,e.collection);b=[...B].filter(q=>q.type==="item").length,A>0&&B[0].type!=="item"&&--A}}else b=[...e.collection].filter(z=>z.level===0&&z.type==="item").length;x={"aria-expanded":D,"aria-level":n.level+1,"aria-posinset":A+1,"aria-setsize":b}}let{itemProps:_,...C}=Gl({selectionManager:e.selectionManager,key:n.key,ref:i,isVirtualized:s,shouldSelectOnPressUp:t.shouldSelectOnPressUp||d,onAction:r||(E=n.props)!=null&&E.onAction?wl((M=n.props)==null?void 0:M.onAction,r?()=>r(n.key):void 0):void 0,focus:h,linkBehavior:c}),w=k=>{let D=ut();if(!Je(k.currentTarget,He(k))||!i.current||!D)return;let b=Vt(i.current);if(b.currentNode=D,"expandedKeys"in e&&D===i.current){if(k.key===Tn.expand[a]&&e.selectionManager.focusedKey===n.key&&y&&!e.expandedKeys.has(n.key)){e.toggleKey(n.key),k.stopPropagation();return}else if(k.key===Tn.collapse[a]&&e.selectionManager.focusedKey===n.key&&y&&e.expandedKeys.has(n.key)){e.toggleKey(n.key),k.stopPropagation();return}}switch(k.key){case"ArrowLeft":if(o==="arrow"){let z=a==="rtl"?b.nextNode():b.previousNode();if(z)k.preventDefault(),k.stopPropagation(),Ge(z),et(z,{containingElement:at(i.current)});else if(k.preventDefault(),k.stopPropagation(),a==="rtl")Ge(i.current),et(i.current,{containingElement:at(i.current)});else{b.currentNode=i.current;let B=zn(b);B&&(Ge(B),et(B,{containingElement:at(i.current)}))}}break;case"ArrowRight":if(o==="arrow"){let z=a==="rtl"?b.previousNode():b.nextNode();if(z)k.preventDefault(),k.stopPropagation(),Ge(z),et(z,{containingElement:at(i.current)});else if(k.preventDefault(),k.stopPropagation(),a==="ltr")Ge(i.current),et(i.current,{containingElement:at(i.current)});else{b.currentNode=i.current;let B=zn(b);B&&(Ge(B),et(B,{containingElement:at(i.current)}))}}break;case"ArrowUp":case"ArrowDown":if(!k.altKey&&Je(i.current,He(k))){var A;k.stopPropagation(),k.preventDefault(),(A=i.current.parentElement)==null||A.dispatchEvent(new KeyboardEvent(k.nativeEvent.type,k.nativeEvent))}break}},p=k=>{if(m.current=n.key,He(k)!==i.current){mo()||e.selectionManager.setFocusedKey(n.key);return}},f=k=>{let D=ut();if(!(!Je(k.currentTarget,He(k))||!i.current||!D))switch(k.key){case"Tab":if(o==="tab"){let b=Vt(i.current,{tabbable:!0});b.currentNode=D,(k.shiftKey?b.previousNode():b.nextNode())&&k.stopPropagation()}}},N=So(n.props),K=$e(_,C.hasAction?N:{},{role:"row",onKeyDownCapture:w,onKeyDown:f,onFocus:p,"aria-label":n["aria-label"]||n.textValue||void 0,"aria-selected":e.selectionManager.canSelectItem(n.key)?e.selectionManager.isSelected(n.key):void 0,"aria-disabled":e.selectionManager.isDisabled(n.key)||void 0,"aria-labelledby":u&&(n["aria-label"]||n.textValue)?`${Si(e,n.key)} ${u}`:void 0,id:Si(e,n.key)});if(s){let{collection:k}=e;K["aria-rowindex"]=[...k].find(D=>D.type==="section")?[...k.getKeys()].filter(D=>{var b;return((b=k.getItem(D))==null?void 0:b.type)!=="section"}).findIndex(D=>D===n.key)+1:n.index+1}let T={role:"gridcell","aria-colindex":1};return{rowProps:{...$e(K,x)},gridCellProps:T,descriptionProps:{id:u},...C}}function zn(t){let e=null,i=null;do i=t.lastChild(),i&&(e=i);while(i);return e}function Pc(t,e){var r;let i=(r=e.getChildren)==null?void 0:r.call(e,t.key),n=i?Array.from(i):[],s=n.length>0?n[0]:null,a=[];for(;s;)a.push(s),s=s.nextKey==null?null:e.getItem(s.nextKey);return a}function Ec(t,e){let{key:i}=t,{checkboxProps:n}=Mc(t,e);return{checkboxProps:{...n,"aria-labelledby":`${n.id} ${Si(e,i)}`}}}function Tc(t,e,i){let{gridProps:n}=Dc(t,e,i);return n.role="treegrid",{gridProps:n}}var Bn={};Bn={collapse:"\u0637\u064A",expand:"\u062A\u0645\u062F\u064A\u062F"};var Fn={};Fn={collapse:"\u0421\u0432\u0438\u0432\u0430\u043D\u0435",expand:"\u0420\u0430\u0437\u0448\u0438\u0440\u044F\u0432\u0430\u043D\u0435"};var Rn={};Rn={collapse:"Sbalit",expand:"Rozt\xE1hnout"};var $n={};$n={collapse:"Skjul",expand:"Udvid"};var Vn={};Vn={collapse:"Reduzieren",expand:"Erweitern"};var On={};On={collapse:"\u03A3\u03CD\u03BC\u03C0\u03C4\u03C5\u03BE\u03B7",expand:"\u0391\u03BD\u03AC\u03C0\u03C4\u03C5\u03BE\u03B7"};var Ln={};Ln={expand:"Expand",collapse:"Collapse"};var Gn={};Gn={collapse:"Contraer",expand:"Ampliar"};var Hn={};Hn={collapse:"Ahenda",expand:"Laienda"};var Un={};Un={collapse:"Pienenn\xE4",expand:"Laajenna"};var qn={};qn={collapse:"R\xE9duire",expand:"D\xE9velopper"};var Wn={};Wn={collapse:"\u05DB\u05D5\u05D5\u05E5",expand:"\u05D4\u05E8\u05D7\u05D1"};var Yn={};Yn={collapse:"Sa\u017Emi",expand:"Pro\u0161iri"};var Qn={};Qn={collapse:"\xD6sszecsuk\xE1s",expand:"Kibont\xE1s"};var Zn={};Zn={collapse:"Comprimi",expand:"Espandi"};var Xn={};Xn={collapse:"\u6298\u308A\u305F\u305F\u3080",expand:"\u5C55\u958B"};var Jn={};Jn={collapse:"\uC811\uAE30",expand:"\uD3BC\uCE58\uAE30"};var es={};es={collapse:"Sutraukti",expand:"I\u0161skleisti"};var ts={};ts={collapse:"Sak\u013Caut",expand:"Izv\u0113rst"};var is={};is={collapse:"Skjul",expand:"Utvid"};var ls={};ls={collapse:"Samenvouwen",expand:"Uitvouwen"};var ns={};ns={collapse:"Zwi\u0144",expand:"Rozwi\u0144"};var ss={};ss={collapse:"Recolher",expand:"Expandir"};var as={};as={collapse:"Colapsar",expand:"Expandir"};var rs={};rs={collapse:"Restr\xE2nge\u021Bi",expand:"Extinde\u021Bi"};var os={};os={collapse:"\u0421\u0432\u0435\u0440\u043D\u0443\u0442\u044C",expand:"\u0420\u0430\u0437\u0432\u0435\u0440\u043D\u0443\u0442\u044C"};var cs={};cs={collapse:"Zbali\u0165",expand:"Rozbali\u0165"};var ds={};ds={collapse:"Strni",expand:"Raz\u0161iri"};var us={};us={collapse:" Skupi",expand:"Pro\u0161iri"};var ms={};ms={collapse:"D\xF6lj",expand:"Expandera"};var ps={};ps={collapse:"Daralt",expand:"Geni\u015Flet"};var hs={};hs={collapse:"\u0417\u0433\u043E\u0440\u043D\u0443\u0442\u0438",expand:"\u0420\u043E\u0437\u0433\u043E\u0440\u043D\u0443\u0442\u0438"};var gs={};gs={collapse:"\u6298\u53E0",expand:"\u6269\u5C55"};var fs={};fs={collapse:"\u6536\u5408",expand:"\u5C55\u958B"};var xs={};xs={"ar-AE":Bn,"bg-BG":Fn,"cs-CZ":Rn,"da-DK":$n,"de-DE":Vn,"el-GR":On,"en-US":Ln,"es-ES":Gn,"et-EE":Hn,"fi-FI":Un,"fr-FR":qn,"he-IL":Wn,"hr-HR":Yn,"hu-HU":Qn,"it-IT":Zn,"ja-JP":Xn,"ko-KR":Jn,"lt-LT":es,"lv-LV":ts,"nb-NO":is,"nl-NL":ls,"pl-PL":ns,"pt-BR":ss,"pt-PT":as,"ro-RO":rs,"ru-RU":os,"sk-SK":cs,"sl-SI":ds,"sr-SP":us,"sv-SE":ms,"tr-TR":ps,"uk-UA":hs,"zh-CN":gs,"zh-TW":fs};function zc(t){return t&&t.__esModule?t.default:t}function ys(t,e,i){let{node:n}=t,s=Ac(t,e,i),a=s.rowProps["aria-expanded"]===!0,r=zt(zc(xs),"@react-aria/tree"),c=co({"aria-label":a?r.format("collapse"):r.format("expand"),"aria-labelledby":s.rowProps.id}),o={onPress:()=>{s.isDisabled||(e.toggleKey(n.key),e.selectionManager.setFocused(!0),e.selectionManager.setFocusedKey(n.key))},excludeFromTabOrder:!0,preventFocusOnPress:!0,"data-react-aria-prevent-focus":!0,...c};return{...s,expandButtonProps:o}}var rt=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 n=this.clone();return e.addDescendants(n,t),n}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}},vs=class extends rt{filter(t,e,i){let[n,s]=ks(t,e,this.firstChildKey,i),a=this.clone();return a.firstChildKey=n,a.lastChildKey=s,a}},Bc=class extends rt{};Bc.type="header";var _i=class extends rt{};_i.type="loader";var bs=class extends vs{filter(t,e,i){if(i(this.textValue,this)){let n=this.clone();return e.addDescendants(n,t),n}return null}};bs.type="item";var Fc=class extends vs{filter(t,e,i){let n=super.filter(t,e,i);if(n&&n.lastChildKey!==null){let s=t.getItem(n.lastChildKey);if(s&&s.type!=="header")return n}return null}};Fc.type="section";var js=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),n=(i==null?void 0:i.firstChildKey)==null?null:e.get(i.firstChildKey);for(;n;)yield n,n=n.nextKey==null?void 0:e.get(n.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 n of i)this.addDescendants(n,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,n]=ks(this,e,this.firstKey,t);return e==null||e.commit(i,n),e}constructor(){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.frozen=!1,this.itemCount=0}};function ks(t,e,i,n){if(i==null)return[null,null];let s=null,a=null,r=t.getItem(i);for(;r!=null;){let c=r.filter(t,e,n);c!=null&&(c.nextKey=null,a&&(c.prevKey=a.key,a.nextKey=c.key),s??(s=c),e.addNode(c),a=c),r=r.nextKey?t.getItem(r.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 ws=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}},Ni=class Oi extends ws{get index(){return this._index}set index(e){this._index=e,this.ownerDocument.markDirty(this)}get level(){var e;return this.parentNode instanceof Oi?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 n,s,a,r,c,o,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 Oi?((n=this.parentNode.node)==null?void 0:n.key)??null:null,i.prevKey=((a=(s=this.previousVisibleSibling)==null?void 0:s.node)==null?void 0:a.key)??null,i.nextKey=((r=e==null?void 0:e.node)==null?void 0:r.key)??null,i.hasChildNodes=!!this.firstChild,i.firstChildKey=((o=(c=this.firstVisibleChild)==null?void 0:c.node)==null?void 0:o.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 m=(i.colIndex??i.index)+(i.colSpan??1);if(e.node!=null&&m!==e.node.colIndex){let h=e.getMutableNode();h.colIndex=m}}}setProps(e,i,n,s,a){let r,{value:c,textValue:o,id:d,...u}=e;if(this.node==null?(r=new n(d??`react-aria-${++this.ownerDocument.nodeId}`),this.node=r):r=this.getMutableNode(),u.ref=i,r.props=u,r.rendered=s,r.render=a,r.value=c,e["aria-label"]&&(r["aria-label"]=e["aria-label"]),r.textValue=o||(typeof u.children=="string"?u.children:"")||e["aria-label"]||"",d!=null&&d!==r.key)throw Error("Cannot change the id of an item");u.colSpan!=null&&(r.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 n=i==="none";if(e.isHidden!==n){(((s=e.parentNode)==null?void 0:s.firstVisibleChild)===e||((a=e.parentNode)==null?void 0:a.lastVisibleChild)===e)&&e.ownerDocument.markDirty(e.parentNode);let r=e.previousVisibleSibling,c=e.nextVisibleSibling;r&&e.ownerDocument.markDirty(r),c&&e.ownerDocument.markDirty(c),e.isHidden=n,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}},Rc=class extends ws{get isConnected(){return!0}createElement(t){return new Ni(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,n;for(let s of this.dirtyNodes)s instanceof Ni&&(!s.isConnected||s.isHidden)?this.removeNode(s):s.updateChildIndices();for(let s of this.dirtyNodes)s instanceof Ni?(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,((n=(i=this.lastVisibleChild)==null?void 0:i.node)==null?void 0:n.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 Ii(t){let{children:e,items:i,idScope:n,addIdAndValue:s,dependencies:a=[]}=t,r=(0,g.useMemo)(()=>new WeakMap,a);return(0,g.useMemo)(()=>{if(i&&typeof e=="function"){let c=[];for(let o of i){let d=r.get(o);if(!d){d=e(o);let u=d.props.id??o.key??o.id;if(u==null)throw Error("Could not determine key for item");n!=null&&(u=n+":"+u),d=(0,g.cloneElement)(d,s?{key:u,id:u,value:o}:{key:u}),r.set(o,d)}c.push(d)}return c}else if(typeof e!="function")return e},[e,i,r,n,s])}var $c=Qi(),Vc=jr(),Cs=(0,g.createContext)(!1),wt=(0,g.createContext)(null);function Ss(t){if((0,g.useContext)(wt))return t.content;let{collection:e,document:i}=Hc(t.createCollection);return g.createElement(g.Fragment,null,g.createElement(ro,null,g.createElement(wt.Provider,{value:i},t.content)),g.createElement(Oc,{render:t.children,collection:e}))}function Oc({collection:t,render:e}){return e(t)}function Lc(t,e,i){let n=_l(),s=(0,g.useRef)(n);return s.current=n,(0,Vc.useSyncExternalStore)(t,(0,g.useCallback)(()=>s.current?i():e(),[e,i]))}var Gc=typeof g.useSyncExternalStore=="function"?g.useSyncExternalStore:Lc;function Hc(t){let[e]=(0,g.useState)(()=>new Rc((t==null?void 0:t())||new js));return{collection:Gc((0,g.useCallback)(i=>e.subscribe(i),[e]),(0,g.useCallback)(()=>{let i=e.getCollection();return e.isSSR&&e.resetAfterSSR(),i},[e]),(0,g.useCallback)(()=>(e.isSSR=!0,e.getCollection()),[e])),document:e}}var Ki=(0,g.createContext)(null);function Uc(t){var e;return e=class extends rt{},e.type=t,e}function _s(t,e,i,n,s,a){typeof t=="string"&&(t=Uc(t));let r=(0,g.useCallback)(o=>{o==null||o.setProps(e,i,t,n,a)},[e,i,n,a,t]),c=(0,g.useContext)(Ki);if(c){let o=c.ownerDocument.nodesByProps.get(e);return o||(o=c.ownerDocument.createElement(t.type),o.setProps(e,i,t,n,a),c.appendChild(o),c.ownerDocument.updateCollection(),c.ownerDocument.nodesByProps.set(e,o)),s?g.createElement(Ki.Provider,{value:o},s):null}return g.createElement(t.type,{ref:r},s)}function Mi(t,e){let i=({node:s})=>e(s.props,s.props.ref,s),n=(0,g.forwardRef)((s,a)=>{let r=(0,g.useContext)(yl);if(!(0,g.useContext)(Cs)){if(e.length>=3)throw Error(e.name+" cannot be rendered outside a collection.");return e(s,a)}return _s(t,s,a,"children"in s?s.children:null,null,c=>g.createElement(yl.Provider,{value:r},g.createElement(i,{node:c})))});return n.displayName=e.name,n}function qc(t,e,i=Ns){let n=({node:a})=>e(a.props,a.props.ref,a),s=(0,g.forwardRef)((a,r)=>_s(t,a,r,null,i(a),c=>g.createElement(n,{node:c}))??g.createElement(g.Fragment,null));return s.displayName=e.name,s}function Ns(t){return Ii({...t,addIdAndValue:!0})}var Is=(0,g.createContext)(null);function Ks(t){let e=(0,g.useContext)(Is),i=((e==null?void 0:e.dependencies)||[]).concat(t.dependencies),n=t.idScope??(e==null?void 0:e.idScope),s=Ns({...t,idScope:n,dependencies:i});return(0,g.useContext)(wt)&&(s=g.createElement(Wc,null,s)),e=(0,g.useMemo)(()=>({dependencies:i,idScope:n}),[n,...i]),g.createElement(Is.Provider,{value:e},s)}function Wc({children:t}){let e=(0,g.useContext)(wt),i=(0,g.useMemo)(()=>g.createElement(wt.Provider,{value:null},g.createElement(Cs.Provider,{value:!0},t)),[t]);return _l()?g.createElement(Ki.Provider,{value:e},i):(0,$c.createPortal)(i,e)}var Yc=(0,g.createContext)(null),Ms={CollectionRoot({collection:t,renderDropIndicator:e}){return Ds(t,null,e)},CollectionBranch({collection:t,parent:e,renderDropIndicator:i}){return Ds(t,e,i)}};function Ds(t,e,i){return Ii({items:e?t.getChildren(e.key):t,dependencies:[i],children(n){if(n.type==="content")return g.createElement(g.Fragment,null);let s=n.render(n);return!i||n.type!=="item"?s:g.createElement(g.Fragment,null,i({type:"item",key:n.key,dropPosition:"before"}),s,Qc(t,n,i))}})}function Qc(t,e,i){let n=e.key,s=t.getKeyAfter(n),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 r=e.nextKey==null?null:t.getItem(e.nextKey);for(;r!=null&&r.type!=="item";)r=r.nextKey==null?null:t.getItem(r.nextKey);let c=[];if(r==null){let o=e;for(;(o==null?void 0:o.type)==="item"&&(!a||o.parentKey!==a.parentKey&&a.level<o.level);){let d=i({type:"item",key:o.key,dropPosition:"after"});(0,g.isValidElement)(d)&&c.push((0,g.cloneElement)(d,{key:`${o.key}-after`})),o=o.parentKey==null?null:t.getItem(o.parentKey)}}return c}var Ut=(0,g.createContext)(Ms),We=class Da extends Set{constructor(e,i,n){super(e),e instanceof Da?(this.anchorKey=i??e.anchorKey,this.currentKey=n??e.currentKey):(this.anchorKey=i??null,this.currentKey=n??null)}};function Zc(t,e){if(t.size!==e.size)return!1;for(let i of t)if(!e.has(i))return!1;return!0}function As(t){let{selectionMode:e="none",disallowEmptySelection:i=!1,allowDuplicateSelectionEvents:n,selectionBehavior:s="toggle",disabledBehavior:a="all"}=t,r=(0,g.useRef)(!1),[,c]=(0,g.useState)(!1),o=(0,g.useRef)(null),d=(0,g.useRef)(null),[,u]=(0,g.useState)(null),[m,h]=di((0,g.useMemo)(()=>Ps(t.selectedKeys),[t.selectedKeys]),(0,g.useMemo)(()=>Ps(t.defaultSelectedKeys,new We),[t.defaultSelectedKeys]),t.onSelectionChange),x=(0,g.useMemo)(()=>t.disabledKeys?new Set(t.disabledKeys):new Set,[t.disabledKeys]),[y,j]=(0,g.useState)(s);s==="replace"&&y==="toggle"&&typeof m=="object"&&m.size===0&&j("replace");let v=(0,g.useRef)(s);return(0,g.useEffect)(()=>{s!==v.current&&(j(s),v.current=s)},[s]),{selectionMode:e,disallowEmptySelection:i,selectionBehavior:y,setSelectionBehavior:j,get isFocused(){return r.current},setFocused(_){r.current=_,c(_)},get focusedKey(){return o.current},get childFocusStrategy(){return d.current},setFocusedKey(_,C="first"){o.current=_,d.current=C,u(_)},selectedKeys:m,setSelectedKeys(_){(n||!Zc(_,m))&&h(_)},disabledKeys:x,disabledBehavior:a}}function Ps(t,e){return t?t==="all"?"all":new We(t):e}var Es=class Aa{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(n=>i.has(n)),this._isSelectAll}get firstSelectedKey(){let e=null;for(let i of this.state.selectedKeys){let n=this.collection.getItem(i);(!e||n&&wi(this.collection,n,e)<0)&&(e=n)}return(e==null?void 0:e.key)??null}get lastSelectedKey(){let e=null;for(let i of this.state.selectedKeys){let n=this.collection.getItem(i);(!e||n&&wi(this.collection,n,e)>0)&&(e=n)}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 n;if(this.state.selectedKeys==="all")n=new We([i],i,i);else{let s=this.state.selectedKeys,a=s.anchorKey??i;n=new We(s,a,i);for(let r of this.getKeyRange(a,s.currentKey??i))n.delete(r);for(let r of this.getKeyRange(i,a))this.canSelectItem(r)&&n.add(r)}this.state.setSelectedKeys(n)}getKeyRange(e,i){let n=this.collection.getItem(e),s=this.collection.getItem(i);return n&&s?wi(this.collection,n,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 n=[],s=e;for(;s!=null;){let r=this.collection.getItem(s);if(r&&(r.type==="item"||r.type==="cell"&&this.allowsCellSelection)&&n.push(s),s===i)return n;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 n=new We(this.state.selectedKeys==="all"?this.getSelectAllKeys():this.state.selectedKeys);n.has(i)?n.delete(i):this.canSelectItem(i)&&(n.add(i),n.anchorKey=i,n.currentKey=i),!(this.disallowEmptySelection&&n.size===0)&&this.state.setSelectedKeys(n)}replaceSelection(e){if(this.selectionMode==="none")return;let i=this.getKey(e);if(i==null)return;let n=this.canSelectItem(i)?new We([i],i,i):new We;this.state.setSelectedKeys(n)}setSelectedKeys(e){if(this.selectionMode==="none")return;let i=new We;for(let n of e){let s=this.getKey(n);if(s!=null&&(i.add(s),this.selectionMode==="single"))break}this.state.setSelectedKeys(i)}getSelectAllKeys(){let e=[],i=n=>{var s;for(;n!=null;){if(this.canSelectItem(n)){let a=this.collection.getItem(n);(a==null?void 0:a.type)==="item"&&e.push(n),a!=null&&a.hasChildNodes&&(this.allowsCellSelection||a.type!=="item")&&i(((s=kc(Zl(a,this.collection)))==null?void 0:s.key)??null)}n=this.collection.getKeyAfter(n)}};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 We)}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 n of e)if(!i.has(n))return!1;for(let n of i)if(!e.has(n))return!1;return!0}canSelectItem(e){var n;if(this.state.selectionMode==="none"||this.state.disabledKeys.has(e))return!1;let i=this.collection.getItem(e);return!(!i||i!=null&&((n=i.props)!=null&&n.isDisabled)||i.type==="cell"&&!this.allowsCellSelection)}isDisabled(e){var n;var i;return this.state.disabledBehavior==="all"&&(this.state.disabledKeys.has(e)||!!((i=this.collection.getItem(e))!=null&&((n=i.props)!=null&&n.isDisabled)))}isLink(e){var n;var i;return!!((i=this.collection.getItem(e))!=null&&((n=i.props)!=null&&n.href))}getItemProps(e){var i;return(i=this.collection.getItem(e))==null?void 0:i.props}withCollection(e){return new Aa(e,this.state,{allowsCellSelection:this.allowsCellSelection,layoutDelegate:this.layoutDelegate||void 0})}constructor(e,i,n){this.collection=e,this.state=i,this.allowsCellSelection=(n==null?void 0:n.allowsCellSelection)??!1,this._isSelectAll=null,this.layoutDelegate=(n==null?void 0:n.layoutDelegate)||null}},Xc=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 r of a.childNodes)i(r)};for(let a of t)i(a);let n=null,s=0;for(let[a,r]of this.keyMap)n?(n.nextKey=a,r.prevKey=n.key):(this.firstKey=a,r.prevKey=void 0),r.type==="item"&&(r.index=s++),n=r,n.nextKey=void 0;this.lastKey=(n==null?void 0:n.key)??null}};function Jc(t){let{onExpandedChange:e}=t,[i,n]=di(t.expandedKeys?new Set(t.expandedKeys):void 0,t.defaultExpandedKeys?new Set(t.defaultExpandedKeys):new Set,e),s=As(t),a=(0,g.useMemo)(()=>t.disabledKeys?new Set(t.disabledKeys):new Set,[t.disabledKeys]),r=Ql(t,(0,g.useCallback)(c=>new Xc(c,{expandedKeys:i}),[i]),null);return(0,g.useEffect)(()=>{s.focusedKey!=null&&!r.getItem(s.focusedKey)&&s.setFocusedKey(null)},[r,s.focusedKey]),{collection:r,expandedKeys:i,disabledKeys:a,toggleKey:c=>{n(ed(i,c))},setExpandedKeys:n,selectionManager:new Es(r,s)}}function ed(t,e){let i=new Set(t);return i.has(e)?i.delete(e):i.add(e),i}var Ct=(0,g.createContext)({}),Di=(0,g.createContext)(null),td=(0,g.forwardRef)(function(t,e){let{render:i}=(0,g.useContext)(Di);return g.createElement(g.Fragment,null,i(t,e))});function Ts(t,e){var a;let i=t==null?void 0:t.renderDropIndicator,n=(a=t==null?void 0:t.isVirtualDragging)==null?void 0:a.call(t),s=(0,g.useCallback)(r=>{if(n||e!=null&&e.isDropTarget(r))return i?i(r):g.createElement(td,{target:r})},[e==null?void 0:e.target,n,i]);return t!=null&&t.useDropIndicator?s:void 0}function zs(t,e,i){var a,r,c;let n=t.focusedKey,s=null;if(e!=null&&((a=e.isVirtualDragging)!=null&&a.call(e))&&((r=i==null?void 0:i.target)==null?void 0:r.type)==="item"&&(s=i.target.key,i.target.dropPosition==="after")){let o=i.collection.getKeyAfter(s),d=null;if(o!=null){let u=((c=i.collection.getItem(s))==null?void 0:c.level)??0;for(;o;){let m=i.collection.getItem(o);if(!m)break;if(m.type!=="item"){o=i.collection.getKeyAfter(o);continue}if((m.level??0)<=u)break;d=o,o=i.collection.getKeyAfter(o)}}s=o??d??s}return(0,g.useMemo)(()=>new Set([n,s].filter(o=>o!=null)),[n,s])}var Bs=10,Fs=5,id=class{setup(t,e,i){this.delegate=t,this.state=e,this.direction=i}getDropTargetFromPoint(t,e,i){let n=this.delegate.getDropTargetFromPoint(t,e,i);return!n||n.type==="root"?n:this.resolveDropTarget(n,t,e,i)}resolveDropTarget(t,e,i,n){let s=this.pointerTracking,a=i-s.lastY,r=e-s.lastX,c=s.yDirection,o=s.xDirection;if(Math.abs(a)>Fs&&(c=a>0?"down":"up",s.yDirection=c,s.lastY=i),Math.abs(r)>Bs&&(o=r>0?"right":"left",s.xDirection=o,s.lastX=e),t.dropPosition==="before"){let m=this.state.collection.getKeyBefore(t.key);if(m!=null){let h={type:"item",key:m,dropPosition:"after"};n(h)&&(t=h)}}let d=this.getPotentialTargets(t,n);if(d.length===0)return{type:"root"};let u;return d.length>1?u=this.selectTarget(d,t,e,i,c,o):(u=d[0],s.boundaryContext=null),u}getPotentialTargets(t,e){if(t.dropPosition==="on")return[t];let i=t,n=this.state.collection,s=n.getItem(i.key);for(;s&&(s==null?void 0:s.type)!=="item"&&s.nextKey!=null;)i.key=s.nextKey,s=n.getItem(s.nextKey);let a=[i];if(s&&s.hasChildNodes&&this.state.expandedKeys.has(s.key)&&n.getChildren&&i.dropPosition==="after"){let o=null;for(let d of n.getChildren(s.key))if(d.type==="item"){o=d;break}if(o){let d={type:"item",key:o.key,dropPosition:"before"};return e(d)?[d]:[]}}if((s==null?void 0:s.nextKey)!=null)return[t];let r=s==null?void 0:s.parentKey,c=[];for(;r;){let o=n.getItem(r),d=o!=null&&o.nextKey?n.getItem(o.nextKey):null;if(!d||d.parentKey!==r){let u={type:"item",key:r,dropPosition:"after"};if(e(u)&&c.push(u),d)break}r=o==null?void 0:o.parentKey}if(c.length>0&&a.push(...c),a.length===1){let o=n.getKeyAfter(i.key),d=o?n.getItem(o):null;if(o!=null&&d&&s&&d.level!=null&&s.level!=null&&d.level>s.level){let u={type:"item",key:o,dropPosition:"before"};if(e(u))return[u]}}return a.filter(e)}selectTarget(t,e,i,n,s,a){var u;if(t.length<2)return t[0];let r=this.pointerTracking,c=(u=this.state.collection.getItem(e.key))==null?void 0:u.parentKey;if(!c)return t[0];(!r.boundaryContext||r.boundaryContext.parentKey!==c)&&(r.boundaryContext={parentKey:c,preferredTargetIndex:r.yDirection==="up"?t.length-1:0,lastSwitchY:n,lastSwitchX:i});let o=r.boundaryContext,d=Math.abs(i-o.lastSwitchX);if(Math.abs(n-o.lastSwitchY)>Fs&&s){let m=o.preferredTargetIndex||0;s==="down"&&m===0?o.preferredTargetIndex=t.length-1:s==="up"&&m===t.length-1&&(o.preferredTargetIndex=0),r.xDirection=null}if(d>Bs&&a){let m=o.preferredTargetIndex||0;a==="left"?this.direction==="ltr"?m<t.length-1&&(o.preferredTargetIndex=m+1,o.lastSwitchX=i):m>0&&(o.preferredTargetIndex=m-1,o.lastSwitchX=i):a==="right"&&(this.direction==="ltr"?m>0&&(o.preferredTargetIndex=m-1,o.lastSwitchX=i):m<t.length-1&&(o.preferredTargetIndex=m+1,o.lastSwitchX=i)),r.yDirection=null}return t[Math.max(0,Math.min(o.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}}},ld=class Li extends js{withExpandedKeys(e,i){let n=this.clone();return n.expandedKeys=i,Li.cloneAncestorSections(i,e,n),Li.cloneAncestorSections(e,i,n),n.frozen=this.frozen,n}static cloneAncestorSections(e,i,n){for(let s of e)if(!i.has(s)){let a=s;for(;a!=null;){let r=n.getItem(a);if((r==null?void 0:r.type)==="section"){n.keyMap.set(a,r.clone());break}else a=(r==null?void 0:r.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 n=this.getKeyAfter(i.key);i=n?this.getItem(n):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 n=i.getItem(e),s=(n==null?void 0:n.firstChildKey)==null?null:i.getItem(n.firstChildKey);if(n&&n.type==="section"&&s)for(;s&&s.key!==n.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}},nd=(0,g.createContext)(null),Ai=(0,g.createContext)(null),sd=(0,g.forwardRef)(function(t,e){return[t,e]=lo(t,e,nd),g.createElement(Ss,{content:g.createElement(Ks,t),createCollection:()=>new ld},i=>g.createElement(ad,{props:t,collection:i,treeRef:e}))}),Rs={expand:{ltr:"ArrowRight",rtl:"ArrowLeft"},collapse:{ltr:"ArrowLeft",rtl:"ArrowRight"}};function ad({props:t,collection:e,treeRef:i}){let{dragAndDropHooks:n}=t,{direction:s}=Ot(),a=Kl({usage:"search",sensitivity:"base"}),r=!!(n!=null&&n.useDraggableCollectionState),c=!!(n!=null&&n.useDroppableCollectionState),o=(0,g.useRef)(r),d=(0,g.useRef)(c);(0,g.useEffect)(()=>{o.current!==r&&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.")},[r,c]);let{selectionMode:u="none",expandedKeys:m,defaultExpandedKeys:h,onExpandedChange:x,disabledBehavior:y="all"}=t,{CollectionRoot:j,isVirtualized:v,layoutDelegate:_,dropTargetDelegate:C}=(0,g.useContext)(Ut),[w,p]=di(m?new Set(m):void 0,h?new Set(h):new Set,x),[f,N]=(0,g.useState)(e),[K,T]=(0,g.useState)(w),[I,E]=(0,g.useState)(()=>e.withExpandedKeys(K,w));(!ud(K,w)||e!==f)&&(E(e.withExpandedKeys(K,w)),N(e),T(w));let M=Jc({...t,selectionMode:u,expandedKeys:w,onExpandedChange:p,collection:I,children:void 0,disabledBehavior:y}),{gridProps:k}=Tc({...t,isVirtualized:v,layoutDelegate:_},M,i),D,b,A,z=!1,B=null,q=(0,g.useRef)(null);if(r&&n){D=n.useDraggableCollectionState({collection:M.collection,selectionManager:M.selectionManager,preview:n.renderDragPreview?q:void 0}),n.useDraggableCollection({},D,i);let P=n.DragPreview;B=n.renderDragPreview?g.createElement(P,{ref:q},n.renderDragPreview):null}let[Y]=(0,g.useState)(()=>new id);if(c&&n){b=n.useDroppableCollectionState({collection:M.collection,selectionManager:M.selectionManager});let P=n.dropTargetDelegate||C||new n.ListDropTargetDelegate(M.collection,i,{direction:s});Y.setup(P,M,s);let X=new ji({collection:M.collection,collator:a,ref:i,disabledKeys:M.selectionManager.disabledKeys,disabledBehavior:M.selectionManager.disabledBehavior,direction:s,layoutDelegate:_});A=n.useDroppableCollection({keyboardDelegate:X,dropTargetDelegate:Y,onDropActivate:Q=>{var J;if(Q.target.type==="item"){let ie=Q.target.key,le=M.collection.getItem(ie),fe=w.has(ie);le&&le.hasChildNodes&&(!fe||n!=null&&((J=n.isVirtualDragging)!=null&&J.call(n)))&&M.toggleKey(ie)}},onKeyDown:Q=>{let J=b==null?void 0:b.target;if(J&&J.type==="item"&&J.dropPosition==="on"){let ie=M.collection.getItem(J.key);(Q.key===Rs.expand[s]&&(ie!=null&&ie.hasChildNodes)&&!M.expandedKeys.has(J.key)||Q.key===Rs.collapse[s]&&(ie!=null&&ie.hasChildNodes)&&M.expandedKeys.has(J.key))&&M.toggleKey(J.key)}}},b,i);let Z=b.getDropOperation;b.getDropOperation=Q=>{var fe;let{target:J,isInternal:ie}=Q,le=(D==null?void 0:D.draggingKeys)??new Set;if(ie&&J.type==="item"&&le.size>0){if(le.has(J.key)&&J.dropPosition==="on")return"cancel";let pe=J.key;for(;pe!=null;){let ue=(fe=M.collection.getItem(pe))==null?void 0:fe.parentKey;if(ue!=null&&le.has(ue))return"cancel";pe=ue??null}}return Z(Q)},z=b.isDropTarget({type:"root"})}let S=!!(r&&!(D!=null&&D.isDisabled)),{focusProps:W,isFocused:te,isFocusVisible:ce}=ci(),de={isEmpty:M.collection.size===0,isFocused:te,isFocusVisible:ce,isDropTarget:z,selectionMode:M.selectionManager.selectionMode,allowsDragging:!!S,state:M},he=vt({...t,children:void 0,defaultClassName:"react-aria-Tree",values:de}),me=null;if(M.collection.size===0&&t.renderEmptyState){let{isEmpty:P,...X}=de,Z=t.renderEmptyState({...X});me=g.createElement("div",{role:"row",style:{display:"contents"},"aria-level":1},g.createElement("div",{role:"gridcell",style:{display:"contents"}},Z))}let ge=Rt(t,{global:!0});return g.createElement(g.Fragment,null,g.createElement(Io,null,g.createElement(Bt.div,{...$e(ge,he,k,W,A==null?void 0:A.collectionProps),ref:i,slot:t.slot||void 0,"data-empty":M.collection.size===0||void 0,"data-focused":te||void 0,"data-drop-target":z||void 0,"data-focus-visible":ce||void 0,"data-selection-mode":M.selectionManager.selectionMode==="none"?void 0:M.selectionManager.selectionMode,"data-allows-dragging":!!S||void 0},g.createElement(xl,{values:[[Ai,M],[Ct,{dragAndDropHooks:n,dragState:D,dropState:b}],[Di,{render:rd}]]},c&&g.createElement(dd,null),g.createElement(Fo,null,g.createElement(j,{collection:M.collection,persistedKeys:zs(M.selectionManager,n,b),scrollRef:i,renderDropIndicator:Ts(n,b)}))),me)),B)}var $s=class extends rt{};$s.type="content";var Vs=Mi($s,function(t){let e=(0,g.useContext)(Os),i=vt({children:t.children,values:e});return g.createElement(Ut.Provider,{value:Ms},i.children)}),Os=(0,g.createContext)(null),Ls=class extends rt{};Ls.type="item";var Gs=qc(Ls,(t,e,i)=>{let n=(0,g.useContext)(Ai);e=ui(e);let{dragAndDropHooks:s,dragState:a,dropState:r}=(0,g.useContext)(Ct),{rowProps:c,gridCellProps:o,expandButtonProps:d,descriptionProps:u,...m}=ys({node:i,shouldSelectOnPressUp:!!a},n,e),h=c["aria-expanded"]===!0,x=t.hasChildItems||[...n.collection.getChildren(i.key)].length>1,y=c["aria-level"]||1,{hoverProps:j,isHovered:v}=so({isDisabled:!m.allowsSelection&&!m.hasAction,onHoverStart:t.onHoverStart,onHoverChange:t.onHoverChange,onHoverEnd:t.onHoverEnd}),{isFocusVisible:_,focusProps:C}=ci(),{isFocusVisible:w,focusProps:p}=ci({within:!0}),{checkboxProps:f}=Ec({key:i.key},n),N=null;a&&s&&(N=s.useDraggableItem({key:i.key,hasDragButton:!0},a));let K=null,T=(0,g.useRef)(null),I=(0,g.useRef)(null),E=(0,g.useRef)(null),{visuallyHiddenProps:M}=fi();r&&s&&(K=s.useDropIndicator({target:{type:"item",key:i.key,dropPosition:"on"},activateButtonRef:E},r,I));let k=a&&a.isDragging(i.key),D=K==null?void 0:K.isDropTarget,b=n.selectionManager.selectionMode,A=n.selectionManager.selectionBehavior,z=g.useMemo(()=>({...m,isHovered:v,isFocusVisible:_,isExpanded:h,hasChildItems:x,level:y,selectionMode:b,selectionBehavior:A,isFocusVisibleWithin:w,state:n,id:i.key,allowsDragging:!!a,isDragging:k,isDropTarget:D}),[m,v,_,h,x,y,w,n,i.key,a,k,D,A,b]),B=vt({...t,id:void 0,children:i.rendered,defaultClassName:"react-aria-TreeItem",defaultStyle:{"--tree-item-level":y},values:z});(0,g.useEffect)(()=>{i.textValue},[i.textValue]),(0,g.useEffect)(()=>{x&&T.current},[]);let q=(0,g.useRef)(null);(0,g.useEffect)(()=>{a&&q.current},[]);let Y=Ii({items:n.collection.getChildren(i.key),children:te=>{switch(te.type){case"content":return te.render(te);case"loader":case"item":return g.createElement(g.Fragment,null);default:throw Error("Unsupported element type in TreeRow: "+te.type)}}}),S=jt(),W=Rt(t,{global:!0});return delete W.id,delete W.onClick,g.createElement(g.Fragment,null,K&&!K.isHidden&&g.createElement("div",{role:"row","aria-level":c["aria-level"],"aria-expanded":c["aria-expanded"],"aria-label":K.dropIndicatorProps["aria-label"]},g.createElement("div",{role:"gridcell","aria-colindex":1,style:{display:"contents"}},g.createElement("div",{role:"button",...M,...K.dropIndicatorProps,ref:I}),c["aria-expanded"]==null?null:g.createElement("div",{role:"button",...M,id:S,"aria-label":d["aria-label"],"aria-labelledby":`${S} ${c.id}`,tabIndex:-1,ref:E}))),g.createElement(Bt.div,{...$e(W,c,C,j,p,N==null?void 0:N.dragProps),...B,ref:e,"data-expanded":x&&h||void 0,"data-has-child-items":x||void 0,"data-level":y,"data-selected":m.isSelected||void 0,"data-disabled":m.isDisabled||void 0,"data-hovered":v||void 0,"data-focused":m.isFocused||void 0,"data-focus-visible":_||void 0,"data-pressed":m.isPressed||void 0,"data-selection-mode":n.selectionManager.selectionMode==="none"?void 0:n.selectionManager.selectionMode,"data-allows-dragging":!!a||void 0,"data-dragging":k||void 0,"data-drop-target":D||void 0},g.createElement("div",{...o,style:{display:"contents"}},g.createElement(xl,{values:[[Ko,{slots:{selection:f}}],[oo,{slots:{[no]:{},chevron:{...d,ref:T},drag:{...N==null?void 0:N.dragButtonProps,ref:q,style:{pointerEvents:"none"}}}}],[Os,{...z}],[Ro,{isSelected:m.isSelected}]]},Y))))});Mi(_i,function(t,e,i){let{isVirtualized:n}=(0,g.useContext)(Ut),s=(0,g.useContext)(Ai),{isLoading:a,onLoadMore:r,scrollOffset:c,...o}=t,d=(0,g.useRef)(null);Rl((0,g.useMemo)(()=>({onLoadMore:r,collection:s==null?void 0:s.collection,sentinelRef:d,scrollOffset:c}),[r,c,s==null?void 0:s.collection]),d),e=ui(e);let{rowProps:u,gridCellProps:m}=ys({node:i},s,e),h=u["aria-level"]||1,x={role:"row","aria-level":u["aria-level"]},y=vt({...o,id:void 0,children:i.rendered,defaultClassName:"react-aria-TreeLoader",values:{level:h}}),j={};return n&&(j={display:"contents"}),g.createElement(g.Fragment,null,g.createElement("div",{style:{position:"relative",width:0,height:0},inert:$l(!0)},g.createElement("div",{"data-testid":"loadMoreSentinel",ref:d,style:{position:"absolute",height:1,width:1}})),a&&y.children&&g.createElement(Bt.div,{ref:e,...$e(Rt(t),x),...y,"data-level":h},g.createElement("div",{...m,style:j},y.children)))});function rd(t,e){var d;e=ui(e);let{dragAndDropHooks:i,dropState:n}=(0,g.useContext)(Ct),s=(0,g.useRef)(null),{dropIndicatorProps:a,isHidden:r,isDropTarget:c}=i.useDropIndicator(t,n,s);if(r)return null;let o=n&&t.target.type==="item"?(((d=n.collection.getItem(t.target.key))==null?void 0:d.level)||0)+1:1;return g.createElement(cd,{...t,dropIndicatorProps:a,isDropTarget:c,ref:e,buttonRef:s,level:o})}function od(t,e){let{dropIndicatorProps:i,isDropTarget:n,buttonRef:s,level:a,...r}=t,{visuallyHiddenProps:c}=fi(),o=vt({...r,defaultClassName:"react-aria-DropIndicator",defaultStyle:{position:"relative","--tree-item-level":a},values:{isDropTarget:n}});return g.createElement(Bt.div,{...o,role:"row","aria-level":a,ref:e,"data-drop-target":n||void 0},g.createElement("div",{role:"gridcell"},g.createElement("div",{...c,role:"button",...i,ref:s}),o.children))}var cd=(0,g.forwardRef)(od);function dd(){let{dragAndDropHooks:t,dropState:e}=(0,g.useContext)(Ct),i=(0,g.useRef)(null),{dropIndicatorProps:n}=t.useDropIndicator({target:{type:"root"}},e,i),s=e.isDropTarget({type:"root"}),{visuallyHiddenProps:a}=fi();return!s&&n["aria-hidden"]?null:g.createElement("div",{role:"row","aria-hidden":n["aria-hidden"],style:{position:"absolute"}},g.createElement("div",{role:"gridcell"},g.createElement("div",{role:"button",...a,...n,ref:i})))}function ud(t,e){if(t.size!==e.size)return!1;for(let i of t)if(!e.has(i))return!1;return!0}var md=Se(),pd=t=>{switch(t){case"chat":return"chat_model";case"autocomplete":return"autocomplete_model";case"edit":return"edit_model"}};const Hs=()=>{let t=(0,md.c)(12),[e,i]=lt(rr),{saveUserConfig:n}=xt(),s;t[0]!==n||t[1]!==i?(s=async m=>{await n({config:m}).then(()=>{i(h=>({...h,...m}))})},t[0]=n,t[1]=i,t[2]=s):s=t[2];let a=s,r;t[3]!==a||t[4]!==e?(r=async(m,h)=>{var y,j,v,_,C;let x=pd(h);x&&a({ai:{...e.ai,models:{custom_models:((j=(y=e.ai)==null?void 0:y.models)==null?void 0:j.custom_models)??[],displayed_models:((_=(v=e.ai)==null?void 0:v.models)==null?void 0:_.displayed_models)??[],...(C=e.ai)==null?void 0:C.models,[x]:m}}})},t[3]=a,t[4]=e,t[5]=r):r=t[5];let c=r,o;t[6]!==a||t[7]!==e?(o=async m=>{a({ai:{...e.ai,mode:m}})},t[6]=a,t[7]=e,t[8]=o):o=t[8];let d=o,u;return t[9]!==d||t[10]!==c?(u={saveModelChange:c,saveModeChange:d},t[9]=d,t[10]=c,t[11]=u):u=t[11],u},qt=["openai","anthropic","google","ollama","bedrock","deepseek","azure","github","openrouter","wandb","opencode-go","marimo"];var Me=class Gi{constructor(e,i){this.providerId=e,this.shortModelId=i}get id(){return`${this.providerId}/${this.shortModelId}`}static parse(e){if(!e.includes("/"))return new Gi(hd(e),e);let[i,...n]=e.split("/");return new Gi(i,n.join("/"))}};function hd(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 Pi(t){return qt.includes(t)}const gd=JSON.parse(`{"anthropic":[{"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.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.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","model":"gemini-3.1-flash-image-preview","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-02-26","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}}],"bedrock":[{"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":"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 Sonnet 4.6","model":"claude-sonnet-4-6","description":"","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}}],"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":"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.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.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 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 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"},{"name":"MiniMax M2.5","model":"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"},{"name":"GLM 5","model":"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-02-11"}],"wandb":[{"name":"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-03-27","cost":{"input":1.4,"output":4.4}},{"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":["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":["tool_calling"],"input_types":["text"],"output_types":["text"],"release_date":"2026-02-12","cost":{"input":0.3,"output":1.2}},{"name":"GLM 5","model":"zai-org/GLM-5-FP8","description":"Z.ai's flagship open-source foundation model engineered for complex systems design and long-horizon agent workflows","roles":["chat","edit"],"capabilities":["tool_calling"],"input_types":["text"],"output_types":["text"],"release_date":"2026-02-11","cost":{"input":1,"output":3.2}},{"name":"Kimi K2.5","model":"moonshotai/Kimi-K2.5","description":"Moonshot AI's native multimodal model, delivering state-of-the-art visual coding capability and a self-directed agent swarm paradigm","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image"],"output_types":["text"],"release_date":"2026-01-27","cost":{"input":0.5,"output":2.85}},{"name":"DeepSeek V3.1","model":"deepseek-ai/DeepSeek-V3.1","description":"Large hybrid reasoning model (671B parameters, 37B active) that supports both thinking and non-thinking modes via prompt templates","roles":["chat","edit"],"capabilities":["tool_calling"],"input_types":["text"],"output_types":["text"],"release_date":"2025-08-21","cost":{"input":0.55,"output":1.65}},{"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":["tool_calling"],"input_types":["text"],"output_types":["text"],"release_date":"2025-08-05","cost":{"input":0.15,"output":0.6}},{"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":["tool_calling"],"input_types":["text"],"output_types":["text"],"release_date":"2025-08-05","cost":{"input":0.05,"output":0.2}},{"name":"Qwen3 30B A3B Instruct 2507","model":"Qwen/Qwen3-30B-A3B-Instruct-2507","description":"30.5B-parameter mixture-of-experts language model from Qwen, with 3.3B active parameters per inference","roles":["chat","edit"],"capabilities":["tool_calling"],"input_types":["text"],"output_types":["text"],"release_date":"2025-07-29","cost":{"input":0.1,"output":0.3}},{"name":"Qwen3-235B-A22B-Thinking-2507","model":"Qwen/Qwen3-235B-A22B-Thinking-2507","description":"High-performance, open-weight Mixture-of-Experts (MoE) language model optimized for complex reasoning tasks","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text"],"output_types":["text"],"release_date":"2025-07-25","cost":{"input":0.1,"output":0.1}}],"opencode-go":[{"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":"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}},{"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.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.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":"MiMo V2 Omni","model":"mimo-v2-omni","description":"Frontier omni-modal model that natively processes image, video, and audio inputs within a unified architecture","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text","image","pdf"],"output_types":["text"],"release_date":"2026-03-18","cost":{"input":0.4,"output":2}},{"name":"MiMo V2 Pro","model":"mimo-v2-pro","description":"Xiaomi's flagship foundation model, featuring over 1T total parameters and a 1M context length, deeply optimized for agentic scenarios","roles":["chat","edit"],"capabilities":["thinking","tool_calling"],"input_types":["text"],"output_types":["text"],"release_date":"2026-03-18","cost":{"input":1,"output":3}},{"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}}]}`),fd=[{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 xd=gd,yd=fd;const Us=Ze(()=>{let t=new Map,e=new Map;for(let[i,n]of Object.entries(xd)){if(!n)continue;let s=i;for(let a of n){let r=a.model,c={...a,model:r,provider:s,custom:!1},o=`${s}/${r}`;t.set(o,c),(c.roles.includes("chat")||c.roles.includes("edit"))&&!e.has(s)&&e.set(s,o)}}return{modelMap:t,defaultModelByProvider:e}});var qs=Ze(()=>{let t=new Map,e=new Map;return yd.forEach((i,n)=>{t.set(i.id,i),e.set(i.id,n)}),{providerMap:t,providerToOrderIdx:e}}),St=class ti{constructor(e,i){Ne(this,"modelsByProviderMap",new ll);this.customModels=new Set(e),this.displayedModels=new Set(i),this.modelsMap=new Map,this.buildMaps()}static getProviderInfo(e){let{providerMap:i}=qs();return i.get(e)}static create(e){let{customModels:i=[],displayedModels:n=[]}=e;return new ti(i.map(s=>Me.parse(s).id),n.map(s=>Me.parse(s).id))}buildMaps(){let e=ti.buildMapsFromConfig({displayedModels:this.displayedModels,customModels:this.customModels});e.modelsMap.size===0&&(U.error("The configured displayed_models have filtered out all registered models. Reverting back to showing all models.",[...this.displayedModels]),e=ti.buildMapsFromConfig({displayedModels:new Set,customModels:this.customModels})),this.modelsByProviderMap=e.modelsByProviderMap,this.modelsMap=e.modelsMap}static buildMapsFromConfig(e){let{displayedModels:i,customModels:n}=e,s=i.size>0,a=Us().modelMap,r=new Map,c=new Map,o=new ll;for(let d of n){if(s&&!i.has(d))continue;let u=Me.parse(d),m={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};r.set(d,m)}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([...r,...c]);for(let[d,u]of c.entries()){let m=Me.parse(d);o.add(m.providerId,u)}return{modelsByProviderMap:o,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=qs().providerToOrderIdx;return e.sort((n,s)=>{let a=n[0],r=s[0];return(i.get(a)??0)-(i.get(r)??0)}),e}getModelsMap(){return this.modelsMap}getModel(e){return this.modelsMap.get(e)}};const Ws=Wi("marimo:accept-completion-on-enter",!0,Ui,{getOnInit:!0});function vd(t){"scheduler"in window?window.scheduler.postTask(t,{priority:"background"}):"requestIdleCallback"in window?requestIdleCallback(t):setTimeout(t,0)}var Wt=null,bd=class{constructor(t){Ne(this,"abortController",new AbortController);this.view=t.view,this.view.dom.addEventListener("focus",()=>{Wt=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(Fa())t.style.display="none";else{let e=(Wt==null?void 0:Wt.deref())===this.view;t.style.display=e?"":"none"}}destroy(){this.abortController.abort()}};const Ys={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 jd(t,e){let i=[];for(let n of t.split(`
|
|
2
|
+
`)){if(n.startsWith('"')||n.trim()==="")continue;let s=kd(n,e);s&&i.push(s)}return i}function kd(t,e){let i=t.split(/\s+/),n=i[0],s=0;if(n in Ys){let a=Ys[n],r={};for(let o of a.args||[])if(s+=1,s<i.length)r[o]=i[s];else{e&&e(`Not enough arguments for "${n}" command: "${t}"`);return}let c={name:n};return"args"in a&&(c.args=r),"mode"in a&&(c.mode=a.mode),c}e&&e(`Unknown vimrc command: "${t}"`)}function wd(){return Cd(),Sd(),[Le.of([{key:"j",run:t=>{if(La(t,!0)&&Yi(t)){let e=t.state.facet(At),i=t.state.facet(qi);return e.moveToNextCell({cellId:i,before:!1,noCreate:!0}),!0}return!1}}]),Le.of([{key:"k",run:t=>{if(Ya(t)&&Yi(t)){let e=t.state.facet(At),i=t.state.facet(qi);return e.moveToNextCell({cellId:i,before:!0,noCreate:!0}),!0}return!1}}]),Le.of([{linux:"Ctrl-[",win:"Ctrl-[",run:t=>{let e=gt(t);return e?Zs(e)?e.state.vim.insertMode?(ee.exitInsertMode(e,!0),!0):!1:(U.warn("Expected CodeMirror instance to have Vim state"),!1):(U.warn("Expected CodeMirror instance to have CodeMirror instance state"),!1)}}]),ul.define(t=>(requestAnimationFrame(()=>{Qs.INSTANCES.addInstance(t)}),{destroy(){Qs.INSTANCES.removeInstance(t)}})),ul.define(t=>new bd({view:t})),Tr.domEventHandlers({keydown(t,e){return t.ctrlKey&&t.key==="Escape"?(e.dom.dispatchEvent(new KeyboardEvent(t.type,t)),!0):!1}})]}function Ei(t,e){let i=t.cm6;if(!i)return;let n=i.coordsAtPos(i.state.selection.main.head);if(!n)return;let s=document.getElementById("App");if(!s)return;let a=s.clientHeight,r;switch(e){case"center":r=(n.top+n.bottom)/2-a/2;break;case"start":r=n.top;break;case"end":r=n.bottom-a;break}s.scrollBy({top:r,behavior:"smooth"})}var Cd=Ze(()=>{ee.defineAction("goToDefinition",t=>{let e=t.cm6;return Ha(e)}),ee.mapCommand("gd","action","goToDefinition",{},{context:"normal"}),ee.defineAction("scrollCursorToCenter",t=>Ei(t,"center")),ee.mapCommand("zz","action","scrollCursorToCenter",{},{context:"normal"}),ee.defineAction("scrollCursorToTop",t=>Ei(t,"start")),ee.mapCommand("zt","action","scrollCursorToTop",{},{context:"normal"}),ee.defineAction("scrollCursorToBottom",t=>Ei(t,"end")),ee.mapCommand("zb","action","scrollCursorToBottom",{},{context:"normal"}),ee.defineEx("write","w",t=>{let e=t.cm6;e&&e.state.facet(At).saveNotebook()})}),Sd=Ze(async()=>{var e;let t=(e=it.get(ni).keymap)==null?void 0:e.vimrc;if(t)try{U.log(`Loading vimrc from ${t}`);let i=(await Yr().sendFileDetails({path:t})).contents;if(!i){U.error(`Failed to load vimrc from ${t}`);return}_d(jd(i,U.warn))}catch(i){U.error("Failed to load vimrc:",i)}});function _d(t){function e(a){if(!a.args){U.warn(`Could not execute vimrc command "${a.name}: expected arguments"`);return}if(!a.args.lhs||!a.args.rhs){U.warn(`Could not execute vimrc command "${a.name}: expected arguments"`);return}a.mode?ee.map(a.args.lhs,a.args.rhs,a.mode):ee.map(a.args.lhs,a.args.rhs)}function i(a){if(!a.args){U.warn(`Could not execute vimrc command "${a.name}: expected arguments"`);return}if(!a.args.lhs||!a.args.rhs){U.warn(`Could not execute vimrc command "${a.name}: expected arguments"`);return}a.mode?ee.noremap(a.args.lhs,a.args.rhs,a.mode):ee.noremap(a.args.lhs,a.args.rhs)}function n(a){if(!a.args){U.warn(`Could not execute vimrc command "${a.name}: expected arguments"`);return}if(!a.args.lhs){U.warn(`Could not execute vimrc command "${a.name}: expected arguments"`);return}a.mode?ee.unmap(a.args.lhs,a.mode):ee.unmap(a.args.lhs)}function s(a){a.mode?ee.mapclear(a.mode):ee.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)?n(a):"mapclear|nmapclear|vmapclear|imapclear".split("|").includes(a.name)?s(a):U.warn(`Could not execute vimrc command "${a.name}: unknown command"`)}function Nd(t){return"getVimGlobalState_"in t&&typeof t.getVimGlobalState_=="function"}function Id(){var e;if(!Nd(ee))return!1;let t=(e=ee.getVimGlobalState_())==null?void 0:e.macroModeState;return t?!!(t.isRecording||t.isPlaying):!1}var Qs=(ot=class{constructor(){Ne(this,"instances",new Set);Ne(this,"isBroadcasting",!1)}addInstance(e){this.instances.add(e);let i=gt(e);if(!i){U.warn("Expected CodeMirror instance to have CodeMirror instance state");return}i.on("vim-mode-change",n=>{if(this.isBroadcasting)return;li("mode"in n,'Expected event to have a "mode" property');let s=Id();this.isBroadcasting=!0,vd(()=>{s||this.broadcastModeChange(e,n.mode,n.subMode),this.isBroadcasting=!1})})}removeInstance(e){this.instances.delete(e)}broadcastModeChange(e,i,n){li("exitInsertMode"in ee,"Vim does not have an exitInsertMode method"),li("exitVisualMode"in ee,"Vim does not have an exitVisualMode method");for(let s of this.instances)if(s!==e){let a=gt(s);if(!a){U.warn("Expected CodeMirror instance to have CodeMirror instance state");continue}let r=a.setSelections.bind(a);if(a.setSelections=()=>[],!Zs(a)){U.warn("Expected CodeMirror instance to have Vim state");continue}let c=a.state.vim;switch(i){case"normal":c.insertMode&&ee.exitInsertMode(a,!0),c.visualMode&&ee.exitVisualMode(a,!0);break;case"insert":c.insertMode||ee.handleKey(a,"i","mapping");break;case"visual":break}a.setSelections=r}}},Ne(ot,"INSTANCES",new ot),ot);function Zs(t){return t.state.vim!==void 0}const Kd=["default","vim"];function Md(t,e){switch(t.preset){case"default":return[Le.of(Xs()),Le.of(Js(e))];case"vim":return[Le.of(Ad()),Le.of(Js(e)),Le.of([{key:"Enter",run:i=>{var n,s;return(s=(n=gt(i))==null?void 0:n.state.vim)!=null&&s.insertMode?Br(i):!1}}]),dl.high(Pd("d",i=>i.state.doc.toString()==="",i=>i.state.doc.toString()===""?(i.state.facet(At).deleteCell(),!0):!1)),Le.of(Td()),Qa({status:!1}),dl.high(wd())];default:return qr(t.preset),[]}}var Dd=new Set([pl,ml]),Xs=Ze(()=>Hr.filter(t=>!Dd.has(t.run))),Js=t=>[{key:t.getHotkey("cell.toggleComment").key,run:pl},{key:t.getHotkey("cell.toggleBlockComment").key,run:ml}],Ad=Ze(()=>{let t=new Set(["Enter","Ctrl-v","ArrowUp","ArrowDown","ArrowLeft","ArrowRight"]);return Xs().filter(e=>!t.has(e.key||e.mac||e.linux||e.win||""))});function Pd(t,e,i){let n="",s=0;return Le.of([{any:(a,r)=>{let c=r.key,o=r.timeStamp;return c!==t||!e(a)?(n="",s=0,!1):n===t&&o-s<500&&i(a)?(n="",s=0,!0):(n=c,s=o,!1)}}])}function Ed(t){var e;return((e=t==null?void 0:t.state.vim)==null?void 0:e.visualMode)===!0}function Td(){let t=e=>i=>Ed(gt(i))?!1:e(i);return[{key:"ArrowDown",run:t($r),shift:t(Fr)},{key:"ArrowUp",run:t(Gr),shift:t(Rr)},{key:"ArrowLeft",run:t(Lr),shift:t(zr)},{key:"ArrowRight",run:t(Or),shift:t(Vr)}]}function ea(){return["compact","medium","full","columns"]}var zd={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 Bd(t){for(let i of qt)if(zd[i](t))return i;let e=t==null?void 0:t.custom_providers;if(e){let i=Object.entries(e).find(([n,s])=>s==null?void 0:s.base_url);if(i)return i[0]}}function Fd(t){let e=Bd(t);if(e)return Us().defaultModelByProvider.get(e)}function Rd(t){var a,r;let e={chatModel:void 0,editModel:void 0},i=!((a=t==null?void 0:t.models)!=null&&a.chat_model),n=!((r=t==null?void 0:t.models)!=null&&r.edit_model);if(!i&&!n)return e;let s=Fd(t);return s&&(i&&(e.chatModel=s),n&&(e.editModel=s)),e}var $d=Se();function ta(t){return t.toLowerCase().replaceAll("+","-").trim()}function Vd(t,e){let i=t.getHotkeyGroups(),n=e?new Set(i[e]||[]):new Set,s=new Map;for(let c of t.iterate()){if(n.has(c))continue;let o=t.getHotkey(c);if(!o.key||o.key.trim()==="")continue;let d=ta(o.key);s.has(d)||s.set(d,[]);let u=s.get(d);u&&u.push({action:c,name:o.name})}let a=[],r=new Set;for(let[c,o]of s.entries())if(o.length>1){a.push({key:c,actions:o});for(let{action:d}of o)r.add(d)}return{duplicates:a,hasDuplicate:c=>r.has(c),getDuplicatesFor:c=>{let o=t.getHotkey(c);if(!o.key||o.key.trim()==="")return[];let d=ta(o.key),u=a.find(m=>m.key===d);return!u||u.actions.length<=1?[]:u.actions.filter(m=>m.action!==c).map(m=>m.action)}}}function Od(t,e){let i=(0,$d.c)(3),n;return i[0]!==t||i[1]!==e?(n=Vd(t,e),i[0]=t,i[1]=e,i[2]=n):n=i[2],n}var Ld=Se(),l=Hi(xr(),1);const Gd=t=>{let e=(0,Ld.c)(7),{duplicates:i}=t;if(i.length===0)return null;let n,s;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=(0,l.jsx)(pi,{className:"h-4 w-4"}),s=(0,l.jsx)(Oo,{children:"Duplicate shortcuts"}),e[0]=n,e[1]=s):(n=e[0],s=e[1]);let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=(0,l.jsx)("p",{className:"mb-2",children:"Multiple actions are assigned to the same keyboard shortcut:"}),e[2]=a):a=e[2];let r;e[3]===i?r=e[4]:(r=i.map(Ud),e[3]=i,e[4]=r);let c;return e[5]===r?c=e[6]:(c=(0,l.jsxs)(Dl,{variant:"warning",className:"mb-4",children:[n,s,(0,l.jsxs)(Ml,{children:[a,(0,l.jsx)("ul",{className:"space-y-2",children:r})]})]}),e[5]=r,e[6]=c),c};function Hd(t){let{action:e,name:i}=t;return(0,l.jsx)("li",{children:i},e)}function Ud(t){let{key:e,actions:i}=t;return(0,l.jsxs)("li",{className:"text-xs",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,l.jsx)(yi,{shortcut:e}),(0,l.jsx)("span",{className:"font-semibold",children:"is used by:"})]}),(0,l.jsx)("ul",{className:"ml-6 list-disc",children:i.map(Hd)})]},e)}const Ti=nt(!1),qd=()=>{let[t,e]=lt(Ti),[i,n]=(0,g.useState)(null),[s,a]=(0,g.useState)([]),[r,c]=tl(),o=st(mr),{saveUserConfig:d}=xt(),{duplicates:u,hasDuplicate:m,getDuplicatesFor:h}=Od(o,"Markdown");$o("global.showHelp",()=>e(p=>!p));let x=async p=>{let f={...r};c(N=>({...N,...p})),await d({config:p}).catch(N=>{throw c(f),N})},y=async p=>{if(!i)return;let f=p.join("-"),N={keymap:{...r.keymap,overrides:{...r.keymap.overrides,[i]:f}}};n(null),a([]),await x(N)},j=async()=>{if(!i)return;let p={keymap:{...r.keymap,overrides:{...r.keymap.overrides}}};delete p.keymap.overrides[i],n(null),a([]),await x(p)},v=async()=>{if(!window.confirm("Are you sure you want to reset all shortcuts to their default values?"))return;let p={keymap:{...r.keymap,overrides:{}}};n(null),a([]),await x(p)};if(!t)return null;let _=p=>{let f=o.getHotkey(p);if(i===p){let T=nr(p);return(0,l.jsxs)("div",{children:[(0,l.jsx)(Fe,{defaultValue:s.join("+"),placeholder:f.name,onKeyDown:I=>{I.preventDefault();let E=[];if(I.key==="Meta"||I.key==="Control"||I.key==="Alt"||I.key==="Shift"||(I.metaKey&&E.push(Xi()?"Cmd":"Meta"),I.ctrlKey&&E.push("Ctrl"),I.altKey&&E.push("Alt"),I.shiftKey&&E.push("Shift"),I.key==="-"))return;if(I.key==="Escape"&&E.length===0){n(null),a([]);return}let M=I.key.length===1?I.key.toLowerCase():I.key;I.key===" "&&(M="Space"),E.push(M),y(E)},autoFocus:!0,endAdornment:(0,l.jsx)(ae,{variant:"text",size:"xs",className:"mb-0",onClick:()=>{n(null),a([])},children:(0,l.jsx)(oi,{className:"w-4 h-4"})})}),(0,l.jsxs)("div",{className:"flex items-center justify-between w-full",children:[(0,l.jsx)("span",{className:"text-muted-foreground text-xs",children:"Press a key combination"}),T.key!==f.key&&(0,l.jsxs)("span",{className:"text-xs cursor-pointer text-primary",onClick:j,children:["Reset to default:"," ",(0,l.jsx)("span",{className:"font-mono",children:T.key})]})]})]},p)}let N=m(p),K=N?h(p):[];return(0,l.jsxs)("div",{className:"grid grid-cols-[auto_2fr_3fr] gap-2 items-center",children:[o.isEditable(p)?(0,l.jsx)(bl,{className:"cursor-pointer opacity-60 hover:opacity-100 text-muted-foreground w-3 h-3",onClick:()=>{a([]),n(p)}}):(0,l.jsx)("div",{className:"w-3 h-3"}),(0,l.jsx)(yi,{className:"justify-end",shortcut:f.key}),(0,l.jsxs)("div",{className:"flex items-center gap-1",children:[(0,l.jsx)("span",{children:f.name.toLowerCase()}),N&&(0,l.jsxs)("div",{className:"group relative inline-flex",children:[(0,l.jsx)(pi,{className:"w-3 h-3 text-(--yellow-11)"}),(0,l.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:"," ",K.map(T=>o.getHotkey(T).name.toLowerCase()).join(", ")]})]})]})]},p)},C=o.getHotkeyGroups(),w=(p,f)=>{let N=C[p];return(0,l.jsxs)("div",{className:"mb-[40px] gap-2 flex flex-col",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("h3",{className:"text-lg font-medium",children:p}),f]}),N.map(_)]})};return(0,l.jsx)(Bo,{open:t,onOpenChange:p=>e(p),children:(0,l.jsxs)(zo,{className:"sm:items-center sm:top-0",children:[(0,l.jsx)(To,{}),(0,l.jsxs)(Eo,{usePortal:!1,className:"max-h-screen sm:max-h-[90vh] overflow-y-auto sm:max-w-[850px]",children:[(0,l.jsx)(Ao,{children:(0,l.jsx)(Po,{children:"Shortcuts"})}),(0,l.jsx)(Gd,{duplicates:u}),(0,l.jsxs)("div",{className:"flex flex-row gap-3",children:[(0,l.jsxs)("div",{className:"w-1/2",children:[w("Editing"),w("Markdown")]}),(0,l.jsxs)("div",{className:"w-1/2",children:[w("Navigation"),w("Running Cells"),w("Creation and Ordering"),(p=>w(p,(0,l.jsxs)("p",{className:"text-xs text-muted-foreground flex items-center gap-1",children:["Press"," ",r.keymap.preset==="vim"?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(yi,{shortcut:Xi()?"Cmd":"Ctrl"}),(0,l.jsx)(re,{children:"Esc"})]}):(0,l.jsx)(re,{children:"Esc"})," ","in a cell to enter command mode"]})))("Command"),w("Other"),(0,l.jsx)(ae,{className:"mt-4 hover:bg-destructive/10 border-destructive hover:border-destructive",variant:"outline",size:"xs",onClick:v,tabIndex:-1,children:(0,l.jsx)("span",{className:"text-destructive",children:"Reset all to default"})})]})]})]})]})})};var ia="marimo:copilot:signedIn";const la=Wi(ia,null,Ui,{getOnInit:!0}),na=nt(null),Yt=nt(null),zi=nt({busy:!1,kind:null,message:null});function Wd(t){it.set(Yt,t)}function Yd(t){it.get(Yt)===t&&it.set(Yt,null)}function Qd(){return er.getItem(ia)==="true"}function sa(){let t=Qd(),e=cr();return t&&e.completion.copilot==="github"}function Zd(){return za(ni,t=>t.completion.copilot==="github")}var Xd=Ur(),ke=U.get("@github/copilot-language-server"),Jd=class extends Ga{constructor(e){super(e);Ne(this,"documentVersion",0);Ne(this,"hasOpenedDocument",!1);Ne(this,"copilotSettings",{});Ne(this,"getCompletionInternal",async(e,i)=>await this._request("textDocument/inlineCompletion",{...e,textDocument:{...e.textDocument,version:i}}));Ne(this,"throttledGetCompletionInternal",ic(this.getCompletionInternal,200));Ne(this,"handleNotification",e=>{if(!e.params)return;let i=e;if(i.method==="statusNotification"&&it.set(zi,i.params),i.method==="didChangeStatus"&&it.set(zi,i.params),i.method==="window/logMessage"){let{type:n,message:s}=i.params;switch(n){case 1:ke.error("[GitHub Copilot]",s);break;case 2:ke.warn("[GitHub Copilot]",s);break;case 3:ke.debug("[GitHub Copilot]",s);break;default:ke.log("[GitHub Copilot]",s);break}}});this.copilotSettings=e.copilotSettings??{},this.onNotification(this.handleNotification),this.attachInitializeListener()}attachInitializeListener(){this.initializePromise.then(()=>{this.sendConfiguration()})}async reInitialize(){ke.log("#reInitialize: Re-initializing LSP connection"),this.initializePromise=this.initialize(),await this.initializePromise,await this.sendConfiguration()}async sendConfiguration(){let e=this.copilotSettings;!e||Object.keys(e).length===0||(await this.notify("workspace/didChangeConfiguration",{settings:e}),ke.debug("#sendConfiguration: Configuration sent",e))}async _request(e,i){return await this.request(e,i)}async notify(e,i){return ke.debug("#notify",e,i),super.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!sa()}async textDocumentDidOpen(e){return this.isDisabled()?e:(this.hasOpenedDocument=!0,super.textDocumentDidOpen(e))}async textDocumentCompletion(e){return[]}async textDocumentDidChange(e){if(this.isDisabled())return e;this.hasOpenedDocument||await this.textDocumentDidOpen({textDocument:{uri:e.textDocument.uri,languageId:"python",version:e.textDocument.version,text:e.contentChanges[0].text}});let i=e.contentChanges;i.length!==1&&ke.warn("#textDocumentDidChange: Multiple changes detected. This is not supported.",i);let n=i[0];"range"in n&&ke.warn("#textDocumentDidChange: Copilot doesn't support range changes.",n);let s=Va(n.text);return super.textDocumentDidChange({...e,contentChanges:[{text:s}],textDocument:Xd.VersionedTextDocumentIdentifier.create(e.textDocument.uri,++this.documentVersion)})}textDocumentHover(e){return Promise.resolve({contents:[]})}signOut(){return this._request("signOut",{})}async signInInitiate(){ke.log("#signInInitiate: Starting sign-in flow");try{let e=await this._request("signIn",{});return ke.log("#signInInitiate: Sign-in flow started successfully"),e}catch(e){throw ke.warn("#signInInitiate: Failed to start sign-in flow",e),e}}async signInConfirm(e){ke.log("#signInConfirm: Confirming sign-in");try{let i=await this._request("signInConfirm",e);return ke.log("#signInConfirm: Sign-in confirmed successfully"),i}catch(i){throw ke.warn("#signInConfirm: Failed to confirm sign-in",i),i}}async signedIn(){try{let{status:e}=await this._request("checkStatus",{});return ke.log("#checkStatus: Status check completed",{status:e}),e==="SignedIn"||e==="AlreadySignedIn"||e==="OK"}catch(e){throw ke.warn("#signedIn: Failed to check sign-in status",e),e}}async getCompletion(e){if(this.isDisabled())return null;let i=this.documentVersion;if(e.textDocument.version=i,i===0)return null;Wd(i);let n=await this.throttledGetCompletionInternal(e,i);return Yd(i),i===this.documentVersion?n??null:null}},eu=Wa(),tu=Za(),iu=class extends tu.Transport{constructor(e){super();Ne(this,"pendingSubscriptions",[]);Ne(this,"needsReInitialization",!1);this.delegate=void 0,this.pendingSubscriptions=[],this.options={retries:e.retries??3,retryDelayMs:e.retryDelayMs??1e3,maxTimeoutMs:e.maxTimeoutMs??5e3,getWsUrl:e.getWsUrl,waitForReady:e.waitForReady,showError:e.showError}}subscribe(...e){super.subscribe(...e);let[i,n]=e;this.pendingSubscriptions.push({event:i,handler:n}),this.delegate&&this.delegate.subscribe(i,n)}unsubscribe(...e){let i=super.unsubscribe(...e),[n,s]=e;if(this.delegate&&this.delegate.unsubscribe(n,s),s)if(n){let a=this.pendingSubscriptions.findIndex(r=>r.event===n&&r.handler===s);a>-1&&this.pendingSubscriptions.splice(a,1)}else this.pendingSubscriptions=this.pendingSubscriptions.filter(a=>a.handler!==s);else n?this.pendingSubscriptions=this.pendingSubscriptions.filter(a=>a.event!==n):this.pendingSubscriptions=[];return i}createDelegate(){let e=new eu.WebSocketTransport(this.options.getWsUrl());for(let{event:i,handler:n}of this.pendingSubscriptions)e.subscribe(i,n);return e}async tryConnect(){for(let e=1;e<=this.options.retries;e++)try{this.delegate||(this.delegate=this.createDelegate()),await this.delegate.connect(),U.log("Copilot#connect: Connected successfully");return}catch(i){if(U.warn(`Copilot#connect: Connection attempt ${e}/${this.options.retries} failed`,i),e===this.options.retries)throw this.delegate=void 0,this.needsReInitialization=!0,this.options.showError("GitHub Copilot Connection Error",`Failed to connect to GitHub Copilot. Please check your settings and try again.
|
|
3
3
|
|
|
4
|
-
${$o(i)}`),i;await new Promise(n=>setTimeout(n,this.options.retryDelayMs))}}async connect(){return await this.options.waitForReady(),this.tryConnect()}close(){var e;(e=this.delegate)==null||e.close(),this.delegate=void 0,this.needsReInitialization=!0}async sendData(e,i){if(!this.delegate){U.log("Copilot#sendData: Delegate not initialized, reconnecting...");try{await this.options.waitForReady(),await this.tryConnect()}catch(n){throw U.error("Copilot#sendData: Failed to reconnect transport",n),Error("Unable to connect to GitHub Copilot. Please check your settings and try again.",{cause:n})}if(this.needsReInitialization&&this.onReconnect){U.log("Copilot#sendData: Re-initializing LSP after reconnection...");try{await this.onReconnect(),this.needsReInitialization=!1}catch(n){throw this.close(),U.error("Copilot#sendData: LSP re-initialization after reconnection failed",n),n}}}if(!this.delegate)throw Error("Failed to initialize GitHub Copilot connection. Please try again.");return i??(i=this.options.maxTimeoutMs),this.delegate.sendData(e,i)}};const sa="/__marimo_copilot__.py";var aa=`file://${sa}`;const iu=Ze(()=>{let t=pr();return new tu({getWsUrl:()=>t.getLSPURL("copilot").toString(),waitForReady:async()=>{await Qd(),await mr()},showError:(e,i)=>{Re({variant:"danger",title:e,description:i})}})}),_t=Ze(()=>{var n,s;let t=((s=(n=it.get(ni).ai)==null?void 0:n.github)==null?void 0:s.copilot_settings)??{},e=iu(),i=new Xd({rootUri:aa,workspaceFolders:null,transport:e,copilotSettings:t});return e.onReconnect=()=>i.reInitialize(),i});function lu(){return Va({documentUri:aa,client:_t(),languageId:"copilot",hoverEnabled:!1,completionEnabled:!1,definitionEnabled:!1,renameEnabled:!1,codeActionsEnabled:!1,signatureHelpEnabled:!1,diagnosticsEnabled:!1,sendIncrementalChanges:!1})}const ra=(0,g.memo)(()=>{let[t,e]=lt(ia),[i,n]=lt(la),[s,a]=(0,g.useState)(),[r,c]=(0,g.useState)(!1),o=async m=>{m.preventDefault(),c(!0);try{let h=await su();if(!(h!=null&&h.verificationUri)||!h.userCode){U.error("Copilot#trySignIn: Invalid response from sign-in",{result:h}),n("connectionError"),Re({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:y,userCode:j}=h;da(y)?e(!0):(n("signingIn"),a({url:x,code:j}))}catch(h){U.error("Copilot#trySignIn: Error during sign-in",h),n("connectionError"),Re({title:"GitHub Copilot Connection Error",description:h instanceof Error?h.message:"Unable to connect to GitHub Copilot. Please check your settings and try again.",variant:"danger"})}finally{c(!1)}},d=async m=>{if(m.preventDefault(),s){c(!0);try{let h=await au(s.code);h.success?(e(!0),n("signedIn")):h.error==="connection"?(n("connectionError"),Re({title:"GitHub Copilot Connection Error",description:"Lost connection during sign-in. Please try again.",variant:"danger",action:(0,l.jsx)(se,{onClick:o,children:"Retry"})})):n("signInFailed")}finally{c(!1)}}},u=async m=>{m.preventDefault(),await ou(),e(!1),n("signedOut")};return(()=>{switch(i??(t?"signedIn":"connecting")){case"connecting":return(0,l.jsx)(Oe,{className:"font-normal flex",children:"Connecting..."});case"signedOut":return(0,l.jsx)(se,{onClick:o,size:"xs",variant:"link",children:"Sign in to GitHub Copilot"});case"signingIn":return(0,l.jsxs)("ol",{className:"ml-4 text-sm list-decimal [&>li]:mt-2",children:[(0,l.jsx)("li",{children:(0,l.jsxs)("div",{className:"flex items-center",children:["Copy this code:",(0,l.jsx)("strong",{className:"ml-2",children:s==null?void 0:s.code}),(0,l.jsx)(Jr,{className:"ml-2 cursor-pointer opacity-60 hover:opacity-100 h-3 w-3",onClick:async()=>{s&&(await yo(s.code),Re({description:"Copied to clipboard"}))}})]})}),(0,l.jsxs)("li",{children:["Enter the code at this link:",(0,l.jsx)("a",{href:s==null?void 0:s.url,target:"_blank",rel:"noreferrer",className:Pr({variant:"link",size:"xs"}),children:s==null?void 0:s.url})]}),(0,l.jsxs)("li",{children:["Click here when done:",(0,l.jsxs)(se,{size:"xs",onClick:d,className:"ml-1",children:[r&&(0,l.jsx)(Tt,{className:"h-3 w-3 mr-1 animate-spin"}),"Done"]})]})]});case"signInFailed":return(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,l.jsx)("div",{className:"text-destructive text-sm",children:"Sign in failed. Please try again."}),r?(0,l.jsx)(Tt,{className:"h-3 w-3 mr-1 animate-spin"}):(0,l.jsx)(se,{onClick:o,size:"xs",variant:"link",children:"Connect to GitHub Copilot"})]});case"signedIn":return(0,l.jsxs)("div",{className:"flex items-center gap-5",children:[(0,l.jsxs)(Oe,{className:"font-normal flex items-center",children:[(0,l.jsx)("div",{className:"inline-flex items-center justify-center bg-(--grass-7) rounded-full p-1 mr-2",children:(0,l.jsx)(Yr,{className:"h-3 w-3 text-white"})}),"Connected"]}),(0,l.jsx)(se,{onClick:u,size:"xs",variant:"text",children:"Disconnect"})]});case"connectionError":return(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,l.jsxs)(Oe,{className:"font-normal flex",children:[(0,l.jsx)(oi,{className:"h-4 w-4 mr-1"}),"Connection Error"]}),(0,l.jsx)("div",{className:"text-sm",children:"Unable to connect to GitHub Copilot."}),(0,l.jsx)(se,{onClick:o,size:"xs",variant:"link",children:"Retry Connection"})]});case"notConnected":return(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,l.jsxs)(Oe,{className:"font-normal flex",children:[(0,l.jsx)(oi,{className:"h-4 w-4 mr-1"}),"Unable to connect"]}),(0,l.jsxs)("div",{className:"text-sm",children:["For troubleshooting, see the"," ",(0,l.jsx)(re,{href:"https://docs.marimo.io/getting_started/index.html#github-copilot",children:"docs"}),"."]})]})}})()});ra.displayName="CopilotConfig";var oa=5,nu=3e3;async function su(){return await _t().signInInitiate()}async function au(t){let e=_t();try{U.log("Copilot#tryFinishSignIn: Attempting to confirm sign-in");let{status:i}=await e.signInConfirm({userCode:t});return da(i)?(U.log("Copilot#tryFinishSignIn: Sign-in confirmed successfully"),{success:!0}):(U.warn("Copilot#tryFinishSignIn: Sign-in confirmation returned unexpected status",{status:i}),{success:!1})}catch(i){return ca(i)?(U.error("Copilot#tryFinishSignIn: Connection error during sign-in",i),{success:!1,error:"connection"}):await ru(e)}}async function ru(t){for(let e=0;e<oa;e++)try{if(await new Promise(i=>setTimeout(i,nu)),await t.signedIn())return U.log("Copilot#tryFinishSignIn: Successfully signed in after retry"),{success:!0}}catch(i){if(U.warn("Copilot#tryFinishSignIn: Retry attempt failed",{attempt:e+1,maxRetries:oa}),ca(i))return{success:!1,error:"connection"}}return U.error("Copilot#tryFinishSignIn: All sign-in attempts failed"),{success:!1}}async function ou(){await _t().signOut()}function ca(t){return t instanceof Error&&(t.message.includes("ECONNREFUSED")||t.message.includes("WebSocket")||t.message.includes("network"))}function da(t){return t==="SignedIn"||t==="AlreadySignedIn"||t==="OK"}var ua="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",cu="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",du="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",uu="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",ma="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",mu="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",pa="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",ha="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",pu="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",hu="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eWeights%20&%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",gu="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=",fu=Se(),ga={openai:pa,anthropic:ua,claude:ua,gemini:ma,google:ma,codex:pa,ollama:mu,azure:qo,bedrock:Uo,deepseek:du,github:uu,openrouter:pu,wandb:hu,"opencode-go":ha,marimo:gu,opencode:ha,cursor:cu};const Te=t=>{let e=(0,fu.c)(15),i,n,s;e[0]===t?(i=e[1],n=e[2],s=e[3]):({provider:n,className:s,...i}=t,e[0]=t,e[1]=i,e[2]=n,e[3]=s);let a=s===void 0?"":s;if(n==="openai-compatible"||!(n in ga)){let d;e[4]===a?d=e[5]:(d=Ee("h-4 w-4",a),e[4]=a,e[5]=d);let u;return e[6]===d?u=e[7]:(u=(0,l.jsx)(ii,{className:d}),e[6]=d,e[7]=u),u}let r=ga[n],c;e[8]===a?c=e[9]:(c=Ee("h-4 w-4 grayscale dark:invert",a),e[8]=a,e[9]=c);let o;return e[10]!==r||e[11]!==i||e[12]!==n||e[13]!==c?(o=(0,l.jsx)("img",{src:r,alt:n,className:c,...i}),e[10]=r,e[11]=i,e[12]=n,e[13]=c,e[14]=o):o=e[14],o};function Qt(t){switch(t){case"chat":return"bg-[var(--purple-3)] text-[var(--purple-11)]";case"autocomplete":return"bg-[var(--green-3)] text-[var(--green-11)]";case"edit":return"bg-[var(--blue-3)] text-[var(--blue-11)]";case"thinking":return"bg-[var(--purple-4)] text-[var(--purple-12)]"}return"bg-[var(--mauve-3)] text-[var(--mauve-11)]"}function fa(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 Zt=Se();const O="flex flex-row items-center space-x-1 space-y-0",xu=t=>{let e=(0,Zt.c)(2),{children:i}=t,n;return e[0]===i?n=e[1]:(n=(0,l.jsx)("div",{className:"text-md font-semibold text-muted-foreground uppercase tracking-wide mb-1",children:i}),e[0]=i,e[1]=n),n},pt=t=>{let e=(0,Zt.c)(10),i,n,s;e[0]===t?(i=e[1],n=e[2],s=e[3]):({children:i,className:n,...s}=t,e[0]=t,e[1]=i,e[2]=n,e[3]=s);let a;e[4]===n?a=e[5]:(a=Ee("text-base font-semibold underline-offset-2 text-accent-foreground uppercase tracking-wide",n),e[4]=n,e[5]=a);let r;return e[6]!==i||e[7]!==s||e[8]!==a?(r=(0,l.jsx)("div",{...s,className:a,children:i}),e[6]=i,e[7]=s,e[8]=a,e[9]=r):r=e[9],r},yu=t=>{let e=(0,Zt.c)(2),{children:i}=t,n;return e[0]===i?n=e[1]:(n=(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:i}),e[0]=i,e[1]=n),n},ze=t=>{let e=(0,Zt.c)(5),{title:i,children:n}=t,s;e[0]===i?s=e[1]:(s=(0,l.jsx)(pt,{children:i}),e[0]=i,e[1]=s);let a;return e[2]!==n||e[3]!==s?(a=(0,l.jsxs)("div",{className:"flex flex-col gap-4 pb-4",children:[s,n]}),e[2]=n,e[3]=s,e[4]=a):a=e[4],a},xa=[{label:"Auto (Default)",value:"auto"},{label:"Native",value:"native"},{label:"Polars",value:"polars"},{label:"Lazy Polars",value:"lazy-polars"},{label:"Pandas",value:"pandas"}],vu="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 bu=Se();const ya=t=>{let e=(0,bu.c)(12),{value:i,includeSuggestion:n}=t,s=n===void 0?!0:n;if(!i||i.includes("/"))return null;let a;e[0]===i?a=e[1]:(a=Me.parse(i),e[0]=i,e[1]=a);let r=a.id,c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=(0,l.jsx)("code",{className:"font-bold",children:"provider/model"}),e[2]=c):c=e[2];let o;e[3]===i?o=e[4]:(o=(0,l.jsxs)("span",{children:["Model id should be in the form"," ",c,". ",i," is missing a provider."]}),e[3]=i,e[4]=o);let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=(0,l.jsx)("br",{}),e[5]=d):d=e[5];let u;e[6]!==s||e[7]!==r?(u=s&&r&&(0,l.jsxs)("span",{children:["Did you mean ",(0,l.jsx)("code",{className:"font-bold",children:r}),"?"]}),e[6]=s,e[7]=r,e[8]=u):u=e[8];let m;return e[9]!==o||e[10]!==u?(m=(0,l.jsxs)(kt,{kind:"danger",className:"mt-1",children:[o,d,u]}),e[9]=o,e[10]=u,e[11]=m):m=e[11],m};var zi=Se();function va(t,e){let i=(0,zi.c)(10),n;i[0]!==e||i[1]!==t?(n=Qi(t,e),i[0]=e,i[1]=t,i[2]=n):n=i[2];let s=n,a=st(cr),r;i[3]!==e||i[4]!==a?(r=Qi(a,e),i[3]=e,i[4]=a,i[5]=r):r=i[5];let c=r,o=c!=null&&s!==c,d;return i[6]!==s||i[7]!==o||i[8]!==c?(d={isOverridden:o,currentValue:s,overriddenValue:c},i[6]=s,i[7]=o,i[8]=c,i[9]=d):d=i[9],d}const ju=t=>{let e=(0,zi.c)(3),{name:i,children:n}=t,[s]=Ji(),{isOverridden:a}=va(s,i),r;return e[0]!==n||e[1]!==a?(r=a?(0,l.jsx)(qe,{delayDuration:200,content:(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,l.jsxs)("p",{children:["This setting is overridden by the"," ",(0,l.jsx)(ae,{className:"inline mx-px",children:"pyproject.toml"})," config."]}),(0,l.jsxs)("p",{children:["To change it, edit the project config"," ",(0,l.jsx)(ae,{className:"inline mx-px",children:"pyproject.toml"}),"directly."]})]}),children:(0,l.jsx)("div",{className:"text-muted-foreground opacity-80 cursor-not-allowed *:pointer-events-none",children:n})}):n,e[0]=n,e[1]=a,e[2]=r):r=e[2],r},L=t=>{let e=(0,zi.c)(18),{userConfig:i,name:n}=t,{isOverridden:s,currentValue:a,overriddenValue:r}=va(i,n);if(!s)return null;let c,o;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=(0,l.jsxs)("span",{children:["This setting is overridden by"," ",(0,l.jsx)(ae,{className:"inline",children:"pyproject.toml"}),"."]}),o=(0,l.jsx)("br",{}),e[0]=c,e[1]=o):(c=e[0],o=e[1]);let d,u;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=(0,l.jsxs)("span",{children:["Edit the ",(0,l.jsx)(ae,{className:"inline",children:"pyproject.toml"})," file directly to change this setting."]}),u=(0,l.jsx)("br",{}),e[2]=d,e[3]=u):(d=e[2],u=e[3]);let m=String(a),h;e[4]===m?h=e[5]:(h=(0,l.jsxs)("span",{children:["User value: ",(0,l.jsx)("strong",{children:m})]}),e[4]=m,e[5]=h);let x;e[6]===Symbol.for("react.memo_cache_sentinel")?(x=(0,l.jsx)("br",{}),e[6]=x):x=e[6];let y=String(r),j;e[7]===y?j=e[8]:(j=(0,l.jsxs)("span",{children:["Project value: ",(0,l.jsx)("strong",{children:y})]}),e[7]=y,e[8]=j);let v;e[9]!==h||e[10]!==j?(v=(0,l.jsxs)(l.Fragment,{children:[c,o,d,u,h,x,j]}),e[9]=h,e[10]=j,e[11]=v):v=e[11];let _;e[12]===Symbol.for("react.memo_cache_sentinel")?(_=(0,l.jsx)(Tl,{className:"w-3 h-3"}),e[12]=_):_=e[12];let C=String(r),w;e[13]===C?w=e[14]:(w=(0,l.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:[_,"Overridden by pyproject.toml [",C,"]"]}),e[13]=C,e[14]=w);let p;return e[15]!==v||e[16]!==w?(p=(0,l.jsx)(qe,{content:v,children:w}),e[15]=v,e[16]=w,e[17]=p):p=e[17],p};var ku=Se();function ba(){let t=(0,ku.c)(1),e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=[],t[0]=e):e=t[0],Dl(wu,e)}async function wu(){return si.get("/ai/mcp/status")}function Cu(){let[t,e]=(0,g.useState)(!1);return{refresh:async()=>{e(!0);try{await si.post("/ai/mcp/refresh",{}),Re({title:"MCP refreshed",description:"MCP server configuration has been refreshed successfully"})}catch(i){Re({title:"Refresh failed",description:i instanceof Error?i.message:"Failed to refresh MCP",variant:"danger"})}finally{e(!1)}},isRefreshing:t}}var ja=Se();const Su=()=>{let t=(0,ja.c)(27),{data:e,refetch:i,isFetching:n}=ba(),s;t[0]===i?s=t[1]:(s=async()=>{try{await si.post("/ai/mcp/refresh",{}),Re({title:"MCP refreshed",description:"MCP server configuration has been refreshed"}),i()}catch(p){let f=p;Re({title:"Refresh failed",description:f instanceof Error?f.message:"Failed to refresh MCP",variant:"danger"})}},t[0]=i,t[1]=s);let a=s,r;t[2]===(e==null?void 0:e.servers)?r=t[3]:(r=(e==null?void 0:e.servers)||{},t[2]=e==null?void 0:e.servers,t[3]=r);let c=r,o=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",m=(e==null?void 0:e.status)==="error"&&o&&"text-red-500",h;t[4]!==d||t[5]!==u||t[6]!==m?(h=Ee("h-4 w-4",d,u,m),t[4]=d,t[5]=u,t[6]=m,t[7]=h):h=t[7];let x;t[8]===h?x=t[9]:(x=(0,l.jsx)(qe,{content:"MCP Status",children:(0,l.jsx)(jr,{asChild:!0,children:(0,l.jsx)(se,{variant:"text",size:"icon",children:(0,l.jsx)(zl,{className:h})})})}),t[8]=h,t[9]=x);let y;t[10]===Symbol.for("react.memo_cache_sentinel")?(y=(0,l.jsx)("h4",{className:"font-medium text-sm",children:"MCP Server Status"}),t[10]=y):y=t[10];let j;t[11]===n?j=t[12]:(j=n?(0,l.jsx)(Tt,{className:"h-3 w-3 animate-spin"}):(0,l.jsx)(gl,{className:"h-3 w-3"}),t[11]=n,t[12]=j);let v;t[13]!==a||t[14]!==n||t[15]!==j?(v=(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[y,(0,l.jsx)(se,{variant:"ghost",size:"xs",onClick:a,disabled:n,children:j})]}),t[13]=a,t[14]=n,t[15]=j,t[16]=v):v=t[16];let _;t[17]!==o||t[18]!==c||t[19]!==e?(_=e&&(0,l.jsxs)("div",{className:"text-xs space-y-2",children:[o&&(0,l.jsxs)("div",{className:"flex justify-between items-center",children:[(0,l.jsx)("span",{className:"text-muted-foreground",children:"Overall:"}),(0,l.jsx)(Xt,{status:e.status})]}),e.error&&(0,l.jsx)("div",{className:"text-xs text-red-500 bg-red-50 dark:bg-red-950/20 p-2 rounded",children:e.error}),o&&(0,l.jsxs)("div",{className:"space-y-1",children:[(0,l.jsx)("div",{className:"text-muted-foreground font-medium",children:"Servers:"}),Object.entries(c).map(_u)]}),!o&&(0,l.jsxs)("div",{className:"text-muted-foreground text-center py-2",children:["No MCP servers configured. ",(0,l.jsx)("br",{})," Configure under"," ",(0,l.jsx)("b",{children:"Settings > AI > MCP"})]})]}),t[17]=o,t[18]=c,t[19]=e,t[20]=_):_=t[20];let C;t[21]!==_||t[22]!==v?(C=(0,l.jsx)(kr,{className:"w-[320px]",align:"start",side:"right",children:(0,l.jsxs)("div",{className:"space-y-3",children:[v,_]})}),t[21]=_,t[22]=v,t[23]=C):C=t[23];let w;return t[24]!==C||t[25]!==x?(w=(0,l.jsxs)(wr,{children:[x,C]}),t[24]=C,t[25]=x,t[26]=w):w=t[26],w},Xt=t=>{let e=(0,ja.c)(11),{status:i}=t,n=i==="ok"&&"text-green-500",s=i==="partial"&&"text-yellow-500",a=i==="error"&&"text-red-500",r=i==="failed"&&"text-red-500",c=i==="disconnected"&&"text-gray-500",o=i==="pending"&&"text-yellow-500",d=i==="connected"&&"text-green-500",u;e[0]!==n||e[1]!==s||e[2]!==a||e[3]!==r||e[4]!==c||e[5]!==o||e[6]!==d?(u=Ee("text-xs font-medium",n,s,a,r,c,o,d),e[0]=n,e[1]=s,e[2]=a,e[3]=r,e[4]=c,e[5]=o,e[6]=d,e[7]=u):u=e[7];let m;return e[8]!==i||e[9]!==u?(m=(0,l.jsx)("span",{className:u,children:i}),e[8]=i,e[9]=u,e[10]=m):m=e[10],m};function _u(t){let[e,i]=t;return(0,l.jsxs)("div",{className:"flex justify-between items-center pl-2",children:[(0,l.jsx)("span",{className:"text-muted-foreground truncate max-w-[180px]",children:e}),(0,l.jsx)(Xt,{status:i})]},e)}var Nu=Se(),Iu=[{id:"marimo",title:"marimo (docs)",description:"Access marimo documentation"},{id:"context7",title:"Context7",description:"Connect to Context7 MCP server"}];const Ku=t=>{let e=(0,Nu.c)(36),{form:i,onSubmit:n}=t,{handleClick:s}=$i(),{data:a,refetch:r,isFetching:c}=ba(),{refresh:o,isRefreshing:d}=Cu(),u;e[0]!==r||e[1]!==o?(u=async()=>{await o(),r()},e[0]=r,e[1]=o,e[2]=u):u=e[2];let m=u,h;e[3]===Symbol.for("react.memo_cache_sentinel")?(h=(0,l.jsx)(pt,{children:"MCP Servers"}),e[3]=h):h=e[3];let x;e[4]===a?x=e[5]:(x=a&&(0,l.jsx)(Xt,{status:a.status}),e[4]=a,e[5]=x);let y=d||c,j;e[6]!==c||e[7]!==d?(j=d||c?(0,l.jsx)(Tt,{className:"h-3 w-3 animate-spin"}):(0,l.jsx)(gl,{className:"h-3 w-3"}),e[6]=c,e[7]=d,e[8]=j):j=e[8];let v;e[9]!==m||e[10]!==y||e[11]!==j?(v=(0,l.jsx)(se,{variant:"outline",size:"xs",onClick:m,disabled:y,children:j}),e[9]=m,e[10]=y,e[11]=j,e[12]=v):v=e[12];let _;e[13]!==x||e[14]!==v?(_=(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[h,(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[x,v]})]}),e[13]=x,e[14]=v,e[15]=_):_=e[15];let C;e[16]===a?C=e[17]:(C=(a==null?void 0:a.error)&&(0,l.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]=C);let w;e[18]===a?w=e[19]:(w=(a==null?void 0:a.servers)&&(0,l.jsx)("div",{className:"text-xs text-muted-foreground",children:Object.entries(a.servers).map(Mu)}),e[18]=a,e[19]=w);let p;e[20]===Symbol.for("react.memo_cache_sentinel")?(p=(0,l.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]=p):p=e[20];let f;e[21]===Symbol.for("react.memo_cache_sentinel")?(f=(0,l.jsx)(ae,{className:"inline",children:"marimo[mcp]"}),e[21]=f):f=e[21];let N;e[22]===s?N=e[23]:(N=(0,l.jsxs)("p",{className:"text-sm text-muted-foreground",children:["This feature requires the ",f," ","package. See"," ",(0,l.jsx)(se,{variant:"link",onClick:()=>s("optionalDeps"),size:"xs",children:"Optional Features"})," ","for more details."]}),e[22]=s,e[23]=N);let K;e[24]!==i||e[25]!==n?(K=E=>{let{field:M}=E,k=M.value||[],D=b=>{let A=k.includes(b)?k.filter(z=>z!==b):[...k,b];M.onChange(A),n(i.getValues())};return(0,l.jsx)(R,{children:(0,l.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:Iu.map(b=>{let A=k.includes(b.id);return(0,l.jsxs)(Xo,{className:`cursor-pointer transition-all ${A?"border-[var(--blue-9)] bg-[var(--blue-2)]":"hover:border-[var(--blue-7)]"}`,onClick:()=>D(b.id),children:[(0,l.jsx)(Yo,{children:(0,l.jsxs)("div",{className:"flex items-start justify-between",children:[(0,l.jsx)(Wo,{className:"text-base",children:b.title}),(0,l.jsx)("span",{className:`h-5 w-5 flex items-center justify-center rounded border ${A?"border-[var(--blue-7)] bg-[var(--blue-7)] text-foreground":"border-muted bg-background text-muted-foreground"}`,children:A?(0,l.jsx)(nc,{}):null})]})}),(0,l.jsx)(Qo,{children:(0,l.jsx)(Zo,{children:b.description})})]},b.id)})})})},e[24]=i,e[25]=n,e[26]=K):K=e[26];let T;e[27]!==i.control||e[28]!==K?(T=(0,l.jsx)($,{control:i.control,name:"mcp.presets",render:K}),e[27]=i.control,e[28]=K,e[29]=T):T=e[29];let I;return e[30]!==N||e[31]!==T||e[32]!==_||e[33]!==C||e[34]!==w?(I=(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[_,C,w,p,N,T]}),e[30]=N,e[31]=T,e[32]=_,e[33]=C,e[34]=w,e[35]=I):I=e[35],I};function Mu(t){let[e,i]=t;return(0,l.jsxs)("div",{children:[e,": ",(0,l.jsx)(Xt,{status:i})]},e)}var Ce=Se();const Du=t=>{let e=(0,Ce.c)(5),{provider:i,children:n}=t,s;e[0]===i?s=e[1]:(s=i&&(0,l.jsx)(Te,{provider:i,className:"mr-2"}),e[0]=i,e[1]=s);let a;return e[2]!==n||e[3]!==s?(a=(0,l.jsxs)("div",{className:"flex items-center text-base font-semibold",children:[s,n]}),e[2]=n,e[3]=s,e[4]=a):a=e[4],a},Ve=t=>{let e=(0,Ce.c)(11),{form:i,config:n,name:s,placeholder:a,testId:r,description:c,onChange:o}=t,d;e[0]!==n||e[1]!==c||e[2]!==s||e[3]!==o||e[4]!==a||e[5]!==r?(d=m=>{let{field:h}=m;return(0,l.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(B,{children:"API Key"}),(0,l.jsx)(V,{children:(0,l.jsx)(Be,{"data-testid":r,rootClassName:"flex-1",className:"m-0 inline-flex h-7",placeholder:a,type:"password",...h,value:Nt(h.value),onChange:x=>{let y=x.target.value;y.includes("*")||(h.onChange(y),o==null||o(y))}})}),(0,l.jsx)(G,{}),(0,l.jsx)(L,{userConfig:n,name:s})]}),c&&(0,l.jsx)(H,{children:c})]})},e[0]=n,e[1]=c,e[2]=s,e[3]=o,e[4]=a,e[5]=r,e[6]=d):d=e[6];let u;return e[7]!==i.control||e[8]!==s||e[9]!==d?(u=(0,l.jsx)($,{control:i.control,name:s,render:d}),e[7]=i.control,e[8]=s,e[9]=d,e[10]=u):u=e[10],u};function Nt(t){return t==null?"":typeof t=="string"?t:String(t)}const Ye=t=>{let e=(0,Ce.c)(12),{form:i,config:n,name:s,placeholder:a,testId:r,description:c,disabled:o,onChange:d}=t,u=o===void 0?!1:o,m;e[0]!==n||e[1]!==c||e[2]!==u||e[3]!==s||e[4]!==d||e[5]!==a||e[6]!==r?(m=x=>{let{field:y}=x;return(0,l.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(B,{children:"Base URL"}),(0,l.jsx)(V,{children:(0,l.jsx)(Be,{"data-testid":r,rootClassName:"flex-1",className:"m-0 inline-flex h-7",placeholder:a,...y,value:Nt(y.value),disabled:u,onChange:j=>{y.onChange(j.target.value),d==null||d(j.target.value)}})}),(0,l.jsx)(G,{}),(0,l.jsx)(L,{userConfig:n,name:s})]}),c&&(0,l.jsx)(H,{children:c})]})},e[0]=n,e[1]=c,e[2]=u,e[3]=s,e[4]=d,e[5]=a,e[6]=r,e[7]=m):m=e[7];let h;return e[8]!==i.control||e[9]!==s||e[10]!==m?(h=(0,l.jsx)($,{control:i.control,name:s,render:m}),e[8]=i.control,e[9]=s,e[10]=m,e[11]=h):h=e[11],h},Fi=t=>{let e=(0,Ce.c)(13),{form:i,config:n,name:s,placeholder:a,description:r,label:c,forRole:o,onSubmit:d}=t,u;e[0]!==n||e[1]!==r||e[2]!==o||e[3]!==i||e[4]!==c||e[5]!==s||e[6]!==d||e[7]!==a?(u=h=>{let{field:x}=h,y=Nt(x.value),j=v=>{x.onChange(v),d(i.getValues())};return(0,l.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(B,{children:c}),(0,l.jsx)(V,{children:(0,l.jsx)(Ka,{value:y,placeholder:a,onSelect:j,triggerClassName:"text-sm",customDropdownContent:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Et,{}),(0,l.jsxs)("p",{className:"px-2 py-1.5 text-sm text-muted-secondary flex items-center gap-1",children:["Enter a custom model",(0,l.jsx)(qe,{content:"Models should include the provider prefix, e.g. 'openai/gpt-4o'",children:(0,l.jsx)(Ha,{className:"h-3 w-3"})})]}),(0,l.jsxs)("div",{className:"px-2 py-1",children:[(0,l.jsx)(Be,{className:"w-full border-border shadow-none focus-visible:shadow-xs",placeholder:a,...x,value:Nt(x.value),onKeyDown:ol.stopPropagation()}),y&&(0,l.jsx)(ya,{value:y,includeSuggestion:!1})]})]}),forRole:o})}),(0,l.jsx)(G,{})]}),(0,l.jsx)(L,{userConfig:n,name:s}),(0,l.jsx)(ya,{value:y}),r&&(0,l.jsx)(H,{children:r})]})},e[0]=n,e[1]=r,e[2]=o,e[3]=i,e[4]=c,e[5]=s,e[6]=d,e[7]=a,e[8]=u):u=e[8];let m;return e[9]!==i.control||e[10]!==s||e[11]!==u?(m=(0,l.jsx)($,{control:i.control,name:s,render:u}),e[9]=i.control,e[10]=s,e[11]=u,e[12]=m):m=e[12],m},Au=t=>{let e=(0,Ce.c)(10),{form:i,config:n,name:s,options:a,testId:r,disabled:c}=t,o=c===void 0?!1:c,d;e[0]!==n||e[1]!==o||e[2]!==s||e[3]!==a||e[4]!==r?(d=m=>{let{field:h}=m;return(0,l.jsx)("div",{className:"flex flex-col space-y-1",children:(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(B,{children:"Provider"}),(0,l.jsx)(V,{children:(0,l.jsx)(Ke,{"data-testid":r,onChange:x=>{x.target.value==="none"?h.onChange(!1):h.onChange(x.target.value)},value:Nt(h.value===!0?"github":h.value===!1?"none":h.value),disabled:o,className:"inline-flex mr-2",children:a.map(Gu)})}),(0,l.jsx)(G,{}),(0,l.jsx)(L,{userConfig:n,name:s})]})})},e[0]=n,e[1]=o,e[2]=s,e[3]=a,e[4]=r,e[5]=d):d=e[5];let u;return e[6]!==i.control||e[7]!==s||e[8]!==d?(u=(0,l.jsx)($,{control:i.control,name:s,render:d}),e[6]=i.control,e[7]=s,e[8]=d,e[9]=u):u=e[9],u};var Pu=({form:t,config:e,onSubmit:i})=>{let n=t.getValues("completion.copilot");if(n===!1)return null;if(n==="codeium")return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("p",{className:"text-sm text-muted-secondary",children:["To get a Windsurf API key, follow"," ",(0,l.jsx)(re,{href:"https://docs.marimo.io/guides/editor_features/ai_completion.html#windsurf-copilot",children:"these instructions"}),"."]}),(0,l.jsx)(Ve,{form:t,config:e,name:"completion.codeium_api_key",placeholder:"key",testId:"codeium-api-key-input"})]});if(n==="github")return(0,l.jsx)(ra,{});if(n==="custom")return(0,l.jsx)(Fi,{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"})},It=t=>{let e=(0,Ce.c)(5),{children:i,className:n}=t,s;e[0]===n?s=e[1]:(s=Ee("flex flex-col gap-4 pb-4",n),e[0]=n,e[1]=s);let a;return e[2]!==i||e[3]!==s?(a=(0,l.jsx)("div",{className:s,children:i}),e[2]=i,e[3]=s,e[4]=a):a=e[4],a},Eu=t=>{let e=(0,Ce.c)(23),{qualifiedId:i,model:n,isEnabled:s,onToggle:a,onDelete:r}=t,c;e[0]!==a||e[1]!==i?(c=()=>{a(i)},e[0]=a,e[1]=i,e[2]=c):c=e[2];let o=c,d;e[3]!==r||e[4]!==i?(d=v=>{v.stopPropagation(),v.preventDefault(),r(i)},e[3]=r,e[4]=i,e[5]=d):d=e[5];let u=d,m;e[6]===n?m=e[7]:(m=(0,l.jsx)(Tu,{model:n}),e[6]=n,e[7]=m);let h;e[8]!==u||e[9]!==n.custom?(h=n.custom&&(0,l.jsx)(se,{variant:"ghost",size:"icon",onClick:u,className:"mr-2 hover:bg-transparent",children:(0,l.jsx)(bl,{className:"h-3.5 w-3.5 text-muted-foreground"})}),e[8]=u,e[9]=n.custom,e[10]=h):h=e[10];let x;e[11]!==o||e[12]!==s?(x=(0,l.jsx)(gr,{checked:s,onClick:o,size:"sm"}),e[11]=o,e[12]=s,e[13]=x):x=e[13];let y;e[14]!==m||e[15]!==h||e[16]!==x?(y=(0,l.jsx)($s,{children:(0,l.jsxs)("div",{className:"flex items-center justify-between px-3 py-2.5 border-b last:border-b-0 cursor-pointer outline-none",children:[m,h,x]})}),e[14]=m,e[15]=h,e[16]=x,e[17]=y):y=e[17];let j;return e[18]!==o||e[19]!==n.name||e[20]!==i||e[21]!==y?(j=(0,l.jsx)(Ls,{id:i,textValue:n.name,className:"pl-6 outline-none data-focused:bg-muted/50 hover:bg-muted/50",onAction:o,children:y}),e[18]=o,e[19]=n.name,e[20]=i,e[21]=y,e[22]=j):j=e[22],j},Tu=t=>{let e=(0,Ce.c)(18),{model:i}=t,n;e[0]===i.name?n=e[1]:(n=(0,l.jsx)("h3",{className:"font-medium text-sm",children:i.name}),e[0]=i.name,e[1]=n);let s;e[2]===i.custom?s=e[3]:(s=i.custom&&(0,l.jsx)(ii,{className:"h-4 w-4"}),e[2]=i.custom,e[3]=s);let a;e[4]===s?a=e[5]:(a=(0,l.jsx)(qe,{content:"Custom model",children:s}),e[4]=s,e[5]=a);let r;e[6]===i.capabilities?r=e[7]:(r=i.capabilities.includes("thinking")&&(0,l.jsxs)("div",{className:Ee("flex items-center gap-1 rounded px-1 py-0.5 w-fit",Qt("thinking")),children:[(0,l.jsx)(vi,{className:"h-3 w-3"}),(0,l.jsx)("span",{className:"text-xs font-medium",children:"Reasoning"})]}),e[6]=i.capabilities,e[7]=r);let c;e[8]!==n||e[9]!==a||e[10]!==r?(c=(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[n,a,r]}),e[8]=n,e[9]=a,e[10]=r,e[11]=c):c=e[11];let o;e[12]!==i.custom||e[13]!==i.description?(o=i.description&&!i.custom&&(0,l.jsx)("p",{className:"text-sm text-muted-foreground line-clamp-2",children:i.description}),e[12]=i.custom,e[13]=i.description,e[14]=o):o=e[14];let d;return e[15]!==c||e[16]!==o?(d=(0,l.jsxs)("div",{className:"flex flex-col flex-1 gap-0.5",children:[c,o]}),e[15]=c,e[16]=o,e[17]=d):d=e[17],d};const zu=t=>{let e=(0,Ce.c)(13),{form:i,config:n,onSubmit:s}=t,a,r;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=(0,l.jsx)(pt,{children:"Code Completion"}),r=(0,l.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[0]=a,e[1]=r):(a=e[0],r=e[1]);let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=["none","github","codeium","custom"],e[2]=c):c=e[2];let o;e[3]!==n||e[4]!==i?(o=(0,l.jsx)(Au,{form:i,config:n,name:"completion.copilot",options:c,testId:"copilot-select"}),e[3]=n,e[4]=i,e[5]=o):o=e[5];let d;e[6]!==n||e[7]!==i||e[8]!==s?(d=Pu({form:i,config:n,onSubmit:s}),e[6]=n,e[7]=i,e[8]=s,e[9]=d):d=e[9];let u;return e[10]!==o||e[11]!==d?(u=(0,l.jsxs)(It,{children:[a,r,o,d]}),e[10]=o,e[11]=d,e[12]=u):u=e[12],u};var Fe=t=>{let e=(0,Ce.c)(15),{title:i,triggerClassName:n,provider:s,children:a,isConfigured:r,value:c}=t,o=c??s,d;e[0]===r?d=e[1]:(d=r&&(0,l.jsx)("span",{className:"ml-2 px-1 rounded bg-muted text-xs font-medium border",children:"Configured"}),e[0]=r,e[1]=d);let u;e[2]!==s||e[3]!==d||e[4]!==i?(u=(0,l.jsxs)(Du,{provider:s,children:[i,d]}),e[2]=s,e[3]=d,e[4]=i,e[5]=u):u=e[5];let m;e[6]!==u||e[7]!==n?(m=(0,l.jsx)(xr,{className:n,children:u}),e[6]=u,e[7]=n,e[8]=m):m=e[8];let h;e[9]===a?h=e[10]:(h=(0,l.jsx)(vr,{wrapperClassName:"flex flex-col gap-4",children:a}),e[9]=a,e[10]=h);let x;return e[11]!==o||e[12]!==m||e[13]!==h?(x=(0,l.jsxs)(yr,{value:o,children:[m,h]}),e[11]=o,e[12]=m,e[13]=h,e[14]=x):x=e[14],x};const Fu=({form:t,config:e,onSubmit:i})=>{let[n,s]=(0,g.useState)(!1),[a,r]=(0,g.useState)(""),[c,o]=(0,g.useState)(""),[d,u]=(0,g.useState)(""),m=(0,g.useId)(),h=(0,g.useId)(),x=(0,g.useId)(),y=a.toLowerCase().replaceAll(/\s+/g,"_"),j=t.watch("ai.custom_providers"),v=qt.includes(y)||j&&Object.keys(j).includes(y),_=y.includes("."),C=y.trim()&&d.trim()&&!v&&!_,w=()=>{r(""),o(""),u(""),s(!1)};return(0,l.jsx)($,{control:t.control,name:"ai.custom_providers",render:({field:p})=>{let f=p.value||{},N=Object.entries(f),K=()=>{C&&(p.onChange({...f,[y]:{api_key:c||void 0,base_url:d}}),i(t.getValues()),w())},T=k=>{let{[k]:D,...b}=f;t.resetField("ai.custom_providers"),t.setValue("ai.custom_providers",b,{shouldDirty:!0}),i(t.getValues())},I=(0,l.jsxs)("div",{className:"flex flex-col gap-3 p-4 border border-border rounded-md bg-muted/20",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,l.jsx)(Oe,{htmlFor:m,children:"Provider Name"}),(0,l.jsx)(Be,{id:m,placeholder:"e.g., together, groq, mistral",value:a,onChange:k=>r(k.target.value)}),v&&(0,l.jsx)("p",{className:"text-xs text-destructive",children:"A provider with this name already exists."}),_&&(0,l.jsx)("p",{className:"text-xs text-destructive",children:"Provider names cannot contain '.' characters."}),a&&!_&&(0,l.jsxs)("p",{className:"text-xs text-muted-secondary",children:["Use models with prefix:"," ",(0,l.jsxs)(ae,{className:"inline text-xs",children:[y,"/"]})]})]}),(0,l.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,l.jsxs)(Oe,{htmlFor:x,children:["Base URL ",(0,l.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,l.jsx)(Be,{id:x,placeholder:"e.g., https://api.together.xyz/v1",value:d,onChange:k=>u(k.target.value)})]}),(0,l.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,l.jsx)(Oe,{htmlFor:h,children:"API Key (optional)"}),(0,l.jsx)(Be,{id:h,placeholder:"sk-...",type:"password",value:c,onChange:k=>o(k.target.value)})]}),(0,l.jsxs)("div",{className:"flex gap-2 mt-1",children:[(0,l.jsx)(se,{onClick:K,disabled:!C,size:"xs",children:"Add Provider"}),(0,l.jsx)(se,{variant:"outline",onClick:w,size:"xs",children:"Cancel"})]})]}),E=k=>{p.onChange({...f,[k.providerName]:{...f[k.providerName],[k.fieldName]:k.value||void 0}})},M=({providerName:k,providerConfig:D,onRemove:b})=>{let A=ri.startCase(k),z=!!D.api_key||!!D.base_url;return(0,l.jsxs)(Fe,{title:A,provider:k,value:`custom-${k}`,isConfigured:z,children:[(0,l.jsx)(Ve,{form:t,config:e,name:`ai.custom_providers.${k}.api_key`,placeholder:"sk-...",testId:`custom-provider-${k}-api-key`,onChange:F=>E({providerName:k,fieldName:"api_key",value:F})}),(0,l.jsx)(Ye,{form:t,config:e,name:`ai.custom_providers.${k}.base_url`,placeholder:"https://api.example.com/v1",testId:`custom-provider-${k}-base-url`,onChange:F=>E({providerName:k,fieldName:"base_url",value:F})}),(0,l.jsxs)(se,{variant:"destructive",size:"xs",onClick:F=>{F.stopPropagation(),F.preventDefault(),b(k)},className:"w-fit self-end",children:[(0,l.jsx)(bl,{className:"h-4 w-4 mr-2"}),"Remove Provider"]})]},`custom-${k}`)};return(0,l.jsxs)(It,{children:[(0,l.jsx)(pt,{children:"Custom Providers"}),(0,l.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."}),N.length>0&&(0,l.jsx)(tl,{type:"multiple",className:"-mt-4",children:N.map(([k,D])=>M({providerName:k,providerConfig:D,onRemove:T}))}),n?I:(0,l.jsx)(ka,{className:"self-start",isFormOpen:n,setIsFormOpen:s,label:"Add Provider"})]})}})},Bu=t=>{let e=(0,Ce.c)(127),{form:i,config:n,onSubmit:s}=t,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=dt(),e[0]=a):a=e[0];let r=a,c;e[1]===i?c=e[2]:(c=ht=>!!i.getValues(ht),e[1]=i,e[2]=c);let o=c,d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=(0,l.jsx)(ae,{className:"inline",children:"marimo.toml"}),e[3]=d):d=e[3];let u;e[4]===Symbol.for("react.memo_cache_sentinel")?(u=(0,l.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,l.jsx)(re,{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 m=o("ai.open_ai.api_key"),h;e[5]===Symbol.for("react.memo_cache_sentinel")?(h=(0,l.jsxs)(l.Fragment,{children:["Your OpenAI API key from"," ",(0,l.jsx)(re,{href:"https://platform.openai.com/account/api-keys",children:"platform.openai.com"}),"."]}),e[5]=h):h=e[5];let x,y;e[6]!==n||e[7]!==i?(x=(0,l.jsx)(Ve,{form:i,config:n,name:"ai.open_ai.api_key",placeholder:"sk-proj...",testId:"ai-openai-api-key-input",description:h}),y=(0,l.jsx)(Ye,{form:i,config:n,name:"ai.open_ai.base_url",placeholder:"https://api.openai.com/v1",testId:"ai-base-url-input",disabled:r}),e[6]=n,e[7]=i,e[8]=x,e[9]=y):(x=e[8],y=e[9]);let j;e[10]!==m||e[11]!==x||e[12]!==y?(j=(0,l.jsxs)(Fe,{title:"OpenAI",provider:"openai",triggerClassName:"pt-0",isConfigured:m,children:[x,y]}),e[10]=m,e[11]=x,e[12]=y,e[13]=j):j=e[13];let v=o("ai.anthropic.api_key"),_;e[14]===Symbol.for("react.memo_cache_sentinel")?(_=(0,l.jsxs)(l.Fragment,{children:["Your Anthropic API key from"," ",(0,l.jsx)(re,{href:"https://console.anthropic.com/settings/keys",children:"console.anthropic.com"}),"."]}),e[14]=_):_=e[14];let C;e[15]!==n||e[16]!==i?(C=(0,l.jsx)(Ve,{form:i,config:n,name:"ai.anthropic.api_key",placeholder:"sk-ant...",testId:"ai-anthropic-api-key-input",description:_}),e[15]=n,e[16]=i,e[17]=C):C=e[17];let w;e[18]!==v||e[19]!==C?(w=(0,l.jsx)(Fe,{title:"Anthropic",provider:"anthropic",isConfigured:v,children:C}),e[18]=v,e[19]=C,e[20]=w):w=e[20];let p=o("ai.google.api_key"),f;e[21]===Symbol.for("react.memo_cache_sentinel")?(f=(0,l.jsxs)(l.Fragment,{children:["Your Google AI API key from"," ",(0,l.jsx)(re,{href:"https://aistudio.google.com/app/apikey",children:"aistudio.google.com"}),"."]}),e[21]=f):f=e[21];let N;e[22]!==n||e[23]!==i?(N=(0,l.jsx)(Ve,{form:i,config:n,name:"ai.google.api_key",placeholder:"AI...",testId:"ai-google-api-key-input",description:f}),e[22]=n,e[23]=i,e[24]=N):N=e[24];let K;e[25]!==p||e[26]!==N?(K=(0,l.jsx)(Fe,{title:"Google",provider:"google",isConfigured:p,children:N}),e[25]=p,e[26]=N,e[27]=K):K=e[27];let T=o("ai.ollama.base_url"),I;e[28]!==n||e[29]!==i?(I=(0,l.jsx)(Ye,{form:i,config:n,name:"ai.ollama.base_url",placeholder:"http://localhost:11434/v1",testId:"ollama-base-url-input"}),e[28]=n,e[29]=i,e[30]=I):I=e[30];let E;e[31]!==T||e[32]!==I?(E=(0,l.jsx)(Fe,{title:"Ollama",provider:"ollama",isConfigured:T,children:I}),e[31]=T,e[32]=I,e[33]=E):E=e[33];let M=o("ai.github.api_key"),k;e[34]===Symbol.for("react.memo_cache_sentinel")?(k=(0,l.jsx)(Ml,{variant:"warning",className:"py-1.5 px-3 text-xs",children:(0,l.jsxs)(Kl,{children:["Free tier models have low token limits which can cause errors with larger prompts."," ",(0,l.jsx)(re,{href:"https://docs.github.com/en/github-models/prototyping-with-ai-models#rate-limits",children:"Learn more"})]})}),e[34]=k):k=e[34];let D;e[35]===Symbol.for("react.memo_cache_sentinel")?(D=(0,l.jsxs)(l.Fragment,{children:["Your GitHub API token from"," ",(0,l.jsx)(ae,{className:"inline",children:"gh auth token"}),"."]}),e[35]=D):D=e[35];let b,A;e[36]!==n||e[37]!==i?(b=(0,l.jsx)(Ve,{form:i,config:n,name:"ai.github.api_key",placeholder:"gho_...",testId:"ai-github-api-key-input",description:D}),A=(0,l.jsx)(Ye,{form:i,config:n,name:"ai.github.base_url",placeholder:"https://models.github.ai/inference",testId:"ai-github-base-url-input"}),e[36]=n,e[37]=i,e[38]=b,e[39]=A):(b=e[38],A=e[39]);let z;e[40]!==M||e[41]!==b||e[42]!==A?(z=(0,l.jsxs)(Fe,{title:"GitHub",provider:"github",isConfigured:M,children:[k,b,A]}),e[40]=M,e[41]=b,e[42]=A,e[43]=z):z=e[43];let F=o("ai.openrouter.api_key"),q;e[44]===Symbol.for("react.memo_cache_sentinel")?(q=(0,l.jsxs)(l.Fragment,{children:["Your OpenRouter API key from ","",(0,l.jsx)(re,{href:"https://openrouter.ai/keys",children:"openrouter.ai"}),"."]}),e[44]=q):q=e[44];let Y,S;e[45]!==n||e[46]!==i?(Y=(0,l.jsx)(Ve,{form:i,config:n,name:"ai.openrouter.api_key",placeholder:"or-...",testId:"ai-openrouter-api-key-input",description:q}),S=(0,l.jsx)(Ye,{form:i,config:n,name:"ai.openrouter.base_url",placeholder:"https://openrouter.ai/api/v1/",testId:"ai-openrouter-base-url-input"}),e[45]=n,e[46]=i,e[47]=Y,e[48]=S):(Y=e[47],S=e[48]);let W;e[49]!==F||e[50]!==Y||e[51]!==S?(W=(0,l.jsxs)(Fe,{title:"OpenRouter",provider:"openrouter",isConfigured:F,children:[Y,S]}),e[49]=F,e[50]=Y,e[51]=S,e[52]=W):W=e[52];let ee=o("ai.wandb.api_key"),oe;e[53]===Symbol.for("react.memo_cache_sentinel")?(oe=(0,l.jsxs)(l.Fragment,{children:["Your Weights & Biases API key from"," ",(0,l.jsx)(re,{href:"https://wandb.ai/authorize",children:"wandb.ai"}),"."]}),e[53]=oe):oe=e[53];let ce,he;e[54]!==n||e[55]!==i?(ce=(0,l.jsx)(Ve,{form:i,config:n,name:"ai.wandb.api_key",placeholder:"your-wandb-api-key",testId:"ai-wandb-api-key-input",description:oe}),he=(0,l.jsx)(Ye,{form:i,config:n,name:"ai.wandb.base_url",placeholder:"https://api.inference.wandb.ai/v1/",testId:"ai-wandb-base-url-input"}),e[54]=n,e[55]=i,e[56]=ce,e[57]=he):(ce=e[56],he=e[57]);let ue;e[58]!==ee||e[59]!==ce||e[60]!==he?(ue=(0,l.jsxs)(Fe,{title:"Weights & Biases",provider:"wandb",isConfigured:ee,children:[ce,he]}),e[58]=ee,e[59]=ce,e[60]=he,e[61]=ue):ue=e[61];let ge=o("ai.opencode_go.api_key"),P;e[62]===Symbol.for("react.memo_cache_sentinel")?(P=(0,l.jsxs)(l.Fragment,{children:["Your OpenCode API key from"," ",(0,l.jsx)(re,{href:"https://opencode.ai/auth",children:"opencode.ai"}),". OpenCode Go is a low-cost subscription for open coding models."]}),e[62]=P):P=e[62];let X,Z;e[63]!==n||e[64]!==i?(X=(0,l.jsx)(Ve,{form:i,config:n,name:"ai.opencode_go.api_key",placeholder:"your-opencode-api-key",testId:"ai-opencode-go-api-key-input",description:P}),Z=(0,l.jsx)(Ye,{form:i,config:n,name:"ai.opencode_go.base_url",placeholder:"https://opencode.ai/zen/go/v1/",testId:"ai-opencode-go-base-url-input"}),e[63]=n,e[64]=i,e[65]=X,e[66]=Z):(X=e[65],Z=e[66]);let Q;e[67]!==ge||e[68]!==X||e[69]!==Z?(Q=(0,l.jsxs)(Fe,{title:"OpenCode Go",provider:"opencode-go",isConfigured:ge,children:[X,Z]}),e[67]=ge,e[68]=X,e[69]=Z,e[70]=Q):Q=e[70];let J=o("ai.azure.api_key")&&o("ai.azure.base_url"),te;e[71]===Symbol.for("react.memo_cache_sentinel")?(te=(0,l.jsxs)(l.Fragment,{children:["Your Azure API key from"," ",(0,l.jsx)(re,{href:"https://portal.azure.com/",children:"portal.azure.com"}),"."]}),e[71]=te):te=e[71];let ie,fe;e[72]!==n||e[73]!==i?(ie=(0,l.jsx)(Ve,{form:i,config:n,name:"ai.azure.api_key",placeholder:"sk-proj...",testId:"ai-azure-api-key-input",description:te}),fe=(0,l.jsx)(Ye,{form:i,config:n,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]=n,e[73]=i,e[74]=ie,e[75]=fe):(ie=e[74],fe=e[75]);let me;e[76]!==J||e[77]!==ie||e[78]!==fe?(me=(0,l.jsxs)(Fe,{title:"Azure",provider:"azure",isConfigured:J,children:[ie,fe]}),e[76]=J,e[77]=ie,e[78]=fe,e[79]=me):me=e[79];let de=o("ai.bedrock.region_name"),ve;e[80]===Symbol.for("react.memo_cache_sentinel")?(ve=(0,l.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,l.jsx)(re,{href:"https://docs.marimo.io/guides/editor_features/ai_completion.html#aws-bedrock",children:"documentation"})," ","for more details."]}),e[80]=ve):ve=e[80];let xe;e[81]===n?xe=e[82]:(xe=ht=>{let{field:tt}=ht;return(0,l.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(B,{children:"AWS Region"}),(0,l.jsx)(V,{children:(0,l.jsx)(Ke,{"data-testid":"bedrock-region-select",onChange:Aa=>tt.onChange(Aa.target.value),value:typeof tt.value=="string"?tt.value:"us-east-1",disabled:tt.disabled,className:"inline-flex mr-2",children:vu.map(Hu)})}),(0,l.jsx)(G,{}),(0,l.jsx)(L,{userConfig:n,name:"ai.bedrock.region_name"})]}),(0,l.jsx)(H,{children:"The AWS region where Bedrock service is available."})]})},e[81]=n,e[82]=xe);let De;e[83]!==i.control||e[84]!==xe?(De=(0,l.jsx)($,{control:i.control,disabled:r,name:"ai.bedrock.region_name",render:xe}),e[83]=i.control,e[84]=xe,e[85]=De):De=e[85];let ye;e[86]===n?ye=e[87]:(ye=ht=>{let{field:tt}=ht;return(0,l.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(B,{children:"AWS Profile Name (Optional)"}),(0,l.jsx)(V,{children:(0,l.jsx)(Be,{"data-testid":"bedrock-profile-input",rootClassName:"flex-1",className:"m-0 inline-flex h-7",placeholder:"default",...tt,value:tt.value||""})}),(0,l.jsx)(G,{}),(0,l.jsx)(L,{userConfig:n,name:"ai.bedrock.profile_name"})]}),(0,l.jsx)(H,{children:"The AWS profile name from your ~/.aws/credentials file. Leave blank to use your default AWS credentials."})]})},e[86]=n,e[87]=ye);let be;e[88]!==i.control||e[89]!==ye?(be=(0,l.jsx)($,{control:i.control,disabled:r,name:"ai.bedrock.profile_name",render:ye}),e[88]=i.control,e[89]=ye,e[90]=be):be=e[90];let je;e[91]!==de||e[92]!==De||e[93]!==be?(je=(0,l.jsxs)(Fe,{title:"AWS Bedrock",provider:"bedrock",isConfigured:de,children:[ve,De,be]}),e[91]=de,e[92]=De,e[93]=be,e[94]=je):je=e[94];let Ae=o("ai.open_ai_compatible.api_key")&&o("ai.open_ai_compatible.base_url"),ne;e[95]===Symbol.for("react.memo_cache_sentinel")?(ne=(0,l.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[95]=ne):ne=e[95];let Qe;e[96]===Symbol.for("react.memo_cache_sentinel")?(Qe=(0,l.jsx)(l.Fragment,{children:"API key for any OpenAI-compatible provider (e.g., Together, Groq, Mistral, Perplexity, etc)."}),e[96]=Qe):Qe=e[96];let Ie;e[97]!==n||e[98]!==i?(Ie=(0,l.jsx)(Ve,{form:i,config:n,name:"ai.open_ai_compatible.api_key",placeholder:"sk-...",testId:"ai-openai-compatible-api-key-input",description:Qe}),e[97]=n,e[98]=i,e[99]=Ie):Ie=e[99];let Ue;e[100]===Symbol.for("react.memo_cache_sentinel")?(Ue=(0,l.jsx)(l.Fragment,{children:"Base URL for your OpenAI-compatible provider."}),e[100]=Ue):Ue=e[100];let we;e[101]!==n||e[102]!==i?(we=(0,l.jsx)(Ye,{form:i,config:n,name:"ai.open_ai_compatible.base_url",placeholder:"https://api.together.xyz/v1",testId:"ai-openai-compatible-base-url-input",description:Ue}),e[101]=n,e[102]=i,e[103]=we):we=e[103];let _e;e[104]!==Ae||e[105]!==Ie||e[106]!==we?(_e=(0,l.jsxs)(Fe,{title:"OpenAI-Compatible (Legacy)",provider:"openai-compatible",isConfigured:Ae,children:[ne,Ie,we]}),e[104]=Ae,e[105]=Ie,e[106]=we,e[107]=_e):_e=e[107];let Pe;e[108]!==w||e[109]!==K||e[110]!==E||e[111]!==z||e[112]!==W||e[113]!==ue||e[114]!==Q||e[115]!==me||e[116]!==je||e[117]!==_e||e[118]!==j?(Pe=(0,l.jsxs)(tl,{type:"multiple",children:[j,w,K,E,z,W,ue,Q,me,je,_e]}),e[108]=w,e[109]=K,e[110]=E,e[111]=z,e[112]=W,e[113]=ue,e[114]=Q,e[115]=me,e[116]=je,e[117]=_e,e[118]=j,e[119]=Pe):Pe=e[119];let ct;e[120]!==n||e[121]!==i||e[122]!==s?(ct=(0,l.jsx)(Fu,{form:i,config:n,onSubmit:s}),e[120]=n,e[121]=i,e[122]=s,e[123]=ct):ct=e[123];let Kt;return e[124]!==Pe||e[125]!==ct?(Kt=(0,l.jsxs)(It,{children:[u,Pe,ct]}),e[124]=Pe,e[125]=ct,e[126]=Kt):Kt=e[126],Kt},Ru=t=>{var w;let e=(0,Ce.c)(32),{form:i,config:n,onSubmit:s}=t,[a,r]=(0,g.useState)(((w=n.ai)==null?void 0:w.max_tokens)!=null),c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=(0,l.jsx)(pt,{children:"AI Assistant"}),e[0]=c):c=e[0];let o;e[1]===i.control?o=e[2]:(o=(0,l.jsx)($,{control:i.control,name:"ai.inline_tooltip",render:Uu}),e[1]=i.control,e[2]=o);let d;e[3]!==i||e[4]!==a||e[5]!==s?(d=p=>{let{field:f}=p;return(0,l.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,l.jsxs)("div",{className:"flex items-center gap-x-2",children:[(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(B,{className:"font-normal",children:"Max output tokens"}),(0,l.jsx)(V,{children:(0,l.jsx)(Be,{"data-testid":"ai-max-tokens-input",type:"number",min:1,disabled:!a,className:"w-28 h-6",value:f.value??(a?"":32768),onChange:N=>{let K=Number.parseInt(N.target.value,10);f.onChange(Number.isFinite(K)&&K>0?K:null)}})})]}),(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(le,{"data-testid":"ai-max-tokens-checkbox",checked:a,onCheckedChange:N=>{let K=N===!0;r(K);let T=K?f.value??32768:null;i.setValue("ai.max_tokens",T,{shouldDirty:!0,shouldTouch:!0}),s(i.getValues())}}),(0,l.jsx)(B,{className:"font-normal",children:"Override"})]})]}),(0,l.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,l.jsx)($,{control:i.control,name:"ai.max_tokens",render:d}),e[7]=i.control,e[8]=d,e[9]=u):u=e[9];let m;e[10]===Symbol.for("react.memo_cache_sentinel")?(m=(0,l.jsx)(fo,{}),e[10]=m):m=e[10];let h;e[11]===Symbol.for("react.memo_cache_sentinel")?(h=(0,l.jsx)("span",{children:"Model to use for chat conversations in the Chat panel."}),e[11]=h):h=e[11];let x;e[12]!==n||e[13]!==i||e[14]!==s?(x=(0,l.jsx)(Fi,{label:"Chat Model",form:i,config:n,name:"ai.models.chat_model",placeholder:Xi,description:h,forRole:"chat",onSubmit:s}),e[12]=n,e[13]=i,e[14]=s,e[15]=x):x=e[15];let y;e[16]===Symbol.for("react.memo_cache_sentinel")?(y=(0,l.jsxs)("span",{children:["Model to use for code editing with the"," ",(0,l.jsx)(ae,{className:"inline",children:"Generate with AI"})," button."]}),e[16]=y):y=e[16];let j;e[17]!==n||e[18]!==i||e[19]!==s?(j=(0,l.jsx)(Fi,{label:"Edit Model",form:i,config:n,name:"ai.models.edit_model",placeholder:Xi,description:y,forRole:"edit",onSubmit:s}),e[17]=n,e[18]=i,e[19]=s,e[20]=j):j=e[20];let v;e[21]===n?v=e[22]:(v=p=>{let{field:f}=p;return(0,l.jsxs)("div",{className:"flex flex-col",children:[(0,l.jsxs)(R,{children:[(0,l.jsx)(B,{children:"Custom Rules"}),(0,l.jsx)(V,{children:(0,l.jsx)(go,{"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",...f,value:f.value})}),(0,l.jsx)(G,{}),(0,l.jsx)(L,{userConfig:n,name:"ai.rules"})]}),(0,l.jsx)(H,{children:"Custom rules to include in all AI completion prompts."})]})},e[21]=n,e[22]=v);let _;e[23]!==i.control||e[24]!==v?(_=(0,l.jsx)($,{control:i.control,name:"ai.rules",render:v}),e[23]=i.control,e[24]=v,e[25]=_):_=e[25];let C;return e[26]!==_||e[27]!==o||e[28]!==u||e[29]!==x||e[30]!==j?(C=(0,l.jsxs)(It,{children:[c,o,u,m,x,j,_]}),e[26]=_,e[27]=o,e[28]=u,e[29]=x,e[30]=j,e[31]=C):C=e[31],C};var $u=t=>{let e=(0,Ce.c)(51),{providerId:i,models:n,enabledModels:s,onToggleModel:a,onToggleProvider:r,onDeleteModel:c}=t,o;if(e[0]!==s||e[1]!==n||e[2]!==i){let k;e[4]!==s||e[5]!==i?(k=D=>s.has(new Me(i,D.model).id),e[4]=s,e[5]=i,e[6]=k):k=e[6],o=n.filter(k),e[0]=s,e[1]=n,e[2]=i,e[3]=o}else o=e[3];let d=o.length,u=n.length,m;e[7]===i?m=e[8]:(m=St.getProviderInfo(i),e[7]=i,e[8]=m);let h=m,x;e[9]!==(h==null?void 0:h.name)||e[10]!==i?(x=(h==null?void 0:h.name)||ri.startCase(i),e[9]=h==null?void 0:h.name,e[10]=i,e[11]=x):x=e[11];let y=x,j=d===0?!1:d===u?!0:"indeterminate",v;e[12]!==d||e[13]!==r||e[14]!==i||e[15]!==u?(v=()=>{r(i,d<u/2)},e[12]=d,e[13]=r,e[14]=i,e[15]=u,e[16]=v):v=e[16];let _=Dt(v),C;e[17]===Symbol.for("react.memo_cache_sentinel")?(C=ol.stopPropagation(),e[17]=C):C=e[17];let w;e[18]!==j||e[19]!==_?(w=(0,l.jsx)(le,{checked:j,onCheckedChange:_,onClick:C}),e[18]=j,e[19]=_,e[20]=w):w=e[20];let p;e[21]===i?p=e[22]:(p=(0,l.jsx)(Te,{provider:i,className:"h-5 w-5"}),e[21]=i,e[22]=p);let f;e[23]===y?f=e[24]:(f=(0,l.jsx)("h2",{className:"font-semibold",children:y}),e[23]=y,e[24]=f);let N;e[25]!==d||e[26]!==u?(N=(0,l.jsxs)("p",{className:"text-sm text-muted-secondary",children:[d,"/",u," models"]}),e[25]=d,e[26]=u,e[27]=N):N=e[27];let K;e[28]!==f||e[29]!==N?(K=(0,l.jsxs)("div",{className:"flex items-center justify-between w-full",children:[f,N]}),e[28]=f,e[29]=N,e[30]=K):K=e[30];let T;e[31]===Symbol.for("react.memo_cache_sentinel")?(T=(0,l.jsx)(so,{slot:"chevron",children:(0,l.jsx)(Zr,{className:"h-4 w-4 text-muted-foreground shrink-0 transition-transform duration-200 group-data-expanded:rotate-90"})}),e[31]=T):T=e[31];let I;e[32]!==K||e[33]!==w||e[34]!==p?(I=(0,l.jsx)($s,{children:(0,l.jsxs)("div",{className:"flex items-center gap-3 px-2 py-3 hover:bg-muted/50 cursor-pointer outline-none focus-visible:outline-none border-b group-data-expanded:border-b-0 rounded-sm",children:[w,p,K,T]})}),e[32]=K,e[33]=w,e[34]=p,e[35]=I):I=e[35];let E;if(e[36]!==s||e[37]!==n||e[38]!==c||e[39]!==a||e[40]!==i){let k;e[42]!==s||e[43]!==c||e[44]!==a||e[45]!==i?(k=D=>{let b=new Me(i,D.model).id;return(0,l.jsx)(Eu,{qualifiedId:b,model:D,isEnabled:s.has(b),onToggle:a,onDelete:c},b)},e[42]=s,e[43]=c,e[44]=a,e[45]=i,e[46]=k):k=e[46],E=n.map(k),e[36]=s,e[37]=n,e[38]=c,e[39]=a,e[40]=i,e[41]=E}else E=e[41];let M;return e[47]!==i||e[48]!==I||e[49]!==E?(M=(0,l.jsxs)(Ls,{id:i,hasChildItems:!0,textValue:i,className:"outline-none data-focused:bg-muted/50 group",children:[I,E]}),e[47]=i,e[48]=I,e[49]=E,e[50]=M):M=e[50],M};const Vu=({form:t,onSubmit:e})=>{let i=mi({control:t.control,name:"ai.models.custom_models"}),n=mi({control:t.control,name:"ai.custom_providers"}),s=(0,g.useMemo)(()=>Object.keys(n||{}),[n]),a=(0,g.useMemo)(()=>St.create({displayedModels:[],customModels:i}),[i]),r=mi({control:t.control,name:"ai.models.displayed_models",defaultValue:[]}),c=new Set(r),o=a.getGroupedModelsByProvider(),d=a.getListModelsByProvider(),u=Dt(x=>{let y=c.has(x)?r.filter(j=>j!==x):[...r,x];t.setValue("ai.models.displayed_models",y,{shouldDirty:!0,shouldTouch:!0}),e(t.getValues())}),m=Dt(async(x,y)=>{let j=o.get(x)||[],v=new Set(j.map(C=>new Me(x,C.model).id)),_=y?[...new Set([...r,...v])]:r.filter(C=>!v.has(C));t.setValue("ai.models.displayed_models",_,{shouldDirty:!0,shouldTouch:!0}),e(t.getValues())}),h=Dt(x=>{let y=i.filter(v=>v!==x),j=r.filter(v=>v!==x);t.setValue("ai.models.displayed_models",j,{shouldDirty:!0,shouldTouch:!0}),t.setValue("ai.models.custom_models",y,{shouldDirty:!0,shouldTouch:!0}),e(t.getValues())});return(0,l.jsxs)(It,{className:"gap-2",children:[(0,l.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,l.jsx)("div",{className:"bg-background",children:(0,l.jsx)(nd,{"aria-label":"AI Models by Provider",className:"flex-1 overflow-auto outline-none focus-visible:outline-none",selectionMode:"none",children:d.map(([x,y])=>(0,l.jsx)($u,{providerId:x,models:y,enabledModels:c,onToggleModel:u,onToggleProvider:m,onDeleteModel:h},x))})}),(0,l.jsx)(Ou,{form:t,customModels:i,customProviderNames:s,onSubmit:e})]})},Ou=t=>{let e=(0,Ce.c)(77),{form:i,customModels:n,customProviderNames:s,onSubmit:a}=t,[r,c]=(0,g.useState)(!1),[o,d]=(0,g.useState)(!1),[u,m]=(0,g.useState)(null),[h,x]=(0,g.useState)(""),[y,j]=(0,g.useState)(""),v=(0,g.useId)(),_=(0,g.useId)(),C=(0,g.useId)(),w=u==="custom",p=w?h:u,f;e[0]!==y||e[1]!==p?(f=(p==null?void 0:p.trim())&&(y==null?void 0:y.trim()),e[0]=y,e[1]=p,e[2]=f):f=e[2];let N=f,K;e[3]===Symbol.for("react.memo_cache_sentinel")?(K=()=>{m(null),x(""),j(""),c(!1)},e[3]=K):K=e[3];let T=K,I;e[4]!==n||e[5]!==i||e[6]!==N||e[7]!==y||e[8]!==a||e[9]!==p?(I=()=>{if(!N)return;let ne=new Me(p,y);i.setValue("ai.models.custom_models",[ne.id,...n],{shouldDirty:!0,shouldTouch:!0}),a(i.getValues()),T(),d(!0),setTimeout(()=>d(!1),2e3)},e[4]=n,e[5]=i,e[6]=N,e[7]=y,e[8]=a,e[9]=p,e[10]=I):I=e[10];let E=I,M;e[11]===v?M=e[12]:(M=(0,l.jsx)(Oe,{htmlFor:v,className:"text-sm font-medium text-muted-foreground min-w-12",children:"Provider"}),e[11]=v,e[12]=M);let k=u||"",D;e[13]===Symbol.for("react.memo_cache_sentinel")?(D=ne=>m(ne),e[13]=D):D=e[13];let b;e[14]===u?b=e[15]:(b=u?(0,l.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,l.jsx)(Te,{provider:u,className:"h-3.5 w-3.5"}),(0,l.jsx)("span",{children:ei(u)})]}):(0,l.jsx)("span",{className:"text-muted-foreground",children:"Select..."}),e[14]=u,e[15]=b);let A;e[16]!==v||e[17]!==b?(A=(0,l.jsx)(_r,{id:v,className:"w-40 truncate",children:b}),e[16]=v,e[17]=b,e[18]=A):A=e[18];let z;e[19]===s?z=e[20]:(z=s.length>0&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("p",{className:"px-2 py-1 text-xs text-muted-secondary font-medium",children:"Custom Providers"}),s.map(qu),(0,l.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]=z);let F;e[21]===s?F=e[22]:(F=qt.filter(ne=>ne!=="marimo"&&!s.includes(ne)).map(Wu),e[21]=s,e[22]=F);let q;e[23]===Symbol.for("react.memo_cache_sentinel")?(q=(0,l.jsx)("p",{className:"px-2 py-1 text-xs text-muted-secondary font-medium mt-1",children:"Other"}),e[23]=q):q=e[23];let Y;e[24]===Symbol.for("react.memo_cache_sentinel")?(Y=(0,l.jsx)(ai,{value:"custom",children:(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(Te,{provider:"openai-compatible",className:"h-4 w-4"}),(0,l.jsx)("span",{children:"Enter provider name"})]})}),e[24]=Y):Y=e[24];let S;e[25]!==F||e[26]!==z?(S=(0,l.jsx)(Cr,{children:(0,l.jsxs)(Sr,{children:[z,F,q,Y]})}),e[25]=F,e[26]=z,e[27]=S):S=e[27];let W;e[28]!==S||e[29]!==k||e[30]!==A?(W=(0,l.jsxs)(Nr,{value:k,onValueChange:D,children:[A,S]}),e[28]=S,e[29]=k,e[30]=A,e[31]=W):W=e[31];let ee;e[32]!==W||e[33]!==M?(ee=(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[M,W]}),e[32]=W,e[33]=M,e[34]=ee):ee=e[34];let oe;e[35]!==_||e[36]!==h||e[37]!==w?(oe=w&&(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(Oe,{htmlFor:_,className:"text-sm font-medium text-muted-foreground min-w-12",children:"Name"}),(0,l.jsx)(Be,{id:_,value:h,onChange:ne=>x(ne.target.value),placeholder:"openrouter",className:"w-40 truncate"})]}),e[35]=_,e[36]=h,e[37]=w,e[38]=oe):oe=e[38];let ce;e[39]!==ee||e[40]!==oe?(ce=(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[ee,oe]}),e[39]=ee,e[40]=oe,e[41]=ce):ce=e[41];let he=ce,ue=w&&"self-start",ge;e[42]===ue?ge=e[43]:(ge=Ee("flex items-center gap-2",ue),e[42]=ue,e[43]=ge);let P;e[44]===C?P=e[45]:(P=(0,l.jsx)(Oe,{htmlFor:C,className:"text-sm font-medium text-muted-foreground",children:"Model"}),e[44]=C,e[45]=P);let X;e[46]===Symbol.for("react.memo_cache_sentinel")?(X=ne=>j(ne.target.value),e[46]=X):X=e[46];let Z;e[47]!==y||e[48]!==C?(Z=(0,l.jsx)(Be,{id:C,value:y,onChange:X,placeholder:"gpt-4",className:"text-xs mb-0"}),e[47]=y,e[48]=C,e[49]=Z):Z=e[49];let Q;e[50]!==ge||e[51]!==P||e[52]!==Z?(Q=(0,l.jsxs)("div",{className:ge,children:[P,Z]}),e[50]=ge,e[51]=P,e[52]=Z,e[53]=Q):Q=e[53];let J=Q,te=w&&"self-end",ie;e[54]===te?ie=e[55]:(ie=Ee("flex gap-1.5 ml-auto",te),e[54]=te,e[55]=ie);let fe=!N,me;e[56]!==E||e[57]!==fe?(me=(0,l.jsx)(se,{onClick:E,disabled:fe,size:"xs",children:"Add"}),e[56]=E,e[57]=fe,e[58]=me):me=e[58];let de;e[59]===Symbol.for("react.memo_cache_sentinel")?(de=(0,l.jsx)(se,{variant:"outline",onClick:T,size:"xs",children:"Cancel"}),e[59]=de):de=e[59];let ve;e[60]!==ie||e[61]!==me?(ve=(0,l.jsxs)("div",{className:ie,children:[me,de]}),e[60]=ie,e[61]=me,e[62]=ve):ve=e[62];let xe;e[63]!==J||e[64]!==he||e[65]!==ve?(xe=(0,l.jsxs)("div",{className:"flex items-center gap-3 p-3 border border-border rounded-md",children:[he,J,ve]}),e[63]=J,e[64]=he,e[65]=ve,e[66]=xe):xe=e[66];let De=r&&xe,ye;e[67]===r?ye=e[68]:(ye=(0,l.jsx)(ka,{isFormOpen:r,setIsFormOpen:c,label:"Add Model",className:"pl-2"}),e[67]=r,e[68]=ye);let be;e[69]===o?be=e[70]:(be=o&&(0,l.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]=o,e[70]=be);let je;e[71]!==ye||e[72]!==be?(je=(0,l.jsxs)("div",{className:"flex flex-row text-sm",children:[ye,be]}),e[71]=ye,e[72]=be,e[73]=je):je=e[73];let Ae;return e[74]!==De||e[75]!==je?(Ae=(0,l.jsxs)("div",{children:[De,je]}),e[74]=De,e[75]=je,e[76]=Ae):Ae=e[76],Ae};var ka=t=>{let e=(0,Ce.c)(10),{isFormOpen:i,setIsFormOpen:n,label:s,className:a}=t,r;e[0]===n?r=e[1]:(r=u=>{u.stopPropagation(),u.preventDefault(),n(!0)},e[0]=n,e[1]=r);let c;e[2]===a?c=e[3]:(c=Ee("px-0",a),e[2]=a,e[3]=c);let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o=(0,l.jsx)(eo,{className:"h-4 w-4 mr-2 mb-0.5"}),e[4]=o):o=e[4];let d;return e[5]!==i||e[6]!==s||e[7]!==r||e[8]!==c?(d=(0,l.jsxs)(se,{onClick:r,variant:"link",disabled:i,className:c,children:[o,s]}),e[5]=i,e[6]=s,e[7]=r,e[8]=c,e[9]=d):d=e[9],d};const Lu=t=>{let e=(0,Ce.c)(26),{form:i,config:n,onSubmit:s}=t,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=dt(),e[0]=a):a=e[0];let r=a,[c,o]=lt(Na),d;e[1]===o?d=e[2]:(d=v=>o(v),e[1]=o,e[2]=d);let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=(0,l.jsxs)(nl,{className:"mb-2",children:[(0,l.jsx)(ft,{value:"ai-features",children:"AI Features"}),(0,l.jsx)(ft,{value:"ai-providers",children:"AI Providers"}),(0,l.jsx)(ft,{value:"ai-models",children:"AI Models"}),!r&&(0,l.jsx)(ft,{value:"mcp",children:"MCP"})]}),e[3]=u):u=e[3];let m;e[4]!==n||e[5]!==i||e[6]!==s?(m=(0,l.jsxs)(Pt,{value:"ai-features",children:[(0,l.jsx)(zu,{form:i,config:n,onSubmit:s}),(0,l.jsx)(Ru,{form:i,config:n,onSubmit:s})]}),e[4]=n,e[5]=i,e[6]=s,e[7]=m):m=e[7];let h;e[8]!==n||e[9]!==i||e[10]!==s?(h=(0,l.jsx)(Pt,{value:"ai-providers",children:(0,l.jsx)(Bu,{form:i,config:n,onSubmit:s})}),e[8]=n,e[9]=i,e[10]=s,e[11]=h):h=e[11];let x;e[12]!==n||e[13]!==i||e[14]!==s?(x=(0,l.jsx)(Pt,{value:"ai-models",children:(0,l.jsx)(Vu,{form:i,config:n,onSubmit:s})}),e[12]=n,e[13]=i,e[14]=s,e[15]=x):x=e[15];let y;e[16]!==i||e[17]!==s?(y=!r&&(0,l.jsx)(Pt,{value:"mcp",children:(0,l.jsx)(Ku,{form:i,onSubmit:s})}),e[16]=i,e[17]=s,e[18]=y):y=e[18];let j;return e[19]!==c||e[20]!==d||e[21]!==m||e[22]!==h||e[23]!==x||e[24]!==y?(j=(0,l.jsxs)(ll,{value:c,onValueChange:d,className:"flex-1",children:[u,m,h,x,y]}),e[19]=c,e[20]=d,e[21]=m,e[22]=h,e[23]=x,e[24]=y,e[25]=j):j=e[25],j};function Gu(t){return(0,l.jsx)("option",{value:t,children:t},t)}function Hu(t){return(0,l.jsx)("option",{value:t,children:t},t)}function Uu(t){let{field:e}=t;return(0,l.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(B,{className:"font-normal",children:"AI Edit Tooltip"}),(0,l.jsx)(V,{children:(0,l.jsx)(le,{"data-testid":"inline-ai-checkbox",checked:e.value===!0,onCheckedChange:e.onChange})})]}),(0,l.jsx)(H,{children:'Enable "Edit with AI" tooltip when selecting code.'})]})}function qu(t){return(0,l.jsx)(ai,{value:t,children:(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(Te,{provider:t,className:"h-4 w-4"}),(0,l.jsx)("span",{children:ri.startCase(t)})]})},t)}function Wu(t){return(0,l.jsx)(ai,{value:t,children:(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(Te,{provider:t,className:"h-4 w-4"}),(0,l.jsx)("span",{children:ei(t)})]})},t)}var Yu=Se(),Qu=["auto","true","false"];const Zu=t=>{let e=(0,Yu.c)(47),{form:i,config:n,onSubmit:s}=t,a;e[0]!==n||e[1]!==i.control?(a=(T,I)=>(0,l.jsx)($,{control:i.control,name:T,render:E=>{let{field:M}=E,k=D=>{let b=D.target.value;M.onChange(b==="true"?!0:b==="false"?!1:b)};return(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(B,{className:"text-sm font-normal w-16",children:I}),(0,l.jsx)(V,{children:(0,l.jsx)(Ke,{"data-testid":"auto-discover-schemas-select",onChange:k,value:M.value===void 0?"auto":M.value.toString(),disabled:M.disabled,className:"w-[100px]",children:Qu.map(Xu)})}),(0,l.jsx)(L,{userConfig:n,name:T})]})}}),e[0]=n,e[1]=i.control,e[2]=a):a=e[2];let r=a,c;e[3]===n?c=e[4]:(c=T=>{let{field:I}=T;return(0,l.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(B,{children:"Dataframe viewer"}),(0,l.jsx)(V,{children:(0,l.jsx)(Ke,{"data-testid":"display-dataframes-select",onChange:E=>I.onChange(E.target.value),value:I.value,disabled:I.disabled,className:"inline-flex mr-2",children:["rich","plain"].map(Ju)})}),(0,l.jsx)(G,{}),(0,l.jsx)(L,{userConfig:n,name:"display.dataframes"})]}),(0,l.jsx)(H,{children:"Whether to use marimo's rich dataframe viewer or a plain HTML table. This requires restarting your notebook to take effect."})]})},e[3]=n,e[4]=c);let o;e[5]!==i.control||e[6]!==c?(o=(0,l.jsx)($,{control:i.control,name:"display.dataframes",render:c}),e[5]=i.control,e[6]=c,e[7]=o):o=e[7];let d;e[8]!==n||e[9]!==i||e[10]!==s?(d=T=>{let{field:I}=T;return(0,l.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(B,{children:"Default table page size"}),(0,l.jsx)(V,{children:(0,l.jsx)(yt,{"aria-label":"Default table page size","data-testid":"default-table-page-size-input",className:"m-0 w-24",...I,value:I.value,minValue:1,step:1,onChange:E=>{I.onChange(E),Number.isNaN(E)||s(i.getValues())}})}),(0,l.jsx)(G,{}),(0,l.jsx)(L,{userConfig:n,name:"display.default_table_page_size"})]}),(0,l.jsx)(H,{children:"The default number of rows displayed in dataframes and SQL results."})]})},e[8]=n,e[9]=i,e[10]=s,e[11]=d):d=e[11];let u;e[12]!==i.control||e[13]!==d?(u=(0,l.jsx)($,{control:i.control,name:"display.default_table_page_size",render:d}),e[12]=i.control,e[13]=d,e[14]=u):u=e[14];let m;e[15]!==n||e[16]!==i||e[17]!==s?(m=T=>{let{field:I}=T;return(0,l.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(B,{children:"Default table max columns"}),(0,l.jsx)(V,{children:(0,l.jsx)(yt,{"aria-label":"Default table max columns","data-testid":"default-table-max-columns-input",className:"m-0 w-24",...I,value:I.value,minValue:1,step:1,onChange:E=>{I.onChange(E),Number.isNaN(E)||s(i.getValues())}})}),(0,l.jsx)(G,{}),(0,l.jsx)(L,{userConfig:n,name:"display.default_table_max_columns"})]}),(0,l.jsx)(H,{children:"The default maximum number of columns displayed in dataframes and SQL results."})]})},e[15]=n,e[16]=i,e[17]=s,e[18]=m):m=e[18];let h;e[19]!==i.control||e[20]!==m?(h=(0,l.jsx)($,{control:i.control,name:"display.default_table_max_columns",render:m}),e[19]=i.control,e[20]=m,e[21]=h):h=e[21];let x;e[22]===Symbol.for("react.memo_cache_sentinel")?(x=(0,l.jsx)("div",{className:"text-sm text-foreground",children:"Database Schema Discovery"}),e[22]=x):x=e[22];let y,j;e[23]===Symbol.for("react.memo_cache_sentinel")?(j=(0,l.jsx)("br",{}),y=(0,l.jsx)("span",{className:"font-semibold",children:"Can be expensive for large databases."}),e[23]=y,e[24]=j):(y=e[23],j=e[24]);let v;e[25]===Symbol.for("react.memo_cache_sentinel")?(v=(0,l.jsxs)("div",{className:"text-sm text-muted-foreground mb-2",children:["Whether database schemas, tables, and columns are automatically discovered.",j,y," ","Use 'auto' to determine introspection based on the"," ",(0,l.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[25]=v):v=e[25];let _;e[26]===r?_=e[27]:(_=(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[x,v,r("datasources.auto_discover_schemas","Schemas"),r("datasources.auto_discover_tables","Tables"),r("datasources.auto_discover_columns","Columns")]}),e[26]=r,e[27]=_);let C;e[28]===n?C=e[29]:(C=T=>{let{field:I}=T;return(0,l.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(B,{children:"SQL Linter"}),(0,l.jsx)(V,{children:(0,l.jsx)(le,{"data-testid":"sql-linter-checkbox",checked:I.value,onCheckedChange:I.onChange})}),(0,l.jsx)(G,{}),(0,l.jsx)(L,{userConfig:n,name:"diagnostics.sql_linter"})]}),(0,l.jsx)(H,{children:"Better linting and autocompletions for SQL cells."})]})},e[28]=n,e[29]=C);let w;e[30]!==i.control||e[31]!==C?(w=(0,l.jsx)($,{control:i.control,name:"diagnostics.sql_linter",render:C}),e[30]=i.control,e[31]=C,e[32]=w):w=e[32];let p;e[33]===n?p=e[34]:(p=T=>{let{field:I}=T;return(0,l.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(B,{children:"Default SQL output"}),(0,l.jsx)(V,{children:(0,l.jsx)(Ke,{"data-testid":"user-config-sql-output-select",onChange:E=>I.onChange(E.target.value),value:I.value,disabled:I.disabled,className:"inline-flex mr-2",children:xa.map(e0)})}),(0,l.jsx)(G,{}),(0,l.jsx)(L,{userConfig:n,name:"runtime.default_sql_output"})]}),(0,l.jsx)(H,{children:'The default SQL output type for new notebooks; overridden by "sql_output" in the application config.'})]})},e[33]=n,e[34]=p);let f;e[35]!==i.control||e[36]!==p?(f=(0,l.jsx)($,{control:i.control,name:"runtime.default_sql_output",render:p}),e[35]=i.control,e[36]=p,e[37]=f):f=e[37];let N;e[38]!==_||e[39]!==w||e[40]!==f?(N=(0,l.jsxs)(ze,{title:"SQL",children:[_,w,f]}),e[38]=_,e[39]=w,e[40]=f,e[41]=N):N=e[41];let K;return e[42]!==N||e[43]!==o||e[44]!==u||e[45]!==h?(K=(0,l.jsxs)(l.Fragment,{children:[o,u,h,N]}),e[42]=N,e[43]=o,e[44]=u,e[45]=h,e[46]=K):K=e[46],K};function Xu(t){return(0,l.jsx)("option",{value:t,children:t},t)}function Ju(t){return(0,l.jsx)("option",{value:t,children:t},t)}function e0(t){return(0,l.jsx)("option",{value:t.value,children:t.label},t.value)}function Bi(t,e){let i={};for(let n of Object.keys(e)){let s=e[n],a=t[n];if(a!==void 0){if(s===!0)i[n]=a;else if(typeof s=="object"&&s){let r=Bi(a,s);Object.keys(r).length>0&&(i[n]=r)}}}return i}var wa=(t,e)=>{var i,n,s,a,r;e.ai={...e.ai,models:{...(i=e.ai)==null?void 0:i.models,displayed_models:((s=(n=t.ai)==null?void 0:n.models)==null?void 0:s.displayed_models)??[],custom_models:((r=(a=t.ai)==null?void 0:a.models)==null?void 0:r.custom_models)??[]}}},t0=[["ai.models.displayed_models",wa],["ai.models.custom_models",wa]],i0=new Map(t0),l0=(t,e)=>{if(!t)return!1;let i=t;for(let n of e.split(".")){if(typeof i!="object"||!i)return!1;i=i[n]}return i===!0};const n0=t=>{let{values:e,dirtyValues:i,touchedFields:n}=t;for(let[s,a]of i0)l0(n,s)&&a(e,i)};var s0=Se(),Ca=[{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:[dt()?{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"}];dt()||Ca.push({id:"lsp",packagesRequired:[{name:"python-lsp-server"},{name:"websockets"}],additionalPackageInstalls:[{name:"python-lsp-ruff"}],description:"Language Server Protocol*"});const a0=()=>{let t=(0,s0.c)(21),[e]=el(),i=e.package_management.manager,{getPackageList:n}=xt(),s;t[0]===n?s=t[1]:(s=()=>n(),t[0]=n,t[1]=s);let a;t[2]===i?a=t[3]:(a=[i],t[2]=i,t[3]=a);let{data:r,error:c,refetch:o,isPending:d}=Dl(s,a);if(d){let w;return t[4]===Symbol.for("react.memo_cache_sentinel")?(w=(0,l.jsx)(hl,{size:"medium",centered:!0}),t[4]=w):w=t[4],w}if(c){let w;return t[5]===c?w=t[6]:(w=(0,l.jsx)(Oo,{error:c}),t[5]=c,t[6]=w),w}let u;if(t[7]!==(r==null?void 0:r.packages)){let w=(r==null?void 0:r.packages)||[];u=new Set(w.map(o0)),t[7]=r==null?void 0:r.packages,t[8]=u}else u=t[8];let m=u,h;t[9]===Symbol.for("react.memo_cache_sentinel")?(h=(0,l.jsx)(pt,{children:"Optional Features"}),t[9]=h):h=t[9];let x;t[10]===Symbol.for("react.memo_cache_sentinel")?(x=(0,l.jsxs)("p",{className:"text-sm text-muted-foreground",children:["marimo is lightweight, with few dependencies, to maximize compatibility with your own environments.",(0,l.jsx)("br",{}),"To unlock additional features in the marimo editor, you can install these optional dependencies:"]}),t[10]=x):x=t[10];let y;t[11]===Symbol.for("react.memo_cache_sentinel")?(y=(0,l.jsx)(Lo,{children:(0,l.jsxs)(Al,{children:[(0,l.jsx)(Lt,{children:"Dependency"}),(0,l.jsx)(Lt,{children:"Feature"}),(0,l.jsx)(Lt,{children:"Status"}),(0,l.jsx)(Lt,{})]})}),t[11]=y):y=t[11];let j;t[12]!==m||t[13]!==i||t[14]!==o?(j=Ca.map(w=>{let p=w.packagesRequired.every(N=>m.has(N.name.split("[")[0])),f=w.packagesRequired.map(c0).join(", ");return(0,l.jsxs)(Al,{className:"text-sm",children:[(0,l.jsx)(xi,{children:w.description}),(0,l.jsx)(xi,{className:"font-mono text-xs",children:f}),(0,l.jsx)(xi,{children:p?(0,l.jsxs)("div",{className:"flex items-center",children:[(0,l.jsx)(Pl,{className:"h-4 w-4 text-(--grass-10) mr-2"}),(0,l.jsx)("span",{children:"Installed"})]}):(0,l.jsxs)("div",{className:"flex items-center",children:[(0,l.jsx)(Ba,{className:"h-4 w-4 text-(--red-10) mr-2"}),(0,l.jsx)(r0,{packageSpecs:[...w.packagesRequired,...w.additionalPackageInstalls],packageManager:i,onSuccess:o})]})})]},w.id)}),t[12]=m,t[13]=i,t[14]=o,t[15]=j):j=t[15];let v;t[16]===j?v=t[17]:(v=(0,l.jsxs)(Ho,{children:[y,(0,l.jsx)(Go,{children:j})]}),t[16]=j,t[17]=v);let _;t[18]===Symbol.for("react.memo_cache_sentinel")?(_=(0,l.jsx)("p",{className:"text-muted-foreground mt-2",children:"*Requires server restart"}),t[18]=_):_=t[18];let C;return t[19]===v?C=t[20]:(C=(0,l.jsxs)("div",{className:"flex-1 flex flex-col overflow-hidden gap-2",children:[h,x,v,_]}),t[19]=v,t[20]=C),C};var r0=({packageSpecs:t,packageManager:e,onSuccess:i})=>{let[n,s]=g.useState(!1),{addPackage:a}=xt();return(0,l.jsxs)(se,{size:"xs",variant:"outline",className:Ee("text-xs",n&&"opacity-50 cursor-not-allowed"),onClick:async()=>{try{s(!0);let r=await a({package:t.map(c=>c.minVersion?`${c.name}>=${c.minVersion}`:c.name).join(" "),group:"dev"});r.success?(i(),Re({title:"Package installed",description:(0,l.jsxs)("span",{children:["The packages"," ",(0,l.jsx)(ae,{className:"inline",children:t.map(c=>c.name).join(", ")})," ","have been added to your environment."]})})):Re({title:"Failed to install package",description:r.error,variant:"danger"})}finally{s(!1)}},disabled:n,children:[n?(0,l.jsx)(hl,{size:"small",className:"mr-2 h-3 w-3"}):(0,l.jsx)(Ra,{className:"mr-2 h-3 w-3"}),"Install with ",e]})};function o0(t){return t.name}function c0(t){return t.name}var Sa=[{id:"editor",label:"Editor",Icon:vl,className:"bg-(--blue-4)"},{id:"display",label:"Display",Icon:lc,className:"bg-(--grass-4)"},{id:"packageManagementAndData",label:"Packages & Data",Icon:Ua,className:"bg-(--red-4)"},{id:"runtime",label:"Runtime",Icon:El,className:"bg-(--amber-4)"},{id:"ai",label:"AI",Icon:vi,className:"bg-[linear-gradient(45deg,var(--purple-5),var(--cyan-5))]"},{id:"optionalDeps",label:"Optional Dependencies",Icon:Tl,className:"bg-(--orange-4)"},{id:"labs",label:"Labs",Icon:ic,className:"bg-(--slate-4)"}];const _a=nt(Sa[0].id);var d0=100,Ri="__system__";const u0=()=>{let[t,e]=Ji(),[i,n]=lt(qs),s=(0,g.useRef)(null),a=Mt(Ei),[r,c]=lt(_a),o=st(Xa);st(Za).mode==="home"&&(o={terminal:!0,pylsp:!0,ty:!0,basedpyright:!0,pyrefly:!0});let d=st(hr),{locale:u}=Ot(),{saveUserConfig:m}=xt(),h=mo({resolver:ho(nr),defaultValues:t}),x=(p,f)=>{let{chatModel:N,editModel:K}=Bd(p);return(N||K)&&(f={...f,models:{...f==null?void 0:f.models,...N&&{chat_model:N},...K&&{edit_model:K}}},N&&h.setValue("ai.models.chat_model",N),K&&h.setValue("ai.models.edit_model",K)),f},y=Mo(async p=>{let f=Bi(p,h.formState.dirtyFields);n0({values:p,dirtyValues:f,touchedFields:h.formState.touchedFields}),Object.keys(f).length!==0&&(f.ai&&(f.ai=x(p.ai,f.ai)),await m({config:f}),e(N=>tr({},N,f)))},d0),j=dt(),v=(0,g.useId)(),_=(0,g.useId)(),C=()=>{switch(r){case"editor":return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(ze,{title:"Autosave",children:[(0,l.jsx)($,{control:h.control,name:"save.autosave",render:({field:p})=>(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(B,{className:"font-normal",children:"Autosave enabled"}),(0,l.jsx)(V,{children:(0,l.jsx)(le,{"data-testid":"autosave-checkbox",checked:p.value==="after_delay",disabled:p.disabled,onCheckedChange:f=>{p.onChange(f?"after_delay":"off")}})}),(0,l.jsx)(G,{}),(0,l.jsx)(L,{userConfig:t,name:"save.autosave"})]})}),(0,l.jsx)($,{control:h.control,name:"save.autosave_delay",render:({field:p})=>(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(B,{children:"Autosave delay (seconds)"}),(0,l.jsx)(V,{children:(0,l.jsx)(yt,{"aria-label":"Autosave delay","data-testid":"autosave-delay-input",className:"m-0 w-24",isDisabled:h.getValues("save.autosave")!=="after_delay",...p,value:p.value/1e3,minValue:1,onChange:f=>{p.onChange(f*1e3),Number.isNaN(f)||y(h.getValues())}})}),(0,l.jsx)(G,{}),(0,l.jsx)(L,{userConfig:t,name:"save.autosave_delay"})]})}),(0,l.jsx)($,{control:h.control,name:"runtime.default_auto_download",render:({field:p})=>(0,l.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(B,{children:"Save cell outputs as"}),(0,l.jsx)(V,{children:(0,l.jsxs)("div",{className:"flex gap-4",children:[(0,l.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,l.jsx)(le,{id:v,checked:Array.isArray(p.value)&&p.value.includes("html"),onCheckedChange:()=>{let f=Array.isArray(p.value)?p.value:[];p.onChange(pl(f,"html"))}}),(0,l.jsx)(B,{htmlFor:v,children:"HTML"})]}),(0,l.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,l.jsx)(le,{id:_,checked:Array.isArray(p.value)&&p.value.includes("ipynb"),onCheckedChange:()=>{let f=Array.isArray(p.value)?p.value:[];p.onChange(pl(f,"ipynb"))}}),(0,l.jsx)(B,{htmlFor:_,children:"IPYNB"})]})]})}),(0,l.jsx)(G,{}),(0,l.jsx)(L,{userConfig:t,name:"runtime.default_auto_download"})]}),(0,l.jsxs)(H,{children:["When enabled, marimo will periodically save notebooks in your selected formats (HTML, IPYNB) to a folder named"," ",(0,l.jsx)(ae,{className:"inline",children:"__marimo__"})," next to your notebook file."]})]})})]}),(0,l.jsxs)(ze,{title:"Formatting",children:[(0,l.jsx)($,{control:h.control,name:"save.format_on_save",render:({field:p})=>(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(B,{className:"font-normal",children:"Format on save"}),(0,l.jsx)(V,{children:(0,l.jsx)(le,{"data-testid":"format-on-save-checkbox",checked:p.value,disabled:p.disabled,onCheckedChange:f=>{p.onChange(f)}})}),(0,l.jsx)(G,{}),(0,l.jsx)(L,{userConfig:t,name:"save.format_on_save"})]})}),(0,l.jsx)($,{control:h.control,name:"formatting.line_length",render:({field:p})=>(0,l.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(B,{children:"Line length"}),(0,l.jsx)(V,{children:(0,l.jsx)(yt,{"aria-label":"Line length","data-testid":"line-length-input",className:"m-0 w-24",...p,value:p.value,minValue:1,maxValue:1e3,onChange:f=>{p.onChange(f),Number.isNaN(f)||y(h.getValues())}})}),(0,l.jsx)(G,{}),(0,l.jsx)(L,{userConfig:t,name:"formatting.line_length"})]}),(0,l.jsx)(H,{children:"Maximum line length when formatting code."})]})})]}),(0,l.jsxs)(ze,{title:"Autocomplete",children:[(0,l.jsx)($,{control:h.control,name:"completion.activate_on_typing",render:({field:p})=>(0,l.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(B,{className:"font-normal",children:"Autocomplete"}),(0,l.jsx)(V,{children:(0,l.jsx)(le,{"data-testid":"autocomplete-checkbox",checked:p.value,disabled:p.disabled,onCheckedChange:f=>{p.onChange(!!f)}})}),(0,l.jsx)(G,{}),(0,l.jsx)(L,{userConfig:t,name:"completion.activate_on_typing"})]}),(0,l.jsx)(H,{children:"When unchecked, code completion is still available through a hotkey."}),(0,l.jsx)("div",{children:(0,l.jsx)(se,{variant:"link",className:"mb-0 px-0",type:"button",onClick:f=>{f.preventDefault(),f.stopPropagation(),c("ai")},children:"Edit AI autocomplete"})})]})}),(0,l.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(B,{className:"font-normal",children:"Accept suggestion on Enter"}),(0,l.jsx)(V,{children:(0,l.jsx)(le,{"data-testid":"accept-completion-on-enter-checkbox",checked:i,onCheckedChange:p=>n(!!p)})})]}),(0,l.jsx)(H,{children:"When unchecked, pressing Enter inserts a new line instead of accepting an autocomplete suggestion. Use Tab to accept suggestions."})]}),(0,l.jsx)($,{control:h.control,name:"completion.signature_hint_on_typing",render:({field:p})=>(0,l.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(B,{className:"font-normal",children:"Signature hints"}),(0,l.jsx)(V,{children:(0,l.jsx)(le,{"data-testid":"signature-hint-on-type-checkbox",checked:p.value??!1,disabled:p.disabled,onCheckedChange:f=>{p.onChange(!!f)}})}),(0,l.jsx)(G,{}),(0,l.jsx)(L,{userConfig:t,name:"completion.signature_hint_on_typing"})]}),(0,l.jsx)(H,{children:"Display signature hints while typing within function calls."})]})}),(0,l.jsx)($,{control:h.control,name:"completion.auto_close_pairs",render:({field:p})=>(0,l.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(B,{className:"font-normal",children:"Auto-close pairs"}),(0,l.jsx)(V,{children:(0,l.jsx)(le,{"data-testid":"auto-close-pairs-checkbox",checked:p.value??!0,disabled:p.disabled,onCheckedChange:f=>{p.onChange(!!f)}})}),(0,l.jsx)(G,{}),(0,l.jsx)(L,{userConfig:t,name:"completion.auto_close_pairs"})]}),(0,l.jsxs)(H,{children:["Automatically insert closing brackets"," ",(0,l.jsx)("code",{className:"text-xs",children:"()"}),","," ",(0,l.jsx)("code",{className:"text-xs",children:"[]"}),","," ",(0,l.jsx)("code",{className:"text-xs",children:"{}"}),", and quotes"," ",(0,l.jsx)("code",{className:"text-xs",children:'""'}),","," ",(0,l.jsx)("code",{className:"text-xs",children:"''"})," when opening one."]})]})})]}),(0,l.jsxs)(ze,{title:"Language Servers",children:[(0,l.jsxs)(H,{children:["See the"," ",(0,l.jsx)(re,{href:"https://docs.marimo.io/guides/editor_features/language_server/",children:"docs"})," ","for more information about language server support."]}),(0,l.jsxs)(H,{children:[(0,l.jsx)("strong",{children:"Note:"})," When using multiple language servers, different features may conflict."]}),(0,l.jsx)($,{control:h.control,name:"language_servers.pylsp.enabled",render:({field:p})=>(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,l.jsxs)(R,{className:O,children:[(0,l.jsxs)(B,{children:[(0,l.jsx)(bt,{variant:"defaultOutline",className:"mr-2",children:"Beta"}),"Python Language Server (",(0,l.jsx)(re,{href:"https://github.com/python-lsp/python-lsp-server",children:"docs"}),")"]}),(0,l.jsx)(V,{children:(0,l.jsx)(le,{"data-testid":"pylsp-checkbox",checked:p.value,disabled:p.disabled,onCheckedChange:f=>{p.onChange(!!f)}})}),(0,l.jsx)(G,{}),(0,l.jsx)(L,{userConfig:t,name:"language_servers.pylsp.enabled"})]}),p.value&&!o.pylsp&&(0,l.jsxs)(kt,{kind:"danger",children:["The Python Language Server is not available in your current environment. Please install"," ",(0,l.jsx)(ae,{className:"inline",children:"python-lsp-server"})," in your environment."]})]})}),(0,l.jsx)($,{control:h.control,name:"language_servers.basedpyright.enabled",render:({field:p})=>(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,l.jsxs)(R,{className:O,children:[(0,l.jsxs)(B,{children:[(0,l.jsx)(bt,{variant:"defaultOutline",className:"mr-2",children:"Beta"}),"basedpyright (",(0,l.jsx)(re,{href:"https://github.com/DetachHead/basedpyright",children:"docs"}),")"]}),(0,l.jsx)(V,{children:(0,l.jsx)(le,{"data-testid":"basedpyright-checkbox",checked:p.value,disabled:p.disabled,onCheckedChange:f=>{p.onChange(!!f)}})}),(0,l.jsx)(G,{}),(0,l.jsx)(L,{userConfig:t,name:"language_servers.basedpyright.enabled"})]}),p.value&&!o.basedpyright&&(0,l.jsxs)(kt,{kind:"danger",children:["basedpyright is not available in your current environment. Please install"," ",(0,l.jsx)(ae,{className:"inline",children:"basedpyright"})," in your environment."]})]})}),(0,l.jsx)($,{control:h.control,name:"language_servers.pyrefly.enabled",render:({field:p})=>(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,l.jsxs)(R,{className:O,children:[(0,l.jsxs)(B,{children:[(0,l.jsx)(bt,{variant:"defaultOutline",className:"mr-2",children:"Beta"}),"Pyrefly (",(0,l.jsx)(re,{href:"https://github.com/facebook/pyrefly",children:"docs"}),")"]}),(0,l.jsx)(V,{children:(0,l.jsx)(le,{"data-testid":"pyrefly-checkbox",checked:p.value,disabled:p.disabled,onCheckedChange:f=>{p.onChange(!!f)}})}),(0,l.jsx)(G,{}),(0,l.jsx)(L,{userConfig:t,name:"language_servers.pyrefly.enabled"})]}),p.value&&!o.pyrefly&&(0,l.jsxs)(kt,{kind:"danger",children:["Pyrefly is not available in your current environment. Please install ",(0,l.jsx)(ae,{className:"inline",children:"pyrefly"})," in your environment."]})]})}),(0,l.jsx)($,{control:h.control,name:"language_servers.ty.enabled",render:({field:p})=>(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,l.jsxs)(R,{className:O,children:[(0,l.jsxs)(B,{children:[(0,l.jsx)(bt,{variant:"defaultOutline",className:"mr-2",children:"Beta"}),"ty (",(0,l.jsx)(re,{href:"https://github.com/astral-sh/ty",children:"docs"}),")"]}),(0,l.jsx)(V,{children:(0,l.jsx)(le,{"data-testid":"ty-checkbox",checked:p.value,disabled:p.disabled,onCheckedChange:f=>{p.onChange(!!f)}})}),(0,l.jsx)(G,{}),(0,l.jsx)(L,{userConfig:t,name:"language_servers.ty.enabled"})]}),p.value&&!o.ty&&(0,l.jsxs)(kt,{kind:"danger",children:["ty is not available in your current environment. Please install ",(0,l.jsx)(ae,{className:"inline",children:"ty"})," in your environment."]})]})}),(0,l.jsx)($,{control:h.control,name:"diagnostics.enabled",render:({field:p})=>(0,l.jsxs)(R,{className:O,children:[(0,l.jsxs)(B,{children:[(0,l.jsx)(bt,{variant:"defaultOutline",className:"mr-2",children:"Beta"}),"Diagnostics"]}),(0,l.jsx)(V,{children:(0,l.jsx)(le,{"data-testid":"diagnostics-checkbox",checked:p.value,disabled:p.disabled,onCheckedChange:f=>{p.onChange(!!f)}})}),(0,l.jsx)(G,{}),(0,l.jsx)(L,{userConfig:t,name:"diagnostics.enabled"})]})})]}),(0,l.jsxs)(ze,{title:"Keymap",children:[(0,l.jsx)($,{control:h.control,name:"keymap.preset",render:({field:p})=>(0,l.jsx)("div",{className:"flex flex-col space-y-1",children:(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(B,{children:"Keymap"}),(0,l.jsx)(V,{children:(0,l.jsx)(Ke,{"data-testid":"keymap-select",onChange:f=>p.onChange(f.target.value),value:p.value,disabled:p.disabled,className:"inline-flex mr-2",children:Id.map(f=>(0,l.jsx)("option",{value:f,children:f},f))})}),(0,l.jsx)(G,{}),(0,l.jsx)(L,{userConfig:t,name:"keymap.preset"})]})})}),(0,l.jsx)($,{control:h.control,name:"keymap.destructive_delete",render:({field:p})=>(0,l.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(B,{className:"font-normal",children:"Destructive delete"}),(0,l.jsx)(V,{children:(0,l.jsx)(le,{"data-testid":"destructive-delete-checkbox",checked:p.value,disabled:p.disabled,onCheckedChange:f=>{p.onChange(!!f)}})}),(0,l.jsx)(G,{}),(0,l.jsx)(L,{userConfig:t,name:"keymap.destructive_delete"})]}),(0,l.jsxs)(H,{className:"flex items-center gap-1",children:["Allow deleting non-empty cells",(0,l.jsx)(qe,{content:(0,l.jsxs)("div",{className:"max-w-xs",children:[(0,l.jsx)("strong",{children:"Use with caution:"})," Deleting cells with code can lose work and computed results since variables are removed from memory."]}),children:(0,l.jsx)(pi,{className:"w-3 h-3 text-(--amber-11)"})})]}),(0,l.jsx)("div",{children:(0,l.jsx)(se,{variant:"link",className:"mb-0 px-0",type:"button",onClick:f=>{f.preventDefault(),f.stopPropagation(),a(!0)},children:"Edit Keyboard Shortcuts"})})]})})]})]});case"display":return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(ze,{title:"Display",children:[(0,l.jsx)($,{control:h.control,name:"display.default_width",render:({field:p})=>(0,l.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(B,{children:"Default width"}),(0,l.jsx)(V,{children:(0,l.jsx)(Ke,{"data-testid":"user-config-width-select",onChange:f=>p.onChange(f.target.value),value:p.value,disabled:p.disabled,className:"inline-flex mr-2",children:Js().map(f=>(0,l.jsx)("option",{value:f,children:f},f))})}),(0,l.jsx)(G,{}),(0,l.jsx)(L,{userConfig:t,name:"display.default_width"})]}),(0,l.jsx)(H,{children:'The default app width for new notebooks; overridden by "width" in the application config.'})]})}),(0,l.jsx)($,{control:h.control,name:"display.theme",render:({field:p})=>(0,l.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(B,{children:"Theme"}),(0,l.jsx)(V,{children:(0,l.jsx)(Ke,{"data-testid":"theme-select",onChange:f=>p.onChange(f.target.value),value:p.value,disabled:p.disabled,className:"inline-flex mr-2",children:xo.map(f=>(0,l.jsx)("option",{value:f,children:f},f))})}),(0,l.jsx)(G,{}),(0,l.jsx)(L,{userConfig:t,name:"display.theme"})]}),(0,l.jsx)(H,{children:"This theme will be applied to the user's configuration; it does not affect theme when sharing the notebook."})]})}),(0,l.jsx)($,{control:h.control,name:"display.code_editor_font_size",render:({field:p})=>(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(B,{children:"Code editor font size (px)"}),(0,l.jsx)(V,{children:(0,l.jsx)("span",{className:"inline-flex mr-2",children:(0,l.jsx)(yt,{"aria-label":"Code editor font size","data-testid":"code-editor-font-size-input",className:"m-0 w-24",...p,value:p.value,minValue:8,maxValue:32,onChange:f=>{p.onChange(f),y(h.getValues())}})})}),(0,l.jsx)(G,{}),(0,l.jsx)(L,{userConfig:t,name:"display.code_editor_font_size"})]})}),(0,l.jsx)($,{control:h.control,name:"display.locale",render:({field:p})=>(0,l.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(B,{children:"Locale"}),(0,l.jsx)(V,{children:(0,l.jsxs)(Ke,{"data-testid":"locale-select",onChange:f=>{f.target.value===Ri?p.onChange(void 0):p.onChange(f.target.value)},value:p.value||Ri,disabled:p.disabled,className:"inline-flex mr-2",children:[(0,l.jsx)("option",{value:Ri,children:"System"}),navigator.languages.map(f=>(0,l.jsx)("option",{value:f,children:f},f))]})}),(0,l.jsx)(G,{}),(0,l.jsx)(L,{userConfig:t,name:"display.locale"})]}),(0,l.jsxs)(H,{children:["The locale to use for the notebook. If your desired locale is not listed, you can change it manually via"," ",(0,l.jsx)(ae,{className:"inline",children:"marimo config show"}),"."]})]})}),(0,l.jsx)($,{control:h.control,name:"display.reference_highlighting",render:({field:p})=>(0,l.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(B,{children:"Reference highlighting"}),(0,l.jsx)(V,{children:(0,l.jsx)(le,{"data-testid":"reference-highlighting-checkbox",checked:p.value,onCheckedChange:p.onChange})}),(0,l.jsx)(G,{}),(0,l.jsx)(L,{userConfig:t,name:"display.reference_highlighting"})]}),(0,l.jsx)(H,{children:"Visually emphasizes variables in a cell that are defined elsewhere in the notebook."})]})})]}),(0,l.jsx)(ze,{title:"Outputs",children:(0,l.jsx)($,{control:h.control,name:"display.cell_output",render:({field:p})=>(0,l.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(B,{children:"Cell output area"}),(0,l.jsx)(V,{children:(0,l.jsx)(Ke,{"data-testid":"cell-output-select",onChange:f=>p.onChange(f.target.value),value:p.value,disabled:p.disabled,className:"inline-flex mr-2",children:["above","below"].map(f=>(0,l.jsx)("option",{value:f,children:f},f))})}),(0,l.jsx)(G,{}),(0,l.jsx)(L,{userConfig:t,name:"display.cell_output"})]}),(0,l.jsx)(H,{children:"Where to display cell's output."})]})})})]});case"packageManagementAndData":return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(ze,{title:"Package Management",children:(0,l.jsx)($,{control:h.control,disabled:j,name:"package_management.manager",render:({field:p})=>(0,l.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(B,{children:"Manager"}),(0,l.jsx)(V,{children:(0,l.jsx)(Ke,{"data-testid":"package-manager-select",onChange:f=>p.onChange(f.target.value),value:p.value,disabled:p.disabled,className:"inline-flex mr-2",children:sr.map(f=>(0,l.jsx)("option",{value:f,children:f},f))})}),(0,l.jsx)(G,{}),(0,l.jsx)(L,{userConfig:t,name:"package_management.manager"})]}),(0,l.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,l.jsx)(re,{href:"https://docs.marimo.io/guides/editor_features/package_management.html",children:"docs"}),".",(0,l.jsx)("br",{}),(0,l.jsx)("br",{}),"Running marimo in a"," ",(0,l.jsx)(re,{href:"https://docs.marimo.io/guides/package_management/inlining_dependencies.html",children:"sandboxed environment"})," ","is only supported by ",(0,l.jsx)(ae,{className:"inline",children:"uv"})]})]})})}),(0,l.jsx)(ze,{title:"Data",children:(0,l.jsx)(Zu,{form:h,config:t,onSubmit:y})})]});case"runtime":return(0,l.jsxs)(ze,{title:"Runtime configuration",children:[(0,l.jsx)($,{control:h.control,name:"runtime.auto_instantiate",render:({field:p})=>(0,l.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(B,{className:"font-normal",children:"Autorun on startup"}),(0,l.jsx)(V,{children:(0,l.jsx)(le,{"data-testid":"auto-instantiate-checkbox",disabled:p.disabled,checked:p.value,onCheckedChange:p.onChange})}),(0,l.jsx)(G,{}),(0,l.jsx)(L,{userConfig:t,name:"runtime.auto_instantiate"})]}),(0,l.jsx)(H,{children:"Whether to automatically run all cells on startup."})]})}),(0,l.jsx)($,{control:h.control,name:"runtime.on_cell_change",render:({field:p})=>(0,l.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(B,{className:"font-normal",children:"On cell change"}),(0,l.jsx)(V,{children:(0,l.jsx)(Ke,{"data-testid":"on-cell-change-select",onChange:f=>p.onChange(f.target.value),value:p.value,className:"inline-flex mr-2",children:["lazy","autorun"].map(f=>(0,l.jsx)("option",{value:f,children:f},f))})}),(0,l.jsx)(G,{}),(0,l.jsx)(L,{userConfig:t,name:"runtime.on_cell_change"})]}),(0,l.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,l.jsx)($,{control:h.control,name:"runtime.auto_reload",render:({field:p})=>(0,l.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(B,{className:"font-normal",children:"On module change"}),(0,l.jsx)(V,{children:(0,l.jsx)(Ke,{"data-testid":"auto-reload-select",onChange:f=>p.onChange(f.target.value),value:p.value,disabled:j,className:"inline-flex mr-2",children:["off","lazy","autorun"].map(f=>(0,l.jsx)("option",{value:f,children:f},f))})}),(0,l.jsx)(G,{}),(0,l.jsx)(L,{userConfig:t,name:"runtime.auto_reload"})]}),(0,l.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,l.jsx)($,{control:h.control,name:"runtime.reactive_tests",render:({field:p})=>(0,l.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(B,{className:"font-normal",children:"Autorun Unit Tests"}),(0,l.jsx)(V,{children:(0,l.jsx)(le,{"data-testid":"reactive-test-checkbox",checked:p.value,onCheckedChange:p.onChange})})]}),(0,l.jsx)(L,{userConfig:t,name:"runtime.reactive_tests"}),(0,l.jsx)(G,{}),(0,l.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,l.jsxs)(H,{children:["Learn more in the"," ",(0,l.jsx)(re,{href:"https://docs.marimo.io/guides/reactivity/#configuring-how-marimo-runs-cells",children:"docs"}),"."]})]});case"ai":return(0,l.jsx)(Lu,{form:h,config:t,onSubmit:y});case"optionalDeps":return(0,l.jsx)(a0,{});case"labs":return(0,l.jsxs)(ze,{title:"Experimental Features",children:[(0,l.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,l.jsx)($,{control:h.control,name:"experimental.rtc_v2",render:({field:p})=>(0,l.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(B,{className:"font-normal",children:"Real-Time Collaboration"}),(0,l.jsx)(V,{children:(0,l.jsx)(le,{"data-testid":"rtc-checkbox",checked:p.value===!0,onCheckedChange:p.onChange})})]}),(0,l.jsx)(H,{children:"Enable experimental real-time collaboration. This change requires a page refresh to take effect."})]})}),(0,l.jsx)($,{control:h.control,name:"experimental.external_agents",render:({field:p})=>(0,l.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(B,{className:"font-normal",children:"External Agents"}),(0,l.jsx)(V,{children:(0,l.jsx)(le,{"data-testid":"external-agents-checkbox",checked:p.value===!0,onCheckedChange:p.onChange})})]}),(0,l.jsx)(L,{userConfig:t,name:"experimental.external_agents"}),(0,l.jsxs)(H,{children:["Enable experimental external agents such as Claude Code and Gemini CLI. Learn more in the"," ",(0,l.jsx)(re,{href:"https://docs.marimo.io/guides/editor_features/agents/",children:"docs"}),"."]})]})})]})}},w=(0,l.jsxs)("p",{className:"text-muted-secondary",children:["User configuration is stored in ",(0,l.jsx)(ae,{className:"inline",children:"marimo.toml"}),(0,l.jsx)("br",{}),"Run ",(0,l.jsx)(ae,{className:"inline",children:"marimo config show"})," in your terminal to show your current configuration and file location."]});return(0,l.jsx)(po,{...h,children:(0,l.jsxs)("form",{ref:s,onChange:h.handleSubmit(p=>y(p)),className:"flex text-pretty overflow-hidden",children:[(0,l.jsx)(ll,{value:r,onValueChange:p=>c(p),orientation:"vertical",className:"w-1/3 border-r h-full overflow-auto p-3",children:(0,l.jsxs)(nl,{className:"self-start max-h-none flex flex-col gap-2 shrink-0 bg-background flex-1 min-h-full",children:[Sa.map(p=>(0,l.jsx)(ft,{value:p.id,className:"w-full text-left p-2 data-[state=active]:bg-primary data-[state=active]:text-primary-foreground justify-start",children:(0,l.jsxs)("div",{className:"flex gap-4 items-center text-lg overflow-hidden",children:[(0,l.jsx)("span",{className:Ee(p.className,"w-8 h-8 rounded flex items-center justify-center text-muted-foreground shrink-0"),children:(0,l.jsx)(p.Icon,{className:"w-4 h-4"})}),(0,l.jsx)("span",{className:"truncate",children:p.label})]})},p.id)),(0,l.jsxs)("div",{className:"p-2 text-xs text-muted-foreground self-start flex flex-col gap-1",children:[(0,l.jsxs)("span",{children:["Version: ",d]}),(0,l.jsxs)("span",{children:["Locale: ",u]})]}),(0,l.jsx)("div",{className:"flex-1"}),!dt()&&w]})}),(0,l.jsx)("div",{className:"w-2/3 pl-6 gap-2 flex flex-col overflow-auto p-6",children:C()})]})})};var m0=Se();const Na=nt("ai-features"),Ia=nt(!1);function $i(){let t=(0,m0.c)(4),e=Mt(_a),i=Mt(Ia),n=Mt(Na),s;return t[0]!==e||t[1]!==n||t[2]!==i?(s={handleClick:(a,r)=>{e(a),a==="ai"&&n(r??"ai-features"),i(!0)}},t[0]=e,t[1]=n,t[2]=i,t[3]=s):s=t[3],s}var Jt=Se();const Ka=t=>{var F,q,Y,S,W,ee,oe,ce,he,ue,ge,P,X,Z,Q,J,te,ie;let e=(0,Jt.c)(59),{value:i,placeholder:n,onSelect:s,triggerClassName:a,customDropdownContent:r,iconSize:c,showAddCustomModelDocs:o,forRole:d,displayIconOnly:u}=t,m=c===void 0?"medium":c,h=o===void 0?!1:o,x=u===void 0?!1:u,[y,j]=g.useState(!1),v=st(dr),_=st(rr),{saveModelChange:C}=Gs(),{handleClick:w}=$i(),p=_.copilot==="custom"?(F=v==null?void 0:v.models)==null?void 0:F.autocomplete_model:void 0,f,N,K,T,I,E,M,k,D;if(e[0]!==((q=v==null?void 0:v.models)==null?void 0:q.autocomplete_model)||e[1]!==((Y=v==null?void 0:v.models)==null?void 0:Y.chat_model)||e[2]!==((S=v==null?void 0:v.models)==null?void 0:S.custom_models)||e[3]!==((W=v==null?void 0:v.models)==null?void 0:W.displayed_models)||e[4]!==((ee=v==null?void 0:v.models)==null?void 0:ee.edit_model)||e[5]!==p||e[6]!==x||e[7]!==d||e[8]!==m||e[9]!==y||e[10]!==s||e[11]!==n||e[12]!==C||e[13]!==a||e[14]!==i){let fe=St.create({customModels:[...((oe=v==null?void 0:v.models)==null?void 0:oe.custom_models)??[],(ce=v==null?void 0:v.models)==null?void 0:ce.chat_model,p,(he=v==null?void 0:v.models)==null?void 0:he.edit_model].filter(Boolean),displayedModels:(ue=v==null?void 0:v.models)==null?void 0:ue.displayed_models}),me=fe.getListModelsByProvider(),de=d==="autocomplete"?(ge=v==null?void 0:v.models)==null?void 0:ge.autocomplete_model:d==="chat"?(P=v==null?void 0:v.models)==null?void 0:P.chat_model:d==="edit"?(X=v==null?void 0:v.models)==null?void 0:X.edit_model:void 0,ve=i?Me.parse(i):de?Me.parse(de):void 0,xe=m==="medium"?"h-4 w-4":"h-3 w-3",De=(we,_e)=>{let Pe=fe.getModel(we.id);return(0,l.jsxs)("div",{className:"flex items-center gap-2 w-full px-2 py-1",children:[(0,l.jsx)(Te,{provider:we.providerId,className:xe}),(0,l.jsxs)("div",{className:"flex flex-col",children:[(0,l.jsx)("span",{children:(Pe==null?void 0:Pe.name)||we.shortModelId}),(0,l.jsx)("span",{className:"text-xs text-muted-foreground",children:we.id})]}),(0,l.jsx)("div",{className:"ml-auto flex gap-1",children:(0,l.jsx)(qe,{content:fa(_e),children:(0,l.jsx)("span",{className:`text-xs px-1.5 py-0.5 rounded font-medium ${Qt(_e)}`,children:_e},_e)})})]})},ye;e[24]!==d||e[25]!==s||e[26]!==C?(ye=we=>{s?s(we):C(we,d),j(!1)},e[24]=d,e[25]=s,e[26]=C,e[27]=ye):ye=e[27];let be=ye;N=Ar,k=y,D=j;let je=`flex items-center justify-between px-2 py-0.5 border rounded-md
|
|
5
|
-
hover:bg-accent hover:text-accent-foreground ${a}`,Ae=ve?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Te,{provider:ve.providerId,className:xe}),x?null:(0,l.jsx)("span",{className:"truncate",children:Pi(ve.providerId)?ve.shortModelId:ve.id})]}):(0,l.jsx)("span",{className:"text-muted-foreground truncate",children:n}),
|
|
4
|
+
${Vo(i)}`),i;await new Promise(n=>setTimeout(n,this.options.retryDelayMs))}}async connect(){return await this.options.waitForReady(),this.tryConnect()}close(){var e;(e=this.delegate)==null||e.close(),this.delegate=void 0,this.needsReInitialization=!0}async sendData(e,i){if(!this.delegate){U.log("Copilot#sendData: Delegate not initialized, reconnecting...");try{await this.options.waitForReady(),await this.tryConnect()}catch(n){throw U.error("Copilot#sendData: Failed to reconnect transport",n),Error("Unable to connect to GitHub Copilot. Please check your settings and try again.",{cause:n})}if(this.needsReInitialization&&this.onReconnect){U.log("Copilot#sendData: Re-initializing LSP after reconnection...");try{await this.onReconnect(),this.needsReInitialization=!1}catch(n){throw this.close(),U.error("Copilot#sendData: LSP re-initialization after reconnection failed",n),n}}}if(!this.delegate)throw Error("Failed to initialize GitHub Copilot connection. Please try again.");return i??(i=this.options.maxTimeoutMs),this.delegate.sendData(e,i)}};const aa="/__marimo_copilot__.py";var ra=`file://${aa}`;const lu=Ze(()=>{let t=hr();return new iu({getWsUrl:()=>t.getLSPURL("copilot").toString(),waitForReady:async()=>{await Zd(),await pr()},showError:(e,i)=>{Re({variant:"danger",title:e,description:i})}})}),_t=Ze(()=>{var n,s;let t=((s=(n=it.get(ni).ai)==null?void 0:n.github)==null?void 0:s.copilot_settings)??{},e=lu(),i=new Jd({rootUri:ra,workspaceFolders:null,transport:e,copilotSettings:t});return e.onReconnect=()=>i.reInitialize(),i});function nu(){return Oa({documentUri:ra,client:_t(),languageId:"copilot",hoverEnabled:!1,completionEnabled:!1,definitionEnabled:!1,renameEnabled:!1,codeActionsEnabled:!1,signatureHelpEnabled:!1,diagnosticsEnabled:!1,sendIncrementalChanges:!1})}const oa=(0,g.memo)(()=>{let[t,e]=lt(la),[i,n]=lt(na),[s,a]=(0,g.useState)(),[r,c]=(0,g.useState)(!1),o=async m=>{m.preventDefault(),c(!0);try{let h=await au();if(!(h!=null&&h.verificationUri)||!h.userCode){U.error("Copilot#trySignIn: Invalid response from sign-in",{result:h}),n("connectionError"),Re({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:y,userCode:j}=h;ua(y)?e(!0):(n("signingIn"),a({url:x,code:j}))}catch(h){U.error("Copilot#trySignIn: Error during sign-in",h),n("connectionError"),Re({title:"GitHub Copilot Connection Error",description:h instanceof Error?h.message:"Unable to connect to GitHub Copilot. Please check your settings and try again.",variant:"danger"})}finally{c(!1)}},d=async m=>{if(m.preventDefault(),s){c(!0);try{let h=await ru(s.code);h.success?(e(!0),n("signedIn")):h.error==="connection"?(n("connectionError"),Re({title:"GitHub Copilot Connection Error",description:"Lost connection during sign-in. Please try again.",variant:"danger",action:(0,l.jsx)(ae,{onClick:o,children:"Retry"})})):n("signInFailed")}finally{c(!1)}}},u=async m=>{m.preventDefault(),await cu(),e(!1),n("signedOut")};return(()=>{switch(i??(t?"signedIn":"connecting")){case"connecting":return(0,l.jsx)(Oe,{className:"font-normal flex",children:"Connecting..."});case"signedOut":return(0,l.jsx)(ae,{onClick:o,size:"xs",variant:"link",children:"Sign in to GitHub Copilot"});case"signingIn":return(0,l.jsxs)("ol",{className:"ml-4 text-sm list-decimal [&>li]:mt-2",children:[(0,l.jsx)("li",{children:(0,l.jsxs)("div",{className:"flex items-center",children:["Copy this code:",(0,l.jsx)("strong",{className:"ml-2",children:s==null?void 0:s.code}),(0,l.jsx)(eo,{className:"ml-2 cursor-pointer opacity-60 hover:opacity-100 h-3 w-3",onClick:async()=>{s&&(await vo(s.code),Re({description:"Copied to clipboard"}))}})]})}),(0,l.jsxs)("li",{children:["Enter the code at this link:",(0,l.jsx)("a",{href:s==null?void 0:s.url,target:"_blank",rel:"noreferrer",className:Er({variant:"link",size:"xs"}),children:s==null?void 0:s.url})]}),(0,l.jsxs)("li",{children:["Click here when done:",(0,l.jsxs)(ae,{size:"xs",onClick:d,className:"ml-1",children:[r&&(0,l.jsx)(Tt,{className:"h-3 w-3 mr-1 animate-spin"}),"Done"]})]})]});case"signInFailed":return(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,l.jsx)("div",{className:"text-destructive text-sm",children:"Sign in failed. Please try again."}),r?(0,l.jsx)(Tt,{className:"h-3 w-3 mr-1 animate-spin"}):(0,l.jsx)(ae,{onClick:o,size:"xs",variant:"link",children:"Connect to GitHub Copilot"})]});case"signedIn":return(0,l.jsxs)("div",{className:"flex items-center gap-5",children:[(0,l.jsxs)(Oe,{className:"font-normal flex items-center",children:[(0,l.jsx)("div",{className:"inline-flex items-center justify-center bg-(--grass-7) rounded-full p-1 mr-2",children:(0,l.jsx)(Qr,{className:"h-3 w-3 text-white"})}),"Connected"]}),(0,l.jsx)(ae,{onClick:u,size:"xs",variant:"text",children:"Disconnect"})]});case"connectionError":return(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,l.jsxs)(Oe,{className:"font-normal flex",children:[(0,l.jsx)(oi,{className:"h-4 w-4 mr-1"}),"Connection Error"]}),(0,l.jsx)("div",{className:"text-sm",children:"Unable to connect to GitHub Copilot."}),(0,l.jsx)(ae,{onClick:o,size:"xs",variant:"link",children:"Retry Connection"})]});case"notConnected":return(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,l.jsxs)(Oe,{className:"font-normal flex",children:[(0,l.jsx)(oi,{className:"h-4 w-4 mr-1"}),"Unable to connect"]}),(0,l.jsxs)("div",{className:"text-sm",children:["For troubleshooting, see the"," ",(0,l.jsx)(oe,{href:"https://docs.marimo.io/getting_started/index.html#github-copilot",children:"docs"}),"."]})]})}})()});oa.displayName="CopilotConfig";var ca=5,su=3e3;async function au(){return await _t().signInInitiate()}async function ru(t){let e=_t();try{U.log("Copilot#tryFinishSignIn: Attempting to confirm sign-in");let{status:i}=await e.signInConfirm({userCode:t});return ua(i)?(U.log("Copilot#tryFinishSignIn: Sign-in confirmed successfully"),{success:!0}):(U.warn("Copilot#tryFinishSignIn: Sign-in confirmation returned unexpected status",{status:i}),{success:!1})}catch(i){return da(i)?(U.error("Copilot#tryFinishSignIn: Connection error during sign-in",i),{success:!1,error:"connection"}):await ou(e)}}async function ou(t){for(let e=0;e<ca;e++)try{if(await new Promise(i=>setTimeout(i,su)),await t.signedIn())return U.log("Copilot#tryFinishSignIn: Successfully signed in after retry"),{success:!0}}catch(i){if(U.warn("Copilot#tryFinishSignIn: Retry attempt failed",{attempt:e+1,maxRetries:ca}),da(i))return{success:!1,error:"connection"}}return U.error("Copilot#tryFinishSignIn: All sign-in attempts failed"),{success:!1}}async function cu(){await _t().signOut()}function da(t){return t instanceof Error&&(t.message.includes("ECONNREFUSED")||t.message.includes("WebSocket")||t.message.includes("network"))}function ua(t){return t==="SignedIn"||t==="AlreadySignedIn"||t==="OK"}var ma="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",du="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",uu="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",mu="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",pa="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",pu="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",ha="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",ga="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",hu="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",gu="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eWeights%20&%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",fu="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=",xu=Se(),fa={openai:ha,anthropic:ma,claude:ma,gemini:pa,google:pa,codex:ha,ollama:pu,azure:Wo,bedrock:qo,deepseek:uu,github:mu,openrouter:hu,wandb:gu,"opencode-go":ga,marimo:fu,opencode:ga,cursor:du};const Te=t=>{let e=(0,xu.c)(15),i,n,s;e[0]===t?(i=e[1],n=e[2],s=e[3]):({provider:n,className:s,...i}=t,e[0]=t,e[1]=i,e[2]=n,e[3]=s);let a=s===void 0?"":s;if(n==="openai-compatible"||!(n in fa)){let d;e[4]===a?d=e[5]:(d=Ee("h-4 w-4",a),e[4]=a,e[5]=d);let u;return e[6]===d?u=e[7]:(u=(0,l.jsx)(ii,{className:d}),e[6]=d,e[7]=u),u}let r=fa[n],c;e[8]===a?c=e[9]:(c=Ee("h-4 w-4 grayscale dark:invert",a),e[8]=a,e[9]=c);let o;return e[10]!==r||e[11]!==i||e[12]!==n||e[13]!==c?(o=(0,l.jsx)("img",{src:r,alt:n,className:c,...i}),e[10]=r,e[11]=i,e[12]=n,e[13]=c,e[14]=o):o=e[14],o};function Qt(t){switch(t){case"chat":return"bg-[var(--purple-3)] text-[var(--purple-11)]";case"autocomplete":return"bg-[var(--green-3)] text-[var(--green-11)]";case"edit":return"bg-[var(--blue-3)] text-[var(--blue-11)]";case"thinking":return"bg-[var(--purple-4)] text-[var(--purple-12)]"}return"bg-[var(--mauve-3)] text-[var(--mauve-11)]"}function xa(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 Zt=Se();const O="flex flex-row items-center space-x-1 space-y-0",yu=t=>{let e=(0,Zt.c)(2),{children:i}=t,n;return e[0]===i?n=e[1]:(n=(0,l.jsx)("div",{className:"text-md font-semibold text-muted-foreground uppercase tracking-wide mb-1",children:i}),e[0]=i,e[1]=n),n},pt=t=>{let e=(0,Zt.c)(10),i,n,s;e[0]===t?(i=e[1],n=e[2],s=e[3]):({children:i,className:n,...s}=t,e[0]=t,e[1]=i,e[2]=n,e[3]=s);let a;e[4]===n?a=e[5]:(a=Ee("text-base font-semibold underline-offset-2 text-accent-foreground uppercase tracking-wide",n),e[4]=n,e[5]=a);let r;return e[6]!==i||e[7]!==s||e[8]!==a?(r=(0,l.jsx)("div",{...s,className:a,children:i}),e[6]=i,e[7]=s,e[8]=a,e[9]=r):r=e[9],r},vu=t=>{let e=(0,Zt.c)(2),{children:i}=t,n;return e[0]===i?n=e[1]:(n=(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:i}),e[0]=i,e[1]=n),n},ze=t=>{let e=(0,Zt.c)(5),{title:i,children:n}=t,s;e[0]===i?s=e[1]:(s=(0,l.jsx)(pt,{children:i}),e[0]=i,e[1]=s);let a;return e[2]!==n||e[3]!==s?(a=(0,l.jsxs)("div",{className:"flex flex-col gap-4 pb-4",children:[s,n]}),e[2]=n,e[3]=s,e[4]=a):a=e[4],a},ya=[{label:"Auto (Default)",value:"auto"},{label:"Native",value:"native"},{label:"Polars",value:"polars"},{label:"Lazy Polars",value:"lazy-polars"},{label:"Pandas",value:"pandas"}],bu="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 ju=Se();const va=t=>{let e=(0,ju.c)(12),{value:i,includeSuggestion:n}=t,s=n===void 0?!0:n;if(!i||i.includes("/"))return null;let a;e[0]===i?a=e[1]:(a=Me.parse(i),e[0]=i,e[1]=a);let r=a.id,c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=(0,l.jsx)("code",{className:"font-bold",children:"provider/model"}),e[2]=c):c=e[2];let o;e[3]===i?o=e[4]:(o=(0,l.jsxs)("span",{children:["Model id should be in the form"," ",c,". ",i," is missing a provider."]}),e[3]=i,e[4]=o);let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=(0,l.jsx)("br",{}),e[5]=d):d=e[5];let u;e[6]!==s||e[7]!==r?(u=s&&r&&(0,l.jsxs)("span",{children:["Did you mean ",(0,l.jsx)("code",{className:"font-bold",children:r}),"?"]}),e[6]=s,e[7]=r,e[8]=u):u=e[8];let m;return e[9]!==o||e[10]!==u?(m=(0,l.jsxs)(kt,{kind:"danger",className:"mt-1",children:[o,d,u]}),e[9]=o,e[10]=u,e[11]=m):m=e[11],m};var Bi=Se();function ba(t,e){let i=(0,Bi.c)(10),n;i[0]!==e||i[1]!==t?(n=Zi(t,e),i[0]=e,i[1]=t,i[2]=n):n=i[2];let s=n,a=st(dr),r;i[3]!==e||i[4]!==a?(r=Zi(a,e),i[3]=e,i[4]=a,i[5]=r):r=i[5];let c=r,o=c!=null&&s!==c,d;return i[6]!==s||i[7]!==o||i[8]!==c?(d={isOverridden:o,currentValue:s,overriddenValue:c},i[6]=s,i[7]=o,i[8]=c,i[9]=d):d=i[9],d}const ku=t=>{let e=(0,Bi.c)(3),{name:i,children:n}=t,[s]=el(),{isOverridden:a}=ba(s,i),r;return e[0]!==n||e[1]!==a?(r=a?(0,l.jsx)(qe,{delayDuration:200,content:(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,l.jsxs)("p",{children:["This setting is overridden by the"," ",(0,l.jsx)(re,{className:"inline mx-px",children:"pyproject.toml"})," config."]}),(0,l.jsxs)("p",{children:["To change it, edit the project config"," ",(0,l.jsx)(re,{className:"inline mx-px",children:"pyproject.toml"}),"directly."]})]}),children:(0,l.jsx)("div",{className:"text-muted-foreground opacity-80 cursor-not-allowed *:pointer-events-none",children:n})}):n,e[0]=n,e[1]=a,e[2]=r):r=e[2],r},L=t=>{let e=(0,Bi.c)(18),{userConfig:i,name:n}=t,{isOverridden:s,currentValue:a,overriddenValue:r}=ba(i,n);if(!s)return null;let c,o;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=(0,l.jsxs)("span",{children:["This setting is overridden by"," ",(0,l.jsx)(re,{className:"inline",children:"pyproject.toml"}),"."]}),o=(0,l.jsx)("br",{}),e[0]=c,e[1]=o):(c=e[0],o=e[1]);let d,u;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=(0,l.jsxs)("span",{children:["Edit the ",(0,l.jsx)(re,{className:"inline",children:"pyproject.toml"})," file directly to change this setting."]}),u=(0,l.jsx)("br",{}),e[2]=d,e[3]=u):(d=e[2],u=e[3]);let m=String(a),h;e[4]===m?h=e[5]:(h=(0,l.jsxs)("span",{children:["User value: ",(0,l.jsx)("strong",{children:m})]}),e[4]=m,e[5]=h);let x;e[6]===Symbol.for("react.memo_cache_sentinel")?(x=(0,l.jsx)("br",{}),e[6]=x):x=e[6];let y=String(r),j;e[7]===y?j=e[8]:(j=(0,l.jsxs)("span",{children:["Project value: ",(0,l.jsx)("strong",{children:y})]}),e[7]=y,e[8]=j);let v;e[9]!==h||e[10]!==j?(v=(0,l.jsxs)(l.Fragment,{children:[c,o,d,u,h,x,j]}),e[9]=h,e[10]=j,e[11]=v):v=e[11];let _;e[12]===Symbol.for("react.memo_cache_sentinel")?(_=(0,l.jsx)(zl,{className:"w-3 h-3"}),e[12]=_):_=e[12];let C=String(r),w;e[13]===C?w=e[14]:(w=(0,l.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:[_,"Overridden by pyproject.toml [",C,"]"]}),e[13]=C,e[14]=w);let p;return e[15]!==v||e[16]!==w?(p=(0,l.jsx)(qe,{content:v,children:w}),e[15]=v,e[16]=w,e[17]=p):p=e[17],p};var wu=Se();function ja(){let t=(0,wu.c)(1),e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=[],t[0]=e):e=t[0],Al(Cu,e)}async function Cu(){return si.get("/ai/mcp/status")}function Su(){let[t,e]=(0,g.useState)(!1);return{refresh:async()=>{e(!0);try{await si.post("/ai/mcp/refresh",{}),Re({title:"MCP refreshed",description:"MCP server configuration has been refreshed successfully"})}catch(i){Re({title:"Refresh failed",description:i instanceof Error?i.message:"Failed to refresh MCP",variant:"danger"})}finally{e(!1)}},isRefreshing:t}}var ka=Se();const _u=()=>{let t=(0,ka.c)(27),{data:e,refetch:i,isFetching:n}=ja(),s;t[0]===i?s=t[1]:(s=async()=>{try{await si.post("/ai/mcp/refresh",{}),Re({title:"MCP refreshed",description:"MCP server configuration has been refreshed"}),i()}catch(p){let f=p;Re({title:"Refresh failed",description:f instanceof Error?f.message:"Failed to refresh MCP",variant:"danger"})}},t[0]=i,t[1]=s);let a=s,r;t[2]===(e==null?void 0:e.servers)?r=t[3]:(r=(e==null?void 0:e.servers)||{},t[2]=e==null?void 0:e.servers,t[3]=r);let c=r,o=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",m=(e==null?void 0:e.status)==="error"&&o&&"text-red-500",h;t[4]!==d||t[5]!==u||t[6]!==m?(h=Ee("h-4 w-4",d,u,m),t[4]=d,t[5]=u,t[6]=m,t[7]=h):h=t[7];let x;t[8]===h?x=t[9]:(x=(0,l.jsx)(qe,{content:"MCP Status",children:(0,l.jsx)(kr,{asChild:!0,children:(0,l.jsx)(ae,{variant:"text",size:"icon",children:(0,l.jsx)(Bl,{className:h})})})}),t[8]=h,t[9]=x);let y;t[10]===Symbol.for("react.memo_cache_sentinel")?(y=(0,l.jsx)("h4",{className:"font-medium text-sm",children:"MCP Server Status"}),t[10]=y):y=t[10];let j;t[11]===n?j=t[12]:(j=n?(0,l.jsx)(Tt,{className:"h-3 w-3 animate-spin"}):(0,l.jsx)(fl,{className:"h-3 w-3"}),t[11]=n,t[12]=j);let v;t[13]!==a||t[14]!==n||t[15]!==j?(v=(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[y,(0,l.jsx)(ae,{variant:"ghost",size:"xs",onClick:a,disabled:n,children:j})]}),t[13]=a,t[14]=n,t[15]=j,t[16]=v):v=t[16];let _;t[17]!==o||t[18]!==c||t[19]!==e?(_=e&&(0,l.jsxs)("div",{className:"text-xs space-y-2",children:[o&&(0,l.jsxs)("div",{className:"flex justify-between items-center",children:[(0,l.jsx)("span",{className:"text-muted-foreground",children:"Overall:"}),(0,l.jsx)(Xt,{status:e.status})]}),e.error&&(0,l.jsx)("div",{className:"text-xs text-red-500 bg-red-50 dark:bg-red-950/20 p-2 rounded",children:e.error}),o&&(0,l.jsxs)("div",{className:"space-y-1",children:[(0,l.jsx)("div",{className:"text-muted-foreground font-medium",children:"Servers:"}),Object.entries(c).map(Nu)]}),!o&&(0,l.jsxs)("div",{className:"text-muted-foreground text-center py-2",children:["No MCP servers configured. ",(0,l.jsx)("br",{})," Configure under"," ",(0,l.jsx)("b",{children:"Settings > AI > MCP"})]})]}),t[17]=o,t[18]=c,t[19]=e,t[20]=_):_=t[20];let C;t[21]!==_||t[22]!==v?(C=(0,l.jsx)(wr,{className:"w-[320px]",align:"start",side:"right",children:(0,l.jsxs)("div",{className:"space-y-3",children:[v,_]})}),t[21]=_,t[22]=v,t[23]=C):C=t[23];let w;return t[24]!==C||t[25]!==x?(w=(0,l.jsxs)(Cr,{children:[x,C]}),t[24]=C,t[25]=x,t[26]=w):w=t[26],w},Xt=t=>{let e=(0,ka.c)(11),{status:i}=t,n=i==="ok"&&"text-green-500",s=i==="partial"&&"text-yellow-500",a=i==="error"&&"text-red-500",r=i==="failed"&&"text-red-500",c=i==="disconnected"&&"text-gray-500",o=i==="pending"&&"text-yellow-500",d=i==="connected"&&"text-green-500",u;e[0]!==n||e[1]!==s||e[2]!==a||e[3]!==r||e[4]!==c||e[5]!==o||e[6]!==d?(u=Ee("text-xs font-medium",n,s,a,r,c,o,d),e[0]=n,e[1]=s,e[2]=a,e[3]=r,e[4]=c,e[5]=o,e[6]=d,e[7]=u):u=e[7];let m;return e[8]!==i||e[9]!==u?(m=(0,l.jsx)("span",{className:u,children:i}),e[8]=i,e[9]=u,e[10]=m):m=e[10],m};function Nu(t){let[e,i]=t;return(0,l.jsxs)("div",{className:"flex justify-between items-center pl-2",children:[(0,l.jsx)("span",{className:"text-muted-foreground truncate max-w-[180px]",children:e}),(0,l.jsx)(Xt,{status:i})]},e)}var Iu=Se(),Ku=[{id:"marimo",title:"marimo (docs)",description:"Access marimo documentation"},{id:"context7",title:"Context7",description:"Connect to Context7 MCP server"}];const Mu=t=>{let e=(0,Iu.c)(36),{form:i,onSubmit:n}=t,{handleClick:s}=Vi(),{data:a,refetch:r,isFetching:c}=ja(),{refresh:o,isRefreshing:d}=Su(),u;e[0]!==r||e[1]!==o?(u=async()=>{await o(),r()},e[0]=r,e[1]=o,e[2]=u):u=e[2];let m=u,h;e[3]===Symbol.for("react.memo_cache_sentinel")?(h=(0,l.jsx)(pt,{children:"MCP Servers"}),e[3]=h):h=e[3];let x;e[4]===a?x=e[5]:(x=a&&(0,l.jsx)(Xt,{status:a.status}),e[4]=a,e[5]=x);let y=d||c,j;e[6]!==c||e[7]!==d?(j=d||c?(0,l.jsx)(Tt,{className:"h-3 w-3 animate-spin"}):(0,l.jsx)(fl,{className:"h-3 w-3"}),e[6]=c,e[7]=d,e[8]=j):j=e[8];let v;e[9]!==m||e[10]!==y||e[11]!==j?(v=(0,l.jsx)(ae,{variant:"outline",size:"xs",onClick:m,disabled:y,children:j}),e[9]=m,e[10]=y,e[11]=j,e[12]=v):v=e[12];let _;e[13]!==x||e[14]!==v?(_=(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[h,(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[x,v]})]}),e[13]=x,e[14]=v,e[15]=_):_=e[15];let C;e[16]===a?C=e[17]:(C=(a==null?void 0:a.error)&&(0,l.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]=C);let w;e[18]===a?w=e[19]:(w=(a==null?void 0:a.servers)&&(0,l.jsx)("div",{className:"text-xs text-muted-foreground",children:Object.entries(a.servers).map(Du)}),e[18]=a,e[19]=w);let p;e[20]===Symbol.for("react.memo_cache_sentinel")?(p=(0,l.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]=p):p=e[20];let f;e[21]===Symbol.for("react.memo_cache_sentinel")?(f=(0,l.jsx)(re,{className:"inline",children:"marimo[mcp]"}),e[21]=f):f=e[21];let N;e[22]===s?N=e[23]:(N=(0,l.jsxs)("p",{className:"text-sm text-muted-foreground",children:["This feature requires the ",f," ","package. See"," ",(0,l.jsx)(ae,{variant:"link",onClick:()=>s("optionalDeps"),size:"xs",children:"Optional Features"})," ","for more details."]}),e[22]=s,e[23]=N);let K;e[24]!==i||e[25]!==n?(K=E=>{let{field:M}=E,k=M.value||[],D=b=>{let A=k.includes(b)?k.filter(z=>z!==b):[...k,b];M.onChange(A),n(i.getValues())};return(0,l.jsx)(R,{children:(0,l.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:Ku.map(b=>{let A=k.includes(b.id);return(0,l.jsxs)(Jo,{className:`cursor-pointer transition-all ${A?"border-[var(--blue-9)] bg-[var(--blue-2)]":"hover:border-[var(--blue-7)]"}`,onClick:()=>D(b.id),children:[(0,l.jsx)(Qo,{children:(0,l.jsxs)("div",{className:"flex items-start justify-between",children:[(0,l.jsx)(Yo,{className:"text-base",children:b.title}),(0,l.jsx)("span",{className:`h-5 w-5 flex items-center justify-center rounded border ${A?"border-[var(--blue-7)] bg-[var(--blue-7)] text-foreground":"border-muted bg-background text-muted-foreground"}`,children:A?(0,l.jsx)(sc,{}):null})]})}),(0,l.jsx)(Zo,{children:(0,l.jsx)(Xo,{children:b.description})})]},b.id)})})})},e[24]=i,e[25]=n,e[26]=K):K=e[26];let T;e[27]!==i.control||e[28]!==K?(T=(0,l.jsx)($,{control:i.control,name:"mcp.presets",render:K}),e[27]=i.control,e[28]=K,e[29]=T):T=e[29];let I;return e[30]!==N||e[31]!==T||e[32]!==_||e[33]!==C||e[34]!==w?(I=(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[_,C,w,p,N,T]}),e[30]=N,e[31]=T,e[32]=_,e[33]=C,e[34]=w,e[35]=I):I=e[35],I};function Du(t){let[e,i]=t;return(0,l.jsxs)("div",{children:[e,": ",(0,l.jsx)(Xt,{status:i})]},e)}var Ce=Se();const Au=t=>{let e=(0,Ce.c)(5),{provider:i,children:n}=t,s;e[0]===i?s=e[1]:(s=i&&(0,l.jsx)(Te,{provider:i,className:"mr-2"}),e[0]=i,e[1]=s);let a;return e[2]!==n||e[3]!==s?(a=(0,l.jsxs)("div",{className:"flex items-center text-base font-semibold",children:[s,n]}),e[2]=n,e[3]=s,e[4]=a):a=e[4],a},Ve=t=>{let e=(0,Ce.c)(11),{form:i,config:n,name:s,placeholder:a,testId:r,description:c,onChange:o}=t,d;e[0]!==n||e[1]!==c||e[2]!==s||e[3]!==o||e[4]!==a||e[5]!==r?(d=m=>{let{field:h}=m;return(0,l.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(F,{children:"API Key"}),(0,l.jsx)(V,{children:(0,l.jsx)(Fe,{"data-testid":r,rootClassName:"flex-1",className:"m-0 inline-flex h-7",placeholder:a,type:"password",...h,value:Nt(h.value),onChange:x=>{let y=x.target.value;y.includes("*")||(h.onChange(y),o==null||o(y))}})}),(0,l.jsx)(G,{}),(0,l.jsx)(L,{userConfig:n,name:s})]}),c&&(0,l.jsx)(H,{children:c})]})},e[0]=n,e[1]=c,e[2]=s,e[3]=o,e[4]=a,e[5]=r,e[6]=d):d=e[6];let u;return e[7]!==i.control||e[8]!==s||e[9]!==d?(u=(0,l.jsx)($,{control:i.control,name:s,render:d}),e[7]=i.control,e[8]=s,e[9]=d,e[10]=u):u=e[10],u};function Nt(t){return t==null?"":typeof t=="string"?t:String(t)}const Ye=t=>{let e=(0,Ce.c)(12),{form:i,config:n,name:s,placeholder:a,testId:r,description:c,disabled:o,onChange:d}=t,u=o===void 0?!1:o,m;e[0]!==n||e[1]!==c||e[2]!==u||e[3]!==s||e[4]!==d||e[5]!==a||e[6]!==r?(m=x=>{let{field:y}=x;return(0,l.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(F,{children:"Base URL"}),(0,l.jsx)(V,{children:(0,l.jsx)(Fe,{"data-testid":r,rootClassName:"flex-1",className:"m-0 inline-flex h-7",placeholder:a,...y,value:Nt(y.value),disabled:u,onChange:j=>{y.onChange(j.target.value),d==null||d(j.target.value)}})}),(0,l.jsx)(G,{}),(0,l.jsx)(L,{userConfig:n,name:s})]}),c&&(0,l.jsx)(H,{children:c})]})},e[0]=n,e[1]=c,e[2]=u,e[3]=s,e[4]=d,e[5]=a,e[6]=r,e[7]=m):m=e[7];let h;return e[8]!==i.control||e[9]!==s||e[10]!==m?(h=(0,l.jsx)($,{control:i.control,name:s,render:m}),e[8]=i.control,e[9]=s,e[10]=m,e[11]=h):h=e[11],h},Fi=t=>{let e=(0,Ce.c)(13),{form:i,config:n,name:s,placeholder:a,description:r,label:c,forRole:o,onSubmit:d}=t,u;e[0]!==n||e[1]!==r||e[2]!==o||e[3]!==i||e[4]!==c||e[5]!==s||e[6]!==d||e[7]!==a?(u=h=>{let{field:x}=h,y=Nt(x.value),j=v=>{x.onChange(v),d(i.getValues())};return(0,l.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(F,{children:c}),(0,l.jsx)(V,{children:(0,l.jsx)(Ma,{value:y,placeholder:a,onSelect:j,triggerClassName:"text-sm",customDropdownContent:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Et,{}),(0,l.jsxs)("p",{className:"px-2 py-1.5 text-sm text-muted-secondary flex items-center gap-1",children:["Enter a custom model",(0,l.jsx)(qe,{content:"Models should include the provider prefix, e.g. 'openai/gpt-4o'",children:(0,l.jsx)(Ua,{className:"h-3 w-3"})})]}),(0,l.jsxs)("div",{className:"px-2 py-1",children:[(0,l.jsx)(Fe,{className:"w-full border-border shadow-none focus-visible:shadow-xs",placeholder:a,...x,value:Nt(x.value),onKeyDown:cl.stopPropagation()}),y&&(0,l.jsx)(va,{value:y,includeSuggestion:!1})]})]}),forRole:o})}),(0,l.jsx)(G,{})]}),(0,l.jsx)(L,{userConfig:n,name:s}),(0,l.jsx)(va,{value:y}),r&&(0,l.jsx)(H,{children:r})]})},e[0]=n,e[1]=r,e[2]=o,e[3]=i,e[4]=c,e[5]=s,e[6]=d,e[7]=a,e[8]=u):u=e[8];let m;return e[9]!==i.control||e[10]!==s||e[11]!==u?(m=(0,l.jsx)($,{control:i.control,name:s,render:u}),e[9]=i.control,e[10]=s,e[11]=u,e[12]=m):m=e[12],m},Pu=t=>{let e=(0,Ce.c)(10),{form:i,config:n,name:s,options:a,testId:r,disabled:c}=t,o=c===void 0?!1:c,d;e[0]!==n||e[1]!==o||e[2]!==s||e[3]!==a||e[4]!==r?(d=m=>{let{field:h}=m;return(0,l.jsx)("div",{className:"flex flex-col space-y-1",children:(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(F,{children:"Provider"}),(0,l.jsx)(V,{children:(0,l.jsx)(Ke,{"data-testid":r,onChange:x=>{x.target.value==="none"?h.onChange(!1):h.onChange(x.target.value)},value:Nt(h.value===!0?"github":h.value===!1?"none":h.value),disabled:o,className:"inline-flex mr-2",children:a.map(Hu)})}),(0,l.jsx)(G,{}),(0,l.jsx)(L,{userConfig:n,name:s})]})})},e[0]=n,e[1]=o,e[2]=s,e[3]=a,e[4]=r,e[5]=d):d=e[5];let u;return e[6]!==i.control||e[7]!==s||e[8]!==d?(u=(0,l.jsx)($,{control:i.control,name:s,render:d}),e[6]=i.control,e[7]=s,e[8]=d,e[9]=u):u=e[9],u};var Eu=({form:t,config:e,onSubmit:i})=>{let n=t.getValues("completion.copilot");if(n===!1)return null;if(n==="codeium")return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("p",{className:"text-sm text-muted-secondary",children:["To get a Windsurf API key, follow"," ",(0,l.jsx)(oe,{href:"https://docs.marimo.io/guides/editor_features/ai_completion.html#windsurf-copilot",children:"these instructions"}),"."]}),(0,l.jsx)(Ve,{form:t,config:e,name:"completion.codeium_api_key",placeholder:"key",testId:"codeium-api-key-input"})]});if(n==="github")return(0,l.jsx)(oa,{});if(n==="custom")return(0,l.jsx)(Fi,{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"})},It=t=>{let e=(0,Ce.c)(5),{children:i,className:n}=t,s;e[0]===n?s=e[1]:(s=Ee("flex flex-col gap-4 pb-4",n),e[0]=n,e[1]=s);let a;return e[2]!==i||e[3]!==s?(a=(0,l.jsx)("div",{className:s,children:i}),e[2]=i,e[3]=s,e[4]=a):a=e[4],a},Tu=t=>{let e=(0,Ce.c)(23),{qualifiedId:i,model:n,isEnabled:s,onToggle:a,onDelete:r}=t,c;e[0]!==a||e[1]!==i?(c=()=>{a(i)},e[0]=a,e[1]=i,e[2]=c):c=e[2];let o=c,d;e[3]!==r||e[4]!==i?(d=v=>{v.stopPropagation(),v.preventDefault(),r(i)},e[3]=r,e[4]=i,e[5]=d):d=e[5];let u=d,m;e[6]===n?m=e[7]:(m=(0,l.jsx)(zu,{model:n}),e[6]=n,e[7]=m);let h;e[8]!==u||e[9]!==n.custom?(h=n.custom&&(0,l.jsx)(ae,{variant:"ghost",size:"icon",onClick:u,className:"mr-2 hover:bg-transparent",children:(0,l.jsx)(jl,{className:"h-3.5 w-3.5 text-muted-foreground"})}),e[8]=u,e[9]=n.custom,e[10]=h):h=e[10];let x;e[11]!==o||e[12]!==s?(x=(0,l.jsx)(fr,{checked:s,onClick:o,size:"sm"}),e[11]=o,e[12]=s,e[13]=x):x=e[13];let y;e[14]!==m||e[15]!==h||e[16]!==x?(y=(0,l.jsx)(Vs,{children:(0,l.jsxs)("div",{className:"flex items-center justify-between px-3 py-2.5 border-b last:border-b-0 cursor-pointer outline-none",children:[m,h,x]})}),e[14]=m,e[15]=h,e[16]=x,e[17]=y):y=e[17];let j;return e[18]!==o||e[19]!==n.name||e[20]!==i||e[21]!==y?(j=(0,l.jsx)(Gs,{id:i,textValue:n.name,className:"pl-6 outline-none data-focused:bg-muted/50 hover:bg-muted/50",onAction:o,children:y}),e[18]=o,e[19]=n.name,e[20]=i,e[21]=y,e[22]=j):j=e[22],j},zu=t=>{let e=(0,Ce.c)(18),{model:i}=t,n;e[0]===i.name?n=e[1]:(n=(0,l.jsx)("h3",{className:"font-medium text-sm",children:i.name}),e[0]=i.name,e[1]=n);let s;e[2]===i.custom?s=e[3]:(s=i.custom&&(0,l.jsx)(ii,{className:"h-4 w-4"}),e[2]=i.custom,e[3]=s);let a;e[4]===s?a=e[5]:(a=(0,l.jsx)(qe,{content:"Custom model",children:s}),e[4]=s,e[5]=a);let r;e[6]===i.capabilities?r=e[7]:(r=i.capabilities.includes("thinking")&&(0,l.jsxs)("div",{className:Ee("flex items-center gap-1 rounded px-1 py-0.5 w-fit",Qt("thinking")),children:[(0,l.jsx)(vi,{className:"h-3 w-3"}),(0,l.jsx)("span",{className:"text-xs font-medium",children:"Reasoning"})]}),e[6]=i.capabilities,e[7]=r);let c;e[8]!==n||e[9]!==a||e[10]!==r?(c=(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[n,a,r]}),e[8]=n,e[9]=a,e[10]=r,e[11]=c):c=e[11];let o;e[12]!==i.custom||e[13]!==i.description?(o=i.description&&!i.custom&&(0,l.jsx)("p",{className:"text-sm text-muted-foreground line-clamp-2",children:i.description}),e[12]=i.custom,e[13]=i.description,e[14]=o):o=e[14];let d;return e[15]!==c||e[16]!==o?(d=(0,l.jsxs)("div",{className:"flex flex-col flex-1 gap-0.5",children:[c,o]}),e[15]=c,e[16]=o,e[17]=d):d=e[17],d};const Bu=t=>{let e=(0,Ce.c)(13),{form:i,config:n,onSubmit:s}=t,a,r;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=(0,l.jsx)(pt,{children:"Code Completion"}),r=(0,l.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[0]=a,e[1]=r):(a=e[0],r=e[1]);let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=["none","github","codeium","custom"],e[2]=c):c=e[2];let o;e[3]!==n||e[4]!==i?(o=(0,l.jsx)(Pu,{form:i,config:n,name:"completion.copilot",options:c,testId:"copilot-select"}),e[3]=n,e[4]=i,e[5]=o):o=e[5];let d;e[6]!==n||e[7]!==i||e[8]!==s?(d=Eu({form:i,config:n,onSubmit:s}),e[6]=n,e[7]=i,e[8]=s,e[9]=d):d=e[9];let u;return e[10]!==o||e[11]!==d?(u=(0,l.jsxs)(It,{children:[a,r,o,d]}),e[10]=o,e[11]=d,e[12]=u):u=e[12],u};var Be=t=>{let e=(0,Ce.c)(15),{title:i,triggerClassName:n,provider:s,children:a,isConfigured:r,value:c}=t,o=c??s,d;e[0]===r?d=e[1]:(d=r&&(0,l.jsx)("span",{className:"ml-2 px-1 rounded bg-muted text-xs font-medium border",children:"Configured"}),e[0]=r,e[1]=d);let u;e[2]!==s||e[3]!==d||e[4]!==i?(u=(0,l.jsxs)(Au,{provider:s,children:[i,d]}),e[2]=s,e[3]=d,e[4]=i,e[5]=u):u=e[5];let m;e[6]!==u||e[7]!==n?(m=(0,l.jsx)(yr,{className:n,children:u}),e[6]=u,e[7]=n,e[8]=m):m=e[8];let h;e[9]===a?h=e[10]:(h=(0,l.jsx)(br,{wrapperClassName:"flex flex-col gap-4",children:a}),e[9]=a,e[10]=h);let x;return e[11]!==o||e[12]!==m||e[13]!==h?(x=(0,l.jsxs)(vr,{value:o,children:[m,h]}),e[11]=o,e[12]=m,e[13]=h,e[14]=x):x=e[14],x};const Fu=({form:t,config:e,onSubmit:i})=>{let[n,s]=(0,g.useState)(!1),[a,r]=(0,g.useState)(""),[c,o]=(0,g.useState)(""),[d,u]=(0,g.useState)(""),m=(0,g.useId)(),h=(0,g.useId)(),x=(0,g.useId)(),y=a.toLowerCase().replaceAll(/\s+/g,"_"),j=t.watch("ai.custom_providers"),v=qt.includes(y)||j&&Object.keys(j).includes(y),_=y.includes("."),C=y.trim()&&d.trim()&&!v&&!_,w=()=>{r(""),o(""),u(""),s(!1)};return(0,l.jsx)($,{control:t.control,name:"ai.custom_providers",render:({field:p})=>{let f=p.value||{},N=Object.entries(f),K=()=>{C&&(p.onChange({...f,[y]:{api_key:c||void 0,base_url:d}}),i(t.getValues()),w())},T=k=>{let{[k]:D,...b}=f;t.resetField("ai.custom_providers"),t.setValue("ai.custom_providers",b,{shouldDirty:!0}),i(t.getValues())},I=(0,l.jsxs)("div",{className:"flex flex-col gap-3 p-4 border border-border rounded-md bg-muted/20",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,l.jsx)(Oe,{htmlFor:m,children:"Provider Name"}),(0,l.jsx)(Fe,{id:m,placeholder:"e.g., together, groq, mistral",value:a,onChange:k=>r(k.target.value)}),v&&(0,l.jsx)("p",{className:"text-xs text-destructive",children:"A provider with this name already exists."}),_&&(0,l.jsx)("p",{className:"text-xs text-destructive",children:"Provider names cannot contain '.' characters."}),a&&!_&&(0,l.jsxs)("p",{className:"text-xs text-muted-secondary",children:["Use models with prefix:"," ",(0,l.jsxs)(re,{className:"inline text-xs",children:[y,"/"]})]})]}),(0,l.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,l.jsxs)(Oe,{htmlFor:x,children:["Base URL ",(0,l.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,l.jsx)(Fe,{id:x,placeholder:"e.g., https://api.together.xyz/v1",value:d,onChange:k=>u(k.target.value)})]}),(0,l.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,l.jsx)(Oe,{htmlFor:h,children:"API Key (optional)"}),(0,l.jsx)(Fe,{id:h,placeholder:"sk-...",type:"password",value:c,onChange:k=>o(k.target.value)})]}),(0,l.jsxs)("div",{className:"flex gap-2 mt-1",children:[(0,l.jsx)(ae,{onClick:K,disabled:!C,size:"xs",children:"Add Provider"}),(0,l.jsx)(ae,{variant:"outline",onClick:w,size:"xs",children:"Cancel"})]})]}),E=k=>{p.onChange({...f,[k.providerName]:{...f[k.providerName],[k.fieldName]:k.value||void 0}})},M=({providerName:k,providerConfig:D,onRemove:b})=>{let A=ri.startCase(k),z=!!D.api_key||!!D.base_url;return(0,l.jsxs)(Be,{title:A,provider:k,value:`custom-${k}`,isConfigured:z,children:[(0,l.jsx)(Ve,{form:t,config:e,name:`ai.custom_providers.${k}.api_key`,placeholder:"sk-...",testId:`custom-provider-${k}-api-key`,onChange:B=>E({providerName:k,fieldName:"api_key",value:B})}),(0,l.jsx)(Ye,{form:t,config:e,name:`ai.custom_providers.${k}.base_url`,placeholder:"https://api.example.com/v1",testId:`custom-provider-${k}-base-url`,onChange:B=>E({providerName:k,fieldName:"base_url",value:B})}),(0,l.jsxs)(ae,{variant:"destructive",size:"xs",onClick:B=>{B.stopPropagation(),B.preventDefault(),b(k)},className:"w-fit self-end",children:[(0,l.jsx)(jl,{className:"h-4 w-4 mr-2"}),"Remove Provider"]})]},`custom-${k}`)};return(0,l.jsxs)(It,{children:[(0,l.jsx)(pt,{children:"Custom Providers"}),(0,l.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."}),N.length>0&&(0,l.jsx)(il,{type:"multiple",className:"-mt-4",children:N.map(([k,D])=>M({providerName:k,providerConfig:D,onRemove:T}))}),n?I:(0,l.jsx)(wa,{className:"self-start",isFormOpen:n,setIsFormOpen:s,label:"Add Provider"})]})}})},Ru=t=>{let e=(0,Ce.c)(127),{form:i,config:n,onSubmit:s}=t,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=dt(),e[0]=a):a=e[0];let r=a,c;e[1]===i?c=e[2]:(c=ht=>!!i.getValues(ht),e[1]=i,e[2]=c);let o=c,d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=(0,l.jsx)(re,{className:"inline",children:"marimo.toml"}),e[3]=d):d=e[3];let u;e[4]===Symbol.for("react.memo_cache_sentinel")?(u=(0,l.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,l.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 m=o("ai.open_ai.api_key"),h;e[5]===Symbol.for("react.memo_cache_sentinel")?(h=(0,l.jsxs)(l.Fragment,{children:["Your OpenAI API key from"," ",(0,l.jsx)(oe,{href:"https://platform.openai.com/account/api-keys",children:"platform.openai.com"}),"."]}),e[5]=h):h=e[5];let x,y;e[6]!==n||e[7]!==i?(x=(0,l.jsx)(Ve,{form:i,config:n,name:"ai.open_ai.api_key",placeholder:"sk-proj...",testId:"ai-openai-api-key-input",description:h}),y=(0,l.jsx)(Ye,{form:i,config:n,name:"ai.open_ai.base_url",placeholder:"https://api.openai.com/v1",testId:"ai-base-url-input",disabled:r}),e[6]=n,e[7]=i,e[8]=x,e[9]=y):(x=e[8],y=e[9]);let j;e[10]!==m||e[11]!==x||e[12]!==y?(j=(0,l.jsxs)(Be,{title:"OpenAI",provider:"openai",triggerClassName:"pt-0",isConfigured:m,children:[x,y]}),e[10]=m,e[11]=x,e[12]=y,e[13]=j):j=e[13];let v=o("ai.anthropic.api_key"),_;e[14]===Symbol.for("react.memo_cache_sentinel")?(_=(0,l.jsxs)(l.Fragment,{children:["Your Anthropic API key from"," ",(0,l.jsx)(oe,{href:"https://console.anthropic.com/settings/keys",children:"console.anthropic.com"}),"."]}),e[14]=_):_=e[14];let C;e[15]!==n||e[16]!==i?(C=(0,l.jsx)(Ve,{form:i,config:n,name:"ai.anthropic.api_key",placeholder:"sk-ant...",testId:"ai-anthropic-api-key-input",description:_}),e[15]=n,e[16]=i,e[17]=C):C=e[17];let w;e[18]!==v||e[19]!==C?(w=(0,l.jsx)(Be,{title:"Anthropic",provider:"anthropic",isConfigured:v,children:C}),e[18]=v,e[19]=C,e[20]=w):w=e[20];let p=o("ai.google.api_key"),f;e[21]===Symbol.for("react.memo_cache_sentinel")?(f=(0,l.jsxs)(l.Fragment,{children:["Your Google AI API key from"," ",(0,l.jsx)(oe,{href:"https://aistudio.google.com/app/apikey",children:"aistudio.google.com"}),"."]}),e[21]=f):f=e[21];let N;e[22]!==n||e[23]!==i?(N=(0,l.jsx)(Ve,{form:i,config:n,name:"ai.google.api_key",placeholder:"AI...",testId:"ai-google-api-key-input",description:f}),e[22]=n,e[23]=i,e[24]=N):N=e[24];let K;e[25]!==p||e[26]!==N?(K=(0,l.jsx)(Be,{title:"Google",provider:"google",isConfigured:p,children:N}),e[25]=p,e[26]=N,e[27]=K):K=e[27];let T=o("ai.ollama.base_url"),I;e[28]!==n||e[29]!==i?(I=(0,l.jsx)(Ye,{form:i,config:n,name:"ai.ollama.base_url",placeholder:"http://localhost:11434/v1",testId:"ollama-base-url-input"}),e[28]=n,e[29]=i,e[30]=I):I=e[30];let E;e[31]!==T||e[32]!==I?(E=(0,l.jsx)(Be,{title:"Ollama",provider:"ollama",isConfigured:T,children:I}),e[31]=T,e[32]=I,e[33]=E):E=e[33];let M=o("ai.github.api_key"),k;e[34]===Symbol.for("react.memo_cache_sentinel")?(k=(0,l.jsx)(Dl,{variant:"warning",className:"py-1.5 px-3 text-xs",children:(0,l.jsxs)(Ml,{children:["Free tier models have low token limits which can cause errors with larger prompts."," ",(0,l.jsx)(oe,{href:"https://docs.github.com/en/github-models/prototyping-with-ai-models#rate-limits",children:"Learn more"})]})}),e[34]=k):k=e[34];let D;e[35]===Symbol.for("react.memo_cache_sentinel")?(D=(0,l.jsxs)(l.Fragment,{children:["Your GitHub API token from"," ",(0,l.jsx)(re,{className:"inline",children:"gh auth token"}),"."]}),e[35]=D):D=e[35];let b,A;e[36]!==n||e[37]!==i?(b=(0,l.jsx)(Ve,{form:i,config:n,name:"ai.github.api_key",placeholder:"gho_...",testId:"ai-github-api-key-input",description:D}),A=(0,l.jsx)(Ye,{form:i,config:n,name:"ai.github.base_url",placeholder:"https://models.github.ai/inference",testId:"ai-github-base-url-input"}),e[36]=n,e[37]=i,e[38]=b,e[39]=A):(b=e[38],A=e[39]);let z;e[40]!==M||e[41]!==b||e[42]!==A?(z=(0,l.jsxs)(Be,{title:"GitHub",provider:"github",isConfigured:M,children:[k,b,A]}),e[40]=M,e[41]=b,e[42]=A,e[43]=z):z=e[43];let B=o("ai.openrouter.api_key"),q;e[44]===Symbol.for("react.memo_cache_sentinel")?(q=(0,l.jsxs)(l.Fragment,{children:["Your OpenRouter API key from ","",(0,l.jsx)(oe,{href:"https://openrouter.ai/keys",children:"openrouter.ai"}),"."]}),e[44]=q):q=e[44];let Y,S;e[45]!==n||e[46]!==i?(Y=(0,l.jsx)(Ve,{form:i,config:n,name:"ai.openrouter.api_key",placeholder:"or-...",testId:"ai-openrouter-api-key-input",description:q}),S=(0,l.jsx)(Ye,{form:i,config:n,name:"ai.openrouter.base_url",placeholder:"https://openrouter.ai/api/v1/",testId:"ai-openrouter-base-url-input"}),e[45]=n,e[46]=i,e[47]=Y,e[48]=S):(Y=e[47],S=e[48]);let W;e[49]!==B||e[50]!==Y||e[51]!==S?(W=(0,l.jsxs)(Be,{title:"OpenRouter",provider:"openrouter",isConfigured:B,children:[Y,S]}),e[49]=B,e[50]=Y,e[51]=S,e[52]=W):W=e[52];let te=o("ai.wandb.api_key"),ce;e[53]===Symbol.for("react.memo_cache_sentinel")?(ce=(0,l.jsxs)(l.Fragment,{children:["Your Weights & Biases API key from"," ",(0,l.jsx)(oe,{href:"https://wandb.ai/authorize",children:"wandb.ai"}),"."]}),e[53]=ce):ce=e[53];let de,he;e[54]!==n||e[55]!==i?(de=(0,l.jsx)(Ve,{form:i,config:n,name:"ai.wandb.api_key",placeholder:"your-wandb-api-key",testId:"ai-wandb-api-key-input",description:ce}),he=(0,l.jsx)(Ye,{form:i,config:n,name:"ai.wandb.base_url",placeholder:"https://api.inference.wandb.ai/v1/",testId:"ai-wandb-base-url-input"}),e[54]=n,e[55]=i,e[56]=de,e[57]=he):(de=e[56],he=e[57]);let me;e[58]!==te||e[59]!==de||e[60]!==he?(me=(0,l.jsxs)(Be,{title:"Weights & Biases",provider:"wandb",isConfigured:te,children:[de,he]}),e[58]=te,e[59]=de,e[60]=he,e[61]=me):me=e[61];let ge=o("ai.opencode_go.api_key"),P;e[62]===Symbol.for("react.memo_cache_sentinel")?(P=(0,l.jsxs)(l.Fragment,{children:["Your OpenCode API key from"," ",(0,l.jsx)(oe,{href:"https://opencode.ai/auth",children:"opencode.ai"}),". OpenCode Go is a low-cost subscription for open coding models."]}),e[62]=P):P=e[62];let X,Z;e[63]!==n||e[64]!==i?(X=(0,l.jsx)(Ve,{form:i,config:n,name:"ai.opencode_go.api_key",placeholder:"your-opencode-api-key",testId:"ai-opencode-go-api-key-input",description:P}),Z=(0,l.jsx)(Ye,{form:i,config:n,name:"ai.opencode_go.base_url",placeholder:"https://opencode.ai/zen/go/v1/",testId:"ai-opencode-go-base-url-input"}),e[63]=n,e[64]=i,e[65]=X,e[66]=Z):(X=e[65],Z=e[66]);let Q;e[67]!==ge||e[68]!==X||e[69]!==Z?(Q=(0,l.jsxs)(Be,{title:"OpenCode Go",provider:"opencode-go",isConfigured:ge,children:[X,Z]}),e[67]=ge,e[68]=X,e[69]=Z,e[70]=Q):Q=e[70];let J=o("ai.azure.api_key")&&o("ai.azure.base_url"),ie;e[71]===Symbol.for("react.memo_cache_sentinel")?(ie=(0,l.jsxs)(l.Fragment,{children:["Your Azure API key from"," ",(0,l.jsx)(oe,{href:"https://portal.azure.com/",children:"portal.azure.com"}),"."]}),e[71]=ie):ie=e[71];let le,fe;e[72]!==n||e[73]!==i?(le=(0,l.jsx)(Ve,{form:i,config:n,name:"ai.azure.api_key",placeholder:"sk-proj...",testId:"ai-azure-api-key-input",description:ie}),fe=(0,l.jsx)(Ye,{form:i,config:n,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]=n,e[73]=i,e[74]=le,e[75]=fe):(le=e[74],fe=e[75]);let pe;e[76]!==J||e[77]!==le||e[78]!==fe?(pe=(0,l.jsxs)(Be,{title:"Azure",provider:"azure",isConfigured:J,children:[le,fe]}),e[76]=J,e[77]=le,e[78]=fe,e[79]=pe):pe=e[79];let ue=o("ai.bedrock.region_name"),ve;e[80]===Symbol.for("react.memo_cache_sentinel")?(ve=(0,l.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,l.jsx)(oe,{href:"https://docs.marimo.io/guides/editor_features/ai_completion.html#aws-bedrock",children:"documentation"})," ","for more details."]}),e[80]=ve):ve=e[80];let xe;e[81]===n?xe=e[82]:(xe=ht=>{let{field:tt}=ht;return(0,l.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(F,{children:"AWS Region"}),(0,l.jsx)(V,{children:(0,l.jsx)(Ke,{"data-testid":"bedrock-region-select",onChange:Pa=>tt.onChange(Pa.target.value),value:typeof tt.value=="string"?tt.value:"us-east-1",disabled:tt.disabled,className:"inline-flex mr-2",children:bu.map(Uu)})}),(0,l.jsx)(G,{}),(0,l.jsx)(L,{userConfig:n,name:"ai.bedrock.region_name"})]}),(0,l.jsx)(H,{children:"The AWS region where Bedrock service is available."})]})},e[81]=n,e[82]=xe);let De;e[83]!==i.control||e[84]!==xe?(De=(0,l.jsx)($,{control:i.control,disabled:r,name:"ai.bedrock.region_name",render:xe}),e[83]=i.control,e[84]=xe,e[85]=De):De=e[85];let ye;e[86]===n?ye=e[87]:(ye=ht=>{let{field:tt}=ht;return(0,l.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(F,{children:"AWS Profile Name (Optional)"}),(0,l.jsx)(V,{children:(0,l.jsx)(Fe,{"data-testid":"bedrock-profile-input",rootClassName:"flex-1",className:"m-0 inline-flex h-7",placeholder:"default",...tt,value:tt.value||""})}),(0,l.jsx)(G,{}),(0,l.jsx)(L,{userConfig:n,name:"ai.bedrock.profile_name"})]}),(0,l.jsx)(H,{children:"The AWS profile name from your ~/.aws/credentials file. Leave blank to use your default AWS credentials."})]})},e[86]=n,e[87]=ye);let be;e[88]!==i.control||e[89]!==ye?(be=(0,l.jsx)($,{control:i.control,disabled:r,name:"ai.bedrock.profile_name",render:ye}),e[88]=i.control,e[89]=ye,e[90]=be):be=e[90];let je;e[91]!==ue||e[92]!==De||e[93]!==be?(je=(0,l.jsxs)(Be,{title:"AWS Bedrock",provider:"bedrock",isConfigured:ue,children:[ve,De,be]}),e[91]=ue,e[92]=De,e[93]=be,e[94]=je):je=e[94];let Ae=o("ai.open_ai_compatible.api_key")&&o("ai.open_ai_compatible.base_url"),se;e[95]===Symbol.for("react.memo_cache_sentinel")?(se=(0,l.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[95]=se):se=e[95];let Qe;e[96]===Symbol.for("react.memo_cache_sentinel")?(Qe=(0,l.jsx)(l.Fragment,{children:"API key for any OpenAI-compatible provider (e.g., Together, Groq, Mistral, Perplexity, etc)."}),e[96]=Qe):Qe=e[96];let Ie;e[97]!==n||e[98]!==i?(Ie=(0,l.jsx)(Ve,{form:i,config:n,name:"ai.open_ai_compatible.api_key",placeholder:"sk-...",testId:"ai-openai-compatible-api-key-input",description:Qe}),e[97]=n,e[98]=i,e[99]=Ie):Ie=e[99];let Ue;e[100]===Symbol.for("react.memo_cache_sentinel")?(Ue=(0,l.jsx)(l.Fragment,{children:"Base URL for your OpenAI-compatible provider."}),e[100]=Ue):Ue=e[100];let we;e[101]!==n||e[102]!==i?(we=(0,l.jsx)(Ye,{form:i,config:n,name:"ai.open_ai_compatible.base_url",placeholder:"https://api.together.xyz/v1",testId:"ai-openai-compatible-base-url-input",description:Ue}),e[101]=n,e[102]=i,e[103]=we):we=e[103];let _e;e[104]!==Ae||e[105]!==Ie||e[106]!==we?(_e=(0,l.jsxs)(Be,{title:"OpenAI-Compatible (Legacy)",provider:"openai-compatible",isConfigured:Ae,children:[se,Ie,we]}),e[104]=Ae,e[105]=Ie,e[106]=we,e[107]=_e):_e=e[107];let Pe;e[108]!==w||e[109]!==K||e[110]!==E||e[111]!==z||e[112]!==W||e[113]!==me||e[114]!==Q||e[115]!==pe||e[116]!==je||e[117]!==_e||e[118]!==j?(Pe=(0,l.jsxs)(il,{type:"multiple",children:[j,w,K,E,z,W,me,Q,pe,je,_e]}),e[108]=w,e[109]=K,e[110]=E,e[111]=z,e[112]=W,e[113]=me,e[114]=Q,e[115]=pe,e[116]=je,e[117]=_e,e[118]=j,e[119]=Pe):Pe=e[119];let ct;e[120]!==n||e[121]!==i||e[122]!==s?(ct=(0,l.jsx)(Fu,{form:i,config:n,onSubmit:s}),e[120]=n,e[121]=i,e[122]=s,e[123]=ct):ct=e[123];let Kt;return e[124]!==Pe||e[125]!==ct?(Kt=(0,l.jsxs)(It,{children:[u,Pe,ct]}),e[124]=Pe,e[125]=ct,e[126]=Kt):Kt=e[126],Kt},$u=t=>{var w;let e=(0,Ce.c)(32),{form:i,config:n,onSubmit:s}=t,[a,r]=(0,g.useState)(((w=n.ai)==null?void 0:w.max_tokens)!=null),c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=(0,l.jsx)(pt,{children:"AI Assistant"}),e[0]=c):c=e[0];let o;e[1]===i.control?o=e[2]:(o=(0,l.jsx)($,{control:i.control,name:"ai.inline_tooltip",render:qu}),e[1]=i.control,e[2]=o);let d;e[3]!==i||e[4]!==a||e[5]!==s?(d=p=>{let{field:f}=p;return(0,l.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,l.jsxs)("div",{className:"flex items-center gap-x-2",children:[(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(F,{className:"font-normal",children:"Max output tokens"}),(0,l.jsx)(V,{children:(0,l.jsx)(Fe,{"data-testid":"ai-max-tokens-input",type:"number",min:1,disabled:!a,className:"w-28 h-6",value:f.value??(a?"":32768),onChange:N=>{let K=Number.parseInt(N.target.value,10);f.onChange(Number.isFinite(K)&&K>0?K:null)}})})]}),(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(ne,{"data-testid":"ai-max-tokens-checkbox",checked:a,onCheckedChange:N=>{let K=N===!0;r(K);let T=K?f.value??32768:null;i.setValue("ai.max_tokens",T,{shouldDirty:!0,shouldTouch:!0}),s(i.getValues())}}),(0,l.jsx)(F,{className:"font-normal",children:"Override"})]})]}),(0,l.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,l.jsx)($,{control:i.control,name:"ai.max_tokens",render:d}),e[7]=i.control,e[8]=d,e[9]=u):u=e[9];let m;e[10]===Symbol.for("react.memo_cache_sentinel")?(m=(0,l.jsx)(xo,{}),e[10]=m):m=e[10];let h;e[11]===Symbol.for("react.memo_cache_sentinel")?(h=(0,l.jsx)("span",{children:"Model to use for chat conversations in the Chat panel."}),e[11]=h):h=e[11];let x;e[12]!==n||e[13]!==i||e[14]!==s?(x=(0,l.jsx)(Fi,{label:"Chat Model",form:i,config:n,name:"ai.models.chat_model",placeholder:Ji,description:h,forRole:"chat",onSubmit:s}),e[12]=n,e[13]=i,e[14]=s,e[15]=x):x=e[15];let y;e[16]===Symbol.for("react.memo_cache_sentinel")?(y=(0,l.jsxs)("span",{children:["Model to use for code editing with the"," ",(0,l.jsx)(re,{className:"inline",children:"Generate with AI"})," button."]}),e[16]=y):y=e[16];let j;e[17]!==n||e[18]!==i||e[19]!==s?(j=(0,l.jsx)(Fi,{label:"Edit Model",form:i,config:n,name:"ai.models.edit_model",placeholder:Ji,description:y,forRole:"edit",onSubmit:s}),e[17]=n,e[18]=i,e[19]=s,e[20]=j):j=e[20];let v;e[21]===n?v=e[22]:(v=p=>{let{field:f}=p;return(0,l.jsxs)("div",{className:"flex flex-col",children:[(0,l.jsxs)(R,{children:[(0,l.jsx)(F,{children:"Custom Rules"}),(0,l.jsx)(V,{children:(0,l.jsx)(fo,{"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",...f,value:f.value})}),(0,l.jsx)(G,{}),(0,l.jsx)(L,{userConfig:n,name:"ai.rules"})]}),(0,l.jsx)(H,{children:"Custom rules to include in all AI completion prompts."})]})},e[21]=n,e[22]=v);let _;e[23]!==i.control||e[24]!==v?(_=(0,l.jsx)($,{control:i.control,name:"ai.rules",render:v}),e[23]=i.control,e[24]=v,e[25]=_):_=e[25];let C;return e[26]!==_||e[27]!==o||e[28]!==u||e[29]!==x||e[30]!==j?(C=(0,l.jsxs)(It,{children:[c,o,u,m,x,j,_]}),e[26]=_,e[27]=o,e[28]=u,e[29]=x,e[30]=j,e[31]=C):C=e[31],C};var Vu=t=>{let e=(0,Ce.c)(51),{providerId:i,models:n,enabledModels:s,onToggleModel:a,onToggleProvider:r,onDeleteModel:c}=t,o;if(e[0]!==s||e[1]!==n||e[2]!==i){let k;e[4]!==s||e[5]!==i?(k=D=>s.has(new Me(i,D.model).id),e[4]=s,e[5]=i,e[6]=k):k=e[6],o=n.filter(k),e[0]=s,e[1]=n,e[2]=i,e[3]=o}else o=e[3];let d=o.length,u=n.length,m;e[7]===i?m=e[8]:(m=St.getProviderInfo(i),e[7]=i,e[8]=m);let h=m,x;e[9]!==(h==null?void 0:h.name)||e[10]!==i?(x=(h==null?void 0:h.name)||ri.startCase(i),e[9]=h==null?void 0:h.name,e[10]=i,e[11]=x):x=e[11];let y=x,j=d===0?!1:d===u?!0:"indeterminate",v;e[12]!==d||e[13]!==r||e[14]!==i||e[15]!==u?(v=()=>{r(i,d<u/2)},e[12]=d,e[13]=r,e[14]=i,e[15]=u,e[16]=v):v=e[16];let _=Dt(v),C;e[17]===Symbol.for("react.memo_cache_sentinel")?(C=cl.stopPropagation(),e[17]=C):C=e[17];let w;e[18]!==j||e[19]!==_?(w=(0,l.jsx)(ne,{checked:j,onCheckedChange:_,onClick:C}),e[18]=j,e[19]=_,e[20]=w):w=e[20];let p;e[21]===i?p=e[22]:(p=(0,l.jsx)(Te,{provider:i,className:"h-5 w-5"}),e[21]=i,e[22]=p);let f;e[23]===y?f=e[24]:(f=(0,l.jsx)("h2",{className:"font-semibold",children:y}),e[23]=y,e[24]=f);let N;e[25]!==d||e[26]!==u?(N=(0,l.jsxs)("p",{className:"text-sm text-muted-secondary",children:[d,"/",u," models"]}),e[25]=d,e[26]=u,e[27]=N):N=e[27];let K;e[28]!==f||e[29]!==N?(K=(0,l.jsxs)("div",{className:"flex items-center justify-between w-full",children:[f,N]}),e[28]=f,e[29]=N,e[30]=K):K=e[30];let T;e[31]===Symbol.for("react.memo_cache_sentinel")?(T=(0,l.jsx)(ao,{slot:"chevron",children:(0,l.jsx)(Xr,{className:"h-4 w-4 text-muted-foreground shrink-0 transition-transform duration-200 group-data-expanded:rotate-90"})}),e[31]=T):T=e[31];let I;e[32]!==K||e[33]!==w||e[34]!==p?(I=(0,l.jsx)(Vs,{children:(0,l.jsxs)("div",{className:"flex items-center gap-3 px-2 py-3 hover:bg-muted/50 cursor-pointer outline-none focus-visible:outline-none border-b group-data-expanded:border-b-0 rounded-sm",children:[w,p,K,T]})}),e[32]=K,e[33]=w,e[34]=p,e[35]=I):I=e[35];let E;if(e[36]!==s||e[37]!==n||e[38]!==c||e[39]!==a||e[40]!==i){let k;e[42]!==s||e[43]!==c||e[44]!==a||e[45]!==i?(k=D=>{let b=new Me(i,D.model).id;return(0,l.jsx)(Tu,{qualifiedId:b,model:D,isEnabled:s.has(b),onToggle:a,onDelete:c},b)},e[42]=s,e[43]=c,e[44]=a,e[45]=i,e[46]=k):k=e[46],E=n.map(k),e[36]=s,e[37]=n,e[38]=c,e[39]=a,e[40]=i,e[41]=E}else E=e[41];let M;return e[47]!==i||e[48]!==I||e[49]!==E?(M=(0,l.jsxs)(Gs,{id:i,hasChildItems:!0,textValue:i,className:"outline-none data-focused:bg-muted/50 group",children:[I,E]}),e[47]=i,e[48]=I,e[49]=E,e[50]=M):M=e[50],M};const Ou=({form:t,onSubmit:e})=>{let i=mi({control:t.control,name:"ai.models.custom_models"}),n=mi({control:t.control,name:"ai.custom_providers"}),s=(0,g.useMemo)(()=>Object.keys(n||{}),[n]),a=(0,g.useMemo)(()=>St.create({displayedModels:[],customModels:i}),[i]),r=mi({control:t.control,name:"ai.models.displayed_models",defaultValue:[]}),c=new Set(r),o=a.getGroupedModelsByProvider(),d=a.getListModelsByProvider(),u=Dt(x=>{let y=c.has(x)?r.filter(j=>j!==x):[...r,x];t.setValue("ai.models.displayed_models",y,{shouldDirty:!0,shouldTouch:!0}),e(t.getValues())}),m=Dt(async(x,y)=>{let j=o.get(x)||[],v=new Set(j.map(C=>new Me(x,C.model).id)),_=y?[...new Set([...r,...v])]:r.filter(C=>!v.has(C));t.setValue("ai.models.displayed_models",_,{shouldDirty:!0,shouldTouch:!0}),e(t.getValues())}),h=Dt(x=>{let y=i.filter(v=>v!==x),j=r.filter(v=>v!==x);t.setValue("ai.models.displayed_models",j,{shouldDirty:!0,shouldTouch:!0}),t.setValue("ai.models.custom_models",y,{shouldDirty:!0,shouldTouch:!0}),e(t.getValues())});return(0,l.jsxs)(It,{className:"gap-2",children:[(0,l.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,l.jsx)("div",{className:"bg-background",children:(0,l.jsx)(sd,{"aria-label":"AI Models by Provider",className:"flex-1 overflow-auto outline-none focus-visible:outline-none",selectionMode:"none",children:d.map(([x,y])=>(0,l.jsx)(Vu,{providerId:x,models:y,enabledModels:c,onToggleModel:u,onToggleProvider:m,onDeleteModel:h},x))})}),(0,l.jsx)(Lu,{form:t,customModels:i,customProviderNames:s,onSubmit:e})]})},Lu=t=>{let e=(0,Ce.c)(77),{form:i,customModels:n,customProviderNames:s,onSubmit:a}=t,[r,c]=(0,g.useState)(!1),[o,d]=(0,g.useState)(!1),[u,m]=(0,g.useState)(null),[h,x]=(0,g.useState)(""),[y,j]=(0,g.useState)(""),v=(0,g.useId)(),_=(0,g.useId)(),C=(0,g.useId)(),w=u==="custom",p=w?h:u,f;e[0]!==y||e[1]!==p?(f=(p==null?void 0:p.trim())&&(y==null?void 0:y.trim()),e[0]=y,e[1]=p,e[2]=f):f=e[2];let N=f,K;e[3]===Symbol.for("react.memo_cache_sentinel")?(K=()=>{m(null),x(""),j(""),c(!1)},e[3]=K):K=e[3];let T=K,I;e[4]!==n||e[5]!==i||e[6]!==N||e[7]!==y||e[8]!==a||e[9]!==p?(I=()=>{if(!N)return;let se=new Me(p,y);i.setValue("ai.models.custom_models",[se.id,...n],{shouldDirty:!0,shouldTouch:!0}),a(i.getValues()),T(),d(!0),setTimeout(()=>d(!1),2e3)},e[4]=n,e[5]=i,e[6]=N,e[7]=y,e[8]=a,e[9]=p,e[10]=I):I=e[10];let E=I,M;e[11]===v?M=e[12]:(M=(0,l.jsx)(Oe,{htmlFor:v,className:"text-sm font-medium text-muted-foreground min-w-12",children:"Provider"}),e[11]=v,e[12]=M);let k=u||"",D;e[13]===Symbol.for("react.memo_cache_sentinel")?(D=se=>m(se),e[13]=D):D=e[13];let b;e[14]===u?b=e[15]:(b=u?(0,l.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,l.jsx)(Te,{provider:u,className:"h-3.5 w-3.5"}),(0,l.jsx)("span",{children:ei(u)})]}):(0,l.jsx)("span",{className:"text-muted-foreground",children:"Select..."}),e[14]=u,e[15]=b);let A;e[16]!==v||e[17]!==b?(A=(0,l.jsx)(Nr,{id:v,className:"w-40 truncate",children:b}),e[16]=v,e[17]=b,e[18]=A):A=e[18];let z;e[19]===s?z=e[20]:(z=s.length>0&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("p",{className:"px-2 py-1 text-xs text-muted-secondary font-medium",children:"Custom Providers"}),s.map(Wu),(0,l.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]=z);let B;e[21]===s?B=e[22]:(B=qt.filter(se=>se!=="marimo"&&!s.includes(se)).map(Yu),e[21]=s,e[22]=B);let q;e[23]===Symbol.for("react.memo_cache_sentinel")?(q=(0,l.jsx)("p",{className:"px-2 py-1 text-xs text-muted-secondary font-medium mt-1",children:"Other"}),e[23]=q):q=e[23];let Y;e[24]===Symbol.for("react.memo_cache_sentinel")?(Y=(0,l.jsx)(ai,{value:"custom",children:(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(Te,{provider:"openai-compatible",className:"h-4 w-4"}),(0,l.jsx)("span",{children:"Enter provider name"})]})}),e[24]=Y):Y=e[24];let S;e[25]!==B||e[26]!==z?(S=(0,l.jsx)(Sr,{children:(0,l.jsxs)(_r,{children:[z,B,q,Y]})}),e[25]=B,e[26]=z,e[27]=S):S=e[27];let W;e[28]!==S||e[29]!==k||e[30]!==A?(W=(0,l.jsxs)(Ir,{value:k,onValueChange:D,children:[A,S]}),e[28]=S,e[29]=k,e[30]=A,e[31]=W):W=e[31];let te;e[32]!==W||e[33]!==M?(te=(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[M,W]}),e[32]=W,e[33]=M,e[34]=te):te=e[34];let ce;e[35]!==_||e[36]!==h||e[37]!==w?(ce=w&&(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(Oe,{htmlFor:_,className:"text-sm font-medium text-muted-foreground min-w-12",children:"Name"}),(0,l.jsx)(Fe,{id:_,value:h,onChange:se=>x(se.target.value),placeholder:"openrouter",className:"w-40 truncate"})]}),e[35]=_,e[36]=h,e[37]=w,e[38]=ce):ce=e[38];let de;e[39]!==te||e[40]!==ce?(de=(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[te,ce]}),e[39]=te,e[40]=ce,e[41]=de):de=e[41];let he=de,me=w&&"self-start",ge;e[42]===me?ge=e[43]:(ge=Ee("flex items-center gap-2",me),e[42]=me,e[43]=ge);let P;e[44]===C?P=e[45]:(P=(0,l.jsx)(Oe,{htmlFor:C,className:"text-sm font-medium text-muted-foreground",children:"Model"}),e[44]=C,e[45]=P);let X;e[46]===Symbol.for("react.memo_cache_sentinel")?(X=se=>j(se.target.value),e[46]=X):X=e[46];let Z;e[47]!==y||e[48]!==C?(Z=(0,l.jsx)(Fe,{id:C,value:y,onChange:X,placeholder:"gpt-4",className:"text-xs mb-0"}),e[47]=y,e[48]=C,e[49]=Z):Z=e[49];let Q;e[50]!==ge||e[51]!==P||e[52]!==Z?(Q=(0,l.jsxs)("div",{className:ge,children:[P,Z]}),e[50]=ge,e[51]=P,e[52]=Z,e[53]=Q):Q=e[53];let J=Q,ie=w&&"self-end",le;e[54]===ie?le=e[55]:(le=Ee("flex gap-1.5 ml-auto",ie),e[54]=ie,e[55]=le);let fe=!N,pe;e[56]!==E||e[57]!==fe?(pe=(0,l.jsx)(ae,{onClick:E,disabled:fe,size:"xs",children:"Add"}),e[56]=E,e[57]=fe,e[58]=pe):pe=e[58];let ue;e[59]===Symbol.for("react.memo_cache_sentinel")?(ue=(0,l.jsx)(ae,{variant:"outline",onClick:T,size:"xs",children:"Cancel"}),e[59]=ue):ue=e[59];let ve;e[60]!==le||e[61]!==pe?(ve=(0,l.jsxs)("div",{className:le,children:[pe,ue]}),e[60]=le,e[61]=pe,e[62]=ve):ve=e[62];let xe;e[63]!==J||e[64]!==he||e[65]!==ve?(xe=(0,l.jsxs)("div",{className:"flex items-center gap-3 p-3 border border-border rounded-md",children:[he,J,ve]}),e[63]=J,e[64]=he,e[65]=ve,e[66]=xe):xe=e[66];let De=r&&xe,ye;e[67]===r?ye=e[68]:(ye=(0,l.jsx)(wa,{isFormOpen:r,setIsFormOpen:c,label:"Add Model",className:"pl-2"}),e[67]=r,e[68]=ye);let be;e[69]===o?be=e[70]:(be=o&&(0,l.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]=o,e[70]=be);let je;e[71]!==ye||e[72]!==be?(je=(0,l.jsxs)("div",{className:"flex flex-row text-sm",children:[ye,be]}),e[71]=ye,e[72]=be,e[73]=je):je=e[73];let Ae;return e[74]!==De||e[75]!==je?(Ae=(0,l.jsxs)("div",{children:[De,je]}),e[74]=De,e[75]=je,e[76]=Ae):Ae=e[76],Ae};var wa=t=>{let e=(0,Ce.c)(10),{isFormOpen:i,setIsFormOpen:n,label:s,className:a}=t,r;e[0]===n?r=e[1]:(r=u=>{u.stopPropagation(),u.preventDefault(),n(!0)},e[0]=n,e[1]=r);let c;e[2]===a?c=e[3]:(c=Ee("px-0",a),e[2]=a,e[3]=c);let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o=(0,l.jsx)(to,{className:"h-4 w-4 mr-2 mb-0.5"}),e[4]=o):o=e[4];let d;return e[5]!==i||e[6]!==s||e[7]!==r||e[8]!==c?(d=(0,l.jsxs)(ae,{onClick:r,variant:"link",disabled:i,className:c,children:[o,s]}),e[5]=i,e[6]=s,e[7]=r,e[8]=c,e[9]=d):d=e[9],d};const Gu=t=>{let e=(0,Ce.c)(26),{form:i,config:n,onSubmit:s}=t,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=dt(),e[0]=a):a=e[0];let r=a,[c,o]=lt(Ia),d;e[1]===o?d=e[2]:(d=v=>o(v),e[1]=o,e[2]=d);let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=(0,l.jsxs)(sl,{className:"mb-2",children:[(0,l.jsx)(ft,{value:"ai-features",children:"AI Features"}),(0,l.jsx)(ft,{value:"ai-providers",children:"AI Providers"}),(0,l.jsx)(ft,{value:"ai-models",children:"AI Models"}),!r&&(0,l.jsx)(ft,{value:"mcp",children:"MCP"})]}),e[3]=u):u=e[3];let m;e[4]!==n||e[5]!==i||e[6]!==s?(m=(0,l.jsxs)(Pt,{value:"ai-features",children:[(0,l.jsx)(Bu,{form:i,config:n,onSubmit:s}),(0,l.jsx)($u,{form:i,config:n,onSubmit:s})]}),e[4]=n,e[5]=i,e[6]=s,e[7]=m):m=e[7];let h;e[8]!==n||e[9]!==i||e[10]!==s?(h=(0,l.jsx)(Pt,{value:"ai-providers",children:(0,l.jsx)(Ru,{form:i,config:n,onSubmit:s})}),e[8]=n,e[9]=i,e[10]=s,e[11]=h):h=e[11];let x;e[12]!==n||e[13]!==i||e[14]!==s?(x=(0,l.jsx)(Pt,{value:"ai-models",children:(0,l.jsx)(Ou,{form:i,config:n,onSubmit:s})}),e[12]=n,e[13]=i,e[14]=s,e[15]=x):x=e[15];let y;e[16]!==i||e[17]!==s?(y=!r&&(0,l.jsx)(Pt,{value:"mcp",children:(0,l.jsx)(Mu,{form:i,onSubmit:s})}),e[16]=i,e[17]=s,e[18]=y):y=e[18];let j;return e[19]!==c||e[20]!==d||e[21]!==m||e[22]!==h||e[23]!==x||e[24]!==y?(j=(0,l.jsxs)(nl,{value:c,onValueChange:d,className:"flex-1",children:[u,m,h,x,y]}),e[19]=c,e[20]=d,e[21]=m,e[22]=h,e[23]=x,e[24]=y,e[25]=j):j=e[25],j};function Hu(t){return(0,l.jsx)("option",{value:t,children:t},t)}function Uu(t){return(0,l.jsx)("option",{value:t,children:t},t)}function qu(t){let{field:e}=t;return(0,l.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(F,{className:"font-normal",children:"AI Edit Tooltip"}),(0,l.jsx)(V,{children:(0,l.jsx)(ne,{"data-testid":"inline-ai-checkbox",checked:e.value===!0,onCheckedChange:e.onChange})})]}),(0,l.jsx)(H,{children:'Enable "Edit with AI" tooltip when selecting code.'})]})}function Wu(t){return(0,l.jsx)(ai,{value:t,children:(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(Te,{provider:t,className:"h-4 w-4"}),(0,l.jsx)("span",{children:ri.startCase(t)})]})},t)}function Yu(t){return(0,l.jsx)(ai,{value:t,children:(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(Te,{provider:t,className:"h-4 w-4"}),(0,l.jsx)("span",{children:ei(t)})]})},t)}var Qu=Se(),Zu=["auto","true","false"];const Xu=t=>{let e=(0,Qu.c)(47),{form:i,config:n,onSubmit:s}=t,a;e[0]!==n||e[1]!==i.control?(a=(T,I)=>(0,l.jsx)($,{control:i.control,name:T,render:E=>{let{field:M}=E,k=D=>{let b=D.target.value;M.onChange(b==="true"?!0:b==="false"?!1:b)};return(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(F,{className:"text-sm font-normal w-16",children:I}),(0,l.jsx)(V,{children:(0,l.jsx)(Ke,{"data-testid":"auto-discover-schemas-select",onChange:k,value:M.value===void 0?"auto":M.value.toString(),disabled:M.disabled,className:"w-[100px]",children:Zu.map(Ju)})}),(0,l.jsx)(L,{userConfig:n,name:T})]})}}),e[0]=n,e[1]=i.control,e[2]=a):a=e[2];let r=a,c;e[3]===n?c=e[4]:(c=T=>{let{field:I}=T;return(0,l.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(F,{children:"Dataframe viewer"}),(0,l.jsx)(V,{children:(0,l.jsx)(Ke,{"data-testid":"display-dataframes-select",onChange:E=>I.onChange(E.target.value),value:I.value,disabled:I.disabled,className:"inline-flex mr-2",children:["rich","plain"].map(e0)})}),(0,l.jsx)(G,{}),(0,l.jsx)(L,{userConfig:n,name:"display.dataframes"})]}),(0,l.jsx)(H,{children:"Whether to use marimo's rich dataframe viewer or a plain HTML table. This requires restarting your notebook to take effect."})]})},e[3]=n,e[4]=c);let o;e[5]!==i.control||e[6]!==c?(o=(0,l.jsx)($,{control:i.control,name:"display.dataframes",render:c}),e[5]=i.control,e[6]=c,e[7]=o):o=e[7];let d;e[8]!==n||e[9]!==i||e[10]!==s?(d=T=>{let{field:I}=T;return(0,l.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(F,{children:"Default table page size"}),(0,l.jsx)(V,{children:(0,l.jsx)(yt,{"aria-label":"Default table page size","data-testid":"default-table-page-size-input",className:"m-0 w-24",...I,value:I.value,minValue:1,step:1,onChange:E=>{I.onChange(E),Number.isNaN(E)||s(i.getValues())}})}),(0,l.jsx)(G,{}),(0,l.jsx)(L,{userConfig:n,name:"display.default_table_page_size"})]}),(0,l.jsx)(H,{children:"The default number of rows displayed in dataframes and SQL results."})]})},e[8]=n,e[9]=i,e[10]=s,e[11]=d):d=e[11];let u;e[12]!==i.control||e[13]!==d?(u=(0,l.jsx)($,{control:i.control,name:"display.default_table_page_size",render:d}),e[12]=i.control,e[13]=d,e[14]=u):u=e[14];let m;e[15]!==n||e[16]!==i||e[17]!==s?(m=T=>{let{field:I}=T;return(0,l.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(F,{children:"Default table max columns"}),(0,l.jsx)(V,{children:(0,l.jsx)(yt,{"aria-label":"Default table max columns","data-testid":"default-table-max-columns-input",className:"m-0 w-24",...I,value:I.value,minValue:1,step:1,onChange:E=>{I.onChange(E),Number.isNaN(E)||s(i.getValues())}})}),(0,l.jsx)(G,{}),(0,l.jsx)(L,{userConfig:n,name:"display.default_table_max_columns"})]}),(0,l.jsx)(H,{children:"The default maximum number of columns displayed in dataframes and SQL results."})]})},e[15]=n,e[16]=i,e[17]=s,e[18]=m):m=e[18];let h;e[19]!==i.control||e[20]!==m?(h=(0,l.jsx)($,{control:i.control,name:"display.default_table_max_columns",render:m}),e[19]=i.control,e[20]=m,e[21]=h):h=e[21];let x;e[22]===Symbol.for("react.memo_cache_sentinel")?(x=(0,l.jsx)("div",{className:"text-sm text-foreground",children:"Database Schema Discovery"}),e[22]=x):x=e[22];let y,j;e[23]===Symbol.for("react.memo_cache_sentinel")?(j=(0,l.jsx)("br",{}),y=(0,l.jsx)("span",{className:"font-semibold",children:"Can be expensive for large databases."}),e[23]=y,e[24]=j):(y=e[23],j=e[24]);let v;e[25]===Symbol.for("react.memo_cache_sentinel")?(v=(0,l.jsxs)("div",{className:"text-sm text-muted-foreground mb-2",children:["Whether database schemas, tables, and columns are automatically discovered.",j,y," ","Use 'auto' to determine introspection based on the"," ",(0,l.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[25]=v):v=e[25];let _;e[26]===r?_=e[27]:(_=(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[x,v,r("datasources.auto_discover_schemas","Schemas"),r("datasources.auto_discover_tables","Tables"),r("datasources.auto_discover_columns","Columns")]}),e[26]=r,e[27]=_);let C;e[28]===n?C=e[29]:(C=T=>{let{field:I}=T;return(0,l.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(F,{children:"SQL Linter"}),(0,l.jsx)(V,{children:(0,l.jsx)(ne,{"data-testid":"sql-linter-checkbox",checked:I.value,onCheckedChange:I.onChange})}),(0,l.jsx)(G,{}),(0,l.jsx)(L,{userConfig:n,name:"diagnostics.sql_linter"})]}),(0,l.jsx)(H,{children:"Better linting and autocompletions for SQL cells."})]})},e[28]=n,e[29]=C);let w;e[30]!==i.control||e[31]!==C?(w=(0,l.jsx)($,{control:i.control,name:"diagnostics.sql_linter",render:C}),e[30]=i.control,e[31]=C,e[32]=w):w=e[32];let p;e[33]===n?p=e[34]:(p=T=>{let{field:I}=T;return(0,l.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(F,{children:"Default SQL output"}),(0,l.jsx)(V,{children:(0,l.jsx)(Ke,{"data-testid":"user-config-sql-output-select",onChange:E=>I.onChange(E.target.value),value:I.value,disabled:I.disabled,className:"inline-flex mr-2",children:ya.map(t0)})}),(0,l.jsx)(G,{}),(0,l.jsx)(L,{userConfig:n,name:"runtime.default_sql_output"})]}),(0,l.jsx)(H,{children:'The default SQL output type for new notebooks; overridden by "sql_output" in the application config.'})]})},e[33]=n,e[34]=p);let f;e[35]!==i.control||e[36]!==p?(f=(0,l.jsx)($,{control:i.control,name:"runtime.default_sql_output",render:p}),e[35]=i.control,e[36]=p,e[37]=f):f=e[37];let N;e[38]!==_||e[39]!==w||e[40]!==f?(N=(0,l.jsxs)(ze,{title:"SQL",children:[_,w,f]}),e[38]=_,e[39]=w,e[40]=f,e[41]=N):N=e[41];let K;return e[42]!==N||e[43]!==o||e[44]!==u||e[45]!==h?(K=(0,l.jsxs)(l.Fragment,{children:[o,u,h,N]}),e[42]=N,e[43]=o,e[44]=u,e[45]=h,e[46]=K):K=e[46],K};function Ju(t){return(0,l.jsx)("option",{value:t,children:t},t)}function e0(t){return(0,l.jsx)("option",{value:t,children:t},t)}function t0(t){return(0,l.jsx)("option",{value:t.value,children:t.label},t.value)}function Ri(t,e){let i={};for(let n of Object.keys(e)){let s=e[n],a=t[n];if(a!==void 0){if(s===!0)i[n]=a;else if(typeof s=="object"&&s){let r=Ri(a,s);Object.keys(r).length>0&&(i[n]=r)}}}return i}var Ca=(t,e)=>{var i,n,s,a,r;e.ai={...e.ai,models:{...(i=e.ai)==null?void 0:i.models,displayed_models:((s=(n=t.ai)==null?void 0:n.models)==null?void 0:s.displayed_models)??[],custom_models:((r=(a=t.ai)==null?void 0:a.models)==null?void 0:r.custom_models)??[]}}},i0=[["ai.models.displayed_models",Ca],["ai.models.custom_models",Ca]],l0=new Map(i0),n0=(t,e)=>{if(!t)return!1;let i=t;for(let n of e.split(".")){if(typeof i!="object"||!i)return!1;i=i[n]}return i===!0};const s0=t=>{let{values:e,dirtyValues:i,touchedFields:n}=t;for(let[s,a]of l0)n0(n,s)&&a(e,i)};var a0=Se(),Sa=[{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:[dt()?{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"}];dt()||Sa.push({id:"lsp",packagesRequired:[{name:"python-lsp-server"},{name:"websockets"}],additionalPackageInstalls:[{name:"python-lsp-ruff"}],description:"Language Server Protocol*"});const r0=()=>{let t=(0,a0.c)(21),[e]=tl(),i=e.package_management.manager,{getPackageList:n}=xt(),s;t[0]===n?s=t[1]:(s=()=>n(),t[0]=n,t[1]=s);let a;t[2]===i?a=t[3]:(a=[i],t[2]=i,t[3]=a);let{data:r,error:c,refetch:o,isPending:d}=Al(s,a);if(d){let w;return t[4]===Symbol.for("react.memo_cache_sentinel")?(w=(0,l.jsx)(gl,{size:"medium",centered:!0}),t[4]=w):w=t[4],w}if(c){let w;return t[5]===c?w=t[6]:(w=(0,l.jsx)(Lo,{error:c}),t[5]=c,t[6]=w),w}let u;if(t[7]!==(r==null?void 0:r.packages)){let w=(r==null?void 0:r.packages)||[];u=new Set(w.map(c0)),t[7]=r==null?void 0:r.packages,t[8]=u}else u=t[8];let m=u,h;t[9]===Symbol.for("react.memo_cache_sentinel")?(h=(0,l.jsx)(pt,{children:"Optional Features"}),t[9]=h):h=t[9];let x;t[10]===Symbol.for("react.memo_cache_sentinel")?(x=(0,l.jsxs)("p",{className:"text-sm text-muted-foreground",children:["marimo is lightweight, with few dependencies, to maximize compatibility with your own environments.",(0,l.jsx)("br",{}),"To unlock additional features in the marimo editor, you can install these optional dependencies:"]}),t[10]=x):x=t[10];let y;t[11]===Symbol.for("react.memo_cache_sentinel")?(y=(0,l.jsx)(Go,{children:(0,l.jsxs)(Pl,{children:[(0,l.jsx)(Lt,{children:"Dependency"}),(0,l.jsx)(Lt,{children:"Feature"}),(0,l.jsx)(Lt,{children:"Status"}),(0,l.jsx)(Lt,{})]})}),t[11]=y):y=t[11];let j;t[12]!==m||t[13]!==i||t[14]!==o?(j=Sa.map(w=>{let p=w.packagesRequired.every(N=>m.has(N.name.split("[")[0])),f=w.packagesRequired.map(d0).join(", ");return(0,l.jsxs)(Pl,{className:"text-sm",children:[(0,l.jsx)(xi,{children:w.description}),(0,l.jsx)(xi,{className:"font-mono text-xs",children:f}),(0,l.jsx)(xi,{children:p?(0,l.jsxs)("div",{className:"flex items-center",children:[(0,l.jsx)(El,{className:"h-4 w-4 text-(--grass-10) mr-2"}),(0,l.jsx)("span",{children:"Installed"})]}):(0,l.jsxs)("div",{className:"flex items-center",children:[(0,l.jsx)(Ra,{className:"h-4 w-4 text-(--red-10) mr-2"}),(0,l.jsx)(o0,{packageSpecs:[...w.packagesRequired,...w.additionalPackageInstalls],packageManager:i,onSuccess:o})]})})]},w.id)}),t[12]=m,t[13]=i,t[14]=o,t[15]=j):j=t[15];let v;t[16]===j?v=t[17]:(v=(0,l.jsxs)(Uo,{children:[y,(0,l.jsx)(Ho,{children:j})]}),t[16]=j,t[17]=v);let _;t[18]===Symbol.for("react.memo_cache_sentinel")?(_=(0,l.jsx)("p",{className:"text-muted-foreground mt-2",children:"*Requires server restart"}),t[18]=_):_=t[18];let C;return t[19]===v?C=t[20]:(C=(0,l.jsxs)("div",{className:"flex-1 flex flex-col overflow-hidden gap-2",children:[h,x,v,_]}),t[19]=v,t[20]=C),C};var o0=({packageSpecs:t,packageManager:e,onSuccess:i})=>{let[n,s]=g.useState(!1),{addPackage:a}=xt();return(0,l.jsxs)(ae,{size:"xs",variant:"outline",className:Ee("text-xs",n&&"opacity-50 cursor-not-allowed"),onClick:async()=>{try{s(!0);let r=await a({package:t.map(c=>c.minVersion?`${c.name}>=${c.minVersion}`:c.name).join(" "),group:"dev"});r.success?(i(),Re({title:"Package installed",description:(0,l.jsxs)("span",{children:["The packages"," ",(0,l.jsx)(re,{className:"inline",children:t.map(c=>c.name).join(", ")})," ","have been added to your environment."]})})):Re({title:"Failed to install package",description:r.error,variant:"danger"})}finally{s(!1)}},disabled:n,children:[n?(0,l.jsx)(gl,{size:"small",className:"mr-2 h-3 w-3"}):(0,l.jsx)($a,{className:"mr-2 h-3 w-3"}),"Install with ",e]})};function c0(t){return t.name}function d0(t){return t.name}var _a=[{id:"editor",label:"Editor",Icon:bl,className:"bg-(--blue-4)"},{id:"display",label:"Display",Icon:nc,className:"bg-(--grass-4)"},{id:"packageManagementAndData",label:"Packages & Data",Icon:qa,className:"bg-(--red-4)"},{id:"runtime",label:"Runtime",Icon:Tl,className:"bg-(--amber-4)"},{id:"ai",label:"AI",Icon:vi,className:"bg-[linear-gradient(45deg,var(--purple-5),var(--cyan-5))]"},{id:"optionalDeps",label:"Optional Dependencies",Icon:zl,className:"bg-(--orange-4)"},{id:"labs",label:"Labs",Icon:lc,className:"bg-(--slate-4)"}];const Na=nt(_a[0].id);var u0=100,$i="__system__";const m0=()=>{let[t,e]=el(),[i,n]=lt(Ws),s=(0,g.useRef)(null),a=Mt(Ti),[r,c]=lt(Na),o=st(Ja);st(Xa).mode==="home"&&(o={terminal:!0,pylsp:!0,ty:!0,basedpyright:!0,pyrefly:!0});let d=st(gr),{locale:u}=Ot(),{saveUserConfig:m}=xt(),h=po({resolver:go(sr),defaultValues:t}),x=(p,f)=>{let{chatModel:N,editModel:K}=Rd(p);return(N||K)&&(f={...f,models:{...f==null?void 0:f.models,...N&&{chat_model:N},...K&&{edit_model:K}}},N&&h.setValue("ai.models.chat_model",N),K&&h.setValue("ai.models.edit_model",K)),f},y=Do(async p=>{let f=Ri(p,h.formState.dirtyFields);s0({values:p,dirtyValues:f,touchedFields:h.formState.touchedFields}),Object.keys(f).length!==0&&(f.ai&&(f.ai=x(p.ai,f.ai)),await m({config:f}),e(N=>ir({},N,f)))},u0),j=dt(),v=(0,g.useId)(),_=(0,g.useId)(),C=()=>{switch(r){case"editor":return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(ze,{title:"Autosave",children:[(0,l.jsx)($,{control:h.control,name:"save.autosave",render:({field:p})=>(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(F,{className:"font-normal",children:"Autosave enabled"}),(0,l.jsx)(V,{children:(0,l.jsx)(ne,{"data-testid":"autosave-checkbox",checked:p.value==="after_delay",disabled:p.disabled,onCheckedChange:f=>{p.onChange(f?"after_delay":"off")}})}),(0,l.jsx)(G,{}),(0,l.jsx)(L,{userConfig:t,name:"save.autosave"})]})}),(0,l.jsx)($,{control:h.control,name:"save.autosave_delay",render:({field:p})=>(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(F,{children:"Autosave delay (seconds)"}),(0,l.jsx)(V,{children:(0,l.jsx)(yt,{"aria-label":"Autosave delay","data-testid":"autosave-delay-input",className:"m-0 w-24",isDisabled:h.getValues("save.autosave")!=="after_delay",...p,value:p.value/1e3,minValue:1,onChange:f=>{p.onChange(f*1e3),Number.isNaN(f)||y(h.getValues())}})}),(0,l.jsx)(G,{}),(0,l.jsx)(L,{userConfig:t,name:"save.autosave_delay"})]})}),(0,l.jsx)($,{control:h.control,name:"runtime.default_auto_download",render:({field:p})=>(0,l.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(F,{children:"Save cell outputs as"}),(0,l.jsx)(V,{children:(0,l.jsxs)("div",{className:"flex gap-4",children:[(0,l.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,l.jsx)(ne,{id:v,checked:Array.isArray(p.value)&&p.value.includes("html"),onCheckedChange:()=>{let f=Array.isArray(p.value)?p.value:[];p.onChange(hl(f,"html"))}}),(0,l.jsx)(F,{htmlFor:v,children:"HTML"})]}),(0,l.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,l.jsx)(ne,{id:_,checked:Array.isArray(p.value)&&p.value.includes("ipynb"),onCheckedChange:()=>{let f=Array.isArray(p.value)?p.value:[];p.onChange(hl(f,"ipynb"))}}),(0,l.jsx)(F,{htmlFor:_,children:"IPYNB"})]})]})}),(0,l.jsx)(G,{}),(0,l.jsx)(L,{userConfig:t,name:"runtime.default_auto_download"})]}),(0,l.jsxs)(H,{children:["When enabled, marimo will periodically save notebooks in your selected formats (HTML, IPYNB) to a folder named"," ",(0,l.jsx)(re,{className:"inline",children:"__marimo__"})," next to your notebook file."]})]})})]}),(0,l.jsxs)(ze,{title:"Formatting",children:[(0,l.jsx)($,{control:h.control,name:"save.format_on_save",render:({field:p})=>(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(F,{className:"font-normal",children:"Format on save"}),(0,l.jsx)(V,{children:(0,l.jsx)(ne,{"data-testid":"format-on-save-checkbox",checked:p.value,disabled:p.disabled,onCheckedChange:f=>{p.onChange(f)}})}),(0,l.jsx)(G,{}),(0,l.jsx)(L,{userConfig:t,name:"save.format_on_save"})]})}),(0,l.jsx)($,{control:h.control,name:"formatting.line_length",render:({field:p})=>(0,l.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(F,{children:"Line length"}),(0,l.jsx)(V,{children:(0,l.jsx)(yt,{"aria-label":"Line length","data-testid":"line-length-input",className:"m-0 w-24",...p,value:p.value,minValue:1,maxValue:1e3,onChange:f=>{p.onChange(f),Number.isNaN(f)||y(h.getValues())}})}),(0,l.jsx)(G,{}),(0,l.jsx)(L,{userConfig:t,name:"formatting.line_length"})]}),(0,l.jsx)(H,{children:"Maximum line length when formatting code."})]})})]}),(0,l.jsxs)(ze,{title:"Autocomplete",children:[(0,l.jsx)($,{control:h.control,name:"completion.activate_on_typing",render:({field:p})=>(0,l.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(F,{className:"font-normal",children:"Autocomplete"}),(0,l.jsx)(V,{children:(0,l.jsx)(ne,{"data-testid":"autocomplete-checkbox",checked:p.value,disabled:p.disabled,onCheckedChange:f=>{p.onChange(!!f)}})}),(0,l.jsx)(G,{}),(0,l.jsx)(L,{userConfig:t,name:"completion.activate_on_typing"})]}),(0,l.jsx)(H,{children:"When unchecked, code completion is still available through a hotkey."}),(0,l.jsx)("div",{children:(0,l.jsx)(ae,{variant:"link",className:"mb-0 px-0",type:"button",onClick:f=>{f.preventDefault(),f.stopPropagation(),c("ai")},children:"Edit AI autocomplete"})})]})}),(0,l.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(F,{className:"font-normal",children:"Accept suggestion on Enter"}),(0,l.jsx)(V,{children:(0,l.jsx)(ne,{"data-testid":"accept-completion-on-enter-checkbox",checked:i,onCheckedChange:p=>n(!!p)})})]}),(0,l.jsx)(H,{children:"When unchecked, pressing Enter inserts a new line instead of accepting an autocomplete suggestion. Use Tab to accept suggestions."})]}),(0,l.jsx)($,{control:h.control,name:"completion.signature_hint_on_typing",render:({field:p})=>(0,l.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(F,{className:"font-normal",children:"Signature hints"}),(0,l.jsx)(V,{children:(0,l.jsx)(ne,{"data-testid":"signature-hint-on-type-checkbox",checked:p.value??!1,disabled:p.disabled,onCheckedChange:f=>{p.onChange(!!f)}})}),(0,l.jsx)(G,{}),(0,l.jsx)(L,{userConfig:t,name:"completion.signature_hint_on_typing"})]}),(0,l.jsx)(H,{children:"Display signature hints while typing within function calls."})]})}),(0,l.jsx)($,{control:h.control,name:"completion.auto_close_pairs",render:({field:p})=>(0,l.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(F,{className:"font-normal",children:"Auto-close pairs"}),(0,l.jsx)(V,{children:(0,l.jsx)(ne,{"data-testid":"auto-close-pairs-checkbox",checked:p.value??!0,disabled:p.disabled,onCheckedChange:f=>{p.onChange(!!f)}})}),(0,l.jsx)(G,{}),(0,l.jsx)(L,{userConfig:t,name:"completion.auto_close_pairs"})]}),(0,l.jsxs)(H,{children:["Automatically insert closing brackets"," ",(0,l.jsx)("code",{className:"text-xs",children:"()"}),","," ",(0,l.jsx)("code",{className:"text-xs",children:"[]"}),","," ",(0,l.jsx)("code",{className:"text-xs",children:"{}"}),", and quotes"," ",(0,l.jsx)("code",{className:"text-xs",children:'""'}),","," ",(0,l.jsx)("code",{className:"text-xs",children:"''"})," when opening one."]})]})})]}),(0,l.jsxs)(ze,{title:"Language Servers",children:[(0,l.jsxs)(H,{children:["See the"," ",(0,l.jsx)(oe,{href:"https://docs.marimo.io/guides/editor_features/language_server/",children:"docs"})," ","for more information about language server support."]}),(0,l.jsxs)(H,{children:[(0,l.jsx)("strong",{children:"Note:"})," When using multiple language servers, different features may conflict."]}),(0,l.jsx)($,{control:h.control,name:"language_servers.pylsp.enabled",render:({field:p})=>(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,l.jsxs)(R,{className:O,children:[(0,l.jsxs)(F,{children:[(0,l.jsx)(bt,{variant:"defaultOutline",className:"mr-2",children:"Beta"}),"Python Language Server (",(0,l.jsx)(oe,{href:"https://github.com/python-lsp/python-lsp-server",children:"docs"}),")"]}),(0,l.jsx)(V,{children:(0,l.jsx)(ne,{"data-testid":"pylsp-checkbox",checked:p.value,disabled:p.disabled,onCheckedChange:f=>{p.onChange(!!f)}})}),(0,l.jsx)(G,{}),(0,l.jsx)(L,{userConfig:t,name:"language_servers.pylsp.enabled"})]}),p.value&&!o.pylsp&&(0,l.jsxs)(kt,{kind:"danger",children:["The Python Language Server is not available in your current environment. Please install"," ",(0,l.jsx)(re,{className:"inline",children:"python-lsp-server"})," in your environment."]})]})}),(0,l.jsx)($,{control:h.control,name:"language_servers.basedpyright.enabled",render:({field:p})=>(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,l.jsxs)(R,{className:O,children:[(0,l.jsxs)(F,{children:[(0,l.jsx)(bt,{variant:"defaultOutline",className:"mr-2",children:"Beta"}),"basedpyright (",(0,l.jsx)(oe,{href:"https://github.com/DetachHead/basedpyright",children:"docs"}),")"]}),(0,l.jsx)(V,{children:(0,l.jsx)(ne,{"data-testid":"basedpyright-checkbox",checked:p.value,disabled:p.disabled,onCheckedChange:f=>{p.onChange(!!f)}})}),(0,l.jsx)(G,{}),(0,l.jsx)(L,{userConfig:t,name:"language_servers.basedpyright.enabled"})]}),p.value&&!o.basedpyright&&(0,l.jsxs)(kt,{kind:"danger",children:["basedpyright is not available in your current environment. Please install"," ",(0,l.jsx)(re,{className:"inline",children:"basedpyright"})," in your environment."]})]})}),(0,l.jsx)($,{control:h.control,name:"language_servers.pyrefly.enabled",render:({field:p})=>(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,l.jsxs)(R,{className:O,children:[(0,l.jsxs)(F,{children:[(0,l.jsx)(bt,{variant:"defaultOutline",className:"mr-2",children:"Beta"}),"Pyrefly (",(0,l.jsx)(oe,{href:"https://github.com/facebook/pyrefly",children:"docs"}),")"]}),(0,l.jsx)(V,{children:(0,l.jsx)(ne,{"data-testid":"pyrefly-checkbox",checked:p.value,disabled:p.disabled,onCheckedChange:f=>{p.onChange(!!f)}})}),(0,l.jsx)(G,{}),(0,l.jsx)(L,{userConfig:t,name:"language_servers.pyrefly.enabled"})]}),p.value&&!o.pyrefly&&(0,l.jsxs)(kt,{kind:"danger",children:["Pyrefly is not available in your current environment. Please install ",(0,l.jsx)(re,{className:"inline",children:"pyrefly"})," in your environment."]})]})}),(0,l.jsx)($,{control:h.control,name:"language_servers.ty.enabled",render:({field:p})=>(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,l.jsxs)(R,{className:O,children:[(0,l.jsxs)(F,{children:[(0,l.jsx)(bt,{variant:"defaultOutline",className:"mr-2",children:"Beta"}),"ty (",(0,l.jsx)(oe,{href:"https://github.com/astral-sh/ty",children:"docs"}),")"]}),(0,l.jsx)(V,{children:(0,l.jsx)(ne,{"data-testid":"ty-checkbox",checked:p.value,disabled:p.disabled,onCheckedChange:f=>{p.onChange(!!f)}})}),(0,l.jsx)(G,{}),(0,l.jsx)(L,{userConfig:t,name:"language_servers.ty.enabled"})]}),p.value&&!o.ty&&(0,l.jsxs)(kt,{kind:"danger",children:["ty is not available in your current environment. Please install ",(0,l.jsx)(re,{className:"inline",children:"ty"})," in your environment."]})]})}),(0,l.jsx)($,{control:h.control,name:"diagnostics.enabled",render:({field:p})=>(0,l.jsxs)(R,{className:O,children:[(0,l.jsxs)(F,{children:[(0,l.jsx)(bt,{variant:"defaultOutline",className:"mr-2",children:"Beta"}),"Diagnostics"]}),(0,l.jsx)(V,{children:(0,l.jsx)(ne,{"data-testid":"diagnostics-checkbox",checked:p.value,disabled:p.disabled,onCheckedChange:f=>{p.onChange(!!f)}})}),(0,l.jsx)(G,{}),(0,l.jsx)(L,{userConfig:t,name:"diagnostics.enabled"})]})})]}),(0,l.jsxs)(ze,{title:"Keymap",children:[(0,l.jsx)($,{control:h.control,name:"keymap.preset",render:({field:p})=>(0,l.jsx)("div",{className:"flex flex-col space-y-1",children:(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(F,{children:"Keymap"}),(0,l.jsx)(V,{children:(0,l.jsx)(Ke,{"data-testid":"keymap-select",onChange:f=>p.onChange(f.target.value),value:p.value,disabled:p.disabled,className:"inline-flex mr-2",children:Kd.map(f=>(0,l.jsx)("option",{value:f,children:f},f))})}),(0,l.jsx)(G,{}),(0,l.jsx)(L,{userConfig:t,name:"keymap.preset"})]})})}),(0,l.jsx)($,{control:h.control,name:"keymap.destructive_delete",render:({field:p})=>(0,l.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(F,{className:"font-normal",children:"Destructive delete"}),(0,l.jsx)(V,{children:(0,l.jsx)(ne,{"data-testid":"destructive-delete-checkbox",checked:p.value,disabled:p.disabled,onCheckedChange:f=>{p.onChange(!!f)}})}),(0,l.jsx)(G,{}),(0,l.jsx)(L,{userConfig:t,name:"keymap.destructive_delete"})]}),(0,l.jsxs)(H,{className:"flex items-center gap-1",children:["Allow deleting non-empty cells",(0,l.jsx)(qe,{content:(0,l.jsxs)("div",{className:"max-w-xs",children:[(0,l.jsx)("strong",{children:"Use with caution:"})," Deleting cells with code can lose work and computed results since variables are removed from memory."]}),children:(0,l.jsx)(pi,{className:"w-3 h-3 text-(--amber-11)"})})]}),(0,l.jsx)("div",{children:(0,l.jsx)(ae,{variant:"link",className:"mb-0 px-0",type:"button",onClick:f=>{f.preventDefault(),f.stopPropagation(),a(!0)},children:"Edit Keyboard Shortcuts"})})]})})]})]});case"display":return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(ze,{title:"Display",children:[(0,l.jsx)($,{control:h.control,name:"display.default_width",render:({field:p})=>(0,l.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(F,{children:"Default width"}),(0,l.jsx)(V,{children:(0,l.jsx)(Ke,{"data-testid":"user-config-width-select",onChange:f=>p.onChange(f.target.value),value:p.value,disabled:p.disabled,className:"inline-flex mr-2",children:ea().map(f=>(0,l.jsx)("option",{value:f,children:f},f))})}),(0,l.jsx)(G,{}),(0,l.jsx)(L,{userConfig:t,name:"display.default_width"})]}),(0,l.jsx)(H,{children:'The default app width for new notebooks; overridden by "width" in the application config.'})]})}),(0,l.jsx)($,{control:h.control,name:"display.theme",render:({field:p})=>(0,l.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(F,{children:"Theme"}),(0,l.jsx)(V,{children:(0,l.jsx)(Ke,{"data-testid":"theme-select",onChange:f=>p.onChange(f.target.value),value:p.value,disabled:p.disabled,className:"inline-flex mr-2",children:yo.map(f=>(0,l.jsx)("option",{value:f,children:f},f))})}),(0,l.jsx)(G,{}),(0,l.jsx)(L,{userConfig:t,name:"display.theme"})]}),(0,l.jsx)(H,{children:"This theme will be applied to the user's configuration; it does not affect theme when sharing the notebook."})]})}),(0,l.jsx)($,{control:h.control,name:"display.code_editor_font_size",render:({field:p})=>(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(F,{children:"Code editor font size (px)"}),(0,l.jsx)(V,{children:(0,l.jsx)("span",{className:"inline-flex mr-2",children:(0,l.jsx)(yt,{"aria-label":"Code editor font size","data-testid":"code-editor-font-size-input",className:"m-0 w-24",...p,value:p.value,minValue:8,maxValue:32,onChange:f=>{p.onChange(f),y(h.getValues())}})})}),(0,l.jsx)(G,{}),(0,l.jsx)(L,{userConfig:t,name:"display.code_editor_font_size"})]})}),(0,l.jsx)($,{control:h.control,name:"display.locale",render:({field:p})=>(0,l.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(F,{children:"Locale"}),(0,l.jsx)(V,{children:(0,l.jsxs)(Ke,{"data-testid":"locale-select",onChange:f=>{f.target.value===$i?p.onChange(void 0):p.onChange(f.target.value)},value:p.value||$i,disabled:p.disabled,className:"inline-flex mr-2",children:[(0,l.jsx)("option",{value:$i,children:"System"}),navigator.languages.map(f=>(0,l.jsx)("option",{value:f,children:f},f))]})}),(0,l.jsx)(G,{}),(0,l.jsx)(L,{userConfig:t,name:"display.locale"})]}),(0,l.jsxs)(H,{children:["The locale to use for the notebook. If your desired locale is not listed, you can change it manually via"," ",(0,l.jsx)(re,{className:"inline",children:"marimo config show"}),"."]})]})}),(0,l.jsx)($,{control:h.control,name:"display.reference_highlighting",render:({field:p})=>(0,l.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(F,{children:"Reference highlighting"}),(0,l.jsx)(V,{children:(0,l.jsx)(ne,{"data-testid":"reference-highlighting-checkbox",checked:p.value,onCheckedChange:p.onChange})}),(0,l.jsx)(G,{}),(0,l.jsx)(L,{userConfig:t,name:"display.reference_highlighting"})]}),(0,l.jsx)(H,{children:"Visually emphasizes variables in a cell that are defined elsewhere in the notebook."})]})})]}),(0,l.jsx)(ze,{title:"Outputs",children:(0,l.jsx)($,{control:h.control,name:"display.cell_output",render:({field:p})=>(0,l.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(F,{children:"Cell output area"}),(0,l.jsx)(V,{children:(0,l.jsx)(Ke,{"data-testid":"cell-output-select",onChange:f=>p.onChange(f.target.value),value:p.value,disabled:p.disabled,className:"inline-flex mr-2",children:["above","below"].map(f=>(0,l.jsx)("option",{value:f,children:f},f))})}),(0,l.jsx)(G,{}),(0,l.jsx)(L,{userConfig:t,name:"display.cell_output"})]}),(0,l.jsx)(H,{children:"Where to display cell's output."})]})})})]});case"packageManagementAndData":return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(ze,{title:"Package Management",children:(0,l.jsx)($,{control:h.control,disabled:j,name:"package_management.manager",render:({field:p})=>(0,l.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(F,{children:"Manager"}),(0,l.jsx)(V,{children:(0,l.jsx)(Ke,{"data-testid":"package-manager-select",onChange:f=>p.onChange(f.target.value),value:p.value,disabled:p.disabled,className:"inline-flex mr-2",children:ar.map(f=>(0,l.jsx)("option",{value:f,children:f},f))})}),(0,l.jsx)(G,{}),(0,l.jsx)(L,{userConfig:t,name:"package_management.manager"})]}),(0,l.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,l.jsx)(oe,{href:"https://docs.marimo.io/guides/editor_features/package_management.html",children:"docs"}),".",(0,l.jsx)("br",{}),(0,l.jsx)("br",{}),"Running marimo in a"," ",(0,l.jsx)(oe,{href:"https://docs.marimo.io/guides/package_management/inlining_dependencies.html",children:"sandboxed environment"})," ","is only supported by ",(0,l.jsx)(re,{className:"inline",children:"uv"})]})]})})}),(0,l.jsx)(ze,{title:"Data",children:(0,l.jsx)(Xu,{form:h,config:t,onSubmit:y})})]});case"runtime":return(0,l.jsxs)(ze,{title:"Runtime configuration",children:[(0,l.jsx)($,{control:h.control,name:"runtime.auto_instantiate",render:({field:p})=>(0,l.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(F,{className:"font-normal",children:"Autorun on startup"}),(0,l.jsx)(V,{children:(0,l.jsx)(ne,{"data-testid":"auto-instantiate-checkbox",disabled:p.disabled,checked:p.value,onCheckedChange:p.onChange})}),(0,l.jsx)(G,{}),(0,l.jsx)(L,{userConfig:t,name:"runtime.auto_instantiate"})]}),(0,l.jsx)(H,{children:"Whether to automatically run all cells on startup."})]})}),(0,l.jsx)($,{control:h.control,name:"runtime.on_cell_change",render:({field:p})=>(0,l.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(F,{className:"font-normal",children:"On cell change"}),(0,l.jsx)(V,{children:(0,l.jsx)(Ke,{"data-testid":"on-cell-change-select",onChange:f=>p.onChange(f.target.value),value:p.value,className:"inline-flex mr-2",children:["lazy","autorun"].map(f=>(0,l.jsx)("option",{value:f,children:f},f))})}),(0,l.jsx)(G,{}),(0,l.jsx)(L,{userConfig:t,name:"runtime.on_cell_change"})]}),(0,l.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,l.jsx)($,{control:h.control,name:"runtime.auto_reload",render:({field:p})=>(0,l.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(F,{className:"font-normal",children:"On module change"}),(0,l.jsx)(V,{children:(0,l.jsx)(Ke,{"data-testid":"auto-reload-select",onChange:f=>p.onChange(f.target.value),value:p.value,disabled:j,className:"inline-flex mr-2",children:["off","lazy","autorun"].map(f=>(0,l.jsx)("option",{value:f,children:f},f))})}),(0,l.jsx)(G,{}),(0,l.jsx)(L,{userConfig:t,name:"runtime.auto_reload"})]}),(0,l.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,l.jsx)($,{control:h.control,name:"runtime.reactive_tests",render:({field:p})=>(0,l.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(F,{className:"font-normal",children:"Autorun Unit Tests"}),(0,l.jsx)(V,{children:(0,l.jsx)(ne,{"data-testid":"reactive-test-checkbox",checked:p.value,onCheckedChange:p.onChange})})]}),(0,l.jsx)(L,{userConfig:t,name:"runtime.reactive_tests"}),(0,l.jsx)(G,{}),(0,l.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,l.jsxs)(H,{children:["Learn more in the"," ",(0,l.jsx)(oe,{href:"https://docs.marimo.io/guides/reactivity/#configuring-how-marimo-runs-cells",children:"docs"}),"."]})]});case"ai":return(0,l.jsx)(Gu,{form:h,config:t,onSubmit:y});case"optionalDeps":return(0,l.jsx)(r0,{});case"labs":return(0,l.jsxs)(ze,{title:"Experimental Features",children:[(0,l.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,l.jsx)($,{control:h.control,name:"experimental.rtc_v2",render:({field:p})=>(0,l.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(F,{className:"font-normal",children:"Real-Time Collaboration"}),(0,l.jsx)(V,{children:(0,l.jsx)(ne,{"data-testid":"rtc-checkbox",checked:p.value===!0,onCheckedChange:p.onChange})})]}),(0,l.jsx)(H,{children:"Enable experimental real-time collaboration. This change requires a page refresh to take effect."})]})}),(0,l.jsx)($,{control:h.control,name:"experimental.external_agents",render:({field:p})=>(0,l.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,l.jsxs)(R,{className:O,children:[(0,l.jsx)(F,{className:"font-normal",children:"External Agents"}),(0,l.jsx)(V,{children:(0,l.jsx)(ne,{"data-testid":"external-agents-checkbox",checked:p.value===!0,onCheckedChange:p.onChange})})]}),(0,l.jsx)(L,{userConfig:t,name:"experimental.external_agents"}),(0,l.jsxs)(H,{children:["Enable experimental external agents such as Claude Code and Gemini CLI. Learn more in the"," ",(0,l.jsx)(oe,{href:"https://docs.marimo.io/guides/editor_features/agents/",children:"docs"}),"."]})]})})]})}},w=(0,l.jsxs)("p",{className:"text-muted-secondary",children:["User configuration is stored in ",(0,l.jsx)(re,{className:"inline",children:"marimo.toml"}),(0,l.jsx)("br",{}),"Run ",(0,l.jsx)(re,{className:"inline",children:"marimo config show"})," in your terminal to show your current configuration and file location."]});return(0,l.jsx)(ho,{...h,children:(0,l.jsxs)("form",{ref:s,onChange:h.handleSubmit(p=>y(p)),className:"flex text-pretty overflow-hidden",children:[(0,l.jsx)(nl,{value:r,onValueChange:p=>c(p),orientation:"vertical",className:"w-1/3 border-r h-full overflow-auto p-3",children:(0,l.jsxs)(sl,{className:"self-start max-h-none flex flex-col gap-2 shrink-0 bg-background flex-1 min-h-full",children:[_a.map(p=>(0,l.jsx)(ft,{value:p.id,className:"w-full text-left p-2 data-[state=active]:bg-primary data-[state=active]:text-primary-foreground justify-start",children:(0,l.jsxs)("div",{className:"flex gap-4 items-center text-lg overflow-hidden",children:[(0,l.jsx)("span",{className:Ee(p.className,"w-8 h-8 rounded flex items-center justify-center text-muted-foreground shrink-0"),children:(0,l.jsx)(p.Icon,{className:"w-4 h-4"})}),(0,l.jsx)("span",{className:"truncate",children:p.label})]})},p.id)),(0,l.jsxs)("div",{className:"p-2 text-xs text-muted-foreground self-start flex flex-col gap-1",children:[(0,l.jsxs)("span",{children:["Version: ",d]}),(0,l.jsxs)("span",{children:["Locale: ",u]})]}),(0,l.jsx)("div",{className:"flex-1"}),!dt()&&w]})}),(0,l.jsx)("div",{className:"w-2/3 pl-6 gap-2 flex flex-col overflow-auto p-6",children:C()})]})})};var p0=Se();const Ia=nt("ai-features"),Ka=nt(!1);function Vi(){let t=(0,p0.c)(4),e=Mt(Na),i=Mt(Ka),n=Mt(Ia),s;return t[0]!==e||t[1]!==n||t[2]!==i?(s={handleClick:(a,r)=>{e(a),a==="ai"&&n(r??"ai-features"),i(!0)}},t[0]=e,t[1]=n,t[2]=i,t[3]=s):s=t[3],s}var Jt=Se();const Ma=t=>{var B,q,Y,S,W,te,ce,de,he,me,ge,P,X,Z,Q,J,ie,le;let e=(0,Jt.c)(59),{value:i,placeholder:n,onSelect:s,triggerClassName:a,customDropdownContent:r,iconSize:c,showAddCustomModelDocs:o,forRole:d,displayIconOnly:u}=t,m=c===void 0?"medium":c,h=o===void 0?!1:o,x=u===void 0?!1:u,[y,j]=g.useState(!1),v=st(ur),_=st(or),{saveModelChange:C}=Hs(),{handleClick:w}=Vi(),p=_.copilot==="custom"?(B=v==null?void 0:v.models)==null?void 0:B.autocomplete_model:void 0,f,N,K,T,I,E,M,k,D;if(e[0]!==((q=v==null?void 0:v.models)==null?void 0:q.autocomplete_model)||e[1]!==((Y=v==null?void 0:v.models)==null?void 0:Y.chat_model)||e[2]!==((S=v==null?void 0:v.models)==null?void 0:S.custom_models)||e[3]!==((W=v==null?void 0:v.models)==null?void 0:W.displayed_models)||e[4]!==((te=v==null?void 0:v.models)==null?void 0:te.edit_model)||e[5]!==p||e[6]!==x||e[7]!==d||e[8]!==m||e[9]!==y||e[10]!==s||e[11]!==n||e[12]!==C||e[13]!==a||e[14]!==i){let fe=St.create({customModels:[...((ce=v==null?void 0:v.models)==null?void 0:ce.custom_models)??[],(de=v==null?void 0:v.models)==null?void 0:de.chat_model,p,(he=v==null?void 0:v.models)==null?void 0:he.edit_model].filter(Boolean),displayedModels:(me=v==null?void 0:v.models)==null?void 0:me.displayed_models}),pe=fe.getListModelsByProvider(),ue=d==="autocomplete"?(ge=v==null?void 0:v.models)==null?void 0:ge.autocomplete_model:d==="chat"?(P=v==null?void 0:v.models)==null?void 0:P.chat_model:d==="edit"?(X=v==null?void 0:v.models)==null?void 0:X.edit_model:void 0,ve=i?Me.parse(i):ue?Me.parse(ue):void 0,xe=m==="medium"?"h-4 w-4":"h-3 w-3",De=(we,_e)=>{let Pe=fe.getModel(we.id);return(0,l.jsxs)("div",{className:"flex items-center gap-2 w-full px-2 py-1",children:[(0,l.jsx)(Te,{provider:we.providerId,className:xe}),(0,l.jsxs)("div",{className:"flex flex-col",children:[(0,l.jsx)("span",{children:(Pe==null?void 0:Pe.name)||we.shortModelId}),(0,l.jsx)("span",{className:"text-xs text-muted-foreground",children:we.id})]}),(0,l.jsx)("div",{className:"ml-auto flex gap-1",children:(0,l.jsx)(qe,{content:xa(_e),children:(0,l.jsx)("span",{className:`text-xs px-1.5 py-0.5 rounded font-medium ${Qt(_e)}`,children:_e},_e)})})]})},ye;e[24]!==d||e[25]!==s||e[26]!==C?(ye=we=>{s?s(we):C(we,d),j(!1)},e[24]=d,e[25]=s,e[26]=C,e[27]=ye):ye=e[27];let be=ye;N=Pr,k=y,D=j;let je=`flex items-center justify-between px-2 py-0.5 border rounded-md
|
|
5
|
+
hover:bg-accent hover:text-accent-foreground ${a}`,Ae=ve?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Te,{provider:ve.providerId,className:xe}),x?null:(0,l.jsx)("span",{className:"truncate",children:Pi(ve.providerId)?ve.shortModelId:ve.id})]}):(0,l.jsx)("span",{className:"text-muted-foreground truncate",children:n}),se;e[28]===Ae?se=e[29]:(se=(0,l.jsx)("div",{className:"flex items-center gap-2 truncate",children:Ae}),e[28]=Ae,e[29]=se);let Qe=`${xe} ml-1`,Ie;e[30]===Qe?Ie=e[31]:(Ie=(0,l.jsx)(Zr,{className:Qe}),e[30]=Qe,e[31]=Ie),e[32]!==je||e[33]!==se||e[34]!==Ie?(K=(0,l.jsxs)(Mr,{className:je,children:[se,Ie]}),e[32]=je,e[33]=se,e[34]=Ie,e[35]=K):K=e[35],f=Dr,T="w-[300px]",I=ue&&d&&De(Me.parse(ue),d),e[36]!==ue||e[37]!==d?(E=ue&&d&&(0,l.jsx)(Et,{}),e[36]=ue,e[37]=d,e[38]=E):E=e[38];let Ue;e[39]!==be||e[40]!==xe?(Ue=we=>{let[_e,Pe]=we;return(0,l.jsx)(h0,{provider:_e,onSelect:be,models:Pe,iconSizeClass:xe},_e)},e[39]=be,e[40]=xe,e[41]=Ue):Ue=e[41],M=pe.map(Ue),e[0]=(Z=v==null?void 0:v.models)==null?void 0:Z.autocomplete_model,e[1]=(Q=v==null?void 0:v.models)==null?void 0:Q.chat_model,e[2]=(J=v==null?void 0:v.models)==null?void 0:J.custom_models,e[3]=(ie=v==null?void 0:v.models)==null?void 0:ie.displayed_models,e[4]=(le=v==null?void 0:v.models)==null?void 0:le.edit_model,e[5]=p,e[6]=x,e[7]=d,e[8]=m,e[9]=y,e[10]=s,e[11]=n,e[12]=C,e[13]=a,e[14]=i,e[15]=f,e[16]=N,e[17]=K,e[18]=T,e[19]=I,e[20]=E,e[21]=M,e[22]=k,e[23]=D}else f=e[15],N=e[16],K=e[17],T=e[18],I=e[19],E=e[20],M=e[21],k=e[22],D=e[23];let b;e[42]!==w||e[43]!==h?(b=h&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Et,{}),(0,l.jsxs)(Kr,{className:"h-7 flex items-center gap-2",onClick:()=>w("ai","ai-models"),children:[(0,l.jsx)(Jr,{className:"h-3 w-3"}),(0,l.jsx)("span",{className:"cursor-pointer text-link",children:"Add custom model"})]})]}),e[42]=w,e[43]=h,e[44]=b):b=e[44];let A;e[45]!==f||e[46]!==r||e[47]!==b||e[48]!==T||e[49]!==I||e[50]!==E||e[51]!==M?(A=(0,l.jsxs)(f,{className:T,children:[I,E,M,r,b]}),e[45]=f,e[46]=r,e[47]=b,e[48]=T,e[49]=I,e[50]=E,e[51]=M,e[52]=A):A=e[52];let z;return e[53]!==N||e[54]!==K||e[55]!==A||e[56]!==k||e[57]!==D?(z=(0,l.jsxs)(N,{open:k,onOpenChange:D,children:[K,A]}),e[53]=N,e[54]=K,e[55]=A,e[56]=k,e[57]=D,e[58]=z):z=e[58],z};var h0=t=>{let e=(0,Jt.c)(26),{provider:i,onSelect:n,models:s,iconSizeClass:a}=t,r=Pi(i)?i:"openai-compatible",c;e[0]===i?c=e[1]:(c=St.getProviderInfo(i),e[0]=i,e[1]=c);let o=c;if(s.length===0)return null;let d;e[2]!==r||e[3]!==a?(d=(0,l.jsx)(Te,{provider:r,className:a}),e[2]=r,e[3]=a,e[4]=d):d=e[4];let u;e[5]===i?u=e[6]:(u=ei(i),e[5]=i,e[6]=u);let m;e[7]!==d||e[8]!==u?(m=(0,l.jsx)(rl,{children:(0,l.jsxs)("p",{className:"flex items-center gap-2",children:[d,u]})}),e[7]=d,e[8]=u,e[9]=m):m=e[9];let h=o?-90:0,x;e[10]===o?x=e[11]:(x=o&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("p",{className:"text-sm text-muted-foreground p-2 max-w-[300px]",children:[o.description,(0,l.jsx)("br",{})]}),(0,l.jsxs)("p",{className:"text-sm text-muted-foreground p-2 pt-0",children:["For more information, see the"," ",(0,l.jsx)("a",{href:o.url,target:"_blank",className:"underline",rel:"noreferrer","aria-label":"Provider details",children:"provider details"}),"."]}),(0,l.jsx)(Et,{})]}),e[10]=o,e[11]=x);let y;if(e[12]!==s||e[13]!==n||e[14]!==i){let _;e[16]!==n||e[17]!==i?(_=C=>{let w=`${i}/${C.model}`;return(0,l.jsxs)(ol,{children:[(0,l.jsx)(rl,{showChevron:!1,className:"py-2",children:(0,l.jsx)("div",{className:"flex items-center gap-2 w-full cursor-pointer",onClick:()=>{n(w)},children:(0,l.jsx)(g0,{model:C,provider:i})})}),(0,l.jsx)(al,{className:"p-4 w-80",children:(0,l.jsx)(f0,{model:C,provider:i})})]},w)},e[16]=n,e[17]=i,e[18]=_):_=e[18],y=s.map(_),e[12]=s,e[13]=n,e[14]=i,e[15]=y}else y=e[15];let j;e[19]!==h||e[20]!==x||e[21]!==y?(j=(0,l.jsx)(Ar,{children:(0,l.jsxs)(al,{className:"max-h-[40vh] overflow-y-auto",alignOffset:h,sideOffset:5,children:[x,y]})}),e[19]=h,e[20]=x,e[21]=y,e[22]=j):j=e[22];let v;return e[23]!==m||e[24]!==j?(v=(0,l.jsxs)(ol,{children:[m,j]}),e[23]=m,e[24]=j,e[25]=v):v=e[25],v},g0=t=>{let e=(0,Jt.c)(17),{model:i,provider:n}=t,s=Pi(n)?n:"openai-compatible",a;e[0]===s?a=e[1]:(a=(0,l.jsx)(Te,{provider:s,className:"h-4 w-4"}),e[0]=s,e[1]=a);let r;e[2]===i.name?r=e[3]:(r=(0,l.jsx)("span",{children:i.name}),e[2]=i.name,e[3]=r);let c;e[4]===i.capabilities?c=e[5]:(c=i.capabilities.includes("thinking")&&(0,l.jsx)(qe,{content:"Reasoning model",children:(0,l.jsx)(vi,{className:`h-5 w-5 rounded-md p-1 ${Qt("thinking")}`})}),e[4]=i.capabilities,e[5]=c);let o;e[6]===c?o=e[7]:(o=(0,l.jsx)("div",{className:"ml-auto",children:c}),e[6]=c,e[7]=o);let d;e[8]!==r||e[9]!==o?(d=(0,l.jsxs)("div",{className:"flex flex-row w-full items-center",children:[r,o]}),e[8]=r,e[9]=o,e[10]=d):d=e[10];let u;e[11]===i.custom?u=e[12]:(u=i.custom&&(0,l.jsx)(qe,{content:"Custom model",children:(0,l.jsx)(ii,{className:"h-5 w-5"})}),e[11]=i.custom,e[12]=u);let m;return e[13]!==a||e[14]!==d||e[15]!==u?(m=(0,l.jsxs)(l.Fragment,{children:[a,d,u]}),e[13]=a,e[14]=d,e[15]=u,e[16]=m):m=e[16],m};const f0=t=>{let e=(0,Jt.c)(28),{model:i,provider:n}=t,s;e[0]===i.name?s=e[1]:(s=(0,l.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,l.jsx)("p",{className:"text-xs text-muted-foreground font-mono",children:i.model}),e[2]=i.model,e[3]=a);let r;e[4]!==s||e[5]!==a?(r=(0,l.jsxs)("div",{children:[s,a]}),e[4]=s,e[5]=a,e[6]=r):r=e[6];let c;e[7]===i.description?c=e[8]:(c=(0,l.jsx)("p",{className:"text-sm text-muted-foreground leading-relaxed",children:i.description}),e[7]=i.description,e[8]=c);let o;e[9]===i.roles?o=e[10]:(o=i.roles.length>0&&(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Capabilities:"}),(0,l.jsx)("div",{className:"flex flex-wrap gap-1",children:i.roles.map(x0)})]}),e[9]=i.roles,e[10]=o);let d;e[11]===i.capabilities?d=e[12]:(d=i.capabilities.includes("thinking")&&(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("div",{className:"w-2 h-2 bg-purple-500 rounded-full animate-pulse"}),(0,l.jsx)("span",{className:"text-xs text-muted-foreground",children:"Supports thinking mode"})]}),e[11]=i.capabilities,e[12]=d);let u;e[13]===n?u=e[14]:(u=(0,l.jsx)(Te,{provider:n,className:"h-4 w-4"}),e[13]=n,e[14]=u);let m;e[15]===n?m=e[16]:(m=ei(n),e[15]=n,e[16]=m);let h;e[17]===m?h=e[18]:(h=(0,l.jsx)("span",{className:"text-xs text-muted-foreground",children:m}),e[17]=m,e[18]=h);let x;e[19]!==u||e[20]!==h?(x=(0,l.jsxs)("div",{className:"flex items-center gap-2 pt-2 border-t border-border",children:[u,h]}),e[19]=u,e[20]=h,e[21]=x):x=e[21];let y;return e[22]!==x||e[23]!==r||e[24]!==c||e[25]!==o||e[26]!==d?(y=(0,l.jsxs)("div",{className:"space-y-3",children:[r,c,o,d,x]}),e[22]=x,e[23]=r,e[24]=c,e[25]=o,e[26]=d,e[27]=y):y=e[27],y};function ei(t){let e=St.getProviderInfo(t);return e?e.name:Wr(t)}function x0(t){return(0,l.jsx)("span",{className:`px-2 py-1 text-xs rounded-md font-medium ${Qt(t)}`,title:xa(t),children:t},t)}export{Di as A,bs as B,Md as C,Ts as D,Hs as E,Mi as F,Gl as G,Ql as H,Ss as I,Bl as J,$l as K,Ks as L,As as M,Ut as N,Ct as O,Yc as P,_i as R,ea as S,Me as T,Wl as U,Zl as V,ji as W,El as X,Tl as Y,Yt as _,Ri as a,qd as b,ya as c,Te as d,aa as f,zi as g,na as h,m0 as i,Es as j,zs as k,vu as l,_t as m,Ka as n,_u as o,nu as p,Rl as q,Vi as r,ku as s,Ma as t,yu as u,sa as v,Ws as w,Ti as x,la as y,rt as z};
|