decocms 3.79.2 → 3.80.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-Diz6uT7Y.js → AlertCircle-CzPpSV3W.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-Bo4YThIl.js → ArrowUpRight-BefNTATY.js} +1 -1
- package/dist/client/assets/{CheckCircle-BSFt0_RZ.js → CheckCircle-BRNW9lmT.js} +1 -1
- package/dist/client/assets/{ChevronDown-C_njLrOU.js → ChevronDown-Di-ZHzN-.js} +1 -1
- package/dist/client/assets/{ChevronLeft-ByQFERqp.js → ChevronLeft-ByolOLbh.js} +1 -1
- package/dist/client/assets/{ChevronRight-D1duQehP.js → ChevronRight-CmB8MBzZ.js} +1 -1
- package/dist/client/assets/{ChevronUp-_gM_dQkt.js → ChevronUp-BurUkCqE.js} +1 -1
- package/dist/client/assets/{DotsVertical-BJnhQ8u0.js → DotsVertical-Dsznav3Y.js} +1 -1
- package/dist/client/assets/{Eye-SUXNGsVY.js → Eye-B8NUm9Br.js} +1 -1
- package/dist/client/assets/{FilterLines-CxIQYlMz.js → FilterLines-DMbodALc.js} +1 -1
- package/dist/client/assets/{Globe01-CNw0uMhK.js → Globe01-BG9Wm5DJ.js} +1 -1
- package/dist/client/assets/{Globe04-B24hCYmg.js → Globe04-Fg_TSPLj.js} +1 -1
- package/dist/client/assets/{HardDrive-IPJJMMij.js → HardDrive-BLr46_IN.js} +1 -1
- package/dist/client/assets/{Key01-CES8n-fG.js → Key01-Dc0MTS9j.js} +1 -1
- package/dist/client/assets/{LayoutLeft-D3mZzNi0.js → LayoutLeft-nNhAa0Dy.js} +1 -1
- package/dist/client/assets/{LinkExternal01-B8zRpPza.js → LinkExternal01-D0OVTAOa.js} +1 -1
- package/dist/client/assets/{Monitor01-Uh-3HvZI.js → Monitor01-D_VMj6ZB.js} +1 -1
- package/dist/client/assets/{Palette-Du66341h.js → Palette-BmXFbt3l.js} +1 -1
- package/dist/client/assets/{Play-CVoFjR5I.js → Play-CAiQqhjZ.js} +1 -1
- package/dist/client/assets/{Plus-DoMNANl8.js → Plus-DHDiWYHk.js} +1 -1
- package/dist/client/assets/{SearchMd-B-bL1wjq.js → SearchMd-DaWHy1GV.js} +1 -1
- package/dist/client/assets/{Settings02-BvivcyYL.js → Settings02-B7jENSJZ.js} +1 -1
- package/dist/client/assets/{Shield01-BewRt7sw.js → Shield01-YoAzrA51.js} +1 -1
- package/dist/client/assets/{Star01-Ds91SJzA.js → Star01-CaB7lNB9.js} +1 -1
- package/dist/client/assets/{Stars01-PS518Jif.js → Stars01-a6WqibZn.js} +1 -1
- package/dist/client/assets/{Stars02-CVb_b-OZ.js → Stars02-D2Vky1vN.js} +1 -1
- package/dist/client/assets/{Sun-tLN4vA6M.js → Sun-vyxrPcie.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-vo5MpXEz.js → SwitchHorizontal01-C3K-vKiU.js} +1 -1
- package/dist/client/assets/{Tool01-BgzvuPeY.js → Tool01-CTw8qR4v.js} +1 -1
- package/dist/client/assets/{Trash01-D84eyfFz.js → Trash01-BzTEx-hS.js} +1 -1
- package/dist/client/assets/{Upload01-BA5iKtAl.js → Upload01-DwgHgRix.js} +1 -1
- package/dist/client/assets/{User01-CeCQHgwg.js → User01-BtO-AoKy.js} +1 -1
- package/dist/client/assets/{Users01-DtmLcsFN.js → Users01-BRTza8nY.js} +1 -1
- package/dist/client/assets/{Users03-ClWrctLP.js → Users03-9LUo_raC.js} +1 -1
- package/dist/client/assets/{X-2HGWB7Oo.js → X-1BuEzBGR.js} +1 -1
- package/dist/client/assets/{XCircle-B88UxHjD.js → XCircle-DtHr5hnB.js} +1 -1
- package/dist/client/assets/{XClose-DcfEQwVh.js → XClose-qpXD94Yo.js} +1 -1
- package/dist/client/assets/{Zap-BeB31T8Y.js → Zap-DluXKGP1.js} +1 -1
- package/dist/client/assets/{ZapSquare-BfSTQonf.js → ZapSquare-C2q_71C5.js} +1 -1
- package/dist/client/assets/{ZoomOut-Csc4IU4b.js → ZoomOut-DHX-bR9F.js} +1 -1
- package/dist/client/assets/{access-gate-BI-B2IAv.js → access-gate-CGKEhEok.js} +1 -1
- package/dist/client/assets/add-section-modal-SzJO4niJ.js +1 -0
- package/dist/client/assets/{agent-icon-BMQHBhP6.js → agent-icon-B8qJNw4_.js} +1 -1
- package/dist/client/assets/{agents-list-XJ_b0Boo.js → agents-list-BCVql_rD.js} +1 -1
- package/dist/client/assets/{ai-providers-BT9tXzcJ.js → ai-providers-DfbrzvnV.js} +1 -1
- package/dist/client/assets/{alert-BFF74cGy.js → alert-BdFRtqYC.js} +1 -1
- package/dist/client/assets/{alert-dialog-0uOi3HqZ.js → alert-dialog-CSRFWtbt.js} +3 -3
- package/dist/client/assets/app-editor-CSxGjHmN.js +1 -0
- package/dist/client/assets/{auth-CCI_mhgC.js → auth-DOooeHhC.js} +1 -1
- package/dist/client/assets/{auth-catchall-DFuEeSui.js → auth-catchall-esDJNOF7.js} +1 -1
- package/dist/client/assets/{auth-entry-BE0f6I0U.js → auth-entry-CJkDGWB9.js} +1 -1
- package/dist/client/assets/{auth-split-layout-DTKSSrMT.js → auth-split-layout-BHOeLJSB.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-eSHjAd3t.js → authenticate-and-persist-oauth-CAo_oHNJ.js} +1 -1
- package/dist/client/assets/{automation-list-row-Ct9jaHYX.js → automation-list-row-CBS-1Qac.js} +1 -1
- package/dist/client/assets/automation-runs-BhCrA9zN.js +1 -0
- package/dist/client/assets/{automations-DAlCMK2H.js → automations-DgOam79q.js} +1 -1
- package/dist/client/assets/{avatar-CtVVLapD.js → avatar-BnBqk-2k.js} +1 -1
- package/dist/client/assets/{badge-BFvLiE20.js → badge-CpxlbcB7.js} +1 -1
- package/dist/client/assets/{block-document-CZwjF0EN.js → block-document-DJ0g8qfo.js} +2 -2
- package/dist/client/assets/{brand-context-Dc4UEvfb.js → brand-context-COIa0n8O.js} +1 -1
- package/dist/client/assets/{buckets-CY1G8BoT.js → buckets-BINQS-Su.js} +1 -1
- package/dist/client/assets/{capability-load-error-CNUOCvDx.js → capability-load-error-HdFgr5IE.js} +1 -1
- package/dist/client/assets/{card-DZtTT5Es.js → card-DQnbTJFb.js} +1 -1
- package/dist/client/assets/category-editor-vCwJctBK.js +1 -0
- package/dist/client/assets/{chat-context-Dqu5Dj_J.js → chat-context-CmZjYRTw.js} +1 -1
- package/dist/client/assets/{checkbox-CHXOcnVE.js → checkbox-DokO2DXd.js} +1 -1
- package/dist/client/assets/{cli-auth-success-BSe4zAji.js → cli-auth-success-NPtl5xjH.js} +1 -1
- package/dist/client/assets/collection-detail-DgzIzvmX.js +1 -0
- package/dist/client/assets/{collection-display-button-Dn_LJLmj.js → collection-display-button-hKaFuGbc.js} +1 -1
- package/dist/client/assets/{collection-search-D6nD206z.js → collection-search-9oxtR-cY.js} +1 -1
- package/dist/client/assets/{collection-tabs-cs02GObx.js → collection-tabs-CvHGsfW_.js} +1 -1
- package/dist/client/assets/{command-DhLgZpjn.js → command-Bw5g6PzP.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-CTTgJmu9.js → commerce-onboarding-QQ9bqrwx.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-DNAK4U2K.js → connect-desktop-dialog-BktLGd3J.js} +1 -1
- package/dist/client/assets/{connection-card-BwnCXxRf.js → connection-card-BZz5WDR5.js} +1 -1
- package/dist/client/assets/connection-detail-DNAdeiIH.js +1 -0
- package/dist/client/assets/{connection-form-helpers-Csy5hutj.js → connection-form-helpers-CltinQul.js} +1 -1
- package/dist/client/assets/connections-BSiahnsQ.js +1 -0
- package/dist/client/assets/context-menu-ByPsUX7u.js +1 -0
- package/dist/client/assets/{decopilot-CLVJpS6M.js → decopilot-DjAEZRNX.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-_mJQvJZ7.js → decopilot-sse-pool-R-AtQW2s.js} +1 -1
- package/dist/client/assets/{dialog-AE8ChAe3.js → dialog-L9SFsS1U.js} +1 -1
- package/dist/client/assets/{domain-settings-Dika0U17.js → domain-settings-BDbjH98X.js} +1 -1
- package/dist/client/assets/{drawer-Di9WrlRG.js → drawer-D-LP9Hh8.js} +1 -1
- package/dist/client/assets/{dropdown-menu-ecBYljKf.js → dropdown-menu-ByaGrYAQ.js} +1 -1
- package/dist/client/assets/{empty-state-CegPWPc0.js → empty-state-BoeIt5Fh.js} +1 -1
- package/dist/client/assets/{extract-connection-data-BumzxLvt.js → extract-connection-data-Rczvmr_Y.js} +1 -1
- package/dist/client/assets/file-explorer-QNJW4EAt.js +2 -0
- package/dist/client/assets/{file-type-icon-BOraV8Gq.js → file-type-icon-C96ES1WD.js} +1 -1
- package/dist/client/assets/{files-7E0LjJ-5.js → files-CK2ZpMSb.js} +1 -1
- package/dist/client/assets/{form-teSq_9QK.js → form-Ci3Mfx5E.js} +1 -1
- package/dist/client/assets/{general-DCnSVDK9.js → general-Dt135lsN.js} +1 -1
- package/dist/client/assets/{github-repo-picker-LA1Jld2f.js → github-repo-picker-CLrsrBV_.js} +1 -1
- package/dist/client/assets/{hooks-DwlYXenh.js → hooks-BBwQx9Hj.js} +1 -1
- package/dist/client/assets/{import-from-deco-dialog-D3BPX6JW.js → import-from-deco-dialog-D3nDDNau.js} +1 -1
- package/dist/client/assets/{index-CKtGWWKI.js → index-28ylgXoe.js} +2 -2
- package/dist/client/assets/{index-DnokqHCE.js → index-B-wtw2cV.js} +3 -3
- package/dist/client/assets/{index-3BvM9m2F.js → index-BRqNUInJ.js} +1 -1
- package/dist/client/assets/{index-DJiEBchG.js → index-BYWWr4r7.js} +1 -1
- package/dist/client/assets/index-Bh2oT8fz.css +1 -0
- package/dist/client/assets/index-CuZWA4Jo.js +1 -0
- package/dist/client/assets/index-D4eNxtKO.js +503 -0
- package/dist/client/assets/{index-DR6YHYZo.js → index-DF_aAsrE.js} +1 -1
- package/dist/client/assets/{index-dCmm-GRp.js → index-DM3CipuA.js} +1 -1
- package/dist/client/assets/{index-C4YdUUl9.js → index-DUXTdmoE.js} +1 -1
- package/dist/client/assets/{index-UyzF2Wxm.js → index-DrM3Gy-E.js} +3 -3
- package/dist/client/assets/{index-DnjeTCJ0.js → index-Dtsr5F6p.js} +1 -1
- package/dist/client/assets/{index-BonkSf20.js → index-JnEot5Hj.js} +1 -1
- package/dist/client/assets/index-Y9nbouYw.js +1 -0
- package/dist/client/assets/{index-DnCrG3F_.js → index-_BBnqQdQ.js} +1 -1
- package/dist/client/assets/{index-redirect-CiKtg2BH.js → index-redirect-DmPoZnz_.js} +1 -1
- package/dist/client/assets/{input-CTZybS4f.js → input-BiM4A7Ep.js} +1 -1
- package/dist/client/assets/{integration-icon-CslqVkci.js → integration-icon-g_GK3RAr.js} +1 -1
- package/dist/client/assets/{label-Djcog1jo.js → label-CjJncELr.js} +1 -1
- package/dist/client/assets/{login-E5h2Z5UF.js → login-BOHERlR0.js} +1 -1
- package/dist/client/assets/{mcp-oauth-BcPuGj2k.js → mcp-oauth-CEKI9gHX.js} +1 -1
- package/dist/client/assets/{members-w9nno9lo.js → members-BRt8WHan.js} +1 -1
- package/dist/client/assets/{monaco-editor-DnGtg8Ra.js → monaco-editor-BiUexVQ3.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-BqgDsRP3.js → monitoring-stats-row-CwoDwl1p.js} +1 -1
- package/dist/client/assets/{oauth-callback-azsKM8N9.js → oauth-callback-BuVPnEYV.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-DUI7fLPI.js → oauth-callback-ai-provider-YJv6IQM9.js} +1 -1
- package/dist/client/assets/{onboarding-DQTGvP19.js → onboarding-CYpSkBDm.js} +1 -1
- package/dist/client/assets/{org-install-BIHuRdOB.js → org-install-DCy7wocy.js} +1 -1
- package/dist/client/assets/{org-layout-enkFWMsq.js → org-layout-RT_U7zH8.js} +1 -1
- package/dist/client/assets/{organization-choice-CqCgStKm.js → organization-choice-bTsrQb1b.js} +1 -1
- package/dist/client/assets/page-seo-form-oftq8ir_.js +1 -0
- package/dist/client/assets/page-seo-sheet-CAgRh54V.js +1 -0
- package/dist/client/assets/{popover-DG0h5msu.js → popover-CdhOYhn4.js} +1 -1
- package/dist/client/assets/post-editor-B3gQokNp.js +1 -0
- package/dist/client/assets/{preview-dialog-Bnu3vr0P.js → preview-dialog-vDgojfWg.js} +2 -2
- package/dist/client/assets/{primitives-BVa9_bXR.js → primitives-CPVg2JCk.js} +1 -1
- package/dist/client/assets/{profile-Dp5DSYPN.js → profile-C8hjNf5c.js} +1 -1
- package/dist/client/assets/project-app-view-CVZVC5T9.js +1 -0
- package/dist/client/assets/record-editor-BZDypwa5.js +1 -0
- package/dist/client/assets/registry-BSMljcPA.js +2 -0
- package/dist/client/assets/{registry-layout-DSIR5CP1.js → registry-layout-BuJ69l8z.js} +1 -1
- package/dist/client/assets/{require-capability-Cj0iYy81.js → require-capability-7xlqOMAl.js} +1 -1
- package/dist/client/assets/{required-auth-layout-clm6boiC.js → required-auth-layout-DMkbzFqw.js} +1 -1
- package/dist/client/assets/{reset-password-B-IQNmbh.js → reset-password-CANGclZQ.js} +1 -1
- package/dist/client/assets/{roles-Cba1TfDM.js → roles-BsbFpQdA.js} +1 -1
- package/dist/client/assets/{save-status-CDIs_R_V.js → save-status-BZrjQZNL.js} +1 -1
- package/dist/client/assets/{scroll-area-BBReqUns.js → scroll-area-DaDHqFsI.js} +2 -2
- package/dist/client/assets/{search-input-D9asghaf.js → search-input-CA0juGKQ.js} +1 -1
- package/dist/client/assets/{secrets-CN8bUJoZ.js → secrets-2KI9BQIB.js} +1 -1
- package/dist/client/assets/sections-editor-DAz_riff.js +2 -0
- package/dist/client/assets/{select-CYFnhI-Q.js → select-lfhjFS6i.js} +1 -1
- package/dist/client/assets/{select-model-35S1fWTq.js → select-model-DhPTkTLZ.js} +1 -1
- package/dist/client/assets/seo-editor-qYixYUVP.js +1 -0
- package/dist/client/assets/{settings-layout-BBO5MmT3.js → settings-layout-D8_yU3Dv.js} +1 -1
- package/dist/client/assets/{settings-section-DOlV_atx.js → settings-section-uGwPOE8T.js} +1 -1
- package/dist/client/assets/{sheet-DALs-qBg.js → sheet-nKeubIDJ.js} +1 -1
- package/dist/client/assets/{shell-controls-B6QkcDFu.js → shell-controls-Nhg6txWq.js} +1 -1
- package/dist/client/assets/{shell-layout-Ch8BfEKU.js → shell-layout-DJP1UAvL.js} +1 -1
- package/dist/client/assets/{shell-route-loading-RsrwOcS1.js → shell-route-loading-BQkX9uZV.js} +1 -1
- package/dist/client/assets/{sidebar-hZIrovG4.js → sidebar-BDxhgXc-.js} +1 -1
- package/dist/client/assets/{skeleton-BqZgigOh.js → skeleton-CQjs3VsL.js} +1 -1
- package/dist/client/assets/sortable.esm-DaR8hxU_.js +5 -0
- package/dist/client/assets/{sso-BXwKoXqN.js → sso-hQT21VNe.js} +1 -1
- package/dist/client/assets/{store-CRZGNrMb.js → store-BEmqzV80.js} +1 -1
- package/dist/client/assets/store-registry-BoeF7jFP.js +2 -0
- package/dist/client/assets/{studio-tools-C1AZbzwg.js → studio-tools-CAUx-JUt.js} +1 -1
- package/dist/client/assets/{switch-DRDIUTD7.js → switch-Vf_P6Fjw.js} +1 -1
- package/dist/client/assets/{table-tYYVDDAQ.js → table-Df43OI16.js} +1 -1
- package/dist/client/assets/{tabs-D__sk4iN.js → tabs-B7LOh75O.js} +1 -1
- package/dist/client/assets/{task-status-CftQiZKN.js → task-status-CNl7XTqg.js} +1 -1
- package/dist/client/assets/{textarea-DmmCVjU6.js → textarea-CoSni5ST.js} +1 -1
- package/dist/client/assets/{toggle-group-5CInie8P.js → toggle-group-Dpya1ElG.js} +1 -1
- package/dist/client/assets/{toolbar-Bm-rdLjh.js → toolbar-C-FtiPvy.js} +1 -1
- package/dist/client/assets/{tooltip-C7L4o0rn.js → tooltip-Cs_BNuMF.js} +1 -1
- package/dist/client/assets/{types-CppGS_VJ.js → types-GBPItn3L.js} +1 -1
- package/dist/client/assets/{use-ai-providers-Deso-Vyj.js → use-ai-providers-Cyy4e6Er.js} +1 -1
- package/dist/client/assets/{use-automations-DdPVJNl5.js → use-automations-jx__re2k.js} +1 -1
- package/dist/client/assets/{use-capability-CGVlaZtI.js → use-capability-_e3uVe_7.js} +1 -1
- package/dist/client/assets/{use-clock-tick-Bp0qVbdD.js → use-clock-tick-g2v6P087.js} +1 -1
- package/dist/client/assets/{use-collections-CXeEMOwb.js → use-collections-B_GMLsdD.js} +1 -1
- package/dist/client/assets/{use-connection-DqvYiUe3.js → use-connection-DKt0DY8s.js} +1 -1
- package/dist/client/assets/{use-copy-H4KuRxx2.js → use-copy-CgtuLhVL.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp--tV5feR-.js → use-create-virtual-mcp-3Gcq1gem.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-Ct9kek4B.js → use-debounced-autosave-EPMbx34N.js} +1 -1
- package/dist/client/assets/{use-delete-connection-B2XplI5F.js → use-delete-connection-CWY-Tuh_.js} +1 -1
- package/dist/client/assets/{use-file-configs-CJ5VKJt7.js → use-file-configs-Ci1h3IZS.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-BpnVw1p2.js → use-infinite-scroll-Dt6SxdrG.js} +1 -1
- package/dist/client/assets/{use-join-requests-rgaNUN9B.js → use-join-requests-Dtt8rzJS.js} +1 -1
- package/dist/client/assets/{use-mcp-client-Cv0jyhEU.js → use-mcp-client-lyJJArps.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-CPZOOi8c.js → use-mcp-prompts-82Xtua4M.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-z50pjVux.js → use-mcp-tools-CdHM3tvY.js} +1 -1
- package/dist/client/assets/{use-members-jM6HOjam.js → use-members-CR5Y6qBg.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-CytgRfBH.js → use-navigate-to-agent-DKc1WVEH.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-DjPrRX3t.js → use-org-auth-client-DyCA15LL.js} +1 -1
- package/dist/client/assets/{use-org-sso-QBVELOwd.js → use-org-sso-DzO_wPSE.js} +1 -1
- package/dist/client/assets/{use-organization-roles-DHxcYiQL.js → use-organization-roles-CfNQzskd.js} +1 -1
- package/dist/client/assets/{use-organization-settings-DPqJ7ETy.js → use-organization-settings-DmFrFel5.js} +1 -1
- package/dist/client/assets/{use-registry-connections-DQ1fpeHW.js → use-registry-connections-grv_p5nm.js} +1 -1
- package/dist/client/assets/{use-secrets-C3RMGjE2.js → use-secrets-DzWb-lJi.js} +1 -1
- package/dist/client/assets/{use-status-sounds-BaJ0EN3G.js → use-status-sounds-CeAiKW9f.js} +1 -1
- package/dist/client/assets/{use-view-mode-DMk0VP0I.js → use-view-mode-PWJQxDpL.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-iRRxKkRN.js → use-virtual-mcp-Bglvu7_H.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-v9qNAGwf.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-Bu3QWDEr.js +1 -0
- package/dist/client/assets/{variant-calendar-Cn9DL04u.js → variant-calendar-BwPeBwqf.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-DnLJJSFI.js → view-mode-toggle-B_Gx2-J_.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/add-section-modal-BBef0kzW.js +0 -1
- package/dist/client/assets/app-editor-DB3LZKk9.js +0 -1
- package/dist/client/assets/automation-runs-CNqGFhXQ.js +0 -1
- package/dist/client/assets/calendar-Cof0eQRR.js +0 -1
- package/dist/client/assets/category-editor-CqVdn-A-.js +0 -1
- package/dist/client/assets/collection-detail-CGFO7Nxa.js +0 -1
- package/dist/client/assets/connection-detail-jhV3T5Vf.js +0 -1
- package/dist/client/assets/connections-RSAnGIGn.js +0 -1
- package/dist/client/assets/context-menu-CwmbYH1X.js +0 -1
- package/dist/client/assets/file-explorer-pkuer-wd.js +0 -2
- package/dist/client/assets/image-field-ycul5miD.js +0 -1
- package/dist/client/assets/index-BB0hMJf7.js +0 -1
- package/dist/client/assets/index-Bcj3iVpr.js +0 -1
- package/dist/client/assets/index-CqVkj8du.js +0 -502
- package/dist/client/assets/index-wICsQ-2V.css +0 -1
- package/dist/client/assets/page-seo-form-CLI6M5cV.js +0 -1
- package/dist/client/assets/page-seo-sheet-ClPikk0g.js +0 -1
- package/dist/client/assets/post-editor-BVwj0umw.js +0 -1
- package/dist/client/assets/project-app-view-r7Nmocf7.js +0 -1
- package/dist/client/assets/record-editor-DoT_RQtf.js +0 -1
- package/dist/client/assets/registry-Do0X3IQW.js +0 -2
- package/dist/client/assets/save-referenced-block-BJospazn.js +0 -1
- package/dist/client/assets/schema-form-B6Wg-hy1.js +0 -2
- package/dist/client/assets/sections-editor-BojFR4GO.js +0 -2
- package/dist/client/assets/seo-editor-DBNUZ0fG.js +0 -1
- package/dist/client/assets/sortable.esm-BtnRUgUU.js +0 -5
- package/dist/client/assets/store-registry-C5xb_cZe.js +0 -2
- package/dist/client/assets/use-deco-credits-rzfxapgg.js +0 -1
- package/dist/client/assets/useInfiniteQuery-DVN2QYOz.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BKCXXvPp.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as E,c as oe,j as t,a2 as Ye,i as ce,v as be,b as _e,u as Ze,a as Ne,p as et,s as tt,L as nt,E as st,C as ot,B as U,q as te,m as it,l as de,t as W,K as rt}from"./index-UyzF2Wxm.js";import{a as lt,b as De,g as at,e as ct}from"./extract-connection-data-BumzxLvt.js";import{C as dt}from"./collection-display-button-Dn_LJLmj.js";import{S as mt}from"./search-input-D9asghaf.js";import{C as ut}from"./collection-tabs-cs02GObx.js";import{u as pt,a as ke,g as ht,C as Ce}from"./connection-card-BwnCXxRf.js";import{E as gt}from"./empty-state-CegPWPc0.js";import{I as xt}from"./integration-icon-CslqVkci.js";import{P as ue}from"./index-DJiEBchG.js";import{u as ft,D as jt}from"./use-delete-connection-B2XplI5F.js";import{u as ye}from"./use-capability-CGVlaZtI.js";import{u as yt}from"./use-infinite-scroll-BpnVw1p2.js";import{u as Ct}from"./use-view-mode-DMk0VP0I.js";import{g as he}from"./connection-slug-eyAPH6o3.js";import{c as Ae,d as we,b as Te,A as Ie,e as Pe,g as $e,a as Le,f as Oe}from"./alert-dialog-0uOi3HqZ.js";import{C as Fe}from"./checkbox-CHXOcnVE.js";import{d as Me,c as ze,D as Ve,a as Ee,b as Be,e as Ke}from"./dialog-AE8ChAe3.js";import{D as vt,a as St,c as bt,b as _t,d as Nt,e as Dt,f as kt}from"./drawer-Di9WrlRG.js";import{u as At}from"./tooltip-C7L4o0rn.js";import{D as Ue,a as Re,b as He,c as re}from"./dropdown-menu-ecBYljKf.js";import{F as Q,b as J,c as Y,d as Z,f as ee,a as ve}from"./form-teSq_9QK.js";import{I as ie}from"./input-CTZybS4f.js";import{d as wt,b as Tt,c as It,S as Pt,a as ae}from"./select-CYFnhI-Q.js";import{T as $t}from"./textarea-DmmCVjU6.js";import{b as We,u as Lt}from"./use-connection-DqvYiUe3.js";import{u as Ot}from"./use-virtual-mcp-iRRxKkRN.js";import{u as Ft}from"./studio-tools-C1AZbzwg.js";import{Z as Mt,a7 as zt,C as Vt,z as Et}from"./agent-icon-BMQHBhP6.js";import{n as ge}from"./XCircle-B88UxHjD.js";import{a as Xe}from"./DotsVertical-BJnhQ8u0.js";import{s as qe}from"./Eye-SUXNGsVY.js";import{s as je}from"./Star01-Ds91SJzA.js";import{s as Ge}from"./Plus-DoMNANl8.js";import{s as Qe}from"./Trash01-D84eyfFz.js";import{s as Je}from"./XClose-DcfEQwVh.js";import{i as pe,a as Se,E as Bt,c as Kt,p as Ut,b as Rt,d as Ht}from"./connection-form-helpers-Csy5hutj.js";import{a as Wt}from"./authenticate-and-persist-oauth-eSHjAd3t.js";import"./use-mcp-client-Cv0jyhEU.js";import"./auth-CCI_mhgC.js";import"./SwitchHorizontal01-vo5MpXEz.js";import"./ChevronUp-_gM_dQkt.js";import"./view-mode-toggle-DnLJJSFI.js";import"./badge-BFvLiE20.js";import"./SearchMd-B-bL1wjq.js";import"./use-registry-connections-DQ1fpeHW.js";import"./use-organization-settings-DPqJ7ETy.js";import"./useInfiniteQuery-DVN2QYOz.js";import"./card-DZtTT5Es.js";import"./sidebar-hZIrovG4.js";import"./LayoutLeft-D3mZzNi0.js";import"./sheet-DALs-qBg.js";import"./X-2HGWB7Oo.js";import"./ChevronRight-D1duQehP.js";import"./label-Djcog1jo.js";import"./ChevronDown-C_njLrOU.js";import"./use-collections-CXeEMOwb.js";import"./AlertCircle-Diz6uT7Y.js";import"./Tool01-BgzvuPeY.js";import"./Settings02-BvivcyYL.js";import"./ArrowUpRight-Bo4YThIl.js";import"./ZapSquare-BfSTQonf.js";import"./Users03-ClWrctLP.js";import"./CheckCircle-BSFt0_RZ.js";import"./ChevronLeft-ByQFERqp.js";import"./Stars02-CVb_b-OZ.js";import"./ZoomOut-Csc4IU4b.js";import"./Globe01-CNw0uMhK.js";import"./FilterLines-CxIQYlMz.js";import"./Globe04-B24hCYmg.js";import"./HardDrive-IPJJMMij.js";import"./Key01-CES8n-fG.js";import"./LinkExternal01-B8zRpPza.js";import"./Monitor01-Uh-3HvZI.js";import"./Sun-tLN4vA6M.js";import"./Palette-Du66341h.js";import"./Play-CVoFjR5I.js";import"./Shield01-BewRt7sw.js";import"./Stars01-PS518Jif.js";import"./Upload01-BA5iKtAl.js";import"./User01-CeCQHgwg.js";import"./Users01-DtmLcsFN.js";import"./Zap-BeB31T8Y.js";import"./mcp-oauth-BcPuGj2k.js";function Xt(f){const e=`deco-filters-${f}`,[n,p]=E.useState(()=>{try{const o=globalThis.localStorage?.getItem(e);if(o)return JSON.parse(o)}catch(o){console.error("Failed to parse stored filters:",o)}return[]});return[n,o=>{p(o);try{globalThis.localStorage?.setItem(e,JSON.stringify(o))}catch(i){console.error("Failed to save filters:",i)}}]}function qt(f){const e=oe.c(7),[n,p]=E.useState(f),[l,o]=E.useState(f?"desc":null);let i;e[0]!==l||e[1]!==n?(i=j=>{n!==j?(p(j),o("asc")):l==="asc"?o("desc"):l==="desc"&&(p(void 0),o(null))},e[0]=l,e[1]=n,e[2]=i):i=e[2];const g=i;let h;return e[3]!==g||e[4]!==l||e[5]!==n?(h={sortKey:n,sortDirection:l,handleSort:g},e[3]=g,e[4]=l,e[5]=n,e[6]=h):h=e[6],h}function Gt(f){const e=oe.c(20),{namespace:n,resource:p,defaultSortKey:l,defaultViewMode:o}=f,i=l===void 0?"title":l,g=o===void 0?"table":o,[h,j]=E.useState(""),y=E.useDeferredValue(h),N=`${n}-${p}`,[b,a]=Xt(N),x=`mesh-${p}-filter-visible-${n}`;let m;e[0]!==x?(m=()=>globalThis.localStorage?.getItem(x)==="true",e[0]=x,e[1]=m):m=e[1];const[v,_]=E.useState(m);let D;e[2]!==x?(D=T=>{_(T),globalThis.localStorage?.setItem(x,String(T))},e[2]=x,e[3]=D):D=e[3];const L=D;let O;e[4]!==v||e[5]!==L?(O=()=>{L(!v)},e[4]=v,e[5]=L,e[6]=O):O=e[6];const s=O,[A,F]=Ct(`mesh-${p}-${n}`,g),{sortKey:M,sortDirection:w,handleSort:P}=qt(i),z=M;let C;return e[7]!==v||e[8]!==b||e[9]!==P||e[10]!==h||e[11]!==y||e[12]!==L||e[13]!==a||e[14]!==F||e[15]!==w||e[16]!==z||e[17]!==s||e[18]!==A?(C={search:h,searchTerm:y,setSearch:j,filters:b,setFilters:a,filterBarVisible:v,setFilterBarVisible:L,toggleFilterBar:s,viewMode:A,setViewMode:F,sortKey:z,sortDirection:w,handleSort:P},e[7]=v,e[8]=b,e[9]=P,e[10]=h,e[11]=y,e[12]=L,e[13]=a,e[14]=F,e[15]=w,e[16]=z,e[17]=s,e[18]=A,e[19]=C):C=e[19],C}function Qt(f){const e=oe.c(51),{group:n,onOpen:p,selectionMode:l,selectedIds:o,onToggleSelect:i}=f;let g;if(e[0]!==n.connections||e[1]!==o){let C;e[3]!==o?(C=T=>o.has(T.id),e[3]=o,e[4]=C):C=e[4],g=n.connections.every(C),e[0]=n.connections,e[1]=o,e[2]=g}else g=e[2];const h=g;let j;if(e[5]!==n.connections||e[6]!==o){let C;e[8]!==o?(C=T=>o.has(T.id),e[8]=o,e[9]=C):C=e[9],j=n.connections.some(C),e[5]=n.connections,e[6]=o,e[7]=j}else j=e[7];const y=j,N=`${n.connections.length} instances`;let b;e[10]!==n.icon||e[11]!==n.title||e[12]!==N?(b={title:n.title,icon:n.icon,description:N},e[10]=n.icon,e[11]=n.title,e[12]=N,e[13]=b):b=e[13];let a;e[14]!==h||e[15]!==n.connections||e[16]!==p||e[17]!==i||e[18]!==o||e[19]!==l?(a=()=>l?(()=>{for(const C of n.connections)h?o.has(C.id)&&i(C.id):o.has(C.id)||i(C.id)})():p(),e[14]=h,e[15]=n.connections,e[16]=p,e[17]=i,e[18]=o,e[19]=l,e[20]=a):a=e[20];const x=l&&h&&"ring-2 ring-primary",m=l&&y&&!h&&"ring-1 ring-primary/50";let v;e[21]!==x||e[22]!==m?(v=de(x,m),e[21]=x,e[22]=m,e[23]=v):v=e[23];let _;e[24]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(ge,{}),e[24]=_):_=e[24];let D;e[25]!==h||e[26]!==n.connections||e[27]!==i||e[28]!==o||e[29]!==l||e[30]!==y?(D=l?t.jsx(Fe,{checked:h?!0:y?"indeterminate":!1,onCheckedChange:()=>{for(const C of n.connections)h?o.has(C.id)&&i(C.id):o.has(C.id)||i(C.id)}}):t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}),t.jsxs("span",{className:"text-xs text-muted-foreground font-normal tabular-nums",children:["x",n.connections.length]})]}),e[25]=h,e[26]=n.connections,e[27]=i,e[28]=o,e[29]=l,e[30]=y,e[31]=D):D=e[31];const L=l?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let O;e[32]!==L?(O=de("overflow-hidden transition-all duration-150 ease-out",L),e[32]=L,e[33]=O):O=e[33];let s;e[34]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx(Re,{asChild:!0,children:t.jsx(U,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Yt,children:t.jsx(Xe,{size:20})})}),e[34]=s):s=e[34];let A;e[35]!==p?(A=C=>{C.stopPropagation(),p()},e[35]=p,e[36]=A):A=e[36];let F;e[37]===Symbol.for("react.memo_cache_sentinel")?(F=t.jsx(qe,{size:16}),e[37]=F):F=e[37];let M;e[38]!==A?(M=t.jsxs(Ue,{children:[s,t.jsx(He,{align:"end",onClick:Jt,children:t.jsxs(re,{onClick:A,children:[F,"Open"]})})]}),e[38]=A,e[39]=M):M=e[39];let w;e[40]!==O||e[41]!==M?(w=t.jsx("div",{className:O,children:M}),e[40]=O,e[41]=M,e[42]=w):w=e[42];let P;e[43]!==D||e[44]!==w?(P=t.jsxs("div",{className:"flex items-center gap-1",children:[D,w]}),e[43]=D,e[44]=w,e[45]=P):P=e[45];let z;return e[46]!==P||e[47]!==b||e[48]!==a||e[49]!==v?(z=t.jsx(t.Fragment,{children:t.jsx(Ce,{connection:b,onClick:a,className:v,fallbackIcon:_,headerActionsAlwaysVisible:!0,headerActions:P})}),e[46]=P,e[47]=b,e[48]=a,e[49]=v,e[50]=z):z=e[50],z}function Jt(f){return f.stopPropagation()}function Yt(f){return f.stopPropagation()}function Zt(f){const e=oe.c(23),{count:n,total:p,canManage:l,canManageAgents:o,onSelectAll:i,onDeselectAll:g,onDelete:h,onAddToAgent:j,onToggleStatus:y,onCancel:N}=f;if(n===0)return null;let b;e[0]!==n?(b=t.jsxs("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:[n," selected"]}),e[0]=n,e[1]=b):b=e[1];let a;e[2]!==n||e[3]!==g||e[4]!==i||e[5]!==p?(a=n<p?t.jsxs(U,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:i,children:["Select all (",p,")"]}):t.jsx(U,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:g,children:"Clear selection"}),e[2]=n,e[3]=g,e[4]=i,e[5]=p,e[6]=a):a=e[6];let x;e[7]!==o||e[8]!==j?(x=o&&t.jsxs(U,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:j,children:[t.jsx(Ge,{size:13}),"Add to Agent"]}),e[7]=o,e[8]=j,e[9]=x):x=e[9];let m;e[10]!==l||e[11]!==h||e[12]!==y?(m=l&&t.jsxs(t.Fragment,{children:[t.jsx(U,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>y("active"),children:"Enable"}),t.jsx(U,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>y("inactive"),children:"Disable"}),t.jsxs(U,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:h,children:[t.jsx(Qe,{size:13}),"Delete"]})]}),e[10]=l,e[11]=h,e[12]=y,e[13]=m):m=e[13];let v;e[14]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(Je,{size:13}),e[14]=v):v=e[14];let _;e[15]!==N?(_=t.jsx(U,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:N,children:v}),e[15]=N,e[16]=_):_=e[16];let D;return e[17]!==b||e[18]!==a||e[19]!==x||e[20]!==m||e[21]!==_?(D=t.jsx("div",{className:"fixed bottom-4 left-1/2 z-50 -translate-x-1/2",children:t.jsxs("div",{className:"rounded-xl border border-border bg-background/95 shadow-lg backdrop-blur px-3 py-2 flex items-center gap-2",children:[b,a,x,m,_]})}),e[17]=b,e[18]=a,e[19]=x,e[20]=m,e[21]=_,e[22]=D):D=e[22],D}function en(f){const e=oe.c(25),{open:n,onOpenChange:p,agents:l,onConfirm:o}=f,[i,g]=E.useState(null);let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsxs(Ve,{children:[t.jsx(Ee,{children:"Add to Agent"}),t.jsx(Be,{children:"Select an agent to add the selected connections to."})]}),e[0]=h):h=e[0];let j;e[1]!==l||e[2]!==i?(j=l.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No agents found"}):l.map(D=>t.jsxs("button",{type:"button",onClick:()=>g(D.id),className:de("flex items-center gap-3 w-full rounded-md px-3 py-2 text-left transition-colors",i===D.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(xt,{icon:D.icon,name:D.title,size:"sm",className:"shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:D.title}),D.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:D.description})]})]},D.id)),e[1]=l,e[2]=i,e[3]=j):j=e[3];let y;e[4]!==j?(y=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:j}),e[4]=j,e[5]=y):y=e[5];let N;e[6]!==p?(N=t.jsx(U,{variant:"outline",onClick:()=>p(!1),children:"Cancel"}),e[6]=p,e[7]=N):N=e[7];const b=!i;let a;e[8]!==o||e[9]!==p||e[10]!==i?(a=()=>{i&&(o(i),p(!1),g(null))},e[8]=o,e[9]=p,e[10]=i,e[11]=a):a=e[11];let x;e[12]!==b||e[13]!==a?(x=t.jsx(U,{disabled:b,onClick:a,children:"Add"}),e[12]=b,e[13]=a,e[14]=x):x=e[14];let m;e[15]!==N||e[16]!==x?(m=t.jsxs(Ke,{children:[N,x]}),e[15]=N,e[16]=x,e[17]=m):m=e[17];let v;e[18]!==y||e[19]!==m?(v=t.jsxs(ze,{className:"sm:max-w-[400px]",children:[h,y,m]}),e[18]=y,e[19]=m,e[20]=v):v=e[20];let _;return e[21]!==p||e[22]!==n||e[23]!==v?(_=t.jsx(Me,{open:n,onOpenChange:p,children:v}),e[21]=p,e[22]=n,e[23]=v,e[24]=_):_=e[24],_}function tn(f){const e=oe.c(20),{open:n,onOpenChange:p,count:l,onConfirm:o}=f,i=l!==1?"s":"";let g;e[0]!==l||e[1]!==i?(g=t.jsxs(Ae,{children:["Delete ",l," connection",i,"?"]}),e[0]=l,e[1]=i,e[2]=g):g=e[2];const h=l!==1?"s":"";let j;e[3]!==h?(j=t.jsxs(we,{children:["This will permanently delete the selected connection",h,". This action cannot be undone."]}),e[3]=h,e[4]=j):j=e[4];let y;e[5]!==g||e[6]!==j?(y=t.jsxs(Te,{children:[g,j]}),e[5]=g,e[6]=j,e[7]=y):y=e[7];let N;e[8]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(Ie,{children:"Cancel"}),e[8]=N):N=e[8];const b=l!==1?"s":"";let a;e[9]!==l||e[10]!==o||e[11]!==b?(a=t.jsxs(Pe,{children:[N,t.jsxs($e,{onClick:o,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:["Delete ",l," connection",b]})]}),e[9]=l,e[10]=o,e[11]=b,e[12]=a):a=e[12];let x;e[13]!==y||e[14]!==a?(x=t.jsxs(Le,{children:[y,a]}),e[13]=y,e[14]=a,e[15]=x):x=e[15];let m;return e[16]!==p||e[17]!==n||e[18]!==x?(m=t.jsx(Oe,{open:n,onOpenChange:p,children:x}),e[16]=p,e[17]=n,e[18]=x,e[19]=m):m=e[19],m}function nn(f){return f._registryId?.includes("community-registry")===!0}function sn(f){const e=oe.c(58),{item:n,canManage:p,allConnections:l,connectedAppNames:o,connectingItemId:i,onNavigateConnected:g,onConnect:h}=f,[j,y]=E.useState(!1),[N,b]=E.useState(null);let a,x;e[0]!==o||e[1]!==n?(a=De(n)??"",x=o.has(a),e[0]=o,e[1]=n,e[2]=a,e[3]=x):(a=e[2],x=e[3]);const m=x,v=n._meta?.["mcp.mesh"],_=v?.friendlyName||v?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",D=n.server?.description||n.description||null;let L;e[4]!==n.server?.icons?.[0]?.src||e[5]!==n.server?.repository?(L=n.server?.icons?.[0]?.src||at(n.server?.repository)||null,e[4]=n.server?.icons?.[0]?.src,e[5]=n.server?.repository,e[6]=L):L=e[6];const O=L;let s;if(e[7]!==l||e[8]!==a){let k;e[10]!==a?(k=se=>se.connection_type!=="VIRTUAL"&&se.app_name===a,e[10]=a,e[11]=k):k=e[11],s=l.filter(k),e[7]=l,e[8]=a,e[9]=s}else s=e[9];const A=s;let F;e[12]!==n?(F=nn(n),e[12]=n,e[13]=F):F=e[13];const M=F;let w,P;e[14]!==A||e[15]!==p||e[16]!==M||e[17]!==m||e[18]!==n||e[19]!==h||e[20]!==g?(w=()=>{if(m){const k=A[0];k&&g(k);return}p&&P()},P=()=>{M?(b("connect"),y(!0)):h(n)},e[14]=A,e[15]=p,e[16]=M,e[17]=m,e[18]=n,e[19]=h,e[20]=g,e[21]=w,e[22]=P):(w=e[21],P=e[22]);let z;e[23]!==n||e[24]!==h||e[25]!==N?(z=()=>{te("connections_community_warning_confirmed",{registry_item_id:n.id}),y(!1),N==="connect"&&h(n),b(null)},e[23]=n,e[24]=h,e[25]=N,e[26]=z):z=e[26];const C=z;let T;e[27]!==D||e[28]!==O||e[29]!==_?(T={title:_,description:D,icon:O},e[27]=D,e[28]=O,e[29]=_,e[30]=T):T=e[30];let G;e[31]===Symbol.for("react.memo_cache_sentinel")?(G=t.jsx(ge,{}),e[31]=G):G=e[31];let H;e[32]!==M||e[33]!==n._sourceIcon?(H=M&&n._sourceIcon&&t.jsx("img",{src:n._sourceIcon,alt:"Community",className:"size-4 rounded-sm object-contain"}),e[32]=M,e[33]=n._sourceIcon,e[34]=H):H=e[34];let X;e[35]!==p||e[36]!==i||e[37]!==P||e[38]!==m||e[39]!==n.id?(X=m?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}):p&&t.jsx(U,{variant:"outline",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:i!==null,onClick:k=>{k.stopPropagation(),P()},children:i===n.id?t.jsx(ce,{size:14,className:"animate-spin"}):"Connect"}),e[35]=p,e[36]=i,e[37]=P,e[38]=m,e[39]=n.id,e[40]=X):X=e[40];let c;e[41]!==H||e[42]!==X?(c=t.jsxs("div",{className:"flex items-center gap-2",children:[H,X]}),e[41]=H,e[42]=X,e[43]=c):c=e[43];let S;e[44]!==w||e[45]!==c||e[46]!==T?(S=t.jsx(Ce,{connection:T,fallbackIcon:G,onClick:w,headerActionsAlwaysVisible:!0,headerActions:c}),e[44]=w,e[45]=c,e[46]=T,e[47]=S):S=e[47];let V;e[48]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsxs(Te,{children:[t.jsx(Ae,{children:"Community MCP Server"}),t.jsx(we,{children:"This MCP server is from the Community MCP Registry and is not maintained or verified by Deco. Community servers may have varying levels of quality, security, and reliability. Proceed with caution and review the server details before connecting."})]}),e[48]=V):V=e[48];let R;e[49]===Symbol.for("react.memo_cache_sentinel")?(R=t.jsx(Ie,{children:"Cancel"}),e[49]=R):R=e[49];let B;e[50]!==C?(B=t.jsxs(Le,{children:[V,t.jsxs(Pe,{children:[R,t.jsx($e,{onClick:C,children:"Continue"})]})]}),e[50]=C,e[51]=B):B=e[51];let u;e[52]!==j||e[53]!==B?(u=t.jsx(Oe,{open:j,onOpenChange:y,children:B}),e[52]=j,e[53]=B,e[54]=u):u=e[54];let $;return e[55]!==S||e[56]!==u?($=t.jsxs(t.Fragment,{children:[S,u]}),e[55]=S,e[56]=u,e[57]=$):$=e[57],$}function on({listState:f,activeTab:e,typeFilter:n,statusFilter:p,registryFilter:l,enabledRegistries:o}){const{org:i}=be(),g=it(),h=_e(),{data:j}=Ne.useSession(),y=We(),N=Lt(f),b=ft(),{granted:a}=ye("connections:manage"),{granted:x}=ye("agents:manage"),[m,v]=E.useState(new Set),_=m.size>0,[D,L]=E.useState(!1),[O,s]=E.useState(!1),[A,F]=E.useState(null),M=Ot(),w=N.filter(r=>!(n!=="ALL"&&r.connection_type!==n||p!=="ALL"&&r.status!==p)),P=ht(w),z=r=>{v(d=>{const K=new Set(d);return K.has(r)?K.delete(r):K.add(r),K})},C=()=>{v(new Set)},T=ke(o,f.searchTerm),G=T.items,H=yt(T.loadMore,T.hasMore,T.isLoadingMore),X=new Set(N.filter(r=>r.app_name).map(r=>r.app_name)),c=l==="ALL"||o.some(r=>r.id===l)?l:"ALL",S=f.search.length>0,V=e==="all"||S?G.filter(r=>{if(c!=="ALL"&&r._registryId!==c)return!1;if(S){const d=De(r);if(d&&X.has(d))return!1}return!0}):[],R=e==="connected"||S?P:[],B=async r=>{if(!(!i||!j?.user?.id)){te("connection_add_clicked",{action:"connect_new",registry_item_id:r.id,source:"connections_page"}),F(r.id);try{const d=ct(r,i.id,j.user.id,{remoteIndex:0}),K=d.connection_type==="STDIO",I=!!d.connection_url,q=K&&d.connection_headers&&typeof d.connection_headers=="object"&&"command"in d.connection_headers;if(!I&&!q){W.error("This MCP Server cannot be connected: no connection method available"),F(null);return}const{id:ne}=await y.create.mutateAsync(d),le=await Wt({connectionId:ne,orgId:i.id,orgSlug:i.slug,persistFallback:fe=>y.update.mutateAsync({id:ne,data:{connection_token:fe}}).then(()=>{})});if(le.ran&&!le.ok){te("connection_oauth_failed",{connection_id:ne,flow:"connections_page_connect",error:le.error??"no_token"}),W.error(`Authentication failed: ${le.error??"no token received"}`);return}if(le.ran){te("connection_oauth_succeeded",{connection_id:ne,flow:"connections_page_connect"});const fe=new URL(`/api/${i.slug}/mcp/${ne}`,window.location.origin);await g.invalidateQueries({queryKey:rt.isMCPAuthenticated(fe.href,null)}),$(),W.success("Authentication successful")}W.success("Connected successfully")}catch(d){W.error(`Failed to connect: ${d instanceof Error?d.message:String(d)}`)}finally{F(null)}}},u=Ft(),$=()=>{g.invalidateQueries({predicate:r=>{const d=r.queryKey;return d[1]===i.id&&d[3]==="collection"&&d[4]==="CONNECTIONS"}})},k=async()=>{L(!1);const r=[...m];te("connections_bulk_delete",{count:r.length});let d=0;for(const K of r)try{await u.call("COLLECTION_CONNECTIONS_DELETE",{id:K,force:!0}),d++}catch{}$(),W.success(`Deleted ${d} connection${d!==1?"s":""}`),C()},se=async(r,d)=>{try{await y.update.mutateAsync({id:r,data:{status:d}}),$(),W.success(d==="active"?"Connection enabled":"Connection disabled")}catch{W.error("Failed to update connection")}},xe=async r=>{const d=[...m];te("connections_bulk_status_toggled",{count:d.length,to_status:r});let K=0;for(const I of d)try{await y.update.mutateAsync({id:I,data:{status:r}}),K++}catch{}$(),W.success(`${r==="active"?"Enabled":"Disabled"} ${K} connection${K!==1?"s":""}`),C()},me=async r=>{const d=M.find(q=>q.id===r);if(!d)return;te("connections_bulk_add_to_agent",{agent_id:r,count:m.size});const K=new Set(d.connections.map(q=>q.connection_id)),I=[...m].filter(q=>!K.has(q)).map(q=>({connection_id:q,selected_tools:null,selected_resources:null,selected_prompts:null}));if(I.length===0){W.info("All selected connections are already in that agent");return}try{await u.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:r,data:{connections:[...d.connections,...I]}}),g.invalidateQueries({predicate:q=>{const ne=q.queryKey;return ne[1]===i.id&&ne[3]==="collection"&&ne[4]==="VIRTUAL_MCP"}}),W.success(`Added ${I.length} connection${I.length!==1?"s":""} to "${d.title}"`),C()}catch{W.error("Failed to add connections to agent")}};return t.jsxs(t.Fragment,{children:[t.jsx(jt,{...b}),t.jsx(tn,{open:D,onOpenChange:L,count:m.size,onConfirm:k}),t.jsx(en,{open:O,onOpenChange:s,agents:M,onConfirm:me}),T.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ce,{size:32,className:"animate-spin text-muted-foreground"})}):t.jsx("div",{children:(S?V.length===0&&w.length===0:e==="all"?V.length===0:w.length===0)?t.jsx(gt,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:"No Connections found",description:f.search?`No Connections match "${f.search}"`:a?"Create a connection to get started.":"Ask an organization admin to add one."}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[R.map(r=>{if(r.type==="group")return t.jsx(Qt,{group:r,onOpen:()=>{h({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:r.key}})},selectionMode:_,selectedIds:m,onToggleSelect:z},r.key);const d=r.connection,K=m.has(d.id);return t.jsx(Ce,{connection:d,fallbackIcon:t.jsx(ge,{}),onClick:()=>_?z(d.id):h({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:he(d)}}),className:de(K&&"ring-2 ring-primary bg-primary/5"),headerActionsAlwaysVisible:!0,headerActions:t.jsxs("div",{className:"flex items-center gap-1",children:[_?t.jsx(Fe,{checked:K,onCheckedChange:()=>z(d.id),onClick:I=>I.stopPropagation()}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}),t.jsx("div",{className:de("overflow-hidden transition-all duration-150 ease-out",_?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100"),children:t.jsxs(Ue,{children:[t.jsx(Re,{asChild:!0,children:t.jsx(U,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:I=>I.stopPropagation(),children:t.jsx(Xe,{size:20})})}),t.jsxs(He,{align:"end",onClick:I=>I.stopPropagation(),children:[t.jsxs(re,{onClick:I=>{I.stopPropagation(),h({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:he(d)}})},children:[t.jsx(qe,{size:16}),"Open"]}),(a||x)&&t.jsxs(re,{onClick:I=>{I.stopPropagation(),z(d.id)},children:[t.jsx(zt,{size:16}),"Select"]}),a&&(d.status==="active"?t.jsxs(re,{onClick:I=>{I.stopPropagation(),se(d.id,"inactive")},children:[t.jsx(Vt,{size:16}),"Disable"]}):t.jsxs(re,{onClick:I=>{I.stopPropagation(),se(d.id,"active")},children:[t.jsx(Et,{size:16}),"Enable"]})),a&&t.jsxs(re,{variant:"destructive",onClick:I=>{I.stopPropagation(),b.requestDelete(d)},children:[t.jsx(Qe,{size:16}),"Delete"]})]})]})})]})},d.id)}),V.map(r=>t.jsx(sn,{item:r,canManage:a,allConnections:N,connectedAppNames:X,connectingItemId:A,onNavigateConnected:d=>h({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:he(d)}}),onConnect:B},`catalog-${r._registryId}:${r.id}`)),(e==="all"||S)&&o.length>0&&t.jsx("div",{ref:H,className:"col-span-full h-4"}),(e==="all"||S)&&T.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(ce,{size:24,className:"animate-spin text-muted-foreground"})})]})}),_&&t.jsx(Zt,{count:m.size,total:w.length,canManage:a,canManageAgents:x,onSelectAll:()=>{v(new Set(w.map(r=>r.id)))},onDeselectAll:()=>v(new Set),onDelete:()=>L(!0),onAddToAgent:()=>s(!0),onToggleStatus:xe,onCancel:C})]})}function rn(){const{org:f}=be(),e=_e(),n=Ze({strict:!1}),{data:p}=Ne.useSession(),{stdioEnabled:l}=et(),o=At(),{granted:i}=ye("connections:manage"),g=Gt({namespace:f.slug,resource:"connections"}),h=We(),[j,y]=tt(nt.connectionsTab(f.slug),c=>n.tab==="all"||n.tab==="connected"?n.tab:c??"all"),[N,b]=E.useState("ALL"),[a,x]=E.useState("ALL"),[m,v]=E.useState("ALL"),_=pt(),L=ke(_,g.searchTerm).items,O=g.search!==g.searchTerm,s=st({resolver:ot(Kt),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),A=s.watch("ui_type"),F=s.watch("connection_url"),M=s.watch("npx_package"),w=pe({uiType:A,connectionUrl:F??"",npxPackage:M??""})??Se({uiType:A,connectionUrl:F??"",registryItems:L}),P=i&&n.action==="create",z=()=>{te("connections_custom_dialog_opened",{source:"connections_page"}),e({to:"/$org/settings/connections",params:{org:f.slug},search:{action:"create"}})},C=()=>{e({to:"/$org/settings/connections",params:{org:f.slug},search:{}})},T=async c=>{let S,V=null,R=null,B=null;c.ui_type==="NPX"?(S="STDIO",V="",B=Rt(c.npx_package||"",c.env_vars||[])):c.ui_type==="STDIO"?(S="STDIO",V="",B=Ht(c.stdio_command||"",c.stdio_args||"",c.stdio_cwd,c.env_vars||[])):(S=c.ui_type,V=c.connection_url||"",R=c.connection_token||null);const u=lt("conn");te("connection_custom_created",{connection_type:S,ui_type:c.ui_type}),await h.create.mutateAsync({id:u,title:c.title,description:c.description||null,connection_type:S,connection_url:V,connection_token:R,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:p?.user?.id||"system",organization_id:f.id,icon:c.icon??null,app_name:null,app_id:null,connection_headers:B,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),C(),s.reset(),e({to:"/$org/settings/connections/$appSlug",params:{org:f.slug,appSlug:he({app_name:null,connection_url:V,title:c.title,id:u})}})},G=c=>{c||(P&&C(),s.reset())},H=c=>{const S=c.trim();if(!S)return;const V=!!s.formState.dirtyFields.title,R=!!s.formState.dirtyFields.description,B=!!s.formState.dirtyFields.env_vars,u=k=>{if(k&&(!V&&!s.getValues("title").trim()&&k.title&&s.setValue("title",k.title,{shouldDirty:!1}),!R&&!(s.getValues("description")??"").trim()&&k.description&&s.setValue("description",k.description,{shouldDirty:!1}),!B&&k.envVarKeys?.length)){const se=s.getValues("env_vars")??[],xe=new Set(se.map(r=>r.key)),me=k.envVarKeys.filter(r=>!xe.has(r));me.length>0&&s.setValue("env_vars",[...se,...me.map(r=>({key:r,value:""}))],{shouldDirty:!0})}},$=Ut(S);if($&&l){s.setValue("ui_type","NPX",{shouldDirty:!0}),s.setValue("npx_package",$.packageName,{shouldDirty:!0}),s.setValue("connection_url","",{shouldDirty:!0}),s.setValue("connection_token",null,{shouldDirty:!0}),u(pe({uiType:"NPX",npxPackage:$.packageName}));return}if(S.startsWith("http://")||S.startsWith("https://")){const k=A==="HTTP"||A==="SSE"||A==="Websocket"?A:"HTTP";s.setValue("ui_type",k,{shouldDirty:!0}),s.setValue("connection_url",S,{shouldDirty:!0}),u(pe({uiType:k,connectionUrl:S})??Se({uiType:k,connectionUrl:S,registryItems:L}));return}A==="NPX"&&u(pe({uiType:"NPX",npxPackage:S}))},X=i?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(U,{variant:"outline",onClick:z,children:[t.jsx(Ge,{size:14,className:"sm:hidden"}),t.jsx("span",{className:"hidden sm:inline",children:"Custom Connection"})]})}):null;return t.jsx(t.Fragment,{children:t.jsxs(ue,{children:[(()=>{const c="Create Connection",S="Create a custom connection in your organization. Fill in the details below.",V=s.formState.isSubmitting?"Saving...":"Create Connection",R=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(Q,{control:s.control,name:"ui_type",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Type *"}),t.jsxs(wt,{value:u.value,onValueChange:u.onChange,children:[t.jsx(Z,{children:t.jsx(Tt,{children:t.jsx(It,{})})}),t.jsxs(Pt,{children:[t.jsx(ae,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(je,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(ae,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(je,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(ae,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(je,{className:"w-4 h-4"}),"Websocket"]})}),l&&t.jsxs(t.Fragment,{children:[t.jsx(ae,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ge,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(ae,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Mt,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(ee,{})]})}),A==="NPX"&&t.jsx(Q,{control:s.control,name:"npx_package",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:"NPM Package *"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"@perplexity-ai/mcp-server",...u,value:u.value??"",onPaste:$=>{const k=$.clipboardData.getData("text");k&&($.preventDefault(),s.setValue("npx_package",k.trim(),{shouldDirty:!0}),H(k))},onBlur:$=>{H($.target.value),u.onBlur()}})}),t.jsx(ee,{})]})}),A==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(Q,{control:s.control,name:"stdio_command",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Command *"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"node, bun, python...",...u,value:u.value??""})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:s.control,name:"stdio_args",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Arguments"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"arg1 arg2 --flag value",...u,value:u.value??""})}),t.jsx(ee,{})]})})]}),t.jsx(Q,{control:s.control,name:"stdio_cwd",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Working Directory"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"/path/to/project (optional)",...u,value:u.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),t.jsx(ee,{})]})})]}),(A==="NPX"||A==="STDIO")&&t.jsx(Q,{control:s.control,name:"env_vars",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Environment Variables"}),t.jsx(Z,{children:t.jsx(Bt,{value:u.value??[],onChange:u.onChange})}),t.jsx(ee,{})]})}),A!=="NPX"&&A!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(Q,{control:s.control,name:"connection_url",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:"URL *"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"https://example.com/mcp",...u,value:u.value??"",onPaste:$=>{const k=$.clipboardData.getData("text");k&&($.preventDefault(),s.setValue("connection_url",k.trim(),{shouldDirty:!0}),H(k))},onBlur:$=>{H($.target.value),u.onBlur()}})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:s.control,name:"connection_token",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:w?.token?.label??"Token (optional)"}),t.jsx(Z,{children:t.jsx(ie,{type:"password",placeholder:w?.token?.placeholder??"Bearer token or API key",...u,value:u.value??""})}),w?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[w.token.helperText,w.id==="github"&&t.jsxs(t.Fragment,{children:[" ","·"," ",t.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:"Open GitHub PAT settings"})]})]}),t.jsx(ee,{})]})})]}),t.jsx(Q,{control:s.control,name:"title",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Name *"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"My Connection",...u})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:s.control,name:"description",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Description"}),t.jsx(Z,{children:t.jsx($t,{placeholder:"A brief description of this connection",rows:3,...u,value:u.value??""})}),t.jsx(ee,{})]})})]}),B=P;return o?t.jsx(vt,{open:B,onOpenChange:G,children:t.jsxs(St,{className:"max-h-[90vh]",children:[t.jsx(bt,{className:"pb-2",children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"flex-1 text-left",children:[t.jsx(_t,{children:c}),t.jsx(Nt,{className:"mt-1",children:S})]}),t.jsx(Dt,{asChild:!0,children:t.jsx(U,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:t.jsx(Je,{size:16})})})]})}),t.jsx(ve,{...s,children:t.jsxs("form",{onSubmit:s.handleSubmit(T),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:R}),t.jsx(kt,{children:t.jsx(U,{type:"submit",disabled:s.formState.isSubmitting,className:"w-full",children:V})})]})})]})}):t.jsx(Me,{open:B,onOpenChange:G,children:t.jsxs(ze,{className:"sm:max-w-[525px]",children:[t.jsxs(Ve,{children:[t.jsx(Ee,{children:c}),t.jsx(Be,{children:S})]}),t.jsx(ve,{...s,children:t.jsxs("form",{onSubmit:s.handleSubmit(T),children:[t.jsx("div",{className:"py-4",children:R}),t.jsxs(Ke,{children:[t.jsx(U,{type:"button",variant:"outline",onClick:()=>G(!1),children:"Cancel"}),t.jsx(U,{type:"submit",disabled:s.formState.isSubmitting,className:"min-w-40",children:V})]})]})})]})})})(),t.jsx(ue.Content,{children:t.jsx(ue.Body,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(ue.Title,{children:"Connections"}),t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(mt,{value:g.search,onChange:g.setSearch,placeholder:"Search for a connection",className:"w-full md:w-[375px]",onKeyDown:c=>{c.key==="Escape"&&(g.setSearch(""),c.target.blur())}}),t.jsx(dt,{sortKey:g.sortKey,sortDirection:g.sortDirection,onSort:g.handleSort,sortOptions:[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"connection_type",label:"Type"},{id:"updated_by",label:"Updated by"},{id:"updated_at",label:"Updated"}],filters:[{label:"Type",value:N,onChange:c=>b(c||"ALL"),options:[{id:"ALL",label:"All"},{id:"HTTP",label:"HTTP"},{id:"SSE",label:"SSE"},{id:"Websocket",label:"WebSocket"},{id:"STDIO",label:"STDIO"}]},{label:"Status",value:a,onChange:c=>x(c||"ALL"),options:[{id:"ALL",label:"All"},{id:"active",label:"Active"},{id:"inactive",label:"Inactive"},{id:"error",label:"Error"}]},..._.length>1?[{label:"Registry",value:m,onChange:c=>v(c||"ALL"),options:[{id:"ALL",label:"All registries"},..._.map(c=>({id:c.id,label:c.id.includes("community-registry")?"Community MCP Registry":c.title}))]}]:[]]})]}),X]}),t.jsx(ut,{tabs:[{id:"all",label:"All"},{id:"connected",label:"Connected"}],activeTab:j,onTabChange:c=>{const S=c;S!==j&&te("connections_page_tab_changed",{to_tab:S}),y(S)}}),t.jsx(E.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ce,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:O?.5:1,transition:O?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:O?"none":"auto"},children:t.jsx(on,{listState:g,activeTab:j,typeFilter:N,statusFilter:a,registryFilter:m,enabledRegistries:_})})})]})})})]})})}function Fs(){const f=oe.c(1);let e;return f[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ye,{children:t.jsx(E.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ce,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(rn,{})})}),f[0]=e):e=f[0],e}export{Fs as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as i,j as a,dE as y,P as T,Q as v,dF as O,dG as j,dH as G,dI as $,bP as k,dJ as D,dK as _,U,dL as L,dM as z,dN as B,dO as F,dP as H,dQ as X,dR as K,dS as Q,dT as W,c as C,l as g}from"./index-UyzF2Wxm.js";var h="ContextMenu",[J]=U(h,[_]),u=_(),[Y,R]=J(h),P=n=>{const{__scopeContextMenu:e,children:o,onOpenChange:t,dir:r,modal:s=!0}=n,[d,c]=i.useState(!1),x=u(e),m=k(t),l=i.useCallback(f=>{c(f),m(f)},[m]);return a.jsx(Y,{scope:e,open:d,onOpenChange:l,modal:s,children:a.jsx(D,{...x,dir:r,open:d,onOpenChange:l,modal:s,children:o})})};P.displayName=h;var N="ContextMenuTrigger",b=i.forwardRef((n,e)=>{const{__scopeContextMenu:o,disabled:t=!1,...r}=n,s=R(N,o),d=u(o),c=i.useRef({x:0,y:0}),x=i.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...c.current})}),m=i.useRef(0),l=i.useCallback(()=>window.clearTimeout(m.current),[]),f=p=>{c.current={x:p.clientX,y:p.clientY},s.onOpenChange(!0)};return i.useEffect(()=>l,[l]),i.useEffect(()=>{t&&l()},[t,l]),a.jsxs(a.Fragment,{children:[a.jsx(y,{...d,virtualRef:x}),a.jsx(T.span,{"data-state":s.open?"open":"closed","data-disabled":t?"":void 0,...r,ref:e,style:{WebkitTouchCallout:"none",...n.style},onContextMenu:t?n.onContextMenu:v(n.onContextMenu,p=>{l(),f(p),p.preventDefault()}),onPointerDown:t?n.onPointerDown:v(n.onPointerDown,M(p=>{l(),m.current=window.setTimeout(()=>f(p),700)})),onPointerMove:t?n.onPointerMove:v(n.onPointerMove,M(l)),onPointerCancel:t?n.onPointerCancel:v(n.onPointerCancel,M(l)),onPointerUp:t?n.onPointerUp:v(n.onPointerUp,M(l))})]})});b.displayName=N;var q="ContextMenuPortal",w=n=>{const{__scopeContextMenu:e,...o}=n,t=u(e);return a.jsx(G,{...t,...o})};w.displayName=q;var E="ContextMenuContent",I=i.forwardRef((n,e)=>{const{__scopeContextMenu:o,...t}=n,r=R(E,o),s=u(o),d=i.useRef(!1);return a.jsx($,{...s,...t,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:c=>{n.onCloseAutoFocus?.(c),!c.defaultPrevented&&d.current&&c.preventDefault(),d.current=!1},onInteractOutside:c=>{n.onInteractOutside?.(c),!c.defaultPrevented&&!r.modal&&(d.current=!0)},style:{...n.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)"}})});I.displayName=E;var V="ContextMenuGroup",Z=i.forwardRef((n,e)=>{const{__scopeContextMenu:o,...t}=n,r=u(o);return a.jsx(L,{...r,...t,ref:e})});Z.displayName=V;var ee="ContextMenuLabel",te=i.forwardRef((n,e)=>{const{__scopeContextMenu:o,...t}=n,r=u(o);return a.jsx(z,{...r,...t,ref:e})});te.displayName=ee;var ne="ContextMenuItem",S=i.forwardRef((n,e)=>{const{__scopeContextMenu:o,...t}=n,r=u(o);return a.jsx(O,{...r,...t,ref:e})});S.displayName=ne;var oe="ContextMenuCheckboxItem",re=i.forwardRef((n,e)=>{const{__scopeContextMenu:o,...t}=n,r=u(o);return a.jsx(B,{...r,...t,ref:e})});re.displayName=oe;var ae="ContextMenuRadioGroup",se=i.forwardRef((n,e)=>{const{__scopeContextMenu:o,...t}=n,r=u(o);return a.jsx(F,{...r,...t,ref:e})});se.displayName=ae;var ie="ContextMenuRadioItem",ce=i.forwardRef((n,e)=>{const{__scopeContextMenu:o,...t}=n,r=u(o);return a.jsx(H,{...r,...t,ref:e})});ce.displayName=ie;var ue="ContextMenuItemIndicator",de=i.forwardRef((n,e)=>{const{__scopeContextMenu:o,...t}=n,r=u(o);return a.jsx(X,{...r,...t,ref:e})});de.displayName=ue;var le="ContextMenuSeparator",A=i.forwardRef((n,e)=>{const{__scopeContextMenu:o,...t}=n,r=u(o);return a.jsx(j,{...r,...t,ref:e})});A.displayName=le;var xe="ContextMenuArrow",pe=i.forwardRef((n,e)=>{const{__scopeContextMenu:o,...t}=n,r=u(o);return a.jsx(K,{...r,...t,ref:e})});pe.displayName=xe;var me="ContextMenuSubTrigger",fe=i.forwardRef((n,e)=>{const{__scopeContextMenu:o,...t}=n,r=u(o);return a.jsx(Q,{...r,...t,ref:e})});fe.displayName=me;var ve="ContextMenuSubContent",Ce=i.forwardRef((n,e)=>{const{__scopeContextMenu:o,...t}=n,r=u(o);return a.jsx(W,{...r,...t,ref:e,style:{...n.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)"}})});Ce.displayName=ve;function M(n){return e=>e.pointerType!=="mouse"?n(e):void 0}var Me=P,ge=b,he=w,_e=I,Re=S,Pe=A;function be(n){const e=C.c(4);let o;e[0]!==n?({...o}=n,e[0]=n,e[1]=o):o=e[1];let t;return e[2]!==o?(t=a.jsx(Me,{"data-slot":"context-menu",...o}),e[2]=o,e[3]=t):t=e[3],t}function we(n){const e=C.c(4);let o;e[0]!==n?({...o}=n,e[0]=n,e[1]=o):o=e[1];let t;return e[2]!==o?(t=a.jsx(ge,{"data-slot":"context-menu-trigger",...o}),e[2]=o,e[3]=t):t=e[3],t}function Ee(n){const e=C.c(8);let o,t;e[0]!==n?({className:o,...t}=n,e[0]=n,e[1]=o,e[2]=t):(o=e[1],t=e[2]);let r;e[3]!==o?(r=g("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",o),e[3]=o,e[4]=r):r=e[4];let s;return e[5]!==t||e[6]!==r?(s=a.jsx(he,{children:a.jsx(_e,{"data-slot":"context-menu-content",className:r,...t})}),e[5]=t,e[6]=r,e[7]=s):s=e[7],s}function Ie(n){const e=C.c(12);let o,t,r,s;e[0]!==n?({className:o,inset:t,variant:s,...r}=n,e[0]=n,e[1]=o,e[2]=t,e[3]=r,e[4]=s):(o=e[1],t=e[2],r=e[3],s=e[4]);const d=s===void 0?"default":s;let c;e[5]!==o?(c=g("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",o),e[5]=o,e[6]=c):c=e[6];let x;return e[7]!==t||e[8]!==r||e[9]!==c||e[10]!==d?(x=a.jsx(Re,{"data-slot":"context-menu-item","data-inset":t,"data-variant":d,className:c,...r}),e[7]=t,e[8]=r,e[9]=c,e[10]=d,e[11]=x):x=e[11],x}function Se(n){const e=C.c(8);let o,t;e[0]!==n?({className:o,...t}=n,e[0]=n,e[1]=o,e[2]=t):(o=e[1],t=e[2]);let r;e[3]!==o?(r=g("bg-border -mx-1 my-1 h-px",o),e[3]=o,e[4]=r):r=e[4];let s;return e[5]!==t||e[6]!==r?(s=a.jsx(Pe,{"data-slot":"context-menu-separator",className:r,...t}),e[5]=t,e[6]=r,e[7]=s):s=e[7],s}export{Ie as C,Se as a,we as b,Ee as c,be as d};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as Ke,r as l,j as i,i as re,B as fe,l as Ve,m as ut,t as $,K as Te}from"./index-UyzF2Wxm.js";import{F as mt,l as pt}from"./index-DR6YHYZo.js";import{e as ht,at as xt,au as gt,av as ae,aw as yt,N as $e}from"./agent-icon-BMQHBhP6.js";import{a as wt}from"./Tool01-BgzvuPeY.js";import{s as jt}from"./XClose-DcfEQwVh.js";import{S as bt}from"./scroll-area-BBReqUns.js";import{b as Oe,T as Re,a as ze}from"./tooltip-C7L4o0rn.js";import{f as vt,a as Ct,b as Nt,c as St,d as Dt,e as kt,A as Ft,g as Lt}from"./alert-dialog-0uOi3HqZ.js";import{u as Et}from"./chat-context-Dqu5Dj_J.js";import{b as Pt}from"./shell-layout-Ch8BfEKU.js";import{ae as le,af as Ae,ag as Tt}from"./index-CqVkj8du.js";import{a as $t,b as Ot,D as Rt,e as zt,c as At,d as Wt}from"./dialog-AE8ChAe3.js";import{I as We}from"./input-CTZybS4f.js";import{b as It,C as _,a as Ie,c as Mt,d as Kt}from"./context-menu-CwmbYH1X.js";import{t as Vt}from"./ChevronDown-C_njLrOU.js";import{i as Bt}from"./ChevronRight-D1duQehP.js";import{a as Gt}from"./ZoomOut-Csc4IU4b.js";import{E as qt,z as Me,A as he,B as Qt,C as Ut,D as Jt,G as M,I as ce,g as xe,J as ge,K as Ht,M as Xt,N as ye,O as de,P as we,Q as Yt,U as Zt}from"./preview-dialog-Bnu3vr0P.js";import"./AlertCircle-Diz6uT7Y.js";import"./SwitchHorizontal01-vo5MpXEz.js";import"./Settings02-BvivcyYL.js";import"./XCircle-B88UxHjD.js";import"./ArrowUpRight-Bo4YThIl.js";import"./ZapSquare-BfSTQonf.js";import"./Users03-ClWrctLP.js";import"./CheckCircle-BSFt0_RZ.js";import"./ChevronUp-_gM_dQkt.js";import"./ChevronLeft-ByQFERqp.js";import"./DotsVertical-BJnhQ8u0.js";import"./Stars02-CVb_b-OZ.js";import"./Eye-SUXNGsVY.js";import"./Globe01-CNw0uMhK.js";import"./FilterLines-CxIQYlMz.js";import"./Star01-Ds91SJzA.js";import"./Globe04-B24hCYmg.js";import"./HardDrive-IPJJMMij.js";import"./Key01-CES8n-fG.js";import"./LayoutLeft-D3mZzNi0.js";import"./LinkExternal01-B8zRpPza.js";import"./Monitor01-Uh-3HvZI.js";import"./Sun-tLN4vA6M.js";import"./Palette-Du66341h.js";import"./Play-CVoFjR5I.js";import"./Plus-DoMNANl8.js";import"./SearchMd-B-bL1wjq.js";import"./Shield01-BewRt7sw.js";import"./Stars01-PS518Jif.js";import"./Trash01-D84eyfFz.js";import"./Upload01-BA5iKtAl.js";import"./User01-CeCQHgwg.js";import"./Users01-DtmLcsFN.js";import"./X-2HGWB7Oo.js";import"./Zap-BeB31T8Y.js";import"./use-clock-tick-Bp0qVbdD.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-H4KuRxx2.js";import"./file-type-icon-BOraV8Gq.js";import"./tab-id-BptcWVWa.js";import"./content-blocks-o63cs2vh.js";import"./types-CppGS_VJ.js";import"./use-mcp-client-Cv0jyhEU.js";import"./auth-CCI_mhgC.js";import"./hooks-DwlYXenh.js";import"./decopilot-sse-pool-_mJQvJZ7.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./studio-tools-C1AZbzwg.js";import"./sheet-DALs-qBg.js";import"./integration-icon-CslqVkci.js";import"./use-virtual-mcp-iRRxKkRN.js";import"./use-collections-CXeEMOwb.js";import"./use-navigate-to-agent-CytgRfBH.js";import"./use-connection-DqvYiUe3.js";import"./use-mcp-prompts-CPZOOi8c.js";import"./form-teSq_9QK.js";import"./label-Djcog1jo.js";import"./select-CYFnhI-Q.js";import"./use-ai-providers-Deso-Vyj.js";import"./use-organization-settings-DPqJ7ETy.js";import"./avatar-CtVVLapD.js";import"./required-auth-layout-clm6boiC.js";import"./use-org-sso-QBVELOwd.js";import"./index-CKtGWWKI.js";import"./drawer-Di9WrlRG.js";import"./collection-search-D6nD206z.js";import"./tabs-D__sk4iN.js";import"./toggle-group-5CInie8P.js";import"./use-deco-credits-rzfxapgg.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-BwnCXxRf.js";import"./use-registry-connections-DQ1fpeHW.js";import"./useInfiniteQuery-DVN2QYOz.js";import"./use-infinite-scroll-BpnVw1p2.js";import"./extract-connection-data-BumzxLvt.js";import"./card-DZtTT5Es.js";import"./collection-tabs-cs02GObx.js";import"./badge-BFvLiE20.js";import"./textarea-DmmCVjU6.js";import"./connection-form-helpers-Csy5hutj.js";import"./authenticate-and-persist-oauth-eSHjAd3t.js";import"./mcp-oauth-BcPuGj2k.js";import"./useSuspenseInfiniteQuery-BKCXXvPp.js";import"./connect-desktop-dialog-DNAK4U2K.js";import"./decopilot-CLVJpS6M.js";import"./checkbox-CHXOcnVE.js";import"./skeleton-BqZgigOh.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-DOlV_atx.js";import"./popover-DG0h5msu.js";import"./command-DhLgZpjn.js";import"./index-DnCrG3F_.js";import"./dropdown-menu-ecBYljKf.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-BaJ0EN3G.js";import"./empty-state-CegPWPc0.js";import"./toolbar-Bm-rdLjh.js";import"./use-mcp-tools-z50pjVux.js";import"./use-capability-CGVlaZtI.js";import"./shell-route-loading-RsrwOcS1.js";import"./index-C4YdUUl9.js";import"./switch-DRDIUTD7.js";import"./use-debounced-autosave-Ct9kek4B.js";import"./index-DJiEBchG.js";import"./sidebar-hZIrovG4.js";import"./search-input-D9asghaf.js";import"./github-repo-picker-LA1Jld2f.js";import"./use-secrets-C3RMGjE2.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./view-mode-toggle-DnLJJSFI.js";import"./select-model-35S1fWTq.js";import"./use-automations-DdPVJNl5.js";import"./monaco-editor-DnGtg8Ra.js";import"./automation-runs-CNqGFhXQ.js";import"./table-tYYVDDAQ.js";import"./use-members-jM6HOjam.js";import"./use-org-auth-client-DjPrRX3t.js";import"./task-status-CftQiZKN.js";import"./automation-list-row-Ct9jaHYX.js";const _t={"new-file":{title:"New File",description:"Enter a name for the new file.",submit:"Create",placeholder:"filename.ts"},"new-folder":{title:"New Folder",description:"Enter a name for the new folder.",submit:"Create",placeholder:"folder-name"},rename:{title:"Rename",description:"Enter a new name for this item.",submit:"Rename",placeholder:"new-name"}};function en(y){const e=Ke.c(51),{open:c,mode:K,initialName:X,parentLabel:Q,isPending:A,onSubmit:V,onOpenChange:P}=y,W=X===void 0?"":X,o=A===void 0?!1:A,[p,O]=l.useState(W),[I,B]=l.useState(c),f=_t[K];c!==I&&(B(c),c&&O(W));let F;e[0]!==o||e[1]!==P?(F=E=>{!E&&!o&&P(!1)},e[0]=o,e[1]=P,e[2]=F):F=e[2];const U=F;let G;e[3]!==o||e[4]!==p||e[5]!==V?(G=async E=>{E.preventDefault();const z=p.trim();!z||o||await V(z)},e[3]=o,e[4]=p,e[5]=V,e[6]=G):G=e[6];const q=G;let L;e[7]!==f.title?(L=i.jsx($t,{children:f.title}),e[7]=f.title,e[8]=L):L=e[8];let N;e[9]!==f.description?(N=i.jsx(Ot,{children:f.description}),e[9]=f.description,e[10]=N):N=e[10];let R;e[11]!==L||e[12]!==N?(R=i.jsxs(Rt,{children:[L,N]}),e[11]=L,e[12]=N,e[13]=R):R=e[13];let S;e[14]!==Q?(S=Q&&i.jsxs("div",{className:"space-y-1.5",children:[i.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Location"}),i.jsx(We,{value:Q,readOnly:!0,disabled:!0,className:"font-mono text-xs"})]}),e[14]=Q,e[15]=S):S=e[15];let D;e[16]===Symbol.for("react.memo_cache_sentinel")?(D=i.jsx("label",{htmlFor:"file-explorer-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[16]=D):D=e[16];let j;e[17]===Symbol.for("react.memo_cache_sentinel")?(j=E=>O(E.target.value),e[17]=j):j=e[17];let b;e[18]!==f.placeholder||e[19]!==o||e[20]!==p?(b=i.jsxs("div",{className:"space-y-1.5",children:[D,i.jsx(We,{id:"file-explorer-name",value:p,onChange:j,placeholder:f.placeholder,autoFocus:!0,disabled:o})]}),e[18]=f.placeholder,e[19]=o,e[20]=p,e[21]=b):b=e[21];let h;e[22]!==b||e[23]!==S?(h=i.jsxs("div",{className:"space-y-4 py-4",children:[S,b]}),e[22]=b,e[23]=S,e[24]=h):h=e[24];let x;e[25]!==P?(x=()=>P(!1),e[25]=P,e[26]=x):x=e[26];let v;e[27]!==o||e[28]!==x?(v=i.jsx(fe,{type:"button",variant:"outline",onClick:x,disabled:o,children:"Cancel"}),e[27]=o,e[28]=x,e[29]=v):v=e[29];let C;e[30]!==o||e[31]!==p?(C=!p.trim()||o,e[30]=o,e[31]=p,e[32]=C):C=e[32];let u;e[33]!==f.submit||e[34]!==o?(u=o?i.jsxs(i.Fragment,{children:[i.jsx(re,{size:14,className:"animate-spin"}),"Saving…"]}):f.submit,e[33]=f.submit,e[34]=o,e[35]=u):u=e[35];let k;e[36]!==C||e[37]!==u?(k=i.jsx(fe,{type:"submit",disabled:C,children:u}),e[36]=C,e[37]=u,e[38]=k):k=e[38];let m;e[39]!==v||e[40]!==k?(m=i.jsxs(zt,{children:[v,k]}),e[39]=v,e[40]=k,e[41]=m):m=e[41];let g;e[42]!==q||e[43]!==h||e[44]!==m||e[45]!==R?(g=i.jsx(At,{className:"sm:max-w-md",children:i.jsxs("form",{onSubmit:q,children:[R,h,m]})}),e[42]=q,e[43]=h,e[44]=m,e[45]=R,e[46]=g):g=e[46];let T;return e[47]!==U||e[48]!==c||e[49]!==g?(T=i.jsx(Wt,{open:c,onOpenChange:U,children:g}),e[47]=U,e[48]=c,e[49]=g,e[50]=T):T=e[50],T}const tn="#d9a441";function nn(y){const e=Ke.c(45),{node:c,depth:K,isExpanded:X,isSelected:Q,isLoading:A,fileVisual:V,onOpen:P,onSelect:W,onNewFile:o,onNewFolder:p,onCopyPath:O,onCopyRelativePath:I,onRename:B,onDelete:f}=y,F=A===void 0?!1:A,U=c.kind==="directory",{Icon:G,color:q}=V,L=Q&&"bg-accent";let N;e[0]!==L?(N=Ve("flex w-full items-center gap-1.5 px-2 py-1.5 text-left text-[13px] hover:bg-accent transition-colors",L),e[0]=L,e[1]=N):N=e[1];const R=`${K*14+8}px`;let S;e[2]!==R?(S={paddingLeft:R},e[2]=R,e[3]=S):S=e[3];let D;e[4]!==P||e[5]!==W?(D=()=>{W(),P()},e[4]=P,e[5]=W,e[6]=D):D=e[6];let j;e[7]!==G||e[8]!==q||e[9]!==U||e[10]!==X||e[11]!==F?(j=U?i.jsxs(i.Fragment,{children:[F?i.jsx(re,{size:14,className:"shrink-0 animate-spin text-muted-foreground"}):X?i.jsx(Vt,{size:14,className:"shrink-0 text-muted-foreground"}):i.jsx(Bt,{size:14,className:"shrink-0 text-muted-foreground"}),i.jsx(Gt,{size:16,className:"shrink-0",style:{color:tn}})]}):i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"w-3.5 shrink-0"}),i.jsx(G,{size:16,className:"shrink-0",style:{color:q}})]}),e[7]=G,e[8]=q,e[9]=U,e[10]=X,e[11]=F,e[12]=j):j=e[12];let b;e[13]!==c.name?(b=i.jsx("span",{className:"truncate",children:c.name}),e[13]=c.name,e[14]=b):b=e[14];let h;e[15]!==N||e[16]!==S||e[17]!==D||e[18]!==j||e[19]!==b?(h=i.jsx(It,{asChild:!0,children:i.jsxs("button",{type:"button",className:N,style:S,onClick:D,children:[j,b]})}),e[15]=N,e[16]=S,e[17]=D,e[18]=j,e[19]=b,e[20]=h):h=e[20];let x;e[21]!==o?(x=i.jsx(_,{onSelect:o,children:"New File"}),e[21]=o,e[22]=x):x=e[22];let v;e[23]!==p?(v=i.jsx(_,{onSelect:p,children:"New Folder"}),e[23]=p,e[24]=v):v=e[24];let C;e[25]===Symbol.for("react.memo_cache_sentinel")?(C=i.jsx(Ie,{}),e[25]=C):C=e[25];let u;e[26]!==O?(u=i.jsx(_,{onSelect:O,children:"Copy Path"}),e[26]=O,e[27]=u):u=e[27];let k;e[28]!==I?(k=i.jsx(_,{onSelect:I,children:"Copy Relative Path"}),e[28]=I,e[29]=k):k=e[29];let m;e[30]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(Ie,{}),e[30]=m):m=e[30];let g;e[31]!==B?(g=i.jsx(_,{onSelect:B,children:"Rename"}),e[31]=B,e[32]=g):g=e[32];let T;e[33]!==f?(T=i.jsx(_,{variant:"destructive",onSelect:f,children:"Delete"}),e[33]=f,e[34]=T):T=e[34];let E;e[35]!==x||e[36]!==v||e[37]!==u||e[38]!==k||e[39]!==g||e[40]!==T?(E=i.jsxs(Mt,{className:"w-52",children:[x,v,C,u,k,m,g,T]}),e[35]=x,e[36]=v,e[37]=u,e[38]=k,e[39]=g,e[40]=T,e[41]=E):E=e[41];let z;return e[42]!==E||e[43]!==h?(z=i.jsxs(Kt,{children:[h,E]}),e[42]=E,e[43]=h,e[44]=z):z=e[44],z}pt.config({paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.0/min/vs"}});function je(y,e,c,K){return`/api/${y}/sandbox/${encodeURIComponent(e)}/${encodeURIComponent(c)}/${K}`}function rn(y){const e=M(y);return!e||e.includes("..")||e.includes("\\")?!1:e.startsWith(".deco/blocks/")||!e.startsWith("/")&&!e.includes("://")}const sn="#94a3b8";function on(y){const e=y.toLowerCase();return e.endsWith(".tsx")||e.endsWith(".ts")?{Icon:ae,color:"#3b82f6"}:e.endsWith(".jsx")||e.endsWith(".js")||e.endsWith(".mjs")||e.endsWith(".cjs")?{Icon:ae,color:"#d9a441"}:e.endsWith(".json")?{Icon:yt,color:"#cb9b3f"}:e.endsWith(".css")||e.endsWith(".scss")?{Icon:ae,color:"#06b6d4"}:e.endsWith(".html")||e.endsWith(".xml")?{Icon:ae,color:"#f97316"}:/\.(png|jpe?g|gif|webp|avif|ico|svg)$/.test(e)?{Icon:wt,color:"#a855f7"}:e.endsWith(".md")||e.endsWith(".mdx")?{Icon:$e,color:"#64748b"}:{Icon:$e,color:sn}}function Ai({orgSlug:y,virtualMcpId:e,branch:c,openPath:K}){const[X,Q]=l.useState({files:[],directories:[],truncated:!1}),{files:A,directories:V}=X,[P,W]=l.useState(new Set),[o,p]=l.useState(null),[O,I]=l.useState(null),[B,f]=l.useState([]),[F,U]=l.useState(""),[G,q]=l.useState(!1),[L,N]=l.useState(!1),[,R]=l.useState(new Set),[S,D]=l.useState(new Set),j=l.useRef(0),b=l.useRef(null),h=l.useRef(new Set),x=l.useRef(new Map);function v(t){R(n=>{const r=typeof t=="function"?t(n):t;return h.current=r,r})}const[C,u]=l.useState(new Map),k=l.useRef(null),[m,g]=l.useState(null),{sendMessage:T}=Et(),{setChatOpen:E}=Pt(),z=ut(),[w,J]=l.useState(null),[H,ue]=l.useState(null),[ee,ie]=l.useState(!1);async function te(t,n){const r=await fetch(je(y,e,c,t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(n)});if(!r.ok){const s=await r.json().catch(()=>({}));throw new Error(s.error??`Request failed (${r.status})`)}return r.json()}async function se(){z.invalidateQueries({queryKey:Ae(y,e,c)})}function be(t,n){navigator.clipboard.writeText(n).then(()=>$.success(`${t} copied`),()=>$.error(`Failed to copy ${t.toLowerCase()}`))}function Be(t){const n=Yt(t);if(!n)return;const r=`${y}/${e}/${c}`;z.setQueryData(Te.decofile(r),s=>{if(!s)return s;const{[n]:a,...d}=s;return d}),z.invalidateQueries({queryKey:Te.liveMeta(r)})}function Ge(t){const n=t.kind==="file"?[t.path]:A.filter(r=>r.startsWith(".deco/blocks/")).map(r=>ce(r)).filter(r=>r===t.path||r.startsWith(`${t.path}/`));for(const r of n)Be(r)}function qe(t){const n=ce(t);return B.filter(r=>{if(r!==n&&!r.startsWith(`${n}/`))return!1;const s=C.get(r);return!!(s?.loaded&&s.editorValue!==s.savedContent)})}function ve(t){f(n=>n.map(r=>t(r)).filter(r=>r!==null)),p(n=>n&&t(n)),u(n=>{const r=new Map;for(const[s,a]of n){const d=t(s);d&&r.set(d,a)}return r}),I(n=>{if(!n)return n;const r=t(n.path);return r?r===n.path?n:{...n,path:r,name:r.split("/").pop()??r}:null})}function Qe(t){const n=ce(t);I(r=>r&&(r.path===n||r.path.startsWith(`${n}/`)?null:r)),ve(r=>r===n||r.startsWith(`${n}/`)?null:r)}async function Ue(t){if(!w)return;const n=de(w.parentDir,t);if(we(n,A,V))throw new Error(`"${t}" already exists`);await te("write",{path:M(n),content:""}),await ne(),await se(),J(null),me(n)}async function Je(t){if(!w)return;const n=de(w.parentDir,t);if(we(n,A,V))throw new Error(`"${t}" already exists`);const r=M(n);await te("mkdir",{path:r}),Q(s=>({...s,directories:s.directories.includes(r)?s.directories:[...s.directories,r]})),await ne(),await se(),J(null),W(s=>{const a=new Set(s);for(const d of he(n))a.add(d);return a.add(n),a}),I({name:t,path:n,kind:"directory",children:[]})}async function He(t){if(!w)return;const n=w.node.path,r=ye(n),s=de(r,t);if(s===n){J(null);return}if(we(s,A,V))throw new Error(`"${t}" already exists`);await te("rename",{from:M(n),to:M(s)}),ve(a=>a===n?s:a.startsWith(`${n}/`)?de(s,a.slice(n.length+1)):a),await ne(),await se(),J(null)}async function Xe(t){ie(!0);try{await te("unlink",{path:M(t.path),recursive:t.kind==="directory"}),Ge(t),Qe(t.path),await ne(),await se(),ue(null),$.success(`Deleted "${t.name}"`)}catch(n){$.error(n instanceof Error?n.message:"Delete failed")}finally{ie(!1)}}async function Ye(t){const n=Xt(t);if(n){$.error(n);return}ie(!0);try{w?.mode==="new-file"?(await Ue(t),$.success(`Created "${t}"`)):w?.mode==="new-folder"?(await Je(t),$.success(`Created folder "${t}"`)):w?.mode==="rename"&&(await He(t),$.success(`Renamed to "${t}"`))}catch(r){$.error(r instanceof Error?r.message:"Operation failed")}finally{ie(!1)}}const Ce=l.useRef(!1);Ce.current||(Ce.current=!0,b.current=ne());const[Ze,_e]=l.useState(null);if(K&&K!==Ze){_e(K);const t=K;queueMicrotask(()=>{rn(t)&&me(t).catch(n=>{$.error(n instanceof Error?n.message:"Failed to open file")})})}async function Ne(t){const n=await te("glob",t);return{files:n.files??[],directories:n.directories??[],truncated:n.truncated}}function Se(t,n,r){if(r!==j.current)return!1;let s=!1;return Q(a=>{const d=n?Zt(a.files,a.directories,t,a.truncated):{files:t.files,directories:t.directories??[],truncated:!!t.truncated};return s=!!d.truncated,{files:d.files,directories:d.directories,truncated:s}}),s&&$.warning("File list truncated — some files may be hidden"),s}async function et(t){const n=x.current.get(t);if(n)return n;const r=j.current,s=(async()=>{const a=await Ne({pattern:"**/*",path:M(t),limit:Me}),d=Se(a,!0,r);return!d&&r===j.current&&v(Y=>{const oe=new Set(Y);return oe.add(t),oe}),d})();x.current.set(t,s);try{return await s}finally{x.current.delete(t)}}async function De(t){if(!ge(t,h.current))return!1;D(n=>new Set(n).add(t));try{return await et(t)}finally{D(n=>{const r=new Set(n);return r.delete(t),r})}}async function tt(t){const n=new Set(h.current);for(const r of he(t)){if(!ge(r,n))continue;if(await De(r))throw new Error("Folder listing truncated — expand again to load more");n.add(r)}}async function ne(){const t=++j.current;x.current.clear(),q(!0),v(new Set),W(new Set),D(new Set);try{const n=await Ne({pattern:"**/*",limit:Me,maxDepth:qt});Se(n,!1,t),N(!0)}catch{L&&$.error("Failed to refresh file tree")}finally{q(!1)}}async function ke(t){if(!C.get(t)?.loaded){u(r=>{const s=new Map(r);return s.set(t,{savedContent:"",editorValue:"",loaded:!1}),s});try{const r=await fetch(je(y,e,c,"read"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:M(t),full:!0})});if(!r.ok)return;const s=await r.json(),a=Ht(s.content??"");u(d=>{const Y=new Map(d);return Y.set(t,{savedContent:a,editorValue:a,loaded:!0}),Y})}catch{}}}async function nt(t,n){try{const r=await fetch(je(y,e,c,"write"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:M(t),content:n})});if(!r.ok){le("file save failed",{path:t,status:r.status});return}le("file saved via sandbox /write",{path:t}),z.invalidateQueries({queryKey:Ae(y,e,c)});try{const s=await Tt(y,e,c);le("git status after save",s)}catch(s){le("git status after save failed",{path:t,error:s instanceof Error?s.message:String(s)})}u(s=>{const a=new Map(s),d=a.get(t);return d&&a.set(t,{...d,savedContent:n}),a})}catch{}}function rt(t){p(t),I({name:t.split("/").pop()??t,path:t,kind:"file",children:[]}),g(null),B.includes(t)||f(n=>[...n,t]),ke(t)}function it(t){f(n=>{const r=n.filter(s=>s!==t);return o===t&&p(r[r.length-1]??null),r}),u(n=>{const r=new Map(n);return r.delete(t),r})}function Fe(t){W(n=>{const r=new Set(n);return r.has(t)?r.delete(t):r.add(t),r})}async function st(t){if(ge(t,h.current))try{if(await De(t))return}catch(n){$.error(n instanceof Error?n.message:"Failed to load folder");return}Fe(t)}async function ot(t,n){if(n){Fe(t);return}await st(t)}async function me(t){await b.current,await tt(t);const n=he(t);W(r=>{const s=new Set(r);for(const a of n)s.add(a);return s}),rt(t)}function at(){return O?.kind==="directory"?O.path:O?.kind==="file"?ye(O.path):o?ye(o):"/"}function Le(t){const n=at();J({mode:t,parentDir:n,node:{name:"",path:n,kind:"directory",children:[]}})}const lt=Qt(A,V),Ee=Ut(lt,P),Pe=F?Ee.filter(t=>t.node.name.toLowerCase().includes(F.toLowerCase())):Ee,Z=o?C.get(o):null,ct=Z?.loaded&&Z.editorValue!==Z.savedContent,pe=H?qe(H.path):[],dt=(t,n)=>{k.current=t,t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyS,async()=>{if(!o)return;const r=t.getValue();await nt(o,r)}),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyK,()=>{const r=t.getSelection(),s=t.getModel();if(!r||!s||!o)return;const a=s.getValueInRange(r);g({filePath:o,lineStart:r.startLineNumber,lineEnd:r.endLineNumber,selectedCode:a})})};function ft(t){if(!m)return;const n=[`The user selected code in the file explorer and asked: **"${t.trim()}"**`,"",`**File:** \`${m.filePath}\``,`**Lines:** ${m.lineStart}–${m.lineEnd}`];if(m.selectedCode){const r=xe(m.filePath),s=m.selectedCode.replace(/```/g,"`` `");n.push("","**Selected code:**","```"+r,s,"```")}n.push("","Please read the source file, locate the code, and apply the requested change."),E(!0),T({parts:[{type:"text",text:n.join(`
|
|
2
|
-
`)}]}),g(null)}return G&&!L?i.jsx("div",{className:"flex items-center justify-center h-full w-full",children:i.jsx(re,{size:20,className:"animate-spin text-muted-foreground"})}):i.jsxs("div",{className:"flex h-full w-full overflow-hidden",children:[i.jsxs("div",{className:"w-64 shrink-0 border-r flex flex-col overflow-hidden",children:[i.jsxs("div",{className:"flex items-center gap-1 p-2 border-b",children:[i.jsxs("div",{className:"relative min-w-0 flex-1",children:[i.jsx(ht,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground"}),i.jsx("input",{type:"text",value:F,onChange:t=>U(t.target.value),placeholder:"Search files...","aria-label":"Search files",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"})]}),i.jsxs(Oe,{children:[i.jsx(Re,{asChild:!0,children:i.jsx(fe,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"New file",onClick:()=>Le("new-file"),children:i.jsx(xt,{size:14})})}),i.jsx(ze,{side:"bottom",children:"New file"})]}),i.jsxs(Oe,{children:[i.jsx(Re,{asChild:!0,children:i.jsx(fe,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"New folder",onClick:()=>Le("new-folder"),children:i.jsx(gt,{size:14})})}),i.jsx(ze,{side:"bottom",children:"New folder"})]})]}),i.jsx(bt,{className:"flex-1",children:i.jsxs("div",{className:"py-1",children:[Pe.map(t=>{const{node:n,depth:r}=t,s=n.kind==="directory",a=P.has(n.path),d=O?.path===n.path,Y=Jt(n.path,n.kind),oe=s&&S.has(n.path);return i.jsx(nn,{node:n,depth:r,isExpanded:a,isSelected:d,isLoading:oe,fileVisual:on(n.name),onSelect:()=>I(n),onOpen:()=>{s?ot(n.path,a):me(n.path)},onNewFile:()=>J({mode:"new-file",node:n,parentDir:Y}),onNewFolder:()=>J({mode:"new-folder",node:n,parentDir:Y}),onCopyPath:()=>be("Path",ce(n.path)),onCopyRelativePath:()=>be("Relative path",M(n.path)),onRename:()=>J({mode:"rename",node:n,parentDir:Y}),onDelete:()=>ue(n)},n.path)}),L&&Pe.length===0&&i.jsx("div",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:F?`No files match "${F}"`:"No files found"})]})})]}),i.jsxs("div",{className:"relative flex-1 flex flex-col overflow-hidden",children:[B.length>0&&i.jsx("div",{className:"flex items-center border-b overflow-x-auto shrink-0",children:B.map(t=>{const n=C.get(t),r=n?.loaded&&n.editorValue!==n.savedContent,s=o===t,a=t.split("/").pop()??t;return i.jsxs("div",{className:Ve("flex items-center gap-1 px-3 py-1.5 text-xs border-r cursor-pointer transition-colors",s?"bg-background text-foreground":"bg-muted/50 text-muted-foreground hover:bg-accent"),onClick:()=>{p(t),ke(t)},onKeyDown:()=>{},role:"tab",tabIndex:0,"aria-selected":s,children:[i.jsx("span",{className:"truncate max-w-32",children:a}),r&&i.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-foreground/60 shrink-0"}),i.jsx("button",{type:"button",className:"ml-1 rounded p-0.5 hover:bg-accent-foreground/10",onClick:d=>{d.stopPropagation(),it(t)},children:i.jsx(jt,{size:12})})]},t)})}),m&&i.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 z-20 mt-2",style:{width:"360px"},children:i.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 r=t.currentTarget.elements.namedItem("askAiInput");r.value.trim()&&ft(r.value)},children:[i.jsx("input",{name:"askAiInput",autoFocus:!0,type:"text",placeholder:"Ask the AI...",className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground",onKeyDown:t=>{t.stopPropagation(),t.key==="Escape"&&g(null)}}),i.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:"Send",children:i.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[i.jsx("title",{children:"Send"}),i.jsx("path",{d:"M5 9V1M1 5l4-4 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})}),i.jsx("div",{className:"flex-1 overflow-hidden",children:o&&Z?.loaded?i.jsx(mt,{language:xe(o),theme:document.documentElement.classList.contains("dark")?"vs-dark":"light",value:Z.editorValue,path:o,onChange:t=>{const n=o;n&&u(r=>{const s=new Map(r),a=s.get(n);return a&&s.set(n,{...a,editorValue:t??""}),s})},onMount:dt,loading:i.jsx("div",{className:"flex items-center justify-center h-full w-full",children:i.jsx(re,{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}}},o):o&&!Z?.loaded?i.jsx("div",{className:"flex items-center justify-center h-full w-full",children:i.jsx(re,{size:20,className:"animate-spin text-muted-foreground"})}):i.jsx("div",{className:"flex items-center justify-center h-full w-full text-sm text-muted-foreground",children:"Select a file to edit"})}),o&&i.jsxs("div",{className:"flex items-center justify-between px-3 py-1 border-t text-[11px] text-muted-foreground shrink-0",children:[i.jsx("span",{className:"truncate",children:o}),i.jsxs("span",{children:[ct?"Modified":"Saved"," ·"," ",xe(o)]})]})]}),i.jsx(en,{open:w!==null,mode:w?.mode??"new-file",initialName:w?.mode==="rename"?w.node.name:"",parentLabel:w&&w.mode!=="rename"?w.parentDir==="/"?"/":M(w.parentDir):void 0,isPending:ee,onSubmit:Ye,onOpenChange:t=>{!t&&!ee&&J(null)}}),i.jsx(vt,{open:H!==null,onOpenChange:t=>{!t&&!ee&&ue(null)},children:i.jsxs(Ct,{children:[i.jsxs(Nt,{children:[i.jsxs(St,{children:["Delete ",H?.kind==="directory"?"folder":"file","?"]}),i.jsxs(Dt,{children:["This will permanently delete"," ",i.jsx("span",{className:"font-mono",children:H?.name}),H?.kind==="directory"?" and everything inside it.":".",pe.length>0&&i.jsxs(i.Fragment,{children:[" ",pe.length===1?"One open file has unsaved changes that will be lost.":`${pe.length} open files have unsaved changes that will be lost.`]})]})]}),i.jsxs(kt,{children:[i.jsx(Ft,{disabled:ee,children:"Cancel"}),i.jsx(Lt,{disabled:ee||!H,onClick:t=>{t.preventDefault(),H&&Xe(H)},children:"Delete"})]})]})})]})}export{Ai as FileExplorer};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as C,v as be,d as _e,K as Pe,j as t,a2 as Ue,r as $,B as Y,x as $e,l as he,i as De,t as q}from"./index-UyzF2Wxm.js";import{a as W}from"./Tool01-BgzvuPeY.js";import{s as ze}from"./Trash01-D84eyfFz.js";import{i as je}from"./Upload01-BA5iKtAl.js";import{I as Fe}from"./input-CTZybS4f.js";import{L as Te}from"./label-Djcog1jo.js";import{i as Le}from"./AlertCircle-Diz6uT7Y.js";import{i as Ne}from"./ChevronUp-_gM_dQkt.js";import{a as Ee}from"./Eye-SUXNGsVY.js";import{a as Oe}from"./DotsVertical-BJnhQ8u0.js";import{N as Ae}from"./agent-icon-BMQHBhP6.js";import{n as Re}from"./LinkExternal01-B8zRpPza.js";import{d as Be,a as Ge,b as Me,D as Ve,c as Ke}from"./dialog-AE8ChAe3.js";import{c as pe,a as Je,D as Qe,b as qe}from"./dropdown-menu-ecBYljKf.js";import{S as Ye}from"./skeleton-BqZgigOh.js";import{T as We,a as He,b as Xe,c as Ze}from"./tabs-D__sk4iN.js";import{u as et,c as tt}from"./use-file-configs-CJ5VKJt7.js";import{u as st}from"./useInfiniteQuery-DVN2QYOz.js";import{u as nt}from"./studio-tools-C1AZbzwg.js";function it(s){if(typeof s=="string")return s;if(!s||typeof s!="object")return"";const e=s;if(Array.isArray(e.variants)){const n=e.variants,l=n.find(r=>r.rule?.__resolveType?.includes("always"));if(typeof l?.value=="string")return l.value;const i=n.find(r=>typeof r.value=="string");if(i)return i.value}return typeof e.src=="string"?e.src:typeof e.url=="string"?e.url:typeof e.value=="string"?e.value:""}function lt(s){const e=C.c(10),{org:n}=be(),l=nt();let i;e[0]!==n.id||e[1]!==s.configId?(i=Pe.filePickerObjects(n.id,s.configId),e[0]=n.id,e[1]=s.configId,e[2]=i):i=e[2];const r=s.enabled!==!1&&!!s.configId;let o;e[3]!==s.configId||e[4]!==l?(o=async a=>{const{pageParam:g}=a;return await l.call("FILE_OBJECTS_LIST",{configId:s.configId,cursor:g??void 0})},e[3]=s.configId,e[4]=l,e[5]=o):o=e[5];let f;return e[6]!==i||e[7]!==r||e[8]!==o?(f={queryKey:i,enabled:r,staleTime:3e4,initialPageParam:null,queryFn:o,getNextPageParam:rt},e[6]=i,e[7]=r,e[8]=o,e[9]=f):f=e[9],st(f)}function rt(s){return s.nextCursor??void 0}function Ce(){const s=C.c(2),{org:e}=be();let n;return s[0]!==e?(n={mutationFn:async l=>{const i=l.file.type||"application/octet-stream",r=await fetch(`/api/${encodeURIComponent(e.slug)}/file-configs/${encodeURIComponent(l.configId)}/upload?filename=${encodeURIComponent(l.file.name)}`,{method:"POST",headers:{"Content-Type":i},body:l.file});if(!r.ok){const o=await r.text().catch(ot);let f=`${r.status} ${r.statusText}`;try{const a=JSON.parse(o);a.message&&(f=a.message)}catch{o&&(f=o.slice(0,200))}throw new Error(`Upload failed: ${f}`)}return await r.json()}},s[0]=e,s[1]=n):n=s[1],_e(n)}function ot(){return""}const ye="file-picker:last-config-id";function at(s){const e=C.c(19),n=s.mode==="image"?"Pick an image":"Pick a file";let l;e[0]!==n?(l=t.jsx(Ge,{children:n}),e[0]=n,e[1]=l):l=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Me,{children:"Upload a new file or pick one previously uploaded to a configured bucket."}),e[2]=i):i=e[2];let r;e[3]!==l?(r=t.jsxs(Ve,{children:[l,i]}),e[3]=l,e[4]=r):r=e[4];let o;e[5]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(Ye,{className:"h-64 w-full"}),e[5]=o):o=e[5];let f;e[6]!==s?(f=x=>{s.onSelect(x),s.onOpenChange(!1)},e[6]=s,e[7]=f):f=e[7];let a;e[8]!==s.lockedConfigId||e[9]!==s.mode||e[10]!==f?(a=t.jsx(Ue,{fallback:ct,children:t.jsx($.Suspense,{fallback:o,children:t.jsx(ft,{mode:s.mode,lockedConfigId:s.lockedConfigId,onSelect:f})})}),e[8]=s.lockedConfigId,e[9]=s.mode,e[10]=f,e[11]=a):a=e[11];let g;e[12]!==r||e[13]!==a?(g=t.jsxs(Ke,{className:"sm:max-w-3xl max-h-[85vh] overflow-hidden flex flex-col",children:[r,a]}),e[12]=r,e[13]=a,e[14]=g):g=e[14];let u;return e[15]!==s.onOpenChange||e[16]!==s.open||e[17]!==g?(u=t.jsx(Be,{open:s.open,onOpenChange:s.onOpenChange,children:g}),e[15]=s.onOpenChange,e[16]=s.open,e[17]=g,e[18]=u):u=e[18],u}function ct(s){const{error:e}=s;return t.jsx(dt,{error:e??new Error("Failed to load buckets")})}function dt(s){const e=C.c(3),{error:n}=s;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(Le,{size:16}),e[0]=l):l=e[0];let i;return e[1]!==n.message?(i=t.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[l,t.jsx("span",{className:"text-sm font-medium",children:n.message})]}),e[1]=n.message,e[2]=i):i=e[2],i}function ft(s){const e=C.c(32),{mode:n,lockedConfigId:l,onSelect:i}=s,r=et();if(r.length===0){let d;return e[0]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(gt,{}),e[0]=d):d=e[0],d}if(l){let d;if(e[1]!==r||e[2]!==l){let c;e[4]!==l?(c=h=>h.id===l,e[4]=l,e[5]=c):c=e[5],d=r.find(c),e[1]=r,e[2]=l,e[3]=d}else d=e[3];const m=d;if(m){let c;return e[6]!==m||e[7]!==n||e[8]!==i?(c=t.jsx(xe,{config:m,mode:n,onSelect:i}),e[6]=m,e[7]=n,e[8]=i,e[9]=c):c=e[9],c}}if(r.length===1){const d=r[0];let m;return e[10]!==d||e[11]!==n||e[12]!==i?(m=t.jsx(xe,{config:d,mode:n,onSelect:i}),e[10]=d,e[11]=n,e[12]=i,e[13]=m):m=e[13],m}let o;e[14]===Symbol.for("react.memo_cache_sentinel")?(o=typeof window<"u"?window.localStorage.getItem(ye):null,e[14]=o):o=e[14];const f=o;let a;e[15]!==r?(a=r.find(d=>d.id===f)?.id??r[0].id,e[15]=r,e[16]=a):a=e[16];const g=a;let u;e[17]!==r?(u=r.map(ut),e[17]=r,e[18]=u):u=e[18];let x;e[19]!==u?(x=t.jsx(He,{className:"self-start",children:u}),e[19]=u,e[20]=x):x=e[20];let p;if(e[21]!==r||e[22]!==n||e[23]!==i){let d;e[25]!==n||e[26]!==i?(d=m=>t.jsx(Xe,{value:m.id,className:"min-h-0 flex-1 overflow-hidden",children:t.jsx(xe,{config:m,mode:n,onSelect:i})},m.id),e[25]=n,e[26]=i,e[27]=d):d=e[27],p=r.map(d),e[21]=r,e[22]=n,e[23]=i,e[24]=p}else p=e[24];let j;return e[28]!==g||e[29]!==x||e[30]!==p?(j=t.jsxs(Ze,{defaultValue:g,onValueChange:mt,className:"min-h-0 flex-1 flex flex-col",children:[x,p]}),e[28]=g,e[29]=x,e[30]=p,e[31]=j):j=e[31],j}function ut(s){return t.jsx(We,{value:s.id,children:s.name},s.id)}function mt(s){typeof window<"u"&&window.localStorage.setItem(ye,s)}function gt(){const s=C.c(4),{org:e}=be();let n,l;s[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:t.jsx(je,{size:20,className:"text-muted-foreground"})}),l=t.jsxs("div",{children:[t.jsx("p",{className:"font-medium text-sm",children:"No bucket configured"}),t.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:"Add an S3-compatible bucket in Settings before you can upload files."})]}),s[0]=n,s[1]=l):(n=s[0],l=s[1]);let i;return s[2]!==e.slug?(i=t.jsxs("div",{className:"rounded-xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[n,l,t.jsx(Y,{asChild:!0,size:"sm",className:"mt-2",children:t.jsx($e,{to:"/$org/settings/files",params:{org:e.slug},children:"Configure a bucket"})})]}),s[2]=e.slug,s[3]=i):i=s[3],i}function xe({config:s,mode:e,onSelect:n}){const l=lt({configId:s.id}),i=Ce(),[r,o]=$.useState(!1),f=$.useRef(null),a=e==="image"?"image/*":void 0;async function g(c){if(!c)return;const h=Array.from(c);if(h.length===0)return;let w=null;const b=[];for(const N of h)try{const y=await i.mutateAsync({configId:s.id,file:N});w??=y.publicUrl}catch(y){b.push(`${N.name} (${y instanceof Error?y.message:"upload failed"})`)}await l.refetch(),b.length>0&&q.error(b.length===h.length?`Upload failed: ${b.join("; ")}`:`Some files failed: ${b.join("; ")}`),w&&n(w)}function u(c){c.preventDefault(),o(!0)}function x(){o(!1)}function p(c){c.preventDefault(),o(!1),g(c.dataTransfer.files)}const d=(l.data?.pages??[]).flatMap(c=>c.items),m=d.filter(c=>e==="image"?Ie(c.key):!0);return t.jsxs("div",{className:"flex flex-col gap-3 min-h-0 h-full",children:[t.jsxs("button",{type:"button",onClick:()=>f.current?.click(),onDragOver:u,onDragLeave:x,onDrop:p,className:he("rounded-xl border border-dashed border-border/60 p-6 flex flex-col items-center justify-center gap-2 text-center transition-colors",r&&"border-primary bg-primary/5",i.isPending&&"opacity-60 pointer-events-none"),children:[t.jsx(je,{size:18,className:"text-muted-foreground"}),t.jsx("p",{className:"text-sm font-medium",children:i.isPending?"Uploading…":"Drop files here or click to upload"}),t.jsxs("p",{className:"text-xs text-muted-foreground",children:["Up to 100 MB."," ",e==="image"?"Images only (PNG, JPEG, WebP, GIF, SVG, AVIF).":"Common image, video, audio, and document types."]}),t.jsx("input",{ref:f,type:"file",accept:a,multiple:!0,className:"hidden",onChange:c=>{const h=Array.from(c.target.files??[]);c.target.value="",g(h)}})]}),l.isFetching&&!l.isFetchingNextPage?t.jsx("div",{className:"flex justify-end",children:t.jsx("span",{className:"text-xs text-muted-foreground",children:"Loading…"})}):null,t.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto pr-1",children:[m.length===0?e==="image"&&d.length>0?t.jsx(xt,{}):t.jsx(pt,{}):e==="image"?t.jsx(bt,{items:m,onSelect:n}):t.jsx(jt,{items:m,onSelect:n}),l.hasNextPage&&t.jsx("div",{className:"flex justify-center py-4",children:t.jsx(Y,{type:"button",variant:"outline",size:"sm",disabled:l.isFetchingNextPage,onClick:()=>l.fetchNextPage(),children:l.isFetchingNextPage?t.jsxs(t.Fragment,{children:[t.jsx(De,{size:14,className:"animate-spin"}),"Loading…"]}):"Load more"})})]})]})}function pt(){const s=C.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{className:"flex h-full min-h-40 flex-col items-center justify-center gap-2 py-8 text-center",children:[t.jsx("div",{className:"flex size-10 items-center justify-center rounded-full bg-muted",children:t.jsx(W,{size:18,className:"text-muted-foreground"})}),t.jsx("p",{className:"text-sm font-medium",children:"No files in this bucket yet"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Drop a file above to get started."})]}),s[0]=e):e=s[0],e}function xt(){const s=C.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{className:"flex h-full min-h-40 flex-col items-center justify-center gap-2 py-8 text-center",children:[t.jsx("div",{className:"flex size-10 items-center justify-center rounded-full bg-muted",children:t.jsx(W,{size:18,className:"text-muted-foreground"})}),t.jsx("p",{className:"text-sm font-medium",children:"No images in this bucket yet"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"The bucket has other files, but none match common image formats."})]}),s[0]=e):e=s[0],e}function Ie(s){return/\.(png|jpe?g|gif|webp|svg|avif|bmp)$/i.test(s)}function ht(s){const e=s.lastIndexOf(".");return e<0||e===s.length-1?"file":s.slice(e+1).toLowerCase()}function bt(s){const e=C.c(7),{items:n,onSelect:l}=s;let i;if(e[0]!==n||e[1]!==l){let o;e[3]!==l?(o=f=>t.jsx(Se,{item:f,variant:"image",onSelect:l},f.key),e[3]=l,e[4]=o):o=e[4],i=n.map(o),e[0]=n,e[1]=l,e[2]=i}else i=e[2];let r;return e[5]!==i?(r=t.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-3",children:i}),e[5]=i,e[6]=r):r=e[6],r}function jt(s){const e=C.c(7),{items:n,onSelect:l}=s;let i;if(e[0]!==n||e[1]!==l){let o;e[3]!==l?(o=f=>t.jsx("li",{children:t.jsx(Se,{item:f,variant:"row",onSelect:l})},f.key),e[3]=l,e[4]=o):o=e[4],i=n.map(o),e[0]=n,e[1]=l,e[2]=i}else i=e[2];let r;return e[5]!==i?(r=t.jsx("ul",{className:"divide-y divide-border/60 rounded-lg border border-border/60",children:i}),e[5]=i,e[6]=r):r=e[6],r}function Se(s){const e=C.c(58),{item:n,variant:l,onSelect:i}=s;let r;e[0]!==n.key?(r=ht(n.key),e[0]=n.key,e[1]=r):r=e[1];const o=r;if(l==="image"){let b;e[2]!==n.publicUrl||e[3]!==i?(b=()=>i(n.publicUrl),e[2]=n.publicUrl,e[3]=i,e[4]=b):b=e[4];let N;e[5]!==n.key||e[6]!==n.publicUrl?(N=t.jsx("img",{src:n.publicUrl,alt:n.key,loading:"lazy",className:"h-full w-full object-cover",onError:yt}),e[5]=n.key,e[6]=n.publicUrl,e[7]=N):N=e[7];let y;e[8]!==n.key||e[9]!==b||e[10]!==N?(y=t.jsx("button",{type:"button",onClick:b,className:"block h-full w-full transition hover:ring-2 hover:ring-primary",title:n.key,children:N}),e[8]=n.key,e[9]=b,e[10]=N,e[11]=y):y=e[11];let P;e[12]!==o?(P=t.jsx("span",{className:"pointer-events-none absolute left-1.5 top-1.5 rounded bg-background/80 px-1.5 py-0.5 text-[10px] font-medium uppercase text-foreground opacity-0 backdrop-blur-sm transition-opacity group-hover:opacity-100",children:o}),e[12]=o,e[13]=P):P=e[13];let S;e[14]!==n||e[15]!==i?(S=t.jsx("div",{className:"absolute right-1.5 top-1.5 opacity-0 transition-opacity group-hover:opacity-100",children:t.jsx(ke,{item:n,onSelect:i})}),e[14]=n,e[15]=i,e[16]=S):S=e[16];let I;e[17]!==n.key?(I=we(n.key),e[17]=n.key,e[18]=I):I=e[18];let _;e[19]!==I?(_=t.jsx("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 bg-gradient-to-t from-black/70 to-transparent p-2 opacity-0 transition-opacity group-hover:opacity-100",children:t.jsx("p",{className:"truncate text-xs text-white",children:I})}),e[19]=I,e[20]=_):_=e[20];let k;return e[21]!==y||e[22]!==P||e[23]!==S||e[24]!==_?(k=t.jsxs("div",{className:"group relative aspect-square overflow-hidden rounded-lg border border-border/60 bg-muted",children:[y,P,S,_]}),e[21]=y,e[22]=P,e[23]=S,e[24]=_,e[25]=k):k=e[25],k}let f;e[26]!==n.publicUrl||e[27]!==i?(f=()=>i(n.publicUrl),e[26]=n.publicUrl,e[27]=i,e[28]=f):f=e[28];let a;e[29]!==n.key?(a=t.jsx("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-md bg-muted",children:Ie(n.key)?t.jsx(W,{size:16,className:"text-muted-foreground"}):t.jsx(Ae,{size:16,className:"text-muted-foreground"})}),e[29]=n.key,e[30]=a):a=e[30];let g;e[31]!==n.key?(g=we(n.key),e[31]=n.key,e[32]=g):g=e[32];let u;e[33]!==g?(u=t.jsx("p",{className:"truncate text-sm font-medium",children:g}),e[33]=g,e[34]=u):u=e[34];let x;e[35]!==n.key?(x=t.jsx("p",{className:"truncate font-mono text-xs text-muted-foreground",children:n.key}),e[35]=n.key,e[36]=x):x=e[36];let p;e[37]!==u||e[38]!==x?(p=t.jsxs("div",{className:"min-w-0 flex-1",children:[u,x]}),e[37]=u,e[38]=x,e[39]=p):p=e[39];let j;e[40]!==o?(j=t.jsx("span",{className:"shrink-0 rounded bg-muted px-1.5 py-0.5 text-[10px] font-medium uppercase text-muted-foreground",children:o}),e[40]=o,e[41]=j):j=e[41];let d;e[42]!==n.size?(d=wt(n.size),e[42]=n.size,e[43]=d):d=e[43];let m;e[44]!==d?(m=t.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:d}),e[44]=d,e[45]=m):m=e[45];let c;e[46]!==m||e[47]!==f||e[48]!==a||e[49]!==p||e[50]!==j?(c=t.jsxs("button",{type:"button",onClick:f,className:"flex min-w-0 flex-1 items-center gap-3 text-left",children:[a,p,j,m]}),e[46]=m,e[47]=f,e[48]=a,e[49]=p,e[50]=j,e[51]=c):c=e[51];let h;e[52]!==n||e[53]!==i?(h=t.jsx(ke,{item:n,onSelect:i}),e[52]=n,e[53]=i,e[54]=h):h=e[54];let w;return e[55]!==c||e[56]!==h?(w=t.jsxs("div",{className:"group flex items-center gap-3 px-3 py-2 transition hover:bg-muted/50",children:[c,h]}),e[55]=c,e[56]=h,e[57]=w):w=e[57],w}function yt(s){s.target.style.display="none"}function ke(s){const e=C.c(22),{item:n,onSelect:l}=s,[i,r]=$.useState(!1);let o;e[0]!==n.publicUrl?(o=async function(b){b.preventDefault(),b.stopPropagation();try{await navigator.clipboard.writeText(n.publicUrl),r(!0),window.setTimeout(()=>r(!1),1500)}catch{q.error("Failed to copy URL")}},e[0]=n.publicUrl,e[1]=o):o=e[1];const f=o;let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(Je,{asChild:!0,children:t.jsx(Y,{type:"button",variant:"ghost",size:"icon",className:"size-7 rounded-md bg-background/80 backdrop-blur-sm",onClick:kt,"aria-label":"Asset actions",children:t.jsx(Oe,{size:14})})}),e[2]=a):a=e[2];let g;e[3]!==n.publicUrl||e[4]!==l?(g=()=>l(n.publicUrl),e[3]=n.publicUrl,e[4]=l,e[5]=g):g=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(Ne,{size:14}),e[6]=u):u=e[6];let x;e[7]!==g?(x=t.jsxs(pe,{onClick:g,children:[u,"Use this"]}),e[7]=g,e[8]=x):x=e[8];let p;e[9]!==i?(p=i?t.jsx(Ne,{size:14}):t.jsx(Ee,{size:14}),e[9]=i,e[10]=p):p=e[10];const j=i?"Copied":"Copy URL";let d;e[11]!==f||e[12]!==p||e[13]!==j?(d=t.jsxs(pe,{onClick:f,children:[p,j]}),e[11]=f,e[12]=p,e[13]=j,e[14]=d):d=e[14];let m;e[15]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(Re,{size:14}),e[15]=m):m=e[15];let c;e[16]!==n.publicUrl?(c=t.jsx(pe,{asChild:!0,children:t.jsxs("a",{href:n.publicUrl,target:"_blank",rel:"noreferrer",onClick:vt,children:[m,"Open in new tab"]})}),e[16]=n.publicUrl,e[17]=c):c=e[17];let h;return e[18]!==c||e[19]!==x||e[20]!==d?(h=t.jsxs(Qe,{children:[a,t.jsxs(qe,{align:"end",onClick:Nt,children:[x,d,c]})]}),e[18]=c,e[19]=x,e[20]=d,e[21]=h):h=e[21],h}function vt(s){return s.stopPropagation()}function Nt(s){return s.stopPropagation()}function kt(s){return s.stopPropagation()}function we(s){const e=s.split("/");return e[e.length-1]??s}function wt(s){return s<1024?`${s} B`:s<1024*1024?`${(s/1024).toFixed(1)} KB`:`${(s/(1024*1024)).toFixed(1)} MB`}function Ct(s,e){if(!e)return null;const n=e.toLowerCase();return s.find(l=>{const i=l.bucket.toLowerCase();return l.siteSlug?.toLowerCase()===n||i===n||i===`deco-assets-${n}`})??null}function It(s){try{const e=new URL(s).pathname;return decodeURIComponent(e.split("/").pop()??s)}catch{return s.split("/").pop()??s}}function St(s){const e=s.lastIndexOf(".");return e<0||e===s.length-1?"":s.slice(e+1).toLowerCase()}const _t=new Set(["image/png","image/jpeg","image/gif","image/webp","image/svg+xml","image/avif"]);function Yt(s){const e=C.c(86),{schema:n,value:l,onChange:i,path:r,label:o,sandbox:f}=s,a=it(l),[g,u]=$.useState(!1),[x,p]=$.useState(!1),[j,d]=$.useState(!1),[m,c]=$.useState(!1),h=a?It(a):"",w=h?St(h):"",b=tt(),N=Ce();let y;e[0]!==b.data?.configs?(y=b.data?.configs??[],e[0]=b.data?.configs,e[1]=y):y=e[1];const P=f?.siteSlug;let S;e[2]!==y||e[3]!==P?(S=Ct(y,P),e[2]=y,e[3]=P,e[4]=S):S=e[4];const I=S;let _;e[5]!==i||e[6]!==c||e[7]!==d?(_=function(v){d(!1),c(!1),i(v)},e[5]=i,e[6]=c,e[7]=d,e[8]=_):_=e[8];const k=_;let H;e[9]!==b.data?.configs||e[10]!==I?(H=function(){if(I)return I.id;const v=b.data?.configs??[];if(v.length===1)return v[0].id;if(v.length===0)return null;const D=typeof window<"u"?window.localStorage.getItem(ye):null;return v.some(ie=>ie.id===D)?D:null},e[9]=b.data?.configs,e[10]=I,e[11]=H):H=e[11];const le=H;let X;e[12]!==le||e[13]!==u||e[14]!==k||e[15]!==N?(X=async function(v){if(!v)return;const D=Array.from(v).filter(Pt);if(D.length===0){q.error("Only image files are accepted here.");return}const ie=le();if(!ie){u(!0);return}try{const ge=await N.mutateAsync({configId:ie,file:D[0]});k(ge.publicUrl),D.length>1&&q.info(`Uploaded ${D[0].name}; extra files were ignored (single-select field).`)}catch(ge){const ve=ge;q.error(ve instanceof Error?ve.message:"Upload failed")}},e[12]=le,e[13]=u,e[14]=k,e[15]=N,e[16]=X):X=e[16];const re=X;let Z;e[17]!==p?(Z=function(v){v.preventDefault(),v.dataTransfer.types.includes("Files")&&p(!0)},e[17]=p,e[18]=Z):Z=e[18];const oe=Z;let ee;e[19]!==p?(ee=function(v){v.currentTarget===v.target&&p(!1)},e[19]=p,e[20]=ee):ee=e[20];const ae=ee;let te;e[21]!==re||e[22]!==p?(te=function(v){v.preventDefault(),p(!1),re(v.dataTransfer.files)},e[21]=re,e[22]=p,e[23]=te):te=e[23];const ce=te;let z;e[24]!==o||e[25]!==r?(z=t.jsx(Te,{htmlFor:r,className:"text-muted-foreground",children:o}),e[24]=o,e[25]=r,e[26]=z):z=e[26];let F;e[27]!==n.description?(F=n.description&&t.jsx("p",{className:"text-xs leading-normal text-muted-foreground",children:n.description}),e[27]=n.description,e[28]=F):F=e[28];let T;e[29]!==z||e[30]!==F?(T=t.jsxs("div",{className:"min-w-0 space-y-0.5",children:[z,F]}),e[29]=z,e[30]=F,e[31]=T):T=e[31];const de=x&&"border-primary ring-2 ring-primary/30",fe=N.isPending&&"pointer-events-none opacity-60";let L;e[32]!==de||e[33]!==fe?(L=he("group relative w-full overflow-hidden rounded-xl border border-border/60 bg-muted/30 transition",de,fe),e[32]=de,e[33]=fe,e[34]=L):L=e[34];let E;e[35]!==w||e[36]!==h||e[37]!==m||e[38]!==j||e[39]!==o||e[40]!==c||e[41]!==d||e[42]!==u||e[43]!==a||e[44]!==N.isPending?(E=a?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"relative h-40 w-full bg-[image:linear-gradient(45deg,rgba(0,0,0,0.04)_25%,transparent_25%,transparent_75%,rgba(0,0,0,0.04)_75%),linear-gradient(45deg,rgba(0,0,0,0.04)_25%,transparent_25%,transparent_75%,rgba(0,0,0,0.04)_75%)] bg-[position:0_0,8px_8px] [background-size:16px_16px]",children:[!m&&t.jsx("img",{src:a,alt:o,className:he("h-full w-full object-contain transition-opacity",!j&&"opacity-0"),onLoad:()=>d(!0),onError:()=>c(!0)},a),m&&t.jsxs("div",{className:"flex h-full w-full flex-col items-center justify-center gap-1 text-muted-foreground",children:[t.jsx(W,{size:20}),t.jsx("p",{className:"text-xs",children:"Preview unavailable"})]}),!j&&!m&&t.jsx("div",{className:"absolute inset-0 animate-pulse bg-muted/60"})]}),t.jsxs("div",{className:"flex items-center gap-2 border-t border-border/60 bg-background/50 px-3 py-2",children:[t.jsx("span",{className:"min-w-0 flex-1 truncate text-xs font-medium",children:h}),w&&t.jsx("span",{className:"shrink-0 rounded bg-muted px-1.5 py-0.5 text-[10px] font-medium uppercase text-muted-foreground",children:w})]})]}):t.jsxs("button",{type:"button",onClick:()=>u(!0),className:"flex h-40 w-full flex-col items-center justify-center gap-2 text-sm text-muted-foreground hover:bg-muted/60 hover:text-foreground",children:[t.jsx(W,{size:20}),t.jsx("span",{className:"text-sm font-medium",children:N.isPending?"Uploading…":"Drop an image or click to browse"}),t.jsx("span",{className:"text-xs text-muted-foreground",children:"PNG, JPEG, WebP, GIF, SVG, AVIF — up to 100 MB"})]}),e[35]=w,e[36]=h,e[37]=m,e[38]=j,e[39]=o,e[40]=c,e[41]=d,e[42]=u,e[43]=a,e[44]=N.isPending,e[45]=E):E=e[45];let O;e[46]!==x?(O=x&&t.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center bg-primary/10 backdrop-blur-[1px]",children:t.jsx("span",{className:"rounded-md bg-background px-3 py-1.5 text-xs font-medium shadow",children:"Drop to upload"})}),e[46]=x,e[47]=O):O=e[47];let A;e[48]!==ae||e[49]!==oe||e[50]!==ce||e[51]!==L||e[52]!==E||e[53]!==O?(A=t.jsxs("div",{onDragOver:oe,onDragLeave:ae,onDrop:ce,className:L,children:[E,O]}),e[48]=ae,e[49]=oe,e[50]=ce,e[51]=L,e[52]=E,e[53]=O,e[54]=A):A=e[54];let R;e[55]!==k?(R=U=>k(U.target.value),e[55]=k,e[56]=R):R=e[56];let B;e[57]!==r||e[58]!==a||e[59]!==R?(B=t.jsx(Fe,{id:r,type:"url",value:a,onChange:R,placeholder:"https://...",className:"h-9 min-w-0 flex-1"}),e[57]=r,e[58]=a,e[59]=R,e[60]=B):B=e[60];let G;e[61]!==u?(G=()=>u(!0),e[61]=u,e[62]=G):G=e[62];let se;e[63]===Symbol.for("react.memo_cache_sentinel")?(se=t.jsx(je,{size:14}),e[63]=se):se=e[63];const ue=a?"Replace":"Browse";let M;e[64]!==G||e[65]!==ue?(M=t.jsxs(Y,{type:"button",variant:"outline",size:"sm",onClick:G,className:"h-9 shrink-0",children:[se,ue]}),e[64]=G,e[65]=ue,e[66]=M):M=e[66];let V;e[67]!==k||e[68]!==a?(V=a&&t.jsx(Y,{type:"button",variant:"ghost",size:"sm",onClick:()=>k(""),className:"h-9 shrink-0","aria-label":"Remove image",children:t.jsx(ze,{size:14})}),e[67]=k,e[68]=a,e[69]=V):V=e[69];let K;e[70]!==B||e[71]!==M||e[72]!==V?(K=t.jsxs("div",{className:"flex w-full min-w-0 items-center gap-2",children:[B,M,V]}),e[70]=B,e[71]=M,e[72]=V,e[73]=K):K=e[73];let J;e[74]!==k?(J=U=>k(U),e[74]=k,e[75]=J):J=e[75];const me=I?.id??null;let Q;e[76]!==g||e[77]!==u||e[78]!==J||e[79]!==me?(Q=t.jsx(at,{open:g,onOpenChange:u,mode:"image",onSelect:J,lockedConfigId:me}),e[76]=g,e[77]=u,e[78]=J,e[79]=me,e[80]=Q):Q=e[80];let ne;return e[81]!==T||e[82]!==A||e[83]!==K||e[84]!==Q?(ne=t.jsxs("div",{className:"grid w-full min-w-0 grid-cols-[minmax(0,1fr)] gap-2",children:[T,A,K,Q]}),e[81]=T,e[82]=A,e[83]=K,e[84]=Q,e[85]=ne):ne=e[85],ne}function Pt(s){return _t.has(s.type||"")}export{at as F,Yt as I,ye as L,it as e,Ct as m,Ce as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{al as ot,am as he,an as lt,ao as at,ap as Oe,m as le,aq as ct,ar as dt,r as $,as as mt,at as ut,au as ft,av as ht,aw as Se,ax as pt,ay as xt,az as gt,c as k,j as n,v as J,l as G,i as ae,aA as Z,t as U,K as te,k as se,B as Y,d as bt,a6 as yt,a2 as vt,a as jt}from"./index-UyzF2Wxm.js";import{u as be}from"./tooltip-C7L4o0rn.js";import{i as wt,u as ce,m as Nt,a as St,S as Ct}from"./use-mcp-client-Cv0jyhEU.js";import{u as _t,b as It,v as Tt,a as kt}from"./use-virtual-mcp-iRRxKkRN.js";import{i as $t}from"./ChevronUp-_gM_dQkt.js";import{e as At,A as de,Q as Et,a0 as Ot,D as Pt,k as Mt}from"./agent-icon-BMQHBhP6.js";import{s as ye}from"./Plus-DoMNANl8.js";import{i as Pe}from"./X-2HGWB7Oo.js";import{C as re}from"./index-CKtGWWKI.js";import{b as zt}from"./chat-context-Dqu5Dj_J.js";import{N as Rt}from"./decopilot-CLVJpS6M.js";import{u as Me,a as oe,K as ze,P as Re,D as Le,c as Lt,S as Ht,v as Dt,b as Ft,C as Ut,s as Qt,d as Bt,e as qt,f as Vt}from"./sortable.esm-BtnRUgUU.js";import{g as Kt,u as Wt,d as Gt,h as Jt}from"./use-deco-credits-rzfxapgg.js";import{u as He,a as De,o as Xt}from"./use-organization-settings-DPqJ7ETy.js";import{c as ve,b as Zt,h as Yt}from"./shell-layout-Ch8BfEKU.js";import{I as Fe}from"./input-CTZybS4f.js";import{S as es,t as je,P as ts,h as ss,s as ns,g as is}from"./scroll-area-BBReqUns.js";import{S as rs,a as os,b as ls,c as as,d as cs}from"./sheet-DALs-qBg.js";import{S as H}from"./skeleton-BqZgigOh.js";import{t as Ue}from"./ChevronDown-C_njLrOU.js";import{c as Qe}from"./ZoomOut-Csc4IU4b.js";import{g as Be,M as ds}from"./types-CppGS_VJ.js";import{I as qe}from"./integration-icon-CslqVkci.js";import{b as ms,c as us,S as fs,a as Ce,d as hs}from"./select-CYFnhI-Q.js";import{T as ps}from"./textarea-DmmCVjU6.js";import{u as Ve}from"./studio-tools-C1AZbzwg.js";import{a as xs}from"./use-mcp-tools-z50pjVux.js";import{i as gs}from"./XCircle-B88UxHjD.js";import{f as bs}from"./tab-id-BptcWVWa.js";import{g as ys}from"./use-mcp-prompts-CPZOOi8c.js";import{u as vs,w as js}from"./hooks-DwlYXenh.js";import{a as ws,g as Ns,c as Ss,b as Cs,D as _s}from"./dropdown-menu-ecBYljKf.js";import{s as Is}from"./Trash01-D84eyfFz.js";import{a as Ts,u as ks}from"./use-ai-providers-Deso-Vyj.js";import{u as $s}from"./connect-desktop-dialog-DNAK4U2K.js";import{a as As}from"./toolbar-Bm-rdLjh.js";import"./auth-CCI_mhgC.js";import"./use-collections-CXeEMOwb.js";import"./AlertCircle-Diz6uT7Y.js";import"./Tool01-BgzvuPeY.js";import"./SwitchHorizontal01-vo5MpXEz.js";import"./Settings02-BvivcyYL.js";import"./ArrowUpRight-Bo4YThIl.js";import"./ZapSquare-BfSTQonf.js";import"./Users03-ClWrctLP.js";import"./CheckCircle-BSFt0_RZ.js";import"./ChevronLeft-ByQFERqp.js";import"./ChevronRight-D1duQehP.js";import"./DotsVertical-BJnhQ8u0.js";import"./Stars02-CVb_b-OZ.js";import"./Eye-SUXNGsVY.js";import"./Globe01-CNw0uMhK.js";import"./FilterLines-CxIQYlMz.js";import"./Star01-Ds91SJzA.js";import"./Globe04-B24hCYmg.js";import"./HardDrive-IPJJMMij.js";import"./Key01-CES8n-fG.js";import"./LayoutLeft-D3mZzNi0.js";import"./LinkExternal01-B8zRpPza.js";import"./Monitor01-Uh-3HvZI.js";import"./Sun-tLN4vA6M.js";import"./Palette-Du66341h.js";import"./Play-CVoFjR5I.js";import"./SearchMd-B-bL1wjq.js";import"./Shield01-BewRt7sw.js";import"./Stars01-PS518Jif.js";import"./Upload01-BA5iKtAl.js";import"./User01-CeCQHgwg.js";import"./Users01-DtmLcsFN.js";import"./XClose-DcfEQwVh.js";import"./Zap-BeB31T8Y.js";import"./dialog-AE8ChAe3.js";import"./drawer-Di9WrlRG.js";import"./collection-search-D6nD206z.js";import"./form-teSq_9QK.js";import"./label-Djcog1jo.js";import"./tabs-D__sk4iN.js";import"./toggle-group-5CInie8P.js";import"./popover-DG0h5msu.js";import"./command-DhLgZpjn.js";import"./index-DnCrG3F_.js";import"./useInfiniteQuery-DVN2QYOz.js";import"./use-infinite-scroll-BpnVw1p2.js";import"./question-004-sINsf4GQ.js";import"./checkbox-CHXOcnVE.js";import"./ai-providers-logos-DD3qZ33J.js";import"./avatar-CtVVLapD.js";import"./settings-section-DOlV_atx.js";import"./card-DZtTT5Es.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-BwnCXxRf.js";import"./use-registry-connections-DQ1fpeHW.js";import"./use-connection-DqvYiUe3.js";import"./extract-connection-data-BumzxLvt.js";import"./collection-tabs-cs02GObx.js";import"./badge-BFvLiE20.js";import"./connection-form-helpers-Csy5hutj.js";import"./authenticate-and-persist-oauth-eSHjAd3t.js";import"./mcp-oauth-BcPuGj2k.js";import"./useSuspenseInfiniteQuery-BKCXXvPp.js";import"./required-auth-layout-clm6boiC.js";import"./use-org-sso-QBVELOwd.js";import"./use-clock-tick-Bp0qVbdD.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-H4KuRxx2.js";import"./file-type-icon-BOraV8Gq.js";import"./content-blocks-o63cs2vh.js";import"./use-navigate-to-agent-CytgRfBH.js";import"./decopilot-sse-pool-_mJQvJZ7.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";function _e(t,e){const s=new Set(e);return t.filter(r=>!s.has(r))}function Es(t,e,s){const r=t.slice(0);return r[e]=s,r}var Os=class extends ot{#i;#e;#r;#n;#t;#s;#o;#l;#a;#c=[];constructor(t,e,s){super(),this.#i=t,this.#n=s,this.#r=[],this.#t=[],this.#e=[],this.setQueries(e)}onSubscribe(){this.listeners.size===1&&this.#t.forEach(t=>{t.subscribe(e=>{this.#f(t,e)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#t.forEach(t=>{t.destroy()})}setQueries(t,e){this.#r=t,this.#n=e,he.batch(()=>{const s=this.#t,r=this.#u(this.#r);r.forEach(c=>c.observer.setOptions(c.defaultedQueryOptions));const i=r.map(c=>c.observer),o=i.map(c=>c.getCurrentResult()),l=s.length!==i.length,d=i.some((c,u)=>c!==s[u]),a=l||d,m=a?!0:o.some((c,u)=>{const f=this.#e[u];return!f||!lt(c,f)});!a&&!m||(a&&(this.#c=r,this.#t=i),this.#e=o,this.hasListeners()&&(a&&(_e(s,i).forEach(c=>{c.destroy()}),_e(i,s).forEach(c=>{c.subscribe(u=>{this.#f(c,u)})})),this.#h()))})}getCurrentResult(){return this.#e}getQueries(){return this.#t.map(t=>t.getCurrentQuery())}getObservers(){return this.#t}getOptimisticResult(t,e){const s=this.#u(t),r=s.map(o=>o.observer.getOptimisticResult(o.defaultedQueryOptions)),i=s.map(o=>o.defaultedQueryOptions.queryHash);return[r,o=>this.#m(o??r,e,i),()=>this.#d(r,s)]}#d(t,e){return e.map((s,r)=>{const i=t[r];return s.defaultedQueryOptions.notifyOnChangeProps?i:s.observer.trackResult(i,o=>{e.forEach(l=>{l.observer.trackProp(o)})})})}#m(t,e,s){if(e){const r=this.#a,i=s!==void 0&&r!==void 0&&(r.length!==s.length||s.some((o,l)=>o!==r[l]));return(!this.#s||this.#e!==this.#l||i||e!==this.#o)&&(this.#o=e,this.#l=this.#e,s!==void 0&&(this.#a=s),this.#s=at(this.#s,e(t))),this.#s}return t}#p(){return this.#n?.combine!==void 0&&this.#t.some((t,e)=>t.options.suspense&&this.#e[e]?.data===void 0)}#u(t){const e=new Map;this.#t.forEach(r=>{const i=r.options.queryHash;if(!i)return;const o=e.get(i);o?o.push(r):e.set(i,[r])});const s=[];return t.forEach(r=>{const i=this.#i.defaultQueryOptions(r),l=e.get(i.queryHash)?.shift()??new Oe(this.#i,i);s.push({defaultedQueryOptions:i,observer:l})}),s}#f(t,e){const s=this.#t.indexOf(t);s!==-1&&(this.#e=Es(this.#e,s,e),this.#h())}#h(){if(this.hasListeners()){const t=this.#d(this.#e,this.#c),e=this.#p(),s=this.#s,r=e?s:this.#m(t,this.#n?.combine);(e||s!==r)&&he.batch(()=>{this.listeners.forEach(i=>{i(this.#e)})})}}};function Ps({queries:t,...e},s){const r=le(s),i=ct(),o=dt(),l=$.useMemo(()=>t.map(p=>{const g=r.defaultQueryOptions(p);return g._optimisticResults=i?"isRestoring":"optimistic",g}),[t,r,i]);l.forEach(p=>{mt(p);const g=r.getQueryCache().get(p.queryHash);ut(p,o,g)}),ft(o);const[d]=$.useState(()=>new Os(r,l,e)),[a,m,c]=d.getOptimisticResult(l,e.combine),u=!i&&e.subscribed!==!1;$.useSyncExternalStore($.useCallback(p=>u?d.subscribe(he.batchCalls(p)):ht,[d,u]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),$.useEffect(()=>{d.setQueries(l,e)},[l,e,d]);const h=a.some((p,g)=>Se(l[g],p))?a.flatMap((p,g)=>{const y=l[g];if(y&&Se(y,p)){const j=new Oe(r,y);return pt(y,j,o)}return[]}):[];if(h.length>0)throw Promise.all(h);const x=a.find((p,g)=>{const y=l[g];return y&&xt({result:p,errorResetBoundary:o,throwOnError:y.throwOnError,query:r.getQueryCache().get(y.queryHash),suspense:y.suspense})});if(x?.error)throw x.error;return m(c())}function Ms(t,e){return Ps({...t,queries:t.queries.map(s=>({...s,suspense:!0,throwOnError:gt,enabled:!0,placeholderData:void 0}))},e)}function Ke(t){const e=k.c(11),{properties:s,required:r,values:i,onChange:o}=t;let l;e[0]!==r?(l=r??[],e[0]=r,e[1]=l):l=e[1];let d;e[2]!==l?(d=new Set(l),e[2]=l,e[3]=d):d=e[3];const a=d;let m;e[4]!==s?(m=Object.entries(s),e[4]=s,e[5]=m):m=e[5];let c;return e[6]!==o||e[7]!==a||e[8]!==m||e[9]!==i?(c=n.jsx("div",{className:"flex flex-col gap-2",children:m.map(u=>{const[f,h]=u;return n.jsxs("div",{className:"flex flex-col gap-0.5",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("label",{className:"text-xs font-medium leading-none flex items-center gap-1",children:[f,a.has(f)&&n.jsx("span",{className:"text-red-500 text-[10px]",children:"*"})]}),n.jsx("span",{className:"text-[10px] text-muted-foreground font-mono",children:h.type})]}),h.description&&n.jsx("p",{className:"text-[10px] text-muted-foreground leading-snug",children:h.description}),n.jsx(zs,{type:h.type,fieldKey:f,value:i[f],onChange:x=>o(f,x)})]},f)})}),e[6]=o,e[7]=a,e[8]=m,e[9]=i,e[10]=c):c=e[10],c}function zs(t){const e=k.c(19),{type:s,fieldKey:r,value:i,onChange:o}=t;if(s==="object"||s==="array"){const c=i??"";let u;e[0]!==o?(u=x=>o(x.target.value),e[0]=o,e[1]=u):u=e[1];const f=`Enter ${r} as JSON…`;let h;return e[2]!==c||e[3]!==u||e[4]!==f?(h=n.jsx(ps,{className:"font-mono text-xs h-16",value:c,onChange:u,placeholder:f,rows:2}),e[2]=c,e[3]=u,e[4]=f,e[5]=h):h=e[5],h}if(s==="boolean"){const c=i!=null?String(i):"";let u;e[6]!==o?(u=p=>o(p==="true"),e[6]=o,e[7]=u):u=e[7];let f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(ms,{className:"h-7 text-xs",children:n.jsx(us,{placeholder:"Select…"})}),e[8]=f):f=e[8];let h;e[9]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsxs(fs,{children:[n.jsx(Ce,{value:"true",children:"true"}),n.jsx(Ce,{value:"false",children:"false"})]}),e[9]=h):h=e[9];let x;return e[10]!==c||e[11]!==u?(x=n.jsxs(hs,{value:c,onValueChange:u,children:[f,h]}),e[10]=c,e[11]=u,e[12]=x):x=e[12],x}const l=i??"";let d;e[13]!==o?(d=c=>o(c.target.value),e[13]=o,e[14]=d):d=e[14];const a=`Enter ${r}…`;let m;return e[15]!==l||e[16]!==d||e[17]!==a?(m=n.jsx(Fe,{className:"h-7 text-xs",value:l,onChange:d,placeholder:a}),e[15]=l,e[16]=d,e[17]=a,e[18]=m):m=e[18],m}const ne=8;function Rs(t){const e=k.c(16),{open:s,onOpenChange:r}=t,[i,o]=$.useState("");let l,d;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(rs,{children:"Manage home"}),d=n.jsx(os,{children:"Add agents to the home board and pin their interactive UIs or prompts."}),e[0]=l,e[1]=d):(l=e[0],d=e[1]);let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(At,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none","aria-hidden":!0}),e[2]=a):a=e[2];let m;e[3]===Symbol.for("react.memo_cache_sentinel")?(m=p=>o(p.target.value),e[3]=m):m=e[3];let c;e[4]!==i?(c=n.jsxs(ls,{className:"px-5 py-4 border-b border-border",children:[l,d,n.jsxs("div",{className:"relative mt-3",children:[a,n.jsx(Fe,{value:i,onChange:m,placeholder:"Search agents…",className:"pl-8 h-8 text-sm"})]})]}),e[4]=i,e[5]=c):c=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(hn,{}),e[6]=u):u=e[6];let f;e[7]!==i?(f=n.jsx(es,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"p-3 flex flex-col gap-4",children:n.jsx($.Suspense,{fallback:u,children:n.jsx(Hs,{search:i})})})}),e[7]=i,e[8]=f):f=e[8];let h;e[9]!==c||e[10]!==f?(h=n.jsxs(as,{side:"right",className:"w-full sm:max-w-md p-0 flex flex-col",children:[c,f]}),e[9]=c,e[10]=f,e[11]=h):h=e[11];let x;return e[12]!==r||e[13]!==s||e[14]!==h?(x=n.jsx(cs,{open:s,onOpenChange:r,children:h}),e[12]=r,e[13]=s,e[14]=h,e[15]=x):x=e[15],x}function Ls(t){const e=k.c(32),{org:s}=J(),r=He();let i;e[0]!==r?.ids?(i=r?.ids??[],e[0]=r?.ids,e[1]=i):i=e[1];const o=i,l=De(),d=It(),a=le();let m;e[2]!==s||e[3]!==a?(m=()=>a.refetchQueries({queryKey:te.homeNextActions(s.slug),type:"active"}),e[2]=s,e[3]=a,e[4]=m):m=e[4];const c=m;let u;e[5]!==o?(u=C=>o.includes(C),e[5]=o,e[6]=u):u=e[6];const f=u;let h;e[7]!==o||e[8]!==t?(h=t?o.filter(C=>t.has(C)).length:o.length,e[7]=o,e[8]=t,e[9]=h):h=e[9];const p=h>=ne;let g;e[10]!==p||e[11]!==f||e[12]!==l?(g=C=>f(C)||p?Promise.resolve():l.apply(I=>I.includes(C)?null:[...I,C]),e[10]=p,e[11]=f,e[12]=l,e[13]=g):g=e[13];const y=g;let j;e[14]!==l?(j=C=>l.apply(I=>I.filter(T=>T!==C)),e[14]=l,e[15]=j):j=e[15];const w=j;let v;e[16]!==l?(v=C=>l.apply(()=>C),e[16]=l,e[17]=v):v=e[17];const b=v;let N;e[18]!==d||e[19]!==p||e[20]!==f||e[21]!==c||e[22]!==l?(N=async(C,I)=>{await d.update.mutateAsync({id:C.id,data:{metadata:I}}),!f(C.id)&&!p&&await l.apply(T=>T.includes(C.id)?null:[...T,C.id]),await c()},e[18]=d,e[19]=p,e[20]=f,e[21]=c,e[22]=l,e[23]=N):N=e[23];const S=N;let _;return e[24]!==y||e[25]!==p||e[26]!==o||e[27]!==f||e[28]!==w||e[29]!==b||e[30]!==S?(_={homeIds:o,isOnHome:f,atLimit:p,addAgent:y,removeAgent:w,reorder:b,saveAgentMetadata:S},e[24]=y,e[25]=p,e[26]=o,e[27]=f,e[28]=w,e[29]=b,e[30]=S,e[31]=_):_=e[31],_}function Hs(t){const e=k.c(21),{search:s}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={pageSize:1e3},e[0]=r):r=e[0];const i=_t(r);let o;e[1]!==i?(o=new Set(i.map(Bs)),e[1]=i,e[2]=o):o=e[2];const l=Ls(o);let d,a,m;if(e[3]!==i||e[4]!==l||e[5]!==s){const p=new Map(i.map(Qs));d=s.trim().toLowerCase();const g=w=>!d||w.title?.toLowerCase().includes(d);a=l.homeIds.map(w=>p.get(w)).filter(Us).filter(g);const y=Kt(i);let j;e[9]!==l?(j=w=>!l.isOnHome(w.id),e[9]=l,e[10]=j):j=e[10],m=i.filter(Fs).filter(w=>!y.has(w.id)).filter(j).filter(g).sort(Ds),e[3]=i,e[4]=l,e[5]=s,e[6]=d,e[7]=a,e[8]=m}else d=e[6],a=e[7],m=e[8];const c=m;let u;e[11]!==l||e[12]!==a?(u=n.jsx(qs,{home:l,agents:a}),e[11]=l,e[12]=a,e[13]=u):u=e[13];const f=!!d;let h;e[14]!==c||e[15]!==l||e[16]!==f?(h=n.jsx(Ws,{home:l,agents:c,hasSearch:f}),e[14]=c,e[15]=l,e[16]=f,e[17]=h):h=e[17];let x;return e[18]!==u||e[19]!==h?(x=n.jsxs(n.Fragment,{children:[u,h]}),e[18]=u,e[19]=h,e[20]=x):x=e[20],x}function Ds(t,e){return(t.title??"").localeCompare(e.title??"")}function Fs(t){return t.id&&!wt(t.id)}function Us(t){return!!t}function Qs(t){return[t.id,t]}function Bs(t){return t.id}function We(t){const e=k.c(7),{title:s,hint:r}=t;let i;e[0]!==s?(i=n.jsx("span",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:s}),e[0]=s,e[1]=i):i=e[1];let o;e[2]!==r?(o=r&&n.jsx("span",{className:"text-xs text-muted-foreground",children:r}),e[2]=r,e[3]=o):o=e[3];let l;return e[4]!==i||e[5]!==o?(l=n.jsxs("div",{className:"flex items-center justify-between px-1",children:[i,o]}),e[4]=i,e[5]=o,e[6]=l):l=e[6],l}function qs(t){const e=k.c(14),{home:s,agents:r}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={activationConstraint:{distance:5}},e[0]=i):i=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o={coordinateGetter:Qt},e[1]=o):o=e[1];const l=Me(oe(Re,i),oe(ze,o));let d;e[2]!==s?(d=h=>{const{active:x,over:p}=h;if(!p||x.id===p.id)return;const g=s.homeIds,y=g.indexOf(x.id),j=g.indexOf(p.id);y===-1||j===-1||s.reorder(Bt([...g],y,j)).catch(Ks)},e[2]=s,e[3]=d):d=e[3];const a=d,m=`${s.homeIds.length}/${ne}`;let c;e[4]!==m?(c=n.jsx(We,{title:"On home",hint:m}),e[4]=m,e[5]=c):c=e[5];let u;e[6]!==r||e[7]!==a||e[8]!==s||e[9]!==l?(u=r.length===0?n.jsx("p",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:"No agents on the home yet."}):n.jsx(Le,{sensors:l,collisionDetection:Lt,onDragEnd:a,children:n.jsx(Ht,{items:r.map(Vs),strategy:Dt,children:n.jsx("div",{className:"flex flex-col gap-1",children:r.map(h=>n.jsx(Js,{agent:h,home:s},h.id))})})}),e[6]=r,e[7]=a,e[8]=s,e[9]=l,e[10]=u):u=e[10];let f;return e[11]!==c||e[12]!==u?(f=n.jsxs("div",{className:"flex flex-col gap-1.5",children:[c,u]}),e[11]=c,e[12]=u,e[13]=f):f=e[13],f}function Vs(t){return t.id}function Ks(){return U.error("Couldn't reorder home — please try again.")}function Ws(t){const e=k.c(6),{home:s,agents:r,hasSearch:i}=t,[o,l]=$.useState(20);let d;if(e[0]!==r||e[1]!==i||e[2]!==s||e[3]!==o){const a=r.slice(0,o);let m;e[5]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(We,{title:"Add to home"}),e[5]=m):m=e[5],d=n.jsxs("div",{className:"flex flex-col gap-1.5",children:[m,r.length===0?n.jsx("p",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:i?"No agents match.":"Every agent is on the home."}):n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"flex flex-col gap-1",children:a.map(c=>n.jsx(Ys,{agent:c,home:s},c.id))}),r.length>o&&n.jsxs("button",{type:"button",onClick:()=>l(Gs),className:"mt-1 self-center rounded-md px-3 py-1.5 text-xs text-muted-foreground hover:bg-accent/40 hover:text-foreground",children:["Load more (",r.length-o,")"]})]})]}),e[0]=r,e[1]=i,e[2]=s,e[3]=o,e[4]=d}else d=e[4];return d}function Gs(t){return t+20}function Ge(t){const e=Z(t.metadata?.ui).filter(o=>!!o.resourceUri).length,s=t.metadata?.ui?.homePrompts,r=Array.isArray(s)?s.length:null,i=[];return e>0&&i.push(`${e} tile${e===1?"":"s"}`),r!==null&&r>0&&i.push(`${r} prompt${r===1?"":"s"}`),r===0&&i.push("prompts off"),i.join(" · ")}function Js(t){const e=k.c(57),{agent:s,home:r}=t,[i,o]=$.useState(!1);let l;e[0]!==s.id?(l={id:s.id},e[0]=s.id,e[1]=l):l=e[1];const{attributes:d,listeners:a,setNodeRef:m,transform:c,transition:u,isDragging:f}=Ft(l),h=Ge(s)||"Quick access";let x;e[2]!==c?(x=Ut.Transform.toString(c),e[2]=c,e[3]=x):x=e[3];const p=f?.5:void 0,g=f?100:void 0;let y;e[4]!==x||e[5]!==p||e[6]!==g||e[7]!==u?(y={transform:x,transition:u,opacity:p,zIndex:g},e[4]=x,e[5]=p,e[6]=g,e[7]=u,e[8]=y):y=e[8];const j=y,w=f&&"shadow-lg";let v;e[9]!==w?(v=G("rounded-lg border border-border bg-card",w),e[9]=w,e[10]=v):v=e[10];const b=`Drag to reorder ${s.title??s.id}`;let N;e[11]===Symbol.for("react.memo_cache_sentinel")?(N=n.jsx(Qe,{size:14}),e[11]=N):N=e[11];let S;e[12]!==d||e[13]!==a||e[14]!==b?(S=n.jsx("button",{type:"button",...d,...a,className:"shrink-0 text-muted-foreground hover:text-foreground cursor-grab active:cursor-grabbing outline-none focus-visible:ring-2 focus-visible:ring-ring rounded","aria-label":b,children:N}),e[12]=d,e[13]=a,e[14]=b,e[15]=S):S=e[15];let _;e[16]===Symbol.for("react.memo_cache_sentinel")?(_=()=>o(Zs),e[16]=_):_=e[16];const C=s.title??s.id;let I;e[17]!==s.icon||e[18]!==C?(I=n.jsx(de,{icon:s.icon,name:C,size:"sm"}),e[17]=s.icon,e[18]=C,e[19]=I):I=e[19];const T=s.title??s.id;let E;e[20]!==T?(E=n.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:T}),e[20]=T,e[21]=E):E=e[21];let P;e[22]!==h?(P=n.jsx("div",{className:"truncate text-xs text-muted-foreground",children:h}),e[22]=h,e[23]=P):P=e[23];let M;e[24]!==E||e[25]!==P?(M=n.jsxs("div",{className:"min-w-0 flex-1",children:[E,P]}),e[24]=E,e[25]=P,e[26]=M):M=e[26];const Q=i&&"rotate-180";let z;e[27]!==Q?(z=G("shrink-0 text-muted-foreground transition-transform",Q),e[27]=Q,e[28]=z):z=e[28];let R;e[29]!==z?(R=n.jsx(Ue,{size:16,className:z}),e[29]=z,e[30]=R):R=e[30];let q;e[31]!==i||e[32]!==I||e[33]!==M||e[34]!==R?(q=n.jsxs("button",{type:"button",onClick:_,className:"flex min-w-0 flex-1 items-center gap-2.5 text-left outline-none","aria-expanded":i,children:[I,M,R]}),e[31]=i,e[32]=I,e[33]=M,e[34]=R,e[35]=q):q=e[35];let A;e[36]!==s.id||e[37]!==r?(A=()=>r.removeAgent(s.id).catch(Xs),e[36]=s.id,e[37]=r,e[38]=A):A=e[38];const B=`Remove ${s.title??s.id} from home`;let L;e[39]===Symbol.for("react.memo_cache_sentinel")?(L=n.jsx(Pe,{size:14}),e[39]=L):L=e[39];let O;e[40]!==A||e[41]!==B?(O=n.jsx("button",{type:"button",onClick:A,"aria-label":B,title:"Remove from home",className:"shrink-0 inline-flex size-7 items-center justify-center rounded-md text-muted-foreground hover:bg-destructive/10 hover:text-destructive",children:L}),e[40]=A,e[41]=B,e[42]=O):O=e[42];let D;e[43]!==S||e[44]!==q||e[45]!==O?(D=n.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-2.5",children:[S,q,O]}),e[43]=S,e[44]=q,e[45]=O,e[46]=D):D=e[46];let F;e[47]!==s||e[48]!==i||e[49]!==r?(F=i&&n.jsx(Je,{agent:s,home:r}),e[47]=s,e[48]=i,e[49]=r,e[50]=F):F=e[50];let K;return e[51]!==m||e[52]!==j||e[53]!==D||e[54]!==F||e[55]!==v?(K=n.jsxs("div",{ref:m,style:j,className:v,children:[D,F]}),e[51]=m,e[52]=j,e[53]=D,e[54]=F,e[55]=v,e[56]=K):K=e[56],K}function Xs(){return U.error("Couldn't remove from home — please try again.")}function Zs(t){return!t}function Ys({agent:t,home:e}){const[s,r]=$.useState(!1),[i,o]=$.useState(!1),l=Ge(t),d=async()=>{if(!e.atLimit){o(!0);try{await e.addAgent(t.id)}catch{U.error("Couldn't add to home — please try again.")}finally{o(!1)}}};return n.jsxs("div",{className:"rounded-lg border border-border bg-card",children:[n.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5",children:[n.jsxs("button",{type:"button",onClick:()=>r(a=>!a),className:"flex min-w-0 flex-1 items-center gap-3 text-left outline-none","aria-expanded":s,children:[n.jsx(de,{icon:t.icon,name:t.title??t.id,size:"sm"}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:t.title??t.id}),l&&n.jsx("div",{className:"truncate text-xs text-muted-foreground",children:l})]}),n.jsx(Ue,{size:16,className:G("shrink-0 text-muted-foreground transition-transform",s&&"rotate-180")})]}),n.jsx("button",{type:"button",onClick:d,disabled:i||e.atLimit,"aria-label":"Add to home",title:e.atLimit?`Home is full (${ne}) — remove an agent first`:"Add to home",className:"shrink-0 inline-flex size-7 items-center justify-center rounded-md bg-foreground text-background text-xs hover:opacity-90 disabled:opacity-40 disabled:cursor-not-allowed",children:i?n.jsx(ae,{size:12,className:"animate-spin"}):n.jsx(ye,{size:14})})]}),s&&n.jsx(Je,{agent:t,home:e})]})}function Je(t){const e=k.c(17),{agent:s,home:r}=t,i=s.metadata?.ui;let o;e[0]!==i?(o=Z(i),e[0]=i,e[1]=o):o=e[1];const l=o;let d;e[2]!==s.connections?(d=(s.connections??[]).map(en).sort(),e[2]=s.connections,e[3]=d):d=e[3];const a=d,m=s.metadata?.ui?.homePrompts;let c;e[4]!==s||e[5]!==a||e[6]!==r||e[7]!==l?(c=n.jsx(sn,{agent:s,home:r,connectionIds:a,pinnedTiles:l}),e[4]=s,e[5]=a,e[6]=r,e[7]=l,e[8]=c):c=e[8];let u;e[9]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(tn,{}),e[9]=u):u=e[9];const f=m??null;let h;e[10]!==s||e[11]!==r||e[12]!==f?(h=n.jsx($.Suspense,{fallback:u,children:n.jsx(an,{agent:s,home:r,curated:f})}),e[10]=s,e[11]=r,e[12]=f,e[13]=h):h=e[13];let x;return e[14]!==c||e[15]!==h?(x=n.jsxs("div",{className:"border-t border-border px-3 py-2 flex flex-col gap-3",children:[c,h]}),e[14]=c,e[15]=h,e[16]=x):x=e[16],x}function en(t){return t.connection_id}function tn(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsxs("div",{className:"flex flex-col gap-2 py-1",children:[n.jsx(H,{className:"h-8 w-full"}),n.jsx(H,{className:"h-8 w-2/3"})]}),t[0]=e):e=t[0],e}function sn({agent:t,home:e,connectionIds:s,pinnedTiles:r}){const i=Ve(),{data:o,isLoading:l}=se({queryKey:te.projectConnectionDetails(t.id,s),enabled:s.length>0,queryFn:async()=>(await Promise.all(s.map(async u=>{try{const{item:f}=await i.call("COLLECTION_CONNECTIONS_GET",{id:u}),h=(f?.tools??[]).flatMap(x=>{const p=Be(x._meta);return p?[{name:x.name,description:x.description,resourceUri:p,inputSchema:x.inputSchema}]:[]});return{id:u,title:f?.title??u,icon:f?.icon??null,uiTools:h}}catch{return{id:u,title:u,icon:null,uiTools:[]}}}))).filter(u=>u.uiTools.length>0)});if(s.length===0)return null;if(l)return n.jsxs("div",{className:"flex flex-col gap-1 py-0.5",children:[n.jsx(H,{className:"h-7 w-full"}),n.jsx(H,{className:"h-7 w-2/3"})]});if(!o||o.length===0)return null;const d=new Map;for(const c of o)for(const u of c.uiTools)d.set(`${c.id}:${u.name}`,{conn:c,tool:u});const a=c=>{if(c.toolName&&c.connectionId)return d.get(`${c.connectionId}:${c.toolName}`);for(const[,u]of d)if(u.conn.id===c.connectionId&&u.tool.resourceUri===c.resourceUri)return u},m=r.some(c=>!!a(c));return n.jsxs("div",{className:"flex flex-col gap-2",children:[m&&n.jsxs("div",{className:"flex flex-col gap-0.5",children:[n.jsx("span",{className:"text-[10px] font-medium uppercase tracking-wide text-muted-foreground px-2",children:"Pinned tiles"}),r.map(c=>{const u=a(c);return u?n.jsx(on,{agent:t,home:e,connection:u.conn,tool:u.tool,tile:c},c.tileId??`${c.connectionId}:${c.resourceUri}:${c.toolName}`):null})]}),n.jsxs("div",{className:"flex flex-col gap-0.5",children:[n.jsx("span",{className:"text-[10px] font-medium uppercase tracking-wide text-muted-foreground px-2",children:"Add tile"}),o.map(c=>c.uiTools.map(u=>n.jsx(ln,{agent:t,home:e,connection:c,tool:u},`add:${c.id}:${u.name}`)))]})]})}function Xe(t,e){const s={};for(const[r,i]of Object.entries(t)){const o=e[r]?.type;if((o==="object"||o==="array")&&typeof i=="string"){if(!i.trim())continue;try{s[r]=JSON.parse(i)}catch{return null}}else if((o==="number"||o==="integer")&&typeof i=="string"){if(!i.trim())continue;s[r]=Number(i)}else i!==""&&i!=null&&(s[r]=i)}return s}function nn(t,e){if(!t||!e)return{};const s={};for(const[r,i]of Object.entries(t)){const o=e[r]?.type;(o==="object"||o==="array")&&i!=null&&typeof i!="string"?s[r]=JSON.stringify(i,null,2):s[r]=i}return s}function rn(t){if(!t)return"";const e=Object.entries(t).filter(([,s])=>s!=null&&s!=="");return e.length===0?"":e.slice(0,3).map(([s,r])=>{const i=typeof r=="object"?JSON.stringify(r):String(r);return`${s}=${i.length>20?`${i.slice(0,20)}…`:i}`}).join(", ")}function on({agent:t,home:e,connection:s,tool:r,tile:i}){const[o,l]=$.useState(!1),[d,a]=$.useState(!1),m=r.inputSchema?.properties&&Object.keys(r.inputSchema.properties).length>0,[c,u]=$.useState(()=>nn(i.toolInput,r.inputSchema?.properties)),f=async()=>{l(!0);try{const p=Z(t.metadata?.ui),g=i.tileId?p.filter(j=>j.tileId!==i.tileId):p.filter(j=>j!==i),y={...t.metadata??{},ui:{...t.metadata?.ui??{},homeTile:null,homeTiles:g}};await e.saveAgentMetadata(t,y),a(!1)}catch(p){console.error("[home-tiles] failed to remove tile",p),U.error("Couldn't update home — please try again.")}finally{l(!1)}},h=async()=>{l(!0);try{let p;if(m&&r.inputSchema?.properties){const w=Xe(c,r.inputSchema.properties);if(!w){U.error("Invalid JSON in one of the fields — please fix it."),l(!1);return}Object.keys(w).length>0&&(p=w)}const y=Z(t.metadata?.ui).map(w=>(i.tileId?w.tileId===i.tileId:w===i)?{...w,toolInput:p}:w),j={...t.metadata??{},ui:{...t.metadata?.ui??{},homeTile:null,homeTiles:y}};await e.saveAgentMetadata(t,j),a(!1)}catch(p){console.error("[home-tiles] failed to save tile",p),U.error("Couldn't update home — please try again.")}finally{l(!1)}},x=rn(i.toolInput);return n.jsxs("div",{className:"flex flex-col rounded-md bg-accent/20",children:[n.jsxs("div",{className:"flex items-center gap-2.5 px-2 py-1",children:[n.jsx(qe,{icon:s.icon,name:s.title,size:"xs"}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("div",{className:"truncate text-sm text-foreground",children:je(r.name)}),x&&n.jsx("div",{className:"truncate text-[10px] text-muted-foreground font-mono",children:x})]}),m&&n.jsx("button",{type:"button",onClick:()=>a(p=>!p),"aria-label":"Configure tile props",title:"Configure tile props",className:"inline-flex size-7 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-accent/60",children:n.jsx(Et,{size:14})}),n.jsx(we,{isPinned:!0,submitting:o,onClick:f,label:"Remove from home"})]}),d&&m&&r.inputSchema?.properties&&n.jsxs("div",{className:"px-3 pb-2 pt-1 flex flex-col gap-2",children:[n.jsx(Ke,{properties:r.inputSchema.properties,required:r.inputSchema.required,values:c,onChange:(p,g)=>u(y=>({...y,[p]:g}))}),n.jsxs("div",{className:"flex items-center gap-2 justify-end",children:[n.jsx(Y,{variant:"ghost",size:"sm",className:"h-7 text-xs",onClick:()=>a(!1),children:"Cancel"}),n.jsx(Y,{size:"sm",className:"h-7 text-xs",disabled:o,onClick:h,children:o?n.jsx(ae,{size:12,className:"animate-spin"}):"Save"})]})]})]})}function ln({agent:t,home:e,connection:s,tool:r}){const[i,o]=$.useState(!1),[l,d]=$.useState(!1),a=r.inputSchema?.properties&&Object.keys(r.inputSchema.properties).length>0,[m,c]=$.useState({}),u=async()=>{if(a&&!l){d(!0);return}if(!e.isOnHome(t.id)&&e.atLimit){U.error(`Home is full (${ne}) — remove an agent first`);return}await f()},f=async()=>{o(!0);try{let h;if(a&&r.inputSchema?.properties){const y=Xe(m,r.inputSchema.properties);if(!y){U.error("Invalid JSON in one of the fields — please fix it."),o(!1);return}Object.keys(y).length>0&&(h=y)}const p=[...Z(t.metadata?.ui),{tileId:crypto.randomUUID(),connectionId:s.id,resourceUri:r.resourceUri,toolName:r.name,...h?{toolInput:h}:{}}],g={...t.metadata??{},ui:{...t.metadata?.ui??{},homeTile:null,homeTiles:p}};await e.saveAgentMetadata(t,g),d(!1),c({})}catch(h){console.error("[home-tiles] failed to add tile",h),U.error("Couldn't update home — please try again.")}finally{o(!1)}};return n.jsxs("div",{className:"flex flex-col rounded-md hover:bg-accent/40",children:[n.jsxs("div",{className:"flex items-center gap-2.5 px-2 py-1",children:[n.jsx(qe,{icon:s.icon,name:s.title,size:"xs"}),n.jsx("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:je(r.name)}),n.jsx(we,{isPinned:!1,submitting:i,onClick:u,label:"Add to home"})]}),l&&a&&r.inputSchema?.properties&&n.jsxs("div",{className:"px-3 pb-2 pt-1 flex flex-col gap-2",children:[n.jsx(Ke,{properties:r.inputSchema.properties,required:r.inputSchema.required,values:m,onChange:(h,x)=>c(p=>({...p,[h]:x}))}),n.jsxs("div",{className:"flex items-center gap-2 justify-end",children:[n.jsx(Y,{variant:"ghost",size:"sm",className:"h-7 text-xs",onClick:()=>{d(!1),c({})},children:"Cancel"}),n.jsx(Y,{size:"sm",className:"h-7 text-xs",disabled:i,onClick:f,children:i?n.jsx(ae,{size:12,className:"animate-spin"}):"Pin"})]})]})]})}function we(t){const e=k.c(11),{isPinned:s,submitting:r,onClick:i,label:o}=t,l=s?"text-muted-foreground hover:bg-destructive/10 hover:text-destructive":"bg-foreground text-background hover:opacity-90";let d;e[0]!==l?(d=G("inline-flex size-7 shrink-0 items-center justify-center rounded-md text-xs transition-colors disabled:opacity-50 disabled:cursor-progress",l),e[0]=l,e[1]=d):d=e[1];let a;e[2]!==s||e[3]!==r?(a=r?n.jsx(ae,{size:12,className:"animate-spin"}):s?n.jsx(Ot,{size:14}):n.jsx(ye,{size:14}),e[2]=s,e[3]=r,e[4]=a):a=e[4];let m;return e[5]!==o||e[6]!==i||e[7]!==r||e[8]!==d||e[9]!==a?(m=n.jsx("button",{type:"button",onClick:i,disabled:r,"aria-label":o,title:o,className:d,children:a}),e[5]=o,e[6]=i,e[7]=r,e[8]=d,e[9]=a,e[10]=m):m=e[10],m}function an(t){const e=k.c(32),{agent:s,home:r,curated:i}=t,{org:o}=J();let l;e[0]!==s.id||e[1]!==o.id||e[2]!==o.slug?(l={connectionId:s.id,orgId:o.id,orgSlug:o.slug},e[0]=s.id,e[1]=o.id,e[2]=o.slug,e[3]=l):l=e[3];const d=ce(l);let a;e[4]!==s.id||e[5]!==o.id?(a=te.agentPrompts(o.id,s.id),e[4]=s.id,e[5]=o.id,e[6]=a):a=e[6];let m;e[7]!==d?(m=async()=>{const{prompts:b}=await d.listPrompts();return b.map(un)},e[7]=d,e[8]=m):m=e[8];let c;e[9]!==a||e[10]!==m?(c={queryKey:a,queryFn:m,staleTime:3e4,retry:!1},e[9]=a,e[10]=m,e[11]=c):c=e[11];const{data:u,isLoading:f,error:h}=se(c),x=ve(o.slug);let p,g;if(e[12]!==s.id||e[13]!==u||e[14]!==x.prompts){let b;e[17]!==s.id?(b=S=>S.agentId===s.id&&S.promptName,e[17]=s.id,e[18]=b):b=e[18],p=x.prompts.filter(b).map(mn);let N;e[19]!==u?(N=u??[],e[19]=u,e[20]=N):N=e[20],g=[...N];for(const S of p)g.some(_=>_.name===S.name)||g.push(S);e[12]=s.id,e[13]=u,e[14]=x.prompts,e[15]=p,e[16]=g}else p=e[15],g=e[16];if(f&&p.length===0){let b;return e[21]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx(H,{className:"h-7 w-full"}),n.jsx(H,{className:"h-7 w-2/3"})]}),e[21]=b):b=e[21],b}if(h&&p.length===0)return console.error("[home-tiles] listPrompts failed for agent",s.id,h),null;if(g.length===0)return null;let y;e[22]!==i||e[23]!==g?(y=i??g.map(dn),e[22]=i,e[23]=g,e[24]=y):y=e[24];let j;e[25]!==y?(j=new Set(y),e[25]=y,e[26]=j):j=e[26];const w=j;let v;return e[27]!==s||e[28]!==r||e[29]!==g||e[30]!==w?(v=n.jsx("div",{className:"flex flex-col gap-0.5",children:g.map(b=>n.jsx(fn,{agent:s,home:r,prompt:b,allPromptNames:g.map(cn),isPinned:w.has(b.name)},b.name))}),e[27]=s,e[28]=r,e[29]=g,e[30]=w,e[31]=v):v=e[31],v}function cn(t){return t.name}function dn(t){return t.name}function mn(t){return{name:t.promptName,title:t.title,description:t.description}}function un(t){return{name:t.name,title:t.title,description:t.description}}function fn({agent:t,home:e,prompt:s,allPromptNames:r,isPinned:i}){const[o,l]=$.useState(!1),d=async()=>{if(!i&&!e.isOnHome(t.id)&&e.atLimit){U.error(`Home is full (${ne}) — remove an agent first`);return}l(!0);try{const a=t.metadata?.ui?.homePrompts;let m;Array.isArray(a)?m=i?a.filter(u=>u!==s.name):[...a,s.name]:m=i?r.filter(u=>u!==s.name):r;const c={...t.metadata??{},ui:{...t.metadata?.ui??{},homePrompts:m}};await e.saveAgentMetadata(t,c)}catch(a){console.error("[home-tiles] failed to toggle prompt",a),U.error("Couldn't update home — please try again.")}finally{l(!1)}};return n.jsxs("div",{className:"flex items-center gap-2.5 rounded-md px-2 py-1 hover:bg-accent/40",children:[n.jsx("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:s.title??je(s.name)}),n.jsx(we,{isPinned:i,submitting:o,onClick:d,label:i?"Remove from home":"Add to home"})]})}function hn(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"flex flex-col gap-2 p-2",children:Array.from({length:4},pn)}),t[0]=e):e=t[0],e}function pn(t,e){return n.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-border p-2.5",children:[n.jsx(H,{className:"size-8 rounded-md"}),n.jsxs("div",{className:"flex-1 space-y-1.5",children:[n.jsx(H,{className:"h-3 w-1/2"}),n.jsx(H,{className:"h-2.5 w-1/3"})]})]},e)}const ee=1,Ze=`home-board.layout.v${ee}`;function Ye(t){return`home-board.layout.v${ee}.${t}`}const et={version:ee,tiles:{},hidden:[]};function pe(t){return!t||t.version!==ee?et:{version:ee,tiles:t.tiles??{},hidden:Array.isArray(t.hidden)?t.hidden:[]}}function xn(t){return Object.keys(t.tiles).length>0||t.hidden.length>0}function gn(t){try{const e=localStorage.getItem(Ye(t));return e?pe(JSON.parse(e)):void 0}catch{return}}function Ie(t,e){try{localStorage.setItem(Ye(t),JSON.stringify(e))}catch{}}async function Te(t,e){if(!(await fetch(`/api/${t}/kv/${Ze}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok)throw new Error("Failed to save board layout")}function bn(t){const e=k.c(24),s=le();let r;e[0]!==t?(r=te.boardLayout(t),e[0]=t,e[1]=r):r=e[1];const i=r;let o;e[2]!==t?(o=gn(t),e[2]=t,e[3]=o):o=e[3];const l=o;let d;e[4]!==l||e[5]!==t?(d=async()=>{const y=await fetch(`/api/${t}/kv/${Ze}`);if(y.status===404)return l&&xn(l)?(await Te(t,l),l):et;if(!y.ok)throw new Error("Failed to load board layout");const j=await y.json(),w=pe(j.value);return Ie(t,w),w},e[4]=l,e[5]=t,e[6]=d):d=e[6];let a;e[7]!==l||e[8]!==i||e[9]!==d?(a={queryKey:i,queryFn:d,initialData:l,staleTime:0,refetchOnWindowFocus:!1},e[7]=l,e[8]=i,e[9]=d,e[10]=a):a=e[10];const{data:m,isLoading:c}=se(a);let u;e[11]!==t?(u={mutationFn:y=>Te(t,y)},e[11]=t,e[12]=u):u=e[12];const f=bt(u);let h;e[13]!==f||e[14]!==t||e[15]!==s||e[16]!==i?(h=y=>{Ie(t,y),s.setQueryData(i,y),f.mutate(y)},e[13]=f,e[14]=t,e[15]=s,e[16]=i,e[17]=h):h=e[17];const x=h;let p;e[18]!==m?(p=pe(m),e[18]=m,e[19]=p):p=e[19];let g;return e[20]!==c||e[21]!==x||e[22]!==p?(g={layout:p,isLoading:c,save:x},e[20]=c,e[21]=x,e[22]=p,e[23]=g):g=e[23],g}const tt=$.createContext(null);function yn(t){const e=k.c(24),{children:s}=t,{org:r}=J(),i=bn(r.slug),[o,l]=$.useState(!1),[d,a]=$.useState(null);let m;e[0]!==i.layout?(m=()=>{a(i.layout),l(!0)},e[0]=i.layout,e[1]=m):m=e[1];const c=m;let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=()=>{a(null),l(!1)},e[2]=u):u=e[2];const f=u;let h;e[3]!==d||e[4]!==i?(h=()=>{d&&i.save(d),a(null),l(!1)},e[3]=d,e[4]=i,e[5]=h):h=e[5];const x=h,p=o&&d!==null,g=p?d:i.layout;let y;e[6]!==d||e[7]!==p||e[8]!==i.layout?(y=p?JSON.stringify(d)!==JSON.stringify(i.layout):!1,e[6]=d,e[7]=p,e[8]=i.layout,e[9]=y):y=e[9];const j=y;let w;e[10]!==o||e[11]!==i?(w=S=>{o?a(S):i.save(S)},e[10]=o,e[11]=i,e[12]=w):w=e[12];const v=w;let b;e[13]!==v||e[14]!==c||e[15]!==j||e[16]!==o||e[17]!==g||e[18]!==x||e[19]!==i.isLoading?(b={isEditMode:o,enter:c,cancel:f,save:x,hasChanges:j,layout:g,isLayoutLoading:i.isLoading,commitLayout:v},e[13]=v,e[14]=c,e[15]=j,e[16]=o,e[17]=g,e[18]=x,e[19]=i.isLoading,e[20]=b):b=e[20];let N;return e[21]!==s||e[22]!==b?(N=n.jsx(tt.Provider,{value:b,children:s}),e[21]=s,e[22]=b,e[23]=N):N=e[23],N}function st(){const t=$.useContext(tt);if(!t)throw new Error("useHomeEdit must be used within a HomeEditProvider");return t}function vn({agentId:t}){const{org:e,locator:s}=J(),r=ce({connectionId:t,orgId:e.id,orgSlug:e.slug}),{create:i}=vs(),{setTaskId:o}=Zt(),[l,d]=$.useState(null),[a,m]=$.useState(!1),c=$.useRef(!1),u=async(g,y)=>{if(!r){U.error("MCP client not available");return}if(!c.current){c.current=!0,m(!0);try{const j=await ys(r,g.name,y),w={type:"doc",content:[{type:"paragraph",content:[ss({id:g.name,name:ns(g.name,is(g._meta)),metadata:j.messages,char:"/",kind:"prompt",args:y}),{type:"text",text:" "}]}]},v=crypto.randomUUID();js(sessionStorage,s,v,{tiptapDoc:w}),await i({id:v,virtual_mcp_id:t}),o(v,t,{autosend:!0})}catch(j){console.error("[start-thread-from-prompt] failed",j),U.error("Failed to start thread. Please try again.")}finally{c.current=!1,m(!1)}}},f=async g=>{if(!c.current){if(g.arguments&&g.arguments.length>0){d(g);return}await u(g)}},h=async g=>{if(!l)return;const y=l;d(null),await u(y,g)};return{start:f,startBlank:async g=>{if(!c.current){c.current=!0,m(!0);try{const y=crypto.randomUUID();await i({id:y,virtual_mcp_id:t}),o(y,t,g?.main?{main:g.main}:void 0)}catch(y){console.error("[start-thread-from-prompt] startBlank failed",y),U.error("Failed to start thread. Please try again.")}finally{c.current=!1,m(!1)}}},dialog:n.jsx(ts,{prompt:l,setPrompt:g=>d(g),onSubmit:h}),dialogPrompt:l,starting:a}}const V=4,W=100,ke=12,jn=5,wn={w:2,h:2};class xe extends $.Component{state={hasError:!1};static getDerivedStateFromError(e){return{hasError:!0,message:e instanceof Error?e.message:"Unknown error"}}componentDidCatch(e,s){console.error("[home-tiles] tile crashed:",e,s.componentStack)}render(){return this.state.hasError?n.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2 p-4 text-center",children:[n.jsx("span",{className:"flex size-8 items-center justify-center rounded-md bg-destructive/10 text-destructive",children:n.jsx(yt,{size:16})}),n.jsx("p",{className:"text-sm font-medium text-foreground",children:"This tile crashed"}),n.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:this.state.message??"Something went wrong rendering this tile."})]}):this.props.children}}function Nn(t){const e=k.c(72),{tiles:s,isEditMode:r,renderTile:i,onMove:o,onResize:l,onRemove:d}=t,a=be(),m=$.useRef(null),[c,u]=$.useState(null),[f,h]=$.useState(null);let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x={activationConstraint:{distance:4}},e[0]=x):x=e[0];const p=Me(oe(Re,x),oe(ze)),g=s.reduce(Sn,0),y=r?Math.max(g+2,4):Math.max(g,1);let j;e[1]===Symbol.for("react.memo_cache_sentinel")?(j=()=>{const A=m.current?.getBoundingClientRect();return A?{cellWidth:A.width/V,cellHeight:W}:null},e[1]=j):j=e[1];const w=j;let v;e[2]===Symbol.for("react.memo_cache_sentinel")?(v=A=>{u(String(A.active.id)),h(w())},e[2]=v):v=e[2];const b=v;let N;e[3]!==f||e[4]!==o||e[5]!==s?(N=A=>{const B=String(A.active.id),L=f??w();if(u(null),h(null),!L||L.cellWidth<=0)return;const O=s.find(K=>K.id===B);if(!O)return;const D=Math.round(A.delta.x/L.cellWidth),F=Math.round(A.delta.y/L.cellHeight);D===0&&F===0||o(B,{x:O.x+D,y:O.y+F})},e[3]=f,e[4]=o,e[5]=s,e[6]=N):N=e[6];const S=N;if(a){let A;if(e[7]!==i||e[8]!==s){let L;e[10]!==i?(L=O=>n.jsx("div",{className:"group bg-card card-shadow rounded-2xl overflow-hidden",style:{minHeight:W},children:n.jsx(xe,{children:i(O)})},O.id),e[10]=i,e[11]=L):L=e[11],A=s.map(L),e[7]=i,e[8]=s,e[9]=A}else A=e[9];let B;return e[12]!==A?(B=n.jsx("div",{className:"flex flex-col gap-3 px-4 pb-8",children:A}),e[12]=A,e[13]=B):B=e[13],B}let _,C,I,T,E,P,M,Q,z;if(e[14]!==c||e[15]!==f||e[16]!==r||e[17]!==S||e[18]!==d||e[19]!==l||e[20]!==i||e[21]!==p||e[22]!==s||e[23]!==y){const A=c?s.find(X=>X.id===c):null;C=Le,Q=p,z=b,I=S;const B=y*W,L=r?W*4:W;let O;e[33]!==B||e[34]!==L?(O={height:B,minHeight:L},e[33]=B,e[34]=L,e[35]=O):O=e[35];let D;e[36]!==r||e[37]!==s||e[38]!==y?(D=r&&n.jsx(Cn,{rows:y,tiles:s}),e[36]=r,e[37]=s,e[38]=y,e[39]=D):D=e[39];let F;if(e[40]!==c||e[41]!==r||e[42]!==d||e[43]!==l||e[44]!==i||e[45]!==s){let X;e[47]!==c||e[48]!==r||e[49]!==d||e[50]!==l||e[51]!==i?(X=ie=>n.jsx(In,{tile:ie,isEditMode:r,isDragging:c===ie.id,onResize:l,onRemove:d,children:i(ie)},ie.id),e[47]=c,e[48]=r,e[49]=d,e[50]=l,e[51]=i,e[52]=X):X=e[52],F=s.map(X),e[40]=c,e[41]=r,e[42]=d,e[43]=l,e[44]=i,e[45]=s,e[46]=F}else F=e[46];e[53]!==O||e[54]!==D||e[55]!==F?(T=n.jsxs("div",{ref:m,className:"relative w-full",style:O,children:[D,F]}),e[53]=O,e[54]=D,e[55]=F,e[56]=T):T=e[56],_=qt,E=null;const K=A&&f?A.w*f.cellWidth-ke:void 0,me=A&&f?A.h*f.cellHeight-ke:void 0;e[57]!==K||e[58]!==me?(P={width:K,height:me},e[57]=K,e[58]=me,e[59]=P):P=e[59],M=A&&n.jsx("div",{className:"bg-card card-shadow rounded-2xl shadow-2xl ring-2 ring-primary/40 h-full overflow-hidden opacity-95",children:n.jsx(xe,{children:i(A)})}),e[14]=c,e[15]=f,e[16]=r,e[17]=S,e[18]=d,e[19]=l,e[20]=i,e[21]=p,e[22]=s,e[23]=y,e[24]=_,e[25]=C,e[26]=I,e[27]=T,e[28]=E,e[29]=P,e[30]=M,e[31]=Q,e[32]=z}else _=e[24],C=e[25],I=e[26],T=e[27],E=e[28],P=e[29],M=e[30],Q=e[31],z=e[32];let R;e[60]!==_||e[61]!==E||e[62]!==P||e[63]!==M?(R=n.jsx(_,{dropAnimation:E,style:P,children:M}),e[60]=_,e[61]=E,e[62]=P,e[63]=M,e[64]=R):R=e[64];let q;return e[65]!==C||e[66]!==I||e[67]!==T||e[68]!==R||e[69]!==Q||e[70]!==z?(q=n.jsxs(C,{sensors:Q,onDragStart:z,onDragEnd:I,children:[T,R]}),e[65]=C,e[66]=I,e[67]=T,e[68]=R,e[69]=Q,e[70]=z,e[71]=q):q=e[71],q}function Sn(t,e){return Math.max(t,e.y+e.h)}function Cn(t){const e=k.c(7),{rows:s,tiles:r}=t;let i;e[0]!==r?(i=(a,m)=>r.some(c=>a>=c.x&&a<c.x+c.w&&m>=c.y&&m<c.y+c.h),e[0]=r,e[1]=i):i=e[1];const o=i;let l;if(e[2]!==o||e[3]!==s){l=[];for(let a=0;a<s;a++)for(let m=0;m<V;m++)o(m,a)||l.push({x:m,y:a});e[2]=o,e[3]=s,e[4]=l}else l=e[4];let d;return e[5]!==l?(d=n.jsx("div",{className:"absolute inset-0 pointer-events-none",children:l.map(_n)}),e[5]=l,e[6]=d):d=e[6],d}function _n(t){return n.jsx("div",{className:"absolute p-1",style:{left:`${t.x/V*100}%`,top:t.y*W,width:`${1/V*100}%`,height:W},children:n.jsx("div",{className:"h-full w-full rounded-2xl border border-dashed border-border/60"})},`${t.x}-${t.y}`)}function In(t){const e=k.c(31),{tile:s,isEditMode:r,isDragging:i,onResize:o,onRemove:l,children:d}=t,a=!r;let m;e[0]!==a||e[1]!==s.id?(m={id:s.id,disabled:a},e[0]=a,e[1]=s.id,e[2]=m):m=e[2];const{setNodeRef:c,attributes:u,listeners:f,isDragging:h}=Vt(m),x=`${s.x/V*100}%`,p=`${s.w/V*100}%`,g=s.y*W,y=s.h*W,j=h||i,w=!j&&"transition-[left,top,width,height,opacity] duration-200 ease-out",v=j&&"opacity-30";let b;e[3]!==w||e[4]!==v?(b=G("absolute p-1 will-change-[left,top,width,height,opacity]",w,v),e[3]=w,e[4]=v,e[5]=b):b=e[5];let N;e[6]!==y||e[7]!==x||e[8]!==g||e[9]!==p?(N={left:x,top:g,width:p,height:y},e[6]=y,e[7]=x,e[8]=g,e[9]=p,e[10]=N):N=e[10];const S=r&&"outline outline-1 outline-transparent hover:outline-primary/40";let _;e[11]!==S?(_=G("group relative h-full bg-card card-shadow rounded-2xl overflow-hidden",S),e[11]=S,e[12]=_):_=e[12];let C;e[13]!==u||e[14]!==r||e[15]!==f||e[16]!==l||e[17]!==o||e[18]!==s?(C=r&&n.jsxs(n.Fragment,{children:[n.jsx("button",{type:"button",...u,...f,className:"absolute top-2 left-2 z-10 flex size-8 items-center justify-center rounded-md bg-background/90 border border-border text-muted-foreground hover:text-foreground hover:bg-muted cursor-grab active:cursor-grabbing","aria-label":"Drag tile",children:n.jsx(Qe,{size:16})}),n.jsx("div",{className:"absolute top-2 right-2 z-10 flex items-center gap-1",children:n.jsx(Tn,{tile:s,onResize:o,onRemove:l})})]}),e[13]=u,e[14]=r,e[15]=f,e[16]=l,e[17]=o,e[18]=s,e[19]=C):C=e[19];let I;e[20]!==d?(I=n.jsx("div",{className:"h-full overflow-hidden",children:n.jsx(xe,{children:d})}),e[20]=d,e[21]=I):I=e[21];let T;e[22]!==I||e[23]!==_||e[24]!==C?(T=n.jsxs("div",{className:_,children:[C,I]}),e[22]=I,e[23]=_,e[24]=C,e[25]=T):T=e[25];let E;return e[26]!==c||e[27]!==T||e[28]!==b||e[29]!==N?(E=n.jsx("div",{ref:c,className:b,style:N,children:T}),e[26]=c,e[27]=T,e[28]=b,e[29]=N,e[30]=E):E=e[30],E}function Tn(t){const e=k.c(20),{tile:s,onResize:r,onRemove:i}=t,[o,l]=$.useState(!1);let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(ws,{asChild:!0,children:n.jsx("button",{type:"button",className:"flex size-8 items-center justify-center rounded-md bg-background/90 border border-border text-muted-foreground hover:text-foreground hover:bg-muted","aria-label":"Tile options",children:n.jsx(Pt,{size:16})})}),e[0]=d):d=e[0];let a;e[1]!==r||e[2]!==s.id?(a=g=>{r(s.id,g),l(!1)},e[1]=r,e[2]=s.id,e[3]=a):a=e[3];let m;e[4]!==a||e[5]!==s?(m=n.jsx(kn,{tile:s,onPick:a}),e[4]=a,e[5]=s,e[6]=m):m=e[6];let c;e[7]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(Ns,{}),e[7]=c):c=e[7];let u;e[8]!==i||e[9]!==s.id?(u=()=>i(s.id),e[8]=i,e[9]=s.id,e[10]=u):u=e[10];let f;e[11]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(Is,{size:14,className:"mr-2"}),e[11]=f):f=e[11];let h;e[12]!==u?(h=n.jsxs(Ss,{onSelect:u,className:"text-destructive focus:text-destructive",children:[f,"Remove tile"]}),e[12]=u,e[13]=h):h=e[13];let x;e[14]!==m||e[15]!==h?(x=n.jsxs(Cs,{align:"end",className:"w-auto",children:[m,c,h]}),e[14]=m,e[15]=h,e[16]=x):x=e[16];let p;return e[17]!==o||e[18]!==x?(p=n.jsxs(_s,{open:o,onOpenChange:l,children:[d,x]}),e[17]=o,e[18]=x,e[19]=p):p=e[19],p}function kn(t){const e=k.c(19),{tile:s,onPick:r}=t,i=s.minW??1,o=s.minH??1,[l,d]=$.useState(null);let a;e[0]!==l||e[1]!==s.h||e[2]!==s.w?(a=l??{w:s.w,h:s.h},e[0]=l,e[1]=s.h,e[2]=s.w,e[3]=a):a=e[3];const m=a;let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx("span",{className:"text-xs text-muted-foreground",children:"Size"}),e[4]=c):c=e[4];let u;e[5]!==m.h||e[6]!==m.w?(u=n.jsxs("div",{className:"mb-2 flex items-center justify-between gap-4",children:[c,n.jsxs("span",{className:"text-xs font-medium tabular-nums",children:[m.w," × ",m.h]})]}),e[5]=m.h,e[6]=m.w,e[7]=u):u=e[7];let f,h;e[8]===Symbol.for("react.memo_cache_sentinel")?(f={gridTemplateColumns:`repeat(${V}, 1.25rem)`},h=()=>d(null),e[8]=f,e[9]=h):(f=e[8],h=e[9]);let x;e[10]!==m.h||e[11]!==m.w||e[12]!==o||e[13]!==i||e[14]!==r?(x=n.jsx("div",{className:"grid w-max gap-1",style:f,onPointerLeave:h,children:Array.from({length:jn},(g,y)=>Array.from({length:V},(j,w)=>{const v=w+1,b=y+1,N=v<i||b<o,S=v<=m.w&&b<=m.h;return n.jsx("button",{type:"button",disabled:N,"aria-label":`${v} by ${b}`,onPointerEnter:()=>d({w:v,h:b}),onClick:()=>r({w:v,h:b}),className:G("size-5 rounded-sm border transition-colors",S?"border-primary bg-primary/30":"border-border bg-muted",N?"cursor-not-allowed opacity-40":"cursor-pointer hover:border-primary/60")},`${v}x${b}`)}))}),e[10]=m.h,e[11]=m.w,e[12]=o,e[13]=i,e[14]=r,e[15]=x):x=e[15];let p;return e[16]!==u||e[17]!==x?(p=n.jsxs("div",{className:"px-2 py-1.5",children:[u,x]}),e[16]=u,e[17]=x,e[18]=p):p=e[18],p}function $n(t,e,s){return t.some(r=>e>=r.x&&e<r.x+r.w&&s>=r.y&&s<r.y+r.h)}function ge(t,e,s){for(let r=0;r<100;r++)for(let i=0;i<=V-e;i++){let o=!0;for(let l=0;l<s&&o;l++)for(let d=0;d<e&&o;d++)$n(t,i+d,r+l)&&(o=!1);if(o)return{x:i,y:r}}return{x:0,y:0}}function ue(t,e,s={w:1,h:1}){const r=Math.max(s.w,Math.min(V,t)),i=Math.max(s.h,Math.min(6,e));return{w:r,h:i}}function fe(t,e,s){const r=Math.max(0,Math.min(V-s,t)),i=Math.max(0,e);return{x:r,y:i}}function An(t,e,s){const r=t.find(a=>a.id===e);if(!r)return t;const i=t.filter(a=>a.id!==e),o=i.find(a=>s.x>=a.x&&s.x<a.x+a.w&&s.y>=a.y&&s.y<a.y+a.h);if(o&&o.w===r.w&&o.h===r.h)return t.map(a=>a.id===e?{...a,x:o.x,y:o.y}:a.id===o.id?{...a,x:r.x,y:r.y}:a);const d=[{...r,x:s.x,y:s.y}];for(const a of i){const m=ge(d,a.w,a.h);d.push({...a,x:m.x,y:m.y})}return d}function En(t){const e=k.c(35),{layout:s,isLayoutLoading:r,commitLayout:i}=st();let o;e[0]!==s.hidden?(o=new Set(s.hidden),e[0]=s.hidden,e[1]=o):o=e[1];const l=o;let d,a;if(e[2]!==t||e[3]!==l||e[4]!==s.tiles){a=[];let j;e[7]!==l?(j=v=>v.pinned||!l.has(v.id),e[7]=l,e[8]=j):j=e[8];const w=t.filter(j);d=new Map;for(const v of t)v.minSize&&d.set(v.id,v.minSize);for(const v of w){const b=s.tiles[v.id];if(!b)continue;const N=d.get(v.id),{w:S,h:_}=ue(b.w,b.h,N),{x:C,y:I}=fe(b.x,b.y,S);a.push({id:v.id,x:C,y:I,w:S,h:_,minW:N?.w,minH:N?.h})}for(const v of w){if(a.some(I=>I.id===v.id))continue;const b=v.defaultSize??wn,N=d.get(v.id),{w:S,h:_}=ue(b.w,b.h,N),C=ge(a,S,_);a.push({id:v.id,x:C.x,y:C.y,w:S,h:_,minW:N?.w,minH:N?.h})}e[2]=t,e[3]=l,e[4]=s.tiles,e[5]=d,e[6]=a}else d=e[5],a=e[6];let m;e[9]!==t?(m=new Set(t.map(On)),e[9]=t,e[10]=m):m=e[10];const c=m;let u;e[11]!==c||e[12]!==i?(u=(j,w)=>{const v={};for(const b of j)v[b.id]={x:b.x,y:b.y,w:b.w,h:b.h};i({version:ee,tiles:v,hidden:w.filter(b=>c.has(b))})},e[11]=c,e[12]=i,e[13]=u):u=e[13];const f=u;let h;e[14]!==a?(h={visible:a},e[14]=a,e[15]=h):h=e[15];let x;e[16]!==f||e[17]!==s||e[18]!==a?(x=(j,w)=>{const v=a.find(S=>S.id===j);if(!v)return;const b=fe(w.x,w.y,v.w);if(b.x===v.x&&b.y===v.y)return;const N=An(a,j,b);f(N,s.hidden)},e[16]=f,e[17]=s,e[18]=a,e[19]=x):x=e[19];let p;e[20]!==f||e[21]!==s||e[22]!==d||e[23]!==a?(p=(j,w)=>{const v=a.find(T=>T.id===j);if(!v)return;const b=d.get(j),{w:N,h:S}=ue(w.w,w.h,b);if(N===v.w&&S===v.h)return;const _={...v,w:N,h:S,x:fe(v.x,v.y,N).x},C=a.filter(T=>T.id!==j),I=[_];for(const T of C){const E=ge(I,T.w,T.h);I.push({...T,x:E.x,y:E.y})}f(I,s.hidden)},e[20]=f,e[21]=s,e[22]=d,e[23]=a,e[24]=p):p=e[24];let g;e[25]!==f||e[26]!==s||e[27]!==a?(g=j=>{const w=a.filter(v=>v.id!==j);f(w,Array.from(new Set([...s.hidden,j])))},e[25]=f,e[26]=s,e[27]=a,e[28]=g):g=e[28];let y;return e[29]!==r||e[30]!==h||e[31]!==x||e[32]!==p||e[33]!==g?(y={snapshot:h,isLoading:r,moveTile:x,resizeTile:p,hideTile:g},e[29]=r,e[30]=h,e[31]=x,e[32]=p,e[33]=g,e[34]=y):y=e[34],y}function On(t){return t.id}const Pn={w:2,h:4},Mn={w:1,h:2},zn={w:1,h:1};function Rn(t){return`prompt:${t.agentId}:${t.promptName||"blank"}`}function Ln(t){return t.tileId?`tile:${t.tileId}`:`tile:${t.agentId}:${t.resourceUri}`}function Hn(t){return t.promptName?t.agentName:t.description}function Dn(t){return{name:t.promptName,title:t.title,description:t.description,arguments:t.arguments,_meta:t._meta}}function nt(t){const e=k.c(14),{org:s}=J();let r;e[0]!==s.id||e[1]!==s.slug||e[2]!==t.connectionId?(r=Nt({connectionId:t.connectionId,orgId:s.id,orgSlug:s.slug}),e[0]=s.id,e[1]=s.slug,e[2]=t.connectionId,e[3]=r):r=e[3];const{data:i}=se(r),o=!!i&&!t.toolName;let l;e[4]!==i||e[5]!==o?(l={client:i,enabled:o},e[4]=i,e[5]=o,e[6]=l):l=e[6];const{data:d}=xs(l);let a;e[7]!==t.resourceUri||e[8]!==t.toolName||e[9]!==d?.tools?(a=t.toolName??d?.tools.find(u=>Be(u._meta)===t.resourceUri)?.name,e[7]=t.resourceUri,e[8]=t.toolName,e[9]=d?.tools,e[10]=a):a=e[10];const m=a;let c;return e[11]!==t.connectionId||e[12]!==m?(c=m?bs(t.connectionId,m):void 0,e[11]=t.connectionId,e[12]=m,e[13]=c):c=e[13],c}function Ne(t){const e=k.c(10);let s;e[0]!==t?(s={agentId:t},e[0]=t,e[1]=s):s=e[1];const{start:r,startBlank:i,dialog:o,starting:l}=vn(s);let d;e[2]!==r||e[3]!==i?(d=c=>{if(!c.promptName){i();return}r(Dn(c))},e[2]=r,e[3]=i,e[4]=d):d=e[4];const a=d;let m;return e[5]!==o||e[6]!==a||e[7]!==i||e[8]!==l?(m={open:a,startBlank:i,dialog:o,starting:l},e[5]=o,e[6]=a,e[7]=i,e[8]=l,e[9]=m):m=e[9],m}function Fn(t){const e=k.c(32),{entry:s,isEditMode:r}=t,{open:i,dialog:o,starting:l}=Ne(s.agentId);let d;e[0]!==s||e[1]!==i?(d=()=>i(s),e[0]=s,e[1]=i,e[2]=d):d=e[2];const a=l||r,m=!r&&"cursor-pointer transition-colors hover:bg-accent/40",c=r&&"cursor-default pl-12",u=l&&"opacity-60";let f;e[3]!==m||e[4]!==c||e[5]!==u?(f=G("group/tile relative flex h-full w-full items-center gap-3 px-4 py-3 text-left bg-card",m,c,u),e[3]=m,e[4]=c,e[5]=u,e[6]=f):f=e[6];let h;e[7]!==s.agentIcon||e[8]!==s.agentName?(h=n.jsx(de,{icon:s.agentIcon,name:s.agentName,size:"sm+"}),e[7]=s.agentIcon,e[8]=s.agentName,e[9]=h):h=e[9];let x;e[10]!==s.title?(x=n.jsx("div",{className:"line-clamp-2 text-sm font-medium text-foreground leading-snug",children:s.title}),e[10]=s.title,e[11]=x):x=e[11];let p;e[12]!==s?(p=Hn(s),e[12]=s,e[13]=p):p=e[13];let g;e[14]!==p?(g=n.jsx("div",{className:"truncate text-xs text-muted-foreground mt-0.5",children:p}),e[14]=p,e[15]=g):g=e[15];let y;e[16]!==g||e[17]!==x?(y=n.jsxs("div",{className:"min-w-0 flex-1",children:[x,g]}),e[16]=g,e[17]=x,e[18]=y):y=e[18];let j;e[19]!==r?(j=!r&&n.jsx(gs,{size:16,className:"shrink-0 text-muted-foreground opacity-0 -translate-x-1 transition-all duration-200 group-hover/tile:opacity-100 group-hover/tile:translate-x-0","aria-hidden":!0}),e[19]=r,e[20]=j):j=e[20];let w;e[21]!==l||e[22]!==d||e[23]!==y||e[24]!==j||e[25]!==a||e[26]!==f||e[27]!==h?(w=n.jsxs("button",{type:"button",onClick:d,disabled:a,"aria-busy":l,className:f,children:[h,y,j]}),e[21]=l,e[22]=d,e[23]=y,e[24]=j,e[25]=a,e[26]=f,e[27]=h,e[28]=w):w=e[28];let v;return e[29]!==o||e[30]!==w?(v=n.jsxs(n.Fragment,{children:[w,o]}),e[29]=o,e[30]=w,e[31]=v):v=e[31],v}function Un(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"mt-4 grid w-full grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",children:Array.from({length:3},Qn)}),t[0]=e):e=t[0],e}function Qn(t,e){return n.jsxs("div",{className:"flex w-full items-center gap-3 rounded-2xl bg-card card-shadow px-3 py-2.5",children:[n.jsx(H,{className:"size-10 rounded-xl"}),n.jsxs("div",{className:"flex-1 space-y-1.5",children:[n.jsx(H,{className:"h-3 w-2/3"}),n.jsx(H,{className:"h-2.5 w-1/3"})]})]},`chip-skeleton-${e}`)}function Bn(t){const e=k.c(17),{tile:s,prompts:r,isEditMode:i,tileWidth:o}=t,{org:l}=J(),{open:d,startBlank:a,dialog:m,starting:c}=Ne(s.agentId),u=r.filter(qn),f=nt(s),h="relative flex h-full w-full flex-col p-3";let x;e[0]!==i||e[1]!==f||e[2]!==a||e[3]!==c?(x=!i&&n.jsx("button",{type:"button",onClick:()=>{a(f?{main:f}:void 0)},disabled:c,"aria-busy":c,className:"mb-1 self-start rounded-md px-2 py-1 text-[10px] text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:"Open chat"}),e[0]=i,e[1]=f,e[2]=a,e[3]=c,e[4]=x):x=e[4];const p="flex min-h-0 flex-1 gap-3 overflow-hidden";let g;e[5]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(Kn,{}),e[5]=g):g=e[5];let y;e[6]!==l.id||e[7]!==l.slug||e[8]!==s?(y=n.jsx("div",{className:"min-h-0 flex-1 overflow-hidden rounded-lg border border-border",children:n.jsx($.Suspense,{fallback:g,children:n.jsx(Vn,{tile:s,orgId:l.id,orgSlug:l.slug})})}),e[6]=l.id,e[7]=l.slug,e[8]=s,e[9]=y):y=e[9];const j=u.length>0&&!i&&o>=2&&n.jsx("div",{className:"flex w-44 shrink-0 flex-col gap-2 overflow-hidden",children:u.map(b=>n.jsx("button",{type:"button",onClick:()=>d(b),disabled:c,className:"shrink-0 rounded-lg border border-border bg-background px-2.5 py-2 text-left text-xs leading-snug text-foreground transition-colors hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:n.jsx("span",{className:"line-clamp-2",children:b.title})},b.promptName))});let w;e[10]!==y||e[11]!==j?(w=n.jsxs("div",{className:p,children:[y,j]}),e[10]=y,e[11]=j,e[12]=w):w=e[12];let v;return e[13]!==m||e[14]!==x||e[15]!==w?(v=n.jsxs("div",{className:h,children:[x,w,m]}),e[13]=m,e[14]=x,e[15]=w,e[16]=v):v=e[16],v}function qn(t){return!!t.promptName}function Vn(t){const e=k.c(13),{tile:s,orgId:r,orgSlug:i}=t;let o;e[0]!==r||e[1]!==i||e[2]!==s.connectionId?(o={connectionId:s.connectionId,orgId:r,orgSlug:i},e[0]=r,e[1]=i,e[2]=s.connectionId,e[3]=o):o=e[3];const l=ce(o),d=s.minHeight??200,a=s.maxHeight??4e3;let m;return e[4]!==l||e[5]!==r||e[6]!==i||e[7]!==d||e[8]!==a||e[9]!==s.connectionId||e[10]!==s.resourceUri||e[11]!==s.toolInput?(m=n.jsx(ds,{resourceURI:s.resourceUri,orgId:r,orgSlug:i,connectionId:s.connectionId,client:l,toolInput:s.toolInput,displayMode:"fullscreen",minHeight:d,maxHeight:a,className:"h-full"}),e[4]=l,e[5]=r,e[6]=i,e[7]=d,e[8]=a,e[9]=s.connectionId,e[10]=s.resourceUri,e[11]=s.toolInput,e[12]=m):m=e[12],m}function Kn(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsxs("div",{className:"flex h-full w-full flex-col gap-2 p-4",children:[n.jsx(H,{className:"h-3 w-2/3"}),n.jsx(H,{className:"h-3 w-1/2"}),n.jsx(H,{className:"mt-1 h-full w-full rounded-md"})]}),t[0]=e):e=t[0],e}function Wn(t){const e=k.c(14),{icon:s,name:r}=t;let i;e[0]!==s||e[1]!==r?(i=n.jsx(de,{icon:s,name:r,size:"sm+"}),e[0]=s,e[1]=r,e[2]=i):i=e[2];let o;e[3]!==r?(o=n.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:r}),e[3]=r,e[4]=o):o=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx("div",{className:"truncate text-xs text-muted-foreground",children:"Loading tile…"}),e[5]=l):l=e[5];let d;e[6]!==o?(d=n.jsxs("div",{className:"min-w-0 flex-1",children:[o,l]}),e[6]=o,e[7]=d):d=e[7];let a;e[8]!==i||e[9]!==d?(a=n.jsxs("div",{className:"flex items-center gap-2.5",children:[i,d]}),e[8]=i,e[9]=d,e[10]=a):a=e[10];let m;e[11]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsxs("div",{className:"flex flex-1 flex-col gap-2 pt-1",children:[n.jsx(H,{className:"h-3 w-3/4"}),n.jsx(H,{className:"h-3 w-1/2"}),n.jsx(H,{className:"h-3 w-2/3"})]}),e[11]=m):m=e[11];let c;return e[12]!==a?(c=n.jsxs("div",{className:"flex h-full w-full flex-col gap-3 p-5 opacity-60",children:[a,m]}),e[12]=a,e[13]=c):c=e[13],c}function Gn(t){const e=k.c(10),{tile:s,prompts:r,isEditMode:i}=t,{open:o,startBlank:l,dialog:d,starting:a}=Ne(s.agentId),m=r.filter(Jn),c=nt(s),u="flex h-full w-full flex-col gap-3 p-4";let f;e[0]!==c||e[1]!==l?(f=()=>{l(c?{main:c}:void 0)},e[0]=c,e[1]=l,e[2]=f):f=e[2];const h=a||i;let x;e[3]!==f||e[4]!==h?(x=n.jsx("button",{type:"button",onClick:f,disabled:h,className:"mb-1 self-start rounded-md px-2 py-1 text-[10px] text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:"Open chat"}),e[3]=f,e[4]=h,e[5]=x):x=e[5];const p=m.length>0&&!i&&n.jsx("div",{className:"grid grid-cols-1 gap-2 overflow-hidden sm:grid-cols-2",children:m.map(y=>n.jsx("button",{type:"button",onClick:()=>!i&&o(y),disabled:a,className:"rounded-lg border border-border bg-background px-2.5 py-2 text-left text-xs leading-snug text-foreground transition-colors hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:n.jsx("span",{className:"line-clamp-2",children:y.title})},y.promptName))});let g;return e[6]!==d||e[7]!==x||e[8]!==p?(g=n.jsxs("div",{className:u,children:[x,p,d]}),e[6]=d,e[7]=x,e[8]=p,e[9]=g):g=e[9],g}function Jn(t){return!!t.promptName}function it({isEditMode:t}){const{org:e}=J(),{isLoading:s,prompts:r,tiles:i}=ve(e.slug),o=He()?.ids??[],l=new Set(o),d=De(),a=Ve(),m=le(),c=new Set(i.map(b=>b.agentId)),u=new Map;for(const b of r){const N=u.get(b.agentId);N?N.push(b):u.set(b.agentId,[b])}const f=r.filter(b=>!c.has(b.agentId)),h=[...i.map(b=>({kind:"tile",id:Ln(b),data:b})),...f.map(b=>({kind:"prompt",id:Rn(b),data:b}))],x=new Map(h.map(b=>[b.id,b])),p=En(h.map(b=>({id:b.id,defaultSize:b.kind==="tile"?Pn:zn,minSize:b.kind==="tile"?Mn:void 0,pinned:l.has(b.data.agentId)}))),g=b=>{d.apply(N=>N.filter(S=>S!==b)).catch(()=>U.error("Couldn't remove from home — please try again."))},y=async b=>{if(i.filter(S=>S.agentId===b.agentId).length<=1){g(b.agentId);return}try{const _=(await a.call("COLLECTION_VIRTUAL_MCP_GET",{id:b.agentId})).item;if(!_)throw new Error("Agent not found");const C=Z(_.metadata?.ui),I=b.tileId?C.filter(T=>T.tileId!==b.tileId):C.filter(T=>T.connectionId!==b.connectionId||T.resourceUri!==b.resourceUri);await a.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:b.agentId,data:{metadata:{..._.metadata??{},ui:{..._.metadata?.ui??{},homeTile:null,homeTiles:I}}}}),m.invalidateQueries({queryKey:te.homeNextActions(e.slug)})}catch{U.error("Couldn't remove tile — please try again.")}},j=b=>{const N=x.get(b);if(N){if(!l.has(N.data.agentId)){p.hideTile(b);return}N.kind==="tile"?y(N.data):g(N.data.agentId)}},w=b=>{const N=x.get(b.id);if(!N)return null;if(N.kind==="tile"){const S=u.get(N.data.agentId)??[];return n.jsx(vt,{fallback:n.jsx(Gn,{tile:N.data,prompts:S,isEditMode:t}),children:n.jsx($.Suspense,{fallback:n.jsx(Wn,{icon:N.data.agentIcon,name:N.data.agentName}),children:n.jsx(Bn,{tile:N.data,prompts:S,isEditMode:t,tileWidth:b.w})})})}return n.jsx(Fn,{entry:N.data,isEditMode:t})};return s||p.isLoading?n.jsx(Un,{}):p.snapshot.visible.length===0&&!t?null:n.jsx("div",{className:"mt-4 flex w-full max-w-7xl flex-col gap-4",children:n.jsx(Nn,{tiles:p.snapshot.visible,isEditMode:t,renderTile:w,onMove:p.moveTile,onResize:p.resizeTile,onRemove:j})})}function Xn(t){const e=k.c(2),{prompts:s,tiles:r}=ve(t),i=r.length>0||s.length>0;let o;return e[0]!==i?(o={hasVisibleTiles:i},e[0]=i,e[1]=o):o=e[1],o}const $e=420,Ae=305;function rt(){const t=k.c(4);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("img",{src:"/home/bg-top-left.svg",alt:"",className:"absolute top-0 left-0 h-auto select-none opacity-80 dark:hidden",style:{width:$e}}),t[0]=e):e=t[0];let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx("img",{src:"/home/bg-top-left-dark.svg",alt:"",className:"absolute top-0 left-0 hidden h-auto select-none opacity-80 dark:block",style:{width:$e}}),t[1]=s):s=t[1];let r;t[2]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx("img",{src:"/home/bg-bottom-right.svg",alt:"",className:"absolute bottom-0 right-0 h-auto select-none opacity-80 dark:hidden",style:{width:Ae}}),t[2]=r):r=t[2];let i;return t[3]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsxs("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 overflow-hidden",children:[e,s,r,n.jsx("img",{src:"/home/bg-bottom-right-dark.svg",alt:"",className:"absolute bottom-0 right-0 hidden h-auto select-none opacity-80 dark:block",style:{width:Ae}})]}),t[3]=i):i=t[3],i}function Ee(){const t=k.c(33),{data:e}=jt.useSession(),{org:s}=J(),r=be(),i=$s(),{selectedVirtualMcp:o}=zt();let l;t[0]!==s.id?(l=St(s.id),t[0]=s.id,t[1]=l):l=t[1];const a=o??l;let m;t[2]!==s.slug?(m=Yt(s.slug),t[2]=s.slug,t[3]=m):m=t[3],se(m);let c;t[4]!==s.id||t[5]!==s.slug?(c={connectionId:Ct,orgId:s.id,orgSlug:s.slug},t[4]=s.id,t[5]=s.slug,t[6]=c):c=t[6];const u=ce(c);let f;t[7]!==s.id||t[8]!==s.slug?(f=Ts(s.slug,s.id),t[7]=s.id,t[8]=s.slug,t[9]=f):f=t[9];let h;t[10]!==s.id||t[11]!==s.slug?(h=Xt(s.slug,s.id),t[10]=s.id,t[11]=s.slug,t[12]=h):h=t[12];let x;t[13]!==a.id||t[14]!==s.id||t[15]!==u?(x=Tt(s.id,a.id,u),t[13]=a.id,t[14]=s.id,t[15]=u,t[16]=x):x=t[16];let p;t[17]!==f||t[18]!==h||t[19]!==x?(p={queries:[f,h,x]},t[17]=f,t[18]=h,t[19]=x,t[20]=p):p=t[20],Ms(p);const g=ks(),y=kt(a.id),{hasDecoKey:j,isZeroBalance:w,isInitialFreeCredit:v,balanceDollars:b,hasOnlyDecoProvider:N}=Wt(),{hasVisibleTiles:S}=Xn(s.slug),_=Gt(y?.metadata);if(g.length===0&&!(_&&Jt(i))){let R;return t[21]===Symbol.for("react.memo_cache_sentinel")?(R=n.jsx("div",{className:"flex-1 overflow-y-auto",children:n.jsx("div",{className:"min-h-full flex items-center justify-center px-4 py-10",children:n.jsx(Rt,{})})}),t[21]=R):R=t[21],R}let I;t[22]!==e?.user?.name?(I=e?.user?.name?.split(" ")[0]||"there",t[22]=e?.user?.name,t[23]=I):I=t[23];const T=I,E=j&&v&&b!=null,P=j&&w&&N;let M;t[24]!==b||t[25]!==E||t[26]!==P?(M=E?n.jsx(re.CreditsEyebrow,{balanceDollars:b}):P?n.jsx(re.NoCreditsEyebrow,{}):null,t[24]=b,t[25]=E,t[26]=P,t[27]=M):M=t[27];const Q=M;let z;return t[28]!==Q||t[29]!==S||t[30]!==r||t[31]!==T?(z=n.jsx(yn,{children:r?n.jsx(Zn,{eyebrow:Q,userName:T}):n.jsx(Yn,{eyebrow:Q,userName:T,hasVisibleTiles:S})}),t[28]=Q,t[29]=S,t[30]=r,t[31]=T,t[32]=z):z=t[32],z}function Zn(t){const e=k.c(12),{eyebrow:s,userName:r}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(rt,{}),e[0]=i):i=e[0];let o;e[1]!==s?(o=s&&n.jsx("div",{className:"mb-4",children:s}),e[1]=s,e[2]=o):o=e[2];let l;e[3]!==r?(l=n.jsxs("p",{className:"text-3xl font-medium text-foreground text-center max-w-[280px]",children:["What's on your mind, ",r,"?"]}),e[3]=r,e[4]=l):l=e[4];let d;e[5]!==o||e[6]!==l?(d=n.jsxs("div",{className:"relative flex flex-col items-center justify-center w-full pt-28 pb-8 px-4",children:[o,l]}),e[5]=o,e[6]=l,e[7]=d):d=e[7];let a;e[8]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx("div",{className:"relative w-full flex flex-col gap-4 pb-8 px-4",children:n.jsx(re.Input,{showConnectionsBanner:!0})}),e[8]=a):a=e[8];let m;e[9]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx("div",{className:"relative w-full px-4 pb-8",children:n.jsx(it,{isEditMode:!1})}),e[9]=m):m=e[9];let c;return e[10]!==d?(c=n.jsxs("div",{className:"flex-1 relative flex flex-col items-center overflow-y-auto",children:[i,d,a,m]}),e[10]=d,e[11]=c):c=e[11],c}function Yn(t){const e=k.c(32),{eyebrow:s,userName:r,hasVisibleTiles:i}=t,{isEditMode:o,enter:l,save:d,cancel:a,hasChanges:m}=st(),[c,u]=$.useState(!1);let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=()=>u(!0),e[0]=f):f=e[0];let h;e[1]!==a||e[2]!==l||e[3]!==m||e[4]!==o||e[5]!==d?(h=n.jsx(As.Right,{children:n.jsx(ei,{isEditMode:o,hasChanges:m,onEnter:l,onSave:d,onCancel:a,onAddTile:f})}),e[1]=a,e[2]=l,e[3]=m,e[4]=o,e[5]=d,e[6]=h):h=e[6];let x;e[7]!==c?(x=n.jsx(Rs,{open:c,onOpenChange:u}),e[7]=c,e[8]=x):x=e[8];let p;e[9]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx(rt,{}),e[9]=p):p=e[9];const g=i||o?"pt-32":"flex-1 justify-center";let y;e[10]!==g?(y=G("relative flex flex-col items-center px-10 pb-4",g),e[10]=g,e[11]=y):y=e[11];let j;e[12]!==s?(j=s&&n.jsx("div",{className:"mb-4",children:s}),e[12]=s,e[13]=j):j=e[13];let w;e[14]!==r?(w=n.jsxs("p",{className:"text-3xl font-medium text-foreground",children:["What's on your mind, ",r,"?"]}),e[14]=r,e[15]=w):w=e[15];let v;e[16]!==j||e[17]!==w?(v=n.jsxs("div",{className:"text-center mb-10",children:[j,w]}),e[16]=j,e[17]=w,e[18]=v):v=e[18];let b;e[19]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsxs("div",{className:"relative w-full",children:[n.jsx(ti,{}),n.jsx(re.Input,{showConnectionsBanner:!0})]}),e[19]=b):b=e[19];let N;e[20]!==v?(N=n.jsxs("div",{className:"flex flex-col items-center w-full max-w-[672px]",children:[v,b]}),e[20]=v,e[21]=N):N=e[21];let S;e[22]!==o?(S=n.jsx("div",{className:"relative w-full mt-10 mx-auto max-w-[1280px] px-2 pb-16",children:n.jsx(it,{isEditMode:o})}),e[22]=o,e[23]=S):S=e[23];let _;e[24]!==N||e[25]!==S||e[26]!==y?(_=n.jsxs("div",{className:"flex-1 relative flex flex-col min-h-0",children:[p,n.jsx("div",{className:"flex-1 relative flex flex-col overflow-y-auto",children:n.jsxs("div",{className:y,children:[N,S]})})]}),e[24]=N,e[25]=S,e[26]=y,e[27]=_):_=e[27];let C;return e[28]!==_||e[29]!==h||e[30]!==x?(C=n.jsxs(n.Fragment,{children:[h,x,_]}),e[28]=_,e[29]=h,e[30]=x,e[31]=C):C=e[31],C}function ei(t){const e=k.c(17),{isEditMode:s,hasChanges:r,onEnter:i,onSave:o,onCancel:l,onAddTile:d}=t;if(s){let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(ye,{size:14}),e[0]=c):c=e[0];let u;e[1]!==d?(u=n.jsxs("button",{type:"button",onClick:d,className:"flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",title:"Add a tile from any agent",children:[c,"Add tile"]}),e[1]=d,e[2]=u):u=e[2];let f;e[3]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(Pe,{size:14}),e[3]=f):f=e[3];let h;e[4]!==l?(h=n.jsxs(Y,{size:"sm",variant:"ghost",onClick:l,className:"gap-1.5 h-7 text-xs",children:[f,"Cancel"]}),e[4]=l,e[5]=h):h=e[5];const x=!r;let p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx($t,{size:14}),e[6]=p):p=e[6];let g;e[7]!==o||e[8]!==x?(g=n.jsxs(Y,{size:"sm",onClick:o,disabled:x,className:"gap-1.5 h-7 text-xs",children:[p,"Save"]}),e[7]=o,e[8]=x,e[9]=g):g=e[9];let y;return e[10]!==u||e[11]!==h||e[12]!==g?(y=n.jsxs(n.Fragment,{children:[u,h,g]}),e[10]=u,e[11]=h,e[12]=g,e[13]=y):y=e[13],y}let a;e[14]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(Mt,{size:14}),e[14]=a):a=e[14];let m;return e[15]!==i?(m=n.jsxs("button",{type:"button",onClick:i,className:"flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",title:"Customize your home",children:[a,"Customize"]}),e[15]=i,e[16]=m):m=e[16],m}function ti(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("img",{src:"/home/capybara.png",alt:"","aria-hidden":!0,className:"pointer-events-none absolute -top-16 right-6 z-20 h-20 w-auto select-none"}),t[0]=e):e=t[0],e}function ro(){const t=k.c(2);if(be()){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx("div",{className:"flex-1 min-h-0 flex flex-col bg-background overflow-hidden",children:n.jsx(Ee,{})}),t[0]=r):r=t[0],r}let s;return t[1]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx("div",{className:"flex-1 min-h-0 pb-1 pr-1 pl-0 pt-0",children:n.jsx("div",{className:"h-full p-0.5 pt-0.25",children:n.jsx("div",{className:"flex flex-col h-full bg-background overflow-hidden card-shadow rounded-[0.75rem]",children:n.jsx(Ee,{})})})}),t[1]=s):s=t[1],s}export{ro as default};
|