decocms 4.22.2 → 4.22.3
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-BWfyWgiw.js → AlertCircle-CS_9RDbg.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-h5-lNOU3.js → ArrowUpRight-DvbKSlUB.js} +1 -1
- package/dist/client/assets/{Check-B2t3_u8j.js → Check-CUUu6fuS.js} +1 -1
- package/dist/client/assets/{CheckCircle-Cd9sCPj_.js → CheckCircle-2nPR7mAJ.js} +1 -1
- package/dist/client/assets/{ChevronDown-CJGVvA9G.js → ChevronDown-SbVNxwJa.js} +1 -1
- package/dist/client/assets/{ChevronRight-SxNLyRA0.js → ChevronRight-CcT_Yai8.js} +1 -1
- package/dist/client/assets/{ChevronUp-Cfv8kwOP.js → ChevronUp-DvAb8S9K.js} +1 -1
- package/dist/client/assets/{Circle-CmWJQsR2.js → Circle-Bk2OeGHv.js} +1 -1
- package/dist/client/assets/{Copy01-C_1mrR9P.js → Copy01-DvnmgpBw.js} +1 -1
- package/dist/client/assets/{DotsVertical-DQ-r-KXk.js → DotsVertical-BdQp-tpJ.js} +1 -1
- package/dist/client/assets/{Eye-Jd91Hda4.js → Eye-_b_nmYda.js} +1 -1
- package/dist/client/assets/{FilterLines-C7Zdp7-q.js → FilterLines-Dgm9Ju0X.js} +1 -1
- package/dist/client/assets/{Globe01-4bI1LBPk.js → Globe01-BWEVPBr8.js} +1 -1
- package/dist/client/assets/{Globe04-CPnbhr3e.js → Globe04-wcXsSWcH.js} +1 -1
- package/dist/client/assets/{HardDrive-WT4IA8YF.js → HardDrive-CCq9xvHa.js} +1 -1
- package/dist/client/assets/{Key01-_0kmrESm.js → Key01-BXrc6Emy.js} +1 -1
- package/dist/client/assets/{LayoutLeft-D_5UU_fl.js → LayoutLeft-BStzo30s.js} +1 -1
- package/dist/client/assets/{LinkExternal01-CYx_LjKe.js → LinkExternal01-BuzymGhb.js} +1 -1
- package/dist/client/assets/{List-5nWMXvgZ.js → List-BFtSkA22.js} +1 -1
- package/dist/client/assets/{Loading02-D5Q9o2ML.js → Loading02-Cc_XPeVS.js} +1 -1
- package/dist/client/assets/{Monitor01-EVfMwGgl.js → Monitor01-BJSW7YEH.js} +1 -1
- package/dist/client/assets/{Palette-Cg2Il5Mo.js → Palette-BudWH9og.js} +1 -1
- package/dist/client/assets/{Play-C4pBBuTc.js → Play-tpQoZZ7-.js} +1 -1
- package/dist/client/assets/{Plus-Cj9kK9tN.js → Plus-6nUvzb_a.js} +1 -1
- package/dist/client/assets/{SearchLg-JSkDDvk4.js → SearchLg-uOXEhZpb.js} +1 -1
- package/dist/client/assets/{SearchMd-CP9WApAb.js → SearchMd-CxCfJ-k7.js} +1 -1
- package/dist/client/assets/{Settings02-Bs74lw7T.js → Settings02-C4te5XIh.js} +1 -1
- package/dist/client/assets/{Shield01-DMFwBOtF.js → Shield01-DL0nLXwm.js} +1 -1
- package/dist/client/assets/{Star01-CC3gyOop.js → Star01-BMo746nc.js} +1 -1
- package/dist/client/assets/{Stars01-DKD-uu49.js → Stars01-CeLaUJek.js} +1 -1
- package/dist/client/assets/{Stars02-DGriyPK-.js → Stars02-CbNiaecd.js} +1 -1
- package/dist/client/assets/{Sun-DszeKWvN.js → Sun-DdZgJrCs.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-a_i15cCW.js → SwitchHorizontal01-BmduH4aR.js} +1 -1
- package/dist/client/assets/{Tool01-iIXzQIf6.js → Tool01-TTGB3OaR.js} +1 -1
- package/dist/client/assets/{Trash01-D_xTnQtW.js → Trash01-D7DoI-Sm.js} +1 -1
- package/dist/client/assets/{Upload01-COCQSA6j.js → Upload01-DK0nNkQH.js} +1 -1
- package/dist/client/assets/{User01-DBHhpCM7.js → User01-zyFcbX02.js} +1 -1
- package/dist/client/assets/{Users01-BymojQtX.js → Users01-DD6y7ZFy.js} +1 -1
- package/dist/client/assets/{Users03-Dnn-6pZq.js → Users03-CbmB3ag4.js} +1 -1
- package/dist/client/assets/{X-DY9hR308.js → X-qcmmBu7s.js} +1 -1
- package/dist/client/assets/{XCircle-DofnF94J.js → XCircle-Bn7fkWKh.js} +1 -1
- package/dist/client/assets/{XClose-CmiCfuv_.js → XClose-aB151tNh.js} +1 -1
- package/dist/client/assets/{Zap-BwbZR_TW.js → Zap-CKOdamGS.js} +1 -1
- package/dist/client/assets/{ZapSquare-B7pUKk1h.js → ZapSquare-BWJNUjCu.js} +1 -1
- package/dist/client/assets/{ZoomOut-B3kimgA9.js → ZoomOut-TFjut-PL.js} +1 -1
- package/dist/client/assets/{access-gate-BOS773UI.js → access-gate-BrC4x4bH.js} +1 -1
- package/dist/client/assets/{add-section-modal-Z7yIxDfk.js → add-section-modal-CMgGjfQy.js} +1 -1
- package/dist/client/assets/{agent-capabilities-DRUNyKs6.js → agent-capabilities-B_99zpHP.js} +1 -1
- package/dist/client/assets/{agent-icon-K57A0DzY.js → agent-icon-CPQk4YwJ.js} +1 -1
- package/dist/client/assets/{agents-list-DdfrpJA4.js → agents-list-nbmqgS_E.js} +1 -1
- package/dist/client/assets/{ai-providers-ZlX0S41Y.js → ai-providers-D0wJFLuS.js} +1 -1
- package/dist/client/assets/{alert-D12iE_jh.js → alert-CIXXRGUS.js} +1 -1
- package/dist/client/assets/{alert-dialog-BuY0O9iQ.js → alert-dialog-DmHjxQGj.js} +1 -1
- package/dist/client/assets/{app-editor-B6oORsVZ.js → app-editor-BsolX872.js} +1 -1
- package/dist/client/assets/{auth-D1xUzxIp.js → auth-D0kIsFu2.js} +1 -1
- package/dist/client/assets/{auth-catchall-BTjXPhNI.js → auth-catchall-DqYoQiw7.js} +1 -1
- package/dist/client/assets/{auth-entry-Bg2Xb6tT.js → auth-entry-D3jHJu3A.js} +1 -1
- package/dist/client/assets/{auth-split-layout-CzHLXrwa.js → auth-split-layout-CX7sxZli.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-CbQ04gTK.js → authenticate-and-persist-oauth-DkNbTtTB.js} +1 -1
- package/dist/client/assets/{automation-list-row-3xTUT0sz.js → automation-list-row-F_XkFIpJ.js} +1 -1
- package/dist/client/assets/{automation-runs-B5QugYRM.js → automation-runs-fA1ChIGW.js} +1 -1
- package/dist/client/assets/{automations-DpLONqEv.js → automations-mTaCH83G.js} +1 -1
- package/dist/client/assets/{avatar-b6IKYKQs.js → avatar-B8x-LJ3L.js} +1 -1
- package/dist/client/assets/{badge-DGFEVFje.js → badge-Du0UNTzb.js} +1 -1
- package/dist/client/assets/{block-document-CLPFDPat.js → block-document-iNfCDN2P.js} +1 -1
- package/dist/client/assets/{brand-context-Ba-On5d-.js → brand-context-E2Z3Pmiz.js} +1 -1
- package/dist/client/assets/{breadcrumb-8G_CoEun.js → breadcrumb-BShjlVDr.js} +1 -1
- package/dist/client/assets/{buckets-pXaevYUV.js → buckets-BT1sWv9w.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-OTFFglhS.js → bulk-category-panel-CXG1IXf-.js} +1 -1
- package/dist/client/assets/{capability-load-error-CEmXpgFG.js → capability-load-error-DsHvqjTt.js} +1 -1
- package/dist/client/assets/{card-dPxA0RCs.js → card-CYX_RwBA.js} +1 -1
- package/dist/client/assets/{category-editor-B2KWZmpg.js → category-editor-DjMzIFH_.js} +1 -1
- package/dist/client/assets/{chat-context-COllONR2.js → chat-context-Cemyx-UZ.js} +1 -1
- package/dist/client/assets/{checkbox-5y5TSI8u.js → checkbox-DZJkrzus.js} +1 -1
- package/dist/client/assets/{cli-auth-success-DY-Hf-b0.js → cli-auth-success-DOW9HsKN.js} +1 -1
- package/dist/client/assets/{collection-detail-bmPgPvem.js → collection-detail-BMZKhngT.js} +1 -1
- package/dist/client/assets/{collection-display-button-B4kpKs3o.js → collection-display-button-BuAgDHrw.js} +1 -1
- package/dist/client/assets/{collection-search-SaKzAiAF.js → collection-search-DfgQYgyj.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-CJ-K0eS_.js → collection-table-wrapper-hkqvebTU.js} +1 -1
- package/dist/client/assets/{collection-tabs-CZb_AY94.js → collection-tabs-D3XeP_yy.js} +1 -1
- package/dist/client/assets/{command-DDwBnk4S.js → command-DN00KTSb.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-Cj6KuavN.js → commerce-onboarding-yWSM0PQD.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-uu1uNLI_.js → connect-desktop-dialog-DnC2R2Wo.js} +1 -1
- package/dist/client/assets/{connection-card-BsaY572f.js → connection-card-BoKNDsqu.js} +1 -1
- package/dist/client/assets/{connection-detail-CVTulNyz.js → connection-detail-C_252exw.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-CHdocTpm.js → connection-form-helpers-DgmmJwTY.js} +1 -1
- package/dist/client/assets/{connections-JYGKhfuk.js → connections-BMIC4hHM.js} +1 -1
- package/dist/client/assets/{decopilot-B6qg2Op3.js → decopilot-CETHa21a.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-D8tR3MTD.js → decopilot-sse-pool-C82Ujbm_.js} +1 -1
- package/dist/client/assets/{dialog-RRPWwqaQ.js → dialog-CEOLT1ZZ.js} +1 -1
- package/dist/client/assets/{domain-settings-CtXa1jf3.js → domain-settings-BSIbwctC.js} +1 -1
- package/dist/client/assets/{drawer-DJfZ0VmD.js → drawer-B-rufaJn.js} +1 -1
- package/dist/client/assets/{dropdown-menu-DDhytuEd.js → dropdown-menu-CeNfEKAu.js} +1 -1
- package/dist/client/assets/{empty-state-CtsFp5nF.js → empty-state-BXO7rHQu.js} +1 -1
- package/dist/client/assets/{extract-connection-data-DI_Hy6px.js → extract-connection-data-Db76guDM.js} +1 -1
- package/dist/client/assets/{file-explorer-D1P9uacX.js → file-explorer-CLuX6xBf.js} +1 -1
- package/dist/client/assets/{file-type-icon-CBM2EyFd.js → file-type-icon-CxAOgcI2.js} +1 -1
- package/dist/client/assets/{files-DdTksaS8.js → files-BjIbXeVM.js} +1 -1
- package/dist/client/assets/{form-BylSC3lX.js → form-DtFQ7vfL.js} +1 -1
- package/dist/client/assets/{general-DGX6oTcl.js → general-DHyqePel.js} +1 -1
- package/dist/client/assets/{github-repo-picker-J64_EPEa.js → github-repo-picker-DXC0Oul4.js} +1 -1
- package/dist/client/assets/{hooks-B4JA5-D1.js → hooks-DLOVOtDp.js} +1 -1
- package/dist/client/assets/{index-DTx-RDv5.js → index-914V2fcS.js} +1 -1
- package/dist/client/assets/{index-DEenRZAo.js → index-9ntojBLk.js} +1 -1
- package/dist/client/assets/{index-DKXcf6uO.js → index-B1FK7wQH.js} +1 -1
- package/dist/client/assets/{index-CZfoQE-0.js → index-BNz3lima.js} +1 -1
- package/dist/client/assets/{index-B3JJ62uP.js → index-Blor2-rz.js} +1 -1
- package/dist/client/assets/{index-Bxu03H5X.js → index-BlyuLoWx.js} +1 -1
- package/dist/client/assets/{index-FLLcVjP1.js → index-Cs6NaxUB.js} +25 -25
- package/dist/client/assets/{index-8heN4TLW.js → index-Cwr5cOYK.js} +1 -1
- package/dist/client/assets/{index-CC3_vx1n.js → index-D5RT2LDt.js} +1 -1
- package/dist/client/assets/{index-jUZDCPpZ.js → index-Ds2zXC-C.js} +1 -1
- package/dist/client/assets/{index-DACIolxc.js → index-Um2y51Zg.js} +1 -1
- package/dist/client/assets/{index-DHu9eqr8.js → index-g1gbVRQq.js} +1 -1
- package/dist/client/assets/{index-redirect-KOsw3DwK.js → index-redirect-D63CT2D1.js} +1 -1
- package/dist/client/assets/{index-5AaNNafz.js → index-wvMNjAV0.js} +3 -3
- package/dist/client/assets/{index-C7SCPFX7.js → index-yCHQGXJ7.js} +1 -1
- package/dist/client/assets/{input-BAz505sI.js → input-CtNQHwPy.js} +1 -1
- package/dist/client/assets/{integration-icon-DtLxCtgy.js → integration-icon-DvFXK2MU.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-BDVAAQIu.js → invite-member-dialog-CrMqsXT4.js} +1 -1
- package/dist/client/assets/{label-BALEyZ3d.js → label-B8KM3R_q.js} +1 -1
- package/dist/client/assets/{library-tab-Ds5fpIQF.js → library-tab-DFX3AeS3.js} +1 -1
- package/dist/client/assets/{login-DPGDZC34.js → login-DxUhmOqI.js} +1 -1
- package/dist/client/assets/{mcp-oauth-CXxRaWx9.js → mcp-oauth-DzrEuQr5.js} +1 -1
- package/dist/client/assets/{members-Bape-XGh.js → members-CPkTTkE0.js} +1 -1
- package/dist/client/assets/{monaco-editor-qr3YxpgD.js → monaco-editor-BgI79QTg.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-DHs40KAy.js → monitoring-stats-row-CUczTxeX.js} +1 -1
- package/dist/client/assets/{oauth-callback-DAEXXBSA.js → oauth-callback-DIyFvghE.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-DGzIC1E3.js → oauth-callback-ai-provider-IS3SsI0k.js} +1 -1
- package/dist/client/assets/{onboarding-BQNZ1j24.js → onboarding-KfqNRkYy.js} +1 -1
- package/dist/client/assets/{org-install-cdxFoHPK.js → org-install-CxT0tsIO.js} +1 -1
- package/dist/client/assets/{org-layout-MlmaWu50.js → org-layout-BQzjU6XX.js} +1 -1
- package/dist/client/assets/{organization-choice-CCNhBIVu.js → organization-choice-BI1DZkDU.js} +1 -1
- package/dist/client/assets/{page-seo-form-B9WRtqtD.js → page-seo-form-D7JF4DTh.js} +1 -1
- package/dist/client/assets/page-seo-sheet-BzOt7DdS.js +1 -0
- package/dist/client/assets/{popover-QpTPPo-c.js → popover-Cvv98a2C.js} +1 -1
- package/dist/client/assets/{post-editor-DrsCS-yJ.js → post-editor-6_kkiUtL.js} +1 -1
- package/dist/client/assets/{primitives-BjlgEPjn.js → primitives-Bxk9aYw4.js} +1 -1
- package/dist/client/assets/{profile-BJ8vtOlo.js → profile-CZas9jg2.js} +1 -1
- package/dist/client/assets/project-app-view-xDz9FH-v.js +1 -0
- package/dist/client/assets/record-editor-C33gYIwT.js +1 -0
- package/dist/client/assets/registry-D8itHQYS.js +2 -0
- package/dist/client/assets/{registry-layout-ksLcOWzv.js → registry-layout-8sIvvJ4I.js} +1 -1
- package/dist/client/assets/{require-capability-C2pr3gWk.js → require-capability-CSyEuadx.js} +1 -1
- package/dist/client/assets/{required-auth-layout-BIsgDBTS.js → required-auth-layout-CH2SPOr0.js} +1 -1
- package/dist/client/assets/{reset-password-5xoBMew1.js → reset-password-CftvJ30J.js} +1 -1
- package/dist/client/assets/{roles-CTVYbrPK.js → roles-b4IJFdUQ.js} +1 -1
- package/dist/client/assets/{scroll-area-B7g9A0xO.js → scroll-area-CbuKwozG.js} +1 -1
- package/dist/client/assets/{search-input-Cn-k-Sr0.js → search-input-BJJrtkoD.js} +1 -1
- package/dist/client/assets/{secrets-01-N-EoG.js → secrets-xEL3iU0h.js} +1 -1
- package/dist/client/assets/{sections-editor-FTn-qJ5h.js → sections-editor-I7PrxFXt.js} +1 -1
- package/dist/client/assets/{select-DMOL9nTa.js → select-DF6YoK_r.js} +1 -1
- package/dist/client/assets/{select-model-DJ7qLHls.js → select-model-nui66-pH.js} +1 -1
- package/dist/client/assets/{seo-editor-CJg20m-v.js → seo-editor-BJAI05hX.js} +1 -1
- package/dist/client/assets/{settings-layout-C-lnHpnd.js → settings-layout-urJbxzRN.js} +1 -1
- package/dist/client/assets/{settings-section-knuBYiSB.js → settings-section-CngINngb.js} +1 -1
- package/dist/client/assets/{sheet-B1hdeTXZ.js → sheet-DMc7DeSX.js} +1 -1
- package/dist/client/assets/{shell-controls-DGQEgSmu.js → shell-controls-Bkd5dBPA.js} +1 -1
- package/dist/client/assets/{shell-layout-BzrEGgvG.js → shell-layout-CoG2R-A7.js} +1 -1
- package/dist/client/assets/{sidebar-BZHqZbJ1.js → sidebar-yJWB-4vB.js} +1 -1
- package/dist/client/assets/{skeleton-C1g3sLzc.js → skeleton-CEKyj6Ku.js} +1 -1
- package/dist/client/assets/{sso-BRP47dTR.js → sso-C_CoNDtw.js} +1 -1
- package/dist/client/assets/{store-COqKQ01f.js → store-B3cr8RRQ.js} +1 -1
- package/dist/client/assets/store-registry-0mo75fzc.js +2 -0
- package/dist/client/assets/{studio-tools-CK3O9apC.js → studio-tools-CEhEjTYq.js} +1 -1
- package/dist/client/assets/{switch-CTqoacsA.js → switch-CDv7wzZp.js} +1 -1
- package/dist/client/assets/{table-D9O3xZPm.js → table-_yINUqfn.js} +1 -1
- package/dist/client/assets/{tabs-OKKf4LAY.js → tabs-Cf3RVJ3Q.js} +1 -1
- package/dist/client/assets/{task-row-mk4G9x-_.js → task-row-BVs0CmAg.js} +1 -1
- package/dist/client/assets/{task-status-gvDe4NpG.js → task-status-VysJG0vN.js} +1 -1
- package/dist/client/assets/{textarea-BwMDBTqD.js → textarea-CDy5MusJ.js} +1 -1
- package/dist/client/assets/{toggle-group-CqoGi-AW.js → toggle-group-Dtf2CWD1.js} +1 -1
- package/dist/client/assets/{toolbar-Do7hu99P.js → toolbar-DeO3vJmm.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-D8xZWaZ4.js → toolbar-icon-button-C4_ADEJH.js} +1 -1
- package/dist/client/assets/{tools-list-D7bHk7AU.js → tools-list-Cn_EK2iQ.js} +1 -1
- package/dist/client/assets/{tooltip-jwNiafJz.js → tooltip-DlUY886I.js} +1 -1
- package/dist/client/assets/{types-Z9nbiCM2.js → types-CvzpcJR1.js} +1 -1
- package/dist/client/assets/{use-ai-providers-CaFOP2gL.js → use-ai-providers-BJKmj4My.js} +1 -1
- package/dist/client/assets/{use-automations-BYB1tBxg.js → use-automations-BFGNyCFk.js} +1 -1
- package/dist/client/assets/{use-capability-BJgOQ1dM.js → use-capability-DgzJJHkU.js} +1 -1
- package/dist/client/assets/{use-clock-tick-DiuTRa3m.js → use-clock-tick-BEBincp5.js} +1 -1
- package/dist/client/assets/{use-collections-D9VCe-RD.js → use-collections-CjkVI8cV.js} +1 -1
- package/dist/client/assets/{use-connection-BsHhz007.js → use-connection-ChjsmWTh.js} +1 -1
- package/dist/client/assets/{use-copy-BhkveYAE.js → use-copy-I4FalMZb.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-DL7SpS9p.js → use-create-virtual-mcp-BmL59nAp.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-CP4G_DMm.js → use-debounced-autosave-DhGwNW9j.js} +1 -1
- package/dist/client/assets/{use-debounced-value-qurf1YAB.js → use-debounced-value-CLg8LNax.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-89JO9cLA.js → use-decopilot-events-uhlm9ZSC.js} +1 -1
- package/dist/client/assets/{use-delete-connection-CPcnCL2Y.js → use-delete-connection-CZmgFI8O.js} +1 -1
- package/dist/client/assets/{use-file-configs-C37Mzz_w.js → use-file-configs-aZ5m3Qj2.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-Dzaxo4bN.js → use-infinite-scroll-DI0qAEco.js} +1 -1
- package/dist/client/assets/{use-join-requests-CPgcKwb5.js → use-join-requests-CIrAIT4T.js} +1 -1
- package/dist/client/assets/{use-mcp-client-DAdRU1cY.js → use-mcp-client-dBNHEL6c.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-DbP7dBZf.js → use-mcp-prompts-D2VFS_7Z.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-s0H1m2Ok.js → use-mcp-tools-DX5g41Xz.js} +1 -1
- package/dist/client/assets/{use-members-BT2wuks0.js → use-members-BeAV3T2H.js} +1 -1
- package/dist/client/assets/{use-mobile-CCjACM_-.js → use-mobile-7niVKoti.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-CMFaBfX6.js → use-navigate-to-agent-C1tFWD13.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-BSqoqb51.js → use-org-auth-client-CwSEkcA-.js} +1 -1
- package/dist/client/assets/{use-org-sso-CZi5R7ze.js → use-org-sso-CXSE3hAV.js} +1 -1
- package/dist/client/assets/{use-organization-roles-amhmG5-6.js → use-organization-roles-C8hy4d4V.js} +1 -1
- package/dist/client/assets/{use-organization-settings-DJLfSIHV.js → use-organization-settings-OjpRHnBI.js} +1 -1
- package/dist/client/assets/{use-registry-connections-DPtEZCsY.js → use-registry-connections-BiMSB_yO.js} +1 -1
- package/dist/client/assets/{use-secrets-CTWIslZA.js → use-secrets-sNifGUNT.js} +1 -1
- package/dist/client/assets/{use-status-sounds-Du5pinlF.js → use-status-sounds-BjM7PTwu.js} +1 -1
- package/dist/client/assets/{use-view-mode-C9H3mYaP.js → use-view-mode-C6xNmVYR.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-B0Bq3-Jt.js → use-virtual-mcp-Cy-jA6Qm.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-CcA0p7if.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-DXVqJ8aq.js +1 -0
- package/dist/client/assets/{useSuspenseQueries-BQ3vTQtS.js → useSuspenseQueries-Dg30S2DW.js} +1 -1
- package/dist/client/assets/{variant-calendar-DKaaO6xE.js → variant-calendar-DoCnqvSc.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-B6q9qYR8.js → view-mode-toggle-BMDNQ_Ex.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +1 -1
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/page-seo-sheet-Da6XfVR0.js +0 -1
- package/dist/client/assets/project-app-view-DseQWbDi.js +0 -1
- package/dist/client/assets/record-editor-DbGexVfp.js +0 -1
- package/dist/client/assets/registry-DeMcmcPG.js +0 -2
- package/dist/client/assets/store-registry-DkYzijdd.js +0 -2
- package/dist/client/assets/useInfiniteQuery-C7fx2naq.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DpHAMt5e.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as k,j as n,r as A,D as J,m as xe,l as Q,i as le,ag as Z,t as K,K as te,k as se,B as Y,d as nt,W as it,E as ot,a as rt,b as lt,u as at}from"./index-5AaNNafz.js";import{u as ge}from"./use-mobile-CCjACM_-.js";import{u as ct}from"./useSuspenseQueries-BQ3vTQtS.js";import{u as ae,m as dt}from"./use-mcp-client-DAdRU1cY.js";import{i as mt,a as ut,S as ft}from"./constants-C8_Swa4x.js";import{u as pt,b as ht,v as xt,a as gt}from"./use-virtual-mcp-B0Bq3-Jt.js";import{i as bt}from"./Check-B2t3_u8j.js";import{b as Pe,a as Se}from"./ZoomOut-B3kimgA9.js";import{i as yt,A as ce,t as jt,ae as vt,H as Nt,l as wt}from"./agent-icon-K57A0DzY.js";import{s as be}from"./Plus-Cj9kK9tN.js";import{i as ye}from"./X-DY9hR308.js";import{p as St}from"./index-CZfoQE-0.js";import{b as Me,c as oe,K as Ee,P as ze,D as Le,d as _t,S as Ct,v as It,g as Tt,h as kt,i as $t,f as At,e as Pt,n as Mt,C as re,L as Et,k as zt}from"./library-tab-Ds5fpIQF.js";import{f as Lt,d as Ot}from"./tab-id-CLpu897Q.js";import{b as Dt}from"./chat-context-COllONR2.js";import{N as Ht}from"./decopilot-B6qg2Op3.js";import{g as Rt,u as Ft,c as Ut,h as Bt}from"./agent-capabilities-DRUNyKs6.js";import{a as Oe,b as De,o as Vt}from"./use-organization-settings-DJLfSIHV.js";import{c as je,b as Kt,h as Wt}from"./shell-layout-BzrEGgvG.js";import{I as He}from"./input-BAz505sI.js";import{S as qt,t as ve,P as Gt,j as Qt,s as Jt,g as Xt}from"./scroll-area-B7g9A0xO.js";import{S as Zt,a as Yt,b as es,c as ts,d as ss}from"./sheet-B1hdeTXZ.js";import{S as V}from"./skeleton-C1g3sLzc.js";import{t as Re}from"./ChevronDown-CJGVvA9G.js";import{g as Fe,M as ns}from"./types-Z9nbiCM2.js";import{I as Ue}from"./integration-icon-DtLxCtgy.js";import{S as is,a as os,b as rs,c as _e,d as ls}from"./select-DMOL9nTa.js";import{T as as}from"./textarea-BwMDBTqD.js";import{u as Be}from"./studio-tools-CK3O9apC.js";import{a as cs}from"./use-mcp-tools-s0H1m2Ok.js";import{i as ds}from"./XCircle-DofnF94J.js";import{g as ms}from"./use-mcp-prompts-DbP7dBZf.js";import{b as us,w as fs}from"./hooks-B4JA5-D1.js";import{b as ps,d as hs,c as xs,D as gs,a as bs}from"./dropdown-menu-DDhytuEd.js";import{s as ys}from"./Trash01-D_xTnQtW.js";import{a as js,u as vs}from"./use-ai-providers-CaFOP2gL.js";import{u as Ns}from"./connect-desktop-dialog-uu1uNLI_.js";import{T as ws}from"./toolbar-Do7hu99P.js";import"./auth-D1xUzxIp.js";import"./use-collections-D9VCe-RD.js";import"./AlertCircle-BWfyWgiw.js";import"./Tool01-iIXzQIf6.js";import"./SwitchHorizontal01-a_i15cCW.js";import"./Settings02-Bs74lw7T.js";import"./ArrowUpRight-h5-lNOU3.js";import"./ZapSquare-B7pUKk1h.js";import"./Users03-Dnn-6pZq.js";import"./CheckCircle-Cd9sCPj_.js";import"./ChevronRight-SxNLyRA0.js";import"./ChevronUp-Cfv8kwOP.js";import"./Circle-CmWJQsR2.js";import"./Stars02-DGriyPK-.js";import"./Loading02-D5Q9o2ML.js";import"./Copy01-C_1mrR9P.js";import"./DotsVertical-DQ-r-KXk.js";import"./Globe01-4bI1LBPk.js";import"./Eye-Jd91Hda4.js";import"./FilterLines-C7Zdp7-q.js";import"./Star01-CC3gyOop.js";import"./Globe04-CPnbhr3e.js";import"./HardDrive-WT4IA8YF.js";import"./Key01-_0kmrESm.js";import"./LayoutLeft-D_5UU_fl.js";import"./LinkExternal01-CYx_LjKe.js";import"./List-5nWMXvgZ.js";import"./Monitor01-EVfMwGgl.js";import"./Sun-DszeKWvN.js";import"./Palette-Cg2Il5Mo.js";import"./Play-C4pBBuTc.js";import"./SearchLg-JSkDDvk4.js";import"./SearchMd-CP9WApAb.js";import"./Shield01-DMFwBOtF.js";import"./Stars01-DKD-uu49.js";import"./Upload01-COCQSA6j.js";import"./User01-DBHhpCM7.js";import"./Users01-BymojQtX.js";import"./XClose-CmiCfuv_.js";import"./Zap-BwbZR_TW.js";import"./alert-dialog-BuY0O9iQ.js";import"./dialog-RRPWwqaQ.js";import"./file-type-icon-CBM2EyFd.js";import"./use-debounced-value-qurf1YAB.js";import"./popover-QpTPPo-c.js";import"./tooltip-jwNiafJz.js";import"./index-8heN4TLW.js";import"./drawer-DJfZ0VmD.js";import"./collection-search-SaKzAiAF.js";import"./form-BylSC3lX.js";import"./label-BALEyZ3d.js";import"./tabs-OKKf4LAY.js";import"./toggle-group-CqoGi-AW.js";import"./command-DDwBnk4S.js";import"./index-DHu9eqr8.js";import"./useInfiniteQuery-C7fx2naq.js";import"./use-infinite-scroll-Dzaxo4bN.js";import"./question-004-sINsf4GQ.js";import"./use-decopilot-events-89JO9cLA.js";import"./decopilot-sse-pool-D8tR3MTD.js";import"./backoff-CrEUbyZT.js";import"./checkbox-5y5TSI8u.js";import"./ai-providers-logos-DD3qZ33J.js";import"./avatar-b6IKYKQs.js";import"./settings-section-knuBYiSB.js";import"./card-dPxA0RCs.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-BsaY572f.js";import"./use-registry-connections-DPtEZCsY.js";import"./use-connection-BsHhz007.js";import"./extract-connection-data-DI_Hy6px.js";import"./collection-tabs-CZb_AY94.js";import"./badge-DGFEVFje.js";import"./connection-form-helpers-CHdocTpm.js";import"./authenticate-and-persist-oauth-CbQ04gTK.js";import"./mcp-oauth-CXxRaWx9.js";import"./useSuspenseInfiniteQuery-DpHAMt5e.js";import"./required-auth-layout-BIsgDBTS.js";import"./use-org-sso-CZi5R7ze.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-BhkveYAE.js";import"./content-blocks-o63cs2vh.js";import"./use-clock-tick-DiuTRa3m.js";import"./use-navigate-to-agent-CMFaBfX6.js";import"./delay-CnY5UFtP.js";function Ve(t){const e=k.c(11),{properties:s,required:o,values:i,onChange:r}=t;let a;e[0]!==o?(a=o??[],e[0]=o,e[1]=a):a=e[1];let d;e[2]!==a?(d=new Set(a),e[2]=a,e[3]=d):d=e[3];const l=d;let m;e[4]!==s?(m=Object.entries(s),e[4]=s,e[5]=m):m=e[5];let c;return e[6]!==r||e[7]!==l||e[8]!==m||e[9]!==i?(c=n.jsx("div",{className:"flex flex-col gap-2",children:m.map(u=>{const[f,p]=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,l.has(f)&&n.jsx("span",{className:"text-red-500 text-[10px]",children:"*"})]}),n.jsx("span",{className:"text-[10px] text-muted-foreground font-mono",children:p.type})]}),p.description&&n.jsx("p",{className:"text-[10px] text-muted-foreground leading-snug",children:p.description}),n.jsx(Ss,{type:p.type,fieldKey:f,value:i[f],onChange:h=>r(f,h)})]},f)})}),e[6]=r,e[7]=l,e[8]=m,e[9]=i,e[10]=c):c=e[10],c}function Ss(t){const e=k.c(19),{type:s,fieldKey:o,value:i,onChange:r}=t;if(s==="object"||s==="array"){const c=i??"";let u;e[0]!==r?(u=h=>r(h.target.value),e[0]=r,e[1]=u):u=e[1];const f=`Enter ${o} as JSON…`;let p;return e[2]!==c||e[3]!==u||e[4]!==f?(p=n.jsx(as,{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]=p):p=e[5],p}if(s==="boolean"){const c=i!=null?String(i):"";let u;e[6]!==r?(u=g=>r(g==="true"),e[6]=r,e[7]=u):u=e[7];let f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(is,{className:"h-7 text-xs",children:n.jsx(os,{placeholder:"Select…"})}),e[8]=f):f=e[8];let p;e[9]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsxs(rs,{children:[n.jsx(_e,{value:"true",children:"true"}),n.jsx(_e,{value:"false",children:"false"})]}),e[9]=p):p=e[9];let h;return e[10]!==c||e[11]!==u?(h=n.jsxs(ls,{value:c,onValueChange:u,children:[f,p]}),e[10]=c,e[11]=u,e[12]=h):h=e[12],h}const a=i??"";let d;e[13]!==r?(d=c=>r(c.target.value),e[13]=r,e[14]=d):d=e[14];const l=`Enter ${o}…`;let m;return e[15]!==a||e[16]!==d||e[17]!==l?(m=n.jsx(He,{className:"h-7 text-xs",value:a,onChange:d,placeholder:l}),e[15]=a,e[16]=d,e[17]=l,e[18]=m):m=e[18],m}const ne=8;function _s(t){const e=k.c(16),{open:s,onOpenChange:o}=t,[i,r]=A.useState("");let a,d;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(Zt,{children:"Manage home"}),d=n.jsx(Yt,{children:"Add agents to the home board and pin their interactive UIs or prompts."}),e[0]=a,e[1]=d):(a=e[0],d=e[1]);let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(yt,{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]=l):l=e[2];let m;e[3]===Symbol.for("react.memo_cache_sentinel")?(m=g=>r(g.target.value),e[3]=m):m=e[3];let c;e[4]!==i?(c=n.jsxs(es,{className:"px-5 py-4 border-b border-border",children:[a,d,n.jsxs("div",{className:"relative mt-3",children:[l,n.jsx(He,{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(tn,{}),e[6]=u):u=e[6];let f;e[7]!==i?(f=n.jsx(qt,{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(A.Suspense,{fallback:u,children:n.jsx(Is,{search:i})})})}),e[7]=i,e[8]=f):f=e[8];let p;e[9]!==c||e[10]!==f?(p=n.jsxs(ts,{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]=p):p=e[11];let h;return e[12]!==o||e[13]!==s||e[14]!==p?(h=n.jsx(ss,{open:s,onOpenChange:o,children:p}),e[12]=o,e[13]=s,e[14]=p,e[15]=h):h=e[15],h}function Cs(t){const e=k.c(32),{org:s}=J(),o=Oe();let i;e[0]!==o?.ids?(i=o?.ids??[],e[0]=o?.ids,e[1]=i):i=e[1];const r=i,a=De(),d=ht(),l=xe();let m;e[2]!==s||e[3]!==l?(m=()=>l.refetchQueries({queryKey:te.homeNextActions(s.slug),type:"active"}),e[2]=s,e[3]=l,e[4]=m):m=e[4];const c=m;let u;e[5]!==r?(u=_=>r.includes(_),e[5]=r,e[6]=u):u=e[6];const f=u;let p;e[7]!==r||e[8]!==t?(p=t?r.filter(_=>t.has(_)).length:r.length,e[7]=r,e[8]=t,e[9]=p):p=e[9];const g=p>=ne;let b;e[10]!==g||e[11]!==f||e[12]!==a?(b=_=>f(_)||g?Promise.resolve():a.apply(C=>C.includes(_)?null:[...C,_]),e[10]=g,e[11]=f,e[12]=a,e[13]=b):b=e[13];const y=b;let N;e[14]!==a?(N=_=>a.apply(C=>C.filter(I=>I!==_)),e[14]=a,e[15]=N):N=e[15];const v=N;let j;e[16]!==a?(j=_=>a.apply(()=>_),e[16]=a,e[17]=j):j=e[17];const x=j;let w;e[18]!==d||e[19]!==g||e[20]!==f||e[21]!==c||e[22]!==a?(w=async(_,C)=>{await d.update.mutateAsync({id:_.id,data:{metadata:C}}),!f(_.id)&&!g&&await a.apply(I=>I.includes(_.id)?null:[...I,_.id]),await c()},e[18]=d,e[19]=g,e[20]=f,e[21]=c,e[22]=a,e[23]=w):w=e[23];const S=w;let T;return e[24]!==y||e[25]!==g||e[26]!==r||e[27]!==f||e[28]!==v||e[29]!==x||e[30]!==S?(T={homeIds:r,isOnHome:f,atLimit:g,addAgent:y,removeAgent:v,reorder:x,saveAgentMetadata:S},e[24]=y,e[25]=g,e[26]=r,e[27]=f,e[28]=v,e[29]=x,e[30]=S,e[31]=T):T=e[31],T}function Is(t){const e=k.c(21),{search:s}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={pageSize:1e3},e[0]=o):o=e[0];const i=pt(o);let r;e[1]!==i?(r=new Set(i.map(Ps)),e[1]=i,e[2]=r):r=e[2];const a=Cs(r);let d,l,m;if(e[3]!==i||e[4]!==a||e[5]!==s){const g=new Map(i.map(As));d=s.trim().toLowerCase();const b=v=>!d||v.title?.toLowerCase().includes(d);l=a.homeIds.map(v=>g.get(v)).filter($s).filter(b);const y=Rt(i);let N;e[9]!==a?(N=v=>!a.isOnHome(v.id),e[9]=a,e[10]=N):N=e[10],m=i.filter(ks).filter(v=>!y.has(v.id)).filter(N).filter(b).sort(Ts),e[3]=i,e[4]=a,e[5]=s,e[6]=d,e[7]=l,e[8]=m}else d=e[6],l=e[7],m=e[8];const c=m;let u;e[11]!==a||e[12]!==l?(u=n.jsx(Ms,{home:a,agents:l}),e[11]=a,e[12]=l,e[13]=u):u=e[13];const f=!!d;let p;e[14]!==c||e[15]!==a||e[16]!==f?(p=n.jsx(Ls,{home:a,agents:c,hasSearch:f}),e[14]=c,e[15]=a,e[16]=f,e[17]=p):p=e[17];let h;return e[18]!==u||e[19]!==p?(h=n.jsxs(n.Fragment,{children:[u,p]}),e[18]=u,e[19]=p,e[20]=h):h=e[20],h}function Ts(t,e){return(t.title??"").localeCompare(e.title??"")}function ks(t){return t.id&&!mt(t.id)}function $s(t){return!!t}function As(t){return[t.id,t]}function Ps(t){return t.id}function Ke(t){const e=k.c(7),{title:s,hint:o}=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 r;e[2]!==o?(r=o&&n.jsx("span",{className:"text-xs text-muted-foreground",children:o}),e[2]=o,e[3]=r):r=e[3];let a;return e[4]!==i||e[5]!==r?(a=n.jsxs("div",{className:"flex items-center justify-between px-1",children:[i,r]}),e[4]=i,e[5]=r,e[6]=a):a=e[6],a}function Ms(t){const e=k.c(14),{home:s,agents:o}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={activationConstraint:{distance:5}},e[0]=i):i=e[0];let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r={coordinateGetter:$t},e[1]=r):r=e[1];const a=Me(oe(ze,i),oe(Ee,r));let d;e[2]!==s?(d=p=>{const{active:h,over:g}=p;if(!g||h.id===g.id)return;const b=s.homeIds,y=b.indexOf(h.id),N=b.indexOf(g.id);y===-1||N===-1||s.reorder(At([...b],y,N)).catch(zs)},e[2]=s,e[3]=d):d=e[3];const l=d,m=`${s.homeIds.length}/${ne}`;let c;e[4]!==m?(c=n.jsx(Ke,{title:"On home",hint:m}),e[4]=m,e[5]=c):c=e[5];let u;e[6]!==o||e[7]!==l||e[8]!==s||e[9]!==a?(u=o.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:a,collisionDetection:_t,onDragEnd:l,children:n.jsx(Ct,{items:o.map(Es),strategy:It,children:n.jsx("div",{className:"flex flex-col gap-1",children:o.map(p=>n.jsx(Ds,{agent:p,home:s},p.id))})})}),e[6]=o,e[7]=l,e[8]=s,e[9]=a,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 Es(t){return t.id}function zs(){return K.error("Couldn't reorder home — please try again.")}function Ls(t){const e=k.c(6),{home:s,agents:o,hasSearch:i}=t,[r,a]=A.useState(20);let d;if(e[0]!==o||e[1]!==i||e[2]!==s||e[3]!==r){const l=o.slice(0,r);let m;e[5]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(Ke,{title:"Add to home"}),e[5]=m):m=e[5],d=n.jsxs("div",{className:"flex flex-col gap-1.5",children:[m,o.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:l.map(c=>n.jsx(Fs,{agent:c,home:s},c.id))}),o.length>r&&n.jsxs("button",{type:"button",onClick:()=>a(Os),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 (",o.length-r,")"]})]})]}),e[0]=o,e[1]=i,e[2]=s,e[3]=r,e[4]=d}else d=e[4];return d}function Os(t){return t+20}function We(t){const e=Z(t.metadata?.ui).filter(r=>!!r.resourceUri).length,s=t.metadata?.ui?.homePrompts,o=Array.isArray(s)?s.length:null,i=[];return e>0&&i.push(`${e} tile${e===1?"":"s"}`),o!==null&&o>0&&i.push(`${o} prompt${o===1?"":"s"}`),o===0&&i.push("prompts off"),i.join(" · ")}function Ds(t){const e=k.c(57),{agent:s,home:o}=t,[i,r]=A.useState(!1);let a;e[0]!==s.id?(a={id:s.id},e[0]=s.id,e[1]=a):a=e[1];const{attributes:d,listeners:l,setNodeRef:m,transform:c,transition:u,isDragging:f}=Tt(a),p=We(s)||"Quick access";let h;e[2]!==c?(h=kt.Transform.toString(c),e[2]=c,e[3]=h):h=e[3];const g=f?.5:void 0,b=f?100:void 0;let y;e[4]!==h||e[5]!==g||e[6]!==b||e[7]!==u?(y={transform:h,transition:u,opacity:g,zIndex:b},e[4]=h,e[5]=g,e[6]=b,e[7]=u,e[8]=y):y=e[8];const N=y,v=f&&"shadow-lg";let j;e[9]!==v?(j=Q("rounded-lg border border-border bg-card",v),e[9]=v,e[10]=j):j=e[10];const x=`Drag to reorder ${s.title??s.id}`;let w;e[11]===Symbol.for("react.memo_cache_sentinel")?(w=n.jsx(Pe,{size:14}),e[11]=w):w=e[11];let S;e[12]!==d||e[13]!==l||e[14]!==x?(S=n.jsx("button",{type:"button",...d,...l,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":x,children:w}),e[12]=d,e[13]=l,e[14]=x,e[15]=S):S=e[15];let T;e[16]===Symbol.for("react.memo_cache_sentinel")?(T=()=>r(Rs),e[16]=T):T=e[16];const _=s.title??s.id;let C;e[17]!==s.icon||e[18]!==_?(C=n.jsx(ce,{icon:s.icon,name:_,size:"sm"}),e[17]=s.icon,e[18]=_,e[19]=C):C=e[19];const I=s.title??s.id;let P;e[20]!==I?(P=n.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:I}),e[20]=I,e[21]=P):P=e[21];let E;e[22]!==p?(E=n.jsx("div",{className:"truncate text-xs text-muted-foreground",children:p}),e[22]=p,e[23]=E):E=e[23];let z;e[24]!==P||e[25]!==E?(z=n.jsxs("div",{className:"min-w-0 flex-1",children:[P,E]}),e[24]=P,e[25]=E,e[26]=z):z=e[26];const H=i&&"rotate-180";let L;e[27]!==H?(L=Q("shrink-0 text-muted-foreground transition-transform",H),e[27]=H,e[28]=L):L=e[28];let D;e[29]!==L?(D=n.jsx(Re,{size:16,className:L}),e[29]=L,e[30]=D):D=e[30];let U;e[31]!==i||e[32]!==C||e[33]!==z||e[34]!==D?(U=n.jsxs("button",{type:"button",onClick:T,className:"flex min-w-0 flex-1 items-center gap-2.5 text-left outline-none","aria-expanded":i,children:[C,z,D]}),e[31]=i,e[32]=C,e[33]=z,e[34]=D,e[35]=U):U=e[35];let $;e[36]!==s.id||e[37]!==o?($=()=>o.removeAgent(s.id).catch(Hs),e[36]=s.id,e[37]=o,e[38]=$):$=e[38];const R=`Remove ${s.title??s.id} from home`;let O;e[39]===Symbol.for("react.memo_cache_sentinel")?(O=n.jsx(ye,{size:14}),e[39]=O):O=e[39];let M;e[40]!==$||e[41]!==R?(M=n.jsx("button",{type:"button",onClick:$,"aria-label":R,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:O}),e[40]=$,e[41]=R,e[42]=M):M=e[42];let F;e[43]!==S||e[44]!==U||e[45]!==M?(F=n.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-2.5",children:[S,U,M]}),e[43]=S,e[44]=U,e[45]=M,e[46]=F):F=e[46];let B;e[47]!==s||e[48]!==i||e[49]!==o?(B=i&&n.jsx(qe,{agent:s,home:o}),e[47]=s,e[48]=i,e[49]=o,e[50]=B):B=e[50];let W;return e[51]!==m||e[52]!==N||e[53]!==F||e[54]!==B||e[55]!==j?(W=n.jsxs("div",{ref:m,style:N,className:j,children:[F,B]}),e[51]=m,e[52]=N,e[53]=F,e[54]=B,e[55]=j,e[56]=W):W=e[56],W}function Hs(){return K.error("Couldn't remove from home — please try again.")}function Rs(t){return!t}function Fs({agent:t,home:e}){const[s,o]=A.useState(!1),[i,r]=A.useState(!1),a=We(t),d=async()=>{if(!e.atLimit){r(!0);try{await e.addAgent(t.id)}catch{K.error("Couldn't add to home — please try again.")}finally{r(!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:()=>o(l=>!l),className:"flex min-w-0 flex-1 items-center gap-3 text-left outline-none","aria-expanded":s,children:[n.jsx(ce,{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}),a&&n.jsx("div",{className:"truncate text-xs text-muted-foreground",children:a})]}),n.jsx(Re,{size:16,className:Q("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(le,{size:12,className:"animate-spin"}):n.jsx(be,{size:14})})]}),s&&n.jsx(qe,{agent:t,home:e})]})}function qe(t){const e=k.c(17),{agent:s,home:o}=t,i=s.metadata?.ui;let r;e[0]!==i?(r=Z(i),e[0]=i,e[1]=r):r=e[1];const a=r;let d;e[2]!==s.connections?(d=(s.connections??[]).map(Us).sort(),e[2]=s.connections,e[3]=d):d=e[3];const l=d,m=s.metadata?.ui?.homePrompts;let c;e[4]!==s||e[5]!==l||e[6]!==o||e[7]!==a?(c=n.jsx(Vs,{agent:s,home:o,connectionIds:l,pinnedTiles:a}),e[4]=s,e[5]=l,e[6]=o,e[7]=a,e[8]=c):c=e[8];let u;e[9]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(Bs,{}),e[9]=u):u=e[9];const f=m??null;let p;e[10]!==s||e[11]!==o||e[12]!==f?(p=n.jsx(A.Suspense,{fallback:u,children:n.jsx(Qs,{agent:s,home:o,curated:f})}),e[10]=s,e[11]=o,e[12]=f,e[13]=p):p=e[13];let h;return e[14]!==c||e[15]!==p?(h=n.jsxs("div",{className:"border-t border-border px-3 py-2 flex flex-col gap-3",children:[c,p]}),e[14]=c,e[15]=p,e[16]=h):h=e[16],h}function Us(t){return t.connection_id}function Bs(){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(V,{className:"h-8 w-full"}),n.jsx(V,{className:"h-8 w-2/3"})]}),t[0]=e):e=t[0],e}function Vs({agent:t,home:e,connectionIds:s,pinnedTiles:o}){const i=Be(),{data:r,isLoading:a}=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}),p=(f?.tools??[]).flatMap(h=>{const g=Fe(h._meta);return g?[{name:h.name,description:h.description,resourceUri:g,inputSchema:h.inputSchema}]:[]});return{id:u,title:f?.title??u,icon:f?.icon??null,uiTools:p}}catch{return{id:u,title:u,icon:null,uiTools:[]}}}))).filter(u=>u.uiTools.length>0)});if(s.length===0)return null;if(a)return n.jsxs("div",{className:"flex flex-col gap-1 py-0.5",children:[n.jsx(V,{className:"h-7 w-full"}),n.jsx(V,{className:"h-7 w-2/3"})]});if(!r||r.length===0)return null;const d=new Map;for(const c of r)for(const u of c.uiTools)d.set(`${c.id}:${u.name}`,{conn:c,tool:u});const l=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=o.some(c=>!!l(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"}),o.map(c=>{const u=l(c);return u?n.jsx(qs,{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"}),r.map(c=>c.uiTools.map(u=>n.jsx(Gs,{agent:t,home:e,connection:c,tool:u},`add:${c.id}:${u.name}`)))]})]})}function Ge(t,e){const s={};for(const[o,i]of Object.entries(t)){const r=e[o]?.type;if((r==="object"||r==="array")&&typeof i=="string"){if(!i.trim())continue;try{s[o]=JSON.parse(i)}catch{return null}}else if((r==="number"||r==="integer")&&typeof i=="string"){if(!i.trim())continue;s[o]=Number(i)}else i!==""&&i!=null&&(s[o]=i)}return s}function Ks(t,e){if(!t||!e)return{};const s={};for(const[o,i]of Object.entries(t)){const r=e[o]?.type;(r==="object"||r==="array")&&i!=null&&typeof i!="string"?s[o]=JSON.stringify(i,null,2):s[o]=i}return s}function Ws(t){if(!t)return"";const e=Object.entries(t).filter(([,s])=>s!=null&&s!=="");return e.length===0?"":e.slice(0,3).map(([s,o])=>{const i=typeof o=="object"?JSON.stringify(o):String(o);return`${s}=${i.length>20?`${i.slice(0,20)}…`:i}`}).join(", ")}function qs({agent:t,home:e,connection:s,tool:o,tile:i}){const[r,a]=A.useState(!1),[d,l]=A.useState(!1),m=o.inputSchema?.properties&&Object.keys(o.inputSchema.properties).length>0,[c,u]=A.useState(()=>Ks(i.toolInput,o.inputSchema?.properties)),f=async()=>{a(!0);try{const g=Z(t.metadata?.ui),b=i.tileId?g.filter(N=>N.tileId!==i.tileId):g.filter(N=>N!==i),y={...t.metadata??{},ui:{...t.metadata?.ui??{},homeTile:null,homeTiles:b}};await e.saveAgentMetadata(t,y),l(!1)}catch(g){console.error("[home-tiles] failed to remove tile",g),K.error("Couldn't update home — please try again.")}finally{a(!1)}},p=async()=>{a(!0);try{let g;if(m&&o.inputSchema?.properties){const v=Ge(c,o.inputSchema.properties);if(!v){K.error("Invalid JSON in one of the fields — please fix it."),a(!1);return}Object.keys(v).length>0&&(g=v)}const y=Z(t.metadata?.ui).map(v=>(i.tileId?v.tileId===i.tileId:v===i)?{...v,toolInput:g}:v),N={...t.metadata??{},ui:{...t.metadata?.ui??{},homeTile:null,homeTiles:y}};await e.saveAgentMetadata(t,N),l(!1)}catch(g){console.error("[home-tiles] failed to save tile",g),K.error("Couldn't update home — please try again.")}finally{a(!1)}},h=Ws(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(Ue,{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:ve(o.name)}),h&&n.jsx("div",{className:"truncate text-[10px] text-muted-foreground font-mono",children:h})]}),m&&n.jsx("button",{type:"button",onClick:()=>l(g=>!g),"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(jt,{size:14})}),n.jsx(Ne,{isPinned:!0,submitting:r,onClick:f,label:"Remove from home"})]}),d&&m&&o.inputSchema?.properties&&n.jsxs("div",{className:"px-3 pb-2 pt-1 flex flex-col gap-2",children:[n.jsx(Ve,{properties:o.inputSchema.properties,required:o.inputSchema.required,values:c,onChange:(g,b)=>u(y=>({...y,[g]:b}))}),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:()=>l(!1),children:"Cancel"}),n.jsx(Y,{size:"sm",className:"h-7 text-xs",disabled:r,onClick:p,children:r?n.jsx(le,{size:12,className:"animate-spin"}):"Save"})]})]})]})}function Gs({agent:t,home:e,connection:s,tool:o}){const[i,r]=A.useState(!1),[a,d]=A.useState(!1),l=o.inputSchema?.properties&&Object.keys(o.inputSchema.properties).length>0,[m,c]=A.useState({}),u=async()=>{if(l&&!a){d(!0);return}if(!e.isOnHome(t.id)&&e.atLimit){K.error(`Home is full (${ne}) — remove an agent first`);return}await f()},f=async()=>{r(!0);try{let p;if(l&&o.inputSchema?.properties){const y=Ge(m,o.inputSchema.properties);if(!y){K.error("Invalid JSON in one of the fields — please fix it."),r(!1);return}Object.keys(y).length>0&&(p=y)}const g=[...Z(t.metadata?.ui),{tileId:crypto.randomUUID(),connectionId:s.id,resourceUri:o.resourceUri,toolName:o.name,...p?{toolInput:p}:{}}],b={...t.metadata??{},ui:{...t.metadata?.ui??{},homeTile:null,homeTiles:g}};await e.saveAgentMetadata(t,b),d(!1),c({})}catch(p){console.error("[home-tiles] failed to add tile",p),K.error("Couldn't update home — please try again.")}finally{r(!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(Ue,{icon:s.icon,name:s.title,size:"xs"}),n.jsx("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:ve(o.name)}),n.jsx(Ne,{isPinned:!1,submitting:i,onClick:u,label:"Add to home"})]}),a&&l&&o.inputSchema?.properties&&n.jsxs("div",{className:"px-3 pb-2 pt-1 flex flex-col gap-2",children:[n.jsx(Ve,{properties:o.inputSchema.properties,required:o.inputSchema.required,values:m,onChange:(p,h)=>c(g=>({...g,[p]:h}))}),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(le,{size:12,className:"animate-spin"}):"Pin"})]})]})]})}function Ne(t){const e=k.c(11),{isPinned:s,submitting:o,onClick:i,label:r}=t,a=s?"text-muted-foreground hover:bg-destructive/10 hover:text-destructive":"bg-foreground text-background hover:opacity-90";let d;e[0]!==a?(d=Q("inline-flex size-7 shrink-0 items-center justify-center rounded-md text-xs transition-colors disabled:opacity-50 disabled:cursor-progress",a),e[0]=a,e[1]=d):d=e[1];let l;e[2]!==s||e[3]!==o?(l=o?n.jsx(le,{size:12,className:"animate-spin"}):s?n.jsx(vt,{size:14}):n.jsx(be,{size:14}),e[2]=s,e[3]=o,e[4]=l):l=e[4];let m;return e[5]!==r||e[6]!==i||e[7]!==o||e[8]!==d||e[9]!==l?(m=n.jsx("button",{type:"button",onClick:i,disabled:o,"aria-label":r,title:r,className:d,children:l}),e[5]=r,e[6]=i,e[7]=o,e[8]=d,e[9]=l,e[10]=m):m=e[10],m}function Qs(t){const e=k.c(32),{agent:s,home:o,curated:i}=t,{org:r}=J();let a;e[0]!==s.id||e[1]!==r.id||e[2]!==r.slug?(a={connectionId:s.id,orgId:r.id,orgSlug:r.slug},e[0]=s.id,e[1]=r.id,e[2]=r.slug,e[3]=a):a=e[3];const d=ae(a);let l;e[4]!==s.id||e[5]!==r.id?(l=te.agentPrompts(r.id,s.id),e[4]=s.id,e[5]=r.id,e[6]=l):l=e[6];let m;e[7]!==d?(m=async()=>{const{prompts:x}=await d.listPrompts();return x.map(Ys)},e[7]=d,e[8]=m):m=e[8];let c;e[9]!==l||e[10]!==m?(c={queryKey:l,queryFn:m,staleTime:3e4,retry:!1},e[9]=l,e[10]=m,e[11]=c):c=e[11];const{data:u,isLoading:f,error:p}=se(c),h=je(r.slug);let g,b;if(e[12]!==s.id||e[13]!==u||e[14]!==h.prompts){let x;e[17]!==s.id?(x=S=>S.agentId===s.id&&S.promptName,e[17]=s.id,e[18]=x):x=e[18],g=h.prompts.filter(x).map(Zs);let w;e[19]!==u?(w=u??[],e[19]=u,e[20]=w):w=e[20],b=[...w];for(const S of g)b.some(T=>T.name===S.name)||b.push(S);e[12]=s.id,e[13]=u,e[14]=h.prompts,e[15]=g,e[16]=b}else g=e[15],b=e[16];if(f&&g.length===0){let x;return e[21]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx(V,{className:"h-7 w-full"}),n.jsx(V,{className:"h-7 w-2/3"})]}),e[21]=x):x=e[21],x}if(p&&g.length===0)return console.error("[home-tiles] listPrompts failed for agent",s.id,p),null;if(b.length===0)return null;let y;e[22]!==i||e[23]!==b?(y=i??b.map(Xs),e[22]=i,e[23]=b,e[24]=y):y=e[24];let N;e[25]!==y?(N=new Set(y),e[25]=y,e[26]=N):N=e[26];const v=N;let j;return e[27]!==s||e[28]!==o||e[29]!==b||e[30]!==v?(j=n.jsx("div",{className:"flex flex-col gap-0.5",children:b.map(x=>n.jsx(en,{agent:s,home:o,prompt:x,allPromptNames:b.map(Js),isPinned:v.has(x.name)},x.name))}),e[27]=s,e[28]=o,e[29]=b,e[30]=v,e[31]=j):j=e[31],j}function Js(t){return t.name}function Xs(t){return t.name}function Zs(t){return{name:t.promptName,title:t.title,description:t.description}}function Ys(t){return{name:t.name,title:t.title,description:t.description}}function en({agent:t,home:e,prompt:s,allPromptNames:o,isPinned:i}){const[r,a]=A.useState(!1),d=async()=>{if(!i&&!e.isOnHome(t.id)&&e.atLimit){K.error(`Home is full (${ne}) — remove an agent first`);return}a(!0);try{const l=t.metadata?.ui?.homePrompts;let m;Array.isArray(l)?m=i?l.filter(u=>u!==s.name):[...l,s.name]:m=i?o.filter(u=>u!==s.name):o;const c={...t.metadata??{},ui:{...t.metadata?.ui??{},homePrompts:m}};await e.saveAgentMetadata(t,c)}catch(l){console.error("[home-tiles] failed to toggle prompt",l),K.error("Couldn't update home — please try again.")}finally{a(!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??ve(s.name)}),n.jsx(Ne,{isPinned:i,submitting:r,onClick:d,label:i?"Remove from home":"Add to home"})]})}function tn(){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},sn)}),t[0]=e):e=t[0],e}function sn(t,e){return n.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-border p-2.5",children:[n.jsx(V,{className:"size-8 rounded-md"}),n.jsxs("div",{className:"flex-1 space-y-1.5",children:[n.jsx(V,{className:"h-3 w-1/2"}),n.jsx(V,{className:"h-2.5 w-1/3"})]})]},e)}const ee=1,Qe=`home-board.layout.v${ee}`;function Je(t){return`home-board.layout.v${ee}.${t}`}const Xe={version:ee,tiles:{},hidden:[]};function fe(t){return!t||t.version!==ee?Xe:{version:ee,tiles:t.tiles??{},hidden:Array.isArray(t.hidden)?t.hidden:[]}}function nn(t){return Object.keys(t.tiles).length>0||t.hidden.length>0}function on(t){try{const e=localStorage.getItem(Je(t));return e?fe(JSON.parse(e)):void 0}catch{return}}function Ce(t,e){try{localStorage.setItem(Je(t),JSON.stringify(e))}catch{}}async function Ie(t,e){if(!(await fetch(`/api/${t}/kv/${Qe}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok)throw new Error("Failed to save board layout")}function rn(t){const e=k.c(24),s=xe();let o;e[0]!==t?(o=te.boardLayout(t),e[0]=t,e[1]=o):o=e[1];const i=o;let r;e[2]!==t?(r=on(t),e[2]=t,e[3]=r):r=e[3];const a=r;let d;e[4]!==a||e[5]!==t?(d=async()=>{const y=await fetch(`/api/${t}/kv/${Qe}`);if(y.status===404)return a&&nn(a)?(await Ie(t,a),a):Xe;if(!y.ok)throw new Error("Failed to load board layout");const N=await y.json(),v=fe(N.value);return Ce(t,v),v},e[4]=a,e[5]=t,e[6]=d):d=e[6];let l;e[7]!==a||e[8]!==i||e[9]!==d?(l={queryKey:i,queryFn:d,initialData:a,staleTime:0,refetchOnWindowFocus:!1},e[7]=a,e[8]=i,e[9]=d,e[10]=l):l=e[10];const{data:m,isLoading:c}=se(l);let u;e[11]!==t?(u={mutationFn:y=>Ie(t,y)},e[11]=t,e[12]=u):u=e[12];const f=nt(u);let p;e[13]!==f||e[14]!==t||e[15]!==s||e[16]!==i?(p=y=>{Ce(t,y),s.setQueryData(i,y),f.mutate(y)},e[13]=f,e[14]=t,e[15]=s,e[16]=i,e[17]=p):p=e[17];const h=p;let g;e[18]!==m?(g=fe(m),e[18]=m,e[19]=g):g=e[19];let b;return e[20]!==c||e[21]!==h||e[22]!==g?(b={layout:g,isLoading:c,save:h},e[20]=c,e[21]=h,e[22]=g,e[23]=b):b=e[23],b}const Ze=A.createContext(null);function ln(t){const e=k.c(24),{children:s}=t,{org:o}=J(),i=rn(o.slug),[r,a]=A.useState(!1),[d,l]=A.useState(null);let m;e[0]!==i.layout?(m=()=>{l(i.layout),a(!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=()=>{l(null),a(!1)},e[2]=u):u=e[2];const f=u;let p;e[3]!==d||e[4]!==i?(p=()=>{d&&i.save(d),l(null),a(!1)},e[3]=d,e[4]=i,e[5]=p):p=e[5];const h=p,g=r&&d!==null,b=g?d:i.layout;let y;e[6]!==d||e[7]!==g||e[8]!==i.layout?(y=g?JSON.stringify(d)!==JSON.stringify(i.layout):!1,e[6]=d,e[7]=g,e[8]=i.layout,e[9]=y):y=e[9];const N=y;let v;e[10]!==r||e[11]!==i?(v=S=>{r?l(S):i.save(S)},e[10]=r,e[11]=i,e[12]=v):v=e[12];const j=v;let x;e[13]!==j||e[14]!==c||e[15]!==N||e[16]!==r||e[17]!==b||e[18]!==h||e[19]!==i.isLoading?(x={isEditMode:r,enter:c,cancel:f,save:h,hasChanges:N,layout:b,isLayoutLoading:i.isLoading,commitLayout:j},e[13]=j,e[14]=c,e[15]=N,e[16]=r,e[17]=b,e[18]=h,e[19]=i.isLoading,e[20]=x):x=e[20];let w;return e[21]!==s||e[22]!==x?(w=n.jsx(Ze.Provider,{value:x,children:s}),e[21]=s,e[22]=x,e[23]=w):w=e[23],w}function Ye(){const t=A.useContext(Ze);if(!t)throw new Error("useHomeEdit must be used within a HomeEditProvider");return t}function an({agentId:t}){const{org:e,locator:s}=J(),o=ae({connectionId:t,orgId:e.id,orgSlug:e.slug}),{create:i}=us(),{setTaskId:r}=Kt(),[a,d]=A.useState(null),[l,m]=A.useState(!1),c=A.useRef(!1),u=async(b,y)=>{if(!o){K.error("MCP client not available");return}if(!c.current){c.current=!0,m(!0);try{const N=await ms(o,b.name,y),v={type:"doc",content:[{type:"paragraph",content:[Qt({id:b.name,name:Jt(b.name,Xt(b._meta)),metadata:N.messages,char:"/",kind:"prompt",args:y}),{type:"text",text:" "}]}]},j=crypto.randomUUID();fs(sessionStorage,s,j,{tiptapDoc:v}),await i({id:j,virtual_mcp_id:t}),r(j,t,{autosend:!0})}catch(N){console.error("[start-thread-from-prompt] failed",N),K.error("Failed to start thread. Please try again.")}finally{c.current=!1,m(!1)}}},f=async b=>{if(!c.current){if(b.arguments&&b.arguments.length>0){d(b);return}await u(b)}},p=async b=>{if(!a)return;const y=a;d(null),await u(y,b)};return{start:f,startBlank:async b=>{if(!c.current){c.current=!0,m(!0);try{const y=crypto.randomUUID();await i({id:y,virtual_mcp_id:t}),r(y,t,b?.main?{main:b.main}:void 0)}catch(y){console.error("[start-thread-from-prompt] startBlank failed",y),K.error("Failed to start thread. Please try again.")}finally{c.current=!1,m(!1)}}},dialog:n.jsx(Gt,{prompt:a,setPrompt:b=>d(b),onSubmit:p}),dialogPrompt:a,starting:l}}const q=4,G=100,Te=12,cn=5,dn={w:2,h:2};class pe extends A.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(it,{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 mn(t){const e=k.c(72),{tiles:s,isEditMode:o,renderTile:i,onMove:r,onResize:a,onRemove:d}=t,l=ge(),m=A.useRef(null),[c,u]=A.useState(null),[f,p]=A.useState(null);let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h={activationConstraint:{distance:4}},e[0]=h):h=e[0];const g=Me(oe(ze,h),oe(Ee)),b=s.reduce(un,0),y=o?Math.max(b+2,4):Math.max(b,1);let N;e[1]===Symbol.for("react.memo_cache_sentinel")?(N=()=>{const $=m.current?.getBoundingClientRect();return $?{cellWidth:$.width/q,cellHeight:G}:null},e[1]=N):N=e[1];const v=N;let j;e[2]===Symbol.for("react.memo_cache_sentinel")?(j=$=>{u(String($.active.id)),p(v())},e[2]=j):j=e[2];const x=j;let w;e[3]!==f||e[4]!==r||e[5]!==s?(w=$=>{const R=String($.active.id),O=f??v();if(u(null),p(null),!O||O.cellWidth<=0)return;const M=s.find(W=>W.id===R);if(!M)return;const F=Math.round($.delta.x/O.cellWidth),B=Math.round($.delta.y/O.cellHeight);F===0&&B===0||r(R,{x:M.x+F,y:M.y+B})},e[3]=f,e[4]=r,e[5]=s,e[6]=w):w=e[6];const S=w;if(l){let $;if(e[7]!==i||e[8]!==s){let O;e[10]!==i?(O=M=>n.jsx("div",{className:"group bg-card card-shadow rounded-2xl overflow-hidden",style:{minHeight:G},children:n.jsx(pe,{children:i(M)})},M.id),e[10]=i,e[11]=O):O=e[11],$=s.map(O),e[7]=i,e[8]=s,e[9]=$}else $=e[9];let R;return e[12]!==$?(R=n.jsx("div",{className:"flex flex-col gap-3 px-4 pb-8",children:$}),e[12]=$,e[13]=R):R=e[13],R}let T,_,C,I,P,E,z,H,L;if(e[14]!==c||e[15]!==f||e[16]!==o||e[17]!==S||e[18]!==d||e[19]!==a||e[20]!==i||e[21]!==g||e[22]!==s||e[23]!==y){const $=c?s.find(X=>X.id===c):null;_=Le,H=g,L=x,C=S;const R=y*G,O=o?G*4:G;let M;e[33]!==R||e[34]!==O?(M={height:R,minHeight:O},e[33]=R,e[34]=O,e[35]=M):M=e[35];let F;e[36]!==o||e[37]!==s||e[38]!==y?(F=o&&n.jsx(fn,{rows:y,tiles:s}),e[36]=o,e[37]=s,e[38]=y,e[39]=F):F=e[39];let B;if(e[40]!==c||e[41]!==o||e[42]!==d||e[43]!==a||e[44]!==i||e[45]!==s){let X;e[47]!==c||e[48]!==o||e[49]!==d||e[50]!==a||e[51]!==i?(X=ie=>n.jsx(hn,{tile:ie,isEditMode:o,isDragging:c===ie.id,onResize:a,onRemove:d,children:i(ie)},ie.id),e[47]=c,e[48]=o,e[49]=d,e[50]=a,e[51]=i,e[52]=X):X=e[52],B=s.map(X),e[40]=c,e[41]=o,e[42]=d,e[43]=a,e[44]=i,e[45]=s,e[46]=B}else B=e[46];e[53]!==M||e[54]!==F||e[55]!==B?(I=n.jsxs("div",{ref:m,className:"relative w-full",style:M,children:[F,B]}),e[53]=M,e[54]=F,e[55]=B,e[56]=I):I=e[56],T=Pt,P=null;const W=$&&f?$.w*f.cellWidth-Te:void 0,de=$&&f?$.h*f.cellHeight-Te:void 0;e[57]!==W||e[58]!==de?(E={width:W,height:de},e[57]=W,e[58]=de,e[59]=E):E=e[59],z=$&&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(pe,{children:i($)})}),e[14]=c,e[15]=f,e[16]=o,e[17]=S,e[18]=d,e[19]=a,e[20]=i,e[21]=g,e[22]=s,e[23]=y,e[24]=T,e[25]=_,e[26]=C,e[27]=I,e[28]=P,e[29]=E,e[30]=z,e[31]=H,e[32]=L}else T=e[24],_=e[25],C=e[26],I=e[27],P=e[28],E=e[29],z=e[30],H=e[31],L=e[32];let D;e[60]!==T||e[61]!==P||e[62]!==E||e[63]!==z?(D=n.jsx(T,{dropAnimation:P,style:E,children:z}),e[60]=T,e[61]=P,e[62]=E,e[63]=z,e[64]=D):D=e[64];let U;return e[65]!==_||e[66]!==C||e[67]!==I||e[68]!==D||e[69]!==H||e[70]!==L?(U=n.jsxs(_,{sensors:H,onDragStart:L,onDragEnd:C,children:[I,D]}),e[65]=_,e[66]=C,e[67]=I,e[68]=D,e[69]=H,e[70]=L,e[71]=U):U=e[71],U}function un(t,e){return Math.max(t,e.y+e.h)}function fn(t){const e=k.c(7),{rows:s,tiles:o}=t;let i;e[0]!==o?(i=(l,m)=>o.some(c=>l>=c.x&&l<c.x+c.w&&m>=c.y&&m<c.y+c.h),e[0]=o,e[1]=i):i=e[1];const r=i;let a;if(e[2]!==r||e[3]!==s){a=[];for(let l=0;l<s;l++)for(let m=0;m<q;m++)r(m,l)||a.push({x:m,y:l});e[2]=r,e[3]=s,e[4]=a}else a=e[4];let d;return e[5]!==a?(d=n.jsx("div",{className:"absolute inset-0 pointer-events-none",children:a.map(pn)}),e[5]=a,e[6]=d):d=e[6],d}function pn(t){return n.jsx("div",{className:"absolute p-1",style:{left:`${t.x/q*100}%`,top:t.y*G,width:`${1/q*100}%`,height:G},children:n.jsx("div",{className:"h-full w-full rounded-2xl border border-dashed border-border/60"})},`${t.x}-${t.y}`)}function hn(t){const e=k.c(31),{tile:s,isEditMode:o,isDragging:i,onResize:r,onRemove:a,children:d}=t,l=!o;let m;e[0]!==l||e[1]!==s.id?(m={id:s.id,disabled:l},e[0]=l,e[1]=s.id,e[2]=m):m=e[2];const{setNodeRef:c,attributes:u,listeners:f,isDragging:p}=Mt(m),h=`${s.x/q*100}%`,g=`${s.w/q*100}%`,b=s.y*G,y=s.h*G,N=p||i,v=!N&&"transition-[left,top,width,height,opacity] duration-200 ease-out",j=N&&"opacity-30";let x;e[3]!==v||e[4]!==j?(x=Q("absolute p-1 will-change-[left,top,width,height,opacity]",v,j),e[3]=v,e[4]=j,e[5]=x):x=e[5];let w;e[6]!==y||e[7]!==h||e[8]!==b||e[9]!==g?(w={left:h,top:b,width:g,height:y},e[6]=y,e[7]=h,e[8]=b,e[9]=g,e[10]=w):w=e[10];const S=o&&"outline outline-1 outline-transparent hover:outline-primary/40";let T;e[11]!==S?(T=Q("group relative h-full bg-card card-shadow rounded-2xl overflow-hidden",S),e[11]=S,e[12]=T):T=e[12];let _;e[13]!==u||e[14]!==o||e[15]!==f||e[16]!==a||e[17]!==r||e[18]!==s?(_=o&&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(Pe,{size:16})}),n.jsx("div",{className:"absolute top-2 right-2 z-10 flex items-center gap-1",children:n.jsx(xn,{tile:s,onResize:r,onRemove:a})})]}),e[13]=u,e[14]=o,e[15]=f,e[16]=a,e[17]=r,e[18]=s,e[19]=_):_=e[19];let C;e[20]!==d?(C=n.jsx("div",{className:"h-full overflow-hidden",children:n.jsx(pe,{children:d})}),e[20]=d,e[21]=C):C=e[21];let I;e[22]!==C||e[23]!==T||e[24]!==_?(I=n.jsxs("div",{className:T,children:[_,C]}),e[22]=C,e[23]=T,e[24]=_,e[25]=I):I=e[25];let P;return e[26]!==c||e[27]!==I||e[28]!==x||e[29]!==w?(P=n.jsx("div",{ref:c,className:x,style:w,children:I}),e[26]=c,e[27]=I,e[28]=x,e[29]=w,e[30]=P):P=e[30],P}function xn(t){const e=k.c(20),{tile:s,onResize:o,onRemove:i}=t,[r,a]=A.useState(!1);let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(ps,{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(Nt,{size:16})})}),e[0]=d):d=e[0];let l;e[1]!==o||e[2]!==s.id?(l=b=>{o(s.id,b),a(!1)},e[1]=o,e[2]=s.id,e[3]=l):l=e[3];let m;e[4]!==l||e[5]!==s?(m=n.jsx(gn,{tile:s,onPick:l}),e[4]=l,e[5]=s,e[6]=m):m=e[6];let c;e[7]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(hs,{}),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(ys,{size:14,className:"mr-2"}),e[11]=f):f=e[11];let p;e[12]!==u?(p=n.jsxs(xs,{onSelect:u,className:"text-destructive focus:text-destructive",children:[f,"Remove tile"]}),e[12]=u,e[13]=p):p=e[13];let h;e[14]!==m||e[15]!==p?(h=n.jsxs(gs,{align:"end",className:"w-auto",children:[m,c,p]}),e[14]=m,e[15]=p,e[16]=h):h=e[16];let g;return e[17]!==r||e[18]!==h?(g=n.jsxs(bs,{open:r,onOpenChange:a,children:[d,h]}),e[17]=r,e[18]=h,e[19]=g):g=e[19],g}function gn(t){const e=k.c(19),{tile:s,onPick:o}=t,i=s.minW??1,r=s.minH??1,[a,d]=A.useState(null);let l;e[0]!==a||e[1]!==s.h||e[2]!==s.w?(l=a??{w:s.w,h:s.h},e[0]=a,e[1]=s.h,e[2]=s.w,e[3]=l):l=e[3];const m=l;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,p;e[8]===Symbol.for("react.memo_cache_sentinel")?(f={gridTemplateColumns:`repeat(${q}, 1.25rem)`},p=()=>d(null),e[8]=f,e[9]=p):(f=e[8],p=e[9]);let h;e[10]!==m.h||e[11]!==m.w||e[12]!==r||e[13]!==i||e[14]!==o?(h=n.jsx("div",{className:"grid w-max gap-1",style:f,onPointerLeave:p,children:Array.from({length:cn},(b,y)=>Array.from({length:q},(N,v)=>{const j=v+1,x=y+1,w=j<i||x<r,S=j<=m.w&&x<=m.h;return n.jsx("button",{type:"button",disabled:w,"aria-label":`${j} by ${x}`,onPointerEnter:()=>d({w:j,h:x}),onClick:()=>o({w:j,h:x}),className:Q("size-5 rounded-sm border transition-colors",S?"border-primary bg-primary/30":"border-border bg-muted",w?"cursor-not-allowed opacity-40":"cursor-pointer hover:border-primary/60")},`${j}x${x}`)}))}),e[10]=m.h,e[11]=m.w,e[12]=r,e[13]=i,e[14]=o,e[15]=h):h=e[15];let g;return e[16]!==u||e[17]!==h?(g=n.jsxs("div",{className:"px-2 py-1.5",children:[u,h]}),e[16]=u,e[17]=h,e[18]=g):g=e[18],g}function bn(t,e,s){return t.some(o=>e>=o.x&&e<o.x+o.w&&s>=o.y&&s<o.y+o.h)}function he(t,e,s){for(let o=0;o<100;o++)for(let i=0;i<=q-e;i++){let r=!0;for(let a=0;a<s&&r;a++)for(let d=0;d<e&&r;d++)bn(t,i+d,o+a)&&(r=!1);if(r)return{x:i,y:o}}return{x:0,y:0}}function me(t,e,s={w:1,h:1}){const o=Math.max(s.w,Math.min(q,t)),i=Math.max(s.h,Math.min(6,e));return{w:o,h:i}}function ue(t,e,s){const o=Math.max(0,Math.min(q-s,t)),i=Math.max(0,e);return{x:o,y:i}}function yn(t,e,s){const o=t.find(l=>l.id===e);if(!o)return t;const i=t.filter(l=>l.id!==e),r=i.find(l=>s.x>=l.x&&s.x<l.x+l.w&&s.y>=l.y&&s.y<l.y+l.h);if(r&&r.w===o.w&&r.h===o.h)return t.map(l=>l.id===e?{...l,x:r.x,y:r.y}:l.id===r.id?{...l,x:o.x,y:o.y}:l);const d=[{...o,x:s.x,y:s.y}];for(const l of i){const m=he(d,l.w,l.h);d.push({...l,x:m.x,y:m.y})}return d}function jn(t){const e=k.c(35),{layout:s,isLayoutLoading:o,commitLayout:i}=Ye();let r;e[0]!==s.hidden?(r=new Set(s.hidden),e[0]=s.hidden,e[1]=r):r=e[1];const a=r;let d,l;if(e[2]!==t||e[3]!==a||e[4]!==s.tiles){l=[];let N;e[7]!==a?(N=j=>j.pinned||!a.has(j.id),e[7]=a,e[8]=N):N=e[8];const v=t.filter(N);d=new Map;for(const j of t)j.minSize&&d.set(j.id,j.minSize);for(const j of v){const x=s.tiles[j.id];if(!x)continue;const w=d.get(j.id),{w:S,h:T}=me(x.w,x.h,w),{x:_,y:C}=ue(x.x,x.y,S);l.push({id:j.id,x:_,y:C,w:S,h:T,minW:w?.w,minH:w?.h})}for(const j of v){if(l.some(C=>C.id===j.id))continue;const x=j.defaultSize??dn,w=d.get(j.id),{w:S,h:T}=me(x.w,x.h,w),_=he(l,S,T);l.push({id:j.id,x:_.x,y:_.y,w:S,h:T,minW:w?.w,minH:w?.h})}e[2]=t,e[3]=a,e[4]=s.tiles,e[5]=d,e[6]=l}else d=e[5],l=e[6];let m;e[9]!==t?(m=new Set(t.map(vn)),e[9]=t,e[10]=m):m=e[10];const c=m;let u;e[11]!==c||e[12]!==i?(u=(N,v)=>{const j={};for(const x of N)j[x.id]={x:x.x,y:x.y,w:x.w,h:x.h};i({version:ee,tiles:j,hidden:v.filter(x=>c.has(x))})},e[11]=c,e[12]=i,e[13]=u):u=e[13];const f=u;let p;e[14]!==l?(p={visible:l},e[14]=l,e[15]=p):p=e[15];let h;e[16]!==f||e[17]!==s||e[18]!==l?(h=(N,v)=>{const j=l.find(S=>S.id===N);if(!j)return;const x=ue(v.x,v.y,j.w);if(x.x===j.x&&x.y===j.y)return;const w=yn(l,N,x);f(w,s.hidden)},e[16]=f,e[17]=s,e[18]=l,e[19]=h):h=e[19];let g;e[20]!==f||e[21]!==s||e[22]!==d||e[23]!==l?(g=(N,v)=>{const j=l.find(I=>I.id===N);if(!j)return;const x=d.get(N),{w,h:S}=me(v.w,v.h,x);if(w===j.w&&S===j.h)return;const T={...j,w,h:S,x:ue(j.x,j.y,w).x},_=l.filter(I=>I.id!==N),C=[T];for(const I of _){const P=he(C,I.w,I.h);C.push({...I,x:P.x,y:P.y})}f(C,s.hidden)},e[20]=f,e[21]=s,e[22]=d,e[23]=l,e[24]=g):g=e[24];let b;e[25]!==f||e[26]!==s||e[27]!==l?(b=N=>{const v=l.filter(j=>j.id!==N);f(v,Array.from(new Set([...s.hidden,N])))},e[25]=f,e[26]=s,e[27]=l,e[28]=b):b=e[28];let y;return e[29]!==o||e[30]!==p||e[31]!==h||e[32]!==g||e[33]!==b?(y={snapshot:p,isLoading:o,moveTile:h,resizeTile:g,hideTile:b},e[29]=o,e[30]=p,e[31]=h,e[32]=g,e[33]=b,e[34]=y):y=e[34],y}function vn(t){return t.id}const Nn={w:2,h:4},wn={w:1,h:2},Sn={w:1,h:1};function _n(t){return`prompt:${t.agentId}:${t.promptName||"blank"}`}function Cn(t){return t.tileId?`tile:${t.tileId}`:`tile:${t.agentId}:${t.resourceUri}`}function In(t){return t.promptName?t.agentName:t.description}function Tn(t){return{name:t.promptName,title:t.title,description:t.description,arguments:t.arguments,_meta:t._meta}}function et(t){const e=k.c(14),{org:s}=J();let o;e[0]!==s.id||e[1]!==s.slug||e[2]!==t.connectionId?(o=dt({connectionId:t.connectionId,orgId:s.id,orgSlug:s.slug}),e[0]=s.id,e[1]=s.slug,e[2]=t.connectionId,e[3]=o):o=e[3];const{data:i}=se(o),r=!!i&&!t.toolName;let a;e[4]!==i||e[5]!==r?(a={client:i,enabled:r},e[4]=i,e[5]=r,e[6]=a):a=e[6];const{data:d}=cs(a);let l;e[7]!==t.resourceUri||e[8]!==t.toolName||e[9]!==d?.tools?(l=t.toolName??d?.tools.find(u=>Fe(u._meta)===t.resourceUri)?.name,e[7]=t.resourceUri,e[8]=t.toolName,e[9]=d?.tools,e[10]=l):l=e[10];const m=l;let c;return e[11]!==t.connectionId||e[12]!==m?(c=m?Lt(t.connectionId,m):void 0,e[11]=t.connectionId,e[12]=m,e[13]=c):c=e[13],c}function we(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:o,startBlank:i,dialog:r,starting:a}=an(s);let d;e[2]!==o||e[3]!==i?(d=c=>{if(!c.promptName){i();return}o(Tn(c))},e[2]=o,e[3]=i,e[4]=d):d=e[4];const l=d;let m;return e[5]!==r||e[6]!==l||e[7]!==i||e[8]!==a?(m={open:l,startBlank:i,dialog:r,starting:a},e[5]=r,e[6]=l,e[7]=i,e[8]=a,e[9]=m):m=e[9],m}function kn(t){const e=k.c(32),{entry:s,isEditMode:o}=t,{open:i,dialog:r,starting:a}=we(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 l=a||o,m=!o&&"cursor-pointer transition-colors hover:bg-accent/40",c=o&&"cursor-default pl-12",u=a&&"opacity-60";let f;e[3]!==m||e[4]!==c||e[5]!==u?(f=Q("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 p;e[7]!==s.agentIcon||e[8]!==s.agentName?(p=n.jsx(ce,{icon:s.agentIcon,name:s.agentName,size:"sm+"}),e[7]=s.agentIcon,e[8]=s.agentName,e[9]=p):p=e[9];let h;e[10]!==s.title?(h=n.jsx("div",{className:"line-clamp-2 text-sm font-medium text-foreground leading-snug",children:s.title}),e[10]=s.title,e[11]=h):h=e[11];let g;e[12]!==s?(g=In(s),e[12]=s,e[13]=g):g=e[13];let b;e[14]!==g?(b=n.jsx("div",{className:"truncate text-xs text-muted-foreground mt-0.5",children:g}),e[14]=g,e[15]=b):b=e[15];let y;e[16]!==b||e[17]!==h?(y=n.jsxs("div",{className:"min-w-0 flex-1",children:[h,b]}),e[16]=b,e[17]=h,e[18]=y):y=e[18];let N;e[19]!==o?(N=!o&&n.jsx(ds,{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]=o,e[20]=N):N=e[20];let v;e[21]!==a||e[22]!==d||e[23]!==y||e[24]!==N||e[25]!==l||e[26]!==f||e[27]!==p?(v=n.jsxs("button",{type:"button",onClick:d,disabled:l,"aria-busy":a,className:f,children:[p,y,N]}),e[21]=a,e[22]=d,e[23]=y,e[24]=N,e[25]=l,e[26]=f,e[27]=p,e[28]=v):v=e[28];let j;return e[29]!==r||e[30]!==v?(j=n.jsxs(n.Fragment,{children:[v,r]}),e[29]=r,e[30]=v,e[31]=j):j=e[31],j}function $n(){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},An)}),t[0]=e):e=t[0],e}function An(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(V,{className:"size-10 rounded-xl"}),n.jsxs("div",{className:"flex-1 space-y-1.5",children:[n.jsx(V,{className:"h-3 w-2/3"}),n.jsx(V,{className:"h-2.5 w-1/3"})]})]},`chip-skeleton-${e}`)}function Pn(t){const e=k.c(17),{tile:s,prompts:o,isEditMode:i,tileWidth:r}=t,{org:a}=J(),{open:d,startBlank:l,dialog:m,starting:c}=we(s.agentId),u=o.filter(Mn),f=et(s),p="relative flex h-full w-full flex-col p-3";let h;e[0]!==i||e[1]!==f||e[2]!==l||e[3]!==c?(h=!i&&n.jsx("button",{type:"button",onClick:()=>{l(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]=l,e[3]=c,e[4]=h):h=e[4];const g="flex min-h-0 flex-1 gap-3 overflow-hidden";let b;e[5]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx(zn,{}),e[5]=b):b=e[5];let y;e[6]!==a.id||e[7]!==a.slug||e[8]!==s?(y=n.jsx("div",{className:"min-h-0 flex-1 overflow-hidden rounded-lg border border-border",children:n.jsx(A.Suspense,{fallback:b,children:n.jsx(En,{tile:s,orgId:a.id,orgSlug:a.slug})})}),e[6]=a.id,e[7]=a.slug,e[8]=s,e[9]=y):y=e[9];const N=u.length>0&&!i&&r>=2&&n.jsx("div",{className:"flex w-44 shrink-0 flex-col gap-2 overflow-hidden",children:u.map(x=>n.jsx("button",{type:"button",onClick:()=>d(x),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:x.title})},x.promptName))});let v;e[10]!==y||e[11]!==N?(v=n.jsxs("div",{className:g,children:[y,N]}),e[10]=y,e[11]=N,e[12]=v):v=e[12];let j;return e[13]!==m||e[14]!==h||e[15]!==v?(j=n.jsxs("div",{className:p,children:[h,v,m]}),e[13]=m,e[14]=h,e[15]=v,e[16]=j):j=e[16],j}function Mn(t){return!!t.promptName}function En(t){const e=k.c(13),{tile:s,orgId:o,orgSlug:i}=t;let r;e[0]!==o||e[1]!==i||e[2]!==s.connectionId?(r={connectionId:s.connectionId,orgId:o,orgSlug:i},e[0]=o,e[1]=i,e[2]=s.connectionId,e[3]=r):r=e[3];const a=ae(r),d=s.minHeight??200,l=s.maxHeight??4e3;let m;return e[4]!==a||e[5]!==o||e[6]!==i||e[7]!==d||e[8]!==l||e[9]!==s.connectionId||e[10]!==s.resourceUri||e[11]!==s.toolInput?(m=n.jsx(ns,{resourceURI:s.resourceUri,orgId:o,orgSlug:i,connectionId:s.connectionId,client:a,toolInput:s.toolInput,displayMode:"fullscreen",minHeight:d,maxHeight:l,className:"h-full"}),e[4]=a,e[5]=o,e[6]=i,e[7]=d,e[8]=l,e[9]=s.connectionId,e[10]=s.resourceUri,e[11]=s.toolInput,e[12]=m):m=e[12],m}function zn(){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(V,{className:"h-3 w-2/3"}),n.jsx(V,{className:"h-3 w-1/2"}),n.jsx(V,{className:"mt-1 h-full w-full rounded-md"})]}),t[0]=e):e=t[0],e}function Ln(t){const e=k.c(14),{icon:s,name:o}=t;let i;e[0]!==s||e[1]!==o?(i=n.jsx(ce,{icon:s,name:o,size:"sm+"}),e[0]=s,e[1]=o,e[2]=i):i=e[2];let r;e[3]!==o?(r=n.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:o}),e[3]=o,e[4]=r):r=e[4];let a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx("div",{className:"truncate text-xs text-muted-foreground",children:"Loading tile…"}),e[5]=a):a=e[5];let d;e[6]!==r?(d=n.jsxs("div",{className:"min-w-0 flex-1",children:[r,a]}),e[6]=r,e[7]=d):d=e[7];let l;e[8]!==i||e[9]!==d?(l=n.jsxs("div",{className:"flex items-center gap-2.5",children:[i,d]}),e[8]=i,e[9]=d,e[10]=l):l=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(V,{className:"h-3 w-3/4"}),n.jsx(V,{className:"h-3 w-1/2"}),n.jsx(V,{className:"h-3 w-2/3"})]}),e[11]=m):m=e[11];let c;return e[12]!==l?(c=n.jsxs("div",{className:"flex h-full w-full flex-col gap-3 p-5 opacity-60",children:[l,m]}),e[12]=l,e[13]=c):c=e[13],c}function On(t){const e=k.c(10),{tile:s,prompts:o,isEditMode:i}=t,{open:r,startBlank:a,dialog:d,starting:l}=we(s.agentId),m=o.filter(Dn),c=et(s),u="flex h-full w-full flex-col gap-3 p-4";let f;e[0]!==c||e[1]!==a?(f=()=>{a(c?{main:c}:void 0)},e[0]=c,e[1]=a,e[2]=f):f=e[2];const p=l||i;let h;e[3]!==f||e[4]!==p?(h=n.jsx("button",{type:"button",onClick:f,disabled:p,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]=p,e[5]=h):h=e[5];const g=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&&r(y),disabled:l,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 b;return e[6]!==d||e[7]!==h||e[8]!==g?(b=n.jsxs("div",{className:u,children:[h,g,d]}),e[6]=d,e[7]=h,e[8]=g,e[9]=b):b=e[9],b}function Dn(t){return!!t.promptName}function tt({isEditMode:t}){const{org:e}=J(),{isLoading:s,prompts:o,tiles:i}=je(e.slug),r=Oe()?.ids??[],a=new Set(r),d=De(),l=Be(),m=xe(),c=new Set(i.map(x=>x.agentId)),u=new Map;for(const x of o){const w=u.get(x.agentId);w?w.push(x):u.set(x.agentId,[x])}const f=o.filter(x=>!c.has(x.agentId)),p=[...i.map(x=>({kind:"tile",id:Cn(x),data:x})),...f.map(x=>({kind:"prompt",id:_n(x),data:x}))],h=new Map(p.map(x=>[x.id,x])),g=jn(p.map(x=>({id:x.id,defaultSize:x.kind==="tile"?Nn:Sn,minSize:x.kind==="tile"?wn:void 0,pinned:a.has(x.data.agentId)}))),b=x=>{d.apply(w=>w.filter(S=>S!==x)).catch(()=>K.error("Couldn't remove from home — please try again."))},y=async x=>{if(i.filter(S=>S.agentId===x.agentId).length<=1){b(x.agentId);return}try{const T=(await l.call("COLLECTION_VIRTUAL_MCP_GET",{id:x.agentId})).item;if(!T)throw new Error("Agent not found");const _=Z(T.metadata?.ui),C=x.tileId?_.filter(I=>I.tileId!==x.tileId):_.filter(I=>I.connectionId!==x.connectionId||I.resourceUri!==x.resourceUri);await l.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:x.agentId,data:{metadata:{...T.metadata??{},ui:{...T.metadata?.ui??{},homeTile:null,homeTiles:C}}}}),m.invalidateQueries({queryKey:te.homeNextActions(e.slug)})}catch{K.error("Couldn't remove tile — please try again.")}},N=x=>{const w=h.get(x);if(w){if(!a.has(w.data.agentId)){g.hideTile(x);return}w.kind==="tile"?y(w.data):b(w.data.agentId)}},v=x=>{const w=h.get(x.id);if(!w)return null;if(w.kind==="tile"){const S=u.get(w.data.agentId)??[];return n.jsx(ot,{fallback:n.jsx(On,{tile:w.data,prompts:S,isEditMode:t}),children:n.jsx(A.Suspense,{fallback:n.jsx(Ln,{icon:w.data.agentIcon,name:w.data.agentName}),children:n.jsx(Pn,{tile:w.data,prompts:S,isEditMode:t,tileWidth:x.w})})})}return n.jsx(kn,{entry:w.data,isEditMode:t})};return s||g.isLoading?n.jsx($n,{}):g.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(mn,{tiles:g.snapshot.visible,isEditMode:t,renderTile:v,onMove:g.moveTile,onResize:g.resizeTile,onRemove:N})})}function Hn(t){const e=k.c(2),{prompts:s,tiles:o}=je(t),i=o.length>0||s.length>0;let r;return e[0]!==i?(r={hasVisibleTiles:i},e[0]=i,e[1]=r):r=e[1],r}const ke=420,$e=305;function st(){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:ke}}),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:ke}}),t[1]=s):s=t[1];let o;t[2]===Symbol.for("react.memo_cache_sentinel")?(o=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:$e}}),t[2]=o):o=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,o,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:$e}})]}),t[3]=i):i=t[3],i}function Ae(){const t=k.c(33),{data:e}=rt.useSession(),{org:s}=J(),o=ge(),i=Ns(),{selectedVirtualMcp:r}=Dt();let a;t[0]!==s.id?(a=ut(s.id),t[0]=s.id,t[1]=a):a=t[1];const l=r??a;let m;t[2]!==s.slug?(m=Wt(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:ft,orgId:s.id,orgSlug:s.slug},t[4]=s.id,t[5]=s.slug,t[6]=c):c=t[6];const u=ae(c);let f;t[7]!==s.id||t[8]!==s.slug?(f=js(s.slug,s.id),t[7]=s.id,t[8]=s.slug,t[9]=f):f=t[9];let p;t[10]!==s.id||t[11]!==s.slug?(p=Vt(s.slug,s.id),t[10]=s.id,t[11]=s.slug,t[12]=p):p=t[12];let h;t[13]!==l.id||t[14]!==s.id||t[15]!==u?(h=xt(s.id,l.id,u),t[13]=l.id,t[14]=s.id,t[15]=u,t[16]=h):h=t[16];let g;t[17]!==f||t[18]!==p||t[19]!==h?(g={queries:[f,p,h]},t[17]=f,t[18]=p,t[19]=h,t[20]=g):g=t[20],ct(g);const b=vs(),y=gt(l.id),{hasDecoKey:N,isZeroBalance:v,isInitialFreeCredit:j,balanceDollars:x,hasOnlyDecoProvider:w}=Ft(),{hasVisibleTiles:S}=Hn(s.slug),T=Ut(y?.metadata);if(b.length===0&&!(T&&Bt(i))){let D;return t[21]===Symbol.for("react.memo_cache_sentinel")?(D=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(Ht,{})})}),t[21]=D):D=t[21],D}let C;t[22]!==e?.user?.name?(C=e?.user?.name?.split(" ")[0]||"there",t[22]=e?.user?.name,t[23]=C):C=t[23];const I=C,P=N&&j&&x!=null,E=N&&v&&w;let z;t[24]!==x||t[25]!==P||t[26]!==E?(z=P?n.jsx(re.CreditsEyebrow,{balanceDollars:x}):E?n.jsx(re.NoCreditsEyebrow,{}):null,t[24]=x,t[25]=P,t[26]=E,t[27]=z):z=t[27];const H=z;let L;return t[28]!==H||t[29]!==S||t[30]!==o||t[31]!==I?(L=n.jsx(ln,{children:o?n.jsx(Rn,{eyebrow:H,userName:I}):n.jsx(Fn,{eyebrow:H,userName:I,hasVisibleTiles:S})}),t[28]=H,t[29]=S,t[30]=o,t[31]=I,t[32]=L):L=t[32],L}function Rn(t){const e=k.c(12),{eyebrow:s,userName:o}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(st,{}),e[0]=i):i=e[0];let r;e[1]!==s?(r=s&&n.jsx("div",{className:"mb-4",children:s}),e[1]=s,e[2]=r):r=e[2];let a;e[3]!==o?(a=n.jsxs("p",{className:"text-3xl font-medium text-foreground text-center max-w-[280px]",children:["What's on your mind, ",o,"?"]}),e[3]=o,e[4]=a):a=e[4];let d;e[5]!==r||e[6]!==a?(d=n.jsxs("div",{className:"relative flex flex-col items-center justify-center w-full pt-28 pb-8 px-4",children:[r,a]}),e[5]=r,e[6]=a,e[7]=d):d=e[7];let l;e[8]===Symbol.for("react.memo_cache_sentinel")?(l=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]=l):l=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(tt,{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,l,m]}),e[10]=d,e[11]=c):c=e[11],c}function Fn(t){const e=k.c(54),{eyebrow:s,userName:o,hasVisibleTiles:i}=t,{isEditMode:r,enter:a,save:d,cancel:l,hasChanges:m}=Ye(),[c,u]=A.useState(!1),f=lt();let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p={strict:!1},e[0]=p):p=e[0];const{main:h}=at(p);let g;e[1]!==h?(g=h?Ot(h):null,e[1]=h,e[2]=g):g=e[2];const b=g,y=h==="files"||!!b;let N;e[3]!==f?(N=B=>f({to:".",search:W=>({...W,main:B}),replace:!0}),e[3]=f,e[4]=N):N=e[4];const v=N;let j;e[5]===Symbol.for("react.memo_cache_sentinel")?(j={kind:"component",Component:Se},e[5]=j):j=e[5];let x;e[6]!==y||e[7]!==v?(x=()=>v(y?void 0:"files"),e[6]=y,e[7]=v,e[8]=x):x=e[8];let w;e[9]!==y||e[10]!==x?(w=n.jsx(St,{title:"Library",icon:j,active:y,onClick:x}),e[9]=y,e[10]=x,e[11]=w):w=e[11];let S;e[12]===Symbol.for("react.memo_cache_sentinel")?(S=()=>u(!0),e[12]=S):S=e[12];let T;e[13]!==l||e[14]!==a||e[15]!==m||e[16]!==r||e[17]!==d?(T=n.jsx(Un,{isEditMode:r,hasChanges:m,onEnter:a,onSave:d,onCancel:l,onAddTile:S}),e[13]=l,e[14]=a,e[15]=m,e[16]=r,e[17]=d,e[18]=T):T=e[18];let _;e[19]!==w||e[20]!==T?(_=n.jsxs(ws.Right,{children:[w,T]}),e[19]=w,e[20]=T,e[21]=_):_=e[21];let C;e[22]!==c?(C=n.jsx(_s,{open:c,onOpenChange:u}),e[22]=c,e[23]=C):C=e[23];let I;e[24]===Symbol.for("react.memo_cache_sentinel")?(I=n.jsx(st,{}),e[24]=I):I=e[24];const P=i||r?"pt-32":"flex-1 justify-center";let E;e[25]!==P?(E=Q("relative flex flex-col items-center px-10 pb-4",P),e[25]=P,e[26]=E):E=e[26];let z;e[27]!==s?(z=s&&n.jsx("div",{className:"mb-4",children:s}),e[27]=s,e[28]=z):z=e[28];let H;e[29]!==o?(H=n.jsxs("p",{className:"text-3xl font-medium text-foreground",children:["What's on your mind, ",o,"?"]}),e[29]=o,e[30]=H):H=e[30];let L;e[31]!==z||e[32]!==H?(L=n.jsxs("div",{className:"text-center mb-10",children:[z,H]}),e[31]=z,e[32]=H,e[33]=L):L=e[33];let D;e[34]===Symbol.for("react.memo_cache_sentinel")?(D=n.jsxs("div",{className:"relative w-full",children:[n.jsx(Bn,{}),n.jsx(re.Input,{showConnectionsBanner:!0})]}),e[34]=D):D=e[34];let U;e[35]!==L?(U=n.jsxs("div",{className:"flex flex-col items-center w-full max-w-[672px]",children:[L,D]}),e[35]=L,e[36]=U):U=e[36];let $;e[37]!==r?($=n.jsx("div",{className:"relative w-full mt-10 mx-auto max-w-[1280px] px-2 pb-16",children:n.jsx(tt,{isEditMode:r})}),e[37]=r,e[38]=$):$=e[38];let R;e[39]!==E||e[40]!==U||e[41]!==$?(R=n.jsxs("div",{className:"flex-1 min-w-0 relative flex flex-col",children:[I,n.jsx("div",{className:"flex-1 relative flex flex-col overflow-y-auto",children:n.jsxs("div",{className:E,children:[U,$]})})]}),e[39]=E,e[40]=U,e[41]=$,e[42]=R):R=e[42];let O;e[43]!==b||e[44]!==y||e[45]!==v?(O=y&&n.jsxs("div",{className:"w-[45%] max-w-[680px] min-w-[380px] shrink-0 flex flex-col min-h-0 border-l border-border bg-background",children:[n.jsxs("div",{className:"h-10 shrink-0 flex items-center justify-between px-3 border-b border-border",children:[n.jsxs("div",{className:"flex items-center gap-1.5 text-sm font-medium text-foreground",children:[n.jsx(Se,{size:16}),"Library"]}),n.jsx("button",{type:"button",onClick:()=>v(void 0),"aria-label":"Close Library panel",className:"flex size-7 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground transition-colors",children:n.jsx(ye,{size:16})})]}),n.jsx("div",{className:"flex-1 min-h-0",children:b?n.jsx(Et,{path:b.path}):n.jsx(zt,{})})]}),e[43]=b,e[44]=y,e[45]=v,e[46]=O):O=e[46];let M;e[47]!==R||e[48]!==O?(M=n.jsxs("div",{className:"flex-1 relative flex flex-row min-h-0",children:[R,O]}),e[47]=R,e[48]=O,e[49]=M):M=e[49];let F;return e[50]!==C||e[51]!==M||e[52]!==_?(F=n.jsxs(n.Fragment,{children:[_,C,M]}),e[50]=C,e[51]=M,e[52]=_,e[53]=F):F=e[53],F}function Un(t){const e=k.c(17),{isEditMode:s,hasChanges:o,onEnter:i,onSave:r,onCancel:a,onAddTile:d}=t;if(s){let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(be,{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(ye,{size:14}),e[3]=f):f=e[3];let p;e[4]!==a?(p=n.jsxs(Y,{size:"sm",variant:"ghost",onClick:a,className:"gap-1.5 h-7 text-xs",children:[f,"Cancel"]}),e[4]=a,e[5]=p):p=e[5];const h=!o;let g;e[6]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(bt,{size:14}),e[6]=g):g=e[6];let b;e[7]!==r||e[8]!==h?(b=n.jsxs(Y,{size:"sm",onClick:r,disabled:h,className:"gap-1.5 h-7 text-xs",children:[g,"Save"]}),e[7]=r,e[8]=h,e[9]=b):b=e[9];let y;return e[10]!==u||e[11]!==p||e[12]!==b?(y=n.jsxs(n.Fragment,{children:[u,p,b]}),e[10]=u,e[11]=p,e[12]=b,e[13]=y):y=e[13],y}let l;e[14]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(wt,{size:14}),e[14]=l):l=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:[l,"Customize"]}),e[15]=i,e[16]=m):m=e[16],m}function Bn(){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 lr(){const t=k.c(2);if(ge()){let o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx("div",{className:"flex-1 min-h-0 flex flex-col bg-background overflow-hidden",children:n.jsx(Ae,{})}),t[0]=o):o=t[0],o}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(Ae,{})})})}),t[1]=s):s=t[1],s}export{lr as default};
|
|
1
|
+
import{c as k,j as n,r as A,D as J,m as xe,l as Q,i as le,ag as Z,t as K,K as te,k as se,B as Y,d as nt,W as it,E as ot,a as rt,b as lt,u as at}from"./index-wvMNjAV0.js";import{u as ge}from"./use-mobile-7niVKoti.js";import{u as ct}from"./useSuspenseQueries-Dg30S2DW.js";import{u as ae,m as dt}from"./use-mcp-client-dBNHEL6c.js";import{i as mt,a as ut,S as ft}from"./constants-C8_Swa4x.js";import{u as pt,b as ht,v as xt,a as gt}from"./use-virtual-mcp-Cy-jA6Qm.js";import{i as bt}from"./Check-CUUu6fuS.js";import{b as Pe,a as Se}from"./ZoomOut-TFjut-PL.js";import{i as yt,A as ce,t as jt,ae as vt,H as Nt,l as wt}from"./agent-icon-CPQk4YwJ.js";import{s as be}from"./Plus-6nUvzb_a.js";import{i as ye}from"./X-qcmmBu7s.js";import{p as St}from"./index-BNz3lima.js";import{b as Me,c as oe,K as Ee,P as ze,D as Le,d as _t,S as Ct,v as It,g as Tt,h as kt,i as $t,f as At,e as Pt,n as Mt,C as re,L as Et,k as zt}from"./library-tab-DFX3AeS3.js";import{f as Lt,d as Ot}from"./tab-id-CLpu897Q.js";import{b as Dt}from"./chat-context-Cemyx-UZ.js";import{N as Ht}from"./decopilot-CETHa21a.js";import{g as Rt,u as Ft,c as Ut,h as Bt}from"./agent-capabilities-B_99zpHP.js";import{a as Oe,b as De,o as Vt}from"./use-organization-settings-OjpRHnBI.js";import{c as je,b as Kt,h as Wt}from"./shell-layout-CoG2R-A7.js";import{I as He}from"./input-CtNQHwPy.js";import{S as qt,t as ve,P as Gt,j as Qt,s as Jt,g as Xt}from"./scroll-area-CbuKwozG.js";import{S as Zt,a as Yt,b as es,c as ts,d as ss}from"./sheet-DMc7DeSX.js";import{S as V}from"./skeleton-CEKyj6Ku.js";import{t as Re}from"./ChevronDown-SbVNxwJa.js";import{g as Fe,M as ns}from"./types-CvzpcJR1.js";import{I as Ue}from"./integration-icon-DvFXK2MU.js";import{S as is,a as os,b as rs,c as _e,d as ls}from"./select-DF6YoK_r.js";import{T as as}from"./textarea-CDy5MusJ.js";import{u as Be}from"./studio-tools-CEhEjTYq.js";import{a as cs}from"./use-mcp-tools-DX5g41Xz.js";import{i as ds}from"./XCircle-Bn7fkWKh.js";import{g as ms}from"./use-mcp-prompts-D2VFS_7Z.js";import{b as us,w as fs}from"./hooks-DLOVOtDp.js";import{b as ps,d as hs,c as xs,D as gs,a as bs}from"./dropdown-menu-CeNfEKAu.js";import{s as ys}from"./Trash01-D7DoI-Sm.js";import{a as js,u as vs}from"./use-ai-providers-BJKmj4My.js";import{u as Ns}from"./connect-desktop-dialog-DnC2R2Wo.js";import{T as ws}from"./toolbar-DeO3vJmm.js";import"./auth-D0kIsFu2.js";import"./use-collections-CjkVI8cV.js";import"./AlertCircle-CS_9RDbg.js";import"./Tool01-TTGB3OaR.js";import"./SwitchHorizontal01-BmduH4aR.js";import"./Settings02-C4te5XIh.js";import"./ArrowUpRight-DvbKSlUB.js";import"./ZapSquare-BWJNUjCu.js";import"./Users03-CbmB3ag4.js";import"./CheckCircle-2nPR7mAJ.js";import"./ChevronRight-CcT_Yai8.js";import"./ChevronUp-DvAb8S9K.js";import"./Circle-Bk2OeGHv.js";import"./Stars02-CbNiaecd.js";import"./Loading02-Cc_XPeVS.js";import"./Copy01-DvnmgpBw.js";import"./DotsVertical-BdQp-tpJ.js";import"./Globe01-BWEVPBr8.js";import"./Eye-_b_nmYda.js";import"./FilterLines-Dgm9Ju0X.js";import"./Star01-BMo746nc.js";import"./Globe04-wcXsSWcH.js";import"./HardDrive-CCq9xvHa.js";import"./Key01-BXrc6Emy.js";import"./LayoutLeft-BStzo30s.js";import"./LinkExternal01-BuzymGhb.js";import"./List-BFtSkA22.js";import"./Monitor01-BJSW7YEH.js";import"./Sun-DdZgJrCs.js";import"./Palette-BudWH9og.js";import"./Play-tpQoZZ7-.js";import"./SearchLg-uOXEhZpb.js";import"./SearchMd-CxCfJ-k7.js";import"./Shield01-DL0nLXwm.js";import"./Stars01-CeLaUJek.js";import"./Upload01-DK0nNkQH.js";import"./User01-zyFcbX02.js";import"./Users01-DD6y7ZFy.js";import"./XClose-aB151tNh.js";import"./Zap-CKOdamGS.js";import"./alert-dialog-DmHjxQGj.js";import"./dialog-CEOLT1ZZ.js";import"./file-type-icon-CxAOgcI2.js";import"./use-debounced-value-CLg8LNax.js";import"./popover-Cvv98a2C.js";import"./tooltip-DlUY886I.js";import"./index-Cwr5cOYK.js";import"./drawer-B-rufaJn.js";import"./collection-search-DfgQYgyj.js";import"./form-DtFQ7vfL.js";import"./label-B8KM3R_q.js";import"./tabs-Cf3RVJ3Q.js";import"./toggle-group-Dtf2CWD1.js";import"./command-DN00KTSb.js";import"./index-g1gbVRQq.js";import"./useInfiniteQuery-CcA0p7if.js";import"./use-infinite-scroll-DI0qAEco.js";import"./question-004-sINsf4GQ.js";import"./use-decopilot-events-uhlm9ZSC.js";import"./decopilot-sse-pool-C82Ujbm_.js";import"./backoff-CrEUbyZT.js";import"./checkbox-DZJkrzus.js";import"./ai-providers-logos-DD3qZ33J.js";import"./avatar-B8x-LJ3L.js";import"./settings-section-CngINngb.js";import"./card-CYX_RwBA.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-BoKNDsqu.js";import"./use-registry-connections-BiMSB_yO.js";import"./use-connection-ChjsmWTh.js";import"./extract-connection-data-Db76guDM.js";import"./collection-tabs-D3XeP_yy.js";import"./badge-Du0UNTzb.js";import"./connection-form-helpers-DgmmJwTY.js";import"./authenticate-and-persist-oauth-DkNbTtTB.js";import"./mcp-oauth-DzrEuQr5.js";import"./useSuspenseInfiniteQuery-DXVqJ8aq.js";import"./required-auth-layout-CH2SPOr0.js";import"./use-org-sso-CXSE3hAV.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-I4FalMZb.js";import"./content-blocks-o63cs2vh.js";import"./use-clock-tick-BEBincp5.js";import"./use-navigate-to-agent-C1tFWD13.js";import"./delay-CnY5UFtP.js";function Ve(t){const e=k.c(11),{properties:s,required:o,values:i,onChange:r}=t;let a;e[0]!==o?(a=o??[],e[0]=o,e[1]=a):a=e[1];let d;e[2]!==a?(d=new Set(a),e[2]=a,e[3]=d):d=e[3];const l=d;let m;e[4]!==s?(m=Object.entries(s),e[4]=s,e[5]=m):m=e[5];let c;return e[6]!==r||e[7]!==l||e[8]!==m||e[9]!==i?(c=n.jsx("div",{className:"flex flex-col gap-2",children:m.map(u=>{const[f,p]=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,l.has(f)&&n.jsx("span",{className:"text-red-500 text-[10px]",children:"*"})]}),n.jsx("span",{className:"text-[10px] text-muted-foreground font-mono",children:p.type})]}),p.description&&n.jsx("p",{className:"text-[10px] text-muted-foreground leading-snug",children:p.description}),n.jsx(Ss,{type:p.type,fieldKey:f,value:i[f],onChange:h=>r(f,h)})]},f)})}),e[6]=r,e[7]=l,e[8]=m,e[9]=i,e[10]=c):c=e[10],c}function Ss(t){const e=k.c(19),{type:s,fieldKey:o,value:i,onChange:r}=t;if(s==="object"||s==="array"){const c=i??"";let u;e[0]!==r?(u=h=>r(h.target.value),e[0]=r,e[1]=u):u=e[1];const f=`Enter ${o} as JSON…`;let p;return e[2]!==c||e[3]!==u||e[4]!==f?(p=n.jsx(as,{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]=p):p=e[5],p}if(s==="boolean"){const c=i!=null?String(i):"";let u;e[6]!==r?(u=g=>r(g==="true"),e[6]=r,e[7]=u):u=e[7];let f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(is,{className:"h-7 text-xs",children:n.jsx(os,{placeholder:"Select…"})}),e[8]=f):f=e[8];let p;e[9]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsxs(rs,{children:[n.jsx(_e,{value:"true",children:"true"}),n.jsx(_e,{value:"false",children:"false"})]}),e[9]=p):p=e[9];let h;return e[10]!==c||e[11]!==u?(h=n.jsxs(ls,{value:c,onValueChange:u,children:[f,p]}),e[10]=c,e[11]=u,e[12]=h):h=e[12],h}const a=i??"";let d;e[13]!==r?(d=c=>r(c.target.value),e[13]=r,e[14]=d):d=e[14];const l=`Enter ${o}…`;let m;return e[15]!==a||e[16]!==d||e[17]!==l?(m=n.jsx(He,{className:"h-7 text-xs",value:a,onChange:d,placeholder:l}),e[15]=a,e[16]=d,e[17]=l,e[18]=m):m=e[18],m}const ne=8;function _s(t){const e=k.c(16),{open:s,onOpenChange:o}=t,[i,r]=A.useState("");let a,d;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(Zt,{children:"Manage home"}),d=n.jsx(Yt,{children:"Add agents to the home board and pin their interactive UIs or prompts."}),e[0]=a,e[1]=d):(a=e[0],d=e[1]);let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(yt,{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]=l):l=e[2];let m;e[3]===Symbol.for("react.memo_cache_sentinel")?(m=g=>r(g.target.value),e[3]=m):m=e[3];let c;e[4]!==i?(c=n.jsxs(es,{className:"px-5 py-4 border-b border-border",children:[a,d,n.jsxs("div",{className:"relative mt-3",children:[l,n.jsx(He,{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(tn,{}),e[6]=u):u=e[6];let f;e[7]!==i?(f=n.jsx(qt,{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(A.Suspense,{fallback:u,children:n.jsx(Is,{search:i})})})}),e[7]=i,e[8]=f):f=e[8];let p;e[9]!==c||e[10]!==f?(p=n.jsxs(ts,{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]=p):p=e[11];let h;return e[12]!==o||e[13]!==s||e[14]!==p?(h=n.jsx(ss,{open:s,onOpenChange:o,children:p}),e[12]=o,e[13]=s,e[14]=p,e[15]=h):h=e[15],h}function Cs(t){const e=k.c(32),{org:s}=J(),o=Oe();let i;e[0]!==o?.ids?(i=o?.ids??[],e[0]=o?.ids,e[1]=i):i=e[1];const r=i,a=De(),d=ht(),l=xe();let m;e[2]!==s||e[3]!==l?(m=()=>l.refetchQueries({queryKey:te.homeNextActions(s.slug),type:"active"}),e[2]=s,e[3]=l,e[4]=m):m=e[4];const c=m;let u;e[5]!==r?(u=_=>r.includes(_),e[5]=r,e[6]=u):u=e[6];const f=u;let p;e[7]!==r||e[8]!==t?(p=t?r.filter(_=>t.has(_)).length:r.length,e[7]=r,e[8]=t,e[9]=p):p=e[9];const g=p>=ne;let b;e[10]!==g||e[11]!==f||e[12]!==a?(b=_=>f(_)||g?Promise.resolve():a.apply(C=>C.includes(_)?null:[...C,_]),e[10]=g,e[11]=f,e[12]=a,e[13]=b):b=e[13];const y=b;let N;e[14]!==a?(N=_=>a.apply(C=>C.filter(I=>I!==_)),e[14]=a,e[15]=N):N=e[15];const v=N;let j;e[16]!==a?(j=_=>a.apply(()=>_),e[16]=a,e[17]=j):j=e[17];const x=j;let w;e[18]!==d||e[19]!==g||e[20]!==f||e[21]!==c||e[22]!==a?(w=async(_,C)=>{await d.update.mutateAsync({id:_.id,data:{metadata:C}}),!f(_.id)&&!g&&await a.apply(I=>I.includes(_.id)?null:[...I,_.id]),await c()},e[18]=d,e[19]=g,e[20]=f,e[21]=c,e[22]=a,e[23]=w):w=e[23];const S=w;let T;return e[24]!==y||e[25]!==g||e[26]!==r||e[27]!==f||e[28]!==v||e[29]!==x||e[30]!==S?(T={homeIds:r,isOnHome:f,atLimit:g,addAgent:y,removeAgent:v,reorder:x,saveAgentMetadata:S},e[24]=y,e[25]=g,e[26]=r,e[27]=f,e[28]=v,e[29]=x,e[30]=S,e[31]=T):T=e[31],T}function Is(t){const e=k.c(21),{search:s}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={pageSize:1e3},e[0]=o):o=e[0];const i=pt(o);let r;e[1]!==i?(r=new Set(i.map(Ps)),e[1]=i,e[2]=r):r=e[2];const a=Cs(r);let d,l,m;if(e[3]!==i||e[4]!==a||e[5]!==s){const g=new Map(i.map(As));d=s.trim().toLowerCase();const b=v=>!d||v.title?.toLowerCase().includes(d);l=a.homeIds.map(v=>g.get(v)).filter($s).filter(b);const y=Rt(i);let N;e[9]!==a?(N=v=>!a.isOnHome(v.id),e[9]=a,e[10]=N):N=e[10],m=i.filter(ks).filter(v=>!y.has(v.id)).filter(N).filter(b).sort(Ts),e[3]=i,e[4]=a,e[5]=s,e[6]=d,e[7]=l,e[8]=m}else d=e[6],l=e[7],m=e[8];const c=m;let u;e[11]!==a||e[12]!==l?(u=n.jsx(Ms,{home:a,agents:l}),e[11]=a,e[12]=l,e[13]=u):u=e[13];const f=!!d;let p;e[14]!==c||e[15]!==a||e[16]!==f?(p=n.jsx(Ls,{home:a,agents:c,hasSearch:f}),e[14]=c,e[15]=a,e[16]=f,e[17]=p):p=e[17];let h;return e[18]!==u||e[19]!==p?(h=n.jsxs(n.Fragment,{children:[u,p]}),e[18]=u,e[19]=p,e[20]=h):h=e[20],h}function Ts(t,e){return(t.title??"").localeCompare(e.title??"")}function ks(t){return t.id&&!mt(t.id)}function $s(t){return!!t}function As(t){return[t.id,t]}function Ps(t){return t.id}function Ke(t){const e=k.c(7),{title:s,hint:o}=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 r;e[2]!==o?(r=o&&n.jsx("span",{className:"text-xs text-muted-foreground",children:o}),e[2]=o,e[3]=r):r=e[3];let a;return e[4]!==i||e[5]!==r?(a=n.jsxs("div",{className:"flex items-center justify-between px-1",children:[i,r]}),e[4]=i,e[5]=r,e[6]=a):a=e[6],a}function Ms(t){const e=k.c(14),{home:s,agents:o}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={activationConstraint:{distance:5}},e[0]=i):i=e[0];let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r={coordinateGetter:$t},e[1]=r):r=e[1];const a=Me(oe(ze,i),oe(Ee,r));let d;e[2]!==s?(d=p=>{const{active:h,over:g}=p;if(!g||h.id===g.id)return;const b=s.homeIds,y=b.indexOf(h.id),N=b.indexOf(g.id);y===-1||N===-1||s.reorder(At([...b],y,N)).catch(zs)},e[2]=s,e[3]=d):d=e[3];const l=d,m=`${s.homeIds.length}/${ne}`;let c;e[4]!==m?(c=n.jsx(Ke,{title:"On home",hint:m}),e[4]=m,e[5]=c):c=e[5];let u;e[6]!==o||e[7]!==l||e[8]!==s||e[9]!==a?(u=o.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:a,collisionDetection:_t,onDragEnd:l,children:n.jsx(Ct,{items:o.map(Es),strategy:It,children:n.jsx("div",{className:"flex flex-col gap-1",children:o.map(p=>n.jsx(Ds,{agent:p,home:s},p.id))})})}),e[6]=o,e[7]=l,e[8]=s,e[9]=a,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 Es(t){return t.id}function zs(){return K.error("Couldn't reorder home — please try again.")}function Ls(t){const e=k.c(6),{home:s,agents:o,hasSearch:i}=t,[r,a]=A.useState(20);let d;if(e[0]!==o||e[1]!==i||e[2]!==s||e[3]!==r){const l=o.slice(0,r);let m;e[5]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(Ke,{title:"Add to home"}),e[5]=m):m=e[5],d=n.jsxs("div",{className:"flex flex-col gap-1.5",children:[m,o.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:l.map(c=>n.jsx(Fs,{agent:c,home:s},c.id))}),o.length>r&&n.jsxs("button",{type:"button",onClick:()=>a(Os),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 (",o.length-r,")"]})]})]}),e[0]=o,e[1]=i,e[2]=s,e[3]=r,e[4]=d}else d=e[4];return d}function Os(t){return t+20}function We(t){const e=Z(t.metadata?.ui).filter(r=>!!r.resourceUri).length,s=t.metadata?.ui?.homePrompts,o=Array.isArray(s)?s.length:null,i=[];return e>0&&i.push(`${e} tile${e===1?"":"s"}`),o!==null&&o>0&&i.push(`${o} prompt${o===1?"":"s"}`),o===0&&i.push("prompts off"),i.join(" · ")}function Ds(t){const e=k.c(57),{agent:s,home:o}=t,[i,r]=A.useState(!1);let a;e[0]!==s.id?(a={id:s.id},e[0]=s.id,e[1]=a):a=e[1];const{attributes:d,listeners:l,setNodeRef:m,transform:c,transition:u,isDragging:f}=Tt(a),p=We(s)||"Quick access";let h;e[2]!==c?(h=kt.Transform.toString(c),e[2]=c,e[3]=h):h=e[3];const g=f?.5:void 0,b=f?100:void 0;let y;e[4]!==h||e[5]!==g||e[6]!==b||e[7]!==u?(y={transform:h,transition:u,opacity:g,zIndex:b},e[4]=h,e[5]=g,e[6]=b,e[7]=u,e[8]=y):y=e[8];const N=y,v=f&&"shadow-lg";let j;e[9]!==v?(j=Q("rounded-lg border border-border bg-card",v),e[9]=v,e[10]=j):j=e[10];const x=`Drag to reorder ${s.title??s.id}`;let w;e[11]===Symbol.for("react.memo_cache_sentinel")?(w=n.jsx(Pe,{size:14}),e[11]=w):w=e[11];let S;e[12]!==d||e[13]!==l||e[14]!==x?(S=n.jsx("button",{type:"button",...d,...l,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":x,children:w}),e[12]=d,e[13]=l,e[14]=x,e[15]=S):S=e[15];let T;e[16]===Symbol.for("react.memo_cache_sentinel")?(T=()=>r(Rs),e[16]=T):T=e[16];const _=s.title??s.id;let C;e[17]!==s.icon||e[18]!==_?(C=n.jsx(ce,{icon:s.icon,name:_,size:"sm"}),e[17]=s.icon,e[18]=_,e[19]=C):C=e[19];const I=s.title??s.id;let P;e[20]!==I?(P=n.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:I}),e[20]=I,e[21]=P):P=e[21];let E;e[22]!==p?(E=n.jsx("div",{className:"truncate text-xs text-muted-foreground",children:p}),e[22]=p,e[23]=E):E=e[23];let z;e[24]!==P||e[25]!==E?(z=n.jsxs("div",{className:"min-w-0 flex-1",children:[P,E]}),e[24]=P,e[25]=E,e[26]=z):z=e[26];const H=i&&"rotate-180";let L;e[27]!==H?(L=Q("shrink-0 text-muted-foreground transition-transform",H),e[27]=H,e[28]=L):L=e[28];let D;e[29]!==L?(D=n.jsx(Re,{size:16,className:L}),e[29]=L,e[30]=D):D=e[30];let U;e[31]!==i||e[32]!==C||e[33]!==z||e[34]!==D?(U=n.jsxs("button",{type:"button",onClick:T,className:"flex min-w-0 flex-1 items-center gap-2.5 text-left outline-none","aria-expanded":i,children:[C,z,D]}),e[31]=i,e[32]=C,e[33]=z,e[34]=D,e[35]=U):U=e[35];let $;e[36]!==s.id||e[37]!==o?($=()=>o.removeAgent(s.id).catch(Hs),e[36]=s.id,e[37]=o,e[38]=$):$=e[38];const R=`Remove ${s.title??s.id} from home`;let O;e[39]===Symbol.for("react.memo_cache_sentinel")?(O=n.jsx(ye,{size:14}),e[39]=O):O=e[39];let M;e[40]!==$||e[41]!==R?(M=n.jsx("button",{type:"button",onClick:$,"aria-label":R,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:O}),e[40]=$,e[41]=R,e[42]=M):M=e[42];let F;e[43]!==S||e[44]!==U||e[45]!==M?(F=n.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-2.5",children:[S,U,M]}),e[43]=S,e[44]=U,e[45]=M,e[46]=F):F=e[46];let B;e[47]!==s||e[48]!==i||e[49]!==o?(B=i&&n.jsx(qe,{agent:s,home:o}),e[47]=s,e[48]=i,e[49]=o,e[50]=B):B=e[50];let W;return e[51]!==m||e[52]!==N||e[53]!==F||e[54]!==B||e[55]!==j?(W=n.jsxs("div",{ref:m,style:N,className:j,children:[F,B]}),e[51]=m,e[52]=N,e[53]=F,e[54]=B,e[55]=j,e[56]=W):W=e[56],W}function Hs(){return K.error("Couldn't remove from home — please try again.")}function Rs(t){return!t}function Fs({agent:t,home:e}){const[s,o]=A.useState(!1),[i,r]=A.useState(!1),a=We(t),d=async()=>{if(!e.atLimit){r(!0);try{await e.addAgent(t.id)}catch{K.error("Couldn't add to home — please try again.")}finally{r(!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:()=>o(l=>!l),className:"flex min-w-0 flex-1 items-center gap-3 text-left outline-none","aria-expanded":s,children:[n.jsx(ce,{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}),a&&n.jsx("div",{className:"truncate text-xs text-muted-foreground",children:a})]}),n.jsx(Re,{size:16,className:Q("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(le,{size:12,className:"animate-spin"}):n.jsx(be,{size:14})})]}),s&&n.jsx(qe,{agent:t,home:e})]})}function qe(t){const e=k.c(17),{agent:s,home:o}=t,i=s.metadata?.ui;let r;e[0]!==i?(r=Z(i),e[0]=i,e[1]=r):r=e[1];const a=r;let d;e[2]!==s.connections?(d=(s.connections??[]).map(Us).sort(),e[2]=s.connections,e[3]=d):d=e[3];const l=d,m=s.metadata?.ui?.homePrompts;let c;e[4]!==s||e[5]!==l||e[6]!==o||e[7]!==a?(c=n.jsx(Vs,{agent:s,home:o,connectionIds:l,pinnedTiles:a}),e[4]=s,e[5]=l,e[6]=o,e[7]=a,e[8]=c):c=e[8];let u;e[9]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(Bs,{}),e[9]=u):u=e[9];const f=m??null;let p;e[10]!==s||e[11]!==o||e[12]!==f?(p=n.jsx(A.Suspense,{fallback:u,children:n.jsx(Qs,{agent:s,home:o,curated:f})}),e[10]=s,e[11]=o,e[12]=f,e[13]=p):p=e[13];let h;return e[14]!==c||e[15]!==p?(h=n.jsxs("div",{className:"border-t border-border px-3 py-2 flex flex-col gap-3",children:[c,p]}),e[14]=c,e[15]=p,e[16]=h):h=e[16],h}function Us(t){return t.connection_id}function Bs(){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(V,{className:"h-8 w-full"}),n.jsx(V,{className:"h-8 w-2/3"})]}),t[0]=e):e=t[0],e}function Vs({agent:t,home:e,connectionIds:s,pinnedTiles:o}){const i=Be(),{data:r,isLoading:a}=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}),p=(f?.tools??[]).flatMap(h=>{const g=Fe(h._meta);return g?[{name:h.name,description:h.description,resourceUri:g,inputSchema:h.inputSchema}]:[]});return{id:u,title:f?.title??u,icon:f?.icon??null,uiTools:p}}catch{return{id:u,title:u,icon:null,uiTools:[]}}}))).filter(u=>u.uiTools.length>0)});if(s.length===0)return null;if(a)return n.jsxs("div",{className:"flex flex-col gap-1 py-0.5",children:[n.jsx(V,{className:"h-7 w-full"}),n.jsx(V,{className:"h-7 w-2/3"})]});if(!r||r.length===0)return null;const d=new Map;for(const c of r)for(const u of c.uiTools)d.set(`${c.id}:${u.name}`,{conn:c,tool:u});const l=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=o.some(c=>!!l(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"}),o.map(c=>{const u=l(c);return u?n.jsx(qs,{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"}),r.map(c=>c.uiTools.map(u=>n.jsx(Gs,{agent:t,home:e,connection:c,tool:u},`add:${c.id}:${u.name}`)))]})]})}function Ge(t,e){const s={};for(const[o,i]of Object.entries(t)){const r=e[o]?.type;if((r==="object"||r==="array")&&typeof i=="string"){if(!i.trim())continue;try{s[o]=JSON.parse(i)}catch{return null}}else if((r==="number"||r==="integer")&&typeof i=="string"){if(!i.trim())continue;s[o]=Number(i)}else i!==""&&i!=null&&(s[o]=i)}return s}function Ks(t,e){if(!t||!e)return{};const s={};for(const[o,i]of Object.entries(t)){const r=e[o]?.type;(r==="object"||r==="array")&&i!=null&&typeof i!="string"?s[o]=JSON.stringify(i,null,2):s[o]=i}return s}function Ws(t){if(!t)return"";const e=Object.entries(t).filter(([,s])=>s!=null&&s!=="");return e.length===0?"":e.slice(0,3).map(([s,o])=>{const i=typeof o=="object"?JSON.stringify(o):String(o);return`${s}=${i.length>20?`${i.slice(0,20)}…`:i}`}).join(", ")}function qs({agent:t,home:e,connection:s,tool:o,tile:i}){const[r,a]=A.useState(!1),[d,l]=A.useState(!1),m=o.inputSchema?.properties&&Object.keys(o.inputSchema.properties).length>0,[c,u]=A.useState(()=>Ks(i.toolInput,o.inputSchema?.properties)),f=async()=>{a(!0);try{const g=Z(t.metadata?.ui),b=i.tileId?g.filter(N=>N.tileId!==i.tileId):g.filter(N=>N!==i),y={...t.metadata??{},ui:{...t.metadata?.ui??{},homeTile:null,homeTiles:b}};await e.saveAgentMetadata(t,y),l(!1)}catch(g){console.error("[home-tiles] failed to remove tile",g),K.error("Couldn't update home — please try again.")}finally{a(!1)}},p=async()=>{a(!0);try{let g;if(m&&o.inputSchema?.properties){const v=Ge(c,o.inputSchema.properties);if(!v){K.error("Invalid JSON in one of the fields — please fix it."),a(!1);return}Object.keys(v).length>0&&(g=v)}const y=Z(t.metadata?.ui).map(v=>(i.tileId?v.tileId===i.tileId:v===i)?{...v,toolInput:g}:v),N={...t.metadata??{},ui:{...t.metadata?.ui??{},homeTile:null,homeTiles:y}};await e.saveAgentMetadata(t,N),l(!1)}catch(g){console.error("[home-tiles] failed to save tile",g),K.error("Couldn't update home — please try again.")}finally{a(!1)}},h=Ws(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(Ue,{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:ve(o.name)}),h&&n.jsx("div",{className:"truncate text-[10px] text-muted-foreground font-mono",children:h})]}),m&&n.jsx("button",{type:"button",onClick:()=>l(g=>!g),"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(jt,{size:14})}),n.jsx(Ne,{isPinned:!0,submitting:r,onClick:f,label:"Remove from home"})]}),d&&m&&o.inputSchema?.properties&&n.jsxs("div",{className:"px-3 pb-2 pt-1 flex flex-col gap-2",children:[n.jsx(Ve,{properties:o.inputSchema.properties,required:o.inputSchema.required,values:c,onChange:(g,b)=>u(y=>({...y,[g]:b}))}),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:()=>l(!1),children:"Cancel"}),n.jsx(Y,{size:"sm",className:"h-7 text-xs",disabled:r,onClick:p,children:r?n.jsx(le,{size:12,className:"animate-spin"}):"Save"})]})]})]})}function Gs({agent:t,home:e,connection:s,tool:o}){const[i,r]=A.useState(!1),[a,d]=A.useState(!1),l=o.inputSchema?.properties&&Object.keys(o.inputSchema.properties).length>0,[m,c]=A.useState({}),u=async()=>{if(l&&!a){d(!0);return}if(!e.isOnHome(t.id)&&e.atLimit){K.error(`Home is full (${ne}) — remove an agent first`);return}await f()},f=async()=>{r(!0);try{let p;if(l&&o.inputSchema?.properties){const y=Ge(m,o.inputSchema.properties);if(!y){K.error("Invalid JSON in one of the fields — please fix it."),r(!1);return}Object.keys(y).length>0&&(p=y)}const g=[...Z(t.metadata?.ui),{tileId:crypto.randomUUID(),connectionId:s.id,resourceUri:o.resourceUri,toolName:o.name,...p?{toolInput:p}:{}}],b={...t.metadata??{},ui:{...t.metadata?.ui??{},homeTile:null,homeTiles:g}};await e.saveAgentMetadata(t,b),d(!1),c({})}catch(p){console.error("[home-tiles] failed to add tile",p),K.error("Couldn't update home — please try again.")}finally{r(!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(Ue,{icon:s.icon,name:s.title,size:"xs"}),n.jsx("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:ve(o.name)}),n.jsx(Ne,{isPinned:!1,submitting:i,onClick:u,label:"Add to home"})]}),a&&l&&o.inputSchema?.properties&&n.jsxs("div",{className:"px-3 pb-2 pt-1 flex flex-col gap-2",children:[n.jsx(Ve,{properties:o.inputSchema.properties,required:o.inputSchema.required,values:m,onChange:(p,h)=>c(g=>({...g,[p]:h}))}),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(le,{size:12,className:"animate-spin"}):"Pin"})]})]})]})}function Ne(t){const e=k.c(11),{isPinned:s,submitting:o,onClick:i,label:r}=t,a=s?"text-muted-foreground hover:bg-destructive/10 hover:text-destructive":"bg-foreground text-background hover:opacity-90";let d;e[0]!==a?(d=Q("inline-flex size-7 shrink-0 items-center justify-center rounded-md text-xs transition-colors disabled:opacity-50 disabled:cursor-progress",a),e[0]=a,e[1]=d):d=e[1];let l;e[2]!==s||e[3]!==o?(l=o?n.jsx(le,{size:12,className:"animate-spin"}):s?n.jsx(vt,{size:14}):n.jsx(be,{size:14}),e[2]=s,e[3]=o,e[4]=l):l=e[4];let m;return e[5]!==r||e[6]!==i||e[7]!==o||e[8]!==d||e[9]!==l?(m=n.jsx("button",{type:"button",onClick:i,disabled:o,"aria-label":r,title:r,className:d,children:l}),e[5]=r,e[6]=i,e[7]=o,e[8]=d,e[9]=l,e[10]=m):m=e[10],m}function Qs(t){const e=k.c(32),{agent:s,home:o,curated:i}=t,{org:r}=J();let a;e[0]!==s.id||e[1]!==r.id||e[2]!==r.slug?(a={connectionId:s.id,orgId:r.id,orgSlug:r.slug},e[0]=s.id,e[1]=r.id,e[2]=r.slug,e[3]=a):a=e[3];const d=ae(a);let l;e[4]!==s.id||e[5]!==r.id?(l=te.agentPrompts(r.id,s.id),e[4]=s.id,e[5]=r.id,e[6]=l):l=e[6];let m;e[7]!==d?(m=async()=>{const{prompts:x}=await d.listPrompts();return x.map(Ys)},e[7]=d,e[8]=m):m=e[8];let c;e[9]!==l||e[10]!==m?(c={queryKey:l,queryFn:m,staleTime:3e4,retry:!1},e[9]=l,e[10]=m,e[11]=c):c=e[11];const{data:u,isLoading:f,error:p}=se(c),h=je(r.slug);let g,b;if(e[12]!==s.id||e[13]!==u||e[14]!==h.prompts){let x;e[17]!==s.id?(x=S=>S.agentId===s.id&&S.promptName,e[17]=s.id,e[18]=x):x=e[18],g=h.prompts.filter(x).map(Zs);let w;e[19]!==u?(w=u??[],e[19]=u,e[20]=w):w=e[20],b=[...w];for(const S of g)b.some(T=>T.name===S.name)||b.push(S);e[12]=s.id,e[13]=u,e[14]=h.prompts,e[15]=g,e[16]=b}else g=e[15],b=e[16];if(f&&g.length===0){let x;return e[21]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx(V,{className:"h-7 w-full"}),n.jsx(V,{className:"h-7 w-2/3"})]}),e[21]=x):x=e[21],x}if(p&&g.length===0)return console.error("[home-tiles] listPrompts failed for agent",s.id,p),null;if(b.length===0)return null;let y;e[22]!==i||e[23]!==b?(y=i??b.map(Xs),e[22]=i,e[23]=b,e[24]=y):y=e[24];let N;e[25]!==y?(N=new Set(y),e[25]=y,e[26]=N):N=e[26];const v=N;let j;return e[27]!==s||e[28]!==o||e[29]!==b||e[30]!==v?(j=n.jsx("div",{className:"flex flex-col gap-0.5",children:b.map(x=>n.jsx(en,{agent:s,home:o,prompt:x,allPromptNames:b.map(Js),isPinned:v.has(x.name)},x.name))}),e[27]=s,e[28]=o,e[29]=b,e[30]=v,e[31]=j):j=e[31],j}function Js(t){return t.name}function Xs(t){return t.name}function Zs(t){return{name:t.promptName,title:t.title,description:t.description}}function Ys(t){return{name:t.name,title:t.title,description:t.description}}function en({agent:t,home:e,prompt:s,allPromptNames:o,isPinned:i}){const[r,a]=A.useState(!1),d=async()=>{if(!i&&!e.isOnHome(t.id)&&e.atLimit){K.error(`Home is full (${ne}) — remove an agent first`);return}a(!0);try{const l=t.metadata?.ui?.homePrompts;let m;Array.isArray(l)?m=i?l.filter(u=>u!==s.name):[...l,s.name]:m=i?o.filter(u=>u!==s.name):o;const c={...t.metadata??{},ui:{...t.metadata?.ui??{},homePrompts:m}};await e.saveAgentMetadata(t,c)}catch(l){console.error("[home-tiles] failed to toggle prompt",l),K.error("Couldn't update home — please try again.")}finally{a(!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??ve(s.name)}),n.jsx(Ne,{isPinned:i,submitting:r,onClick:d,label:i?"Remove from home":"Add to home"})]})}function tn(){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},sn)}),t[0]=e):e=t[0],e}function sn(t,e){return n.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-border p-2.5",children:[n.jsx(V,{className:"size-8 rounded-md"}),n.jsxs("div",{className:"flex-1 space-y-1.5",children:[n.jsx(V,{className:"h-3 w-1/2"}),n.jsx(V,{className:"h-2.5 w-1/3"})]})]},e)}const ee=1,Qe=`home-board.layout.v${ee}`;function Je(t){return`home-board.layout.v${ee}.${t}`}const Xe={version:ee,tiles:{},hidden:[]};function fe(t){return!t||t.version!==ee?Xe:{version:ee,tiles:t.tiles??{},hidden:Array.isArray(t.hidden)?t.hidden:[]}}function nn(t){return Object.keys(t.tiles).length>0||t.hidden.length>0}function on(t){try{const e=localStorage.getItem(Je(t));return e?fe(JSON.parse(e)):void 0}catch{return}}function Ce(t,e){try{localStorage.setItem(Je(t),JSON.stringify(e))}catch{}}async function Ie(t,e){if(!(await fetch(`/api/${t}/kv/${Qe}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok)throw new Error("Failed to save board layout")}function rn(t){const e=k.c(24),s=xe();let o;e[0]!==t?(o=te.boardLayout(t),e[0]=t,e[1]=o):o=e[1];const i=o;let r;e[2]!==t?(r=on(t),e[2]=t,e[3]=r):r=e[3];const a=r;let d;e[4]!==a||e[5]!==t?(d=async()=>{const y=await fetch(`/api/${t}/kv/${Qe}`);if(y.status===404)return a&&nn(a)?(await Ie(t,a),a):Xe;if(!y.ok)throw new Error("Failed to load board layout");const N=await y.json(),v=fe(N.value);return Ce(t,v),v},e[4]=a,e[5]=t,e[6]=d):d=e[6];let l;e[7]!==a||e[8]!==i||e[9]!==d?(l={queryKey:i,queryFn:d,initialData:a,staleTime:0,refetchOnWindowFocus:!1},e[7]=a,e[8]=i,e[9]=d,e[10]=l):l=e[10];const{data:m,isLoading:c}=se(l);let u;e[11]!==t?(u={mutationFn:y=>Ie(t,y)},e[11]=t,e[12]=u):u=e[12];const f=nt(u);let p;e[13]!==f||e[14]!==t||e[15]!==s||e[16]!==i?(p=y=>{Ce(t,y),s.setQueryData(i,y),f.mutate(y)},e[13]=f,e[14]=t,e[15]=s,e[16]=i,e[17]=p):p=e[17];const h=p;let g;e[18]!==m?(g=fe(m),e[18]=m,e[19]=g):g=e[19];let b;return e[20]!==c||e[21]!==h||e[22]!==g?(b={layout:g,isLoading:c,save:h},e[20]=c,e[21]=h,e[22]=g,e[23]=b):b=e[23],b}const Ze=A.createContext(null);function ln(t){const e=k.c(24),{children:s}=t,{org:o}=J(),i=rn(o.slug),[r,a]=A.useState(!1),[d,l]=A.useState(null);let m;e[0]!==i.layout?(m=()=>{l(i.layout),a(!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=()=>{l(null),a(!1)},e[2]=u):u=e[2];const f=u;let p;e[3]!==d||e[4]!==i?(p=()=>{d&&i.save(d),l(null),a(!1)},e[3]=d,e[4]=i,e[5]=p):p=e[5];const h=p,g=r&&d!==null,b=g?d:i.layout;let y;e[6]!==d||e[7]!==g||e[8]!==i.layout?(y=g?JSON.stringify(d)!==JSON.stringify(i.layout):!1,e[6]=d,e[7]=g,e[8]=i.layout,e[9]=y):y=e[9];const N=y;let v;e[10]!==r||e[11]!==i?(v=S=>{r?l(S):i.save(S)},e[10]=r,e[11]=i,e[12]=v):v=e[12];const j=v;let x;e[13]!==j||e[14]!==c||e[15]!==N||e[16]!==r||e[17]!==b||e[18]!==h||e[19]!==i.isLoading?(x={isEditMode:r,enter:c,cancel:f,save:h,hasChanges:N,layout:b,isLayoutLoading:i.isLoading,commitLayout:j},e[13]=j,e[14]=c,e[15]=N,e[16]=r,e[17]=b,e[18]=h,e[19]=i.isLoading,e[20]=x):x=e[20];let w;return e[21]!==s||e[22]!==x?(w=n.jsx(Ze.Provider,{value:x,children:s}),e[21]=s,e[22]=x,e[23]=w):w=e[23],w}function Ye(){const t=A.useContext(Ze);if(!t)throw new Error("useHomeEdit must be used within a HomeEditProvider");return t}function an({agentId:t}){const{org:e,locator:s}=J(),o=ae({connectionId:t,orgId:e.id,orgSlug:e.slug}),{create:i}=us(),{setTaskId:r}=Kt(),[a,d]=A.useState(null),[l,m]=A.useState(!1),c=A.useRef(!1),u=async(b,y)=>{if(!o){K.error("MCP client not available");return}if(!c.current){c.current=!0,m(!0);try{const N=await ms(o,b.name,y),v={type:"doc",content:[{type:"paragraph",content:[Qt({id:b.name,name:Jt(b.name,Xt(b._meta)),metadata:N.messages,char:"/",kind:"prompt",args:y}),{type:"text",text:" "}]}]},j=crypto.randomUUID();fs(sessionStorage,s,j,{tiptapDoc:v}),await i({id:j,virtual_mcp_id:t}),r(j,t,{autosend:!0})}catch(N){console.error("[start-thread-from-prompt] failed",N),K.error("Failed to start thread. Please try again.")}finally{c.current=!1,m(!1)}}},f=async b=>{if(!c.current){if(b.arguments&&b.arguments.length>0){d(b);return}await u(b)}},p=async b=>{if(!a)return;const y=a;d(null),await u(y,b)};return{start:f,startBlank:async b=>{if(!c.current){c.current=!0,m(!0);try{const y=crypto.randomUUID();await i({id:y,virtual_mcp_id:t}),r(y,t,b?.main?{main:b.main}:void 0)}catch(y){console.error("[start-thread-from-prompt] startBlank failed",y),K.error("Failed to start thread. Please try again.")}finally{c.current=!1,m(!1)}}},dialog:n.jsx(Gt,{prompt:a,setPrompt:b=>d(b),onSubmit:p}),dialogPrompt:a,starting:l}}const q=4,G=100,Te=12,cn=5,dn={w:2,h:2};class pe extends A.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(it,{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 mn(t){const e=k.c(72),{tiles:s,isEditMode:o,renderTile:i,onMove:r,onResize:a,onRemove:d}=t,l=ge(),m=A.useRef(null),[c,u]=A.useState(null),[f,p]=A.useState(null);let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h={activationConstraint:{distance:4}},e[0]=h):h=e[0];const g=Me(oe(ze,h),oe(Ee)),b=s.reduce(un,0),y=o?Math.max(b+2,4):Math.max(b,1);let N;e[1]===Symbol.for("react.memo_cache_sentinel")?(N=()=>{const $=m.current?.getBoundingClientRect();return $?{cellWidth:$.width/q,cellHeight:G}:null},e[1]=N):N=e[1];const v=N;let j;e[2]===Symbol.for("react.memo_cache_sentinel")?(j=$=>{u(String($.active.id)),p(v())},e[2]=j):j=e[2];const x=j;let w;e[3]!==f||e[4]!==r||e[5]!==s?(w=$=>{const R=String($.active.id),O=f??v();if(u(null),p(null),!O||O.cellWidth<=0)return;const M=s.find(W=>W.id===R);if(!M)return;const F=Math.round($.delta.x/O.cellWidth),B=Math.round($.delta.y/O.cellHeight);F===0&&B===0||r(R,{x:M.x+F,y:M.y+B})},e[3]=f,e[4]=r,e[5]=s,e[6]=w):w=e[6];const S=w;if(l){let $;if(e[7]!==i||e[8]!==s){let O;e[10]!==i?(O=M=>n.jsx("div",{className:"group bg-card card-shadow rounded-2xl overflow-hidden",style:{minHeight:G},children:n.jsx(pe,{children:i(M)})},M.id),e[10]=i,e[11]=O):O=e[11],$=s.map(O),e[7]=i,e[8]=s,e[9]=$}else $=e[9];let R;return e[12]!==$?(R=n.jsx("div",{className:"flex flex-col gap-3 px-4 pb-8",children:$}),e[12]=$,e[13]=R):R=e[13],R}let T,_,C,I,P,E,z,H,L;if(e[14]!==c||e[15]!==f||e[16]!==o||e[17]!==S||e[18]!==d||e[19]!==a||e[20]!==i||e[21]!==g||e[22]!==s||e[23]!==y){const $=c?s.find(X=>X.id===c):null;_=Le,H=g,L=x,C=S;const R=y*G,O=o?G*4:G;let M;e[33]!==R||e[34]!==O?(M={height:R,minHeight:O},e[33]=R,e[34]=O,e[35]=M):M=e[35];let F;e[36]!==o||e[37]!==s||e[38]!==y?(F=o&&n.jsx(fn,{rows:y,tiles:s}),e[36]=o,e[37]=s,e[38]=y,e[39]=F):F=e[39];let B;if(e[40]!==c||e[41]!==o||e[42]!==d||e[43]!==a||e[44]!==i||e[45]!==s){let X;e[47]!==c||e[48]!==o||e[49]!==d||e[50]!==a||e[51]!==i?(X=ie=>n.jsx(hn,{tile:ie,isEditMode:o,isDragging:c===ie.id,onResize:a,onRemove:d,children:i(ie)},ie.id),e[47]=c,e[48]=o,e[49]=d,e[50]=a,e[51]=i,e[52]=X):X=e[52],B=s.map(X),e[40]=c,e[41]=o,e[42]=d,e[43]=a,e[44]=i,e[45]=s,e[46]=B}else B=e[46];e[53]!==M||e[54]!==F||e[55]!==B?(I=n.jsxs("div",{ref:m,className:"relative w-full",style:M,children:[F,B]}),e[53]=M,e[54]=F,e[55]=B,e[56]=I):I=e[56],T=Pt,P=null;const W=$&&f?$.w*f.cellWidth-Te:void 0,de=$&&f?$.h*f.cellHeight-Te:void 0;e[57]!==W||e[58]!==de?(E={width:W,height:de},e[57]=W,e[58]=de,e[59]=E):E=e[59],z=$&&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(pe,{children:i($)})}),e[14]=c,e[15]=f,e[16]=o,e[17]=S,e[18]=d,e[19]=a,e[20]=i,e[21]=g,e[22]=s,e[23]=y,e[24]=T,e[25]=_,e[26]=C,e[27]=I,e[28]=P,e[29]=E,e[30]=z,e[31]=H,e[32]=L}else T=e[24],_=e[25],C=e[26],I=e[27],P=e[28],E=e[29],z=e[30],H=e[31],L=e[32];let D;e[60]!==T||e[61]!==P||e[62]!==E||e[63]!==z?(D=n.jsx(T,{dropAnimation:P,style:E,children:z}),e[60]=T,e[61]=P,e[62]=E,e[63]=z,e[64]=D):D=e[64];let U;return e[65]!==_||e[66]!==C||e[67]!==I||e[68]!==D||e[69]!==H||e[70]!==L?(U=n.jsxs(_,{sensors:H,onDragStart:L,onDragEnd:C,children:[I,D]}),e[65]=_,e[66]=C,e[67]=I,e[68]=D,e[69]=H,e[70]=L,e[71]=U):U=e[71],U}function un(t,e){return Math.max(t,e.y+e.h)}function fn(t){const e=k.c(7),{rows:s,tiles:o}=t;let i;e[0]!==o?(i=(l,m)=>o.some(c=>l>=c.x&&l<c.x+c.w&&m>=c.y&&m<c.y+c.h),e[0]=o,e[1]=i):i=e[1];const r=i;let a;if(e[2]!==r||e[3]!==s){a=[];for(let l=0;l<s;l++)for(let m=0;m<q;m++)r(m,l)||a.push({x:m,y:l});e[2]=r,e[3]=s,e[4]=a}else a=e[4];let d;return e[5]!==a?(d=n.jsx("div",{className:"absolute inset-0 pointer-events-none",children:a.map(pn)}),e[5]=a,e[6]=d):d=e[6],d}function pn(t){return n.jsx("div",{className:"absolute p-1",style:{left:`${t.x/q*100}%`,top:t.y*G,width:`${1/q*100}%`,height:G},children:n.jsx("div",{className:"h-full w-full rounded-2xl border border-dashed border-border/60"})},`${t.x}-${t.y}`)}function hn(t){const e=k.c(31),{tile:s,isEditMode:o,isDragging:i,onResize:r,onRemove:a,children:d}=t,l=!o;let m;e[0]!==l||e[1]!==s.id?(m={id:s.id,disabled:l},e[0]=l,e[1]=s.id,e[2]=m):m=e[2];const{setNodeRef:c,attributes:u,listeners:f,isDragging:p}=Mt(m),h=`${s.x/q*100}%`,g=`${s.w/q*100}%`,b=s.y*G,y=s.h*G,N=p||i,v=!N&&"transition-[left,top,width,height,opacity] duration-200 ease-out",j=N&&"opacity-30";let x;e[3]!==v||e[4]!==j?(x=Q("absolute p-1 will-change-[left,top,width,height,opacity]",v,j),e[3]=v,e[4]=j,e[5]=x):x=e[5];let w;e[6]!==y||e[7]!==h||e[8]!==b||e[9]!==g?(w={left:h,top:b,width:g,height:y},e[6]=y,e[7]=h,e[8]=b,e[9]=g,e[10]=w):w=e[10];const S=o&&"outline outline-1 outline-transparent hover:outline-primary/40";let T;e[11]!==S?(T=Q("group relative h-full bg-card card-shadow rounded-2xl overflow-hidden",S),e[11]=S,e[12]=T):T=e[12];let _;e[13]!==u||e[14]!==o||e[15]!==f||e[16]!==a||e[17]!==r||e[18]!==s?(_=o&&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(Pe,{size:16})}),n.jsx("div",{className:"absolute top-2 right-2 z-10 flex items-center gap-1",children:n.jsx(xn,{tile:s,onResize:r,onRemove:a})})]}),e[13]=u,e[14]=o,e[15]=f,e[16]=a,e[17]=r,e[18]=s,e[19]=_):_=e[19];let C;e[20]!==d?(C=n.jsx("div",{className:"h-full overflow-hidden",children:n.jsx(pe,{children:d})}),e[20]=d,e[21]=C):C=e[21];let I;e[22]!==C||e[23]!==T||e[24]!==_?(I=n.jsxs("div",{className:T,children:[_,C]}),e[22]=C,e[23]=T,e[24]=_,e[25]=I):I=e[25];let P;return e[26]!==c||e[27]!==I||e[28]!==x||e[29]!==w?(P=n.jsx("div",{ref:c,className:x,style:w,children:I}),e[26]=c,e[27]=I,e[28]=x,e[29]=w,e[30]=P):P=e[30],P}function xn(t){const e=k.c(20),{tile:s,onResize:o,onRemove:i}=t,[r,a]=A.useState(!1);let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(ps,{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(Nt,{size:16})})}),e[0]=d):d=e[0];let l;e[1]!==o||e[2]!==s.id?(l=b=>{o(s.id,b),a(!1)},e[1]=o,e[2]=s.id,e[3]=l):l=e[3];let m;e[4]!==l||e[5]!==s?(m=n.jsx(gn,{tile:s,onPick:l}),e[4]=l,e[5]=s,e[6]=m):m=e[6];let c;e[7]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(hs,{}),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(ys,{size:14,className:"mr-2"}),e[11]=f):f=e[11];let p;e[12]!==u?(p=n.jsxs(xs,{onSelect:u,className:"text-destructive focus:text-destructive",children:[f,"Remove tile"]}),e[12]=u,e[13]=p):p=e[13];let h;e[14]!==m||e[15]!==p?(h=n.jsxs(gs,{align:"end",className:"w-auto",children:[m,c,p]}),e[14]=m,e[15]=p,e[16]=h):h=e[16];let g;return e[17]!==r||e[18]!==h?(g=n.jsxs(bs,{open:r,onOpenChange:a,children:[d,h]}),e[17]=r,e[18]=h,e[19]=g):g=e[19],g}function gn(t){const e=k.c(19),{tile:s,onPick:o}=t,i=s.minW??1,r=s.minH??1,[a,d]=A.useState(null);let l;e[0]!==a||e[1]!==s.h||e[2]!==s.w?(l=a??{w:s.w,h:s.h},e[0]=a,e[1]=s.h,e[2]=s.w,e[3]=l):l=e[3];const m=l;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,p;e[8]===Symbol.for("react.memo_cache_sentinel")?(f={gridTemplateColumns:`repeat(${q}, 1.25rem)`},p=()=>d(null),e[8]=f,e[9]=p):(f=e[8],p=e[9]);let h;e[10]!==m.h||e[11]!==m.w||e[12]!==r||e[13]!==i||e[14]!==o?(h=n.jsx("div",{className:"grid w-max gap-1",style:f,onPointerLeave:p,children:Array.from({length:cn},(b,y)=>Array.from({length:q},(N,v)=>{const j=v+1,x=y+1,w=j<i||x<r,S=j<=m.w&&x<=m.h;return n.jsx("button",{type:"button",disabled:w,"aria-label":`${j} by ${x}`,onPointerEnter:()=>d({w:j,h:x}),onClick:()=>o({w:j,h:x}),className:Q("size-5 rounded-sm border transition-colors",S?"border-primary bg-primary/30":"border-border bg-muted",w?"cursor-not-allowed opacity-40":"cursor-pointer hover:border-primary/60")},`${j}x${x}`)}))}),e[10]=m.h,e[11]=m.w,e[12]=r,e[13]=i,e[14]=o,e[15]=h):h=e[15];let g;return e[16]!==u||e[17]!==h?(g=n.jsxs("div",{className:"px-2 py-1.5",children:[u,h]}),e[16]=u,e[17]=h,e[18]=g):g=e[18],g}function bn(t,e,s){return t.some(o=>e>=o.x&&e<o.x+o.w&&s>=o.y&&s<o.y+o.h)}function he(t,e,s){for(let o=0;o<100;o++)for(let i=0;i<=q-e;i++){let r=!0;for(let a=0;a<s&&r;a++)for(let d=0;d<e&&r;d++)bn(t,i+d,o+a)&&(r=!1);if(r)return{x:i,y:o}}return{x:0,y:0}}function me(t,e,s={w:1,h:1}){const o=Math.max(s.w,Math.min(q,t)),i=Math.max(s.h,Math.min(6,e));return{w:o,h:i}}function ue(t,e,s){const o=Math.max(0,Math.min(q-s,t)),i=Math.max(0,e);return{x:o,y:i}}function yn(t,e,s){const o=t.find(l=>l.id===e);if(!o)return t;const i=t.filter(l=>l.id!==e),r=i.find(l=>s.x>=l.x&&s.x<l.x+l.w&&s.y>=l.y&&s.y<l.y+l.h);if(r&&r.w===o.w&&r.h===o.h)return t.map(l=>l.id===e?{...l,x:r.x,y:r.y}:l.id===r.id?{...l,x:o.x,y:o.y}:l);const d=[{...o,x:s.x,y:s.y}];for(const l of i){const m=he(d,l.w,l.h);d.push({...l,x:m.x,y:m.y})}return d}function jn(t){const e=k.c(35),{layout:s,isLayoutLoading:o,commitLayout:i}=Ye();let r;e[0]!==s.hidden?(r=new Set(s.hidden),e[0]=s.hidden,e[1]=r):r=e[1];const a=r;let d,l;if(e[2]!==t||e[3]!==a||e[4]!==s.tiles){l=[];let N;e[7]!==a?(N=j=>j.pinned||!a.has(j.id),e[7]=a,e[8]=N):N=e[8];const v=t.filter(N);d=new Map;for(const j of t)j.minSize&&d.set(j.id,j.minSize);for(const j of v){const x=s.tiles[j.id];if(!x)continue;const w=d.get(j.id),{w:S,h:T}=me(x.w,x.h,w),{x:_,y:C}=ue(x.x,x.y,S);l.push({id:j.id,x:_,y:C,w:S,h:T,minW:w?.w,minH:w?.h})}for(const j of v){if(l.some(C=>C.id===j.id))continue;const x=j.defaultSize??dn,w=d.get(j.id),{w:S,h:T}=me(x.w,x.h,w),_=he(l,S,T);l.push({id:j.id,x:_.x,y:_.y,w:S,h:T,minW:w?.w,minH:w?.h})}e[2]=t,e[3]=a,e[4]=s.tiles,e[5]=d,e[6]=l}else d=e[5],l=e[6];let m;e[9]!==t?(m=new Set(t.map(vn)),e[9]=t,e[10]=m):m=e[10];const c=m;let u;e[11]!==c||e[12]!==i?(u=(N,v)=>{const j={};for(const x of N)j[x.id]={x:x.x,y:x.y,w:x.w,h:x.h};i({version:ee,tiles:j,hidden:v.filter(x=>c.has(x))})},e[11]=c,e[12]=i,e[13]=u):u=e[13];const f=u;let p;e[14]!==l?(p={visible:l},e[14]=l,e[15]=p):p=e[15];let h;e[16]!==f||e[17]!==s||e[18]!==l?(h=(N,v)=>{const j=l.find(S=>S.id===N);if(!j)return;const x=ue(v.x,v.y,j.w);if(x.x===j.x&&x.y===j.y)return;const w=yn(l,N,x);f(w,s.hidden)},e[16]=f,e[17]=s,e[18]=l,e[19]=h):h=e[19];let g;e[20]!==f||e[21]!==s||e[22]!==d||e[23]!==l?(g=(N,v)=>{const j=l.find(I=>I.id===N);if(!j)return;const x=d.get(N),{w,h:S}=me(v.w,v.h,x);if(w===j.w&&S===j.h)return;const T={...j,w,h:S,x:ue(j.x,j.y,w).x},_=l.filter(I=>I.id!==N),C=[T];for(const I of _){const P=he(C,I.w,I.h);C.push({...I,x:P.x,y:P.y})}f(C,s.hidden)},e[20]=f,e[21]=s,e[22]=d,e[23]=l,e[24]=g):g=e[24];let b;e[25]!==f||e[26]!==s||e[27]!==l?(b=N=>{const v=l.filter(j=>j.id!==N);f(v,Array.from(new Set([...s.hidden,N])))},e[25]=f,e[26]=s,e[27]=l,e[28]=b):b=e[28];let y;return e[29]!==o||e[30]!==p||e[31]!==h||e[32]!==g||e[33]!==b?(y={snapshot:p,isLoading:o,moveTile:h,resizeTile:g,hideTile:b},e[29]=o,e[30]=p,e[31]=h,e[32]=g,e[33]=b,e[34]=y):y=e[34],y}function vn(t){return t.id}const Nn={w:2,h:4},wn={w:1,h:2},Sn={w:1,h:1};function _n(t){return`prompt:${t.agentId}:${t.promptName||"blank"}`}function Cn(t){return t.tileId?`tile:${t.tileId}`:`tile:${t.agentId}:${t.resourceUri}`}function In(t){return t.promptName?t.agentName:t.description}function Tn(t){return{name:t.promptName,title:t.title,description:t.description,arguments:t.arguments,_meta:t._meta}}function et(t){const e=k.c(14),{org:s}=J();let o;e[0]!==s.id||e[1]!==s.slug||e[2]!==t.connectionId?(o=dt({connectionId:t.connectionId,orgId:s.id,orgSlug:s.slug}),e[0]=s.id,e[1]=s.slug,e[2]=t.connectionId,e[3]=o):o=e[3];const{data:i}=se(o),r=!!i&&!t.toolName;let a;e[4]!==i||e[5]!==r?(a={client:i,enabled:r},e[4]=i,e[5]=r,e[6]=a):a=e[6];const{data:d}=cs(a);let l;e[7]!==t.resourceUri||e[8]!==t.toolName||e[9]!==d?.tools?(l=t.toolName??d?.tools.find(u=>Fe(u._meta)===t.resourceUri)?.name,e[7]=t.resourceUri,e[8]=t.toolName,e[9]=d?.tools,e[10]=l):l=e[10];const m=l;let c;return e[11]!==t.connectionId||e[12]!==m?(c=m?Lt(t.connectionId,m):void 0,e[11]=t.connectionId,e[12]=m,e[13]=c):c=e[13],c}function we(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:o,startBlank:i,dialog:r,starting:a}=an(s);let d;e[2]!==o||e[3]!==i?(d=c=>{if(!c.promptName){i();return}o(Tn(c))},e[2]=o,e[3]=i,e[4]=d):d=e[4];const l=d;let m;return e[5]!==r||e[6]!==l||e[7]!==i||e[8]!==a?(m={open:l,startBlank:i,dialog:r,starting:a},e[5]=r,e[6]=l,e[7]=i,e[8]=a,e[9]=m):m=e[9],m}function kn(t){const e=k.c(32),{entry:s,isEditMode:o}=t,{open:i,dialog:r,starting:a}=we(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 l=a||o,m=!o&&"cursor-pointer transition-colors hover:bg-accent/40",c=o&&"cursor-default pl-12",u=a&&"opacity-60";let f;e[3]!==m||e[4]!==c||e[5]!==u?(f=Q("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 p;e[7]!==s.agentIcon||e[8]!==s.agentName?(p=n.jsx(ce,{icon:s.agentIcon,name:s.agentName,size:"sm+"}),e[7]=s.agentIcon,e[8]=s.agentName,e[9]=p):p=e[9];let h;e[10]!==s.title?(h=n.jsx("div",{className:"line-clamp-2 text-sm font-medium text-foreground leading-snug",children:s.title}),e[10]=s.title,e[11]=h):h=e[11];let g;e[12]!==s?(g=In(s),e[12]=s,e[13]=g):g=e[13];let b;e[14]!==g?(b=n.jsx("div",{className:"truncate text-xs text-muted-foreground mt-0.5",children:g}),e[14]=g,e[15]=b):b=e[15];let y;e[16]!==b||e[17]!==h?(y=n.jsxs("div",{className:"min-w-0 flex-1",children:[h,b]}),e[16]=b,e[17]=h,e[18]=y):y=e[18];let N;e[19]!==o?(N=!o&&n.jsx(ds,{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]=o,e[20]=N):N=e[20];let v;e[21]!==a||e[22]!==d||e[23]!==y||e[24]!==N||e[25]!==l||e[26]!==f||e[27]!==p?(v=n.jsxs("button",{type:"button",onClick:d,disabled:l,"aria-busy":a,className:f,children:[p,y,N]}),e[21]=a,e[22]=d,e[23]=y,e[24]=N,e[25]=l,e[26]=f,e[27]=p,e[28]=v):v=e[28];let j;return e[29]!==r||e[30]!==v?(j=n.jsxs(n.Fragment,{children:[v,r]}),e[29]=r,e[30]=v,e[31]=j):j=e[31],j}function $n(){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},An)}),t[0]=e):e=t[0],e}function An(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(V,{className:"size-10 rounded-xl"}),n.jsxs("div",{className:"flex-1 space-y-1.5",children:[n.jsx(V,{className:"h-3 w-2/3"}),n.jsx(V,{className:"h-2.5 w-1/3"})]})]},`chip-skeleton-${e}`)}function Pn(t){const e=k.c(17),{tile:s,prompts:o,isEditMode:i,tileWidth:r}=t,{org:a}=J(),{open:d,startBlank:l,dialog:m,starting:c}=we(s.agentId),u=o.filter(Mn),f=et(s),p="relative flex h-full w-full flex-col p-3";let h;e[0]!==i||e[1]!==f||e[2]!==l||e[3]!==c?(h=!i&&n.jsx("button",{type:"button",onClick:()=>{l(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]=l,e[3]=c,e[4]=h):h=e[4];const g="flex min-h-0 flex-1 gap-3 overflow-hidden";let b;e[5]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx(zn,{}),e[5]=b):b=e[5];let y;e[6]!==a.id||e[7]!==a.slug||e[8]!==s?(y=n.jsx("div",{className:"min-h-0 flex-1 overflow-hidden rounded-lg border border-border",children:n.jsx(A.Suspense,{fallback:b,children:n.jsx(En,{tile:s,orgId:a.id,orgSlug:a.slug})})}),e[6]=a.id,e[7]=a.slug,e[8]=s,e[9]=y):y=e[9];const N=u.length>0&&!i&&r>=2&&n.jsx("div",{className:"flex w-44 shrink-0 flex-col gap-2 overflow-hidden",children:u.map(x=>n.jsx("button",{type:"button",onClick:()=>d(x),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:x.title})},x.promptName))});let v;e[10]!==y||e[11]!==N?(v=n.jsxs("div",{className:g,children:[y,N]}),e[10]=y,e[11]=N,e[12]=v):v=e[12];let j;return e[13]!==m||e[14]!==h||e[15]!==v?(j=n.jsxs("div",{className:p,children:[h,v,m]}),e[13]=m,e[14]=h,e[15]=v,e[16]=j):j=e[16],j}function Mn(t){return!!t.promptName}function En(t){const e=k.c(13),{tile:s,orgId:o,orgSlug:i}=t;let r;e[0]!==o||e[1]!==i||e[2]!==s.connectionId?(r={connectionId:s.connectionId,orgId:o,orgSlug:i},e[0]=o,e[1]=i,e[2]=s.connectionId,e[3]=r):r=e[3];const a=ae(r),d=s.minHeight??200,l=s.maxHeight??4e3;let m;return e[4]!==a||e[5]!==o||e[6]!==i||e[7]!==d||e[8]!==l||e[9]!==s.connectionId||e[10]!==s.resourceUri||e[11]!==s.toolInput?(m=n.jsx(ns,{resourceURI:s.resourceUri,orgId:o,orgSlug:i,connectionId:s.connectionId,client:a,toolInput:s.toolInput,displayMode:"fullscreen",minHeight:d,maxHeight:l,className:"h-full"}),e[4]=a,e[5]=o,e[6]=i,e[7]=d,e[8]=l,e[9]=s.connectionId,e[10]=s.resourceUri,e[11]=s.toolInput,e[12]=m):m=e[12],m}function zn(){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(V,{className:"h-3 w-2/3"}),n.jsx(V,{className:"h-3 w-1/2"}),n.jsx(V,{className:"mt-1 h-full w-full rounded-md"})]}),t[0]=e):e=t[0],e}function Ln(t){const e=k.c(14),{icon:s,name:o}=t;let i;e[0]!==s||e[1]!==o?(i=n.jsx(ce,{icon:s,name:o,size:"sm+"}),e[0]=s,e[1]=o,e[2]=i):i=e[2];let r;e[3]!==o?(r=n.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:o}),e[3]=o,e[4]=r):r=e[4];let a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx("div",{className:"truncate text-xs text-muted-foreground",children:"Loading tile…"}),e[5]=a):a=e[5];let d;e[6]!==r?(d=n.jsxs("div",{className:"min-w-0 flex-1",children:[r,a]}),e[6]=r,e[7]=d):d=e[7];let l;e[8]!==i||e[9]!==d?(l=n.jsxs("div",{className:"flex items-center gap-2.5",children:[i,d]}),e[8]=i,e[9]=d,e[10]=l):l=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(V,{className:"h-3 w-3/4"}),n.jsx(V,{className:"h-3 w-1/2"}),n.jsx(V,{className:"h-3 w-2/3"})]}),e[11]=m):m=e[11];let c;return e[12]!==l?(c=n.jsxs("div",{className:"flex h-full w-full flex-col gap-3 p-5 opacity-60",children:[l,m]}),e[12]=l,e[13]=c):c=e[13],c}function On(t){const e=k.c(10),{tile:s,prompts:o,isEditMode:i}=t,{open:r,startBlank:a,dialog:d,starting:l}=we(s.agentId),m=o.filter(Dn),c=et(s),u="flex h-full w-full flex-col gap-3 p-4";let f;e[0]!==c||e[1]!==a?(f=()=>{a(c?{main:c}:void 0)},e[0]=c,e[1]=a,e[2]=f):f=e[2];const p=l||i;let h;e[3]!==f||e[4]!==p?(h=n.jsx("button",{type:"button",onClick:f,disabled:p,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]=p,e[5]=h):h=e[5];const g=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&&r(y),disabled:l,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 b;return e[6]!==d||e[7]!==h||e[8]!==g?(b=n.jsxs("div",{className:u,children:[h,g,d]}),e[6]=d,e[7]=h,e[8]=g,e[9]=b):b=e[9],b}function Dn(t){return!!t.promptName}function tt({isEditMode:t}){const{org:e}=J(),{isLoading:s,prompts:o,tiles:i}=je(e.slug),r=Oe()?.ids??[],a=new Set(r),d=De(),l=Be(),m=xe(),c=new Set(i.map(x=>x.agentId)),u=new Map;for(const x of o){const w=u.get(x.agentId);w?w.push(x):u.set(x.agentId,[x])}const f=o.filter(x=>!c.has(x.agentId)),p=[...i.map(x=>({kind:"tile",id:Cn(x),data:x})),...f.map(x=>({kind:"prompt",id:_n(x),data:x}))],h=new Map(p.map(x=>[x.id,x])),g=jn(p.map(x=>({id:x.id,defaultSize:x.kind==="tile"?Nn:Sn,minSize:x.kind==="tile"?wn:void 0,pinned:a.has(x.data.agentId)}))),b=x=>{d.apply(w=>w.filter(S=>S!==x)).catch(()=>K.error("Couldn't remove from home — please try again."))},y=async x=>{if(i.filter(S=>S.agentId===x.agentId).length<=1){b(x.agentId);return}try{const T=(await l.call("COLLECTION_VIRTUAL_MCP_GET",{id:x.agentId})).item;if(!T)throw new Error("Agent not found");const _=Z(T.metadata?.ui),C=x.tileId?_.filter(I=>I.tileId!==x.tileId):_.filter(I=>I.connectionId!==x.connectionId||I.resourceUri!==x.resourceUri);await l.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:x.agentId,data:{metadata:{...T.metadata??{},ui:{...T.metadata?.ui??{},homeTile:null,homeTiles:C}}}}),m.invalidateQueries({queryKey:te.homeNextActions(e.slug)})}catch{K.error("Couldn't remove tile — please try again.")}},N=x=>{const w=h.get(x);if(w){if(!a.has(w.data.agentId)){g.hideTile(x);return}w.kind==="tile"?y(w.data):b(w.data.agentId)}},v=x=>{const w=h.get(x.id);if(!w)return null;if(w.kind==="tile"){const S=u.get(w.data.agentId)??[];return n.jsx(ot,{fallback:n.jsx(On,{tile:w.data,prompts:S,isEditMode:t}),children:n.jsx(A.Suspense,{fallback:n.jsx(Ln,{icon:w.data.agentIcon,name:w.data.agentName}),children:n.jsx(Pn,{tile:w.data,prompts:S,isEditMode:t,tileWidth:x.w})})})}return n.jsx(kn,{entry:w.data,isEditMode:t})};return s||g.isLoading?n.jsx($n,{}):g.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(mn,{tiles:g.snapshot.visible,isEditMode:t,renderTile:v,onMove:g.moveTile,onResize:g.resizeTile,onRemove:N})})}function Hn(t){const e=k.c(2),{prompts:s,tiles:o}=je(t),i=o.length>0||s.length>0;let r;return e[0]!==i?(r={hasVisibleTiles:i},e[0]=i,e[1]=r):r=e[1],r}const ke=420,$e=305;function st(){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:ke}}),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:ke}}),t[1]=s):s=t[1];let o;t[2]===Symbol.for("react.memo_cache_sentinel")?(o=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:$e}}),t[2]=o):o=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,o,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:$e}})]}),t[3]=i):i=t[3],i}function Ae(){const t=k.c(33),{data:e}=rt.useSession(),{org:s}=J(),o=ge(),i=Ns(),{selectedVirtualMcp:r}=Dt();let a;t[0]!==s.id?(a=ut(s.id),t[0]=s.id,t[1]=a):a=t[1];const l=r??a;let m;t[2]!==s.slug?(m=Wt(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:ft,orgId:s.id,orgSlug:s.slug},t[4]=s.id,t[5]=s.slug,t[6]=c):c=t[6];const u=ae(c);let f;t[7]!==s.id||t[8]!==s.slug?(f=js(s.slug,s.id),t[7]=s.id,t[8]=s.slug,t[9]=f):f=t[9];let p;t[10]!==s.id||t[11]!==s.slug?(p=Vt(s.slug,s.id),t[10]=s.id,t[11]=s.slug,t[12]=p):p=t[12];let h;t[13]!==l.id||t[14]!==s.id||t[15]!==u?(h=xt(s.id,l.id,u),t[13]=l.id,t[14]=s.id,t[15]=u,t[16]=h):h=t[16];let g;t[17]!==f||t[18]!==p||t[19]!==h?(g={queries:[f,p,h]},t[17]=f,t[18]=p,t[19]=h,t[20]=g):g=t[20],ct(g);const b=vs(),y=gt(l.id),{hasDecoKey:N,isZeroBalance:v,isInitialFreeCredit:j,balanceDollars:x,hasOnlyDecoProvider:w}=Ft(),{hasVisibleTiles:S}=Hn(s.slug),T=Ut(y?.metadata);if(b.length===0&&!(T&&Bt(i))){let D;return t[21]===Symbol.for("react.memo_cache_sentinel")?(D=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(Ht,{})})}),t[21]=D):D=t[21],D}let C;t[22]!==e?.user?.name?(C=e?.user?.name?.split(" ")[0]||"there",t[22]=e?.user?.name,t[23]=C):C=t[23];const I=C,P=N&&j&&x!=null,E=N&&v&&w;let z;t[24]!==x||t[25]!==P||t[26]!==E?(z=P?n.jsx(re.CreditsEyebrow,{balanceDollars:x}):E?n.jsx(re.NoCreditsEyebrow,{}):null,t[24]=x,t[25]=P,t[26]=E,t[27]=z):z=t[27];const H=z;let L;return t[28]!==H||t[29]!==S||t[30]!==o||t[31]!==I?(L=n.jsx(ln,{children:o?n.jsx(Rn,{eyebrow:H,userName:I}):n.jsx(Fn,{eyebrow:H,userName:I,hasVisibleTiles:S})}),t[28]=H,t[29]=S,t[30]=o,t[31]=I,t[32]=L):L=t[32],L}function Rn(t){const e=k.c(12),{eyebrow:s,userName:o}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(st,{}),e[0]=i):i=e[0];let r;e[1]!==s?(r=s&&n.jsx("div",{className:"mb-4",children:s}),e[1]=s,e[2]=r):r=e[2];let a;e[3]!==o?(a=n.jsxs("p",{className:"text-3xl font-medium text-foreground text-center max-w-[280px]",children:["What's on your mind, ",o,"?"]}),e[3]=o,e[4]=a):a=e[4];let d;e[5]!==r||e[6]!==a?(d=n.jsxs("div",{className:"relative flex flex-col items-center justify-center w-full pt-28 pb-8 px-4",children:[r,a]}),e[5]=r,e[6]=a,e[7]=d):d=e[7];let l;e[8]===Symbol.for("react.memo_cache_sentinel")?(l=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]=l):l=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(tt,{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,l,m]}),e[10]=d,e[11]=c):c=e[11],c}function Fn(t){const e=k.c(54),{eyebrow:s,userName:o,hasVisibleTiles:i}=t,{isEditMode:r,enter:a,save:d,cancel:l,hasChanges:m}=Ye(),[c,u]=A.useState(!1),f=lt();let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p={strict:!1},e[0]=p):p=e[0];const{main:h}=at(p);let g;e[1]!==h?(g=h?Ot(h):null,e[1]=h,e[2]=g):g=e[2];const b=g,y=h==="files"||!!b;let N;e[3]!==f?(N=B=>f({to:".",search:W=>({...W,main:B}),replace:!0}),e[3]=f,e[4]=N):N=e[4];const v=N;let j;e[5]===Symbol.for("react.memo_cache_sentinel")?(j={kind:"component",Component:Se},e[5]=j):j=e[5];let x;e[6]!==y||e[7]!==v?(x=()=>v(y?void 0:"files"),e[6]=y,e[7]=v,e[8]=x):x=e[8];let w;e[9]!==y||e[10]!==x?(w=n.jsx(St,{title:"Library",icon:j,active:y,onClick:x}),e[9]=y,e[10]=x,e[11]=w):w=e[11];let S;e[12]===Symbol.for("react.memo_cache_sentinel")?(S=()=>u(!0),e[12]=S):S=e[12];let T;e[13]!==l||e[14]!==a||e[15]!==m||e[16]!==r||e[17]!==d?(T=n.jsx(Un,{isEditMode:r,hasChanges:m,onEnter:a,onSave:d,onCancel:l,onAddTile:S}),e[13]=l,e[14]=a,e[15]=m,e[16]=r,e[17]=d,e[18]=T):T=e[18];let _;e[19]!==w||e[20]!==T?(_=n.jsxs(ws.Right,{children:[w,T]}),e[19]=w,e[20]=T,e[21]=_):_=e[21];let C;e[22]!==c?(C=n.jsx(_s,{open:c,onOpenChange:u}),e[22]=c,e[23]=C):C=e[23];let I;e[24]===Symbol.for("react.memo_cache_sentinel")?(I=n.jsx(st,{}),e[24]=I):I=e[24];const P=i||r?"pt-32":"flex-1 justify-center";let E;e[25]!==P?(E=Q("relative flex flex-col items-center px-10 pb-4",P),e[25]=P,e[26]=E):E=e[26];let z;e[27]!==s?(z=s&&n.jsx("div",{className:"mb-4",children:s}),e[27]=s,e[28]=z):z=e[28];let H;e[29]!==o?(H=n.jsxs("p",{className:"text-3xl font-medium text-foreground",children:["What's on your mind, ",o,"?"]}),e[29]=o,e[30]=H):H=e[30];let L;e[31]!==z||e[32]!==H?(L=n.jsxs("div",{className:"text-center mb-10",children:[z,H]}),e[31]=z,e[32]=H,e[33]=L):L=e[33];let D;e[34]===Symbol.for("react.memo_cache_sentinel")?(D=n.jsxs("div",{className:"relative w-full",children:[n.jsx(Bn,{}),n.jsx(re.Input,{showConnectionsBanner:!0})]}),e[34]=D):D=e[34];let U;e[35]!==L?(U=n.jsxs("div",{className:"flex flex-col items-center w-full max-w-[672px]",children:[L,D]}),e[35]=L,e[36]=U):U=e[36];let $;e[37]!==r?($=n.jsx("div",{className:"relative w-full mt-10 mx-auto max-w-[1280px] px-2 pb-16",children:n.jsx(tt,{isEditMode:r})}),e[37]=r,e[38]=$):$=e[38];let R;e[39]!==E||e[40]!==U||e[41]!==$?(R=n.jsxs("div",{className:"flex-1 min-w-0 relative flex flex-col",children:[I,n.jsx("div",{className:"flex-1 relative flex flex-col overflow-y-auto",children:n.jsxs("div",{className:E,children:[U,$]})})]}),e[39]=E,e[40]=U,e[41]=$,e[42]=R):R=e[42];let O;e[43]!==b||e[44]!==y||e[45]!==v?(O=y&&n.jsxs("div",{className:"w-[45%] max-w-[680px] min-w-[380px] shrink-0 flex flex-col min-h-0 border-l border-border bg-background",children:[n.jsxs("div",{className:"h-10 shrink-0 flex items-center justify-between px-3 border-b border-border",children:[n.jsxs("div",{className:"flex items-center gap-1.5 text-sm font-medium text-foreground",children:[n.jsx(Se,{size:16}),"Library"]}),n.jsx("button",{type:"button",onClick:()=>v(void 0),"aria-label":"Close Library panel",className:"flex size-7 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground transition-colors",children:n.jsx(ye,{size:16})})]}),n.jsx("div",{className:"flex-1 min-h-0",children:b?n.jsx(Et,{path:b.path}):n.jsx(zt,{})})]}),e[43]=b,e[44]=y,e[45]=v,e[46]=O):O=e[46];let M;e[47]!==R||e[48]!==O?(M=n.jsxs("div",{className:"flex-1 relative flex flex-row min-h-0",children:[R,O]}),e[47]=R,e[48]=O,e[49]=M):M=e[49];let F;return e[50]!==C||e[51]!==M||e[52]!==_?(F=n.jsxs(n.Fragment,{children:[_,C,M]}),e[50]=C,e[51]=M,e[52]=_,e[53]=F):F=e[53],F}function Un(t){const e=k.c(17),{isEditMode:s,hasChanges:o,onEnter:i,onSave:r,onCancel:a,onAddTile:d}=t;if(s){let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(be,{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(ye,{size:14}),e[3]=f):f=e[3];let p;e[4]!==a?(p=n.jsxs(Y,{size:"sm",variant:"ghost",onClick:a,className:"gap-1.5 h-7 text-xs",children:[f,"Cancel"]}),e[4]=a,e[5]=p):p=e[5];const h=!o;let g;e[6]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(bt,{size:14}),e[6]=g):g=e[6];let b;e[7]!==r||e[8]!==h?(b=n.jsxs(Y,{size:"sm",onClick:r,disabled:h,className:"gap-1.5 h-7 text-xs",children:[g,"Save"]}),e[7]=r,e[8]=h,e[9]=b):b=e[9];let y;return e[10]!==u||e[11]!==p||e[12]!==b?(y=n.jsxs(n.Fragment,{children:[u,p,b]}),e[10]=u,e[11]=p,e[12]=b,e[13]=y):y=e[13],y}let l;e[14]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(wt,{size:14}),e[14]=l):l=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:[l,"Customize"]}),e[15]=i,e[16]=m):m=e[16],m}function Bn(){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 lr(){const t=k.c(2);if(ge()){let o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx("div",{className:"flex-1 min-h-0 flex flex-col bg-background overflow-hidden",children:n.jsx(Ae,{})}),t[0]=o):o=t[0],o}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(Ae,{})})})}),t[1]=s):s=t[1],s}export{lr as default};
|