decocms 4.339.1 → 4.340.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-COFB2d-k.js → AlertCircle-Ci-hYOqv.js} +1 -1
- package/dist/client/assets/{AreaChart-xaiGT9tS.js → AreaChart-DoYXYmyG.js} +1 -1
- package/dist/client/assets/{ArrowLeft-B_Sm8nZF.js → ArrowLeft-bSm3BNTP.js} +1 -1
- package/dist/client/assets/{ArrowUp-DtnUC7b1.js → ArrowUp-D8qcxyxl.js} +1 -1
- package/dist/client/assets/{Check-RwOXYzpY.js → Check-Bm4pKAip.js} +1 -1
- package/dist/client/assets/{CheckCircle-BakDkudF.js → CheckCircle-CxY3rlAm.js} +1 -1
- package/dist/client/assets/{ChevronRight-BId4MMJ9.js → ChevronRight-CVA9425t.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-BPZJCzil.js → ChevronSelectorVertical-WRqK1Mrc.js} +1 -1
- package/dist/client/assets/{ChevronUp-CKGVkzNf.js → ChevronUp-DxATplb1.js} +1 -1
- package/dist/client/assets/{Copy01-D8F1H1Rm.js → Copy01-DB0ALgAH.js} +1 -1
- package/dist/client/assets/{CreditCard01-hwp2k2z5.js → CreditCard01-smVPvYXE.js} +1 -1
- package/dist/client/assets/{DotsVertical-CiZ90LaC.js → DotsVertical-K0YXD5Xp.js} +1 -1
- package/dist/client/assets/{Download01-BFWoFyp5.js → Download01-DTG8FxjC.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-DgbmJPin.js → ErrorBarContext-urbA9eXk.js} +1 -1
- package/dist/client/assets/{Eye-BkYoLh_d.js → Eye-C7eDeC1B.js} +1 -1
- package/dist/client/assets/{GitBranch01-wBN2Zyoy.js → GitBranch01-CTfNzZhb.js} +1 -1
- package/dist/client/assets/{Globe01-D_ldoikY.js → Globe01-BIqUh-Wm.js} +1 -1
- package/dist/client/assets/{HardDrive-ChbOVw3L.js → HardDrive-C-v0dJH8.js} +1 -1
- package/dist/client/assets/{Image01-CVmN_WRr.js → Image01-BAO1u5yb.js} +1 -1
- package/dist/client/assets/{Key01-n-kxmORy.js → Key01-Bco3JWi5.js} +1 -1
- package/dist/client/assets/{Link01-ngcEVr-U.js → Link01-yHELimBx.js} +1 -1
- package/dist/client/assets/{LinkExternal01-CYGJDolS.js → LinkExternal01-Ajyc9uFz.js} +1 -1
- package/dist/client/assets/{Monitor01-B3YP0Q4Y.js → Monitor01-CZwiGM11.js} +1 -1
- package/dist/client/assets/{Package-D3FCZEz9.js → Package-CII6DRam.js} +1 -1
- package/dist/client/assets/{Palette-B8VxVOuh.js → Palette-DAybMQCg.js} +1 -1
- package/dist/client/assets/{Play-BJDJ0Cd_.js → Play-BCDmVmXb.js} +1 -1
- package/dist/client/assets/{Plus-f1J7CslD.js → Plus-B3THEWxi.js} +1 -1
- package/dist/client/assets/{SearchLg-ijCBByfF.js → SearchLg-BW5z-Jmq.js} +1 -1
- package/dist/client/assets/{SearchMd-BxQNX78D.js → SearchMd-trH7xP9Q.js} +1 -1
- package/dist/client/assets/{Sector-DjNoLuA2.js → Sector-CzZW5olm.js} +1 -1
- package/dist/client/assets/{Settings02-DI7LVcro.js → Settings02-IWtrYGOv.js} +1 -1
- package/dist/client/assets/{Share07-BlQxtP9X.js → Share07-C_FfyIR6.js} +1 -1
- package/dist/client/assets/{Shield01-arn3OL5A.js → Shield01-DbH51sQf.js} +1 -1
- package/dist/client/assets/{Stars01-C7zRxa-s.js → Stars01-DDKtXwrQ.js} +1 -1
- package/dist/client/assets/{Sun-CudPxUwF.js → Sun-Fs22jsuj.js} +1 -1
- package/dist/client/assets/{Tool01-CsI9zgpV.js → Tool01-BJmzZfRm.js} +1 -1
- package/dist/client/assets/{Tool02-BFWUmpcW.js → Tool02-D5gCi3V2.js} +1 -1
- package/dist/client/assets/{Trash01-JArTmXvL.js → Trash01-VtG9RQfC.js} +1 -1
- package/dist/client/assets/{TrendUp01-BXyuZrfj.js → TrendUp01-BSaUEAJa.js} +1 -1
- package/dist/client/assets/{Upload01-TH_UzEO5.js → Upload01-DLgmYiLN.js} +1 -1
- package/dist/client/assets/{User01-BQutGTr9.js → User01-BBrQuNix.js} +1 -1
- package/dist/client/assets/{UserSquare-EeCR50Jd.js → UserSquare-D_Mg9gDt.js} +1 -1
- package/dist/client/assets/{Users01-BlGMCWje.js → Users01-C6TOtt1M.js} +1 -1
- package/dist/client/assets/{Users03-DBIwkies.js → Users03-Di0wmvZD.js} +1 -1
- package/dist/client/assets/{XCircle-B-U8MZ3l.js → XCircle-B8QRFbl_.js} +1 -1
- package/dist/client/assets/{XClose-Dz9b9dRZ.js → XClose-B_DrKSBW.js} +1 -1
- package/dist/client/assets/{Zap-Dpl5zC2B.js → Zap-JQ9vG-vf.js} +1 -1
- package/dist/client/assets/{ZoomOut-d1whDSJ4.js → ZoomOut-BuGsEwz7.js} +1 -1
- package/dist/client/assets/{access-gate-CgpWlbs5.js → access-gate-Fm1tpXMI.js} +1 -1
- package/dist/client/assets/{agent-icon-COOgI3ay.js → agent-icon-SMSi6xWE.js} +1 -1
- package/dist/client/assets/{agents-list-B3Y5y06D.js → agents-list-D9MXEBxO.js} +1 -1
- package/dist/client/assets/{ai-providers-C9ObWIua.js → ai-providers-Bky-E-Ls.js} +1 -1
- package/dist/client/assets/{alert--Dt-uESS.js → alert-D5ow738y.js} +1 -1
- package/dist/client/assets/{alert-dialog-CADzi4i2.js → alert-dialog-DkCt8SMC.js} +1 -1
- package/dist/client/assets/{analytics-tab-BzVQHWsw.js → analytics-tab-BUm5DfGT.js} +1 -1
- package/dist/client/assets/{api-keys-DR6-cuN4.js → api-keys-CzHvEbxu.js} +1 -1
- package/dist/client/assets/api-keys-oVyoFGH7.js +1 -0
- package/dist/client/assets/app-editor-DHg_gRM4.js +1 -0
- package/dist/client/assets/{auth-CDNWJs_H.js → auth-DhrjniPt.js} +1 -1
- package/dist/client/assets/{auth-catchall-DL3O1q4B.js → auth-catchall-DbvmiYjg.js} +1 -1
- package/dist/client/assets/{auth-entry-C1LZapjz.js → auth-entry-C17Fx_ZQ.js} +1 -1
- package/dist/client/assets/{auth-split-layout-Gop3ynxc.js → auth-split-layout-mFzEiGJd.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-Bc7-Czof.js → authenticate-and-persist-oauth-B3ICSnyd.js} +1 -1
- package/dist/client/assets/{automation-list-row-DTvuVLg8.js → automation-list-row-Cu2NfQCN.js} +1 -1
- package/dist/client/assets/{automation-runs-jJdD2kMw.js → automation-runs-BJXyMXLk.js} +1 -1
- package/dist/client/assets/{automations-DtgECkvr.js → automations-DD2cF0W5.js} +1 -1
- package/dist/client/assets/{autosend-DnWitnAW.js → autosend-Czy6C6y2.js} +1 -1
- package/dist/client/assets/{avatar-DelCpRBk.js → avatar-DH4ZIsE3.js} +1 -1
- package/dist/client/assets/{badge-CzoDeQX5.js → badge-VI5MdDWx.js} +1 -1
- package/dist/client/assets/{block-document-CYynEyMa.js → block-document-BOMLwV-x.js} +1 -1
- package/dist/client/assets/{breadcrumb-Ci8qwvwh.js → breadcrumb-_uXEtTpi.js} +1 -1
- package/dist/client/assets/{buckets-7DRsNGEd.js → buckets-BF4qZNVF.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-CBcpSaVj.js → bulk-category-panel-QkjSCrGL.js} +1 -1
- package/dist/client/assets/{capability-load-error-GWNWVbL6.js → capability-load-error-BYrVfy2j.js} +1 -1
- package/dist/client/assets/{cards-Cj23GDZ7.js → cards-DxEfwobu.js} +1 -1
- package/dist/client/assets/{category-editor-242jZ9R1.js → category-editor-DFFdOAsg.js} +1 -1
- package/dist/client/assets/{cdn-tab-CxrKZ9BM.js → cdn-tab-DZRKaaQ_.js} +1 -1
- package/dist/client/assets/{chart-xWqOKrT9.js → chart-3gsLx_Ix.js} +1 -1
- package/dist/client/assets/{chat-context-YazMDsfb.js → chat-context-CK8dv3gu.js} +1 -1
- package/dist/client/assets/{checkbox-5kuFpJGJ.js → checkbox-BqHdXcFf.js} +1 -1
- package/dist/client/assets/{choose-editor-CoN8FJC-.js → choose-editor-B_PfDQPQ.js} +1 -1
- package/dist/client/assets/{cli-auth-success-BR4HnqSw.js → cli-auth-success-CiU2KvLG.js} +1 -1
- package/dist/client/assets/{client-icons-BJAudV-4.js → client-icons-Y5EunWnJ.js} +1 -1
- package/dist/client/assets/{collection-detail-TohUC5eL.js → collection-detail-DoLosNGu.js} +1 -1
- package/dist/client/assets/{collection-display-button-C3Z23sMQ.js → collection-display-button-9Rer_oPI.js} +1 -1
- package/dist/client/assets/{collection-search-x0S64zby.js → collection-search-D4iyLe2V.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-Be1BrSKV.js → collection-table-wrapper-mpt431uh.js} +1 -1
- package/dist/client/assets/{collection-tabs-BI0Rhp1n.js → collection-tabs-DP-ptCDv.js} +1 -1
- package/dist/client/assets/{command-DvAIiR-Z.js → command-Q8LdaCNH.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-rsu4xpmu.js → commerce-onboarding-p7cypOhd.js} +1 -1
- package/dist/client/assets/{connect-CPAQI-Wa.js → connect-DX5yXC5i.js} +1 -1
- package/dist/client/assets/{connect-layout-DnTik73n.js → connect-layout-LgrVcABr.js} +1 -1
- package/dist/client/assets/{connection-DVZ0x-CQ.js → connection-DpQjP7x0.js} +1 -1
- package/dist/client/assets/{connection-card-CSJ2w0Dp.js → connection-card-BLWf3Xy2.js} +1 -1
- package/dist/client/assets/{connection-detail-BQl9INRf.js → connection-detail-CrohyrRP.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-BGULertj.js → connection-form-helpers-DEtFyGOP.js} +1 -1
- package/dist/client/assets/{connections-CJ3AQ7bL.js → connections-C7LL4rXL.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-BrRJMZ9P.js → create-organization-dialog-DGUi6mEC.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-T7r443E8.js → decopilot-sse-pool--W7_l_Pu.js} +1 -1
- package/dist/client/assets/{dialog-ClXo-ILY.js → dialog-CzPQcE4z.js} +1 -1
- package/dist/client/assets/{domain-settings-D4vHkL29.js → domain-settings-DJ3VqnT5.js} +1 -1
- package/dist/client/assets/{drawer-4yZNiDGz.js → drawer-C9BPrZDr.js} +1 -1
- package/dist/client/assets/{dropdown-menu-ChRlmtGH.js → dropdown-menu-S3caw2j5.js} +1 -1
- package/dist/client/assets/{e2e-tab-DE_h1PjG.js → e2e-tab-CbbFdJij.js} +1 -1
- package/dist/client/assets/{editor-C8IlfhPf.js → editor-BnFle53c.js} +1 -1
- package/dist/client/assets/{empty-state-CmJs9n9u.js → empty-state-CZMUdubS.js} +1 -1
- package/dist/client/assets/{empty-state-CMDRQGT-.js → empty-state-DcZpUCNu.js} +1 -1
- package/dist/client/assets/{extract-connection-data-CBaHjHii.js → extract-connection-data-kN2PmA7O.js} +1 -1
- package/dist/client/assets/{file-explorer-bszPPJMi.js → file-explorer-Yy8Zh0pl.js} +1 -1
- package/dist/client/assets/{file-type-icon-CCS82EWp.js → file-type-icon-B0g83ZyY.js} +1 -1
- package/dist/client/assets/{folder-icon-BprwUfXF.js → folder-icon-D3DcymJq.js} +1 -1
- package/dist/client/assets/{form-BbPYrZM0.js → form-DvuQtnED.js} +1 -1
- package/dist/client/assets/{general-Jx6iT4LG.js → general-KHTKCDNW.js} +1 -1
- package/dist/client/assets/{github-icon-BamvWtlu.js → github-icon-DrHBaXxl.js} +1 -1
- package/dist/client/assets/{github-repo-picker-_9hUfw1v.js → github-repo-picker-Dth8apmY.js} +1 -1
- package/dist/client/assets/{gitlab-icon-BvCV8hCq.js → gitlab-icon-CqhnK68r.js} +1 -1
- package/dist/client/assets/{hooks-Dp9_KjXz.js → hooks-CmppZ4t-.js} +1 -1
- package/dist/client/assets/{hosting-tab-CvfAAsG1.js → hosting-tab-BSY_y3eW.js} +1 -1
- package/dist/client/assets/{index-Bo46yES1.js → index-B5h68pGs.js} +1 -1
- package/dist/client/assets/{index-B59o9_T8.js → index-BN8lkiEZ.js} +1 -1
- package/dist/client/assets/{index-DMbrlz1m.js → index-BNTjD3DA.js} +1 -1
- package/dist/client/assets/{index-DE8RFRam.js → index-B_UYjr-V.js} +1 -1
- package/dist/client/assets/{index-Cg7xMas6.js → index-BuMUpGMy.js} +1 -1
- package/dist/client/assets/{index-DMoSkttT.js → index-BvcLMqsN.js} +1 -1
- package/dist/client/assets/{index-owJhPnZu.js → index-C21GEmET.js} +6 -6
- package/dist/client/assets/{index-DIek05Ni.js → index-Cq8Pvay3.js} +2 -2
- package/dist/client/assets/{index-xqZUEhiq.js → index-D_T9uJin.js} +1 -1
- package/dist/client/assets/{index-CeY5DP2H.js → index-EAXjpOy4.js} +1 -1
- package/dist/client/assets/{index-redirect-BSQNK0c5.js → index-redirect-B5bq1j7_.js} +1 -1
- package/dist/client/assets/{infra-billing-D81JNr_4.js → infra-billing-BfUMYeYP.js} +1 -1
- package/dist/client/assets/{input-B6-nFuh0.js → input-CXaj-v5Z.js} +1 -1
- package/dist/client/assets/{integration-icon-BdFo1XXn.js → integration-icon-BciBkkLS.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-D9VCDEZZ.js → invite-member-dialog-CFzUpQKI.js} +1 -1
- package/dist/client/assets/{label-Bzd8c-RA.js → label-Bvpy7Oho.js} +1 -1
- package/dist/client/assets/{layout-BZVLMtZ0.js → layout-BOzbpUOV.js} +1 -1
- package/dist/client/assets/{login-DbWxzcWy.js → login-DFaHOFCz.js} +1 -1
- package/dist/client/assets/{markdown-CtbNHSiX.js → markdown-ExIgzICz.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-BtErdXgT.js → mcp-app-renderer-frOcxc5c.js} +1 -1
- package/dist/client/assets/{mcp-oauth-D3PGb0x2.js → mcp-oauth-CO6SXeww.js} +1 -1
- package/dist/client/assets/{members-X7tkSv1G.js → members-BVf2gPbI.js} +1 -1
- package/dist/client/assets/{monaco-editor-DMcAThqN.js → monaco-editor-f9mRiBzG.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-DKvLbjkP.js → monitoring-stats-row-BUyK7gpm.js} +1 -1
- package/dist/client/assets/{multi-select-DGNYTNEk.js → multi-select-C26TUeZm.js} +1 -1
- package/dist/client/assets/{oauth-callback-Ca0yqV1C.js → oauth-callback-BOV4pEsd.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-DOQ0G2c1.js → oauth-callback-ai-provider-D0cKJMt6.js} +1 -1
- package/dist/client/assets/{onboarding-CiXSJ2qw.js → onboarding-QlUfD7P_.js} +1 -1
- package/dist/client/assets/{org-layout-CPBdd6Bg.js → org-layout-4M2gjk2V.js} +1 -1
- package/dist/client/assets/{organization-choice-DW679eUB.js → organization-choice-jYfVKhw-.js} +1 -1
- package/dist/client/assets/{orgs-CbnIGbcT.js → orgs-Ej8UwE_Z.js} +1 -1
- package/dist/client/assets/{page-seo-form-CNpNwABh.js → page-seo-form-CZIiWzd-.js} +1 -1
- package/dist/client/assets/{popover-DNtfUsCB.js → popover-WFrG7a2R.js} +1 -1
- package/dist/client/assets/{post-calendar-B07y2JsG.js → post-calendar-BR2EFs40.js} +1 -1
- package/dist/client/assets/{post-editor-B2SPGEHG.js → post-editor-B9f8O3bl.js} +1 -1
- package/dist/client/assets/{primitives-CDC6DfBN.js → primitives-BDOvoMZj.js} +1 -1
- package/dist/client/assets/{profile-D0A66T6t.js → profile-D2_wNXJJ.js} +1 -1
- package/dist/client/assets/{project-app-view-D3HZP3xn.js → project-app-view-BPinvwe5.js} +1 -1
- package/dist/client/assets/{project-icon-BKwNPyDH.js → project-icon-UW2aNrmO.js} +1 -1
- package/dist/client/assets/{prompts-f-nECtr8.js → prompts-BkHOIDfz.js} +1 -1
- package/dist/client/assets/record-editor-D_gv9qLp.js +1 -0
- package/dist/client/assets/redirect-editor-D7Y2QAJF.js +1 -0
- package/dist/client/assets/registry-B7mQzgov.js +2 -0
- package/dist/client/assets/{registry-layout-_YKt4pUw.js → registry-layout-Ce3WSHsq.js} +1 -1
- package/dist/client/assets/{reports-CJdrG2bq.js → reports-CMqU8ts1.js} +1 -1
- package/dist/client/assets/{repositories-DSl4FF_U.js → repositories-B2yGbecz.js} +1 -1
- package/dist/client/assets/{require-capability-CsSJsgrd.js → require-capability-DcTb-1uc.js} +1 -1
- package/dist/client/assets/{required-auth-layout-XPR00FzH.js → required-auth-layout-8fTIt_aK.js} +1 -1
- package/dist/client/assets/{reset-password-C7jgcNbQ.js → reset-password-DCDD-Kv0.js} +1 -1
- package/dist/client/assets/{review-settings-Md-jLxYt.js → review-settings-IopPVrta.js} +1 -1
- package/dist/client/assets/{roles-CXp8d28s.js → roles-BgzRs2Sr.js} +1 -1
- package/dist/client/assets/{schema-DWDQ6ryI.js → schema-DPmO1u84.js} +1 -1
- package/dist/client/assets/{scroll-area-DGWiXZ1w.js → scroll-area-rLcI77hD.js} +1 -1
- package/dist/client/assets/{search-input-C6-gsMRW.js → search-input-Doquni24.js} +1 -1
- package/dist/client/assets/{secrets-DhZRaOsn.js → secrets-D14mIqld.js} +1 -1
- package/dist/client/assets/{sections-editor-Bj3bltq-.js → sections-editor-DZ5Mf3hJ.js} +1 -1
- package/dist/client/assets/{select-model-CNLldzs6.js → select-model-DrnwzB9O.js} +1 -1
- package/dist/client/assets/{select-DQ8iiyqK.js → select-yUbJhxjV.js} +1 -1
- package/dist/client/assets/{self-tool-result-BklMHu3Z.js → self-tool-result-R89u3KD_.js} +1 -1
- package/dist/client/assets/{seo-editor-DZXDnR6Q.js → seo-editor-BSF1nbGR.js} +1 -1
- package/dist/client/assets/settings-layout-BKGUhRYp.js +1 -0
- package/dist/client/assets/{settings-sidebar-C4thiWjt.js → settings-sidebar-n457m10G.js} +1 -1
- package/dist/client/assets/{shell-controls-D1BhH3wU.js → shell-controls-Cu3O0EJI.js} +1 -1
- package/dist/client/assets/{shell-layout-DPGy1SNU.js → shell-layout-mq1rTR9A.js} +1 -1
- package/dist/client/assets/{skill-preview-uCDTII4c.js → skill-preview-Czw-q82P.js} +1 -1
- package/dist/client/assets/{skills-NhAovMUS.js → skills-CXM8-A66.js} +1 -1
- package/dist/client/assets/{sso-DvAkMGsr.js → sso-DmvIsgOy.js} +1 -1
- package/dist/client/assets/{store-BXnHEyof.js → store-CwUh9qfx.js} +1 -1
- package/dist/client/assets/store-registry-VBYM6r8b.js +2 -0
- package/dist/client/assets/{switch-PGr_evzH.js → switch-DIrg2aPu.js} +1 -1
- package/dist/client/assets/{synced-repos-CnYBF3Cu.js → synced-repos-CCx9E-XM.js} +1 -1
- package/dist/client/assets/{table-CSG_zh9i.js → table-YY6V2hZW.js} +1 -1
- package/dist/client/assets/{tabs-2whhUI-U.js → tabs-BfZitUl0.js} +1 -1
- package/dist/client/assets/{task-board-Cc_Je1Tl.js → task-board-CcBm1zGR.js} +1 -1
- package/dist/client/assets/{task-route-DwIJjDqc.js → task-route-CE4jCk70.js} +1 -1
- package/dist/client/assets/{tasks-cqDWMluZ.js → tasks-BwXFaObv.js} +1 -1
- package/dist/client/assets/{textarea-Bd7RaMNl.js → textarea-C78H3rVc.js} +1 -1
- package/dist/client/assets/{thread-intent-8XofJk4L.js → thread-intent-BpDfabWb.js} +1 -1
- package/dist/client/assets/{thread-route-d5I3uQSg.js → thread-route-Dc2oc_Dg.js} +1 -1
- package/dist/client/assets/{toggle-group-HtX54j1S.js → toggle-group-BevTxBnc.js} +1 -1
- package/dist/client/assets/{toolbar-aNyqdI6F.js → toolbar-DxDsdTUW.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-TVZ9wV20.js → toolbar-icon-button-qgFQcO8V.js} +1 -1
- package/dist/client/assets/{track-CJ7UTAbv.js → track-BhFH-quB.js} +1 -1
- package/dist/client/assets/{types-WjdgXYHr.js → types-Cb8JtPgh.js} +1 -1
- package/dist/client/assets/{use-ai-providers-4XpSsDac.js → use-ai-providers-D5HZ97MS.js} +1 -1
- package/dist/client/assets/{use-automations-DDYhlGUd.js → use-automations-B5r9U-b3.js} +1 -1
- package/dist/client/assets/{use-autosave-BjCysC8V.js → use-autosave-iyfZNja2.js} +1 -1
- package/dist/client/assets/{use-connection-CwE_S8Fn.js → use-connection-DWdDv9Yx.js} +1 -1
- package/dist/client/assets/{use-copy-ijs7Eg_a.js → use-copy-D6zLgP47.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-oTZRb5vp.js → use-create-virtual-mcp-DGBOV37L.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-D655Ka7O.js → use-debounced-autosave-Ct-eC-Fb.js} +1 -1
- package/dist/client/assets/{use-debounced-value-BbelcnFE.js → use-debounced-value-DwukIiaZ.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-DmOH7Ko7.js → use-decopilot-events-t7dJuv2i.js} +1 -1
- package/dist/client/assets/{use-delete-connection-CLOPkvMX.js → use-delete-connection-Ormx92y9.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-Cwa1-AYh.js → use-deployment-admin-hfaWQhJy.js} +1 -1
- package/dist/client/assets/{use-destination-route-5cTdDwgV.js → use-destination-route-CNlk2byj.js} +1 -1
- package/dist/client/assets/{use-file-configs-C_x_aysA.js → use-file-configs-aaltFWKT.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-DqFZUY4N.js → use-infinite-scroll-BF2rYYW-.js} +1 -1
- package/dist/client/assets/{use-join-requests-BQwmRhwt.js → use-join-requests-DrSrjrK5.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-DS6JPyoV.js → use-mcp-auth-status-DmXIvFRb.js} +1 -1
- package/dist/client/assets/{use-mcp-client-TErTfSlr.js → use-mcp-client-CF-3mvGg.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-Cdr9RVeH.js → use-mcp-prompts-OhxWTpoX.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-CUsFOk8y.js → use-mcp-tools-BuSZglWG.js} +1 -1
- package/dist/client/assets/{use-members-DHc3PfZ3.js → use-members-DnTUGBde.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-DVwAusa4.js → use-navigate-to-agent-Hm-6dVUl.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-iR6n2Ufe.js → use-org-auth-client-BNes3v9b.js} +1 -1
- package/dist/client/assets/{use-org-notice-DXsc-iYj.js → use-org-notice-B9p3w7io.js} +1 -1
- package/dist/client/assets/{use-org-sso-B84iMdmV.js → use-org-sso-DGrHkk3Z.js} +1 -1
- package/dist/client/assets/{use-organization-roles-DD8iZIN6.js → use-organization-roles-DbyT1hed.js} +1 -1
- package/dist/client/assets/{use-organization-settings-Bbmygdp8.js → use-organization-settings-CrsOfln-.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-By4OUY2Q.js → use-panel-navigate-BMuzi49d.js} +1 -1
- package/dist/client/assets/{use-registry-connections-DECk2LFw.js → use-registry-connections-mpoM1a_q.js} +1 -1
- package/dist/client/assets/{use-secrets-JuG9mGc4.js → use-secrets-5zBAWglb.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-PbBwq_3M.js → use-section-preview-base-CJW41yeA.js} +1 -1
- package/dist/client/assets/{use-status-sounds-D9R6Dfxe.js → use-status-sounds-BsvWRkTi.js} +1 -1
- package/dist/client/assets/{use-tags-jHUVem-1.js → use-tags-DZW2yC2l.js} +1 -1
- package/dist/client/assets/{use-view-mode-C9jdp1Mr.js → use-view-mode-CKvfkqqx.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-B0KZ5f7x.js → use-virtual-mcp-fvlDQ-yg.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-D1I6_WH-.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-0BfT-cEg.js +1 -0
- package/dist/client/assets/{users-D-CFyrsb.js → users-C2JSGXb-.js} +1 -1
- package/dist/client/assets/{variant-calendar-B-Z6ag4J.js → variant-calendar-CNyW5bJ5.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-B2DIjtO4.js → view-mode-toggle-CI8fe64b.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +683 -610
- package/dist/server/migrate.js +254 -181
- package/dist/server/server.js +343 -343
- package/package.json +1 -1
- package/dist/client/assets/api-keys-Cyhr6yA9.js +0 -1
- package/dist/client/assets/app-editor-D4awjVz8.js +0 -1
- package/dist/client/assets/record-editor-BO0tdXdW.js +0 -1
- package/dist/client/assets/redirect-editor-aVa1U6bV.js +0 -1
- package/dist/client/assets/registry-CavqWnpp.js +0 -2
- package/dist/client/assets/settings-layout-B3CufETO.js +0 -1
- package/dist/client/assets/store-registry-CW_ddR1G.js +0 -2
- package/dist/client/assets/useInfiniteQuery-CwkiBLlS.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BTeTh9yc.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as se,b as Te,r as d,j as r,h as pe,B as Re,fk as en,bm as tn,bs as ge,fl as nn,fm as rn,fn as on,fo as sn,cL as an,fp as ln,fq as dt,bo as cn,fr as dn,fs as un,ft as fn,fu as pn,fv as mn,fw as xn,fx as hn,fy as gn,fz as bn,l as le,n as yn,t as te,a4 as tt,a1 as nt,a2 as rt,K as ot}from"./index-DIek05Ni.js";import{aa as vn,bh as Cn,bi as wn}from"./agent-icon-COOgI3ay.js";import{s as Nn}from"./XClose-Dz9b9dRZ.js";import{S as jn}from"./scroll-area-DGWiXZ1w.js";import{a as En}from"./chat-context-YazMDsfb.js";import{F as Sn}from"./editor-C8IlfhPf.js";import{u as Dn}from"./shell-layout-DPGy1SNU.js";import{s as je,a as st,f as Mn,b as Rn}from"./index-owJhPnZu.js";import{d as Tn,h as Pn,c as kn,e as Fn,b as An,D as Ln}from"./dialog-ClXo-ILY.js";import{I as it}from"./input-B6-nFuh0.js";import{c as On,d as In,b as Kn,f as zn,g as $n,e as _n,a as Gn,A as Bn}from"./alert-dialog-CADzi4i2.js";import{t as Vn}from"./ChevronUp-CKGVkzNf.js";import{i as Un}from"./ChevronRight-BId4MMJ9.js";import{i as qn}from"./Share07-BlQxtP9X.js";import{i as Hn,E as Wn,e as Oe,h as Qn,j as Xn,k as Yn,l as Jn,t as re,m as Ee,n as Ie,o as Se,g as Ke,p as ze,q as Zn,s as er,v as tr,r as $e,u as De,w as _e,x as nr,y as rr,z as or,A as sr}from"./skill-preview-uCDTII4c.js";import"./AlertCircle-COFB2d-k.js";import"./Tool01-CsI9zgpV.js";import"./ArrowUp-DtnUC7b1.js";import"./ArrowLeft-B_Sm8nZF.js";import"./Tool02-BFWUmpcW.js";import"./XCircle-B-U8MZ3l.js";import"./TrendUp01-BXyuZrfj.js";import"./ZoomOut-d1whDSJ4.js";import"./Users03-DBIwkies.js";import"./CheckCircle-BakDkudF.js";import"./Check-RwOXYzpY.js";import"./ChevronSelectorVertical-BPZJCzil.js";import"./DotsVertical-CiZ90LaC.js";import"./UserSquare-EeCR50Jd.js";import"./Copy01-D8F1H1Rm.js";import"./CreditCard01-hwp2k2z5.js";import"./Download01-BFWoFyp5.js";import"./Settings02-DI7LVcro.js";import"./Eye-BkYoLh_d.js";import"./GitBranch01-wBN2Zyoy.js";import"./Globe01-D_ldoikY.js";import"./HardDrive-ChbOVw3L.js";import"./Image01-CVmN_WRr.js";import"./Key01-n-kxmORy.js";import"./Link01-ngcEVr-U.js";import"./LinkExternal01-CYGJDolS.js";import"./Monitor01-B3YP0Q4Y.js";import"./Sun-CudPxUwF.js";import"./Package-D3FCZEz9.js";import"./Palette-B8VxVOuh.js";import"./Play-BJDJ0Cd_.js";import"./Plus-f1J7CslD.js";import"./SearchLg-ijCBByfF.js";import"./SearchMd-BxQNX78D.js";import"./Shield01-arn3OL5A.js";import"./Stars01-C7zRxa-s.js";import"./Trash01-JArTmXvL.js";import"./Upload01-TH_UzEO5.js";import"./User01-BQutGTr9.js";import"./Users01-BlGMCWje.js";import"./Zap-Dpl5zC2B.js";import"./select-DQ8iiyqK.js";import"./use-panel-navigate-By4OUY2Q.js";import"./use-destination-route-5cTdDwgV.js";import"./autosend-DnWitnAW.js";import"./thread-intent-8XofJk4L.js";import"./slugify-CEUa2lfQ.js";import"./hooks-Dp9_KjXz.js";import"./use-mcp-client-TErTfSlr.js";import"./constants-Daqiz8AS.js";import"./auth-CDNWJs_H.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-T7r443E8.js";import"./task-board-Cc_Je1Tl.js";import"./schema-DWDQ6ryI.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-B0KZ5f7x.js";import"./use-ai-providers-4XpSsDac.js";import"./location-oTTXFrSF.js";import"./use-decopilot-events-DmOH7Ko7.js";import"./thread-route-d5I3uQSg.js";import"./use-organization-settings-Bbmygdp8.js";import"./avatar-DelCpRBk.js";import"./project-icon-BKwNPyDH.js";import"./github-repo-CTPv5ZM2.js";import"./source-system-tabs-CnEGUb4r.js";import"./command-DvAIiR-Z.js";import"./index-Cg7xMas6.js";import"./required-auth-layout-XPR00FzH.js";import"./use-org-sso-B84iMdmV.js";import"./use-org-notice-DXsc-iYj.js";import"./automation-runs-jJdD2kMw.js";import"./useInfiniteQuery-CwkiBLlS.js";import"./use-infinite-scroll-DqFZUY4N.js";import"./use-connection-CwE_S8Fn.js";import"./table-CSG_zh9i.js";import"./empty-state-CMDRQGT-.js";import"./use-members-DHc3PfZ3.js";import"./use-org-auth-client-iR6n2Ufe.js";import"./use-automations-DDYhlGUd.js";import"./useSuspenseInfiniteQuery-BTeTh9yc.js";import"./format-time-BtXRrtv4.js";import"./differenceInSeconds-C3x8sHUj.js";import"./use-copy-ijs7Eg_a.js";import"./markdown-CtbNHSiX.js";import"./monaco-editor-DMcAThqN.js";import"./mcp-app-renderer-BtErdXgT.js";import"./types-WjdgXYHr.js";import"./integration-icon-BdFo1XXn.js";import"./use-navigate-to-agent-DVwAusa4.js";import"./use-mcp-prompts-Cdr9RVeH.js";import"./form-BbPYrZM0.js";import"./label-Bzd8c-RA.js";import"./file-type-icon-CCS82EWp.js";import"./drawer-4yZNiDGz.js";import"./collection-search-x0S64zby.js";import"./tabs-2whhUI-U.js";import"./toggle-group-HtX54j1S.js";import"./task-route-DwIJjDqc.js";import"./extract-connection-data-CBaHjHii.js";import"./metadata-dUsYcpuu.js";import"./connection-DVZ0x-CQ.js";import"./connection-card-CSJ2w0Dp.js";import"./use-registry-connections-DECk2LFw.js";import"./retry-CErkP7V6.js";import"./connection-slug-CITJ0kGN.js";import"./textarea-Bd7RaMNl.js";import"./connection-form-helpers-BGULertj.js";import"./authenticate-and-persist-oauth-Bc7-Czof.js";import"./mcp-oauth-D3PGb0x2.js";import"./collection-tabs-BI0Rhp1n.js";import"./badge-CzoDeQX5.js";import"./use-file-configs-C_x_aysA.js";import"./site-slug-uya6Wp4-.js";import"./dropdown-menu-ChRlmtGH.js";import"./popover-DNtfUsCB.js";import"./github-icon-BamvWtlu.js";import"./get-initials-D-f_fDFw.js";import"./select-model-CNLldzs6.js";import"./checkbox-5kuFpJGJ.js";import"./ai-providers-logos-DD3qZ33J.js";import"./folder-icon-BprwUfXF.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-D9R6Dfxe.js";import"./toolbar-aNyqdI6F.js";import"./use-mcp-tools-CUsFOk8y.js";import"./pt-BR-z8aNQunR.js";import"./use-debounced-autosave-D655Ka7O.js";import"./search-input-C6-gsMRW.js";import"./use-mcp-auth-status-DS6JPyoV.js";import"./switch-PGr_evzH.js";import"./github-repo-picker-_9hUfw1v.js";import"./use-debounced-value-BbelcnFE.js";import"./provision-repo-scoped-github-connection-WQFARyHG.js";import"./gitlab-icon-BvCV8hCq.js";import"./use-secrets-JuG9mGc4.js";import"./client-icons-BJAudV-4.js";import"./connect-layout-DnTik73n.js";import"./self-tool-result-BklMHu3Z.js";import"./track-CJ7UTAbv.js";import"./use-tags-jHUVem-1.js";import"./breadcrumb-Ci8qwvwh.js";import"./toolbar-icon-button-TVZ9wV20.js";import"./safe-image-url-D5z803Ot.js";import"./automation-list-row-DTvuVLg8.js";import"./site-error--i37Vnuw.js";import"./cards-Cj23GDZ7.js";const ir={"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 ar(i){const e=se.c(71),{open:s,mode:a,initialName:l,parentLabel:m,isPending:y,onSubmit:u,onOpenChange:b}=i,E=l===void 0?"":l,h=y===void 0?!1:y,x=Te(),[f,O]=d.useState(E),[X,I]=d.useState(s),C=ir[a];s!==X&&(I(s),s&&O(E));let g;e[0]!==h||e[1]!==b?(g=Q=>{!Q&&!h&&b(!1)},e[0]=h,e[1]=b,e[2]=g):g=e[2];const R=g;let z;e[3]!==h||e[4]!==f||e[5]!==u?(z=async Q=>{Q.preventDefault();const ne=f.trim();!ne||h||await u(ne)},e[3]=h,e[4]=f,e[5]=u,e[6]=z):z=e[6];const L=z;let T;e[7]!==C.titleKey||e[8]!==x?(T=x(C.titleKey),e[7]=C.titleKey,e[8]=x,e[9]=T):T=e[9];let P;e[10]!==T?(P=r.jsx(Tn,{children:T}),e[10]=T,e[11]=P):P=e[11];let D;e[12]!==C.descriptionKey||e[13]!==x?(D=x(C.descriptionKey),e[12]=C.descriptionKey,e[13]=x,e[14]=D):D=e[14];let S;e[15]!==D?(S=r.jsx(Pn,{children:D}),e[15]=D,e[16]=S):S=e[16];let N;e[17]!==P||e[18]!==S?(N=r.jsxs(kn,{children:[P,S]}),e[17]=P,e[18]=S,e[19]=N):N=e[19];let M;e[20]!==m||e[21]!==x?(M=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(it,{value:m,readOnly:!0,disabled:!0,className:"font-mono text-xs"})]}),e[20]=m,e[21]=x,e[22]=M):M=e[22];let j;e[23]!==x?(j=x("sandbox.fileExplorerNameDialog.name"),e[23]=x,e[24]=j):j=e[24];let F;e[25]!==j?(F=r.jsx("label",{htmlFor:"file-explorer-name",className:"text-xs font-medium text-muted-foreground",children:j}),e[25]=j,e[26]=F):F=e[26];let q;e[27]===Symbol.for("react.memo_cache_sentinel")?(q=Q=>O(Q.target.value),e[27]=q):q=e[27];let $;e[28]!==C.placeholderKey||e[29]!==x?($=x(C.placeholderKey),e[28]=C.placeholderKey,e[29]=x,e[30]=$):$=e[30];let Y;e[31]!==h||e[32]!==f||e[33]!==$?(Y=r.jsx(it,{id:"file-explorer-name",value:f,onChange:q,placeholder:$,autoFocus:!0,disabled:h}),e[31]=h,e[32]=f,e[33]=$,e[34]=Y):Y=e[34];let J;e[35]!==F||e[36]!==Y?(J=r.jsxs("div",{className:"space-y-1.5",children:[F,Y]}),e[35]=F,e[36]=Y,e[37]=J):J=e[37];let ee;e[38]!==M||e[39]!==J?(ee=r.jsxs("div",{className:"space-y-4 py-4",children:[M,J]}),e[38]=M,e[39]=J,e[40]=ee):ee=e[40];let _;e[41]!==b?(_=()=>b(!1),e[41]=b,e[42]=_):_=e[42];let A;e[43]!==x?(A=x("sandbox.fileExplorerNameDialog.cancel"),e[43]=x,e[44]=A):A=e[44];let H;e[45]!==h||e[46]!==_||e[47]!==A?(H=r.jsx(Re,{type:"button",variant:"outline",onClick:_,disabled:h,children:A}),e[45]=h,e[46]=_,e[47]=A,e[48]=H):H=e[48];let K;e[49]!==h||e[50]!==f?(K=!f.trim()||h,e[49]=h,e[50]=f,e[51]=K):K=e[51];let W;e[52]!==C.submitKey||e[53]!==h||e[54]!==x?(W=h?r.jsxs(r.Fragment,{children:[r.jsx(pe,{className:"size-3.5"}),x("sandbox.fileExplorerNameDialog.saving")]}):x(C.submitKey),e[52]=C.submitKey,e[53]=h,e[54]=x,e[55]=W):W=e[55];let G;e[56]!==K||e[57]!==W?(G=r.jsx(Re,{type:"submit",disabled:K,children:W}),e[56]=K,e[57]=W,e[58]=G):G=e[58];let k;e[59]!==H||e[60]!==G?(k=r.jsxs(Fn,{children:[H,G]}),e[59]=H,e[60]=G,e[61]=k):k=e[61];let B;e[62]!==L||e[63]!==ee||e[64]!==k||e[65]!==N?(B=r.jsx(An,{className:"sm:max-w-md",children:r.jsxs("form",{onSubmit:L,children:[N,ee,k]})}),e[62]=L,e[63]=ee,e[64]=k,e[65]=N,e[66]=B):B=e[66];let V;return e[67]!==R||e[68]!==s||e[69]!==B?(V=r.jsx(Ln,{open:s,onOpenChange:R,children:B}),e[67]=R,e[68]=s,e[69]=B,e[70]=V):V=e[70],V}function lr(i){const e=se.c(47),{deleteTarget:s,deleteDirtyPaths:a,fsActionPending:l,onOpenChange:m,onConfirm:y}=i,u=Te(),b=s?.kind==="directory",E=s!==null,h=b?"sandbox.fileExplorerDeleteDialog.titleFolder":"sandbox.fileExplorerDeleteDialog.titleFile";let x;e[0]!==u||e[1]!==h?(x=u(h),e[0]=u,e[1]=h,e[2]=x):x=e[2];let f;e[3]!==x?(f=r.jsx(On,{children:x}),e[3]=x,e[4]=f):f=e[4];let O;e[5]!==u?(O=u("sandbox.fileExplorerDeleteDialog.description"),e[5]=u,e[6]=O):O=e[6];const X=s?.name;let I;e[7]!==X?(I=r.jsx("span",{className:"font-mono",children:X}),e[7]=X,e[8]=I):I=e[8];let C;e[9]!==b||e[10]!==u?(C=b?u("sandbox.fileExplorerDeleteDialog.folderSuffix"):".",e[9]=b,e[10]=u,e[11]=C):C=e[11];let g;e[12]!==a.length||e[13]!==u?(g=a.length>0&&r.jsxs(r.Fragment,{children:[" ",a.length===1?u("sandbox.fileExplorerDeleteDialog.unsavedChangesOne"):u("sandbox.fileExplorerDeleteDialog.unsavedChangesMany",{count:a.length})]}),e[12]=a.length,e[13]=u,e[14]=g):g=e[14];let R;e[15]!==O||e[16]!==I||e[17]!==C||e[18]!==g?(R=r.jsxs(In,{children:[O," ",I,C,g]}),e[15]=O,e[16]=I,e[17]=C,e[18]=g,e[19]=R):R=e[19];let z;e[20]!==R||e[21]!==f?(z=r.jsxs(Kn,{children:[f,R]}),e[20]=R,e[21]=f,e[22]=z):z=e[22];let L;e[23]!==u?(L=u("sandbox.fileExplorerDeleteDialog.cancel"),e[23]=u,e[24]=L):L=e[24];let T;e[25]!==l||e[26]!==L?(T=r.jsx(zn,{disabled:l,children:L}),e[25]=l,e[26]=L,e[27]=T):T=e[27];const P=l||!s;let D;e[28]!==s||e[29]!==y?(D=q=>{q.preventDefault(),s&&y(s)},e[28]=s,e[29]=y,e[30]=D):D=e[30];let S;e[31]!==u?(S=u("sandbox.fileExplorerDeleteDialog.delete"),e[31]=u,e[32]=S):S=e[32];let N;e[33]!==P||e[34]!==D||e[35]!==S?(N=r.jsx($n,{disabled:P,onClick:D,children:S}),e[33]=P,e[34]=D,e[35]=S,e[36]=N):N=e[36];let M;e[37]!==T||e[38]!==N?(M=r.jsxs(_n,{children:[T,N]}),e[37]=T,e[38]=N,e[39]=M):M=e[39];let j;e[40]!==z||e[41]!==M?(j=r.jsxs(Gn,{children:[z,M]}),e[40]=z,e[41]=M,e[42]=j):j=e[42];let F;return e[43]!==m||e[44]!==E||e[45]!==j?(F=r.jsx(Bn,{open:E,onOpenChange:m,children:j}),e[43]=m,e[44]=E,e[45]=j,e[46]=F):F=e[46],F}var Ge="ContextMenu",[cr]=cn(Ge,[dt]),Z=dt(),[dr,ut]=cr(Ge),ft=i=>{const{__scopeContextMenu:e,children:s,onOpenChange:a,dir:l,modal:m=!0}=i,[y,u]=d.useState(!1),b=Z(e),E=an(a),h=d.useCallback(x=>{u(x),E(x)},[E]);return r.jsx(dr,{scope:e,open:y,onOpenChange:h,modal:m,children:r.jsx(ln,{...b,dir:l,open:y,onOpenChange:h,modal:m,children:s})})};ft.displayName=Ge;var pt="ContextMenuTrigger",mt=d.forwardRef((i,e)=>{const{__scopeContextMenu:s,disabled:a=!1,...l}=i,m=ut(pt,s),y=Z(s),u=d.useRef({x:0,y:0}),b=d.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...u.current})}),E=d.useRef(0),h=d.useCallback(()=>window.clearTimeout(E.current),[]),x=f=>{u.current={x:f.clientX,y:f.clientY},m.onOpenChange(!0)};return d.useEffect(()=>h,[h]),d.useEffect(()=>{a&&h()},[a,h]),r.jsxs(r.Fragment,{children:[r.jsx(en,{...y,virtualRef:b}),r.jsx(tn.span,{"data-state":m.open?"open":"closed","data-disabled":a?"":void 0,...l,ref:e,style:{WebkitTouchCallout:"none",...i.style},onContextMenu:a?i.onContextMenu:ge(i.onContextMenu,f=>{h(),x(f),f.preventDefault()}),onPointerDown:a?i.onPointerDown:ge(i.onPointerDown,Me(f=>{h(),E.current=window.setTimeout(()=>x(f),700)})),onPointerMove:a?i.onPointerMove:ge(i.onPointerMove,Me(h)),onPointerCancel:a?i.onPointerCancel:ge(i.onPointerCancel,Me(h)),onPointerUp:a?i.onPointerUp:ge(i.onPointerUp,Me(h))})]})});mt.displayName=pt;var ur="ContextMenuPortal",xt=i=>{const{__scopeContextMenu:e,...s}=i,a=Z(e);return r.jsx(on,{...a,...s})};xt.displayName=ur;var ht="ContextMenuContent",gt=d.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=ut(ht,s),m=Z(s),y=d.useRef(!1);return r.jsx(sn,{...m,...a,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:u=>{i.onCloseAutoFocus?.(u),!u.defaultPrevented&&y.current&&u.preventDefault(),y.current=!1},onInteractOutside:u=>{i.onInteractOutside?.(u),!u.defaultPrevented&&!l.modal&&(y.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)"}})});gt.displayName=ht;var fr="ContextMenuGroup",pr=d.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=Z(s);return r.jsx(dn,{...l,...a,ref:e})});pr.displayName=fr;var mr="ContextMenuLabel",xr=d.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=Z(s);return r.jsx(un,{...l,...a,ref:e})});xr.displayName=mr;var hr="ContextMenuItem",bt=d.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=Z(s);return r.jsx(nn,{...l,...a,ref:e})});bt.displayName=hr;var gr="ContextMenuCheckboxItem",br=d.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=Z(s);return r.jsx(fn,{...l,...a,ref:e})});br.displayName=gr;var yr="ContextMenuRadioGroup",vr=d.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=Z(s);return r.jsx(pn,{...l,...a,ref:e})});vr.displayName=yr;var Cr="ContextMenuRadioItem",wr=d.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=Z(s);return r.jsx(mn,{...l,...a,ref:e})});wr.displayName=Cr;var Nr="ContextMenuItemIndicator",jr=d.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=Z(s);return r.jsx(xn,{...l,...a,ref:e})});jr.displayName=Nr;var Er="ContextMenuSeparator",yt=d.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=Z(s);return r.jsx(rn,{...l,...a,ref:e})});yt.displayName=Er;var Sr="ContextMenuArrow",Dr=d.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=Z(s);return r.jsx(hn,{...l,...a,ref:e})});Dr.displayName=Sr;var Mr="ContextMenuSubTrigger",Rr=d.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=Z(s);return r.jsx(gn,{...l,...a,ref:e})});Rr.displayName=Mr;var Tr="ContextMenuSubContent",Pr=d.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=Z(s);return r.jsx(bn,{...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)"}})});Pr.displayName=Tr;function Me(i){return e=>e.pointerType!=="mouse"?i(e):void 0}var kr=ft,Fr=mt,Ar=xt,Lr=gt,Or=bt,Ir=yt;function Kr(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(kr,{"data-slot":"context-menu",...s}),e[2]=s,e[3]=a):a=e[3],a}function zr(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(Fr,{"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(Ar,{children:r.jsx(Lr,{"data-slot":"context-menu-content",translate:"no",className:l,...a})}),e[5]=a,e[6]=l,e[7]=m):m=e[7],m}function fe(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 y=m===void 0?"default":m;let u;e[5]!==s?(u=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]=u):u=e[6];let b;return e[7]!==a||e[8]!==l||e[9]!==u||e[10]!==y?(b=r.jsx(Or,{"data-slot":"context-menu-item","data-inset":a,"data-variant":y,className:u,...l}),e[7]=a,e[8]=l,e[9]=u,e[10]=y,e[11]=b):b=e[11],b}function at(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(Ir,{"data-slot":"context-menu-separator",className:l,...a}),e[5]=a,e[6]=l,e[7]=m):m=e[7],m}const _r="#d9a441";function Gr(i){const e=se.c(63),{node:s,depth:a,isExpanded:l,isSelected:m,isLoading:y,fileVisual:u,onOpen:b,onSelect:E,onNewFile:h,onNewFolder:x,onCopyPath:f,onCopyRelativePath:O,onRename:X,onDelete:I}=i,C=y===void 0?!1:y,g=Te(),R=s.kind==="directory",{Icon:z,color:L}=u,T=m&&"bg-accent";let P;e[0]!==T?(P=le("flex w-full items-center gap-1.5 px-2 py-1.5 text-left text-[13px] hover:bg-accent transition-colors",T),e[0]=T,e[1]=P):P=e[1];const D=`${a*14+8}px`;let S;e[2]!==D?(S={paddingLeft:D},e[2]=D,e[3]=S):S=e[3];let N;e[4]!==b||e[5]!==E?(N=()=>{E(),b()},e[4]=b,e[5]=E,e[6]=N):N=e[6];let M;e[7]!==z||e[8]!==L||e[9]!==R||e[10]!==l||e[11]!==C?(M=R?r.jsxs(r.Fragment,{children:[C?r.jsx(pe,{className:"size-3.5 shrink-0 text-muted-foreground"}):l?r.jsx(Vn,{size:14,className:"shrink-0 text-muted-foreground"}):r.jsx(Un,{size:14,className:"shrink-0 text-muted-foreground"}),r.jsx(qn,{size:16,className:"shrink-0",style:{color:_r}})]}):r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"w-3.5 shrink-0"}),r.jsx(z,{size:16,className:"shrink-0",style:{color:L}})]}),e[7]=z,e[8]=L,e[9]=R,e[10]=l,e[11]=C,e[12]=M):M=e[12];let j;e[13]!==s.name?(j=r.jsx("span",{className:"truncate",children:s.name}),e[13]=s.name,e[14]=j):j=e[14];let F;e[15]!==P||e[16]!==S||e[17]!==N||e[18]!==M||e[19]!==j?(F=r.jsx(zr,{asChild:!0,children:r.jsxs("button",{type:"button",className:P,style:S,onClick:N,children:[M,j]})}),e[15]=P,e[16]=S,e[17]=N,e[18]=M,e[19]=j,e[20]=F):F=e[20];let q;e[21]!==g?(q=g("sandbox.fileTreeRow.newFile"),e[21]=g,e[22]=q):q=e[22];let $;e[23]!==h||e[24]!==q?($=r.jsx(fe,{onSelect:h,children:q}),e[23]=h,e[24]=q,e[25]=$):$=e[25];let Y;e[26]!==g?(Y=g("sandbox.fileTreeRow.newFolder"),e[26]=g,e[27]=Y):Y=e[27];let J;e[28]!==x||e[29]!==Y?(J=r.jsx(fe,{onSelect:x,children:Y}),e[28]=x,e[29]=Y,e[30]=J):J=e[30];let ee;e[31]===Symbol.for("react.memo_cache_sentinel")?(ee=r.jsx(at,{}),e[31]=ee):ee=e[31];let _;e[32]!==g?(_=g("sandbox.fileTreeRow.copyPath"),e[32]=g,e[33]=_):_=e[33];let A;e[34]!==f||e[35]!==_?(A=r.jsx(fe,{onSelect:f,children:_}),e[34]=f,e[35]=_,e[36]=A):A=e[36];let H;e[37]!==g?(H=g("sandbox.fileTreeRow.copyRelativePath"),e[37]=g,e[38]=H):H=e[38];let K;e[39]!==O||e[40]!==H?(K=r.jsx(fe,{onSelect:O,children:H}),e[39]=O,e[40]=H,e[41]=K):K=e[41];let W;e[42]===Symbol.for("react.memo_cache_sentinel")?(W=r.jsx(at,{}),e[42]=W):W=e[42];let G;e[43]!==g?(G=g("sandbox.fileTreeRow.rename"),e[43]=g,e[44]=G):G=e[44];let k;e[45]!==X||e[46]!==G?(k=r.jsx(fe,{onSelect:X,children:G}),e[45]=X,e[46]=G,e[47]=k):k=e[47];let B;e[48]!==g?(B=g("sandbox.fileTreeRow.delete"),e[48]=g,e[49]=B):B=e[49];let V;e[50]!==I||e[51]!==B?(V=r.jsx(fe,{variant:"destructive",onSelect:I,children:B}),e[50]=I,e[51]=B,e[52]=V):V=e[52];let Q;e[53]!==$||e[54]!==J||e[55]!==A||e[56]!==K||e[57]!==k||e[58]!==V?(Q=r.jsxs($r,{className:"w-52",children:[$,J,ee,A,K,W,k,V]}),e[53]=$,e[54]=J,e[55]=A,e[56]=K,e[57]=k,e[58]=V,e[59]=Q):Q=e[59];let ne;return e[60]!==Q||e[61]!==F?(ne=r.jsxs(Kr,{children:[F,Q]}),e[60]=Q,e[61]=F,e[62]=ne):ne=e[62],ne}const lt=200,Br=2,Vr=250,ct=200;function Ur(i,e){return Rn(i,e)}function qr(i){const e=se.c(9),{text:s,query:a}=i;let l,m,y;if(e[0]!==a||e[1]!==s){const{leadingEllipsis:b,segments:E}=Zn(s,a);l="truncate font-mono text-muted-foreground",m=b&&r.jsx("span",{className:"text-muted-foreground/50",children:"…"}),y=E.map(Hr),e[0]=a,e[1]=s,e[2]=l,e[3]=m,e[4]=y}else l=e[2],m=e[3],y=e[4];let u;return e[5]!==l||e[6]!==m||e[7]!==y?(u=r.jsxs("span",{className:l,children:[m,y]}),e[5]=l,e[6]=m,e[7]=y,e[8]=u):u=e[8],u}function Hr(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 Xi({orgSlug:i,virtualMcpId:e,branch:s,threadId:a,openPath:l}){const m={orgSlug:i,virtualMcpId:e,branch:s,threadId:a},[y,u]=d.useState({files:[],directories:[],truncated:!1}),{files:b,directories:E}=y,[h,x]=d.useState(new Set),[f,O]=d.useState(null),[X,I]=d.useState(null),[C,g]=d.useState([]),[R,z]=d.useState(""),[L,T]=d.useState(null),[P,D]=d.useState(null),[S,N]=d.useState(!1),[M,j]=d.useState(!1),[F,q]=d.useState(!1),[$,Y]=d.useState(!1),[,J]=d.useState(new Set),[ee,_]=d.useState(new Set),A=d.useRef(0),H=d.useRef(null),K=d.useRef(new Set),W=d.useRef(new Map),G=d.useRef(null),k=d.useRef(0),B=d.useRef(null),V=d.useRef(null),Q=d.useRef(null);function ne(t){J(n=>{const o=typeof t=="function"?t(n):t;return K.current=o,o})}const[me,de]=d.useState(new Map),Pe=d.useRef(null),[ie,be]=d.useState(null),{sendMessage:vt}=En(),{openSidePanel:Ct}=Dn(),ye=yn(),[U,oe]=d.useState(null),[ke,Fe]=d.useState(null),[ve,Ce]=d.useState(!1);async function ae(t,n){const o=await fetch(Ur(m,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 we(){ye.invalidateQueries({queryKey:st(m)})}function Be(t,n,o){navigator.clipboard.writeText(o).then(()=>te.success(t("sandbox.fileExplorer.textCopied",{label:n})),()=>te.error(t("sandbox.fileExplorer.failedToCopyText",{label:n.toLowerCase()})))}function wt(t){const n=or(t);if(!n)return;const o=`${i}/${e}/${s}`;ye.setQueryData(ot.decofile(o),c=>{if(!c)return c;const{[n]:p,...v}=c;return v}),ye.invalidateQueries({queryKey:ot.liveMeta(i,e,s)})}function Nt(t){const n=t.kind==="file"?[t.path]:b.filter(o=>o.startsWith(".deco/blocks/")).map(o=>Ee(o)).filter(o=>o===t.path||o.startsWith(`${t.path}/`));for(const o of n)wt(o)}function jt(t){const n=Ee(t);return C.filter(o=>{if(o!==n&&!o.startsWith(`${n}/`))return!1;const c=me.get(o);return!!(c?.loaded&&c.editorValue!==c.savedContent)})}function Ve(t){g(n=>n.map(o=>t(o)).filter(o=>o!==null)),O(n=>n&&t(n)),de(n=>{const o=new Map;for(const[c,p]of n){const v=t(c);v&&o.set(v,p)}return o}),I(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 Et(t){const n=Ee(t);I(o=>o&&(o.path===n||o.path.startsWith(`${n}/`)?null:o)),Ve(o=>o===n||o.startsWith(`${n}/`)?null:o)}async function St(t,n){if(!U)return;const o=De(U.parentDir,n);if(_e(o,b,E))throw new Error(t("sandbox.fileExplorer.fileAlreadyExists",{name:n}));await ae("write",{path:re(o),content:""}),await xe(),await we(),oe(null),he(o)}async function Dt(t,n){if(!U)return;const o=De(U.parentDir,n);if(_e(o,b,E))throw new Error(t("sandbox.fileExplorer.fileAlreadyExists",{name:n}));const c=re(o);await ae("mkdir",{path:c}),u(p=>({...p,directories:p.directories.includes(c)?p.directories:[...p.directories,c]})),await xe(),await we(),oe(null),x(p=>{const v=new Set(p);for(const ce of ze(o))v.add(ce);return v.add(o),v}),I({name:n,path:o,kind:"directory",children:[]})}async function Mt(t,n){if(!U)return;const o=U.node.path,c=Se(o),p=De(c,n);if(p===o){oe(null);return}if(_e(p,b,E))throw new Error(t("sandbox.fileExplorer.fileAlreadyExists",{name:n}));await ae("rename",{from:re(o),to:re(p)}),Ve(v=>v===o?p:v.startsWith(`${o}/`)?De(p,v.slice(o.length+1)):v),await xe(),await we(),oe(null)}async function Rt(t,n){Ce(!0);try{await ae("unlink",{path:re(n.path),recursive:n.kind==="directory"}),Nt(n),Et(n.path),await xe(),await we(),Fe(null),te.success(t("sandbox.fileExplorer.fileDeleted",{name:n.name}))}catch(o){te.error(o instanceof Error?o.message:t("sandbox.fileExplorer.deleteFailed"))}finally{Ce(!1)}}async function Tt(t,n){const o=tr(n);if(o){te.error(o);return}Ce(!0);try{U?.mode==="new-file"?(await St(t,n),te.success(t("sandbox.fileExplorer.fileCreated",{name:n}))):U?.mode==="new-folder"?(await Dt(t,n),te.success(t("sandbox.fileExplorer.folderCreated",{name:n}))):U?.mode==="rename"&&(await Mt(t,n),te.success(t("sandbox.fileExplorer.renamedTo",{name:n})))}catch(c){te.error(c instanceof Error?c.message:t("sandbox.fileExplorer.operationFailed"))}finally{Ce(!1)}}const Ue=d.useRef(!1);Ue.current||(Ue.current=!0,H.current=xe());const[Pt,kt]=d.useState(null),w=Te();if(l&&l!==Pt){kt(l);const t=l;queueMicrotask(()=>{Hn(t)&&he(t)})}async function Ae(t){const n=await ae("glob",t);return{files:n.files??[],directories:n.directories??[],truncated:n.truncated}}function qe(t,n,o){if(o!==A.current)return!1;let c=!1;return u(p=>{const v=n?sr(p.files,p.directories,t,p.truncated):{files:t.files,directories:t.directories??[],truncated:!!t.truncated};return c=!!v.truncated,{files:v.files,directories:v.directories,truncated:c}}),c&&te.warning(w("sandbox.fileExplorer.fileListTruncated")),c}async function Ft(t){const n=W.current.get(t);if(n)return n;const o=A.current,c=(async()=>{const p=await Ae({pattern:"**/*",path:re(t),limit:Oe}),v=qe(p,!0,o);return!v&&o===A.current&&ne(ce=>{const Ne=new Set(ce);return Ne.add(t),Ne}),v})();W.current.set(t,c);try{return await c}finally{W.current.delete(t)}}async function He(t){if(!$e(t,K.current))return!1;_(n=>new Set(n).add(t));try{return await Ft(t)}finally{_(n=>{const o=new Set(n);return o.delete(t),o})}}async function At(t,n){const o=new Set(K.current);for(const c of ze(n)){if(!$e(c,o))continue;if(await He(c))throw new Error(t("sandbox.fileExplorer.folderListingTruncated"));o.add(c)}}async function xe(){const t=++A.current;B.current=null,V.current=null,W.current.clear(),q(!0),ne(new Set),x(new Set),_(new Set);try{const n=await Ae({pattern:"**/*",limit:Oe,maxDepth:Wn});qe(n,!1,t),Y(!0)}catch{$&&te.error(w("sandbox.fileExplorer.failedToRefreshFileTree"))}finally{q(!1)}}async function We(t){if(!me.get(t)?.loaded){de(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=er(o.content??"");de(p=>{const v=new Map(p);return v.set(t,{savedContent:c,editorValue:c,loaded:!0}),v})}catch{}}}function Lt(){k.current++,T(null),D(null),N(!1),j(!1)}async function Ot(){const t=A.current,n=B.current;if(n&&n.generation===t)return n.files;const o=V.current;if(o&&o.generation===t)return o.promise;const c=(async()=>{const p=await Ae({pattern:"**/*",limit:Oe});return A.current===t&&(B.current={generation:t,files:p.files}),p.files})();V.current={generation:t,promise:c};try{return await c}finally{V.current?.generation===t&&(V.current=null)}}async function It(t,n){try{const o=await Ot();if(n!==k.current)return;T(nr(o,t,ct))}catch{if(n!==k.current)return;T([])}}async function Kt(t,n){N(!0);try{const o=await ae("grep",{pattern:t,output_mode:"content",ignore_case:!0,fixed_strings:!0,limit:lt});if(n!==k.current)return;D(rr(o.results??"")),j((o.matchCount??0)>=lt)}catch{if(n!==k.current)return;D([]),j(!1)}finally{n===k.current&&N(!1)}}function zt(t){const n=t.trim(),o=++k.current;It(n,o),n.length<Br?(D(null),N(!1),j(!1)):Kt(n,o)}function $t(t){if(z(t),G.current&&clearTimeout(G.current),!t.trim()){Lt();return}G.current=setTimeout(()=>{zt(t)},Vr)}function Qe(t){const n=Q.current;if(!n||n.path!==f)return;Q.current=null;const o=Math.max(1,n.line);t.revealLineInCenter(o),t.setPosition({lineNumber:o,column:1}),t.focus()}function _t(t){Q.current={path:t.path,line:t.line};const n=f===t.path&&me.get(t.path)?.loaded;he(t.path),n&&Pe.current&&Qe(Pe.current)}async function Gt(t,n){try{await ae("write",{path:re(t),content:n}),je("file saved via sandbox /write",{path:t}),ye.invalidateQueries({queryKey:st(m)});try{const o=await Mn(m);je("git status after save",o)}catch(o){je("git status after save failed",{path:t,error:o instanceof Error?o.message:String(o)})}de(o=>{const c=new Map(o),p=c.get(t);return p&&c.set(t,{...p,savedContent:n}),c})}catch(o){je("file save failed",{path:t,error:o instanceof Error?o.message:String(o)})}}function Bt(t){O(t),I({name:t.split("/").pop()??t,path:t,kind:"file",children:[]}),be(null),C.includes(t)||g(n=>[...n,t]),We(t)}function Vt(t){g(n=>{const o=n.filter(c=>c!==t);return f===t&&O(o[o.length-1]??null),o}),de(n=>{const o=new Map(n);return o.delete(t),o})}function Xe(t){x(n=>{const o=new Set(n);return o.has(t)?o.delete(t):o.add(t),o})}async function Ut(t){if($e(t,K.current))try{if(await He(t))return}catch(n){te.error(n instanceof Error?n.message:w("sandbox.fileExplorer.failedToLoadFolder"));return}Xe(t)}async function qt(t,n){if(n){Xe(t);return}await Ut(t)}async function Ht(t){await H.current,await At(w,t);const n=ze(t);x(o=>{const c=new Set(o);for(const p of n)c.add(p);return c}),Bt(t)}function he(t){Ht(t).catch(n=>{te.error(n instanceof Error?n.message:w("sandbox.fileExplorer.failedToOpenFile"))})}function Wt(){return X?.kind==="directory"?X.path:X?.kind==="file"?Se(X.path):f?Se(f):"/"}function Ye(t){const n=Wt();oe({mode:t,parentDir:n,node:{name:"",path:n,kind:"directory",children:[]}})}const Qt=Qn(b,E),Je=Xn(Qt,h),Le=L?.length??0,Ze=Yn(P??[]),et=P?.length??0,ue=f?me.get(f):null,Xt=ue?.loaded&&ue.editorValue!==ue.savedContent,Yt=ke?jt(ke.path):[],Jt=(t,n)=>{Pe.current=t,Qe(t),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyS,async()=>{if(!f)return;const o=t.getValue();await Gt(f,o)}),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyK,()=>{const o=t.getSelection(),c=t.getModel();if(!o||!c||!f)return;const p=c.getValueInRange(o);be({filePath:f,lineStart:o.startLineNumber,lineEnd:o.endLineNumber,selectedCode:p})})};function Zt(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=Ke(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."),Ct(),vt({parts:[{type:"text",text:n.join(`
|
|
1
|
+
import{c as se,b as Te,r as d,j as r,h as pe,B as Re,fk as en,bm as tn,bs as ge,fl as nn,fm as rn,fn as on,fo as sn,cL as an,fp as ln,fq as dt,bo as cn,fr as dn,fs as un,ft as fn,fu as pn,fv as mn,fw as xn,fx as hn,fy as gn,fz as bn,l as le,n as yn,t as te,a4 as tt,a1 as nt,a2 as rt,K as ot}from"./index-Cq8Pvay3.js";import{aa as vn,bh as Cn,bi as wn}from"./agent-icon-SMSi6xWE.js";import{s as Nn}from"./XClose-B_DrKSBW.js";import{S as jn}from"./scroll-area-rLcI77hD.js";import{a as En}from"./chat-context-CK8dv3gu.js";import{F as Sn}from"./editor-BnFle53c.js";import{u as Dn}from"./shell-layout-mq1rTR9A.js";import{s as je,a as st,f as Mn,b as Rn}from"./index-C21GEmET.js";import{d as Tn,h as Pn,c as kn,e as Fn,b as An,D as Ln}from"./dialog-CzPQcE4z.js";import{I as it}from"./input-CXaj-v5Z.js";import{c as On,d as In,b as Kn,f as zn,g as $n,e as _n,a as Gn,A as Bn}from"./alert-dialog-DkCt8SMC.js";import{t as Vn}from"./ChevronUp-DxATplb1.js";import{i as Un}from"./ChevronRight-CVA9425t.js";import{i as qn}from"./Share07-C_FfyIR6.js";import{i as Hn,E as Wn,e as Oe,h as Qn,j as Xn,k as Yn,l as Jn,t as re,m as Ee,n as Ie,o as Se,g as Ke,p as ze,q as Zn,s as er,v as tr,r as $e,u as De,w as _e,x as nr,y as rr,z as or,A as sr}from"./skill-preview-Czw-q82P.js";import"./AlertCircle-Ci-hYOqv.js";import"./Tool01-BJmzZfRm.js";import"./ArrowUp-D8qcxyxl.js";import"./ArrowLeft-bSm3BNTP.js";import"./Tool02-D5gCi3V2.js";import"./XCircle-B8QRFbl_.js";import"./TrendUp01-BSaUEAJa.js";import"./ZoomOut-BuGsEwz7.js";import"./Users03-Di0wmvZD.js";import"./CheckCircle-CxY3rlAm.js";import"./Check-Bm4pKAip.js";import"./ChevronSelectorVertical-WRqK1Mrc.js";import"./DotsVertical-K0YXD5Xp.js";import"./UserSquare-D_Mg9gDt.js";import"./Copy01-DB0ALgAH.js";import"./CreditCard01-smVPvYXE.js";import"./Download01-DTG8FxjC.js";import"./Settings02-IWtrYGOv.js";import"./Eye-C7eDeC1B.js";import"./GitBranch01-CTfNzZhb.js";import"./Globe01-BIqUh-Wm.js";import"./HardDrive-C-v0dJH8.js";import"./Image01-BAO1u5yb.js";import"./Key01-Bco3JWi5.js";import"./Link01-yHELimBx.js";import"./LinkExternal01-Ajyc9uFz.js";import"./Monitor01-CZwiGM11.js";import"./Sun-Fs22jsuj.js";import"./Package-CII6DRam.js";import"./Palette-DAybMQCg.js";import"./Play-BCDmVmXb.js";import"./Plus-B3THEWxi.js";import"./SearchLg-BW5z-Jmq.js";import"./SearchMd-trH7xP9Q.js";import"./Shield01-DbH51sQf.js";import"./Stars01-DDKtXwrQ.js";import"./Trash01-VtG9RQfC.js";import"./Upload01-DLgmYiLN.js";import"./User01-BBrQuNix.js";import"./Users01-C6TOtt1M.js";import"./Zap-JQ9vG-vf.js";import"./select-yUbJhxjV.js";import"./use-panel-navigate-BMuzi49d.js";import"./use-destination-route-CNlk2byj.js";import"./autosend-Czy6C6y2.js";import"./thread-intent-BpDfabWb.js";import"./slugify-CEUa2lfQ.js";import"./hooks-CmppZ4t-.js";import"./use-mcp-client-CF-3mvGg.js";import"./constants-Daqiz8AS.js";import"./auth-DhrjniPt.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool--W7_l_Pu.js";import"./task-board-CcBm1zGR.js";import"./schema-DPmO1u84.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-fvlDQ-yg.js";import"./use-ai-providers-D5HZ97MS.js";import"./location-oTTXFrSF.js";import"./use-decopilot-events-t7dJuv2i.js";import"./thread-route-Dc2oc_Dg.js";import"./use-organization-settings-CrsOfln-.js";import"./avatar-DH4ZIsE3.js";import"./project-icon-UW2aNrmO.js";import"./github-repo-CTPv5ZM2.js";import"./source-system-tabs-CnEGUb4r.js";import"./command-Q8LdaCNH.js";import"./index-BuMUpGMy.js";import"./required-auth-layout-8fTIt_aK.js";import"./use-org-sso-DGrHkk3Z.js";import"./use-org-notice-B9p3w7io.js";import"./automation-runs-BJXyMXLk.js";import"./useInfiniteQuery-D1I6_WH-.js";import"./use-infinite-scroll-BF2rYYW-.js";import"./use-connection-DWdDv9Yx.js";import"./table-YY6V2hZW.js";import"./empty-state-DcZpUCNu.js";import"./use-members-DnTUGBde.js";import"./use-org-auth-client-BNes3v9b.js";import"./use-automations-B5r9U-b3.js";import"./useSuspenseInfiniteQuery-0BfT-cEg.js";import"./format-time-BtXRrtv4.js";import"./differenceInSeconds-C3x8sHUj.js";import"./use-copy-D6zLgP47.js";import"./markdown-ExIgzICz.js";import"./monaco-editor-f9mRiBzG.js";import"./mcp-app-renderer-frOcxc5c.js";import"./types-Cb8JtPgh.js";import"./integration-icon-BciBkkLS.js";import"./use-navigate-to-agent-Hm-6dVUl.js";import"./use-mcp-prompts-OhxWTpoX.js";import"./form-DvuQtnED.js";import"./label-Bvpy7Oho.js";import"./file-type-icon-B0g83ZyY.js";import"./drawer-C9BPrZDr.js";import"./collection-search-D4iyLe2V.js";import"./tabs-BfZitUl0.js";import"./toggle-group-BevTxBnc.js";import"./task-route-CE4jCk70.js";import"./extract-connection-data-kN2PmA7O.js";import"./metadata-dUsYcpuu.js";import"./connection-DpQjP7x0.js";import"./connection-card-BLWf3Xy2.js";import"./use-registry-connections-mpoM1a_q.js";import"./retry-CErkP7V6.js";import"./connection-slug-CITJ0kGN.js";import"./textarea-C78H3rVc.js";import"./connection-form-helpers-DEtFyGOP.js";import"./authenticate-and-persist-oauth-B3ICSnyd.js";import"./mcp-oauth-CO6SXeww.js";import"./collection-tabs-DP-ptCDv.js";import"./badge-VI5MdDWx.js";import"./use-file-configs-aaltFWKT.js";import"./site-slug-uya6Wp4-.js";import"./dropdown-menu-S3caw2j5.js";import"./popover-WFrG7a2R.js";import"./github-icon-DrHBaXxl.js";import"./get-initials-D-f_fDFw.js";import"./select-model-DrnwzB9O.js";import"./checkbox-BqHdXcFf.js";import"./ai-providers-logos-DD3qZ33J.js";import"./folder-icon-D3DcymJq.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-BsvWRkTi.js";import"./toolbar-DxDsdTUW.js";import"./use-mcp-tools-BuSZglWG.js";import"./pt-BR-z8aNQunR.js";import"./use-debounced-autosave-Ct-eC-Fb.js";import"./search-input-Doquni24.js";import"./use-mcp-auth-status-DmXIvFRb.js";import"./switch-DIrg2aPu.js";import"./github-repo-picker-Dth8apmY.js";import"./use-debounced-value-DwukIiaZ.js";import"./provision-repo-scoped-github-connection-WQFARyHG.js";import"./gitlab-icon-CqhnK68r.js";import"./use-secrets-5zBAWglb.js";import"./client-icons-Y5EunWnJ.js";import"./connect-layout-LgrVcABr.js";import"./self-tool-result-R89u3KD_.js";import"./track-BhFH-quB.js";import"./use-tags-DZW2yC2l.js";import"./breadcrumb-_uXEtTpi.js";import"./toolbar-icon-button-qgFQcO8V.js";import"./safe-image-url-D5z803Ot.js";import"./automation-list-row-Cu2NfQCN.js";import"./site-error--i37Vnuw.js";import"./cards-DxEfwobu.js";const ir={"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 ar(i){const e=se.c(71),{open:s,mode:a,initialName:l,parentLabel:m,isPending:y,onSubmit:u,onOpenChange:b}=i,E=l===void 0?"":l,h=y===void 0?!1:y,x=Te(),[f,O]=d.useState(E),[X,I]=d.useState(s),C=ir[a];s!==X&&(I(s),s&&O(E));let g;e[0]!==h||e[1]!==b?(g=Q=>{!Q&&!h&&b(!1)},e[0]=h,e[1]=b,e[2]=g):g=e[2];const R=g;let z;e[3]!==h||e[4]!==f||e[5]!==u?(z=async Q=>{Q.preventDefault();const ne=f.trim();!ne||h||await u(ne)},e[3]=h,e[4]=f,e[5]=u,e[6]=z):z=e[6];const L=z;let T;e[7]!==C.titleKey||e[8]!==x?(T=x(C.titleKey),e[7]=C.titleKey,e[8]=x,e[9]=T):T=e[9];let P;e[10]!==T?(P=r.jsx(Tn,{children:T}),e[10]=T,e[11]=P):P=e[11];let D;e[12]!==C.descriptionKey||e[13]!==x?(D=x(C.descriptionKey),e[12]=C.descriptionKey,e[13]=x,e[14]=D):D=e[14];let S;e[15]!==D?(S=r.jsx(Pn,{children:D}),e[15]=D,e[16]=S):S=e[16];let N;e[17]!==P||e[18]!==S?(N=r.jsxs(kn,{children:[P,S]}),e[17]=P,e[18]=S,e[19]=N):N=e[19];let M;e[20]!==m||e[21]!==x?(M=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(it,{value:m,readOnly:!0,disabled:!0,className:"font-mono text-xs"})]}),e[20]=m,e[21]=x,e[22]=M):M=e[22];let j;e[23]!==x?(j=x("sandbox.fileExplorerNameDialog.name"),e[23]=x,e[24]=j):j=e[24];let F;e[25]!==j?(F=r.jsx("label",{htmlFor:"file-explorer-name",className:"text-xs font-medium text-muted-foreground",children:j}),e[25]=j,e[26]=F):F=e[26];let q;e[27]===Symbol.for("react.memo_cache_sentinel")?(q=Q=>O(Q.target.value),e[27]=q):q=e[27];let $;e[28]!==C.placeholderKey||e[29]!==x?($=x(C.placeholderKey),e[28]=C.placeholderKey,e[29]=x,e[30]=$):$=e[30];let Y;e[31]!==h||e[32]!==f||e[33]!==$?(Y=r.jsx(it,{id:"file-explorer-name",value:f,onChange:q,placeholder:$,autoFocus:!0,disabled:h}),e[31]=h,e[32]=f,e[33]=$,e[34]=Y):Y=e[34];let J;e[35]!==F||e[36]!==Y?(J=r.jsxs("div",{className:"space-y-1.5",children:[F,Y]}),e[35]=F,e[36]=Y,e[37]=J):J=e[37];let ee;e[38]!==M||e[39]!==J?(ee=r.jsxs("div",{className:"space-y-4 py-4",children:[M,J]}),e[38]=M,e[39]=J,e[40]=ee):ee=e[40];let _;e[41]!==b?(_=()=>b(!1),e[41]=b,e[42]=_):_=e[42];let A;e[43]!==x?(A=x("sandbox.fileExplorerNameDialog.cancel"),e[43]=x,e[44]=A):A=e[44];let H;e[45]!==h||e[46]!==_||e[47]!==A?(H=r.jsx(Re,{type:"button",variant:"outline",onClick:_,disabled:h,children:A}),e[45]=h,e[46]=_,e[47]=A,e[48]=H):H=e[48];let K;e[49]!==h||e[50]!==f?(K=!f.trim()||h,e[49]=h,e[50]=f,e[51]=K):K=e[51];let W;e[52]!==C.submitKey||e[53]!==h||e[54]!==x?(W=h?r.jsxs(r.Fragment,{children:[r.jsx(pe,{className:"size-3.5"}),x("sandbox.fileExplorerNameDialog.saving")]}):x(C.submitKey),e[52]=C.submitKey,e[53]=h,e[54]=x,e[55]=W):W=e[55];let G;e[56]!==K||e[57]!==W?(G=r.jsx(Re,{type:"submit",disabled:K,children:W}),e[56]=K,e[57]=W,e[58]=G):G=e[58];let k;e[59]!==H||e[60]!==G?(k=r.jsxs(Fn,{children:[H,G]}),e[59]=H,e[60]=G,e[61]=k):k=e[61];let B;e[62]!==L||e[63]!==ee||e[64]!==k||e[65]!==N?(B=r.jsx(An,{className:"sm:max-w-md",children:r.jsxs("form",{onSubmit:L,children:[N,ee,k]})}),e[62]=L,e[63]=ee,e[64]=k,e[65]=N,e[66]=B):B=e[66];let V;return e[67]!==R||e[68]!==s||e[69]!==B?(V=r.jsx(Ln,{open:s,onOpenChange:R,children:B}),e[67]=R,e[68]=s,e[69]=B,e[70]=V):V=e[70],V}function lr(i){const e=se.c(47),{deleteTarget:s,deleteDirtyPaths:a,fsActionPending:l,onOpenChange:m,onConfirm:y}=i,u=Te(),b=s?.kind==="directory",E=s!==null,h=b?"sandbox.fileExplorerDeleteDialog.titleFolder":"sandbox.fileExplorerDeleteDialog.titleFile";let x;e[0]!==u||e[1]!==h?(x=u(h),e[0]=u,e[1]=h,e[2]=x):x=e[2];let f;e[3]!==x?(f=r.jsx(On,{children:x}),e[3]=x,e[4]=f):f=e[4];let O;e[5]!==u?(O=u("sandbox.fileExplorerDeleteDialog.description"),e[5]=u,e[6]=O):O=e[6];const X=s?.name;let I;e[7]!==X?(I=r.jsx("span",{className:"font-mono",children:X}),e[7]=X,e[8]=I):I=e[8];let C;e[9]!==b||e[10]!==u?(C=b?u("sandbox.fileExplorerDeleteDialog.folderSuffix"):".",e[9]=b,e[10]=u,e[11]=C):C=e[11];let g;e[12]!==a.length||e[13]!==u?(g=a.length>0&&r.jsxs(r.Fragment,{children:[" ",a.length===1?u("sandbox.fileExplorerDeleteDialog.unsavedChangesOne"):u("sandbox.fileExplorerDeleteDialog.unsavedChangesMany",{count:a.length})]}),e[12]=a.length,e[13]=u,e[14]=g):g=e[14];let R;e[15]!==O||e[16]!==I||e[17]!==C||e[18]!==g?(R=r.jsxs(In,{children:[O," ",I,C,g]}),e[15]=O,e[16]=I,e[17]=C,e[18]=g,e[19]=R):R=e[19];let z;e[20]!==R||e[21]!==f?(z=r.jsxs(Kn,{children:[f,R]}),e[20]=R,e[21]=f,e[22]=z):z=e[22];let L;e[23]!==u?(L=u("sandbox.fileExplorerDeleteDialog.cancel"),e[23]=u,e[24]=L):L=e[24];let T;e[25]!==l||e[26]!==L?(T=r.jsx(zn,{disabled:l,children:L}),e[25]=l,e[26]=L,e[27]=T):T=e[27];const P=l||!s;let D;e[28]!==s||e[29]!==y?(D=q=>{q.preventDefault(),s&&y(s)},e[28]=s,e[29]=y,e[30]=D):D=e[30];let S;e[31]!==u?(S=u("sandbox.fileExplorerDeleteDialog.delete"),e[31]=u,e[32]=S):S=e[32];let N;e[33]!==P||e[34]!==D||e[35]!==S?(N=r.jsx($n,{disabled:P,onClick:D,children:S}),e[33]=P,e[34]=D,e[35]=S,e[36]=N):N=e[36];let M;e[37]!==T||e[38]!==N?(M=r.jsxs(_n,{children:[T,N]}),e[37]=T,e[38]=N,e[39]=M):M=e[39];let j;e[40]!==z||e[41]!==M?(j=r.jsxs(Gn,{children:[z,M]}),e[40]=z,e[41]=M,e[42]=j):j=e[42];let F;return e[43]!==m||e[44]!==E||e[45]!==j?(F=r.jsx(Bn,{open:E,onOpenChange:m,children:j}),e[43]=m,e[44]=E,e[45]=j,e[46]=F):F=e[46],F}var Ge="ContextMenu",[cr]=cn(Ge,[dt]),Z=dt(),[dr,ut]=cr(Ge),ft=i=>{const{__scopeContextMenu:e,children:s,onOpenChange:a,dir:l,modal:m=!0}=i,[y,u]=d.useState(!1),b=Z(e),E=an(a),h=d.useCallback(x=>{u(x),E(x)},[E]);return r.jsx(dr,{scope:e,open:y,onOpenChange:h,modal:m,children:r.jsx(ln,{...b,dir:l,open:y,onOpenChange:h,modal:m,children:s})})};ft.displayName=Ge;var pt="ContextMenuTrigger",mt=d.forwardRef((i,e)=>{const{__scopeContextMenu:s,disabled:a=!1,...l}=i,m=ut(pt,s),y=Z(s),u=d.useRef({x:0,y:0}),b=d.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...u.current})}),E=d.useRef(0),h=d.useCallback(()=>window.clearTimeout(E.current),[]),x=f=>{u.current={x:f.clientX,y:f.clientY},m.onOpenChange(!0)};return d.useEffect(()=>h,[h]),d.useEffect(()=>{a&&h()},[a,h]),r.jsxs(r.Fragment,{children:[r.jsx(en,{...y,virtualRef:b}),r.jsx(tn.span,{"data-state":m.open?"open":"closed","data-disabled":a?"":void 0,...l,ref:e,style:{WebkitTouchCallout:"none",...i.style},onContextMenu:a?i.onContextMenu:ge(i.onContextMenu,f=>{h(),x(f),f.preventDefault()}),onPointerDown:a?i.onPointerDown:ge(i.onPointerDown,Me(f=>{h(),E.current=window.setTimeout(()=>x(f),700)})),onPointerMove:a?i.onPointerMove:ge(i.onPointerMove,Me(h)),onPointerCancel:a?i.onPointerCancel:ge(i.onPointerCancel,Me(h)),onPointerUp:a?i.onPointerUp:ge(i.onPointerUp,Me(h))})]})});mt.displayName=pt;var ur="ContextMenuPortal",xt=i=>{const{__scopeContextMenu:e,...s}=i,a=Z(e);return r.jsx(on,{...a,...s})};xt.displayName=ur;var ht="ContextMenuContent",gt=d.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=ut(ht,s),m=Z(s),y=d.useRef(!1);return r.jsx(sn,{...m,...a,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:u=>{i.onCloseAutoFocus?.(u),!u.defaultPrevented&&y.current&&u.preventDefault(),y.current=!1},onInteractOutside:u=>{i.onInteractOutside?.(u),!u.defaultPrevented&&!l.modal&&(y.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)"}})});gt.displayName=ht;var fr="ContextMenuGroup",pr=d.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=Z(s);return r.jsx(dn,{...l,...a,ref:e})});pr.displayName=fr;var mr="ContextMenuLabel",xr=d.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=Z(s);return r.jsx(un,{...l,...a,ref:e})});xr.displayName=mr;var hr="ContextMenuItem",bt=d.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=Z(s);return r.jsx(nn,{...l,...a,ref:e})});bt.displayName=hr;var gr="ContextMenuCheckboxItem",br=d.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=Z(s);return r.jsx(fn,{...l,...a,ref:e})});br.displayName=gr;var yr="ContextMenuRadioGroup",vr=d.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=Z(s);return r.jsx(pn,{...l,...a,ref:e})});vr.displayName=yr;var Cr="ContextMenuRadioItem",wr=d.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=Z(s);return r.jsx(mn,{...l,...a,ref:e})});wr.displayName=Cr;var Nr="ContextMenuItemIndicator",jr=d.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=Z(s);return r.jsx(xn,{...l,...a,ref:e})});jr.displayName=Nr;var Er="ContextMenuSeparator",yt=d.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=Z(s);return r.jsx(rn,{...l,...a,ref:e})});yt.displayName=Er;var Sr="ContextMenuArrow",Dr=d.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=Z(s);return r.jsx(hn,{...l,...a,ref:e})});Dr.displayName=Sr;var Mr="ContextMenuSubTrigger",Rr=d.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=Z(s);return r.jsx(gn,{...l,...a,ref:e})});Rr.displayName=Mr;var Tr="ContextMenuSubContent",Pr=d.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=Z(s);return r.jsx(bn,{...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)"}})});Pr.displayName=Tr;function Me(i){return e=>e.pointerType!=="mouse"?i(e):void 0}var kr=ft,Fr=mt,Ar=xt,Lr=gt,Or=bt,Ir=yt;function Kr(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(kr,{"data-slot":"context-menu",...s}),e[2]=s,e[3]=a):a=e[3],a}function zr(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(Fr,{"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(Ar,{children:r.jsx(Lr,{"data-slot":"context-menu-content",translate:"no",className:l,...a})}),e[5]=a,e[6]=l,e[7]=m):m=e[7],m}function fe(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 y=m===void 0?"default":m;let u;e[5]!==s?(u=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]=u):u=e[6];let b;return e[7]!==a||e[8]!==l||e[9]!==u||e[10]!==y?(b=r.jsx(Or,{"data-slot":"context-menu-item","data-inset":a,"data-variant":y,className:u,...l}),e[7]=a,e[8]=l,e[9]=u,e[10]=y,e[11]=b):b=e[11],b}function at(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(Ir,{"data-slot":"context-menu-separator",className:l,...a}),e[5]=a,e[6]=l,e[7]=m):m=e[7],m}const _r="#d9a441";function Gr(i){const e=se.c(63),{node:s,depth:a,isExpanded:l,isSelected:m,isLoading:y,fileVisual:u,onOpen:b,onSelect:E,onNewFile:h,onNewFolder:x,onCopyPath:f,onCopyRelativePath:O,onRename:X,onDelete:I}=i,C=y===void 0?!1:y,g=Te(),R=s.kind==="directory",{Icon:z,color:L}=u,T=m&&"bg-accent";let P;e[0]!==T?(P=le("flex w-full items-center gap-1.5 px-2 py-1.5 text-left text-[13px] hover:bg-accent transition-colors",T),e[0]=T,e[1]=P):P=e[1];const D=`${a*14+8}px`;let S;e[2]!==D?(S={paddingLeft:D},e[2]=D,e[3]=S):S=e[3];let N;e[4]!==b||e[5]!==E?(N=()=>{E(),b()},e[4]=b,e[5]=E,e[6]=N):N=e[6];let M;e[7]!==z||e[8]!==L||e[9]!==R||e[10]!==l||e[11]!==C?(M=R?r.jsxs(r.Fragment,{children:[C?r.jsx(pe,{className:"size-3.5 shrink-0 text-muted-foreground"}):l?r.jsx(Vn,{size:14,className:"shrink-0 text-muted-foreground"}):r.jsx(Un,{size:14,className:"shrink-0 text-muted-foreground"}),r.jsx(qn,{size:16,className:"shrink-0",style:{color:_r}})]}):r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"w-3.5 shrink-0"}),r.jsx(z,{size:16,className:"shrink-0",style:{color:L}})]}),e[7]=z,e[8]=L,e[9]=R,e[10]=l,e[11]=C,e[12]=M):M=e[12];let j;e[13]!==s.name?(j=r.jsx("span",{className:"truncate",children:s.name}),e[13]=s.name,e[14]=j):j=e[14];let F;e[15]!==P||e[16]!==S||e[17]!==N||e[18]!==M||e[19]!==j?(F=r.jsx(zr,{asChild:!0,children:r.jsxs("button",{type:"button",className:P,style:S,onClick:N,children:[M,j]})}),e[15]=P,e[16]=S,e[17]=N,e[18]=M,e[19]=j,e[20]=F):F=e[20];let q;e[21]!==g?(q=g("sandbox.fileTreeRow.newFile"),e[21]=g,e[22]=q):q=e[22];let $;e[23]!==h||e[24]!==q?($=r.jsx(fe,{onSelect:h,children:q}),e[23]=h,e[24]=q,e[25]=$):$=e[25];let Y;e[26]!==g?(Y=g("sandbox.fileTreeRow.newFolder"),e[26]=g,e[27]=Y):Y=e[27];let J;e[28]!==x||e[29]!==Y?(J=r.jsx(fe,{onSelect:x,children:Y}),e[28]=x,e[29]=Y,e[30]=J):J=e[30];let ee;e[31]===Symbol.for("react.memo_cache_sentinel")?(ee=r.jsx(at,{}),e[31]=ee):ee=e[31];let _;e[32]!==g?(_=g("sandbox.fileTreeRow.copyPath"),e[32]=g,e[33]=_):_=e[33];let A;e[34]!==f||e[35]!==_?(A=r.jsx(fe,{onSelect:f,children:_}),e[34]=f,e[35]=_,e[36]=A):A=e[36];let H;e[37]!==g?(H=g("sandbox.fileTreeRow.copyRelativePath"),e[37]=g,e[38]=H):H=e[38];let K;e[39]!==O||e[40]!==H?(K=r.jsx(fe,{onSelect:O,children:H}),e[39]=O,e[40]=H,e[41]=K):K=e[41];let W;e[42]===Symbol.for("react.memo_cache_sentinel")?(W=r.jsx(at,{}),e[42]=W):W=e[42];let G;e[43]!==g?(G=g("sandbox.fileTreeRow.rename"),e[43]=g,e[44]=G):G=e[44];let k;e[45]!==X||e[46]!==G?(k=r.jsx(fe,{onSelect:X,children:G}),e[45]=X,e[46]=G,e[47]=k):k=e[47];let B;e[48]!==g?(B=g("sandbox.fileTreeRow.delete"),e[48]=g,e[49]=B):B=e[49];let V;e[50]!==I||e[51]!==B?(V=r.jsx(fe,{variant:"destructive",onSelect:I,children:B}),e[50]=I,e[51]=B,e[52]=V):V=e[52];let Q;e[53]!==$||e[54]!==J||e[55]!==A||e[56]!==K||e[57]!==k||e[58]!==V?(Q=r.jsxs($r,{className:"w-52",children:[$,J,ee,A,K,W,k,V]}),e[53]=$,e[54]=J,e[55]=A,e[56]=K,e[57]=k,e[58]=V,e[59]=Q):Q=e[59];let ne;return e[60]!==Q||e[61]!==F?(ne=r.jsxs(Kr,{children:[F,Q]}),e[60]=Q,e[61]=F,e[62]=ne):ne=e[62],ne}const lt=200,Br=2,Vr=250,ct=200;function Ur(i,e){return Rn(i,e)}function qr(i){const e=se.c(9),{text:s,query:a}=i;let l,m,y;if(e[0]!==a||e[1]!==s){const{leadingEllipsis:b,segments:E}=Zn(s,a);l="truncate font-mono text-muted-foreground",m=b&&r.jsx("span",{className:"text-muted-foreground/50",children:"…"}),y=E.map(Hr),e[0]=a,e[1]=s,e[2]=l,e[3]=m,e[4]=y}else l=e[2],m=e[3],y=e[4];let u;return e[5]!==l||e[6]!==m||e[7]!==y?(u=r.jsxs("span",{className:l,children:[m,y]}),e[5]=l,e[6]=m,e[7]=y,e[8]=u):u=e[8],u}function Hr(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 Xi({orgSlug:i,virtualMcpId:e,branch:s,threadId:a,openPath:l}){const m={orgSlug:i,virtualMcpId:e,branch:s,threadId:a},[y,u]=d.useState({files:[],directories:[],truncated:!1}),{files:b,directories:E}=y,[h,x]=d.useState(new Set),[f,O]=d.useState(null),[X,I]=d.useState(null),[C,g]=d.useState([]),[R,z]=d.useState(""),[L,T]=d.useState(null),[P,D]=d.useState(null),[S,N]=d.useState(!1),[M,j]=d.useState(!1),[F,q]=d.useState(!1),[$,Y]=d.useState(!1),[,J]=d.useState(new Set),[ee,_]=d.useState(new Set),A=d.useRef(0),H=d.useRef(null),K=d.useRef(new Set),W=d.useRef(new Map),G=d.useRef(null),k=d.useRef(0),B=d.useRef(null),V=d.useRef(null),Q=d.useRef(null);function ne(t){J(n=>{const o=typeof t=="function"?t(n):t;return K.current=o,o})}const[me,de]=d.useState(new Map),Pe=d.useRef(null),[ie,be]=d.useState(null),{sendMessage:vt}=En(),{openSidePanel:Ct}=Dn(),ye=yn(),[U,oe]=d.useState(null),[ke,Fe]=d.useState(null),[ve,Ce]=d.useState(!1);async function ae(t,n){const o=await fetch(Ur(m,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 we(){ye.invalidateQueries({queryKey:st(m)})}function Be(t,n,o){navigator.clipboard.writeText(o).then(()=>te.success(t("sandbox.fileExplorer.textCopied",{label:n})),()=>te.error(t("sandbox.fileExplorer.failedToCopyText",{label:n.toLowerCase()})))}function wt(t){const n=or(t);if(!n)return;const o=`${i}/${e}/${s}`;ye.setQueryData(ot.decofile(o),c=>{if(!c)return c;const{[n]:p,...v}=c;return v}),ye.invalidateQueries({queryKey:ot.liveMeta(i,e,s)})}function Nt(t){const n=t.kind==="file"?[t.path]:b.filter(o=>o.startsWith(".deco/blocks/")).map(o=>Ee(o)).filter(o=>o===t.path||o.startsWith(`${t.path}/`));for(const o of n)wt(o)}function jt(t){const n=Ee(t);return C.filter(o=>{if(o!==n&&!o.startsWith(`${n}/`))return!1;const c=me.get(o);return!!(c?.loaded&&c.editorValue!==c.savedContent)})}function Ve(t){g(n=>n.map(o=>t(o)).filter(o=>o!==null)),O(n=>n&&t(n)),de(n=>{const o=new Map;for(const[c,p]of n){const v=t(c);v&&o.set(v,p)}return o}),I(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 Et(t){const n=Ee(t);I(o=>o&&(o.path===n||o.path.startsWith(`${n}/`)?null:o)),Ve(o=>o===n||o.startsWith(`${n}/`)?null:o)}async function St(t,n){if(!U)return;const o=De(U.parentDir,n);if(_e(o,b,E))throw new Error(t("sandbox.fileExplorer.fileAlreadyExists",{name:n}));await ae("write",{path:re(o),content:""}),await xe(),await we(),oe(null),he(o)}async function Dt(t,n){if(!U)return;const o=De(U.parentDir,n);if(_e(o,b,E))throw new Error(t("sandbox.fileExplorer.fileAlreadyExists",{name:n}));const c=re(o);await ae("mkdir",{path:c}),u(p=>({...p,directories:p.directories.includes(c)?p.directories:[...p.directories,c]})),await xe(),await we(),oe(null),x(p=>{const v=new Set(p);for(const ce of ze(o))v.add(ce);return v.add(o),v}),I({name:n,path:o,kind:"directory",children:[]})}async function Mt(t,n){if(!U)return;const o=U.node.path,c=Se(o),p=De(c,n);if(p===o){oe(null);return}if(_e(p,b,E))throw new Error(t("sandbox.fileExplorer.fileAlreadyExists",{name:n}));await ae("rename",{from:re(o),to:re(p)}),Ve(v=>v===o?p:v.startsWith(`${o}/`)?De(p,v.slice(o.length+1)):v),await xe(),await we(),oe(null)}async function Rt(t,n){Ce(!0);try{await ae("unlink",{path:re(n.path),recursive:n.kind==="directory"}),Nt(n),Et(n.path),await xe(),await we(),Fe(null),te.success(t("sandbox.fileExplorer.fileDeleted",{name:n.name}))}catch(o){te.error(o instanceof Error?o.message:t("sandbox.fileExplorer.deleteFailed"))}finally{Ce(!1)}}async function Tt(t,n){const o=tr(n);if(o){te.error(o);return}Ce(!0);try{U?.mode==="new-file"?(await St(t,n),te.success(t("sandbox.fileExplorer.fileCreated",{name:n}))):U?.mode==="new-folder"?(await Dt(t,n),te.success(t("sandbox.fileExplorer.folderCreated",{name:n}))):U?.mode==="rename"&&(await Mt(t,n),te.success(t("sandbox.fileExplorer.renamedTo",{name:n})))}catch(c){te.error(c instanceof Error?c.message:t("sandbox.fileExplorer.operationFailed"))}finally{Ce(!1)}}const Ue=d.useRef(!1);Ue.current||(Ue.current=!0,H.current=xe());const[Pt,kt]=d.useState(null),w=Te();if(l&&l!==Pt){kt(l);const t=l;queueMicrotask(()=>{Hn(t)&&he(t)})}async function Ae(t){const n=await ae("glob",t);return{files:n.files??[],directories:n.directories??[],truncated:n.truncated}}function qe(t,n,o){if(o!==A.current)return!1;let c=!1;return u(p=>{const v=n?sr(p.files,p.directories,t,p.truncated):{files:t.files,directories:t.directories??[],truncated:!!t.truncated};return c=!!v.truncated,{files:v.files,directories:v.directories,truncated:c}}),c&&te.warning(w("sandbox.fileExplorer.fileListTruncated")),c}async function Ft(t){const n=W.current.get(t);if(n)return n;const o=A.current,c=(async()=>{const p=await Ae({pattern:"**/*",path:re(t),limit:Oe}),v=qe(p,!0,o);return!v&&o===A.current&&ne(ce=>{const Ne=new Set(ce);return Ne.add(t),Ne}),v})();W.current.set(t,c);try{return await c}finally{W.current.delete(t)}}async function He(t){if(!$e(t,K.current))return!1;_(n=>new Set(n).add(t));try{return await Ft(t)}finally{_(n=>{const o=new Set(n);return o.delete(t),o})}}async function At(t,n){const o=new Set(K.current);for(const c of ze(n)){if(!$e(c,o))continue;if(await He(c))throw new Error(t("sandbox.fileExplorer.folderListingTruncated"));o.add(c)}}async function xe(){const t=++A.current;B.current=null,V.current=null,W.current.clear(),q(!0),ne(new Set),x(new Set),_(new Set);try{const n=await Ae({pattern:"**/*",limit:Oe,maxDepth:Wn});qe(n,!1,t),Y(!0)}catch{$&&te.error(w("sandbox.fileExplorer.failedToRefreshFileTree"))}finally{q(!1)}}async function We(t){if(!me.get(t)?.loaded){de(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=er(o.content??"");de(p=>{const v=new Map(p);return v.set(t,{savedContent:c,editorValue:c,loaded:!0}),v})}catch{}}}function Lt(){k.current++,T(null),D(null),N(!1),j(!1)}async function Ot(){const t=A.current,n=B.current;if(n&&n.generation===t)return n.files;const o=V.current;if(o&&o.generation===t)return o.promise;const c=(async()=>{const p=await Ae({pattern:"**/*",limit:Oe});return A.current===t&&(B.current={generation:t,files:p.files}),p.files})();V.current={generation:t,promise:c};try{return await c}finally{V.current?.generation===t&&(V.current=null)}}async function It(t,n){try{const o=await Ot();if(n!==k.current)return;T(nr(o,t,ct))}catch{if(n!==k.current)return;T([])}}async function Kt(t,n){N(!0);try{const o=await ae("grep",{pattern:t,output_mode:"content",ignore_case:!0,fixed_strings:!0,limit:lt});if(n!==k.current)return;D(rr(o.results??"")),j((o.matchCount??0)>=lt)}catch{if(n!==k.current)return;D([]),j(!1)}finally{n===k.current&&N(!1)}}function zt(t){const n=t.trim(),o=++k.current;It(n,o),n.length<Br?(D(null),N(!1),j(!1)):Kt(n,o)}function $t(t){if(z(t),G.current&&clearTimeout(G.current),!t.trim()){Lt();return}G.current=setTimeout(()=>{zt(t)},Vr)}function Qe(t){const n=Q.current;if(!n||n.path!==f)return;Q.current=null;const o=Math.max(1,n.line);t.revealLineInCenter(o),t.setPosition({lineNumber:o,column:1}),t.focus()}function _t(t){Q.current={path:t.path,line:t.line};const n=f===t.path&&me.get(t.path)?.loaded;he(t.path),n&&Pe.current&&Qe(Pe.current)}async function Gt(t,n){try{await ae("write",{path:re(t),content:n}),je("file saved via sandbox /write",{path:t}),ye.invalidateQueries({queryKey:st(m)});try{const o=await Mn(m);je("git status after save",o)}catch(o){je("git status after save failed",{path:t,error:o instanceof Error?o.message:String(o)})}de(o=>{const c=new Map(o),p=c.get(t);return p&&c.set(t,{...p,savedContent:n}),c})}catch(o){je("file save failed",{path:t,error:o instanceof Error?o.message:String(o)})}}function Bt(t){O(t),I({name:t.split("/").pop()??t,path:t,kind:"file",children:[]}),be(null),C.includes(t)||g(n=>[...n,t]),We(t)}function Vt(t){g(n=>{const o=n.filter(c=>c!==t);return f===t&&O(o[o.length-1]??null),o}),de(n=>{const o=new Map(n);return o.delete(t),o})}function Xe(t){x(n=>{const o=new Set(n);return o.has(t)?o.delete(t):o.add(t),o})}async function Ut(t){if($e(t,K.current))try{if(await He(t))return}catch(n){te.error(n instanceof Error?n.message:w("sandbox.fileExplorer.failedToLoadFolder"));return}Xe(t)}async function qt(t,n){if(n){Xe(t);return}await Ut(t)}async function Ht(t){await H.current,await At(w,t);const n=ze(t);x(o=>{const c=new Set(o);for(const p of n)c.add(p);return c}),Bt(t)}function he(t){Ht(t).catch(n=>{te.error(n instanceof Error?n.message:w("sandbox.fileExplorer.failedToOpenFile"))})}function Wt(){return X?.kind==="directory"?X.path:X?.kind==="file"?Se(X.path):f?Se(f):"/"}function Ye(t){const n=Wt();oe({mode:t,parentDir:n,node:{name:"",path:n,kind:"directory",children:[]}})}const Qt=Qn(b,E),Je=Xn(Qt,h),Le=L?.length??0,Ze=Yn(P??[]),et=P?.length??0,ue=f?me.get(f):null,Xt=ue?.loaded&&ue.editorValue!==ue.savedContent,Yt=ke?jt(ke.path):[],Jt=(t,n)=>{Pe.current=t,Qe(t),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyS,async()=>{if(!f)return;const o=t.getValue();await Gt(f,o)}),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyK,()=>{const o=t.getSelection(),c=t.getModel();if(!o||!c||!f)return;const p=c.getValueInRange(o);be({filePath:f,lineStart:o.startLineNumber,lineEnd:o.endLineNumber,selectedCode:p})})};function Zt(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=Ke(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."),Ct(),vt({parts:[{type:"text",text:n.join(`
|
|
2
2
|
`)}]}),be(null)}return F&&!$?r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(pe,{className:"size-5 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:R,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(tt,{children:[r.jsx(nt,{asChild:!0,children:r.jsx(Re,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":w("sandbox.fileExplorer.newFileLabel"),onClick:()=>Ye("new-file"),children:r.jsx(Cn,{size:14})})}),r.jsx(rt,{side:"bottom",children:w("sandbox.fileExplorer.newFile")})]}),r.jsxs(tt,{children:[r.jsx(nt,{asChild:!0,children:r.jsx(Re,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":w("sandbox.fileExplorer.newFolderLabel"),onClick:()=>Ye("new-folder"),children:r.jsx(wn,{size:14})})}),r.jsx(rt,{side:"bottom",children:w("sandbox.fileExplorer.newFolder")})]})]}),r.jsx(jn,{className:"flex-1",children:r.jsxs("div",{className:"py-1",children:[!R&&Je.map(t=>{const{node:n,depth:o}=t,c=n.kind==="directory",p=h.has(n.path),v=X?.path===n.path,ce=Jn(n.path,n.kind),Ne=c&&ee.has(n.path);return r.jsx(Gr,{node:n,depth:o,isExpanded:p,isSelected:v,isLoading:Ne,fileVisual:Ie(n.name),onSelect:()=>I(n),onOpen:()=>{c?qt(n.path,p):he(n.path)},onNewFile:()=>oe({mode:"new-file",node:n,parentDir:ce}),onNewFolder:()=>oe({mode:"new-folder",node:n,parentDir:ce}),onCopyPath:()=>Be(w,"Path",Ee(n.path)),onCopyRelativePath:()=>Be(w,"Relative path",re(n.path)),onRename:()=>oe({mode:"rename",node:n,parentDir:ce}),onDelete:()=>Fe(n)},n.path)}),!R&&$&&Je.length===0&&r.jsx("div",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:w("sandbox.fileExplorer.noFilesFound")}),R&&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")}),Le>0&&r.jsxs("span",{className:"normal-case tracking-normal text-muted-foreground/70",children:[Le,Le>=ct?"+":""]})]}),L!==null&&L.length===0&&r.jsx("div",{className:"px-3 py-1 text-xs text-muted-foreground",children:w("sandbox.fileExplorer.noFileNamesMatch")}),L?.map(t=>{const n=t.split("/").pop()??t,o=Se(t),{Icon:c,color:p}=Ie(n),v=f===t;return r.jsxs("button",{type:"button",onClick:()=>he(t),title:t,className:le("flex w-full items-center gap-1.5 px-3 py-1 text-left text-xs hover:bg-accent",v&&"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)})]}),R&&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")}),et>0&&r.jsxs("span",{className:"text-muted-foreground/70 normal-case tracking-normal",children:[et,M?"+":""]}),S&&r.jsx(pe,{className:"size-[10px]"})]}),!S&&P!==null&&Ze.length===0&&r.jsx("div",{className:"px-3 py-1 text-xs text-muted-foreground",children:w("sandbox.fileExplorer.noMatchesInFileContents")}),Ze.map(t=>{const n=t.path.split("/").pop()??t.path,{Icon:o,color:c}=Ie(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:()=>_t(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(qr,{text:p.text,query:R})]},`${t.path}:${p.line}`))]},t.path)})]})]})})]}),r.jsxs("div",{className:"relative flex-1 flex flex-col overflow-hidden",children:[C.length>0&&r.jsx("div",{className:"flex items-center border-b overflow-x-auto shrink-0",children:C.map(t=>{const n=me.get(t),o=n?.loaded&&n.editorValue!==n.savedContent,c=f===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:()=>{O(t),We(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:v=>{v.stopPropagation(),Vt(t)},children:r.jsx(Nn,{size:12})})]},t)})}),ie&&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()&&Zt(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"&&be(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:f&&ue?.loaded?r.jsx(Sn,{language:Ke(f),theme:document.documentElement.classList.contains("dark")?"vs-dark":"light",value:ue.editorValue,path:f,onChange:t=>{const n=f;n&&de(o=>{const c=new Map(o),p=c.get(n);return p&&c.set(n,{...p,editorValue:t??""}),c})},onMount:Jt,loading:r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(pe,{className:"size-5 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}}},f):f&&!ue?.loaded?r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(pe,{className:"size-5 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")})}),f&&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:f}),r.jsxs("span",{children:[w(Xt?"sandbox.fileExplorer.modified":"sandbox.fileExplorer.saved")," ","· ",Ke(f)]})]})]}),r.jsx(ar,{open:U!==null,mode:U?.mode??"new-file",initialName:U?.mode==="rename"?U.node.name:"",parentLabel:U&&U.mode!=="rename"?U.parentDir==="/"?"/":re(U.parentDir):void 0,isPending:ve,onSubmit:t=>Tt(w,t),onOpenChange:t=>{!t&&!ve&&oe(null)}}),r.jsx(lr,{deleteTarget:ke,deleteDirtyPaths:Yt,fsActionPending:ve,onOpenChange:t=>{!t&&!ve&&Fe(null)},onConfirm:t=>{Rt(w,t)}})]})}export{Xi as FileExplorer};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as g,j as o}from"./index-
|
|
1
|
+
import{c as g,j as o}from"./index-Cq8Pvay3.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,2 +1,2 @@
|
|
|
1
|
-
import{c as m,G as x,K as y,m as I,n as R,e as P,r as A,j as g}from"./index-
|
|
1
|
+
import{c as m,G as x,K as y,m as I,n as R,e as P,r as A,j as g}from"./index-Cq8Pvay3.js";import{s as D}from"./Eye-C7eDeC1B.js";function nt(s){return s.contentHash??`${s.size}-${s.updatedAt}`}function S(s,t,e,n){const r=new URLSearchParams(n).toString();return`/api/${encodeURIComponent(s)}/fs/${encodeURIComponent(t)}/${e}${r?`?${r}`:""}`}async function F(s,t,e){const n=await fetch(s,t);if(n.ok||e?.allow404&&n.status===404)return n;let r="";try{r=(await n.json()).error??""}catch{}throw new Error(r||`HTTP ${n.status}`)}function rt(s,t){const e=m.c(15),{org:n}=x();let r;e[0]!==n.id||e[1]!==t||e[2]!==s?(r=y.orgFsList(n.id,s,t),e[0]=n.id,e[1]=t,e[2]=s,e[3]=r):r=e[3];let i;e[4]!==n.id||e[5]!==s?(i=(c,l)=>l?.queryKey[1]===n.id&&l.queryKey[2]===s?c:void 0,e[4]=n.id,e[5]=s,e[6]=i):i=e[6];let a;e[7]!==n.slug||e[8]!==t||e[9]!==s?(a=async()=>(await(await F(S(n.slug,s,"list",{path:t}))).json()).entries.toSorted(M),e[7]=n.slug,e[8]=t,e[9]=s,e[10]=a):a=e[10];let o;return e[11]!==r||e[12]!==i||e[13]!==a?(o={queryKey:r,placeholderData:i,queryFn:a},e[11]=r,e[12]=i,e[13]=a,e[14]=o):o=e[14],I(o)}function M(s,t){return s.kind!==t.kind?s.kind==="dir"?-1:1:s.path.localeCompare(t.path)}async function B(s,t,e){const n=await F(S(s,t,"stat",{path:e}),void 0,{allow404:!0});return n.status===404?null:(await n.json()).entry}function it(s,t,e){const n=m.c(15),{org:r}=x();let i;n[0]!==r.id||n[1]!==t||n[2]!==s?(i=y.orgFsStat(r.id,s??"",t),n[0]=r.id,n[1]=t,n[2]=s,n[3]=i):i=n[3];const a=s!==null;let o;n[4]!==e?(o=e?.refetchIntervalWhenAbsent?d=>d.state.data?!1:e.refetchIntervalWhenAbsent??!1:void 0,n[4]=e,n[5]=o):o=n[5];let c;n[6]!==r.slug||n[7]!==t||n[8]!==s?(c=()=>B(r.slug,s??"",t),n[6]=r.slug,n[7]=t,n[8]=s,n[9]=c):c=n[9];let l;return n[10]!==i||n[11]!==a||n[12]!==o||n[13]!==c?(l={queryKey:i,enabled:a,refetchInterval:o,queryFn:c},n[10]=i,n[11]=a,n[12]=o,n[13]=c,n[14]=l):l=n[14],I(l)}function ot(s){const t=m.c(9),{org:e}=x();let n;t[0]!==e.id||t[1]!==s?(n=y.orgFsUsage(e.id,s),t[0]=e.id,t[1]=s,t[2]=n):n=t[2];let r;t[3]!==e.slug||t[4]!==s?(r=async()=>await(await F(S(e.slug,s,"usage"))).json(),t[3]=e.slug,t[4]=s,t[5]=r):r=t[5];let i;return t[6]!==n||t[7]!==r?(i={queryKey:n,queryFn:r},t[6]=n,t[7]=r,t[8]=i):i=t[8],I(i)}function at(s,t){const e=m.c(9),n=s===void 0?60:s,{org:r}=x();let i;e[0]!==r.id?(i=y.orgFsRecent(r.id),e[0]=r.id,e[1]=i):i=e[1];const a=t?.enabled;let o;e[2]!==n||e[3]!==r.slug?(o=async()=>(await(await F(`/api/${encodeURIComponent(r.slug)}/fs/recent?limit=${n}`)).json()).entries,e[2]=n,e[3]=r.slug,e[4]=o):o=e[4];let c;return e[5]!==i||e[6]!==a||e[7]!==o?(c={queryKey:i,enabled:a,queryFn:o},e[5]=i,e[6]=a,e[7]=o,e[8]=c):c=e[8],I(c)}const Q=50;function lt(s,t){const e=m.c(16),{org:n}=x();let r;e[0]!==n.id||e[1]!==s||e[2]!==t?.prefix||e[3]!==t?.volume?(r=y.orgFsSearch(n.id,s,t?.volume??"",t?.prefix??""),e[0]=n.id,e[1]=s,e[2]=t?.prefix,e[3]=t?.volume,e[4]=r):r=e[4];const i=s.length>0;let a;e[5]!==n.id?(a=(l,d)=>d?.queryKey[1]===n.id?l:void 0,e[5]=n.id,e[6]=a):a=e[6];let o;e[7]!==n.slug||e[8]!==s||e[9]!==t?(o=async()=>{const l=new URLSearchParams({q:s,limit:String(Q)});return t&&(l.set("volume",t.volume),t.prefix&&l.set("prefix",t.prefix)),(await(await F(`/api/${encodeURIComponent(n.slug)}/fs/search?${l}`)).json()).entries},e[7]=n.slug,e[8]=s,e[9]=t,e[10]=o):o=e[10];let c;return e[11]!==r||e[12]!==i||e[13]!==a||e[14]!==o?(c={queryKey:r,enabled:i,placeholderData:a,queryFn:o},e[11]=r,e[12]=i,e[13]=a,e[14]=o,e[15]=c):c=e[15],I(c)}function ct(s){const t=m.c(8),{org:e}=x();let n;t[0]!==e.id?(n=y.orgFsSkills(e.id),t[0]=e.id,t[1]=n):n=t[1];const r=s?.enabled;let i;t[2]!==e.slug?(i=async()=>{const o=await F(`/api/${encodeURIComponent(e.slug)}/fs/skills`),{skills:c}=await o.json();return c.map(N)},t[2]=e.slug,t[3]=i):i=t[3];let a;return t[4]!==n||t[5]!==r||t[6]!==i?(a={queryKey:n,enabled:r,queryFn:i},t[4]=n,t[5]=r,t[6]=i,t[7]=a):a=t[7],I(a)}function N(s){return{volume:s.volume,path:s.path}}async function W(s){const t=await F(`/api/${encodeURIComponent(s)}/fs/skills`),{skills:e}=await t.json();return e}function ft(){const s=m.c(7),{org:t}=x();let e;s[0]!==t.id?(e=y.slashSkills(t.id),s[0]=t.id,s[1]=e):e=s[1];let n;s[2]!==t.slug?(n=()=>W(t.slug),s[2]=t.slug,s[3]=n):n=s[3];let r;return s[4]!==e||s[5]!==n?(r={queryKey:e,queryFn:n,staleTime:6e4},s[4]=e,s[5]=n,s[6]=r):r=s[6],I(r)}async function H(s,t,e){return(await F(S(s,t,"read",{path:e}))).text()}function dt(s,t){const e=m.c(8);let n;e[0]!==s?(n=y.fileText(s),e[0]=s,e[1]=n):n=e[1];const r=t?.enabled!==!1&&s!=="";let i;e[2]!==s?(i=async()=>{const o=await fetch(s,{credentials:"include"});return o.ok?await o.text():null},e[2]=s,e[3]=i):i=e[3];let a;return e[4]!==n||e[5]!==r||e[6]!==i?(a={queryKey:n,enabled:r,staleTime:6e4,retry:!1,queryFn:i},e[4]=n,e[5]=r,e[6]=i,e[7]=a):a=e[7],I(a)}const X=new Set(["md","mdx","markdown","txt","text"]),G=25,V=64*1024,z=256*1024,Y=4;function J(s){const t=s.lastIndexOf(".");return t===-1?!1:X.has(s.slice(t+1).toLowerCase())}async function ut(s,t,e){const n=e?`${e}/`:"",r=f=>f.startsWith(n)?f.slice(n.length):f,i=[],a=[],o=[{path:e,depth:0}];for(;o.length>0;){const f=o.shift();if(!f)break;let h;try{h=(await(await F(S(s,t,"list",{path:f.path}))).json()).entries}catch{continue}for(const u of[...h].sort((b,w)=>b.path.localeCompare(w.path))){if(u.kind==="dir"){f.depth<Y&&o.push({path:u.path,depth:f.depth+1});continue}J(u.path)&&u.size<=V&&i.length<G?i.push(u.path):a.push(r(u.path))}}const c=await Promise.all(i.map(f=>H(s,t,f).catch(()=>null))),l=[];let d=0;return i.forEach((f,h)=>{const u=c[h];if(u==null||d+u.length>z){a.push(r(f));return}d+=u.length,l.push({relPath:r(f),content:u})}),l.sort((f,h)=>f.relPath==="SKILL.md"?-1:h.relPath==="SKILL.md"?1:f.relPath.localeCompare(h.relPath)),a.sort(),{files:l,omittedPaths:a}}function ht(){const s=m.c(7),{org:t}=x();let e;s[0]!==t.id?(e=y.orgFsPublicSets(t.id),s[0]=t.id,s[1]=e):e=s[1];let n;s[2]!==t.slug?(n=async()=>(await(await F(`/api/${encodeURIComponent(t.slug)}/fs/public-sets`)).json()).sets,s[2]=t.slug,s[3]=n):n=s[3];let r;return s[4]!==e||s[5]!==n?(r={queryKey:e,staleTime:3e5,queryFn:n},s[4]=e,s[5]=n,s[6]=r):r=s[6],I(r)}function gt(s){const t=m.c(3),{org:e}=x();let n;return t[0]!==e.slug||t[1]!==s?(n=r=>S(e.slug,s,"read",{path:r}),t[0]=e.slug,t[1]=s,t[2]=n):n=t[2],n}function yt(){const s=m.c(2),{org:t}=x();let e;return s[0]!==t.slug?(e=(n,r)=>S(t.slug,n,"read",{path:r}),s[0]=t.slug,s[1]=e):e=s[1],e}function pt(s){const t=m.c(3),{org:e}=x();let n;return t[0]!==e||t[1]!==s?(n={mutationFn:async r=>(await(await F(S(e.slug,s,"file",{path:r.path}),{method:"PUT",headers:{"content-type":r.contentType??"text/html; charset=utf-8"},body:r.body})).json()).entry},t[0]=e,t[1]=s,t[2]=n):n=t[2],P(n)}function Ft(s){const t=m.c(18),{org:e}=x(),n=R();let r;t[0]!==e||t[1]!==s?(r=async l=>(await(await F(S(e.slug,s,"public",{path:l.path}),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({mode:l.mode,password:l.password})})).json()).entry,t[0]=e,t[1]=s,t[2]=r):r=t[2];let i;t[3]!==e||t[4]!==n||t[5]!==s?(i=async l=>{const d=y.orgFsStat(e.id,s,l.path);await n.cancelQueries({queryKey:d});const f=n.getQueryData(d),h=l.mode!=="private";return n.setQueryData(d,u=>u&&{...u,readPublic:h,effectivePublic:h,shareMode:l.mode}),{key:d,previous:f}},t[3]=e,t[4]=n,t[5]=s,t[6]=i):i=t[6];let a;t[7]!==n?(a=(l,d,f)=>{f&&n.setQueryData(f.key,f.previous)},t[7]=n,t[8]=a):a=t[8];let o;t[9]!==e||t[10]!==n||t[11]!==s?(o=(l,d,f)=>{n.invalidateQueries({queryKey:y.orgFsStat(e.id,s,f.path)}),n.invalidateQueries({queryKey:y.orgFsVolume(e.id,s)}),n.invalidateQueries({queryKey:y.orgFsRecent(e.id)}),n.invalidateQueries({queryKey:y.orgFsSearchRoot(e.id)})},t[9]=e,t[10]=n,t[11]=s,t[12]=o):o=t[12];let c;return t[13]!==r||t[14]!==i||t[15]!==a||t[16]!==o?(c={mutationFn:r,onMutate:i,onError:a,onSettled:o},t[13]=r,t[14]=i,t[15]=a,t[16]=o,t[17]=c):c=t[17],P(c)}function mt(s){const t=m.c(33),{org:e}=x(),n=R();let r;t[0]!==e||t[1]!==n||t[2]!==s?(r=()=>{n.invalidateQueries({queryKey:y.orgFsVolume(e.id,s)}),n.invalidateQueries({queryKey:y.orgFsRecent(e.id)}),n.invalidateQueries({queryKey:y.orgFsSearchRoot(e.id)})},t[0]=e,t[1]=n,t[2]=s,t[3]=r):r=t[3];const i=r;let a;t[4]!==e||t[5]!==s?(a=async p=>{const C=(await Promise.allSettled(p.files.map(j=>{const q=p.dir?`${p.dir}/${j.name}`:j.name;return F(S(e.slug,s,"file",{path:q}),{method:"PUT",headers:{"content-type":j.type||"application/octet-stream"},body:j})}))).find(Z);if(C)throw C.reason},t[4]=e,t[5]=s,t[6]=a):a=t[6];let o;t[7]!==i||t[8]!==a?(o={mutationFn:a,onSettled:i},t[7]=i,t[8]=a,t[9]=o):o=t[9];const c=P(o);let l;t[10]!==e||t[11]!==s?(l=async p=>{await F(S(e.slug,s,"dir",{path:p}),{method:"POST"})},t[10]=e,t[11]=s,t[12]=l):l=t[12];let d;t[13]!==i||t[14]!==l?(d={mutationFn:l,onSuccess:i},t[13]=i,t[14]=l,t[15]=d):d=t[15];const f=P(d);let h;t[16]!==e||t[17]!==s?(h=async p=>{await F(S(e.slug,s,"file",{path:p}),{method:"DELETE"})},t[16]=e,t[17]=s,t[18]=h):h=t[18];let u;t[19]!==i||t[20]!==h?(u={mutationFn:h,onSuccess:i},t[19]=i,t[20]=h,t[21]=u):u=t[21];const b=P(u);let w;t[22]!==e||t[23]!==s?(w=async p=>{await F(S(e.slug,s,"move"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(p)})},t[22]=e,t[23]=s,t[24]=w):w=t[24];let k;t[25]!==i||t[26]!==w?(k={mutationFn:w,onSuccess:i},t[25]=i,t[26]=w,t[27]=k):k=t[27];const T=P(k);let $;return t[28]!==f||t[29]!==T||t[30]!==b||t[31]!==c?($={upload:c,mkdir:f,remove:b,move:T},t[28]=f,t[29]=T,t[30]=b,t[31]=c,t[32]=$):$=t[32],$}function Z(s){return s.status==="rejected"}function v(s){const t={};for(const e of s.split(`
|
|
2
2
|
`)){const n=e.match(/^([A-Za-z][\w-]*):\s*(.*)$/);n?.[1]&&n[2]!==void 0&&(t[n[1].toLowerCase()]=n[2].trim())}return t}function U(s){for(const t of s.split(/\n\s*\n/)){const e=t.trim();if(!(!e||e.startsWith("#")))return e.replace(/\n/g," ")}return null}function wt(s){const t=s.match(/^---\n([\s\S]*?)\n---\n?/);if(!t||t[1]===void 0)return{name:null,description:U(s),body:s};const e=v(t[1]),n=s.slice(t[0].length);return{name:e.name||null,description:e.description||U(n),body:n}}const tt={default:{backFrom:"#4D87DF",backTo:"#296FE8",frontFrom:"#72B6FA",frontTo:"#5BB1EF",stripe:"#84CDFB",glyph:"#014AC9"},system:{backFrom:"#8A94A6",backTo:"#6B7687",frontFrom:"#B6BEC9",frontTo:"#A3ADBA",stripe:"#D5DBE3",glyph:"#3D4757"}};function St(s){const t=m.c(46);let e,n,r,i;t[0]!==s?({glyph:e,readOnly:r,tone:i,...n}=s,t[0]=s,t[1]=e,t[2]=n,t[3]=r,t[4]=i):(e=t[1],n=t[2],r=t[3],i=t[4]);const o=tt[i===void 0?"default":i],c=A.useId(),l=`${c}-back`,d=`${c}-front`,f=`url(#${l})`;let h;t[5]!==f?(h=g.jsx("path",{d:"M2.53738 2.55C1.13602 2.55 0 3.68602 0 5.08738V11.535H31.931V7.65326C31.931 6.23616 30.7822 5.08738 29.3651 5.08738H14.7681L13.8775 5.02542C13.3886 4.99141 12.9197 4.81809 12.5261 4.52596L10.7726 3.22419C10.1828 2.78638 9.46784 2.55 8.73334 2.55H2.53738Z",fill:f}),t[5]=f,t[6]=h):h=t[6];const u=`url(#${d})`;let b;t[7]!==u?(b=g.jsx("rect",{y:"8.72",width:"32",height:"21",rx:"2.566",fill:u}),t[7]=u,t[8]=b):b=t[8];let w;t[9]===Symbol.for("react.memo_cache_sentinel")?(w=g.jsx("rect",{x:"0.3",y:"8.86",width:"31.4",height:"0.55",rx:"0.275",fill:"#FFFFFF",opacity:"0.25"}),t[9]=w):w=t[9];let k,T;t[10]!==o.stripe?(k=g.jsx("rect",{y:"25.81",width:"32",height:"0.552",fill:o.stripe}),T=g.jsx("rect",{y:"27.05",width:"32",height:"0.552",fill:o.stripe}),t[10]=o.stripe,t[11]=k,t[12]=T):(k=t[11],T=t[12]);let $;t[13]!==e||t[14]!==o.glyph?($=e&&g.jsx(e,{x:10.5,y:13.2,width:11,height:11,strokeWidth:2.2,style:{color:o.glyph,opacity:.55}}),t[13]=e,t[14]=o.glyph,t[15]=$):$=t[15];let p;t[16]!==r?(p=r&&g.jsxs(g.Fragment,{children:[g.jsx("circle",{cx:"25.5",cy:"25.5",r:"6.2",strokeWidth:"1",className:"fill-background stroke-border"}),g.jsx(D,{x:22.1,y:22.1,width:6.8,height:6.8,strokeWidth:2.2,className:"text-muted-foreground"})]}),t[16]=r,t[17]=p):p=t[17];let K;t[18]!==o.backFrom?(K=g.jsx("stop",{offset:"0.3",stopColor:o.backFrom}),t[18]=o.backFrom,t[19]=K):K=t[19];let C;t[20]!==o.backTo?(C=g.jsx("stop",{offset:"1",stopColor:o.backTo}),t[20]=o.backTo,t[21]=C):C=t[21];let j;t[22]!==l||t[23]!==K||t[24]!==C?(j=g.jsxs("linearGradient",{id:l,x1:"15.97",y1:"2.55",x2:"15.97",y2:"9.53",gradientUnits:"userSpaceOnUse",children:[K,C]}),t[22]=l,t[23]=K,t[24]=C,t[25]=j):j=t[25];let q;t[26]!==o.frontFrom?(q=g.jsx("stop",{stopColor:o.frontFrom}),t[26]=o.frontFrom,t[27]=q):q=t[27];let O;t[28]!==o.frontTo?(O=g.jsx("stop",{offset:"1",stopColor:o.frontTo}),t[28]=o.frontTo,t[29]=O):O=t[29];let L;t[30]!==d||t[31]!==q||t[32]!==O?(L=g.jsxs("radialGradient",{id:d,cx:"0",cy:"0",r:"10",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(1.6 0 0 2.1538 16 19.22)",children:[q,O]}),t[30]=d,t[31]=q,t[32]=O,t[33]=L):L=t[33];let E;t[34]!==j||t[35]!==L?(E=g.jsxs("defs",{children:[j,L]}),t[34]=j,t[35]=L,t[36]=E):E=t[36];let _;return t[37]!==n||t[38]!==p||t[39]!==E||t[40]!==h||t[41]!==b||t[42]!==k||t[43]!==T||t[44]!==$?(_=g.jsxs("svg",{viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",...n,children:[h,b,w,k,T,$,p,E]}),t[37]=n,t[38]=p,t[39]=E,t[40]=h,t[41]=b,t[42]=k,t[43]=T,t[44]=$,t[45]=_):_=t[45],_}export{St as F,W as a,yt as b,at as c,ct as d,gt as e,ut as f,pt as g,nt as h,Ft as i,it as j,dt as k,rt as l,lt as m,ht as n,ot as o,wt as p,ft as q,B as r,mt as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f6 as C,c as f,j as c,as as j,r as d,l as p,ca as v,f7 as b,f8 as h}from"./index-
|
|
1
|
+
import{f6 as C,c as f,j as c,as as j,r as d,l as p,ca as v,f7 as b,f8 as h}from"./index-Cq8Pvay3.js";import{L as N}from"./label-Bvpy7Oho.js";const E=C,g=d.createContext({}),M=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}=b();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 w(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 L(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(v,{"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 y(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 R(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{E as F,w as a,P as b,R as c,M as d,L as e,y as f};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ae as re,ag as X,b as U,G as ie,n as le,aq as ce,ar as ge,e as ne,o as W,t as G,K as ee,j as i,dp as se,dq as oe,dr as M,as as de,c as Y,r as J,a7 as me,M as te,cP as ue,cQ as fe,w as pe,B as he,P as $,ds as xe}from"./index-
|
|
1
|
+
import{ae as re,ag as X,b as U,G as ie,n as le,aq as ce,ar as ge,e as ne,o as W,t as G,K as ee,j as i,dp as se,dq as oe,dr as M,as as de,c as Y,r as J,a7 as me,M as te,cP as ue,cQ as fe,w as pe,B as he,P as $,ds as xe}from"./index-Cq8Pvay3.js";import{u as je}from"./use-org-auth-client-BNes3v9b.js";import{u as ze}from"./use-debounced-autosave-Ct-eC-Fb.js";import{A as Se}from"./avatar-DH4ZIsE3.js";import{I as ae}from"./input-CXaj-v5Z.js";import{C as ve}from"./review-settings-IopPVrta.js";import{D as Oe}from"./domain-settings-DJ3VqnT5.js";import{c as be,d as ye,b as Ce,f as _e,g as Ae,e as De,a as Fe,A as we}from"./alert-dialog-DkCt8SMC.js";import{R as Ne}from"./require-capability-DcTb-1uc.js";import"./User01-BBrQuNix.js";import"./switch-DIrg2aPu.js";import"./UserSquare-D_Mg9gDt.js";import"./GitBranch01-CTfNzZhb.js";import"./use-organization-settings-CrsOfln-.js";import"./constants-Daqiz8AS.js";import"./schema-DPmO1u84.js";import"./task-board-CcBm1zGR.js";import"./badge-VI5MdDWx.js";import"./select-yUbJhxjV.js";import"./Check-Bm4pKAip.js";import"./ChevronUp-DxATplb1.js";import"./access-gate-Fm1tpXMI.js";import"./capability-load-error-BYrVfy2j.js";const Te=re({name:X().min(1,"Name is required").max(255,"Name is too long"),logo:X().optional()});function Ee(e){const t=Y.c(17),{value:n,onChange:g,name:r,disabled:l}=e,d=U(),m=J.useRef(null);let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a=()=>m.current?.click(),t[0]=a):a=t[0];const h=a;let s;t[1]!==g||t[2]!==d?(s=Z=>{const z=Z.target.files?.[0];if(!z)return;if(z.size>2097152){G.error(d("settings.organizationForm.imageTooLarge"));return}const p=new FileReader;p.onerror=()=>G.error(d("settings.organizationForm.failedToReadImage")),p.onloadend=()=>{p.result&&g(p.result),m.current&&(m.current.value="")},p.readAsDataURL(z)},t[1]=g,t[2]=d,t[3]=s):s=t[3];const c=s;let o;t[4]!==d?(o=d("settings.organizationForm.uploadLogoLabel"),t[4]=d,t[5]=o):o=t[5];let u;t[6]!==l||t[7]!==c?(u=i.jsx("input",{ref:m,type:"file",accept:"image/*",onChange:c,className:"hidden",disabled:l}),t[6]=l,t[7]=c,t[8]=u):u=t[8];const x=n||void 0,j=r??"?";let f;t[9]!==x||t[10]!==j?(f=i.jsx(Se,{url:x,fallback:j,shape:"square",size:"base"}),t[9]=x,t[10]=j,t[11]=f):f=t[11];let S;return t[12]!==l||t[13]!==o||t[14]!==u||t[15]!==f?(S=i.jsxs("button",{type:"button",onClick:h,disabled:l,className:"rounded-lg overflow-hidden hover:ring-2 hover:ring-border transition-all disabled:opacity-50","aria-label":o,children:[u,f]}),t[12]=l,t[13]=o,t[14]=u,t[15]=f,t[16]=S):S=t[16],S}function Pe(){const e=U(),{org:t}=ie(),n=je(),g=le(),r=ce({resolver:ge(Te),values:{name:t.name??"",logo:t.logo??""}}),l=ne({mutationFn:async s=>{const c={name:s.name};s.logo&&(c.logo=s.logo);const o=await n.organization.update({data:c});if(o?.error)throw new Error(o.error.message||e("settings.organizationForm.failedToUpdateOrg"));return o},onSuccess:(s,c)=>{W("organization_settings_updated",{organization_id:t.id,fields:Object.keys(c)}),g.invalidateQueries({queryKey:ee.organizations()}),g.invalidateQueries({queryKey:ee.activeOrganization(t.slug)}),G.success(e("settings.organizationForm.updateSuccess"))},onError:(s,c)=>{W("organization_settings_update_failed",{organization_id:t.id,fields:Object.keys(c),error:s instanceof Error?s.message:String(s)}),G.error(s instanceof Error?s.message:e("settings.organizationForm.failedToUpdateOrg"))}}),{schedule:d,flush:m}=ze({save:async()=>{const s=r.control._formState.dirtyFields;if(Object.keys(s).length===0||!await r.trigger())return;const o=r.getValues(),u=r.control._defaultValues;r.reset(o,{keepValues:!0});try{await l.mutateAsync(o)}catch{r.reset(u,{keepValues:!0})}}}),a=r.formState.errors,h=typeof window<"u"?`${window.location.host}/`:"";return i.jsx(se,{children:i.jsxs(oe,{children:[i.jsx(M,{title:e("settings.organizationForm.logoTitle"),description:e("settings.organizationForm.logoDescription"),action:i.jsx(Ee,{value:r.watch("logo"),onChange:s=>{r.setValue("logo",s??"",{shouldDirty:!0}),m()},name:r.watch("name")})}),i.jsx(M,{title:e("settings.organizationForm.nameTitle"),action:i.jsx(de,{control:r.control,name:"name",render:({field:s})=>i.jsx(ae,{id:"org-name",...s,onChange:c=>{s.onChange(c),d()},onBlur:()=>{s.onBlur(),m()},placeholder:e("settings.organizationForm.namePlaceholder"),className:"w-[280px]"})})}),i.jsx(M,{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:[h&&i.jsx("span",{className:"pl-3 text-sm text-muted-foreground select-none",children:h}),i.jsx("span",{className:"flex-1 min-w-0 px-2 py-1.5 text-sm text-foreground truncate",children:t.slug})]})}),(a.name||a.logo)&&i.jsxs("div",{className:"px-5 pb-3 flex flex-col gap-1",children:[a.name&&i.jsx("p",{className:"text-xs text-destructive",children:a.name.message}),a.logo&&i.jsx("p",{className:"text-xs text-destructive",children:a.logo.message})]})]})})}function Le(){const e=Y.c(86),t=U(),{org:n}=ie(),[g,r]=J.useState(!1),[l,d]=J.useState(""),m=me();let a;e[0]!==n.id||e[1]!==m?(a=async()=>{await m.call("ORGANIZATION_DELETE",{id:n.id})},e[0]=n.id,e[1]=m,e[2]=a):a=e[2];let h;e[3]!==n.id||e[4]!==n.slug||e[5]!==t?(h=()=>{W("organization_deleted",{organization_id:n.id}),localStorage.getItem(te.lastOrgSlug())===n.slug&&localStorage.removeItem(te.lastOrgSlug()),ue()?.org===n.slug&&fe(),pe(),G.success(t("settings.deleteOrganizationSection.organizationDeleted")),window.location.href="/"},e[3]=n.id,e[4]=n.slug,e[5]=t,e[6]=h):h=e[6];let s;e[7]!==t?(s=v=>{G.error(v instanceof Error?v.message:t("settings.deleteOrganizationSection.failedToDeleteOrganization"))},e[7]=t,e[8]=s):s=e[8];let c;e[9]!==a||e[10]!==h||e[11]!==s?(c={mutationFn:a,onSuccess:h,onError:s},e[9]=a,e[10]=h,e[11]=s,e[12]=c):c=e[12];const o=ne(c);let u;e[13]!==t?(u=t("settings.deleteOrganizationSection.dangerZone"),e[13]=t,e[14]=u):u=e[14];let x;e[15]!==t?(x=t("settings.deleteOrganizationSection.irreversibleActionsDescription"),e[15]=t,e[16]=x):x=e[16];let j;e[17]!==t?(j=t("settings.deleteOrganizationSection.deleteOrganizationTitle"),e[17]=t,e[18]=j):j=e[18];let f;e[19]!==t?(f=t("settings.deleteOrganizationSection.deleteOrganizationDescription"),e[19]=t,e[20]=f):f=e[20];let S;e[21]===Symbol.for("react.memo_cache_sentinel")?(S=()=>r(!0),e[21]=S):S=e[21];const Z=o.isPending;let z;e[22]!==t?(z=t("settings.deleteOrganizationSection.deleteButton"),e[22]=t,e[23]=z):z=e[23];let p;e[24]!==o.isPending||e[25]!==z?(p=i.jsx(he,{variant:"destructive",size:"sm",onClick:S,disabled:Z,children:z}),e[24]=o.isPending,e[25]=z,e[26]=p):p=e[26];let O;e[27]!==p||e[28]!==j||e[29]!==f?(O=i.jsx(oe,{className:"border-destructive/40",children:i.jsx(M,{title:j,description:f,action:p})}),e[27]=p,e[28]=j,e[29]=f,e[30]=O):O=e[30];let b;e[31]!==O||e[32]!==u||e[33]!==x?(b=i.jsx(se,{title:u,description:x,children:O}),e[31]=O,e[32]=u,e[33]=x,e[34]=b):b=e[34];let K;e[35]===Symbol.for("react.memo_cache_sentinel")?(K=v=>{r(v),v||d("")},e[35]=K):K=e[35];let y;e[36]!==t?(y=t("settings.deleteOrganizationSection.deleteOrganizationQuestion"),e[36]=t,e[37]=y):y=e[37];let C;e[38]!==y?(C=i.jsx(be,{children:y}),e[38]=y,e[39]=C):C=e[39];let _;e[40]!==n.name||e[41]!==t?(_=t("settings.deleteOrganizationSection.deleteWarning",{organizationName:n.name}),e[40]=n.name,e[41]=t,e[42]=_):_=e[42];let A;e[43]!==_?(A=i.jsx("p",{children:_}),e[43]=_,e[44]=A):A=e[44];let D;e[45]!==n.name||e[46]!==t?(D=t("settings.deleteOrganizationSection.typeToConfirm",{organizationName:n.name}),e[45]=n.name,e[46]=t,e[47]=D):D=e[47];let F;e[48]!==D?(F=i.jsx("p",{className:"mt-3 mb-1.5",children:D}),e[48]=D,e[49]=F):F=e[49];let Q;e[50]===Symbol.for("react.memo_cache_sentinel")?(Q=v=>d(v.target.value),e[50]=Q):Q=e[50];let w;e[51]!==l||e[52]!==n.name?(w=i.jsx(ae,{value:l,onChange:Q,placeholder:n.name,autoFocus:!0}),e[51]=l,e[52]=n.name,e[53]=w):w=e[53];let N;e[54]!==A||e[55]!==F||e[56]!==w?(N=i.jsx(ye,{asChild:!0,children:i.jsxs("div",{children:[A,F,w]})}),e[54]=A,e[55]=F,e[56]=w,e[57]=N):N=e[57];let T;e[58]!==C||e[59]!==N?(T=i.jsxs(Ce,{children:[C,N]}),e[58]=C,e[59]=N,e[60]=T):T=e[60];let E;e[61]!==t?(E=t("settings.deleteOrganizationSection.cancel"),e[61]=t,e[62]=E):E=e[62];let P;e[63]!==E?(P=i.jsx(_e,{children:E}),e[63]=E,e[64]=P):P=e[64];let L;e[65]!==o?(L=()=>o.mutate(),e[65]=o,e[66]=L):L=e[66];const H=l!==n.name||o.isPending;let k;e[67]!==o.isPending||e[68]!==t?(k=o.isPending?t("settings.deleteOrganizationSection.deleting"):t("settings.deleteOrganizationSection.deleteOrganizationAction"),e[67]=o.isPending,e[68]=t,e[69]=k):k=e[69];let R;e[70]!==L||e[71]!==H||e[72]!==k?(R=i.jsx(Ae,{onClick:L,disabled:H,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90 disabled:opacity-50",children:k}),e[70]=L,e[71]=H,e[72]=k,e[73]=R):R=e[73];let q;e[74]!==P||e[75]!==R?(q=i.jsxs(De,{children:[P,R]}),e[74]=P,e[75]=R,e[76]=q):q=e[76];let I;e[77]!==T||e[78]!==q?(I=i.jsxs(Fe,{children:[T,q]}),e[77]=T,e[78]=q,e[79]=I):I=e[79];let B;e[80]!==g||e[81]!==I?(B=i.jsx(we,{open:g,onOpenChange:K,children:I}),e[80]=g,e[81]=I,e[82]=B):B=e[82];let V;return e[83]!==b||e[84]!==B?(V=i.jsxs(i.Fragment,{children:[b,B]}),e[83]=b,e[84]=B,e[85]=V):V=e[85],V}function ke(){const e=Y.c(10),t=U();let n;e[0]!==t?(n=t("settings.orgGeneral.organization"),e[0]=t,e[1]=n):n=e[1];let g;e[2]!==n?(g=i.jsx($.Title,{children:n}),e[2]=n,e[3]=g):g=e[3];let r,l,d,m;e[4]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(Pe,{}),l=i.jsx(ve,{}),d=i.jsx(Oe,{}),m=i.jsx(Le,{}),e[4]=r,e[5]=l,e[6]=d,e[7]=m):(r=e[4],l=e[5],d=e[6],m=e[7]);let a;return e[8]!==g?(a=i.jsx($,{children:i.jsx($.Content,{children:i.jsx($.Body,{children:i.jsxs(xe,{children:[g,r,l,d,m]})})})}),e[8]=g,e[9]=a):a=e[9],a}function at(){const e=Y.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsx(Ne,{capability:"org:manage",area:"general settings",children:i.jsx(ke,{})}),e[0]=t):t=e[0],t}export{at as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as n,j as o}from"./index-
|
|
1
|
+
import{c as n,j as o}from"./index-Cq8Pvay3.js";function a(r){const e=n.c(4),{size:t,className:c}=r;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=o.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]=s):s=e[0];let i;return e[1]!==c||e[2]!==t?(i=o.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",className:c,children:s}),e[1]=c,e[2]=t,e[3]=i):i=e[3],i}export{a as G};
|
package/dist/client/assets/{github-repo-picker-_9hUfw1v.js → github-repo-picker-Dth8apmY.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as L,G as ue,a as _e,n as de,r as z,aR as ne,b as H,j as t,B as ce,b4 as he,l as oe,h as B,ff as pe,t as M,e as be,K as ie,m as ze,x as Le,z as Ge}from"./index-DIek05Ni.js";import{c as je,d as ye,b as ke,D as Ne}from"./dialog-ClXo-ILY.js";import{C as ve}from"./collection-search-x0S64zby.js";import{u as Pe}from"./use-debounced-value-BbelcnFE.js";import{b as Re,u as Fe}from"./use-connection-CwE_S8Fn.js";import{u as se}from"./use-mcp-client-TErTfSlr.js";import{W as $e,S as fe}from"./constants-Daqiz8AS.js";import{a as we}from"./authenticate-and-persist-oauth-Bc7-Czof.js";import{i as ae}from"./ArrowLeft-B_Sm8nZF.js";import{n as Oe}from"./LinkExternal01-CYGJDolS.js";import{n as Ue}from"./Share07-BlQxtP9X.js";import{c as De}from"./use-mcp-tools-CUsFOk8y.js";import{e as He}from"./extract-connection-data-CBaHjHii.js";import{u as Ce}from"./use-navigate-to-agent-DVwAusa4.js";import{G as Q}from"./github-icon-BamvWtlu.js";import{b as Me,p as xe,f as qe,G as ge}from"./provision-repo-scoped-github-connection-WQFARyHG.js";import{u as Se,a as Be,b as Qe,c as Ve,G as Ke}from"./gitlab-icon-BvCV8hCq.js";import{i as We}from"./SearchLg-ijCBByfF.js";function Je(h,e){const s=L.c(12),{org:i}=ue();let m;s[0]!==i.id?(m=$e.REGISTRY(i.id),s[0]=i.id,s[1]=m):m=s[1];const o=m;let c;s[2]!==i.id||s[3]!==i.slug||s[4]!==o?(c={connectionId:o,orgId:i.id,orgSlug:i.slug},s[2]=i.id,s[3]=i.slug,s[4]=o,s[5]=c):c=s[5];const l=se(c);let n;s[6]!==h?(n={name:h},s[6]=h,s[7]=n):n=s[7];const a=e?.enabled??!0;let u;return s[8]!==l||s[9]!==n||s[10]!==a?(u={client:l,toolName:"COLLECTION_REGISTRY_APP_GET",toolArguments:n,enabled:a,staleTime:3e5,select:Ye},s[8]=l,s[9]=n,s[10]=a,s[11]=u):u=s[11],De(u)}function Ye(h){return h.structuredContent?.item??null}const Xe="deco/mcp-github";function Ze(h){const{org:e}=ue(),{data:s}=_e.useSession(),i=Re(),m=de(),[o,c]=z.useState("idle"),[l,n]=z.useState(null),[a,u]=z.useState(null),{data:f,isLoading:j}=Je(Xe,{enabled:h.enabled}),g=z.useRef(!1);h.enabled&&f&&!j&&!g.current&&s?.user?.id&&o==="idle"&&(g.current=!0,x());async function x(){if(!(!f||!s?.user?.id||!e))try{c("installing"),n(null);const d=He(f,e.id,s.user.id,{remoteIndex:0});if(!d.connection_url)throw new Error("Registry item is missing a remote URL for mcp-github");const{id:k}=await i.create.mutateAsync(d);c("authenticating");const N=await we({connectionId:k,orgId:e.id,orgSlug:e.slug,persistFallback:p=>i.update.mutateAsync({id:k,data:{connection_token:p}}).then(()=>{})});if(N.ran&&!N.ok){try{await i.delete.mutateAsync(k)}catch{}throw new Error(N.error&&N.error!=="no token received"?N.error:"No token received from GitHub")}ne(m,e.id),u(d),c("ready")}catch(d){n(d instanceof Error?d.message:String(d)),c("error")}}function b(){c("idle"),n(null),u(null),g.current=!1}return h.enabled&&j&&o==="idle"?{status:"installing",error:null,connection:null,retry:b}:{status:o,error:l,connection:a,retry:b}}function Ie(h){const e=L.c(3),{provider:s,className:i}=h;let m;return e[0]!==i||e[1]!==s?(m=s==="gitlab"?t.jsx(Ke,{size:16,className:i}):t.jsx(Q,{size:16,className:i}),e[0]=i,e[1]=s,e[2]=m):m=e[2],m}function Ee(h){return(h??[]).filter(e=>e.status==="active"&&e.servable)}function Ae(h){const e=L.c(20),{provider:s,path:i,host:m,hint:o,disabled:c,busy:l,onSelect:n}=h,a=c&&"opacity-60 cursor-not-allowed";let u;e[0]!==a?(u=oe("w-full flex items-center gap-3 px-4 py-2.5 text-left hover:bg-muted/60 transition-colors",a),e[0]=a,e[1]=u):u=e[1];let f;e[2]!==s?(f=t.jsx(Ie,{provider:s,className:"text-muted-foreground"}),e[2]=s,e[3]=f):f=e[3];let j;e[4]!==i?(j=t.jsx("span",{className:"block text-sm truncate",children:i}),e[4]=i,e[5]=j):j=e[5];const g=o?`${m} · ${o}`:m;let x;e[6]!==g?(x=t.jsx("span",{className:"block text-xs text-muted-foreground truncate",children:g}),e[6]=g,e[7]=x):x=e[7];let b;e[8]!==j||e[9]!==x?(b=t.jsxs("span",{className:"flex-1 min-w-0",children:[j,x]}),e[8]=j,e[9]=x,e[10]=b):b=e[10];let d;e[11]!==l?(d=l?t.jsx(B,{className:"size-4 text-muted-foreground"}):null,e[11]=l,e[12]=d):d=e[12];let y;return e[13]!==c||e[14]!==n||e[15]!==u||e[16]!==f||e[17]!==b||e[18]!==d?(y=t.jsxs("button",{type:"button",disabled:c,onClick:n,className:u,children:[f,b,d]}),e[13]=c,e[14]=n,e[15]=u,e[16]=f,e[17]=b,e[18]=d,e[19]=y):y=e[19],y}function et(h){const e=L.c(17),{onPick:s,pendingPath:i}=h,m=H(),o=Ve();if(o.isPending){let j;return e[0]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(he,{className:"h-24 w-full"}),e[0]=j):j=e[0],j}let c;e[1]!==o.data?(c=o.data??[],e[1]=o.data,e[2]=c):c=e[2];const l=c;if(l.length===0)return null;let n;e[3]!==m?(n=m("common.repositoryPicker.linkedSection"),e[3]=m,e[4]=n):n=e[4];let a;e[5]!==n?(a=t.jsx("p",{className:"px-4 py-2 text-xs font-medium text-muted-foreground",children:n}),e[5]=n,e[6]=a):a=e[6];let u;if(e[7]!==s||e[8]!==i||e[9]!==l){let j;e[11]!==s||e[12]!==i?(j=g=>t.jsx(Ae,{provider:g.provider,path:g.path,host:g.host,hint:g.defaultBranch,disabled:i!==null,busy:i===g.path,onSelect:()=>s(g)},g.id),e[11]=s,e[12]=i,e[13]=j):j=e[13],u=l.map(j),e[7]=s,e[8]=i,e[9]=l,e[10]=u}else u=e[10];let f;return e[14]!==a||e[15]!==u?(f=t.jsxs("div",{children:[a,u]}),e[14]=a,e[15]=u,e[16]=f):f=e[16],f}function tt(h){const e=L.c(22),{account:s,onLink:i,pendingPath:m}=h,o=H(),[c,l]=z.useState(""),n=Pe(c,300),a=z.useDeferredValue(n),u=c!==a,f=Qe(s.id,a);let j;e[0]!==o?(j=o("common.repositoryPicker.searchPlaceholder"),e[0]=o,e[1]=j):j=e[1];const g=u||f.isFetching;let x;e[2]!==c||e[3]!==j||e[4]!==g?(x=t.jsx(ve,{placeholder:j,value:c,onChange:l,isSearching:g}),e[2]=c,e[3]=j,e[4]=g,e[5]=x):x=e[5];const b=u?"opacity-40":"opacity-100";let d;e[6]!==b?(d=oe("flex-1 overflow-y-auto transition-opacity duration-150",b),e[6]=b,e[7]=d):d=e[7];let y;e[8]!==i||e[9]!==m||e[10]!==f.data||e[11]!==f.error||e[12]!==f.isError||e[13]!==f.isPending||e[14]!==o?(y=f.isPending?t.jsx("div",{className:"flex-1 flex items-center justify-center py-10",children:t.jsx(B,{className:"size-4.5 text-muted-foreground"})}):f.isError?t.jsx("p",{className:"px-4 py-10 text-center text-sm text-muted-foreground",children:f.error instanceof Error?f.error.message:o("common.repositoryPicker.searchFailed")}):(f.data??[]).length===0?t.jsx("p",{className:"px-4 py-10 text-center text-sm text-muted-foreground",children:o("common.repositoryPicker.searchEmpty")}):(f.data??[]).map(p=>t.jsx(Ae,{provider:p.ref.provider,path:p.ref.path,host:p.ref.host,hint:p.visibility,disabled:m!==null,busy:m===p.ref.path,onSelect:()=>i(p.webUrl,p.ref.path)},`${p.ref.host}/${p.ref.path}`)),e[8]=i,e[9]=m,e[10]=f.data,e[11]=f.error,e[12]=f.isError,e[13]=f.isPending,e[14]=o,e[15]=y):y=e[15];let k;e[16]!==d||e[17]!==y?(k=t.jsx("div",{className:d,children:y}),e[16]=d,e[17]=y,e[18]=k):k=e[18];let N;return e[19]!==x||e[20]!==k?(N=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[x,k]}),e[19]=x,e[20]=k,e[21]=N):N=e[21],N}function nt(h){const e=L.c(12),{accounts:s,onSelect:i}=h,m=H();let o;e[0]!==m?(o=m("common.repositoryPicker.browseSection"),e[0]=m,e[1]=o):o=e[1];let c;e[2]!==o?(c=t.jsx("p",{className:"px-4 py-2 text-xs font-medium text-muted-foreground",children:o}),e[2]=o,e[3]=c):c=e[3];let l;if(e[4]!==s||e[5]!==i){let a;e[7]!==i?(a=u=>t.jsxs("button",{type:"button",onClick:()=>i(u),className:"w-full flex items-center gap-3 px-4 py-2.5 text-left hover:bg-muted/60 transition-colors",children:[t.jsx(Ie,{provider:u.type,className:"text-muted-foreground"}),t.jsxs("span",{className:"flex-1 min-w-0",children:[t.jsx("span",{className:"block text-sm truncate",children:u.login}),t.jsx("span",{className:"block text-xs text-muted-foreground truncate",children:u.host})]}),t.jsx(We,{size:14,className:"text-muted-foreground"})]},u.id),e[7]=i,e[8]=a):a=e[8],l=s.map(a),e[4]=s,e[5]=i,e[6]=l}else l=e[6];let n;return e[9]!==c||e[10]!==l?(n=t.jsxs("div",{className:"flex-1 overflow-y-auto",children:[c,l]}),e[9]=c,e[10]=l,e[11]=n):n=e[11],n}function st(h){const e=L.c(37),{open:s,onOpenChange:i,title:m,onPicked:o,onError:c}=h,l=H(),n=Se(),a=Be(),[u,f]=z.useState(null),[j,g]=z.useState(null);let x;e[0]!==n.data?(x=Ee(n.data),e[0]=n.data,e[1]=x):x=e[1];const b=x;let d;e[2]!==o?(d=function(R){g(R.path),o({repository:R}),g(null)},e[2]=o,e[3]=d):d=e[3];const y=d;let k;e[4]!==u||e[5]!==a||e[6]!==c||e[7]!==o||e[8]!==l?(k=function(R,E){u&&(g(E),a.mutate({url:R,accountId:u.id},{onSuccess:T=>o({repository:T}),onError:T=>c?.(T instanceof Error?T.message:l("common.repositoryPicker.linkFailed")),onSettled:()=>g(null)}))},e[4]=u,e[5]=a,e[6]=c,e[7]=o,e[8]=l,e[9]=k):k=e[9];const N=k;let p;e[10]!==i?(p=_=>{_||f(null),i(_)},e[10]=i,e[11]=p):p=e[11];let r;e[12]!==m?(r=t.jsx(je,{className:"sr-only",children:t.jsx(ye,{children:m})}),e[12]=m,e[13]=r):r=e[13];let P;e[14]!==u||e[15]!==l?(P=u?t.jsx(ce,{size:"icon",variant:"ghost",onClick:()=>f(null),"aria-label":l("common.repositoryPicker.back"),children:t.jsx(ae,{size:16})}):null,e[14]=u,e[15]=l,e[16]=P):P=e[16];const v=u?u.login:m;let w;e[17]!==v?(w=t.jsx("span",{className:"text-sm font-medium truncate",children:v}),e[17]=v,e[18]=w):w=e[18];let C;e[19]!==P||e[20]!==w?(C=t.jsxs("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3 shrink-0",children:[P,w]}),e[19]=P,e[20]=w,e[21]=C):C=e[21];let I;e[22]!==u||e[23]!==n.isPending||e[24]!==N||e[25]!==j||e[26]!==y||e[27]!==b?(I=n.isPending?t.jsx("div",{className:"p-4",children:t.jsx(he,{className:"h-24 w-full"})}):u?t.jsx(tt,{account:u,onLink:N,pendingPath:j}):t.jsxs("div",{className:"flex-1 overflow-y-auto",children:[t.jsx(et,{onPick:y,pendingPath:j}),b.length>0?t.jsx(nt,{accounts:b,onSelect:f}):null]}),e[22]=u,e[23]=n.isPending,e[24]=N,e[25]=j,e[26]=y,e[27]=b,e[28]=I):I=e[28];let S;e[29]!==I||e[30]!==r||e[31]!==C?(S=t.jsxs(ke,{className:"sm:max-w-[560px] h-[85svh] sm:h-[520px] p-0 gap-0 overflow-hidden flex flex-col",children:[r,C,I]}),e[29]=I,e[30]=r,e[31]=C,e[32]=S):S=e[32];let A;return e[33]!==s||e[34]!==S||e[35]!==p?(A=t.jsx(Ne,{open:s,onOpenChange:p,children:S}),e[33]=s,e[34]=S,e[35]=p,e[36]=A):A=e[36],A}function it(h){const e=h.path.split("/"),s=e[e.length-1]??h.path;return{owner:e.slice(0,-1).join("/"),name:s,fullName:h.path,url:h.webUrl,private:h.visibility!=="public",description:null,updatedAt:h.updatedAt,fork:!1}}function ot(h,e,s){return{title:e.name,description:s.description,pinned:!1,icon:null,metadata:{githubRepo:{owner:e.owner,name:e.name,url:e.url,repositoryId:h.id},instructions:null,ui:{pinnedViews:null,layout:{defaultMainView:{type:"site-editor"},chatDefaultOpen:!0}}},connections:[]}}function lt(h){const e=L.c(26),{open:s,onOpenChange:i,title:m,onImportComplete:o,mode:c}=h,l=c===void 0?"agent":c,n=H(),{org:a}=ue(),u=de(),f=Ce();let j;e[0]!==a.id||e[1]!==a.slug?(j={connectionId:fe,orgId:a.id,orgSlug:a.slug},e[0]=a.id,e[1]=a.slug,e[2]=j):j=e[2];const g=se(j);let x;e[3]!==l||e[4]!==n||e[5]!==m?(x=m??n(l==="connection"?"common.githubRepoPicker.addRepo":"common.githubRepoPicker.importFromGitHub"),e[3]=l,e[4]=n,e[5]=m,e[6]=x):x=e[6];const b=x;let d;e[7]!==g||e[8]!==n?(d=async function(v,w){const C=await g.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:ot(v,w,{description:n("common.repositoryPicker.agentDescription",{path:v.path})})}}),S=(C.structuredContent??C).item?.id;if(!S)throw new Error(n("common.repositoryPicker.createAgentFailed"));return S},e[7]=g,e[8]=n,e[9]=d):d=e[9];const y=d;let k;e[10]!==y||e[11]!==l||e[12]!==f||e[13]!==o||e[14]!==i||e[15]!==a.id||e[16]!==u||e[17]!==n?(k=function(v){const w=it(v);if(i(!1),l==="connection"){if(ne(u,a.id),pe(u,a.id),o){o({virtualMcpId:null,repo:w,connectionId:null,repositoryId:v.id});return}M.success(n("common.githubRepoPicker.addedRepo",{name:w.name}));return}y(v,w).then(C=>{if(ne(u,a.id),o){o({virtualMcpId:C,repo:w,connectionId:null,repositoryId:v.id});return}M.success(n("common.githubRepoPicker.importedRepo",{name:w.name})),f(C)}).catch(C=>{M.error(C instanceof Error?C.message:n("common.repositoryPicker.createAgentFailed"))})},e[10]=y,e[11]=l,e[12]=f,e[13]=o,e[14]=i,e[15]=a.id,e[16]=u,e[17]=n,e[18]=k):k=e[18];const N=k;let p;e[19]!==N?(p=P=>{const{repository:v}=P;return N(v)},e[19]=N,e[20]=p):p=e[20];let r;return e[21]!==i||e[22]!==s||e[23]!==b||e[24]!==p?(r=t.jsx(st,{open:s,onOpenChange:i,title:b,onPicked:p,onError:rt}),e[21]=i,e[22]=s,e[23]=b,e[24]=p,e[25]=r):r=e[25],r}function rt(h){return M.error(h)}function _t(h){const e=L.c(4),s=Se();if(!s.isPending&&Ee(s.data).length>0){let m;return e[0]!==h?(m=t.jsx(lt,{...h}),e[0]=h,e[1]=m):m=e[1],m}let i;return e[2]!==h?(i=t.jsx(ct,{...h}),e[2]=h,e[3]=i):i=e[3],i}function ct(h){const e=L.c(27),{open:s,onOpenChange:i,title:m,onImportComplete:o,mode:c}=h,l=c===void 0?"agent":c,n=H();let a;e[0]!==l||e[1]!==n||e[2]!==m?(a=m??n(l==="connection"?"common.githubRepoPicker.addRepo":"common.githubRepoPicker.importFromGitHub"),e[0]=l,e[1]=n,e[2]=m,e[3]=a):a=e[3];const u=a,[f,j]=z.useState(null);let g;e[4]!==u?(g=t.jsx(je,{className:"sr-only",children:t.jsx(ye,{children:u})}),e[4]=u,e[5]=g):g=e[5];let x;e[6]!==u||e[7]!==f||e[8]!==n?(x=t.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3 shrink-0",children:f?t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:()=>j(null),className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors shrink-0","aria-label":n("common.githubRepoPicker.backToAccounts"),children:t.jsx(ae,{size:16})}),t.jsx("img",{src:f.avatarUrl,alt:f.login,className:"size-5 rounded-full ring-1 ring-border shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:f.login})]}):t.jsxs(t.Fragment,{children:[t.jsx(Q,{className:"size-4 text-foreground shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:u})]})}),e[6]=u,e[7]=f,e[8]=n,e[9]=x):x=e[9];let b;e[10]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(B,{className:"size-4.5 text-muted-foreground"})}),e[10]=b):b=e[10];let d;e[11]!==i?(d=()=>i(!1),e[11]=i,e[12]=d):d=e[12];let y;e[13]!==l||e[14]!==o||e[15]!==s||e[16]!==f||e[17]!==d?(y=t.jsx("div",{className:"flex-1 overflow-hidden flex flex-col min-w-0",children:t.jsx(z.Suspense,{fallback:b,children:t.jsx(at,{open:s,onComplete:d,selectedInstallation:f,onSelectInstallation:j,onImportComplete:o,mode:l})})}),e[13]=l,e[14]=o,e[15]=s,e[16]=f,e[17]=d,e[18]=y):y=e[18];let k;e[19]!==g||e[20]!==x||e[21]!==y?(k=t.jsxs(ke,{className:"sm:max-w-[560px] h-[85svh] sm:h-[520px] p-0 gap-0 overflow-hidden flex flex-col",children:[g,x,y]}),e[19]=g,e[20]=x,e[21]=y,e[22]=k):k=e[22];let N;return e[23]!==i||e[24]!==s||e[25]!==k?(N=t.jsx(Ne,{open:s,onOpenChange:i,children:k}),e[23]=i,e[24]=s,e[25]=k,e[26]=N):N=e[26],N}function at({open:h,onComplete:e,selectedInstallation:s,onSelectInstallation:i,onImportComplete:m,mode:o="agent"}){const c=H(),{org:l}=ue(),n=de(),a=Ce(),[u,f]=z.useState(null),j=Fe({slug:"mcp-github"}),g=Me(j),x=Ze({enabled:h&&g.length===0}),b=g.length===1?g[0]??null:u,d=se({connectionId:b?.id??"",orgId:l.id,orgSlug:l.slug}),y=se({connectionId:fe,orgId:l.id,orgSlug:l.slug}),k=async(r,P)=>{try{const w=await d.callTool({name:"get_file_contents",arguments:{owner:r.owner,repo:r.name,path:P}});if(w.isError)return null;const I=w.content?.find(S=>S.type==="resource")?.resource?.text;if(!I)return null;try{const S=JSON.parse(I);return typeof S=="string"?S:JSON.stringify(S)}catch{return I}}catch{return null}},N=(r,P)=>{Promise.all([k(P,"AGENTS.md"),k(P,"CLAUDE.md")]).then(async([v,w])=>{const C=v??w??null;C&&(await y.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:r,data:{metadata:{instructions:C}}}}),ne(n,l.id))}).catch(v=>{console.error("GitHub instructions fetch failed:",v)})},p=be({mutationFn:async r=>{if(!b||!s)throw new Error("No GitHub connection or installation");const P=s.installationId;if(o==="connection"){const{childConnectionId:I}=await xe({orgSlug:l.slug,sourceConnection:b,installationId:P,owner:r.owner,repo:r.name,githubCallTool:S=>d.callTool(S),selfCallTool:S=>y.callTool(S),orgShared:!0});return{virtualMcpId:null,repo:r,connectionId:I,item:null}}const{childConnectionId:v,reused:w}=await xe({orgSlug:l.slug,sourceConnection:b,installationId:P,owner:r.owner,repo:r.name,githubCallTool:I=>d.callTool(I),selfCallTool:I=>y.callTool(I)});let C=null;try{const I=await y.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:r.name,description:r.description||"Imported from GitHub",pinned:!1,icon:null,metadata:{githubRepo:{owner:r.owner,name:r.name,url:r.url,installationId:P,connectionId:v},instructions:null,ui:{pinnedViews:null,layout:{defaultMainView:{type:"site-editor"},chatDefaultOpen:!0}}},connections:[{connection_id:v}]}}}),S=I.structuredContent??I,A=S.item?.id;if(!S.item||!A)throw new Error("Failed to create the imported agent");return C=A,{virtualMcpId:A,repo:r,connectionId:v,item:S.item}}catch(I){throw C&&await y.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:C}}).catch(()=>{}),w||await y.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:v,force:!0}}).catch(()=>{}),I}},onSuccess:({virtualMcpId:r,repo:P,connectionId:v,item:w})=>{if(o==="connection"||!r||!w){if(ne(n,l.id),pe(n,l.id),m){m({virtualMcpId:null,repo:P,connectionId:v});return}M.success(c("common.githubRepoPicker.addedRepo",{name:P.name})),e();return}if(n.setQueryData(ie.collectionItem(y,l.id,"","VIRTUAL_MCP",r),{item:w}),ne(n,l.id),N(r,P),m){m({virtualMcpId:r,repo:P,connectionId:v});return}M.success(c("common.githubRepoPicker.importedRepo",{name:P.name})),e(),a(r)},onError:(r,P)=>{console.error("GitHub import failed:",r);const v=r instanceof Error?r.message:c("common.githubRepoPicker.unknownError");if(P.fork&&v.toLowerCase().includes("mint")){M.error(c("common.githubRepoPicker.failedImportFork",{name:P.name}));return}M.error(c("common.githubRepoPicker.failedImport",{error:v}))}});return x.status==="installing"||x.status==="authenticating"?t.jsx(me,{status:x.status,error:null,retry:x.retry}):x.status==="error"?t.jsx(me,{status:"error",error:x.error,retry:x.retry}):g.length===0&&x.status==="idle"?t.jsx(me,{status:"installing",error:null,retry:x.retry}):g.length>1&&!b?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:c("common.githubRepoPicker.selectConnection")})}),g.map(r=>t.jsxs("button",{type:"button",onClick:()=>f(r),className:"flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left",children:[r.icon?t.jsx("img",{src:r.icon,alt:r.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(Q,{className:"size-3.5 text-muted-foreground"})}),t.jsx("span",{className:"text-sm font-medium",children:r.title})]},r.id))]}):b?s?t.jsx(mt,{connectionId:b.id,orgId:l.id,orgSlug:l.slug,installation:s,onSelectRepo:r=>p.mutate(r),isSaving:p.isPending}):t.jsx(ut,{connectionId:b.id,orgId:l.id,orgSlug:l.slug,onSelect:i,showBackButton:g.length>1,onBack:()=>f(null)}):null}function ut(h){const e=L.c(124),{connectionId:s,orgId:i,orgSlug:m,onSelect:o,showBackButton:c,onBack:l}=h,n=H();let a;e[0]!==i||e[1]!==m?(a={connectionId:fe,orgId:i,orgSlug:m},e[0]=i,e[1]=m,e[2]=a):a=e[2];const u=se(a),f=de(),j=Re();let g;e[3]!==s||e[4]!==i?(g=ie.githubUserOrgs(i,s),e[3]=s,e[4]=i,e[5]=g):g=e[5];let x;e[6]!==s||e[7]!==u?(x=()=>qe(R=>u.callTool(R),s),e[6]=s,e[7]=u,e[8]=x):x=e[8];let b;e[9]!==g||e[10]!==x?(b={queryKey:g,queryFn:x},e[9]=g,e[10]=x,e[11]=b):b=e[11];const d=ze(b);let y;e[12]!==j||e[13]!==s||e[14]!==d||e[15]!==i||e[16]!==m||e[17]!==f?(y=async()=>{const R=await we({connectionId:s,orgId:i,orgSlug:m,persistFallback:T=>j.update.mutateAsync({id:s,data:{connection_token:T}}).then(dt)});if(R.ran&&!R.ok)throw new Error(R.error??"no token received");const E=new URL(`/api/${m}/mcp/${s}`,window.location.origin);await f.invalidateQueries({queryKey:ie.isMCPAuthenticated(E.href,null)}),await f.invalidateQueries({queryKey:ie.mcpClientPrefix()}),await d.refetch()},e[12]=j,e[13]=s,e[14]=d,e[15]=i,e[16]=m,e[17]=f,e[18]=y):y=e[18];let k;e[19]!==n?(k=R=>{M.error(n("common.githubRepoPicker.failedReconnect",{error:R instanceof Error?R.message:n("common.githubRepoPicker.unknownError")}))},e[19]=n,e[20]=k):k=e[20];let N;e[21]!==y||e[22]!==k?(N={mutationFn:y,onError:k},e[21]=y,e[22]=k,e[23]=N):N=e[23];const p=be(N);if(d.isLoading){let R;return e[24]===Symbol.for("react.memo_cache_sentinel")?(R=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(B,{className:"size-4.5 text-muted-foreground"})}),e[24]=R):R=e[24],R}if(d.isError){let R;e[25]!==n?(R=n("common.githubRepoPicker.failedLoadAccounts"),e[25]=n,e[26]=R):R=e[26];let E;e[27]!==R?(E=t.jsx("p",{className:"text-sm text-destructive",children:R}),e[27]=R,e[28]=E):E=e[28];let T;e[29]!==n?(T=n("common.githubRepoPicker.connectionExpiredMessage"),e[29]=n,e[30]=T):T=e[30];let G;e[31]!==T?(G=t.jsx("p",{className:"text-xs text-muted-foreground max-w-[280px] leading-relaxed",children:T}),e[31]=T,e[32]=G):G=e[32];let F;e[33]!==p?(F=()=>p.mutate(),e[33]=p,e[34]=F):F=e[34];const q=p.isPending;let $;e[35]!==p.isPending?($=p.isPending?t.jsx(B,{className:"size-3.5"}):t.jsx(Q,{className:"size-3.5"}),e[35]=p.isPending,e[36]=$):$=e[36];let O;e[37]!==n?(O=n("common.githubRepoPicker.reconnectGitHub"),e[37]=n,e[38]=O):O=e[38];let U;e[39]!==p.isPending||e[40]!==F||e[41]!==$||e[42]!==O?(U=t.jsxs(ce,{type:"button",variant:"outline",size:"sm",onClick:F,disabled:q,children:[$,O]}),e[39]=p.isPending,e[40]=F,e[41]=$,e[42]=O,e[43]=U):U=e[43];let D;return e[44]!==G||e[45]!==U||e[46]!==E?(D=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-6 text-center",children:[E,G,U]}),e[44]=G,e[45]=U,e[46]=E,e[47]=D):D=e[47],D}const r=d.data;if(!r)return null;if(r.installations.length===0){let R;e[48]!==l||e[49]!==c||e[50]!==n?(R=c&&t.jsx("div",{className:"flex items-center gap-1 px-4 pt-3 pb-1 shrink-0",children:t.jsxs("button",{type:"button",onClick:l,className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[t.jsx(ae,{size:12}),n("common.githubRepoPicker.changeConnection")]})}),e[48]=l,e[49]=c,e[50]=n,e[51]=R):R=e[51];let E;e[52]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx("div",{className:"size-16 rounded-2xl bg-muted flex items-center justify-center",children:t.jsx(Q,{className:"size-8 text-foreground"})}),e[52]=E):E=e[52];let T;e[53]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx("span",{className:"size-1.5 rounded-full bg-success"}),e[53]=T):T=e[53];let G;e[54]!==n?(G=n("common.githubRepoPicker.githubConnected"),e[54]=n,e[55]=G):G=e[55];let F;e[56]!==G?(F=t.jsxs("div",{className:"mt-4 flex items-center gap-1.5 text-xs font-medium text-success",children:[T,G]}),e[56]=G,e[57]=F):F=e[57];let q;e[58]!==n?(q=n("common.githubRepoPicker.setupRepositoriesTitle"),e[58]=n,e[59]=q):q=e[59];let $;e[60]!==q?($=t.jsx("h2",{className:"mt-2 text-base font-semibold text-foreground",children:q}),e[60]=q,e[61]=$):$=e[61];let O;e[62]!==n?(O=n("common.githubRepoPicker.noRepositoriesShared"),e[62]=n,e[63]=O):O=e[63];let U;e[64]!==O?(U=t.jsx("p",{className:"mt-1.5 max-w-[360px] text-xs leading-relaxed text-muted-foreground",children:O}),e[64]=O,e[65]=U):U=e[65];let D;e[66]!==n?(D=n("common.githubRepoPicker.chooseRepositories"),e[66]=n,e[67]=D):D=e[67];let le;e[68]===Symbol.for("react.memo_cache_sentinel")?(le=t.jsx(Oe,{size:14}),e[68]=le):le=e[68];let V;e[69]!==D?(V=t.jsx(ce,{asChild:!0,size:"sm",children:t.jsxs("a",{href:ge,target:"_blank",rel:"noopener noreferrer",children:[D,le]})}),e[69]=D,e[70]=V):V=e[70];let K;e[71]!==d?(K=()=>{d.refetch()},e[71]=d,e[72]=K):K=e[72];const Te=d.isFetching;let W;e[73]!==d.isFetching?(W=d.isFetching&&t.jsx(B,{className:"size-3.5"}),e[73]=d.isFetching,e[74]=W):W=e[74];let J;e[75]!==n?(J=n("common.githubRepoPicker.checkAgain"),e[75]=n,e[76]=J):J=e[76];let Y;e[77]!==d.isFetching||e[78]!==K||e[79]!==W||e[80]!==J?(Y=t.jsxs(ce,{type:"button",variant:"outline",size:"sm",onClick:K,disabled:Te,children:[W,J]}),e[77]=d.isFetching,e[78]=K,e[79]=W,e[80]=J,e[81]=Y):Y=e[81];let X;e[82]!==V||e[83]!==Y?(X=t.jsxs("div",{className:"mt-5 flex items-center gap-2",children:[V,Y]}),e[82]=V,e[83]=Y,e[84]=X):X=e[84];let Z;e[85]!==n?(Z=n("common.githubRepoPicker.repositoryAccessNote"),e[85]=n,e[86]=Z):Z=e[86];let ee;e[87]!==Z?(ee=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:Z}),e[87]=Z,e[88]=ee):ee=e[88];let te;e[89]!==F||e[90]!==$||e[91]!==U||e[92]!==X||e[93]!==ee?(te=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center px-8 py-6 text-center",children:[E,F,$,U,X,ee]}),e[89]=F,e[90]=$,e[91]=U,e[92]=X,e[93]=ee,e[94]=te):te=e[94];let re;return e[95]!==te||e[96]!==R?(re=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[R,te]}),e[95]=te,e[96]=R,e[97]=re):re=e[97],re}let P;e[98]!==l||e[99]!==c||e[100]!==n?(P=c&&t.jsx("div",{className:"flex items-center gap-1 px-4 pt-3 pb-1 shrink-0",children:t.jsxs("button",{type:"button",onClick:l,className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[t.jsx(ae,{size:12}),n("common.githubRepoPicker.changeConnection")]})}),e[98]=l,e[99]=c,e[100]=n,e[101]=P):P=e[101];let v;if(e[102]!==r.installations||e[103]!==o||e[104]!==n){let R;e[106]!==o||e[107]!==n?(R=E=>t.jsxs("button",{type:"button",onClick:()=>o(E),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:E.avatarUrl,alt:E.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:E.login}),E.type==="User"&&t.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:n("common.githubRepoPicker.personalAccount")})]}),t.jsxs("span",{className:"text-xs text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity shrink-0",children:[n("common.githubRepoPicker.select")," →"]})]},E.installationId),e[106]=o,e[107]=n,e[108]=R):R=e[108],v=r.installations.map(R),e[102]=r.installations,e[103]=o,e[104]=n,e[105]=v}else v=e[105];let w;e[109]!==v?(w=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden [scrollbar-gutter:stable]",children:v}),e[109]=v,e[110]=w):w=e[110];let C;e[111]!==n?(C=n("common.githubRepoPicker.accountNotListed"),e[111]=n,e[112]=C):C=e[112];let I;e[113]!==n?(I=n("common.githubRepoPicker.installGitHubApp"),e[113]=n,e[114]=I):I=e[114];let S;e[115]!==I?(S=t.jsx("span",{className:"underline underline-offset-2",children:I}),e[115]=I,e[116]=S):S=e[116];let A;e[117]!==C||e[118]!==S?(A=t.jsx("div",{className:"px-4 py-3 border-t border-border shrink-0",children:t.jsxs("a",{href:ge,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:[C," ",S]})}),e[117]=C,e[118]=S,e[119]=A):A=e[119];let _;return e[120]!==w||e[121]!==A||e[122]!==P?(_=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[P,w,A]}),e[120]=w,e[121]=A,e[122]=P,e[123]=_):_=e[123],_}function dt(){}function mt(h){const e=L.c(23),{connectionId:s,orgId:i,orgSlug:m,installation:o,onSelectRepo:c,isSaving:l}=h,n=H(),[a,u]=z.useState(""),f=Pe(a,300),j=z.useDeferredValue(f),g=a!==j;let x;e[0]!==n?(x=n("common.githubRepoPicker.searchRepositories"),e[0]=n,e[1]=x):x=e[1];let b;e[2]!==g||e[3]!==a||e[4]!==x?(b=t.jsx(ve,{placeholder:x,value:a,onChange:u,isSearching:g}),e[2]=g,e[3]=a,e[4]=x,e[5]=b):b=e[5];const d=g?"opacity-40":"opacity-100";let y;e[6]!==d?(y=oe("flex-1 overflow-hidden flex flex-col transition-opacity duration-150",d),e[6]=d,e[7]=y):y=e[7];let k;e[8]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(B,{className:"size-4.5 text-muted-foreground"})}),e[8]=k):k=e[8];let N;e[9]!==s||e[10]!==j||e[11]!==o||e[12]!==l||e[13]!==c||e[14]!==i||e[15]!==m?(N=t.jsx(z.Suspense,{fallback:k,children:t.jsx(ft,{connectionId:s,orgId:i,orgSlug:m,installation:o,query:j,onSelectRepo:c,isSaving:l})}),e[9]=s,e[10]=j,e[11]=o,e[12]=l,e[13]=c,e[14]=i,e[15]=m,e[16]=N):N=e[16];let p;e[17]!==y||e[18]!==N?(p=t.jsx("div",{className:y,children:N}),e[17]=y,e[18]=N,e[19]=p):p=e[19];let r;return e[20]!==b||e[21]!==p?(r=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[b,p]}),e[20]=b,e[21]=p,e[22]=r):r=e[22],r}function ft(h){const e=L.c(36),{connectionId:s,orgId:i,orgSlug:m,installation:o,query:c,onSelectRepo:l,isSaving:n}=h,a=H();let u;e[0]!==s||e[1]!==i||e[2]!==m?(u={connectionId:s,orgId:i,orgSlug:m},e[0]=s,e[1]=i,e[2]=m,e[3]=u):u=e[3];const f=se(u),j=o.type==="User"?"user":"org",g=c?`${j}:${o.login} ${c} in:name fork:true`:`${j}:${o.login} fork:true`;let x;e[4]!==s||e[5]!==o.login||e[6]!==i||e[7]!==c?(x=ie.githubOrgRepos(i,s,o.login,c),e[4]=s,e[5]=o.login,e[6]=i,e[7]=c,e[8]=x):x=e[8];let b;e[9]!==f||e[10]!==g?(b=async p=>{const{signal:r}=p,v=(await f.callTool({name:"search_repositories",arguments:{query:g,page:1,perPage:30}},void 0,{signal:r})).content?.[0]?.text;if(!v)throw new Error("No response from search_repositories");return(JSON.parse(v).items??[]).map(xt)},e[9]=f,e[10]=g,e[11]=b):b=e[11];let d;e[12]!==x||e[13]!==b?(d={queryKey:x,queryFn:b},e[12]=x,e[13]=b,e[14]=d):d=e[14];const{data:y}=Le(d);if(y.length===0){let p;e[15]!==a?(p=a("common.githubRepoPicker.noRepositoriesFound"),e[15]=a,e[16]=p):p=e[16];let r;e[17]!==p?(r=t.jsx("p",{className:"text-sm text-muted-foreground",children:p}),e[17]=p,e[18]=r):r=e[18];let P;e[19]!==c||e[20]!==a?(P=c&&t.jsx("p",{className:"text-xs text-muted-foreground/60",children:a("common.githubRepoPicker.tryDifferentSearchTerm")}),e[19]=c,e[20]=a,e[21]=P):P=e[21];let v;return e[22]!==r||e[23]!==P?(v=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-1",children:[r,P]}),e[22]=r,e[23]=P,e[24]=v):v=e[24],v}let k;if(e[25]!==n||e[26]!==l||e[27]!==y||e[28]!==a){let p;e[30]!==n||e[31]!==l||e[32]!==a?(p=r=>t.jsxs("button",{type:"button",onClick:()=>l(r),disabled:n,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(Q,{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:r.name}),r.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:a("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:[r.private?t.jsx(Ge,{size:10}):t.jsx(Ue,{size:10}),r.private?a("common.githubRepoPicker.private"):a("common.githubRepoPicker.public")]})]},r.fullName),e[30]=n,e[31]=l,e[32]=a,e[33]=p):p=e[33],k=y.map(p),e[25]=n,e[26]=l,e[27]=y,e[28]=a,e[29]=k}else k=e[29];let N;return e[34]!==k?(N=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden flex flex-col [scrollbar-gutter:stable]",children:k}),e[34]=k,e[35]=N):N=e[35],N}function xt(h){return{name:h.name,fullName:h.full_name,owner:h.full_name.split("/")[0]??"",url:h.html_url,private:h.private,description:h.description,updatedAt:h.updated_at,fork:h.fork??!1}}function me(h){const e=L.c(51),{status:s,error:i,retry:m}=h,o=H();if(s==="error"){let v;e[0]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("div",{className:"size-10 rounded-full bg-destructive/10 flex items-center justify-center",children:t.jsx(Q,{className:"size-5 text-destructive"})}),e[0]=v):v=e[0];let w;e[1]!==o?(w=o("common.githubRepoPicker.connectionFailed"),e[1]=o,e[2]=w):w=e[2];let C;e[3]!==w?(C=t.jsx("p",{className:"text-sm font-medium",children:w}),e[3]=w,e[4]=C):C=e[4];let I;e[5]!==i||e[6]!==o?(I=i??o("common.githubRepoPicker.somethingWentWrong"),e[5]=i,e[6]=o,e[7]=I):I=e[7];let S;e[8]!==I?(S=t.jsx("p",{className:"text-xs text-muted-foreground max-w-[260px] leading-relaxed",children:I}),e[8]=I,e[9]=S):S=e[9];let A;e[10]!==C||e[11]!==S?(A=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[C,S]}),e[10]=C,e[11]=S,e[12]=A):A=e[12];let _;e[13]!==o?(_=o("common.githubRepoPicker.tryAgain"),e[13]=o,e[14]=_):_=e[14];let R;e[15]!==m||e[16]!==_?(R=t.jsx("button",{type:"button",onClick:m,className:"text-xs font-medium text-foreground border border-border rounded-md px-3 py-1.5 hover:bg-accent transition-colors",children:_}),e[15]=m,e[16]=_,e[17]=R):R=e[17];let E;return e[18]!==A||e[19]!==R?(E=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[v,A,R]}),e[18]=A,e[19]=R,e[20]=E):E=e[20],E}const c=s==="authenticating";let l;e[21]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("div",{className:"size-10 rounded-full bg-muted flex items-center justify-center",children:t.jsx(Q,{className:"size-5 text-foreground"})}),e[21]=l):l=e[21];let n;e[22]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsxs("div",{className:"relative size-10",children:[l,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(B,{className:"size-3 text-muted-foreground"})})]}),e[22]=n):n=e[22];let a;e[23]!==c||e[24]!==o?(a=o(c?"common.githubRepoPicker.authenticatingGitHub":"common.githubRepoPicker.settingUpGitHub"),e[23]=c,e[24]=o,e[25]=a):a=e[25];let u;e[26]!==a?(u=t.jsx("p",{className:"text-sm font-medium",children:a}),e[26]=a,e[27]=u):u=e[27];let f;e[28]!==c||e[29]!==o?(f=o(c?"common.githubRepoPicker.completeOAuthFlow":"common.githubRepoPicker.installingGitHubConnection"),e[28]=c,e[29]=o,e[30]=f):f=e[30];let j;e[31]!==f?(j=t.jsx("p",{className:"text-xs text-muted-foreground",children:f}),e[31]=f,e[32]=j):j=e[32];let g;e[33]!==u||e[34]!==j?(g=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[u,j]}),e[33]=u,e[34]=j,e[35]=g):g=e[35];const x=c?"bg-muted-foreground/30":"bg-foreground animate-pulse";let b;e[36]!==x?(b=oe("size-1.5 rounded-full",x),e[36]=x,e[37]=b):b=e[37];let d;e[38]!==b?(d=t.jsx("span",{className:b}),e[38]=b,e[39]=d):d=e[39];const y=c?"bg-foreground animate-pulse":"bg-muted-foreground/30";let k;e[40]!==y?(k=oe("size-1.5 rounded-full",y),e[40]=y,e[41]=k):k=e[41];let N;e[42]!==k?(N=t.jsx("span",{className:k}),e[42]=k,e[43]=N):N=e[43];let p;e[44]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("span",{className:"size-1.5 rounded-full bg-muted-foreground/30"}),e[44]=p):p=e[44];let r;e[45]!==d||e[46]!==N?(r=t.jsxs("div",{className:"flex items-center gap-1.5",children:[d,N,p]}),e[45]=d,e[46]=N,e[47]=r):r=e[47];let P;return e[48]!==r||e[49]!==g?(P=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[n,g,r]}),e[48]=r,e[49]=g,e[50]=P):P=e[50],P}export{_t as G,Ze as a,Je as u};
|
|
1
|
+
import{c as L,G as ue,a as _e,n as de,r as z,aR as ne,b as H,j as t,B as ce,b4 as he,l as oe,h as B,ff as pe,t as M,e as be,K as ie,m as ze,x as Le,z as Ge}from"./index-Cq8Pvay3.js";import{c as je,d as ye,b as ke,D as Ne}from"./dialog-CzPQcE4z.js";import{C as ve}from"./collection-search-D4iyLe2V.js";import{u as Pe}from"./use-debounced-value-DwukIiaZ.js";import{b as Re,u as Fe}from"./use-connection-DWdDv9Yx.js";import{u as se}from"./use-mcp-client-CF-3mvGg.js";import{W as $e,S as fe}from"./constants-Daqiz8AS.js";import{a as we}from"./authenticate-and-persist-oauth-B3ICSnyd.js";import{i as ae}from"./ArrowLeft-bSm3BNTP.js";import{n as Oe}from"./LinkExternal01-Ajyc9uFz.js";import{n as Ue}from"./Share07-C_FfyIR6.js";import{c as De}from"./use-mcp-tools-BuSZglWG.js";import{e as He}from"./extract-connection-data-kN2PmA7O.js";import{u as Ce}from"./use-navigate-to-agent-Hm-6dVUl.js";import{G as Q}from"./github-icon-DrHBaXxl.js";import{b as Me,p as xe,f as qe,G as ge}from"./provision-repo-scoped-github-connection-WQFARyHG.js";import{u as Se,a as Be,b as Qe,c as Ve,G as Ke}from"./gitlab-icon-CqhnK68r.js";import{i as We}from"./SearchLg-BW5z-Jmq.js";function Je(h,e){const s=L.c(12),{org:i}=ue();let m;s[0]!==i.id?(m=$e.REGISTRY(i.id),s[0]=i.id,s[1]=m):m=s[1];const o=m;let c;s[2]!==i.id||s[3]!==i.slug||s[4]!==o?(c={connectionId:o,orgId:i.id,orgSlug:i.slug},s[2]=i.id,s[3]=i.slug,s[4]=o,s[5]=c):c=s[5];const l=se(c);let n;s[6]!==h?(n={name:h},s[6]=h,s[7]=n):n=s[7];const a=e?.enabled??!0;let u;return s[8]!==l||s[9]!==n||s[10]!==a?(u={client:l,toolName:"COLLECTION_REGISTRY_APP_GET",toolArguments:n,enabled:a,staleTime:3e5,select:Ye},s[8]=l,s[9]=n,s[10]=a,s[11]=u):u=s[11],De(u)}function Ye(h){return h.structuredContent?.item??null}const Xe="deco/mcp-github";function Ze(h){const{org:e}=ue(),{data:s}=_e.useSession(),i=Re(),m=de(),[o,c]=z.useState("idle"),[l,n]=z.useState(null),[a,u]=z.useState(null),{data:f,isLoading:j}=Je(Xe,{enabled:h.enabled}),g=z.useRef(!1);h.enabled&&f&&!j&&!g.current&&s?.user?.id&&o==="idle"&&(g.current=!0,x());async function x(){if(!(!f||!s?.user?.id||!e))try{c("installing"),n(null);const d=He(f,e.id,s.user.id,{remoteIndex:0});if(!d.connection_url)throw new Error("Registry item is missing a remote URL for mcp-github");const{id:k}=await i.create.mutateAsync(d);c("authenticating");const N=await we({connectionId:k,orgId:e.id,orgSlug:e.slug,persistFallback:p=>i.update.mutateAsync({id:k,data:{connection_token:p}}).then(()=>{})});if(N.ran&&!N.ok){try{await i.delete.mutateAsync(k)}catch{}throw new Error(N.error&&N.error!=="no token received"?N.error:"No token received from GitHub")}ne(m,e.id),u(d),c("ready")}catch(d){n(d instanceof Error?d.message:String(d)),c("error")}}function b(){c("idle"),n(null),u(null),g.current=!1}return h.enabled&&j&&o==="idle"?{status:"installing",error:null,connection:null,retry:b}:{status:o,error:l,connection:a,retry:b}}function Ie(h){const e=L.c(3),{provider:s,className:i}=h;let m;return e[0]!==i||e[1]!==s?(m=s==="gitlab"?t.jsx(Ke,{size:16,className:i}):t.jsx(Q,{size:16,className:i}),e[0]=i,e[1]=s,e[2]=m):m=e[2],m}function Ee(h){return(h??[]).filter(e=>e.status==="active"&&e.servable)}function Ae(h){const e=L.c(20),{provider:s,path:i,host:m,hint:o,disabled:c,busy:l,onSelect:n}=h,a=c&&"opacity-60 cursor-not-allowed";let u;e[0]!==a?(u=oe("w-full flex items-center gap-3 px-4 py-2.5 text-left hover:bg-muted/60 transition-colors",a),e[0]=a,e[1]=u):u=e[1];let f;e[2]!==s?(f=t.jsx(Ie,{provider:s,className:"text-muted-foreground"}),e[2]=s,e[3]=f):f=e[3];let j;e[4]!==i?(j=t.jsx("span",{className:"block text-sm truncate",children:i}),e[4]=i,e[5]=j):j=e[5];const g=o?`${m} · ${o}`:m;let x;e[6]!==g?(x=t.jsx("span",{className:"block text-xs text-muted-foreground truncate",children:g}),e[6]=g,e[7]=x):x=e[7];let b;e[8]!==j||e[9]!==x?(b=t.jsxs("span",{className:"flex-1 min-w-0",children:[j,x]}),e[8]=j,e[9]=x,e[10]=b):b=e[10];let d;e[11]!==l?(d=l?t.jsx(B,{className:"size-4 text-muted-foreground"}):null,e[11]=l,e[12]=d):d=e[12];let y;return e[13]!==c||e[14]!==n||e[15]!==u||e[16]!==f||e[17]!==b||e[18]!==d?(y=t.jsxs("button",{type:"button",disabled:c,onClick:n,className:u,children:[f,b,d]}),e[13]=c,e[14]=n,e[15]=u,e[16]=f,e[17]=b,e[18]=d,e[19]=y):y=e[19],y}function et(h){const e=L.c(17),{onPick:s,pendingPath:i}=h,m=H(),o=Ve();if(o.isPending){let j;return e[0]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(he,{className:"h-24 w-full"}),e[0]=j):j=e[0],j}let c;e[1]!==o.data?(c=o.data??[],e[1]=o.data,e[2]=c):c=e[2];const l=c;if(l.length===0)return null;let n;e[3]!==m?(n=m("common.repositoryPicker.linkedSection"),e[3]=m,e[4]=n):n=e[4];let a;e[5]!==n?(a=t.jsx("p",{className:"px-4 py-2 text-xs font-medium text-muted-foreground",children:n}),e[5]=n,e[6]=a):a=e[6];let u;if(e[7]!==s||e[8]!==i||e[9]!==l){let j;e[11]!==s||e[12]!==i?(j=g=>t.jsx(Ae,{provider:g.provider,path:g.path,host:g.host,hint:g.defaultBranch,disabled:i!==null,busy:i===g.path,onSelect:()=>s(g)},g.id),e[11]=s,e[12]=i,e[13]=j):j=e[13],u=l.map(j),e[7]=s,e[8]=i,e[9]=l,e[10]=u}else u=e[10];let f;return e[14]!==a||e[15]!==u?(f=t.jsxs("div",{children:[a,u]}),e[14]=a,e[15]=u,e[16]=f):f=e[16],f}function tt(h){const e=L.c(22),{account:s,onLink:i,pendingPath:m}=h,o=H(),[c,l]=z.useState(""),n=Pe(c,300),a=z.useDeferredValue(n),u=c!==a,f=Qe(s.id,a);let j;e[0]!==o?(j=o("common.repositoryPicker.searchPlaceholder"),e[0]=o,e[1]=j):j=e[1];const g=u||f.isFetching;let x;e[2]!==c||e[3]!==j||e[4]!==g?(x=t.jsx(ve,{placeholder:j,value:c,onChange:l,isSearching:g}),e[2]=c,e[3]=j,e[4]=g,e[5]=x):x=e[5];const b=u?"opacity-40":"opacity-100";let d;e[6]!==b?(d=oe("flex-1 overflow-y-auto transition-opacity duration-150",b),e[6]=b,e[7]=d):d=e[7];let y;e[8]!==i||e[9]!==m||e[10]!==f.data||e[11]!==f.error||e[12]!==f.isError||e[13]!==f.isPending||e[14]!==o?(y=f.isPending?t.jsx("div",{className:"flex-1 flex items-center justify-center py-10",children:t.jsx(B,{className:"size-4.5 text-muted-foreground"})}):f.isError?t.jsx("p",{className:"px-4 py-10 text-center text-sm text-muted-foreground",children:f.error instanceof Error?f.error.message:o("common.repositoryPicker.searchFailed")}):(f.data??[]).length===0?t.jsx("p",{className:"px-4 py-10 text-center text-sm text-muted-foreground",children:o("common.repositoryPicker.searchEmpty")}):(f.data??[]).map(p=>t.jsx(Ae,{provider:p.ref.provider,path:p.ref.path,host:p.ref.host,hint:p.visibility,disabled:m!==null,busy:m===p.ref.path,onSelect:()=>i(p.webUrl,p.ref.path)},`${p.ref.host}/${p.ref.path}`)),e[8]=i,e[9]=m,e[10]=f.data,e[11]=f.error,e[12]=f.isError,e[13]=f.isPending,e[14]=o,e[15]=y):y=e[15];let k;e[16]!==d||e[17]!==y?(k=t.jsx("div",{className:d,children:y}),e[16]=d,e[17]=y,e[18]=k):k=e[18];let N;return e[19]!==x||e[20]!==k?(N=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[x,k]}),e[19]=x,e[20]=k,e[21]=N):N=e[21],N}function nt(h){const e=L.c(12),{accounts:s,onSelect:i}=h,m=H();let o;e[0]!==m?(o=m("common.repositoryPicker.browseSection"),e[0]=m,e[1]=o):o=e[1];let c;e[2]!==o?(c=t.jsx("p",{className:"px-4 py-2 text-xs font-medium text-muted-foreground",children:o}),e[2]=o,e[3]=c):c=e[3];let l;if(e[4]!==s||e[5]!==i){let a;e[7]!==i?(a=u=>t.jsxs("button",{type:"button",onClick:()=>i(u),className:"w-full flex items-center gap-3 px-4 py-2.5 text-left hover:bg-muted/60 transition-colors",children:[t.jsx(Ie,{provider:u.type,className:"text-muted-foreground"}),t.jsxs("span",{className:"flex-1 min-w-0",children:[t.jsx("span",{className:"block text-sm truncate",children:u.login}),t.jsx("span",{className:"block text-xs text-muted-foreground truncate",children:u.host})]}),t.jsx(We,{size:14,className:"text-muted-foreground"})]},u.id),e[7]=i,e[8]=a):a=e[8],l=s.map(a),e[4]=s,e[5]=i,e[6]=l}else l=e[6];let n;return e[9]!==c||e[10]!==l?(n=t.jsxs("div",{className:"flex-1 overflow-y-auto",children:[c,l]}),e[9]=c,e[10]=l,e[11]=n):n=e[11],n}function st(h){const e=L.c(37),{open:s,onOpenChange:i,title:m,onPicked:o,onError:c}=h,l=H(),n=Se(),a=Be(),[u,f]=z.useState(null),[j,g]=z.useState(null);let x;e[0]!==n.data?(x=Ee(n.data),e[0]=n.data,e[1]=x):x=e[1];const b=x;let d;e[2]!==o?(d=function(R){g(R.path),o({repository:R}),g(null)},e[2]=o,e[3]=d):d=e[3];const y=d;let k;e[4]!==u||e[5]!==a||e[6]!==c||e[7]!==o||e[8]!==l?(k=function(R,E){u&&(g(E),a.mutate({url:R,accountId:u.id},{onSuccess:T=>o({repository:T}),onError:T=>c?.(T instanceof Error?T.message:l("common.repositoryPicker.linkFailed")),onSettled:()=>g(null)}))},e[4]=u,e[5]=a,e[6]=c,e[7]=o,e[8]=l,e[9]=k):k=e[9];const N=k;let p;e[10]!==i?(p=_=>{_||f(null),i(_)},e[10]=i,e[11]=p):p=e[11];let r;e[12]!==m?(r=t.jsx(je,{className:"sr-only",children:t.jsx(ye,{children:m})}),e[12]=m,e[13]=r):r=e[13];let P;e[14]!==u||e[15]!==l?(P=u?t.jsx(ce,{size:"icon",variant:"ghost",onClick:()=>f(null),"aria-label":l("common.repositoryPicker.back"),children:t.jsx(ae,{size:16})}):null,e[14]=u,e[15]=l,e[16]=P):P=e[16];const v=u?u.login:m;let w;e[17]!==v?(w=t.jsx("span",{className:"text-sm font-medium truncate",children:v}),e[17]=v,e[18]=w):w=e[18];let C;e[19]!==P||e[20]!==w?(C=t.jsxs("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3 shrink-0",children:[P,w]}),e[19]=P,e[20]=w,e[21]=C):C=e[21];let I;e[22]!==u||e[23]!==n.isPending||e[24]!==N||e[25]!==j||e[26]!==y||e[27]!==b?(I=n.isPending?t.jsx("div",{className:"p-4",children:t.jsx(he,{className:"h-24 w-full"})}):u?t.jsx(tt,{account:u,onLink:N,pendingPath:j}):t.jsxs("div",{className:"flex-1 overflow-y-auto",children:[t.jsx(et,{onPick:y,pendingPath:j}),b.length>0?t.jsx(nt,{accounts:b,onSelect:f}):null]}),e[22]=u,e[23]=n.isPending,e[24]=N,e[25]=j,e[26]=y,e[27]=b,e[28]=I):I=e[28];let S;e[29]!==I||e[30]!==r||e[31]!==C?(S=t.jsxs(ke,{className:"sm:max-w-[560px] h-[85svh] sm:h-[520px] p-0 gap-0 overflow-hidden flex flex-col",children:[r,C,I]}),e[29]=I,e[30]=r,e[31]=C,e[32]=S):S=e[32];let A;return e[33]!==s||e[34]!==S||e[35]!==p?(A=t.jsx(Ne,{open:s,onOpenChange:p,children:S}),e[33]=s,e[34]=S,e[35]=p,e[36]=A):A=e[36],A}function it(h){const e=h.path.split("/"),s=e[e.length-1]??h.path;return{owner:e.slice(0,-1).join("/"),name:s,fullName:h.path,url:h.webUrl,private:h.visibility!=="public",description:null,updatedAt:h.updatedAt,fork:!1}}function ot(h,e,s){return{title:e.name,description:s.description,pinned:!1,icon:null,metadata:{githubRepo:{owner:e.owner,name:e.name,url:e.url,repositoryId:h.id},instructions:null,ui:{pinnedViews:null,layout:{defaultMainView:{type:"site-editor"},chatDefaultOpen:!0}}},connections:[]}}function lt(h){const e=L.c(26),{open:s,onOpenChange:i,title:m,onImportComplete:o,mode:c}=h,l=c===void 0?"agent":c,n=H(),{org:a}=ue(),u=de(),f=Ce();let j;e[0]!==a.id||e[1]!==a.slug?(j={connectionId:fe,orgId:a.id,orgSlug:a.slug},e[0]=a.id,e[1]=a.slug,e[2]=j):j=e[2];const g=se(j);let x;e[3]!==l||e[4]!==n||e[5]!==m?(x=m??n(l==="connection"?"common.githubRepoPicker.addRepo":"common.githubRepoPicker.importFromGitHub"),e[3]=l,e[4]=n,e[5]=m,e[6]=x):x=e[6];const b=x;let d;e[7]!==g||e[8]!==n?(d=async function(v,w){const C=await g.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:ot(v,w,{description:n("common.repositoryPicker.agentDescription",{path:v.path})})}}),S=(C.structuredContent??C).item?.id;if(!S)throw new Error(n("common.repositoryPicker.createAgentFailed"));return S},e[7]=g,e[8]=n,e[9]=d):d=e[9];const y=d;let k;e[10]!==y||e[11]!==l||e[12]!==f||e[13]!==o||e[14]!==i||e[15]!==a.id||e[16]!==u||e[17]!==n?(k=function(v){const w=it(v);if(i(!1),l==="connection"){if(ne(u,a.id),pe(u,a.id),o){o({virtualMcpId:null,repo:w,connectionId:null,repositoryId:v.id});return}M.success(n("common.githubRepoPicker.addedRepo",{name:w.name}));return}y(v,w).then(C=>{if(ne(u,a.id),o){o({virtualMcpId:C,repo:w,connectionId:null,repositoryId:v.id});return}M.success(n("common.githubRepoPicker.importedRepo",{name:w.name})),f(C)}).catch(C=>{M.error(C instanceof Error?C.message:n("common.repositoryPicker.createAgentFailed"))})},e[10]=y,e[11]=l,e[12]=f,e[13]=o,e[14]=i,e[15]=a.id,e[16]=u,e[17]=n,e[18]=k):k=e[18];const N=k;let p;e[19]!==N?(p=P=>{const{repository:v}=P;return N(v)},e[19]=N,e[20]=p):p=e[20];let r;return e[21]!==i||e[22]!==s||e[23]!==b||e[24]!==p?(r=t.jsx(st,{open:s,onOpenChange:i,title:b,onPicked:p,onError:rt}),e[21]=i,e[22]=s,e[23]=b,e[24]=p,e[25]=r):r=e[25],r}function rt(h){return M.error(h)}function _t(h){const e=L.c(4),s=Se();if(!s.isPending&&Ee(s.data).length>0){let m;return e[0]!==h?(m=t.jsx(lt,{...h}),e[0]=h,e[1]=m):m=e[1],m}let i;return e[2]!==h?(i=t.jsx(ct,{...h}),e[2]=h,e[3]=i):i=e[3],i}function ct(h){const e=L.c(27),{open:s,onOpenChange:i,title:m,onImportComplete:o,mode:c}=h,l=c===void 0?"agent":c,n=H();let a;e[0]!==l||e[1]!==n||e[2]!==m?(a=m??n(l==="connection"?"common.githubRepoPicker.addRepo":"common.githubRepoPicker.importFromGitHub"),e[0]=l,e[1]=n,e[2]=m,e[3]=a):a=e[3];const u=a,[f,j]=z.useState(null);let g;e[4]!==u?(g=t.jsx(je,{className:"sr-only",children:t.jsx(ye,{children:u})}),e[4]=u,e[5]=g):g=e[5];let x;e[6]!==u||e[7]!==f||e[8]!==n?(x=t.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3 shrink-0",children:f?t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:()=>j(null),className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors shrink-0","aria-label":n("common.githubRepoPicker.backToAccounts"),children:t.jsx(ae,{size:16})}),t.jsx("img",{src:f.avatarUrl,alt:f.login,className:"size-5 rounded-full ring-1 ring-border shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:f.login})]}):t.jsxs(t.Fragment,{children:[t.jsx(Q,{className:"size-4 text-foreground shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:u})]})}),e[6]=u,e[7]=f,e[8]=n,e[9]=x):x=e[9];let b;e[10]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(B,{className:"size-4.5 text-muted-foreground"})}),e[10]=b):b=e[10];let d;e[11]!==i?(d=()=>i(!1),e[11]=i,e[12]=d):d=e[12];let y;e[13]!==l||e[14]!==o||e[15]!==s||e[16]!==f||e[17]!==d?(y=t.jsx("div",{className:"flex-1 overflow-hidden flex flex-col min-w-0",children:t.jsx(z.Suspense,{fallback:b,children:t.jsx(at,{open:s,onComplete:d,selectedInstallation:f,onSelectInstallation:j,onImportComplete:o,mode:l})})}),e[13]=l,e[14]=o,e[15]=s,e[16]=f,e[17]=d,e[18]=y):y=e[18];let k;e[19]!==g||e[20]!==x||e[21]!==y?(k=t.jsxs(ke,{className:"sm:max-w-[560px] h-[85svh] sm:h-[520px] p-0 gap-0 overflow-hidden flex flex-col",children:[g,x,y]}),e[19]=g,e[20]=x,e[21]=y,e[22]=k):k=e[22];let N;return e[23]!==i||e[24]!==s||e[25]!==k?(N=t.jsx(Ne,{open:s,onOpenChange:i,children:k}),e[23]=i,e[24]=s,e[25]=k,e[26]=N):N=e[26],N}function at({open:h,onComplete:e,selectedInstallation:s,onSelectInstallation:i,onImportComplete:m,mode:o="agent"}){const c=H(),{org:l}=ue(),n=de(),a=Ce(),[u,f]=z.useState(null),j=Fe({slug:"mcp-github"}),g=Me(j),x=Ze({enabled:h&&g.length===0}),b=g.length===1?g[0]??null:u,d=se({connectionId:b?.id??"",orgId:l.id,orgSlug:l.slug}),y=se({connectionId:fe,orgId:l.id,orgSlug:l.slug}),k=async(r,P)=>{try{const w=await d.callTool({name:"get_file_contents",arguments:{owner:r.owner,repo:r.name,path:P}});if(w.isError)return null;const I=w.content?.find(S=>S.type==="resource")?.resource?.text;if(!I)return null;try{const S=JSON.parse(I);return typeof S=="string"?S:JSON.stringify(S)}catch{return I}}catch{return null}},N=(r,P)=>{Promise.all([k(P,"AGENTS.md"),k(P,"CLAUDE.md")]).then(async([v,w])=>{const C=v??w??null;C&&(await y.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:r,data:{metadata:{instructions:C}}}}),ne(n,l.id))}).catch(v=>{console.error("GitHub instructions fetch failed:",v)})},p=be({mutationFn:async r=>{if(!b||!s)throw new Error("No GitHub connection or installation");const P=s.installationId;if(o==="connection"){const{childConnectionId:I}=await xe({orgSlug:l.slug,sourceConnection:b,installationId:P,owner:r.owner,repo:r.name,githubCallTool:S=>d.callTool(S),selfCallTool:S=>y.callTool(S),orgShared:!0});return{virtualMcpId:null,repo:r,connectionId:I,item:null}}const{childConnectionId:v,reused:w}=await xe({orgSlug:l.slug,sourceConnection:b,installationId:P,owner:r.owner,repo:r.name,githubCallTool:I=>d.callTool(I),selfCallTool:I=>y.callTool(I)});let C=null;try{const I=await y.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:r.name,description:r.description||"Imported from GitHub",pinned:!1,icon:null,metadata:{githubRepo:{owner:r.owner,name:r.name,url:r.url,installationId:P,connectionId:v},instructions:null,ui:{pinnedViews:null,layout:{defaultMainView:{type:"site-editor"},chatDefaultOpen:!0}}},connections:[{connection_id:v}]}}}),S=I.structuredContent??I,A=S.item?.id;if(!S.item||!A)throw new Error("Failed to create the imported agent");return C=A,{virtualMcpId:A,repo:r,connectionId:v,item:S.item}}catch(I){throw C&&await y.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:C}}).catch(()=>{}),w||await y.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:v,force:!0}}).catch(()=>{}),I}},onSuccess:({virtualMcpId:r,repo:P,connectionId:v,item:w})=>{if(o==="connection"||!r||!w){if(ne(n,l.id),pe(n,l.id),m){m({virtualMcpId:null,repo:P,connectionId:v});return}M.success(c("common.githubRepoPicker.addedRepo",{name:P.name})),e();return}if(n.setQueryData(ie.collectionItem(y,l.id,"","VIRTUAL_MCP",r),{item:w}),ne(n,l.id),N(r,P),m){m({virtualMcpId:r,repo:P,connectionId:v});return}M.success(c("common.githubRepoPicker.importedRepo",{name:P.name})),e(),a(r)},onError:(r,P)=>{console.error("GitHub import failed:",r);const v=r instanceof Error?r.message:c("common.githubRepoPicker.unknownError");if(P.fork&&v.toLowerCase().includes("mint")){M.error(c("common.githubRepoPicker.failedImportFork",{name:P.name}));return}M.error(c("common.githubRepoPicker.failedImport",{error:v}))}});return x.status==="installing"||x.status==="authenticating"?t.jsx(me,{status:x.status,error:null,retry:x.retry}):x.status==="error"?t.jsx(me,{status:"error",error:x.error,retry:x.retry}):g.length===0&&x.status==="idle"?t.jsx(me,{status:"installing",error:null,retry:x.retry}):g.length>1&&!b?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:c("common.githubRepoPicker.selectConnection")})}),g.map(r=>t.jsxs("button",{type:"button",onClick:()=>f(r),className:"flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left",children:[r.icon?t.jsx("img",{src:r.icon,alt:r.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(Q,{className:"size-3.5 text-muted-foreground"})}),t.jsx("span",{className:"text-sm font-medium",children:r.title})]},r.id))]}):b?s?t.jsx(mt,{connectionId:b.id,orgId:l.id,orgSlug:l.slug,installation:s,onSelectRepo:r=>p.mutate(r),isSaving:p.isPending}):t.jsx(ut,{connectionId:b.id,orgId:l.id,orgSlug:l.slug,onSelect:i,showBackButton:g.length>1,onBack:()=>f(null)}):null}function ut(h){const e=L.c(124),{connectionId:s,orgId:i,orgSlug:m,onSelect:o,showBackButton:c,onBack:l}=h,n=H();let a;e[0]!==i||e[1]!==m?(a={connectionId:fe,orgId:i,orgSlug:m},e[0]=i,e[1]=m,e[2]=a):a=e[2];const u=se(a),f=de(),j=Re();let g;e[3]!==s||e[4]!==i?(g=ie.githubUserOrgs(i,s),e[3]=s,e[4]=i,e[5]=g):g=e[5];let x;e[6]!==s||e[7]!==u?(x=()=>qe(R=>u.callTool(R),s),e[6]=s,e[7]=u,e[8]=x):x=e[8];let b;e[9]!==g||e[10]!==x?(b={queryKey:g,queryFn:x},e[9]=g,e[10]=x,e[11]=b):b=e[11];const d=ze(b);let y;e[12]!==j||e[13]!==s||e[14]!==d||e[15]!==i||e[16]!==m||e[17]!==f?(y=async()=>{const R=await we({connectionId:s,orgId:i,orgSlug:m,persistFallback:T=>j.update.mutateAsync({id:s,data:{connection_token:T}}).then(dt)});if(R.ran&&!R.ok)throw new Error(R.error??"no token received");const E=new URL(`/api/${m}/mcp/${s}`,window.location.origin);await f.invalidateQueries({queryKey:ie.isMCPAuthenticated(E.href,null)}),await f.invalidateQueries({queryKey:ie.mcpClientPrefix()}),await d.refetch()},e[12]=j,e[13]=s,e[14]=d,e[15]=i,e[16]=m,e[17]=f,e[18]=y):y=e[18];let k;e[19]!==n?(k=R=>{M.error(n("common.githubRepoPicker.failedReconnect",{error:R instanceof Error?R.message:n("common.githubRepoPicker.unknownError")}))},e[19]=n,e[20]=k):k=e[20];let N;e[21]!==y||e[22]!==k?(N={mutationFn:y,onError:k},e[21]=y,e[22]=k,e[23]=N):N=e[23];const p=be(N);if(d.isLoading){let R;return e[24]===Symbol.for("react.memo_cache_sentinel")?(R=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(B,{className:"size-4.5 text-muted-foreground"})}),e[24]=R):R=e[24],R}if(d.isError){let R;e[25]!==n?(R=n("common.githubRepoPicker.failedLoadAccounts"),e[25]=n,e[26]=R):R=e[26];let E;e[27]!==R?(E=t.jsx("p",{className:"text-sm text-destructive",children:R}),e[27]=R,e[28]=E):E=e[28];let T;e[29]!==n?(T=n("common.githubRepoPicker.connectionExpiredMessage"),e[29]=n,e[30]=T):T=e[30];let G;e[31]!==T?(G=t.jsx("p",{className:"text-xs text-muted-foreground max-w-[280px] leading-relaxed",children:T}),e[31]=T,e[32]=G):G=e[32];let F;e[33]!==p?(F=()=>p.mutate(),e[33]=p,e[34]=F):F=e[34];const q=p.isPending;let $;e[35]!==p.isPending?($=p.isPending?t.jsx(B,{className:"size-3.5"}):t.jsx(Q,{className:"size-3.5"}),e[35]=p.isPending,e[36]=$):$=e[36];let O;e[37]!==n?(O=n("common.githubRepoPicker.reconnectGitHub"),e[37]=n,e[38]=O):O=e[38];let U;e[39]!==p.isPending||e[40]!==F||e[41]!==$||e[42]!==O?(U=t.jsxs(ce,{type:"button",variant:"outline",size:"sm",onClick:F,disabled:q,children:[$,O]}),e[39]=p.isPending,e[40]=F,e[41]=$,e[42]=O,e[43]=U):U=e[43];let D;return e[44]!==G||e[45]!==U||e[46]!==E?(D=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-6 text-center",children:[E,G,U]}),e[44]=G,e[45]=U,e[46]=E,e[47]=D):D=e[47],D}const r=d.data;if(!r)return null;if(r.installations.length===0){let R;e[48]!==l||e[49]!==c||e[50]!==n?(R=c&&t.jsx("div",{className:"flex items-center gap-1 px-4 pt-3 pb-1 shrink-0",children:t.jsxs("button",{type:"button",onClick:l,className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[t.jsx(ae,{size:12}),n("common.githubRepoPicker.changeConnection")]})}),e[48]=l,e[49]=c,e[50]=n,e[51]=R):R=e[51];let E;e[52]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx("div",{className:"size-16 rounded-2xl bg-muted flex items-center justify-center",children:t.jsx(Q,{className:"size-8 text-foreground"})}),e[52]=E):E=e[52];let T;e[53]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx("span",{className:"size-1.5 rounded-full bg-success"}),e[53]=T):T=e[53];let G;e[54]!==n?(G=n("common.githubRepoPicker.githubConnected"),e[54]=n,e[55]=G):G=e[55];let F;e[56]!==G?(F=t.jsxs("div",{className:"mt-4 flex items-center gap-1.5 text-xs font-medium text-success",children:[T,G]}),e[56]=G,e[57]=F):F=e[57];let q;e[58]!==n?(q=n("common.githubRepoPicker.setupRepositoriesTitle"),e[58]=n,e[59]=q):q=e[59];let $;e[60]!==q?($=t.jsx("h2",{className:"mt-2 text-base font-semibold text-foreground",children:q}),e[60]=q,e[61]=$):$=e[61];let O;e[62]!==n?(O=n("common.githubRepoPicker.noRepositoriesShared"),e[62]=n,e[63]=O):O=e[63];let U;e[64]!==O?(U=t.jsx("p",{className:"mt-1.5 max-w-[360px] text-xs leading-relaxed text-muted-foreground",children:O}),e[64]=O,e[65]=U):U=e[65];let D;e[66]!==n?(D=n("common.githubRepoPicker.chooseRepositories"),e[66]=n,e[67]=D):D=e[67];let le;e[68]===Symbol.for("react.memo_cache_sentinel")?(le=t.jsx(Oe,{size:14}),e[68]=le):le=e[68];let V;e[69]!==D?(V=t.jsx(ce,{asChild:!0,size:"sm",children:t.jsxs("a",{href:ge,target:"_blank",rel:"noopener noreferrer",children:[D,le]})}),e[69]=D,e[70]=V):V=e[70];let K;e[71]!==d?(K=()=>{d.refetch()},e[71]=d,e[72]=K):K=e[72];const Te=d.isFetching;let W;e[73]!==d.isFetching?(W=d.isFetching&&t.jsx(B,{className:"size-3.5"}),e[73]=d.isFetching,e[74]=W):W=e[74];let J;e[75]!==n?(J=n("common.githubRepoPicker.checkAgain"),e[75]=n,e[76]=J):J=e[76];let Y;e[77]!==d.isFetching||e[78]!==K||e[79]!==W||e[80]!==J?(Y=t.jsxs(ce,{type:"button",variant:"outline",size:"sm",onClick:K,disabled:Te,children:[W,J]}),e[77]=d.isFetching,e[78]=K,e[79]=W,e[80]=J,e[81]=Y):Y=e[81];let X;e[82]!==V||e[83]!==Y?(X=t.jsxs("div",{className:"mt-5 flex items-center gap-2",children:[V,Y]}),e[82]=V,e[83]=Y,e[84]=X):X=e[84];let Z;e[85]!==n?(Z=n("common.githubRepoPicker.repositoryAccessNote"),e[85]=n,e[86]=Z):Z=e[86];let ee;e[87]!==Z?(ee=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:Z}),e[87]=Z,e[88]=ee):ee=e[88];let te;e[89]!==F||e[90]!==$||e[91]!==U||e[92]!==X||e[93]!==ee?(te=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center px-8 py-6 text-center",children:[E,F,$,U,X,ee]}),e[89]=F,e[90]=$,e[91]=U,e[92]=X,e[93]=ee,e[94]=te):te=e[94];let re;return e[95]!==te||e[96]!==R?(re=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[R,te]}),e[95]=te,e[96]=R,e[97]=re):re=e[97],re}let P;e[98]!==l||e[99]!==c||e[100]!==n?(P=c&&t.jsx("div",{className:"flex items-center gap-1 px-4 pt-3 pb-1 shrink-0",children:t.jsxs("button",{type:"button",onClick:l,className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[t.jsx(ae,{size:12}),n("common.githubRepoPicker.changeConnection")]})}),e[98]=l,e[99]=c,e[100]=n,e[101]=P):P=e[101];let v;if(e[102]!==r.installations||e[103]!==o||e[104]!==n){let R;e[106]!==o||e[107]!==n?(R=E=>t.jsxs("button",{type:"button",onClick:()=>o(E),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:E.avatarUrl,alt:E.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:E.login}),E.type==="User"&&t.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:n("common.githubRepoPicker.personalAccount")})]}),t.jsxs("span",{className:"text-xs text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity shrink-0",children:[n("common.githubRepoPicker.select")," →"]})]},E.installationId),e[106]=o,e[107]=n,e[108]=R):R=e[108],v=r.installations.map(R),e[102]=r.installations,e[103]=o,e[104]=n,e[105]=v}else v=e[105];let w;e[109]!==v?(w=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden [scrollbar-gutter:stable]",children:v}),e[109]=v,e[110]=w):w=e[110];let C;e[111]!==n?(C=n("common.githubRepoPicker.accountNotListed"),e[111]=n,e[112]=C):C=e[112];let I;e[113]!==n?(I=n("common.githubRepoPicker.installGitHubApp"),e[113]=n,e[114]=I):I=e[114];let S;e[115]!==I?(S=t.jsx("span",{className:"underline underline-offset-2",children:I}),e[115]=I,e[116]=S):S=e[116];let A;e[117]!==C||e[118]!==S?(A=t.jsx("div",{className:"px-4 py-3 border-t border-border shrink-0",children:t.jsxs("a",{href:ge,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:[C," ",S]})}),e[117]=C,e[118]=S,e[119]=A):A=e[119];let _;return e[120]!==w||e[121]!==A||e[122]!==P?(_=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[P,w,A]}),e[120]=w,e[121]=A,e[122]=P,e[123]=_):_=e[123],_}function dt(){}function mt(h){const e=L.c(23),{connectionId:s,orgId:i,orgSlug:m,installation:o,onSelectRepo:c,isSaving:l}=h,n=H(),[a,u]=z.useState(""),f=Pe(a,300),j=z.useDeferredValue(f),g=a!==j;let x;e[0]!==n?(x=n("common.githubRepoPicker.searchRepositories"),e[0]=n,e[1]=x):x=e[1];let b;e[2]!==g||e[3]!==a||e[4]!==x?(b=t.jsx(ve,{placeholder:x,value:a,onChange:u,isSearching:g}),e[2]=g,e[3]=a,e[4]=x,e[5]=b):b=e[5];const d=g?"opacity-40":"opacity-100";let y;e[6]!==d?(y=oe("flex-1 overflow-hidden flex flex-col transition-opacity duration-150",d),e[6]=d,e[7]=y):y=e[7];let k;e[8]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(B,{className:"size-4.5 text-muted-foreground"})}),e[8]=k):k=e[8];let N;e[9]!==s||e[10]!==j||e[11]!==o||e[12]!==l||e[13]!==c||e[14]!==i||e[15]!==m?(N=t.jsx(z.Suspense,{fallback:k,children:t.jsx(ft,{connectionId:s,orgId:i,orgSlug:m,installation:o,query:j,onSelectRepo:c,isSaving:l})}),e[9]=s,e[10]=j,e[11]=o,e[12]=l,e[13]=c,e[14]=i,e[15]=m,e[16]=N):N=e[16];let p;e[17]!==y||e[18]!==N?(p=t.jsx("div",{className:y,children:N}),e[17]=y,e[18]=N,e[19]=p):p=e[19];let r;return e[20]!==b||e[21]!==p?(r=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[b,p]}),e[20]=b,e[21]=p,e[22]=r):r=e[22],r}function ft(h){const e=L.c(36),{connectionId:s,orgId:i,orgSlug:m,installation:o,query:c,onSelectRepo:l,isSaving:n}=h,a=H();let u;e[0]!==s||e[1]!==i||e[2]!==m?(u={connectionId:s,orgId:i,orgSlug:m},e[0]=s,e[1]=i,e[2]=m,e[3]=u):u=e[3];const f=se(u),j=o.type==="User"?"user":"org",g=c?`${j}:${o.login} ${c} in:name fork:true`:`${j}:${o.login} fork:true`;let x;e[4]!==s||e[5]!==o.login||e[6]!==i||e[7]!==c?(x=ie.githubOrgRepos(i,s,o.login,c),e[4]=s,e[5]=o.login,e[6]=i,e[7]=c,e[8]=x):x=e[8];let b;e[9]!==f||e[10]!==g?(b=async p=>{const{signal:r}=p,v=(await f.callTool({name:"search_repositories",arguments:{query:g,page:1,perPage:30}},void 0,{signal:r})).content?.[0]?.text;if(!v)throw new Error("No response from search_repositories");return(JSON.parse(v).items??[]).map(xt)},e[9]=f,e[10]=g,e[11]=b):b=e[11];let d;e[12]!==x||e[13]!==b?(d={queryKey:x,queryFn:b},e[12]=x,e[13]=b,e[14]=d):d=e[14];const{data:y}=Le(d);if(y.length===0){let p;e[15]!==a?(p=a("common.githubRepoPicker.noRepositoriesFound"),e[15]=a,e[16]=p):p=e[16];let r;e[17]!==p?(r=t.jsx("p",{className:"text-sm text-muted-foreground",children:p}),e[17]=p,e[18]=r):r=e[18];let P;e[19]!==c||e[20]!==a?(P=c&&t.jsx("p",{className:"text-xs text-muted-foreground/60",children:a("common.githubRepoPicker.tryDifferentSearchTerm")}),e[19]=c,e[20]=a,e[21]=P):P=e[21];let v;return e[22]!==r||e[23]!==P?(v=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-1",children:[r,P]}),e[22]=r,e[23]=P,e[24]=v):v=e[24],v}let k;if(e[25]!==n||e[26]!==l||e[27]!==y||e[28]!==a){let p;e[30]!==n||e[31]!==l||e[32]!==a?(p=r=>t.jsxs("button",{type:"button",onClick:()=>l(r),disabled:n,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(Q,{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:r.name}),r.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:a("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:[r.private?t.jsx(Ge,{size:10}):t.jsx(Ue,{size:10}),r.private?a("common.githubRepoPicker.private"):a("common.githubRepoPicker.public")]})]},r.fullName),e[30]=n,e[31]=l,e[32]=a,e[33]=p):p=e[33],k=y.map(p),e[25]=n,e[26]=l,e[27]=y,e[28]=a,e[29]=k}else k=e[29];let N;return e[34]!==k?(N=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden flex flex-col [scrollbar-gutter:stable]",children:k}),e[34]=k,e[35]=N):N=e[35],N}function xt(h){return{name:h.name,fullName:h.full_name,owner:h.full_name.split("/")[0]??"",url:h.html_url,private:h.private,description:h.description,updatedAt:h.updated_at,fork:h.fork??!1}}function me(h){const e=L.c(51),{status:s,error:i,retry:m}=h,o=H();if(s==="error"){let v;e[0]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("div",{className:"size-10 rounded-full bg-destructive/10 flex items-center justify-center",children:t.jsx(Q,{className:"size-5 text-destructive"})}),e[0]=v):v=e[0];let w;e[1]!==o?(w=o("common.githubRepoPicker.connectionFailed"),e[1]=o,e[2]=w):w=e[2];let C;e[3]!==w?(C=t.jsx("p",{className:"text-sm font-medium",children:w}),e[3]=w,e[4]=C):C=e[4];let I;e[5]!==i||e[6]!==o?(I=i??o("common.githubRepoPicker.somethingWentWrong"),e[5]=i,e[6]=o,e[7]=I):I=e[7];let S;e[8]!==I?(S=t.jsx("p",{className:"text-xs text-muted-foreground max-w-[260px] leading-relaxed",children:I}),e[8]=I,e[9]=S):S=e[9];let A;e[10]!==C||e[11]!==S?(A=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[C,S]}),e[10]=C,e[11]=S,e[12]=A):A=e[12];let _;e[13]!==o?(_=o("common.githubRepoPicker.tryAgain"),e[13]=o,e[14]=_):_=e[14];let R;e[15]!==m||e[16]!==_?(R=t.jsx("button",{type:"button",onClick:m,className:"text-xs font-medium text-foreground border border-border rounded-md px-3 py-1.5 hover:bg-accent transition-colors",children:_}),e[15]=m,e[16]=_,e[17]=R):R=e[17];let E;return e[18]!==A||e[19]!==R?(E=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[v,A,R]}),e[18]=A,e[19]=R,e[20]=E):E=e[20],E}const c=s==="authenticating";let l;e[21]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("div",{className:"size-10 rounded-full bg-muted flex items-center justify-center",children:t.jsx(Q,{className:"size-5 text-foreground"})}),e[21]=l):l=e[21];let n;e[22]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsxs("div",{className:"relative size-10",children:[l,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(B,{className:"size-3 text-muted-foreground"})})]}),e[22]=n):n=e[22];let a;e[23]!==c||e[24]!==o?(a=o(c?"common.githubRepoPicker.authenticatingGitHub":"common.githubRepoPicker.settingUpGitHub"),e[23]=c,e[24]=o,e[25]=a):a=e[25];let u;e[26]!==a?(u=t.jsx("p",{className:"text-sm font-medium",children:a}),e[26]=a,e[27]=u):u=e[27];let f;e[28]!==c||e[29]!==o?(f=o(c?"common.githubRepoPicker.completeOAuthFlow":"common.githubRepoPicker.installingGitHubConnection"),e[28]=c,e[29]=o,e[30]=f):f=e[30];let j;e[31]!==f?(j=t.jsx("p",{className:"text-xs text-muted-foreground",children:f}),e[31]=f,e[32]=j):j=e[32];let g;e[33]!==u||e[34]!==j?(g=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[u,j]}),e[33]=u,e[34]=j,e[35]=g):g=e[35];const x=c?"bg-muted-foreground/30":"bg-foreground animate-pulse";let b;e[36]!==x?(b=oe("size-1.5 rounded-full",x),e[36]=x,e[37]=b):b=e[37];let d;e[38]!==b?(d=t.jsx("span",{className:b}),e[38]=b,e[39]=d):d=e[39];const y=c?"bg-foreground animate-pulse":"bg-muted-foreground/30";let k;e[40]!==y?(k=oe("size-1.5 rounded-full",y),e[40]=y,e[41]=k):k=e[41];let N;e[42]!==k?(N=t.jsx("span",{className:k}),e[42]=k,e[43]=N):N=e[43];let p;e[44]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("span",{className:"size-1.5 rounded-full bg-muted-foreground/30"}),e[44]=p):p=e[44];let r;e[45]!==d||e[46]!==N?(r=t.jsxs("div",{className:"flex items-center gap-1.5",children:[d,N,p]}),e[45]=d,e[46]=N,e[47]=r):r=e[47];let P;return e[48]!==r||e[49]!==g?(P=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[n,g,r]}),e[48]=r,e[49]=g,e[50]=P):P=e[50],P}export{_t as G,Ze as a,Je as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c,G as u,a7 as f,K as a,m as y,n as T,e as p,bY as E,j as C}from"./index-
|
|
1
|
+
import{c,G as u,a7 as f,K as a,m as y,n as T,e as p,bY as E,j as C}from"./index-Cq8Pvay3.js";const S=5*6e4;function _(){const e=c.c(7),{org:t}=u(),s=f();let l;e[0]!==t.id?(l=a.gitProviderCapabilities(t.id),e[0]=t.id,e[1]=l):l=e[1];let i;e[2]!==s?(i=()=>s.call("GIT_PROVIDER_CAPABILITIES",{}),e[2]=s,e[3]=i):i=e[3];let o;return e[4]!==l||e[5]!==i?(o={queryKey:l,staleTime:S,queryFn:i},e[4]=l,e[5]=i,e[6]=o):o=e[6],y(o)}function g(){const e=c.c(7),{org:t}=u(),s=f();let l;e[0]!==t.id?(l=a.gitAccounts(t.id),e[0]=t.id,e[1]=l):l=e[1];let i;e[2]!==s?(i=async()=>(await s.call("GIT_ACCOUNT_LIST",{})).accounts,e[2]=s,e[3]=i):i=e[3];let o;return e[4]!==l||e[5]!==i?(o={queryKey:l,staleTime:6e4,queryFn:i},e[4]=l,e[5]=i,e[6]=o):o=e[6],y(o)}function A(e){const t=c.c(9),{org:s}=u(),l=f();let i;t[0]!==e||t[1]!==s.id?(i=a.repositories(s.id,e),t[0]=e,t[1]=s.id,t[2]=i):i=t[2];let o;t[3]!==e||t[4]!==l?(o=async()=>(await l.call("REPOSITORY_LIST",{})).repositories,t[3]=e,t[4]=l,t[5]=o):o=t[5];let n;return t[6]!==i||t[7]!==o?(n={queryKey:i,staleTime:6e4,queryFn:o},t[6]=i,t[7]=o,t[8]=n):n=t[8],y(n)}function O(e,t){const s=c.c(12),{org:l}=u(),i=f();let o;s[0]!==e||s[1]!==l.id||s[2]!==t?(o=a.providerRepoSearch(l.id,e??"",t),s[0]=e,s[1]=l.id,s[2]=t,s[3]=o):o=s[3];const n=e!==null;let r;s[4]!==e||s[5]!==t||s[6]!==i?(r=async()=>e===null?[]:(await i.call("REPOSITORY_SEARCH",{accountId:e,...t?{query:t}:{}})).repositories,s[4]=e,s[5]=t,s[6]=i,s[7]=r):r=s[7];let d;return s[8]!==o||s[9]!==n||s[10]!==r?(d={queryKey:o,enabled:n,placeholderData:E,staleTime:3e4,retry:!1,queryFn:r},s[8]=o,s[9]=n,s[10]=r,s[11]=d):d=s[11],y(d)}function K(){const e=c.c(8),{org:t}=u(),s=f(),l=T();let i;e[0]!==s?(i=async r=>(await s.call("GIT_ACCOUNT_CONNECT_TOKEN",r)).account,e[0]=s,e[1]=i):i=e[1];let o;e[2]!==t||e[3]!==l?(o=()=>l.invalidateQueries({queryKey:a.gitAccounts(t.id)}),e[2]=t,e[3]=l,e[4]=o):o=e[4];let n;return e[5]!==i||e[6]!==o?(n={mutationFn:i,onSettled:o},e[5]=i,e[6]=o,e[7]=n):n=e[7],p(n)}function L(){const e=c.c(8),{org:t}=u(),s=f(),l=T();let i;e[0]!==s?(i=r=>s.call("GIT_ACCOUNT_DELETE",{id:r}),e[0]=s,e[1]=i):i=e[1];let o;e[2]!==t||e[3]!==l?(o=()=>{l.invalidateQueries({queryKey:a.gitAccounts(t.id)}),l.invalidateQueries({queryKey:a.repositories(t.id)})},e[2]=t,e[3]=l,e[4]=o):o=e[4];let n;return e[5]!==i||e[6]!==o?(n={mutationFn:i,onSettled:o},e[5]=i,e[6]=o,e[7]=n):n=e[7],p(n)}function v(){const e=c.c(8),{org:t}=u(),s=f(),l=T();let i;e[0]!==s?(i=async r=>(await s.call("REPOSITORY_LINK",r)).repository,e[0]=s,e[1]=i):i=e[1];let o;e[2]!==t||e[3]!==l?(o=()=>l.invalidateQueries({queryKey:a.repositories(t.id)}),e[2]=t,e[3]=l,e[4]=o):o=e[4];let n;return e[5]!==i||e[6]!==o?(n={mutationFn:i,onSettled:o},e[5]=i,e[6]=o,e[7]=n):n=e[7],p(n)}function P(){const e=c.c(8),{org:t}=u(),s=f(),l=T();let i;e[0]!==s?(i=r=>s.call("REPOSITORY_DELETE",{id:r}),e[0]=s,e[1]=i):i=e[1];let o;e[2]!==t||e[3]!==l?(o=()=>l.invalidateQueries({queryKey:a.repositories(t.id)}),e[2]=t,e[3]=l,e[4]=o):o=e[4];let n;return e[5]!==i||e[6]!==o?(n={mutationFn:i,onSettled:o},e[5]=i,e[6]=o,e[7]=n):n=e[7],p(n)}function q(e){const t=c.c(4),{size:s,className:l}=e;let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=C.jsx("path",{d:"M23.6004 9.5927l-.0337-.0862L20.3.9814a.851.851 0 00-.3362-.405.8748.8748 0 00-.9997.0539.8748.8748 0 00-.29.4399l-2.2055 6.748H7.5375L5.3318 1.0702a.8573.8573 0 00-.29-.4412.8748.8748 0 00-.9997-.0537.8585.8585 0 00-.3361.4049L.4332 9.5015l-.0325.0862a6.0657 6.0657 0 002.0119 7.0105l.0113.0087.03.0213 4.976 3.7264 2.462 1.8633 1.4995 1.1321a1.0085 1.0085 0 001.2197 0l1.4995-1.1321 2.462-1.8633 5.0062-3.7489.0125-.01a6.0682 6.0682 0 002.0094-7.003z"}),t[0]=i):i=t[0];let o;return t[1]!==l||t[2]!==s?(o=C.jsx("svg",{width:s,height:s,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:l,children:i}),t[1]=l,t[2]=s,t[3]=o):o=t[3],o}export{q as G,v as a,O as b,A as c,L as d,P as e,_ as f,K as g,g as u};
|