@decocms/mesh 1.0.21 → 1.0.23
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/client/assets/{AlertCircle-CkBPRGL_.js → AlertCircle-D7Y5lb85.js} +1 -1
- package/dist/client/assets/{ArrowLeft-eDq0PdxL.js → ArrowLeft-DLGdR8R3.js} +1 -1
- package/dist/client/assets/{Calendar-GsuMeXnI.js → Calendar-BIuHCFcF.js} +1 -1
- package/dist/client/assets/{ChevronDown-CqrF2uJ-.js → ChevronDown-DNVwrHI3.js} +1 -1
- package/dist/client/assets/{Clock-d43uwP0y.js → Clock-CbKCY_SW.js} +1 -1
- package/dist/client/assets/{Copy01-CUqgUCLS.js → Copy01-B-rLWzst.js} +1 -1
- package/dist/client/assets/{CpuChip02-CwrVudRE.js → CpuChip02-wuCmGgd2.js} +1 -1
- package/dist/client/assets/{DotsVertical-CGWni397.js → DotsVertical-qrfHOj7f.js} +1 -1
- package/dist/client/assets/{File06-CwcvFGqd.js → File06-DJfHNtkr.js} +1 -1
- package/dist/client/assets/{GitBranch01-B0LIL7GO.js → GitBranch01-DKUtbZqA.js} +1 -1
- package/dist/client/assets/{Inbox01-De35FSLT.js → Inbox01-C3SohPjD.js} +1 -1
- package/dist/client/assets/{InfoCircle-CaOedrxe.js → InfoCircle-JMKMx9jx.js} +1 -1
- package/dist/client/assets/{Key01-BXtnSDND.js → Key01-BUYdliq4.js} +1 -1
- package/dist/client/assets/{LinkExternal01-ClKXW-wQ.js → LinkExternal01-CwO6S7_R.js} +1 -1
- package/dist/client/assets/{Loading01-DfUJLT5a.js → Loading01-DyCC_wp5.js} +1 -1
- package/dist/client/assets/{Lock01-mcQuD2fk.js → Lock01-CJO1oPaw.js} +1 -1
- package/dist/client/assets/{Plus-xQLsl9Xg.js → Plus-BoZvN_rT.js} +1 -1
- package/dist/client/assets/{SearchMd-BAWY3jJ1.js → SearchMd-DBw3zp_M.js} +1 -1
- package/dist/client/assets/{Terminal-CJwUlnBn.js → Terminal-DURJ2Sop.js} +1 -1
- package/dist/client/assets/{Trash01-DAwkJNu8.js → Trash01-D8NpuzHg.js} +1 -1
- package/dist/client/assets/{Upload01-5z8SDkNm.js → Upload01-BYUhUNdK.js} +1 -1
- package/dist/client/assets/{X-SWur-HdE.js → X-BV7uqO3B.js} +1 -1
- package/dist/client/assets/{XClose-CAyc7YMv.js → XClose-Dez1KTRy.js} +1 -1
- package/dist/client/assets/{alert-dialog-dauOR89q.js → alert-dialog-2c4JlYwD.js} +2 -2
- package/dist/client/assets/auth-DLdX6AGd.js +1 -0
- package/dist/client/assets/{auth-catchall-L0DhXNi0.js → auth-catchall-kFa24VQN.js} +1 -1
- package/dist/client/assets/avatar-NC000dj0.js +1 -0
- package/dist/client/assets/{badge-DBsMMhww.js → badge-ffsmxYLL.js} +1 -1
- package/dist/client/assets/{button-UpWqqi7Z.js → button-BM8Ntdfr.js} +1 -1
- package/dist/client/assets/{card-csaWOT-1.js → card-BWKGhflg.js} +1 -1
- package/dist/client/assets/{checkbox-B53QAVdc.js → checkbox-CDB4i5WM.js} +1 -1
- package/dist/client/assets/{collection-detail-DU4x4vE8.js → collection-detail-DUvB2Vch.js} +1 -1
- package/dist/client/assets/{collection-display-button-CJMwmXuc.js → collection-display-button-M0ZEYwbq.js} +1 -1
- package/dist/client/assets/{collection-header-BIZLVBPH.js → collection-header-BZq2RMFO.js} +1 -1
- package/dist/client/assets/{collection-page-CpTNB-W7.js → collection-page-DV7fHb8_.js} +1 -1
- package/dist/client/assets/{collection-search-xvAQUbQ8.js → collection-search-D4vMytfv.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-BLpgESGM.js → collection-table-wrapper-CDYLUpBi.js} +1 -1
- package/dist/client/assets/{connection-card-DIVWkbya.js → connection-card-DMoDmlju.js} +1 -1
- package/dist/client/assets/connection-detail-BPMKrF4u.js +1 -0
- package/dist/client/assets/connections-W2RFM1S-.js +1 -0
- package/dist/client/assets/{core-Cy6-sfQL.js → core-CJVZ6TZ4.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-BpD_WYLu.js → create-organization-dialog-DY8wFeXZ.js} +1 -1
- package/dist/client/assets/{dialog-DQ_m9LgP.js → dialog-_0iI5rNw.js} +1 -1
- package/dist/client/assets/{dropdown-menu-B_pozn9G.js → dropdown-menu-4Ypgp2xI.js} +1 -1
- package/dist/client/assets/env-vars-editor-DuAsDAtd.js +1 -0
- package/dist/client/assets/{error-boundary-07xTy_TK.js → error-boundary-Dd7BgwTJ.js} +1 -1
- package/dist/client/assets/{extract-connection-data-DzWc2H-V.js → extract-connection-data-C4wZpmQd.js} +1 -1
- package/dist/client/assets/{form-CGaxh2WC.js → form-DNdbWanJ.js} +1 -1
- package/dist/client/assets/{formatDistanceToNow-BzQ8Uo3Q.js → formatDistanceToNow-CNMZ-Ei_.js} +1 -1
- package/dist/client/assets/gateway-detail-De4b4XSK.js +1 -0
- package/dist/client/assets/{gateways-B-RGUqRx.js → gateways-q4D0Ec2r.js} +1 -1
- package/dist/client/assets/{home-FzIxjpJt.js → home-RuIm8-ic.js} +1 -1
- package/dist/client/assets/index-BdkjLo3e.css +1 -0
- package/dist/client/assets/{index-D_9U2egr.js → index-BlsDXE23.js} +20 -20
- package/dist/client/assets/{index-D_TAlzS2.js → index-CD92JRY8.js} +1 -1
- package/dist/client/assets/{index-Czm7CWjK.js → index-CGy1qJ5Y.js} +1 -1
- package/dist/client/assets/{index-CB7OHJDJ.js → index-MYfTA9Ba.js} +1 -1
- package/dist/client/assets/{input-DNanPJKs.js → input-B45bC0Rc.js} +1 -1
- package/dist/client/assets/json-DzSEyFTU.js +1 -0
- package/dist/client/assets/{json-syntax-highlighter-BgGlXkoS.js → json-syntax-highlighter-DO7qBvWL.js} +2 -2
- package/dist/client/assets/{layout-Cx9b8Yer.js → layout-RDUry3u6.js} +1 -1
- package/dist/client/assets/{lazy-highlighter-B6ffJp-C.js → lazy-highlighter-KouMYaFu.js} +1 -1
- package/dist/client/assets/{localstorage-keys-BkdyiQZF.js → localstorage-keys-BNPDgZQf.js} +1 -1
- package/dist/client/assets/{login-C7pFWDVX.js → login-BZwM9o36.js} +1 -1
- package/dist/client/assets/{mcp-oauth-C_ge4NPz.js → mcp-oauth-BxQJ_sZ7.js} +1 -1
- package/dist/client/assets/members-b4fCyidG.js +3 -0
- package/dist/client/assets/monitoring-C3u-RljV.js +1 -0
- package/dist/client/assets/{oauth-callback-DVsq0aWr.js → oauth-callback-C8RVlzMp.js} +1 -1
- package/dist/client/assets/{page-lDA0jUjQ.js → page-D9cTJOkH.js} +1 -1
- package/dist/client/assets/popover-CDfnuIYl.js +1 -0
- package/dist/client/assets/prism-light-CAnIadDL.js +1 -0
- package/dist/client/assets/{resizable-CjAFAEbu.js → resizable-CwsfF64n.js} +34 -34
- package/dist/client/assets/{resource-tabs-CwnllnxC.js → resource-tabs-yHmaZ9ZD.js} +1 -1
- package/dist/client/assets/select-CG-oLpgX.js +1 -0
- package/dist/client/assets/{settings-B33ucW8T.js → settings-CrKQeRt-.js} +1 -1
- package/dist/client/assets/shell-layout-DRz6Ov6H.js +19 -0
- package/dist/client/assets/{spinner-mwkhkfGn.js → spinner-BIp36cWs.js} +1 -1
- package/dist/client/assets/{store-bCSxhgbO.js → store-DpYoNJNm.js} +1 -1
- package/dist/client/assets/{store-app-detail-MMa90jUl.js → store-app-detail-CxLOlzfX.js} +1 -1
- package/dist/client/assets/switch-Ckivla4Z.js +1 -0
- package/dist/client/assets/{tools-list-ReDr32oC.js → tools-list-DWIsrkx2.js} +1 -1
- package/dist/client/assets/tooltip-CYopm1Sm.js +1 -0
- package/dist/client/assets/{types-C7Od-bBc.js → types-Bmw9MVte.js} +1 -1
- package/dist/client/assets/{use-binding-q2q9V0d9.js → use-binding-DiGbYyGi.js} +6 -6
- package/dist/client/assets/{use-connection-CCY0Xwwp.js → use-connection-BGthiOfQ.js} +1 -1
- package/dist/client/assets/{use-connection-resources-CQX8IZC3.js → use-connection-resources-B-9emPmy.js} +1 -1
- package/dist/client/assets/{use-gateway-6PKj5OoP.js → use-gateway-B_vZFCo_.js} +1 -1
- package/dist/client/assets/{use-list-state-C-sROL5p.js → use-list-state-D2xhuXBP.js} +1 -1
- package/dist/client/assets/{use-mcp-W5evRIL-.js → use-mcp-CKeUPEl8.js} +1 -1
- package/dist/client/assets/{use-members-DBU71Me9.js → use-members-DGy3Ohsl.js} +1 -1
- package/dist/client/assets/{use-mobile-DjZ7nTWx.js → use-mobile-BSF9aYm8.js} +1 -1
- package/dist/client/assets/{use-organization-settings-Du1vfsWT.js → use-organization-settings-Xs2e_hDY.js} +1 -1
- package/dist/client/assets/{use-tool-call-DTxbLF2G.js → use-tool-call-DOhzogS9.js} +1 -1
- package/dist/client/assets/useQuery-CA4Qsiz4.js +1 -0
- package/dist/client/assets/{useSuspenseInfiniteQuery-6jf87YQF.js → useSuspenseInfiniteQuery-HnhdgP6D.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-BWA1OFcI.js → view-mode-toggle-D-v785I-.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +141 -141
- package/dist/server/migrate.js +87 -87
- package/dist/server/server.js +138 -138
- package/package.json +1 -1
- package/dist/client/assets/auth-Ds7lWA5K.js +0 -1
- package/dist/client/assets/avatar-CB7RLPFt.js +0 -1
- package/dist/client/assets/connection-detail-Cdicu8TT.js +0 -1
- package/dist/client/assets/connections-BYIPhseC.js +0 -1
- package/dist/client/assets/env-vars-editor-DcIkv_3p.js +0 -1
- package/dist/client/assets/gateway-detail-DOKwn-_O.js +0 -1
- package/dist/client/assets/index-DNC-5MRZ.css +0 -1
- package/dist/client/assets/json-rZ-8IzF3.js +0 -1
- package/dist/client/assets/members-g3aHOb_a.js +0 -3
- package/dist/client/assets/monitoring-B4Jp1FeK.js +0 -1
- package/dist/client/assets/popover-BN78TD4M.js +0 -1
- package/dist/client/assets/prism-light-B_WmfTLI.js +0 -1
- package/dist/client/assets/select-888i9ck2.js +0 -1
- package/dist/client/assets/shell-layout-D2VG1r1F.js +0 -17
- package/dist/client/assets/switch-CxdnIT30.js +0 -1
- package/dist/client/assets/tooltip-CaoJSXa7.js +0 -1
- package/dist/client/assets/useQuery-BTda2D25.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aw as Pt,r as N,c as P,d as Rn,j as p,g as Ks,av as Yi,x as ip,y as ru,v as lp,w as jo,i as ap,b as cp,t as up,F as ee,Q as dp,ax as Ro,ay as su,al as fp,ak as hp,az as pp,H as Xi,a5 as ou,a8 as mp,B as Dn,E as We,a2 as Qi,a9 as gp,z as Js,a6 as yp,a1 as Zi,af as xp,ag as bp,ah as kp,aA as el,aB as vp,a7 as iu,a4 as wp,aC as Sp,L as Cp,aD as Np,aE as Ep}from"./index-D_9U2egr.js";import{U as ht,f as tl,d as Gs,c as Lt,b as nl,I as Ys,u as Tp,n as Mp}from"./use-connection-CCY0Xwwp.js";import{d as Op,C as mn,e as Ap,f as Ip,g as jp,I as Rp,B as Dp,n as ca,G as lu,M as Pp,o as Lp,R as ua,m as $p}from"./resizable-CjAFAEbu.js";import{E as vr,i as _p}from"./SearchMd-BAWY3jJ1.js";import{E as ar}from"./error-boundary-07xTy_TK.js";import{P as Xs}from"./formatDistanceToNow-BzQ8Uo3Q.js";import{u as zp,L as Bp}from"./localstorage-keys-BkdyiQZF.js";import{u as Fp,a as Ue,c as Ke,b as Je,T as Ge,i as rl}from"./tooltip-CaoJSXa7.js";import{B as ue,c as Z}from"./button-UpWqqi7Z.js";import{F as ct,a as au,b as $t,c as wr,d as Pn}from"./form-CGaxh2WC.js";import{I as Ln}from"./input-DNanPJKs.js";import{T as Zr,D as Vp,a as Hp,b as Wp,f as qp,c as Up,d as Kp}from"./dialog-DQ_m9LgP.js";import{A as Jp,D as Gp,u as Yp}from"./use-binding-q2q9V0d9.js";import{i as Zt}from"./Loading01-DfUJLT5a.js";import{s as sl}from"./Plus-xQLsl9Xg.js";import{i as Xp}from"./Upload01-5z8SDkNm.js";import{b as Nn,a as ol,V as Qs}from"./layout-Cx9b8Yer.js";import{i as Qp}from"./AlertCircle-CkBPRGL_.js";import{s as Zp}from"./Clock-d43uwP0y.js";import{a as em}from"./Copy01-CUqgUCLS.js";import{i as il,J as tm}from"./json-syntax-highlighter-BgGlXkoS.js";import{s as ll,i as cu}from"./XClose-CAyc7YMv.js";import{u as nm,O as rm,M as sm,F as om,v as im,E as lm}from"./index-D_TAlzS2.js";import{u as al}from"./use-mcp-W5evRIL-.js";import{S as $n}from"./spinner-mwkhkfGn.js";import{V as am}from"./view-mode-toggle-BWA1OFcI.js";import{i as cm}from"./GitBranch01-B0LIL7GO.js";import{a as uu,b as um}from"./use-tool-call-DTxbLF2G.js";import"./index-Czm7CWjK.js";import{n as dm}from"./Calendar-GsuMeXnI.js";import{b as fm,D as hm,a as pm,d as da,i as mm}from"./dropdown-menu-B_pozn9G.js";import{B as fn}from"./badge-DBsMMhww.js";import{i as du}from"./X-SWur-HdE.js";import"./CpuChip02-CwrVudRE.js";import"./select-888i9ck2.js";import"./ChevronDown-CqrF2uJ-.js";import"./use-mobile-DjZ7nTWx.js";import"./use-gateway-6PKj5OoP.js";import"./Terminal-CJwUlnBn.js";import"./connection-card-DIVWkbya.js";import"./card-csaWOT-1.js";import"./LinkExternal01-ClKXW-wQ.js";import"./alert-dialog-dauOR89q.js";import"./File06-CwcvFGqd.js";import"./InfoCircle-CaOedrxe.js";import"./use-organization-settings-Du1vfsWT.js";import"./useQuery-BTda2D25.js";import"./auth-Ds7lWA5K.js";import"./ArrowLeft-eDq0PdxL.js";import"./mcp-oauth-C_ge4NPz.js";import"./env-vars-editor-DcIkv_3p.js";import"./Trash01-DAwkJNu8.js";import"./Key01-BXtnSDND.js";import"./extract-connection-data-DzWc2H-V.js";import"./registry-utils-ulDDT0d8.js";import"./generate-id-Dyweu44Y.js";import"./index-CB7OHJDJ.js";const fu=Pt("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);const hu=Pt("Braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]);const gm=Pt("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);const ym=Pt("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const pu=Pt("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const mu=Pt("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);const gu=Pt("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);const yu=Pt("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]),cl=({size:n=24,color:e="currentColor",...t})=>N.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},N.createElement("path",{d:"M12 8v4m0 4h.01M2 8.523v6.954c0 .245 0 .367.028.482a1 1 0 0 0 .12.29c.061.1.148.187.32.36l4.923 4.922c.173.173.26.26.36.322.09.054.188.095.29.12.115.027.237.027.482.027h6.954c.245 0 .367 0 .482-.028a.998.998 0 0 0 .29-.12c.1-.061.187-.148.36-.32l4.922-4.923c.173-.173.26-.26.322-.36a.998.998 0 0 0 .12-.29c.027-.115.027-.237.027-.482V8.523c0-.245 0-.367-.028-.482a.998.998 0 0 0-.12-.29c-.061-.1-.148-.187-.32-.36L16.608 2.47c-.173-.173-.26-.26-.36-.322a1 1 0 0 0-.29-.12C15.844 2 15.722 2 15.477 2H8.523c-.245 0-.367 0-.482.028a1 1 0 0 0-.29.12c-.1.061-.187.148-.36.32L2.47 7.392c-.173.173-.26.26-.322.36a1 1 0 0 0-.12.29C2 8.156 2 8.278 2 8.523Z"}));cl.displayName="AlertOctagon";const xu=({size:n=24,color:e="currentColor",...t})=>N.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},N.createElement("path",{d:"M20.5 8v8.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.22 21 17.38 21 15.7 21H8.3c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3.5 18.72 3.5 17.88 3.5 16.2V8m.1-5h16.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C22 3.76 22 4.04 22 4.6v1.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437C21.24 8 20.96 8 20.4 8H3.6c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C2 7.24 2 6.96 2 6.4V4.6c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C2.76 3 3.04 3 3.6 3Zm6 8.5h4.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C16 12.26 16 12.54 16 13.1v.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437c-.214.109-.494.109-1.054.109H9.6c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C8 14.74 8 14.46 8 13.9v-.8c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C8.76 11.5 9.04 11.5 9.6 11.5Z"}));xu.displayName="Box";const bu=({size:n=24,color:e="currentColor",...t})=>N.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},N.createElement("path",{d:"m22.7 11.5-2 2-2-2m2.245 1.5A9 9 0 1 0 19 17.657M12 7v5l3 2"}));bu.displayName="ClockFastForward";const ku=({size:n=24,color:e="currentColor",...t})=>N.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},N.createElement("path",{d:"m16 18 6-6-6-6M8 6l-6 6 6 6"}));ku.displayName="Code01";const vu=({size:n=24,color:e="currentColor",...t})=>N.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},N.createElement("path",{d:"m17 17 5-5-5-5M7 7l-5 5 5 5m7-14-4 18"}));vu.displayName="Code02";const wu=({size:n=24,color:e="currentColor",...t})=>N.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},N.createElement("path",{d:"M12 17a5 5 0 1 0 10 0 5 5 0 0 0-10 0Zm0 0c0-1.126.372-2.165 1-3V5m-1 12c0 .825.2 1.604.554 2.29-.842.712-2.788 1.21-5.054 1.21-3.038 0-5.5-.895-5.5-2V5m11 0c0 1.105-2.462 2-5.5 2S2 6.105 2 5m11 0c0-1.105-2.462-2-5.5-2S2 3.895 2 5m0 9c0 1.105 2.462 2 5.5 2 2.189 0 4.08-.465 4.965-1.138M13 9.5c0 1.105-2.462 2-5.5 2S2 10.605 2 9.5"}));wu.displayName="CoinsStacked01";const Ur=({size:n=24,color:e="currentColor",...t})=>N.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},N.createElement("path",{d:"M6.8 3h-.6c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C3 4.52 3 5.08 3 6.2v11.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C4.52 21 5.08 21 6.2 21h.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C10 19.48 10 18.92 10 17.8V6.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C8.48 3 7.92 3 6.8 3Zm11 0h-.6c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C14 4.52 14 5.08 14 6.2v11.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C15.52 21 16.08 21 17.2 21h.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C21 19.48 21 18.92 21 17.8V6.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C19.48 3 18.92 3 17.8 3Z"}));Ur.displayName="Columns01";const Su=({size:n=24,color:e="currentColor",...t})=>N.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},N.createElement("path",{d:"M4 4v1.4c0 3.36 0 5.04.654 6.324a6 6 0 0 0 2.622 2.622C8.56 15 10.24 15 13.6 15H20m0 0-5-5m5 5-5 5"}));Su.displayName="CornerDownRight";const Cu=({size:n=24,color:e="currentColor",...t})=>N.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},N.createElement("path",{d:"M21 5c0 1.657-4.03 3-9 3S3 6.657 3 5m18 0c0-1.657-4.03-3-9-3S3 3.343 3 5m18 0v14c0 1.66-4 3-9 3s-9-1.34-9-3V5m18 7c0 1.66-4 3-9 3s-9-1.34-9-3"}));Cu.displayName="Database01";const Nu=({size:n=24,color:e="currentColor",...t})=>N.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},N.createElement("path",{d:"M11 4H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 6.28 2 7.12 2 8.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C4.28 22 5.12 22 6.8 22h8.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C20 19.72 20 18.88 20 17.2V13M8 16h1.675c.489 0 .733 0 .963-.055.204-.05.4-.13.579-.24.201-.123.374-.296.72-.642L21.5 5.5a2.121 2.121 0 0 0-3-3l-9.563 9.563c-.346.346-.519.519-.642.72a2 2 0 0 0-.24.579c-.055.23-.055.474-.055.963V16Z"}));Nu.displayName="Edit05";const Zs=({size:n=24,color:e="currentColor",...t})=>N.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},N.createElement("path",{d:"M3 9h13.5a4.5 4.5 0 1 1 0 9H12M3 9l4-4M3 9l4 4"}));Zs.displayName="FlipBackward";const Eu=({size:n=24,color:e="currentColor",...t})=>N.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},N.createElement("path",{d:"m13 22-3-3m0 0 3-3m-3 3h5a7 7 0 0 0 3-13.326M6 18.326A7 7 0 0 1 9 5h5m0 0-3-3m3 3-3 3"}));Eu.displayName="Repeat03";const eo=({size:n=24,color:e="currentColor",...t})=>N.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},N.createElement("path",{d:"M15 8H8.6c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C7 7.24 7 6.96 7 6.4V3m10 18v-6.4c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C16.24 13 15.96 13 15.4 13H8.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C7 13.76 7 14.04 7 14.6V21M21 9.325V16.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h6.875c.489 0 .733 0 .963.055.204.05.4.13.579.24.201.123.374.296.72.642l3.126 3.126c.346.346.519.519.642.72.11.18.19.374.24.579.055.23.055.474.055.963Z"}));eo.displayName="Save02";const Tu=({size:n=24,color:e="currentColor",...t})=>N.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},N.createElement("path",{d:"M15.631 7.631c-.396-.396-.594-.594-.668-.822a1 1 0 0 1 0-.618c.074-.228.272-.426.668-.822L18.47 2.53a6 6 0 0 0-8.3 6.895c.12.49.179.734.168.888a.849.849 0 0 1-.11.392c-.07.138-.207.274-.48.547L3.5 17.5a2.121 2.121 0 0 0 3 3l6.248-6.248c.273-.273.41-.41.547-.48a.849.849 0 0 1 .392-.11c.154-.011.399.049.888.168a6 6 0 0 0 6.895-8.3l-2.84 2.84c-.396.396-.594.594-.822.668a1 1 0 0 1-.618 0c-.228-.074-.426-.272-.822-.668l-.738-.738Z"}));Tu.displayName="Tool01";const to=({size:n=24,color:e="currentColor",...t})=>N.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},N.createElement("path",{d:"M16 3.468a4.5 4.5 0 0 1 0 8.064m2 5.234c1.512.684 2.872 1.799 4 3.234M2 20c1.946-2.477 4.59-4 7.5-4s5.553 1.523 7.5 4M14 7.5a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0Z"}));to.displayName="Users02";const{getOwnPropertyNames:xm,getOwnPropertySymbols:bm}=Object,{hasOwnProperty:km}=Object.prototype;function Do(n,e){return function(r,s,o){return n(r,s,o)&&e(r,s,o)}}function Ir(n){return function(t,r,s){if(!t||!r||typeof t!="object"||typeof r!="object")return n(t,r,s);const{cache:o}=s,i=o.get(t),l=o.get(r);if(i&&l)return i===r&&l===t;o.set(t,r),o.set(r,t);const a=n(t,r,s);return o.delete(t),o.delete(r),a}}function vm(n){return n?.[Symbol.toStringTag]}function fa(n){return xm(n).concat(bm(n))}const wm=Object.hasOwn||((n,e)=>km.call(n,e));function on(n,e){return n===e||!n&&!e&&n!==n&&e!==e}const Sm="__v",Cm="__o",Nm="_owner",{getOwnPropertyDescriptor:ha,keys:pa}=Object;function Em(n,e){return n.byteLength===e.byteLength&&es(new Uint8Array(n),new Uint8Array(e))}function Tm(n,e,t){let r=n.length;if(e.length!==r)return!1;for(;r-- >0;)if(!t.equals(n[r],e[r],r,r,n,e,t))return!1;return!0}function Mm(n,e){return n.byteLength===e.byteLength&&es(new Uint8Array(n.buffer,n.byteOffset,n.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function Om(n,e){return on(n.getTime(),e.getTime())}function Am(n,e){return n.name===e.name&&n.message===e.message&&n.cause===e.cause&&n.stack===e.stack}function Im(n,e){return n===e}function ma(n,e,t){const r=n.size;if(r!==e.size)return!1;if(!r)return!0;const s=new Array(r),o=n.entries();let i,l,a=0;for(;(i=o.next())&&!i.done;){const c=e.entries();let u=!1,d=0;for(;(l=c.next())&&!l.done;){if(s[d]){d++;continue}const f=i.value,h=l.value;if(t.equals(f[0],h[0],a,d,n,e,t)&&t.equals(f[1],h[1],f[0],h[0],n,e,t)){u=s[d]=!0;break}d++}if(!u)return!1;a++}return!0}const jm=on;function Rm(n,e,t){const r=pa(n);let s=r.length;if(pa(e).length!==s)return!1;for(;s-- >0;)if(!Mu(n,e,t,r[s]))return!1;return!0}function Hn(n,e,t){const r=fa(n);let s=r.length;if(fa(e).length!==s)return!1;let o,i,l;for(;s-- >0;)if(o=r[s],!Mu(n,e,t,o)||(i=ha(n,o),l=ha(e,o),(i||l)&&(!i||!l||i.configurable!==l.configurable||i.enumerable!==l.enumerable||i.writable!==l.writable)))return!1;return!0}function Dm(n,e){return on(n.valueOf(),e.valueOf())}function Pm(n,e){return n.source===e.source&&n.flags===e.flags}function ga(n,e,t){const r=n.size;if(r!==e.size)return!1;if(!r)return!0;const s=new Array(r),o=n.values();let i,l;for(;(i=o.next())&&!i.done;){const a=e.values();let c=!1,u=0;for(;(l=a.next())&&!l.done;){if(!s[u]&&t.equals(i.value,l.value,i.value,l.value,n,e,t)){c=s[u]=!0;break}u++}if(!c)return!1}return!0}function es(n,e){let t=n.byteLength;if(e.byteLength!==t||n.byteOffset!==e.byteOffset)return!1;for(;t-- >0;)if(n[t]!==e[t])return!1;return!0}function Lm(n,e){return n.hostname===e.hostname&&n.pathname===e.pathname&&n.protocol===e.protocol&&n.port===e.port&&n.hash===e.hash&&n.username===e.username&&n.password===e.password}function Mu(n,e,t,r){return(r===Nm||r===Cm||r===Sm)&&(n.$$typeof||e.$$typeof)?!0:wm(e,r)&&t.equals(n[r],e[r],r,r,n,e,t)}const $m="[object ArrayBuffer]",_m="[object Arguments]",zm="[object Boolean]",Bm="[object DataView]",Fm="[object Date]",Vm="[object Error]",Hm="[object Map]",Wm="[object Number]",qm="[object Object]",Um="[object RegExp]",Km="[object Set]",Jm="[object String]",Gm={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},Ym="[object URL]",Xm=Object.prototype.toString;function Qm({areArrayBuffersEqual:n,areArraysEqual:e,areDataViewsEqual:t,areDatesEqual:r,areErrorsEqual:s,areFunctionsEqual:o,areMapsEqual:i,areNumbersEqual:l,areObjectsEqual:a,arePrimitiveWrappersEqual:c,areRegExpsEqual:u,areSetsEqual:d,areTypedArraysEqual:f,areUrlsEqual:h,unknownTagComparators:m}){return function(y,x,b){if(y===x)return!0;if(y==null||x==null)return!1;const v=typeof y;if(v!==typeof x)return!1;if(v!=="object")return v==="number"?l(y,x,b):v==="function"?o(y,x,b):!1;const C=y.constructor;if(C!==x.constructor)return!1;if(C===Object)return a(y,x,b);if(Array.isArray(y))return e(y,x,b);if(C===Date)return r(y,x,b);if(C===RegExp)return u(y,x,b);if(C===Map)return i(y,x,b);if(C===Set)return d(y,x,b);const k=Xm.call(y);if(k===Fm)return r(y,x,b);if(k===Um)return u(y,x,b);if(k===Hm)return i(y,x,b);if(k===Km)return d(y,x,b);if(k===qm)return typeof y.then!="function"&&typeof x.then!="function"&&a(y,x,b);if(k===Ym)return h(y,x,b);if(k===Vm)return s(y,x,b);if(k===_m)return a(y,x,b);if(Gm[k])return f(y,x,b);if(k===$m)return n(y,x,b);if(k===Bm)return t(y,x,b);if(k===zm||k===Wm||k===Jm)return c(y,x,b);if(m){let w=m[k];if(!w){const S=vm(y);S&&(w=m[S])}if(w)return w(y,x,b)}return!1}}function Zm({circular:n,createCustomConfig:e,strict:t}){let r={areArrayBuffersEqual:Em,areArraysEqual:t?Hn:Tm,areDataViewsEqual:Mm,areDatesEqual:Om,areErrorsEqual:Am,areFunctionsEqual:Im,areMapsEqual:t?Do(ma,Hn):ma,areNumbersEqual:jm,areObjectsEqual:t?Hn:Rm,arePrimitiveWrappersEqual:Dm,areRegExpsEqual:Pm,areSetsEqual:t?Do(ga,Hn):ga,areTypedArraysEqual:t?Do(es,Hn):es,areUrlsEqual:Lm,unknownTagComparators:void 0};if(e&&(r=Object.assign({},r,e(r))),n){const s=Ir(r.areArraysEqual),o=Ir(r.areMapsEqual),i=Ir(r.areObjectsEqual),l=Ir(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:s,areMapsEqual:o,areObjectsEqual:i,areSetsEqual:l})}return r}function eg(n){return function(e,t,r,s,o,i,l){return n(e,t,l)}}function tg({circular:n,comparator:e,createState:t,equals:r,strict:s}){if(t)return function(l,a){const{cache:c=n?new WeakMap:void 0,meta:u}=t();return e(l,a,{cache:c,equals:r,meta:u,strict:s})};if(n)return function(l,a){return e(l,a,{cache:new WeakMap,equals:r,meta:void 0,strict:s})};const o={cache:void 0,equals:r,meta:void 0,strict:s};return function(l,a){return e(l,a,o)}}const ng=_t();_t({strict:!0});_t({circular:!0});_t({circular:!0,strict:!0});_t({createInternalComparator:()=>on});_t({strict:!0,createInternalComparator:()=>on});_t({circular:!0,createInternalComparator:()=>on});_t({circular:!0,createInternalComparator:()=>on,strict:!0});function _t(n={}){const{circular:e=!1,createInternalComparator:t,createState:r,strict:s=!1}=n,o=Zm(n),i=Qm(o),l=t?t(i):eg(i);return tg({circular:e,comparator:i,createState:r,equals:l,strict:s})}function rg(n){const e=P.c(3),{gatewayId:t,onSelect:r}=n,{data:s}=Ip(t);if(s.length===0)return null;let o;return e[0]!==r||e[1]!==s?(o=p.jsx(Rp,{prompts:s,onSelect:r,className:"mt-6"}),e[0]=r,e[1]=s,e[2]=o):o=e[2],o}function sg(n){const e=P.c(20),{form:t}=n;let r;e[0]!==t?(r=d=>{const{field:f}=d;return p.jsx(hg,{size:"md",value:f.value,onChange:f.onChange,alt:t.watch("title")})},e[0]=t,e[1]=r):r=e[1];let s;e[2]!==t.control||e[3]!==r?(s=p.jsx(ct,{control:t.control,name:"avatar",render:r}),e[2]=t.control,e[3]=r,e[4]=s):s=e[4];let o;e[5]!==t.control?(o=p.jsxs("div",{className:"flex flex-col gap-3 flex-1 min-w-0",children:[p.jsx(ct,{control:t.control,name:"title",render:cg}),p.jsx(ct,{control:t.control,name:"description",render:ag})]}),e[5]=t.control,e[6]=o):o=e[6];let i;e[7]!==s||e[8]!==o?(i=p.jsxs("div",{className:"flex gap-4 items-start",children:[s,o]}),e[7]=s,e[8]=o,e[9]=i):i=e[9];let l,a;e[10]!==t.control?(l=p.jsxs("div",{className:"flex gap-4",children:[p.jsx(ct,{control:t.control,name:"gateway_id",render:lg}),p.jsx(ct,{control:t.control,name:"model",render:ig})]}),a=p.jsx(ct,{control:t.control,name:"system_prompt",render:og}),e[10]=t.control,e[11]=l,e[12]=a):(l=e[11],a=e[12]);let c;e[13]!==i||e[14]!==l||e[15]!==a?(c=p.jsxs("div",{className:"h-full py-6 flex flex-col max-w-2xl mx-auto w-full min-w-0 gap-6 overflow-y-auto",children:[i,l,a]}),e[13]=i,e[14]=l,e[15]=a,e[16]=c):c=e[16];let u;return e[17]!==t||e[18]!==c?(u=p.jsx(au,{...t,children:c}),e[17]=t,e[18]=c,e[19]=u):u=e[19],u}function og(n){const{field:e}=n;return p.jsxs($t,{className:"flex-1 flex flex-col min-h-0",children:[p.jsx(wr,{className:"text-xs text-muted-foreground",children:"System prompt"}),p.jsx(Pn,{children:p.jsx(Zr,{...e,placeholder:"You are a helpful assistant...",className:"flex-1 min-h-[200px] resize-none text-base leading-relaxed font-normal rounded-xl border border-border bg-muted/20 px-4 py-3 shadow-none focus-visible:ring-0"})})]})}function ig(n){const{field:e}=n;return p.jsxs($t,{className:"flex-1",children:[p.jsx(wr,{className:"text-xs text-muted-foreground",children:"Model"}),p.jsx(Pp,{selectedModel:e.value?{id:e.value.id,connectionId:e.value.connectionId}:void 0,onModelChange:t=>e.onChange({id:t.id,connectionId:t.connectionId}),placeholder:"Select model",variant:"bordered",className:"w-full"})]})}function lg(n){const{field:e}=n;return p.jsxs($t,{className:"flex-1",children:[p.jsx(wr,{className:"text-xs text-muted-foreground",children:"Gateway"}),p.jsx(lu,{selectedGatewayId:e.value,onGatewayChange:e.onChange,placeholder:"Select gateway",variant:"bordered",className:"w-full"})]})}function ag(n){const{field:e}=n;return p.jsxs($t,{children:[p.jsx(wr,{className:"text-xs text-muted-foreground",children:"Description"}),p.jsx(Pn,{children:p.jsx(Ln,{...e,value:e.value??"",placeholder:"Add a description…",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function cg(n){const{field:e}=n;return p.jsxs($t,{children:[p.jsx(wr,{className:"text-xs text-muted-foreground",children:"Name"}),p.jsx(Pn,{children:p.jsx(Ln,{...e,placeholder:"Untitled assistant",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function ug(n){const e=P.c(12),{onSubmit:t,onStop:r,isStreaming:s,disabled:o,usageMessages:i}=n,{inputValue:l,handleInputChange:a,handleSubmit:c,branchContext:u}=jp();let d;e[0]!==c||e[1]!==t?(d=m=>c(m,t),e[0]=c,e[1]=t,e[2]=d):d=e[2];const f=u?"Edit your message...":"Ask anything or @ for context";let h;return e[3]!==o||e[4]!==a||e[5]!==l||e[6]!==s||e[7]!==r||e[8]!==d||e[9]!==f||e[10]!==i?(h=p.jsx(mn.Input,{onSubmit:d,onStop:r,disabled:o,isStreaming:s,placeholder:f,usageMessages:i,value:l,onValueChange:a}),e[3]=o,e[4]=a,e[5]=l,e[6]=s,e[7]=r,e[8]=d,e[9]=f,e[10]=i,e[11]=h):h=e[11],h}function dg(n){const e=P.c(77),{activeThreadId:t,setActiveThreadId:r,mode:s,assistant:o,form:i}=n;let l;e[0]!==t||e[1]!==o.system_prompt||e[2]!==r?(l={threadId:t,systemPrompt:o.system_prompt,onThreadChange:r},e[0]=t,e[1]=o.system_prompt,e[2]=r,e[3]=l):l=e[3];const a=Op(l),{inputController:c,branchContext:u,clearBranchContext:d,branchFromMessage:f}=a,h=!!o.gateway_id&&!!o.model?.id&&!!o.model?.connectionId;let m;e[4]!==t||e[5]!==o.gateway_id||e[6]!==o.model||e[7]!==a||e[8]!==d||e[9]!==h?(m=async He=>{if(!h)return;const gt={created_at:new Date().toISOString(),thread_id:t,model:{id:o.model.id,connectionId:o.model.connectionId},gateway:{id:o.gateway_id??""},user:{name:"you"}};await a.sendMessage(He,gt),d()},e[4]=t,e[5]=o.gateway_id,e[6]=o.model,e[7]=a,e[8]=d,e[9]=h,e[10]=m):m=e[10];const g=m;let y;e[11]!==u||e[12]!==d||e[13]!==c||e[14]!==r?(y=()=>{u&&(r(u.originalThreadId),d(),c.setValue(""))},e[11]=u,e[12]=d,e[13]=c,e[14]=r,e[15]=y):y=e[15];const x=y;let b;e[16]!==o.avatar||e[17]!==o.title?(b=o.avatar?p.jsx("div",{className:"size-[60px] rounded-[18px] border border-border shrink-0 overflow-hidden",children:p.jsx("img",{src:o.avatar,alt:o.title,className:"h-full w-full object-cover"})}):p.jsx("div",{className:"size-[60px] rounded-[18px] border border-border shrink-0 overflow-hidden bg-muted/20 flex items-center justify-center",children:p.jsx(to,{size:28,className:"text-muted-foreground"})}),e[16]=o.avatar,e[17]=o.title,e[18]=b):b=e[18];let v;e[19]!==o.title?(v=p.jsx("h3",{className:"text-xl font-medium text-foreground",children:o.title}),e[19]=o.title,e[20]=v):v=e[20];let C;e[21]!==o.description?(C=o.description?p.jsx("div",{className:"text-muted-foreground text-center text-sm max-w-md",children:o.description}):null,e[21]=o.description,e[22]=C):C=e[22];let k;e[23]!==b||e[24]!==v||e[25]!==C?(k=p.jsxs("div",{className:"flex flex-col items-center gap-4",children:[b,v,C]}),e[23]=b,e[24]=v,e[25]=C,e[26]=k):k=e[26];let w;e[27]!==o.gateway_id||e[28]!==g?(w=o.gateway_id&&p.jsx(ar,{fallback:null,children:p.jsx(N.Suspense,{fallback:p.jsx("div",{className:"flex justify-center mt-6",children:p.jsx(Zt,{size:20,className:"animate-spin text-muted-foreground"})}),children:p.jsx(rg,{gatewayId:o.gateway_id,onSelect:He=>{g(He.description??He.name)}})})}),e[27]=o.gateway_id,e[28]=g,e[29]=w):w=e[29];let S;e[30]!==k||e[31]!==w?(S=p.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 p-4 text-center",children:[k,w]}),e[30]=k,e[31]=w,e[32]=S):S=e[32];const M=S;let E;e[33]!==a.messages?(E=a.messages.filter(fg),e[33]=a.messages,e[34]=E):E=e[34];const T=E,R=s==="edit",L=R?"opacity-100 pointer-events-auto":"opacity-0 pointer-events-none";let B;e[35]!==L?(B=Z("absolute inset-0 px-2 transition-opacity duration-200 ease-out",L),e[35]=L,e[36]=B):B=e[36];let _;e[37]!==i?(_=p.jsx(sg,{form:i}),e[37]=i,e[38]=_):_=e[38];let O;e[39]!==B||e[40]!==_?(O=p.jsx("div",{className:B,children:_}),e[39]=B,e[40]=_,e[41]=O):O=e[41];const A=R?"opacity-0 pointer-events-none":"opacity-100";let D;e[42]!==A?(D=Z("h-full transition-opacity duration-200 ease-out",A),e[42]=A,e[43]=D):D=e[43];let z;e[44]!==f||e[45]!==a.messages||e[46]!==a.status||e[47]!==M||e[48]!==T.length?(z=T.length===0?p.jsx(mn.EmptyState,{children:M}):p.jsx(mn.Messages,{messages:a.messages,status:a.status,minHeightOffset:240,onBranchFromMessage:f}),e[44]=f,e[45]=a.messages,e[46]=a.status,e[47]=M,e[48]=T.length,e[49]=z):z=e[49];let K;e[50]!==D||e[51]!==z?(K=p.jsx("div",{className:D,children:z}),e[50]=D,e[51]=z,e[52]=K):K=e[52];let W;e[53]!==O||e[54]!==K?(W=p.jsxs(mn.Main,{className:"h-full relative overflow-hidden",children:[O,K]}),e[53]=O,e[54]=K,e[55]=W):W=e[55];const H=R?"translate-y-full":"translate-y-0";let q;e[56]!==H?(q=Z("transition-transform duration-300 ease-out",H),e[56]=H,e[57]=q):q=e[57];let X;e[58]===Symbol.for("react.memo_cache_sentinel")?(X=p.jsx(Dp,{}),e[58]=X):X=e[58];const J=a.status==="submitted"||a.status==="streaming",Q=!h;let ne;e[59]!==a.messages||e[60]!==a.stop||e[61]!==g||e[62]!==J||e[63]!==Q?(ne=p.jsxs("div",{className:"max-w-2xl mx-auto w-full min-w-0 flex flex-col gap-2",children:[X,p.jsx(ug,{onSubmit:g,onStop:a.stop,isStreaming:J,disabled:Q,usageMessages:a.messages})]}),e[59]=a.messages,e[60]=a.stop,e[61]=g,e[62]=J,e[63]=Q,e[64]=ne):ne=e[64];let me;e[65]!==u||e[66]!==d||e[67]!==x||e[68]!==c||e[69]!==ne?(me=p.jsx(mn.Footer,{children:p.jsx(Ap,{inputController:c,branchContext:u,clearBranchContext:d,onGoToOriginalMessage:x,children:ne})}),e[65]=u,e[66]=d,e[67]=x,e[68]=c,e[69]=ne,e[70]=me):me=e[70];let je;e[71]!==q||e[72]!==me?(je=p.jsx("div",{className:q,children:me}),e[71]=q,e[72]=me,e[73]=je):je=e[73];let mt;return e[74]!==W||e[75]!==je?(mt=p.jsxs(mn,{children:[W,je]}),e[74]=W,e[75]=je,e[76]=mt):mt=e[76],mt}function fg(n){return n.role!=="system"}function hg(n){const e=P.c(18),{value:t,onChange:r,alt:s,size:o}=n,i=o===void 0?"md":o,l=N.useRef(null),a=i==="xs"?"h-6 w-6":i==="sm"?"h-8 w-8":"h-16 w-16",c=i==="xs"?"h-3 w-3":i==="sm"?"h-4 w-4":"h-6 w-6",u=i==="xs"?"h-3 w-3":i==="sm"?"h-3.5 w-3.5":"h-5 w-5";let d;e[0]!==r?(d=w=>{const S=w.target.files?.[0];if(!S)return;const M=new FileReader;M.onloadend=()=>{const E=M.result;r(E)},M.readAsDataURL(S)},e[0]=r,e[1]=d):d=e[1];const f=d;let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=()=>{l.current?.click()},e[2]=h):h=e[2];const m=h,g=`relative ${a} shrink-0 cursor-pointer group`;let y;e[3]!==f?(y=p.jsx("input",{type:"file",ref:l,className:"hidden",accept:"image/*",onChange:f}),e[3]=f,e[4]=y):y=e[4];let x;e[5]!==s||e[6]!==c||e[7]!==t?(x=t?p.jsx("img",{src:t,alt:s||"Avatar",className:"w-full h-full object-cover"}):p.jsx("div",{className:"w-full h-full flex items-center justify-center text-muted-foreground",children:p.jsx(to,{className:c})}),e[5]=s,e[6]=c,e[7]=t,e[8]=x):x=e[8];const b=`${u} text-white`;let v;e[9]!==b?(v=p.jsx("div",{className:"absolute inset-0 bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center rounded-xl",children:p.jsx(Xp,{className:b})}),e[9]=b,e[10]=v):v=e[10];let C;e[11]!==x||e[12]!==v?(C=p.jsxs("div",{className:"h-full w-full rounded-xl border border-border bg-muted/20 overflow-hidden relative",children:[x,v]}),e[11]=x,e[12]=v,e[13]=C):C=e[13];let k;return e[14]!==g||e[15]!==y||e[16]!==C?(k=p.jsxs("div",{className:g,onClick:m,children:[y,C]}),e[14]=g,e[15]=y,e[16]=C,e[17]=k):k=e[17],k}function pg(n){const e=P.c(57),{providerId:t,assistantId:r,onBack:s}=n,i=Ks().location.href,l=Yi();let a;e[0]!==s||e[1]!==l?(a=s??(()=>l.history.back()),e[0]=s,e[1]=l,e[2]=a):a=e[2];const c=a,{locator:u}=Fp();let d;e[3]!==r||e[4]!==u?(d=Bp.assistantChatActiveThread(u,r),e[3]=r,e[4]=u,e[5]=d):d=e[5];const[f,h]=zp(d,mg),m=t||ht;let g;e[6]!==m?(g=Lt(m),e[6]=m,e[7]=g):g=e[7];const y=g,x=tl(t,"ASSISTANT",r,y),b=Gs(t,"ASSISTANT",y),v=b.update.isPending,[C,k]=N.useState(x?.model.id&&x?.gateway_id?"chat":"edit");let w;e[8]===Symbol.for("react.memo_cache_sentinel")?(w=ip(Jp),e[8]=w):w=e[8];const S=x??void 0;let M;e[9]!==S?(M={resolver:w,values:S},e[9]=S,e[10]=M):M=e[10];const E=ru(M);let T;e[11]!==b.update||e[12]!==r||e[13]!==E?(T=E.handleSubmit(async J=>{const Q=await b.update.mutateAsync({id:r,data:J});E.reset(Q),k("chat")}),e[11]=b.update,e[12]=r,e[13]=E,e[14]=T):T=e[14];const R=T;if(!x){let J;e[15]===Symbol.for("react.memo_cache_sentinel")?(J=p.jsx(ca,{}),e[15]=J):J=e[15];let Q;e[16]===Symbol.for("react.memo_cache_sentinel")?(Q=p.jsx("div",{className:"flex h-full w-full bg-background",children:p.jsx(vr,{title:"Assistant not found",description:"This assistant may have been deleted or you may not have access to it."})}),e[16]=Q):Q=e[16];let ne;return e[17]!==c?(ne=p.jsx(ar,{children:p.jsx(N.Suspense,{fallback:J,children:p.jsx(Nn,{onBack:c,children:Q})})}),e[17]=c,e[18]=ne):ne=e[18],ne}let L;e[19]===Symbol.for("react.memo_cache_sentinel")?(L=p.jsx(ca,{}),e[19]=L):L=e[19];let B;e[20]!==x.avatar||e[21]!==x.title?(B=p.jsx("div",{className:"h-6 w-6 min-w-6 rounded-lg border border-border bg-muted/20 overflow-hidden shrink-0",children:x.avatar?p.jsx("img",{src:x.avatar,alt:x.title,className:"h-full w-full object-cover"}):p.jsx("div",{className:"h-full w-full flex items-center justify-center text-muted-foreground",children:p.jsx(to,{size:12,className:"text-muted-foreground"})})}),e[20]=x.avatar,e[21]=x.title,e[22]=B):B=e[22];let _;e[23]!==x.title?(_=p.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:x.title}),e[23]=x.title,e[24]=_):_=e[24];let O;e[25]!==x.description?(O=x.description?p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),p.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:x.description})]}):null,e[25]=x.description,e[26]=O):O=e[26];let A;e[27]!==_||e[28]!==O?(A=p.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[_,O]}),e[27]=_,e[28]=O,e[29]=A):A=e[29];let D;e[30]!==B||e[31]!==A?(D=p.jsx(ol,{children:p.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[B,A]})}),e[30]=B,e[31]=A,e[32]=D):D=e[32];const z=x.avatar??"assistant";let K;e[33]!==x.title||e[34]!==z||e[35]!==i?(K=p.jsx(Xs,{title:x.title,url:i,icon:z}),e[33]=x.title,e[34]=z,e[35]=i,e[36]=K):K=e[36];let W;e[37]!==E.formState.isDirty||e[38]!==v||e[39]!==C||e[40]!==R||e[41]!==h?(W=C==="chat"?p.jsxs(p.Fragment,{children:[p.jsx(Ue,{children:p.jsxs(Ke,{children:[p.jsx(Je,{asChild:!0,children:p.jsx(ue,{type:"button",onClick:()=>h(crypto.randomUUID()),"aria-label":"New thread",variant:"outline",size:"icon",className:"size-7 border border-input",children:p.jsx(sl,{size:16})})}),p.jsx(Ge,{children:"New thread"})]})}),p.jsx(Ue,{children:p.jsxs(Ke,{children:[p.jsx(Je,{asChild:!0,children:p.jsx(ue,{type:"button",onClick:()=>k("edit"),"aria-label":"Edit",variant:"outline",size:"icon",className:"size-7 border border-input",children:p.jsx(Nu,{size:16})})}),p.jsx(Ge,{children:"Edit"})]})})]}):p.jsxs(p.Fragment,{children:[p.jsx(Ue,{children:p.jsxs(Ke,{delayDuration:0,children:[p.jsx(Je,{asChild:!0,children:p.jsx("span",{className:"inline-block",children:p.jsx(ue,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:v,onClick:()=>k("chat"),"aria-label":"Cancel",children:p.jsx(Zs,{size:14})})})}),p.jsx(Ge,{side:"bottom",children:"Cancel"})]})}),p.jsx(Ue,{children:p.jsxs(Ke,{delayDuration:0,children:[p.jsx(Je,{asChild:!0,children:p.jsx("span",{className:"inline-block",children:p.jsx(ue,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:!E.formState.isDirty||v,onClick:()=>{R()},"aria-label":"Save",children:v?p.jsx(Zt,{size:14,className:"animate-spin"}):p.jsx(eo,{size:14})})})}),p.jsx(Ge,{side:"bottom",children:"Save"})]})})]}),e[37]=E.formState.isDirty,e[38]=v,e[39]=C,e[40]=R,e[41]=h,e[42]=W):W=e[42];let H;e[43]!==K||e[44]!==W?(H=p.jsxs(Qs,{children:[K,W]}),e[43]=K,e[44]=W,e[45]=H):H=e[45];let q;e[46]!==f||e[47]!==x||e[48]!==E||e[49]!==C||e[50]!==h?(q=p.jsx("div",{className:"h-full",children:p.jsx(dg,{activeThreadId:f,setActiveThreadId:h,mode:C,assistant:x,form:E},E.formState.submitCount)}),e[46]=f,e[47]=x,e[48]=E,e[49]=C,e[50]=h,e[51]=q):q=e[51];let X;return e[52]!==c||e[53]!==D||e[54]!==H||e[55]!==q?(X=p.jsx(ar,{children:p.jsx(N.Suspense,{fallback:L,children:p.jsxs(Nn,{onBack:c,children:[D,H,q]})})}),e[52]=c,e[53]=D,e[54]=H,e[55]=q,e[56]=X):X=e[56],X}function mg(n){return n||crypto.randomUUID()}function gg(n){const e=P.c(6),{itemId:t,onBack:r}=n;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={strict:!1},e[0]=s):s=e[0];const i=Rn(s).connectionId??ht;if(!i||i===ht){let a;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=p.jsx("div",{className:"flex h-full w-full bg-background",children:p.jsx(vr,{title:"Assistant not found",description:"Missing connection information in the current route."})}),e[1]=a):a=e[1],a}let l;return e[2]!==i||e[3]!==t||e[4]!==r?(l=p.jsx(pg,{providerId:i,assistantId:t,onBack:r}),e[2]=i,e[3]=t,e[4]=r,e[5]=l):l=e[5],l}lp({title:jo().min(1),description:jo().nullable(),body:jo()});function Po(n){for(const e of n.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function yg(){const n=window.location.pathname.split("/").filter(Boolean),e=n.findIndex(r=>r==="mcps"),t=e>=0?n[e+1]:void 0;return t?decodeURIComponent(t):void 0}function xg(n){const e=P.c(13),{form:t}=n;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=p.jsx("div",{className:"text-sm font-medium text-foreground",children:"Details"}),e[0]=r):r=e[0];let s;e[1]!==t.control?(s=p.jsxs("div",{className:"flex flex-col gap-4",children:[r,p.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[p.jsx(ct,{control:t.control,name:"title",render:vg}),p.jsx(ct,{control:t.control,name:"description",render:kg})]})]}),e[1]=t.control,e[2]=s):s=e[2];let o,i;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=p.jsx("div",{className:"text-sm font-medium text-foreground",children:"Message"}),i=p.jsx("div",{className:"text-xs text-muted-foreground",children:"This becomes the user message in the prompt."}),e[3]=o,e[4]=i):(o=e[3],i=e[4]);let l;e[5]!==t.control?(l=p.jsxs("div",{className:"flex flex-col gap-2",children:[o,i,p.jsx(ct,{control:t.control,name:"body",render:bg})]}),e[5]=t.control,e[6]=l):l=e[6];let a;e[7]!==s||e[8]!==l?(a=p.jsxs("div",{className:"h-full py-6 flex flex-col max-w-3xl mx-auto w-full min-w-0 gap-8 overflow-y-auto px-4",children:[s,l]}),e[7]=s,e[8]=l,e[9]=a):a=e[9];let c;return e[10]!==t||e[11]!==a?(c=p.jsx(au,{...t,children:a}),e[10]=t,e[11]=a,e[12]=c):c=e[12],c}function bg(n){const{field:e}=n;return p.jsx($t,{children:p.jsx(Pn,{children:p.jsx(Zr,{...e,value:e.value??"",placeholder:"Write the prompt message…",className:"min-h-[240px] resize-none text-base leading-relaxed font-normal rounded-xl border border-border bg-muted/20 px-4 py-3 shadow-none focus-visible:ring-0"})})})}function kg(n){const{field:e}=n;return p.jsxs($t,{children:[p.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),p.jsx(Pn,{children:p.jsx(Ln,{...e,value:e.value??"",placeholder:"Add a description…",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function vg(n){const{field:e}=n;return p.jsxs($t,{children:[p.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),p.jsx(Pn,{children:p.jsx(Ln,{...e,placeholder:"Untitled prompt",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function wg(n){const e=P.c(51),{providerId:t,promptId:r,onBack:s}=n,i=Ks().location.href,l=t||ht;let a;e[0]!==l?(a=Lt(l),e[0]=l,e[1]=a):a=e[1];const c=a,u=tl(t,"PROMPT",r,c),d=Gs(t,"PROMPT",c),f=d.update.isPending;let h;e[2]!==u?(h=u?{title:u.title,description:u.description??null,body:Po(u)}:void 0,e[2]=u,e[3]=h):h=e[3];let m;e[4]!==h?(m={values:h},e[4]=h,e[5]=m):m=e[5];const g=ru(m);let y;e[6]!==g||e[7]!==u?(y=()=>{u&&g.reset({title:u.title,description:u.description??null,body:Po(u)})},e[6]=g,e[7]=u,e[8]=y):y=e[8];const x=y;let b;e[9]!==d.update||e[10]!==g||e[11]!==r?(b=g.handleSubmit(async q=>{const X=await d.update.mutateAsync({id:r,data:{title:q.title,description:q.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:q.body}}]}});g.reset({title:X.title,description:X.description??null,body:Po(X)})}),e[9]=d.update,e[10]=g,e[11]=r,e[12]=b):b=e[12];const v=b;if(!u){let q;return e[13]===Symbol.for("react.memo_cache_sentinel")?(q=p.jsx("div",{className:"flex h-full w-full bg-background",children:p.jsx(vr,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[13]=q):q=e[13],q}let C;e[14]!==u.title?(C=p.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:u.title}),e[14]=u.title,e[15]=C):C=e[15];let k;e[16]!==u.description?(k=u.description?p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),p.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:u.description})]}):null,e[16]=u.description,e[17]=k):k=e[17];let w;e[18]!==C||e[19]!==k?(w=p.jsx(ol,{children:p.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[C,k]})}),e[18]=C,e[19]=k,e[20]=w):w=e[20];let S;e[21]!==u.title||e[22]!==i?(S=p.jsx(Xs,{title:u.title,url:i,icon:"description"}),e[21]=u.title,e[22]=i,e[23]=S):S=e[23];const M=!g.formState.isDirty||f;let E;e[24]===Symbol.for("react.memo_cache_sentinel")?(E=p.jsx(Zs,{size:14}),e[24]=E):E=e[24];let T;e[25]!==x||e[26]!==M?(T=p.jsx(Je,{asChild:!0,children:p.jsx("span",{className:"inline-block",children:p.jsx(ue,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:M,onClick:x,"aria-label":"Cancel",children:E})})}),e[25]=x,e[26]=M,e[27]=T):T=e[27];let R;e[28]===Symbol.for("react.memo_cache_sentinel")?(R=p.jsx(Ge,{side:"bottom",children:"Cancel"}),e[28]=R):R=e[28];let L;e[29]!==T?(L=p.jsx(Ue,{children:p.jsxs(Ke,{delayDuration:0,children:[T,R]})}),e[29]=T,e[30]=L):L=e[30];const B=!g.formState.isDirty||f;let _;e[31]!==v?(_=()=>{v()},e[31]=v,e[32]=_):_=e[32];let O;e[33]===Symbol.for("react.memo_cache_sentinel")?(O=p.jsx(eo,{size:14}),e[33]=O):O=e[33];let A;e[34]!==B||e[35]!==_?(A=p.jsx(Je,{asChild:!0,children:p.jsx("span",{className:"inline-block",children:p.jsx(ue,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:B,onClick:_,"aria-label":"Save",children:O})})}),e[34]=B,e[35]=_,e[36]=A):A=e[36];let D;e[37]===Symbol.for("react.memo_cache_sentinel")?(D=p.jsx(Ge,{side:"bottom",children:"Save"}),e[37]=D):D=e[37];let z;e[38]!==A?(z=p.jsx(Ue,{children:p.jsxs(Ke,{delayDuration:0,children:[A,D]})}),e[38]=A,e[39]=z):z=e[39];let K;e[40]!==S||e[41]!==L||e[42]!==z?(K=p.jsxs(Qs,{children:[S,L,z]}),e[40]=S,e[41]=L,e[42]=z,e[43]=K):K=e[43];let W;e[44]!==g?(W=p.jsx("div",{className:"h-full",children:p.jsx(xg,{form:g})}),e[44]=g,e[45]=W):W=e[45];let H;return e[46]!==s||e[47]!==K||e[48]!==W||e[49]!==w?(H=p.jsxs(Nn,{onBack:s,children:[w,K,W]}),e[46]=s,e[47]=K,e[48]=W,e[49]=w,e[50]=H):H=e[50],H}function Sg(n){const e=P.c(5),{itemId:t,onBack:r}=n;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=yg()??ht,e[0]=s):s=e[0];const o=s;if(!o||o===ht){let l;return e[1]===Symbol.for("react.memo_cache_sentinel")?(l=p.jsx("div",{className:"flex h-full w-full bg-background",children:p.jsx(vr,{title:"Prompt not found",description:"Missing connection information in the current route."})}),e[1]=l):l=e[1],l}let i;return e[2]!==t||e[3]!==r?(i=p.jsx(ar,{children:p.jsx(N.Suspense,{fallback:null,children:p.jsx(wg,{providerId:o,promptId:t,onBack:r})})}),e[2]=t,e[3]=r,e[4]=i):i=e[4],i}const Cg=ap("relative w-full rounded-lg border px-4 py-3 text-sm flex items-start gap-3 [&>svg]:size-4 [&>svg]:flex-shrink-0 [&>svg]:mt-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-destructive/5 text-destructive border-destructive/25 [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",warning:"bg-warning/10 text-warning-foreground border-warning [&>svg]:text-current *:data-[slot=alert-description]:text-warning-foreground/90",success:"bg-success/10 text-success-foreground border-success [&>svg]:text-current *:data-[slot=alert-description]:text-success-foreground/90",info:"bg-card text-card-foreground border-border [&>svg]:text-current *:data-[slot=alert-description]:text-muted-foreground/90"}},defaultVariants:{variant:"default"}});function Ng(n){const e=P.c(10);let t,r,s;e[0]!==n?({className:t,variant:s,...r}=n,e[0]=n,e[1]=t,e[2]=r,e[3]=s):(t=e[1],r=e[2],s=e[3]);let o;e[4]!==t||e[5]!==s?(o=Z(Cg({variant:s}),t),e[4]=t,e[5]=s,e[6]=o):o=e[6];let i;return e[7]!==r||e[8]!==o?(i=p.jsx("div",{"data-slot":"alert",role:"alert",className:o,...r}),e[7]=r,e[8]=o,e[9]=i):i=e[9],i}function Eg(n){const e=P.c(8);let t,r;e[0]!==n?({className:t,...r}=n,e[0]=n,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let s;e[3]!==t?(s=Z("line-clamp-1 min-h-4 font-medium tracking-tight",t),e[3]=t,e[4]=s):s=e[4];let o;return e[5]!==r||e[6]!==s?(o=p.jsx("div",{"data-slot":"alert-title",className:s,...r}),e[5]=r,e[6]=s,e[7]=o):o=e[7],o}function Tg(n){const e=P.c(8);let t,r;e[0]!==n?({className:t,...r}=n,e[0]=n,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let s;e[3]!==t?(s=Z("text-muted-foreground leading-relaxed",t),e[3]=t,e[4]=s):s=e[4];let o;return e[5]!==r||e[6]!==s?(o=p.jsx("div",{"data-slot":"alert-description",className:s,...r}),e[5]=r,e[6]=s,e[7]=o):o=e[7],o}const Mg=n=>n.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Og(n){const e=P.c(13),{toolName:t,connectionId:r,onBack:s}=n,o=`/mcp/${r}`;let i;e[0]!==o?(i=new URL(o,window.location.origin),e[0]=o,e[1]=i):i=e[1];const l=i;let a;e[2]!==r?(a={connectionId:r},e[2]=r,e[3]=a):a=e[3];const c=nm(a);if(!c.isAuthenticated){let f;return e[4]!==c.supportsOAuth||e[5]!==s?(f=p.jsx("div",{className:"flex h-full items-center justify-center",children:c.supportsOAuth?p.jsx(rm,{onAuthenticate:()=>s(),buttonText:"Go back to authenticate"}):p.jsx(sm,{hasReadme:!1})}),e[4]=c.supportsOAuth,e[5]=s,e[6]=f):f=e[6],f}const u=`${r}:${t}`;let d;return e[7]!==r||e[8]!==l||e[9]!==s||e[10]!==u||e[11]!==t?(d=p.jsx(Ag,{toolName:t,connectionId:r,mcpProxyUrl:l,onBack:s},u),e[7]=r,e[8]=l,e[9]=s,e[10]=u,e[11]=t,e[12]=d):d=e[12],d}function Ag({toolName:n,connectionId:e,mcpProxyUrl:t,onBack:r}){const o=Ks().location.href,{replayId:i}=cp({strict:!1}),l=(()=>{if(!i)return null;const A=`replay-${i}`,D=sessionStorage.getItem(A);if(!D)return null;sessionStorage.removeItem(A);try{return JSON.parse(D)}catch{return null}})(),a=(()=>{if(!l)return null;const A={};for(const[D,z]of Object.entries(l))z!==null&&typeof z=="object"?A[D]=JSON.stringify(z,null,2):A[D]=z;return A})(),[c,u]=N.useState(a??{}),[d,f]=N.useState(l?JSON.stringify(l,null,2):"{}"),[h,m]=N.useState(null),[g,y]=N.useState(null),[x,b]=N.useState(!1),[v,C]=N.useState(null),k=nl(e),w=al({url:t.href});N.useEffect(()=>{w.error&&console.error("MCP Error:",w.error)},[w.error]);const S=w.tools?.find(A=>A.name===n),M=S?.inputSchema?.properties,E=M?Object.keys(M):[],T=E.length>0,R={};if(T&&S?.inputSchema?.properties)for(const A of E)R[A]=S.inputSchema.required?.includes(A)?"":void 0;const L=A=>Object.prototype.hasOwnProperty.call(c,A),B=async()=>{b(!0),y(null),m(null),C(null);const A=performance.now(),D=Lt(e);try{const z=T?{...R,...c}:(()=>{const J=d.trim();if(!J)return{};const Q=JSON.parse(J);if(Q&&typeof Q=="object")return Q;throw new Error("Raw JSON input must be an object.")})();T&&S?.inputSchema?.properties&&Object.entries(S.inputSchema.properties).forEach(([J,Q])=>{if((Q.type==="object"||Q.type==="array")&&typeof z[J]=="string")try{z[J]=JSON.parse(z[J])}catch{}});const K=await D(n,z),W=performance.now(),H=Math.round(W-A);m(K);const q=JSON.stringify(K),X=new TextEncoder().encode(q).length;C({duration:`${H}ms`,bytes:`${X} bytes`,tokens:`~${Math.ceil(X/4)} tokens`,cost:"$0.0000"})}catch(z){const K=z instanceof Error?z.message:String(z);y(K||"Unknown error occurred");const W=performance.now();C({duration:`${Math.round(W-A)}ms`})}finally{b(!1)}},_=(A,D)=>{u(z=>({...z,[A]:D}))},O=()=>{m(null),y(null),C(null)};return p.jsxs(Nn,{onBack:r,children:[p.jsx(Qs,{children:p.jsx(Xs,{title:S?.name??Mg(n),url:o,icon:"build"})}),p.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 h-full",children:[p.jsx("div",{className:"flex flex-col border-r border-border overflow-hidden",children:p.jsxs("div",{className:"flex-1 overflow-auto",children:[p.jsx("div",{className:"flex flex-col gap-4 p-6 border-b border-border min-h-28",children:p.jsxs("div",{className:"flex flex-col gap-2",children:[p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx(Ys,{icon:k?.icon||null,name:k?.title||n,size:"sm",className:"shadow-sm shrink-0"}),p.jsx("h1",{className:"text-lg font-medium text-foreground leading-none",children:n}),p.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-muted/50 rounded-md h-fit",children:[w.state==="ready"?p.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):w.state==="connecting"?p.jsx(Zt,{size:10,className:"animate-spin text-yellow-500 shrink-0"}):p.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-red-500 shrink-0"}),p.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:w.state.replace("_"," ")})]})]}),p.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:S?.description||"No description available"})]})}),p.jsxs("div",{className:"flex flex-col p-6 gap-4",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsx("h2",{className:"text-sm font-semibold text-foreground uppercase tracking-wide",children:"Parameters"}),S?.inputSchema?.required&&S.inputSchema.required.length>0&&p.jsxs("span",{className:"text-xs text-muted-foreground",children:[p.jsx("span",{className:"text-red-500",children:"*"})," Required"]})]}),p.jsx("div",{className:"space-y-4",children:T&&S?.inputSchema?.properties?Object.entries(S.inputSchema.properties).map(([A,D])=>p.jsxs("div",{className:"space-y-2",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsxs("label",{className:"text-sm font-medium leading-none flex items-center gap-1.5",children:[A,S.inputSchema?.required?.includes(A)&&p.jsx("span",{className:"text-red-500 text-xs",children:"*"})]}),p.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:D.type})]}),D.description&&p.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:D.description}),D.type==="object"||D.type==="array"?p.jsx(Zr,{className:"font-mono text-xs",value:L(A)?c[A]??"":R[A]??"",onChange:z=>_(A,z.target.value),placeholder:`Enter ${A} as JSON...`,rows:3}):p.jsx(Ln,{value:L(A)?c[A]??"":R[A]??"",onChange:z=>_(A,z.target.value),placeholder:`Enter ${A}...`})]},A)):S?.inputSchema&&!T?p.jsxs("div",{className:"space-y-2",children:[p.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),p.jsx(Zr,{className:"font-mono text-xs min-h-[120px]",value:d,onChange:A=>f(A.target.value),placeholder:'e.g. { "foo": "bar" }'})]}):p.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:p.jsx("p",{className:"text-sm text-muted-foreground",children:"No parameters required"})})})]})]})}),p.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[p.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-t lg:border-t-0 border-b border-border bg-background",children:[p.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:"Result"}),v&&p.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[p.jsxs("div",{className:"flex items-center gap-1.5",children:[p.jsx(Zp,{className:"h-3 w-3 text-muted-foreground"}),p.jsx("span",{className:"font-mono text-foreground",children:v.duration})]}),v.tokens&&p.jsxs("div",{className:"flex items-center gap-1.5",children:[p.jsx(xu,{className:"h-3 w-3 text-muted-foreground"}),p.jsx("span",{className:"font-mono text-foreground",children:v.tokens})]}),v.bytes&&p.jsxs("div",{className:"flex items-center gap-1.5",children:[p.jsx(Cu,{className:"h-3 w-3 text-muted-foreground"}),p.jsx("span",{className:"font-mono text-foreground",children:v.bytes})]}),v.cost&&p.jsx("div",{className:"flex items-center gap-1.5",children:p.jsx("span",{className:"font-mono text-foreground",children:v.cost})})]})]}),p.jsx("div",{className:"flex items-center justify-end lg:justify-between px-4 h-14 border-b border-border bg-background",children:p.jsxs("div",{className:"flex items-center gap-2 w-full lg:w-auto",children:[p.jsx(ue,{size:"sm",variant:"default",className:"h-8 gap-2 flex-1 lg:flex-none",onClick:B,disabled:x,children:x?p.jsxs(p.Fragment,{children:[p.jsx(Zt,{size:14,className:"animate-spin"}),"Executing..."]}):p.jsxs(p.Fragment,{children:[p.jsx(il,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})}),p.jsx(Ue,{children:p.jsxs(Ke,{children:[p.jsx(Je,{asChild:!0,children:p.jsx(ue,{size:"icon",variant:"outline",className:"h-8 w-8 shrink-0",onClick:O,disabled:!h&&!g,children:p.jsx(ll,{size:14})})}),p.jsx(Ge,{children:p.jsx("p",{children:"Clear results"})})]})})]})}),g&&p.jsx("div",{className:"px-6 py-4 bg-background",children:p.jsx(Ng,{variant:"destructive",children:p.jsxs("div",{className:"flex flex-col gap-2",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(Qp,{className:"h-4 w-4"}),p.jsx(Eg,{className:"mb-0",children:"Execution Failed"})]}),p.jsx(Tg,{className:"text-xs text-destructive",children:g})]})})}),p.jsx("div",{className:"relative flex-1 overflow-auto bg-muted/50",children:h?p.jsxs(p.Fragment,{children:[p.jsx(tm,{jsonString:JSON.stringify(h,null,2),padding:"1.5rem"}),p.jsx(ue,{size:"icon",variant:"ghost",className:"absolute top-4 right-4 h-8 w-8 bg-background/80 hover:bg-background border border-border shadow-sm",onClick:()=>{navigator.clipboard.writeText(JSON.stringify(h,null,2)),up.success("Copied to clipboard")},children:p.jsx(em,{className:"h-3.5 w-3.5"})})]}):p.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[p.jsx(ku,{className:"h-12 w-12 mb-3 opacity-40"}),p.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]})]})]})}function Ig(n){const e=P.c(7),{itemId:t,onBack:r}=n;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={strict:!1},e[0]=s):s=e[0];const i=Rn(s).connectionId??ht;if(!nl(i)){let u;return e[1]===Symbol.for("react.memo_cache_sentinel")?(u=p.jsx("div",{className:"flex h-full items-center justify-center",children:p.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[p.jsx("h3",{className:"text-lg font-semibold",children:"Connection not found"}),p.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection may have been deleted or you may not have access."})]})}),e[1]=u):u=e[1],u}let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=p.jsx("div",{className:"flex h-full items-center justify-center",children:p.jsx(Zt,{size:32,className:"animate-spin text-muted-foreground"})}),e[2]=a):a=e[2];let c;return e[3]!==i||e[4]!==r||e[5]!==t?(c=p.jsx(N.Suspense,{fallback:a,children:p.jsx(Og,{toolName:t,connectionId:i,onBack:r})}),e[3]=i,e[4]=r,e[5]=t,e[6]=c):c=e[6],c}const ya=n=>{let e;const t=new Set,r=(c,u)=>{const d=typeof c=="function"?c(e):c;if(!Object.is(d,e)){const f=e;e=u??(typeof d!="object"||d===null)?d:Object.assign({},e,d),t.forEach(h=>h(e,f))}},s=()=>e,l={setState:r,getState:s,getInitialState:()=>a,subscribe:c=>(t.add(c),()=>t.delete(c))},a=e=n(r,s,l);return l},ul=(n=>n?ya(n):ya),jg=n=>n;function yi(n,e=jg){const t=ee.useSyncExternalStore(n.subscribe,ee.useCallback(()=>e(n.getState()),[n,e]),ee.useCallback(()=>e(n.getInitialState()),[n,e]));return ee.useDebugValue(t),t}const Rg=n=>{const e=ul(n),t=r=>yi(e,r);return Object.assign(t,e),t},Dg=(n=>Rg);function Ou(n,e){let t;try{t=n()}catch{return}return{getItem:s=>{var o;const i=a=>a===null?null:JSON.parse(a,void 0),l=(o=t.getItem(s))!=null?o:null;return l instanceof Promise?l.then(i):i(l)},setItem:(s,o)=>t.setItem(s,JSON.stringify(o,void 0)),removeItem:s=>t.removeItem(s)}}const xi=n=>e=>{try{const t=n(e);return t instanceof Promise?t:{then(r){return xi(r)(t)},catch(r){return this}}}catch(t){return{then(r){return this},catch(r){return xi(r)(t)}}}},Pg=(n,e)=>(t,r,s)=>{let o={storage:Ou(()=>localStorage),partialize:g=>g,version:0,merge:(g,y)=>({...y,...g}),...e},i=!1;const l=new Set,a=new Set;let c=o.storage;if(!c)return n((...g)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),t(...g)},r,s);const u=()=>{const g=o.partialize({...r()});return c.setItem(o.name,{state:g,version:o.version})},d=s.setState;s.setState=(g,y)=>(d(g,y),u());const f=n((...g)=>(t(...g),u()),r,s);s.getInitialState=()=>f;let h;const m=()=>{var g,y;if(!c)return;i=!1,l.forEach(b=>{var v;return b((v=r())!=null?v:f)});const x=((y=o.onRehydrateStorage)==null?void 0:y.call(o,(g=r())!=null?g:f))||void 0;return xi(c.getItem.bind(c))(o.name).then(b=>{if(b)if(typeof b.version=="number"&&b.version!==o.version){if(o.migrate){const v=o.migrate(b.state,b.version);return v instanceof Promise?v.then(C=>[!0,C]):[!0,v]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,b.state];return[!1,void 0]}).then(b=>{var v;const[C,k]=b;if(h=o.merge(k,(v=r())!=null?v:f),t(h,!0),C)return u()}).then(()=>{x?.(h,void 0),h=r(),i=!0,a.forEach(b=>b(h))}).catch(b=>{x?.(void 0,b)})};return s.persist={setOptions:g=>{o={...o,...g},g.storage&&(c=g.storage)},clearStorage:()=>{c?.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>m(),hasHydrated:()=>i,onHydrate:g=>(l.add(g),()=>{l.delete(g)}),onFinishHydration:g=>(a.add(g),()=>{a.delete(g)})},o.skipHydration||m(),h||f},Au=Pg,{useSyncExternalStoreWithSelector:Lg}=dp,$g=n=>n;function _g(n,e=$g,t){const r=Lg(n.subscribe,n.getState,n.getInitialState,e,t);return ee.useDebugValue(r),r}const xa=n=>Symbol.iterator in n,ba=n=>"entries"in n,ka=(n,e)=>{const t=n instanceof Map?n:new Map(n.entries()),r=e instanceof Map?e:new Map(e.entries());if(t.size!==r.size)return!1;for(const[s,o]of t)if(!r.has(s)||!Object.is(o,r.get(s)))return!1;return!0},zg=(n,e)=>{const t=n[Symbol.iterator](),r=e[Symbol.iterator]();let s=t.next(),o=r.next();for(;!s.done&&!o.done;){if(!Object.is(s.value,o.value))return!1;s=t.next(),o=r.next()}return!!s.done&&!!o.done};function Bg(n,e){return Object.is(n,e)?!0:typeof n!="object"||n===null||typeof e!="object"||e===null||Object.getPrototypeOf(n)!==Object.getPrototypeOf(e)?!1:xa(n)&&xa(e)?ba(n)&&ba(e)?ka(n,e):zg(n,e):ka({entries:()=>Object.entries(n)},{entries:()=>Object.entries(e)})}function Fg(n,e="Output"){if(!n)return`interface ${e} {}`;function t(o){if(!o||typeof o!="object")return"unknown";const i=o.type;if(Array.isArray(i))return i.map(l=>r(l)).join(" | ");switch(i){case"string":return o.enum?o.enum.map(l=>`"${l}"`).join(" | "):"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";case"array":{const l=o.items;return l?`${t(l)}[]`:"unknown[]"}case"object":return s(o);default:return o.anyOf?o.anyOf.map(t).join(" | "):o.oneOf?o.oneOf.map(t).join(" | "):o.allOf?o.allOf.map(t).join(" & "):"unknown"}}function r(o){switch(o){case"string":return"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";default:return"unknown"}}function s(o){const i=o.properties;if(!i)return"Record<string, unknown>";const l=new Set(o.required||[]);return`{
|
|
1
|
+
import{aw as Pt,r as N,c as P,d as Rn,j as p,g as Ks,as as Yi,x as ip,y as ru,v as lp,w as jo,i as ap,b as cp,t as up,F as ee,Q as dp,ax as Ro,ay as su,ai as fp,ah as hp,az as pp,H as Xi,a2 as ou,a5 as mp,B as Dn,E as We,$ as Qi,a6 as gp,z as Js,a3 as yp,Z as Zi,ac as xp,ad as bp,ae as kp,aA as el,aB as vp,a4 as iu,a1 as wp,aC as Sp,L as Cp,aD as Np,aE as Ep}from"./index-BlsDXE23.js";import{U as ht,f as tl,d as Gs,c as Lt,b as nl,I as Ys,u as Tp,n as Mp}from"./use-connection-BGthiOfQ.js";import{d as Op,C as mn,e as Ap,f as Ip,g as jp,I as Rp,B as Dp,n as ca,G as lu,M as Pp,o as Lp,R as ua,m as $p}from"./resizable-CwsfF64n.js";import{E as vr,i as _p}from"./SearchMd-DBw3zp_M.js";import{E as ar}from"./error-boundary-Dd7BgwTJ.js";import{P as Xs}from"./formatDistanceToNow-CNMZ-Ei_.js";import{u as zp,L as Bp}from"./localstorage-keys-BNPDgZQf.js";import{u as Fp,a as Ue,c as Ke,b as Je,T as Ge,i as rl}from"./tooltip-CYopm1Sm.js";import{B as ue,c as Z}from"./button-BM8Ntdfr.js";import{F as ct,a as au,b as $t,c as wr,d as Pn}from"./form-DNdbWanJ.js";import{I as Ln}from"./input-B45bC0Rc.js";import{T as Zr,D as Vp,a as Hp,b as Wp,f as qp,c as Up,d as Kp}from"./dialog-_0iI5rNw.js";import{A as Jp,D as Gp,u as Yp}from"./use-binding-DiGbYyGi.js";import{i as Zt}from"./Loading01-DyCC_wp5.js";import{s as sl}from"./Plus-BoZvN_rT.js";import{i as Xp}from"./Upload01-BYUhUNdK.js";import{b as Nn,a as ol,V as Qs}from"./layout-RDUry3u6.js";import{i as Qp}from"./AlertCircle-D7Y5lb85.js";import{s as Zp}from"./Clock-CbKCY_SW.js";import{a as em}from"./Copy01-B-rLWzst.js";import{i as il,J as tm}from"./json-syntax-highlighter-DO7qBvWL.js";import{s as ll,i as cu}from"./XClose-Dez1KTRy.js";import{u as nm,O as rm,M as sm,F as om,v as im,E as lm}from"./index-CD92JRY8.js";import{u as al}from"./use-mcp-CKeUPEl8.js";import{S as $n}from"./spinner-BIp36cWs.js";import{V as am}from"./view-mode-toggle-D-v785I-.js";import{i as cm}from"./GitBranch01-DKUtbZqA.js";import{a as uu,b as um}from"./use-tool-call-DOhzogS9.js";import"./index-CGy1qJ5Y.js";import{n as dm}from"./Calendar-BIuHCFcF.js";import{b as fm,D as hm,a as pm,d as da,i as mm}from"./dropdown-menu-4Ypgp2xI.js";import{B as fn}from"./badge-ffsmxYLL.js";import{i as du}from"./X-BV7uqO3B.js";import"./CpuChip02-wuCmGgd2.js";import"./select-CG-oLpgX.js";import"./ChevronDown-DNVwrHI3.js";import"./use-mobile-BSF9aYm8.js";import"./use-gateway-B_vZFCo_.js";import"./Terminal-DURJ2Sop.js";import"./connection-card-DMoDmlju.js";import"./card-BWKGhflg.js";import"./LinkExternal01-CwO6S7_R.js";import"./alert-dialog-2c4JlYwD.js";import"./File06-DJfHNtkr.js";import"./InfoCircle-JMKMx9jx.js";import"./use-organization-settings-Xs2e_hDY.js";import"./useQuery-CA4Qsiz4.js";import"./auth-DLdX6AGd.js";import"./ArrowLeft-DLGdR8R3.js";import"./mcp-oauth-BxQJ_sZ7.js";import"./env-vars-editor-DuAsDAtd.js";import"./Trash01-D8NpuzHg.js";import"./Key01-BUYdliq4.js";import"./extract-connection-data-C4wZpmQd.js";import"./registry-utils-ulDDT0d8.js";import"./generate-id-Dyweu44Y.js";import"./index-MYfTA9Ba.js";const fu=Pt("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);const hu=Pt("Braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]);const gm=Pt("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);const ym=Pt("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const pu=Pt("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const mu=Pt("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);const gu=Pt("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);const yu=Pt("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]),cl=({size:n=24,color:e="currentColor",...t})=>N.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},N.createElement("path",{d:"M12 8v4m0 4h.01M2 8.523v6.954c0 .245 0 .367.028.482a1 1 0 0 0 .12.29c.061.1.148.187.32.36l4.923 4.922c.173.173.26.26.36.322.09.054.188.095.29.12.115.027.237.027.482.027h6.954c.245 0 .367 0 .482-.028a.998.998 0 0 0 .29-.12c.1-.061.187-.148.36-.32l4.922-4.923c.173-.173.26-.26.322-.36a.998.998 0 0 0 .12-.29c.027-.115.027-.237.027-.482V8.523c0-.245 0-.367-.028-.482a.998.998 0 0 0-.12-.29c-.061-.1-.148-.187-.32-.36L16.608 2.47c-.173-.173-.26-.26-.36-.322a1 1 0 0 0-.29-.12C15.844 2 15.722 2 15.477 2H8.523c-.245 0-.367 0-.482.028a1 1 0 0 0-.29.12c-.1.061-.187.148-.36.32L2.47 7.392c-.173.173-.26.26-.322.36a1 1 0 0 0-.12.29C2 8.156 2 8.278 2 8.523Z"}));cl.displayName="AlertOctagon";const xu=({size:n=24,color:e="currentColor",...t})=>N.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},N.createElement("path",{d:"M20.5 8v8.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.22 21 17.38 21 15.7 21H8.3c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3.5 18.72 3.5 17.88 3.5 16.2V8m.1-5h16.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C22 3.76 22 4.04 22 4.6v1.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437C21.24 8 20.96 8 20.4 8H3.6c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C2 7.24 2 6.96 2 6.4V4.6c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C2.76 3 3.04 3 3.6 3Zm6 8.5h4.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C16 12.26 16 12.54 16 13.1v.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437c-.214.109-.494.109-1.054.109H9.6c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C8 14.74 8 14.46 8 13.9v-.8c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C8.76 11.5 9.04 11.5 9.6 11.5Z"}));xu.displayName="Box";const bu=({size:n=24,color:e="currentColor",...t})=>N.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},N.createElement("path",{d:"m22.7 11.5-2 2-2-2m2.245 1.5A9 9 0 1 0 19 17.657M12 7v5l3 2"}));bu.displayName="ClockFastForward";const ku=({size:n=24,color:e="currentColor",...t})=>N.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},N.createElement("path",{d:"m16 18 6-6-6-6M8 6l-6 6 6 6"}));ku.displayName="Code01";const vu=({size:n=24,color:e="currentColor",...t})=>N.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},N.createElement("path",{d:"m17 17 5-5-5-5M7 7l-5 5 5 5m7-14-4 18"}));vu.displayName="Code02";const wu=({size:n=24,color:e="currentColor",...t})=>N.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},N.createElement("path",{d:"M12 17a5 5 0 1 0 10 0 5 5 0 0 0-10 0Zm0 0c0-1.126.372-2.165 1-3V5m-1 12c0 .825.2 1.604.554 2.29-.842.712-2.788 1.21-5.054 1.21-3.038 0-5.5-.895-5.5-2V5m11 0c0 1.105-2.462 2-5.5 2S2 6.105 2 5m11 0c0-1.105-2.462-2-5.5-2S2 3.895 2 5m0 9c0 1.105 2.462 2 5.5 2 2.189 0 4.08-.465 4.965-1.138M13 9.5c0 1.105-2.462 2-5.5 2S2 10.605 2 9.5"}));wu.displayName="CoinsStacked01";const Ur=({size:n=24,color:e="currentColor",...t})=>N.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},N.createElement("path",{d:"M6.8 3h-.6c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C3 4.52 3 5.08 3 6.2v11.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C4.52 21 5.08 21 6.2 21h.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C10 19.48 10 18.92 10 17.8V6.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C8.48 3 7.92 3 6.8 3Zm11 0h-.6c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C14 4.52 14 5.08 14 6.2v11.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C15.52 21 16.08 21 17.2 21h.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C21 19.48 21 18.92 21 17.8V6.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C19.48 3 18.92 3 17.8 3Z"}));Ur.displayName="Columns01";const Su=({size:n=24,color:e="currentColor",...t})=>N.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},N.createElement("path",{d:"M4 4v1.4c0 3.36 0 5.04.654 6.324a6 6 0 0 0 2.622 2.622C8.56 15 10.24 15 13.6 15H20m0 0-5-5m5 5-5 5"}));Su.displayName="CornerDownRight";const Cu=({size:n=24,color:e="currentColor",...t})=>N.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},N.createElement("path",{d:"M21 5c0 1.657-4.03 3-9 3S3 6.657 3 5m18 0c0-1.657-4.03-3-9-3S3 3.343 3 5m18 0v14c0 1.66-4 3-9 3s-9-1.34-9-3V5m18 7c0 1.66-4 3-9 3s-9-1.34-9-3"}));Cu.displayName="Database01";const Nu=({size:n=24,color:e="currentColor",...t})=>N.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},N.createElement("path",{d:"M11 4H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 6.28 2 7.12 2 8.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C4.28 22 5.12 22 6.8 22h8.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C20 19.72 20 18.88 20 17.2V13M8 16h1.675c.489 0 .733 0 .963-.055.204-.05.4-.13.579-.24.201-.123.374-.296.72-.642L21.5 5.5a2.121 2.121 0 0 0-3-3l-9.563 9.563c-.346.346-.519.519-.642.72a2 2 0 0 0-.24.579c-.055.23-.055.474-.055.963V16Z"}));Nu.displayName="Edit05";const Zs=({size:n=24,color:e="currentColor",...t})=>N.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},N.createElement("path",{d:"M3 9h13.5a4.5 4.5 0 1 1 0 9H12M3 9l4-4M3 9l4 4"}));Zs.displayName="FlipBackward";const Eu=({size:n=24,color:e="currentColor",...t})=>N.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},N.createElement("path",{d:"m13 22-3-3m0 0 3-3m-3 3h5a7 7 0 0 0 3-13.326M6 18.326A7 7 0 0 1 9 5h5m0 0-3-3m3 3-3 3"}));Eu.displayName="Repeat03";const eo=({size:n=24,color:e="currentColor",...t})=>N.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},N.createElement("path",{d:"M15 8H8.6c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C7 7.24 7 6.96 7 6.4V3m10 18v-6.4c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C16.24 13 15.96 13 15.4 13H8.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C7 13.76 7 14.04 7 14.6V21M21 9.325V16.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h6.875c.489 0 .733 0 .963.055.204.05.4.13.579.24.201.123.374.296.72.642l3.126 3.126c.346.346.519.519.642.72.11.18.19.374.24.579.055.23.055.474.055.963Z"}));eo.displayName="Save02";const Tu=({size:n=24,color:e="currentColor",...t})=>N.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},N.createElement("path",{d:"M15.631 7.631c-.396-.396-.594-.594-.668-.822a1 1 0 0 1 0-.618c.074-.228.272-.426.668-.822L18.47 2.53a6 6 0 0 0-8.3 6.895c.12.49.179.734.168.888a.849.849 0 0 1-.11.392c-.07.138-.207.274-.48.547L3.5 17.5a2.121 2.121 0 0 0 3 3l6.248-6.248c.273-.273.41-.41.547-.48a.849.849 0 0 1 .392-.11c.154-.011.399.049.888.168a6 6 0 0 0 6.895-8.3l-2.84 2.84c-.396.396-.594.594-.822.668a1 1 0 0 1-.618 0c-.228-.074-.426-.272-.822-.668l-.738-.738Z"}));Tu.displayName="Tool01";const to=({size:n=24,color:e="currentColor",...t})=>N.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},N.createElement("path",{d:"M16 3.468a4.5 4.5 0 0 1 0 8.064m2 5.234c1.512.684 2.872 1.799 4 3.234M2 20c1.946-2.477 4.59-4 7.5-4s5.553 1.523 7.5 4M14 7.5a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0Z"}));to.displayName="Users02";const{getOwnPropertyNames:xm,getOwnPropertySymbols:bm}=Object,{hasOwnProperty:km}=Object.prototype;function Do(n,e){return function(r,s,o){return n(r,s,o)&&e(r,s,o)}}function Ir(n){return function(t,r,s){if(!t||!r||typeof t!="object"||typeof r!="object")return n(t,r,s);const{cache:o}=s,i=o.get(t),l=o.get(r);if(i&&l)return i===r&&l===t;o.set(t,r),o.set(r,t);const a=n(t,r,s);return o.delete(t),o.delete(r),a}}function vm(n){return n?.[Symbol.toStringTag]}function fa(n){return xm(n).concat(bm(n))}const wm=Object.hasOwn||((n,e)=>km.call(n,e));function on(n,e){return n===e||!n&&!e&&n!==n&&e!==e}const Sm="__v",Cm="__o",Nm="_owner",{getOwnPropertyDescriptor:ha,keys:pa}=Object;function Em(n,e){return n.byteLength===e.byteLength&&es(new Uint8Array(n),new Uint8Array(e))}function Tm(n,e,t){let r=n.length;if(e.length!==r)return!1;for(;r-- >0;)if(!t.equals(n[r],e[r],r,r,n,e,t))return!1;return!0}function Mm(n,e){return n.byteLength===e.byteLength&&es(new Uint8Array(n.buffer,n.byteOffset,n.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function Om(n,e){return on(n.getTime(),e.getTime())}function Am(n,e){return n.name===e.name&&n.message===e.message&&n.cause===e.cause&&n.stack===e.stack}function Im(n,e){return n===e}function ma(n,e,t){const r=n.size;if(r!==e.size)return!1;if(!r)return!0;const s=new Array(r),o=n.entries();let i,l,a=0;for(;(i=o.next())&&!i.done;){const c=e.entries();let u=!1,d=0;for(;(l=c.next())&&!l.done;){if(s[d]){d++;continue}const f=i.value,h=l.value;if(t.equals(f[0],h[0],a,d,n,e,t)&&t.equals(f[1],h[1],f[0],h[0],n,e,t)){u=s[d]=!0;break}d++}if(!u)return!1;a++}return!0}const jm=on;function Rm(n,e,t){const r=pa(n);let s=r.length;if(pa(e).length!==s)return!1;for(;s-- >0;)if(!Mu(n,e,t,r[s]))return!1;return!0}function Hn(n,e,t){const r=fa(n);let s=r.length;if(fa(e).length!==s)return!1;let o,i,l;for(;s-- >0;)if(o=r[s],!Mu(n,e,t,o)||(i=ha(n,o),l=ha(e,o),(i||l)&&(!i||!l||i.configurable!==l.configurable||i.enumerable!==l.enumerable||i.writable!==l.writable)))return!1;return!0}function Dm(n,e){return on(n.valueOf(),e.valueOf())}function Pm(n,e){return n.source===e.source&&n.flags===e.flags}function ga(n,e,t){const r=n.size;if(r!==e.size)return!1;if(!r)return!0;const s=new Array(r),o=n.values();let i,l;for(;(i=o.next())&&!i.done;){const a=e.values();let c=!1,u=0;for(;(l=a.next())&&!l.done;){if(!s[u]&&t.equals(i.value,l.value,i.value,l.value,n,e,t)){c=s[u]=!0;break}u++}if(!c)return!1}return!0}function es(n,e){let t=n.byteLength;if(e.byteLength!==t||n.byteOffset!==e.byteOffset)return!1;for(;t-- >0;)if(n[t]!==e[t])return!1;return!0}function Lm(n,e){return n.hostname===e.hostname&&n.pathname===e.pathname&&n.protocol===e.protocol&&n.port===e.port&&n.hash===e.hash&&n.username===e.username&&n.password===e.password}function Mu(n,e,t,r){return(r===Nm||r===Cm||r===Sm)&&(n.$$typeof||e.$$typeof)?!0:wm(e,r)&&t.equals(n[r],e[r],r,r,n,e,t)}const $m="[object ArrayBuffer]",_m="[object Arguments]",zm="[object Boolean]",Bm="[object DataView]",Fm="[object Date]",Vm="[object Error]",Hm="[object Map]",Wm="[object Number]",qm="[object Object]",Um="[object RegExp]",Km="[object Set]",Jm="[object String]",Gm={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},Ym="[object URL]",Xm=Object.prototype.toString;function Qm({areArrayBuffersEqual:n,areArraysEqual:e,areDataViewsEqual:t,areDatesEqual:r,areErrorsEqual:s,areFunctionsEqual:o,areMapsEqual:i,areNumbersEqual:l,areObjectsEqual:a,arePrimitiveWrappersEqual:c,areRegExpsEqual:u,areSetsEqual:d,areTypedArraysEqual:f,areUrlsEqual:h,unknownTagComparators:m}){return function(y,x,b){if(y===x)return!0;if(y==null||x==null)return!1;const v=typeof y;if(v!==typeof x)return!1;if(v!=="object")return v==="number"?l(y,x,b):v==="function"?o(y,x,b):!1;const C=y.constructor;if(C!==x.constructor)return!1;if(C===Object)return a(y,x,b);if(Array.isArray(y))return e(y,x,b);if(C===Date)return r(y,x,b);if(C===RegExp)return u(y,x,b);if(C===Map)return i(y,x,b);if(C===Set)return d(y,x,b);const k=Xm.call(y);if(k===Fm)return r(y,x,b);if(k===Um)return u(y,x,b);if(k===Hm)return i(y,x,b);if(k===Km)return d(y,x,b);if(k===qm)return typeof y.then!="function"&&typeof x.then!="function"&&a(y,x,b);if(k===Ym)return h(y,x,b);if(k===Vm)return s(y,x,b);if(k===_m)return a(y,x,b);if(Gm[k])return f(y,x,b);if(k===$m)return n(y,x,b);if(k===Bm)return t(y,x,b);if(k===zm||k===Wm||k===Jm)return c(y,x,b);if(m){let w=m[k];if(!w){const S=vm(y);S&&(w=m[S])}if(w)return w(y,x,b)}return!1}}function Zm({circular:n,createCustomConfig:e,strict:t}){let r={areArrayBuffersEqual:Em,areArraysEqual:t?Hn:Tm,areDataViewsEqual:Mm,areDatesEqual:Om,areErrorsEqual:Am,areFunctionsEqual:Im,areMapsEqual:t?Do(ma,Hn):ma,areNumbersEqual:jm,areObjectsEqual:t?Hn:Rm,arePrimitiveWrappersEqual:Dm,areRegExpsEqual:Pm,areSetsEqual:t?Do(ga,Hn):ga,areTypedArraysEqual:t?Do(es,Hn):es,areUrlsEqual:Lm,unknownTagComparators:void 0};if(e&&(r=Object.assign({},r,e(r))),n){const s=Ir(r.areArraysEqual),o=Ir(r.areMapsEqual),i=Ir(r.areObjectsEqual),l=Ir(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:s,areMapsEqual:o,areObjectsEqual:i,areSetsEqual:l})}return r}function eg(n){return function(e,t,r,s,o,i,l){return n(e,t,l)}}function tg({circular:n,comparator:e,createState:t,equals:r,strict:s}){if(t)return function(l,a){const{cache:c=n?new WeakMap:void 0,meta:u}=t();return e(l,a,{cache:c,equals:r,meta:u,strict:s})};if(n)return function(l,a){return e(l,a,{cache:new WeakMap,equals:r,meta:void 0,strict:s})};const o={cache:void 0,equals:r,meta:void 0,strict:s};return function(l,a){return e(l,a,o)}}const ng=_t();_t({strict:!0});_t({circular:!0});_t({circular:!0,strict:!0});_t({createInternalComparator:()=>on});_t({strict:!0,createInternalComparator:()=>on});_t({circular:!0,createInternalComparator:()=>on});_t({circular:!0,createInternalComparator:()=>on,strict:!0});function _t(n={}){const{circular:e=!1,createInternalComparator:t,createState:r,strict:s=!1}=n,o=Zm(n),i=Qm(o),l=t?t(i):eg(i);return tg({circular:e,comparator:i,createState:r,equals:l,strict:s})}function rg(n){const e=P.c(3),{gatewayId:t,onSelect:r}=n,{data:s}=Ip(t);if(s.length===0)return null;let o;return e[0]!==r||e[1]!==s?(o=p.jsx(Rp,{prompts:s,onSelect:r,className:"mt-6"}),e[0]=r,e[1]=s,e[2]=o):o=e[2],o}function sg(n){const e=P.c(20),{form:t}=n;let r;e[0]!==t?(r=d=>{const{field:f}=d;return p.jsx(hg,{size:"md",value:f.value,onChange:f.onChange,alt:t.watch("title")})},e[0]=t,e[1]=r):r=e[1];let s;e[2]!==t.control||e[3]!==r?(s=p.jsx(ct,{control:t.control,name:"avatar",render:r}),e[2]=t.control,e[3]=r,e[4]=s):s=e[4];let o;e[5]!==t.control?(o=p.jsxs("div",{className:"flex flex-col gap-3 flex-1 min-w-0",children:[p.jsx(ct,{control:t.control,name:"title",render:cg}),p.jsx(ct,{control:t.control,name:"description",render:ag})]}),e[5]=t.control,e[6]=o):o=e[6];let i;e[7]!==s||e[8]!==o?(i=p.jsxs("div",{className:"flex gap-4 items-start",children:[s,o]}),e[7]=s,e[8]=o,e[9]=i):i=e[9];let l,a;e[10]!==t.control?(l=p.jsxs("div",{className:"flex gap-4",children:[p.jsx(ct,{control:t.control,name:"gateway_id",render:lg}),p.jsx(ct,{control:t.control,name:"model",render:ig})]}),a=p.jsx(ct,{control:t.control,name:"system_prompt",render:og}),e[10]=t.control,e[11]=l,e[12]=a):(l=e[11],a=e[12]);let c;e[13]!==i||e[14]!==l||e[15]!==a?(c=p.jsxs("div",{className:"h-full py-6 flex flex-col max-w-2xl mx-auto w-full min-w-0 gap-6 overflow-y-auto",children:[i,l,a]}),e[13]=i,e[14]=l,e[15]=a,e[16]=c):c=e[16];let u;return e[17]!==t||e[18]!==c?(u=p.jsx(au,{...t,children:c}),e[17]=t,e[18]=c,e[19]=u):u=e[19],u}function og(n){const{field:e}=n;return p.jsxs($t,{className:"flex-1 flex flex-col min-h-0",children:[p.jsx(wr,{className:"text-xs text-muted-foreground",children:"System prompt"}),p.jsx(Pn,{children:p.jsx(Zr,{...e,placeholder:"You are a helpful assistant...",className:"flex-1 min-h-[200px] resize-none text-base leading-relaxed font-normal rounded-xl border border-border bg-muted/20 px-4 py-3 shadow-none focus-visible:ring-0"})})]})}function ig(n){const{field:e}=n;return p.jsxs($t,{className:"flex-1",children:[p.jsx(wr,{className:"text-xs text-muted-foreground",children:"Model"}),p.jsx(Pp,{selectedModel:e.value?{id:e.value.id,connectionId:e.value.connectionId}:void 0,onModelChange:t=>e.onChange({id:t.id,connectionId:t.connectionId}),placeholder:"Select model",variant:"bordered",className:"w-full"})]})}function lg(n){const{field:e}=n;return p.jsxs($t,{className:"flex-1",children:[p.jsx(wr,{className:"text-xs text-muted-foreground",children:"Gateway"}),p.jsx(lu,{selectedGatewayId:e.value,onGatewayChange:e.onChange,placeholder:"Select gateway",variant:"bordered",className:"w-full"})]})}function ag(n){const{field:e}=n;return p.jsxs($t,{children:[p.jsx(wr,{className:"text-xs text-muted-foreground",children:"Description"}),p.jsx(Pn,{children:p.jsx(Ln,{...e,value:e.value??"",placeholder:"Add a description…",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function cg(n){const{field:e}=n;return p.jsxs($t,{children:[p.jsx(wr,{className:"text-xs text-muted-foreground",children:"Name"}),p.jsx(Pn,{children:p.jsx(Ln,{...e,placeholder:"Untitled assistant",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function ug(n){const e=P.c(12),{onSubmit:t,onStop:r,isStreaming:s,disabled:o,usageMessages:i}=n,{inputValue:l,handleInputChange:a,handleSubmit:c,branchContext:u}=jp();let d;e[0]!==c||e[1]!==t?(d=m=>c(m,t),e[0]=c,e[1]=t,e[2]=d):d=e[2];const f=u?"Edit your message...":"Ask anything or @ for context";let h;return e[3]!==o||e[4]!==a||e[5]!==l||e[6]!==s||e[7]!==r||e[8]!==d||e[9]!==f||e[10]!==i?(h=p.jsx(mn.Input,{onSubmit:d,onStop:r,disabled:o,isStreaming:s,placeholder:f,usageMessages:i,value:l,onValueChange:a}),e[3]=o,e[4]=a,e[5]=l,e[6]=s,e[7]=r,e[8]=d,e[9]=f,e[10]=i,e[11]=h):h=e[11],h}function dg(n){const e=P.c(77),{activeThreadId:t,setActiveThreadId:r,mode:s,assistant:o,form:i}=n;let l;e[0]!==t||e[1]!==o.system_prompt||e[2]!==r?(l={threadId:t,systemPrompt:o.system_prompt,onThreadChange:r},e[0]=t,e[1]=o.system_prompt,e[2]=r,e[3]=l):l=e[3];const a=Op(l),{inputController:c,branchContext:u,clearBranchContext:d,branchFromMessage:f}=a,h=!!o.gateway_id&&!!o.model?.id&&!!o.model?.connectionId;let m;e[4]!==t||e[5]!==o.gateway_id||e[6]!==o.model||e[7]!==a||e[8]!==d||e[9]!==h?(m=async He=>{if(!h)return;const gt={created_at:new Date().toISOString(),thread_id:t,model:{id:o.model.id,connectionId:o.model.connectionId},gateway:{id:o.gateway_id??""},user:{name:"you"}};await a.sendMessage(He,gt),d()},e[4]=t,e[5]=o.gateway_id,e[6]=o.model,e[7]=a,e[8]=d,e[9]=h,e[10]=m):m=e[10];const g=m;let y;e[11]!==u||e[12]!==d||e[13]!==c||e[14]!==r?(y=()=>{u&&(r(u.originalThreadId),d(),c.setValue(""))},e[11]=u,e[12]=d,e[13]=c,e[14]=r,e[15]=y):y=e[15];const x=y;let b;e[16]!==o.avatar||e[17]!==o.title?(b=o.avatar?p.jsx("div",{className:"size-[60px] rounded-[18px] border border-border shrink-0 overflow-hidden",children:p.jsx("img",{src:o.avatar,alt:o.title,className:"h-full w-full object-cover"})}):p.jsx("div",{className:"size-[60px] rounded-[18px] border border-border shrink-0 overflow-hidden bg-muted/20 flex items-center justify-center",children:p.jsx(to,{size:28,className:"text-muted-foreground"})}),e[16]=o.avatar,e[17]=o.title,e[18]=b):b=e[18];let v;e[19]!==o.title?(v=p.jsx("h3",{className:"text-xl font-medium text-foreground",children:o.title}),e[19]=o.title,e[20]=v):v=e[20];let C;e[21]!==o.description?(C=o.description?p.jsx("div",{className:"text-muted-foreground text-center text-sm max-w-md",children:o.description}):null,e[21]=o.description,e[22]=C):C=e[22];let k;e[23]!==b||e[24]!==v||e[25]!==C?(k=p.jsxs("div",{className:"flex flex-col items-center gap-4",children:[b,v,C]}),e[23]=b,e[24]=v,e[25]=C,e[26]=k):k=e[26];let w;e[27]!==o.gateway_id||e[28]!==g?(w=o.gateway_id&&p.jsx(ar,{fallback:null,children:p.jsx(N.Suspense,{fallback:p.jsx("div",{className:"flex justify-center mt-6",children:p.jsx(Zt,{size:20,className:"animate-spin text-muted-foreground"})}),children:p.jsx(rg,{gatewayId:o.gateway_id,onSelect:He=>{g(He.description??He.name)}})})}),e[27]=o.gateway_id,e[28]=g,e[29]=w):w=e[29];let S;e[30]!==k||e[31]!==w?(S=p.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 p-4 text-center",children:[k,w]}),e[30]=k,e[31]=w,e[32]=S):S=e[32];const M=S;let E;e[33]!==a.messages?(E=a.messages.filter(fg),e[33]=a.messages,e[34]=E):E=e[34];const T=E,R=s==="edit",L=R?"opacity-100 pointer-events-auto":"opacity-0 pointer-events-none";let B;e[35]!==L?(B=Z("absolute inset-0 px-2 transition-opacity duration-200 ease-out",L),e[35]=L,e[36]=B):B=e[36];let _;e[37]!==i?(_=p.jsx(sg,{form:i}),e[37]=i,e[38]=_):_=e[38];let O;e[39]!==B||e[40]!==_?(O=p.jsx("div",{className:B,children:_}),e[39]=B,e[40]=_,e[41]=O):O=e[41];const A=R?"opacity-0 pointer-events-none":"opacity-100";let D;e[42]!==A?(D=Z("h-full transition-opacity duration-200 ease-out",A),e[42]=A,e[43]=D):D=e[43];let z;e[44]!==f||e[45]!==a.messages||e[46]!==a.status||e[47]!==M||e[48]!==T.length?(z=T.length===0?p.jsx(mn.EmptyState,{children:M}):p.jsx(mn.Messages,{messages:a.messages,status:a.status,minHeightOffset:240,onBranchFromMessage:f}),e[44]=f,e[45]=a.messages,e[46]=a.status,e[47]=M,e[48]=T.length,e[49]=z):z=e[49];let K;e[50]!==D||e[51]!==z?(K=p.jsx("div",{className:D,children:z}),e[50]=D,e[51]=z,e[52]=K):K=e[52];let W;e[53]!==O||e[54]!==K?(W=p.jsxs(mn.Main,{className:"h-full relative overflow-hidden",children:[O,K]}),e[53]=O,e[54]=K,e[55]=W):W=e[55];const H=R?"translate-y-full":"translate-y-0";let q;e[56]!==H?(q=Z("transition-transform duration-300 ease-out",H),e[56]=H,e[57]=q):q=e[57];let X;e[58]===Symbol.for("react.memo_cache_sentinel")?(X=p.jsx(Dp,{}),e[58]=X):X=e[58];const J=a.status==="submitted"||a.status==="streaming",Q=!h;let ne;e[59]!==a.messages||e[60]!==a.stop||e[61]!==g||e[62]!==J||e[63]!==Q?(ne=p.jsxs("div",{className:"max-w-2xl mx-auto w-full min-w-0 flex flex-col gap-2",children:[X,p.jsx(ug,{onSubmit:g,onStop:a.stop,isStreaming:J,disabled:Q,usageMessages:a.messages})]}),e[59]=a.messages,e[60]=a.stop,e[61]=g,e[62]=J,e[63]=Q,e[64]=ne):ne=e[64];let me;e[65]!==u||e[66]!==d||e[67]!==x||e[68]!==c||e[69]!==ne?(me=p.jsx(mn.Footer,{children:p.jsx(Ap,{inputController:c,branchContext:u,clearBranchContext:d,onGoToOriginalMessage:x,children:ne})}),e[65]=u,e[66]=d,e[67]=x,e[68]=c,e[69]=ne,e[70]=me):me=e[70];let je;e[71]!==q||e[72]!==me?(je=p.jsx("div",{className:q,children:me}),e[71]=q,e[72]=me,e[73]=je):je=e[73];let mt;return e[74]!==W||e[75]!==je?(mt=p.jsxs(mn,{children:[W,je]}),e[74]=W,e[75]=je,e[76]=mt):mt=e[76],mt}function fg(n){return n.role!=="system"}function hg(n){const e=P.c(18),{value:t,onChange:r,alt:s,size:o}=n,i=o===void 0?"md":o,l=N.useRef(null),a=i==="xs"?"h-6 w-6":i==="sm"?"h-8 w-8":"h-16 w-16",c=i==="xs"?"h-3 w-3":i==="sm"?"h-4 w-4":"h-6 w-6",u=i==="xs"?"h-3 w-3":i==="sm"?"h-3.5 w-3.5":"h-5 w-5";let d;e[0]!==r?(d=w=>{const S=w.target.files?.[0];if(!S)return;const M=new FileReader;M.onloadend=()=>{const E=M.result;r(E)},M.readAsDataURL(S)},e[0]=r,e[1]=d):d=e[1];const f=d;let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=()=>{l.current?.click()},e[2]=h):h=e[2];const m=h,g=`relative ${a} shrink-0 cursor-pointer group`;let y;e[3]!==f?(y=p.jsx("input",{type:"file",ref:l,className:"hidden",accept:"image/*",onChange:f}),e[3]=f,e[4]=y):y=e[4];let x;e[5]!==s||e[6]!==c||e[7]!==t?(x=t?p.jsx("img",{src:t,alt:s||"Avatar",className:"w-full h-full object-cover"}):p.jsx("div",{className:"w-full h-full flex items-center justify-center text-muted-foreground",children:p.jsx(to,{className:c})}),e[5]=s,e[6]=c,e[7]=t,e[8]=x):x=e[8];const b=`${u} text-white`;let v;e[9]!==b?(v=p.jsx("div",{className:"absolute inset-0 bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center rounded-xl",children:p.jsx(Xp,{className:b})}),e[9]=b,e[10]=v):v=e[10];let C;e[11]!==x||e[12]!==v?(C=p.jsxs("div",{className:"h-full w-full rounded-xl border border-border bg-muted/20 overflow-hidden relative",children:[x,v]}),e[11]=x,e[12]=v,e[13]=C):C=e[13];let k;return e[14]!==g||e[15]!==y||e[16]!==C?(k=p.jsxs("div",{className:g,onClick:m,children:[y,C]}),e[14]=g,e[15]=y,e[16]=C,e[17]=k):k=e[17],k}function pg(n){const e=P.c(57),{providerId:t,assistantId:r,onBack:s}=n,i=Ks().location.href,l=Yi();let a;e[0]!==s||e[1]!==l?(a=s??(()=>l.history.back()),e[0]=s,e[1]=l,e[2]=a):a=e[2];const c=a,{locator:u}=Fp();let d;e[3]!==r||e[4]!==u?(d=Bp.assistantChatActiveThread(u,r),e[3]=r,e[4]=u,e[5]=d):d=e[5];const[f,h]=zp(d,mg),m=t||ht;let g;e[6]!==m?(g=Lt(m),e[6]=m,e[7]=g):g=e[7];const y=g,x=tl(t,"ASSISTANT",r,y),b=Gs(t,"ASSISTANT",y),v=b.update.isPending,[C,k]=N.useState(x?.model.id&&x?.gateway_id?"chat":"edit");let w;e[8]===Symbol.for("react.memo_cache_sentinel")?(w=ip(Jp),e[8]=w):w=e[8];const S=x??void 0;let M;e[9]!==S?(M={resolver:w,values:S},e[9]=S,e[10]=M):M=e[10];const E=ru(M);let T;e[11]!==b.update||e[12]!==r||e[13]!==E?(T=E.handleSubmit(async J=>{const Q=await b.update.mutateAsync({id:r,data:J});E.reset(Q),k("chat")}),e[11]=b.update,e[12]=r,e[13]=E,e[14]=T):T=e[14];const R=T;if(!x){let J;e[15]===Symbol.for("react.memo_cache_sentinel")?(J=p.jsx(ca,{}),e[15]=J):J=e[15];let Q;e[16]===Symbol.for("react.memo_cache_sentinel")?(Q=p.jsx("div",{className:"flex h-full w-full bg-background",children:p.jsx(vr,{title:"Assistant not found",description:"This assistant may have been deleted or you may not have access to it."})}),e[16]=Q):Q=e[16];let ne;return e[17]!==c?(ne=p.jsx(ar,{children:p.jsx(N.Suspense,{fallback:J,children:p.jsx(Nn,{onBack:c,children:Q})})}),e[17]=c,e[18]=ne):ne=e[18],ne}let L;e[19]===Symbol.for("react.memo_cache_sentinel")?(L=p.jsx(ca,{}),e[19]=L):L=e[19];let B;e[20]!==x.avatar||e[21]!==x.title?(B=p.jsx("div",{className:"h-6 w-6 min-w-6 rounded-lg border border-border bg-muted/20 overflow-hidden shrink-0",children:x.avatar?p.jsx("img",{src:x.avatar,alt:x.title,className:"h-full w-full object-cover"}):p.jsx("div",{className:"h-full w-full flex items-center justify-center text-muted-foreground",children:p.jsx(to,{size:12,className:"text-muted-foreground"})})}),e[20]=x.avatar,e[21]=x.title,e[22]=B):B=e[22];let _;e[23]!==x.title?(_=p.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:x.title}),e[23]=x.title,e[24]=_):_=e[24];let O;e[25]!==x.description?(O=x.description?p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),p.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:x.description})]}):null,e[25]=x.description,e[26]=O):O=e[26];let A;e[27]!==_||e[28]!==O?(A=p.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[_,O]}),e[27]=_,e[28]=O,e[29]=A):A=e[29];let D;e[30]!==B||e[31]!==A?(D=p.jsx(ol,{children:p.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[B,A]})}),e[30]=B,e[31]=A,e[32]=D):D=e[32];const z=x.avatar??"assistant";let K;e[33]!==x.title||e[34]!==z||e[35]!==i?(K=p.jsx(Xs,{title:x.title,url:i,icon:z}),e[33]=x.title,e[34]=z,e[35]=i,e[36]=K):K=e[36];let W;e[37]!==E.formState.isDirty||e[38]!==v||e[39]!==C||e[40]!==R||e[41]!==h?(W=C==="chat"?p.jsxs(p.Fragment,{children:[p.jsx(Ue,{children:p.jsxs(Ke,{children:[p.jsx(Je,{asChild:!0,children:p.jsx(ue,{type:"button",onClick:()=>h(crypto.randomUUID()),"aria-label":"New thread",variant:"outline",size:"icon",className:"size-7 border border-input",children:p.jsx(sl,{size:16})})}),p.jsx(Ge,{children:"New thread"})]})}),p.jsx(Ue,{children:p.jsxs(Ke,{children:[p.jsx(Je,{asChild:!0,children:p.jsx(ue,{type:"button",onClick:()=>k("edit"),"aria-label":"Edit",variant:"outline",size:"icon",className:"size-7 border border-input",children:p.jsx(Nu,{size:16})})}),p.jsx(Ge,{children:"Edit"})]})})]}):p.jsxs(p.Fragment,{children:[p.jsx(Ue,{children:p.jsxs(Ke,{delayDuration:0,children:[p.jsx(Je,{asChild:!0,children:p.jsx("span",{className:"inline-block",children:p.jsx(ue,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:v,onClick:()=>k("chat"),"aria-label":"Cancel",children:p.jsx(Zs,{size:14})})})}),p.jsx(Ge,{side:"bottom",children:"Cancel"})]})}),p.jsx(Ue,{children:p.jsxs(Ke,{delayDuration:0,children:[p.jsx(Je,{asChild:!0,children:p.jsx("span",{className:"inline-block",children:p.jsx(ue,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:!E.formState.isDirty||v,onClick:()=>{R()},"aria-label":"Save",children:v?p.jsx(Zt,{size:14,className:"animate-spin"}):p.jsx(eo,{size:14})})})}),p.jsx(Ge,{side:"bottom",children:"Save"})]})})]}),e[37]=E.formState.isDirty,e[38]=v,e[39]=C,e[40]=R,e[41]=h,e[42]=W):W=e[42];let H;e[43]!==K||e[44]!==W?(H=p.jsxs(Qs,{children:[K,W]}),e[43]=K,e[44]=W,e[45]=H):H=e[45];let q;e[46]!==f||e[47]!==x||e[48]!==E||e[49]!==C||e[50]!==h?(q=p.jsx("div",{className:"h-full",children:p.jsx(dg,{activeThreadId:f,setActiveThreadId:h,mode:C,assistant:x,form:E},E.formState.submitCount)}),e[46]=f,e[47]=x,e[48]=E,e[49]=C,e[50]=h,e[51]=q):q=e[51];let X;return e[52]!==c||e[53]!==D||e[54]!==H||e[55]!==q?(X=p.jsx(ar,{children:p.jsx(N.Suspense,{fallback:L,children:p.jsxs(Nn,{onBack:c,children:[D,H,q]})})}),e[52]=c,e[53]=D,e[54]=H,e[55]=q,e[56]=X):X=e[56],X}function mg(n){return n||crypto.randomUUID()}function gg(n){const e=P.c(6),{itemId:t,onBack:r}=n;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={strict:!1},e[0]=s):s=e[0];const i=Rn(s).connectionId??ht;if(!i||i===ht){let a;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=p.jsx("div",{className:"flex h-full w-full bg-background",children:p.jsx(vr,{title:"Assistant not found",description:"Missing connection information in the current route."})}),e[1]=a):a=e[1],a}let l;return e[2]!==i||e[3]!==t||e[4]!==r?(l=p.jsx(pg,{providerId:i,assistantId:t,onBack:r}),e[2]=i,e[3]=t,e[4]=r,e[5]=l):l=e[5],l}lp({title:jo().min(1),description:jo().nullable(),body:jo()});function Po(n){for(const e of n.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function yg(){const n=window.location.pathname.split("/").filter(Boolean),e=n.findIndex(r=>r==="mcps"),t=e>=0?n[e+1]:void 0;return t?decodeURIComponent(t):void 0}function xg(n){const e=P.c(13),{form:t}=n;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=p.jsx("div",{className:"text-sm font-medium text-foreground",children:"Details"}),e[0]=r):r=e[0];let s;e[1]!==t.control?(s=p.jsxs("div",{className:"flex flex-col gap-4",children:[r,p.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[p.jsx(ct,{control:t.control,name:"title",render:vg}),p.jsx(ct,{control:t.control,name:"description",render:kg})]})]}),e[1]=t.control,e[2]=s):s=e[2];let o,i;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=p.jsx("div",{className:"text-sm font-medium text-foreground",children:"Message"}),i=p.jsx("div",{className:"text-xs text-muted-foreground",children:"This becomes the user message in the prompt."}),e[3]=o,e[4]=i):(o=e[3],i=e[4]);let l;e[5]!==t.control?(l=p.jsxs("div",{className:"flex flex-col gap-2",children:[o,i,p.jsx(ct,{control:t.control,name:"body",render:bg})]}),e[5]=t.control,e[6]=l):l=e[6];let a;e[7]!==s||e[8]!==l?(a=p.jsxs("div",{className:"h-full py-6 flex flex-col max-w-3xl mx-auto w-full min-w-0 gap-8 overflow-y-auto px-4",children:[s,l]}),e[7]=s,e[8]=l,e[9]=a):a=e[9];let c;return e[10]!==t||e[11]!==a?(c=p.jsx(au,{...t,children:a}),e[10]=t,e[11]=a,e[12]=c):c=e[12],c}function bg(n){const{field:e}=n;return p.jsx($t,{children:p.jsx(Pn,{children:p.jsx(Zr,{...e,value:e.value??"",placeholder:"Write the prompt message…",className:"min-h-[240px] resize-none text-base leading-relaxed font-normal rounded-xl border border-border bg-muted/20 px-4 py-3 shadow-none focus-visible:ring-0"})})})}function kg(n){const{field:e}=n;return p.jsxs($t,{children:[p.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),p.jsx(Pn,{children:p.jsx(Ln,{...e,value:e.value??"",placeholder:"Add a description…",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function vg(n){const{field:e}=n;return p.jsxs($t,{children:[p.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),p.jsx(Pn,{children:p.jsx(Ln,{...e,placeholder:"Untitled prompt",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function wg(n){const e=P.c(51),{providerId:t,promptId:r,onBack:s}=n,i=Ks().location.href,l=t||ht;let a;e[0]!==l?(a=Lt(l),e[0]=l,e[1]=a):a=e[1];const c=a,u=tl(t,"PROMPT",r,c),d=Gs(t,"PROMPT",c),f=d.update.isPending;let h;e[2]!==u?(h=u?{title:u.title,description:u.description??null,body:Po(u)}:void 0,e[2]=u,e[3]=h):h=e[3];let m;e[4]!==h?(m={values:h},e[4]=h,e[5]=m):m=e[5];const g=ru(m);let y;e[6]!==g||e[7]!==u?(y=()=>{u&&g.reset({title:u.title,description:u.description??null,body:Po(u)})},e[6]=g,e[7]=u,e[8]=y):y=e[8];const x=y;let b;e[9]!==d.update||e[10]!==g||e[11]!==r?(b=g.handleSubmit(async q=>{const X=await d.update.mutateAsync({id:r,data:{title:q.title,description:q.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:q.body}}]}});g.reset({title:X.title,description:X.description??null,body:Po(X)})}),e[9]=d.update,e[10]=g,e[11]=r,e[12]=b):b=e[12];const v=b;if(!u){let q;return e[13]===Symbol.for("react.memo_cache_sentinel")?(q=p.jsx("div",{className:"flex h-full w-full bg-background",children:p.jsx(vr,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[13]=q):q=e[13],q}let C;e[14]!==u.title?(C=p.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:u.title}),e[14]=u.title,e[15]=C):C=e[15];let k;e[16]!==u.description?(k=u.description?p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),p.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:u.description})]}):null,e[16]=u.description,e[17]=k):k=e[17];let w;e[18]!==C||e[19]!==k?(w=p.jsx(ol,{children:p.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[C,k]})}),e[18]=C,e[19]=k,e[20]=w):w=e[20];let S;e[21]!==u.title||e[22]!==i?(S=p.jsx(Xs,{title:u.title,url:i,icon:"description"}),e[21]=u.title,e[22]=i,e[23]=S):S=e[23];const M=!g.formState.isDirty||f;let E;e[24]===Symbol.for("react.memo_cache_sentinel")?(E=p.jsx(Zs,{size:14}),e[24]=E):E=e[24];let T;e[25]!==x||e[26]!==M?(T=p.jsx(Je,{asChild:!0,children:p.jsx("span",{className:"inline-block",children:p.jsx(ue,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:M,onClick:x,"aria-label":"Cancel",children:E})})}),e[25]=x,e[26]=M,e[27]=T):T=e[27];let R;e[28]===Symbol.for("react.memo_cache_sentinel")?(R=p.jsx(Ge,{side:"bottom",children:"Cancel"}),e[28]=R):R=e[28];let L;e[29]!==T?(L=p.jsx(Ue,{children:p.jsxs(Ke,{delayDuration:0,children:[T,R]})}),e[29]=T,e[30]=L):L=e[30];const B=!g.formState.isDirty||f;let _;e[31]!==v?(_=()=>{v()},e[31]=v,e[32]=_):_=e[32];let O;e[33]===Symbol.for("react.memo_cache_sentinel")?(O=p.jsx(eo,{size:14}),e[33]=O):O=e[33];let A;e[34]!==B||e[35]!==_?(A=p.jsx(Je,{asChild:!0,children:p.jsx("span",{className:"inline-block",children:p.jsx(ue,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:B,onClick:_,"aria-label":"Save",children:O})})}),e[34]=B,e[35]=_,e[36]=A):A=e[36];let D;e[37]===Symbol.for("react.memo_cache_sentinel")?(D=p.jsx(Ge,{side:"bottom",children:"Save"}),e[37]=D):D=e[37];let z;e[38]!==A?(z=p.jsx(Ue,{children:p.jsxs(Ke,{delayDuration:0,children:[A,D]})}),e[38]=A,e[39]=z):z=e[39];let K;e[40]!==S||e[41]!==L||e[42]!==z?(K=p.jsxs(Qs,{children:[S,L,z]}),e[40]=S,e[41]=L,e[42]=z,e[43]=K):K=e[43];let W;e[44]!==g?(W=p.jsx("div",{className:"h-full",children:p.jsx(xg,{form:g})}),e[44]=g,e[45]=W):W=e[45];let H;return e[46]!==s||e[47]!==K||e[48]!==W||e[49]!==w?(H=p.jsxs(Nn,{onBack:s,children:[w,K,W]}),e[46]=s,e[47]=K,e[48]=W,e[49]=w,e[50]=H):H=e[50],H}function Sg(n){const e=P.c(5),{itemId:t,onBack:r}=n;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=yg()??ht,e[0]=s):s=e[0];const o=s;if(!o||o===ht){let l;return e[1]===Symbol.for("react.memo_cache_sentinel")?(l=p.jsx("div",{className:"flex h-full w-full bg-background",children:p.jsx(vr,{title:"Prompt not found",description:"Missing connection information in the current route."})}),e[1]=l):l=e[1],l}let i;return e[2]!==t||e[3]!==r?(i=p.jsx(ar,{children:p.jsx(N.Suspense,{fallback:null,children:p.jsx(wg,{providerId:o,promptId:t,onBack:r})})}),e[2]=t,e[3]=r,e[4]=i):i=e[4],i}const Cg=ap("relative w-full rounded-lg border px-4 py-3 text-sm flex items-start gap-3 [&>svg]:size-4 [&>svg]:flex-shrink-0 [&>svg]:mt-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-destructive/5 text-destructive border-destructive/25 [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",warning:"bg-warning/10 text-warning-foreground border-warning [&>svg]:text-current *:data-[slot=alert-description]:text-warning-foreground/90",success:"bg-success/10 text-success-foreground border-success [&>svg]:text-current *:data-[slot=alert-description]:text-success-foreground/90",info:"bg-card text-card-foreground border-border [&>svg]:text-current *:data-[slot=alert-description]:text-muted-foreground/90"}},defaultVariants:{variant:"default"}});function Ng(n){const e=P.c(10);let t,r,s;e[0]!==n?({className:t,variant:s,...r}=n,e[0]=n,e[1]=t,e[2]=r,e[3]=s):(t=e[1],r=e[2],s=e[3]);let o;e[4]!==t||e[5]!==s?(o=Z(Cg({variant:s}),t),e[4]=t,e[5]=s,e[6]=o):o=e[6];let i;return e[7]!==r||e[8]!==o?(i=p.jsx("div",{"data-slot":"alert",role:"alert",className:o,...r}),e[7]=r,e[8]=o,e[9]=i):i=e[9],i}function Eg(n){const e=P.c(8);let t,r;e[0]!==n?({className:t,...r}=n,e[0]=n,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let s;e[3]!==t?(s=Z("line-clamp-1 min-h-4 font-medium tracking-tight",t),e[3]=t,e[4]=s):s=e[4];let o;return e[5]!==r||e[6]!==s?(o=p.jsx("div",{"data-slot":"alert-title",className:s,...r}),e[5]=r,e[6]=s,e[7]=o):o=e[7],o}function Tg(n){const e=P.c(8);let t,r;e[0]!==n?({className:t,...r}=n,e[0]=n,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let s;e[3]!==t?(s=Z("text-muted-foreground leading-relaxed",t),e[3]=t,e[4]=s):s=e[4];let o;return e[5]!==r||e[6]!==s?(o=p.jsx("div",{"data-slot":"alert-description",className:s,...r}),e[5]=r,e[6]=s,e[7]=o):o=e[7],o}const Mg=n=>n.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Og(n){const e=P.c(13),{toolName:t,connectionId:r,onBack:s}=n,o=`/mcp/${r}`;let i;e[0]!==o?(i=new URL(o,window.location.origin),e[0]=o,e[1]=i):i=e[1];const l=i;let a;e[2]!==r?(a={connectionId:r},e[2]=r,e[3]=a):a=e[3];const c=nm(a);if(!c.isAuthenticated){let f;return e[4]!==c.supportsOAuth||e[5]!==s?(f=p.jsx("div",{className:"flex h-full items-center justify-center",children:c.supportsOAuth?p.jsx(rm,{onAuthenticate:()=>s(),buttonText:"Go back to authenticate"}):p.jsx(sm,{hasReadme:!1})}),e[4]=c.supportsOAuth,e[5]=s,e[6]=f):f=e[6],f}const u=`${r}:${t}`;let d;return e[7]!==r||e[8]!==l||e[9]!==s||e[10]!==u||e[11]!==t?(d=p.jsx(Ag,{toolName:t,connectionId:r,mcpProxyUrl:l,onBack:s},u),e[7]=r,e[8]=l,e[9]=s,e[10]=u,e[11]=t,e[12]=d):d=e[12],d}function Ag({toolName:n,connectionId:e,mcpProxyUrl:t,onBack:r}){const o=Ks().location.href,{replayId:i}=cp({strict:!1}),l=(()=>{if(!i)return null;const A=`replay-${i}`,D=sessionStorage.getItem(A);if(!D)return null;sessionStorage.removeItem(A);try{return JSON.parse(D)}catch{return null}})(),a=(()=>{if(!l)return null;const A={};for(const[D,z]of Object.entries(l))z!==null&&typeof z=="object"?A[D]=JSON.stringify(z,null,2):A[D]=z;return A})(),[c,u]=N.useState(a??{}),[d,f]=N.useState(l?JSON.stringify(l,null,2):"{}"),[h,m]=N.useState(null),[g,y]=N.useState(null),[x,b]=N.useState(!1),[v,C]=N.useState(null),k=nl(e),w=al({url:t.href});N.useEffect(()=>{w.error&&console.error("MCP Error:",w.error)},[w.error]);const S=w.tools?.find(A=>A.name===n),M=S?.inputSchema?.properties,E=M?Object.keys(M):[],T=E.length>0,R={};if(T&&S?.inputSchema?.properties)for(const A of E)R[A]=S.inputSchema.required?.includes(A)?"":void 0;const L=A=>Object.prototype.hasOwnProperty.call(c,A),B=async()=>{b(!0),y(null),m(null),C(null);const A=performance.now(),D=Lt(e);try{const z=T?{...R,...c}:(()=>{const J=d.trim();if(!J)return{};const Q=JSON.parse(J);if(Q&&typeof Q=="object")return Q;throw new Error("Raw JSON input must be an object.")})();T&&S?.inputSchema?.properties&&Object.entries(S.inputSchema.properties).forEach(([J,Q])=>{if((Q.type==="object"||Q.type==="array")&&typeof z[J]=="string")try{z[J]=JSON.parse(z[J])}catch{}});const K=await D(n,z),W=performance.now(),H=Math.round(W-A);m(K);const q=JSON.stringify(K),X=new TextEncoder().encode(q).length;C({duration:`${H}ms`,bytes:`${X} bytes`,tokens:`~${Math.ceil(X/4)} tokens`,cost:"$0.0000"})}catch(z){const K=z instanceof Error?z.message:String(z);y(K||"Unknown error occurred");const W=performance.now();C({duration:`${Math.round(W-A)}ms`})}finally{b(!1)}},_=(A,D)=>{u(z=>({...z,[A]:D}))},O=()=>{m(null),y(null),C(null)};return p.jsxs(Nn,{onBack:r,children:[p.jsx(Qs,{children:p.jsx(Xs,{title:S?.name??Mg(n),url:o,icon:"build"})}),p.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 h-full",children:[p.jsx("div",{className:"flex flex-col border-r border-border overflow-hidden",children:p.jsxs("div",{className:"flex-1 overflow-auto",children:[p.jsx("div",{className:"flex flex-col gap-4 p-6 border-b border-border min-h-28",children:p.jsxs("div",{className:"flex flex-col gap-2",children:[p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx(Ys,{icon:k?.icon||null,name:k?.title||n,size:"sm",className:"shadow-sm shrink-0"}),p.jsx("h1",{className:"text-lg font-medium text-foreground leading-none",children:n}),p.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-muted/50 rounded-md h-fit",children:[w.state==="ready"?p.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):w.state==="connecting"?p.jsx(Zt,{size:10,className:"animate-spin text-yellow-500 shrink-0"}):p.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-red-500 shrink-0"}),p.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:w.state.replace("_"," ")})]})]}),p.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:S?.description||"No description available"})]})}),p.jsxs("div",{className:"flex flex-col p-6 gap-4",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsx("h2",{className:"text-sm font-semibold text-foreground uppercase tracking-wide",children:"Parameters"}),S?.inputSchema?.required&&S.inputSchema.required.length>0&&p.jsxs("span",{className:"text-xs text-muted-foreground",children:[p.jsx("span",{className:"text-red-500",children:"*"})," Required"]})]}),p.jsx("div",{className:"space-y-4",children:T&&S?.inputSchema?.properties?Object.entries(S.inputSchema.properties).map(([A,D])=>p.jsxs("div",{className:"space-y-2",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsxs("label",{className:"text-sm font-medium leading-none flex items-center gap-1.5",children:[A,S.inputSchema?.required?.includes(A)&&p.jsx("span",{className:"text-red-500 text-xs",children:"*"})]}),p.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:D.type})]}),D.description&&p.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:D.description}),D.type==="object"||D.type==="array"?p.jsx(Zr,{className:"font-mono text-xs",value:L(A)?c[A]??"":R[A]??"",onChange:z=>_(A,z.target.value),placeholder:`Enter ${A} as JSON...`,rows:3}):p.jsx(Ln,{value:L(A)?c[A]??"":R[A]??"",onChange:z=>_(A,z.target.value),placeholder:`Enter ${A}...`})]},A)):S?.inputSchema&&!T?p.jsxs("div",{className:"space-y-2",children:[p.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),p.jsx(Zr,{className:"font-mono text-xs min-h-[120px]",value:d,onChange:A=>f(A.target.value),placeholder:'e.g. { "foo": "bar" }'})]}):p.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:p.jsx("p",{className:"text-sm text-muted-foreground",children:"No parameters required"})})})]})]})}),p.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[p.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-t lg:border-t-0 border-b border-border bg-background",children:[p.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:"Result"}),v&&p.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[p.jsxs("div",{className:"flex items-center gap-1.5",children:[p.jsx(Zp,{className:"h-3 w-3 text-muted-foreground"}),p.jsx("span",{className:"font-mono text-foreground",children:v.duration})]}),v.tokens&&p.jsxs("div",{className:"flex items-center gap-1.5",children:[p.jsx(xu,{className:"h-3 w-3 text-muted-foreground"}),p.jsx("span",{className:"font-mono text-foreground",children:v.tokens})]}),v.bytes&&p.jsxs("div",{className:"flex items-center gap-1.5",children:[p.jsx(Cu,{className:"h-3 w-3 text-muted-foreground"}),p.jsx("span",{className:"font-mono text-foreground",children:v.bytes})]}),v.cost&&p.jsx("div",{className:"flex items-center gap-1.5",children:p.jsx("span",{className:"font-mono text-foreground",children:v.cost})})]})]}),p.jsx("div",{className:"flex items-center justify-end lg:justify-between px-4 h-14 border-b border-border bg-background",children:p.jsxs("div",{className:"flex items-center gap-2 w-full lg:w-auto",children:[p.jsx(ue,{size:"sm",variant:"default",className:"h-8 gap-2 flex-1 lg:flex-none",onClick:B,disabled:x,children:x?p.jsxs(p.Fragment,{children:[p.jsx(Zt,{size:14,className:"animate-spin"}),"Executing..."]}):p.jsxs(p.Fragment,{children:[p.jsx(il,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})}),p.jsx(Ue,{children:p.jsxs(Ke,{children:[p.jsx(Je,{asChild:!0,children:p.jsx(ue,{size:"icon",variant:"outline",className:"h-8 w-8 shrink-0",onClick:O,disabled:!h&&!g,children:p.jsx(ll,{size:14})})}),p.jsx(Ge,{children:p.jsx("p",{children:"Clear results"})})]})})]})}),g&&p.jsx("div",{className:"px-6 py-4 bg-background",children:p.jsx(Ng,{variant:"destructive",children:p.jsxs("div",{className:"flex flex-col gap-2",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(Qp,{className:"h-4 w-4"}),p.jsx(Eg,{className:"mb-0",children:"Execution Failed"})]}),p.jsx(Tg,{className:"text-xs text-destructive",children:g})]})})}),p.jsx("div",{className:"relative flex-1 overflow-auto bg-muted/50",children:h?p.jsxs(p.Fragment,{children:[p.jsx(tm,{jsonString:JSON.stringify(h,null,2),padding:"1.5rem"}),p.jsx(ue,{size:"icon",variant:"ghost",className:"absolute top-4 right-4 h-8 w-8 bg-background/80 hover:bg-background border border-border shadow-sm",onClick:()=>{navigator.clipboard.writeText(JSON.stringify(h,null,2)),up.success("Copied to clipboard")},children:p.jsx(em,{className:"h-3.5 w-3.5"})})]}):p.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[p.jsx(ku,{className:"h-12 w-12 mb-3 opacity-40"}),p.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]})]})]})}function Ig(n){const e=P.c(7),{itemId:t,onBack:r}=n;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={strict:!1},e[0]=s):s=e[0];const i=Rn(s).connectionId??ht;if(!nl(i)){let u;return e[1]===Symbol.for("react.memo_cache_sentinel")?(u=p.jsx("div",{className:"flex h-full items-center justify-center",children:p.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[p.jsx("h3",{className:"text-lg font-semibold",children:"Connection not found"}),p.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection may have been deleted or you may not have access."})]})}),e[1]=u):u=e[1],u}let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=p.jsx("div",{className:"flex h-full items-center justify-center",children:p.jsx(Zt,{size:32,className:"animate-spin text-muted-foreground"})}),e[2]=a):a=e[2];let c;return e[3]!==i||e[4]!==r||e[5]!==t?(c=p.jsx(N.Suspense,{fallback:a,children:p.jsx(Og,{toolName:t,connectionId:i,onBack:r})}),e[3]=i,e[4]=r,e[5]=t,e[6]=c):c=e[6],c}const ya=n=>{let e;const t=new Set,r=(c,u)=>{const d=typeof c=="function"?c(e):c;if(!Object.is(d,e)){const f=e;e=u??(typeof d!="object"||d===null)?d:Object.assign({},e,d),t.forEach(h=>h(e,f))}},s=()=>e,l={setState:r,getState:s,getInitialState:()=>a,subscribe:c=>(t.add(c),()=>t.delete(c))},a=e=n(r,s,l);return l},ul=(n=>n?ya(n):ya),jg=n=>n;function yi(n,e=jg){const t=ee.useSyncExternalStore(n.subscribe,ee.useCallback(()=>e(n.getState()),[n,e]),ee.useCallback(()=>e(n.getInitialState()),[n,e]));return ee.useDebugValue(t),t}const Rg=n=>{const e=ul(n),t=r=>yi(e,r);return Object.assign(t,e),t},Dg=(n=>Rg);function Ou(n,e){let t;try{t=n()}catch{return}return{getItem:s=>{var o;const i=a=>a===null?null:JSON.parse(a,void 0),l=(o=t.getItem(s))!=null?o:null;return l instanceof Promise?l.then(i):i(l)},setItem:(s,o)=>t.setItem(s,JSON.stringify(o,void 0)),removeItem:s=>t.removeItem(s)}}const xi=n=>e=>{try{const t=n(e);return t instanceof Promise?t:{then(r){return xi(r)(t)},catch(r){return this}}}catch(t){return{then(r){return this},catch(r){return xi(r)(t)}}}},Pg=(n,e)=>(t,r,s)=>{let o={storage:Ou(()=>localStorage),partialize:g=>g,version:0,merge:(g,y)=>({...y,...g}),...e},i=!1;const l=new Set,a=new Set;let c=o.storage;if(!c)return n((...g)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),t(...g)},r,s);const u=()=>{const g=o.partialize({...r()});return c.setItem(o.name,{state:g,version:o.version})},d=s.setState;s.setState=(g,y)=>(d(g,y),u());const f=n((...g)=>(t(...g),u()),r,s);s.getInitialState=()=>f;let h;const m=()=>{var g,y;if(!c)return;i=!1,l.forEach(b=>{var v;return b((v=r())!=null?v:f)});const x=((y=o.onRehydrateStorage)==null?void 0:y.call(o,(g=r())!=null?g:f))||void 0;return xi(c.getItem.bind(c))(o.name).then(b=>{if(b)if(typeof b.version=="number"&&b.version!==o.version){if(o.migrate){const v=o.migrate(b.state,b.version);return v instanceof Promise?v.then(C=>[!0,C]):[!0,v]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,b.state];return[!1,void 0]}).then(b=>{var v;const[C,k]=b;if(h=o.merge(k,(v=r())!=null?v:f),t(h,!0),C)return u()}).then(()=>{x?.(h,void 0),h=r(),i=!0,a.forEach(b=>b(h))}).catch(b=>{x?.(void 0,b)})};return s.persist={setOptions:g=>{o={...o,...g},g.storage&&(c=g.storage)},clearStorage:()=>{c?.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>m(),hasHydrated:()=>i,onHydrate:g=>(l.add(g),()=>{l.delete(g)}),onFinishHydration:g=>(a.add(g),()=>{a.delete(g)})},o.skipHydration||m(),h||f},Au=Pg,{useSyncExternalStoreWithSelector:Lg}=dp,$g=n=>n;function _g(n,e=$g,t){const r=Lg(n.subscribe,n.getState,n.getInitialState,e,t);return ee.useDebugValue(r),r}const xa=n=>Symbol.iterator in n,ba=n=>"entries"in n,ka=(n,e)=>{const t=n instanceof Map?n:new Map(n.entries()),r=e instanceof Map?e:new Map(e.entries());if(t.size!==r.size)return!1;for(const[s,o]of t)if(!r.has(s)||!Object.is(o,r.get(s)))return!1;return!0},zg=(n,e)=>{const t=n[Symbol.iterator](),r=e[Symbol.iterator]();let s=t.next(),o=r.next();for(;!s.done&&!o.done;){if(!Object.is(s.value,o.value))return!1;s=t.next(),o=r.next()}return!!s.done&&!!o.done};function Bg(n,e){return Object.is(n,e)?!0:typeof n!="object"||n===null||typeof e!="object"||e===null||Object.getPrototypeOf(n)!==Object.getPrototypeOf(e)?!1:xa(n)&&xa(e)?ba(n)&&ba(e)?ka(n,e):zg(n,e):ka({entries:()=>Object.entries(n)},{entries:()=>Object.entries(e)})}function Fg(n,e="Output"){if(!n)return`interface ${e} {}`;function t(o){if(!o||typeof o!="object")return"unknown";const i=o.type;if(Array.isArray(i))return i.map(l=>r(l)).join(" | ");switch(i){case"string":return o.enum?o.enum.map(l=>`"${l}"`).join(" | "):"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";case"array":{const l=o.items;return l?`${t(l)}[]`:"unknown[]"}case"object":return s(o);default:return o.anyOf?o.anyOf.map(t).join(" | "):o.oneOf?o.oneOf.map(t).join(" | "):o.allOf?o.allOf.map(t).join(" & "):"unknown"}}function r(o){switch(o){case"string":return"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";default:return"unknown"}}function s(o){const i=o.properties;if(!i)return"Record<string, unknown>";const l=new Set(o.required||[]);return`{
|
|
2
2
|
${Object.entries(i).map(([c,u])=>{const d=l.has(c)?"":"?";return`${u.description?` /** ${u.description} */
|
|
3
3
|
`:""} ${c}${d}: ${t(u)};`}).join(`
|
|
4
4
|
`)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as n,c as N,j as s}from"./index-
|
|
1
|
+
import{r as n,c as N,j as s}from"./index-BlsDXE23.js";import{c as C,B as y}from"./button-BM8Ntdfr.js";import{d as M,j as z,D as E,c as D,b as S,a as T}from"./dropdown-menu-4Ypgp2xI.js";import{i as L,a as V,c as B,b as _,T as W}from"./tooltip-CYopm1Sm.js";import{V as $}from"./view-mode-toggle-D-v785I-.js";const w=({size:t=24,color:e="currentColor",...r})=>n.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},n.createElement("path",{d:"M12 5v14m0 0 7-7m-7 7-7-7"}));w.displayName="ArrowDown";const k=({size:t=24,color:e="currentColor",...r})=>n.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},n.createElement("path",{d:"M21 12H9m12-6H9m12 12H9m-4-6a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm0-6a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm0 12a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"}));k.displayName="List";const b=({size:t=24,color:e="currentColor",...r})=>n.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},n.createElement("path",{d:"M5 21v-7m0-4V3m7 18v-9m0-4V3m7 18v-5m0-4V3M2 14h6m1-6h6m1 8h6"}));b.displayName="Sliders01";function I(t){const e=N.c(16),{viewMode:r,onViewModeChange:g,sortKey:v,sortDirection:a,onSort:l,sortOptions:c}=t;let d;e[0]!==c?(d=c===void 0?[]:c,e[0]=c,e[1]=d):d=e[1];const m=d;let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(V,{children:s.jsxs(B,{children:[s.jsx(_,{asChild:!0,children:s.jsx(E,{asChild:!0,children:s.jsx(y,{variant:"outline",size:"icon",className:"size-7 border border-input",children:s.jsx(b,{size:16})})})}),s.jsx(W,{children:"Search filters"})]})}),e[2]=h):h=e[2];let p;e[3]===Symbol.for("react.memo_cache_sentinel")?(p={value:"table",icon:s.jsx(k,{})},e[3]=p):p=e[3];let x;e[4]===Symbol.for("react.memo_cache_sentinel")?(x=[p,{value:"cards",icon:s.jsx(D,{})}],e[4]=x):x=e[4];let o;e[5]!==g||e[6]!==r?(o=s.jsx("div",{className:"p-2 border-b border-border",children:s.jsx($,{value:r,onValueChange:g,fullWidth:!0,options:x})}),e[5]=g,e[6]=r,e[7]=o):o=e[7];let i;e[8]!==l||e[9]!==a||e[10]!==v||e[11]!==m?(i=m.length>0&&l&&s.jsxs("div",{className:"p-2",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Sort by"}),m.map(f=>{const j=v===f.id;return s.jsx(M,{onClick:()=>l(f.id),className:C("h-8 px-2 py-0 cursor-pointer",j&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[j&&s.jsx(L,{size:16,className:"text-foreground shrink-0"}),!j&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:f.label}),j&&a&&(a==="asc"?s.jsx(z,{size:16,className:"text-foreground shrink-0"}):s.jsx(w,{size:16,className:"text-foreground shrink-0"}))]})},f.id)})]}),e[8]=l,e[9]=a,e[10]=v,e[11]=m,e[12]=i):i=e[12];let u;return e[13]!==o||e[14]!==i?(u=s.jsxs(S,{children:[h,s.jsxs(T,{align:"end",className:"w-[200px] p-0 gap-0",children:[o,i]})]}),e[13]=o,e[14]=i,e[15]=u):u=e[15],u}export{I as C,w as n};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as j,j as i}from"./index-
|
|
1
|
+
import{c as j,j as i}from"./index-BlsDXE23.js";import{C as b}from"./collection-display-button-M0ZEYwbq.js";function g(h){const e=j.c(17),{title:d,viewMode:r,onViewModeChange:l,sortKey:m,sortDirection:f,onSort:x,sortOptions:n,ctaButton:p}=h;let c;e[0]!==n?(c=n===void 0?[]:n,e[0]=n,e[1]=c):c=e[1];const u=c;let t;e[2]!==d?(t=i.jsx("h1",{className:"text-sm font-medium text-foreground",children:d}),e[2]=d,e[3]=t):t=e[3];let s;e[4]!==x||e[5]!==l||e[6]!==f||e[7]!==m||e[8]!==u||e[9]!==r?(s=r&&l&&i.jsx(b,{viewMode:r,onViewModeChange:l,sortKey:m,sortDirection:f,onSort:x,sortOptions:u}),e[4]=x,e[5]=l,e[6]=f,e[7]=m,e[8]=u,e[9]=r,e[10]=s):s=e[10];let o;e[11]!==p||e[12]!==s?(o=i.jsxs("div",{className:"flex items-center gap-2",children:[s,p]}),e[11]=p,e[12]=s,e[13]=o):o=e[13];let a;return e[14]!==t||e[15]!==o?(a=i.jsx("div",{className:"shrink-0 w-full border-b border-border h-12",children:i.jsxs("div",{className:"flex items-center justify-between gap-3 h-12 px-4",children:[t,o]})}),e[14]=t,e[15]=o,e[16]=a):a=e[16],a}export{g as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as s,j as c}from"./index-
|
|
1
|
+
import{c as s,j as c}from"./index-BlsDXE23.js";function r(t){const e=s.c(2),{children:l}=t;let o;return e[0]!==l?(o=c.jsx("div",{className:"flex flex-col h-full bg-background overflow-hidden",children:l}),e[0]=l,e[1]=o):o=e[1],o}export{r as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as x,j as a}from"./index-
|
|
1
|
+
import{c as x,j as a}from"./index-BlsDXE23.js";import{i as u}from"./SearchMd-DBw3zp_M.js";import{I as b}from"./input-B45bC0Rc.js";import{c as g}from"./button-BM8Ntdfr.js";function w(h){const e=x.c(13),{value:n,onChange:c,placeholder:d,onKeyDown:i,className:m}=h,f=d===void 0?"Search...":d;let t;e[0]!==m?(t=g("shrink-0 w-full border-b border-border h-12",m),e[0]=m,e[1]=t):t=e[1];let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=a.jsx(u,{size:16,className:"text-muted-foreground shrink-0"}),e[2]=o):o=e[2];let r;e[3]!==c?(r=p=>c(p.target.value),e[3]=c,e[4]=r):r=e[4];let s;e[5]!==i||e[6]!==f||e[7]!==r||e[8]!==n?(s=a.jsxs("label",{className:"flex items-center gap-2.5 h-12 px-4 cursor-text",children:[o,a.jsx(b,{value:n,onChange:r,onKeyDown:i,placeholder:f,className:"flex-1 border-0 shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"})]}),e[5]=i,e[6]=f,e[7]=r,e[8]=n,e[9]=s):s=e[9];let l;return e[10]!==t||e[11]!==s?(l=a.jsx("div",{className:t,children:s}),e[10]=t,e[11]=s,e[12]=l):l=e[12],l}export{w as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as g,j as o}from"./index-
|
|
1
|
+
import{c as g,j as o}from"./index-BlsDXE23.js";import{c as u}from"./button-BM8Ntdfr.js";import{n as T}from"./collection-display-button-M0ZEYwbq.js";import{j as $}from"./dropdown-menu-4Ypgp2xI.js";function R(a){const e=g.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("w-full caption-bottom text-sm min-w-0",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("div",{"data-slot":"table-container",className:"relative w-full min-w-0",children:o.jsx("table",{"data-slot":"table",className:l,...s})}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function H(a){const e=g.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("[&_tr]:border-b",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("thead",{"data-slot":"table-header",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function L(a){const e=g.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("[&_tr:last-child]:border-0",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("tbody",{"data-slot":"table-body",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function S(a){const e=g.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("data-[state=selected]:bg-muted border-b transition-colors",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("tr",{"data-slot":"table-row",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function z(a){const e=g.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("th",{"data-slot":"table-head",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function D(a){const e=g.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("td",{"data-slot":"table-cell",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function E(a){const e=g.c(29),{columns:t,data:s,sortKey:l,sortDirection:r,onSort:f,onRowClick:c,rowClassName:x}=a;let h;e[0]!==r?(h=function(n,N){return o.jsx("div",{className:"w-4 flex items-center justify-center",children:N&&r&&(r==="asc"?o.jsx($,{size:16,className:"text-muted-foreground transition-colors"}):o.jsx(T,{size:16,className:"text-muted-foreground transition-colors"}))})},e[0]=r,e[1]=h):h=e[1];const w=h;let p;e[2]===Symbol.for("react.memo_cache_sentinel")?(p=function(n,N){let C="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-xs h-9 uppercase tracking-wider";return n===N-1&&(C="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-xs h-9 uppercase tracking-wider w-8"),C},e[2]=p):p=e[2];const i=p;let d;if(e[3]!==t||e[4]!==f||e[5]!==w||e[6]!==l){let m;e[8]!==t.length||e[9]!==f||e[10]!==w||e[11]!==l?(m=(n,N)=>{const C=l===n.id;return o.jsx(z,{className:u(i(N,t.length),"group transition-colors select-none",n.sortable&&"hover:bg-accent cursor-pointer",n.rowClassName,n.cellClassName),onClick:n.sortable&&f?()=>f(n.id):void 0,children:o.jsxs("span",{className:"flex items-center gap-1",children:[n.header,n.sortable&&w(n.id,C)]})},n.id)},e[8]=t.length,e[9]=f,e[10]=w,e[11]=l,e[12]=m):m=e[12],d=t.map(m),e[3]=t,e[4]=f,e[5]=w,e[6]=l,e[7]=d}else d=e[7];let j;e[13]!==d?(j=o.jsx(H,{className:"sticky top-0 z-10 border-b-0 bg-muted/30",children:o.jsx(S,{className:"h-9 hover:bg-transparent border-b border-border",children:d})}),e[13]=d,e[14]=j):j=e[14];let v;if(e[15]!==t||e[16]!==s||e[17]!==c||e[18]!==x){let m;e[20]!==t||e[21]!==c||e[22]!==x?(m=(n,N)=>{const C=x?.(n);return o.jsx(S,{"data-row-index":N,className:u("group/data-row transition-colors border-b-0 hover:bg-accent/50",c?"cursor-pointer":"",C),onClick:c?()=>c(n):void 0,children:t.map(b=>o.jsx(D,{className:u("px-5 py-4 h-16 align-middle text-sm text-foreground",b.cellClassName,b.wrap?"whitespace-normal wrap-break-word":""),children:o.jsx("div",{className:u(b.wrap?"w-full":"min-w-0 w-full",!b.wrap&&"truncate overflow-hidden whitespace-nowrap"),children:b.render?b.render(n):b.accessor?b.accessor(n):null})},b.id))},N)},e[20]=t,e[21]=c,e[22]=x,e[23]=m):m=e[23],v=s.map(m),e[15]=t,e[16]=s,e[17]=c,e[18]=x,e[19]=v}else v=e[19];let y;e[24]!==v?(y=o.jsx(L,{children:v}),e[24]=v,e[25]=y):y=e[25];let k;return e[26]!==j||e[27]!==y?(k=o.jsx("div",{className:"w-full bg-background min-w-0",children:o.jsxs(R,{className:"w-full border-collapse",children:[j,y]})}),e[26]=j,e[27]=y,e[28]=k):k=e[28],k}function W(a){const e=g.c(12),{columns:t,data:s,isLoading:l,sortKey:r,sortDirection:f,onSort:c,onRowClick:x,emptyState:h}=a;if(l===void 0?!1:l){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx("div",{className:"flex items-center justify-center h-full",children:o.jsx("div",{className:"text-muted-foreground",children:"Loading..."})}),e[0]=i):i=e[0],i}if(s.length===0){let i;e[1]!==h?(i=h||o.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"No items found"}),e[1]=h,e[2]=i):i=e[2];let d;return e[3]!==i?(d=o.jsx("div",{className:"flex items-center justify-center h-full",children:i}),e[3]=i,e[4]=d):d=e[4],d}let p;return e[5]!==t||e[6]!==s||e[7]!==x||e[8]!==c||e[9]!==f||e[10]!==r?(p=o.jsx("div",{className:"flex-1 overflow-auto",children:o.jsx(E,{columns:t,data:s,sortKey:r,sortDirection:f,onSort:c,onRowClick:x})}),e[5]=t,e[6]=s,e[7]=x,e[8]=c,e[9]=f,e[10]=r,e[11]=p):p=e[11],p}export{W as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as S,j as s}from"./index-
|
|
1
|
+
import{c as S,j as s}from"./index-BlsDXE23.js";import{C as _}from"./card-BWKGhflg.js";import{c as j}from"./button-BM8Ntdfr.js";import{I as A}from"./use-connection-BGthiOfQ.js";function H(h){const e=S.c(40),{connection:t,onClick:g,headerActions:v,footer:C,className:k,size:R,fallbackIcon:z}=h,b=R===void 0?"md":R,y=b==="sm"?"p-4":"p-6",I=b==="sm"?"text-sm":"text-base",w=b==="sm"?"text-xs":"text-sm",E=g&&"hover:bg-muted/50";let i;e[0]!==k||e[1]!==E?(i=j("cursor-pointer transition-colors group",E,k),e[0]=k,e[1]=E,e[2]=i):i=e[2];let l;e[3]!==y?(l=j("flex flex-col gap-4 relative",y),e[3]=y,e[4]=l):l=e[4];let o;e[5]!==t.icon||e[6]!==t.title||e[7]!==z?(o=s.jsx(A,{icon:t.icon,name:t.title,size:"md",className:"shrink-0 shadow-sm",fallbackIcon:z}),e[5]=t.icon,e[6]=t.title,e[7]=z,e[8]=o):o=e[8];let n;e[9]!==v?(n=v&&s.jsx("div",{className:j("transition-opacity","opacity-0 group-hover:opacity-100"),onClick:q,children:v}),e[9]=v,e[10]=n):n=e[10];let c;e[11]!==n?(c=s.jsx("div",{className:"relative",children:n}),e[11]=n,e[12]=c):c=e[12];let r;e[13]!==o||e[14]!==c?(r=s.jsxs("div",{className:"flex items-start justify-between",children:[o,c]}),e[13]=o,e[14]=c,e[15]=r):r=e[15];let a;e[16]!==I?(a=j("font-medium text-foreground truncate",I),e[16]=I,e[17]=a):a=e[17];let m;e[18]!==t.title||e[19]!==a?(m=s.jsx("h3",{className:a,children:t.title}),e[18]=t.title,e[19]=a,e[20]=m):m=e[20];let d;e[21]!==w?(d=j("text-muted-foreground line-clamp-2",w),e[21]=w,e[22]=d):d=e[22];const P=t.description||"No description";let f;e[23]!==d||e[24]!==P?(f=s.jsx("p",{className:d,children:P}),e[23]=d,e[24]=P,e[25]=f):f=e[25];let p;e[26]!==m||e[27]!==f?(p=s.jsxs("div",{className:"flex flex-col gap-0",children:[m,f]}),e[26]=m,e[27]=f,e[28]=p):p=e[28];let x;e[29]!==C?(x=C&&s.jsx("div",{onClick:$,children:C}),e[29]=C,e[30]=x):x=e[30];let u;e[31]!==p||e[32]!==x||e[33]!==l||e[34]!==r?(u=s.jsxs("div",{className:l,children:[r,p,x]}),e[31]=p,e[32]=x,e[33]=l,e[34]=r,e[35]=u):u=e[35];let N;return e[36]!==g||e[37]!==u||e[38]!==i?(N=s.jsx(_,{className:i,onClick:g,children:u}),e[36]=g,e[37]=u,e[38]=i,e[39]=N):N=e[39],N}function $(h){return h.stopPropagation()}function q(h){return h.stopPropagation()}export{H as C};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as q,c as B,j as s,K as xt,f as ye,g as Fe,a as gt,t as jt,d as bt,b as vt,as as yt}from"./index-BlsDXE23.js";import{E as H}from"./SearchMd-DBw3zp_M.js";import{E as st}from"./error-boundary-Dd7BgwTJ.js";import{I as Ce,c as ot,b as Ne,d as Ct,e as Nt,a as St}from"./use-connection-BGthiOfQ.js";import{b as wt}from"./use-binding-DiGbYyGi.js";import{E as Ze,u as _t,S as $t}from"./index-CD92JRY8.js";import{u as Tt,a as It}from"./use-connection-resources-B-9emPmy.js";import{B as Se}from"./button-BM8Ntdfr.js";import{i as nt}from"./Loading01-DyCC_wp5.js";import{R as Dt}from"./resource-tabs-yHmaZ9ZD.js";import{V as Be,a as At,b as Pt}from"./layout-RDUry3u6.js";import{g as Xe}from"./generate-id-Dyweu44Y.js";import{C as we}from"./collection-display-button-M0ZEYwbq.js";import{C as qe}from"./collection-search-D4vMytfv.js";import{C as We}from"./card-BWKGhflg.js";import{b as it,D as rt,a as lt,d as G}from"./dropdown-menu-4Ypgp2xI.js";import{a as at}from"./Copy01-B-rLWzst.js";import{i as ct}from"./DotsVertical-qrfHOj7f.js";import{s as dt,u as kt}from"./use-list-state-D2xhuXBP.js";import{s as mt}from"./Trash01-D8NpuzHg.js";import{C as Ge}from"./collection-table-wrapper-CDYLUpBi.js";import{n as et}from"./Inbox01-C3SohPjD.js";import{A as Ue}from"./avatar-NC000dj0.js";import{u as Et}from"./useQuery-CA4Qsiz4.js";import{P as He}from"./formatDistanceToNow-CNMZ-Ei_.js";import{B as Lt}from"./extract-connection-data-C4wZpmQd.js";import{A as Rt,g as Mt,c as zt,b as Ot,d as Vt,e as Kt,a as Ut,f as Ft}from"./alert-dialog-2c4JlYwD.js";import{s as Bt}from"./Plus-BoZvN_rT.js";import{R as qt,T as Wt}from"./tools-list-DWIsrkx2.js";import"./tooltip-CYopm1Sm.js";import"./auth-DLdX6AGd.js";import"./mcp-oauth-BxQJ_sZ7.js";import"./env-vars-editor-DuAsDAtd.js";import"./input-B45bC0Rc.js";import"./use-tool-call-DOhzogS9.js";import"./File06-DJfHNtkr.js";import"./Key01-BUYdliq4.js";import"./form-DNdbWanJ.js";import"./select-CG-oLpgX.js";import"./ChevronDown-DNVwrHI3.js";import"./Terminal-DURJ2Sop.js";import"./use-gateway-B_vZFCo_.js";import"./CpuChip02-wuCmGgd2.js";import"./registry-utils-ulDDT0d8.js";import"./index-CGy1qJ5Y.js";import"./index-MYfTA9Ba.js";import"./badge-ffsmxYLL.js";import"./ArrowLeft-DLGdR8R3.js";import"./view-mode-toggle-D-v785I-.js";import"./use-mobile-BSF9aYm8.js";import"./use-organization-settings-Xs2e_hDY.js";const Je=({size:t=24,color:e="currentColor",...o})=>q.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},q.createElement("path",{d:"M2.876 18.116c.046-.414.069-.62.131-.814a2 2 0 0 1 .234-.485c.111-.17.259-.317.553-.61L17 3a2.828 2.828 0 1 1 4 4L7.794 20.206c-.294.294-.442.442-.611.553a2 2 0 0 1-.485.233c-.193.063-.4.086-.814.132L2.5 21.5l.376-3.384Z"}));Je.displayName="Edit01";function Gt(t,e){const o=t.properties||{};for(const n in o){const l=o[n];if(l&&l.type==="string"&&(l.format==="url"||l.format==="uri")&&e&&typeof e=="object"&&n in e&&e[n])return e[n]}const i=["image","img","avatar","icon","logo","thumbnail","cover"];for(const n of i)if(e&&typeof e=="object"&&n in e&&typeof e[n]=="string")return e[n]}function Ht(t){const e=B.c(25),{item:o,schema:i,actions:n}=t;let l;e[0]!==o||e[1]!==i?(l=Gt(i,o),e[0]=o,e[1]=i,e[2]=l):l=e[2];const c=l,m=o&&typeof o=="object"&&"description"in o&&typeof o.description=="string"?o.description:void 0;let p;e[3]!==n?(p=n&&Object.keys(n).length>0,e[3]=n,e[4]=p):p=e[4];const r=p;let b;e[5]!==c||e[6]!==o.title?(b=s.jsx(Ce,{icon:c,name:o.title,size:"md",className:"shrink-0 shadow-sm"}),e[5]=c,e[6]=o.title,e[7]=b):b=e[7];let S;e[8]!==o.title?(S=s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:o.title}),e[8]=o.title,e[9]=S):S=e[9];const f=m||"No description";let x;e[10]!==f?(x=s.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:f}),e[10]=f,e[11]=x):x=e[11];let g;e[12]!==S||e[13]!==x?(g=s.jsxs("div",{className:"flex flex-col gap-0 flex-1",children:[S,x]}),e[12]=S,e[13]=x,e[14]=g):g=e[14];let j;e[15]!==b||e[16]!==g?(j=s.jsxs("div",{className:"flex flex-col gap-4 p-6 flex-1",children:[b,g]}),e[15]=b,e[16]=g,e[17]=j):j=e[17];let d;e[18]!==n||e[19]!==r||e[20]!==o?(d=r&&s.jsx("div",{className:"absolute top-6 right-6 opacity-0 group-hover:opacity-100 transition-opacity",onClick:Zt,onMouseDown:Yt,children:s.jsxs(it,{children:[s.jsx(rt,{asChild:!0,children:s.jsx(Se,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:Qt,children:s.jsx(ct,{size:20})})}),s.jsxs(lt,{align:"end",onClick:Jt,children:[n.open&&s.jsxs(G,{onClick:a=>{a.stopPropagation(),n.open?.(o)},children:[s.jsx(dt,{size:16}),"Open"]}),n.edit&&s.jsxs(G,{onClick:a=>{a.stopPropagation(),n.edit?.(o)},children:[s.jsx(Je,{size:16}),"Edit"]}),n.duplicate&&s.jsxs(G,{onClick:a=>{a.stopPropagation(),n.duplicate?.(o)},children:[s.jsx(at,{size:16}),"Duplicate"]}),n.delete&&s.jsxs(G,{variant:"destructive",onClick:a=>{a.stopPropagation(),n.delete?.(o)},children:[s.jsx(mt,{size:16}),"Delete"]})]})]})}),e[18]=n,e[19]=r,e[20]=o,e[21]=d):d=e[21];let w;return e[22]!==j||e[23]!==d?(w=s.jsxs(We,{className:"cursor-pointer transition-colors h-full flex flex-col group relative",children:[j,d]}),e[22]=j,e[23]=d,e[24]=w):w=e[24],w}function Jt(t){return t.stopPropagation()}function Qt(t){return t.stopPropagation()}function Yt(t){return t.stopPropagation()}function Zt(t){return t.stopPropagation()}function Xt(t){const e=B.c(9);let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=ot(),e[0]=o):o=e[0];const i=o;let n;e[1]!==t?(n=xt.user(t),e[1]=t,e[2]=n):n=e[2];let l;e[3]!==t?(l=async()=>(await i("USER_GET",{id:t})).user,e[3]=t,e[4]=l):l=e[4];const c=!!t;let m;return e[5]!==n||e[6]!==l||e[7]!==c?(m={queryKey:n,queryFn:l,staleTime:3e5,retry:1,enabled:c},e[5]=n,e[6]=l,e[7]=c,e[8]=m):m=e[8],Et(m)}function es(t){const e=B.c(33),{id:o,size:i,showEmail:n,className:l}=t,c=i===void 0?"xs":i,m=n===void 0?!1:n,{data:p,isLoading:r,isError:b}=Xt(o);if(r){const a=`flex items-center gap-2 ${l||""}`;let h;e[0]!==c?(h=s.jsx(Ue.Skeleton,{shape:"circle",size:c}),e[0]=c,e[1]=h):h=e[1];let N;e[2]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx("div",{className:"h-3 w-24 bg-muted animate-pulse rounded"}),e[2]=N):N=e[2];let u;e[3]!==m?(u=m&&s.jsx("div",{className:"h-2 w-32 bg-muted animate-pulse rounded"}),e[3]=m,e[4]=u):u=e[4];let _;e[5]!==u?(_=s.jsxs("div",{className:"flex flex-col gap-1",children:[N,u]}),e[5]=u,e[6]=_):_=e[6];let v;return e[7]!==a||e[8]!==h||e[9]!==_?(v=s.jsxs("div",{className:a,children:[h,_]}),e[7]=a,e[8]=h,e[9]=_,e[10]=v):v=e[10],v}if(b||!p){const a=`flex items-center gap-2 ${l||""}`;let h;e[11]!==c?(h=s.jsx(Ue,{shape:"circle",size:c,fallback:"?",muted:!0}),e[11]=c,e[12]=h):h=e[12];let N;e[13]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx("div",{className:"flex flex-col",children:s.jsx("div",{className:"text-sm text-muted-foreground",children:"Unknown User"})}),e[13]=N):N=e[13];let u;return e[14]!==a||e[15]!==h?(u=s.jsxs("div",{className:a,children:[h,N]}),e[14]=a,e[15]=h,e[16]=u):u=e[16],u}const S=`flex items-center gap-2 ${l||""}`,f=p.image??void 0;let x;e[17]!==c||e[18]!==f||e[19]!==p.name?(x=s.jsx(Ue,{shape:"circle",size:c,url:f,fallback:p.name}),e[17]=c,e[18]=f,e[19]=p.name,e[20]=x):x=e[20];let g;e[21]!==p.name?(g=s.jsx("div",{className:"text-sm font-medium",children:p.name}),e[21]=p.name,e[22]=g):g=e[22];let j;e[23]!==m||e[24]!==p.email?(j=m&&s.jsx("div",{className:"text-xs text-muted-foreground",children:p.email}),e[23]=m,e[24]=p.email,e[25]=j):j=e[25];let d;e[26]!==g||e[27]!==j?(d=s.jsxs("div",{className:"flex flex-col",children:[g,j]}),e[26]=g,e[27]=j,e[28]=d):d=e[28];let w;return e[29]!==S||e[30]!==x||e[31]!==d?(w=s.jsxs("div",{className:S,children:[x,d]}),e[29]=S,e[30]=x,e[31]=d,e[32]=w):w=e[32],w}const ts=["icon","avatar","logo"],tt=["created_at","created_by","id"];function ss(t){return Object.keys(t).find(e=>ts.includes(e.toLowerCase()))}function ut(t,e){return Object.keys(t.properties||{}).filter(o=>["id","created_at","updated_at","created_by","updated_by"].includes(o)?!1:e?e.includes(o):!0).map(o=>({id:o,label:o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," ")}))}function os(t){const e=B.c(32),{data:o,schema:i,viewMode:n,onViewModeChange:l,search:c,sortKey:m,sortDirection:p,onSort:r,actions:b,onItemClick:S,headerActions:f,emptyState:x,readOnly:g,columns:j,hideToolbar:d,sortableFields:w}=t,a=l===void 0?as:l,h=p===void 0?"asc":p,N=r===void 0?ls:r;let u;e[0]!==b?(u=b===void 0?{}:b,e[0]=b,e[1]=u):u=e[1];const _=u,v=S===void 0?rs:S,I=f===void 0?null:f,D=x===void 0?null:x,z=g===void 0?!1:g,T=j===void 0?void 0:j,y=d===void 0?!1:d,R=w===void 0?void 0:w;let L;e[2]!==T||e[3]!==i||e[4]!==R?(L=T?T.filter(is).filter(P=>!R||R.includes(P.id)).map(ns):ut(i,R),e[2]=T,e[3]=i,e[4]=R,e[5]=L):L=e[5];const O=L;let M;e[6]!==I||e[7]!==y||e[8]!==N||e[9]!==a||e[10]!==h||e[11]!==m||e[12]!==O||e[13]!==n?(M=!y&&s.jsx("div",{className:"shrink-0 w-full border-b border-border h-12",children:s.jsxs("div",{className:"flex items-center gap-3 h-12 px-4",children:[s.jsx("div",{className:"flex items-center gap-2 flex-1",children:I}),s.jsx("div",{className:"flex items-center gap-2 shrink-0",children:s.jsx(we,{viewMode:n,onViewModeChange:a,sortKey:m,sortDirection:h,onSort:N,sortOptions:O})})]})}),e[6]=I,e[7]=y,e[8]=N,e[9]=a,e[10]=h,e[11]=m,e[12]=O,e[13]=n,e[14]=M):M=e[14];let $;e[15]!==_||e[16]!==T||e[17]!==o||e[18]!==D||e[19]!==v||e[20]!==N||e[21]!==z||e[22]!==i||e[23]!==c||e[24]!==h||e[25]!==m||e[26]!==R||e[27]!==n?($=n==="cards"?s.jsx("div",{className:"flex-1 overflow-auto p-5",children:o.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:D||s.jsx(Ze,{icon:s.jsx(et,{size:36,className:"text-muted-foreground"}),title:"No items found",description:c?"Try adjusting your search":"No items to display"})}):s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:o.map(P=>s.jsx("div",{onClick:()=>v?.(P),className:"cursor-pointer h-full",children:s.jsx(Ht,{item:P,schema:i,readOnly:z,actions:_})},P.id))})}):s.jsx(Ge,{columns:ms(T,i,R,_),data:o,sortKey:m,sortDirection:h,onSort:N,onRowClick:v,emptyState:D||s.jsx(Ze,{icon:s.jsx(et,{size:36,className:"text-muted-foreground"}),title:"No items found",description:c?"Try adjusting your search":"No items to display"})}),e[15]=_,e[16]=T,e[17]=o,e[18]=D,e[19]=v,e[20]=N,e[21]=z,e[22]=i,e[23]=c,e[24]=h,e[25]=m,e[26]=R,e[27]=n,e[28]=$):$=e[28];let A;return e[29]!==M||e[30]!==$?(A=s.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[M,$]}),e[29]=M,e[30]=$,e[31]=A):A=e[31],A}function ns(t){return{id:t.id,label:typeof t.header=="string"?t.header:t.id}}function is(t){return t.sortable!==!1}function rs(){}function ls(){}function as(){}function cs(t){return{id:"actions",header:"",render:e=>s.jsxs(it,{children:[s.jsx(rt,{asChild:!0,children:s.jsx(Se,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:o=>o.stopPropagation(),children:s.jsx(ct,{size:20})})}),s.jsxs(lt,{align:"end",onClick:o=>o.stopPropagation(),children:[t.open&&s.jsxs(G,{onClick:o=>{o.stopPropagation(),t.open?.(e)},children:[s.jsx(dt,{size:16}),"Open"]}),t.edit&&s.jsxs(G,{onClick:o=>{o.stopPropagation(),t.edit?.(e)},children:[s.jsx(Je,{size:16}),"Edit"]}),t.duplicate&&s.jsxs(G,{onClick:o=>{o.stopPropagation(),t.duplicate?.(e)},children:[s.jsx(at,{size:16}),"Duplicate"]}),t.delete&&s.jsxs(G,{variant:"destructive",onClick:o=>{o.stopPropagation(),t.delete?.(e)},children:[s.jsx(mt,{size:16}),"Delete"]})]})]}),cellClassName:"w-[60px]",sortable:!1}}function ft(t){const e=t.type;return Array.isArray(e)?e.every(o=>ft({type:o})):e==="string"||e==="number"||e==="integer"||e==="boolean"||e==="null"}function ds(t,e){const o=t.properties||{},i=Object.keys(o).filter(r=>{const b=o[r];return b&&ft(b)}),n=ss(o),l=[],c=new Set;n&&i.includes(n)&&(l.push(n),c.add(n));const m=["title","description","updated_at","updated_by"];for(const r of m)i.includes(r)&&!c.has(r)&&(l.push(r),c.add(r));const p=i.filter(r=>!c.has(r)&&!tt.includes(r)).sort((r,b)=>r.localeCompare(b));for(const r of p)l.push(r),c.add(r);for(const r of tt)i.includes(r)&&!c.has(r)&&(l.push(r),c.add(r));return l.map(r=>{const b=o[r],S=e?e.includes(r):!["id"].includes(r);return r===n?{id:r,header:"",render:f=>{const x=f[r];return s.jsx(Ce,{icon:x,name:f.title,size:"sm",className:"shrink-0 shadow-sm"})},sortable:!1,cellClassName:"w-16 shrink-0",wrap:!0}:r==="description"?{id:r,header:"Description",render:f=>{const x=f[r];return x==null?"—":s.jsx("span",{className:"block truncate max-w-[50ch]",children:String(x)})},sortable:S,cellClassName:"max-w-[50ch]"}:r==="created_by"||r==="updated_by"?{id:r,header:r.charAt(0).toUpperCase()+r.slice(1).replace(/_/g," "),render:f=>{const x=f[r];return x?s.jsx(es,{id:String(x),size:"xs"}):"—"},sortable:S,cellClassName:"max-w-[250px]"}:b?.format==="date-time"||r.endsWith("_at")?{id:r,header:r.charAt(0).toUpperCase()+r.slice(1).replace(/_/g," "),render:f=>{const x=f[r];return x?s.jsx("span",{className:"block truncate max-w-full",children:new Date(x).toLocaleDateString()}):"—"},sortable:S,cellClassName:"max-w-[200px]"}:{id:r,header:r.charAt(0).toUpperCase()+r.slice(1).replace(/_/g," "),render:f=>{const x=f[r];return x==null?"—":s.jsx("span",{className:"block truncate max-w-full",children:String(x)})},sortable:S,cellClassName:"max-w-[200px]"}})}function ms(t,e,o,i){const n=t||ds(e,o);return n.some(m=>m.id==="actions")?n:Object.keys(i).length>0?[...n,cs(i)]:n}function us(t){const e=B.c(117),{connectionId:o,org:i,activeCollection:n}=t,l=n.name,c=n.schema??Lt,m=n.hasCreateTool,p=n.hasUpdateTool,r=n.hasDeleteTool,b=ye(),f=Fe().location.href,{data:x}=gt.useSession(),g=x?.user?.id||"unknown",j=Ne(o);let d;e[0]!==o?(d=ot(o),e[0]=o,e[1]=d):d=e[1];const w=d,a=Ct(o,l,w),h=`${o}-${l}`;let N;e[2]!==i||e[3]!==h?(N={namespace:i,resource:h,defaultSortKey:"updated_at"},e[2]=i,e[3]=h,e[4]=N):N=e[4];const{search:u,searchTerm:_,setSearch:v,viewMode:I,setViewMode:D,sortKey:z,sortDirection:T,handleSort:y}=kt(N);let R;e[5]!==_||e[6]!==T||e[7]!==z?(R={searchTerm:_,sortKey:z,sortDirection:T},e[5]=_,e[6]=T,e[7]=z,e[8]=R):R=e[8];const L=Nt(o,l,w,R),O=!m&&!p&&!r;let M;e[9]!==l||e[10]!==o||e[11]!==b||e[12]!==i?(M=F=>{b({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:i,connectionId:o,collectionName:l,itemId:F.id}})},e[9]=l,e[10]=o,e[11]=b,e[12]=i,e[13]=M):M=e[13];const $=M;let A;e[14]!==a.create||e[15]!==g?(A=async F=>{const ve=new Date().toISOString();await a.create.mutateAsync({...F,id:Xe("conn"),title:`${F.title} (Copy)`,created_at:ve,updated_at:ve,created_by:g,updated_by:g})},e[14]=a.create,e[15]=g,e[16]=A):A=e[16];const P=A,[C,K]=q.useState(null);let V;e[17]===Symbol.for("react.memo_cache_sentinel")?(V=F=>{K(F)},e[17]=V):V=e[17];const k=V;let E;e[18]!==$||e[19]!==p?(E=p&&{edit:$},e[18]=$,e[19]=p,e[20]=E):E=e[20];let U;e[21]!==P||e[22]!==m?(U=m&&{duplicate:P},e[21]=P,e[22]=m,e[23]=U):U=e[23];let W;e[24]!==r?(W=r&&{delete:k},e[24]=r,e[25]=W):W=e[25];let J;e[26]!==W||e[27]!==E||e[28]!==U?(J={...E,...U,...W},e[26]=W,e[27]=E,e[28]=U,e[29]=J):J=e[29];const Q=J;let fe;e[30]!==a.delete||e[31]!==C?(fe=async()=>{C&&(await a.delete.mutateAsync(C.id),K(null))},e[30]=a.delete,e[31]=C,e[32]=fe):fe=e[32];const _e=fe;let pe;e[33]!==a.create||e[34]!==l||e[35]!==o||e[36]!==m||e[37]!==b||e[38]!==i||e[39]!==g?(pe=async()=>{if(!m){jt.error("Create operation is not available for this collection");return}const F=new Date().toISOString(),ve={id:Xe("conn"),title:"New Item",description:"A brief description of the item",created_at:F,updated_at:F,created_by:g,updated_by:g};try{const Ke=await a.create.mutateAsync(ve);b({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:i,connectionId:o,collectionName:l,itemId:Ke.id}})}catch(Ke){console.error("Failed to create item:",Ke)}},e[33]=a.create,e[34]=l,e[35]=o,e[36]=m,e[37]=b,e[38]=i,e[39]=g,e[40]=pe):pe=e[40];const $e=pe;let he;e[41]!==c?(he=ut(c),e[41]=c,e[42]=he):he=e[42];const Te=he,Qe=(L?.length??0)>0,pt=m&&Qe,ht=m&&!Qe&&!u;let xe;e[43]!==a.create||e[44]!==$e||e[45]!==m?(xe=m?s.jsxs(Se,{onClick:$e,size:"sm",disabled:a.create.isPending,className:"h-7",children:[s.jsx(Bt,{className:"mr-2 h-4 w-4"}),a.create.isPending?"Creating...":"Create"]}):null,e[43]=a.create,e[44]=$e,e[45]=m,e[46]=xe):xe=e[46];const Ye=xe,Ie=z;let Y;e[47]!==y||e[48]!==D||e[49]!==T||e[50]!==Te||e[51]!==Ie||e[52]!==I?(Y=s.jsx(we,{viewMode:I,onViewModeChange:D,sortKey:Ie,sortDirection:T,onSort:y,sortOptions:Te}),e[47]=y,e[48]=D,e[49]=T,e[50]=Te,e[51]=Ie,e[52]=I,e[53]=Y):Y=e[53];const De=`${l}s`,Ae=j?.icon??"grid_view";let Z;e[54]!==De||e[55]!==Ae||e[56]!==f?(Z=s.jsx(He,{title:De,url:f,icon:Ae}),e[54]=De,e[55]=Ae,e[56]=f,e[57]=Z):Z=e[57];const Pe=pt&&Ye;let X;e[58]!==Y||e[59]!==Z||e[60]!==Pe?(X=s.jsxs(Be,{children:[Y,Z,Pe]}),e[58]=Y,e[59]=Z,e[60]=Pe,e[61]=X):X=e[61];const ke=`Search ${l}...`;let ee;e[62]!==v?(ee=F=>{F.key==="Escape"&&(v(""),F.target.blur())},e[62]=v,e[63]=ee):ee=e[63];let te;e[64]!==u||e[65]!==v||e[66]!==ke||e[67]!==ee?(te=s.jsx(qe,{value:u,onChange:v,placeholder:ke,onKeyDown:ee}),e[64]=u,e[65]=v,e[66]=ke,e[67]=ee,e[68]=te):te=e[68];let se;e[69]!==L?(se=L??[],e[69]=L,e[70]=se):se=e[70];const Ee=z;let oe;e[71]!==$?(oe=F=>$(F),e[71]=$,e[72]=oe):oe=e[72];const Le="No items found",Re=u?"Try adjusting your search terms":"This collection doesn't have any items yet.",Me=ht?Ye:void 0;let ne;e[73]!==Le||e[74]!==Re||e[75]!==Me?(ne=s.jsx(H,{image:null,title:Le,description:Re,actions:Me}),e[73]=Le,e[74]=Re,e[75]=Me,e[76]=ne):ne=e[76];let ie;e[77]!==y||e[78]!==O||e[79]!==Q||e[80]!==c||e[81]!==u||e[82]!==v||e[83]!==D||e[84]!==T||e[85]!==se||e[86]!==Ee||e[87]!==oe||e[88]!==ne||e[89]!==I?(ie=s.jsx("div",{className:"flex-1 overflow-auto",children:s.jsx(os,{hideToolbar:!0,data:se,schema:c,viewMode:I,onViewModeChange:D,search:u,onSearchChange:v,sortKey:Ee,sortDirection:T,onSort:y,actions:Q,onItemClick:oe,readOnly:O,emptyState:ne})}),e[77]=y,e[78]=O,e[79]=Q,e[80]=c,e[81]=u,e[82]=v,e[83]=D,e[84]=T,e[85]=se,e[86]=Ee,e[87]=oe,e[88]=ne,e[89]=I,e[90]=ie):ie=e[90];let re;e[91]!==te||e[92]!==ie?(re=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[te,ie]}),e[91]=te,e[92]=ie,e[93]=re):re=e[93];const ze=!!C;let ge;e[94]===Symbol.for("react.memo_cache_sentinel")?(ge=F=>{F||K(null)},e[94]=ge):ge=e[94];let je;e[95]===Symbol.for("react.memo_cache_sentinel")?(je=s.jsx(zt,{children:"Delete item?"}),e[95]=je):je=e[95];const Oe=C?.title;let le;e[96]!==Oe?(le=s.jsxs(Ot,{children:[je,s.jsxs(Vt,{children:['Are you sure you want to delete "',Oe,'"? This action cannot be undone.']})]}),e[96]=Oe,e[97]=le):le=e[97];let ae;e[98]!==a.delete.isPending?(ae=s.jsx(Rt,{disabled:a.delete.isPending,children:"Cancel"}),e[98]=a.delete.isPending,e[99]=ae):ae=e[99];const Ve=a.delete.isPending?"Deleting...":"Delete";let ce;e[100]!==a.delete.isPending||e[101]!==_e||e[102]!==Ve?(ce=s.jsx(Mt,{onClick:_e,disabled:a.delete.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Ve}),e[100]=a.delete.isPending,e[101]=_e,e[102]=Ve,e[103]=ce):ce=e[103];let de;e[104]!==ae||e[105]!==ce?(de=s.jsxs(Kt,{children:[ae,ce]}),e[104]=ae,e[105]=ce,e[106]=de):de=e[106];let me;e[107]!==le||e[108]!==de?(me=s.jsxs(Ut,{children:[le,de]}),e[107]=le,e[108]=de,e[109]=me):me=e[109];let ue;e[110]!==ze||e[111]!==me?(ue=s.jsx(Ft,{open:ze,onOpenChange:ge,children:me}),e[110]=ze,e[111]=me,e[112]=ue):ue=e[112];let be;return e[113]!==X||e[114]!==re||e[115]!==ue?(be=s.jsxs(s.Fragment,{children:[X,re,ue]}),e[113]=X,e[114]=re,e[115]=ue,e[116]=be):be=e[116],be}function fs(t){const e=B.c(42),{prompts:o,connectionId:i,org:n,connectionTitle:l,connectionIcon:c,onPromptClick:m,showToolbar:p,emptyMessage:r}=t,b=p===void 0?!0:p,S=r===void 0?"This connection doesn't have any prompts yet.":r,f=ye(),g=Fe().location.href,[j,d]=q.useState(""),[w,a]=q.useState("table"),[h,N]=q.useState("name"),[u,_]=q.useState("asc");let v;e[0]!==u||e[1]!==h?(v=k=>{h===k?(_(js),u==="desc"&&N(void 0)):(N(k),_("asc"))},e[0]=u,e[1]=h,e[2]=v):v=e[2];const I=v;let D;e[3]!==i||e[4]!==f||e[5]!==m||e[6]!==n?(D=k=>{m?m(k):i&&n&&f({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:n,connectionId:i,collectionName:"prompts",itemId:encodeURIComponent(k.name)}})},e[3]=i,e[4]=f,e[5]=m,e[6]=n,e[7]=D):D=e[7];const z=D;let T;if(e[8]!==o||e[9]!==j||e[10]!==u||e[11]!==h){const k=!o||o.length===0?[]:j.trim()?(()=>{const E=j.toLowerCase();return o.filter(U=>U.name.toLowerCase().includes(E)||U.description&&U.description.toLowerCase().includes(E))})():o;T=!h||!u?k:[...k].sort((E,U)=>{const W=E[h]||"",J=U[h]||"",Q=String(W).localeCompare(String(J));return u==="asc"?Q:-Q}),e[8]=o,e[9]=j,e[10]=u,e[11]=h,e[12]=T}else T=e[12];const y=T;let R;e[13]===Symbol.for("react.memo_cache_sentinel")?(R=[{id:"name",header:"Name",render:gs,sortable:!0},{id:"description",header:"Description",render:xs,cellClassName:"flex-1",sortable:!0}],e[13]=R):R=e[13];const L=R;let O;e[14]===Symbol.for("react.memo_cache_sentinel")?(O=L.filter(hs).map(ps),e[14]=O):O=e[14];const M=O;let $;e[15]!==c||e[16]!==l||e[17]!==I||e[18]!==b||e[19]!==u||e[20]!==h||e[21]!==g||e[22]!==w?($=b&&s.jsxs(Be,{children:[s.jsx(we,{viewMode:w,onViewModeChange:a,sortKey:h,sortDirection:u,onSort:I,sortOptions:M}),s.jsx(He,{title:l?`${l}: Prompts`:"Prompts",url:g,icon:c??"description"})]}),e[15]=c,e[16]=l,e[17]=I,e[18]=b,e[19]=u,e[20]=h,e[21]=g,e[22]=w,e[23]=$):$=e[23];let A;e[24]===Symbol.for("react.memo_cache_sentinel")?(A=k=>{k.key==="Escape"&&(d(""),k.target.blur())},e[24]=A):A=e[24];let P;e[25]!==j?(P=s.jsx(qe,{value:j,onChange:d,placeholder:"Search prompts...",onKeyDown:A}),e[25]=j,e[26]=P):P=e[26];let C;e[27]!==S||e[28]!==z||e[29]!==I||e[30]!==j||e[31]!==u||e[32]!==h||e[33]!==y||e[34]!==w?(C=w==="cards"?s.jsx("div",{className:"flex-1 overflow-auto p-5",children:y.length===0?s.jsx(H,{image:null,title:j?"No prompts found":"No prompts available",description:j?"Try adjusting your search terms":S}):s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:y.map(k=>s.jsx(We,{className:"cursor-pointer transition-colors",onClick:()=>z(k),children:s.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[s.jsx(Ce,{icon:null,name:k.name,size:"md",className:"shrink-0 shadow-sm"}),s.jsxs("div",{className:"flex flex-col gap-0",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:k.name}),s.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:k.description||"No description"})]})]})},k.name))})}):s.jsx(Ge,{columns:L,data:y,isLoading:!1,sortKey:h,sortDirection:u,onSort:I,onRowClick:k=>z(k),emptyState:s.jsx(H,{image:null,title:j?"No prompts found":"No prompts available",description:j?"Try adjusting your search terms":S})}),e[27]=S,e[28]=z,e[29]=I,e[30]=j,e[31]=u,e[32]=h,e[33]=y,e[34]=w,e[35]=C):C=e[35];let K;e[36]!==P||e[37]!==C?(K=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[P,C]}),e[36]=P,e[37]=C,e[38]=K):K=e[38];let V;return e[39]!==K||e[40]!==$?(V=s.jsxs(s.Fragment,{children:[$,K]}),e[39]=K,e[40]=$,e[41]=V):V=e[41],V}function ps(t){return{id:t.id,label:typeof t.header=="string"?t.header:t.id}}function hs(t){return t.sortable}function xs(t){return s.jsx("span",{className:"text-sm text-foreground",children:t.description||"—"})}function gs(t){return s.jsx("span",{className:"text-sm font-medium font-mono text-foreground",children:t.name})}function js(t){return t==="asc"?"desc":t==="desc"?null:"asc"}function bs(t){const e=B.c(6),{prompts:o,connectionId:i,org:n}=t,l=Ne(i),c=l?.title,m=l?.icon;let p;return e[0]!==i||e[1]!==n||e[2]!==o||e[3]!==c||e[4]!==m?(p=s.jsx(fs,{prompts:o,connectionId:i,org:n,connectionTitle:c,connectionIcon:m}),e[0]=i,e[1]=n,e[2]=o,e[3]=c,e[4]=m,e[5]=p):p=e[5],p}function vs(t){const e=B.c(2),{repository:o}=t;let i;return e[0]!==o?(i=s.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:s.jsx(qt,{repository:o})}),e[0]=o,e[1]=i):i=e[1],i}function ys(t){const e=B.c(39),{resources:o,connectionTitle:i,connectionIcon:n,onResourceClick:l,showToolbar:c,emptyMessage:m}=t,p=c===void 0?!0:c,r=m===void 0?"This connection doesn't have any resources yet.":m,S=Fe().location.href,[f,x]=q.useState(""),[g,j]=q.useState("table"),[d,w]=q.useState("name"),[a,h]=q.useState("asc");let N;e[0]!==a||e[1]!==d?(N=C=>{d===C?(h(Ts),a==="desc"&&w(void 0)):(w(C),h("asc"))},e[0]=a,e[1]=d,e[2]=N):N=e[2];const u=N;let _;e[3]!==l?(_=C=>{l&&l(C)},e[3]=l,e[4]=_):_=e[4];const v=_;let I;if(e[5]!==o||e[6]!==f||e[7]!==a||e[8]!==d){const C=!o||o.length===0?[]:f.trim()?(()=>{const K=f.toLowerCase();return o.filter(V=>V.uri.toLowerCase().includes(K)||V.name&&V.name.toLowerCase().includes(K)||V.description&&V.description.toLowerCase().includes(K))})():o;I=!d||!a?C:[...C].sort((K,V)=>{const k=K[d]||"",E=V[d]||"",U=String(k).localeCompare(String(E));return a==="asc"?U:-U}),e[5]=o,e[6]=f,e[7]=a,e[8]=d,e[9]=I}else I=e[9];const D=I;let z;e[10]===Symbol.for("react.memo_cache_sentinel")?(z=[{id:"name",header:"Name",render:$s,sortable:!0},{id:"uri",header:"URI",render:_s,sortable:!0},{id:"description",header:"Description",render:ws,cellClassName:"flex-1",sortable:!0},{id:"mimeType",header:"Type",render:Ss,sortable:!0}],e[10]=z):z=e[10];const T=z;let y;e[11]===Symbol.for("react.memo_cache_sentinel")?(y=T.filter(Ns).map(Cs),e[11]=y):y=e[11];const R=y;let L;e[12]!==n||e[13]!==i||e[14]!==u||e[15]!==p||e[16]!==a||e[17]!==d||e[18]!==S||e[19]!==g?(L=p&&s.jsxs(Be,{children:[s.jsx(we,{viewMode:g,onViewModeChange:j,sortKey:d,sortDirection:a,onSort:u,sortOptions:R}),s.jsx(He,{title:i?`${i}: Resources`:"Resources",url:S,icon:n??"folder"})]}),e[12]=n,e[13]=i,e[14]=u,e[15]=p,e[16]=a,e[17]=d,e[18]=S,e[19]=g,e[20]=L):L=e[20];let O;e[21]===Symbol.for("react.memo_cache_sentinel")?(O=C=>{C.key==="Escape"&&(x(""),C.target.blur())},e[21]=O):O=e[21];let M;e[22]!==f?(M=s.jsx(qe,{value:f,onChange:x,placeholder:"Search resources...",onKeyDown:O}),e[22]=f,e[23]=M):M=e[23];let $;e[24]!==r||e[25]!==v||e[26]!==u||e[27]!==f||e[28]!==a||e[29]!==d||e[30]!==D||e[31]!==g?($=g==="cards"?s.jsx("div",{className:"flex-1 overflow-auto p-5",children:D.length===0?s.jsx(H,{image:null,title:f?"No resources found":"No resources available",description:f?"Try adjusting your search terms":r}):s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:D.map(C=>s.jsx(We,{className:"cursor-pointer transition-colors",onClick:()=>v(C),children:s.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[s.jsx(Ce,{icon:null,name:C.name||C.uri,size:"md",className:"shrink-0 shadow-sm"}),s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:C.name||C.uri}),s.jsx("p",{className:"text-xs font-mono text-muted-foreground truncate",children:C.uri}),C.description&&s.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mt-1",children:C.description})]})]})},C.uri))})}):s.jsx(Ge,{columns:T,data:D,isLoading:!1,sortKey:d,sortDirection:a,onSort:u,onRowClick:C=>v(C),emptyState:s.jsx(H,{image:null,title:f?"No resources found":"No resources available",description:f?"Try adjusting your search terms":r})}),e[24]=r,e[25]=v,e[26]=u,e[27]=f,e[28]=a,e[29]=d,e[30]=D,e[31]=g,e[32]=$):$=e[32];let A;e[33]!==M||e[34]!==$?(A=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[M,$]}),e[33]=M,e[34]=$,e[35]=A):A=e[35];let P;return e[36]!==A||e[37]!==L?(P=s.jsxs(s.Fragment,{children:[L,A]}),e[36]=A,e[37]=L,e[38]=P):P=e[38],P}function Cs(t){return{id:t.id,label:typeof t.header=="string"?t.header:t.id}}function Ns(t){return t.sortable}function Ss(t){return s.jsx("span",{className:"text-sm text-muted-foreground",children:t.mimeType||"—"})}function ws(t){return s.jsx("span",{className:"text-sm text-foreground",children:t.description||"—"})}function _s(t){return s.jsx("span",{className:"text-sm font-mono text-muted-foreground",children:t.uri})}function $s(t){return s.jsx("span",{className:"text-sm font-medium text-foreground",children:t.name||t.uri})}function Ts(t){return t==="asc"?"desc":t==="desc"?null:"asc"}function Is(t){const e=B.c(6),{resources:o,connectionId:i,org:n}=t,l=Ne(i),c=l?.title,m=l?.icon;let p;return e[0]!==i||e[1]!==n||e[2]!==o||e[3]!==c||e[4]!==m?(p=s.jsx(ys,{resources:o,connectionId:i,org:n,connectionTitle:c,connectionIcon:m}),e[0]=i,e[1]=n,e[2]=o,e[3]=c,e[4]=m,e[5]=p):p=e[5],p}function Ds(t){const e=B.c(4),{tools:o,connectionId:i,org:n}=t;let l;return e[0]!==i||e[1]!==n||e[2]!==o?(l=s.jsx(Wt,{tools:o,connectionId:i,org:n}),e[0]=i,e[1]=n,e[2]=o,e[3]=l):l=e[3],l}function As(t){const e=B.c(61),{connection:o,connectionId:i,org:n,requestedTabId:l,collections:c,onUpdate:m,isUpdating:p,prompts:r,resources:b}=t,S=yt();let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f={from:"/$org/mcps/$connectionId"},e[0]=f):f=e[0];const x=ye(f);let g;e[1]!==i?(g={connectionId:i},e[1]=i,e[2]=g):g=e[2];const j=_t(g),d=j.isAuthenticated,w=o?.metadata?.repository,a=!!w?.url,h=o?.tools?.length??0,N=r.length,u=b.length;let _;e[3]===Symbol.for("react.memo_cache_sentinel")?(_={id:"settings",label:"Settings"},e[3]=_):_=e[3];let v;e[4]!==d||e[5]!==h?(v=d&&h>0?[{id:"tools",label:"Tools",count:h}]:[],e[4]=d,e[5]=h,e[6]=v):v=e[6];let I;e[7]!==d||e[8]!==N?(I=d&&N>0?[{id:"prompts",label:"Prompts",count:N}]:[],e[7]=d,e[8]=N,e[9]=I):I=e[9];let D;e[10]!==d||e[11]!==u?(D=d&&u>0?[{id:"resources",label:"Resources",count:u}]:[],e[10]=d,e[11]=u,e[12]=D):D=e[12];let z;if(e[13]!==c||e[14]!==a||e[15]!==d||e[16]!==v||e[17]!==I||e[18]!==D){let E;e[20]!==a?(E=a?[{id:"readme",label:"README"}]:[],e[20]=a,e[21]=E):E=e[21],z=[_,...v,...I,...D,...d?(c||[]).map(Ps):[],...E],e[13]=c,e[14]=a,e[15]=d,e[16]=v,e[17]=I,e[18]=D,e[19]=z}else z=e[19];const T=z,y=T.some(E=>E.id===l)?l:"settings";let R;e[22]!==x?(R=E=>{x({search:U=>({...U,tab:E}),replace:!0})},e[22]=x,e[23]=R):R=e[23];const L=R;let O;e[24]!==c?(O=c||[],e[24]=c,e[25]=O):O=e[25];let M;if(e[26]!==y||e[27]!==O){let E;e[29]!==y?(E=U=>U.name===y,e[29]=y,e[30]=E):E=e[30],M=O.find(E),e[26]=y,e[27]=O,e[28]=M}else M=e[28];const $=M;let A;e[31]!==S.history?(A=()=>S.history.back(),e[31]=S.history,e[32]=A):A=e[32];let P;e[33]!==y||e[34]!==L||e[35]!==T?(P=s.jsx(At,{children:s.jsx(Dt,{tabs:T,activeTab:y,onTabChange:L})}),e[33]=y,e[34]=L,e[35]=T,e[36]=P):P=e[36];let C;e[37]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx("div",{className:"flex h-full items-center justify-center",children:s.jsx(nt,{size:32,className:"animate-spin text-muted-foreground"})}),e[37]=C):C=e[37];let K;e[38]!==$||e[39]!==y||e[40]!==j.isServerError||e[41]!==j.supportsOAuth||e[42]!==o||e[43]!==i||e[44]!==L||e[45]!==a||e[46]!==d||e[47]!==p||e[48]!==m||e[49]!==n||e[50]!==r||e[51]!==w||e[52]!==b?(K=s.jsx(q.Suspense,{fallback:C,children:y==="tools"?s.jsx(Ds,{tools:o.tools??void 0,connectionId:i,org:n}):y==="prompts"?s.jsx(bs,{prompts:r,connectionId:i,org:n}):y==="resources"?s.jsx(Is,{resources:b,connectionId:i,org:n}):y==="settings"?s.jsx($t,{connection:o,onUpdate:m,isUpdating:p,isMCPAuthenticated:d,supportsOAuth:j.supportsOAuth,isServerError:j.isServerError,onViewReadme:a?()=>L("readme"):void 0}):y==="readme"&&a?s.jsx(vs,{repository:w}):$&&d?s.jsx(us,{connectionId:i,org:n,activeCollection:$},y):s.jsx(H,{title:"Collection not found",description:"This collection may have been deleted or you may not have access."})}),e[38]=$,e[39]=y,e[40]=j.isServerError,e[41]=j.supportsOAuth,e[42]=o,e[43]=i,e[44]=L,e[45]=a,e[46]=d,e[47]=p,e[48]=m,e[49]=n,e[50]=r,e[51]=w,e[52]=b,e[53]=K):K=e[53];let V;e[54]!==y||e[55]!==K?(V=s.jsx("div",{className:"flex h-full w-full bg-background overflow-hidden",children:s.jsx("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-auto",children:s.jsx(st,{children:K},y)})}),e[54]=y,e[55]=K,e[56]=V):V=e[56];let k;return e[57]!==A||e[58]!==P||e[59]!==V?(k=s.jsxs(Pt,{onBack:A,children:[P,V]}),e[57]=A,e[58]=P,e[59]=V,e[60]=k):k=e[60],k}function Ps(t){return{id:t.name,label:t.displayName}}function ks(){const t=B.c(29);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/mcps/$connectionId"},t[0]=e):e=t[0];const o=ye(e);let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i={from:"/shell/$org/mcps/$connectionId"},t[1]=i):i=t[1];const{connectionId:n,org:l}=bt(i);let c;t[2]===Symbol.for("react.memo_cache_sentinel")?(c={from:"/shell/$org/mcps/$connectionId"},t[2]=c):c=t[2];const p=vt(c).tab||"settings",r=Ne(n),b=St(),S=wt(r??void 0);let f;t[3]!==n?(f=[n],t[3]=n,t[4]=f):f=t[4];const{promptsMap:x}=Tt(f);let g;t[5]!==n?(g=[n],t[5]=n,t[6]=g):g=t[6];const{resourcesMap:j}=It(g);let d;t[7]!==n||t[8]!==x?(d=x.get(n)??[],t[7]=n,t[8]=x,t[9]=d):d=t[9];const w=d;let a;t[10]!==n||t[11]!==j?(a=j.get(n)??[],t[10]=n,t[11]=j,t[12]=a):a=t[12];const h=a;let N;t[13]!==b.update||t[14]!==n?(N=async v=>{await b.update.mutateAsync({id:n,data:v})},t[13]=b.update,t[14]=n,t[15]=N):N=t[15];const u=N;if(!r){let v;return t[16]!==o||t[17]!==l?(v=s.jsx("div",{className:"flex h-full w-full bg-background",children:s.jsx(H,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:s.jsx(Se,{variant:"outline",onClick:()=>o({to:"/$org/mcps",params:{org:l}}),children:"Back to connections"})})}),t[16]=o,t[17]=l,t[18]=v):v=t[18],v}let _;return t[19]!==b.update.isPending||t[20]!==S||t[21]!==r||t[22]!==n||t[23]!==u||t[24]!==l||t[25]!==w||t[26]!==p||t[27]!==h?(_=s.jsx(As,{org:l,connection:r,connectionId:n,requestedTabId:p,collections:S,onUpdate:u,isUpdating:b.update.isPending,prompts:w,resources:h}),t[19]=b.update.isPending,t[20]=S,t[21]=r,t[22]=n,t[23]=u,t[24]=l,t[25]=w,t[26]=p,t[27]=h,t[28]=_):_=t[28],_}function Es(){const t=B.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(st,{children:s.jsx(q.Suspense,{fallback:s.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:s.jsx(nt,{size:32,className:"animate-spin text-muted-foreground"})}),children:s.jsx(ks,{})})}),t[0]=e):e=t[0],e}function Eo(){const t=B.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Es,{}),t[0]=e):e=t[0],e}export{Eo as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as J,j as e,r as M,f as Q,b as Y,a as Z,u as ee,y as ne,x as te,v as X,W as se,w as x,_ as oe}from"./index-BlsDXE23.js";import{C as re}from"./collection-header-BZq2RMFO.js";import{C as ie}from"./collection-page-DV7fHb8_.js";import{C as ae}from"./collection-search-D4vMytfv.js";import{C as ce}from"./collection-table-wrapper-CDYLUpBi.js";import{C as le}from"./connection-card-DMoDmlju.js";import{E as P}from"./SearchMd-DBw3zp_M.js";import{E as de}from"./error-boundary-Dd7BgwTJ.js";import{a as me,u as pe,n as T,I as ue}from"./use-connection-BGthiOfQ.js";import{u as xe,s as F}from"./use-list-state-D2xhuXBP.js";import{u as he}from"./tooltip-CYopm1Sm.js";import{f as ge,a as je,b as fe,c as ve,d as _e,e as Ce,A as ye,g as Se}from"./alert-dialog-2c4JlYwD.js";import{B as we}from"./badge-ffsmxYLL.js";import{B as g}from"./button-BM8Ntdfr.js";import{d as Ne,c as ke,D as De,a as be,b as Pe,T as Te,f as Ie}from"./dialog-_0iI5rNw.js";import{b as z,D as V,a as R,d as k}from"./dropdown-menu-4Ypgp2xI.js";import{a as Me,F as l,b as d,c as m,d as p,f as u}from"./form-DNdbWanJ.js";import{i as B}from"./DotsVertical-qrfHOj7f.js";import{i as $e,r as Ae,s as I,E as Ee,e as W}from"./env-vars-editor-DuAsDAtd.js";import{i as Oe}from"./Loading01-DyCC_wp5.js";import{i as Fe}from"./Terminal-DURJ2Sop.js";import{s as H}from"./Trash01-D8NpuzHg.js";import{I as f}from"./input-B45bC0Rc.js";import{S as ze,a as Ve,b as Re,c as Be,d as w}from"./select-CG-oLpgX.js";import{g as He}from"./generate-id-Dyweu44Y.js";import"./collection-display-button-M0ZEYwbq.js";import"./view-mode-toggle-D-v785I-.js";import"./card-BWKGhflg.js";import"./use-mobile-BSF9aYm8.js";import"./X-BV7uqO3B.js";import"./Plus-BoZvN_rT.js";import"./ChevronDown-DNVwrHI3.js";const Xe=X({key:x(),value:x()}),We=X({title:x().min(1,"Name is required"),description:x().nullable().optional(),ui_type:oe(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:x().optional(),connection_token:x().nullable().optional(),npx_package:x().optional(),stdio_command:x().optional(),stdio_args:x().optional(),stdio_cwd:x().optional(),env_vars:se(Xe).optional()}).refine(t=>t.ui_type==="NPX"?!!t.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(t=>t.ui_type==="STDIO"?!!t.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(t=>t.ui_type==="HTTP"||t.ui_type==="SSE"||t.ui_type==="Websocket"?!!t.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function Le(t,o){const j={command:"npx",args:["-y",t]},v=W(o);return Object.keys(v).length>0&&(j.envVars=v),j}function Ue(t,o,j,v){const _={command:t};o.trim()&&(_.args=o.trim().split(/\s+/)),j?.trim()&&(_.cwd=j.trim());const i=W(v);return Object.keys(i).length>0&&(_.envVars=i),_}function Ke(t){return t.command==="npx"}function qe(t){return t.args?.find(o=>!o.startsWith("-"))??""}function Ge(t){return{command:t.command,args:t.args?.join(" ")??"",cwd:t.cwd??""}}function Je(t,o){switch(o.type){case"edit":return{mode:"editing",connection:o.connection};case"delete":return{mode:"deleting",connection:o.connection};case"close":return{mode:"idle"}}}function Qe(){const{org:t}=he(),o=Q(),j=Y({strict:!1}),{data:v}=Z.useSession(),{stdioEnabled:_}=ee(),i=xe({namespace:t.slug,resource:"connections"}),D=me(),b=pe(i),[h,C]=M.useReducer(Je,{mode:"idle"}),$=j.action==="create",L=()=>{o({to:"/$org/mcps",params:{org:t.slug},search:{action:"create"}})},A=()=>{o({to:"/$org/mcps",params:{org:t.slug},search:{}})},r=ne({resolver:te(We),defaultValues:{title:"",description:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),y=r.watch("ui_type"),a=h.mode==="editing"?h.connection:null;M.useEffect(()=>{if(a){const n=$e(a.connection_headers)?a.connection_headers:null;if(n&&a.connection_type==="STDIO"){const s=Ae(n.envVars);if(Ke(n)){const c=qe(n);r.reset({title:a.title,description:a.description,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:c,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:s})}else{const c=Ge(n);r.reset({title:a.title,description:a.description,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:c.command,stdio_args:c.args,stdio_cwd:c.cwd,env_vars:s})}}else r.reset({title:a.title,description:a.description,ui_type:a.connection_type,connection_url:a.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]})}else r.reset({title:"",description:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]})},[a,r]);const U=async()=>{if(h.mode!=="deleting")return;const n=h.connection.id;C({type:"close"});try{await D.delete.mutateAsync(n)}catch{}},K=async n=>{let s,c=null,N=null,S=null;if(n.ui_type==="NPX"?(s="STDIO",c="",S=Le(n.npx_package||"",n.env_vars||[])):n.ui_type==="STDIO"?(s="STDIO",c="",S=Ue(n.stdio_command||"",n.stdio_args||"",n.stdio_cwd,n.env_vars||[])):(s=n.ui_type,c=n.connection_url||"",N=n.connection_token||null),a){await D.update.mutateAsync({id:a.id,data:{title:n.title,description:n.description||null,connection_type:s,connection_url:c,...N&&{connection_token:N},...S&&{connection_headers:S}}}),C({type:"close"}),r.reset();return}const O=He("conn");await D.create.mutateAsync({id:O,title:n.title,description:n.description||null,connection_type:s,connection_url:c,connection_token:N,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:v?.user?.id||"system",organization_id:t.id,icon:null,app_name:null,app_id:null,connection_headers:S,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),A(),r.reset(),o({to:"/$org/mcps/$connectionId",params:{org:t.slug,connectionId:O}})},E=n=>{n||($?A():C({type:"close"}),r.reset())},q=[{id:"icon",header:"",render:n=>e.jsx(ue,{icon:n.icon,name:n.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:e.jsx(T,{})}),cellClassName:"w-16 shrink-0",wrap:!0},{id:"title",header:"Name",render:n=>e.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:n.title}),cellClassName:"w-48 min-w-0 shrink-0",sortable:!0},{id:"description",header:"Description",render:n=>e.jsx("span",{className:"text-sm text-foreground line-clamp-2",children:n.description||"—"}),cellClassName:"flex-1 min-w-0",wrap:!0,sortable:!0},{id:"connection_type",header:"Type",accessor:n=>e.jsx("span",{className:"text-sm font-medium",children:n.connection_type}),cellClassName:"w-24 shrink-0",sortable:!0},{id:"connection_url",header:"URL",render:n=>{const s=n.connection_url??"",c=s.length>40?`${s.slice(0,40)}...`:s;return e.jsx("span",{className:"text-sm text-muted-foreground",children:c})},cellClassName:"w-48 min-w-0 shrink-0"},{id:"status",header:"Status",render:n=>e.jsx(we,{variant:n.status==="active"?"success":"outline",children:n.status}),cellClassName:"w-24 shrink-0",sortable:!0},{id:"actions",header:"",render:n=>e.jsxs(z,{children:[e.jsx(V,{asChild:!0,children:e.jsx(g,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:s=>s.stopPropagation(),children:e.jsx(B,{size:20})})}),e.jsxs(R,{align:"end",onClick:s=>s.stopPropagation(),children:[e.jsxs(k,{onClick:s=>{s.stopPropagation(),o({to:"/$org/mcps/$connectionId",params:{org:t.slug,connectionId:n.id}})},children:[e.jsx(F,{size:16}),"Inspect"]}),e.jsxs(k,{variant:"destructive",onClick:s=>{s.stopPropagation(),C({type:"delete",connection:n})},children:[e.jsx(H,{size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],G=e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(g,{variant:"outline",onClick:()=>o({to:"/$org/store",params:{org:t.slug}}),size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Browse Store"}),e.jsx(g,{onClick:L,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Connect MCP Server"})]});return e.jsxs(ie,{children:[e.jsx(Ne,{open:$||h.mode==="editing",onOpenChange:E,children:e.jsxs(ke,{className:"sm:max-w-[525px]",children:[e.jsxs(De,{children:[e.jsx(be,{children:a?"Edit Connection":"Create New Connection"}),e.jsx(Pe,{children:a?"Update the connection details below.":"Add a new connection to your organization. Fill in the details below."})]}),e.jsx(Me,{...r,children:e.jsxs("form",{onSubmit:r.handleSubmit(K),children:[e.jsxs("div",{className:"grid gap-4 py-4",children:[e.jsx(l,{control:r.control,name:"title",render:({field:n})=>e.jsxs(d,{children:[e.jsx(m,{children:"Name *"}),e.jsx(p,{children:e.jsx(f,{placeholder:"My Connection",...n})}),e.jsx(u,{})]})}),e.jsx(l,{control:r.control,name:"description",render:({field:n})=>e.jsxs(d,{children:[e.jsx(m,{children:"Description"}),e.jsx(p,{children:e.jsx(Te,{placeholder:"A brief description of this connection",rows:3,...n,value:n.value??""})}),e.jsx(u,{})]})}),e.jsx(l,{control:r.control,name:"ui_type",render:({field:n})=>e.jsxs(d,{children:[e.jsx(m,{children:"Type *"}),e.jsxs(ze,{value:n.value,onValueChange:n.onChange,children:[e.jsx(p,{children:e.jsx(Ve,{children:e.jsx(Re,{})})}),e.jsxs(Be,{children:[e.jsx(w,{value:"HTTP",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(I,{className:"w-4 h-4"}),"HTTP"]})}),e.jsx(w,{value:"SSE",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(I,{className:"w-4 h-4"}),"SSE"]})}),e.jsx(w,{value:"Websocket",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(I,{className:"w-4 h-4"}),"Websocket"]})}),_&&e.jsxs(e.Fragment,{children:[e.jsx(w,{value:"NPX",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(T,{className:"w-4 h-4"}),"NPX Package"]})}),e.jsx(w,{value:"STDIO",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(Fe,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),e.jsx(u,{})]})}),y==="NPX"&&e.jsx(e.Fragment,{children:e.jsx(l,{control:r.control,name:"npx_package",render:({field:n})=>e.jsxs(d,{children:[e.jsx(m,{children:"NPM Package *"}),e.jsx(p,{children:e.jsx(f,{placeholder:"@perplexity-ai/mcp-server",...n,value:n.value??""})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"The npm package to run with npx"}),e.jsx(u,{})]})})}),y==="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[e.jsx(l,{control:r.control,name:"stdio_command",render:({field:n})=>e.jsxs(d,{children:[e.jsx(m,{children:"Command *"}),e.jsx(p,{children:e.jsx(f,{placeholder:"node, bun, python...",...n,value:n.value??""})}),e.jsx(u,{})]})}),e.jsx(l,{control:r.control,name:"stdio_args",render:({field:n})=>e.jsxs(d,{children:[e.jsx(m,{children:"Arguments"}),e.jsx(p,{children:e.jsx(f,{placeholder:"arg1 arg2 --flag value",...n,value:n.value??""})}),e.jsx(u,{})]})})]}),e.jsx(l,{control:r.control,name:"stdio_cwd",render:({field:n})=>e.jsxs(d,{children:[e.jsx(m,{children:"Working Directory"}),e.jsx(p,{children:e.jsx(f,{placeholder:"/path/to/project (optional)",...n,value:n.value??""})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),e.jsx(u,{})]})})]}),(y==="NPX"||y==="STDIO")&&e.jsx(l,{control:r.control,name:"env_vars",render:({field:n})=>e.jsxs(d,{children:[e.jsx(m,{children:"Environment Variables"}),e.jsx(p,{children:e.jsx(Ee,{value:n.value??[],onChange:n.onChange})}),e.jsx(u,{})]})}),y!=="NPX"&&y!=="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsx(l,{control:r.control,name:"connection_url",render:({field:n})=>e.jsxs(d,{children:[e.jsx(m,{children:"URL *"}),e.jsx(p,{children:e.jsx(f,{placeholder:"https://example.com/mcp",...n,value:n.value??""})}),e.jsx(u,{})]})}),e.jsx(l,{control:r.control,name:"connection_token",render:({field:n})=>e.jsxs(d,{children:[e.jsx(m,{children:"Token (optional)"}),e.jsx(p,{children:e.jsx(f,{type:"password",placeholder:"Bearer token or API key",...n,value:n.value??""})}),e.jsx(u,{})]})})]})]}),e.jsxs(Ie,{children:[e.jsx(g,{type:"button",variant:"outline",onClick:()=>E(!1),children:"Cancel"}),e.jsx(g,{type:"submit",disabled:r.formState.isSubmitting,className:"min-w-40",children:r.formState.isSubmitting?"Saving...":a?"Update Connection":"Create Connection"})]})]})})]})}),e.jsx(ge,{open:h.mode==="deleting",onOpenChange:n=>!n&&C({type:"close"}),children:e.jsxs(je,{children:[e.jsxs(fe,{children:[e.jsx(ve,{children:"Delete Connection?"}),e.jsxs(_e,{children:["This action cannot be undone. This will permanently delete"," ",e.jsx("span",{className:"font-medium text-foreground",children:h.mode==="deleting"&&h.connection.title}),"."]})]}),e.jsxs(Ce,{children:[e.jsx(ye,{children:"Cancel"}),e.jsx(Se,{onClick:U,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})}),e.jsx(re,{title:"MCP Servers",viewMode:i.viewMode,onViewModeChange:i.setViewMode,sortKey:i.sortKey,sortDirection:i.sortDirection,onSort:i.handleSort,sortOptions:[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"connection_type",label:"Type"},{id:"status",label:"Status"}],ctaButton:G}),e.jsx(ae,{value:i.search,onChange:i.setSearch,placeholder:"Search for an MCP Server...",onKeyDown:n=>{n.key==="Escape"&&(i.setSearch(""),n.target.blur())}}),i.viewMode==="cards"?e.jsx("div",{className:"flex-1 overflow-auto p-5",children:b.length===0?e.jsx(P,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:(i.search,"No MCP Servers found"),description:i.search?`No MCP Servers match "${i.search}"`:"Create a connection to get started.",actions:!i.search&&e.jsx(g,{variant:"outline",onClick:()=>o({to:"/$org/store",params:{org:t.slug}}),children:"Browse Store"})}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:b.map(n=>e.jsx(le,{connection:n,fallbackIcon:e.jsx(T,{}),onClick:()=>o({to:"/$org/mcps/$connectionId",params:{org:t.slug,connectionId:n.id}}),headerActions:e.jsxs(z,{children:[e.jsx(V,{asChild:!0,children:e.jsx(g,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:s=>s.stopPropagation(),children:e.jsx(B,{size:20})})}),e.jsxs(R,{align:"end",onClick:s=>s.stopPropagation(),children:[e.jsxs(k,{onClick:s=>{s.stopPropagation(),o({to:"/$org/mcps/$connectionId",params:{org:t.slug,connectionId:n.id}})},children:[e.jsx(F,{size:16}),"Inspect"]}),e.jsxs(k,{variant:"destructive",onClick:s=>{s.stopPropagation(),C({type:"delete",connection:n})},children:[e.jsx(H,{size:16}),"Delete"]})]})]})},n.id))})}):e.jsx(ce,{columns:q,data:b,isLoading:!1,sortKey:i.sortKey,sortDirection:i.sortDirection,onSort:i.handleSort,onRowClick:n=>o({to:"/$org/mcps/$connectionId",params:{org:t.slug,connectionId:n.id}}),emptyState:i.search?e.jsx(P,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:400,height:178,"aria-hidden":"true"}),title:"No MCP Servers found",description:`No MCP Servers match "${i.search}"`}):e.jsx(P,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:400,height:178,"aria-hidden":"true"}),title:"No MCP Servers found",description:"Create a connection to get started.",actions:e.jsx(g,{variant:"outline",onClick:()=>o({to:"/$org/store",params:{org:t.slug}}),children:"Browse Store"})})})]})}function In(){const t=J.c(1);let o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=e.jsx(de,{children:e.jsx(M.Suspense,{fallback:e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsx(Oe,{size:32,className:"animate-spin text-muted-foreground"})}),children:e.jsx(Qe,{})})}),t[0]=o):o=t[0],o}export{In as default};
|