decocms 4.513.8 → 4.514.2
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/{ActiveShapeUtils-uKFYSg4Y.js → ActiveShapeUtils-CHFZipEm.js} +1 -1
- package/dist/client/assets/{AlertCircle-Q16nTVAa.js → AlertCircle-Cl9MnCHV.js} +1 -1
- package/dist/client/assets/{AreaChart-k5WqYBKX.js → AreaChart-eT2eWPao.js} +1 -1
- package/dist/client/assets/{ArrowLeft-C_dTX_8N.js → ArrowLeft-B3J1dilo.js} +1 -1
- package/dist/client/assets/{ArrowUp--4P0C-xl.js → ArrowUp-ty1fNgz8.js} +1 -1
- package/dist/client/assets/{BarChart-VS3Ye-qY.js → BarChart-D3BiUeWT.js} +1 -1
- package/dist/client/assets/{Building02-Gub-pr-8.js → Building02-CXXFWq7T.js} +1 -1
- package/dist/client/assets/{CartesianChart-BvH4QiKh.js → CartesianChart-BQsDloJJ.js} +1 -1
- package/dist/client/assets/{CategoricalChart-CTrV8dYV.js → CategoricalChart-D7jEbDda.js} +1 -1
- package/dist/client/assets/{CheckCircle-CQxu_pm9.js → CheckCircle-BuC_2xE-.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-GBLm8Zpl.js → ChevronSelectorVertical-DBVz-pss.js} +1 -1
- package/dist/client/assets/{ChevronUp-DK-Gvyk8.js → ChevronUp-C6jSoozz.js} +1 -1
- package/dist/client/assets/{Copy01-EWitDFCf.js → Copy01-BfzavrnK.js} +1 -1
- package/dist/client/assets/{CreditCard01-wx_z4Iiz.js → CreditCard01-D4uOiM__.js} +1 -1
- package/dist/client/assets/{DotsVertical-DIT5hu2b.js → DotsVertical-D-hn0Dkf.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-C56oRnGq.js → ErrorBarContext-CWxvaHlH.js} +1 -1
- package/dist/client/assets/{Globe04-B45_cBRN.js → Globe04-DyOUovld.js} +1 -1
- package/dist/client/assets/{Image01-BfGAREA7.js → Image01-DAZebL5E.js} +1 -1
- package/dist/client/assets/{Key01-BV7tzZs6.js → Key01-C4oKdOxt.js} +1 -1
- package/dist/client/assets/{Link01-9civFIb9.js → Link01-P5FIlBoy.js} +1 -1
- package/dist/client/assets/{LinkBroken01-DmmKNgpp.js → LinkBroken01-DEquJ_T8.js} +1 -1
- package/dist/client/assets/Minus-Ci5SA05N.js +1 -0
- package/dist/client/assets/{Monitor01-BoSs_8gg.js → Monitor01-AJCHl5A0.js} +1 -1
- package/dist/client/assets/{Play-CleWZLOG.js → Play-DRXE4Wh3.js} +1 -1
- package/dist/client/assets/{Plus-DQf-jm_3.js → Plus-OUKjFCO5.js} +1 -1
- package/dist/client/assets/{ReferenceLine-DtJF7ODu.js → ReferenceLine-CzqfJhVr.js} +1 -1
- package/dist/client/assets/{SearchMd-D0zp0uee.js → SearchMd-DOAm11zk.js} +1 -1
- package/dist/client/assets/{Sector-CWBWrJZQ.js → Sector-CKAj60vn.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-B7gta_qY.js → ShoppingBag01-B0NHZcKN.js} +1 -1
- package/dist/client/assets/{Sun-BfjJa3ru.js → Sun-C2GJq6HR.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-BJyDDPw9.js → SwitchHorizontal01-D_6u5L3T.js} +1 -1
- package/dist/client/assets/Tool01-BY6oDwaL.js +1 -0
- package/dist/client/assets/{Trash01-Dlk_Sh-H.js → Trash01-DACOfhdO.js} +1 -1
- package/dist/client/assets/{Upload01-DlF9Jqso.js → Upload01-B7LEFTjQ.js} +1 -1
- package/dist/client/assets/{User01-BcekHhAV.js → User01-CqjI1DkH.js} +1 -1
- package/dist/client/assets/{UserSquare-cdWcOBLL.js → UserSquare-A32fBry4.js} +1 -1
- package/dist/client/assets/{Users01-BIP-PxGt.js → Users01-D0oi1l5W.js} +1 -1
- package/dist/client/assets/{XClose-L_GNViCD.js → XClose-CQaQUNf-.js} +1 -1
- package/dist/client/assets/{ZoomOut-B3s5275g.js → ZoomOut-DlJBD5vG.js} +1 -1
- package/dist/client/assets/{access-gate-CsHtyNGi.js → access-gate-abVNiHeV.js} +1 -1
- package/dist/client/assets/active-indicator-CCMhAsc_.js +1 -0
- package/dist/client/assets/add-connection-dialog-DkBENg1p.js +1 -0
- package/dist/client/assets/agent-analytics-D1y-uZj_.js +2 -0
- package/dist/client/assets/agent-app-BxwZBX95.js +1 -0
- package/dist/client/assets/agent-assets-Brtg6kRu.js +1 -0
- package/dist/client/assets/agent-automation-NLoRrfTP.js +20 -0
- package/dist/client/assets/agent-automations-DV46O76v.js +1 -0
- package/dist/client/assets/agent-connect-sources-BIG3rsVu.js +1 -0
- package/dist/client/assets/agent-deck-r9DIt100.js +1 -0
- package/dist/client/assets/agent-e2e-svekcgy3.js +1 -0
- package/dist/client/assets/agent-experiments-D0QChua-.js +1 -0
- package/dist/client/assets/agent-file-C0PC9UDE.js +1 -0
- package/dist/client/assets/agent-hosting-fLCmbqNX.js +1 -0
- package/dist/client/assets/agent-icon-CI8VdOMu.js +1 -0
- package/dist/client/assets/agent-library-B5EQfCD5.js +1 -0
- package/dist/client/assets/agent-library-file-wINpTEhw.js +1 -0
- package/dist/client/assets/agent-monitor-CJ7BcPOM.js +1 -0
- package/dist/client/assets/agent-overview-DFU3xNza.js +1 -0
- package/dist/client/assets/agent-releases-PzrUDgqz.js +2 -0
- package/dist/client/assets/agent-settings-kK_6sFW0.js +1 -0
- package/dist/client/assets/{agent-site-editor-DMCFUFgp.js → agent-site-editor-cR2P-fl9.js} +17 -17
- package/dist/client/assets/agent-site-editor-code-B7Z6Zby2.js +2 -0
- package/dist/client/assets/agent-site-editor-content-J7gMddNW.js +1 -0
- package/dist/client/assets/agent-site-editor-preview-Ct_3ZnYP.js +1 -0
- package/dist/client/assets/agent-view-DDc1W26L.js +1 -0
- package/dist/client/assets/{agent-view-guard-AH_0N8JG.js → agent-view-guard-jvmKuAlB.js} +1 -1
- package/dist/client/assets/agents-list-CTj-YYcZ.js +1 -0
- package/dist/client/assets/ai-providers-Dige6Gab.js +6 -0
- package/dist/client/assets/alert-dialog-378JEYD5.js +7 -0
- package/dist/client/assets/alert-nivJF0en.js +1 -0
- package/dist/client/assets/analytics-sections-CLjbpVxw.js +1 -0
- package/dist/client/assets/api-keys-CgjYbD5Q.js +1 -0
- package/dist/client/assets/api-keys-bzwBMosu.js +1 -0
- package/dist/client/assets/app-editor-CREi2JWY.js +1 -0
- package/dist/client/assets/{asset-utils-Duz2qYol.js → asset-utils-BjSnmmSO.js} +1 -1
- package/dist/client/assets/{auth-BVkTFTOt.js → auth-DE4T3ddO.js} +1 -1
- package/dist/client/assets/{auth-catchall-lx3pSppE.js → auth-catchall-Bseb6I-0.js} +1 -1
- package/dist/client/assets/auth-entry-Cf6GqUx1.js +1 -0
- package/dist/client/assets/{auth-split-layout-CFlGWfV0.js → auth-split-layout-B1Cde358.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-POYqGagt.js → authenticate-and-persist-oauth-CdmHowj-.js} +1 -1
- package/dist/client/assets/automation-list-row-J3xDK__O.js +1 -0
- package/dist/client/assets/automation-runs-BUIfdJwO.js +1 -0
- package/dist/client/assets/automations-D1CJtDol.js +1 -0
- package/dist/client/assets/{autosend-CL2OZPvg.js → autosend-CBHD7iJO.js} +1 -1
- package/dist/client/assets/avatar-Cc1hvtuU.js +1 -0
- package/dist/client/assets/badge-C7ybnwZ-.js +1 -0
- package/dist/client/assets/block-document-Dh_-f4DK.js +3 -0
- package/dist/client/assets/{blocks-preview-workspace-context-DcqAhd0P.js → blocks-preview-workspace-context-BU7y-Y7u.js} +1 -1
- package/dist/client/assets/blocks-tab-states-D1FNgHyZ.js +20 -0
- package/dist/client/assets/blog-schema-CBTFkESw.js +1 -0
- package/dist/client/assets/buckets-DFFNixJf.js +1 -0
- package/dist/client/assets/{build-improve-prompt-doc-BJrt-jCW.js → build-improve-prompt-doc-hZbkitda.js} +1 -1
- package/dist/client/assets/{calendar-sxNtZ9wG.js → calendar-C4l3Sq4b.js} +1 -1
- package/dist/client/assets/{capability-load-error-CB4I7CRT.js → capability-load-error-S46czdrr.js} +1 -1
- package/dist/client/assets/category-editor-Cszp5IGU.js +1 -0
- package/dist/client/assets/{chart-NRF3lK-V.js → chart-Jmd43tPY.js} +1 -1
- package/dist/client/assets/{chat-context-Dv2E4fnf.js → chat-context-BITSwdcc.js} +6 -6
- package/dist/client/assets/{chat-draft-X1dGJc2x.js → chat-draft-CCI_1QAK.js} +1 -1
- package/dist/client/assets/checkbox-0NOpAJ5T.js +1 -0
- package/dist/client/assets/choose-editor-CA1Z8wt_.js +1 -0
- package/dist/client/assets/{cli-auth-success-aITDjw-8.js → cli-auth-success-BHUECjv9.js} +1 -1
- package/dist/client/assets/{client-icons-DRk6JWY6.js → client-icons-gaPiyknt.js} +1 -1
- package/dist/client/assets/cms-settings-editor-CQEJEja5.js +1 -0
- package/dist/client/assets/{collapsible-DHXUZre4.js → collapsible-DOFG9yfl.js} +1 -1
- package/dist/client/assets/collection-detail-BEj20hmw.js +1 -0
- package/dist/client/assets/collection-display-button-rCf-3uRy.js +1 -0
- package/dist/client/assets/{collection-search-Dcze6ySb.js → collection-search-CIxU1PVq.js} +1 -1
- package/dist/client/assets/collection-table-wrapper-DCxvjjsP.js +1 -0
- package/dist/client/assets/collection-tabs-DaLQpZio.js +1 -0
- package/dist/client/assets/{column-rules-C_Hndp-C.js → column-rules-DYXerNq9.js} +1 -1
- package/dist/client/assets/combobox-B87RHKBR.js +1 -0
- package/dist/client/assets/{coming-soon-page-DsS1SnMg.js → coming-soon-page-CaX9sy9O.js} +1 -1
- package/dist/client/assets/command-Ba_5WsCd.js +1 -0
- package/dist/client/assets/companion-mcps-section-C67YThWu.js +1 -0
- package/dist/client/assets/config-DeUl1W-3.js +1 -0
- package/dist/client/assets/connect-DhQDs2Rh.js +9 -0
- package/dist/client/assets/connect-layout-DKEbEN7G.js +1 -0
- package/dist/client/assets/{connection-CEK3iDim.js → connection-BR-nK6Tl.js} +1 -1
- package/dist/client/assets/{connection-card-Zhg6xn7V.js → connection-card-DXcp-Py-.js} +1 -1
- package/dist/client/assets/connection-detail-BdHLaQdB.js +1 -0
- package/dist/client/assets/connection-form-helpers-DCUgbY2x.js +1 -0
- package/dist/client/assets/connections-C8od2cky.js +1 -0
- package/dist/client/assets/content-tab-DOx3d8s1.js +22 -0
- package/dist/client/assets/context-CyfB4jhL.js +1 -0
- package/dist/client/assets/{context-menu-BFA8rRfY.js → context-menu-DRIu4CGG.js} +1 -1
- package/dist/client/assets/context-shell-CBh1Kqrf.js +197 -0
- package/dist/client/assets/{core.esm-BO316fgf.js → core.esm-CUfhAz_n.js} +2 -2
- package/dist/client/assets/{create-organization-dialog-Cb6YY9K7.js → create-organization-dialog-BampxPoF.js} +1 -1
- package/dist/client/assets/{daily-pulse-C0-1QTxZ.js → daily-pulse-E_GTptwI.js} +1 -1
- package/dist/client/assets/discover-BJCMDYCL.js +1 -0
- package/dist/client/assets/{domain-settings-B_QSN-on.js → domain-settings-IAcnbYtW.js} +1 -1
- package/dist/client/assets/{drawer-DL0G-oy-.js → drawer-C_Kv9tyJ.js} +1 -1
- package/dist/client/assets/{editor-B62-XQRE.js → editor-BZrTIvMY.js} +1 -1
- package/dist/client/assets/editor-classes-CAPeLkF0.js +1 -0
- package/dist/client/assets/{empty-state-JTI0oLk7.js → empty-state-CCT3pK8b.js} +1 -1
- package/dist/client/assets/empty-state-D0-hC4SP.js +1 -0
- package/dist/client/assets/{extract-connection-data-BlmKelwb.js → extract-connection-data-DgQP-Acf.js} +1 -1
- package/dist/client/assets/{feature-gate-DQ2MNs-B.js → feature-gate-oDt9H2hj.js} +1 -1
- package/dist/client/assets/{feature-paywall-BSXK-EmV.js → feature-paywall-CPSL3k8f.js} +1 -1
- package/dist/client/assets/file-explorer-F9Id0_wP.js +2 -0
- package/dist/client/assets/file-preview-DqvAJ2gl.js +1 -0
- package/dist/client/assets/file-share-button-DU8Ii3Pq.js +3 -0
- package/dist/client/assets/{file-type-icon-HF5UcaS2.js → file-type-icon-CtpbaJ_o.js} +1 -1
- package/dist/client/assets/folder-icon-VVNavsMq.js +2 -0
- package/dist/client/assets/{form-DNjk4sZI.js → form-ZF_zHWQ9.js} +1 -1
- package/dist/client/assets/general-CpiBy9G1.js +1 -0
- package/dist/client/assets/home-3hr9vAk3.js +1 -0
- package/dist/client/assets/{hosted-publish-feedback-DtU7FOId.js → hosted-publish-feedback-BnCMIrwd.js} +1 -1
- package/dist/client/assets/{icon-button-WP5IJTs8.js → icon-button-BCLR9-j9.js} +1 -1
- package/dist/client/assets/{index-DEQvnIsm.js → index-9Td7hVK9.js} +39 -39
- package/dist/client/assets/{index-BaQyqQF-.js → index-B39crKg_.js} +1 -1
- package/dist/client/assets/index-BxCkAJfQ.js +5 -0
- package/dist/client/assets/{index-DCOsLpC6.js → index-C6A_b0di.js} +23 -23
- package/dist/client/assets/index-CWfwo1z9.css +1 -0
- package/dist/client/assets/index-D-HXEhmO.js +2 -0
- package/dist/client/assets/{index-C13QaLdF.js → index-D7ES761U.js} +2 -2
- package/dist/client/assets/index-D7t71-xJ.js +1 -0
- package/dist/client/assets/index-DEAz082E.js +4 -0
- package/dist/client/assets/{index-DtysKpnb.js → index-DJddxUSw.js} +1 -1
- package/dist/client/assets/{index-B9qNCJbx.js → index-DK3Ep84Z.js} +1 -1
- package/dist/client/assets/{index-a-46Uqqs.js → index-DKMWjgS7.js} +1 -1
- package/dist/client/assets/index-DNHoyGzb.js +4 -0
- package/dist/client/assets/index-DS1f8KDp.js +1 -0
- package/dist/client/assets/{index-CVLOGr5B.js → index-Dk4fwsla.js} +1 -1
- package/dist/client/assets/{index-D6gxSs-5.js → index-hmSobACX.js} +1 -1
- package/dist/client/assets/{index-redirect-dS_ROPu1.js → index-redirect-ICO8W6fM.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-BnP8vr6V.js → infiniteQueryObserver-BqVxP8jE.js} +1 -1
- package/dist/client/assets/infra-billing-k1B_26e7.js +1 -0
- package/dist/client/assets/input-BflXPGfY.js +17 -0
- package/dist/client/assets/input-CLvyExpl.js +1 -0
- package/dist/client/assets/{integration-icon-Bysyldtc.js → integration-icon-Czum6uhQ.js} +1 -1
- package/dist/client/assets/{jira-icon-DJANnyLA.js → jira-icon-CmXcETIR.js} +1 -1
- package/dist/client/assets/{label-Cf2Qy475.js → label-BzQ0oC62.js} +1 -1
- package/dist/client/assets/{layout-CQ47j80U.js → layout-C1rzYsCq.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-BdSVZFZL.js → legacy-agents-deep-bmkvDTYr.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-BaYQkGoI.js → legacy-main-redirect-fOwKqwQa.js} +1 -1
- package/dist/client/assets/library-ByFOcPOv.js +1 -0
- package/dist/client/assets/{location-BjlyegC2.js → location-V0VwTJTt.js} +1 -1
- package/dist/client/assets/{login-BCT_8F_z.js → login-DVqyXSHg.js} +1 -1
- package/dist/client/assets/{markdown-DgDY2QmE.js → markdown-B1zFsFo7.js} +3 -3
- package/dist/client/assets/{mcp-app-renderer-pDbHkuXF.js → mcp-app-renderer-Bf1f4Ceg.js} +2 -2
- package/dist/client/assets/{mcp-oauth-C_-ZUSLH.js → mcp-oauth-BHBhycgr.js} +1 -1
- package/dist/client/assets/{mcp-oauth-aX1L4mRw.js → mcp-oauth-CkjCA9RZ.js} +1 -1
- package/dist/client/assets/members-B4Zz7sva.js +1 -0
- package/dist/client/assets/{memory-CWT1ZdIC.js → memory-QU-TAw7m.js} +2 -2
- package/dist/client/assets/mini-report-page-bSG3Flw_.js +1 -0
- package/dist/client/assets/mock-board-BHn9MuT3.js +81 -0
- package/dist/client/assets/{monaco-editor-DDuHJmyY.js → monaco-editor-wqQ4fYDS.js} +2 -2
- package/dist/client/assets/monitoring-CR4bg4zZ.js +1 -0
- package/dist/client/assets/monitoring-stats-row-DioSAyII.js +1 -0
- package/dist/client/assets/multi-select-5BLvoExq.js +1 -0
- package/dist/client/assets/{mustache-DrIjKpei.js → mustache-vdWfkBYh.js} +1 -1
- package/dist/client/assets/{new-project-dialog-DKeFr4C7.js → new-project-dialog-BvtJEgwj.js} +1 -1
- package/dist/client/assets/{oauth-callback-B1G7saOE.js → oauth-callback-B7kkYxlG.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-mNgeHhki.js → oauth-callback-ai-provider-BSB184d_.js} +1 -1
- package/dist/client/assets/onboarding-3V6KDNvu.js +1 -0
- package/dist/client/assets/openai-conversation-BOV1CPr9.js +3 -0
- package/dist/client/assets/{optimistic-project-sidebar-views-BaDUYmKF.js → optimistic-project-sidebar-views-CDbNj78E.js} +1 -1
- package/dist/client/assets/{order-monitor-day-C_yvKTz5.js → order-monitor-day-IrpdOD6b.js} +1 -1
- package/dist/client/assets/organization-choice-MP97c7Uh.js +1 -0
- package/dist/client/assets/{orgs-BEJlYBbK.js → orgs-B8fm4Uev.js} +1 -1
- package/dist/client/assets/{page-seo-form-N1KKSZaU.js → page-seo-form-atPw0Bzy.js} +1 -1
- package/dist/client/assets/pair-CPX6al59.js +48 -0
- package/dist/client/assets/plan-D5QEVVHy.js +1 -0
- package/dist/client/assets/{plan-ladder-CFysCUYy.js → plan-ladder-BrQcyUIW.js} +1 -1
- package/dist/client/assets/popover-y1Oe7lDX.js +1 -0
- package/dist/client/assets/post-calendar-DKFZ2k__.js +1 -0
- package/dist/client/assets/post-editor-C7KpFgFl.js +2 -0
- package/dist/client/assets/{preview-content-UW33EMCo.js → preview-content-CASns7Bx.js} +1 -1
- package/dist/client/assets/{preview-dialog-DWW9xaMT.js → preview-dialog-Bp27XzYu.js} +1 -1
- package/dist/client/assets/{preview-panel-C2ZH3x01.js → preview-panel-CQmAT98U.js} +1 -1
- package/dist/client/assets/preview-tab-Bf-5Y1Jl.js +551 -0
- package/dist/client/assets/product-picker-dialog-DHQY8m9h.js +1 -0
- package/dist/client/assets/profile-BjQ2KBvh.js +1 -0
- package/dist/client/assets/project-app-view-7frrMXLv.js +1 -0
- package/dist/client/assets/project-apps-B_ndMlxz.js +1 -0
- package/dist/client/assets/project-feed-DDT4YI-O.js +1 -0
- package/dist/client/assets/project-icon-DUAMZ6TE.js +1 -0
- package/dist/client/assets/project-reports-atiyzwc9.js +1 -0
- package/dist/client/assets/project-tasks-Eqh63lhC.js +1 -0
- package/dist/client/assets/projects-BsSSw8lj.js +1 -0
- package/dist/client/assets/{projects-empty-state-SWDBQkN4.js → projects-empty-state-C4YWUWaA.js} +1 -1
- package/dist/client/assets/{prompts-oa8BoX1i.js → prompts-MbCnXZ1a.js} +1 -1
- package/dist/client/assets/record-editor-BWu5k7pC.js +1 -0
- package/dist/client/assets/redirect-editor-CCgj69b1.js +1 -0
- package/dist/client/assets/reports-BZ9cBpIj.js +1 -0
- package/dist/client/assets/{reports-BsyMPz_z.js → reports-DtK_k0mw.js} +2 -2
- package/dist/client/assets/reports-onboarding-DJ-NbVTC.js +1 -0
- package/dist/client/assets/reports-tab-DSx2zNB5.js +2 -0
- package/dist/client/assets/repositories-CUjiO7Q7.js +1 -0
- package/dist/client/assets/repositories-V1W3Pebc.js +1 -0
- package/dist/client/assets/{repository-binding-DpSh0bkT.js → repository-binding-BS8jIipN.js} +1 -1
- package/dist/client/assets/{repository-import-picker-CmGbASze.js → repository-import-picker-BeVN8ofs.js} +1 -1
- package/dist/client/assets/{repository-picker-C86kcY-U.js → repository-picker-CetmC7NO.js} +1 -1
- package/dist/client/assets/{require-capability-D4dR1lZc.js → require-capability-BXOjMc3O.js} +1 -1
- package/dist/client/assets/{required-auth-layout-RW5dOh2c.js → required-auth-layout-QO7O-1TO.js} +1 -1
- package/dist/client/assets/{reset-password-lP2OGZgV.js → reset-password-Ci2P5znC.js} +1 -1
- package/dist/client/assets/{resizable-DueLEUEm.js → resizable-CrVZUcE4.js} +1 -1
- package/dist/client/assets/{resolve-tab-icon-B66mDW53.js → resolve-tab-icon-D7qZ3Nre.js} +1 -1
- package/dist/client/assets/review-settings-B0KlqUmV.js +1 -0
- package/dist/client/assets/roles-Bpj5uWGL.js +1 -0
- package/dist/client/assets/route-CVmEZnC4.js +1 -0
- package/dist/client/assets/route-DCcOo_Fu.js +1 -0
- package/dist/client/assets/route-Dlb9DaLO.js +1 -0
- package/dist/client/assets/{sandbox-lifecycle-context-BIf8-4ZY.js → sandbox-lifecycle-context-1ooazWyk.js} +1 -1
- package/dist/client/assets/{schema-BzqS-kNt.js → schema-B3NB_q91.js} +1 -1
- package/dist/client/assets/{schema-Bcb37BRV.js → schema-ByMREa-i.js} +1 -1
- package/dist/client/assets/{scroll-area-CIRLWlOA.js → scroll-area-CW5-JRgC.js} +1 -1
- package/dist/client/assets/search-input-B_OlFySN.js +1 -0
- package/dist/client/assets/search-toggle-RVc9z5fy.js +1 -0
- package/dist/client/assets/{secret-ciphertext-6VBjcV3b.js → secret-ciphertext-LTe2O-a_.js} +1 -1
- package/dist/client/assets/{secret-picker-NhuvO0ke.js → secret-picker-BlRp4HzP.js} +1 -1
- package/dist/client/assets/secrets-BoJZCEkY.js +1 -0
- package/dist/client/assets/{sections-DzoS45qS.js → sections-Bx_NBrfK.js} +1 -1
- package/dist/client/assets/sections-editor-Yqqk6kxD.js +4 -0
- package/dist/client/assets/select-DhiDgIO1.js +1 -0
- package/dist/client/assets/select-model-CNqedfLL.js +1 -0
- package/dist/client/assets/seo-editor-Do8kHXZ8.js +1 -0
- package/dist/client/assets/{separator-5oK4b-Mi.js → separator-DdWTpmVK.js} +1 -1
- package/dist/client/assets/settings-tab-CuIMw825.js +1 -0
- package/dist/client/assets/sheet-B-s1ua_Z.js +1 -0
- package/dist/client/assets/shell-layout-CY1spQRE.js +1 -0
- package/dist/client/assets/site-editor-N3P8Lz6V.js +1 -0
- package/dist/client/assets/{site-editor-toast-CmNIWnCw.js → site-editor-toast-C1RmSMI1.js} +1 -1
- package/dist/client/assets/skills-Bnj_KxZg.js +1 -0
- package/dist/client/assets/slider-BSwhIehC.js +1 -0
- package/dist/client/assets/{sortable.esm-BuCSUlOk.js → sortable.esm-CYRBGay0.js} +1 -1
- package/dist/client/assets/{sso-DX8PZk1N.js → sso-CFndO4wK.js} +1 -1
- package/dist/client/assets/{suggestion-DRP05M3-.js → suggestion-CltD0ABv.js} +2 -2
- package/dist/client/assets/switch-yuJEjOLk.js +1 -0
- package/dist/client/assets/{symbol-C1zrmwNF.js → symbol-CMtab6uG.js} +1 -1
- package/dist/client/assets/synced-repos-D78tO3Pk.js +1 -0
- package/dist/client/assets/{tab-icon-glyph-D6mZxF_9.js → tab-icon-glyph-DOqEYvgV.js} +1 -1
- package/dist/client/assets/{table-CltsOK_0.js → table-Bmv3FKqQ.js} +1 -1
- package/dist/client/assets/tabs-T-4a22mK.js +1 -0
- package/dist/client/assets/task-assignee-avatar-Dj06hA7z.js +1 -0
- package/dist/client/assets/{task-board-DUTGhEiC.js → task-board-DnhxE9Ze.js} +1 -1
- package/dist/client/assets/{task-route-BpmTIbg4.js → task-route-DRMhGkuH.js} +1 -1
- package/dist/client/assets/{task-status-C72thlpO.js → task-status-Casovenw.js} +1 -1
- package/dist/client/assets/taskboard-analytics-KndajnUw.js +1 -0
- package/dist/client/assets/tasks-DkhvAltj.js +4 -0
- package/dist/client/assets/tasks-PyDZ--hU.js +1 -0
- package/dist/client/assets/textarea-DHjq38AG.js +1 -0
- package/dist/client/assets/thread-analytics-DVM0PBQ_.js +1 -0
- package/dist/client/assets/{thread-intent-8kpZLcDE.js → thread-intent-C-QntTcr.js} +1 -1
- package/dist/client/assets/thread-route-BoCZIRSh.js +1 -0
- package/dist/client/assets/{thread-route-DTbE-Col.js → thread-route-DvFhRH4u.js} +1 -1
- package/dist/client/assets/thread-sheet-body-B9EzC9lD.js +1 -0
- package/dist/client/assets/{time-range-picker-BJ8aJbM7.js → time-range-picker-D4iS4Tok.js} +1 -1
- package/dist/client/assets/toggle-group-zQcn1Csj.js +1 -0
- package/dist/client/assets/{tool-namespace-CTeV292R.js → tool-namespace-fIptQgg1.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-BypH-a8F.js → toolbar-icon-button-CuMOaxw3.js} +1 -1
- package/dist/client/assets/{tooltip-B6NbTX5P.js → tooltip-DV3h0qB7.js} +1 -1
- package/dist/client/assets/{tooltipContext-DNlXAkZZ.js → tooltipContext-C1Usc_Xr.js} +1 -1
- package/dist/client/assets/{track-B0UUbkCz.js → track-D3pPKR-g.js} +1 -1
- package/dist/client/assets/{types-m1Dsi5sG.js → types-lFikl_dm.js} +6 -6
- package/dist/client/assets/{url-slug-CYvqbzge.js → url-slug--55QR8Nb.js} +1 -1
- package/dist/client/assets/{usage-stats-BH4bqLoE.js → usage-stats-B3yu3h_n.js} +2 -2
- package/dist/client/assets/{use-ai-providers-W2Q5vYCk.js → use-ai-providers-CJ3l7pn5.js} +1 -1
- package/dist/client/assets/{use-automations-Q-O37R-p.js → use-automations-AFKI1tpu.js} +1 -1
- package/dist/client/assets/{use-autosave-BWJWTtk0.js → use-autosave-BWKp6REv.js} +1 -1
- package/dist/client/assets/{use-chat-layout-state-C-XHZ0Dd.js → use-chat-layout-state-CFDHkSjX.js} +1 -1
- package/dist/client/assets/{use-clock-tick-xpCK7CUB.js → use-clock-tick-DWhyUgPt.js} +1 -1
- package/dist/client/assets/use-connect-companion-D-4FVJ1G.js +1 -0
- package/dist/client/assets/{use-connection-Cqf7M1G6.js → use-connection-D86v3ILu.js} +1 -1
- package/dist/client/assets/{use-content-sync-D6XyiV7H.js → use-content-sync-B_u58-cJ.js} +1 -1
- package/dist/client/assets/{use-copy-Dkgb0DtI.js → use-copy-DbzSulAX.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-BZx-8s-I.js → use-create-virtual-mcp-Bpc0V7fw.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-B1aPt2Gv.js → use-date-fns-locale-BkRX2MBK.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-Qji0VG0D.js → use-debounced-autosave-BsfvM49F.js} +1 -1
- package/dist/client/assets/{use-debounced-value-vhgvmVq4.js → use-debounced-value-Crqf3Q_U.js} +1 -1
- package/dist/client/assets/{use-deco-credits-k0aTLB-T.js → use-deco-credits-w1Fx0lhH.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-Czwn8ZVj.js → use-decopilot-events-v5UbI-6m.js} +1 -1
- package/dist/client/assets/use-delete-connection-GTXvmM2m.js +1 -0
- package/dist/client/assets/{use-deployment-admin-BrGfiqwj.js → use-deployment-admin-CvzNECST.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-oDwhtnfP.js → use-fast-preview-draft-url-Cq-7PjNm.js} +1 -1
- package/dist/client/assets/{use-file-configs-BIHMmAjW.js → use-file-configs-C938PJ-2.js} +1 -1
- package/dist/client/assets/{use-inbox-feed-SkFacTLx.js → use-inbox-feed-DMFX13-C.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-B9sczgXI.js → use-infinite-scroll-B4sR41eR.js} +1 -1
- package/dist/client/assets/{use-join-requests-DALj-BO-.js → use-join-requests-CFc2x1tJ.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-Cv3Ydqwx.js → use-main-panel-tabs-CdF-rdeA.js} +1 -1
- package/dist/client/assets/{use-main-schema-v8-Jzc_7tOC.js → use-main-schema-v8-CPnLt6Ij.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-BKawZyTw.js → use-mcp-auth-status-C-8wTSBe.js} +1 -1
- package/dist/client/assets/use-mcp-client-BhxxHJAR.js +10 -0
- package/dist/client/assets/{use-mcp-prompts-D1rnFTSb.js → use-mcp-prompts-CWm61MWP.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-CPGj7A6a.js → use-mcp-tools-B-1ERvY-.js} +1 -1
- package/dist/client/assets/{use-members-D-L919KG.js → use-members-D8urAs1B.js} +1 -1
- package/dist/client/assets/{use-mobile-CSFJ-mhK.js → use-mobile-DPUoyyVH.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-B-QlLf3R.js → use-navigate-to-agent-CAhRgqGF.js} +1 -1
- package/dist/client/assets/{use-open-billing-url-DWsw6Alp.js → use-open-billing-url-CTnk9Ci6.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-Co_fa5Pp.js → use-org-auth-client-BxQ5jCjX.js} +1 -1
- package/dist/client/assets/{use-org-fs-CAwgni1d.js → use-org-fs-D5WYBjY7.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-Cxt6puu1.js → use-org-repo-syncs-CTMJohOd.js} +1 -1
- package/dist/client/assets/{use-org-sso-BhMczCH6.js → use-org-sso-kfkGg5E2.js} +1 -1
- package/dist/client/assets/{use-organization-roles-DZJHfOlV.js → use-organization-roles-CNuC-BeU.js} +1 -1
- package/dist/client/assets/{use-organization-settings-BtOReG0H.js → use-organization-settings-lg55x1fU.js} +1 -1
- package/dist/client/assets/use-panel-navigate-PJ02Fhm0.js +1 -0
- package/dist/client/assets/{use-project-native-view-presence-D4pR1T7b.js → use-project-native-view-presence-DhJ5XyAj.js} +1 -1
- package/dist/client/assets/{use-project-scope-Dn4doId4.js → use-project-scope-Bni4_LWG.js} +1 -1
- package/dist/client/assets/use-recent-apps-DeX3pZaG.js +1 -0
- package/dist/client/assets/{use-releases-DoIKvYCz.js → use-releases-B-HpyDoJ.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-COAemppC.js → use-reports-diagnostic-DWDdyEhl.js} +1 -1
- package/dist/client/assets/{use-secrets-CA-kSu-4.js → use-secrets-wjYhC2WJ.js} +1 -1
- package/dist/client/assets/use-section-preview-base-DstUlTIU.js +1 -0
- package/dist/client/assets/use-sidebar-collapsed-DBizPCCU.js +1 -0
- package/dist/client/assets/{use-tags-CUZ9CIka.js → use-tags-4flo1DLi.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-34pQYq8w.js → use-task-board-analytics-4vg4P00a.js} +1 -1
- package/dist/client/assets/{use-task-board-events-CmYlpSMI.js → use-task-board-events-B4LW6jCp.js} +1 -1
- package/dist/client/assets/{use-task-board-item-prs-Cu4afbvW.js → use-task-board-item-prs-CpCwgJpe.js} +1 -1
- package/dist/client/assets/{use-task-metadata-C0A64pXU.js → use-task-metadata-Ds0QI2U3.js} +1 -1
- package/dist/client/assets/{use-thread-analytics-DXbq3gl0.js → use-thread-analytics-CnHM0k-v.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-BUN4R0HD.js → use-thread-outputs-DlYRXkMN.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-CQlvT4FW.js +1 -0
- package/dist/client/assets/{useQueries-DNx9dZks.js → useQueries-CRPGHJee.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-B7wF7Y8d.js +1 -0
- package/dist/client/assets/users-Dffg8_r8.js +1 -0
- package/dist/client/assets/{utils-D-52h1Lf.js → utils-CbUuWeGM.js} +1 -1
- package/dist/client/assets/variant-calendar-B3ufBpPm.js +1 -0
- package/dist/client/assets/{variant-draft-pointer-BY7yWri4.js → variant-draft-pointer-DuDZP2PW.js} +1 -1
- package/dist/client/assets/{virtual-mcp-CPoLjKOt.js → virtual-mcp-CN6o7d3g.js} +1 -1
- package/dist/client/assets/{watch-sse-pool-C7xRCtu5.js → watch-sse-pool-By7HSTtg.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/server.js +532 -532
- package/package.json +1 -1
- package/dist/client/assets/Tool01-Bp-TbrXi.js +0 -1
- package/dist/client/assets/add-connection-dialog-DwDvS8Uw.js +0 -1
- package/dist/client/assets/agent-analytics-bhSR3DTp.js +0 -2
- package/dist/client/assets/agent-app-D3AENVQT.js +0 -1
- package/dist/client/assets/agent-assets-BwCvdqkQ.js +0 -1
- package/dist/client/assets/agent-automation-BB_6G_CX.js +0 -20
- package/dist/client/assets/agent-automations-1AEGAcHU.js +0 -1
- package/dist/client/assets/agent-connect-sources-Dh_ELrva.js +0 -1
- package/dist/client/assets/agent-deck-Cd8T_xPW.js +0 -1
- package/dist/client/assets/agent-e2e-Bz8yllNo.js +0 -1
- package/dist/client/assets/agent-experiments-BmvDtQNl.js +0 -1
- package/dist/client/assets/agent-file-BoVEwoJD.js +0 -1
- package/dist/client/assets/agent-hosting-DtDQtjNQ.js +0 -1
- package/dist/client/assets/agent-icon-D6wS7rd0.js +0 -1
- package/dist/client/assets/agent-library-BeoJetpR.js +0 -1
- package/dist/client/assets/agent-library-file-DCYJT22p.js +0 -1
- package/dist/client/assets/agent-monitor-DduGwwal.js +0 -1
- package/dist/client/assets/agent-overview-Bj_gDP1X.js +0 -1
- package/dist/client/assets/agent-releases-CAjd1_1N.js +0 -2
- package/dist/client/assets/agent-settings-CnK9fsFs.js +0 -1
- package/dist/client/assets/agent-site-editor-code-C20F9ay-.js +0 -2
- package/dist/client/assets/agent-site-editor-content-ChnnFjhK.js +0 -1
- package/dist/client/assets/agent-site-editor-preview-BxDD-Aar.js +0 -1
- package/dist/client/assets/agent-view-3YMZSj3x.js +0 -1
- package/dist/client/assets/agents-list-ZmW8mXyl.js +0 -1
- package/dist/client/assets/ai-providers-CJqDCuAR.js +0 -6
- package/dist/client/assets/alert-PPdejvI2.js +0 -1
- package/dist/client/assets/alert-dialog-ygFmYcOa.js +0 -7
- package/dist/client/assets/analytics-sections-CveDF2n6.js +0 -1
- package/dist/client/assets/api-keys-BRV_KE0D.js +0 -1
- package/dist/client/assets/api-keys-CbBz_rxa.js +0 -1
- package/dist/client/assets/app-editor-Cio5Pq66.js +0 -1
- package/dist/client/assets/auth-entry-Dz_b1brR.js +0 -1
- package/dist/client/assets/automation-list-row-C69hu-tr.js +0 -1
- package/dist/client/assets/automation-runs-CefmsDTb.js +0 -1
- package/dist/client/assets/automations-C6R9dV-_.js +0 -1
- package/dist/client/assets/avatar-LfY3dprD.js +0 -1
- package/dist/client/assets/badge-CyDHDRPg.js +0 -1
- package/dist/client/assets/block-document-Di6OpT4O.js +0 -3
- package/dist/client/assets/blocks-tab-states-BjRnBrj4.js +0 -20
- package/dist/client/assets/blog-schema-C2heOfy2.js +0 -1
- package/dist/client/assets/board-analytics-fCGfPXJ7.js +0 -1
- package/dist/client/assets/buckets-j1BXX0Sb.js +0 -1
- package/dist/client/assets/category-editor-D_K2FWTB.js +0 -1
- package/dist/client/assets/checkbox-CaUezNgL.js +0 -1
- package/dist/client/assets/choose-editor-CDMfdVL-.js +0 -1
- package/dist/client/assets/cms-settings-editor-C_3APl39.js +0 -1
- package/dist/client/assets/collection-detail-BXabjop0.js +0 -1
- package/dist/client/assets/collection-display-button-Cdfgosxf.js +0 -1
- package/dist/client/assets/collection-table-wrapper-CWGTaBjx.js +0 -1
- package/dist/client/assets/collection-tabs-yg6VVFu9.js +0 -1
- package/dist/client/assets/combobox-B5xPQiKP.js +0 -1
- package/dist/client/assets/command-KXg0ZuU-.js +0 -1
- package/dist/client/assets/companion-mcps-section-Da_S5Z-R.js +0 -1
- package/dist/client/assets/config-UdFHLZs6.js +0 -1
- package/dist/client/assets/connect-CsG4Vqc-.js +0 -9
- package/dist/client/assets/connect-layout-DE_So4kH.js +0 -1
- package/dist/client/assets/connection-detail-lT3XwVgT.js +0 -1
- package/dist/client/assets/connection-form-helpers-DAFP702a.js +0 -1
- package/dist/client/assets/connections-Chwm450B.js +0 -1
- package/dist/client/assets/content-tab-DYpKep2J.js +0 -22
- package/dist/client/assets/context-Bfj5rpO_.js +0 -1
- package/dist/client/assets/context-shell-CUCiFtf6.js +0 -30
- package/dist/client/assets/discover-BqgmKYIf.js +0 -1
- package/dist/client/assets/editor-classes-BAKuqcj0.js +0 -1
- package/dist/client/assets/empty-state-lzzC-d42.js +0 -1
- package/dist/client/assets/file-explorer-CcePNy3q.js +0 -2
- package/dist/client/assets/file-preview-DFkUyLsr.js +0 -1
- package/dist/client/assets/file-share-button-CQ2Uf2PU.js +0 -3
- package/dist/client/assets/flat-project-B3HLdqxT.js +0 -1
- package/dist/client/assets/folder-icon-DaIPH_Nm.js +0 -2
- package/dist/client/assets/general-D2dbnN_J.js +0 -1
- package/dist/client/assets/get-initials-D-f_fDFw.js +0 -1
- package/dist/client/assets/home-CvMudobI.js +0 -1
- package/dist/client/assets/index-BdR6LNyh.js +0 -1
- package/dist/client/assets/index-ChfkzyhC.js +0 -81
- package/dist/client/assets/index-DAYXa7zL.js +0 -2
- package/dist/client/assets/index-DZLfyA8t.js +0 -4
- package/dist/client/assets/index-JvhyBpMR.js +0 -4
- package/dist/client/assets/index-mh7U_AKI.js +0 -1
- package/dist/client/assets/index-pFm7t22i.css +0 -1
- package/dist/client/assets/index-wkvFsHpn.js +0 -5
- package/dist/client/assets/infra-billing-BeLfFWAD.js +0 -1
- package/dist/client/assets/input-Brhdhig1.js +0 -17
- package/dist/client/assets/input-Bu2Qzwzh.js +0 -1
- package/dist/client/assets/library-DTps1LzJ.js +0 -1
- package/dist/client/assets/library-tab-C2aU1qmT.js +0 -168
- package/dist/client/assets/members-DNkbLBWU.js +0 -1
- package/dist/client/assets/mini-report-page-aWQFmVFz.js +0 -1
- package/dist/client/assets/mock-board-DWNU2n2-.js +0 -1
- package/dist/client/assets/monitoring-Cvbt9Za_.js +0 -1
- package/dist/client/assets/monitoring-stats-row-DyiPtUKv.js +0 -1
- package/dist/client/assets/multi-select-CfDYfsZ-.js +0 -1
- package/dist/client/assets/onboarding-kCa3Jkpy.js +0 -1
- package/dist/client/assets/openai-conversation-CLgg2Qod.js +0 -3
- package/dist/client/assets/organization-choice-BpI-_S8p.js +0 -1
- package/dist/client/assets/pair-ByV0vAAs.js +0 -48
- package/dist/client/assets/plan-BtuC_TCe.js +0 -1
- package/dist/client/assets/popover-CjfUWaC0.js +0 -1
- package/dist/client/assets/post-calendar-Bk6dx49G.js +0 -1
- package/dist/client/assets/post-editor-BUlsS3rc.js +0 -2
- package/dist/client/assets/preview-tab-DsWFy6nY.js +0 -551
- package/dist/client/assets/product-picker-dialog-ERcYwJUp.js +0 -1
- package/dist/client/assets/profile-BxA_I2_7.js +0 -1
- package/dist/client/assets/project-app-view-D-3K5nUJ.js +0 -1
- package/dist/client/assets/project-apps-D50B5nYg.js +0 -1
- package/dist/client/assets/project-feed-zQus1O7R.js +0 -1
- package/dist/client/assets/project-icon-ChTT5o1a.js +0 -1
- package/dist/client/assets/project-reports-B3JoeeH6.js +0 -1
- package/dist/client/assets/project-tasks-UglBCJxC.js +0 -1
- package/dist/client/assets/projects-CKCvSpxg.js +0 -1
- package/dist/client/assets/record-editor-C4fMBCCz.js +0 -1
- package/dist/client/assets/redirect-editor-vQorNOA7.js +0 -1
- package/dist/client/assets/reports-BTilnVW5.js +0 -1
- package/dist/client/assets/reports-onboarding-PNNHl11L.js +0 -1
- package/dist/client/assets/reports-tab-DA_8UL9O.js +0 -2
- package/dist/client/assets/repositories-BNK48Uq5.js +0 -1
- package/dist/client/assets/repositories-BpTNBXai.js +0 -1
- package/dist/client/assets/review-settings-JhWFefH3.js +0 -1
- package/dist/client/assets/roles-CT2aKtzc.js +0 -1
- package/dist/client/assets/route-C6Ybfjjx.js +0 -1
- package/dist/client/assets/route-CQTsC5_0.js +0 -1
- package/dist/client/assets/route-K-xr6t6Y.js +0 -1
- package/dist/client/assets/search-input-Br9i_Ft5.js +0 -1
- package/dist/client/assets/search-toggle-Dj92h38-.js +0 -1
- package/dist/client/assets/secrets-D4GRsD5W.js +0 -1
- package/dist/client/assets/sections-editor-C_iMM594.js +0 -4
- package/dist/client/assets/select-ChqJI0MI.js +0 -1
- package/dist/client/assets/select-model-CzvrFpf6.js +0 -1
- package/dist/client/assets/seo-editor-DUiWy8Gm.js +0 -1
- package/dist/client/assets/settings-tab-C1pr-l9r.js +0 -1
- package/dist/client/assets/sheet-CzJFx6b-.js +0 -1
- package/dist/client/assets/shell-layout-DKGS0yWx.js +0 -1
- package/dist/client/assets/site-editor-Bl1xnqtg.js +0 -1
- package/dist/client/assets/skills-DEb_PUzK.js +0 -1
- package/dist/client/assets/slider-BBmtNfbs.js +0 -1
- package/dist/client/assets/switch-CJc_fIEE.js +0 -1
- package/dist/client/assets/synced-repos-GT8waIWj.js +0 -1
- package/dist/client/assets/tabs-D0oiuUhC.js +0 -1
- package/dist/client/assets/task-assignee-avatar-BfUNDI59.js +0 -1
- package/dist/client/assets/taskboard-analytics-DG4Zz1H_.js +0 -1
- package/dist/client/assets/tasks-Cf4EZXG5.js +0 -4
- package/dist/client/assets/tasks-D-91kNhg.js +0 -1
- package/dist/client/assets/textarea-CWgoXXnV.js +0 -1
- package/dist/client/assets/thread-analytics-BjWUFe-q.js +0 -1
- package/dist/client/assets/thread-route-B_SMytnm.js +0 -1
- package/dist/client/assets/thread-sheet-body-OnJZloqZ.js +0 -1
- package/dist/client/assets/toggle-group-BWQRN38D.js +0 -1
- package/dist/client/assets/use-connect-companion-DJ8vj1p7.js +0 -1
- package/dist/client/assets/use-delete-connection-DbRA1FXb.js +0 -1
- package/dist/client/assets/use-ensure-project-folder-BvOs3JKp.js +0 -1
- package/dist/client/assets/use-mcp-client-CAdgJ_QT.js +0 -10
- package/dist/client/assets/use-panel-navigate-BwwjvhNB.js +0 -1
- package/dist/client/assets/use-recent-apps-B_BFFpi_.js +0 -1
- package/dist/client/assets/use-section-preview-base-DAksxTnD.js +0 -1
- package/dist/client/assets/use-sidebar-collapsed-Dv10z2iu.js +0 -1
- package/dist/client/assets/useInfiniteQuery-Bo5dbMM_.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CcFcpWuM.js +0 -1
- package/dist/client/assets/users-DWxowv8y.js +0 -1
- package/dist/client/assets/variant-calendar-BQESjgmt.js +0 -1
- package/dist/client/assets/view-mode-toggle-Bgum-rnB.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as X,j as i,b as J,r as Y,B as we,a as me,t as oe,G as $e,au as pe,aw as ye,l as U,m as Ke,K as We,ae as Fe,a2 as Re,d as Be,E as Ge,L as Ne,Y as He,y as ge,aa as Ee,P as Xe}from"./index-9Td7hVK9.js";import{u as ve,c as Te,i as qe,j as Ye,k as Ue,l as Je}from"./use-sidebar-collapsed-DBizPCCU.js";import{S as Ve,a as Qe,b as Ze}from"./sheet-B-s1ua_Z.js";import{u as et}from"./use-mobile-DPUoyyVH.js";import{u as tt,a as st,D as nt,c as it,C as rt,P as ot}from"./core.esm-CUfhAz_n.js";import{S as lt,v as at,u as ct}from"./sortable.esm-CYRBGay0.js";import{i as dt}from"./Tool01-BY6oDwaL.js";import{C as ut,A as ft,D as ze,E as ht}from"./agent-icon-CI8VdOMu.js";import{s as mt}from"./Plus-OUKjFCO5.js";import{s as Ae}from"./XClose-CQaQUNf-.js";import{T as ce,a as de,c as ue}from"./tooltip-DV3h0qB7.js";import{C as be,f as gt,g as pt,e as xt}from"./context-menu-DRIu4CGG.js";import{A as bt}from"./avatar-Cc1hvtuU.js";import{C as jt}from"./create-organization-dialog-BampxPoF.js";import{P as yt}from"./project-apps-B_ndMlxz.js";import{u as vt,a as St}from"./use-recent-apps-DeX3pZaG.js";import{b as wt}from"./use-navigate-to-agent-CAhRgqGF.js";import{u as zt,a as Ot}from"./use-project-scope-Bni4_LWG.js";import{i as Ct}from"./UserSquare-A32fBry4.js";import{C as Oe,e as _t,b as Rt,c as Nt,f as Et}from"./command-Ba_5WsCd.js";import{u as Tt}from"./use-debounced-value-Crqf3Q_U.js";const At={xs:"xs",sm:"xs",lg:"md"};function Se(t){const e=X.c(4),{org:s,size:o}=t,r=o===void 0?"sm":o,l=s.logo??void 0,n=At[r];let a;return e[0]!==s.name||e[1]!==l||e[2]!==n?(a=i.jsx(bt,{url:l,fallback:s.name,size:n,tone:"solid"}),e[0]=s.name,e[1]=l,e[2]=n,e[3]=a):a=e[3],a}function Ls({invitation:t,onChanged:e}){const s=J(),[o,r]=Y.useState(!1),l=t.organizationName??s("header.orgSwitcher.unknownOrganization"),n=async()=>{r(!0);try{const d=await me.organization.acceptInvitation({invitationId:t.id});if(d.error){oe.error(d.error.message),r(!1);return}}catch{oe.error(s("header.orgSwitcher.failedToAcceptInvitation")),r(!1);return}oe.success(s("header.orgSwitcher.joined",{name:l})),$e();let c;try{c=(await me.organization.getFullOrganization({query:{organizationId:t.organizationId}}))?.data?.slug}catch{}window.location.href=c?`/${c}`:"/"},a=async()=>{r(!0);try{const c=await me.organization.rejectInvitation({invitationId:t.id});if(c.error){oe.error(c.error.message),r(!1);return}oe.success(s("header.orgSwitcher.invitationDeclined")),r(!1),e()}catch{oe.error(s("header.orgSwitcher.failedToDeclineInvitation")),r(!1)}};return i.jsxs("div",{className:"flex items-center gap-3 rounded-md border border-dashed border-border px-3 py-2.5",children:[i.jsx(Se,{org:{name:l},size:"sm"}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("p",{className:"truncate text-sm font-medium",children:l}),i.jsx("p",{className:"truncate text-xs text-muted-foreground",children:s("header.orgSwitcher.invitedToJoin")})]}),i.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[i.jsx(we,{size:"sm",variant:"default",onClick:n,disabled:o,children:s("header.orgSwitcher.accept")}),i.jsx(we,{size:"icon-sm",variant:"ghost",className:"text-muted-foreground",onClick:a,disabled:o,"aria-label":s("header.orgSwitcher.declineInvitationTo",{name:l}),children:i.jsx(Ae,{size:14})})]})]})}const It=3,Ie=10,Lt=440,kt=55;function Le(t){const e=Math.floor((t-Lt)/kt);return Math.min(Ie,Math.max(It,e))}function Pt(t,e,s=Ie*3,o=[]){return[...new Set([e,...o,...t])].slice(0,s)}function Dt(t,e){return!e.id||t.some(s=>s.slug===e.slug)?[...t]:[...t,e]}function Mt(t,e,s,o,r=[]){if(t.length<=o)return{shown:[...t],hidden:[]};const l=new Map(t.map(a=>[a.slug,a])),n=new Set;s&&l.has(s)&&n.add(s);for(const a of r)l.has(a)&&n.add(a);for(const a of e){if(n.size>=o)break;l.has(a)&&n.add(a)}for(const a of t){if(n.size>=o)break;n.add(a.slug)}return{shown:t.filter(a=>n.has(a.slug)),hidden:t.filter(a=>!n.has(a.slug))}}const Ce=[];function $t(){const t=X.c(6);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=ye.recentOrgs(),t[0]=e):e=t[0];const[s,o]=pe(e,Ce),r=Array.isArray(s)?s:Ce;let l;t[1]!==o?(l=(a,c)=>o(d=>Pt(Array.isArray(d)?d:[],a,void 0,c)),t[1]=o,t[2]=l):l=t[2];let n;return t[3]!==r||t[4]!==l?(n={recent:r,remember:l},t[3]=r,t[4]=l,t[5]=n):n=t[5],n}const ke={hidden:[],pinned:[],order:[]},ae=(t,e)=>t.filter(s=>s!==e);function le(t){if(typeof t!="object"||t===null)return ke;const e=o=>Array.isArray(o)?o.filter(r=>typeof r=="string"):[],s=t;return{hidden:e(s.hidden),pinned:e(s.pinned),order:e(s.order)}}function Kt(t,e){return{...t,hidden:[...ae(t.hidden,e),e],pinned:ae(t.pinned,e)}}function Wt(t,e){return{...t,hidden:ae(t.hidden,e)}}function Ft(t,e){return t.pinned.includes(e)?{...t,pinned:ae(t.pinned,e)}:{...t,hidden:ae(t.hidden,e),pinned:[...t.pinned,e]}}function Bt(t,e,s){const o=r=>{const l=e.order.indexOf(r);return l===-1?Number.MAX_SAFE_INTEGER:l};return t.filter(r=>r.slug===s||!e.hidden.includes(r.slug)).map((r,l)=>({org:r,index:l})).sort((r,l)=>Number(e.pinned.includes(l.org.slug))-Number(e.pinned.includes(r.org.slug))||o(r.org.slug)-o(l.org.slug)||r.index-l.index).map(({org:r})=>r)}function Gt(t,e,s,o){const r=e.indexOf(s),l=e.indexOf(o);if(r===-1||l===-1||r===l||t.pinned.includes(s)!==t.pinned.includes(o))return t;const n=[...e];return n.splice(r,1),n.splice(l,0,s),{...t,order:[...n,...t.order.filter(a=>!n.includes(a))]}}function xe(t){const e=X.c(11),{active:s,label:o,children:r}=t,l=s?"h-7 opacity-100":"h-2 opacity-0 group-hover/rail:opacity-60";let n;e[0]!==l?(n=U("w-1 rounded-r-full bg-foreground","transition-[height,opacity] duration-200 ease-[var(--ease-out-cubic)]","motion-reduce:transition-none",l),e[0]=l,e[1]=n):n=e[1];let a;e[2]!==n?(a=i.jsx("span",{"aria-hidden":!0,className:"absolute top-0 -left-2.5 flex h-9 items-center",children:i.jsx("span",{className:n})}),e[2]=n,e[3]=a):a=e[3];let c;e[4]!==s||e[5]!==o?(c=o&&i.jsx("span",{"aria-hidden":!0,className:U("line-clamp-2 w-full px-0.5 text-center text-2xs text-ellipsis transition-colors",s?"font-medium text-sidebar-foreground":"text-muted-foreground group-hover/rail:text-sidebar-foreground"),children:o}),e[4]=s,e[5]=o,e[6]=c):c=e[6];let d;return e[7]!==r||e[8]!==a||e[9]!==c?(d=i.jsxs("div",{className:"group/rail relative flex w-full shrink-0 flex-col items-center gap-1",children:[a,r,c]}),e[7]=r,e[8]=a,e[9]=c,e[10]=d):d=e[10],d}function Ht(t){const e=X.c(13),s=t.trim(),{data:o}=me.useSession(),r=o?.user?.id??"",l=s.length>0&&!!r,n=We.organizationSearch(r,s);let a;e[0]!==s?(a=async b=>{const{signal:O}=b,x=await fetch(`/api/_me/organizations/search?q=${encodeURIComponent(s)}`,{signal:O});if(!x.ok)throw new Error(`Organization search failed: ${x.status}`);return await x.json()},e[0]=s,e[1]=a):a=e[1];let c;e[2]!==l||e[3]!==n||e[4]!==a?(c={queryKey:n,queryFn:a,enabled:l,placeholderData:Fe,staleTime:3e4,retry:!1},e[2]=l,e[3]=n,e[4]=a,e[5]=c):c=e[5];const{data:d,isFetching:p,isPlaceholderData:m,isError:h}=Ke(c);let f;e[6]!==d?.items?(f=d?.items??[],e[6]=d?.items,e[7]=f):f=e[7];const u=l&&p,g=l&&m;let j;return e[8]!==h||e[9]!==f||e[10]!==u||e[11]!==g?(j={hits:f,isSearching:u,isStale:g,isError:h},e[8]=h,e[9]=f,e[10]=u,e[11]=g,e[12]=j):j=e[12],j}function Xt(t){const e=X.c(61),{orgs:s,currentSlug:o,hiddenCount:r,onSelect:l}=t,n=J(),[a,c]=Y.useState(!1),[d,p]=Y.useState("");let m;e[0]!==d?(m=d.trim(),e[0]=d,e[1]=m):m=e[1];const h=m,f=Tt(h,150),u=h.length>0,g=f===h,{hits:j,isSearching:b,isStale:O,isError:x}=Ht(u?f:""),y=u?j:s;let z;e[2]===Symbol.for("react.memo_cache_sentinel")?(z=B=>{c(B),B||p("")},e[2]=z):z=e[2];const v=z;let S;e[3]!==n?(S=n("sidebar.rail.searchOrganizations"),e[3]=n,e[4]=S):S=e[4];let A;e[5]===Symbol.for("react.memo_cache_sentinel")?(A=()=>v(!0),e[5]=A):A=e[5];let w;e[6]===Symbol.for("react.memo_cache_sentinel")?(w=i.jsx(Ct,{size:18}),e[6]=w):w=e[6];let C;e[7]!==S?(C=i.jsx(ce,{asChild:!0,children:i.jsx("button",{type:"button","aria-label":S,onClick:A,className:"flex size-9 shrink-0 cursor-pointer items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-sidebar-accent hover:text-foreground focus-ring",children:w})}),e[7]=S,e[8]=C):C=e[8];let R;e[9]!==r||e[10]!==n?(R=r>0?n("sidebar.rail.searchMoreOrganizations",{count:r}):n("sidebar.rail.searchOrganizations"),e[9]=r,e[10]=n,e[11]=R):R=e[11];let N;e[12]!==R?(N=i.jsx(de,{side:"right",children:R}),e[12]=R,e[13]=N):N=e[13];let I;e[14]!==C||e[15]!==N?(I=i.jsx(xe,{active:!1,children:i.jsxs(ue,{children:[C,N]})}),e[14]=C,e[15]=N,e[16]=I):I=e[16];let L;e[17]!==n?(L=n("sidebar.rail.searchOrganizations"),e[17]=n,e[18]=L):L=e[18];let E;e[19]!==n?(E=n("sidebar.rail.searchPlaceholder"),e[19]=n,e[20]=E):E=e[20];let _;e[21]!==n?(_=n("sidebar.rail.searchPlaceholder"),e[21]=n,e[22]=_):_=e[22];let k;e[23]!==d||e[24]!==_?(k=i.jsx(_t,{value:d,onValueChange:p,placeholder:_}),e[23]=d,e[24]=_,e[25]=k):k=e[25];const F=u&&(O||!g)&&"opacity-50";let D;e[26]!==F?(D=U(F),e[26]=F,e[27]=D):D=e[27];let M;e[28]!==x||e[29]!==u||e[30]!==n?(M=u&&x&&i.jsx(Oe,{children:n("sidebar.rail.searchFailed")}),e[28]=x,e[29]=u,e[30]=n,e[31]=M):M=e[31];let $;e[32]!==x||e[33]!==b||e[34]!==y.length||e[35]!==g||e[36]!==n?($=!x&&g&&!b&&y.length===0&&i.jsx(Oe,{children:n("sidebar.rail.searchEmpty")}),e[32]=x,e[33]=b,e[34]=y.length,e[35]=g,e[36]=n,e[37]=$):$=e[37];let K;if(e[38]!==o||e[39]!==l||e[40]!==y||e[41]!==n){let B;e[43]!==o||e[44]!==l||e[45]!==n?(B=G=>i.jsxs(Rt,{value:G.slug,onSelect:()=>{v(!1),G.slug!==o&&l(G.slug)},className:"gap-2.5",children:[i.jsx(Se,{org:G,size:"sm"}),i.jsx("span",{className:"min-w-0 flex-1 truncate",children:G.name}),G.slug===o&&i.jsx("span",{className:"text-meta shrink-0",children:n("sidebar.rail.currentOrganization")})]},G.id),e[43]=o,e[44]=l,e[45]=n,e[46]=B):B=e[46],K=y.map(B),e[38]=o,e[39]=l,e[40]=y,e[41]=n,e[42]=K}else K=e[42];let W;e[47]!==D||e[48]!==M||e[49]!==$||e[50]!==K?(W=i.jsxs(Nt,{className:D,children:[M,$,K]}),e[47]=D,e[48]=M,e[49]=$,e[50]=K,e[51]=W):W=e[51];let P;e[52]!==a||e[53]!==L||e[54]!==E||e[55]!==k||e[56]!==W?(P=i.jsxs(Et,{open:a,onOpenChange:v,title:L,description:E,shouldFilter:!1,children:[k,W]}),e[52]=a,e[53]=L,e[54]=E,e[55]=k,e[56]=W,e[57]=P):P=e[57];let q;return e[58]!==P||e[59]!==I?(q=i.jsxs(i.Fragment,{children:[I,P]}),e[58]=P,e[59]=I,e[60]=q):q=e[60],q}function qt(t){return globalThis.addEventListener("resize",t),()=>globalThis.removeEventListener("resize",t)}const Yt=()=>Le(globalThis.innerHeight),Ut=()=>Le(0);function Jt(t){const e=X.c(59),{org:s,active:o,onSelect:r,pinned:l,onOpenSettings:n,onTogglePin:a,onHide:c}=t,d=J();let p;e[0]!==s.slug?(p={id:s.slug},e[0]=s.slug,e[1]=p):p=e[1];const{setNodeRef:m,listeners:h,transform:f,transition:u,isDragging:g}=ct(p);let j;e[2]!==f?(j=rt.Transform.toString(f?{...f,x:0}:null),e[2]=f,e[3]=j):j=e[3];const b=g?1:void 0,O=`rail-org-${s.slug}`;let x;e[4]!==j||e[5]!==b||e[6]!==O||e[7]!==u?(x={transform:j,transition:u,zIndex:b,viewTransitionName:O},e[4]=j,e[5]=b,e[6]=O,e[7]=u,e[8]=x):x=e[8];const y=s.name,z=o||void 0,v=o?"opacity-100":"opacity-60 hover:scale-105 hover:opacity-100",S=r&&"cursor-pointer";let A;e[9]!==v||e[10]!==S?(A=U("relative flex shrink-0 items-center justify-center rounded-xl focus-ring","transition-[opacity,transform] duration-150 ease-out",v,S),e[9]=v,e[10]=S,e[11]=A):A=e[11];let w;e[12]!==s?(w=i.jsx(Se,{org:s,size:"lg"}),e[12]=s,e[13]=w):w=e[13];let C;e[14]!==l?(C=l&&i.jsx("span",{"aria-hidden":!0,className:"absolute -top-1 -right-1 flex size-4 items-center justify-center rounded-full bg-sidebar-accent text-muted-foreground ring-2 ring-sidebar",children:i.jsx(ze,{size:9})}),e[14]=l,e[15]=C):C=e[15];let R;e[16]!==r||e[17]!==s.name||e[18]!==A||e[19]!==w||e[20]!==C||e[21]!==z?(R=i.jsx(ce,{asChild:!0,children:i.jsx(gt,{asChild:!0,children:i.jsxs("button",{type:"button","aria-label":y,"aria-current":z,onClick:r,className:A,children:[w,C]})})}),e[16]=r,e[17]=s.name,e[18]=A,e[19]=w,e[20]=C,e[21]=z,e[22]=R):R=e[22];let N;e[23]!==s.name?(N=i.jsx(de,{side:"right",children:s.name}),e[23]=s.name,e[24]=N):N=e[24];let I;e[25]!==R||e[26]!==N?(I=i.jsxs(ue,{children:[R,N]}),e[25]=R,e[26]=N,e[27]=I):I=e[27];let L;e[28]===Symbol.for("react.memo_cache_sentinel")?(L=i.jsx(ht,{}),e[28]=L):L=e[28];let E;e[29]!==d?(E=d("sidebar.rail.organizationSettings"),e[29]=d,e[30]=E):E=e[30];let _;e[31]!==n||e[32]!==E?(_=i.jsxs(be,{onSelect:n,children:[L,E]}),e[31]=n,e[32]=E,e[33]=_):_=e[33];let k;e[34]===Symbol.for("react.memo_cache_sentinel")?(k=i.jsx(ze,{}),e[34]=k):k=e[34];let F;e[35]!==l||e[36]!==d?(F=d(l?"sidebar.rail.unpinOrganization":"sidebar.rail.pinOrganization"),e[35]=l,e[36]=d,e[37]=F):F=e[37];let D;e[38]!==a||e[39]!==F?(D=i.jsxs(be,{onSelect:a,children:[k,F]}),e[38]=a,e[39]=F,e[40]=D):D=e[40];let M;e[41]!==c||e[42]!==d?(M=c&&i.jsxs(be,{onSelect:c,children:[i.jsx(dt,{}),d("sidebar.rail.hideOrganization")]}),e[41]=c,e[42]=d,e[43]=M):M=e[43];let $;e[44]!==_||e[45]!==D||e[46]!==M?($=i.jsxs(pt,{children:[_,D,M]}),e[44]=_,e[45]=D,e[46]=M,e[47]=$):$=e[47];let K;e[48]!==I||e[49]!==$?(K=i.jsxs(xt,{children:[I,$]}),e[48]=I,e[49]=$,e[50]=K):K=e[50];let W;e[51]!==o||e[52]!==K?(W=i.jsx(xe,{active:o,children:K}),e[51]=o,e[52]=K,e[53]=W):W=e[53];let P;return e[54]!==h||e[55]!==m||e[56]!==W||e[57]!==x?(P=i.jsx("div",{ref:m,...h,style:x,className:"w-full shrink-0 touch-none",children:W}),e[54]=h,e[55]=m,e[56]=W,e[57]=x,e[58]=P):P=e[58],P}function Vt(t){const e=X.c(64),{project:s,orgSlug:o,active:r,onClose:l,onNavigate:n}=t,a=J();let c,d,p,m,h,f,u,g,j,b,O;if(e[0]!==r||e[1]!==n||e[2]!==o||e[3]!==s.icon||e[4]!==s.id||e[5]!==s.title){const k=ut(s.icon,s.title);O="group/rail relative flex w-full flex-col items-center gap-1",p=ue,d=ce,b=!0,c=Ne,m=He.root,e[17]!==o||e[18]!==s.id?(h={org:o,agentId:s.id},e[17]=o,e[18]=s.id,e[19]=h):h=e[19],f=s.title,u=r||void 0,e[20]!==n?(g=()=>{ge("org_rail_recent_project_opened"),n?.()},e[20]=n,e[21]=g):g=e[21],j=U("flex shrink-0 rounded-lg focus-ring",k.text,r&&"ring-[1.5px] ring-current"),e[0]=r,e[1]=n,e[2]=o,e[3]=s.icon,e[4]=s.id,e[5]=s.title,e[6]=c,e[7]=d,e[8]=p,e[9]=m,e[10]=h,e[11]=f,e[12]=u,e[13]=g,e[14]=j,e[15]=b,e[16]=O}else c=e[6],d=e[7],p=e[8],m=e[9],h=e[10],f=e[11],u=e[12],g=e[13],j=e[14],b=e[15],O=e[16];let x;e[22]!==s.icon||e[23]!==s.title?(x=i.jsx(ft,{icon:s.icon,name:s.title,size:"sm",className:"size-8 rounded-lg"}),e[22]=s.icon,e[23]=s.title,e[24]=x):x=e[24];let y;e[25]!==c||e[26]!==m||e[27]!==h||e[28]!==f||e[29]!==u||e[30]!==g||e[31]!==j||e[32]!==x?(y=i.jsx(c,{to:m,params:h,"aria-label":f,"aria-current":u,onClick:g,className:j,children:x}),e[25]=c,e[26]=m,e[27]=h,e[28]=f,e[29]=u,e[30]=g,e[31]=j,e[32]=x,e[33]=y):y=e[33];let z;e[34]!==d||e[35]!==y||e[36]!==b?(z=i.jsx(d,{asChild:b,children:y}),e[34]=d,e[35]=y,e[36]=b,e[37]=z):z=e[37];let v;e[38]!==s.title?(v=i.jsx(de,{side:"right",children:s.title}),e[38]=s.title,e[39]=v):v=e[39];let S;e[40]!==p||e[41]!==z||e[42]!==v?(S=i.jsxs(p,{children:[z,v]}),e[40]=p,e[41]=z,e[42]=v,e[43]=S):S=e[43];const A=r?"font-medium text-sidebar-foreground":"text-muted-foreground group-hover/rail:text-sidebar-foreground";let w;e[44]!==A?(w=U("line-clamp-2 w-full text-center text-2xs break-words transition-colors",A),e[44]=A,e[45]=w):w=e[45];let C;e[46]!==s.title||e[47]!==w?(C=i.jsx("span",{"aria-hidden":!0,className:w,children:s.title}),e[46]=s.title,e[47]=w,e[48]=C):C=e[48];let R;e[49]!==s.title||e[50]!==a?(R=a("sidebar.rail.closeApp",{name:s.title}),e[49]=s.title,e[50]=a,e[51]=R):R=e[51];let N;e[52]!==l?(N=()=>{ge("org_rail_recent_project_closed"),l()},e[52]=l,e[53]=N):N=e[53];let I,L;e[54]===Symbol.for("react.memo_cache_sentinel")?(I=U("absolute -top-1.5 right-[calc(50%-1.25rem)] flex size-4 cursor-pointer items-center justify-center rounded-full","bg-sidebar-accent text-muted-foreground ring-2 ring-sidebar hover:text-foreground","opacity-0 transition-opacity duration-150 group-hover/rail:opacity-100 focus-visible:opacity-100 focus-visible:outline-none"),L=i.jsx(Ae,{size:10}),e[54]=I,e[55]=L):(I=e[54],L=e[55]);let E;e[56]!==R||e[57]!==N?(E=i.jsx("button",{type:"button","aria-label":R,onClick:N,className:I,children:L}),e[56]=R,e[57]=N,e[58]=E):E=e[58];let _;return e[59]!==S||e[60]!==C||e[61]!==E||e[62]!==O?(_=i.jsxs("div",{className:O,children:[S,C,E]}),e[59]=S,e[60]=C,e[61]=E,e[62]=O,e[63]=_):_=e[63],_}const Qt={"site-editor":"/site-editor"};function Zt(t){const e=X.c(26),{app:s}=t,o=J(),r=yt[s],l=Qt[s];if(!r||!l)return null;let n;e[0]!==r.labelKey||e[1]!==o?(n=o(r.labelKey),e[0]=r.labelKey,e[1]=o,e[2]=n):n=e[2];let a;e[3]!==r.labelKey||e[4]!==o?(a=o(r.labelKey),e[3]=r.labelKey,e[4]=o,e[5]=a):a=e[5];let c;e[6]!==r.tone?(c=U("flex size-9 shrink-0 items-center justify-center rounded-xl focus-ring opacity-100",r.tone),e[6]=r.tone,e[7]=c):c=e[7];let d;e[8]!==r.Icon?(d=i.jsx(r.Icon,{size:18}),e[8]=r.Icon,e[9]=d):d=e[9];let p;e[10]!==a||e[11]!==c||e[12]!==d||e[13]!==l?(p=i.jsx(ce,{asChild:!0,children:i.jsx(Ne,{to:l,"aria-label":a,"aria-current":"page","data-testid":"org-rail-local-app",className:c,children:d})}),e[10]=a,e[11]=c,e[12]=d,e[13]=l,e[14]=p):p=e[14];let m;e[15]!==r.labelKey||e[16]!==o?(m=o(r.labelKey),e[15]=r.labelKey,e[16]=o,e[17]=m):m=e[17];let h;e[18]!==m?(h=i.jsx(de,{side:"right",children:m}),e[18]=m,e[19]=h):h=e[19];let f;e[20]!==p||e[21]!==h?(f=i.jsxs(ue,{children:[p,h]}),e[20]=p,e[21]=h,e[22]=f):f=e[22];let u;return e[23]!==n||e[24]!==f?(u=i.jsx(xe,{active:!0,label:n,children:f}),e[23]=n,e[24]=f,e[25]=u):u=e[25],u}function es(){const{org:t}=Re();return vt(t.slug),null}function Pe(t){const e=X.c(52),{onNavigate:s}=t===void 0?{}:t,o=J(),r=Be(),{org:l}=Re(),{data:n}=Ge(),[a,c]=Y.useState(!1),d=ve(),{recent:p,forget:m}=wt(l.slug),{projects:h}=zt(),f=Ot(),u=St(),g=u&&u.projectId===null?u.app:null,j=g?[]:p.flatMap(T=>h.filter(H=>H.id===T)),b=Dt(n??[],l),{recent:O,remember:x}=$t();let y;e[0]===Symbol.for("react.memo_cache_sentinel")?(y=ye.railOrgPrefs(),e[0]=y):y=e[0];const[z,v]=pe(y,ke),S=le(z),A=Y.useSyncExternalStore(qt,Yt,Ut),{shown:w}=Mt(Bt(b,S,l.slug),O,l.slug,A,S.pinned);let C;e[1]===Symbol.for("react.memo_cache_sentinel")?(C={activationConstraint:{distance:8}},e[1]=C):C=e[1];const R=tt(st(ot,C)),N=T=>{const{active:H,over:re}=T;re&&(ge("org_rail_reordered"),v(Me=>Gt(le(Me),w.map(ns),String(H.id),String(re.id))))},I=T=>{s?.(),r({to:"/$org/home",params:{org:T},viewTransition:!0})},L=T=>{ge("org_rail_travel");const H=w.some(re=>re.slug===T);v(re=>Wt(le(re),T)),x(T,H?w.map(ss):void 0),I(T)},E=!d&&"border-r border-sidebar-border";let _;e[2]!==E?(_=U("flex w-[68px] shrink-0 flex-col items-center gap-2.5 overflow-y-auto bg-sidebar px-2.5 pt-3 pb-2 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",E),e[2]=E,e[3]=_):_=e[3];let k;e[4]!==o?(k=o("sidebar.rail.ariaLabel"),e[4]=o,e[5]=k):k=e[5];const F=nt,D=it,M=lt,$=w.map(ts),K=at,W=w.map(T=>i.jsxs(Y.Fragment,{children:[i.jsx(Jt,{org:T,active:T.slug===l.slug,pinned:S.pinned.includes(T.slug),onSelect:T.slug!==l.slug?()=>L(T.slug):f?()=>I(T.slug):void 0,onOpenSettings:()=>{s?.(),r({to:"/$org/settings",params:{org:T.slug}})},onTogglePin:()=>v(H=>Ft(le(H),T.slug)),onHide:T.slug===l.slug?void 0:()=>v(H=>Kt(le(H),T.slug))}),T.slug===l.slug&&j.length>0&&i.jsx("div",{style:{viewTransitionName:"rail-projects"},className:"-mx-1.5 flex w-[calc(100%+0.75rem)] flex-col items-center gap-3 rounded-[12px] bg-foreground/4 px-1 py-3",children:j.map(H=>i.jsx(Vt,{project:H,orgSlug:l.slug,active:f===H.id,onClose:()=>m(H.id),onNavigate:s},H.id))})]},T.id));let P;e[6]!==M||e[7]!==W||e[8]!==$||e[9]!==K?(P=i.jsx(M,{items:$,strategy:K,children:W}),e[6]=M,e[7]=W,e[8]=$,e[9]=K,e[10]=P):P=e[10];let q;e[11]!==F||e[12]!==N||e[13]!==R||e[14]!==P||e[15]!==D?(q=i.jsx(F,{sensors:R,collisionDetection:D,onDragEnd:N,children:P}),e[11]=F,e[12]=N,e[13]=R,e[14]=P,e[15]=D,e[16]=q):q=e[16];let B;e[17]!==l.slug||e[18]!==b||e[19]!==w.length||e[20]!==L?(B=b.length>w.length&&i.jsx(Xt,{orgs:b,currentSlug:l.slug,hiddenCount:b.length-w.length,onSelect:L}),e[17]=l.slug,e[18]=b,e[19]=w.length,e[20]=L,e[21]=B):B=e[21];let G;e[22]!==o?(G=o("sidebar.picker.newOrganization"),e[22]=o,e[23]=G):G=e[23];let V;e[24]!==c?(V=()=>c(!0),e[24]=c,e[25]=V):V=e[25];let fe;e[26]===Symbol.for("react.memo_cache_sentinel")?(fe=i.jsx(mt,{size:18}),e[26]=fe):fe=e[26];let Q;e[27]!==G||e[28]!==V?(Q=i.jsx(ce,{asChild:!0,children:i.jsx("button",{type:"button","aria-label":G,onClick:V,className:"flex size-9 shrink-0 cursor-pointer items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-sidebar-accent hover:text-foreground focus-ring",children:fe})}),e[27]=G,e[28]=V,e[29]=Q):Q=e[29];let Z;e[30]!==o?(Z=o("sidebar.picker.newOrganization"),e[30]=o,e[31]=Z):Z=e[31];let ee;e[32]!==Z?(ee=i.jsx(de,{side:"right",children:Z}),e[32]=Z,e[33]=ee):ee=e[33];let te;e[34]!==Q||e[35]!==ee?(te=i.jsx(xe,{active:!1,children:i.jsxs(ue,{children:[Q,ee]})}),e[34]=Q,e[35]=ee,e[36]=te):te=e[36];let se;e[37]!==g?(se=g&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"my-2 h-px w-6 shrink-0 bg-sidebar-border","aria-hidden":!0}),i.jsx(Zt,{app:g})]}),e[37]=g,e[38]=se):se=e[38];let ne;e[39]!==q||e[40]!==B||e[41]!==te||e[42]!==se||e[43]!==_||e[44]!==k?(ne=i.jsxs("div",{className:_,"aria-label":k,children:[q,B,te,se]}),e[39]=q,e[40]=B,e[41]=te,e[42]=se,e[43]=_,e[44]=k,e[45]=ne):ne=e[45];let ie;e[46]!==a||e[47]!==c?(ie=i.jsx(jt,{open:a,onOpenChange:c}),e[46]=a,e[47]=c,e[48]=ie):ie=e[48];let he;return e[49]!==ne||e[50]!==ie?(he=i.jsxs(i.Fragment,{children:[ne,ie]}),e[49]=ne,e[50]=ie,e[51]=he):he=e[51],he}function ts(t){return t.slug}function ss(t){return t.slug}function ns(t){return t.slug}function is(t){const e=X.c(15),{width:s,minWidth:o,maxWidth:r,onPointerDown:l,onKeyDown:n,onDoubleClick:a}=t,c=J(),{isMobile:d}=Te(),p=ve();if(d||p)return null;let m;e[0]!==c?(m=c("sidebar.sidebarResizeHandle.ariaLabel"),e[0]=c,e[1]=m):m=e[1];let h;e[2]!==c?(h=c("sidebar.sidebarResizeHandle.title"),e[2]=c,e[3]=h):h=e[3];let f,u;e[4]===Symbol.for("react.memo_cache_sentinel")?(f={left:"var(--sidebar-width)"},u=i.jsx("span",{className:"pointer-events-none absolute inset-y-0 left-1/2 w-px -translate-x-1/2 bg-transparent transition-colors duration-150 group-hover/resize:bg-border group-active/resize:bg-border group-focus-visible/resize:bg-ring"}),e[4]=f,e[5]=u):(f=e[4],u=e[5]);let g;return e[6]!==r||e[7]!==o||e[8]!==a||e[9]!==n||e[10]!==l||e[11]!==m||e[12]!==h||e[13]!==s?(g=i.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":m,"aria-valuenow":s,"aria-valuemin":o,"aria-valuemax":r,title:h,tabIndex:0,onPointerDown:l,onKeyDown:n,onDoubleClick:a,className:"group/resize absolute top-0 z-20 h-full w-2 -translate-x-1/2 cursor-col-resize focus-visible:outline-none",style:f,children:u}),e[6]=r,e[7]=o,e[8]=a,e[9]=n,e[10]=l,e[11]=m,e[12]=h,e[13]=s,e[14]=g):g=e[14],g}const je=400,_e=16,rs="sidebar.width.v2";function os(){const t=X.c(14),e=ls;let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=u=>typeof u=="number"?e(u):192,t[0]=s):s=t[0];const[o,r]=pe(rs,s),l=Y.useRef(null);let n;t[1]!==r||t[2]!==o?(n=u=>{u.preventDefault();const g=u.clientX,j=e(o),b=l.current??(typeof document<"u"?document.querySelector('[data-slot="sidebar-wrapper"]'):null),O=b?Array.from(b.querySelectorAll('[data-slot="sidebar"], [data-slot="sidebar-container"]')):[];for(const z of O)z.style.transition="none";const x=z=>{const v=e(j+(z.clientX-g));b?.style.setProperty("--sidebar-width",`${v}px`)},y=z=>{const v=e(j+(z.clientX-g));r(v);for(const S of O)S.style.transition="";window.removeEventListener("pointermove",x),window.removeEventListener("pointerup",y),window.removeEventListener("pointercancel",y),document.body.style.userSelect="",document.body.style.cursor=""};document.body.style.userSelect="none",document.body.style.cursor="col-resize",window.addEventListener("pointermove",x),window.addEventListener("pointerup",y),window.addEventListener("pointercancel",y)},t[1]=r,t[2]=o,t[3]=n):n=t[3];const a=n;let c;t[4]!==r?(c=()=>{r(192)},t[4]=r,t[5]=c):c=t[5];const d=c;let p;t[6]!==r||t[7]!==o?(p=u=>{if(u.key==="ArrowLeft")r(e(o-_e));else if(u.key==="ArrowRight")r(e(o+_e));else if(u.key==="Home")r(192);else if(u.key==="End")r(je);else return;u.preventDefault()},t[6]=r,t[7]=o,t[8]=p):p=t[8];const m=p,h=e(o);let f;return t[9]!==m||t[10]!==a||t[11]!==d||t[12]!==h?(f={width:h,minWidth:192,maxWidth:je,wrapperRef:l,onStartResize:a,onKeyDownResize:m,resetWidth:d},t[9]=m,t[10]=a,t[11]=d,t[12]=h,t[13]=f):f=t[13],f}function ls(t){return Math.max(192,Math.min(je,t))}const De=Y.createContext(null);function as(){const t=Y.use(De);if(!t)throw new Error("Layout regions require a Layout");return t}function cs({children:t,notice:e,outsideOrg:s}){const o=et(),[r,l]=pe(ye.sidebarOpen(),!0),n=os(),a=Ee();return i.jsx(De,{value:{isMobile:o,resize:n},children:i.jsx(qe,{open:r,onOpenChange:l,children:i.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[e,i.jsxs("div",{className:"flex flex-1 flex-row min-h-0",children:[a&&!s&&i.jsx(es,{}),!o&&a&&(s?.rail??!0)&&i.jsx(Pe,{}),i.jsx(Ye,{ref:n.wrapperRef,className:"flex-1 bg-sidebar relative min-h-0",style:{"--sidebar-width":`${n.width}px`,"--sidebar-width-icon":a?"0px":"3.125rem"},children:i.jsx(Ue,{children:t})})]})]})})})}function ds(t){const e=X.c(37),{children:s,renderMobile:o}=t,r=J(),{isMobile:l,resize:n}=as(),{openMobile:a,setOpenMobile:c}=Te(),d=ve(),p=Ee();let m;e[0]!==c?(m=()=>c(!1),e[0]=c,e[1]=m):m=e[1];const h=m;if(!l){const z=p&&d;let v;e[2]!==s||e[3]!==z?(v=i.jsx("div",{className:"contents",inert:z,children:s}),e[2]=s,e[3]=z,e[4]=v):v=e[4];let S;e[5]!==n.maxWidth||e[6]!==n.minWidth||e[7]!==n.onKeyDownResize||e[8]!==n.onStartResize||e[9]!==n.resetWidth||e[10]!==n.width?(S=i.jsx(is,{width:n.width,minWidth:n.minWidth,maxWidth:n.maxWidth,onPointerDown:n.onStartResize,onKeyDown:n.onKeyDownResize,onDoubleClick:n.resetWidth}),e[5]=n.maxWidth,e[6]=n.minWidth,e[7]=n.onKeyDownResize,e[8]=n.onStartResize,e[9]=n.resetWidth,e[10]=n.width,e[11]=S):S=e[11];let A;return e[12]!==v||e[13]!==S?(A=i.jsxs(i.Fragment,{children:[v,S]}),e[12]=v,e[13]=S,e[14]=A):A=e[14],A}let f;e[15]!==r?(f=r("layouts.shellControls.navigationTitle"),e[15]=r,e[16]=f):f=e[16];let u;e[17]!==f?(u=i.jsx(Ve,{className:"sr-only",children:f}),e[17]=f,e[18]=u):u=e[18];let g;e[19]!==h||e[20]!==p?(g=p&&i.jsx(Pe,{onNavigate:h}),e[19]=h,e[20]=p,e[21]=g):g=e[21];let j;e[22]!==h||e[23]!==o?(j=o({onClose:h}),e[22]=h,e[23]=o,e[24]=j):j=e[24];let b;e[25]!==j?(b=i.jsx("div",{className:"min-w-0 flex-1",children:j}),e[25]=j,e[26]=b):b=e[26];let O;e[27]!==g||e[28]!==b?(O=i.jsxs("div",{className:"flex h-full min-h-0",children:[g,b]}),e[27]=g,e[28]=b,e[29]=O):O=e[29];let x;e[30]!==u||e[31]!==O?(x=i.jsxs(Qe,{side:"left",hideCloseButton:!0,className:"w-screen max-w-none! p-0",onOpenAutoFocus:us,children:[u,O]}),e[30]=u,e[31]=O,e[32]=x):x=e[32];let y;return e[33]!==a||e[34]!==c||e[35]!==x?(y=i.jsx(Ze,{open:a,onOpenChange:c,children:x}),e[33]=a,e[34]=c,e[35]=x,e[36]=y):y=e[36],y}function us(t){return t.preventDefault()}function fs(t){const e=X.c(3),{children:s}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={background:"transparent",containerType:"inline-size"},e[0]=o):o=e[0];let r;return e[1]!==s?(r=i.jsx(Je,{className:"flex flex-col min-h-0",style:o,children:i.jsx(Xe,{variant:"plain",className:"bg-sidebar",children:i.jsx("div",{className:"relative flex-1 min-h-0 flex flex-row",children:s})})}),e[1]=s,e[2]=r):r=e[2],r}const ks=Object.assign(cs,{Sidebar:ds,Content:fs});export{Ls as I,ks as L,Se as O,Ht as u,Dt as w};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{c as q,b as Z,r as Q,j as t,B as te,h as it,l as ve,X as vs,T as bs,V as js,U as He,at as Ut,ar as Yt,as as Bt,t as oe,a2 as Fe,D as Xe,q as Je,s as lt,v as at,H as Ye,a3 as ys,fE as an,w as Vt,L as ws,I as ke,ak as rn,z as on,et as tt,av as Wt,aj as cn,es as ze,er as Be,an as Tt,m as Ss,K as Dt,fF as dn,fG as un,fH as mn,ba as be,fI as je,n as Ue,P as fn,d as Pt,u as pn,af as rt,o as Ns,e as hn,aM as Cs,y as _e,b2 as xn,a as gn,fJ as ks,fK as vn,aX as bn,ad as jn,aE as yn,aD as wn,a5 as Sn,fL as Nn,aL as Cn}from"./index-9Td7hVK9.js";import{g as kn}from"./extract-connection-data-DgQP-Acf.js";import{b as Mn}from"./chat-context-BITSwdcc.js";import{U as _n,b as Vn}from"./build-improve-prompt-doc-hZbkitda.js";import{E as Tn}from"./empty-state-CCT3pK8b.js";import{a as Dn}from"./shell-layout-CY1spQRE.js";import{g as ft,n as Pn,a as Kt,e as On,u as In,f as An}from"./use-date-fns-locale-BkRX2MBK.js";import{a as $n}from"./mcp-oauth-BHBhycgr.js";import{f as Fn,e as En,b as zn,A as Rn,a as Ln,d as Un,c as Yn,g as Bn}from"./alert-dialog-378JEYD5.js";import{T as ut}from"./textarea-DHjq38AG.js";import{c as Se,T as Ne,a as Ce}from"./tooltip-DV3h0qB7.js";import{a as Ot,b as Ms,u as Wn}from"./use-connection-D86v3ILu.js";import{b as Kn,a as _s,g as Vs,f as Gn,k as qn}from"./repository-binding-BS8jIipN.js";import{i as Gt}from"./mcp-oauth-CkjCA9RZ.js";import{bg as Hn,k as Qn,bh as Xn,bi as Jn,aN as Zn,aH as ei,aK as ti,bj as si,bk as Ts,bl as Ds,bm as ni,as as ii,bn as li,bo as jt,bp as qt,A as Ht,M as ai,bq as ri,br as oi,g as Ps,p as Qt,n as ci,w as di,v as ui,u as mi,f as Os,D as Xt,aL as fi,ag as pi,ay as hi}from"./agent-icon-CI8VdOMu.js";import{s as Pe}from"./Plus-OUKjFCO5.js";import{t as dt,a as xi}from"./Tool01-BY6oDwaL.js";import{s as It}from"./Trash01-DACOfhdO.js";import{u as Jt}from"./use-debounced-autosave-BsfvM49F.js";import{A as gi}from"./add-connection-dialog-DkBENg1p.js";import{i as Ct}from"./SearchMd-DOAm11zk.js";import{F as Zt}from"./file-type-icon-CtpbaJ_o.js";import{i as vi,j as bi,k as ji,l as yi}from"./use-org-fs-D5WYBjY7.js";import{I as Ze}from"./integration-icon-Czum6uhQ.js";import{C as Is}from"./checkbox-0NOpAJ5T.js";import{S as wi}from"./search-input-B_OlFySN.js";import{b as Oe,a as Ie,c as we,d as Ae,S as $e}from"./select-DhiDgIO1.js";import{s as At}from"./XClose-CQaQUNf-.js";import{C as Si}from"./collection-tabs-DaLQpZio.js";import{T as As,u as $s}from"./use-mcp-auth-status-C-8wTSBe.js";import{u as pt}from"./use-mcp-client-BhxxHJAR.js";import{a as Fs}from"./use-mcp-tools-B-1ERvY-.js";import{u as Ni}from"./use-mcp-prompts-CWm61MWP.js";import{g as Ci}from"./connection-slug-CITJ0kGN.js";import{t as kt}from"./utils-CVEq3hMx.js";import{S as ht}from"./switch-yuJEjOLk.js";import{a as Es,b as zs,P as Rs}from"./popover-y1Oe7lDX.js";import{S as ki}from"./scroll-area-CW5-JRgC.js";import{i as Mi}from"./Upload01-B7LEFTjQ.js";import{i as _i}from"./DotsVertical-D-hn0Dkf.js";import{a as Vi}from"./Image01-DAZebL5E.js";import{i as Ti}from"./Monitor01-AJCHl5A0.js";import{g as Di}from"./types-lFikl_dm.js";import{a as Ls,d as Pi,u as Oi}from"./use-main-schema-v8-CPnLt6Ij.js";import{a as Ii}from"./use-panel-navigate-PJ02Fhm0.js";import{u as Ai,e as Mt,r as _t,p as $i,g as Fi,s as Ei,t as zi,h as Ri,a as Li}from"./use-project-native-view-presence-DhJ5XyAj.js";import{a as Us,u as Ui,i as Yi,o as Bi,r as es,p as Wi,w as Ki,b as ts}from"./optimistic-project-sidebar-views-CDbNj78E.js";import{P as Gi,a as qi,i as Hi}from"./sections-Bx_NBrfK.js";import{i as $t}from"./Key01-C4oKdOxt.js";import{a as Qi}from"./format-time-Cq80KKvY.js";import{a as xt}from"./Copy01-BfzavrnK.js";import{u as Xi}from"./use-copy-DbzSulAX.js";import{L as ye}from"./label-BzQ0oC62.js";import{s as Ys,p as Ji,f as Zi}from"./thread-intent-C-QntTcr.js";import{V as el,E as gt,r as Bs,C as tl,w as sl}from"./virtual-mcp-CN6o7d3g.js";import{s as Ws}from"./slugify-CEUa2lfQ.js";import{b as nl,a as il,D as ll}from"./drawer-C_Kv9tyJ.js";import{u as al}from"./use-mobile-DPUoyyVH.js";import{d as vt}from"./delay-CnY5UFtP.js";import{b as rl}from"./sandbox-url-D3mC8qhT.js";import{S as ol,a as cl,b as dl}from"./secret-picker-BlRp4HzP.js";import{u as ul,a as ml}from"./use-secrets-wjYhC2WJ.js";import{o as ss}from"./omit-sandbox-map-jj4lCB2U.js";import{G as fl}from"./repository-picker-CetmC7NO.js";import{r as pl}from"./serial-task-queue-CGOeQgpr.js";import{t as De,c as Qe,m as hl,a as Ks}from"./differenceInSeconds-C3x8sHUj.js";function nt(l,e){const s=ft(),n=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??s.weekStartsOn??s.locale?.options?.weekStartsOn??0,i=De(l,e?.in),a=i.getDay(),c=(a<n?7:0)+a-n;return i.setDate(i.getDate()-c),i.setHours(0,0,0,0),i}function mt(l,e){return nt(l,{...e,weekStartsOn:1})}function Gs(l,e){const s=De(l,e?.in),n=s.getFullYear(),i=Qe(s,0);i.setFullYear(n+1,0,4),i.setHours(0,0,0,0);const a=mt(i),c=Qe(s,0);c.setFullYear(n,0,4),c.setHours(0,0,0,0);const r=mt(c);return s.getTime()>=a.getTime()?n+1:s.getTime()>=r.getTime()?n:n-1}function ns(l,e){const s=De(l,e?.in);return s.setHours(0,0,0,0),s}function xl(l,e,s){const[n,i]=Pn(s?.in,l,e),a=ns(n),c=ns(i),r=+a-Kt(a),p=+c-Kt(c);return Math.round((r-p)/hl)}function gl(l,e){const s=Gs(l,e),n=Qe(l,0);return n.setFullYear(s,0,4),n.setHours(0,0,0,0),mt(n)}function vl(l){return l instanceof Date||typeof l=="object"&&Object.prototype.toString.call(l)==="[object Date]"}function bl(l){return!(!vl(l)&&typeof l!="number"||isNaN(+De(l)))}function jl(l,e){const s=De(l,e?.in);return s.setFullYear(s.getFullYear(),0,1),s.setHours(0,0,0,0),s}function yl(l,e){const s=De(l,e?.in);return xl(s,jl(s))+1}function wl(l,e){const s=De(l,e?.in),n=+mt(s)-+gl(s);return Math.round(n/Ks)+1}function qs(l,e){const s=De(l,e?.in),n=s.getFullYear(),i=ft(),a=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,c=Qe(e?.in||l,0);c.setFullYear(n+1,0,a),c.setHours(0,0,0,0);const r=nt(c,e),p=Qe(e?.in||l,0);p.setFullYear(n,0,a),p.setHours(0,0,0,0);const o=nt(p,e);return+s>=+r?n+1:+s>=+o?n:n-1}function Sl(l,e){const s=ft(),n=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,i=qs(l,e),a=Qe(e?.in||l,0);return a.setFullYear(i,0,n),a.setHours(0,0,0,0),nt(a,e)}function Nl(l,e){const s=De(l,e?.in),n=+nt(s,e)-+Sl(s,e);return Math.round(n/Ks)+1}function re(l,e){const s=l<0?"-":"",n=Math.abs(l).toString().padStart(e,"0");return s+n}const Ee={y(l,e){const s=l.getFullYear(),n=s>0?s:1-s;return re(e==="yy"?n%100:n,e.length)},M(l,e){const s=l.getMonth();return e==="M"?String(s+1):re(s+1,2)},d(l,e){return re(l.getDate(),e.length)},a(l,e){const s=l.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return s.toUpperCase();case"aaa":return s;case"aaaaa":return s[0];default:return s==="am"?"a.m.":"p.m."}},h(l,e){return re(l.getHours()%12||12,e.length)},H(l,e){return re(l.getHours(),e.length)},m(l,e){return re(l.getMinutes(),e.length)},s(l,e){return re(l.getSeconds(),e.length)},S(l,e){const s=e.length,n=l.getMilliseconds(),i=Math.trunc(n*Math.pow(10,s-3));return re(i,e.length)}},qe={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},is={G:function(l,e,s){const n=l.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return s.era(n,{width:"abbreviated"});case"GGGGG":return s.era(n,{width:"narrow"});default:return s.era(n,{width:"wide"})}},y:function(l,e,s){if(e==="yo"){const n=l.getFullYear(),i=n>0?n:1-n;return s.ordinalNumber(i,{unit:"year"})}return Ee.y(l,e)},Y:function(l,e,s,n){const i=qs(l,n),a=i>0?i:1-i;if(e==="YY"){const c=a%100;return re(c,2)}return e==="Yo"?s.ordinalNumber(a,{unit:"year"}):re(a,e.length)},R:function(l,e){const s=Gs(l);return re(s,e.length)},u:function(l,e){const s=l.getFullYear();return re(s,e.length)},Q:function(l,e,s){const n=Math.ceil((l.getMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return re(n,2);case"Qo":return s.ordinalNumber(n,{unit:"quarter"});case"QQQ":return s.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return s.quarter(n,{width:"narrow",context:"formatting"});default:return s.quarter(n,{width:"wide",context:"formatting"})}},q:function(l,e,s){const n=Math.ceil((l.getMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return re(n,2);case"qo":return s.ordinalNumber(n,{unit:"quarter"});case"qqq":return s.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return s.quarter(n,{width:"narrow",context:"standalone"});default:return s.quarter(n,{width:"wide",context:"standalone"})}},M:function(l,e,s){const n=l.getMonth();switch(e){case"M":case"MM":return Ee.M(l,e);case"Mo":return s.ordinalNumber(n+1,{unit:"month"});case"MMM":return s.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return s.month(n,{width:"narrow",context:"formatting"});default:return s.month(n,{width:"wide",context:"formatting"})}},L:function(l,e,s){const n=l.getMonth();switch(e){case"L":return String(n+1);case"LL":return re(n+1,2);case"Lo":return s.ordinalNumber(n+1,{unit:"month"});case"LLL":return s.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return s.month(n,{width:"narrow",context:"standalone"});default:return s.month(n,{width:"wide",context:"standalone"})}},w:function(l,e,s,n){const i=Nl(l,n);return e==="wo"?s.ordinalNumber(i,{unit:"week"}):re(i,e.length)},I:function(l,e,s){const n=wl(l);return e==="Io"?s.ordinalNumber(n,{unit:"week"}):re(n,e.length)},d:function(l,e,s){return e==="do"?s.ordinalNumber(l.getDate(),{unit:"date"}):Ee.d(l,e)},D:function(l,e,s){const n=yl(l);return e==="Do"?s.ordinalNumber(n,{unit:"dayOfYear"}):re(n,e.length)},E:function(l,e,s){const n=l.getDay();switch(e){case"E":case"EE":case"EEE":return s.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return s.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(n,{width:"short",context:"formatting"});default:return s.day(n,{width:"wide",context:"formatting"})}},e:function(l,e,s,n){const i=l.getDay(),a=(i-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(a);case"ee":return re(a,2);case"eo":return s.ordinalNumber(a,{unit:"day"});case"eee":return s.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return s.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(i,{width:"short",context:"formatting"});default:return s.day(i,{width:"wide",context:"formatting"})}},c:function(l,e,s,n){const i=l.getDay(),a=(i-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(a);case"cc":return re(a,e.length);case"co":return s.ordinalNumber(a,{unit:"day"});case"ccc":return s.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return s.day(i,{width:"narrow",context:"standalone"});case"cccccc":return s.day(i,{width:"short",context:"standalone"});default:return s.day(i,{width:"wide",context:"standalone"})}},i:function(l,e,s){const n=l.getDay(),i=n===0?7:n;switch(e){case"i":return String(i);case"ii":return re(i,e.length);case"io":return s.ordinalNumber(i,{unit:"day"});case"iii":return s.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return s.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return s.day(n,{width:"short",context:"formatting"});default:return s.day(n,{width:"wide",context:"formatting"})}},a:function(l,e,s){const i=l.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return s.dayPeriod(i,{width:"narrow",context:"formatting"});default:return s.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(l,e,s){const n=l.getHours();let i;switch(n===12?i=qe.noon:n===0?i=qe.midnight:i=n/12>=1?"pm":"am",e){case"b":case"bb":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return s.dayPeriod(i,{width:"narrow",context:"formatting"});default:return s.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(l,e,s){const n=l.getHours();let i;switch(n>=17?i=qe.evening:n>=12?i=qe.afternoon:n>=4?i=qe.morning:i=qe.night,e){case"B":case"BB":case"BBB":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return s.dayPeriod(i,{width:"narrow",context:"formatting"});default:return s.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(l,e,s){if(e==="ho"){let n=l.getHours()%12;return n===0&&(n=12),s.ordinalNumber(n,{unit:"hour"})}return Ee.h(l,e)},H:function(l,e,s){return e==="Ho"?s.ordinalNumber(l.getHours(),{unit:"hour"}):Ee.H(l,e)},K:function(l,e,s){const n=l.getHours()%12;return e==="Ko"?s.ordinalNumber(n,{unit:"hour"}):re(n,e.length)},k:function(l,e,s){let n=l.getHours();return n===0&&(n=24),e==="ko"?s.ordinalNumber(n,{unit:"hour"}):re(n,e.length)},m:function(l,e,s){return e==="mo"?s.ordinalNumber(l.getMinutes(),{unit:"minute"}):Ee.m(l,e)},s:function(l,e,s){return e==="so"?s.ordinalNumber(l.getSeconds(),{unit:"second"}):Ee.s(l,e)},S:function(l,e){return Ee.S(l,e)},X:function(l,e,s){const n=l.getTimezoneOffset();if(n===0)return"Z";switch(e){case"X":return as(n);case"XXXX":case"XX":return Le(n);default:return Le(n,":")}},x:function(l,e,s){const n=l.getTimezoneOffset();switch(e){case"x":return as(n);case"xxxx":case"xx":return Le(n);default:return Le(n,":")}},O:function(l,e,s){const n=l.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+ls(n,":");default:return"GMT"+Le(n,":")}},z:function(l,e,s){const n=l.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+ls(n,":");default:return"GMT"+Le(n,":")}},t:function(l,e,s){const n=Math.trunc(+l/1e3);return re(n,e.length)},T:function(l,e,s){return re(+l,e.length)}};function ls(l,e=""){const s=l>0?"-":"+",n=Math.abs(l),i=Math.trunc(n/60),a=n%60;return a===0?s+String(i):s+String(i)+e+re(a,2)}function as(l,e){return l%60===0?(l>0?"-":"+")+re(Math.abs(l)/60,2):Le(l,e)}function Le(l,e=""){const s=l>0?"-":"+",n=Math.abs(l),i=re(Math.trunc(n/60),2),a=re(n%60,2);return s+i+e+a}const rs=(l,e)=>{switch(l){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}},Hs=(l,e)=>{switch(l){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}},Cl=(l,e)=>{const s=l.match(/(P+)(p+)?/)||[],n=s[1],i=s[2];if(!i)return rs(l,e);let a;switch(n){case"P":a=e.dateTime({width:"short"});break;case"PP":a=e.dateTime({width:"medium"});break;case"PPP":a=e.dateTime({width:"long"});break;default:a=e.dateTime({width:"full"});break}return a.replace("{{date}}",rs(n,e)).replace("{{time}}",Hs(i,e))},kl={p:Hs,P:Cl},Ml=/^D+$/,_l=/^Y+$/,Vl=["D","DD","YY","YYYY"];function Tl(l){return Ml.test(l)}function Dl(l){return _l.test(l)}function Pl(l,e,s){const n=Ol(l,e,s);if(console.warn(n),Vl.includes(l))throw new RangeError(n)}function Ol(l,e,s){const n=l[0]==="Y"?"years":"days of the month";return`Use \`${l.toLowerCase()}\` instead of \`${l}\` (in \`${e}\`) for formatting ${n} to the input \`${s}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Il=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Al=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,$l=/^'([^]*?)'?$/,Fl=/''/g,El=/[a-zA-Z]/;function zl(l,e,s){const n=ft(),i=s?.locale??n.locale??On,a=s?.firstWeekContainsDate??s?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,c=s?.weekStartsOn??s?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=De(l,s?.in);if(!bl(r))throw new RangeError("Invalid time value");let p=e.match(Al).map(f=>{const m=f[0];if(m==="p"||m==="P"){const u=kl[m];return u(f,i.formatLong)}return f}).join("").match(Il).map(f=>{if(f==="''")return{isToken:!1,value:"'"};const m=f[0];if(m==="'")return{isToken:!1,value:Rl(f)};if(is[m])return{isToken:!0,value:f};if(m.match(El))throw new RangeError("Format string contains an unescaped latin alphabet character `"+m+"`");return{isToken:!1,value:f}});i.localize.preprocessor&&(p=i.localize.preprocessor(r,p));const o={firstWeekContainsDate:a,weekStartsOn:c,locale:i};return p.map(f=>{if(!f.isToken)return f.value;const m=f.value;(!s?.useAdditionalWeekYearTokens&&Dl(m)||!s?.useAdditionalDayOfYearTokens&&Tl(m))&&Pl(m,e,String(l));const u=is[m[0]];return u(r,m,i.localize,o)}).join("")}function Rl(l){const e=l.match($l);return e?e[1].replace(Fl,"'"):l}const Qs=25*1024*1024,yt="home",wt="knowledge";function os(l){return l==null?"":l<1024?`${l} B`:l<1024*1024?`${(l/1024).toFixed(0)} KB`:`${(l/(1024*1024)).toFixed(1)} MB`}function Re(l){return l.split("/").pop()??l}function Ll(l){const e=q.c(64),{form:s}=l,n=Z(),{upload:i}=vi(yt),a=bi(),c=Q.useRef(null),[r,p]=Q.useState(!1),[o,f]=Q.useState(""),[m,u]=Q.useState(!1);let h;e[0]!==r?(h={enabled:r},e[0]=r,e[1]=h):h=e[1];const{data:d}=ji(60,h),x=d===void 0?[]:d;let g;e[2]!==r?(g={enabled:r},e[2]=r,e[3]=g):g=e[3];const{data:v}=yi(g),y=v===void 0?[]:v;let j;e[4]!==s?(j=()=>s.getValues("metadata.knowledge")??[],e[4]=s,e[5]=j):j=e[5];const[b,S]=Q.useState(j);let N;e[6]!==s?(N=I=>{S(I),s.setValue("metadata.knowledge",I,{shouldDirty:!0})},e[6]=s,e[7]=N):N=e[7];const k=N;let w;e[8]!==a||e[9]!==b||e[10]!==k||e[11]!==n||e[12]!==i?(w=async I=>{if(!I||I.length===0)return;const ne=Array.from(I),L=ne.filter(ql),ee=ne.filter(Gl);if(ee.length>0&&oe.warning(n("virtualMcp.filesSection.fileTooLargeTitle"),{description:n("virtualMcp.filesSection.fileTooLargeDescription",{names:ee.map(Kl).join(", ")})}),L.length!==0){try{await i.mutateAsync({dir:wt,files:L})}catch(J){const pe=J;oe.error(pe instanceof Error?pe.message:n("virtualMcp.filesSection.failedUploadFile"));return}k([...b,...L.map(J=>({id:crypto.randomUUID(),name:J.name,volume:yt,path:`${wt}/${J.name}`,url:a(yt,`${wt}/${J.name}`),contentType:J.type||null,size:J.size,addedAt:new Date().toISOString()}))])}},e[8]=a,e[9]=b,e[10]=k,e[11]=n,e[12]=i,e[13]=w):w=e[13];const C=w;let _;e[14]!==a||e[15]!==b||e[16]!==k?(_=I=>{b.some(ne=>ne.volume===I.volume&&ne.path===I.path)||(k([...b,{id:crypto.randomUUID(),name:Re(I.path),volume:I.volume,path:I.path,url:a(I.volume,I.path),contentType:null,size:I.size??null,addedAt:new Date().toISOString()}]),p(!1))},e[14]=a,e[15]=b,e[16]=k,e[17]=_):_=e[17];const T=_;let V;e[18]!==a||e[19]!==b||e[20]!==k?(V=I=>{b.some(ne=>ne.volume===I.volume&&ne.path===I.path)||(k([...b,{id:crypto.randomUUID(),name:Re(I.path),kind:"skill",volume:I.volume,path:I.path,url:a(I.volume,I.path),contentType:null,size:null,addedAt:new Date().toISOString()}]),p(!1))},e[18]=a,e[19]=b,e[20]=k,e[21]=V):V=e[21];const $=V;let D;e[22]!==b||e[23]!==k?(D=I=>{k(b.filter(ne=>ne.id!==I))},e[22]=b,e[23]=k,e[24]=D):D=e[24];const A=D;let P;e[25]===Symbol.for("react.memo_cache_sentinel")?(P=I=>{p(I),I&&f("")},e[25]=P):P=e[25];const E=P;let U;e[26]!==b?(U=new Set(b.map(Wl)),e[26]=b,e[27]=U):U=e[27];const K=U,Y=o.toLowerCase();let B;e[28]!==K?(B=I=>!K.has(`${I.volume}/${I.path}`),e[28]=K,e[29]=B):B=e[29];const z=x.filter(Bl).filter(B).filter(I=>Re(I.path).toLowerCase().includes(Y)).slice(0,5);let M;e[30]!==K?(M=I=>!K.has(`${I.volume}/${I.path}`),e[30]=K,e[31]=M):M=e[31];const O=y.filter(M).filter(I=>Re(I.path).toLowerCase().includes(Y)).slice(0,5),G=I=>t.jsxs(vs,{open:r,onOpenChange:E,children:[t.jsx(bs,{asChild:!0,children:I}),t.jsxs(js,{align:"end",className:"w-56",children:[t.jsxs(He,{onSelect:()=>{c.current?.click()},children:[t.jsx(Hn,{size:16}),n("virtualMcp.filesSection.uploadFile")]}),t.jsxs(Ut,{children:[t.jsxs(Yt,{className:"gap-2 [&_svg:not([class*='text-'])]:text-muted-foreground",children:[t.jsx(Qn,{size:16}),n("virtualMcp.filesSection.selectFileOrFolder")]}),t.jsxs(Bt,{className:"w-72 p-0",children:[t.jsxs("div",{className:"flex items-center gap-2 border-b px-3",children:[t.jsx(Ct,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsx("input",{value:o,onChange:ne=>f(ne.target.value),onKeyDown:Yl,placeholder:n("virtualMcp.filesSection.searchFilesPlaceholder"),className:"h-10 w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),t.jsx("div",{className:"max-h-64 overflow-y-auto p-1",children:z.length===0?t.jsx("p",{className:"px-2 py-3 text-center text-sm text-muted-foreground",children:n("virtualMcp.filesSection.noFilesFound")}):z.map(ne=>t.jsxs(He,{onSelect:()=>T(ne),children:[t.jsx(Zt,{filename:Re(ne.path),className:"h-5 w-4 shrink-0"}),t.jsx("span",{className:"flex-1 truncate",children:Re(ne.path)}),ne.size!=null&&t.jsx("span",{className:"text-xs text-muted-foreground",children:os(ne.size)})]},`${ne.volume}/${ne.path}`))})]})]}),t.jsxs(Ut,{children:[t.jsxs(Yt,{className:"gap-2 [&_svg:not([class*='text-'])]:text-muted-foreground",children:[t.jsx(dt,{size:16}),n("virtualMcp.filesSection.selectSkill")]}),t.jsxs(Bt,{className:"w-72 p-0",children:[t.jsxs("div",{className:"flex items-center gap-2 border-b px-3",children:[t.jsx(Ct,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsx("input",{value:o,onChange:ne=>f(ne.target.value),onKeyDown:Ul,placeholder:n("virtualMcp.filesSection.searchSkillsPlaceholder"),className:"h-10 w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),t.jsx("div",{className:"max-h-64 overflow-y-auto p-1",children:O.length===0?t.jsx("p",{className:"px-2 py-3 text-center text-sm text-muted-foreground",children:n("virtualMcp.filesSection.noSkillsFound")}):O.map(ne=>t.jsxs(He,{onSelect:()=>$(ne),children:[t.jsx(dt,{size:16,className:"shrink-0"}),t.jsx("span",{className:"flex-1 truncate",children:Re(ne.path)})]},`${ne.volume}/${ne.path}`))})]})]})]})]}),R="flex flex-col gap-3";let F;e[32]!==n?(F=n("virtualMcp.filesSection.filesAndSkills"),e[32]=n,e[33]=F):F=e[33];let W;e[34]!==F?(W=t.jsx("h2",{className:"text-sm font-medium text-foreground",children:F}),e[34]=F,e[35]=W):W=e[35];let H;e[36]!==n?(H=n("virtualMcp.filesSection.description"),e[36]=n,e[37]=H):H=e[37];let se;e[38]!==H?(se=t.jsx("p",{className:"text-sm text-muted-foreground",children:H}),e[38]=H,e[39]=se):se=e[39];let le;e[40]!==W||e[41]!==se?(le=t.jsxs("div",{className:"flex flex-col gap-1",children:[W,se]}),e[40]=W,e[41]=se,e[42]=le):le=e[42];const ce=b.length>0&&G(t.jsxs(te,{variant:"outline",size:"sm",disabled:i.isPending,children:[i.isPending?t.jsx(it,{size:"xs"}):t.jsx(Pe,{size:14}),n("virtualMcp.filesSection.add")]}));let ae;e[43]!==le||e[44]!==ce?(ae=t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[le,ce]}),e[43]=le,e[44]=ce,e[45]=ae):ae=e[45];let ie;e[46]!==C?(ie=t.jsx("input",{ref:c,type:"file",multiple:!0,className:"hidden",onChange:I=>{C(I.target.files),I.target.value=""}}),e[46]=C,e[47]=ie):ie=e[47];let X,de;e[48]===Symbol.for("react.memo_cache_sentinel")?(X=I=>{I.preventDefault(),u(!0)},de=()=>u(!1),e[48]=X,e[49]=de):(X=e[48],de=e[49]);let ue;e[50]!==C?(ue=I=>{I.preventDefault(),I.stopPropagation(),u(!1),C(I.dataTransfer.files)},e[50]=C,e[51]=ue):ue=e[51];const he=m&&"outline outline-2 outline-dashed outline-primary";let me;e[52]!==he?(me=ve("flex flex-col gap-2 rounded-lg",he),e[52]=he,e[53]=me):me=e[53];const xe=b.length===0?G(t.jsxs("button",{type:"button",className:"flex items-center gap-3 px-3 py-2.5 rounded-lg border border-dashed border-border hover:bg-accent transition-colors w-full text-left cursor-pointer",children:[t.jsx("div",{className:"flex items-center justify-center size-8 rounded-md text-muted-foreground/75 border border-dashed border-border shrink-0",children:t.jsx(Pe,{size:16})}),t.jsx("span",{className:"text-sm text-muted-foreground flex-1",children:n("virtualMcp.filesSection.noFilesOrSkillsYet")})]})):b.map(I=>t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 surface",children:[I.kind==="skill"?t.jsx("div",{className:"flex items-center justify-center h-8 w-6.5 shrink-0 rounded-md bg-muted text-muted-foreground",children:t.jsx(dt,{size:16})}):t.jsx(Zt,{filename:I.name,className:"h-8 w-6.5 shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:I.name}),t.jsx("p",{className:"text-xs text-muted-foreground",children:I.kind==="skill"?n("virtualMcp.filesSection.kindSkill"):I.size!=null?os(I.size):n("virtualMcp.filesSection.kindFile")})]}),t.jsx(te,{variant:"ghost",size:"icon",onClick:()=>A(I.id),"aria-label":n("virtualMcp.filesSection.removeAriaLabel",{name:I.name}),children:t.jsx(It,{size:16})})]},I.id));let ge;e[54]!==X||e[55]!==de||e[56]!==ue||e[57]!==me||e[58]!==xe?(ge=t.jsx("div",{onDragOver:X,onDragLeave:de,onDrop:ue,className:me,children:xe}),e[54]=X,e[55]=de,e[56]=ue,e[57]=me,e[58]=xe,e[59]=ge):ge=e[59];let fe;return e[60]!==ae||e[61]!==ie||e[62]!==ge?(fe=t.jsxs("section",{className:R,children:[ae,ie,ge]}),e[60]=ae,e[61]=ie,e[62]=ge,e[63]=fe):fe=e[63],fe}function Ul(l){return l.stopPropagation()}function Yl(l){return l.stopPropagation()}function Bl(l){return l.kind!=="dir"}function Wl(l){return`${l.volume}/${l.path}`}function Kl(l){return l.name}function Gl(l){return l.size>Qs}function ql(l){return l.size<=Qs}function Hl(l){return l==null?"all":l.length===0?"self":"selected"}function Ql(l){const e=q.c(88),{form:s,currentAgentId:n}=l,i=Z(),{org:a}=Fe(),c=Kn(),[r,p]=Q.useState(!1);let o;e[0]!==s?(o=s.getValues("metadata.subAgents")??null,e[0]=s,e[1]=o):o=e[1];const f=o;let m;e[2]!==f?(m=()=>Hl(f),e[2]=f,e[3]=m):m=e[3];const[u,h]=Q.useState(m);let d;e[4]!==f?(d=f??[],e[4]=f,e[5]=d):d=e[5];const[x,g]=Q.useState(d);let v,y,j,b,S,N;if(e[6]!==c||e[7]!==n||e[8]!==s||e[9]!==u||e[10]!==a||e[11]!==x||e[12]!==i){let _;e[19]!==n||e[20]!==a?(_=X=>X.id!==n&&X.id!==a.id&&X.status==="active",e[19]=n,e[20]=a,e[21]=_):_=e[21],v=c.filter(_);let T;e[22]!==x?(T=X=>x.includes(X.id),e[22]=x,e[23]=T):T=e[23];const V=v.filter(T);let $;e[24]!==s?($=(X,de)=>s.setValue("metadata.subAgents",X==="all"?null:X==="self"?[]:de,{shouldDirty:!0}),e[24]=s,e[25]=$):$=e[25];const D=$;let A;e[26]!==D||e[27]!==x?(A=X=>{h(X),D(X,x)},e[26]=D,e[27]=x,e[28]=A):A=e[28];const P=A;let E;e[29]!==D||e[30]!==x?(E=X=>{const de=x.includes(X)?x.filter(ue=>ue!==X):[...x,X];g(de),D("selected",de)},e[29]=D,e[30]=x,e[31]=E):E=e[31],y=E,S="flex flex-col gap-3";let U;e[32]!==i?(U=i("virtualMcp.subAgentsSection.title"),e[32]=i,e[33]=U):U=e[33];let K;e[34]!==U?(K=t.jsx("h2",{className:"text-sm font-medium text-foreground",children:U}),e[34]=U,e[35]=K):K=e[35];let Y;e[36]!==u||e[37]!==i?(Y=u==="all"&&t.jsx("p",{className:"text-sm text-muted-foreground",children:i("virtualMcp.subAgentsSection.canDelegateToAnyAgent")}),e[36]=u,e[37]=i,e[38]=Y):Y=e[38];let B;e[39]!==u||e[40]!==i?(B=u==="self"&&t.jsx("p",{className:"text-sm text-muted-foreground",children:i("virtualMcp.subAgentsSection.canOnlyDelegateToItself")}),e[39]=u,e[40]=i,e[41]=B):B=e[41];let z;e[42]!==K||e[43]!==Y||e[44]!==B?(z=t.jsxs("div",{className:"flex flex-col gap-1",children:[K,Y,B]}),e[42]=K,e[43]=Y,e[44]=B,e[45]=z):z=e[45];const M=u==="selected"&&V.length>0&&t.jsxs(te,{variant:"outline",size:"sm",onClick:()=>p(!0),children:[t.jsx(Pe,{size:14}),i("virtualMcp.subAgentsSection.addSubAgent")]});let O;e[46]!==P?(O=X=>P(X),e[46]=P,e[47]=O):O=e[47];let G;e[48]===Symbol.for("react.memo_cache_sentinel")?(G=t.jsx(Oe,{size:"sm",className:"w-auto",children:t.jsx(Ie,{})}),e[48]=G):G=e[48];let R;e[49]!==i?(R=i("virtualMcp.subAgentsSection.anyAgent"),e[49]=i,e[50]=R):R=e[50];let F;e[51]!==R?(F=t.jsx(we,{value:"all",children:R}),e[51]=R,e[52]=F):F=e[52];let W;e[53]!==i?(W=i("virtualMcp.subAgentsSection.specificAgents"),e[53]=i,e[54]=W):W=e[54];let H;e[55]!==W?(H=t.jsx(we,{value:"selected",children:W}),e[55]=W,e[56]=H):H=e[56];let se;e[57]!==i?(se=i("virtualMcp.subAgentsSection.onlyItself"),e[57]=i,e[58]=se):se=e[58];let le;e[59]!==se?(le=t.jsx(we,{value:"self",children:se}),e[59]=se,e[60]=le):le=e[60];let ce;e[61]!==F||e[62]!==H||e[63]!==le?(ce=t.jsxs(Ae,{align:"end",children:[F,H,le]}),e[61]=F,e[62]=H,e[63]=le,e[64]=ce):ce=e[64];let ae;e[65]!==u||e[66]!==O||e[67]!==ce?(ae=t.jsxs($e,{value:u,onValueChange:O,children:[G,ce]}),e[65]=u,e[66]=O,e[67]=ce,e[68]=ae):ae=e[68];let ie;e[69]!==M||e[70]!==ae?(ie=t.jsxs("div",{className:"flex items-center gap-2",children:[M,ae]}),e[69]=M,e[70]=ae,e[71]=ie):ie=e[71],e[72]!==z||e[73]!==ie?(N=t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[z,ie]}),e[72]=z,e[73]=ie,e[74]=N):N=e[74],j="flex flex-col gap-2",b=u==="selected"&&(V.length>0?V.map(X=>t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 surface",children:[t.jsx(Ze,{icon:X.icon,name:X.title,size:"sm",className:"shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:X.title}),X.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:X.description})]}),t.jsx(te,{variant:"ghost",size:"icon",onClick:()=>y(X.id),children:t.jsx(At,{size:16})})]},X.id)):t.jsxs("button",{type:"button",onClick:()=>p(!0),className:"flex items-center gap-3 px-3 py-2.5 rounded-lg border border-dashed border-border hover:bg-accent transition-colors w-full text-left cursor-pointer",children:[t.jsx("div",{className:"flex items-center justify-center size-8 rounded-md text-muted-foreground/75 border border-dashed border-border shrink-0",children:t.jsx(Pe,{size:16})}),t.jsx("span",{className:"text-sm text-muted-foreground",children:i("virtualMcp.subAgentsSection.emptyStateMessage")})]})),e[6]=c,e[7]=n,e[8]=s,e[9]=u,e[10]=a,e[11]=x,e[12]=i,e[13]=v,e[14]=y,e[15]=j,e[16]=b,e[17]=S,e[18]=N}else v=e[13],y=e[14],j=e[15],b=e[16],S=e[17],N=e[18];let k;e[75]!==j||e[76]!==b?(k=t.jsx("div",{className:j,children:b}),e[75]=j,e[76]=b,e[77]=k):k=e[77];let w;e[78]!==v||e[79]!==y||e[80]!==r||e[81]!==x?(w=t.jsx(Xl,{open:r,onOpenChange:p,candidates:v,selectedIds:x,onToggle:y}),e[78]=v,e[79]=y,e[80]=r,e[81]=x,e[82]=w):w=e[82];let C;return e[83]!==S||e[84]!==N||e[85]!==k||e[86]!==w?(C=t.jsxs("section",{className:S,children:[N,k,w]}),e[83]=S,e[84]=N,e[85]=k,e[86]=w,e[87]=C):C=e[87],C}function Xl(l){const e=q.c(39),{open:s,onOpenChange:n,candidates:i,selectedIds:a,onToggle:c}=l,r=Z(),[p,o]=Q.useState("");let f,m,u,h,d,x,g,v,y;if(e[0]!==i||e[1]!==n||e[2]!==c||e[3]!==s||e[4]!==p||e[5]!==a||e[6]!==r){const N=p.toLowerCase(),k=i.filter(_=>_.title.toLowerCase().includes(N)||_.description?.toLowerCase().includes(N));m=Xe,v=s,y=n,f=Je,d="max-w-md";let w;e[16]!==r?(w=r("virtualMcp.subAgentsSection.title"),e[16]=r,e[17]=w):w=e[17],e[18]!==w?(x=t.jsx(lt,{children:t.jsx(at,{children:w})}),e[18]=w,e[19]=x):x=e[19];let C;e[20]!==r?(C=r("virtualMcp.subAgentsSection.searchPlaceholder"),e[20]=r,e[21]=C):C=e[21],e[22]!==p||e[23]!==C?(g=t.jsx(wi,{value:p,onChange:o,placeholder:C,className:"w-full"}),e[22]=p,e[23]=C,e[24]=g):g=e[24],u="flex flex-col gap-1 max-h-80 overflow-y-auto",h=k.length===0?t.jsx("p",{className:"text-sm text-muted-foreground px-1 py-4 text-center",children:r("virtualMcp.subAgentsSection.noAgentsFound")}):k.map(_=>t.jsxs("button",{type:"button",onClick:()=>c(_.id),className:"flex items-center gap-3 px-2 py-2 rounded-lg hover:bg-accent transition-colors cursor-pointer w-full text-left",children:[t.jsx(Is,{checked:a.includes(_.id),className:"pointer-events-none",tabIndex:-1}),t.jsx(Ze,{icon:_.icon,name:_.title,size:"sm",className:"shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:_.title}),_.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:_.description})]})]},_.id)),e[0]=i,e[1]=n,e[2]=c,e[3]=s,e[4]=p,e[5]=a,e[6]=r,e[7]=f,e[8]=m,e[9]=u,e[10]=h,e[11]=d,e[12]=x,e[13]=g,e[14]=v,e[15]=y}else f=e[7],m=e[8],u=e[9],h=e[10],d=e[11],x=e[12],g=e[13],v=e[14],y=e[15];let j;e[25]!==u||e[26]!==h?(j=t.jsx("div",{className:u,children:h}),e[25]=u,e[26]=h,e[27]=j):j=e[27];let b;e[28]!==f||e[29]!==d||e[30]!==x||e[31]!==g||e[32]!==j?(b=t.jsxs(f,{className:d,children:[x,g,j]}),e[28]=f,e[29]=d,e[30]=x,e[31]=g,e[32]=j,e[33]=b):b=e[33];let S;return e[34]!==m||e[35]!==v||e[36]!==y||e[37]!==b?(S=t.jsx(m,{open:v,onOpenChange:y,children:b}),e[34]=m,e[35]=v,e[36]=y,e[37]=b,e[38]=S):S=e[38],S}function st(){const l=q.c(1);let e;return l[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"flex items-center justify-center h-32",children:t.jsx(it,{className:"size-6 text-muted-foreground"})}),l[0]=e):e=l[0],e}function ct(l,e){return({error:s})=>s?.message?.includes("Method not found")||s?.code===-32601?t.jsx("div",{className:"flex-1 overflow-auto px-4 py-3 space-y-1",children:t.jsx("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:l})}):t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center h-full p-6 text-center space-y-4",children:[t.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:t.jsx(ys,{className:"h-6 w-6 text-destructive"})}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("h3",{className:"text-lg font-medium",children:e("virtualMcp.dependencySelectionDialog.somethingWentWrong")}),t.jsx("p",{className:"text-sm text-muted-foreground max-w-xs mx-auto",children:s?.message?s.message.length>200?`${s.message.slice(0,200)}...`:s.message:e("virtualMcp.dependencySelectionDialog.unexpectedError")})]})]})}function Xs(l){const e=q.c(23),{item:s,isSelected:n,onToggle:i,disabled:a}=l,c=a?"cursor-not-allowed opacity-50":"cursor-pointer",r=n?"bg-accent/25":"hover:bg-accent";let p;e[0]!==c||e[1]!==r?(p=ve("flex items-start gap-3 p-4 rounded-lg transition-colors",c,r),e[0]=c,e[1]=r,e[2]=p):p=e[2];let o;e[3]!==s.name?(o=t.jsx("p",{className:"text-sm font-medium leading-none truncate",children:s.name}),e[3]=s.name,e[4]=o):o=e[4];let f;e[5]!==s.tags?(f=s.tags&&t.jsx("span",{className:"shrink-0",children:s.tags}),e[5]=s.tags,e[6]=f):f=e[6];let m;e[7]!==o||e[8]!==f?(m=t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[o,f]}),e[7]=o,e[8]=f,e[9]=m):m=e[9];let u;e[10]!==s.description?(u=s.description&&t.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:s.description}),e[10]=s.description,e[11]=u):u=e[11];let h;e[12]!==m||e[13]!==u?(h=t.jsxs("div",{className:"flex-1 min-w-0 space-y-2",children:[m,u]}),e[12]=m,e[13]=u,e[14]=h):h=e[14];let d;e[15]!==a||e[16]!==n||e[17]!==i?(d=t.jsx(Is,{checked:n,onCheckedChange:i,disabled:a,className:"mt-0.5"}),e[15]=a,e[16]=n,e[17]=i,e[18]=d):d=e[18];let x;return e[19]!==p||e[20]!==h||e[21]!==d?(x=t.jsxs("label",{className:p,children:[h,d]}),e[19]=p,e[20]=h,e[21]=d,e[22]=x):x=e[22],x}function Jl(l){const e=q.c(35),{activeTab:s,onTabChange:n,showSelectAll:i,isAllSelected:a,handleSelectAll:c}=l,r=Z();let p;e[0]!==r?(p=r("virtualMcp.dependencySelectionDialog.tabTools"),e[0]=r,e[1]=p):p=e[1];let o;e[2]!==p?(o={id:"tools",label:p},e[2]=p,e[3]=o):o=e[3];let f;e[4]!==r?(f=r("virtualMcp.dependencySelectionDialog.tabActive"),e[4]=r,e[5]=f):f=e[5];let m;e[6]!==f?(m={id:"active",label:f},e[6]=f,e[7]=m):m=e[7];let u;e[8]!==r?(u=r("virtualMcp.dependencySelectionDialog.tabResources"),e[8]=r,e[9]=u):u=e[9];let h;e[10]!==u?(h={id:"resources",label:u},e[10]=u,e[11]=h):h=e[11];let d;e[12]!==r?(d=r("virtualMcp.dependencySelectionDialog.tabPrompts"),e[12]=r,e[13]=d):d=e[13];let x;e[14]!==d?(x={id:"prompts",label:d},e[14]=d,e[15]=x):x=e[15];let g;e[16]!==o||e[17]!==m||e[18]!==h||e[19]!==x?(g=[o,m,h,x],e[16]=o,e[17]=m,e[18]=h,e[19]=x,e[20]=g):g=e[20];let v;e[21]!==n?(v=S=>n(S),e[21]=n,e[22]=v):v=e[22];let y;e[23]!==s||e[24]!==v||e[25]!==g?(y=t.jsx(Si,{tabs:g,activeTab:s,onTabChange:v}),e[23]=s,e[24]=v,e[25]=g,e[26]=y):y=e[26];let j;e[27]!==c||e[28]!==a||e[29]!==i||e[30]!==r?(j=i&&t.jsx("button",{type:"button",onClick:c,className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:r(a?"virtualMcp.dependencySelectionDialog.deselectAll":"virtualMcp.dependencySelectionDialog.selectAll")}),e[27]=c,e[28]=a,e[29]=i,e[30]=r,e[31]=j):j=e[31];let b;return e[32]!==y||e[33]!==j?(b=t.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-t border-border shrink-0",children:[y,j]}),e[32]=y,e[33]=j,e[34]=b):b=e[34],b}function Ft(l){const e=q.c(13),{items:s,selections:n,onToggle:i,emptyMessage:a,disabled:c}=l;let r,p,o;if(e[0]!==c||e[1]!==a||e[2]!==s||e[3]!==i||e[4]!==n){o=Symbol.for("react.early_return_sentinel");e:{const m=s.map(Zl);if(s.length===0){let u;e[8]!==a?(u=t.jsx("div",{className:"flex-1 overflow-auto px-4 py-3 space-y-1",children:t.jsx("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:a})}),e[8]=a,e[9]=u):u=e[9],o=u;break e}r="flex-1 overflow-auto px-4 py-3 space-y-1",p=s.map(u=>t.jsx(Xs,{item:u,isSelected:n===null||n?.includes(u.id),onToggle:()=>i(u.id,m),disabled:c},u.id))}e[0]=c,e[1]=a,e[2]=s,e[3]=i,e[4]=n,e[5]=r,e[6]=p,e[7]=o}else r=e[5],p=e[6],o=e[7];if(o!==Symbol.for("react.early_return_sentinel"))return o;let f;return e[10]!==r||e[11]!==p?(f=t.jsx("div",{className:r,children:p}),e[10]=r,e[11]=p,e[12]=f):f=e[12],f}function Zl(l){return l.id}function ea(l){const e=q.c(22),{connectionId:s,toolSelections:n,onToggleTool:i}=l,a=Z(),{org:c}=Fe();let r;e[0]!==s||e[1]!==c.id||e[2]!==c.slug?(r={connectionId:s,orgId:c.id,orgSlug:c.slug},e[0]=s,e[1]=c.id,e[2]=c.slug,e[3]=r):r=e[3];const p=pt(r);let o;e[4]!==p?(o={client:p},e[4]=p,e[5]=o):o=e[5];const{data:f}=Fs(o),m=f.tools;let u,h,d;if(e[6]!==f.tools||e[7]!==i||e[8]!==a||e[9]!==n){d=Symbol.for("react.early_return_sentinel");e:{const g=m.map(sa);let v;e[13]!==n?(v=b=>n===null||n.includes(b.name),e[13]=n,e[14]=v):v=e[14];const j=f.tools.filter(v).map(ta);if(j.length===0){let b;e[15]!==a?(b=a("virtualMcp.dependencySelectionDialog.noActiveToolsSelected"),e[15]=a,e[16]=b):b=e[16];let S;e[17]!==b?(S=t.jsx("div",{className:"flex-1 overflow-auto px-4 py-3 space-y-1",children:t.jsx("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:b})}),e[17]=b,e[18]=S):S=e[18],d=S;break e}u="flex-1 overflow-auto px-4 py-3 space-y-1",h=j.map(b=>t.jsx(Xs,{item:b,isSelected:!0,onToggle:()=>i(b.id,g)},b.id))}e[6]=f.tools,e[7]=i,e[8]=a,e[9]=n,e[10]=u,e[11]=h,e[12]=d}else u=e[10],h=e[11],d=e[12];if(d!==Symbol.for("react.early_return_sentinel"))return d;let x;return e[19]!==u||e[20]!==h?(x=t.jsx("div",{className:u,children:h}),e[19]=u,e[20]=h,e[21]=x):x=e[21],x}function ta(l){return{id:l.name,name:l.name,description:l.description,tags:t.jsx(As,{annotations:l.annotations,_meta:l._meta})}}function sa(l){return l.name}function na(l){const e=q.c(16),{connectionId:s,selections:n,onToggle:i,disabled:a}=l,{org:c}=Fe();let r;e[0]!==s||e[1]!==c.id||e[2]!==c.slug?(r={connectionId:s,orgId:c.id,orgSlug:c.slug},e[0]=s,e[1]=c.id,e[2]=c.slug,e[3]=r):r=e[3];const p=pt(r);let o;e[4]!==p?(o={client:p},e[4]=p,e[5]=o):o=e[5];const{data:f}=Fs(o);let m;e[6]!==f.tools?(m=f.tools.map(ia),e[6]=f.tools,e[7]=m):m=e[7];const u=m,h=Z();let d;e[8]!==h?(d=h("virtualMcp.dependencySelectionDialog.noToolsAvailable"),e[8]=h,e[9]=d):d=e[9];let x;return e[10]!==a||e[11]!==u||e[12]!==i||e[13]!==n||e[14]!==d?(x=t.jsx(Ft,{items:u,selections:n,onToggle:i,emptyMessage:d,disabled:a}),e[10]=a,e[11]=u,e[12]=i,e[13]=n,e[14]=d,e[15]=x):x=e[15],x}function ia(l){return{id:l.name,name:l.name,description:l.description,tags:t.jsx(As,{annotations:l.annotations,_meta:l._meta})}}function la(l){const e=q.c(16),{connectionId:s,selections:n,onToggle:i,disabled:a}=l,{org:c}=Fe();let r;e[0]!==s||e[1]!==c.id||e[2]!==c.slug?(r={connectionId:s,orgId:c.id,orgSlug:c.slug},e[0]=s,e[1]=c.id,e[2]=c.slug,e[3]=r):r=e[3];const p=pt(r);let o;e[4]!==p?(o={client:p},e[4]=p,e[5]=o):o=e[5];const{data:f}=an(o);let m;e[6]!==f.resources?(m=f.resources.map(aa),e[6]=f.resources,e[7]=m):m=e[7];const u=m,h=Z();let d;e[8]!==h?(d=h("virtualMcp.dependencySelectionDialog.noResourcesAvailable"),e[8]=h,e[9]=d):d=e[9];let x;return e[10]!==a||e[11]!==u||e[12]!==i||e[13]!==n||e[14]!==d?(x=t.jsx(Ft,{items:u,selections:n,onToggle:i,emptyMessage:d,disabled:a}),e[10]=a,e[11]=u,e[12]=i,e[13]=n,e[14]=d,e[15]=x):x=e[15],x}function aa(l){return{id:l.name||l.uri,name:l.name||l.uri,description:l.description}}function ra(l){const e=q.c(16),{connectionId:s,selections:n,onToggle:i,disabled:a}=l,{org:c}=Fe();let r;e[0]!==s||e[1]!==c.id||e[2]!==c.slug?(r={connectionId:s,orgId:c.id,orgSlug:c.slug},e[0]=s,e[1]=c.id,e[2]=c.slug,e[3]=r):r=e[3];const p=pt(r);let o;e[4]!==p?(o={client:p},e[4]=p,e[5]=o):o=e[5];const{data:f}=Ni(o);let m;e[6]!==f.prompts?(m=f.prompts.map(oa),e[6]=f.prompts,e[7]=m):m=e[7];const u=m,h=Z();let d;e[8]!==h?(d=h("virtualMcp.dependencySelectionDialog.noPromptsAvailable"),e[8]=h,e[9]=d):d=e[9];let x;return e[10]!==a||e[11]!==u||e[12]!==i||e[13]!==n||e[14]!==d?(x=t.jsx(Ft,{items:u,selections:n,onToggle:i,emptyMessage:d,disabled:a}),e[10]=a,e[11]=u,e[12]=i,e[13]=n,e[14]=d,e[15]=x):x=e[15],x}function oa(l){return{id:l.name,name:l.name,description:l.description}}function ca(l){const e=q.c(58),{currentConnection:s,activeTab:n,selectedId:i,formData:a,toggleTool:c,toggleResource:r,togglePrompt:p,toggleAllTools:o,toggleAllResources:f,toggleAllPrompts:m,onTabChange:u}=l,h=Z(),d=a[i],x=n==="tools"?d?.tools===null:n==="resources"?d?.resources===null:n==="prompts"?d?.prompts===null:!1,g=n!=="active";let v;e[0]!==n||e[1]!==i||e[2]!==m||e[3]!==f||e[4]!==o?(v=()=>{n==="tools"?o(i):n==="resources"?f(i):n==="prompts"&&m(i)},e[0]=n,e[1]=i,e[2]=m,e[3]=f,e[4]=o,e[5]=v):v=e[5];const y=v;let j;e[6]!==s.icon||e[7]!==s.title?(j=t.jsx(Ze,{icon:s.icon,name:s.title,size:"sm",className:"shrink-0"}),e[6]=s.icon,e[7]=s.title,e[8]=j):j=e[8];let b;e[9]!==s.title?(b=t.jsx("h2",{className:"text-base font-semibold truncate",children:s.title}),e[9]=s.title,e[10]=b):b=e[10];let S;e[11]!==s.description?(S=s.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s.description}),e[11]=s.description,e[12]=S):S=e[12];let N;e[13]!==b||e[14]!==S?(N=t.jsxs("div",{className:"flex-1 min-w-0",children:[b,S]}),e[13]=b,e[14]=S,e[15]=N):N=e[15];let k;e[16]!==j||e[17]!==N?(k=t.jsx("div",{className:"px-6 pt-5 pb-4 shrink-0",children:t.jsxs("div",{className:"flex items-center gap-3",children:[j,N]})}),e[16]=j,e[17]=N,e[18]=k):k=e[18];let w;e[19]!==n||e[20]!==y||e[21]!==x||e[22]!==u||e[23]!==g?(w=t.jsx(Jl,{activeTab:n,onTabChange:u,showSelectAll:g,isAllSelected:x,handleSelectAll:y}),e[19]=n,e[20]=y,e[21]=x,e[22]=u,e[23]=g,e[24]=w):w=e[24];let C;e[25]!==n||e[26]!==a||e[27]!==i||e[28]!==h||e[29]!==c?(C=n==="active"&&t.jsx(Ye,{fallback:ct(h("virtualMcp.dependencySelectionDialog.toolsNotSupported"),h),children:t.jsx(Q.Suspense,{fallback:t.jsx(st,{}),children:t.jsx(ea,{connectionId:i,toolSelections:a[i]?a[i].tools:[],onToggleTool:(A,P)=>c(i,A,P)})})}),e[25]=n,e[26]=a,e[27]=i,e[28]=h,e[29]=c,e[30]=C):C=e[30];let _;e[31]!==n||e[32]!==a||e[33]!==i||e[34]!==h||e[35]!==c?(_=n==="tools"&&t.jsx(Ye,{fallback:ct(h("virtualMcp.dependencySelectionDialog.toolsNotSupported"),h),children:t.jsx(Q.Suspense,{fallback:t.jsx(st,{}),children:t.jsx(na,{connectionId:i,selections:a[i]?a[i].tools:[],onToggle:(A,P)=>c(i,A,P)})})}),e[31]=n,e[32]=a,e[33]=i,e[34]=h,e[35]=c,e[36]=_):_=e[36];let T;e[37]!==n||e[38]!==a||e[39]!==i||e[40]!==h||e[41]!==r?(T=n==="resources"&&t.jsx(Ye,{fallback:ct(h("virtualMcp.dependencySelectionDialog.resourcesNotSupported"),h),children:t.jsx(Q.Suspense,{fallback:t.jsx(st,{}),children:t.jsx(la,{connectionId:i,selections:a[i]?a[i].resources:[],onToggle:(A,P)=>r(i,A,P)})})}),e[37]=n,e[38]=a,e[39]=i,e[40]=h,e[41]=r,e[42]=T):T=e[42];let V;e[43]!==n||e[44]!==a||e[45]!==i||e[46]!==h||e[47]!==p?(V=n==="prompts"&&t.jsx(Ye,{fallback:ct(h("virtualMcp.dependencySelectionDialog.promptsNotSupported"),h),children:t.jsx(Q.Suspense,{fallback:t.jsx(st,{}),children:t.jsx(ra,{connectionId:i,selections:a[i]?a[i].prompts:[],onToggle:(A,P)=>p(i,A,P)})})}),e[43]=n,e[44]=a,e[45]=i,e[46]=h,e[47]=p,e[48]=V):V=e[48];let $;e[49]!==T||e[50]!==V||e[51]!==C||e[52]!==_?($=t.jsxs("div",{className:"flex-1 overflow-hidden flex flex-col",children:[C,_,T,V]}),e[49]=T,e[50]=V,e[51]=C,e[52]=_,e[53]=$):$=e[53];let D;return e[54]!==$||e[55]!==k||e[56]!==w?(D=t.jsxs(t.Fragment,{children:[k,w,$]}),e[54]=$,e[55]=k,e[56]=w,e[57]=D):D=e[57],D}function da(l){const e=q.c(7),{onClose:s}=l,n=Z();let i;e[0]!==s?(i=()=>s(!1),e[0]=s,e[1]=i):i=e[1];let a;e[2]!==n?(a=n("virtualMcp.dependencySelectionDialog.done"),e[2]=n,e[3]=a):a=e[3];let c;return e[4]!==i||e[5]!==a?(c=t.jsx(Vt,{className:"px-6 py-4 border-t border-border shrink-0",children:t.jsx(te,{variant:"outline",onClick:i,children:a})}),e[4]=i,e[5]=a,e[6]=c):c=e[6],c}function ua(l){const e=q.c(23),{connectionId:s,onAuthenticate:n,children:i}=l,a=Z();let c;e[0]!==s?(c={connectionId:s},e[0]=s,e[1]=c):c=e[1];const r=$s(c);if(r.supportsOAuth&&!r.isAuthenticated){let f;e[2]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx("div",{className:"flex items-center justify-center size-12 rounded-full bg-muted",children:t.jsx(Xn,{size:22,className:"text-muted-foreground"})}),e[2]=f):f=e[2];let m;e[3]!==a?(m=a("virtualMcp.dependencySelectionDialog.authorizationRequired"),e[3]=a,e[4]=m):m=e[4];let u;e[5]!==m?(u=t.jsx("p",{className:"text-sm font-medium",children:m}),e[5]=m,e[6]=u):u=e[6];let h;e[7]!==a?(h=a("virtualMcp.dependencySelectionDialog.authorizationDescription"),e[7]=a,e[8]=h):h=e[8];let d;e[9]!==h?(d=t.jsx("p",{className:"text-xs text-muted-foreground max-w-xs",children:h}),e[9]=h,e[10]=d):d=e[10];let x;e[11]!==u||e[12]!==d?(x=t.jsxs("div",{className:"space-y-1",children:[u,d]}),e[11]=u,e[12]=d,e[13]=x):x=e[13];let g;e[14]!==s||e[15]!==n||e[16]!==a?(g=n&&t.jsx(te,{variant:"outline",size:"sm",onClick:()=>n(s),children:a("virtualMcp.dependencySelectionDialog.authorize")}),e[14]=s,e[15]=n,e[16]=a,e[17]=g):g=e[17];let v;return e[18]!==x||e[19]!==g?(v=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-4 p-8 text-center",children:[f,x,g]}),e[18]=x,e[19]=g,e[20]=v):v=e[20],v}let o;return e[21]!==i?(o=t.jsx(t.Fragment,{children:i}),e[21]=i,e[22]=o):o=e[22],o}function ma(l){const e={};for(const s of l)e[s.connection_id]={tools:s.selected_tools,resources:s.selected_resources??null,prompts:s.selected_prompts??null};return e}function cs(l){return Object.entries(l).map(([e,s])=>({connection_id:e,selected_tools:s.tools,selected_resources:s.resources,selected_prompts:s.prompts}))}function ds(l,e,s,n){const i=l[e]??{tools:null,resources:null,prompts:null};return{...l,[e]:{...i,[s]:n}}}function fa(l,e){return e.type==="SET_ACTIVE_TAB"?{...l,activeTab:e.payload}:l}function pa(l){const e=q.c(49),{open:s,onOpenChange:n,selectedId:i,form:a,connections:c,onAuthenticate:r}=l;let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p={activeTab:"tools"},e[0]=p):p=e[0];const[o,f]=Q.useReducer(fa,p),m=Ot(i??"");let u;e[1]!==c?(u=c??[],e[1]=c,e[2]=u):u=e[2];let h;e[3]!==u?(h=ma(u),e[3]=u,e[4]=h):h=e[4];const d=h;let x;e[5]!==a||e[6]!==d?(x=(z,M,O,G)=>{const R=d[z]?.[M];let F;R===null?F=G.filter(W=>W!==O):R?.includes(O)?F=R.filter(W=>W!==O):(F=[...R??[],O],F.length===G.length&&(F=null)),a.setValue("connections",cs(ds(d,z,M,F)),{shouldDirty:!0,shouldTouch:!0})},e[5]=a,e[6]=d,e[7]=x):x=e[7];const g=x;let v;e[8]!==a||e[9]!==d?(v=(z,M)=>{const G=d[z]?.[M]===null?[]:null;a.setValue("connections",cs(ds(d,z,M,G)),{shouldDirty:!0,shouldTouch:!0})},e[8]=a,e[9]=d,e[10]=v):v=e[10];const y=v;let j;e[11]!==g?(j=(z,M,O)=>g(z,"tools",M,O),e[11]=g,e[12]=j):j=e[12];const b=j;let S;e[13]!==g?(S=(z,M,O)=>g(z,"resources",M,O),e[13]=g,e[14]=S):S=e[14];const N=S;let k;e[15]!==g?(k=(z,M,O)=>g(z,"prompts",M,O),e[15]=g,e[16]=k):k=e[16];const w=k;let C;e[17]!==y?(C=z=>y(z,"tools"),e[17]=y,e[18]=C):C=e[18];const _=C;let T;e[19]!==y?(T=z=>y(z,"resources"),e[19]=y,e[20]=T):T=e[20];const V=T;let $;e[21]!==y?($=z=>y(z,"prompts"),e[21]=y,e[22]=$):$=e[22];const D=$;if(!i||!m)return null;let A;e[23]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(st,{}),e[23]=A):A=e[23];let P;e[24]===Symbol.for("react.memo_cache_sentinel")?(P=z=>f({type:"SET_ACTIVE_TAB",payload:z}),e[24]=P):P=e[24];let E;e[25]!==m||e[26]!==o.activeTab||e[27]!==d||e[28]!==i||e[29]!==D||e[30]!==V||e[31]!==_||e[32]!==w||e[33]!==N||e[34]!==b?(E=t.jsx(ca,{currentConnection:m,activeTab:o.activeTab,selectedId:i,formData:d,toggleTool:b,toggleResource:N,togglePrompt:w,toggleAllTools:_,toggleAllResources:V,toggleAllPrompts:D,onTabChange:P},i),e[25]=m,e[26]=o.activeTab,e[27]=d,e[28]=i,e[29]=D,e[30]=V,e[31]=_,e[32]=w,e[33]=N,e[34]=b,e[35]=E):E=e[35];let U;e[36]!==r||e[37]!==i||e[38]!==E?(U=t.jsx(Q.Suspense,{fallback:A,children:t.jsx(ua,{connectionId:i,onAuthenticate:r,children:E})}),e[36]=r,e[37]=i,e[38]=E,e[39]=U):U=e[39];let K;e[40]!==n?(K=t.jsx(da,{onClose:n}),e[40]=n,e[41]=K):K=e[41];let Y;e[42]!==U||e[43]!==K?(Y=t.jsxs(Je,{className:"sm:max-w-2xl h-[75vh] max-h-[75vh] flex flex-col p-0 gap-0 overflow-hidden w-[95vw]",children:[U,K]}),e[42]=U,e[43]=K,e[44]=Y):Y=e[44];let B;return e[45]!==n||e[46]!==s||e[47]!==Y?(B=t.jsx(Xe,{open:s,onOpenChange:n,children:Y}),e[45]=n,e[46]=s,e[47]=Y,e[48]=B):B=e[48],B}const us="__new_instance__";function ha(l){const e=q.c(25),{connection_id:s,usedConnectionIds:n,onOpenSettings:i,onRemove:a,onAuthenticate:c,onSwitchInstance:r,onNewInstance:p}=l,o=Ot(s),{org:f}=Fe();if(!o){let g;return e[0]!==a?(g=t.jsx(ba,{onRemove:a}),e[0]=a,e[1]=g):g=e[1],g}let m;e[2]!==o?(m=Ci(o),e[2]=o,e[3]=m):m=e[3];const u=m;let h;e[4]!==s?(h=t.jsx(va,{connection_id:s}),e[4]=s,e[5]=h):h=e[5];let d;e[6]!==o.app_name||e[7]!==o.connection_type||e[8]!==o.description||e[9]!==o.icon||e[10]!==o.status||e[11]!==o.title||e[12]!==s||e[13]!==c||e[14]!==p||e[15]!==i||e[16]!==a||e[17]!==r||e[18]!==f.slug||e[19]!==u||e[20]!==n?(d=t.jsx(ga,{connection_id:s,connectionTitle:o.title,connectionDescription:o.description,connectionIcon:o.icon,connectionType:o.connection_type,connectionStatus:o.status,slug:u,orgSlug:f.slug,appName:o.app_name,usedConnectionIds:n,onOpenSettings:i,onRemove:a,onAuthenticate:c,onSwitchInstance:r,onNewInstance:p}),e[6]=o.app_name,e[7]=o.connection_type,e[8]=o.description,e[9]=o.icon,e[10]=o.status,e[11]=o.title,e[12]=s,e[13]=c,e[14]=p,e[15]=i,e[16]=a,e[17]=r,e[18]=f.slug,e[19]=u,e[20]=n,e[21]=d):d=e[21];let x;return e[22]!==h||e[23]!==d?(x=t.jsx(Q.Suspense,{fallback:h,children:d}),e[22]=h,e[23]=d,e[24]=x):x=e[24],x}function xa(l){const e=q.c(24),{appName:s,connectionId:n,usedConnectionIds:i,onSwitchInstance:a,onNewInstance:c}=l,r=Z();let p;e[0]!==s?(p={filters:[{column:"app_name",value:s}]},e[0]=s,e[1]=p):p=e[1];const o=Wn(p);if(o.length<=1&&!c)return null;let f;e[2]!==n||e[3]!==c||e[4]!==a?(f=g=>{g===us?c?.():a(n,g)},e[2]=n,e[3]=c,e[4]=a,e[5]=f):f=e[5];let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(Oe,{size:"xs",className:"w-auto gap-1 shadow-none",children:t.jsx(Ie,{})}),e[6]=m):m=e[6];let u;if(e[7]!==n||e[8]!==o||e[9]!==i){let g;e[11]!==n||e[12]!==i?(g=v=>t.jsx(we,{value:v.id,className:"text-xs",disabled:v.id!==n&&i.has(v.id),children:v.title},v.id),e[11]=n,e[12]=i,e[13]=g):g=e[13],u=o.map(g),e[7]=n,e[8]=o,e[9]=i,e[10]=u}else u=e[10];let h;e[14]!==c||e[15]!==r?(h=c&&t.jsxs(we,{value:us,className:"text-xs text-muted-foreground",children:["+ ",r("virtualMcp.connectionItem.newInstance")]}),e[14]=c,e[15]=r,e[16]=h):h=e[16];let d;e[17]!==u||e[18]!==h?(d=t.jsxs(Ae,{children:[u,h]}),e[17]=u,e[18]=h,e[19]=d):d=e[19];let x;return e[20]!==n||e[21]!==f||e[22]!==d?(x=t.jsxs($e,{value:n,onValueChange:f,children:[m,d]}),e[20]=n,e[21]=f,e[22]=d,e[23]=x):x=e[23],x}function ga({connection_id:l,connectionTitle:e,connectionDescription:s,connectionIcon:n,connectionType:i,connectionStatus:a,slug:c,orgSlug:r,appName:p,usedConnectionIds:o,onOpenSettings:f,onRemove:m,onAuthenticate:u,onSwitchInstance:h,onNewInstance:d}){const x=$s({connectionId:l}),g=Ms(),y=!(i==="VIRTUAL")&&x.supportsOAuth&&!x.isAuthenticated,j=a!=="active",b=Z(),S=async N=>{try{await g.update.mutateAsync({id:l,data:{status:N}}),oe.success(b(N==="active"?"virtualMcp.connectionItem.connectionEnabled":"virtualMcp.connectionItem.connectionDisabled"))}catch{oe.error(b("virtualMcp.connectionItem.failedToUpdateConnection"))}};return t.jsxs("div",{className:ve("surface overflow-hidden transition-colors",(y||j)&&"shadow-edge-destructive bg-destructive/5"),children:[t.jsxs(ws,{to:"/$org/settings/connections/$appSlug",params:{org:r,appSlug:c},className:"flex items-center gap-3 px-4 py-3 cursor-pointer hover:bg-accent transition-colors",children:[t.jsx(Ze,{icon:n,name:e,size:"sm",className:"shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:e}),y?t.jsx("span",{className:"text-xs text-destructive font-medium",children:b("virtualMcp.connectionItem.needsAuthorization")}):j?t.jsx("span",{className:"text-xs text-destructive font-medium",children:b(a==="error"?"virtualMcp.connectionItem.disabledError":"virtualMcp.connectionItem.disabled")}):s&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s})]}),y?t.jsx(te,{variant:"outline",size:"sm",className:"shrink-0",onClick:N=>{N.preventDefault(),N.stopPropagation(),u(l)},children:b("virtualMcp.connectionItem.authorize")}):j?t.jsxs(te,{variant:"outline",size:"sm",className:"gap-1.5 shrink-0",onClick:N=>{N.preventDefault(),N.stopPropagation(),S("active")},children:[t.jsx(Jn,{size:13}),b("virtualMcp.connectionItem.enable")]}):t.jsxs(Se,{delayDuration:0,children:[t.jsx(Ne,{asChild:!0,children:t.jsx("span",{className:"inline-flex items-center justify-center rounded-md h-7 w-7 hover:bg-accent text-muted-foreground shrink-0 transition-colors",children:t.jsx(xi,{size:16})})}),t.jsx(Ce,{side:"bottom",children:b("virtualMcp.connectionItem.connectionSettings")})]})]}),t.jsxs("div",{className:"flex items-center gap-3 px-4 py-2 border-t border-border bg-muted/25",children:[p&&t.jsx(xa,{appName:p,connectionId:l,usedConnectionIds:o,onSwitchInstance:h,onNewInstance:d}),t.jsxs("div",{className:"flex items-center gap-0.5 ml-auto",children:[t.jsxs(Se,{delayDuration:0,children:[t.jsx(Ne,{asChild:!0,children:t.jsx(te,{variant:"ghost",size:"icon-sm",onClick:f,"aria-label":b("virtualMcp.connectionItem.configureResources"),children:t.jsx(Zn,{size:13})})}),t.jsx(Ce,{side:"bottom",children:b("virtualMcp.connectionItem.configureResources")})]}),!j&&t.jsxs(Se,{delayDuration:0,children:[t.jsx(Ne,{asChild:!0,children:t.jsx(te,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground",onClick:()=>S("inactive"),"aria-label":b("virtualMcp.connectionItem.disableConnection"),children:t.jsx(ei,{size:13})})}),t.jsx(Ce,{side:"bottom",children:b("virtualMcp.connectionItem.disable")})]}),t.jsxs(Se,{delayDuration:0,children:[t.jsx(Ne,{asChild:!0,children:t.jsx(te,{variant:"ghost-destructive",size:"icon-sm",onClick:m,"aria-label":b("virtualMcp.connectionItem.removeConnection"),children:t.jsx(At,{size:13})})}),t.jsx(Ce,{side:"bottom",children:b("virtualMcp.connectionItem.remove")})]})]})]})]})}function va(l){const e=q.c(17),{connection_id:s}=l,n=Ot(s);if(!n){let m;return e[0]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(Js,{}),e[0]=m):m=e[0],m}let i;e[1]!==n.icon||e[2]!==n.title?(i=t.jsx(Ze,{icon:n.icon,name:n.title,size:"sm",className:"shrink-0"}),e[1]=n.icon,e[2]=n.title,e[3]=i):i=e[3];let a;e[4]!==n.title?(a=t.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[4]=n.title,e[5]=a):a=e[5];let c;e[6]!==n.description?(c=n.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:n.description}),e[6]=n.description,e[7]=c):c=e[7];let r;e[8]!==a||e[9]!==c?(r=t.jsxs("div",{className:"flex-1 min-w-0",children:[a,c]}),e[8]=a,e[9]=c,e[10]=r):r=e[10];let p;e[11]!==i||e[12]!==r?(p=t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",children:[i,r]}),e[11]=i,e[12]=r,e[13]=p):p=e[13];let o;e[14]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("div",{className:"flex items-center px-4 py-2 border-t border-border bg-muted/25",children:t.jsx("div",{className:"h-5 w-20 rounded bg-muted animate-pulse"})}),e[14]=o):o=e[14];let f;return e[15]!==p?(f=t.jsxs("div",{className:"surface overflow-hidden",children:[p,o]}),e[15]=p,e[16]=f):f=e[16],f}function ba(l){const e=q.c(20),{onRemove:s}=l,n=Z();let i;e[0]!==n?(i=n("virtualMcp.connectionItem.connectionNotFound"),e[0]=n,e[1]=i):i=e[1];let a;e[2]!==i?(a=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm text-destructive font-medium truncate",children:i})}),e[2]=i,e[3]=a):a=e[3];let c;e[4]!==n?(c=n("virtualMcp.connectionItem.removeConnection"),e[4]=n,e[5]=c):c=e[5];let r;e[6]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(At,{size:13}),e[6]=r):r=e[6];let p;e[7]!==s||e[8]!==c?(p=t.jsx(Ne,{asChild:!0,children:t.jsx(te,{variant:"ghost-destructive",size:"icon-sm",className:"shrink-0",onClick:s,"aria-label":c,children:r})}),e[7]=s,e[8]=c,e[9]=p):p=e[9];let o;e[10]!==n?(o=n("virtualMcp.connectionItem.remove"),e[10]=n,e[11]=o):o=e[11];let f;e[12]!==o?(f=t.jsx(Ce,{side:"bottom",children:o}),e[12]=o,e[13]=f):f=e[13];let m;e[14]!==p||e[15]!==f?(m=t.jsxs(Se,{delayDuration:0,children:[p,f]}),e[14]=p,e[15]=f,e[16]=m):m=e[16];let u;return e[17]!==a||e[18]!==m?(u=t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 rounded-xl border border-destructive/50 bg-destructive/5",children:[a,m]}),e[17]=a,e[18]=m,e[19]=u):u=e[19],u}function Js(){const l=q.c(3);let e;l[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"size-8 rounded-md bg-muted animate-pulse shrink-0"}),l[0]=e):e=l[0];let s;l[1]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",children:[e,t.jsxs("div",{className:"flex-1 space-y-1.5",children:[t.jsx("div",{className:"h-4 w-32 rounded bg-muted animate-pulse"}),t.jsx("div",{className:"h-3 w-48 rounded bg-muted animate-pulse"})]})]}),l[1]=s):s=l[1];let n;return l[2]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsxs("div",{className:"surface overflow-hidden",children:[s,t.jsx("div",{className:"flex items-center px-4 py-2 border-t border-border bg-muted/25",children:t.jsx("div",{className:"h-5 w-20 rounded bg-muted animate-pulse"})})]}),l[2]=n):n=l[2],n}function Zs(l){const e=q.c(85),{value:s,onChange:n,onColorChange:i,name:a,size:c,className:r,avatarClassName:p,showHoverOverlay:o,disabled:f}=l,m=c===void 0?"lg":c,u=o===void 0?!0:o,h=f===void 0?!1:f,d=Z(),[x,g]=Q.useState(!1),[v,y]=Q.useState("icons"),[j,b]=Q.useState(""),[S,N]=Q.useState("blue");let k;e[0]!==s?(k=ti(s),e[0]=s,e[1]=k):k=e[1];const w=k,C=w.type==="icon"||w.type==="url"&&w.color?w.color:S;let _;e[2]!==n||e[3]!==C?(_=ee=>{n(jt(ee,C))},e[2]=n,e[3]=C,e[4]=_):_=e[4];const T=_;let V;e[5]!==n||e[6]!==i||e[7]!==w.name||e[8]!==w.type||e[9]!==w.url?(V=ee=>{N(ee),i?.(ee),w.type==="icon"?n(jt(w.name,ee)):w.type==="url"&&n(qt(w.url,ee))},e[5]=n,e[6]=i,e[7]=w.name,e[8]=w.type,e[9]=w.url,e[10]=V):V=e[10];const $=V;let D;e[11]!==n||e[12]!==C?(D=ee=>{n(qt(ee,C)),g(!1)},e[11]=n,e[12]=C,e[13]=D):D=e[13];const A=D;let P;e[14]!==n||e[15]!==C?(P=()=>{const ee=Ts(),J=ee[Math.floor(Math.random()*ee.length)];n(jt(J,C))},e[14]=n,e[15]=C,e[16]=P):P=e[16];const E=P,U=h?!1:x;let K;e[17]!==d?(K=d("common.iconPicker.changeIcon"),e[17]=d,e[18]=K):K=e[18];const Y=h?"cursor-default opacity-50":"cursor-pointer";let B;e[19]!==r||e[20]!==m||e[21]!==Y?(B=ve("relative group overflow-hidden",Y,si(m),r),e[19]=r,e[20]=m,e[21]=Y,e[22]=B):B=e[22];let z;e[23]!==p||e[24]!==a||e[25]!==m||e[26]!==s?(z=t.jsx(Ht,{icon:s,name:a,size:m,className:p}),e[23]=p,e[24]=a,e[25]=m,e[26]=s,e[27]=z):z=e[27];let M;e[28]!==h||e[29]!==u?(M=u&&!h&&t.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity",children:t.jsx(ai,{size:16,className:"text-white"})}),e[28]=h,e[29]=u,e[30]=M):M=e[30];let O;e[31]!==h||e[32]!==K||e[33]!==B||e[34]!==z||e[35]!==M?(O=t.jsx(Es,{asChild:!0,children:t.jsxs("button",{type:"button","data-testid":"icon-picker-trigger","aria-label":K,disabled:h,className:B,children:[z,M]})}),e[31]=h,e[32]=K,e[33]=B,e[34]=z,e[35]=M,e[36]=O):O=e[36];let G;e[37]!==a||e[38]!==s?(G=t.jsx("div",{className:"flex items-center justify-center py-4",children:t.jsx(Ht,{icon:s,name:a,size:"xl"})}),e[37]=a,e[38]=s,e[39]=G):G=e[39];let R;e[40]!==v?(R=ee=>{if(ee.key!=="ArrowLeft"&&ee.key!=="ArrowRight")return;ee.preventDefault();const J=v==="icons"?"upload":"icons";y(J),document.getElementById(`icon-picker-tab-${J}`)?.focus()},e[40]=v,e[41]=R):R=e[41];const F=v==="icons",W=v==="icons"?0:-1;let H;e[42]===Symbol.for("react.memo_cache_sentinel")?(H=()=>y("icons"),e[42]=H):H=e[42];const se=v==="icons"?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground";let le;e[43]!==se?(le=ve("px-3 py-2 text-sm font-medium border-b-2 -mb-px transition-colors",se),e[43]=se,e[44]=le):le=e[44];let ce;e[45]!==d?(ce=d("common.iconPicker.iconsTab"),e[45]=d,e[46]=ce):ce=e[46];let ae;e[47]!==F||e[48]!==W||e[49]!==le||e[50]!==ce?(ae=t.jsx("button",{id:"icon-picker-tab-icons",type:"button",role:"tab","aria-selected":F,"aria-controls":"icon-picker-panel-icons",tabIndex:W,onClick:H,className:le,children:ce}),e[47]=F,e[48]=W,e[49]=le,e[50]=ce,e[51]=ae):ae=e[51];const ie=v==="upload",X=v==="upload"?0:-1;let de;e[52]===Symbol.for("react.memo_cache_sentinel")?(de=()=>y("upload"),e[52]=de):de=e[52];const ue=v==="upload"?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground";let he;e[53]!==ue?(he=ve("px-3 py-2 text-sm font-medium border-b-2 -mb-px transition-colors",ue),e[53]=ue,e[54]=he):he=e[54];let me;e[55]!==d?(me=d("common.iconPicker.uploadTab"),e[55]=d,e[56]=me):me=e[56];let xe;e[57]!==ie||e[58]!==X||e[59]!==he||e[60]!==me?(xe=t.jsx("button",{id:"icon-picker-tab-upload",type:"button",role:"tab","aria-selected":ie,"aria-controls":"icon-picker-panel-upload",tabIndex:X,onClick:de,className:he,children:me}),e[57]=ie,e[58]=X,e[59]=he,e[60]=me,e[61]=xe):xe=e[61];let ge;e[62]===Symbol.for("react.memo_cache_sentinel")?(ge=t.jsx("div",{className:"flex-1"}),e[62]=ge):ge=e[62];let fe;e[63]!==R||e[64]!==ae||e[65]!==xe?(fe=t.jsxs("div",{role:"tablist","aria-label":"Icon source",className:"flex items-center border-b border-border px-3",onKeyDown:R,children:[ae,xe,ge]}),e[63]=R,e[64]=ae,e[65]=xe,e[66]=fe):fe=e[66];let I;e[67]!==$||e[68]!==E||e[69]!==T||e[70]!==A||e[71]!==w.name||e[72]!==w.type||e[73]!==j||e[74]!==C||e[75]!==v?(I=v==="icons"?t.jsx("div",{id:"icon-picker-panel-icons",role:"tabpanel","aria-labelledby":"icon-picker-tab-icons",children:t.jsx(Sa,{search:j,onSearchChange:b,selectedColor:C,onColorChange:$,onSelectIcon:T,onRandom:E,currentIconName:w.type==="icon"?w.name:null})}):t.jsx("div",{id:"icon-picker-panel-upload",role:"tabpanel","aria-labelledby":"icon-picker-tab-upload",children:t.jsx(Na,{onUpload:A})}),e[67]=$,e[68]=E,e[69]=T,e[70]=A,e[71]=w.name,e[72]=w.type,e[73]=j,e[74]=C,e[75]=v,e[76]=I):I=e[76];let ne;e[77]!==G||e[78]!==fe||e[79]!==I?(ne=t.jsx(zs,{align:"start",className:"w-80 p-0",onOpenAutoFocus:ja,children:t.jsxs("div",{className:"flex flex-col",children:[G,fe,I]})}),e[77]=G,e[78]=fe,e[79]=I,e[80]=ne):ne=e[80];let L;return e[81]!==O||e[82]!==ne||e[83]!==U?(L=t.jsxs(Rs,{open:U,onOpenChange:g,children:[O,ne]}),e[81]=O,e[82]=ne,e[83]=U,e[84]=L):L=e[84],L}function ja(l){return l.preventDefault()}function ya(l){const e=q.c(33),{selectedColor:s,onColorChange:n}=l,i=Z(),[a,c]=Q.useState(!1);let r,p,o,f,m,u,h;if(e[0]!==a||e[1]!==s){const S=Ds(s);p=Rs,u=a,h=c,r=Es,m=!0,o="button",f=ve("h-6 w-6 rounded-full shrink-0 ring-2 ring-offset-2 ring-offset-background transition-all cursor-pointer hover:scale-110",S.dot,"ring-foreground/20"),e[0]=a,e[1]=s,e[2]=r,e[3]=p,e[4]=o,e[5]=f,e[6]=m,e[7]=u,e[8]=h}else r=e[2],p=e[3],o=e[4],f=e[5],m=e[6],u=e[7],h=e[8];let d;e[9]!==i?(d=i("common.iconPicker.changeColor"),e[9]=i,e[10]=d):d=e[10];let x;e[11]!==i?(x=i("common.iconPicker.changeColor"),e[11]=i,e[12]=x):x=e[12];let g;e[13]!==o||e[14]!==f||e[15]!==d||e[16]!==x?(g=t.jsx("button",{type:o,className:f,title:d,"aria-label":x}),e[13]=o,e[14]=f,e[15]=d,e[16]=x,e[17]=g):g=e[17];let v;e[18]!==r||e[19]!==m||e[20]!==g?(v=t.jsx(r,{asChild:m,children:g}),e[18]=r,e[19]=m,e[20]=g,e[21]=v):v=e[21];let y;e[22]!==n||e[23]!==s?(y=oi.map(S=>t.jsx("button",{type:"button",onClick:()=>{n(S.name),c(!1)},className:ve("h-5 w-5 rounded-full transition-all shrink-0 cursor-pointer",S.dot,s===S.name?"ring-2 ring-offset-1 ring-offset-background ring-foreground/30 scale-110":"hover:scale-110"),title:S.name,"aria-label":S.name},S.name)),e[22]=n,e[23]=s,e[24]=y):y=e[24];let j;e[25]!==y?(j=t.jsx(zs,{align:"start",side:"right",sideOffset:8,className:"w-auto p-2",onOpenAutoFocus:wa,children:t.jsx("div",{className:"grid grid-cols-4 gap-1",children:y})}),e[25]=y,e[26]=j):j=e[26];let b;return e[27]!==p||e[28]!==j||e[29]!==u||e[30]!==h||e[31]!==v?(b=t.jsxs(p,{open:u,onOpenChange:h,children:[v,j]}),e[27]=p,e[28]=j,e[29]=u,e[30]=h,e[31]=v,e[32]=b):b=e[32],b}function wa(l){return l.preventDefault()}function Sa(l){const e=q.c(55),{search:s,onSearchChange:n,selectedColor:i,onColorChange:a,onSelectIcon:c,onRandom:r,currentIconName:p}=l,o=Z();let f,m,u,h,d,x,g;if(e[0]!==p||e[1]!==a||e[2]!==r||e[3]!==n||e[4]!==c||e[5]!==s||e[6]!==i||e[7]!==o){const S=Ts(),N=Ds(i);m=ni(S,s),x="flex flex-col";let k;e[15]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(Ct,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none"}),e[15]=k):k=e[15];let w;e[16]!==n?(w=P=>n(P.target.value),e[16]=n,e[17]=w):w=e[17];let C;e[18]!==o?(C=o("common.iconPicker.filterPlaceholder"),e[18]=o,e[19]=C):C=e[19];let _;e[20]!==s||e[21]!==w||e[22]!==C?(_=t.jsxs("div",{className:"relative flex-1",children:[k,t.jsx(ke,{value:s,onChange:w,placeholder:C,size:"sm",className:"text-xs pl-7"})]}),e[20]=s,e[21]=w,e[22]=C,e[23]=_):_=e[23];let T;e[24]!==o?(T=o("common.iconPicker.randomIcon"),e[24]=o,e[25]=T):T=e[25];let V;e[26]!==o?(V=o("common.iconPicker.randomIcon"),e[26]=o,e[27]=V):V=e[27];let $;e[28]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(ri,{className:"size-3.5 text-muted-foreground"}),e[28]=$):$=e[28];let D;e[29]!==r||e[30]!==T||e[31]!==V?(D=t.jsx(te,{type:"button",variant:"outline",size:"icon",onClick:r,className:"shrink-0",title:T,"aria-label":V,children:$}),e[29]=r,e[30]=T,e[31]=V,e[32]=D):D=e[32];let A;e[33]!==a||e[34]!==i?(A=t.jsx(ya,{selectedColor:i,onColorChange:a}),e[33]=a,e[34]=i,e[35]=A):A=e[35],e[36]!==D||e[37]!==A||e[38]!==_?(g=t.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",children:[_,D,A]}),e[36]=D,e[37]=A,e[38]=_,e[39]=g):g=e[39],f=ki,d="h-56",u="grid grid-cols-9 gap-0.5 px-2 pb-2",h=m.map(P=>{const E=ii(P);return E?t.jsx("button",{type:"button",onClick:()=>c(P),className:ve("h-8 w-8 flex items-center justify-center rounded-lg transition-colors cursor-pointer",p===P?ve(N.bg,N.text):ve(N.text,"hover:bg-accent")),title:P,"aria-label":li(P),children:t.jsx(E,{size:18})},P):null}),e[0]=p,e[1]=a,e[2]=r,e[3]=n,e[4]=c,e[5]=s,e[6]=i,e[7]=o,e[8]=f,e[9]=m,e[10]=u,e[11]=h,e[12]=d,e[13]=x,e[14]=g}else f=e[8],m=e[9],u=e[10],h=e[11],d=e[12],x=e[13],g=e[14];let v;e[40]!==u||e[41]!==h?(v=t.jsx("div",{className:u,children:h}),e[40]=u,e[41]=h,e[42]=v):v=e[42];let y;e[43]!==m.length||e[44]!==o?(y=m.length===0&&t.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:o("common.iconPicker.noIconsFound")}),e[43]=m.length,e[44]=o,e[45]=y):y=e[45];let j;e[46]!==f||e[47]!==d||e[48]!==v||e[49]!==y?(j=t.jsxs(f,{className:d,children:[v,y]}),e[46]=f,e[47]=d,e[48]=v,e[49]=y,e[50]=j):j=e[50];let b;return e[51]!==x||e[52]!==g||e[53]!==j?(b=t.jsxs("div",{className:x,children:[g,j]}),e[51]=x,e[52]=g,e[53]=j,e[54]=b):b=e[54],b}function Na(l){const e=q.c(46),{onUpload:s}=l,n=Z(),i=Q.useRef(null);let a;e[0]!==s||e[1]!==n?(a=D=>{const A=D.target.files?.[0];if(!A)return;if(A.size>2097152){oe.error(n("common.iconPicker.imageTooLarge")),D.target.value="";return}const P=new FileReader;P.onerror=()=>{oe.error(n("common.iconPicker.failedToReadImage")),i.current&&(i.current.value="")},P.onloadend=()=>{P.readyState===FileReader.DONE&&P.result&&s(P.result),i.current&&(i.current.value="")},P.readAsDataURL(A)},e[0]=s,e[1]=n,e[2]=a):a=e[2];const c=a,[r,p]=Q.useState("");let o;e[3]!==s||e[4]!==r?(o=()=>{const D=r.trim();D&&(s(D),p(""))},e[3]=s,e[4]=r,e[5]=o):o=e[5];const f=o;let m;e[6]!==c?(m=t.jsx("input",{type:"file",ref:i,className:"hidden",accept:"image/*",onChange:c}),e[6]=c,e[7]=m):m=e[7];let u;e[8]===Symbol.for("react.memo_cache_sentinel")?(u=()=>i.current?.click(),e[8]=u):u=e[8];let h;e[9]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(Mi,{size:20}),e[9]=h):h=e[9];let d;e[10]!==n?(d=n("common.iconPicker.uploadHint"),e[10]=n,e[11]=d):d=e[11];let x;e[12]!==d?(x=t.jsxs("button",{type:"button",onClick:u,className:"h-24 rounded-lg border-2 border-dashed border-border hover:border-foreground/50 hover:bg-accent transition-colors flex flex-col items-center justify-center gap-2 text-muted-foreground hover:text-foreground",children:[h,t.jsx("span",{className:"text-xs",children:d})]}),e[12]=d,e[13]=x):x=e[13];let g;e[14]!==n?(g=n("common.iconPicker.or"),e[14]=n,e[15]=g):g=e[15];let v;e[16]!==g?(v=t.jsx("span",{className:"text-xs text-muted-foreground",children:g}),e[16]=g,e[17]=v):v=e[17];let y;e[18]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx("div",{className:"flex-1 h-px bg-border"}),e[18]=y):y=e[18];let j;e[19]!==v?(j=t.jsxs("div",{className:"flex items-center gap-2",children:[v,y]}),e[19]=v,e[20]=j):j=e[20];let b;e[21]===Symbol.for("react.memo_cache_sentinel")?(b=D=>p(D.target.value),e[21]=b):b=e[21];let S;e[22]!==n?(S=n("common.iconPicker.pasteUrlPlaceholder"),e[22]=n,e[23]=S):S=e[23];let N;e[24]!==f?(N=D=>{D.key==="Enter"&&(D.preventDefault(),f())},e[24]=f,e[25]=N):N=e[25];let k;e[26]!==r||e[27]!==S||e[28]!==N?(k=t.jsx(ke,{value:r,onChange:b,placeholder:S,className:"h-8 text-xs flex-1",onKeyDown:N}),e[26]=r,e[27]=S,e[28]=N,e[29]=k):k=e[29];let w;e[30]!==r?(w=r.trim(),e[30]=r,e[31]=w):w=e[31];const C=!w;let _;e[32]!==n?(_=n("common.iconPicker.apply"),e[32]=n,e[33]=_):_=e[33];let T;e[34]!==f||e[35]!==C||e[36]!==_?(T=t.jsx(te,{variant:"outline",className:"shrink-0",onClick:f,disabled:C,children:_}),e[34]=f,e[35]=C,e[36]=_,e[37]=T):T=e[37];let V;e[38]!==k||e[39]!==T?(V=t.jsxs("div",{className:"flex items-center gap-1.5",children:[k,T]}),e[38]=k,e[39]=T,e[40]=V):V=e[40];let $;return e[41]!==j||e[42]!==V||e[43]!==m||e[44]!==x?($=t.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[m,x,j,V]}),e[41]=j,e[42]=V,e[43]=m,e[44]=x,e[45]=$):$=e[45],$}function Ca(l){const e=q.c(11),{viewId:s}=l;if(s==="overview"){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Ps,{size:16}),e[0]=i):i=e[0],i}if(s==="reports"){let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Qt,{size:16}),e[1]=i):i=e[1],i}if(s==="board"){let i;return e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(ci,{size:16}),e[2]=i):i=e[2],i}if(s==="site-editor"){let i;return e[3]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Ti,{size:16}),e[3]=i):i=e[3],i}if(s==="assets"){let i;return e[4]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Vi,{size:16}),e[4]=i):i=e[4],i}if(s==="releases"){let i;return e[5]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(di,{size:16}),e[5]=i):i=e[5],i}if(s==="hosting"){let i;return e[6]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(rn,{size:16}),e[6]=i):i=e[6],i}if(s==="e2e"){let i;return e[7]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(ui,{size:16}),e[7]=i):i=e[7],i}if(s==="analytics"){let i;return e[8]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Qt,{size:16}),e[8]=i):i=e[8],i}if(s==="cdn"){let i;return e[9]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(mi,{size:16}),e[9]=i):i=e[9],i}let n;return e[10]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(Os,{size:16}),e[10]=n):n=e[10],n}function ms(l){const e=q.c(51),{pinned:s,canSetMainView:n,onOpen:i,onTogglePin:a,onSetMainView:c}=l,r=Z(),p=s?"text-foreground":"text-muted-foreground/40";let o;e[0]!==p?(o=ve("size-7",p),e[0]=p,e[1]=o):o=e[1];let f;e[2]!==s||e[3]!==r?(f=r(s?"virtualMcp.settings.views.unpin":"virtualMcp.settings.views.pin"),e[2]=s,e[3]=r,e[4]=f):f=e[4];let m;e[5]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(Xt,{size:16}),e[5]=m):m=e[5];let u;e[6]!==a||e[7]!==s||e[8]!==o||e[9]!==f?(u=t.jsx(Ne,{asChild:!0,children:t.jsx(te,{variant:"ghost",size:"icon",className:o,"aria-label":f,"aria-pressed":s,onClick:a,children:m})}),e[6]=a,e[7]=s,e[8]=o,e[9]=f,e[10]=u):u=e[10];let h;e[11]!==s||e[12]!==r?(h=r(s?"virtualMcp.settings.views.unpin":"virtualMcp.settings.views.pin"),e[11]=s,e[12]=r,e[13]=h):h=e[13];let d;e[14]!==h?(d=t.jsx(Ce,{side:"top",children:h}),e[14]=h,e[15]=d):d=e[15];let x;e[16]!==u||e[17]!==d?(x=t.jsxs(Se,{delayDuration:0,children:[u,d]}),e[16]=u,e[17]=d,e[18]=x):x=e[18];let g;e[19]!==r?(g=r("virtualMcp.settings.views.rowActions"),e[19]=r,e[20]=g):g=e[20];let v;e[21]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(_i,{size:16}),e[21]=v):v=e[21];let y;e[22]!==g?(y=t.jsx(bs,{asChild:!0,children:t.jsx(te,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground","aria-label":g,children:v})}),e[22]=g,e[23]=y):y=e[23];let j;e[24]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(on,{size:14}),e[24]=j):j=e[24];let b;e[25]!==r?(b=r("virtualMcp.settings.views.open"),e[25]=r,e[26]=b):b=e[26];let S;e[27]!==i||e[28]!==b?(S=t.jsxs(He,{onClick:i,children:[j,b]}),e[27]=i,e[28]=b,e[29]=S):S=e[29];let N;e[30]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(Xt,{size:14}),e[30]=N):N=e[30];let k;e[31]!==s||e[32]!==r?(k=r(s?"virtualMcp.settings.views.unpin":"virtualMcp.settings.views.pin"),e[31]=s,e[32]=r,e[33]=k):k=e[33];let w;e[34]!==a||e[35]!==k?(w=t.jsxs(He,{onClick:a,children:[N,k]}),e[34]=a,e[35]=k,e[36]=w):w=e[36];let C;e[37]!==n||e[38]!==c||e[39]!==r?(C=n&&t.jsxs(He,{onClick:c,children:[t.jsx(Ps,{size:14}),r("virtualMcp.settings.views.setMainView")]}),e[37]=n,e[38]=c,e[39]=r,e[40]=C):C=e[40];let _;e[41]!==S||e[42]!==w||e[43]!==C?(_=t.jsxs(js,{align:"end",children:[S,w,C]}),e[41]=S,e[42]=w,e[43]=C,e[44]=_):_=e[44];let T;e[45]!==y||e[46]!==_?(T=t.jsxs(vs,{children:[y,_]}),e[45]=y,e[46]=_,e[47]=T):T=e[47];let V;return e[48]!==T||e[49]!==x?(V=t.jsxs("div",{className:"flex items-center gap-1",children:[x,T]}),e[48]=T,e[49]=x,e[50]=V):V=e[50],V}const fs=l=>l.stopPropagation();function ka(l){const e=q.c(8),{icon:s,title:n}=l;let i;e[0]!==s||e[1]!==n?(i=t.jsx(Ze,{icon:s,name:n,size:"xs",className:"shrink-0"}),e[0]=s,e[1]=n,e[2]=i):i=e[2];let a;e[3]!==n?(a=t.jsx("span",{className:"text-xs text-muted-foreground",children:n}),e[3]=n,e[4]=a):a=e[4];let c;return e[5]!==i||e[6]!==a?(c=t.jsxs("div",{className:"flex items-center gap-2 px-4 py-2.5 bg-muted/30",children:[i,a]}),e[5]=i,e[6]=a,e[7]=c):c=e[7],c}function Ma(l){const e=q.c(70),{views:s}=l,n=Z();let i;e[0]!==n?(i=n("virtualMcp.settings.views.defaults"),e[0]=n,e[1]=i):i=e[1];let a;e[2]!==n?(a=n("virtualMcp.layoutTabContent.mainView"),e[2]=n,e[3]=a):a=e[3];let c;e[4]!==n?(c=n("virtualMcp.layoutTabContent.mainViewDescription"),e[4]=n,e[5]=c):c=e[5];const r=s.defaultMainView,p=s.setMainView;let o;e[6]!==n?(o=n("virtualMcp.layoutTabContent.mainView"),e[6]=n,e[7]=o):o=e[7];let f;e[8]!==n?(f=n("virtualMcp.layoutTabContent.noMainView"),e[8]=n,e[9]=f):f=e[9];let m;e[10]!==f?(m=t.jsx(Ie,{placeholder:f}),e[10]=f,e[11]=m):m=e[11];let u;e[12]!==o||e[13]!==m?(u=t.jsx(Oe,{"aria-label":o,size:"sm",className:"w-36 shrink-0 @min-xl/project-settings:w-44",children:m}),e[12]=o,e[13]=m,e[14]=u):u=e[14];let h;e[15]!==s.defaultMainOptions?(h=s.defaultMainOptions.map(_a),e[15]=s.defaultMainOptions,e[16]=h):h=e[16];let d;e[17]!==h?(d=t.jsx(Ae,{children:h}),e[17]=h,e[18]=d):d=e[18];let x;e[19]!==d||e[20]!==u||e[21]!==s.defaultMainView||e[22]!==s.setMainView?(x=t.jsxs($e,{value:r,onValueChange:p,children:[u,d]}),e[19]=d,e[20]=u,e[21]=s.defaultMainView,e[22]=s.setMainView,e[23]=x):x=e[23];let g;e[24]!==x||e[25]!==a||e[26]!==c?(g=t.jsx(tt,{title:a,description:c,action:x}),e[24]=x,e[25]=a,e[26]=c,e[27]=g):g=e[27];let v;e[28]!==n?(v=n("virtualMcp.layoutTabContent.showChat"),e[28]=n,e[29]=v):v=e[29];let y;e[30]!==n?(y=n("virtualMcp.layoutTabContent.showChatDescription"),e[30]=n,e[31]=y):y=e[31];let j;e[32]!==n?(j=n("virtualMcp.layoutTabContent.showChat"),e[32]=n,e[33]=j):j=e[33];const b=s.noMainView?!0:s.chatDefaultOpen;let S;e[34]!==j||e[35]!==b||e[36]!==s.noMainView||e[37]!==s.setChatDefaultOpen?(S=t.jsx(Ne,{asChild:!0,children:t.jsx("span",{className:"shrink-0",children:t.jsx(ht,{"aria-label":j,checked:b,disabled:s.noMainView,onCheckedChange:s.setChatDefaultOpen})})}),e[34]=j,e[35]=b,e[36]=s.noMainView,e[37]=s.setChatDefaultOpen,e[38]=S):S=e[38];let N;e[39]!==n||e[40]!==s.noMainView?(N=s.noMainView&&t.jsx(Ce,{side:"top",children:n("virtualMcp.layoutTabContent.chatAlwaysShown")}),e[39]=n,e[40]=s.noMainView,e[41]=N):N=e[41];let k;e[42]!==S||e[43]!==N?(k=t.jsxs(Se,{delayDuration:0,children:[S,N]}),e[42]=S,e[43]=N,e[44]=k):k=e[44];let w;e[45]!==v||e[46]!==y||e[47]!==k?(w=t.jsx(tt,{title:v,description:y,action:k}),e[45]=v,e[46]=y,e[47]=k,e[48]=w):w=e[48];let C;e[49]!==g||e[50]!==w?(C=t.jsxs(ze,{children:[g,w]}),e[49]=g,e[50]=w,e[51]=C):C=e[51];let _;e[52]!==i||e[53]!==C?(_=t.jsx(Be,{title:i,children:C}),e[52]=i,e[53]=C,e[54]=_):_=e[54];let T;e[55]!==n?(T=n("virtualMcp.settings.views.sidebar"),e[55]=n,e[56]=T):T=e[56];let V;e[57]!==s?(V=s.projectViews.map(E=>{const U=s.pinned(E);return t.jsx(tt,{icon:t.jsx(Ca,{viewId:E}),title:s.labels[E],onClick:()=>s.openView(E),action:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(ms,{pinned:U,canSetMainView:U&&!s.isMainView(E),onOpen:()=>s.openView(E),onTogglePin:()=>s.togglePin(E,!U),onSetMainView:()=>s.setMainView(E)}),t.jsx("span",{onClick:()=>s.openView(E),className:"flex cursor-pointer items-center text-muted-foreground",children:t.jsx(Wt,{size:16})})]})},E)}),e[57]=s,e[58]=V):V=e[58];let $;e[59]!==s?($=s.connectionsData.flatMap(E=>[t.jsx(ka,{icon:E.icon,title:E.title},`${E.id}:header`),...E.uiTools.map(U=>{const K=s.pinnedAppViews.find(M=>M.connectionId===E.id&&M.toolName===U.name),Y=!!K,B=cn(E.id,U.name),z=`ext-apps:${E.id}:${U.name}`;return t.jsx(tt,{onClick:()=>s.openView(B),icon:Y?t.jsx("span",{onClick:fs,children:t.jsx(Zs,{value:K.icon??null,name:K.label||U.name,size:"xs",showHoverOverlay:!1,onChange:M=>s.setAppViewIcon(E.id,U.name,M)})}):t.jsx(Os,{size:16}),title:Y?t.jsx("span",{onClick:fs,children:t.jsx(ke,{value:K.label,onChange:M=>s.setAppViewLabel(E.id,U.name,M.target.value),onBlur:s.commitAppViewLabel,"aria-label":U.title??kt(U.name),className:"h-7 w-full max-w-52 text-sm"})}):U.title??kt(U.name),action:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(ms,{pinned:Y,canSetMainView:Y&&!s.isMainView(z),onOpen:()=>s.openView(B),onTogglePin:()=>s.toggleAppViewPin(E.id,U.name),onSetMainView:()=>s.setMainView(z)}),t.jsx("span",{onClick:()=>s.openView(B),className:"flex cursor-pointer items-center text-muted-foreground",children:t.jsx(Wt,{size:16})})]})},`${E.id}:${U.name}`)})]),e[59]=s,e[60]=$):$=e[60];let D;e[61]!==V||e[62]!==$?(D=t.jsxs(ze,{children:[V,$]}),e[61]=V,e[62]=$,e[63]=D):D=e[63];let A;e[64]!==T||e[65]!==D?(A=t.jsx(Be,{title:T,children:D}),e[64]=T,e[65]=D,e[66]=A):A=e[66];let P;return e[67]!==_||e[68]!==A?(P=t.jsxs(t.Fragment,{children:[_,A]}),e[67]=_,e[68]=A,e[69]=P):P=e[69],P}function _a(l){return t.jsx(we,{value:l.value,children:l.label},l.value)}const en="site-editor",Va=new Set([en,"content"]);function Ta({virtualMcpId:l,form:e,flushAndSave:s}){const n=Z(),i=Tt(),{openPanel:a}=Ii(),c=_s(l),r=Ai(c),p=Us(l),o=Ui(l),f=(c?.connections??[]).map(M=>M.connection_id).sort(),{data:m}=Ss({queryKey:Dt.projectConnectionDetails(l,f),enabled:f.length>0,queryFn:async()=>await Promise.all(f.map(async O=>{try{const{item:G}=await i.call("COLLECTION_CONNECTIONS_GET",{id:O}),R=(G?.tools??[]).flatMap(F=>{const W=Di(F._meta);return W?[{name:F.name,title:F.title,description:F.description,resourceUri:W}]:[]});return{fetchOk:!0,id:O,title:G?.title??O,icon:G?.icon??null,uiTools:R}}catch{return{fetchOk:!1,id:O,title:O,icon:null,uiTools:[]}}}))}),u=(m??[]).filter(M=>M.uiTools.length>0),h=new Set([...dn,...un]),d=e.watch("metadata.ui.pinnedViews")??[],x=e.watch("metadata.ui.layout")??null,g=x?.defaultMainView??null,v=x?.chatDefaultOpen??!1,y=Mt(_t({sidebarViews:e.watch("metadata.sidebarViews"),ui:{layout:x}}),e.watch("metadata.sidebarViewsVersion")),j=o??(c?Mt(_t(c.metadata),c.metadata.sidebarViewsVersion):y),b=(()=>{if(!g||g.type==="chat")return"";const M=mn(g.type);return M==="instructions"||M==="connections"||M==="layout"?"settings":Va.has(M)?en:h.has(M)?M:`${M}:${g.id??""}:${g.toolName??""}`})(),S=b==="",N=M=>{const[O,G,R]=M.split(":");return O?h.has(O)?{type:O}:O==="ext-apps"&&G?{type:"ext-apps",id:G,toolName:R||void 0}:null:null},k=M=>{e.setValue("metadata.ui.pinnedViews",M,{shouldDirty:!0})},w=M=>{e.setValue("metadata.ui.layout",{...x,...M},{shouldDirty:!0})},C=Q.useRef(!1);if(m&&m.length>0&&!C.current){C.current=!0;const M=new Set((m??[]).filter(F=>F.fetchOk).map(F=>F.id)),O=new Set(u.flatMap(F=>F.uiTools.map(W=>`${F.id}:${W.name}`))),G=new Set(f),R=d.filter(F=>G.has(F.connectionId)&&(!M.has(F.connectionId)||O.has(`${F.connectionId}:${F.toolName}`)));R.length!==d.length&&(k(R),g?.type==="ext-apps"&&!R.some(F=>F.connectionId===g.id&&F.toolName===g.toolName)&&w({defaultMainView:{type:"settings"}}))}const _=(M,O)=>{if(d.some(R=>R.connectionId===M&&R.toolName===O)){const R=d.filter(W=>!(W.connectionId===M&&W.toolName===O));k(R);const F=`ext-apps:${M}:${O}`;b===F&&w({defaultMainView:{type:"settings"}})}else{const R=u.find(F=>F.id===M)?.uiTools.find(F=>F.name===O)?.title;k([...d,{connectionId:M,toolName:O,label:R??kt(O),icon:null}])}s()},T=(M,O,G)=>{k(d.map(R=>R.connectionId===M&&R.toolName===O?{...R,label:G}:R))},V=()=>{s()},$=(M,O,G)=>{k(d.map(R=>R.connectionId===M&&R.toolName===O?{...R,icon:G}:R)),s()},D=M=>{w({defaultMainView:N(M)}),s()},A=(M,O)=>{const G=zi(j,M,O,1);e.setValue("metadata.sidebarViews",G,{shouldDirty:!0}),e.setValue("metadata.sidebarViewsVersion",1,{shouldDirty:!0}),p.stage(G,j);const R=Ri(g,M,O);R!==g&&w({defaultMainView:R})},P=Ls(c?.metadata),E=$i(P,r.presence),U=Fi(E),K=Ei(j,E,1),Y={overview:n("sidebar.navDestinations.home"),reports:n("sidebar.navDestinations.reports"),board:n("sidebar.navDestinations.tasks"),"site-editor":n("virtualMcp.layoutTabContent.siteEditor"),assets:n("common.mainPanelTabs.assets"),releases:n("common.mainPanelTabs.releases"),hosting:n("common.mainPanelTabs.hosting"),e2e:n("common.mainPanelTabs.e2e"),analytics:n("common.mainPanelTabs.analytics"),cdn:n("common.mainPanelTabs.cdn"),automations:n("virtualMcp.layoutTabContent.automations"),experiments:n("experiments.title")},B=[];for(const M of K)M!=="automations"&&B.push({value:M,label:Y[M]});for(const M of d)B.push({value:`ext-apps:${M.connectionId}:${M.toolName}`,label:M.label||M.toolName});return K.includes("automations")&&B.push({value:"automations",label:Y.automations}),B.push({value:"settings",label:n("virtualMcp.layoutTabContent.settings")}),{projectViews:U,labels:Y,pinned:M=>j.includes(M),isMainView:M=>b===M,defaultMainView:b,defaultMainOptions:B,noMainView:S,chatDefaultOpen:v,connectionsData:u,pinnedAppViews:d,openView:M=>a(M,{virtualmcpid:l}),togglePin:(M,O)=>A(M,O),setMainView:D,setChatDefaultOpen:M=>{w({chatDefaultOpen:M}),s()},toggleAppViewPin:_,setAppViewIcon:$,setAppViewLabel:T,commitAppViewLabel:V}}function Da(l){const e=q.c(55),{form:s,onCommit:n}=l,i=Z(),a=Q.useId();let c;e[0]!==i?(c=i("virtualMcp.settings.identity.icon"),e[0]=i,e[1]=c):c=e[1];let r;e[2]!==c?(r=t.jsx("p",{className:"text-sm font-medium",children:c}),e[2]=c,e[3]=r):r=e[3];let p;e[4]!==i?(p=i("virtualMcp.settings.identity.iconDescription"),e[4]=i,e[5]=p):p=e[5];let o;e[6]!==p?(o=t.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:p}),e[6]=p,e[7]=o):o=e[7];let f;e[8]!==r||e[9]!==o?(f=t.jsxs("div",{children:[r,o]}),e[8]=r,e[9]=o,e[10]=f):f=e[10];let m;e[11]!==s||e[12]!==n||e[13]!==i?(m=T=>{const{field:V}=T;return t.jsx("div",{className:"justify-self-start",children:t.jsx(Zs,{value:V.value??null,onChange:$=>{V.onChange($),n()},onColorChange:$=>{s.setValue("metadata.ui.themeColor",$,{shouldDirty:!0}),n()},name:s.watch("title")||i("virtualMcp.virtualMcp.agentNameFallback"),size:"md",avatarClassName:"[&_svg]:w-1/2 [&_svg]:h-1/2"})})},e[11]=s,e[12]=n,e[13]=i,e[14]=m):m=e[14];let u;e[15]!==s.control||e[16]!==m?(u=t.jsx(be,{name:"icon",control:s.control,render:m}),e[15]=s.control,e[16]=m,e[17]=u):u=e[17];let h;e[18]!==f||e[19]!==u?(h=t.jsxs(je,{className:"grid gap-3 @min-xl/project-settings:grid-cols-[180px_minmax(0,1fr)] @min-xl/project-settings:gap-8",children:[f,u]}),e[18]=f,e[19]=u,e[20]=h):h=e[20];const d=`${a}-name`;let x;e[21]!==i?(x=i("virtualMcp.settings.identity.name"),e[21]=i,e[22]=x):x=e[22];let g;e[23]!==x||e[24]!==d?(g=t.jsx("label",{htmlFor:d,className:"text-sm font-medium",children:x}),e[23]=x,e[24]=d,e[25]=g):g=e[25];let v;e[26]!==a||e[27]!==n||e[28]!==i?(v=T=>{const{field:V}=T;return t.jsx(ke,{...V,id:`${a}-name`,value:V.value??"",onBlur:()=>{V.onBlur(),n()},placeholder:i("virtualMcp.virtualMcp.agentNamePlaceholder")})},e[26]=a,e[27]=n,e[28]=i,e[29]=v):v=e[29];let y;e[30]!==s.control||e[31]!==v?(y=t.jsx(be,{name:"title",control:s.control,render:v}),e[30]=s.control,e[31]=v,e[32]=y):y=e[32];let j;e[33]!==g||e[34]!==y?(j=t.jsxs(je,{className:"grid gap-3 @min-xl/project-settings:grid-cols-[180px_minmax(0,1fr)] @min-xl/project-settings:gap-8",children:[g,y]}),e[33]=g,e[34]=y,e[35]=j):j=e[35];const b=`${a}-description`;let S;e[36]!==i?(S=i("virtualMcp.settings.identity.description"),e[36]=i,e[37]=S):S=e[37];let N;e[38]!==b||e[39]!==S?(N=t.jsx("label",{htmlFor:b,className:"text-sm font-medium",children:S}),e[38]=b,e[39]=S,e[40]=N):N=e[40];let k;e[41]!==a||e[42]!==n||e[43]!==i?(k=T=>{const{field:V}=T;return t.jsx(ut,{...V,id:`${a}-description`,value:V.value??"",onBlur:()=>{V.onBlur(),n()},placeholder:i("virtualMcp.virtualMcp.descriptionPlaceholder"),className:"min-h-24 resize-y"})},e[41]=a,e[42]=n,e[43]=i,e[44]=k):k=e[44];let w;e[45]!==s.control||e[46]!==k?(w=t.jsx(be,{name:"description",control:s.control,render:k}),e[45]=s.control,e[46]=k,e[47]=w):w=e[47];let C;e[48]!==N||e[49]!==w?(C=t.jsxs(je,{className:"grid gap-3 @min-xl/project-settings:grid-cols-[180px_minmax(0,1fr)] @min-xl/project-settings:gap-8",children:[N,w]}),e[48]=N,e[49]=w,e[50]=C):C=e[50];let _;return e[51]!==j||e[52]!==C||e[53]!==h?(_=t.jsxs(ze,{children:[h,j,C]}),e[51]=j,e[52]=C,e[53]=h,e[54]=_):_=e[54],_}function Pa(l){const e=q.c(8),{section:s}=l,n=Z();let i;e[0]!==n?(i=n("virtualMcp.settings.navigation"),e[0]=n,e[1]=i):i=e[1];let a;e[2]!==s||e[3]!==n?(a=Gi.map(r=>{const{titleKey:p}=qi[r];return t.jsx(Ue.Tab,{active:s===r,asChild:!0,children:t.jsx(ws,{to:".",activeOptions:{exact:!0,explicitUndefined:!0},search:o=>({...o,section:r==="general"?void 0:r}),children:n(p)})},r)}),e[2]=s,e[3]=n,e[4]=a):a=e[4];let c;if(e[5]!==i||e[6]!==a){const r=t.jsx(Ue.Tabs,{"aria-label":i,children:a});c=t.jsx(fn.Toolbar.Left.Portal,{fallback:r,children:r}),e[5]=i,e[6]=a,e[7]=c}else c=e[7];return c}function Oa(){const l=q.c(8),e=Pt();let s;l[0]===Symbol.for("react.memo_cache_sentinel")?(s={strict:!1},l[0]=s):s=l[0];const{section:n}=pn(s);let i;l[1]!==n?(i=Hi(n)?n:"general",l[1]=n,l[2]=i):i=l[2];let a;l[3]!==e?(a=r=>e({to:".",search:p=>({...p,section:r??void 0})}),l[3]=e,l[4]=a):a=l[4];let c;return l[5]!==i||l[6]!==a?(c={section:i,openSection:a},l[5]=i,l[6]=a,l[7]=c):c=l[7],c}function tn(l){const e=q.c(20),{value:s,label:n,copiedLabel:i,variant:a,size:c,className:r,copiedClassName:p}=l,o=a===void 0?"ghost":a,f=c===void 0?"icon-sm":c,{handleCopy:m,copied:u}=Xi();let h;e[0]!==m||e[1]!==s?(h=()=>{m(s).catch(Ia)},e[0]=m,e[1]=s,e[2]=h):h=e[2];const d=u&&p;let x;e[3]!==r||e[4]!==d?(x=ve(r,d),e[3]=r,e[4]=d,e[5]=x):x=e[5];let g;e[6]!==u?(g=u?t.jsx(rt,{className:"text-success"}):t.jsx(xt,{}),e[6]=u,e[7]=g):g=e[7];let v;e[8]!==n||e[9]!==f||e[10]!==h||e[11]!==x||e[12]!==g||e[13]!==o?(v=t.jsx(te,{type:"button",variant:o,size:f,"aria-label":n,onClick:h,className:x,children:g}),e[8]=n,e[9]=f,e[10]=h,e[11]=x,e[12]=g,e[13]=o,e[14]=v):v=e[14];const y=u?i:"";let j;e[15]!==y?(j=t.jsx("span",{className:"sr-only","aria-live":"polite",children:y}),e[15]=y,e[16]=j):j=e[16];let b;return e[17]!==v||e[18]!==j?(b=t.jsxs(t.Fragment,{children:[v,j]}),e[17]=v,e[18]=j,e[19]=b):b=e[19],b}function Ia(){}function Aa(l){const e=q.c(14),{id:s,value:n,copyLabel:i,copiedLabel:a,className:c}=l;let r;e[0]!==c?(r=ve("relative h-fit",c),e[0]=c,e[1]=r):r=e[1];let p;e[2]!==s||e[3]!==n?(p=t.jsx(ke,{id:s,value:n,readOnly:!0,disabled:!0,className:"pr-10 font-mono"}),e[2]=s,e[3]=n,e[4]=p):p=e[4];let o;e[5]===Symbol.for("react.memo_cache_sentinel")?(o=ve("absolute top-1/2 right-1 -translate-y-1/2 transition-opacity","opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 focus-visible:opacity-100 pointer-coarse:opacity-100"),e[5]=o):o=e[5];let f;e[6]!==a||e[7]!==i||e[8]!==n?(f=t.jsx(tn,{value:n,label:i,copiedLabel:a,className:o,copiedClassName:"opacity-100"}),e[6]=a,e[7]=i,e[8]=n,e[9]=f):f=e[9];let m;return e[10]!==r||e[11]!==p||e[12]!==f?(m=t.jsxs("div",{className:r,children:[p,f]}),e[10]=r,e[11]=p,e[12]=f,e[13]=m):m=e[13],m}async function ps(l){const e=await l.json().catch(()=>({}));if(!l.ok)throw new Error(e.error??`HTTP ${l.status}`);return e}function $a(l){const e=q.c(106),{orgSlug:s,virtualMcpId:n}=l,i=Z(),a=Ns(),c=`/api/${s}/hosted/${encodeURIComponent(n)}/site-tokens`;let r;e[0]!==s||e[1]!==n?(r=Dt.hostedSiteTokens(s,n),e[0]=s,e[1]=n,e[2]=r):r=e[2];const p=r,[o,f]=Q.useState(null),m=Q.useId();let u;e[3]!==c?(u=async()=>ps(await fetch(c)),e[3]=c,e[4]=u):u=e[4];let h;e[5]!==p||e[6]!==u?(h={queryKey:p,queryFn:u},e[5]=p,e[6]=u,e[7]=h):h=e[7];const d=Ss(h);let x;e[8]!==c?(x=async()=>ps(await fetch(c,{method:"POST"})),e[8]=c,e[9]=x):x=e[9];let g;e[10]===Symbol.for("react.memo_cache_sentinel")?(g=fe=>{const{token:I}=fe;return f(I)},e[10]=g):g=e[10];let v;e[11]!==p||e[12]!==a?(v=()=>a.invalidateQueries({queryKey:p}),e[11]=p,e[12]=a,e[13]=v):v=e[13];let y;e[14]!==x||e[15]!==v?(y={mutationFn:x,onSuccess:g,onError:Fa,onSettled:v},e[14]=x,e[15]=v,e[16]=y):y=e[16];const j=hn(y);let b;e[17]!==d.data?.tokens?(b=d.data?.tokens??[],e[17]=d.data?.tokens,e[18]=b):b=e[18];const S=b,N=d.data?.site;let k;e[19]!==i?(k=i("siteTokens.title"),e[19]=i,e[20]=k):k=e[20];let w;e[21]!==i?(w=i("siteTokens.description"),e[21]=i,e[22]=w):w=e[22];let C;e[23]!==i?(C=i("siteTokens.siteId"),e[23]=i,e[24]=C):C=e[24];let _;e[25]!==m||e[26]!==C?(_=t.jsx("label",{htmlFor:m,className:"text-sm font-medium",children:C}),e[25]=m,e[26]=C,e[27]=_):_=e[27];let T;e[28]!==i?(T=i("siteTokens.siteIdDescription"),e[28]=i,e[29]=T):T=e[29];let V;e[30]!==T?(V=t.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:T}),e[30]=T,e[31]=V):V=e[31];let $;e[32]!==N||e[33]!==m||e[34]!==i?($=N?t.jsx(Aa,{id:m,value:N,copyLabel:i("siteTokens.copySiteId"),copiedLabel:i("siteTokens.siteIdCopied"),className:"min-w-0 flex-1"}):t.jsx("p",{className:"min-w-0 flex-1 font-mono text-xs text-muted-foreground",children:"—"}),e[32]=N,e[33]=m,e[34]=i,e[35]=$):$=e[35];const D=!d.data||j.isPending;let A;e[36]!==j?(A=()=>j.mutate(),e[36]=j,e[37]=A):A=e[37];let P;e[38]!==j.isPending?(P=j.isPending?t.jsx(it,{className:"size-3.5"}):t.jsx(Pe,{size:14}),e[38]=j.isPending,e[39]=P):P=e[39];let E;e[40]!==i?(E=i("siteTokens.issue"),e[40]=i,e[41]=E):E=e[41];let U;e[42]!==D||e[43]!==A||e[44]!==P||e[45]!==E?(U=t.jsxs(te,{type:"button",size:"sm",className:"shrink-0",disabled:D,onClick:A,children:[P,E]}),e[42]=D,e[43]=A,e[44]=P,e[45]=E,e[46]=U):U=e[46];let K;e[47]!==$||e[48]!==U?(K=t.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[$,U]}),e[47]=$,e[48]=U,e[49]=K):K=e[49];let Y;e[50]!==_||e[51]!==V||e[52]!==K?(Y=t.jsxs(je,{className:"group",children:[_,V,K]}),e[50]=_,e[51]=V,e[52]=K,e[53]=Y):Y=e[53];let B;e[54]!==d.error||e[55]!==d.isError?(B=d.isError?t.jsx(je,{children:t.jsx("p",{className:"text-xs text-destructive",children:d.error.message})}):null,e[54]=d.error,e[55]=d.isError,e[56]=B):B=e[56];let z;if(e[57]!==i||e[58]!==S){let fe;e[60]!==i?(fe=I=>t.jsx(je,{children:t.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[t.jsx($t,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"truncate font-mono text-xs",children:I.kid}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("siteTokens.issuedAgo",{when:Qi(new Date(I.iat*1e3))})})]})]})},I.kid),e[60]=i,e[61]=fe):fe=e[61],z=S.map(fe),e[57]=i,e[58]=S,e[59]=z}else z=e[59];let M;e[62]!==Y||e[63]!==B||e[64]!==z?(M=t.jsxs(ze,{children:[Y,B,z]}),e[62]=Y,e[63]=B,e[64]=z,e[65]=M):M=e[65];const O=o!==null;let G;e[66]===Symbol.for("react.memo_cache_sentinel")?(G=fe=>!fe&&f(null),e[66]=G):G=e[66];let R;e[67]!==i?(R=i("siteTokens.createdTitle"),e[67]=i,e[68]=R):R=e[68];let F;e[69]!==R?(F=t.jsx(at,{children:R}),e[69]=R,e[70]=F):F=e[70];let W;e[71]!==i?(W=i("siteTokens.createdDescription"),e[71]=i,e[72]=W):W=e[72];let H;e[73]!==W?(H=t.jsx(Cs,{children:W}),e[73]=W,e[74]=H):H=e[74];let se;e[75]!==F||e[76]!==H?(se=t.jsxs(lt,{children:[F,H]}),e[75]=F,e[76]=H,e[77]=se):se=e[77];let le;e[78]!==i?(le=i("siteTokens.createdTitle"),e[78]=i,e[79]=le):le=e[79];const ce=o??"";let ae;e[80]!==le||e[81]!==ce?(ae=t.jsx(ke,{readOnly:!0,"aria-label":le,value:ce,className:"font-mono text-xs"}),e[80]=le,e[81]=ce,e[82]=ae):ae=e[82];let ie;e[83]!==o||e[84]!==i?(ie=o?t.jsx(tn,{value:o,label:i("siteTokens.copy"),copiedLabel:i("siteTokens.copied"),variant:"outline",size:"icon",className:"shrink-0"}):null,e[83]=o,e[84]=i,e[85]=ie):ie=e[85];let X;e[86]!==ae||e[87]!==ie?(X=t.jsxs("div",{className:"flex items-center gap-2",children:[ae,ie]}),e[86]=ae,e[87]=ie,e[88]=X):X=e[88];let de;e[89]===Symbol.for("react.memo_cache_sentinel")?(de=()=>f(null),e[89]=de):de=e[89];let ue;e[90]!==i?(ue=i("siteTokens.done"),e[90]=i,e[91]=ue):ue=e[91];let he;e[92]!==ue?(he=t.jsx(Vt,{children:t.jsx(te,{onClick:de,children:ue})}),e[92]=ue,e[93]=he):he=e[93];let me;e[94]!==se||e[95]!==X||e[96]!==he?(me=t.jsxs(Je,{className:"sm:max-w-lg",children:[se,X,he]}),e[94]=se,e[95]=X,e[96]=he,e[97]=me):me=e[97];let xe;e[98]!==O||e[99]!==me?(xe=t.jsx(Xe,{open:O,onOpenChange:G,children:me}),e[98]=O,e[99]=me,e[100]=xe):xe=e[100];let ge;return e[101]!==w||e[102]!==M||e[103]!==xe||e[104]!==k?(ge=t.jsxs(Be,{title:k,description:w,children:[M,xe]}),e[101]=w,e[102]=M,e[103]=xe,e[104]=k,e[105]=ge):ge=e[105],ge}function Fa(l){return oe.error(l.message)}function Ea(l){const e=q.c(8),{control:s,previewServerUrl:n}=l,i=Z();let a;e[0]!==n?(a=Ys(n),e[0]=n,e[1]=a):a=e[1];const c=!!a;let r;e[2]!==c||e[3]!==i?(r=o=>{const{field:f}=o;return t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"space-y-0.5 min-w-0",children:[t.jsx(ye,{htmlFor:"fast-preview",className:"font-normal text-foreground",children:i("sandbox.cmsSettings.fastPreview.label")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i(c?"sandbox.cmsSettings.fastPreview.description":"sandbox.cmsSettings.fastPreview.needsPreviewServerUrl")})]}),t.jsx(ht,{id:"fast-preview",className:"shrink-0",checked:!!f.value&&c,disabled:!c,onCheckedChange:m=>f.onChange(m)})]})},e[2]=c,e[3]=i,e[4]=r):r=e[4];let p;return e[5]!==s||e[6]!==r?(p=t.jsx(be,{control:s,name:"metadata.fastPreview",render:r}),e[5]=s,e[6]=r,e[7]=p):p=e[7],p}function za(l){const e=q.c(5),{control:s,fastPreview:n}=l,i=Z();if(!n)return null;let a;e[0]!==i?(a=r=>{const{field:p}=r;return t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"space-y-0.5 min-w-0",children:[t.jsx(ye,{htmlFor:"fast-preview-in-place",className:"font-normal text-foreground",children:i("sandbox.cmsSettings.fastPreviewInPlace.label")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("sandbox.cmsSettings.fastPreviewInPlace.description")})]}),t.jsx(ht,{id:"fast-preview-in-place",className:"shrink-0",checked:!!p.value,onCheckedChange:o=>p.onChange(o)})]})},e[0]=i,e[1]=a):a=e[1];let c;return e[2]!==s||e[3]!==a?(c=t.jsx(be,{control:s,name:"metadata.fastPreviewInPlace",render:a}),e[2]=s,e[3]=a,e[4]=c):c=e[4],c}function Ra(l){const e=q.c(18),{control:s,isBlocksV8:n}=l,i=n===void 0?!1:n,a=Z();let c;e[0]!==a?(c=a("sandbox.previewServerUrlField.label"),e[0]=a,e[1]=c):c=e[1];let r;e[2]!==c?(r=t.jsx(ye,{htmlFor:"preview-server-url",children:c}),e[2]=c,e[3]=r):r=e[3];let p;e[4]!==a?(p=d=>{const{field:x}=d,g=x.value??"";return t.jsx(ke,{id:"preview-server-url",type:"url",inputMode:"url",placeholder:a("sandbox.previewServerUrlField.placeholder"),value:g,onChange:v=>x.onChange(v.target.value===""?null:v.target.value),onBlur:()=>{x.onChange(Ji(g)),x.onBlur()}})},e[4]=a,e[5]=p):p=e[5];let o;e[6]!==s||e[7]!==p?(o=t.jsx(be,{control:s,name:"metadata.previewServerUrl",render:p}),e[6]=s,e[7]=p,e[8]=o):o=e[8];const f=i?"sandbox.previewServerUrlField.descriptionBlocksV8":"sandbox.previewServerUrlField.description";let m;e[9]!==a||e[10]!==f?(m=a(f),e[9]=a,e[10]=f,e[11]=m):m=e[11];let u;e[12]!==m?(u=t.jsx("p",{className:"text-xs text-muted-foreground",children:m}),e[12]=m,e[13]=u):u=e[13];let h;return e[14]!==r||e[15]!==o||e[16]!==u?(h=t.jsxs("div",{className:"space-y-2",children:[r,o,u]}),e[14]=r,e[15]=o,e[16]=u,e[17]=h):h=e[17],h}function La(l){const e=q.c(15),{control:s,isBlocksV8:n,previewServerUrl:i,fastPreview:a}=l,c=Z(),r=n||!!a;let p;e[0]!==s||e[1]!==n?(p=t.jsx(je,{children:t.jsx(Ra,{control:s,isBlocksV8:n})}),e[0]=s,e[1]=n,e[2]=p):p=e[2];let o;e[3]!==s||e[4]!==n||e[5]!==i||e[6]!==c?(o=n?!Ys(i)&&t.jsx(je,{children:t.jsx("p",{className:"text-xs text-muted-foreground",children:c("sandbox.cmsSettings.blocksV8.needsPreviewServerUrl")})}):t.jsx(je,{children:t.jsx(Ea,{control:s,previewServerUrl:i})}),e[3]=s,e[4]=n,e[5]=i,e[6]=c,e[7]=o):o=e[7];let f;e[8]!==s||e[9]!==r?(f=r&&t.jsx(je,{children:t.jsx(za,{control:s,fastPreview:r})}),e[8]=s,e[9]=r,e[10]=f):f=e[10];let m;return e[11]!==p||e[12]!==o||e[13]!==f?(m=t.jsxs(t.Fragment,{children:[p,o,f]}),e[11]=p,e[12]=o,e[13]=f,e[14]=m):m=e[14],m}const St={tools:null,resources:null,prompts:null},Ua=el.pick({status:!0,title:!0,description:!0,icon:!0,metadata:!0,connections:!0});function Ya(l){const s=new TextEncoder().encode(l),n=Array.from(s,i=>String.fromCharCode(i)).join("");return btoa(n)}function sn(l){return{"x-studio-client":l,"x-mesh-client":l}}function Ba(l){const e=q.c(15),{url:s,agentId:n}=l,i=Z(),[a,c]=Q.useState(!1);let r;e[0]!==n||e[1]!==i||e[2]!==s?(r=async()=>{_e("agent_connect_action",{agent_id:n,action:"copy_url"}),await navigator.clipboard.writeText(s),c(!0),oe.success(i("virtualMcp.virtualMcpShareModal.agentUrlCopied")),await vt(2e3),c(!1)},e[0]=n,e[1]=i,e[2]=s,e[3]=r):r=e[3];const p=r;let o;e[4]!==a?(o=a?t.jsx(rt,{size:20,className:"text-success"}):t.jsx(xt,{size:20}),e[4]=a,e[5]=o):o=e[5];let f;e[6]!==a||e[7]!==i?(f=i(a?"virtualMcp.virtualMcpShareModal.copied":"virtualMcp.virtualMcpShareModal.copyUrl"),e[6]=a,e[7]=i,e[8]=f):f=e[8];let m;e[9]!==f?(m=t.jsx("span",{className:"text-xs font-medium",children:f}),e[9]=f,e[10]=m):m=e[10];let u;return e[11]!==p||e[12]!==o||e[13]!==m?(u=t.jsxs(te,{type:"button",variant:"outline",onClick:p,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[o,m]}),e[11]=p,e[12]=o,e[13]=m,e[14]=u):u=e[14],u}function Wa(l){const e=q.c(13),{url:s,serverName:n,agentId:i}=l,a=Z();let c;e[0]!==i||e[1]!==n||e[2]!==a||e[3]!==s?(c=()=>{_e("agent_connect_action",{agent_id:i,action:"install_cursor"});const u=Ws(n),h={type:"http",url:s,headers:sn("Cursor")},d=Ya(JSON.stringify(h,null,2)),x=`cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(u)}&config=${encodeURIComponent(d)}`;window.open(x,"_blank"),oe.success(a("virtualMcp.virtualMcpShareModal.openingCursor"))},e[0]=i,e[1]=n,e[2]=a,e[3]=s,e[4]=c):c=e[4];const r=c;let p;e[5]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("img",{src:"/logos/cursor.svg",alt:"Cursor",className:"h-5 w-5",style:{filter:"brightness(0) saturate(100%) invert(11%) sepia(8%) saturate(785%) hue-rotate(1deg) brightness(95%) contrast(89%)"}}),e[5]=p):p=e[5];let o;e[6]!==a?(o=a("virtualMcp.virtualMcpShareModal.installOnCursor"),e[6]=a,e[7]=o):o=e[7];let f;e[8]!==o?(f=t.jsx("span",{className:"text-xs font-medium",children:o}),e[8]=o,e[9]=f):f=e[9];let m;return e[10]!==r||e[11]!==f?(m=t.jsxs(te,{type:"button",variant:"outline",onClick:r,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[p,f]}),e[10]=r,e[11]=f,e[12]=m):m=e[12],m}function Ka(l){const e=q.c(16),{url:s,serverName:n,agentId:i}=l,a=Z(),[c,r]=Q.useState(!1);let p;e[0]!==i||e[1]!==n||e[2]!==a||e[3]!==s?(p=async()=>{_e("agent_connect_action",{agent_id:i,action:"install_claude_code"});const d=Ws(n),x={type:"http",url:s,headers:sn("Claude Code")},g=JSON.stringify(x,null,2),v=`claude mcp add-json "${d}" '${g.replace(/'/g,"'\\''")}' --scope user`;await navigator.clipboard.writeText(v),r(!0),oe.success(a("virtualMcp.virtualMcpShareModal.claudeCodeCommandCopied")),await vt(2e3),r(!1)},e[0]=i,e[1]=n,e[2]=a,e[3]=s,e[4]=p):p=e[4];const o=p;let f;e[5]!==c?(f=c?t.jsx(rt,{size:20,className:"text-success"}):t.jsx("img",{src:"/logos/Claude Code.svg",alt:"Claude Code",className:"h-5 w-5",style:{filter:"brightness(0) saturate(100%) invert(55%) sepia(31%) saturate(1264%) hue-rotate(331deg) brightness(92%) contrast(86%)"}}),e[5]=c,e[6]=f):f=e[6];let m;e[7]!==c||e[8]!==a?(m=a(c?"virtualMcp.virtualMcpShareModal.copied":"virtualMcp.virtualMcpShareModal.installOnClaudeCode"),e[7]=c,e[8]=a,e[9]=m):m=e[9];let u;e[10]!==m?(u=t.jsx("span",{className:"text-xs font-medium",children:m}),e[10]=m,e[11]=u):u=e[11];let h;return e[12]!==o||e[13]!==f||e[14]!==u?(h=t.jsxs(te,{type:"button",variant:"outline",onClick:o,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[f,u]}),e[12]=o,e[13]=f,e[14]=u,e[15]=h):h=e[15],h}const Ga=720*60*60;function qa({virtualMcp:l}){const e=Z(),s=Tt(),[n,i]=Q.useState(null),[a,c]=Q.useState(!1),[r,p]=Q.useState(!1),o=l.id,f=l.title||`agent-${o.slice(0,8)}`,m=n?`bunx @decocms/typegen@latest --mcp ${o} --key ${n} --output client.ts`:`bunx @decocms/typegen@latest --mcp ${o} --key <api-key> --output client.ts`,u=async()=>{c(!0);try{const{key:d}=await s.call("API_KEY_CREATE",{name:`typegen-${f}`,permissions:{[o]:["*"]},expiresIn:Ga});if(!d)throw new Error("No key in response");i(d),_e("agent_typegen_key_generated",{agent_id:o})}catch{_e("agent_typegen_key_failed",{agent_id:o}),oe.error(e("virtualMcp.virtualMcpShareModal.failedGenerateApiKey"))}finally{c(!1)}},h=async()=>{_e("agent_connect_action",{agent_id:o,action:"typegen_copy_command",has_api_key:!!n}),await navigator.clipboard.writeText(m),p(!0),oe.success(e("virtualMcp.virtualMcpShareModal.commandCopied")),await vt(2e3),p(!1)};return t.jsxs("div",{className:"flex min-w-0 flex-col gap-3",children:[t.jsxs("div",{className:"flex items-start justify-between gap-3",children:[t.jsxs("div",{className:"flex flex-col gap-0.5",children:[t.jsx("h4",{className:"text-sm font-medium text-foreground",children:e("virtualMcp.virtualMcpShareModal.generateTypedClient")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:e("virtualMcp.virtualMcpShareModal.generateTypedClientDescription")})]}),!n&&t.jsxs(te,{type:"button",variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:u,disabled:a,children:[a?t.jsx(it,{className:"size-3.5"}):t.jsx($t,{size:14}),t.jsx("span",{children:e(a?"virtualMcp.virtualMcpShareModal.generating":"virtualMcp.virtualMcpShareModal.generateApiKey")})]})]}),n&&t.jsx("p",{className:"rounded-md border border-warning/20 bg-warning/10 px-3 py-2 text-xs text-warning",children:e("virtualMcp.virtualMcpShareModal.storeKeySecurely")}),t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:e("virtualMcp.virtualMcpShareModal.generateClientLabel")}),t.jsx("div",{className:"rounded-md border border-input bg-muted/50 px-3 py-2.5",children:t.jsxs("div",{className:"flex items-start gap-2",children:[t.jsx("code",{className:"min-w-0 flex-1 break-all font-mono text-xs text-muted-foreground",children:m}),t.jsx(te,{type:"button",variant:"ghost",size:"icon-xs",className:"shrink-0",onClick:h,children:r?t.jsx(rt,{size:12,className:"text-success"}):t.jsx(xt,{size:12})})]})}),t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:e("virtualMcp.virtualMcpShareModal.runtimeVariables")}),t.jsx(Ha,{apiKey:n,agentId:o})]})}function Ha(l){const e=q.c(21),{apiKey:s,agentId:n}=l,[i,a]=Q.useState(!1),c=window.location.origin,r=s?`STUDIO_API_KEY=${s}`:"STUDIO_API_KEY=<api-key>",p=`STUDIO_BASE_URL=${c}`,o=`${r}
|
|
2
|
+
${p}`;let f;e[0]!==n||e[1]!==s||e[2]!==o?(f=async()=>{_e("agent_connect_action",{agent_id:n,action:"typegen_copy_env",has_api_key:!!s}),await navigator.clipboard.writeText(o),a(!0),await vt(2e3),a(!1)},e[0]=n,e[1]=s,e[2]=o,e[3]=f):f=e[3];const m=f,u=!s;let h;e[4]!==u?(h=ve({"opacity-50":u}),e[4]=u,e[5]=h):h=e[5];let d;e[6]!==r||e[7]!==h?(d=t.jsx("span",{className:h,children:r}),e[6]=r,e[7]=h,e[8]=d):d=e[8];let x,g;e[9]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("br",{}),g=t.jsx("span",{children:p}),e[9]=x,e[10]=g):(x=e[9],g=e[10]);let v;e[11]!==d?(v=t.jsxs("code",{className:"min-w-0 flex-1 font-mono text-xs text-muted-foreground",children:[d,x,g]}),e[11]=d,e[12]=v):v=e[12];let y;e[13]!==i?(y=i?t.jsx(rt,{size:12,className:"text-success"}):t.jsx(xt,{size:12}),e[13]=i,e[14]=y):y=e[14];let j;e[15]!==m||e[16]!==y?(j=t.jsx(te,{type:"button",variant:"ghost",size:"icon-xs",className:"shrink-0",onClick:m,children:y}),e[15]=m,e[16]=y,e[17]=j):j=e[17];let b;return e[18]!==v||e[19]!==j?(b=t.jsx("div",{className:"rounded-md border border-input bg-muted/50 px-3 py-2.5",children:t.jsxs("div",{className:"flex items-start gap-2",children:[v,j]})}),e[18]=v,e[19]=j,e[20]=b):b=e[20],b}function Qa(l){const e=q.c(3),{virtualMcp:s}=l;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"h-20 animate-pulse rounded-md bg-muted"}),e[0]=n):n=e[0];let i;return e[1]!==s?(i=t.jsx(Q.Suspense,{fallback:n,children:t.jsx(qa,{virtualMcp:s})}),e[1]=s,e[2]=i):i=e[2],i}function Xa(l){const e=q.c(45),{open:s,onOpenChange:n,virtualMcp:i}=l,a=Z(),{org:c}=Fe(),r=`/api/${c.slug}/mcp/virtual-mcp/${i.id}`;let p;e[0]!==r?(p=new URL(r,window.location.origin),e[0]=r,e[1]=p):p=e[1];const o=p;let f;e[2]!==i.id||e[3]!==i.title?(f=i.title||`agent-${i.id?.slice(0,8)??"default"}`,e[2]=i.id,e[3]=i.title,e[4]=f):f=e[4];const m=f,u=al();let h;e[5]!==i.id||e[6]!==o.href?(h=t.jsx(Ba,{url:o.href,agentId:i.id}),e[5]=i.id,e[6]=o.href,e[7]=h):h=e[7];let d,x;e[8]!==m||e[9]!==i.id||e[10]!==o.href?(d=t.jsx(Wa,{url:o.href,serverName:m,agentId:i.id}),x=t.jsx(Ka,{url:o.href,serverName:m,agentId:i.id}),e[8]=m,e[9]=i.id,e[10]=o.href,e[11]=d,e[12]=x):(d=e[11],x=e[12]);let g;e[13]!==h||e[14]!==d||e[15]!==x?(g=t.jsx("div",{className:"flex flex-col gap-3 pt-2",children:t.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[h,d,x]})}),e[13]=h,e[14]=d,e[15]=x,e[16]=g):g=e[16];let v;e[17]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("div",{className:"border-t border-border"}),e[17]=v):v=e[17];let y;e[18]!==i?(y=t.jsx(Qa,{virtualMcp:i}),e[18]=i,e[19]=y):y=e[19];let j;e[20]!==g||e[21]!==y?(j=t.jsxs("div",{className:"flex flex-col gap-6",children:[g,v,y]}),e[20]=g,e[21]=y,e[22]=j):j=e[22];const b=j;if(u){let C;e[23]!==a?(C=a("virtualMcp.virtualMcpShareModal.connect"),e[23]=a,e[24]=C):C=e[24];let _;e[25]!==C?(_=t.jsx(nl,{className:"mt-4 mb-4 text-base font-semibold",children:C}),e[25]=C,e[26]=_):_=e[26];let T;e[27]!==b||e[28]!==_?(T=t.jsx(il,{children:t.jsxs("div",{className:"flex-1 overflow-y-auto px-4 pb-6 [touch-action:pan-y]",children:[_,b]})}),e[27]=b,e[28]=_,e[29]=T):T=e[29];let V;return e[30]!==n||e[31]!==s||e[32]!==T?(V=t.jsx(ll,{open:s,onOpenChange:n,children:T}),e[30]=n,e[31]=s,e[32]=T,e[33]=V):V=e[33],V}let S;e[34]!==a?(S=a("virtualMcp.virtualMcpShareModal.connect"),e[34]=a,e[35]=S):S=e[35];let N;e[36]!==S?(N=t.jsx(lt,{children:t.jsx(at,{children:S})}),e[36]=S,e[37]=N):N=e[37];let k;e[38]!==b||e[39]!==N?(k=t.jsxs(Je,{className:"max-h-[80vh] overflow-y-auto sm:max-w-2xl",children:[N,b]}),e[38]=b,e[39]=N,e[40]=k):k=e[40];let w;return e[41]!==n||e[42]!==s||e[43]!==k?(w=t.jsx(Xe,{open:s,onOpenChange:n,children:k}),e[41]=n,e[42]=s,e[43]=k,e[44]=w):w=e[44],w}const Ja=/^[A-Za-z_][A-Za-z0-9_]*$/;function Za(l){const e={},s=l.split(/\r?\n/);for(let n=0;n<s.length;n++){let i=(s[n]??"").trim();if(!i||i.startsWith("#"))continue;i.startsWith("export ")&&(i=i.slice(7).trim());const a=i.indexOf("=");if(a<0)throw new Error(`Line ${n+1}: missing '='`);const c=i.slice(0,a).trim();if(!Ja.test(c))throw new Error(`Line ${n+1}: invalid key "${c}"`);let r=i.slice(a+1).trim();r.length>=2&&(r.startsWith('"')&&r.endsWith('"')||r.startsWith("'")&&r.endsWith("'"))&&(r=r.slice(1,-1)),e[c]=r}return e}function er(l){const e=q.c(28),{control:s,form:n,virtualMcpId:i,orgSlug:a,sandboxMap:c}=l,r=Z();let p;e[0]!==r?(p=r("sandbox.envVarsField.title"),e[0]=r,e[1]=p):p=e[1];let o;e[2]!==p?(o=t.jsx("div",{className:"flex items-baseline justify-between gap-2",children:t.jsx(ye,{className:"font-normal text-foreground",children:p})}),e[2]=p,e[3]=o):o=e[3];let f;e[4]!==r?(f=r("sandbox.envVarsField.description"),e[4]=r,e[5]=f):f=e[5];let m;e[6]!==f?(m=t.jsx("p",{className:"text-xs text-muted-foreground",children:f}),e[6]=f,e[7]=m):m=e[7];let u;e[8]!==s||e[9]!==n||e[10]!==a||e[11]!==c||e[12]!==i?(u=t.jsx(tr,{control:s,form:n,virtualMcpId:i,orgSlug:a,sandboxMap:c}),e[8]=s,e[9]=n,e[10]=a,e[11]=c,e[12]=i,e[13]=u):u=e[13];let h;e[14]!==r?(h=y=>{const{error:j}=y;return t.jsx("div",{className:"rounded-md border border-destructive/40 bg-destructive/5 px-3 py-2 text-xs text-destructive",children:j?.message??r("sandbox.envVarsField.failedToLoadSecrets")})},e[14]=r,e[15]=h):h=e[15];let d;e[16]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(xn,{className:"h-9 w-full"}),e[16]=d):d=e[16];let x;e[17]!==s||e[18]!==n?(x=t.jsx(Q.Suspense,{fallback:d,children:t.jsx(nr,{control:s,form:n})}),e[17]=s,e[18]=n,e[19]=x):x=e[19];let g;e[20]!==h||e[21]!==x?(g=t.jsx(Ye,{fallback:h,children:x}),e[20]=h,e[21]=x,e[22]=g):g=e[22];let v;return e[23]!==o||e[24]!==m||e[25]!==u||e[26]!==g?(v=t.jsxs("div",{className:"space-y-2",children:[o,m,u,g]}),e[23]=o,e[24]=m,e[25]=u,e[26]=g,e[27]=v):v=e[27],v}function tr(l){const e=q.c(33),{control:s,form:n,virtualMcpId:i,orgSlug:a,sandboxMap:c}=l,r=Z(),o=gn.useSession().data?.user?.id,f="metadata.runtime.env";let m;e[0]!==n?(m=()=>JSON.stringify(hs(n.getValues(f))),e[0]=n,e[1]=m):m=e[1];const[u,h]=Q.useState(m);let d;e[2]!==s?(d={control:s,name:f},e[2]=s,e[3]=d):d=e[3];const x=ks(d);let g;e[4]!==x?(g=JSON.stringify(hs(x)),e[4]=x,e[5]=g):g=e[5];const v=g,y=v!==u;let j;e[6]!==c||e[7]!==o?(j=o?Object.keys(c?.[o]??{}):[],e[6]=c,e[7]=o,e[8]=j):j=e[8];const b=j,S=b.length>0,[N,k]=Q.useState(!1);if(!y||!S)return null;let w;e[9]!==v||e[10]!==a||e[11]!==r||e[12]!==b||e[13]!==i?(w=async()=>{k(!0);const E=await Promise.allSettled(b.map(async K=>{const Y=rl({orgSlug:a,virtualMcpId:i,branch:K,threadId:null},"setup/start"),B=await fetch(Y,{method:"POST"});if(!B.ok){const z=await B.text().catch(()=>B.statusText);throw new Error(z||B.statusText)}}));k(!1);const U=E.filter(sr).length;U===0?(h(v),oe.success(b.length===1?r("sandbox.envVarsField.restartedSingle"):r("sandbox.envVarsField.restartedMultiple",{count:b.length}))):oe.error(r("sandbox.envVarsField.restartFailed",{failed:U,total:b.length}))},e[9]=v,e[10]=a,e[11]=r,e[12]=b,e[13]=i,e[14]=w):w=e[14];const C=w;let _;e[15]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(ys,{className:"size-3.5 shrink-0"}),e[15]=_):_=e[15];let T;e[16]!==r?(T=r("sandbox.envVarsField.sandboxRunningNotice"),e[16]=r,e[17]=T):T=e[17];let V;e[18]!==T?(V=t.jsxs("div",{className:"flex min-w-0 items-center gap-2 text-warning",children:[_,t.jsx("span",{className:"truncate",children:T})]}),e[18]=T,e[19]=V):V=e[19];let $;e[20]!==N?($=N?t.jsx(it,{className:"size-3.5"}):t.jsx(bn,{className:"size-3.5"}),e[20]=N,e[21]=$):$=e[21];let D;e[22]!==N||e[23]!==r?(D=r(N?"sandbox.envVarsField.restarting":"sandbox.envVarsField.restartDev"),e[22]=N,e[23]=r,e[24]=D):D=e[24];let A;e[25]!==C||e[26]!==N||e[27]!==D||e[28]!==$?(A=t.jsxs(te,{type:"button",variant:"outline",size:"sm",onClick:C,disabled:N,className:"shrink-0",children:[$,D]}),e[25]=C,e[26]=N,e[27]=D,e[28]=$,e[29]=A):A=e[29];let P;return e[30]!==A||e[31]!==V?(P=t.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-md border border-warning/20 bg-warning/10 px-3 py-2 text-xs",children:[V,A]}),e[30]=A,e[31]=V,e[32]=P):P=e[32],P}function sr(l){return l.status==="rejected"}function nr(l){const e=q.c(62),{control:s,form:n}=l,i=Z(),a="metadata.runtime.env";let c;e[0]!==s?(c={control:s,name:a},e[0]=s,e[1]=c):c=e[1];const r=vn(c),{fields:p,append:o,remove:f}=r;let m;e[2]!==n?(m=(Y,B)=>{n.setValue(`${a}.${Y}`,B,{shouldDirty:!0,shouldTouch:!0})},e[2]=n,e[3]=m):m=e[3];const u=m,h=ul();let d;if(e[4]!==h){d=new Map;for(const Y of h)d.set(Y.id,Y);e[4]=h,e[5]=d}else d=e[5];const[x,g]=Q.useState(null);let v;e[6]!==o?(v=()=>{o({key:"",kind:"literal",value:""})},e[6]=o,e[7]=v):v=e[7];const y=v;let j;e[8]!==o||e[9]!==n||e[10]!==i?(j=async()=>{let Y;try{Y=await navigator.clipboard.readText()}catch{oe.error(i("sandbox.envVarsField.clipboardReadFailed"));return}if(!Y.trim()){oe.error(i("sandbox.envVarsField.clipboardEmpty"));return}let B;try{B=Za(Y)}catch(F){const W=F;oe.error(W.message);return}const z=Object.entries(B);if(z.length===0){oe.error(i("sandbox.envVarsField.nothingToAdd"));return}const M=n.getValues(a)??[],O=new Set;for(const F of M){const W=(F.key??"").trim();W&&O.add(W)}let G=0,R=0;for(const[F,W]of z){if(O.has(F)){R++;continue}o({key:F,kind:"literal",value:W}),O.add(F),G++}G===0&&R>0?oe.message(i("sandbox.envVarsField.allKeysExist",{count:R})):oe.success(R>0?i("sandbox.envVarsField.addedWithSkipped",{added:G,skipped:R}):i("sandbox.envVarsField.added",{added:G}))},e[8]=o,e[9]=n,e[10]=i,e[11]=j):j=e[11];const b=j;let S;if(e[12]!==s||e[13]!==p||e[14]!==n||e[15]!==f||e[16]!==d||e[17]!==h||e[18]!==u){let Y;e[20]!==s||e[21]!==n||e[22]!==f||e[23]!==d||e[24]!==h||e[25]!==u?(Y=(B,z)=>t.jsx("li",{className:"rounded-md border border-border bg-background",children:t.jsx(ir,{index:z,control:s,form:n,onUpdateEntry:u,fieldPath:a,secrets:h,secretById:d,onSaveAsSecret:(M,O)=>g({kind:"save-literal",index:z,presetKey:M,presetValue:O}),onCreateNewSecret:M=>g({kind:"create-new",index:z,presetKey:M}),onRemove:()=>f(z)})},B.id),e[20]=s,e[21]=n,e[22]=f,e[23]=d,e[24]=h,e[25]=u,e[26]=Y):Y=e[26],S=p.map(Y),e[12]=s,e[13]=p,e[14]=n,e[15]=f,e[16]=d,e[17]=h,e[18]=u,e[19]=S}else S=e[19];let N;e[27]!==S?(N=t.jsx("ul",{className:"space-y-2",children:S}),e[27]=S,e[28]=N):N=e[28];let k;e[29]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(Pe,{className:"size-3.5"}),e[29]=k):k=e[29];let w;e[30]!==i?(w=i("sandbox.envVarsField.addEnvVar"),e[30]=i,e[31]=w):w=e[31];let C;e[32]!==y||e[33]!==w?(C=t.jsxs(te,{type:"button",variant:"outline",size:"sm",onClick:y,className:"flex-1",children:[k,w]}),e[32]=y,e[33]=w,e[34]=C):C=e[34];let _;e[35]!==i?(_=i("sandbox.envVarsField.pasteDotenvAriaLabel"),e[35]=i,e[36]=_):_=e[36];let T;e[37]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(fi,{className:"size-3.5"}),e[37]=T):T=e[37];let V;e[38]!==i?(V=i("sandbox.envVarsField.pasteDotenv"),e[38]=i,e[39]=V):V=e[39];let $;e[40]!==b||e[41]!==_||e[42]!==V?($=t.jsx(Ne,{asChild:!0,children:t.jsxs(te,{type:"button",variant:"outline",size:"sm",onClick:b,"aria-label":_,children:[T,V]})}),e[40]=b,e[41]=_,e[42]=V,e[43]=$):$=e[43];let D;e[44]!==i?(D=i("sandbox.envVarsField.pasteDotenvTooltip"),e[44]=i,e[45]=D):D=e[45];let A;e[46]!==D?(A=t.jsx(Ce,{children:D}),e[46]=D,e[47]=A):A=e[47];let P;e[48]!==$||e[49]!==A?(P=t.jsxs(Se,{children:[$,A]}),e[48]=$,e[49]=A,e[50]=P):P=e[50];let E;e[51]!==P||e[52]!==C?(E=t.jsxs("div",{className:"flex items-center gap-2",children:[C,P]}),e[51]=P,e[52]=C,e[53]=E):E=e[53];let U;e[54]!==x||e[55]!==n||e[56]!==u?(U=x!==null?t.jsx(ar,{mode:x,onClose:()=>g(null),onSaved:Y=>{const B=n.getValues(`${a}.${x.index}.key`)?.trim()??"";u(x.index,{key:B,kind:"secret",secretId:Y}),g(null)}}):null,e[54]=x,e[55]=n,e[56]=u,e[57]=U):U=e[57];let K;return e[58]!==E||e[59]!==U||e[60]!==N?(K=t.jsxs("div",{className:"space-y-2",children:[N,E,U]}),e[58]=E,e[59]=U,e[60]=N,e[61]=K):K=e[61],K}function ir(l){const e=q.c(77),{index:s,control:n,form:i,onUpdateEntry:a,fieldPath:c,secrets:r,secretById:p,onSaveAsSecret:o,onCreateNewSecret:f,onRemove:m}=l,u=Z(),h=`${c}.${s}.key`,d=`${c}.${s}.value`,x=`${c}.${s}.secretId`,g=`${c}.${s}.kind`;let v;e[0]!==n||e[1]!==g?(v={control:n,name:g},e[0]=n,e[1]=g,e[2]=v):v=e[2];const j=ks(v)==="secret"?"secret":"literal";let b;e[3]!==i||e[4]!==s||e[5]!==h||e[6]!==o||e[7]!==a||e[8]!==d?(b=W=>{const H=i.getValues(h)?.trim()??"";if(W==="literal"){a(s,{key:H,kind:"literal",value:""});return}const se=i.getValues(d)??"";if(se.length>0){o(H,se);return}a(s,{key:H,kind:"secret",secretId:""})},e[3]=i,e[4]=s,e[5]=h,e[6]=o,e[7]=a,e[8]=d,e[9]=b):b=e[9];const S=b;let N;e[10]!==s||e[11]!==u?(N=W=>{const{field:H}=W,se=(H.value??"").trim(),le=se.length>0&&!gt.test(se);return t.jsxs("div",{className:"space-y-1",children:[t.jsx(ke,{...H,value:H.value??"",placeholder:u("sandbox.envVarsField.keyPlaceholder"),spellCheck:!1,autoComplete:"off",autoCapitalize:"off",autoCorrect:"off",className:ve("font-mono",le&&"border-destructive focus-visible:ring-destructive"),"aria-invalid":le,"aria-label":u("sandbox.envVarsField.envVarKeyLabel",{index:s+1}),onBlur:ce=>{const ae=ce.target.value.trim();H.onChange(ae),H.onBlur()}}),le?t.jsx("p",{className:"text-2xs text-destructive",children:u("sandbox.envVarsField.invalidKeyMessage")}):null]})},e[10]=s,e[11]=u,e[12]=N):N=e[12];let k;e[13]!==n||e[14]!==h||e[15]!==N?(k=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx(be,{control:n,name:h,render:N})}),e[13]=n,e[14]=h,e[15]=N,e[16]=k):k=e[16];let w;e[17]!==S?(w=W=>S(W),e[17]=S,e[18]=w):w=e[18];let C;e[19]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(Oe,{className:"h-9 w-[110px]",children:t.jsx(Ie,{})}),e[19]=C):C=e[19];let _;e[20]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx($t,{className:"size-3.5"}),e[20]=_):_=e[20];let T;e[21]!==u?(T=u("sandbox.envVarsField.literal"),e[21]=u,e[22]=T):T=e[22];let V;e[23]!==T?(V=t.jsx(we,{value:"literal",children:t.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[_,T]})}),e[23]=T,e[24]=V):V=e[24];let $;e[25]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(jn,{className:"size-3.5"}),e[25]=$):$=e[25];let D;e[26]!==u?(D=u("sandbox.envVarsField.secret"),e[26]=u,e[27]=D):D=e[27];let A;e[28]!==D?(A=t.jsx(we,{value:"secret",children:t.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[$,D]})}),e[28]=D,e[29]=A):A=e[29];let P;e[30]!==A||e[31]!==V?(P=t.jsxs(Ae,{children:[V,A]}),e[30]=A,e[31]=V,e[32]=P):P=e[32];let E;e[33]!==j||e[34]!==P||e[35]!==w?(E=t.jsx("div",{className:"shrink-0",children:t.jsxs($e,{value:j,onValueChange:w,children:[C,P]})}),e[33]=j,e[34]=P,e[35]=w,e[36]=E):E=e[36];let U;e[37]!==n||e[38]!==i||e[39]!==s||e[40]!==h||e[41]!==j||e[42]!==f||e[43]!==p||e[44]!==x||e[45]!==r||e[46]!==u||e[47]!==d?(U=t.jsx("div",{className:"flex flex-[2] min-w-0 items-center gap-1",children:j==="literal"?t.jsx(be,{control:n,name:d,render:W=>{const{field:H}=W;return t.jsx(ke,{...H,value:H.value??"",type:"password",placeholder:u("sandbox.envVarsField.valuePlaceholder"),spellCheck:!1,autoComplete:"off",className:"font-mono","aria-label":u("sandbox.envVarsField.envVarValueLabel",{index:s+1}),onBlur:se=>{H.onChange(se.target.value),H.onBlur()}})}}):t.jsxs(t.Fragment,{children:[t.jsx(be,{control:n,name:x,render:W=>{const{field:H}=W;return t.jsxs($e,{value:H.value||"",onValueChange:se=>H.onChange(se),children:[t.jsx(Oe,{className:ve("h-9 w-full",!H.value&&"text-muted-foreground"),"aria-label":u("sandbox.envVarsField.secretAriaLabel",{index:s+1}),children:t.jsx(Ie,{placeholder:u("sandbox.envVarsField.pickSecretPlaceholder"),children:t.jsx(ol,{field:H,secretById:p})})}),t.jsx(Ae,{children:r.length===0?t.jsx("div",{className:"px-2 py-2 text-xs text-muted-foreground",children:u("sandbox.envVarsField.noSecretsYet")}):r.map(lr)})]})}}),t.jsxs(Se,{children:[t.jsx(Ne,{asChild:!0,children:t.jsx(te,{type:"button",variant:"ghost",size:"icon","aria-label":u("sandbox.envVarsField.createNewSecretAriaLabel"),onClick:()=>{const W=i.getValues(h)?.trim()??"";f(W)},children:t.jsx(Pe,{className:"size-3.5"})})}),t.jsx(Ce,{children:u("sandbox.envVarsField.createNewSecret")})]})]})}),e[37]=n,e[38]=i,e[39]=s,e[40]=h,e[41]=j,e[42]=f,e[43]=p,e[44]=x,e[45]=r,e[46]=u,e[47]=d,e[48]=U):U=e[48];let K;e[49]!==i||e[50]!==h||e[51]!==j||e[52]!==o||e[53]!==u||e[54]!==d?(K=j==="literal"?t.jsxs(Se,{children:[t.jsx(Ne,{asChild:!0,children:t.jsx(te,{type:"button",variant:"ghost",size:"icon","aria-label":u("sandbox.envVarsField.saveAsSecretAriaLabel"),onClick:()=>{const W=i.getValues(h)?.trim()??"",H=i.getValues(d)??"";o(W,H)},children:t.jsx(pi,{className:"size-3.5"})})}),t.jsx(Ce,{children:u("sandbox.envVarsField.saveAsSecret")})]}):null,e[49]=i,e[50]=h,e[51]=j,e[52]=o,e[53]=u,e[54]=d,e[55]=K):K=e[55];let Y;e[56]!==u?(Y=u("sandbox.envVarsField.removeEnvVarAriaLabel"),e[56]=u,e[57]=Y):Y=e[57];let B;e[58]===Symbol.for("react.memo_cache_sentinel")?(B=t.jsx(It,{className:"size-3.5"}),e[58]=B):B=e[58];let z;e[59]!==m||e[60]!==Y?(z=t.jsx(Ne,{asChild:!0,children:t.jsx(te,{type:"button",variant:"ghost",size:"icon","aria-label":Y,onClick:m,children:B})}),e[59]=m,e[60]=Y,e[61]=z):z=e[61];let M;e[62]!==u?(M=u("sandbox.envVarsField.remove"),e[62]=u,e[63]=M):M=e[63];let O;e[64]!==M?(O=t.jsx(Ce,{children:M}),e[64]=M,e[65]=O):O=e[65];let G;e[66]!==z||e[67]!==O?(G=t.jsxs(Se,{children:[z,O]}),e[66]=z,e[67]=O,e[68]=G):G=e[68];let R;e[69]!==K||e[70]!==G?(R=t.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[K,G]}),e[69]=K,e[70]=G,e[71]=R):R=e[71];let F;return e[72]!==E||e[73]!==U||e[74]!==R||e[75]!==k?(F=t.jsxs("div",{className:"flex flex-col gap-2 p-2 sm:flex-row sm:items-center",children:[k,E,U,R]}),e[72]=E,e[73]=U,e[74]=R,e[75]=k,e[76]=F):F=e[76],F}function lr(l){return t.jsx(we,{value:l.id,children:t.jsxs("span",{className:"inline-flex items-center gap-2",children:[t.jsx(dl,{scope:l.scope}),t.jsx("span",{className:"font-mono",children:l.name})]})},l.id)}function ar({mode:l,onClose:e,onSaved:s}){const n=Z(),i=l.kind==="save-literal"?l.presetValue:"",a=l.presetKey,[c,r]=Q.useState(()=>rr(a)),[p,o]=Q.useState("organization"),[f,m]=Q.useState(i),[u,h]=Q.useState(""),d=ml(),x=c.trim(),g=f.length>0&&x.length>0&&cl.test(x),v=async b=>{if(b.preventDefault(),!!g)try{const S=await d.mutateAsync({scope:p,name:x,value:f,description:u.trim()||void 0});oe.success(n("sandbox.envVarsField.secretSaved",{name:S.name})),s(S.id)}catch(S){oe.error(S instanceof Error?S.message:n("sandbox.envVarsField.failedToSaveSecret"))}},y=l.kind==="save-literal"?n("sandbox.envVarsField.saveValueAsSecretTitle"):n("sandbox.envVarsField.createNewSecretTitle"),j=l.kind==="save-literal"?n("sandbox.envVarsField.saveValueAsSecretDescription"):n("sandbox.envVarsField.createNewSecretDescription");return t.jsx(Xe,{open:!0,onOpenChange:b=>{b||e()},children:t.jsxs(Je,{className:"sm:max-w-md",children:[t.jsxs(lt,{children:[t.jsx(at,{children:y}),t.jsx(Cs,{children:j})]}),t.jsxs("form",{onSubmit:v,className:"space-y-4",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(ye,{htmlFor:"save-secret-scope",children:n("sandbox.envVarsField.scopeLabel")}),t.jsxs($e,{value:p,onValueChange:b=>o(b),children:[t.jsx(Oe,{id:"save-secret-scope",children:t.jsx(Ie,{})}),t.jsxs(Ae,{children:[t.jsx(we,{value:"organization",children:n("sandbox.envVarsField.scopeOrganization")}),t.jsx(we,{value:"user",children:n("sandbox.envVarsField.scopePrivate")})]})]})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(ye,{htmlFor:"save-secret-name",children:n("sandbox.envVarsField.nameLabel")}),t.jsx(ke,{id:"save-secret-name",value:c,onChange:b=>r(b.target.value),placeholder:n("sandbox.envVarsField.namePlaceholder"),autoComplete:"off",required:!0}),t.jsx("p",{className:"text-xs text-muted-foreground",children:n("sandbox.envVarsField.nameHelperText")})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(ye,{htmlFor:"save-secret-value",children:n("sandbox.envVarsField.valueLabel")}),t.jsx(ke,{id:"save-secret-value",type:"password",value:f,onChange:b=>m(b.target.value),placeholder:n("sandbox.envVarsField.secretValuePlaceholder"),autoComplete:"new-password",required:!0})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(ye,{htmlFor:"save-secret-description",children:n("sandbox.envVarsField.descriptionLabel")}),t.jsx(ut,{id:"save-secret-description",value:u,onChange:b=>h(b.target.value),rows:2,placeholder:n("sandbox.envVarsField.descriptionPlaceholder")})]}),t.jsxs(Vt,{children:[t.jsx(te,{type:"button",variant:"outline",onClick:e,disabled:d.isPending,children:n("sandbox.envVarsField.cancel")}),t.jsx(te,{type:"submit",disabled:!g||d.isPending,children:d.isPending?n("sandbox.envVarsField.saving"):n("sandbox.envVarsField.saveSecret")})]})]})]})})}function hs(l){if(!Array.isArray(l))return[];const e=[];for(const s of l){if(!s||typeof s!="object")continue;const n=s,i=(n.key??"").trim();if(!(!i||!gt.test(i))){if(n.kind==="literal"){e.push({key:i,kind:"literal",value:n.value??""});continue}n.kind==="secret"&&n.secretId&&e.push({key:i,kind:"secret",secretId:n.secretId})}}return e}function rr(l){const e=l.trim();return e&>.test(e)?e:""}function or(l){const e=q.c(21),{repo:s,className:n}=l,i=Z();let a;e[0]!==n?(a=ve("space-y-2",n),e[0]=n,e[1]=a):a=e[1];let c;e[2]!==i?(c=i("sandbox.repoRow.label"),e[2]=i,e[3]=c):c=e[3];let r;e[4]!==c?(r=t.jsx(ye,{children:c}),e[4]=c,e[5]=r):r=e[5];let p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(fl,{size:20,className:"shrink-0 text-foreground/60"}),e[6]=p):p=e[6];let o;e[7]!==s||e[8]!==i?(o=t.jsx(Ne,{asChild:!0,children:t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-border bg-background px-4 py-3",tabIndex:0,children:[p,t.jsx("div",{className:"min-w-0 flex-1",children:s?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"truncate text-sm font-medium",children:[s.owner,"/",s.name]}),t.jsx("div",{className:"truncate text-xs text-muted-foreground",children:s.url})]}):t.jsx("div",{className:"text-sm text-muted-foreground",children:i("sandbox.repoRow.noRepositoryConnected")})})]})}),e[7]=s,e[8]=i,e[9]=o):o=e[9];let f;e[10]!==i?(f=i("sandbox.repoRow.tooltipContent"),e[10]=i,e[11]=f):f=e[11];let m;e[12]!==f?(m=t.jsx(Ce,{children:f}),e[12]=f,e[13]=m):m=e[13];let u;e[14]!==o||e[15]!==m?(u=t.jsxs(Se,{children:[o,m]}),e[14]=o,e[15]=m,e[16]=u):u=e[16];let h;return e[17]!==a||e[18]!==r||e[19]!==u?(h=t.jsxs("div",{className:a,children:[r,u]}),e[17]=a,e[18]=r,e[19]=u,e[20]=h):h=e[20],h}const cr={npm:{install:"npm install",run:l=>`npm run ${l}`,runtime:"node"},pnpm:{install:"pnpm install",run:l=>`pnpm run ${l}`,runtime:"node"},yarn:{install:"yarn install",run:l=>`yarn run ${l}`,runtime:"node"},bun:{install:"bun install",run:l=>`bun run ${l}`,runtime:"bun"},deno:{install:"deno install",run:l=>`deno task ${l}`,runtime:"deno"}};function dr(l){const e=l.trim();if(e==="")return{ok:!0,value:null};if(!/^\d+$/.test(e))return{ok:!1};const s=Number(e);return s<1||s>65535?{ok:!1}:{ok:!0,value:String(s)}}const ur=Object.keys(cr),Nt="__none__";function mr(l){const e=q.c(47),{control:s}=l,n=Z(),i=Q.useRef(null);let a;e[0]!==n?(a=n("sandbox.runtimeFields.packageManager"),e[0]=n,e[1]=a):a=e[1];let c;e[2]!==a?(c=t.jsx(ye,{htmlFor:"runtime-pm",children:a}),e[2]=a,e[3]=c):c=e[3];let r;e[4]!==n?(r=w=>{const{field:C}=w;return t.jsxs($e,{value:C.value??Nt,onValueChange:_=>C.onChange(_===Nt?null:_),children:[t.jsx(Oe,{id:"runtime-pm",children:t.jsx(Ie,{placeholder:n("sandbox.runtimeFields.autoDetect")})}),t.jsxs(Ae,{children:[t.jsx(we,{value:Nt,children:n("sandbox.runtimeFields.autoDetect")}),ur.map(pr)]})]})},e[4]=n,e[5]=r):r=e[5];let p;e[6]!==s||e[7]!==r?(p=t.jsx(be,{control:s,name:"metadata.runtime.selected",render:r}),e[6]=s,e[7]=r,e[8]=p):p=e[8];let o;e[9]!==c||e[10]!==p?(o=t.jsxs("div",{className:"space-y-2",children:[c,p]}),e[9]=c,e[10]=p,e[11]=o):o=e[11];let f;e[12]!==n?(f=n("sandbox.runtimeFields.packagePath"),e[12]=n,e[13]=f):f=e[13];let m;e[14]!==f?(m=t.jsx(ye,{htmlFor:"runtime-path",children:f}),e[14]=f,e[15]=m):m=e[15];let u;e[16]!==s?(u=t.jsx(be,{control:s,name:"metadata.runtime.path",render:fr}),e[16]=s,e[17]=u):u=e[17];let h;e[18]!==n?(h=n("sandbox.runtimeFields.packagePathDescription"),e[18]=n,e[19]=h):h=e[19];let d;e[20]!==h?(d=t.jsx("p",{className:"text-xs text-muted-foreground",children:h}),e[20]=h,e[21]=d):d=e[21];let x;e[22]!==d||e[23]!==m||e[24]!==u?(x=t.jsxs("div",{className:"space-y-2",children:[m,u,d]}),e[22]=d,e[23]=m,e[24]=u,e[25]=x):x=e[25];let g;e[26]!==n?(g=n("sandbox.runtimeFields.devServerPort"),e[26]=n,e[27]=g):g=e[27];let v;e[28]!==g?(v=t.jsx(ye,{htmlFor:"runtime-port",children:g}),e[28]=g,e[29]=v):v=e[29];let y;e[30]!==n?(y=w=>{const{field:C}=w;return t.jsx(ke,{ref:i,id:"runtime-port",inputMode:"numeric",placeholder:n("sandbox.runtimeFields.auto"),defaultValue:C.value??"",onBlur:_=>{const T=dr(_.target.value);T.ok?C.onChange(T.value):i.current&&(i.current.value=C.value??"")}})},e[30]=n,e[31]=y):y=e[31];let j;e[32]!==s||e[33]!==y?(j=t.jsx(be,{control:s,name:"metadata.runtime.port",render:y}),e[32]=s,e[33]=y,e[34]=j):j=e[34];let b;e[35]!==n?(b=n("sandbox.runtimeFields.devServerPortDescription"),e[35]=n,e[36]=b):b=e[36];let S;e[37]!==b?(S=t.jsx("p",{className:"text-xs text-muted-foreground",children:b}),e[37]=b,e[38]=S):S=e[38];let N;e[39]!==v||e[40]!==j||e[41]!==S?(N=t.jsxs("div",{className:"space-y-2",children:[v,j,S]}),e[39]=v,e[40]=j,e[41]=S,e[42]=N):N=e[42];let k;return e[43]!==x||e[44]!==N||e[45]!==o?(k=t.jsxs("div",{className:"space-y-5",children:[o,x,N]}),e[43]=x,e[44]=N,e[45]=o,e[46]=k):k=e[46],k}function fr(l){const{field:e}=l;return t.jsx(ke,{id:"runtime-path",placeholder:".",defaultValue:e.value??"",onBlur:s=>{const n=s.target.value.trim();e.onChange(n===""?null:n)}})}function pr(l){return t.jsx(we,{value:l,children:l},l)}function hr(l){const e=q.c(5),{control:s}=l,n=Z();let i;e[0]!==n?(i=c=>{const{field:r}=c;return t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"space-y-0.5 min-w-0",children:[t.jsx(ye,{htmlFor:"field-description-tooltips",className:"font-normal text-foreground",children:n("sandbox.fieldDescriptionTooltipsField.label")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:n("sandbox.fieldDescriptionTooltipsField.description")})]}),t.jsx(ht,{id:"field-description-tooltips",className:"shrink-0",checked:r.value??!1,onCheckedChange:p=>r.onChange(p)})]})},e[0]=n,e[1]=i):i=e[1];let a;return e[2]!==s||e[3]!==i?(a=t.jsx(be,{control:s,name:"metadata.fieldDescriptionTooltips",render:i}),e[2]=s,e[3]=i,e[4]=a):a=e[4],a}function xr(l){const e=q.c(32),{control:s,onCommit:n}=l,i=Z();let a;e[0]!==i?(a=i("virtualMcp.virtualMcp.publishPolicySmart"),e[0]=i,e[1]=a):a=e[1];let c;e[2]!==i?(c=i("virtualMcp.virtualMcp.publishPolicySmartDescription"),e[2]=i,e[3]=c):c=e[3];let r;e[4]!==a||e[5]!==c?(r={value:"smart",label:a,description:c},e[4]=a,e[5]=c,e[6]=r):r=e[6];let p;e[7]!==i?(p=i("virtualMcp.virtualMcp.publishPolicyCodeReview"),e[7]=i,e[8]=p):p=e[8];let o;e[9]!==i?(o=i("virtualMcp.virtualMcp.publishPolicyCodeReviewDescription"),e[9]=i,e[10]=o):o=e[10];let f;e[11]!==p||e[12]!==o?(f={value:"code-review",label:p,description:o},e[11]=p,e[12]=o,e[13]=f):f=e[13];let m;e[14]!==i?(m=i("virtualMcp.virtualMcp.publishPolicyOpen"),e[14]=i,e[15]=m):m=e[15];let u;e[16]!==i?(u=i("virtualMcp.virtualMcp.publishPolicyOpenDescription"),e[16]=i,e[17]=u):u=e[17];let h;e[18]!==m||e[19]!==u?(h={value:"open",label:m,description:u},e[18]=m,e[19]=u,e[20]=h):h=e[20];let d;e[21]!==r||e[22]!==f||e[23]!==h?(d=[r,f,h],e[21]=r,e[22]=f,e[23]=h,e[24]=d):d=e[24];const x=d;let g;e[25]!==n||e[26]!==x||e[27]!==i?(g=y=>{const{field:j}=y,b=j.value??"smart";return t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"space-y-0.5 min-w-0",children:[t.jsx(ye,{htmlFor:"publish-policy",className:"font-normal text-foreground",children:i("virtualMcp.virtualMcp.publishing")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("virtualMcp.virtualMcp.publishingDescription")})]}),t.jsxs($e,{value:b,onValueChange:S=>{j.onChange(S),n()},children:[t.jsx(Oe,{id:"publish-policy",className:"w-44 shrink-0",children:t.jsx(Ie,{})}),t.jsx(Ae,{className:"max-w-80",children:x.map(gr)})]})]})},e[25]=n,e[26]=x,e[27]=i,e[28]=g):g=e[28];let v;return e[29]!==s||e[30]!==g?(v=t.jsx(be,{name:"metadata.publishPolicy",control:s,render:g}),e[29]=s,e[30]=g,e[31]=v):v=e[31],v}function gr(l){return t.jsx(we,{value:l.value,description:l.description,children:l.label},l.value)}function vr(l){const e=q.c(24),{control:s,onCommit:n}=l,i=Z();let a;e[0]!==i?(a=i("sandbox.cmsSettings.contentEditing.off"),e[0]=i,e[1]=a):a=e[1];let c;e[2]!==i?(c=i("sandbox.cmsSettings.contentEditing.offDescription"),e[2]=i,e[3]=c):c=e[3];let r;e[4]!==a||e[5]!==c?(r={value:"off",label:a,description:c},e[4]=a,e[5]=c,e[6]=r):r=e[6];let p;e[7]!==i?(p=i("sandbox.cmsSettings.contentEditing.on"),e[7]=i,e[8]=p):p=e[8];let o;e[9]!==i?(o=i("sandbox.cmsSettings.contentEditing.onDescription"),e[9]=i,e[10]=o):o=e[10];let f;e[11]!==p||e[12]!==o?(f={value:"on",label:p,description:o},e[11]=p,e[12]=o,e[13]=f):f=e[13];let m;e[14]!==r||e[15]!==f?(m=[r,f],e[14]=r,e[15]=f,e[16]=m):m=e[16];const u=m;let h;e[17]!==n||e[18]!==u||e[19]!==i?(h=x=>{const{field:g}=x,v=g.value??null,y=Bs(v);return t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"space-y-0.5 min-w-0",children:[t.jsx(ye,{htmlFor:"content-editing-mode",className:"font-normal text-foreground",children:i("sandbox.cmsSettings.contentEditing.title")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("sandbox.cmsSettings.contentEditing.description")})]}),t.jsxs($e,{value:y,onValueChange:j=>{const b=tl.safeParse(j);b.success&&(g.onChange(sl(v,b.data)),n())},children:[t.jsx(Oe,{id:"content-editing-mode",className:"w-44 shrink-0",children:t.jsx(Ie,{})}),t.jsx(Ae,{className:"max-w-80",children:u.map(br)})]})]})},e[17]=n,e[18]=u,e[19]=i,e[20]=h):h=e[20];let d;return e[21]!==s||e[22]!==h?(d=t.jsx(be,{name:"metadata.ui.layout",control:s,render:h}),e[21]=s,e[22]=h,e[23]=d):d=e[23],d}function br(l){return t.jsx(we,{value:l.value,description:l.description,children:l.label},l.value)}function xs(l){const e=l.metadata?.sidebarViews,s=l.metadata?.sidebarViewsVersion;return{effectiveViews:[...Mt(_t(l.metadata),s)],rawViews:e===null?null:e?[...e]:void 0,version:s}}function jr(l,e){return l===e?!0:!l||!e||l.length!==e.length?!1:l.every((s,n)=>s===e[n])}function yr(l,e){switch(e.type){case"SET_SHARE_DIALOG_OPEN":return{...l,shareDialogOpen:e.payload};case"SET_ADD_DIALOG_OPEN":return{...l,addDialogOpen:e.payload};case"OPEN_SETTINGS":return{...l,settingsDialogOpen:!0,settingsConnectionId:e.payload};case"CLOSE_SETTINGS":return{...l,settingsDialogOpen:!1,settingsConnectionId:null};default:return l}}function wr(l,e){switch(e.type){case"accumulate":{const s=l??{start:e.now,fields:new Set,saveCount:0,instructionsLength:null},n=new Set(s.fields);for(const i of e.fields)n.add(i);return{...s,fields:n,saveCount:s.saveCount+1,instructionsLength:e.instructionsLength??s.instructionsLength}}case"reset":return null}}function Sr(l){const e=l.metadata?.runtime?.env;if(!e||e.length===0)return l;const s=e.filter(n=>{if(!n||typeof n!="object")return!1;const i=(n.key??"").trim();return!i||!gt.test(i)?!1:n.kind==="literal"?!0:n.kind==="secret"?!!n.secretId:!1});return s.length===e.length?l:{...l,metadata:{...l.metadata,runtime:{...l.metadata?.runtime??{},env:s}}}}async function Nr(l,e){const s=l?.idToken??null;if(s){const i=gs(s);if(i)return i}const n=l?.userinfoEndpoint??null;if(n)try{const i=await fetch(n,{headers:{Authorization:`Bearer ${e}`}});if(i.ok){const a=await i.json(),c=typeof a.email=="string"?a.email:typeof a.upn=="string"?a.upn:typeof a.preferred_username=="string"?a.preferred_username:null;if(c)return c}}catch{}return gs(e)}function gs(l){try{const e=l.split(".");if(e.length===3&&e[1]){const s=JSON.parse(atob(e[1].replace(/-/g,"+").replace(/_/g,"/")));if(typeof s.email=="string")return s.email;if(typeof s.upn=="string")return s.upn;if(typeof s.preferred_username=="string")return s.preferred_username}}catch{}return null}function Cr({virtualMcp:l,contextSection:e}){const s=Z(),n=In(),{org:i}=Fe(),a=Gn(),{data:c}=qn([l.id]),r=c?.get(l.id)?.last_used_at,p=Ms(),o=Ns(),f=Tt(),m=Us(l.id),u=JSON.stringify([i.id,l.id]),h=Yi(l.metadata,m.snapshot()),d=yn({resolver:wn(Ua),defaultValues:{...l,metadata:{...ss(l.metadata),previewServerUrl:Zi(l.metadata),...h}}}),x=d.watch("connections"),g=Pi(l),v=Ls(l?.metadata),y=v&&Bs(d.watch("metadata.ui.layout"))==="off",j=Vs(l),b=j?{owner:j.owner,name:j.name,url:j.url}:null,[S,N]=Q.useReducer(yr,{shareDialogOpen:!1,addDialogOpen:!1,settingsDialogOpen:!1,settingsConnectionId:null}),[k,w]=Q.useState(!1),[C,_]=Q.useState(!1),{openSidePanel:T}=Dn(),{sendMessage:V}=Mn(),$=async()=>{if(C)return;const L=d.getValues("metadata.instructions");if(L?.trim()){_(!0);try{U(),_e("agent_instructions_improve_clicked",{agent_id:l.id,instructions_length:L.length}),T();const ee=Cn(i.id);await V({tiptapDoc:Vn({managerAgentId:ee.id,managerName:ee.title,kind:"agent",id:l.id,instructions:L})})}finally{_(!1)}}},[D,A]=Q.useReducer(wr,null),P=()=>{D!==null&&(_e("agent_updated",{agent_id:l.id,fields:Array.from(D.fields),instructions_length:D.instructionsLength,save_count:D.saveCount,edit_duration_ms:Date.now()-D.start}),A({type:"reset"}))},{schedule:E,flush:U}=Jt({delayMs:3e4,save:async()=>P()}),K=async()=>{const L=m.snapshot(),ee={predicate:Ve=>ts(Ve.queryKey,i.id)},J=async()=>(await o.invalidateQueries({predicate:Ve=>ts(Ve.queryKey,i.id),refetchType:"all"}),es(o,i.id,l.id)),pe=(Ve,Ge)=>{if(Ve){jr(d.getValues("metadata.sidebarViews"),Ve.rawViews)||d.setValue("metadata.sidebarViews",Ve.rawViews,{shouldDirty:!1}),d.getValues("metadata.sidebarViewsVersion")!==Ve.version&&d.setValue("metadata.sidebarViewsVersion",Ve.version,{shouldDirty:!1});return}Ge!==null&&(d.setValue("metadata.sidebarViews",[...Ge],{shouldDirty:!1}),d.setValue("metadata.sidebarViewsVersion",Li,{shouldDirty:!1}))},Me=Bi(L),Te=Object.keys(d.control._formState.dirtyFields);if(Te.length===0&&!Me){await m.settle({snapshot:L,saved:!0,authoritativeViews:L?.persistedViews});return}const We=Te.length>0?Te:["metadata"],ot=We.includes("metadata"),Ke=d.getValues();d.reset(Ke,{keepValues:!0});const et=Sr(Ke),nn=es(o,i.id,l.id),ln=Wi({sidebarViews:et.metadata?.sidebarViews,sidebarViewsVersion:et.metadata?.sidebarViewsVersion},L,nn?.metadata);et.metadata={...ss(et.metadata),...ln};let bt;try{bt=await a.update.mutateAsync({id:l.id,data:et})}catch(Ve){let Ge=null;try{Ge=await J()}catch{}const Rt=Ge?xs(Ge):null,Lt=await m.settle({snapshot:L,saved:!1,authoritativeViews:Rt?.effectiveViews});throw Lt.settledLatest&&pe(Rt,Lt.reconciledViews),Ve}await o.cancelQueries(ee),Ki(o,i.id,bt);const Et=xs(bt),zt=await m.settle({snapshot:L,saved:!0,authoritativeViews:Et.effectiveViews});zt.settledLatest&&pe(Et,zt.reconciledViews),A({type:"accumulate",now:Date.now(),fields:We,instructionsLength:ot?Ke.metadata?.instructions?.length??0:null}),E()},Y=()=>pl(u,K),{schedule:B,flush:z}=Jt({save:Y});Q.useEffect(()=>{const L=d.watch(()=>B());return()=>L.unsubscribe()},[]);const M=()=>{_e("connections_dialog_opened",{source:"agent_settings",mode:"add"}),N({type:"SET_ADD_DIALOG_OPEN",payload:!0})},O=async L=>{const ee=d.getValues("connections");if(ee.some(Me=>Me.connection_id===L))return;d.setValue("connections",[...ee,{connection_id:L,selected_tools:St.tools,selected_resources:St.resources,selected_prompts:St.prompts}],{shouldDirty:!0}),N({type:"SET_ADD_DIALOG_OPEN",payload:!1});const J=new URL(`/api/${i.slug}/mcp/${L}`,window.location.origin),pe=await Gt({url:J.href,token:null,orgId:i.id});pe.supportsOAuth&&!pe.isAuthenticated&&await H(L)},G=L=>{const J=d.getValues("connections").filter(pe=>pe.connection_id!==L);d.setValue("connections",J,{shouldDirty:!0})},R=(L,ee)=>{const J=d.getValues("connections");if(J.some(pe=>pe.connection_id===ee)){oe.error(s("virtualMcp.virtualMcp.instanceAlreadyAdded"));return}d.setValue("connections",J.map(pe=>pe.connection_id===L?{...pe,connection_id:ee}:pe),{shouldDirty:!0})},F=async L=>{if(d.getValues("connections").find(J=>J.connection_id===L))try{const{item:J}=await f.call("COLLECTION_CONNECTIONS_GET",{id:L});if(!J)return;const pe=J.title.replace(/\s*\(.*?\)\s*$/,""),Me=kn("conn"),Te=`${pe} (${Date.now().toString(36).slice(-4)})`;await p.create.mutateAsync({id:Me,title:Te,description:J.description??null,connection_type:J.connection_type,connection_url:J.connection_url??null,connection_token:null,icon:J.icon??null,app_name:J.app_name??null,app_id:J.app_id??null,connection_headers:J.connection_headers??null});const We=new URL(`/api/${i.slug}/mcp/${Me}`,window.location.origin),ot=await Gt({url:We.href,token:null,orgId:i.id});if(ot.supportsOAuth&&!ot.isAuthenticated){const Ke=await H(Me);if(!Ke){await p.delete.mutateAsync(Me);return}await p.update.mutateAsync({id:Me,data:{title:`${pe} (${Ke})`}})}R(L,Me),oe.success(s("virtualMcp.virtualMcp.newInstanceCreated"))}catch(J){console.error("Failed to create instance:",J),oe.error(s("virtualMcp.virtualMcp.failedToCreateInstance"))}},W=L=>{N({type:"OPEN_SETTINGS",payload:L})},H=async L=>{const{token:ee,tokenInfo:J,error:pe}=await $n({connectionId:L,orgSlug:i.slug,scope:"offline_access"});if(pe||!ee)return oe.error(s("virtualMcp.virtualMcp.authenticationFailed",{error:pe??""})),null;if(J)try{const Te=await fetch(`/api/${i.slug}/connections/${L}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:J.accessToken,refreshToken:J.refreshToken,expiresIn:J.expiresIn,scope:J.scope,clientId:J.clientId,clientSecret:J.clientSecret,tokenEndpoint:J.tokenEndpoint})});if(!Te.ok)console.error("Failed to save OAuth token:",await Te.text()),await p.update.mutateAsync({id:L,data:{connection_token:ee}});else try{await p.update.mutateAsync({id:L,data:{}})}catch(We){console.warn("Failed to refresh connection tools after OAuth:",We)}}catch(Te){console.error("Error saving OAuth token:",Te),await p.update.mutateAsync({id:L,data:{connection_token:ee}})}else await p.update.mutateAsync({id:L,data:{connection_token:ee}});const Me=new URL(`/api/${i.slug}/mcp/${L}`,window.location.origin);return await o.invalidateQueries({queryKey:Dt.isMCPAuthenticated(Me.href,null)}),oe.success(s("virtualMcp.virtualMcp.authenticationSuccessful")),Nr(J,ee)},se=()=>{const L=d.getValues("metadata.instructions")??"",ee=s("virtualMcp.virtualMcp.promptTemplateContent"),J=L.trim()?`${L}
|
|
3
|
+
|
|
4
|
+
${ee}`:ee;d.setValue("metadata.instructions",J,{shouldDirty:!0})},le=new Set(x.map(L=>L.connection_id)),{section:ce}=Oa(),ae=e!==null,ie=e==="instructions"?null:e??ce,X=ie==="general",de=ae?e==="instructions":X,ue=Oi(l.id)==="v8",he=Ta({virtualMcpId:l.id,form:d,flushAndSave:z}),me=Pt(),[xe,ge]=Q.useState(!1),fe=async()=>{U();try{await a.delete.mutateAsync(l.id),_e("agent_deleted",{agent_id:l.id,source:"agent_detail"}),oe.success(s("virtualMcp.virtualMcp.agentDeleted",{title:l.title})),me({to:"/$org",params:{org:i.slug}})}catch{}},I=t.jsxs(te,{variant:"outline",size:"sm",onClick:()=>{_e("agent_connect_modal_opened",{agent_id:l.id}),N({type:"SET_SHARE_DIALOG_OPEN",payload:!0})},children:[t.jsx(Sn,{size:14}),s("virtualMcp.virtualMcp.connect")]}),ne=t.jsxs("div",{className:"flex items-center gap-2",children:[!d.watch("metadata.instructions")?.trim()&&t.jsx(te,{variant:"outline",size:"sm",onClick:se,children:s("virtualMcp.virtualMcp.promptTemplate")}),t.jsxs(te,{variant:"outline",size:"sm",disabled:C||!d.watch("metadata.instructions")?.trim(),onClick:$,children:[t.jsx(dt,{size:13}),s("virtualMcp.virtualMcp.improve")]})]});return t.jsxs(Ue,{children:[t.jsxs(t.Fragment,{children:[!ae&&t.jsxs(t.Fragment,{children:[t.jsx(Ue.Title,{children:s("virtualMcp.settings.title")}),t.jsx(Pa,{section:ie??"general"})]}),t.jsx(Ue.Actions,{secondary:ie==="connections"?I:void 0,children:ie==="connections"?t.jsxs(te,{size:"sm",onClick:M,children:[t.jsx(Pe,{size:14}),s("virtualMcp.virtualMcp.addConnection")]}):I}),t.jsx(Ue.Content,{children:t.jsx(Ue.Container,{width:"standard",className:"@container/project-settings",children:t.jsxs(Nn,{children:[X&&t.jsx(Ma,{views:he}),X&&t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(Da,{form:d,onCommit:z}),t.jsxs("div",{className:"flex flex-wrap items-center gap-2 px-4 text-xs text-muted-foreground",children:[t.jsx(_n,{id:l.created_by,size:"2xs",className:"text-sm text-muted-foreground"}),t.jsx("span",{className:"text-muted-foreground/50",children:"·"}),t.jsxs("span",{children:[s("virtualMcp.virtualMcp.created")," ",zl(new Date(l.created_at),"PP",{locale:n})]}),t.jsx("span",{className:"text-muted-foreground/50",children:"·"}),t.jsx("span",{children:r?s("virtualMcp.virtualMcp.lastUsed",{time:An(new Date(r),{addSuffix:!0,locale:n})}):s("virtualMcp.virtualMcp.neverUsed")})]})]}),ie==="connections"&&t.jsx("section",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:x.length===0?t.jsxs("button",{type:"button",onClick:M,className:"flex items-center gap-3 px-3 py-2.5 rounded-lg border border-dashed border-border hover:bg-accent transition-colors w-full text-left cursor-pointer",children:[t.jsx("div",{className:"flex items-center justify-center size-8 rounded-md text-muted-foreground/75 border border-dashed border-border shrink-0",children:t.jsx(Pe,{size:16})}),t.jsx("span",{className:"text-sm text-muted-foreground",children:s("virtualMcp.virtualMcp.noConnectionsYet")})]}):x.map(L=>t.jsx(Ye,{fallback:()=>null,children:t.jsx(Q.Suspense,{fallback:t.jsx(Js,{}),children:t.jsx(ha,{connection_id:L.connection_id,usedConnectionIds:le,onOpenSettings:()=>W(L.connection_id),onRemove:()=>G(L.connection_id),onAuthenticate:H,onSwitchInstance:R,onNewInstance:()=>F(L.connection_id)})})},L.connection_id))})}),de&&t.jsxs("section",{className:"flex flex-col gap-3",children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsx("h2",{className:"text-sm font-medium text-foreground",children:s("virtualMcp.virtualMcp.instructions")}),ne]}),t.jsx(be,{name:"metadata.instructions",control:d.control,render:({field:L})=>t.jsxs("div",{className:"relative rounded-xl shadow-edge bg-card focus-within-ring",children:[t.jsx(ut,{...L,value:L.value??"",onChange:ee=>{L.onChange(ee)},onBlur:()=>{L.onBlur(),z()},placeholder:s("virtualMcp.virtualMcp.instructionsPlaceholder"),className:"min-h-[200px] max-h-[360px] overflow-auto resize-none text-base text-muted-foreground placeholder:text-muted-foreground/40 leading-relaxed border-0 shadow-none px-4 py-3 pr-11 focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent",style:{boxShadow:"none"}}),t.jsxs(Se,{delayDuration:0,children:[t.jsx(Ne,{asChild:!0,children:t.jsx(te,{type:"button",variant:"ghost",size:"icon-sm",className:"absolute top-2 right-2 text-muted-foreground",onClick:()=>w(!0),"aria-label":s("virtualMcp.virtualMcp.openFullscreenEditor"),children:t.jsx(hi,{size:14})})}),t.jsx(Ce,{side:"left",children:s("virtualMcp.virtualMcp.fullscreen")})]})]})})]}),de&&t.jsx(Ll,{form:d}),X&&t.jsx(Ye,{fallback:()=>null,children:t.jsx(Q.Suspense,{fallback:t.jsxs("section",{className:"flex flex-col gap-3",children:[t.jsx("h2",{className:"text-sm font-medium text-foreground",children:s("virtualMcp.virtualMcp.subAgents")}),t.jsx("div",{className:"h-16 rounded-lg border border-dashed border-border animate-pulse"})]}),children:t.jsx(Ql,{form:d,currentAgentId:l.id})})}),ie==="site"&&v&&t.jsx(Be,{title:s("sandbox.cmsSettings.title"),children:t.jsxs(ze,{children:[t.jsx(je,{children:t.jsx(vr,{control:d.control,onCommit:z})}),!y&&t.jsx(je,{children:t.jsx(hr,{control:d.control})}),!y&&g&&t.jsx(je,{children:t.jsx(xr,{control:d.control,onCommit:z})})]})}),ie==="site"&&!y&&t.jsx(Be,{title:s("sandbox.cmsSettings.preview.title"),description:s("sandbox.cmsSettings.preview.description"),children:t.jsx(ze,{children:t.jsx(La,{control:d.control,isBlocksV8:ue,previewServerUrl:d.watch("metadata.previewServerUrl"),fastPreview:d.watch("metadata.fastPreview")})})}),ie==="site"&&ue&&g&&t.jsx($a,{orgSlug:i.slug,virtualMcpId:l.id}),ie==="site"&&t.jsx(Be,{title:s("virtualMcp.virtualMcp.sandbox"),children:t.jsxs(ze,{children:[t.jsx(je,{children:t.jsx(or,{repo:b})}),t.jsx(je,{children:t.jsx(mr,{control:d.control})}),t.jsx(je,{children:t.jsx(er,{control:d.control,form:d,virtualMcpId:l.id,orgSlug:i.slug,sandboxMap:l.metadata.sandboxMap})})]})}),X&&t.jsx(Be,{title:s("virtualMcp.settings.groups.advanced"),children:t.jsx(ze,{children:t.jsx(tt,{title:s("virtualMcp.virtualMcp.deleteAgent"),description:s("virtualMcp.virtualMcp.deleteAgentDescription"),action:t.jsxs(te,{variant:"outline",size:"sm",className:"text-destructive hover:bg-destructive/10 hover:text-destructive",onClick:()=>ge(!0),children:[t.jsx(It,{size:14}),s("virtualMcp.virtualMcp.deleteAgent")]})})})})]})})},e??ie)]}),t.jsx(Fn,{open:xe,onOpenChange:ge,children:t.jsxs(En,{children:[t.jsxs(zn,{children:[t.jsx(Rn,{children:s("virtualMcp.virtualMcp.deleteAgentConfirm")}),t.jsx(Ln,{children:s("virtualMcp.virtualMcp.deleteAgentConfirmDescription",{title:l.title})})]}),t.jsxs(Un,{children:[t.jsx(Yn,{children:s("virtualMcp.virtualMcp.cancel")}),t.jsx(Bn,{onClick:fe,variant:"destructive",children:s("virtualMcp.virtualMcp.delete")})]})]})}),t.jsx(gi,{open:S.addDialogOpen,onOpenChange:L=>N({type:"SET_ADD_DIALOG_OPEN",payload:L}),agentId:l.id,addedConnectionIds:le,onAdd:O}),t.jsx(pa,{open:S.settingsDialogOpen,onOpenChange:L=>{L||N({type:"CLOSE_SETTINGS"})},selectedId:S.settingsConnectionId,form:d,connections:x,onAuthenticate:H}),t.jsx(Xa,{open:S.shareDialogOpen,onOpenChange:L=>N({type:"SET_SHARE_DIALOG_OPEN",payload:L}),virtualMcp:l}),t.jsx(Xe,{open:k,onOpenChange:w,children:t.jsxs(Je,{className:"w-[90vw] sm:max-w-6xl h-[85vh] flex flex-col p-0 gap-0",children:[t.jsx(lt,{className:"px-6 pt-6 pb-3 border-b border-border shrink-0",children:t.jsx(at,{children:s("virtualMcp.virtualMcp.instructions")})}),t.jsx("div",{className:"flex-1 min-h-0 p-6",children:t.jsx(be,{name:"metadata.instructions",control:d.control,render:({field:L})=>t.jsx(ut,{...L,value:L.value??"",onChange:ee=>{L.onChange(ee)},onBlur:()=>{L.onBlur(),z()},placeholder:s("virtualMcp.virtualMcp.instructionsPlaceholder"),className:"w-full h-full resize-none text-base text-muted-foreground placeholder:text-muted-foreground/40 leading-relaxed rounded-xl shadow-edge px-4 py-3 focus-ring bg-card border-0",style:{boxShadow:"none"}})})})]})})]})}function zo(l){const e=q.c(22),{virtualMcpId:s,contextSection:n}=l,i=n===void 0?null:n,a=Z(),c=Pt(),{org:r}=Fe(),p=_s(s);if(!p){let u;e[0]!==a?(u=a("virtualMcp.virtualMcp.spaceNotFound"),e[0]=a,e[1]=u):u=e[1];let h;e[2]!==a?(h=a("virtualMcp.virtualMcp.spaceNotFoundDescription"),e[2]=a,e[3]=h):h=e[3];let d;e[4]!==c||e[5]!==r.slug?(d=()=>c({to:"/$org",params:{org:r.slug}}),e[4]=c,e[5]=r.slug,e[6]=d):d=e[6];let x;e[7]!==a?(x=a("virtualMcp.virtualMcp.backToSpaces"),e[7]=a,e[8]=x):x=e[8];let g;e[9]!==d||e[10]!==x?(g=t.jsx(te,{variant:"outline",onClick:d,children:x}),e[9]=d,e[10]=x,e[11]=g):g=e[11];let v;return e[12]!==u||e[13]!==h||e[14]!==g?(v=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Tn,{title:u,description:h,actions:g})}),e[12]=u,e[13]=h,e[14]=g,e[15]=v):v=e[15],v}let o;e[16]!==p?(o=Vs(p)?.connectionId??"",e[16]=p,e[17]=o):o=e[17];const f=`${p.id}:${o}`;let m;return e[18]!==i||e[19]!==f||e[20]!==p?(m=t.jsx(Cr,{virtualMcp:p,contextSection:i},f),e[18]=i,e[19]=f,e[20]=p,e[21]=m):m=e[21],m}export{zo as V};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as l,
|
|
1
|
+
import{r as l,bB as ce,j as p,bH as _,bG as T,bE as C,bL as le,bA as de,bX as ue,bT as fe,bM as me}from"./index-9Td7hVK9.js";import{c as Y}from"./index-BdQq_4o_.js";var X=["PageUp","PageDown"],$=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],G={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},M="Slider",[z,Se,pe]=le(M),[W]=fe(M,[pe]),[he,B]=W(M),q=l.forwardRef((e,t)=>{const{name:o,min:n=0,max:s=100,step:c=1,orientation:r="horizontal",disabled:a=!1,minStepsBetweenThumbs:u=0,defaultValue:b=[n],value:h,onValueChange:i=()=>{},onValueCommit:d=()=>{},inverted:v=!1,form:R,...g}=e,m=l.useRef(new Set),f=l.useRef(0),w=r==="horizontal"?ge:ve,[S=[],K]=ce({prop:h,defaultProp:b,onChange:x=>{[...m.current][f.current]?.focus(),i(x)}}),V=l.useRef(S);function j(x){const y=ye(S,x);A(x,y)}function se(x){A(x,f.current)}function ae(){const x=V.current[f.current];S[f.current]!==x&&d(S)}function A(x,y,{commit:k}={commit:!1}){const U=_e(c),H=Ce(Math.round((x-n)/c)*c+n,U),I=Y(H,[n,s]);K((D=[])=>{const P=xe(D,I,y);if(De(P,u*c)){f.current=P.indexOf(I);const F=String(P)!==String(D);return F&&k&&d(P),F?P:D}else return D})}return p.jsx(he,{scope:e.__scopeSlider,name:o,disabled:a,min:n,max:s,valueIndexToChangeRef:f,thumbs:m.current,values:S,orientation:r,form:R,children:p.jsx(z.Provider,{scope:e.__scopeSlider,children:p.jsx(z.Slot,{scope:e.__scopeSlider,children:p.jsx(w,{"aria-disabled":a,"data-disabled":a?"":void 0,...g,ref:t,onPointerDown:_(g.onPointerDown,()=>{a||(V.current=S)}),min:n,max:s,inverted:v,onSlideStart:a?void 0:j,onSlideMove:a?void 0:se,onSlideEnd:a?void 0:ae,onHomeKeyDown:()=>!a&&A(n,0,{commit:!0}),onEndKeyDown:()=>!a&&A(s,S.length-1,{commit:!0}),onStepKeyDown:({event:x,direction:y})=>{if(!a){const H=X.includes(x.key)||x.shiftKey&&$.includes(x.key)?10:1,I=f.current,D=S[I],P=c*H*y;A(D+P,I,{commit:!0})}}})})})})});q.displayName=M;var[J,Q]=W(M,{startEdge:"left",endEdge:"right",size:"width",direction:1}),ge=l.forwardRef((e,t)=>{const{min:o,max:n,dir:s,inverted:c,onSlideStart:r,onSlideMove:a,onSlideEnd:u,onStepKeyDown:b,...h}=e,[i,d]=l.useState(null),v=C(t,w=>d(w)),R=l.useRef(void 0),g=de(s),m=g==="ltr",f=m&&!c||!m&&c;function E(w){const S=R.current||i.getBoundingClientRect(),K=[0,S.width],j=O(K,f?[o,n]:[n,o]);return R.current=S,j(w-S.left)}return p.jsx(J,{scope:e.__scopeSlider,startEdge:f?"left":"right",endEdge:f?"right":"left",direction:f?1:-1,size:"width",children:p.jsx(Z,{dir:g,"data-orientation":"horizontal",...h,ref:v,style:{...h.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:w=>{const S=E(w.clientX);r?.(S)},onSlideMove:w=>{const S=E(w.clientX);a?.(S)},onSlideEnd:()=>{R.current=void 0,u?.()},onStepKeyDown:w=>{const K=G[f?"from-left":"from-right"].includes(w.key);b?.({event:w,direction:K?-1:1})}})})}),ve=l.forwardRef((e,t)=>{const{min:o,max:n,inverted:s,onSlideStart:c,onSlideMove:r,onSlideEnd:a,onStepKeyDown:u,...b}=e,h=l.useRef(null),i=C(t,h),d=l.useRef(void 0),v=!s;function R(g){const m=d.current||h.current.getBoundingClientRect(),f=[0,m.height],w=O(f,v?[n,o]:[o,n]);return d.current=m,w(g-m.top)}return p.jsx(J,{scope:e.__scopeSlider,startEdge:v?"bottom":"top",endEdge:v?"top":"bottom",size:"height",direction:v?1:-1,children:p.jsx(Z,{"data-orientation":"vertical",...b,ref:i,style:{...b.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:g=>{const m=R(g.clientY);c?.(m)},onSlideMove:g=>{const m=R(g.clientY);r?.(m)},onSlideEnd:()=>{d.current=void 0,a?.()},onStepKeyDown:g=>{const f=G[v?"from-bottom":"from-top"].includes(g.key);u?.({event:g,direction:f?-1:1})}})})}),Z=l.forwardRef((e,t)=>{const{__scopeSlider:o,onSlideStart:n,onSlideMove:s,onSlideEnd:c,onHomeKeyDown:r,onEndKeyDown:a,onStepKeyDown:u,...b}=e,h=B(M,o);return p.jsx(T.span,{...b,ref:t,onKeyDown:_(e.onKeyDown,i=>{i.key==="Home"?(r(i),i.preventDefault()):i.key==="End"?(a(i),i.preventDefault()):X.concat($).includes(i.key)&&(u(i),i.preventDefault())}),onPointerDown:_(e.onPointerDown,i=>{const d=i.target;d.setPointerCapture(i.pointerId),i.preventDefault(),h.thumbs.has(d)?d.focus():n(i)}),onPointerMove:_(e.onPointerMove,i=>{i.target.hasPointerCapture(i.pointerId)&&s(i)}),onPointerUp:_(e.onPointerUp,i=>{const d=i.target;d.hasPointerCapture(i.pointerId)&&(d.releasePointerCapture(i.pointerId),c(i))})})}),ee="SliderTrack",te=l.forwardRef((e,t)=>{const{__scopeSlider:o,...n}=e,s=B(ee,o);return p.jsx(T.span,{"data-disabled":s.disabled?"":void 0,"data-orientation":s.orientation,...n,ref:t})});te.displayName=ee;var N="SliderRange",ne=l.forwardRef((e,t)=>{const{__scopeSlider:o,...n}=e,s=B(N,o),c=Q(N,o),r=l.useRef(null),a=C(t,r),u=s.values.length,b=s.values.map(d=>ie(d,s.min,s.max)),h=u>1?Math.min(...b):0,i=100-Math.max(...b);return p.jsx(T.span,{"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,...n,ref:a,style:{...e.style,[c.startEdge]:h+"%",[c.endEdge]:i+"%"}})});ne.displayName=N;var L="SliderThumb",oe=l.forwardRef((e,t)=>{const o=Se(e.__scopeSlider),[n,s]=l.useState(null),c=C(t,a=>s(a)),r=l.useMemo(()=>n?o().findIndex(a=>a.ref.current===n):-1,[o,n]);return p.jsx(be,{...e,ref:c,index:r})}),be=l.forwardRef((e,t)=>{const{__scopeSlider:o,index:n,name:s,...c}=e,r=B(L,o),a=Q(L,o),[u,b]=l.useState(null),h=C(t,E=>b(E)),i=u?r.form||!!u.closest("form"):!0,d=ue(u),v=r.values[n],R=v===void 0?0:ie(v,r.min,r.max),g=Re(n,r.values.length),m=d?.[a.size],f=m?Pe(m,R,a.direction):0;return l.useEffect(()=>{if(u)return r.thumbs.add(u),()=>{r.thumbs.delete(u)}},[u,r.thumbs]),p.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[a.startEdge]:`calc(${R}% + ${f}px)`},children:[p.jsx(z.ItemSlot,{scope:e.__scopeSlider,children:p.jsx(T.span,{role:"slider","aria-label":e["aria-label"]||g,"aria-valuemin":r.min,"aria-valuenow":v,"aria-valuemax":r.max,"aria-orientation":r.orientation,"data-orientation":r.orientation,"data-disabled":r.disabled?"":void 0,tabIndex:r.disabled?void 0:0,...c,ref:h,style:v===void 0?{display:"none"}:e.style,onFocus:_(e.onFocus,()=>{r.valueIndexToChangeRef.current=n})})}),i&&p.jsx(re,{name:s??(r.name?r.name+(r.values.length>1?"[]":""):void 0),form:r.form,value:v},n)]})});oe.displayName=L;var we="RadioBubbleInput",re=l.forwardRef(({__scopeSlider:e,value:t,...o},n)=>{const s=l.useRef(null),c=C(s,n),r=me(t);return l.useEffect(()=>{const a=s.current;if(!a)return;const u=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(u,"value").set;if(r!==t&&h){const i=new Event("input",{bubbles:!0});h.call(a,t),a.dispatchEvent(i)}},[r,t]),p.jsx(T.input,{style:{display:"none"},...o,ref:c,defaultValue:t})});re.displayName=we;function xe(e=[],t,o){const n=[...e];return n[o]=t,n.sort((s,c)=>s-c)}function ie(e,t,o){const c=100/(o-t)*(e-t);return Y(c,[0,100])}function Re(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function ye(e,t){if(e.length===1)return 0;const o=e.map(s=>Math.abs(s-t)),n=Math.min(...o);return o.indexOf(n)}function Pe(e,t,o){const n=e/2,c=O([0,50],[0,n]);return(n-c(t)*o)*o}function Ee(e){return e.slice(0,-1).map((t,o)=>e[o+1]-t)}function De(e,t){if(t>0){const o=Ee(e);return Math.min(...o)>=t}return!0}function O(e,t){return o=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(o-e[0])}}function _e(e){return(String(e).split(".")[1]||"").length}function Ce(e,t){const o=Math.pow(10,t);return Math.round(e*o)/o}var Ae=q,Ie=te,Te=ne,Be=oe;export{Te as R,Ie as T,Ae as a,Be as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as n,bz as j,di as R,dj as Ee,dk as ke,dl as Se,aJ as xe,dm as V}from"./index-DEQvnIsm.js";var de=1,Ie=.9,Ce=.8,Re=.17,Q=.1,Z=.999,Ae=.9999,Me=.99,$e=/[\\\/_+.#"@\[\(\{&]/,De=/[\\\/_+.#"@\[\(\{&]/g,Fe=/[\s-]/,ve=/[\s-]/g;function ee(t,l,r,f,u,c,d){if(c===l.length)return u===t.length?de:Me;var v=`${u},${c}`;if(d[v]!==void 0)return d[v];for(var b=f.charAt(c),i=r.indexOf(b,u),p=0,h,x,E,I;i>=0;)h=ee(t,l,r,f,i+1,c+1,d),h>p&&(i===u?h*=de:$e.test(t.charAt(i-1))?(h*=Ce,E=t.slice(u,i-1).match(De),E&&u>0&&(h*=Math.pow(Z,E.length))):Fe.test(t.charAt(i-1))?(h*=Ie,I=t.slice(u,i-1).match(ve),I&&u>0&&(h*=Math.pow(Z,I.length))):(h*=Re,u>0&&(h*=Math.pow(Z,i-u))),t.charAt(i)!==l.charAt(c)&&(h*=Ae)),(h<Q&&r.charAt(i-1)===f.charAt(c+1)||f.charAt(c+1)===f.charAt(c)&&r.charAt(i-1)!==f.charAt(c))&&(x=ee(t,l,r,f,i+1,c+2,d),x*Q>h&&(h=x*Q)),h>p&&(p=h),i=r.indexOf(b,i+1);return d[v]=p,p}function se(t){return t.toLowerCase().replace(ve," ")}function Ke(t,l,r){return t=r&&r.length>0?`${t+" "+r.join(" ")}`:t,ee(t,l,se(t),se(l),0,0,{})}var P='[cmdk-group=""]',_='[cmdk-group-items=""]',je='[cmdk-group-heading=""]',me='[cmdk-item=""]',fe=`${me}:not([aria-disabled="true"])`,te="cmdk-item-select",F="data-value",qe=(t,l,r)=>Ke(t,l,r),pe=n.createContext(void 0),L=()=>n.useContext(pe),he=n.createContext(void 0),re=()=>n.useContext(he),ge=n.createContext(void 0),be=n.forwardRef((t,l)=>{let r=K(()=>{var e,o;return{search:"",value:(o=(e=t.value)!=null?e:t.defaultValue)!=null?o:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),f=K(()=>new Set),u=K(()=>new Map),c=K(()=>new Map),d=K(()=>new Set),v=we(t),{label:b,children:i,value:p,onValueChange:h,filter:x,shouldFilter:E,loop:I,disablePointerSelection:U=!1,vimBindings:A=!0,...O}=t,H=j(),ne=j(),J=j(),M=n.useRef(null),w=Te();$(()=>{if(p!==void 0){let e=p.trim();r.current.value=e,k.emit()}},[p]),$(()=>{w(6,ae)},[]);let k=n.useMemo(()=>({subscribe:e=>(d.current.add(e),()=>d.current.delete(e)),snapshot:()=>r.current,setState:(e,o,s)=>{var a,m,g,S;if(!Object.is(r.current[e],o)){if(r.current[e]=o,e==="search")G(),T(),w(1,W);else if(e==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let y=document.getElementById(J);y?y.focus():(a=document.getElementById(H))==null||a.focus()}if(w(7,()=>{var y;r.current.selectedItemId=(y=D())==null?void 0:y.id,k.emit()}),s||w(5,ae),((m=v.current)==null?void 0:m.value)!==void 0){let y=o??"";(S=(g=v.current).onValueChange)==null||S.call(g,y);return}}k.emit()}},emit:()=>{d.current.forEach(e=>e())}}),[]),N=n.useMemo(()=>({value:(e,o,s)=>{var a;o!==((a=c.current.get(e))==null?void 0:a.value)&&(c.current.set(e,{value:o,keywords:s}),r.current.filtered.items.set(e,le(o,s)),w(2,()=>{T(),k.emit()}))},item:(e,o)=>(f.current.add(e),o&&(u.current.has(o)?u.current.get(o).add(e):u.current.set(o,new Set([e]))),w(3,()=>{G(),T(),r.current.value||W(),k.emit()}),()=>{c.current.delete(e),f.current.delete(e),r.current.filtered.items.delete(e);let s=D();w(4,()=>{G(),s?.getAttribute("id")===e&&W(),k.emit()})}),group:e=>(u.current.has(e)||u.current.set(e,new Set),()=>{c.current.delete(e),u.current.delete(e)}),filter:()=>v.current.shouldFilter,label:b||t["aria-label"],getDisablePointerSelection:()=>v.current.disablePointerSelection,listId:H,inputId:J,labelId:ne,listInnerRef:M}),[]);function le(e,o){var s,a;let m=(a=(s=v.current)==null?void 0:s.filter)!=null?a:qe;return e?m(e,r.current.search,o):0}function T(){if(!r.current.search||v.current.shouldFilter===!1)return;let e=r.current.filtered.items,o=[];r.current.filtered.groups.forEach(a=>{let m=u.current.get(a),g=0;m.forEach(S=>{let y=e.get(S);g=Math.max(y,g)}),o.push([a,g])});let s=M.current;q().sort((a,m)=>{var g,S;let y=a.getAttribute("id"),z=m.getAttribute("id");return((g=e.get(z))!=null?g:0)-((S=e.get(y))!=null?S:0)}).forEach(a=>{let m=a.closest(_);m?m.appendChild(a.parentElement===m?a:a.closest(`${_} > *`)):s.appendChild(a.parentElement===s?a:a.closest(`${_} > *`))}),o.sort((a,m)=>m[1]-a[1]).forEach(a=>{var m;let g=(m=M.current)==null?void 0:m.querySelector(`${P}[${F}="${encodeURIComponent(a[0])}"]`);g?.parentElement.appendChild(g)})}function W(){let e=q().find(s=>s.getAttribute("aria-disabled")!=="true"),o=e?.getAttribute(F);k.setState("value",o||void 0)}function G(){var e,o,s,a;if(!r.current.search||v.current.shouldFilter===!1){r.current.filtered.count=f.current.size;return}r.current.filtered.groups=new Set;let m=0;for(let g of f.current){let S=(o=(e=c.current.get(g))==null?void 0:e.value)!=null?o:"",y=(a=(s=c.current.get(g))==null?void 0:s.keywords)!=null?a:[],z=le(S,y);r.current.filtered.items.set(g,z),z>0&&m++}for(let[g,S]of u.current)for(let y of S)if(r.current.filtered.items.get(y)>0){r.current.filtered.groups.add(g);break}r.current.filtered.count=m}function ae(){var e,o,s;let a=D();a&&(((e=a.parentElement)==null?void 0:e.firstChild)===a&&((s=(o=a.closest(P))==null?void 0:o.querySelector(je))==null||s.scrollIntoView({block:"nearest"})),a.scrollIntoView({block:"nearest"}))}function D(){var e;return(e=M.current)==null?void 0:e.querySelector(`${me}[aria-selected="true"]`)}function q(){var e;return Array.from(((e=M.current)==null?void 0:e.querySelectorAll(fe))||[])}function X(e){let o=q()[e];o&&k.setState("value",o.getAttribute(F))}function Y(e){var o;let s=D(),a=q(),m=a.findIndex(S=>S===s),g=a[m+e];(o=v.current)!=null&&o.loop&&(g=m+e<0?a[a.length-1]:m+e===a.length?a[0]:a[m+e]),g&&k.setState("value",g.getAttribute(F))}function ue(e){let o=D(),s=o?.closest(P),a;for(;s&&!a;)s=e>0?Je(s,P):Ne(s,P),a=s?.querySelector(fe);a?k.setState("value",a.getAttribute(F)):Y(e)}let ie=()=>X(q().length-1),oe=e=>{e.preventDefault(),e.metaKey?ie():e.altKey?ue(1):Y(1)},ce=e=>{e.preventDefault(),e.metaKey?X(0):e.altKey?ue(-1):Y(-1)};return n.createElement(R.div,{ref:l,tabIndex:-1,...O,"cmdk-root":"",onKeyDown:e=>{var o;(o=O.onKeyDown)==null||o.call(O,e);let s=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||s))switch(e.key){case"n":case"j":{A&&e.ctrlKey&&oe(e);break}case"ArrowDown":{oe(e);break}case"p":case"k":{A&&e.ctrlKey&&ce(e);break}case"ArrowUp":{ce(e);break}case"Home":{e.preventDefault(),X(0);break}case"End":{e.preventDefault(),ie();break}case"Enter":{e.preventDefault();let a=D();if(a){let m=new Event(te);a.dispatchEvent(m)}}}}},n.createElement("label",{"cmdk-label":"",htmlFor:N.inputId,id:N.labelId,style:Ge},b),B(t,e=>n.createElement(he.Provider,{value:k},n.createElement(pe.Provider,{value:N},e))))}),Pe=n.forwardRef((t,l)=>{var r,f;let u=j(),c=n.useRef(null),d=n.useContext(ge),v=L(),b=we(t),i=(f=(r=b.current)==null?void 0:r.forceMount)!=null?f:d?.forceMount;$(()=>{if(!i)return v.item(u,d?.id)},[i]);let p=ye(u,c,[t.value,t.children,c],t.keywords),h=re(),x=C(w=>w.value&&w.value===p.current),E=C(w=>i||v.filter()===!1?!0:w.search?w.filtered.items.get(u)>0:!0);n.useEffect(()=>{let w=c.current;if(!(!w||t.disabled))return w.addEventListener(te,I),()=>w.removeEventListener(te,I)},[E,t.onSelect,t.disabled]);function I(){var w,k;U(),(k=(w=b.current).onSelect)==null||k.call(w,p.current)}function U(){h.setState("value",p.current,!0)}if(!E)return null;let{disabled:A,value:O,onSelect:H,forceMount:ne,keywords:J,...M}=t;return n.createElement(R.div,{ref:V(c,l),...M,id:u,"cmdk-item":"",role:"option","aria-disabled":!!A,"aria-selected":!!x,"data-disabled":!!A,"data-selected":!!x,onPointerMove:A||v.getDisablePointerSelection()?void 0:U,onClick:A?void 0:I},t.children)}),Ve=n.forwardRef((t,l)=>{let{heading:r,children:f,forceMount:u,...c}=t,d=j(),v=n.useRef(null),b=n.useRef(null),i=j(),p=L(),h=C(E=>u||p.filter()===!1?!0:E.search?E.filtered.groups.has(d):!0);$(()=>p.group(d),[]),ye(d,v,[t.value,t.heading,b]);let x=n.useMemo(()=>({id:d,forceMount:u}),[u]);return n.createElement(R.div,{ref:V(v,l),...c,"cmdk-group":"",role:"presentation",hidden:h?void 0:!0},r&&n.createElement("div",{ref:b,"cmdk-group-heading":"","aria-hidden":!0,id:i},r),B(t,E=>n.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?i:void 0},n.createElement(ge.Provider,{value:x},E))))}),Le=n.forwardRef((t,l)=>{let{alwaysRender:r,...f}=t,u=n.useRef(null),c=C(d=>!d.search);return!r&&!c?null:n.createElement(R.div,{ref:V(u,l),...f,"cmdk-separator":"",role:"separator"})}),Oe=n.forwardRef((t,l)=>{let{onValueChange:r,...f}=t,u=t.value!=null,c=re(),d=C(i=>i.search),v=C(i=>i.selectedItemId),b=L();return n.useEffect(()=>{t.value!=null&&c.setState("search",t.value)},[t.value]),n.createElement(R.input,{ref:l,...f,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":b.listId,"aria-labelledby":b.labelId,"aria-activedescendant":v,id:b.inputId,type:"text",value:u?t.value:d,onChange:i=>{u||c.setState("search",i.target.value),r?.(i.target.value)}})}),ze=n.forwardRef((t,l)=>{let{children:r,label:f="Suggestions",...u}=t,c=n.useRef(null),d=n.useRef(null),v=C(i=>i.selectedItemId),b=L();return n.useEffect(()=>{if(d.current&&c.current){let i=d.current,p=c.current,h,x=new ResizeObserver(()=>{h=requestAnimationFrame(()=>{let E=i.offsetHeight;p.style.setProperty("--cmdk-list-height",E.toFixed(1)+"px")})});return x.observe(i),()=>{cancelAnimationFrame(h),x.unobserve(i)}}},[]),n.createElement(R.div,{ref:V(c,l),...u,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":v,"aria-label":f,id:b.listId},B(t,i=>n.createElement("div",{ref:V(d,b.listInnerRef),"cmdk-list-sizer":""},i)))}),Be=n.forwardRef((t,l)=>{let{open:r,onOpenChange:f,overlayClassName:u,contentClassName:c,container:d,...v}=t;return n.createElement(Ee,{open:r,onOpenChange:f},n.createElement(ke,{container:d},n.createElement(Se,{"cmdk-overlay":"",className:u}),n.createElement(xe,{"aria-label":t.label,"cmdk-dialog":"",className:c},n.createElement(be,{ref:l,...v}))))}),Ue=n.forwardRef((t,l)=>C(r=>r.filtered.count===0)?n.createElement(R.div,{ref:l,...t,"cmdk-empty":"",role:"presentation"}):null),He=n.forwardRef((t,l)=>{let{progress:r,children:f,label:u="Loading...",...c}=t;return n.createElement(R.div,{ref:l,...c,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":u},B(t,d=>n.createElement("div",{"aria-hidden":!0},d)))}),Ye=Object.assign(be,{List:ze,Item:Pe,Input:Oe,Group:Ve,Separator:Le,Dialog:Be,Empty:Ue,Loading:He});function Je(t,l){let r=t.nextElementSibling;for(;r;){if(r.matches(l))return r;r=r.nextElementSibling}}function Ne(t,l){let r=t.previousElementSibling;for(;r;){if(r.matches(l))return r;r=r.previousElementSibling}}function we(t){let l=n.useRef(t);return $(()=>{l.current=t}),l}var $=typeof window>"u"?n.useEffect:n.useLayoutEffect;function K(t){let l=n.useRef();return l.current===void 0&&(l.current=t()),l}function C(t){let l=re(),r=()=>t(l.snapshot());return n.useSyncExternalStore(l.subscribe,r,r)}function ye(t,l,r,f=[]){let u=n.useRef(),c=L();return $(()=>{var d;let v=(()=>{var i;for(let p of r){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(i=p.current.textContent)==null?void 0:i.trim():u.current}})(),b=f.map(i=>i.trim());c.value(t,v,b),(d=l.current)==null||d.setAttribute(F,v),u.current=v}),u}var Te=()=>{let[t,l]=n.useState(),r=K(()=>new Map);return $(()=>{r.current.forEach(f=>f()),r.current=new Map},[t]),(f,u)=>{r.current.set(f,u),l({})}};function We(t){let l=t.type;return typeof l=="function"?l(t.props):"render"in l?l.render(t.props):t}function B({asChild:t,children:l},r){return t&&n.isValidElement(l)?n.cloneElement(We(l),{ref:l.ref},r(l.props.children)):r(l)}var Ge={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};export{Ye as _};
|
|
1
|
+
import{r as n,bD as q,dm as R,dn as Ee,dp as ke,dq as Se,aJ as xe,dr as j}from"./index-9Td7hVK9.js";var de=1,Ie=.9,Ce=.8,Re=.17,Q=.1,Z=.999,Ae=.9999,Me=.99,$e=/[\\\/_+.#"@\[\(\{&]/,De=/[\\\/_+.#"@\[\(\{&]/g,Fe=/[\s-]/,ve=/[\s-]/g;function ee(t,l,r,f,u,c,d){if(c===l.length)return u===t.length?de:Me;var v=`${u},${c}`;if(d[v]!==void 0)return d[v];for(var b=f.charAt(c),i=r.indexOf(b,u),p=0,h,x,E,I;i>=0;)h=ee(t,l,r,f,i+1,c+1,d),h>p&&(i===u?h*=de:$e.test(t.charAt(i-1))?(h*=Ce,E=t.slice(u,i-1).match(De),E&&u>0&&(h*=Math.pow(Z,E.length))):Fe.test(t.charAt(i-1))?(h*=Ie,I=t.slice(u,i-1).match(ve),I&&u>0&&(h*=Math.pow(Z,I.length))):(h*=Re,u>0&&(h*=Math.pow(Z,i-u))),t.charAt(i)!==l.charAt(c)&&(h*=Ae)),(h<Q&&r.charAt(i-1)===f.charAt(c+1)||f.charAt(c+1)===f.charAt(c)&&r.charAt(i-1)!==f.charAt(c))&&(x=ee(t,l,r,f,i+1,c+2,d),x*Q>h&&(h=x*Q)),h>p&&(p=h),i=r.indexOf(b,i+1);return d[v]=p,p}function se(t){return t.toLowerCase().replace(ve," ")}function Ke(t,l,r){return t=r&&r.length>0?`${t+" "+r.join(" ")}`:t,ee(t,l,se(t),se(l),0,0,{})}var V='[cmdk-group=""]',_='[cmdk-group-items=""]',qe='[cmdk-group-heading=""]',me='[cmdk-item=""]',fe=`${me}:not([aria-disabled="true"])`,te="cmdk-item-select",F="data-value",Pe=(t,l,r)=>Ke(t,l,r),pe=n.createContext(void 0),L=()=>n.useContext(pe),he=n.createContext(void 0),re=()=>n.useContext(he),ge=n.createContext(void 0),be=n.forwardRef((t,l)=>{let r=K(()=>{var e,o;return{search:"",value:(o=(e=t.value)!=null?e:t.defaultValue)!=null?o:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),f=K(()=>new Set),u=K(()=>new Map),c=K(()=>new Map),d=K(()=>new Set),v=we(t),{label:b,children:i,value:p,onValueChange:h,filter:x,shouldFilter:E,loop:I,disablePointerSelection:U=!1,vimBindings:A=!0,...O}=t,H=q(),ne=q(),J=q(),M=n.useRef(null),w=Te();$(()=>{if(p!==void 0){let e=p.trim();r.current.value=e,k.emit()}},[p]),$(()=>{w(6,ae)},[]);let k=n.useMemo(()=>({subscribe:e=>(d.current.add(e),()=>d.current.delete(e)),snapshot:()=>r.current,setState:(e,o,s)=>{var a,m,g,S;if(!Object.is(r.current[e],o)){if(r.current[e]=o,e==="search")G(),T(),w(1,W);else if(e==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let y=document.getElementById(J);y?y.focus():(a=document.getElementById(H))==null||a.focus()}if(w(7,()=>{var y;r.current.selectedItemId=(y=D())==null?void 0:y.id,k.emit()}),s||w(5,ae),((m=v.current)==null?void 0:m.value)!==void 0){let y=o??"";(S=(g=v.current).onValueChange)==null||S.call(g,y);return}}k.emit()}},emit:()=>{d.current.forEach(e=>e())}}),[]),N=n.useMemo(()=>({value:(e,o,s)=>{var a;o!==((a=c.current.get(e))==null?void 0:a.value)&&(c.current.set(e,{value:o,keywords:s}),r.current.filtered.items.set(e,le(o,s)),w(2,()=>{T(),k.emit()}))},item:(e,o)=>(f.current.add(e),o&&(u.current.has(o)?u.current.get(o).add(e):u.current.set(o,new Set([e]))),w(3,()=>{G(),T(),r.current.value||W(),k.emit()}),()=>{c.current.delete(e),f.current.delete(e),r.current.filtered.items.delete(e);let s=D();w(4,()=>{G(),s?.getAttribute("id")===e&&W(),k.emit()})}),group:e=>(u.current.has(e)||u.current.set(e,new Set),()=>{c.current.delete(e),u.current.delete(e)}),filter:()=>v.current.shouldFilter,label:b||t["aria-label"],getDisablePointerSelection:()=>v.current.disablePointerSelection,listId:H,inputId:J,labelId:ne,listInnerRef:M}),[]);function le(e,o){var s,a;let m=(a=(s=v.current)==null?void 0:s.filter)!=null?a:Pe;return e?m(e,r.current.search,o):0}function T(){if(!r.current.search||v.current.shouldFilter===!1)return;let e=r.current.filtered.items,o=[];r.current.filtered.groups.forEach(a=>{let m=u.current.get(a),g=0;m.forEach(S=>{let y=e.get(S);g=Math.max(y,g)}),o.push([a,g])});let s=M.current;P().sort((a,m)=>{var g,S;let y=a.getAttribute("id"),B=m.getAttribute("id");return((g=e.get(B))!=null?g:0)-((S=e.get(y))!=null?S:0)}).forEach(a=>{let m=a.closest(_);m?m.appendChild(a.parentElement===m?a:a.closest(`${_} > *`)):s.appendChild(a.parentElement===s?a:a.closest(`${_} > *`))}),o.sort((a,m)=>m[1]-a[1]).forEach(a=>{var m;let g=(m=M.current)==null?void 0:m.querySelector(`${V}[${F}="${encodeURIComponent(a[0])}"]`);g?.parentElement.appendChild(g)})}function W(){let e=P().find(s=>s.getAttribute("aria-disabled")!=="true"),o=e?.getAttribute(F);k.setState("value",o||void 0)}function G(){var e,o,s,a;if(!r.current.search||v.current.shouldFilter===!1){r.current.filtered.count=f.current.size;return}r.current.filtered.groups=new Set;let m=0;for(let g of f.current){let S=(o=(e=c.current.get(g))==null?void 0:e.value)!=null?o:"",y=(a=(s=c.current.get(g))==null?void 0:s.keywords)!=null?a:[],B=le(S,y);r.current.filtered.items.set(g,B),B>0&&m++}for(let[g,S]of u.current)for(let y of S)if(r.current.filtered.items.get(y)>0){r.current.filtered.groups.add(g);break}r.current.filtered.count=m}function ae(){var e,o,s;let a=D();a&&(((e=a.parentElement)==null?void 0:e.firstChild)===a&&((s=(o=a.closest(V))==null?void 0:o.querySelector(qe))==null||s.scrollIntoView({block:"nearest"})),a.scrollIntoView({block:"nearest"}))}function D(){var e;return(e=M.current)==null?void 0:e.querySelector(`${me}[aria-selected="true"]`)}function P(){var e;return Array.from(((e=M.current)==null?void 0:e.querySelectorAll(fe))||[])}function X(e){let o=P()[e];o&&k.setState("value",o.getAttribute(F))}function Y(e){var o;let s=D(),a=P(),m=a.findIndex(S=>S===s),g=a[m+e];(o=v.current)!=null&&o.loop&&(g=m+e<0?a[a.length-1]:m+e===a.length?a[0]:a[m+e]),g&&k.setState("value",g.getAttribute(F))}function ue(e){let o=D(),s=o?.closest(V),a;for(;s&&!a;)s=e>0?Je(s,V):Ne(s,V),a=s?.querySelector(fe);a?k.setState("value",a.getAttribute(F)):Y(e)}let ie=()=>X(P().length-1),oe=e=>{e.preventDefault(),e.metaKey?ie():e.altKey?ue(1):Y(1)},ce=e=>{e.preventDefault(),e.metaKey?X(0):e.altKey?ue(-1):Y(-1)};return n.createElement(R.div,{ref:l,tabIndex:-1,...O,"cmdk-root":"",onKeyDown:e=>{var o;(o=O.onKeyDown)==null||o.call(O,e);let s=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||s))switch(e.key){case"n":case"j":{A&&e.ctrlKey&&oe(e);break}case"ArrowDown":{oe(e);break}case"p":case"k":{A&&e.ctrlKey&&ce(e);break}case"ArrowUp":{ce(e);break}case"Home":{e.preventDefault(),X(0);break}case"End":{e.preventDefault(),ie();break}case"Enter":{e.preventDefault();let a=D();if(a){let m=new Event(te);a.dispatchEvent(m)}}}}},n.createElement("label",{"cmdk-label":"",htmlFor:N.inputId,id:N.labelId,style:Ge},b),z(t,e=>n.createElement(he.Provider,{value:k},n.createElement(pe.Provider,{value:N},e))))}),Ve=n.forwardRef((t,l)=>{var r,f;let u=q(),c=n.useRef(null),d=n.useContext(ge),v=L(),b=we(t),i=(f=(r=b.current)==null?void 0:r.forceMount)!=null?f:d?.forceMount;$(()=>{if(!i)return v.item(u,d?.id)},[i]);let p=ye(u,c,[t.value,t.children,c],t.keywords),h=re(),x=C(w=>w.value&&w.value===p.current),E=C(w=>i||v.filter()===!1?!0:w.search?w.filtered.items.get(u)>0:!0);n.useEffect(()=>{let w=c.current;if(!(!w||t.disabled))return w.addEventListener(te,I),()=>w.removeEventListener(te,I)},[E,t.onSelect,t.disabled]);function I(){var w,k;U(),(k=(w=b.current).onSelect)==null||k.call(w,p.current)}function U(){h.setState("value",p.current,!0)}if(!E)return null;let{disabled:A,value:O,onSelect:H,forceMount:ne,keywords:J,...M}=t;return n.createElement(R.div,{ref:j(c,l),...M,id:u,"cmdk-item":"",role:"option","aria-disabled":!!A,"aria-selected":!!x,"data-disabled":!!A,"data-selected":!!x,onPointerMove:A||v.getDisablePointerSelection()?void 0:U,onClick:A?void 0:I},t.children)}),je=n.forwardRef((t,l)=>{let{heading:r,children:f,forceMount:u,...c}=t,d=q(),v=n.useRef(null),b=n.useRef(null),i=q(),p=L(),h=C(E=>u||p.filter()===!1?!0:E.search?E.filtered.groups.has(d):!0);$(()=>p.group(d),[]),ye(d,v,[t.value,t.heading,b]);let x=n.useMemo(()=>({id:d,forceMount:u}),[u]);return n.createElement(R.div,{ref:j(v,l),...c,"cmdk-group":"",role:"presentation",hidden:h?void 0:!0},r&&n.createElement("div",{ref:b,"cmdk-group-heading":"","aria-hidden":!0,id:i},r),z(t,E=>n.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?i:void 0},n.createElement(ge.Provider,{value:x},E))))}),Le=n.forwardRef((t,l)=>{let{alwaysRender:r,...f}=t,u=n.useRef(null),c=C(d=>!d.search);return!r&&!c?null:n.createElement(R.div,{ref:j(u,l),...f,"cmdk-separator":"",role:"separator"})}),Oe=n.forwardRef((t,l)=>{let{onValueChange:r,...f}=t,u=t.value!=null,c=re(),d=C(i=>i.search),v=C(i=>i.selectedItemId),b=L();return n.useEffect(()=>{t.value!=null&&c.setState("search",t.value)},[t.value]),n.createElement(R.input,{ref:l,...f,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":b.listId,"aria-labelledby":b.labelId,"aria-activedescendant":v,id:b.inputId,type:"text",value:u?t.value:d,onChange:i=>{u||c.setState("search",i.target.value),r?.(i.target.value)}})}),Be=n.forwardRef((t,l)=>{let{children:r,label:f="Suggestions",...u}=t,c=n.useRef(null),d=n.useRef(null),v=C(i=>i.selectedItemId),b=L();return n.useEffect(()=>{if(d.current&&c.current){let i=d.current,p=c.current,h,x=new ResizeObserver(()=>{h=requestAnimationFrame(()=>{let E=i.offsetHeight;p.style.setProperty("--cmdk-list-height",E.toFixed(1)+"px")})});return x.observe(i),()=>{cancelAnimationFrame(h),x.unobserve(i)}}},[]),n.createElement(R.div,{ref:j(c,l),...u,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":v,"aria-label":f,id:b.listId},z(t,i=>n.createElement("div",{ref:j(d,b.listInnerRef),"cmdk-list-sizer":""},i)))}),ze=n.forwardRef((t,l)=>{let{open:r,onOpenChange:f,overlayClassName:u,contentClassName:c,container:d,...v}=t;return n.createElement(Ee,{open:r,onOpenChange:f},n.createElement(ke,{container:d},n.createElement(Se,{"cmdk-overlay":"",className:u}),n.createElement(xe,{"aria-label":t.label,"cmdk-dialog":"",className:c},n.createElement(be,{ref:l,...v}))))}),Ue=n.forwardRef((t,l)=>C(r=>r.filtered.count===0)?n.createElement(R.div,{ref:l,...t,"cmdk-empty":"",role:"presentation"}):null),He=n.forwardRef((t,l)=>{let{progress:r,children:f,label:u="Loading...",...c}=t;return n.createElement(R.div,{ref:l,...c,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":u},z(t,d=>n.createElement("div",{"aria-hidden":!0},d)))}),Ye=Object.assign(be,{List:Be,Item:Ve,Input:Oe,Group:je,Separator:Le,Dialog:ze,Empty:Ue,Loading:He});function Je(t,l){let r=t.nextElementSibling;for(;r;){if(r.matches(l))return r;r=r.nextElementSibling}}function Ne(t,l){let r=t.previousElementSibling;for(;r;){if(r.matches(l))return r;r=r.previousElementSibling}}function we(t){let l=n.useRef(t);return $(()=>{l.current=t}),l}var $=typeof window>"u"?n.useEffect:n.useLayoutEffect;function K(t){let l=n.useRef();return l.current===void 0&&(l.current=t()),l}function C(t){let l=re(),r=()=>t(l.snapshot());return n.useSyncExternalStore(l.subscribe,r,r)}function ye(t,l,r,f=[]){let u=n.useRef(),c=L();return $(()=>{var d;let v=(()=>{var i;for(let p of r){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(i=p.current.textContent)==null?void 0:i.trim():u.current}})(),b=f.map(i=>i.trim());c.value(t,v,b),(d=l.current)==null||d.setAttribute(F,v),u.current=v}),u}var Te=()=>{let[t,l]=n.useState(),r=K(()=>new Map);return $(()=>{r.current.forEach(f=>f()),r.current=new Map},[t]),(f,u)=>{r.current.set(f,u),l({})}};function We(t){let l=t.type;return typeof l=="function"?l(t.props):"render"in l?l.render(t.props):t}function z({asChild:t,children:l},r){return t&&n.isValidElement(l)?n.cloneElement(We(l),{ref:l.ref},r(l.props.children)):r(l)}var Ge={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};export{Ye as _};
|