decocms 4.248.2 → 4.248.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-DYa65h7M.js → AlertCircle-BJLsdJJB.js} +1 -1
- package/dist/client/assets/{AreaChart-Z7000aGF.js → AreaChart-DPRb077p.js} +1 -1
- package/dist/client/assets/{ArrowLeft-D0sSJGyh.js → ArrowLeft-BpINHsGO.js} +1 -1
- package/dist/client/assets/{ArrowUp-DaPuMC6J.js → ArrowUp-BCnJIsa2.js} +1 -1
- package/dist/client/assets/{Check-ErA_74IV.js → Check-DYWCAvRe.js} +1 -1
- package/dist/client/assets/{CheckCircle-CiRCtOI3.js → CheckCircle-CZfdFD75.js} +1 -1
- package/dist/client/assets/{ChevronDown-Dgga4a4Q.js → ChevronDown-Dm7RFEzi.js} +1 -1
- package/dist/client/assets/{ChevronRight-Cf-ty0tK.js → ChevronRight-DfFDfMiT.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-BS9Eaphx.js → ChevronSelectorVertical-BrPFZOd6.js} +1 -1
- package/dist/client/assets/{ChevronUp-DOEAI0tE.js → ChevronUp-YRlpUnbI.js} +1 -1
- package/dist/client/assets/{Copy01-C8DEngph.js → Copy01-B7kE9119.js} +1 -1
- package/dist/client/assets/{CreditCard01-LLnESWWX.js → CreditCard01-BBWGD6ln.js} +1 -1
- package/dist/client/assets/{DotsVertical-B9Mg1LjT.js → DotsVertical-Ds_DhNTo.js} +1 -1
- package/dist/client/assets/{Download01-CKTo0VS3.js → Download01-CtExxOFo.js} +1 -1
- package/dist/client/assets/{Eye-C-IIbq0b.js → Eye-Bkw_HSyr.js} +1 -1
- package/dist/client/assets/{FilterLines-BmuWDJhh.js → FilterLines-CdBZbJbR.js} +1 -1
- package/dist/client/assets/{Globe01-AGteY5p8.js → Globe01-CbzTjXVx.js} +1 -1
- package/dist/client/assets/{Globe04-B6IxAzhj.js → Globe04-5uq9vA8E.js} +1 -1
- package/dist/client/assets/{HardDrive-Bxx1_cqg.js → HardDrive-DLZzUCJy.js} +1 -1
- package/dist/client/assets/{Key01-Du0R52Fs.js → Key01-WP13V6P8.js} +1 -1
- package/dist/client/assets/{LinkExternal01-lwDudDKU.js → LinkExternal01-DWP8dcJA.js} +1 -1
- package/dist/client/assets/{LockUnlocked01-ChTbbG9p.js → LockUnlocked01-BsAWOf6A.js} +1 -1
- package/dist/client/assets/{LogOut01-VHtvJ8Vp.js → LogOut01-DUJGO4hF.js} +1 -1
- package/dist/client/assets/{Monitor01-DA25Iq0R.js → Monitor01-DZgvR7bI.js} +1 -1
- package/dist/client/assets/{Palette-yngNVQ4n.js → Palette-BRlImZFI.js} +1 -1
- package/dist/client/assets/{Play-CsQhzYUI.js → Play-xBrWdkON.js} +1 -1
- package/dist/client/assets/{Plus-Cf4b1bNp.js → Plus-DKhcQWfb.js} +1 -1
- package/dist/client/assets/{SearchLg-CIhGyLjl.js → SearchLg-BzZYCybQ.js} +1 -1
- package/dist/client/assets/{SearchMd-B1dsuEY7.js → SearchMd-C-eFE6qY.js} +1 -1
- package/dist/client/assets/{Settings02-zoYBf2Q9.js → Settings02-DsPup1VS.js} +1 -1
- package/dist/client/assets/{Share07-KO4nWaTW.js → Share07-_7OUHtSc.js} +1 -1
- package/dist/client/assets/{Shield01-EKP5VJCL.js → Shield01-BMGrPJL4.js} +1 -1
- package/dist/client/assets/{Stars01-BgC1nyVS.js → Stars01-DyPW1NZ3.js} +1 -1
- package/dist/client/assets/{Stars02-D7QMgn6_.js → Stars02-CsRg1_DW.js} +1 -1
- package/dist/client/assets/{Sun-CH0lCvO4.js → Sun-lLrEGeIB.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-ByrC3JZW.js → SwitchHorizontal01-Buwrdn2y.js} +1 -1
- package/dist/client/assets/{Tool01-BjJidQ3c.js → Tool01-Dg67-JKv.js} +1 -1
- package/dist/client/assets/{Tool02-Bs7nBBx_.js → Tool02-_e_W6rPa.js} +1 -1
- package/dist/client/assets/{Trash01-C4UDDTjr.js → Trash01-649gpHj9.js} +1 -1
- package/dist/client/assets/{TrendUp01-BQO_JaWi.js → TrendUp01-CSEGC0U8.js} +1 -1
- package/dist/client/assets/{Upload01-k3Mh0fZU.js → Upload01-DjDsiYUt.js} +1 -1
- package/dist/client/assets/{User01-m6vclzYC.js → User01-Dlgu2BER.js} +1 -1
- package/dist/client/assets/{UserSquare-1p4hY8NI.js → UserSquare-BS_e8Pjv.js} +1 -1
- package/dist/client/assets/{Users01-CWeSTta9.js → Users01-C7EqAQaR.js} +1 -1
- package/dist/client/assets/{Users03-a8f_wZmP.js → Users03-DvaTkZMF.js} +1 -1
- package/dist/client/assets/{XCircle-3TmYYaVT.js → XCircle-Cn5WdVId.js} +1 -1
- package/dist/client/assets/{XClose-BO1_8YHD.js → XClose-DyI1k_z6.js} +1 -1
- package/dist/client/assets/{YAxis-DrM-OWWa.js → YAxis-BOx2DF1X.js} +1 -1
- package/dist/client/assets/{Zap-BUA1_Jut.js → Zap-D44l2tlW.js} +1 -1
- package/dist/client/assets/{ZapSquare-8U0SgWLp.js → ZapSquare-DUHD_nc-.js} +1 -1
- package/dist/client/assets/{access-gate-D3zAqPzH.js → access-gate-D_1GlcS4.js} +1 -1
- package/dist/client/assets/agent-icon-BhfneAwy.js +1 -0
- package/dist/client/assets/agents-list-BUvHAwfb.js +1 -0
- package/dist/client/assets/ai-providers-lRapbKCn.js +6 -0
- package/dist/client/assets/{alert-DSZ984JY.js → alert-CuEsZrDf.js} +1 -1
- package/dist/client/assets/{alert-dialog-BBUALe3i.js → alert-dialog-fRZZzq2b.js} +2 -2
- package/dist/client/assets/api-keys-DOxIXB_j.js +1 -0
- package/dist/client/assets/app-editor-C_guf21J.js +1 -0
- package/dist/client/assets/{auth-CS2cT5wl.js → auth-CsyM6wOp.js} +1 -1
- package/dist/client/assets/{auth-catchall-Bs5rDKB8.js → auth-catchall-B-WhgvT0.js} +1 -1
- package/dist/client/assets/{auth-entry-B7mR5g8T.js → auth-entry-CQkyABOA.js} +1 -1
- package/dist/client/assets/{auth-split-layout-CxqUA4_R.js → auth-split-layout-vT7dwNTB.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-CB658Lpc.js → authenticate-and-persist-oauth-D5NQEgY8.js} +1 -1
- package/dist/client/assets/{automation-list-row-DqAvOKpL.js → automation-list-row-BDX5Zyot.js} +1 -1
- package/dist/client/assets/{automation-runs-C7VPpqIt.js → automation-runs-DTPprHYR.js} +16 -16
- package/dist/client/assets/automations-CkB3kyG0.js +1 -0
- package/dist/client/assets/{avatar-md-XNPuR.js → avatar-DeFAeBFl.js} +1 -1
- package/dist/client/assets/{badge-BR2WgVsV.js → badge-BNu531uc.js} +1 -1
- package/dist/client/assets/{block-document-yl-Al_kf.js → block-document-x1IV3qey.js} +1 -1
- package/dist/client/assets/buckets-J-wFqi2h.js +1 -0
- package/dist/client/assets/bulk-category-panel-CEdqKYSP.js +1 -0
- package/dist/client/assets/{capability-load-error-BornUXv-.js → capability-load-error-DUMl4Cfr.js} +1 -1
- package/dist/client/assets/{cards-B5pz2XNy.js → cards-CL2vc4-W.js} +1 -1
- package/dist/client/assets/category-editor-NdAWtsih.js +1 -0
- package/dist/client/assets/{chart-Dw43HBj2.js → chart-CArbD1Z5.js} +3 -3
- package/dist/client/assets/chat-context-C-y8N43p.js +35 -0
- package/dist/client/assets/{checkbox-CNnFytxt.js → checkbox-D3MLpBTA.js} +1 -1
- package/dist/client/assets/choose-editor-2qYKfGsR.js +1 -0
- package/dist/client/assets/{cli-auth-success-B37XVEcm.js → cli-auth-success-CDGc5a3I.js} +1 -1
- package/dist/client/assets/collection-detail-C2cTonBC.js +1 -0
- package/dist/client/assets/collection-display-button-jiE_9-7-.js +1 -0
- package/dist/client/assets/collection-search-CNrn5ZLG.js +1 -0
- package/dist/client/assets/{collection-table-wrapper-C12GS9C3.js → collection-table-wrapper-C4xZgp9x.js} +1 -1
- package/dist/client/assets/{collection-tabs-Dfa_vQOq.js → collection-tabs-Dg_azfZv.js} +1 -1
- package/dist/client/assets/{command-CXX8Roxa.js → command-BlvzBYcm.js} +1 -1
- package/dist/client/assets/commerce-onboarding-D0tGx8Lj.js +1 -0
- package/dist/client/assets/connect-D3748pCj.js +8 -0
- package/dist/client/assets/connection-CeBlIp_O.js +1 -0
- package/dist/client/assets/connection-card-B5D9qN3O.js +1 -0
- package/dist/client/assets/connection-detail-DuwCDpDs.js +1 -0
- package/dist/client/assets/connection-form-helpers-B3UcqYZu.js +1 -0
- package/dist/client/assets/connections-Dm3ee4Hu.js +1 -0
- package/dist/client/assets/{decopilot-sse-pool-BbcmZgTF.js → decopilot-sse-pool-DvpyeiPr.js} +1 -1
- package/dist/client/assets/dialog-CuqXnWbf.js +1 -0
- package/dist/client/assets/domain-settings-fQdlB2tF.js +1 -0
- package/dist/client/assets/{drawer-9chetton.js → drawer-Dw47OmQ9.js} +1 -1
- package/dist/client/assets/{dropdown-menu-Dhjx8BUz.js → dropdown-menu-Cg8GO9Ey.js} +1 -1
- package/dist/client/assets/{empty-state-BHXPcV6D.js → empty-state-DgtjDyl7.js} +1 -1
- package/dist/client/assets/{extract-connection-data-DyM1tiNg.js → extract-connection-data-CFDQblVE.js} +1 -1
- package/dist/client/assets/{file-explorer-CGdZE7j0.js → file-explorer-BKaBUpVr.js} +2 -2
- package/dist/client/assets/{file-type-icon-jL53noJP.js → file-type-icon-BfTCeyA7.js} +1 -1
- package/dist/client/assets/{form-Cb2ftegM.js → form-gSf7rSoB.js} +1 -1
- package/dist/client/assets/general-fQ-9F_8c.js +1 -0
- package/dist/client/assets/{github-repo-picker-B0itW_sn.js → github-repo-picker-DxNDjsxj.js} +1 -1
- package/dist/client/assets/{hooks-BasSX9U3.js → hooks-IJLcrm9m.js} +5 -5
- package/dist/client/assets/{index-CJWr9N0v.js → index-BXFmp3WW.js} +1 -1
- package/dist/client/assets/index-BoZK85Tz.js +1 -0
- package/dist/client/assets/index-C-W5dASy.js +235 -0
- package/dist/client/assets/{index-BnYSClvU.js → index-CTd9wjzr.js} +37 -37
- package/dist/client/assets/{index-BHhk6DR8.js → index-CZyJSpiW.js} +2 -2
- package/dist/client/assets/{index-ZiQvvnOE.js → index-DkaFt-ER.js} +1 -1
- package/dist/client/assets/index-E5NqaLsL.js +1 -0
- package/dist/client/assets/index-JZrhswCW.js +1 -0
- package/dist/client/assets/index-redirect-BARimKaN.js +1 -0
- package/dist/client/assets/{index-BGLk9CX0.js → index-rmUjTFsu.js} +2 -2
- package/dist/client/assets/infra-billing-CsjaugX6.js +1 -0
- package/dist/client/assets/{input-7l72-E74.js → input-BPzKKVIm.js} +1 -1
- package/dist/client/assets/{integration-icon-9hdQMmio.js → integration-icon-0pMS4e0x.js} +1 -1
- package/dist/client/assets/invite-member-dialog-DncQfqgo.js +1 -0
- package/dist/client/assets/{label-Di7XD03t.js → label-Cy4ljnv_.js} +1 -1
- package/dist/client/assets/layout-DH8wLQcr.js +1 -0
- package/dist/client/assets/{login-B01_8Sdh.js → login-CYjOmWQU.js} +1 -1
- package/dist/client/assets/{mcp-oauth-_naDcGdv.js → mcp-oauth-D5NqWvPJ.js} +1 -1
- package/dist/client/assets/members-2QPdx0w5.js +1 -0
- package/dist/client/assets/{monaco-editor-DgD9evL7.js → monaco-editor-SX25UZKO.js} +4 -4
- package/dist/client/assets/{monitoring-stats-row-B0BLM1my.js → monitoring-stats-row-DOzTz31T.js} +1 -1
- package/dist/client/assets/{multi-select-BLNYHoGy.js → multi-select-DQX6uGgz.js} +1 -1
- package/dist/client/assets/{oauth-callback-BqBCpIME.js → oauth-callback-Bl1uQrp-.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-DA5Wl5SM.js → oauth-callback-ai-provider-D6vkHSiC.js} +1 -1
- package/dist/client/assets/{onboarding-px_II1bW.js → onboarding-DLUW7rwC.js} +1 -1
- package/dist/client/assets/{org-layout-DFED5zNf.js → org-layout-CHqCDI-6.js} +1 -1
- package/dist/client/assets/{organization-choice-IrwqMfm_.js → organization-choice-C665vOEP.js} +1 -1
- package/dist/client/assets/orgs-B8XetzAm.js +1 -0
- package/dist/client/assets/{page-seo-form-Cm5Qv5ak.js → page-seo-form-BqksEx3f.js} +1 -1
- package/dist/client/assets/{popover-CfGL7saO.js → popover-CKC_v_FI.js} +1 -1
- package/dist/client/assets/post-editor-D0V_cWUV.js +1 -0
- package/dist/client/assets/{primitives-DIc8lbRG.js → primitives-C4dJYS7T.js} +1 -1
- package/dist/client/assets/profile-CUktqNbW.js +1 -0
- package/dist/client/assets/project-app-view-DQXGeh0y.js +1 -0
- package/dist/client/assets/record-editor-D5yY3Dz9.js +1 -0
- package/dist/client/assets/redirect-editor-BEdHUyBe.js +1 -0
- package/dist/client/assets/registry-BWnBGVZj.js +2 -0
- package/dist/client/assets/{registry-layout-t9OiEUok.js → registry-layout-1Qslk_W6.js} +4 -4
- package/dist/client/assets/{reports-B-JkBTXv.js → reports-Bvrg-uin.js} +1 -1
- package/dist/client/assets/require-capability-DR7Mbbou.js +1 -0
- package/dist/client/assets/{required-auth-layout-DgjkQLI6.js → required-auth-layout-C7iO_f_Y.js} +1 -1
- package/dist/client/assets/{reset-password-C_dZ8Eqo.js → reset-password-D5H5T765.js} +1 -1
- package/dist/client/assets/roles-D4n1d-tX.js +1 -0
- package/dist/client/assets/{search-input-DsWKOK9t.js → search-input-vt9k7znl.js} +1 -1
- package/dist/client/assets/secrets-saGLdJQ9.js +1 -0
- package/dist/client/assets/{sections-editor-hTI5vt6I.js → sections-editor-dlfE05iX.js} +2 -2
- package/dist/client/assets/select-CX1EQjk0.js +1 -0
- package/dist/client/assets/{select-model-Dqz5FPx4.js → select-model-By0_2E97.js} +2 -2
- package/dist/client/assets/self-tool-result-wLzQezsb.js +1 -0
- package/dist/client/assets/seo-editor-BgJ2ySZq.js +1 -0
- package/dist/client/assets/settings-layout-_qKXk5vn.js +1 -0
- package/dist/client/assets/shell-controls-DUgcifyl.js +1 -0
- package/dist/client/assets/shell-layout-BGunSaDG.js +1 -0
- package/dist/client/assets/{spinner-glqojFDA.js → spinner-DQUJXeRb.js} +1 -1
- package/dist/client/assets/sso-DNeFyj4s.js +1 -0
- package/dist/client/assets/store-CLnACfV7.js +1 -0
- package/dist/client/assets/store-registry-CYcCjiAW.js +2 -0
- package/dist/client/assets/switch-080KuP0Z.js +1 -0
- package/dist/client/assets/synced-repos-CQQV9Zjv.js +1 -0
- package/dist/client/assets/{tab-id-CYxMrTRp.js → tab-id-BMHIgJVu.js} +1 -1
- package/dist/client/assets/{table-_DZMZF7n.js → table-DxRhe_5K.js} +1 -1
- package/dist/client/assets/tabs-Dt2F-lST.js +1 -0
- package/dist/client/assets/tasks-BaA9DyLn.js +1 -0
- package/dist/client/assets/textarea-C50htUTR.js +1 -0
- package/dist/client/assets/toggle-group-CT4Q_c7z.js +1 -0
- package/dist/client/assets/{toolbar-DEkBOfzd.js → toolbar-nEkAKWTR.js} +1 -1
- package/dist/client/assets/{track-C3SQxOl4.js → track-BifnyqN6.js} +1 -1
- package/dist/client/assets/{types-Dh-L4V2P.js → types-DZVMpxej.js} +4 -4
- package/dist/client/assets/use-ai-providers-Chs1tcQD.js +1 -0
- package/dist/client/assets/use-api-keys-Djf4Eh5p.js +1 -0
- package/dist/client/assets/use-automations-CmpL_Mom.js +1 -0
- package/dist/client/assets/{use-autosave-P4ije4un.js → use-autosave-D5h0ivOe.js} +1 -1
- package/dist/client/assets/{use-clock-tick-yZZNkqhy.js → use-clock-tick-Cad8pAZ9.js} +1 -1
- package/dist/client/assets/use-commerce-diagnostic-CRHEo45Z.js +1 -0
- package/dist/client/assets/use-connection-DzUFG_BF.js +1 -0
- package/dist/client/assets/{use-copy-BGwAE5Xe.js → use-copy-B43wL_o8.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-B5mSvVFn.js → use-create-virtual-mcp-CTvxs6s1.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-BDvfPMkV.js → use-debounced-autosave-DSiZvyT9.js} +1 -1
- package/dist/client/assets/{use-debounced-value-UZPGD-zb.js → use-debounced-value-Dq1JGl41.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-8dmobXlE.js → use-decopilot-events-ka0F1PHR.js} +1 -1
- package/dist/client/assets/use-delete-connection-CySUkdqd.js +1 -0
- package/dist/client/assets/{use-deployment-admin-tOuWllrn.js → use-deployment-admin-BQBai7bt.js} +1 -1
- package/dist/client/assets/use-file-configs-B6WrrXgQ.js +1 -0
- package/dist/client/assets/{use-infinite-scroll-Dzm35RNS.js → use-infinite-scroll-4H8mlAbs.js} +1 -1
- package/dist/client/assets/use-join-requests-eJo_jJba.js +1 -0
- package/dist/client/assets/{use-mcp-client-DFoPNyXR.js → use-mcp-client-PMt78ucZ.js} +7 -7
- package/dist/client/assets/use-mcp-tools-BgEqxU0u.js +1 -0
- package/dist/client/assets/use-members-CzhU7i-s.js +1 -0
- package/dist/client/assets/{use-navigate-to-agent-CX93JJ-W.js → use-navigate-to-agent-DpqkGd8j.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-CiGZ-xlx.js → use-org-auth-client-DCF2a5iN.js} +1 -1
- package/dist/client/assets/use-org-repo-syncs-t5rFG9d3.js +1 -0
- package/dist/client/assets/{use-org-sso-CHwTj_pK.js → use-org-sso-DmTf_LfQ.js} +1 -1
- package/dist/client/assets/{use-organization-roles-ChU_RgEA.js → use-organization-roles-7NQcUwh1.js} +1 -1
- package/dist/client/assets/use-organization-settings-BQYM8ne1.js +1 -0
- package/dist/client/assets/{use-registry-connections-BvzfOtMr.js → use-registry-connections-CrLBfd4m.js} +1 -1
- package/dist/client/assets/use-secrets-2hVFkyTr.js +1 -0
- package/dist/client/assets/{use-section-preview-base-CYcMtPj5.js → use-section-preview-base-CnPY0DDc.js} +1 -1
- package/dist/client/assets/{use-status-sounds-BWK3t0nt.js → use-status-sounds-u8GHDfsk.js} +1 -1
- package/dist/client/assets/use-tags-C5qFTaG8.js +1 -0
- package/dist/client/assets/use-view-mode-DWyYPm90.js +1 -0
- package/dist/client/assets/{use-virtual-mcp-BbdjNQ1e.js → use-virtual-mcp-eZtpf4bS.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-UhiHP148.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-Cf9qli1T.js +1 -0
- package/dist/client/assets/users-j4gaj7Zx.js +1 -0
- package/dist/client/assets/variant-calendar-DvHJ9GeI.js +1 -0
- package/dist/client/assets/view-mode-toggle-DdFZltId.js +1 -0
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +1 -1
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/ArrowUpRight-Dv9QvAW5.js +0 -1
- package/dist/client/assets/LayoutLeft-BKrrf1xY.js +0 -1
- package/dist/client/assets/X-IBBjQPfk.js +0 -1
- package/dist/client/assets/agent-icon-vjhOL9u6.js +0 -1
- package/dist/client/assets/agents-list-DJeAJ_3a.js +0 -1
- package/dist/client/assets/ai-providers-DmqZvdDR.js +0 -6
- package/dist/client/assets/api-keys-DEdlM0o6.js +0 -1
- package/dist/client/assets/app-editor-DGG6hIQW.js +0 -1
- package/dist/client/assets/automations-QJpsEj6l.js +0 -1
- package/dist/client/assets/buckets-D7AznYZl.js +0 -1
- package/dist/client/assets/bulk-category-panel-Aw08g8MP.js +0 -1
- package/dist/client/assets/card-IdHCmi8B.js +0 -1
- package/dist/client/assets/category-editor-BLU7MJ_a.js +0 -1
- package/dist/client/assets/chat-context-Df1gS1sI.js +0 -35
- package/dist/client/assets/choose-editor-BGNNx0rr.js +0 -1
- package/dist/client/assets/collection-detail-CdVhmMD8.js +0 -1
- package/dist/client/assets/collection-display-button-DpaZ3d0j.js +0 -1
- package/dist/client/assets/collection-search-BQLruUQ4.js +0 -1
- package/dist/client/assets/commerce-onboarding-BOD-_HLG.js +0 -1
- package/dist/client/assets/connect-VrBLOQz7.js +0 -8
- package/dist/client/assets/connection-D6NWrsFQ.js +0 -1
- package/dist/client/assets/connection-card-2s-BDhzN.js +0 -1
- package/dist/client/assets/connection-detail-rH7mQov2.js +0 -1
- package/dist/client/assets/connection-form-helpers-BahPv0zc.js +0 -1
- package/dist/client/assets/connections-X1ffPxSi.js +0 -1
- package/dist/client/assets/dialog-B0pGkX2q.js +0 -1
- package/dist/client/assets/domain-settings-CBmnQIJo.js +0 -1
- package/dist/client/assets/general-DdO_16ZO.js +0 -1
- package/dist/client/assets/index-BVEEZvKv.js +0 -1
- package/dist/client/assets/index-CkEYKazi.js +0 -1
- package/dist/client/assets/index-DBsyf30G.js +0 -1
- package/dist/client/assets/index-DTCr2n-a.js +0 -235
- package/dist/client/assets/index-mAaX9S9j.js +0 -1
- package/dist/client/assets/index-redirect-D24SfTyt.js +0 -1
- package/dist/client/assets/infra-billing-DCiyfS8M.js +0 -1
- package/dist/client/assets/invite-member-dialog-CEZXV_r9.js +0 -1
- package/dist/client/assets/layout-HxxUtI_4.js +0 -1
- package/dist/client/assets/members-C7m7k6Aj.js +0 -1
- package/dist/client/assets/orgs-Ba0nF6qS.js +0 -1
- package/dist/client/assets/post-editor-yBvya3yr.js +0 -1
- package/dist/client/assets/profile-ZEjk6oqp.js +0 -1
- package/dist/client/assets/project-app-view-Ba53vvVz.js +0 -1
- package/dist/client/assets/record-editor-B2rcuwQk.js +0 -1
- package/dist/client/assets/redirect-editor-C-iqitv1.js +0 -1
- package/dist/client/assets/registry-BShVgR7c.js +0 -2
- package/dist/client/assets/require-capability-BganaMDA.js +0 -1
- package/dist/client/assets/roles-CPT4_Zim.js +0 -1
- package/dist/client/assets/secrets-Cm0Tre0I.js +0 -1
- package/dist/client/assets/select-BRuvjhJw.js +0 -1
- package/dist/client/assets/self-tool-result-mEKHKLZ8.js +0 -1
- package/dist/client/assets/seo-editor-DaIHsMkg.js +0 -1
- package/dist/client/assets/settings-layout-Hxpekzl7.js +0 -1
- package/dist/client/assets/settings-section-BS9eoASN.js +0 -1
- package/dist/client/assets/settings-subnav-D-pYtn7v.js +0 -1
- package/dist/client/assets/shell-controls-BhWnmqdm.js +0 -1
- package/dist/client/assets/shell-layout-B7KEX529.js +0 -1
- package/dist/client/assets/sidebar-Z1Ar8Iq1.js +0 -1
- package/dist/client/assets/skeleton-BvZK-LJN.js +0 -1
- package/dist/client/assets/sso-CZzvOl_H.js +0 -1
- package/dist/client/assets/store-4VNI89Jx.js +0 -1
- package/dist/client/assets/store-registry-5DQx43Zm.js +0 -2
- package/dist/client/assets/studio-tools-BBCHIrbu.js +0 -1
- package/dist/client/assets/switch-BAlslK2J.js +0 -1
- package/dist/client/assets/synced-repos-BYuo6K5k.js +0 -1
- package/dist/client/assets/tabs-DeNiwmVV.js +0 -1
- package/dist/client/assets/tasks-BohHzFrx.js +0 -1
- package/dist/client/assets/textarea-DkNj8yms.js +0 -1
- package/dist/client/assets/toggle-group-Do3gb8uy.js +0 -1
- package/dist/client/assets/tooltip-Dt_WUeQs.js +0 -1
- package/dist/client/assets/use-ai-providers-DwZngUHl.js +0 -1
- package/dist/client/assets/use-api-keys-DrlFtOsW.js +0 -1
- package/dist/client/assets/use-automations-BqX_0zG2.js +0 -1
- package/dist/client/assets/use-capability-U_kO9pjO.js +0 -1
- package/dist/client/assets/use-commerce-diagnostic-DL4B4X1w.js +0 -1
- package/dist/client/assets/use-connection-D7--TeDa.js +0 -1
- package/dist/client/assets/use-delete-connection-CP8NWsvL.js +0 -1
- package/dist/client/assets/use-file-configs-CgH1G4FU.js +0 -1
- package/dist/client/assets/use-join-requests-CW8P-2hM.js +0 -1
- package/dist/client/assets/use-mcp-tools-ByMlhxuh.js +0 -1
- package/dist/client/assets/use-members-DpAa0K8W.js +0 -1
- package/dist/client/assets/use-mobile-DxjazlC8.js +0 -1
- package/dist/client/assets/use-org-repo-syncs-CugnYvLM.js +0 -1
- package/dist/client/assets/use-organization-settings-kcm-WdX5.js +0 -1
- package/dist/client/assets/use-secrets-CAbcEA8g.js +0 -1
- package/dist/client/assets/use-settings-tabs-qdqtthwY.js +0 -1
- package/dist/client/assets/use-tags-Bcd_6z1e.js +0 -1
- package/dist/client/assets/use-view-mode-cgBHRzHt.js +0 -1
- package/dist/client/assets/useInfiniteQuery-CMi-ILZI.js +0 -1
- package/dist/client/assets/useRouterState-B0WmwZ8z.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-Cw5NEgMj.js +0 -1
- package/dist/client/assets/users-CAr233Ns.js +0 -1
- package/dist/client/assets/variant-calendar--Tz37I5S.js +0 -1
- package/dist/client/assets/view-mode-toggle-ChvR0gk0.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c,j as
|
|
1
|
+
import{c,j as l,et as f,eu as m,n as u,ev as g,ew as x,ex as v,ey as b,ez as h,eA as w,eB as j,eC as N,eD as z,eE as y,eF as _,eG as p}from"./index-C-W5dASy.js";import{i as D}from"./Check-DYWCAvRe.js";import{i as $}from"./ChevronRight-DfFDfMiT.js";import{i as M}from"./DotsVertical-Ds_DhNTo.js";function R(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=l.jsx(f,{"data-slot":"dropdown-menu",...t}),e[2]=t,e[3]=s):s=e[3],s}function T(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=l.jsx(m,{"data-slot":"dropdown-menu-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function E(a){const e=c.c(10);let t,s,o;e[0]!==a?({className:t,sideOffset:o,...s}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);const n=o===void 0?4:o;let r;e[4]!==t?(r=u("notranslate bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border p-1 shadow-md",t),e[4]=t,e[5]=r):r=e[5];let i;return e[6]!==s||e[7]!==n||e[8]!==r?(i=l.jsx(x,{children:l.jsx(v,{"data-slot":"dropdown-menu-content",sideOffset:n,translate:"no",className:r,...s})}),e[6]=s,e[7]=n,e[8]=r,e[9]=i):i=e[9],i}function G(a){const e=c.c(12);let t,s,o,n;e[0]!==a?({className:t,inset:s,variant:n,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);const r=n===void 0?"default":n;let i;e[5]!==t?(i=u("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-pointer items-center gap-2 rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[5]=t,e[6]=i):i=e[6];let d;return e[7]!==s||e[8]!==o||e[9]!==i||e[10]!==r?(d=l.jsx(g,{"data-slot":"dropdown-menu-item","data-inset":s,"data-variant":r,className:i,...o}),e[7]=s,e[8]=o,e[9]=i,e[10]=r,e[11]=d):d=e[11],d}function L(a){const e=c.c(13);let t,s,o,n;e[0]!==a?({className:o,children:s,checked:t,...n}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);let r;e[5]!==o?(r=u("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-lg py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=r):r=e[6];let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=l.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:l.jsx(p,{children:l.jsx(D,{className:"size-4"})})}),e[7]=i):i=e[7];let d;return e[8]!==t||e[9]!==s||e[10]!==n||e[11]!==r?(d=l.jsxs(h,{"data-slot":"dropdown-menu-checkbox-item",className:r,checked:t,...n,children:[i,s]}),e[8]=t,e[9]=s,e[10]=n,e[11]=r,e[12]=d):d=e[12],d}function O(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=l.jsx(y,{"data-slot":"dropdown-menu-radio-group",...t}),e[2]=t,e[3]=s):s=e[3],s}function A(a){const e=c.c(11);let t,s,o;e[0]!==a?({className:s,children:t,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);let n;e[4]!==s?(n=u("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-lg py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",s),e[4]=s,e[5]=n):n=e[5];let r;e[6]===Symbol.for("react.memo_cache_sentinel")?(r=l.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:l.jsx(p,{children:l.jsx(M,{className:"size-2 fill-current"})})}),e[6]=r):r=e[6];let i;return e[7]!==t||e[8]!==o||e[9]!==n?(i=l.jsxs(_,{"data-slot":"dropdown-menu-radio-item",className:n,...o,children:[r,t]}),e[7]=t,e[8]=o,e[9]=n,e[10]=i):i=e[10],i}function B(a){const e=c.c(10);let t,s,o;e[0]!==a?({className:t,inset:s,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);let n;e[4]!==t?(n=u("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",t),e[4]=t,e[5]=n):n=e[5];let r;return e[6]!==s||e[7]!==o||e[8]!==n?(r=l.jsx(b,{"data-slot":"dropdown-menu-label","data-inset":s,className:n,...o}),e[6]=s,e[7]=o,e[8]=n,e[9]=r):r=e[9],r}function F(a){const e=c.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=u("bg-border -mx-1 my-1 h-px",t),e[3]=t,e[4]=o):o=e[4];let n;return e[5]!==s||e[6]!==o?(n=l.jsx(w,{"data-slot":"dropdown-menu-separator",className:o,...s}),e[5]=s,e[6]=o,e[7]=n):n=e[7],n}function P(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=l.jsx(j,{"data-slot":"dropdown-menu-sub",...t}),e[2]=t,e[3]=s):s=e[3],s}function q(a){const e=c.c(13);let t,s,o,n;e[0]!==a?({className:s,inset:o,children:t,...n}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);let r;e[5]!==s?(r=u("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",s),e[5]=s,e[6]=r):r=e[6];let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=l.jsx($,{className:"ml-auto size-4"}),e[7]=i):i=e[7];let d;return e[8]!==t||e[9]!==o||e[10]!==n||e[11]!==r?(d=l.jsxs(N,{"data-slot":"dropdown-menu-sub-trigger","data-inset":o,className:r,...n,children:[t,i]}),e[8]=t,e[9]=o,e[10]=n,e[11]=r,e[12]=d):d=e[12],d}function H(a){const e=c.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=u("notranslate bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",t),e[3]=t,e[4]=o):o=e[4];let n;return e[5]!==s||e[6]!==o?(n=l.jsx(z,{"data-slot":"dropdown-menu-sub-content",translate:"no",className:o,...s}),e[5]=s,e[6]=o,e[7]=n):n=e[7],n}export{T as D,G as a,E as b,R as c,P as d,q as e,H as f,O as g,A as h,F as i,B as j,L as k};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as v,
|
|
1
|
+
import{c as v,n as N,j as t}from"./index-C-W5dASy.js";function y(){const x=v.c(1);let e;return x[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("img",{src:"/empty-state-cards.png",alt:"",width:336,height:320,"aria-hidden":"true"}),x[0]=e):e=x[0],e}function C(x){const e=v.c(24),{image:f,title:p,description:u,actions:o,className:h,descriptionClassName:j,actionsClassName:g}=x;let s;e[0]!==h?(s=N("flex flex-1 flex-col items-center justify-center gap-8 p-4",h),e[0]=h,e[1]=s):s=e[1];let l;e[2]!==f?(l=f!==null&&t.jsx("div",{className:"flex items-center justify-center",children:f??t.jsx(y,{})}),e[2]=f,e[3]=l):l=e[3];let i;e[4]!==p?(i=t.jsx("h3",{className:"text-center text-lg font-medium text-foreground",children:p}),e[4]=p,e[5]=i):i=e[5];let c;e[6]!==j?(c=N("text-sm text-muted-foreground text-center max-w-[300px]",j),e[6]=j,e[7]=c):c=e[7];let a;e[8]!==u||e[9]!==c?(a=t.jsx("div",{className:c,children:u}),e[8]=u,e[9]=c,e[10]=a):a=e[10];let n;e[11]!==i||e[12]!==a?(n=t.jsxs("div",{className:"flex flex-col items-center gap-2",children:[i,a]}),e[11]=i,e[12]=a,e[13]=n):n=e[13];let r;e[14]!==o||e[15]!==g?(r=o&&t.jsx("div",{className:N("flex items-center gap-2",g),children:o}),e[14]=o,e[15]=g,e[16]=r):r=e[16];let m;e[17]!==n||e[18]!==r?(m=t.jsxs("div",{className:"flex flex-col items-center gap-4",children:[n,r]}),e[17]=n,e[18]=r,e[19]=m):m=e[19];let d;return e[20]!==s||e[21]!==l||e[22]!==m?(d=t.jsxs("div",{className:s,children:[l,m]}),e[20]=s,e[21]=l,e[22]=m,e[23]=d):d=e[23],d}export{C as E};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as I}from"./metadata-dUsYcpuu.js";import"./index-
|
|
1
|
+
import{g as I}from"./metadata-dUsYcpuu.js";import"./index-C-W5dASy.js";import{c as E}from"./use-mcp-client-PMt78ucZ.js";import{W as T}from"./constants-BSYv1IkQ.js";function U(t){if(!t)return null;const e=typeof t=="string"?t:t.url;if(!e)return null;const n=e.match(/github\.com[/:]([^/]+)\/([^/]+?)(?:\.git)?\/?$/);return n?{owner:n[1]||"",repo:n[2]||""}:null}function H(t){const e=U(t);if(!e)return null;const n=`https://github.com/${e.owner}.png`;return`https://images.weserv.nl/?url=${encodeURIComponent(n)}&output=webp`}function L(t,e){return t===T.REGISTRY(e)||t===T.COMMUNITY_REGISTRY(e)}function J(t,e){return L(t,e)?"COLLECTION_REGISTRY_APP_LIST":"REGISTRY_ITEM_LIST"}function Q(t){if(!t)return[];const e=[];for(const n of t){let a=[];if(Array.isArray(n))a=n;else if(typeof n=="object"&&n!==null){const r=Object.keys(n).find(o=>Array.isArray(n[o]));r&&(a=n[r])}e.push(...a)}return e}const D={"streamable-http":"HTTP",http:"HTTP",sse:"SSE",stdio:"STDIO",websocket:"Websocket"};function G(t){return t?D[t]??t.toUpperCase():null}function X(t){if(!t)return[];if(Array.isArray(t))return t;if(typeof t=="object"&&t!==null){const e=Object.keys(t).find(n=>Array.isArray(t[n]));if(e)return t[e]}return[]}async function Z(t,e,n,a,r){const o=await E({connectionId:t,orgId:e,orgSlug:n});try{const s=await o.callTool({name:a,arguments:r});return s.structuredContent??s}finally{await o.close().catch(console.error)}}let Y="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",$=(t=21)=>{let e="",n=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)e+=Y[n[t]&63];return e};function j(t){return`${t}_${$()}`}function V(t){return I(t._meta)?.appName||t.server?.name||null}function K(t){if(!t?.url)return"Unknown";try{return new URL(t.url).hostname}catch{return t.url}}function W(t){const e=t?.identifier||t?.name;return e?e.replace(/^@[^/]+\//,"").replace(/[-_]/g," ").replace(/\b\w/g,a=>a.toUpperCase()):"Unknown"}function tt(t,e,n,a){const r=t.server,o=I(t._meta),s=new Date().toISOString(),R=o?.friendlyName||o?.friendly_name||t.title||r?.title||r?.name||"Unnamed MCP Server",k=r?.description||null,w=r?.icons?.[0]?.src||H(r?.repository)||null,i=o?.oauth_config,A=i&&typeof i.authorizationEndpoint=="string"&&typeof i.tokenEndpoint=="string"&&typeof i.clientId=="string"&&Array.isArray(i.scopes)&&(i.grantType==="authorization_code"||i.grantType==="client_credentials")?i:null,C=o?.configuration_state,v=o?.configuration_scopes,P=r?.repository?{url:r.repository.url,source:r.repository.source,subfolder:r.repository.subfolder}:null,p=r?.packages??[],g=r?.remotes??[],S=a?.packageIndex??0,N=a?.remoteIndex??0,y=p.length>0&&(a?.packageIndex!==void 0||g.length===0),c=y?p[S]:null,l=y?null:g[N];let u,f,h=null;if(c){const _=c.identifier||c.name;u="STDIO",f="";const m={};if(c.environmentVariables)for(const b of c.environmentVariables)b.name&&(m[b.name]="");h={command:"npx",args:_?["-y",_]:[],...Object.keys(m).length>0&&{envVars:m}}}else l?(u=G(l.type)||"HTTP",f=l.url||""):(u="HTTP",f="");const M=g.length>1,O=p.length>1;let d="";c&&O?d=` (${W(c)})`:l&&M&&(d=` (${K(l)})`);const x=R+d;return{id:j("conn"),title:x,description:k,icon:w,app_name:V(t),app_id:o?.id||t.id||null,connection_type:u,connection_url:f,connection_token:null,connection_headers:h,oauth_config:A,configuration_state:C??null,configuration_scopes:v??null,metadata:{source:"store",registry_item_id:t.id,verified:o?.verified??!1,scopeName:o?.scopeName??null,toolsCount:o?.tools?.length??0,publishedAt:o?.publishedAt??null,repository:P},created_at:s,updated_at:s,created_by:n,organization_id:e,tools:null,bindings:null,status:"inactive"}}export{V as a,H as b,Z as c,X as d,tt as e,Q as f,j as g,J as i};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as se,b as Me,r as u,j as r,k as fe,B as De,e9 as Jt,aG as Zt,aM as xe,ea as en,eb as tn,ec as nn,ed as rn,bT as on,ee as sn,ef as lt,aI as an,eg as ln,eh as cn,ei as dn,ej as un,ek as fn,el as pn,em as mn,en as xn,eo as hn,m as le,o as gn,t as ne,K as Ze}from"./index-DTCr2n-a.js";import{F as bn,l as yn}from"./monaco-editor-DgD9evL7.js";import{d as vn,a$ as Cn,b0 as wn}from"./agent-icon-vjhOL9u6.js";import{s as jn}from"./XClose-BO1_8YHD.js";import{B as Nn}from"./automation-runs-C7VPpqIt.js";import{c as et,T as tt,a as nt}from"./tooltip-Dt_WUeQs.js";import{a as En}from"./chat-context-Df1gS1sI.js";import{u as Sn}from"./shell-layout-B7KEX529.js";import{i as Dn,E as Mn,a as Ae,b as Rn,f as Tn,g as Pn,c as kn,t as re,d as we,e as Le,h as je,j as Oe,k as Ie,l as Fn,s as An,v as Ln,m as $e,n as Ne,o as rt,p as On,q as Ee,r as Ke,w as In,x as $n,y as Kn,z as zn}from"./index-BnYSClvU.js";import{b as _n,h as Gn,a as Bn,c as Vn,d as Un,e as Hn}from"./dialog-B0pGkX2q.js";import{I as ot}from"./input-7l72-E74.js";import{c as qn,d as Wn,b as Qn,f as Xn,g as Yn,e as Jn,a as Zn,A as er}from"./alert-dialog-BBUALe3i.js";import{t as tr}from"./ChevronDown-Dgga4a4Q.js";import{i as nr}from"./ChevronRight-Cf-ty0tK.js";import{i as rr}from"./Share07-KO4nWaTW.js";import"./spinner-glqojFDA.js";import"./delay-CnY5UFtP.js";import"./AlertCircle-DYa65h7M.js";import"./Tool01-BjJidQ3c.js";import"./ArrowUp-DaPuMC6J.js";import"./ArrowLeft-D0sSJGyh.js";import"./Tool02-Bs7nBBx_.js";import"./XCircle-3TmYYaVT.js";import"./ArrowUpRight-Dv9QvAW5.js";import"./TrendUp01-BQO_JaWi.js";import"./ZapSquare-8U0SgWLp.js";import"./Users03-a8f_wZmP.js";import"./CheckCircle-CiRCtOI3.js";import"./Check-ErA_74IV.js";import"./ChevronSelectorVertical-BS9Eaphx.js";import"./ChevronUp-DOEAI0tE.js";import"./DotsVertical-B9Mg1LjT.js";import"./Stars02-D7QMgn6_.js";import"./UserSquare-1p4hY8NI.js";import"./Copy01-C8DEngph.js";import"./CreditCard01-LLnESWWX.js";import"./Download01-CKTo0VS3.js";import"./Settings02-zoYBf2Q9.js";import"./Eye-C-IIbq0b.js";import"./FilterLines-BmuWDJhh.js";import"./Globe01-AGteY5p8.js";import"./Globe04-B6IxAzhj.js";import"./SwitchHorizontal01-ByrC3JZW.js";import"./HardDrive-Bxx1_cqg.js";import"./Key01-Du0R52Fs.js";import"./LayoutLeft-BKrrf1xY.js";import"./LinkExternal01-lwDudDKU.js";import"./LockUnlocked01-ChTbbG9p.js";import"./LogOut01-VHtvJ8Vp.js";import"./Monitor01-DA25Iq0R.js";import"./Sun-CH0lCvO4.js";import"./Palette-yngNVQ4n.js";import"./Play-CsQhzYUI.js";import"./Plus-Cf4b1bNp.js";import"./SearchLg-CIhGyLjl.js";import"./SearchMd-B1dsuEY7.js";import"./Shield01-EKP5VJCL.js";import"./Stars01-BgC1nyVS.js";import"./Trash01-C4UDDTjr.js";import"./Upload01-k3Mh0fZU.js";import"./User01-m6vclzYC.js";import"./Users01-CWeSTta9.js";import"./X-IBBjQPfk.js";import"./Zap-BUA1_Jut.js";import"./select-BRuvjhJw.js";import"./useInfiniteQuery-CMi-ILZI.js";import"./use-infinite-scroll-Dzm35RNS.js";import"./use-connection-D7--TeDa.js";import"./use-mcp-client-DFoPNyXR.js";import"./constants-BSYv1IkQ.js";import"./auth-CS2cT5wl.js";import"./use-virtual-mcp-BbdjNQ1e.js";import"./card-IdHCmi8B.js";import"./sidebar-Z1Ar8Iq1.js";import"./use-mobile-DxjazlC8.js";import"./table-_DZMZF7n.js";import"./empty-state-BHXPcV6D.js";import"./use-members-DpAa0K8W.js";import"./use-org-auth-client-CiGZ-xlx.js";import"./use-clock-tick-yZZNkqhy.js";import"./use-automations-BqX_0zG2.js";import"./studio-tools-BBCHIrbu.js";import"./useSuspenseInfiniteQuery-Cw5NEgMj.js";import"./avatar-md-XNPuR.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-BGwAE5Xe.js";import"./tab-id-CYxMrTRp.js";import"./hooks-BasSX9U3.js";import"./decopilot-sse-pool-BbcmZgTF.js";import"./backoff-CrEUbyZT.js";import"./types-Dh-L4V2P.js";import"./integration-icon-9hdQMmio.js";import"./use-navigate-to-agent-CX93JJ-W.js";import"./reusable-new-chat-CouMjkYR.js";import"./chart-Dw43HBj2.js";import"./index-ZiQvvnOE.js";import"./form-Cb2ftegM.js";import"./label-Di7XD03t.js";import"./file-type-icon-jL53noJP.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-ai-providers-DwZngUHl.js";import"./use-decopilot-events-8dmobXlE.js";import"./use-organization-settings-kcm-WdX5.js";import"./required-auth-layout-DgjkQLI6.js";import"./use-org-sso-CHwTj_pK.js";import"./drawer-9chetton.js";import"./collection-search-BQLruUQ4.js";import"./deco-site-production-url-BjY4ZYd-.js";import"./tabs-DeNiwmVV.js";import"./toggle-group-Do3gb8uy.js";import"./use-commerce-diagnostic-DL4B4X1w.js";import"./popover-CfGL7saO.js";import"./self-tool-result-mEKHKLZ8.js";import"./extract-connection-data-DyM1tiNg.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-CMPWtdMv.js";import"./use-debounced-value-UZPGD-zb.js";import"./authenticate-and-persist-oauth-CB658Lpc.js";import"./mcp-oauth-_naDcGdv.js";import"./track-C3SQxOl4.js";import"./toolbar-DEkBOfzd.js";import"./skeleton-BvZK-LJN.js";import"./github-repo-picker-B0itW_sn.js";import"./use-mcp-tools-ByMlhxuh.js";import"./agent-capabilities-C4tLW0Za.js";import"./connection-card-2s-BDhzN.js";import"./use-registry-connections-BvzfOtMr.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-DkNj8yms.js";import"./connection-form-helpers-BahPv0zc.js";import"./collection-tabs-Dfa_vQOq.js";import"./badge-BR2WgVsV.js";import"./command-CXX8Roxa.js";import"./index-CJWr9N0v.js";import"./select-model-Dqz5FPx4.js";import"./checkbox-CNnFytxt.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-BS9eoASN.js";import"./cards-B5pz2XNy.js";import"./dropdown-menu-Dhjx8BUz.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-BWK3t0nt.js";import"./use-capability-U_kO9pjO.js";import"./use-file-configs-CgH1G4FU.js";import"./pt-BR-CLy76QW2.js";import"./switch-BAlslK2J.js";import"./use-debounced-autosave-BDvfPMkV.js";import"./index-mAaX9S9j.js";import"./search-input-DsWKOK9t.js";import"./index-DBsyf30G.js";import"./use-secrets-CAbcEA8g.js";import"./AreaChart-Z7000aGF.js";import"./use-tags-Bcd_6z1e.js";import"./get-initials-D-f_fDFw.js";import"./automation-list-row-DqAvOKpL.js";import"./use-org-repo-syncs-CugnYvLM.js";const or={"new-file":{titleKey:"sandbox.fileExplorerNameDialog.newFileTitle",descriptionKey:"sandbox.fileExplorerNameDialog.newFileDescription",submitKey:"sandbox.fileExplorerNameDialog.newFileSubmit",placeholderKey:"sandbox.fileExplorerNameDialog.newFilePlaceholder"},"new-folder":{titleKey:"sandbox.fileExplorerNameDialog.newFolderTitle",descriptionKey:"sandbox.fileExplorerNameDialog.newFolderDescription",submitKey:"sandbox.fileExplorerNameDialog.newFolderSubmit",placeholderKey:"sandbox.fileExplorerNameDialog.newFolderPlaceholder"},rename:{titleKey:"sandbox.fileExplorerNameDialog.renameTitle",descriptionKey:"sandbox.fileExplorerNameDialog.renameDescription",submitKey:"sandbox.fileExplorerNameDialog.renameSubmit",placeholderKey:"sandbox.fileExplorerNameDialog.renamePlaceholder"}};function sr(a){const e=se.c(71),{open:s,mode:i,initialName:l,parentLabel:m,isPending:h,onSubmit:f,onOpenChange:v}=a,N=l===void 0?"":l,d=h===void 0?!1:h,x=Me(),[g,k]=u.useState(N),[Z,q]=u.useState(s),y=or[i];s!==Z&&(q(s),s&&k(N));let b;e[0]!==d||e[1]!==v?(b=_=>{!_&&!d&&v(!1)},e[0]=d,e[1]=v,e[2]=b):b=e[2];const F=b;let A;e[3]!==d||e[4]!==g||e[5]!==f?(A=async _=>{_.preventDefault();const te=g.trim();!te||d||await f(te)},e[3]=d,e[4]=g,e[5]=f,e[6]=A):A=e[6];const I=A;let S;e[7]!==y.titleKey||e[8]!==x?(S=x(y.titleKey),e[7]=y.titleKey,e[8]=x,e[9]=S):S=e[9];let P;e[10]!==S?(P=r.jsx(_n,{children:S}),e[10]=S,e[11]=P):P=e[11];let D;e[12]!==y.descriptionKey||e[13]!==x?(D=x(y.descriptionKey),e[12]=y.descriptionKey,e[13]=x,e[14]=D):D=e[14];let M;e[15]!==D?(M=r.jsx(Gn,{children:D}),e[15]=D,e[16]=M):M=e[16];let j;e[17]!==P||e[18]!==M?(j=r.jsxs(Bn,{children:[P,M]}),e[17]=P,e[18]=M,e[19]=j):j=e[19];let R;e[20]!==m||e[21]!==x?(R=m&&r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:x("sandbox.fileExplorerNameDialog.location")}),r.jsx(ot,{value:m,readOnly:!0,disabled:!0,className:"font-mono text-xs"})]}),e[20]=m,e[21]=x,e[22]=R):R=e[22];let E;e[23]!==x?(E=x("sandbox.fileExplorerNameDialog.name"),e[23]=x,e[24]=E):E=e[24];let T;e[25]!==E?(T=r.jsx("label",{htmlFor:"file-explorer-name",className:"text-xs font-medium text-muted-foreground",children:E}),e[25]=E,e[26]=T):T=e[26];let Q;e[27]===Symbol.for("react.memo_cache_sentinel")?(Q=_=>k(_.target.value),e[27]=Q):Q=e[27];let X;e[28]!==y.placeholderKey||e[29]!==x?(X=x(y.placeholderKey),e[28]=y.placeholderKey,e[29]=x,e[30]=X):X=e[30];let Y;e[31]!==d||e[32]!==g||e[33]!==X?(Y=r.jsx(ot,{id:"file-explorer-name",value:g,onChange:Q,placeholder:X,autoFocus:!0,disabled:d}),e[31]=d,e[32]=g,e[33]=X,e[34]=Y):Y=e[34];let G;e[35]!==T||e[36]!==Y?(G=r.jsxs("div",{className:"space-y-1.5",children:[T,Y]}),e[35]=T,e[36]=Y,e[37]=G):G=e[37];let $;e[38]!==R||e[39]!==G?($=r.jsxs("div",{className:"space-y-4 py-4",children:[R,G]}),e[38]=R,e[39]=G,e[40]=$):$=e[40];let W;e[41]!==v?(W=()=>v(!1),e[41]=v,e[42]=W):W=e[42];let K;e[43]!==x?(K=x("sandbox.fileExplorerNameDialog.cancel"),e[43]=x,e[44]=K):K=e[44];let z;e[45]!==d||e[46]!==W||e[47]!==K?(z=r.jsx(De,{type:"button",variant:"outline",onClick:W,disabled:d,children:K}),e[45]=d,e[46]=W,e[47]=K,e[48]=z):z=e[48];let B;e[49]!==d||e[50]!==g?(B=!g.trim()||d,e[49]=d,e[50]=g,e[51]=B):B=e[51];let L;e[52]!==y.submitKey||e[53]!==d||e[54]!==x?(L=d?r.jsxs(r.Fragment,{children:[r.jsx(fe,{size:14,className:"animate-spin"}),x("sandbox.fileExplorerNameDialog.saving")]}):x(y.submitKey),e[52]=y.submitKey,e[53]=d,e[54]=x,e[55]=L):L=e[55];let V;e[56]!==B||e[57]!==L?(V=r.jsx(De,{type:"submit",disabled:B,children:L}),e[56]=B,e[57]=L,e[58]=V):V=e[58];let O;e[59]!==z||e[60]!==V?(O=r.jsxs(Vn,{children:[z,V]}),e[59]=z,e[60]=V,e[61]=O):O=e[61];let U;e[62]!==I||e[63]!==$||e[64]!==O||e[65]!==j?(U=r.jsx(Un,{className:"sm:max-w-md",children:r.jsxs("form",{onSubmit:I,children:[j,$,O]})}),e[62]=I,e[63]=$,e[64]=O,e[65]=j,e[66]=U):U=e[66];let ee;return e[67]!==F||e[68]!==s||e[69]!==U?(ee=r.jsx(Hn,{open:s,onOpenChange:F,children:U}),e[67]=F,e[68]=s,e[69]=U,e[70]=ee):ee=e[70],ee}function ir(a){const e=se.c(47),{deleteTarget:s,deleteDirtyPaths:i,fsActionPending:l,onOpenChange:m,onConfirm:h}=a,f=Me(),v=s?.kind==="directory",N=s!==null,d=v?"sandbox.fileExplorerDeleteDialog.titleFolder":"sandbox.fileExplorerDeleteDialog.titleFile";let x;e[0]!==f||e[1]!==d?(x=f(d),e[0]=f,e[1]=d,e[2]=x):x=e[2];let g;e[3]!==x?(g=r.jsx(qn,{children:x}),e[3]=x,e[4]=g):g=e[4];let k;e[5]!==f?(k=f("sandbox.fileExplorerDeleteDialog.description"),e[5]=f,e[6]=k):k=e[6];const Z=s?.name;let q;e[7]!==Z?(q=r.jsx("span",{className:"font-mono",children:Z}),e[7]=Z,e[8]=q):q=e[8];let y;e[9]!==v||e[10]!==f?(y=v?f("sandbox.fileExplorerDeleteDialog.folderSuffix"):".",e[9]=v,e[10]=f,e[11]=y):y=e[11];let b;e[12]!==i.length||e[13]!==f?(b=i.length>0&&r.jsxs(r.Fragment,{children:[" ",i.length===1?f("sandbox.fileExplorerDeleteDialog.unsavedChangesOne"):f("sandbox.fileExplorerDeleteDialog.unsavedChangesMany",{count:i.length})]}),e[12]=i.length,e[13]=f,e[14]=b):b=e[14];let F;e[15]!==k||e[16]!==q||e[17]!==y||e[18]!==b?(F=r.jsxs(Wn,{children:[k," ",q,y,b]}),e[15]=k,e[16]=q,e[17]=y,e[18]=b,e[19]=F):F=e[19];let A;e[20]!==F||e[21]!==g?(A=r.jsxs(Qn,{children:[g,F]}),e[20]=F,e[21]=g,e[22]=A):A=e[22];let I;e[23]!==f?(I=f("sandbox.fileExplorerDeleteDialog.cancel"),e[23]=f,e[24]=I):I=e[24];let S;e[25]!==l||e[26]!==I?(S=r.jsx(Xn,{disabled:l,children:I}),e[25]=l,e[26]=I,e[27]=S):S=e[27];const P=l||!s;let D;e[28]!==s||e[29]!==h?(D=Q=>{Q.preventDefault(),s&&h(s)},e[28]=s,e[29]=h,e[30]=D):D=e[30];let M;e[31]!==f?(M=f("sandbox.fileExplorerDeleteDialog.delete"),e[31]=f,e[32]=M):M=e[32];let j;e[33]!==P||e[34]!==D||e[35]!==M?(j=r.jsx(Yn,{disabled:P,onClick:D,children:M}),e[33]=P,e[34]=D,e[35]=M,e[36]=j):j=e[36];let R;e[37]!==S||e[38]!==j?(R=r.jsxs(Jn,{children:[S,j]}),e[37]=S,e[38]=j,e[39]=R):R=e[39];let E;e[40]!==A||e[41]!==R?(E=r.jsxs(Zn,{children:[A,R]}),e[40]=A,e[41]=R,e[42]=E):E=e[42];let T;return e[43]!==m||e[44]!==N||e[45]!==E?(T=r.jsx(er,{open:N,onOpenChange:m,children:E}),e[43]=m,e[44]=N,e[45]=E,e[46]=T):T=e[46],T}var ze="ContextMenu",[ar]=an(ze,[lt]),J=lt(),[lr,ct]=ar(ze),dt=a=>{const{__scopeContextMenu:e,children:s,onOpenChange:i,dir:l,modal:m=!0}=a,[h,f]=u.useState(!1),v=J(e),N=on(i),d=u.useCallback(x=>{f(x),N(x)},[N]);return r.jsx(lr,{scope:e,open:h,onOpenChange:d,modal:m,children:r.jsx(sn,{...v,dir:l,open:h,onOpenChange:d,modal:m,children:s})})};dt.displayName=ze;var ut="ContextMenuTrigger",ft=u.forwardRef((a,e)=>{const{__scopeContextMenu:s,disabled:i=!1,...l}=a,m=ct(ut,s),h=J(s),f=u.useRef({x:0,y:0}),v=u.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...f.current})}),N=u.useRef(0),d=u.useCallback(()=>window.clearTimeout(N.current),[]),x=g=>{f.current={x:g.clientX,y:g.clientY},m.onOpenChange(!0)};return u.useEffect(()=>d,[d]),u.useEffect(()=>{i&&d()},[i,d]),r.jsxs(r.Fragment,{children:[r.jsx(Jt,{...h,virtualRef:v}),r.jsx(Zt.span,{"data-state":m.open?"open":"closed","data-disabled":i?"":void 0,...l,ref:e,style:{WebkitTouchCallout:"none",...a.style},onContextMenu:i?a.onContextMenu:xe(a.onContextMenu,g=>{d(),x(g),g.preventDefault()}),onPointerDown:i?a.onPointerDown:xe(a.onPointerDown,Se(g=>{d(),N.current=window.setTimeout(()=>x(g),700)})),onPointerMove:i?a.onPointerMove:xe(a.onPointerMove,Se(d)),onPointerCancel:i?a.onPointerCancel:xe(a.onPointerCancel,Se(d)),onPointerUp:i?a.onPointerUp:xe(a.onPointerUp,Se(d))})]})});ft.displayName=ut;var cr="ContextMenuPortal",pt=a=>{const{__scopeContextMenu:e,...s}=a,i=J(e);return r.jsx(nn,{...i,...s})};pt.displayName=cr;var mt="ContextMenuContent",xt=u.forwardRef((a,e)=>{const{__scopeContextMenu:s,...i}=a,l=ct(mt,s),m=J(s),h=u.useRef(!1);return r.jsx(rn,{...m,...i,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:f=>{a.onCloseAutoFocus?.(f),!f.defaultPrevented&&h.current&&f.preventDefault(),h.current=!1},onInteractOutside:f=>{a.onInteractOutside?.(f),!f.defaultPrevented&&!l.modal&&(h.current=!0)},style:{...a.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});xt.displayName=mt;var dr="ContextMenuGroup",ur=u.forwardRef((a,e)=>{const{__scopeContextMenu:s,...i}=a,l=J(s);return r.jsx(ln,{...l,...i,ref:e})});ur.displayName=dr;var fr="ContextMenuLabel",pr=u.forwardRef((a,e)=>{const{__scopeContextMenu:s,...i}=a,l=J(s);return r.jsx(cn,{...l,...i,ref:e})});pr.displayName=fr;var mr="ContextMenuItem",ht=u.forwardRef((a,e)=>{const{__scopeContextMenu:s,...i}=a,l=J(s);return r.jsx(en,{...l,...i,ref:e})});ht.displayName=mr;var xr="ContextMenuCheckboxItem",hr=u.forwardRef((a,e)=>{const{__scopeContextMenu:s,...i}=a,l=J(s);return r.jsx(dn,{...l,...i,ref:e})});hr.displayName=xr;var gr="ContextMenuRadioGroup",br=u.forwardRef((a,e)=>{const{__scopeContextMenu:s,...i}=a,l=J(s);return r.jsx(un,{...l,...i,ref:e})});br.displayName=gr;var yr="ContextMenuRadioItem",vr=u.forwardRef((a,e)=>{const{__scopeContextMenu:s,...i}=a,l=J(s);return r.jsx(fn,{...l,...i,ref:e})});vr.displayName=yr;var Cr="ContextMenuItemIndicator",wr=u.forwardRef((a,e)=>{const{__scopeContextMenu:s,...i}=a,l=J(s);return r.jsx(pn,{...l,...i,ref:e})});wr.displayName=Cr;var jr="ContextMenuSeparator",gt=u.forwardRef((a,e)=>{const{__scopeContextMenu:s,...i}=a,l=J(s);return r.jsx(tn,{...l,...i,ref:e})});gt.displayName=jr;var Nr="ContextMenuArrow",Er=u.forwardRef((a,e)=>{const{__scopeContextMenu:s,...i}=a,l=J(s);return r.jsx(mn,{...l,...i,ref:e})});Er.displayName=Nr;var Sr="ContextMenuSubTrigger",Dr=u.forwardRef((a,e)=>{const{__scopeContextMenu:s,...i}=a,l=J(s);return r.jsx(xn,{...l,...i,ref:e})});Dr.displayName=Sr;var Mr="ContextMenuSubContent",Rr=u.forwardRef((a,e)=>{const{__scopeContextMenu:s,...i}=a,l=J(s);return r.jsx(hn,{...l,...i,ref:e,style:{...a.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Rr.displayName=Mr;function Se(a){return e=>e.pointerType!=="mouse"?a(e):void 0}var Tr=dt,Pr=ft,kr=pt,Fr=xt,Ar=ht,Lr=gt;function Or(a){const e=se.c(4);let s;e[0]!==a?({...s}=a,e[0]=a,e[1]=s):s=e[1];let i;return e[2]!==s?(i=r.jsx(Tr,{"data-slot":"context-menu",...s}),e[2]=s,e[3]=i):i=e[3],i}function Ir(a){const e=se.c(4);let s;e[0]!==a?({...s}=a,e[0]=a,e[1]=s):s=e[1];let i;return e[2]!==s?(i=r.jsx(Pr,{"data-slot":"context-menu-trigger",...s}),e[2]=s,e[3]=i):i=e[3],i}function $r(a){const e=se.c(8);let s,i;e[0]!==a?({className:s,...i}=a,e[0]=a,e[1]=s,e[2]=i):(s=e[1],i=e[2]);let l;e[3]!==s?(l=le("notranslate bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",s),e[3]=s,e[4]=l):l=e[4];let m;return e[5]!==i||e[6]!==l?(m=r.jsx(kr,{children:r.jsx(Fr,{"data-slot":"context-menu-content",translate:"no",className:l,...i})}),e[5]=i,e[6]=l,e[7]=m):m=e[7],m}function ue(a){const e=se.c(12);let s,i,l,m;e[0]!==a?({className:s,inset:i,variant:m,...l}=a,e[0]=a,e[1]=s,e[2]=i,e[3]=l,e[4]=m):(s=e[1],i=e[2],l=e[3],m=e[4]);const h=m===void 0?"default":m;let f;e[5]!==s?(f=le("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",s),e[5]=s,e[6]=f):f=e[6];let v;return e[7]!==i||e[8]!==l||e[9]!==f||e[10]!==h?(v=r.jsx(Ar,{"data-slot":"context-menu-item","data-inset":i,"data-variant":h,className:f,...l}),e[7]=i,e[8]=l,e[9]=f,e[10]=h,e[11]=v):v=e[11],v}function st(a){const e=se.c(8);let s,i;e[0]!==a?({className:s,...i}=a,e[0]=a,e[1]=s,e[2]=i):(s=e[1],i=e[2]);let l;e[3]!==s?(l=le("bg-border -mx-1 my-1 h-px",s),e[3]=s,e[4]=l):l=e[4];let m;return e[5]!==i||e[6]!==l?(m=r.jsx(Lr,{"data-slot":"context-menu-separator",className:l,...i}),e[5]=i,e[6]=l,e[7]=m):m=e[7],m}const Kr="#d9a441";function zr(a){const e=se.c(63),{node:s,depth:i,isExpanded:l,isSelected:m,isLoading:h,fileVisual:f,onOpen:v,onSelect:N,onNewFile:d,onNewFolder:x,onCopyPath:g,onCopyRelativePath:k,onRename:Z,onDelete:q}=a,y=h===void 0?!1:h,b=Me(),F=s.kind==="directory",{Icon:A,color:I}=f,S=m&&"bg-accent";let P;e[0]!==S?(P=le("flex w-full items-center gap-1.5 px-2 py-1.5 text-left text-[13px] hover:bg-accent transition-colors",S),e[0]=S,e[1]=P):P=e[1];const D=`${i*14+8}px`;let M;e[2]!==D?(M={paddingLeft:D},e[2]=D,e[3]=M):M=e[3];let j;e[4]!==v||e[5]!==N?(j=()=>{N(),v()},e[4]=v,e[5]=N,e[6]=j):j=e[6];let R;e[7]!==A||e[8]!==I||e[9]!==F||e[10]!==l||e[11]!==y?(R=F?r.jsxs(r.Fragment,{children:[y?r.jsx(fe,{size:14,className:"shrink-0 animate-spin text-muted-foreground"}):l?r.jsx(tr,{size:14,className:"shrink-0 text-muted-foreground"}):r.jsx(nr,{size:14,className:"shrink-0 text-muted-foreground"}),r.jsx(rr,{size:16,className:"shrink-0",style:{color:Kr}})]}):r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"w-3.5 shrink-0"}),r.jsx(A,{size:16,className:"shrink-0",style:{color:I}})]}),e[7]=A,e[8]=I,e[9]=F,e[10]=l,e[11]=y,e[12]=R):R=e[12];let E;e[13]!==s.name?(E=r.jsx("span",{className:"truncate",children:s.name}),e[13]=s.name,e[14]=E):E=e[14];let T;e[15]!==P||e[16]!==M||e[17]!==j||e[18]!==R||e[19]!==E?(T=r.jsx(Ir,{asChild:!0,children:r.jsxs("button",{type:"button",className:P,style:M,onClick:j,children:[R,E]})}),e[15]=P,e[16]=M,e[17]=j,e[18]=R,e[19]=E,e[20]=T):T=e[20];let Q;e[21]!==b?(Q=b("sandbox.fileTreeRow.newFile"),e[21]=b,e[22]=Q):Q=e[22];let X;e[23]!==d||e[24]!==Q?(X=r.jsx(ue,{onSelect:d,children:Q}),e[23]=d,e[24]=Q,e[25]=X):X=e[25];let Y;e[26]!==b?(Y=b("sandbox.fileTreeRow.newFolder"),e[26]=b,e[27]=Y):Y=e[27];let G;e[28]!==x||e[29]!==Y?(G=r.jsx(ue,{onSelect:x,children:Y}),e[28]=x,e[29]=Y,e[30]=G):G=e[30];let $;e[31]===Symbol.for("react.memo_cache_sentinel")?($=r.jsx(st,{}),e[31]=$):$=e[31];let W;e[32]!==b?(W=b("sandbox.fileTreeRow.copyPath"),e[32]=b,e[33]=W):W=e[33];let K;e[34]!==g||e[35]!==W?(K=r.jsx(ue,{onSelect:g,children:W}),e[34]=g,e[35]=W,e[36]=K):K=e[36];let z;e[37]!==b?(z=b("sandbox.fileTreeRow.copyRelativePath"),e[37]=b,e[38]=z):z=e[38];let B;e[39]!==k||e[40]!==z?(B=r.jsx(ue,{onSelect:k,children:z}),e[39]=k,e[40]=z,e[41]=B):B=e[41];let L;e[42]===Symbol.for("react.memo_cache_sentinel")?(L=r.jsx(st,{}),e[42]=L):L=e[42];let V;e[43]!==b?(V=b("sandbox.fileTreeRow.rename"),e[43]=b,e[44]=V):V=e[44];let O;e[45]!==Z||e[46]!==V?(O=r.jsx(ue,{onSelect:Z,children:V}),e[45]=Z,e[46]=V,e[47]=O):O=e[47];let U;e[48]!==b?(U=b("sandbox.fileTreeRow.delete"),e[48]=b,e[49]=U):U=e[49];let ee;e[50]!==q||e[51]!==U?(ee=r.jsx(ue,{variant:"destructive",onSelect:q,children:U}),e[50]=q,e[51]=U,e[52]=ee):ee=e[52];let _;e[53]!==X||e[54]!==G||e[55]!==K||e[56]!==B||e[57]!==O||e[58]!==ee?(_=r.jsxs($r,{className:"w-52",children:[X,G,$,K,B,L,O,ee]}),e[53]=X,e[54]=G,e[55]=K,e[56]=B,e[57]=O,e[58]=ee,e[59]=_):_=e[59];let te;return e[60]!==_||e[61]!==T?(te=r.jsxs(Or,{children:[T,_]}),e[60]=_,e[61]=T,e[62]=te):te=e[62],te}yn.config({paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.0/min/vs"}});const it=200,_r=2,Gr=250,at=200;function Br(a,e,s,i){return`/api/${a}/sandbox/${encodeURIComponent(e)}/${encodeURIComponent(s)}/${i}`}function Vr(a){const e=se.c(9),{text:s,query:i}=a;let l,m,h;if(e[0]!==i||e[1]!==s){const{leadingEllipsis:v,segments:N}=Fn(s,i);l="truncate font-mono text-muted-foreground",m=v&&r.jsx("span",{className:"text-muted-foreground/50",children:"…"}),h=N.map(Ur),e[0]=i,e[1]=s,e[2]=l,e[3]=m,e[4]=h}else l=e[2],m=e[3],h=e[4];let f;return e[5]!==l||e[6]!==m||e[7]!==h?(f=r.jsxs("span",{className:l,children:[m,h]}),e[5]=l,e[6]=m,e[7]=h,e[8]=f):f=e[8],f}function Ur(a,e){return a.match?r.jsx("span",{className:"rounded-[2px] bg-primary/20 text-foreground",children:a.text},e):r.jsx("span",{children:a.text},e)}function Bi({orgSlug:a,virtualMcpId:e,branch:s,openPath:i}){const[l,m]=u.useState({files:[],directories:[],truncated:!1}),{files:h,directories:f}=l,[v,N]=u.useState(new Set),[d,x]=u.useState(null),[g,k]=u.useState(null),[Z,q]=u.useState([]),[y,b]=u.useState(""),[F,A]=u.useState(null),[I,S]=u.useState(null),[P,D]=u.useState(!1),[M,j]=u.useState(!1),[R,E]=u.useState(!1),[T,Q]=u.useState(!1),[,X]=u.useState(new Set),[Y,G]=u.useState(new Set),$=u.useRef(0),W=u.useRef(null),K=u.useRef(new Set),z=u.useRef(new Map),B=u.useRef(null),L=u.useRef(0),V=u.useRef(null),O=u.useRef(null),U=u.useRef(null);function ee(t){X(n=>{const o=typeof t=="function"?t(n):t;return K.current=o,o})}const[_,te]=u.useState(new Map),Re=u.useRef(null),[ie,he]=u.useState(null),{sendMessage:bt}=En(),{openSidePanel:yt}=Sn(),ge=gn(),[H,oe]=u.useState(null),[Te,Pe]=u.useState(null),[be,ye]=u.useState(!1);async function ae(t,n){const o=await fetch(Br(a,e,s,t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(n)});if(!o.ok){const c=await o.json().catch(()=>({}));throw new Error(c.error??`Request failed (${o.status})`)}return o.json()}async function ve(){ge.invalidateQueries({queryKey:rt(a,e,s)})}function _e(t,n,o){navigator.clipboard.writeText(o).then(()=>ne.success(t("sandbox.fileExplorer.textCopied",{label:n})),()=>ne.error(t("sandbox.fileExplorer.failedToCopyText",{label:n.toLowerCase()})))}function vt(t){const n=Kn(t);if(!n)return;const o=`${a}/${e}/${s}`;ge.setQueryData(Ze.decofile(o),c=>{if(!c)return c;const{[n]:p,...C}=c;return C}),ge.invalidateQueries({queryKey:Ze.liveMeta(a,e,s)})}function Ct(t){const n=t.kind==="file"?[t.path]:h.filter(o=>o.startsWith(".deco/blocks/")).map(o=>we(o)).filter(o=>o===t.path||o.startsWith(`${t.path}/`));for(const o of n)vt(o)}function wt(t){const n=we(t);return Z.filter(o=>{if(o!==n&&!o.startsWith(`${n}/`))return!1;const c=_.get(o);return!!(c?.loaded&&c.editorValue!==c.savedContent)})}function Ge(t){q(n=>n.map(o=>t(o)).filter(o=>o!==null)),x(n=>n&&t(n)),te(n=>{const o=new Map;for(const[c,p]of n){const C=t(c);C&&o.set(C,p)}return o}),k(n=>{if(!n)return n;const o=t(n.path);return o?o===n.path?n:{...n,path:o,name:o.split("/").pop()??o}:null})}function jt(t){const n=we(t);k(o=>o&&(o.path===n||o.path.startsWith(`${n}/`)?null:o)),Ge(o=>o===n||o.startsWith(`${n}/`)?null:o)}async function Nt(t,n){if(!H)return;const o=Ee(H.parentDir,n);if(Ke(o,h,f))throw new Error(t("sandbox.fileExplorer.fileAlreadyExists",{name:n}));await ae("write",{path:re(o),content:""}),await pe(),await ve(),oe(null),me(o)}async function Et(t,n){if(!H)return;const o=Ee(H.parentDir,n);if(Ke(o,h,f))throw new Error(t("sandbox.fileExplorer.fileAlreadyExists",{name:n}));const c=re(o);await ae("mkdir",{path:c}),m(p=>({...p,directories:p.directories.includes(c)?p.directories:[...p.directories,c]})),await pe(),await ve(),oe(null),N(p=>{const C=new Set(p);for(const ce of Ie(o))C.add(ce);return C.add(o),C}),k({name:n,path:o,kind:"directory",children:[]})}async function St(t,n){if(!H)return;const o=H.node.path,c=je(o),p=Ee(c,n);if(p===o){oe(null);return}if(Ke(p,h,f))throw new Error(t("sandbox.fileExplorer.fileAlreadyExists",{name:n}));await ae("rename",{from:re(o),to:re(p)}),Ge(C=>C===o?p:C.startsWith(`${o}/`)?Ee(p,C.slice(o.length+1)):C),await pe(),await ve(),oe(null)}async function Dt(t,n){ye(!0);try{await ae("unlink",{path:re(n.path),recursive:n.kind==="directory"}),Ct(n),jt(n.path),await pe(),await ve(),Pe(null),ne.success(t("sandbox.fileExplorer.fileDeleted",{name:n.name}))}catch(o){ne.error(o instanceof Error?o.message:t("sandbox.fileExplorer.deleteFailed"))}finally{ye(!1)}}async function Mt(t,n){const o=Ln(n);if(o){ne.error(o);return}ye(!0);try{H?.mode==="new-file"?(await Nt(t,n),ne.success(t("sandbox.fileExplorer.fileCreated",{name:n}))):H?.mode==="new-folder"?(await Et(t,n),ne.success(t("sandbox.fileExplorer.folderCreated",{name:n}))):H?.mode==="rename"&&(await St(t,n),ne.success(t("sandbox.fileExplorer.renamedTo",{name:n})))}catch(c){ne.error(c instanceof Error?c.message:t("sandbox.fileExplorer.operationFailed"))}finally{ye(!1)}}const Be=u.useRef(!1);Be.current||(Be.current=!0,W.current=pe());const[Rt,Tt]=u.useState(null),w=Me();if(i&&i!==Rt){Tt(i);const t=i;queueMicrotask(()=>{Dn(t)&&me(t)})}async function ke(t){const n=await ae("glob",t);return{files:n.files??[],directories:n.directories??[],truncated:n.truncated}}function Ve(t,n,o){if(o!==$.current)return!1;let c=!1;return m(p=>{const C=n?zn(p.files,p.directories,t,p.truncated):{files:t.files,directories:t.directories??[],truncated:!!t.truncated};return c=!!C.truncated,{files:C.files,directories:C.directories,truncated:c}}),c&&ne.warning(w("sandbox.fileExplorer.fileListTruncated")),c}async function Pt(t){const n=z.current.get(t);if(n)return n;const o=$.current,c=(async()=>{const p=await ke({pattern:"**/*",path:re(t),limit:Ae}),C=Ve(p,!0,o);return!C&&o===$.current&&ee(ce=>{const Ce=new Set(ce);return Ce.add(t),Ce}),C})();z.current.set(t,c);try{return await c}finally{z.current.delete(t)}}async function Ue(t){if(!$e(t,K.current))return!1;G(n=>new Set(n).add(t));try{return await Pt(t)}finally{G(n=>{const o=new Set(n);return o.delete(t),o})}}async function kt(t,n){const o=new Set(K.current);for(const c of Ie(n)){if(!$e(c,o))continue;if(await Ue(c))throw new Error(t("sandbox.fileExplorer.folderListingTruncated"));o.add(c)}}async function pe(){const t=++$.current;V.current=null,O.current=null,z.current.clear(),E(!0),ee(new Set),N(new Set),G(new Set);try{const n=await ke({pattern:"**/*",limit:Ae,maxDepth:Mn});Ve(n,!1,t),Q(!0)}catch{T&&ne.error(w("sandbox.fileExplorer.failedToRefreshFileTree"))}finally{E(!1)}}async function He(t){if(!_.get(t)?.loaded){te(o=>{const c=new Map(o);return c.set(t,{savedContent:"",editorValue:"",loaded:!1}),c});try{const o=await ae("read",{path:re(t),full:!0}),c=An(o.content??"");te(p=>{const C=new Map(p);return C.set(t,{savedContent:c,editorValue:c,loaded:!0}),C})}catch{}}}function Ft(){L.current++,A(null),S(null),D(!1),j(!1)}async function At(){const t=$.current,n=V.current;if(n&&n.generation===t)return n.files;const o=O.current;if(o&&o.generation===t)return o.promise;const c=(async()=>{const p=await ke({pattern:"**/*",limit:Ae});return $.current===t&&(V.current={generation:t,files:p.files}),p.files})();O.current={generation:t,promise:c};try{return await c}finally{O.current?.generation===t&&(O.current=null)}}async function Lt(t,n){try{const o=await At();if(n!==L.current)return;A(In(o,t,at))}catch{if(n!==L.current)return;A([])}}async function Ot(t,n){D(!0);try{const o=await ae("grep",{pattern:t,output_mode:"content",ignore_case:!0,fixed_strings:!0,limit:it});if(n!==L.current)return;S($n(o.results??"")),j((o.matchCount??0)>=it)}catch{if(n!==L.current)return;S([]),j(!1)}finally{n===L.current&&D(!1)}}function It(t){const n=t.trim(),o=++L.current;Lt(n,o),n.length<_r?(S(null),D(!1),j(!1)):Ot(n,o)}function $t(t){if(b(t),B.current&&clearTimeout(B.current),!t.trim()){Ft();return}B.current=setTimeout(()=>{It(t)},Gr)}function qe(t){const n=U.current;if(!n||n.path!==d)return;U.current=null;const o=Math.max(1,n.line);t.revealLineInCenter(o),t.setPosition({lineNumber:o,column:1}),t.focus()}function Kt(t){U.current={path:t.path,line:t.line};const n=d===t.path&&_.get(t.path)?.loaded;me(t.path),n&&Re.current&&qe(Re.current)}async function zt(t,n){try{await ae("write",{path:re(t),content:n}),Ne("file saved via sandbox /write",{path:t}),ge.invalidateQueries({queryKey:rt(a,e,s)});try{const o=await On(a,e,s);Ne("git status after save",o)}catch(o){Ne("git status after save failed",{path:t,error:o instanceof Error?o.message:String(o)})}te(o=>{const c=new Map(o),p=c.get(t);return p&&c.set(t,{...p,savedContent:n}),c})}catch(o){Ne("file save failed",{path:t,error:o instanceof Error?o.message:String(o)})}}function _t(t){x(t),k({name:t.split("/").pop()??t,path:t,kind:"file",children:[]}),he(null),Z.includes(t)||q(n=>[...n,t]),He(t)}function Gt(t){q(n=>{const o=n.filter(c=>c!==t);return d===t&&x(o[o.length-1]??null),o}),te(n=>{const o=new Map(n);return o.delete(t),o})}function We(t){N(n=>{const o=new Set(n);return o.has(t)?o.delete(t):o.add(t),o})}async function Bt(t){if($e(t,K.current))try{if(await Ue(t))return}catch(n){ne.error(n instanceof Error?n.message:w("sandbox.fileExplorer.failedToLoadFolder"));return}We(t)}async function Vt(t,n){if(n){We(t);return}await Bt(t)}async function Ut(t){await W.current,await kt(w,t);const n=Ie(t);N(o=>{const c=new Set(o);for(const p of n)c.add(p);return c}),_t(t)}function me(t){Ut(t).catch(n=>{ne.error(n instanceof Error?n.message:w("sandbox.fileExplorer.failedToOpenFile"))})}function Ht(){return g?.kind==="directory"?g.path:g?.kind==="file"?je(g.path):d?je(d):"/"}function Qe(t){const n=Ht();oe({mode:t,parentDir:n,node:{name:"",path:n,kind:"directory",children:[]}})}const qt=Rn(h,f),Xe=Tn(qt,v),Fe=F?.length??0,Ye=Pn(I??[]),Je=I?.length??0,de=d?_.get(d):null,Wt=de?.loaded&&de.editorValue!==de.savedContent,Qt=Te?wt(Te.path):[],Xt=(t,n)=>{Re.current=t,qe(t),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyS,async()=>{if(!d)return;const o=t.getValue();await zt(d,o)}),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyK,()=>{const o=t.getSelection(),c=t.getModel();if(!o||!c||!d)return;const p=c.getValueInRange(o);he({filePath:d,lineStart:o.startLineNumber,lineEnd:o.endLineNumber,selectedCode:p})})};function Yt(t){if(!ie)return;const n=[`The user selected code in the file explorer and asked: **"${t.trim()}"**`,"",`**File:** \`${ie.filePath}\``,`**Lines:** ${ie.lineStart}–${ie.lineEnd}`];if(ie.selectedCode){const o=Oe(ie.filePath),c=ie.selectedCode.replace(/```/g,"`` `");n.push("","**Selected code:**","```"+o,c,"```")}n.push("","Please read the source file, locate the code, and apply the requested change."),yt("chat"),bt({parts:[{type:"text",text:n.join(`
|
|
2
|
-
`)}]}),he(null)}return R&&!T?r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(fe,{size:20,className:"animate-spin text-muted-foreground"})}):r.jsxs("div",{className:"flex h-full w-full overflow-hidden",children:[r.jsxs("div",{className:"w-64 shrink-0 border-r flex flex-col overflow-hidden",children:[r.jsxs("div",{className:"flex items-center gap-1 p-2 border-b",children:[r.jsxs("div",{className:"relative min-w-0 flex-1",children:[r.jsx(vn,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground"}),r.jsx("input",{type:"text",value:y,onChange:t=>$t(t.target.value),placeholder:w("sandbox.fileExplorer.searchFilesPlaceholder"),"aria-label":w("sandbox.fileExplorer.searchFilesLabel"),className:"w-full rounded-md border border-input bg-transparent pl-7 pr-2 py-1.5 text-xs outline-none placeholder:text-muted-foreground focus:ring-1 focus:ring-ring"})]}),r.jsxs(
|
|
1
|
+
import{c as se,b as Me,r as u,j as r,k as fe,B as De,eV as Jt,bd as Zt,bj as xe,eW as en,eX as tn,eY as nn,eZ as rn,cu as on,e_ as sn,e$ as lt,bf as an,f0 as ln,f1 as cn,f2 as dn,f3 as un,f4 as fn,f5 as pn,f6 as mn,f7 as xn,f8 as hn,n as le,p as gn,t as ne,ab as Ze,a8 as et,a9 as tt,K as nt}from"./index-C-W5dASy.js";import{F as bn,l as yn}from"./monaco-editor-SX25UZKO.js";import{d as vn,a$ as Cn,b0 as wn}from"./agent-icon-BhfneAwy.js";import{s as jn}from"./XClose-DyI1k_z6.js";import{B as Nn}from"./automation-runs-DTPprHYR.js";import{a as En}from"./chat-context-C-y8N43p.js";import{u as Sn}from"./shell-layout-BGunSaDG.js";import{i as Dn,E as Mn,a as Ae,b as Rn,f as Tn,g as Pn,c as kn,t as re,d as we,e as Le,h as je,j as Oe,k as Ie,l as Fn,s as An,v as Ln,m as $e,n as Ne,o as rt,p as On,q as Ee,r as Ke,w as In,x as $n,y as Kn,z as zn}from"./index-CTd9wjzr.js";import{b as _n,h as Gn,a as Bn,c as Vn,d as Un,e as Hn}from"./dialog-CuqXnWbf.js";import{I as ot}from"./input-BPzKKVIm.js";import{c as Wn,d as qn,b as Qn,f as Xn,g as Yn,e as Jn,a as Zn,A as er}from"./alert-dialog-fRZZzq2b.js";import{t as tr}from"./ChevronDown-Dm7RFEzi.js";import{i as nr}from"./ChevronRight-DfFDfMiT.js";import{i as rr}from"./Share07-_7OUHtSc.js";import"./spinner-DQUJXeRb.js";import"./delay-CnY5UFtP.js";import"./AlertCircle-BJLsdJJB.js";import"./Tool01-Dg67-JKv.js";import"./ArrowUp-BCnJIsa2.js";import"./ArrowLeft-BpINHsGO.js";import"./Tool02-_e_W6rPa.js";import"./XCircle-Cn5WdVId.js";import"./TrendUp01-CSEGC0U8.js";import"./ZapSquare-DUHD_nc-.js";import"./Users03-DvaTkZMF.js";import"./CheckCircle-CZfdFD75.js";import"./Check-DYWCAvRe.js";import"./ChevronSelectorVertical-BrPFZOd6.js";import"./ChevronUp-YRlpUnbI.js";import"./DotsVertical-Ds_DhNTo.js";import"./Stars02-CsRg1_DW.js";import"./UserSquare-BS_e8Pjv.js";import"./Copy01-B7kE9119.js";import"./CreditCard01-BBWGD6ln.js";import"./Download01-CtExxOFo.js";import"./Settings02-DsPup1VS.js";import"./Eye-Bkw_HSyr.js";import"./FilterLines-CdBZbJbR.js";import"./Globe01-CbzTjXVx.js";import"./Globe04-5uq9vA8E.js";import"./SwitchHorizontal01-Buwrdn2y.js";import"./HardDrive-DLZzUCJy.js";import"./Key01-WP13V6P8.js";import"./LinkExternal01-DWP8dcJA.js";import"./LockUnlocked01-BsAWOf6A.js";import"./LogOut01-DUJGO4hF.js";import"./Monitor01-DZgvR7bI.js";import"./Sun-lLrEGeIB.js";import"./Palette-BRlImZFI.js";import"./Play-xBrWdkON.js";import"./Plus-DKhcQWfb.js";import"./SearchLg-BzZYCybQ.js";import"./SearchMd-C-eFE6qY.js";import"./Shield01-BMGrPJL4.js";import"./Stars01-DyPW1NZ3.js";import"./Trash01-649gpHj9.js";import"./Upload01-DjDsiYUt.js";import"./User01-Dlgu2BER.js";import"./Users01-C7EqAQaR.js";import"./Zap-D44l2tlW.js";import"./select-CX1EQjk0.js";import"./useInfiniteQuery-UhiHP148.js";import"./use-infinite-scroll-4H8mlAbs.js";import"./use-connection-DzUFG_BF.js";import"./use-mcp-client-PMt78ucZ.js";import"./constants-BSYv1IkQ.js";import"./auth-CsyM6wOp.js";import"./use-virtual-mcp-eZtpf4bS.js";import"./table-DxRhe_5K.js";import"./empty-state-DgtjDyl7.js";import"./use-members-CzhU7i-s.js";import"./use-org-auth-client-DCF2a5iN.js";import"./use-clock-tick-Cad8pAZ9.js";import"./use-automations-CmpL_Mom.js";import"./useSuspenseInfiniteQuery-Cf9qli1T.js";import"./avatar-DeFAeBFl.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-B43wL_o8.js";import"./tab-id-BMHIgJVu.js";import"./hooks-IJLcrm9m.js";import"./decopilot-sse-pool-DvpyeiPr.js";import"./backoff-CrEUbyZT.js";import"./types-DZVMpxej.js";import"./integration-icon-0pMS4e0x.js";import"./use-navigate-to-agent-DpqkGd8j.js";import"./reusable-new-chat-CouMjkYR.js";import"./chart-CArbD1Z5.js";import"./index-DkaFt-ER.js";import"./form-gSf7rSoB.js";import"./label-Cy4ljnv_.js";import"./file-type-icon-BfTCeyA7.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-ai-providers-Chs1tcQD.js";import"./use-decopilot-events-ka0F1PHR.js";import"./use-organization-settings-BQYM8ne1.js";import"./required-auth-layout-C7iO_f_Y.js";import"./use-org-sso-DmTf_LfQ.js";import"./drawer-Dw47OmQ9.js";import"./collection-search-CNrn5ZLG.js";import"./deco-site-production-url-BjY4ZYd-.js";import"./tabs-Dt2F-lST.js";import"./toggle-group-CT4Q_c7z.js";import"./use-commerce-diagnostic-CRHEo45Z.js";import"./popover-CKC_v_FI.js";import"./self-tool-result-wLzQezsb.js";import"./extract-connection-data-CFDQblVE.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-CMPWtdMv.js";import"./use-debounced-value-Dq1JGl41.js";import"./authenticate-and-persist-oauth-D5NQEgY8.js";import"./mcp-oauth-D5NqWvPJ.js";import"./track-BifnyqN6.js";import"./toolbar-nEkAKWTR.js";import"./github-repo-picker-DxNDjsxj.js";import"./use-mcp-tools-BgEqxU0u.js";import"./agent-capabilities-C4tLW0Za.js";import"./connection-card-B5D9qN3O.js";import"./use-registry-connections-CrLBfd4m.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-C50htUTR.js";import"./connection-form-helpers-B3UcqYZu.js";import"./collection-tabs-Dg_azfZv.js";import"./badge-BNu531uc.js";import"./command-BlvzBYcm.js";import"./index-BXFmp3WW.js";import"./select-model-By0_2E97.js";import"./checkbox-D3MLpBTA.js";import"./ai-providers-logos-DD3qZ33J.js";import"./cards-CL2vc4-W.js";import"./dropdown-menu-Cg8GO9Ey.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-u8GHDfsk.js";import"./use-file-configs-B6WrrXgQ.js";import"./pt-BR-CLy76QW2.js";import"./switch-080KuP0Z.js";import"./use-debounced-autosave-DSiZvyT9.js";import"./search-input-vt9k7znl.js";import"./index-BoZK85Tz.js";import"./use-secrets-2hVFkyTr.js";import"./AreaChart-DPRb077p.js";import"./use-tags-C5qFTaG8.js";import"./get-initials-D-f_fDFw.js";import"./automation-list-row-BDX5Zyot.js";import"./use-org-repo-syncs-t5rFG9d3.js";const or={"new-file":{titleKey:"sandbox.fileExplorerNameDialog.newFileTitle",descriptionKey:"sandbox.fileExplorerNameDialog.newFileDescription",submitKey:"sandbox.fileExplorerNameDialog.newFileSubmit",placeholderKey:"sandbox.fileExplorerNameDialog.newFilePlaceholder"},"new-folder":{titleKey:"sandbox.fileExplorerNameDialog.newFolderTitle",descriptionKey:"sandbox.fileExplorerNameDialog.newFolderDescription",submitKey:"sandbox.fileExplorerNameDialog.newFolderSubmit",placeholderKey:"sandbox.fileExplorerNameDialog.newFolderPlaceholder"},rename:{titleKey:"sandbox.fileExplorerNameDialog.renameTitle",descriptionKey:"sandbox.fileExplorerNameDialog.renameDescription",submitKey:"sandbox.fileExplorerNameDialog.renameSubmit",placeholderKey:"sandbox.fileExplorerNameDialog.renamePlaceholder"}};function sr(i){const e=se.c(71),{open:s,mode:a,initialName:l,parentLabel:m,isPending:h,onSubmit:f,onOpenChange:v}=i,N=l===void 0?"":l,d=h===void 0?!1:h,x=Me(),[g,k]=u.useState(N),[Z,W]=u.useState(s),y=or[a];s!==Z&&(W(s),s&&k(N));let b;e[0]!==d||e[1]!==v?(b=_=>{!_&&!d&&v(!1)},e[0]=d,e[1]=v,e[2]=b):b=e[2];const F=b;let A;e[3]!==d||e[4]!==g||e[5]!==f?(A=async _=>{_.preventDefault();const te=g.trim();!te||d||await f(te)},e[3]=d,e[4]=g,e[5]=f,e[6]=A):A=e[6];const I=A;let S;e[7]!==y.titleKey||e[8]!==x?(S=x(y.titleKey),e[7]=y.titleKey,e[8]=x,e[9]=S):S=e[9];let P;e[10]!==S?(P=r.jsx(_n,{children:S}),e[10]=S,e[11]=P):P=e[11];let D;e[12]!==y.descriptionKey||e[13]!==x?(D=x(y.descriptionKey),e[12]=y.descriptionKey,e[13]=x,e[14]=D):D=e[14];let M;e[15]!==D?(M=r.jsx(Gn,{children:D}),e[15]=D,e[16]=M):M=e[16];let j;e[17]!==P||e[18]!==M?(j=r.jsxs(Bn,{children:[P,M]}),e[17]=P,e[18]=M,e[19]=j):j=e[19];let R;e[20]!==m||e[21]!==x?(R=m&&r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:x("sandbox.fileExplorerNameDialog.location")}),r.jsx(ot,{value:m,readOnly:!0,disabled:!0,className:"font-mono text-xs"})]}),e[20]=m,e[21]=x,e[22]=R):R=e[22];let E;e[23]!==x?(E=x("sandbox.fileExplorerNameDialog.name"),e[23]=x,e[24]=E):E=e[24];let T;e[25]!==E?(T=r.jsx("label",{htmlFor:"file-explorer-name",className:"text-xs font-medium text-muted-foreground",children:E}),e[25]=E,e[26]=T):T=e[26];let Q;e[27]===Symbol.for("react.memo_cache_sentinel")?(Q=_=>k(_.target.value),e[27]=Q):Q=e[27];let X;e[28]!==y.placeholderKey||e[29]!==x?(X=x(y.placeholderKey),e[28]=y.placeholderKey,e[29]=x,e[30]=X):X=e[30];let Y;e[31]!==d||e[32]!==g||e[33]!==X?(Y=r.jsx(ot,{id:"file-explorer-name",value:g,onChange:Q,placeholder:X,autoFocus:!0,disabled:d}),e[31]=d,e[32]=g,e[33]=X,e[34]=Y):Y=e[34];let G;e[35]!==T||e[36]!==Y?(G=r.jsxs("div",{className:"space-y-1.5",children:[T,Y]}),e[35]=T,e[36]=Y,e[37]=G):G=e[37];let $;e[38]!==R||e[39]!==G?($=r.jsxs("div",{className:"space-y-4 py-4",children:[R,G]}),e[38]=R,e[39]=G,e[40]=$):$=e[40];let q;e[41]!==v?(q=()=>v(!1),e[41]=v,e[42]=q):q=e[42];let K;e[43]!==x?(K=x("sandbox.fileExplorerNameDialog.cancel"),e[43]=x,e[44]=K):K=e[44];let z;e[45]!==d||e[46]!==q||e[47]!==K?(z=r.jsx(De,{type:"button",variant:"outline",onClick:q,disabled:d,children:K}),e[45]=d,e[46]=q,e[47]=K,e[48]=z):z=e[48];let B;e[49]!==d||e[50]!==g?(B=!g.trim()||d,e[49]=d,e[50]=g,e[51]=B):B=e[51];let L;e[52]!==y.submitKey||e[53]!==d||e[54]!==x?(L=d?r.jsxs(r.Fragment,{children:[r.jsx(fe,{size:14,className:"animate-spin"}),x("sandbox.fileExplorerNameDialog.saving")]}):x(y.submitKey),e[52]=y.submitKey,e[53]=d,e[54]=x,e[55]=L):L=e[55];let V;e[56]!==B||e[57]!==L?(V=r.jsx(De,{type:"submit",disabled:B,children:L}),e[56]=B,e[57]=L,e[58]=V):V=e[58];let O;e[59]!==z||e[60]!==V?(O=r.jsxs(Vn,{children:[z,V]}),e[59]=z,e[60]=V,e[61]=O):O=e[61];let U;e[62]!==I||e[63]!==$||e[64]!==O||e[65]!==j?(U=r.jsx(Un,{className:"sm:max-w-md",children:r.jsxs("form",{onSubmit:I,children:[j,$,O]})}),e[62]=I,e[63]=$,e[64]=O,e[65]=j,e[66]=U):U=e[66];let ee;return e[67]!==F||e[68]!==s||e[69]!==U?(ee=r.jsx(Hn,{open:s,onOpenChange:F,children:U}),e[67]=F,e[68]=s,e[69]=U,e[70]=ee):ee=e[70],ee}function ar(i){const e=se.c(47),{deleteTarget:s,deleteDirtyPaths:a,fsActionPending:l,onOpenChange:m,onConfirm:h}=i,f=Me(),v=s?.kind==="directory",N=s!==null,d=v?"sandbox.fileExplorerDeleteDialog.titleFolder":"sandbox.fileExplorerDeleteDialog.titleFile";let x;e[0]!==f||e[1]!==d?(x=f(d),e[0]=f,e[1]=d,e[2]=x):x=e[2];let g;e[3]!==x?(g=r.jsx(Wn,{children:x}),e[3]=x,e[4]=g):g=e[4];let k;e[5]!==f?(k=f("sandbox.fileExplorerDeleteDialog.description"),e[5]=f,e[6]=k):k=e[6];const Z=s?.name;let W;e[7]!==Z?(W=r.jsx("span",{className:"font-mono",children:Z}),e[7]=Z,e[8]=W):W=e[8];let y;e[9]!==v||e[10]!==f?(y=v?f("sandbox.fileExplorerDeleteDialog.folderSuffix"):".",e[9]=v,e[10]=f,e[11]=y):y=e[11];let b;e[12]!==a.length||e[13]!==f?(b=a.length>0&&r.jsxs(r.Fragment,{children:[" ",a.length===1?f("sandbox.fileExplorerDeleteDialog.unsavedChangesOne"):f("sandbox.fileExplorerDeleteDialog.unsavedChangesMany",{count:a.length})]}),e[12]=a.length,e[13]=f,e[14]=b):b=e[14];let F;e[15]!==k||e[16]!==W||e[17]!==y||e[18]!==b?(F=r.jsxs(qn,{children:[k," ",W,y,b]}),e[15]=k,e[16]=W,e[17]=y,e[18]=b,e[19]=F):F=e[19];let A;e[20]!==F||e[21]!==g?(A=r.jsxs(Qn,{children:[g,F]}),e[20]=F,e[21]=g,e[22]=A):A=e[22];let I;e[23]!==f?(I=f("sandbox.fileExplorerDeleteDialog.cancel"),e[23]=f,e[24]=I):I=e[24];let S;e[25]!==l||e[26]!==I?(S=r.jsx(Xn,{disabled:l,children:I}),e[25]=l,e[26]=I,e[27]=S):S=e[27];const P=l||!s;let D;e[28]!==s||e[29]!==h?(D=Q=>{Q.preventDefault(),s&&h(s)},e[28]=s,e[29]=h,e[30]=D):D=e[30];let M;e[31]!==f?(M=f("sandbox.fileExplorerDeleteDialog.delete"),e[31]=f,e[32]=M):M=e[32];let j;e[33]!==P||e[34]!==D||e[35]!==M?(j=r.jsx(Yn,{disabled:P,onClick:D,children:M}),e[33]=P,e[34]=D,e[35]=M,e[36]=j):j=e[36];let R;e[37]!==S||e[38]!==j?(R=r.jsxs(Jn,{children:[S,j]}),e[37]=S,e[38]=j,e[39]=R):R=e[39];let E;e[40]!==A||e[41]!==R?(E=r.jsxs(Zn,{children:[A,R]}),e[40]=A,e[41]=R,e[42]=E):E=e[42];let T;return e[43]!==m||e[44]!==N||e[45]!==E?(T=r.jsx(er,{open:N,onOpenChange:m,children:E}),e[43]=m,e[44]=N,e[45]=E,e[46]=T):T=e[46],T}var ze="ContextMenu",[ir]=an(ze,[lt]),J=lt(),[lr,ct]=ir(ze),dt=i=>{const{__scopeContextMenu:e,children:s,onOpenChange:a,dir:l,modal:m=!0}=i,[h,f]=u.useState(!1),v=J(e),N=on(a),d=u.useCallback(x=>{f(x),N(x)},[N]);return r.jsx(lr,{scope:e,open:h,onOpenChange:d,modal:m,children:r.jsx(sn,{...v,dir:l,open:h,onOpenChange:d,modal:m,children:s})})};dt.displayName=ze;var ut="ContextMenuTrigger",ft=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,disabled:a=!1,...l}=i,m=ct(ut,s),h=J(s),f=u.useRef({x:0,y:0}),v=u.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...f.current})}),N=u.useRef(0),d=u.useCallback(()=>window.clearTimeout(N.current),[]),x=g=>{f.current={x:g.clientX,y:g.clientY},m.onOpenChange(!0)};return u.useEffect(()=>d,[d]),u.useEffect(()=>{a&&d()},[a,d]),r.jsxs(r.Fragment,{children:[r.jsx(Jt,{...h,virtualRef:v}),r.jsx(Zt.span,{"data-state":m.open?"open":"closed","data-disabled":a?"":void 0,...l,ref:e,style:{WebkitTouchCallout:"none",...i.style},onContextMenu:a?i.onContextMenu:xe(i.onContextMenu,g=>{d(),x(g),g.preventDefault()}),onPointerDown:a?i.onPointerDown:xe(i.onPointerDown,Se(g=>{d(),N.current=window.setTimeout(()=>x(g),700)})),onPointerMove:a?i.onPointerMove:xe(i.onPointerMove,Se(d)),onPointerCancel:a?i.onPointerCancel:xe(i.onPointerCancel,Se(d)),onPointerUp:a?i.onPointerUp:xe(i.onPointerUp,Se(d))})]})});ft.displayName=ut;var cr="ContextMenuPortal",pt=i=>{const{__scopeContextMenu:e,...s}=i,a=J(e);return r.jsx(nn,{...a,...s})};pt.displayName=cr;var mt="ContextMenuContent",xt=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=ct(mt,s),m=J(s),h=u.useRef(!1);return r.jsx(rn,{...m,...a,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:f=>{i.onCloseAutoFocus?.(f),!f.defaultPrevented&&h.current&&f.preventDefault(),h.current=!1},onInteractOutside:f=>{i.onInteractOutside?.(f),!f.defaultPrevented&&!l.modal&&(h.current=!0)},style:{...i.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});xt.displayName=mt;var dr="ContextMenuGroup",ur=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(ln,{...l,...a,ref:e})});ur.displayName=dr;var fr="ContextMenuLabel",pr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(cn,{...l,...a,ref:e})});pr.displayName=fr;var mr="ContextMenuItem",ht=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(en,{...l,...a,ref:e})});ht.displayName=mr;var xr="ContextMenuCheckboxItem",hr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(dn,{...l,...a,ref:e})});hr.displayName=xr;var gr="ContextMenuRadioGroup",br=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(un,{...l,...a,ref:e})});br.displayName=gr;var yr="ContextMenuRadioItem",vr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(fn,{...l,...a,ref:e})});vr.displayName=yr;var Cr="ContextMenuItemIndicator",wr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(pn,{...l,...a,ref:e})});wr.displayName=Cr;var jr="ContextMenuSeparator",gt=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(tn,{...l,...a,ref:e})});gt.displayName=jr;var Nr="ContextMenuArrow",Er=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(mn,{...l,...a,ref:e})});Er.displayName=Nr;var Sr="ContextMenuSubTrigger",Dr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(xn,{...l,...a,ref:e})});Dr.displayName=Sr;var Mr="ContextMenuSubContent",Rr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(hn,{...l,...a,ref:e,style:{...i.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Rr.displayName=Mr;function Se(i){return e=>e.pointerType!=="mouse"?i(e):void 0}var Tr=dt,Pr=ft,kr=pt,Fr=xt,Ar=ht,Lr=gt;function Or(i){const e=se.c(4);let s;e[0]!==i?({...s}=i,e[0]=i,e[1]=s):s=e[1];let a;return e[2]!==s?(a=r.jsx(Tr,{"data-slot":"context-menu",...s}),e[2]=s,e[3]=a):a=e[3],a}function Ir(i){const e=se.c(4);let s;e[0]!==i?({...s}=i,e[0]=i,e[1]=s):s=e[1];let a;return e[2]!==s?(a=r.jsx(Pr,{"data-slot":"context-menu-trigger",...s}),e[2]=s,e[3]=a):a=e[3],a}function $r(i){const e=se.c(8);let s,a;e[0]!==i?({className:s,...a}=i,e[0]=i,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let l;e[3]!==s?(l=le("notranslate bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",s),e[3]=s,e[4]=l):l=e[4];let m;return e[5]!==a||e[6]!==l?(m=r.jsx(kr,{children:r.jsx(Fr,{"data-slot":"context-menu-content",translate:"no",className:l,...a})}),e[5]=a,e[6]=l,e[7]=m):m=e[7],m}function ue(i){const e=se.c(12);let s,a,l,m;e[0]!==i?({className:s,inset:a,variant:m,...l}=i,e[0]=i,e[1]=s,e[2]=a,e[3]=l,e[4]=m):(s=e[1],a=e[2],l=e[3],m=e[4]);const h=m===void 0?"default":m;let f;e[5]!==s?(f=le("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",s),e[5]=s,e[6]=f):f=e[6];let v;return e[7]!==a||e[8]!==l||e[9]!==f||e[10]!==h?(v=r.jsx(Ar,{"data-slot":"context-menu-item","data-inset":a,"data-variant":h,className:f,...l}),e[7]=a,e[8]=l,e[9]=f,e[10]=h,e[11]=v):v=e[11],v}function st(i){const e=se.c(8);let s,a;e[0]!==i?({className:s,...a}=i,e[0]=i,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let l;e[3]!==s?(l=le("bg-border -mx-1 my-1 h-px",s),e[3]=s,e[4]=l):l=e[4];let m;return e[5]!==a||e[6]!==l?(m=r.jsx(Lr,{"data-slot":"context-menu-separator",className:l,...a}),e[5]=a,e[6]=l,e[7]=m):m=e[7],m}const Kr="#d9a441";function zr(i){const e=se.c(63),{node:s,depth:a,isExpanded:l,isSelected:m,isLoading:h,fileVisual:f,onOpen:v,onSelect:N,onNewFile:d,onNewFolder:x,onCopyPath:g,onCopyRelativePath:k,onRename:Z,onDelete:W}=i,y=h===void 0?!1:h,b=Me(),F=s.kind==="directory",{Icon:A,color:I}=f,S=m&&"bg-accent";let P;e[0]!==S?(P=le("flex w-full items-center gap-1.5 px-2 py-1.5 text-left text-[13px] hover:bg-accent transition-colors",S),e[0]=S,e[1]=P):P=e[1];const D=`${a*14+8}px`;let M;e[2]!==D?(M={paddingLeft:D},e[2]=D,e[3]=M):M=e[3];let j;e[4]!==v||e[5]!==N?(j=()=>{N(),v()},e[4]=v,e[5]=N,e[6]=j):j=e[6];let R;e[7]!==A||e[8]!==I||e[9]!==F||e[10]!==l||e[11]!==y?(R=F?r.jsxs(r.Fragment,{children:[y?r.jsx(fe,{size:14,className:"shrink-0 animate-spin text-muted-foreground"}):l?r.jsx(tr,{size:14,className:"shrink-0 text-muted-foreground"}):r.jsx(nr,{size:14,className:"shrink-0 text-muted-foreground"}),r.jsx(rr,{size:16,className:"shrink-0",style:{color:Kr}})]}):r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"w-3.5 shrink-0"}),r.jsx(A,{size:16,className:"shrink-0",style:{color:I}})]}),e[7]=A,e[8]=I,e[9]=F,e[10]=l,e[11]=y,e[12]=R):R=e[12];let E;e[13]!==s.name?(E=r.jsx("span",{className:"truncate",children:s.name}),e[13]=s.name,e[14]=E):E=e[14];let T;e[15]!==P||e[16]!==M||e[17]!==j||e[18]!==R||e[19]!==E?(T=r.jsx(Ir,{asChild:!0,children:r.jsxs("button",{type:"button",className:P,style:M,onClick:j,children:[R,E]})}),e[15]=P,e[16]=M,e[17]=j,e[18]=R,e[19]=E,e[20]=T):T=e[20];let Q;e[21]!==b?(Q=b("sandbox.fileTreeRow.newFile"),e[21]=b,e[22]=Q):Q=e[22];let X;e[23]!==d||e[24]!==Q?(X=r.jsx(ue,{onSelect:d,children:Q}),e[23]=d,e[24]=Q,e[25]=X):X=e[25];let Y;e[26]!==b?(Y=b("sandbox.fileTreeRow.newFolder"),e[26]=b,e[27]=Y):Y=e[27];let G;e[28]!==x||e[29]!==Y?(G=r.jsx(ue,{onSelect:x,children:Y}),e[28]=x,e[29]=Y,e[30]=G):G=e[30];let $;e[31]===Symbol.for("react.memo_cache_sentinel")?($=r.jsx(st,{}),e[31]=$):$=e[31];let q;e[32]!==b?(q=b("sandbox.fileTreeRow.copyPath"),e[32]=b,e[33]=q):q=e[33];let K;e[34]!==g||e[35]!==q?(K=r.jsx(ue,{onSelect:g,children:q}),e[34]=g,e[35]=q,e[36]=K):K=e[36];let z;e[37]!==b?(z=b("sandbox.fileTreeRow.copyRelativePath"),e[37]=b,e[38]=z):z=e[38];let B;e[39]!==k||e[40]!==z?(B=r.jsx(ue,{onSelect:k,children:z}),e[39]=k,e[40]=z,e[41]=B):B=e[41];let L;e[42]===Symbol.for("react.memo_cache_sentinel")?(L=r.jsx(st,{}),e[42]=L):L=e[42];let V;e[43]!==b?(V=b("sandbox.fileTreeRow.rename"),e[43]=b,e[44]=V):V=e[44];let O;e[45]!==Z||e[46]!==V?(O=r.jsx(ue,{onSelect:Z,children:V}),e[45]=Z,e[46]=V,e[47]=O):O=e[47];let U;e[48]!==b?(U=b("sandbox.fileTreeRow.delete"),e[48]=b,e[49]=U):U=e[49];let ee;e[50]!==W||e[51]!==U?(ee=r.jsx(ue,{variant:"destructive",onSelect:W,children:U}),e[50]=W,e[51]=U,e[52]=ee):ee=e[52];let _;e[53]!==X||e[54]!==G||e[55]!==K||e[56]!==B||e[57]!==O||e[58]!==ee?(_=r.jsxs($r,{className:"w-52",children:[X,G,$,K,B,L,O,ee]}),e[53]=X,e[54]=G,e[55]=K,e[56]=B,e[57]=O,e[58]=ee,e[59]=_):_=e[59];let te;return e[60]!==_||e[61]!==T?(te=r.jsxs(Or,{children:[T,_]}),e[60]=_,e[61]=T,e[62]=te):te=e[62],te}yn.config({paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.0/min/vs"}});const at=200,_r=2,Gr=250,it=200;function Br(i,e,s,a){return`/api/${i}/sandbox/${encodeURIComponent(e)}/${encodeURIComponent(s)}/${a}`}function Vr(i){const e=se.c(9),{text:s,query:a}=i;let l,m,h;if(e[0]!==a||e[1]!==s){const{leadingEllipsis:v,segments:N}=Fn(s,a);l="truncate font-mono text-muted-foreground",m=v&&r.jsx("span",{className:"text-muted-foreground/50",children:"…"}),h=N.map(Ur),e[0]=a,e[1]=s,e[2]=l,e[3]=m,e[4]=h}else l=e[2],m=e[3],h=e[4];let f;return e[5]!==l||e[6]!==m||e[7]!==h?(f=r.jsxs("span",{className:l,children:[m,h]}),e[5]=l,e[6]=m,e[7]=h,e[8]=f):f=e[8],f}function Ur(i,e){return i.match?r.jsx("span",{className:"rounded-[2px] bg-primary/20 text-foreground",children:i.text},e):r.jsx("span",{children:i.text},e)}function Pa({orgSlug:i,virtualMcpId:e,branch:s,openPath:a}){const[l,m]=u.useState({files:[],directories:[],truncated:!1}),{files:h,directories:f}=l,[v,N]=u.useState(new Set),[d,x]=u.useState(null),[g,k]=u.useState(null),[Z,W]=u.useState([]),[y,b]=u.useState(""),[F,A]=u.useState(null),[I,S]=u.useState(null),[P,D]=u.useState(!1),[M,j]=u.useState(!1),[R,E]=u.useState(!1),[T,Q]=u.useState(!1),[,X]=u.useState(new Set),[Y,G]=u.useState(new Set),$=u.useRef(0),q=u.useRef(null),K=u.useRef(new Set),z=u.useRef(new Map),B=u.useRef(null),L=u.useRef(0),V=u.useRef(null),O=u.useRef(null),U=u.useRef(null);function ee(t){X(n=>{const o=typeof t=="function"?t(n):t;return K.current=o,o})}const[_,te]=u.useState(new Map),Re=u.useRef(null),[ae,he]=u.useState(null),{sendMessage:bt}=En(),{openSidePanel:yt}=Sn(),ge=gn(),[H,oe]=u.useState(null),[Te,Pe]=u.useState(null),[be,ye]=u.useState(!1);async function ie(t,n){const o=await fetch(Br(i,e,s,t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(n)});if(!o.ok){const c=await o.json().catch(()=>({}));throw new Error(c.error??`Request failed (${o.status})`)}return o.json()}async function ve(){ge.invalidateQueries({queryKey:rt(i,e,s)})}function _e(t,n,o){navigator.clipboard.writeText(o).then(()=>ne.success(t("sandbox.fileExplorer.textCopied",{label:n})),()=>ne.error(t("sandbox.fileExplorer.failedToCopyText",{label:n.toLowerCase()})))}function vt(t){const n=Kn(t);if(!n)return;const o=`${i}/${e}/${s}`;ge.setQueryData(nt.decofile(o),c=>{if(!c)return c;const{[n]:p,...C}=c;return C}),ge.invalidateQueries({queryKey:nt.liveMeta(i,e,s)})}function Ct(t){const n=t.kind==="file"?[t.path]:h.filter(o=>o.startsWith(".deco/blocks/")).map(o=>we(o)).filter(o=>o===t.path||o.startsWith(`${t.path}/`));for(const o of n)vt(o)}function wt(t){const n=we(t);return Z.filter(o=>{if(o!==n&&!o.startsWith(`${n}/`))return!1;const c=_.get(o);return!!(c?.loaded&&c.editorValue!==c.savedContent)})}function Ge(t){W(n=>n.map(o=>t(o)).filter(o=>o!==null)),x(n=>n&&t(n)),te(n=>{const o=new Map;for(const[c,p]of n){const C=t(c);C&&o.set(C,p)}return o}),k(n=>{if(!n)return n;const o=t(n.path);return o?o===n.path?n:{...n,path:o,name:o.split("/").pop()??o}:null})}function jt(t){const n=we(t);k(o=>o&&(o.path===n||o.path.startsWith(`${n}/`)?null:o)),Ge(o=>o===n||o.startsWith(`${n}/`)?null:o)}async function Nt(t,n){if(!H)return;const o=Ee(H.parentDir,n);if(Ke(o,h,f))throw new Error(t("sandbox.fileExplorer.fileAlreadyExists",{name:n}));await ie("write",{path:re(o),content:""}),await pe(),await ve(),oe(null),me(o)}async function Et(t,n){if(!H)return;const o=Ee(H.parentDir,n);if(Ke(o,h,f))throw new Error(t("sandbox.fileExplorer.fileAlreadyExists",{name:n}));const c=re(o);await ie("mkdir",{path:c}),m(p=>({...p,directories:p.directories.includes(c)?p.directories:[...p.directories,c]})),await pe(),await ve(),oe(null),N(p=>{const C=new Set(p);for(const ce of Ie(o))C.add(ce);return C.add(o),C}),k({name:n,path:o,kind:"directory",children:[]})}async function St(t,n){if(!H)return;const o=H.node.path,c=je(o),p=Ee(c,n);if(p===o){oe(null);return}if(Ke(p,h,f))throw new Error(t("sandbox.fileExplorer.fileAlreadyExists",{name:n}));await ie("rename",{from:re(o),to:re(p)}),Ge(C=>C===o?p:C.startsWith(`${o}/`)?Ee(p,C.slice(o.length+1)):C),await pe(),await ve(),oe(null)}async function Dt(t,n){ye(!0);try{await ie("unlink",{path:re(n.path),recursive:n.kind==="directory"}),Ct(n),jt(n.path),await pe(),await ve(),Pe(null),ne.success(t("sandbox.fileExplorer.fileDeleted",{name:n.name}))}catch(o){ne.error(o instanceof Error?o.message:t("sandbox.fileExplorer.deleteFailed"))}finally{ye(!1)}}async function Mt(t,n){const o=Ln(n);if(o){ne.error(o);return}ye(!0);try{H?.mode==="new-file"?(await Nt(t,n),ne.success(t("sandbox.fileExplorer.fileCreated",{name:n}))):H?.mode==="new-folder"?(await Et(t,n),ne.success(t("sandbox.fileExplorer.folderCreated",{name:n}))):H?.mode==="rename"&&(await St(t,n),ne.success(t("sandbox.fileExplorer.renamedTo",{name:n})))}catch(c){ne.error(c instanceof Error?c.message:t("sandbox.fileExplorer.operationFailed"))}finally{ye(!1)}}const Be=u.useRef(!1);Be.current||(Be.current=!0,q.current=pe());const[Rt,Tt]=u.useState(null),w=Me();if(a&&a!==Rt){Tt(a);const t=a;queueMicrotask(()=>{Dn(t)&&me(t)})}async function ke(t){const n=await ie("glob",t);return{files:n.files??[],directories:n.directories??[],truncated:n.truncated}}function Ve(t,n,o){if(o!==$.current)return!1;let c=!1;return m(p=>{const C=n?zn(p.files,p.directories,t,p.truncated):{files:t.files,directories:t.directories??[],truncated:!!t.truncated};return c=!!C.truncated,{files:C.files,directories:C.directories,truncated:c}}),c&&ne.warning(w("sandbox.fileExplorer.fileListTruncated")),c}async function Pt(t){const n=z.current.get(t);if(n)return n;const o=$.current,c=(async()=>{const p=await ke({pattern:"**/*",path:re(t),limit:Ae}),C=Ve(p,!0,o);return!C&&o===$.current&&ee(ce=>{const Ce=new Set(ce);return Ce.add(t),Ce}),C})();z.current.set(t,c);try{return await c}finally{z.current.delete(t)}}async function Ue(t){if(!$e(t,K.current))return!1;G(n=>new Set(n).add(t));try{return await Pt(t)}finally{G(n=>{const o=new Set(n);return o.delete(t),o})}}async function kt(t,n){const o=new Set(K.current);for(const c of Ie(n)){if(!$e(c,o))continue;if(await Ue(c))throw new Error(t("sandbox.fileExplorer.folderListingTruncated"));o.add(c)}}async function pe(){const t=++$.current;V.current=null,O.current=null,z.current.clear(),E(!0),ee(new Set),N(new Set),G(new Set);try{const n=await ke({pattern:"**/*",limit:Ae,maxDepth:Mn});Ve(n,!1,t),Q(!0)}catch{T&&ne.error(w("sandbox.fileExplorer.failedToRefreshFileTree"))}finally{E(!1)}}async function He(t){if(!_.get(t)?.loaded){te(o=>{const c=new Map(o);return c.set(t,{savedContent:"",editorValue:"",loaded:!1}),c});try{const o=await ie("read",{path:re(t),full:!0}),c=An(o.content??"");te(p=>{const C=new Map(p);return C.set(t,{savedContent:c,editorValue:c,loaded:!0}),C})}catch{}}}function Ft(){L.current++,A(null),S(null),D(!1),j(!1)}async function At(){const t=$.current,n=V.current;if(n&&n.generation===t)return n.files;const o=O.current;if(o&&o.generation===t)return o.promise;const c=(async()=>{const p=await ke({pattern:"**/*",limit:Ae});return $.current===t&&(V.current={generation:t,files:p.files}),p.files})();O.current={generation:t,promise:c};try{return await c}finally{O.current?.generation===t&&(O.current=null)}}async function Lt(t,n){try{const o=await At();if(n!==L.current)return;A(In(o,t,it))}catch{if(n!==L.current)return;A([])}}async function Ot(t,n){D(!0);try{const o=await ie("grep",{pattern:t,output_mode:"content",ignore_case:!0,fixed_strings:!0,limit:at});if(n!==L.current)return;S($n(o.results??"")),j((o.matchCount??0)>=at)}catch{if(n!==L.current)return;S([]),j(!1)}finally{n===L.current&&D(!1)}}function It(t){const n=t.trim(),o=++L.current;Lt(n,o),n.length<_r?(S(null),D(!1),j(!1)):Ot(n,o)}function $t(t){if(b(t),B.current&&clearTimeout(B.current),!t.trim()){Ft();return}B.current=setTimeout(()=>{It(t)},Gr)}function We(t){const n=U.current;if(!n||n.path!==d)return;U.current=null;const o=Math.max(1,n.line);t.revealLineInCenter(o),t.setPosition({lineNumber:o,column:1}),t.focus()}function Kt(t){U.current={path:t.path,line:t.line};const n=d===t.path&&_.get(t.path)?.loaded;me(t.path),n&&Re.current&&We(Re.current)}async function zt(t,n){try{await ie("write",{path:re(t),content:n}),Ne("file saved via sandbox /write",{path:t}),ge.invalidateQueries({queryKey:rt(i,e,s)});try{const o=await On(i,e,s);Ne("git status after save",o)}catch(o){Ne("git status after save failed",{path:t,error:o instanceof Error?o.message:String(o)})}te(o=>{const c=new Map(o),p=c.get(t);return p&&c.set(t,{...p,savedContent:n}),c})}catch(o){Ne("file save failed",{path:t,error:o instanceof Error?o.message:String(o)})}}function _t(t){x(t),k({name:t.split("/").pop()??t,path:t,kind:"file",children:[]}),he(null),Z.includes(t)||W(n=>[...n,t]),He(t)}function Gt(t){W(n=>{const o=n.filter(c=>c!==t);return d===t&&x(o[o.length-1]??null),o}),te(n=>{const o=new Map(n);return o.delete(t),o})}function qe(t){N(n=>{const o=new Set(n);return o.has(t)?o.delete(t):o.add(t),o})}async function Bt(t){if($e(t,K.current))try{if(await Ue(t))return}catch(n){ne.error(n instanceof Error?n.message:w("sandbox.fileExplorer.failedToLoadFolder"));return}qe(t)}async function Vt(t,n){if(n){qe(t);return}await Bt(t)}async function Ut(t){await q.current,await kt(w,t);const n=Ie(t);N(o=>{const c=new Set(o);for(const p of n)c.add(p);return c}),_t(t)}function me(t){Ut(t).catch(n=>{ne.error(n instanceof Error?n.message:w("sandbox.fileExplorer.failedToOpenFile"))})}function Ht(){return g?.kind==="directory"?g.path:g?.kind==="file"?je(g.path):d?je(d):"/"}function Qe(t){const n=Ht();oe({mode:t,parentDir:n,node:{name:"",path:n,kind:"directory",children:[]}})}const Wt=Rn(h,f),Xe=Tn(Wt,v),Fe=F?.length??0,Ye=Pn(I??[]),Je=I?.length??0,de=d?_.get(d):null,qt=de?.loaded&&de.editorValue!==de.savedContent,Qt=Te?wt(Te.path):[],Xt=(t,n)=>{Re.current=t,We(t),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyS,async()=>{if(!d)return;const o=t.getValue();await zt(d,o)}),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyK,()=>{const o=t.getSelection(),c=t.getModel();if(!o||!c||!d)return;const p=c.getValueInRange(o);he({filePath:d,lineStart:o.startLineNumber,lineEnd:o.endLineNumber,selectedCode:p})})};function Yt(t){if(!ae)return;const n=[`The user selected code in the file explorer and asked: **"${t.trim()}"**`,"",`**File:** \`${ae.filePath}\``,`**Lines:** ${ae.lineStart}–${ae.lineEnd}`];if(ae.selectedCode){const o=Oe(ae.filePath),c=ae.selectedCode.replace(/```/g,"`` `");n.push("","**Selected code:**","```"+o,c,"```")}n.push("","Please read the source file, locate the code, and apply the requested change."),yt("chat"),bt({parts:[{type:"text",text:n.join(`
|
|
2
|
+
`)}]}),he(null)}return R&&!T?r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(fe,{size:20,className:"animate-spin text-muted-foreground"})}):r.jsxs("div",{className:"flex h-full w-full overflow-hidden",children:[r.jsxs("div",{className:"w-64 shrink-0 border-r flex flex-col overflow-hidden",children:[r.jsxs("div",{className:"flex items-center gap-1 p-2 border-b",children:[r.jsxs("div",{className:"relative min-w-0 flex-1",children:[r.jsx(vn,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground"}),r.jsx("input",{type:"text",value:y,onChange:t=>$t(t.target.value),placeholder:w("sandbox.fileExplorer.searchFilesPlaceholder"),"aria-label":w("sandbox.fileExplorer.searchFilesLabel"),className:"w-full rounded-md border border-input bg-transparent pl-7 pr-2 py-1.5 text-xs outline-none placeholder:text-muted-foreground focus:ring-1 focus:ring-ring"})]}),r.jsxs(Ze,{children:[r.jsx(et,{asChild:!0,children:r.jsx(De,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":w("sandbox.fileExplorer.newFileLabel"),onClick:()=>Qe("new-file"),children:r.jsx(Cn,{size:14})})}),r.jsx(tt,{side:"bottom",children:w("sandbox.fileExplorer.newFile")})]}),r.jsxs(Ze,{children:[r.jsx(et,{asChild:!0,children:r.jsx(De,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":w("sandbox.fileExplorer.newFolderLabel"),onClick:()=>Qe("new-folder"),children:r.jsx(wn,{size:14})})}),r.jsx(tt,{side:"bottom",children:w("sandbox.fileExplorer.newFolder")})]})]}),r.jsx(Nn,{className:"flex-1",children:r.jsxs("div",{className:"py-1",children:[!y&&Xe.map(t=>{const{node:n,depth:o}=t,c=n.kind==="directory",p=v.has(n.path),C=g?.path===n.path,ce=kn(n.path,n.kind),Ce=c&&Y.has(n.path);return r.jsx(zr,{node:n,depth:o,isExpanded:p,isSelected:C,isLoading:Ce,fileVisual:Le(n.name),onSelect:()=>k(n),onOpen:()=>{c?Vt(n.path,p):me(n.path)},onNewFile:()=>oe({mode:"new-file",node:n,parentDir:ce}),onNewFolder:()=>oe({mode:"new-folder",node:n,parentDir:ce}),onCopyPath:()=>_e(w,"Path",we(n.path)),onCopyRelativePath:()=>_e(w,"Relative path",re(n.path)),onRename:()=>oe({mode:"rename",node:n,parentDir:ce}),onDelete:()=>Pe(n)},n.path)}),!y&&T&&Xe.length===0&&r.jsx("div",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:w("sandbox.fileExplorer.noFilesFound")}),y&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"flex items-center gap-1.5 px-3 pb-0.5 pt-1 text-[10px] font-medium uppercase tracking-wide text-muted-foreground",children:[r.jsx("span",{children:w("sandbox.fileExplorer.files")}),Fe>0&&r.jsxs("span",{className:"normal-case tracking-normal text-muted-foreground/70",children:[Fe,Fe>=it?"+":""]})]}),F!==null&&F.length===0&&r.jsx("div",{className:"px-3 py-1 text-xs text-muted-foreground",children:w("sandbox.fileExplorer.noFileNamesMatch")}),F?.map(t=>{const n=t.split("/").pop()??t,o=je(t),{Icon:c,color:p}=Le(n),C=d===t;return r.jsxs("button",{type:"button",onClick:()=>me(t),title:t,className:le("flex w-full items-center gap-1.5 px-3 py-1 text-left text-xs hover:bg-accent",C&&"bg-accent"),children:[r.jsx(c,{size:14,className:le("shrink-0",p)}),r.jsx("span",{className:"max-w-40 shrink-0 truncate",children:n}),o!=="/"&&r.jsx("span",{className:"truncate text-muted-foreground/60",children:o})]},t)})]}),y&&r.jsxs("div",{className:"mt-1 border-t pt-1",children:[r.jsxs("div",{className:"flex items-center gap-1.5 px-3 pb-0.5 pt-1 text-[10px] font-medium uppercase tracking-wide text-muted-foreground",children:[r.jsx("span",{children:w("sandbox.fileExplorer.inFiles")}),Je>0&&r.jsxs("span",{className:"text-muted-foreground/70 normal-case tracking-normal",children:[Je,M?"+":""]}),P&&r.jsx(fe,{size:10,className:"animate-spin"})]}),!P&&I!==null&&Ye.length===0&&r.jsx("div",{className:"px-3 py-1 text-xs text-muted-foreground",children:w("sandbox.fileExplorer.noMatchesInFileContents")}),Ye.map(t=>{const n=t.path.split("/").pop()??t.path,{Icon:o,color:c}=Le(n);return r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1 text-xs text-muted-foreground",children:[r.jsx(o,{size:14,className:le("shrink-0",c)}),r.jsx("span",{className:"truncate",children:n}),r.jsx("span",{className:"text-muted-foreground/60",children:t.matches.length})]}),t.matches.map(p=>r.jsxs("button",{type:"button",onClick:()=>Kt(p),title:`${t.path}:${p.line}`,className:"flex w-full items-baseline gap-2 pl-8 pr-3 py-0.5 text-left text-xs hover:bg-accent",children:[r.jsx("span",{className:"shrink-0 tabular-nums text-muted-foreground",children:p.line}),r.jsx(Vr,{text:p.text,query:y})]},`${t.path}:${p.line}`))]},t.path)})]})]})})]}),r.jsxs("div",{className:"relative flex-1 flex flex-col overflow-hidden",children:[Z.length>0&&r.jsx("div",{className:"flex items-center border-b overflow-x-auto shrink-0",children:Z.map(t=>{const n=_.get(t),o=n?.loaded&&n.editorValue!==n.savedContent,c=d===t,p=t.split("/").pop()??t;return r.jsxs("div",{className:le("flex items-center gap-1 px-3 py-1.5 text-xs border-r cursor-pointer transition-colors",c?"bg-background text-foreground":"bg-muted/50 text-muted-foreground hover:bg-accent"),onClick:()=>{x(t),He(t)},onKeyDown:()=>{},role:"tab",tabIndex:0,"aria-selected":c,children:[r.jsx("span",{className:"truncate max-w-32",children:p}),o&&r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-foreground/60 shrink-0"}),r.jsx("button",{type:"button",className:"ml-1 rounded p-0.5 hover:bg-accent-foreground/10",onClick:C=>{C.stopPropagation(),Gt(t)},children:r.jsx(jn,{size:12})})]},t)})}),ae&&r.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 z-20 mt-2",style:{width:"360px"},children:r.jsxs("form",{className:"flex w-full items-center gap-1.5 rounded-xl border border-border bg-background/95 px-3 py-1.5 shadow-lg backdrop-blur",onSubmit:t=>{t.preventDefault();const o=t.currentTarget.elements.namedItem("askAiInput");o.value.trim()&&Yt(o.value)},children:[r.jsx("input",{name:"askAiInput",autoFocus:!0,type:"text",placeholder:w("sandbox.fileExplorer.askTheAiPlaceholder"),className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground",onKeyDown:t=>{t.stopPropagation(),t.key==="Escape"&&he(null)}}),r.jsx("button",{type:"submit",className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-foreground text-background transition-opacity",title:w("sandbox.fileExplorer.send"),children:r.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[r.jsx("title",{children:w("sandbox.fileExplorer.send")}),r.jsx("path",{d:"M5 9V1M1 5l4-4 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})}),r.jsx("div",{className:"flex-1 overflow-hidden",children:d&&de?.loaded?r.jsx(bn,{language:Oe(d),theme:document.documentElement.classList.contains("dark")?"vs-dark":"light",value:de.editorValue,path:d,onChange:t=>{const n=d;n&&te(o=>{const c=new Map(o),p=c.get(n);return p&&c.set(n,{...p,editorValue:t??""}),c})},onMount:Xt,loading:r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(fe,{size:20,className:"animate-spin text-muted-foreground"})}),options:{fontSize:13,scrollBeyondLastLine:!1,automaticLayout:!0,lineNumbersMinChars:2,wordWrap:"on",minimap:{enabled:!1},padding:{top:12,bottom:12},scrollbar:{vertical:"auto",horizontal:"auto",verticalScrollbarSize:8,horizontalScrollbarSize:8}}},d):d&&!de?.loaded?r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(fe,{size:20,className:"animate-spin text-muted-foreground"})}):r.jsx("div",{className:"flex items-center justify-center h-full w-full text-sm text-muted-foreground",children:w("sandbox.fileExplorer.selectFileToEdit")})}),d&&r.jsxs("div",{className:"flex items-center justify-between px-3 py-1 border-t text-[11px] text-muted-foreground shrink-0",children:[r.jsx("span",{className:"truncate",children:d}),r.jsxs("span",{children:[w(qt?"sandbox.fileExplorer.modified":"sandbox.fileExplorer.saved")," ","· ",Oe(d)]})]})]}),r.jsx(sr,{open:H!==null,mode:H?.mode??"new-file",initialName:H?.mode==="rename"?H.node.name:"",parentLabel:H&&H.mode!=="rename"?H.parentDir==="/"?"/":re(H.parentDir):void 0,isPending:be,onSubmit:t=>Mt(w,t),onOpenChange:t=>{!t&&!be&&oe(null)}}),r.jsx(ar,{deleteTarget:Te,deleteDirtyPaths:Qt,fsActionPending:be,onOpenChange:t=>{!t&&!be&&Pe(null)},onConfirm:t=>{Dt(w,t)}})]})}export{Pa as FileExplorer};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as g,j as o}from"./index-
|
|
1
|
+
import{c as g,j as o}from"./index-C-W5dASy.js";const h={pdf:"#D92D20",doc:"#155EEF",docx:"#155EEF",txt:"#475467",md:"#475467",xls:"#099250",xlsx:"#099250",csv:"#099250",tsv:"#099250",json:"#475467",xml:"#475467",yaml:"#475467",yml:"#475467",ppt:"#DC6803",pptx:"#DC6803",key:"#DC6803",png:"#7F56D9",jpg:"#7F56D9",jpeg:"#7F56D9",gif:"#7F56D9",webp:"#7F56D9",svg:"#7F56D9",avif:"#7F56D9",mp3:"#DD2590",wav:"#DD2590",mp4:"#DD2590",mov:"#DD2590",webm:"#DD2590",zip:"#475467",tar:"#475467",gz:"#475467",rar:"#475467",html:"#DC6803",htm:"#DC6803",css:"#155EEF",js:"#155EEF",jsx:"#155EEF",ts:"#155EEF",tsx:"#155EEF",py:"#155EEF",sql:"#155EEF",sh:"#475467"},F="#475467",D={pdf:"PDF",doc:"Word document",docx:"Word document",txt:"Text file",md:"Markdown",xls:"Excel file",xlsx:"Excel file",csv:"CSV file",tsv:"TSV file",json:"JSON file",xml:"XML file",yaml:"YAML file",yml:"YAML file",ppt:"Presentation",pptx:"Presentation",key:"Presentation",png:"Image",jpg:"Image",jpeg:"Image",gif:"Image",webp:"Image",svg:"Image",avif:"Image",mp3:"Audio",wav:"Audio",mp4:"Video",mov:"Video",webm:"Video",zip:"Archive",tar:"Archive",gz:"Archive",rar:"Archive",html:"HTML file",htm:"HTML file"};function v(l){const e=f(l);return e?D[e]??`${e.toUpperCase()} file`:"File"}function f(l){const e=l.lastIndexOf(".");if(e<=0||e===l.length-1)return null;const t=l.slice(e+1).toLowerCase();return t.length>4||!/^[a-z0-9]+$/.test(t)?null:t}function u(l){const e=g.c(17);let t,n;e[0]!==l?({filename:t,...n}=l,e[0]=l,e[1]=t,e[2]=n):(t=e[1],n=e[2]);let s,i,a;e[3]!==t?(i=f(t),s=i?h[i]??F:null,a=i?.toUpperCase()??"",e[3]=t,e[4]=s,e[5]=i,e[6]=a):(s=e[4],i=e[5],a=e[6]);const c=a,m=Math.min(8+c.length*4.6,28);let p,x;e[7]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsx("path",{d:"M19.5 1H8a4 4 0 0 0-4 4v30a4 4 0 0 0 4 4h16a4 4 0 0 0 4-4V9.5L19.5 1Z",className:"fill-background stroke-border",strokeWidth:"1.5"}),x=o.jsx("path",{d:"M19.5 1v4.5a4 4 0 0 0 4 4H28",className:"stroke-border",strokeWidth:"1.5"}),e[7]=p,e[8]=x):(p=e[7],x=e[8]);let r;e[9]!==m||e[10]!==s||e[11]!==i||e[12]!==c?(r=i&&s&&o.jsxs(o.Fragment,{children:[o.jsx("rect",{x:"1",y:"20",width:m,height:"12",rx:"3",fill:s}),o.jsx("text",{x:1+m/2,y:"29",textAnchor:"middle",fontSize:"7",fontWeight:"700",letterSpacing:"0.2",fill:"#FFFFFF",style:{fontFamily:"inherit"},children:c})]}),e[9]=m,e[10]=s,e[11]=i,e[12]=c,e[13]=r):r=e[13];let d;return e[14]!==n||e[15]!==r?(d=o.jsxs("svg",{viewBox:"0 0 32 40",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",...n,children:[p,x,r]}),e[14]=n,e[15]=r,e[16]=d):d=e[16],d}export{u as F,v as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{eK as C,c as f,j as c,as as j,r as d,n as p,bR as b,eL as v,eM as h}from"./index-C-W5dASy.js";import{L as N}from"./label-Cy4ljnv_.js";const D=C,g=d.createContext({}),E=t=>{const e=f.c(9);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let o;e[2]!==s.name?(o={name:s.name},e[2]=s.name,e[3]=o):o=e[3];let n;e[4]!==s?(n=c.jsx(j,{...s}),e[4]=s,e[5]=n):n=e[5];let r;return e[6]!==o||e[7]!==n?(r=c.jsx(g.Provider,{value:o,children:n}),e[6]=o,e[7]=n,e[8]=r):r=e[8],r},x=()=>{const t=f.c(13),e=d.useContext(g),s=d.useContext($),{getFieldState:o}=v();let n;t[0]!==e.name?(n={name:e.name},t[0]=e.name,t[1]=n):n=t[1];const r=h(n);let a;t[2]!==e.name||t[3]!==r||t[4]!==o?(a=o(e.name,r),t[2]=e.name,t[3]=r,t[4]=o,t[5]=a):a=t[5];const l=a;if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=s,m=`${i}-form-item`,F=`${i}-form-item-description`,I=`${i}-form-item-message`;let u;return t[6]!==e.name||t[7]!==l||t[8]!==i||t[9]!==m||t[10]!==F||t[11]!==I?(u={id:i,name:e.name,formItemId:m,formDescriptionId:F,formMessageId:I,...l},t[6]=e.name,t[7]=l,t[8]=i,t[9]=m,t[10]=F,t[11]=I,t[12]=u):u=t[12],u},$=d.createContext({});function L(t){const e=f.c(13);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const n=d.useId();let r;e[3]!==n?(r={id:n},e[3]=n,e[4]=r):r=e[4];let a;e[5]!==s?(a=p("grid gap-2",s),e[5]=s,e[6]=a):a=e[6];let l;e[7]!==o||e[8]!==a?(l=c.jsx("div",{"data-slot":"form-item",className:a,...o}),e[7]=o,e[8]=a,e[9]=l):l=e[9];let i;return e[10]!==r||e[11]!==l?(i=c.jsx($.Provider,{value:r,children:l}),e[10]=r,e[11]=l,e[12]=i):i=e[12],i}function w(t){const e=f.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:n,formItemId:r}=x(),a=!!n;let l;e[3]!==s?(l=p("text-foreground data-[error=true]:text-destructive",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==r||e[6]!==o||e[7]!==a||e[8]!==l?(i=c.jsx(N,{"data-slot":"form-label","data-error":a,className:l,htmlFor:r,...o}),e[5]=r,e[6]=o,e[7]=a,e[8]=l,e[9]=i):i=e[9],i}function P(t){const e=f.c(7);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];const{error:o,formItemId:n,formDescriptionId:r,formMessageId:a}=x(),l=o?`${r} ${a}`:`${r}`,i=!!o;let m;return e[2]!==n||e[3]!==s||e[4]!==l||e[5]!==i?(m=c.jsx(b,{"data-slot":"form-control",id:n,"aria-describedby":l,"aria-invalid":i,...s}),e[2]=n,e[3]=s,e[4]=l,e[5]=i,e[6]=m):m=e[6],m}function R(t){const e=f.c(9);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{formDescriptionId:n}=x();let r;e[3]!==s?(r=p("text-muted-foreground text-sm",s),e[3]=s,e[4]=r):r=e[4];let a;return e[5]!==n||e[6]!==o||e[7]!==r?(a=c.jsx("p",{"data-slot":"form-description",id:n,className:r,...o}),e[5]=n,e[6]=o,e[7]=r,e[8]=a):a=e[8],a}function y(t){const e=f.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:n,formMessageId:r}=x(),a=n?String(n?.message??""):o.children;if(!a)return null;let l;e[3]!==s?(l=p("text-destructive text-sm",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==a||e[6]!==r||e[7]!==o||e[8]!==l?(i=c.jsx("p",{"data-slot":"form-message",id:r,className:l,...o,children:a}),e[5]=a,e[6]=r,e[7]=o,e[8]=l,e[9]=i):i=e[9],i}export{D as F,L as a,P as b,y as c,E as d,w as e,R as f};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as P,H as Z,r as Y,j as i,B as ie,L as ge,ak as ue,am as ne,b as E,p as fe,ao as pe,ap as xe,e as le,q as se,t as O,K as oe,d6 as J,d7 as X,d8 as Q,as as he,Y as je,a3 as Se,av as ve,I as ae,cy as ze,cz as be,y as Ae,P as W,d9 as _e}from"./index-C-W5dASy.js";import{A as ye,b as Ce}from"./alert-CuEsZrDf.js";import{i as Oe}from"./XCircle-Cn5WdVId.js";import{n as Ne}from"./LinkExternal01-DWP8dcJA.js";import{s as De}from"./XClose-DyI1k_z6.js";import{u as we}from"./use-org-auth-client-DCF2a5iN.js";import{u as Te}from"./use-debounced-autosave-DSiZvyT9.js";import{A as Fe}from"./avatar-DeFAeBFl.js";import{I as re}from"./input-BPzKKVIm.js";import{d as ce,S as Pe,a as ke,b as Ee,c as Ie}from"./select-CX1EQjk0.js";import{A as me}from"./agent-icon-BhfneAwy.js";import{a as Le,i as Ve,e as Me}from"./constants-BSYv1IkQ.js";import{u as Re}from"./use-virtual-mcp-eZtpf4bS.js";import{b as $e}from"./agent-capabilities-C4tLW0Za.js";import{f as qe,i as Be,b as Ke,j as Ue}from"./use-organization-settings-BQYM8ne1.js";import{S as Ge}from"./switch-080KuP0Z.js";import{D as Qe}from"./domain-settings-fQdlB2tF.js";import{c as Ye,d as He,b as We,f as Ze,g as Je,e as Xe,a as et,A as tt}from"./alert-dialog-fRZZzq2b.js";import{R as it}from"./require-capability-DR7Mbbou.js";import"./User01-Dlgu2BER.js";import"./Check-DYWCAvRe.js";import"./ChevronDown-Dm7RFEzi.js";import"./ChevronUp-YRlpUnbI.js";import"./AlertCircle-BJLsdJJB.js";import"./Tool01-Dg67-JKv.js";import"./ArrowUp-BCnJIsa2.js";import"./ArrowLeft-BpINHsGO.js";import"./Tool02-_e_W6rPa.js";import"./TrendUp01-CSEGC0U8.js";import"./ZapSquare-DUHD_nc-.js";import"./Users03-DvaTkZMF.js";import"./CheckCircle-CZfdFD75.js";import"./ChevronRight-DfFDfMiT.js";import"./ChevronSelectorVertical-BrPFZOd6.js";import"./DotsVertical-Ds_DhNTo.js";import"./Stars02-CsRg1_DW.js";import"./UserSquare-BS_e8Pjv.js";import"./Copy01-B7kE9119.js";import"./CreditCard01-BBWGD6ln.js";import"./Download01-CtExxOFo.js";import"./Settings02-DsPup1VS.js";import"./Eye-Bkw_HSyr.js";import"./FilterLines-CdBZbJbR.js";import"./Share07-_7OUHtSc.js";import"./Globe01-CbzTjXVx.js";import"./Globe04-5uq9vA8E.js";import"./SwitchHorizontal01-Buwrdn2y.js";import"./HardDrive-DLZzUCJy.js";import"./Key01-WP13V6P8.js";import"./LockUnlocked01-BsAWOf6A.js";import"./LogOut01-DUJGO4hF.js";import"./Monitor01-DZgvR7bI.js";import"./Sun-lLrEGeIB.js";import"./Palette-BRlImZFI.js";import"./Play-xBrWdkON.js";import"./Plus-DKhcQWfb.js";import"./SearchLg-BzZYCybQ.js";import"./SearchMd-C-eFE6qY.js";import"./Shield01-BMGrPJL4.js";import"./Stars01-DyPW1NZ3.js";import"./Trash01-649gpHj9.js";import"./Upload01-DjDsiYUt.js";import"./Users01-C7EqAQaR.js";import"./Zap-D44l2tlW.js";import"./use-mcp-client-PMt78ucZ.js";import"./auth-CsyM6wOp.js";import"./badge-BNu531uc.js";import"./access-gate-D_1GlcS4.js";import"./capability-load-error-DUMl4Cfr.js";function de(e){return`connect-banner-dismissed:${e}`}function st(e){if(typeof window>"u")return!0;try{return localStorage.getItem(de(e))==="1"}catch{return!1}}function nt(){const e=P.c(17),{org:t}=Z();let n;e[0]!==t.id?(n=()=>st(t.id),e[0]=t.id,e[1]=n):n=e[1];const[r,c]=Y.useState(n);if(r)return null;let a;e[2]!==t.id?(a=()=>{c(!0);try{localStorage.setItem(de(t.id),"1")}catch{}},e[2]=t.id,e[3]=a):a=e[3];const g=a;let m;e[4]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(Ne,{}),e[4]=m):m=e[4];let o;e[5]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx("span",{children:"Use Studio MCP anywhere — paste a command into Claude Code, Cursor, Codex, or any MCP client."}),e[5]=o):o=e[5];let f;e[6]!==t.slug?(f={org:t.slug},e[6]=t.slug,e[7]=f):f=e[7];let s;e[8]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx(Oe,{size:12}),e[8]=s):s=e[8];let d;e[9]!==f?(d=i.jsx(ie,{asChild:!0,size:"sm",variant:"ghost",className:"text-xs gap-1",children:i.jsxs(ge,{to:"/$org/settings/connect",params:f,children:["Connect to clients ",s]})}),e[9]=f,e[10]=d):d=e[10];let l;e[11]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx(De,{size:14}),e[11]=l):l=e[11];let u;e[12]!==g?(u=i.jsx(ie,{variant:"ghost",size:"icon",className:"size-7",onClick:g,"aria-label":"Dismiss",children:l}),e[12]=g,e[13]=u):u=e[13];let p;return e[14]!==d||e[15]!==u?(p=i.jsxs(ye,{variant:"info",className:"items-center",children:[m,i.jsxs(Ce,{className:"flex-1 flex items-center justify-between gap-2 text-sm",children:[o,i.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[d,u]})]})]}),e[14]=d,e[15]=u,e[16]=p):p=e[16],p}const ot=ue({name:ne().min(1,"Name is required").max(255,"Name is too long"),logo:ne().optional()});function at(e){const t=P.c(17),{value:n,onChange:r,name:c,disabled:a}=e,g=E(),m=Y.useRef(null);let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=()=>m.current?.click(),t[0]=o):o=t[0];const f=o;let s;t[1]!==r||t[2]!==g?(s=N=>{const x=N.target.files?.[0];if(!x)return;if(x.size>2097152){O.error(g("settings.organizationForm.imageTooLarge"));return}const h=new FileReader;h.onerror=()=>O.error(g("settings.organizationForm.failedToReadImage")),h.onloadend=()=>{h.result&&r(h.result),m.current&&(m.current.value="")},h.readAsDataURL(x)},t[1]=r,t[2]=g,t[3]=s):s=t[3];const d=s;let l;t[4]!==g?(l=g("settings.organizationForm.uploadLogoLabel"),t[4]=g,t[5]=l):l=t[5];let u;t[6]!==a||t[7]!==d?(u=i.jsx("input",{ref:m,type:"file",accept:"image/*",onChange:d,className:"hidden",disabled:a}),t[6]=a,t[7]=d,t[8]=u):u=t[8];const p=n||void 0,j=c??"?";let S;t[9]!==p||t[10]!==j?(S=i.jsx(Fe,{url:p,fallback:j,shape:"square",size:"base"}),t[9]=p,t[10]=j,t[11]=S):S=t[11];let z;return t[12]!==a||t[13]!==l||t[14]!==u||t[15]!==S?(z=i.jsxs("button",{type:"button",onClick:f,disabled:a,className:"rounded-lg overflow-hidden hover:ring-2 hover:ring-border transition-all disabled:opacity-50","aria-label":l,children:[u,S]}),t[12]=a,t[13]=l,t[14]=u,t[15]=S,t[16]=z):z=t[16],z}function lt(){const e=E(),{org:t}=Z(),n=we(),r=fe(),c=pe({resolver:xe(ot),values:{name:t.name??"",logo:t.logo??""}}),a=le({mutationFn:async s=>{const d={name:s.name};s.logo&&(d.logo=s.logo);const l=await n.organization.update({data:d});if(l?.error)throw new Error(l.error.message||e("settings.organizationForm.failedToUpdateOrg"));return l},onSuccess:(s,d)=>{se("organization_settings_updated",{organization_id:t.id,fields:Object.keys(d)}),r.invalidateQueries({queryKey:oe.organizations()}),r.invalidateQueries({queryKey:oe.activeOrganization(t.slug)}),O.success(e("settings.organizationForm.updateSuccess"))},onError:(s,d)=>{se("organization_settings_update_failed",{organization_id:t.id,fields:Object.keys(d),error:s instanceof Error?s.message:String(s)}),O.error(s instanceof Error?s.message:e("settings.organizationForm.failedToUpdateOrg"))}}),{schedule:g,flush:m}=Te({save:async()=>{const s=c.control._formState.dirtyFields;if(Object.keys(s).length===0||!await c.trigger())return;const l=c.getValues(),u=c.control._defaultValues;c.reset(l,{keepValues:!0});try{await a.mutateAsync(l)}catch{c.reset(u,{keepValues:!0})}}}),o=c.formState.errors,f=typeof window<"u"?`${window.location.host}/`:"";return i.jsx(J,{children:i.jsxs(X,{children:[i.jsx(Q,{title:e("settings.organizationForm.logoTitle"),description:e("settings.organizationForm.logoDescription"),action:i.jsx(at,{value:c.watch("logo"),onChange:s=>{c.setValue("logo",s??"",{shouldDirty:!0}),m()},name:c.watch("name")})}),i.jsx(Q,{title:e("settings.organizationForm.nameTitle"),action:i.jsx(he,{control:c.control,name:"name",render:({field:s})=>i.jsx(re,{id:"org-name",...s,onChange:d=>{s.onChange(d),g()},onBlur:()=>{s.onBlur(),m()},placeholder:e("settings.organizationForm.namePlaceholder"),className:"w-[280px]"})})}),i.jsx(Q,{title:e("settings.organizationForm.urlTitle"),description:e("settings.organizationForm.urlDescription"),action:i.jsxs("div",{className:"flex items-center w-[280px] rounded-md border border-input bg-muted/40 overflow-hidden",children:[f&&i.jsx("span",{className:"pl-3 text-sm text-muted-foreground select-none",children:f}),i.jsx("span",{className:"flex-1 min-w-0 px-2 py-1.5 text-sm text-foreground truncate",children:t.slug})]})}),(o.name||o.logo)&&i.jsxs("div",{className:"px-5 pb-3 flex flex-col gap-1",children:[o.name&&i.jsx("p",{className:"text-xs text-destructive",children:o.name.message}),o.logo&&i.jsx("p",{className:"text-xs text-destructive",children:o.logo.message})]})]})})}const te="__super_agent__";function rt(){const e=P.c(42),t=E(),{org:n}=Z(),r=Re(),{mainAgentId:c}=qe(),a=Be();let g,m,o,f,s,d,l,u;if(e[0]!==r||e[1]!==c||e[2]!==n.id||e[3]!==a||e[4]!==t){const S=$e(r),z=(r??[]).filter(dt).filter(v=>!S.has(v.id)).filter(mt);let N;e[13]!==n.id?(N=Le(n.id),e[13]=n.id,e[14]=N):N=e[14];const x=N,h=c!=null?(r??[]).find(v=>v.id===c):void 0,D=h?h.id:te,w=h&&!z.some(v=>v.id===h.id)?[h,...z]:z;let C;e[15]!==r||e[16]!==a||e[17]!==x.title||e[18]!==t?(C=v=>{const y=v===te?null:v,I=y===null?x.title:(r??[]).find(F=>F.id===y)?.title??"";a.mutate(y,{onSuccess:()=>O.success(y===null?t("settings.mainAgent.resetToast"):t("settings.mainAgent.setToast",{title:I})),onError:()=>O.error(t("settings.mainAgent.errorToast"))})},e[15]=r,e[16]=a,e[17]=x.title,e[18]=t,e[19]=C):C=e[19];const T=C;m=Pe,s=D,d=T,l=a.isPending,e[20]===Symbol.for("react.memo_cache_sentinel")?(u=i.jsx(ke,{className:"w-full sm:w-[280px]",children:i.jsx(Ee,{})}),e[20]=u):u=e[20],g=Ie;let b;e[21]!==x.icon||e[22]!==x.title?(b=i.jsx(me,{icon:x.icon,name:x.title,size:"xs",className:"shrink-0"}),e[21]=x.icon,e[22]=x.title,e[23]=b):b=e[23];let A;e[24]!==t?(A=t("settings.mainAgent.superAgentOption"),e[24]=t,e[25]=A):A=e[25];let _;e[26]!==A?(_=i.jsx("span",{className:"truncate",children:A}),e[26]=A,e[27]=_):_=e[27],e[28]!==_||e[29]!==b?(o=i.jsx(ce,{value:te,children:i.jsxs("span",{className:"flex items-center gap-2",children:[b,_]})}),e[28]=_,e[29]=b,e[30]=o):o=e[30],f=w.map(ct),e[0]=r,e[1]=c,e[2]=n.id,e[3]=a,e[4]=t,e[5]=g,e[6]=m,e[7]=o,e[8]=f,e[9]=s,e[10]=d,e[11]=l,e[12]=u}else g=e[5],m=e[6],o=e[7],f=e[8],s=e[9],d=e[10],l=e[11],u=e[12];let p;e[31]!==g||e[32]!==o||e[33]!==f?(p=i.jsxs(g,{children:[o,f]}),e[31]=g,e[32]=o,e[33]=f,e[34]=p):p=e[34];let j;return e[35]!==m||e[36]!==s||e[37]!==d||e[38]!==l||e[39]!==u||e[40]!==p?(j=i.jsxs(m,{value:s,onValueChange:d,disabled:l,children:[u,p]}),e[35]=m,e[36]=s,e[37]=d,e[38]=l,e[39]=u,e[40]=p,e[41]=j):j=e[41],j}function ct(e){return i.jsx(ce,{value:e.id,children:i.jsxs("span",{className:"flex items-center gap-2",children:[i.jsx(me,{icon:e.icon,name:e.title,size:"xs",className:"shrink-0"}),i.jsx("span",{className:"truncate",children:e.title})]})},e.id)}function mt(e){return!Me(e.id)}function dt(e){return!Ve(e.id)}function gt(){const e=P.c(16),t=E();let n;e[0]!==t?(n=t("settings.mainAgent.title"),e[0]=t,e[1]=n):n=e[1];let r;e[2]!==t?(r=t("settings.mainAgent.description"),e[2]=t,e[3]=r):r=e[3];let c;e[4]!==t?(c=t("settings.mainAgent.itemTitle"),e[4]=t,e[5]=c):c=e[5];let a;e[6]!==t?(a=t("settings.mainAgent.itemDescription"),e[6]=t,e[7]=a):a=e[7];let g;e[8]===Symbol.for("react.memo_cache_sentinel")?(g=i.jsx(Y.Suspense,{fallback:i.jsx(je,{className:"h-9 w-[280px]"}),children:i.jsx(rt,{})}),e[8]=g):g=e[8];let m;e[9]!==c||e[10]!==a?(m=i.jsx(X,{children:i.jsx(Q,{title:c,description:a,action:g})}),e[9]=c,e[10]=a,e[11]=m):m=e[11];let o;return e[12]!==n||e[13]!==r||e[14]!==m?(o=i.jsx(J,{title:n,description:r,children:m}),e[12]=n,e[13]=r,e[14]=m,e[15]=o):o=e[15],o}function ut(){const e=P.c(27),t=E(),n=Ke(),r=Ue();let c;e[0]!==t?(c=t("settings.navigation.title"),e[0]=t,e[1]=c):c=e[1];let a;e[2]!==t?(a=t("settings.navigation.description"),e[2]=t,e[3]=a):a=e[3];let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=i.jsx(Se,{size:16}),e[4]=g):g=e[4];let m;e[5]!==t?(m=t("settings.navigation.navV2Title"),e[5]=t,e[6]=m):m=e[6];let o;e[7]!==t?(o=t("settings.navigation.navV2Description"),e[7]=t,e[8]=o):o=e[8];const f=r.isPending;let s;e[9]!==t?(s=t("settings.navigation.navV2Title"),e[9]=t,e[10]=s):s=e[10];let d;e[11]!==r||e[12]!==t?(d=j=>r.mutate("nav_v2",j,{onError:()=>O.error(t("settings.navigation.updateError"))}),e[11]=r,e[12]=t,e[13]=d):d=e[13];let l;e[14]!==n||e[15]!==r.isPending||e[16]!==s||e[17]!==d?(l=i.jsx(Ge,{checked:n,disabled:f,"aria-label":s,onCheckedChange:d}),e[14]=n,e[15]=r.isPending,e[16]=s,e[17]=d,e[18]=l):l=e[18];let u;e[19]!==m||e[20]!==o||e[21]!==l?(u=i.jsx(X,{children:i.jsx(Q,{icon:g,title:m,description:o,action:l})}),e[19]=m,e[20]=o,e[21]=l,e[22]=u):u=e[22];let p;return e[23]!==c||e[24]!==a||e[25]!==u?(p=i.jsx(J,{title:c,description:a,children:u}),e[23]=c,e[24]=a,e[25]=u,e[26]=p):p=e[26],p}function ft(){const e=P.c(86),t=E(),{org:n}=Z(),[r,c]=Y.useState(!1),[a,g]=Y.useState(""),m=ve();let o;e[0]!==n.id||e[1]!==m?(o=async()=>{await m.call("ORGANIZATION_DELETE",{id:n.id})},e[0]=n.id,e[1]=m,e[2]=o):o=e[2];let f;e[3]!==n.id||e[4]!==n.slug||e[5]!==t?(f=()=>{se("organization_deleted",{organization_id:n.id}),localStorage.getItem(ae.lastOrgSlug())===n.slug&&localStorage.removeItem(ae.lastOrgSlug()),ze()?.org===n.slug&&be(),Ae(),O.success(t("settings.deleteOrganizationSection.organizationDeleted")),window.location.href="/"},e[3]=n.id,e[4]=n.slug,e[5]=t,e[6]=f):f=e[6];let s;e[7]!==t?(s=k=>{O.error(k instanceof Error?k.message:t("settings.deleteOrganizationSection.failedToDeleteOrganization"))},e[7]=t,e[8]=s):s=e[8];let d;e[9]!==o||e[10]!==f||e[11]!==s?(d={mutationFn:o,onSuccess:f,onError:s},e[9]=o,e[10]=f,e[11]=s,e[12]=d):d=e[12];const l=le(d);let u;e[13]!==t?(u=t("settings.deleteOrganizationSection.dangerZone"),e[13]=t,e[14]=u):u=e[14];let p;e[15]!==t?(p=t("settings.deleteOrganizationSection.irreversibleActionsDescription"),e[15]=t,e[16]=p):p=e[16];let j;e[17]!==t?(j=t("settings.deleteOrganizationSection.deleteOrganizationTitle"),e[17]=t,e[18]=j):j=e[18];let S;e[19]!==t?(S=t("settings.deleteOrganizationSection.deleteOrganizationDescription"),e[19]=t,e[20]=S):S=e[20];let z;e[21]===Symbol.for("react.memo_cache_sentinel")?(z=()=>c(!0),e[21]=z):z=e[21];const N=l.isPending;let x;e[22]!==t?(x=t("settings.deleteOrganizationSection.deleteButton"),e[22]=t,e[23]=x):x=e[23];let h;e[24]!==l.isPending||e[25]!==x?(h=i.jsx(ie,{variant:"destructive",size:"sm",onClick:z,disabled:N,children:x}),e[24]=l.isPending,e[25]=x,e[26]=h):h=e[26];let D;e[27]!==h||e[28]!==j||e[29]!==S?(D=i.jsx(X,{className:"border-destructive/40",children:i.jsx(Q,{title:j,description:S,action:h})}),e[27]=h,e[28]=j,e[29]=S,e[30]=D):D=e[30];let w;e[31]!==D||e[32]!==u||e[33]!==p?(w=i.jsx(J,{title:u,description:p,children:D}),e[31]=D,e[32]=u,e[33]=p,e[34]=w):w=e[34];let C;e[35]===Symbol.for("react.memo_cache_sentinel")?(C=k=>{c(k),k||g("")},e[35]=C):C=e[35];let T;e[36]!==t?(T=t("settings.deleteOrganizationSection.deleteOrganizationQuestion"),e[36]=t,e[37]=T):T=e[37];let b;e[38]!==T?(b=i.jsx(Ye,{children:T}),e[38]=T,e[39]=b):b=e[39];let A;e[40]!==n.name||e[41]!==t?(A=t("settings.deleteOrganizationSection.deleteWarning",{organizationName:n.name}),e[40]=n.name,e[41]=t,e[42]=A):A=e[42];let _;e[43]!==A?(_=i.jsx("p",{children:A}),e[43]=A,e[44]=_):_=e[44];let v;e[45]!==n.name||e[46]!==t?(v=t("settings.deleteOrganizationSection.typeToConfirm",{organizationName:n.name}),e[45]=n.name,e[46]=t,e[47]=v):v=e[47];let y;e[48]!==v?(y=i.jsx("p",{className:"mt-3 mb-1.5",children:v}),e[48]=v,e[49]=y):y=e[49];let I;e[50]===Symbol.for("react.memo_cache_sentinel")?(I=k=>g(k.target.value),e[50]=I):I=e[50];let F;e[51]!==a||e[52]!==n.name?(F=i.jsx(re,{value:a,onChange:I,placeholder:n.name,autoFocus:!0}),e[51]=a,e[52]=n.name,e[53]=F):F=e[53];let L;e[54]!==_||e[55]!==y||e[56]!==F?(L=i.jsx(He,{asChild:!0,children:i.jsxs("div",{children:[_,y,F]})}),e[54]=_,e[55]=y,e[56]=F,e[57]=L):L=e[57];let V;e[58]!==b||e[59]!==L?(V=i.jsxs(We,{children:[b,L]}),e[58]=b,e[59]=L,e[60]=V):V=e[60];let M;e[61]!==t?(M=t("settings.deleteOrganizationSection.cancel"),e[61]=t,e[62]=M):M=e[62];let R;e[63]!==M?(R=i.jsx(Ze,{children:M}),e[63]=M,e[64]=R):R=e[64];let $;e[65]!==l?($=()=>l.mutate(),e[65]=l,e[66]=$):$=e[66];const ee=a!==n.name||l.isPending;let q;e[67]!==l.isPending||e[68]!==t?(q=l.isPending?t("settings.deleteOrganizationSection.deleting"):t("settings.deleteOrganizationSection.deleteOrganizationAction"),e[67]=l.isPending,e[68]=t,e[69]=q):q=e[69];let B;e[70]!==$||e[71]!==ee||e[72]!==q?(B=i.jsx(Je,{onClick:$,disabled:ee,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90 disabled:opacity-50",children:q}),e[70]=$,e[71]=ee,e[72]=q,e[73]=B):B=e[73];let K;e[74]!==R||e[75]!==B?(K=i.jsxs(Xe,{children:[R,B]}),e[74]=R,e[75]=B,e[76]=K):K=e[76];let U;e[77]!==V||e[78]!==K?(U=i.jsxs(et,{children:[V,K]}),e[77]=V,e[78]=K,e[79]=U):U=e[79];let G;e[80]!==r||e[81]!==U?(G=i.jsx(tt,{open:r,onOpenChange:C,children:U}),e[80]=r,e[81]=U,e[82]=G):G=e[82];let H;return e[83]!==w||e[84]!==G?(H=i.jsxs(i.Fragment,{children:[w,G]}),e[83]=w,e[84]=G,e[85]=H):H=e[85],H}function pt(){const e=P.c(12),t=E();let n;e[0]!==t?(n=t("settings.orgGeneral.organization"),e[0]=t,e[1]=n):n=e[1];let r;e[2]!==n?(r=i.jsx(W.Title,{children:n}),e[2]=n,e[3]=r):r=e[3];let c,a,g,m,o,f;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx(nt,{}),a=i.jsx(lt,{}),g=i.jsx(gt,{}),m=i.jsx(ut,{}),o=i.jsx(Qe,{}),f=i.jsx(ft,{}),e[4]=c,e[5]=a,e[6]=g,e[7]=m,e[8]=o,e[9]=f):(c=e[4],a=e[5],g=e[6],m=e[7],o=e[8],f=e[9]);let s;return e[10]!==r?(s=i.jsx(W,{children:i.jsx(W.Content,{children:i.jsx(W.Body,{children:i.jsxs(_e,{children:[r,c,a,g,m,o,f]})})})}),e[10]=r,e[11]=s):s=e[11],s}function Ti(){const e=P.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsx(it,{capability:"org:manage",area:"general settings",children:i.jsx(pt,{})}),e[0]=t):t=e[0],t}export{Ti as default};
|
package/dist/client/assets/{github-repo-picker-B0itW_sn.js → github-repo-picker-DxNDjsxj.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as M,j as t,F as de,a as ye,o as me,r as H,ap as le,b as ee,k as Z,e as ge,t as te,e4 as Ne,K as se,G as ke,n as ve,m as ae,B as re,x as Ce,y as Re}from"./index-DTCr2n-a.js";import{a as we,b as Pe,d as Se,e as Ie}from"./dialog-B0pGkX2q.js";import{C as Te}from"./collection-search-BQLruUQ4.js";import{u as _e}from"./use-debounced-value-UZPGD-zb.js";import{b as he,u as Ee}from"./use-connection-D7--TeDa.js";import{u as ne}from"./use-mcp-client-DFoPNyXR.js";import{W as Ae,S as pe}from"./constants-BSYv1IkQ.js";import{a as be}from"./authenticate-and-persist-oauth-CB658Lpc.js";import{i as ue}from"./ArrowLeft-D0sSJGyh.js";import{n as ze}from"./LinkExternal01-lwDudDKU.js";import{n as Le}from"./LockUnlocked01-ChTbbG9p.js";import{u as Ge}from"./use-mcp-tools-ByMlhxuh.js";import{e as Oe}from"./extract-connection-data-DyM1tiNg.js";import{c as Fe}from"./use-navigate-to-agent-CX93JJ-W.js";import{g as Ue,p as fe,f as He,G as xe}from"./provision-repo-scoped-github-connection-CMPWtdMv.js";function D(C){const e=M.c(4),{size:n,className:l}=C;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0016 8c0-4.42-3.58-8-8-8z"}),e[0]=x):x=e[0];let o;return e[1]!==l||e[2]!==n?(o=t.jsx("svg",{width:n,height:n,viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",className:l,children:x}),e[1]=l,e[2]=n,e[3]=o):o=e[3],o}function $e(C,e){const n=M.c(12),{org:l}=de();let x;n[0]!==l.id?(x=Ae.REGISTRY(l.id),n[0]=l.id,n[1]=x):x=n[1];const o=x;let a;n[2]!==l.id||n[3]!==l.slug||n[4]!==o?(a={connectionId:o,orgId:l.id,orgSlug:l.slug},n[2]=l.id,n[3]=l.slug,n[4]=o,n[5]=a):a=n[5];const r=ne(a);let s;n[6]!==C?(s={name:C},n[6]=C,n[7]=s):s=n[7];const u=e?.enabled??!0;let k;return n[8]!==r||n[9]!==s||n[10]!==u?(k={client:r,toolName:"COLLECTION_REGISTRY_APP_GET",toolArguments:s,enabled:u,staleTime:3e5,select:De},n[8]=r,n[9]=s,n[10]=u,n[11]=k):k=n[11],Ge(k)}function De(C){return C.structuredContent?.item??null}const Me="deco/mcp-github";function Be(C){const{org:e}=de(),{data:n}=ye.useSession(),l=he(),x=me(),[o,a]=H.useState("idle"),[r,s]=H.useState(null),[u,k]=H.useState(null),{data:v,isLoading:P}=$e(Me,{enabled:C.enabled}),f=H.useRef(!1);C.enabled&&v&&!P&&!f.current&&n?.user?.id&&o==="idle"&&(f.current=!0,d());async function d(){if(!(!v||!n?.user?.id||!e))try{a("installing"),s(null);const c=Oe(v,e.id,n.user.id,{remoteIndex:0});if(!c.connection_url)throw new Error("Registry item is missing a remote URL for mcp-github");const{id:h}=await l.create.mutateAsync(c);a("authenticating");const y=await be({connectionId:h,orgId:e.id,orgSlug:e.slug,persistFallback:g=>l.update.mutateAsync({id:h,data:{connection_token:g}}).then(()=>{})});if(y.ran&&!y.ok){try{await l.delete.mutateAsync(h)}catch{}throw new Error(y.error&&y.error!=="no token received"?y.error:"No token received from GitHub")}le(x,e.id),k(c),a("ready")}catch(c){s(c instanceof Error?c.message:String(c)),a("error")}}function m(){a("idle"),s(null),k(null),f.current=!1}return C.enabled&&P&&o==="idle"?{status:"installing",error:null,connection:null,retry:m}:{status:o,error:r,connection:u,retry:m}}function mt(C){const e=M.c(27),{open:n,onOpenChange:l,title:x,onImportComplete:o,mode:a}=C,r=a===void 0?"agent":a,s=ee();let u;e[0]!==r||e[1]!==s||e[2]!==x?(u=x??s(r==="connection"?"common.githubRepoPicker.addRepo":"common.githubRepoPicker.importFromGitHub"),e[0]=r,e[1]=s,e[2]=x,e[3]=u):u=e[3];const k=u,[v,P]=H.useState(null);let f;e[4]!==k?(f=t.jsx(we,{className:"sr-only",children:t.jsx(Pe,{children:k})}),e[4]=k,e[5]=f):f=e[5];let d;e[6]!==k||e[7]!==v||e[8]!==s?(d=t.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3 shrink-0",children:v?t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:()=>P(null),className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors shrink-0","aria-label":s("common.githubRepoPicker.backToAccounts"),children:t.jsx(ue,{size:16})}),t.jsx("img",{src:v.avatarUrl,alt:v.login,className:"size-5 rounded-full ring-1 ring-border shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:v.login})]}):t.jsxs(t.Fragment,{children:[t.jsx(D,{className:"size-4 text-foreground shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:k})]})}),e[6]=k,e[7]=v,e[8]=s,e[9]=d):d=e[9];let m;e[10]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(Z,{size:18,className:"animate-spin text-muted-foreground"})}),e[10]=m):m=e[10];let c;e[11]!==l?(c=()=>l(!1),e[11]=l,e[12]=c):c=e[12];let b;e[13]!==r||e[14]!==o||e[15]!==n||e[16]!==v||e[17]!==c?(b=t.jsx("div",{className:"flex-1 overflow-hidden flex flex-col min-w-0",children:t.jsx(H.Suspense,{fallback:m,children:t.jsx(qe,{open:n,onComplete:c,selectedInstallation:v,onSelectInstallation:P,onImportComplete:o,mode:r})})}),e[13]=r,e[14]=o,e[15]=n,e[16]=v,e[17]=c,e[18]=b):b=e[18];let h;e[19]!==f||e[20]!==d||e[21]!==b?(h=t.jsxs(Se,{className:"sm:max-w-[560px] h-[85svh] sm:h-[520px] p-0 gap-0 overflow-hidden flex flex-col",children:[f,d,b]}),e[19]=f,e[20]=d,e[21]=b,e[22]=h):h=e[22];let y;return e[23]!==l||e[24]!==n||e[25]!==h?(y=t.jsx(Ie,{open:n,onOpenChange:l,children:h}),e[23]=l,e[24]=n,e[25]=h,e[26]=y):y=e[26],y}function qe({open:C,onComplete:e,selectedInstallation:n,onSelectInstallation:l,onImportComplete:x,mode:o="agent"}){const a=ee(),{org:r}=de(),s=me(),u=Fe(),[k,v]=H.useState(null),P=Ee({slug:"mcp-github"}),f=Ue(P),d=Be({enabled:C&&f.length===0}),m=f.length===1?f[0]??null:k,c=ne({connectionId:m?.id??"",orgId:r.id,orgSlug:r.slug}),b=ne({connectionId:pe,orgId:r.id,orgSlug:r.slug}),h=async(i,j)=>{try{const I=await c.callTool({name:"get_file_contents",arguments:{owner:i.owner,repo:i.name,path:j}});if(I.isError)return null;const R=I.content?.find(w=>w.type==="resource")?.resource?.text;if(!R)return null;try{const w=JSON.parse(R);return typeof w=="string"?w:JSON.stringify(w)}catch{return R}}catch{return null}},y=(i,j)=>{Promise.all([h(j,"AGENTS.md"),h(j,"CLAUDE.md")]).then(async([N,I])=>{const T=N??I??null;T&&(await b.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:i,data:{metadata:{instructions:T}}}}),le(s,r.id))}).catch(N=>{console.error("GitHub instructions fetch failed:",N)})},g=ge({mutationFn:async i=>{if(!m||!n)throw new Error("No GitHub connection or installation");const j=n.installationId;if(o==="connection"){const{childConnectionId:R}=await fe({orgSlug:r.slug,sourceConnection:m,installationId:j,owner:i.owner,repo:i.name,githubCallTool:w=>c.callTool(w),selfCallTool:w=>b.callTool(w),orgShared:!0});return{virtualMcpId:null,repo:i,connectionId:R,item:null}}const{childConnectionId:N,reused:I}=await fe({orgSlug:r.slug,sourceConnection:m,installationId:j,owner:i.owner,repo:i.name,githubCallTool:R=>c.callTool(R),selfCallTool:R=>b.callTool(R)});let T=null;try{const R=await b.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:i.name,description:i.description||"Imported from GitHub",pinned:!1,icon:null,metadata:{githubRepo:{owner:i.owner,name:i.name,url:i.url,installationId:j,connectionId:N},instructions:null,ui:{pinnedViews:null,layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}},connections:[{connection_id:N}]}}}),w=R.structuredContent??R,_=w.item?.id;if(!w.item||!_)throw new Error("Failed to create the imported agent");return T=_,{virtualMcpId:_,repo:i,connectionId:N,item:w.item}}catch(R){throw T&&await b.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:T}}).catch(()=>{}),I||await b.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:N,force:!0}}).catch(()=>{}),R}},onSuccess:({virtualMcpId:i,repo:j,connectionId:N,item:I})=>{if(o==="connection"||!i||!I){if(le(s,r.id),Ne(s,r.id),x){x({virtualMcpId:null,repo:j,connectionId:N});return}te.success(a("common.githubRepoPicker.addedRepo",{name:j.name})),e();return}if(s.setQueryData(se.collectionItem(b,r.id,"","VIRTUAL_MCP",i),{item:I}),le(s,r.id),y(i,j),x){x({virtualMcpId:i,repo:j,connectionId:N});return}te.success(a("common.githubRepoPicker.importedRepo",{name:j.name})),e(),localStorage.setItem(ke.sidebarOpen(),JSON.stringify(!1)),u(i)},onError:(i,j)=>{console.error("GitHub import failed:",i);const N=i instanceof Error?i.message:a("common.githubRepoPicker.unknownError");if(j.fork&&N.toLowerCase().includes("mint")){te.error(a("common.githubRepoPicker.failedImportFork",{name:j.name}));return}te.error(a("common.githubRepoPicker.failedImport",{error:N}))}});return d.status==="installing"||d.status==="authenticating"?t.jsx(ce,{status:d.status,error:null,retry:d.retry}):d.status==="error"?t.jsx(ce,{status:"error",error:d.error,retry:d.retry}):f.length===0&&d.status==="idle"?t.jsx(ce,{status:"installing",error:null,retry:d.retry}):f.length>1&&!m?t.jsxs("div",{className:"flex flex-col py-2",children:[t.jsx("div",{className:"px-4 py-2",children:t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:a("common.githubRepoPicker.selectConnection")})}),f.map(i=>t.jsxs("button",{type:"button",onClick:()=>v(i),className:"flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left",children:[i.icon?t.jsx("img",{src:i.icon,alt:i.title,className:"size-7 rounded-full shrink-0"}):t.jsx("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:t.jsx(D,{className:"size-3.5 text-muted-foreground"})}),t.jsx("span",{className:"text-sm font-medium",children:i.title})]},i.id))]}):m?n?t.jsx(Ke,{connectionId:m.id,orgId:r.id,orgSlug:r.slug,installation:n,onSelectRepo:i=>g.mutate(i),isSaving:g.isPending}):t.jsx(Qe,{connectionId:m.id,orgId:r.id,orgSlug:r.slug,onSelect:l,showBackButton:f.length>1,onBack:()=>v(null)}):null}function Qe(C){const e=M.c(124),{connectionId:n,orgId:l,orgSlug:x,onSelect:o,showBackButton:a,onBack:r}=C,s=ee();let u;e[0]!==l||e[1]!==x?(u={connectionId:pe,orgId:l,orgSlug:x},e[0]=l,e[1]=x,e[2]=u):u=e[2];const k=ne(u),v=me(),P=he();let f;e[3]!==n||e[4]!==l?(f=se.githubUserOrgs(l,n),e[3]=n,e[4]=l,e[5]=f):f=e[5];let d;e[6]!==n||e[7]!==k?(d=()=>He(p=>k.callTool(p),n),e[6]=n,e[7]=k,e[8]=d):d=e[8];let m;e[9]!==f||e[10]!==d?(m={queryKey:f,queryFn:d},e[9]=f,e[10]=d,e[11]=m):m=e[11];const c=ve(m);let b;e[12]!==P||e[13]!==n||e[14]!==c||e[15]!==l||e[16]!==x||e[17]!==v?(b=async()=>{const p=await be({connectionId:n,orgId:l,orgSlug:x,persistFallback:E=>P.update.mutateAsync({id:n,data:{connection_token:E}}).then(Ve)});if(p.ran&&!p.ok)throw new Error(p.error??"no token received");const S=new URL(`/api/${x}/mcp/${n}`,window.location.origin);await v.invalidateQueries({queryKey:se.isMCPAuthenticated(S.href,null)}),await v.invalidateQueries({queryKey:se.mcpClientPrefix()}),await c.refetch()},e[12]=P,e[13]=n,e[14]=c,e[15]=l,e[16]=x,e[17]=v,e[18]=b):b=e[18];let h;e[19]!==s?(h=p=>{te.error(s("common.githubRepoPicker.failedReconnect",{error:p instanceof Error?p.message:s("common.githubRepoPicker.unknownError")}))},e[19]=s,e[20]=h):h=e[20];let y;e[21]!==b||e[22]!==h?(y={mutationFn:b,onError:h},e[21]=b,e[22]=h,e[23]=y):y=e[23];const g=ge(y);if(c.isLoading){let p;return e[24]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(Z,{size:18,className:"animate-spin text-muted-foreground"})}),e[24]=p):p=e[24],p}if(c.isError){let p;e[25]!==s?(p=s("common.githubRepoPicker.failedLoadAccounts"),e[25]=s,e[26]=p):p=e[26];let S;e[27]!==p?(S=t.jsx("p",{className:"text-sm text-destructive",children:p}),e[27]=p,e[28]=S):S=e[28];let E;e[29]!==s?(E=s("common.githubRepoPicker.connectionExpiredMessage"),e[29]=s,e[30]=E):E=e[30];let A;e[31]!==E?(A=t.jsx("p",{className:"text-xs text-muted-foreground max-w-[280px] leading-relaxed",children:E}),e[31]=E,e[32]=A):A=e[32];let z;e[33]!==g?(z=()=>g.mutate(),e[33]=g,e[34]=z):z=e[34];const $=g.isPending;let L;e[35]!==g.isPending?(L=g.isPending?t.jsx(Z,{size:14,className:"animate-spin"}):t.jsx(D,{className:"size-3.5"}),e[35]=g.isPending,e[36]=L):L=e[36];let G;e[37]!==s?(G=s("common.githubRepoPicker.reconnectGitHub"),e[37]=s,e[38]=G):G=e[38];let O;e[39]!==g.isPending||e[40]!==z||e[41]!==L||e[42]!==G?(O=t.jsxs(re,{type:"button",variant:"outline",size:"sm",onClick:z,disabled:$,children:[L,G]}),e[39]=g.isPending,e[40]=z,e[41]=L,e[42]=G,e[43]=O):O=e[43];let U;return e[44]!==A||e[45]!==O||e[46]!==S?(U=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-6 text-center",children:[S,A,O]}),e[44]=A,e[45]=O,e[46]=S,e[47]=U):U=e[47],U}const i=c.data;if(!i)return null;if(i.installations.length===0){let p;e[48]!==r||e[49]!==a||e[50]!==s?(p=a&&t.jsx("div",{className:"flex items-center gap-1 px-4 pt-3 pb-1 shrink-0",children:t.jsxs("button",{type:"button",onClick:r,className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[t.jsx(ue,{size:12}),s("common.githubRepoPicker.changeConnection")]})}),e[48]=r,e[49]=a,e[50]=s,e[51]=p):p=e[51];let S;e[52]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("div",{className:"size-16 rounded-2xl bg-muted flex items-center justify-center",children:t.jsx(D,{className:"size-8 text-foreground"})}),e[52]=S):S=e[52];let E;e[53]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx("span",{className:"size-1.5 rounded-full bg-success"}),e[53]=E):E=e[53];let A;e[54]!==s?(A=s("common.githubRepoPicker.githubConnected"),e[54]=s,e[55]=A):A=e[55];let z;e[56]!==A?(z=t.jsxs("div",{className:"mt-4 flex items-center gap-1.5 text-xs font-medium text-success",children:[E,A]}),e[56]=A,e[57]=z):z=e[57];let $;e[58]!==s?($=s("common.githubRepoPicker.setupRepositoriesTitle"),e[58]=s,e[59]=$):$=e[59];let L;e[60]!==$?(L=t.jsx("h2",{className:"mt-2 text-base font-semibold text-foreground",children:$}),e[60]=$,e[61]=L):L=e[61];let G;e[62]!==s?(G=s("common.githubRepoPicker.noRepositoriesShared"),e[62]=s,e[63]=G):G=e[63];let O;e[64]!==G?(O=t.jsx("p",{className:"mt-1.5 max-w-[360px] text-xs leading-relaxed text-muted-foreground",children:G}),e[64]=G,e[65]=O):O=e[65];let U;e[66]!==s?(U=s("common.githubRepoPicker.chooseRepositories"),e[66]=s,e[67]=U):U=e[67];let ie;e[68]===Symbol.for("react.memo_cache_sentinel")?(ie=t.jsx(ze,{size:14}),e[68]=ie):ie=e[68];let B;e[69]!==U?(B=t.jsx(re,{asChild:!0,size:"sm",children:t.jsxs("a",{href:xe,target:"_blank",rel:"noopener noreferrer",children:[U,ie]})}),e[69]=U,e[70]=B):B=e[70];let q;e[71]!==c?(q=()=>{c.refetch()},e[71]=c,e[72]=q):q=e[72];const je=c.isFetching;let Q;e[73]!==c.isFetching?(Q=c.isFetching&&t.jsx(Z,{size:14,className:"animate-spin"}),e[73]=c.isFetching,e[74]=Q):Q=e[74];let V;e[75]!==s?(V=s("common.githubRepoPicker.checkAgain"),e[75]=s,e[76]=V):V=e[76];let K;e[77]!==c.isFetching||e[78]!==q||e[79]!==Q||e[80]!==V?(K=t.jsxs(re,{type:"button",variant:"outline",size:"sm",onClick:q,disabled:je,children:[Q,V]}),e[77]=c.isFetching,e[78]=q,e[79]=Q,e[80]=V,e[81]=K):K=e[81];let J;e[82]!==B||e[83]!==K?(J=t.jsxs("div",{className:"mt-5 flex items-center gap-2",children:[B,K]}),e[82]=B,e[83]=K,e[84]=J):J=e[84];let W;e[85]!==s?(W=s("common.githubRepoPicker.repositoryAccessNote"),e[85]=s,e[86]=W):W=e[86];let Y;e[87]!==W?(Y=t.jsx("p",{className:"mt-4 max-w-[360px] rounded-lg bg-muted/50 px-3 py-2 text-xs leading-relaxed text-muted-foreground",children:W}),e[87]=W,e[88]=Y):Y=e[88];let X;e[89]!==z||e[90]!==L||e[91]!==O||e[92]!==J||e[93]!==Y?(X=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center px-8 py-6 text-center",children:[S,z,L,O,J,Y]}),e[89]=z,e[90]=L,e[91]=O,e[92]=J,e[93]=Y,e[94]=X):X=e[94];let oe;return e[95]!==X||e[96]!==p?(oe=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[p,X]}),e[95]=X,e[96]=p,e[97]=oe):oe=e[97],oe}let j;e[98]!==r||e[99]!==a||e[100]!==s?(j=a&&t.jsx("div",{className:"flex items-center gap-1 px-4 pt-3 pb-1 shrink-0",children:t.jsxs("button",{type:"button",onClick:r,className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[t.jsx(ue,{size:12}),s("common.githubRepoPicker.changeConnection")]})}),e[98]=r,e[99]=a,e[100]=s,e[101]=j):j=e[101];let N;if(e[102]!==i.installations||e[103]!==o||e[104]!==s){let p;e[106]!==o||e[107]!==s?(p=S=>t.jsxs("button",{type:"button",onClick:()=>o(S),className:"w-full flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left group",children:[t.jsx("img",{src:S.avatarUrl,alt:S.login,className:"size-7 rounded-full shrink-0 ring-1 ring-border"}),t.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[t.jsx("span",{className:"text-sm font-medium leading-none",children:S.login}),S.type==="User"&&t.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:s("common.githubRepoPicker.personalAccount")})]}),t.jsxs("span",{className:"text-xs text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity shrink-0",children:[s("common.githubRepoPicker.select")," →"]})]},S.installationId),e[106]=o,e[107]=s,e[108]=p):p=e[108],N=i.installations.map(p),e[102]=i.installations,e[103]=o,e[104]=s,e[105]=N}else N=e[105];let I;e[109]!==N?(I=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden [scrollbar-gutter:stable]",children:N}),e[109]=N,e[110]=I):I=e[110];let T;e[111]!==s?(T=s("common.githubRepoPicker.accountNotListed"),e[111]=s,e[112]=T):T=e[112];let R;e[113]!==s?(R=s("common.githubRepoPicker.installGitHubApp"),e[113]=s,e[114]=R):R=e[114];let w;e[115]!==R?(w=t.jsx("span",{className:"underline underline-offset-2",children:R}),e[115]=R,e[116]=w):w=e[116];let _;e[117]!==T||e[118]!==w?(_=t.jsx("div",{className:"px-4 py-3 border-t border-border shrink-0",children:t.jsxs("a",{href:xe,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:[T," ",w]})}),e[117]=T,e[118]=w,e[119]=_):_=e[119];let F;return e[120]!==I||e[121]!==_||e[122]!==j?(F=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[j,I,_]}),e[120]=I,e[121]=_,e[122]=j,e[123]=F):F=e[123],F}function Ve(){}function Ke(C){const e=M.c(23),{connectionId:n,orgId:l,orgSlug:x,installation:o,onSelectRepo:a,isSaving:r}=C,s=ee(),[u,k]=H.useState(""),v=_e(u,300),P=H.useDeferredValue(v),f=u!==P;let d;e[0]!==s?(d=s("common.githubRepoPicker.searchRepositories"),e[0]=s,e[1]=d):d=e[1];let m;e[2]!==f||e[3]!==u||e[4]!==d?(m=t.jsx(Te,{placeholder:d,value:u,onChange:k,isSearching:f}),e[2]=f,e[3]=u,e[4]=d,e[5]=m):m=e[5];const c=f?"opacity-40":"opacity-100";let b;e[6]!==c?(b=ae("flex-1 overflow-hidden flex flex-col transition-opacity duration-150",c),e[6]=c,e[7]=b):b=e[7];let h;e[8]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(Z,{size:18,className:"animate-spin text-muted-foreground"})}),e[8]=h):h=e[8];let y;e[9]!==n||e[10]!==P||e[11]!==o||e[12]!==r||e[13]!==a||e[14]!==l||e[15]!==x?(y=t.jsx(H.Suspense,{fallback:h,children:t.jsx(Je,{connectionId:n,orgId:l,orgSlug:x,installation:o,query:P,onSelectRepo:a,isSaving:r})}),e[9]=n,e[10]=P,e[11]=o,e[12]=r,e[13]=a,e[14]=l,e[15]=x,e[16]=y):y=e[16];let g;e[17]!==b||e[18]!==y?(g=t.jsx("div",{className:b,children:y}),e[17]=b,e[18]=y,e[19]=g):g=e[19];let i;return e[20]!==m||e[21]!==g?(i=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[m,g]}),e[20]=m,e[21]=g,e[22]=i):i=e[22],i}function Je(C){const e=M.c(36),{connectionId:n,orgId:l,orgSlug:x,installation:o,query:a,onSelectRepo:r,isSaving:s}=C,u=ee();let k;e[0]!==n||e[1]!==l||e[2]!==x?(k={connectionId:n,orgId:l,orgSlug:x},e[0]=n,e[1]=l,e[2]=x,e[3]=k):k=e[3];const v=ne(k),P=o.type==="User"?"user":"org",f=a?`${P}:${o.login} ${a} in:name fork:true`:`${P}:${o.login} fork:true`;let d;e[4]!==n||e[5]!==o.login||e[6]!==l||e[7]!==a?(d=se.githubOrgRepos(l,n,o.login,a),e[4]=n,e[5]=o.login,e[6]=l,e[7]=a,e[8]=d):d=e[8];let m;e[9]!==v||e[10]!==f?(m=async g=>{const{signal:i}=g,N=(await v.callTool({name:"search_repositories",arguments:{query:f,page:1,perPage:30}},void 0,{signal:i})).content?.[0]?.text;if(!N)throw new Error("No response from search_repositories");return(JSON.parse(N).items??[]).map(We)},e[9]=v,e[10]=f,e[11]=m):m=e[11];let c;e[12]!==d||e[13]!==m?(c={queryKey:d,queryFn:m},e[12]=d,e[13]=m,e[14]=c):c=e[14];const{data:b}=Ce(c);if(b.length===0){let g;e[15]!==u?(g=u("common.githubRepoPicker.noRepositoriesFound"),e[15]=u,e[16]=g):g=e[16];let i;e[17]!==g?(i=t.jsx("p",{className:"text-sm text-muted-foreground",children:g}),e[17]=g,e[18]=i):i=e[18];let j;e[19]!==a||e[20]!==u?(j=a&&t.jsx("p",{className:"text-xs text-muted-foreground/60",children:u("common.githubRepoPicker.tryDifferentSearchTerm")}),e[19]=a,e[20]=u,e[21]=j):j=e[21];let N;return e[22]!==i||e[23]!==j?(N=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-1",children:[i,j]}),e[22]=i,e[23]=j,e[24]=N):N=e[24],N}let h;if(e[25]!==s||e[26]!==r||e[27]!==b||e[28]!==u){let g;e[30]!==s||e[31]!==r||e[32]!==u?(g=i=>t.jsxs("button",{type:"button",onClick:()=>r(i),disabled:s,className:"flex items-start gap-3 px-4 py-3 hover:bg-accent transition-colors text-left disabled:opacity-50 disabled:cursor-not-allowed",children:[t.jsx(D,{className:"size-4 text-muted-foreground mt-0.5 shrink-0"}),t.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[t.jsx("span",{className:"text-sm font-medium truncate",children:i.name}),i.fork&&t.jsx("span",{className:"text-xs font-medium text-muted-foreground border border-border rounded px-1.5 py-0.5 shrink-0 leading-none",children:u("common.githubRepoPicker.forkBadge")})]}),t.jsxs("span",{className:"flex items-center gap-1 text-xs font-medium text-muted-foreground border border-border rounded px-1.5 py-0.5 shrink-0 leading-none",children:[i.private?t.jsx(Re,{size:10}):t.jsx(Le,{size:10}),i.private?u("common.githubRepoPicker.private"):u("common.githubRepoPicker.public")]})]},i.fullName),e[30]=s,e[31]=r,e[32]=u,e[33]=g):g=e[33],h=b.map(g),e[25]=s,e[26]=r,e[27]=b,e[28]=u,e[29]=h}else h=e[29];let y;return e[34]!==h?(y=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden flex flex-col [scrollbar-gutter:stable]",children:h}),e[34]=h,e[35]=y):y=e[35],y}function We(C){return{name:C.name,fullName:C.full_name,owner:C.full_name.split("/")[0]??"",url:C.html_url,private:C.private,description:C.description,updatedAt:C.updated_at,fork:C.fork??!1}}function ce(C){const e=M.c(51),{status:n,error:l,retry:x}=C,o=ee();if(n==="error"){let N;e[0]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("div",{className:"size-10 rounded-full bg-destructive/10 flex items-center justify-center",children:t.jsx(D,{className:"size-5 text-destructive"})}),e[0]=N):N=e[0];let I;e[1]!==o?(I=o("common.githubRepoPicker.connectionFailed"),e[1]=o,e[2]=I):I=e[2];let T;e[3]!==I?(T=t.jsx("p",{className:"text-sm font-medium",children:I}),e[3]=I,e[4]=T):T=e[4];let R;e[5]!==l||e[6]!==o?(R=l??o("common.githubRepoPicker.somethingWentWrong"),e[5]=l,e[6]=o,e[7]=R):R=e[7];let w;e[8]!==R?(w=t.jsx("p",{className:"text-xs text-muted-foreground max-w-[260px] leading-relaxed",children:R}),e[8]=R,e[9]=w):w=e[9];let _;e[10]!==T||e[11]!==w?(_=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[T,w]}),e[10]=T,e[11]=w,e[12]=_):_=e[12];let F;e[13]!==o?(F=o("common.githubRepoPicker.tryAgain"),e[13]=o,e[14]=F):F=e[14];let p;e[15]!==x||e[16]!==F?(p=t.jsx("button",{type:"button",onClick:x,className:"text-xs font-medium text-foreground border border-border rounded-md px-3 py-1.5 hover:bg-accent transition-colors",children:F}),e[15]=x,e[16]=F,e[17]=p):p=e[17];let S;return e[18]!==_||e[19]!==p?(S=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[N,_,p]}),e[18]=_,e[19]=p,e[20]=S):S=e[20],S}const a=n==="authenticating";let r;e[21]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"size-10 rounded-full bg-muted flex items-center justify-center",children:t.jsx(D,{className:"size-5 text-foreground"})}),e[21]=r):r=e[21];let s;e[22]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsxs("div",{className:"relative size-10",children:[r,t.jsx("div",{className:"absolute -bottom-0.5 -right-0.5 size-4 rounded-full bg-background flex items-center justify-center",children:t.jsx(Z,{size:12,className:"animate-spin text-muted-foreground"})})]}),e[22]=s):s=e[22];let u;e[23]!==a||e[24]!==o?(u=o(a?"common.githubRepoPicker.authenticatingGitHub":"common.githubRepoPicker.settingUpGitHub"),e[23]=a,e[24]=o,e[25]=u):u=e[25];let k;e[26]!==u?(k=t.jsx("p",{className:"text-sm font-medium",children:u}),e[26]=u,e[27]=k):k=e[27];let v;e[28]!==a||e[29]!==o?(v=o(a?"common.githubRepoPicker.completeOAuthFlow":"common.githubRepoPicker.installingGitHubConnection"),e[28]=a,e[29]=o,e[30]=v):v=e[30];let P;e[31]!==v?(P=t.jsx("p",{className:"text-xs text-muted-foreground",children:v}),e[31]=v,e[32]=P):P=e[32];let f;e[33]!==k||e[34]!==P?(f=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[k,P]}),e[33]=k,e[34]=P,e[35]=f):f=e[35];const d=a?"bg-muted-foreground/30":"bg-foreground animate-pulse";let m;e[36]!==d?(m=ae("size-1.5 rounded-full",d),e[36]=d,e[37]=m):m=e[37];let c;e[38]!==m?(c=t.jsx("span",{className:m}),e[38]=m,e[39]=c):c=e[39];const b=a?"bg-foreground animate-pulse":"bg-muted-foreground/30";let h;e[40]!==b?(h=ae("size-1.5 rounded-full",b),e[40]=b,e[41]=h):h=e[41];let y;e[42]!==h?(y=t.jsx("span",{className:h}),e[42]=h,e[43]=y):y=e[43];let g;e[44]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("span",{className:"size-1.5 rounded-full bg-muted-foreground/30"}),e[44]=g):g=e[44];let i;e[45]!==c||e[46]!==y?(i=t.jsxs("div",{className:"flex items-center gap-1.5",children:[c,y,g]}),e[45]=c,e[46]=y,e[47]=i):i=e[47];let j;return e[48]!==i||e[49]!==f?(j=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[s,f,i]}),e[48]=i,e[49]=f,e[50]=j):j=e[50],j}export{D as G,mt as a,Be as b,$e as u};
|
|
1
|
+
import{c as M,j as t,H as de,a as ye,p as me,r as H,aP as le,b as ee,k as Z,e as ge,t as te,eO as Ne,K as se,I as ke,o as ve,n as ae,B as re,z as Ce,C as Re}from"./index-C-W5dASy.js";import{a as we,b as Pe,d as Se,e as Ie}from"./dialog-CuqXnWbf.js";import{C as Te}from"./collection-search-CNrn5ZLG.js";import{u as _e}from"./use-debounced-value-Dq1JGl41.js";import{b as he,u as Ee}from"./use-connection-DzUFG_BF.js";import{u as ne}from"./use-mcp-client-PMt78ucZ.js";import{W as Ae,S as pe}from"./constants-BSYv1IkQ.js";import{a as be}from"./authenticate-and-persist-oauth-D5NQEgY8.js";import{i as ue}from"./ArrowLeft-BpINHsGO.js";import{n as ze}from"./LinkExternal01-DWP8dcJA.js";import{n as Le}from"./LockUnlocked01-BsAWOf6A.js";import{u as Ge}from"./use-mcp-tools-BgEqxU0u.js";import{e as Oe}from"./extract-connection-data-CFDQblVE.js";import{c as Fe}from"./use-navigate-to-agent-DpqkGd8j.js";import{g as Ue,p as fe,f as He,G as xe}from"./provision-repo-scoped-github-connection-CMPWtdMv.js";function D(C){const e=M.c(4),{size:n,className:l}=C;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0016 8c0-4.42-3.58-8-8-8z"}),e[0]=x):x=e[0];let o;return e[1]!==l||e[2]!==n?(o=t.jsx("svg",{width:n,height:n,viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",className:l,children:x}),e[1]=l,e[2]=n,e[3]=o):o=e[3],o}function $e(C,e){const n=M.c(12),{org:l}=de();let x;n[0]!==l.id?(x=Ae.REGISTRY(l.id),n[0]=l.id,n[1]=x):x=n[1];const o=x;let a;n[2]!==l.id||n[3]!==l.slug||n[4]!==o?(a={connectionId:o,orgId:l.id,orgSlug:l.slug},n[2]=l.id,n[3]=l.slug,n[4]=o,n[5]=a):a=n[5];const r=ne(a);let s;n[6]!==C?(s={name:C},n[6]=C,n[7]=s):s=n[7];const u=e?.enabled??!0;let k;return n[8]!==r||n[9]!==s||n[10]!==u?(k={client:r,toolName:"COLLECTION_REGISTRY_APP_GET",toolArguments:s,enabled:u,staleTime:3e5,select:De},n[8]=r,n[9]=s,n[10]=u,n[11]=k):k=n[11],Ge(k)}function De(C){return C.structuredContent?.item??null}const Me="deco/mcp-github";function Be(C){const{org:e}=de(),{data:n}=ye.useSession(),l=he(),x=me(),[o,a]=H.useState("idle"),[r,s]=H.useState(null),[u,k]=H.useState(null),{data:v,isLoading:P}=$e(Me,{enabled:C.enabled}),f=H.useRef(!1);C.enabled&&v&&!P&&!f.current&&n?.user?.id&&o==="idle"&&(f.current=!0,d());async function d(){if(!(!v||!n?.user?.id||!e))try{a("installing"),s(null);const c=Oe(v,e.id,n.user.id,{remoteIndex:0});if(!c.connection_url)throw new Error("Registry item is missing a remote URL for mcp-github");const{id:h}=await l.create.mutateAsync(c);a("authenticating");const y=await be({connectionId:h,orgId:e.id,orgSlug:e.slug,persistFallback:g=>l.update.mutateAsync({id:h,data:{connection_token:g}}).then(()=>{})});if(y.ran&&!y.ok){try{await l.delete.mutateAsync(h)}catch{}throw new Error(y.error&&y.error!=="no token received"?y.error:"No token received from GitHub")}le(x,e.id),k(c),a("ready")}catch(c){s(c instanceof Error?c.message:String(c)),a("error")}}function m(){a("idle"),s(null),k(null),f.current=!1}return C.enabled&&P&&o==="idle"?{status:"installing",error:null,connection:null,retry:m}:{status:o,error:r,connection:u,retry:m}}function mt(C){const e=M.c(27),{open:n,onOpenChange:l,title:x,onImportComplete:o,mode:a}=C,r=a===void 0?"agent":a,s=ee();let u;e[0]!==r||e[1]!==s||e[2]!==x?(u=x??s(r==="connection"?"common.githubRepoPicker.addRepo":"common.githubRepoPicker.importFromGitHub"),e[0]=r,e[1]=s,e[2]=x,e[3]=u):u=e[3];const k=u,[v,P]=H.useState(null);let f;e[4]!==k?(f=t.jsx(we,{className:"sr-only",children:t.jsx(Pe,{children:k})}),e[4]=k,e[5]=f):f=e[5];let d;e[6]!==k||e[7]!==v||e[8]!==s?(d=t.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3 shrink-0",children:v?t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:()=>P(null),className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors shrink-0","aria-label":s("common.githubRepoPicker.backToAccounts"),children:t.jsx(ue,{size:16})}),t.jsx("img",{src:v.avatarUrl,alt:v.login,className:"size-5 rounded-full ring-1 ring-border shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:v.login})]}):t.jsxs(t.Fragment,{children:[t.jsx(D,{className:"size-4 text-foreground shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:k})]})}),e[6]=k,e[7]=v,e[8]=s,e[9]=d):d=e[9];let m;e[10]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(Z,{size:18,className:"animate-spin text-muted-foreground"})}),e[10]=m):m=e[10];let c;e[11]!==l?(c=()=>l(!1),e[11]=l,e[12]=c):c=e[12];let b;e[13]!==r||e[14]!==o||e[15]!==n||e[16]!==v||e[17]!==c?(b=t.jsx("div",{className:"flex-1 overflow-hidden flex flex-col min-w-0",children:t.jsx(H.Suspense,{fallback:m,children:t.jsx(qe,{open:n,onComplete:c,selectedInstallation:v,onSelectInstallation:P,onImportComplete:o,mode:r})})}),e[13]=r,e[14]=o,e[15]=n,e[16]=v,e[17]=c,e[18]=b):b=e[18];let h;e[19]!==f||e[20]!==d||e[21]!==b?(h=t.jsxs(Se,{className:"sm:max-w-[560px] h-[85svh] sm:h-[520px] p-0 gap-0 overflow-hidden flex flex-col",children:[f,d,b]}),e[19]=f,e[20]=d,e[21]=b,e[22]=h):h=e[22];let y;return e[23]!==l||e[24]!==n||e[25]!==h?(y=t.jsx(Ie,{open:n,onOpenChange:l,children:h}),e[23]=l,e[24]=n,e[25]=h,e[26]=y):y=e[26],y}function qe({open:C,onComplete:e,selectedInstallation:n,onSelectInstallation:l,onImportComplete:x,mode:o="agent"}){const a=ee(),{org:r}=de(),s=me(),u=Fe(),[k,v]=H.useState(null),P=Ee({slug:"mcp-github"}),f=Ue(P),d=Be({enabled:C&&f.length===0}),m=f.length===1?f[0]??null:k,c=ne({connectionId:m?.id??"",orgId:r.id,orgSlug:r.slug}),b=ne({connectionId:pe,orgId:r.id,orgSlug:r.slug}),h=async(i,j)=>{try{const I=await c.callTool({name:"get_file_contents",arguments:{owner:i.owner,repo:i.name,path:j}});if(I.isError)return null;const R=I.content?.find(w=>w.type==="resource")?.resource?.text;if(!R)return null;try{const w=JSON.parse(R);return typeof w=="string"?w:JSON.stringify(w)}catch{return R}}catch{return null}},y=(i,j)=>{Promise.all([h(j,"AGENTS.md"),h(j,"CLAUDE.md")]).then(async([N,I])=>{const T=N??I??null;T&&(await b.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:i,data:{metadata:{instructions:T}}}}),le(s,r.id))}).catch(N=>{console.error("GitHub instructions fetch failed:",N)})},g=ge({mutationFn:async i=>{if(!m||!n)throw new Error("No GitHub connection or installation");const j=n.installationId;if(o==="connection"){const{childConnectionId:R}=await fe({orgSlug:r.slug,sourceConnection:m,installationId:j,owner:i.owner,repo:i.name,githubCallTool:w=>c.callTool(w),selfCallTool:w=>b.callTool(w),orgShared:!0});return{virtualMcpId:null,repo:i,connectionId:R,item:null}}const{childConnectionId:N,reused:I}=await fe({orgSlug:r.slug,sourceConnection:m,installationId:j,owner:i.owner,repo:i.name,githubCallTool:R=>c.callTool(R),selfCallTool:R=>b.callTool(R)});let T=null;try{const R=await b.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:i.name,description:i.description||"Imported from GitHub",pinned:!1,icon:null,metadata:{githubRepo:{owner:i.owner,name:i.name,url:i.url,installationId:j,connectionId:N},instructions:null,ui:{pinnedViews:null,layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}},connections:[{connection_id:N}]}}}),w=R.structuredContent??R,_=w.item?.id;if(!w.item||!_)throw new Error("Failed to create the imported agent");return T=_,{virtualMcpId:_,repo:i,connectionId:N,item:w.item}}catch(R){throw T&&await b.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:T}}).catch(()=>{}),I||await b.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:N,force:!0}}).catch(()=>{}),R}},onSuccess:({virtualMcpId:i,repo:j,connectionId:N,item:I})=>{if(o==="connection"||!i||!I){if(le(s,r.id),Ne(s,r.id),x){x({virtualMcpId:null,repo:j,connectionId:N});return}te.success(a("common.githubRepoPicker.addedRepo",{name:j.name})),e();return}if(s.setQueryData(se.collectionItem(b,r.id,"","VIRTUAL_MCP",i),{item:I}),le(s,r.id),y(i,j),x){x({virtualMcpId:i,repo:j,connectionId:N});return}te.success(a("common.githubRepoPicker.importedRepo",{name:j.name})),e(),localStorage.setItem(ke.sidebarOpen(),JSON.stringify(!1)),u(i)},onError:(i,j)=>{console.error("GitHub import failed:",i);const N=i instanceof Error?i.message:a("common.githubRepoPicker.unknownError");if(j.fork&&N.toLowerCase().includes("mint")){te.error(a("common.githubRepoPicker.failedImportFork",{name:j.name}));return}te.error(a("common.githubRepoPicker.failedImport",{error:N}))}});return d.status==="installing"||d.status==="authenticating"?t.jsx(ce,{status:d.status,error:null,retry:d.retry}):d.status==="error"?t.jsx(ce,{status:"error",error:d.error,retry:d.retry}):f.length===0&&d.status==="idle"?t.jsx(ce,{status:"installing",error:null,retry:d.retry}):f.length>1&&!m?t.jsxs("div",{className:"flex flex-col py-2",children:[t.jsx("div",{className:"px-4 py-2",children:t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:a("common.githubRepoPicker.selectConnection")})}),f.map(i=>t.jsxs("button",{type:"button",onClick:()=>v(i),className:"flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left",children:[i.icon?t.jsx("img",{src:i.icon,alt:i.title,className:"size-7 rounded-full shrink-0"}):t.jsx("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:t.jsx(D,{className:"size-3.5 text-muted-foreground"})}),t.jsx("span",{className:"text-sm font-medium",children:i.title})]},i.id))]}):m?n?t.jsx(Ke,{connectionId:m.id,orgId:r.id,orgSlug:r.slug,installation:n,onSelectRepo:i=>g.mutate(i),isSaving:g.isPending}):t.jsx(Qe,{connectionId:m.id,orgId:r.id,orgSlug:r.slug,onSelect:l,showBackButton:f.length>1,onBack:()=>v(null)}):null}function Qe(C){const e=M.c(124),{connectionId:n,orgId:l,orgSlug:x,onSelect:o,showBackButton:a,onBack:r}=C,s=ee();let u;e[0]!==l||e[1]!==x?(u={connectionId:pe,orgId:l,orgSlug:x},e[0]=l,e[1]=x,e[2]=u):u=e[2];const k=ne(u),v=me(),P=he();let f;e[3]!==n||e[4]!==l?(f=se.githubUserOrgs(l,n),e[3]=n,e[4]=l,e[5]=f):f=e[5];let d;e[6]!==n||e[7]!==k?(d=()=>He(p=>k.callTool(p),n),e[6]=n,e[7]=k,e[8]=d):d=e[8];let m;e[9]!==f||e[10]!==d?(m={queryKey:f,queryFn:d},e[9]=f,e[10]=d,e[11]=m):m=e[11];const c=ve(m);let b;e[12]!==P||e[13]!==n||e[14]!==c||e[15]!==l||e[16]!==x||e[17]!==v?(b=async()=>{const p=await be({connectionId:n,orgId:l,orgSlug:x,persistFallback:E=>P.update.mutateAsync({id:n,data:{connection_token:E}}).then(Ve)});if(p.ran&&!p.ok)throw new Error(p.error??"no token received");const S=new URL(`/api/${x}/mcp/${n}`,window.location.origin);await v.invalidateQueries({queryKey:se.isMCPAuthenticated(S.href,null)}),await v.invalidateQueries({queryKey:se.mcpClientPrefix()}),await c.refetch()},e[12]=P,e[13]=n,e[14]=c,e[15]=l,e[16]=x,e[17]=v,e[18]=b):b=e[18];let h;e[19]!==s?(h=p=>{te.error(s("common.githubRepoPicker.failedReconnect",{error:p instanceof Error?p.message:s("common.githubRepoPicker.unknownError")}))},e[19]=s,e[20]=h):h=e[20];let y;e[21]!==b||e[22]!==h?(y={mutationFn:b,onError:h},e[21]=b,e[22]=h,e[23]=y):y=e[23];const g=ge(y);if(c.isLoading){let p;return e[24]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(Z,{size:18,className:"animate-spin text-muted-foreground"})}),e[24]=p):p=e[24],p}if(c.isError){let p;e[25]!==s?(p=s("common.githubRepoPicker.failedLoadAccounts"),e[25]=s,e[26]=p):p=e[26];let S;e[27]!==p?(S=t.jsx("p",{className:"text-sm text-destructive",children:p}),e[27]=p,e[28]=S):S=e[28];let E;e[29]!==s?(E=s("common.githubRepoPicker.connectionExpiredMessage"),e[29]=s,e[30]=E):E=e[30];let A;e[31]!==E?(A=t.jsx("p",{className:"text-xs text-muted-foreground max-w-[280px] leading-relaxed",children:E}),e[31]=E,e[32]=A):A=e[32];let z;e[33]!==g?(z=()=>g.mutate(),e[33]=g,e[34]=z):z=e[34];const $=g.isPending;let L;e[35]!==g.isPending?(L=g.isPending?t.jsx(Z,{size:14,className:"animate-spin"}):t.jsx(D,{className:"size-3.5"}),e[35]=g.isPending,e[36]=L):L=e[36];let G;e[37]!==s?(G=s("common.githubRepoPicker.reconnectGitHub"),e[37]=s,e[38]=G):G=e[38];let O;e[39]!==g.isPending||e[40]!==z||e[41]!==L||e[42]!==G?(O=t.jsxs(re,{type:"button",variant:"outline",size:"sm",onClick:z,disabled:$,children:[L,G]}),e[39]=g.isPending,e[40]=z,e[41]=L,e[42]=G,e[43]=O):O=e[43];let U;return e[44]!==A||e[45]!==O||e[46]!==S?(U=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-6 text-center",children:[S,A,O]}),e[44]=A,e[45]=O,e[46]=S,e[47]=U):U=e[47],U}const i=c.data;if(!i)return null;if(i.installations.length===0){let p;e[48]!==r||e[49]!==a||e[50]!==s?(p=a&&t.jsx("div",{className:"flex items-center gap-1 px-4 pt-3 pb-1 shrink-0",children:t.jsxs("button",{type:"button",onClick:r,className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[t.jsx(ue,{size:12}),s("common.githubRepoPicker.changeConnection")]})}),e[48]=r,e[49]=a,e[50]=s,e[51]=p):p=e[51];let S;e[52]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("div",{className:"size-16 rounded-2xl bg-muted flex items-center justify-center",children:t.jsx(D,{className:"size-8 text-foreground"})}),e[52]=S):S=e[52];let E;e[53]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx("span",{className:"size-1.5 rounded-full bg-success"}),e[53]=E):E=e[53];let A;e[54]!==s?(A=s("common.githubRepoPicker.githubConnected"),e[54]=s,e[55]=A):A=e[55];let z;e[56]!==A?(z=t.jsxs("div",{className:"mt-4 flex items-center gap-1.5 text-xs font-medium text-success",children:[E,A]}),e[56]=A,e[57]=z):z=e[57];let $;e[58]!==s?($=s("common.githubRepoPicker.setupRepositoriesTitle"),e[58]=s,e[59]=$):$=e[59];let L;e[60]!==$?(L=t.jsx("h2",{className:"mt-2 text-base font-semibold text-foreground",children:$}),e[60]=$,e[61]=L):L=e[61];let G;e[62]!==s?(G=s("common.githubRepoPicker.noRepositoriesShared"),e[62]=s,e[63]=G):G=e[63];let O;e[64]!==G?(O=t.jsx("p",{className:"mt-1.5 max-w-[360px] text-xs leading-relaxed text-muted-foreground",children:G}),e[64]=G,e[65]=O):O=e[65];let U;e[66]!==s?(U=s("common.githubRepoPicker.chooseRepositories"),e[66]=s,e[67]=U):U=e[67];let ie;e[68]===Symbol.for("react.memo_cache_sentinel")?(ie=t.jsx(ze,{size:14}),e[68]=ie):ie=e[68];let B;e[69]!==U?(B=t.jsx(re,{asChild:!0,size:"sm",children:t.jsxs("a",{href:xe,target:"_blank",rel:"noopener noreferrer",children:[U,ie]})}),e[69]=U,e[70]=B):B=e[70];let q;e[71]!==c?(q=()=>{c.refetch()},e[71]=c,e[72]=q):q=e[72];const je=c.isFetching;let Q;e[73]!==c.isFetching?(Q=c.isFetching&&t.jsx(Z,{size:14,className:"animate-spin"}),e[73]=c.isFetching,e[74]=Q):Q=e[74];let V;e[75]!==s?(V=s("common.githubRepoPicker.checkAgain"),e[75]=s,e[76]=V):V=e[76];let K;e[77]!==c.isFetching||e[78]!==q||e[79]!==Q||e[80]!==V?(K=t.jsxs(re,{type:"button",variant:"outline",size:"sm",onClick:q,disabled:je,children:[Q,V]}),e[77]=c.isFetching,e[78]=q,e[79]=Q,e[80]=V,e[81]=K):K=e[81];let J;e[82]!==B||e[83]!==K?(J=t.jsxs("div",{className:"mt-5 flex items-center gap-2",children:[B,K]}),e[82]=B,e[83]=K,e[84]=J):J=e[84];let W;e[85]!==s?(W=s("common.githubRepoPicker.repositoryAccessNote"),e[85]=s,e[86]=W):W=e[86];let Y;e[87]!==W?(Y=t.jsx("p",{className:"mt-4 max-w-[360px] rounded-lg bg-muted/50 px-3 py-2 text-xs leading-relaxed text-muted-foreground",children:W}),e[87]=W,e[88]=Y):Y=e[88];let X;e[89]!==z||e[90]!==L||e[91]!==O||e[92]!==J||e[93]!==Y?(X=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center px-8 py-6 text-center",children:[S,z,L,O,J,Y]}),e[89]=z,e[90]=L,e[91]=O,e[92]=J,e[93]=Y,e[94]=X):X=e[94];let oe;return e[95]!==X||e[96]!==p?(oe=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[p,X]}),e[95]=X,e[96]=p,e[97]=oe):oe=e[97],oe}let j;e[98]!==r||e[99]!==a||e[100]!==s?(j=a&&t.jsx("div",{className:"flex items-center gap-1 px-4 pt-3 pb-1 shrink-0",children:t.jsxs("button",{type:"button",onClick:r,className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[t.jsx(ue,{size:12}),s("common.githubRepoPicker.changeConnection")]})}),e[98]=r,e[99]=a,e[100]=s,e[101]=j):j=e[101];let N;if(e[102]!==i.installations||e[103]!==o||e[104]!==s){let p;e[106]!==o||e[107]!==s?(p=S=>t.jsxs("button",{type:"button",onClick:()=>o(S),className:"w-full flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left group",children:[t.jsx("img",{src:S.avatarUrl,alt:S.login,className:"size-7 rounded-full shrink-0 ring-1 ring-border"}),t.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[t.jsx("span",{className:"text-sm font-medium leading-none",children:S.login}),S.type==="User"&&t.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:s("common.githubRepoPicker.personalAccount")})]}),t.jsxs("span",{className:"text-xs text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity shrink-0",children:[s("common.githubRepoPicker.select")," →"]})]},S.installationId),e[106]=o,e[107]=s,e[108]=p):p=e[108],N=i.installations.map(p),e[102]=i.installations,e[103]=o,e[104]=s,e[105]=N}else N=e[105];let I;e[109]!==N?(I=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden [scrollbar-gutter:stable]",children:N}),e[109]=N,e[110]=I):I=e[110];let T;e[111]!==s?(T=s("common.githubRepoPicker.accountNotListed"),e[111]=s,e[112]=T):T=e[112];let R;e[113]!==s?(R=s("common.githubRepoPicker.installGitHubApp"),e[113]=s,e[114]=R):R=e[114];let w;e[115]!==R?(w=t.jsx("span",{className:"underline underline-offset-2",children:R}),e[115]=R,e[116]=w):w=e[116];let _;e[117]!==T||e[118]!==w?(_=t.jsx("div",{className:"px-4 py-3 border-t border-border shrink-0",children:t.jsxs("a",{href:xe,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:[T," ",w]})}),e[117]=T,e[118]=w,e[119]=_):_=e[119];let F;return e[120]!==I||e[121]!==_||e[122]!==j?(F=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[j,I,_]}),e[120]=I,e[121]=_,e[122]=j,e[123]=F):F=e[123],F}function Ve(){}function Ke(C){const e=M.c(23),{connectionId:n,orgId:l,orgSlug:x,installation:o,onSelectRepo:a,isSaving:r}=C,s=ee(),[u,k]=H.useState(""),v=_e(u,300),P=H.useDeferredValue(v),f=u!==P;let d;e[0]!==s?(d=s("common.githubRepoPicker.searchRepositories"),e[0]=s,e[1]=d):d=e[1];let m;e[2]!==f||e[3]!==u||e[4]!==d?(m=t.jsx(Te,{placeholder:d,value:u,onChange:k,isSearching:f}),e[2]=f,e[3]=u,e[4]=d,e[5]=m):m=e[5];const c=f?"opacity-40":"opacity-100";let b;e[6]!==c?(b=ae("flex-1 overflow-hidden flex flex-col transition-opacity duration-150",c),e[6]=c,e[7]=b):b=e[7];let h;e[8]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(Z,{size:18,className:"animate-spin text-muted-foreground"})}),e[8]=h):h=e[8];let y;e[9]!==n||e[10]!==P||e[11]!==o||e[12]!==r||e[13]!==a||e[14]!==l||e[15]!==x?(y=t.jsx(H.Suspense,{fallback:h,children:t.jsx(Je,{connectionId:n,orgId:l,orgSlug:x,installation:o,query:P,onSelectRepo:a,isSaving:r})}),e[9]=n,e[10]=P,e[11]=o,e[12]=r,e[13]=a,e[14]=l,e[15]=x,e[16]=y):y=e[16];let g;e[17]!==b||e[18]!==y?(g=t.jsx("div",{className:b,children:y}),e[17]=b,e[18]=y,e[19]=g):g=e[19];let i;return e[20]!==m||e[21]!==g?(i=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[m,g]}),e[20]=m,e[21]=g,e[22]=i):i=e[22],i}function Je(C){const e=M.c(36),{connectionId:n,orgId:l,orgSlug:x,installation:o,query:a,onSelectRepo:r,isSaving:s}=C,u=ee();let k;e[0]!==n||e[1]!==l||e[2]!==x?(k={connectionId:n,orgId:l,orgSlug:x},e[0]=n,e[1]=l,e[2]=x,e[3]=k):k=e[3];const v=ne(k),P=o.type==="User"?"user":"org",f=a?`${P}:${o.login} ${a} in:name fork:true`:`${P}:${o.login} fork:true`;let d;e[4]!==n||e[5]!==o.login||e[6]!==l||e[7]!==a?(d=se.githubOrgRepos(l,n,o.login,a),e[4]=n,e[5]=o.login,e[6]=l,e[7]=a,e[8]=d):d=e[8];let m;e[9]!==v||e[10]!==f?(m=async g=>{const{signal:i}=g,N=(await v.callTool({name:"search_repositories",arguments:{query:f,page:1,perPage:30}},void 0,{signal:i})).content?.[0]?.text;if(!N)throw new Error("No response from search_repositories");return(JSON.parse(N).items??[]).map(We)},e[9]=v,e[10]=f,e[11]=m):m=e[11];let c;e[12]!==d||e[13]!==m?(c={queryKey:d,queryFn:m},e[12]=d,e[13]=m,e[14]=c):c=e[14];const{data:b}=Ce(c);if(b.length===0){let g;e[15]!==u?(g=u("common.githubRepoPicker.noRepositoriesFound"),e[15]=u,e[16]=g):g=e[16];let i;e[17]!==g?(i=t.jsx("p",{className:"text-sm text-muted-foreground",children:g}),e[17]=g,e[18]=i):i=e[18];let j;e[19]!==a||e[20]!==u?(j=a&&t.jsx("p",{className:"text-xs text-muted-foreground/60",children:u("common.githubRepoPicker.tryDifferentSearchTerm")}),e[19]=a,e[20]=u,e[21]=j):j=e[21];let N;return e[22]!==i||e[23]!==j?(N=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-1",children:[i,j]}),e[22]=i,e[23]=j,e[24]=N):N=e[24],N}let h;if(e[25]!==s||e[26]!==r||e[27]!==b||e[28]!==u){let g;e[30]!==s||e[31]!==r||e[32]!==u?(g=i=>t.jsxs("button",{type:"button",onClick:()=>r(i),disabled:s,className:"flex items-start gap-3 px-4 py-3 hover:bg-accent transition-colors text-left disabled:opacity-50 disabled:cursor-not-allowed",children:[t.jsx(D,{className:"size-4 text-muted-foreground mt-0.5 shrink-0"}),t.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[t.jsx("span",{className:"text-sm font-medium truncate",children:i.name}),i.fork&&t.jsx("span",{className:"text-xs font-medium text-muted-foreground border border-border rounded px-1.5 py-0.5 shrink-0 leading-none",children:u("common.githubRepoPicker.forkBadge")})]}),t.jsxs("span",{className:"flex items-center gap-1 text-xs font-medium text-muted-foreground border border-border rounded px-1.5 py-0.5 shrink-0 leading-none",children:[i.private?t.jsx(Re,{size:10}):t.jsx(Le,{size:10}),i.private?u("common.githubRepoPicker.private"):u("common.githubRepoPicker.public")]})]},i.fullName),e[30]=s,e[31]=r,e[32]=u,e[33]=g):g=e[33],h=b.map(g),e[25]=s,e[26]=r,e[27]=b,e[28]=u,e[29]=h}else h=e[29];let y;return e[34]!==h?(y=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden flex flex-col [scrollbar-gutter:stable]",children:h}),e[34]=h,e[35]=y):y=e[35],y}function We(C){return{name:C.name,fullName:C.full_name,owner:C.full_name.split("/")[0]??"",url:C.html_url,private:C.private,description:C.description,updatedAt:C.updated_at,fork:C.fork??!1}}function ce(C){const e=M.c(51),{status:n,error:l,retry:x}=C,o=ee();if(n==="error"){let N;e[0]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("div",{className:"size-10 rounded-full bg-destructive/10 flex items-center justify-center",children:t.jsx(D,{className:"size-5 text-destructive"})}),e[0]=N):N=e[0];let I;e[1]!==o?(I=o("common.githubRepoPicker.connectionFailed"),e[1]=o,e[2]=I):I=e[2];let T;e[3]!==I?(T=t.jsx("p",{className:"text-sm font-medium",children:I}),e[3]=I,e[4]=T):T=e[4];let R;e[5]!==l||e[6]!==o?(R=l??o("common.githubRepoPicker.somethingWentWrong"),e[5]=l,e[6]=o,e[7]=R):R=e[7];let w;e[8]!==R?(w=t.jsx("p",{className:"text-xs text-muted-foreground max-w-[260px] leading-relaxed",children:R}),e[8]=R,e[9]=w):w=e[9];let _;e[10]!==T||e[11]!==w?(_=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[T,w]}),e[10]=T,e[11]=w,e[12]=_):_=e[12];let F;e[13]!==o?(F=o("common.githubRepoPicker.tryAgain"),e[13]=o,e[14]=F):F=e[14];let p;e[15]!==x||e[16]!==F?(p=t.jsx("button",{type:"button",onClick:x,className:"text-xs font-medium text-foreground border border-border rounded-md px-3 py-1.5 hover:bg-accent transition-colors",children:F}),e[15]=x,e[16]=F,e[17]=p):p=e[17];let S;return e[18]!==_||e[19]!==p?(S=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[N,_,p]}),e[18]=_,e[19]=p,e[20]=S):S=e[20],S}const a=n==="authenticating";let r;e[21]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"size-10 rounded-full bg-muted flex items-center justify-center",children:t.jsx(D,{className:"size-5 text-foreground"})}),e[21]=r):r=e[21];let s;e[22]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsxs("div",{className:"relative size-10",children:[r,t.jsx("div",{className:"absolute -bottom-0.5 -right-0.5 size-4 rounded-full bg-background flex items-center justify-center",children:t.jsx(Z,{size:12,className:"animate-spin text-muted-foreground"})})]}),e[22]=s):s=e[22];let u;e[23]!==a||e[24]!==o?(u=o(a?"common.githubRepoPicker.authenticatingGitHub":"common.githubRepoPicker.settingUpGitHub"),e[23]=a,e[24]=o,e[25]=u):u=e[25];let k;e[26]!==u?(k=t.jsx("p",{className:"text-sm font-medium",children:u}),e[26]=u,e[27]=k):k=e[27];let v;e[28]!==a||e[29]!==o?(v=o(a?"common.githubRepoPicker.completeOAuthFlow":"common.githubRepoPicker.installingGitHubConnection"),e[28]=a,e[29]=o,e[30]=v):v=e[30];let P;e[31]!==v?(P=t.jsx("p",{className:"text-xs text-muted-foreground",children:v}),e[31]=v,e[32]=P):P=e[32];let f;e[33]!==k||e[34]!==P?(f=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[k,P]}),e[33]=k,e[34]=P,e[35]=f):f=e[35];const d=a?"bg-muted-foreground/30":"bg-foreground animate-pulse";let m;e[36]!==d?(m=ae("size-1.5 rounded-full",d),e[36]=d,e[37]=m):m=e[37];let c;e[38]!==m?(c=t.jsx("span",{className:m}),e[38]=m,e[39]=c):c=e[39];const b=a?"bg-foreground animate-pulse":"bg-muted-foreground/30";let h;e[40]!==b?(h=ae("size-1.5 rounded-full",b),e[40]=b,e[41]=h):h=e[41];let y;e[42]!==h?(y=t.jsx("span",{className:h}),e[42]=h,e[43]=y):y=e[43];let g;e[44]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("span",{className:"size-1.5 rounded-full bg-muted-foreground/30"}),e[44]=g):g=e[44];let i;e[45]!==c||e[46]!==y?(i=t.jsxs("div",{className:"flex items-center gap-1.5",children:[c,y,g]}),e[45]=c,e[46]=y,e[47]=i):i=e[47];let j;return e[48]!==i||e[49]!==f?(j=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[s,f,i]}),e[48]=i,e[49]=f,e[50]=j):j=e[50],j}export{D as G,mt as a,Be as b,$e as u};
|