decocms 3.91.0 → 3.93.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-CJRvjf9E.js → AlertCircle-CPsUqb9w.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-C-ASyyy7.js → ArrowUpRight-DtS0Ql0c.js} +1 -1
- package/dist/client/assets/{CheckCircle-DHlN5aNG.js → CheckCircle-BolkWLNV.js} +1 -1
- package/dist/client/assets/{ChevronDown-siikX1CB.js → ChevronDown-Br0JyxxI.js} +1 -1
- package/dist/client/assets/{ChevronLeft-BMBu9Rmw.js → ChevronLeft-DYKFs25Z.js} +1 -1
- package/dist/client/assets/{ChevronRight-bS8zu0mE.js → ChevronRight-Bb3fYro8.js} +1 -1
- package/dist/client/assets/{ChevronUp-CazSoL4d.js → ChevronUp-9AmI2r-8.js} +1 -1
- package/dist/client/assets/{DotsVertical--w5kUeSe.js → DotsVertical-BWvAFXp6.js} +1 -1
- package/dist/client/assets/{Eye-evykl5te.js → Eye-BeU9HzvI.js} +1 -1
- package/dist/client/assets/{FilterLines-CbmfI3qe.js → FilterLines-BjafZAm6.js} +1 -1
- package/dist/client/assets/{Globe01-C5qUvOk3.js → Globe01-BaODUE4b.js} +1 -1
- package/dist/client/assets/{Globe04-ayhcWvo6.js → Globe04-CeW5Z0Kh.js} +1 -1
- package/dist/client/assets/{HardDrive-BZnTfRN9.js → HardDrive-BKjshHXk.js} +1 -1
- package/dist/client/assets/{Key01-BHQPeab7.js → Key01-CkNZEW2T.js} +1 -1
- package/dist/client/assets/{LayoutLeft-eB33hZq-.js → LayoutLeft-AxfIYgPW.js} +1 -1
- package/dist/client/assets/{LinkExternal01-C9BK0yA_.js → LinkExternal01-DVLkc3K_.js} +1 -1
- package/dist/client/assets/{Monitor01-CuUeTTqr.js → Monitor01-C6fIMnPI.js} +1 -1
- package/dist/client/assets/{Palette-B-wglEVr.js → Palette-Du7PwJ5T.js} +1 -1
- package/dist/client/assets/{Play-eP0tvaLl.js → Play-YBZX5ZLG.js} +1 -1
- package/dist/client/assets/{Plus-DYuvLVJp.js → Plus-CJK_Z_9l.js} +1 -1
- package/dist/client/assets/{SearchMd-BqOCkx90.js → SearchMd-Bu6i-7O-.js} +1 -1
- package/dist/client/assets/{Settings02-Ca71UgHw.js → Settings02-ClyP-nns.js} +1 -1
- package/dist/client/assets/{Shield01-DY339kBm.js → Shield01-BjFKeQ_N.js} +1 -1
- package/dist/client/assets/{Star01-Cdx4KR4U.js → Star01-D1d9bklt.js} +1 -1
- package/dist/client/assets/{Stars01-DPz6mq_I.js → Stars01-C8smcBql.js} +1 -1
- package/dist/client/assets/{Stars02-CGjIjk8V.js → Stars02-B5rq9Mzt.js} +1 -1
- package/dist/client/assets/{Sun-C4MaHaW6.js → Sun-DodPsLp-.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-DqWROiIl.js → SwitchHorizontal01-kAH8gjqT.js} +1 -1
- package/dist/client/assets/{Tool01-CLVT6zPR.js → Tool01-Rpx-Fbsn.js} +1 -1
- package/dist/client/assets/{Trash01-D3NdLyIt.js → Trash01-Dyf1A0dZ.js} +1 -1
- package/dist/client/assets/{Upload01-CwAL7vx3.js → Upload01-XbcBo5aV.js} +1 -1
- package/dist/client/assets/{User01-CPYMutV0.js → User01-BfBqwqiZ.js} +1 -1
- package/dist/client/assets/{Users01-Ih8cqcDu.js → Users01-CPlN96Ae.js} +1 -1
- package/dist/client/assets/{Users03-zuYH9zmO.js → Users03-BrHC1wzv.js} +1 -1
- package/dist/client/assets/{X-DFZG0D7q.js → X-dsSDVl3-.js} +1 -1
- package/dist/client/assets/{XCircle-C4Okg4wT.js → XCircle-D9bIJ2aG.js} +1 -1
- package/dist/client/assets/{XClose-CsMYL6lC.js → XClose-gI66KzDJ.js} +1 -1
- package/dist/client/assets/{Zap-0-1HsH9l.js → Zap-Cg8ncZ4g.js} +1 -1
- package/dist/client/assets/{ZapSquare-CSwYwLqC.js → ZapSquare-D0HzXU-T.js} +1 -1
- package/dist/client/assets/{ZoomOut-DZZylEjW.js → ZoomOut-BzN_Ms7a.js} +1 -1
- package/dist/client/assets/{access-gate-BKEoJm4_.js → access-gate-CJ0Kwc3B.js} +1 -1
- package/dist/client/assets/{add-section-modal-DcqHegyG.js → add-section-modal-BieWS4zs.js} +1 -1
- package/dist/client/assets/{agent-icon-DyIO38tc.js → agent-icon-zFcUURp0.js} +1 -1
- package/dist/client/assets/{agents-list-CTPBFG-U.js → agents-list-BHA72N6X.js} +1 -1
- package/dist/client/assets/{ai-providers-BdFdksO5.js → ai-providers-Bc8lgoXa.js} +1 -1
- package/dist/client/assets/{alert-bxo3sfvI.js → alert-ClVBr42M.js} +1 -1
- package/dist/client/assets/{alert-dialog-CvkQwL5h.js → alert-dialog-1_FLDsv-.js} +3 -3
- package/dist/client/assets/{app-editor-B_pm__vT.js → app-editor-B82yAEWL.js} +1 -1
- package/dist/client/assets/{auth-Duwx_iL2.js → auth-Brn3FIq2.js} +1 -1
- package/dist/client/assets/{auth-catchall-CSy0uKFp.js → auth-catchall-B4CdMBde.js} +1 -1
- package/dist/client/assets/{auth-entry-C20r1MAB.js → auth-entry-Bu37HmBx.js} +1 -1
- package/dist/client/assets/{auth-split-layout-BAnr4RmX.js → auth-split-layout-DdFuJpuY.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-C_sfC4y1.js → authenticate-and-persist-oauth-DpasRxwB.js} +1 -1
- package/dist/client/assets/{automation-list-row-CSGFQlGB.js → automation-list-row-AaVS_thW.js} +1 -1
- package/dist/client/assets/{automation-runs-Cg17Xjs9.js → automation-runs-CtBNdoCw.js} +1 -1
- package/dist/client/assets/{automations-DzcGR2GP.js → automations-CaFTE7ZZ.js} +1 -1
- package/dist/client/assets/{avatar-DK4P1R5g.js → avatar-Bbv-vQmP.js} +1 -1
- package/dist/client/assets/{badge-BKEWn2TK.js → badge-ntRHb2xe.js} +1 -1
- package/dist/client/assets/{block-document-NIWGLeAt.js → block-document-CUi8tPcs.js} +1 -1
- package/dist/client/assets/{brand-context-CJDKvZr6.js → brand-context-2LkdpcNZ.js} +1 -1
- package/dist/client/assets/{buckets-diJYBJDb.js → buckets-DDlFW7BW.js} +1 -1
- package/dist/client/assets/{capability-load-error-CvoDXWMK.js → capability-load-error-D4gZOly9.js} +1 -1
- package/dist/client/assets/{card-CAloKMup.js → card-TqCh9vpE.js} +1 -1
- package/dist/client/assets/{category-editor-OJRcsrxS.js → category-editor-DKUiS2HO.js} +1 -1
- package/dist/client/assets/{chat-context-B8Pf9_Ws.js → chat-context-ZvIoYXlE.js} +1 -1
- package/dist/client/assets/{checkbox-BQjinmyU.js → checkbox-CjmwO_qQ.js} +1 -1
- package/dist/client/assets/{cli-auth-success-BUzt6pk1.js → cli-auth-success-Qxw92IEP.js} +1 -1
- package/dist/client/assets/{collection-detail-BaUmzKIC.js → collection-detail-BluOmLke.js} +1 -1
- package/dist/client/assets/{collection-display-button-DQ41t2NW.js → collection-display-button-Bl1k9hmZ.js} +1 -1
- package/dist/client/assets/{collection-search-oL_WM4rt.js → collection-search-rvdULW19.js} +1 -1
- package/dist/client/assets/{collection-tabs-BmqFW71W.js → collection-tabs-Dbzrj6g8.js} +1 -1
- package/dist/client/assets/{command-D3tx4Z-o.js → command-xiPyikST.js} +1 -1
- package/dist/client/assets/commerce-onboarding-oFh3OU00.js +1 -0
- package/dist/client/assets/{connect-desktop-dialog-cYgK2XT4.js → connect-desktop-dialog-CdehM8HT.js} +1 -1
- package/dist/client/assets/{connection-card-DS-KJfkn.js → connection-card-CCUMmOJp.js} +1 -1
- package/dist/client/assets/{connection-detail-DS2TWtDQ.js → connection-detail-DU-yhlHH.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-D6xKQSqh.js → connection-form-helpers-DwyZsmC2.js} +1 -1
- package/dist/client/assets/{connections-C20eJoml.js → connections-TTpLAoSx.js} +1 -1
- package/dist/client/assets/{context-menu-Bv_k6cm6.js → context-menu-C2_IMfFs.js} +1 -1
- package/dist/client/assets/{decopilot-7gVBBoRg.js → decopilot-BfvheG4H.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-85Pin_5c.js → decopilot-sse-pool-gPcdIlzZ.js} +1 -1
- package/dist/client/assets/{dialog-C2ETGOlj.js → dialog-DNLq7rFW.js} +1 -1
- package/dist/client/assets/{domain-settings-DYnLYvkm.js → domain-settings-DL5sm-Tx.js} +1 -1
- package/dist/client/assets/{drawer-CliHEmeh.js → drawer-DVmSmGnj.js} +1 -1
- package/dist/client/assets/{dropdown-menu-DpexHxwz.js → dropdown-menu-Cm5anyRF.js} +1 -1
- package/dist/client/assets/{empty-state-Bttcdn67.js → empty-state-BFpBC4xM.js} +1 -1
- package/dist/client/assets/{extract-connection-data-CdrxJbbw.js → extract-connection-data-B-Wrpl8q.js} +1 -1
- package/dist/client/assets/{file-explorer-KrE43sZb.js → file-explorer-u0QHw7Ux.js} +1 -1
- package/dist/client/assets/{file-type-icon-BqeQzn3H.js → file-type-icon-CHCPvP7h.js} +1 -1
- package/dist/client/assets/{files-YqKKAUmX.js → files-2TRWMcXR.js} +1 -1
- package/dist/client/assets/{form-Bbk-lY-7.js → form-ot5ixpyH.js} +1 -1
- package/dist/client/assets/{general-fC_qvwJN.js → general-DVWcKhSH.js} +1 -1
- package/dist/client/assets/{github-repo-picker-Cr4ZW67O.js → github-repo-picker-BRoi9lFR.js} +1 -1
- package/dist/client/assets/{hooks-BPl3QtCR.js → hooks-BzM98nK3.js} +1 -1
- package/dist/client/assets/{import-from-deco-dialog-CPuC0ABC.js → import-from-deco-dialog-JCrtglrI.js} +1 -1
- package/dist/client/assets/{index-C9HI3IQT.js → index-B8-rjD8O.js} +1 -1
- package/dist/client/assets/{index-CpYfLdbh.js → index-BLwOjDz-.js} +31 -31
- package/dist/client/assets/index-BYcSBhf-.js +1 -0
- package/dist/client/assets/{index-BZ2bAvBZ.js → index-C39E3PwA.js} +26 -26
- package/dist/client/assets/{index-DiDBx4Jd.js → index-CCFPAqFW.js} +1 -1
- package/dist/client/assets/{index-BONY-938.js → index-CSc53yD2.js} +1 -1
- package/dist/client/assets/{index-B3I-Kacs.js → index-CTcesiMm.js} +1 -1
- package/dist/client/assets/{index-CF2fOu8a.js → index-D8YsxgRv.js} +1 -1
- package/dist/client/assets/{index-DUQAYjfP.js → index-DZm2C9d-.js} +1 -1
- package/dist/client/assets/{index-BHkcyC9T.js → index-EIfjWvhU.js} +1 -1
- package/dist/client/assets/index-H4th1M1W.js +26 -0
- package/dist/client/assets/{index-JxN6NNcb.js → index-QXhoa99l.js} +1 -1
- package/dist/client/assets/index-U1Qbw0Xz.css +1 -0
- package/dist/client/assets/{index-Dnojhzzx.js → index-Z9CY6YwJ.js} +1 -1
- package/dist/client/assets/{index-redirect-DUmXObtL.js → index-redirect-CGFmrszq.js} +1 -1
- package/dist/client/assets/{index-CUkKcI0t.js → index-y4n-lKYx.js} +1 -1
- package/dist/client/assets/{input-CIRD_tZz.js → input-ClZRxnmh.js} +1 -1
- package/dist/client/assets/{integration-icon-DR2sJls0.js → integration-icon-BbB4oB5i.js} +1 -1
- package/dist/client/assets/{label-B97xU05r.js → label-BSGw8oBO.js} +1 -1
- package/dist/client/assets/{login-aqSvs4xu.js → login-CdTPEOBa.js} +1 -1
- package/dist/client/assets/{mcp-oauth-Djb0mwKI.js → mcp-oauth-B4Saszrk.js} +1 -1
- package/dist/client/assets/{members-LIiEPwh_.js → members-DBQhJ4XB.js} +1 -1
- package/dist/client/assets/{monaco-editor-chBKXgor.js → monaco-editor-CzA3Yj-7.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-B2OtnWGL.js → monitoring-stats-row-D2iO8L9k.js} +1 -1
- package/dist/client/assets/{oauth-callback-CPjT2KBB.js → oauth-callback-Bako7Xx5.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-CNvn3MnX.js → oauth-callback-ai-provider-kLVV98j9.js} +1 -1
- package/dist/client/assets/{onboarding-Doy2esp8.js → onboarding-DtVt1E-s.js} +1 -1
- package/dist/client/assets/{org-install-DMtmX55L.js → org-install-BZEHE0yF.js} +1 -1
- package/dist/client/assets/{org-layout-DBS5Dl9D.js → org-layout-BEbkmqhm.js} +1 -1
- package/dist/client/assets/{organization-choice-BmyyAVCI.js → organization-choice-B0z1MsQp.js} +1 -1
- package/dist/client/assets/{page-seo-form-Cq4dpyUr.js → page-seo-form-Dbv12H5K.js} +1 -1
- package/dist/client/assets/page-seo-sheet-CgJD2Pyd.js +1 -0
- package/dist/client/assets/{popover-Dg4e80gp.js → popover-DrCzKeNI.js} +1 -1
- package/dist/client/assets/{post-editor-5nP4PxmA.js → post-editor-C-cvaP0F.js} +1 -1
- package/dist/client/assets/{preview-dialog-CDJVefgZ.js → preview-dialog-Cent5BMR.js} +1 -1
- package/dist/client/assets/{primitives-DUdU_mJX.js → primitives-Cmp-rnEw.js} +1 -1
- package/dist/client/assets/{profile-kBSMawrR.js → profile-CBVk-VK5.js} +1 -1
- package/dist/client/assets/project-app-view-CQBqVZeE.js +1 -0
- package/dist/client/assets/record-editor-DGhJ2SI5.js +1 -0
- package/dist/client/assets/registry-BSgelBeo.js +2 -0
- package/dist/client/assets/{registry-layout-CulqOQUe.js → registry-layout-fxT45x9G.js} +1 -1
- package/dist/client/assets/{require-capability-BmO-FXvQ.js → require-capability-FrFn5vuD.js} +1 -1
- package/dist/client/assets/{required-auth-layout-k-s2E1Qb.js → required-auth-layout-5s5GmtQD.js} +1 -1
- package/dist/client/assets/{reset-password-zxigX-0y.js → reset-password-CCAC6jao.js} +1 -1
- package/dist/client/assets/{roles-CnqkorpG.js → roles-C4EA0fe9.js} +1 -1
- package/dist/client/assets/{save-status-BHYmpruK.js → save-status-CxoqkKc0.js} +1 -1
- package/dist/client/assets/{scroll-area-D2_mdzGg.js → scroll-area-AgEJrEaz.js} +1 -1
- package/dist/client/assets/{search-input-CIf1Vg9y.js → search-input-Dr84Z3zy.js} +1 -1
- package/dist/client/assets/{secrets-Chc4G-P7.js → secrets-Cv_31YKq.js} +1 -1
- package/dist/client/assets/{sections-editor-JadmVfEe.js → sections-editor-CdYoJhgp.js} +1 -1
- package/dist/client/assets/{select-BVI-5ZuA.js → select-C0uicJXN.js} +1 -1
- package/dist/client/assets/{select-model-xkUMgIU9.js → select-model-k6DruMQz.js} +1 -1
- package/dist/client/assets/{seo-editor-CI81KXn7.js → seo-editor-Davp-Ubf.js} +1 -1
- package/dist/client/assets/{settings-layout-BhTO_Kmx.js → settings-layout-CMBq2oi7.js} +1 -1
- package/dist/client/assets/{settings-section-Cjt1BmIe.js → settings-section-BIy2qPd0.js} +1 -1
- package/dist/client/assets/{sheet-BRZ8PIrM.js → sheet-FzTZnAMo.js} +1 -1
- package/dist/client/assets/{shell-controls-pLFf4RJ7.js → shell-controls-bcOU57uW.js} +1 -1
- package/dist/client/assets/{shell-layout-DRb4EqiB.js → shell-layout-CTx4S0SP.js} +1 -1
- package/dist/client/assets/{shell-route-loading-DuHKXv9P.js → shell-route-loading-7Bhg6e88.js} +1 -1
- package/dist/client/assets/{sidebar-Bnk9mrkf.js → sidebar-wPogh5H2.js} +1 -1
- package/dist/client/assets/{skeleton-DHujU9w_.js → skeleton-DbxaKwuD.js} +1 -1
- package/dist/client/assets/{sortable.esm-Cxy3zG7_.js → sortable.esm-ByCZlKMG.js} +1 -1
- package/dist/client/assets/{sso-Bx7AxsDg.js → sso-BvHL8UBy.js} +1 -1
- package/dist/client/assets/{store-B8dfBRZv.js → store-h2l8hrU9.js} +1 -1
- package/dist/client/assets/store-registry-GDMsvEZE.js +2 -0
- package/dist/client/assets/{studio-tools-DgyOaysE.js → studio-tools-Bub4-_ck.js} +1 -1
- package/dist/client/assets/{switch-Bkziulms.js → switch-BIG_iZUi.js} +1 -1
- package/dist/client/assets/{table-KIotO0Kc.js → table-CL3GsV9E.js} +1 -1
- package/dist/client/assets/{tabs-DHLQ27WW.js → tabs-BBOxnNNJ.js} +1 -1
- package/dist/client/assets/{task-status-f5DTkB-J.js → task-status-C0jVgE2C.js} +1 -1
- package/dist/client/assets/{textarea-B3tIZUed.js → textarea-CiOzOVqH.js} +1 -1
- package/dist/client/assets/{toggle-group-CRyR0oMn.js → toggle-group-DGtMQR93.js} +1 -1
- package/dist/client/assets/{toolbar-C_VPmr7n.js → toolbar-BY-bt8fG.js} +1 -1
- package/dist/client/assets/{tooltip-CJMltTIZ.js → tooltip-N_gwtefU.js} +1 -1
- package/dist/client/assets/{types-COD2S7bi.js → types-B4TXjhWy.js} +1 -1
- package/dist/client/assets/{use-ai-providers-C9TDMEuy.js → use-ai-providers-Bxs29-wG.js} +1 -1
- package/dist/client/assets/{use-automations-DJZ5x0Zc.js → use-automations-3L1xzB_A.js} +1 -1
- package/dist/client/assets/{use-capability-B1kzuPXs.js → use-capability-CxuRI8nR.js} +1 -1
- package/dist/client/assets/{use-clock-tick-CMT1YGdo.js → use-clock-tick-D6kCNTAu.js} +1 -1
- package/dist/client/assets/use-collections-Bzpy7fbk.js +1 -0
- package/dist/client/assets/{use-connection-w2D8E4uB.js → use-connection-BlwNcCfs.js} +1 -1
- package/dist/client/assets/{use-copy-B3D09Hxq.js → use-copy-C18cGMuZ.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-Ct9eNtwu.js → use-create-virtual-mcp-DjprLKRm.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-6krVFdTN.js → use-debounced-autosave-DwtJTCPs.js} +1 -1
- package/dist/client/assets/{use-delete-connection-DFc5oU0M.js → use-delete-connection-BqUiZBIv.js} +1 -1
- package/dist/client/assets/{use-file-configs-2PCi1klw.js → use-file-configs-DmpAJnrE.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-_XAuQc_I.js → use-infinite-scroll-D90uCAWk.js} +1 -1
- package/dist/client/assets/{use-join-requests-DYWv9410.js → use-join-requests-XdoqGykA.js} +1 -1
- package/dist/client/assets/{use-mcp-client-DN-NMZV3.js → use-mcp-client-DTuk5FL3.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-C617vkSu.js → use-mcp-prompts-CCJeXeit.js} +1 -1
- package/dist/client/assets/use-mcp-tools-erMTNVPt.js +1 -0
- package/dist/client/assets/{use-members-C2aOC6i6.js → use-members-DVeZ57Fb.js} +1 -1
- package/dist/client/assets/{use-mobile-Dl3xzohk.js → use-mobile-CO6Qj17d.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-Cv7a1gGO.js → use-navigate-to-agent-C5qzB5Os.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-DuB9kXBr.js → use-org-auth-client-CFe_aocy.js} +1 -1
- package/dist/client/assets/{use-org-sso-DqXQdm0q.js → use-org-sso-CUKxi2Np.js} +1 -1
- package/dist/client/assets/{use-organization-roles-8bKwxyLc.js → use-organization-roles-DuVOs9is.js} +1 -1
- package/dist/client/assets/{use-organization-settings-CQ99RcOM.js → use-organization-settings-BKJdKRk2.js} +1 -1
- package/dist/client/assets/{use-registry-connections-O8z8zBrP.js → use-registry-connections-BBgqLjED.js} +1 -1
- package/dist/client/assets/{use-secrets-B2tL3Eiw.js → use-secrets-BjGeTk2k.js} +1 -1
- package/dist/client/assets/{use-status-sounds-ChxrQq8Q.js → use-status-sounds-PgJJL_Xe.js} +1 -1
- package/dist/client/assets/{use-view-mode-D4efzYWD.js → use-view-mode-BVZfmz1B.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-BZBO6fTt.js → use-virtual-mcp-Bey-jE-7.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-33NCNh33.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-CfUDvQx6.js +1 -0
- package/dist/client/assets/useSuspenseQueries-BW_N2GXU.js +1 -0
- package/dist/client/assets/{variant-calendar-BRzmbMAw.js → variant-calendar-DtCm49M6.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-FA5jZlaq.js → view-mode-toggle-CVV_-3gy.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +3 -3
- package/dist/server/server.js +1 -1
- package/package.json +2 -1
- package/dist/client/assets/commerce-onboarding-BdejwHzi.js +0 -1
- package/dist/client/assets/index-BUBP8yoe.js +0 -1
- package/dist/client/assets/index-DkuCmq2i.js +0 -26
- package/dist/client/assets/index-rS_HhTdz.css +0 -1
- package/dist/client/assets/page-seo-sheet-BchgKYRp.js +0 -1
- package/dist/client/assets/project-app-view-BNdGMa0O.js +0 -1
- package/dist/client/assets/record-editor-BWfKPgxQ.js +0 -1
- package/dist/client/assets/registry-Bj4YS8KM.js +0 -2
- package/dist/client/assets/store-registry-Dw6Kxeid.js +0 -2
- package/dist/client/assets/use-collections-BLUmcReO.js +0 -1
- package/dist/client/assets/use-mcp-tools-HiR2aat0.js +0 -1
- package/dist/client/assets/useInfiniteQuery-D1y00mLl.js +0 -1
- package/dist/client/assets/useQueries-BUNJnzbM.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BiCq230f.js +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "decocms",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.93.0",
|
|
4
4
|
"description": "Deco CMS — Self-hostable MCP Gateway for managing AI connections and tools",
|
|
5
5
|
"author": "Deco team",
|
|
6
6
|
"repository": {
|
|
@@ -140,6 +140,7 @@
|
|
|
140
140
|
"@tiptap/starter-kit": "3.20.2",
|
|
141
141
|
"@tiptap/suggestion": "3.20.2",
|
|
142
142
|
"@types/bun": "^1.3.1",
|
|
143
|
+
"@types/google.maps": "^3.65.2",
|
|
143
144
|
"@types/pg": "^8.15.6",
|
|
144
145
|
"@types/react-syntax-highlighter": "^15.5.13",
|
|
145
146
|
"@untitledui/icons": "^0.0.19",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as E,r as q,l as ee,j as t,B,m as nt,d as ke,K as W,o as Ke,s as fe,n as qe,p as Ve,k as me,i as st,a as Be,u as _t,b as it,q as It,v as ot,Q as wt,E as Et,w as Xe,L as Tt}from"./index-CpYfLdbh.js";import{A as kt}from"./auth-entry-C20r1MAB.js";import{A as Y}from"./auth-split-layout-BAnr4RmX.js";import{O as Je}from"./organization-choice-BmyyAVCI.js";import{f as Ot}from"./tab-id-BptcWVWa.js";import{I as Ge}from"./input-CIRD_tZz.js";import{u as Re,W as rt,S as lt,g as Rt,C as Ut}from"./use-mcp-client-DN-NMZV3.js";import{i as at}from"./XCircle-C4Okg4wT.js";import{I as $t}from"./integration-icon-DR2sJls0.js";import{D as He,a as Pt,b as zt,c as Lt,d as At,e as Dt}from"./dialog-C2ETGOlj.js";import{T as Mt,a as Ft,b as Kt}from"./tooltip-CJMltTIZ.js";import{i as ct}from"./CheckCircle-DHlN5aNG.js";import{i as qt}from"./ZoomOut-DZZylEjW.js";import{g as Vt,c as Bt,e as Gt}from"./extract-connection-data-CdrxJbbw.js";import{F as pe,a as Qe,b as ge,c as he,d as xe,e as ye}from"./form-Bbk-lY-7.js";import{i as Ht}from"./ChevronUp-CazSoL4d.js";import{s as Qt,a as Wt}from"./Eye-evykl5te.js";import{i as Yt}from"./Settings02-Ca71UgHw.js";import{S as dt,a as ut,b as mt,c as ft,d as pt}from"./select-BVI-5ZuA.js";import{u as Zt}from"./useQueries-BUNJnzbM.js";import{a as Xt}from"./authenticate-and-persist-oauth-C_sfC4y1.js";import{i as gt}from"./ArrowUpRight-C-ASyyy7.js";import{s as ht}from"./User01-CPYMutV0.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./avatar-DK4P1R5g.js";import"./auth-Duwx_iL2.js";import"./agent-icon-DyIO38tc.js";import"./AlertCircle-CJRvjf9E.js";import"./Tool01-CLVT6zPR.js";import"./SwitchHorizontal01-DqWROiIl.js";import"./ZapSquare-CSwYwLqC.js";import"./Users03-zuYH9zmO.js";import"./ChevronDown-siikX1CB.js";import"./ChevronLeft-BMBu9Rmw.js";import"./ChevronRight-bS8zu0mE.js";import"./DotsVertical--w5kUeSe.js";import"./Stars02-CGjIjk8V.js";import"./Globe01-C5qUvOk3.js";import"./FilterLines-CbmfI3qe.js";import"./Star01-Cdx4KR4U.js";import"./Globe04-ayhcWvo6.js";import"./HardDrive-BZnTfRN9.js";import"./Key01-BHQPeab7.js";import"./LayoutLeft-eB33hZq-.js";import"./LinkExternal01-C9BK0yA_.js";import"./Monitor01-CuUeTTqr.js";import"./Sun-C4MaHaW6.js";import"./Palette-B-wglEVr.js";import"./Play-eP0tvaLl.js";import"./Plus-DYuvLVJp.js";import"./SearchMd-BqOCkx90.js";import"./Shield01-DY339kBm.js";import"./Stars01-DPz6mq_I.js";import"./Trash01-D3NdLyIt.js";import"./Upload01-CwAL7vx3.js";import"./Users01-Ih8cqcDu.js";import"./XClose-CsMYL6lC.js";import"./X-DFZG0D7q.js";import"./Zap-0-1HsH9l.js";import"./label-B97xU05r.js";import"./mcp-oauth-Djb0mwKI.js";const Jt=/^[a-zA-Z][a-zA-Z\d+.-]*:/,en=/^[a-zA-Z][a-zA-Z\d+.-]*:\/\//,tn=/^[^\s/:?#]+\.[^\s/:?#]+:\d+(?:[/?#]|$)/,nn=/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/i;function Ee(s){const e=s.trim();if(!e)return{ok:!1,error:"Enter a website URL."};const n=Jt.test(e),i=en.test(e),o=tn.test(e);if(n&&!i&&!o)return{ok:!1,error:"Use an HTTP or HTTPS website URL."};const c=i?e:`https://${e}`;let r;try{r=new URL(c)}catch{return{ok:!1,error:"Enter a valid website URL."}}if(r.protocol!=="http:"&&r.protocol!=="https:")return{ok:!1,error:"Use an HTTP or HTTPS website URL."};const l=r.hostname.split(".");return l.length<2||l.some(a=>!a||!nn.test(a))?{ok:!1,error:"Enter a valid website URL."}:(r.protocol="https:",{ok:!0,value:r.origin})}function De(s){const e=E.c(14),{children:n,className:i,wrapperClassName:o}=s,[c,r]=q.useState(!0);let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=j=>{if(!j)return;const y=()=>{const m=j.scrollHeight-j.scrollTop-j.clientHeight<8;r(m)};y(),j.addEventListener("scroll",y,{passive:!0});const h=new ResizeObserver(y);h.observe(j);for(const m of Array.from(j.children))h.observe(m);return()=>{j.removeEventListener("scroll",y),h.disconnect()}},e[0]=l):l=e[0];const a=l;let d;e[1]!==o?(d=ee("relative",o),e[1]=o,e[2]=d):d=e[2];let f;e[3]!==n||e[4]!==i?(f=t.jsx("div",{ref:a,className:i,children:n}),e[3]=n,e[4]=i,e[5]=f):f=e[5];const p=c?"opacity-0":"opacity-100";let u;e[6]!==p?(u=ee("pointer-events-none absolute inset-x-0 -bottom-px h-[72px]","bg-gradient-to-t from-sidebar from-[6px] to-transparent","backdrop-blur-[1px] [mask-image:linear-gradient(to_top,black_6px,transparent)]","transition-opacity duration-200",p),e[6]=p,e[7]=u):u=e[7];let x;e[8]!==u?(x=t.jsx("div",{"aria-hidden":!0,className:u}),e[8]=u,e[9]=x):x=e[9];let g;return e[10]!==d||e[11]!==f||e[12]!==x?(g=t.jsxs("div",{className:d,children:[f,x]}),e[10]=d,e[11]=f,e[12]=x,e[13]=g):g=e[13],g}function sn(s){const e=s.properties;if(!e)return[];const n=[];for(const[i,o]of Object.entries(e)){const l=o?.properties?.__type?.const;typeof l=="string"&&l.length>0&&n.push({fieldKey:i,bindingType:l})}return n}function on(s,e){const n=[];if(s.length&&n.push({field:["id"],operator:"in",value:s}),e.length&&n.push({field:["name"],operator:"in",value:e}),n.length!==0)return n.length===1?n[0]:{operator:"or",conditions:n}}function J(s){const e=s;if(e.isError)throw new Error(e.content?.find(n=>n.text)?.text??"Tool call failed");return e.structuredContent??s}function rn(s,e,n,i){return{...s??{},[e]:{__type:n,value:i}}}function Me(s){return s==null?!1:typeof s=="string"?s.trim().length>0:typeof s=="number"||typeof s=="boolean"?!0:Array.isArray(s)?s.some(Me):typeof s=="object"?Object.entries(s).some(([e,n])=>!e.startsWith("__")&&Me(n)):!1}function ln(s){return s.replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/\b\w/g,e=>e.toUpperCase())}function an(s){return Me(s)?typeof s=="string"?s.trim():typeof s=="number"||typeof s=="boolean"?String(s):JSON.stringify(s):null}function cn(s){return s?Object.entries(s).flatMap(([e,n])=>{if(e.startsWith("__"))return[];const i=an(n);return i?[{key:e,label:ln(e),value:i}]:[]}):[]}function dn(s,e,n){const i=s.filter(o=>o.app_name===e||!!n&&o.app_id===n);return i.length===0?null:(i.sort((o,c)=>{const r=l=>l.status==="active"?0:1;return r(o)!==r(c)?r(o)-r(c):(c.updated_at??"").localeCompare(o.updated_at??"")}),i[0].id)}function un(s){return s.server?.icons?.[0]?.src??Vt(s.server?.repository)??null}function mn(s,e){const n=s._meta?.["mcp.mesh"];return n?.friendlyName||n?.friendly_name||s.title||s.server?.title||s.server?.name||e}function fn(s){const e=[],n=new Map(s.connections.map(i=>[i.id,i]));for(const i of s.requirements){const o=s.curated[i.bindingType],c=o?s.itemsById[o.registryAppId]:s.itemsByName[i.bindingType];if(!c)continue;const r=s.configurationState?.[i.fieldKey]?.value,l=r?n.get(r):void 0,a=r&&l?r:null,d=a?s.connectionReadiness?.[a]!==!1:!1,f=!!a&&d;e.push({fieldKey:i.fieldKey,bindingType:i.bindingType,registryItem:c,title:mn(c,i.bindingType),icon:un(c),headline:o?.headline??c._meta?.["mcp.mesh"]?.short_description??null,checks:o?.checks??null,bullets:o?.bullets??[],satisfied:f,candidateConnectionId:f?null:a||dn(s.connections,i.bindingType,o?.registryAppId),linkedConnectionId:a,configurationState:l?.configuration_state??null})}return e}function pn(s,e){if(!s)return null;const n=o=>{if(o.startsWith("sc-domain:"))return o.substring(10);try{let r=new URL(o.startsWith("http")?o:`https://${o}`).hostname||"";return r.startsWith("www.")&&(r=r.substring(4)),r}catch{return o}},i=n(s);for(const o of e)if(n(o.siteUrl)===i)return o.siteUrl;return null}function gn(s){return(s?.response?.accountSummaries??[]).map(i=>({account:i.account,options:(i.propertySummaries??[]).map(o=>({value:o.property,label:o.displayName}))}))}function et(s){const e=E.c(38);let n,i,o,c,r;e[0]!==s?({value:r,onChange:i,placeholder:o,className:n,...c}=s,e[0]=s,e[1]=n,e[2]=i,e[3]=o,e[4]=c,e[5]=r):(n=e[1],i=e[2],o=e[3],c=e[4],r=e[5]);const[l,a]=q.useState(!1),[d,f]=q.useState(!1);let p;e[6]!==r?(p=async()=>{if(r)try{await navigator.clipboard.writeText(r),f(!0),setTimeout(()=>f(!1),2e3)}catch(F){console.error("Failed to copy text: ",F)}},e[6]=r,e[7]=p):p=e[7];const u=p;let x;e[8]!==l?(x=()=>{a(!l)},e[8]=l,e[9]=x):x=e[9];const g=x,j=l?"text":"password";let y;e[10]!==n?(y=ee("pr-20",n),e[10]=n,e[11]=y):y=e[11];let h;e[12]!==i||e[13]!==o||e[14]!==c||e[15]!==j||e[16]!==y||e[17]!==r?(h=t.jsx(Ge,{type:j,value:r,onChange:i,placeholder:o,className:y,...c}),e[12]=i,e[13]=o,e[14]=c,e[15]=j,e[16]=y,e[17]=r,e[18]=h):h=e[18];const m=l?"Hide password":"Show password";let b;e[19]!==l?(b=l?t.jsx(Yt,{size:16}):t.jsx(Qt,{size:16}),e[19]=l,e[20]=b):b=e[20];let C;e[21]!==m||e[22]!==b||e[23]!==g?(C=t.jsx(B,{type:"button",variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:g,title:m,children:b}),e[21]=m,e[22]=b,e[23]=g,e[24]=C):C=e[24];const v=!r,N=d?"Copied!":"Copy token";let _;e[25]!==d?(_=d?t.jsx(Ht,{size:16}):t.jsx(Wt,{size:16}),e[25]=d,e[26]=_):_=e[26];let T;e[27]!==u||e[28]!==N||e[29]!==_||e[30]!==v?(T=t.jsx(B,{type:"button",variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:u,disabled:v,title:N,children:_}),e[27]=u,e[28]=N,e[29]=_,e[30]=v,e[31]=T):T=e[31];let k;e[32]!==T||e[33]!==C?(k=t.jsxs("div",{className:"absolute right-1 top-1 flex items-center gap-1 h-8",children:[C,T]}),e[32]=T,e[33]=C,e[34]=k):k=e[34];let w;return e[35]!==k||e[36]!==h?(w=t.jsxs("div",{className:"relative",children:[h,k]}),e[35]=k,e[36]=h,e[37]=w):w=e[37],w}function We(s){const e=E.c(19),{card:n,selfClient:i,org:o,onDone:c,onError:r}=s,l=nt();let a;e[0]!==n||e[1]!==i?(a=async y=>{const h={...n.configurationState??{},...y};await i.callTool({name:"COLLECTION_CONNECTIONS_UPDATE",arguments:{id:n.linkedConnectionId||n.candidateConnectionId,data:{configuration_state:h}}})},e[0]=n,e[1]=i,e[2]=a):a=e[2];let d;e[3]!==c||e[4]!==o||e[5]!==l?(d=async()=>{await l.invalidateQueries({queryKey:W.commerceDiscoveryCompanionConnections(o.id)}),c()},e[3]=c,e[4]=o,e[5]=l,e[6]=d):d=e[6];let f;e[7]!==r?(f=y=>{r?.(y)},e[7]=r,e[8]=f):f=e[8];let p;e[9]!==a||e[10]!==d||e[11]!==f?(p={mutationFn:a,onSuccess:d,onError:f},e[9]=a,e[10]=d,e[11]=f,e[12]=p):p=e[12];const u=ke(p);let x;e[13]!==u?(x=y=>u.mutate(y),e[13]=u,e[14]=x):x=e[14];const g=x;let j;return e[15]!==u.error||e[16]!==u.isPending||e[17]!==g?(j={save:g,isPending:u.isPending,error:u.error},e[15]=u.error,e[16]=u.isPending,e[17]=g,e[18]=j):j=e[18],j}const hn=Ke({accountName:fe().min(1,"Account name is required"),appKey:fe().optional(),appToken:fe().optional()});function xn(s){const e=E.c(63),{card:n,selfClient:i,org:o,onDone:c,onIsPendingChange:r}=s;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=qe(hn),e[0]=l):l=e[0];const a=n.configurationState?.accountName||"",d=n.configurationState?.appKey||"",f=n.configurationState?.appToken||"";let p;e[1]!==a||e[2]!==d||e[3]!==f?(p={resolver:l,defaultValues:{accountName:a,appKey:d,appToken:f}},e[1]=a,e[2]=d,e[3]=f,e[4]=p):p=e[4];const u=Ve(p);let x;e[5]!==n.configurationState?.accountName||e[6]!==n.configurationState?.appKey||e[7]!==n.configurationState?.appToken||e[8]!==u?(x=()=>{u.reset({accountName:n.configurationState?.accountName||"",appKey:n.configurationState?.appKey||"",appToken:n.configurationState?.appToken||""})},e[5]=n.configurationState?.accountName,e[6]=n.configurationState?.appKey,e[7]=n.configurationState?.appToken,e[8]=u,e[9]=x):x=e[9];let g;e[10]!==n.configurationState||e[11]!==u?(g=[n.configurationState,u],e[10]=n.configurationState,e[11]=u,e[12]=g):g=e[12],q.useEffect(x,g);let j;e[13]!==n||e[14]!==c||e[15]!==o||e[16]!==i?(j={card:n,selfClient:i,org:o,onDone:c},e[13]=n,e[14]=c,e[15]=o,e[16]=i,e[17]=j):j=e[17];const{save:y,isPending:h,error:m}=We(j);let b,C;e[18]!==h||e[19]!==r?(C=()=>{r?.(h)},b=[h,r],e[18]=h,e[19]=r,e[20]=b,e[21]=C):(b=e[20],C=e[21]),q.useEffect(C,b);let v;if(e[22]!==u||e[23]!==y){let z;e[25]!==y?(z=async S=>{y(S)},e[25]=y,e[26]=z):z=e[26],v=u.handleSubmit(z),e[22]=u,e[23]=y,e[24]=v}else v=e[24];const N=v;let _;e[27]!==h?(_=z=>{const{field:S}=z;return t.jsxs(ge,{children:[t.jsx(he,{children:"Account Name"}),t.jsx(xe,{children:t.jsx(Ge,{placeholder:"Your VTEX account name",...S,disabled:h})}),t.jsx(ye,{})]})},e[27]=h,e[28]=_):_=e[28];let T;e[29]!==u.control||e[30]!==_?(T=t.jsx(pe,{control:u.control,name:"accountName",render:_}),e[29]=u.control,e[30]=_,e[31]=T):T=e[31];let k;e[32]!==h?(k=z=>{const{field:S}=z;return t.jsxs(ge,{children:[t.jsx(he,{children:"App Key (optional)"}),t.jsx(xe,{children:t.jsx(et,{placeholder:"VTEX app key",...S,disabled:h})}),t.jsx(ye,{})]})},e[32]=h,e[33]=k):k=e[33];let w;e[34]!==u.control||e[35]!==k?(w=t.jsx(pe,{control:u.control,name:"appKey",render:k}),e[34]=u.control,e[35]=k,e[36]=w):w=e[36];let F;e[37]!==h?(F=z=>{const{field:S}=z;return t.jsxs(ge,{children:[t.jsx(he,{children:"App Token (optional)"}),t.jsx(xe,{children:t.jsx(et,{placeholder:"VTEX app token",...S,disabled:h})}),t.jsx(ye,{})]})},e[37]=h,e[38]=F):F=e[38];let R;e[39]!==u.control||e[40]!==F?(R=t.jsx(pe,{control:u.control,name:"appToken",render:F}),e[39]=u.control,e[40]=F,e[41]=R):R=e[41];let I;e[42]!==u||e[43]!==T||e[44]!==w||e[45]!==R?(I=t.jsxs(Qe,{...u,children:[T,w,R]}),e[42]=u,e[43]=T,e[44]=w,e[45]=R,e[46]=I):I=e[46];let P;e[47]!==m?(P=m&&t.jsx("p",{role:"alert",className:"text-sm text-destructive",children:m instanceof Error?m.message:"Failed to save configuration"}),e[47]=m,e[48]=P):P=e[48];let A;e[49]!==h||e[50]!==c?(A=t.jsx(B,{type:"button",variant:"outline",onClick:c,disabled:h,children:"Cancel"}),e[49]=h,e[50]=c,e[51]=A):A=e[51];const D=h?"Saving...":"Save";let K;e[52]!==h||e[53]!==D?(K=t.jsx(B,{type:"submit",disabled:h,children:D}),e[52]=h,e[53]=D,e[54]=K):K=e[54];let M;e[55]!==A||e[56]!==K?(M=t.jsxs(He,{className:"pt-4",children:[A,K]}),e[55]=A,e[56]=K,e[57]=M):M=e[57];let U;return e[58]!==N||e[59]!==I||e[60]!==P||e[61]!==M?(U=t.jsxs("form",{onSubmit:N,className:"space-y-4",children:[I,P,M]}),e[58]=N,e[59]=I,e[60]=P,e[61]=M,e[62]=U):U=e[62],U}const yn=Ke({propertyId:fe().min(1,"Property is required")});function jn(s){const e=E.c(55),{card:n,connectionId:i,companionClient:o,selfClient:c,org:r,onDone:l,onIsPendingChange:a}=s;let d;e[0]!==i||e[1]!==r.id?(d=W.commerceDiscoveryCompanionGaProperties(r.id,i),e[0]=i,e[1]=r.id,e[2]=d):d=e[2];let f;e[3]!==o?(f=async()=>{const S=await o.callTool({name:"get-account-summaries",arguments:{}}),L=J(S);return gn(L)},e[3]=o,e[4]=f):f=e[4];let p;e[5]!==d||e[6]!==f?(p={queryKey:d,queryFn:f},e[5]=d,e[6]=f,e[7]=p):p=e[7];const u=me(p);let x;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=qe(yn),e[8]=x):x=e[8];const g=n.configurationState?.propertyId||"";let j;e[9]!==g?(j={resolver:x,defaultValues:{propertyId:g}},e[9]=g,e[10]=j):j=e[10];const y=Ve(j);let h;e[11]!==n||e[12]!==l||e[13]!==r||e[14]!==c?(h={card:n,selfClient:c,org:r,onDone:l},e[11]=n,e[12]=l,e[13]=r,e[14]=c,e[15]=h):h=e[15];const{save:m,isPending:b,error:C}=We(h);let v,N;e[16]!==b||e[17]!==a?(v=()=>{a?.(b)},N=[b,a],e[16]=b,e[17]=a,e[18]=v,e[19]=N):(v=e[18],N=e[19]),q.useEffect(v,N);let _;if(e[20]!==y||e[21]!==m){let S;e[23]!==m?(S=async L=>{m(L)},e[23]=m,e[24]=S):S=e[24],_=y.handleSubmit(S),e[20]=y,e[21]=m,e[22]=_}else _=e[22];const T=_;if(u.isLoading){let S;return e[25]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("div",{className:"space-y-4",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading properties..."})}),e[25]=S):S=e[25],S}if(u.isError){let S;return e[26]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("div",{className:"space-y-4",children:t.jsx("p",{className:"text-sm text-destructive",children:"Failed to load Google Analytics properties."})}),e[26]=S):S=e[26],S}let k;e[27]!==u.data?(k=u.data||[],e[27]=u.data,e[28]=k):k=e[28];const w=k;if(w.flatMap(Sn).length===0){let S;return e[29]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("div",{className:"space-y-4",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"No Google Analytics properties found. Please connect a Google Analytics account with properties."})}),e[29]=S):S=e[29],S}let R;e[30]!==b||e[31]!==w?(R=S=>{const{field:L}=S;return t.jsxs(ge,{children:[t.jsx(he,{children:"Google Analytics Property"}),t.jsx(xe,{children:t.jsxs(dt,{value:L.value,onValueChange:L.onChange,disabled:b,children:[t.jsx(ut,{children:t.jsx(mt,{placeholder:"Select a property"})}),t.jsx(ft,{children:w.map(bn)})]})}),t.jsx(ye,{})]})},e[30]=b,e[31]=w,e[32]=R):R=e[32];let I;e[33]!==y.control||e[34]!==R?(I=t.jsx(pe,{control:y.control,name:"propertyId",render:R}),e[33]=y.control,e[34]=R,e[35]=I):I=e[35];let P;e[36]!==y||e[37]!==I?(P=t.jsx(Qe,{...y,children:I}),e[36]=y,e[37]=I,e[38]=P):P=e[38];let A;e[39]!==C?(A=C&&t.jsx("p",{role:"alert",className:"text-sm text-destructive",children:C instanceof Error?C.message:"Failed to save configuration"}),e[39]=C,e[40]=A):A=e[40];let D;e[41]!==b||e[42]!==l?(D=t.jsx(B,{type:"button",variant:"outline",onClick:l,disabled:b,children:"Cancel"}),e[41]=b,e[42]=l,e[43]=D):D=e[43];const K=b?"Saving...":"Save";let M;e[44]!==b||e[45]!==K?(M=t.jsx(B,{type:"submit",disabled:b,children:K}),e[44]=b,e[45]=K,e[46]=M):M=e[46];let U;e[47]!==D||e[48]!==M?(U=t.jsxs(He,{className:"pt-4",children:[D,M]}),e[47]=D,e[48]=M,e[49]=U):U=e[49];let z;return e[50]!==T||e[51]!==P||e[52]!==A||e[53]!==U?(z=t.jsxs("form",{onSubmit:T,className:"space-y-4",children:[P,A,U]}),e[50]=T,e[51]=P,e[52]=A,e[53]=U,e[54]=z):z=e[54],z}function bn(s){return t.jsx("div",{children:s.options.map(Cn)},s.account)}function Cn(s){return t.jsx(pt,{value:s.value,children:s.label},s.value)}function Sn(s){return s.options}const vn=Ke({siteUrl:fe().min(1,"Site is required")});function Nn(s){const e=E.c(59),{card:n,connectionId:i,companionClient:o,selfClient:c,org:r,contextSiteUrl:l,onDone:a,onIsPendingChange:d}=s;let f;e[0]!==i||e[1]!==r.id?(f=W.commerceDiscoveryCompanionGscSites(r.id,i),e[0]=i,e[1]=r.id,e[2]=f):f=e[2];let p;e[3]!==o?(p=async()=>{const S=await o.callTool({name:"list_sites",arguments:{}});return J(S).sites||[]},e[3]=o,e[4]=p):p=e[4];let u;e[5]!==f||e[6]!==p?(u={queryKey:f,queryFn:p},e[5]=f,e[6]=p,e[7]=u):u=e[7];const x=me(u);let g;e[8]===Symbol.for("react.memo_cache_sentinel")?(g=qe(vn),e[8]=g):g=e[8];const j=n.configurationState?.siteUrl||"";let y;e[9]!==j?(y={resolver:g,defaultValues:{siteUrl:j}},e[9]=j,e[10]=y):y=e[10];const h=Ve(y);let m;e[11]!==n||e[12]!==a||e[13]!==r||e[14]!==c?(m={card:n,selfClient:c,org:r,onDone:a},e[11]=n,e[12]=a,e[13]=r,e[14]=c,e[15]=m):m=e[15];const{save:b,isPending:C,error:v}=We(m);let N,_;e[16]!==C||e[17]!==d?(N=()=>{d?.(C)},_=[C,d],e[16]=C,e[17]=d,e[18]=N,e[19]=_):(N=e[18],_=e[19]),q.useEffect(N,_);let T;if(e[20]!==h||e[21]!==b){let S;e[23]!==b?(S=async L=>{b(L)},e[23]=b,e[24]=S):S=e[24],T=h.handleSubmit(S),e[20]=h,e[21]=b,e[22]=T}else T=e[22];const k=T;if(x.isLoading){let S;return e[25]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("div",{className:"space-y-4",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading sites..."})}),e[25]=S):S=e[25],S}if(x.isError){let S;return e[26]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("div",{className:"space-y-4",children:t.jsx("p",{className:"text-sm text-destructive",children:"Failed to load Google Search Console sites."})}),e[26]=S):S=e[26],S}let w,F;if(e[27]!==n.configurationState?.siteUrl||e[28]!==l||e[29]!==h||e[30]!==x.data){F=Symbol.for("react.early_return_sentinel");e:{if(w=x.data||[],w.length===0){let L;e[33]===Symbol.for("react.memo_cache_sentinel")?(L=t.jsx("div",{className:"space-y-4",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"No verified sites found. Please verify a site in Google Search Console."})}),e[33]=L):L=e[33],F=L;break e}const S=n.configurationState?.siteUrl;if(S&&h.getValues("siteUrl")!==S)h.setValue("siteUrl",S);else if(!S&&!h.getValues("siteUrl")){const L=pn(l,w);L&&h.setValue("siteUrl",L)}}e[27]=n.configurationState?.siteUrl,e[28]=l,e[29]=h,e[30]=x.data,e[31]=w,e[32]=F}else w=e[31],F=e[32];if(F!==Symbol.for("react.early_return_sentinel"))return F;let R;e[34]!==C||e[35]!==w?(R=S=>{const{field:L}=S;return t.jsxs(ge,{children:[t.jsx(he,{children:"Verified Site"}),t.jsx(xe,{children:t.jsxs(dt,{value:L.value,onValueChange:L.onChange,disabled:C,children:[t.jsx(ut,{children:t.jsx(mt,{placeholder:"Select a site"})}),t.jsx(ft,{children:w.map(_n)})]})}),t.jsx(ye,{})]})},e[34]=C,e[35]=w,e[36]=R):R=e[36];let I;e[37]!==h.control||e[38]!==R?(I=t.jsx(pe,{control:h.control,name:"siteUrl",render:R}),e[37]=h.control,e[38]=R,e[39]=I):I=e[39];let P;e[40]!==h||e[41]!==I?(P=t.jsx(Qe,{...h,children:I}),e[40]=h,e[41]=I,e[42]=P):P=e[42];let A;e[43]!==v?(A=v&&t.jsx("p",{role:"alert",className:"text-sm text-destructive",children:v instanceof Error?v.message:"Failed to save configuration"}),e[43]=v,e[44]=A):A=e[44];let D;e[45]!==C||e[46]!==a?(D=t.jsx(B,{type:"button",variant:"outline",onClick:a,disabled:C,children:"Cancel"}),e[45]=C,e[46]=a,e[47]=D):D=e[47];const K=C?"Saving...":"Save";let M;e[48]!==C||e[49]!==K?(M=t.jsx(B,{type:"submit",disabled:C,children:K}),e[48]=C,e[49]=K,e[50]=M):M=e[50];let U;e[51]!==D||e[52]!==M?(U=t.jsxs(He,{className:"pt-4",children:[D,M]}),e[51]=D,e[52]=M,e[53]=U):U=e[53];let z;return e[54]!==k||e[55]!==P||e[56]!==A||e[57]!==U?(z=t.jsxs("form",{onSubmit:k,className:"space-y-4",children:[P,A,U]}),e[54]=k,e[55]=P,e[56]=A,e[57]=U,e[58]=z):z=e[58],z}function _n(s){return t.jsx(pt,{value:s.siteUrl,children:s.siteUrl},s.siteUrl)}const In={vtex:xn,"google-analytics":jn,"google-search-console":Nn};function wn(){const s=E.c(3);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"size-9 shrink-0 animate-pulse rounded-lg bg-muted/60"}),t.jsx("div",{className:"h-4 w-32 animate-pulse rounded bg-muted/60"}),t.jsx("div",{className:"ml-auto h-8 w-20 animate-pulse rounded-lg bg-muted/60"})]}),s[0]=e):e=s[0];let n;s[1]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"p-1",children:t.jsx("div",{className:"h-5 w-40 animate-pulse rounded bg-muted/60"})}),s[1]=n):n=s[1];let i;return s[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsxs("div",{className:"flex flex-col gap-2 rounded-2xl border border-border bg-card p-4",children:[e,t.jsxs("div",{className:"flex flex-col gap-1 px-1 py-2",children:[n,t.jsx("div",{className:"p-1",children:t.jsx("div",{className:"h-5 w-56 animate-pulse rounded bg-muted/60"})})]})]}),s[2]=i):i=s[2],i}function Fe(s){const e=E.c(3),{children:n}=s;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(ct,{size:14,className:"shrink-0 text-blue-500"}),e[0]=i):i=e[0];let o;return e[1]!==n?(o=t.jsxs("div",{className:"flex items-center gap-2 p-1",children:[i,t.jsx("p",{className:"text-sm text-foreground",children:n})]}),e[1]=n,e[2]=o):o=e[2],o}function En(s){const e=E.c(43),{card:n,connecting:i,disabled:o,onConnect:c,org:r,selfClient:l,siteUrl:a}=s,d=n.linkedConnectionId;let f;e[0]!==n.configurationState?(f=cn(n.configurationState),e[0]=n.configurationState,e[1]=f):f=e[1];const p=f;let u;e[2]!==n.icon||e[3]!==n.title?(u=t.jsx($t,{icon:n.icon,name:n.title,size:"sm",fit:"contain",className:"p-1.5"}),e[2]=n.icon,e[3]=n.title,e[4]=u):u=e[4];let x;e[5]!==n.title?(x=t.jsx("p",{className:"flex-1 text-sm text-foreground",children:n.title}),e[5]=n.title,e[6]=x):x=e[6];let g;e[7]!==n.satisfied||e[8]!==n.title||e[9]!==i||e[10]!==o||e[11]!==c?(g=n.satisfied?t.jsxs("div",{className:"flex h-8 items-center gap-2 px-3 text-sm text-muted-foreground",children:[t.jsx(ct,{size:16})," Connected"]}):t.jsx(B,{type:"button",variant:"outline",size:"sm",disabled:o||i,onClick:c,"aria-label":`Connect ${n.title}`,children:i?t.jsx(st,{size:16,className:"animate-spin"}):"Connect"}),e[7]=n.satisfied,e[8]=n.title,e[9]=i,e[10]=o,e[11]=c,e[12]=g):g=e[12];let j;e[13]!==u||e[14]!==x||e[15]!==g?(j=t.jsxs("div",{className:"flex items-center gap-2",children:[u,x,g]}),e[13]=u,e[14]=x,e[15]=g,e[16]=j):j=e[16];let y;e[17]!==n.checks?(y=n.checks!==null&&t.jsxs(Fe,{children:["+ ",n.checks," checks"]}),e[17]=n.checks,e[18]=y):y=e[18];let h;e[19]!==n.headline?(h=n.headline&&t.jsx(Fe,{children:n.headline}),e[19]=n.headline,e[20]=h):h=e[20];let m;e[21]!==n.bullets?(m=n.bullets.map(Tn),e[21]=n.bullets,e[22]=m):m=e[22];let b;e[23]!==n.candidateConnectionId||e[24]!==n.satisfied||e[25]!==n.title?(b=!n.satisfied&&n.candidateConnectionId&&t.jsxs("p",{className:"px-1 text-xs text-muted-foreground",children:["Using your existing ",n.title]}),e[23]=n.candidateConnectionId,e[24]=n.satisfied,e[25]=n.title,e[26]=b):b=e[26];let C;e[27]!==y||e[28]!==h||e[29]!==m||e[30]!==b?(C=t.jsxs("div",{className:"flex flex-col gap-1 px-1 py-2",children:[y,h,m,b]}),e[27]=y,e[28]=h,e[29]=m,e[30]=b,e[31]=C):C=e[31];let v;e[32]!==n||e[33]!==d||e[34]!==r||e[35]!==p||e[36]!==l||e[37]!==a?(v=n.satisfied&&d&&t.jsx(Rn,{card:n,org:r,selfClient:l,connectionId:d,savedConfigEntries:p,contextSiteUrl:a}),e[32]=n,e[33]=d,e[34]=r,e[35]=p,e[36]=l,e[37]=a,e[38]=v):v=e[38];let N;return e[39]!==C||e[40]!==v||e[41]!==j?(N=t.jsxs("div",{className:"flex flex-col gap-2 rounded-2xl border border-border bg-card p-4",children:[j,C,v]}),e[39]=C,e[40]=v,e[41]=j,e[42]=N):N=e[42],N}function Tn(s){return t.jsx(Fe,{children:s},s)}function kn(s,e){return/(token|secret|password|appKey|key)$/i.test(s)?"••••••••":e}function On(s){const e=E.c(2),{title:n}=s;let i;return e[0]!==n?(i=t.jsx("div",{className:"grid gap-3 border-t border-border pt-3",children:t.jsxs("p",{className:"text-xs text-muted-foreground",children:["Configuration isn't available here yet for ",n,"."]})}),e[0]=n,e[1]=i):i=e[1],i}function Rn(s){const e=E.c(36),{card:n,org:i,selfClient:o,connectionId:c,savedConfigEntries:r,contextSiteUrl:l}=s;let a;e[0]!==c||e[1]!==i.id||e[2]!==i.slug?(a={connectionId:c,orgId:i.id,orgSlug:i.slug},e[0]=c,e[1]=i.id,e[2]=i.slug,e[3]=a):a=e[3];const d=Re(a),[f,p]=q.useState(!1),[u,x]=q.useState(!1),g=In[n.bindingType];let j;e[4]!==u?(j=w=>{!w&&u||p(w)},e[4]=u,e[5]=j):j=e[5];const y=j;let h;e[6]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("p",{className:"text-sm font-medium text-foreground",children:"Configuration"}),e[6]=h):h=e[6];let m;e[7]!==r.length?(m=r.length===0&&t.jsx("p",{className:"text-xs text-muted-foreground",children:"No configuration values saved yet."}),e[7]=r.length,e[8]=m):m=e[8];let b;e[9]!==m?(b=t.jsxs("div",{className:"grid gap-1",children:[h,m]}),e[9]=m,e[10]=b):b=e[10];let C;e[11]!==g||e[12]!==n.title||e[13]!==r.length?(C=r.length>0?t.jsxs(Mt,{children:[t.jsx(Ft,{asChild:!0,children:t.jsx(B,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>p(!0),"aria-label":`Edit ${n.title} configuration`,disabled:!g,children:t.jsx(qt,{size:14})})}),t.jsx(Kt,{children:"Edit configuration"})]}):t.jsx(B,{type:"button",variant:"outline",size:"sm",onClick:()=>p(!0),disabled:!g,children:"Configure"}),e[11]=g,e[12]=n.title,e[13]=r.length,e[14]=C):C=e[14];let v;e[15]!==b||e[16]!==C?(v=t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[b,C]}),e[15]=b,e[16]=C,e[17]=v):v=e[17];let N;e[18]!==r?(N=r.length>0&&t.jsx("dl",{className:"grid gap-2",children:r.map(Un)}),e[18]=r,e[19]=N):N=e[19];let _;e[20]!==v||e[21]!==N?(_=t.jsxs("div",{className:"grid gap-3 border-t border-border pt-3",children:[v,N]}),e[20]=v,e[21]=N,e[22]=_):_=e[22];let T;e[23]!==g||e[24]!==n||e[25]!==d||e[26]!==c||e[27]!==l||e[28]!==f||e[29]!==y||e[30]!==i||e[31]!==o?(T=g?t.jsx(Pt,{open:f,onOpenChange:y,children:t.jsxs(zt,{className:"sm:max-w-lg",children:[t.jsxs(Lt,{children:[t.jsxs(At,{children:["Configure ",n.title]}),t.jsx(Dt,{children:"Update the values this companion uses for Commerce Discovery."})]}),t.jsx(g,{card:n,connectionId:c,companionClient:d,selfClient:o,org:i,contextSiteUrl:l,onDone:()=>p(!1),onIsPendingChange:x})]})}):t.jsx(On,{title:n.title}),e[23]=g,e[24]=n,e[25]=d,e[26]=c,e[27]=l,e[28]=f,e[29]=y,e[30]=i,e[31]=o,e[32]=T):T=e[32];let k;return e[33]!==T||e[34]!==_?(k=t.jsxs(t.Fragment,{children:[_,T]}),e[33]=T,e[34]=_,e[35]=k):k=e[35],k}function Un(s){return t.jsxs("div",{className:"flex items-center justify-between gap-3 text-sm",children:[t.jsx("dt",{className:"text-muted-foreground",children:s.label}),t.jsx("dd",{className:"truncate text-foreground",children:kn(s.key,s.value)})]},s.key)}const Ye={vtex:{registryAppId:"deco/vtex",checks:49,headline:"Out-of-stock, thin PDPs & attribute gaps across every SKU"},"google-analytics":{registryAppId:"deco/google-analytics",checks:49,headline:"Where revenue leaks between product view and checkout"},"google-search-console":{registryAppId:"deco/google-search-console",checks:49,headline:"Search visibility & indexing gaps across your catalog"}};function $n(s){const e=E.c(39),{selfClient:n,org:i,cdConnectionId:o}=s;let c;e[0]!==o||e[1]!==i.id||e[2]!==i.slug?(c={connectionId:o,orgId:i.id,orgSlug:i.slug},e[0]=o,e[1]=i.id,e[2]=i.slug,e[3]=c):c=e[3];const r=Re(c);let l;e[4]!==o||e[5]!==i.id?(l=W.commerceDiscoveryCompanionSchema(i.id,o),e[4]=o,e[5]=i.id,e[6]=l):l=e[6];let a;e[7]!==r?(a=async()=>{const O=await r.callTool({name:"MCP_CONFIGURATION",arguments:{}});return J(O)},e[7]=r,e[8]=a):a=e[8];let d;e[9]!==l||e[10]!==a?(d={queryKey:l,queryFn:a},e[9]=l,e[10]=a,e[11]=d):d=e[11];const f=me(d),p=sn(f.data?.stateSchema??{properties:{}}),u=p.map(Kn),x=p.map(Fn).filter(Mn),g=p.filter(Dn).map(An),j=[...x,...g].sort().join(",");let y;e[12]!==o||e[13]!==i.id?(y=W.commerceDiscoveryConnection(i.id,o),e[12]=o,e[13]=i.id,e[14]=y):y=e[14];let h;e[15]!==o||e[16]!==n?(h=async()=>{const O=await n.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:o}});return J(O)},e[15]=o,e[16]=n,e[17]=h):h=e[17];let m;e[18]!==y||e[19]!==h?(m={queryKey:y,queryFn:h},e[18]=y,e[19]=h,e[20]=m):m=e[20];const b=me(m),C=b.data?.item?.configuration_state??null;let v;e[21]!==C?(v=O=>C?.[O.fieldKey]?.value,e[21]=C,e[22]=v):v=e[22];const N=p.map(v).filter(Ln),_=me({queryKey:W.commerceDiscoveryCompanionConnections(i.id),enabled:p.length>0,queryFn:async()=>{const O=[{field:["app_name"],operator:"in",value:u},{field:["app_id"],operator:"in",value:x}];N.length>0&&O.push({field:["id"],operator:"in",value:N});const G=await n.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{where:{operator:"or",conditions:O},limit:1e3}});return J(G)}}),T=_.data?.items??[],k=new Set(N),w=T.filter(O=>k.has(O.id)),F=w.filter(zn);let R;e[23]!==i.id||e[24]!==i.slug?(R=O=>({queryKey:W.commerceDiscoveryCompanionOAuthStatus(i.id,O.id),queryFn:async()=>{const G=await fetch(`/api/${encodeURIComponent(i.slug)}/connections/${encodeURIComponent(O.id)}/oauth-token/status`,{credentials:"include"});return G.ok?{hasToken:(await G.json()).hasToken===!0}:{hasToken:!1}},retry:!1}),e[23]=i.id,e[24]=i.slug,e[25]=R):R=e[25];const I=Zt({queries:F.map(R)});let P;e[26]!==I?(P=(O,G)=>[O.id,I[G]?.data?.hasToken===!0],e[26]=I,e[27]=P):P=e[27];const A=new Map(F.map(P)),D={};for(const O of w)D[O.id]=!O.oauth_config||!!O.connection_token||A.get(O.id)===!0;const K=me({queryKey:W.commerceDiscoveryCompanionRegistry(i.id,j),enabled:p.length>0,queryFn:async()=>{const O=on(x,g),G=await Bt(rt.REGISTRY(i.id),i.id,i.slug,"COLLECTION_REGISTRY_APP_LIST",{...O?{where:O}:{},limit:1e3});return J(G)}}),M={},U={};for(const O of K.data?.items??[])M[O.id]=O,O.server?.name&&(U[O.server.name]=O);const z=fn({requirements:p,itemsById:M,itemsByName:U,connections:T,connectionReadiness:D,configurationState:C,curated:Ye});let S;e[28]!==b||e[29]!==_||e[30]!==I||e[31]!==K||e[32]!==p||e[33]!==f.isPending?(S=f.isPending||b.isPending||p.length>0&&(_.isPending||K.isPending||I.some(Pn)),e[28]=b,e[29]=_,e[30]=I,e[31]=K,e[32]=p,e[33]=f.isPending,e[34]=S):S=e[34];const L=S,V=f.error??b.error??_.error??K.error??null;let Z;return e[35]!==z||e[36]!==V||e[37]!==L?(Z={cards:z,isLoading:L,error:V},e[35]=z,e[36]=V,e[37]=L,e[38]=Z):Z=e[38],Z}function Pn(s){return s.isPending}function zn(s){return s.oauth_config&&!s.connection_token}function Ln(s){return typeof s=="string"&&s.length>0}function An(s){return s.bindingType}function Dn(s){return!Ye[s.bindingType]}function Mn(s){return!!s}function Fn(s){return Ye[s.bindingType]?.registryAppId}function Kn(s){return s.bindingType}function qn({selfClient:s,org:e,userId:n,cdConnectionId:i}){const o=nt(),[c,r]=q.useState(null),[l,a]=q.useState(null),d=async(p,u)=>{const x=await s.callTool({name:"COLLECTION_CONNECTIONS_UPDATE",arguments:{id:p,data:u}});return J(x)};async function f(p){r(p.fieldKey),a(null);try{let u=p.candidateConnectionId;if(!u){const m=Gt(p.registryItem,e.id,n,{remoteIndex:0}),b=m.connection_type==="STDIO",C=!!m.connection_url,v=b&&m.connection_headers&&typeof m.connection_headers=="object"&&"command"in m.connection_headers;if(!C&&!v){a(`${p.title} cannot be connected: no connection method available`);return}const N=await s.callTool({name:"COLLECTION_CONNECTIONS_CREATE",arguments:{data:m}});u=J(N).item.id}const x=u,g=await Xt({connectionId:x,orgId:e.id,orgSlug:e.slug,persistFallback:m=>d(x,{connection_token:m}).then(()=>{})});if(!g.ok){a(`Couldn't sign in to ${p.title}: ${g.error}`);return}const j=await s.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:i}}),y=J(j).item?.configuration_state??null,h=rn(y,p.fieldKey,p.bindingType,x);await d(i,{configuration_state:h}),await o.invalidateQueries({queryKey:W.commerceDiscoveryConnection(e.id,i)}),await o.invalidateQueries({queryKey:W.commerceDiscoveryCompanionConnections(e.id)})}catch(u){a(u instanceof Error?u.message:String(u))}finally{r(null)}}return{connect:f,connectingFieldKey:c,error:l}}const Vn="flex min-h-0 flex-1 flex-col gap-6 md:grid md:flex-none md:gap-4";function Bn(){const s=E.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx("p",{className:"text-2xl font-medium text-foreground",children:"Unlock your full diagnostic"}),t.jsx("p",{className:"text-base text-muted-foreground",children:"Connect your tools to unlock 100+ checks across your funnel."})]}),s[0]=e):e=s[0],e}function Gn(){const s=E.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"grid gap-4",children:[0,1,2].map(Hn)}),s[0]=e):e=s[0],e}function Hn(s){return t.jsx(wn,{},s)}function Qn(s){const e=E.c(24),{org:n,cdConnectionId:i,siteUrl:o}=s,{data:c}=Be.useSession(),r=c?.user?.id??"";let l;e[0]!==n.id||e[1]!==n.slug?(l={connectionId:lt,orgId:n.id,orgSlug:n.slug},e[0]=n.id,e[1]=n.slug,e[2]=l):l=e[2];const a=Re(l);let d;e[3]!==i||e[4]!==n||e[5]!==a?(d={selfClient:a,org:n,cdConnectionId:i},e[3]=i,e[4]=n,e[5]=a,e[6]=d):d=e[6];const{cards:f,isLoading:p,error:u}=$n(d);let x;e[7]!==i||e[8]!==n||e[9]!==a||e[10]!==r?(x={selfClient:a,org:n,userId:r,cdConnectionId:i},e[7]=i,e[8]=n,e[9]=a,e[10]=r,e[11]=x):x=e[11];const{connect:g,connectingFieldKey:j,error:y}=qn(x);if(!p&&!u&&f.length===0)return null;const h=j!==null;let m;e[12]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(Bn,{}),e[12]=m):m=e[12];let b;return e[13]!==h||e[14]!==f||e[15]!==g||e[16]!==y||e[17]!==j||e[18]!==u||e[19]!==p||e[20]!==n||e[21]!==a||e[22]!==o?(b=t.jsxs("div",{className:Vn,children:[m,u?t.jsxs("div",{role:"alert",className:"rounded-2xl border border-border bg-card p-4",children:[t.jsx("p",{className:"text-sm text-foreground",children:"Couldn't load companion integrations."}),t.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Reload the page to try again."})]}):p?t.jsx(Gn,{}):t.jsx(De,{wrapperClassName:"flex min-h-0 flex-1 flex-col md:block",className:"-mx-1 min-h-0 flex-1 overflow-y-auto px-1 md:max-h-[45vh] md:flex-none",children:t.jsxs("div",{className:"grid gap-4",children:[y&&t.jsx("p",{role:"alert",className:"text-sm text-destructive",children:y}),f.map(C=>t.jsx(En,{card:C,connecting:j===C.fieldKey,disabled:h&&j!==C.fieldKey,org:n,selfClient:a,siteUrl:o,onConnect:()=>{g(C)}},C.fieldKey))]})})]}),e[13]=h,e[14]=f,e[15]=g,e[16]=y,e[17]=j,e[18]=u,e[19]=p,e[20]=n,e[21]=a,e[22]=o,e[23]=b):b=e[23],b}const Ze="https://decocms-tanstack.deco-cx.workers.dev/agendar",Wn="Rather have us walk you through it?",Yn="Book a 20-minute call and we'll run the diagnostic with you, live.";function xt({siteUrl:s,email:e}){const n=new URL(Ze);return s&&n.searchParams.set("siteUrl",s),e&&n.searchParams.set("email",e),n.toString()}function Zn(s){const e=E.c(9),{href:n,size:i,className:o}=s,c=n===void 0?Ze:n,r=i===void 0?"lg":i;let l;e[0]!==o?(l=ee("w-full",o),e[0]=o,e[1]=l):l=e[1];let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(gt,{size:16}),e[2]=a):a=e[2];let d;e[3]!==c?(d=t.jsxs("a",{href:c,target:"_blank",rel:"noreferrer",children:["Schedule a meeting",a]}),e[3]=c,e[4]=d):d=e[4];let f;return e[5]!==r||e[6]!==l||e[7]!==d?(f=t.jsx(B,{asChild:!0,variant:"outline",size:r,className:l,children:d}),e[5]=r,e[6]=l,e[7]=d,e[8]=f):f=e[8],f}function tt(s){const e=E.c(2),{children:n}=s;let i;return e[0]!==n?(i=t.jsx("div",{className:"relative z-10 flex h-12 w-12 items-center justify-center rounded-full border border-border bg-card card-shadow",children:n}),e[0]=n,e[1]=i):i=e[1],i}function Xn(){const s=E.c(4);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(tt,{children:t.jsx(ht,{size:20,className:"text-muted-foreground"})}),s[0]=e):e=s[0];let n;s[1]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"relative mx-4 h-px flex-1 bg-border",children:t.jsx("span",{className:"absolute top-1/2 h-1.5 w-1.5 -translate-x-1/2 -translate-y-1/2 rounded-full bg-foreground animate-connection-travel","aria-hidden":!0})}),s[1]=n):n=s[1];let i;s[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("span",{className:"absolute inset-0 rounded-full border border-foreground/40 animate-connection-arrive","aria-hidden":!0}),s[2]=i):i=s[2];let o;return s[3]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsxs("div",{className:"flex items-center justify-between rounded-2xl border border-border/60 bg-muted/40 px-7 py-7",children:[e,n,t.jsxs("div",{className:"relative",children:[i,t.jsxs(tt,{children:[t.jsx("img",{src:"/logos/deco logo.svg",alt:"deco",className:"h-6 w-6 dark:hidden"}),t.jsx("img",{src:"/logos/deco logo negative.svg",alt:"deco",className:"hidden h-6 w-6 dark:block"})]})]})]}),s[3]=o):o=s[3],o}function yt(s){const e=E.c(4),{href:n}=s;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Xn,{}),e[0]=i):i=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsxs("div",{className:"grid gap-2",children:[t.jsx("h2",{className:"text-xl font-medium leading-7 text-foreground",children:Wn}),t.jsx("p",{className:"text-base leading-6 text-muted-foreground",children:Yn})]}),e[1]=o):o=e[1];let c;return e[2]!==n?(c=t.jsx("div",{className:"relative flex h-full w-full items-center justify-center p-10",children:t.jsxs("div",{className:"flex w-full max-w-[380px] flex-col gap-6 rounded-3xl border border-border bg-card p-8 card-shadow",children:[i,o,t.jsx(Zn,{href:n,size:"xl"})]})}),e[2]=n,e[3]=c):c=e[3],c}function Jn(s){const e=E.c(8),{className:n,href:i}=s,o=i===void 0?Ze:i;let c;e[0]!==n?(c=ee("flex items-center gap-4 rounded-2xl border border-border bg-card p-5 card-shadow transition-colors hover:bg-accent",n),e[0]=n,e[1]=c):c=e[1];let r;e[2]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("span",{className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-full bg-muted text-muted-foreground",children:t.jsx(ht,{size:20})}),e[2]=r):r=e[2];let l,a;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsxs("span",{className:"flex flex-1 flex-col gap-0.5",children:[t.jsx("span",{className:"text-base font-medium leading-5 text-foreground",children:"Prefer to talk to a human?"}),t.jsx("span",{className:"text-sm leading-5 text-muted-foreground",children:"Book a call and we'll run the diagnostic with you."})]}),a=t.jsx(gt,{size:18,className:"shrink-0 text-muted-foreground"}),e[3]=l,e[4]=a):(l=e[3],a=e[4]);let d;return e[5]!==o||e[6]!==c?(d=t.jsxs("a",{href:o,target:"_blank",rel:"noreferrer",className:c,children:[r,l,a]}),e[5]=o,e[6]=c,e[7]=d):d=e[7],d}function jt(s){const e=E.c(10),{host:n}=s,i=`https://www.google.com/s2/favicons?domain=${n}&sz=128`;let o,c,r;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-7 w-7 dark:hidden"}),c=t.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-7 w-7 hidden dark:block"}),r=t.jsx("div",{className:"h-6 w-px rotate-12 bg-border","aria-hidden":"true"}),e[0]=o,e[1]=c,e[2]=r):(o=e[0],c=e[1],r=e[2]);let l;e[3]!==i?(l=t.jsx("div",{className:"flex h-7 w-7 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-border bg-white",children:t.jsx("img",{src:i,alt:"",className:"h-5 w-5",loading:"lazy"})}),e[3]=i,e[4]=l):l=e[4];let a;e[5]!==n?(a=t.jsx("span",{className:"text-lg font-medium text-foreground",children:n}),e[5]=n,e[6]=a):a=e[6];let d;return e[7]!==l||e[8]!==a?(d=t.jsxs("div",{className:"flex items-center gap-3",children:[o,c,r,l,a]}),e[7]=l,e[8]=a,e[9]=d):d=e[9],d}function bt(s){const e=E.c(16),{label:n,iconSize:i,className:o,iconClassName:c,labelClassName:r}=s,l=i===void 0?14:i;let a;e[0]!==o?(a=ee("inline-flex items-center gap-2",o),e[0]=o,e[1]=a):a=e[1];let d;e[2]!==c?(d=ee("shrink-0 animate-spin",c),e[2]=c,e[3]=d):d=e[3];let f;e[4]!==l||e[5]!==d?(f=t.jsx(st,{size:l,className:d}),e[4]=l,e[5]=d,e[6]=f):f=e[6];let p;e[7]!==r?(p=ee("text-sm",r),e[7]=r,e[8]=p):p=e[8];let u;e[9]!==n||e[10]!==p?(u=t.jsx("span",{className:p,children:n}),e[9]=n,e[10]=p,e[11]=u):u=e[11];let x;return e[12]!==a||e[13]!==f||e[14]!==u?(x=t.jsxs("span",{className:a,children:[f,u]}),e[12]=a,e[13]=f,e[14]=u,e[15]=x):x=e[15],x}const es={route:"Preparing commerce onboarding...",workspace:"Preparing your commerce workspace...",connect:"Connecting workspace...",setup:"Setting up Commerce Discovery...",button:"Setting up"};function Ct(s){return es[s]}function St(s){const e=E.c(2),{variant:n}=s;let i;return e[0]!==n?(i=t.jsx(Y,{children:t.jsx(Ue,{variant:n})}),e[0]=n,e[1]=i):i=e[1],i}function Ue(s){const e=E.c(4),{variant:n}=s;let i;e[0]!==n?(i=Ct(n),e[0]=n,e[1]=i):i=e[1];let o;return e[2]!==i?(o=t.jsx("div",{className:"py-4",role:"status","aria-live":"polite",children:t.jsx(bt,{label:i,className:"text-muted-foreground"})}),e[2]=i,e[3]=o):o=e[3],o}function ts(){const s=E.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(bt,{label:Ct("button")}),s[0]=e):e=s[0],e}function Ci(){const s=E.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ss,{}),s[0]=e):e=s[0],e}const vt=q.createContext(null),Nt=()=>q.useContext(vt);function ns(s){if(!s)return null;const e=Ee(s);return e.ok?new URL(e.value).hostname:null}function ss(){const s=E.c(9);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/commerce-onboarding"},s[0]=e):e=s[0];const n=_t(e),{org:i,siteUrl:o}=n;let c;s[1]!==o?(c=ns(o),s[1]=o,s[2]=c):c=s[2];const r=c;let l;s[3]!==i||s[4]!==o?(l=t.jsx(is,{requestedOrgSlug:i,siteUrl:o}),s[3]=i,s[4]=o,s[5]=l):l=s[5];let a;return s[6]!==r||s[7]!==l?(a=t.jsx(vt.Provider,{value:r,children:l}),s[6]=r,s[7]=l,s[8]=a):a=s[8],a}function is(s){const e=E.c(8),{requestedOrgSlug:n,siteUrl:i}=s,{data:o,isPending:c}=Be.useSession(),r=Nt();if(c){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(St,{variant:"route"}),e[0]=a):a=e[0],a}if(!o){const a=typeof window>"u"?"/commerce-onboarding":`${window.location.pathname}${window.location.search}`;let d;e[1]!==r?(d=r?t.jsx(jt,{host:r}):void 0,e[1]=r,e[2]=d):d=e[2];let f;return e[3]!==d?(f=t.jsx(Y,{children:t.jsx(kt,{callbackUrl:a,allowAutoLogin:!1,title:"Unlock your full diagnostic",subtitle:null,brand:d})}),e[3]=d,e[4]=f):f=e[4],f}let l;return e[5]!==n||e[6]!==i?(l=t.jsx(os,{requestedOrgSlug:n,siteUrl:i}),e[5]=n,e[6]=i,e[7]=l):l=e[7],l}function os(s){const e=E.c(40),{requestedOrgSlug:n,siteUrl:i}=s,o=it(),c=It(),[r,l]=q.useState(null),[a,d]=q.useState(null),f=c.data?.map(ls)??[];let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p={mutationFn:rs,retry:!1,onSuccess:m=>{d(m)}},e[0]=p):p=e[0];const u=ke(p);if(c.isPending){let m;return e[1]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(St,{variant:"route"}),e[1]=m):m=e[1],m}if(c.error){let m;return e[2]!==c?(m=t.jsx(Te,{title:"We could not load your organizations",description:"Retry to continue commerce setup from this page.",actionLabel:"Retry",onRetry:()=>c.refetch()}),e[2]=c,e[3]=m):m=e[3],m}const x=n?f.find(m=>m.slug===n):null;if(x){let m;return e[4]!==x||e[5]!==i?(m=t.jsx(we,{org:x,initialSiteUrl:i}),e[4]=x,e[5]=i,e[6]=m):m=e[6],m}if(n){let m;return e[7]!==c?(m=t.jsx(Te,{title:"Organization not found",description:"We could not find that organization for your account.",actionLabel:"Retry",onRetry:()=>c.refetch()}),e[7]=c,e[8]=m):m=e[8],m}if(r){let m;return e[9]!==r||e[10]!==i?(m=t.jsx(we,{org:r,initialSiteUrl:i}),e[9]=r,e[10]=i,e[11]=m):m=e[11],m}if(f.length===1&&f[0]){let m;return e[12]!==f[0]||e[13]!==i?(m=t.jsx(we,{org:f[0],initialSiteUrl:i}),e[12]=f[0],e[13]=i,e[14]=m):m=e[14],m}if(f.length>1){let m;e[15]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(te,{title:"Choose an organization",description:"Select where commerce diagnostics should continue."}),e[15]=m):m=e[15];let b;e[16]===Symbol.for("react.memo_cache_sentinel")?(b=v=>l(v),e[16]=b):b=e[16];let C;return e[17]!==f?(C=t.jsx(Y,{children:t.jsxs("div",{className:"grid gap-10",children:[m,t.jsx(De,{className:"-mx-1 max-h-[60vh] overflow-y-auto px-1",children:t.jsx(Je,{organizations:f,selectLabel:"Continue",onSelected:b})})]})}),e[17]=f,e[18]=C):C=e[18],C}if(!a){let m;e[19]!==u?(m=()=>{u.reset(),u.mutate()},e[19]=u,e[20]=m):m=e[20];let b;return e[21]!==u||e[22]!==m?(b=t.jsx(as,{mutation:u,onRetry:m}),e[21]=u,e[22]=m,e[23]=b):b=e[23],b}const g=a;if(g?.success&&(g.status==="created"||g.status==="joined"||g.status==="already_has_organization")&&g.organization){let m;return e[24]!==g.organization||e[25]!==i?(m=t.jsx(we,{org:g.organization,initialSiteUrl:i}),e[24]=g.organization,e[25]=i,e[26]=m):m=e[26],m}if(g?.status==="ambiguous"&&g.organizations&&g.organizations.length>0){let m;e[27]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(te,{title:"Choose an organization",description:"Your email can access more than one organization. Choose where commerce setup should continue."}),e[27]=m):m=e[27];const b=g.domain??void 0;let C;e[28]!==o||e[29]!==i?(C=(N,_)=>{ot(),l({...N,slug:_}),o({to:"/commerce-onboarding",search:{org:_,siteUrl:i}})},e[28]=o,e[29]=i,e[30]=C):C=e[30];let v;return e[31]!==g.organizations||e[32]!==b||e[33]!==C?(v=t.jsx(Y,{children:t.jsxs("div",{className:"grid gap-10",children:[m,t.jsx(De,{className:"-mx-1 max-h-[60vh] overflow-y-auto px-1",children:t.jsx(Je,{organizations:g.organizations,domain:b,onJoined:C})})]})}),e[31]=g.organizations,e[32]=b,e[33]=C,e[34]=v):v=e[34],v}const j=g?.error??"We could not determine a commerce organization for this account.";let y;e[35]!==u?(y=()=>{d(null),u.reset()},e[35]=u,e[36]=y):y=e[36];let h;return e[37]!==j||e[38]!==y?(h=t.jsx(Te,{title:"Commerce onboarding needs support",description:j,actionLabel:"Try again",onRetry:y}),e[37]=j,e[38]=y,e[39]=h):h=e[39],h}async function rs(){const e=await(await fetch("/api/auth/custom/ensure-organization",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"}})).json();return e.success&&(e.status==="created"||e.status==="joined"||e.status==="already_has_organization")&&e.organization&&ot(),e}function ls(s){return{id:s.id,name:s.name,slug:s.slug,logo:s.logo??null}}function as(s){const e=E.c(7),{mutation:n,onRetry:i}=s,o=q.useRef(!1);let c;e[0]!==n?(c=d=>{!d||o.current||(o.current=!0,n.mutate())},e[0]=n,e[1]=c):c=e[1];const r=c;if(n.error){let d;return e[2]!==i?(d=t.jsx(Te,{title:"Commerce onboarding is unavailable",description:"We could not prepare an organization for commerce setup. Retry from this page or contact support.",actionLabel:"Retry",onRetry:i}),e[2]=i,e[3]=d):d=e[3],d}let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(Ue,{variant:"workspace"}),e[4]=l):l=e[4];let a;return e[5]!==r?(a=t.jsx(Y,{children:t.jsx("div",{ref:r,children:l})}),e[5]=r,e[6]=a):a=e[6],a}function te(s){const e=E.c(8),{title:n,description:i}=s,o=Nt();let c;e[0]!==o?(c=o?t.jsx(jt,{host:o}):t.jsxs("div",{children:[t.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),t.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]}),e[0]=o,e[1]=c):c=e[1];let r;e[2]!==i||e[3]!==n?(r=(n||i)&&t.jsxs("div",{className:"space-y-2",children:[n&&t.jsx("h1",{className:"text-2xl font-medium leading-8",children:n}),i&&t.jsx("p",{className:"text-base text-muted-foreground leading-6",children:i})]}),e[2]=i,e[3]=n,e[4]=r):r=e[4];let l;return e[5]!==c||e[6]!==r?(l=t.jsxs("div",{className:"grid gap-10",children:[c,r]}),e[5]=c,e[6]=r,e[7]=l):l=e[7],l}function Te(s){const e=E.c(9),{title:n,description:i,actionLabel:o,onRetry:c}=s;let r;e[0]!==i||e[1]!==n?(r=t.jsx(te,{title:n,description:i}),e[0]=i,e[1]=n,e[2]=r):r=e[2];let l;e[3]!==o||e[4]!==c?(l=t.jsx(B,{type:"button",size:"xl",className:"w-full",onClick:c,children:o}),e[3]=o,e[4]=c,e[5]=l):l=e[5];let a;return e[6]!==r||e[7]!==l?(a=t.jsx(Y,{children:t.jsxs("div",{className:"grid gap-10",children:[r,l]})}),e[6]=r,e[7]=l,e[8]=a):a=e[8],a}function cs(s){return s.content?.find(e=>e.text)?.text??"Commerce Discovery setup failed."}function Ie(s){const e=s;if(e.isError)throw new Error(cs(e));return e.structuredContent??s}function we(s){const e=E.c(10),{org:n,initialSiteUrl:i}=s,{data:o}=Be.useSession(),c=o?.user?.email;let r;e[0]!==i||e[1]!==c?(r=xt({siteUrl:i,email:c}),e[0]=i,e[1]=c,e[2]=r):r=e[2];const l=r;let a;e[3]!==l?(a=t.jsx(yt,{href:l}),e[3]=l,e[4]=a):a=e[4];const d=a;let f;return e[5]!==i||e[6]!==d||e[7]!==n||e[8]!==o?.user?.email?(f=t.jsx(wt,{children:p=>{const{reset:u}=p;return t.jsx(Et,{fallback:x=>{const{error:g,resetError:j}=x;return t.jsx(Y,{visual:d,children:t.jsx(ds,{orgName:n.name,message:g instanceof Error?g.message:"We could not check Commerce Discovery setup.",onRetry:()=>{u(),j()}})})},children:t.jsx(q.Suspense,{fallback:t.jsx(Y,{visual:d,children:t.jsx(Ue,{variant:"connect"})}),children:t.jsx(us,{org:n,initialSiteUrl:i,sessionEmail:o?.user?.email},`${n.id}:${i??""}`)})})}}),e[5]=i,e[6]=d,e[7]=n,e[8]=o?.user?.email,e[9]=f):f=e[9],f}function ds(s){const e=E.c(10),{orgName:n,message:i,onRetry:o}=s,c=`Commerce setup will continue for ${n}.`;let r;e[0]!==c?(r=t.jsx(te,{title:"Commerce diagnostics",description:c}),e[0]=c,e[1]=r):r=e[1];let l;e[2]!==i?(l=t.jsx(Oe,{message:i}),e[2]=i,e[3]=l):l=e[3];let a;e[4]!==o?(a=t.jsx(B,{type:"button",size:"xl",className:"w-full",onClick:o,children:"Retry"}),e[4]=o,e[5]=a):a=e[5];let d;return e[6]!==r||e[7]!==l||e[8]!==a?(d=t.jsxs("div",{className:"grid gap-10",children:[r,l,a]}),e[6]=r,e[7]=l,e[8]=a,e[9]=d):d=e[9],d}function us(s){const e=E.c(104),{org:n,initialSiteUrl:i,sessionEmail:o}=s,c=it();let r;e[0]!==n.id||e[1]!==n.slug?(r={connectionId:lt,orgId:n.id,orgSlug:n.slug},e[0]=n.id,e[1]=n.slug,e[2]=r):r=e[2];const l=Re(r),[a,d]=q.useState(i??""),[f,p]=q.useState(null),[u,x]=q.useState(null),g=q.useRef(!1),j=rt.COMMERCE_DISCOVERY(n.id),y=Rt(n.id),h=W.commerceDiscoveryConnection(n.id,j);let m;e[3]!==j||e[4]!==l?(m=async()=>{const $=await l.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:j}});return Ie($)},e[3]=j,e[4]=l,e[5]=m):m=e[5];let b;e[6]!==h||e[7]!==m?(b={queryKey:h,queryFn:m,retry:!1},e[6]=h,e[7]=m,e[8]=b):b=e[8];const C=Xe(b),v=W.commerceDiscoveryVirtualMcp(n.id,y);let N;e[9]!==l||e[10]!==y?(N=async()=>{const $=await l.callTool({name:"COLLECTION_VIRTUAL_MCP_GET",arguments:{id:y}});return Ie($)},e[9]=l,e[10]=y,e[11]=N):N=e[11];let _;e[12]!==v||e[13]!==N?(_={queryKey:v,queryFn:N,retry:!1},e[12]=v,e[13]=N,e[14]=_):_=e[14];const T=Xe(_);let k;e[15]!==l?(k=async $=>{const H=await l.callTool({name:"COMMERCE_DISCOVERY_SETUP",arguments:{siteUrl:$}});return Ie(H)},e[15]=l,e[16]=k):k=e[16];let w;e[17]!==C||e[18]!==T?(w=$=>{p($),x(null),C.refetch(),T.refetch()},e[17]=C,e[18]=T,e[19]=w):w=e[19];let F;e[20]===Symbol.for("react.memo_cache_sentinel")?(F=$=>{x($ instanceof Error?$.message:"Commerce Discovery setup failed.")},e[20]=F):F=e[20];let R;e[21]!==k||e[22]!==w?(R={mutationFn:k,retry:!1,onSuccess:w,onError:F},e[21]=k,e[22]=w,e[23]=R):R=e[23];const I=ke(R);let P;e[24]!==l?(P={mutationFn:async $=>{const H=await l.callTool({name:"COMMERCE_DISCOVERY_RUN",arguments:{siteUrl:$}});return Ie(H)},retry:!1},e[24]=l,e[25]=P):P=e[25];const A=ke(P),D=!!C.data.item&&!!T.data.item,K=C.data.item,M=typeof K?.metadata?.siteUrl=="string"?K.metadata.siteUrl:void 0,U=i||a||M||"";let z;e[26]!==U||e[27]!==o?(z=xt({siteUrl:U,email:o}),e[26]=U,e[27]=o,e[28]=z):z=e[28];const S=z;let L;e[29]!==S?(L=t.jsx(yt,{href:S}),e[29]=S,e[30]=L):L=e[30];const V=L;let Z;e[31]!==I?(Z=$=>{const H=Ee($);if(!H.ok){x(H.error);return}x(null),I.mutate(H.value)},e[31]=I,e[32]=Z):Z=e[32];const O=Z;let G;e[33]!==i||e[34]!==O||e[35]!==D?(G=$=>{!$||g.current||D||!i||(g.current=!0,O(i))},e[33]=i,e[34]=O,e[35]=D,e[36]=G):G=e[36];const je=G;let be;e[37]!==O||e[38]!==a?(be=$=>{$.preventDefault(),O(a)},e[37]=O,e[38]=a,e[39]=be):be=e[39];const X=be;let Ce;e[40]!==j||e[41]!==f?.reportApp||e[42]!==y?(Ce=f?.reportApp??{connectionId:j,virtualMcpId:y,toolName:Ut},e[40]=j,e[41]=f?.reportApp,e[42]=y,e[43]=Ce):Ce=e[43];const Q=Ce;let Se;e[44]!==U||e[45]!==c||e[46]!==n.slug||e[47]!==Q.connectionId||e[48]!==Q.toolName||e[49]!==Q.virtualMcpId||e[50]!==A?(Se=()=>{const $=Ee(U);$.ok&&A.mutate($.value),localStorage.setItem(Tt.sidebarOpen(),JSON.stringify(!1)),c({to:"/$org/$taskId",params:{org:n.slug,taskId:crypto.randomUUID()},search:{virtualmcpid:Q.virtualMcpId,main:Ot(Q.connectionId,Q.toolName),chat:0}})},e[44]=U,e[45]=c,e[46]=n.slug,e[47]=Q.connectionId,e[48]=Q.toolName,e[49]=Q.virtualMcpId,e[50]=A,e[51]=Se):Se=e[51];const $e=Se;if(D){let $;return e[52]!==S||e[53]!==V||e[54]!==U||e[55]!==$e||e[56]!==n||e[57]!==Q?($=t.jsx(ms,{org:n,reportApp:Q,onOpenReport:$e,meetingUrl:S,meetingVisual:V,siteUrl:U}),e[52]=S,e[53]=V,e[54]=U,e[55]=$e,e[56]=n,e[57]=Q,e[58]=$):$=e[58],$}if(i){let $;e[59]!==i?($=Ee(i),e[59]=i,e[60]=$):$=e[60];const H=$;if(!H.ok){const Le=`Commerce setup will continue for ${n.name}.`;let ae;e[61]!==Le?(ae=t.jsx(te,{title:"Commerce diagnostics",description:Le}),e[61]=Le,e[62]=ae):ae=e[62];let ce;e[63]!==H.error?(ce=t.jsx(Oe,{message:H.error}),e[63]=H.error,e[64]=ce):ce=e[64];let de;e[65]!==X||e[66]!==u||e[67]!==I.isPending||e[68]!==a?(de=t.jsx(Ae,{siteUrl:a,error:u,isSubmitting:I.isPending,onSiteUrlChange:d,onSubmit:X}),e[65]=X,e[66]=u,e[67]=I.isPending,e[68]=a,e[69]=de):de=e[69];let ue;e[70]!==ae||e[71]!==ce||e[72]!==de?(ue=t.jsxs("div",{className:"grid gap-10",children:[ae,ce,de]}),e[70]=ae,e[71]=ce,e[72]=de,e[73]=ue):ue=e[73];let _e;return e[74]!==V||e[75]!==ue?(_e=t.jsx(Y,{visual:V,children:ue}),e[74]=V,e[75]=ue,e[76]=_e):_e=e[76],_e}const ze=`Commerce Discovery is being prepared for ${H.value}.`;let oe;e[77]!==ze?(oe=t.jsx(te,{title:"Commerce diagnostics",description:ze}),e[77]=ze,e[78]=oe):oe=e[78];let re;e[79]!==X||e[80]!==u||e[81]!==I||e[82]!==a?(re=u?t.jsxs(t.Fragment,{children:[t.jsx(Oe,{message:u}),t.jsx(Ae,{siteUrl:a,error:null,isSubmitting:I.isPending,onSiteUrlChange:d,onSubmit:X})]}):t.jsx(Ue,{variant:"setup"}),e[79]=X,e[80]=u,e[81]=I,e[82]=a,e[83]=re):re=e[83];let le;e[84]!==oe||e[85]!==re||e[86]!==je?(le=t.jsxs("div",{ref:je,className:"grid gap-10",children:[oe,re]}),e[84]=oe,e[85]=re,e[86]=je,e[87]=le):le=e[87];let Ne;return e[88]!==V||e[89]!==le?(Ne=t.jsx(Y,{visual:V,children:le}),e[88]=V,e[89]=le,e[90]=Ne):Ne=e[90],Ne}const Pe=`Commerce setup will continue for ${n.name}.`;let ne;e[91]!==Pe?(ne=t.jsx(te,{title:"Commerce diagnostics",description:Pe}),e[91]=Pe,e[92]=ne):ne=e[92];let se;e[93]!==X||e[94]!==u||e[95]!==I.isPending||e[96]!==a?(se=t.jsx(Ae,{siteUrl:a,error:u,isSubmitting:I.isPending,onSiteUrlChange:d,onSubmit:X}),e[93]=X,e[94]=u,e[95]=I.isPending,e[96]=a,e[97]=se):se=e[97];let ie;e[98]!==ne||e[99]!==se?(ie=t.jsxs("div",{className:"grid gap-10",children:[ne,se]}),e[98]=ne,e[99]=se,e[100]=ie):ie=e[100];let ve;return e[101]!==V||e[102]!==ie?(ve=t.jsx(Y,{visual:V,children:ie}),e[101]=V,e[102]=ie,e[103]=ve):ve=e[103],ve}function Ae(s){const e=E.c(22),{siteUrl:n,error:i,isSubmitting:o,onSiteUrlChange:c,onSubmit:r}=s;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("label",{className:"text-sm font-medium",htmlFor:"commerce-site-url",children:"Website URL"}),e[0]=l):l=e[0];let a;e[1]!==c?(a=y=>c(y.target.value),e[1]=c,e[2]=a):a=e[2];const d=!!i;let f;e[3]!==o||e[4]!==n||e[5]!==a||e[6]!==d?(f=t.jsx(Ge,{id:"commerce-site-url",type:"text",inputMode:"url",value:n,onChange:a,placeholder:"https://example.com","aria-invalid":d,disabled:o}),e[3]=o,e[4]=n,e[5]=a,e[6]=d,e[7]=f):f=e[7];let p;e[8]!==i?(p=i?t.jsx(Oe,{message:i}):null,e[8]=i,e[9]=p):p=e[9];let u;e[10]!==f||e[11]!==p?(u=t.jsxs("div",{className:"grid gap-2",children:[l,f,p]}),e[10]=f,e[11]=p,e[12]=u):u=e[12];let x;e[13]!==o?(x=o?t.jsx(ts,{}):t.jsxs(t.Fragment,{children:["Continue",t.jsx(at,{size:16})]}),e[13]=o,e[14]=x):x=e[14];let g;e[15]!==o||e[16]!==x?(g=t.jsx(B,{type:"submit",size:"xl",className:"w-full",disabled:o,children:x}),e[15]=o,e[16]=x,e[17]=g):g=e[17];let j;return e[18]!==r||e[19]!==u||e[20]!==g?(j=t.jsxs("form",{className:"grid gap-4",onSubmit:r,children:[u,g]}),e[18]=r,e[19]=u,e[20]=g,e[21]=j):j=e[21],j}function ms(s){const e=E.c(20),{org:n,reportApp:i,onOpenReport:o,meetingUrl:c,meetingVisual:r,siteUrl:l}=s;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(te,{}),e[0]=a):a=e[0];let d;e[1]!==n||e[2]!==i.connectionId||e[3]!==l?(d=t.jsx(Qn,{org:n,cdConnectionId:i.connectionId,siteUrl:l}),e[1]=n,e[2]=i.connectionId,e[3]=l,e[4]=d):d=e[4];let f;e[5]!==c?(f=t.jsx(Jn,{className:"md:hidden",href:c}),e[5]=c,e[6]=f):f=e[6];const p=!i.virtualMcpId;let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(at,{size:18}),e[7]=u):u=e[7];let x;e[8]!==o||e[9]!==p?(x=t.jsxs(B,{type:"button",size:"xl",className:"w-full rounded-2xl text-base font-medium",onClick:o,disabled:p,children:["See full report",u]}),e[8]=o,e[9]=p,e[10]=x):x=e[10];let g;e[11]!==f||e[12]!==x?(g=t.jsxs("div",{className:"flex shrink-0 flex-col gap-3 md:mt-8",children:[f,x]}),e[11]=f,e[12]=x,e[13]=g):g=e[13];let j;e[14]!==d||e[15]!==g?(j=t.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-6 md:grid md:gap-4",children:[a,d,g]}),e[14]=d,e[15]=g,e[16]=j):j=e[16];let y;return e[17]!==r||e[18]!==j?(y=t.jsx(Y,{align:"fill",visual:r,children:j}),e[17]=r,e[18]=j,e[19]=y):y=e[19],y}function Oe(s){const e=E.c(2),{message:n}=s;let i;return e[0]!==n?(i=t.jsx("p",{className:"text-sm leading-5 text-destructive",role:"alert",children:n}),e[0]=n,e[1]=i):i=e[1],i}export{Ci as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{am as st,c as k,j as n,r as $,C as J,m as xe,l as Q,i as le,an as Z,t as U,K as te,k as se,B as Y,d as nt,a7 as it,E as ot,a as rt}from"./index-CpYfLdbh.js";import{u as ge}from"./use-mobile-Dl3xzohk.js";import{u as lt}from"./useQueries-BUNJnzbM.js";import{i as at,u as ae,m as ct,a as dt,S as mt}from"./use-mcp-client-DN-NMZV3.js";import{u as ut,b as ft,v as pt,a as ht}from"./use-virtual-mcp-BZBO6fTt.js";import{i as xt}from"./ChevronUp-CazSoL4d.js";import{e as gt,A as ce,Y as yt,a8 as bt,D as jt,k as vt}from"./agent-icon-DyIO38tc.js";import{s as ye}from"./Plus-DYuvLVJp.js";import{i as $e}from"./X-DFZG0D7q.js";import{C as oe}from"./index-CF2fOu8a.js";import{b as Nt}from"./chat-context-B8Pf9_Ws.js";import{N as wt}from"./decopilot-7gVBBoRg.js";import{g as St,b as Ae,c as re,K as Pe,P as Ee,D as Me,d as _t,S as Ct,v as It,e as Tt,C as kt,s as $t,l as At,k as Pt,o as Et,u as Mt,j as zt,h as Ot}from"./sortable.esm-Cxy3zG7_.js";import{u as ze,a as Oe,o as Lt}from"./use-organization-settings-CQ99RcOM.js";import{c as be,b as Dt,h as Ht}from"./shell-layout-DRb4EqiB.js";import{I as Le}from"./input-CIRD_tZz.js";import{S as Rt,t as je,P as Ft,j as Ut,s as Bt,g as Vt}from"./scroll-area-D2_mdzGg.js";import{S as Kt,a as qt,b as Wt,c as Gt,d as Qt}from"./sheet-BRZ8PIrM.js";import{S as H}from"./skeleton-DHujU9w_.js";import{t as De}from"./ChevronDown-siikX1CB.js";import{d as He}from"./ZoomOut-DZZylEjW.js";import{g as Re,M as Jt}from"./types-COD2S7bi.js";import{I as Fe}from"./integration-icon-DR2sJls0.js";import{a as Xt,b as Zt,c as Yt,d as we,S as es}from"./select-BVI-5ZuA.js";import{T as ts}from"./textarea-B3tIZUed.js";import{u as Ue}from"./studio-tools-DgyOaysE.js";import{a as ss}from"./use-mcp-tools-HiR2aat0.js";import{i as ns}from"./XCircle-C4Okg4wT.js";import{f as is}from"./tab-id-BptcWVWa.js";import{g as os}from"./use-mcp-prompts-C617vkSu.js";import{u as rs,w as ls}from"./hooks-BPl3QtCR.js";import{a as as,g as cs,c as ds,b as ms,D as us}from"./dropdown-menu-DpexHxwz.js";import{s as fs}from"./Trash01-D3NdLyIt.js";import{a as ps,u as hs}from"./use-ai-providers-C9TDMEuy.js";import{u as xs}from"./connect-desktop-dialog-cYgK2XT4.js";import{a as gs}from"./toolbar-C_VPmr7n.js";import"./auth-Duwx_iL2.js";import"./use-collections-BLUmcReO.js";import"./AlertCircle-CJRvjf9E.js";import"./Tool01-CLVT6zPR.js";import"./SwitchHorizontal01-DqWROiIl.js";import"./Settings02-Ca71UgHw.js";import"./ArrowUpRight-C-ASyyy7.js";import"./ZapSquare-CSwYwLqC.js";import"./Users03-zuYH9zmO.js";import"./CheckCircle-DHlN5aNG.js";import"./ChevronLeft-BMBu9Rmw.js";import"./ChevronRight-bS8zu0mE.js";import"./DotsVertical--w5kUeSe.js";import"./Stars02-CGjIjk8V.js";import"./Eye-evykl5te.js";import"./Globe01-C5qUvOk3.js";import"./FilterLines-CbmfI3qe.js";import"./Star01-Cdx4KR4U.js";import"./Globe04-ayhcWvo6.js";import"./HardDrive-BZnTfRN9.js";import"./Key01-BHQPeab7.js";import"./LayoutLeft-eB33hZq-.js";import"./LinkExternal01-C9BK0yA_.js";import"./Monitor01-CuUeTTqr.js";import"./Sun-C4MaHaW6.js";import"./Palette-B-wglEVr.js";import"./Play-eP0tvaLl.js";import"./SearchMd-BqOCkx90.js";import"./Shield01-DY339kBm.js";import"./Stars01-DPz6mq_I.js";import"./Upload01-CwAL7vx3.js";import"./User01-CPYMutV0.js";import"./Users01-Ih8cqcDu.js";import"./XClose-CsMYL6lC.js";import"./Zap-0-1HsH9l.js";import"./tooltip-CJMltTIZ.js";import"./dialog-C2ETGOlj.js";import"./drawer-CliHEmeh.js";import"./collection-search-oL_WM4rt.js";import"./form-Bbk-lY-7.js";import"./label-B97xU05r.js";import"./tabs-DHLQ27WW.js";import"./toggle-group-CRyR0oMn.js";import"./popover-Dg4e80gp.js";import"./command-D3tx4Z-o.js";import"./index-B3I-Kacs.js";import"./useInfiniteQuery-D1y00mLl.js";import"./use-infinite-scroll-_XAuQc_I.js";import"./question-004-sINsf4GQ.js";import"./checkbox-BQjinmyU.js";import"./ai-providers-logos-DD3qZ33J.js";import"./avatar-DK4P1R5g.js";import"./settings-section-Cjt1BmIe.js";import"./card-CAloKMup.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-DS-KJfkn.js";import"./use-registry-connections-O8z8zBrP.js";import"./use-connection-w2D8E4uB.js";import"./extract-connection-data-CdrxJbbw.js";import"./collection-tabs-BmqFW71W.js";import"./badge-BKEWn2TK.js";import"./connection-form-helpers-D6xKQSqh.js";import"./authenticate-and-persist-oauth-C_sfC4y1.js";import"./mcp-oauth-Djb0mwKI.js";import"./useSuspenseInfiniteQuery-BiCq230f.js";import"./required-auth-layout-k-s2E1Qb.js";import"./use-org-sso-DqXQdm0q.js";import"./use-clock-tick-CMT1YGdo.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-B3D09Hxq.js";import"./file-type-icon-BqeQzn3H.js";import"./content-blocks-o63cs2vh.js";import"./use-navigate-to-agent-Cv7a1gGO.js";import"./decopilot-sse-pool-85Pin_5c.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";function ys(t,e){return lt({...t,queries:t.queries.map(s=>({...s,suspense:!0,throwOnError:st,enabled:!0,placeholderData:void 0}))},e)}function Be(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(bs,{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 bs(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(ts,{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=x=>r(x==="true"),e[6]=r,e[7]=u):u=e[7];let f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(Xt,{className:"h-7 text-xs",children:n.jsx(Zt,{placeholder:"Select…"})}),e[8]=f):f=e[8];let p;e[9]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsxs(Yt,{children:[n.jsx(we,{value:"true",children:"true"}),n.jsx(we,{value:"false",children:"false"})]}),e[9]=p):p=e[9];let h;return e[10]!==c||e[11]!==u?(h=n.jsxs(es,{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(Le,{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 js(t){const e=k.c(16),{open:s,onOpenChange:o}=t,[i,r]=$.useState("");let a,d;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(Kt,{children:"Manage home"}),d=n.jsx(qt,{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(gt,{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=x=>r(x.target.value),e[3]=m):m=e[3];let c;e[4]!==i?(c=n.jsxs(Wt,{className:"px-5 py-4 border-b border-border",children:[a,d,n.jsxs("div",{className:"relative mt-3",children:[l,n.jsx(Le,{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(Js,{}),e[6]=u):u=e[6];let f;e[7]!==i?(f=n.jsx(Rt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"p-3 flex flex-col gap-4",children:n.jsx($.Suspense,{fallback:u,children:n.jsx(Ns,{search:i})})})}),e[7]=i,e[8]=f):f=e[8];let p;e[9]!==c||e[10]!==f?(p=n.jsxs(Gt,{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(Qt,{open:s,onOpenChange:o,children:p}),e[12]=o,e[13]=s,e[14]=p,e[15]=h):h=e[15],h}function vs(t){const e=k.c(32),{org:s}=J(),o=ze();let i;e[0]!==o?.ids?(i=o?.ids??[],e[0]=o?.ids,e[1]=i):i=e[1];const r=i,a=Oe(),d=ft(),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 x=p>=ne;let y;e[10]!==x||e[11]!==f||e[12]!==a?(y=_=>f(_)||x?Promise.resolve():a.apply(I=>I.includes(_)?null:[...I,_]),e[10]=x,e[11]=f,e[12]=a,e[13]=y):y=e[13];const b=y;let v;e[14]!==a?(v=_=>a.apply(I=>I.filter(T=>T!==_)),e[14]=a,e[15]=v):v=e[15];const N=v;let j;e[16]!==a?(j=_=>a.apply(()=>_),e[16]=a,e[17]=j):j=e[17];const g=j;let w;e[18]!==d||e[19]!==x||e[20]!==f||e[21]!==c||e[22]!==a?(w=async(_,I)=>{await d.update.mutateAsync({id:_.id,data:{metadata:I}}),!f(_.id)&&!x&&await a.apply(T=>T.includes(_.id)?null:[...T,_.id]),await c()},e[18]=d,e[19]=x,e[20]=f,e[21]=c,e[22]=a,e[23]=w):w=e[23];const S=w;let C;return e[24]!==b||e[25]!==x||e[26]!==r||e[27]!==f||e[28]!==N||e[29]!==g||e[30]!==S?(C={homeIds:r,isOnHome:f,atLimit:x,addAgent:b,removeAgent:N,reorder:g,saveAgentMetadata:S},e[24]=b,e[25]=x,e[26]=r,e[27]=f,e[28]=N,e[29]=g,e[30]=S,e[31]=C):C=e[31],C}function Ns(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=ut(o);let r;e[1]!==i?(r=new Set(i.map(Is)),e[1]=i,e[2]=r):r=e[2];const a=vs(r);let d,l,m;if(e[3]!==i||e[4]!==a||e[5]!==s){const x=new Map(i.map(Cs));d=s.trim().toLowerCase();const y=N=>!d||N.title?.toLowerCase().includes(d);l=a.homeIds.map(N=>x.get(N)).filter(_s).filter(y);const b=St(i);let v;e[9]!==a?(v=N=>!a.isOnHome(N.id),e[9]=a,e[10]=v):v=e[10],m=i.filter(Ss).filter(N=>!b.has(N.id)).filter(v).filter(y).sort(ws),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(Ts,{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(As,{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 ws(t,e){return(t.title??"").localeCompare(e.title??"")}function Ss(t){return t.id&&!at(t.id)}function _s(t){return!!t}function Cs(t){return[t.id,t]}function Is(t){return t.id}function Ve(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 Ts(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=Ae(re(Ee,i),re(Pe,r));let d;e[2]!==s?(d=p=>{const{active:h,over:x}=p;if(!x||h.id===x.id)return;const y=s.homeIds,b=y.indexOf(h.id),v=y.indexOf(x.id);b===-1||v===-1||s.reorder(At([...y],b,v)).catch($s)},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(Ve,{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(Me,{sensors:a,collisionDetection:_t,onDragEnd:l,children:n.jsx(Ct,{items:o.map(ks),strategy:It,children:n.jsx("div",{className:"flex flex-col gap-1",children:o.map(p=>n.jsx(Es,{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 ks(t){return t.id}function $s(){return U.error("Couldn't reorder home — please try again.")}function As(t){const e=k.c(6),{home:s,agents:o,hasSearch:i}=t,[r,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(Ve,{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(Os,{agent:c,home:s},c.id))}),o.length>r&&n.jsxs("button",{type:"button",onClick:()=>a(Ps),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 Ps(t){return t+20}function Ke(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 Es(t){const e=k.c(57),{agent:s,home:o}=t,[i,r]=$.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=Ke(s)||"Quick access";let h;e[2]!==c?(h=kt.Transform.toString(c),e[2]=c,e[3]=h):h=e[3];const x=f?.5:void 0,y=f?100:void 0;let b;e[4]!==h||e[5]!==x||e[6]!==y||e[7]!==u?(b={transform:h,transition:u,opacity:x,zIndex:y},e[4]=h,e[5]=x,e[6]=y,e[7]=u,e[8]=b):b=e[8];const v=b,N=f&&"shadow-lg";let j;e[9]!==N?(j=Q("rounded-lg border border-border bg-card",N),e[9]=N,e[10]=j):j=e[10];const g=`Drag to reorder ${s.title??s.id}`;let w;e[11]===Symbol.for("react.memo_cache_sentinel")?(w=n.jsx(He,{size:14}),e[11]=w):w=e[11];let S;e[12]!==d||e[13]!==l||e[14]!==g?(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":g,children:w}),e[12]=d,e[13]=l,e[14]=g,e[15]=S):S=e[15];let C;e[16]===Symbol.for("react.memo_cache_sentinel")?(C=()=>r(zs),e[16]=C):C=e[16];const _=s.title??s.id;let I;e[17]!==s.icon||e[18]!==_?(I=n.jsx(ce,{icon:s.icon,name:_,size:"sm"}),e[17]=s.icon,e[18]=_,e[19]=I):I=e[19];const T=s.title??s.id;let P;e[20]!==T?(P=n.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:T}),e[20]=T,e[21]=P):P=e[21];let M;e[22]!==p?(M=n.jsx("div",{className:"truncate text-xs text-muted-foreground",children:p}),e[22]=p,e[23]=M):M=e[23];let z;e[24]!==P||e[25]!==M?(z=n.jsxs("div",{className:"min-w-0 flex-1",children:[P,M]}),e[24]=P,e[25]=M,e[26]=z):z=e[26];const B=i&&"rotate-180";let O;e[27]!==B?(O=Q("shrink-0 text-muted-foreground transition-transform",B),e[27]=B,e[28]=O):O=e[28];let L;e[29]!==O?(L=n.jsx(De,{size:16,className:O}),e[29]=O,e[30]=L):L=e[30];let K;e[31]!==i||e[32]!==I||e[33]!==z||e[34]!==L?(K=n.jsxs("button",{type:"button",onClick:C,className:"flex min-w-0 flex-1 items-center gap-2.5 text-left outline-none","aria-expanded":i,children:[I,z,L]}),e[31]=i,e[32]=I,e[33]=z,e[34]=L,e[35]=K):K=e[35];let A;e[36]!==s.id||e[37]!==o?(A=()=>o.removeAgent(s.id).catch(Ms),e[36]=s.id,e[37]=o,e[38]=A):A=e[38];const V=`Remove ${s.title??s.id} from home`;let D;e[39]===Symbol.for("react.memo_cache_sentinel")?(D=n.jsx($e,{size:14}),e[39]=D):D=e[39];let E;e[40]!==A||e[41]!==V?(E=n.jsx("button",{type:"button",onClick:A,"aria-label":V,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:D}),e[40]=A,e[41]=V,e[42]=E):E=e[42];let R;e[43]!==S||e[44]!==K||e[45]!==E?(R=n.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-2.5",children:[S,K,E]}),e[43]=S,e[44]=K,e[45]=E,e[46]=R):R=e[46];let F;e[47]!==s||e[48]!==i||e[49]!==o?(F=i&&n.jsx(qe,{agent:s,home:o}),e[47]=s,e[48]=i,e[49]=o,e[50]=F):F=e[50];let W;return e[51]!==m||e[52]!==v||e[53]!==R||e[54]!==F||e[55]!==j?(W=n.jsxs("div",{ref:m,style:v,className:j,children:[R,F]}),e[51]=m,e[52]=v,e[53]=R,e[54]=F,e[55]=j,e[56]=W):W=e[56],W}function Ms(){return U.error("Couldn't remove from home — please try again.")}function zs(t){return!t}function Os({agent:t,home:e}){const[s,o]=$.useState(!1),[i,r]=$.useState(!1),a=Ke(t),d=async()=>{if(!e.atLimit){r(!0);try{await e.addAgent(t.id)}catch{U.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(De,{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(ye,{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(Ls).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(Hs,{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(Ds,{}),e[9]=u):u=e[9];const f=m??null;let p;e[10]!==s||e[11]!==o||e[12]!==f?(p=n.jsx($.Suspense,{fallback:u,children:n.jsx(Vs,{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 Ls(t){return t.connection_id}function Ds(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsxs("div",{className:"flex flex-col gap-2 py-1",children:[n.jsx(H,{className:"h-8 w-full"}),n.jsx(H,{className:"h-8 w-2/3"})]}),t[0]=e):e=t[0],e}function Hs({agent:t,home:e,connectionIds:s,pinnedTiles:o}){const i=Ue(),{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 x=Re(h._meta);return x?[{name:h.name,description:h.description,resourceUri:x,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(H,{className:"h-7 w-full"}),n.jsx(H,{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(Us,{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(Bs,{agent:t,home:e,connection:c,tool:u},`add:${c.id}:${u.name}`)))]})]})}function We(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 Rs(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 Fs(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 Us({agent:t,home:e,connection:s,tool:o,tile:i}){const[r,a]=$.useState(!1),[d,l]=$.useState(!1),m=o.inputSchema?.properties&&Object.keys(o.inputSchema.properties).length>0,[c,u]=$.useState(()=>Rs(i.toolInput,o.inputSchema?.properties)),f=async()=>{a(!0);try{const x=Z(t.metadata?.ui),y=i.tileId?x.filter(v=>v.tileId!==i.tileId):x.filter(v=>v!==i),b={...t.metadata??{},ui:{...t.metadata?.ui??{},homeTile:null,homeTiles:y}};await e.saveAgentMetadata(t,b),l(!1)}catch(x){console.error("[home-tiles] failed to remove tile",x),U.error("Couldn't update home — please try again.")}finally{a(!1)}},p=async()=>{a(!0);try{let x;if(m&&o.inputSchema?.properties){const N=We(c,o.inputSchema.properties);if(!N){U.error("Invalid JSON in one of the fields — please fix it."),a(!1);return}Object.keys(N).length>0&&(x=N)}const b=Z(t.metadata?.ui).map(N=>(i.tileId?N.tileId===i.tileId:N===i)?{...N,toolInput:x}:N),v={...t.metadata??{},ui:{...t.metadata?.ui??{},homeTile:null,homeTiles:b}};await e.saveAgentMetadata(t,v),l(!1)}catch(x){console.error("[home-tiles] failed to save tile",x),U.error("Couldn't update home — please try again.")}finally{a(!1)}},h=Fs(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(Fe,{icon:s.icon,name:s.title,size:"xs"}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("div",{className:"truncate text-sm text-foreground",children:je(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(x=>!x),"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(yt,{size:14})}),n.jsx(ve,{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(Be,{properties:o.inputSchema.properties,required:o.inputSchema.required,values:c,onChange:(x,y)=>u(b=>({...b,[x]:y}))}),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 Bs({agent:t,home:e,connection:s,tool:o}){const[i,r]=$.useState(!1),[a,d]=$.useState(!1),l=o.inputSchema?.properties&&Object.keys(o.inputSchema.properties).length>0,[m,c]=$.useState({}),u=async()=>{if(l&&!a){d(!0);return}if(!e.isOnHome(t.id)&&e.atLimit){U.error(`Home is full (${ne}) — remove an agent first`);return}await f()},f=async()=>{r(!0);try{let p;if(l&&o.inputSchema?.properties){const b=We(m,o.inputSchema.properties);if(!b){U.error("Invalid JSON in one of the fields — please fix it."),r(!1);return}Object.keys(b).length>0&&(p=b)}const x=[...Z(t.metadata?.ui),{tileId:crypto.randomUUID(),connectionId:s.id,resourceUri:o.resourceUri,toolName:o.name,...p?{toolInput:p}:{}}],y={...t.metadata??{},ui:{...t.metadata?.ui??{},homeTile:null,homeTiles:x}};await e.saveAgentMetadata(t,y),d(!1),c({})}catch(p){console.error("[home-tiles] failed to add tile",p),U.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(Fe,{icon:s.icon,name:s.title,size:"xs"}),n.jsx("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:je(o.name)}),n.jsx(ve,{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(Be,{properties:o.inputSchema.properties,required:o.inputSchema.required,values:m,onChange:(p,h)=>c(x=>({...x,[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 ve(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(bt,{size:14}):n.jsx(ye,{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 Vs(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:g}=await d.listPrompts();return g.map(Gs)},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=be(r.slug);let x,y;if(e[12]!==s.id||e[13]!==u||e[14]!==h.prompts){let g;e[17]!==s.id?(g=S=>S.agentId===s.id&&S.promptName,e[17]=s.id,e[18]=g):g=e[18],x=h.prompts.filter(g).map(Ws);let w;e[19]!==u?(w=u??[],e[19]=u,e[20]=w):w=e[20],y=[...w];for(const S of x)y.some(C=>C.name===S.name)||y.push(S);e[12]=s.id,e[13]=u,e[14]=h.prompts,e[15]=x,e[16]=y}else x=e[15],y=e[16];if(f&&x.length===0){let g;return e[21]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx(H,{className:"h-7 w-full"}),n.jsx(H,{className:"h-7 w-2/3"})]}),e[21]=g):g=e[21],g}if(p&&x.length===0)return console.error("[home-tiles] listPrompts failed for agent",s.id,p),null;if(y.length===0)return null;let b;e[22]!==i||e[23]!==y?(b=i??y.map(qs),e[22]=i,e[23]=y,e[24]=b):b=e[24];let v;e[25]!==b?(v=new Set(b),e[25]=b,e[26]=v):v=e[26];const N=v;let j;return e[27]!==s||e[28]!==o||e[29]!==y||e[30]!==N?(j=n.jsx("div",{className:"flex flex-col gap-0.5",children:y.map(g=>n.jsx(Qs,{agent:s,home:o,prompt:g,allPromptNames:y.map(Ks),isPinned:N.has(g.name)},g.name))}),e[27]=s,e[28]=o,e[29]=y,e[30]=N,e[31]=j):j=e[31],j}function Ks(t){return t.name}function qs(t){return t.name}function Ws(t){return{name:t.promptName,title:t.title,description:t.description}}function Gs(t){return{name:t.name,title:t.title,description:t.description}}function Qs({agent:t,home:e,prompt:s,allPromptNames:o,isPinned:i}){const[r,a]=$.useState(!1),d=async()=>{if(!i&&!e.isOnHome(t.id)&&e.atLimit){U.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),U.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??je(s.name)}),n.jsx(ve,{isPinned:i,submitting:r,onClick:d,label:i?"Remove from home":"Add to home"})]})}function Js(){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},Xs)}),t[0]=e):e=t[0],e}function Xs(t,e){return n.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-border p-2.5",children:[n.jsx(H,{className:"size-8 rounded-md"}),n.jsxs("div",{className:"flex-1 space-y-1.5",children:[n.jsx(H,{className:"h-3 w-1/2"}),n.jsx(H,{className:"h-2.5 w-1/3"})]})]},e)}const ee=1,Ge=`home-board.layout.v${ee}`;function Qe(t){return`home-board.layout.v${ee}.${t}`}const Je={version:ee,tiles:{},hidden:[]};function fe(t){return!t||t.version!==ee?Je:{version:ee,tiles:t.tiles??{},hidden:Array.isArray(t.hidden)?t.hidden:[]}}function Zs(t){return Object.keys(t.tiles).length>0||t.hidden.length>0}function Ys(t){try{const e=localStorage.getItem(Qe(t));return e?fe(JSON.parse(e)):void 0}catch{return}}function Se(t,e){try{localStorage.setItem(Qe(t),JSON.stringify(e))}catch{}}async function _e(t,e){if(!(await fetch(`/api/${t}/kv/${Ge}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok)throw new Error("Failed to save board layout")}function en(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=Ys(t),e[2]=t,e[3]=r):r=e[3];const a=r;let d;e[4]!==a||e[5]!==t?(d=async()=>{const b=await fetch(`/api/${t}/kv/${Ge}`);if(b.status===404)return a&&Zs(a)?(await _e(t,a),a):Je;if(!b.ok)throw new Error("Failed to load board layout");const v=await b.json(),N=fe(v.value);return Se(t,N),N},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:b=>_e(t,b)},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=b=>{Se(t,b),s.setQueryData(i,b),f.mutate(b)},e[13]=f,e[14]=t,e[15]=s,e[16]=i,e[17]=p):p=e[17];const h=p;let x;e[18]!==m?(x=fe(m),e[18]=m,e[19]=x):x=e[19];let y;return e[20]!==c||e[21]!==h||e[22]!==x?(y={layout:x,isLoading:c,save:h},e[20]=c,e[21]=h,e[22]=x,e[23]=y):y=e[23],y}const Xe=$.createContext(null);function tn(t){const e=k.c(24),{children:s}=t,{org:o}=J(),i=en(o.slug),[r,a]=$.useState(!1),[d,l]=$.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,x=r&&d!==null,y=x?d:i.layout;let b;e[6]!==d||e[7]!==x||e[8]!==i.layout?(b=x?JSON.stringify(d)!==JSON.stringify(i.layout):!1,e[6]=d,e[7]=x,e[8]=i.layout,e[9]=b):b=e[9];const v=b;let N;e[10]!==r||e[11]!==i?(N=S=>{r?l(S):i.save(S)},e[10]=r,e[11]=i,e[12]=N):N=e[12];const j=N;let g;e[13]!==j||e[14]!==c||e[15]!==v||e[16]!==r||e[17]!==y||e[18]!==h||e[19]!==i.isLoading?(g={isEditMode:r,enter:c,cancel:f,save:h,hasChanges:v,layout:y,isLayoutLoading:i.isLoading,commitLayout:j},e[13]=j,e[14]=c,e[15]=v,e[16]=r,e[17]=y,e[18]=h,e[19]=i.isLoading,e[20]=g):g=e[20];let w;return e[21]!==s||e[22]!==g?(w=n.jsx(Xe.Provider,{value:g,children:s}),e[21]=s,e[22]=g,e[23]=w):w=e[23],w}function Ze(){const t=$.useContext(Xe);if(!t)throw new Error("useHomeEdit must be used within a HomeEditProvider");return t}function sn({agentId:t}){const{org:e,locator:s}=J(),o=ae({connectionId:t,orgId:e.id,orgSlug:e.slug}),{create:i}=rs(),{setTaskId:r}=Dt(),[a,d]=$.useState(null),[l,m]=$.useState(!1),c=$.useRef(!1),u=async(y,b)=>{if(!o){U.error("MCP client not available");return}if(!c.current){c.current=!0,m(!0);try{const v=await os(o,y.name,b),N={type:"doc",content:[{type:"paragraph",content:[Ut({id:y.name,name:Bt(y.name,Vt(y._meta)),metadata:v.messages,char:"/",kind:"prompt",args:b}),{type:"text",text:" "}]}]},j=crypto.randomUUID();ls(sessionStorage,s,j,{tiptapDoc:N}),await i({id:j,virtual_mcp_id:t}),r(j,t,{autosend:!0})}catch(v){console.error("[start-thread-from-prompt] failed",v),U.error("Failed to start thread. Please try again.")}finally{c.current=!1,m(!1)}}},f=async y=>{if(!c.current){if(y.arguments&&y.arguments.length>0){d(y);return}await u(y)}},p=async y=>{if(!a)return;const b=a;d(null),await u(b,y)};return{start:f,startBlank:async y=>{if(!c.current){c.current=!0,m(!0);try{const b=crypto.randomUUID();await i({id:b,virtual_mcp_id:t}),r(b,t,y?.main?{main:y.main}:void 0)}catch(b){console.error("[start-thread-from-prompt] startBlank failed",b),U.error("Failed to start thread. Please try again.")}finally{c.current=!1,m(!1)}}},dialog:n.jsx(Ft,{prompt:a,setPrompt:y=>d(y),onSubmit:p}),dialogPrompt:a,starting:l}}const q=4,G=100,Ce=12,nn=5,on={w:2,h:2};class pe extends $.Component{state={hasError:!1};static getDerivedStateFromError(e){return{hasError:!0,message:e instanceof Error?e.message:"Unknown error"}}componentDidCatch(e,s){console.error("[home-tiles] tile crashed:",e,s.componentStack)}render(){return this.state.hasError?n.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2 p-4 text-center",children:[n.jsx("span",{className:"flex size-8 items-center justify-center rounded-md bg-destructive/10 text-destructive",children:n.jsx(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 rn(t){const e=k.c(72),{tiles:s,isEditMode:o,renderTile:i,onMove:r,onResize:a,onRemove:d}=t,l=ge(),m=$.useRef(null),[c,u]=$.useState(null),[f,p]=$.useState(null);let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h={activationConstraint:{distance:4}},e[0]=h):h=e[0];const x=Ae(re(Ee,h),re(Pe)),y=s.reduce(ln,0),b=o?Math.max(y+2,4):Math.max(y,1);let v;e[1]===Symbol.for("react.memo_cache_sentinel")?(v=()=>{const A=m.current?.getBoundingClientRect();return A?{cellWidth:A.width/q,cellHeight:G}:null},e[1]=v):v=e[1];const N=v;let j;e[2]===Symbol.for("react.memo_cache_sentinel")?(j=A=>{u(String(A.active.id)),p(N())},e[2]=j):j=e[2];const g=j;let w;e[3]!==f||e[4]!==r||e[5]!==s?(w=A=>{const V=String(A.active.id),D=f??N();if(u(null),p(null),!D||D.cellWidth<=0)return;const E=s.find(W=>W.id===V);if(!E)return;const R=Math.round(A.delta.x/D.cellWidth),F=Math.round(A.delta.y/D.cellHeight);R===0&&F===0||r(V,{x:E.x+R,y:E.y+F})},e[3]=f,e[4]=r,e[5]=s,e[6]=w):w=e[6];const S=w;if(l){let A;if(e[7]!==i||e[8]!==s){let D;e[10]!==i?(D=E=>n.jsx("div",{className:"group bg-card card-shadow rounded-2xl overflow-hidden",style:{minHeight:G},children:n.jsx(pe,{children:i(E)})},E.id),e[10]=i,e[11]=D):D=e[11],A=s.map(D),e[7]=i,e[8]=s,e[9]=A}else A=e[9];let V;return e[12]!==A?(V=n.jsx("div",{className:"flex flex-col gap-3 px-4 pb-8",children:A}),e[12]=A,e[13]=V):V=e[13],V}let C,_,I,T,P,M,z,B,O;if(e[14]!==c||e[15]!==f||e[16]!==o||e[17]!==S||e[18]!==d||e[19]!==a||e[20]!==i||e[21]!==x||e[22]!==s||e[23]!==b){const A=c?s.find(X=>X.id===c):null;_=Me,B=x,O=g,I=S;const V=b*G,D=o?G*4:G;let E;e[33]!==V||e[34]!==D?(E={height:V,minHeight:D},e[33]=V,e[34]=D,e[35]=E):E=e[35];let R;e[36]!==o||e[37]!==s||e[38]!==b?(R=o&&n.jsx(an,{rows:b,tiles:s}),e[36]=o,e[37]=s,e[38]=b,e[39]=R):R=e[39];let F;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(dn,{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],F=s.map(X),e[40]=c,e[41]=o,e[42]=d,e[43]=a,e[44]=i,e[45]=s,e[46]=F}else F=e[46];e[53]!==E||e[54]!==R||e[55]!==F?(T=n.jsxs("div",{ref:m,className:"relative w-full",style:E,children:[R,F]}),e[53]=E,e[54]=R,e[55]=F,e[56]=T):T=e[56],C=Pt,P=null;const W=A&&f?A.w*f.cellWidth-Ce:void 0,de=A&&f?A.h*f.cellHeight-Ce:void 0;e[57]!==W||e[58]!==de?(M={width:W,height:de},e[57]=W,e[58]=de,e[59]=M):M=e[59],z=A&&n.jsx("div",{className:"bg-card card-shadow rounded-2xl shadow-2xl ring-2 ring-primary/40 h-full overflow-hidden opacity-95",children:n.jsx(pe,{children:i(A)})}),e[14]=c,e[15]=f,e[16]=o,e[17]=S,e[18]=d,e[19]=a,e[20]=i,e[21]=x,e[22]=s,e[23]=b,e[24]=C,e[25]=_,e[26]=I,e[27]=T,e[28]=P,e[29]=M,e[30]=z,e[31]=B,e[32]=O}else C=e[24],_=e[25],I=e[26],T=e[27],P=e[28],M=e[29],z=e[30],B=e[31],O=e[32];let L;e[60]!==C||e[61]!==P||e[62]!==M||e[63]!==z?(L=n.jsx(C,{dropAnimation:P,style:M,children:z}),e[60]=C,e[61]=P,e[62]=M,e[63]=z,e[64]=L):L=e[64];let K;return e[65]!==_||e[66]!==I||e[67]!==T||e[68]!==L||e[69]!==B||e[70]!==O?(K=n.jsxs(_,{sensors:B,onDragStart:O,onDragEnd:I,children:[T,L]}),e[65]=_,e[66]=I,e[67]=T,e[68]=L,e[69]=B,e[70]=O,e[71]=K):K=e[71],K}function ln(t,e){return Math.max(t,e.y+e.h)}function an(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(cn)}),e[5]=a,e[6]=d):d=e[6],d}function cn(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 dn(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}=Et(m),h=`${s.x/q*100}%`,x=`${s.w/q*100}%`,y=s.y*G,b=s.h*G,v=p||i,N=!v&&"transition-[left,top,width,height,opacity] duration-200 ease-out",j=v&&"opacity-30";let g;e[3]!==N||e[4]!==j?(g=Q("absolute p-1 will-change-[left,top,width,height,opacity]",N,j),e[3]=N,e[4]=j,e[5]=g):g=e[5];let w;e[6]!==b||e[7]!==h||e[8]!==y||e[9]!==x?(w={left:h,top:y,width:x,height:b},e[6]=b,e[7]=h,e[8]=y,e[9]=x,e[10]=w):w=e[10];const S=o&&"outline outline-1 outline-transparent hover:outline-primary/40";let C;e[11]!==S?(C=Q("group relative h-full bg-card card-shadow rounded-2xl overflow-hidden",S),e[11]=S,e[12]=C):C=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(He,{size:16})}),n.jsx("div",{className:"absolute top-2 right-2 z-10 flex items-center gap-1",children:n.jsx(mn,{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 I;e[20]!==d?(I=n.jsx("div",{className:"h-full overflow-hidden",children:n.jsx(pe,{children:d})}),e[20]=d,e[21]=I):I=e[21];let T;e[22]!==I||e[23]!==C||e[24]!==_?(T=n.jsxs("div",{className:C,children:[_,I]}),e[22]=I,e[23]=C,e[24]=_,e[25]=T):T=e[25];let P;return e[26]!==c||e[27]!==T||e[28]!==g||e[29]!==w?(P=n.jsx("div",{ref:c,className:g,style:w,children:T}),e[26]=c,e[27]=T,e[28]=g,e[29]=w,e[30]=P):P=e[30],P}function mn(t){const e=k.c(20),{tile:s,onResize:o,onRemove:i}=t,[r,a]=$.useState(!1);let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(as,{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(jt,{size:16})})}),e[0]=d):d=e[0];let l;e[1]!==o||e[2]!==s.id?(l=y=>{o(s.id,y),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(un,{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(cs,{}),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(fs,{size:14,className:"mr-2"}),e[11]=f):f=e[11];let p;e[12]!==u?(p=n.jsxs(ds,{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(ms,{align:"end",className:"w-auto",children:[m,c,p]}),e[14]=m,e[15]=p,e[16]=h):h=e[16];let x;return e[17]!==r||e[18]!==h?(x=n.jsxs(us,{open:r,onOpenChange:a,children:[d,h]}),e[17]=r,e[18]=h,e[19]=x):x=e[19],x}function un(t){const e=k.c(19),{tile:s,onPick:o}=t,i=s.minW??1,r=s.minH??1,[a,d]=$.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:nn},(y,b)=>Array.from({length:q},(v,N)=>{const j=N+1,g=b+1,w=j<i||g<r,S=j<=m.w&&g<=m.h;return n.jsx("button",{type:"button",disabled:w,"aria-label":`${j} by ${g}`,onPointerEnter:()=>d({w:j,h:g}),onClick:()=>o({w:j,h:g}),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${g}`)}))}),e[10]=m.h,e[11]=m.w,e[12]=r,e[13]=i,e[14]=o,e[15]=h):h=e[15];let x;return e[16]!==u||e[17]!==h?(x=n.jsxs("div",{className:"px-2 py-1.5",children:[u,h]}),e[16]=u,e[17]=h,e[18]=x):x=e[18],x}function fn(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++)fn(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 pn(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 hn(t){const e=k.c(35),{layout:s,isLayoutLoading:o,commitLayout:i}=Ze();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 v;e[7]!==a?(v=j=>j.pinned||!a.has(j.id),e[7]=a,e[8]=v):v=e[8];const N=t.filter(v);d=new Map;for(const j of t)j.minSize&&d.set(j.id,j.minSize);for(const j of N){const g=s.tiles[j.id];if(!g)continue;const w=d.get(j.id),{w:S,h:C}=me(g.w,g.h,w),{x:_,y:I}=ue(g.x,g.y,S);l.push({id:j.id,x:_,y:I,w:S,h:C,minW:w?.w,minH:w?.h})}for(const j of N){if(l.some(I=>I.id===j.id))continue;const g=j.defaultSize??on,w=d.get(j.id),{w:S,h:C}=me(g.w,g.h,w),_=he(l,S,C);l.push({id:j.id,x:_.x,y:_.y,w:S,h:C,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(xn)),e[9]=t,e[10]=m):m=e[10];const c=m;let u;e[11]!==c||e[12]!==i?(u=(v,N)=>{const j={};for(const g of v)j[g.id]={x:g.x,y:g.y,w:g.w,h:g.h};i({version:ee,tiles:j,hidden:N.filter(g=>c.has(g))})},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=(v,N)=>{const j=l.find(S=>S.id===v);if(!j)return;const g=ue(N.x,N.y,j.w);if(g.x===j.x&&g.y===j.y)return;const w=pn(l,v,g);f(w,s.hidden)},e[16]=f,e[17]=s,e[18]=l,e[19]=h):h=e[19];let x;e[20]!==f||e[21]!==s||e[22]!==d||e[23]!==l?(x=(v,N)=>{const j=l.find(T=>T.id===v);if(!j)return;const g=d.get(v),{w,h:S}=me(N.w,N.h,g);if(w===j.w&&S===j.h)return;const C={...j,w,h:S,x:ue(j.x,j.y,w).x},_=l.filter(T=>T.id!==v),I=[C];for(const T of _){const P=he(I,T.w,T.h);I.push({...T,x:P.x,y:P.y})}f(I,s.hidden)},e[20]=f,e[21]=s,e[22]=d,e[23]=l,e[24]=x):x=e[24];let y;e[25]!==f||e[26]!==s||e[27]!==l?(y=v=>{const N=l.filter(j=>j.id!==v);f(N,Array.from(new Set([...s.hidden,v])))},e[25]=f,e[26]=s,e[27]=l,e[28]=y):y=e[28];let b;return e[29]!==o||e[30]!==p||e[31]!==h||e[32]!==x||e[33]!==y?(b={snapshot:p,isLoading:o,moveTile:h,resizeTile:x,hideTile:y},e[29]=o,e[30]=p,e[31]=h,e[32]=x,e[33]=y,e[34]=b):b=e[34],b}function xn(t){return t.id}const gn={w:2,h:4},yn={w:1,h:2},bn={w:1,h:1};function jn(t){return`prompt:${t.agentId}:${t.promptName||"blank"}`}function vn(t){return t.tileId?`tile:${t.tileId}`:`tile:${t.agentId}:${t.resourceUri}`}function Nn(t){return t.promptName?t.agentName:t.description}function wn(t){return{name:t.promptName,title:t.title,description:t.description,arguments:t.arguments,_meta:t._meta}}function Ye(t){const e=k.c(14),{org:s}=J();let o;e[0]!==s.id||e[1]!==s.slug||e[2]!==t.connectionId?(o=ct({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}=ss(a);let l;e[7]!==t.resourceUri||e[8]!==t.toolName||e[9]!==d?.tools?(l=t.toolName??d?.tools.find(u=>Re(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?is(t.connectionId,m):void 0,e[11]=t.connectionId,e[12]=m,e[13]=c):c=e[13],c}function Ne(t){const e=k.c(10);let s;e[0]!==t?(s={agentId:t},e[0]=t,e[1]=s):s=e[1];const{start:o,startBlank:i,dialog:r,starting:a}=sn(s);let d;e[2]!==o||e[3]!==i?(d=c=>{if(!c.promptName){i();return}o(wn(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 Sn(t){const e=k.c(32),{entry:s,isEditMode:o}=t,{open:i,dialog:r,starting:a}=Ne(s.agentId);let d;e[0]!==s||e[1]!==i?(d=()=>i(s),e[0]=s,e[1]=i,e[2]=d):d=e[2];const 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 x;e[12]!==s?(x=Nn(s),e[12]=s,e[13]=x):x=e[13];let y;e[14]!==x?(y=n.jsx("div",{className:"truncate text-xs text-muted-foreground mt-0.5",children:x}),e[14]=x,e[15]=y):y=e[15];let b;e[16]!==y||e[17]!==h?(b=n.jsxs("div",{className:"min-w-0 flex-1",children:[h,y]}),e[16]=y,e[17]=h,e[18]=b):b=e[18];let v;e[19]!==o?(v=!o&&n.jsx(ns,{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]=v):v=e[20];let N;e[21]!==a||e[22]!==d||e[23]!==b||e[24]!==v||e[25]!==l||e[26]!==f||e[27]!==p?(N=n.jsxs("button",{type:"button",onClick:d,disabled:l,"aria-busy":a,className:f,children:[p,b,v]}),e[21]=a,e[22]=d,e[23]=b,e[24]=v,e[25]=l,e[26]=f,e[27]=p,e[28]=N):N=e[28];let j;return e[29]!==r||e[30]!==N?(j=n.jsxs(n.Fragment,{children:[N,r]}),e[29]=r,e[30]=N,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},Cn)}),t[0]=e):e=t[0],e}function Cn(t,e){return n.jsxs("div",{className:"flex w-full items-center gap-3 rounded-2xl bg-card card-shadow px-3 py-2.5",children:[n.jsx(H,{className:"size-10 rounded-xl"}),n.jsxs("div",{className:"flex-1 space-y-1.5",children:[n.jsx(H,{className:"h-3 w-2/3"}),n.jsx(H,{className:"h-2.5 w-1/3"})]})]},`chip-skeleton-${e}`)}function In(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}=Ne(s.agentId),u=o.filter(Tn),f=Ye(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 x="flex min-h-0 flex-1 gap-3 overflow-hidden";let y;e[5]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsx($n,{}),e[5]=y):y=e[5];let b;e[6]!==a.id||e[7]!==a.slug||e[8]!==s?(b=n.jsx("div",{className:"min-h-0 flex-1 overflow-hidden rounded-lg border border-border",children:n.jsx($.Suspense,{fallback:y,children:n.jsx(kn,{tile:s,orgId:a.id,orgSlug:a.slug})})}),e[6]=a.id,e[7]=a.slug,e[8]=s,e[9]=b):b=e[9];const v=u.length>0&&!i&&r>=2&&n.jsx("div",{className:"flex w-44 shrink-0 flex-col gap-2 overflow-hidden",children:u.map(g=>n.jsx("button",{type:"button",onClick:()=>d(g),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:g.title})},g.promptName))});let N;e[10]!==b||e[11]!==v?(N=n.jsxs("div",{className:x,children:[b,v]}),e[10]=b,e[11]=v,e[12]=N):N=e[12];let j;return e[13]!==m||e[14]!==h||e[15]!==N?(j=n.jsxs("div",{className:p,children:[h,N,m]}),e[13]=m,e[14]=h,e[15]=N,e[16]=j):j=e[16],j}function Tn(t){return!!t.promptName}function kn(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(Jt,{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 $n(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsxs("div",{className:"flex h-full w-full flex-col gap-2 p-4",children:[n.jsx(H,{className:"h-3 w-2/3"}),n.jsx(H,{className:"h-3 w-1/2"}),n.jsx(H,{className:"mt-1 h-full w-full rounded-md"})]}),t[0]=e):e=t[0],e}function An(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(H,{className:"h-3 w-3/4"}),n.jsx(H,{className:"h-3 w-1/2"}),n.jsx(H,{className:"h-3 w-2/3"})]}),e[11]=m):m=e[11];let c;return e[12]!==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 Pn(t){const e=k.c(10),{tile:s,prompts:o,isEditMode:i}=t,{open:r,startBlank:a,dialog:d,starting:l}=Ne(s.agentId),m=o.filter(En),c=Ye(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 x=m.length>0&&!i&&n.jsx("div",{className:"grid grid-cols-1 gap-2 overflow-hidden sm:grid-cols-2",children:m.map(b=>n.jsx("button",{type:"button",onClick:()=>!i&&r(b),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:b.title})},b.promptName))});let y;return e[6]!==d||e[7]!==h||e[8]!==x?(y=n.jsxs("div",{className:u,children:[h,x,d]}),e[6]=d,e[7]=h,e[8]=x,e[9]=y):y=e[9],y}function En(t){return!!t.promptName}function et({isEditMode:t}){const{org:e}=J(),{isLoading:s,prompts:o,tiles:i}=be(e.slug),r=ze()?.ids??[],a=new Set(r),d=Oe(),l=Ue(),m=xe(),c=new Set(i.map(g=>g.agentId)),u=new Map;for(const g of o){const w=u.get(g.agentId);w?w.push(g):u.set(g.agentId,[g])}const f=o.filter(g=>!c.has(g.agentId)),p=[...i.map(g=>({kind:"tile",id:vn(g),data:g})),...f.map(g=>({kind:"prompt",id:jn(g),data:g}))],h=new Map(p.map(g=>[g.id,g])),x=hn(p.map(g=>({id:g.id,defaultSize:g.kind==="tile"?gn:bn,minSize:g.kind==="tile"?yn:void 0,pinned:a.has(g.data.agentId)}))),y=g=>{d.apply(w=>w.filter(S=>S!==g)).catch(()=>U.error("Couldn't remove from home — please try again."))},b=async g=>{if(i.filter(S=>S.agentId===g.agentId).length<=1){y(g.agentId);return}try{const C=(await l.call("COLLECTION_VIRTUAL_MCP_GET",{id:g.agentId})).item;if(!C)throw new Error("Agent not found");const _=Z(C.metadata?.ui),I=g.tileId?_.filter(T=>T.tileId!==g.tileId):_.filter(T=>T.connectionId!==g.connectionId||T.resourceUri!==g.resourceUri);await l.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:g.agentId,data:{metadata:{...C.metadata??{},ui:{...C.metadata?.ui??{},homeTile:null,homeTiles:I}}}}),m.invalidateQueries({queryKey:te.homeNextActions(e.slug)})}catch{U.error("Couldn't remove tile — please try again.")}},v=g=>{const w=h.get(g);if(w){if(!a.has(w.data.agentId)){x.hideTile(g);return}w.kind==="tile"?b(w.data):y(w.data.agentId)}},N=g=>{const w=h.get(g.id);if(!w)return null;if(w.kind==="tile"){const S=u.get(w.data.agentId)??[];return n.jsx(ot,{fallback:n.jsx(Pn,{tile:w.data,prompts:S,isEditMode:t}),children:n.jsx($.Suspense,{fallback:n.jsx(An,{icon:w.data.agentIcon,name:w.data.agentName}),children:n.jsx(In,{tile:w.data,prompts:S,isEditMode:t,tileWidth:g.w})})})}return n.jsx(Sn,{entry:w.data,isEditMode:t})};return s||x.isLoading?n.jsx(_n,{}):x.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(rn,{tiles:x.snapshot.visible,isEditMode:t,renderTile:N,onMove:x.moveTile,onResize:x.resizeTile,onRemove:v})})}function Mn(t){const e=k.c(2),{prompts:s,tiles:o}=be(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 Ie=420,Te=305;function tt(){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:Ie}}),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:Ie}}),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:Te}}),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:Te}})]}),t[3]=i):i=t[3],i}function ke(){const t=k.c(33),{data:e}=rt.useSession(),{org:s}=J(),o=ge(),i=xs(),{selectedVirtualMcp:r}=Nt();let a;t[0]!==s.id?(a=dt(s.id),t[0]=s.id,t[1]=a):a=t[1];const l=r??a;let m;t[2]!==s.slug?(m=Ht(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:mt,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=ps(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=Lt(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=pt(s.id,l.id,u),t[13]=l.id,t[14]=s.id,t[15]=u,t[16]=h):h=t[16];let x;t[17]!==f||t[18]!==p||t[19]!==h?(x={queries:[f,p,h]},t[17]=f,t[18]=p,t[19]=h,t[20]=x):x=t[20],ys(x);const y=hs(),b=ht(l.id),{hasDecoKey:v,isZeroBalance:N,isInitialFreeCredit:j,balanceDollars:g,hasOnlyDecoProvider:w}=Mt(),{hasVisibleTiles:S}=Mn(s.slug),C=zt(b?.metadata);if(y.length===0&&!(C&&Ot(i))){let L;return t[21]===Symbol.for("react.memo_cache_sentinel")?(L=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(wt,{})})}),t[21]=L):L=t[21],L}let I;t[22]!==e?.user?.name?(I=e?.user?.name?.split(" ")[0]||"there",t[22]=e?.user?.name,t[23]=I):I=t[23];const T=I,P=v&&j&&g!=null,M=v&&N&&w;let z;t[24]!==g||t[25]!==P||t[26]!==M?(z=P?n.jsx(oe.CreditsEyebrow,{balanceDollars:g}):M?n.jsx(oe.NoCreditsEyebrow,{}):null,t[24]=g,t[25]=P,t[26]=M,t[27]=z):z=t[27];const B=z;let O;return t[28]!==B||t[29]!==S||t[30]!==o||t[31]!==T?(O=n.jsx(tn,{children:o?n.jsx(zn,{eyebrow:B,userName:T}):n.jsx(On,{eyebrow:B,userName:T,hasVisibleTiles:S})}),t[28]=B,t[29]=S,t[30]=o,t[31]=T,t[32]=O):O=t[32],O}function zn(t){const e=k.c(12),{eyebrow:s,userName:o}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(tt,{}),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(oe.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(et,{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 On(t){const e=k.c(32),{eyebrow:s,userName:o,hasVisibleTiles:i}=t,{isEditMode:r,enter:a,save:d,cancel:l,hasChanges:m}=Ze(),[c,u]=$.useState(!1);let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=()=>u(!0),e[0]=f):f=e[0];let p;e[1]!==l||e[2]!==a||e[3]!==m||e[4]!==r||e[5]!==d?(p=n.jsx(gs.Right,{children:n.jsx(Ln,{isEditMode:r,hasChanges:m,onEnter:a,onSave:d,onCancel:l,onAddTile:f})}),e[1]=l,e[2]=a,e[3]=m,e[4]=r,e[5]=d,e[6]=p):p=e[6];let h;e[7]!==c?(h=n.jsx(js,{open:c,onOpenChange:u}),e[7]=c,e[8]=h):h=e[8];let x;e[9]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(tt,{}),e[9]=x):x=e[9];const y=i||r?"pt-32":"flex-1 justify-center";let b;e[10]!==y?(b=Q("relative flex flex-col items-center px-10 pb-4",y),e[10]=y,e[11]=b):b=e[11];let v;e[12]!==s?(v=s&&n.jsx("div",{className:"mb-4",children:s}),e[12]=s,e[13]=v):v=e[13];let N;e[14]!==o?(N=n.jsxs("p",{className:"text-3xl font-medium text-foreground",children:["What's on your mind, ",o,"?"]}),e[14]=o,e[15]=N):N=e[15];let j;e[16]!==v||e[17]!==N?(j=n.jsxs("div",{className:"text-center mb-10",children:[v,N]}),e[16]=v,e[17]=N,e[18]=j):j=e[18];let g;e[19]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsxs("div",{className:"relative w-full",children:[n.jsx(Dn,{}),n.jsx(oe.Input,{showConnectionsBanner:!0})]}),e[19]=g):g=e[19];let w;e[20]!==j?(w=n.jsxs("div",{className:"flex flex-col items-center w-full max-w-[672px]",children:[j,g]}),e[20]=j,e[21]=w):w=e[21];let S;e[22]!==r?(S=n.jsx("div",{className:"relative w-full mt-10 mx-auto max-w-[1280px] px-2 pb-16",children:n.jsx(et,{isEditMode:r})}),e[22]=r,e[23]=S):S=e[23];let C;e[24]!==w||e[25]!==S||e[26]!==b?(C=n.jsxs("div",{className:"flex-1 relative flex flex-col min-h-0",children:[x,n.jsx("div",{className:"flex-1 relative flex flex-col overflow-y-auto",children:n.jsxs("div",{className:b,children:[w,S]})})]}),e[24]=w,e[25]=S,e[26]=b,e[27]=C):C=e[27];let _;return e[28]!==C||e[29]!==p||e[30]!==h?(_=n.jsxs(n.Fragment,{children:[p,h,C]}),e[28]=C,e[29]=p,e[30]=h,e[31]=_):_=e[31],_}function Ln(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(ye,{size:14}),e[0]=c):c=e[0];let u;e[1]!==d?(u=n.jsxs("button",{type:"button",onClick:d,className:"flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",title:"Add a tile from any agent",children:[c,"Add tile"]}),e[1]=d,e[2]=u):u=e[2];let f;e[3]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx($e,{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 x;e[6]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(xt,{size:14}),e[6]=x):x=e[6];let y;e[7]!==r||e[8]!==h?(y=n.jsxs(Y,{size:"sm",onClick:r,disabled:h,className:"gap-1.5 h-7 text-xs",children:[x,"Save"]}),e[7]=r,e[8]=h,e[9]=y):y=e[9];let b;return e[10]!==u||e[11]!==p||e[12]!==y?(b=n.jsxs(n.Fragment,{children:[u,p,y]}),e[10]=u,e[11]=p,e[12]=y,e[13]=b):b=e[13],b}let l;e[14]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(vt,{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 Dn(){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 Vo(){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(ke,{})}),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(ke,{})})})}),t[1]=s):s=t[1],s}export{Vo as default};
|