decocms 4.6.0 → 4.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-Dc2EW1Xh.js → AlertCircle-BJq9ypj0.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-CQzCYQdd.js → ArrowUpRight-BcajLYn1.js} +1 -1
- package/dist/client/assets/{CheckCircle-Co8-96Va.js → CheckCircle-CgZRVWJ7.js} +1 -1
- package/dist/client/assets/{ChevronDown-DWQLUoqf.js → ChevronDown-C7iCpNd7.js} +1 -1
- package/dist/client/assets/{ChevronRight-Fl5MZFE5.js → ChevronRight-CQ6qJi_4.js} +1 -1
- package/dist/client/assets/{ChevronUp-C_lc_o3g.js → ChevronUp-BtpDIyFt.js} +1 -1
- package/dist/client/assets/{DotsVertical-Bj73amJ1.js → DotsVertical-CxSK3DNF.js} +1 -1
- package/dist/client/assets/{Eye-Cbxk_9w_.js → Eye-EQZNVaju.js} +1 -1
- package/dist/client/assets/{FilterLines-BYUFwc91.js → FilterLines-Bs1V5x-b.js} +1 -1
- package/dist/client/assets/{Globe01-DWTVb7Un.js → Globe01-BCZ4MJ9r.js} +1 -1
- package/dist/client/assets/{Globe04-CDxhXYra.js → Globe04-BYKU0iQC.js} +1 -1
- package/dist/client/assets/{HardDrive-BMXxrd-5.js → HardDrive-4fVVGWQv.js} +1 -1
- package/dist/client/assets/{Key01-DE0qpETa.js → Key01-x0kqMuez.js} +1 -1
- package/dist/client/assets/{LayoutLeft-D_an0z1y.js → LayoutLeft-gtZ98pdB.js} +1 -1
- package/dist/client/assets/{LinkExternal01-CkYnR-pE.js → LinkExternal01-Ct3eSohN.js} +1 -1
- package/dist/client/assets/{Monitor01-CwPbYng2.js → Monitor01-B4532Y1i.js} +1 -1
- package/dist/client/assets/{Palette-D_MNr8c_.js → Palette-CNyx15J3.js} +1 -1
- package/dist/client/assets/{Play-BSsk9TRT.js → Play-CR5jCOmn.js} +1 -1
- package/dist/client/assets/{Plus-CVGVCEWD.js → Plus-K9-3Y3av.js} +1 -1
- package/dist/client/assets/{SearchLg-C6-0dWFV.js → SearchLg-DNsRNxo9.js} +1 -1
- package/dist/client/assets/{SearchMd-B5gWQzhi.js → SearchMd-BA75dueP.js} +1 -1
- package/dist/client/assets/{Settings02-BPbjqaSP.js → Settings02-CUXE6YBK.js} +1 -1
- package/dist/client/assets/{Shield01-JA8ffipF.js → Shield01-gyJITz9J.js} +1 -1
- package/dist/client/assets/{Star01-Coh-d_en.js → Star01-hycj5iSk.js} +1 -1
- package/dist/client/assets/{Stars01-BNO0I13-.js → Stars01-D7uKNdAz.js} +1 -1
- package/dist/client/assets/{Stars02-_7e7vEGZ.js → Stars02-EI2D1sR2.js} +1 -1
- package/dist/client/assets/{Sun-Bkd03ipa.js → Sun-C9Wxt9CP.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-CiBRgm5I.js → SwitchHorizontal01-BrQLjMKA.js} +1 -1
- package/dist/client/assets/{Tool01-l_q8HUGI.js → Tool01-BDYpV4bF.js} +1 -1
- package/dist/client/assets/{Trash01-Bg4qQ-BB.js → Trash01-CkOiGHv0.js} +1 -1
- package/dist/client/assets/{Upload01-DXs8XkD-.js → Upload01-De93EmfO.js} +1 -1
- package/dist/client/assets/{User01-B-8LArOe.js → User01-BQnxqmQ5.js} +1 -1
- package/dist/client/assets/{Users01-BKqcv_gF.js → Users01-6ImDxKnC.js} +1 -1
- package/dist/client/assets/{Users03-D6kZFOjC.js → Users03-bEnDQfVD.js} +1 -1
- package/dist/client/assets/{X-CKh7IqmP.js → X-B7BrDYoR.js} +1 -1
- package/dist/client/assets/{XCircle-ChyNg6J4.js → XCircle--nqVJrRk.js} +1 -1
- package/dist/client/assets/{XClose-DOOHZ1iM.js → XClose-Bhi6uXp9.js} +1 -1
- package/dist/client/assets/{Zap-CGzacH_p.js → Zap-qEJPKDHk.js} +1 -1
- package/dist/client/assets/{ZapSquare-C9wtQq17.js → ZapSquare-XIRAkyko.js} +1 -1
- package/dist/client/assets/{ZoomOut-DT2MdREq.js → ZoomOut-B1lM_F9T.js} +1 -1
- package/dist/client/assets/{access-gate-BvzmNzgn.js → access-gate-BPjDLFwi.js} +1 -1
- package/dist/client/assets/{add-section-modal-BPyB9snb.js → add-section-modal-5SY3LIrK.js} +1 -1
- package/dist/client/assets/{agent-icon-B8eeNtuV.js → agent-icon-CJLs7JnL.js} +1 -1
- package/dist/client/assets/{agents-list-CRZC4vXY.js → agents-list-9b-w0Hxc.js} +1 -1
- package/dist/client/assets/{ai-providers-CgZlWEmI.js → ai-providers-a-phAOpt.js} +1 -1
- package/dist/client/assets/{alert-BFh5ZgoM.js → alert-DUteqAcw.js} +1 -1
- package/dist/client/assets/{alert-dialog-BD3igJDK.js → alert-dialog-769FAsUD.js} +1 -1
- package/dist/client/assets/{app-editor-GuZ0oz1C.js → app-editor-Dd1HA6k8.js} +1 -1
- package/dist/client/assets/{auth-CVcuabTS.js → auth-D29ieVkn.js} +1 -1
- package/dist/client/assets/{auth-catchall-BmKG9NPL.js → auth-catchall-B__PsIrj.js} +1 -1
- package/dist/client/assets/{auth-entry-gYR0lE8e.js → auth-entry-B8bFDnH8.js} +1 -1
- package/dist/client/assets/{auth-split-layout-CSxcQQiq.js → auth-split-layout-C91qSikf.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-B6YIi7Gy.js → authenticate-and-persist-oauth-Ot7eZvPq.js} +1 -1
- package/dist/client/assets/{automation-list-row-DjU3jslE.js → automation-list-row-C92STjEq.js} +1 -1
- package/dist/client/assets/{automation-runs-Dk8muYzQ.js → automation-runs-CBokQ0Wd.js} +1 -1
- package/dist/client/assets/{automations-Dh7v1Iwu.js → automations-BZM8UXWs.js} +1 -1
- package/dist/client/assets/{avatar-ClJplFDb.js → avatar-BeX1bScj.js} +1 -1
- package/dist/client/assets/{badge-kG1ciDHg.js → badge-40QNvrlo.js} +1 -1
- package/dist/client/assets/{block-document-RwImv4A7.js → block-document-FKMFR3nl.js} +1 -1
- package/dist/client/assets/{brand-context-C134XR4f.js → brand-context-vMXmPiWz.js} +1 -1
- package/dist/client/assets/{buckets-Dn3RjMXJ.js → buckets-aRLDQdB7.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-Dc7EhKeO.js → bulk-category-panel-iMZW3-6F.js} +1 -1
- package/dist/client/assets/{capability-load-error-Ea8TKuPS.js → capability-load-error-Bootd2y7.js} +1 -1
- package/dist/client/assets/{card-B4nOjxjh.js → card-mou1irWY.js} +1 -1
- package/dist/client/assets/{category-editor-QHLmkKZL.js → category-editor-w_J0qziX.js} +1 -1
- package/dist/client/assets/{chat-context-o6OHcwaz.js → chat-context-CDQGKTRb.js} +1 -1
- package/dist/client/assets/{checkbox-C8lYmD-I.js → checkbox-CQmZUGae.js} +1 -1
- package/dist/client/assets/{cli-auth-success-B1Fu33_g.js → cli-auth-success-CE14uwpH.js} +1 -1
- package/dist/client/assets/{collection-detail-B5rNz-Wz.js → collection-detail-DeOef9Um.js} +1 -1
- package/dist/client/assets/{collection-display-button-Bk_9Pvnv.js → collection-display-button-CV0kO4yO.js} +1 -1
- package/dist/client/assets/{collection-search-EKDGBBWD.js → collection-search-Bxp9u43w.js} +1 -1
- package/dist/client/assets/{collection-tabs-B4rLoGfk.js → collection-tabs-OuAA7gyO.js} +1 -1
- package/dist/client/assets/{command-BdMByUYO.js → command-CSY5a7Nv.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-BwW4IuxA.js → commerce-onboarding-CqZ9LJkV.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-ZFUlmIw8.js → connect-desktop-dialog-BRLVLmM1.js} +1 -1
- package/dist/client/assets/{connection-card-DXxeWgUJ.js → connection-card-Dnvk_cT5.js} +1 -1
- package/dist/client/assets/{connection-detail-BDw02lKx.js → connection-detail-D08afNEg.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-DPNIJhMB.js → connection-form-helpers-BSTA0pW8.js} +1 -1
- package/dist/client/assets/{connections-CEJbZBo0.js → connections-DU-jqQLE.js} +1 -1
- package/dist/client/assets/{context-menu-gI4zglEM.js → context-menu-BEQoU-0G.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-D9bCmaFi.js → decopilot-sse-pool-D0-zqsJt.js} +1 -1
- package/dist/client/assets/{decopilot-BAd_1NUv.js → decopilot-xdkIhiJl.js} +1 -1
- package/dist/client/assets/{dialog-D_71fLjl.js → dialog-CPwF731q.js} +1 -1
- package/dist/client/assets/{domain-settings-BNNySpeP.js → domain-settings-CO-7ooar.js} +1 -1
- package/dist/client/assets/{drawer-DodsaUcg.js → drawer-DlHMG-t7.js} +1 -1
- package/dist/client/assets/{dropdown-menu-DA0Umn63.js → dropdown-menu-CRzlYZec.js} +1 -1
- package/dist/client/assets/{empty-state-DKU1AE7g.js → empty-state-BrsYg01G.js} +1 -1
- package/dist/client/assets/{extract-connection-data-Dr1KuD3e.js → extract-connection-data-BLNjuXm9.js} +1 -1
- package/dist/client/assets/{file-explorer-DRnjO29u.js → file-explorer-rTMALYsN.js} +1 -1
- package/dist/client/assets/{file-type-icon-B-idWQER.js → file-type-icon-CZT8Q3fZ.js} +1 -1
- package/dist/client/assets/{files-Du_TyDiZ.js → files-DRUlydo8.js} +1 -1
- package/dist/client/assets/{form-DM2r8X1h.js → form-DbXRmybh.js} +1 -1
- package/dist/client/assets/{general-DSwDb14Y.js → general-TyH6pDBj.js} +1 -1
- package/dist/client/assets/{github-repo-picker-BzKrKS0y.js → github-repo-picker-DpXi-YYo.js} +1 -1
- package/dist/client/assets/{hooks-DxOSHTpN.js → hooks-mecxyGXr.js} +1 -1
- package/dist/client/assets/{import-from-deco-dialog-B0LK8KLz.js → import-from-deco-dialog-gw8JFWRQ.js} +1 -1
- package/dist/client/assets/{index-DKUn_x5-.js → index-8gVeAkM5.js} +1 -1
- package/dist/client/assets/{index-Cwvb1nlN.js → index-BFqCdkwd.js} +5 -5
- package/dist/client/assets/{index-pHcuwHnY.js → index-BHMagGVX.js} +1 -1
- package/dist/client/assets/{index-C8BsadKU.js → index-BJ2n8tC-.js} +1 -1
- package/dist/client/assets/{index-D0NstA9i.js → index-BtNhnk8x.js} +1 -1
- package/dist/client/assets/{index-Bqne0FVi.js → index-C2ExGzfp.js} +1 -1
- package/dist/client/assets/{index-B3OleqJQ.js → index-C6LmyPz-.js} +1 -1
- package/dist/client/assets/{index-BtNdd8C0.js → index-CjONkpe7.js} +1 -1
- package/dist/client/assets/{index-C_NGk336.js → index-CkU3dvkf.js} +1 -1
- package/dist/client/assets/{index-CveNYzWA.js → index-Cka24isE.js} +1 -1
- package/dist/client/assets/{index-Btu8MJ2T.js → index-Cw1_akCN.js} +3 -3
- package/dist/client/assets/{index-DFQgcYyk.js → index-D0PVVLS2.js} +1 -1
- package/dist/client/assets/{index-CMq-PrAu.js → index-hUSewKBE.js} +1 -1
- package/dist/client/assets/{index-DJ7Qk0xb.js → index-lbjS-oOC.js} +1 -1
- package/dist/client/assets/{index-redirect-BnWjgCMM.js → index-redirect-DoeCrs1U.js} +1 -1
- package/dist/client/assets/{input-4Ev3FmKy.js → input-DLr6JHGJ.js} +1 -1
- package/dist/client/assets/{integration-icon-eUjgo-Wa.js → integration-icon-iMszCnRO.js} +1 -1
- package/dist/client/assets/{label-gN8KznQ2.js → label-DBw8HeDH.js} +1 -1
- package/dist/client/assets/{login-BmQXmH_N.js → login-B7YZp4Tu.js} +1 -1
- package/dist/client/assets/{mcp-oauth-Cc5rkXEa.js → mcp-oauth-Bv1ej_Wz.js} +1 -1
- package/dist/client/assets/{members-Cp4zjzzy.js → members-D2jgmjul.js} +1 -1
- package/dist/client/assets/{monaco-editor-C44cv-br.js → monaco-editor-BQ1CFgLG.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-B40jQDmM.js → monitoring-stats-row-Be7nWM6q.js} +1 -1
- package/dist/client/assets/{oauth-callback-BrDST1fv.js → oauth-callback-BOEG63cg.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-WTkIlkS3.js → oauth-callback-ai-provider-wGoInC5D.js} +1 -1
- package/dist/client/assets/{onboarding-Dxkmjc30.js → onboarding-BGIu-B-F.js} +1 -1
- package/dist/client/assets/{org-install-B1JYSwjj.js → org-install-r4d6GH9Z.js} +1 -1
- package/dist/client/assets/{org-layout-Dujtpnew.js → org-layout-qL8h85_L.js} +1 -1
- package/dist/client/assets/{organization-choice-J5jK1Oxb.js → organization-choice-e3L-ZbL1.js} +1 -1
- package/dist/client/assets/{page-seo-form-A__xQkq5.js → page-seo-form-B4xtw7wy.js} +1 -1
- package/dist/client/assets/page-seo-sheet-CmaMrcgu.js +1 -0
- package/dist/client/assets/{popover-HVRs71J_.js → popover-B-zFyk2E.js} +1 -1
- package/dist/client/assets/{post-editor-AykTxdlh.js → post-editor-vILHAOBb.js} +1 -1
- package/dist/client/assets/{primitives-CqVCusAX.js → primitives-9rYPo8fq.js} +1 -1
- package/dist/client/assets/{profile-Dsm5cVUE.js → profile-DHs8Wr35.js} +1 -1
- package/dist/client/assets/project-app-view-CuuB2xXY.js +1 -0
- package/dist/client/assets/record-editor-BImRbjQY.js +1 -0
- package/dist/client/assets/{registry-layout-DnR6q-gU.js → registry-layout-D83bPbhY.js} +1 -1
- package/dist/client/assets/registry-xZZhpj_0.js +2 -0
- package/dist/client/assets/{require-capability-BHjBd5cR.js → require-capability-C-CL1zjU.js} +1 -1
- package/dist/client/assets/{required-auth-layout-BHT7ZfwS.js → required-auth-layout-ByN1DYD2.js} +1 -1
- package/dist/client/assets/{reset-password-C9fbH_Io.js → reset-password-C-jY3K_D.js} +1 -1
- package/dist/client/assets/{roles-DdiiM8bD.js → roles-Ba43B68D.js} +1 -1
- package/dist/client/assets/{scroll-area-DBKWSV0V.js → scroll-area-stexiMtw.js} +1 -1
- package/dist/client/assets/{search-input-CCb3iBWj.js → search-input-CbPO8glW.js} +1 -1
- package/dist/client/assets/{secrets-POD6p8M3.js → secrets-CY00qt0D.js} +1 -1
- package/dist/client/assets/{sections-editor-DmZ3dLRQ.js → sections-editor-CnXAOdKD.js} +1 -1
- package/dist/client/assets/{select-DsygRtM0.js → select-CkO_vFl4.js} +1 -1
- package/dist/client/assets/{select-model-Dz5WmHmG.js → select-model-CoIvfCTP.js} +1 -1
- package/dist/client/assets/{seo-editor-KdLfuwTx.js → seo-editor-CqxRfGo8.js} +1 -1
- package/dist/client/assets/{settings-layout-C7eatiLG.js → settings-layout-CCwpamgO.js} +1 -1
- package/dist/client/assets/{settings-section-BDyOfwm9.js → settings-section-CS-HJOQa.js} +1 -1
- package/dist/client/assets/{sheet-BuVYCl7W.js → sheet-BJzqKXxB.js} +1 -1
- package/dist/client/assets/{shell-controls-BKIuBDCo.js → shell-controls-DQhZ740p.js} +1 -1
- package/dist/client/assets/shell-layout-CR0Hp5Mh.js +1 -0
- package/dist/client/assets/{shell-route-loading-LDGMG-07.js → shell-route-loading-YF3fqODB.js} +1 -1
- package/dist/client/assets/{sidebar-DnL9fG62.js → sidebar-D4jky0lG.js} +1 -1
- package/dist/client/assets/{skeleton-BgNQclTb.js → skeleton-BbyhTtn8.js} +1 -1
- package/dist/client/assets/{sortable.esm-CPwrTvNQ.js → sortable.esm-GHEOPheK.js} +1 -1
- package/dist/client/assets/{sso-DzkqAS16.js → sso-Dudubnxj.js} +1 -1
- package/dist/client/assets/{store-CuC2elbL.js → store-DiPlVeJJ.js} +1 -1
- package/dist/client/assets/store-registry-DIx06FUL.js +2 -0
- package/dist/client/assets/{studio-tools-B50CVfWQ.js → studio-tools-BkyKqeDD.js} +1 -1
- package/dist/client/assets/{switch-wJmvNZzz.js → switch-iORKvsWw.js} +1 -1
- package/dist/client/assets/{table-CDMv3jJI.js → table-dJL8Gx_v.js} +1 -1
- package/dist/client/assets/{tabs-BtMboBYf.js → tabs-Dv5E70j1.js} +1 -1
- package/dist/client/assets/{task-status-XX_WiZVd.js → task-status-BIJ-JzCh.js} +1 -1
- package/dist/client/assets/{textarea-DhaBNVNU.js → textarea-BbsMd9WU.js} +1 -1
- package/dist/client/assets/{toggle-group-CUlLZ0WG.js → toggle-group-ZHbJlDbB.js} +1 -1
- package/dist/client/assets/{toolbar-ChXNrWyq.js → toolbar-L97y_brf.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-Ds9XpOpZ.js → toolbar-icon-button-CnbRqKNI.js} +1 -1
- package/dist/client/assets/{tools-list-jajXFCHc.js → tools-list-m4wD8VuT.js} +1 -1
- package/dist/client/assets/{tooltip--hLULyB8.js → tooltip-DQJ-jcPk.js} +1 -1
- package/dist/client/assets/{types-CJ1piLtD.js → types-DnF2nXDI.js} +1 -1
- package/dist/client/assets/{use-ai-providers-CDUvzgtf.js → use-ai-providers-FWk9OVU1.js} +1 -1
- package/dist/client/assets/{use-automations-CM_uU7rn.js → use-automations-UH03D3_k.js} +1 -1
- package/dist/client/assets/{use-capability-BU6ciZJU.js → use-capability-BrLd3HxM.js} +1 -1
- package/dist/client/assets/{use-clock-tick-CrebkY9T.js → use-clock-tick-Cov0S4x5.js} +1 -1
- package/dist/client/assets/{use-collections-DVgsseNJ.js → use-collections-BnfRvFB1.js} +1 -1
- package/dist/client/assets/{use-connection-eth2XC-k.js → use-connection-DmwGJvkl.js} +1 -1
- package/dist/client/assets/{use-copy-Pbq9Qj8M.js → use-copy-CP0aLOns.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-BiSxyHB5.js → use-create-virtual-mcp-Cvu0UuPh.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-D47AwpeF.js → use-debounced-autosave-DEtmNfmW.js} +1 -1
- package/dist/client/assets/{use-debounced-value-BwJG2WZ7.js → use-debounced-value-pSAE8gPb.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-vuxyqGzO.js → use-decopilot-events-qzMfR8aE.js} +1 -1
- package/dist/client/assets/{use-delete-connection-BLF2aFv2.js → use-delete-connection-Boc8i97a.js} +1 -1
- package/dist/client/assets/{use-file-configs-C0Bxesif.js → use-file-configs-BKp911Uy.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-D2_Ok7--.js → use-infinite-scroll-C98OH2pE.js} +1 -1
- package/dist/client/assets/{use-join-requests-Bb9m7Kcn.js → use-join-requests-v_HpjSzf.js} +1 -1
- package/dist/client/assets/{use-mcp-client-gLPXhZwB.js → use-mcp-client-eL9inrhT.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-DlvK4PCy.js → use-mcp-prompts-BwjPqGqM.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-BuZcYJRN.js → use-mcp-tools-BRt-21KP.js} +1 -1
- package/dist/client/assets/{use-members-CKL7vqmc.js → use-members-DIYbrf7J.js} +1 -1
- package/dist/client/assets/{use-mobile-ClQdwqdV.js → use-mobile-BEMk8YZy.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-BiR_hnuj.js → use-navigate-to-agent-4Srb4Woe.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-DhNK-6Hb.js → use-org-auth-client-CRCqB27u.js} +1 -1
- package/dist/client/assets/{use-org-fs-DEr-WdtP.js → use-org-fs-sAfsYw1V.js} +1 -1
- package/dist/client/assets/{use-org-sso-D7xmv0-O.js → use-org-sso-B5PmzULO.js} +1 -1
- package/dist/client/assets/{use-organization-roles-d3UIS_ut.js → use-organization-roles-D5ExDxTL.js} +1 -1
- package/dist/client/assets/{use-organization-settings-sdfsJyHP.js → use-organization-settings-B67X4xDb.js} +1 -1
- package/dist/client/assets/{use-registry-connections-zKZuukaQ.js → use-registry-connections-BbQFk-hr.js} +1 -1
- package/dist/client/assets/{use-secrets-CqdIcoAr.js → use-secrets-BDDhVn1J.js} +1 -1
- package/dist/client/assets/{use-status-sounds-PFzjdDsL.js → use-status-sounds-DtFUS1V8.js} +1 -1
- package/dist/client/assets/{use-view-mode-DIgKkfzH.js → use-view-mode-D4DGwJDj.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-cFiSNo55.js → use-virtual-mcp-C1pJMY-h.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-Depl5l-b.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-DuIaWnch.js +1 -0
- package/dist/client/assets/{useSuspenseQueries-Blox8E_y.js → useSuspenseQueries-DcYkaPjN.js} +1 -1
- package/dist/client/assets/{variant-calendar-BGBXolQx.js → variant-calendar-DYeu7eMI.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-CXuLlYYW.js → view-mode-toggle-FEIyeDRK.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +383 -366
- package/dist/server/server.js +253 -253
- package/package.json +1 -1
- package/dist/client/assets/page-seo-sheet-BDorMbm5.js +0 -1
- package/dist/client/assets/project-app-view-0WOOUHRR.js +0 -1
- package/dist/client/assets/record-editor-BeS6EgWO.js +0 -1
- package/dist/client/assets/registry-JHGZe7dz.js +0 -2
- package/dist/client/assets/shell-layout-DBLgWYru.js +0 -1
- package/dist/client/assets/store-registry-rIEcmjfy.js +0 -2
- package/dist/client/assets/useInfiniteQuery-DRF-obNO.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CxCY-IUG.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as h}from"./index-
|
|
1
|
+
import{r as h}from"./index-Cw1_akCN.js";var w=(o,i,l,s,c,t,m,d)=>{let r=document.documentElement,u=["light","dark"];function n(e){(Array.isArray(o)?o:[o]).forEach(a=>{let p=a==="class",S=p&&t?c.map(f=>t[f]||f):c;p?(r.classList.remove(...S),r.classList.add(t&&t[e]?t[e]:e)):r.setAttribute(a,e)}),y(e)}function y(e){d&&u.includes(e)&&(r.style.colorScheme=e)}function g(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(s)n(s);else try{let e=localStorage.getItem(i)||l,a=m&&e==="system"?g():e;n(a)}catch{}};h.createContext(void 0);h.memo(({forcedTheme:o,storageKey:i,attribute:l,enableSystem:s,enableColorScheme:c,defaultTheme:t,value:m,themes:d,nonce:r,scriptProps:u})=>{let n=JSON.stringify([l,i,t,o,d,m,s,c]).slice(1,-1);return h.createElement("script",{...u,suppressHydrationWarning:!0,nonce:typeof window>"u"?r:"",dangerouslySetInnerHTML:{__html:`(${w.toString()})(${n})`}})});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as k,aM as ys,c as R,l as ae,j as s,J as ws,i as js,B as Y,K as se,k as me,ac as yn,D as Ve,m as Ft,t as ce,ae as ks,G as Ss,e as zs,b as wn,u as jn,E as $t}from"./index-Btu8MJ2T.js";import{i as Ns}from"./ChevronRight-Fl5MZFE5.js";import{a as Cs,s as kn}from"./Eye-Cbxk_9w_.js";import{n as qe,i as pt}from"./Globe01-DWTVb7Un.js";import{b as $s,c as Ps,e as Es,i as Ds,f as Sn,a as _t,g as Ts,h as Ms,d as Os}from"./ZoomOut-DT2MdREq.js";import{a as ct}from"./Palette-D_MNr8c_.js";import{s as As}from"./Plus-CVGVCEWD.js";import{i as Rs}from"./SearchLg-C6-0dWFV.js";import{t as Is}from"./Stars01-BNO0I13-.js";import{i as dt}from"./Upload01-DXs8XkD-.js";import{s as zn}from"./XClose-DOOHZ1iM.js";import{i as Ut}from"./Zap-CGzacH_p.js";import{u as Nn}from"./use-mobile-ClQdwqdV.js";import{f as Ls,a as Fs,b as _s,c as Us,d as Bs,e as Hs,A as qs,g as Ws}from"./alert-dialog-BD3igJDK.js";import{c as Cn,a as Le,d as Xe,e as Qe,f as $n,b as Ks,D as Gs}from"./dialog-D_71fLjl.js";import{I as We}from"./input-4Ev3FmKy.js";import{S as oe}from"./skeleton-BgNQclTb.js";import{F as we,M as Bt,d as Pn}from"./file-type-icon-B-idWQER.js";import{T as Vs}from"./toolbar-ChXNrWyq.js";import{u as Xs}from"./use-debounced-value-BwJG2WZ7.js";import{i as En,f as Dn,j as Qs,d as Tn,e as Ys,a as Ye,u as At,k as Ht,l as Zs,b as Js,m as Mn,n as el}from"./use-org-fs-DEr-WdtP.js";import{i as xt}from"./DotsVertical-Bj73amJ1.js";import{i as On}from"./Key01-DE0qpETa.js";import{s as gt}from"./Trash01-Bg4qQ-BB.js";import{D as Ze,a as Je,b as et,c as pe}from"./dropdown-menu-DA0Umn63.js";import{T as tl}from"./textarea-DhaBNVNU.js";import{t as nl}from"./ChevronDown-DWQLUoqf.js";import{i as sl,n as ll}from"./ChevronUp-C_lc_o3g.js";import{i as ut}from"./X-CKh7IqmP.js";import{a as rl,P as il,b as ol}from"./popover-HVRs71J_.js";import{T as xe,a as ge,b as be}from"./tooltip--hLULyB8.js";import{n as An}from"./LinkExternal01-CkYnR-pE.js";import{l as al,F as cl}from"./index-DFQgcYyk.js";import{i as dl}from"./LayoutLeft-D_an0z1y.js";const bt=k.createContext(null);bt.displayName="PanelGroupContext";const ne={group:"data-panel-group",groupDirection:"data-panel-group-direction",groupId:"data-panel-group-id",panel:"data-panel",panelCollapsible:"data-panel-collapsible",panelId:"data-panel-id",panelSize:"data-panel-size",resizeHandle:"data-resize-handle",resizeHandleActive:"data-resize-handle-active",resizeHandleEnabled:"data-panel-resize-handle-enabled",resizeHandleId:"data-panel-resize-handle-id",resizeHandleState:"data-resize-handle-state"},qt=10,Ee=k.useLayoutEffect,en=ys.useId,ul=typeof en=="function"?en:()=>null;let fl=0;function Wt(t=null){const e=ul(),n=k.useRef(t||e||null);return n.current===null&&(n.current=""+fl++),t??n.current}function Rn({children:t,className:e="",collapsedSize:n,collapsible:l,defaultSize:r,forwardedRef:i,id:o,maxSize:a,minSize:c,onCollapse:d,onExpand:f,onResize:u,order:m,style:h,tagName:p="div",...g}){const y=k.useContext(bt);if(y===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:x,expandPanel:b,getPanelSize:j,getPanelStyle:z,groupId:N,isPanelCollapsed:C,reevaluatePanelConstraints:w,registerPanel:M,resizePanel:O,unregisterPanel:T}=y,v=Wt(o),$=k.useRef({callbacks:{onCollapse:d,onExpand:f,onResize:u},constraints:{collapsedSize:n,collapsible:l,defaultSize:r,maxSize:a,minSize:c},id:v,idIsFromProps:o!==void 0,order:m});k.useRef({didLogMissingDefaultSizeWarning:!1}),Ee(()=>{const{callbacks:F,constraints:_}=$.current,B={..._};$.current.id=v,$.current.idIsFromProps=o!==void 0,$.current.order=m,F.onCollapse=d,F.onExpand=f,F.onResize=u,_.collapsedSize=n,_.collapsible=l,_.defaultSize=r,_.maxSize=a,_.minSize=c,(B.collapsedSize!==_.collapsedSize||B.collapsible!==_.collapsible||B.maxSize!==_.maxSize||B.minSize!==_.minSize)&&w($.current,B)}),Ee(()=>{const F=$.current;return M(F),()=>{T(F)}},[m,v,M,T]),k.useImperativeHandle(i,()=>({collapse:()=>{x($.current)},expand:F=>{b($.current,F)},getId(){return v},getSize(){return j($.current)},isCollapsed(){return C($.current)},isExpanded(){return!C($.current)},resize:F=>{O($.current,F)}}),[x,b,j,C,v,O]);const K=z($.current,r);return k.createElement(p,{...g,children:t,className:e,id:v,style:{...K,...h},[ne.groupId]:N,[ne.panel]:"",[ne.panelCollapsible]:l||void 0,[ne.panelId]:v,[ne.panelSize]:parseFloat(""+K.flexGrow).toFixed(1)})}const In=k.forwardRef((t,e)=>k.createElement(Rn,{...t,forwardedRef:e}));Rn.displayName="Panel";In.displayName="forwardRef(Panel)";let Rt=null,at=-1,Se=null;function ml(t,e){if(e){const n=(e&Bn)!==0,l=(e&Hn)!==0,r=(e&qn)!==0,i=(e&Wn)!==0;if(n)return r?"se-resize":i?"ne-resize":"e-resize";if(l)return r?"sw-resize":i?"nw-resize":"w-resize";if(r)return"s-resize";if(i)return"n-resize"}switch(t){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function hl(){Se!==null&&(document.head.removeChild(Se),Rt=null,Se=null,at=-1)}function Pt(t,e){var n,l;const r=ml(t,e);if(Rt!==r){if(Rt=r,Se===null&&(Se=document.createElement("style"),document.head.appendChild(Se)),at>=0){var i;(i=Se.sheet)===null||i===void 0||i.removeRule(at)}at=(n=(l=Se.sheet)===null||l===void 0?void 0:l.insertRule(`*{cursor: ${r} !important;}`))!==null&&n!==void 0?n:-1}}function Ln(t){return t.type==="keydown"}function Fn(t){return t.type.startsWith("pointer")}function _n(t){return t.type.startsWith("mouse")}function vt(t){if(Fn(t)){if(t.isPrimary)return{x:t.clientX,y:t.clientY}}else if(_n(t))return{x:t.clientX,y:t.clientY};return{x:1/0,y:1/0}}function pl(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function xl(t,e,n){return t.x<e.x+e.width&&t.x+t.width>e.x&&t.y<e.y+e.height&&t.y+t.height>e.y}function gl(t,e){if(t===e)throw new Error("Cannot compare node with itself");const n={a:sn(t),b:sn(e)};let l;for(;n.a.at(-1)===n.b.at(-1);)t=n.a.pop(),e=n.b.pop(),l=t;V(l,"Stacking order can only be calculated for elements with a common ancestor");const r={a:nn(tn(n.a)),b:nn(tn(n.b))};if(r.a===r.b){const i=l.childNodes,o={a:n.a.at(-1),b:n.b.at(-1)};let a=i.length;for(;a--;){const c=i[a];if(c===o.a)return 1;if(c===o.b)return-1}}return Math.sign(r.a-r.b)}const bl=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function vl(t){var e;const n=getComputedStyle((e=Un(t))!==null&&e!==void 0?e:t).display;return n==="flex"||n==="inline-flex"}function yl(t){const e=getComputedStyle(t);return!!(e.position==="fixed"||e.zIndex!=="auto"&&(e.position!=="static"||vl(t))||+e.opacity<1||"transform"in e&&e.transform!=="none"||"webkitTransform"in e&&e.webkitTransform!=="none"||"mixBlendMode"in e&&e.mixBlendMode!=="normal"||"filter"in e&&e.filter!=="none"||"webkitFilter"in e&&e.webkitFilter!=="none"||"isolation"in e&&e.isolation==="isolate"||bl.test(e.willChange)||e.webkitOverflowScrolling==="touch")}function tn(t){let e=t.length;for(;e--;){const n=t[e];if(V(n,"Missing node"),yl(n))return n}return null}function nn(t){return t&&Number(getComputedStyle(t).zIndex)||0}function sn(t){const e=[];for(;t;)e.push(t),t=Un(t);return e}function Un(t){const{parentNode:e}=t;return e&&e instanceof ShadowRoot?e.host:e}const Bn=1,Hn=2,qn=4,Wn=8,wl=pl()==="coarse";let fe=[],Ie=!1,Pe=new Map,yt=new Map;const Ke=new Set;function jl(t,e,n,l,r){var i;const{ownerDocument:o}=e,a={direction:n,element:e,hitAreaMargins:l,setResizeHandlerState:r},c=(i=Pe.get(o))!==null&&i!==void 0?i:0;return Pe.set(o,c+1),Ke.add(a),ft(),function(){var f;yt.delete(t),Ke.delete(a);const u=(f=Pe.get(o))!==null&&f!==void 0?f:1;if(Pe.set(o,u-1),ft(),u===1&&Pe.delete(o),fe.includes(a)){const m=fe.indexOf(a);m>=0&&fe.splice(m,1),Gt(),r("up",!0,null)}}}function kl(t){const{target:e}=t,{x:n,y:l}=vt(t);Ie=!0,Kt({target:e,x:n,y:l}),ft(),fe.length>0&&(mt("down",t),t.preventDefault(),Kn(e)||t.stopImmediatePropagation())}function Et(t){const{x:e,y:n}=vt(t);if(Ie&&t.buttons===0&&(Ie=!1,mt("up",t)),!Ie){const{target:l}=t;Kt({target:l,x:e,y:n})}mt("move",t),Gt(),fe.length>0&&t.preventDefault()}function Dt(t){const{target:e}=t,{x:n,y:l}=vt(t);yt.clear(),Ie=!1,fe.length>0&&(t.preventDefault(),Kn(e)||t.stopImmediatePropagation()),mt("up",t),Kt({target:e,x:n,y:l}),Gt(),ft()}function Kn(t){let e=t;for(;e;){if(e.hasAttribute(ne.resizeHandle))return!0;e=e.parentElement}return!1}function Kt({target:t,x:e,y:n}){fe.splice(0);let l=null;(t instanceof HTMLElement||t instanceof SVGElement)&&(l=t),Ke.forEach(r=>{const{element:i,hitAreaMargins:o}=r,a=i.getBoundingClientRect(),{bottom:c,left:d,right:f,top:u}=a,m=wl?o.coarse:o.fine;if(e>=d-m&&e<=f+m&&n>=u-m&&n<=c+m){if(l!==null&&document.contains(l)&&i!==l&&!i.contains(l)&&!l.contains(i)&&gl(l,i)>0){let p=l,g=!1;for(;p&&!p.contains(i);){if(xl(p.getBoundingClientRect(),a)){g=!0;break}p=p.parentElement}if(g)return}fe.push(r)}})}function Tt(t,e){yt.set(t,e)}function Gt(){let t=!1,e=!1;fe.forEach(l=>{const{direction:r}=l;r==="horizontal"?t=!0:e=!0});let n=0;yt.forEach(l=>{n|=l}),t&&e?Pt("intersection",n):t?Pt("horizontal",n):e?Pt("vertical",n):hl()}let Mt=new AbortController;function ft(){Mt.abort(),Mt=new AbortController;const t={capture:!0,signal:Mt.signal};Ke.size&&(Ie?(fe.length>0&&Pe.forEach((e,n)=>{const{body:l}=n;e>0&&(l.addEventListener("contextmenu",Dt,t),l.addEventListener("pointerleave",Et,t),l.addEventListener("pointermove",Et,t))}),window.addEventListener("pointerup",Dt,t),window.addEventListener("pointercancel",Dt,t)):Pe.forEach((e,n)=>{const{body:l}=n;e>0&&(l.addEventListener("pointerdown",kl,t),l.addEventListener("pointermove",Et,t))}))}function mt(t,e){Ke.forEach(n=>{const{setResizeHandlerState:l}=n,r=fe.includes(n);l(t,r,e)})}function Sl(){const[t,e]=k.useState(0);return k.useCallback(()=>e(n=>n+1),[])}function V(t,e){if(!t)throw console.error(e),Error(e)}function De(t,e,n=qt){return t.toFixed(n)===e.toFixed(n)?0:t>e?1:-1}function ve(t,e,n=qt){return De(t,e,n)===0}function ue(t,e,n){return De(t,e,n)===0}function zl(t,e,n){if(t.length!==e.length)return!1;for(let l=0;l<t.length;l++){const r=t[l],i=e[l];if(!ue(r,i,n))return!1}return!0}function Re({panelConstraints:t,panelIndex:e,size:n}){const l=t[e];V(l!=null,`Panel constraints not found for index ${e}`);let{collapsedSize:r=0,collapsible:i,maxSize:o=100,minSize:a=0}=l;if(De(n,a)<0)if(i){const c=(r+a)/2;De(n,c)<0?n=r:n=a}else n=a;return n=Math.min(o,n),n=parseFloat(n.toFixed(qt)),n}function _e({delta:t,initialLayout:e,panelConstraints:n,pivotIndices:l,prevLayout:r,trigger:i}){if(ue(t,0))return e;const o=[...e],[a,c]=l;V(a!=null,"Invalid first pivot index"),V(c!=null,"Invalid second pivot index");let d=0;if(i==="keyboard"){{const u=t<0?c:a,m=n[u];V(m,`Panel constraints not found for index ${u}`);const{collapsedSize:h=0,collapsible:p,minSize:g=0}=m;if(p){const y=e[u];if(V(y!=null,`Previous layout not found for panel index ${u}`),ue(y,h)){const x=g-y;De(x,Math.abs(t))>0&&(t=t<0?0-x:x)}}}{const u=t<0?a:c,m=n[u];V(m,`No panel constraints found for index ${u}`);const{collapsedSize:h=0,collapsible:p,minSize:g=0}=m;if(p){const y=e[u];if(V(y!=null,`Previous layout not found for panel index ${u}`),ue(y,g)){const x=y-h;De(x,Math.abs(t))>0&&(t=t<0?0-x:x)}}}}{const u=t<0?1:-1;let m=t<0?c:a,h=0;for(;;){const g=e[m];V(g!=null,`Previous layout not found for panel index ${m}`);const x=Re({panelConstraints:n,panelIndex:m,size:100})-g;if(h+=x,m+=u,m<0||m>=n.length)break}const p=Math.min(Math.abs(t),Math.abs(h));t=t<0?0-p:p}{let m=t<0?a:c;for(;m>=0&&m<n.length;){const h=Math.abs(t)-Math.abs(d),p=e[m];V(p!=null,`Previous layout not found for panel index ${m}`);const g=p-h,y=Re({panelConstraints:n,panelIndex:m,size:g});if(!ue(p,y)&&(d+=p-y,o[m]=y,d.toPrecision(3).localeCompare(Math.abs(t).toPrecision(3),void 0,{numeric:!0})>=0))break;t<0?m--:m++}}if(zl(r,o))return r;{const u=t<0?c:a,m=e[u];V(m!=null,`Previous layout not found for panel index ${u}`);const h=m+d,p=Re({panelConstraints:n,panelIndex:u,size:h});if(o[u]=p,!ue(p,h)){let g=h-p,x=t<0?c:a;for(;x>=0&&x<n.length;){const b=o[x];V(b!=null,`Previous layout not found for panel index ${x}`);const j=b+g,z=Re({panelConstraints:n,panelIndex:x,size:j});if(ue(b,z)||(g-=z-b,o[x]=z),ue(g,0))break;t>0?x--:x++}}}const f=o.reduce((u,m)=>m+u,0);return ue(f,100)?o:r}function Nl({layout:t,panelsArray:e,pivotIndices:n}){let l=0,r=100,i=0,o=0;const a=n[0];V(a!=null,"No pivot index found"),e.forEach((u,m)=>{const{constraints:h}=u,{maxSize:p=100,minSize:g=0}=h;m===a?(l=g,r=p):(i+=g,o+=p)});const c=Math.min(r,100-i),d=Math.max(l,100-o),f=t[a];return{valueMax:c,valueMin:d,valueNow:f}}function Ge(t,e=document){return Array.from(e.querySelectorAll(`[${ne.resizeHandleId}][data-panel-group-id="${t}"]`))}function Gn(t,e,n=document){const r=Ge(t,n).findIndex(i=>i.getAttribute(ne.resizeHandleId)===e);return r??null}function Vn(t,e,n){const l=Gn(t,e,n);return l!=null?[l,l+1]:[-1,-1]}function Xn(t,e=document){var n;if(e instanceof HTMLElement&&(e==null||(n=e.dataset)===null||n===void 0?void 0:n.panelGroupId)==t)return e;const l=e.querySelector(`[data-panel-group][data-panel-group-id="${t}"]`);return l||null}function wt(t,e=document){const n=e.querySelector(`[${ne.resizeHandleId}="${t}"]`);return n||null}function Cl(t,e,n,l=document){var r,i,o,a;const c=wt(e,l),d=Ge(t,l),f=c?d.indexOf(c):-1,u=(r=(i=n[f])===null||i===void 0?void 0:i.id)!==null&&r!==void 0?r:null,m=(o=(a=n[f+1])===null||a===void 0?void 0:a.id)!==null&&o!==void 0?o:null;return[u,m]}function $l({committedValuesRef:t,eagerValuesRef:e,groupId:n,layout:l,panelDataArray:r,panelGroupElement:i,setLayout:o}){k.useRef({didWarnAboutMissingResizeHandle:!1}),Ee(()=>{if(!i)return;const a=Ge(n,i);for(let c=0;c<r.length-1;c++){const{valueMax:d,valueMin:f,valueNow:u}=Nl({layout:l,panelsArray:r,pivotIndices:[c,c+1]}),m=a[c];if(m!=null){const h=r[c];V(h,`No panel data found for index "${c}"`),m.setAttribute("aria-controls",h.id),m.setAttribute("aria-valuemax",""+Math.round(d)),m.setAttribute("aria-valuemin",""+Math.round(f)),m.setAttribute("aria-valuenow",u!=null?""+Math.round(u):"")}}return()=>{a.forEach((c,d)=>{c.removeAttribute("aria-controls"),c.removeAttribute("aria-valuemax"),c.removeAttribute("aria-valuemin"),c.removeAttribute("aria-valuenow")})}},[n,l,r,i]),k.useEffect(()=>{if(!i)return;const a=e.current;V(a,"Eager values not found");const{panelDataArray:c}=a,d=Xn(n,i);V(d!=null,`No group found for id "${n}"`);const f=Ge(n,i);V(f,`No resize handles found for group id "${n}"`);const u=f.map(m=>{const h=m.getAttribute(ne.resizeHandleId);V(h,"Resize handle element has no handle id attribute");const[p,g]=Cl(n,h,c,i);if(p==null||g==null)return()=>{};const y=x=>{if(!x.defaultPrevented)switch(x.key){case"Enter":{x.preventDefault();const b=c.findIndex(j=>j.id===p);if(b>=0){const j=c[b];V(j,`No panel data found for index ${b}`);const z=l[b],{collapsedSize:N=0,collapsible:C,minSize:w=0}=j.constraints;if(z!=null&&C){const M=_e({delta:ue(z,N)?w-N:N-z,initialLayout:l,panelConstraints:c.map(O=>O.constraints),pivotIndices:Vn(n,h,i),prevLayout:l,trigger:"keyboard"});l!==M&&o(M)}}break}}};return m.addEventListener("keydown",y),()=>{m.removeEventListener("keydown",y)}});return()=>{u.forEach(m=>m())}},[i,t,e,n,l,r,o])}function ln(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function Qn(t,e){const n=t==="horizontal",{x:l,y:r}=vt(e);return n?l:r}function Pl(t,e,n,l,r){const i=n==="horizontal",o=wt(e,r);V(o,`No resize handle element found for id "${e}"`);const a=o.getAttribute(ne.groupId);V(a,"Resize handle element has no group id attribute");let{initialCursorPosition:c}=l;const d=Qn(n,t),f=Xn(a,r);V(f,`No group element found for id "${a}"`);const u=f.getBoundingClientRect(),m=i?u.width:u.height;return(d-c)/m*100}function El(t,e,n,l,r,i){if(Ln(t)){const o=n==="horizontal";let a=0;t.shiftKey?a=100:r!=null?a=r:a=10;let c=0;switch(t.key){case"ArrowDown":c=o?0:a;break;case"ArrowLeft":c=o?-a:0;break;case"ArrowRight":c=o?a:0;break;case"ArrowUp":c=o?0:-a;break;case"End":c=100;break;case"Home":c=-100;break}return c}else return l==null?0:Pl(t,e,n,l,i)}function Dl({panelDataArray:t}){const e=Array(t.length),n=t.map(i=>i.constraints);let l=0,r=100;for(let i=0;i<t.length;i++){const o=n[i];V(o,`Panel constraints not found for index ${i}`);const{defaultSize:a}=o;a!=null&&(l++,e[i]=a,r-=a)}for(let i=0;i<t.length;i++){const o=n[i];V(o,`Panel constraints not found for index ${i}`);const{defaultSize:a}=o;if(a!=null)continue;const c=t.length-l,d=r/c;l++,e[i]=d,r-=d}return e}function Te(t,e,n){e.forEach((l,r)=>{const i=t[r];V(i,`Panel data not found for index ${r}`);const{callbacks:o,constraints:a,id:c}=i,{collapsedSize:d=0,collapsible:f}=a,u=n[c];if(u==null||l!==u){n[c]=l;const{onCollapse:m,onExpand:h,onResize:p}=o;p&&p(l,u),f&&(m||h)&&(h&&(u==null||ve(u,d))&&!ve(l,d)&&h(),m&&(u==null||!ve(u,d))&&ve(l,d)&&m())}})}function ot(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!=e[n])return!1;return!0}function Tl({defaultSize:t,dragState:e,layout:n,panelData:l,panelIndex:r,precision:i=3}){const o=n[r];let a;return o==null?a=t!=null?t.toPrecision(i):"1":l.length===1?a="1":a=o.toPrecision(i),{flexBasis:0,flexGrow:a,flexShrink:1,overflow:"hidden",pointerEvents:e!==null?"none":void 0}}function Ml(t,e=10){let n=null;return(...r)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{t(...r)},e)}}function rn(t){try{if(typeof localStorage<"u")t.getItem=e=>localStorage.getItem(e),t.setItem=(e,n)=>{localStorage.setItem(e,n)};else throw new Error("localStorage not supported in this environment")}catch(e){console.error(e),t.getItem=()=>null,t.setItem=()=>{}}}function Yn(t){return`react-resizable-panels:${t}`}function Zn(t){return t.map(e=>{const{constraints:n,id:l,idIsFromProps:r,order:i}=e;return r?l:i?`${i}:${JSON.stringify(n)}`:JSON.stringify(n)}).sort((e,n)=>e.localeCompare(n)).join(",")}function Jn(t,e){try{const n=Yn(t),l=e.getItem(n);if(l){const r=JSON.parse(l);if(typeof r=="object"&&r!=null)return r}}catch{}return null}function Ol(t,e,n){var l,r;const i=(l=Jn(t,n))!==null&&l!==void 0?l:{},o=Zn(e);return(r=i[o])!==null&&r!==void 0?r:null}function Al(t,e,n,l,r){var i;const o=Yn(t),a=Zn(e),c=(i=Jn(t,r))!==null&&i!==void 0?i:{};c[a]={expandToSizes:Object.fromEntries(n.entries()),layout:l};try{r.setItem(o,JSON.stringify(c))}catch(d){console.error(d)}}function on({layout:t,panelConstraints:e}){const n=[...t],l=n.reduce((i,o)=>i+o,0);if(n.length!==e.length)throw Error(`Invalid ${e.length} panel layout: ${n.map(i=>`${i}%`).join(", ")}`);if(!ue(l,100)&&n.length>0)for(let i=0;i<e.length;i++){const o=n[i];V(o!=null,`No layout data found for index ${i}`);const a=100/l*o;n[i]=a}let r=0;for(let i=0;i<e.length;i++){const o=n[i];V(o!=null,`No layout data found for index ${i}`);const a=Re({panelConstraints:e,panelIndex:i,size:o});o!=a&&(r+=o-a,n[i]=a)}if(!ue(r,0))for(let i=0;i<e.length;i++){const o=n[i];V(o!=null,`No layout data found for index ${i}`);const a=o+r,c=Re({panelConstraints:e,panelIndex:i,size:a});if(o!==c&&(r-=c-o,n[i]=c,ue(r,0)))break}return n}const Rl=100,Ue={getItem:t=>(rn(Ue),Ue.getItem(t)),setItem:(t,e)=>{rn(Ue),Ue.setItem(t,e)}},an={};function es({autoSaveId:t=null,children:e,className:n="",direction:l,forwardedRef:r,id:i=null,onLayout:o=null,keyboardResizeBy:a=null,storage:c=Ue,style:d,tagName:f="div",...u}){const m=Wt(i),h=k.useRef(null),[p,g]=k.useState(null),[y,x]=k.useState([]),b=Sl(),j=k.useRef({}),z=k.useRef(new Map),N=k.useRef(0),C=k.useRef({autoSaveId:t,direction:l,dragState:p,id:m,keyboardResizeBy:a,onLayout:o,storage:c}),w=k.useRef({layout:y,panelDataArray:[],panelDataArrayChanged:!1});k.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),k.useImperativeHandle(r,()=>({getId:()=>C.current.id,getLayout:()=>{const{layout:S}=w.current;return S},setLayout:S=>{const{onLayout:I}=C.current,{layout:L,panelDataArray:U}=w.current,D=on({layout:S,panelConstraints:U.map(H=>H.constraints)});ln(L,D)||(x(D),w.current.layout=D,I&&I(D),Te(U,D,j.current))}}),[]),Ee(()=>{C.current.autoSaveId=t,C.current.direction=l,C.current.dragState=p,C.current.id=m,C.current.onLayout=o,C.current.storage=c}),$l({committedValuesRef:C,eagerValuesRef:w,groupId:m,layout:y,panelDataArray:w.current.panelDataArray,setLayout:x,panelGroupElement:h.current}),k.useEffect(()=>{const{panelDataArray:S}=w.current;if(t){if(y.length===0||y.length!==S.length)return;let I=an[t];I==null&&(I=Ml(Al,Rl),an[t]=I);const L=[...S],U=new Map(z.current);I(t,L,U,y,c)}},[t,y,c]),k.useEffect(()=>{});const M=k.useCallback(S=>{const{onLayout:I}=C.current,{layout:L,panelDataArray:U}=w.current;if(S.constraints.collapsible){const D=U.map(de=>de.constraints),{collapsedSize:H=0,panelSize:Q,pivotIndices:ee}=$e(U,S,L);if(V(Q!=null,`Panel size not found for panel "${S.id}"`),!ve(Q,H)){z.current.set(S.id,Q);const P=Oe(U,S)===U.length-1?Q-H:H-Q,X=_e({delta:P,initialLayout:L,panelConstraints:D,pivotIndices:ee,prevLayout:L,trigger:"imperative-api"});ot(L,X)||(x(X),w.current.layout=X,I&&I(X),Te(U,X,j.current))}}},[]),O=k.useCallback((S,I)=>{const{onLayout:L}=C.current,{layout:U,panelDataArray:D}=w.current;if(S.constraints.collapsible){const H=D.map(te=>te.constraints),{collapsedSize:Q=0,panelSize:ee=0,minSize:de=0,pivotIndices:P}=$e(D,S,U),X=I??de;if(ve(ee,Q)){const te=z.current.get(S.id),he=te!=null&&te>=X?te:X,Ne=Oe(D,S)===D.length-1?ee-he:he-ee,ie=_e({delta:Ne,initialLayout:U,panelConstraints:H,pivotIndices:P,prevLayout:U,trigger:"imperative-api"});ot(U,ie)||(x(ie),w.current.layout=ie,L&&L(ie),Te(D,ie,j.current))}}},[]),T=k.useCallback(S=>{const{layout:I,panelDataArray:L}=w.current,{panelSize:U}=$e(L,S,I);return V(U!=null,`Panel size not found for panel "${S.id}"`),U},[]),v=k.useCallback((S,I)=>{const{panelDataArray:L}=w.current,U=Oe(L,S);return Tl({defaultSize:I,dragState:p,layout:y,panelData:L,panelIndex:U})},[p,y]),$=k.useCallback(S=>{const{layout:I,panelDataArray:L}=w.current,{collapsedSize:U=0,collapsible:D,panelSize:H}=$e(L,S,I);return V(H!=null,`Panel size not found for panel "${S.id}"`),D===!0&&ve(H,U)},[]),K=k.useCallback(S=>{const{layout:I,panelDataArray:L}=w.current,{collapsedSize:U=0,collapsible:D,panelSize:H}=$e(L,S,I);return V(H!=null,`Panel size not found for panel "${S.id}"`),!D||De(H,U)>0},[]),F=k.useCallback(S=>{const{panelDataArray:I}=w.current;I.push(S),I.sort((L,U)=>{const D=L.order,H=U.order;return D==null&&H==null?0:D==null?-1:H==null?1:D-H}),w.current.panelDataArrayChanged=!0,b()},[b]);Ee(()=>{if(w.current.panelDataArrayChanged){w.current.panelDataArrayChanged=!1;const{autoSaveId:S,onLayout:I,storage:L}=C.current,{layout:U,panelDataArray:D}=w.current;let H=null;if(S){const ee=Ol(S,D,L);ee&&(z.current=new Map(Object.entries(ee.expandToSizes)),H=ee.layout)}H==null&&(H=Dl({panelDataArray:D}));const Q=on({layout:H,panelConstraints:D.map(ee=>ee.constraints)});ln(U,Q)||(x(Q),w.current.layout=Q,I&&I(Q),Te(D,Q,j.current))}}),Ee(()=>{const S=w.current;return()=>{S.layout=[]}},[]);const _=k.useCallback(S=>{let I=!1;const L=h.current;return L&&window.getComputedStyle(L,null).getPropertyValue("direction")==="rtl"&&(I=!0),function(D){D.preventDefault();const H=h.current;if(!H)return()=>null;const{direction:Q,dragState:ee,id:de,keyboardResizeBy:P,onLayout:X}=C.current,{layout:te,panelDataArray:he}=w.current,{initialLayout:je}=ee??{},Ne=Vn(de,S,H);let ie=El(D,S,Q,ee,P,H);const lt=Q==="horizontal";lt&&I&&(ie=-ie);const Nt=he.map(Ct=>Ct.constraints),Ce=_e({delta:ie,initialLayout:je??te,panelConstraints:Nt,pivotIndices:Ne,prevLayout:te,trigger:Ln(D)?"keyboard":"mouse-or-touch"}),rt=!ot(te,Ce);(Fn(D)||_n(D))&&N.current!=ie&&(N.current=ie,!rt&&ie!==0?lt?Tt(S,ie<0?Bn:Hn):Tt(S,ie<0?qn:Wn):Tt(S,0)),rt&&(x(Ce),w.current.layout=Ce,X&&X(Ce),Te(he,Ce,j.current))}},[]),B=k.useCallback((S,I)=>{const{onLayout:L}=C.current,{layout:U,panelDataArray:D}=w.current,H=D.map(te=>te.constraints),{panelSize:Q,pivotIndices:ee}=$e(D,S,U);V(Q!=null,`Panel size not found for panel "${S.id}"`);const P=Oe(D,S)===D.length-1?Q-I:I-Q,X=_e({delta:P,initialLayout:U,panelConstraints:H,pivotIndices:ee,prevLayout:U,trigger:"imperative-api"});ot(U,X)||(x(X),w.current.layout=X,L&&L(X),Te(D,X,j.current))},[]),G=k.useCallback((S,I)=>{const{layout:L,panelDataArray:U}=w.current,{collapsedSize:D=0,collapsible:H}=I,{collapsedSize:Q=0,collapsible:ee,maxSize:de=100,minSize:P=0}=S.constraints,{panelSize:X}=$e(U,S,L);X!=null&&(H&&ee&&ve(X,D)?ve(D,Q)||B(S,Q):X<P?B(S,P):X>de&&B(S,de))},[B]),q=k.useCallback((S,I)=>{const{direction:L}=C.current,{layout:U}=w.current;if(!h.current)return;const D=wt(S,h.current);V(D,`Drag handle element not found for id "${S}"`);const H=Qn(L,I);g({dragHandleId:S,dragHandleRect:D.getBoundingClientRect(),initialCursorPosition:H,initialLayout:U})},[]),J=k.useCallback(()=>{g(null)},[]),Z=k.useCallback(S=>{const{panelDataArray:I}=w.current,L=Oe(I,S);L>=0&&(I.splice(L,1),delete j.current[S.id],w.current.panelDataArrayChanged=!0,b())},[b]),A=k.useMemo(()=>({collapsePanel:M,direction:l,dragState:p,expandPanel:O,getPanelSize:T,getPanelStyle:v,groupId:m,isPanelCollapsed:$,isPanelExpanded:K,reevaluatePanelConstraints:G,registerPanel:F,registerResizeHandle:_,resizePanel:B,startDragging:q,stopDragging:J,unregisterPanel:Z,panelGroupElement:h.current}),[M,p,l,O,T,v,m,$,K,G,F,_,B,q,J,Z]),W={display:"flex",flexDirection:l==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return k.createElement(bt.Provider,{value:A},k.createElement(f,{...u,children:e,className:n,id:i,ref:h,style:{...W,...d},[ne.group]:"",[ne.groupDirection]:l,[ne.groupId]:m}))}const ts=k.forwardRef((t,e)=>k.createElement(es,{...t,forwardedRef:e}));es.displayName="PanelGroup";ts.displayName="forwardRef(PanelGroup)";function Oe(t,e){return t.findIndex(n=>n===e||n.id===e.id)}function $e(t,e,n){const l=Oe(t,e),i=l===t.length-1?[l-1,l]:[l,l+1],o=n[l];return{...e.constraints,panelSize:o,pivotIndices:i}}function Il({disabled:t,handleId:e,resizeHandler:n,panelGroupElement:l}){k.useEffect(()=>{if(t||n==null||l==null)return;const r=wt(e,l);if(r==null)return;const i=o=>{if(!o.defaultPrevented)switch(o.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{o.preventDefault(),n(o);break}case"F6":{o.preventDefault();const a=r.getAttribute(ne.groupId);V(a,`No group element found for id "${a}"`);const c=Ge(a,l),d=Gn(a,e,l);V(d!==null,`No resize element found for id "${e}"`);const f=o.shiftKey?d>0?d-1:c.length-1:d+1<c.length?d+1:0;c[f].focus();break}}};return r.addEventListener("keydown",i),()=>{r.removeEventListener("keydown",i)}},[l,t,e,n])}function ns({children:t=null,className:e="",disabled:n=!1,hitAreaMargins:l,id:r,onBlur:i,onClick:o,onDragging:a,onFocus:c,onPointerDown:d,onPointerUp:f,style:u={},tabIndex:m=0,tagName:h="div",...p}){var g,y;const x=k.useRef(null),b=k.useRef({onClick:o,onDragging:a,onPointerDown:d,onPointerUp:f});k.useEffect(()=>{b.current.onClick=o,b.current.onDragging=a,b.current.onPointerDown=d,b.current.onPointerUp=f});const j=k.useContext(bt);if(j===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:z,groupId:N,registerResizeHandle:C,startDragging:w,stopDragging:M,panelGroupElement:O}=j,T=Wt(r),[v,$]=k.useState("inactive"),[K,F]=k.useState(!1),[_,B]=k.useState(null),G=k.useRef({state:v});Ee(()=>{G.current.state=v}),k.useEffect(()=>{if(n)B(null);else{const A=C(T);B(()=>A)}},[n,T,C]);const q=(g=l?.coarse)!==null&&g!==void 0?g:15,J=(y=l?.fine)!==null&&y!==void 0?y:5;k.useEffect(()=>{if(n||_==null)return;const A=x.current;V(A,"Element ref not attached");let W=!1;return jl(T,A,z,{coarse:q,fine:J},(I,L,U)=>{if(!L){$("inactive");return}switch(I){case"down":{$("drag"),W=!1,V(U,'Expected event to be defined for "down" action'),w(T,U);const{onDragging:D,onPointerDown:H}=b.current;D?.(!0),H?.();break}case"move":{const{state:D}=G.current;W=!0,D!=="drag"&&$("hover"),V(U,'Expected event to be defined for "move" action'),_(U);break}case"up":{$("hover"),M();const{onClick:D,onDragging:H,onPointerUp:Q}=b.current;H?.(!1),Q?.(),W||D?.();break}}})},[q,z,n,J,C,T,_,w,M]),Il({disabled:n,handleId:T,resizeHandler:_,panelGroupElement:O});const Z={touchAction:"none",userSelect:"none"};return k.createElement(h,{...p,children:t,className:e,id:r,onBlur:()=>{F(!1),i?.()},onFocus:()=>{F(!0),c?.()},ref:x,role:"separator",style:{...Z,...u},tabIndex:m,[ne.groupDirection]:z,[ne.groupId]:N,[ne.resizeHandle]:"",[ne.resizeHandleActive]:v==="drag"?"pointer":K?"keyboard":void 0,[ne.resizeHandleEnabled]:!n,[ne.resizeHandleId]:T,[ne.resizeHandleState]:v})}ns.displayName="PanelResizeHandle";function Ll(t){const e=R.c(10);let n,l,r;e[0]!==t?({className:n,ref:r,...l}=t,e[0]=t,e[1]=n,e[2]=l,e[3]=r):(n=e[1],l=e[2],r=e[3]);let i;e[4]!==n?(i=ae("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",n),e[4]=n,e[5]=i):i=e[5];let o;return e[6]!==l||e[7]!==r||e[8]!==i?(o=s.jsx(ts,{ref:r,"data-slot":"resizable-panel-group",className:i,...l}),e[6]=l,e[7]=r,e[8]=i,e[9]=o):o=e[9],o}function cn(t){const e=R.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let l;return e[2]!==n?(l=s.jsx(In,{"data-slot":"resizable-panel",...n}),e[2]=n,e[3]=l):l=e[3],l}function Fl(t){const e=R.c(12);let n,l,r;e[0]!==t?({withHandle:r,className:n,...l}=t,e[0]=t,e[1]=n,e[2]=l,e[3]=r):(n=e[1],l=e[2],r=e[3]);let i;e[4]!==n?(i=ae("bg-border focus-visible:ring-ring relative flex w-[0.5px] items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",n),e[4]=n,e[5]=i):i=e[5];let o;e[6]!==r?(o=r&&s.jsx("div",{className:"bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border",children:s.jsx($s,{className:"size-2.5"})}),e[6]=r,e[7]=o):o=e[7];let a;return e[8]!==l||e[9]!==i||e[10]!==o?(a=s.jsx(ns,{"data-slot":"resizable-handle",className:i,...l,children:o}),e[8]=l,e[9]=i,e[10]=o,e[11]=a):a=e[11],a}function _l(t){if(!t||t.includes("\\")||t.includes("..")||t.includes("\0"))return!0;try{const e=decodeURIComponent(t);if(e.includes("\\")||e.includes("..")||e.includes("\0"))return!0;if(e!==t&&e.includes("/")){const n=(t.match(/\//g)??[]).length;if((e.match(/\//g)??[]).length>n)return!0}return!1}catch{return!0}}function Ul(t){if(_l(t))throw new Error(`Invalid block key: ${t||"(empty)"}`)}function Bl(t){try{return decodeURIComponent(t)}catch{return t}}function Hl(t){return Ul(t),encodeURIComponent(t)}function ql(t){return`.deco/blocks/${Hl(t)}.json`}function bo(t){return`/${ql(t)}`}const vo=1e4,Wl=3;function It(t){return t.trim()?(t.startsWith("/")?t:`/${t}`).replace(/\/+/g,"/"):"/"}function Vt(t){return t.startsWith("/")?t.slice(1):t}function ht(t){return t.trim()?t.startsWith("/")?t:`/${t}`:"/"}function Kl(t){const e=ht(t);if(e==="/")return"/";const n=e.split("/").filter(Boolean);return n.pop(),n.length===0?"/":`/${n.join("/")}`}function yo(t,e){const n=e.replace(/^\/+|\/+$/g,"");return ht(n?`${t==="/"?"":t}/${n}`:t)}function wo(t,e){return e==="directory"?t:Kl(t)}function jo(t){const e=t.trim();return e?e.includes("/")||e.includes("\\")||e.includes("..")||e.includes("\0")?"Name cannot contain /, \\, or ..":null:"Name is required"}function Gl(t){const e=Vt(t);return e?e.split("/").filter(Boolean).length:0}function ko(t,e,n,l=!1){return{files:[...new Set([...t,...n.files])],directories:[...new Set([...e,...n.directories??[]])],truncated:l||!!n.truncated}}function So(t,e){return Gl(t)>=Wl&&!e.has(t)}function zo(t,e,n=[]){const l=Vt(t);if(e.includes(l)||n.includes(l))return!0;if(!l)return!1;const r=`${l}/`;return e.some(i=>i.startsWith(r))||n.some(i=>i.startsWith(r))}function No(t){const e=Vt(t),n=".deco/blocks/";if(!e.startsWith(n)||!e.endsWith(".json"))return null;const l=e.slice(n.length,-5);return Bl(l)}function Vl(t){if(!t)return"plaintext";const e=t.toLowerCase();return e.endsWith(".tsx")||e.endsWith(".ts")?"typescript":e.endsWith(".jsx")||e.endsWith(".js")||e.endsWith(".mjs")||e.endsWith(".cjs")?"javascript":e.endsWith(".json")?"json":e.endsWith(".md")||e.endsWith(".mdx")?"markdown":e.endsWith(".css")?"css":e.endsWith(".scss")?"scss":e.endsWith(".html")?"html":e.endsWith(".yaml")||e.endsWith(".yml")?"yaml":e.endsWith(".xml")||e.endsWith(".svg")?"xml":e.endsWith(".py")?"python":e.endsWith(".sql")?"sql":e.endsWith(".sh")?"shell":"plaintext"}function Co(t){const e=It(t).split("/").filter(Boolean),n=["/"];let l="";for(const r of e.slice(0,-1))l+=`/${r}`,n.push(l);return n}function $o(t,e=[]){const n={children:[]},l=i=>{const a=It(i).split("/").filter(Boolean);let c=n,d="";for(const f of a){d+=`/${f}`;let u=c.children.find(m=>m.name===f);u?u.kind==="file"&&(u.kind="directory"):(u={name:f,path:d,kind:"directory",children:[]},c.children.push(u)),c=u}};for(const i of t){const a=It(i).split("/").filter(Boolean);let c=n,d="";a.forEach((f,u)=>{d+=`/${f}`;const m=u===a.length-1;let h=c.children.find(p=>p.name===f);h||(h={name:f,path:d,kind:m?"file":"directory",children:[]},c.children.push(h)),c=h})}for(const i of e)l(ht(i));const r=i=>{i.sort((o,a)=>o.kind!==a.kind?o.kind==="directory"?-1:1:o.name.localeCompare(a.name));for(const o of i)o.children.length>0&&r(o.children)};return r(n.children),n.children}function Xl(t,e,n=0){const l=[];for(const r of t)r.name!==".gitkeep"&&(l.push({node:r,depth:n}),r.kind==="directory"&&r.children.length>0&&e.has(r.path)&&l.push(...Xl(r.children,e,n+1)));return l}function Po(t){return t.split(`
|
|
1
|
+
import{r as k,aM as ys,c as R,l as ae,j as s,J as ws,i as js,B as Y,K as se,k as me,ac as yn,D as Ve,m as Ft,t as ce,ae as ks,G as Ss,e as zs,b as wn,u as jn,E as $t}from"./index-Cw1_akCN.js";import{i as Ns}from"./ChevronRight-CQ6qJi_4.js";import{a as Cs,s as kn}from"./Eye-EQZNVaju.js";import{n as qe,i as pt}from"./Globe01-BCZ4MJ9r.js";import{b as $s,c as Ps,e as Es,i as Ds,f as Sn,a as _t,g as Ts,h as Ms,d as Os}from"./ZoomOut-B1lM_F9T.js";import{a as ct}from"./Palette-CNyx15J3.js";import{s as As}from"./Plus-K9-3Y3av.js";import{i as Rs}from"./SearchLg-DNsRNxo9.js";import{t as Is}from"./Stars01-D7uKNdAz.js";import{i as dt}from"./Upload01-De93EmfO.js";import{s as zn}from"./XClose-Bhi6uXp9.js";import{i as Ut}from"./Zap-qEJPKDHk.js";import{u as Nn}from"./use-mobile-BEMk8YZy.js";import{f as Ls,a as Fs,b as _s,c as Us,d as Bs,e as Hs,A as qs,g as Ws}from"./alert-dialog-769FAsUD.js";import{c as Cn,a as Le,d as Xe,e as Qe,f as $n,b as Ks,D as Gs}from"./dialog-CPwF731q.js";import{I as We}from"./input-DLr6JHGJ.js";import{S as oe}from"./skeleton-BbyhTtn8.js";import{F as we,M as Bt,d as Pn}from"./file-type-icon-CZT8Q3fZ.js";import{T as Vs}from"./toolbar-L97y_brf.js";import{u as Xs}from"./use-debounced-value-pSAE8gPb.js";import{i as En,f as Dn,j as Qs,d as Tn,e as Ys,a as Ye,u as At,k as Ht,l as Zs,b as Js,m as Mn,n as el}from"./use-org-fs-sAfsYw1V.js";import{i as xt}from"./DotsVertical-CxSK3DNF.js";import{i as On}from"./Key01-x0kqMuez.js";import{s as gt}from"./Trash01-CkOiGHv0.js";import{D as Ze,a as Je,b as et,c as pe}from"./dropdown-menu-CRzlYZec.js";import{T as tl}from"./textarea-BbsMd9WU.js";import{t as nl}from"./ChevronDown-C7iCpNd7.js";import{i as sl,n as ll}from"./ChevronUp-BtpDIyFt.js";import{i as ut}from"./X-B7BrDYoR.js";import{a as rl,P as il,b as ol}from"./popover-B-zFyk2E.js";import{T as xe,a as ge,b as be}from"./tooltip-DQJ-jcPk.js";import{n as An}from"./LinkExternal01-Ct3eSohN.js";import{l as al,F as cl}from"./index-D0PVVLS2.js";import{i as dl}from"./LayoutLeft-gtZ98pdB.js";const bt=k.createContext(null);bt.displayName="PanelGroupContext";const ne={group:"data-panel-group",groupDirection:"data-panel-group-direction",groupId:"data-panel-group-id",panel:"data-panel",panelCollapsible:"data-panel-collapsible",panelId:"data-panel-id",panelSize:"data-panel-size",resizeHandle:"data-resize-handle",resizeHandleActive:"data-resize-handle-active",resizeHandleEnabled:"data-panel-resize-handle-enabled",resizeHandleId:"data-panel-resize-handle-id",resizeHandleState:"data-resize-handle-state"},qt=10,Ee=k.useLayoutEffect,en=ys.useId,ul=typeof en=="function"?en:()=>null;let fl=0;function Wt(t=null){const e=ul(),n=k.useRef(t||e||null);return n.current===null&&(n.current=""+fl++),t??n.current}function Rn({children:t,className:e="",collapsedSize:n,collapsible:l,defaultSize:r,forwardedRef:i,id:o,maxSize:a,minSize:c,onCollapse:d,onExpand:f,onResize:u,order:m,style:h,tagName:p="div",...g}){const y=k.useContext(bt);if(y===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:x,expandPanel:b,getPanelSize:j,getPanelStyle:z,groupId:N,isPanelCollapsed:C,reevaluatePanelConstraints:w,registerPanel:M,resizePanel:O,unregisterPanel:T}=y,v=Wt(o),$=k.useRef({callbacks:{onCollapse:d,onExpand:f,onResize:u},constraints:{collapsedSize:n,collapsible:l,defaultSize:r,maxSize:a,minSize:c},id:v,idIsFromProps:o!==void 0,order:m});k.useRef({didLogMissingDefaultSizeWarning:!1}),Ee(()=>{const{callbacks:F,constraints:_}=$.current,B={..._};$.current.id=v,$.current.idIsFromProps=o!==void 0,$.current.order=m,F.onCollapse=d,F.onExpand=f,F.onResize=u,_.collapsedSize=n,_.collapsible=l,_.defaultSize=r,_.maxSize=a,_.minSize=c,(B.collapsedSize!==_.collapsedSize||B.collapsible!==_.collapsible||B.maxSize!==_.maxSize||B.minSize!==_.minSize)&&w($.current,B)}),Ee(()=>{const F=$.current;return M(F),()=>{T(F)}},[m,v,M,T]),k.useImperativeHandle(i,()=>({collapse:()=>{x($.current)},expand:F=>{b($.current,F)},getId(){return v},getSize(){return j($.current)},isCollapsed(){return C($.current)},isExpanded(){return!C($.current)},resize:F=>{O($.current,F)}}),[x,b,j,C,v,O]);const K=z($.current,r);return k.createElement(p,{...g,children:t,className:e,id:v,style:{...K,...h},[ne.groupId]:N,[ne.panel]:"",[ne.panelCollapsible]:l||void 0,[ne.panelId]:v,[ne.panelSize]:parseFloat(""+K.flexGrow).toFixed(1)})}const In=k.forwardRef((t,e)=>k.createElement(Rn,{...t,forwardedRef:e}));Rn.displayName="Panel";In.displayName="forwardRef(Panel)";let Rt=null,at=-1,Se=null;function ml(t,e){if(e){const n=(e&Bn)!==0,l=(e&Hn)!==0,r=(e&qn)!==0,i=(e&Wn)!==0;if(n)return r?"se-resize":i?"ne-resize":"e-resize";if(l)return r?"sw-resize":i?"nw-resize":"w-resize";if(r)return"s-resize";if(i)return"n-resize"}switch(t){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function hl(){Se!==null&&(document.head.removeChild(Se),Rt=null,Se=null,at=-1)}function Pt(t,e){var n,l;const r=ml(t,e);if(Rt!==r){if(Rt=r,Se===null&&(Se=document.createElement("style"),document.head.appendChild(Se)),at>=0){var i;(i=Se.sheet)===null||i===void 0||i.removeRule(at)}at=(n=(l=Se.sheet)===null||l===void 0?void 0:l.insertRule(`*{cursor: ${r} !important;}`))!==null&&n!==void 0?n:-1}}function Ln(t){return t.type==="keydown"}function Fn(t){return t.type.startsWith("pointer")}function _n(t){return t.type.startsWith("mouse")}function vt(t){if(Fn(t)){if(t.isPrimary)return{x:t.clientX,y:t.clientY}}else if(_n(t))return{x:t.clientX,y:t.clientY};return{x:1/0,y:1/0}}function pl(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function xl(t,e,n){return t.x<e.x+e.width&&t.x+t.width>e.x&&t.y<e.y+e.height&&t.y+t.height>e.y}function gl(t,e){if(t===e)throw new Error("Cannot compare node with itself");const n={a:sn(t),b:sn(e)};let l;for(;n.a.at(-1)===n.b.at(-1);)t=n.a.pop(),e=n.b.pop(),l=t;V(l,"Stacking order can only be calculated for elements with a common ancestor");const r={a:nn(tn(n.a)),b:nn(tn(n.b))};if(r.a===r.b){const i=l.childNodes,o={a:n.a.at(-1),b:n.b.at(-1)};let a=i.length;for(;a--;){const c=i[a];if(c===o.a)return 1;if(c===o.b)return-1}}return Math.sign(r.a-r.b)}const bl=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function vl(t){var e;const n=getComputedStyle((e=Un(t))!==null&&e!==void 0?e:t).display;return n==="flex"||n==="inline-flex"}function yl(t){const e=getComputedStyle(t);return!!(e.position==="fixed"||e.zIndex!=="auto"&&(e.position!=="static"||vl(t))||+e.opacity<1||"transform"in e&&e.transform!=="none"||"webkitTransform"in e&&e.webkitTransform!=="none"||"mixBlendMode"in e&&e.mixBlendMode!=="normal"||"filter"in e&&e.filter!=="none"||"webkitFilter"in e&&e.webkitFilter!=="none"||"isolation"in e&&e.isolation==="isolate"||bl.test(e.willChange)||e.webkitOverflowScrolling==="touch")}function tn(t){let e=t.length;for(;e--;){const n=t[e];if(V(n,"Missing node"),yl(n))return n}return null}function nn(t){return t&&Number(getComputedStyle(t).zIndex)||0}function sn(t){const e=[];for(;t;)e.push(t),t=Un(t);return e}function Un(t){const{parentNode:e}=t;return e&&e instanceof ShadowRoot?e.host:e}const Bn=1,Hn=2,qn=4,Wn=8,wl=pl()==="coarse";let fe=[],Ie=!1,Pe=new Map,yt=new Map;const Ke=new Set;function jl(t,e,n,l,r){var i;const{ownerDocument:o}=e,a={direction:n,element:e,hitAreaMargins:l,setResizeHandlerState:r},c=(i=Pe.get(o))!==null&&i!==void 0?i:0;return Pe.set(o,c+1),Ke.add(a),ft(),function(){var f;yt.delete(t),Ke.delete(a);const u=(f=Pe.get(o))!==null&&f!==void 0?f:1;if(Pe.set(o,u-1),ft(),u===1&&Pe.delete(o),fe.includes(a)){const m=fe.indexOf(a);m>=0&&fe.splice(m,1),Gt(),r("up",!0,null)}}}function kl(t){const{target:e}=t,{x:n,y:l}=vt(t);Ie=!0,Kt({target:e,x:n,y:l}),ft(),fe.length>0&&(mt("down",t),t.preventDefault(),Kn(e)||t.stopImmediatePropagation())}function Et(t){const{x:e,y:n}=vt(t);if(Ie&&t.buttons===0&&(Ie=!1,mt("up",t)),!Ie){const{target:l}=t;Kt({target:l,x:e,y:n})}mt("move",t),Gt(),fe.length>0&&t.preventDefault()}function Dt(t){const{target:e}=t,{x:n,y:l}=vt(t);yt.clear(),Ie=!1,fe.length>0&&(t.preventDefault(),Kn(e)||t.stopImmediatePropagation()),mt("up",t),Kt({target:e,x:n,y:l}),Gt(),ft()}function Kn(t){let e=t;for(;e;){if(e.hasAttribute(ne.resizeHandle))return!0;e=e.parentElement}return!1}function Kt({target:t,x:e,y:n}){fe.splice(0);let l=null;(t instanceof HTMLElement||t instanceof SVGElement)&&(l=t),Ke.forEach(r=>{const{element:i,hitAreaMargins:o}=r,a=i.getBoundingClientRect(),{bottom:c,left:d,right:f,top:u}=a,m=wl?o.coarse:o.fine;if(e>=d-m&&e<=f+m&&n>=u-m&&n<=c+m){if(l!==null&&document.contains(l)&&i!==l&&!i.contains(l)&&!l.contains(i)&&gl(l,i)>0){let p=l,g=!1;for(;p&&!p.contains(i);){if(xl(p.getBoundingClientRect(),a)){g=!0;break}p=p.parentElement}if(g)return}fe.push(r)}})}function Tt(t,e){yt.set(t,e)}function Gt(){let t=!1,e=!1;fe.forEach(l=>{const{direction:r}=l;r==="horizontal"?t=!0:e=!0});let n=0;yt.forEach(l=>{n|=l}),t&&e?Pt("intersection",n):t?Pt("horizontal",n):e?Pt("vertical",n):hl()}let Mt=new AbortController;function ft(){Mt.abort(),Mt=new AbortController;const t={capture:!0,signal:Mt.signal};Ke.size&&(Ie?(fe.length>0&&Pe.forEach((e,n)=>{const{body:l}=n;e>0&&(l.addEventListener("contextmenu",Dt,t),l.addEventListener("pointerleave",Et,t),l.addEventListener("pointermove",Et,t))}),window.addEventListener("pointerup",Dt,t),window.addEventListener("pointercancel",Dt,t)):Pe.forEach((e,n)=>{const{body:l}=n;e>0&&(l.addEventListener("pointerdown",kl,t),l.addEventListener("pointermove",Et,t))}))}function mt(t,e){Ke.forEach(n=>{const{setResizeHandlerState:l}=n,r=fe.includes(n);l(t,r,e)})}function Sl(){const[t,e]=k.useState(0);return k.useCallback(()=>e(n=>n+1),[])}function V(t,e){if(!t)throw console.error(e),Error(e)}function De(t,e,n=qt){return t.toFixed(n)===e.toFixed(n)?0:t>e?1:-1}function ve(t,e,n=qt){return De(t,e,n)===0}function ue(t,e,n){return De(t,e,n)===0}function zl(t,e,n){if(t.length!==e.length)return!1;for(let l=0;l<t.length;l++){const r=t[l],i=e[l];if(!ue(r,i,n))return!1}return!0}function Re({panelConstraints:t,panelIndex:e,size:n}){const l=t[e];V(l!=null,`Panel constraints not found for index ${e}`);let{collapsedSize:r=0,collapsible:i,maxSize:o=100,minSize:a=0}=l;if(De(n,a)<0)if(i){const c=(r+a)/2;De(n,c)<0?n=r:n=a}else n=a;return n=Math.min(o,n),n=parseFloat(n.toFixed(qt)),n}function _e({delta:t,initialLayout:e,panelConstraints:n,pivotIndices:l,prevLayout:r,trigger:i}){if(ue(t,0))return e;const o=[...e],[a,c]=l;V(a!=null,"Invalid first pivot index"),V(c!=null,"Invalid second pivot index");let d=0;if(i==="keyboard"){{const u=t<0?c:a,m=n[u];V(m,`Panel constraints not found for index ${u}`);const{collapsedSize:h=0,collapsible:p,minSize:g=0}=m;if(p){const y=e[u];if(V(y!=null,`Previous layout not found for panel index ${u}`),ue(y,h)){const x=g-y;De(x,Math.abs(t))>0&&(t=t<0?0-x:x)}}}{const u=t<0?a:c,m=n[u];V(m,`No panel constraints found for index ${u}`);const{collapsedSize:h=0,collapsible:p,minSize:g=0}=m;if(p){const y=e[u];if(V(y!=null,`Previous layout not found for panel index ${u}`),ue(y,g)){const x=y-h;De(x,Math.abs(t))>0&&(t=t<0?0-x:x)}}}}{const u=t<0?1:-1;let m=t<0?c:a,h=0;for(;;){const g=e[m];V(g!=null,`Previous layout not found for panel index ${m}`);const x=Re({panelConstraints:n,panelIndex:m,size:100})-g;if(h+=x,m+=u,m<0||m>=n.length)break}const p=Math.min(Math.abs(t),Math.abs(h));t=t<0?0-p:p}{let m=t<0?a:c;for(;m>=0&&m<n.length;){const h=Math.abs(t)-Math.abs(d),p=e[m];V(p!=null,`Previous layout not found for panel index ${m}`);const g=p-h,y=Re({panelConstraints:n,panelIndex:m,size:g});if(!ue(p,y)&&(d+=p-y,o[m]=y,d.toPrecision(3).localeCompare(Math.abs(t).toPrecision(3),void 0,{numeric:!0})>=0))break;t<0?m--:m++}}if(zl(r,o))return r;{const u=t<0?c:a,m=e[u];V(m!=null,`Previous layout not found for panel index ${u}`);const h=m+d,p=Re({panelConstraints:n,panelIndex:u,size:h});if(o[u]=p,!ue(p,h)){let g=h-p,x=t<0?c:a;for(;x>=0&&x<n.length;){const b=o[x];V(b!=null,`Previous layout not found for panel index ${x}`);const j=b+g,z=Re({panelConstraints:n,panelIndex:x,size:j});if(ue(b,z)||(g-=z-b,o[x]=z),ue(g,0))break;t>0?x--:x++}}}const f=o.reduce((u,m)=>m+u,0);return ue(f,100)?o:r}function Nl({layout:t,panelsArray:e,pivotIndices:n}){let l=0,r=100,i=0,o=0;const a=n[0];V(a!=null,"No pivot index found"),e.forEach((u,m)=>{const{constraints:h}=u,{maxSize:p=100,minSize:g=0}=h;m===a?(l=g,r=p):(i+=g,o+=p)});const c=Math.min(r,100-i),d=Math.max(l,100-o),f=t[a];return{valueMax:c,valueMin:d,valueNow:f}}function Ge(t,e=document){return Array.from(e.querySelectorAll(`[${ne.resizeHandleId}][data-panel-group-id="${t}"]`))}function Gn(t,e,n=document){const r=Ge(t,n).findIndex(i=>i.getAttribute(ne.resizeHandleId)===e);return r??null}function Vn(t,e,n){const l=Gn(t,e,n);return l!=null?[l,l+1]:[-1,-1]}function Xn(t,e=document){var n;if(e instanceof HTMLElement&&(e==null||(n=e.dataset)===null||n===void 0?void 0:n.panelGroupId)==t)return e;const l=e.querySelector(`[data-panel-group][data-panel-group-id="${t}"]`);return l||null}function wt(t,e=document){const n=e.querySelector(`[${ne.resizeHandleId}="${t}"]`);return n||null}function Cl(t,e,n,l=document){var r,i,o,a;const c=wt(e,l),d=Ge(t,l),f=c?d.indexOf(c):-1,u=(r=(i=n[f])===null||i===void 0?void 0:i.id)!==null&&r!==void 0?r:null,m=(o=(a=n[f+1])===null||a===void 0?void 0:a.id)!==null&&o!==void 0?o:null;return[u,m]}function $l({committedValuesRef:t,eagerValuesRef:e,groupId:n,layout:l,panelDataArray:r,panelGroupElement:i,setLayout:o}){k.useRef({didWarnAboutMissingResizeHandle:!1}),Ee(()=>{if(!i)return;const a=Ge(n,i);for(let c=0;c<r.length-1;c++){const{valueMax:d,valueMin:f,valueNow:u}=Nl({layout:l,panelsArray:r,pivotIndices:[c,c+1]}),m=a[c];if(m!=null){const h=r[c];V(h,`No panel data found for index "${c}"`),m.setAttribute("aria-controls",h.id),m.setAttribute("aria-valuemax",""+Math.round(d)),m.setAttribute("aria-valuemin",""+Math.round(f)),m.setAttribute("aria-valuenow",u!=null?""+Math.round(u):"")}}return()=>{a.forEach((c,d)=>{c.removeAttribute("aria-controls"),c.removeAttribute("aria-valuemax"),c.removeAttribute("aria-valuemin"),c.removeAttribute("aria-valuenow")})}},[n,l,r,i]),k.useEffect(()=>{if(!i)return;const a=e.current;V(a,"Eager values not found");const{panelDataArray:c}=a,d=Xn(n,i);V(d!=null,`No group found for id "${n}"`);const f=Ge(n,i);V(f,`No resize handles found for group id "${n}"`);const u=f.map(m=>{const h=m.getAttribute(ne.resizeHandleId);V(h,"Resize handle element has no handle id attribute");const[p,g]=Cl(n,h,c,i);if(p==null||g==null)return()=>{};const y=x=>{if(!x.defaultPrevented)switch(x.key){case"Enter":{x.preventDefault();const b=c.findIndex(j=>j.id===p);if(b>=0){const j=c[b];V(j,`No panel data found for index ${b}`);const z=l[b],{collapsedSize:N=0,collapsible:C,minSize:w=0}=j.constraints;if(z!=null&&C){const M=_e({delta:ue(z,N)?w-N:N-z,initialLayout:l,panelConstraints:c.map(O=>O.constraints),pivotIndices:Vn(n,h,i),prevLayout:l,trigger:"keyboard"});l!==M&&o(M)}}break}}};return m.addEventListener("keydown",y),()=>{m.removeEventListener("keydown",y)}});return()=>{u.forEach(m=>m())}},[i,t,e,n,l,r,o])}function ln(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function Qn(t,e){const n=t==="horizontal",{x:l,y:r}=vt(e);return n?l:r}function Pl(t,e,n,l,r){const i=n==="horizontal",o=wt(e,r);V(o,`No resize handle element found for id "${e}"`);const a=o.getAttribute(ne.groupId);V(a,"Resize handle element has no group id attribute");let{initialCursorPosition:c}=l;const d=Qn(n,t),f=Xn(a,r);V(f,`No group element found for id "${a}"`);const u=f.getBoundingClientRect(),m=i?u.width:u.height;return(d-c)/m*100}function El(t,e,n,l,r,i){if(Ln(t)){const o=n==="horizontal";let a=0;t.shiftKey?a=100:r!=null?a=r:a=10;let c=0;switch(t.key){case"ArrowDown":c=o?0:a;break;case"ArrowLeft":c=o?-a:0;break;case"ArrowRight":c=o?a:0;break;case"ArrowUp":c=o?0:-a;break;case"End":c=100;break;case"Home":c=-100;break}return c}else return l==null?0:Pl(t,e,n,l,i)}function Dl({panelDataArray:t}){const e=Array(t.length),n=t.map(i=>i.constraints);let l=0,r=100;for(let i=0;i<t.length;i++){const o=n[i];V(o,`Panel constraints not found for index ${i}`);const{defaultSize:a}=o;a!=null&&(l++,e[i]=a,r-=a)}for(let i=0;i<t.length;i++){const o=n[i];V(o,`Panel constraints not found for index ${i}`);const{defaultSize:a}=o;if(a!=null)continue;const c=t.length-l,d=r/c;l++,e[i]=d,r-=d}return e}function Te(t,e,n){e.forEach((l,r)=>{const i=t[r];V(i,`Panel data not found for index ${r}`);const{callbacks:o,constraints:a,id:c}=i,{collapsedSize:d=0,collapsible:f}=a,u=n[c];if(u==null||l!==u){n[c]=l;const{onCollapse:m,onExpand:h,onResize:p}=o;p&&p(l,u),f&&(m||h)&&(h&&(u==null||ve(u,d))&&!ve(l,d)&&h(),m&&(u==null||!ve(u,d))&&ve(l,d)&&m())}})}function ot(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!=e[n])return!1;return!0}function Tl({defaultSize:t,dragState:e,layout:n,panelData:l,panelIndex:r,precision:i=3}){const o=n[r];let a;return o==null?a=t!=null?t.toPrecision(i):"1":l.length===1?a="1":a=o.toPrecision(i),{flexBasis:0,flexGrow:a,flexShrink:1,overflow:"hidden",pointerEvents:e!==null?"none":void 0}}function Ml(t,e=10){let n=null;return(...r)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{t(...r)},e)}}function rn(t){try{if(typeof localStorage<"u")t.getItem=e=>localStorage.getItem(e),t.setItem=(e,n)=>{localStorage.setItem(e,n)};else throw new Error("localStorage not supported in this environment")}catch(e){console.error(e),t.getItem=()=>null,t.setItem=()=>{}}}function Yn(t){return`react-resizable-panels:${t}`}function Zn(t){return t.map(e=>{const{constraints:n,id:l,idIsFromProps:r,order:i}=e;return r?l:i?`${i}:${JSON.stringify(n)}`:JSON.stringify(n)}).sort((e,n)=>e.localeCompare(n)).join(",")}function Jn(t,e){try{const n=Yn(t),l=e.getItem(n);if(l){const r=JSON.parse(l);if(typeof r=="object"&&r!=null)return r}}catch{}return null}function Ol(t,e,n){var l,r;const i=(l=Jn(t,n))!==null&&l!==void 0?l:{},o=Zn(e);return(r=i[o])!==null&&r!==void 0?r:null}function Al(t,e,n,l,r){var i;const o=Yn(t),a=Zn(e),c=(i=Jn(t,r))!==null&&i!==void 0?i:{};c[a]={expandToSizes:Object.fromEntries(n.entries()),layout:l};try{r.setItem(o,JSON.stringify(c))}catch(d){console.error(d)}}function on({layout:t,panelConstraints:e}){const n=[...t],l=n.reduce((i,o)=>i+o,0);if(n.length!==e.length)throw Error(`Invalid ${e.length} panel layout: ${n.map(i=>`${i}%`).join(", ")}`);if(!ue(l,100)&&n.length>0)for(let i=0;i<e.length;i++){const o=n[i];V(o!=null,`No layout data found for index ${i}`);const a=100/l*o;n[i]=a}let r=0;for(let i=0;i<e.length;i++){const o=n[i];V(o!=null,`No layout data found for index ${i}`);const a=Re({panelConstraints:e,panelIndex:i,size:o});o!=a&&(r+=o-a,n[i]=a)}if(!ue(r,0))for(let i=0;i<e.length;i++){const o=n[i];V(o!=null,`No layout data found for index ${i}`);const a=o+r,c=Re({panelConstraints:e,panelIndex:i,size:a});if(o!==c&&(r-=c-o,n[i]=c,ue(r,0)))break}return n}const Rl=100,Ue={getItem:t=>(rn(Ue),Ue.getItem(t)),setItem:(t,e)=>{rn(Ue),Ue.setItem(t,e)}},an={};function es({autoSaveId:t=null,children:e,className:n="",direction:l,forwardedRef:r,id:i=null,onLayout:o=null,keyboardResizeBy:a=null,storage:c=Ue,style:d,tagName:f="div",...u}){const m=Wt(i),h=k.useRef(null),[p,g]=k.useState(null),[y,x]=k.useState([]),b=Sl(),j=k.useRef({}),z=k.useRef(new Map),N=k.useRef(0),C=k.useRef({autoSaveId:t,direction:l,dragState:p,id:m,keyboardResizeBy:a,onLayout:o,storage:c}),w=k.useRef({layout:y,panelDataArray:[],panelDataArrayChanged:!1});k.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),k.useImperativeHandle(r,()=>({getId:()=>C.current.id,getLayout:()=>{const{layout:S}=w.current;return S},setLayout:S=>{const{onLayout:I}=C.current,{layout:L,panelDataArray:U}=w.current,D=on({layout:S,panelConstraints:U.map(H=>H.constraints)});ln(L,D)||(x(D),w.current.layout=D,I&&I(D),Te(U,D,j.current))}}),[]),Ee(()=>{C.current.autoSaveId=t,C.current.direction=l,C.current.dragState=p,C.current.id=m,C.current.onLayout=o,C.current.storage=c}),$l({committedValuesRef:C,eagerValuesRef:w,groupId:m,layout:y,panelDataArray:w.current.panelDataArray,setLayout:x,panelGroupElement:h.current}),k.useEffect(()=>{const{panelDataArray:S}=w.current;if(t){if(y.length===0||y.length!==S.length)return;let I=an[t];I==null&&(I=Ml(Al,Rl),an[t]=I);const L=[...S],U=new Map(z.current);I(t,L,U,y,c)}},[t,y,c]),k.useEffect(()=>{});const M=k.useCallback(S=>{const{onLayout:I}=C.current,{layout:L,panelDataArray:U}=w.current;if(S.constraints.collapsible){const D=U.map(de=>de.constraints),{collapsedSize:H=0,panelSize:Q,pivotIndices:ee}=$e(U,S,L);if(V(Q!=null,`Panel size not found for panel "${S.id}"`),!ve(Q,H)){z.current.set(S.id,Q);const P=Oe(U,S)===U.length-1?Q-H:H-Q,X=_e({delta:P,initialLayout:L,panelConstraints:D,pivotIndices:ee,prevLayout:L,trigger:"imperative-api"});ot(L,X)||(x(X),w.current.layout=X,I&&I(X),Te(U,X,j.current))}}},[]),O=k.useCallback((S,I)=>{const{onLayout:L}=C.current,{layout:U,panelDataArray:D}=w.current;if(S.constraints.collapsible){const H=D.map(te=>te.constraints),{collapsedSize:Q=0,panelSize:ee=0,minSize:de=0,pivotIndices:P}=$e(D,S,U),X=I??de;if(ve(ee,Q)){const te=z.current.get(S.id),he=te!=null&&te>=X?te:X,Ne=Oe(D,S)===D.length-1?ee-he:he-ee,ie=_e({delta:Ne,initialLayout:U,panelConstraints:H,pivotIndices:P,prevLayout:U,trigger:"imperative-api"});ot(U,ie)||(x(ie),w.current.layout=ie,L&&L(ie),Te(D,ie,j.current))}}},[]),T=k.useCallback(S=>{const{layout:I,panelDataArray:L}=w.current,{panelSize:U}=$e(L,S,I);return V(U!=null,`Panel size not found for panel "${S.id}"`),U},[]),v=k.useCallback((S,I)=>{const{panelDataArray:L}=w.current,U=Oe(L,S);return Tl({defaultSize:I,dragState:p,layout:y,panelData:L,panelIndex:U})},[p,y]),$=k.useCallback(S=>{const{layout:I,panelDataArray:L}=w.current,{collapsedSize:U=0,collapsible:D,panelSize:H}=$e(L,S,I);return V(H!=null,`Panel size not found for panel "${S.id}"`),D===!0&&ve(H,U)},[]),K=k.useCallback(S=>{const{layout:I,panelDataArray:L}=w.current,{collapsedSize:U=0,collapsible:D,panelSize:H}=$e(L,S,I);return V(H!=null,`Panel size not found for panel "${S.id}"`),!D||De(H,U)>0},[]),F=k.useCallback(S=>{const{panelDataArray:I}=w.current;I.push(S),I.sort((L,U)=>{const D=L.order,H=U.order;return D==null&&H==null?0:D==null?-1:H==null?1:D-H}),w.current.panelDataArrayChanged=!0,b()},[b]);Ee(()=>{if(w.current.panelDataArrayChanged){w.current.panelDataArrayChanged=!1;const{autoSaveId:S,onLayout:I,storage:L}=C.current,{layout:U,panelDataArray:D}=w.current;let H=null;if(S){const ee=Ol(S,D,L);ee&&(z.current=new Map(Object.entries(ee.expandToSizes)),H=ee.layout)}H==null&&(H=Dl({panelDataArray:D}));const Q=on({layout:H,panelConstraints:D.map(ee=>ee.constraints)});ln(U,Q)||(x(Q),w.current.layout=Q,I&&I(Q),Te(D,Q,j.current))}}),Ee(()=>{const S=w.current;return()=>{S.layout=[]}},[]);const _=k.useCallback(S=>{let I=!1;const L=h.current;return L&&window.getComputedStyle(L,null).getPropertyValue("direction")==="rtl"&&(I=!0),function(D){D.preventDefault();const H=h.current;if(!H)return()=>null;const{direction:Q,dragState:ee,id:de,keyboardResizeBy:P,onLayout:X}=C.current,{layout:te,panelDataArray:he}=w.current,{initialLayout:je}=ee??{},Ne=Vn(de,S,H);let ie=El(D,S,Q,ee,P,H);const lt=Q==="horizontal";lt&&I&&(ie=-ie);const Nt=he.map(Ct=>Ct.constraints),Ce=_e({delta:ie,initialLayout:je??te,panelConstraints:Nt,pivotIndices:Ne,prevLayout:te,trigger:Ln(D)?"keyboard":"mouse-or-touch"}),rt=!ot(te,Ce);(Fn(D)||_n(D))&&N.current!=ie&&(N.current=ie,!rt&&ie!==0?lt?Tt(S,ie<0?Bn:Hn):Tt(S,ie<0?qn:Wn):Tt(S,0)),rt&&(x(Ce),w.current.layout=Ce,X&&X(Ce),Te(he,Ce,j.current))}},[]),B=k.useCallback((S,I)=>{const{onLayout:L}=C.current,{layout:U,panelDataArray:D}=w.current,H=D.map(te=>te.constraints),{panelSize:Q,pivotIndices:ee}=$e(D,S,U);V(Q!=null,`Panel size not found for panel "${S.id}"`);const P=Oe(D,S)===D.length-1?Q-I:I-Q,X=_e({delta:P,initialLayout:U,panelConstraints:H,pivotIndices:ee,prevLayout:U,trigger:"imperative-api"});ot(U,X)||(x(X),w.current.layout=X,L&&L(X),Te(D,X,j.current))},[]),G=k.useCallback((S,I)=>{const{layout:L,panelDataArray:U}=w.current,{collapsedSize:D=0,collapsible:H}=I,{collapsedSize:Q=0,collapsible:ee,maxSize:de=100,minSize:P=0}=S.constraints,{panelSize:X}=$e(U,S,L);X!=null&&(H&&ee&&ve(X,D)?ve(D,Q)||B(S,Q):X<P?B(S,P):X>de&&B(S,de))},[B]),q=k.useCallback((S,I)=>{const{direction:L}=C.current,{layout:U}=w.current;if(!h.current)return;const D=wt(S,h.current);V(D,`Drag handle element not found for id "${S}"`);const H=Qn(L,I);g({dragHandleId:S,dragHandleRect:D.getBoundingClientRect(),initialCursorPosition:H,initialLayout:U})},[]),J=k.useCallback(()=>{g(null)},[]),Z=k.useCallback(S=>{const{panelDataArray:I}=w.current,L=Oe(I,S);L>=0&&(I.splice(L,1),delete j.current[S.id],w.current.panelDataArrayChanged=!0,b())},[b]),A=k.useMemo(()=>({collapsePanel:M,direction:l,dragState:p,expandPanel:O,getPanelSize:T,getPanelStyle:v,groupId:m,isPanelCollapsed:$,isPanelExpanded:K,reevaluatePanelConstraints:G,registerPanel:F,registerResizeHandle:_,resizePanel:B,startDragging:q,stopDragging:J,unregisterPanel:Z,panelGroupElement:h.current}),[M,p,l,O,T,v,m,$,K,G,F,_,B,q,J,Z]),W={display:"flex",flexDirection:l==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return k.createElement(bt.Provider,{value:A},k.createElement(f,{...u,children:e,className:n,id:i,ref:h,style:{...W,...d},[ne.group]:"",[ne.groupDirection]:l,[ne.groupId]:m}))}const ts=k.forwardRef((t,e)=>k.createElement(es,{...t,forwardedRef:e}));es.displayName="PanelGroup";ts.displayName="forwardRef(PanelGroup)";function Oe(t,e){return t.findIndex(n=>n===e||n.id===e.id)}function $e(t,e,n){const l=Oe(t,e),i=l===t.length-1?[l-1,l]:[l,l+1],o=n[l];return{...e.constraints,panelSize:o,pivotIndices:i}}function Il({disabled:t,handleId:e,resizeHandler:n,panelGroupElement:l}){k.useEffect(()=>{if(t||n==null||l==null)return;const r=wt(e,l);if(r==null)return;const i=o=>{if(!o.defaultPrevented)switch(o.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{o.preventDefault(),n(o);break}case"F6":{o.preventDefault();const a=r.getAttribute(ne.groupId);V(a,`No group element found for id "${a}"`);const c=Ge(a,l),d=Gn(a,e,l);V(d!==null,`No resize element found for id "${e}"`);const f=o.shiftKey?d>0?d-1:c.length-1:d+1<c.length?d+1:0;c[f].focus();break}}};return r.addEventListener("keydown",i),()=>{r.removeEventListener("keydown",i)}},[l,t,e,n])}function ns({children:t=null,className:e="",disabled:n=!1,hitAreaMargins:l,id:r,onBlur:i,onClick:o,onDragging:a,onFocus:c,onPointerDown:d,onPointerUp:f,style:u={},tabIndex:m=0,tagName:h="div",...p}){var g,y;const x=k.useRef(null),b=k.useRef({onClick:o,onDragging:a,onPointerDown:d,onPointerUp:f});k.useEffect(()=>{b.current.onClick=o,b.current.onDragging=a,b.current.onPointerDown=d,b.current.onPointerUp=f});const j=k.useContext(bt);if(j===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:z,groupId:N,registerResizeHandle:C,startDragging:w,stopDragging:M,panelGroupElement:O}=j,T=Wt(r),[v,$]=k.useState("inactive"),[K,F]=k.useState(!1),[_,B]=k.useState(null),G=k.useRef({state:v});Ee(()=>{G.current.state=v}),k.useEffect(()=>{if(n)B(null);else{const A=C(T);B(()=>A)}},[n,T,C]);const q=(g=l?.coarse)!==null&&g!==void 0?g:15,J=(y=l?.fine)!==null&&y!==void 0?y:5;k.useEffect(()=>{if(n||_==null)return;const A=x.current;V(A,"Element ref not attached");let W=!1;return jl(T,A,z,{coarse:q,fine:J},(I,L,U)=>{if(!L){$("inactive");return}switch(I){case"down":{$("drag"),W=!1,V(U,'Expected event to be defined for "down" action'),w(T,U);const{onDragging:D,onPointerDown:H}=b.current;D?.(!0),H?.();break}case"move":{const{state:D}=G.current;W=!0,D!=="drag"&&$("hover"),V(U,'Expected event to be defined for "move" action'),_(U);break}case"up":{$("hover"),M();const{onClick:D,onDragging:H,onPointerUp:Q}=b.current;H?.(!1),Q?.(),W||D?.();break}}})},[q,z,n,J,C,T,_,w,M]),Il({disabled:n,handleId:T,resizeHandler:_,panelGroupElement:O});const Z={touchAction:"none",userSelect:"none"};return k.createElement(h,{...p,children:t,className:e,id:r,onBlur:()=>{F(!1),i?.()},onFocus:()=>{F(!0),c?.()},ref:x,role:"separator",style:{...Z,...u},tabIndex:m,[ne.groupDirection]:z,[ne.groupId]:N,[ne.resizeHandle]:"",[ne.resizeHandleActive]:v==="drag"?"pointer":K?"keyboard":void 0,[ne.resizeHandleEnabled]:!n,[ne.resizeHandleId]:T,[ne.resizeHandleState]:v})}ns.displayName="PanelResizeHandle";function Ll(t){const e=R.c(10);let n,l,r;e[0]!==t?({className:n,ref:r,...l}=t,e[0]=t,e[1]=n,e[2]=l,e[3]=r):(n=e[1],l=e[2],r=e[3]);let i;e[4]!==n?(i=ae("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",n),e[4]=n,e[5]=i):i=e[5];let o;return e[6]!==l||e[7]!==r||e[8]!==i?(o=s.jsx(ts,{ref:r,"data-slot":"resizable-panel-group",className:i,...l}),e[6]=l,e[7]=r,e[8]=i,e[9]=o):o=e[9],o}function cn(t){const e=R.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let l;return e[2]!==n?(l=s.jsx(In,{"data-slot":"resizable-panel",...n}),e[2]=n,e[3]=l):l=e[3],l}function Fl(t){const e=R.c(12);let n,l,r;e[0]!==t?({withHandle:r,className:n,...l}=t,e[0]=t,e[1]=n,e[2]=l,e[3]=r):(n=e[1],l=e[2],r=e[3]);let i;e[4]!==n?(i=ae("bg-border focus-visible:ring-ring relative flex w-[0.5px] items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",n),e[4]=n,e[5]=i):i=e[5];let o;e[6]!==r?(o=r&&s.jsx("div",{className:"bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border",children:s.jsx($s,{className:"size-2.5"})}),e[6]=r,e[7]=o):o=e[7];let a;return e[8]!==l||e[9]!==i||e[10]!==o?(a=s.jsx(ns,{"data-slot":"resizable-handle",className:i,...l,children:o}),e[8]=l,e[9]=i,e[10]=o,e[11]=a):a=e[11],a}function _l(t){if(!t||t.includes("\\")||t.includes("..")||t.includes("\0"))return!0;try{const e=decodeURIComponent(t);if(e.includes("\\")||e.includes("..")||e.includes("\0"))return!0;if(e!==t&&e.includes("/")){const n=(t.match(/\//g)??[]).length;if((e.match(/\//g)??[]).length>n)return!0}return!1}catch{return!0}}function Ul(t){if(_l(t))throw new Error(`Invalid block key: ${t||"(empty)"}`)}function Bl(t){try{return decodeURIComponent(t)}catch{return t}}function Hl(t){return Ul(t),encodeURIComponent(t)}function ql(t){return`.deco/blocks/${Hl(t)}.json`}function bo(t){return`/${ql(t)}`}const vo=1e4,Wl=3;function It(t){return t.trim()?(t.startsWith("/")?t:`/${t}`).replace(/\/+/g,"/"):"/"}function Vt(t){return t.startsWith("/")?t.slice(1):t}function ht(t){return t.trim()?t.startsWith("/")?t:`/${t}`:"/"}function Kl(t){const e=ht(t);if(e==="/")return"/";const n=e.split("/").filter(Boolean);return n.pop(),n.length===0?"/":`/${n.join("/")}`}function yo(t,e){const n=e.replace(/^\/+|\/+$/g,"");return ht(n?`${t==="/"?"":t}/${n}`:t)}function wo(t,e){return e==="directory"?t:Kl(t)}function jo(t){const e=t.trim();return e?e.includes("/")||e.includes("\\")||e.includes("..")||e.includes("\0")?"Name cannot contain /, \\, or ..":null:"Name is required"}function Gl(t){const e=Vt(t);return e?e.split("/").filter(Boolean).length:0}function ko(t,e,n,l=!1){return{files:[...new Set([...t,...n.files])],directories:[...new Set([...e,...n.directories??[]])],truncated:l||!!n.truncated}}function So(t,e){return Gl(t)>=Wl&&!e.has(t)}function zo(t,e,n=[]){const l=Vt(t);if(e.includes(l)||n.includes(l))return!0;if(!l)return!1;const r=`${l}/`;return e.some(i=>i.startsWith(r))||n.some(i=>i.startsWith(r))}function No(t){const e=Vt(t),n=".deco/blocks/";if(!e.startsWith(n)||!e.endsWith(".json"))return null;const l=e.slice(n.length,-5);return Bl(l)}function Vl(t){if(!t)return"plaintext";const e=t.toLowerCase();return e.endsWith(".tsx")||e.endsWith(".ts")?"typescript":e.endsWith(".jsx")||e.endsWith(".js")||e.endsWith(".mjs")||e.endsWith(".cjs")?"javascript":e.endsWith(".json")?"json":e.endsWith(".md")||e.endsWith(".mdx")?"markdown":e.endsWith(".css")?"css":e.endsWith(".scss")?"scss":e.endsWith(".html")?"html":e.endsWith(".yaml")||e.endsWith(".yml")?"yaml":e.endsWith(".xml")||e.endsWith(".svg")?"xml":e.endsWith(".py")?"python":e.endsWith(".sql")?"sql":e.endsWith(".sh")?"shell":"plaintext"}function Co(t){const e=It(t).split("/").filter(Boolean),n=["/"];let l="";for(const r of e.slice(0,-1))l+=`/${r}`,n.push(l);return n}function $o(t,e=[]){const n={children:[]},l=i=>{const a=It(i).split("/").filter(Boolean);let c=n,d="";for(const f of a){d+=`/${f}`;let u=c.children.find(m=>m.name===f);u?u.kind==="file"&&(u.kind="directory"):(u={name:f,path:d,kind:"directory",children:[]},c.children.push(u)),c=u}};for(const i of t){const a=It(i).split("/").filter(Boolean);let c=n,d="";a.forEach((f,u)=>{d+=`/${f}`;const m=u===a.length-1;let h=c.children.find(p=>p.name===f);h||(h={name:f,path:d,kind:m?"file":"directory",children:[]},c.children.push(h)),c=h})}for(const i of e)l(ht(i));const r=i=>{i.sort((o,a)=>o.kind!==a.kind?o.kind==="directory"?-1:1:o.name.localeCompare(a.name));for(const o of i)o.children.length>0&&r(o.children)};return r(n.children),n.children}function Xl(t,e,n=0){const l=[];for(const r of t)r.name!==".gitkeep"&&(l.push({node:r,depth:n}),r.kind==="directory"&&r.children.length>0&&e.has(r.path)&&l.push(...Xl(r.children,e,n+1)));return l}function Po(t){return t.split(`
|
|
2
2
|
`).map(e=>{const n=e.match(/^\d+\t(.*)/);return n?n[1]:e}).join(`
|
|
3
3
|
`)}al.config({paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.0/min/vs"}});function Ql(t){const e=R.c(11),{value:n,filename:l}=t,[r]=ws(),i=r.theme==="dark"||r.theme==="system"&&typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches;let o;e[0]!==l?(o=Vl(l),e[0]=l,e[1]=o):o=e[1];const a=i?"vs-dark":"light";let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx("div",{className:"flex h-full w-full items-center justify-center",children:s.jsx(js,{size:20,className:"animate-spin text-muted-foreground"})}),e[2]=c):c=e[2];let d,f;e[3]===Symbol.for("react.memo_cache_sentinel")?(d={enabled:!1},f={top:12,bottom:12},e[3]=d,e[4]=f):(d=e[3],f=e[4]);let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u={readOnly:!0,domReadOnly:!0,fontSize:13,scrollBeyondLastLine:!1,automaticLayout:!0,lineNumbersMinChars:3,wordWrap:"on",minimap:d,padding:f,renderLineHighlight:"none",scrollbar:{vertical:"auto",horizontal:"auto",verticalScrollbarSize:8,horizontalScrollbarSize:8}},e[5]=u):u=e[5];let m;return e[6]!==l||e[7]!==o||e[8]!==a||e[9]!==n?(m=s.jsx(cl,{path:l,language:o,value:n,theme:a,loading:c,options:u},l),e[6]=l,e[7]=o,e[8]=a,e[9]=n,e[10]=m):m=e[10],m}function ss(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}const Yl=new Set(["png","jpg","jpeg","gif","webp","svg","avif"]),Zl=new Set(["txt","json","csv","tsv","log","yaml","yml","xml","toml","ts","tsx","js","jsx","py","rb","go","rs","java","sh","sql"]),dn=2*1024*1024;function Jl(t,e){const n=t.split(".").pop()?.toLowerCase()??"";return Yl.has(n)?"image":n==="pdf"?"pdf":n==="html"||n==="htm"?"html":n==="md"||n==="markdown"?e<=dn?"markdown":"download":Zl.has(n)&&e<=dn?"text":"download"}function ls(){const t=R.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(oe,{className:"h-6 w-2/3"}),t[0]=e):e=t[0];let n;return t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("div",{className:"flex h-full w-full items-center justify-center",children:s.jsxs("div",{className:"flex w-3/4 max-w-md flex-col gap-3 p-6",children:[e,s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(oe,{className:"h-3 w-full"}),s.jsx(oe,{className:"h-3 w-5/6"}),s.jsx(oe,{className:"h-3 w-2/3"})]})]})}),t[1]=n):n=t[1],n}function rs(t){const e=R.c(20),{file:n,note:l}=t;let r;e[0]!==n.filename?(r=s.jsx(we,{filename:n.filename,className:"h-12 w-10"}),e[0]=n.filename,e[1]=r):r=e[1];let i;e[2]!==n.filename?(i=s.jsx("span",{className:"text-sm font-medium text-foreground",children:n.filename}),e[2]=n.filename,e[3]=i):i=e[3];let o;e[4]!==n.size?(o=ss(n.size),e[4]=n.size,e[5]=o):o=e[5];const a=l?` · ${l}`:"";let c;e[6]!==o||e[7]!==a?(c=s.jsxs("span",{className:"text-xs text-muted-foreground",children:[o,a]}),e[6]=o,e[7]=a,e[8]=c):c=e[8];let d;e[9]!==i||e[10]!==c?(d=s.jsxs("div",{className:"flex flex-col items-center gap-0.5",children:[i,c]}),e[9]=i,e[10]=c,e[11]=d):d=e[11];let f;e[12]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(qe,{size:14}),e[12]=f):f=e[12];let u;e[13]!==n.downloadUrl||e[14]!==n.filename?(u=s.jsx(Y,{asChild:!0,variant:"outline",size:"sm",children:s.jsxs("a",{href:n.downloadUrl,download:n.filename,children:[f,"Download"]})}),e[13]=n.downloadUrl,e[14]=n.filename,e[15]=u):u=e[15];let m;return e[16]!==r||e[17]!==d||e[18]!==u?(m=s.jsx("div",{className:"flex h-full w-full items-center justify-center",children:s.jsxs("div",{className:"flex flex-col items-center gap-3 rounded-xl border border-border bg-muted/30 px-10 py-8",children:[r,d,u]})}),e[16]=r,e[17]=d,e[18]=u,e[19]=m):m=e[19],m}function un(t){const e=R.c(16),{file:n,markdown:l}=t;let r;e[0]!==n.downloadUrl?(r=se.fileText(n.downloadUrl),e[0]=n.downloadUrl,e[1]=r):r=e[1];let i;e[2]!==n.downloadUrl?(i=async()=>{const u=await fetch(n.downloadUrl,{credentials:"include"});if(!u.ok)throw new Error(`fetch failed: ${u.status}`);return u.text()},e[2]=n.downloadUrl,e[3]=i):i=e[3];let o;e[4]!==r||e[5]!==i?(o={queryKey:r,queryFn:i,staleTime:6e4,retry:!1},e[4]=r,e[5]=i,e[6]=o):o=e[6];const{data:a,isPending:c,isError:d}=me(o);if(c){let u;return e[7]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(ls,{}),e[7]=u):u=e[7],u}if(d||a===void 0){let u;return e[8]!==n?(u=s.jsx(rs,{file:n,note:"preview unavailable"}),e[8]=n,e[9]=u):u=e[9],u}if(l){const u=`file-preview-${n.key}`;let m;return e[10]!==a||e[11]!==u?(m=s.jsx("div",{className:"h-full overflow-y-auto",children:s.jsx("div",{className:"prose prose-sm dark:prose-invert mx-auto max-w-3xl px-6 py-6",children:s.jsx(Bt,{id:u,text:a})})}),e[10]=a,e[11]=u,e[12]=m):m=e[12],m}let f;return e[13]!==a||e[14]!==n.filename?(f=s.jsx(Ql,{value:a,filename:n.filename}),e[13]=a,e[14]=n.filename,e[15]=f):f=e[15],f}function is(t){const e=R.c(15),{file:n}=t;switch(Jl(n.filename,n.size)){case"image":{let r;return e[0]!==n.downloadUrl||e[1]!==n.filename?(r=s.jsx("div",{className:"flex h-full w-full items-center justify-center overflow-auto bg-muted/30 p-4",children:s.jsx("img",{src:n.downloadUrl,alt:n.filename,className:"max-h-full max-w-full rounded-lg object-contain"})}),e[0]=n.downloadUrl,e[1]=n.filename,e[2]=r):r=e[2],r}case"pdf":{let r;return e[3]!==n.downloadUrl||e[4]!==n.filename?(r=s.jsx("iframe",{src:n.downloadUrl,title:n.filename,className:"block h-full w-full bg-white"}),e[3]=n.downloadUrl,e[4]=n.filename,e[5]=r):r=e[5],r}case"html":{let r;return e[6]!==n.downloadUrl||e[7]!==n.filename?(r=s.jsx("iframe",{src:n.downloadUrl,title:n.filename,sandbox:"allow-scripts",className:"block h-full w-full bg-white"}),e[6]=n.downloadUrl,e[7]=n.filename,e[8]=r):r=e[8],r}case"markdown":{let r;return e[9]!==n?(r=s.jsx(un,{file:n,markdown:!0}),e[9]=n,e[10]=r):r=e[10],r}case"text":{let r;return e[11]!==n?(r=s.jsx(un,{file:n,markdown:!1}),e[11]=n,e[12]=r):r=e[12],r}default:{let r;return e[13]!==n?(r=s.jsx(rs,{file:n}),e[13]=n,e[14]=r):r=e[14],r}}}function er(t){const e=R.c(40),{readUrl:n,editor:l,downloadName:r,trailing:i}=t;let o;e[0]!==n?(o=new URL(n,window.location.origin).toString(),e[0]=n,e[1]=o):o=e[1];const a=o;let c;e[2]!==l?(c=l.deckDetected&&s.jsxs(xe,{children:[s.jsx(ge,{asChild:!0,children:s.jsx(Y,{variant:l.railOpen?"secondary":"ghost",size:"icon","aria-label":l.railOpen?"Hide slide list":"Show slide list",onClick:()=>l.setRailOpen(!l.railOpen),children:s.jsx(dl,{size:14})})}),s.jsx(be,{side:"bottom",children:l.railOpen?"Hide slide list":"Show slide list"})]}),e[2]=l,e[3]=c):c=e[3];let d;e[4]!==a?(d=()=>window.open(a,"_blank","noopener"),e[4]=a,e[5]=d):d=e[5];let f;e[6]!==a?(f=s.jsx("span",{className:"truncate",children:a}),e[6]=a,e[7]=f):f=e[7];let u;e[8]!==a||e[9]!==d||e[10]!==f?(u=s.jsx("button",{type:"button",onClick:d,className:"flex min-w-0 flex-1 items-center rounded-md px-2 py-1 text-left text-xs text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",title:a,children:f}),e[8]=a,e[9]=d,e[10]=f,e[11]=u):u=e[11];let m;e[12]!==l.agentUpdated||e[13]!==l.reload?(m=l.agentUpdated&&s.jsxs(xe,{children:[s.jsx(ge,{asChild:!0,children:s.jsxs(Y,{variant:"outline",size:"sm",className:"h-7 gap-1 text-xs",onClick:l.reload,children:[s.jsx(yn,{size:12}),"Agent updated — reload"]})}),s.jsx(be,{side:"bottom",children:"The agent rewrote this deck while you were editing. Reloading discards unsaved differences."})]}),e[12]=l.agentUpdated,e[13]=l.reload,e[14]=m):m=e[14];let h;e[15]!==l.saving?(h=l.saving&&s.jsx("span",{className:"px-1 text-xs text-muted-foreground",children:"Saving…"}),e[15]=l.saving,e[16]=h):h=e[16];let p;e[17]!==l?(p=l.deckDetected&&l.writable&&s.jsxs(xe,{children:[s.jsx(ge,{asChild:!0,children:s.jsx(Y,{variant:l.editMode?"secondary":"ghost",size:"icon","aria-label":l.editMode?"Done editing":"Edit inline",className:ae(l.editMode&&"text-primary"),onClick:()=>l.setEditMode(!l.editMode),children:s.jsx(Ps,{size:14})})}),s.jsx(be,{side:"bottom",children:l.editMode?"Done editing":"Edit inline (text, reorder, delete)"})]}),e[17]=l,e[18]=p):p=e[18];let g;e[19]!==a||e[20]!==r||e[21]!==l.deckDetected?(g=l.deckDetected?s.jsxs(Ze,{children:[s.jsx(Je,{asChild:!0,children:s.jsx(Y,{variant:"ghost",size:"icon","aria-label":"Download",children:s.jsx(qe,{size:14})})}),s.jsxs(et,{align:"end",children:[s.jsxs(pe,{onClick:()=>window.open(`${a}#print`,"_blank","noopener"),children:[s.jsx(Es,{size:14}),"Export as PDF"]}),s.jsx(pe,{asChild:!0,children:s.jsxs("a",{href:a,download:r,children:[s.jsx(Ds,{size:14}),"Download HTML"]})})]})]}):s.jsxs(xe,{children:[s.jsx(ge,{asChild:!0,children:s.jsx(Y,{variant:"ghost",size:"icon","aria-label":"Download",asChild:!0,children:s.jsx("a",{href:a,download:r,children:s.jsx(qe,{size:14})})})}),s.jsx(be,{side:"bottom",children:"Download"})]}),e[19]=a,e[20]=r,e[21]=l.deckDetected,e[22]=g):g=e[22];let y;e[23]!==a?(y=()=>window.open(a,"_blank","noopener"),e[23]=a,e[24]=y):y=e[24];let x;e[25]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(An,{size:14}),e[25]=x):x=e[25];let b;e[26]!==y?(b=s.jsx(ge,{asChild:!0,children:s.jsx(Y,{variant:"ghost",size:"icon","aria-label":"Open in new tab",onClick:y,children:x})}),e[26]=y,e[27]=b):b=e[27];let j;e[28]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(be,{side:"bottom",children:"Open in new tab"}),e[28]=j):j=e[28];let z;e[29]!==b?(z=s.jsxs(xe,{children:[b,j]}),e[29]=b,e[30]=z):z=e[30];let N;return e[31]!==z||e[32]!==c||e[33]!==u||e[34]!==m||e[35]!==h||e[36]!==p||e[37]!==g||e[38]!==i?(N=s.jsxs("div",{className:"flex h-9 shrink-0 items-center gap-1 border-b border-border/60 px-2",children:[c,u,m,h,p,g,z,i]}),e[31]=z,e[32]=c,e[33]=u,e[34]=m,e[35]=h,e[36]=p,e[37]=g,e[38]=i,e[39]=N):N=e[39],N}const Ae=1;function tr(t){if(typeof t!="object"||t===null||t.v!==Ae||t.source!=="deck-viewer")return null;const e=t;return e.type==="ready"||e.type==="state"||e.type==="op"&&typeof e.opId=="string"&&e.op?e:null}class ke extends Error{constructor(e,n){super(e),this.code=n,this.name="DeckOpError"}code}function os(t){return[...t.children].filter(e=>!/^(TEMPLATE|SCRIPT|STYLE)$/.test(e.tagName))}function nr(t){const n=new DOMParser().parseFromString(t,"text/html").querySelector("deck-viewer");return n?os(n).length:null}function sr(t,e){const n=new DOMParser().parseFromString(t,"text/html"),l=n.querySelector("deck-viewer");if(!l)throw new ke("no <deck-viewer> element in source","no-viewer");const r=os(l),i=e.kind==="move"?e.from:e.at,o=r[i];if(!o)throw new ke(`slide index ${i} out of range (${r.length})`,"stale-index");switch(e.kind){case"remove":{if(r.length<=1)throw new ke("cannot remove the last slide","bad-op");o.remove();break}case"duplicate":{const c=o.cloneNode(!0);c.removeAttribute("id");for(const d of c.querySelectorAll("[id]"))d.removeAttribute("id");o.after(c);break}case"move":{if(e.to<0||e.to>=r.length)throw new ke(`move target ${e.to} out of range`,"stale-index");if(e.to!==e.from){const c=e.to<e.from?r[e.to]:r[e.to].nextSibling;l.insertBefore(o,c)}break}case"set-attr":{if(!/^[a-zA-Z][\w-]*$/.test(e.name))throw new ke(`invalid attribute name: ${e.name}`,"bad-op");o.setAttribute(e.name,e.value);break}case"remove-attr":{o.removeAttribute(e.name);break}case"replace":{const d=new DOMParser().parseFromString(e.html,"text/html").body.firstElementChild;if(!d)throw new ke("replace html has no root element","bad-op");o.replaceWith(n.importNode(d,!0));break}default:throw new ke(`unknown op kind: ${e.kind}`,"bad-op")}return`${t.trimStart().toLowerCase().startsWith("<!doctype")?`<!DOCTYPE html>
|
|
4
4
|
`:""}${n.documentElement.outerHTML}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as k,j as n,r as $,D as J,m as xe,l as Q,i as le,an as Z,t as U,K as te,k as se,B as Y,d as st,a6 as nt,E as it,a as ot}from"./index-Btu8MJ2T.js";import{u as ge}from"./use-mobile-ClQdwqdV.js";import{u as rt}from"./useSuspenseQueries-Blox8E_y.js";import{i as lt,u as ae,m as at,a as ct,S as dt}from"./use-mcp-client-gLPXhZwB.js";import{u as mt,b as ut,v as ft,a as pt}from"./use-virtual-mcp-cFiSNo55.js";import{i as ht}from"./ChevronUp-C_lc_o3g.js";import{i as xt,A as ce,t as gt,ae as yt,F as bt,j as jt}from"./agent-icon-B8eeNtuV.js";import{s as ye}from"./Plus-CVGVCEWD.js";import{i as $e}from"./X-CKh7IqmP.js";import{C as oe}from"./index-CveNYzWA.js";import{b as vt}from"./chat-context-o6OHcwaz.js";import{N as Nt}from"./decopilot-BAd_1NUv.js";import{g as wt,a as Ae,b as re,K as Pe,P as Ee,D as Me,c as St,S as _t,v as Ct,d as It,C as Tt,s as kt,l as $t,k as At,o as Pt,u as Et,j as Mt,h as zt}from"./sortable.esm-CPwrTvNQ.js";import{u as ze,a as Oe,o as Ot}from"./use-organization-settings-sdfsJyHP.js";import{c as be,b as Lt,h as Dt}from"./shell-layout-DBLgWYru.js";import{I as Le}from"./input-4Ev3FmKy.js";import{S as Ht,t as je,P as Rt,j as Ft,s as Ut,g as Bt}from"./scroll-area-DBKWSV0V.js";import{S as Vt,a as Kt,b as Wt,c as qt,d as Gt}from"./sheet-BuVYCl7W.js";import{S as H}from"./skeleton-BgNQclTb.js";import{t as De}from"./ChevronDown-DWQLUoqf.js";import{b as He}from"./ZoomOut-DT2MdREq.js";import{g as Re,M as Qt}from"./types-CJ1piLtD.js";import{I as Fe}from"./integration-icon-eUjgo-Wa.js";import{a as Jt,b as Xt,c as Zt,d as we,S as Yt}from"./select-DsygRtM0.js";import{T as es}from"./textarea-DhaBNVNU.js";import{u as Ue}from"./studio-tools-B50CVfWQ.js";import{a as ts}from"./use-mcp-tools-BuZcYJRN.js";import{i as ss}from"./XCircle-ChyNg6J4.js";import{f as ns}from"./tab-id-AX1D_RMI.js";import{g as is}from"./use-mcp-prompts-DlvK4PCy.js";import{u as os,w as rs}from"./hooks-DxOSHTpN.js";import{a as ls,g as as,c as cs,b as ds,D as ms}from"./dropdown-menu-DA0Umn63.js";import{s as us}from"./Trash01-Bg4qQ-BB.js";import{a as fs,u as ps}from"./use-ai-providers-CDUvzgtf.js";import{u as hs}from"./connect-desktop-dialog-ZFUlmIw8.js";import{T as xs}from"./toolbar-ChXNrWyq.js";import"./auth-CVcuabTS.js";import"./use-collections-DVgsseNJ.js";import"./AlertCircle-Dc2EW1Xh.js";import"./Tool01-l_q8HUGI.js";import"./SwitchHorizontal01-CiBRgm5I.js";import"./Settings02-BPbjqaSP.js";import"./ArrowUpRight-CQzCYQdd.js";import"./ZapSquare-C9wtQq17.js";import"./Users03-D6kZFOjC.js";import"./CheckCircle-Co8-96Va.js";import"./ChevronRight-Fl5MZFE5.js";import"./DotsVertical-Bj73amJ1.js";import"./Stars02-_7e7vEGZ.js";import"./Eye-Cbxk_9w_.js";import"./Globe01-DWTVb7Un.js";import"./FilterLines-BYUFwc91.js";import"./Star01-Coh-d_en.js";import"./Globe04-CDxhXYra.js";import"./HardDrive-BMXxrd-5.js";import"./Key01-DE0qpETa.js";import"./LayoutLeft-D_an0z1y.js";import"./LinkExternal01-CkYnR-pE.js";import"./Monitor01-CwPbYng2.js";import"./Sun-Bkd03ipa.js";import"./Palette-D_MNr8c_.js";import"./Play-BSsk9TRT.js";import"./SearchLg-C6-0dWFV.js";import"./SearchMd-B5gWQzhi.js";import"./Shield01-JA8ffipF.js";import"./Stars01-BNO0I13-.js";import"./Upload01-DXs8XkD-.js";import"./User01-B-8LArOe.js";import"./Users01-BKqcv_gF.js";import"./XClose-DOOHZ1iM.js";import"./Zap-CGzacH_p.js";import"./tooltip--hLULyB8.js";import"./dialog-D_71fLjl.js";import"./drawer-DodsaUcg.js";import"./collection-search-EKDGBBWD.js";import"./form-DM2r8X1h.js";import"./label-gN8KznQ2.js";import"./tabs-BtMboBYf.js";import"./toggle-group-CUlLZ0WG.js";import"./popover-HVRs71J_.js";import"./command-BdMByUYO.js";import"./index-CMq-PrAu.js";import"./useInfiniteQuery-DRF-obNO.js";import"./use-infinite-scroll-D2_Ok7--.js";import"./use-org-fs-DEr-WdtP.js";import"./question-004-sINsf4GQ.js";import"./use-decopilot-events-vuxyqGzO.js";import"./decopilot-sse-pool-D9bCmaFi.js";import"./backoff-CrEUbyZT.js";import"./checkbox-C8lYmD-I.js";import"./ai-providers-logos-DD3qZ33J.js";import"./avatar-ClJplFDb.js";import"./settings-section-BDyOfwm9.js";import"./card-B4nOjxjh.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-DXxeWgUJ.js";import"./use-registry-connections-zKZuukaQ.js";import"./use-connection-eth2XC-k.js";import"./extract-connection-data-Dr1KuD3e.js";import"./collection-tabs-B4rLoGfk.js";import"./badge-kG1ciDHg.js";import"./connection-form-helpers-DPNIJhMB.js";import"./authenticate-and-persist-oauth-B6YIi7Gy.js";import"./mcp-oauth-Cc5rkXEa.js";import"./useSuspenseInfiniteQuery-CxCY-IUG.js";import"./required-auth-layout-BHT7ZfwS.js";import"./use-org-sso-D7xmv0-O.js";import"./use-clock-tick-CrebkY9T.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-Pbq9Qj8M.js";import"./file-type-icon-B-idWQER.js";import"./content-blocks-o63cs2vh.js";import"./use-navigate-to-agent-BiR_hnuj.js";import"./delay-CnY5UFtP.js";function Be(t){const e=k.c(11),{properties:s,required:o,values:i,onChange:r}=t;let a;e[0]!==o?(a=o??[],e[0]=o,e[1]=a):a=e[1];let d;e[2]!==a?(d=new Set(a),e[2]=a,e[3]=d):d=e[3];const l=d;let m;e[4]!==s?(m=Object.entries(s),e[4]=s,e[5]=m):m=e[5];let c;return e[6]!==r||e[7]!==l||e[8]!==m||e[9]!==i?(c=n.jsx("div",{className:"flex flex-col gap-2",children:m.map(u=>{const[f,p]=u;return n.jsxs("div",{className:"flex flex-col gap-0.5",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("label",{className:"text-xs font-medium leading-none flex items-center gap-1",children:[f,l.has(f)&&n.jsx("span",{className:"text-red-500 text-[10px]",children:"*"})]}),n.jsx("span",{className:"text-[10px] text-muted-foreground font-mono",children:p.type})]}),p.description&&n.jsx("p",{className:"text-[10px] text-muted-foreground leading-snug",children:p.description}),n.jsx(gs,{type:p.type,fieldKey:f,value:i[f],onChange:h=>r(f,h)})]},f)})}),e[6]=r,e[7]=l,e[8]=m,e[9]=i,e[10]=c):c=e[10],c}function gs(t){const e=k.c(19),{type:s,fieldKey:o,value:i,onChange:r}=t;if(s==="object"||s==="array"){const c=i??"";let u;e[0]!==r?(u=h=>r(h.target.value),e[0]=r,e[1]=u):u=e[1];const f=`Enter ${o} as JSON…`;let p;return e[2]!==c||e[3]!==u||e[4]!==f?(p=n.jsx(es,{className:"font-mono text-xs h-16",value:c,onChange:u,placeholder:f,rows:2}),e[2]=c,e[3]=u,e[4]=f,e[5]=p):p=e[5],p}if(s==="boolean"){const c=i!=null?String(i):"";let u;e[6]!==r?(u=x=>r(x==="true"),e[6]=r,e[7]=u):u=e[7];let f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(Jt,{className:"h-7 text-xs",children:n.jsx(Xt,{placeholder:"Select…"})}),e[8]=f):f=e[8];let p;e[9]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsxs(Zt,{children:[n.jsx(we,{value:"true",children:"true"}),n.jsx(we,{value:"false",children:"false"})]}),e[9]=p):p=e[9];let h;return e[10]!==c||e[11]!==u?(h=n.jsxs(Yt,{value:c,onValueChange:u,children:[f,p]}),e[10]=c,e[11]=u,e[12]=h):h=e[12],h}const a=i??"";let d;e[13]!==r?(d=c=>r(c.target.value),e[13]=r,e[14]=d):d=e[14];const l=`Enter ${o}…`;let m;return e[15]!==a||e[16]!==d||e[17]!==l?(m=n.jsx(Le,{className:"h-7 text-xs",value:a,onChange:d,placeholder:l}),e[15]=a,e[16]=d,e[17]=l,e[18]=m):m=e[18],m}const ne=8;function ys(t){const e=k.c(16),{open:s,onOpenChange:o}=t,[i,r]=$.useState("");let a,d;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(Vt,{children:"Manage home"}),d=n.jsx(Kt,{children:"Add agents to the home board and pin their interactive UIs or prompts."}),e[0]=a,e[1]=d):(a=e[0],d=e[1]);let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(xt,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none","aria-hidden":!0}),e[2]=l):l=e[2];let m;e[3]===Symbol.for("react.memo_cache_sentinel")?(m=x=>r(x.target.value),e[3]=m):m=e[3];let c;e[4]!==i?(c=n.jsxs(Wt,{className:"px-5 py-4 border-b border-border",children:[a,d,n.jsxs("div",{className:"relative mt-3",children:[l,n.jsx(Le,{value:i,onChange:m,placeholder:"Search agents…",className:"pl-8 h-8 text-sm"})]})]}),e[4]=i,e[5]=c):c=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(Gs,{}),e[6]=u):u=e[6];let f;e[7]!==i?(f=n.jsx(Ht,{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(js,{search:i})})})}),e[7]=i,e[8]=f):f=e[8];let p;e[9]!==c||e[10]!==f?(p=n.jsxs(qt,{side:"right",className:"w-full sm:max-w-md p-0 flex flex-col",children:[c,f]}),e[9]=c,e[10]=f,e[11]=p):p=e[11];let h;return e[12]!==o||e[13]!==s||e[14]!==p?(h=n.jsx(Gt,{open:s,onOpenChange:o,children:p}),e[12]=o,e[13]=s,e[14]=p,e[15]=h):h=e[15],h}function bs(t){const e=k.c(32),{org:s}=J(),o=ze();let i;e[0]!==o?.ids?(i=o?.ids??[],e[0]=o?.ids,e[1]=i):i=e[1];const r=i,a=Oe(),d=ut(),l=xe();let m;e[2]!==s||e[3]!==l?(m=()=>l.refetchQueries({queryKey:te.homeNextActions(s.slug),type:"active"}),e[2]=s,e[3]=l,e[4]=m):m=e[4];const c=m;let u;e[5]!==r?(u=_=>r.includes(_),e[5]=r,e[6]=u):u=e[6];const f=u;let p;e[7]!==r||e[8]!==t?(p=t?r.filter(_=>t.has(_)).length:r.length,e[7]=r,e[8]=t,e[9]=p):p=e[9];const x=p>=ne;let y;e[10]!==x||e[11]!==f||e[12]!==a?(y=_=>f(_)||x?Promise.resolve():a.apply(I=>I.includes(_)?null:[...I,_]),e[10]=x,e[11]=f,e[12]=a,e[13]=y):y=e[13];const b=y;let v;e[14]!==a?(v=_=>a.apply(I=>I.filter(T=>T!==_)),e[14]=a,e[15]=v):v=e[15];const N=v;let j;e[16]!==a?(j=_=>a.apply(()=>_),e[16]=a,e[17]=j):j=e[17];const g=j;let w;e[18]!==d||e[19]!==x||e[20]!==f||e[21]!==c||e[22]!==a?(w=async(_,I)=>{await d.update.mutateAsync({id:_.id,data:{metadata:I}}),!f(_.id)&&!x&&await a.apply(T=>T.includes(_.id)?null:[...T,_.id]),await c()},e[18]=d,e[19]=x,e[20]=f,e[21]=c,e[22]=a,e[23]=w):w=e[23];const S=w;let C;return e[24]!==b||e[25]!==x||e[26]!==r||e[27]!==f||e[28]!==N||e[29]!==g||e[30]!==S?(C={homeIds:r,isOnHome:f,atLimit:x,addAgent:b,removeAgent:N,reorder:g,saveAgentMetadata:S},e[24]=b,e[25]=x,e[26]=r,e[27]=f,e[28]=N,e[29]=g,e[30]=S,e[31]=C):C=e[31],C}function js(t){const e=k.c(21),{search:s}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={pageSize:1e3},e[0]=o):o=e[0];const i=mt(o);let r;e[1]!==i?(r=new Set(i.map(_s)),e[1]=i,e[2]=r):r=e[2];const a=bs(r);let d,l,m;if(e[3]!==i||e[4]!==a||e[5]!==s){const x=new Map(i.map(Ss));d=s.trim().toLowerCase();const y=N=>!d||N.title?.toLowerCase().includes(d);l=a.homeIds.map(N=>x.get(N)).filter(ws).filter(y);const b=wt(i);let v;e[9]!==a?(v=N=>!a.isOnHome(N.id),e[9]=a,e[10]=v):v=e[10],m=i.filter(Ns).filter(N=>!b.has(N.id)).filter(v).filter(y).sort(vs),e[3]=i,e[4]=a,e[5]=s,e[6]=d,e[7]=l,e[8]=m}else d=e[6],l=e[7],m=e[8];const c=m;let u;e[11]!==a||e[12]!==l?(u=n.jsx(Cs,{home:a,agents:l}),e[11]=a,e[12]=l,e[13]=u):u=e[13];const f=!!d;let p;e[14]!==c||e[15]!==a||e[16]!==f?(p=n.jsx(ks,{home:a,agents:c,hasSearch:f}),e[14]=c,e[15]=a,e[16]=f,e[17]=p):p=e[17];let h;return e[18]!==u||e[19]!==p?(h=n.jsxs(n.Fragment,{children:[u,p]}),e[18]=u,e[19]=p,e[20]=h):h=e[20],h}function vs(t,e){return(t.title??"").localeCompare(e.title??"")}function Ns(t){return t.id&&!lt(t.id)}function ws(t){return!!t}function Ss(t){return[t.id,t]}function _s(t){return t.id}function Ve(t){const e=k.c(7),{title:s,hint:o}=t;let i;e[0]!==s?(i=n.jsx("span",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:s}),e[0]=s,e[1]=i):i=e[1];let r;e[2]!==o?(r=o&&n.jsx("span",{className:"text-xs text-muted-foreground",children:o}),e[2]=o,e[3]=r):r=e[3];let a;return e[4]!==i||e[5]!==r?(a=n.jsxs("div",{className:"flex items-center justify-between px-1",children:[i,r]}),e[4]=i,e[5]=r,e[6]=a):a=e[6],a}function Cs(t){const e=k.c(14),{home:s,agents:o}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={activationConstraint:{distance:5}},e[0]=i):i=e[0];let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r={coordinateGetter:kt},e[1]=r):r=e[1];const a=Ae(re(Ee,i),re(Pe,r));let d;e[2]!==s?(d=p=>{const{active:h,over:x}=p;if(!x||h.id===x.id)return;const y=s.homeIds,b=y.indexOf(h.id),v=y.indexOf(x.id);b===-1||v===-1||s.reorder($t([...y],b,v)).catch(Ts)},e[2]=s,e[3]=d):d=e[3];const l=d,m=`${s.homeIds.length}/${ne}`;let c;e[4]!==m?(c=n.jsx(Ve,{title:"On home",hint:m}),e[4]=m,e[5]=c):c=e[5];let u;e[6]!==o||e[7]!==l||e[8]!==s||e[9]!==a?(u=o.length===0?n.jsx("p",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:"No agents on the home yet."}):n.jsx(Me,{sensors:a,collisionDetection:St,onDragEnd:l,children:n.jsx(_t,{items:o.map(Is),strategy:Ct,children:n.jsx("div",{className:"flex flex-col gap-1",children:o.map(p=>n.jsx(As,{agent:p,home:s},p.id))})})}),e[6]=o,e[7]=l,e[8]=s,e[9]=a,e[10]=u):u=e[10];let f;return e[11]!==c||e[12]!==u?(f=n.jsxs("div",{className:"flex flex-col gap-1.5",children:[c,u]}),e[11]=c,e[12]=u,e[13]=f):f=e[13],f}function Is(t){return t.id}function Ts(){return U.error("Couldn't reorder home — please try again.")}function ks(t){const e=k.c(6),{home:s,agents:o,hasSearch:i}=t,[r,a]=$.useState(20);let d;if(e[0]!==o||e[1]!==i||e[2]!==s||e[3]!==r){const l=o.slice(0,r);let m;e[5]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(Ve,{title:"Add to home"}),e[5]=m):m=e[5],d=n.jsxs("div",{className:"flex flex-col gap-1.5",children:[m,o.length===0?n.jsx("p",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:i?"No agents match.":"Every agent is on the home."}):n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"flex flex-col gap-1",children:l.map(c=>n.jsx(Ms,{agent:c,home:s},c.id))}),o.length>r&&n.jsxs("button",{type:"button",onClick:()=>a($s),className:"mt-1 self-center rounded-md px-3 py-1.5 text-xs text-muted-foreground hover:bg-accent/40 hover:text-foreground",children:["Load more (",o.length-r,")"]})]})]}),e[0]=o,e[1]=i,e[2]=s,e[3]=r,e[4]=d}else d=e[4];return d}function $s(t){return t+20}function Ke(t){const e=Z(t.metadata?.ui).filter(r=>!!r.resourceUri).length,s=t.metadata?.ui?.homePrompts,o=Array.isArray(s)?s.length:null,i=[];return e>0&&i.push(`${e} tile${e===1?"":"s"}`),o!==null&&o>0&&i.push(`${o} prompt${o===1?"":"s"}`),o===0&&i.push("prompts off"),i.join(" · ")}function As(t){const e=k.c(57),{agent:s,home:o}=t,[i,r]=$.useState(!1);let a;e[0]!==s.id?(a={id:s.id},e[0]=s.id,e[1]=a):a=e[1];const{attributes:d,listeners:l,setNodeRef:m,transform:c,transition:u,isDragging:f}=It(a),p=Ke(s)||"Quick access";let h;e[2]!==c?(h=Tt.Transform.toString(c),e[2]=c,e[3]=h):h=e[3];const x=f?.5:void 0,y=f?100:void 0;let b;e[4]!==h||e[5]!==x||e[6]!==y||e[7]!==u?(b={transform:h,transition:u,opacity:x,zIndex:y},e[4]=h,e[5]=x,e[6]=y,e[7]=u,e[8]=b):b=e[8];const v=b,N=f&&"shadow-lg";let j;e[9]!==N?(j=Q("rounded-lg border border-border bg-card",N),e[9]=N,e[10]=j):j=e[10];const g=`Drag to reorder ${s.title??s.id}`;let w;e[11]===Symbol.for("react.memo_cache_sentinel")?(w=n.jsx(He,{size:14}),e[11]=w):w=e[11];let S;e[12]!==d||e[13]!==l||e[14]!==g?(S=n.jsx("button",{type:"button",...d,...l,className:"shrink-0 text-muted-foreground hover:text-foreground cursor-grab active:cursor-grabbing outline-none focus-visible:ring-2 focus-visible:ring-ring rounded","aria-label":g,children:w}),e[12]=d,e[13]=l,e[14]=g,e[15]=S):S=e[15];let C;e[16]===Symbol.for("react.memo_cache_sentinel")?(C=()=>r(Es),e[16]=C):C=e[16];const _=s.title??s.id;let I;e[17]!==s.icon||e[18]!==_?(I=n.jsx(ce,{icon:s.icon,name:_,size:"sm"}),e[17]=s.icon,e[18]=_,e[19]=I):I=e[19];const T=s.title??s.id;let P;e[20]!==T?(P=n.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:T}),e[20]=T,e[21]=P):P=e[21];let M;e[22]!==p?(M=n.jsx("div",{className:"truncate text-xs text-muted-foreground",children:p}),e[22]=p,e[23]=M):M=e[23];let z;e[24]!==P||e[25]!==M?(z=n.jsxs("div",{className:"min-w-0 flex-1",children:[P,M]}),e[24]=P,e[25]=M,e[26]=z):z=e[26];const B=i&&"rotate-180";let O;e[27]!==B?(O=Q("shrink-0 text-muted-foreground transition-transform",B),e[27]=B,e[28]=O):O=e[28];let L;e[29]!==O?(L=n.jsx(De,{size:16,className:O}),e[29]=O,e[30]=L):L=e[30];let K;e[31]!==i||e[32]!==I||e[33]!==z||e[34]!==L?(K=n.jsxs("button",{type:"button",onClick:C,className:"flex min-w-0 flex-1 items-center gap-2.5 text-left outline-none","aria-expanded":i,children:[I,z,L]}),e[31]=i,e[32]=I,e[33]=z,e[34]=L,e[35]=K):K=e[35];let A;e[36]!==s.id||e[37]!==o?(A=()=>o.removeAgent(s.id).catch(Ps),e[36]=s.id,e[37]=o,e[38]=A):A=e[38];const V=`Remove ${s.title??s.id} from home`;let D;e[39]===Symbol.for("react.memo_cache_sentinel")?(D=n.jsx($e,{size:14}),e[39]=D):D=e[39];let E;e[40]!==A||e[41]!==V?(E=n.jsx("button",{type:"button",onClick:A,"aria-label":V,title:"Remove from home",className:"shrink-0 inline-flex size-7 items-center justify-center rounded-md text-muted-foreground hover:bg-destructive/10 hover:text-destructive",children:D}),e[40]=A,e[41]=V,e[42]=E):E=e[42];let R;e[43]!==S||e[44]!==K||e[45]!==E?(R=n.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-2.5",children:[S,K,E]}),e[43]=S,e[44]=K,e[45]=E,e[46]=R):R=e[46];let F;e[47]!==s||e[48]!==i||e[49]!==o?(F=i&&n.jsx(We,{agent:s,home:o}),e[47]=s,e[48]=i,e[49]=o,e[50]=F):F=e[50];let q;return e[51]!==m||e[52]!==v||e[53]!==R||e[54]!==F||e[55]!==j?(q=n.jsxs("div",{ref:m,style:v,className:j,children:[R,F]}),e[51]=m,e[52]=v,e[53]=R,e[54]=F,e[55]=j,e[56]=q):q=e[56],q}function Ps(){return U.error("Couldn't remove from home — please try again.")}function Es(t){return!t}function Ms({agent:t,home:e}){const[s,o]=$.useState(!1),[i,r]=$.useState(!1),a=Ke(t),d=async()=>{if(!e.atLimit){r(!0);try{await e.addAgent(t.id)}catch{U.error("Couldn't add to home — please try again.")}finally{r(!1)}}};return n.jsxs("div",{className:"rounded-lg border border-border bg-card",children:[n.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5",children:[n.jsxs("button",{type:"button",onClick:()=>o(l=>!l),className:"flex min-w-0 flex-1 items-center gap-3 text-left outline-none","aria-expanded":s,children:[n.jsx(ce,{icon:t.icon,name:t.title??t.id,size:"sm"}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:t.title??t.id}),a&&n.jsx("div",{className:"truncate text-xs text-muted-foreground",children:a})]}),n.jsx(De,{size:16,className:Q("shrink-0 text-muted-foreground transition-transform",s&&"rotate-180")})]}),n.jsx("button",{type:"button",onClick:d,disabled:i||e.atLimit,"aria-label":"Add to home",title:e.atLimit?`Home is full (${ne}) — remove an agent first`:"Add to home",className:"shrink-0 inline-flex size-7 items-center justify-center rounded-md bg-foreground text-background text-xs hover:opacity-90 disabled:opacity-40 disabled:cursor-not-allowed",children:i?n.jsx(le,{size:12,className:"animate-spin"}):n.jsx(ye,{size:14})})]}),s&&n.jsx(We,{agent:t,home:e})]})}function We(t){const e=k.c(17),{agent:s,home:o}=t,i=s.metadata?.ui;let r;e[0]!==i?(r=Z(i),e[0]=i,e[1]=r):r=e[1];const a=r;let d;e[2]!==s.connections?(d=(s.connections??[]).map(zs).sort(),e[2]=s.connections,e[3]=d):d=e[3];const l=d,m=s.metadata?.ui?.homePrompts;let c;e[4]!==s||e[5]!==l||e[6]!==o||e[7]!==a?(c=n.jsx(Ls,{agent:s,home:o,connectionIds:l,pinnedTiles:a}),e[4]=s,e[5]=l,e[6]=o,e[7]=a,e[8]=c):c=e[8];let u;e[9]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(Os,{}),e[9]=u):u=e[9];const f=m??null;let p;e[10]!==s||e[11]!==o||e[12]!==f?(p=n.jsx($.Suspense,{fallback:u,children:n.jsx(Us,{agent:s,home:o,curated:f})}),e[10]=s,e[11]=o,e[12]=f,e[13]=p):p=e[13];let h;return e[14]!==c||e[15]!==p?(h=n.jsxs("div",{className:"border-t border-border px-3 py-2 flex flex-col gap-3",children:[c,p]}),e[14]=c,e[15]=p,e[16]=h):h=e[16],h}function zs(t){return t.connection_id}function Os(){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 Ls({agent:t,home:e,connectionIds:s,pinnedTiles:o}){const i=Ue(),{data:r,isLoading:a}=se({queryKey:te.projectConnectionDetails(t.id,s),enabled:s.length>0,queryFn:async()=>(await Promise.all(s.map(async u=>{try{const{item:f}=await i.call("COLLECTION_CONNECTIONS_GET",{id:u}),p=(f?.tools??[]).flatMap(h=>{const x=Re(h._meta);return x?[{name:h.name,description:h.description,resourceUri:x,inputSchema:h.inputSchema}]:[]});return{id:u,title:f?.title??u,icon:f?.icon??null,uiTools:p}}catch{return{id:u,title:u,icon:null,uiTools:[]}}}))).filter(u=>u.uiTools.length>0)});if(s.length===0)return null;if(a)return n.jsxs("div",{className:"flex flex-col gap-1 py-0.5",children:[n.jsx(H,{className:"h-7 w-full"}),n.jsx(H,{className:"h-7 w-2/3"})]});if(!r||r.length===0)return null;const d=new Map;for(const c of r)for(const u of c.uiTools)d.set(`${c.id}:${u.name}`,{conn:c,tool:u});const l=c=>{if(c.toolName&&c.connectionId)return d.get(`${c.connectionId}:${c.toolName}`);for(const[,u]of d)if(u.conn.id===c.connectionId&&u.tool.resourceUri===c.resourceUri)return u},m=o.some(c=>!!l(c));return n.jsxs("div",{className:"flex flex-col gap-2",children:[m&&n.jsxs("div",{className:"flex flex-col gap-0.5",children:[n.jsx("span",{className:"text-[10px] font-medium uppercase tracking-wide text-muted-foreground px-2",children:"Pinned tiles"}),o.map(c=>{const u=l(c);return u?n.jsx(Rs,{agent:t,home:e,connection:u.conn,tool:u.tool,tile:c},c.tileId??`${c.connectionId}:${c.resourceUri}:${c.toolName}`):null})]}),n.jsxs("div",{className:"flex flex-col gap-0.5",children:[n.jsx("span",{className:"text-[10px] font-medium uppercase tracking-wide text-muted-foreground px-2",children:"Add tile"}),r.map(c=>c.uiTools.map(u=>n.jsx(Fs,{agent:t,home:e,connection:c,tool:u},`add:${c.id}:${u.name}`)))]})]})}function qe(t,e){const s={};for(const[o,i]of Object.entries(t)){const r=e[o]?.type;if((r==="object"||r==="array")&&typeof i=="string"){if(!i.trim())continue;try{s[o]=JSON.parse(i)}catch{return null}}else if((r==="number"||r==="integer")&&typeof i=="string"){if(!i.trim())continue;s[o]=Number(i)}else i!==""&&i!=null&&(s[o]=i)}return s}function Ds(t,e){if(!t||!e)return{};const s={};for(const[o,i]of Object.entries(t)){const r=e[o]?.type;(r==="object"||r==="array")&&i!=null&&typeof i!="string"?s[o]=JSON.stringify(i,null,2):s[o]=i}return s}function Hs(t){if(!t)return"";const e=Object.entries(t).filter(([,s])=>s!=null&&s!=="");return e.length===0?"":e.slice(0,3).map(([s,o])=>{const i=typeof o=="object"?JSON.stringify(o):String(o);return`${s}=${i.length>20?`${i.slice(0,20)}…`:i}`}).join(", ")}function Rs({agent:t,home:e,connection:s,tool:o,tile:i}){const[r,a]=$.useState(!1),[d,l]=$.useState(!1),m=o.inputSchema?.properties&&Object.keys(o.inputSchema.properties).length>0,[c,u]=$.useState(()=>Ds(i.toolInput,o.inputSchema?.properties)),f=async()=>{a(!0);try{const x=Z(t.metadata?.ui),y=i.tileId?x.filter(v=>v.tileId!==i.tileId):x.filter(v=>v!==i),b={...t.metadata??{},ui:{...t.metadata?.ui??{},homeTile:null,homeTiles:y}};await e.saveAgentMetadata(t,b),l(!1)}catch(x){console.error("[home-tiles] failed to remove tile",x),U.error("Couldn't update home — please try again.")}finally{a(!1)}},p=async()=>{a(!0);try{let x;if(m&&o.inputSchema?.properties){const N=qe(c,o.inputSchema.properties);if(!N){U.error("Invalid JSON in one of the fields — please fix it."),a(!1);return}Object.keys(N).length>0&&(x=N)}const b=Z(t.metadata?.ui).map(N=>(i.tileId?N.tileId===i.tileId:N===i)?{...N,toolInput:x}:N),v={...t.metadata??{},ui:{...t.metadata?.ui??{},homeTile:null,homeTiles:b}};await e.saveAgentMetadata(t,v),l(!1)}catch(x){console.error("[home-tiles] failed to save tile",x),U.error("Couldn't update home — please try again.")}finally{a(!1)}},h=Hs(i.toolInput);return n.jsxs("div",{className:"flex flex-col rounded-md bg-accent/20",children:[n.jsxs("div",{className:"flex items-center gap-2.5 px-2 py-1",children:[n.jsx(Fe,{icon:s.icon,name:s.title,size:"xs"}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("div",{className:"truncate text-sm text-foreground",children:je(o.name)}),h&&n.jsx("div",{className:"truncate text-[10px] text-muted-foreground font-mono",children:h})]}),m&&n.jsx("button",{type:"button",onClick:()=>l(x=>!x),"aria-label":"Configure tile props",title:"Configure tile props",className:"inline-flex size-7 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-accent/60",children:n.jsx(gt,{size:14})}),n.jsx(ve,{isPinned:!0,submitting:r,onClick:f,label:"Remove from home"})]}),d&&m&&o.inputSchema?.properties&&n.jsxs("div",{className:"px-3 pb-2 pt-1 flex flex-col gap-2",children:[n.jsx(Be,{properties:o.inputSchema.properties,required:o.inputSchema.required,values:c,onChange:(x,y)=>u(b=>({...b,[x]:y}))}),n.jsxs("div",{className:"flex items-center gap-2 justify-end",children:[n.jsx(Y,{variant:"ghost",size:"sm",className:"h-7 text-xs",onClick:()=>l(!1),children:"Cancel"}),n.jsx(Y,{size:"sm",className:"h-7 text-xs",disabled:r,onClick:p,children:r?n.jsx(le,{size:12,className:"animate-spin"}):"Save"})]})]})]})}function Fs({agent:t,home:e,connection:s,tool:o}){const[i,r]=$.useState(!1),[a,d]=$.useState(!1),l=o.inputSchema?.properties&&Object.keys(o.inputSchema.properties).length>0,[m,c]=$.useState({}),u=async()=>{if(l&&!a){d(!0);return}if(!e.isOnHome(t.id)&&e.atLimit){U.error(`Home is full (${ne}) — remove an agent first`);return}await f()},f=async()=>{r(!0);try{let p;if(l&&o.inputSchema?.properties){const b=qe(m,o.inputSchema.properties);if(!b){U.error("Invalid JSON in one of the fields — please fix it."),r(!1);return}Object.keys(b).length>0&&(p=b)}const x=[...Z(t.metadata?.ui),{tileId:crypto.randomUUID(),connectionId:s.id,resourceUri:o.resourceUri,toolName:o.name,...p?{toolInput:p}:{}}],y={...t.metadata??{},ui:{...t.metadata?.ui??{},homeTile:null,homeTiles:x}};await e.saveAgentMetadata(t,y),d(!1),c({})}catch(p){console.error("[home-tiles] failed to add tile",p),U.error("Couldn't update home — please try again.")}finally{r(!1)}};return n.jsxs("div",{className:"flex flex-col rounded-md hover:bg-accent/40",children:[n.jsxs("div",{className:"flex items-center gap-2.5 px-2 py-1",children:[n.jsx(Fe,{icon:s.icon,name:s.title,size:"xs"}),n.jsx("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:je(o.name)}),n.jsx(ve,{isPinned:!1,submitting:i,onClick:u,label:"Add to home"})]}),a&&l&&o.inputSchema?.properties&&n.jsxs("div",{className:"px-3 pb-2 pt-1 flex flex-col gap-2",children:[n.jsx(Be,{properties:o.inputSchema.properties,required:o.inputSchema.required,values:m,onChange:(p,h)=>c(x=>({...x,[p]:h}))}),n.jsxs("div",{className:"flex items-center gap-2 justify-end",children:[n.jsx(Y,{variant:"ghost",size:"sm",className:"h-7 text-xs",onClick:()=>{d(!1),c({})},children:"Cancel"}),n.jsx(Y,{size:"sm",className:"h-7 text-xs",disabled:i,onClick:f,children:i?n.jsx(le,{size:12,className:"animate-spin"}):"Pin"})]})]})]})}function ve(t){const e=k.c(11),{isPinned:s,submitting:o,onClick:i,label:r}=t,a=s?"text-muted-foreground hover:bg-destructive/10 hover:text-destructive":"bg-foreground text-background hover:opacity-90";let d;e[0]!==a?(d=Q("inline-flex size-7 shrink-0 items-center justify-center rounded-md text-xs transition-colors disabled:opacity-50 disabled:cursor-progress",a),e[0]=a,e[1]=d):d=e[1];let l;e[2]!==s||e[3]!==o?(l=o?n.jsx(le,{size:12,className:"animate-spin"}):s?n.jsx(yt,{size:14}):n.jsx(ye,{size:14}),e[2]=s,e[3]=o,e[4]=l):l=e[4];let m;return e[5]!==r||e[6]!==i||e[7]!==o||e[8]!==d||e[9]!==l?(m=n.jsx("button",{type:"button",onClick:i,disabled:o,"aria-label":r,title:r,className:d,children:l}),e[5]=r,e[6]=i,e[7]=o,e[8]=d,e[9]=l,e[10]=m):m=e[10],m}function Us(t){const e=k.c(32),{agent:s,home:o,curated:i}=t,{org:r}=J();let a;e[0]!==s.id||e[1]!==r.id||e[2]!==r.slug?(a={connectionId:s.id,orgId:r.id,orgSlug:r.slug},e[0]=s.id,e[1]=r.id,e[2]=r.slug,e[3]=a):a=e[3];const d=ae(a);let l;e[4]!==s.id||e[5]!==r.id?(l=te.agentPrompts(r.id,s.id),e[4]=s.id,e[5]=r.id,e[6]=l):l=e[6];let m;e[7]!==d?(m=async()=>{const{prompts:g}=await d.listPrompts();return g.map(Ws)},e[7]=d,e[8]=m):m=e[8];let c;e[9]!==l||e[10]!==m?(c={queryKey:l,queryFn:m,staleTime:3e4,retry:!1},e[9]=l,e[10]=m,e[11]=c):c=e[11];const{data:u,isLoading:f,error:p}=se(c),h=be(r.slug);let x,y;if(e[12]!==s.id||e[13]!==u||e[14]!==h.prompts){let g;e[17]!==s.id?(g=S=>S.agentId===s.id&&S.promptName,e[17]=s.id,e[18]=g):g=e[18],x=h.prompts.filter(g).map(Ks);let w;e[19]!==u?(w=u??[],e[19]=u,e[20]=w):w=e[20],y=[...w];for(const S of x)y.some(C=>C.name===S.name)||y.push(S);e[12]=s.id,e[13]=u,e[14]=h.prompts,e[15]=x,e[16]=y}else x=e[15],y=e[16];if(f&&x.length===0){let g;return e[21]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx(H,{className:"h-7 w-full"}),n.jsx(H,{className:"h-7 w-2/3"})]}),e[21]=g):g=e[21],g}if(p&&x.length===0)return console.error("[home-tiles] listPrompts failed for agent",s.id,p),null;if(y.length===0)return null;let b;e[22]!==i||e[23]!==y?(b=i??y.map(Vs),e[22]=i,e[23]=y,e[24]=b):b=e[24];let v;e[25]!==b?(v=new Set(b),e[25]=b,e[26]=v):v=e[26];const N=v;let j;return e[27]!==s||e[28]!==o||e[29]!==y||e[30]!==N?(j=n.jsx("div",{className:"flex flex-col gap-0.5",children:y.map(g=>n.jsx(qs,{agent:s,home:o,prompt:g,allPromptNames:y.map(Bs),isPinned:N.has(g.name)},g.name))}),e[27]=s,e[28]=o,e[29]=y,e[30]=N,e[31]=j):j=e[31],j}function Bs(t){return t.name}function Vs(t){return t.name}function Ks(t){return{name:t.promptName,title:t.title,description:t.description}}function Ws(t){return{name:t.name,title:t.title,description:t.description}}function qs({agent:t,home:e,prompt:s,allPromptNames:o,isPinned:i}){const[r,a]=$.useState(!1),d=async()=>{if(!i&&!e.isOnHome(t.id)&&e.atLimit){U.error(`Home is full (${ne}) — remove an agent first`);return}a(!0);try{const l=t.metadata?.ui?.homePrompts;let m;Array.isArray(l)?m=i?l.filter(u=>u!==s.name):[...l,s.name]:m=i?o.filter(u=>u!==s.name):o;const c={...t.metadata??{},ui:{...t.metadata?.ui??{},homePrompts:m}};await e.saveAgentMetadata(t,c)}catch(l){console.error("[home-tiles] failed to toggle prompt",l),U.error("Couldn't update home — please try again.")}finally{a(!1)}};return n.jsxs("div",{className:"flex items-center gap-2.5 rounded-md px-2 py-1 hover:bg-accent/40",children:[n.jsx("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:s.title??je(s.name)}),n.jsx(ve,{isPinned:i,submitting:r,onClick:d,label:i?"Remove from home":"Add to home"})]})}function Gs(){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},Qs)}),t[0]=e):e=t[0],e}function Qs(t,e){return n.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-border p-2.5",children:[n.jsx(H,{className:"size-8 rounded-md"}),n.jsxs("div",{className:"flex-1 space-y-1.5",children:[n.jsx(H,{className:"h-3 w-1/2"}),n.jsx(H,{className:"h-2.5 w-1/3"})]})]},e)}const ee=1,Ge=`home-board.layout.v${ee}`;function Qe(t){return`home-board.layout.v${ee}.${t}`}const Je={version:ee,tiles:{},hidden:[]};function fe(t){return!t||t.version!==ee?Je:{version:ee,tiles:t.tiles??{},hidden:Array.isArray(t.hidden)?t.hidden:[]}}function Js(t){return Object.keys(t.tiles).length>0||t.hidden.length>0}function Xs(t){try{const e=localStorage.getItem(Qe(t));return e?fe(JSON.parse(e)):void 0}catch{return}}function Se(t,e){try{localStorage.setItem(Qe(t),JSON.stringify(e))}catch{}}async function _e(t,e){if(!(await fetch(`/api/${t}/kv/${Ge}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok)throw new Error("Failed to save board layout")}function Zs(t){const e=k.c(24),s=xe();let o;e[0]!==t?(o=te.boardLayout(t),e[0]=t,e[1]=o):o=e[1];const i=o;let r;e[2]!==t?(r=Xs(t),e[2]=t,e[3]=r):r=e[3];const a=r;let d;e[4]!==a||e[5]!==t?(d=async()=>{const b=await fetch(`/api/${t}/kv/${Ge}`);if(b.status===404)return a&&Js(a)?(await _e(t,a),a):Je;if(!b.ok)throw new Error("Failed to load board layout");const v=await b.json(),N=fe(v.value);return Se(t,N),N},e[4]=a,e[5]=t,e[6]=d):d=e[6];let l;e[7]!==a||e[8]!==i||e[9]!==d?(l={queryKey:i,queryFn:d,initialData:a,staleTime:0,refetchOnWindowFocus:!1},e[7]=a,e[8]=i,e[9]=d,e[10]=l):l=e[10];const{data:m,isLoading:c}=se(l);let u;e[11]!==t?(u={mutationFn:b=>_e(t,b)},e[11]=t,e[12]=u):u=e[12];const f=st(u);let p;e[13]!==f||e[14]!==t||e[15]!==s||e[16]!==i?(p=b=>{Se(t,b),s.setQueryData(i,b),f.mutate(b)},e[13]=f,e[14]=t,e[15]=s,e[16]=i,e[17]=p):p=e[17];const h=p;let x;e[18]!==m?(x=fe(m),e[18]=m,e[19]=x):x=e[19];let y;return e[20]!==c||e[21]!==h||e[22]!==x?(y={layout:x,isLoading:c,save:h},e[20]=c,e[21]=h,e[22]=x,e[23]=y):y=e[23],y}const Xe=$.createContext(null);function Ys(t){const e=k.c(24),{children:s}=t,{org:o}=J(),i=Zs(o.slug),[r,a]=$.useState(!1),[d,l]=$.useState(null);let m;e[0]!==i.layout?(m=()=>{l(i.layout),a(!0)},e[0]=i.layout,e[1]=m):m=e[1];const c=m;let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=()=>{l(null),a(!1)},e[2]=u):u=e[2];const f=u;let p;e[3]!==d||e[4]!==i?(p=()=>{d&&i.save(d),l(null),a(!1)},e[3]=d,e[4]=i,e[5]=p):p=e[5];const h=p,x=r&&d!==null,y=x?d:i.layout;let b;e[6]!==d||e[7]!==x||e[8]!==i.layout?(b=x?JSON.stringify(d)!==JSON.stringify(i.layout):!1,e[6]=d,e[7]=x,e[8]=i.layout,e[9]=b):b=e[9];const v=b;let N;e[10]!==r||e[11]!==i?(N=S=>{r?l(S):i.save(S)},e[10]=r,e[11]=i,e[12]=N):N=e[12];const j=N;let g;e[13]!==j||e[14]!==c||e[15]!==v||e[16]!==r||e[17]!==y||e[18]!==h||e[19]!==i.isLoading?(g={isEditMode:r,enter:c,cancel:f,save:h,hasChanges:v,layout:y,isLayoutLoading:i.isLoading,commitLayout:j},e[13]=j,e[14]=c,e[15]=v,e[16]=r,e[17]=y,e[18]=h,e[19]=i.isLoading,e[20]=g):g=e[20];let w;return e[21]!==s||e[22]!==g?(w=n.jsx(Xe.Provider,{value:g,children:s}),e[21]=s,e[22]=g,e[23]=w):w=e[23],w}function Ze(){const t=$.useContext(Xe);if(!t)throw new Error("useHomeEdit must be used within a HomeEditProvider");return t}function en({agentId:t}){const{org:e,locator:s}=J(),o=ae({connectionId:t,orgId:e.id,orgSlug:e.slug}),{create:i}=os(),{setTaskId:r}=Lt(),[a,d]=$.useState(null),[l,m]=$.useState(!1),c=$.useRef(!1),u=async(y,b)=>{if(!o){U.error("MCP client not available");return}if(!c.current){c.current=!0,m(!0);try{const v=await is(o,y.name,b),N={type:"doc",content:[{type:"paragraph",content:[Ft({id:y.name,name:Ut(y.name,Bt(y._meta)),metadata:v.messages,char:"/",kind:"prompt",args:b}),{type:"text",text:" "}]}]},j=crypto.randomUUID();rs(sessionStorage,s,j,{tiptapDoc:N}),await i({id:j,virtual_mcp_id:t}),r(j,t,{autosend:!0})}catch(v){console.error("[start-thread-from-prompt] failed",v),U.error("Failed to start thread. Please try again.")}finally{c.current=!1,m(!1)}}},f=async y=>{if(!c.current){if(y.arguments&&y.arguments.length>0){d(y);return}await u(y)}},p=async y=>{if(!a)return;const b=a;d(null),await u(b,y)};return{start:f,startBlank:async y=>{if(!c.current){c.current=!0,m(!0);try{const b=crypto.randomUUID();await i({id:b,virtual_mcp_id:t}),r(b,t,y?.main?{main:y.main}:void 0)}catch(b){console.error("[start-thread-from-prompt] startBlank failed",b),U.error("Failed to start thread. Please try again.")}finally{c.current=!1,m(!1)}}},dialog:n.jsx(Rt,{prompt:a,setPrompt:y=>d(y),onSubmit:p}),dialogPrompt:a,starting:l}}const W=4,G=100,Ce=12,tn=5,sn={w:2,h:2};class pe extends $.Component{state={hasError:!1};static getDerivedStateFromError(e){return{hasError:!0,message:e instanceof Error?e.message:"Unknown error"}}componentDidCatch(e,s){console.error("[home-tiles] tile crashed:",e,s.componentStack)}render(){return this.state.hasError?n.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2 p-4 text-center",children:[n.jsx("span",{className:"flex size-8 items-center justify-center rounded-md bg-destructive/10 text-destructive",children:n.jsx(nt,{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:o,renderTile:i,onMove:r,onResize:a,onRemove:d}=t,l=ge(),m=$.useRef(null),[c,u]=$.useState(null),[f,p]=$.useState(null);let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h={activationConstraint:{distance:4}},e[0]=h):h=e[0];const x=Ae(re(Ee,h),re(Pe)),y=s.reduce(on,0),b=o?Math.max(y+2,4):Math.max(y,1);let v;e[1]===Symbol.for("react.memo_cache_sentinel")?(v=()=>{const A=m.current?.getBoundingClientRect();return A?{cellWidth:A.width/W,cellHeight:G}:null},e[1]=v):v=e[1];const N=v;let j;e[2]===Symbol.for("react.memo_cache_sentinel")?(j=A=>{u(String(A.active.id)),p(N())},e[2]=j):j=e[2];const g=j;let w;e[3]!==f||e[4]!==r||e[5]!==s?(w=A=>{const V=String(A.active.id),D=f??N();if(u(null),p(null),!D||D.cellWidth<=0)return;const E=s.find(q=>q.id===V);if(!E)return;const R=Math.round(A.delta.x/D.cellWidth),F=Math.round(A.delta.y/D.cellHeight);R===0&&F===0||r(V,{x:E.x+R,y:E.y+F})},e[3]=f,e[4]=r,e[5]=s,e[6]=w):w=e[6];const S=w;if(l){let A;if(e[7]!==i||e[8]!==s){let D;e[10]!==i?(D=E=>n.jsx("div",{className:"group bg-card card-shadow rounded-2xl overflow-hidden",style:{minHeight:G},children:n.jsx(pe,{children:i(E)})},E.id),e[10]=i,e[11]=D):D=e[11],A=s.map(D),e[7]=i,e[8]=s,e[9]=A}else A=e[9];let V;return e[12]!==A?(V=n.jsx("div",{className:"flex flex-col gap-3 px-4 pb-8",children:A}),e[12]=A,e[13]=V):V=e[13],V}let C,_,I,T,P,M,z,B,O;if(e[14]!==c||e[15]!==f||e[16]!==o||e[17]!==S||e[18]!==d||e[19]!==a||e[20]!==i||e[21]!==x||e[22]!==s||e[23]!==b){const A=c?s.find(X=>X.id===c):null;_=Me,B=x,O=g,I=S;const V=b*G,D=o?G*4:G;let E;e[33]!==V||e[34]!==D?(E={height:V,minHeight:D},e[33]=V,e[34]=D,e[35]=E):E=e[35];let R;e[36]!==o||e[37]!==s||e[38]!==b?(R=o&&n.jsx(rn,{rows:b,tiles:s}),e[36]=o,e[37]=s,e[38]=b,e[39]=R):R=e[39];let F;if(e[40]!==c||e[41]!==o||e[42]!==d||e[43]!==a||e[44]!==i||e[45]!==s){let X;e[47]!==c||e[48]!==o||e[49]!==d||e[50]!==a||e[51]!==i?(X=ie=>n.jsx(an,{tile:ie,isEditMode:o,isDragging:c===ie.id,onResize:a,onRemove:d,children:i(ie)},ie.id),e[47]=c,e[48]=o,e[49]=d,e[50]=a,e[51]=i,e[52]=X):X=e[52],F=s.map(X),e[40]=c,e[41]=o,e[42]=d,e[43]=a,e[44]=i,e[45]=s,e[46]=F}else F=e[46];e[53]!==E||e[54]!==R||e[55]!==F?(T=n.jsxs("div",{ref:m,className:"relative w-full",style:E,children:[R,F]}),e[53]=E,e[54]=R,e[55]=F,e[56]=T):T=e[56],C=At,P=null;const q=A&&f?A.w*f.cellWidth-Ce:void 0,de=A&&f?A.h*f.cellHeight-Ce:void 0;e[57]!==q||e[58]!==de?(M={width:q,height:de},e[57]=q,e[58]=de,e[59]=M):M=e[59],z=A&&n.jsx("div",{className:"bg-card card-shadow rounded-2xl shadow-2xl ring-2 ring-primary/40 h-full overflow-hidden opacity-95",children:n.jsx(pe,{children:i(A)})}),e[14]=c,e[15]=f,e[16]=o,e[17]=S,e[18]=d,e[19]=a,e[20]=i,e[21]=x,e[22]=s,e[23]=b,e[24]=C,e[25]=_,e[26]=I,e[27]=T,e[28]=P,e[29]=M,e[30]=z,e[31]=B,e[32]=O}else C=e[24],_=e[25],I=e[26],T=e[27],P=e[28],M=e[29],z=e[30],B=e[31],O=e[32];let L;e[60]!==C||e[61]!==P||e[62]!==M||e[63]!==z?(L=n.jsx(C,{dropAnimation:P,style:M,children:z}),e[60]=C,e[61]=P,e[62]=M,e[63]=z,e[64]=L):L=e[64];let K;return e[65]!==_||e[66]!==I||e[67]!==T||e[68]!==L||e[69]!==B||e[70]!==O?(K=n.jsxs(_,{sensors:B,onDragStart:O,onDragEnd:I,children:[T,L]}),e[65]=_,e[66]=I,e[67]=T,e[68]=L,e[69]=B,e[70]=O,e[71]=K):K=e[71],K}function on(t,e){return Math.max(t,e.y+e.h)}function rn(t){const e=k.c(7),{rows:s,tiles:o}=t;let i;e[0]!==o?(i=(l,m)=>o.some(c=>l>=c.x&&l<c.x+c.w&&m>=c.y&&m<c.y+c.h),e[0]=o,e[1]=i):i=e[1];const r=i;let a;if(e[2]!==r||e[3]!==s){a=[];for(let l=0;l<s;l++)for(let m=0;m<W;m++)r(m,l)||a.push({x:m,y:l});e[2]=r,e[3]=s,e[4]=a}else a=e[4];let d;return e[5]!==a?(d=n.jsx("div",{className:"absolute inset-0 pointer-events-none",children:a.map(ln)}),e[5]=a,e[6]=d):d=e[6],d}function ln(t){return n.jsx("div",{className:"absolute p-1",style:{left:`${t.x/W*100}%`,top:t.y*G,width:`${1/W*100}%`,height:G},children:n.jsx("div",{className:"h-full w-full rounded-2xl border border-dashed border-border/60"})},`${t.x}-${t.y}`)}function an(t){const e=k.c(31),{tile:s,isEditMode:o,isDragging:i,onResize:r,onRemove:a,children:d}=t,l=!o;let m;e[0]!==l||e[1]!==s.id?(m={id:s.id,disabled:l},e[0]=l,e[1]=s.id,e[2]=m):m=e[2];const{setNodeRef:c,attributes:u,listeners:f,isDragging:p}=Pt(m),h=`${s.x/W*100}%`,x=`${s.w/W*100}%`,y=s.y*G,b=s.h*G,v=p||i,N=!v&&"transition-[left,top,width,height,opacity] duration-200 ease-out",j=v&&"opacity-30";let g;e[3]!==N||e[4]!==j?(g=Q("absolute p-1 will-change-[left,top,width,height,opacity]",N,j),e[3]=N,e[4]=j,e[5]=g):g=e[5];let w;e[6]!==b||e[7]!==h||e[8]!==y||e[9]!==x?(w={left:h,top:y,width:x,height:b},e[6]=b,e[7]=h,e[8]=y,e[9]=x,e[10]=w):w=e[10];const S=o&&"outline outline-1 outline-transparent hover:outline-primary/40";let C;e[11]!==S?(C=Q("group relative h-full bg-card card-shadow rounded-2xl overflow-hidden",S),e[11]=S,e[12]=C):C=e[12];let _;e[13]!==u||e[14]!==o||e[15]!==f||e[16]!==a||e[17]!==r||e[18]!==s?(_=o&&n.jsxs(n.Fragment,{children:[n.jsx("button",{type:"button",...u,...f,className:"absolute top-2 left-2 z-10 flex size-8 items-center justify-center rounded-md bg-background/90 border border-border text-muted-foreground hover:text-foreground hover:bg-muted cursor-grab active:cursor-grabbing","aria-label":"Drag tile",children:n.jsx(He,{size:16})}),n.jsx("div",{className:"absolute top-2 right-2 z-10 flex items-center gap-1",children:n.jsx(cn,{tile:s,onResize:r,onRemove:a})})]}),e[13]=u,e[14]=o,e[15]=f,e[16]=a,e[17]=r,e[18]=s,e[19]=_):_=e[19];let I;e[20]!==d?(I=n.jsx("div",{className:"h-full overflow-hidden",children:n.jsx(pe,{children:d})}),e[20]=d,e[21]=I):I=e[21];let T;e[22]!==I||e[23]!==C||e[24]!==_?(T=n.jsxs("div",{className:C,children:[_,I]}),e[22]=I,e[23]=C,e[24]=_,e[25]=T):T=e[25];let P;return e[26]!==c||e[27]!==T||e[28]!==g||e[29]!==w?(P=n.jsx("div",{ref:c,className:g,style:w,children:T}),e[26]=c,e[27]=T,e[28]=g,e[29]=w,e[30]=P):P=e[30],P}function cn(t){const e=k.c(20),{tile:s,onResize:o,onRemove:i}=t,[r,a]=$.useState(!1);let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(ls,{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(bt,{size:16})})}),e[0]=d):d=e[0];let l;e[1]!==o||e[2]!==s.id?(l=y=>{o(s.id,y),a(!1)},e[1]=o,e[2]=s.id,e[3]=l):l=e[3];let m;e[4]!==l||e[5]!==s?(m=n.jsx(dn,{tile:s,onPick:l}),e[4]=l,e[5]=s,e[6]=m):m=e[6];let c;e[7]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(as,{}),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(us,{size:14,className:"mr-2"}),e[11]=f):f=e[11];let p;e[12]!==u?(p=n.jsxs(cs,{onSelect:u,className:"text-destructive focus:text-destructive",children:[f,"Remove tile"]}),e[12]=u,e[13]=p):p=e[13];let h;e[14]!==m||e[15]!==p?(h=n.jsxs(ds,{align:"end",className:"w-auto",children:[m,c,p]}),e[14]=m,e[15]=p,e[16]=h):h=e[16];let x;return e[17]!==r||e[18]!==h?(x=n.jsxs(ms,{open:r,onOpenChange:a,children:[d,h]}),e[17]=r,e[18]=h,e[19]=x):x=e[19],x}function dn(t){const e=k.c(19),{tile:s,onPick:o}=t,i=s.minW??1,r=s.minH??1,[a,d]=$.useState(null);let l;e[0]!==a||e[1]!==s.h||e[2]!==s.w?(l=a??{w:s.w,h:s.h},e[0]=a,e[1]=s.h,e[2]=s.w,e[3]=l):l=e[3];const m=l;let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx("span",{className:"text-xs text-muted-foreground",children:"Size"}),e[4]=c):c=e[4];let u;e[5]!==m.h||e[6]!==m.w?(u=n.jsxs("div",{className:"mb-2 flex items-center justify-between gap-4",children:[c,n.jsxs("span",{className:"text-xs font-medium tabular-nums",children:[m.w," × ",m.h]})]}),e[5]=m.h,e[6]=m.w,e[7]=u):u=e[7];let f,p;e[8]===Symbol.for("react.memo_cache_sentinel")?(f={gridTemplateColumns:`repeat(${W}, 1.25rem)`},p=()=>d(null),e[8]=f,e[9]=p):(f=e[8],p=e[9]);let h;e[10]!==m.h||e[11]!==m.w||e[12]!==r||e[13]!==i||e[14]!==o?(h=n.jsx("div",{className:"grid w-max gap-1",style:f,onPointerLeave:p,children:Array.from({length:tn},(y,b)=>Array.from({length:W},(v,N)=>{const j=N+1,g=b+1,w=j<i||g<r,S=j<=m.w&&g<=m.h;return n.jsx("button",{type:"button",disabled:w,"aria-label":`${j} by ${g}`,onPointerEnter:()=>d({w:j,h:g}),onClick:()=>o({w:j,h:g}),className:Q("size-5 rounded-sm border transition-colors",S?"border-primary bg-primary/30":"border-border bg-muted",w?"cursor-not-allowed opacity-40":"cursor-pointer hover:border-primary/60")},`${j}x${g}`)}))}),e[10]=m.h,e[11]=m.w,e[12]=r,e[13]=i,e[14]=o,e[15]=h):h=e[15];let x;return e[16]!==u||e[17]!==h?(x=n.jsxs("div",{className:"px-2 py-1.5",children:[u,h]}),e[16]=u,e[17]=h,e[18]=x):x=e[18],x}function mn(t,e,s){return t.some(o=>e>=o.x&&e<o.x+o.w&&s>=o.y&&s<o.y+o.h)}function he(t,e,s){for(let o=0;o<100;o++)for(let i=0;i<=W-e;i++){let r=!0;for(let a=0;a<s&&r;a++)for(let d=0;d<e&&r;d++)mn(t,i+d,o+a)&&(r=!1);if(r)return{x:i,y:o}}return{x:0,y:0}}function me(t,e,s={w:1,h:1}){const o=Math.max(s.w,Math.min(W,t)),i=Math.max(s.h,Math.min(6,e));return{w:o,h:i}}function ue(t,e,s){const o=Math.max(0,Math.min(W-s,t)),i=Math.max(0,e);return{x:o,y:i}}function un(t,e,s){const o=t.find(l=>l.id===e);if(!o)return t;const i=t.filter(l=>l.id!==e),r=i.find(l=>s.x>=l.x&&s.x<l.x+l.w&&s.y>=l.y&&s.y<l.y+l.h);if(r&&r.w===o.w&&r.h===o.h)return t.map(l=>l.id===e?{...l,x:r.x,y:r.y}:l.id===r.id?{...l,x:o.x,y:o.y}:l);const d=[{...o,x:s.x,y:s.y}];for(const l of i){const m=he(d,l.w,l.h);d.push({...l,x:m.x,y:m.y})}return d}function fn(t){const e=k.c(35),{layout:s,isLayoutLoading:o,commitLayout:i}=Ze();let r;e[0]!==s.hidden?(r=new Set(s.hidden),e[0]=s.hidden,e[1]=r):r=e[1];const a=r;let d,l;if(e[2]!==t||e[3]!==a||e[4]!==s.tiles){l=[];let v;e[7]!==a?(v=j=>j.pinned||!a.has(j.id),e[7]=a,e[8]=v):v=e[8];const N=t.filter(v);d=new Map;for(const j of t)j.minSize&&d.set(j.id,j.minSize);for(const j of N){const g=s.tiles[j.id];if(!g)continue;const w=d.get(j.id),{w:S,h:C}=me(g.w,g.h,w),{x:_,y:I}=ue(g.x,g.y,S);l.push({id:j.id,x:_,y:I,w:S,h:C,minW:w?.w,minH:w?.h})}for(const j of N){if(l.some(I=>I.id===j.id))continue;const g=j.defaultSize??sn,w=d.get(j.id),{w:S,h:C}=me(g.w,g.h,w),_=he(l,S,C);l.push({id:j.id,x:_.x,y:_.y,w:S,h:C,minW:w?.w,minH:w?.h})}e[2]=t,e[3]=a,e[4]=s.tiles,e[5]=d,e[6]=l}else d=e[5],l=e[6];let m;e[9]!==t?(m=new Set(t.map(pn)),e[9]=t,e[10]=m):m=e[10];const c=m;let u;e[11]!==c||e[12]!==i?(u=(v,N)=>{const j={};for(const g of v)j[g.id]={x:g.x,y:g.y,w:g.w,h:g.h};i({version:ee,tiles:j,hidden:N.filter(g=>c.has(g))})},e[11]=c,e[12]=i,e[13]=u):u=e[13];const f=u;let p;e[14]!==l?(p={visible:l},e[14]=l,e[15]=p):p=e[15];let h;e[16]!==f||e[17]!==s||e[18]!==l?(h=(v,N)=>{const j=l.find(S=>S.id===v);if(!j)return;const g=ue(N.x,N.y,j.w);if(g.x===j.x&&g.y===j.y)return;const w=un(l,v,g);f(w,s.hidden)},e[16]=f,e[17]=s,e[18]=l,e[19]=h):h=e[19];let x;e[20]!==f||e[21]!==s||e[22]!==d||e[23]!==l?(x=(v,N)=>{const j=l.find(T=>T.id===v);if(!j)return;const g=d.get(v),{w,h:S}=me(N.w,N.h,g);if(w===j.w&&S===j.h)return;const C={...j,w,h:S,x:ue(j.x,j.y,w).x},_=l.filter(T=>T.id!==v),I=[C];for(const T of _){const P=he(I,T.w,T.h);I.push({...T,x:P.x,y:P.y})}f(I,s.hidden)},e[20]=f,e[21]=s,e[22]=d,e[23]=l,e[24]=x):x=e[24];let y;e[25]!==f||e[26]!==s||e[27]!==l?(y=v=>{const N=l.filter(j=>j.id!==v);f(N,Array.from(new Set([...s.hidden,v])))},e[25]=f,e[26]=s,e[27]=l,e[28]=y):y=e[28];let b;return e[29]!==o||e[30]!==p||e[31]!==h||e[32]!==x||e[33]!==y?(b={snapshot:p,isLoading:o,moveTile:h,resizeTile:x,hideTile:y},e[29]=o,e[30]=p,e[31]=h,e[32]=x,e[33]=y,e[34]=b):b=e[34],b}function pn(t){return t.id}const hn={w:2,h:4},xn={w:1,h:2},gn={w:1,h:1};function yn(t){return`prompt:${t.agentId}:${t.promptName||"blank"}`}function bn(t){return t.tileId?`tile:${t.tileId}`:`tile:${t.agentId}:${t.resourceUri}`}function jn(t){return t.promptName?t.agentName:t.description}function vn(t){return{name:t.promptName,title:t.title,description:t.description,arguments:t.arguments,_meta:t._meta}}function Ye(t){const e=k.c(14),{org:s}=J();let o;e[0]!==s.id||e[1]!==s.slug||e[2]!==t.connectionId?(o=at({connectionId:t.connectionId,orgId:s.id,orgSlug:s.slug}),e[0]=s.id,e[1]=s.slug,e[2]=t.connectionId,e[3]=o):o=e[3];const{data:i}=se(o),r=!!i&&!t.toolName;let a;e[4]!==i||e[5]!==r?(a={client:i,enabled:r},e[4]=i,e[5]=r,e[6]=a):a=e[6];const{data:d}=ts(a);let l;e[7]!==t.resourceUri||e[8]!==t.toolName||e[9]!==d?.tools?(l=t.toolName??d?.tools.find(u=>Re(u._meta)===t.resourceUri)?.name,e[7]=t.resourceUri,e[8]=t.toolName,e[9]=d?.tools,e[10]=l):l=e[10];const m=l;let c;return e[11]!==t.connectionId||e[12]!==m?(c=m?ns(t.connectionId,m):void 0,e[11]=t.connectionId,e[12]=m,e[13]=c):c=e[13],c}function Ne(t){const e=k.c(10);let s;e[0]!==t?(s={agentId:t},e[0]=t,e[1]=s):s=e[1];const{start:o,startBlank:i,dialog:r,starting:a}=en(s);let d;e[2]!==o||e[3]!==i?(d=c=>{if(!c.promptName){i();return}o(vn(c))},e[2]=o,e[3]=i,e[4]=d):d=e[4];const l=d;let m;return e[5]!==r||e[6]!==l||e[7]!==i||e[8]!==a?(m={open:l,startBlank:i,dialog:r,starting:a},e[5]=r,e[6]=l,e[7]=i,e[8]=a,e[9]=m):m=e[9],m}function Nn(t){const e=k.c(32),{entry:s,isEditMode:o}=t,{open:i,dialog:r,starting:a}=Ne(s.agentId);let d;e[0]!==s||e[1]!==i?(d=()=>i(s),e[0]=s,e[1]=i,e[2]=d):d=e[2];const l=a||o,m=!o&&"cursor-pointer transition-colors hover:bg-accent/40",c=o&&"cursor-default pl-12",u=a&&"opacity-60";let f;e[3]!==m||e[4]!==c||e[5]!==u?(f=Q("group/tile relative flex h-full w-full items-center gap-3 px-4 py-3 text-left bg-card",m,c,u),e[3]=m,e[4]=c,e[5]=u,e[6]=f):f=e[6];let p;e[7]!==s.agentIcon||e[8]!==s.agentName?(p=n.jsx(ce,{icon:s.agentIcon,name:s.agentName,size:"sm+"}),e[7]=s.agentIcon,e[8]=s.agentName,e[9]=p):p=e[9];let h;e[10]!==s.title?(h=n.jsx("div",{className:"line-clamp-2 text-sm font-medium text-foreground leading-snug",children:s.title}),e[10]=s.title,e[11]=h):h=e[11];let x;e[12]!==s?(x=jn(s),e[12]=s,e[13]=x):x=e[13];let y;e[14]!==x?(y=n.jsx("div",{className:"truncate text-xs text-muted-foreground mt-0.5",children:x}),e[14]=x,e[15]=y):y=e[15];let b;e[16]!==y||e[17]!==h?(b=n.jsxs("div",{className:"min-w-0 flex-1",children:[h,y]}),e[16]=y,e[17]=h,e[18]=b):b=e[18];let v;e[19]!==o?(v=!o&&n.jsx(ss,{size:16,className:"shrink-0 text-muted-foreground opacity-0 -translate-x-1 transition-all duration-200 group-hover/tile:opacity-100 group-hover/tile:translate-x-0","aria-hidden":!0}),e[19]=o,e[20]=v):v=e[20];let N;e[21]!==a||e[22]!==d||e[23]!==b||e[24]!==v||e[25]!==l||e[26]!==f||e[27]!==p?(N=n.jsxs("button",{type:"button",onClick:d,disabled:l,"aria-busy":a,className:f,children:[p,b,v]}),e[21]=a,e[22]=d,e[23]=b,e[24]=v,e[25]=l,e[26]=f,e[27]=p,e[28]=N):N=e[28];let j;return e[29]!==r||e[30]!==N?(j=n.jsxs(n.Fragment,{children:[N,r]}),e[29]=r,e[30]=N,e[31]=j):j=e[31],j}function wn(){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},Sn)}),t[0]=e):e=t[0],e}function Sn(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 _n(t){const e=k.c(17),{tile:s,prompts:o,isEditMode:i,tileWidth:r}=t,{org:a}=J(),{open:d,startBlank:l,dialog:m,starting:c}=Ne(s.agentId),u=o.filter(Cn),f=Ye(s),p="relative flex h-full w-full flex-col p-3";let h;e[0]!==i||e[1]!==f||e[2]!==l||e[3]!==c?(h=!i&&n.jsx("button",{type:"button",onClick:()=>{l(f?{main:f}:void 0)},disabled:c,"aria-busy":c,className:"mb-1 self-start rounded-md px-2 py-1 text-[10px] text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:"Open chat"}),e[0]=i,e[1]=f,e[2]=l,e[3]=c,e[4]=h):h=e[4];const x="flex min-h-0 flex-1 gap-3 overflow-hidden";let y;e[5]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsx(Tn,{}),e[5]=y):y=e[5];let b;e[6]!==a.id||e[7]!==a.slug||e[8]!==s?(b=n.jsx("div",{className:"min-h-0 flex-1 overflow-hidden rounded-lg border border-border",children:n.jsx($.Suspense,{fallback:y,children:n.jsx(In,{tile:s,orgId:a.id,orgSlug:a.slug})})}),e[6]=a.id,e[7]=a.slug,e[8]=s,e[9]=b):b=e[9];const v=u.length>0&&!i&&r>=2&&n.jsx("div",{className:"flex w-44 shrink-0 flex-col gap-2 overflow-hidden",children:u.map(g=>n.jsx("button",{type:"button",onClick:()=>d(g),disabled:c,className:"shrink-0 rounded-lg border border-border bg-background px-2.5 py-2 text-left text-xs leading-snug text-foreground transition-colors hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:n.jsx("span",{className:"line-clamp-2",children:g.title})},g.promptName))});let N;e[10]!==b||e[11]!==v?(N=n.jsxs("div",{className:x,children:[b,v]}),e[10]=b,e[11]=v,e[12]=N):N=e[12];let j;return e[13]!==m||e[14]!==h||e[15]!==N?(j=n.jsxs("div",{className:p,children:[h,N,m]}),e[13]=m,e[14]=h,e[15]=N,e[16]=j):j=e[16],j}function Cn(t){return!!t.promptName}function In(t){const e=k.c(13),{tile:s,orgId:o,orgSlug:i}=t;let r;e[0]!==o||e[1]!==i||e[2]!==s.connectionId?(r={connectionId:s.connectionId,orgId:o,orgSlug:i},e[0]=o,e[1]=i,e[2]=s.connectionId,e[3]=r):r=e[3];const a=ae(r),d=s.minHeight??200,l=s.maxHeight??4e3;let m;return e[4]!==a||e[5]!==o||e[6]!==i||e[7]!==d||e[8]!==l||e[9]!==s.connectionId||e[10]!==s.resourceUri||e[11]!==s.toolInput?(m=n.jsx(Qt,{resourceURI:s.resourceUri,orgId:o,orgSlug:i,connectionId:s.connectionId,client:a,toolInput:s.toolInput,displayMode:"fullscreen",minHeight:d,maxHeight:l,className:"h-full"}),e[4]=a,e[5]=o,e[6]=i,e[7]=d,e[8]=l,e[9]=s.connectionId,e[10]=s.resourceUri,e[11]=s.toolInput,e[12]=m):m=e[12],m}function Tn(){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 kn(t){const e=k.c(14),{icon:s,name:o}=t;let i;e[0]!==s||e[1]!==o?(i=n.jsx(ce,{icon:s,name:o,size:"sm+"}),e[0]=s,e[1]=o,e[2]=i):i=e[2];let r;e[3]!==o?(r=n.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:o}),e[3]=o,e[4]=r):r=e[4];let a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx("div",{className:"truncate text-xs text-muted-foreground",children:"Loading tile…"}),e[5]=a):a=e[5];let d;e[6]!==r?(d=n.jsxs("div",{className:"min-w-0 flex-1",children:[r,a]}),e[6]=r,e[7]=d):d=e[7];let l;e[8]!==i||e[9]!==d?(l=n.jsxs("div",{className:"flex items-center gap-2.5",children:[i,d]}),e[8]=i,e[9]=d,e[10]=l):l=e[10];let m;e[11]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsxs("div",{className:"flex flex-1 flex-col gap-2 pt-1",children:[n.jsx(H,{className:"h-3 w-3/4"}),n.jsx(H,{className:"h-3 w-1/2"}),n.jsx(H,{className:"h-3 w-2/3"})]}),e[11]=m):m=e[11];let c;return e[12]!==l?(c=n.jsxs("div",{className:"flex h-full w-full flex-col gap-3 p-5 opacity-60",children:[l,m]}),e[12]=l,e[13]=c):c=e[13],c}function $n(t){const e=k.c(10),{tile:s,prompts:o,isEditMode:i}=t,{open:r,startBlank:a,dialog:d,starting:l}=Ne(s.agentId),m=o.filter(An),c=Ye(s),u="flex h-full w-full flex-col gap-3 p-4";let f;e[0]!==c||e[1]!==a?(f=()=>{a(c?{main:c}:void 0)},e[0]=c,e[1]=a,e[2]=f):f=e[2];const p=l||i;let h;e[3]!==f||e[4]!==p?(h=n.jsx("button",{type:"button",onClick:f,disabled:p,className:"mb-1 self-start rounded-md px-2 py-1 text-[10px] text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:"Open chat"}),e[3]=f,e[4]=p,e[5]=h):h=e[5];const x=m.length>0&&!i&&n.jsx("div",{className:"grid grid-cols-1 gap-2 overflow-hidden sm:grid-cols-2",children:m.map(b=>n.jsx("button",{type:"button",onClick:()=>!i&&r(b),disabled:l,className:"rounded-lg border border-border bg-background px-2.5 py-2 text-left text-xs leading-snug text-foreground transition-colors hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:n.jsx("span",{className:"line-clamp-2",children:b.title})},b.promptName))});let y;return e[6]!==d||e[7]!==h||e[8]!==x?(y=n.jsxs("div",{className:u,children:[h,x,d]}),e[6]=d,e[7]=h,e[8]=x,e[9]=y):y=e[9],y}function An(t){return!!t.promptName}function et({isEditMode:t}){const{org:e}=J(),{isLoading:s,prompts:o,tiles:i}=be(e.slug),r=ze()?.ids??[],a=new Set(r),d=Oe(),l=Ue(),m=xe(),c=new Set(i.map(g=>g.agentId)),u=new Map;for(const g of o){const w=u.get(g.agentId);w?w.push(g):u.set(g.agentId,[g])}const f=o.filter(g=>!c.has(g.agentId)),p=[...i.map(g=>({kind:"tile",id:bn(g),data:g})),...f.map(g=>({kind:"prompt",id:yn(g),data:g}))],h=new Map(p.map(g=>[g.id,g])),x=fn(p.map(g=>({id:g.id,defaultSize:g.kind==="tile"?hn:gn,minSize:g.kind==="tile"?xn:void 0,pinned:a.has(g.data.agentId)}))),y=g=>{d.apply(w=>w.filter(S=>S!==g)).catch(()=>U.error("Couldn't remove from home — please try again."))},b=async g=>{if(i.filter(S=>S.agentId===g.agentId).length<=1){y(g.agentId);return}try{const C=(await l.call("COLLECTION_VIRTUAL_MCP_GET",{id:g.agentId})).item;if(!C)throw new Error("Agent not found");const _=Z(C.metadata?.ui),I=g.tileId?_.filter(T=>T.tileId!==g.tileId):_.filter(T=>T.connectionId!==g.connectionId||T.resourceUri!==g.resourceUri);await l.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:g.agentId,data:{metadata:{...C.metadata??{},ui:{...C.metadata?.ui??{},homeTile:null,homeTiles:I}}}}),m.invalidateQueries({queryKey:te.homeNextActions(e.slug)})}catch{U.error("Couldn't remove tile — please try again.")}},v=g=>{const w=h.get(g);if(w){if(!a.has(w.data.agentId)){x.hideTile(g);return}w.kind==="tile"?b(w.data):y(w.data.agentId)}},N=g=>{const w=h.get(g.id);if(!w)return null;if(w.kind==="tile"){const S=u.get(w.data.agentId)??[];return n.jsx(it,{fallback:n.jsx($n,{tile:w.data,prompts:S,isEditMode:t}),children:n.jsx($.Suspense,{fallback:n.jsx(kn,{icon:w.data.agentIcon,name:w.data.agentName}),children:n.jsx(_n,{tile:w.data,prompts:S,isEditMode:t,tileWidth:g.w})})})}return n.jsx(Nn,{entry:w.data,isEditMode:t})};return s||x.isLoading?n.jsx(wn,{}):x.snapshot.visible.length===0&&!t?null:n.jsx("div",{className:"mt-4 flex w-full max-w-7xl flex-col gap-4",children:n.jsx(nn,{tiles:x.snapshot.visible,isEditMode:t,renderTile:N,onMove:x.moveTile,onResize:x.resizeTile,onRemove:v})})}function Pn(t){const e=k.c(2),{prompts:s,tiles:o}=be(t),i=o.length>0||s.length>0;let r;return e[0]!==i?(r={hasVisibleTiles:i},e[0]=i,e[1]=r):r=e[1],r}const Ie=420,Te=305;function tt(){const t=k.c(4);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("img",{src:"/home/bg-top-left.svg",alt:"",className:"absolute top-0 left-0 h-auto select-none opacity-80 dark:hidden",style:{width:Ie}}),t[0]=e):e=t[0];let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx("img",{src:"/home/bg-top-left-dark.svg",alt:"",className:"absolute top-0 left-0 hidden h-auto select-none opacity-80 dark:block",style:{width:Ie}}),t[1]=s):s=t[1];let o;t[2]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx("img",{src:"/home/bg-bottom-right.svg",alt:"",className:"absolute bottom-0 right-0 h-auto select-none opacity-80 dark:hidden",style:{width:Te}}),t[2]=o):o=t[2];let i;return t[3]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsxs("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 overflow-hidden",children:[e,s,o,n.jsx("img",{src:"/home/bg-bottom-right-dark.svg",alt:"",className:"absolute bottom-0 right-0 hidden h-auto select-none opacity-80 dark:block",style:{width:Te}})]}),t[3]=i):i=t[3],i}function ke(){const t=k.c(33),{data:e}=ot.useSession(),{org:s}=J(),o=ge(),i=hs(),{selectedVirtualMcp:r}=vt();let a;t[0]!==s.id?(a=ct(s.id),t[0]=s.id,t[1]=a):a=t[1];const l=r??a;let m;t[2]!==s.slug?(m=Dt(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:dt,orgId:s.id,orgSlug:s.slug},t[4]=s.id,t[5]=s.slug,t[6]=c):c=t[6];const u=ae(c);let f;t[7]!==s.id||t[8]!==s.slug?(f=fs(s.slug,s.id),t[7]=s.id,t[8]=s.slug,t[9]=f):f=t[9];let p;t[10]!==s.id||t[11]!==s.slug?(p=Ot(s.slug,s.id),t[10]=s.id,t[11]=s.slug,t[12]=p):p=t[12];let h;t[13]!==l.id||t[14]!==s.id||t[15]!==u?(h=ft(s.id,l.id,u),t[13]=l.id,t[14]=s.id,t[15]=u,t[16]=h):h=t[16];let x;t[17]!==f||t[18]!==p||t[19]!==h?(x={queries:[f,p,h]},t[17]=f,t[18]=p,t[19]=h,t[20]=x):x=t[20],rt(x);const y=ps(),b=pt(l.id),{hasDecoKey:v,isZeroBalance:N,isInitialFreeCredit:j,balanceDollars:g,hasOnlyDecoProvider:w}=Et(),{hasVisibleTiles:S}=Pn(s.slug),C=Mt(b?.metadata);if(y.length===0&&!(C&&zt(i))){let L;return t[21]===Symbol.for("react.memo_cache_sentinel")?(L=n.jsx("div",{className:"flex-1 overflow-y-auto",children:n.jsx("div",{className:"min-h-full flex items-center justify-center px-4 py-10",children:n.jsx(Nt,{})})}),t[21]=L):L=t[21],L}let I;t[22]!==e?.user?.name?(I=e?.user?.name?.split(" ")[0]||"there",t[22]=e?.user?.name,t[23]=I):I=t[23];const T=I,P=v&&j&&g!=null,M=v&&N&&w;let z;t[24]!==g||t[25]!==P||t[26]!==M?(z=P?n.jsx(oe.CreditsEyebrow,{balanceDollars:g}):M?n.jsx(oe.NoCreditsEyebrow,{}):null,t[24]=g,t[25]=P,t[26]=M,t[27]=z):z=t[27];const B=z;let O;return t[28]!==B||t[29]!==S||t[30]!==o||t[31]!==T?(O=n.jsx(Ys,{children:o?n.jsx(En,{eyebrow:B,userName:T}):n.jsx(Mn,{eyebrow:B,userName:T,hasVisibleTiles:S})}),t[28]=B,t[29]=S,t[30]=o,t[31]=T,t[32]=O):O=t[32],O}function En(t){const e=k.c(12),{eyebrow:s,userName:o}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(tt,{}),e[0]=i):i=e[0];let r;e[1]!==s?(r=s&&n.jsx("div",{className:"mb-4",children:s}),e[1]=s,e[2]=r):r=e[2];let a;e[3]!==o?(a=n.jsxs("p",{className:"text-3xl font-medium text-foreground text-center max-w-[280px]",children:["What's on your mind, ",o,"?"]}),e[3]=o,e[4]=a):a=e[4];let d;e[5]!==r||e[6]!==a?(d=n.jsxs("div",{className:"relative flex flex-col items-center justify-center w-full pt-28 pb-8 px-4",children:[r,a]}),e[5]=r,e[6]=a,e[7]=d):d=e[7];let l;e[8]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx("div",{className:"relative w-full flex flex-col gap-4 pb-8 px-4",children:n.jsx(oe.Input,{showConnectionsBanner:!0})}),e[8]=l):l=e[8];let m;e[9]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx("div",{className:"relative w-full px-4 pb-8",children:n.jsx(et,{isEditMode:!1})}),e[9]=m):m=e[9];let c;return e[10]!==d?(c=n.jsxs("div",{className:"flex-1 relative flex flex-col items-center overflow-y-auto",children:[i,d,l,m]}),e[10]=d,e[11]=c):c=e[11],c}function Mn(t){const e=k.c(32),{eyebrow:s,userName:o,hasVisibleTiles:i}=t,{isEditMode:r,enter:a,save:d,cancel:l,hasChanges:m}=Ze(),[c,u]=$.useState(!1);let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=()=>u(!0),e[0]=f):f=e[0];let p;e[1]!==l||e[2]!==a||e[3]!==m||e[4]!==r||e[5]!==d?(p=n.jsx(xs.Right,{children:n.jsx(zn,{isEditMode:r,hasChanges:m,onEnter:a,onSave:d,onCancel:l,onAddTile:f})}),e[1]=l,e[2]=a,e[3]=m,e[4]=r,e[5]=d,e[6]=p):p=e[6];let h;e[7]!==c?(h=n.jsx(ys,{open:c,onOpenChange:u}),e[7]=c,e[8]=h):h=e[8];let x;e[9]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(tt,{}),e[9]=x):x=e[9];const y=i||r?"pt-32":"flex-1 justify-center";let b;e[10]!==y?(b=Q("relative flex flex-col items-center px-10 pb-4",y),e[10]=y,e[11]=b):b=e[11];let v;e[12]!==s?(v=s&&n.jsx("div",{className:"mb-4",children:s}),e[12]=s,e[13]=v):v=e[13];let N;e[14]!==o?(N=n.jsxs("p",{className:"text-3xl font-medium text-foreground",children:["What's on your mind, ",o,"?"]}),e[14]=o,e[15]=N):N=e[15];let j;e[16]!==v||e[17]!==N?(j=n.jsxs("div",{className:"text-center mb-10",children:[v,N]}),e[16]=v,e[17]=N,e[18]=j):j=e[18];let g;e[19]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsxs("div",{className:"relative w-full",children:[n.jsx(On,{}),n.jsx(oe.Input,{showConnectionsBanner:!0})]}),e[19]=g):g=e[19];let w;e[20]!==j?(w=n.jsxs("div",{className:"flex flex-col items-center w-full max-w-[672px]",children:[j,g]}),e[20]=j,e[21]=w):w=e[21];let S;e[22]!==r?(S=n.jsx("div",{className:"relative w-full mt-10 mx-auto max-w-[1280px] px-2 pb-16",children:n.jsx(et,{isEditMode:r})}),e[22]=r,e[23]=S):S=e[23];let C;e[24]!==w||e[25]!==S||e[26]!==b?(C=n.jsxs("div",{className:"flex-1 relative flex flex-col min-h-0",children:[x,n.jsx("div",{className:"flex-1 relative flex flex-col overflow-y-auto",children:n.jsxs("div",{className:b,children:[w,S]})})]}),e[24]=w,e[25]=S,e[26]=b,e[27]=C):C=e[27];let _;return e[28]!==C||e[29]!==p||e[30]!==h?(_=n.jsxs(n.Fragment,{children:[p,h,C]}),e[28]=C,e[29]=p,e[30]=h,e[31]=_):_=e[31],_}function zn(t){const e=k.c(17),{isEditMode:s,hasChanges:o,onEnter:i,onSave:r,onCancel:a,onAddTile:d}=t;if(s){let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(ye,{size:14}),e[0]=c):c=e[0];let u;e[1]!==d?(u=n.jsxs("button",{type:"button",onClick:d,className:"flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",title:"Add a tile from any agent",children:[c,"Add tile"]}),e[1]=d,e[2]=u):u=e[2];let f;e[3]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx($e,{size:14}),e[3]=f):f=e[3];let p;e[4]!==a?(p=n.jsxs(Y,{size:"sm",variant:"ghost",onClick:a,className:"gap-1.5 h-7 text-xs",children:[f,"Cancel"]}),e[4]=a,e[5]=p):p=e[5];const h=!o;let x;e[6]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(ht,{size:14}),e[6]=x):x=e[6];let y;e[7]!==r||e[8]!==h?(y=n.jsxs(Y,{size:"sm",onClick:r,disabled:h,className:"gap-1.5 h-7 text-xs",children:[x,"Save"]}),e[7]=r,e[8]=h,e[9]=y):y=e[9];let b;return e[10]!==u||e[11]!==p||e[12]!==y?(b=n.jsxs(n.Fragment,{children:[u,p,y]}),e[10]=u,e[11]=p,e[12]=y,e[13]=b):b=e[13],b}let l;e[14]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(jt,{size:14}),e[14]=l):l=e[14];let m;return e[15]!==i?(m=n.jsxs("button",{type:"button",onClick:i,className:"flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",title:"Customize your home",children:[l,"Customize"]}),e[15]=i,e[16]=m):m=e[16],m}function On(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("img",{src:"/home/capybara.png",alt:"","aria-hidden":!0,className:"pointer-events-none absolute -top-16 right-6 z-20 h-20 w-auto select-none"}),t[0]=e):e=t[0],e}function Vo(){const t=k.c(2);if(ge()){let o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx("div",{className:"flex-1 min-h-0 flex flex-col bg-background overflow-hidden",children:n.jsx(ke,{})}),t[0]=o):o=t[0],o}let s;return t[1]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx("div",{className:"flex-1 min-h-0 pb-1 pr-1 pl-0 pt-0",children:n.jsx("div",{className:"h-full p-0.5 pt-0.25",children:n.jsx("div",{className:"flex flex-col h-full bg-background overflow-hidden card-shadow rounded-[0.75rem]",children:n.jsx(ke,{})})})}),t[1]=s):s=t[1],s}export{Vo as default};
|
|
1
|
+
import{c as k,j as n,r as $,D as J,m as xe,l as Q,i as le,an as Z,t as U,K as te,k as se,B as Y,d as st,a6 as nt,E as it,a as ot}from"./index-Cw1_akCN.js";import{u as ge}from"./use-mobile-BEMk8YZy.js";import{u as rt}from"./useSuspenseQueries-DcYkaPjN.js";import{i as lt,u as ae,m as at,a as ct,S as dt}from"./use-mcp-client-eL9inrhT.js";import{u as mt,b as ut,v as ft,a as pt}from"./use-virtual-mcp-C1pJMY-h.js";import{i as ht}from"./ChevronUp-BtpDIyFt.js";import{i as xt,A as ce,t as gt,ae as yt,F as bt,j as jt}from"./agent-icon-CJLs7JnL.js";import{s as ye}from"./Plus-K9-3Y3av.js";import{i as $e}from"./X-B7BrDYoR.js";import{C as oe}from"./index-Cka24isE.js";import{b as vt}from"./chat-context-CDQGKTRb.js";import{N as Nt}from"./decopilot-xdkIhiJl.js";import{g as wt,a as Ae,b as re,K as Pe,P as Ee,D as Me,c as St,S as _t,v as Ct,d as It,C as Tt,s as kt,l as $t,k as At,o as Pt,u as Et,j as Mt,h as zt}from"./sortable.esm-GHEOPheK.js";import{u as ze,a as Oe,o as Ot}from"./use-organization-settings-B67X4xDb.js";import{c as be,b as Lt,h as Dt}from"./shell-layout-CR0Hp5Mh.js";import{I as Le}from"./input-DLr6JHGJ.js";import{S as Ht,t as je,P as Rt,j as Ft,s as Ut,g as Bt}from"./scroll-area-stexiMtw.js";import{S as Vt,a as Kt,b as Wt,c as qt,d as Gt}from"./sheet-BJzqKXxB.js";import{S as H}from"./skeleton-BbyhTtn8.js";import{t as De}from"./ChevronDown-C7iCpNd7.js";import{b as He}from"./ZoomOut-B1lM_F9T.js";import{g as Re,M as Qt}from"./types-DnF2nXDI.js";import{I as Fe}from"./integration-icon-iMszCnRO.js";import{a as Jt,b as Xt,c as Zt,d as we,S as Yt}from"./select-CkO_vFl4.js";import{T as es}from"./textarea-BbsMd9WU.js";import{u as Ue}from"./studio-tools-BkyKqeDD.js";import{a as ts}from"./use-mcp-tools-BRt-21KP.js";import{i as ss}from"./XCircle--nqVJrRk.js";import{f as ns}from"./tab-id-AX1D_RMI.js";import{g as is}from"./use-mcp-prompts-BwjPqGqM.js";import{u as os,w as rs}from"./hooks-mecxyGXr.js";import{a as ls,g as as,c as cs,b as ds,D as ms}from"./dropdown-menu-CRzlYZec.js";import{s as us}from"./Trash01-CkOiGHv0.js";import{a as fs,u as ps}from"./use-ai-providers-FWk9OVU1.js";import{u as hs}from"./connect-desktop-dialog-BRLVLmM1.js";import{T as xs}from"./toolbar-L97y_brf.js";import"./auth-D29ieVkn.js";import"./use-collections-BnfRvFB1.js";import"./AlertCircle-BJq9ypj0.js";import"./Tool01-BDYpV4bF.js";import"./SwitchHorizontal01-BrQLjMKA.js";import"./Settings02-CUXE6YBK.js";import"./ArrowUpRight-BcajLYn1.js";import"./ZapSquare-XIRAkyko.js";import"./Users03-bEnDQfVD.js";import"./CheckCircle-CgZRVWJ7.js";import"./ChevronRight-CQ6qJi_4.js";import"./DotsVertical-CxSK3DNF.js";import"./Stars02-EI2D1sR2.js";import"./Eye-EQZNVaju.js";import"./Globe01-BCZ4MJ9r.js";import"./FilterLines-Bs1V5x-b.js";import"./Star01-hycj5iSk.js";import"./Globe04-BYKU0iQC.js";import"./HardDrive-4fVVGWQv.js";import"./Key01-x0kqMuez.js";import"./LayoutLeft-gtZ98pdB.js";import"./LinkExternal01-Ct3eSohN.js";import"./Monitor01-B4532Y1i.js";import"./Sun-C9Wxt9CP.js";import"./Palette-CNyx15J3.js";import"./Play-CR5jCOmn.js";import"./SearchLg-DNsRNxo9.js";import"./SearchMd-BA75dueP.js";import"./Shield01-gyJITz9J.js";import"./Stars01-D7uKNdAz.js";import"./Upload01-De93EmfO.js";import"./User01-BQnxqmQ5.js";import"./Users01-6ImDxKnC.js";import"./XClose-Bhi6uXp9.js";import"./Zap-qEJPKDHk.js";import"./tooltip-DQJ-jcPk.js";import"./dialog-CPwF731q.js";import"./drawer-DlHMG-t7.js";import"./collection-search-Bxp9u43w.js";import"./form-DbXRmybh.js";import"./label-DBw8HeDH.js";import"./tabs-Dv5E70j1.js";import"./toggle-group-ZHbJlDbB.js";import"./popover-B-zFyk2E.js";import"./command-CSY5a7Nv.js";import"./index-hUSewKBE.js";import"./useInfiniteQuery-Depl5l-b.js";import"./use-infinite-scroll-C98OH2pE.js";import"./use-org-fs-sAfsYw1V.js";import"./question-004-sINsf4GQ.js";import"./use-decopilot-events-qzMfR8aE.js";import"./decopilot-sse-pool-D0-zqsJt.js";import"./backoff-CrEUbyZT.js";import"./checkbox-CQmZUGae.js";import"./ai-providers-logos-DD3qZ33J.js";import"./avatar-BeX1bScj.js";import"./settings-section-CS-HJOQa.js";import"./card-mou1irWY.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-Dnvk_cT5.js";import"./use-registry-connections-BbQFk-hr.js";import"./use-connection-DmwGJvkl.js";import"./extract-connection-data-BLNjuXm9.js";import"./collection-tabs-OuAA7gyO.js";import"./badge-40QNvrlo.js";import"./connection-form-helpers-BSTA0pW8.js";import"./authenticate-and-persist-oauth-Ot7eZvPq.js";import"./mcp-oauth-Bv1ej_Wz.js";import"./useSuspenseInfiniteQuery-DuIaWnch.js";import"./required-auth-layout-ByN1DYD2.js";import"./use-org-sso-B5PmzULO.js";import"./use-clock-tick-Cov0S4x5.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-CP0aLOns.js";import"./file-type-icon-CZT8Q3fZ.js";import"./content-blocks-o63cs2vh.js";import"./use-navigate-to-agent-4Srb4Woe.js";import"./delay-CnY5UFtP.js";function Be(t){const e=k.c(11),{properties:s,required:o,values:i,onChange:r}=t;let a;e[0]!==o?(a=o??[],e[0]=o,e[1]=a):a=e[1];let d;e[2]!==a?(d=new Set(a),e[2]=a,e[3]=d):d=e[3];const l=d;let m;e[4]!==s?(m=Object.entries(s),e[4]=s,e[5]=m):m=e[5];let c;return e[6]!==r||e[7]!==l||e[8]!==m||e[9]!==i?(c=n.jsx("div",{className:"flex flex-col gap-2",children:m.map(u=>{const[f,p]=u;return n.jsxs("div",{className:"flex flex-col gap-0.5",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("label",{className:"text-xs font-medium leading-none flex items-center gap-1",children:[f,l.has(f)&&n.jsx("span",{className:"text-red-500 text-[10px]",children:"*"})]}),n.jsx("span",{className:"text-[10px] text-muted-foreground font-mono",children:p.type})]}),p.description&&n.jsx("p",{className:"text-[10px] text-muted-foreground leading-snug",children:p.description}),n.jsx(gs,{type:p.type,fieldKey:f,value:i[f],onChange:h=>r(f,h)})]},f)})}),e[6]=r,e[7]=l,e[8]=m,e[9]=i,e[10]=c):c=e[10],c}function gs(t){const e=k.c(19),{type:s,fieldKey:o,value:i,onChange:r}=t;if(s==="object"||s==="array"){const c=i??"";let u;e[0]!==r?(u=h=>r(h.target.value),e[0]=r,e[1]=u):u=e[1];const f=`Enter ${o} as JSON…`;let p;return e[2]!==c||e[3]!==u||e[4]!==f?(p=n.jsx(es,{className:"font-mono text-xs h-16",value:c,onChange:u,placeholder:f,rows:2}),e[2]=c,e[3]=u,e[4]=f,e[5]=p):p=e[5],p}if(s==="boolean"){const c=i!=null?String(i):"";let u;e[6]!==r?(u=x=>r(x==="true"),e[6]=r,e[7]=u):u=e[7];let f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(Jt,{className:"h-7 text-xs",children:n.jsx(Xt,{placeholder:"Select…"})}),e[8]=f):f=e[8];let p;e[9]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsxs(Zt,{children:[n.jsx(we,{value:"true",children:"true"}),n.jsx(we,{value:"false",children:"false"})]}),e[9]=p):p=e[9];let h;return e[10]!==c||e[11]!==u?(h=n.jsxs(Yt,{value:c,onValueChange:u,children:[f,p]}),e[10]=c,e[11]=u,e[12]=h):h=e[12],h}const a=i??"";let d;e[13]!==r?(d=c=>r(c.target.value),e[13]=r,e[14]=d):d=e[14];const l=`Enter ${o}…`;let m;return e[15]!==a||e[16]!==d||e[17]!==l?(m=n.jsx(Le,{className:"h-7 text-xs",value:a,onChange:d,placeholder:l}),e[15]=a,e[16]=d,e[17]=l,e[18]=m):m=e[18],m}const ne=8;function ys(t){const e=k.c(16),{open:s,onOpenChange:o}=t,[i,r]=$.useState("");let a,d;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(Vt,{children:"Manage home"}),d=n.jsx(Kt,{children:"Add agents to the home board and pin their interactive UIs or prompts."}),e[0]=a,e[1]=d):(a=e[0],d=e[1]);let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(xt,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none","aria-hidden":!0}),e[2]=l):l=e[2];let m;e[3]===Symbol.for("react.memo_cache_sentinel")?(m=x=>r(x.target.value),e[3]=m):m=e[3];let c;e[4]!==i?(c=n.jsxs(Wt,{className:"px-5 py-4 border-b border-border",children:[a,d,n.jsxs("div",{className:"relative mt-3",children:[l,n.jsx(Le,{value:i,onChange:m,placeholder:"Search agents…",className:"pl-8 h-8 text-sm"})]})]}),e[4]=i,e[5]=c):c=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(Gs,{}),e[6]=u):u=e[6];let f;e[7]!==i?(f=n.jsx(Ht,{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(js,{search:i})})})}),e[7]=i,e[8]=f):f=e[8];let p;e[9]!==c||e[10]!==f?(p=n.jsxs(qt,{side:"right",className:"w-full sm:max-w-md p-0 flex flex-col",children:[c,f]}),e[9]=c,e[10]=f,e[11]=p):p=e[11];let h;return e[12]!==o||e[13]!==s||e[14]!==p?(h=n.jsx(Gt,{open:s,onOpenChange:o,children:p}),e[12]=o,e[13]=s,e[14]=p,e[15]=h):h=e[15],h}function bs(t){const e=k.c(32),{org:s}=J(),o=ze();let i;e[0]!==o?.ids?(i=o?.ids??[],e[0]=o?.ids,e[1]=i):i=e[1];const r=i,a=Oe(),d=ut(),l=xe();let m;e[2]!==s||e[3]!==l?(m=()=>l.refetchQueries({queryKey:te.homeNextActions(s.slug),type:"active"}),e[2]=s,e[3]=l,e[4]=m):m=e[4];const c=m;let u;e[5]!==r?(u=_=>r.includes(_),e[5]=r,e[6]=u):u=e[6];const f=u;let p;e[7]!==r||e[8]!==t?(p=t?r.filter(_=>t.has(_)).length:r.length,e[7]=r,e[8]=t,e[9]=p):p=e[9];const x=p>=ne;let y;e[10]!==x||e[11]!==f||e[12]!==a?(y=_=>f(_)||x?Promise.resolve():a.apply(I=>I.includes(_)?null:[...I,_]),e[10]=x,e[11]=f,e[12]=a,e[13]=y):y=e[13];const b=y;let v;e[14]!==a?(v=_=>a.apply(I=>I.filter(T=>T!==_)),e[14]=a,e[15]=v):v=e[15];const N=v;let j;e[16]!==a?(j=_=>a.apply(()=>_),e[16]=a,e[17]=j):j=e[17];const g=j;let w;e[18]!==d||e[19]!==x||e[20]!==f||e[21]!==c||e[22]!==a?(w=async(_,I)=>{await d.update.mutateAsync({id:_.id,data:{metadata:I}}),!f(_.id)&&!x&&await a.apply(T=>T.includes(_.id)?null:[...T,_.id]),await c()},e[18]=d,e[19]=x,e[20]=f,e[21]=c,e[22]=a,e[23]=w):w=e[23];const S=w;let C;return e[24]!==b||e[25]!==x||e[26]!==r||e[27]!==f||e[28]!==N||e[29]!==g||e[30]!==S?(C={homeIds:r,isOnHome:f,atLimit:x,addAgent:b,removeAgent:N,reorder:g,saveAgentMetadata:S},e[24]=b,e[25]=x,e[26]=r,e[27]=f,e[28]=N,e[29]=g,e[30]=S,e[31]=C):C=e[31],C}function js(t){const e=k.c(21),{search:s}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={pageSize:1e3},e[0]=o):o=e[0];const i=mt(o);let r;e[1]!==i?(r=new Set(i.map(_s)),e[1]=i,e[2]=r):r=e[2];const a=bs(r);let d,l,m;if(e[3]!==i||e[4]!==a||e[5]!==s){const x=new Map(i.map(Ss));d=s.trim().toLowerCase();const y=N=>!d||N.title?.toLowerCase().includes(d);l=a.homeIds.map(N=>x.get(N)).filter(ws).filter(y);const b=wt(i);let v;e[9]!==a?(v=N=>!a.isOnHome(N.id),e[9]=a,e[10]=v):v=e[10],m=i.filter(Ns).filter(N=>!b.has(N.id)).filter(v).filter(y).sort(vs),e[3]=i,e[4]=a,e[5]=s,e[6]=d,e[7]=l,e[8]=m}else d=e[6],l=e[7],m=e[8];const c=m;let u;e[11]!==a||e[12]!==l?(u=n.jsx(Cs,{home:a,agents:l}),e[11]=a,e[12]=l,e[13]=u):u=e[13];const f=!!d;let p;e[14]!==c||e[15]!==a||e[16]!==f?(p=n.jsx(ks,{home:a,agents:c,hasSearch:f}),e[14]=c,e[15]=a,e[16]=f,e[17]=p):p=e[17];let h;return e[18]!==u||e[19]!==p?(h=n.jsxs(n.Fragment,{children:[u,p]}),e[18]=u,e[19]=p,e[20]=h):h=e[20],h}function vs(t,e){return(t.title??"").localeCompare(e.title??"")}function Ns(t){return t.id&&!lt(t.id)}function ws(t){return!!t}function Ss(t){return[t.id,t]}function _s(t){return t.id}function Ve(t){const e=k.c(7),{title:s,hint:o}=t;let i;e[0]!==s?(i=n.jsx("span",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:s}),e[0]=s,e[1]=i):i=e[1];let r;e[2]!==o?(r=o&&n.jsx("span",{className:"text-xs text-muted-foreground",children:o}),e[2]=o,e[3]=r):r=e[3];let a;return e[4]!==i||e[5]!==r?(a=n.jsxs("div",{className:"flex items-center justify-between px-1",children:[i,r]}),e[4]=i,e[5]=r,e[6]=a):a=e[6],a}function Cs(t){const e=k.c(14),{home:s,agents:o}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={activationConstraint:{distance:5}},e[0]=i):i=e[0];let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r={coordinateGetter:kt},e[1]=r):r=e[1];const a=Ae(re(Ee,i),re(Pe,r));let d;e[2]!==s?(d=p=>{const{active:h,over:x}=p;if(!x||h.id===x.id)return;const y=s.homeIds,b=y.indexOf(h.id),v=y.indexOf(x.id);b===-1||v===-1||s.reorder($t([...y],b,v)).catch(Ts)},e[2]=s,e[3]=d):d=e[3];const l=d,m=`${s.homeIds.length}/${ne}`;let c;e[4]!==m?(c=n.jsx(Ve,{title:"On home",hint:m}),e[4]=m,e[5]=c):c=e[5];let u;e[6]!==o||e[7]!==l||e[8]!==s||e[9]!==a?(u=o.length===0?n.jsx("p",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:"No agents on the home yet."}):n.jsx(Me,{sensors:a,collisionDetection:St,onDragEnd:l,children:n.jsx(_t,{items:o.map(Is),strategy:Ct,children:n.jsx("div",{className:"flex flex-col gap-1",children:o.map(p=>n.jsx(As,{agent:p,home:s},p.id))})})}),e[6]=o,e[7]=l,e[8]=s,e[9]=a,e[10]=u):u=e[10];let f;return e[11]!==c||e[12]!==u?(f=n.jsxs("div",{className:"flex flex-col gap-1.5",children:[c,u]}),e[11]=c,e[12]=u,e[13]=f):f=e[13],f}function Is(t){return t.id}function Ts(){return U.error("Couldn't reorder home — please try again.")}function ks(t){const e=k.c(6),{home:s,agents:o,hasSearch:i}=t,[r,a]=$.useState(20);let d;if(e[0]!==o||e[1]!==i||e[2]!==s||e[3]!==r){const l=o.slice(0,r);let m;e[5]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(Ve,{title:"Add to home"}),e[5]=m):m=e[5],d=n.jsxs("div",{className:"flex flex-col gap-1.5",children:[m,o.length===0?n.jsx("p",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:i?"No agents match.":"Every agent is on the home."}):n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"flex flex-col gap-1",children:l.map(c=>n.jsx(Ms,{agent:c,home:s},c.id))}),o.length>r&&n.jsxs("button",{type:"button",onClick:()=>a($s),className:"mt-1 self-center rounded-md px-3 py-1.5 text-xs text-muted-foreground hover:bg-accent/40 hover:text-foreground",children:["Load more (",o.length-r,")"]})]})]}),e[0]=o,e[1]=i,e[2]=s,e[3]=r,e[4]=d}else d=e[4];return d}function $s(t){return t+20}function Ke(t){const e=Z(t.metadata?.ui).filter(r=>!!r.resourceUri).length,s=t.metadata?.ui?.homePrompts,o=Array.isArray(s)?s.length:null,i=[];return e>0&&i.push(`${e} tile${e===1?"":"s"}`),o!==null&&o>0&&i.push(`${o} prompt${o===1?"":"s"}`),o===0&&i.push("prompts off"),i.join(" · ")}function As(t){const e=k.c(57),{agent:s,home:o}=t,[i,r]=$.useState(!1);let a;e[0]!==s.id?(a={id:s.id},e[0]=s.id,e[1]=a):a=e[1];const{attributes:d,listeners:l,setNodeRef:m,transform:c,transition:u,isDragging:f}=It(a),p=Ke(s)||"Quick access";let h;e[2]!==c?(h=Tt.Transform.toString(c),e[2]=c,e[3]=h):h=e[3];const x=f?.5:void 0,y=f?100:void 0;let b;e[4]!==h||e[5]!==x||e[6]!==y||e[7]!==u?(b={transform:h,transition:u,opacity:x,zIndex:y},e[4]=h,e[5]=x,e[6]=y,e[7]=u,e[8]=b):b=e[8];const v=b,N=f&&"shadow-lg";let j;e[9]!==N?(j=Q("rounded-lg border border-border bg-card",N),e[9]=N,e[10]=j):j=e[10];const g=`Drag to reorder ${s.title??s.id}`;let w;e[11]===Symbol.for("react.memo_cache_sentinel")?(w=n.jsx(He,{size:14}),e[11]=w):w=e[11];let S;e[12]!==d||e[13]!==l||e[14]!==g?(S=n.jsx("button",{type:"button",...d,...l,className:"shrink-0 text-muted-foreground hover:text-foreground cursor-grab active:cursor-grabbing outline-none focus-visible:ring-2 focus-visible:ring-ring rounded","aria-label":g,children:w}),e[12]=d,e[13]=l,e[14]=g,e[15]=S):S=e[15];let C;e[16]===Symbol.for("react.memo_cache_sentinel")?(C=()=>r(Es),e[16]=C):C=e[16];const _=s.title??s.id;let I;e[17]!==s.icon||e[18]!==_?(I=n.jsx(ce,{icon:s.icon,name:_,size:"sm"}),e[17]=s.icon,e[18]=_,e[19]=I):I=e[19];const T=s.title??s.id;let P;e[20]!==T?(P=n.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:T}),e[20]=T,e[21]=P):P=e[21];let M;e[22]!==p?(M=n.jsx("div",{className:"truncate text-xs text-muted-foreground",children:p}),e[22]=p,e[23]=M):M=e[23];let z;e[24]!==P||e[25]!==M?(z=n.jsxs("div",{className:"min-w-0 flex-1",children:[P,M]}),e[24]=P,e[25]=M,e[26]=z):z=e[26];const B=i&&"rotate-180";let O;e[27]!==B?(O=Q("shrink-0 text-muted-foreground transition-transform",B),e[27]=B,e[28]=O):O=e[28];let L;e[29]!==O?(L=n.jsx(De,{size:16,className:O}),e[29]=O,e[30]=L):L=e[30];let K;e[31]!==i||e[32]!==I||e[33]!==z||e[34]!==L?(K=n.jsxs("button",{type:"button",onClick:C,className:"flex min-w-0 flex-1 items-center gap-2.5 text-left outline-none","aria-expanded":i,children:[I,z,L]}),e[31]=i,e[32]=I,e[33]=z,e[34]=L,e[35]=K):K=e[35];let A;e[36]!==s.id||e[37]!==o?(A=()=>o.removeAgent(s.id).catch(Ps),e[36]=s.id,e[37]=o,e[38]=A):A=e[38];const V=`Remove ${s.title??s.id} from home`;let D;e[39]===Symbol.for("react.memo_cache_sentinel")?(D=n.jsx($e,{size:14}),e[39]=D):D=e[39];let E;e[40]!==A||e[41]!==V?(E=n.jsx("button",{type:"button",onClick:A,"aria-label":V,title:"Remove from home",className:"shrink-0 inline-flex size-7 items-center justify-center rounded-md text-muted-foreground hover:bg-destructive/10 hover:text-destructive",children:D}),e[40]=A,e[41]=V,e[42]=E):E=e[42];let R;e[43]!==S||e[44]!==K||e[45]!==E?(R=n.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-2.5",children:[S,K,E]}),e[43]=S,e[44]=K,e[45]=E,e[46]=R):R=e[46];let F;e[47]!==s||e[48]!==i||e[49]!==o?(F=i&&n.jsx(We,{agent:s,home:o}),e[47]=s,e[48]=i,e[49]=o,e[50]=F):F=e[50];let q;return e[51]!==m||e[52]!==v||e[53]!==R||e[54]!==F||e[55]!==j?(q=n.jsxs("div",{ref:m,style:v,className:j,children:[R,F]}),e[51]=m,e[52]=v,e[53]=R,e[54]=F,e[55]=j,e[56]=q):q=e[56],q}function Ps(){return U.error("Couldn't remove from home — please try again.")}function Es(t){return!t}function Ms({agent:t,home:e}){const[s,o]=$.useState(!1),[i,r]=$.useState(!1),a=Ke(t),d=async()=>{if(!e.atLimit){r(!0);try{await e.addAgent(t.id)}catch{U.error("Couldn't add to home — please try again.")}finally{r(!1)}}};return n.jsxs("div",{className:"rounded-lg border border-border bg-card",children:[n.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5",children:[n.jsxs("button",{type:"button",onClick:()=>o(l=>!l),className:"flex min-w-0 flex-1 items-center gap-3 text-left outline-none","aria-expanded":s,children:[n.jsx(ce,{icon:t.icon,name:t.title??t.id,size:"sm"}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:t.title??t.id}),a&&n.jsx("div",{className:"truncate text-xs text-muted-foreground",children:a})]}),n.jsx(De,{size:16,className:Q("shrink-0 text-muted-foreground transition-transform",s&&"rotate-180")})]}),n.jsx("button",{type:"button",onClick:d,disabled:i||e.atLimit,"aria-label":"Add to home",title:e.atLimit?`Home is full (${ne}) — remove an agent first`:"Add to home",className:"shrink-0 inline-flex size-7 items-center justify-center rounded-md bg-foreground text-background text-xs hover:opacity-90 disabled:opacity-40 disabled:cursor-not-allowed",children:i?n.jsx(le,{size:12,className:"animate-spin"}):n.jsx(ye,{size:14})})]}),s&&n.jsx(We,{agent:t,home:e})]})}function We(t){const e=k.c(17),{agent:s,home:o}=t,i=s.metadata?.ui;let r;e[0]!==i?(r=Z(i),e[0]=i,e[1]=r):r=e[1];const a=r;let d;e[2]!==s.connections?(d=(s.connections??[]).map(zs).sort(),e[2]=s.connections,e[3]=d):d=e[3];const l=d,m=s.metadata?.ui?.homePrompts;let c;e[4]!==s||e[5]!==l||e[6]!==o||e[7]!==a?(c=n.jsx(Ls,{agent:s,home:o,connectionIds:l,pinnedTiles:a}),e[4]=s,e[5]=l,e[6]=o,e[7]=a,e[8]=c):c=e[8];let u;e[9]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(Os,{}),e[9]=u):u=e[9];const f=m??null;let p;e[10]!==s||e[11]!==o||e[12]!==f?(p=n.jsx($.Suspense,{fallback:u,children:n.jsx(Us,{agent:s,home:o,curated:f})}),e[10]=s,e[11]=o,e[12]=f,e[13]=p):p=e[13];let h;return e[14]!==c||e[15]!==p?(h=n.jsxs("div",{className:"border-t border-border px-3 py-2 flex flex-col gap-3",children:[c,p]}),e[14]=c,e[15]=p,e[16]=h):h=e[16],h}function zs(t){return t.connection_id}function Os(){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 Ls({agent:t,home:e,connectionIds:s,pinnedTiles:o}){const i=Ue(),{data:r,isLoading:a}=se({queryKey:te.projectConnectionDetails(t.id,s),enabled:s.length>0,queryFn:async()=>(await Promise.all(s.map(async u=>{try{const{item:f}=await i.call("COLLECTION_CONNECTIONS_GET",{id:u}),p=(f?.tools??[]).flatMap(h=>{const x=Re(h._meta);return x?[{name:h.name,description:h.description,resourceUri:x,inputSchema:h.inputSchema}]:[]});return{id:u,title:f?.title??u,icon:f?.icon??null,uiTools:p}}catch{return{id:u,title:u,icon:null,uiTools:[]}}}))).filter(u=>u.uiTools.length>0)});if(s.length===0)return null;if(a)return n.jsxs("div",{className:"flex flex-col gap-1 py-0.5",children:[n.jsx(H,{className:"h-7 w-full"}),n.jsx(H,{className:"h-7 w-2/3"})]});if(!r||r.length===0)return null;const d=new Map;for(const c of r)for(const u of c.uiTools)d.set(`${c.id}:${u.name}`,{conn:c,tool:u});const l=c=>{if(c.toolName&&c.connectionId)return d.get(`${c.connectionId}:${c.toolName}`);for(const[,u]of d)if(u.conn.id===c.connectionId&&u.tool.resourceUri===c.resourceUri)return u},m=o.some(c=>!!l(c));return n.jsxs("div",{className:"flex flex-col gap-2",children:[m&&n.jsxs("div",{className:"flex flex-col gap-0.5",children:[n.jsx("span",{className:"text-[10px] font-medium uppercase tracking-wide text-muted-foreground px-2",children:"Pinned tiles"}),o.map(c=>{const u=l(c);return u?n.jsx(Rs,{agent:t,home:e,connection:u.conn,tool:u.tool,tile:c},c.tileId??`${c.connectionId}:${c.resourceUri}:${c.toolName}`):null})]}),n.jsxs("div",{className:"flex flex-col gap-0.5",children:[n.jsx("span",{className:"text-[10px] font-medium uppercase tracking-wide text-muted-foreground px-2",children:"Add tile"}),r.map(c=>c.uiTools.map(u=>n.jsx(Fs,{agent:t,home:e,connection:c,tool:u},`add:${c.id}:${u.name}`)))]})]})}function qe(t,e){const s={};for(const[o,i]of Object.entries(t)){const r=e[o]?.type;if((r==="object"||r==="array")&&typeof i=="string"){if(!i.trim())continue;try{s[o]=JSON.parse(i)}catch{return null}}else if((r==="number"||r==="integer")&&typeof i=="string"){if(!i.trim())continue;s[o]=Number(i)}else i!==""&&i!=null&&(s[o]=i)}return s}function Ds(t,e){if(!t||!e)return{};const s={};for(const[o,i]of Object.entries(t)){const r=e[o]?.type;(r==="object"||r==="array")&&i!=null&&typeof i!="string"?s[o]=JSON.stringify(i,null,2):s[o]=i}return s}function Hs(t){if(!t)return"";const e=Object.entries(t).filter(([,s])=>s!=null&&s!=="");return e.length===0?"":e.slice(0,3).map(([s,o])=>{const i=typeof o=="object"?JSON.stringify(o):String(o);return`${s}=${i.length>20?`${i.slice(0,20)}…`:i}`}).join(", ")}function Rs({agent:t,home:e,connection:s,tool:o,tile:i}){const[r,a]=$.useState(!1),[d,l]=$.useState(!1),m=o.inputSchema?.properties&&Object.keys(o.inputSchema.properties).length>0,[c,u]=$.useState(()=>Ds(i.toolInput,o.inputSchema?.properties)),f=async()=>{a(!0);try{const x=Z(t.metadata?.ui),y=i.tileId?x.filter(v=>v.tileId!==i.tileId):x.filter(v=>v!==i),b={...t.metadata??{},ui:{...t.metadata?.ui??{},homeTile:null,homeTiles:y}};await e.saveAgentMetadata(t,b),l(!1)}catch(x){console.error("[home-tiles] failed to remove tile",x),U.error("Couldn't update home — please try again.")}finally{a(!1)}},p=async()=>{a(!0);try{let x;if(m&&o.inputSchema?.properties){const N=qe(c,o.inputSchema.properties);if(!N){U.error("Invalid JSON in one of the fields — please fix it."),a(!1);return}Object.keys(N).length>0&&(x=N)}const b=Z(t.metadata?.ui).map(N=>(i.tileId?N.tileId===i.tileId:N===i)?{...N,toolInput:x}:N),v={...t.metadata??{},ui:{...t.metadata?.ui??{},homeTile:null,homeTiles:b}};await e.saveAgentMetadata(t,v),l(!1)}catch(x){console.error("[home-tiles] failed to save tile",x),U.error("Couldn't update home — please try again.")}finally{a(!1)}},h=Hs(i.toolInput);return n.jsxs("div",{className:"flex flex-col rounded-md bg-accent/20",children:[n.jsxs("div",{className:"flex items-center gap-2.5 px-2 py-1",children:[n.jsx(Fe,{icon:s.icon,name:s.title,size:"xs"}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("div",{className:"truncate text-sm text-foreground",children:je(o.name)}),h&&n.jsx("div",{className:"truncate text-[10px] text-muted-foreground font-mono",children:h})]}),m&&n.jsx("button",{type:"button",onClick:()=>l(x=>!x),"aria-label":"Configure tile props",title:"Configure tile props",className:"inline-flex size-7 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-accent/60",children:n.jsx(gt,{size:14})}),n.jsx(ve,{isPinned:!0,submitting:r,onClick:f,label:"Remove from home"})]}),d&&m&&o.inputSchema?.properties&&n.jsxs("div",{className:"px-3 pb-2 pt-1 flex flex-col gap-2",children:[n.jsx(Be,{properties:o.inputSchema.properties,required:o.inputSchema.required,values:c,onChange:(x,y)=>u(b=>({...b,[x]:y}))}),n.jsxs("div",{className:"flex items-center gap-2 justify-end",children:[n.jsx(Y,{variant:"ghost",size:"sm",className:"h-7 text-xs",onClick:()=>l(!1),children:"Cancel"}),n.jsx(Y,{size:"sm",className:"h-7 text-xs",disabled:r,onClick:p,children:r?n.jsx(le,{size:12,className:"animate-spin"}):"Save"})]})]})]})}function Fs({agent:t,home:e,connection:s,tool:o}){const[i,r]=$.useState(!1),[a,d]=$.useState(!1),l=o.inputSchema?.properties&&Object.keys(o.inputSchema.properties).length>0,[m,c]=$.useState({}),u=async()=>{if(l&&!a){d(!0);return}if(!e.isOnHome(t.id)&&e.atLimit){U.error(`Home is full (${ne}) — remove an agent first`);return}await f()},f=async()=>{r(!0);try{let p;if(l&&o.inputSchema?.properties){const b=qe(m,o.inputSchema.properties);if(!b){U.error("Invalid JSON in one of the fields — please fix it."),r(!1);return}Object.keys(b).length>0&&(p=b)}const x=[...Z(t.metadata?.ui),{tileId:crypto.randomUUID(),connectionId:s.id,resourceUri:o.resourceUri,toolName:o.name,...p?{toolInput:p}:{}}],y={...t.metadata??{},ui:{...t.metadata?.ui??{},homeTile:null,homeTiles:x}};await e.saveAgentMetadata(t,y),d(!1),c({})}catch(p){console.error("[home-tiles] failed to add tile",p),U.error("Couldn't update home — please try again.")}finally{r(!1)}};return n.jsxs("div",{className:"flex flex-col rounded-md hover:bg-accent/40",children:[n.jsxs("div",{className:"flex items-center gap-2.5 px-2 py-1",children:[n.jsx(Fe,{icon:s.icon,name:s.title,size:"xs"}),n.jsx("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:je(o.name)}),n.jsx(ve,{isPinned:!1,submitting:i,onClick:u,label:"Add to home"})]}),a&&l&&o.inputSchema?.properties&&n.jsxs("div",{className:"px-3 pb-2 pt-1 flex flex-col gap-2",children:[n.jsx(Be,{properties:o.inputSchema.properties,required:o.inputSchema.required,values:m,onChange:(p,h)=>c(x=>({...x,[p]:h}))}),n.jsxs("div",{className:"flex items-center gap-2 justify-end",children:[n.jsx(Y,{variant:"ghost",size:"sm",className:"h-7 text-xs",onClick:()=>{d(!1),c({})},children:"Cancel"}),n.jsx(Y,{size:"sm",className:"h-7 text-xs",disabled:i,onClick:f,children:i?n.jsx(le,{size:12,className:"animate-spin"}):"Pin"})]})]})]})}function ve(t){const e=k.c(11),{isPinned:s,submitting:o,onClick:i,label:r}=t,a=s?"text-muted-foreground hover:bg-destructive/10 hover:text-destructive":"bg-foreground text-background hover:opacity-90";let d;e[0]!==a?(d=Q("inline-flex size-7 shrink-0 items-center justify-center rounded-md text-xs transition-colors disabled:opacity-50 disabled:cursor-progress",a),e[0]=a,e[1]=d):d=e[1];let l;e[2]!==s||e[3]!==o?(l=o?n.jsx(le,{size:12,className:"animate-spin"}):s?n.jsx(yt,{size:14}):n.jsx(ye,{size:14}),e[2]=s,e[3]=o,e[4]=l):l=e[4];let m;return e[5]!==r||e[6]!==i||e[7]!==o||e[8]!==d||e[9]!==l?(m=n.jsx("button",{type:"button",onClick:i,disabled:o,"aria-label":r,title:r,className:d,children:l}),e[5]=r,e[6]=i,e[7]=o,e[8]=d,e[9]=l,e[10]=m):m=e[10],m}function Us(t){const e=k.c(32),{agent:s,home:o,curated:i}=t,{org:r}=J();let a;e[0]!==s.id||e[1]!==r.id||e[2]!==r.slug?(a={connectionId:s.id,orgId:r.id,orgSlug:r.slug},e[0]=s.id,e[1]=r.id,e[2]=r.slug,e[3]=a):a=e[3];const d=ae(a);let l;e[4]!==s.id||e[5]!==r.id?(l=te.agentPrompts(r.id,s.id),e[4]=s.id,e[5]=r.id,e[6]=l):l=e[6];let m;e[7]!==d?(m=async()=>{const{prompts:g}=await d.listPrompts();return g.map(Ws)},e[7]=d,e[8]=m):m=e[8];let c;e[9]!==l||e[10]!==m?(c={queryKey:l,queryFn:m,staleTime:3e4,retry:!1},e[9]=l,e[10]=m,e[11]=c):c=e[11];const{data:u,isLoading:f,error:p}=se(c),h=be(r.slug);let x,y;if(e[12]!==s.id||e[13]!==u||e[14]!==h.prompts){let g;e[17]!==s.id?(g=S=>S.agentId===s.id&&S.promptName,e[17]=s.id,e[18]=g):g=e[18],x=h.prompts.filter(g).map(Ks);let w;e[19]!==u?(w=u??[],e[19]=u,e[20]=w):w=e[20],y=[...w];for(const S of x)y.some(C=>C.name===S.name)||y.push(S);e[12]=s.id,e[13]=u,e[14]=h.prompts,e[15]=x,e[16]=y}else x=e[15],y=e[16];if(f&&x.length===0){let g;return e[21]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx(H,{className:"h-7 w-full"}),n.jsx(H,{className:"h-7 w-2/3"})]}),e[21]=g):g=e[21],g}if(p&&x.length===0)return console.error("[home-tiles] listPrompts failed for agent",s.id,p),null;if(y.length===0)return null;let b;e[22]!==i||e[23]!==y?(b=i??y.map(Vs),e[22]=i,e[23]=y,e[24]=b):b=e[24];let v;e[25]!==b?(v=new Set(b),e[25]=b,e[26]=v):v=e[26];const N=v;let j;return e[27]!==s||e[28]!==o||e[29]!==y||e[30]!==N?(j=n.jsx("div",{className:"flex flex-col gap-0.5",children:y.map(g=>n.jsx(qs,{agent:s,home:o,prompt:g,allPromptNames:y.map(Bs),isPinned:N.has(g.name)},g.name))}),e[27]=s,e[28]=o,e[29]=y,e[30]=N,e[31]=j):j=e[31],j}function Bs(t){return t.name}function Vs(t){return t.name}function Ks(t){return{name:t.promptName,title:t.title,description:t.description}}function Ws(t){return{name:t.name,title:t.title,description:t.description}}function qs({agent:t,home:e,prompt:s,allPromptNames:o,isPinned:i}){const[r,a]=$.useState(!1),d=async()=>{if(!i&&!e.isOnHome(t.id)&&e.atLimit){U.error(`Home is full (${ne}) — remove an agent first`);return}a(!0);try{const l=t.metadata?.ui?.homePrompts;let m;Array.isArray(l)?m=i?l.filter(u=>u!==s.name):[...l,s.name]:m=i?o.filter(u=>u!==s.name):o;const c={...t.metadata??{},ui:{...t.metadata?.ui??{},homePrompts:m}};await e.saveAgentMetadata(t,c)}catch(l){console.error("[home-tiles] failed to toggle prompt",l),U.error("Couldn't update home — please try again.")}finally{a(!1)}};return n.jsxs("div",{className:"flex items-center gap-2.5 rounded-md px-2 py-1 hover:bg-accent/40",children:[n.jsx("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:s.title??je(s.name)}),n.jsx(ve,{isPinned:i,submitting:r,onClick:d,label:i?"Remove from home":"Add to home"})]})}function Gs(){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},Qs)}),t[0]=e):e=t[0],e}function Qs(t,e){return n.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-border p-2.5",children:[n.jsx(H,{className:"size-8 rounded-md"}),n.jsxs("div",{className:"flex-1 space-y-1.5",children:[n.jsx(H,{className:"h-3 w-1/2"}),n.jsx(H,{className:"h-2.5 w-1/3"})]})]},e)}const ee=1,Ge=`home-board.layout.v${ee}`;function Qe(t){return`home-board.layout.v${ee}.${t}`}const Je={version:ee,tiles:{},hidden:[]};function fe(t){return!t||t.version!==ee?Je:{version:ee,tiles:t.tiles??{},hidden:Array.isArray(t.hidden)?t.hidden:[]}}function Js(t){return Object.keys(t.tiles).length>0||t.hidden.length>0}function Xs(t){try{const e=localStorage.getItem(Qe(t));return e?fe(JSON.parse(e)):void 0}catch{return}}function Se(t,e){try{localStorage.setItem(Qe(t),JSON.stringify(e))}catch{}}async function _e(t,e){if(!(await fetch(`/api/${t}/kv/${Ge}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok)throw new Error("Failed to save board layout")}function Zs(t){const e=k.c(24),s=xe();let o;e[0]!==t?(o=te.boardLayout(t),e[0]=t,e[1]=o):o=e[1];const i=o;let r;e[2]!==t?(r=Xs(t),e[2]=t,e[3]=r):r=e[3];const a=r;let d;e[4]!==a||e[5]!==t?(d=async()=>{const b=await fetch(`/api/${t}/kv/${Ge}`);if(b.status===404)return a&&Js(a)?(await _e(t,a),a):Je;if(!b.ok)throw new Error("Failed to load board layout");const v=await b.json(),N=fe(v.value);return Se(t,N),N},e[4]=a,e[5]=t,e[6]=d):d=e[6];let l;e[7]!==a||e[8]!==i||e[9]!==d?(l={queryKey:i,queryFn:d,initialData:a,staleTime:0,refetchOnWindowFocus:!1},e[7]=a,e[8]=i,e[9]=d,e[10]=l):l=e[10];const{data:m,isLoading:c}=se(l);let u;e[11]!==t?(u={mutationFn:b=>_e(t,b)},e[11]=t,e[12]=u):u=e[12];const f=st(u);let p;e[13]!==f||e[14]!==t||e[15]!==s||e[16]!==i?(p=b=>{Se(t,b),s.setQueryData(i,b),f.mutate(b)},e[13]=f,e[14]=t,e[15]=s,e[16]=i,e[17]=p):p=e[17];const h=p;let x;e[18]!==m?(x=fe(m),e[18]=m,e[19]=x):x=e[19];let y;return e[20]!==c||e[21]!==h||e[22]!==x?(y={layout:x,isLoading:c,save:h},e[20]=c,e[21]=h,e[22]=x,e[23]=y):y=e[23],y}const Xe=$.createContext(null);function Ys(t){const e=k.c(24),{children:s}=t,{org:o}=J(),i=Zs(o.slug),[r,a]=$.useState(!1),[d,l]=$.useState(null);let m;e[0]!==i.layout?(m=()=>{l(i.layout),a(!0)},e[0]=i.layout,e[1]=m):m=e[1];const c=m;let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=()=>{l(null),a(!1)},e[2]=u):u=e[2];const f=u;let p;e[3]!==d||e[4]!==i?(p=()=>{d&&i.save(d),l(null),a(!1)},e[3]=d,e[4]=i,e[5]=p):p=e[5];const h=p,x=r&&d!==null,y=x?d:i.layout;let b;e[6]!==d||e[7]!==x||e[8]!==i.layout?(b=x?JSON.stringify(d)!==JSON.stringify(i.layout):!1,e[6]=d,e[7]=x,e[8]=i.layout,e[9]=b):b=e[9];const v=b;let N;e[10]!==r||e[11]!==i?(N=S=>{r?l(S):i.save(S)},e[10]=r,e[11]=i,e[12]=N):N=e[12];const j=N;let g;e[13]!==j||e[14]!==c||e[15]!==v||e[16]!==r||e[17]!==y||e[18]!==h||e[19]!==i.isLoading?(g={isEditMode:r,enter:c,cancel:f,save:h,hasChanges:v,layout:y,isLayoutLoading:i.isLoading,commitLayout:j},e[13]=j,e[14]=c,e[15]=v,e[16]=r,e[17]=y,e[18]=h,e[19]=i.isLoading,e[20]=g):g=e[20];let w;return e[21]!==s||e[22]!==g?(w=n.jsx(Xe.Provider,{value:g,children:s}),e[21]=s,e[22]=g,e[23]=w):w=e[23],w}function Ze(){const t=$.useContext(Xe);if(!t)throw new Error("useHomeEdit must be used within a HomeEditProvider");return t}function en({agentId:t}){const{org:e,locator:s}=J(),o=ae({connectionId:t,orgId:e.id,orgSlug:e.slug}),{create:i}=os(),{setTaskId:r}=Lt(),[a,d]=$.useState(null),[l,m]=$.useState(!1),c=$.useRef(!1),u=async(y,b)=>{if(!o){U.error("MCP client not available");return}if(!c.current){c.current=!0,m(!0);try{const v=await is(o,y.name,b),N={type:"doc",content:[{type:"paragraph",content:[Ft({id:y.name,name:Ut(y.name,Bt(y._meta)),metadata:v.messages,char:"/",kind:"prompt",args:b}),{type:"text",text:" "}]}]},j=crypto.randomUUID();rs(sessionStorage,s,j,{tiptapDoc:N}),await i({id:j,virtual_mcp_id:t}),r(j,t,{autosend:!0})}catch(v){console.error("[start-thread-from-prompt] failed",v),U.error("Failed to start thread. Please try again.")}finally{c.current=!1,m(!1)}}},f=async y=>{if(!c.current){if(y.arguments&&y.arguments.length>0){d(y);return}await u(y)}},p=async y=>{if(!a)return;const b=a;d(null),await u(b,y)};return{start:f,startBlank:async y=>{if(!c.current){c.current=!0,m(!0);try{const b=crypto.randomUUID();await i({id:b,virtual_mcp_id:t}),r(b,t,y?.main?{main:y.main}:void 0)}catch(b){console.error("[start-thread-from-prompt] startBlank failed",b),U.error("Failed to start thread. Please try again.")}finally{c.current=!1,m(!1)}}},dialog:n.jsx(Rt,{prompt:a,setPrompt:y=>d(y),onSubmit:p}),dialogPrompt:a,starting:l}}const W=4,G=100,Ce=12,tn=5,sn={w:2,h:2};class pe extends $.Component{state={hasError:!1};static getDerivedStateFromError(e){return{hasError:!0,message:e instanceof Error?e.message:"Unknown error"}}componentDidCatch(e,s){console.error("[home-tiles] tile crashed:",e,s.componentStack)}render(){return this.state.hasError?n.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2 p-4 text-center",children:[n.jsx("span",{className:"flex size-8 items-center justify-center rounded-md bg-destructive/10 text-destructive",children:n.jsx(nt,{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:o,renderTile:i,onMove:r,onResize:a,onRemove:d}=t,l=ge(),m=$.useRef(null),[c,u]=$.useState(null),[f,p]=$.useState(null);let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h={activationConstraint:{distance:4}},e[0]=h):h=e[0];const x=Ae(re(Ee,h),re(Pe)),y=s.reduce(on,0),b=o?Math.max(y+2,4):Math.max(y,1);let v;e[1]===Symbol.for("react.memo_cache_sentinel")?(v=()=>{const A=m.current?.getBoundingClientRect();return A?{cellWidth:A.width/W,cellHeight:G}:null},e[1]=v):v=e[1];const N=v;let j;e[2]===Symbol.for("react.memo_cache_sentinel")?(j=A=>{u(String(A.active.id)),p(N())},e[2]=j):j=e[2];const g=j;let w;e[3]!==f||e[4]!==r||e[5]!==s?(w=A=>{const V=String(A.active.id),D=f??N();if(u(null),p(null),!D||D.cellWidth<=0)return;const E=s.find(q=>q.id===V);if(!E)return;const R=Math.round(A.delta.x/D.cellWidth),F=Math.round(A.delta.y/D.cellHeight);R===0&&F===0||r(V,{x:E.x+R,y:E.y+F})},e[3]=f,e[4]=r,e[5]=s,e[6]=w):w=e[6];const S=w;if(l){let A;if(e[7]!==i||e[8]!==s){let D;e[10]!==i?(D=E=>n.jsx("div",{className:"group bg-card card-shadow rounded-2xl overflow-hidden",style:{minHeight:G},children:n.jsx(pe,{children:i(E)})},E.id),e[10]=i,e[11]=D):D=e[11],A=s.map(D),e[7]=i,e[8]=s,e[9]=A}else A=e[9];let V;return e[12]!==A?(V=n.jsx("div",{className:"flex flex-col gap-3 px-4 pb-8",children:A}),e[12]=A,e[13]=V):V=e[13],V}let C,_,I,T,P,M,z,B,O;if(e[14]!==c||e[15]!==f||e[16]!==o||e[17]!==S||e[18]!==d||e[19]!==a||e[20]!==i||e[21]!==x||e[22]!==s||e[23]!==b){const A=c?s.find(X=>X.id===c):null;_=Me,B=x,O=g,I=S;const V=b*G,D=o?G*4:G;let E;e[33]!==V||e[34]!==D?(E={height:V,minHeight:D},e[33]=V,e[34]=D,e[35]=E):E=e[35];let R;e[36]!==o||e[37]!==s||e[38]!==b?(R=o&&n.jsx(rn,{rows:b,tiles:s}),e[36]=o,e[37]=s,e[38]=b,e[39]=R):R=e[39];let F;if(e[40]!==c||e[41]!==o||e[42]!==d||e[43]!==a||e[44]!==i||e[45]!==s){let X;e[47]!==c||e[48]!==o||e[49]!==d||e[50]!==a||e[51]!==i?(X=ie=>n.jsx(an,{tile:ie,isEditMode:o,isDragging:c===ie.id,onResize:a,onRemove:d,children:i(ie)},ie.id),e[47]=c,e[48]=o,e[49]=d,e[50]=a,e[51]=i,e[52]=X):X=e[52],F=s.map(X),e[40]=c,e[41]=o,e[42]=d,e[43]=a,e[44]=i,e[45]=s,e[46]=F}else F=e[46];e[53]!==E||e[54]!==R||e[55]!==F?(T=n.jsxs("div",{ref:m,className:"relative w-full",style:E,children:[R,F]}),e[53]=E,e[54]=R,e[55]=F,e[56]=T):T=e[56],C=At,P=null;const q=A&&f?A.w*f.cellWidth-Ce:void 0,de=A&&f?A.h*f.cellHeight-Ce:void 0;e[57]!==q||e[58]!==de?(M={width:q,height:de},e[57]=q,e[58]=de,e[59]=M):M=e[59],z=A&&n.jsx("div",{className:"bg-card card-shadow rounded-2xl shadow-2xl ring-2 ring-primary/40 h-full overflow-hidden opacity-95",children:n.jsx(pe,{children:i(A)})}),e[14]=c,e[15]=f,e[16]=o,e[17]=S,e[18]=d,e[19]=a,e[20]=i,e[21]=x,e[22]=s,e[23]=b,e[24]=C,e[25]=_,e[26]=I,e[27]=T,e[28]=P,e[29]=M,e[30]=z,e[31]=B,e[32]=O}else C=e[24],_=e[25],I=e[26],T=e[27],P=e[28],M=e[29],z=e[30],B=e[31],O=e[32];let L;e[60]!==C||e[61]!==P||e[62]!==M||e[63]!==z?(L=n.jsx(C,{dropAnimation:P,style:M,children:z}),e[60]=C,e[61]=P,e[62]=M,e[63]=z,e[64]=L):L=e[64];let K;return e[65]!==_||e[66]!==I||e[67]!==T||e[68]!==L||e[69]!==B||e[70]!==O?(K=n.jsxs(_,{sensors:B,onDragStart:O,onDragEnd:I,children:[T,L]}),e[65]=_,e[66]=I,e[67]=T,e[68]=L,e[69]=B,e[70]=O,e[71]=K):K=e[71],K}function on(t,e){return Math.max(t,e.y+e.h)}function rn(t){const e=k.c(7),{rows:s,tiles:o}=t;let i;e[0]!==o?(i=(l,m)=>o.some(c=>l>=c.x&&l<c.x+c.w&&m>=c.y&&m<c.y+c.h),e[0]=o,e[1]=i):i=e[1];const r=i;let a;if(e[2]!==r||e[3]!==s){a=[];for(let l=0;l<s;l++)for(let m=0;m<W;m++)r(m,l)||a.push({x:m,y:l});e[2]=r,e[3]=s,e[4]=a}else a=e[4];let d;return e[5]!==a?(d=n.jsx("div",{className:"absolute inset-0 pointer-events-none",children:a.map(ln)}),e[5]=a,e[6]=d):d=e[6],d}function ln(t){return n.jsx("div",{className:"absolute p-1",style:{left:`${t.x/W*100}%`,top:t.y*G,width:`${1/W*100}%`,height:G},children:n.jsx("div",{className:"h-full w-full rounded-2xl border border-dashed border-border/60"})},`${t.x}-${t.y}`)}function an(t){const e=k.c(31),{tile:s,isEditMode:o,isDragging:i,onResize:r,onRemove:a,children:d}=t,l=!o;let m;e[0]!==l||e[1]!==s.id?(m={id:s.id,disabled:l},e[0]=l,e[1]=s.id,e[2]=m):m=e[2];const{setNodeRef:c,attributes:u,listeners:f,isDragging:p}=Pt(m),h=`${s.x/W*100}%`,x=`${s.w/W*100}%`,y=s.y*G,b=s.h*G,v=p||i,N=!v&&"transition-[left,top,width,height,opacity] duration-200 ease-out",j=v&&"opacity-30";let g;e[3]!==N||e[4]!==j?(g=Q("absolute p-1 will-change-[left,top,width,height,opacity]",N,j),e[3]=N,e[4]=j,e[5]=g):g=e[5];let w;e[6]!==b||e[7]!==h||e[8]!==y||e[9]!==x?(w={left:h,top:y,width:x,height:b},e[6]=b,e[7]=h,e[8]=y,e[9]=x,e[10]=w):w=e[10];const S=o&&"outline outline-1 outline-transparent hover:outline-primary/40";let C;e[11]!==S?(C=Q("group relative h-full bg-card card-shadow rounded-2xl overflow-hidden",S),e[11]=S,e[12]=C):C=e[12];let _;e[13]!==u||e[14]!==o||e[15]!==f||e[16]!==a||e[17]!==r||e[18]!==s?(_=o&&n.jsxs(n.Fragment,{children:[n.jsx("button",{type:"button",...u,...f,className:"absolute top-2 left-2 z-10 flex size-8 items-center justify-center rounded-md bg-background/90 border border-border text-muted-foreground hover:text-foreground hover:bg-muted cursor-grab active:cursor-grabbing","aria-label":"Drag tile",children:n.jsx(He,{size:16})}),n.jsx("div",{className:"absolute top-2 right-2 z-10 flex items-center gap-1",children:n.jsx(cn,{tile:s,onResize:r,onRemove:a})})]}),e[13]=u,e[14]=o,e[15]=f,e[16]=a,e[17]=r,e[18]=s,e[19]=_):_=e[19];let I;e[20]!==d?(I=n.jsx("div",{className:"h-full overflow-hidden",children:n.jsx(pe,{children:d})}),e[20]=d,e[21]=I):I=e[21];let T;e[22]!==I||e[23]!==C||e[24]!==_?(T=n.jsxs("div",{className:C,children:[_,I]}),e[22]=I,e[23]=C,e[24]=_,e[25]=T):T=e[25];let P;return e[26]!==c||e[27]!==T||e[28]!==g||e[29]!==w?(P=n.jsx("div",{ref:c,className:g,style:w,children:T}),e[26]=c,e[27]=T,e[28]=g,e[29]=w,e[30]=P):P=e[30],P}function cn(t){const e=k.c(20),{tile:s,onResize:o,onRemove:i}=t,[r,a]=$.useState(!1);let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(ls,{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(bt,{size:16})})}),e[0]=d):d=e[0];let l;e[1]!==o||e[2]!==s.id?(l=y=>{o(s.id,y),a(!1)},e[1]=o,e[2]=s.id,e[3]=l):l=e[3];let m;e[4]!==l||e[5]!==s?(m=n.jsx(dn,{tile:s,onPick:l}),e[4]=l,e[5]=s,e[6]=m):m=e[6];let c;e[7]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(as,{}),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(us,{size:14,className:"mr-2"}),e[11]=f):f=e[11];let p;e[12]!==u?(p=n.jsxs(cs,{onSelect:u,className:"text-destructive focus:text-destructive",children:[f,"Remove tile"]}),e[12]=u,e[13]=p):p=e[13];let h;e[14]!==m||e[15]!==p?(h=n.jsxs(ds,{align:"end",className:"w-auto",children:[m,c,p]}),e[14]=m,e[15]=p,e[16]=h):h=e[16];let x;return e[17]!==r||e[18]!==h?(x=n.jsxs(ms,{open:r,onOpenChange:a,children:[d,h]}),e[17]=r,e[18]=h,e[19]=x):x=e[19],x}function dn(t){const e=k.c(19),{tile:s,onPick:o}=t,i=s.minW??1,r=s.minH??1,[a,d]=$.useState(null);let l;e[0]!==a||e[1]!==s.h||e[2]!==s.w?(l=a??{w:s.w,h:s.h},e[0]=a,e[1]=s.h,e[2]=s.w,e[3]=l):l=e[3];const m=l;let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx("span",{className:"text-xs text-muted-foreground",children:"Size"}),e[4]=c):c=e[4];let u;e[5]!==m.h||e[6]!==m.w?(u=n.jsxs("div",{className:"mb-2 flex items-center justify-between gap-4",children:[c,n.jsxs("span",{className:"text-xs font-medium tabular-nums",children:[m.w," × ",m.h]})]}),e[5]=m.h,e[6]=m.w,e[7]=u):u=e[7];let f,p;e[8]===Symbol.for("react.memo_cache_sentinel")?(f={gridTemplateColumns:`repeat(${W}, 1.25rem)`},p=()=>d(null),e[8]=f,e[9]=p):(f=e[8],p=e[9]);let h;e[10]!==m.h||e[11]!==m.w||e[12]!==r||e[13]!==i||e[14]!==o?(h=n.jsx("div",{className:"grid w-max gap-1",style:f,onPointerLeave:p,children:Array.from({length:tn},(y,b)=>Array.from({length:W},(v,N)=>{const j=N+1,g=b+1,w=j<i||g<r,S=j<=m.w&&g<=m.h;return n.jsx("button",{type:"button",disabled:w,"aria-label":`${j} by ${g}`,onPointerEnter:()=>d({w:j,h:g}),onClick:()=>o({w:j,h:g}),className:Q("size-5 rounded-sm border transition-colors",S?"border-primary bg-primary/30":"border-border bg-muted",w?"cursor-not-allowed opacity-40":"cursor-pointer hover:border-primary/60")},`${j}x${g}`)}))}),e[10]=m.h,e[11]=m.w,e[12]=r,e[13]=i,e[14]=o,e[15]=h):h=e[15];let x;return e[16]!==u||e[17]!==h?(x=n.jsxs("div",{className:"px-2 py-1.5",children:[u,h]}),e[16]=u,e[17]=h,e[18]=x):x=e[18],x}function mn(t,e,s){return t.some(o=>e>=o.x&&e<o.x+o.w&&s>=o.y&&s<o.y+o.h)}function he(t,e,s){for(let o=0;o<100;o++)for(let i=0;i<=W-e;i++){let r=!0;for(let a=0;a<s&&r;a++)for(let d=0;d<e&&r;d++)mn(t,i+d,o+a)&&(r=!1);if(r)return{x:i,y:o}}return{x:0,y:0}}function me(t,e,s={w:1,h:1}){const o=Math.max(s.w,Math.min(W,t)),i=Math.max(s.h,Math.min(6,e));return{w:o,h:i}}function ue(t,e,s){const o=Math.max(0,Math.min(W-s,t)),i=Math.max(0,e);return{x:o,y:i}}function un(t,e,s){const o=t.find(l=>l.id===e);if(!o)return t;const i=t.filter(l=>l.id!==e),r=i.find(l=>s.x>=l.x&&s.x<l.x+l.w&&s.y>=l.y&&s.y<l.y+l.h);if(r&&r.w===o.w&&r.h===o.h)return t.map(l=>l.id===e?{...l,x:r.x,y:r.y}:l.id===r.id?{...l,x:o.x,y:o.y}:l);const d=[{...o,x:s.x,y:s.y}];for(const l of i){const m=he(d,l.w,l.h);d.push({...l,x:m.x,y:m.y})}return d}function fn(t){const e=k.c(35),{layout:s,isLayoutLoading:o,commitLayout:i}=Ze();let r;e[0]!==s.hidden?(r=new Set(s.hidden),e[0]=s.hidden,e[1]=r):r=e[1];const a=r;let d,l;if(e[2]!==t||e[3]!==a||e[4]!==s.tiles){l=[];let v;e[7]!==a?(v=j=>j.pinned||!a.has(j.id),e[7]=a,e[8]=v):v=e[8];const N=t.filter(v);d=new Map;for(const j of t)j.minSize&&d.set(j.id,j.minSize);for(const j of N){const g=s.tiles[j.id];if(!g)continue;const w=d.get(j.id),{w:S,h:C}=me(g.w,g.h,w),{x:_,y:I}=ue(g.x,g.y,S);l.push({id:j.id,x:_,y:I,w:S,h:C,minW:w?.w,minH:w?.h})}for(const j of N){if(l.some(I=>I.id===j.id))continue;const g=j.defaultSize??sn,w=d.get(j.id),{w:S,h:C}=me(g.w,g.h,w),_=he(l,S,C);l.push({id:j.id,x:_.x,y:_.y,w:S,h:C,minW:w?.w,minH:w?.h})}e[2]=t,e[3]=a,e[4]=s.tiles,e[5]=d,e[6]=l}else d=e[5],l=e[6];let m;e[9]!==t?(m=new Set(t.map(pn)),e[9]=t,e[10]=m):m=e[10];const c=m;let u;e[11]!==c||e[12]!==i?(u=(v,N)=>{const j={};for(const g of v)j[g.id]={x:g.x,y:g.y,w:g.w,h:g.h};i({version:ee,tiles:j,hidden:N.filter(g=>c.has(g))})},e[11]=c,e[12]=i,e[13]=u):u=e[13];const f=u;let p;e[14]!==l?(p={visible:l},e[14]=l,e[15]=p):p=e[15];let h;e[16]!==f||e[17]!==s||e[18]!==l?(h=(v,N)=>{const j=l.find(S=>S.id===v);if(!j)return;const g=ue(N.x,N.y,j.w);if(g.x===j.x&&g.y===j.y)return;const w=un(l,v,g);f(w,s.hidden)},e[16]=f,e[17]=s,e[18]=l,e[19]=h):h=e[19];let x;e[20]!==f||e[21]!==s||e[22]!==d||e[23]!==l?(x=(v,N)=>{const j=l.find(T=>T.id===v);if(!j)return;const g=d.get(v),{w,h:S}=me(N.w,N.h,g);if(w===j.w&&S===j.h)return;const C={...j,w,h:S,x:ue(j.x,j.y,w).x},_=l.filter(T=>T.id!==v),I=[C];for(const T of _){const P=he(I,T.w,T.h);I.push({...T,x:P.x,y:P.y})}f(I,s.hidden)},e[20]=f,e[21]=s,e[22]=d,e[23]=l,e[24]=x):x=e[24];let y;e[25]!==f||e[26]!==s||e[27]!==l?(y=v=>{const N=l.filter(j=>j.id!==v);f(N,Array.from(new Set([...s.hidden,v])))},e[25]=f,e[26]=s,e[27]=l,e[28]=y):y=e[28];let b;return e[29]!==o||e[30]!==p||e[31]!==h||e[32]!==x||e[33]!==y?(b={snapshot:p,isLoading:o,moveTile:h,resizeTile:x,hideTile:y},e[29]=o,e[30]=p,e[31]=h,e[32]=x,e[33]=y,e[34]=b):b=e[34],b}function pn(t){return t.id}const hn={w:2,h:4},xn={w:1,h:2},gn={w:1,h:1};function yn(t){return`prompt:${t.agentId}:${t.promptName||"blank"}`}function bn(t){return t.tileId?`tile:${t.tileId}`:`tile:${t.agentId}:${t.resourceUri}`}function jn(t){return t.promptName?t.agentName:t.description}function vn(t){return{name:t.promptName,title:t.title,description:t.description,arguments:t.arguments,_meta:t._meta}}function Ye(t){const e=k.c(14),{org:s}=J();let o;e[0]!==s.id||e[1]!==s.slug||e[2]!==t.connectionId?(o=at({connectionId:t.connectionId,orgId:s.id,orgSlug:s.slug}),e[0]=s.id,e[1]=s.slug,e[2]=t.connectionId,e[3]=o):o=e[3];const{data:i}=se(o),r=!!i&&!t.toolName;let a;e[4]!==i||e[5]!==r?(a={client:i,enabled:r},e[4]=i,e[5]=r,e[6]=a):a=e[6];const{data:d}=ts(a);let l;e[7]!==t.resourceUri||e[8]!==t.toolName||e[9]!==d?.tools?(l=t.toolName??d?.tools.find(u=>Re(u._meta)===t.resourceUri)?.name,e[7]=t.resourceUri,e[8]=t.toolName,e[9]=d?.tools,e[10]=l):l=e[10];const m=l;let c;return e[11]!==t.connectionId||e[12]!==m?(c=m?ns(t.connectionId,m):void 0,e[11]=t.connectionId,e[12]=m,e[13]=c):c=e[13],c}function Ne(t){const e=k.c(10);let s;e[0]!==t?(s={agentId:t},e[0]=t,e[1]=s):s=e[1];const{start:o,startBlank:i,dialog:r,starting:a}=en(s);let d;e[2]!==o||e[3]!==i?(d=c=>{if(!c.promptName){i();return}o(vn(c))},e[2]=o,e[3]=i,e[4]=d):d=e[4];const l=d;let m;return e[5]!==r||e[6]!==l||e[7]!==i||e[8]!==a?(m={open:l,startBlank:i,dialog:r,starting:a},e[5]=r,e[6]=l,e[7]=i,e[8]=a,e[9]=m):m=e[9],m}function Nn(t){const e=k.c(32),{entry:s,isEditMode:o}=t,{open:i,dialog:r,starting:a}=Ne(s.agentId);let d;e[0]!==s||e[1]!==i?(d=()=>i(s),e[0]=s,e[1]=i,e[2]=d):d=e[2];const l=a||o,m=!o&&"cursor-pointer transition-colors hover:bg-accent/40",c=o&&"cursor-default pl-12",u=a&&"opacity-60";let f;e[3]!==m||e[4]!==c||e[5]!==u?(f=Q("group/tile relative flex h-full w-full items-center gap-3 px-4 py-3 text-left bg-card",m,c,u),e[3]=m,e[4]=c,e[5]=u,e[6]=f):f=e[6];let p;e[7]!==s.agentIcon||e[8]!==s.agentName?(p=n.jsx(ce,{icon:s.agentIcon,name:s.agentName,size:"sm+"}),e[7]=s.agentIcon,e[8]=s.agentName,e[9]=p):p=e[9];let h;e[10]!==s.title?(h=n.jsx("div",{className:"line-clamp-2 text-sm font-medium text-foreground leading-snug",children:s.title}),e[10]=s.title,e[11]=h):h=e[11];let x;e[12]!==s?(x=jn(s),e[12]=s,e[13]=x):x=e[13];let y;e[14]!==x?(y=n.jsx("div",{className:"truncate text-xs text-muted-foreground mt-0.5",children:x}),e[14]=x,e[15]=y):y=e[15];let b;e[16]!==y||e[17]!==h?(b=n.jsxs("div",{className:"min-w-0 flex-1",children:[h,y]}),e[16]=y,e[17]=h,e[18]=b):b=e[18];let v;e[19]!==o?(v=!o&&n.jsx(ss,{size:16,className:"shrink-0 text-muted-foreground opacity-0 -translate-x-1 transition-all duration-200 group-hover/tile:opacity-100 group-hover/tile:translate-x-0","aria-hidden":!0}),e[19]=o,e[20]=v):v=e[20];let N;e[21]!==a||e[22]!==d||e[23]!==b||e[24]!==v||e[25]!==l||e[26]!==f||e[27]!==p?(N=n.jsxs("button",{type:"button",onClick:d,disabled:l,"aria-busy":a,className:f,children:[p,b,v]}),e[21]=a,e[22]=d,e[23]=b,e[24]=v,e[25]=l,e[26]=f,e[27]=p,e[28]=N):N=e[28];let j;return e[29]!==r||e[30]!==N?(j=n.jsxs(n.Fragment,{children:[N,r]}),e[29]=r,e[30]=N,e[31]=j):j=e[31],j}function wn(){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},Sn)}),t[0]=e):e=t[0],e}function Sn(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 _n(t){const e=k.c(17),{tile:s,prompts:o,isEditMode:i,tileWidth:r}=t,{org:a}=J(),{open:d,startBlank:l,dialog:m,starting:c}=Ne(s.agentId),u=o.filter(Cn),f=Ye(s),p="relative flex h-full w-full flex-col p-3";let h;e[0]!==i||e[1]!==f||e[2]!==l||e[3]!==c?(h=!i&&n.jsx("button",{type:"button",onClick:()=>{l(f?{main:f}:void 0)},disabled:c,"aria-busy":c,className:"mb-1 self-start rounded-md px-2 py-1 text-[10px] text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:"Open chat"}),e[0]=i,e[1]=f,e[2]=l,e[3]=c,e[4]=h):h=e[4];const x="flex min-h-0 flex-1 gap-3 overflow-hidden";let y;e[5]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsx(Tn,{}),e[5]=y):y=e[5];let b;e[6]!==a.id||e[7]!==a.slug||e[8]!==s?(b=n.jsx("div",{className:"min-h-0 flex-1 overflow-hidden rounded-lg border border-border",children:n.jsx($.Suspense,{fallback:y,children:n.jsx(In,{tile:s,orgId:a.id,orgSlug:a.slug})})}),e[6]=a.id,e[7]=a.slug,e[8]=s,e[9]=b):b=e[9];const v=u.length>0&&!i&&r>=2&&n.jsx("div",{className:"flex w-44 shrink-0 flex-col gap-2 overflow-hidden",children:u.map(g=>n.jsx("button",{type:"button",onClick:()=>d(g),disabled:c,className:"shrink-0 rounded-lg border border-border bg-background px-2.5 py-2 text-left text-xs leading-snug text-foreground transition-colors hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:n.jsx("span",{className:"line-clamp-2",children:g.title})},g.promptName))});let N;e[10]!==b||e[11]!==v?(N=n.jsxs("div",{className:x,children:[b,v]}),e[10]=b,e[11]=v,e[12]=N):N=e[12];let j;return e[13]!==m||e[14]!==h||e[15]!==N?(j=n.jsxs("div",{className:p,children:[h,N,m]}),e[13]=m,e[14]=h,e[15]=N,e[16]=j):j=e[16],j}function Cn(t){return!!t.promptName}function In(t){const e=k.c(13),{tile:s,orgId:o,orgSlug:i}=t;let r;e[0]!==o||e[1]!==i||e[2]!==s.connectionId?(r={connectionId:s.connectionId,orgId:o,orgSlug:i},e[0]=o,e[1]=i,e[2]=s.connectionId,e[3]=r):r=e[3];const a=ae(r),d=s.minHeight??200,l=s.maxHeight??4e3;let m;return e[4]!==a||e[5]!==o||e[6]!==i||e[7]!==d||e[8]!==l||e[9]!==s.connectionId||e[10]!==s.resourceUri||e[11]!==s.toolInput?(m=n.jsx(Qt,{resourceURI:s.resourceUri,orgId:o,orgSlug:i,connectionId:s.connectionId,client:a,toolInput:s.toolInput,displayMode:"fullscreen",minHeight:d,maxHeight:l,className:"h-full"}),e[4]=a,e[5]=o,e[6]=i,e[7]=d,e[8]=l,e[9]=s.connectionId,e[10]=s.resourceUri,e[11]=s.toolInput,e[12]=m):m=e[12],m}function Tn(){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 kn(t){const e=k.c(14),{icon:s,name:o}=t;let i;e[0]!==s||e[1]!==o?(i=n.jsx(ce,{icon:s,name:o,size:"sm+"}),e[0]=s,e[1]=o,e[2]=i):i=e[2];let r;e[3]!==o?(r=n.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:o}),e[3]=o,e[4]=r):r=e[4];let a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx("div",{className:"truncate text-xs text-muted-foreground",children:"Loading tile…"}),e[5]=a):a=e[5];let d;e[6]!==r?(d=n.jsxs("div",{className:"min-w-0 flex-1",children:[r,a]}),e[6]=r,e[7]=d):d=e[7];let l;e[8]!==i||e[9]!==d?(l=n.jsxs("div",{className:"flex items-center gap-2.5",children:[i,d]}),e[8]=i,e[9]=d,e[10]=l):l=e[10];let m;e[11]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsxs("div",{className:"flex flex-1 flex-col gap-2 pt-1",children:[n.jsx(H,{className:"h-3 w-3/4"}),n.jsx(H,{className:"h-3 w-1/2"}),n.jsx(H,{className:"h-3 w-2/3"})]}),e[11]=m):m=e[11];let c;return e[12]!==l?(c=n.jsxs("div",{className:"flex h-full w-full flex-col gap-3 p-5 opacity-60",children:[l,m]}),e[12]=l,e[13]=c):c=e[13],c}function $n(t){const e=k.c(10),{tile:s,prompts:o,isEditMode:i}=t,{open:r,startBlank:a,dialog:d,starting:l}=Ne(s.agentId),m=o.filter(An),c=Ye(s),u="flex h-full w-full flex-col gap-3 p-4";let f;e[0]!==c||e[1]!==a?(f=()=>{a(c?{main:c}:void 0)},e[0]=c,e[1]=a,e[2]=f):f=e[2];const p=l||i;let h;e[3]!==f||e[4]!==p?(h=n.jsx("button",{type:"button",onClick:f,disabled:p,className:"mb-1 self-start rounded-md px-2 py-1 text-[10px] text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:"Open chat"}),e[3]=f,e[4]=p,e[5]=h):h=e[5];const x=m.length>0&&!i&&n.jsx("div",{className:"grid grid-cols-1 gap-2 overflow-hidden sm:grid-cols-2",children:m.map(b=>n.jsx("button",{type:"button",onClick:()=>!i&&r(b),disabled:l,className:"rounded-lg border border-border bg-background px-2.5 py-2 text-left text-xs leading-snug text-foreground transition-colors hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:n.jsx("span",{className:"line-clamp-2",children:b.title})},b.promptName))});let y;return e[6]!==d||e[7]!==h||e[8]!==x?(y=n.jsxs("div",{className:u,children:[h,x,d]}),e[6]=d,e[7]=h,e[8]=x,e[9]=y):y=e[9],y}function An(t){return!!t.promptName}function et({isEditMode:t}){const{org:e}=J(),{isLoading:s,prompts:o,tiles:i}=be(e.slug),r=ze()?.ids??[],a=new Set(r),d=Oe(),l=Ue(),m=xe(),c=new Set(i.map(g=>g.agentId)),u=new Map;for(const g of o){const w=u.get(g.agentId);w?w.push(g):u.set(g.agentId,[g])}const f=o.filter(g=>!c.has(g.agentId)),p=[...i.map(g=>({kind:"tile",id:bn(g),data:g})),...f.map(g=>({kind:"prompt",id:yn(g),data:g}))],h=new Map(p.map(g=>[g.id,g])),x=fn(p.map(g=>({id:g.id,defaultSize:g.kind==="tile"?hn:gn,minSize:g.kind==="tile"?xn:void 0,pinned:a.has(g.data.agentId)}))),y=g=>{d.apply(w=>w.filter(S=>S!==g)).catch(()=>U.error("Couldn't remove from home — please try again."))},b=async g=>{if(i.filter(S=>S.agentId===g.agentId).length<=1){y(g.agentId);return}try{const C=(await l.call("COLLECTION_VIRTUAL_MCP_GET",{id:g.agentId})).item;if(!C)throw new Error("Agent not found");const _=Z(C.metadata?.ui),I=g.tileId?_.filter(T=>T.tileId!==g.tileId):_.filter(T=>T.connectionId!==g.connectionId||T.resourceUri!==g.resourceUri);await l.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:g.agentId,data:{metadata:{...C.metadata??{},ui:{...C.metadata?.ui??{},homeTile:null,homeTiles:I}}}}),m.invalidateQueries({queryKey:te.homeNextActions(e.slug)})}catch{U.error("Couldn't remove tile — please try again.")}},v=g=>{const w=h.get(g);if(w){if(!a.has(w.data.agentId)){x.hideTile(g);return}w.kind==="tile"?b(w.data):y(w.data.agentId)}},N=g=>{const w=h.get(g.id);if(!w)return null;if(w.kind==="tile"){const S=u.get(w.data.agentId)??[];return n.jsx(it,{fallback:n.jsx($n,{tile:w.data,prompts:S,isEditMode:t}),children:n.jsx($.Suspense,{fallback:n.jsx(kn,{icon:w.data.agentIcon,name:w.data.agentName}),children:n.jsx(_n,{tile:w.data,prompts:S,isEditMode:t,tileWidth:g.w})})})}return n.jsx(Nn,{entry:w.data,isEditMode:t})};return s||x.isLoading?n.jsx(wn,{}):x.snapshot.visible.length===0&&!t?null:n.jsx("div",{className:"mt-4 flex w-full max-w-7xl flex-col gap-4",children:n.jsx(nn,{tiles:x.snapshot.visible,isEditMode:t,renderTile:N,onMove:x.moveTile,onResize:x.resizeTile,onRemove:v})})}function Pn(t){const e=k.c(2),{prompts:s,tiles:o}=be(t),i=o.length>0||s.length>0;let r;return e[0]!==i?(r={hasVisibleTiles:i},e[0]=i,e[1]=r):r=e[1],r}const Ie=420,Te=305;function tt(){const t=k.c(4);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("img",{src:"/home/bg-top-left.svg",alt:"",className:"absolute top-0 left-0 h-auto select-none opacity-80 dark:hidden",style:{width:Ie}}),t[0]=e):e=t[0];let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx("img",{src:"/home/bg-top-left-dark.svg",alt:"",className:"absolute top-0 left-0 hidden h-auto select-none opacity-80 dark:block",style:{width:Ie}}),t[1]=s):s=t[1];let o;t[2]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx("img",{src:"/home/bg-bottom-right.svg",alt:"",className:"absolute bottom-0 right-0 h-auto select-none opacity-80 dark:hidden",style:{width:Te}}),t[2]=o):o=t[2];let i;return t[3]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsxs("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 overflow-hidden",children:[e,s,o,n.jsx("img",{src:"/home/bg-bottom-right-dark.svg",alt:"",className:"absolute bottom-0 right-0 hidden h-auto select-none opacity-80 dark:block",style:{width:Te}})]}),t[3]=i):i=t[3],i}function ke(){const t=k.c(33),{data:e}=ot.useSession(),{org:s}=J(),o=ge(),i=hs(),{selectedVirtualMcp:r}=vt();let a;t[0]!==s.id?(a=ct(s.id),t[0]=s.id,t[1]=a):a=t[1];const l=r??a;let m;t[2]!==s.slug?(m=Dt(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:dt,orgId:s.id,orgSlug:s.slug},t[4]=s.id,t[5]=s.slug,t[6]=c):c=t[6];const u=ae(c);let f;t[7]!==s.id||t[8]!==s.slug?(f=fs(s.slug,s.id),t[7]=s.id,t[8]=s.slug,t[9]=f):f=t[9];let p;t[10]!==s.id||t[11]!==s.slug?(p=Ot(s.slug,s.id),t[10]=s.id,t[11]=s.slug,t[12]=p):p=t[12];let h;t[13]!==l.id||t[14]!==s.id||t[15]!==u?(h=ft(s.id,l.id,u),t[13]=l.id,t[14]=s.id,t[15]=u,t[16]=h):h=t[16];let x;t[17]!==f||t[18]!==p||t[19]!==h?(x={queries:[f,p,h]},t[17]=f,t[18]=p,t[19]=h,t[20]=x):x=t[20],rt(x);const y=ps(),b=pt(l.id),{hasDecoKey:v,isZeroBalance:N,isInitialFreeCredit:j,balanceDollars:g,hasOnlyDecoProvider:w}=Et(),{hasVisibleTiles:S}=Pn(s.slug),C=Mt(b?.metadata);if(y.length===0&&!(C&&zt(i))){let L;return t[21]===Symbol.for("react.memo_cache_sentinel")?(L=n.jsx("div",{className:"flex-1 overflow-y-auto",children:n.jsx("div",{className:"min-h-full flex items-center justify-center px-4 py-10",children:n.jsx(Nt,{})})}),t[21]=L):L=t[21],L}let I;t[22]!==e?.user?.name?(I=e?.user?.name?.split(" ")[0]||"there",t[22]=e?.user?.name,t[23]=I):I=t[23];const T=I,P=v&&j&&g!=null,M=v&&N&&w;let z;t[24]!==g||t[25]!==P||t[26]!==M?(z=P?n.jsx(oe.CreditsEyebrow,{balanceDollars:g}):M?n.jsx(oe.NoCreditsEyebrow,{}):null,t[24]=g,t[25]=P,t[26]=M,t[27]=z):z=t[27];const B=z;let O;return t[28]!==B||t[29]!==S||t[30]!==o||t[31]!==T?(O=n.jsx(Ys,{children:o?n.jsx(En,{eyebrow:B,userName:T}):n.jsx(Mn,{eyebrow:B,userName:T,hasVisibleTiles:S})}),t[28]=B,t[29]=S,t[30]=o,t[31]=T,t[32]=O):O=t[32],O}function En(t){const e=k.c(12),{eyebrow:s,userName:o}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(tt,{}),e[0]=i):i=e[0];let r;e[1]!==s?(r=s&&n.jsx("div",{className:"mb-4",children:s}),e[1]=s,e[2]=r):r=e[2];let a;e[3]!==o?(a=n.jsxs("p",{className:"text-3xl font-medium text-foreground text-center max-w-[280px]",children:["What's on your mind, ",o,"?"]}),e[3]=o,e[4]=a):a=e[4];let d;e[5]!==r||e[6]!==a?(d=n.jsxs("div",{className:"relative flex flex-col items-center justify-center w-full pt-28 pb-8 px-4",children:[r,a]}),e[5]=r,e[6]=a,e[7]=d):d=e[7];let l;e[8]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx("div",{className:"relative w-full flex flex-col gap-4 pb-8 px-4",children:n.jsx(oe.Input,{showConnectionsBanner:!0})}),e[8]=l):l=e[8];let m;e[9]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx("div",{className:"relative w-full px-4 pb-8",children:n.jsx(et,{isEditMode:!1})}),e[9]=m):m=e[9];let c;return e[10]!==d?(c=n.jsxs("div",{className:"flex-1 relative flex flex-col items-center overflow-y-auto",children:[i,d,l,m]}),e[10]=d,e[11]=c):c=e[11],c}function Mn(t){const e=k.c(32),{eyebrow:s,userName:o,hasVisibleTiles:i}=t,{isEditMode:r,enter:a,save:d,cancel:l,hasChanges:m}=Ze(),[c,u]=$.useState(!1);let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=()=>u(!0),e[0]=f):f=e[0];let p;e[1]!==l||e[2]!==a||e[3]!==m||e[4]!==r||e[5]!==d?(p=n.jsx(xs.Right,{children:n.jsx(zn,{isEditMode:r,hasChanges:m,onEnter:a,onSave:d,onCancel:l,onAddTile:f})}),e[1]=l,e[2]=a,e[3]=m,e[4]=r,e[5]=d,e[6]=p):p=e[6];let h;e[7]!==c?(h=n.jsx(ys,{open:c,onOpenChange:u}),e[7]=c,e[8]=h):h=e[8];let x;e[9]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(tt,{}),e[9]=x):x=e[9];const y=i||r?"pt-32":"flex-1 justify-center";let b;e[10]!==y?(b=Q("relative flex flex-col items-center px-10 pb-4",y),e[10]=y,e[11]=b):b=e[11];let v;e[12]!==s?(v=s&&n.jsx("div",{className:"mb-4",children:s}),e[12]=s,e[13]=v):v=e[13];let N;e[14]!==o?(N=n.jsxs("p",{className:"text-3xl font-medium text-foreground",children:["What's on your mind, ",o,"?"]}),e[14]=o,e[15]=N):N=e[15];let j;e[16]!==v||e[17]!==N?(j=n.jsxs("div",{className:"text-center mb-10",children:[v,N]}),e[16]=v,e[17]=N,e[18]=j):j=e[18];let g;e[19]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsxs("div",{className:"relative w-full",children:[n.jsx(On,{}),n.jsx(oe.Input,{showConnectionsBanner:!0})]}),e[19]=g):g=e[19];let w;e[20]!==j?(w=n.jsxs("div",{className:"flex flex-col items-center w-full max-w-[672px]",children:[j,g]}),e[20]=j,e[21]=w):w=e[21];let S;e[22]!==r?(S=n.jsx("div",{className:"relative w-full mt-10 mx-auto max-w-[1280px] px-2 pb-16",children:n.jsx(et,{isEditMode:r})}),e[22]=r,e[23]=S):S=e[23];let C;e[24]!==w||e[25]!==S||e[26]!==b?(C=n.jsxs("div",{className:"flex-1 relative flex flex-col min-h-0",children:[x,n.jsx("div",{className:"flex-1 relative flex flex-col overflow-y-auto",children:n.jsxs("div",{className:b,children:[w,S]})})]}),e[24]=w,e[25]=S,e[26]=b,e[27]=C):C=e[27];let _;return e[28]!==C||e[29]!==p||e[30]!==h?(_=n.jsxs(n.Fragment,{children:[p,h,C]}),e[28]=C,e[29]=p,e[30]=h,e[31]=_):_=e[31],_}function zn(t){const e=k.c(17),{isEditMode:s,hasChanges:o,onEnter:i,onSave:r,onCancel:a,onAddTile:d}=t;if(s){let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(ye,{size:14}),e[0]=c):c=e[0];let u;e[1]!==d?(u=n.jsxs("button",{type:"button",onClick:d,className:"flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",title:"Add a tile from any agent",children:[c,"Add tile"]}),e[1]=d,e[2]=u):u=e[2];let f;e[3]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx($e,{size:14}),e[3]=f):f=e[3];let p;e[4]!==a?(p=n.jsxs(Y,{size:"sm",variant:"ghost",onClick:a,className:"gap-1.5 h-7 text-xs",children:[f,"Cancel"]}),e[4]=a,e[5]=p):p=e[5];const h=!o;let x;e[6]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(ht,{size:14}),e[6]=x):x=e[6];let y;e[7]!==r||e[8]!==h?(y=n.jsxs(Y,{size:"sm",onClick:r,disabled:h,className:"gap-1.5 h-7 text-xs",children:[x,"Save"]}),e[7]=r,e[8]=h,e[9]=y):y=e[9];let b;return e[10]!==u||e[11]!==p||e[12]!==y?(b=n.jsxs(n.Fragment,{children:[u,p,y]}),e[10]=u,e[11]=p,e[12]=y,e[13]=b):b=e[13],b}let l;e[14]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(jt,{size:14}),e[14]=l):l=e[14];let m;return e[15]!==i?(m=n.jsxs("button",{type:"button",onClick:i,className:"flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",title:"Customize your home",children:[l,"Customize"]}),e[15]=i,e[16]=m):m=e[16],m}function On(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("img",{src:"/home/capybara.png",alt:"","aria-hidden":!0,className:"pointer-events-none absolute -top-16 right-6 z-20 h-20 w-auto select-none"}),t[0]=e):e=t[0],e}function Vo(){const t=k.c(2);if(ge()){let o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx("div",{className:"flex-1 min-h-0 flex flex-col bg-background overflow-hidden",children:n.jsx(ke,{})}),t[0]=o):o=t[0],o}let s;return t[1]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx("div",{className:"flex-1 min-h-0 pb-1 pr-1 pl-0 pt-0",children:n.jsx("div",{className:"h-full p-0.5 pt-0.25",children:n.jsx("div",{className:"flex flex-col h-full bg-background overflow-hidden card-shadow rounded-[0.75rem]",children:n.jsx(ke,{})})})}),t[1]=s):s=t[1],s}export{Vo as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as f,l as d,r as p,j as r}from"./index-
|
|
1
|
+
import{c as f,l as d,r as p,j as r}from"./index-Cw1_akCN.js";import{m as w}from"./sidebar-D4jky0lG.js";const v=p.createContext(void 0),H=v.Provider;function N(c,e){const l=p.Children.toArray(c);for(const i of l)if(p.isValidElement(i)&&i.type===e)return i;return null}function P(c){const e=f.c(5),{children:l,className:i}=c;let s;e[0]!==i?(s=d("flex flex-col h-full w-full bg-background overflow-hidden",i),e[0]=i,e[1]=s):s=e[1];let t;return e[2]!==l||e[3]!==s?(t=r.jsx("div",{className:s,children:l}),e[2]=l,e[3]=s,e[4]=t):t=e[4],t}function C(c){const e=f.c(17),{children:l,className:i,hideSidebarTrigger:s}=c;let t;e[0]!==l?(t=N(l,j),e[0]=l,e[1]=t):t=e[1];const n=t;let a;e[2]!==l?(a=N(l,b),e[2]=l,e[3]=a):a=e[3];const o=a;let m;e[4]!==i?(m=d("shrink-0 w-full border-b border-border/50 h-11","flex items-center justify-between gap-3 pr-2 pl-2 md:pl-4",i),e[4]=i,e[5]=m):m=e[5];let x;e[6]!==s?(x=!s&&r.jsx(w,{className:"md:hidden shrink-0"}),e[6]=s,e[7]=x):x=e[7];let u;e[8]!==n||e[9]!==x?(u=r.jsxs("div",{className:"flex items-center gap-1 min-w-0 flex-1",children:[x,n]}),e[8]=n,e[9]=x,e[10]=u):u=e[10];let h;e[11]!==o?(h=r.jsx("div",{className:"flex items-center",children:o}),e[11]=o,e[12]=h):h=e[12];let g;return e[13]!==m||e[14]!==u||e[15]!==h?(g=r.jsxs("div",{className:m,children:[u,h]}),e[13]=m,e[14]=u,e[15]=h,e[16]=g):g=e[16],g}function j(c){const e=f.c(5),{children:l,className:i}=c;let s;e[0]!==i?(s=d("flex items-center gap-2 min-w-0 overflow-hidden",i),e[0]=i,e[1]=s):s=e[1];let t;return e[2]!==l||e[3]!==s?(t=r.jsx("div",{className:s,children:l}),e[2]=l,e[3]=s,e[4]=t):t=e[4],t}function b(c){const e=f.c(5),{children:l,className:i}=c;let s;e[0]!==i?(s=d("flex items-center gap-2 shrink-0 overflow-hidden",i),e[0]=i,e[1]=s):s=e[1];let t;return e[2]!==l||e[3]!==s?(t=r.jsx("div",{className:s,children:l}),e[2]=l,e[3]=s,e[4]=t):t=e[4],t}function $(c){const e=f.c(6),{children:l,className:i}=c,s=p.useContext(v);let t;e[0]!==i||e[1]!==s?(t=d("flex-1 overflow-auto",s,i),e[0]=i,e[1]=s,e[2]=t):t=e[2];let n;return e[3]!==l||e[4]!==t?(n=r.jsx("div",{className:t,children:l}),e[3]=l,e[4]=t,e[5]=n):n=e[5],n}function y(c){const e=f.c(10),{children:l,actions:i,className:s}=c;let t;e[0]!==s?(t=d("flex flex-wrap items-center justify-between gap-3",s),e[0]=s,e[1]=t):t=e[1];let n;e[2]!==l?(n=r.jsx("div",{className:"text-xl font-medium min-w-0",children:l}),e[2]=l,e[3]=n):n=e[3];let a;e[4]!==i?(a=i&&r.jsx("div",{className:"flex items-center gap-2",children:i}),e[4]=i,e[5]=a):a=e[5];let o;return e[6]!==t||e[7]!==n||e[8]!==a?(o=r.jsxs("div",{className:t,children:[n,a]}),e[6]=t,e[7]=n,e[8]=a,e[9]=o):o=e[9],o}function R(c){const e=f.c(6),{children:l,className:i,maxWidth:s}=c,t=s===void 0?"max-w-[1200px]":s;let n;e[0]!==i||e[1]!==t?(n=d("mx-auto w-full px-4 pt-8 pb-6 md:px-10 md:pt-12 md:pb-10",t,i),e[0]=i,e[1]=t,e[2]=n):n=e[2];let a;return e[3]!==l||e[4]!==n?(a=r.jsx("div",{className:n,children:l}),e[3]=l,e[4]=n,e[5]=a):a=e[5],a}const T=Object.assign(P,{Header:Object.assign(C,{Left:j,Right:b}),Content:$,Title:y,Body:R});export{T as P,H as a};
|