@decocms/mesh 2.96.2 → 2.96.3
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-4DBdKyiN.js → AlertCircle-B74h0Me5.js} +1 -1
- package/dist/client/assets/{AlertOctagon-CJ4814e4.js → AlertOctagon-ChhphFDk.js} +1 -1
- package/dist/client/assets/{ArrowLeft-BbUXsmjT.js → ArrowLeft-ruL5WSCw.js} +1 -1
- package/dist/client/assets/{ArrowUp-Cf0ZCNqn.js → ArrowUp-BTMunjeO.js} +1 -1
- package/dist/client/assets/{Check-DVZrDl7E.js → Check-Dy1kSzwX.js} +1 -1
- package/dist/client/assets/{CheckCircle-CA3HsvdF.js → CheckCircle-BFGOeCKZ.js} +1 -1
- package/dist/client/assets/{CheckDone01-CDAeIQ63.js → CheckDone01-CIq1TziU.js} +1 -1
- package/dist/client/assets/{ChevronDown-BrnUqul2.js → ChevronDown-CEjoikg0.js} +1 -1
- package/dist/client/assets/{ChevronRight-lTpPQGwH.js → ChevronRight-CVpzq9SE.js} +1 -1
- package/dist/client/assets/{Clock-BpIUYvY9.js → Clock-BFqtZfyI.js} +1 -1
- package/dist/client/assets/{Code01-CgOGThgh.js → Code01-ztcPrUdW.js} +1 -1
- package/dist/client/assets/{Container-CMQiv6Ns.js → Container-D5gdKEFc.js} +1 -1
- package/dist/client/assets/{Copy01-CMA5_oKx.js → Copy01-eBFwMxtu.js} +1 -1
- package/dist/client/assets/{Dataflow03-CJHUSZDC.js → Dataflow03-By6KEPGS.js} +1 -1
- package/dist/client/assets/{DotsHorizontal-bihG3j6i.js → DotsHorizontal-BHB6MwwO.js} +1 -1
- package/dist/client/assets/{DotsVertical-XqPeTgM4.js → DotsVertical-DDpixXKv.js} +1 -1
- package/dist/client/assets/{Download01-COYP-wbM.js → Download01-B-vJTp2a.js} +1 -1
- package/dist/client/assets/{Edit01-CN-BVNm7.js → Edit01-DS8TXF8v.js} +1 -1
- package/dist/client/assets/{Eye-DBhpblAN.js → Eye-DFOdFQT-.js} +1 -1
- package/dist/client/assets/{File02-C2olsFnm.js → File02-CY_WqD-0.js} +1 -1
- package/dist/client/assets/{File06-CyuQ1kk7.js → File06-uox_o6En.js} +1 -1
- package/dist/client/assets/{FilterLines-DNMtf_47.js → FilterLines-DcDy1u8y.js} +1 -1
- package/dist/client/assets/{Globe01-S1shXduq.js → Globe01-W_ezcOw6.js} +1 -1
- package/dist/client/assets/{Grid01-BB6GzE_H.js → Grid01-pmpn_yyH.js} +1 -1
- package/dist/client/assets/{Home02-9-Cl82ip.js → Home02-BK4iA9ga.js} +1 -1
- package/dist/client/assets/{Image01-Bllq3U2e.js → Image01-CjBWTpk6.js} +1 -1
- package/dist/client/assets/{Inbox01-_QG6HIJd.js → Inbox01-1y9TGDAK.js} +1 -1
- package/dist/client/assets/{InfoCircle-BzKPKNIV.js → InfoCircle-B2WmuOEX.js} +1 -1
- package/dist/client/assets/{Key01-kq7PX1YS.js → Key01-DXWjoaTE.js} +1 -1
- package/dist/client/assets/{LinkExternal01-B7R1mSP2.js → LinkExternal01-CiZoO6oB.js} +1 -1
- package/dist/client/assets/{List-ByKRHbSO.js → List-Yy4oZaIm.js} +1 -1
- package/dist/client/assets/{Loading01-C30bDA9h.js → Loading01-BclS8iWV.js} +1 -1
- package/dist/client/assets/{Lock01-CMTkVFHx.js → Lock01-D8RoH81a.js} +1 -1
- package/dist/client/assets/{Pin01-DpTPW-9K.js → Pin01-DaSjWctK.js} +1 -1
- package/dist/client/assets/{Play-BweooOYS.js → Play-P0DrvK6F.js} +1 -1
- package/dist/client/assets/{Plus-q5YWe4us.js → Plus-C5LR6cck.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-DRWlmqw5.js → RefreshCcw01-DxpF0pWy.js} +1 -1
- package/dist/client/assets/{RefreshCw01-Bb8t9XLS.js → RefreshCw01-Cvn_Sesf.js} +1 -1
- package/dist/client/assets/{Save01-DXWV5nj4.js → Save01-CAo15i_T.js} +1 -1
- package/dist/client/assets/{SearchMd-hERLZOdx.js → SearchMd-DhDCnDEk.js} +1 -1
- package/dist/client/assets/{Settings01-K_PXf5Q7.js → Settings01-Di__7g37.js} +1 -1
- package/dist/client/assets/{Settings02-ZV7r5q4D.js → Settings02-Cs4oKE9x.js} +1 -1
- package/dist/client/assets/{Share07-Dx2Rb32N.js → Share07-CNOl6few.js} +1 -1
- package/dist/client/assets/{Terminal-VY7qOx_i.js → Terminal-DhXZE8tI.js} +1 -1
- package/dist/client/assets/{Tool01-BP_mkdy3.js → Tool01-D6uiZqcI.js} +1 -1
- package/dist/client/assets/{Trash01-Dk9pv506.js → Trash01-fpfGO2En.js} +1 -1
- package/dist/client/assets/{Upload01-BokmTptz.js → Upload01-BK6OrHOB.js} +1 -1
- package/dist/client/assets/{Users03-C_ymlzx3.js → Users03-9Yj1Oct5.js} +1 -1
- package/dist/client/assets/{X-BofIsacr.js → X-D-vCW-FP.js} +1 -1
- package/dist/client/assets/{XClose-B9jvydA5.js → XClose-CwzH0SGu.js} +1 -1
- package/dist/client/assets/{agent-connections-preview-CcWJACAV.js → agent-connections-preview-Bm7_QMu6.js} +1 -1
- package/dist/client/assets/{agent-detail-BTNxaZph.js → agent-detail-C4sYOZn2.js} +1 -1
- package/dist/client/assets/{agents-isWhMnyk.js → agents-UG-TRZOf.js} +1 -1
- package/dist/client/assets/alert-dialog-C2eeNa17.js +7 -0
- package/dist/client/assets/{auth-catchall-BmUeke0B.js → auth-catchall-DsmRXLAK.js} +1 -1
- package/dist/client/assets/{avatar-DbtnoOEU.js → avatar-DVIfFxjv.js} +1 -1
- package/dist/client/assets/{badge-D_aixLlt.js → badge-Ce8oucop.js} +1 -1
- package/dist/client/assets/{binder-BeHB3-7Y.js → binder-B_Z7E1sw.js} +1 -1
- package/dist/client/assets/{breadcrumb-ClGbT9Pe.js → breadcrumb-DTOs2A-I.js} +1 -1
- package/dist/client/assets/{button-D-PerQqC.js → button-Cxd9D7GZ.js} +1 -1
- package/dist/client/assets/{card-ZafkYtyj.js → card-U5Qqs_wY.js} +1 -1
- package/dist/client/assets/{checkbox-DGTMQZYw.js → checkbox-QmtfqLqJ.js} +1 -1
- package/dist/client/assets/{circle-alert-B5MH-I2D.js → circle-alert-p06JWO6x.js} +1 -1
- package/dist/client/assets/{collection-detail-D7K7KZ3j.js → collection-detail-WxZ2NZBP.js} +1 -1
- package/dist/client/assets/{collection-search-CFO7XWxi.js → collection-search-BEKSlJnh.js} +1 -1
- package/dist/client/assets/{collection-tab-ZK9qGzbi.js → collection-tab-CXhYQfuQ.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-aEUpSjNT.js → collection-table-wrapper-Bq9YQNWy.js} +1 -1
- package/dist/client/assets/{collection-tabs-zYgpPtAl.js → collection-tabs-D6wgvS1J.js} +1 -1
- package/dist/client/assets/{command-riBVGEeS.js → command-17BNeKxr.js} +1 -1
- package/dist/client/assets/{connect-CxlD4pzc.js → connect-D6XC7UNZ.js} +1 -1
- package/dist/client/assets/{connection-card-DibEpgAJ.js → connection-card-CHDbSQUC.js} +1 -1
- package/dist/client/assets/{connection-detail-VawJXFkM.js → connection-detail-91YS9aaX.js} +1 -1
- package/dist/client/assets/{connections-rTehwMXP.js → connections-CH561e8o.js} +1 -1
- package/dist/client/assets/{constants-CH9byiKA.js → constants-7tHIXjuz.js} +1 -1
- package/dist/client/assets/constants-B1QaD4GY.js +1 -0
- package/dist/client/assets/{create-organization-dialog-DBHZfDPt.js → create-organization-dialog-BIJfN6rY.js} +1 -1
- package/dist/client/assets/{create-project-dialog-Yqgc0Gmy.js → create-project-dialog-W-9Wb58U.js} +1 -1
- package/dist/client/assets/{dialog-CFptoDdD.js → dialog-D36Sp9vM.js} +1 -1
- package/dist/client/assets/{dropdown-menu-C8QhWQVm.js → dropdown-menu-D1SDd-O9.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-DYwd3Z58.js → dynamic-plugin-layout-iqk4NK_8.js} +1 -1
- package/dist/client/assets/{empty-state-DyXzPX9E.js → empty-state-DmFtndPA.js} +1 -1
- package/dist/client/assets/{empty-state-DoBcZdM-.js → empty-state-x18Ct7Bg.js} +1 -1
- package/dist/client/assets/{env-vars-editor-DyPP_8RR.js → env-vars-editor-CxTFyVmJ.js} +1 -1
- package/dist/client/assets/{error-boundary-8guJh7VT.js → error-boundary-BuSNQDm9.js} +1 -1
- package/dist/client/assets/{extract-connection-data-DkrrvIEC.js → extract-connection-data-Bxl9-N57.js} +1 -1
- package/dist/client/assets/{file-browser-Fvr2IbiZ.js → file-browser-Ca7lIx_M.js} +2 -2
- package/dist/client/assets/{form-CtFhf1V_.js → form-C7gcuapm.js} +1 -1
- package/dist/client/assets/{grid-view-Ce3NoRpj.js → grid-view-CioJM2m4.js} +1 -1
- package/dist/client/assets/{home-BjMglPl-.js → home-CO_-lcJ6.js} +1 -1
- package/dist/client/assets/{index-D1S818JH.js → index-APqurMYH.js} +1 -1
- package/dist/client/assets/{index-B29giag9.js → index-B0lAKtRh.js} +2 -2
- package/dist/client/assets/{index-V777tuW4.js → index-C1cLa9Gd.js} +1 -1
- package/dist/client/assets/{index-CwR6GYR2.js → index-C4SaT72q.js} +1 -1
- package/dist/client/assets/{index-CrTEMTct.js → index-CuPKLB9d.js} +1 -1
- package/dist/client/assets/{index-BCTs9n6O.js → index-CypvbRZN.js} +1 -1
- package/dist/client/assets/{index-Bourcgd_.js → index-DCBC9Z8D.js} +1 -1
- package/dist/client/assets/{index-BlBYI35m.js → index-Da6ccH2V.js} +1 -1
- package/dist/client/assets/{index-D8tHe059.js → index-uvODQDQz.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-Dzcc9UjY.js → infiniteQueryObserver-B5jHce9f.js} +1 -1
- package/dist/client/assets/{input-Cxci79To.js → input-BTRdl8wU.js} +1 -1
- package/dist/client/assets/{integration-icon-ByKWru2D.js → integration-icon-Qol0n8Yu.js} +1 -1
- package/dist/client/assets/{label-BN7IWnf6.js → label-B-xKop8p.js} +1 -1
- package/dist/client/assets/{layout-DUHhpHXf.js → layout-DQVjOYgA.js} +1 -1
- package/dist/client/assets/{localstorage-keys-CwGoMvvj.js → localstorage-keys-DE1N3_0b.js} +1 -1
- package/dist/client/assets/{login-Ty0R4DxW.js → login-CEoLgQ5J.js} +1 -1
- package/dist/client/assets/{mcp-oauth-ChVLA9f3.js → mcp-oauth-fVu6jtVi.js} +1 -1
- package/dist/client/assets/{mcp-server-card-DBYZ33HR.js → mcp-server-card-DUsbBMD4.js} +1 -1
- package/dist/client/assets/{mcp-server-detail-Du-GkpxI.js → mcp-server-detail-Dc_FNQcM.js} +2 -2
- package/dist/client/assets/{members-DsiwYbO8.js → members-6JeadSC6.js} +1 -1
- package/dist/client/assets/{monitoring-BlxCJU8J.js → monitoring-B6aMBTbK.js} +2 -2
- package/dist/client/assets/{monitoring-dashboard-edit-DSM3xa4Q.js → monitoring-dashboard-edit-D0LJi6WO.js} +1 -1
- package/dist/client/assets/{monitoring-dashboard-view-CJ1f1bB7.js → monitoring-dashboard-view-B9KgxuRn.js} +2 -2
- package/dist/client/assets/{oauth-callback-DmySymdW.js → oauth-callback-Bao0-Lp_.js} +1 -1
- package/dist/client/assets/{page-D0Sa9mFI.js → page-D3AoRnua.js} +1 -1
- package/dist/client/assets/{page-Tih4SWMI.js → page-tBi1gMVm.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-D05hsZ5h.js → plugin-empty-state-DgG7XCmo.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-hheYGSVX.js → plugin-empty-state-KJVP3Tbc.js} +1 -1
- package/dist/client/assets/{plugin-header-CE-bMrP6.js → plugin-header-CRttRDjI.js} +1 -1
- package/dist/client/assets/{plugin-header-CmN2-mKw.js → plugin-header-gmQgvWvo.js} +1 -1
- package/dist/client/assets/{popover-Bq8aZ27v.js → popover-CdY9eVBh.js} +1 -1
- package/dist/client/assets/{project-layout-ByRKYVau.js → project-layout-CIS1pzpd.js} +1 -1
- package/dist/client/assets/{project-settings-ByYa3pFP.js → project-settings-Dpll6cAV.js} +1 -1
- package/dist/client/assets/{projects-list-CDpKF2Ed.js → projects-list-D8CKizs8.js} +1 -1
- package/dist/client/assets/{registry-layout-CfGazoo8.js → registry-layout-DV5n9jEh.js} +3 -3
- package/dist/client/assets/{registry-utils-6Y4tQn0C.js → registry-utils-icgkdXTH.js} +1 -1
- package/dist/client/assets/{resizable-DfSFqzWY.js → resizable-CQB3xYuP.js} +1 -1
- package/dist/client/assets/{save-actions-htT4YoqX.js → save-actions-BCWYpxCn.js} +1 -1
- package/dist/client/assets/{scroll-area-BJ5bePQ1.js → scroll-area-B6cIs4dW.js} +1 -1
- package/dist/client/assets/{select-D6oaQfJS.js → select-vvkW2wBk.js} +1 -1
- package/dist/client/assets/{shell-layout-GR3VdFoR.js → shell-layout-Do1GEQEt.js} +3 -3
- package/dist/client/assets/{spinner-BstVffOp.js → spinner-BsQXvc2Y.js} +1 -1
- package/dist/client/assets/{store-invite-C4VxiywO.js → store-invite-CfCVsnuu.js} +1 -1
- package/dist/client/assets/{switch-Bi5F4S-5.js → switch-BezvOOLk.js} +1 -1
- package/dist/client/assets/{table-C576YCZw.js → table-Bhjp6CI9.js} +1 -1
- package/dist/client/assets/{tasks-BDnJjeaX.js → tasks-DGTypMJH.js} +1 -1
- package/dist/client/assets/{textarea-DhETf1og.js → textarea-D0RfPnUt.js} +1 -1
- package/dist/client/assets/{time-range-picker-CG48KHqL.js → time-range-picker-BTAPhqft.js} +1 -1
- package/dist/client/assets/{toggle-group-BdU9v1nm.js → toggle-group-CTeIuV4q.js} +1 -1
- package/dist/client/assets/{tools-list-DhfY_SNs.js → tools-list-K8xKTQ3C.js} +1 -1
- package/dist/client/assets/{tooltip-D-FT-fCa.js → tooltip-DkOvFQ7D.js} +1 -1
- package/dist/client/assets/{topbar-portal-IUe4pf8g.js → topbar-portal-B2pXZeiz.js} +1 -1
- package/dist/client/assets/{typewriter-title-cc0Pz_LM.js → typewriter-title-fOoA67kV.js} +1 -1
- package/dist/client/assets/{use-binding-B7W2mOcc.js → use-binding-Dvp-m6Vz.js} +1 -1
- package/dist/client/assets/{use-connection-DrWeJHXu.js → use-connection-t2lORAui.js} +1 -1
- package/dist/client/assets/{use-copy-BNoj9l5V.js → use-copy-tAcjwV9Y.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-DhPfPD_b.js → use-create-virtual-mcp-BUseoHRu.js} +1 -1
- package/dist/client/assets/{use-deco-chat-open-B0b2QgDS.js → use-deco-chat-open-BVQclAcG.js} +5 -5
- package/dist/client/assets/{use-install-from-registry-BMfOY5TA.js → use-install-from-registry-BcVvP9yq.js} +1 -1
- package/dist/client/assets/{use-list-state-qDaPNHfK.js → use-list-state-Lbcc4L0H.js} +1 -1
- package/dist/client/assets/{use-llm-DjYTM2HW.js → use-llm-CJX1SR85.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-BMZQCyj7.js → use-mcp-prompts-BjSsl1qM.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-CdAhr98j.js → use-mcp-tools-BPlzUo29.js} +1 -1
- package/dist/client/assets/{use-mobile-DcwTOp-X.js → use-mobile-BKPcRCzM.js} +1 -1
- package/dist/client/assets/{use-organization-settings-6xOluKFM.js → use-organization-settings-CUcA5y45.js} +1 -1
- package/dist/client/assets/{use-project-DY_ihdkL.js → use-project-BTuyMFkB.js} +1 -1
- package/dist/client/assets/{use-view-mode-CY4TLkHz.js → use-view-mode-CDTkXCJs.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-IiP1g_wm.js → use-virtual-mcp-BPuNbW-j.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-Cb7WWrkC.js +1 -0
- package/dist/client/assets/{useMutation-WNJB1RXH.js → useMutation-DTtaBOsy.js} +1 -1
- package/dist/client/assets/useQuery-Cx1KUbzW.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-CeqWcmOh.js +1 -0
- package/dist/client/assets/{view-mode-toggle-CRrDEnZy.js → view-mode-toggle-CPbxqbKZ.js} +1 -1
- package/dist/client/assets/{workflow-CD5ePGpY.js → workflow-BOVimVc9.js} +1 -1
- package/dist/client/index.html +1 -1
- package/package.json +1 -1
- package/dist/client/assets/alert-dialog-Cl76sYVz.js +0 -7
- package/dist/client/assets/constants-kLsxGUtY.js +0 -1
- package/dist/client/assets/useInfiniteQuery-eF9xXIkq.js +0 -1
- package/dist/client/assets/useQuery-BO0TdkAU.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DfH90Jor.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as H,u as W,z as X,O as Y,h as oe,k as ae,j as s,o as ce,s as G,K as U,t as R,r as q,aN as te,bv as ue,m as de,g as ge}from"./index-B29giag9.js";import{P as Z}from"./index-CwR6GYR2.js";import{B as fe,a as he,b as pe,c as xe}from"./breadcrumb-ClGbT9Pe.js";import{u as ee}from"./useMutation-WNJB1RXH.js";import{a as ie,u as re}from"./constants-CH9byiKA.js";import{B as L,c as je}from"./button-D-PerQqC.js";import{I as V}from"./input-Cxci79To.js";import{T as be}from"./textarea-DhETf1og.js";import{F as Q,d as M,a as me,b as $,c as K,e as se,f as J}from"./form-CtFhf1V_.js";import{u as ye}from"./useQuery-BO0TdkAU.js";import{S as ve}from"./switch-Bi5F4S-5.js";import{L as Ne}from"./label-BN7IWnf6.js";import{h as Ce}from"./use-connection-DrWeJHXu.js";import{a as Se,c as Pe}from"./use-binding-B7W2mOcc.js";import{u as we}from"./use-install-from-registry-BMfOY5TA.js";import{i as Ie}from"./Loading01-C30bDA9h.js";import{s as Ee}from"./Plus-q5YWe4us.js";import{S as Fe,a as De,b as _e,c as Oe,d as le}from"./select-D6oaQfJS.js";import{i as Te}from"./Upload01-BokmTptz.js";import{i as Ae}from"./X-BofIsacr.js";import{c as ze,h as Be,d as ke,b as Re,A as Le,e as Ue,g as qe,a as Me,f as $e}from"./alert-dialog-Cl76sYVz.js";import"./ChevronRight-lTpPQGwH.js";import"./binder-BeHB3-7Y.js";import"./extract-connection-data-DkrrvIEC.js";import"./constants-kLsxGUtY.js";import"./github-icon-Dp3wHhYE.js";import"./registry-utils-6Y4tQn0C.js";import"./generate-id-Dyweu44Y.js";import"./index-V777tuW4.js";import"./Check-DVZrDl7E.js";import"./ChevronDown-BrnUqul2.js";const Ke=ce({name:G().min(1,"Name is required").max(200,"Name is too long"),description:G().max(1e3,"Description is too long").nullable()});function Ge(){const e=H.c(58),{org:t,project:i}=W(),o=X(),d=i.slug===Y;let g;e[0]!==t.id?(g={connectionId:ie,orgId:t.id},e[0]=t.id,e[1]=g):g=e[1];const u=re(g);let x;e[2]===Symbol.for("react.memo_cache_sentinel")?(x=oe(Ke),e[2]=x):x=e[2];const j=i.name??"",b=i.description??"";let a;e[3]!==j||e[4]!==b?(a={resolver:x,values:{name:j,description:b}},e[3]=j,e[4]=b,e[5]=a):a=e[5];const c=ae(a);let f;e[6]!==u||e[7]!==i.id?(f=async B=>{const _=await u.callTool({name:"PROJECT_UPDATE",arguments:{projectId:i.id,name:B.name,description:B.description||null}});return _.structuredContent??_},e[6]=u,e[7]=i.id,e[8]=f):f=e[8];let h;e[9]!==c||e[10]!==t.id||e[11]!==i.slug||e[12]!==o?(h=()=>{o.invalidateQueries({queryKey:U.project(t.id,i.slug)}),o.invalidateQueries({queryKey:U.projects(t.id)}),R.success("Project updated successfully"),c.reset(c.getValues())},e[9]=c,e[10]=t.id,e[11]=i.slug,e[12]=o,e[13]=h):h=e[13];let w;e[14]!==f||e[15]!==h?(w={mutationFn:f,onSuccess:h,onError:Qe},e[14]=f,e[15]=h,e[16]=w):w=e[16];const m=ee(w);let y;e[17]!==m?(y=async B=>{await m.mutateAsync(B)},e[17]=m,e[18]=y):y=e[18];const P=y,C=c.formState.isDirty;let I;e[19]!==c||e[20]!==P?(I=c.handleSubmit(P),e[19]=c,e[20]=P,e[21]=I):I=e[21];let S;e[22]!==d||e[23]!==m.isPending?(S=B=>{const{field:_}=B;return s.jsxs($,{children:[s.jsx(K,{children:"Project Name"}),s.jsx(M,{children:s.jsx(V,{placeholder:"My Project",..._,disabled:d||m.isPending})}),d&&s.jsx(se,{children:"The organization admin project name cannot be changed."}),s.jsx(J,{})]})},e[22]=d,e[23]=m.isPending,e[24]=S):S=e[24];let n;e[25]!==c.control||e[26]!==S?(n=s.jsx(Q,{control:c.control,name:"name",render:S}),e[25]=c.control,e[26]=S,e[27]=n):n=e[27];let r;e[28]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(K,{children:"Slug"}),e[28]=r):r=e[28];let l;e[29]!==i.slug?(l=s.jsx(M,{children:s.jsx(V,{value:i.slug,disabled:!0,className:"bg-muted"})}),e[29]=i.slug,e[30]=l):l=e[30];let p;e[31]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(se,{children:"The project slug cannot be changed after creation."}),e[31]=p):p=e[31];let v;e[32]!==l?(v=s.jsxs($,{children:[r,l,p]}),e[32]=l,e[33]=v):v=e[33];let N;e[34]!==m.isPending?(N=B=>{const{field:_}=B;return s.jsxs($,{children:[s.jsx(K,{children:"Description"}),s.jsx(M,{children:s.jsx(be,{placeholder:"Optional project description...",rows:3,..._,value:_.value??"",disabled:m.isPending})}),s.jsx(J,{})]})},e[34]=m.isPending,e[35]=N):N=e[35];let F;e[36]!==c.control||e[37]!==N?(F=s.jsx(Q,{control:c.control,name:"description",render:N}),e[36]=c.control,e[37]=N,e[38]=F):F=e[38];const O=!C||m.isPending,T=m.isPending?"Saving...":"Save Changes";let D;e[39]!==O||e[40]!==T?(D=s.jsx(L,{type:"submit",disabled:O,className:"min-w-24",children:T}),e[39]=O,e[40]=T,e[41]=D):D=e[41];let A;e[42]!==c||e[43]!==C||e[44]!==m.isPending?(A=C&&s.jsx(L,{type:"button",variant:"outline",onClick:()=>c.reset(),disabled:m.isPending,children:"Cancel"}),e[42]=c,e[43]=C,e[44]=m.isPending,e[45]=A):A=e[45];let z;e[46]!==D||e[47]!==A?(z=s.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[D,A]}),e[46]=D,e[47]=A,e[48]=z):z=e[48];let E;e[49]!==n||e[50]!==v||e[51]!==F||e[52]!==z||e[53]!==I?(E=s.jsxs("form",{onSubmit:I,className:"space-y-6",children:[n,v,F,z]}),e[49]=n,e[50]=v,e[51]=F,e[52]=z,e[53]=I,e[54]=E):E=e[54];let k;return e[55]!==c||e[56]!==E?(k=s.jsx(me,{...c,children:E}),e[55]=c,e[56]=E,e[57]=k):k=e[57],k}function Qe(e){R.error("Failed to update project: "+(e instanceof Error?e.message:"Unknown error"))}function Je({value:e,onValueChange:t,placeholder:i="Select a connection...",binding:o,bindingType:d,onAddNew:g,className:u,disabled:x=!1}){const[j,b]=q.useState(!1),{installByBinding:a,isInstalling:c}=we(),f=j||c,h=Ce(),w=Se({connections:h,binding:typeof o=="string"?o:void 0}),m=!o||!h?h??[]:typeof o=="string"?w:Array.isArray(o)&&o.length>0?h.filter(n=>Pe(n,o)):h,y=(()=>{if(!d?.startsWith("@"))return null;const[n,r]=d.replace("@","").split("/");return n&&r?{scope:n,appName:r}:null})(),P=(()=>{let n=m;const r=Array.isArray(o)&&o.length>0;if(y&&!r&&(n=n.filter(l=>{const p=l.app_name,v=l.metadata?.scopeName;return p===y.appName&&v===y.scope})),e&&!n.some(l=>l.id===e)){const l=h?.find(p=>p.id===e);if(l)return[l,...n]}return n})(),C=d?.startsWith("@"),I=async()=>{if(C&&d){b(!0);try{const n=await a(d);n&&t(n.id)}finally{b(!1)}return}g?.()},S=P.find(n=>n.id===e);return s.jsxs(Fe,{value:e??"none",onValueChange:n=>t(n==="none"?null:n),disabled:x,children:[s.jsx(De,{size:"sm",className:je("w-[200px]",u),children:s.jsx(_e,{placeholder:i,children:S?s.jsxs("div",{className:"flex items-center gap-2",children:[S.icon?s.jsx("img",{src:S.icon,alt:S.title,className:"w-4 h-4 rounded shrink-0"}):s.jsx("div",{className:"w-4 h-4 rounded bg-gradient-to-br from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary shrink-0",children:S.title.slice(0,1).toUpperCase()}),s.jsx("span",{className:"truncate",children:S.title})]}):i})}),s.jsxs(Oe,{children:[s.jsx(le,{value:"none",children:"No connection"}),P.length===0?s.jsx("div",{className:"px-2 py-4 text-center text-sm text-muted-foreground",children:"No compatible connections found"}):P.map(n=>s.jsx(le,{value:n.id,children:s.jsxs("div",{className:"flex items-center gap-2",children:[n.icon?s.jsx("img",{src:n.icon,alt:n.title,className:"w-4 h-4 rounded"}):s.jsx("div",{className:"w-4 h-4 rounded bg-gradient-to-br from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:n.title.slice(0,1).toUpperCase()}),s.jsx("span",{children:n.title})]})},n.id)),(g||C)&&s.jsx("div",{className:"border-t border-border",children:s.jsx(L,{onPointerDown:n=>n.stopPropagation(),onClick:n=>{n.preventDefault(),n.stopPropagation(),I()},disabled:f||x,variant:"ghost",className:"w-full justify-start gap-2 px-2 py-2 h-auto hover:bg-muted rounded-md text-sm disabled:opacity-50 disabled:cursor-not-allowed",type:"button",children:f?s.jsxs(s.Fragment,{children:[s.jsx(Ie,{size:16,className:"animate-spin"}),s.jsx("span",{children:"Connecting..."})]}):s.jsxs(s.Fragment,{children:[s.jsx(Ee,{size:16}),s.jsx("span",{children:"Add Connection"})]})})})]})]})}const Ve=e=>{if(!e||typeof e!="object")return!1;const t=e;return t.type==="text"&&typeof t.text=="string"&&t.text.trim().toLowerCase().startsWith("error")},ne=e=>{const t=e.structuredContent??e,i=t&&typeof t=="object"?t:null,o=i?.content?.[0]?.text&&typeof i.content[0].text=="string"?i.content[0].text:null;if(i?.isError)throw new Error(o??"Tool call failed");if(Ve(t))throw new Error(t.text);return t};function He(e){return e.requiresMcpBinding===!0?!0:e.binding!==void 0}function We(e){const t=H.c(48),{plugin:i,isEnabled:o,isSaving:d,pendingBinding:g,description:u,label:x,icon:j,projectId:b,client:a,onBindingChange:c,onToggle:f}=e;let h;t[0]!==i?(h=He(i),t[0]=i,t[1]=h):h=t[1];const w=h;let m;t[2]!==i.id||t[3]!==b?(m=U.projectPluginConfig(b??"",i.id),t[2]=i.id,t[3]=b,t[4]=m):m=t[4];let y;t[5]!==a||t[6]!==i.id||t[7]!==b?(y=async()=>{if(!b)throw new Error("Project ID is required to load plugin config.");const E=await a.callTool({name:"PROJECT_PLUGIN_CONFIG_GET",arguments:{projectId:b,pluginId:i.id}});return ne(E)},t[5]=a,t[6]=i.id,t[7]=b,t[8]=y):y=t[8];const P=!!b&&w;let C;t[9]!==m||t[10]!==y||t[11]!==P?(C={queryKey:m,queryFn:y,enabled:P},t[9]=m,t[10]=y,t[11]=P,t[12]=C):C=t[12];const{data:I,isLoading:S}=ye(C),n=I?.config?.connectionId??null,r=g!==void 0?g:n;let l;t[13]!==j?(l=j&&s.jsx("div",{className:"flex-shrink-0 text-muted-foreground [&>svg]:size-4",children:j}),t[13]=j,t[14]=l):l=t[14];let p;t[15]!==x?(p=s.jsx("div",{className:"text-sm font-medium text-foreground",children:x}),t[15]=x,t[16]=p):p=t[16];let v;t[17]!==u?(v=u&&s.jsx("p",{className:"text-xs text-muted-foreground",children:u}),t[17]=u,t[18]=v):v=t[18];let N;t[19]!==p||t[20]!==v?(N=s.jsxs("div",{className:"min-w-0",children:[p,v]}),t[19]=p,t[20]=v,t[21]=N):N=t[21];let F;t[22]!==l||t[23]!==N?(F=s.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[l,N]}),t[22]=l,t[23]=N,t[24]=F):F=t[24];let O;t[25]!==f||t[26]!==i.id?(O=E=>f(i.id,E),t[25]=f,t[26]=i.id,t[27]=O):O=t[27];let T;t[28]!==o||t[29]!==d||t[30]!==O?(T=s.jsx(ve,{checked:o,onCheckedChange:O,disabled:d}),t[28]=o,t[29]=d,t[30]=O,t[31]=T):T=t[31];let D;t[32]!==F||t[33]!==T?(D=s.jsxs("div",{className:"flex items-center justify-between gap-4",children:[F,T]}),t[32]=F,t[33]=T,t[34]=D):D=t[34];let A;t[35]!==S||t[36]!==o||t[37]!==d||t[38]!==w||t[39]!==c||t[40]!==i.binding||t[41]!==i.id||t[42]!==r||t[43]!==n?(A=o&&w&&s.jsxs("div",{className:"mt-3 pl-7 flex items-center gap-3",children:[s.jsx(Ne,{className:"text-xs text-muted-foreground w-24",children:"Connection"}),s.jsx(Je,{value:r??null,onValueChange:E=>c(i.id,E,n),binding:i.binding,placeholder:"Select connection...",className:"w-56",disabled:d||S})]}),t[35]=S,t[36]=o,t[37]=d,t[38]=w,t[39]=c,t[40]=i.binding,t[41]=i.id,t[42]=r,t[43]=n,t[44]=A):A=t[44];let z;return t[45]!==D||t[46]!==A?(z=s.jsxs("div",{className:"py-3",children:[D,A]}),t[45]=D,t[46]=A,t[47]=z):z=t[47],z}function Ze(){const{org:e,project:t}=W(),i=X(),o=re({connectionId:ie,orgId:e.id}),[d,g]=q.useState({}),[u,x]=q.useState({}),[j,b]=q.useState(!1),a=t.enabledPlugins??[],c=n=>{const r=d[n];return r!==void 0?r:a.includes(n)},f=()=>{const n=new Set(a);for(const[r,l]of Object.entries(d))l?n.add(r):n.delete(r);return Array.from(n)},h=Object.keys(d).length>0||Object.keys(u).length>0,w=(n,r)=>{const l=a.includes(n);g(r===l?p=>{const{[n]:v,...N}=p;return N}:p=>({...p,[n]:r}))},m=(n,r,l)=>{if(r===l){x(p=>{const{[n]:v,...N}=p;return N});return}x(p=>({...p,[n]:r}))},y=ee({mutationFn:async n=>{const r=[];if(n.updatePlugins){const l=await o.callTool({name:"PROJECT_UPDATE",arguments:{projectId:t.id,enabledPlugins:n.enabledPlugins}});r.push(ne(l))}if(n.bindingUpdates.length>0){const l=await Promise.all(n.bindingUpdates.map(async({pluginId:p,connectionId:v})=>{const N=await o.callTool({name:"PROJECT_PLUGIN_CONFIG_UPDATE",arguments:{projectId:t.id,pluginId:p,connectionId:v}});return ne(N)}));r.push(...l)}return r},onSuccess:(n,r)=>{r.updatePlugins&&(i.invalidateQueries({queryKey:U.project(e.id,t.slug)}),i.invalidateQueries({queryKey:U.projects(e.id)})),r.bindingUpdates.forEach(({pluginId:l})=>{i.invalidateQueries({queryKey:U.projectPluginConfig(t.id??"",l)})}),g({}),x({}),R.success("Plugins updated successfully")},onError:n=>{R.error("Failed to update plugins: "+(n instanceof Error?n.message:"Unknown error"))},onSettled:()=>{b(!1)}}),P=()=>{b(!0),y.mutate({enabledPlugins:f(),updatePlugins:Object.keys(d).length>0,bindingUpdates:Object.entries(u).map(([n,r])=>({pluginId:n,connectionId:r}))})},C=()=>{g({}),x({})},I=n=>ue.find(r=>r.pluginId===n),S=n=>te.find(l=>l.id===n)?.description??null;return te.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No plugins available."}):s.jsxs("div",{className:"space-y-4",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Enable or disable plugins for this project. Enabled plugins will appear in the sidebar."}),s.jsx("div",{className:"divide-y divide-border border-y border-border",children:te.map(n=>{const r=I(n.id),l=S(n.id),p=c(n.id);return s.jsx(We,{plugin:n,isEnabled:p,isSaving:j,pendingBinding:u[n.id],description:l,label:r?.label??n.id,icon:r?.icon,projectId:t.id,client:o,onBindingChange:m,onToggle:w},n.id)})}),s.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[s.jsx(L,{variant:"outline",onClick:C,disabled:!h||j,children:"Cancel"}),s.jsx(L,{onClick:P,disabled:!h||j,className:"min-w-24",children:j?"Saving...":"Save Changes"})]})]})}const Ye=ce({name:G().min(1,"Name is required").max(255,"Name is too long"),slug:G().min(1,"Slug is required").max(50,"Slug is too long").regex(/^[a-z0-9-]+$/,"Slug must contain only lowercase letters, numbers, and hyphens"),logo:G().optional()});function Xe(e){const t=H.c(24),{value:i,onChange:o,name:d}=e,g=q.useRef(null);let u;t[0]!==o?(u=S=>{const n=S.target.files?.[0];if(n){if(n.size>2097152){R.error("Image must be smaller than 2MB");return}const r=new FileReader;r.onerror=()=>{const l=r.error;console.error("FileReader error:",l),R.error(l?.message||"Failed to read image file. Please try again."),g.current&&(g.current.value="")},r.onloadend=()=>{if(r.readyState===FileReader.DONE&&r.result){const l=r.result;o(l)}},r.readAsDataURL(n)}},t[0]=o,t[1]=u):u=t[1];const x=u;let j;t[2]===Symbol.for("react.memo_cache_sentinel")?(j=()=>{g.current?.click()},t[2]=j):j=t[2];const b=j;let a;t[3]!==o?(a=S=>{S.stopPropagation(),o("")},t[3]=o,t[4]=a):a=t[4];const c=a;let f;t[5]!==x?(f=s.jsx("input",{type:"file",ref:g,className:"hidden",accept:"image/*",onChange:x}),t[5]=x,t[6]=f):f=t[6];let h;t[7]!==c||t[8]!==d||t[9]!==i?(h=i?s.jsxs("div",{className:"relative group",children:[s.jsx("div",{className:"h-20 w-20 rounded-lg border border-border bg-muted/20 overflow-hidden",children:s.jsx("img",{src:i,alt:d||"Organization logo",className:"w-full h-full object-cover"})}),s.jsx("button",{type:"button",onClick:c,className:"absolute -top-2 -right-2 h-6 w-6 rounded-full bg-destructive text-destructive-foreground opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center",children:s.jsx(Ae,{className:"h-3 w-3"})})]}):s.jsxs("button",{type:"button",onClick:b,className:"h-20 w-20 rounded-lg border-2 border-dashed border-border hover:border-foreground/50 hover:bg-accent/50 transition-colors flex flex-col items-center justify-center gap-1 text-muted-foreground hover:text-foreground",children:[s.jsx(Te,{className:"h-5 w-5"}),s.jsx("span",{className:"text-xs",children:"Upload"})]}),t[7]=c,t[8]=d,t[9]=i,t[10]=h):h=t[10];const w=i?"Change Logo":"Upload Logo";let m;t[11]!==w?(m=s.jsx(L,{type:"button",variant:"outline",size:"sm",onClick:b,className:"mb-2",children:w}),t[11]=w,t[12]=m):m=t[12];let y;t[13]!==c||t[14]!==i?(y=i&&s.jsx(L,{type:"button",variant:"ghost",size:"sm",onClick:c,className:"ml-2",children:"Remove"}),t[13]=c,t[14]=i,t[15]=y):y=t[15];let P;t[16]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Recommended: Square image, at least 200x200px. Max 2MB."}),t[16]=P):P=t[16];let C;t[17]!==m||t[18]!==y?(C=s.jsxs("div",{className:"flex-1",children:[m,y,P]}),t[17]=m,t[18]=y,t[19]=C):C=t[19];let I;return t[20]!==C||t[21]!==f||t[22]!==h?(I=s.jsxs("div",{className:"flex items-start gap-4",children:[f,h,C]}),t[20]=C,t[21]=f,t[22]=h,t[23]=I):I=t[23],I}function et(){const e=de(),{org:t,project:i}=W(),o=X(),[d,g]=q.useState(!1),u=ae({resolver:oe(Ye),values:{name:t.name??"",slug:t.slug??"",logo:t.logo??""}}),x=ee({mutationFn:async a=>{const c={name:a.name,slug:a.slug};a.logo&&(c.logo=a.logo);const f=await ge.organization.update({organizationId:t.id,data:c});if(f?.error)throw new Error(f.error.message||"Failed to update organization");return f},onSuccess:a=>{o.invalidateQueries({queryKey:U.organizations()}),o.invalidateQueries({queryKey:U.activeOrganization(t.slug)}),R.success("Organization settings updated successfully"),a?.data?.slug&&a.data.slug!==t.slug&&e({to:"/$org/$project/settings",params:{org:a.data.slug,project:i.slug}})},onError:a=>{R.error(a instanceof Error?a.message:"Failed to update organization")},onSettled:()=>{g(!1)}}),j=a=>{g(!0),x.mutate(a)},b=u.formState.isDirty;return s.jsx(me,{...u,children:s.jsxs("form",{onSubmit:u.handleSubmit(j),className:"space-y-6",children:[s.jsx(Q,{control:u.control,name:"name",render:({field:a})=>s.jsxs($,{children:[s.jsx(K,{children:"Organization Name"}),s.jsx(M,{children:s.jsx(V,{placeholder:"My Organization",...a,disabled:d})}),s.jsx(J,{})]})}),s.jsx(Q,{control:u.control,name:"slug",render:({field:a})=>s.jsxs($,{children:[s.jsx(K,{children:"Organization Slug"}),s.jsx(M,{children:s.jsx(V,{placeholder:"my-organization",...a,disabled:d,onChange:c=>{const f=c.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");a.onChange(f)}})}),s.jsx(se,{children:"Used in URLs. Only lowercase letters, numbers, and hyphens are allowed."}),s.jsx(J,{})]})}),s.jsx(Q,{control:u.control,name:"logo",render:({field:a})=>s.jsxs($,{children:[s.jsx(K,{children:"Logo"}),s.jsx(M,{children:s.jsx(Xe,{value:a.value,onChange:a.onChange,name:u.watch("name")})}),s.jsx(J,{})]})}),s.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[s.jsx(L,{type:"submit",disabled:!b||d,className:"min-w-24",children:d?"Saving...":"Save Changes"}),b&&s.jsx(L,{type:"button",variant:"outline",onClick:()=>u.reset(),disabled:d,children:"Cancel"})]})]})})}function tt(){const e=H.c(44),{org:t,project:i}=W(),o=de(),d=X(),[g,u]=q.useState(""),[x,j]=q.useState(!1),b=i.slug===Y;let a;e[0]!==t.id?(a={connectionId:ie,orgId:t.id},e[0]=t.id,e[1]=a):a=e[1];const c=re(a);let f;e[2]!==c||e[3]!==i.id?(f=async()=>{const _=await c.callTool({name:"PROJECT_DELETE",arguments:{projectId:i.id}});return _.structuredContent??_},e[2]=c,e[3]=i.id,e[4]=f):f=e[4];let h;e[5]!==o||e[6]!==t.id||e[7]!==t.slug||e[8]!==d?(h=_=>{_.success?(d.invalidateQueries({queryKey:U.projects(t.id)}),R.success("Project deleted"),o({to:"/$org/$project",params:{org:t.slug,project:Y}})):R.error(_.message??"Failed to delete project")},e[5]=o,e[6]=t.id,e[7]=t.slug,e[8]=d,e[9]=h):h=e[9];let w;e[10]!==f||e[11]!==h?(w={mutationFn:f,onSuccess:h,onError:st},e[10]=f,e[11]=h,e[12]=w):w=e[12];const m=ee(w);if(b)return null;const y=g===i.name;let P;e[13]!==m?(P=()=>{m.mutate()},e[13]=m,e[14]=P):P=e[14];const C=P;let I;e[15]===Symbol.for("react.memo_cache_sentinel")?(I=_=>{j(_),_||u("")},e[15]=I):I=e[15];const S=I;let n;e[16]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{children:[s.jsx("h3",{className:"font-semibold text-destructive",children:"Danger Zone"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Irreversible and destructive actions."})]}),e[16]=n):n=e[16];let r;e[17]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Be,{asChild:!0,children:s.jsx(L,{variant:"destructive",children:"Delete Project"})}),e[17]=r):r=e[17];let l;e[18]!==i.name?(l=s.jsxs(ze,{children:['Delete "',i.name,'"?']}),e[18]=i.name,e[19]=l):l=e[19];let p;e[20]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(ke,{children:"This action cannot be undone. All project data will be permanently deleted."}),e[20]=p):p=e[20];let v;e[21]!==l?(v=s.jsxs(Re,{children:[l,p]}),e[21]=l,e[22]=v):v=e[22];let N;e[23]!==i.name?(N=s.jsxs("p",{className:"text-sm mb-2",children:["Type ",s.jsx("strong",{children:i.name})," to confirm:"]}),e[23]=i.name,e[24]=N):N=e[24];let F;e[25]===Symbol.for("react.memo_cache_sentinel")?(F=_=>u(_.target.value),e[25]=F):F=e[25];let O;e[26]!==g||e[27]!==i.name?(O=s.jsx(V,{value:g,onChange:F,placeholder:i.name}),e[26]=g,e[27]=i.name,e[28]=O):O=e[28];let T;e[29]!==N||e[30]!==O?(T=s.jsxs("div",{className:"py-4",children:[N,O]}),e[29]=N,e[30]=O,e[31]=T):T=e[31];let D;e[32]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx(Le,{children:"Cancel"}),e[32]=D):D=e[32];const A=!y||m.isPending,z=m.isPending?"Deleting...":"Delete Project";let E;e[33]!==C||e[34]!==A||e[35]!==z?(E=s.jsxs(Ue,{children:[D,s.jsx(qe,{onClick:C,disabled:A,className:"bg-destructive hover:bg-destructive/90 text-destructive-foreground",children:z})]}),e[33]=C,e[34]=A,e[35]=z,e[36]=E):E=e[36];let k;e[37]!==v||e[38]!==T||e[39]!==E?(k=s.jsxs(Me,{children:[v,T,E]}),e[37]=v,e[38]=T,e[39]=E,e[40]=k):k=e[40];let B;return e[41]!==x||e[42]!==k?(B=s.jsxs("div",{className:"border border-destructive/50 rounded-lg p-4 space-y-4",children:[n,s.jsxs($e,{open:x,onOpenChange:S,children:[r,k]})]}),e[41]=x,e[42]=k,e[43]=B):B=e[43],B}function st(e){R.error("Failed to delete project: "+(e instanceof Error?e.message:"Unknown error"))}function At(){const e=H.c(10),{project:t}=W(),i=t.slug===Y;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Z.Header,{children:s.jsx(Z.Header.Left,{children:s.jsx(fe,{children:s.jsx(he,{children:s.jsx(pe,{children:s.jsx(xe,{children:"Settings"})})})})})}),e[0]=o):o=e[0];let d;e[1]!==i?(d=i&&s.jsxs("section",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"Organization"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Update your organization's name, slug, and logo."})]}),s.jsx(et,{})]}),e[1]=i,e[2]=d):d=e[2];let g;e[3]!==i?(g=!i&&s.jsxs("section",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"General"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Basic project information."})]}),s.jsx(Ge,{})]}),e[3]=i,e[4]=g):g=e[4];let u,x;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsxs("section",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"Plugins"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Manage which plugins are enabled and configure them."})]}),s.jsx(Ze,{})]}),x=s.jsx(tt,{}),e[5]=u,e[6]=x):(u=e[5],x=e[6]);let j;return e[7]!==d||e[8]!==g?(j=s.jsxs(Z,{children:[o,s.jsx(Z.Content,{children:s.jsx("div",{className:"flex h-full",children:s.jsx("div",{className:"flex-1 overflow-auto",children:s.jsx("div",{className:"p-5 max-w-2xl",children:s.jsxs("div",{className:"space-y-8",children:[d,g,u,x]})})})})})]}),e[7]=d,e[8]=g,e[9]=j):j=e[9],j}export{At as default};
|
|
1
|
+
import{c as H,u as W,z as X,O as Y,h as oe,k as ae,j as s,o as ce,s as G,K as U,t as R,r as q,aM as te,bu as ue,m as de,g as ge}from"./index-B0lAKtRh.js";import{P as Z}from"./index-C4SaT72q.js";import{B as fe,a as he,b as pe,c as xe}from"./breadcrumb-DTOs2A-I.js";import{u as ee}from"./useMutation-DTtaBOsy.js";import{a as ie,u as re}from"./constants-7tHIXjuz.js";import{B as L,c as je}from"./button-Cxd9D7GZ.js";import{I as V}from"./input-BTRdl8wU.js";import{T as be}from"./textarea-D0RfPnUt.js";import{F as Q,d as M,a as me,b as $,c as K,e as se,f as J}from"./form-C7gcuapm.js";import{u as ye}from"./useQuery-Cx1KUbzW.js";import{S as ve}from"./switch-BezvOOLk.js";import{L as Ne}from"./label-B-xKop8p.js";import{h as Ce}from"./use-connection-t2lORAui.js";import{a as Se,c as Pe}from"./use-binding-Dvp-m6Vz.js";import{u as we}from"./use-install-from-registry-BcVvP9yq.js";import{i as Ie}from"./Loading01-BclS8iWV.js";import{s as Ee}from"./Plus-C5LR6cck.js";import{S as Fe,a as De,b as _e,c as Oe,d as le}from"./select-vvkW2wBk.js";import{i as Te}from"./Upload01-BK6OrHOB.js";import{i as Ae}from"./X-D-vCW-FP.js";import{c as ze,h as Be,d as ke,b as Re,A as Le,e as Ue,g as qe,a as Me,f as $e}from"./alert-dialog-C2eeNa17.js";import"./ChevronRight-CVpzq9SE.js";import"./binder-B_Z7E1sw.js";import"./extract-connection-data-Bxl9-N57.js";import"./constants-B1QaD4GY.js";import"./github-icon-Dp3wHhYE.js";import"./registry-utils-icgkdXTH.js";import"./generate-id-Dyweu44Y.js";import"./index-C1cLa9Gd.js";import"./Check-Dy1kSzwX.js";import"./ChevronDown-CEjoikg0.js";const Ke=ce({name:G().min(1,"Name is required").max(200,"Name is too long"),description:G().max(1e3,"Description is too long").nullable()});function Ge(){const e=H.c(58),{org:t,project:i}=W(),o=X(),d=i.slug===Y;let g;e[0]!==t.id?(g={connectionId:ie,orgId:t.id},e[0]=t.id,e[1]=g):g=e[1];const u=re(g);let x;e[2]===Symbol.for("react.memo_cache_sentinel")?(x=oe(Ke),e[2]=x):x=e[2];const j=i.name??"",b=i.description??"";let a;e[3]!==j||e[4]!==b?(a={resolver:x,values:{name:j,description:b}},e[3]=j,e[4]=b,e[5]=a):a=e[5];const c=ae(a);let f;e[6]!==u||e[7]!==i.id?(f=async B=>{const _=await u.callTool({name:"PROJECT_UPDATE",arguments:{projectId:i.id,name:B.name,description:B.description||null}});return _.structuredContent??_},e[6]=u,e[7]=i.id,e[8]=f):f=e[8];let h;e[9]!==c||e[10]!==t.id||e[11]!==i.slug||e[12]!==o?(h=()=>{o.invalidateQueries({queryKey:U.project(t.id,i.slug)}),o.invalidateQueries({queryKey:U.projects(t.id)}),R.success("Project updated successfully"),c.reset(c.getValues())},e[9]=c,e[10]=t.id,e[11]=i.slug,e[12]=o,e[13]=h):h=e[13];let w;e[14]!==f||e[15]!==h?(w={mutationFn:f,onSuccess:h,onError:Qe},e[14]=f,e[15]=h,e[16]=w):w=e[16];const m=ee(w);let y;e[17]!==m?(y=async B=>{await m.mutateAsync(B)},e[17]=m,e[18]=y):y=e[18];const P=y,C=c.formState.isDirty;let I;e[19]!==c||e[20]!==P?(I=c.handleSubmit(P),e[19]=c,e[20]=P,e[21]=I):I=e[21];let S;e[22]!==d||e[23]!==m.isPending?(S=B=>{const{field:_}=B;return s.jsxs($,{children:[s.jsx(K,{children:"Project Name"}),s.jsx(M,{children:s.jsx(V,{placeholder:"My Project",..._,disabled:d||m.isPending})}),d&&s.jsx(se,{children:"The organization admin project name cannot be changed."}),s.jsx(J,{})]})},e[22]=d,e[23]=m.isPending,e[24]=S):S=e[24];let n;e[25]!==c.control||e[26]!==S?(n=s.jsx(Q,{control:c.control,name:"name",render:S}),e[25]=c.control,e[26]=S,e[27]=n):n=e[27];let r;e[28]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(K,{children:"Slug"}),e[28]=r):r=e[28];let l;e[29]!==i.slug?(l=s.jsx(M,{children:s.jsx(V,{value:i.slug,disabled:!0,className:"bg-muted"})}),e[29]=i.slug,e[30]=l):l=e[30];let p;e[31]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(se,{children:"The project slug cannot be changed after creation."}),e[31]=p):p=e[31];let v;e[32]!==l?(v=s.jsxs($,{children:[r,l,p]}),e[32]=l,e[33]=v):v=e[33];let N;e[34]!==m.isPending?(N=B=>{const{field:_}=B;return s.jsxs($,{children:[s.jsx(K,{children:"Description"}),s.jsx(M,{children:s.jsx(be,{placeholder:"Optional project description...",rows:3,..._,value:_.value??"",disabled:m.isPending})}),s.jsx(J,{})]})},e[34]=m.isPending,e[35]=N):N=e[35];let F;e[36]!==c.control||e[37]!==N?(F=s.jsx(Q,{control:c.control,name:"description",render:N}),e[36]=c.control,e[37]=N,e[38]=F):F=e[38];const O=!C||m.isPending,T=m.isPending?"Saving...":"Save Changes";let D;e[39]!==O||e[40]!==T?(D=s.jsx(L,{type:"submit",disabled:O,className:"min-w-24",children:T}),e[39]=O,e[40]=T,e[41]=D):D=e[41];let A;e[42]!==c||e[43]!==C||e[44]!==m.isPending?(A=C&&s.jsx(L,{type:"button",variant:"outline",onClick:()=>c.reset(),disabled:m.isPending,children:"Cancel"}),e[42]=c,e[43]=C,e[44]=m.isPending,e[45]=A):A=e[45];let z;e[46]!==D||e[47]!==A?(z=s.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[D,A]}),e[46]=D,e[47]=A,e[48]=z):z=e[48];let E;e[49]!==n||e[50]!==v||e[51]!==F||e[52]!==z||e[53]!==I?(E=s.jsxs("form",{onSubmit:I,className:"space-y-6",children:[n,v,F,z]}),e[49]=n,e[50]=v,e[51]=F,e[52]=z,e[53]=I,e[54]=E):E=e[54];let k;return e[55]!==c||e[56]!==E?(k=s.jsx(me,{...c,children:E}),e[55]=c,e[56]=E,e[57]=k):k=e[57],k}function Qe(e){R.error("Failed to update project: "+(e instanceof Error?e.message:"Unknown error"))}function Je({value:e,onValueChange:t,placeholder:i="Select a connection...",binding:o,bindingType:d,onAddNew:g,className:u,disabled:x=!1}){const[j,b]=q.useState(!1),{installByBinding:a,isInstalling:c}=we(),f=j||c,h=Ce(),w=Se({connections:h,binding:typeof o=="string"?o:void 0}),m=!o||!h?h??[]:typeof o=="string"?w:Array.isArray(o)&&o.length>0?h.filter(n=>Pe(n,o)):h,y=(()=>{if(!d?.startsWith("@"))return null;const[n,r]=d.replace("@","").split("/");return n&&r?{scope:n,appName:r}:null})(),P=(()=>{let n=m;const r=Array.isArray(o)&&o.length>0;if(y&&!r&&(n=n.filter(l=>{const p=l.app_name,v=l.metadata?.scopeName;return p===y.appName&&v===y.scope})),e&&!n.some(l=>l.id===e)){const l=h?.find(p=>p.id===e);if(l)return[l,...n]}return n})(),C=d?.startsWith("@"),I=async()=>{if(C&&d){b(!0);try{const n=await a(d);n&&t(n.id)}finally{b(!1)}return}g?.()},S=P.find(n=>n.id===e);return s.jsxs(Fe,{value:e??"none",onValueChange:n=>t(n==="none"?null:n),disabled:x,children:[s.jsx(De,{size:"sm",className:je("w-[200px]",u),children:s.jsx(_e,{placeholder:i,children:S?s.jsxs("div",{className:"flex items-center gap-2",children:[S.icon?s.jsx("img",{src:S.icon,alt:S.title,className:"w-4 h-4 rounded shrink-0"}):s.jsx("div",{className:"w-4 h-4 rounded bg-gradient-to-br from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary shrink-0",children:S.title.slice(0,1).toUpperCase()}),s.jsx("span",{className:"truncate",children:S.title})]}):i})}),s.jsxs(Oe,{children:[s.jsx(le,{value:"none",children:"No connection"}),P.length===0?s.jsx("div",{className:"px-2 py-4 text-center text-sm text-muted-foreground",children:"No compatible connections found"}):P.map(n=>s.jsx(le,{value:n.id,children:s.jsxs("div",{className:"flex items-center gap-2",children:[n.icon?s.jsx("img",{src:n.icon,alt:n.title,className:"w-4 h-4 rounded"}):s.jsx("div",{className:"w-4 h-4 rounded bg-gradient-to-br from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:n.title.slice(0,1).toUpperCase()}),s.jsx("span",{children:n.title})]})},n.id)),(g||C)&&s.jsx("div",{className:"border-t border-border",children:s.jsx(L,{onPointerDown:n=>n.stopPropagation(),onClick:n=>{n.preventDefault(),n.stopPropagation(),I()},disabled:f||x,variant:"ghost",className:"w-full justify-start gap-2 px-2 py-2 h-auto hover:bg-muted rounded-md text-sm disabled:opacity-50 disabled:cursor-not-allowed",type:"button",children:f?s.jsxs(s.Fragment,{children:[s.jsx(Ie,{size:16,className:"animate-spin"}),s.jsx("span",{children:"Connecting..."})]}):s.jsxs(s.Fragment,{children:[s.jsx(Ee,{size:16}),s.jsx("span",{children:"Add Connection"})]})})})]})]})}const Ve=e=>{if(!e||typeof e!="object")return!1;const t=e;return t.type==="text"&&typeof t.text=="string"&&t.text.trim().toLowerCase().startsWith("error")},ne=e=>{const t=e.structuredContent??e,i=t&&typeof t=="object"?t:null,o=i?.content?.[0]?.text&&typeof i.content[0].text=="string"?i.content[0].text:null;if(i?.isError)throw new Error(o??"Tool call failed");if(Ve(t))throw new Error(t.text);return t};function He(e){return e.requiresMcpBinding===!0?!0:e.binding!==void 0}function We(e){const t=H.c(48),{plugin:i,isEnabled:o,isSaving:d,pendingBinding:g,description:u,label:x,icon:j,projectId:b,client:a,onBindingChange:c,onToggle:f}=e;let h;t[0]!==i?(h=He(i),t[0]=i,t[1]=h):h=t[1];const w=h;let m;t[2]!==i.id||t[3]!==b?(m=U.projectPluginConfig(b??"",i.id),t[2]=i.id,t[3]=b,t[4]=m):m=t[4];let y;t[5]!==a||t[6]!==i.id||t[7]!==b?(y=async()=>{if(!b)throw new Error("Project ID is required to load plugin config.");const E=await a.callTool({name:"PROJECT_PLUGIN_CONFIG_GET",arguments:{projectId:b,pluginId:i.id}});return ne(E)},t[5]=a,t[6]=i.id,t[7]=b,t[8]=y):y=t[8];const P=!!b&&w;let C;t[9]!==m||t[10]!==y||t[11]!==P?(C={queryKey:m,queryFn:y,enabled:P},t[9]=m,t[10]=y,t[11]=P,t[12]=C):C=t[12];const{data:I,isLoading:S}=ye(C),n=I?.config?.connectionId??null,r=g!==void 0?g:n;let l;t[13]!==j?(l=j&&s.jsx("div",{className:"flex-shrink-0 text-muted-foreground [&>svg]:size-4",children:j}),t[13]=j,t[14]=l):l=t[14];let p;t[15]!==x?(p=s.jsx("div",{className:"text-sm font-medium text-foreground",children:x}),t[15]=x,t[16]=p):p=t[16];let v;t[17]!==u?(v=u&&s.jsx("p",{className:"text-xs text-muted-foreground",children:u}),t[17]=u,t[18]=v):v=t[18];let N;t[19]!==p||t[20]!==v?(N=s.jsxs("div",{className:"min-w-0",children:[p,v]}),t[19]=p,t[20]=v,t[21]=N):N=t[21];let F;t[22]!==l||t[23]!==N?(F=s.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[l,N]}),t[22]=l,t[23]=N,t[24]=F):F=t[24];let O;t[25]!==f||t[26]!==i.id?(O=E=>f(i.id,E),t[25]=f,t[26]=i.id,t[27]=O):O=t[27];let T;t[28]!==o||t[29]!==d||t[30]!==O?(T=s.jsx(ve,{checked:o,onCheckedChange:O,disabled:d}),t[28]=o,t[29]=d,t[30]=O,t[31]=T):T=t[31];let D;t[32]!==F||t[33]!==T?(D=s.jsxs("div",{className:"flex items-center justify-between gap-4",children:[F,T]}),t[32]=F,t[33]=T,t[34]=D):D=t[34];let A;t[35]!==S||t[36]!==o||t[37]!==d||t[38]!==w||t[39]!==c||t[40]!==i.binding||t[41]!==i.id||t[42]!==r||t[43]!==n?(A=o&&w&&s.jsxs("div",{className:"mt-3 pl-7 flex items-center gap-3",children:[s.jsx(Ne,{className:"text-xs text-muted-foreground w-24",children:"Connection"}),s.jsx(Je,{value:r??null,onValueChange:E=>c(i.id,E,n),binding:i.binding,placeholder:"Select connection...",className:"w-56",disabled:d||S})]}),t[35]=S,t[36]=o,t[37]=d,t[38]=w,t[39]=c,t[40]=i.binding,t[41]=i.id,t[42]=r,t[43]=n,t[44]=A):A=t[44];let z;return t[45]!==D||t[46]!==A?(z=s.jsxs("div",{className:"py-3",children:[D,A]}),t[45]=D,t[46]=A,t[47]=z):z=t[47],z}function Ze(){const{org:e,project:t}=W(),i=X(),o=re({connectionId:ie,orgId:e.id}),[d,g]=q.useState({}),[u,x]=q.useState({}),[j,b]=q.useState(!1),a=t.enabledPlugins??[],c=n=>{const r=d[n];return r!==void 0?r:a.includes(n)},f=()=>{const n=new Set(a);for(const[r,l]of Object.entries(d))l?n.add(r):n.delete(r);return Array.from(n)},h=Object.keys(d).length>0||Object.keys(u).length>0,w=(n,r)=>{const l=a.includes(n);g(r===l?p=>{const{[n]:v,...N}=p;return N}:p=>({...p,[n]:r}))},m=(n,r,l)=>{if(r===l){x(p=>{const{[n]:v,...N}=p;return N});return}x(p=>({...p,[n]:r}))},y=ee({mutationFn:async n=>{const r=[];if(n.updatePlugins){const l=await o.callTool({name:"PROJECT_UPDATE",arguments:{projectId:t.id,enabledPlugins:n.enabledPlugins}});r.push(ne(l))}if(n.bindingUpdates.length>0){const l=await Promise.all(n.bindingUpdates.map(async({pluginId:p,connectionId:v})=>{const N=await o.callTool({name:"PROJECT_PLUGIN_CONFIG_UPDATE",arguments:{projectId:t.id,pluginId:p,connectionId:v}});return ne(N)}));r.push(...l)}return r},onSuccess:(n,r)=>{r.updatePlugins&&(i.invalidateQueries({queryKey:U.project(e.id,t.slug)}),i.invalidateQueries({queryKey:U.projects(e.id)})),r.bindingUpdates.forEach(({pluginId:l})=>{i.invalidateQueries({queryKey:U.projectPluginConfig(t.id??"",l)})}),g({}),x({}),R.success("Plugins updated successfully")},onError:n=>{R.error("Failed to update plugins: "+(n instanceof Error?n.message:"Unknown error"))},onSettled:()=>{b(!1)}}),P=()=>{b(!0),y.mutate({enabledPlugins:f(),updatePlugins:Object.keys(d).length>0,bindingUpdates:Object.entries(u).map(([n,r])=>({pluginId:n,connectionId:r}))})},C=()=>{g({}),x({})},I=n=>ue.find(r=>r.pluginId===n),S=n=>te.find(l=>l.id===n)?.description??null;return te.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No plugins available."}):s.jsxs("div",{className:"space-y-4",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Enable or disable plugins for this project. Enabled plugins will appear in the sidebar."}),s.jsx("div",{className:"divide-y divide-border border-y border-border",children:te.map(n=>{const r=I(n.id),l=S(n.id),p=c(n.id);return s.jsx(We,{plugin:n,isEnabled:p,isSaving:j,pendingBinding:u[n.id],description:l,label:r?.label??n.id,icon:r?.icon,projectId:t.id,client:o,onBindingChange:m,onToggle:w},n.id)})}),s.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[s.jsx(L,{variant:"outline",onClick:C,disabled:!h||j,children:"Cancel"}),s.jsx(L,{onClick:P,disabled:!h||j,className:"min-w-24",children:j?"Saving...":"Save Changes"})]})]})}const Ye=ce({name:G().min(1,"Name is required").max(255,"Name is too long"),slug:G().min(1,"Slug is required").max(50,"Slug is too long").regex(/^[a-z0-9-]+$/,"Slug must contain only lowercase letters, numbers, and hyphens"),logo:G().optional()});function Xe(e){const t=H.c(24),{value:i,onChange:o,name:d}=e,g=q.useRef(null);let u;t[0]!==o?(u=S=>{const n=S.target.files?.[0];if(n){if(n.size>2097152){R.error("Image must be smaller than 2MB");return}const r=new FileReader;r.onerror=()=>{const l=r.error;console.error("FileReader error:",l),R.error(l?.message||"Failed to read image file. Please try again."),g.current&&(g.current.value="")},r.onloadend=()=>{if(r.readyState===FileReader.DONE&&r.result){const l=r.result;o(l)}},r.readAsDataURL(n)}},t[0]=o,t[1]=u):u=t[1];const x=u;let j;t[2]===Symbol.for("react.memo_cache_sentinel")?(j=()=>{g.current?.click()},t[2]=j):j=t[2];const b=j;let a;t[3]!==o?(a=S=>{S.stopPropagation(),o("")},t[3]=o,t[4]=a):a=t[4];const c=a;let f;t[5]!==x?(f=s.jsx("input",{type:"file",ref:g,className:"hidden",accept:"image/*",onChange:x}),t[5]=x,t[6]=f):f=t[6];let h;t[7]!==c||t[8]!==d||t[9]!==i?(h=i?s.jsxs("div",{className:"relative group",children:[s.jsx("div",{className:"h-20 w-20 rounded-lg border border-border bg-muted/20 overflow-hidden",children:s.jsx("img",{src:i,alt:d||"Organization logo",className:"w-full h-full object-cover"})}),s.jsx("button",{type:"button",onClick:c,className:"absolute -top-2 -right-2 h-6 w-6 rounded-full bg-destructive text-destructive-foreground opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center",children:s.jsx(Ae,{className:"h-3 w-3"})})]}):s.jsxs("button",{type:"button",onClick:b,className:"h-20 w-20 rounded-lg border-2 border-dashed border-border hover:border-foreground/50 hover:bg-accent/50 transition-colors flex flex-col items-center justify-center gap-1 text-muted-foreground hover:text-foreground",children:[s.jsx(Te,{className:"h-5 w-5"}),s.jsx("span",{className:"text-xs",children:"Upload"})]}),t[7]=c,t[8]=d,t[9]=i,t[10]=h):h=t[10];const w=i?"Change Logo":"Upload Logo";let m;t[11]!==w?(m=s.jsx(L,{type:"button",variant:"outline",size:"sm",onClick:b,className:"mb-2",children:w}),t[11]=w,t[12]=m):m=t[12];let y;t[13]!==c||t[14]!==i?(y=i&&s.jsx(L,{type:"button",variant:"ghost",size:"sm",onClick:c,className:"ml-2",children:"Remove"}),t[13]=c,t[14]=i,t[15]=y):y=t[15];let P;t[16]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Recommended: Square image, at least 200x200px. Max 2MB."}),t[16]=P):P=t[16];let C;t[17]!==m||t[18]!==y?(C=s.jsxs("div",{className:"flex-1",children:[m,y,P]}),t[17]=m,t[18]=y,t[19]=C):C=t[19];let I;return t[20]!==C||t[21]!==f||t[22]!==h?(I=s.jsxs("div",{className:"flex items-start gap-4",children:[f,h,C]}),t[20]=C,t[21]=f,t[22]=h,t[23]=I):I=t[23],I}function et(){const e=de(),{org:t,project:i}=W(),o=X(),[d,g]=q.useState(!1),u=ae({resolver:oe(Ye),values:{name:t.name??"",slug:t.slug??"",logo:t.logo??""}}),x=ee({mutationFn:async a=>{const c={name:a.name,slug:a.slug};a.logo&&(c.logo=a.logo);const f=await ge.organization.update({organizationId:t.id,data:c});if(f?.error)throw new Error(f.error.message||"Failed to update organization");return f},onSuccess:a=>{o.invalidateQueries({queryKey:U.organizations()}),o.invalidateQueries({queryKey:U.activeOrganization(t.slug)}),R.success("Organization settings updated successfully"),a?.data?.slug&&a.data.slug!==t.slug&&e({to:"/$org/$project/settings",params:{org:a.data.slug,project:i.slug}})},onError:a=>{R.error(a instanceof Error?a.message:"Failed to update organization")},onSettled:()=>{g(!1)}}),j=a=>{g(!0),x.mutate(a)},b=u.formState.isDirty;return s.jsx(me,{...u,children:s.jsxs("form",{onSubmit:u.handleSubmit(j),className:"space-y-6",children:[s.jsx(Q,{control:u.control,name:"name",render:({field:a})=>s.jsxs($,{children:[s.jsx(K,{children:"Organization Name"}),s.jsx(M,{children:s.jsx(V,{placeholder:"My Organization",...a,disabled:d})}),s.jsx(J,{})]})}),s.jsx(Q,{control:u.control,name:"slug",render:({field:a})=>s.jsxs($,{children:[s.jsx(K,{children:"Organization Slug"}),s.jsx(M,{children:s.jsx(V,{placeholder:"my-organization",...a,disabled:d,onChange:c=>{const f=c.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");a.onChange(f)}})}),s.jsx(se,{children:"Used in URLs. Only lowercase letters, numbers, and hyphens are allowed."}),s.jsx(J,{})]})}),s.jsx(Q,{control:u.control,name:"logo",render:({field:a})=>s.jsxs($,{children:[s.jsx(K,{children:"Logo"}),s.jsx(M,{children:s.jsx(Xe,{value:a.value,onChange:a.onChange,name:u.watch("name")})}),s.jsx(J,{})]})}),s.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[s.jsx(L,{type:"submit",disabled:!b||d,className:"min-w-24",children:d?"Saving...":"Save Changes"}),b&&s.jsx(L,{type:"button",variant:"outline",onClick:()=>u.reset(),disabled:d,children:"Cancel"})]})]})})}function tt(){const e=H.c(44),{org:t,project:i}=W(),o=de(),d=X(),[g,u]=q.useState(""),[x,j]=q.useState(!1),b=i.slug===Y;let a;e[0]!==t.id?(a={connectionId:ie,orgId:t.id},e[0]=t.id,e[1]=a):a=e[1];const c=re(a);let f;e[2]!==c||e[3]!==i.id?(f=async()=>{const _=await c.callTool({name:"PROJECT_DELETE",arguments:{projectId:i.id}});return _.structuredContent??_},e[2]=c,e[3]=i.id,e[4]=f):f=e[4];let h;e[5]!==o||e[6]!==t.id||e[7]!==t.slug||e[8]!==d?(h=_=>{_.success?(d.invalidateQueries({queryKey:U.projects(t.id)}),R.success("Project deleted"),o({to:"/$org/$project",params:{org:t.slug,project:Y}})):R.error(_.message??"Failed to delete project")},e[5]=o,e[6]=t.id,e[7]=t.slug,e[8]=d,e[9]=h):h=e[9];let w;e[10]!==f||e[11]!==h?(w={mutationFn:f,onSuccess:h,onError:st},e[10]=f,e[11]=h,e[12]=w):w=e[12];const m=ee(w);if(b)return null;const y=g===i.name;let P;e[13]!==m?(P=()=>{m.mutate()},e[13]=m,e[14]=P):P=e[14];const C=P;let I;e[15]===Symbol.for("react.memo_cache_sentinel")?(I=_=>{j(_),_||u("")},e[15]=I):I=e[15];const S=I;let n;e[16]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{children:[s.jsx("h3",{className:"font-semibold text-destructive",children:"Danger Zone"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Irreversible and destructive actions."})]}),e[16]=n):n=e[16];let r;e[17]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Be,{asChild:!0,children:s.jsx(L,{variant:"destructive",children:"Delete Project"})}),e[17]=r):r=e[17];let l;e[18]!==i.name?(l=s.jsxs(ze,{children:['Delete "',i.name,'"?']}),e[18]=i.name,e[19]=l):l=e[19];let p;e[20]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(ke,{children:"This action cannot be undone. All project data will be permanently deleted."}),e[20]=p):p=e[20];let v;e[21]!==l?(v=s.jsxs(Re,{children:[l,p]}),e[21]=l,e[22]=v):v=e[22];let N;e[23]!==i.name?(N=s.jsxs("p",{className:"text-sm mb-2",children:["Type ",s.jsx("strong",{children:i.name})," to confirm:"]}),e[23]=i.name,e[24]=N):N=e[24];let F;e[25]===Symbol.for("react.memo_cache_sentinel")?(F=_=>u(_.target.value),e[25]=F):F=e[25];let O;e[26]!==g||e[27]!==i.name?(O=s.jsx(V,{value:g,onChange:F,placeholder:i.name}),e[26]=g,e[27]=i.name,e[28]=O):O=e[28];let T;e[29]!==N||e[30]!==O?(T=s.jsxs("div",{className:"py-4",children:[N,O]}),e[29]=N,e[30]=O,e[31]=T):T=e[31];let D;e[32]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx(Le,{children:"Cancel"}),e[32]=D):D=e[32];const A=!y||m.isPending,z=m.isPending?"Deleting...":"Delete Project";let E;e[33]!==C||e[34]!==A||e[35]!==z?(E=s.jsxs(Ue,{children:[D,s.jsx(qe,{onClick:C,disabled:A,className:"bg-destructive hover:bg-destructive/90 text-destructive-foreground",children:z})]}),e[33]=C,e[34]=A,e[35]=z,e[36]=E):E=e[36];let k;e[37]!==v||e[38]!==T||e[39]!==E?(k=s.jsxs(Me,{children:[v,T,E]}),e[37]=v,e[38]=T,e[39]=E,e[40]=k):k=e[40];let B;return e[41]!==x||e[42]!==k?(B=s.jsxs("div",{className:"border border-destructive/50 rounded-lg p-4 space-y-4",children:[n,s.jsxs($e,{open:x,onOpenChange:S,children:[r,k]})]}),e[41]=x,e[42]=k,e[43]=B):B=e[43],B}function st(e){R.error("Failed to delete project: "+(e instanceof Error?e.message:"Unknown error"))}function At(){const e=H.c(10),{project:t}=W(),i=t.slug===Y;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Z.Header,{children:s.jsx(Z.Header.Left,{children:s.jsx(fe,{children:s.jsx(he,{children:s.jsx(pe,{children:s.jsx(xe,{children:"Settings"})})})})})}),e[0]=o):o=e[0];let d;e[1]!==i?(d=i&&s.jsxs("section",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"Organization"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Update your organization's name, slug, and logo."})]}),s.jsx(et,{})]}),e[1]=i,e[2]=d):d=e[2];let g;e[3]!==i?(g=!i&&s.jsxs("section",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"General"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Basic project information."})]}),s.jsx(Ge,{})]}),e[3]=i,e[4]=g):g=e[4];let u,x;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsxs("section",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"Plugins"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Manage which plugins are enabled and configure them."})]}),s.jsx(Ze,{})]}),x=s.jsx(tt,{}),e[5]=u,e[6]=x):(u=e[5],x=e[6]);let j;return e[7]!==d||e[8]!==g?(j=s.jsxs(Z,{children:[o,s.jsx(Z.Content,{children:s.jsx("div",{className:"flex h-full",children:s.jsx("div",{className:"flex-1 overflow-auto",children:s.jsx("div",{className:"p-5 max-w-2xl",children:s.jsxs("div",{className:"space-y-8",children:[d,g,u,x]})})})})})]}),e[7]=d,e[8]=g,e[9]=j):j=e[9],j}export{At as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{b3 as U,c as O,u as H,j as s,aL as G,r as I,m as M,O as V}from"./index-B0lAKtRh.js";import{a as q}from"./use-project-BTuyMFkB.js";import{P as D}from"./index-C4SaT72q.js";import{C as F}from"./collection-search-BEKSlJnh.js";import{A as J}from"./avatar-DVIfFxjv.js";import{c as K,B as R}from"./button-Cxd9D7GZ.js";import{f as Q}from"./formatDistanceToNow-Cb2QZZJn.js";import{E as T}from"./empty-state-x18Ct7Bg.js";import{C as W}from"./create-project-dialog-W-9Wb58U.js";import{B as X,a as Y,b as Z,c as ee}from"./breadcrumb-DTOs2A-I.js";import"./useQuery-Cx1KUbzW.js";import"./constants-7tHIXjuz.js";import"./Loading01-BclS8iWV.js";import"./SearchMd-DhDCnDEk.js";import"./input-BTRdl8wU.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./useMutation-DTtaBOsy.js";import"./dialog-D36Sp9vM.js";import"./X-D-vCW-FP.js";import"./form-C7gcuapm.js";import"./label-B-xKop8p.js";import"./textarea-D0RfPnUt.js";import"./Check-Dy1kSzwX.js";import"./ChevronRight-CVpzq9SE.js";const te=U("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);function se(t){const e=O.c(58),{project:l,onSettingsClick:c}=t,{org:r}=H(),d=l.ui?.themeColor??"#60a5fa",b=l.ui?.bannerColor??d,m=l.ui?.banner?`url(${l.ui.banner})`:void 0;let i;e[0]!==b||e[1]!==m?(i={backgroundColor:b,backgroundImage:m,backgroundSize:"cover",backgroundPosition:"center"},e[0]=b,e[1]=m,e[2]=i):i=e[2];const _=i;let u;e[3]!==r.slug||e[4]!==l.slug?(u={org:r.slug,project:l.slug},e[3]=r.slug,e[4]=l.slug,e[5]=u):u=e[5];let f;e[6]!==c?(f=B=>{B.preventDefault(),B.stopPropagation(),c?.(B)},e[6]=c,e[7]=f):f=e[7];let x,v;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=K("absolute top-3 right-3 size-6 rounded-md flex items-center justify-center","bg-black/20 hover:bg-black/40 transition-colors","opacity-0 group-hover:opacity-100"),v=s.jsx(te,{className:"size-3.5 text-white"}),e[8]=x,e[9]=v):(x=e[8],v=e[9]);let g;e[10]!==f?(g=s.jsx("button",{type:"button",onClick:f,className:x,children:v}),e[10]=f,e[11]=g):g=e[11];let p;e[12]!==_||e[13]!==g?(p=s.jsx("div",{className:"h-20 relative",style:_,children:g}),e[12]=_,e[13]=g,e[14]=p):p=e[14];let n;e[15]!==l.name||e[16]!==l.ui||e[17]!==d?(n=l.ui?.icon?s.jsx("img",{src:l.ui.icon,alt:"",className:"size-8 rounded-md object-cover"}):s.jsx("div",{className:"size-8 rounded-md flex items-center justify-center",style:{backgroundColor:d},children:s.jsx("span",{className:"text-sm font-medium text-white",children:l.name.charAt(0).toUpperCase()})}),e[15]=l.name,e[16]=l.ui,e[17]=d,e[18]=n):n=e[18];let a;e[19]!==l.name?(a=s.jsx("h3",{className:"font-medium text-base text-foreground truncate",children:l.name}),e[19]=l.name,e[20]=a):a=e[20];let h;e[21]!==l.updatedAt?(h=Q(new Date(l.updatedAt),{addSuffix:!0}),e[21]=l.updatedAt,e[22]=h):h=e[22];let j;e[23]!==h?(j=s.jsxs("p",{className:"text-sm text-muted-foreground",children:["Edited"," ",h]}),e[23]=h,e[24]=j):j=e[24];let C;e[25]!==a||e[26]!==j?(C=s.jsxs("div",{className:"flex flex-col",children:[a,j]}),e[25]=a,e[26]=j,e[27]=C):C=e[27];let N;e[28]!==n||e[29]!==C?(N=s.jsxs("div",{className:"flex flex-col gap-4",children:[n,C]}),e[28]=n,e[29]=C,e[30]=N):N=e[30];let k;e[31]!==l.boundConnections?(k=l.boundConnections.slice(0,4).map(le),e[31]=l.boundConnections,e[32]=k):k=e[32];let P;e[33]!==l.boundConnections.length?(P=l.boundConnections.length>4&&s.jsx("div",{className:"-mr-2 rounded-md border border-background",children:s.jsxs("div",{className:"size-6 rounded-md bg-background border border-black/10 shadow-sm flex items-center justify-center text-xs text-muted-foreground",children:["+",l.boundConnections.length-4]})}),e[33]=l.boundConnections.length,e[34]=P):P=e[34];let y;e[35]!==k||e[36]!==P?(y=s.jsxs("div",{className:"flex pr-2",children:[k,P]}),e[35]=k,e[36]=P,e[37]=y):y=e[37];const z=r.logo??void 0;let w;e[38]!==r.name||e[39]!==z?(w=s.jsx(J,{url:z,fallback:r.name,size:"2xs",className:"shrink-0 rounded",objectFit:"cover"}),e[38]=r.name,e[39]=z,e[40]=w):w=e[40];let S;e[41]!==r.name?(S=s.jsx("span",{className:"truncate max-w-20",children:r.name}),e[41]=r.name,e[42]=S):S=e[42];let o;e[43]!==w||e[44]!==S?(o=s.jsxs("div",{className:"flex items-center gap-2 text-xs text-foreground",children:[w,S]}),e[43]=w,e[44]=S,e[45]=o):o=e[45];let L;e[46]!==y||e[47]!==o?(L=s.jsxs("div",{className:"flex items-center justify-between mt-4",children:[y,o]}),e[46]=y,e[47]=o,e[48]=L):L=e[48];let $;e[49]!==N||e[50]!==L?($=s.jsxs("div",{className:"flex flex-col flex-1 justify-between p-4",children:[N,L]}),e[49]=N,e[50]=L,e[51]=$):$=e[51];let A;e[52]!==$||e[53]!==p?(A=s.jsxs("div",{className:"border border-border rounded-xl overflow-hidden bg-card",children:[p,$]}),e[52]=$,e[53]=p,e[54]=A):A=e[54];let E;return e[55]!==A||e[56]!==u?(E=s.jsx(G,{to:"/$org/$project",params:u,className:"block group",children:A}),e[55]=A,e[56]=u,e[57]=E):E=e[57],E}function le(t){return s.jsx("div",{className:"-mr-2 rounded-md border border-background",children:s.jsx(re,{connection:t})},t.id)}function re(t){const e=O.c(13),{connection:l}=t;if(l.icon){let m;e[0]!==l.icon||e[1]!==l.title?(m=s.jsx("img",{src:l.icon,alt:l.title,className:"size-4 object-cover"}),e[0]=l.icon,e[1]=l.title,e[2]=m):m=e[2];let i;return e[3]!==l.title||e[4]!==m?(i=s.jsx("div",{className:"size-6 rounded-md bg-background border border-black/10 shadow-sm flex items-center justify-center overflow-hidden",title:l.title,children:m}),e[3]=l.title,e[4]=m,e[5]=i):i=e[5],i}const c=l.title;let r;e[6]!==l.title?(r=l.title.charAt(0).toUpperCase(),e[6]=l.title,e[7]=r):r=e[7];let d;e[8]!==r?(d=s.jsx("span",{className:"text-[10px] text-muted-foreground font-medium",children:r}),e[8]=r,e[9]=d):d=e[9];let b;return e[10]!==l.title||e[11]!==d?(b=s.jsx("div",{className:"size-6 rounded-md bg-background border border-black/10 shadow-sm flex items-center justify-center overflow-hidden",title:c,children:d}),e[10]=l.title,e[11]=d,e[12]=b):b=e[12],b}function $e(){const t=O.c(40),{org:e}=H(),{data:l,isLoading:c}=q(e.id),[r,d]=I.useState(""),[b,m]=I.useState(!1),i=M();let _,u,f,x,v,g,p,n,a;if(t[0]!==c||t[1]!==i||t[2]!==e.slug||t[3]!==l||t[4]!==r){const N=l?.filter(ie)?.filter(o=>o.name.toLowerCase().includes(r.toLowerCase())||o.description?.toLowerCase().includes(r.toLowerCase()))??[];let k;t[14]!==i||t[15]!==e.slug?(k=o=>{i({to:"/$org/$project/settings",params:{org:e.slug,project:o}})},t[14]=i,t[15]=e.slug,t[16]=k):k=t[16];const P=k;let y;t[17]===Symbol.for("react.memo_cache_sentinel")?(y=()=>{m(!0)},t[17]=y):y=t[17];const z=y;u=D;let w;t[18]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(D.Header.Left,{children:s.jsx(X,{children:s.jsx(Y,{children:s.jsx(Z,{children:s.jsx(ee,{children:"Projects"})})})})}),t[18]=w):w=t[18],t[19]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs(D.Header,{children:[w,s.jsx(D.Header.Right,{children:s.jsx(R,{onClick:z,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Create new project"})})]}),t[19]=n):n=t[19];let S;t[20]===Symbol.for("react.memo_cache_sentinel")?(S=o=>{o.key==="Escape"&&(d(""),o.target.blur())},t[20]=S):S=t[20],t[21]!==r?(a=s.jsx(F,{value:r,onChange:d,placeholder:"Search for a project...",onKeyDown:S}),t[21]=r,t[22]=a):a=t[22],_=D.Content,f="@container",t[23]!==c?(x=c&&s.jsx("div",{className:"p-5",children:s.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:[...Array(4)].map(oe)})}),t[23]=c,t[24]=x):x=t[24],v=!c&&N.length===0&&r&&s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(T,{title:"No projects found",description:`No projects match "${r}"`})}),g=!c&&N.length===0&&!r&&s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(T,{title:"No projects yet",description:"Create a project to get started.",actions:s.jsx(R,{onClick:z,children:"Create new project"})})}),p=!c&&N.length>0&&s.jsx("div",{className:"p-5",children:s.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:N.map(o=>s.jsx(se,{project:o,onSettingsClick:()=>P(o.slug)},o.id))})}),t[0]=c,t[1]=i,t[2]=e.slug,t[3]=l,t[4]=r,t[5]=_,t[6]=u,t[7]=f,t[8]=x,t[9]=v,t[10]=g,t[11]=p,t[12]=n,t[13]=a}else _=t[5],u=t[6],f=t[7],x=t[8],v=t[9],g=t[10],p=t[11],n=t[12],a=t[13];let h;t[25]!==_||t[26]!==f||t[27]!==x||t[28]!==v||t[29]!==g||t[30]!==p?(h=s.jsxs(_,{className:f,children:[x,v,g,p]}),t[25]=_,t[26]=f,t[27]=x,t[28]=v,t[29]=g,t[30]=p,t[31]=h):h=t[31];let j;t[32]!==b?(j=s.jsx(W,{open:b,onOpenChange:m}),t[32]=b,t[33]=j):j=t[33];let C;return t[34]!==u||t[35]!==n||t[36]!==a||t[37]!==h||t[38]!==j?(C=s.jsxs(u,{children:[n,a,h,j]}),t[34]=u,t[35]=n,t[36]=a,t[37]=h,t[38]=j,t[39]=C):C=t[39],C}function oe(t,e){return s.jsx("div",{className:"h-[240px] rounded-xl bg-muted animate-pulse"},e)}function ie(t){return t.slug!==V}export{$e as default};
|