decocms 4.211.12 → 4.211.13
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-iMFIwWNV.js → AlertCircle-BMPkNMGJ.js} +1 -1
- package/dist/client/assets/{AreaChart-GCRS_-AP.js → AreaChart-488R_nQ_.js} +1 -1
- package/dist/client/assets/{ArrowLeft-CsWtY_gB.js → ArrowLeft-Bo0FpGQs.js} +1 -1
- package/dist/client/assets/{ArrowUp-DSxXxGdv.js → ArrowUp-Cmxc5KIG.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-erfF6BcP.js → ArrowUpRight-OVKS4c5s.js} +1 -1
- package/dist/client/assets/{Check-CABzt6--.js → Check-CeB_ZeLq.js} +1 -1
- package/dist/client/assets/{CheckCircle-N8333lb0.js → CheckCircle-C9SAYY-W.js} +1 -1
- package/dist/client/assets/{ChevronDown-DsDzbrOb.js → ChevronDown-CGwhMiqT.js} +1 -1
- package/dist/client/assets/{ChevronRight-DwahmHLA.js → ChevronRight-Cux_llMB.js} +1 -1
- package/dist/client/assets/{ChevronUp-DBUIuLI5.js → ChevronUp-3dsPU76D.js} +1 -1
- package/dist/client/assets/{Copy01-B995BWXi.js → Copy01-CXcHnxi0.js} +1 -1
- package/dist/client/assets/{CpuChip01-lt7Rkp-U.js → CpuChip01-CGpR8wkh.js} +1 -1
- package/dist/client/assets/{CreditCard01-GxtaywC9.js → CreditCard01-DSA6UjMO.js} +1 -1
- package/dist/client/assets/{DotsVertical-BRYCw47k.js → DotsVertical-9U5tOb04.js} +1 -1
- package/dist/client/assets/{Eye-Clu-LouG.js → Eye-DXWAJYKq.js} +1 -1
- package/dist/client/assets/{FilterLines-CNzwsg4F.js → FilterLines-DZrlB4Kh.js} +1 -1
- package/dist/client/assets/{Globe01-0reGbJcL.js → Globe01-Cm-V-gHj.js} +1 -1
- package/dist/client/assets/{Globe04-sue1ujzC.js → Globe04-m1tzMty0.js} +1 -1
- package/dist/client/assets/{HardDrive-CuFY6j2o.js → HardDrive-Dvps78YO.js} +1 -1
- package/dist/client/assets/{Key01-C8zGItpI.js → Key01-DY7yaq7L.js} +1 -1
- package/dist/client/assets/{LayoutLeft-BowuBtX2.js → LayoutLeft-C0u89h3U.js} +1 -1
- package/dist/client/assets/{LinkExternal01-B3QGOPZ8.js → LinkExternal01-CLr9HZg0.js} +1 -1
- package/dist/client/assets/{LogOut01-CwZ1Y9u4.js → LogOut01-BeE1lxGA.js} +1 -1
- package/dist/client/assets/{Monitor01-Bni1e5h7.js → Monitor01-RiuZmvGS.js} +1 -1
- package/dist/client/assets/{Palette-B6o-2LWT.js → Palette-C8S3zMtK.js} +1 -1
- package/dist/client/assets/{Play-BC8nRLNF.js → Play-B8V74CpU.js} +1 -1
- package/dist/client/assets/{Plus-BPZja4FC.js → Plus-CGrXNe_q.js} +1 -1
- package/dist/client/assets/{SearchLg-CGtAP5EH.js → SearchLg-DrUBeTI6.js} +1 -1
- package/dist/client/assets/{SearchMd-BVrWvjH3.js → SearchMd-DFwCvkV1.js} +1 -1
- package/dist/client/assets/{Settings02-C9fJkEJh.js → Settings02-DBlt8Mfk.js} +1 -1
- package/dist/client/assets/{Share07-DS8-754J.js → Share07-C1_p27Hs.js} +1 -1
- package/dist/client/assets/{Shield01-CrVGBhuR.js → Shield01-CZr-J1Qk.js} +1 -1
- package/dist/client/assets/{Star01-CwL23CRL.js → Star01-ClwU4gOx.js} +1 -1
- package/dist/client/assets/{Stars01-D94NieJP.js → Stars01-jLom0LSv.js} +1 -1
- package/dist/client/assets/{Stars02-B08-JGxx.js → Stars02-2eb3r8Gu.js} +1 -1
- package/dist/client/assets/{Sun-kp4es37w.js → Sun-m3RjKnDt.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-ChVU7SWq.js → SwitchHorizontal01-D0Mi7oaK.js} +1 -1
- package/dist/client/assets/{Tool01-DStbcY86.js → Tool01-DMQJZ6a0.js} +1 -1
- package/dist/client/assets/{Tool02-7YE_lsQ5.js → Tool02-CZZOjaKh.js} +1 -1
- package/dist/client/assets/{Trash01-DGt8nZn9.js → Trash01-BCoCDH0H.js} +1 -1
- package/dist/client/assets/{TrendUp01-C6JwA-Np.js → TrendUp01-CYPiI6vW.js} +1 -1
- package/dist/client/assets/{Upload01-DgSyem4d.js → Upload01-mvF19nky.js} +1 -1
- package/dist/client/assets/{User01-CPSa9S2T.js → User01-UnLfhP79.js} +1 -1
- package/dist/client/assets/{Users01-DUxHx9ib.js → Users01-BGTUZMIA.js} +1 -1
- package/dist/client/assets/{Users03-Dqls41gn.js → Users03-C0P658nm.js} +1 -1
- package/dist/client/assets/{X-CseWQ5OZ.js → X-CId2-nhW.js} +1 -1
- package/dist/client/assets/{XCircle-Cpx4dopB.js → XCircle-DOtlBDfF.js} +1 -1
- package/dist/client/assets/{XClose-3fY-ChCg.js → XClose-BoiJoxeV.js} +1 -1
- package/dist/client/assets/{Zap-B6D2E55F.js → Zap-C6ApHWIY.js} +1 -1
- package/dist/client/assets/{ZapSquare-kC-fhZGr.js → ZapSquare-GHgi4Hl7.js} +1 -1
- package/dist/client/assets/{access-gate-CA12_xun.js → access-gate-C95F2WkH.js} +1 -1
- package/dist/client/assets/{agent-icon-CWBP36-h.js → agent-icon-D_vHJRnE.js} +1 -1
- package/dist/client/assets/{agents-list-OMhP8qfw.js → agents-list-DkgLS7SC.js} +1 -1
- package/dist/client/assets/{ai-providers-D478OIo1.js → ai-providers-Bu525zoa.js} +1 -1
- package/dist/client/assets/{alert-DIuR7XaR.js → alert-DbDLUaFg.js} +1 -1
- package/dist/client/assets/{alert-dialog-Xn8LpVc8.js → alert-dialog-BgN-Tqd-.js} +1 -1
- package/dist/client/assets/{app-editor-yIDNZzzT.js → app-editor-BxnAP5XK.js} +1 -1
- package/dist/client/assets/{auth-ANCOmttW.js → auth-BcPAS4K5.js} +1 -1
- package/dist/client/assets/{auth-catchall-CPei7TNu.js → auth-catchall-beEoU58X.js} +1 -1
- package/dist/client/assets/{auth-entry-DR2aLV1R.js → auth-entry-Ba9Dx-Qf.js} +1 -1
- package/dist/client/assets/{auth-split-layout-CkRUAeEO.js → auth-split-layout-BWtw05-K.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-C-JqvyRh.js → authenticate-and-persist-oauth-COCTTCRF.js} +1 -1
- package/dist/client/assets/{automation-list-row-BcUdJrVC.js → automation-list-row-BYFAi_YA.js} +1 -1
- package/dist/client/assets/{automation-runs-BifnU8_i.js → automation-runs-DeLRBvkt.js} +1 -1
- package/dist/client/assets/{automations-B9um6d70.js → automations-BRAq3s1h.js} +1 -1
- package/dist/client/assets/{avatar-CPIgr7-p.js → avatar-CKAwkvrw.js} +1 -1
- package/dist/client/assets/{badge-BoP7NhL_.js → badge-CxlSzoE1.js} +1 -1
- package/dist/client/assets/{billing-BHFWSCxm.js → billing-B-o9jNmN.js} +1 -1
- package/dist/client/assets/{block-document-CPSclET4.js → block-document-B55t08Gk.js} +1 -1
- package/dist/client/assets/{brand-context-Lk6JoeGu.js → brand-context-BFbc6Rr3.js} +1 -1
- package/dist/client/assets/{buckets-BiDyk4mP.js → buckets-DPkGfuKn.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-0zirRi61.js → bulk-category-panel-DEeeidyr.js} +1 -1
- package/dist/client/assets/{capability-load-error-S-JNljGC.js → capability-load-error-BJPRtvi9.js} +1 -1
- package/dist/client/assets/{card-lxFop9oJ.js → card-GrGBYBXG.js} +1 -1
- package/dist/client/assets/{cards-S5FAmKUB.js → cards-DY2u3Spm.js} +1 -1
- package/dist/client/assets/{category-editor-Bv8ApHAC.js → category-editor-ZQJJznra.js} +1 -1
- package/dist/client/assets/{chat-context-CV2ibxPd.js → chat-context-cK_4I7Xc.js} +1 -1
- package/dist/client/assets/{checkbox-ZpkUR1gq.js → checkbox-DjytOswq.js} +1 -1
- package/dist/client/assets/{cli-auth-success-BdE-we7c.js → cli-auth-success-BM-cW7fp.js} +1 -1
- package/dist/client/assets/{collection-detail-7LB4xM1G.js → collection-detail-agcgXjLA.js} +1 -1
- package/dist/client/assets/{collection-display-button-DTKyHVFX.js → collection-display-button-C1_cSZ46.js} +1 -1
- package/dist/client/assets/{collection-search-BzYqusXY.js → collection-search-Cwveue76.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-BSS6Wd5g.js → collection-table-wrapper-rFP3w6Km.js} +1 -1
- package/dist/client/assets/{collection-tabs-Di0fmDNx.js → collection-tabs-DMyjVQaZ.js} +1 -1
- package/dist/client/assets/{command-Bemo-h0S.js → command-DktWLnIE.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-D1H67vwy.js → commerce-onboarding-m9N-S4Gz.js} +1 -1
- package/dist/client/assets/{connect-D8FiLV07.js → connect-D2N1y-Ip.js} +1 -1
- package/dist/client/assets/{connection-card-D-cmYmCq.js → connection-card-BoEQ2uqc.js} +1 -1
- package/dist/client/assets/{connection-detail-ckAlH1gW.js → connection-detail-CQcpDcrD.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-DFqceUmS.js → connection-form-helpers-DB6bc0s9.js} +1 -1
- package/dist/client/assets/{connection-Bq8ZZ2Em.js → connection-xiSJ6-RD.js} +1 -1
- package/dist/client/assets/{connections-qMM5bDwN.js → connections-Dw0iE25b.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-Cvk81TxT.js → decopilot-sse-pool-CYVKd86r.js} +1 -1
- package/dist/client/assets/{dialog-CF1cQ1rb.js → dialog-7h2q_S_D.js} +1 -1
- package/dist/client/assets/{domain-settings-BEadEJ2B.js → domain-settings-VApHKPI3.js} +1 -1
- package/dist/client/assets/{drawer-DfRIJaDr.js → drawer-WhUz4erM.js} +1 -1
- package/dist/client/assets/{dropdown-menu-AkajeJh4.js → dropdown-menu-D3TVm231.js} +1 -1
- package/dist/client/assets/{empty-state-D7Q_5Yzc.js → empty-state-tOcrn7Ci.js} +1 -1
- package/dist/client/assets/{extract-connection-data-sVdeut_9.js → extract-connection-data-BKY0ec6n.js} +1 -1
- package/dist/client/assets/{file-explorer-Dwz4AmxP.js → file-explorer-Dq0lQM5q.js} +1 -1
- package/dist/client/assets/{file-type-icon-BBtbE_NU.js → file-type-icon-CpiTVpKx.js} +1 -1
- package/dist/client/assets/{form-D6GqaWU9.js → form-FE1JRkSu.js} +1 -1
- package/dist/client/assets/{general-8nn2nvKH.js → general-g40hJC_5.js} +1 -1
- package/dist/client/assets/{github-repo-picker-yxnDF_Mi.js → github-repo-picker-BId4yHDh.js} +1 -1
- package/dist/client/assets/{hooks-CJA4VXgB.js → hooks-BTTh4oan.js} +4 -4
- package/dist/client/assets/{index-Al4HY1a3.js → index-BEPKcH_a.js} +1 -1
- package/dist/client/assets/{index-DC7whFuR.js → index-BEYzla8F.js} +5 -5
- package/dist/client/assets/{index-cF1kQ4rp.js → index-BYGXPjH8.js} +1 -1
- package/dist/client/assets/{index-vEFJuUdN.js → index-Bfy-Fe7V.js} +3 -3
- package/dist/client/assets/{index-C3vGEoWV.js → index-Bqv-pFdx.js} +1 -1
- package/dist/client/assets/{index-C2hrpyVC.js → index-C6ZFB-pr.js} +1 -1
- package/dist/client/assets/{index-BMSi953J.js → index-CGRQEzbN.js} +1 -1
- package/dist/client/assets/{index-EI3Ugq-F.js → index-D5KNWpFX.js} +1 -1
- package/dist/client/assets/{index-CjTnqBk_.js → index-GMtytQiz.js} +1 -1
- package/dist/client/assets/{index-kxBCs5fd.js → index-UyBix6gL.js} +1 -1
- package/dist/client/assets/{index-redirect-Bue7X2lf.js → index-redirect-ck6OyrmB.js} +1 -1
- package/dist/client/assets/{input-5e_3GJtI.js → input-BVD_WyXJ.js} +1 -1
- package/dist/client/assets/{integration-icon-Hw_CmlIO.js → integration-icon-BbWY9vfD.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-BFxexQWA.js → invite-member-dialog-CV1AK1O7.js} +1 -1
- package/dist/client/assets/{label-DfGzQmB5.js → label-Dplc1_oE.js} +1 -1
- package/dist/client/assets/{layout-J1KutV1s.js → layout-D5YUqSjq.js} +1 -1
- package/dist/client/assets/{login-DFC8t92m.js → login-BhrXfYan.js} +1 -1
- package/dist/client/assets/{mcp-oauth-OIUxe3g2.js → mcp-oauth-Bi0vxp4Q.js} +1 -1
- package/dist/client/assets/{members-D04j8LGY.js → members-Ji9eO7Ec.js} +1 -1
- package/dist/client/assets/{monaco-editor-DXyVTFn_.js → monaco-editor-a45QrHzb.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-DwkTMqaP.js → monitoring-stats-row-Clyov0L3.js} +1 -1
- package/dist/client/assets/{multi-select-CMm9r82c.js → multi-select-CjPTNrcr.js} +1 -1
- package/dist/client/assets/{oauth-callback-DvccsXft.js → oauth-callback-DiDAIf8E.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-JuzGzHF3.js → oauth-callback-ai-provider-IqzbVWPo.js} +1 -1
- package/dist/client/assets/{onboarding-CITeeAzg.js → onboarding-BJiKjmun.js} +1 -1
- package/dist/client/assets/{org-layout-r55BUxSU.js → org-layout-PfQPZIP6.js} +1 -1
- package/dist/client/assets/{organization-choice-DdAEAan-.js → organization-choice-gP3A2ZAR.js} +1 -1
- package/dist/client/assets/{orgs-DbDUgk30.js → orgs-Cr1CFs6W.js} +1 -1
- package/dist/client/assets/{page-seo-form-DArIhi5S.js → page-seo-form-DudbV1zC.js} +1 -1
- package/dist/client/assets/{popover-DlPz4To4.js → popover-DigaZ5Sb.js} +1 -1
- package/dist/client/assets/{post-editor-DHPRvNNO.js → post-editor-BWzSgRMR.js} +1 -1
- package/dist/client/assets/{primitives-BydS_vZK.js → primitives-J7wgcQJq.js} +1 -1
- package/dist/client/assets/{profile-DI6Ilt8P.js → profile-BDbSzozU.js} +1 -1
- package/dist/client/assets/{project-app-view-C6HXVzqk.js → project-app-view-DAXzq1Ls.js} +1 -1
- package/dist/client/assets/record-editor-ppkuJl7e.js +1 -0
- package/dist/client/assets/{redirect-editor-HVBMW8WM.js → redirect-editor-pHmu3bPB.js} +1 -1
- package/dist/client/assets/registry-Cd5hmvAQ.js +2 -0
- package/dist/client/assets/{registry-layout-BkpbsKCB.js → registry-layout-CpdnxiQT.js} +1 -1
- package/dist/client/assets/{reports-CXIrzC-d.js → reports-DRHBtKft.js} +1 -1
- package/dist/client/assets/{require-capability-fB062a2_.js → require-capability-ATUore6a.js} +1 -1
- package/dist/client/assets/{required-auth-layout-_hvJxMv_.js → required-auth-layout-BFPFAQoy.js} +1 -1
- package/dist/client/assets/{reset-password-BEaSK5jb.js → reset-password-Dqj508VS.js} +1 -1
- package/dist/client/assets/{roles-D12c7S0D.js → roles-CxUv-U9E.js} +1 -1
- package/dist/client/assets/{search-input-Bao8w6Sm.js → search-input--fbtpx3Q.js} +1 -1
- package/dist/client/assets/{secrets-DxgxqJVW.js → secrets-Bks5AT9o.js} +1 -1
- package/dist/client/assets/{sections-editor-DNFZvceN.js → sections-editor-D3-0_ytR.js} +1 -1
- package/dist/client/assets/{select-model-CR0-6PXS.js → select-model-BpUI37HY.js} +1 -1
- package/dist/client/assets/{select-Dez5FrF9.js → select-wwJ8EUoY.js} +1 -1
- package/dist/client/assets/{self-tool-result-CEBp4imh.js → self-tool-result-Cch-sPi1.js} +1 -1
- package/dist/client/assets/{seo-editor-DpWrQCog.js → seo-editor-B-BXD83I.js} +1 -1
- package/dist/client/assets/{settings-layout-DM6YanNm.js → settings-layout-ByUBxOIX.js} +1 -1
- package/dist/client/assets/{settings-section-DPTzp_P_.js → settings-section-CfhHwu3l.js} +1 -1
- package/dist/client/assets/{shell-controls-CAI3Vo2K.js → shell-controls-CCkUJzaH.js} +1 -1
- package/dist/client/assets/{shell-layout-Udqd-jvd.js → shell-layout-C7FmlawD.js} +1 -1
- package/dist/client/assets/{sidebar-BXJraWph.js → sidebar-CusUIOZL.js} +1 -1
- package/dist/client/assets/{skeleton-pl0N1Ino.js → skeleton-Dd2jseki.js} +1 -1
- package/dist/client/assets/{spinner-CppnwMRY.js → spinner-Cq2vfE1B.js} +1 -1
- package/dist/client/assets/{sso-BKgAJn6H.js → sso-B3-RbBmC.js} +1 -1
- package/dist/client/assets/{store-BKFBI3A2.js → store-pPcfwgDj.js} +1 -1
- package/dist/client/assets/store-registry-BvvyMLoR.js +2 -0
- package/dist/client/assets/{studio-tools-CBUmjJWM.js → studio-tools-BBDHxwPb.js} +1 -1
- package/dist/client/assets/{switch-By_6CkwD.js → switch-CAjDqeuV.js} +1 -1
- package/dist/client/assets/{synced-repos-DMX6VroD.js → synced-repos-B2r15ecn.js} +1 -1
- package/dist/client/assets/{tab-id-DdzeNQQR.js → tab-id-BtKEoC5y.js} +1 -1
- package/dist/client/assets/{table-7K7oqOU1.js → table-DwuSaCi4.js} +1 -1
- package/dist/client/assets/{tabs-mQsLl4zR.js → tabs-CIxl9qVO.js} +1 -1
- package/dist/client/assets/{textarea-B-bmHFzf.js → textarea-BkOjJMTl.js} +1 -1
- package/dist/client/assets/{toggle-group-De9TzUcu.js → toggle-group-znNdMK--.js} +1 -1
- package/dist/client/assets/{toolbar-BgPfvPzL.js → toolbar-CdII6jdL.js} +1 -1
- package/dist/client/assets/{tooltip-BUztXQ1W.js → tooltip-F9SMeJ-j.js} +1 -1
- package/dist/client/assets/{track-BdasaloK.js → track-CQoHeM9p.js} +1 -1
- package/dist/client/assets/{use-ai-providers-B0Xkp5BB.js → use-ai-providers-NYX7QSgc.js} +1 -1
- package/dist/client/assets/{use-automations-CfmioFHT.js → use-automations-DoX-Tmqm.js} +1 -1
- package/dist/client/assets/{use-autosave-jnj9qMUO.js → use-autosave-BpJYCCvJ.js} +1 -1
- package/dist/client/assets/{use-capability-D7eAS5np.js → use-capability-DssZIcHp.js} +1 -1
- package/dist/client/assets/{use-clock-tick-iKIdVntg.js → use-clock-tick-CFTIWs0c.js} +1 -1
- package/dist/client/assets/{use-connection-C57YbTcG.js → use-connection-niAftPf5.js} +1 -1
- package/dist/client/assets/{use-copy-B7m5krwW.js → use-copy-C8wJsCEn.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-B0-zziyl.js → use-create-virtual-mcp-BeJ2z9vu.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave--SMcEphJ.js → use-debounced-autosave-CGiNF_NH.js} +1 -1
- package/dist/client/assets/{use-debounced-value-CEYSL9GY.js → use-debounced-value-BolYSN9R.js} +1 -1
- package/dist/client/assets/{use-deco-credits-9r63SN2F.js → use-deco-credits-De3PrmGo.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-9EcaK7qN.js → use-decopilot-events-UAWY9DUq.js} +1 -1
- package/dist/client/assets/{use-delete-connection-Bjv1M5P5.js → use-delete-connection-BcCyYYBn.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-CQBUmrw8.js → use-deployment-admin-Dkp6hxxc.js} +1 -1
- package/dist/client/assets/{use-file-configs-BWwvZiOJ.js → use-file-configs-Cq0JL4Et.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-DKJxpa0X.js → use-infinite-scroll-BMPCHIFs.js} +1 -1
- package/dist/client/assets/{use-join-requests-BjdU0X7c.js → use-join-requests-BGkaC20q.js} +1 -1
- package/dist/client/assets/{use-mcp-client-lJgGp2B_.js → use-mcp-client-CMZDCFwV.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-CMs4Nd8q.js → use-mcp-tools-DcIN6xvI.js} +1 -1
- package/dist/client/assets/{use-members-BDcNIFeP.js → use-members-CNN6Y-Zt.js} +1 -1
- package/dist/client/assets/{use-mobile-WXO34F35.js → use-mobile-RWxooM53.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-_rWnI-Xt.js → use-navigate-to-agent-ChzmcYSy.js} +1 -1
- package/dist/client/assets/{use-open-billing-url-CtUM2rs7.js → use-open-billing-url-XDJk2wdH.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-CO9ez288.js → use-org-auth-client-hxCPh-jf.js} +1 -1
- package/dist/client/assets/{use-org-sso-BORI0Gqf.js → use-org-sso-FYR_uf1o.js} +1 -1
- package/dist/client/assets/{use-organization-roles-DjooZXVB.js → use-organization-roles-H8GHPaLQ.js} +1 -1
- package/dist/client/assets/{use-organization-settings-CgP5KHWU.js → use-organization-settings-CmS9ohCu.js} +1 -1
- package/dist/client/assets/{use-registry-connections-C45H6T-8.js → use-registry-connections-CvNGLAr0.js} +1 -1
- package/dist/client/assets/{use-secrets-QG_xgP3_.js → use-secrets-B-jc_6m7.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-C0W9rmU4.js → use-section-preview-base-B2DzWzr2.js} +1 -1
- package/dist/client/assets/{use-status-sounds-B8tGf8un.js → use-status-sounds-UrQRxkaM.js} +1 -1
- package/dist/client/assets/{use-tags-DyMD1IY8.js → use-tags-opYrp-Zi.js} +1 -1
- package/dist/client/assets/{use-view-mode-D_OPtVgy.js → use-view-mode-Dgp9VTk6.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-DKb7Fyg4.js → use-virtual-mcp-CvLFbjo1.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-DuCyL_is.js +1 -0
- package/dist/client/assets/{useRouterState-BHJ0jJB4.js → useRouterState-rS_ZBcbr.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-ByQ627dx.js +1 -0
- package/dist/client/assets/{users-Bhh884_S.js → users-BQPiAp2u.js} +1 -1
- package/dist/client/assets/{variant-calendar-fAA5D3m3.js → variant-calendar-DboldH8s.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-DjIWnqV3.js → view-mode-toggle-DDofaiqJ.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +408 -408
- package/dist/server/server.js +288 -288
- package/package.json +1 -1
- package/dist/client/assets/record-editor-D47fnaIP.js +0 -1
- package/dist/client/assets/registry-CijDpud_.js +0 -2
- package/dist/client/assets/store-registry-R3Z16Gp0.js +0 -2
- package/dist/client/assets/useInfiniteQuery-Hwy4ey-5.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CdsuGwEV.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as se,b as Me,r as u,j as r,k as fe,B as De,e7 as Jt,aH as Zt,aN as xe,e8 as en,e9 as tn,ea as nn,eb as rn,bT as on,ec as sn,ed as lt,aJ as an,ee as ln,ef as cn,eg as dn,eh as un,ei as fn,ej as pn,ek as mn,el as xn,em as hn,m as le,o as gn,t as ne,K as Ze}from"./index-vEFJuUdN.js";import{F as bn,l as yn}from"./monaco-editor-DXyVTFn_.js";import{e as vn,aX as Cn,aY as wn}from"./agent-icon-CWBP36-h.js";import{s as Nn}from"./XClose-3fY-ChCg.js";import{B as jn}from"./automation-runs-BifnU8_i.js";import{c as et,T as tt,a as nt}from"./tooltip-BUztXQ1W.js";import{a as En}from"./chat-context-CV2ibxPd.js";import{u as Sn}from"./shell-layout-Udqd-jvd.js";import{i as Dn,E as Mn,a as Ae,b as Rn,f as Tn,g as Pn,c as kn,t as re,d as we,e as Le,h as Ne,j as Oe,k as Ie,l as Fn,s as An,v as Ln,m as $e,n as je,o as rt,p as On,q as Ee,r as Ke,w as In,x as $n,y as Kn,z as zn}from"./index-DC7whFuR.js";import{b as _n,h as Gn,a as Bn,c as Vn,d as Un,e as Hn}from"./dialog-CF1cQ1rb.js";import{I as ot}from"./input-5e_3GJtI.js";import{A as qn,a as Wn,b as Qn,c as Xn,d as Yn,e as Jn,f as Zn,g as er}from"./alert-dialog-Xn8LpVc8.js";import{t as tr}from"./ChevronDown-DsDzbrOb.js";import{i as nr}from"./ChevronRight-DwahmHLA.js";import{i as rr}from"./Share07-DS8-754J.js";import"./spinner-CppnwMRY.js";import"./delay-CnY5UFtP.js";import"./AlertCircle-iMFIwWNV.js";import"./Tool01-DStbcY86.js";import"./ArrowUp-DSxXxGdv.js";import"./ArrowLeft-CsWtY_gB.js";import"./Tool02-7YE_lsQ5.js";import"./XCircle-Cpx4dopB.js";import"./ArrowUpRight-erfF6BcP.js";import"./TrendUp01-C6JwA-Np.js";import"./ZapSquare-kC-fhZGr.js";import"./Users03-Dqls41gn.js";import"./CheckCircle-N8333lb0.js";import"./Check-CABzt6--.js";import"./ChevronUp-DBUIuLI5.js";import"./DotsVertical-BRYCw47k.js";import"./Stars02-B08-JGxx.js";import"./Copy01-B995BWXi.js";import"./CpuChip01-lt7Rkp-U.js";import"./CreditCard01-GxtaywC9.js";import"./Globe01-0reGbJcL.js";import"./Settings02-C9fJkEJh.js";import"./Eye-Clu-LouG.js";import"./FilterLines-CNzwsg4F.js";import"./Star01-CwL23CRL.js";import"./Globe04-sue1ujzC.js";import"./SwitchHorizontal01-ChVU7SWq.js";import"./HardDrive-CuFY6j2o.js";import"./Key01-C8zGItpI.js";import"./LayoutLeft-BowuBtX2.js";import"./LinkExternal01-B3QGOPZ8.js";import"./LogOut01-CwZ1Y9u4.js";import"./Monitor01-Bni1e5h7.js";import"./Sun-kp4es37w.js";import"./Palette-B6o-2LWT.js";import"./Play-BC8nRLNF.js";import"./Plus-BPZja4FC.js";import"./SearchLg-CGtAP5EH.js";import"./SearchMd-BVrWvjH3.js";import"./Shield01-CrVGBhuR.js";import"./Stars01-D94NieJP.js";import"./Trash01-DGt8nZn9.js";import"./Upload01-DgSyem4d.js";import"./User01-CPSa9S2T.js";import"./Users01-DUxHx9ib.js";import"./X-CseWQ5OZ.js";import"./Zap-B6D2E55F.js";import"./select-Dez5FrF9.js";import"./useInfiniteQuery-Hwy4ey-5.js";import"./use-infinite-scroll-DKJxpa0X.js";import"./use-connection-C57YbTcG.js";import"./use-mcp-client-lJgGp2B_.js";import"./auth-ANCOmttW.js";import"./use-virtual-mcp-DKb7Fyg4.js";import"./card-lxFop9oJ.js";import"./sidebar-BXJraWph.js";import"./use-mobile-WXO34F35.js";import"./table-7K7oqOU1.js";import"./empty-state-D7Q_5Yzc.js";import"./use-members-BDcNIFeP.js";import"./use-org-auth-client-CO9ez288.js";import"./use-clock-tick-iKIdVntg.js";import"./use-automations-CfmioFHT.js";import"./studio-tools-CBUmjJWM.js";import"./useSuspenseInfiniteQuery-CdsuGwEV.js";import"./avatar-CPIgr7-p.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-B7m5krwW.js";import"./tab-id-DdzeNQQR.js";import"./hooks-CJA4VXgB.js";import"./decopilot-sse-pool-Cvk81TxT.js";import"./backoff-CrEUbyZT.js";import"./index-CjTnqBk_.js";import"./integration-icon-Hw_CmlIO.js";import"./use-navigate-to-agent-_rWnI-Xt.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-GCRS_-AP.js";import"./form-D6GqaWU9.js";import"./label-DfGzQmB5.js";import"./file-type-icon-BBtbE_NU.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-ai-providers-B0Xkp5BB.js";import"./use-decopilot-events-9EcaK7qN.js";import"./use-organization-settings-CgP5KHWU.js";import"./required-auth-layout-_hvJxMv_.js";import"./use-org-sso-BORI0Gqf.js";import"./drawer-DfRIJaDr.js";import"./collection-search-BzYqusXY.js";import"./deco-site-production-url-BjY4ZYd-.js";import"./tabs-mQsLl4zR.js";import"./toggle-group-De9TzUcu.js";import"./use-deco-credits-9r63SN2F.js";import"./popover-DlPz4To4.js";import"./self-tool-result-CEBp4imh.js";import"./extract-connection-data-sVdeut_9.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-C2HwF4Ce.js";import"./use-debounced-value-CEYSL9GY.js";import"./authenticate-and-persist-oauth-C-JqvyRh.js";import"./mcp-oauth-OIUxe3g2.js";import"./track-BdasaloK.js";import"./toolbar-BgPfvPzL.js";import"./skeleton-pl0N1Ino.js";import"./github-repo-picker-yxnDF_Mi.js";import"./use-mcp-tools-CMs4Nd8q.js";import"./agent-capabilities-cXfbMfjV.js";import"./connection-card-D-cmYmCq.js";import"./use-registry-connections-C45H6T-8.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-B-bmHFzf.js";import"./connection-form-helpers-DFqceUmS.js";import"./collection-tabs-Di0fmDNx.js";import"./badge-BoP7NhL_.js";import"./use-open-billing-url-CtUM2rs7.js";import"./select-model-CR0-6PXS.js";import"./checkbox-ZpkUR1gq.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-DPTzp_P_.js";import"./cards-S5FAmKUB.js";import"./dropdown-menu-AkajeJh4.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-B8tGf8un.js";import"./use-capability-D7eAS5np.js";import"./pt-BR-CLy76QW2.js";import"./switch-By_6CkwD.js";import"./use-debounced-autosave--SMcEphJ.js";import"./index-EI3Ugq-F.js";import"./search-input-Bao8w6Sm.js";import"./index-Al4HY1a3.js";import"./use-secrets-QG_xgP3_.js";import"./use-tags-DyMD1IY8.js";import"./get-initials-D-f_fDFw.js";import"./command-Bemo-h0S.js";import"./index-C3vGEoWV.js";import"./use-file-configs-BWwvZiOJ.js";import"./automation-list-row-BcUdJrVC.js";const or={"new-file":{titleKey:"sandbox.fileExplorerNameDialog.newFileTitle",descriptionKey:"sandbox.fileExplorerNameDialog.newFileDescription",submitKey:"sandbox.fileExplorerNameDialog.newFileSubmit",placeholderKey:"sandbox.fileExplorerNameDialog.newFilePlaceholder"},"new-folder":{titleKey:"sandbox.fileExplorerNameDialog.newFolderTitle",descriptionKey:"sandbox.fileExplorerNameDialog.newFolderDescription",submitKey:"sandbox.fileExplorerNameDialog.newFolderSubmit",placeholderKey:"sandbox.fileExplorerNameDialog.newFolderPlaceholder"},rename:{titleKey:"sandbox.fileExplorerNameDialog.renameTitle",descriptionKey:"sandbox.fileExplorerNameDialog.renameDescription",submitKey:"sandbox.fileExplorerNameDialog.renameSubmit",placeholderKey:"sandbox.fileExplorerNameDialog.renamePlaceholder"}};function sr(i){const e=se.c(71),{open:s,mode:a,initialName:l,parentLabel:m,isPending:h,onSubmit:f,onOpenChange:v}=i,j=l===void 0?"":l,d=h===void 0?!1:h,x=Me(),[g,k]=u.useState(j),[Z,q]=u.useState(s),y=or[a];s!==Z&&(q(s),s&&k(j));let b;e[0]!==d||e[1]!==v?(b=_=>{!_&&!d&&v(!1)},e[0]=d,e[1]=v,e[2]=b):b=e[2];const F=b;let A;e[3]!==d||e[4]!==g||e[5]!==f?(A=async _=>{_.preventDefault();const te=g.trim();!te||d||await f(te)},e[3]=d,e[4]=g,e[5]=f,e[6]=A):A=e[6];const I=A;let S;e[7]!==y.titleKey||e[8]!==x?(S=x(y.titleKey),e[7]=y.titleKey,e[8]=x,e[9]=S):S=e[9];let P;e[10]!==S?(P=r.jsx(_n,{children:S}),e[10]=S,e[11]=P):P=e[11];let D;e[12]!==y.descriptionKey||e[13]!==x?(D=x(y.descriptionKey),e[12]=y.descriptionKey,e[13]=x,e[14]=D):D=e[14];let M;e[15]!==D?(M=r.jsx(Gn,{children:D}),e[15]=D,e[16]=M):M=e[16];let N;e[17]!==P||e[18]!==M?(N=r.jsxs(Bn,{children:[P,M]}),e[17]=P,e[18]=M,e[19]=N):N=e[19];let R;e[20]!==m||e[21]!==x?(R=m&&r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:x("sandbox.fileExplorerNameDialog.location")}),r.jsx(ot,{value:m,readOnly:!0,disabled:!0,className:"font-mono text-xs"})]}),e[20]=m,e[21]=x,e[22]=R):R=e[22];let E;e[23]!==x?(E=x("sandbox.fileExplorerNameDialog.name"),e[23]=x,e[24]=E):E=e[24];let T;e[25]!==E?(T=r.jsx("label",{htmlFor:"file-explorer-name",className:"text-xs font-medium text-muted-foreground",children:E}),e[25]=E,e[26]=T):T=e[26];let Q;e[27]===Symbol.for("react.memo_cache_sentinel")?(Q=_=>k(_.target.value),e[27]=Q):Q=e[27];let X;e[28]!==y.placeholderKey||e[29]!==x?(X=x(y.placeholderKey),e[28]=y.placeholderKey,e[29]=x,e[30]=X):X=e[30];let Y;e[31]!==d||e[32]!==g||e[33]!==X?(Y=r.jsx(ot,{id:"file-explorer-name",value:g,onChange:Q,placeholder:X,autoFocus:!0,disabled:d}),e[31]=d,e[32]=g,e[33]=X,e[34]=Y):Y=e[34];let G;e[35]!==T||e[36]!==Y?(G=r.jsxs("div",{className:"space-y-1.5",children:[T,Y]}),e[35]=T,e[36]=Y,e[37]=G):G=e[37];let $;e[38]!==R||e[39]!==G?($=r.jsxs("div",{className:"space-y-4 py-4",children:[R,G]}),e[38]=R,e[39]=G,e[40]=$):$=e[40];let W;e[41]!==v?(W=()=>v(!1),e[41]=v,e[42]=W):W=e[42];let K;e[43]!==x?(K=x("sandbox.fileExplorerNameDialog.cancel"),e[43]=x,e[44]=K):K=e[44];let z;e[45]!==d||e[46]!==W||e[47]!==K?(z=r.jsx(De,{type:"button",variant:"outline",onClick:W,disabled:d,children:K}),e[45]=d,e[46]=W,e[47]=K,e[48]=z):z=e[48];let B;e[49]!==d||e[50]!==g?(B=!g.trim()||d,e[49]=d,e[50]=g,e[51]=B):B=e[51];let L;e[52]!==y.submitKey||e[53]!==d||e[54]!==x?(L=d?r.jsxs(r.Fragment,{children:[r.jsx(fe,{size:14,className:"animate-spin"}),x("sandbox.fileExplorerNameDialog.saving")]}):x(y.submitKey),e[52]=y.submitKey,e[53]=d,e[54]=x,e[55]=L):L=e[55];let V;e[56]!==B||e[57]!==L?(V=r.jsx(De,{type:"submit",disabled:B,children:L}),e[56]=B,e[57]=L,e[58]=V):V=e[58];let O;e[59]!==z||e[60]!==V?(O=r.jsxs(Vn,{children:[z,V]}),e[59]=z,e[60]=V,e[61]=O):O=e[61];let U;e[62]!==I||e[63]!==$||e[64]!==O||e[65]!==N?(U=r.jsx(Un,{className:"sm:max-w-md",children:r.jsxs("form",{onSubmit:I,children:[N,$,O]})}),e[62]=I,e[63]=$,e[64]=O,e[65]=N,e[66]=U):U=e[66];let ee;return e[67]!==F||e[68]!==s||e[69]!==U?(ee=r.jsx(Hn,{open:s,onOpenChange:F,children:U}),e[67]=F,e[68]=s,e[69]=U,e[70]=ee):ee=e[70],ee}function ar(i){const e=se.c(47),{deleteTarget:s,deleteDirtyPaths:a,fsActionPending:l,onOpenChange:m,onConfirm:h}=i,f=Me(),v=s?.kind==="directory",j=s!==null,d=v?"sandbox.fileExplorerDeleteDialog.titleFolder":"sandbox.fileExplorerDeleteDialog.titleFile";let x;e[0]!==f||e[1]!==d?(x=f(d),e[0]=f,e[1]=d,e[2]=x):x=e[2];let g;e[3]!==x?(g=r.jsx(qn,{children:x}),e[3]=x,e[4]=g):g=e[4];let k;e[5]!==f?(k=f("sandbox.fileExplorerDeleteDialog.description"),e[5]=f,e[6]=k):k=e[6];const Z=s?.name;let q;e[7]!==Z?(q=r.jsx("span",{className:"font-mono",children:Z}),e[7]=Z,e[8]=q):q=e[8];let y;e[9]!==v||e[10]!==f?(y=v?f("sandbox.fileExplorerDeleteDialog.folderSuffix"):".",e[9]=v,e[10]=f,e[11]=y):y=e[11];let b;e[12]!==a.length||e[13]!==f?(b=a.length>0&&r.jsxs(r.Fragment,{children:[" ",a.length===1?f("sandbox.fileExplorerDeleteDialog.unsavedChangesOne"):f("sandbox.fileExplorerDeleteDialog.unsavedChangesMany",{count:a.length})]}),e[12]=a.length,e[13]=f,e[14]=b):b=e[14];let F;e[15]!==k||e[16]!==q||e[17]!==y||e[18]!==b?(F=r.jsxs(Wn,{children:[k," ",q,y,b]}),e[15]=k,e[16]=q,e[17]=y,e[18]=b,e[19]=F):F=e[19];let A;e[20]!==F||e[21]!==g?(A=r.jsxs(Qn,{children:[g,F]}),e[20]=F,e[21]=g,e[22]=A):A=e[22];let I;e[23]!==f?(I=f("sandbox.fileExplorerDeleteDialog.cancel"),e[23]=f,e[24]=I):I=e[24];let S;e[25]!==l||e[26]!==I?(S=r.jsx(Xn,{disabled:l,children:I}),e[25]=l,e[26]=I,e[27]=S):S=e[27];const P=l||!s;let D;e[28]!==s||e[29]!==h?(D=Q=>{Q.preventDefault(),s&&h(s)},e[28]=s,e[29]=h,e[30]=D):D=e[30];let M;e[31]!==f?(M=f("sandbox.fileExplorerDeleteDialog.delete"),e[31]=f,e[32]=M):M=e[32];let N;e[33]!==P||e[34]!==D||e[35]!==M?(N=r.jsx(Yn,{disabled:P,onClick:D,children:M}),e[33]=P,e[34]=D,e[35]=M,e[36]=N):N=e[36];let R;e[37]!==S||e[38]!==N?(R=r.jsxs(Jn,{children:[S,N]}),e[37]=S,e[38]=N,e[39]=R):R=e[39];let E;e[40]!==A||e[41]!==R?(E=r.jsxs(Zn,{children:[A,R]}),e[40]=A,e[41]=R,e[42]=E):E=e[42];let T;return e[43]!==m||e[44]!==j||e[45]!==E?(T=r.jsx(er,{open:j,onOpenChange:m,children:E}),e[43]=m,e[44]=j,e[45]=E,e[46]=T):T=e[46],T}var ze="ContextMenu",[ir]=an(ze,[lt]),J=lt(),[lr,ct]=ir(ze),dt=i=>{const{__scopeContextMenu:e,children:s,onOpenChange:a,dir:l,modal:m=!0}=i,[h,f]=u.useState(!1),v=J(e),j=on(a),d=u.useCallback(x=>{f(x),j(x)},[j]);return r.jsx(lr,{scope:e,open:h,onOpenChange:d,modal:m,children:r.jsx(sn,{...v,dir:l,open:h,onOpenChange:d,modal:m,children:s})})};dt.displayName=ze;var ut="ContextMenuTrigger",ft=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,disabled:a=!1,...l}=i,m=ct(ut,s),h=J(s),f=u.useRef({x:0,y:0}),v=u.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...f.current})}),j=u.useRef(0),d=u.useCallback(()=>window.clearTimeout(j.current),[]),x=g=>{f.current={x:g.clientX,y:g.clientY},m.onOpenChange(!0)};return u.useEffect(()=>d,[d]),u.useEffect(()=>{a&&d()},[a,d]),r.jsxs(r.Fragment,{children:[r.jsx(Jt,{...h,virtualRef:v}),r.jsx(Zt.span,{"data-state":m.open?"open":"closed","data-disabled":a?"":void 0,...l,ref:e,style:{WebkitTouchCallout:"none",...i.style},onContextMenu:a?i.onContextMenu:xe(i.onContextMenu,g=>{d(),x(g),g.preventDefault()}),onPointerDown:a?i.onPointerDown:xe(i.onPointerDown,Se(g=>{d(),j.current=window.setTimeout(()=>x(g),700)})),onPointerMove:a?i.onPointerMove:xe(i.onPointerMove,Se(d)),onPointerCancel:a?i.onPointerCancel:xe(i.onPointerCancel,Se(d)),onPointerUp:a?i.onPointerUp:xe(i.onPointerUp,Se(d))})]})});ft.displayName=ut;var cr="ContextMenuPortal",pt=i=>{const{__scopeContextMenu:e,...s}=i,a=J(e);return r.jsx(nn,{...a,...s})};pt.displayName=cr;var mt="ContextMenuContent",xt=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=ct(mt,s),m=J(s),h=u.useRef(!1);return r.jsx(rn,{...m,...a,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:f=>{i.onCloseAutoFocus?.(f),!f.defaultPrevented&&h.current&&f.preventDefault(),h.current=!1},onInteractOutside:f=>{i.onInteractOutside?.(f),!f.defaultPrevented&&!l.modal&&(h.current=!0)},style:{...i.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});xt.displayName=mt;var dr="ContextMenuGroup",ur=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(ln,{...l,...a,ref:e})});ur.displayName=dr;var fr="ContextMenuLabel",pr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(cn,{...l,...a,ref:e})});pr.displayName=fr;var mr="ContextMenuItem",ht=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(en,{...l,...a,ref:e})});ht.displayName=mr;var xr="ContextMenuCheckboxItem",hr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(dn,{...l,...a,ref:e})});hr.displayName=xr;var gr="ContextMenuRadioGroup",br=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(un,{...l,...a,ref:e})});br.displayName=gr;var yr="ContextMenuRadioItem",vr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(fn,{...l,...a,ref:e})});vr.displayName=yr;var Cr="ContextMenuItemIndicator",wr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(pn,{...l,...a,ref:e})});wr.displayName=Cr;var Nr="ContextMenuSeparator",gt=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(tn,{...l,...a,ref:e})});gt.displayName=Nr;var jr="ContextMenuArrow",Er=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(mn,{...l,...a,ref:e})});Er.displayName=jr;var Sr="ContextMenuSubTrigger",Dr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(xn,{...l,...a,ref:e})});Dr.displayName=Sr;var Mr="ContextMenuSubContent",Rr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(hn,{...l,...a,ref:e,style:{...i.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Rr.displayName=Mr;function Se(i){return e=>e.pointerType!=="mouse"?i(e):void 0}var Tr=dt,Pr=ft,kr=pt,Fr=xt,Ar=ht,Lr=gt;function Or(i){const e=se.c(4);let s;e[0]!==i?({...s}=i,e[0]=i,e[1]=s):s=e[1];let a;return e[2]!==s?(a=r.jsx(Tr,{"data-slot":"context-menu",...s}),e[2]=s,e[3]=a):a=e[3],a}function Ir(i){const e=se.c(4);let s;e[0]!==i?({...s}=i,e[0]=i,e[1]=s):s=e[1];let a;return e[2]!==s?(a=r.jsx(Pr,{"data-slot":"context-menu-trigger",...s}),e[2]=s,e[3]=a):a=e[3],a}function $r(i){const e=se.c(8);let s,a;e[0]!==i?({className:s,...a}=i,e[0]=i,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let l;e[3]!==s?(l=le("notranslate bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",s),e[3]=s,e[4]=l):l=e[4];let m;return e[5]!==a||e[6]!==l?(m=r.jsx(kr,{children:r.jsx(Fr,{"data-slot":"context-menu-content",translate:"no",className:l,...a})}),e[5]=a,e[6]=l,e[7]=m):m=e[7],m}function ue(i){const e=se.c(12);let s,a,l,m;e[0]!==i?({className:s,inset:a,variant:m,...l}=i,e[0]=i,e[1]=s,e[2]=a,e[3]=l,e[4]=m):(s=e[1],a=e[2],l=e[3],m=e[4]);const h=m===void 0?"default":m;let f;e[5]!==s?(f=le("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",s),e[5]=s,e[6]=f):f=e[6];let v;return e[7]!==a||e[8]!==l||e[9]!==f||e[10]!==h?(v=r.jsx(Ar,{"data-slot":"context-menu-item","data-inset":a,"data-variant":h,className:f,...l}),e[7]=a,e[8]=l,e[9]=f,e[10]=h,e[11]=v):v=e[11],v}function st(i){const e=se.c(8);let s,a;e[0]!==i?({className:s,...a}=i,e[0]=i,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let l;e[3]!==s?(l=le("bg-border -mx-1 my-1 h-px",s),e[3]=s,e[4]=l):l=e[4];let m;return e[5]!==a||e[6]!==l?(m=r.jsx(Lr,{"data-slot":"context-menu-separator",className:l,...a}),e[5]=a,e[6]=l,e[7]=m):m=e[7],m}const Kr="#d9a441";function zr(i){const e=se.c(63),{node:s,depth:a,isExpanded:l,isSelected:m,isLoading:h,fileVisual:f,onOpen:v,onSelect:j,onNewFile:d,onNewFolder:x,onCopyPath:g,onCopyRelativePath:k,onRename:Z,onDelete:q}=i,y=h===void 0?!1:h,b=Me(),F=s.kind==="directory",{Icon:A,color:I}=f,S=m&&"bg-accent";let P;e[0]!==S?(P=le("flex w-full items-center gap-1.5 px-2 py-1.5 text-left text-[13px] hover:bg-accent transition-colors",S),e[0]=S,e[1]=P):P=e[1];const D=`${a*14+8}px`;let M;e[2]!==D?(M={paddingLeft:D},e[2]=D,e[3]=M):M=e[3];let N;e[4]!==v||e[5]!==j?(N=()=>{j(),v()},e[4]=v,e[5]=j,e[6]=N):N=e[6];let R;e[7]!==A||e[8]!==I||e[9]!==F||e[10]!==l||e[11]!==y?(R=F?r.jsxs(r.Fragment,{children:[y?r.jsx(fe,{size:14,className:"shrink-0 animate-spin text-muted-foreground"}):l?r.jsx(tr,{size:14,className:"shrink-0 text-muted-foreground"}):r.jsx(nr,{size:14,className:"shrink-0 text-muted-foreground"}),r.jsx(rr,{size:16,className:"shrink-0",style:{color:Kr}})]}):r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"w-3.5 shrink-0"}),r.jsx(A,{size:16,className:"shrink-0",style:{color:I}})]}),e[7]=A,e[8]=I,e[9]=F,e[10]=l,e[11]=y,e[12]=R):R=e[12];let E;e[13]!==s.name?(E=r.jsx("span",{className:"truncate",children:s.name}),e[13]=s.name,e[14]=E):E=e[14];let T;e[15]!==P||e[16]!==M||e[17]!==N||e[18]!==R||e[19]!==E?(T=r.jsx(Ir,{asChild:!0,children:r.jsxs("button",{type:"button",className:P,style:M,onClick:N,children:[R,E]})}),e[15]=P,e[16]=M,e[17]=N,e[18]=R,e[19]=E,e[20]=T):T=e[20];let Q;e[21]!==b?(Q=b("sandbox.fileTreeRow.newFile"),e[21]=b,e[22]=Q):Q=e[22];let X;e[23]!==d||e[24]!==Q?(X=r.jsx(ue,{onSelect:d,children:Q}),e[23]=d,e[24]=Q,e[25]=X):X=e[25];let Y;e[26]!==b?(Y=b("sandbox.fileTreeRow.newFolder"),e[26]=b,e[27]=Y):Y=e[27];let G;e[28]!==x||e[29]!==Y?(G=r.jsx(ue,{onSelect:x,children:Y}),e[28]=x,e[29]=Y,e[30]=G):G=e[30];let $;e[31]===Symbol.for("react.memo_cache_sentinel")?($=r.jsx(st,{}),e[31]=$):$=e[31];let W;e[32]!==b?(W=b("sandbox.fileTreeRow.copyPath"),e[32]=b,e[33]=W):W=e[33];let K;e[34]!==g||e[35]!==W?(K=r.jsx(ue,{onSelect:g,children:W}),e[34]=g,e[35]=W,e[36]=K):K=e[36];let z;e[37]!==b?(z=b("sandbox.fileTreeRow.copyRelativePath"),e[37]=b,e[38]=z):z=e[38];let B;e[39]!==k||e[40]!==z?(B=r.jsx(ue,{onSelect:k,children:z}),e[39]=k,e[40]=z,e[41]=B):B=e[41];let L;e[42]===Symbol.for("react.memo_cache_sentinel")?(L=r.jsx(st,{}),e[42]=L):L=e[42];let V;e[43]!==b?(V=b("sandbox.fileTreeRow.rename"),e[43]=b,e[44]=V):V=e[44];let O;e[45]!==Z||e[46]!==V?(O=r.jsx(ue,{onSelect:Z,children:V}),e[45]=Z,e[46]=V,e[47]=O):O=e[47];let U;e[48]!==b?(U=b("sandbox.fileTreeRow.delete"),e[48]=b,e[49]=U):U=e[49];let ee;e[50]!==q||e[51]!==U?(ee=r.jsx(ue,{variant:"destructive",onSelect:q,children:U}),e[50]=q,e[51]=U,e[52]=ee):ee=e[52];let _;e[53]!==X||e[54]!==G||e[55]!==K||e[56]!==B||e[57]!==O||e[58]!==ee?(_=r.jsxs($r,{className:"w-52",children:[X,G,$,K,B,L,O,ee]}),e[53]=X,e[54]=G,e[55]=K,e[56]=B,e[57]=O,e[58]=ee,e[59]=_):_=e[59];let te;return e[60]!==_||e[61]!==T?(te=r.jsxs(Or,{children:[T,_]}),e[60]=_,e[61]=T,e[62]=te):te=e[62],te}yn.config({paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.0/min/vs"}});const at=200,_r=2,Gr=250,it=200;function Br(i,e,s,a){return`/api/${i}/sandbox/${encodeURIComponent(e)}/${encodeURIComponent(s)}/${a}`}function Vr(i){const e=se.c(9),{text:s,query:a}=i;let l,m,h;if(e[0]!==a||e[1]!==s){const{leadingEllipsis:v,segments:j}=Fn(s,a);l="truncate font-mono text-muted-foreground",m=v&&r.jsx("span",{className:"text-muted-foreground/50",children:"…"}),h=j.map(Ur),e[0]=a,e[1]=s,e[2]=l,e[3]=m,e[4]=h}else l=e[2],m=e[3],h=e[4];let f;return e[5]!==l||e[6]!==m||e[7]!==h?(f=r.jsxs("span",{className:l,children:[m,h]}),e[5]=l,e[6]=m,e[7]=h,e[8]=f):f=e[8],f}function Ur(i,e){return i.match?r.jsx("span",{className:"rounded-[2px] bg-primary/20 text-foreground",children:i.text},e):r.jsx("span",{children:i.text},e)}function $a({orgSlug:i,virtualMcpId:e,branch:s,openPath:a}){const[l,m]=u.useState({files:[],directories:[],truncated:!1}),{files:h,directories:f}=l,[v,j]=u.useState(new Set),[d,x]=u.useState(null),[g,k]=u.useState(null),[Z,q]=u.useState([]),[y,b]=u.useState(""),[F,A]=u.useState(null),[I,S]=u.useState(null),[P,D]=u.useState(!1),[M,N]=u.useState(!1),[R,E]=u.useState(!1),[T,Q]=u.useState(!1),[,X]=u.useState(new Set),[Y,G]=u.useState(new Set),$=u.useRef(0),W=u.useRef(null),K=u.useRef(new Set),z=u.useRef(new Map),B=u.useRef(null),L=u.useRef(0),V=u.useRef(null),O=u.useRef(null),U=u.useRef(null);function ee(t){X(n=>{const o=typeof t=="function"?t(n):t;return K.current=o,o})}const[_,te]=u.useState(new Map),Re=u.useRef(null),[ae,he]=u.useState(null),{sendMessage:bt}=En(),{openSidePanel:yt}=Sn(),ge=gn(),[H,oe]=u.useState(null),[Te,Pe]=u.useState(null),[be,ye]=u.useState(!1);async function ie(t,n){const o=await fetch(Br(i,e,s,t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(n)});if(!o.ok){const c=await o.json().catch(()=>({}));throw new Error(c.error??`Request failed (${o.status})`)}return o.json()}async function ve(){ge.invalidateQueries({queryKey:rt(i,e,s)})}function _e(t,n,o){navigator.clipboard.writeText(o).then(()=>ne.success(t("sandbox.fileExplorer.textCopied",{label:n})),()=>ne.error(t("sandbox.fileExplorer.failedToCopyText",{label:n.toLowerCase()})))}function vt(t){const n=Kn(t);if(!n)return;const o=`${i}/${e}/${s}`;ge.setQueryData(Ze.decofile(o),c=>{if(!c)return c;const{[n]:p,...C}=c;return C}),ge.invalidateQueries({queryKey:Ze.liveMeta(i,e,s)})}function Ct(t){const n=t.kind==="file"?[t.path]:h.filter(o=>o.startsWith(".deco/blocks/")).map(o=>we(o)).filter(o=>o===t.path||o.startsWith(`${t.path}/`));for(const o of n)vt(o)}function wt(t){const n=we(t);return Z.filter(o=>{if(o!==n&&!o.startsWith(`${n}/`))return!1;const c=_.get(o);return!!(c?.loaded&&c.editorValue!==c.savedContent)})}function Ge(t){q(n=>n.map(o=>t(o)).filter(o=>o!==null)),x(n=>n&&t(n)),te(n=>{const o=new Map;for(const[c,p]of n){const C=t(c);C&&o.set(C,p)}return o}),k(n=>{if(!n)return n;const o=t(n.path);return o?o===n.path?n:{...n,path:o,name:o.split("/").pop()??o}:null})}function Nt(t){const n=we(t);k(o=>o&&(o.path===n||o.path.startsWith(`${n}/`)?null:o)),Ge(o=>o===n||o.startsWith(`${n}/`)?null:o)}async function jt(t,n){if(!H)return;const o=Ee(H.parentDir,n);if(Ke(o,h,f))throw new Error(t("sandbox.fileExplorer.fileAlreadyExists",{name:n}));await ie("write",{path:re(o),content:""}),await pe(),await ve(),oe(null),me(o)}async function Et(t,n){if(!H)return;const o=Ee(H.parentDir,n);if(Ke(o,h,f))throw new Error(t("sandbox.fileExplorer.fileAlreadyExists",{name:n}));const c=re(o);await ie("mkdir",{path:c}),m(p=>({...p,directories:p.directories.includes(c)?p.directories:[...p.directories,c]})),await pe(),await ve(),oe(null),j(p=>{const C=new Set(p);for(const ce of Ie(o))C.add(ce);return C.add(o),C}),k({name:n,path:o,kind:"directory",children:[]})}async function St(t,n){if(!H)return;const o=H.node.path,c=Ne(o),p=Ee(c,n);if(p===o){oe(null);return}if(Ke(p,h,f))throw new Error(t("sandbox.fileExplorer.fileAlreadyExists",{name:n}));await ie("rename",{from:re(o),to:re(p)}),Ge(C=>C===o?p:C.startsWith(`${o}/`)?Ee(p,C.slice(o.length+1)):C),await pe(),await ve(),oe(null)}async function Dt(t,n){ye(!0);try{await ie("unlink",{path:re(n.path),recursive:n.kind==="directory"}),Ct(n),Nt(n.path),await pe(),await ve(),Pe(null),ne.success(t("sandbox.fileExplorer.fileDeleted",{name:n.name}))}catch(o){ne.error(o instanceof Error?o.message:t("sandbox.fileExplorer.deleteFailed"))}finally{ye(!1)}}async function Mt(t,n){const o=Ln(n);if(o){ne.error(o);return}ye(!0);try{H?.mode==="new-file"?(await jt(t,n),ne.success(t("sandbox.fileExplorer.fileCreated",{name:n}))):H?.mode==="new-folder"?(await Et(t,n),ne.success(t("sandbox.fileExplorer.folderCreated",{name:n}))):H?.mode==="rename"&&(await St(t,n),ne.success(t("sandbox.fileExplorer.renamedTo",{name:n})))}catch(c){ne.error(c instanceof Error?c.message:t("sandbox.fileExplorer.operationFailed"))}finally{ye(!1)}}const Be=u.useRef(!1);Be.current||(Be.current=!0,W.current=pe());const[Rt,Tt]=u.useState(null),w=Me();if(a&&a!==Rt){Tt(a);const t=a;queueMicrotask(()=>{Dn(t)&&me(t)})}async function ke(t){const n=await ie("glob",t);return{files:n.files??[],directories:n.directories??[],truncated:n.truncated}}function Ve(t,n,o){if(o!==$.current)return!1;let c=!1;return m(p=>{const C=n?zn(p.files,p.directories,t,p.truncated):{files:t.files,directories:t.directories??[],truncated:!!t.truncated};return c=!!C.truncated,{files:C.files,directories:C.directories,truncated:c}}),c&&ne.warning(w("sandbox.fileExplorer.fileListTruncated")),c}async function Pt(t){const n=z.current.get(t);if(n)return n;const o=$.current,c=(async()=>{const p=await ke({pattern:"**/*",path:re(t),limit:Ae}),C=Ve(p,!0,o);return!C&&o===$.current&&ee(ce=>{const Ce=new Set(ce);return Ce.add(t),Ce}),C})();z.current.set(t,c);try{return await c}finally{z.current.delete(t)}}async function Ue(t){if(!$e(t,K.current))return!1;G(n=>new Set(n).add(t));try{return await Pt(t)}finally{G(n=>{const o=new Set(n);return o.delete(t),o})}}async function kt(t,n){const o=new Set(K.current);for(const c of Ie(n)){if(!$e(c,o))continue;if(await Ue(c))throw new Error(t("sandbox.fileExplorer.folderListingTruncated"));o.add(c)}}async function pe(){const t=++$.current;V.current=null,O.current=null,z.current.clear(),E(!0),ee(new Set),j(new Set),G(new Set);try{const n=await ke({pattern:"**/*",limit:Ae,maxDepth:Mn});Ve(n,!1,t),Q(!0)}catch{T&&ne.error(w("sandbox.fileExplorer.failedToRefreshFileTree"))}finally{E(!1)}}async function He(t){if(!_.get(t)?.loaded){te(o=>{const c=new Map(o);return c.set(t,{savedContent:"",editorValue:"",loaded:!1}),c});try{const o=await ie("read",{path:re(t),full:!0}),c=An(o.content??"");te(p=>{const C=new Map(p);return C.set(t,{savedContent:c,editorValue:c,loaded:!0}),C})}catch{}}}function Ft(){L.current++,A(null),S(null),D(!1),N(!1)}async function At(){const t=$.current,n=V.current;if(n&&n.generation===t)return n.files;const o=O.current;if(o&&o.generation===t)return o.promise;const c=(async()=>{const p=await ke({pattern:"**/*",limit:Ae});return $.current===t&&(V.current={generation:t,files:p.files}),p.files})();O.current={generation:t,promise:c};try{return await c}finally{O.current?.generation===t&&(O.current=null)}}async function Lt(t,n){try{const o=await At();if(n!==L.current)return;A(In(o,t,it))}catch{if(n!==L.current)return;A([])}}async function Ot(t,n){D(!0);try{const o=await ie("grep",{pattern:t,output_mode:"content",ignore_case:!0,fixed_strings:!0,limit:at});if(n!==L.current)return;S($n(o.results??"")),N((o.matchCount??0)>=at)}catch{if(n!==L.current)return;S([]),N(!1)}finally{n===L.current&&D(!1)}}function It(t){const n=t.trim(),o=++L.current;Lt(n,o),n.length<_r?(S(null),D(!1),N(!1)):Ot(n,o)}function $t(t){if(b(t),B.current&&clearTimeout(B.current),!t.trim()){Ft();return}B.current=setTimeout(()=>{It(t)},Gr)}function qe(t){const n=U.current;if(!n||n.path!==d)return;U.current=null;const o=Math.max(1,n.line);t.revealLineInCenter(o),t.setPosition({lineNumber:o,column:1}),t.focus()}function Kt(t){U.current={path:t.path,line:t.line};const n=d===t.path&&_.get(t.path)?.loaded;me(t.path),n&&Re.current&&qe(Re.current)}async function zt(t,n){try{await ie("write",{path:re(t),content:n}),je("file saved via sandbox /write",{path:t}),ge.invalidateQueries({queryKey:rt(i,e,s)});try{const o=await On(i,e,s);je("git status after save",o)}catch(o){je("git status after save failed",{path:t,error:o instanceof Error?o.message:String(o)})}te(o=>{const c=new Map(o),p=c.get(t);return p&&c.set(t,{...p,savedContent:n}),c})}catch(o){je("file save failed",{path:t,error:o instanceof Error?o.message:String(o)})}}function _t(t){x(t),k({name:t.split("/").pop()??t,path:t,kind:"file",children:[]}),he(null),Z.includes(t)||q(n=>[...n,t]),He(t)}function Gt(t){q(n=>{const o=n.filter(c=>c!==t);return d===t&&x(o[o.length-1]??null),o}),te(n=>{const o=new Map(n);return o.delete(t),o})}function We(t){j(n=>{const o=new Set(n);return o.has(t)?o.delete(t):o.add(t),o})}async function Bt(t){if($e(t,K.current))try{if(await Ue(t))return}catch(n){ne.error(n instanceof Error?n.message:w("sandbox.fileExplorer.failedToLoadFolder"));return}We(t)}async function Vt(t,n){if(n){We(t);return}await Bt(t)}async function Ut(t){await W.current,await kt(w,t);const n=Ie(t);j(o=>{const c=new Set(o);for(const p of n)c.add(p);return c}),_t(t)}function me(t){Ut(t).catch(n=>{ne.error(n instanceof Error?n.message:w("sandbox.fileExplorer.failedToOpenFile"))})}function Ht(){return g?.kind==="directory"?g.path:g?.kind==="file"?Ne(g.path):d?Ne(d):"/"}function Qe(t){const n=Ht();oe({mode:t,parentDir:n,node:{name:"",path:n,kind:"directory",children:[]}})}const qt=Rn(h,f),Xe=Tn(qt,v),Fe=F?.length??0,Ye=Pn(I??[]),Je=I?.length??0,de=d?_.get(d):null,Wt=de?.loaded&&de.editorValue!==de.savedContent,Qt=Te?wt(Te.path):[],Xt=(t,n)=>{Re.current=t,qe(t),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyS,async()=>{if(!d)return;const o=t.getValue();await zt(d,o)}),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyK,()=>{const o=t.getSelection(),c=t.getModel();if(!o||!c||!d)return;const p=c.getValueInRange(o);he({filePath:d,lineStart:o.startLineNumber,lineEnd:o.endLineNumber,selectedCode:p})})};function Yt(t){if(!ae)return;const n=[`The user selected code in the file explorer and asked: **"${t.trim()}"**`,"",`**File:** \`${ae.filePath}\``,`**Lines:** ${ae.lineStart}–${ae.lineEnd}`];if(ae.selectedCode){const o=Oe(ae.filePath),c=ae.selectedCode.replace(/```/g,"`` `");n.push("","**Selected code:**","```"+o,c,"```")}n.push("","Please read the source file, locate the code, and apply the requested change."),yt("chat"),bt({parts:[{type:"text",text:n.join(`
|
|
1
|
+
import{c as se,b as Me,r as u,j as r,k as fe,B as De,e7 as Jt,aH as Zt,aN as xe,e8 as en,e9 as tn,ea as nn,eb as rn,bT as on,ec as sn,ed as lt,aJ as an,ee as ln,ef as cn,eg as dn,eh as un,ei as fn,ej as pn,ek as mn,el as xn,em as hn,m as le,o as gn,t as ne,K as Ze}from"./index-Bfy-Fe7V.js";import{F as bn,l as yn}from"./monaco-editor-a45QrHzb.js";import{e as vn,aX as Cn,aY as wn}from"./agent-icon-D_vHJRnE.js";import{s as Nn}from"./XClose-BoiJoxeV.js";import{B as jn}from"./automation-runs-DeLRBvkt.js";import{c as et,T as tt,a as nt}from"./tooltip-F9SMeJ-j.js";import{a as En}from"./chat-context-cK_4I7Xc.js";import{u as Sn}from"./shell-layout-C7FmlawD.js";import{i as Dn,E as Mn,a as Ae,b as Rn,f as Tn,g as Pn,c as kn,t as re,d as we,e as Le,h as Ne,j as Oe,k as Ie,l as Fn,s as An,v as Ln,m as $e,n as je,o as rt,p as On,q as Ee,r as Ke,w as In,x as $n,y as Kn,z as zn}from"./index-BEYzla8F.js";import{b as _n,h as Gn,a as Bn,c as Vn,d as Un,e as Hn}from"./dialog-7h2q_S_D.js";import{I as ot}from"./input-BVD_WyXJ.js";import{A as qn,a as Wn,b as Qn,c as Xn,d as Yn,e as Jn,f as Zn,g as er}from"./alert-dialog-BgN-Tqd-.js";import{t as tr}from"./ChevronDown-CGwhMiqT.js";import{i as nr}from"./ChevronRight-Cux_llMB.js";import{i as rr}from"./Share07-C1_p27Hs.js";import"./spinner-Cq2vfE1B.js";import"./delay-CnY5UFtP.js";import"./AlertCircle-BMPkNMGJ.js";import"./Tool01-DMQJZ6a0.js";import"./ArrowUp-Cmxc5KIG.js";import"./ArrowLeft-Bo0FpGQs.js";import"./Tool02-CZZOjaKh.js";import"./XCircle-DOtlBDfF.js";import"./ArrowUpRight-OVKS4c5s.js";import"./TrendUp01-CYPiI6vW.js";import"./ZapSquare-GHgi4Hl7.js";import"./Users03-C0P658nm.js";import"./CheckCircle-C9SAYY-W.js";import"./Check-CeB_ZeLq.js";import"./ChevronUp-3dsPU76D.js";import"./DotsVertical-9U5tOb04.js";import"./Stars02-2eb3r8Gu.js";import"./Copy01-CXcHnxi0.js";import"./CpuChip01-CGpR8wkh.js";import"./CreditCard01-DSA6UjMO.js";import"./Globe01-Cm-V-gHj.js";import"./Settings02-DBlt8Mfk.js";import"./Eye-DXWAJYKq.js";import"./FilterLines-DZrlB4Kh.js";import"./Star01-ClwU4gOx.js";import"./Globe04-m1tzMty0.js";import"./SwitchHorizontal01-D0Mi7oaK.js";import"./HardDrive-Dvps78YO.js";import"./Key01-DY7yaq7L.js";import"./LayoutLeft-C0u89h3U.js";import"./LinkExternal01-CLr9HZg0.js";import"./LogOut01-BeE1lxGA.js";import"./Monitor01-RiuZmvGS.js";import"./Sun-m3RjKnDt.js";import"./Palette-C8S3zMtK.js";import"./Play-B8V74CpU.js";import"./Plus-CGrXNe_q.js";import"./SearchLg-DrUBeTI6.js";import"./SearchMd-DFwCvkV1.js";import"./Shield01-CZr-J1Qk.js";import"./Stars01-jLom0LSv.js";import"./Trash01-BCoCDH0H.js";import"./Upload01-mvF19nky.js";import"./User01-UnLfhP79.js";import"./Users01-BGTUZMIA.js";import"./X-CId2-nhW.js";import"./Zap-C6ApHWIY.js";import"./select-wwJ8EUoY.js";import"./useInfiniteQuery-DuCyL_is.js";import"./use-infinite-scroll-BMPCHIFs.js";import"./use-connection-niAftPf5.js";import"./use-mcp-client-CMZDCFwV.js";import"./auth-BcPAS4K5.js";import"./use-virtual-mcp-CvLFbjo1.js";import"./card-GrGBYBXG.js";import"./sidebar-CusUIOZL.js";import"./use-mobile-RWxooM53.js";import"./table-DwuSaCi4.js";import"./empty-state-tOcrn7Ci.js";import"./use-members-CNN6Y-Zt.js";import"./use-org-auth-client-hxCPh-jf.js";import"./use-clock-tick-CFTIWs0c.js";import"./use-automations-DoX-Tmqm.js";import"./studio-tools-BBDHxwPb.js";import"./useSuspenseInfiniteQuery-ByQ627dx.js";import"./avatar-CKAwkvrw.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-C8wJsCEn.js";import"./tab-id-BtKEoC5y.js";import"./hooks-BTTh4oan.js";import"./decopilot-sse-pool-CYVKd86r.js";import"./backoff-CrEUbyZT.js";import"./index-GMtytQiz.js";import"./integration-icon-BbWY9vfD.js";import"./use-navigate-to-agent-ChzmcYSy.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-488R_nQ_.js";import"./form-FE1JRkSu.js";import"./label-Dplc1_oE.js";import"./file-type-icon-CpiTVpKx.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-ai-providers-NYX7QSgc.js";import"./use-decopilot-events-UAWY9DUq.js";import"./use-organization-settings-CmS9ohCu.js";import"./required-auth-layout-BFPFAQoy.js";import"./use-org-sso-FYR_uf1o.js";import"./drawer-WhUz4erM.js";import"./collection-search-Cwveue76.js";import"./deco-site-production-url-BjY4ZYd-.js";import"./tabs-CIxl9qVO.js";import"./toggle-group-znNdMK--.js";import"./use-deco-credits-De3PrmGo.js";import"./popover-DigaZ5Sb.js";import"./self-tool-result-Cch-sPi1.js";import"./extract-connection-data-BKY0ec6n.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-C2HwF4Ce.js";import"./use-debounced-value-BolYSN9R.js";import"./authenticate-and-persist-oauth-COCTTCRF.js";import"./mcp-oauth-Bi0vxp4Q.js";import"./track-CQoHeM9p.js";import"./toolbar-CdII6jdL.js";import"./skeleton-Dd2jseki.js";import"./github-repo-picker-BId4yHDh.js";import"./use-mcp-tools-DcIN6xvI.js";import"./agent-capabilities-cXfbMfjV.js";import"./connection-card-BoEQ2uqc.js";import"./use-registry-connections-CvNGLAr0.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-BkOjJMTl.js";import"./connection-form-helpers-DB6bc0s9.js";import"./collection-tabs-DMyjVQaZ.js";import"./badge-CxlSzoE1.js";import"./use-open-billing-url-XDJk2wdH.js";import"./select-model-BpUI37HY.js";import"./checkbox-DjytOswq.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-CfhHwu3l.js";import"./cards-DY2u3Spm.js";import"./dropdown-menu-D3TVm231.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-UrQRxkaM.js";import"./use-capability-DssZIcHp.js";import"./pt-BR-CLy76QW2.js";import"./switch-CAjDqeuV.js";import"./use-debounced-autosave-CGiNF_NH.js";import"./index-D5KNWpFX.js";import"./search-input--fbtpx3Q.js";import"./index-BEPKcH_a.js";import"./use-secrets-B-jc_6m7.js";import"./use-tags-opYrp-Zi.js";import"./get-initials-D-f_fDFw.js";import"./command-DktWLnIE.js";import"./index-Bqv-pFdx.js";import"./use-file-configs-Cq0JL4Et.js";import"./automation-list-row-BYFAi_YA.js";const or={"new-file":{titleKey:"sandbox.fileExplorerNameDialog.newFileTitle",descriptionKey:"sandbox.fileExplorerNameDialog.newFileDescription",submitKey:"sandbox.fileExplorerNameDialog.newFileSubmit",placeholderKey:"sandbox.fileExplorerNameDialog.newFilePlaceholder"},"new-folder":{titleKey:"sandbox.fileExplorerNameDialog.newFolderTitle",descriptionKey:"sandbox.fileExplorerNameDialog.newFolderDescription",submitKey:"sandbox.fileExplorerNameDialog.newFolderSubmit",placeholderKey:"sandbox.fileExplorerNameDialog.newFolderPlaceholder"},rename:{titleKey:"sandbox.fileExplorerNameDialog.renameTitle",descriptionKey:"sandbox.fileExplorerNameDialog.renameDescription",submitKey:"sandbox.fileExplorerNameDialog.renameSubmit",placeholderKey:"sandbox.fileExplorerNameDialog.renamePlaceholder"}};function sr(i){const e=se.c(71),{open:s,mode:a,initialName:l,parentLabel:m,isPending:h,onSubmit:f,onOpenChange:v}=i,j=l===void 0?"":l,d=h===void 0?!1:h,x=Me(),[g,k]=u.useState(j),[Z,q]=u.useState(s),y=or[a];s!==Z&&(q(s),s&&k(j));let b;e[0]!==d||e[1]!==v?(b=_=>{!_&&!d&&v(!1)},e[0]=d,e[1]=v,e[2]=b):b=e[2];const F=b;let A;e[3]!==d||e[4]!==g||e[5]!==f?(A=async _=>{_.preventDefault();const te=g.trim();!te||d||await f(te)},e[3]=d,e[4]=g,e[5]=f,e[6]=A):A=e[6];const I=A;let S;e[7]!==y.titleKey||e[8]!==x?(S=x(y.titleKey),e[7]=y.titleKey,e[8]=x,e[9]=S):S=e[9];let P;e[10]!==S?(P=r.jsx(_n,{children:S}),e[10]=S,e[11]=P):P=e[11];let D;e[12]!==y.descriptionKey||e[13]!==x?(D=x(y.descriptionKey),e[12]=y.descriptionKey,e[13]=x,e[14]=D):D=e[14];let M;e[15]!==D?(M=r.jsx(Gn,{children:D}),e[15]=D,e[16]=M):M=e[16];let N;e[17]!==P||e[18]!==M?(N=r.jsxs(Bn,{children:[P,M]}),e[17]=P,e[18]=M,e[19]=N):N=e[19];let R;e[20]!==m||e[21]!==x?(R=m&&r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:x("sandbox.fileExplorerNameDialog.location")}),r.jsx(ot,{value:m,readOnly:!0,disabled:!0,className:"font-mono text-xs"})]}),e[20]=m,e[21]=x,e[22]=R):R=e[22];let E;e[23]!==x?(E=x("sandbox.fileExplorerNameDialog.name"),e[23]=x,e[24]=E):E=e[24];let T;e[25]!==E?(T=r.jsx("label",{htmlFor:"file-explorer-name",className:"text-xs font-medium text-muted-foreground",children:E}),e[25]=E,e[26]=T):T=e[26];let Q;e[27]===Symbol.for("react.memo_cache_sentinel")?(Q=_=>k(_.target.value),e[27]=Q):Q=e[27];let X;e[28]!==y.placeholderKey||e[29]!==x?(X=x(y.placeholderKey),e[28]=y.placeholderKey,e[29]=x,e[30]=X):X=e[30];let Y;e[31]!==d||e[32]!==g||e[33]!==X?(Y=r.jsx(ot,{id:"file-explorer-name",value:g,onChange:Q,placeholder:X,autoFocus:!0,disabled:d}),e[31]=d,e[32]=g,e[33]=X,e[34]=Y):Y=e[34];let G;e[35]!==T||e[36]!==Y?(G=r.jsxs("div",{className:"space-y-1.5",children:[T,Y]}),e[35]=T,e[36]=Y,e[37]=G):G=e[37];let $;e[38]!==R||e[39]!==G?($=r.jsxs("div",{className:"space-y-4 py-4",children:[R,G]}),e[38]=R,e[39]=G,e[40]=$):$=e[40];let W;e[41]!==v?(W=()=>v(!1),e[41]=v,e[42]=W):W=e[42];let K;e[43]!==x?(K=x("sandbox.fileExplorerNameDialog.cancel"),e[43]=x,e[44]=K):K=e[44];let z;e[45]!==d||e[46]!==W||e[47]!==K?(z=r.jsx(De,{type:"button",variant:"outline",onClick:W,disabled:d,children:K}),e[45]=d,e[46]=W,e[47]=K,e[48]=z):z=e[48];let B;e[49]!==d||e[50]!==g?(B=!g.trim()||d,e[49]=d,e[50]=g,e[51]=B):B=e[51];let L;e[52]!==y.submitKey||e[53]!==d||e[54]!==x?(L=d?r.jsxs(r.Fragment,{children:[r.jsx(fe,{size:14,className:"animate-spin"}),x("sandbox.fileExplorerNameDialog.saving")]}):x(y.submitKey),e[52]=y.submitKey,e[53]=d,e[54]=x,e[55]=L):L=e[55];let V;e[56]!==B||e[57]!==L?(V=r.jsx(De,{type:"submit",disabled:B,children:L}),e[56]=B,e[57]=L,e[58]=V):V=e[58];let O;e[59]!==z||e[60]!==V?(O=r.jsxs(Vn,{children:[z,V]}),e[59]=z,e[60]=V,e[61]=O):O=e[61];let U;e[62]!==I||e[63]!==$||e[64]!==O||e[65]!==N?(U=r.jsx(Un,{className:"sm:max-w-md",children:r.jsxs("form",{onSubmit:I,children:[N,$,O]})}),e[62]=I,e[63]=$,e[64]=O,e[65]=N,e[66]=U):U=e[66];let ee;return e[67]!==F||e[68]!==s||e[69]!==U?(ee=r.jsx(Hn,{open:s,onOpenChange:F,children:U}),e[67]=F,e[68]=s,e[69]=U,e[70]=ee):ee=e[70],ee}function ar(i){const e=se.c(47),{deleteTarget:s,deleteDirtyPaths:a,fsActionPending:l,onOpenChange:m,onConfirm:h}=i,f=Me(),v=s?.kind==="directory",j=s!==null,d=v?"sandbox.fileExplorerDeleteDialog.titleFolder":"sandbox.fileExplorerDeleteDialog.titleFile";let x;e[0]!==f||e[1]!==d?(x=f(d),e[0]=f,e[1]=d,e[2]=x):x=e[2];let g;e[3]!==x?(g=r.jsx(qn,{children:x}),e[3]=x,e[4]=g):g=e[4];let k;e[5]!==f?(k=f("sandbox.fileExplorerDeleteDialog.description"),e[5]=f,e[6]=k):k=e[6];const Z=s?.name;let q;e[7]!==Z?(q=r.jsx("span",{className:"font-mono",children:Z}),e[7]=Z,e[8]=q):q=e[8];let y;e[9]!==v||e[10]!==f?(y=v?f("sandbox.fileExplorerDeleteDialog.folderSuffix"):".",e[9]=v,e[10]=f,e[11]=y):y=e[11];let b;e[12]!==a.length||e[13]!==f?(b=a.length>0&&r.jsxs(r.Fragment,{children:[" ",a.length===1?f("sandbox.fileExplorerDeleteDialog.unsavedChangesOne"):f("sandbox.fileExplorerDeleteDialog.unsavedChangesMany",{count:a.length})]}),e[12]=a.length,e[13]=f,e[14]=b):b=e[14];let F;e[15]!==k||e[16]!==q||e[17]!==y||e[18]!==b?(F=r.jsxs(Wn,{children:[k," ",q,y,b]}),e[15]=k,e[16]=q,e[17]=y,e[18]=b,e[19]=F):F=e[19];let A;e[20]!==F||e[21]!==g?(A=r.jsxs(Qn,{children:[g,F]}),e[20]=F,e[21]=g,e[22]=A):A=e[22];let I;e[23]!==f?(I=f("sandbox.fileExplorerDeleteDialog.cancel"),e[23]=f,e[24]=I):I=e[24];let S;e[25]!==l||e[26]!==I?(S=r.jsx(Xn,{disabled:l,children:I}),e[25]=l,e[26]=I,e[27]=S):S=e[27];const P=l||!s;let D;e[28]!==s||e[29]!==h?(D=Q=>{Q.preventDefault(),s&&h(s)},e[28]=s,e[29]=h,e[30]=D):D=e[30];let M;e[31]!==f?(M=f("sandbox.fileExplorerDeleteDialog.delete"),e[31]=f,e[32]=M):M=e[32];let N;e[33]!==P||e[34]!==D||e[35]!==M?(N=r.jsx(Yn,{disabled:P,onClick:D,children:M}),e[33]=P,e[34]=D,e[35]=M,e[36]=N):N=e[36];let R;e[37]!==S||e[38]!==N?(R=r.jsxs(Jn,{children:[S,N]}),e[37]=S,e[38]=N,e[39]=R):R=e[39];let E;e[40]!==A||e[41]!==R?(E=r.jsxs(Zn,{children:[A,R]}),e[40]=A,e[41]=R,e[42]=E):E=e[42];let T;return e[43]!==m||e[44]!==j||e[45]!==E?(T=r.jsx(er,{open:j,onOpenChange:m,children:E}),e[43]=m,e[44]=j,e[45]=E,e[46]=T):T=e[46],T}var ze="ContextMenu",[ir]=an(ze,[lt]),J=lt(),[lr,ct]=ir(ze),dt=i=>{const{__scopeContextMenu:e,children:s,onOpenChange:a,dir:l,modal:m=!0}=i,[h,f]=u.useState(!1),v=J(e),j=on(a),d=u.useCallback(x=>{f(x),j(x)},[j]);return r.jsx(lr,{scope:e,open:h,onOpenChange:d,modal:m,children:r.jsx(sn,{...v,dir:l,open:h,onOpenChange:d,modal:m,children:s})})};dt.displayName=ze;var ut="ContextMenuTrigger",ft=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,disabled:a=!1,...l}=i,m=ct(ut,s),h=J(s),f=u.useRef({x:0,y:0}),v=u.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...f.current})}),j=u.useRef(0),d=u.useCallback(()=>window.clearTimeout(j.current),[]),x=g=>{f.current={x:g.clientX,y:g.clientY},m.onOpenChange(!0)};return u.useEffect(()=>d,[d]),u.useEffect(()=>{a&&d()},[a,d]),r.jsxs(r.Fragment,{children:[r.jsx(Jt,{...h,virtualRef:v}),r.jsx(Zt.span,{"data-state":m.open?"open":"closed","data-disabled":a?"":void 0,...l,ref:e,style:{WebkitTouchCallout:"none",...i.style},onContextMenu:a?i.onContextMenu:xe(i.onContextMenu,g=>{d(),x(g),g.preventDefault()}),onPointerDown:a?i.onPointerDown:xe(i.onPointerDown,Se(g=>{d(),j.current=window.setTimeout(()=>x(g),700)})),onPointerMove:a?i.onPointerMove:xe(i.onPointerMove,Se(d)),onPointerCancel:a?i.onPointerCancel:xe(i.onPointerCancel,Se(d)),onPointerUp:a?i.onPointerUp:xe(i.onPointerUp,Se(d))})]})});ft.displayName=ut;var cr="ContextMenuPortal",pt=i=>{const{__scopeContextMenu:e,...s}=i,a=J(e);return r.jsx(nn,{...a,...s})};pt.displayName=cr;var mt="ContextMenuContent",xt=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=ct(mt,s),m=J(s),h=u.useRef(!1);return r.jsx(rn,{...m,...a,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:f=>{i.onCloseAutoFocus?.(f),!f.defaultPrevented&&h.current&&f.preventDefault(),h.current=!1},onInteractOutside:f=>{i.onInteractOutside?.(f),!f.defaultPrevented&&!l.modal&&(h.current=!0)},style:{...i.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});xt.displayName=mt;var dr="ContextMenuGroup",ur=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(ln,{...l,...a,ref:e})});ur.displayName=dr;var fr="ContextMenuLabel",pr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(cn,{...l,...a,ref:e})});pr.displayName=fr;var mr="ContextMenuItem",ht=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(en,{...l,...a,ref:e})});ht.displayName=mr;var xr="ContextMenuCheckboxItem",hr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(dn,{...l,...a,ref:e})});hr.displayName=xr;var gr="ContextMenuRadioGroup",br=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(un,{...l,...a,ref:e})});br.displayName=gr;var yr="ContextMenuRadioItem",vr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(fn,{...l,...a,ref:e})});vr.displayName=yr;var Cr="ContextMenuItemIndicator",wr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(pn,{...l,...a,ref:e})});wr.displayName=Cr;var Nr="ContextMenuSeparator",gt=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(tn,{...l,...a,ref:e})});gt.displayName=Nr;var jr="ContextMenuArrow",Er=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(mn,{...l,...a,ref:e})});Er.displayName=jr;var Sr="ContextMenuSubTrigger",Dr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(xn,{...l,...a,ref:e})});Dr.displayName=Sr;var Mr="ContextMenuSubContent",Rr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(hn,{...l,...a,ref:e,style:{...i.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Rr.displayName=Mr;function Se(i){return e=>e.pointerType!=="mouse"?i(e):void 0}var Tr=dt,Pr=ft,kr=pt,Fr=xt,Ar=ht,Lr=gt;function Or(i){const e=se.c(4);let s;e[0]!==i?({...s}=i,e[0]=i,e[1]=s):s=e[1];let a;return e[2]!==s?(a=r.jsx(Tr,{"data-slot":"context-menu",...s}),e[2]=s,e[3]=a):a=e[3],a}function Ir(i){const e=se.c(4);let s;e[0]!==i?({...s}=i,e[0]=i,e[1]=s):s=e[1];let a;return e[2]!==s?(a=r.jsx(Pr,{"data-slot":"context-menu-trigger",...s}),e[2]=s,e[3]=a):a=e[3],a}function $r(i){const e=se.c(8);let s,a;e[0]!==i?({className:s,...a}=i,e[0]=i,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let l;e[3]!==s?(l=le("notranslate bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",s),e[3]=s,e[4]=l):l=e[4];let m;return e[5]!==a||e[6]!==l?(m=r.jsx(kr,{children:r.jsx(Fr,{"data-slot":"context-menu-content",translate:"no",className:l,...a})}),e[5]=a,e[6]=l,e[7]=m):m=e[7],m}function ue(i){const e=se.c(12);let s,a,l,m;e[0]!==i?({className:s,inset:a,variant:m,...l}=i,e[0]=i,e[1]=s,e[2]=a,e[3]=l,e[4]=m):(s=e[1],a=e[2],l=e[3],m=e[4]);const h=m===void 0?"default":m;let f;e[5]!==s?(f=le("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",s),e[5]=s,e[6]=f):f=e[6];let v;return e[7]!==a||e[8]!==l||e[9]!==f||e[10]!==h?(v=r.jsx(Ar,{"data-slot":"context-menu-item","data-inset":a,"data-variant":h,className:f,...l}),e[7]=a,e[8]=l,e[9]=f,e[10]=h,e[11]=v):v=e[11],v}function st(i){const e=se.c(8);let s,a;e[0]!==i?({className:s,...a}=i,e[0]=i,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let l;e[3]!==s?(l=le("bg-border -mx-1 my-1 h-px",s),e[3]=s,e[4]=l):l=e[4];let m;return e[5]!==a||e[6]!==l?(m=r.jsx(Lr,{"data-slot":"context-menu-separator",className:l,...a}),e[5]=a,e[6]=l,e[7]=m):m=e[7],m}const Kr="#d9a441";function zr(i){const e=se.c(63),{node:s,depth:a,isExpanded:l,isSelected:m,isLoading:h,fileVisual:f,onOpen:v,onSelect:j,onNewFile:d,onNewFolder:x,onCopyPath:g,onCopyRelativePath:k,onRename:Z,onDelete:q}=i,y=h===void 0?!1:h,b=Me(),F=s.kind==="directory",{Icon:A,color:I}=f,S=m&&"bg-accent";let P;e[0]!==S?(P=le("flex w-full items-center gap-1.5 px-2 py-1.5 text-left text-[13px] hover:bg-accent transition-colors",S),e[0]=S,e[1]=P):P=e[1];const D=`${a*14+8}px`;let M;e[2]!==D?(M={paddingLeft:D},e[2]=D,e[3]=M):M=e[3];let N;e[4]!==v||e[5]!==j?(N=()=>{j(),v()},e[4]=v,e[5]=j,e[6]=N):N=e[6];let R;e[7]!==A||e[8]!==I||e[9]!==F||e[10]!==l||e[11]!==y?(R=F?r.jsxs(r.Fragment,{children:[y?r.jsx(fe,{size:14,className:"shrink-0 animate-spin text-muted-foreground"}):l?r.jsx(tr,{size:14,className:"shrink-0 text-muted-foreground"}):r.jsx(nr,{size:14,className:"shrink-0 text-muted-foreground"}),r.jsx(rr,{size:16,className:"shrink-0",style:{color:Kr}})]}):r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"w-3.5 shrink-0"}),r.jsx(A,{size:16,className:"shrink-0",style:{color:I}})]}),e[7]=A,e[8]=I,e[9]=F,e[10]=l,e[11]=y,e[12]=R):R=e[12];let E;e[13]!==s.name?(E=r.jsx("span",{className:"truncate",children:s.name}),e[13]=s.name,e[14]=E):E=e[14];let T;e[15]!==P||e[16]!==M||e[17]!==N||e[18]!==R||e[19]!==E?(T=r.jsx(Ir,{asChild:!0,children:r.jsxs("button",{type:"button",className:P,style:M,onClick:N,children:[R,E]})}),e[15]=P,e[16]=M,e[17]=N,e[18]=R,e[19]=E,e[20]=T):T=e[20];let Q;e[21]!==b?(Q=b("sandbox.fileTreeRow.newFile"),e[21]=b,e[22]=Q):Q=e[22];let X;e[23]!==d||e[24]!==Q?(X=r.jsx(ue,{onSelect:d,children:Q}),e[23]=d,e[24]=Q,e[25]=X):X=e[25];let Y;e[26]!==b?(Y=b("sandbox.fileTreeRow.newFolder"),e[26]=b,e[27]=Y):Y=e[27];let G;e[28]!==x||e[29]!==Y?(G=r.jsx(ue,{onSelect:x,children:Y}),e[28]=x,e[29]=Y,e[30]=G):G=e[30];let $;e[31]===Symbol.for("react.memo_cache_sentinel")?($=r.jsx(st,{}),e[31]=$):$=e[31];let W;e[32]!==b?(W=b("sandbox.fileTreeRow.copyPath"),e[32]=b,e[33]=W):W=e[33];let K;e[34]!==g||e[35]!==W?(K=r.jsx(ue,{onSelect:g,children:W}),e[34]=g,e[35]=W,e[36]=K):K=e[36];let z;e[37]!==b?(z=b("sandbox.fileTreeRow.copyRelativePath"),e[37]=b,e[38]=z):z=e[38];let B;e[39]!==k||e[40]!==z?(B=r.jsx(ue,{onSelect:k,children:z}),e[39]=k,e[40]=z,e[41]=B):B=e[41];let L;e[42]===Symbol.for("react.memo_cache_sentinel")?(L=r.jsx(st,{}),e[42]=L):L=e[42];let V;e[43]!==b?(V=b("sandbox.fileTreeRow.rename"),e[43]=b,e[44]=V):V=e[44];let O;e[45]!==Z||e[46]!==V?(O=r.jsx(ue,{onSelect:Z,children:V}),e[45]=Z,e[46]=V,e[47]=O):O=e[47];let U;e[48]!==b?(U=b("sandbox.fileTreeRow.delete"),e[48]=b,e[49]=U):U=e[49];let ee;e[50]!==q||e[51]!==U?(ee=r.jsx(ue,{variant:"destructive",onSelect:q,children:U}),e[50]=q,e[51]=U,e[52]=ee):ee=e[52];let _;e[53]!==X||e[54]!==G||e[55]!==K||e[56]!==B||e[57]!==O||e[58]!==ee?(_=r.jsxs($r,{className:"w-52",children:[X,G,$,K,B,L,O,ee]}),e[53]=X,e[54]=G,e[55]=K,e[56]=B,e[57]=O,e[58]=ee,e[59]=_):_=e[59];let te;return e[60]!==_||e[61]!==T?(te=r.jsxs(Or,{children:[T,_]}),e[60]=_,e[61]=T,e[62]=te):te=e[62],te}yn.config({paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.0/min/vs"}});const at=200,_r=2,Gr=250,it=200;function Br(i,e,s,a){return`/api/${i}/sandbox/${encodeURIComponent(e)}/${encodeURIComponent(s)}/${a}`}function Vr(i){const e=se.c(9),{text:s,query:a}=i;let l,m,h;if(e[0]!==a||e[1]!==s){const{leadingEllipsis:v,segments:j}=Fn(s,a);l="truncate font-mono text-muted-foreground",m=v&&r.jsx("span",{className:"text-muted-foreground/50",children:"…"}),h=j.map(Ur),e[0]=a,e[1]=s,e[2]=l,e[3]=m,e[4]=h}else l=e[2],m=e[3],h=e[4];let f;return e[5]!==l||e[6]!==m||e[7]!==h?(f=r.jsxs("span",{className:l,children:[m,h]}),e[5]=l,e[6]=m,e[7]=h,e[8]=f):f=e[8],f}function Ur(i,e){return i.match?r.jsx("span",{className:"rounded-[2px] bg-primary/20 text-foreground",children:i.text},e):r.jsx("span",{children:i.text},e)}function $a({orgSlug:i,virtualMcpId:e,branch:s,openPath:a}){const[l,m]=u.useState({files:[],directories:[],truncated:!1}),{files:h,directories:f}=l,[v,j]=u.useState(new Set),[d,x]=u.useState(null),[g,k]=u.useState(null),[Z,q]=u.useState([]),[y,b]=u.useState(""),[F,A]=u.useState(null),[I,S]=u.useState(null),[P,D]=u.useState(!1),[M,N]=u.useState(!1),[R,E]=u.useState(!1),[T,Q]=u.useState(!1),[,X]=u.useState(new Set),[Y,G]=u.useState(new Set),$=u.useRef(0),W=u.useRef(null),K=u.useRef(new Set),z=u.useRef(new Map),B=u.useRef(null),L=u.useRef(0),V=u.useRef(null),O=u.useRef(null),U=u.useRef(null);function ee(t){X(n=>{const o=typeof t=="function"?t(n):t;return K.current=o,o})}const[_,te]=u.useState(new Map),Re=u.useRef(null),[ae,he]=u.useState(null),{sendMessage:bt}=En(),{openSidePanel:yt}=Sn(),ge=gn(),[H,oe]=u.useState(null),[Te,Pe]=u.useState(null),[be,ye]=u.useState(!1);async function ie(t,n){const o=await fetch(Br(i,e,s,t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(n)});if(!o.ok){const c=await o.json().catch(()=>({}));throw new Error(c.error??`Request failed (${o.status})`)}return o.json()}async function ve(){ge.invalidateQueries({queryKey:rt(i,e,s)})}function _e(t,n,o){navigator.clipboard.writeText(o).then(()=>ne.success(t("sandbox.fileExplorer.textCopied",{label:n})),()=>ne.error(t("sandbox.fileExplorer.failedToCopyText",{label:n.toLowerCase()})))}function vt(t){const n=Kn(t);if(!n)return;const o=`${i}/${e}/${s}`;ge.setQueryData(Ze.decofile(o),c=>{if(!c)return c;const{[n]:p,...C}=c;return C}),ge.invalidateQueries({queryKey:Ze.liveMeta(i,e,s)})}function Ct(t){const n=t.kind==="file"?[t.path]:h.filter(o=>o.startsWith(".deco/blocks/")).map(o=>we(o)).filter(o=>o===t.path||o.startsWith(`${t.path}/`));for(const o of n)vt(o)}function wt(t){const n=we(t);return Z.filter(o=>{if(o!==n&&!o.startsWith(`${n}/`))return!1;const c=_.get(o);return!!(c?.loaded&&c.editorValue!==c.savedContent)})}function Ge(t){q(n=>n.map(o=>t(o)).filter(o=>o!==null)),x(n=>n&&t(n)),te(n=>{const o=new Map;for(const[c,p]of n){const C=t(c);C&&o.set(C,p)}return o}),k(n=>{if(!n)return n;const o=t(n.path);return o?o===n.path?n:{...n,path:o,name:o.split("/").pop()??o}:null})}function Nt(t){const n=we(t);k(o=>o&&(o.path===n||o.path.startsWith(`${n}/`)?null:o)),Ge(o=>o===n||o.startsWith(`${n}/`)?null:o)}async function jt(t,n){if(!H)return;const o=Ee(H.parentDir,n);if(Ke(o,h,f))throw new Error(t("sandbox.fileExplorer.fileAlreadyExists",{name:n}));await ie("write",{path:re(o),content:""}),await pe(),await ve(),oe(null),me(o)}async function Et(t,n){if(!H)return;const o=Ee(H.parentDir,n);if(Ke(o,h,f))throw new Error(t("sandbox.fileExplorer.fileAlreadyExists",{name:n}));const c=re(o);await ie("mkdir",{path:c}),m(p=>({...p,directories:p.directories.includes(c)?p.directories:[...p.directories,c]})),await pe(),await ve(),oe(null),j(p=>{const C=new Set(p);for(const ce of Ie(o))C.add(ce);return C.add(o),C}),k({name:n,path:o,kind:"directory",children:[]})}async function St(t,n){if(!H)return;const o=H.node.path,c=Ne(o),p=Ee(c,n);if(p===o){oe(null);return}if(Ke(p,h,f))throw new Error(t("sandbox.fileExplorer.fileAlreadyExists",{name:n}));await ie("rename",{from:re(o),to:re(p)}),Ge(C=>C===o?p:C.startsWith(`${o}/`)?Ee(p,C.slice(o.length+1)):C),await pe(),await ve(),oe(null)}async function Dt(t,n){ye(!0);try{await ie("unlink",{path:re(n.path),recursive:n.kind==="directory"}),Ct(n),Nt(n.path),await pe(),await ve(),Pe(null),ne.success(t("sandbox.fileExplorer.fileDeleted",{name:n.name}))}catch(o){ne.error(o instanceof Error?o.message:t("sandbox.fileExplorer.deleteFailed"))}finally{ye(!1)}}async function Mt(t,n){const o=Ln(n);if(o){ne.error(o);return}ye(!0);try{H?.mode==="new-file"?(await jt(t,n),ne.success(t("sandbox.fileExplorer.fileCreated",{name:n}))):H?.mode==="new-folder"?(await Et(t,n),ne.success(t("sandbox.fileExplorer.folderCreated",{name:n}))):H?.mode==="rename"&&(await St(t,n),ne.success(t("sandbox.fileExplorer.renamedTo",{name:n})))}catch(c){ne.error(c instanceof Error?c.message:t("sandbox.fileExplorer.operationFailed"))}finally{ye(!1)}}const Be=u.useRef(!1);Be.current||(Be.current=!0,W.current=pe());const[Rt,Tt]=u.useState(null),w=Me();if(a&&a!==Rt){Tt(a);const t=a;queueMicrotask(()=>{Dn(t)&&me(t)})}async function ke(t){const n=await ie("glob",t);return{files:n.files??[],directories:n.directories??[],truncated:n.truncated}}function Ve(t,n,o){if(o!==$.current)return!1;let c=!1;return m(p=>{const C=n?zn(p.files,p.directories,t,p.truncated):{files:t.files,directories:t.directories??[],truncated:!!t.truncated};return c=!!C.truncated,{files:C.files,directories:C.directories,truncated:c}}),c&&ne.warning(w("sandbox.fileExplorer.fileListTruncated")),c}async function Pt(t){const n=z.current.get(t);if(n)return n;const o=$.current,c=(async()=>{const p=await ke({pattern:"**/*",path:re(t),limit:Ae}),C=Ve(p,!0,o);return!C&&o===$.current&&ee(ce=>{const Ce=new Set(ce);return Ce.add(t),Ce}),C})();z.current.set(t,c);try{return await c}finally{z.current.delete(t)}}async function Ue(t){if(!$e(t,K.current))return!1;G(n=>new Set(n).add(t));try{return await Pt(t)}finally{G(n=>{const o=new Set(n);return o.delete(t),o})}}async function kt(t,n){const o=new Set(K.current);for(const c of Ie(n)){if(!$e(c,o))continue;if(await Ue(c))throw new Error(t("sandbox.fileExplorer.folderListingTruncated"));o.add(c)}}async function pe(){const t=++$.current;V.current=null,O.current=null,z.current.clear(),E(!0),ee(new Set),j(new Set),G(new Set);try{const n=await ke({pattern:"**/*",limit:Ae,maxDepth:Mn});Ve(n,!1,t),Q(!0)}catch{T&&ne.error(w("sandbox.fileExplorer.failedToRefreshFileTree"))}finally{E(!1)}}async function He(t){if(!_.get(t)?.loaded){te(o=>{const c=new Map(o);return c.set(t,{savedContent:"",editorValue:"",loaded:!1}),c});try{const o=await ie("read",{path:re(t),full:!0}),c=An(o.content??"");te(p=>{const C=new Map(p);return C.set(t,{savedContent:c,editorValue:c,loaded:!0}),C})}catch{}}}function Ft(){L.current++,A(null),S(null),D(!1),N(!1)}async function At(){const t=$.current,n=V.current;if(n&&n.generation===t)return n.files;const o=O.current;if(o&&o.generation===t)return o.promise;const c=(async()=>{const p=await ke({pattern:"**/*",limit:Ae});return $.current===t&&(V.current={generation:t,files:p.files}),p.files})();O.current={generation:t,promise:c};try{return await c}finally{O.current?.generation===t&&(O.current=null)}}async function Lt(t,n){try{const o=await At();if(n!==L.current)return;A(In(o,t,it))}catch{if(n!==L.current)return;A([])}}async function Ot(t,n){D(!0);try{const o=await ie("grep",{pattern:t,output_mode:"content",ignore_case:!0,fixed_strings:!0,limit:at});if(n!==L.current)return;S($n(o.results??"")),N((o.matchCount??0)>=at)}catch{if(n!==L.current)return;S([]),N(!1)}finally{n===L.current&&D(!1)}}function It(t){const n=t.trim(),o=++L.current;Lt(n,o),n.length<_r?(S(null),D(!1),N(!1)):Ot(n,o)}function $t(t){if(b(t),B.current&&clearTimeout(B.current),!t.trim()){Ft();return}B.current=setTimeout(()=>{It(t)},Gr)}function qe(t){const n=U.current;if(!n||n.path!==d)return;U.current=null;const o=Math.max(1,n.line);t.revealLineInCenter(o),t.setPosition({lineNumber:o,column:1}),t.focus()}function Kt(t){U.current={path:t.path,line:t.line};const n=d===t.path&&_.get(t.path)?.loaded;me(t.path),n&&Re.current&&qe(Re.current)}async function zt(t,n){try{await ie("write",{path:re(t),content:n}),je("file saved via sandbox /write",{path:t}),ge.invalidateQueries({queryKey:rt(i,e,s)});try{const o=await On(i,e,s);je("git status after save",o)}catch(o){je("git status after save failed",{path:t,error:o instanceof Error?o.message:String(o)})}te(o=>{const c=new Map(o),p=c.get(t);return p&&c.set(t,{...p,savedContent:n}),c})}catch(o){je("file save failed",{path:t,error:o instanceof Error?o.message:String(o)})}}function _t(t){x(t),k({name:t.split("/").pop()??t,path:t,kind:"file",children:[]}),he(null),Z.includes(t)||q(n=>[...n,t]),He(t)}function Gt(t){q(n=>{const o=n.filter(c=>c!==t);return d===t&&x(o[o.length-1]??null),o}),te(n=>{const o=new Map(n);return o.delete(t),o})}function We(t){j(n=>{const o=new Set(n);return o.has(t)?o.delete(t):o.add(t),o})}async function Bt(t){if($e(t,K.current))try{if(await Ue(t))return}catch(n){ne.error(n instanceof Error?n.message:w("sandbox.fileExplorer.failedToLoadFolder"));return}We(t)}async function Vt(t,n){if(n){We(t);return}await Bt(t)}async function Ut(t){await W.current,await kt(w,t);const n=Ie(t);j(o=>{const c=new Set(o);for(const p of n)c.add(p);return c}),_t(t)}function me(t){Ut(t).catch(n=>{ne.error(n instanceof Error?n.message:w("sandbox.fileExplorer.failedToOpenFile"))})}function Ht(){return g?.kind==="directory"?g.path:g?.kind==="file"?Ne(g.path):d?Ne(d):"/"}function Qe(t){const n=Ht();oe({mode:t,parentDir:n,node:{name:"",path:n,kind:"directory",children:[]}})}const qt=Rn(h,f),Xe=Tn(qt,v),Fe=F?.length??0,Ye=Pn(I??[]),Je=I?.length??0,de=d?_.get(d):null,Wt=de?.loaded&&de.editorValue!==de.savedContent,Qt=Te?wt(Te.path):[],Xt=(t,n)=>{Re.current=t,qe(t),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyS,async()=>{if(!d)return;const o=t.getValue();await zt(d,o)}),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyK,()=>{const o=t.getSelection(),c=t.getModel();if(!o||!c||!d)return;const p=c.getValueInRange(o);he({filePath:d,lineStart:o.startLineNumber,lineEnd:o.endLineNumber,selectedCode:p})})};function Yt(t){if(!ae)return;const n=[`The user selected code in the file explorer and asked: **"${t.trim()}"**`,"",`**File:** \`${ae.filePath}\``,`**Lines:** ${ae.lineStart}–${ae.lineEnd}`];if(ae.selectedCode){const o=Oe(ae.filePath),c=ae.selectedCode.replace(/```/g,"`` `");n.push("","**Selected code:**","```"+o,c,"```")}n.push("","Please read the source file, locate the code, and apply the requested change."),yt("chat"),bt({parts:[{type:"text",text:n.join(`
|
|
2
2
|
`)}]}),he(null)}return R&&!T?r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(fe,{size:20,className:"animate-spin text-muted-foreground"})}):r.jsxs("div",{className:"flex h-full w-full overflow-hidden",children:[r.jsxs("div",{className:"w-64 shrink-0 border-r flex flex-col overflow-hidden",children:[r.jsxs("div",{className:"flex items-center gap-1 p-2 border-b",children:[r.jsxs("div",{className:"relative min-w-0 flex-1",children:[r.jsx(vn,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground"}),r.jsx("input",{type:"text",value:y,onChange:t=>$t(t.target.value),placeholder:w("sandbox.fileExplorer.searchFilesPlaceholder"),"aria-label":w("sandbox.fileExplorer.searchFilesLabel"),className:"w-full rounded-md border border-input bg-transparent pl-7 pr-2 py-1.5 text-xs outline-none placeholder:text-muted-foreground focus:ring-1 focus:ring-ring"})]}),r.jsxs(et,{children:[r.jsx(tt,{asChild:!0,children:r.jsx(De,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":w("sandbox.fileExplorer.newFileLabel"),onClick:()=>Qe("new-file"),children:r.jsx(Cn,{size:14})})}),r.jsx(nt,{side:"bottom",children:w("sandbox.fileExplorer.newFile")})]}),r.jsxs(et,{children:[r.jsx(tt,{asChild:!0,children:r.jsx(De,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":w("sandbox.fileExplorer.newFolderLabel"),onClick:()=>Qe("new-folder"),children:r.jsx(wn,{size:14})})}),r.jsx(nt,{side:"bottom",children:w("sandbox.fileExplorer.newFolder")})]})]}),r.jsx(jn,{className:"flex-1",children:r.jsxs("div",{className:"py-1",children:[!y&&Xe.map(t=>{const{node:n,depth:o}=t,c=n.kind==="directory",p=v.has(n.path),C=g?.path===n.path,ce=kn(n.path,n.kind),Ce=c&&Y.has(n.path);return r.jsx(zr,{node:n,depth:o,isExpanded:p,isSelected:C,isLoading:Ce,fileVisual:Le(n.name),onSelect:()=>k(n),onOpen:()=>{c?Vt(n.path,p):me(n.path)},onNewFile:()=>oe({mode:"new-file",node:n,parentDir:ce}),onNewFolder:()=>oe({mode:"new-folder",node:n,parentDir:ce}),onCopyPath:()=>_e(w,"Path",we(n.path)),onCopyRelativePath:()=>_e(w,"Relative path",re(n.path)),onRename:()=>oe({mode:"rename",node:n,parentDir:ce}),onDelete:()=>Pe(n)},n.path)}),!y&&T&&Xe.length===0&&r.jsx("div",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:w("sandbox.fileExplorer.noFilesFound")}),y&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"flex items-center gap-1.5 px-3 pb-0.5 pt-1 text-[10px] font-medium uppercase tracking-wide text-muted-foreground",children:[r.jsx("span",{children:w("sandbox.fileExplorer.files")}),Fe>0&&r.jsxs("span",{className:"normal-case tracking-normal text-muted-foreground/70",children:[Fe,Fe>=it?"+":""]})]}),F!==null&&F.length===0&&r.jsx("div",{className:"px-3 py-1 text-xs text-muted-foreground",children:w("sandbox.fileExplorer.noFileNamesMatch")}),F?.map(t=>{const n=t.split("/").pop()??t,o=Ne(t),{Icon:c,color:p}=Le(n),C=d===t;return r.jsxs("button",{type:"button",onClick:()=>me(t),title:t,className:le("flex w-full items-center gap-1.5 px-3 py-1 text-left text-xs hover:bg-accent",C&&"bg-accent"),children:[r.jsx(c,{size:14,className:le("shrink-0",p)}),r.jsx("span",{className:"max-w-40 shrink-0 truncate",children:n}),o!=="/"&&r.jsx("span",{className:"truncate text-muted-foreground/60",children:o})]},t)})]}),y&&r.jsxs("div",{className:"mt-1 border-t pt-1",children:[r.jsxs("div",{className:"flex items-center gap-1.5 px-3 pb-0.5 pt-1 text-[10px] font-medium uppercase tracking-wide text-muted-foreground",children:[r.jsx("span",{children:w("sandbox.fileExplorer.inFiles")}),Je>0&&r.jsxs("span",{className:"text-muted-foreground/70 normal-case tracking-normal",children:[Je,M?"+":""]}),P&&r.jsx(fe,{size:10,className:"animate-spin"})]}),!P&&I!==null&&Ye.length===0&&r.jsx("div",{className:"px-3 py-1 text-xs text-muted-foreground",children:w("sandbox.fileExplorer.noMatchesInFileContents")}),Ye.map(t=>{const n=t.path.split("/").pop()??t.path,{Icon:o,color:c}=Le(n);return r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1 text-xs text-muted-foreground",children:[r.jsx(o,{size:14,className:le("shrink-0",c)}),r.jsx("span",{className:"truncate",children:n}),r.jsx("span",{className:"text-muted-foreground/60",children:t.matches.length})]}),t.matches.map(p=>r.jsxs("button",{type:"button",onClick:()=>Kt(p),title:`${t.path}:${p.line}`,className:"flex w-full items-baseline gap-2 pl-8 pr-3 py-0.5 text-left text-xs hover:bg-accent",children:[r.jsx("span",{className:"shrink-0 tabular-nums text-muted-foreground",children:p.line}),r.jsx(Vr,{text:p.text,query:y})]},`${t.path}:${p.line}`))]},t.path)})]})]})})]}),r.jsxs("div",{className:"relative flex-1 flex flex-col overflow-hidden",children:[Z.length>0&&r.jsx("div",{className:"flex items-center border-b overflow-x-auto shrink-0",children:Z.map(t=>{const n=_.get(t),o=n?.loaded&&n.editorValue!==n.savedContent,c=d===t,p=t.split("/").pop()??t;return r.jsxs("div",{className:le("flex items-center gap-1 px-3 py-1.5 text-xs border-r cursor-pointer transition-colors",c?"bg-background text-foreground":"bg-muted/50 text-muted-foreground hover:bg-accent"),onClick:()=>{x(t),He(t)},onKeyDown:()=>{},role:"tab",tabIndex:0,"aria-selected":c,children:[r.jsx("span",{className:"truncate max-w-32",children:p}),o&&r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-foreground/60 shrink-0"}),r.jsx("button",{type:"button",className:"ml-1 rounded p-0.5 hover:bg-accent-foreground/10",onClick:C=>{C.stopPropagation(),Gt(t)},children:r.jsx(Nn,{size:12})})]},t)})}),ae&&r.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 z-20 mt-2",style:{width:"360px"},children:r.jsxs("form",{className:"flex w-full items-center gap-1.5 rounded-xl border border-border bg-background/95 px-3 py-1.5 shadow-lg backdrop-blur",onSubmit:t=>{t.preventDefault();const o=t.currentTarget.elements.namedItem("askAiInput");o.value.trim()&&Yt(o.value)},children:[r.jsx("input",{name:"askAiInput",autoFocus:!0,type:"text",placeholder:w("sandbox.fileExplorer.askTheAiPlaceholder"),className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground",onKeyDown:t=>{t.stopPropagation(),t.key==="Escape"&&he(null)}}),r.jsx("button",{type:"submit",className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-foreground text-background transition-opacity",title:w("sandbox.fileExplorer.send"),children:r.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[r.jsx("title",{children:w("sandbox.fileExplorer.send")}),r.jsx("path",{d:"M5 9V1M1 5l4-4 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})}),r.jsx("div",{className:"flex-1 overflow-hidden",children:d&&de?.loaded?r.jsx(bn,{language:Oe(d),theme:document.documentElement.classList.contains("dark")?"vs-dark":"light",value:de.editorValue,path:d,onChange:t=>{const n=d;n&&te(o=>{const c=new Map(o),p=c.get(n);return p&&c.set(n,{...p,editorValue:t??""}),c})},onMount:Xt,loading:r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(fe,{size:20,className:"animate-spin text-muted-foreground"})}),options:{fontSize:13,scrollBeyondLastLine:!1,automaticLayout:!0,lineNumbersMinChars:2,wordWrap:"on",minimap:{enabled:!1},padding:{top:12,bottom:12},scrollbar:{vertical:"auto",horizontal:"auto",verticalScrollbarSize:8,horizontalScrollbarSize:8}}},d):d&&!de?.loaded?r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(fe,{size:20,className:"animate-spin text-muted-foreground"})}):r.jsx("div",{className:"flex items-center justify-center h-full w-full text-sm text-muted-foreground",children:w("sandbox.fileExplorer.selectFileToEdit")})}),d&&r.jsxs("div",{className:"flex items-center justify-between px-3 py-1 border-t text-[11px] text-muted-foreground shrink-0",children:[r.jsx("span",{className:"truncate",children:d}),r.jsxs("span",{children:[w(Wt?"sandbox.fileExplorer.modified":"sandbox.fileExplorer.saved")," ","· ",Oe(d)]})]})]}),r.jsx(sr,{open:H!==null,mode:H?.mode??"new-file",initialName:H?.mode==="rename"?H.node.name:"",parentLabel:H&&H.mode!=="rename"?H.parentDir==="/"?"/":re(H.parentDir):void 0,isPending:be,onSubmit:t=>Mt(w,t),onOpenChange:t=>{!t&&!be&&oe(null)}}),r.jsx(ar,{deleteTarget:Te,deleteDirtyPaths:Qt,fsActionPending:be,onOpenChange:t=>{!t&&!be&&Pe(null)},onConfirm:t=>{Dt(w,t)}})]})}export{$a as FileExplorer};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as g,j as o}from"./index-
|
|
1
|
+
import{c as g,j as o}from"./index-Bfy-Fe7V.js";const h={pdf:"#D92D20",doc:"#155EEF",docx:"#155EEF",txt:"#475467",md:"#475467",xls:"#099250",xlsx:"#099250",csv:"#099250",tsv:"#099250",json:"#475467",xml:"#475467",yaml:"#475467",yml:"#475467",ppt:"#DC6803",pptx:"#DC6803",key:"#DC6803",png:"#7F56D9",jpg:"#7F56D9",jpeg:"#7F56D9",gif:"#7F56D9",webp:"#7F56D9",svg:"#7F56D9",avif:"#7F56D9",mp3:"#DD2590",wav:"#DD2590",mp4:"#DD2590",mov:"#DD2590",webm:"#DD2590",zip:"#475467",tar:"#475467",gz:"#475467",rar:"#475467",html:"#DC6803",htm:"#DC6803",css:"#155EEF",js:"#155EEF",jsx:"#155EEF",ts:"#155EEF",tsx:"#155EEF",py:"#155EEF",sql:"#155EEF",sh:"#475467"},F="#475467",D={pdf:"PDF",doc:"Word document",docx:"Word document",txt:"Text file",md:"Markdown",xls:"Excel file",xlsx:"Excel file",csv:"CSV file",tsv:"TSV file",json:"JSON file",xml:"XML file",yaml:"YAML file",yml:"YAML file",ppt:"Presentation",pptx:"Presentation",key:"Presentation",png:"Image",jpg:"Image",jpeg:"Image",gif:"Image",webp:"Image",svg:"Image",avif:"Image",mp3:"Audio",wav:"Audio",mp4:"Video",mov:"Video",webm:"Video",zip:"Archive",tar:"Archive",gz:"Archive",rar:"Archive",html:"HTML file",htm:"HTML file"};function v(l){const e=f(l);return e?D[e]??`${e.toUpperCase()} file`:"File"}function f(l){const e=l.lastIndexOf(".");if(e<=0||e===l.length-1)return null;const t=l.slice(e+1).toLowerCase();return t.length>4||!/^[a-z0-9]+$/.test(t)?null:t}function u(l){const e=g.c(17);let t,n;e[0]!==l?({filename:t,...n}=l,e[0]=l,e[1]=t,e[2]=n):(t=e[1],n=e[2]);let s,i,a;e[3]!==t?(i=f(t),s=i?h[i]??F:null,a=i?.toUpperCase()??"",e[3]=t,e[4]=s,e[5]=i,e[6]=a):(s=e[4],i=e[5],a=e[6]);const c=a,m=Math.min(8+c.length*4.6,28);let p,x;e[7]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsx("path",{d:"M19.5 1H8a4 4 0 0 0-4 4v30a4 4 0 0 0 4 4h16a4 4 0 0 0 4-4V9.5L19.5 1Z",className:"fill-background stroke-border",strokeWidth:"1.5"}),x=o.jsx("path",{d:"M19.5 1v4.5a4 4 0 0 0 4 4H28",className:"stroke-border",strokeWidth:"1.5"}),e[7]=p,e[8]=x):(p=e[7],x=e[8]);let r;e[9]!==m||e[10]!==s||e[11]!==i||e[12]!==c?(r=i&&s&&o.jsxs(o.Fragment,{children:[o.jsx("rect",{x:"1",y:"20",width:m,height:"12",rx:"3",fill:s}),o.jsx("text",{x:1+m/2,y:"29",textAnchor:"middle",fontSize:"7",fontWeight:"700",letterSpacing:"0.2",fill:"#FFFFFF",style:{fontFamily:"inherit"},children:c})]}),e[9]=m,e[10]=s,e[11]=i,e[12]=c,e[13]=r):r=e[13];let d;return e[14]!==n||e[15]!==r?(d=o.jsxs("svg",{viewBox:"0 0 32 40",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",...n,children:[p,x,r]}),e[14]=n,e[15]=r,e[16]=d):d=e[16],d}export{u as F,v as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d_ as C,c as d,j as c,a5 as j,r as f,m as p,be as b,d$ as v,e0 as h}from"./index-
|
|
1
|
+
import{d_ as C,c as d,j as c,a5 as j,r as f,m as p,be as b,d$ as v,e0 as h}from"./index-Bfy-Fe7V.js";import{L as N}from"./label-Dplc1_oE.js";const E=C,$=f.createContext({}),M=t=>{const e=d.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($.Provider,{value:o,children:n}),e[6]=o,e[7]=n,e[8]=r):r=e[8],r},x=()=>{const t=d.c(13),e=f.useContext($),s=f.useContext(g),{getFieldState:o}=v();let n;t[0]!==e.name?(n={name:e.name},t[0]=e.name,t[1]=n):n=t[1];const r=h(n);let a;t[2]!==e.name||t[3]!==r||t[4]!==o?(a=o(e.name,r),t[2]=e.name,t[3]=r,t[4]=o,t[5]=a):a=t[5];const l=a;if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=s,m=`${i}-form-item`,F=`${i}-form-item-description`,I=`${i}-form-item-message`;let u;return t[6]!==e.name||t[7]!==l||t[8]!==i||t[9]!==m||t[10]!==F||t[11]!==I?(u={id:i,name:e.name,formItemId:m,formDescriptionId:F,formMessageId:I,...l},t[6]=e.name,t[7]=l,t[8]=i,t[9]=m,t[10]=F,t[11]=I,t[12]=u):u=t[12],u},g=f.createContext({});function w(t){const e=d.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=f.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(g.Provider,{value:r,children:l}),e[10]=r,e[11]=l,e[12]=i):i=e[12],i}function L(t){const e=d.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=d.c(7);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];const{error:o,formItemId:n,formDescriptionId:r,formMessageId:a}=x(),l=o?`${r} ${a}`:`${r}`,i=!!o;let m;return e[2]!==n||e[3]!==s||e[4]!==l||e[5]!==i?(m=c.jsx(b,{"data-slot":"form-control",id:n,"aria-describedby":l,"aria-invalid":i,...s}),e[2]=n,e[3]=s,e[4]=l,e[5]=i,e[6]=m):m=e[6],m}function y(t){const e=d.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=d.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{c as O,F as J,r as Z,j as i,B as se,L as fe,Z as ue,$ as oe,b as P,o as pe,a1 as xe,a2 as he,e as le,p as ne,t as C,K as re,a5 as je,G as ae,bY as Se,bZ as _e,w as ve}from"./index-vEFJuUdN.js";import{P as W}from"./index-EI3Ugq-F.js";import{A as be,b as ze}from"./alert-DIuR7XaR.js";import{i as ye}from"./XCircle-Cpx4dopB.js";import{n as Ae}from"./LinkExternal01-B3QGOPZ8.js";import{s as we}from"./XClose-3fY-ChCg.js";import{u as Ce}from"./use-org-auth-client-CO9ez288.js";import{u as Oe}from"./use-debounced-autosave--SMcEphJ.js";import{A as De}from"./avatar-CPIgr7-p.js";import{I as ce}from"./input-5e_3GJtI.js";import{S as X,a as ee,b as Q,c as Ne}from"./settings-section-DPTzp_P_.js";import{d as me,S as Te,a as Fe,b as ke,c as Pe}from"./select-Dez5FrF9.js";import{S as Ee}from"./skeleton-pl0N1Ino.js";import{A as de,t as Re,aU as Ke,a5 as $e,aV as Le}from"./agent-icon-CWBP36-h.js";import{a as Ie,i as Me,f as Ve}from"./use-mcp-client-lJgGp2B_.js";import{a as qe}from"./use-virtual-mcp-DKb7Fyg4.js";import{a as Ue}from"./agent-capabilities-cXfbMfjV.js";import{e as Be,h as Ge,u as Qe,i as Ze}from"./use-organization-settings-CgP5KHWU.js";import{S as Ye}from"./switch-By_6CkwD.js";import{D as We}from"./domain-settings-BEadEJ2B.js";import{u as He}from"./studio-tools-CBUmjJWM.js";import{A as Je,a as Xe,b as et,c as tt,d as it,e as st,f as nt,g as ot}from"./alert-dialog-Xn8LpVc8.js";import{R as rt}from"./require-capability-fB062a2_.js";import"./sidebar-BXJraWph.js";import"./LayoutLeft-BowuBtX2.js";import"./use-mobile-WXO34F35.js";import"./X-CseWQ5OZ.js";import"./tooltip-BUztXQ1W.js";import"./User01-CPSa9S2T.js";import"./card-lxFop9oJ.js";import"./ArrowUpRight-erfF6BcP.js";import"./Check-CABzt6--.js";import"./ChevronDown-DsDzbrOb.js";import"./ChevronUp-DBUIuLI5.js";import"./AlertCircle-iMFIwWNV.js";import"./Tool01-DStbcY86.js";import"./ArrowUp-DSxXxGdv.js";import"./ArrowLeft-CsWtY_gB.js";import"./Tool02-7YE_lsQ5.js";import"./TrendUp01-C6JwA-Np.js";import"./ZapSquare-kC-fhZGr.js";import"./Users03-Dqls41gn.js";import"./CheckCircle-N8333lb0.js";import"./ChevronRight-DwahmHLA.js";import"./DotsVertical-BRYCw47k.js";import"./Stars02-B08-JGxx.js";import"./Copy01-B995BWXi.js";import"./CpuChip01-lt7Rkp-U.js";import"./CreditCard01-GxtaywC9.js";import"./Globe01-0reGbJcL.js";import"./Settings02-C9fJkEJh.js";import"./Eye-Clu-LouG.js";import"./FilterLines-CNzwsg4F.js";import"./Share07-DS8-754J.js";import"./Star01-CwL23CRL.js";import"./Globe04-sue1ujzC.js";import"./SwitchHorizontal01-ChVU7SWq.js";import"./HardDrive-CuFY6j2o.js";import"./Key01-C8zGItpI.js";import"./LogOut01-CwZ1Y9u4.js";import"./Monitor01-Bni1e5h7.js";import"./Sun-kp4es37w.js";import"./Palette-B6o-2LWT.js";import"./Play-BC8nRLNF.js";import"./Plus-BPZja4FC.js";import"./SearchLg-CGtAP5EH.js";import"./SearchMd-BVrWvjH3.js";import"./Shield01-CrVGBhuR.js";import"./Stars01-D94NieJP.js";import"./Trash01-DGt8nZn9.js";import"./Upload01-DgSyem4d.js";import"./Users01-DUxHx9ib.js";import"./Zap-B6D2E55F.js";import"./auth-ANCOmttW.js";import"./badge-BoP7NhL_.js";import"./use-capability-D7eAS5np.js";import"./access-gate-CA12_xun.js";import"./capability-load-error-S-JNljGC.js";function ge(e){return`connect-banner-dismissed:${e}`}function at(e){if(typeof window>"u")return!0;try{return localStorage.getItem(ge(e))==="1"}catch{return!1}}function lt(){const e=O.c(17),{org:t}=J();let s;e[0]!==t.id?(s=()=>at(t.id),e[0]=t.id,e[1]=s):s=e[1];const[l,a]=Z.useState(s);if(l)return null;let c;e[2]!==t.id?(c=()=>{a(!0);try{localStorage.setItem(ge(t.id),"1")}catch{}},e[2]=t.id,e[3]=c):c=e[3];const r=c;let m;e[4]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(Ae,{}),e[4]=m):m=e[4];let n;e[5]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsx("span",{children:"Use Studio MCP anywhere — paste a command into Claude Code, Cursor, Codex, or any MCP client."}),e[5]=n):n=e[5];let f;e[6]!==t.slug?(f={org:t.slug},e[6]=t.slug,e[7]=f):f=e[7];let o;e[8]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx(ye,{size:12}),e[8]=o):o=e[8];let u;e[9]!==f?(u=i.jsx(se,{asChild:!0,size:"sm",variant:"ghost",className:"text-xs gap-1",children:i.jsxs(fe,{to:"/$org/settings/connect",params:f,children:["Connect to clients ",o]})}),e[9]=f,e[10]=u):u=e[10];let d;e[11]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(we,{size:14}),e[11]=d):d=e[11];let g;e[12]!==r?(g=i.jsx(se,{variant:"ghost",size:"icon",className:"size-7",onClick:r,"aria-label":"Dismiss",children:d}),e[12]=r,e[13]=g):g=e[13];let p;return e[14]!==u||e[15]!==g?(p=i.jsxs(be,{variant:"info",className:"items-center",children:[m,i.jsxs(ze,{className:"flex-1 flex items-center justify-between gap-2 text-sm",children:[n,i.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[u,g]})]})]}),e[14]=u,e[15]=g,e[16]=p):p=e[16],p}const ct=ue({name:oe().min(1,"Name is required").max(255,"Name is too long"),logo:oe().optional()});function mt(e){const t=O.c(17),{value:s,onChange:l,name:a,disabled:c}=e,r=P(),m=Z.useRef(null);let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=()=>m.current?.click(),t[0]=n):n=t[0];const f=n;let o;t[1]!==l||t[2]!==r?(o=D=>{const h=D.target.files?.[0];if(!h)return;if(h.size>2097152){C.error(r("settings.organizationForm.imageTooLarge"));return}const j=new FileReader;j.onerror=()=>C.error(r("settings.organizationForm.failedToReadImage")),j.onloadend=()=>{j.result&&l(j.result),m.current&&(m.current.value="")},j.readAsDataURL(h)},t[1]=l,t[2]=r,t[3]=o):o=t[3];const u=o;let d;t[4]!==r?(d=r("settings.organizationForm.uploadLogoLabel"),t[4]=r,t[5]=d):d=t[5];let g;t[6]!==c||t[7]!==u?(g=i.jsx("input",{ref:m,type:"file",accept:"image/*",onChange:u,className:"hidden",disabled:c}),t[6]=c,t[7]=u,t[8]=g):g=t[8];const p=s||void 0,x=a??"?";let S;t[9]!==p||t[10]!==x?(S=i.jsx(De,{url:p,fallback:x,shape:"square",size:"base"}),t[9]=p,t[10]=x,t[11]=S):S=t[11];let v;return t[12]!==c||t[13]!==d||t[14]!==g||t[15]!==S?(v=i.jsxs("button",{type:"button",onClick:f,disabled:c,className:"rounded-lg overflow-hidden hover:ring-2 hover:ring-border transition-all disabled:opacity-50","aria-label":d,children:[g,S]}),t[12]=c,t[13]=d,t[14]=g,t[15]=S,t[16]=v):v=t[16],v}function dt(){const e=P(),{org:t}=J(),s=Ce(),l=pe(),a=xe({resolver:he(ct),values:{name:t.name??"",logo:t.logo??""}}),c=le({mutationFn:async o=>{const u={name:o.name};o.logo&&(u.logo=o.logo);const d=await s.organization.update({data:u});if(d?.error)throw new Error(d.error.message||e("settings.organizationForm.failedToUpdateOrg"));return d},onSuccess:(o,u)=>{ne("organization_settings_updated",{organization_id:t.id,fields:Object.keys(u)}),l.invalidateQueries({queryKey:re.organizations()}),l.invalidateQueries({queryKey:re.activeOrganization(t.slug)}),C.success(e("settings.organizationForm.updateSuccess"))},onError:(o,u)=>{ne("organization_settings_update_failed",{organization_id:t.id,fields:Object.keys(u),error:o instanceof Error?o.message:String(o)}),C.error(o instanceof Error?o.message:e("settings.organizationForm.failedToUpdateOrg"))}}),{schedule:r,flush:m}=Oe({save:async()=>{const o=a.control._formState.dirtyFields;if(Object.keys(o).length===0||!await a.trigger())return;const d=a.getValues(),g=a.control._defaultValues;a.reset(d,{keepValues:!0});try{await c.mutateAsync(d)}catch{a.reset(g,{keepValues:!0})}}}),n=a.formState.errors,f=typeof window<"u"?`${window.location.host}/`:"";return i.jsx(X,{children:i.jsxs(ee,{children:[i.jsx(Q,{title:e("settings.organizationForm.logoTitle"),description:e("settings.organizationForm.logoDescription"),action:i.jsx(mt,{value:a.watch("logo"),onChange:o=>{a.setValue("logo",o??"",{shouldDirty:!0}),m()},name:a.watch("name")})}),i.jsx(Q,{title:e("settings.organizationForm.nameTitle"),action:i.jsx(je,{control:a.control,name:"name",render:({field:o})=>i.jsx(ce,{id:"org-name",...o,onChange:u=>{o.onChange(u),r()},onBlur:()=>{o.onBlur(),m()},placeholder:e("settings.organizationForm.namePlaceholder"),className:"w-[280px]"})})}),i.jsx(Q,{title:e("settings.organizationForm.urlTitle"),description:e("settings.organizationForm.urlDescription"),action:i.jsxs("div",{className:"flex items-center w-[280px] rounded-md border border-input bg-muted/40 overflow-hidden",children:[f&&i.jsx("span",{className:"pl-3 text-sm text-muted-foreground select-none",children:f}),i.jsx("span",{className:"flex-1 min-w-0 px-2 py-1.5 text-sm text-foreground truncate",children:t.slug})]})}),(n.name||n.logo)&&i.jsxs("div",{className:"px-5 pb-3 flex flex-col gap-1",children:[n.name&&i.jsx("p",{className:"text-xs text-destructive",children:n.name.message}),n.logo&&i.jsx("p",{className:"text-xs text-destructive",children:n.logo.message})]})]})})}const ie="__super_agent__";function gt(){const e=O.c(42),t=P(),{org:s}=J(),l=qe(),{mainAgentId:a}=Be(),c=Ge();let r,m,n,f,o,u,d,g;if(e[0]!==l||e[1]!==a||e[2]!==s.id||e[3]!==c||e[4]!==t){const S=Ue(l),v=(l??[]).filter(pt).filter(_=>!S.has(_.id)).filter(ut);let D;e[13]!==s.id?(D=Ie(s.id),e[13]=s.id,e[14]=D):D=e[14];const h=D,j=a!=null?(l??[]).find(_=>_.id===a):void 0,N=j?j.id:ie,T=j&&!v.some(_=>_.id===j.id)?[j,...v]:v;let w;e[15]!==l||e[16]!==c||e[17]!==h.title||e[18]!==t?(w=_=>{const A=_===ie?null:_,R=A===null?h.title:(l??[]).find(k=>k.id===A)?.title??"";c.mutate(A,{onSuccess:()=>C.success(A===null?t("settings.mainAgent.resetToast"):t("settings.mainAgent.setToast",{title:R})),onError:()=>C.error(t("settings.mainAgent.errorToast"))})},e[15]=l,e[16]=c,e[17]=h.title,e[18]=t,e[19]=w):w=e[19];const F=w;m=Te,o=N,u=F,d=c.isPending,e[20]===Symbol.for("react.memo_cache_sentinel")?(g=i.jsx(Fe,{className:"w-full sm:w-[280px]",children:i.jsx(ke,{})}),e[20]=g):g=e[20],r=Pe;let b;e[21]!==h.icon||e[22]!==h.title?(b=i.jsx(de,{icon:h.icon,name:h.title,size:"xs",className:"shrink-0"}),e[21]=h.icon,e[22]=h.title,e[23]=b):b=e[23];let z;e[24]!==t?(z=t("settings.mainAgent.superAgentOption"),e[24]=t,e[25]=z):z=e[25];let y;e[26]!==z?(y=i.jsx("span",{className:"truncate",children:z}),e[26]=z,e[27]=y):y=e[27],e[28]!==y||e[29]!==b?(n=i.jsx(me,{value:ie,children:i.jsxs("span",{className:"flex items-center gap-2",children:[b,y]})}),e[28]=y,e[29]=b,e[30]=n):n=e[30],f=T.map(ft),e[0]=l,e[1]=a,e[2]=s.id,e[3]=c,e[4]=t,e[5]=r,e[6]=m,e[7]=n,e[8]=f,e[9]=o,e[10]=u,e[11]=d,e[12]=g}else r=e[5],m=e[6],n=e[7],f=e[8],o=e[9],u=e[10],d=e[11],g=e[12];let p;e[31]!==r||e[32]!==n||e[33]!==f?(p=i.jsxs(r,{children:[n,f]}),e[31]=r,e[32]=n,e[33]=f,e[34]=p):p=e[34];let x;return e[35]!==m||e[36]!==o||e[37]!==u||e[38]!==d||e[39]!==g||e[40]!==p?(x=i.jsxs(m,{value:o,onValueChange:u,disabled:d,children:[g,p]}),e[35]=m,e[36]=o,e[37]=u,e[38]=d,e[39]=g,e[40]=p,e[41]=x):x=e[41],x}function ft(e){return i.jsx(me,{value:e.id,children:i.jsxs("span",{className:"flex items-center gap-2",children:[i.jsx(de,{icon:e.icon,name:e.title,size:"xs",className:"shrink-0"}),i.jsx("span",{className:"truncate",children:e.title})]})},e.id)}function ut(e){return!Ve(e.id)}function pt(e){return!Me(e.id)}function xt(){const e=O.c(16),t=P();let s;e[0]!==t?(s=t("settings.mainAgent.title"),e[0]=t,e[1]=s):s=e[1];let l;e[2]!==t?(l=t("settings.mainAgent.description"),e[2]=t,e[3]=l):l=e[3];let a;e[4]!==t?(a=t("settings.mainAgent.itemTitle"),e[4]=t,e[5]=a):a=e[5];let c;e[6]!==t?(c=t("settings.mainAgent.itemDescription"),e[6]=t,e[7]=c):c=e[7];let r;e[8]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(Z.Suspense,{fallback:i.jsx(Ee,{className:"h-9 w-[280px]"}),children:i.jsx(gt,{})}),e[8]=r):r=e[8];let m;e[9]!==a||e[10]!==c?(m=i.jsx(ee,{children:i.jsx(Q,{title:a,description:c,action:r})}),e[9]=a,e[10]=c,e[11]=m):m=e[11];let n;return e[12]!==s||e[13]!==l||e[14]!==m?(n=i.jsx(X,{title:s,description:l,children:m}),e[12]=s,e[13]=l,e[14]=m,e[15]=n):n=e[15],n}function ht(){const e=O.c(11),t=P();let s;e[0]!==t?(s=t("settings.review.title"),e[0]=t,e[1]=s):s=e[1];let l;e[2]!==t?(l=t("settings.review.description"),e[2]=t,e[3]=l):l=e[3];let a;e[4]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(H,{flag:"qa_agent_enabled",icon:i.jsx(Re,{size:16}),titleKey:"settings.review.qaAgentTitle",descriptionKey:"settings.review.qaAgentDescription"}),e[4]=a):a=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx(H,{flag:"code_reviewer_enabled",icon:i.jsx(Ke,{size:16}),titleKey:"settings.review.codeReviewerTitle",descriptionKey:"settings.review.codeReviewerDescription"}),e[5]=c):c=e[5];let r;e[6]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(H,{flag:"auto_merge",icon:i.jsx($e,{size:16}),titleKey:"settings.review.autoMergeTitle",descriptionKey:"settings.review.autoMergeDescription"}),e[6]=r):r=e[6];let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsxs(ee,{children:[a,c,r,i.jsx(H,{flag:"auto_assign_report_tasks_to_super_agent",icon:i.jsx(Le,{size:16}),titleKey:"settings.review.autoAssignReportTasksTitle",descriptionKey:"settings.review.autoAssignReportTasksDescription"})]}),e[7]=m):m=e[7];let n;return e[8]!==s||e[9]!==l?(n=i.jsx(X,{title:s,description:l,children:m}),e[8]=s,e[9]=l,e[10]=n):n=e[10],n}function H(e){const t=O.c(23),{flag:s,icon:l,titleKey:a,descriptionKey:c}=e,r=P(),m=Qe(s),n=Ze();let f;t[0]!==r||t[1]!==a?(f=r(a),t[0]=r,t[1]=a,t[2]=f):f=t[2];let o;t[3]!==c||t[4]!==r?(o=r(c),t[3]=c,t[4]=r,t[5]=o):o=t[5];const u=n.isPending;let d;t[6]!==r||t[7]!==a?(d=r(a),t[6]=r,t[7]=a,t[8]=d):d=t[8];let g;t[9]!==s||t[10]!==n||t[11]!==r?(g=S=>n.mutate(s,S,{onError:()=>C.error(r("settings.review.updateError"))}),t[9]=s,t[10]=n,t[11]=r,t[12]=g):g=t[12];let p;t[13]!==m||t[14]!==n.isPending||t[15]!==d||t[16]!==g?(p=i.jsx(Ye,{checked:m,disabled:u,"aria-label":d,onCheckedChange:g}),t[13]=m,t[14]=n.isPending,t[15]=d,t[16]=g,t[17]=p):p=t[17];let x;return t[18]!==l||t[19]!==f||t[20]!==o||t[21]!==p?(x=i.jsx(Q,{icon:l,title:f,description:o,action:p}),t[18]=l,t[19]=f,t[20]=o,t[21]=p,t[22]=x):x=t[22],x}function jt(){const e=O.c(86),t=P(),{org:s}=J(),[l,a]=Z.useState(!1),[c,r]=Z.useState(""),m=He();let n;e[0]!==s.id||e[1]!==m?(n=async()=>{await m.call("ORGANIZATION_DELETE",{id:s.id})},e[0]=s.id,e[1]=m,e[2]=n):n=e[2];let f;e[3]!==s.id||e[4]!==s.slug||e[5]!==t?(f=()=>{ne("organization_deleted",{organization_id:s.id}),localStorage.getItem(ae.lastOrgSlug())===s.slug&&localStorage.removeItem(ae.lastOrgSlug()),Se()?.org===s.slug&&_e(),ve(),C.success(t("settings.deleteOrganizationSection.organizationDeleted")),window.location.href="/"},e[3]=s.id,e[4]=s.slug,e[5]=t,e[6]=f):f=e[6];let o;e[7]!==t?(o=E=>{C.error(E instanceof Error?E.message:t("settings.deleteOrganizationSection.failedToDeleteOrganization"))},e[7]=t,e[8]=o):o=e[8];let u;e[9]!==n||e[10]!==f||e[11]!==o?(u={mutationFn:n,onSuccess:f,onError:o},e[9]=n,e[10]=f,e[11]=o,e[12]=u):u=e[12];const d=le(u);let g;e[13]!==t?(g=t("settings.deleteOrganizationSection.dangerZone"),e[13]=t,e[14]=g):g=e[14];let p;e[15]!==t?(p=t("settings.deleteOrganizationSection.irreversibleActionsDescription"),e[15]=t,e[16]=p):p=e[16];let x;e[17]!==t?(x=t("settings.deleteOrganizationSection.deleteOrganizationTitle"),e[17]=t,e[18]=x):x=e[18];let S;e[19]!==t?(S=t("settings.deleteOrganizationSection.deleteOrganizationDescription"),e[19]=t,e[20]=S):S=e[20];let v;e[21]===Symbol.for("react.memo_cache_sentinel")?(v=()=>a(!0),e[21]=v):v=e[21];const D=d.isPending;let h;e[22]!==t?(h=t("settings.deleteOrganizationSection.deleteButton"),e[22]=t,e[23]=h):h=e[23];let j;e[24]!==d.isPending||e[25]!==h?(j=i.jsx(se,{variant:"destructive",size:"sm",onClick:v,disabled:D,children:h}),e[24]=d.isPending,e[25]=h,e[26]=j):j=e[26];let N;e[27]!==j||e[28]!==x||e[29]!==S?(N=i.jsx(ee,{className:"border-destructive/40",children:i.jsx(Q,{title:x,description:S,action:j})}),e[27]=j,e[28]=x,e[29]=S,e[30]=N):N=e[30];let T;e[31]!==N||e[32]!==g||e[33]!==p?(T=i.jsx(X,{title:g,description:p,children:N}),e[31]=N,e[32]=g,e[33]=p,e[34]=T):T=e[34];let w;e[35]===Symbol.for("react.memo_cache_sentinel")?(w=E=>{a(E),E||r("")},e[35]=w):w=e[35];let F;e[36]!==t?(F=t("settings.deleteOrganizationSection.deleteOrganizationQuestion"),e[36]=t,e[37]=F):F=e[37];let b;e[38]!==F?(b=i.jsx(Je,{children:F}),e[38]=F,e[39]=b):b=e[39];let z;e[40]!==s.name||e[41]!==t?(z=t("settings.deleteOrganizationSection.deleteWarning",{organizationName:s.name}),e[40]=s.name,e[41]=t,e[42]=z):z=e[42];let y;e[43]!==z?(y=i.jsx("p",{children:z}),e[43]=z,e[44]=y):y=e[44];let _;e[45]!==s.name||e[46]!==t?(_=t("settings.deleteOrganizationSection.typeToConfirm",{organizationName:s.name}),e[45]=s.name,e[46]=t,e[47]=_):_=e[47];let A;e[48]!==_?(A=i.jsx("p",{className:"mt-3 mb-1.5",children:_}),e[48]=_,e[49]=A):A=e[49];let R;e[50]===Symbol.for("react.memo_cache_sentinel")?(R=E=>r(E.target.value),e[50]=R):R=e[50];let k;e[51]!==c||e[52]!==s.name?(k=i.jsx(ce,{value:c,onChange:R,placeholder:s.name,autoFocus:!0}),e[51]=c,e[52]=s.name,e[53]=k):k=e[53];let K;e[54]!==y||e[55]!==A||e[56]!==k?(K=i.jsx(Xe,{asChild:!0,children:i.jsxs("div",{children:[y,A,k]})}),e[54]=y,e[55]=A,e[56]=k,e[57]=K):K=e[57];let $;e[58]!==b||e[59]!==K?($=i.jsxs(et,{children:[b,K]}),e[58]=b,e[59]=K,e[60]=$):$=e[60];let L;e[61]!==t?(L=t("settings.deleteOrganizationSection.cancel"),e[61]=t,e[62]=L):L=e[62];let I;e[63]!==L?(I=i.jsx(tt,{children:L}),e[63]=L,e[64]=I):I=e[64];let M;e[65]!==d?(M=()=>d.mutate(),e[65]=d,e[66]=M):M=e[66];const te=c!==s.name||d.isPending;let V;e[67]!==d.isPending||e[68]!==t?(V=d.isPending?t("settings.deleteOrganizationSection.deleting"):t("settings.deleteOrganizationSection.deleteOrganizationAction"),e[67]=d.isPending,e[68]=t,e[69]=V):V=e[69];let q;e[70]!==M||e[71]!==te||e[72]!==V?(q=i.jsx(it,{onClick:M,disabled:te,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90 disabled:opacity-50",children:V}),e[70]=M,e[71]=te,e[72]=V,e[73]=q):q=e[73];let U;e[74]!==I||e[75]!==q?(U=i.jsxs(st,{children:[I,q]}),e[74]=I,e[75]=q,e[76]=U):U=e[76];let B;e[77]!==$||e[78]!==U?(B=i.jsxs(nt,{children:[$,U]}),e[77]=$,e[78]=U,e[79]=B):B=e[79];let G;e[80]!==l||e[81]!==B?(G=i.jsx(ot,{open:l,onOpenChange:w,children:B}),e[80]=l,e[81]=B,e[82]=G):G=e[82];let Y;return e[83]!==T||e[84]!==G?(Y=i.jsxs(i.Fragment,{children:[T,G]}),e[83]=T,e[84]=G,e[85]=Y):Y=e[85],Y}function St(){const e=O.c(12),t=P();let s;e[0]!==t?(s=t("settings.orgGeneral.organization"),e[0]=t,e[1]=s):s=e[1];let l;e[2]!==s?(l=i.jsx(W.Title,{children:s}),e[2]=s,e[3]=l):l=e[3];let a,c,r,m,n,f;e[4]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(lt,{}),c=i.jsx(dt,{}),r=i.jsx(xt,{}),m=i.jsx(ht,{}),n=i.jsx(We,{}),f=i.jsx(jt,{}),e[4]=a,e[5]=c,e[6]=r,e[7]=m,e[8]=n,e[9]=f):(a=e[4],c=e[5],r=e[6],m=e[7],n=e[8],f=e[9]);let o;return e[10]!==l?(o=i.jsx(W,{children:i.jsx(W.Content,{children:i.jsx(W.Body,{children:i.jsxs(Ne,{children:[l,a,c,r,m,n,f]})})})}),e[10]=l,e[11]=o):o=e[11],o}function Ui(){const e=O.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsx(rt,{capability:"org:manage",area:"general settings",children:i.jsx(St,{})}),e[0]=t):t=e[0],t}export{Ui as default};
|
|
1
|
+
import{c as O,F as J,r as Z,j as i,B as se,L as fe,Z as ue,$ as oe,b as P,o as pe,a1 as xe,a2 as he,e as le,p as ne,t as C,K as re,a5 as je,G as ae,bY as Se,bZ as _e,w as ve}from"./index-Bfy-Fe7V.js";import{P as W}from"./index-D5KNWpFX.js";import{A as be,b as ze}from"./alert-DbDLUaFg.js";import{i as ye}from"./XCircle-DOtlBDfF.js";import{n as Ae}from"./LinkExternal01-CLr9HZg0.js";import{s as we}from"./XClose-BoiJoxeV.js";import{u as Ce}from"./use-org-auth-client-hxCPh-jf.js";import{u as Oe}from"./use-debounced-autosave-CGiNF_NH.js";import{A as De}from"./avatar-CKAwkvrw.js";import{I as ce}from"./input-BVD_WyXJ.js";import{S as X,a as ee,b as Q,c as Ne}from"./settings-section-CfhHwu3l.js";import{d as me,S as Te,a as Fe,b as ke,c as Pe}from"./select-wwJ8EUoY.js";import{S as Ee}from"./skeleton-Dd2jseki.js";import{A as de,t as Re,aU as Ke,a5 as $e,aV as Le}from"./agent-icon-D_vHJRnE.js";import{a as Ie,i as Me,f as Ve}from"./use-mcp-client-CMZDCFwV.js";import{a as qe}from"./use-virtual-mcp-CvLFbjo1.js";import{a as Ue}from"./agent-capabilities-cXfbMfjV.js";import{e as Be,h as Ge,u as Qe,i as Ze}from"./use-organization-settings-CmS9ohCu.js";import{S as Ye}from"./switch-CAjDqeuV.js";import{D as We}from"./domain-settings-VApHKPI3.js";import{u as He}from"./studio-tools-BBDHxwPb.js";import{A as Je,a as Xe,b as et,c as tt,d as it,e as st,f as nt,g as ot}from"./alert-dialog-BgN-Tqd-.js";import{R as rt}from"./require-capability-ATUore6a.js";import"./sidebar-CusUIOZL.js";import"./LayoutLeft-C0u89h3U.js";import"./use-mobile-RWxooM53.js";import"./X-CId2-nhW.js";import"./tooltip-F9SMeJ-j.js";import"./User01-UnLfhP79.js";import"./card-GrGBYBXG.js";import"./ArrowUpRight-OVKS4c5s.js";import"./Check-CeB_ZeLq.js";import"./ChevronDown-CGwhMiqT.js";import"./ChevronUp-3dsPU76D.js";import"./AlertCircle-BMPkNMGJ.js";import"./Tool01-DMQJZ6a0.js";import"./ArrowUp-Cmxc5KIG.js";import"./ArrowLeft-Bo0FpGQs.js";import"./Tool02-CZZOjaKh.js";import"./TrendUp01-CYPiI6vW.js";import"./ZapSquare-GHgi4Hl7.js";import"./Users03-C0P658nm.js";import"./CheckCircle-C9SAYY-W.js";import"./ChevronRight-Cux_llMB.js";import"./DotsVertical-9U5tOb04.js";import"./Stars02-2eb3r8Gu.js";import"./Copy01-CXcHnxi0.js";import"./CpuChip01-CGpR8wkh.js";import"./CreditCard01-DSA6UjMO.js";import"./Globe01-Cm-V-gHj.js";import"./Settings02-DBlt8Mfk.js";import"./Eye-DXWAJYKq.js";import"./FilterLines-DZrlB4Kh.js";import"./Share07-C1_p27Hs.js";import"./Star01-ClwU4gOx.js";import"./Globe04-m1tzMty0.js";import"./SwitchHorizontal01-D0Mi7oaK.js";import"./HardDrive-Dvps78YO.js";import"./Key01-DY7yaq7L.js";import"./LogOut01-BeE1lxGA.js";import"./Monitor01-RiuZmvGS.js";import"./Sun-m3RjKnDt.js";import"./Palette-C8S3zMtK.js";import"./Play-B8V74CpU.js";import"./Plus-CGrXNe_q.js";import"./SearchLg-DrUBeTI6.js";import"./SearchMd-DFwCvkV1.js";import"./Shield01-CZr-J1Qk.js";import"./Stars01-jLom0LSv.js";import"./Trash01-BCoCDH0H.js";import"./Upload01-mvF19nky.js";import"./Users01-BGTUZMIA.js";import"./Zap-C6ApHWIY.js";import"./auth-BcPAS4K5.js";import"./badge-CxlSzoE1.js";import"./use-capability-DssZIcHp.js";import"./access-gate-C95F2WkH.js";import"./capability-load-error-BJPRtvi9.js";function ge(e){return`connect-banner-dismissed:${e}`}function at(e){if(typeof window>"u")return!0;try{return localStorage.getItem(ge(e))==="1"}catch{return!1}}function lt(){const e=O.c(17),{org:t}=J();let s;e[0]!==t.id?(s=()=>at(t.id),e[0]=t.id,e[1]=s):s=e[1];const[l,a]=Z.useState(s);if(l)return null;let c;e[2]!==t.id?(c=()=>{a(!0);try{localStorage.setItem(ge(t.id),"1")}catch{}},e[2]=t.id,e[3]=c):c=e[3];const r=c;let m;e[4]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(Ae,{}),e[4]=m):m=e[4];let n;e[5]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsx("span",{children:"Use Studio MCP anywhere — paste a command into Claude Code, Cursor, Codex, or any MCP client."}),e[5]=n):n=e[5];let f;e[6]!==t.slug?(f={org:t.slug},e[6]=t.slug,e[7]=f):f=e[7];let o;e[8]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx(ye,{size:12}),e[8]=o):o=e[8];let u;e[9]!==f?(u=i.jsx(se,{asChild:!0,size:"sm",variant:"ghost",className:"text-xs gap-1",children:i.jsxs(fe,{to:"/$org/settings/connect",params:f,children:["Connect to clients ",o]})}),e[9]=f,e[10]=u):u=e[10];let d;e[11]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(we,{size:14}),e[11]=d):d=e[11];let g;e[12]!==r?(g=i.jsx(se,{variant:"ghost",size:"icon",className:"size-7",onClick:r,"aria-label":"Dismiss",children:d}),e[12]=r,e[13]=g):g=e[13];let p;return e[14]!==u||e[15]!==g?(p=i.jsxs(be,{variant:"info",className:"items-center",children:[m,i.jsxs(ze,{className:"flex-1 flex items-center justify-between gap-2 text-sm",children:[n,i.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[u,g]})]})]}),e[14]=u,e[15]=g,e[16]=p):p=e[16],p}const ct=ue({name:oe().min(1,"Name is required").max(255,"Name is too long"),logo:oe().optional()});function mt(e){const t=O.c(17),{value:s,onChange:l,name:a,disabled:c}=e,r=P(),m=Z.useRef(null);let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=()=>m.current?.click(),t[0]=n):n=t[0];const f=n;let o;t[1]!==l||t[2]!==r?(o=D=>{const h=D.target.files?.[0];if(!h)return;if(h.size>2097152){C.error(r("settings.organizationForm.imageTooLarge"));return}const j=new FileReader;j.onerror=()=>C.error(r("settings.organizationForm.failedToReadImage")),j.onloadend=()=>{j.result&&l(j.result),m.current&&(m.current.value="")},j.readAsDataURL(h)},t[1]=l,t[2]=r,t[3]=o):o=t[3];const u=o;let d;t[4]!==r?(d=r("settings.organizationForm.uploadLogoLabel"),t[4]=r,t[5]=d):d=t[5];let g;t[6]!==c||t[7]!==u?(g=i.jsx("input",{ref:m,type:"file",accept:"image/*",onChange:u,className:"hidden",disabled:c}),t[6]=c,t[7]=u,t[8]=g):g=t[8];const p=s||void 0,x=a??"?";let S;t[9]!==p||t[10]!==x?(S=i.jsx(De,{url:p,fallback:x,shape:"square",size:"base"}),t[9]=p,t[10]=x,t[11]=S):S=t[11];let v;return t[12]!==c||t[13]!==d||t[14]!==g||t[15]!==S?(v=i.jsxs("button",{type:"button",onClick:f,disabled:c,className:"rounded-lg overflow-hidden hover:ring-2 hover:ring-border transition-all disabled:opacity-50","aria-label":d,children:[g,S]}),t[12]=c,t[13]=d,t[14]=g,t[15]=S,t[16]=v):v=t[16],v}function dt(){const e=P(),{org:t}=J(),s=Ce(),l=pe(),a=xe({resolver:he(ct),values:{name:t.name??"",logo:t.logo??""}}),c=le({mutationFn:async o=>{const u={name:o.name};o.logo&&(u.logo=o.logo);const d=await s.organization.update({data:u});if(d?.error)throw new Error(d.error.message||e("settings.organizationForm.failedToUpdateOrg"));return d},onSuccess:(o,u)=>{ne("organization_settings_updated",{organization_id:t.id,fields:Object.keys(u)}),l.invalidateQueries({queryKey:re.organizations()}),l.invalidateQueries({queryKey:re.activeOrganization(t.slug)}),C.success(e("settings.organizationForm.updateSuccess"))},onError:(o,u)=>{ne("organization_settings_update_failed",{organization_id:t.id,fields:Object.keys(u),error:o instanceof Error?o.message:String(o)}),C.error(o instanceof Error?o.message:e("settings.organizationForm.failedToUpdateOrg"))}}),{schedule:r,flush:m}=Oe({save:async()=>{const o=a.control._formState.dirtyFields;if(Object.keys(o).length===0||!await a.trigger())return;const d=a.getValues(),g=a.control._defaultValues;a.reset(d,{keepValues:!0});try{await c.mutateAsync(d)}catch{a.reset(g,{keepValues:!0})}}}),n=a.formState.errors,f=typeof window<"u"?`${window.location.host}/`:"";return i.jsx(X,{children:i.jsxs(ee,{children:[i.jsx(Q,{title:e("settings.organizationForm.logoTitle"),description:e("settings.organizationForm.logoDescription"),action:i.jsx(mt,{value:a.watch("logo"),onChange:o=>{a.setValue("logo",o??"",{shouldDirty:!0}),m()},name:a.watch("name")})}),i.jsx(Q,{title:e("settings.organizationForm.nameTitle"),action:i.jsx(je,{control:a.control,name:"name",render:({field:o})=>i.jsx(ce,{id:"org-name",...o,onChange:u=>{o.onChange(u),r()},onBlur:()=>{o.onBlur(),m()},placeholder:e("settings.organizationForm.namePlaceholder"),className:"w-[280px]"})})}),i.jsx(Q,{title:e("settings.organizationForm.urlTitle"),description:e("settings.organizationForm.urlDescription"),action:i.jsxs("div",{className:"flex items-center w-[280px] rounded-md border border-input bg-muted/40 overflow-hidden",children:[f&&i.jsx("span",{className:"pl-3 text-sm text-muted-foreground select-none",children:f}),i.jsx("span",{className:"flex-1 min-w-0 px-2 py-1.5 text-sm text-foreground truncate",children:t.slug})]})}),(n.name||n.logo)&&i.jsxs("div",{className:"px-5 pb-3 flex flex-col gap-1",children:[n.name&&i.jsx("p",{className:"text-xs text-destructive",children:n.name.message}),n.logo&&i.jsx("p",{className:"text-xs text-destructive",children:n.logo.message})]})]})})}const ie="__super_agent__";function gt(){const e=O.c(42),t=P(),{org:s}=J(),l=qe(),{mainAgentId:a}=Be(),c=Ge();let r,m,n,f,o,u,d,g;if(e[0]!==l||e[1]!==a||e[2]!==s.id||e[3]!==c||e[4]!==t){const S=Ue(l),v=(l??[]).filter(pt).filter(_=>!S.has(_.id)).filter(ut);let D;e[13]!==s.id?(D=Ie(s.id),e[13]=s.id,e[14]=D):D=e[14];const h=D,j=a!=null?(l??[]).find(_=>_.id===a):void 0,N=j?j.id:ie,T=j&&!v.some(_=>_.id===j.id)?[j,...v]:v;let w;e[15]!==l||e[16]!==c||e[17]!==h.title||e[18]!==t?(w=_=>{const A=_===ie?null:_,R=A===null?h.title:(l??[]).find(k=>k.id===A)?.title??"";c.mutate(A,{onSuccess:()=>C.success(A===null?t("settings.mainAgent.resetToast"):t("settings.mainAgent.setToast",{title:R})),onError:()=>C.error(t("settings.mainAgent.errorToast"))})},e[15]=l,e[16]=c,e[17]=h.title,e[18]=t,e[19]=w):w=e[19];const F=w;m=Te,o=N,u=F,d=c.isPending,e[20]===Symbol.for("react.memo_cache_sentinel")?(g=i.jsx(Fe,{className:"w-full sm:w-[280px]",children:i.jsx(ke,{})}),e[20]=g):g=e[20],r=Pe;let b;e[21]!==h.icon||e[22]!==h.title?(b=i.jsx(de,{icon:h.icon,name:h.title,size:"xs",className:"shrink-0"}),e[21]=h.icon,e[22]=h.title,e[23]=b):b=e[23];let z;e[24]!==t?(z=t("settings.mainAgent.superAgentOption"),e[24]=t,e[25]=z):z=e[25];let y;e[26]!==z?(y=i.jsx("span",{className:"truncate",children:z}),e[26]=z,e[27]=y):y=e[27],e[28]!==y||e[29]!==b?(n=i.jsx(me,{value:ie,children:i.jsxs("span",{className:"flex items-center gap-2",children:[b,y]})}),e[28]=y,e[29]=b,e[30]=n):n=e[30],f=T.map(ft),e[0]=l,e[1]=a,e[2]=s.id,e[3]=c,e[4]=t,e[5]=r,e[6]=m,e[7]=n,e[8]=f,e[9]=o,e[10]=u,e[11]=d,e[12]=g}else r=e[5],m=e[6],n=e[7],f=e[8],o=e[9],u=e[10],d=e[11],g=e[12];let p;e[31]!==r||e[32]!==n||e[33]!==f?(p=i.jsxs(r,{children:[n,f]}),e[31]=r,e[32]=n,e[33]=f,e[34]=p):p=e[34];let x;return e[35]!==m||e[36]!==o||e[37]!==u||e[38]!==d||e[39]!==g||e[40]!==p?(x=i.jsxs(m,{value:o,onValueChange:u,disabled:d,children:[g,p]}),e[35]=m,e[36]=o,e[37]=u,e[38]=d,e[39]=g,e[40]=p,e[41]=x):x=e[41],x}function ft(e){return i.jsx(me,{value:e.id,children:i.jsxs("span",{className:"flex items-center gap-2",children:[i.jsx(de,{icon:e.icon,name:e.title,size:"xs",className:"shrink-0"}),i.jsx("span",{className:"truncate",children:e.title})]})},e.id)}function ut(e){return!Ve(e.id)}function pt(e){return!Me(e.id)}function xt(){const e=O.c(16),t=P();let s;e[0]!==t?(s=t("settings.mainAgent.title"),e[0]=t,e[1]=s):s=e[1];let l;e[2]!==t?(l=t("settings.mainAgent.description"),e[2]=t,e[3]=l):l=e[3];let a;e[4]!==t?(a=t("settings.mainAgent.itemTitle"),e[4]=t,e[5]=a):a=e[5];let c;e[6]!==t?(c=t("settings.mainAgent.itemDescription"),e[6]=t,e[7]=c):c=e[7];let r;e[8]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(Z.Suspense,{fallback:i.jsx(Ee,{className:"h-9 w-[280px]"}),children:i.jsx(gt,{})}),e[8]=r):r=e[8];let m;e[9]!==a||e[10]!==c?(m=i.jsx(ee,{children:i.jsx(Q,{title:a,description:c,action:r})}),e[9]=a,e[10]=c,e[11]=m):m=e[11];let n;return e[12]!==s||e[13]!==l||e[14]!==m?(n=i.jsx(X,{title:s,description:l,children:m}),e[12]=s,e[13]=l,e[14]=m,e[15]=n):n=e[15],n}function ht(){const e=O.c(11),t=P();let s;e[0]!==t?(s=t("settings.review.title"),e[0]=t,e[1]=s):s=e[1];let l;e[2]!==t?(l=t("settings.review.description"),e[2]=t,e[3]=l):l=e[3];let a;e[4]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(H,{flag:"qa_agent_enabled",icon:i.jsx(Re,{size:16}),titleKey:"settings.review.qaAgentTitle",descriptionKey:"settings.review.qaAgentDescription"}),e[4]=a):a=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx(H,{flag:"code_reviewer_enabled",icon:i.jsx(Ke,{size:16}),titleKey:"settings.review.codeReviewerTitle",descriptionKey:"settings.review.codeReviewerDescription"}),e[5]=c):c=e[5];let r;e[6]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(H,{flag:"auto_merge",icon:i.jsx($e,{size:16}),titleKey:"settings.review.autoMergeTitle",descriptionKey:"settings.review.autoMergeDescription"}),e[6]=r):r=e[6];let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsxs(ee,{children:[a,c,r,i.jsx(H,{flag:"auto_assign_report_tasks_to_super_agent",icon:i.jsx(Le,{size:16}),titleKey:"settings.review.autoAssignReportTasksTitle",descriptionKey:"settings.review.autoAssignReportTasksDescription"})]}),e[7]=m):m=e[7];let n;return e[8]!==s||e[9]!==l?(n=i.jsx(X,{title:s,description:l,children:m}),e[8]=s,e[9]=l,e[10]=n):n=e[10],n}function H(e){const t=O.c(23),{flag:s,icon:l,titleKey:a,descriptionKey:c}=e,r=P(),m=Qe(s),n=Ze();let f;t[0]!==r||t[1]!==a?(f=r(a),t[0]=r,t[1]=a,t[2]=f):f=t[2];let o;t[3]!==c||t[4]!==r?(o=r(c),t[3]=c,t[4]=r,t[5]=o):o=t[5];const u=n.isPending;let d;t[6]!==r||t[7]!==a?(d=r(a),t[6]=r,t[7]=a,t[8]=d):d=t[8];let g;t[9]!==s||t[10]!==n||t[11]!==r?(g=S=>n.mutate(s,S,{onError:()=>C.error(r("settings.review.updateError"))}),t[9]=s,t[10]=n,t[11]=r,t[12]=g):g=t[12];let p;t[13]!==m||t[14]!==n.isPending||t[15]!==d||t[16]!==g?(p=i.jsx(Ye,{checked:m,disabled:u,"aria-label":d,onCheckedChange:g}),t[13]=m,t[14]=n.isPending,t[15]=d,t[16]=g,t[17]=p):p=t[17];let x;return t[18]!==l||t[19]!==f||t[20]!==o||t[21]!==p?(x=i.jsx(Q,{icon:l,title:f,description:o,action:p}),t[18]=l,t[19]=f,t[20]=o,t[21]=p,t[22]=x):x=t[22],x}function jt(){const e=O.c(86),t=P(),{org:s}=J(),[l,a]=Z.useState(!1),[c,r]=Z.useState(""),m=He();let n;e[0]!==s.id||e[1]!==m?(n=async()=>{await m.call("ORGANIZATION_DELETE",{id:s.id})},e[0]=s.id,e[1]=m,e[2]=n):n=e[2];let f;e[3]!==s.id||e[4]!==s.slug||e[5]!==t?(f=()=>{ne("organization_deleted",{organization_id:s.id}),localStorage.getItem(ae.lastOrgSlug())===s.slug&&localStorage.removeItem(ae.lastOrgSlug()),Se()?.org===s.slug&&_e(),ve(),C.success(t("settings.deleteOrganizationSection.organizationDeleted")),window.location.href="/"},e[3]=s.id,e[4]=s.slug,e[5]=t,e[6]=f):f=e[6];let o;e[7]!==t?(o=E=>{C.error(E instanceof Error?E.message:t("settings.deleteOrganizationSection.failedToDeleteOrganization"))},e[7]=t,e[8]=o):o=e[8];let u;e[9]!==n||e[10]!==f||e[11]!==o?(u={mutationFn:n,onSuccess:f,onError:o},e[9]=n,e[10]=f,e[11]=o,e[12]=u):u=e[12];const d=le(u);let g;e[13]!==t?(g=t("settings.deleteOrganizationSection.dangerZone"),e[13]=t,e[14]=g):g=e[14];let p;e[15]!==t?(p=t("settings.deleteOrganizationSection.irreversibleActionsDescription"),e[15]=t,e[16]=p):p=e[16];let x;e[17]!==t?(x=t("settings.deleteOrganizationSection.deleteOrganizationTitle"),e[17]=t,e[18]=x):x=e[18];let S;e[19]!==t?(S=t("settings.deleteOrganizationSection.deleteOrganizationDescription"),e[19]=t,e[20]=S):S=e[20];let v;e[21]===Symbol.for("react.memo_cache_sentinel")?(v=()=>a(!0),e[21]=v):v=e[21];const D=d.isPending;let h;e[22]!==t?(h=t("settings.deleteOrganizationSection.deleteButton"),e[22]=t,e[23]=h):h=e[23];let j;e[24]!==d.isPending||e[25]!==h?(j=i.jsx(se,{variant:"destructive",size:"sm",onClick:v,disabled:D,children:h}),e[24]=d.isPending,e[25]=h,e[26]=j):j=e[26];let N;e[27]!==j||e[28]!==x||e[29]!==S?(N=i.jsx(ee,{className:"border-destructive/40",children:i.jsx(Q,{title:x,description:S,action:j})}),e[27]=j,e[28]=x,e[29]=S,e[30]=N):N=e[30];let T;e[31]!==N||e[32]!==g||e[33]!==p?(T=i.jsx(X,{title:g,description:p,children:N}),e[31]=N,e[32]=g,e[33]=p,e[34]=T):T=e[34];let w;e[35]===Symbol.for("react.memo_cache_sentinel")?(w=E=>{a(E),E||r("")},e[35]=w):w=e[35];let F;e[36]!==t?(F=t("settings.deleteOrganizationSection.deleteOrganizationQuestion"),e[36]=t,e[37]=F):F=e[37];let b;e[38]!==F?(b=i.jsx(Je,{children:F}),e[38]=F,e[39]=b):b=e[39];let z;e[40]!==s.name||e[41]!==t?(z=t("settings.deleteOrganizationSection.deleteWarning",{organizationName:s.name}),e[40]=s.name,e[41]=t,e[42]=z):z=e[42];let y;e[43]!==z?(y=i.jsx("p",{children:z}),e[43]=z,e[44]=y):y=e[44];let _;e[45]!==s.name||e[46]!==t?(_=t("settings.deleteOrganizationSection.typeToConfirm",{organizationName:s.name}),e[45]=s.name,e[46]=t,e[47]=_):_=e[47];let A;e[48]!==_?(A=i.jsx("p",{className:"mt-3 mb-1.5",children:_}),e[48]=_,e[49]=A):A=e[49];let R;e[50]===Symbol.for("react.memo_cache_sentinel")?(R=E=>r(E.target.value),e[50]=R):R=e[50];let k;e[51]!==c||e[52]!==s.name?(k=i.jsx(ce,{value:c,onChange:R,placeholder:s.name,autoFocus:!0}),e[51]=c,e[52]=s.name,e[53]=k):k=e[53];let K;e[54]!==y||e[55]!==A||e[56]!==k?(K=i.jsx(Xe,{asChild:!0,children:i.jsxs("div",{children:[y,A,k]})}),e[54]=y,e[55]=A,e[56]=k,e[57]=K):K=e[57];let $;e[58]!==b||e[59]!==K?($=i.jsxs(et,{children:[b,K]}),e[58]=b,e[59]=K,e[60]=$):$=e[60];let L;e[61]!==t?(L=t("settings.deleteOrganizationSection.cancel"),e[61]=t,e[62]=L):L=e[62];let I;e[63]!==L?(I=i.jsx(tt,{children:L}),e[63]=L,e[64]=I):I=e[64];let M;e[65]!==d?(M=()=>d.mutate(),e[65]=d,e[66]=M):M=e[66];const te=c!==s.name||d.isPending;let V;e[67]!==d.isPending||e[68]!==t?(V=d.isPending?t("settings.deleteOrganizationSection.deleting"):t("settings.deleteOrganizationSection.deleteOrganizationAction"),e[67]=d.isPending,e[68]=t,e[69]=V):V=e[69];let q;e[70]!==M||e[71]!==te||e[72]!==V?(q=i.jsx(it,{onClick:M,disabled:te,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90 disabled:opacity-50",children:V}),e[70]=M,e[71]=te,e[72]=V,e[73]=q):q=e[73];let U;e[74]!==I||e[75]!==q?(U=i.jsxs(st,{children:[I,q]}),e[74]=I,e[75]=q,e[76]=U):U=e[76];let B;e[77]!==$||e[78]!==U?(B=i.jsxs(nt,{children:[$,U]}),e[77]=$,e[78]=U,e[79]=B):B=e[79];let G;e[80]!==l||e[81]!==B?(G=i.jsx(ot,{open:l,onOpenChange:w,children:B}),e[80]=l,e[81]=B,e[82]=G):G=e[82];let Y;return e[83]!==T||e[84]!==G?(Y=i.jsxs(i.Fragment,{children:[T,G]}),e[83]=T,e[84]=G,e[85]=Y):Y=e[85],Y}function St(){const e=O.c(12),t=P();let s;e[0]!==t?(s=t("settings.orgGeneral.organization"),e[0]=t,e[1]=s):s=e[1];let l;e[2]!==s?(l=i.jsx(W.Title,{children:s}),e[2]=s,e[3]=l):l=e[3];let a,c,r,m,n,f;e[4]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(lt,{}),c=i.jsx(dt,{}),r=i.jsx(xt,{}),m=i.jsx(ht,{}),n=i.jsx(We,{}),f=i.jsx(jt,{}),e[4]=a,e[5]=c,e[6]=r,e[7]=m,e[8]=n,e[9]=f):(a=e[4],c=e[5],r=e[6],m=e[7],n=e[8],f=e[9]);let o;return e[10]!==l?(o=i.jsx(W,{children:i.jsx(W.Content,{children:i.jsx(W.Body,{children:i.jsxs(Ne,{children:[l,a,c,r,m,n,f]})})})}),e[10]=l,e[11]=o):o=e[11],o}function Ui(){const e=O.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsx(rt,{capability:"org:manage",area:"general settings",children:i.jsx(St,{})}),e[0]=t):t=e[0],t}export{Ui as default};
|
package/dist/client/assets/{github-repo-picker-yxnDF_Mi.js → github-repo-picker-BId4yHDh.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as M,j as t,F as de,a as ye,o as me,r as H,ar as le,b as ee,k as Z,e as ge,t as te,e2 as Ne,K as se,G as ke,n as ve,m as ae,B as re,x as Ce,y as Re}from"./index-vEFJuUdN.js";import{a as we,b as Pe,d as Se,e as Ie}from"./dialog-CF1cQ1rb.js";import{C as Te}from"./collection-search-BzYqusXY.js";import{u as _e}from"./use-debounced-value-CEYSL9GY.js";import{b as he,u as Ee}from"./use-connection-C57YbTcG.js";import{W as Ae,u as ne,S as pe}from"./use-mcp-client-lJgGp2B_.js";import{a as be}from"./authenticate-and-persist-oauth-C-JqvyRh.js";import{i as ue}from"./ArrowLeft-CsWtY_gB.js";import{n as ze}from"./LinkExternal01-B3QGOPZ8.js";import{n as Le}from"./Share07-DS8-754J.js";import{u as Ge}from"./use-mcp-tools-CMs4Nd8q.js";import{e as Oe}from"./extract-connection-data-sVdeut_9.js";import{c as Fe}from"./use-navigate-to-agent-_rWnI-Xt.js";import{g as Ue,p as fe,f as He,G as xe}from"./provision-repo-scoped-github-connection-C2HwF4Ce.js";function D(C){const e=M.c(4),{size:n,className:l}=C;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0016 8c0-4.42-3.58-8-8-8z"}),e[0]=x):x=e[0];let o;return e[1]!==l||e[2]!==n?(o=t.jsx("svg",{width:n,height:n,viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",className:l,children:x}),e[1]=l,e[2]=n,e[3]=o):o=e[3],o}function $e(C,e){const n=M.c(12),{org:l}=de();let x;n[0]!==l.id?(x=Ae.REGISTRY(l.id),n[0]=l.id,n[1]=x):x=n[1];const o=x;let a;n[2]!==l.id||n[3]!==l.slug||n[4]!==o?(a={connectionId:o,orgId:l.id,orgSlug:l.slug},n[2]=l.id,n[3]=l.slug,n[4]=o,n[5]=a):a=n[5];const r=ne(a);let s;n[6]!==C?(s={name:C},n[6]=C,n[7]=s):s=n[7];const u=e?.enabled??!0;let k;return n[8]!==r||n[9]!==s||n[10]!==u?(k={client:r,toolName:"COLLECTION_REGISTRY_APP_GET",toolArguments:s,enabled:u,staleTime:3e5,select:De},n[8]=r,n[9]=s,n[10]=u,n[11]=k):k=n[11],Ge(k)}function De(C){return C.structuredContent?.item??null}const Me="deco/mcp-github";function Be(C){const{org:e}=de(),{data:n}=ye.useSession(),l=he(),x=me(),[o,a]=H.useState("idle"),[r,s]=H.useState(null),[u,k]=H.useState(null),{data:v,isLoading:P}=$e(Me,{enabled:C.enabled}),f=H.useRef(!1);C.enabled&&v&&!P&&!f.current&&n?.user?.id&&o==="idle"&&(f.current=!0,d());async function d(){if(!(!v||!n?.user?.id||!e))try{a("installing"),s(null);const c=Oe(v,e.id,n.user.id,{remoteIndex:0});if(!c.connection_url)throw new Error("Registry item is missing a remote URL for mcp-github");const{id:h}=await l.create.mutateAsync(c);a("authenticating");const y=await be({connectionId:h,orgId:e.id,orgSlug:e.slug,persistFallback:g=>l.update.mutateAsync({id:h,data:{connection_token:g}}).then(()=>{})});if(y.ran&&!y.ok){try{await l.delete.mutateAsync(h)}catch{}throw new Error(y.error&&y.error!=="no token received"?y.error:"No token received from GitHub")}le(x,e.id),k(c),a("ready")}catch(c){s(c instanceof Error?c.message:String(c)),a("error")}}function m(){a("idle"),s(null),k(null),f.current=!1}return C.enabled&&P&&o==="idle"?{status:"installing",error:null,connection:null,retry:m}:{status:o,error:r,connection:u,retry:m}}function dt(C){const e=M.c(27),{open:n,onOpenChange:l,title:x,onImportComplete:o,mode:a}=C,r=a===void 0?"agent":a,s=ee();let u;e[0]!==r||e[1]!==s||e[2]!==x?(u=x??s(r==="connection"?"common.githubRepoPicker.addRepo":"common.githubRepoPicker.importFromGitHub"),e[0]=r,e[1]=s,e[2]=x,e[3]=u):u=e[3];const k=u,[v,P]=H.useState(null);let f;e[4]!==k?(f=t.jsx(we,{className:"sr-only",children:t.jsx(Pe,{children:k})}),e[4]=k,e[5]=f):f=e[5];let d;e[6]!==k||e[7]!==v||e[8]!==s?(d=t.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3 shrink-0",children:v?t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:()=>P(null),className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors shrink-0","aria-label":s("common.githubRepoPicker.backToAccounts"),children:t.jsx(ue,{size:16})}),t.jsx("img",{src:v.avatarUrl,alt:v.login,className:"size-5 rounded-full ring-1 ring-border shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:v.login})]}):t.jsxs(t.Fragment,{children:[t.jsx(D,{className:"size-4 text-foreground shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:k})]})}),e[6]=k,e[7]=v,e[8]=s,e[9]=d):d=e[9];let m;e[10]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(Z,{size:18,className:"animate-spin text-muted-foreground"})}),e[10]=m):m=e[10];let c;e[11]!==l?(c=()=>l(!1),e[11]=l,e[12]=c):c=e[12];let b;e[13]!==r||e[14]!==o||e[15]!==n||e[16]!==v||e[17]!==c?(b=t.jsx("div",{className:"flex-1 overflow-hidden flex flex-col min-w-0",children:t.jsx(H.Suspense,{fallback:m,children:t.jsx(qe,{open:n,onComplete:c,selectedInstallation:v,onSelectInstallation:P,onImportComplete:o,mode:r})})}),e[13]=r,e[14]=o,e[15]=n,e[16]=v,e[17]=c,e[18]=b):b=e[18];let h;e[19]!==f||e[20]!==d||e[21]!==b?(h=t.jsxs(Se,{className:"sm:max-w-[560px] h-[85svh] sm:h-[520px] p-0 gap-0 overflow-hidden flex flex-col",children:[f,d,b]}),e[19]=f,e[20]=d,e[21]=b,e[22]=h):h=e[22];let y;return e[23]!==l||e[24]!==n||e[25]!==h?(y=t.jsx(Ie,{open:n,onOpenChange:l,children:h}),e[23]=l,e[24]=n,e[25]=h,e[26]=y):y=e[26],y}function qe({open:C,onComplete:e,selectedInstallation:n,onSelectInstallation:l,onImportComplete:x,mode:o="agent"}){const a=ee(),{org:r}=de(),s=me(),u=Fe(),[k,v]=H.useState(null),P=Ee({slug:"mcp-github"}),f=Ue(P),d=Be({enabled:C&&f.length===0}),m=f.length===1?f[0]??null:k,c=ne({connectionId:m?.id??"",orgId:r.id,orgSlug:r.slug}),b=ne({connectionId:pe,orgId:r.id,orgSlug:r.slug}),h=async(i,j)=>{try{const I=await c.callTool({name:"get_file_contents",arguments:{owner:i.owner,repo:i.name,path:j}});if(I.isError)return null;const R=I.content?.find(w=>w.type==="resource")?.resource?.text;if(!R)return null;try{const w=JSON.parse(R);return typeof w=="string"?w:JSON.stringify(w)}catch{return R}}catch{return null}},y=(i,j)=>{Promise.all([h(j,"AGENTS.md"),h(j,"CLAUDE.md")]).then(async([N,I])=>{const T=N??I??null;T&&(await b.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:i,data:{metadata:{instructions:T}}}}),le(s,r.id))}).catch(N=>{console.error("GitHub instructions fetch failed:",N)})},g=ge({mutationFn:async i=>{if(!m||!n)throw new Error("No GitHub connection or installation");const j=n.installationId;if(o==="connection"){const{childConnectionId:R}=await fe({orgSlug:r.slug,sourceConnection:m,installationId:j,owner:i.owner,repo:i.name,githubCallTool:w=>c.callTool(w),selfCallTool:w=>b.callTool(w),orgShared:!0});return{virtualMcpId:null,repo:i,connectionId:R,item:null}}const{childConnectionId:N,reused:I}=await fe({orgSlug:r.slug,sourceConnection:m,installationId:j,owner:i.owner,repo:i.name,githubCallTool:R=>c.callTool(R),selfCallTool:R=>b.callTool(R)});let T=null;try{const R=await b.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:i.name,description:i.description||"Imported from GitHub",pinned:!1,icon:null,metadata:{githubRepo:{owner:i.owner,name:i.name,url:i.url,installationId:j,connectionId:N},instructions:null,ui:{pinnedViews:null,layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}},connections:[{connection_id:N}]}}}),w=R.structuredContent??R,_=w.item?.id;if(!w.item||!_)throw new Error("Failed to create the imported agent");return T=_,{virtualMcpId:_,repo:i,connectionId:N,item:w.item}}catch(R){throw T&&await b.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:T}}).catch(()=>{}),I||await b.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:N,force:!0}}).catch(()=>{}),R}},onSuccess:({virtualMcpId:i,repo:j,connectionId:N,item:I})=>{if(o==="connection"||!i||!I){if(le(s,r.id),Ne(s,r.id),x){x({virtualMcpId:null,repo:j,connectionId:N});return}te.success(a("common.githubRepoPicker.addedRepo",{name:j.name})),e();return}if(s.setQueryData(se.collectionItem(b,r.id,"","VIRTUAL_MCP",i),{item:I}),le(s,r.id),y(i,j),x){x({virtualMcpId:i,repo:j,connectionId:N});return}te.success(a("common.githubRepoPicker.importedRepo",{name:j.name})),e(),localStorage.setItem(ke.sidebarOpen(),JSON.stringify(!1)),u(i)},onError:(i,j)=>{console.error("GitHub import failed:",i);const N=i instanceof Error?i.message:a("common.githubRepoPicker.unknownError");if(j.fork&&N.toLowerCase().includes("mint")){te.error(a("common.githubRepoPicker.failedImportFork",{name:j.name}));return}te.error(a("common.githubRepoPicker.failedImport",{error:N}))}});return d.status==="installing"||d.status==="authenticating"?t.jsx(ce,{status:d.status,error:null,retry:d.retry}):d.status==="error"?t.jsx(ce,{status:"error",error:d.error,retry:d.retry}):f.length===0&&d.status==="idle"?t.jsx(ce,{status:"installing",error:null,retry:d.retry}):f.length>1&&!m?t.jsxs("div",{className:"flex flex-col py-2",children:[t.jsx("div",{className:"px-4 py-2",children:t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:a("common.githubRepoPicker.selectConnection")})}),f.map(i=>t.jsxs("button",{type:"button",onClick:()=>v(i),className:"flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left",children:[i.icon?t.jsx("img",{src:i.icon,alt:i.title,className:"size-7 rounded-full shrink-0"}):t.jsx("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:t.jsx(D,{className:"size-3.5 text-muted-foreground"})}),t.jsx("span",{className:"text-sm font-medium",children:i.title})]},i.id))]}):m?n?t.jsx(Ke,{connectionId:m.id,orgId:r.id,orgSlug:r.slug,installation:n,onSelectRepo:i=>g.mutate(i),isSaving:g.isPending}):t.jsx(Qe,{connectionId:m.id,orgId:r.id,orgSlug:r.slug,onSelect:l,showBackButton:f.length>1,onBack:()=>v(null)}):null}function Qe(C){const e=M.c(124),{connectionId:n,orgId:l,orgSlug:x,onSelect:o,showBackButton:a,onBack:r}=C,s=ee();let u;e[0]!==l||e[1]!==x?(u={connectionId:pe,orgId:l,orgSlug:x},e[0]=l,e[1]=x,e[2]=u):u=e[2];const k=ne(u),v=me(),P=he();let f;e[3]!==n||e[4]!==l?(f=se.githubUserOrgs(l,n),e[3]=n,e[4]=l,e[5]=f):f=e[5];let d;e[6]!==n||e[7]!==k?(d=()=>He(p=>k.callTool(p),n),e[6]=n,e[7]=k,e[8]=d):d=e[8];let m;e[9]!==f||e[10]!==d?(m={queryKey:f,queryFn:d},e[9]=f,e[10]=d,e[11]=m):m=e[11];const c=ve(m);let b;e[12]!==P||e[13]!==n||e[14]!==c||e[15]!==l||e[16]!==x||e[17]!==v?(b=async()=>{const p=await be({connectionId:n,orgId:l,orgSlug:x,persistFallback:E=>P.update.mutateAsync({id:n,data:{connection_token:E}}).then(Ve)});if(p.ran&&!p.ok)throw new Error(p.error??"no token received");const S=new URL(`/api/${x}/mcp/${n}`,window.location.origin);await v.invalidateQueries({queryKey:se.isMCPAuthenticated(S.href,null)}),await v.invalidateQueries({queryKey:se.mcpClientPrefix()}),await c.refetch()},e[12]=P,e[13]=n,e[14]=c,e[15]=l,e[16]=x,e[17]=v,e[18]=b):b=e[18];let h;e[19]!==s?(h=p=>{te.error(s("common.githubRepoPicker.failedReconnect",{error:p instanceof Error?p.message:s("common.githubRepoPicker.unknownError")}))},e[19]=s,e[20]=h):h=e[20];let y;e[21]!==b||e[22]!==h?(y={mutationFn:b,onError:h},e[21]=b,e[22]=h,e[23]=y):y=e[23];const g=ge(y);if(c.isLoading){let p;return e[24]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(Z,{size:18,className:"animate-spin text-muted-foreground"})}),e[24]=p):p=e[24],p}if(c.isError){let p;e[25]!==s?(p=s("common.githubRepoPicker.failedLoadAccounts"),e[25]=s,e[26]=p):p=e[26];let S;e[27]!==p?(S=t.jsx("p",{className:"text-sm text-destructive",children:p}),e[27]=p,e[28]=S):S=e[28];let E;e[29]!==s?(E=s("common.githubRepoPicker.connectionExpiredMessage"),e[29]=s,e[30]=E):E=e[30];let A;e[31]!==E?(A=t.jsx("p",{className:"text-xs text-muted-foreground max-w-[280px] leading-relaxed",children:E}),e[31]=E,e[32]=A):A=e[32];let z;e[33]!==g?(z=()=>g.mutate(),e[33]=g,e[34]=z):z=e[34];const $=g.isPending;let L;e[35]!==g.isPending?(L=g.isPending?t.jsx(Z,{size:14,className:"animate-spin"}):t.jsx(D,{className:"size-3.5"}),e[35]=g.isPending,e[36]=L):L=e[36];let G;e[37]!==s?(G=s("common.githubRepoPicker.reconnectGitHub"),e[37]=s,e[38]=G):G=e[38];let O;e[39]!==g.isPending||e[40]!==z||e[41]!==L||e[42]!==G?(O=t.jsxs(re,{type:"button",variant:"outline",size:"sm",onClick:z,disabled:$,children:[L,G]}),e[39]=g.isPending,e[40]=z,e[41]=L,e[42]=G,e[43]=O):O=e[43];let U;return e[44]!==A||e[45]!==O||e[46]!==S?(U=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-6 text-center",children:[S,A,O]}),e[44]=A,e[45]=O,e[46]=S,e[47]=U):U=e[47],U}const i=c.data;if(!i)return null;if(i.installations.length===0){let p;e[48]!==r||e[49]!==a||e[50]!==s?(p=a&&t.jsx("div",{className:"flex items-center gap-1 px-4 pt-3 pb-1 shrink-0",children:t.jsxs("button",{type:"button",onClick:r,className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[t.jsx(ue,{size:12}),s("common.githubRepoPicker.changeConnection")]})}),e[48]=r,e[49]=a,e[50]=s,e[51]=p):p=e[51];let S;e[52]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("div",{className:"size-16 rounded-2xl bg-muted flex items-center justify-center",children:t.jsx(D,{className:"size-8 text-foreground"})}),e[52]=S):S=e[52];let E;e[53]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx("span",{className:"size-1.5 rounded-full bg-success"}),e[53]=E):E=e[53];let A;e[54]!==s?(A=s("common.githubRepoPicker.githubConnected"),e[54]=s,e[55]=A):A=e[55];let z;e[56]!==A?(z=t.jsxs("div",{className:"mt-4 flex items-center gap-1.5 text-xs font-medium text-success",children:[E,A]}),e[56]=A,e[57]=z):z=e[57];let $;e[58]!==s?($=s("common.githubRepoPicker.setupRepositoriesTitle"),e[58]=s,e[59]=$):$=e[59];let L;e[60]!==$?(L=t.jsx("h2",{className:"mt-2 text-base font-semibold text-foreground",children:$}),e[60]=$,e[61]=L):L=e[61];let G;e[62]!==s?(G=s("common.githubRepoPicker.noRepositoriesShared"),e[62]=s,e[63]=G):G=e[63];let O;e[64]!==G?(O=t.jsx("p",{className:"mt-1.5 max-w-[360px] text-xs leading-relaxed text-muted-foreground",children:G}),e[64]=G,e[65]=O):O=e[65];let U;e[66]!==s?(U=s("common.githubRepoPicker.chooseRepositories"),e[66]=s,e[67]=U):U=e[67];let ie;e[68]===Symbol.for("react.memo_cache_sentinel")?(ie=t.jsx(ze,{size:14}),e[68]=ie):ie=e[68];let B;e[69]!==U?(B=t.jsx(re,{asChild:!0,size:"sm",children:t.jsxs("a",{href:xe,target:"_blank",rel:"noopener noreferrer",children:[U,ie]})}),e[69]=U,e[70]=B):B=e[70];let q;e[71]!==c?(q=()=>{c.refetch()},e[71]=c,e[72]=q):q=e[72];const je=c.isFetching;let Q;e[73]!==c.isFetching?(Q=c.isFetching&&t.jsx(Z,{size:14,className:"animate-spin"}),e[73]=c.isFetching,e[74]=Q):Q=e[74];let V;e[75]!==s?(V=s("common.githubRepoPicker.checkAgain"),e[75]=s,e[76]=V):V=e[76];let K;e[77]!==c.isFetching||e[78]!==q||e[79]!==Q||e[80]!==V?(K=t.jsxs(re,{type:"button",variant:"outline",size:"sm",onClick:q,disabled:je,children:[Q,V]}),e[77]=c.isFetching,e[78]=q,e[79]=Q,e[80]=V,e[81]=K):K=e[81];let J;e[82]!==B||e[83]!==K?(J=t.jsxs("div",{className:"mt-5 flex items-center gap-2",children:[B,K]}),e[82]=B,e[83]=K,e[84]=J):J=e[84];let W;e[85]!==s?(W=s("common.githubRepoPicker.repositoryAccessNote"),e[85]=s,e[86]=W):W=e[86];let Y;e[87]!==W?(Y=t.jsx("p",{className:"mt-4 max-w-[360px] rounded-lg bg-muted/50 px-3 py-2 text-xs leading-relaxed text-muted-foreground",children:W}),e[87]=W,e[88]=Y):Y=e[88];let X;e[89]!==z||e[90]!==L||e[91]!==O||e[92]!==J||e[93]!==Y?(X=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center px-8 py-6 text-center",children:[S,z,L,O,J,Y]}),e[89]=z,e[90]=L,e[91]=O,e[92]=J,e[93]=Y,e[94]=X):X=e[94];let oe;return e[95]!==X||e[96]!==p?(oe=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[p,X]}),e[95]=X,e[96]=p,e[97]=oe):oe=e[97],oe}let j;e[98]!==r||e[99]!==a||e[100]!==s?(j=a&&t.jsx("div",{className:"flex items-center gap-1 px-4 pt-3 pb-1 shrink-0",children:t.jsxs("button",{type:"button",onClick:r,className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[t.jsx(ue,{size:12}),s("common.githubRepoPicker.changeConnection")]})}),e[98]=r,e[99]=a,e[100]=s,e[101]=j):j=e[101];let N;if(e[102]!==i.installations||e[103]!==o||e[104]!==s){let p;e[106]!==o||e[107]!==s?(p=S=>t.jsxs("button",{type:"button",onClick:()=>o(S),className:"w-full flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left group",children:[t.jsx("img",{src:S.avatarUrl,alt:S.login,className:"size-7 rounded-full shrink-0 ring-1 ring-border"}),t.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[t.jsx("span",{className:"text-sm font-medium leading-none",children:S.login}),S.type==="User"&&t.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:s("common.githubRepoPicker.personalAccount")})]}),t.jsxs("span",{className:"text-xs text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity shrink-0",children:[s("common.githubRepoPicker.select")," →"]})]},S.installationId),e[106]=o,e[107]=s,e[108]=p):p=e[108],N=i.installations.map(p),e[102]=i.installations,e[103]=o,e[104]=s,e[105]=N}else N=e[105];let I;e[109]!==N?(I=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden [scrollbar-gutter:stable]",children:N}),e[109]=N,e[110]=I):I=e[110];let T;e[111]!==s?(T=s("common.githubRepoPicker.accountNotListed"),e[111]=s,e[112]=T):T=e[112];let R;e[113]!==s?(R=s("common.githubRepoPicker.installGitHubApp"),e[113]=s,e[114]=R):R=e[114];let w;e[115]!==R?(w=t.jsx("span",{className:"underline underline-offset-2",children:R}),e[115]=R,e[116]=w):w=e[116];let _;e[117]!==T||e[118]!==w?(_=t.jsx("div",{className:"px-4 py-3 border-t border-border shrink-0",children:t.jsxs("a",{href:xe,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:[T," ",w]})}),e[117]=T,e[118]=w,e[119]=_):_=e[119];let F;return e[120]!==I||e[121]!==_||e[122]!==j?(F=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[j,I,_]}),e[120]=I,e[121]=_,e[122]=j,e[123]=F):F=e[123],F}function Ve(){}function Ke(C){const e=M.c(23),{connectionId:n,orgId:l,orgSlug:x,installation:o,onSelectRepo:a,isSaving:r}=C,s=ee(),[u,k]=H.useState(""),v=_e(u,300),P=H.useDeferredValue(v),f=u!==P;let d;e[0]!==s?(d=s("common.githubRepoPicker.searchRepositories"),e[0]=s,e[1]=d):d=e[1];let m;e[2]!==f||e[3]!==u||e[4]!==d?(m=t.jsx(Te,{placeholder:d,value:u,onChange:k,isSearching:f}),e[2]=f,e[3]=u,e[4]=d,e[5]=m):m=e[5];const c=f?"opacity-40":"opacity-100";let b;e[6]!==c?(b=ae("flex-1 overflow-hidden flex flex-col transition-opacity duration-150",c),e[6]=c,e[7]=b):b=e[7];let h;e[8]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(Z,{size:18,className:"animate-spin text-muted-foreground"})}),e[8]=h):h=e[8];let y;e[9]!==n||e[10]!==P||e[11]!==o||e[12]!==r||e[13]!==a||e[14]!==l||e[15]!==x?(y=t.jsx(H.Suspense,{fallback:h,children:t.jsx(Je,{connectionId:n,orgId:l,orgSlug:x,installation:o,query:P,onSelectRepo:a,isSaving:r})}),e[9]=n,e[10]=P,e[11]=o,e[12]=r,e[13]=a,e[14]=l,e[15]=x,e[16]=y):y=e[16];let g;e[17]!==b||e[18]!==y?(g=t.jsx("div",{className:b,children:y}),e[17]=b,e[18]=y,e[19]=g):g=e[19];let i;return e[20]!==m||e[21]!==g?(i=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[m,g]}),e[20]=m,e[21]=g,e[22]=i):i=e[22],i}function Je(C){const e=M.c(36),{connectionId:n,orgId:l,orgSlug:x,installation:o,query:a,onSelectRepo:r,isSaving:s}=C,u=ee();let k;e[0]!==n||e[1]!==l||e[2]!==x?(k={connectionId:n,orgId:l,orgSlug:x},e[0]=n,e[1]=l,e[2]=x,e[3]=k):k=e[3];const v=ne(k),P=o.type==="User"?"user":"org",f=a?`${P}:${o.login} ${a} in:name fork:true`:`${P}:${o.login} fork:true`;let d;e[4]!==n||e[5]!==o.login||e[6]!==l||e[7]!==a?(d=se.githubOrgRepos(l,n,o.login,a),e[4]=n,e[5]=o.login,e[6]=l,e[7]=a,e[8]=d):d=e[8];let m;e[9]!==v||e[10]!==f?(m=async g=>{const{signal:i}=g,N=(await v.callTool({name:"search_repositories",arguments:{query:f,page:1,perPage:30}},void 0,{signal:i})).content?.[0]?.text;if(!N)throw new Error("No response from search_repositories");return(JSON.parse(N).items??[]).map(We)},e[9]=v,e[10]=f,e[11]=m):m=e[11];let c;e[12]!==d||e[13]!==m?(c={queryKey:d,queryFn:m},e[12]=d,e[13]=m,e[14]=c):c=e[14];const{data:b}=Ce(c);if(b.length===0){let g;e[15]!==u?(g=u("common.githubRepoPicker.noRepositoriesFound"),e[15]=u,e[16]=g):g=e[16];let i;e[17]!==g?(i=t.jsx("p",{className:"text-sm text-muted-foreground",children:g}),e[17]=g,e[18]=i):i=e[18];let j;e[19]!==a||e[20]!==u?(j=a&&t.jsx("p",{className:"text-xs text-muted-foreground/60",children:u("common.githubRepoPicker.tryDifferentSearchTerm")}),e[19]=a,e[20]=u,e[21]=j):j=e[21];let N;return e[22]!==i||e[23]!==j?(N=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-1",children:[i,j]}),e[22]=i,e[23]=j,e[24]=N):N=e[24],N}let h;if(e[25]!==s||e[26]!==r||e[27]!==b||e[28]!==u){let g;e[30]!==s||e[31]!==r||e[32]!==u?(g=i=>t.jsxs("button",{type:"button",onClick:()=>r(i),disabled:s,className:"flex items-start gap-3 px-4 py-3 hover:bg-accent transition-colors text-left disabled:opacity-50 disabled:cursor-not-allowed",children:[t.jsx(D,{className:"size-4 text-muted-foreground mt-0.5 shrink-0"}),t.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[t.jsx("span",{className:"text-sm font-medium truncate",children:i.name}),i.fork&&t.jsx("span",{className:"text-xs font-medium text-muted-foreground border border-border rounded px-1.5 py-0.5 shrink-0 leading-none",children:u("common.githubRepoPicker.forkBadge")})]}),t.jsxs("span",{className:"flex items-center gap-1 text-xs font-medium text-muted-foreground border border-border rounded px-1.5 py-0.5 shrink-0 leading-none",children:[i.private?t.jsx(Re,{size:10}):t.jsx(Le,{size:10}),i.private?u("common.githubRepoPicker.private"):u("common.githubRepoPicker.public")]})]},i.fullName),e[30]=s,e[31]=r,e[32]=u,e[33]=g):g=e[33],h=b.map(g),e[25]=s,e[26]=r,e[27]=b,e[28]=u,e[29]=h}else h=e[29];let y;return e[34]!==h?(y=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden flex flex-col [scrollbar-gutter:stable]",children:h}),e[34]=h,e[35]=y):y=e[35],y}function We(C){return{name:C.name,fullName:C.full_name,owner:C.full_name.split("/")[0]??"",url:C.html_url,private:C.private,description:C.description,updatedAt:C.updated_at,fork:C.fork??!1}}function ce(C){const e=M.c(51),{status:n,error:l,retry:x}=C,o=ee();if(n==="error"){let N;e[0]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("div",{className:"size-10 rounded-full bg-destructive/10 flex items-center justify-center",children:t.jsx(D,{className:"size-5 text-destructive"})}),e[0]=N):N=e[0];let I;e[1]!==o?(I=o("common.githubRepoPicker.connectionFailed"),e[1]=o,e[2]=I):I=e[2];let T;e[3]!==I?(T=t.jsx("p",{className:"text-sm font-medium",children:I}),e[3]=I,e[4]=T):T=e[4];let R;e[5]!==l||e[6]!==o?(R=l??o("common.githubRepoPicker.somethingWentWrong"),e[5]=l,e[6]=o,e[7]=R):R=e[7];let w;e[8]!==R?(w=t.jsx("p",{className:"text-xs text-muted-foreground max-w-[260px] leading-relaxed",children:R}),e[8]=R,e[9]=w):w=e[9];let _;e[10]!==T||e[11]!==w?(_=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[T,w]}),e[10]=T,e[11]=w,e[12]=_):_=e[12];let F;e[13]!==o?(F=o("common.githubRepoPicker.tryAgain"),e[13]=o,e[14]=F):F=e[14];let p;e[15]!==x||e[16]!==F?(p=t.jsx("button",{type:"button",onClick:x,className:"text-xs font-medium text-foreground border border-border rounded-md px-3 py-1.5 hover:bg-accent transition-colors",children:F}),e[15]=x,e[16]=F,e[17]=p):p=e[17];let S;return e[18]!==_||e[19]!==p?(S=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[N,_,p]}),e[18]=_,e[19]=p,e[20]=S):S=e[20],S}const a=n==="authenticating";let r;e[21]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"size-10 rounded-full bg-muted flex items-center justify-center",children:t.jsx(D,{className:"size-5 text-foreground"})}),e[21]=r):r=e[21];let s;e[22]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsxs("div",{className:"relative size-10",children:[r,t.jsx("div",{className:"absolute -bottom-0.5 -right-0.5 size-4 rounded-full bg-background flex items-center justify-center",children:t.jsx(Z,{size:12,className:"animate-spin text-muted-foreground"})})]}),e[22]=s):s=e[22];let u;e[23]!==a||e[24]!==o?(u=o(a?"common.githubRepoPicker.authenticatingGitHub":"common.githubRepoPicker.settingUpGitHub"),e[23]=a,e[24]=o,e[25]=u):u=e[25];let k;e[26]!==u?(k=t.jsx("p",{className:"text-sm font-medium",children:u}),e[26]=u,e[27]=k):k=e[27];let v;e[28]!==a||e[29]!==o?(v=o(a?"common.githubRepoPicker.completeOAuthFlow":"common.githubRepoPicker.installingGitHubConnection"),e[28]=a,e[29]=o,e[30]=v):v=e[30];let P;e[31]!==v?(P=t.jsx("p",{className:"text-xs text-muted-foreground",children:v}),e[31]=v,e[32]=P):P=e[32];let f;e[33]!==k||e[34]!==P?(f=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[k,P]}),e[33]=k,e[34]=P,e[35]=f):f=e[35];const d=a?"bg-muted-foreground/30":"bg-foreground animate-pulse";let m;e[36]!==d?(m=ae("size-1.5 rounded-full",d),e[36]=d,e[37]=m):m=e[37];let c;e[38]!==m?(c=t.jsx("span",{className:m}),e[38]=m,e[39]=c):c=e[39];const b=a?"bg-foreground animate-pulse":"bg-muted-foreground/30";let h;e[40]!==b?(h=ae("size-1.5 rounded-full",b),e[40]=b,e[41]=h):h=e[41];let y;e[42]!==h?(y=t.jsx("span",{className:h}),e[42]=h,e[43]=y):y=e[43];let g;e[44]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("span",{className:"size-1.5 rounded-full bg-muted-foreground/30"}),e[44]=g):g=e[44];let i;e[45]!==c||e[46]!==y?(i=t.jsxs("div",{className:"flex items-center gap-1.5",children:[c,y,g]}),e[45]=c,e[46]=y,e[47]=i):i=e[47];let j;return e[48]!==i||e[49]!==f?(j=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[s,f,i]}),e[48]=i,e[49]=f,e[50]=j):j=e[50],j}export{D as G,dt as a,Be as b,$e as u};
|
|
1
|
+
import{c as M,j as t,F as de,a as ye,o as me,r as H,ar as le,b as ee,k as Z,e as ge,t as te,e2 as Ne,K as se,G as ke,n as ve,m as ae,B as re,x as Ce,y as Re}from"./index-Bfy-Fe7V.js";import{a as we,b as Pe,d as Se,e as Ie}from"./dialog-7h2q_S_D.js";import{C as Te}from"./collection-search-Cwveue76.js";import{u as _e}from"./use-debounced-value-BolYSN9R.js";import{b as he,u as Ee}from"./use-connection-niAftPf5.js";import{W as Ae,u as ne,S as pe}from"./use-mcp-client-CMZDCFwV.js";import{a as be}from"./authenticate-and-persist-oauth-COCTTCRF.js";import{i as ue}from"./ArrowLeft-Bo0FpGQs.js";import{n as ze}from"./LinkExternal01-CLr9HZg0.js";import{n as Le}from"./Share07-C1_p27Hs.js";import{u as Ge}from"./use-mcp-tools-DcIN6xvI.js";import{e as Oe}from"./extract-connection-data-BKY0ec6n.js";import{c as Fe}from"./use-navigate-to-agent-ChzmcYSy.js";import{g as Ue,p as fe,f as He,G as xe}from"./provision-repo-scoped-github-connection-C2HwF4Ce.js";function D(C){const e=M.c(4),{size:n,className:l}=C;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0016 8c0-4.42-3.58-8-8-8z"}),e[0]=x):x=e[0];let o;return e[1]!==l||e[2]!==n?(o=t.jsx("svg",{width:n,height:n,viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",className:l,children:x}),e[1]=l,e[2]=n,e[3]=o):o=e[3],o}function $e(C,e){const n=M.c(12),{org:l}=de();let x;n[0]!==l.id?(x=Ae.REGISTRY(l.id),n[0]=l.id,n[1]=x):x=n[1];const o=x;let a;n[2]!==l.id||n[3]!==l.slug||n[4]!==o?(a={connectionId:o,orgId:l.id,orgSlug:l.slug},n[2]=l.id,n[3]=l.slug,n[4]=o,n[5]=a):a=n[5];const r=ne(a);let s;n[6]!==C?(s={name:C},n[6]=C,n[7]=s):s=n[7];const u=e?.enabled??!0;let k;return n[8]!==r||n[9]!==s||n[10]!==u?(k={client:r,toolName:"COLLECTION_REGISTRY_APP_GET",toolArguments:s,enabled:u,staleTime:3e5,select:De},n[8]=r,n[9]=s,n[10]=u,n[11]=k):k=n[11],Ge(k)}function De(C){return C.structuredContent?.item??null}const Me="deco/mcp-github";function Be(C){const{org:e}=de(),{data:n}=ye.useSession(),l=he(),x=me(),[o,a]=H.useState("idle"),[r,s]=H.useState(null),[u,k]=H.useState(null),{data:v,isLoading:P}=$e(Me,{enabled:C.enabled}),f=H.useRef(!1);C.enabled&&v&&!P&&!f.current&&n?.user?.id&&o==="idle"&&(f.current=!0,d());async function d(){if(!(!v||!n?.user?.id||!e))try{a("installing"),s(null);const c=Oe(v,e.id,n.user.id,{remoteIndex:0});if(!c.connection_url)throw new Error("Registry item is missing a remote URL for mcp-github");const{id:h}=await l.create.mutateAsync(c);a("authenticating");const y=await be({connectionId:h,orgId:e.id,orgSlug:e.slug,persistFallback:g=>l.update.mutateAsync({id:h,data:{connection_token:g}}).then(()=>{})});if(y.ran&&!y.ok){try{await l.delete.mutateAsync(h)}catch{}throw new Error(y.error&&y.error!=="no token received"?y.error:"No token received from GitHub")}le(x,e.id),k(c),a("ready")}catch(c){s(c instanceof Error?c.message:String(c)),a("error")}}function m(){a("idle"),s(null),k(null),f.current=!1}return C.enabled&&P&&o==="idle"?{status:"installing",error:null,connection:null,retry:m}:{status:o,error:r,connection:u,retry:m}}function dt(C){const e=M.c(27),{open:n,onOpenChange:l,title:x,onImportComplete:o,mode:a}=C,r=a===void 0?"agent":a,s=ee();let u;e[0]!==r||e[1]!==s||e[2]!==x?(u=x??s(r==="connection"?"common.githubRepoPicker.addRepo":"common.githubRepoPicker.importFromGitHub"),e[0]=r,e[1]=s,e[2]=x,e[3]=u):u=e[3];const k=u,[v,P]=H.useState(null);let f;e[4]!==k?(f=t.jsx(we,{className:"sr-only",children:t.jsx(Pe,{children:k})}),e[4]=k,e[5]=f):f=e[5];let d;e[6]!==k||e[7]!==v||e[8]!==s?(d=t.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3 shrink-0",children:v?t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:()=>P(null),className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors shrink-0","aria-label":s("common.githubRepoPicker.backToAccounts"),children:t.jsx(ue,{size:16})}),t.jsx("img",{src:v.avatarUrl,alt:v.login,className:"size-5 rounded-full ring-1 ring-border shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:v.login})]}):t.jsxs(t.Fragment,{children:[t.jsx(D,{className:"size-4 text-foreground shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:k})]})}),e[6]=k,e[7]=v,e[8]=s,e[9]=d):d=e[9];let m;e[10]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(Z,{size:18,className:"animate-spin text-muted-foreground"})}),e[10]=m):m=e[10];let c;e[11]!==l?(c=()=>l(!1),e[11]=l,e[12]=c):c=e[12];let b;e[13]!==r||e[14]!==o||e[15]!==n||e[16]!==v||e[17]!==c?(b=t.jsx("div",{className:"flex-1 overflow-hidden flex flex-col min-w-0",children:t.jsx(H.Suspense,{fallback:m,children:t.jsx(qe,{open:n,onComplete:c,selectedInstallation:v,onSelectInstallation:P,onImportComplete:o,mode:r})})}),e[13]=r,e[14]=o,e[15]=n,e[16]=v,e[17]=c,e[18]=b):b=e[18];let h;e[19]!==f||e[20]!==d||e[21]!==b?(h=t.jsxs(Se,{className:"sm:max-w-[560px] h-[85svh] sm:h-[520px] p-0 gap-0 overflow-hidden flex flex-col",children:[f,d,b]}),e[19]=f,e[20]=d,e[21]=b,e[22]=h):h=e[22];let y;return e[23]!==l||e[24]!==n||e[25]!==h?(y=t.jsx(Ie,{open:n,onOpenChange:l,children:h}),e[23]=l,e[24]=n,e[25]=h,e[26]=y):y=e[26],y}function qe({open:C,onComplete:e,selectedInstallation:n,onSelectInstallation:l,onImportComplete:x,mode:o="agent"}){const a=ee(),{org:r}=de(),s=me(),u=Fe(),[k,v]=H.useState(null),P=Ee({slug:"mcp-github"}),f=Ue(P),d=Be({enabled:C&&f.length===0}),m=f.length===1?f[0]??null:k,c=ne({connectionId:m?.id??"",orgId:r.id,orgSlug:r.slug}),b=ne({connectionId:pe,orgId:r.id,orgSlug:r.slug}),h=async(i,j)=>{try{const I=await c.callTool({name:"get_file_contents",arguments:{owner:i.owner,repo:i.name,path:j}});if(I.isError)return null;const R=I.content?.find(w=>w.type==="resource")?.resource?.text;if(!R)return null;try{const w=JSON.parse(R);return typeof w=="string"?w:JSON.stringify(w)}catch{return R}}catch{return null}},y=(i,j)=>{Promise.all([h(j,"AGENTS.md"),h(j,"CLAUDE.md")]).then(async([N,I])=>{const T=N??I??null;T&&(await b.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:i,data:{metadata:{instructions:T}}}}),le(s,r.id))}).catch(N=>{console.error("GitHub instructions fetch failed:",N)})},g=ge({mutationFn:async i=>{if(!m||!n)throw new Error("No GitHub connection or installation");const j=n.installationId;if(o==="connection"){const{childConnectionId:R}=await fe({orgSlug:r.slug,sourceConnection:m,installationId:j,owner:i.owner,repo:i.name,githubCallTool:w=>c.callTool(w),selfCallTool:w=>b.callTool(w),orgShared:!0});return{virtualMcpId:null,repo:i,connectionId:R,item:null}}const{childConnectionId:N,reused:I}=await fe({orgSlug:r.slug,sourceConnection:m,installationId:j,owner:i.owner,repo:i.name,githubCallTool:R=>c.callTool(R),selfCallTool:R=>b.callTool(R)});let T=null;try{const R=await b.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:i.name,description:i.description||"Imported from GitHub",pinned:!1,icon:null,metadata:{githubRepo:{owner:i.owner,name:i.name,url:i.url,installationId:j,connectionId:N},instructions:null,ui:{pinnedViews:null,layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}},connections:[{connection_id:N}]}}}),w=R.structuredContent??R,_=w.item?.id;if(!w.item||!_)throw new Error("Failed to create the imported agent");return T=_,{virtualMcpId:_,repo:i,connectionId:N,item:w.item}}catch(R){throw T&&await b.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:T}}).catch(()=>{}),I||await b.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:N,force:!0}}).catch(()=>{}),R}},onSuccess:({virtualMcpId:i,repo:j,connectionId:N,item:I})=>{if(o==="connection"||!i||!I){if(le(s,r.id),Ne(s,r.id),x){x({virtualMcpId:null,repo:j,connectionId:N});return}te.success(a("common.githubRepoPicker.addedRepo",{name:j.name})),e();return}if(s.setQueryData(se.collectionItem(b,r.id,"","VIRTUAL_MCP",i),{item:I}),le(s,r.id),y(i,j),x){x({virtualMcpId:i,repo:j,connectionId:N});return}te.success(a("common.githubRepoPicker.importedRepo",{name:j.name})),e(),localStorage.setItem(ke.sidebarOpen(),JSON.stringify(!1)),u(i)},onError:(i,j)=>{console.error("GitHub import failed:",i);const N=i instanceof Error?i.message:a("common.githubRepoPicker.unknownError");if(j.fork&&N.toLowerCase().includes("mint")){te.error(a("common.githubRepoPicker.failedImportFork",{name:j.name}));return}te.error(a("common.githubRepoPicker.failedImport",{error:N}))}});return d.status==="installing"||d.status==="authenticating"?t.jsx(ce,{status:d.status,error:null,retry:d.retry}):d.status==="error"?t.jsx(ce,{status:"error",error:d.error,retry:d.retry}):f.length===0&&d.status==="idle"?t.jsx(ce,{status:"installing",error:null,retry:d.retry}):f.length>1&&!m?t.jsxs("div",{className:"flex flex-col py-2",children:[t.jsx("div",{className:"px-4 py-2",children:t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:a("common.githubRepoPicker.selectConnection")})}),f.map(i=>t.jsxs("button",{type:"button",onClick:()=>v(i),className:"flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left",children:[i.icon?t.jsx("img",{src:i.icon,alt:i.title,className:"size-7 rounded-full shrink-0"}):t.jsx("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:t.jsx(D,{className:"size-3.5 text-muted-foreground"})}),t.jsx("span",{className:"text-sm font-medium",children:i.title})]},i.id))]}):m?n?t.jsx(Ke,{connectionId:m.id,orgId:r.id,orgSlug:r.slug,installation:n,onSelectRepo:i=>g.mutate(i),isSaving:g.isPending}):t.jsx(Qe,{connectionId:m.id,orgId:r.id,orgSlug:r.slug,onSelect:l,showBackButton:f.length>1,onBack:()=>v(null)}):null}function Qe(C){const e=M.c(124),{connectionId:n,orgId:l,orgSlug:x,onSelect:o,showBackButton:a,onBack:r}=C,s=ee();let u;e[0]!==l||e[1]!==x?(u={connectionId:pe,orgId:l,orgSlug:x},e[0]=l,e[1]=x,e[2]=u):u=e[2];const k=ne(u),v=me(),P=he();let f;e[3]!==n||e[4]!==l?(f=se.githubUserOrgs(l,n),e[3]=n,e[4]=l,e[5]=f):f=e[5];let d;e[6]!==n||e[7]!==k?(d=()=>He(p=>k.callTool(p),n),e[6]=n,e[7]=k,e[8]=d):d=e[8];let m;e[9]!==f||e[10]!==d?(m={queryKey:f,queryFn:d},e[9]=f,e[10]=d,e[11]=m):m=e[11];const c=ve(m);let b;e[12]!==P||e[13]!==n||e[14]!==c||e[15]!==l||e[16]!==x||e[17]!==v?(b=async()=>{const p=await be({connectionId:n,orgId:l,orgSlug:x,persistFallback:E=>P.update.mutateAsync({id:n,data:{connection_token:E}}).then(Ve)});if(p.ran&&!p.ok)throw new Error(p.error??"no token received");const S=new URL(`/api/${x}/mcp/${n}`,window.location.origin);await v.invalidateQueries({queryKey:se.isMCPAuthenticated(S.href,null)}),await v.invalidateQueries({queryKey:se.mcpClientPrefix()}),await c.refetch()},e[12]=P,e[13]=n,e[14]=c,e[15]=l,e[16]=x,e[17]=v,e[18]=b):b=e[18];let h;e[19]!==s?(h=p=>{te.error(s("common.githubRepoPicker.failedReconnect",{error:p instanceof Error?p.message:s("common.githubRepoPicker.unknownError")}))},e[19]=s,e[20]=h):h=e[20];let y;e[21]!==b||e[22]!==h?(y={mutationFn:b,onError:h},e[21]=b,e[22]=h,e[23]=y):y=e[23];const g=ge(y);if(c.isLoading){let p;return e[24]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(Z,{size:18,className:"animate-spin text-muted-foreground"})}),e[24]=p):p=e[24],p}if(c.isError){let p;e[25]!==s?(p=s("common.githubRepoPicker.failedLoadAccounts"),e[25]=s,e[26]=p):p=e[26];let S;e[27]!==p?(S=t.jsx("p",{className:"text-sm text-destructive",children:p}),e[27]=p,e[28]=S):S=e[28];let E;e[29]!==s?(E=s("common.githubRepoPicker.connectionExpiredMessage"),e[29]=s,e[30]=E):E=e[30];let A;e[31]!==E?(A=t.jsx("p",{className:"text-xs text-muted-foreground max-w-[280px] leading-relaxed",children:E}),e[31]=E,e[32]=A):A=e[32];let z;e[33]!==g?(z=()=>g.mutate(),e[33]=g,e[34]=z):z=e[34];const $=g.isPending;let L;e[35]!==g.isPending?(L=g.isPending?t.jsx(Z,{size:14,className:"animate-spin"}):t.jsx(D,{className:"size-3.5"}),e[35]=g.isPending,e[36]=L):L=e[36];let G;e[37]!==s?(G=s("common.githubRepoPicker.reconnectGitHub"),e[37]=s,e[38]=G):G=e[38];let O;e[39]!==g.isPending||e[40]!==z||e[41]!==L||e[42]!==G?(O=t.jsxs(re,{type:"button",variant:"outline",size:"sm",onClick:z,disabled:$,children:[L,G]}),e[39]=g.isPending,e[40]=z,e[41]=L,e[42]=G,e[43]=O):O=e[43];let U;return e[44]!==A||e[45]!==O||e[46]!==S?(U=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-6 text-center",children:[S,A,O]}),e[44]=A,e[45]=O,e[46]=S,e[47]=U):U=e[47],U}const i=c.data;if(!i)return null;if(i.installations.length===0){let p;e[48]!==r||e[49]!==a||e[50]!==s?(p=a&&t.jsx("div",{className:"flex items-center gap-1 px-4 pt-3 pb-1 shrink-0",children:t.jsxs("button",{type:"button",onClick:r,className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[t.jsx(ue,{size:12}),s("common.githubRepoPicker.changeConnection")]})}),e[48]=r,e[49]=a,e[50]=s,e[51]=p):p=e[51];let S;e[52]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("div",{className:"size-16 rounded-2xl bg-muted flex items-center justify-center",children:t.jsx(D,{className:"size-8 text-foreground"})}),e[52]=S):S=e[52];let E;e[53]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx("span",{className:"size-1.5 rounded-full bg-success"}),e[53]=E):E=e[53];let A;e[54]!==s?(A=s("common.githubRepoPicker.githubConnected"),e[54]=s,e[55]=A):A=e[55];let z;e[56]!==A?(z=t.jsxs("div",{className:"mt-4 flex items-center gap-1.5 text-xs font-medium text-success",children:[E,A]}),e[56]=A,e[57]=z):z=e[57];let $;e[58]!==s?($=s("common.githubRepoPicker.setupRepositoriesTitle"),e[58]=s,e[59]=$):$=e[59];let L;e[60]!==$?(L=t.jsx("h2",{className:"mt-2 text-base font-semibold text-foreground",children:$}),e[60]=$,e[61]=L):L=e[61];let G;e[62]!==s?(G=s("common.githubRepoPicker.noRepositoriesShared"),e[62]=s,e[63]=G):G=e[63];let O;e[64]!==G?(O=t.jsx("p",{className:"mt-1.5 max-w-[360px] text-xs leading-relaxed text-muted-foreground",children:G}),e[64]=G,e[65]=O):O=e[65];let U;e[66]!==s?(U=s("common.githubRepoPicker.chooseRepositories"),e[66]=s,e[67]=U):U=e[67];let ie;e[68]===Symbol.for("react.memo_cache_sentinel")?(ie=t.jsx(ze,{size:14}),e[68]=ie):ie=e[68];let B;e[69]!==U?(B=t.jsx(re,{asChild:!0,size:"sm",children:t.jsxs("a",{href:xe,target:"_blank",rel:"noopener noreferrer",children:[U,ie]})}),e[69]=U,e[70]=B):B=e[70];let q;e[71]!==c?(q=()=>{c.refetch()},e[71]=c,e[72]=q):q=e[72];const je=c.isFetching;let Q;e[73]!==c.isFetching?(Q=c.isFetching&&t.jsx(Z,{size:14,className:"animate-spin"}),e[73]=c.isFetching,e[74]=Q):Q=e[74];let V;e[75]!==s?(V=s("common.githubRepoPicker.checkAgain"),e[75]=s,e[76]=V):V=e[76];let K;e[77]!==c.isFetching||e[78]!==q||e[79]!==Q||e[80]!==V?(K=t.jsxs(re,{type:"button",variant:"outline",size:"sm",onClick:q,disabled:je,children:[Q,V]}),e[77]=c.isFetching,e[78]=q,e[79]=Q,e[80]=V,e[81]=K):K=e[81];let J;e[82]!==B||e[83]!==K?(J=t.jsxs("div",{className:"mt-5 flex items-center gap-2",children:[B,K]}),e[82]=B,e[83]=K,e[84]=J):J=e[84];let W;e[85]!==s?(W=s("common.githubRepoPicker.repositoryAccessNote"),e[85]=s,e[86]=W):W=e[86];let Y;e[87]!==W?(Y=t.jsx("p",{className:"mt-4 max-w-[360px] rounded-lg bg-muted/50 px-3 py-2 text-xs leading-relaxed text-muted-foreground",children:W}),e[87]=W,e[88]=Y):Y=e[88];let X;e[89]!==z||e[90]!==L||e[91]!==O||e[92]!==J||e[93]!==Y?(X=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center px-8 py-6 text-center",children:[S,z,L,O,J,Y]}),e[89]=z,e[90]=L,e[91]=O,e[92]=J,e[93]=Y,e[94]=X):X=e[94];let oe;return e[95]!==X||e[96]!==p?(oe=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[p,X]}),e[95]=X,e[96]=p,e[97]=oe):oe=e[97],oe}let j;e[98]!==r||e[99]!==a||e[100]!==s?(j=a&&t.jsx("div",{className:"flex items-center gap-1 px-4 pt-3 pb-1 shrink-0",children:t.jsxs("button",{type:"button",onClick:r,className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[t.jsx(ue,{size:12}),s("common.githubRepoPicker.changeConnection")]})}),e[98]=r,e[99]=a,e[100]=s,e[101]=j):j=e[101];let N;if(e[102]!==i.installations||e[103]!==o||e[104]!==s){let p;e[106]!==o||e[107]!==s?(p=S=>t.jsxs("button",{type:"button",onClick:()=>o(S),className:"w-full flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left group",children:[t.jsx("img",{src:S.avatarUrl,alt:S.login,className:"size-7 rounded-full shrink-0 ring-1 ring-border"}),t.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[t.jsx("span",{className:"text-sm font-medium leading-none",children:S.login}),S.type==="User"&&t.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:s("common.githubRepoPicker.personalAccount")})]}),t.jsxs("span",{className:"text-xs text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity shrink-0",children:[s("common.githubRepoPicker.select")," →"]})]},S.installationId),e[106]=o,e[107]=s,e[108]=p):p=e[108],N=i.installations.map(p),e[102]=i.installations,e[103]=o,e[104]=s,e[105]=N}else N=e[105];let I;e[109]!==N?(I=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden [scrollbar-gutter:stable]",children:N}),e[109]=N,e[110]=I):I=e[110];let T;e[111]!==s?(T=s("common.githubRepoPicker.accountNotListed"),e[111]=s,e[112]=T):T=e[112];let R;e[113]!==s?(R=s("common.githubRepoPicker.installGitHubApp"),e[113]=s,e[114]=R):R=e[114];let w;e[115]!==R?(w=t.jsx("span",{className:"underline underline-offset-2",children:R}),e[115]=R,e[116]=w):w=e[116];let _;e[117]!==T||e[118]!==w?(_=t.jsx("div",{className:"px-4 py-3 border-t border-border shrink-0",children:t.jsxs("a",{href:xe,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:[T," ",w]})}),e[117]=T,e[118]=w,e[119]=_):_=e[119];let F;return e[120]!==I||e[121]!==_||e[122]!==j?(F=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[j,I,_]}),e[120]=I,e[121]=_,e[122]=j,e[123]=F):F=e[123],F}function Ve(){}function Ke(C){const e=M.c(23),{connectionId:n,orgId:l,orgSlug:x,installation:o,onSelectRepo:a,isSaving:r}=C,s=ee(),[u,k]=H.useState(""),v=_e(u,300),P=H.useDeferredValue(v),f=u!==P;let d;e[0]!==s?(d=s("common.githubRepoPicker.searchRepositories"),e[0]=s,e[1]=d):d=e[1];let m;e[2]!==f||e[3]!==u||e[4]!==d?(m=t.jsx(Te,{placeholder:d,value:u,onChange:k,isSearching:f}),e[2]=f,e[3]=u,e[4]=d,e[5]=m):m=e[5];const c=f?"opacity-40":"opacity-100";let b;e[6]!==c?(b=ae("flex-1 overflow-hidden flex flex-col transition-opacity duration-150",c),e[6]=c,e[7]=b):b=e[7];let h;e[8]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(Z,{size:18,className:"animate-spin text-muted-foreground"})}),e[8]=h):h=e[8];let y;e[9]!==n||e[10]!==P||e[11]!==o||e[12]!==r||e[13]!==a||e[14]!==l||e[15]!==x?(y=t.jsx(H.Suspense,{fallback:h,children:t.jsx(Je,{connectionId:n,orgId:l,orgSlug:x,installation:o,query:P,onSelectRepo:a,isSaving:r})}),e[9]=n,e[10]=P,e[11]=o,e[12]=r,e[13]=a,e[14]=l,e[15]=x,e[16]=y):y=e[16];let g;e[17]!==b||e[18]!==y?(g=t.jsx("div",{className:b,children:y}),e[17]=b,e[18]=y,e[19]=g):g=e[19];let i;return e[20]!==m||e[21]!==g?(i=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[m,g]}),e[20]=m,e[21]=g,e[22]=i):i=e[22],i}function Je(C){const e=M.c(36),{connectionId:n,orgId:l,orgSlug:x,installation:o,query:a,onSelectRepo:r,isSaving:s}=C,u=ee();let k;e[0]!==n||e[1]!==l||e[2]!==x?(k={connectionId:n,orgId:l,orgSlug:x},e[0]=n,e[1]=l,e[2]=x,e[3]=k):k=e[3];const v=ne(k),P=o.type==="User"?"user":"org",f=a?`${P}:${o.login} ${a} in:name fork:true`:`${P}:${o.login} fork:true`;let d;e[4]!==n||e[5]!==o.login||e[6]!==l||e[7]!==a?(d=se.githubOrgRepos(l,n,o.login,a),e[4]=n,e[5]=o.login,e[6]=l,e[7]=a,e[8]=d):d=e[8];let m;e[9]!==v||e[10]!==f?(m=async g=>{const{signal:i}=g,N=(await v.callTool({name:"search_repositories",arguments:{query:f,page:1,perPage:30}},void 0,{signal:i})).content?.[0]?.text;if(!N)throw new Error("No response from search_repositories");return(JSON.parse(N).items??[]).map(We)},e[9]=v,e[10]=f,e[11]=m):m=e[11];let c;e[12]!==d||e[13]!==m?(c={queryKey:d,queryFn:m},e[12]=d,e[13]=m,e[14]=c):c=e[14];const{data:b}=Ce(c);if(b.length===0){let g;e[15]!==u?(g=u("common.githubRepoPicker.noRepositoriesFound"),e[15]=u,e[16]=g):g=e[16];let i;e[17]!==g?(i=t.jsx("p",{className:"text-sm text-muted-foreground",children:g}),e[17]=g,e[18]=i):i=e[18];let j;e[19]!==a||e[20]!==u?(j=a&&t.jsx("p",{className:"text-xs text-muted-foreground/60",children:u("common.githubRepoPicker.tryDifferentSearchTerm")}),e[19]=a,e[20]=u,e[21]=j):j=e[21];let N;return e[22]!==i||e[23]!==j?(N=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-1",children:[i,j]}),e[22]=i,e[23]=j,e[24]=N):N=e[24],N}let h;if(e[25]!==s||e[26]!==r||e[27]!==b||e[28]!==u){let g;e[30]!==s||e[31]!==r||e[32]!==u?(g=i=>t.jsxs("button",{type:"button",onClick:()=>r(i),disabled:s,className:"flex items-start gap-3 px-4 py-3 hover:bg-accent transition-colors text-left disabled:opacity-50 disabled:cursor-not-allowed",children:[t.jsx(D,{className:"size-4 text-muted-foreground mt-0.5 shrink-0"}),t.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[t.jsx("span",{className:"text-sm font-medium truncate",children:i.name}),i.fork&&t.jsx("span",{className:"text-xs font-medium text-muted-foreground border border-border rounded px-1.5 py-0.5 shrink-0 leading-none",children:u("common.githubRepoPicker.forkBadge")})]}),t.jsxs("span",{className:"flex items-center gap-1 text-xs font-medium text-muted-foreground border border-border rounded px-1.5 py-0.5 shrink-0 leading-none",children:[i.private?t.jsx(Re,{size:10}):t.jsx(Le,{size:10}),i.private?u("common.githubRepoPicker.private"):u("common.githubRepoPicker.public")]})]},i.fullName),e[30]=s,e[31]=r,e[32]=u,e[33]=g):g=e[33],h=b.map(g),e[25]=s,e[26]=r,e[27]=b,e[28]=u,e[29]=h}else h=e[29];let y;return e[34]!==h?(y=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden flex flex-col [scrollbar-gutter:stable]",children:h}),e[34]=h,e[35]=y):y=e[35],y}function We(C){return{name:C.name,fullName:C.full_name,owner:C.full_name.split("/")[0]??"",url:C.html_url,private:C.private,description:C.description,updatedAt:C.updated_at,fork:C.fork??!1}}function ce(C){const e=M.c(51),{status:n,error:l,retry:x}=C,o=ee();if(n==="error"){let N;e[0]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("div",{className:"size-10 rounded-full bg-destructive/10 flex items-center justify-center",children:t.jsx(D,{className:"size-5 text-destructive"})}),e[0]=N):N=e[0];let I;e[1]!==o?(I=o("common.githubRepoPicker.connectionFailed"),e[1]=o,e[2]=I):I=e[2];let T;e[3]!==I?(T=t.jsx("p",{className:"text-sm font-medium",children:I}),e[3]=I,e[4]=T):T=e[4];let R;e[5]!==l||e[6]!==o?(R=l??o("common.githubRepoPicker.somethingWentWrong"),e[5]=l,e[6]=o,e[7]=R):R=e[7];let w;e[8]!==R?(w=t.jsx("p",{className:"text-xs text-muted-foreground max-w-[260px] leading-relaxed",children:R}),e[8]=R,e[9]=w):w=e[9];let _;e[10]!==T||e[11]!==w?(_=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[T,w]}),e[10]=T,e[11]=w,e[12]=_):_=e[12];let F;e[13]!==o?(F=o("common.githubRepoPicker.tryAgain"),e[13]=o,e[14]=F):F=e[14];let p;e[15]!==x||e[16]!==F?(p=t.jsx("button",{type:"button",onClick:x,className:"text-xs font-medium text-foreground border border-border rounded-md px-3 py-1.5 hover:bg-accent transition-colors",children:F}),e[15]=x,e[16]=F,e[17]=p):p=e[17];let S;return e[18]!==_||e[19]!==p?(S=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[N,_,p]}),e[18]=_,e[19]=p,e[20]=S):S=e[20],S}const a=n==="authenticating";let r;e[21]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"size-10 rounded-full bg-muted flex items-center justify-center",children:t.jsx(D,{className:"size-5 text-foreground"})}),e[21]=r):r=e[21];let s;e[22]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsxs("div",{className:"relative size-10",children:[r,t.jsx("div",{className:"absolute -bottom-0.5 -right-0.5 size-4 rounded-full bg-background flex items-center justify-center",children:t.jsx(Z,{size:12,className:"animate-spin text-muted-foreground"})})]}),e[22]=s):s=e[22];let u;e[23]!==a||e[24]!==o?(u=o(a?"common.githubRepoPicker.authenticatingGitHub":"common.githubRepoPicker.settingUpGitHub"),e[23]=a,e[24]=o,e[25]=u):u=e[25];let k;e[26]!==u?(k=t.jsx("p",{className:"text-sm font-medium",children:u}),e[26]=u,e[27]=k):k=e[27];let v;e[28]!==a||e[29]!==o?(v=o(a?"common.githubRepoPicker.completeOAuthFlow":"common.githubRepoPicker.installingGitHubConnection"),e[28]=a,e[29]=o,e[30]=v):v=e[30];let P;e[31]!==v?(P=t.jsx("p",{className:"text-xs text-muted-foreground",children:v}),e[31]=v,e[32]=P):P=e[32];let f;e[33]!==k||e[34]!==P?(f=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[k,P]}),e[33]=k,e[34]=P,e[35]=f):f=e[35];const d=a?"bg-muted-foreground/30":"bg-foreground animate-pulse";let m;e[36]!==d?(m=ae("size-1.5 rounded-full",d),e[36]=d,e[37]=m):m=e[37];let c;e[38]!==m?(c=t.jsx("span",{className:m}),e[38]=m,e[39]=c):c=e[39];const b=a?"bg-foreground animate-pulse":"bg-muted-foreground/30";let h;e[40]!==b?(h=ae("size-1.5 rounded-full",b),e[40]=b,e[41]=h):h=e[41];let y;e[42]!==h?(y=t.jsx("span",{className:h}),e[42]=h,e[43]=y):y=e[43];let g;e[44]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("span",{className:"size-1.5 rounded-full bg-muted-foreground/30"}),e[44]=g):g=e[44];let i;e[45]!==c||e[46]!==y?(i=t.jsxs("div",{className:"flex items-center gap-1.5",children:[c,y,g]}),e[45]=c,e[46]=y,e[47]=i):i=e[47];let j;return e[48]!==i||e[49]!==f?(j=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[s,f,i]}),e[48]=i,e[49]=f,e[50]=j):j=e[50],j}export{D as G,dt as a,Be as b,$e as u};
|