@decocms/mesh 2.123.4 → 2.124.0
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-DiDJuuO7.js → AlertCircle-FqZvtfh1.js} +1 -1
- package/dist/client/assets/{AlertOctagon-T8X2xR5Y.js → AlertOctagon-raXiOXHj.js} +1 -1
- package/dist/client/assets/{AlertTriangle-BR7J9Jvh.js → AlertTriangle-Cag6cydu.js} +1 -1
- package/dist/client/assets/ArrowDown-BzwwIvol.js +1 -0
- package/dist/client/assets/{ArrowLeft-CZ4ZZXqO.js → ArrowLeft-CHSuXHTI.js} +1 -1
- package/dist/client/assets/ArrowUp-lkpB-gsw.js +1 -0
- package/dist/client/assets/{Check-ebSdGxZp.js → Check-BEIYk4IG.js} +1 -1
- package/dist/client/assets/{CheckCircle-BX10u03U.js → CheckCircle-BwIxyhQy.js} +1 -1
- package/dist/client/assets/{CheckDone01-BKZeNjYI.js → CheckDone01-Duh5ZNi_.js} +1 -1
- package/dist/client/assets/{CheckVerified02-Bc-TzDsw.js → CheckVerified02-DFKFrqtt.js} +1 -1
- package/dist/client/assets/{ChevronDown-BxrIQ2Hg.js → ChevronDown-DDsgD0_a.js} +1 -1
- package/dist/client/assets/{ChevronRight-D1zpPr9G.js → ChevronRight-dj0VUAfs.js} +1 -1
- package/dist/client/assets/{Clock-ByTlM-Ae.js → Clock-Dv-gTw8O.js} +1 -1
- package/dist/client/assets/{Code01-62o0ASv5.js → Code01-DbWG3kai.js} +1 -1
- package/dist/client/assets/{Container-Cr2TCDTS.js → Container-BY7Dg1ME.js} +1 -1
- package/dist/client/assets/{Copy01-CfVZSokb.js → Copy01-BpXeBtQY.js} +1 -1
- package/dist/client/assets/{Dataflow03-CEYvQeh9.js → Dataflow03-Ce5PVi3u.js} +1 -1
- package/dist/client/assets/{DotsHorizontal-D_wKOZTi.js → DotsHorizontal--qP7BuAi.js} +1 -1
- package/dist/client/assets/{DotsVertical-BNJZVkhj.js → DotsVertical-_M8uWFPN.js} +1 -1
- package/dist/client/assets/{Download01-CMusldak.js → Download01-Cvq7FqwC.js} +1 -1
- package/dist/client/assets/{Edit01-BySGjbs-.js → Edit01-BOdZHKPa.js} +1 -1
- package/dist/client/assets/{Eye-Wh_bq-Y4.js → Eye-D_CQVe6k.js} +1 -1
- package/dist/client/assets/{File02-Drnn3tnJ.js → File02-BtCmWw9V.js} +1 -1
- package/dist/client/assets/{File06-CL04kImU.js → File06-D2nPQ2vd.js} +1 -1
- package/dist/client/assets/{FilterLines-DgwYDfry.js → FilterLines-CeQtwyiF.js} +1 -1
- package/dist/client/assets/{Globe01-BMVTN5_w.js → Globe01-BUNBHHR9.js} +1 -1
- package/dist/client/assets/{Globe02-BD3ZCWms.js → Globe02-DXh1wFnz.js} +1 -1
- package/dist/client/assets/{Grid01-BWcrgmNx.js → Grid01-DDvgvRE8.js} +1 -1
- package/dist/client/assets/{Hash02-Dqi3bcQt.js → Hash02-CCi87yL-.js} +1 -1
- package/dist/client/assets/{Home02-lTWiIHtK.js → Home02-WM8fzzhX.js} +1 -1
- package/dist/client/assets/{Image01-DcX1niB5.js → Image01-ToJS21L5.js} +1 -1
- package/dist/client/assets/{Inbox01-8_gDqife.js → Inbox01-Dl3sNTM-.js} +1 -1
- package/dist/client/assets/{InfoCircle-BKPaDpeK.js → InfoCircle-CHNw8w2I.js} +1 -1
- package/dist/client/assets/{Key01-CyWdmMm6.js → Key01-CBasGMu5.js} +1 -1
- package/dist/client/assets/{LinkExternal01-DPNrtGWV.js → LinkExternal01-BIouwr8D.js} +1 -1
- package/dist/client/assets/{List-DqeEnxu3.js → List-iNTJ6fUY.js} +1 -1
- package/dist/client/assets/{Loading01-BZRHfswB.js → Loading01-BFMhWWtD.js} +1 -1
- package/dist/client/assets/{Lock01-BDqkVPGz.js → Lock01-C4Sc75k7.js} +1 -1
- package/dist/client/assets/{Pin01-BDMJN64-.js → Pin01-BE9Oh0sU.js} +1 -1
- package/dist/client/assets/{Play-BKXV9SNy.js → Play-gsrF7xxW.js} +1 -1
- package/dist/client/assets/{Plus-YlJja9E2.js → Plus-Ck954sGm.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-Ci0qepHw.js → RefreshCcw01-zTyzcouM.js} +1 -1
- package/dist/client/assets/{RefreshCw01-Sv3Ciq4-.js → RefreshCw01-DbiZ19Ml.js} +1 -1
- package/dist/client/assets/{Rows03-DjbwBGBI.js → Rows03-B0JH9Ohl.js} +1 -1
- package/dist/client/assets/{Save01-CUHpjboy.js → Save01-CGYgsRh8.js} +1 -1
- package/dist/client/assets/{SearchMd-CdY2Qz31.js → SearchMd-Dvn1Eo76.js} +1 -1
- package/dist/client/assets/{Settings01-hHMZndAB.js → Settings01-CE-2gHzf.js} +1 -1
- package/dist/client/assets/{Shield01-BC6B_xBt.js → Shield01-BB8IGqoD.js} +1 -1
- package/dist/client/assets/{Terminal-D2rGQta9.js → Terminal-DQESGxaj.js} +1 -1
- package/dist/client/assets/{Trash01-DjSET-_p.js → Trash01-BC7PAlKV.js} +1 -1
- package/dist/client/assets/{Upload01-C0CPwbYb.js → Upload01-CASznv9t.js} +1 -1
- package/dist/client/assets/{Users03-BiJcw06H.js → Users03-DJ0q7ZN3.js} +1 -1
- package/dist/client/assets/{XCircle-oJlXTAnn.js → XCircle-JhpX2IQK.js} +1 -1
- package/dist/client/assets/{XClose-CNjsPY9p.js → XClose-Cpw_0BW6.js} +1 -1
- package/dist/client/assets/{agent-connections-preview-CyTgEjXK.js → agent-connections-preview-Dhs8DGJ9.js} +1 -1
- package/dist/client/assets/agent-detail-C8HmsASY.js +2 -0
- package/dist/client/assets/agents-BUO9Of5M.js +1 -0
- package/dist/client/assets/alert-dialog-K0UnFp_v.js +7 -0
- package/dist/client/assets/{auth-catchall-BSjXqHGj.js → auth-catchall-Cts5maQI.js} +1 -1
- package/dist/client/assets/{avatar-CLzAk7bk.js → avatar-BLu12sL5.js} +1 -1
- package/dist/client/assets/{badge-zj5rJqFG.js → badge-D4ZHiXFA.js} +1 -1
- package/dist/client/assets/{binder-Yx0eVQL7.js → binder-BeV9Iq0g.js} +1 -1
- package/dist/client/assets/{breadcrumb-p3FP4YzT.js → breadcrumb-kQQ-d55s.js} +1 -1
- package/dist/client/assets/{button-BlFVi9O-.js → button-BxOn_P7A.js} +1 -1
- package/dist/client/assets/{card-C5XZXHnb.js → card-DMS-g9Fe.js} +1 -1
- package/dist/client/assets/{chart-CECGc95G.js → chart-Dm5seKC_.js} +1 -1
- package/dist/client/assets/{checkbox-C81GTltZ.js → checkbox-QVK1EYTJ.js} +1 -1
- package/dist/client/assets/{circle-alert-DTrbbil0.js → circle-alert-BGE5uKTO.js} +1 -1
- package/dist/client/assets/{collection-detail-DC6lEGsR.js → collection-detail-BNuWQnMo.js} +3 -3
- package/dist/client/assets/collection-search-WzmN-NEH.js +1 -0
- package/dist/client/assets/collection-tab-CqF7e-el.js +1 -0
- package/dist/client/assets/collection-table-wrapper-DpYYlIci.js +1 -0
- package/dist/client/assets/{collection-tabs-DXae7bMN.js → collection-tabs-BzQ9gNkb.js} +1 -1
- package/dist/client/assets/{command-C0Lk3OoX.js → command-pJXSXf5S.js} +1 -1
- package/dist/client/assets/{connect-B0zgap2s.js → connect-DpHmbRge.js} +1 -1
- package/dist/client/assets/{connection-card-Bfx8qlqL.js → connection-card-CRsOF1KU.js} +1 -1
- package/dist/client/assets/connection-detail-B1dOB0AI.js +1 -0
- package/dist/client/assets/connections-EWXE105G.js +1 -0
- package/dist/client/assets/{constants-DS4O9R8r.js → constants-9bKBT988.js} +1 -1
- package/dist/client/assets/constants-CS_UcM7e.js +1 -0
- package/dist/client/assets/context-LmNUO0nU.js +23 -0
- package/dist/client/assets/{create-organization-dialog-BFIfEtVL.js → create-organization-dialog-CuKocaBI.js} +1 -1
- package/dist/client/assets/{create-project-dialog-D2mtQ7wt.js → create-project-dialog-heqHF5Xt.js} +1 -1
- package/dist/client/assets/deco-constants-YxoGHwHI.js +1 -0
- package/dist/client/assets/{dialog-BED3woG1.js → dialog-8Qx5GCEw.js} +1 -1
- package/dist/client/assets/{dropdown-menu-Db2R0f6-.js → dropdown-menu-BbhseL--.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-BzLyvc2d.js → dynamic-plugin-layout-Ch1QuglW.js} +1 -1
- package/dist/client/assets/empty-state-C7VZap1W.js +1 -0
- package/dist/client/assets/{empty-state-CIZqXQMR.js → empty-state-CSzTWTZI.js} +1 -1
- package/dist/client/assets/{env-vars-editor-CDWwUXgx.js → env-vars-editor-C0KF8UB-.js} +1 -1
- package/dist/client/assets/{error-boundary-DFWzxGF2.js → error-boundary-BpCU-F5d.js} +1 -1
- package/dist/client/assets/{extract-connection-data-1y_2LKN1.js → extract-connection-data-CLG2vt6G.js} +1 -1
- package/dist/client/assets/{file-browser-BLbb-Y8y.js → file-browser-4BKj7MWu.js} +2 -2
- package/dist/client/assets/{form-DdvC8UfL.js → form-Dn5Ilwyi.js} +1 -1
- package/dist/client/assets/{grid-view-CqSeu3_O.js → grid-view-aIHLkNPN.js} +1 -1
- package/dist/client/assets/{home-DlTcQ85K.js → home-md1YObTz.js} +1 -1
- package/dist/client/assets/index-BpxApmrT.css +1 -0
- package/dist/client/assets/{index-Cs9SJKB2.js → index-BtVQ48XT.js} +1 -1
- package/dist/client/assets/{index-Bb5ajAZZ.js → index-CIUI9_Ip.js} +63 -65
- package/dist/client/assets/{index-BG2jkRwM.js → index-CWIKLTkS.js} +1 -1
- package/dist/client/assets/{index-Chdo1wOf.js → index-DQipirM0.js} +3 -3
- package/dist/client/assets/{index-C5tdq0OE.js → index-DdzAhdkZ.js} +1 -1
- package/dist/client/assets/{index-6Tp9fsVX.js → index-DlglR7Dv.js} +1 -1
- package/dist/client/assets/{index-D8_oQFvH.js → index-Du85XF43.js} +1 -1
- package/dist/client/assets/{index-CNFSBpm2.js → index-ow5WSrzH.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-DOxbID_2.js → infiniteQueryObserver-45WqMl59.js} +1 -1
- package/dist/client/assets/{input-C2bYHqSZ.js → input-D3a40-af.js} +1 -1
- package/dist/client/assets/{integration-icon-CHfvIBul.js → integration-icon-6FQvxTss.js} +1 -1
- package/dist/client/assets/{label-Cz00Hk_C.js → label-_-PuJzKE.js} +1 -1
- package/dist/client/assets/{layout-D8HdJww7.js → layout-C5y_iFls.js} +1 -1
- package/dist/client/assets/{localstorage-keys-D6jY_B8O.js → localstorage-keys-Xr0m_-Nl.js} +1 -1
- package/dist/client/assets/{login-B4sEC044.js → login-CGG5vJdW.js} +1 -1
- package/dist/client/assets/{markdown-W0glOUUc.js → markdown-DumqyZQo.js} +2 -2
- package/dist/client/assets/{mcp-oauth-CxZiVIG0.js → mcp-oauth-ZHptqU19.js} +1 -1
- package/dist/client/assets/{mcp-server-card-MyE_33s4.js → mcp-server-card-uS3QofMZ.js} +1 -1
- package/dist/client/assets/mcp-server-detail-BKF_R4E0.js +2 -0
- package/dist/client/assets/members-BRSEA55l.js +3 -0
- package/dist/client/assets/{monitoring-DnyUAZQs.js → monitoring-ChGczzDH.js} +2 -2
- package/dist/client/assets/{monitoring-dashboard-edit-CeSLs60r.js → monitoring-dashboard-edit-1EYxjqsS.js} +1 -1
- package/dist/client/assets/{monitoring-dashboard-view-CXYrse_E.js → monitoring-dashboard-view-B9ky_iuo.js} +1 -1
- package/dist/client/assets/{oauth-callback-CtEIzTst.js → oauth-callback-DiCjOlTo.js} +1 -1
- package/dist/client/assets/page-Bd4vke_j.js +1 -0
- package/dist/client/assets/page-BqTRzB6R.js +1 -0
- package/dist/client/assets/{plugin-empty-state-C3dQRExn.js → plugin-empty-state-3Ic2Cddr.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-CtOLvnau.js → plugin-empty-state-B0aoDY0o.js} +1 -1
- package/dist/client/assets/{plugin-header-BpYtnCvY.js → plugin-header-1MpH5dMN.js} +1 -1
- package/dist/client/assets/{plugin-header-wMO8zy_s.js → plugin-header-lqwqxxa8.js} +1 -1
- package/dist/client/assets/{popover-B4On8gSm.js → popover-O7pPZSal.js} +1 -1
- package/dist/client/assets/project-layout-Dk2D-43Q.js +1 -0
- package/dist/client/assets/projects-list-CApnnFAH.js +1 -0
- package/dist/client/assets/ranking-layout-CB_f3cVs.js +1 -0
- package/dist/client/assets/{readme-viewer-gb5hrmSg.js → readme-viewer-61IpnmPP.js} +1 -1
- package/dist/client/assets/{registry-layout-Cyki9u_h.js → registry-layout-DGM76yIZ.js} +1 -1
- package/dist/client/assets/{registry-utils-BL6Np0uD.js → registry-utils-DSUIffwE.js} +1 -1
- package/dist/client/assets/{reports-layout-DImwy6ND.js → reports-layout-BMSW5Pvz.js} +2 -2
- package/dist/client/assets/{reset-password-ButVRXi9.js → reset-password-R313_uMV.js} +1 -1
- package/dist/client/assets/{resizable-DUdJ1A_O.js → resizable-Dz9Hl0cL.js} +1 -1
- package/dist/client/assets/{save-actions-BiCpAXjr.js → save-actions-De5hNsxX.js} +1 -1
- package/dist/client/assets/{scroll-area-C9Z4g4D3.js → scroll-area-dZhjEr7K.js} +1 -1
- package/dist/client/assets/{select-DwyzrBGR.js → select-BSYdCUMN.js} +1 -1
- package/dist/client/assets/shell-layout-CGTPLB_Q.js +3 -0
- package/dist/client/assets/{skeleton-DdrlSfda.js → skeleton-D-Lsp11A.js} +1 -1
- package/dist/client/assets/{spinner-DeIV40-d.js → spinner-BL4ZMZYA.js} +1 -1
- package/dist/client/assets/{store-invite-DHfus7Si.js → store-invite-B0hYE1ZZ.js} +1 -1
- package/dist/client/assets/{switch-BW_XeGpN.js → switch-DyckCxcC.js} +1 -1
- package/dist/client/assets/{table-N5hQy-1m.js → table-D0pFXKN4.js} +1 -1
- package/dist/client/assets/tasks-DPZywEmF.js +1 -0
- package/dist/client/assets/{textarea-B5CEImaf.js → textarea-DX9d61Sr.js} +1 -1
- package/dist/client/assets/{time-range-picker-B3M_kZtN.js → time-range-picker-fngIp4Wo.js} +1 -1
- package/dist/client/assets/{toggle-group-k8q-T2Qa.js → toggle-group-Z0vsy7J4.js} +1 -1
- package/dist/client/assets/tools-list-B0lut0n1.js +1 -0
- package/dist/client/assets/{tooltip-BWW8lvJo.js → tooltip-B7RjBzxU.js} +1 -1
- package/dist/client/assets/{topbar-portal-m9wB0x-E.js → topbar-portal-D44GN90b.js} +1 -1
- package/dist/client/assets/{typewriter-title-DcVIzze1.js → typewriter-title-CkssIeLy.js} +1 -1
- package/dist/client/assets/{use-binding-DT0OPEEL.js → use-binding-oEpPFbv0.js} +1 -1
- package/dist/client/assets/{use-connection-O4z2Mc_F.js → use-connection-DXequUdB.js} +1 -1
- package/dist/client/assets/{use-copy-Drx5AGFH.js → use-copy-h8i-bDIZ.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-CZu2JnDv.js → use-create-virtual-mcp-DG-_igKD.js} +1 -1
- package/dist/client/assets/use-deco-chat-open-BAG5m-JA.js +1 -0
- package/dist/client/assets/{use-install-from-registry-Dc84s0lp.js → use-install-from-registry-BCGIZz8M.js} +1 -1
- package/dist/client/assets/{use-list-state-DQM_pDDC.js → use-list-state-DjtYoYEW.js} +1 -1
- package/dist/client/assets/{use-llm-Z9GIoSzc.js → use-llm-DDqwpIPn.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-uD1aNW_g.js → use-mcp-prompts-CqOiamVC.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-B8wkpbTs.js → use-mcp-tools-Dt6WorDi.js} +1 -1
- package/dist/client/assets/{use-mobile-ziAtnWz2.js → use-mobile-CYG2M3Mj.js} +1 -1
- package/dist/client/assets/{use-organization-settings-BJEr33WT.js → use-organization-settings-Db9DvZjz.js} +1 -1
- package/dist/client/assets/{use-project-Dz1PHkz5.js → use-project-x4-rNIeb.js} +1 -1
- package/dist/client/assets/{use-settings-modal-CYH_HZlL.js → use-settings-modal-D-E-U1i_.js} +1 -1
- package/dist/client/assets/{use-view-mode-CRJUL6S-.js → use-view-mode-C5FzaFBT.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-BateG3is.js → use-virtual-mcp-Bq4iD2DN.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-qwQj5SMK.js +1 -0
- package/dist/client/assets/{useMutation-BTkDU0tp.js → useMutation-8rEyObWg.js} +1 -1
- package/dist/client/assets/useQuery-CqT-L2b-.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-BKpm_7Fb.js +1 -0
- package/dist/client/assets/view-mode-toggle-DumSmhPz.js +1 -0
- package/dist/client/assets/workflow-Nf6onDYr.js +1 -0
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +168 -168
- package/dist/server/migrate.js +2 -2
- package/dist/server/server.js +2 -2
- package/package.json +1 -1
- package/dist/client/assets/ArrowUp-CBTnQfpb.js +0 -1
- package/dist/client/assets/Tool01-8K3JOGke.js +0 -1
- package/dist/client/assets/agent-detail-9DFcapAu.js +0 -2
- package/dist/client/assets/agents-4gtiAnuv.js +0 -1
- package/dist/client/assets/alert-dialog-DG1mgLiN.js +0 -7
- package/dist/client/assets/collection-tab-dYtQ3dOc.js +0 -1
- package/dist/client/assets/collection-table-wrapper-D3UQPYYs.js +0 -1
- package/dist/client/assets/connection-detail-CFl60IV3.js +0 -1
- package/dist/client/assets/connections-40Z9p3na.js +0 -1
- package/dist/client/assets/constants-0nWmzfAq.js +0 -1
- package/dist/client/assets/context-CJpih0Aq.js +0 -23
- package/dist/client/assets/deco-constants-B2fB4qCk.js +0 -1
- package/dist/client/assets/empty-state-DwKYfPjb.js +0 -1
- package/dist/client/assets/index-BHAz67cr.css +0 -1
- package/dist/client/assets/mcp-server-detail-DPKP-AVk.js +0 -2
- package/dist/client/assets/members-C0wNcB0L.js +0 -3
- package/dist/client/assets/page-BaeXPwI_.js +0 -1
- package/dist/client/assets/page-wIVLNXO6.js +0 -1
- package/dist/client/assets/project-layout-1AjzWWMn.js +0 -1
- package/dist/client/assets/projects-list-DNSZsINF.js +0 -1
- package/dist/client/assets/ranking-layout-BgeMngBH.js +0 -1
- package/dist/client/assets/shell-layout-BGf6BKNx.js +0 -3
- package/dist/client/assets/tasks-CKkoq9mO.js +0 -1
- package/dist/client/assets/tools-list-TXvbi7bf.js +0 -1
- package/dist/client/assets/use-deco-chat-open-Qq9AtQ8h.js +0 -1
- package/dist/client/assets/useInfiniteQuery-BHuahm2t.js +0 -1
- package/dist/client/assets/useQuery-C0AkqYB7.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DPaJK1nP.js +0 -1
- package/dist/client/assets/workflow-CTPlOYoh.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as Q,r as U,u as re,K as oe,bw as we,j as t,b as me,O as de,d as Ie,bx as Te,by as ne,aC as Re}from"./index-DQipirM0.js";import{P as X}from"./index-DlglR7Dv.js";import{B as Pe,a as $e,b as ke,c as ze}from"./breadcrumb-kQQ-d55s.js";import{i as ue}from"./AlertTriangle-Cag6cydu.js";import{i as fe}from"./FilterLines-CeQtwyiF.js";import{n as xe}from"./Inbox01-Dl3sNTM-.js";import{i as se}from"./Loading01-BFMhWWtD.js";import{s as ge}from"./RefreshCw01-DbiZ19Ml.js";import{i as pe}from"./SearchMd-Dvn1Eo76.js";import{u as he}from"./useQuery-CqT-L2b-.js";import{u as Le}from"./useInfiniteQuery-qwQj5SMK.js";import{a as Fe,f as Ee,b as Oe}from"./registry-utils-DSUIffwE.js";import{u as je,W as Ke,a as _e,h as Ae,b as Me}from"./constants-9bKBT988.js";import{f as Be,g as ye,h as De}from"./use-connection-DXequUdB.js";import{s as Ge}from"./slugify-CEUa2lfQ.js";import{C as We}from"./collection-search-WzmN-NEH.js";import{M as ae}from"./mcp-server-card-uS3QofMZ.js";import{c as ie,B as Y}from"./button-BxOn_P7A.js";import{I as Ve}from"./input-D3a40-af.js";import{b as ve,P as be,a as Ne}from"./popover-O7pPZSal.js";import{i as Ce}from"./Check-BEIYk4IG.js";import{t as Se}from"./ChevronDown-DDsgD0_a.js";import{s as te}from"./XClose-Cpw_0BW6.js";import{s as qe}from"./Plus-Ck954sGm.js";import{E as Ue}from"./empty-state-C7VZap1W.js";import{u as He}from"./use-binding-oEpPFbv0.js";import{L as Je,u as Qe}from"./localstorage-keys-Xr0m_-Nl.js";import{E as Ye}from"./error-boundary-BpCU-F5d.js";import"./use-mobile-CYG2M3Mj.js";import"./tooltip-B7RjBzxU.js";import"./ChevronRight-dj0VUAfs.js";import"./infiniteQueryObserver-45WqMl59.js";import"./useMutation-8rEyObWg.js";import"./CheckVerified02-DFKFrqtt.js";import"./Globe02-DXh1wFnz.js";import"./Lock01-C4Sc75k7.js";import"./Terminal-DQESGxaj.js";import"./card-DMS-g9Fe.js";import"./integration-icon-6FQvxTss.js";import"./Container-BY7Dg1ME.js";import"./github-icon-Dp3wHhYE.js";import"./binder-BeV9Iq0g.js";function Ze(s,e){const r=Q.c(4),[l,m]=U.useState(s),n=U.useRef(null),o=U.useRef(!0);let c,a;return r[0]!==e||r[1]!==s?(c=()=>{if(o.current){o.current=!1;return}return n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{m(s)},e),()=>{n.current&&clearTimeout(n.current)}},a=[s,e],r[0]=e,r[1]=s,r[2]=c,r[3]=a):(c=r[2],a=r[3]),U.useEffect(c,a),l}function Xe(s){const e=Q.c(14),r=U.useRef(null),l=`scroll-position:${s}`,m=U.useRef(null);let n;e[0]!==l?(n=()=>{r.current&&sessionStorage.setItem(l,String(r.current.scrollTop))},e[0]=l,e[1]=n):n=e[1];const o=n;let c;e[2]!==l?(c=()=>{if(m.current===l)return;const j=sessionStorage.getItem(l);if(j&&r.current){const S=Number.parseInt(j,10);r.current.scrollTop=S}m.current=l},e[2]=l,e[3]=c):c=e[3];const a=c;let g;e[4]!==a||e[5]!==l?(g=()=>{m.current!==l&&a()},e[4]=a,e[5]=l,e[6]=g):g=e[6];const I=g;let i;e[7]!==a||e[8]!==l?(i=j=>{r.current=j,j&&m.current!==l&&requestAnimationFrame(()=>{a()})},e[7]=a,e[8]=l,e[9]=i):i=e[9];const p=i;let d;return e[10]!==I||e[11]!==o||e[12]!==p?(d={scrollRef:p,saveScrollPosition:o,handleScroll:I},e[10]=I,e[11]=o,e[12]=p,e[13]=d):d=e[13],d}const et=24;function tt(s){const e=Q.c(54),{registryId:r,listToolName:l,filtersToolName:m,search:n}=s,{org:o}=re();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=[],e[0]=c):c=e[0];const[a,g]=U.useState(c);let I;e[1]===Symbol.for("react.memo_cache_sentinel")?(I=[],e[1]=I):I=e[1];const[i,p]=U.useState(I),d=r||null;let j;e[2]!==o.id||e[3]!==d?(j={connectionId:d,orgId:o.id},e[2]=o.id,e[3]=d,e[4]=j):j=e[4];const S=je(j),R=!!m;let b;e[5]!==m||e[6]!==r?(b=oe.toolCall(r,m||"no-filters","{}"),e[5]=m,e[6]=r,e[7]=b):b=e[7];let N;e[8]!==S||e[9]!==m?(N=async()=>{if(!m)return{tags:[],categories:[]};const f=await S.callTool({name:m,arguments:{}});return f.structuredContent??f},e[8]=S,e[9]=m,e[10]=N):N=e[10];let P;e[11]!==b||e[12]!==N?(P={queryKey:b,queryFn:N,staleTime:36e5,retry:2},e[11]=b,e[12]=N,e[13]=P):P=e[13];const{data:$}=he(P);let h,C,k;if(e[14]!==l||e[15]!==r||e[16]!==n||e[17]!==i||e[18]!==a){const f=n?.trim()?{operator:"or",conditions:[{field:["name"],operator:"contains",value:n},{field:["title"],operator:"contains",value:n},{field:["description"],operator:"contains",value:n}]}:void 0;h={limit:et,...a.length>0&&{tags:a},...i.length>0&&{categories:i},...f&&{where:f}},k=Le,C=oe.toolCall(r,l,JSON.stringify(h)),e[14]=l,e[15]=r,e[16]=n,e[17]=i,e[18]=a,e[19]=h,e[20]=C,e[21]=k}else h=e[19],C=e[20],k=e[21];let v;e[22]!==S||e[23]!==h||e[24]!==l?(v=async f=>{const{pageParam:Z}=f,le=Z?{...h,cursor:Z}:h,ee=await S.callTool({name:l,arguments:le});return ee.structuredContent??ee},e[22]=S,e[23]=h,e[24]=l,e[25]=v):v=e[25];let z;e[26]!==v||e[27]!==C?(z={queryKey:C,queryFn:v,initialPageParam:void 0,getNextPageParam:st,staleTime:36e5,placeholderData:we,retry:2},e[26]=v,e[27]=C,e[28]=z):z=e[28];const{data:w,fetchNextPage:x,hasNextPage:y,isFetchingNextPage:u,isFetching:T,isLoading:L,error:F}=k(z);let K;e:{if(!w?.pages||w.pages.length===0){K=null;break e}const f=w.pages[0];if(typeof f=="object"&&f!==null&&"totalCount"in f&&typeof f.totalCount=="number"){K=f.totalCount;break e}K=null}const _=K,E=w?.pages;let G;e[29]!==E?(G=Fe(E),e[29]=E,e[30]=G):G=e[30];const H=G;let W;e[31]!==n||e[32]!==i.length||e[33]!==a.length?(W=a.length>0||i.length>0||!!n?.trim(),e[31]=n,e[32]=i.length,e[33]=a.length,e[34]=W):W=e[34];const D=W,B=T&&!u&&!L&&D;let A;e[35]!==x||e[36]!==y||e[37]!==u?(A=()=>{y&&!u&&x()},e[35]=x,e[36]=y,e[37]=u,e[38]=A):A=e[38];const V=A,O=y??!1,M=R?$?.tags:void 0,q=R?$?.categories:void 0;let J;return e[39]!==D||e[40]!==T||e[41]!==u||e[42]!==B||e[43]!==L||e[44]!==H||e[45]!==F||e[46]!==V||e[47]!==i||e[48]!==a||e[49]!==O||e[50]!==M||e[51]!==q||e[52]!==_?(J={items:H,totalCount:_,hasMore:O,isLoadingMore:u,isFiltering:B,isInitialLoading:L,isFetching:T,error:F,loadMore:V,availableTags:M,availableCategories:q,selectedTags:a,selectedCategories:i,setSelectedTags:g,setSelectedCategories:p,hasActiveFilters:D},e[39]=D,e[40]=T,e[41]=u,e[42]=B,e[43]=L,e[44]=H,e[45]=F,e[46]=V,e[47]=i,e[48]=a,e[49]=O,e[50]=M,e[51]=q,e[52]=_,e[53]=J):J=e[53],J}function st(s){if(typeof s=="object"&&s!==null){const e=s.nextCursor||s.cursor;if(e)return e}}function rt(s,e){return[...s].sort((r,l)=>l.count-r.count).slice(0,e)}function ce(s){const e=Q.c(52),{label:r,items:l,selectedItems:m,onToggle:n,onClear:o}=s,[c,a]=U.useState(""),[g,I]=U.useState(!1);let i,p,d,j,S,R,b,N,P,$,h;if(e[0]!==l||e[1]!==r||e[2]!==n||e[3]!==g||e[4]!==c||e[5]!==m){const x=[...c?l.filter(E=>E.value.toLowerCase().includes(c.toLowerCase())):l].sort(lt);d=m.length,p=ve,P=g,$=I;let y;e[17]!==r?(y=t.jsx("span",{children:r}),e[17]=r,e[18]=y):y=e[18];let u;e[19]!==d?(u=d>0&&t.jsx("span",{className:"ml-1 rounded-full bg-primary text-primary-foreground px-1.5 py-0.5 text-[10px] font-medium",children:d}),e[19]=d,e[20]=u):u=e[20];let T;e[21]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(Se,{size:14,className:"opacity-50"}),e[21]=T):T=e[21],e[22]!==u||e[23]!==y?(h=t.jsx(be,{asChild:!0,children:t.jsxs(Y,{variant:"outline",size:"sm",className:"h-7 px-3 gap-1.5 text-xs font-normal flex-1",children:[y,u,T]})}),e[22]=u,e[23]=y,e[24]=h):h=e[24],i=Ne,R="w-64 p-0",b="start";let L;e[25]===Symbol.for("react.memo_cache_sentinel")?(L=t.jsx(pe,{size:16,className:"text-muted-foreground shrink-0"}),e[25]=L):L=e[25];let F;e[26]!==r?(F=r.toLowerCase(),e[26]=r,e[27]=F):F=e[27];const K=`Search ${F}...`;let _;e[28]===Symbol.for("react.memo_cache_sentinel")?(_=E=>a(E.target.value),e[28]=_):_=e[28],e[29]!==c||e[30]!==K?(N=t.jsx("div",{className:"shrink-0 w-full border-b border-border h-10",children:t.jsxs("label",{className:"flex items-center gap-2.5 h-10 px-4 cursor-text",children:[L,t.jsx(Ve,{type:"text",placeholder:K,value:c,onChange:_,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[29]=c,e[30]=K,e[31]=N):N=e[31],j="max-h-64 overflow-y-auto p-1 flex flex-col gap-1",S=x.length===0?t.jsx("div",{className:"px-2 py-4 text-sm text-muted-foreground text-center",children:"No results found"}):x.map(E=>{const G=m.includes(E.value);return t.jsxs("button",{onClick:()=>n(E.value),className:ie("w-full flex items-center justify-between px-2 py-1.5 text-sm rounded cursor-pointer transition-colors",G?"bg-accent/50 text-foreground":"hover:bg-muted text-foreground"),children:[t.jsxs("span",{className:"truncate flex items-center gap-2",children:[G&&t.jsx(Ce,{size:16,className:"text-muted-foreground shrink-0"}),E.value]}),t.jsx("span",{className:"text-xs text-muted-foreground ml-2 shrink-0",children:E.count})]},E.value)}),e[0]=l,e[1]=r,e[2]=n,e[3]=g,e[4]=c,e[5]=m,e[6]=i,e[7]=p,e[8]=d,e[9]=j,e[10]=S,e[11]=R,e[12]=b,e[13]=N,e[14]=P,e[15]=$,e[16]=h}else i=e[6],p=e[7],d=e[8],j=e[9],S=e[10],R=e[11],b=e[12],N=e[13],P=e[14],$=e[15],h=e[16];let C;e[32]!==j||e[33]!==S?(C=t.jsx("div",{className:j,children:S}),e[32]=j,e[33]=S,e[34]=C):C=e[34];let k;e[35]!==r||e[36]!==o||e[37]!==d?(k=d>0&&t.jsx("div",{className:"p-2 border-t border-border",children:t.jsxs(Y,{variant:"ghost",size:"sm",onClick:o,className:"w-full text-xs text-muted-foreground hover:text-foreground",children:["Clear ",r.toLowerCase()]})}),e[35]=r,e[36]=o,e[37]=d,e[38]=k):k=e[38];let v;e[39]!==i||e[40]!==k||e[41]!==R||e[42]!==b||e[43]!==N||e[44]!==C?(v=t.jsxs(i,{className:R,align:b,children:[N,C,k]}),e[39]=i,e[40]=k,e[41]=R,e[42]=b,e[43]=N,e[44]=C,e[45]=v):v=e[45];let z;return e[46]!==p||e[47]!==v||e[48]!==P||e[49]!==$||e[50]!==h?(z=t.jsxs(p,{open:P,onOpenChange:$,children:[h,v]}),e[46]=p,e[47]=v,e[48]=P,e[49]=$,e[50]=h,e[51]=z):z=e[51],z}function lt(s,e){return e.count-s.count}function nt(s){const e=Q.c(67),{availableTags:r,availableCategories:l,selectedTags:m,selectedCategories:n,onTagChange:o,onCategoryChange:c}=s,a=r&&r.length>0||l&&l.length>0,g=m.length>0||n.length>0;if(!a)return null;let I;e[0]!==o||e[1]!==m?(I=y=>{m.includes(y)?o(m.filter(u=>u!==y)):o([...m,y])},e[0]=o,e[1]=m,e[2]=I):I=e[2];const i=I;let p;e[3]!==c||e[4]!==n?(p=y=>{n.includes(y)?c(n.filter(u=>u!==y)):c([...n,y])},e[3]=c,e[4]=n,e[5]=p):p=e[5];const d=p;let j;e[6]!==c||e[7]!==o?(j=()=>{o([]),c([])},e[6]=c,e[7]=o,e[8]=j):j=e[8];const S=j;let R,b,N,P,$,h,C;if(e[9]!==l||e[10]!==r||e[11]!==c||e[12]!==o||e[13]!==n||e[14]!==m||e[15]!==d||e[16]!==i){const y=l?rt(l,6):[];R=n,b=m,C=new Set(y.map(ot)),$="flex items-center border-b border-border";let u;e[24]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("div",{className:"flex items-center gap-2 text-muted-foreground",children:t.jsx(fe,{size:16})}),e[24]=u):u=e[24];let T;e[25]!==l||e[26]!==c||e[27]!==n||e[28]!==d?(T=l&&l.length>0&&t.jsx(ce,{label:"Categories",items:l,selectedItems:n,onToggle:d,onClear:()=>c([])}),e[25]=l,e[26]=c,e[27]=n,e[28]=d,e[29]=T):T=e[29];let L;e[30]!==r||e[31]!==o||e[32]!==m||e[33]!==i?(L=r&&r.length>0&&t.jsx(ce,{label:"Tags",items:r,selectedItems:m,onToggle:i,onClear:()=>o([])}),e[30]=r,e[31]=o,e[32]=m,e[33]=i,e[34]=L):L=e[34],e[35]!==L||e[36]!==T?(h=t.jsxs("div",{className:"flex items-center gap-3 flex-wrap px-5 py-3 border-r border-border",children:[u,T,L]}),e[35]=L,e[36]=T,e[37]=h):h=e[37],N="flex items-center gap-3 flex-wrap px-5 py-3";let F;e[38]!==n||e[39]!==d?(F=K=>{const _=n.includes(K.value);return t.jsxs("div",{onClick:()=>d(K.value),className:ie("inline-flex items-center gap-1 text-xs px-2.5 py-1 rounded-full transition-colors cursor-pointer",_?"bg-primary text-primary-foreground hover:bg-primary/80":"bg-muted hover:bg-accent text-muted-foreground"),children:[t.jsx("span",{children:K.value}),_&&t.jsx("span",{onClick:E=>{E.stopPropagation(),d(K.value)},className:"hover:bg-primary/20 rounded-full p-0.5 -mr-1 cursor-pointer flex items-center",children:t.jsx(te,{size:12})})]},K.value)},e[38]=n,e[39]=d,e[40]=F):F=e[40],P=y.map(F),e[9]=l,e[10]=r,e[11]=c,e[12]=o,e[13]=n,e[14]=m,e[15]=d,e[16]=i,e[17]=R,e[18]=b,e[19]=N,e[20]=P,e[21]=$,e[22]=h,e[23]=C}else R=e[17],b=e[18],N=e[19],P=e[20],$=e[21],h=e[22],C=e[23];let k;if(e[41]!==R||e[42]!==d||e[43]!==C){let y;e[45]!==C?(y=T=>!C.has(T),e[45]=C,e[46]=y):y=e[46];let u;e[47]!==d?(u=T=>t.jsxs("div",{onClick:()=>d(T),className:"inline-flex items-center gap-1 text-xs px-2.5 py-1 rounded-full transition-colors cursor-pointer bg-primary text-primary-foreground hover:bg-accent/50",children:[t.jsx("span",{children:T}),t.jsx("span",{onClick:L=>{L.stopPropagation(),d(T)},className:"hover:bg-primary/20 rounded-full p-0.5 -mr-1 cursor-pointer flex items-center",children:t.jsx(te,{size:12})})]},`cat-${T}`),e[47]=d,e[48]=u):u=e[48],k=R.filter(y).map(u),e[41]=R,e[42]=d,e[43]=C,e[44]=k}else k=e[44];let v;if(e[49]!==b||e[50]!==i){let y;e[52]!==i?(y=u=>t.jsxs("div",{onClick:()=>i(u),className:"inline-flex items-center gap-1 text-xs px-2.5 py-1 rounded-full transition-colors cursor-pointer bg-primary text-primary-foreground hover:bg-accent/50",children:[t.jsx("span",{children:u}),t.jsx("span",{onClick:T=>{T.stopPropagation(),i(u)},className:"hover:bg-primary/20 rounded-full p-0.5 -mr-1 cursor-pointer flex items-center",children:t.jsx(te,{size:12})})]},`tag-${u}`),e[52]=i,e[53]=y):y=e[53],v=b.map(y),e[49]=b,e[50]=i,e[51]=v}else v=e[51];let z;e[54]!==S||e[55]!==g?(z=g&&t.jsxs(Y,{variant:"ghost",size:"sm",onClick:S,className:"h-7 text-xs text-muted-foreground hover:text-foreground gap-1 px-2",children:[t.jsx(te,{size:14}),"Clear all"]}),e[54]=S,e[55]=g,e[56]=z):z=e[56];let w;e[57]!==z||e[58]!==N||e[59]!==P||e[60]!==k||e[61]!==v?(w=t.jsxs("div",{className:N,children:[P,k,v,z]}),e[57]=z,e[58]=N,e[59]=P,e[60]=k,e[61]=v,e[62]=w):w=e[62];let x;return e[63]!==w||e[64]!==$||e[65]!==h?(x=t.jsxs("div",{className:$,children:[h,w]}),e[63]=w,e[64]=$,e[65]=h,e[66]=x):x=e[66],x}function ot(s){return s.value}function it(s,e){if(!e)return s;const r=e.toLowerCase();return s.filter(l=>(l.name||l.title||"").toLowerCase().includes(r)||(l.description||l.server?.description||"").toLowerCase().includes(r))}function at(s){return s.verified===!0||s._meta?.["mcp.mesh"]?.verified===!0}function ct(s){const e=Q.c(55),{registryId:r,listToolName:l,filtersToolName:m,storePrivateOnly:n}=s,[o,c]=U.useState(""),a=Ze(o,300),g=me(),{org:I}=re(),{scrollRef:i,saveScrollPosition:p,handleScroll:d}=Xe(`store-discovery:${r}`);let j;e[0]!==a||e[1]!==m||e[2]!==l||e[3]!==r?(j={registryId:r,listToolName:l,filtersToolName:m,search:a},e[0]=a,e[1]=m,e[2]=l,e[3]=r,e[4]=j):j=e[4];const{items:S,hasMore:R,isLoadingMore:b,isInitialLoading:N,isFetching:P,error:$,loadMore:h,availableTags:C,availableCategories:k,selectedTags:v,selectedCategories:z,setSelectedTags:w,setSelectedCategories:x,hasActiveFilters:y}=tt(j);let u,T,L,F;if(e[5]!==a||e[6]!==P||e[7]!==N||e[8]!==S||e[9]!==o||e[10]!==n){const O=o?it(S,o):S;F=n?O.filter(dt):O,u=(o!==a||P)&&!N&&!!o,L=F.filter(at),T=F.filter(M=>!L.find(q=>q.id===M.id)),e[5]=a,e[6]=P,e[7]=N,e[8]=S,e[9]=o,e[10]=n,e[11]=u,e[12]=T,e[13]=L,e[14]=F}else u=e[11],T=e[12],L=e[13],F=e[14];const K=T;let _;e[15]!==g||e[16]!==I.slug||e[17]!==r||e[18]!==p?(_=O=>{p();const M=Ge(O.name||O.title||O.server?.title||""),q=typeof O.id=="string"&&O.id.includes("/"),J=typeof O.server?.name=="string"&&O.server.name.includes("/"),f=q&&!J?O.id:O.server?.name||O.id||"";g({to:"/$org/$project/store/$appName",params:{org:I.slug,project:de,appName:M},search:{registryId:r,serverName:f}})},e[15]=g,e[16]=I.slug,e[17]=r,e[18]=p,e[19]=_):_=e[19];const E=_;let G;e[20]!==d||e[21]!==R||e[22]!==b||e[23]!==h?(G=O=>{if(d(),!R||b)return;const M=O.currentTarget;M.scrollHeight-M.scrollTop-M.clientHeight<200&&h()},e[20]=d,e[21]=R,e[22]=b,e[23]=h,e[24]=G):G=e[24];const H=G;let W;e[25]!==u||e[26]!==o?(W=t.jsx(We,{value:o,onChange:c,placeholder:"Search for an MCP Server...",isSearching:u}),e[25]=u,e[26]=o,e[27]=W):W=e[27];let D;e[28]!==k||e[29]!==C||e[30]!==z||e[31]!==v||e[32]!==x||e[33]!==w?(D=t.jsx(nt,{availableTags:C,availableCategories:k,selectedTags:v,selectedCategories:z,onTagChange:w,onCategoryChange:x}),e[28]=k,e[29]=C,e[30]=z,e[31]=v,e[32]=x,e[33]=w,e[34]=D):D=e[34];let B;e[35]!==K||e[36]!==$||e[37]!==E||e[38]!==y||e[39]!==R||e[40]!==N||e[41]!==b||e[42]!==u||e[43]!==o||e[44]!==L||e[45]!==F?(B=t.jsx("div",{className:"p-5",children:t.jsx("div",{children:$&&!N?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center space-y-4",children:[t.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:t.jsx(ue,{className:"size-8 text-destructive"})}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("h3",{className:"text-lg font-medium",children:"Registry unavailable"}),t.jsx("p",{className:"text-sm text-muted-foreground max-w-sm mx-auto",children:"Could not load items from this registry. It may be temporarily offline."}),$.message&&t.jsx("p",{className:"text-xs text-muted-foreground/60 font-mono max-w-md mx-auto truncate",children:$.message})]}),t.jsxs(Y,{variant:"outline",size:"sm",onClick:mt,children:[t.jsx(ge,{className:"size-4"}),"Try again"]})]}):N?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[t.jsx(se,{size:32,className:"animate-spin text-muted-foreground mb-4"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading items..."})]}):F.length===0&&!y?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[t.jsx(xe,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"No items available"}),t.jsx("p",{className:"text-muted-foreground",children:"This store doesn't have any available items yet."})]}):F.length===0&&y&&!o?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[t.jsx(fe,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"No matching items"}),t.jsx("p",{className:"text-muted-foreground",children:"Try adjusting your filters to find more results."})]}):o&&F.length===0&&!u?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[t.jsx(pe,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"No results found"}),t.jsx("p",{className:"text-muted-foreground",children:"Try adjusting your search terms."})]}):t.jsxs("div",{className:"flex flex-col gap-8",children:[u&&F.length===0&&t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[t.jsx(se,{size:32,className:"animate-spin text-muted-foreground mb-4"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Searching..."})]}),L.length>0&&t.jsx(ae,{items:L,title:"Verified",onItemClick:E}),K.length>0&&t.jsx(ae,{items:K,title:L.length>0?"All":"",onItemClick:E}),R&&b&&t.jsx("div",{className:"flex justify-center py-8",children:t.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[t.jsx(se,{size:20,className:"animate-spin"}),t.jsx("span",{className:"text-sm",children:"Loading more items..."})]})})]})})}),e[35]=K,e[36]=$,e[37]=E,e[38]=y,e[39]=R,e[40]=N,e[41]=b,e[42]=u,e[43]=o,e[44]=L,e[45]=F,e[46]=B):B=e[46];let A;e[47]!==H||e[48]!==i||e[49]!==B?(A=t.jsx("div",{ref:i,className:"flex-1 overflow-y-auto",onScroll:H,children:B}),e[47]=H,e[48]=i,e[49]=B,e[50]=A):A=e[50];let V;return e[51]!==W||e[52]!==D||e[53]!==A?(V=t.jsxs("div",{className:"flex flex-col h-full",children:[W,D,A]}),e[51]=W,e[52]=D,e[53]=A,e[54]=V):V=e[54],V}function mt(){return window.location.reload()}function dt(s){return s.is_public!==!0}function ut(s){const e=Q.c(11),{registryId:r,storePrivateOnly:l}=s,m=Be(r),n=m?.tools;let o;e[0]!==n?(o=Ee(n),e[0]=n,e[1]=o):o=e[1];const c=o;if(!c){let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("div",{className:"bg-muted p-3 rounded-full",children:t.jsx(xe,{className:"size-8 text-muted-foreground"})}),e[2]=d):d=e[2];let j;return e[3]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full py-12 text-center space-y-4",children:[d,t.jsxs("div",{className:"space-y-2",children:[t.jsx("h3",{className:"text-lg font-medium",children:"Registry not available"}),t.jsx("p",{className:"text-sm text-muted-foreground max-w-sm mx-auto",children:"This registry does not support listing store items, or the connection is not responding."})]})]}),e[3]=j):j=e[3],j}const a=m?.tools;let g;e[4]!==a?(g=Oe(a),e[4]=a,e[5]=g):g=e[5];const i=g||void 0;let p;return e[6]!==c||e[7]!==r||e[8]!==l||e[9]!==i?(p=t.jsx(ct,{registryId:r,listToolName:c,filtersToolName:i,storePrivateOnly:l}),e[6]=c,e[7]=r,e[8]=l,e[9]=i,e[10]=p):p=e[10],p}function ft(s){const e=Q.c(43),{registries:r,value:l,onValueChange:m,onAddWellKnown:n,wellKnownRegistries:o,placeholder:c}=s,a=c===void 0?"Select a registry...":c,[g,I]=U.useState(!1);let i,p,d,j,S,R,b,N;if(e[0]!==g||e[1]!==a||e[2]!==r||e[3]!==l){let w;e[12]!==l?(w=y=>y.id===l,e[12]=l,e[13]=w):w=e[13];const x=r.find(w);p=ve,b=g,N=I,i=be,R=!0,d="button",e[14]===Symbol.for("react.memo_cache_sentinel")?(j=ie("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 hover:bg-accent hover:text-accent-foreground dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-lg border bg-transparent px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[3px] h-7 min-w-[160px]"),e[14]=j):j=e[14],S=x?t.jsxs("span",{className:"flex items-center gap-2",children:[x.icon?t.jsx("img",{src:x.icon,alt:x.name,className:"w-4 h-4 rounded"}):t.jsx("span",{className:"w-4 h-4 rounded from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:x.name.slice(0,1).toUpperCase()}),t.jsx("span",{children:x.name})]}):t.jsx("span",{className:"text-muted-foreground",children:a}),e[0]=g,e[1]=a,e[2]=r,e[3]=l,e[4]=i,e[5]=p,e[6]=d,e[7]=j,e[8]=S,e[9]=R,e[10]=b,e[11]=N}else i=e[4],p=e[5],d=e[6],j=e[7],S=e[8],R=e[9],b=e[10],N=e[11];let P;e[15]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(Se,{className:"size-4 opacity-50"}),e[15]=P):P=e[15];let $;e[16]!==d||e[17]!==j||e[18]!==S?($=t.jsxs("button",{type:d,className:j,children:[S,P]}),e[16]=d,e[17]=j,e[18]=S,e[19]=$):$=e[19];let h;e[20]!==i||e[21]!==R||e[22]!==$?(h=t.jsx(i,{asChild:R,children:$}),e[20]=i,e[21]=R,e[22]=$,e[23]=h):h=e[23];let C;if(e[24]!==m||e[25]!==r||e[26]!==l){let w;e[28]!==m||e[29]!==l?(w=x=>t.jsxs("button",{type:"button",onClick:()=>{m(x.id??x.name),I(!1)},className:"relative flex w-full cursor-pointer items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none hover:bg-accent hover:text-accent-foreground",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[x.icon?t.jsx("img",{src:x.icon,alt:x.name,className:"w-4 h-4 rounded"}):t.jsx("span",{className:"w-4 h-4 rounded from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:x.name.slice(0,1).toUpperCase()}),t.jsx("span",{children:x.name})]}),l===(x.id??x.name)&&t.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:t.jsx(Ce,{className:"size-4"})})]},x.id??x.name),e[28]=m,e[29]=l,e[30]=w):w=e[30],C=r.map(w),e[24]=m,e[25]=r,e[26]=l,e[27]=C}else C=e[27];let k;e[31]!==n||e[32]!==o?(k=o.length>0&&t.jsxs("div",{className:"border-t border-border pt-1 mt-1",children:[t.jsx("p",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground",children:"Other known registries"}),o.map(w=>t.jsxs("button",{type:"button",onClick:()=>{n(w),I(!1)},className:"relative flex w-full cursor-pointer items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none hover:bg-accent hover:text-accent-foreground",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[w.icon?t.jsx("img",{src:w.icon,alt:w.title,className:"w-4 h-4 rounded"}):t.jsx("span",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:w.title.slice(0,1).toUpperCase()}),t.jsx("span",{className:"flex-1",children:w.title})]}),t.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center text-muted-foreground",children:t.jsx(qe,{size:16})})]},w.id??w.title))]}),e[31]=n,e[32]=o,e[33]=k):k=e[33];let v;e[34]!==C||e[35]!==k?(v=t.jsxs(Ne,{align:"end",className:"w-auto min-w-[200px] p-1",children:[C,k]}),e[34]=C,e[35]=k,e[36]=v):v=e[36];let z;return e[37]!==p||e[38]!==h||e[39]!==v||e[40]!==b||e[41]!==N?(z=t.jsxs(p,{open:b,onOpenChange:N,children:[h,v]}),e[37]=p,e[38]=h,e[39]=v,e[40]=b,e[41]=N,e[42]=z):z=e[42],z}function xt({registries:s,onConnected:e}){const r=ye(),{org:{slug:l}}=re(),{data:m}=Ie.useSession(),n=me(),[o,c]=U.useState(!1),a=s[0],g=async()=>{if(!(!a||!m?.user?.id)){c(!0);try{const i=await r.create.mutateAsync(a);e?.(i.id)}finally{c(!1)}}},I=()=>{n({to:"/$org/$project/mcps",params:{org:l,project:de},search:{action:"create"}})};return t.jsx(Ue,{image:t.jsx("img",{src:"/store-empty-state.svg",alt:"No store connected",width:336,height:320,className:"max-w-full h-auto"}),title:"Connect to registry",description:"Connect to discover and use Connections from the community.",actions:t.jsxs(t.Fragment,{children:[t.jsxs(Y,{variant:"outline",onClick:g,disabled:o||!a,children:[a?.icon&&t.jsx("img",{src:a.icon,alt:"",className:"size-4"}),o?"Installing...":"Install Registry"]}),t.jsx(Y,{variant:"outline",onClick:I,children:"Custom Connection"})]})})}function gt(s){const e=Q.c(15),{error:r,onRetry:l,registryName:m}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:t.jsx(ue,{className:"h-6 w-6 text-destructive"})}),e[0]=n):n=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("h3",{className:"text-lg font-medium",children:"Unable to load store"}),e[1]=o):o=e[1];let c;e[2]!==m?(c=t.jsxs("p",{className:"text-sm text-muted-foreground max-w-sm mx-auto",children:["The ",t.jsx("strong",{children:m})," registry is currently unreachable. This may be a temporary issue — try again in a moment."]}),e[2]=m,e[3]=c):c=e[3];let a;e[4]!==r?(a=r?.message&&t.jsx("p",{className:"text-xs text-muted-foreground/60 font-mono max-w-md mx-auto truncate",children:r.message}),e[4]=r,e[5]=a):a=e[5];let g;e[6]!==c||e[7]!==a?(g=t.jsxs("div",{className:"space-y-2",children:[o,c,a]}),e[6]=c,e[7]=a,e[8]=g):g=e[8];let I;e[9]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(ge,{className:"size-4"}),e[9]=I):I=e[9];let i;e[10]!==l?(i=t.jsxs(Y,{variant:"outline",size:"sm",onClick:l,children:[I,"Try again"]}),e[10]=l,e[11]=i):i=e[11];let p;return e[12]!==g||e[13]!==i?(p=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-6 text-center space-y-4",children:[n,g,i]}),e[12]=g,e[13]=i,e[14]=p):p=e[14],p}function os(){const s=Q.c(49),{org:e,project:r}=re(),l=De(),m=ye(),n=Te(),o=n.location.pathname.includes("/store/")&&n.location.pathname.split("/").length>3,c=He(l);let a;s[0]!==e.id?(a=Ke.SELF(e.id),s[0]=e.id,s[1]=a):a=s[1];const g=a,I=r.enabledPlugins,i=I==null||I.includes(ne),p=c.filter(f=>f.id!==g?!0:i);let d;s[2]!==g?(d=f=>f.id===g,s[2]=g,s[3]=d):d=s[3];const j=p.some(d);let S;s[4]!==e.id?(S={connectionId:_e,orgId:e.id},s[4]=e.id,s[5]=S):S=s[5];const R=je(S);let b;s[6]!==r.id||s[7]!==R?(b=async()=>{const f=await R.callTool({name:"PROJECT_PLUGIN_CONFIG_GET",arguments:{projectId:r.id,pluginId:ne}});return f.structuredContent??f},s[6]=r.id,s[7]=R,s[8]=b):b=s[8];const{data:N}=he({queryKey:oe.projectPluginConfig(r.id??"",ne),queryFn:b,enabled:j&&!!r.id,staleTime:6e4}),P=N?.config?.settings;let $;s[9]!==P||s[10]!==g?($=f=>f.id===g&&P?{id:f.id,name:P.registryName||f.title,icon:P.registryIcon||f.icon||void 0}:{id:f.id,name:f.title,icon:f.icon||void 0},s[9]=P,s[10]=g,s[11]=$):$=s[11];const h=p.map($);let C;s[12]!==e.slug?(C=Je.selectedRegistry(e.slug),s[12]=e.slug,s[13]=C):C=s[13];const[k,v]=Qe(C,ht);let z;s[14]!==k?(z=f=>f.id===k,s[14]=k,s[15]=z):z=s[15];const x=p.find(z)?.id||p[0]?.id||"",y=x===g&&P?.storePrivateOnly===!0;let u;s[16]!==e.id?(u=Ae(e.id),s[16]=e.id,s[17]=u):u=s[17];let T;s[18]!==u?(T=[u],s[18]=u,s[19]=T):T=s[19];const L=T;let F;s[20]===Symbol.for("react.memo_cache_sentinel")?(F=[Me()],s[20]=F):F=s[20];const K=F;let _;s[21]!==m.create||s[22]!==v?(_=async f=>{const Z=await m.create.mutateAsync(f);v(Z.id)},s[21]=m.create,s[22]=v,s[23]=_):_=s[23];const E=_,G=new Set(p.map(pt)),H=L.filter(f=>f.id&&!G.has(f.id)),W=K.filter(f=>f.id&&!G.has(f.id));if(o){let f;return s[24]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(Re,{}),s[24]=f):f=s[24],f}let D;s[25]===Symbol.for("react.memo_cache_sentinel")?(D=t.jsx(X.Header.Left,{children:t.jsx(Pe,{children:t.jsx($e,{children:t.jsx(ke,{children:t.jsx(ze,{children:"Store"})})})})}),s[25]=D):D=s[25];let B;s[26]!==E?(B=async f=>E(f),s[26]=E,s[27]=B):B=s[27];let A;s[28]!==H||s[29]!==x||s[30]!==h||s[31]!==v||s[32]!==B?(A=t.jsxs(X.Header,{children:[D,t.jsx(X.Header.Right,{children:t.jsx(ft,{wellKnownRegistries:H,registries:h,value:x,onValueChange:v,onAddWellKnown:B,placeholder:"Select store..."})})]}),s[28]=H,s[29]=x,s[30]=h,s[31]=v,s[32]=B,s[33]=A):A=s[33];let V;s[34]!==x||s[35]!==h?(V=f=>{const{error:Z,resetError:le}=f;return t.jsx(gt,{error:Z,onRetry:le,registryName:h.find(ee=>ee.id===x)?.name??"registry"})},s[34]=x,s[35]=h,s[36]=V):V=s[36];let O;s[37]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[t.jsx(se,{size:32,className:"animate-spin text-muted-foreground mb-4"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading store items..."})]}),s[37]=O):O=s[37];let M;s[38]!==W||s[39]!==x||s[40]!==v||s[41]!==y?(M=t.jsx(U.Suspense,{fallback:O,children:x?t.jsx(ut,{registryId:x,storePrivateOnly:y}):t.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:t.jsx(xt,{registries:W,onConnected:f=>{v(f)}})})}),s[38]=W,s[39]=x,s[40]=v,s[41]=y,s[42]=M):M=s[42];let q;s[43]!==V||s[44]!==M?(q=t.jsx(X.Content,{children:t.jsx(Ye,{fallback:V,children:M})}),s[43]=V,s[44]=M,s[45]=q):q=s[45];let J;return s[46]!==A||s[47]!==q?(J=t.jsxs(X,{children:[A,q]}),s[46]=A,s[47]=q,s[48]=J):J=s[48],J}function pt(s){return s.id}function ht(s){return s??""}export{os as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as b,c as y,j as s,u as oe,d as ae,t as Y}from"./index-DQipirM0.js";import{V as ce,C as j}from"./index-CIUI9_Ip.js";import{T as me,i as de,a as fe,t as ue}from"./typewriter-title-CkssIeLy.js";import{E as pe}from"./error-boundary-BpCU-F5d.js";import{u as ee,b as he}from"./context-LmNUO0nU.js";import{I as te}from"./integration-icon-6FQvxTss.js";import{P as xe,a as je,b as ge}from"./popover-O7pPZSal.js";import{S as X}from"./skeleton-D-Lsp11A.js";import{c as se,B as H}from"./button-BxOn_P7A.js";import{i as be,d as ye}from"./constants-9bKBT988.js";import{b as Ne}from"./use-virtual-mcp-Bq4iD2DN.js";import{i as _e}from"./ChevronRight-dj0VUAfs.js";import{t as ie}from"./Users03-DJ0q7ZN3.js";import{P as A}from"./index-DlglR7Dv.js";import{a as U,b as J,T as Q}from"./tooltip-B7RjBzxU.js";import{c as Se}from"./Pin01-BE9Oh0sU.js";import{s as ve}from"./Plus-Ck954sGm.js";import"./spinner-BL4ZMZYA.js";import"./use-mcp-prompts-CqOiamVC.js";import"./useQuery-CqT-L2b-.js";import"./dialog-8Qx5GCEw.js";import"./form-Dn5Ilwyi.js";import"./label-_-PuJzKE.js";import"./input-D3a40-af.js";import"./usage-B8eRkRZY.js";import"./ArrowUp-lkpB-gsw.js";import"./ChevronDown-DDsgD0_a.js";import"./Edit01-BOdZHKPa.js";import"./XCircle-JhpX2IQK.js";import"./AlertCircle-FqZvtfh1.js";import"./AlertTriangle-Cag6cydu.js";import"./use-deco-chat-open-BAG5m-JA.js";import"./localstorage-keys-Xr0m_-Nl.js";import"./useMutation-8rEyObWg.js";import"./ArrowLeft-CHSuXHTI.js";import"./use-copy-h8i-bDIZ.js";import"./badge-D4ZHiXFA.js";import"./Check-BEIYk4IG.js";import"./Code01-DbWG3kai.js";import"./SearchMd-Dvn1Eo76.js";import"./use-create-virtual-mcp-DG-_igKD.js";import"./deco-constants-YxoGHwHI.js";import"./Copy01-BpXeBtQY.js";import"./marked.esm-BaswSlok.js";import"./markdown-DumqyZQo.js";import"./Eye-D_CQVe6k.js";import"./Globe02-DXh1wFnz.js";import"./XClose-Cpw_0BW6.js";import"./select-BSYdCUMN.js";import"./empty-state-C7VZap1W.js";import"./use-connection-DXequUdB.js";import"./generate-id-Dyweu44Y.js";import"./Clock-Dv-gTw8O.js";import"./Trash01-BC7PAlKV.js";import"./decopilot-events-Brt4gAR6.js";import"./use-llm-DDqwpIPn.js";import"./use-binding-oEpPFbv0.js";import"./binder-BeV9Iq0g.js";import"./File06-D2nPQ2vd.js";import"./Grid01-DDvgvRE8.js";import"./Image01-ToJS21L5.js";import"./RefreshCcw01-zTyzcouM.js";import"./Settings01-CE-2gHzf.js";import"./useSuspenseInfiniteQuery-BKpm_7Fb.js";import"./infiniteQueryObserver-45WqMl59.js";import"./Container-BY7Dg1ME.js";import"./use-mobile-CYG2M3Mj.js";const le=({size:e=24,color:t="currentColor",...i})=>b.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...i},b.createElement("path",{d:"m8.59 13.51 6.83 3.98m-.01-10.98-6.82 3.98M21 5a3 3 0 1 1-6 0 3 3 0 0 1 6 0ZM9 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Zm12 7a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}));le.displayName="Share07";function Ce(e){const t=y.c(15),{agent:i}=e,{setVirtualMcpId:p}=ee();let r;t[0]!==i.id||t[1]!==p?(r=()=>{p(i.id)},t[0]=i.id,t[1]=p,t[2]=r):r=t[2];const l=r;let m;t[3]===Symbol.for("react.memo_cache_sentinel")?(m=se("flex flex-col items-center gap-3 p-2 rounded-lg","transition-colors hover:bg-accent/30","cursor-pointer","self-stretch"),t[3]=m):m=t[3];const d=`Select agent ${i.title}`;let n;t[4]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(ie,{size:20}),t[4]=n):n=t[4];let c;t[5]!==i.icon||t[6]!==i.title?(c=s.jsx(te,{icon:i.icon,name:i.title,fallbackIcon:n}),t[5]=i.icon,t[6]=i.title,t[7]=c):c=t[7];let o;t[8]!==i.title?(o=s.jsx("p",{className:"text-sm text-foreground text-center leading-tight line-clamp-2",children:i.title}),t[8]=i.title,t[9]=o):o=t[9];let a;return t[10]!==l||t[11]!==d||t[12]!==c||t[13]!==o?(a=s.jsxs("button",{type:"button",onClick:l,className:m,"aria-label":d,children:[c,o]}),t[10]=l,t[11]=d,t[12]=c,t[13]=o,t[14]=a):a=t[14],a}function we(e){const t=y.c(14),{virtualMcps:i,selectedVirtualMcpId:p,onVirtualMcpChange:r}=e,[l,m]=b.useState(!1),d=b.useRef(null);let n,c;t[0]!==l?(n=()=>{l&&setTimeout(()=>{d.current?.focus()},0)},c=[l],t[0]=l,t[1]=n,t[2]=c):(n=t[1],c=t[2]),b.useEffect(n,c);let o;t[3]!==r?(o=N=>{r(N),m(!1)},t[3]=r,t[4]=o):o=t[4];const a=o;let f;t[5]===Symbol.for("react.memo_cache_sentinel")?(f=se("flex flex-col items-center gap-3 p-2 rounded-lg","transition-colors hover:bg-accent/30","cursor-pointer","self-stretch"),t[5]=f):f=t[5];let u;t[6]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(xe,{asChild:!0,children:s.jsxs("button",{type:"button",className:f,"aria-label":"See all agents",children:[s.jsx("div",{className:"size-12 rounded-lg bg-accent flex items-center justify-center shrink-0",children:s.jsx(_e,{size:24,className:"text-foreground"})}),s.jsx("p",{className:"text-sm text-foreground text-center leading-tight",children:"See all"})]})}),t[6]=u):u=t[6];let h;t[7]!==a||t[8]!==p||t[9]!==i?(h=s.jsx(je,{className:"w-[550px] p-0 overflow-hidden",align:"start",side:"top",sideOffset:8,children:s.jsx(ce,{virtualMcps:i,selectedVirtualMcpId:p,onVirtualMcpChange:a,searchInputRef:d})}),t[7]=a,t[8]=p,t[9]=i,t[10]=h):h=t[10];let g;return t[11]!==l||t[12]!==h?(g=s.jsxs(ge,{open:l,onOpenChange:m,children:[u,h]}),t[11]=l,t[12]=h,t[13]=g):g=t[13],g}function ke(){const e=y.c(20),t=Ne(),{selectedVirtualMcp:i,setVirtualMcpId:p}=ee();let r,l,m,d,n,c;if(e[0]!==t){n=Symbol.for("react.early_return_sentinel");e:{const h=t.filter(Me).slice(0,6);if(h.length===0){n=null;break e}c=t.map(Te),m="w-full max-w-[800px]",e[7]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx("h2",{className:"text-sm font-medium text-muted-foreground mb-4",children:"Recently used agents"}),e[7]=d):d=e[7],r="grid grid-cols-3 sm:grid-cols-4 md:grid-cols-7 gap-2",l=h.map(ze)}e[0]=t,e[1]=r,e[2]=l,e[3]=m,e[4]=d,e[5]=n,e[6]=c}else r=e[1],l=e[2],m=e[3],d=e[4],n=e[5],c=e[6];if(n!==Symbol.for("react.early_return_sentinel"))return n;const o=i?.id??null;let a;e[8]!==p||e[9]!==o||e[10]!==c?(a=s.jsx(we,{virtualMcps:c,selectedVirtualMcpId:o,onVirtualMcpChange:p}),e[8]=p,e[9]=o,e[10]=c,e[11]=a):a=e[11];let f;e[12]!==r||e[13]!==l||e[14]!==a?(f=s.jsxs("div",{className:r,children:[l,a]}),e[12]=r,e[13]=l,e[14]=a,e[15]=f):f=e[15];let u;return e[16]!==m||e[17]!==d||e[18]!==f?(u=s.jsxs("div",{className:m,children:[d,f]}),e[16]=m,e[17]=d,e[18]=f,e[19]=u):u=e[19],u}function ze(e){return s.jsx(Ce,{agent:e},e.id??"default")}function Te(e){return{id:e.id,title:e.title,description:e.description,icon:e.icon}}function Me(e){return e.id!==null&&!be(e.id)}function Ie(){const e=y.c(2);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(X,{className:"h-5 w-40 mb-4"}),e[0]=t):t=e[0];let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsxs("div",{className:"w-full max-w-[800px]",children:[t,s.jsx("div",{className:"grid grid-cols-3 sm:grid-cols-4 md:grid-cols-7 gap-2",children:Array.from({length:7}).map(Pe)})]}),e[1]=i):i=e[1],i}function Pe(e,t){return s.jsxs("div",{className:"flex flex-col items-center gap-3 p-2 self-stretch",children:[s.jsx(X,{className:"size-6 rounded-md shrink-0"}),s.jsx(X,{className:"h-4 w-full"})]},t)}function $e(){const e=y.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(b.Suspense,{fallback:s.jsx(Ie,{}),children:s.jsx(ke,{})}),e[0]=t):t=e[0],t}function Ee(){const e=new Date().getHours();return e>=5&&e<12?"Morning":e>=12&&e<17?"Afternoon":e>=17&&e<22?"Evening":"Night"}function Ve(){const e=y.c(61),{org:t}=oe(),{data:i}=ae.useSession(),{modelsConnections:p,isChatEmpty:r,activeThreadId:l,createThread:m,switchToThread:d,threads:n,selectedVirtualMcp:c}=he();let o;if(e[0]!==l||e[1]!==n){let x;e[3]!==l?(x=ne=>ne.id===l,e[3]=l,e[4]=x):x=e[4],o=n.find(x),e[0]=l,e[1]=n,e[2]=o}else o=e[2];const a=o,[f,u]=b.useState(!1);let h;e[5]!==i?.user?.name?(h=i?.user?.name?.split(" ")[0]||"there",e[5]=i?.user?.name,e[6]=h):h=e[6];const g=h;let N;e[7]===Symbol.for("react.memo_cache_sentinel")?(N=Ee(),e[7]=N):N=e[7];const re=N;let L;e[8]!==t.id?(L=ye(t.id),e[8]=t.id,e[9]=L):L=e[9];const R=c??L;if(p.length===0){let x;return e[10]!==t?(x=s.jsx("div",{className:"flex flex-col size-full bg-background items-center justify-center",children:s.jsx(j.NoLlmBindingEmptyState,{org:t})}),e[10]=t,e[11]=x):x=e[11],x}let _;e[12]!==a?(_=a?.title&&s.jsx(me,{text:a.title,className:"text-sm font-medium text-foreground"}),e[12]=a,e[13]=_):_=e[13];let S;e[14]!==_?(S=s.jsx(A.Header.Left,{className:"gap-2",children:_}),e[14]=_,e[15]=S):S=e[15];let v;e[16]!==m?(v=()=>m(),e[16]=m,e[17]=v):v=e[17];let B;e[18]===Symbol.for("react.memo_cache_sentinel")?(B=s.jsx(ve,{size:16}),e[18]=B):B=e[18];let C;e[19]!==r||e[20]!==v?(C=s.jsx(U,{asChild:!0,children:s.jsx(H,{type:"button",variant:"outline",size:"icon",className:"size-7 border border-input",onClick:v,disabled:r,"aria-label":"New chat",children:B})}),e[19]=r,e[20]=v,e[21]=C):C=e[21];let O;e[22]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx(J,{children:"New chat"}),e[22]=O):O=e[22];let w;e[23]!==C?(w=s.jsxs(Q,{children:[C,O]}),e[23]=C,e[24]=w):w=e[24];let D;e[25]===Symbol.for("react.memo_cache_sentinel")?(D=()=>u(!0),e[25]=D):D=e[25];let F;e[26]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsxs(Q,{children:[s.jsx(U,{asChild:!0,children:s.jsx(H,{type:"button",variant:"outline",size:"icon",className:"size-7 border border-input",onClick:D,"aria-label":"Chat history",children:s.jsx(de,{size:16})})}),s.jsx(J,{children:"Chat history"})]}),e[26]=F):F=e[26];let W;e[27]===Symbol.for("react.memo_cache_sentinel")?(W=s.jsx(Se,{size:16}),e[27]=W):W=e[27];let k;e[28]!==r?(k=s.jsx(U,{asChild:!0,children:s.jsx(H,{type:"button",variant:"outline",size:"icon",className:"size-7 border border-input",onClick:He,disabled:r,"aria-label":"Pin chat",children:W})}),e[28]=r,e[29]=k):k=e[29];let Z;e[30]===Symbol.for("react.memo_cache_sentinel")?(Z=s.jsx(J,{children:"Pin chat"}),e[30]=Z):Z=e[30];let z;e[31]!==k?(z=s.jsxs(Q,{children:[k,Z]}),e[31]=k,e[32]=z):z=e[32];let q;e[33]===Symbol.for("react.memo_cache_sentinel")?(q=s.jsx(le,{size:16}),e[33]=q):q=e[33];let T;e[34]!==r?(T=s.jsx(U,{asChild:!0,children:s.jsx(H,{type:"button",variant:"outline",size:"icon",className:"size-7 border border-input",onClick:Ae,disabled:r,"aria-label":"Share chat",children:q})}),e[34]=r,e[35]=T):T=e[35];let G;e[36]===Symbol.for("react.memo_cache_sentinel")?(G=s.jsx(J,{children:"Share chat"}),e[36]=G):G=e[36];let M;e[37]!==T?(M=s.jsxs(Q,{children:[T,G]}),e[37]=T,e[38]=M):M=e[38];let I;e[39]!==w||e[40]!==z||e[41]!==M?(I=s.jsxs(A.Header.Right,{className:"gap-1",children:[w,F,z,M]}),e[39]=w,e[40]=z,e[41]=M,e[42]=I):I=e[42];let P;e[43]!==I||e[44]!==S?(P=s.jsxs(A.Header,{className:"flex-none z-10 bg-background",children:[S,I]}),e[43]=I,e[44]=S,e[45]=P):P=e[45];let $;e[46]!==R||e[47]!==r||e[48]!==g?($=r?s.jsxs("div",{className:"flex-1 min-h-0 flex flex-col items-center justify-center px-10 pb-32 pt-10",children:[s.jsxs("div",{className:"flex flex-col items-center gap-3 w-full max-w-[600px]",children:[s.jsx("div",{className:"flex justify-center",children:s.jsx(te,{icon:R.icon,name:R.title,size:"md",fallbackIcon:s.jsx(ie,{size:20}),className:"size-12 rounded-xl border border-stone-200/60 shadow-sm aspect-square transition-opacity duration-200"})}),s.jsxs("div",{className:"text-center",children:[s.jsxs("p",{className:"text-lg font-medium text-foreground",children:[re," ",g,","]}),s.jsx("p",{className:"text-base text-muted-foreground opacity-50 mb-0",children:"What are we building today?"})]}),s.jsx("div",{className:"w-full -mt-1",children:s.jsx(j.Input,{})}),s.jsx(j.IceBreakers,{className:"w-full"})]}),s.jsx("div",{className:"flex flex-col items-center w-full mt-4",children:s.jsx($e,{})})]}):s.jsxs(s.Fragment,{children:[s.jsx(j.Main,{children:s.jsx(j.Messages,{})}),s.jsx(j.Footer,{children:s.jsx(j.Input,{})})]}),e[46]=R,e[47]=r,e[48]=g,e[49]=$):$=e[49];let E;e[50]!==d?(E=async x=>{await d(x),u(!1)},e[50]=d,e[51]=E):E=e[51];let V;e[52]!==l||e[53]!==f||e[54]!==E||e[55]!==n?(V=s.jsx(fe,{open:f,onOpenChange:u,threads:n,activeThreadId:l,onThreadSelect:E}),e[52]=l,e[53]=f,e[54]=E,e[55]=n,e[56]=V):V=e[56];let K;return e[57]!==P||e[58]!==$||e[59]!==V?(K=s.jsxs(j,{children:[P,$,V]}),e[57]=P,e[58]=$,e[59]=V,e[60]=K):K=e[60],K}function Ae(){Y.info("Share feature coming soon")}function He(){Y.info("Pin feature coming soon")}function Le(e){const t=y.c(14),{error:i,onRetry:p}=e,r=i?.message?.includes("401")||i?.message?.toLowerCase().includes("unauthorized");let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsxs(A.Header,{className:"flex-none",children:[s.jsx(A.Header.Left,{className:"gap-2"}),s.jsx(A.Header.Right,{className:"gap-1"})]}),t[0]=l):l=t[0];let m;t[1]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx("div",{className:"bg-destructive/10 p-3 rounded-full mx-auto w-fit",children:s.jsx(ue,{className:"h-6 w-6 text-destructive"})}),t[1]=m):m=t[1];const d=r?"Unable to load models":"Something went wrong";let n;t[2]!==d?(n=s.jsx("h3",{className:"text-lg font-medium",children:d}),t[2]=d,t[3]=n):n=t[3];const c=r?"There was an authentication error while loading the models. This might be due to an expired session or invalid API key.":i?.message||"An unexpected error occurred";let o;t[4]!==c?(o=s.jsx("p",{className:"text-sm text-muted-foreground",children:c}),t[4]=c,t[5]=o):o=t[5];let a;t[6]!==n||t[7]!==o?(a=s.jsxs("div",{className:"space-y-2",children:[n,o]}),t[6]=n,t[7]=o,t[8]=a):a=t[8];let f;t[9]!==p?(f=s.jsx(H,{variant:"outline",onClick:p,children:"Try again"}),t[9]=p,t[10]=f):f=t[10];let u;return t[11]!==a||t[12]!==f?(u=s.jsxs(j,{children:[l,s.jsx("div",{className:"flex-1 flex flex-col items-center justify-center p-6 text-center",children:s.jsxs("div",{className:"max-w-sm space-y-4",children:[m,a,f]})})]}),t[11]=a,t[12]=f,t[13]=u):u=t[13],u}function es(){const e=y.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(pe,{fallback:Re,children:s.jsx(b.Suspense,{fallback:s.jsx(j.Skeleton,{}),children:s.jsx(Ve,{})})}),e[0]=t):t=e[0],t}function Re(e){const{error:t,resetError:i}=e;return s.jsx(Le,{error:t,onRetry:i})}export{es as default};
|
package/dist/client/assets/{plugin-empty-state-C3dQRExn.js → plugin-empty-state-3Ic2Cddr.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as s,j as t}from"./index-
|
|
1
|
+
import{c as s,j as t}from"./index-DQipirM0.js";import{e as r}from"./Dataflow03-Ce5PVi3u.js";function a(){const o=s.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8",children:[t.jsx(r,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"No workflows connected"}),t.jsx("p",{className:"text-muted-foreground text-center max-w-md",children:"Connect a workflow provider to create and manage automated workflows with multiple steps and integrations."})]}),o[0]=e):e=o[0],e}export{a as default};
|
package/dist/client/assets/{plugin-empty-state-CtOLvnau.js → plugin-empty-state-B0aoDY0o.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as n,j as t,H as o}from"./index-
|
|
1
|
+
import{c as n,j as t,H as o}from"./index-DQipirM0.js";function c(){const s=n.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8",children:[t.jsx(o,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"No storage connected"}),t.jsx("p",{className:"text-muted-foreground text-center max-w-md",children:"Connect an S3-compatible storage service to browse and manage files."})]}),s[0]=e):e=s[0],e}export{c as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as S,j as s,r as w}from"./index-
|
|
1
|
+
import{c as S,j as s,r as w}from"./index-DQipirM0.js";import{i as R}from"./Check-BEIYk4IG.js";import{t as _}from"./ChevronDown-DDsgD0_a.js";import{e as y}from"./Dataflow03-Ce5PVi3u.js";function E(x){const e=S.c(32),{connections:l,selectedConnectionId:r,onConnectionChange:N}=x,[n,z]=w.useState(!1),C=w.useRef(null);let p;if(e[0]!==l||e[1]!==r){let t;e[3]!==r?(t=u=>u.id===r,e[3]=r,e[4]=t):t=e[4],p=l.find(t),e[0]=l,e[1]=r,e[2]=p}else p=e[2];const i=p;let j;e[5]===Symbol.for("react.memo_cache_sentinel")?(j=t=>{C.current?.contains(t.relatedTarget)||z(!1)},e[5]=j):j=e[5];const k=j;if(l.length===1){let t;e[6]!==i?(t=i?.icon?s.jsx("img",{src:i.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),e[6]=i,e[7]=t):t=e[7];const u=i?.title||"Workflows";let f;e[8]!==u?(f=s.jsx("span",{children:u}),e[8]=u,e[9]=f):f=e[9];let h;return e[10]!==t||e[11]!==f?(h=s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[t,f]}),e[10]=t,e[11]=f,e[12]=h):h=e[12],h}let o;e[13]!==n?(o=()=>z(!n),e[13]=n,e[14]=o):o=e[14];let c;e[15]!==i?(c=i?.icon?s.jsx("img",{src:i.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),e[15]=i,e[16]=c):c=e[16];const v=i?.title||"Select provider";let a;e[17]!==v?(a=s.jsx("span",{children:v}),e[17]=v,e[18]=a):a=e[18];let b;e[19]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(_,{size:14}),e[19]=b):b=e[19];let d;e[20]!==o||e[21]!==c||e[22]!==a?(d=s.jsxs("button",{type:"button",onClick:o,className:"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-md border border-border bg-background hover:bg-accent transition-colors",children:[c,a,b]}),e[20]=o,e[21]=c,e[22]=a,e[23]=d):d=e[23];let m;e[24]!==l||e[25]!==n||e[26]!==N||e[27]!==r?(m=n&&s.jsx("div",{className:"absolute left-0 top-full mt-1 z-50 min-w-48 rounded-md border border-border bg-popover p-1 shadow-md",children:l.map(t=>s.jsxs("button",{type:"button",onClick:()=>{N(t.id),z(!1)},className:"flex items-center gap-2 w-full px-2 py-1.5 text-sm rounded-sm hover:bg-accent transition-colors",children:[t.icon?s.jsx("img",{src:t.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),s.jsx("span",{className:"flex-1 text-left",children:t.title}),t.id===r&&s.jsx(R,{size:14,className:"text-primary"})]},t.id))}),e[24]=l,e[25]=n,e[26]=N,e[27]=r,e[28]=m):m=e[28];let g;return e[29]!==d||e[30]!==m?(g=s.jsxs("div",{className:"relative",ref:C,onBlur:k,children:[d,m]}),e[29]=d,e[30]=m,e[31]=g):g=e[31],g}function H(x){const e=S.c(2);let l;return e[0]!==x?(l=s.jsx(E,{...x}),e[0]=x,e[1]=l):l=e[1],l}export{H as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as w,j as s,r as S,H as y}from"./index-
|
|
1
|
+
import{c as w,j as s,r as S,H as y}from"./index-DQipirM0.js";import{i as _}from"./Check-BEIYk4IG.js";import{t as k}from"./ChevronDown-DDsgD0_a.js";function E(x){const e=w.c(32),{connections:l,selectedConnectionId:n,onConnectionChange:N}=x,[r,z]=S.useState(!1),C=S.useRef(null);let p;if(e[0]!==l||e[1]!==n){let t;e[3]!==n?(t=u=>u.id===n,e[3]=n,e[4]=t):t=e[4],p=l.find(t),e[0]=l,e[1]=n,e[2]=p}else p=e[2];const i=p;let j;e[5]===Symbol.for("react.memo_cache_sentinel")?(j=t=>{C.current?.contains(t.relatedTarget)||z(!1)},e[5]=j):j=e[5];const R=j;if(l.length===1){let t;e[6]!==i?(t=i?.icon?s.jsx("img",{src:i.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),e[6]=i,e[7]=t):t=e[7];const u=i?.title||"Storage";let f;e[8]!==u?(f=s.jsx("span",{children:u}),e[8]=u,e[9]=f):f=e[9];let h;return e[10]!==t||e[11]!==f?(h=s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[t,f]}),e[10]=t,e[11]=f,e[12]=h):h=e[12],h}let o;e[13]!==r?(o=()=>z(!r),e[13]=r,e[14]=o):o=e[14];let a;e[15]!==i?(a=i?.icon?s.jsx("img",{src:i.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),e[15]=i,e[16]=a):a=e[16];const v=i?.title||"Select storage";let c;e[17]!==v?(c=s.jsx("span",{children:v}),e[17]=v,e[18]=c):c=e[18];let b;e[19]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(k,{size:14}),e[19]=b):b=e[19];let d;e[20]!==o||e[21]!==a||e[22]!==c?(d=s.jsxs("button",{type:"button",onClick:o,className:"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-md border border-border bg-background hover:bg-accent transition-colors",children:[a,c,b]}),e[20]=o,e[21]=a,e[22]=c,e[23]=d):d=e[23];let m;e[24]!==l||e[25]!==r||e[26]!==N||e[27]!==n?(m=r&&s.jsx("div",{className:"absolute left-0 top-full mt-1 z-50 min-w-48 rounded-md border border-border bg-popover p-1 shadow-md",children:l.map(t=>s.jsxs("button",{type:"button",onClick:()=>{N(t.id),z(!1)},className:"flex items-center gap-2 w-full px-2 py-1.5 text-sm rounded-sm hover:bg-accent transition-colors",children:[t.icon?s.jsx("img",{src:t.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),s.jsx("span",{className:"flex-1 text-left",children:t.title}),t.id===n&&s.jsx(_,{size:14,className:"text-primary"})]},t.id))}),e[24]=l,e[25]=r,e[26]=N,e[27]=n,e[28]=m):m=e[28];let g;return e[29]!==d||e[30]!==m?(g=s.jsxs("div",{className:"relative",ref:C,onBlur:R,children:[d,m]}),e[29]=d,e[30]=m,e[31]=g):g=e[31],g}function I(x){const e=w.c(2);let l;return e[0]!==x?(l=s.jsx(E,{...x}),e[0]=x,e[1]=l):l=e[1],l}export{I as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i,ap as $,j as c,
|
|
1
|
+
import{r as i,ap as $,j as c,aF as L,al as G,ar as A,am as _,at as P,aG as w,av as j,aH as H,aI as E,aJ as z,aK as K,aw as J,aL as Q,aM as U,aN as V,aO as W,aP as Z,aQ as q,c as R}from"./index-DQipirM0.js";import{c as B}from"./button-BxOn_P7A.js";var x="Popover",[b]=J(x,[E]),g=E(),[X,d]=b(x),N=t=>{const{__scopePopover:e,children:o,open:r,defaultOpen:n,onOpenChange:a,modal:s=!1}=t,p=g(e),l=i.useRef(null),[u,h]=i.useState(!1),[m,f]=$({prop:r,defaultProp:n??!1,onChange:a,caller:x});return c.jsx(L,{...p,children:c.jsx(X,{scope:e,contentId:G(),triggerRef:l,open:m,onOpenChange:f,onOpenToggle:i.useCallback(()=>f(C=>!C),[f]),hasCustomAnchor:u,onCustomAnchorAdd:i.useCallback(()=>h(!0),[]),onCustomAnchorRemove:i.useCallback(()=>h(!1),[]),modal:s,children:o})})};N.displayName=x;var F="PopoverAnchor",Y=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=d(F,o),a=g(o),{onCustomAnchorAdd:s,onCustomAnchorRemove:p}=n;return i.useEffect(()=>(s(),()=>p()),[s,p]),c.jsx(w,{...a,...r,ref:e})});Y.displayName=F;var S="PopoverTrigger",y=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=d(S,o),a=g(o),s=A(e,n.triggerRef),p=c.jsx(_.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":k(n.open),...r,ref:s,onClick:P(t.onClick,n.onOpenToggle)});return n.hasCustomAnchor?p:c.jsx(w,{asChild:!0,...a,children:p})});y.displayName=S;var O="PopoverPortal",[ee,oe]=b(O,{forceMount:void 0}),M=t=>{const{__scopePopover:e,forceMount:o,children:r,container:n}=t,a=d(O,e);return c.jsx(ee,{scope:e,forceMount:o,children:c.jsx(j,{present:o||a.open,children:c.jsx(H,{asChild:!0,container:n,children:r})})})};M.displayName=O;var v="PopoverContent",D=i.forwardRef((t,e)=>{const o=oe(v,t.__scopePopover),{forceMount:r=o.forceMount,...n}=t,a=d(v,t.__scopePopover);return c.jsx(j,{present:r||a.open,children:a.modal?c.jsx(re,{...n,ref:e}):c.jsx(ne,{...n,ref:e})})});D.displayName=v;var te=Q("PopoverContent.RemoveScroll"),re=i.forwardRef((t,e)=>{const o=d(v,t.__scopePopover),r=i.useRef(null),n=A(e,r),a=i.useRef(!1);return i.useEffect(()=>{const s=r.current;if(s)return z(s)},[]),c.jsx(K,{as:te,allowPinchZoom:!0,children:c.jsx(I,{...t,ref:n,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:P(t.onCloseAutoFocus,s=>{s.preventDefault(),a.current||o.triggerRef.current?.focus()}),onPointerDownOutside:P(t.onPointerDownOutside,s=>{const p=s.detail.originalEvent,l=p.button===0&&p.ctrlKey===!0,u=p.button===2||l;a.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:P(t.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),ne=i.forwardRef((t,e)=>{const o=d(v,t.__scopePopover),r=i.useRef(!1),n=i.useRef(!1);return c.jsx(I,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{t.onCloseAutoFocus?.(a),a.defaultPrevented||(r.current||o.triggerRef.current?.focus(),a.preventDefault()),r.current=!1,n.current=!1},onInteractOutside:a=>{t.onInteractOutside?.(a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(n.current=!0));const s=a.target;o.triggerRef.current?.contains(s)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&n.current&&a.preventDefault()}})}),I=i.forwardRef((t,e)=>{const{__scopePopover:o,trapFocus:r,onOpenAutoFocus:n,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEscapeKeyDown:p,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:h,...m}=t,f=d(v,o),C=g(o);return U(),c.jsx(V,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:n,onUnmountAutoFocus:a,children:c.jsx(W,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:h,onEscapeKeyDown:p,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>f.onOpenChange(!1),children:c.jsx(Z,{"data-state":k(f.open),role:"dialog",id:f.contentId,...C,...m,ref:e,style:{...m.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),T="PopoverClose",ae=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=d(T,o);return c.jsx(_.button,{type:"button",...r,ref:e,onClick:P(t.onClick,()=>n.onOpenChange(!1))})});ae.displayName=T;var se="PopoverArrow",ce=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=g(o);return c.jsx(q,{...n,...r,ref:e})});ce.displayName=se;function k(t){return t?"open":"closed"}var ie=N,pe=y,le=M,ue=D;function ve(t){const e=R.c(4);let o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=c.jsx(ie,{"data-slot":"popover",...o}),e[2]=o,e[3]=r):r=e[3],r}function Pe(t){const e=R.c(4);let o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=c.jsx(pe,{"data-slot":"popover-trigger",...o}),e[2]=o,e[3]=r):r=e[3],r}function ge(t){const e=R.c(12);let o,r,n,a;e[0]!==t?({className:o,align:n,sideOffset:a,...r}=t,e[0]=t,e[1]=o,e[2]=r,e[3]=n,e[4]=a):(o=e[1],r=e[2],n=e[3],a=e[4]);const s=n===void 0?"center":n,p=a===void 0?4:a;let l;e[5]!==o?(l=B("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-lg overflow-hidden border p-4 shadow-md outline-hidden",o),e[5]=o,e[6]=l):l=e[6];let u;return e[7]!==s||e[8]!==r||e[9]!==p||e[10]!==l?(u=c.jsx(le,{children:c.jsx(ue,{"data-slot":"popover-content",align:s,sideOffset:p,className:l,...r})}),e[7]=s,e[8]=r,e[9]=p,e[10]=l,e[11]=u):u=e[11],u}export{Pe as P,ge as a,ve as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as v,c as L,d as et,j as i,u as X,O as ee,t as V,H as zr,o as Lt,s as be,b as $e,m as Fe,l as $t,k as Ft,K as Q,aE as Ge,bF as Lr,b0 as ne,P as Mt,S as Ye,e as $r,aC as Fr}from"./index-DQipirM0.js";import{u as Mr,a as Bt}from"./use-project-x4-rNIeb.js";import{c as ie,B as Y}from"./button-BxOn_P7A.js";import{a as Rt,b as Br,c as Rr,d as Wr,D as Wt}from"./dialog-8Qx5GCEw.js";import{a as Gr,b as Ur,c as Kr,T as qr,i as Gt}from"./tooltip-B7RjBzxU.js";import{u as tt,S as re}from"./skeleton-D-Lsp11A.js";import{p as Ut,a as mt,t as Yr,u as Hr}from"./use-settings-modal-D-E-U1i_.js";import{A as Kt}from"./avatar-BLu12sL5.js";import{a as rt,i as Vr}from"./deco-constants-YxoGHwHI.js";import{t as qt}from"./Settings01-CE-2gHzf.js";import{i as Xr}from"./Check-BEIYk4IG.js";import{a as Qr}from"./Copy01-BpXeBtQY.js";import{S as _e}from"./switch-DyckCxcC.js";import{S as Yt,a as Ht,d as Ae,c as Vt,b as Jr}from"./select-BSYdCUMN.js";import{i as Zr}from"./Code01-DbWG3kai.js";import{i as en}from"./Shield01-BB8IGqoD.js";import{n as tn}from"./CheckDone01-Duh5ZNi_.js";import{u as Me}from"./useMutation-8rEyObWg.js";import{a as Xt,F as je,b as le,c as oe,d as ce,f as ke,e as He}from"./form-Dn5Ilwyi.js";import{I as ae}from"./input-D3a40-af.js";import{i as rn}from"./Upload01-CASznv9t.js";import{a as nt,u as Se}from"./constants-9bKBT988.js";import{T as nn}from"./textarea-DX9d61Sr.js";import{c as an,h as sn,d as ln,b as on,A as cn,e as dn,g as un,a as mn,f as fn}from"./alert-dialog-K0UnFp_v.js";import{u as hn}from"./useQuery-CqT-L2b-.js";import{L as Oe}from"./label-_-PuJzKE.js";import{n as xn}from"./Container-BY7Dg1ME.js";import{h as Qt}from"./use-connection-DXequUdB.js";import{a as pn,c as gn}from"./use-binding-oEpPFbv0.js";import{u as vn}from"./use-install-from-registry-BCGIZz8M.js";import{i as yn}from"./Loading01-BFMhWWtD.js";import{s as Jt}from"./Plus-Ck954sGm.js";import{i as q,G as Zt,g as Ue,m as bn,D as Be,r as we,Z as Re,L as me,s as Ne,C as jn,a as kn,b as er,c as Sn,d as wn,T as Nn,u as Pn,e as Cn,f as An,h as Ie,j as H,k as ft,l as ht,n as tr,o as rr,p as We,q as it,t as _n,v as On,w as nr,x as at,y as st,z as ir,A as En,B as ar,E as xt,F as In,H as Dn,I as sr,R as Tn,S as zn,J as Ln,K as $n,M as lr,N as Fn,O as Mn,P as Bn,Q as Rn,U as Wn,V as Gn,W as Un,X as Kn,Y as qn,_ as pt,$ as gt,a0 as vt,a1 as Yn,a2 as lt,a3 as Hn,a4 as ve,a5 as Vn,a6 as Xn,a7 as Qn,a8 as Jn,a9 as Zn,aa as Ke,ab as ei,ac as Te,ad as W,ae as ot,af as ti,ag as ri,ah as ni,ai as or,aj as cr,ak as ii,al as ai,am as si,an as dr,ao as G,ap as li,aq as oi,ar as ci,as as di,at as ui,au as mi,av as fi,aw as hi,ax as xi,ay as pi,az as gi,aA as vi,aB as yi}from"./chart-Dm5seKC_.js";import{B as ur}from"./badge-D4ZHiXFA.js";import{i as bi}from"./AlertCircle-FqZvtfh1.js";import{b as ji,a as mr}from"./use-mcp-tools-Dt6WorDi.js";import"./localstorage-keys-Xr0m_-Nl.js";import"./ChevronDown-DDsgD0_a.js";import"./binder-BeV9Iq0g.js";import"./extract-connection-data-CLG2vt6G.js";import"./constants-CS_UcM7e.js";import"./github-icon-Dp3wHhYE.js";import"./registry-utils-DSUIffwE.js";import"./generate-id-Dyweu44Y.js";import"./index-CWIKLTkS.js";const fr=({size:t=24,color:e="currentColor",...r})=>v.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},v.createElement("path",{d:"M10 2v4.66c0 .218 0 .326-.033.413a.47.47 0 0 1-.138.198c-.07.06-.183.102-.409.185a7.5 7.5 0 1 0 5.16 0c-.226-.083-.339-.125-.409-.185a.469.469 0 0 1-.138-.198C14 6.986 14 6.878 14 6.66V2M8.5 2h7"}));fr.displayName="Beaker01";const hr=({size:t=24,color:e="currentColor",...r})=>v.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},v.createElement("path",{d:"M9.354 21c.705.622 1.632 1 2.646 1s1.94-.378 2.646-1M18 8A6 6 0 1 0 6 8c0 3.09-.78 5.206-1.65 6.605-.735 1.18-1.102 1.771-1.089 1.936.015.182.054.252.2.36.133.099.732.099 1.928.099H18.61c1.196 0 1.795 0 1.927-.098.147-.11.186-.179.2-.361.014-.165-.353-.755-1.088-1.936C18.78 13.206 18 11.09 18 8Z"}));hr.displayName="Bell01";const ct=({size:t=24,color:e="currentColor",...r})=>v.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},v.createElement("path",{d:"M13 2 4.093 12.688c-.348.418-.523.628-.525.804a.5.5 0 0 0 .185.397c.138.111.41.111.955.111H12l-1 8 8.907-10.688c.348-.418.523-.628.525-.804a.5.5 0 0 0-.185-.397c-.138-.111-.41-.111-.955-.111H12l1-8Z"}));ct.displayName="Zap";const ki=[{key:"general",label:"General",icon:i.jsx(qt,{size:14})},{key:"plugins",label:"Plugins",icon:i.jsx(ct,{size:14})}];function Si(t){const e=L.c(14),{activeSection:r,onNavigate:n}=t,{org:s}=X();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={suspense:!0},e[0]=a):a=e[0];const{data:l}=Mr(s.id,a);let o;e[1]!==r?(o=Ut(r),e[1]=r,e[2]=o):o=e[2];const u=o;let d;if(e[3]!==u?.slug||e[4]!==r||e[5]!==n||e[6]!==l){let f;e[8]!==u?.slug||e[9]!==r||e[10]!==n?(f=m=>{const x=u?.slug===m.slug;return i.jsxs("div",{className:"flex flex-col gap-0.5",children:[i.jsxs("button",{type:"button",onClick:()=>n(mt(m.slug,"general")),className:ie("flex items-center gap-2.5 px-2 py-1.5 rounded-md text-sm text-left w-full transition-colors",x?"text-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[i.jsx("div",{className:"size-4 shrink-0 rounded-[3px] flex items-center justify-center overflow-hidden border border-border/50",style:{backgroundColor:m.ui?.themeColor??"#60a5fa"},children:m.ui?.icon?i.jsx("img",{src:m.ui.icon,alt:"",className:"size-full object-cover"}):i.jsx("span",{className:"text-[8px] font-semibold text-white leading-none",children:(m.name??m.slug).charAt(0).toUpperCase()})}),i.jsx("span",{className:"truncate",children:m.name??m.slug})]}),x&&i.jsx("div",{className:"ml-3 flex flex-col gap-0.5 border-l border-border pl-2.5",children:ki.map(h=>{const g=mt(m.slug,h.key);return i.jsxs("button",{type:"button",onClick:()=>n(g),className:ie("flex items-center gap-2.5 px-2 py-1.5 rounded-md text-sm text-left w-full transition-colors",r===g?"bg-accent text-accent-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[i.jsx("span",{className:"shrink-0",children:h.icon}),i.jsx("span",{className:"truncate",children:h.label})]},h.key)})})]},m.slug)},e[8]=u?.slug,e[9]=r,e[10]=n,e[11]=f):f=e[11],d=(l??[]).filter(wi).map(f),e[3]=u?.slug,e[4]=r,e[5]=n,e[6]=l,e[7]=d}else d=e[7];let c;return e[12]!==d?(c=i.jsx(i.Fragment,{children:d}),e[12]=d,e[13]=c):c=e[13],c}function wi(t){return t.slug!==ee}function Ni(t){const e=L.c(30),{activeSection:r,onNavigate:n}=t,{data:s}=et.useSession(),[a]=tt(),l=s?.user,o=l?.image,u=l?.name??"Profile",d=l?.name??"U";let c;e[0]!==d||e[1]!==o?(c=i.jsx(Kt,{url:o,fallback:d,shape:"circle",size:"2xs",className:"size-4 shrink-0"}),e[0]=d,e[1]=o,e[2]=c):c=e[2];let f;e[3]!==u||e[4]!==c?(f={key:"account.profile",label:u,icon:c},e[3]=u,e[4]=c,e[5]=f):f=e[5];let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m={key:"account.preferences",label:"Preferences",icon:i.jsx(qt,{size:14})},e[6]=m):m=e[6];let x;e[7]===Symbol.for("react.memo_cache_sentinel")?(x={key:"account.experimental",label:"Experimental",icon:i.jsx(fr,{size:14})},e[7]=x):x=e[7];let h;e[8]!==f?(h=[f,m,x],e[8]=f,e[9]=h):h=e[9];const g=h;let y;e[10]===Symbol.for("react.memo_cache_sentinel")?(y={key:"org.general",label:"General",icon:i.jsx(Yr,{size:14})},e[10]=y):y=e[10];let S;e[11]===Symbol.for("react.memo_cache_sentinel")?(S={key:"org.plugins",label:"Plugins",icon:i.jsx(ct,{size:14})},e[11]=S):S=e[11];let w;e[12]===Symbol.for("react.memo_cache_sentinel")?(w=[y,S,{key:"org.billing",label:"Billing",icon:i.jsx(rt,{size:14})}],e[12]=w):w=e[12];const P=w;let j;e[13]===Symbol.for("react.memo_cache_sentinel")?(j=i.jsx("p",{className:"px-2 py-1.5 text-xs font-semibold text-muted-foreground/60",children:"Account"}),e[13]=j):j=e[13];let p;e[14]!==g||e[15]!==r||e[16]!==n?(p=i.jsxs("div",{className:"flex flex-col gap-0.5 px-2",children:[j,g.map(A=>i.jsxs("button",{type:"button",onClick:()=>n(A.key),className:ie("flex items-center gap-2.5 px-2 py-1.5 rounded-md text-sm text-left w-full transition-colors",r===A.key?"bg-accent text-accent-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[i.jsx("span",{className:"shrink-0",children:A.icon}),i.jsx("span",{className:"truncate",children:A.label})]},A.key))]}),e[14]=g,e[15]=r,e[16]=n,e[17]=p):p=e[17];let b;e[18]===Symbol.for("react.memo_cache_sentinel")?(b=i.jsx("p",{className:"px-2 py-1.5 text-xs font-semibold text-muted-foreground/60",children:"Organization"}),e[18]=b):b=e[18];let k;e[19]!==r||e[20]!==n?(k=i.jsxs("div",{className:"flex flex-col gap-0.5 px-2",children:[b,P.map(A=>i.jsxs("button",{type:"button",onClick:()=>n(A.key),className:ie("flex items-center gap-2.5 px-2 py-1.5 rounded-md text-sm text-left w-full transition-colors",r===A.key?"bg-accent text-accent-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[i.jsx("span",{className:"shrink-0",children:A.icon}),i.jsx("span",{className:"truncate",children:A.label})]},A.key))]}),e[19]=r,e[20]=n,e[21]=k):k=e[21];let N;e[22]!==r||e[23]!==n||e[24]!==a.experimental_projects?(N=a.experimental_projects&&i.jsxs("div",{className:"flex flex-col gap-0.5 px-2",children:[i.jsx("p",{className:"px-2 py-1.5 text-xs font-semibold text-muted-foreground/60",children:"Projects"}),i.jsx(v.Suspense,{fallback:i.jsx("div",{className:"px-2 py-1.5 text-xs text-muted-foreground/50",children:"Loading…"}),children:i.jsx(Si,{activeSection:r,onNavigate:n})})]}),e[22]=r,e[23]=n,e[24]=a.experimental_projects,e[25]=N):N=e[25];let C;return e[26]!==p||e[27]!==k||e[28]!==N?(C=i.jsxs("div",{className:"w-52 shrink-0 border-r border-border bg-sidebar/50 overflow-y-auto py-3 flex flex-col gap-4",children:[p,k,N]}),e[26]=p,e[27]=k,e[28]=N,e[29]=C):C=e[29],C}function Pi(){const t=L.c(32),{data:e}=et.useSession(),[r,n]=v.useState(!1),s=e?.user,a=s?.image;let l;t[0]!==s?(l=()=>{s?.id&&navigator.clipboard.writeText(s.id).then(()=>{n(!0),setTimeout(()=>n(!1),2e3)})},t[0]=s,t[1]=l):l=t[1];const o=l;let u;t[2]===Symbol.for("react.memo_cache_sentinel")?(u=i.jsx("div",{children:i.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Profile"})}),t[2]=u):u=t[2];const d=s?.name??"U";let c;t[3]!==d||t[4]!==a?(c=i.jsx(Kt,{url:a,fallback:d,shape:"circle",size:"xl",className:"size-16 shrink-0"}),t[3]=d,t[4]=a,t[5]=c):c=t[5];const f=s?.name??"User";let m;t[6]!==f?(m=i.jsx("span",{className:"text-sm font-semibold text-foreground truncate",children:f}),t[6]=f,t[7]=m):m=t[7];const x=s?.email;let h;t[8]!==x?(h=i.jsx("span",{className:"text-sm text-muted-foreground truncate",children:x}),t[8]=x,t[9]=h):h=t[9];let g;t[10]!==m||t[11]!==h?(g=i.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[m,h]}),t[10]=m,t[11]=h,t[12]=g):g=t[12];let y;t[13]!==c||t[14]!==g?(y=i.jsxs("div",{className:"flex items-center gap-4",children:[c,g]}),t[13]=c,t[14]=g,t[15]=y):y=t[15];let S;t[16]===Symbol.for("react.memo_cache_sentinel")?(S=i.jsx("p",{className:"py-4 text-base font-semibold text-foreground border-b border-border",children:"User ID"}),t[16]=S):S=t[16];let w;t[17]===Symbol.for("react.memo_cache_sentinel")?(w=i.jsx("p",{className:"text-sm text-muted-foreground",children:"User ID"}),t[17]=w):w=t[17];const P=s?.id;let j;t[18]!==P?(j=i.jsx("span",{className:"font-mono text-sm",children:P}),t[18]=P,t[19]=j):j=t[19];let p;t[20]!==r?(p=r?i.jsx(Xr,{size:14,className:"text-green-600 shrink-0"}):i.jsx(Qr,{size:14,className:"shrink-0 opacity-70 group-hover:opacity-100 transition-opacity"}),t[20]=r,t[21]=p):p=t[21];let b;t[22]!==o||t[23]!==j||t[24]!==p?(b=i.jsx(Gr,{asChild:!0,children:i.jsxs("button",{type:"button",onClick:o,className:"group flex items-center gap-2 text-muted-foreground hover:text-foreground transition-colors",children:[j,p]})}),t[22]=o,t[23]=j,t[24]=p,t[25]=b):b=t[25];let k;t[26]===Symbol.for("react.memo_cache_sentinel")?(k=i.jsx(Ur,{side:"left",children:i.jsx("p",{className:"text-xs",children:"Copy user ID"})}),t[26]=k):k=t[26];let N;t[27]!==b?(N=i.jsxs("div",{className:"flex flex-col",children:[S,i.jsxs("div",{className:"flex items-center justify-between gap-6 py-4",children:[w,i.jsx(Kr,{children:i.jsxs(qr,{children:[b,k]})})]})]}),t[27]=b,t[28]=N):N=t[28];let C;return t[29]!==N||t[30]!==y?(C=i.jsxs("div",{className:"flex flex-col gap-8",children:[u,y,N]}),t[29]=N,t[30]=y,t[31]=C):C=t[31],C}function qe(t){const e=L.c(27),{icon:r,label:n,description:s,control:a,onClick:l,disabled:o}=t,u=o?void 0:l,d=l?"button":void 0,c=l&&!o?0:void 0;let f;e[0]!==o||e[1]!==l?(f=l&&!o?p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),l())}:void 0,e[0]=o,e[1]=l,e[2]=f):f=e[2];const m=l&&!o?"pointer":void 0;let x;e[3]!==m?(x={cursor:m},e[3]=m,e[4]=x):x=e[4];let h;e[5]!==r?(h=i.jsx("span",{className:"text-muted-foreground mt-0.5 shrink-0",children:r}),e[5]=r,e[6]=h):h=e[6];let g;e[7]!==n?(g=i.jsx("p",{className:"text-sm font-medium text-foreground",children:n}),e[7]=n,e[8]=g):g=e[8];let y;e[9]!==s?(y=i.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed",children:s}),e[9]=s,e[10]=y):y=e[10];let S;e[11]!==g||e[12]!==y?(S=i.jsxs("div",{className:"min-w-0",children:[g,y]}),e[11]=g,e[12]=y,e[13]=S):S=e[13];let w;e[14]!==S||e[15]!==h?(w=i.jsxs("div",{className:"flex items-start gap-3 min-w-0 flex-1",children:[h,S]}),e[14]=S,e[15]=h,e[16]=w):w=e[16];let P;e[17]!==a?(P=i.jsx("div",{onClick:Ci,className:"shrink-0",children:a}),e[17]=a,e[18]=P):P=e[18];let j;return e[19]!==u||e[20]!==w||e[21]!==P||e[22]!==d||e[23]!==c||e[24]!==f||e[25]!==x?(j=i.jsxs("div",{className:"flex items-center justify-between gap-6 py-4 border-b border-border last:border-0",onClick:u,role:d,tabIndex:c,onKeyDown:f,style:x,children:[w,P]}),e[19]=u,e[20]=w,e[21]=P,e[22]=d,e[23]=c,e[24]=f,e[25]=x,e[26]=j):j=e[26],j}function Ci(t){return t.stopPropagation()}function yt(){const t=L.c(35),[e,r]=tt();let n;t[0]!==r?(n=async k=>{if(k&&await Notification.requestPermission()!=="granted"){V.error("Notifications denied. Please enable them in your browser settings."),r(_i);return}r(N=>({...N,enableNotifications:k}))},t[0]=r,t[1]=n):n=t[1];const s=n;let a;t[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx("div",{children:i.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Preferences"})}),t[2]=a):a=t[2];let l;t[3]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx(Zr,{size:16}),t[3]=l):l=t[3];let o;t[4]!==r?(o=()=>r(Ai),t[4]=r,t[5]=o):o=t[5];let u;t[6]!==r?(u=k=>r(N=>({...N,devMode:k})),t[6]=r,t[7]=u):u=t[7];let d;t[8]!==e.devMode||t[9]!==u?(d=i.jsx(_e,{checked:e.devMode,onCheckedChange:u}),t[8]=e.devMode,t[9]=u,t[10]=d):d=t[10];let c;t[11]!==o||t[12]!==d?(c=i.jsx(qe,{icon:l,label:"Developer Mode",description:"Show technical details like JSON input/output for tool calls.",onClick:o,control:d}),t[11]=o,t[12]=d,t[13]=c):c=t[13];let f;t[14]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx(hr,{size:16}),t[14]=f):f=t[14];let m;t[15]!==s||t[16]!==e.enableNotifications?(m=i.jsx(qe,{icon:f,label:"Notifications",description:"Play a sound and show a notification when chat messages complete while the app is unfocused.",disabled:typeof Notification>"u",onClick:()=>s(!e.enableNotifications),control:i.jsx(_e,{disabled:typeof Notification>"u",checked:e.enableNotifications,onCheckedChange:s})}),t[15]=s,t[16]=e.enableNotifications,t[17]=m):m=t[17];let x;t[18]===Symbol.for("react.memo_cache_sentinel")?(x=i.jsx(en,{size:16}),t[18]=x):x=t[18];let h;t[19]!==r?(h=k=>r(N=>({...N,toolApprovalLevel:k})),t[19]=r,t[20]=h):h=t[20];let g;t[21]===Symbol.for("react.memo_cache_sentinel")?(g={none:"Always ask",readonly:"Skip read-only",yolo:"Auto-approve all"},t[21]=g):g=t[21];const y=g[e.toolApprovalLevel];let S;t[22]!==y?(S=i.jsx(Ht,{className:"w-36",children:i.jsx("span",{children:y})}),t[22]=y,t[23]=S):S=t[23];let w;t[24]===Symbol.for("react.memo_cache_sentinel")?(w=i.jsx(Ae,{value:"none",textValue:"Always ask",children:i.jsxs("div",{className:"flex flex-col gap-0.5",children:[i.jsx("span",{className:"font-medium",children:"Always ask"}),i.jsx("span",{className:"text-xs text-muted-foreground",children:"Require approval for all tool calls"})]})}),t[24]=w):w=t[24];let P;t[25]===Symbol.for("react.memo_cache_sentinel")?(P=i.jsx(Ae,{value:"readonly",textValue:"Skip read-only",children:i.jsxs("div",{className:"flex flex-col gap-0.5",children:[i.jsx("span",{className:"font-medium",children:"Skip read-only"}),i.jsx("span",{className:"text-xs text-muted-foreground",children:"Auto-approve read-only tools"})]})}),t[25]=P):P=t[25];let j;t[26]===Symbol.for("react.memo_cache_sentinel")?(j=i.jsxs(Vt,{children:[w,P,i.jsx(Ae,{value:"yolo",textValue:"Auto-approve all",children:i.jsxs("div",{className:"flex flex-col gap-0.5",children:[i.jsx("span",{className:"font-medium",children:"Auto-approve all"}),i.jsx("span",{className:"text-xs text-muted-foreground",children:"Execute all tools without approval"})]})})]}),t[26]=j):j=t[26];let p;t[27]!==e.toolApprovalLevel||t[28]!==h||t[29]!==S?(p=i.jsx(qe,{icon:x,label:"Tool Approval",description:"Choose when to require approval before tools execute.",control:i.jsxs(Yt,{value:e.toolApprovalLevel,onValueChange:h,children:[S,j]})}),t[27]=e.toolApprovalLevel,t[28]=h,t[29]=S,t[30]=p):p=t[30];let b;return t[31]!==p||t[32]!==c||t[33]!==m?(b=i.jsxs("div",{className:"flex flex-col gap-6",children:[a,i.jsxs("div",{className:"flex flex-col",children:[c,m,p]})]}),t[31]=p,t[32]=c,t[33]=m,t[34]=b):b=t[34],b}function Ai(t){return{...t,devMode:!t.devMode}}function _i(t){return{...t,enableNotifications:!1}}function bt(t){const e=L.c(22),{icon:r,label:n,description:s,checked:a,onCheckedChange:l}=t;let o;e[0]!==a||e[1]!==l?(o=()=>l(!a),e[0]=a,e[1]=l,e[2]=o):o=e[2];let u;e[3]!==r?(u=i.jsx("span",{className:"text-muted-foreground mt-0.5 shrink-0",children:r}),e[3]=r,e[4]=u):u=e[4];let d;e[5]!==n?(d=i.jsx("p",{className:"text-sm font-medium text-foreground",children:n}),e[5]=n,e[6]=d):d=e[6];let c;e[7]!==s?(c=i.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed",children:s}),e[7]=s,e[8]=c):c=e[8];let f;e[9]!==d||e[10]!==c?(f=i.jsxs("div",{className:"min-w-0",children:[d,c]}),e[9]=d,e[10]=c,e[11]=f):f=e[11];let m;e[12]!==u||e[13]!==f?(m=i.jsxs("div",{className:"flex items-start gap-3 min-w-0 flex-1",children:[u,f]}),e[12]=u,e[13]=f,e[14]=m):m=e[14];let x;e[15]!==a||e[16]!==l?(x=i.jsx("div",{onClick:Oi,className:"shrink-0",children:i.jsx(_e,{checked:a,onCheckedChange:l})}),e[15]=a,e[16]=l,e[17]=x):x=e[17];let h;return e[18]!==o||e[19]!==m||e[20]!==x?(h=i.jsxs("div",{className:"flex items-center justify-between gap-6 py-4 border-b border-border last:border-0 cursor-pointer",onClick:o,children:[m,x]}),e[18]=o,e[19]=m,e[20]=x,e[21]=h):h=e[21],h}function Oi(t){return t.stopPropagation()}function Ei(){const t=L.c(16),[e,r]=tt();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsxs("div",{children:[i.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Experimental"}),i.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"These features are unstable and may change or stop working at any time."})]}),t[0]=n):n=t[0];let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx(zr,{size:16}),t[1]=s):s=t[1];let a;t[2]!==r?(a=f=>r(m=>({...m,experimental_projects:f})),t[2]=r,t[3]=a):a=t[3];let l;t[4]!==e.experimental_projects||t[5]!==a?(l=i.jsx(bt,{icon:s,label:"Projects",description:"Enable the projects feature in the sidebar.",checked:e.experimental_projects,onCheckedChange:a}),t[4]=e.experimental_projects,t[5]=a,t[6]=l):l=t[6];let o;t[7]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx(tn,{size:16}),t[7]=o):o=t[7];let u;t[8]!==r?(u=f=>r(m=>({...m,experimental_tasks:f})),t[8]=r,t[9]=u):u=t[9];let d;t[10]!==e.experimental_tasks||t[11]!==u?(d=i.jsx(bt,{icon:o,label:"Tasks",description:"Enable the tasks feature in the sidebar.",checked:e.experimental_tasks,onCheckedChange:u}),t[10]=e.experimental_tasks,t[11]=u,t[12]=d):d=t[12];let c;return t[13]!==l||t[14]!==d?(c=i.jsxs("div",{className:"flex flex-col gap-6",children:[n,i.jsxs("div",{className:"flex flex-col rounded-lg border border-border bg-muted/25 px-4",children:[l,d]})]}),t[13]=l,t[14]=d,t[15]=c):c=t[15],c}const Ii=Lt({name:be().min(1,"Name is required").max(255,"Name is too long"),slug:be().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:be().optional()});function Di(t){const e=L.c(24),{value:r,onChange:n,name:s}=t,a=v.useRef(null);let l;e[0]!==n?(l=j=>{const p=j.target.files?.[0];if(p){if(p.size>2097152){V.error("Image must be smaller than 2MB");return}const b=new FileReader;b.onerror=()=>{const k=b.error;console.error("FileReader error:",k),V.error(k?.message||"Failed to read image file. Please try again."),a.current&&(a.current.value="")},b.onloadend=()=>{if(b.readyState===FileReader.DONE&&b.result){const k=b.result;n(k)}},b.readAsDataURL(p)}},e[0]=n,e[1]=l):l=e[1];const o=l;let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=()=>{a.current?.click()},e[2]=u):u=e[2];const d=u;let c;e[3]!==n?(c=j=>{j.stopPropagation(),n("")},e[3]=n,e[4]=c):c=e[4];const f=c;let m;e[5]!==o?(m=i.jsx("input",{type:"file",ref:a,className:"hidden",accept:"image/*",onChange:o}),e[5]=o,e[6]=m):m=e[6];let x;e[7]!==f||e[8]!==s||e[9]!==r?(x=r?i.jsxs("div",{className:"relative group",children:[i.jsx("div",{className:"h-20 w-20 rounded-lg border border-border bg-muted/20 overflow-hidden",children:i.jsx("img",{src:r,alt:s||"Organization logo",className:"w-full h-full object-cover"})}),i.jsx("button",{type:"button",onClick:f,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:i.jsx(Gt,{className:"h-3 w-3"})})]}):i.jsxs("button",{type:"button",onClick:d,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:[i.jsx(rn,{className:"h-5 w-5"}),i.jsx("span",{className:"text-xs",children:"Upload"})]}),e[7]=f,e[8]=s,e[9]=r,e[10]=x):x=e[10];const h=r?"Change Logo":"Upload Logo";let g;e[11]!==h?(g=i.jsx(Y,{type:"button",variant:"outline",size:"sm",onClick:d,className:"mb-2",children:h}),e[11]=h,e[12]=g):g=e[12];let y;e[13]!==f||e[14]!==r?(y=r&&i.jsx(Y,{type:"button",variant:"ghost",size:"sm",onClick:f,className:"ml-2",children:"Remove"}),e[13]=f,e[14]=r,e[15]=y):y=e[15];let S;e[16]===Symbol.for("react.memo_cache_sentinel")?(S=i.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Recommended: Square image, at least 200x200px. Max 2MB."}),e[16]=S):S=e[16];let w;e[17]!==g||e[18]!==y?(w=i.jsxs("div",{className:"flex-1",children:[g,y,S]}),e[17]=g,e[18]=y,e[19]=w):w=e[19];let P;return e[20]!==w||e[21]!==m||e[22]!==x?(P=i.jsxs("div",{className:"flex items-start gap-4",children:[m,x,w]}),e[20]=w,e[21]=m,e[22]=x,e[23]=P):P=e[23],P}function Ti(){const t=$e(),{org:e,project:r}=X(),n=Fe(),[s,a]=v.useState(!1),l=$t({resolver:Ft(Ii),values:{name:e.name??"",slug:e.slug??"",logo:e.logo??""}}),o=Me({mutationFn:async c=>{const f={name:c.name,slug:c.slug};c.logo&&(f.logo=c.logo);const m=await et.organization.update({organizationId:e.id,data:f});if(m?.error)throw new Error(m.error.message||"Failed to update organization");return m},onSuccess:c=>{n.invalidateQueries({queryKey:Q.organizations()}),n.invalidateQueries({queryKey:Q.activeOrganization(e.slug)}),V.success("Organization settings updated successfully"),c?.data?.slug&&c.data.slug!==e.slug&&t({to:"/$org/$project/settings",params:{org:c.data.slug,project:r.slug}})},onError:c=>{V.error(c instanceof Error?c.message:"Failed to update organization")},onSettled:()=>{a(!1)}}),u=c=>{a(!0),o.mutate(c)},d=l.formState.isDirty;return i.jsx(Xt,{...l,children:i.jsxs("form",{onSubmit:l.handleSubmit(u),className:"space-y-6",children:[i.jsx(je,{control:l.control,name:"name",render:({field:c})=>i.jsxs(le,{children:[i.jsx(oe,{children:"Organization Name"}),i.jsx(ce,{children:i.jsx(ae,{placeholder:"My Organization",...c,disabled:s})}),i.jsx(ke,{})]})}),i.jsx(je,{control:l.control,name:"slug",render:({field:c})=>i.jsxs(le,{children:[i.jsx(oe,{children:"Organization Slug"}),i.jsx(ce,{children:i.jsx(ae,{placeholder:"my-organization",...c,disabled:s,onChange:f=>{const m=f.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");c.onChange(m)}})}),i.jsx(He,{children:"Used in URLs. Only lowercase letters, numbers, and hyphens are allowed."}),i.jsx(ke,{})]})}),i.jsx(je,{control:l.control,name:"logo",render:({field:c})=>i.jsxs(le,{children:[i.jsx(oe,{children:"Logo"}),i.jsx(ce,{children:i.jsx(Di,{value:c.value,onChange:c.onChange,name:l.watch("name")})}),i.jsx(ke,{})]})}),i.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[i.jsx(Y,{type:"submit",disabled:!d||s,className:"min-w-24",children:s?"Saving...":"Save Changes"}),d&&i.jsx(Y,{type:"button",variant:"outline",onClick:()=>l.reset(),disabled:s,children:"Cancel"})]})]})})}function zi(){const t=L.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsxs("div",{className:"flex flex-col gap-6",children:[i.jsx("div",{children:i.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Organization"})}),i.jsx(Ti,{})]}),t[0]=e):e=t[0],e}const Li=Lt({name:be().min(1,"Name is required").max(200,"Name is too long"),description:be().max(1e3,"Description is too long").nullable(),themeColor:be().nullable()});function $i(){const t=L.c(63),{org:e,project:r}=X(),n=Fe(),s=r.slug===ee;let a;t[0]!==e.id?(a={connectionId:nt,orgId:e.id},t[0]=e.id,t[1]=a):a=t[1];const l=Se(a);let o;t[2]===Symbol.for("react.memo_cache_sentinel")?(o=Ft(Li),t[2]=o):o=t[2];const u=r.name??"",d=r.description??"",c=r.ui?.themeColor??"#60a5fa";let f;t[3]!==u||t[4]!==d||t[5]!==c?(f={resolver:o,values:{name:u,description:d,themeColor:c}},t[3]=u,t[4]=d,t[5]=c,t[6]=f):f=t[6];const m=$t(f);let x;t[7]!==l||t[8]!==r.id||t[9]!==r.ui?.banner||t[10]!==r.ui?.bannerColor||t[11]!==r.ui?.icon?(x=async D=>{const T=await l.callTool({name:"PROJECT_UPDATE",arguments:{projectId:r.id,name:D.name,description:D.description||null,ui:{themeColor:D.themeColor||null,banner:r.ui?.banner??null,bannerColor:r.ui?.bannerColor??null,icon:r.ui?.icon??null}}});return T.structuredContent??T},t[7]=l,t[8]=r.id,t[9]=r.ui?.banner,t[10]=r.ui?.bannerColor,t[11]=r.ui?.icon,t[12]=x):x=t[12];let h;t[13]!==m||t[14]!==e.id||t[15]!==r.slug||t[16]!==n?(h=()=>{n.invalidateQueries({queryKey:Q.project(e.id,r.slug)}),n.invalidateQueries({queryKey:Q.projects(e.id)}),m.reset(m.getValues())},t[13]=m,t[14]=e.id,t[15]=r.slug,t[16]=n,t[17]=h):h=t[17];let g;t[18]!==x||t[19]!==h?(g={mutationFn:x,onSuccess:h,onError:Fi},t[18]=x,t[19]=h,t[20]=g):g=t[20];const y=Me(g);let S;t[21]!==y?(S=async D=>{await y.mutateAsync(D)},t[21]=y,t[22]=S):S=t[22];const w=S;let P;t[23]!==m||t[24]!==w?(P=D=>{D(),m.handleSubmit(w)()},t[23]=m,t[24]=w,t[25]=P):P=t[25];const j=P;let p;t[26]!==m||t[27]!==w?(p=m.handleSubmit(w),t[26]=m,t[27]=w,t[28]=p):p=t[28];let b;t[29]!==s||t[30]!==y.isPending||t[31]!==j?(b=D=>{const{field:T}=D;return i.jsxs(le,{children:[i.jsx(oe,{children:"Project Name"}),i.jsx(ce,{children:i.jsx(ae,{placeholder:"My Project",...T,onBlur:()=>j(T.onBlur),disabled:s||y.isPending})}),s&&i.jsx(He,{children:"The organization admin project name cannot be changed."}),i.jsx(ke,{})]})},t[29]=s,t[30]=y.isPending,t[31]=j,t[32]=b):b=t[32];let k;t[33]!==m.control||t[34]!==b?(k=i.jsx(je,{control:m.control,name:"name",render:b}),t[33]=m.control,t[34]=b,t[35]=k):k=t[35];let N;t[36]===Symbol.for("react.memo_cache_sentinel")?(N=i.jsx(oe,{children:"Slug"}),t[36]=N):N=t[36];let C;t[37]!==r.slug?(C=i.jsx(ce,{children:i.jsx(ae,{value:r.slug,disabled:!0,className:"bg-muted"})}),t[37]=r.slug,t[38]=C):C=t[38];let A;t[39]===Symbol.for("react.memo_cache_sentinel")?(A=i.jsx(He,{children:"The project slug cannot be changed after creation."}),t[39]=A):A=t[39];let O;t[40]!==C?(O=i.jsxs(le,{children:[N,C,A]}),t[40]=C,t[41]=O):O=t[41];let _;t[42]!==y.isPending||t[43]!==j?(_=D=>{const{field:T}=D;return i.jsxs(le,{children:[i.jsx(oe,{children:"Description"}),i.jsx(ce,{children:i.jsx(nn,{placeholder:"Optional project description...",rows:3,...T,value:T.value??"",onBlur:()=>j(T.onBlur),disabled:y.isPending})}),i.jsx(ke,{})]})},t[42]=y.isPending,t[43]=j,t[44]=_):_=t[44];let E;t[45]!==m.control||t[46]!==_?(E=i.jsx(je,{control:m.control,name:"description",render:_}),t[45]=m.control,t[46]=_,t[47]=E):E=t[47];let I;t[48]!==y.isPending||t[49]!==j?(I=D=>{const{field:T}=D;return i.jsxs(le,{children:[i.jsx(oe,{children:"Color"}),i.jsx(ce,{children:i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"size-9 rounded-md border border-input overflow-hidden cursor-pointer shrink-0",style:{backgroundColor:T.value??"#60a5fa"},children:i.jsx("input",{type:"color",value:T.value??"#60a5fa",onChange:B=>T.onChange(B.target.value),onBlur:()=>j(T.onBlur),disabled:y.isPending,className:"opacity-0 w-full h-full cursor-pointer"})}),i.jsx("span",{className:"font-mono text-sm text-muted-foreground",children:T.value??"#60a5fa"})]})}),i.jsx(ke,{})]})},t[48]=y.isPending,t[49]=j,t[50]=I):I=t[50];let z;t[51]!==m.control||t[52]!==I?(z=i.jsx(je,{control:m.control,name:"themeColor",render:I}),t[51]=m.control,t[52]=I,t[53]=z):z=t[53];let F;t[54]!==p||t[55]!==k||t[56]!==O||t[57]!==E||t[58]!==z?(F=i.jsxs("form",{onSubmit:p,className:"space-y-6",children:[k,O,E,z]}),t[54]=p,t[55]=k,t[56]=O,t[57]=E,t[58]=z,t[59]=F):F=t[59];let $;return t[60]!==m||t[61]!==F?($=i.jsx("div",{className:"flex flex-col",children:i.jsx(Xt,{...m,children:F})}),t[60]=m,t[61]=F,t[62]=$):$=t[62],$}function Fi(t){V.error("Failed to update project: "+(t instanceof Error?t.message:"Unknown error"))}function xr(){const t=L.c(45),{org:e,project:r}=X(),n=$e(),s=Fe(),[a,l]=v.useState(""),[o,u]=v.useState(!1),d=r.slug===ee;let c;t[0]!==e.id?(c={connectionId:nt,orgId:e.id},t[0]=e.id,t[1]=c):c=t[1];const f=Se(c);let m;t[2]!==f||t[3]!==r.id?(m=async()=>{const M=await f.callTool({name:"PROJECT_DELETE",arguments:{projectId:r.id}});return M.structuredContent??M},t[2]=f,t[3]=r.id,t[4]=m):m=t[4];let x;t[5]!==n||t[6]!==e.id||t[7]!==e.slug||t[8]!==s?(x=M=>{M.success?(s.invalidateQueries({queryKey:Q.projects(e.id)}),V.success("Project deleted"),n({to:"/$org/$project",params:{org:e.slug,project:ee}})):V.error(M.message??"Failed to delete project")},t[5]=n,t[6]=e.id,t[7]=e.slug,t[8]=s,t[9]=x):x=t[9];let h;t[10]!==m||t[11]!==x?(h={mutationFn:m,onSuccess:x,onError:Mi},t[10]=m,t[11]=x,t[12]=h):h=t[12];const g=Me(h);if(d)return null;const y=a===r.name;let S;t[13]!==g?(S=()=>{g.mutate()},t[13]=g,t[14]=S):S=t[14];const w=S;let P;t[15]===Symbol.for("react.memo_cache_sentinel")?(P=M=>{u(M),M||l("")},t[15]=P):P=t[15];const j=P;let p;t[16]===Symbol.for("react.memo_cache_sentinel")?(p=i.jsx("p",{className:"py-4 text-base font-semibold text-foreground border-b border-border",children:"Danger Zone"}),t[16]=p):p=t[16];let b;t[17]===Symbol.for("react.memo_cache_sentinel")?(b=i.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[i.jsx("p",{className:"text-sm font-medium text-foreground",children:"Delete Project"}),i.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Permanently delete this project and all its data. This action cannot be undone."})]}),t[17]=b):b=t[17];let k;t[18]===Symbol.for("react.memo_cache_sentinel")?(k=i.jsx(sn,{asChild:!0,children:i.jsx(Y,{variant:"outline",className:"shrink-0 bg-destructive/10 text-destructive border-0 hover:bg-destructive/15 hover:text-destructive",children:"Delete Project"})}),t[18]=k):k=t[18];let N;t[19]!==r.name?(N=i.jsxs(an,{children:['Delete "',r.name,'"?']}),t[19]=r.name,t[20]=N):N=t[20];let C;t[21]===Symbol.for("react.memo_cache_sentinel")?(C=i.jsx(ln,{children:"This action cannot be undone. All project data will be permanently deleted."}),t[21]=C):C=t[21];let A;t[22]!==N?(A=i.jsxs(on,{children:[N,C]}),t[22]=N,t[23]=A):A=t[23];let O;t[24]!==r.name?(O=i.jsxs("p",{className:"text-sm mb-2",children:["Type ",i.jsx("strong",{children:r.name})," to confirm:"]}),t[24]=r.name,t[25]=O):O=t[25];let _;t[26]===Symbol.for("react.memo_cache_sentinel")?(_=M=>l(M.target.value),t[26]=_):_=t[26];let E;t[27]!==a||t[28]!==r.name?(E=i.jsx(ae,{value:a,onChange:_,placeholder:r.name}),t[27]=a,t[28]=r.name,t[29]=E):E=t[29];let I;t[30]!==O||t[31]!==E?(I=i.jsxs("div",{className:"py-4",children:[O,E]}),t[30]=O,t[31]=E,t[32]=I):I=t[32];let z;t[33]===Symbol.for("react.memo_cache_sentinel")?(z=i.jsx(cn,{children:"Cancel"}),t[33]=z):z=t[33];const F=!y||g.isPending,$=g.isPending?"Deleting...":"Delete Project";let D;t[34]!==w||t[35]!==F||t[36]!==$?(D=i.jsxs(dn,{children:[z,i.jsx(un,{onClick:w,disabled:F,className:"bg-destructive/10 text-destructive hover:bg-destructive/15 hover:text-destructive border-0",children:$})]}),t[34]=w,t[35]=F,t[36]=$,t[37]=D):D=t[37];let T;t[38]!==A||t[39]!==I||t[40]!==D?(T=i.jsxs(mn,{children:[A,I,D]}),t[38]=A,t[39]=I,t[40]=D,t[41]=T):T=t[41];let B;return t[42]!==o||t[43]!==T?(B=i.jsxs("div",{className:"flex flex-col",children:[p,i.jsxs("div",{className:"flex items-center justify-between gap-6 py-4",children:[b,i.jsxs(fn,{open:o,onOpenChange:j,children:[k,T]})]})]}),t[42]=o,t[43]=T,t[44]=B):B=t[44],B}function Mi(t){V.error("Failed to delete project: "+(t instanceof Error?t.message:"Unknown error"))}function Bi(){const t=L.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("p",{className:"py-4 text-base font-semibold text-foreground border-b border-border",children:"General"}),t[0]=e):e=t[0];let r;return t[1]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsxs("div",{className:"flex flex-col",children:[e,i.jsxs("div",{className:"pt-6 flex flex-col gap-6",children:[i.jsx($i,{}),i.jsx(xr,{})]})]}),t[1]=r):r=t[1],r}function Ri({value:t,onValueChange:e,placeholder:r="Select a connection...",binding:n,bindingType:s,onAddNew:a,className:l,disabled:o=!1}){const[u,d]=v.useState(!1),{installByBinding:c,isInstalling:f}=vn(),m=u||f,x=Qt(),h=pn({connections:x,binding:typeof n=="string"?n:void 0}),g=!n||!x?x??[]:typeof n=="string"?h:Array.isArray(n)&&n.length>0?x.filter(p=>gn(p,n)):x,y=(()=>{if(!s?.startsWith("@"))return null;const[p,b]=s.replace("@","").split("/");return p&&b?{scope:p,appName:b}:null})(),S=(()=>{let p=g;const b=Array.isArray(n)&&n.length>0;if(y&&!b&&(p=p.filter(k=>{const N=k.app_name,C=k.metadata?.scopeName;return N===y.appName&&C===y.scope})),t&&!p.some(k=>k.id===t)){const k=x?.find(N=>N.id===t);if(k)return[k,...p]}return p})(),w=s?.startsWith("@"),P=async()=>{if(w&&s){d(!0);try{const p=await c(s);p&&e(p.id)}finally{d(!1)}return}a?.()},j=S.find(p=>p.id===t);return i.jsxs(Yt,{value:t??"none",onValueChange:p=>e(p==="none"?null:p),disabled:o,children:[i.jsx(Ht,{size:"sm",className:ie("w-[200px]",l),children:i.jsx(Jr,{placeholder:r,children:j?i.jsxs("div",{className:"flex items-center gap-2",children:[j.icon?i.jsx("img",{src:j.icon,alt:j.title,className:"w-4 h-4 rounded shrink-0"}):i.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:j.title.slice(0,1).toUpperCase()}),i.jsx("span",{className:"truncate",children:j.title})]}):r})}),i.jsxs(Vt,{children:[i.jsx(Ae,{value:"none",children:"No connection"}),S.length===0?i.jsx("div",{className:"px-2 py-4 text-center text-sm text-muted-foreground",children:"No compatible connections found"}):S.map(p=>i.jsx(Ae,{value:p.id,children:i.jsxs("div",{className:"flex items-center gap-2",children:[p.icon?i.jsx("img",{src:p.icon,alt:p.title,className:"w-4 h-4 rounded"}):i.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:p.title.slice(0,1).toUpperCase()}),i.jsx("span",{children:p.title})]})},p.id)),(a||w)&&i.jsx("div",{className:"border-t border-border",children:i.jsx(Y,{onPointerDown:p=>p.stopPropagation(),onClick:p=>{p.preventDefault(),p.stopPropagation(),P()},disabled:m||o,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:m?i.jsxs(i.Fragment,{children:[i.jsx(yn,{size:16,className:"animate-spin"}),i.jsx("span",{children:"Connecting..."})]}):i.jsxs(i.Fragment,{children:[i.jsx(Jt,{size:16}),i.jsx("span",{children:"Add Connection"})]})})})]})]})}const Wi=t=>{if(!t||typeof t!="object")return!1;const e=t;return e.type==="text"&&typeof e.text=="string"&&e.text.trim().toLowerCase().startsWith("error")},Ve=t=>{const e=t.structuredContent??t,r=e&&typeof e=="object"?e:null,n=r?.content?.[0]?.text&&typeof r.content[0].text=="string"?r.content[0].text:null;if(r?.isError)throw new Error(n??"Tool call failed");if(Wi(e))throw new Error(e.text);return e};function Gi(t){return t.requiresMcpBinding===!0?!0:t.binding!==void 0}function Ui(t){const e=L.c(57),{plugin:r,isEnabled:n,isSaving:s,pendingBinding:a,description:l,label:o,icon:u,projectId:d,client:c,onBindingChange:f,onToggle:m}=t;let x;e[0]!==r?(x=Gi(r),e[0]=r,e[1]=x):x=e[1];const h=x;let g;e[2]!==r.id||e[3]!==d?(g=Q.projectPluginConfig(d??"",r.id),e[2]=r.id,e[3]=d,e[4]=g):g=e[4];let y;e[5]!==c||e[6]!==r.id||e[7]!==d?(y=async()=>{if(!d)throw new Error("Project ID is required to load plugin config.");const B=await c.callTool({name:"PROJECT_PLUGIN_CONFIG_GET",arguments:{projectId:d,pluginId:r.id}});return Ve(B)},e[5]=c,e[6]=r.id,e[7]=d,e[8]=y):y=e[8];const S=!!d&&h;let w;e[9]!==g||e[10]!==y||e[11]!==S?(w={queryKey:g,queryFn:y,enabled:S},e[9]=g,e[10]=y,e[11]=S,e[12]=w):w=e[12];const{data:P,isLoading:j}=hn(w),p=P?.config?.connectionId??null,b=a!==void 0?a:p;let k;e[13]!==n||e[14]!==s||e[15]!==m||e[16]!==r.id?(k=()=>!s&&m(r.id,!n),e[13]=n,e[14]=s,e[15]=m,e[16]=r.id,e[17]=k):k=e[17];const N=s?void 0:"pointer";let C;e[18]!==N?(C={cursor:N},e[18]=N,e[19]=C):C=e[19];let A;e[20]!==u?(A=u&&i.jsx("span",{className:"text-muted-foreground mt-0.5 shrink-0 [&>svg]:size-4",children:u}),e[20]=u,e[21]=A):A=e[21];let O;e[22]!==o?(O=i.jsx("p",{className:"text-sm font-medium text-foreground",children:o}),e[22]=o,e[23]=O):O=e[23];let _;e[24]!==l?(_=l&&i.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed",children:l}),e[24]=l,e[25]=_):_=e[25];let E;e[26]!==O||e[27]!==_?(E=i.jsxs("div",{className:"min-w-0",children:[O,_]}),e[26]=O,e[27]=_,e[28]=E):E=e[28];let I;e[29]!==E||e[30]!==A?(I=i.jsxs("div",{className:"flex items-start gap-3 min-w-0 flex-1",children:[A,E]}),e[29]=E,e[30]=A,e[31]=I):I=e[31];let z;e[32]!==m||e[33]!==r.id?(z=B=>m(r.id,B),e[32]=m,e[33]=r.id,e[34]=z):z=e[34];let F;e[35]!==n||e[36]!==s||e[37]!==z?(F=i.jsx("div",{onClick:qi,className:"shrink-0",children:i.jsx(_e,{checked:n,onCheckedChange:z,disabled:s})}),e[35]=n,e[36]=s,e[37]=z,e[38]=F):F=e[38];let $;e[39]!==I||e[40]!==F?($=i.jsxs("div",{className:"flex items-center justify-between gap-6 py-4",children:[I,F]}),e[39]=I,e[40]=F,e[41]=$):$=e[41];let D;e[42]!==j||e[43]!==n||e[44]!==s||e[45]!==h||e[46]!==f||e[47]!==r.binding||e[48]!==r.id||e[49]!==b||e[50]!==p?(D=n&&h&&i.jsxs("div",{onClick:Ki,className:"pb-4 pl-7 flex items-center gap-3",children:[i.jsx(Oe,{className:"text-xs text-muted-foreground w-24",children:"Connection"}),i.jsx(Ri,{value:b??null,onValueChange:B=>f(r.id,B,p),binding:r.binding,placeholder:"Select connection...",className:"w-56",disabled:s||j})]}),e[42]=j,e[43]=n,e[44]=s,e[45]=h,e[46]=f,e[47]=r.binding,e[48]=r.id,e[49]=b,e[50]=p,e[51]=D):D=e[51];let T;return e[52]!==$||e[53]!==D||e[54]!==k||e[55]!==C?(T=i.jsxs("div",{className:"flex flex-col border-b border-border last:border-0",onClick:k,style:C,children:[$,D]}),e[52]=$,e[53]=D,e[54]=k,e[55]=C,e[56]=T):T=e[56],T}function Ki(t){return t.stopPropagation()}function qi(t){return t.stopPropagation()}function Yi(){const{org:t,project:e}=X(),r=Fe(),n=Se({connectionId:nt,orgId:t.id}),[s,a]=v.useState({}),[l,o]=v.useState({}),[u,d]=v.useState(!1),c=e.enabledPlugins??[],f=p=>{const b=s[p];return b!==void 0?b:c.includes(p)},m=()=>{const p=new Set(c);for(const[b,k]of Object.entries(s))k?p.add(b):p.delete(b);return Array.from(p)},x=Object.keys(s).length>0||Object.keys(l).length>0,h=(p,b)=>{const k=c.includes(p);a(b===k?N=>{const{[p]:C,...A}=N;return A}:N=>({...N,[p]:b}))},g=(p,b,k)=>{if(b===k){o(N=>{const{[p]:C,...A}=N;return A});return}o(N=>({...N,[p]:b}))},y=Me({mutationFn:async p=>{const b=[];if(p.updatePlugins){const k=await n.callTool({name:"PROJECT_UPDATE",arguments:{projectId:e.id,enabledPlugins:p.enabledPlugins}});b.push(Ve(k))}if(p.bindingUpdates.length>0){const k=await Promise.all(p.bindingUpdates.map(async({pluginId:N,connectionId:C})=>{const A=await n.callTool({name:"PROJECT_PLUGIN_CONFIG_UPDATE",arguments:{projectId:e.id,pluginId:N,connectionId:C}});return Ve(A)}));b.push(...k)}return b},onSuccess:(p,b)=>{b.updatePlugins&&(r.invalidateQueries({queryKey:Q.project(t.id,e.slug)}),r.invalidateQueries({queryKey:Q.projects(t.id)})),b.bindingUpdates.forEach(({pluginId:k})=>{r.invalidateQueries({queryKey:Q.projectPluginConfig(e.id??"",k)})}),a({}),o({}),V.success("Plugins updated successfully")},onError:p=>{V.error("Failed to update plugins: "+(p instanceof Error?p.message:"Unknown error"))},onSettled:()=>{d(!1)}}),S=()=>{d(!0),y.mutate({enabledPlugins:m(),updatePlugins:Object.keys(s).length>0,bindingUpdates:Object.entries(l).map(([p,b])=>({pluginId:p,connectionId:b}))})},w=()=>{a({}),o({})},P=p=>{const b=Lr.find(k=>k.pluginId===p);return b?{label:b.label,icon:b.items[0]?.icon}:null},j=p=>Ge.find(k=>k.id===p)?.description??null;return Ge.length===0?i.jsx("p",{className:"text-sm text-muted-foreground",children:"No plugins available."}):i.jsxs("div",{className:"space-y-4",children:[i.jsx("div",{className:"flex flex-col",children:Ge.map(p=>{const b=P(p.id),k=j(p.id),N=f(p.id);return i.jsx(Ui,{plugin:p,isEnabled:N,isSaving:u,pendingBinding:l[p.id],description:k,label:b?.label??p.id,icon:b?.icon??i.jsx(xn,{size:14}),projectId:e.id,client:n,onBindingChange:g,onToggle:h},p.id)})}),i.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[i.jsx(Y,{variant:"outline",onClick:w,disabled:!x||u,children:"Cancel"}),i.jsx(Y,{onClick:S,disabled:!x||u,className:"min-w-24",children:u?"Saving...":"Save Changes"})]})]})}function jt(){const t=L.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsxs("div",{className:"flex flex-col gap-6",children:[i.jsx("div",{children:i.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Plugins"})}),i.jsx(Yi,{})]}),t[0]=e):e=t[0],e}function Hi(){const t=L.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsxs("div",{className:"flex flex-col gap-6",children:[i.jsxs("div",{children:[i.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Danger Zone"}),i.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Irreversible and destructive actions."})]}),i.jsx(xr,{})]}),t[0]=e):e=t[0],e}var kt=function(e,r){for(var n=arguments.length,s=new Array(n>2?n-2:0),a=2;a<n;a++)s[a-2]=arguments[a];if(typeof console<"u"&&console.warn&&(r===void 0&&console.warn("LogUtils requires an error message argument"),!e))if(r===void 0)console.warn("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=0;console.warn(r.replace(/%s/g,()=>s[l++]))}};function Vi(t){return t&&typeof t=="object"&&"className"in t&&typeof t.className=="string"?t.className:""}function Xi(t){return(t%180+180)%180}var Qi=function(e){var{width:r,height:n}=e,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=Xi(s),l=a*Math.PI/180,o=Math.atan(n/r),u=l>o&&l<Math.PI-o?n/Math.sin(l):r/Math.cos(l);return Math.abs(u)};function pr(t,e){if(e<1)return[];if(e===1)return t;for(var r=[],n=0;n<t.length;n+=e){var s=t[n];s!==void 0&&r.push(s)}return r}function Ji(t,e,r){var n={width:t.width+e.width,height:t.height+e.height};return Qi(n,r)}function Zi(t,e,r){var n=r==="width",{x:s,y:a,width:l,height:o}=t;return e===1?{start:n?s:a,end:n?s+l:a+o}:{start:n?s+l:a+o,end:n?s:a}}function Ee(t,e,r,n,s){if(t*e<t*n||t*e>t*s)return!1;var a=r();return t*(e-t*a/2-n)>=0&&t*(e+t*a/2-s)<=0}function ea(t,e){return pr(t,e+1)}function ta(t,e,r,n,s){for(var a=(n||[]).slice(),{start:l,end:o}=e,u=0,d=1,c=l,f=function(){var h=n?.[u];if(h===void 0)return{v:pr(n,d)};var g=u,y,S=()=>(y===void 0&&(y=r(h,g)),y),w=h.coordinate,P=u===0||Ee(t,w,S,c,o);P||(u=0,c=l,d+=1),P&&(c=w+t*(S()/2+s),u+=d)},m;d<=a.length;)if(m=f(),m)return m.v;return[]}function ra(t,e,r,n,s){var a=(n||[]).slice(),l=a.length;if(l===0)return[];for(var{start:o,end:u}=e,d=1;d<=l;d++){for(var c=(l-1)%d,f=o,m=!0,x=function(){var j=n[g];if(j==null)return 0;var p=g,b,k=()=>(b===void 0&&(b=r(j,p)),b),N=j.coordinate,C=g===c||Ee(t,N,k,f,u);if(!C)return m=!1,1;C&&(f=N+t*(k()/2+s))},h,g=c;g<l&&(h=x(),!(h!==0&&h===1));g+=d);if(m){for(var y=[],S=c;S<l;S+=d){var w=n[S];w!=null&&y.push(w)}return y}}return[]}function St(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function U(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?St(Object(r),!0).forEach(function(n){na(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):St(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function na(t,e,r){return(e=ia(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ia(t){var e=aa(t,"string");return typeof e=="symbol"?e:e+""}function aa(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function sa(t,e,r,n,s){for(var a=(n||[]).slice(),l=a.length,{start:o}=e,{end:u}=e,d=function(m){var x=a[m];if(x==null)return 1;var h=x,g,y=()=>(g===void 0&&(g=r(x,m)),g);if(m===l-1){var S=t*(h.coordinate+t*y()/2-u);a[m]=h=U(U({},h),{},{tickCoord:S>0?h.coordinate-S*t:h.coordinate})}else a[m]=h=U(U({},h),{},{tickCoord:h.coordinate});if(h.tickCoord!=null){var w=Ee(t,h.tickCoord,y,o,u);w&&(u=h.tickCoord-t*(y()/2+s),a[m]=U(U({},h),{},{isShow:!0}))}},c=l-1;c>=0;c--)d(c);return a}function la(t,e,r,n,s,a){var l=(n||[]).slice(),o=l.length,{start:u,end:d}=e;if(a){var c=n[o-1];if(c!=null){var f=r(c,o-1),m=t*(c.coordinate+t*f/2-d);if(l[o-1]=c=U(U({},c),{},{tickCoord:m>0?c.coordinate-m*t:c.coordinate}),c.tickCoord!=null){var x=Ee(t,c.tickCoord,()=>f,u,d);x&&(d=c.tickCoord-t*(f/2+s),l[o-1]=U(U({},c),{},{isShow:!0}))}}}for(var h=a?o-1:o,g=function(w){var P=l[w];if(P==null)return 1;var j=P,p,b=()=>(p===void 0&&(p=r(P,w)),p);if(w===0){var k=t*(j.coordinate-t*b()/2-u);l[w]=j=U(U({},j),{},{tickCoord:k<0?j.coordinate-k*t:j.coordinate})}else l[w]=j=U(U({},j),{},{tickCoord:j.coordinate});if(j.tickCoord!=null){var N=Ee(t,j.tickCoord,b,u,d);N&&(u=j.tickCoord+t*(b()/2+s),l[w]=U(U({},j),{},{isShow:!0}))}},y=0;y<h;y++)g(y);return l}function dt(t,e,r){var{tick:n,ticks:s,viewBox:a,minTickGap:l,orientation:o,interval:u,tickFormatter:d,unit:c,angle:f}=t;if(!s||!s.length||!n)return[];if(q(u)||Zt.isSsr){var m;return(m=ea(s,q(u)?u:0))!==null&&m!==void 0?m:[]}var x=[],h=o==="top"||o==="bottom"?"width":"height",g=c&&h==="width"?Ue(c,{fontSize:e,letterSpacing:r}):{width:0,height:0},y=(p,b)=>{var k=typeof d=="function"?d(p.value,b):p.value;return h==="width"?Ji(Ue(k,{fontSize:e,letterSpacing:r}),g,f):Ue(k,{fontSize:e,letterSpacing:r})[h]},S=s[0],w=s[1],P=s.length>=2&&S!=null&&w!=null?bn(w.coordinate-S.coordinate):1,j=Zi(a,P,h);return u==="equidistantPreserveStart"?ta(P,j,y,s,l):u==="equidistantPreserveEnd"?ra(P,j,y,s,l):(u==="preserveStart"||u==="preserveStartEnd"?x=la(P,j,y,s,l,u==="preserveStartEnd"):x=sa(P,j,y,s,l),x.filter(p=>p.isShow))}var oa=t=>{var{ticks:e,label:r,labelGapWithTick:n=5,tickSize:s=0,tickMargin:a=0}=t,l=0;if(e){Array.from(e).forEach(c=>{if(c){var f=c.getBoundingClientRect();f.width>l&&(l=f.width)}});var o=r?r.getBoundingClientRect().width:0,u=s+a,d=l+u+o+(r?n:0);return Math.round(d)}return 0},ca=["axisLine","width","height","className","hide","ticks","axisType"];function da(t,e){if(t==null)return{};var r,n,s=ua(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(n=0;n<a.length;n++)r=a[n],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(s[r]=t[r])}return s}function ua(t,e){if(t==null)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.indexOf(n)!==-1)continue;r[n]=t[n]}return r}function fe(){return fe=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},fe.apply(null,arguments)}function wt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function R(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?wt(Object(r),!0).forEach(function(n){ma(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):wt(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function ma(t,e,r){return(e=fa(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function fa(t){var e=ha(t,"string");return typeof e=="symbol"?e:e+""}function ha(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var J={x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd",zIndex:Be.axis};function xa(t){var{x:e,y:r,width:n,height:s,orientation:a,mirror:l,axisLine:o,otherSvgProps:u}=t;if(!o)return null;var d=R(R(R({},u),Ne(o)),{},{fill:"none"});if(a==="top"||a==="bottom"){var c=+(a==="top"&&!l||a==="bottom"&&l);d=R(R({},d),{},{x1:e,y1:r+c*s,x2:e+n,y2:r+c*s})}else{var f=+(a==="left"&&!l||a==="right"&&l);d=R(R({},d),{},{x1:e+f*n,y1:r,x2:e+f*n,y2:r+s})}return v.createElement("line",fe({},d,{className:ne("recharts-cartesian-axis-line",er(o,"className"))}))}function pa(t,e,r,n,s,a,l,o,u){var d,c,f,m,x,h,g=o?-1:1,y=t.tickSize||l,S=q(t.tickCoord)?t.tickCoord:t.coordinate;switch(a){case"top":d=c=t.coordinate,m=r+ +!o*s,f=m-g*y,h=f-g*u,x=S;break;case"left":f=m=t.coordinate,c=e+ +!o*n,d=c-g*y,x=d-g*u,h=S;break;case"right":f=m=t.coordinate,c=e+ +o*n,d=c+g*y,x=d+g*u,h=S;break;default:d=c=t.coordinate,m=r+ +o*s,f=m+g*y,h=f+g*u,x=S;break}return{line:{x1:d,y1:f,x2:c,y2:m},tick:{x,y:h}}}function ga(t,e){switch(t){case"left":return e?"start":"end";case"right":return e?"end":"start";default:return"middle"}}function va(t,e){switch(t){case"left":case"right":return"middle";case"top":return e?"start":"end";default:return e?"end":"start"}}function ya(t){var{option:e,tickProps:r,value:n}=t,s,a=ne(r.className,"recharts-cartesian-axis-tick-value");if(v.isValidElement(e))s=v.cloneElement(e,R(R({},r),{},{className:a}));else if(typeof e=="function")s=e(R(R({},r),{},{className:a}));else{var l="recharts-cartesian-axis-tick-value";typeof e!="boolean"&&(l=ne(l,Vi(e))),s=v.createElement(Nn,fe({},r,{className:l}),n)}return s}var ba=v.forwardRef((t,e)=>{var{ticks:r=[],tick:n,tickLine:s,stroke:a,tickFormatter:l,unit:o,padding:u,tickTextProps:d,orientation:c,mirror:f,x:m,y:x,width:h,height:g,tickSize:y,tickMargin:S,fontSize:w,letterSpacing:P,getTicksConfig:j,events:p,axisType:b}=t,k=dt(R(R({},j),{},{ticks:r}),w,P),N=ga(c,f),C=va(c,f),A=Ne(j),O=Sn(n),_={};typeof s=="object"&&(_=s);var E=R(R({},A),{},{fill:"none"},_),I=k.map($=>R({entry:$},pa($,m,x,h,g,c,y,f,S))),z=I.map($=>{var{entry:D,line:T}=$;return v.createElement(me,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(D.value,"-").concat(D.coordinate,"-").concat(D.tickCoord)},s&&v.createElement("line",fe({},E,T,{className:ne("recharts-cartesian-axis-tick-line",er(s,"className"))})))}),F=I.map(($,D)=>{var T,B,{entry:M,tick:te}=$,Pe=R(R(R(R({verticalAnchor:C},A),{},{textAnchor:N,stroke:"none",fill:a},te),{},{index:D,payload:M,visibleTicksCount:k.length,tickFormatter:l,padding:u},d),{},{angle:(T=(B=d?.angle)!==null&&B!==void 0?B:A.angle)!==null&&T!==void 0?T:0}),Ce=R(R({},Pe),O);return v.createElement(me,fe({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(M.value,"-").concat(M.coordinate,"-").concat(M.tickCoord)},wn(p,M,D)),n&&v.createElement(ya,{option:n,tickProps:Ce,value:"".concat(typeof l=="function"?l(M.value,D):M.value).concat(o||"")}))});return v.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(b,"-ticks")},F.length>0&&v.createElement(Re,{zIndex:Be.label},v.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(b,"-tick-labels"),ref:e},F)),z.length>0&&v.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(b,"-tick-lines")},z))}),ja=v.forwardRef((t,e)=>{var{axisLine:r,width:n,height:s,className:a,hide:l,ticks:o,axisType:u}=t,d=da(t,ca),[c,f]=v.useState(""),[m,x]=v.useState(""),h=v.useRef(null);v.useImperativeHandle(e,()=>({getCalculatedWidth:()=>{var y;return oa({ticks:h.current,label:(y=t.labelRef)===null||y===void 0?void 0:y.current,labelGapWithTick:5,tickSize:t.tickSize,tickMargin:t.tickMargin})}}));var g=v.useCallback(y=>{if(y){var S=y.getElementsByClassName("recharts-cartesian-axis-tick-value");h.current=S;var w=S[0];if(w){var P=window.getComputedStyle(w),j=P.fontSize,p=P.letterSpacing;(j!==c||p!==m)&&(f(j),x(p))}}},[c,m]);return l||n!=null&&n<=0||s!=null&&s<=0?null:v.createElement(Re,{zIndex:t.zIndex},v.createElement(me,{className:ne("recharts-cartesian-axis",a)},v.createElement(xa,{x:t.x,y:t.y,width:n,height:s,orientation:t.orientation,mirror:t.mirror,axisLine:r,otherSvgProps:Ne(t)}),v.createElement(ba,{ref:g,axisType:u,events:d,fontSize:c,getTicksConfig:t,height:t.height,letterSpacing:m,mirror:t.mirror,orientation:t.orientation,padding:t.padding,stroke:t.stroke,tick:t.tick,tickFormatter:t.tickFormatter,tickLine:t.tickLine,tickMargin:t.tickMargin,tickSize:t.tickSize,tickTextProps:t.tickTextProps,ticks:o,unit:t.unit,width:t.width,x:t.x,y:t.y}),v.createElement(jn,{x:t.x,y:t.y,width:t.width,height:t.height,lowerWidth:t.width,upperWidth:t.width},v.createElement(kn,{label:t.label,labelRef:t.labelRef}),t.children)))}),ut=v.forwardRef((t,e)=>{var r=we(t,J);return v.createElement(ja,fe({},r,{ref:e}))});ut.displayName="CartesianAxis";var ka=["x1","y1","x2","y2","key"],Sa=["offset"],wa=["xAxisId","yAxisId"],Na=["xAxisId","yAxisId"];function Nt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function K(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Nt(Object(r),!0).forEach(function(n){Pa(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Nt(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Pa(t,e,r){return(e=Ca(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ca(t){var e=Aa(t,"string");return typeof e=="symbol"?e:e+""}function Aa(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function de(){return de=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},de.apply(null,arguments)}function ze(t,e){if(t==null)return{};var r,n,s=_a(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(n=0;n<a.length;n++)r=a[n],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(s[r]=t[r])}return s}function _a(t,e){if(t==null)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.indexOf(n)!==-1)continue;r[n]=t[n]}return r}var Oa=t=>{var{fill:e}=t;if(!e||e==="none")return null;var{fillOpacity:r,x:n,y:s,width:a,height:l,ry:o}=t;return v.createElement("rect",{x:n,y:s,ry:o,width:a,height:l,stroke:"none",fill:e,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function gr(t){var{option:e,lineItemProps:r}=t,n;if(v.isValidElement(e))n=v.cloneElement(e,r);else if(typeof e=="function")n=e(r);else{var s,{x1:a,y1:l,x2:o,y2:u,key:d}=r,c=ze(r,ka),f=(s=Ne(c))!==null&&s!==void 0?s:{},{offset:m}=f,x=ze(f,Sa);n=v.createElement("line",de({},x,{x1:a,y1:l,x2:o,y2:u,fill:"none",key:d}))}return n}function Ea(t){var{x:e,width:r,horizontal:n=!0,horizontalPoints:s}=t;if(!n||!s||!s.length)return null;var{xAxisId:a,yAxisId:l}=t,o=ze(t,wa),u=s.map((d,c)=>{var f=K(K({},o),{},{x1:e,y1:d,x2:e+r,y2:d,key:"line-".concat(c),index:c});return v.createElement(gr,{key:"line-".concat(c),option:n,lineItemProps:f})});return v.createElement("g",{className:"recharts-cartesian-grid-horizontal"},u)}function Ia(t){var{y:e,height:r,vertical:n=!0,verticalPoints:s}=t;if(!n||!s||!s.length)return null;var{xAxisId:a,yAxisId:l}=t,o=ze(t,Na),u=s.map((d,c)=>{var f=K(K({},o),{},{x1:d,y1:e,x2:d,y2:e+r,key:"line-".concat(c),index:c});return v.createElement(gr,{option:n,lineItemProps:f,key:"line-".concat(c)})});return v.createElement("g",{className:"recharts-cartesian-grid-vertical"},u)}function Da(t){var{horizontalFill:e,fillOpacity:r,x:n,y:s,width:a,height:l,horizontalPoints:o,horizontal:u=!0}=t;if(!u||!e||!e.length||o==null)return null;var d=o.map(f=>Math.round(f+s-s)).sort((f,m)=>f-m);s!==d[0]&&d.unshift(0);var c=d.map((f,m)=>{var x=d[m+1],h=x==null,g=h?s+l-f:x-f;if(g<=0)return null;var y=m%e.length;return v.createElement("rect",{key:"react-".concat(m),y:f,x:n,height:g,width:a,stroke:"none",fill:e[y],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return v.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},c)}function Ta(t){var{vertical:e=!0,verticalFill:r,fillOpacity:n,x:s,y:a,width:l,height:o,verticalPoints:u}=t;if(!e||!r||!r.length)return null;var d=u.map(f=>Math.round(f+s-s)).sort((f,m)=>f-m);s!==d[0]&&d.unshift(0);var c=d.map((f,m)=>{var x=d[m+1],h=x==null,g=h?s+l-f:x-f;if(g<=0)return null;var y=m%r.length;return v.createElement("rect",{key:"react-".concat(m),x:f,y:a,width:g,height:o,stroke:"none",fill:r[y],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return v.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},c)}var za=(t,e)=>{var{xAxis:r,width:n,height:s,offset:a}=t;return tr(dt(K(K(K({},J),r),{},{ticks:rr(r),viewBox:{x:0,y:0,width:n,height:s}})),a.left,a.left+a.width,e)},La=(t,e)=>{var{yAxis:r,width:n,height:s,offset:a}=t;return tr(dt(K(K(K({},J),r),{},{ticks:rr(r),viewBox:{x:0,y:0,width:n,height:s}})),a.top,a.top+a.height,e)},$a={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:Be.grid};function vr(t){var e=Pn(),r=Cn(),n=An(),s=K(K({},we(t,$a)),{},{x:q(t.x)?t.x:n.left,y:q(t.y)?t.y:n.top,width:q(t.width)?t.width:n.width,height:q(t.height)?t.height:n.height}),{xAxisId:a,yAxisId:l,x:o,y:u,width:d,height:c,syncWithTicks:f,horizontalValues:m,verticalValues:x}=s,h=Ie(),g=H(C=>ft(C,"xAxis",a,h)),y=H(C=>ft(C,"yAxis",l,h));if(!ht(d)||!ht(c)||!q(o)||!q(u))return null;var S=s.verticalCoordinatesGenerator||za,w=s.horizontalCoordinatesGenerator||La,{horizontalPoints:P,verticalPoints:j}=s;if((!P||!P.length)&&typeof w=="function"){var p=m&&m.length,b=w({yAxis:y?K(K({},y),{},{ticks:p?m:y.ticks}):void 0,width:e??d,height:r??c,offset:n},p?!0:f);kt(Array.isArray(b),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof b,"]")),Array.isArray(b)&&(P=b)}if((!j||!j.length)&&typeof S=="function"){var k=x&&x.length,N=S({xAxis:g?K(K({},g),{},{ticks:k?x:g.ticks}):void 0,width:e??d,height:r??c,offset:n},k?!0:f);kt(Array.isArray(N),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof N,"]")),Array.isArray(N)&&(j=N)}return v.createElement(Re,{zIndex:s.zIndex},v.createElement("g",{className:"recharts-cartesian-grid"},v.createElement(Oa,{fill:s.fill,fillOpacity:s.fillOpacity,x:s.x,y:s.y,width:s.width,height:s.height,ry:s.ry}),v.createElement(Da,de({},s,{horizontalPoints:P})),v.createElement(Ta,de({},s,{verticalPoints:j})),v.createElement(Ea,de({},s,{offset:n,horizontalPoints:P,xAxis:g,yAxis:y})),v.createElement(Ia,de({},s,{offset:n,verticalPoints:j,xAxis:g,yAxis:y}))))}vr.displayName="CartesianGrid";var yr=(t,e,r)=>nr(t,"xAxis",at(t,e),r),br=(t,e,r)=>ir(t,"xAxis",at(t,e),r),jr=(t,e,r)=>nr(t,"yAxis",st(t,e),r),kr=(t,e,r)=>ir(t,"yAxis",st(t,e),r),Fa=We([it,yr,jr,br,kr],(t,e,r,n,s)=>ar(t,"xAxis")?xt(e,n,!1):xt(r,s,!1)),Ma=(t,e)=>e,Sr=We([In,Ma],(t,e)=>t.filter(r=>r.type==="area").find(r=>r.id===e)),wr=t=>{var e=it(t),r=ar(e,"xAxis");return r?"yAxis":"xAxis"},Ba=(t,e)=>{var r=wr(t);return r==="yAxis"?st(t,e):at(t,e)},Ra=(t,e,r)=>Dn(t,wr(t),Ba(t,e),r),Wa=We([Sr,Ra],(t,e)=>{var r;if(!(t==null||e==null)){var{stackId:n}=t,s=En(t);if(!(n==null||s==null)){var a=(r=e[n])===null||r===void 0?void 0:r.stackedData,l=a?.find(o=>o.key===s);if(l!=null)return l.map(o=>[o[0],o[1]])}}}),Ga=We([it,yr,jr,br,kr,Wa,_n,Fa,Sr,On],(t,e,r,n,s,a,l,o,u,d)=>{var{chartData:c,dataStartIndex:f,dataEndIndex:m}=l;if(!(u==null||t!=="horizontal"&&t!=="vertical"||e==null||r==null||n==null||s==null||n.length===0||s.length===0||o==null)){var{data:x}=u,h;if(x&&x.length>0?h=x:h=c?.slice(f,m+1),h!=null)return os({layout:t,xAxis:e,yAxis:r,xAxisTicks:n,yAxisTicks:s,dataStartIndex:f,areaSettings:u,stackedData:a,displayedData:h,chartBaseValue:d,bandSize:o})}}),Ua=["id"],Ka=["activeDot","animationBegin","animationDuration","animationEasing","connectNulls","dot","fill","fillOpacity","hide","isAnimationActive","legendType","stroke","xAxisId","yAxisId"];function ue(){return ue=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},ue.apply(null,arguments)}function Nr(t,e){if(t==null)return{};var r,n,s=qa(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(n=0;n<a.length;n++)r=a[n],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(s[r]=t[r])}return s}function qa(t,e){if(t==null)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.indexOf(n)!==-1)continue;r[n]=t[n]}return r}function Pt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function ye(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Pt(Object(r),!0).forEach(function(n){Ya(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Pt(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Ya(t,e,r){return(e=Ha(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ha(t){var e=Va(t,"string");return typeof e=="symbol"?e:e+""}function Va(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Le(t,e){return t&&t!=="none"?t:e}var Xa=t=>{var{dataKey:e,name:r,stroke:n,fill:s,legendType:a,hide:l}=t;return[{inactive:l,dataKey:e,type:a,color:Le(n,s),value:lr(r,e),payload:t}]},Qa=v.memo(t=>{var{dataKey:e,data:r,stroke:n,strokeWidth:s,fill:a,name:l,hide:o,unit:u,tooltipType:d,id:c}=t,f={dataDefinedOnItem:r,getPosition:Mn,settings:{stroke:n,strokeWidth:s,fill:a,dataKey:e,nameKey:void 0,name:lr(l,e),hide:o,type:d,color:Le(n,a),unit:u,graphicalItemId:c}};return v.createElement(Fn,{tooltipEntrySettings:f})});function Ja(t){var{clipPathId:e,points:r,props:n}=t,{needClip:s,dot:a,dataKey:l}=n,o=Ne(n);return v.createElement(ei,{points:r,dot:a,className:"recharts-area-dots",dotClassName:"recharts-area-dot",dataKey:l,baseProps:o,needClip:s,clipPathId:e})}function Za(t){var{showLabels:e,children:r,points:n}=t,s=n.map(a=>{var l,o,u={x:(l=a.x)!==null&&l!==void 0?l:0,y:(o=a.y)!==null&&o!==void 0?o:0,width:0,lowerWidth:0,upperWidth:0,height:0};return ye(ye({},u),{},{value:a.value,payload:a.payload,parentViewBox:void 0,viewBox:u,fill:void 0})});return v.createElement(Jn,{value:e?s:void 0},r)}function Ct(t){var{points:e,baseLine:r,needClip:n,clipPathId:s,props:a}=t,{layout:l,type:o,stroke:u,connectNulls:d,isRange:c}=a,{id:f}=a,m=Nr(a,Ua),x=Ne(m),h=Zn(m);return v.createElement(v.Fragment,null,e?.length>1&&v.createElement(me,{clipPath:n?"url(#clipPath-".concat(s,")"):void 0},v.createElement(Ke,ue({},h,{id:f,points:e,connectNulls:d,type:o,baseLine:r,layout:l,stroke:"none",className:"recharts-area-area"})),u!=="none"&&v.createElement(Ke,ue({},x,{className:"recharts-area-curve",layout:l,type:o,connectNulls:d,fill:"none",points:e})),u!=="none"&&c&&v.createElement(Ke,ue({},x,{className:"recharts-area-curve",layout:l,type:o,connectNulls:d,fill:"none",points:r}))),v.createElement(Ja,{points:e,props:m,clipPathId:s}))}function es(t){var e,r,{alpha:n,baseLine:s,points:a,strokeWidth:l}=t,o=(e=a[0])===null||e===void 0?void 0:e.y,u=(r=a[a.length-1])===null||r===void 0?void 0:r.y;if(!Te(o)||!Te(u))return null;var d=n*Math.abs(o-u),c=Math.max(...a.map(f=>f.x||0));return q(s)?c=Math.max(s,c):s&&Array.isArray(s)&&s.length&&(c=Math.max(...s.map(f=>f.x||0),c)),q(c)?v.createElement("rect",{x:0,y:o<u?o:o-d,width:c+(l?parseInt("".concat(l),10):1),height:Math.floor(d)}):null}function ts(t){var e,r,{alpha:n,baseLine:s,points:a,strokeWidth:l}=t,o=(e=a[0])===null||e===void 0?void 0:e.x,u=(r=a[a.length-1])===null||r===void 0?void 0:r.x;if(!Te(o)||!Te(u))return null;var d=n*Math.abs(o-u),c=Math.max(...a.map(f=>f.y||0));return q(s)?c=Math.max(s,c):s&&Array.isArray(s)&&s.length&&(c=Math.max(...s.map(f=>f.y||0),c)),q(c)?v.createElement("rect",{x:o<u?o:o-d,y:0,width:d,height:Math.floor(c+(l?parseInt("".concat(l),10):1))}):null}function rs(t){var{alpha:e,layout:r,points:n,baseLine:s,strokeWidth:a}=t;return r==="vertical"?v.createElement(es,{alpha:e,points:n,baseLine:s,strokeWidth:a}):v.createElement(ts,{alpha:e,points:n,baseLine:s,strokeWidth:a})}function ns(t){var{needClip:e,clipPathId:r,props:n,previousPointsRef:s,previousBaselineRef:a}=t,{points:l,baseLine:o,isAnimationActive:u,animationBegin:d,animationDuration:c,animationEasing:f,onAnimationStart:m,onAnimationEnd:x}=n,h=v.useMemo(()=>({points:l,baseLine:o}),[l,o]),g=Yn(h,"recharts-area-"),y=lt(),[S,w]=v.useState(!1),P=!S,j=v.useCallback(()=>{typeof x=="function"&&x(),w(!1)},[x]),p=v.useCallback(()=>{typeof m=="function"&&m(),w(!0)},[m]);if(y==null)return null;var b=s.current,k=a.current;return v.createElement(Za,{showLabels:P,points:l},n.children,v.createElement(Hn,{animationId:g,begin:d,duration:c,isActive:u,easing:f,onAnimationEnd:j,onAnimationStart:p,key:g},N=>{if(b){var C=b.length/l.length,A=N===1?l:l.map((_,E)=>{var I=Math.floor(E*C);if(b[I]){var z=b[I];return ye(ye({},_),{},{x:ve(z.x,_.x,N),y:ve(z.y,_.y,N)})}return _}),O;return q(o)?O=ve(k,o,N):Vn(o)||Xn(o)?O=ve(k,0,N):O=o.map((_,E)=>{var I=Math.floor(E*C);if(Array.isArray(k)&&k[I]){var z=k[I];return ye(ye({},_),{},{x:ve(z.x,_.x,N),y:ve(z.y,_.y,N)})}return _}),N>0&&(s.current=A,a.current=O),v.createElement(Ct,{points:A,baseLine:O,needClip:e,clipPathId:r,props:n})}return N>0&&(s.current=l,a.current=o),v.createElement(me,null,u&&v.createElement("defs",null,v.createElement("clipPath",{id:"animationClipPath-".concat(r)},v.createElement(rs,{alpha:N,points:l,baseLine:o,layout:y,strokeWidth:n.strokeWidth}))),v.createElement(me,{clipPath:"url(#animationClipPath-".concat(r,")")},v.createElement(Ct,{points:l,baseLine:o,needClip:e,clipPathId:r,props:n})))}),v.createElement(Qn,{label:n.label}))}function is(t){var{needClip:e,clipPathId:r,props:n}=t,s=v.useRef(null),a=v.useRef();return v.createElement(ns,{needClip:e,clipPathId:r,props:n,previousPointsRef:s,previousBaselineRef:a})}class as extends v.PureComponent{render(){var{hide:e,dot:r,points:n,className:s,top:a,left:l,needClip:o,xAxisId:u,yAxisId:d,width:c,height:f,id:m,baseLine:x,zIndex:h}=this.props;if(e)return null;var g=ne("recharts-area",s),y=m,{r:S,strokeWidth:w}=Un(r),P=Kn(r),j=S*2+w,p=o?"url(#clipPath-".concat(P?"":"dots-").concat(y,")"):void 0;return v.createElement(Re,{zIndex:h},v.createElement(me,{className:g},o&&v.createElement("defs",null,v.createElement(qn,{clipPathId:y,xAxisId:u,yAxisId:d}),!P&&v.createElement("clipPath",{id:"clipPath-dots-".concat(y)},v.createElement("rect",{x:l-j/2,y:a-j/2,width:c+j,height:f+j}))),v.createElement(is,{needClip:o,clipPathId:y,props:this.props})),v.createElement(pt,{points:n,mainColor:Le(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:p}),this.props.isRange&&Array.isArray(x)&&v.createElement(pt,{points:x,mainColor:Le(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:p}))}}var Pr={activeDot:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",connectNulls:!1,dot:!1,fill:"#3182bd",fillOpacity:.6,hide:!1,isAnimationActive:"auto",legendType:"line",stroke:"#3182bd",strokeWidth:1,type:"linear",label:!1,xAxisId:0,yAxisId:0,zIndex:Be.area};function ss(t){var e,r=we(t,Pr),{activeDot:n,animationBegin:s,animationDuration:a,animationEasing:l,connectNulls:o,dot:u,fill:d,fillOpacity:c,hide:f,isAnimationActive:m,legendType:x,stroke:h,xAxisId:g,yAxisId:y}=r,S=Nr(r,Ka),w=Bn(),P=Rn(),{needClip:j}=Wn(g,y),p=Ie(),{points:b,isRange:k,baseLine:N}=(e=H(I=>Ga(I,t.id,p)))!==null&&e!==void 0?e:{},C=Gn();if(w!=="horizontal"&&w!=="vertical"||C==null||P!=="AreaChart"&&P!=="ComposedChart")return null;var{height:A,width:O,x:_,y:E}=C;return!b||!b.length?null:v.createElement(as,ue({},S,{activeDot:n,animationBegin:s,animationDuration:a,animationEasing:l,baseLine:N,connectNulls:o,dot:u,fill:d,fillOpacity:c,height:A,hide:f,layout:w,isAnimationActive:m==="auto"?!Zt.isSsr:m,isRange:k,legendType:x,needClip:j,points:b,stroke:h,width:O,left:_,top:E,xAxisId:g,yAxisId:y}))}var ls=(t,e,r,n,s)=>{var a=r??e;if(q(a))return a;var l=t==="horizontal"?s:n,o=l.scale.domain();if(l.type==="number"){var u=Math.max(o[0],o[1]),d=Math.min(o[0],o[1]);return a==="dataMin"?d:a==="dataMax"||u<0?u:Math.max(Math.min(o[0],o[1]),0)}return a==="dataMin"?o[0]:a==="dataMax"?o[1]:o[0]};function os(t){var{areaSettings:{connectNulls:e,baseValue:r,dataKey:n},stackedData:s,layout:a,chartBaseValue:l,xAxis:o,yAxis:u,displayedData:d,dataStartIndex:c,xAxisTicks:f,yAxisTicks:m,bandSize:x}=t,h=s&&s.length,g=ls(a,l,r,o,u),y=a==="horizontal",S=!1,w=d.map((j,p)=>{var b,k,N,C;if(h)C=s[c+p];else{var A=gt(j,n);Array.isArray(A)?(C=A,S=!0):C=[g,A]}var O=(b=(k=C)===null||k===void 0?void 0:k[1])!==null&&b!==void 0?b:null,_=O==null||h&&!e&>(j,n)==null;if(y){var E;return{x:vt({axis:o,ticks:f,bandSize:x,entry:j,index:p}),y:_?null:(E=u.scale.map(O))!==null&&E!==void 0?E:null,value:C,payload:j}}return{x:_?null:(N=o.scale.map(O))!==null&&N!==void 0?N:null,y:vt({axis:u,ticks:m,bandSize:x,entry:j,index:p}),value:C,payload:j}}),P;return h||S?P=w.map(j=>{var p,b=Array.isArray(j.value)?j.value[0]:null;if(y){var k;return{x:j.x,y:b!=null&&j.y!=null&&(k=u.scale.map(b))!==null&&k!==void 0?k:null,payload:j.payload}}return{x:b!=null&&(p=o.scale.map(b))!==null&&p!==void 0?p:null,y:j.y,payload:j.payload}}):P=y?u.scale.map(g):o.scale.map(g),{points:w,baseLine:P??0,isRange:S}}function cs(t){var e=we(t,Pr),r=Ie();return v.createElement(Tn,{id:e.id,type:"area"},n=>v.createElement(v.Fragment,null,v.createElement(zn,{legendPayload:Xa(e)}),v.createElement(Qa,{dataKey:e.dataKey,data:e.data,stroke:e.stroke,strokeWidth:e.strokeWidth,fill:e.fill,name:e.name,hide:e.hide,unit:e.unit,tooltipType:e.tooltipType,id:n}),v.createElement(Ln,{type:"area",id:n,data:e.data,dataKey:e.dataKey,xAxisId:e.xAxisId,yAxisId:e.yAxisId,zAxisId:0,stackId:$n(e.stackId),hide:e.hide,barSize:void 0,baseValue:e.baseValue,isPanorama:r,connectNulls:e.connectNulls}),v.createElement(ss,ue({},e,{id:n}))))}var Cr=v.memo(cs,sr);Cr.displayName="Area";var ds=["domain","range"],us=["domain","range"];function At(t,e){if(t==null)return{};var r,n,s=ms(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(n=0;n<a.length;n++)r=a[n],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(s[r]=t[r])}return s}function ms(t,e){if(t==null)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.indexOf(n)!==-1)continue;r[n]=t[n]}return r}function _t(t,e){return t===e?!0:Array.isArray(t)&&t.length===2&&Array.isArray(e)&&e.length===2?t[0]===e[0]&&t[1]===e[1]:!1}function Ar(t,e){if(t===e)return!0;var{domain:r,range:n}=t,s=At(t,ds),{domain:a,range:l}=e,o=At(e,us);return!_t(r,a)||!_t(n,l)?!1:sr(s,o)}var fs=["type"],hs=["dangerouslySetInnerHTML","ticks","scale"],xs=["id","scale"];function Xe(){return Xe=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Xe.apply(null,arguments)}function Ot(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function Et(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Ot(Object(r),!0).forEach(function(n){ps(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ot(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function ps(t,e,r){return(e=gs(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function gs(t){var e=vs(t,"string");return typeof e=="symbol"?e:e+""}function vs(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Qe(t,e){if(t==null)return{};var r,n,s=ys(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(n=0;n<a.length;n++)r=a[n],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(s[r]=t[r])}return s}function ys(t,e){if(t==null)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.indexOf(n)!==-1)continue;r[n]=t[n]}return r}function bs(t){var e=ot(),r=v.useRef(null),n=lt(),{type:s}=t,a=Qe(t,fs),l=dr(n,"xAxis",s),o=v.useMemo(()=>{if(l!=null)return Et(Et({},a),{},{type:l})},[a,l]);return v.useLayoutEffect(()=>{o!=null&&(r.current===null?e(ti(o)):r.current!==o&&e(ri({prev:r.current,next:o})),r.current=o)},[o,e]),v.useLayoutEffect(()=>()=>{r.current&&(e(ni(r.current)),r.current=null)},[e]),null}var js=t=>{var{xAxisId:e,className:r}=t,n=H(or),s=Ie(),a="xAxis",l=H(S=>cr(S,a,e,s)),o=H(S=>ii(S,e)),u=H(S=>ai(S,e)),d=H(S=>si(S,e));if(o==null||u==null||d==null)return null;var{dangerouslySetInnerHTML:c,ticks:f,scale:m}=t,x=Qe(t,hs),{id:h,scale:g}=d,y=Qe(d,xs);return v.createElement(ut,Xe({},x,y,{x:u.x,y:u.y,width:o.width,height:o.height,className:ne("recharts-".concat(a," ").concat(a),r),viewBox:n,ticks:l,axisType:a}))},ks={allowDataOverflow:W.allowDataOverflow,allowDecimals:W.allowDecimals,allowDuplicatedCategory:W.allowDuplicatedCategory,angle:W.angle,axisLine:J.axisLine,height:W.height,hide:!1,includeHidden:W.includeHidden,interval:W.interval,label:!1,minTickGap:W.minTickGap,mirror:W.mirror,orientation:W.orientation,padding:W.padding,reversed:W.reversed,scale:W.scale,tick:W.tick,tickCount:W.tickCount,tickLine:J.tickLine,tickSize:J.tickSize,type:W.type,xAxisId:0},Ss=t=>{var e=we(t,ks);return v.createElement(v.Fragment,null,v.createElement(bs,{allowDataOverflow:e.allowDataOverflow,allowDecimals:e.allowDecimals,allowDuplicatedCategory:e.allowDuplicatedCategory,angle:e.angle,dataKey:e.dataKey,domain:e.domain,height:e.height,hide:e.hide,id:e.xAxisId,includeHidden:e.includeHidden,interval:e.interval,minTickGap:e.minTickGap,mirror:e.mirror,name:e.name,orientation:e.orientation,padding:e.padding,reversed:e.reversed,scale:e.scale,tick:e.tick,tickCount:e.tickCount,tickFormatter:e.tickFormatter,ticks:e.ticks,type:e.type,unit:e.unit}),v.createElement(js,e))},_r=v.memo(Ss,Ar);_r.displayName="XAxis";var ws=["type"],Ns=["dangerouslySetInnerHTML","ticks","scale"],Ps=["id","scale"];function Je(){return Je=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Je.apply(null,arguments)}function It(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function Dt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?It(Object(r),!0).forEach(function(n){Cs(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):It(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Cs(t,e,r){return(e=As(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function As(t){var e=_s(t,"string");return typeof e=="symbol"?e:e+""}function _s(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ze(t,e){if(t==null)return{};var r,n,s=Os(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(n=0;n<a.length;n++)r=a[n],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(s[r]=t[r])}return s}function Os(t,e){if(t==null)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.indexOf(n)!==-1)continue;r[n]=t[n]}return r}function Es(t){var e=ot(),r=v.useRef(null),n=lt(),{type:s}=t,a=Ze(t,ws),l=dr(n,"yAxis",s),o=v.useMemo(()=>{if(l!=null)return Dt(Dt({},a),{},{type:l})},[l,a]);return v.useLayoutEffect(()=>{o!=null&&(r.current===null?e(li(o)):r.current!==o&&e(oi({prev:r.current,next:o})),r.current=o)},[o,e]),v.useLayoutEffect(()=>()=>{r.current&&(e(ci(r.current)),r.current=null)},[e]),null}function Is(t){var{yAxisId:e,className:r,width:n,label:s}=t,a=v.useRef(null),l=v.useRef(null),o=H(or),u=Ie(),d=ot(),c="yAxis",f=H(b=>di(b,e)),m=H(b=>ui(b,e)),x=H(b=>cr(b,c,e,u)),h=H(b=>mi(b,e));if(v.useLayoutEffect(()=>{if(!(n!=="auto"||!f||fi(s)||v.isValidElement(s)||h==null)){var b=a.current;if(b){var k=b.getCalculatedWidth();Math.round(f.width)!==Math.round(k)&&d(hi({id:e,width:k}))}}},[x,f,d,s,e,n,h]),f==null||m==null||h==null)return null;var{dangerouslySetInnerHTML:g,ticks:y,scale:S}=t,w=Ze(t,Ns),{id:P,scale:j}=h,p=Ze(h,Ps);return v.createElement(ut,Je({},w,p,{ref:a,labelRef:l,x:m.x,y:m.y,tickTextProps:n==="auto"?{width:void 0}:{width:n},width:f.width,height:f.height,className:ne("recharts-".concat(c," ").concat(c),r),viewBox:o,ticks:x,axisType:c}))}var Ds={allowDataOverflow:G.allowDataOverflow,allowDecimals:G.allowDecimals,allowDuplicatedCategory:G.allowDuplicatedCategory,angle:G.angle,axisLine:J.axisLine,hide:!1,includeHidden:G.includeHidden,interval:G.interval,label:!1,minTickGap:G.minTickGap,mirror:G.mirror,orientation:G.orientation,padding:G.padding,reversed:G.reversed,scale:G.scale,tick:G.tick,tickCount:G.tickCount,tickLine:J.tickLine,tickSize:J.tickSize,type:G.type,width:G.width,yAxisId:0},Ts=t=>{var e=we(t,Ds);return v.createElement(v.Fragment,null,v.createElement(Es,{interval:e.interval,id:e.yAxisId,scale:e.scale,type:e.type,domain:e.domain,allowDataOverflow:e.allowDataOverflow,dataKey:e.dataKey,allowDuplicatedCategory:e.allowDuplicatedCategory,allowDecimals:e.allowDecimals,tickCount:e.tickCount,padding:e.padding,includeHidden:e.includeHidden,reversed:e.reversed,ticks:e.ticks,width:e.width,orientation:e.orientation,mirror:e.mirror,hide:e.hide,unit:e.unit,name:e.name,angle:e.angle,minTickGap:e.minTickGap,tick:e.tick,tickFormatter:e.tickFormatter}),v.createElement(Is,e))},Or=v.memo(Ts,Ar);Or.displayName="YAxis";var zs=["axis"],Ls=v.forwardRef((t,e)=>v.createElement(xi,{chartName:"AreaChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:zs,tooltipPayloadSearcher:pi,categoricalChartProps:t,ref:e}));function Z(t){return`$${t.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}`}function $s(t,e){const r=new Date,n=[];if(t==="day"){for(let s=29;s>=0;s--){const a=new Date(r);a.setDate(a.getDate()-s),n.push({date:a.toLocaleDateString("en-US",{month:"short",day:"numeric"}),amount:s===0?e.daily:0})}n[n.length-1]={date:n[n.length-1]?.date??"Today",amount:e.daily}}else if(t==="week"){for(let s=11;s>=0;s--){const a=new Date(r);a.setDate(a.getDate()-s*7),n.push({date:`W${String(52-s)}`,amount:s===0?e.weekly:0})}n[n.length-1]={date:n[n.length-1]?.date??"This week",amount:e.weekly}}else{for(let s=11;s>=0;s--){const a=new Date(r);a.setMonth(a.getMonth()-s),n.push({date:a.toLocaleDateString("en-US",{month:"short",year:"2-digit"}),amount:s===0?e.monthly:0})}n[n.length-1]={date:n[n.length-1]?.date??"This month",amount:e.monthly}}return n}const Fs={low:"Low confidence",medium:"Medium confidence",high:"High confidence"},Ms=[5,10,25,50,100];function Bs(t){const e=L.c(25),{open:r,onOpenChange:n,connectionId:s,currentLimitUsd:a}=t,{org:l}=X(),[o,u]=v.useState(null),[d,c]=v.useState(""),[f,m]=v.useState(null),[x,h]=v.useState(null);let g;e[0]!==s||e[1]!==l.id?(g={connectionId:s,orgId:l.id},e[0]=s,e[1]=l.id,e[2]=g):g=e[2];const y=Se(g);let S;e[3]!==y?(S={client:y},e[3]=y,e[4]=S):S=e[4];const{mutate:w,isPending:P}=mr(S),j=o??(d?parseFloat(d):null);let p,b;e[5]!==a||e[6]!==j||e[7]!==w||e[8]!==n?(b=()=>{if(!j||j<=0)return;const A=a+j;h(null),w({name:"GATEWAY_SET_LIMIT",arguments:{limit_usd:A,return_url:window.location.href}},{onSuccess:O=>{const _=O.structuredContent;_?.checkout_url?m(_.checkout_url):_?.billing_mode==="postpaid"&&p()},onError:O=>{h(O.message??"Failed to create payment link.")}})},p=()=>{u(null),c(""),m(null),h(null),n(!1)},e[5]=a,e[6]=j,e[7]=w,e[8]=n,e[9]=p,e[10]=b):(p=e[9],b=e[10]);let k;e[11]===Symbol.for("react.memo_cache_sentinel")?(k=i.jsxs(Br,{children:[i.jsx(Rr,{children:"Add Credit"}),i.jsx(Wr,{children:"Choose how much credit to add to your AI Gateway."})]}),e[11]=k):k=e[11];let N;e[12]!==f||e[13]!==a||e[14]!==d||e[15]!==j||e[16]!==x||e[17]!==b||e[18]!==P||e[19]!==o?(N=i.jsxs(Rt,{className:"sm:max-w-md",children:[k,f?i.jsxs("div",{className:"flex flex-col gap-4 pt-2",children:[i.jsx("p",{className:"text-sm text-muted-foreground",children:"Your payment link is ready. Click below to complete the purchase. You'll be redirected back here after payment."}),i.jsx(Y,{asChild:!0,className:"gap-2",children:i.jsxs("a",{href:f,children:[i.jsx(rt,{size:15}),"Complete Payment"]})})]}):i.jsxs("div",{className:"flex flex-col gap-5 pt-2",children:[i.jsxs("div",{className:"flex flex-col gap-2",children:[i.jsx(Oe,{className:"text-xs text-muted-foreground",children:"Select amount"}),i.jsx("div",{className:"grid grid-cols-5 gap-2",children:Ms.map(A=>i.jsxs("button",{type:"button",onClick:()=>{u(A),c("")},className:ie("rounded-md border px-3 py-2 text-sm font-medium transition-colors",o===A?"border-primary bg-primary/10 text-primary":"border-border hover:bg-muted"),children:["$",A]},A))})]}),i.jsxs("div",{className:"flex flex-col gap-1.5",children:[i.jsx(Oe,{htmlFor:"custom-amount",className:"text-xs text-muted-foreground",children:"Or enter a custom amount"}),i.jsxs("div",{className:"relative",children:[i.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground",children:"$"}),i.jsx(ae,{id:"custom-amount",type:"number",min:"1",step:"1",placeholder:"0.00",className:"pl-7",value:d,onChange:A=>{c(A.target.value),u(null)}})]})]}),x&&i.jsx("p",{className:"text-xs text-destructive",children:x}),i.jsxs("div",{className:"flex items-center justify-between pt-1",children:[i.jsxs("p",{className:"text-xs text-muted-foreground",children:["Current limit:"," ",i.jsx("span",{className:"font-medium text-foreground",children:Z(a)})]}),i.jsx(Y,{onClick:b,disabled:P||!j||j<=0,className:"gap-2",children:P?"Generating...":"Continue"})]})]})]}),e[12]=f,e[13]=a,e[14]=d,e[15]=j,e[16]=x,e[17]=b,e[18]=P,e[19]=o,e[20]=N):N=e[20];let C;return e[21]!==p||e[22]!==r||e[23]!==N?(C=i.jsx(Wt,{open:r,onOpenChange:p,children:N}),e[21]=p,e[22]=r,e[23]=N,e[24]=C):C=e[24],C}function Rs(t){const e=L.c(22),{estimation:r}=t;if(!r)return null;const{estimatedDaysRemaining:n,estimatedDepletionDate:s,avgDailySpend:a}=r;if(n==null)return null;let l;e[0]!==s?(l=s?new Date(s).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):null,e[0]=s,e[1]=l):l=e[1];const o=l,u=n!==1?"s":"";let d;e[2]!==n||e[3]!==u?(d=i.jsxs("span",{className:"tabular-nums font-medium text-foreground",children:["~",n," day",u," ","remaining"]}),e[2]=n,e[3]=u,e[4]=d):d=e[4];let c;e[5]!==o?(c=o&&i.jsxs("span",{children:["(until ",o,")"]}),e[5]=o,e[6]=c):c=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx("span",{className:"text-muted-foreground/60",children:"|"}),e[7]=f):f=e[7];let m;e[8]!==a?(m=Z(a),e[8]=a,e[9]=m):m=e[9];let x;e[10]!==m?(x=i.jsxs("span",{className:"tabular-nums",children:["avg ",m,"/day"]}),e[10]=m,e[11]=x):x=e[11];let h;e[12]!==r.resetsBeforeDepletion?(h=r.resetsBeforeDepletion&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"text-muted-foreground/60",children:"|"}),i.jsx("span",{className:"text-green-600 dark:text-green-400",children:"Resets before depletion"})]}),e[12]=r.resetsBeforeDepletion,e[13]=h):h=e[13];const g=Fs[r.confidence];let y;e[14]!==g?(y=i.jsx(ur,{variant:"outline",className:"text-[10px] px-1.5 py-0 h-4 font-normal",children:g}),e[14]=g,e[15]=y):y=e[15];let S;return e[16]!==y||e[17]!==d||e[18]!==c||e[19]!==x||e[20]!==h?(S=i.jsxs("div",{className:"mt-3 flex items-center gap-2 flex-wrap text-xs text-muted-foreground",children:[d,c,f,x,h,y]}),e[16]=y,e[17]=d,e[18]=c,e[19]=x,e[20]=h,e[21]=S):S=e[21],S}function Ws(t){const e=L.c(26),{available:r,total:n,estimation:s,onAddCredit:a}=t,l=n>0?Math.max(0,Math.min(100,(n-r)/n*100)):0;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:"Available Credit"}),e[0]=o):o=e[0];let u;e[1]!==r?(u=Z(r),e[1]=r,e[2]=u):u=e[2];let d;e[3]!==u?(d=i.jsx("p",{className:"text-3xl font-bold tabular-nums text-foreground tracking-tight",children:u}),e[3]=u,e[4]=d):d=e[4];let c;e[5]!==n?(c=n>0&&i.jsxs("p",{className:"text-xs text-muted-foreground",children:["of ",Z(n)," total"]}),e[5]=n,e[6]=c):c=e[6];let f;e[7]!==d||e[8]!==c?(f=i.jsxs("div",{className:"flex flex-col gap-1",children:[o,d,c]}),e[7]=d,e[8]=c,e[9]=f):f=e[9];let m;e[10]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(Jt,{size:16}),e[10]=m):m=e[10];let x;e[11]!==a?(x=i.jsxs(Y,{onClick:a,className:"gap-2 px-5",children:[m,"Add Credit"]}),e[11]=a,e[12]=x):x=e[12];let h;e[13]!==f||e[14]!==x?(h=i.jsxs("div",{className:"flex items-center justify-between",children:[f,x]}),e[13]=f,e[14]=x,e[15]=h):h=e[15];let g;e[16]!==r||e[17]!==n||e[18]!==l?(g=n>0&&i.jsxs("div",{className:"mt-4",children:[i.jsx("div",{className:"h-1.5 w-full rounded-full bg-muted overflow-hidden",children:i.jsx("div",{className:"h-full rounded-full bg-primary transition-all",style:{width:`${l}%`}})}),i.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[Z(Math.max(0,n-r))," used"]})]}),e[16]=r,e[17]=n,e[18]=l,e[19]=g):g=e[19];let y;e[20]!==s?(y=i.jsx(Rs,{estimation:s}),e[20]=s,e[21]=y):y=e[21];let S;return e[22]!==y||e[23]!==h||e[24]!==g?(S=i.jsxs("div",{className:"relative overflow-hidden rounded-xl border border-border bg-gradient-to-br from-card via-card to-muted/30 p-6",children:[h,g,y]}),e[22]=y,e[23]=h,e[24]=g,e[25]=S):S=e[25],S}function Gs(t){const e=L.c(54),{connectionId:r,alert:n}=t,{org:s}=X(),[a,l]=v.useState(n.enabled),[o,u]=v.useState(String(n.threshold_usd)),[d,c]=v.useState(n.email??""),[f,m]=v.useState(!1),[x,h]=v.useState(null);let g;e[0]!==r||e[1]!==s.id?(g={connectionId:r,orgId:s.id},e[0]=r,e[1]=s.id,e[2]=g):g=e[2];const y=Se(g);let S;e[3]!==y?(S={client:y},e[3]=y,e[4]=S):S=e[4];const{mutate:w,isPending:P}=mr(S),j=a!==n.enabled||o!==String(n.threshold_usd)||d!==(n.email??"");let p;e[5]!==d||e[6]!==a||e[7]!==w||e[8]!==o?(p=()=>{h(null),m(!1);const se=parseFloat(o);if(a&&(!d||!d.includes("@"))){h("A valid email is required to enable alerts.");return}if(Number.isNaN(se)||se<=0){h("Threshold must be a positive number.");return}w({name:"GATEWAY_SET_ALERT",arguments:{enabled:a,threshold_usd:se,...d?{email:d}:{}}},{onSuccess:()=>{m(!0),setTimeout(()=>m(!1),3e3)},onError:Tr=>{h(Tr.message??"Failed to save alert config.")}})},e[5]=d,e[6]=a,e[7]=w,e[8]=o,e[9]=p):p=e[9];const b=p;let k;e[10]===Symbol.for("react.memo_cache_sentinel")?(k=i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(bi,{size:16,className:"text-muted-foreground"}),i.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:"Low-Balance Alert"})]}),e[10]=k):k=e[10];let N;e[11]!==a?(N=i.jsxs("div",{className:"flex items-center justify-between",children:[k,i.jsx(_e,{checked:a,onCheckedChange:l})]}),e[11]=a,e[12]=N):N=e[12];const C=!a&&"opacity-50 pointer-events-none";let A;e[13]!==C?(A=ie("flex flex-col gap-3 transition-opacity",C),e[13]=C,e[14]=A):A=e[14];let O;e[15]===Symbol.for("react.memo_cache_sentinel")?(O=i.jsx(Oe,{htmlFor:"alert-threshold",className:"text-xs text-muted-foreground",children:"Alert threshold"}),e[15]=O):O=e[15];let _;e[16]===Symbol.for("react.memo_cache_sentinel")?(_=i.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground",children:"$"}),e[16]=_):_=e[16];let E;e[17]===Symbol.for("react.memo_cache_sentinel")?(E=se=>u(se.target.value),e[17]=E):E=e[17];let I;e[18]!==o?(I=i.jsxs("div",{className:"flex flex-col gap-1.5",children:[O,i.jsxs("div",{className:"relative",children:[_,i.jsx(ae,{id:"alert-threshold",type:"number",min:"1",step:"1",className:"pl-7",value:o,onChange:E})]})]}),e[18]=o,e[19]=I):I=e[19];let z;e[20]===Symbol.for("react.memo_cache_sentinel")?(z=i.jsx(Oe,{htmlFor:"alert-email",className:"text-xs text-muted-foreground",children:"Email"}),e[20]=z):z=e[20];let F;e[21]===Symbol.for("react.memo_cache_sentinel")?(F=se=>c(se.target.value),e[21]=F):F=e[21];let $;e[22]!==d?($=i.jsxs("div",{className:"flex flex-col gap-1.5",children:[z,i.jsx(ae,{id:"alert-email",type:"email",placeholder:"you@example.com",value:d,onChange:F})]}),e[22]=d,e[23]=$):$=e[23];let D;e[24]!==I||e[25]!==$?(D=i.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[I,$]}),e[24]=I,e[25]=$,e[26]=D):D=e[26];let T;e[27]!==x?(T=x&&i.jsx("p",{className:"text-xs text-destructive",children:x}),e[27]=x,e[28]=T):T=e[28];let B;e[29]!==a||e[30]!==o?(B=a?`Notify when credit drops below ${Z(parseFloat(o)||0)}`:"Alerts are disabled",e[29]=a,e[30]=o,e[31]=B):B=e[31];let M;e[32]!==B?(M=i.jsx("p",{className:"text-xs text-muted-foreground",children:B}),e[32]=B,e[33]=M):M=e[33];let te;e[34]!==f?(te=f&&i.jsx("span",{className:"text-xs text-green-600 dark:text-green-400",children:"Saved"}),e[34]=f,e[35]=te):te=e[35];const Pe=P||!j,Ce=P?"Saving...":"Save";let he;e[36]!==b||e[37]!==Pe||e[38]!==Ce?(he=i.jsx(Y,{size:"sm",variant:"outline",onClick:b,disabled:Pe,children:Ce}),e[36]=b,e[37]=Pe,e[38]=Ce,e[39]=he):he=e[39];let xe;e[40]!==te||e[41]!==he?(xe=i.jsxs("div",{className:"flex items-center gap-2",children:[te,he]}),e[40]=te,e[41]=he,e[42]=xe):xe=e[42];let pe;e[43]!==M||e[44]!==xe?(pe=i.jsxs("div",{className:"flex items-center justify-between",children:[M,xe]}),e[43]=M,e[44]=xe,e[45]=pe):pe=e[45];let ge;e[46]!==D||e[47]!==T||e[48]!==pe||e[49]!==A?(ge=i.jsxs("div",{className:A,children:[D,T,pe]}),e[46]=D,e[47]=T,e[48]=pe,e[49]=A,e[50]=ge):ge=e[50];let De;return e[51]!==ge||e[52]!==N?(De=i.jsxs("div",{className:"flex flex-col gap-4 rounded-xl border border-border bg-card p-5",children:[N,ge]}),e[51]=ge,e[52]=N,e[53]=De):De=e[53],De}const Tt={day:"Daily",week:"Weekly",month:"Monthly"},Us={day:"daily",week:"weekly",month:"monthly"},Ks={amount:{label:"Spend",color:"var(--chart-1)"}};function qs(t){const e=L.c(38),{usage:r}=t,[n,s]=v.useState("day");let a;e[0]!==n||e[1]!==r?(a=$s(n,r),e[0]=n,e[1]=r,e[2]=a):a=e[2];const l=a,o=r[Us[n]];let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=i.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:"Usage"}),e[3]=u):u=e[3];let d;e[4]!==o?(d=Z(o),e[4]=o,e[5]=d):d=e[5];let c;e[6]!==d?(c=i.jsx("p",{className:"text-2xl font-bold tabular-nums text-foreground tracking-tight",children:d}),e[6]=d,e[7]=c):c=e[7];const f=n==="day"?"today":n==="week"?"this week":"this month";let m;e[8]!==f?(m=i.jsx("p",{className:"text-xs text-muted-foreground",children:f}),e[8]=f,e[9]=m):m=e[9];let x;e[10]!==c||e[11]!==m?(x=i.jsxs("div",{className:"flex items-baseline gap-2",children:[c,m]}),e[10]=c,e[11]=m,e[12]=x):x=e[12];let h;e[13]!==r.total?(h=Z(r.total),e[13]=r.total,e[14]=h):h=e[14];let g;e[15]!==h?(g=i.jsxs("p",{className:"text-xs text-muted-foreground tabular-nums",children:[h," all-time"]}),e[15]=h,e[16]=g):g=e[16];let y;e[17]!==x||e[18]!==g?(y=i.jsxs("div",{className:"flex flex-col gap-0.5",children:[u,x,g]}),e[17]=x,e[18]=g,e[19]=y):y=e[19];let S;e[20]===Symbol.for("react.memo_cache_sentinel")?(S=Object.keys(Tt),e[20]=S):S=e[20];let w;e[21]!==n?(w=i.jsx("div",{className:"flex items-center rounded-md border border-border bg-muted/50 p-0.5",children:S.map(E=>i.jsx("button",{type:"button",onClick:()=>s(E),className:ie("px-2.5 py-1 text-xs font-medium rounded-sm transition-colors",n===E?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:Tt[E]},E))}),e[21]=n,e[22]=w):w=e[22];let P;e[23]!==y||e[24]!==w?(P=i.jsxs("div",{className:"flex items-center justify-between",children:[y,w]}),e[23]=y,e[24]=w,e[25]=P):P=e[25];let j;e[26]===Symbol.for("react.memo_cache_sentinel")?(j={top:4,right:4,bottom:0,left:0},e[26]=j):j=e[26];let p,b,k,N;e[27]===Symbol.for("react.memo_cache_sentinel")?(p=i.jsx("defs",{children:i.jsxs("linearGradient",{id:"fillAmount",x1:"0",y1:"0",x2:"0",y2:"1",children:[i.jsx("stop",{offset:"5%",stopColor:"var(--color-amount)",stopOpacity:.3}),i.jsx("stop",{offset:"95%",stopColor:"var(--color-amount)",stopOpacity:0})]})}),b=i.jsx(vr,{vertical:!1,strokeDasharray:"3 3"}),k=i.jsx(_r,{dataKey:"date",tickLine:!1,axisLine:!1,tickMargin:8,fontSize:11}),N=i.jsx(Or,{tickLine:!1,axisLine:!1,tickMargin:4,fontSize:11,tickFormatter:Hs}),e[27]=p,e[28]=b,e[29]=k,e[30]=N):(p=e[27],b=e[28],k=e[29],N=e[30]);let C,A;e[31]===Symbol.for("react.memo_cache_sentinel")?(C=i.jsx(gi,{content:i.jsx(vi,{formatter:Ys})}),A=i.jsx(Cr,{type:"monotone",dataKey:"amount",stroke:"var(--color-amount)",fill:"url(#fillAmount)",strokeWidth:2}),e[31]=C,e[32]=A):(C=e[31],A=e[32]);let O;e[33]!==l?(O=i.jsx(yi,{config:Ks,className:"h-[280px] w-full",children:i.jsxs(Ls,{data:l,margin:j,children:[p,b,k,N,C,A]})}),e[33]=l,e[34]=O):O=e[34];let _;return e[35]!==P||e[36]!==O?(_=i.jsxs("div",{className:"flex flex-col gap-4 rounded-xl border border-border bg-card p-5",children:[P,O]}),e[35]=P,e[36]=O,e[37]=_):_=e[37],_}function Ys(t){return Z(t)}function Hs(t){return`$${t}`}function Vs(t){const e=L.c(37),{connectionId:r}=t,{org:n}=X(),[s,a]=v.useState(!1);let l;e[0]!==r||e[1]!==n.id?(l={connectionId:r,orgId:n.id},e[0]=r,e[1]=n.id,e[2]=l):l=e[2];const o=Se(l);let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u={},e[3]=u):u=e[3];let d;e[4]!==o?(d={client:o,toolName:"GATEWAY_USAGE",toolArguments:u,staleTime:3e4,select:Xs},e[4]=o,e[5]=d):d=e[5];const{data:c,isLoading:f}=ji(d);if(f){let z;return e[6]===Symbol.for("react.memo_cache_sentinel")?(z=i.jsx(Er,{}),e[6]=z):z=e[6],z}const m=c?.limit.remaining??0,x=c?.limit.total??0;let h;e[7]!==c?.usage?(h=c?.usage??{total:0,daily:0,weekly:0,monthly:0},e[7]=c?.usage,e[8]=h):h=e[8];const g=h,y=c?.billing.mode??"prepaid",S=c?.estimation??null;let w;e[9]!==c?.alert?(w=c?.alert??{enabled:!1,threshold_usd:10,email:null},e[9]=c?.alert,e[10]=w):w=e[10];const P=w,j=x;let p;e[11]===Symbol.for("react.memo_cache_sentinel")?(p=i.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Billing"}),e[11]=p):p=e[11];let b;e[12]!==y?(b=y==="postpaid"&&i.jsx(ur,{variant:"outline",className:"text-[10px] px-1.5 py-0 h-4 font-normal capitalize",children:"Postpaid"}),e[12]=y,e[13]=b):b=e[13];let k;e[14]!==b?(k=i.jsxs("div",{className:"flex items-center gap-2",children:[p,b]}),e[14]=b,e[15]=k):k=e[15];let N;e[16]===Symbol.for("react.memo_cache_sentinel")?(N=()=>a(!0),e[16]=N):N=e[16];let C;e[17]!==m||e[18]!==S||e[19]!==x?(C=i.jsx(Ws,{available:m,total:x,estimation:S,onAddCredit:N}),e[17]=m,e[18]=S,e[19]=x,e[20]=C):C=e[20];let A;e[21]!==g?(A=i.jsx(qs,{usage:g}),e[21]=g,e[22]=A):A=e[22];const O=`${P.enabled}-${P.threshold_usd}-${P.email}`;let _;e[23]!==P||e[24]!==r||e[25]!==O?(_=i.jsx(Gs,{connectionId:r,alert:P},O),e[23]=P,e[24]=r,e[25]=O,e[26]=_):_=e[26];let E;e[27]!==s||e[28]!==r||e[29]!==j?(E=i.jsx(Bs,{open:s,onOpenChange:a,connectionId:r,currentLimitUsd:j}),e[27]=s,e[28]=r,e[29]=j,e[30]=E):E=e[30];let I;return e[31]!==C||e[32]!==A||e[33]!==_||e[34]!==E||e[35]!==k?(I=i.jsxs(i.Fragment,{children:[k,C,A,_,E]}),e[31]=C,e[32]=A,e[33]=_,e[34]=E,e[35]=k,e[36]=I):I=e[36],I}function Xs(t){return t.structuredContent}function Er(){const t=L.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsxs("div",{className:"flex flex-col gap-6",children:[i.jsxs("div",{children:[i.jsx(re,{className:"h-5 w-32"}),i.jsx(re,{className:"h-4 w-64 mt-1.5"})]}),i.jsx(re,{className:"h-28 rounded-xl"}),i.jsx(re,{className:"h-[260px] rounded-lg"})]}),t[0]=e):e=t[0],e}function Ir(){const t=L.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsxs("div",{children:[i.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Billing"}),i.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Monitor usage and manage credits for your organization."})]}),t[0]=e):e=t[0];let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx("div",{className:"flex items-center justify-center size-10 rounded-full bg-muted",children:i.jsx(rt,{size:20,className:"text-muted-foreground"})}),t[1]=r):r=t[1];let n;return t[2]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsxs("div",{className:"flex flex-col gap-6",children:[e,i.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-12 rounded-lg border border-dashed border-border",children:[r,i.jsxs("div",{className:"text-center",children:[i.jsx("p",{className:"text-sm font-medium text-foreground",children:"No AI Gateway configured"}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-[300px]",children:"Install the Deco AI Gateway MCP to start tracking usage and managing credits."})]})]})]}),t[2]=n):n=t[2],n}class Qs extends v.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,r){}render(){return this.state.hasError?i.jsx(Ir,{}):this.props.children}}function Js(){const t=L.c(5),e=Qt();let r;t[0]!==e?(r=e.find(Zs),t[0]=e,t[1]=r):r=t[1];const n=r;if(!n?.id){let a;return t[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(Ir,{}),t[2]=a):a=t[2],a}let s;return t[3]!==n.id?(s=i.jsx(i.Fragment,{children:i.jsx(Vs,{connectionId:n.id})}),t[3]=n.id,t[4]=s):s=t[4],s}function Zs(t){return Vr(t.connection_url)}function el(){const t=L.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("div",{className:"flex flex-col gap-6",children:i.jsx(Qs,{children:i.jsx(v.Suspense,{fallback:i.jsx(Er,{}),children:i.jsx(Js,{})})})}),t[0]=e):e=t[0],e}function Dr(){const t=L.c(3);let e,r;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx(re,{className:"h-6 w-48"}),r=i.jsx(re,{className:"h-4 w-80"}),t[0]=e,t[1]=r):(e=t[0],r=t[1]);let n;return t[2]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsxs("div",{className:"flex flex-col gap-4 pt-2",children:[e,r,i.jsxs("div",{className:"mt-4 flex flex-col gap-3",children:[i.jsx(re,{className:"h-12 w-full"}),i.jsx(re,{className:"h-12 w-full"})]})]}),t[2]=n):n=t[2],n}function zt(t){const e=L.c(14),{projectSlug:r,children:n}=t,{org:s}=X(),{data:a,isLoading:l}=Bt(s.id,r);if(l||!a){let f;return e[0]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx(Dr,{}),e[0]=f):f=e[0],f}const o=r===ee;let u;e[1]!==a.description||e[2]!==a.enabledPlugins||e[3]!==a.id||e[4]!==a.name||e[5]!==a.organizationId||e[6]!==a.slug||e[7]!==a.ui||e[8]!==o?(u={id:a.id,organizationId:a.organizationId,slug:a.slug,name:a.name,description:a.description,enabledPlugins:a.enabledPlugins,ui:a.ui,isOrgAdmin:o},e[1]=a.description,e[2]=a.enabledPlugins,e[3]=a.id,e[4]=a.name,e[5]=a.organizationId,e[6]=a.slug,e[7]=a.ui,e[8]=o,e[9]=u):u=e[9];const d=u;let c;return e[10]!==n||e[11]!==d||e[12]!==s?(c=i.jsx(Mt,{org:s,project:d,children:n}),e[10]=n,e[11]=d,e[12]=s,e[13]=c):c=e[13],c}function tl(t){const e=L.c(20),{section:r}=t;let n;e[0]!==r?(n=Ut(r),e[0]=r,e[1]=n):n=e[1];const s=n;if(s){let a;e[2]!==s.sub?(a=s.sub==="general"&&i.jsx(Bi,{}),e[2]=s.sub,e[3]=a):a=e[3];let l;e[4]!==s.sub?(l=s.sub==="plugins"&&i.jsx(jt,{}),e[4]=s.sub,e[5]=l):l=e[5];let o;e[6]!==s.sub?(o=s.sub==="danger"&&i.jsx(Hi,{}),e[6]=s.sub,e[7]=o):o=e[7];let u;return e[8]!==s.slug||e[9]!==a||e[10]!==l||e[11]!==o?(u=i.jsxs(zt,{projectSlug:s.slug,children:[a,l,o]}),e[8]=s.slug,e[9]=a,e[10]=l,e[11]=o,e[12]=u):u=e[12],u}switch(r){case"account.profile":{let a;return e[13]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(Pi,{}),e[13]=a):a=e[13],a}case"account.preferences":{let a;return e[14]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(yt,{}),e[14]=a):a=e[14],a}case"account.experimental":{let a;return e[15]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(Ei,{}),e[15]=a):a=e[15],a}case"org.general":{let a;return e[16]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(zi,{}),e[16]=a):a=e[16],a}case"org.plugins":{let a;return e[17]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(zt,{projectSlug:ee,children:i.jsx(jt,{})}),e[17]=a):a=e[17],a}case"org.billing":{let a;return e[18]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(el,{}),e[18]=a):a=e[18],a}default:{let a;return e[19]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(yt,{}),e[19]=a):a=e[19],a}}}function rl(){const t=L.c(23),{isOpen:e,activeSection:r,open:n,close:s}=Hr();let a;t[0]!==s?(a=y=>!y&&s(),t[0]=s,t[1]=a):a=t[1];let l;t[2]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx("div",{className:"w-52 shrink-0 border-r border-border"}),t[2]=l):l=t[2];let o;t[3]!==r||t[4]!==n?(o=i.jsx(v.Suspense,{fallback:l,children:i.jsx(Ni,{activeSection:r,onNavigate:n})}),t[3]=r,t[4]=n,t[5]=o):o=t[5];let u,d;t[6]===Symbol.for("react.memo_cache_sentinel")?(u=i.jsx(Gt,{size:16}),d=i.jsx("span",{className:"sr-only",children:"Close"}),t[6]=u,t[7]=d):(u=t[6],d=t[7]);let c;t[8]!==s?(c=i.jsxs("button",{type:"button",onClick:s,className:"absolute top-4 right-4 rounded-md p-1 opacity-70 hover:opacity-100 transition-opacity focus:outline-none focus:ring-2 focus:ring-ring",children:[u,d]}),t[8]=s,t[9]=c):c=t[9];let f;t[10]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx(Dr,{}),t[10]=f):f=t[10];let m;t[11]!==r?(m=i.jsx(v.Suspense,{fallback:f,children:i.jsx(tl,{section:r})}),t[11]=r,t[12]=m):m=t[12];let x;t[13]!==c||t[14]!==m?(x=i.jsxs("div",{className:"flex-1 overflow-y-auto p-8 min-w-0 relative",children:[c,m]}),t[13]=c,t[14]=m,t[15]=x):x=t[15];let h;t[16]!==o||t[17]!==x?(h=i.jsx(Rt,{className:"sm:max-w-[1100px] h-[85vh] p-0 overflow-hidden flex flex-col gap-0",closeButtonClassName:"hidden",children:i.jsxs("div",{className:"flex flex-1 min-h-0 overflow-hidden",children:[o,x]})}),t[16]=o,t[17]=x,t[18]=h):h=t[18];let g;return t[19]!==e||t[20]!==a||t[21]!==h?(g=i.jsx(Wt,{open:e,onOpenChange:a,children:h}),t[19]=e,t[20]=a,t[21]=h,t[22]=g):g=t[22],g}function nl(t){const e=L.c(12),{projectSlug:r,orgSlug:n,error:s}=t,a=$e();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx("h1",{className:"text-xl font-semibold",children:"Failed to load project"}),e[0]=l):l=e[0];let o;e[1]!==r?(o=i.jsxs("p",{className:"text-muted-foreground text-center",children:['There was an error loading the project "',r,'".']}),e[1]=r,e[2]=o):o=e[2];let u;e[3]!==s.message?(u=i.jsx("p",{className:"text-sm text-muted-foreground",children:s.message}),e[3]=s.message,e[4]=u):u=e[4];let d;e[5]!==a||e[6]!==n?(d=i.jsx(Y,{variant:"link",onClick:()=>a({to:"/$org/$project",params:{org:n,project:ee}}),children:"Go to organization home"}),e[5]=a,e[6]=n,e[7]=d):d=e[7];let c;return e[8]!==o||e[9]!==u||e[10]!==d?(c=i.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4 p-8",children:[l,o,u,d]}),e[8]=o,e[9]=u,e[10]=d,e[11]=c):c=e[11],c}function il(t){const e=L.c(9),{projectSlug:r,orgSlug:n}=t,s=$e();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx("h1",{className:"text-xl font-semibold",children:"Project not found"}),e[0]=a):a=e[0];let l;e[1]!==r?(l=i.jsxs("p",{className:"text-muted-foreground text-center",children:['The project "',r,'" does not exist in this organization.']}),e[1]=r,e[2]=l):l=e[2];let o;e[3]!==s||e[4]!==n?(o=i.jsx(Y,{variant:"link",onClick:()=>s({to:"/$org/$project",params:{org:n,project:ee}}),children:"Go to organization home"}),e[3]=s,e[4]=n,e[5]=o):o=e[5];let u;return e[6]!==l||e[7]!==o?(u=i.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4 p-8",children:[a,l,o]}),e[6]=l,e[7]=o,e[8]=u):u=e[8],u}function al(){const t=L.c(23);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const r=$r(e),{org:n}=X(),s=r.org,a=r.project,{data:l,isLoading:o,error:u}=Bt(n.id,a);if(o){let g;return t[1]===Symbol.for("react.memo_cache_sentinel")?(g=i.jsx(Ye,{}),t[1]=g):g=t[1],g}if(u){let g;return t[2]!==u||t[3]!==s||t[4]!==a?(g=i.jsx(nl,{projectSlug:a,orgSlug:s,error:u}),t[2]=u,t[3]=s,t[4]=a,t[5]=g):g=t[5],g}if(!l){let g;return t[6]!==s||t[7]!==a?(g=i.jsx(il,{projectSlug:a,orgSlug:s}),t[6]=s,t[7]=a,t[8]=g):g=t[8],g}const d=l.slug===ee;let c;t[9]!==l.description||t[10]!==l.enabledPlugins||t[11]!==l.id||t[12]!==l.name||t[13]!==l.organizationId||t[14]!==l.slug||t[15]!==l.ui||t[16]!==d?(c={id:l.id,organizationId:l.organizationId,slug:l.slug,name:l.name,description:l.description,enabledPlugins:l.enabledPlugins,ui:l.ui,isOrgAdmin:d},t[9]=l.description,t[10]=l.enabledPlugins,t[11]=l.id,t[12]=l.name,t[13]=l.organizationId,t[14]=l.slug,t[15]=l.ui,t[16]=d,t[17]=c):c=t[17];const f=c;let m,x;t[18]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(v.Suspense,{fallback:i.jsx(Ye,{}),children:i.jsx(Fr,{})}),x=i.jsx(rl,{}),t[18]=m,t[19]=x):(m=t[18],x=t[19]);let h;return t[20]!==f||t[21]!==n?(h=i.jsxs(Mt,{org:n,project:f,children:[m,x]}),t[20]=f,t[21]=n,t[22]=h):h=t[22],h}function Ql(){const t=L.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx(v.Suspense,{fallback:i.jsx(Ye,{}),children:i.jsx(al,{})}),t[0]=e):e=t[0],e}export{Ql as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b3 as U,c as O,u as H,j as s,aD as G,r as I,b as M,O as V}from"./index-DQipirM0.js";import{u as q}from"./use-project-x4-rNIeb.js";import{P as D}from"./index-DlglR7Dv.js";import{C as F}from"./collection-search-WzmN-NEH.js";import{A as J}from"./avatar-BLu12sL5.js";import{c as K,B as R}from"./button-BxOn_P7A.js";import{f as Q}from"./formatDistanceToNow-Cb2QZZJn.js";import{E as T}from"./empty-state-C7VZap1W.js";import{C as W}from"./create-project-dialog-heqHF5Xt.js";import{B as X,a as Y,b as Z,c as ee}from"./breadcrumb-kQQ-d55s.js";import"./useQuery-CqT-L2b-.js";import"./constants-9bKBT988.js";import"./use-mobile-CYG2M3Mj.js";import"./tooltip-B7RjBzxU.js";import"./Loading01-BFMhWWtD.js";import"./SearchMd-Dvn1Eo76.js";import"./input-D3a40-af.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./useMutation-8rEyObWg.js";import"./dialog-8Qx5GCEw.js";import"./form-Dn5Ilwyi.js";import"./label-_-PuJzKE.js";import"./textarea-DX9d61Sr.js";import"./Check-BEIYk4IG.js";import"./ChevronRight-dj0VUAfs.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 Ae(){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{Ae as default};
|