decocms 3.84.3 → 3.85.1
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-CBqPbJhE.js → AlertCircle-UI_s1A_q.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-CeK93HMb.js → ArrowUpRight-BGXtWVLq.js} +1 -1
- package/dist/client/assets/{CheckCircle-DZ7lx3KF.js → CheckCircle-BcQG2RQ_.js} +1 -1
- package/dist/client/assets/{ChevronDown-CJWYZLuA.js → ChevronDown-D0YAzAXq.js} +1 -1
- package/dist/client/assets/{ChevronLeft-CnLqo_kp.js → ChevronLeft-hv_TF25A.js} +1 -1
- package/dist/client/assets/{ChevronRight-DfdMQ2Fw.js → ChevronRight-DQOBw88M.js} +1 -1
- package/dist/client/assets/{ChevronUp-D9KnZoAi.js → ChevronUp-B2D6HqOT.js} +1 -1
- package/dist/client/assets/{DotsVertical-DFqqfAl6.js → DotsVertical-b5t2rran.js} +1 -1
- package/dist/client/assets/{Eye-BT74up7P.js → Eye-BYzzEm3I.js} +1 -1
- package/dist/client/assets/{FilterLines-C8AP3gRc.js → FilterLines-C9tSEykd.js} +1 -1
- package/dist/client/assets/{Globe01-D-zy1b5e.js → Globe01-DIjRFAXE.js} +1 -1
- package/dist/client/assets/{Globe04-CTK-EMBE.js → Globe04-D7R12mcw.js} +1 -1
- package/dist/client/assets/{HardDrive-C5zzTdLP.js → HardDrive-Cvm-O0cK.js} +1 -1
- package/dist/client/assets/{Key01-CGqUyM9V.js → Key01-D41rtuFP.js} +1 -1
- package/dist/client/assets/{LayoutLeft-ByH5X-SK.js → LayoutLeft-DiQZpi5k.js} +1 -1
- package/dist/client/assets/{LinkExternal01-BPuS9hJa.js → LinkExternal01-C470omzl.js} +1 -1
- package/dist/client/assets/{Monitor01-CoqnETyV.js → Monitor01-DC7VBFXb.js} +1 -1
- package/dist/client/assets/{Palette-COnOloJT.js → Palette-KMBswWVt.js} +1 -1
- package/dist/client/assets/{Play-B0YCT5-m.js → Play-Bd1FYhKh.js} +1 -1
- package/dist/client/assets/{Plus-B8D680G_.js → Plus-CoKbuJLU.js} +1 -1
- package/dist/client/assets/{SearchMd-u8dQ1GMf.js → SearchMd-Cdve7MnI.js} +1 -1
- package/dist/client/assets/{Settings02-BWSkBAC0.js → Settings02-CI_uQmeR.js} +1 -1
- package/dist/client/assets/{Shield01-D6oYrc9O.js → Shield01-BZvnvLhB.js} +1 -1
- package/dist/client/assets/{Star01-6xSTQrG2.js → Star01-vvHwZgSL.js} +1 -1
- package/dist/client/assets/{Stars01-CC6YF-Gm.js → Stars01-xm4D-cxK.js} +1 -1
- package/dist/client/assets/{Stars02-CsFUuUcv.js → Stars02-C-_PT1u9.js} +1 -1
- package/dist/client/assets/{Sun-Boa0IILr.js → Sun-CGHCaafi.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-CS0hM449.js → SwitchHorizontal01-C16CMAte.js} +1 -1
- package/dist/client/assets/{Tool01-DKSKRkDn.js → Tool01-Cuf4Loxv.js} +1 -1
- package/dist/client/assets/{Trash01-CWfKClvv.js → Trash01-C2-KSkpM.js} +1 -1
- package/dist/client/assets/{Upload01-Dzd1geuw.js → Upload01-Cxyzcp7U.js} +1 -1
- package/dist/client/assets/{User01-C8VsM6kw.js → User01-DQNqyf0z.js} +1 -1
- package/dist/client/assets/{Users01-3oKdAMi1.js → Users01-Ds21PzyA.js} +1 -1
- package/dist/client/assets/{Users03-BNYrsyyA.js → Users03-DVqhqLtY.js} +1 -1
- package/dist/client/assets/{X-CSyvhNbh.js → X-D4bcZF2P.js} +1 -1
- package/dist/client/assets/{XCircle-DX7bokFz.js → XCircle-ChCszrqC.js} +1 -1
- package/dist/client/assets/{XClose-BDFu3FRS.js → XClose-BIMV7Dn2.js} +1 -1
- package/dist/client/assets/{Zap-CXfIxPjW.js → Zap-BwocpLy_.js} +1 -1
- package/dist/client/assets/{ZapSquare-CRuF7_Od.js → ZapSquare-CI2Ygkar.js} +1 -1
- package/dist/client/assets/{ZoomOut-hi-FNg6F.js → ZoomOut-CCevpFEm.js} +1 -1
- package/dist/client/assets/{access-gate-C-kLa8V2.js → access-gate-DC5UQYOb.js} +1 -1
- package/dist/client/assets/{add-section-modal-DzwoE-VD.js → add-section-modal-BQIff8Ku.js} +1 -1
- package/dist/client/assets/{agent-icon-B5jKg1D4.js → agent-icon-DltOZ7gk.js} +1 -1
- package/dist/client/assets/{agents-list-DPApd7XV.js → agents-list-HUgP9gOt.js} +1 -1
- package/dist/client/assets/{ai-providers-C09A26hu.js → ai-providers-DIxyyZhD.js} +1 -1
- package/dist/client/assets/{alert-B6KsNvdj.js → alert-DkTeVwML.js} +1 -1
- package/dist/client/assets/{alert-dialog-BMQCNP5r.js → alert-dialog-DpS-mMM7.js} +1 -1
- package/dist/client/assets/{app-editor-B4OFXY5P.js → app-editor-DGAKCKE-.js} +1 -1
- package/dist/client/assets/{auth-BkwEkX2d.js → auth-3Qlzfum0.js} +1 -1
- package/dist/client/assets/{auth-catchall-C3EDy8Lr.js → auth-catchall-k44sYCpM.js} +1 -1
- package/dist/client/assets/{auth-entry-cn4hgqYj.js → auth-entry-DJx0s8hS.js} +1 -1
- package/dist/client/assets/{auth-split-layout-DsYH7119.js → auth-split-layout-1KN6oAFe.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-CYtmcv5M.js → authenticate-and-persist-oauth-Czoy-f8w.js} +1 -1
- package/dist/client/assets/{automation-list-row-B6RsIqvM.js → automation-list-row-BrMpZJSX.js} +1 -1
- package/dist/client/assets/{automation-runs-CMCvBggE.js → automation-runs-W3No-HAO.js} +1 -1
- package/dist/client/assets/{automations-BpvvdMu8.js → automations-Dgjltr_b.js} +1 -1
- package/dist/client/assets/{avatar-DVfn3HK-.js → avatar-B442IE73.js} +1 -1
- package/dist/client/assets/{badge-C-PgyJP_.js → badge-CuXnSq54.js} +1 -1
- package/dist/client/assets/{block-document-C3HZF41z.js → block-document-BD7cWULL.js} +1 -1
- package/dist/client/assets/{brand-context-BV09oT1U.js → brand-context-Ddq0r4JY.js} +1 -1
- package/dist/client/assets/{buckets-p48X8MxL.js → buckets-DGVTtrzw.js} +1 -1
- package/dist/client/assets/{capability-load-error-8Q7IbpjY.js → capability-load-error-BKlkiPcg.js} +1 -1
- package/dist/client/assets/{card-Cg4U92wO.js → card-CGNymFBN.js} +1 -1
- package/dist/client/assets/category-editor-DXonE06u.js +1 -0
- package/dist/client/assets/{chat-context-Dphq5ubi.js → chat-context-DqwSWwRT.js} +1 -1
- package/dist/client/assets/{checkbox-BAdcCLlw.js → checkbox-DX2kNd_o.js} +1 -1
- package/dist/client/assets/{cli-auth-success-C_or_CmK.js → cli-auth-success-Bnjczofu.js} +1 -1
- package/dist/client/assets/{collection-detail-DThGhP7u.js → collection-detail-n6014Ts6.js} +1 -1
- package/dist/client/assets/{collection-display-button-C5aIg6vR.js → collection-display-button-CAbrtWV3.js} +1 -1
- package/dist/client/assets/{collection-search-BlM-1h2p.js → collection-search--VTqc0O-.js} +1 -1
- package/dist/client/assets/{collection-tabs-DLdr8wLT.js → collection-tabs-Bm2QWW6E.js} +1 -1
- package/dist/client/assets/{command-CSVnblSP.js → command-DY2CVwyL.js} +1 -1
- package/dist/client/assets/commerce-onboarding--wlyfyPZ.js +1 -0
- package/dist/client/assets/{connect-desktop-dialog-VHzsIUyV.js → connect-desktop-dialog-Rvz9u_CV.js} +1 -1
- package/dist/client/assets/{connection-card-D4RLitiQ.js → connection-card-BSwF1NNx.js} +1 -1
- package/dist/client/assets/{connection-detail-CE3VlhwT.js → connection-detail-0l0C63Md.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-CZiloNgc.js → connection-form-helpers-DG0VHHVH.js} +1 -1
- package/dist/client/assets/{connections-mZne5BrK.js → connections-BZRB4P82.js} +1 -1
- package/dist/client/assets/{context-menu-DYeV_YKF.js → context-menu-IZpfekr5.js} +1 -1
- package/dist/client/assets/{decopilot-DlqOnjYH.js → decopilot-Duluf5jH.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-dougyUqv.js → decopilot-sse-pool-D6IMI0f5.js} +1 -1
- package/dist/client/assets/{dialog-CvVsKEYZ.js → dialog-DDISKcmV.js} +1 -1
- package/dist/client/assets/{domain-settings-DsdL2e7s.js → domain-settings-D5w5Ataa.js} +1 -1
- package/dist/client/assets/{drawer-BwNOtTqY.js → drawer-DKaQPPyr.js} +1 -1
- package/dist/client/assets/{dropdown-menu-Btez7WVe.js → dropdown-menu-10e27AXH.js} +1 -1
- package/dist/client/assets/{empty-state-B1HRggjH.js → empty-state-BdeVb4XA.js} +1 -1
- package/dist/client/assets/{extract-connection-data-CT8AxPCy.js → extract-connection-data-B-8vHcVE.js} +1 -1
- package/dist/client/assets/{file-explorer-DpO6Na_G.js → file-explorer-Bkk4HZEy.js} +1 -1
- package/dist/client/assets/{file-type-icon-CzW2A5RE.js → file-type-icon-Cll7L0-s.js} +1 -1
- package/dist/client/assets/{files-Ip15kqmr.js → files-D72DQEPA.js} +1 -1
- package/dist/client/assets/{form-BWMflY-D.js → form-Bx10NpUN.js} +1 -1
- package/dist/client/assets/{general-Ds-uKNgF.js → general-BrIfBDVn.js} +1 -1
- package/dist/client/assets/{github-repo-picker-DjPaaZ8o.js → github-repo-picker-Dby0l-at.js} +1 -1
- package/dist/client/assets/{hooks-DHpz1d4N.js → hooks-CDzp_brc.js} +1 -1
- package/dist/client/assets/{import-from-deco-dialog-DpallAXe.js → import-from-deco-dialog--s9_66WC.js} +1 -1
- package/dist/client/assets/{index-DpoaFFFe.js → index-26SNxfzY.js} +1 -1
- package/dist/client/assets/{index-ChJT_O6D.js → index-B29SSyAJ.js} +1 -1
- package/dist/client/assets/{index-BWjIO2_h.js → index-BAMRmaRC.js} +1 -1
- package/dist/client/assets/{index-DPtZiiq2.js → index-BYtbVFm5.js} +1 -1
- package/dist/client/assets/{index-DNuFDhRe.js → index-CQeBRxbZ.js} +1 -1
- package/dist/client/assets/{index-Cdi_SW9v.js → index-Cnt3OT0F.js} +4 -4
- package/dist/client/assets/{index-BgmIzn4p.js → index-CzhYS8LW.js} +1 -1
- package/dist/client/assets/{index-Dy0NHd84.js → index-CziDwf0M.js} +1 -1
- package/dist/client/assets/{index-CZynoR0p.js → index-D9cO8eeb.js} +1 -1
- package/dist/client/assets/index-DMv2XL4f.js +1 -0
- package/dist/client/assets/{index-CDQDonc2.js → index-DgTNn2Yb.js} +5 -5
- package/dist/client/assets/{index-BseuxgOP.js → index-DkZ5fto1.js} +1 -1
- package/dist/client/assets/{index-K-9e2ZDA.js → index-DtWX_jyh.js} +1 -1
- package/dist/client/assets/{index-W4B0CmtU.js → index-W_bLYphM.js} +1 -1
- package/dist/client/assets/index-fHHzFvHF.css +1 -0
- package/dist/client/assets/{index-redirect-Bn8nTxK6.js → index-redirect-Dw8S6fhp.js} +1 -1
- package/dist/client/assets/{input-C85X5mQd.js → input-Ckzaub2Q.js} +1 -1
- package/dist/client/assets/{integration-icon-5EPhLKNh.js → integration-icon-CynwtIY3.js} +1 -1
- package/dist/client/assets/{label-BQtTOPkv.js → label-D6XLGyJ_.js} +1 -1
- package/dist/client/assets/{login-GQgDbR7c.js → login-D7CPOPvJ.js} +1 -1
- package/dist/client/assets/{mcp-oauth-DuXz7McC.js → mcp-oauth-CshWQNQX.js} +1 -1
- package/dist/client/assets/{members-DDkcjjUM.js → members-CIOeeOmt.js} +1 -1
- package/dist/client/assets/{monaco-editor-BORZmFin.js → monaco-editor-D5d0J9gi.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-I3txRI3K.js → monitoring-stats-row-CoMFi-WF.js} +1 -1
- package/dist/client/assets/{oauth-callback-BDkUtUND.js → oauth-callback-D1z0A-2_.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-DR6T8Hni.js → oauth-callback-ai-provider-BJBqEPDJ.js} +1 -1
- package/dist/client/assets/{onboarding-BZtattlf.js → onboarding-TACBZ4SL.js} +1 -1
- package/dist/client/assets/{org-install-ByMo7TpY.js → org-install-UuxFqv69.js} +1 -1
- package/dist/client/assets/{org-layout-CibjT00r.js → org-layout-DAsu5R1a.js} +1 -1
- package/dist/client/assets/{organization-choice-DG1wa9ZD.js → organization-choice-DZqe8ZRz.js} +1 -1
- package/dist/client/assets/{page-seo-form-BnV5BbeL.js → page-seo-form-MOAczFXF.js} +1 -1
- package/dist/client/assets/page-seo-sheet-XZwVd2HL.js +1 -0
- package/dist/client/assets/{popover-B07cKons.js → popover-Df7opRcP.js} +1 -1
- package/dist/client/assets/{post-editor-CybfyzFh.js → post-editor-_EnxOukw.js} +1 -1
- package/dist/client/assets/{preview-dialog-CmWcwQ_d.js → preview-dialog-Qgw8TqgL.js} +1 -1
- package/dist/client/assets/{primitives-C4IQk_dn.js → primitives-DS6denQF.js} +1 -1
- package/dist/client/assets/{profile-l-wWEHSm.js → profile-Dr1O3hY1.js} +1 -1
- package/dist/client/assets/project-app-view-BmOR7Rz5.js +1 -0
- package/dist/client/assets/record-editor-CrUrFl6H.js +1 -0
- package/dist/client/assets/registry-BBNKp_JZ.js +2 -0
- package/dist/client/assets/{registry-layout-B8IjWU4h.js → registry-layout-DAw1bfE_.js} +1 -1
- package/dist/client/assets/{require-capability-DUC2rNq-.js → require-capability-BS7RYHPw.js} +1 -1
- package/dist/client/assets/{required-auth-layout-BemkjKan.js → required-auth-layout-DsbnXfHE.js} +1 -1
- package/dist/client/assets/{reset-password-BSCLBo6Q.js → reset-password-B49rCUfQ.js} +1 -1
- package/dist/client/assets/{roles-BYwsj8Sz.js → roles-C7Ng4ibe.js} +1 -1
- package/dist/client/assets/{save-status-sNJre79x.js → save-status-DEjjDdp1.js} +1 -1
- package/dist/client/assets/{scroll-area-dzkBqX8_.js → scroll-area-BrISF3tu.js} +1 -1
- package/dist/client/assets/{search-input-CAgO5lFg.js → search-input-DRdO9fJW.js} +1 -1
- package/dist/client/assets/{secrets-VODDM6qM.js → secrets-DaOAyfQ8.js} +1 -1
- package/dist/client/assets/{sections-editor-rMfKmqo4.js → sections-editor-DNXzKH6w.js} +1 -1
- package/dist/client/assets/{select-DEG7PFkZ.js → select-CHuOKMsv.js} +1 -1
- package/dist/client/assets/{select-model-zOa-Rdrr.js → select-model-DtZt6AUe.js} +1 -1
- package/dist/client/assets/{seo-editor-BRcQaVtJ.js → seo-editor-_SGArFUJ.js} +1 -1
- package/dist/client/assets/{settings-layout-BJN2SrZW.js → settings-layout-BXRrzxk3.js} +1 -1
- package/dist/client/assets/{settings-section-51WiZXYd.js → settings-section--x1ye-kF.js} +1 -1
- package/dist/client/assets/{sheet-0vdtuc3i.js → sheet-CHvzyrLe.js} +1 -1
- package/dist/client/assets/{shell-controls-CDkTdWuk.js → shell-controls-APzM6IIO.js} +1 -1
- package/dist/client/assets/{shell-layout-BdF9IDeE.js → shell-layout-ldK3sCwM.js} +1 -1
- package/dist/client/assets/{shell-route-loading-D58stY2L.js → shell-route-loading-0ipm3Rfv.js} +1 -1
- package/dist/client/assets/{sidebar-BqyUOUvx.js → sidebar-DijqZtyP.js} +1 -1
- package/dist/client/assets/{skeleton-BWev8k8G.js → skeleton-6Veh4gQ_.js} +1 -1
- package/dist/client/assets/{sortable.esm-A8tP5NgA.js → sortable.esm-Chkq7OOX.js} +1 -1
- package/dist/client/assets/{sso-DS5DzPVa.js → sso-Ck2qsfkc.js} +1 -1
- package/dist/client/assets/{store-CSIMYuDp.js → store-CGQaL51B.js} +1 -1
- package/dist/client/assets/store-registry-vYj5JmNx.js +2 -0
- package/dist/client/assets/{studio-tools-D8jocIuF.js → studio-tools-BrM6IZ-j.js} +1 -1
- package/dist/client/assets/{switch-Cq8_Q7W_.js → switch-DK_nl0S9.js} +1 -1
- package/dist/client/assets/{table-Dsj-XDfc.js → table-BkUSKkKk.js} +1 -1
- package/dist/client/assets/{tabs-By9RVZpO.js → tabs-DTxmuNcP.js} +1 -1
- package/dist/client/assets/{task-status-D9dvEJiX.js → task-status-BCVu6N5i.js} +1 -1
- package/dist/client/assets/{textarea-DPdVb49N.js → textarea-haJWQf-v.js} +1 -1
- package/dist/client/assets/{toggle-group-BVAqJsgZ.js → toggle-group-Da7ARg8s.js} +1 -1
- package/dist/client/assets/{toolbar-CP1DI4yM.js → toolbar-DaTym4hl.js} +1 -1
- package/dist/client/assets/{tooltip-B8O5EzJh.js → tooltip-C29fjS_0.js} +1 -1
- package/dist/client/assets/{types-Di9YuMWP.js → types-Q4TXBJ2s.js} +1 -1
- package/dist/client/assets/{use-ai-providers-_Cu_CUx8.js → use-ai-providers-DXoG3bLZ.js} +1 -1
- package/dist/client/assets/{use-automations-Bluj9UpJ.js → use-automations-BZ8qDXjU.js} +1 -1
- package/dist/client/assets/{use-capability-054Jlz5j.js → use-capability-DjzugVhc.js} +1 -1
- package/dist/client/assets/{use-clock-tick-2NgWXYqH.js → use-clock-tick-bysy1gGp.js} +1 -1
- package/dist/client/assets/{use-collections--Li9hsny.js → use-collections-BVkpsnVZ.js} +1 -1
- package/dist/client/assets/{use-connection-CV9pGQq0.js → use-connection-Cd7CYacz.js} +1 -1
- package/dist/client/assets/{use-copy-C7bsJAWf.js → use-copy-D_DJfVXx.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-Bg23ngKV.js → use-create-virtual-mcp-Z03LMXnz.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-BBjgbH01.js → use-debounced-autosave-Dx7G5YC2.js} +1 -1
- package/dist/client/assets/{use-delete-connection-BxK8edOU.js → use-delete-connection-Bg4siIS8.js} +1 -1
- package/dist/client/assets/{use-file-configs-KASOspWn.js → use-file-configs-DUs7SMfa.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-Dj9UAgIo.js → use-infinite-scroll-C6UYOmGO.js} +1 -1
- package/dist/client/assets/{use-join-requests-BPtAiUq0.js → use-join-requests-D93gALrL.js} +1 -1
- package/dist/client/assets/{use-mcp-client-DBqNVBda.js → use-mcp-client-DT8D-Rwk.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-C_k5ossc.js → use-mcp-prompts-D5Dxa0-R.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-B4W-z7bl.js → use-mcp-tools-Di1SYev9.js} +1 -1
- package/dist/client/assets/{use-members-9RqOs3Qh.js → use-members-C-o5r2on.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-zUK-3Xnr.js → use-navigate-to-agent-DEly-MqA.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-d3773LF8.js → use-org-auth-client-Dmek8f-T.js} +1 -1
- package/dist/client/assets/{use-org-sso-CpvSwXK-.js → use-org-sso-C3T2dIBY.js} +1 -1
- package/dist/client/assets/{use-organization-roles-BJf7IYH2.js → use-organization-roles-B8wvwbIk.js} +1 -1
- package/dist/client/assets/{use-organization-settings-D73e98lK.js → use-organization-settings-DiF0XLSc.js} +1 -1
- package/dist/client/assets/{use-registry-connections-BWn-5VV_.js → use-registry-connections-DT6cG_1r.js} +1 -1
- package/dist/client/assets/{use-secrets-CLwAc1Jw.js → use-secrets-m8cO_Wqg.js} +1 -1
- package/dist/client/assets/{use-status-sounds-Dl5xgyQC.js → use-status-sounds-BCBlB-5o.js} +1 -1
- package/dist/client/assets/{use-view-mode-q6Q13eC9.js → use-view-mode-Fw9YXi_l.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-DjogNdpY.js → use-virtual-mcp-Dyc4xTRo.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-YHvdCOfz.js +1 -0
- package/dist/client/assets/useQueries-BPXFxPjE.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-37SjXEvD.js +1 -0
- package/dist/client/assets/{variant-calendar-B-JZS_wJ.js → variant-calendar-T-NWrWul.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-DMN8QWmQ.js → view-mode-toggle-Cuao4cr-.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +153 -153
- package/package.json +1 -1
- package/dist/client/assets/category-editor-BFj-n6b6.js +0 -1
- package/dist/client/assets/commerce-onboarding-BKSKu197.js +0 -1
- package/dist/client/assets/index-B1FrmLLd.js +0 -1
- package/dist/client/assets/index-DDRZvmg6.css +0 -1
- package/dist/client/assets/page-seo-sheet-DALiYt9z.js +0 -1
- package/dist/client/assets/project-app-view-BvnkCP6L.js +0 -1
- package/dist/client/assets/record-editor-ChFWUCDb.js +0 -1
- package/dist/client/assets/registry-Dpu3-9ah.js +0 -2
- package/dist/client/assets/store-registry-CJiDvQQc.js +0 -2
- package/dist/client/assets/useInfiniteQuery-bc8haI9M.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BbH0X03C.js +0 -1
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as st,j as e,B as mt}from"./index-Cdi_SW9v.js";import{i as lt}from"./XCircle-DX7bokFz.js";import{U as pt}from"./agent-icon-B5jKg1D4.js";import{I as tt}from"./input-C85X5mQd.js";import{L as et}from"./label-BQtTOPkv.js";import{as as at,at as nt,aB as ct,au as ft}from"./index-CDQDonc2.js";import{u as dt,s as M,I as gt}from"./primitives-C4IQk_dn.js";import{S as ut}from"./save-status-sNJre79x.js";import{a as xt,B as ht,b as yt}from"./block-document-C3HZF41z.js";import"./AlertCircle-CBqPbJhE.js";import"./Tool01-DKSKRkDn.js";import"./SwitchHorizontal01-CS0hM449.js";import"./Settings02-BWSkBAC0.js";import"./ArrowUpRight-CeK93HMb.js";import"./ZapSquare-CRuF7_Od.js";import"./Users03-BNYrsyyA.js";import"./CheckCircle-DZ7lx3KF.js";import"./ChevronUp-D9KnZoAi.js";import"./ChevronDown-CJWYZLuA.js";import"./ChevronLeft-CnLqo_kp.js";import"./ChevronRight-DfdMQ2Fw.js";import"./DotsVertical-DFqqfAl6.js";import"./Stars02-CsFUuUcv.js";import"./Eye-BT74up7P.js";import"./ZoomOut-hi-FNg6F.js";import"./Globe01-D-zy1b5e.js";import"./FilterLines-C8AP3gRc.js";import"./Star01-6xSTQrG2.js";import"./Globe04-CTK-EMBE.js";import"./HardDrive-C5zzTdLP.js";import"./Key01-CGqUyM9V.js";import"./LayoutLeft-ByH5X-SK.js";import"./LinkExternal01-BPuS9hJa.js";import"./Monitor01-CoqnETyV.js";import"./Sun-Boa0IILr.js";import"./Palette-COnOloJT.js";import"./Play-B0YCT5-m.js";import"./Plus-B8D680G_.js";import"./SearchMd-u8dQ1GMf.js";import"./Shield01-D6oYrc9O.js";import"./Stars01-CC6YF-Gm.js";import"./Trash01-CWfKClvv.js";import"./Upload01-Dzd1geuw.js";import"./User01-C8VsM6kw.js";import"./Users01-3oKdAMi1.js";import"./XClose-BDFu3FRS.js";import"./X-CSyvhNbh.js";import"./Zap-CXfIxPjW.js";import"./index-K-9e2ZDA.js";import"./chat-context-Dphq5ubi.js";import"./hooks-DHpz1d4N.js";import"./use-mcp-client-DBqNVBda.js";import"./auth-BkwEkX2d.js";import"./decopilot-sse-pool-dougyUqv.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-DjogNdpY.js";import"./use-collections--Li9hsny.js";import"./use-ai-providers-_Cu_CUx8.js";import"./studio-tools-D8jocIuF.js";import"./tab-id-BptcWVWa.js";import"./use-organization-settings-D73e98lK.js";import"./scroll-area-dzkBqX8_.js";import"./use-clock-tick-2NgWXYqH.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-C7bsJAWf.js";import"./tooltip-B8O5EzJh.js";import"./file-type-icon-CzW2A5RE.js";import"./dialog-CvVsKEYZ.js";import"./content-blocks-o63cs2vh.js";import"./types-Di9YuMWP.js";import"./shell-layout-BdF9IDeE.js";import"./avatar-DVfn3HK-.js";import"./required-auth-layout-BemkjKan.js";import"./use-org-sso-CpvSwXK-.js";import"./sheet-0vdtuc3i.js";import"./integration-icon-5EPhLKNh.js";import"./use-navigate-to-agent-zUK-3Xnr.js";import"./use-connection-CV9pGQq0.js";import"./use-mcp-prompts-C_k5ossc.js";import"./form-BWMflY-D.js";import"./select-DEG7PFkZ.js";import"./drawer-BwNOtTqY.js";import"./collection-search-BlM-1h2p.js";import"./tabs-By9RVZpO.js";import"./toggle-group-BVAqJsgZ.js";import"./sortable.esm-A8tP5NgA.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-D4RLitiQ.js";import"./use-registry-connections-BWn-5VV_.js";import"./useInfiniteQuery-bc8haI9M.js";import"./use-infinite-scroll-Dj9UAgIo.js";import"./extract-connection-data-CT8AxPCy.js";import"./card-Cg4U92wO.js";import"./collection-tabs-DLdr8wLT.js";import"./badge-C-PgyJP_.js";import"./textarea-DPdVb49N.js";import"./connection-form-helpers-CZiloNgc.js";import"./authenticate-and-persist-oauth-CYtmcv5M.js";import"./mcp-oauth-DuXz7McC.js";import"./useSuspenseInfiniteQuery-BbH0X03C.js";import"./connect-desktop-dialog-VHzsIUyV.js";import"./decopilot-DlqOnjYH.js";import"./checkbox-BAdcCLlw.js";import"./skeleton-BWev8k8G.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-51WiZXYd.js";import"./popover-B07cKons.js";import"./command-CSVnblSP.js";import"./index-DPtZiiq2.js";import"./dropdown-menu-Btez7WVe.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-Dl5xgyQC.js";import"./empty-state-B1HRggjH.js";import"./toolbar-CP1DI4yM.js";import"./preview-dialog-CmWcwQ_d.js";import"./index-Dy0NHd84.js";import"./use-mcp-tools-B4W-z7bl.js";import"./use-capability-054Jlz5j.js";import"./shell-route-loading-D58stY2L.js";import"./index-BgmIzn4p.js";import"./alert-dialog-BMQCNP5r.js";import"./switch-Cq8_Q7W_.js";import"./use-debounced-autosave-BBjgbH01.js";import"./index-ChJT_O6D.js";import"./sidebar-BqyUOUvx.js";import"./search-input-CAgO5lFg.js";import"./github-repo-picker-DjPaaZ8o.js";import"./use-secrets-CLwAc1Jw.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./view-mode-toggle-DMN8QWmQ.js";import"./automation-runs-CMCvBggE.js";import"./table-Dsj-XDfc.js";import"./use-members-9RqOs3Qh.js";import"./use-org-auth-client-d3773LF8.js";import"./task-status-D9dvEJiX.js";import"./use-automations-Bluj9UpJ.js";import"./use-file-configs-KASOspWn.js";import"./monaco-editor-BORZmFin.js";import"./select-model-zOa-Rdrr.js";import"./automation-list-row-B6RsIqvM.js";function Yi(it){const t=st.c(87),{orgSlug:l,virtualMcpId:p,branch:a,blockKey:z,block:G,decofile:H,meta:O,onManagePosts:Q}=it;let F;t[0]!==a||t[1]!==l||t[2]!==p?(F={orgSlug:l,virtualMcpId:p,branch:a},t[0]=a,t[1]=l,t[2]=p,t[3]=F):F=t[3];const m=at(F);let U;t[4]!==G?(U=nt(G,"categories"),t[4]=G,t[5]=U):U=t[5];const ot=U;let D;t[6]!==z||t[7]!==m?(D=o=>{m.mutate({blockKey:z,data:ft(z,"categories",o)})},t[6]=z,t[7]=m,t[8]=D):D=t[8];const[i,V]=dt(ot,D);let L;t[9]!==i||t[10]!==V?(L=(o,rt)=>V({...i,[o]:rt}),t[9]=i,t[10]=V,t[11]=L):L=t[11];const r=L;let s,R;t[12]!==i.slug||t[13]!==H?(s=M(i.slug),R=s?ct(H).filter(o=>o.categorySlugs.includes(s)).length:0,t[12]=i.slug,t[13]=H,t[14]=s,t[15]=R):(s=t[14],R=t[15]);const T=R;let n;t[16]!==i.name?(n=M(i.name)||"Untitled category",t[16]=i.name,t[17]=n):n=t[17];let c;t[18]!==n?(c=e.jsx("span",{className:"truncate text-sm font-medium",children:n}),t[18]=n,t[19]=c):c=t[19];let f;t[20]!==m.isError||t[21]!==m.isPending?(f=e.jsx(ut,{isPending:m.isPending,isError:m.isError}),t[20]=m.isError,t[21]=m.isPending,t[22]=f):f=t[22];let d;t[23]!==c||t[24]!==f?(d=e.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[c,f]}),t[23]=c,t[24]=f,t[25]=d):d=t[25];let g;t[26]!==i.name?(g=M(i.name),t[26]=i.name,t[27]=g):g=t[27];let u;t[28]!==r?(u=o=>r("name",o),t[28]=r,t[29]=u):u=t[29];let x;t[30]!==g||t[31]!==u?(x=e.jsx(gt,{value:g,onChange:u,placeholder:"Category name",className:"py-1 text-3xl font-bold text-foreground"}),t[30]=g,t[31]=u,t[32]=x):x=t[32];let $;t[33]===Symbol.for("react.memo_cache_sentinel")?($=e.jsx(et,{htmlFor:"category-slug",children:"Slug"}),t[33]=$):$=t[33];let h;t[34]!==i.slug?(h=M(i.slug),t[34]=i.slug,t[35]=h):h=t[35];let y;t[36]!==r?(y=o=>r("slug",o.target.value),t[36]=r,t[37]=y):y=t[37];let j;t[38]!==h||t[39]!==y?(j=e.jsxs("div",{className:"mt-4 space-y-2",children:[$,e.jsx(tt,{id:"category-slug",value:h,onChange:y,placeholder:"my-category",className:"h-10"})]}),t[38]=h,t[39]=y,t[40]=j):j=t[40];let A;t[41]===Symbol.for("react.memo_cache_sentinel")?(A=e.jsx(et,{htmlFor:"category-description",children:"Description"}),t[41]=A):A=t[41];let b;t[42]!==i.description?(b=M(i.description),t[42]=i.description,t[43]=b):b=t[43];let v;t[44]!==r?(v=o=>r("description",o.target.value),t[44]=r,t[45]=v):v=t[45];let N;t[46]!==b||t[47]!==v?(N=e.jsxs("div",{className:"mt-4 space-y-2",children:[A,e.jsx(tt,{id:"category-description",value:b,onChange:v,placeholder:"Short description for this category",className:"h-10"})]}),t[46]=b,t[47]=v,t[48]=N):N=t[48];let J;t[49]===Symbol.for("react.memo_cache_sentinel")?(J=e.jsx(pt,{size:16,className:"shrink-0 text-muted-foreground"}),t[49]=J):J=t[49];const X=T===1?"post":"posts";let S;t[50]!==T||t[51]!==X?(S=e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[J,e.jsxs("span",{className:"text-sm",children:[T," ",X," in this category"]})]}),t[50]=T,t[51]=X,t[52]=S):S=t[52];const Y=!s,Z=s?"Jump to the posts list filtered by this category":"Set a slug to manage this category's posts";let B;t[53]!==Q||t[54]!==s?(B=()=>Q(s),t[53]=Q,t[54]=s,t[55]=B):B=t[55];let K;t[56]===Symbol.for("react.memo_cache_sentinel")?(K=e.jsx(lt,{size:14}),t[56]=K):K=t[56];let k;t[57]!==Y||t[58]!==Z||t[59]!==B?(k=e.jsxs(mt,{type:"button",variant:"outline",size:"sm",disabled:Y,title:Z,onClick:B,children:["Manage posts",K]}),t[57]=Y,t[58]=Z,t[59]=B,t[60]=k):k=t[60];let _;t[61]!==S||t[62]!==k?(_=e.jsxs("div",{className:"mt-6 flex items-center justify-between gap-3 rounded-lg border bg-muted/30 px-4 py-3",children:[S,k]}),t[61]=S,t[62]=k,t[63]=_):_=t[63];let W;t[64]===Symbol.for("react.memo_cache_sentinel")?(W=e.jsx("div",{className:"mt-6 border-t"}),t[64]=W):W=t[64];let C;t[65]!==i.sections?(C=xt(i.sections),t[65]=i.sections,t[66]=C):C=t[66];let P;t[67]!==r?(P=o=>r("sections",o),t[67]=r,t[68]=P):P=t[68];let E;t[69]!==O||t[70]!==C||t[71]!==P?(E=e.jsx(ht,{value:C,onChange:P,meta:O,emptyMessage:"This category has no content yet. Use ⊕ to add your first block."}),t[69]=O,t[70]=C,t[71]=P,t[72]=E):E=t[72];let w;t[73]!==x||t[74]!==j||t[75]!==N||t[76]!==_||t[77]!==E?(w=e.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:e.jsxs("div",{className:"mx-auto max-w-3xl px-8 py-8",children:[x,j,N,_,W,E]})}),t[73]=x,t[74]=j,t[75]=N,t[76]=_,t[77]=E,t[78]=w):w=t[78];let I;t[79]!==w||t[80]!==d?(I=e.jsxs("div",{className:"flex h-full flex-col",children:[d,w]}),t[79]=w,t[80]=d,t[81]=I):I=t[81];let q;return t[82]!==a||t[83]!==l||t[84]!==I||t[85]!==p?(q=e.jsx(yt,{orgSlug:l,virtualMcpId:p,branch:a,children:I}),t[82]=a,t[83]=l,t[84]=I,t[85]=p,t[86]=q):q=t[86],q}export{Yi as CategoryEditor};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as I,r as O,l as ve,j as s,B as Y,i as Ce,K as U,k as oe,m as Ue,a as Ne,u as Ae,b as Ie,n as $e,d as Te,o as Ee,Q as De,E as Me,p as Se,L as Ke}from"./index-Cdi_SW9v.js";import{A as qe}from"./auth-entry-cn4hgqYj.js";import{A}from"./auth-split-layout-DsYH7119.js";import{O as _e}from"./organization-choice-DG1wa9ZD.js";import{f as He}from"./tab-id-BptcWVWa.js";import{I as Fe}from"./input-C85X5mQd.js";import{u as be,W as Re,S as Oe,g as Be,C as Qe}from"./use-mcp-client-DBqNVBda.js";import{i as we}from"./XCircle-DX7bokFz.js";import{I as We}from"./integration-icon-5EPhLKNh.js";import{i as ke}from"./CheckCircle-DZ7lx3KF.js";import{g as Ge,c as Ye,e as Ve}from"./extract-connection-data-CT8AxPCy.js";import{a as Ze}from"./authenticate-and-persist-oauth-CYtmcv5M.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./avatar-DVfn3HK-.js";import"./User01-C8VsM6kw.js";import"./auth-BkwEkX2d.js";import"./agent-icon-B5jKg1D4.js";import"./AlertCircle-CBqPbJhE.js";import"./Tool01-DKSKRkDn.js";import"./SwitchHorizontal01-CS0hM449.js";import"./Settings02-BWSkBAC0.js";import"./ArrowUpRight-CeK93HMb.js";import"./ZapSquare-CRuF7_Od.js";import"./Users03-BNYrsyyA.js";import"./ChevronUp-D9KnZoAi.js";import"./ChevronDown-CJWYZLuA.js";import"./ChevronLeft-CnLqo_kp.js";import"./ChevronRight-DfdMQ2Fw.js";import"./DotsVertical-DFqqfAl6.js";import"./Stars02-CsFUuUcv.js";import"./Eye-BT74up7P.js";import"./ZoomOut-hi-FNg6F.js";import"./Globe01-D-zy1b5e.js";import"./FilterLines-C8AP3gRc.js";import"./Star01-6xSTQrG2.js";import"./Globe04-CTK-EMBE.js";import"./HardDrive-C5zzTdLP.js";import"./Key01-CGqUyM9V.js";import"./LayoutLeft-ByH5X-SK.js";import"./LinkExternal01-BPuS9hJa.js";import"./Monitor01-CoqnETyV.js";import"./Sun-Boa0IILr.js";import"./Palette-COnOloJT.js";import"./Play-B0YCT5-m.js";import"./Plus-B8D680G_.js";import"./SearchMd-u8dQ1GMf.js";import"./Shield01-D6oYrc9O.js";import"./Stars01-CC6YF-Gm.js";import"./Trash01-CWfKClvv.js";import"./Upload01-Dzd1geuw.js";import"./Users01-3oKdAMi1.js";import"./XClose-BDFu3FRS.js";import"./X-CSyvhNbh.js";import"./Zap-CXfIxPjW.js";import"./mcp-oauth-DuXz7McC.js";const Je=/^[a-zA-Z][a-zA-Z\d+.-]*:/,Xe=/^[a-zA-Z][a-zA-Z\d+.-]*:\/\//,et=/^[^\s/:?#]+\.[^\s/:?#]+:\d+(?:[/?#]|$)/,tt=/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/i;function he(i){const e=i.trim();if(!e)return{ok:!1,error:"Enter a website URL."};const t=Je.test(e),n=Xe.test(e),o=et.test(e);if(t&&!n&&!o)return{ok:!1,error:"Use an HTTP or HTTPS website URL."};const c=n?e:`https://${e}`;let l;try{l=new URL(c)}catch{return{ok:!1,error:"Enter a valid website URL."}}if(l.protocol!=="http:"&&l.protocol!=="https:")return{ok:!1,error:"Use an HTTP or HTTPS website URL."};const r=l.hostname.split(".");return r.length<2||r.some(d=>!d||!tt.test(d))?{ok:!1,error:"Enter a valid website URL."}:(l.protocol="https:",{ok:!0,value:l.origin})}function xe(i){const e=I.c(14),{children:t,className:n,wrapperClassName:o}=i,[c,l]=O.useState(!0);let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=x=>{if(!x)return;const y=()=>{const a=x.scrollHeight-x.scrollTop-x.clientHeight<8;l(a)};y(),x.addEventListener("scroll",y,{passive:!0});const C=new ResizeObserver(y);C.observe(x);for(const a of Array.from(x.children))C.observe(a);return()=>{x.removeEventListener("scroll",y),C.disconnect()}},e[0]=r):r=e[0];const d=r;let m;e[1]!==o?(m=ve("relative",o),e[1]=o,e[2]=m):m=e[2];let g;e[3]!==t||e[4]!==n?(g=s.jsx("div",{ref:d,className:n,children:t}),e[3]=t,e[4]=n,e[5]=g):g=e[5];const u=c?"opacity-0":"opacity-100";let p;e[6]!==u?(p=ve("pointer-events-none absolute inset-x-0 -bottom-px h-[213px]","bg-gradient-to-t from-sidebar from-[6px] to-transparent","backdrop-blur-[2px] [mask-image:linear-gradient(to_top,black_6px,transparent)]","transition-opacity duration-200",u),e[6]=u,e[7]=p):p=e[7];let h;e[8]!==p?(h=s.jsx("div",{"aria-hidden":!0,className:p}),e[8]=p,e[9]=h):h=e[9];let f;return e[10]!==m||e[11]!==g||e[12]!==h?(f=s.jsxs("div",{className:m,children:[g,h]}),e[10]=m,e[11]=g,e[12]=h,e[13]=f):f=e[13],f}function nt(){const i=I.c(3);let e;i[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"size-12 shrink-0 animate-pulse rounded-lg bg-muted/60"}),s.jsx("div",{className:"h-4 w-32 animate-pulse rounded bg-muted/60"}),s.jsx("div",{className:"ml-auto h-8 w-20 animate-pulse rounded-lg bg-muted/60"})]}),i[0]=e):e=i[0];let t;i[1]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx("div",{className:"p-1",children:s.jsx("div",{className:"h-5 w-40 animate-pulse rounded bg-muted/60"})}),i[1]=t):t=i[1];let n;return i[2]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{className:"flex flex-col gap-2 rounded-2xl border border-border bg-card p-4",children:[e,s.jsxs("div",{className:"flex flex-col gap-1 px-1 py-2",children:[t,s.jsx("div",{className:"p-1",children:s.jsx("div",{className:"h-5 w-56 animate-pulse rounded bg-muted/60"})})]})]}),i[2]=n):n=i[2],n}function ye(i){const e=I.c(3),{children:t}=i;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(ke,{size:14,className:"shrink-0 text-blue-500"}),e[0]=n):n=e[0];let o;return e[1]!==t?(o=s.jsxs("div",{className:"flex items-center gap-2 p-1",children:[n,s.jsx("p",{className:"text-sm text-foreground",children:t})]}),e[1]=t,e[2]=o):o=e[2],o}function st(i){const e=I.c(33),{card:t,connecting:n,disabled:o,onConnect:c}=i;let l;e[0]!==t.icon||e[1]!==t.title?(l=s.jsx(We,{icon:t.icon,name:t.title,size:"md",fit:"contain",className:"p-2"}),e[0]=t.icon,e[1]=t.title,e[2]=l):l=e[2];let r;e[3]!==t.title?(r=s.jsx("p",{className:"flex-1 text-sm text-foreground",children:t.title}),e[3]=t.title,e[4]=r):r=e[4];let d;e[5]!==t.satisfied||e[6]!==t.title||e[7]!==n||e[8]!==o||e[9]!==c?(d=t.satisfied?s.jsxs("div",{className:"flex h-8 items-center gap-2 px-3 text-sm text-muted-foreground",children:[s.jsx(ke,{size:16})," Connected"]}):s.jsx(Y,{type:"button",variant:"outline",size:"sm",disabled:o||n,onClick:c,"aria-label":`Connect ${t.title}`,children:n?s.jsx(Ce,{size:16,className:"animate-spin"}):"Connect"}),e[5]=t.satisfied,e[6]=t.title,e[7]=n,e[8]=o,e[9]=c,e[10]=d):d=e[10];let m;e[11]!==l||e[12]!==r||e[13]!==d?(m=s.jsxs("div",{className:"flex items-center gap-2",children:[l,r,d]}),e[11]=l,e[12]=r,e[13]=d,e[14]=m):m=e[14];let g;e[15]!==t.checks?(g=t.checks!==null&&s.jsxs(ye,{children:["+ ",t.checks," checks"]}),e[15]=t.checks,e[16]=g):g=e[16];let u;e[17]!==t.headline?(u=t.headline&&s.jsx(ye,{children:t.headline}),e[17]=t.headline,e[18]=u):u=e[18];let p;e[19]!==t.bullets?(p=t.bullets.map(it),e[19]=t.bullets,e[20]=p):p=e[20];let h;e[21]!==t.candidateConnectionId||e[22]!==t.satisfied||e[23]!==t.title?(h=!t.satisfied&&t.candidateConnectionId&&s.jsxs("p",{className:"px-1 text-xs text-muted-foreground",children:["Using your existing ",t.title]}),e[21]=t.candidateConnectionId,e[22]=t.satisfied,e[23]=t.title,e[24]=h):h=e[24];let f;e[25]!==g||e[26]!==u||e[27]!==p||e[28]!==h?(f=s.jsxs("div",{className:"flex flex-col gap-1 px-1 py-2",children:[g,u,p,h]}),e[25]=g,e[26]=u,e[27]=p,e[28]=h,e[29]=f):f=e[29];let x;return e[30]!==m||e[31]!==f?(x=s.jsxs("div",{className:"flex flex-col gap-2 rounded-2xl border border-border bg-card p-4",children:[m,f]}),e[30]=m,e[31]=f,e[32]=x):x=e[32],x}function it(i){return s.jsx(ye,{children:i},i)}const je={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 ot(i){const e=i.properties;if(!e)return[];const t=[];for(const[n,o]of Object.entries(e)){const r=o?.properties?.__type?.const;typeof r=="string"&&r.length>0&&t.push({fieldKey:n,bindingType:r})}return t}function rt(i,e){const t=[];if(i.length&&t.push({field:["id"],operator:"in",value:i}),e.length&&t.push({field:["name"],operator:"in",value:e}),t.length!==0)return t.length===1?t[0]:{operator:"or",conditions:t}}function D(i){const e=i;if(e.isError)throw new Error(e.content?.find(t=>t.text)?.text??"Tool call failed");return e.structuredContent??i}function lt(i,e,t,n){return{...i??{},[e]:{__type:t,value:n}}}function at(i,e,t){const n=i.filter(o=>o.app_name===e||!!t&&o.app_id===t);return n.length===0?null:(n.sort((o,c)=>{const l=r=>r.status==="active"?0:1;return l(o)!==l(c)?l(o)-l(c):(c.updated_at??"").localeCompare(o.updated_at??"")}),n[0].id)}function ct(i){return i.server?.icons?.[0]?.src??Ge(i.server?.repository)??null}function dt(i,e){const t=i._meta?.["mcp.mesh"];return t?.friendlyName||t?.friendly_name||i.title||i.server?.title||i.server?.name||e}function mt(i){const e=[];for(const t of i.requirements){const n=i.curated[t.bindingType],o=n?i.itemsById[n.registryAppId]:i.itemsByName[t.bindingType];if(!o)continue;const l=!!i.configurationState?.[t.fieldKey]?.value;e.push({fieldKey:t.fieldKey,bindingType:t.bindingType,registryItem:o,title:dt(o,t.bindingType),icon:ct(o),headline:n?.headline??o._meta?.["mcp.mesh"]?.short_description??null,checks:n?.checks??null,bullets:n?.bullets??[],satisfied:l,candidateConnectionId:l?null:at(i.connections,t.bindingType,n?.registryAppId)})}return e}function ut(i){const e=I.c(25),{selfClient:t,org:n,cdConnectionId:o}=i;let c;e[0]!==o||e[1]!==n.id||e[2]!==n.slug?(c={connectionId:o,orgId:n.id,orgSlug:n.slug},e[0]=o,e[1]=n.id,e[2]=n.slug,e[3]=c):c=e[3];const l=be(c);let r;e[4]!==o||e[5]!==n.id?(r=U.commerceDiscoveryCompanionSchema(n.id,o),e[4]=o,e[5]=n.id,e[6]=r):r=e[6];let d;e[7]!==l?(d=async()=>{const v=await l.callTool({name:"MCP_CONFIGURATION",arguments:{}});return D(v)},e[7]=l,e[8]=d):d=e[8];let m;e[9]!==r||e[10]!==d?(m={queryKey:r,queryFn:d},e[9]=r,e[10]=d,e[11]=m):m=e[11];const g=oe(m),u=ot(g.data?.stateSchema??{properties:{}}),p=u.map(xt),h=u.map(ht).filter(gt),f=u.filter(pt).map(ft),x=[...h,...f].sort().join(",");let y;e[12]!==o||e[13]!==n.id?(y=U.commerceDiscoveryConnection(n.id,o),e[12]=o,e[13]=n.id,e[14]=y):y=e[14];let C;e[15]!==o||e[16]!==t?(C=async()=>{const v=await t.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:o}});return D(v)},e[15]=o,e[16]=t,e[17]=C):C=e[17];let a;e[18]!==y||e[19]!==C?(a={queryKey:y,queryFn:C},e[18]=y,e[19]=C,e[20]=a):a=e[20];const b=oe(a),j=oe({queryKey:U.commerceDiscoveryCompanionConnections(n.id),enabled:u.length>0,queryFn:async()=>{const v=await t.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{where:{operator:"or",conditions:[{field:["app_name"],operator:"in",value:p},{field:["app_id"],operator:"in",value:h}]},limit:1e3}});return D(v)}}),_=oe({queryKey:U.commerceDiscoveryCompanionRegistry(n.id,x),enabled:u.length>0,queryFn:async()=>{const v=rt(h,f),M=await Ye(Re.REGISTRY(n.id),n.id,n.slug,"COLLECTION_REGISTRY_APP_LIST",{...v?{where:v}:{},limit:1e3});return D(M)}}),E={},T={};for(const v of _.data?.items??[])E[v.id]=v,v.server?.name&&(T[v.server.name]=v);const R=mt({requirements:u,itemsById:E,itemsByName:T,connections:j.data?.items??[],configurationState:b.data?.item?.configuration_state??null,curated:je}),N=g.isPending||b.isPending||u.length>0&&(j.isPending||_.isPending),P=g.error??b.error??j.error??_.error??null;let z;return e[21]!==R||e[22]!==P||e[23]!==N?(z={cards:R,isLoading:N,error:P},e[21]=R,e[22]=P,e[23]=N,e[24]=z):z=e[24],z}function ft(i){return i.bindingType}function pt(i){return!je[i.bindingType]}function gt(i){return!!i}function ht(i){return je[i.bindingType]?.registryAppId}function xt(i){return i.bindingType}function yt({selfClient:i,org:e,userId:t,cdConnectionId:n}){const o=Ue(),[c,l]=O.useState(null),[r,d]=O.useState(null),m=async(u,p)=>{const h=await i.callTool({name:"COLLECTION_CONNECTIONS_UPDATE",arguments:{id:u,data:p}});return D(h)};async function g(u){l(u.fieldKey),d(null);try{let p=u.candidateConnectionId;if(!p){const a=Ve(u.registryItem,e.id,t,{remoteIndex:0}),b=a.connection_type==="STDIO",j=!!a.connection_url,_=b&&a.connection_headers&&typeof a.connection_headers=="object"&&"command"in a.connection_headers;if(!j&&!_){d(`${u.title} cannot be connected: no connection method available`);return}const E=await i.callTool({name:"COLLECTION_CONNECTIONS_CREATE",arguments:{data:a}});p=D(E).item.id}const h=p,f=await Ze({connectionId:h,orgId:e.id,orgSlug:e.slug,persistFallback:a=>m(h,{connection_token:a}).then(()=>{})});if(!f.ok){d(`Couldn't sign in to ${u.title}: ${f.error}`);return}const x=await i.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:n}}),y=D(x).item?.configuration_state??null,C=lt(y,u.fieldKey,u.bindingType,h);await m(n,{configuration_state:C}),await o.invalidateQueries({queryKey:U.commerceDiscoveryConnection(e.id,n)}),await o.invalidateQueries({queryKey:U.commerceDiscoveryCompanionConnections(e.id)})}catch(p){d(p instanceof Error?p.message:String(p))}finally{l(null)}}return{connect:g,connectingFieldKey:c,error:r}}function Ct(i){const e=I.c(30),{org:t,cdConnectionId:n,reportDisabled:o,onOpenReport:c}=i,{data:l}=Ne.useSession(),r=l?.user?.id??"";let d;e[0]!==t.id||e[1]!==t.slug?(d={connectionId:Oe,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=d):d=e[2];const m=be(d);let g;e[3]!==n||e[4]!==t||e[5]!==m?(g={selfClient:m,org:t,cdConnectionId:n},e[3]=n,e[4]=t,e[5]=m,e[6]=g):g=e[6];const{cards:u,isLoading:p,error:h}=ut(g);let f;e[7]!==n||e[8]!==t||e[9]!==m||e[10]!==r?(f={selfClient:m,org:t,userId:r,cdConnectionId:n},e[7]=n,e[8]=t,e[9]=m,e[10]=r,e[11]=f):f=e[11];const{connect:x,connectingFieldKey:y,error:C}=yt(f);let a;e[12]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(we,{size:16}),e[12]=a):a=e[12];let b;e[13]!==c||e[14]!==o?(b=s.jsxs(Y,{type:"button",size:"xl",className:"w-full",onClick:c,disabled:o,children:["See full report",a]}),e[13]=c,e[14]=o,e[15]=b):b=e[15];const j=b;if(!p&&!h&&u.length===0){let N;return e[16]!==j?(N=s.jsx("div",{className:"flex min-h-0 flex-1 flex-col justify-end gap-10 md:grid md:flex-none",children:j}),e[16]=j,e[17]=N):N=e[17],N}const _=y!==null;let E;e[18]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsxs("div",{className:"grid gap-1.5",children:[s.jsx("p",{className:"text-2xl font-medium text-foreground",children:"Unlock your full diagnostic"}),s.jsx("p",{className:"text-base text-muted-foreground",children:"Connect your tools to unlock 100+ checks across your funnel."})]}),e[18]=E):E=e[18];let T;e[19]!==_||e[20]!==u||e[21]!==x||e[22]!==C||e[23]!==y||e[24]!==h||e[25]!==p?(T=h?s.jsxs("div",{role:"alert",className:"rounded-2xl border border-border bg-card p-4",children:[s.jsx("p",{className:"text-sm text-foreground",children:"Couldn't load companion integrations."}),s.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Reload the page to try again."})]}):p?s.jsx("div",{className:"flex min-h-0 flex-1 flex-col gap-4",children:[0,1,2].map(bt)}):s.jsx(xe,{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:s.jsxs("div",{className:"grid gap-4",children:[C&&s.jsx("p",{role:"alert",className:"text-sm text-destructive",children:C}),u.map(N=>s.jsx(st,{card:N,connecting:y===N.fieldKey,disabled:_&&y!==N.fieldKey,onConnect:()=>{x(N)}},N.fieldKey))]})}),e[19]=_,e[20]=u,e[21]=x,e[22]=C,e[23]=y,e[24]=h,e[25]=p,e[26]=T):T=e[26];let R;return e[27]!==j||e[28]!==T?(R=s.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-6 md:grid md:flex-none",children:[E,T,j]}),e[27]=j,e[28]=T,e[29]=R):R=e[29],R}function bt(i){return s.jsx(nt,{},i)}function ze(i){const e=I.c(10),{host:t}=i,n=`https://www.google.com/s2/favicons?domain=${t}&sz=128`;let o,c,l;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-7 w-7 dark:hidden"}),c=s.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-7 w-7 hidden dark:block"}),l=s.jsx("div",{className:"h-6 w-px rotate-12 bg-border","aria-hidden":"true"}),e[0]=o,e[1]=c,e[2]=l):(o=e[0],c=e[1],l=e[2]);let r;e[3]!==n?(r=s.jsx("div",{className:"flex h-7 w-7 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-border bg-white",children:s.jsx("img",{src:n,alt:"",className:"h-5 w-5",loading:"lazy"})}),e[3]=n,e[4]=r):r=e[4];let d;e[5]!==t?(d=s.jsx("span",{className:"text-lg font-medium text-foreground",children:t}),e[5]=t,e[6]=d):d=e[6];let m;return e[7]!==r||e[8]!==d?(m=s.jsxs("div",{className:"flex items-center gap-3",children:[o,c,l,r,d]}),e[7]=r,e[8]=d,e[9]=m):m=e[9],m}function Pn(){const i=I.c(1);let e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(vt,{}),i[0]=e):e=i[0],e}const Le=O.createContext(null),Pe=()=>O.useContext(Le);function jt(i){if(!i)return null;const e=he(i);return e.ok?new URL(e.value).hostname:null}function vt(){const i=I.c(9);let e;i[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/commerce-onboarding"},i[0]=e):e=i[0];const t=Ae(e),{org:n,siteUrl:o}=t;let c;i[1]!==o?(c=jt(o),i[1]=o,i[2]=c):c=i[2];const l=c;let r;i[3]!==n||i[4]!==o?(r=s.jsx(St,{requestedOrgSlug:n,siteUrl:o}),i[3]=n,i[4]=o,i[5]=r):r=i[5];let d;return i[6]!==l||i[7]!==r?(d=s.jsx(Le.Provider,{value:l,children:r}),i[6]=l,i[7]=r,i[8]=d):d=i[8],d}function St(i){const e=I.c(8),{requestedOrgSlug:t,siteUrl:n}=i,{data:o,isPending:c}=Ne.useSession(),l=Pe();if(c){let d;return e[0]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(A,{children:s.jsx(V,{label:"Preparing commerce onboarding..."})}),e[0]=d):d=e[0],d}if(!o){const d=typeof window>"u"?"/commerce-onboarding":`${window.location.pathname}${window.location.search}`;let m;e[1]!==l?(m=l?s.jsx(ze,{host:l}):void 0,e[1]=l,e[2]=m):m=e[2];let g;return e[3]!==m?(g=s.jsx(A,{children:s.jsx(qe,{callbackUrl:d,allowAutoLogin:!1,title:"Unlock your full diagnostic",subtitle:null,brand:m})}),e[3]=m,e[4]=g):g=e[4],g}let r;return e[5]!==t||e[6]!==n?(r=s.jsx(_t,{requestedOrgSlug:t,siteUrl:n}),e[5]=t,e[6]=n,e[7]=r):r=e[7],r}function _t(i){const e=I.c(40),{requestedOrgSlug:t,siteUrl:n}=i,o=Ie(),c=$e(),[l,r]=O.useState(null),[d,m]=O.useState(null),g=c.data?.map(It)??[];let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u={mutationFn:Nt,retry:!1,onSuccess:a=>{m(a)}},e[0]=u):u=e[0];const p=Te(u);if(c.isPending){let a;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(A,{children:s.jsx(V,{label:"Preparing commerce onboarding..."})}),e[1]=a):a=e[1],a}if(c.error){let a;return e[2]!==c?(a=s.jsx(le,{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]=a):a=e[3],a}const h=t?g.find(a=>a.slug===t):null;if(h){let a;return e[4]!==h||e[5]!==n?(a=s.jsx(re,{org:h,initialSiteUrl:n}),e[4]=h,e[5]=n,e[6]=a):a=e[6],a}if(t){let a;return e[7]!==c?(a=s.jsx(le,{title:"Organization not found",description:"We could not find that organization for your account.",actionLabel:"Retry",onRetry:()=>c.refetch()}),e[7]=c,e[8]=a):a=e[8],a}if(l){let a;return e[9]!==l||e[10]!==n?(a=s.jsx(re,{org:l,initialSiteUrl:n}),e[9]=l,e[10]=n,e[11]=a):a=e[11],a}if(g.length===1&&g[0]){let a;return e[12]!==g[0]||e[13]!==n?(a=s.jsx(re,{org:g[0],initialSiteUrl:n}),e[12]=g[0],e[13]=n,e[14]=a):a=e[14],a}if(g.length>1){let a;e[15]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx($,{title:"Choose an organization",description:"Select where commerce diagnostics should continue."}),e[15]=a):a=e[15];let b;e[16]===Symbol.for("react.memo_cache_sentinel")?(b=_=>r(_),e[16]=b):b=e[16];let j;return e[17]!==g?(j=s.jsx(A,{children:s.jsxs("div",{className:"grid gap-10",children:[a,s.jsx(xe,{className:"-mx-1 max-h-[60vh] overflow-y-auto px-1",children:s.jsx(_e,{organizations:g,selectLabel:"Continue",onSelected:b})})]})}),e[17]=g,e[18]=j):j=e[18],j}if(!d){let a;e[19]!==p?(a=()=>{p.reset(),p.mutate()},e[19]=p,e[20]=a):a=e[20];let b;return e[21]!==p||e[22]!==a?(b=s.jsx(Tt,{mutation:p,onRetry:a}),e[21]=p,e[22]=a,e[23]=b):b=e[23],b}const f=d;if(f?.success&&(f.status==="created"||f.status==="joined"||f.status==="already_has_organization")&&f.organization){let a;return e[24]!==f.organization||e[25]!==n?(a=s.jsx(re,{org:f.organization,initialSiteUrl:n}),e[24]=f.organization,e[25]=n,e[26]=a):a=e[26],a}if(f?.status==="ambiguous"&&f.organizations&&f.organizations.length>0){let a;e[27]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx($,{title:"Choose an organization",description:"Your email can access more than one organization. Choose where commerce setup should continue."}),e[27]=a):a=e[27];const b=f.domain??void 0;let j;e[28]!==o||e[29]!==n?(j=(E,T)=>{Ee(),r({...E,slug:T}),o({to:"/commerce-onboarding",search:{org:T,siteUrl:n}})},e[28]=o,e[29]=n,e[30]=j):j=e[30];let _;return e[31]!==f.organizations||e[32]!==b||e[33]!==j?(_=s.jsx(A,{children:s.jsxs("div",{className:"grid gap-10",children:[a,s.jsx(xe,{className:"-mx-1 max-h-[60vh] overflow-y-auto px-1",children:s.jsx(_e,{organizations:f.organizations,domain:b,onJoined:j})})]})}),e[31]=f.organizations,e[32]=b,e[33]=j,e[34]=_):_=e[34],_}const x=f?.error??"We could not determine a commerce organization for this account.";let y;e[35]!==p?(y=()=>{m(null),p.reset()},e[35]=p,e[36]=y):y=e[36];let C;return e[37]!==x||e[38]!==y?(C=s.jsx(le,{title:"Commerce onboarding needs support",description:x,actionLabel:"Try again",onRetry:y}),e[37]=x,e[38]=y,e[39]=C):C=e[39],C}async function Nt(){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&&Ee(),e}function It(i){return{id:i.id,name:i.name,slug:i.slug,logo:i.logo??null}}function Tt(i){const e=I.c(7),{mutation:t,onRetry:n}=i,o=O.useRef(!1);let c;e[0]!==t?(c=m=>{!m||o.current||(o.current=!0,t.mutate())},e[0]=t,e[1]=c):c=e[1];const l=c;if(t.error){let m;return e[2]!==n?(m=s.jsx(le,{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:n}),e[2]=n,e[3]=m):m=e[3],m}let r;e[4]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(V,{label:"Preparing your commerce workspace..."}),e[4]=r):r=e[4];let d;return e[5]!==l?(d=s.jsx(A,{children:s.jsx("div",{ref:l,children:r})}),e[5]=l,e[6]=d):d=e[6],d}function $(i){const e=I.c(8),{title:t,description:n}=i,o=Pe();let c;e[0]!==o?(c=o?s.jsx(ze,{host:o}):s.jsxs("div",{children:[s.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),s.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 l;e[2]!==n||e[3]!==t?(l=(t||n)&&s.jsxs("div",{className:"space-y-2",children:[t&&s.jsx("h1",{className:"text-2xl font-medium leading-8",children:t}),n&&s.jsx("p",{className:"text-base text-muted-foreground leading-6",children:n})]}),e[2]=n,e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==c||e[6]!==l?(r=s.jsxs("div",{className:"grid gap-10",children:[c,l]}),e[5]=c,e[6]=l,e[7]=r):r=e[7],r}function V(i){const e=I.c(3),{label:t}=i;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Ce,{size:14,className:"animate-spin text-muted-foreground"}),e[0]=n):n=e[0];let o;return e[1]!==t?(o=s.jsxs("div",{className:"flex items-center gap-2 py-4",role:"status","aria-live":"polite",children:[n,s.jsx("span",{className:"text-sm text-muted-foreground",children:t})]}),e[1]=t,e[2]=o):o=e[2],o}function le(i){const e=I.c(9),{title:t,description:n,actionLabel:o,onRetry:c}=i;let l;e[0]!==n||e[1]!==t?(l=s.jsx($,{title:t,description:n}),e[0]=n,e[1]=t,e[2]=l):l=e[2];let r;e[3]!==o||e[4]!==c?(r=s.jsx(Y,{type:"button",size:"xl",className:"w-full",onClick:c,children:o}),e[3]=o,e[4]=c,e[5]=r):r=e[5];let d;return e[6]!==l||e[7]!==r?(d=s.jsx(A,{children:s.jsxs("div",{className:"grid gap-10",children:[l,r]})}),e[6]=l,e[7]=r,e[8]=d):d=e[8],d}function Et(i){return i.content?.find(e=>e.text)?.text??"Commerce Discovery setup failed."}function pe(i){const e=i;if(e.isError)throw new Error(Et(e));return e.structuredContent??i}function re(i){const e=I.c(3),{org:t,initialSiteUrl:n}=i;let o;return e[0]!==n||e[1]!==t?(o=s.jsx(A,{children:s.jsx(De,{children:c=>{const{reset:l}=c;return s.jsx(Me,{fallback:r=>{const{error:d,resetError:m}=r;return s.jsx(Rt,{orgName:t.name,message:d instanceof Error?d.message:"We could not check Commerce Discovery setup.",onRetry:()=>{l(),m()}})},children:s.jsx(O.Suspense,{fallback:s.jsx(V,{label:"Connecting workspace..."}),children:s.jsx(Ot,{org:t,initialSiteUrl:n},`${t.id}:${n??""}`)})})}})}),e[0]=n,e[1]=t,e[2]=o):o=e[2],o}function Rt(i){const e=I.c(10),{orgName:t,message:n,onRetry:o}=i,c=`Commerce setup will continue for ${t}.`;let l;e[0]!==c?(l=s.jsx($,{title:"Commerce diagnostics",description:c}),e[0]=c,e[1]=l):l=e[1];let r;e[2]!==n?(r=s.jsx(ae,{message:n}),e[2]=n,e[3]=r):r=e[3];let d;e[4]!==o?(d=s.jsx(Y,{type:"button",size:"xl",className:"w-full",onClick:o,children:"Retry"}),e[4]=o,e[5]=d):d=e[5];let m;return e[6]!==l||e[7]!==r||e[8]!==d?(m=s.jsxs("div",{className:"grid gap-10",children:[l,r,d]}),e[6]=l,e[7]=r,e[8]=d,e[9]=m):m=e[9],m}function Ot(i){const e=I.c(83),{org:t,initialSiteUrl:n}=i,o=Ie();let c;e[0]!==t.id||e[1]!==t.slug?(c={connectionId:Oe,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=c):c=e[2];const l=be(c),[r,d]=O.useState(n??""),[m,g]=O.useState(null),[u,p]=O.useState(null),h=O.useRef(!1),f=Re.COMMERCE_DISCOVERY(t.id),x=Be(t.id),y=U.commerceDiscoveryConnection(t.id,f);let C;e[3]!==f||e[4]!==l?(C=async()=>{const S=await l.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:f}});return pe(S)},e[3]=f,e[4]=l,e[5]=C):C=e[5];let a;e[6]!==y||e[7]!==C?(a={queryKey:y,queryFn:C,retry:!1},e[6]=y,e[7]=C,e[8]=a):a=e[8];const b=Se(a),j=U.commerceDiscoveryVirtualMcp(t.id,x);let _;e[9]!==l||e[10]!==x?(_=async()=>{const S=await l.callTool({name:"COLLECTION_VIRTUAL_MCP_GET",arguments:{id:x}});return pe(S)},e[9]=l,e[10]=x,e[11]=_):_=e[11];let E;e[12]!==j||e[13]!==_?(E={queryKey:j,queryFn:_,retry:!1},e[12]=j,e[13]=_,e[14]=E):E=e[14];const T=Se(E);let R;e[15]!==l?(R=async S=>{const k=await l.callTool({name:"COMMERCE_DISCOVERY_SETUP",arguments:{siteUrl:S}});return pe(k)},e[15]=l,e[16]=R):R=e[16];let N;e[17]!==b||e[18]!==T?(N=S=>{g(S),p(null),b.refetch(),T.refetch()},e[17]=b,e[18]=T,e[19]=N):N=e[19];let P;e[20]===Symbol.for("react.memo_cache_sentinel")?(P=S=>{p(S instanceof Error?S.message:"Commerce Discovery setup failed.")},e[20]=P):P=e[20];let z;e[21]!==R||e[22]!==N?(z={mutationFn:R,retry:!1,onSuccess:N,onError:P},e[21]=R,e[22]=N,e[23]=z):z=e[23];const v=Te(z),M=!!b.data.item&&!!T.data.item;let Z;e[24]!==v?(Z=S=>{const k=he(S);if(!k.ok){p(k.error);return}p(null),v.mutate(k.value)},e[24]=v,e[25]=Z):Z=e[25];const K=Z;let J;e[26]!==n||e[27]!==K||e[28]!==M?(J=S=>{!S||h.current||M||!n||(h.current=!0,K(n))},e[26]=n,e[27]=K,e[28]=M,e[29]=J):J=e[29];const ce=J;let X;e[30]!==K||e[31]!==r?(X=S=>{S.preventDefault(),K(r)},e[30]=K,e[31]=r,e[32]=X):X=e[32];const L=X;let ee;e[33]!==f||e[34]!==m?.reportApp||e[35]!==x?(ee=m?.reportApp??{connectionId:f,virtualMcpId:x,toolName:Qe},e[33]=f,e[34]=m?.reportApp,e[35]=x,e[36]=ee):ee=e[36];const w=ee;let te;e[37]!==o||e[38]!==t.slug||e[39]!==w.connectionId||e[40]!==w.toolName||e[41]!==w.virtualMcpId?(te=()=>{localStorage.setItem(Ke.sidebarOpen(),JSON.stringify(!1)),o({to:"/$org/$taskId",params:{org:t.slug,taskId:crypto.randomUUID()},search:{virtualmcpid:w.virtualMcpId,main:He(w.connectionId,w.toolName),chat:0}})},e[37]=o,e[38]=t.slug,e[39]=w.connectionId,e[40]=w.toolName,e[41]=w.virtualMcpId,e[42]=te):te=e[42];const de=te;if(M){let S;return e[43]!==de||e[44]!==t||e[45]!==w?(S=s.jsx(wt,{org:t,reportApp:w,onOpenReport:de}),e[43]=de,e[44]=t,e[45]=w,e[46]=S):S=e[46],S}if(n){let S;e[47]!==n?(S=he(n),e[47]=n,e[48]=S):S=e[48];const k=S;if(!k.ok){const fe=`Commerce setup will continue for ${t.name}.`;let Q;e[49]!==fe?(Q=s.jsx($,{title:"Commerce diagnostics",description:fe}),e[49]=fe,e[50]=Q):Q=e[50];let W;e[51]!==k.error?(W=s.jsx(ae,{message:k.error}),e[51]=k.error,e[52]=W):W=e[52];let G;e[53]!==L||e[54]!==u||e[55]!==v.isPending||e[56]!==r?(G=s.jsx(ge,{siteUrl:r,error:u,isSubmitting:v.isPending,onSiteUrlChange:d,onSubmit:L}),e[53]=L,e[54]=u,e[55]=v.isPending,e[56]=r,e[57]=G):G=e[57];let ie;return e[58]!==Q||e[59]!==W||e[60]!==G?(ie=s.jsxs("div",{className:"grid gap-10",children:[Q,W,G]}),e[58]=Q,e[59]=W,e[60]=G,e[61]=ie):ie=e[61],ie}const ue=`Commerce Discovery is being prepared for ${k.value}.`;let F;e[62]!==ue?(F=s.jsx($,{title:"Commerce diagnostics",description:ue}),e[62]=ue,e[63]=F):F=e[63];let B;e[64]!==L||e[65]!==u||e[66]!==v||e[67]!==r?(B=u?s.jsxs(s.Fragment,{children:[s.jsx(ae,{message:u}),s.jsx(ge,{siteUrl:r,error:null,isSubmitting:v.isPending,onSiteUrlChange:d,onSubmit:L})]}):s.jsx(V,{label:"Setting up Commerce Discovery..."}),e[64]=L,e[65]=u,e[66]=v,e[67]=r,e[68]=B):B=e[68];let se;return e[69]!==F||e[70]!==B||e[71]!==ce?(se=s.jsxs("div",{ref:ce,className:"grid gap-10",children:[F,B]}),e[69]=F,e[70]=B,e[71]=ce,e[72]=se):se=e[72],se}const me=`Commerce setup will continue for ${t.name}.`;let q;e[73]!==me?(q=s.jsx($,{title:"Commerce diagnostics",description:me}),e[73]=me,e[74]=q):q=e[74];let H;e[75]!==L||e[76]!==u||e[77]!==v.isPending||e[78]!==r?(H=s.jsx(ge,{siteUrl:r,error:u,isSubmitting:v.isPending,onSiteUrlChange:d,onSubmit:L}),e[75]=L,e[76]=u,e[77]=v.isPending,e[78]=r,e[79]=H):H=e[79];let ne;return e[80]!==q||e[81]!==H?(ne=s.jsxs("div",{className:"grid gap-10",children:[q,H]}),e[80]=q,e[81]=H,e[82]=ne):ne=e[82],ne}function ge(i){const e=I.c(22),{siteUrl:t,error:n,isSubmitting:o,onSiteUrlChange:c,onSubmit:l}=i;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("label",{className:"text-sm font-medium",htmlFor:"commerce-site-url",children:"Website URL"}),e[0]=r):r=e[0];let d;e[1]!==c?(d=y=>c(y.target.value),e[1]=c,e[2]=d):d=e[2];const m=!!n;let g;e[3]!==o||e[4]!==t||e[5]!==d||e[6]!==m?(g=s.jsx(Fe,{id:"commerce-site-url",type:"text",inputMode:"url",value:t,onChange:d,placeholder:"https://example.com","aria-invalid":m,disabled:o}),e[3]=o,e[4]=t,e[5]=d,e[6]=m,e[7]=g):g=e[7];let u;e[8]!==n?(u=n?s.jsx(ae,{message:n}):null,e[8]=n,e[9]=u):u=e[9];let p;e[10]!==g||e[11]!==u?(p=s.jsxs("div",{className:"grid gap-2",children:[r,g,u]}),e[10]=g,e[11]=u,e[12]=p):p=e[12];let h;e[13]!==o?(h=o?s.jsxs(s.Fragment,{children:[s.jsx(Ce,{size:14,className:"animate-spin"}),"Setting up"]}):s.jsxs(s.Fragment,{children:["Continue",s.jsx(we,{size:16})]}),e[13]=o,e[14]=h):h=e[14];let f;e[15]!==o||e[16]!==h?(f=s.jsx(Y,{type:"submit",size:"xl",className:"w-full",disabled:o,children:h}),e[15]=o,e[16]=h,e[17]=f):f=e[17];let x;return e[18]!==l||e[19]!==p||e[20]!==f?(x=s.jsxs("form",{className:"grid gap-4",onSubmit:l,children:[p,f]}),e[18]=l,e[19]=p,e[20]=f,e[21]=x):x=e[21],x}function wt(i){const e=I.c(6),{org:t,reportApp:n,onOpenReport:o}=i;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx($,{}),e[0]=c):c=e[0];const l=!n.virtualMcpId;let r;return e[1]!==o||e[2]!==t||e[3]!==n.connectionId||e[4]!==l?(r=s.jsxs("div",{className:"flex h-[calc(100dvh-3rem)] flex-col gap-10 md:grid md:h-auto",children:[c,s.jsx(Ct,{org:t,cdConnectionId:n.connectionId,reportDisabled:l,onOpenReport:o})]}),e[1]=o,e[2]=t,e[3]=n.connectionId,e[4]=l,e[5]=r):r=e[5],r}function ae(i){const e=I.c(2),{message:t}=i;let n;return e[0]!==t?(n=s.jsx("p",{className:"text-sm leading-5 text-destructive",role:"alert",children:t}),e[0]=t,e[1]=n):n=e[1],n}export{Pn as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{am as ot,an as he,ao as lt,ap as at,aq as Oe,m as le,ar as ct,as as dt,r as $,at as mt,au as ut,av as ft,aw as ht,ax as Se,ay as pt,az as xt,aA as gt,c as k,j as n,w as J,l as G,i as ae,aB as Z,t as U,K as te,k as se,B as Y,d as bt,a7 as yt,E as vt,a as jt}from"./index-Cdi_SW9v.js";import{u as be}from"./tooltip-B8O5EzJh.js";import{i as wt,u as ce,m as Nt,a as St,S as Ct}from"./use-mcp-client-DBqNVBda.js";import{u as _t,b as It,v as Tt,a as kt}from"./use-virtual-mcp-DjogNdpY.js";import{i as $t}from"./ChevronUp-D9KnZoAi.js";import{e as At,A as de,Y as Et,a7 as Ot,D as Pt,k as Mt}from"./agent-icon-B5jKg1D4.js";import{s as ye}from"./Plus-B8D680G_.js";import{i as Pe}from"./X-CSyvhNbh.js";import{C as re}from"./index-K-9e2ZDA.js";import{b as zt}from"./chat-context-Dphq5ubi.js";import{N as Rt}from"./decopilot-DlqOnjYH.js";import{g as Lt,b as Me,c as oe,K as ze,P as Re,D as Le,d as Ht,S as Dt,v as Ft,e as Ut,C as Qt,s as Bt,l as qt,k as Vt,o as Kt,u as Wt,j as Gt,h as Jt}from"./sortable.esm-A8tP5NgA.js";import{u as He,a as De,o as Xt}from"./use-organization-settings-D73e98lK.js";import{c as ve,b as Zt,h as Yt}from"./shell-layout-BdF9IDeE.js";import{I as Fe}from"./input-C85X5mQd.js";import{S as es,t as je,P as ts,j as ss,s as ns,g as is}from"./scroll-area-dzkBqX8_.js";import{S as rs,a as os,b as ls,c as as,d as cs}from"./sheet-0vdtuc3i.js";import{S as H}from"./skeleton-BWev8k8G.js";import{t as Ue}from"./ChevronDown-CJWYZLuA.js";import{c as Qe}from"./ZoomOut-hi-FNg6F.js";import{g as Be,M as ds}from"./types-Di9YuMWP.js";import{I as qe}from"./integration-icon-5EPhLKNh.js";import{b as ms,c as us,S as fs,a as Ce,d as hs}from"./select-DEG7PFkZ.js";import{T as ps}from"./textarea-DPdVb49N.js";import{u as Ve}from"./studio-tools-D8jocIuF.js";import{a as xs}from"./use-mcp-tools-B4W-z7bl.js";import{i as gs}from"./XCircle-DX7bokFz.js";import{f as bs}from"./tab-id-BptcWVWa.js";import{g as ys}from"./use-mcp-prompts-C_k5ossc.js";import{u as vs,w as js}from"./hooks-DHpz1d4N.js";import{a as ws,g as Ns,c as Ss,b as Cs,D as _s}from"./dropdown-menu-Btez7WVe.js";import{s as Is}from"./Trash01-CWfKClvv.js";import{a as Ts,u as ks}from"./use-ai-providers-_Cu_CUx8.js";import{u as $s}from"./connect-desktop-dialog-VHzsIUyV.js";import{a as As}from"./toolbar-CP1DI4yM.js";import"./auth-BkwEkX2d.js";import"./use-collections--Li9hsny.js";import"./AlertCircle-CBqPbJhE.js";import"./Tool01-DKSKRkDn.js";import"./SwitchHorizontal01-CS0hM449.js";import"./Settings02-BWSkBAC0.js";import"./ArrowUpRight-CeK93HMb.js";import"./ZapSquare-CRuF7_Od.js";import"./Users03-BNYrsyyA.js";import"./CheckCircle-DZ7lx3KF.js";import"./ChevronLeft-CnLqo_kp.js";import"./ChevronRight-DfdMQ2Fw.js";import"./DotsVertical-DFqqfAl6.js";import"./Stars02-CsFUuUcv.js";import"./Eye-BT74up7P.js";import"./Globe01-D-zy1b5e.js";import"./FilterLines-C8AP3gRc.js";import"./Star01-6xSTQrG2.js";import"./Globe04-CTK-EMBE.js";import"./HardDrive-C5zzTdLP.js";import"./Key01-CGqUyM9V.js";import"./LayoutLeft-ByH5X-SK.js";import"./LinkExternal01-BPuS9hJa.js";import"./Monitor01-CoqnETyV.js";import"./Sun-Boa0IILr.js";import"./Palette-COnOloJT.js";import"./Play-B0YCT5-m.js";import"./SearchMd-u8dQ1GMf.js";import"./Shield01-D6oYrc9O.js";import"./Stars01-CC6YF-Gm.js";import"./Upload01-Dzd1geuw.js";import"./User01-C8VsM6kw.js";import"./Users01-3oKdAMi1.js";import"./XClose-BDFu3FRS.js";import"./Zap-CXfIxPjW.js";import"./dialog-CvVsKEYZ.js";import"./drawer-BwNOtTqY.js";import"./collection-search-BlM-1h2p.js";import"./form-BWMflY-D.js";import"./label-BQtTOPkv.js";import"./tabs-By9RVZpO.js";import"./toggle-group-BVAqJsgZ.js";import"./popover-B07cKons.js";import"./command-CSVnblSP.js";import"./index-DPtZiiq2.js";import"./useInfiniteQuery-bc8haI9M.js";import"./use-infinite-scroll-Dj9UAgIo.js";import"./question-004-sINsf4GQ.js";import"./checkbox-BAdcCLlw.js";import"./ai-providers-logos-DD3qZ33J.js";import"./avatar-DVfn3HK-.js";import"./settings-section-51WiZXYd.js";import"./card-Cg4U92wO.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-D4RLitiQ.js";import"./use-registry-connections-BWn-5VV_.js";import"./use-connection-CV9pGQq0.js";import"./extract-connection-data-CT8AxPCy.js";import"./collection-tabs-DLdr8wLT.js";import"./badge-C-PgyJP_.js";import"./connection-form-helpers-CZiloNgc.js";import"./authenticate-and-persist-oauth-CYtmcv5M.js";import"./mcp-oauth-DuXz7McC.js";import"./useSuspenseInfiniteQuery-BbH0X03C.js";import"./required-auth-layout-BemkjKan.js";import"./use-org-sso-CpvSwXK-.js";import"./use-clock-tick-2NgWXYqH.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-C7bsJAWf.js";import"./file-type-icon-CzW2A5RE.js";import"./content-blocks-o63cs2vh.js";import"./use-navigate-to-agent-zUK-3Xnr.js";import"./decopilot-sse-pool-dougyUqv.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";function _e(t,e){const s=new Set(e);return t.filter(r=>!s.has(r))}function Es(t,e,s){const r=t.slice(0);return r[e]=s,r}var Os=class extends ot{#i;#e;#r;#n;#t;#s;#o;#l;#a;#c=[];constructor(t,e,s){super(),this.#i=t,this.#n=s,this.#r=[],this.#t=[],this.#e=[],this.setQueries(e)}onSubscribe(){this.listeners.size===1&&this.#t.forEach(t=>{t.subscribe(e=>{this.#f(t,e)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#t.forEach(t=>{t.destroy()})}setQueries(t,e){this.#r=t,this.#n=e,he.batch(()=>{const s=this.#t,r=this.#u(this.#r);r.forEach(c=>c.observer.setOptions(c.defaultedQueryOptions));const i=r.map(c=>c.observer),o=i.map(c=>c.getCurrentResult()),l=s.length!==i.length,d=i.some((c,u)=>c!==s[u]),a=l||d,m=a?!0:o.some((c,u)=>{const f=this.#e[u];return!f||!lt(c,f)});!a&&!m||(a&&(this.#c=r,this.#t=i),this.#e=o,this.hasListeners()&&(a&&(_e(s,i).forEach(c=>{c.destroy()}),_e(i,s).forEach(c=>{c.subscribe(u=>{this.#f(c,u)})})),this.#h()))})}getCurrentResult(){return this.#e}getQueries(){return this.#t.map(t=>t.getCurrentQuery())}getObservers(){return this.#t}getOptimisticResult(t,e){const s=this.#u(t),r=s.map(o=>o.observer.getOptimisticResult(o.defaultedQueryOptions)),i=s.map(o=>o.defaultedQueryOptions.queryHash);return[r,o=>this.#m(o??r,e,i),()=>this.#d(r,s)]}#d(t,e){return e.map((s,r)=>{const i=t[r];return s.defaultedQueryOptions.notifyOnChangeProps?i:s.observer.trackResult(i,o=>{e.forEach(l=>{l.observer.trackProp(o)})})})}#m(t,e,s){if(e){const r=this.#a,i=s!==void 0&&r!==void 0&&(r.length!==s.length||s.some((o,l)=>o!==r[l]));return(!this.#s||this.#e!==this.#l||i||e!==this.#o)&&(this.#o=e,this.#l=this.#e,s!==void 0&&(this.#a=s),this.#s=at(this.#s,e(t))),this.#s}return t}#p(){return this.#n?.combine!==void 0&&this.#t.some((t,e)=>t.options.suspense&&this.#e[e]?.data===void 0)}#u(t){const e=new Map;this.#t.forEach(r=>{const i=r.options.queryHash;if(!i)return;const o=e.get(i);o?o.push(r):e.set(i,[r])});const s=[];return t.forEach(r=>{const i=this.#i.defaultQueryOptions(r),l=e.get(i.queryHash)?.shift()??new Oe(this.#i,i);s.push({defaultedQueryOptions:i,observer:l})}),s}#f(t,e){const s=this.#t.indexOf(t);s!==-1&&(this.#e=Es(this.#e,s,e),this.#h())}#h(){if(this.hasListeners()){const t=this.#d(this.#e,this.#c),e=this.#p(),s=this.#s,r=e?s:this.#m(t,this.#n?.combine);(e||s!==r)&&he.batch(()=>{this.listeners.forEach(i=>{i(this.#e)})})}}};function Ps({queries:t,...e},s){const r=le(s),i=ct(),o=dt(),l=$.useMemo(()=>t.map(p=>{const g=r.defaultQueryOptions(p);return g._optimisticResults=i?"isRestoring":"optimistic",g}),[t,r,i]);l.forEach(p=>{mt(p);const g=r.getQueryCache().get(p.queryHash);ut(p,o,g)}),ft(o);const[d]=$.useState(()=>new Os(r,l,e)),[a,m,c]=d.getOptimisticResult(l,e.combine),u=!i&&e.subscribed!==!1;$.useSyncExternalStore($.useCallback(p=>u?d.subscribe(he.batchCalls(p)):ht,[d,u]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),$.useEffect(()=>{d.setQueries(l,e)},[l,e,d]);const h=a.some((p,g)=>Se(l[g],p))?a.flatMap((p,g)=>{const y=l[g];if(y&&Se(y,p)){const j=new Oe(r,y);return pt(y,j,o)}return[]}):[];if(h.length>0)throw Promise.all(h);const x=a.find((p,g)=>{const y=l[g];return y&&xt({result:p,errorResetBoundary:o,throwOnError:y.throwOnError,query:r.getQueryCache().get(y.queryHash),suspense:y.suspense})});if(x?.error)throw x.error;return m(c())}function Ms(t,e){return Ps({...t,queries:t.queries.map(s=>({...s,suspense:!0,throwOnError:gt,enabled:!0,placeholderData:void 0}))},e)}function Ke(t){const e=k.c(11),{properties:s,required:r,values:i,onChange:o}=t;let l;e[0]!==r?(l=r??[],e[0]=r,e[1]=l):l=e[1];let d;e[2]!==l?(d=new Set(l),e[2]=l,e[3]=d):d=e[3];const a=d;let m;e[4]!==s?(m=Object.entries(s),e[4]=s,e[5]=m):m=e[5];let c;return e[6]!==o||e[7]!==a||e[8]!==m||e[9]!==i?(c=n.jsx("div",{className:"flex flex-col gap-2",children:m.map(u=>{const[f,h]=u;return n.jsxs("div",{className:"flex flex-col gap-0.5",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("label",{className:"text-xs font-medium leading-none flex items-center gap-1",children:[f,a.has(f)&&n.jsx("span",{className:"text-red-500 text-[10px]",children:"*"})]}),n.jsx("span",{className:"text-[10px] text-muted-foreground font-mono",children:h.type})]}),h.description&&n.jsx("p",{className:"text-[10px] text-muted-foreground leading-snug",children:h.description}),n.jsx(zs,{type:h.type,fieldKey:f,value:i[f],onChange:x=>o(f,x)})]},f)})}),e[6]=o,e[7]=a,e[8]=m,e[9]=i,e[10]=c):c=e[10],c}function zs(t){const e=k.c(19),{type:s,fieldKey:r,value:i,onChange:o}=t;if(s==="object"||s==="array"){const c=i??"";let u;e[0]!==o?(u=x=>o(x.target.value),e[0]=o,e[1]=u):u=e[1];const f=`Enter ${r} as JSON…`;let h;return e[2]!==c||e[3]!==u||e[4]!==f?(h=n.jsx(ps,{className:"font-mono text-xs h-16",value:c,onChange:u,placeholder:f,rows:2}),e[2]=c,e[3]=u,e[4]=f,e[5]=h):h=e[5],h}if(s==="boolean"){const c=i!=null?String(i):"";let u;e[6]!==o?(u=p=>o(p==="true"),e[6]=o,e[7]=u):u=e[7];let f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(ms,{className:"h-7 text-xs",children:n.jsx(us,{placeholder:"Select…"})}),e[8]=f):f=e[8];let h;e[9]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsxs(fs,{children:[n.jsx(Ce,{value:"true",children:"true"}),n.jsx(Ce,{value:"false",children:"false"})]}),e[9]=h):h=e[9];let x;return e[10]!==c||e[11]!==u?(x=n.jsxs(hs,{value:c,onValueChange:u,children:[f,h]}),e[10]=c,e[11]=u,e[12]=x):x=e[12],x}const l=i??"";let d;e[13]!==o?(d=c=>o(c.target.value),e[13]=o,e[14]=d):d=e[14];const a=`Enter ${r}…`;let m;return e[15]!==l||e[16]!==d||e[17]!==a?(m=n.jsx(Fe,{className:"h-7 text-xs",value:l,onChange:d,placeholder:a}),e[15]=l,e[16]=d,e[17]=a,e[18]=m):m=e[18],m}const ne=8;function Rs(t){const e=k.c(16),{open:s,onOpenChange:r}=t,[i,o]=$.useState("");let l,d;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(rs,{children:"Manage home"}),d=n.jsx(os,{children:"Add agents to the home board and pin their interactive UIs or prompts."}),e[0]=l,e[1]=d):(l=e[0],d=e[1]);let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(At,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none","aria-hidden":!0}),e[2]=a):a=e[2];let m;e[3]===Symbol.for("react.memo_cache_sentinel")?(m=p=>o(p.target.value),e[3]=m):m=e[3];let c;e[4]!==i?(c=n.jsxs(ls,{className:"px-5 py-4 border-b border-border",children:[l,d,n.jsxs("div",{className:"relative mt-3",children:[a,n.jsx(Fe,{value:i,onChange:m,placeholder:"Search agents…",className:"pl-8 h-8 text-sm"})]})]}),e[4]=i,e[5]=c):c=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(hn,{}),e[6]=u):u=e[6];let f;e[7]!==i?(f=n.jsx(es,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"p-3 flex flex-col gap-4",children:n.jsx($.Suspense,{fallback:u,children:n.jsx(Hs,{search:i})})})}),e[7]=i,e[8]=f):f=e[8];let h;e[9]!==c||e[10]!==f?(h=n.jsxs(as,{side:"right",className:"w-full sm:max-w-md p-0 flex flex-col",children:[c,f]}),e[9]=c,e[10]=f,e[11]=h):h=e[11];let x;return e[12]!==r||e[13]!==s||e[14]!==h?(x=n.jsx(cs,{open:s,onOpenChange:r,children:h}),e[12]=r,e[13]=s,e[14]=h,e[15]=x):x=e[15],x}function Ls(t){const e=k.c(32),{org:s}=J(),r=He();let i;e[0]!==r?.ids?(i=r?.ids??[],e[0]=r?.ids,e[1]=i):i=e[1];const o=i,l=De(),d=It(),a=le();let m;e[2]!==s||e[3]!==a?(m=()=>a.refetchQueries({queryKey:te.homeNextActions(s.slug),type:"active"}),e[2]=s,e[3]=a,e[4]=m):m=e[4];const c=m;let u;e[5]!==o?(u=C=>o.includes(C),e[5]=o,e[6]=u):u=e[6];const f=u;let h;e[7]!==o||e[8]!==t?(h=t?o.filter(C=>t.has(C)).length:o.length,e[7]=o,e[8]=t,e[9]=h):h=e[9];const p=h>=ne;let g;e[10]!==p||e[11]!==f||e[12]!==l?(g=C=>f(C)||p?Promise.resolve():l.apply(I=>I.includes(C)?null:[...I,C]),e[10]=p,e[11]=f,e[12]=l,e[13]=g):g=e[13];const y=g;let j;e[14]!==l?(j=C=>l.apply(I=>I.filter(T=>T!==C)),e[14]=l,e[15]=j):j=e[15];const w=j;let v;e[16]!==l?(v=C=>l.apply(()=>C),e[16]=l,e[17]=v):v=e[17];const b=v;let N;e[18]!==d||e[19]!==p||e[20]!==f||e[21]!==c||e[22]!==l?(N=async(C,I)=>{await d.update.mutateAsync({id:C.id,data:{metadata:I}}),!f(C.id)&&!p&&await l.apply(T=>T.includes(C.id)?null:[...T,C.id]),await c()},e[18]=d,e[19]=p,e[20]=f,e[21]=c,e[22]=l,e[23]=N):N=e[23];const S=N;let _;return e[24]!==y||e[25]!==p||e[26]!==o||e[27]!==f||e[28]!==w||e[29]!==b||e[30]!==S?(_={homeIds:o,isOnHome:f,atLimit:p,addAgent:y,removeAgent:w,reorder:b,saveAgentMetadata:S},e[24]=y,e[25]=p,e[26]=o,e[27]=f,e[28]=w,e[29]=b,e[30]=S,e[31]=_):_=e[31],_}function Hs(t){const e=k.c(21),{search:s}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={pageSize:1e3},e[0]=r):r=e[0];const i=_t(r);let o;e[1]!==i?(o=new Set(i.map(Bs)),e[1]=i,e[2]=o):o=e[2];const l=Ls(o);let d,a,m;if(e[3]!==i||e[4]!==l||e[5]!==s){const p=new Map(i.map(Qs));d=s.trim().toLowerCase();const g=w=>!d||w.title?.toLowerCase().includes(d);a=l.homeIds.map(w=>p.get(w)).filter(Us).filter(g);const y=Lt(i);let j;e[9]!==l?(j=w=>!l.isOnHome(w.id),e[9]=l,e[10]=j):j=e[10],m=i.filter(Fs).filter(w=>!y.has(w.id)).filter(j).filter(g).sort(Ds),e[3]=i,e[4]=l,e[5]=s,e[6]=d,e[7]=a,e[8]=m}else d=e[6],a=e[7],m=e[8];const c=m;let u;e[11]!==l||e[12]!==a?(u=n.jsx(qs,{home:l,agents:a}),e[11]=l,e[12]=a,e[13]=u):u=e[13];const f=!!d;let h;e[14]!==c||e[15]!==l||e[16]!==f?(h=n.jsx(Ws,{home:l,agents:c,hasSearch:f}),e[14]=c,e[15]=l,e[16]=f,e[17]=h):h=e[17];let x;return e[18]!==u||e[19]!==h?(x=n.jsxs(n.Fragment,{children:[u,h]}),e[18]=u,e[19]=h,e[20]=x):x=e[20],x}function Ds(t,e){return(t.title??"").localeCompare(e.title??"")}function Fs(t){return t.id&&!wt(t.id)}function Us(t){return!!t}function Qs(t){return[t.id,t]}function Bs(t){return t.id}function We(t){const e=k.c(7),{title:s,hint:r}=t;let i;e[0]!==s?(i=n.jsx("span",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:s}),e[0]=s,e[1]=i):i=e[1];let o;e[2]!==r?(o=r&&n.jsx("span",{className:"text-xs text-muted-foreground",children:r}),e[2]=r,e[3]=o):o=e[3];let l;return e[4]!==i||e[5]!==o?(l=n.jsxs("div",{className:"flex items-center justify-between px-1",children:[i,o]}),e[4]=i,e[5]=o,e[6]=l):l=e[6],l}function qs(t){const e=k.c(14),{home:s,agents:r}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={activationConstraint:{distance:5}},e[0]=i):i=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o={coordinateGetter:Bt},e[1]=o):o=e[1];const l=Me(oe(Re,i),oe(ze,o));let d;e[2]!==s?(d=h=>{const{active:x,over:p}=h;if(!p||x.id===p.id)return;const g=s.homeIds,y=g.indexOf(x.id),j=g.indexOf(p.id);y===-1||j===-1||s.reorder(qt([...g],y,j)).catch(Ks)},e[2]=s,e[3]=d):d=e[3];const a=d,m=`${s.homeIds.length}/${ne}`;let c;e[4]!==m?(c=n.jsx(We,{title:"On home",hint:m}),e[4]=m,e[5]=c):c=e[5];let u;e[6]!==r||e[7]!==a||e[8]!==s||e[9]!==l?(u=r.length===0?n.jsx("p",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:"No agents on the home yet."}):n.jsx(Le,{sensors:l,collisionDetection:Ht,onDragEnd:a,children:n.jsx(Dt,{items:r.map(Vs),strategy:Ft,children:n.jsx("div",{className:"flex flex-col gap-1",children:r.map(h=>n.jsx(Js,{agent:h,home:s},h.id))})})}),e[6]=r,e[7]=a,e[8]=s,e[9]=l,e[10]=u):u=e[10];let f;return e[11]!==c||e[12]!==u?(f=n.jsxs("div",{className:"flex flex-col gap-1.5",children:[c,u]}),e[11]=c,e[12]=u,e[13]=f):f=e[13],f}function Vs(t){return t.id}function Ks(){return U.error("Couldn't reorder home — please try again.")}function Ws(t){const e=k.c(6),{home:s,agents:r,hasSearch:i}=t,[o,l]=$.useState(20);let d;if(e[0]!==r||e[1]!==i||e[2]!==s||e[3]!==o){const a=r.slice(0,o);let m;e[5]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(We,{title:"Add to home"}),e[5]=m):m=e[5],d=n.jsxs("div",{className:"flex flex-col gap-1.5",children:[m,r.length===0?n.jsx("p",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:i?"No agents match.":"Every agent is on the home."}):n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"flex flex-col gap-1",children:a.map(c=>n.jsx(Ys,{agent:c,home:s},c.id))}),r.length>o&&n.jsxs("button",{type:"button",onClick:()=>l(Gs),className:"mt-1 self-center rounded-md px-3 py-1.5 text-xs text-muted-foreground hover:bg-accent/40 hover:text-foreground",children:["Load more (",r.length-o,")"]})]})]}),e[0]=r,e[1]=i,e[2]=s,e[3]=o,e[4]=d}else d=e[4];return d}function Gs(t){return t+20}function Ge(t){const e=Z(t.metadata?.ui).filter(o=>!!o.resourceUri).length,s=t.metadata?.ui?.homePrompts,r=Array.isArray(s)?s.length:null,i=[];return e>0&&i.push(`${e} tile${e===1?"":"s"}`),r!==null&&r>0&&i.push(`${r} prompt${r===1?"":"s"}`),r===0&&i.push("prompts off"),i.join(" · ")}function Js(t){const e=k.c(57),{agent:s,home:r}=t,[i,o]=$.useState(!1);let l;e[0]!==s.id?(l={id:s.id},e[0]=s.id,e[1]=l):l=e[1];const{attributes:d,listeners:a,setNodeRef:m,transform:c,transition:u,isDragging:f}=Ut(l),h=Ge(s)||"Quick access";let x;e[2]!==c?(x=Qt.Transform.toString(c),e[2]=c,e[3]=x):x=e[3];const p=f?.5:void 0,g=f?100:void 0;let y;e[4]!==x||e[5]!==p||e[6]!==g||e[7]!==u?(y={transform:x,transition:u,opacity:p,zIndex:g},e[4]=x,e[5]=p,e[6]=g,e[7]=u,e[8]=y):y=e[8];const j=y,w=f&&"shadow-lg";let v;e[9]!==w?(v=G("rounded-lg border border-border bg-card",w),e[9]=w,e[10]=v):v=e[10];const b=`Drag to reorder ${s.title??s.id}`;let N;e[11]===Symbol.for("react.memo_cache_sentinel")?(N=n.jsx(Qe,{size:14}),e[11]=N):N=e[11];let S;e[12]!==d||e[13]!==a||e[14]!==b?(S=n.jsx("button",{type:"button",...d,...a,className:"shrink-0 text-muted-foreground hover:text-foreground cursor-grab active:cursor-grabbing outline-none focus-visible:ring-2 focus-visible:ring-ring rounded","aria-label":b,children:N}),e[12]=d,e[13]=a,e[14]=b,e[15]=S):S=e[15];let _;e[16]===Symbol.for("react.memo_cache_sentinel")?(_=()=>o(Zs),e[16]=_):_=e[16];const C=s.title??s.id;let I;e[17]!==s.icon||e[18]!==C?(I=n.jsx(de,{icon:s.icon,name:C,size:"sm"}),e[17]=s.icon,e[18]=C,e[19]=I):I=e[19];const T=s.title??s.id;let E;e[20]!==T?(E=n.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:T}),e[20]=T,e[21]=E):E=e[21];let P;e[22]!==h?(P=n.jsx("div",{className:"truncate text-xs text-muted-foreground",children:h}),e[22]=h,e[23]=P):P=e[23];let M;e[24]!==E||e[25]!==P?(M=n.jsxs("div",{className:"min-w-0 flex-1",children:[E,P]}),e[24]=E,e[25]=P,e[26]=M):M=e[26];const Q=i&&"rotate-180";let z;e[27]!==Q?(z=G("shrink-0 text-muted-foreground transition-transform",Q),e[27]=Q,e[28]=z):z=e[28];let R;e[29]!==z?(R=n.jsx(Ue,{size:16,className:z}),e[29]=z,e[30]=R):R=e[30];let q;e[31]!==i||e[32]!==I||e[33]!==M||e[34]!==R?(q=n.jsxs("button",{type:"button",onClick:_,className:"flex min-w-0 flex-1 items-center gap-2.5 text-left outline-none","aria-expanded":i,children:[I,M,R]}),e[31]=i,e[32]=I,e[33]=M,e[34]=R,e[35]=q):q=e[35];let A;e[36]!==s.id||e[37]!==r?(A=()=>r.removeAgent(s.id).catch(Xs),e[36]=s.id,e[37]=r,e[38]=A):A=e[38];const B=`Remove ${s.title??s.id} from home`;let L;e[39]===Symbol.for("react.memo_cache_sentinel")?(L=n.jsx(Pe,{size:14}),e[39]=L):L=e[39];let O;e[40]!==A||e[41]!==B?(O=n.jsx("button",{type:"button",onClick:A,"aria-label":B,title:"Remove from home",className:"shrink-0 inline-flex size-7 items-center justify-center rounded-md text-muted-foreground hover:bg-destructive/10 hover:text-destructive",children:L}),e[40]=A,e[41]=B,e[42]=O):O=e[42];let D;e[43]!==S||e[44]!==q||e[45]!==O?(D=n.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-2.5",children:[S,q,O]}),e[43]=S,e[44]=q,e[45]=O,e[46]=D):D=e[46];let F;e[47]!==s||e[48]!==i||e[49]!==r?(F=i&&n.jsx(Je,{agent:s,home:r}),e[47]=s,e[48]=i,e[49]=r,e[50]=F):F=e[50];let K;return e[51]!==m||e[52]!==j||e[53]!==D||e[54]!==F||e[55]!==v?(K=n.jsxs("div",{ref:m,style:j,className:v,children:[D,F]}),e[51]=m,e[52]=j,e[53]=D,e[54]=F,e[55]=v,e[56]=K):K=e[56],K}function Xs(){return U.error("Couldn't remove from home — please try again.")}function Zs(t){return!t}function Ys({agent:t,home:e}){const[s,r]=$.useState(!1),[i,o]=$.useState(!1),l=Ge(t),d=async()=>{if(!e.atLimit){o(!0);try{await e.addAgent(t.id)}catch{U.error("Couldn't add to home — please try again.")}finally{o(!1)}}};return n.jsxs("div",{className:"rounded-lg border border-border bg-card",children:[n.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5",children:[n.jsxs("button",{type:"button",onClick:()=>r(a=>!a),className:"flex min-w-0 flex-1 items-center gap-3 text-left outline-none","aria-expanded":s,children:[n.jsx(de,{icon:t.icon,name:t.title??t.id,size:"sm"}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:t.title??t.id}),l&&n.jsx("div",{className:"truncate text-xs text-muted-foreground",children:l})]}),n.jsx(Ue,{size:16,className:G("shrink-0 text-muted-foreground transition-transform",s&&"rotate-180")})]}),n.jsx("button",{type:"button",onClick:d,disabled:i||e.atLimit,"aria-label":"Add to home",title:e.atLimit?`Home is full (${ne}) — remove an agent first`:"Add to home",className:"shrink-0 inline-flex size-7 items-center justify-center rounded-md bg-foreground text-background text-xs hover:opacity-90 disabled:opacity-40 disabled:cursor-not-allowed",children:i?n.jsx(ae,{size:12,className:"animate-spin"}):n.jsx(ye,{size:14})})]}),s&&n.jsx(Je,{agent:t,home:e})]})}function Je(t){const e=k.c(17),{agent:s,home:r}=t,i=s.metadata?.ui;let o;e[0]!==i?(o=Z(i),e[0]=i,e[1]=o):o=e[1];const l=o;let d;e[2]!==s.connections?(d=(s.connections??[]).map(en).sort(),e[2]=s.connections,e[3]=d):d=e[3];const a=d,m=s.metadata?.ui?.homePrompts;let c;e[4]!==s||e[5]!==a||e[6]!==r||e[7]!==l?(c=n.jsx(sn,{agent:s,home:r,connectionIds:a,pinnedTiles:l}),e[4]=s,e[5]=a,e[6]=r,e[7]=l,e[8]=c):c=e[8];let u;e[9]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(tn,{}),e[9]=u):u=e[9];const f=m??null;let h;e[10]!==s||e[11]!==r||e[12]!==f?(h=n.jsx($.Suspense,{fallback:u,children:n.jsx(an,{agent:s,home:r,curated:f})}),e[10]=s,e[11]=r,e[12]=f,e[13]=h):h=e[13];let x;return e[14]!==c||e[15]!==h?(x=n.jsxs("div",{className:"border-t border-border px-3 py-2 flex flex-col gap-3",children:[c,h]}),e[14]=c,e[15]=h,e[16]=x):x=e[16],x}function en(t){return t.connection_id}function tn(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsxs("div",{className:"flex flex-col gap-2 py-1",children:[n.jsx(H,{className:"h-8 w-full"}),n.jsx(H,{className:"h-8 w-2/3"})]}),t[0]=e):e=t[0],e}function sn({agent:t,home:e,connectionIds:s,pinnedTiles:r}){const i=Ve(),{data:o,isLoading:l}=se({queryKey:te.projectConnectionDetails(t.id,s),enabled:s.length>0,queryFn:async()=>(await Promise.all(s.map(async u=>{try{const{item:f}=await i.call("COLLECTION_CONNECTIONS_GET",{id:u}),h=(f?.tools??[]).flatMap(x=>{const p=Be(x._meta);return p?[{name:x.name,description:x.description,resourceUri:p,inputSchema:x.inputSchema}]:[]});return{id:u,title:f?.title??u,icon:f?.icon??null,uiTools:h}}catch{return{id:u,title:u,icon:null,uiTools:[]}}}))).filter(u=>u.uiTools.length>0)});if(s.length===0)return null;if(l)return n.jsxs("div",{className:"flex flex-col gap-1 py-0.5",children:[n.jsx(H,{className:"h-7 w-full"}),n.jsx(H,{className:"h-7 w-2/3"})]});if(!o||o.length===0)return null;const d=new Map;for(const c of o)for(const u of c.uiTools)d.set(`${c.id}:${u.name}`,{conn:c,tool:u});const a=c=>{if(c.toolName&&c.connectionId)return d.get(`${c.connectionId}:${c.toolName}`);for(const[,u]of d)if(u.conn.id===c.connectionId&&u.tool.resourceUri===c.resourceUri)return u},m=r.some(c=>!!a(c));return n.jsxs("div",{className:"flex flex-col gap-2",children:[m&&n.jsxs("div",{className:"flex flex-col gap-0.5",children:[n.jsx("span",{className:"text-[10px] font-medium uppercase tracking-wide text-muted-foreground px-2",children:"Pinned tiles"}),r.map(c=>{const u=a(c);return u?n.jsx(on,{agent:t,home:e,connection:u.conn,tool:u.tool,tile:c},c.tileId??`${c.connectionId}:${c.resourceUri}:${c.toolName}`):null})]}),n.jsxs("div",{className:"flex flex-col gap-0.5",children:[n.jsx("span",{className:"text-[10px] font-medium uppercase tracking-wide text-muted-foreground px-2",children:"Add tile"}),o.map(c=>c.uiTools.map(u=>n.jsx(ln,{agent:t,home:e,connection:c,tool:u},`add:${c.id}:${u.name}`)))]})]})}function Xe(t,e){const s={};for(const[r,i]of Object.entries(t)){const o=e[r]?.type;if((o==="object"||o==="array")&&typeof i=="string"){if(!i.trim())continue;try{s[r]=JSON.parse(i)}catch{return null}}else if((o==="number"||o==="integer")&&typeof i=="string"){if(!i.trim())continue;s[r]=Number(i)}else i!==""&&i!=null&&(s[r]=i)}return s}function nn(t,e){if(!t||!e)return{};const s={};for(const[r,i]of Object.entries(t)){const o=e[r]?.type;(o==="object"||o==="array")&&i!=null&&typeof i!="string"?s[r]=JSON.stringify(i,null,2):s[r]=i}return s}function rn(t){if(!t)return"";const e=Object.entries(t).filter(([,s])=>s!=null&&s!=="");return e.length===0?"":e.slice(0,3).map(([s,r])=>{const i=typeof r=="object"?JSON.stringify(r):String(r);return`${s}=${i.length>20?`${i.slice(0,20)}…`:i}`}).join(", ")}function on({agent:t,home:e,connection:s,tool:r,tile:i}){const[o,l]=$.useState(!1),[d,a]=$.useState(!1),m=r.inputSchema?.properties&&Object.keys(r.inputSchema.properties).length>0,[c,u]=$.useState(()=>nn(i.toolInput,r.inputSchema?.properties)),f=async()=>{l(!0);try{const p=Z(t.metadata?.ui),g=i.tileId?p.filter(j=>j.tileId!==i.tileId):p.filter(j=>j!==i),y={...t.metadata??{},ui:{...t.metadata?.ui??{},homeTile:null,homeTiles:g}};await e.saveAgentMetadata(t,y),a(!1)}catch(p){console.error("[home-tiles] failed to remove tile",p),U.error("Couldn't update home — please try again.")}finally{l(!1)}},h=async()=>{l(!0);try{let p;if(m&&r.inputSchema?.properties){const w=Xe(c,r.inputSchema.properties);if(!w){U.error("Invalid JSON in one of the fields — please fix it."),l(!1);return}Object.keys(w).length>0&&(p=w)}const y=Z(t.metadata?.ui).map(w=>(i.tileId?w.tileId===i.tileId:w===i)?{...w,toolInput:p}:w),j={...t.metadata??{},ui:{...t.metadata?.ui??{},homeTile:null,homeTiles:y}};await e.saveAgentMetadata(t,j),a(!1)}catch(p){console.error("[home-tiles] failed to save tile",p),U.error("Couldn't update home — please try again.")}finally{l(!1)}},x=rn(i.toolInput);return n.jsxs("div",{className:"flex flex-col rounded-md bg-accent/20",children:[n.jsxs("div",{className:"flex items-center gap-2.5 px-2 py-1",children:[n.jsx(qe,{icon:s.icon,name:s.title,size:"xs"}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("div",{className:"truncate text-sm text-foreground",children:je(r.name)}),x&&n.jsx("div",{className:"truncate text-[10px] text-muted-foreground font-mono",children:x})]}),m&&n.jsx("button",{type:"button",onClick:()=>a(p=>!p),"aria-label":"Configure tile props",title:"Configure tile props",className:"inline-flex size-7 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-accent/60",children:n.jsx(Et,{size:14})}),n.jsx(we,{isPinned:!0,submitting:o,onClick:f,label:"Remove from home"})]}),d&&m&&r.inputSchema?.properties&&n.jsxs("div",{className:"px-3 pb-2 pt-1 flex flex-col gap-2",children:[n.jsx(Ke,{properties:r.inputSchema.properties,required:r.inputSchema.required,values:c,onChange:(p,g)=>u(y=>({...y,[p]:g}))}),n.jsxs("div",{className:"flex items-center gap-2 justify-end",children:[n.jsx(Y,{variant:"ghost",size:"sm",className:"h-7 text-xs",onClick:()=>a(!1),children:"Cancel"}),n.jsx(Y,{size:"sm",className:"h-7 text-xs",disabled:o,onClick:h,children:o?n.jsx(ae,{size:12,className:"animate-spin"}):"Save"})]})]})]})}function ln({agent:t,home:e,connection:s,tool:r}){const[i,o]=$.useState(!1),[l,d]=$.useState(!1),a=r.inputSchema?.properties&&Object.keys(r.inputSchema.properties).length>0,[m,c]=$.useState({}),u=async()=>{if(a&&!l){d(!0);return}if(!e.isOnHome(t.id)&&e.atLimit){U.error(`Home is full (${ne}) — remove an agent first`);return}await f()},f=async()=>{o(!0);try{let h;if(a&&r.inputSchema?.properties){const y=Xe(m,r.inputSchema.properties);if(!y){U.error("Invalid JSON in one of the fields — please fix it."),o(!1);return}Object.keys(y).length>0&&(h=y)}const p=[...Z(t.metadata?.ui),{tileId:crypto.randomUUID(),connectionId:s.id,resourceUri:r.resourceUri,toolName:r.name,...h?{toolInput:h}:{}}],g={...t.metadata??{},ui:{...t.metadata?.ui??{},homeTile:null,homeTiles:p}};await e.saveAgentMetadata(t,g),d(!1),c({})}catch(h){console.error("[home-tiles] failed to add tile",h),U.error("Couldn't update home — please try again.")}finally{o(!1)}};return n.jsxs("div",{className:"flex flex-col rounded-md hover:bg-accent/40",children:[n.jsxs("div",{className:"flex items-center gap-2.5 px-2 py-1",children:[n.jsx(qe,{icon:s.icon,name:s.title,size:"xs"}),n.jsx("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:je(r.name)}),n.jsx(we,{isPinned:!1,submitting:i,onClick:u,label:"Add to home"})]}),l&&a&&r.inputSchema?.properties&&n.jsxs("div",{className:"px-3 pb-2 pt-1 flex flex-col gap-2",children:[n.jsx(Ke,{properties:r.inputSchema.properties,required:r.inputSchema.required,values:m,onChange:(h,x)=>c(p=>({...p,[h]:x}))}),n.jsxs("div",{className:"flex items-center gap-2 justify-end",children:[n.jsx(Y,{variant:"ghost",size:"sm",className:"h-7 text-xs",onClick:()=>{d(!1),c({})},children:"Cancel"}),n.jsx(Y,{size:"sm",className:"h-7 text-xs",disabled:i,onClick:f,children:i?n.jsx(ae,{size:12,className:"animate-spin"}):"Pin"})]})]})]})}function we(t){const e=k.c(11),{isPinned:s,submitting:r,onClick:i,label:o}=t,l=s?"text-muted-foreground hover:bg-destructive/10 hover:text-destructive":"bg-foreground text-background hover:opacity-90";let d;e[0]!==l?(d=G("inline-flex size-7 shrink-0 items-center justify-center rounded-md text-xs transition-colors disabled:opacity-50 disabled:cursor-progress",l),e[0]=l,e[1]=d):d=e[1];let a;e[2]!==s||e[3]!==r?(a=r?n.jsx(ae,{size:12,className:"animate-spin"}):s?n.jsx(Ot,{size:14}):n.jsx(ye,{size:14}),e[2]=s,e[3]=r,e[4]=a):a=e[4];let m;return e[5]!==o||e[6]!==i||e[7]!==r||e[8]!==d||e[9]!==a?(m=n.jsx("button",{type:"button",onClick:i,disabled:r,"aria-label":o,title:o,className:d,children:a}),e[5]=o,e[6]=i,e[7]=r,e[8]=d,e[9]=a,e[10]=m):m=e[10],m}function an(t){const e=k.c(32),{agent:s,home:r,curated:i}=t,{org:o}=J();let l;e[0]!==s.id||e[1]!==o.id||e[2]!==o.slug?(l={connectionId:s.id,orgId:o.id,orgSlug:o.slug},e[0]=s.id,e[1]=o.id,e[2]=o.slug,e[3]=l):l=e[3];const d=ce(l);let a;e[4]!==s.id||e[5]!==o.id?(a=te.agentPrompts(o.id,s.id),e[4]=s.id,e[5]=o.id,e[6]=a):a=e[6];let m;e[7]!==d?(m=async()=>{const{prompts:b}=await d.listPrompts();return b.map(un)},e[7]=d,e[8]=m):m=e[8];let c;e[9]!==a||e[10]!==m?(c={queryKey:a,queryFn:m,staleTime:3e4,retry:!1},e[9]=a,e[10]=m,e[11]=c):c=e[11];const{data:u,isLoading:f,error:h}=se(c),x=ve(o.slug);let p,g;if(e[12]!==s.id||e[13]!==u||e[14]!==x.prompts){let b;e[17]!==s.id?(b=S=>S.agentId===s.id&&S.promptName,e[17]=s.id,e[18]=b):b=e[18],p=x.prompts.filter(b).map(mn);let N;e[19]!==u?(N=u??[],e[19]=u,e[20]=N):N=e[20],g=[...N];for(const S of p)g.some(_=>_.name===S.name)||g.push(S);e[12]=s.id,e[13]=u,e[14]=x.prompts,e[15]=p,e[16]=g}else p=e[15],g=e[16];if(f&&p.length===0){let b;return e[21]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx(H,{className:"h-7 w-full"}),n.jsx(H,{className:"h-7 w-2/3"})]}),e[21]=b):b=e[21],b}if(h&&p.length===0)return console.error("[home-tiles] listPrompts failed for agent",s.id,h),null;if(g.length===0)return null;let y;e[22]!==i||e[23]!==g?(y=i??g.map(dn),e[22]=i,e[23]=g,e[24]=y):y=e[24];let j;e[25]!==y?(j=new Set(y),e[25]=y,e[26]=j):j=e[26];const w=j;let v;return e[27]!==s||e[28]!==r||e[29]!==g||e[30]!==w?(v=n.jsx("div",{className:"flex flex-col gap-0.5",children:g.map(b=>n.jsx(fn,{agent:s,home:r,prompt:b,allPromptNames:g.map(cn),isPinned:w.has(b.name)},b.name))}),e[27]=s,e[28]=r,e[29]=g,e[30]=w,e[31]=v):v=e[31],v}function cn(t){return t.name}function dn(t){return t.name}function mn(t){return{name:t.promptName,title:t.title,description:t.description}}function un(t){return{name:t.name,title:t.title,description:t.description}}function fn({agent:t,home:e,prompt:s,allPromptNames:r,isPinned:i}){const[o,l]=$.useState(!1),d=async()=>{if(!i&&!e.isOnHome(t.id)&&e.atLimit){U.error(`Home is full (${ne}) — remove an agent first`);return}l(!0);try{const a=t.metadata?.ui?.homePrompts;let m;Array.isArray(a)?m=i?a.filter(u=>u!==s.name):[...a,s.name]:m=i?r.filter(u=>u!==s.name):r;const c={...t.metadata??{},ui:{...t.metadata?.ui??{},homePrompts:m}};await e.saveAgentMetadata(t,c)}catch(a){console.error("[home-tiles] failed to toggle prompt",a),U.error("Couldn't update home — please try again.")}finally{l(!1)}};return n.jsxs("div",{className:"flex items-center gap-2.5 rounded-md px-2 py-1 hover:bg-accent/40",children:[n.jsx("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:s.title??je(s.name)}),n.jsx(we,{isPinned:i,submitting:o,onClick:d,label:i?"Remove from home":"Add to home"})]})}function hn(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"flex flex-col gap-2 p-2",children:Array.from({length:4},pn)}),t[0]=e):e=t[0],e}function pn(t,e){return n.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-border p-2.5",children:[n.jsx(H,{className:"size-8 rounded-md"}),n.jsxs("div",{className:"flex-1 space-y-1.5",children:[n.jsx(H,{className:"h-3 w-1/2"}),n.jsx(H,{className:"h-2.5 w-1/3"})]})]},e)}const ee=1,Ze=`home-board.layout.v${ee}`;function Ye(t){return`home-board.layout.v${ee}.${t}`}const et={version:ee,tiles:{},hidden:[]};function pe(t){return!t||t.version!==ee?et:{version:ee,tiles:t.tiles??{},hidden:Array.isArray(t.hidden)?t.hidden:[]}}function xn(t){return Object.keys(t.tiles).length>0||t.hidden.length>0}function gn(t){try{const e=localStorage.getItem(Ye(t));return e?pe(JSON.parse(e)):void 0}catch{return}}function Ie(t,e){try{localStorage.setItem(Ye(t),JSON.stringify(e))}catch{}}async function Te(t,e){if(!(await fetch(`/api/${t}/kv/${Ze}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok)throw new Error("Failed to save board layout")}function bn(t){const e=k.c(24),s=le();let r;e[0]!==t?(r=te.boardLayout(t),e[0]=t,e[1]=r):r=e[1];const i=r;let o;e[2]!==t?(o=gn(t),e[2]=t,e[3]=o):o=e[3];const l=o;let d;e[4]!==l||e[5]!==t?(d=async()=>{const y=await fetch(`/api/${t}/kv/${Ze}`);if(y.status===404)return l&&xn(l)?(await Te(t,l),l):et;if(!y.ok)throw new Error("Failed to load board layout");const j=await y.json(),w=pe(j.value);return Ie(t,w),w},e[4]=l,e[5]=t,e[6]=d):d=e[6];let a;e[7]!==l||e[8]!==i||e[9]!==d?(a={queryKey:i,queryFn:d,initialData:l,staleTime:0,refetchOnWindowFocus:!1},e[7]=l,e[8]=i,e[9]=d,e[10]=a):a=e[10];const{data:m,isLoading:c}=se(a);let u;e[11]!==t?(u={mutationFn:y=>Te(t,y)},e[11]=t,e[12]=u):u=e[12];const f=bt(u);let h;e[13]!==f||e[14]!==t||e[15]!==s||e[16]!==i?(h=y=>{Ie(t,y),s.setQueryData(i,y),f.mutate(y)},e[13]=f,e[14]=t,e[15]=s,e[16]=i,e[17]=h):h=e[17];const x=h;let p;e[18]!==m?(p=pe(m),e[18]=m,e[19]=p):p=e[19];let g;return e[20]!==c||e[21]!==x||e[22]!==p?(g={layout:p,isLoading:c,save:x},e[20]=c,e[21]=x,e[22]=p,e[23]=g):g=e[23],g}const tt=$.createContext(null);function yn(t){const e=k.c(24),{children:s}=t,{org:r}=J(),i=bn(r.slug),[o,l]=$.useState(!1),[d,a]=$.useState(null);let m;e[0]!==i.layout?(m=()=>{a(i.layout),l(!0)},e[0]=i.layout,e[1]=m):m=e[1];const c=m;let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=()=>{a(null),l(!1)},e[2]=u):u=e[2];const f=u;let h;e[3]!==d||e[4]!==i?(h=()=>{d&&i.save(d),a(null),l(!1)},e[3]=d,e[4]=i,e[5]=h):h=e[5];const x=h,p=o&&d!==null,g=p?d:i.layout;let y;e[6]!==d||e[7]!==p||e[8]!==i.layout?(y=p?JSON.stringify(d)!==JSON.stringify(i.layout):!1,e[6]=d,e[7]=p,e[8]=i.layout,e[9]=y):y=e[9];const j=y;let w;e[10]!==o||e[11]!==i?(w=S=>{o?a(S):i.save(S)},e[10]=o,e[11]=i,e[12]=w):w=e[12];const v=w;let b;e[13]!==v||e[14]!==c||e[15]!==j||e[16]!==o||e[17]!==g||e[18]!==x||e[19]!==i.isLoading?(b={isEditMode:o,enter:c,cancel:f,save:x,hasChanges:j,layout:g,isLayoutLoading:i.isLoading,commitLayout:v},e[13]=v,e[14]=c,e[15]=j,e[16]=o,e[17]=g,e[18]=x,e[19]=i.isLoading,e[20]=b):b=e[20];let N;return e[21]!==s||e[22]!==b?(N=n.jsx(tt.Provider,{value:b,children:s}),e[21]=s,e[22]=b,e[23]=N):N=e[23],N}function st(){const t=$.useContext(tt);if(!t)throw new Error("useHomeEdit must be used within a HomeEditProvider");return t}function vn({agentId:t}){const{org:e,locator:s}=J(),r=ce({connectionId:t,orgId:e.id,orgSlug:e.slug}),{create:i}=vs(),{setTaskId:o}=Zt(),[l,d]=$.useState(null),[a,m]=$.useState(!1),c=$.useRef(!1),u=async(g,y)=>{if(!r){U.error("MCP client not available");return}if(!c.current){c.current=!0,m(!0);try{const j=await ys(r,g.name,y),w={type:"doc",content:[{type:"paragraph",content:[ss({id:g.name,name:ns(g.name,is(g._meta)),metadata:j.messages,char:"/",kind:"prompt",args:y}),{type:"text",text:" "}]}]},v=crypto.randomUUID();js(sessionStorage,s,v,{tiptapDoc:w}),await i({id:v,virtual_mcp_id:t}),o(v,t,{autosend:!0})}catch(j){console.error("[start-thread-from-prompt] failed",j),U.error("Failed to start thread. Please try again.")}finally{c.current=!1,m(!1)}}},f=async g=>{if(!c.current){if(g.arguments&&g.arguments.length>0){d(g);return}await u(g)}},h=async g=>{if(!l)return;const y=l;d(null),await u(y,g)};return{start:f,startBlank:async g=>{if(!c.current){c.current=!0,m(!0);try{const y=crypto.randomUUID();await i({id:y,virtual_mcp_id:t}),o(y,t,g?.main?{main:g.main}:void 0)}catch(y){console.error("[start-thread-from-prompt] startBlank failed",y),U.error("Failed to start thread. Please try again.")}finally{c.current=!1,m(!1)}}},dialog:n.jsx(ts,{prompt:l,setPrompt:g=>d(g),onSubmit:h}),dialogPrompt:l,starting:a}}const V=4,W=100,ke=12,jn=5,wn={w:2,h:2};class xe extends $.Component{state={hasError:!1};static getDerivedStateFromError(e){return{hasError:!0,message:e instanceof Error?e.message:"Unknown error"}}componentDidCatch(e,s){console.error("[home-tiles] tile crashed:",e,s.componentStack)}render(){return this.state.hasError?n.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2 p-4 text-center",children:[n.jsx("span",{className:"flex size-8 items-center justify-center rounded-md bg-destructive/10 text-destructive",children:n.jsx(yt,{size:16})}),n.jsx("p",{className:"text-sm font-medium text-foreground",children:"This tile crashed"}),n.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:this.state.message??"Something went wrong rendering this tile."})]}):this.props.children}}function Nn(t){const e=k.c(72),{tiles:s,isEditMode:r,renderTile:i,onMove:o,onResize:l,onRemove:d}=t,a=be(),m=$.useRef(null),[c,u]=$.useState(null),[f,h]=$.useState(null);let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x={activationConstraint:{distance:4}},e[0]=x):x=e[0];const p=Me(oe(Re,x),oe(ze)),g=s.reduce(Sn,0),y=r?Math.max(g+2,4):Math.max(g,1);let j;e[1]===Symbol.for("react.memo_cache_sentinel")?(j=()=>{const A=m.current?.getBoundingClientRect();return A?{cellWidth:A.width/V,cellHeight:W}:null},e[1]=j):j=e[1];const w=j;let v;e[2]===Symbol.for("react.memo_cache_sentinel")?(v=A=>{u(String(A.active.id)),h(w())},e[2]=v):v=e[2];const b=v;let N;e[3]!==f||e[4]!==o||e[5]!==s?(N=A=>{const B=String(A.active.id),L=f??w();if(u(null),h(null),!L||L.cellWidth<=0)return;const O=s.find(K=>K.id===B);if(!O)return;const D=Math.round(A.delta.x/L.cellWidth),F=Math.round(A.delta.y/L.cellHeight);D===0&&F===0||o(B,{x:O.x+D,y:O.y+F})},e[3]=f,e[4]=o,e[5]=s,e[6]=N):N=e[6];const S=N;if(a){let A;if(e[7]!==i||e[8]!==s){let L;e[10]!==i?(L=O=>n.jsx("div",{className:"group bg-card card-shadow rounded-2xl overflow-hidden",style:{minHeight:W},children:n.jsx(xe,{children:i(O)})},O.id),e[10]=i,e[11]=L):L=e[11],A=s.map(L),e[7]=i,e[8]=s,e[9]=A}else A=e[9];let B;return e[12]!==A?(B=n.jsx("div",{className:"flex flex-col gap-3 px-4 pb-8",children:A}),e[12]=A,e[13]=B):B=e[13],B}let _,C,I,T,E,P,M,Q,z;if(e[14]!==c||e[15]!==f||e[16]!==r||e[17]!==S||e[18]!==d||e[19]!==l||e[20]!==i||e[21]!==p||e[22]!==s||e[23]!==y){const A=c?s.find(X=>X.id===c):null;C=Le,Q=p,z=b,I=S;const B=y*W,L=r?W*4:W;let O;e[33]!==B||e[34]!==L?(O={height:B,minHeight:L},e[33]=B,e[34]=L,e[35]=O):O=e[35];let D;e[36]!==r||e[37]!==s||e[38]!==y?(D=r&&n.jsx(Cn,{rows:y,tiles:s}),e[36]=r,e[37]=s,e[38]=y,e[39]=D):D=e[39];let F;if(e[40]!==c||e[41]!==r||e[42]!==d||e[43]!==l||e[44]!==i||e[45]!==s){let X;e[47]!==c||e[48]!==r||e[49]!==d||e[50]!==l||e[51]!==i?(X=ie=>n.jsx(In,{tile:ie,isEditMode:r,isDragging:c===ie.id,onResize:l,onRemove:d,children:i(ie)},ie.id),e[47]=c,e[48]=r,e[49]=d,e[50]=l,e[51]=i,e[52]=X):X=e[52],F=s.map(X),e[40]=c,e[41]=r,e[42]=d,e[43]=l,e[44]=i,e[45]=s,e[46]=F}else F=e[46];e[53]!==O||e[54]!==D||e[55]!==F?(T=n.jsxs("div",{ref:m,className:"relative w-full",style:O,children:[D,F]}),e[53]=O,e[54]=D,e[55]=F,e[56]=T):T=e[56],_=Vt,E=null;const K=A&&f?A.w*f.cellWidth-ke:void 0,me=A&&f?A.h*f.cellHeight-ke:void 0;e[57]!==K||e[58]!==me?(P={width:K,height:me},e[57]=K,e[58]=me,e[59]=P):P=e[59],M=A&&n.jsx("div",{className:"bg-card card-shadow rounded-2xl shadow-2xl ring-2 ring-primary/40 h-full overflow-hidden opacity-95",children:n.jsx(xe,{children:i(A)})}),e[14]=c,e[15]=f,e[16]=r,e[17]=S,e[18]=d,e[19]=l,e[20]=i,e[21]=p,e[22]=s,e[23]=y,e[24]=_,e[25]=C,e[26]=I,e[27]=T,e[28]=E,e[29]=P,e[30]=M,e[31]=Q,e[32]=z}else _=e[24],C=e[25],I=e[26],T=e[27],E=e[28],P=e[29],M=e[30],Q=e[31],z=e[32];let R;e[60]!==_||e[61]!==E||e[62]!==P||e[63]!==M?(R=n.jsx(_,{dropAnimation:E,style:P,children:M}),e[60]=_,e[61]=E,e[62]=P,e[63]=M,e[64]=R):R=e[64];let q;return e[65]!==C||e[66]!==I||e[67]!==T||e[68]!==R||e[69]!==Q||e[70]!==z?(q=n.jsxs(C,{sensors:Q,onDragStart:z,onDragEnd:I,children:[T,R]}),e[65]=C,e[66]=I,e[67]=T,e[68]=R,e[69]=Q,e[70]=z,e[71]=q):q=e[71],q}function Sn(t,e){return Math.max(t,e.y+e.h)}function Cn(t){const e=k.c(7),{rows:s,tiles:r}=t;let i;e[0]!==r?(i=(a,m)=>r.some(c=>a>=c.x&&a<c.x+c.w&&m>=c.y&&m<c.y+c.h),e[0]=r,e[1]=i):i=e[1];const o=i;let l;if(e[2]!==o||e[3]!==s){l=[];for(let a=0;a<s;a++)for(let m=0;m<V;m++)o(m,a)||l.push({x:m,y:a});e[2]=o,e[3]=s,e[4]=l}else l=e[4];let d;return e[5]!==l?(d=n.jsx("div",{className:"absolute inset-0 pointer-events-none",children:l.map(_n)}),e[5]=l,e[6]=d):d=e[6],d}function _n(t){return n.jsx("div",{className:"absolute p-1",style:{left:`${t.x/V*100}%`,top:t.y*W,width:`${1/V*100}%`,height:W},children:n.jsx("div",{className:"h-full w-full rounded-2xl border border-dashed border-border/60"})},`${t.x}-${t.y}`)}function In(t){const e=k.c(31),{tile:s,isEditMode:r,isDragging:i,onResize:o,onRemove:l,children:d}=t,a=!r;let m;e[0]!==a||e[1]!==s.id?(m={id:s.id,disabled:a},e[0]=a,e[1]=s.id,e[2]=m):m=e[2];const{setNodeRef:c,attributes:u,listeners:f,isDragging:h}=Kt(m),x=`${s.x/V*100}%`,p=`${s.w/V*100}%`,g=s.y*W,y=s.h*W,j=h||i,w=!j&&"transition-[left,top,width,height,opacity] duration-200 ease-out",v=j&&"opacity-30";let b;e[3]!==w||e[4]!==v?(b=G("absolute p-1 will-change-[left,top,width,height,opacity]",w,v),e[3]=w,e[4]=v,e[5]=b):b=e[5];let N;e[6]!==y||e[7]!==x||e[8]!==g||e[9]!==p?(N={left:x,top:g,width:p,height:y},e[6]=y,e[7]=x,e[8]=g,e[9]=p,e[10]=N):N=e[10];const S=r&&"outline outline-1 outline-transparent hover:outline-primary/40";let _;e[11]!==S?(_=G("group relative h-full bg-card card-shadow rounded-2xl overflow-hidden",S),e[11]=S,e[12]=_):_=e[12];let C;e[13]!==u||e[14]!==r||e[15]!==f||e[16]!==l||e[17]!==o||e[18]!==s?(C=r&&n.jsxs(n.Fragment,{children:[n.jsx("button",{type:"button",...u,...f,className:"absolute top-2 left-2 z-10 flex size-8 items-center justify-center rounded-md bg-background/90 border border-border text-muted-foreground hover:text-foreground hover:bg-muted cursor-grab active:cursor-grabbing","aria-label":"Drag tile",children:n.jsx(Qe,{size:16})}),n.jsx("div",{className:"absolute top-2 right-2 z-10 flex items-center gap-1",children:n.jsx(Tn,{tile:s,onResize:o,onRemove:l})})]}),e[13]=u,e[14]=r,e[15]=f,e[16]=l,e[17]=o,e[18]=s,e[19]=C):C=e[19];let I;e[20]!==d?(I=n.jsx("div",{className:"h-full overflow-hidden",children:n.jsx(xe,{children:d})}),e[20]=d,e[21]=I):I=e[21];let T;e[22]!==I||e[23]!==_||e[24]!==C?(T=n.jsxs("div",{className:_,children:[C,I]}),e[22]=I,e[23]=_,e[24]=C,e[25]=T):T=e[25];let E;return e[26]!==c||e[27]!==T||e[28]!==b||e[29]!==N?(E=n.jsx("div",{ref:c,className:b,style:N,children:T}),e[26]=c,e[27]=T,e[28]=b,e[29]=N,e[30]=E):E=e[30],E}function Tn(t){const e=k.c(20),{tile:s,onResize:r,onRemove:i}=t,[o,l]=$.useState(!1);let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(ws,{asChild:!0,children:n.jsx("button",{type:"button",className:"flex size-8 items-center justify-center rounded-md bg-background/90 border border-border text-muted-foreground hover:text-foreground hover:bg-muted","aria-label":"Tile options",children:n.jsx(Pt,{size:16})})}),e[0]=d):d=e[0];let a;e[1]!==r||e[2]!==s.id?(a=g=>{r(s.id,g),l(!1)},e[1]=r,e[2]=s.id,e[3]=a):a=e[3];let m;e[4]!==a||e[5]!==s?(m=n.jsx(kn,{tile:s,onPick:a}),e[4]=a,e[5]=s,e[6]=m):m=e[6];let c;e[7]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(Ns,{}),e[7]=c):c=e[7];let u;e[8]!==i||e[9]!==s.id?(u=()=>i(s.id),e[8]=i,e[9]=s.id,e[10]=u):u=e[10];let f;e[11]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(Is,{size:14,className:"mr-2"}),e[11]=f):f=e[11];let h;e[12]!==u?(h=n.jsxs(Ss,{onSelect:u,className:"text-destructive focus:text-destructive",children:[f,"Remove tile"]}),e[12]=u,e[13]=h):h=e[13];let x;e[14]!==m||e[15]!==h?(x=n.jsxs(Cs,{align:"end",className:"w-auto",children:[m,c,h]}),e[14]=m,e[15]=h,e[16]=x):x=e[16];let p;return e[17]!==o||e[18]!==x?(p=n.jsxs(_s,{open:o,onOpenChange:l,children:[d,x]}),e[17]=o,e[18]=x,e[19]=p):p=e[19],p}function kn(t){const e=k.c(19),{tile:s,onPick:r}=t,i=s.minW??1,o=s.minH??1,[l,d]=$.useState(null);let a;e[0]!==l||e[1]!==s.h||e[2]!==s.w?(a=l??{w:s.w,h:s.h},e[0]=l,e[1]=s.h,e[2]=s.w,e[3]=a):a=e[3];const m=a;let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx("span",{className:"text-xs text-muted-foreground",children:"Size"}),e[4]=c):c=e[4];let u;e[5]!==m.h||e[6]!==m.w?(u=n.jsxs("div",{className:"mb-2 flex items-center justify-between gap-4",children:[c,n.jsxs("span",{className:"text-xs font-medium tabular-nums",children:[m.w," × ",m.h]})]}),e[5]=m.h,e[6]=m.w,e[7]=u):u=e[7];let f,h;e[8]===Symbol.for("react.memo_cache_sentinel")?(f={gridTemplateColumns:`repeat(${V}, 1.25rem)`},h=()=>d(null),e[8]=f,e[9]=h):(f=e[8],h=e[9]);let x;e[10]!==m.h||e[11]!==m.w||e[12]!==o||e[13]!==i||e[14]!==r?(x=n.jsx("div",{className:"grid w-max gap-1",style:f,onPointerLeave:h,children:Array.from({length:jn},(g,y)=>Array.from({length:V},(j,w)=>{const v=w+1,b=y+1,N=v<i||b<o,S=v<=m.w&&b<=m.h;return n.jsx("button",{type:"button",disabled:N,"aria-label":`${v} by ${b}`,onPointerEnter:()=>d({w:v,h:b}),onClick:()=>r({w:v,h:b}),className:G("size-5 rounded-sm border transition-colors",S?"border-primary bg-primary/30":"border-border bg-muted",N?"cursor-not-allowed opacity-40":"cursor-pointer hover:border-primary/60")},`${v}x${b}`)}))}),e[10]=m.h,e[11]=m.w,e[12]=o,e[13]=i,e[14]=r,e[15]=x):x=e[15];let p;return e[16]!==u||e[17]!==x?(p=n.jsxs("div",{className:"px-2 py-1.5",children:[u,x]}),e[16]=u,e[17]=x,e[18]=p):p=e[18],p}function $n(t,e,s){return t.some(r=>e>=r.x&&e<r.x+r.w&&s>=r.y&&s<r.y+r.h)}function ge(t,e,s){for(let r=0;r<100;r++)for(let i=0;i<=V-e;i++){let o=!0;for(let l=0;l<s&&o;l++)for(let d=0;d<e&&o;d++)$n(t,i+d,r+l)&&(o=!1);if(o)return{x:i,y:r}}return{x:0,y:0}}function ue(t,e,s={w:1,h:1}){const r=Math.max(s.w,Math.min(V,t)),i=Math.max(s.h,Math.min(6,e));return{w:r,h:i}}function fe(t,e,s){const r=Math.max(0,Math.min(V-s,t)),i=Math.max(0,e);return{x:r,y:i}}function An(t,e,s){const r=t.find(a=>a.id===e);if(!r)return t;const i=t.filter(a=>a.id!==e),o=i.find(a=>s.x>=a.x&&s.x<a.x+a.w&&s.y>=a.y&&s.y<a.y+a.h);if(o&&o.w===r.w&&o.h===r.h)return t.map(a=>a.id===e?{...a,x:o.x,y:o.y}:a.id===o.id?{...a,x:r.x,y:r.y}:a);const d=[{...r,x:s.x,y:s.y}];for(const a of i){const m=ge(d,a.w,a.h);d.push({...a,x:m.x,y:m.y})}return d}function En(t){const e=k.c(35),{layout:s,isLayoutLoading:r,commitLayout:i}=st();let o;e[0]!==s.hidden?(o=new Set(s.hidden),e[0]=s.hidden,e[1]=o):o=e[1];const l=o;let d,a;if(e[2]!==t||e[3]!==l||e[4]!==s.tiles){a=[];let j;e[7]!==l?(j=v=>v.pinned||!l.has(v.id),e[7]=l,e[8]=j):j=e[8];const w=t.filter(j);d=new Map;for(const v of t)v.minSize&&d.set(v.id,v.minSize);for(const v of w){const b=s.tiles[v.id];if(!b)continue;const N=d.get(v.id),{w:S,h:_}=ue(b.w,b.h,N),{x:C,y:I}=fe(b.x,b.y,S);a.push({id:v.id,x:C,y:I,w:S,h:_,minW:N?.w,minH:N?.h})}for(const v of w){if(a.some(I=>I.id===v.id))continue;const b=v.defaultSize??wn,N=d.get(v.id),{w:S,h:_}=ue(b.w,b.h,N),C=ge(a,S,_);a.push({id:v.id,x:C.x,y:C.y,w:S,h:_,minW:N?.w,minH:N?.h})}e[2]=t,e[3]=l,e[4]=s.tiles,e[5]=d,e[6]=a}else d=e[5],a=e[6];let m;e[9]!==t?(m=new Set(t.map(On)),e[9]=t,e[10]=m):m=e[10];const c=m;let u;e[11]!==c||e[12]!==i?(u=(j,w)=>{const v={};for(const b of j)v[b.id]={x:b.x,y:b.y,w:b.w,h:b.h};i({version:ee,tiles:v,hidden:w.filter(b=>c.has(b))})},e[11]=c,e[12]=i,e[13]=u):u=e[13];const f=u;let h;e[14]!==a?(h={visible:a},e[14]=a,e[15]=h):h=e[15];let x;e[16]!==f||e[17]!==s||e[18]!==a?(x=(j,w)=>{const v=a.find(S=>S.id===j);if(!v)return;const b=fe(w.x,w.y,v.w);if(b.x===v.x&&b.y===v.y)return;const N=An(a,j,b);f(N,s.hidden)},e[16]=f,e[17]=s,e[18]=a,e[19]=x):x=e[19];let p;e[20]!==f||e[21]!==s||e[22]!==d||e[23]!==a?(p=(j,w)=>{const v=a.find(T=>T.id===j);if(!v)return;const b=d.get(j),{w:N,h:S}=ue(w.w,w.h,b);if(N===v.w&&S===v.h)return;const _={...v,w:N,h:S,x:fe(v.x,v.y,N).x},C=a.filter(T=>T.id!==j),I=[_];for(const T of C){const E=ge(I,T.w,T.h);I.push({...T,x:E.x,y:E.y})}f(I,s.hidden)},e[20]=f,e[21]=s,e[22]=d,e[23]=a,e[24]=p):p=e[24];let g;e[25]!==f||e[26]!==s||e[27]!==a?(g=j=>{const w=a.filter(v=>v.id!==j);f(w,Array.from(new Set([...s.hidden,j])))},e[25]=f,e[26]=s,e[27]=a,e[28]=g):g=e[28];let y;return e[29]!==r||e[30]!==h||e[31]!==x||e[32]!==p||e[33]!==g?(y={snapshot:h,isLoading:r,moveTile:x,resizeTile:p,hideTile:g},e[29]=r,e[30]=h,e[31]=x,e[32]=p,e[33]=g,e[34]=y):y=e[34],y}function On(t){return t.id}const Pn={w:2,h:4},Mn={w:1,h:2},zn={w:1,h:1};function Rn(t){return`prompt:${t.agentId}:${t.promptName||"blank"}`}function Ln(t){return t.tileId?`tile:${t.tileId}`:`tile:${t.agentId}:${t.resourceUri}`}function Hn(t){return t.promptName?t.agentName:t.description}function Dn(t){return{name:t.promptName,title:t.title,description:t.description,arguments:t.arguments,_meta:t._meta}}function nt(t){const e=k.c(14),{org:s}=J();let r;e[0]!==s.id||e[1]!==s.slug||e[2]!==t.connectionId?(r=Nt({connectionId:t.connectionId,orgId:s.id,orgSlug:s.slug}),e[0]=s.id,e[1]=s.slug,e[2]=t.connectionId,e[3]=r):r=e[3];const{data:i}=se(r),o=!!i&&!t.toolName;let l;e[4]!==i||e[5]!==o?(l={client:i,enabled:o},e[4]=i,e[5]=o,e[6]=l):l=e[6];const{data:d}=xs(l);let a;e[7]!==t.resourceUri||e[8]!==t.toolName||e[9]!==d?.tools?(a=t.toolName??d?.tools.find(u=>Be(u._meta)===t.resourceUri)?.name,e[7]=t.resourceUri,e[8]=t.toolName,e[9]=d?.tools,e[10]=a):a=e[10];const m=a;let c;return e[11]!==t.connectionId||e[12]!==m?(c=m?bs(t.connectionId,m):void 0,e[11]=t.connectionId,e[12]=m,e[13]=c):c=e[13],c}function Ne(t){const e=k.c(10);let s;e[0]!==t?(s={agentId:t},e[0]=t,e[1]=s):s=e[1];const{start:r,startBlank:i,dialog:o,starting:l}=vn(s);let d;e[2]!==r||e[3]!==i?(d=c=>{if(!c.promptName){i();return}r(Dn(c))},e[2]=r,e[3]=i,e[4]=d):d=e[4];const a=d;let m;return e[5]!==o||e[6]!==a||e[7]!==i||e[8]!==l?(m={open:a,startBlank:i,dialog:o,starting:l},e[5]=o,e[6]=a,e[7]=i,e[8]=l,e[9]=m):m=e[9],m}function Fn(t){const e=k.c(32),{entry:s,isEditMode:r}=t,{open:i,dialog:o,starting:l}=Ne(s.agentId);let d;e[0]!==s||e[1]!==i?(d=()=>i(s),e[0]=s,e[1]=i,e[2]=d):d=e[2];const a=l||r,m=!r&&"cursor-pointer transition-colors hover:bg-accent/40",c=r&&"cursor-default pl-12",u=l&&"opacity-60";let f;e[3]!==m||e[4]!==c||e[5]!==u?(f=G("group/tile relative flex h-full w-full items-center gap-3 px-4 py-3 text-left bg-card",m,c,u),e[3]=m,e[4]=c,e[5]=u,e[6]=f):f=e[6];let h;e[7]!==s.agentIcon||e[8]!==s.agentName?(h=n.jsx(de,{icon:s.agentIcon,name:s.agentName,size:"sm+"}),e[7]=s.agentIcon,e[8]=s.agentName,e[9]=h):h=e[9];let x;e[10]!==s.title?(x=n.jsx("div",{className:"line-clamp-2 text-sm font-medium text-foreground leading-snug",children:s.title}),e[10]=s.title,e[11]=x):x=e[11];let p;e[12]!==s?(p=Hn(s),e[12]=s,e[13]=p):p=e[13];let g;e[14]!==p?(g=n.jsx("div",{className:"truncate text-xs text-muted-foreground mt-0.5",children:p}),e[14]=p,e[15]=g):g=e[15];let y;e[16]!==g||e[17]!==x?(y=n.jsxs("div",{className:"min-w-0 flex-1",children:[x,g]}),e[16]=g,e[17]=x,e[18]=y):y=e[18];let j;e[19]!==r?(j=!r&&n.jsx(gs,{size:16,className:"shrink-0 text-muted-foreground opacity-0 -translate-x-1 transition-all duration-200 group-hover/tile:opacity-100 group-hover/tile:translate-x-0","aria-hidden":!0}),e[19]=r,e[20]=j):j=e[20];let w;e[21]!==l||e[22]!==d||e[23]!==y||e[24]!==j||e[25]!==a||e[26]!==f||e[27]!==h?(w=n.jsxs("button",{type:"button",onClick:d,disabled:a,"aria-busy":l,className:f,children:[h,y,j]}),e[21]=l,e[22]=d,e[23]=y,e[24]=j,e[25]=a,e[26]=f,e[27]=h,e[28]=w):w=e[28];let v;return e[29]!==o||e[30]!==w?(v=n.jsxs(n.Fragment,{children:[w,o]}),e[29]=o,e[30]=w,e[31]=v):v=e[31],v}function Un(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"mt-4 grid w-full grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",children:Array.from({length:3},Qn)}),t[0]=e):e=t[0],e}function Qn(t,e){return n.jsxs("div",{className:"flex w-full items-center gap-3 rounded-2xl bg-card card-shadow px-3 py-2.5",children:[n.jsx(H,{className:"size-10 rounded-xl"}),n.jsxs("div",{className:"flex-1 space-y-1.5",children:[n.jsx(H,{className:"h-3 w-2/3"}),n.jsx(H,{className:"h-2.5 w-1/3"})]})]},`chip-skeleton-${e}`)}function Bn(t){const e=k.c(17),{tile:s,prompts:r,isEditMode:i,tileWidth:o}=t,{org:l}=J(),{open:d,startBlank:a,dialog:m,starting:c}=Ne(s.agentId),u=r.filter(qn),f=nt(s),h="relative flex h-full w-full flex-col p-3";let x;e[0]!==i||e[1]!==f||e[2]!==a||e[3]!==c?(x=!i&&n.jsx("button",{type:"button",onClick:()=>{a(f?{main:f}:void 0)},disabled:c,"aria-busy":c,className:"mb-1 self-start rounded-md px-2 py-1 text-[10px] text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:"Open chat"}),e[0]=i,e[1]=f,e[2]=a,e[3]=c,e[4]=x):x=e[4];const p="flex min-h-0 flex-1 gap-3 overflow-hidden";let g;e[5]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(Kn,{}),e[5]=g):g=e[5];let y;e[6]!==l.id||e[7]!==l.slug||e[8]!==s?(y=n.jsx("div",{className:"min-h-0 flex-1 overflow-hidden rounded-lg border border-border",children:n.jsx($.Suspense,{fallback:g,children:n.jsx(Vn,{tile:s,orgId:l.id,orgSlug:l.slug})})}),e[6]=l.id,e[7]=l.slug,e[8]=s,e[9]=y):y=e[9];const j=u.length>0&&!i&&o>=2&&n.jsx("div",{className:"flex w-44 shrink-0 flex-col gap-2 overflow-hidden",children:u.map(b=>n.jsx("button",{type:"button",onClick:()=>d(b),disabled:c,className:"shrink-0 rounded-lg border border-border bg-background px-2.5 py-2 text-left text-xs leading-snug text-foreground transition-colors hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:n.jsx("span",{className:"line-clamp-2",children:b.title})},b.promptName))});let w;e[10]!==y||e[11]!==j?(w=n.jsxs("div",{className:p,children:[y,j]}),e[10]=y,e[11]=j,e[12]=w):w=e[12];let v;return e[13]!==m||e[14]!==x||e[15]!==w?(v=n.jsxs("div",{className:h,children:[x,w,m]}),e[13]=m,e[14]=x,e[15]=w,e[16]=v):v=e[16],v}function qn(t){return!!t.promptName}function Vn(t){const e=k.c(13),{tile:s,orgId:r,orgSlug:i}=t;let o;e[0]!==r||e[1]!==i||e[2]!==s.connectionId?(o={connectionId:s.connectionId,orgId:r,orgSlug:i},e[0]=r,e[1]=i,e[2]=s.connectionId,e[3]=o):o=e[3];const l=ce(o),d=s.minHeight??200,a=s.maxHeight??4e3;let m;return e[4]!==l||e[5]!==r||e[6]!==i||e[7]!==d||e[8]!==a||e[9]!==s.connectionId||e[10]!==s.resourceUri||e[11]!==s.toolInput?(m=n.jsx(ds,{resourceURI:s.resourceUri,orgId:r,orgSlug:i,connectionId:s.connectionId,client:l,toolInput:s.toolInput,displayMode:"fullscreen",minHeight:d,maxHeight:a,className:"h-full"}),e[4]=l,e[5]=r,e[6]=i,e[7]=d,e[8]=a,e[9]=s.connectionId,e[10]=s.resourceUri,e[11]=s.toolInput,e[12]=m):m=e[12],m}function Kn(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsxs("div",{className:"flex h-full w-full flex-col gap-2 p-4",children:[n.jsx(H,{className:"h-3 w-2/3"}),n.jsx(H,{className:"h-3 w-1/2"}),n.jsx(H,{className:"mt-1 h-full w-full rounded-md"})]}),t[0]=e):e=t[0],e}function Wn(t){const e=k.c(14),{icon:s,name:r}=t;let i;e[0]!==s||e[1]!==r?(i=n.jsx(de,{icon:s,name:r,size:"sm+"}),e[0]=s,e[1]=r,e[2]=i):i=e[2];let o;e[3]!==r?(o=n.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:r}),e[3]=r,e[4]=o):o=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx("div",{className:"truncate text-xs text-muted-foreground",children:"Loading tile…"}),e[5]=l):l=e[5];let d;e[6]!==o?(d=n.jsxs("div",{className:"min-w-0 flex-1",children:[o,l]}),e[6]=o,e[7]=d):d=e[7];let a;e[8]!==i||e[9]!==d?(a=n.jsxs("div",{className:"flex items-center gap-2.5",children:[i,d]}),e[8]=i,e[9]=d,e[10]=a):a=e[10];let m;e[11]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsxs("div",{className:"flex flex-1 flex-col gap-2 pt-1",children:[n.jsx(H,{className:"h-3 w-3/4"}),n.jsx(H,{className:"h-3 w-1/2"}),n.jsx(H,{className:"h-3 w-2/3"})]}),e[11]=m):m=e[11];let c;return e[12]!==a?(c=n.jsxs("div",{className:"flex h-full w-full flex-col gap-3 p-5 opacity-60",children:[a,m]}),e[12]=a,e[13]=c):c=e[13],c}function Gn(t){const e=k.c(10),{tile:s,prompts:r,isEditMode:i}=t,{open:o,startBlank:l,dialog:d,starting:a}=Ne(s.agentId),m=r.filter(Jn),c=nt(s),u="flex h-full w-full flex-col gap-3 p-4";let f;e[0]!==c||e[1]!==l?(f=()=>{l(c?{main:c}:void 0)},e[0]=c,e[1]=l,e[2]=f):f=e[2];const h=a||i;let x;e[3]!==f||e[4]!==h?(x=n.jsx("button",{type:"button",onClick:f,disabled:h,className:"mb-1 self-start rounded-md px-2 py-1 text-[10px] text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:"Open chat"}),e[3]=f,e[4]=h,e[5]=x):x=e[5];const p=m.length>0&&!i&&n.jsx("div",{className:"grid grid-cols-1 gap-2 overflow-hidden sm:grid-cols-2",children:m.map(y=>n.jsx("button",{type:"button",onClick:()=>!i&&o(y),disabled:a,className:"rounded-lg border border-border bg-background px-2.5 py-2 text-left text-xs leading-snug text-foreground transition-colors hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:n.jsx("span",{className:"line-clamp-2",children:y.title})},y.promptName))});let g;return e[6]!==d||e[7]!==x||e[8]!==p?(g=n.jsxs("div",{className:u,children:[x,p,d]}),e[6]=d,e[7]=x,e[8]=p,e[9]=g):g=e[9],g}function Jn(t){return!!t.promptName}function it({isEditMode:t}){const{org:e}=J(),{isLoading:s,prompts:r,tiles:i}=ve(e.slug),o=He()?.ids??[],l=new Set(o),d=De(),a=Ve(),m=le(),c=new Set(i.map(b=>b.agentId)),u=new Map;for(const b of r){const N=u.get(b.agentId);N?N.push(b):u.set(b.agentId,[b])}const f=r.filter(b=>!c.has(b.agentId)),h=[...i.map(b=>({kind:"tile",id:Ln(b),data:b})),...f.map(b=>({kind:"prompt",id:Rn(b),data:b}))],x=new Map(h.map(b=>[b.id,b])),p=En(h.map(b=>({id:b.id,defaultSize:b.kind==="tile"?Pn:zn,minSize:b.kind==="tile"?Mn:void 0,pinned:l.has(b.data.agentId)}))),g=b=>{d.apply(N=>N.filter(S=>S!==b)).catch(()=>U.error("Couldn't remove from home — please try again."))},y=async b=>{if(i.filter(S=>S.agentId===b.agentId).length<=1){g(b.agentId);return}try{const _=(await a.call("COLLECTION_VIRTUAL_MCP_GET",{id:b.agentId})).item;if(!_)throw new Error("Agent not found");const C=Z(_.metadata?.ui),I=b.tileId?C.filter(T=>T.tileId!==b.tileId):C.filter(T=>T.connectionId!==b.connectionId||T.resourceUri!==b.resourceUri);await a.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:b.agentId,data:{metadata:{..._.metadata??{},ui:{..._.metadata?.ui??{},homeTile:null,homeTiles:I}}}}),m.invalidateQueries({queryKey:te.homeNextActions(e.slug)})}catch{U.error("Couldn't remove tile — please try again.")}},j=b=>{const N=x.get(b);if(N){if(!l.has(N.data.agentId)){p.hideTile(b);return}N.kind==="tile"?y(N.data):g(N.data.agentId)}},w=b=>{const N=x.get(b.id);if(!N)return null;if(N.kind==="tile"){const S=u.get(N.data.agentId)??[];return n.jsx(vt,{fallback:n.jsx(Gn,{tile:N.data,prompts:S,isEditMode:t}),children:n.jsx($.Suspense,{fallback:n.jsx(Wn,{icon:N.data.agentIcon,name:N.data.agentName}),children:n.jsx(Bn,{tile:N.data,prompts:S,isEditMode:t,tileWidth:b.w})})})}return n.jsx(Fn,{entry:N.data,isEditMode:t})};return s||p.isLoading?n.jsx(Un,{}):p.snapshot.visible.length===0&&!t?null:n.jsx("div",{className:"mt-4 flex w-full max-w-7xl flex-col gap-4",children:n.jsx(Nn,{tiles:p.snapshot.visible,isEditMode:t,renderTile:w,onMove:p.moveTile,onResize:p.resizeTile,onRemove:j})})}function Xn(t){const e=k.c(2),{prompts:s,tiles:r}=ve(t),i=r.length>0||s.length>0;let o;return e[0]!==i?(o={hasVisibleTiles:i},e[0]=i,e[1]=o):o=e[1],o}const $e=420,Ae=305;function rt(){const t=k.c(4);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("img",{src:"/home/bg-top-left.svg",alt:"",className:"absolute top-0 left-0 h-auto select-none opacity-80 dark:hidden",style:{width:$e}}),t[0]=e):e=t[0];let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx("img",{src:"/home/bg-top-left-dark.svg",alt:"",className:"absolute top-0 left-0 hidden h-auto select-none opacity-80 dark:block",style:{width:$e}}),t[1]=s):s=t[1];let r;t[2]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx("img",{src:"/home/bg-bottom-right.svg",alt:"",className:"absolute bottom-0 right-0 h-auto select-none opacity-80 dark:hidden",style:{width:Ae}}),t[2]=r):r=t[2];let i;return t[3]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsxs("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 overflow-hidden",children:[e,s,r,n.jsx("img",{src:"/home/bg-bottom-right-dark.svg",alt:"",className:"absolute bottom-0 right-0 hidden h-auto select-none opacity-80 dark:block",style:{width:Ae}})]}),t[3]=i):i=t[3],i}function Ee(){const t=k.c(33),{data:e}=jt.useSession(),{org:s}=J(),r=be(),i=$s(),{selectedVirtualMcp:o}=zt();let l;t[0]!==s.id?(l=St(s.id),t[0]=s.id,t[1]=l):l=t[1];const a=o??l;let m;t[2]!==s.slug?(m=Yt(s.slug),t[2]=s.slug,t[3]=m):m=t[3],se(m);let c;t[4]!==s.id||t[5]!==s.slug?(c={connectionId:Ct,orgId:s.id,orgSlug:s.slug},t[4]=s.id,t[5]=s.slug,t[6]=c):c=t[6];const u=ce(c);let f;t[7]!==s.id||t[8]!==s.slug?(f=Ts(s.slug,s.id),t[7]=s.id,t[8]=s.slug,t[9]=f):f=t[9];let h;t[10]!==s.id||t[11]!==s.slug?(h=Xt(s.slug,s.id),t[10]=s.id,t[11]=s.slug,t[12]=h):h=t[12];let x;t[13]!==a.id||t[14]!==s.id||t[15]!==u?(x=Tt(s.id,a.id,u),t[13]=a.id,t[14]=s.id,t[15]=u,t[16]=x):x=t[16];let p;t[17]!==f||t[18]!==h||t[19]!==x?(p={queries:[f,h,x]},t[17]=f,t[18]=h,t[19]=x,t[20]=p):p=t[20],Ms(p);const g=ks(),y=kt(a.id),{hasDecoKey:j,isZeroBalance:w,isInitialFreeCredit:v,balanceDollars:b,hasOnlyDecoProvider:N}=Wt(),{hasVisibleTiles:S}=Xn(s.slug),_=Gt(y?.metadata);if(g.length===0&&!(_&&Jt(i))){let R;return t[21]===Symbol.for("react.memo_cache_sentinel")?(R=n.jsx("div",{className:"flex-1 overflow-y-auto",children:n.jsx("div",{className:"min-h-full flex items-center justify-center px-4 py-10",children:n.jsx(Rt,{})})}),t[21]=R):R=t[21],R}let I;t[22]!==e?.user?.name?(I=e?.user?.name?.split(" ")[0]||"there",t[22]=e?.user?.name,t[23]=I):I=t[23];const T=I,E=j&&v&&b!=null,P=j&&w&&N;let M;t[24]!==b||t[25]!==E||t[26]!==P?(M=E?n.jsx(re.CreditsEyebrow,{balanceDollars:b}):P?n.jsx(re.NoCreditsEyebrow,{}):null,t[24]=b,t[25]=E,t[26]=P,t[27]=M):M=t[27];const Q=M;let z;return t[28]!==Q||t[29]!==S||t[30]!==r||t[31]!==T?(z=n.jsx(yn,{children:r?n.jsx(Zn,{eyebrow:Q,userName:T}):n.jsx(Yn,{eyebrow:Q,userName:T,hasVisibleTiles:S})}),t[28]=Q,t[29]=S,t[30]=r,t[31]=T,t[32]=z):z=t[32],z}function Zn(t){const e=k.c(12),{eyebrow:s,userName:r}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(rt,{}),e[0]=i):i=e[0];let o;e[1]!==s?(o=s&&n.jsx("div",{className:"mb-4",children:s}),e[1]=s,e[2]=o):o=e[2];let l;e[3]!==r?(l=n.jsxs("p",{className:"text-3xl font-medium text-foreground text-center max-w-[280px]",children:["What's on your mind, ",r,"?"]}),e[3]=r,e[4]=l):l=e[4];let d;e[5]!==o||e[6]!==l?(d=n.jsxs("div",{className:"relative flex flex-col items-center justify-center w-full pt-28 pb-8 px-4",children:[o,l]}),e[5]=o,e[6]=l,e[7]=d):d=e[7];let a;e[8]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx("div",{className:"relative w-full flex flex-col gap-4 pb-8 px-4",children:n.jsx(re.Input,{showConnectionsBanner:!0})}),e[8]=a):a=e[8];let m;e[9]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx("div",{className:"relative w-full px-4 pb-8",children:n.jsx(it,{isEditMode:!1})}),e[9]=m):m=e[9];let c;return e[10]!==d?(c=n.jsxs("div",{className:"flex-1 relative flex flex-col items-center overflow-y-auto",children:[i,d,a,m]}),e[10]=d,e[11]=c):c=e[11],c}function Yn(t){const e=k.c(32),{eyebrow:s,userName:r,hasVisibleTiles:i}=t,{isEditMode:o,enter:l,save:d,cancel:a,hasChanges:m}=st(),[c,u]=$.useState(!1);let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=()=>u(!0),e[0]=f):f=e[0];let h;e[1]!==a||e[2]!==l||e[3]!==m||e[4]!==o||e[5]!==d?(h=n.jsx(As.Right,{children:n.jsx(ei,{isEditMode:o,hasChanges:m,onEnter:l,onSave:d,onCancel:a,onAddTile:f})}),e[1]=a,e[2]=l,e[3]=m,e[4]=o,e[5]=d,e[6]=h):h=e[6];let x;e[7]!==c?(x=n.jsx(Rs,{open:c,onOpenChange:u}),e[7]=c,e[8]=x):x=e[8];let p;e[9]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx(rt,{}),e[9]=p):p=e[9];const g=i||o?"pt-32":"flex-1 justify-center";let y;e[10]!==g?(y=G("relative flex flex-col items-center px-10 pb-4",g),e[10]=g,e[11]=y):y=e[11];let j;e[12]!==s?(j=s&&n.jsx("div",{className:"mb-4",children:s}),e[12]=s,e[13]=j):j=e[13];let w;e[14]!==r?(w=n.jsxs("p",{className:"text-3xl font-medium text-foreground",children:["What's on your mind, ",r,"?"]}),e[14]=r,e[15]=w):w=e[15];let v;e[16]!==j||e[17]!==w?(v=n.jsxs("div",{className:"text-center mb-10",children:[j,w]}),e[16]=j,e[17]=w,e[18]=v):v=e[18];let b;e[19]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsxs("div",{className:"relative w-full",children:[n.jsx(ti,{}),n.jsx(re.Input,{showConnectionsBanner:!0})]}),e[19]=b):b=e[19];let N;e[20]!==v?(N=n.jsxs("div",{className:"flex flex-col items-center w-full max-w-[672px]",children:[v,b]}),e[20]=v,e[21]=N):N=e[21];let S;e[22]!==o?(S=n.jsx("div",{className:"relative w-full mt-10 mx-auto max-w-[1280px] px-2 pb-16",children:n.jsx(it,{isEditMode:o})}),e[22]=o,e[23]=S):S=e[23];let _;e[24]!==N||e[25]!==S||e[26]!==y?(_=n.jsxs("div",{className:"flex-1 relative flex flex-col min-h-0",children:[p,n.jsx("div",{className:"flex-1 relative flex flex-col overflow-y-auto",children:n.jsxs("div",{className:y,children:[N,S]})})]}),e[24]=N,e[25]=S,e[26]=y,e[27]=_):_=e[27];let C;return e[28]!==_||e[29]!==h||e[30]!==x?(C=n.jsxs(n.Fragment,{children:[h,x,_]}),e[28]=_,e[29]=h,e[30]=x,e[31]=C):C=e[31],C}function ei(t){const e=k.c(17),{isEditMode:s,hasChanges:r,onEnter:i,onSave:o,onCancel:l,onAddTile:d}=t;if(s){let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(ye,{size:14}),e[0]=c):c=e[0];let u;e[1]!==d?(u=n.jsxs("button",{type:"button",onClick:d,className:"flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",title:"Add a tile from any agent",children:[c,"Add tile"]}),e[1]=d,e[2]=u):u=e[2];let f;e[3]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(Pe,{size:14}),e[3]=f):f=e[3];let h;e[4]!==l?(h=n.jsxs(Y,{size:"sm",variant:"ghost",onClick:l,className:"gap-1.5 h-7 text-xs",children:[f,"Cancel"]}),e[4]=l,e[5]=h):h=e[5];const x=!r;let p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx($t,{size:14}),e[6]=p):p=e[6];let g;e[7]!==o||e[8]!==x?(g=n.jsxs(Y,{size:"sm",onClick:o,disabled:x,className:"gap-1.5 h-7 text-xs",children:[p,"Save"]}),e[7]=o,e[8]=x,e[9]=g):g=e[9];let y;return e[10]!==u||e[11]!==h||e[12]!==g?(y=n.jsxs(n.Fragment,{children:[u,h,g]}),e[10]=u,e[11]=h,e[12]=g,e[13]=y):y=e[13],y}let a;e[14]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(Mt,{size:14}),e[14]=a):a=e[14];let m;return e[15]!==i?(m=n.jsxs("button",{type:"button",onClick:i,className:"flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",title:"Customize your home",children:[a,"Customize"]}),e[15]=i,e[16]=m):m=e[16],m}function ti(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("img",{src:"/home/capybara.png",alt:"","aria-hidden":!0,className:"pointer-events-none absolute -top-16 right-6 z-20 h-20 w-auto select-none"}),t[0]=e):e=t[0],e}function io(){const t=k.c(2);if(be()){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx("div",{className:"flex-1 min-h-0 flex flex-col bg-background overflow-hidden",children:n.jsx(Ee,{})}),t[0]=r):r=t[0],r}let s;return t[1]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx("div",{className:"flex-1 min-h-0 pb-1 pr-1 pl-0 pt-0",children:n.jsx("div",{className:"h-full p-0.5 pt-0.25",children:n.jsx("div",{className:"flex flex-col h-full bg-background overflow-hidden card-shadow rounded-[0.75rem]",children:n.jsx(Ee,{})})})}),t[1]=s):s=t[1],s}export{io as default};
|