decocms 3.89.2 → 3.90.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.
Files changed (240) hide show
  1. package/dist/client/assets/{AlertCircle-flSoo6uw.js → AlertCircle-eL7jEjpx.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-BeOMO89N.js → ArrowUpRight-BtZv9HXz.js} +1 -1
  3. package/dist/client/assets/{CheckCircle-B9ekAAw-.js → CheckCircle-Ce4sW5Fr.js} +1 -1
  4. package/dist/client/assets/{ChevronDown-BWfuTI7r.js → ChevronDown-8-SpQ5a6.js} +1 -1
  5. package/dist/client/assets/{ChevronLeft-BNcg18cx.js → ChevronLeft-DQ6Y033o.js} +1 -1
  6. package/dist/client/assets/{ChevronRight-ChYOVgWd.js → ChevronRight-C7AnVgNL.js} +1 -1
  7. package/dist/client/assets/{ChevronUp-BhWz3ylT.js → ChevronUp-hzSQl57_.js} +1 -1
  8. package/dist/client/assets/{DotsVertical-C0YWb9xq.js → DotsVertical-CBCiPEnd.js} +1 -1
  9. package/dist/client/assets/{Eye-DWTUBTZ_.js → Eye-Du8USWUC.js} +1 -1
  10. package/dist/client/assets/{FilterLines-Djqj6uj_.js → FilterLines-D51fKry2.js} +1 -1
  11. package/dist/client/assets/{Globe01-BgRW2EiE.js → Globe01-ByUFNYZ1.js} +1 -1
  12. package/dist/client/assets/{Globe04-XITcP2mp.js → Globe04-BnUIZrLZ.js} +1 -1
  13. package/dist/client/assets/{HardDrive-DS3VxDtU.js → HardDrive-OrjxQFg1.js} +1 -1
  14. package/dist/client/assets/{Key01-DX7L8s0Z.js → Key01-CI_-yaVv.js} +1 -1
  15. package/dist/client/assets/{LayoutLeft-BqtFvEWV.js → LayoutLeft-DnqAFiqW.js} +1 -1
  16. package/dist/client/assets/{LinkExternal01-Cf-6A1_h.js → LinkExternal01-C9plWUCQ.js} +1 -1
  17. package/dist/client/assets/{Monitor01-CZ30bS8J.js → Monitor01-Cx6UPY56.js} +1 -1
  18. package/dist/client/assets/{Palette-Dy2dQgqx.js → Palette-DxYtHeiN.js} +1 -1
  19. package/dist/client/assets/{Play-DvFnuZIO.js → Play-Bpofg5MS.js} +1 -1
  20. package/dist/client/assets/{Plus-jFajoMCA.js → Plus-B6Bp27KE.js} +1 -1
  21. package/dist/client/assets/{SearchMd-uzKFlzQB.js → SearchMd-DY2IStnr.js} +1 -1
  22. package/dist/client/assets/{Settings02-47eDNk4K.js → Settings02-CzDpZT_t.js} +1 -1
  23. package/dist/client/assets/{Shield01-BgRa80OR.js → Shield01-ByoQOTwe.js} +1 -1
  24. package/dist/client/assets/{Star01-BrkbxV-A.js → Star01-COmcJPAd.js} +1 -1
  25. package/dist/client/assets/{Stars01-Daq_eW6a.js → Stars01-DjTb55Tj.js} +1 -1
  26. package/dist/client/assets/{Stars02-DlImJz_z.js → Stars02-B4L_1USv.js} +1 -1
  27. package/dist/client/assets/{Sun-9FxiCes3.js → Sun-BrBndJzL.js} +1 -1
  28. package/dist/client/assets/{SwitchHorizontal01-CB5mOBIf.js → SwitchHorizontal01-COrtT0WP.js} +1 -1
  29. package/dist/client/assets/{Tool01-rx0lKYM8.js → Tool01-D9Z3ra2m.js} +1 -1
  30. package/dist/client/assets/{Trash01-DI7qV1ow.js → Trash01-S_d8yXYH.js} +1 -1
  31. package/dist/client/assets/{Upload01-Boqk1hvA.js → Upload01-BovBQGIq.js} +1 -1
  32. package/dist/client/assets/{User01-B3UbdHmL.js → User01-Dcns6QTI.js} +1 -1
  33. package/dist/client/assets/{Users01-BUyczaeV.js → Users01-Dua8TttV.js} +1 -1
  34. package/dist/client/assets/{Users03-gvBLUtvG.js → Users03-DTBaxDUb.js} +1 -1
  35. package/dist/client/assets/{X-B-cRV-7d.js → X-ClFhIPPx.js} +1 -1
  36. package/dist/client/assets/{XCircle-CkhBWURn.js → XCircle-ZlnM-le2.js} +1 -1
  37. package/dist/client/assets/{XClose-Doj89HqF.js → XClose-Cr1-H9ci.js} +1 -1
  38. package/dist/client/assets/{Zap-BCqTHl-x.js → Zap-TPho1Yix.js} +1 -1
  39. package/dist/client/assets/{ZapSquare-DdgE8vy-.js → ZapSquare-Brn6J5mG.js} +1 -1
  40. package/dist/client/assets/{ZoomOut-BdBjpsIq.js → ZoomOut-BkeollDv.js} +1 -1
  41. package/dist/client/assets/{access-gate-BXDE0rsJ.js → access-gate-FCkKFtCU.js} +1 -1
  42. package/dist/client/assets/{add-section-modal-7a6BUncs.js → add-section-modal-CP8OZAs0.js} +1 -1
  43. package/dist/client/assets/{agent-icon-C6bJxQ04.js → agent-icon-B6eCx9D1.js} +1 -1
  44. package/dist/client/assets/{agents-list-sjsqj6Ot.js → agents-list-CoW11iHc.js} +1 -1
  45. package/dist/client/assets/ai-providers-DZvST0-1.js +1 -0
  46. package/dist/client/assets/{alert-C81LnOX9.js → alert-DG7kpTTq.js} +1 -1
  47. package/dist/client/assets/{alert-dialog-HmiP05XU.js → alert-dialog-DCN5JdMo.js} +3 -3
  48. package/dist/client/assets/app-editor-Cslki56N.js +1 -0
  49. package/dist/client/assets/{auth-B9Q1UUsp.js → auth-B9FveTwh.js} +1 -1
  50. package/dist/client/assets/{auth-catchall-ClOrr_P8.js → auth-catchall-c1PPJXlb.js} +1 -1
  51. package/dist/client/assets/{auth-entry-B7DIloAw.js → auth-entry-_nOUFp_x.js} +1 -1
  52. package/dist/client/assets/{auth-split-layout-dWTaQKch.js → auth-split-layout-DqH6c0k8.js} +1 -1
  53. package/dist/client/assets/{authenticate-and-persist-oauth-xCkDryiA.js → authenticate-and-persist-oauth-DiMpH9Hf.js} +1 -1
  54. package/dist/client/assets/{automation-list-row-CLUMzxuG.js → automation-list-row-D6X7gs0k.js} +1 -1
  55. package/dist/client/assets/{automation-runs-DxPUfxy1.js → automation-runs-B9slN7zB.js} +1 -1
  56. package/dist/client/assets/automations-DgNLJXiB.js +1 -0
  57. package/dist/client/assets/{avatar-oAcdiJ9v.js → avatar-CMukQvh7.js} +1 -1
  58. package/dist/client/assets/{badge-CpKEkIGn.js → badge-BkyT3WoL.js} +1 -1
  59. package/dist/client/assets/{block-document-BVHsyU-9.js → block-document-DuE6VWLI.js} +1 -1
  60. package/dist/client/assets/{brand-context-CwjLKTtp.js → brand-context--ofWuplm.js} +1 -1
  61. package/dist/client/assets/buckets-YjT6-1gl.js +1 -0
  62. package/dist/client/assets/{capability-load-error-CG-hWPTN.js → capability-load-error-b3EGpgG0.js} +1 -1
  63. package/dist/client/assets/{card-BIwENur_.js → card-Bs3t5A2h.js} +1 -1
  64. package/dist/client/assets/category-editor-CEjlWNxU.js +1 -0
  65. package/dist/client/assets/{chat-context-DN0_9Gee.js → chat-context-DueHVvJY.js} +5 -5
  66. package/dist/client/assets/{checkbox-Bi39v4Qa.js → checkbox-LHoIUSFR.js} +1 -1
  67. package/dist/client/assets/{cli-auth-success-pdfiwdy1.js → cli-auth-success-ML14RiWT.js} +1 -1
  68. package/dist/client/assets/collection-detail-ibjdpE0q.js +1 -0
  69. package/dist/client/assets/{collection-display-button-Bzf7YHNy.js → collection-display-button-Drrg41_3.js} +1 -1
  70. package/dist/client/assets/{collection-search-DbQr2iji.js → collection-search-CgpTu-Mz.js} +1 -1
  71. package/dist/client/assets/{collection-tabs-D77_So6e.js → collection-tabs-C8hplLSb.js} +1 -1
  72. package/dist/client/assets/command-BQdrUZdP.js +1 -0
  73. package/dist/client/assets/commerce-onboarding-D1XLRejF.js +1 -0
  74. package/dist/client/assets/{connect-desktop-dialog-ByWaevjw.js → connect-desktop-dialog-XNmCdvVO.js} +1 -1
  75. package/dist/client/assets/{connection-card-DehsL0Sf.js → connection-card-DFgMcv0g.js} +1 -1
  76. package/dist/client/assets/connection-detail-D4rMC3p5.js +1 -0
  77. package/dist/client/assets/{connection-form-helpers-CASdXQaW.js → connection-form-helpers-BehaoK99.js} +1 -1
  78. package/dist/client/assets/connections-EApUiHUb.js +1 -0
  79. package/dist/client/assets/{context-menu-Bt-E5y3C.js → context-menu-BrlUfyhd.js} +1 -1
  80. package/dist/client/assets/{decopilot-BXlT8NLf.js → decopilot-2OorXRZy.js} +1 -1
  81. package/dist/client/assets/{decopilot-sse-pool-CKTJhrtc.js → decopilot-sse-pool-BTlcRVcA.js} +1 -1
  82. package/dist/client/assets/{dialog-BLvz2lK8.js → dialog-DGm31nBN.js} +1 -1
  83. package/dist/client/assets/{domain-settings-ed9WclHg.js → domain-settings-CdtyE8KM.js} +1 -1
  84. package/dist/client/assets/{drawer-C4RJ4_GY.js → drawer-DdWdZjEE.js} +1 -1
  85. package/dist/client/assets/{dropdown-menu-CRyIPZil.js → dropdown-menu-BLOjaXD3.js} +1 -1
  86. package/dist/client/assets/{empty-state-CmZpGujH.js → empty-state-DVp61Buk.js} +1 -1
  87. package/dist/client/assets/{extract-connection-data-iACc8UZO.js → extract-connection-data-D_bB-ShD.js} +1 -1
  88. package/dist/client/assets/file-explorer-vaSlSqZW.js +2 -0
  89. package/dist/client/assets/{file-type-icon-Db262N7w.js → file-type-icon-BCa6hDuH.js} +1 -1
  90. package/dist/client/assets/{files-BwDocccC.js → files-DQb9-lnV.js} +1 -1
  91. package/dist/client/assets/{form-CPJbrMq5.js → form-B5xe8o6u.js} +1 -1
  92. package/dist/client/assets/general-ydE7PYML.js +1 -0
  93. package/dist/client/assets/{github-repo-picker-Db_ehY6e.js → github-repo-picker-8IaQB8YW.js} +1 -1
  94. package/dist/client/assets/{hooks-chgqRyLj.js → hooks-DpQFLCh_.js} +1 -1
  95. package/dist/client/assets/{import-from-deco-dialog-Nrpq_g30.js → import-from-deco-dialog-CRv9nGz3.js} +1 -1
  96. package/dist/client/assets/{index-D7a1JQHt.js → index-B6YHm6is.js} +2 -2
  97. package/dist/client/assets/index-BCPspZww.js +1 -0
  98. package/dist/client/assets/{index-DAmj773w.js → index-BOJe9uwl.js} +1 -1
  99. package/dist/client/assets/{index-K-17SMjl.js → index-BRdqVONz.js} +1 -1
  100. package/dist/client/assets/{index-RkQpccOp.js → index-BtAPhKbE.js} +1 -1
  101. package/dist/client/assets/{index-DFNABgCe.js → index-CRPVmS_G.js} +1 -1
  102. package/dist/client/assets/index-CS7neKAN.js +26 -0
  103. package/dist/client/assets/{index-BkSIY6JJ.js → index-CZQAHCWx.js} +4 -4
  104. package/dist/client/assets/index-CthwRpPw.js +1 -0
  105. package/dist/client/assets/{index-QdluHxPe.js → index-CuxqDMpm.js} +1 -1
  106. package/dist/client/assets/index-DRv0VWsh.js +1 -0
  107. package/dist/client/assets/{index-DC36sAC_.js → index-EMcMxAnt.js} +2 -2
  108. package/dist/client/assets/{index-1ECwD4fs.js → index-hv1cpMXB.js} +10 -10
  109. package/dist/client/assets/{index-redirect-DO0D1qdv.js → index-redirect-Q0F80k5-.js} +1 -1
  110. package/dist/client/assets/{index-4GXqE9fp.js → index-w238AwGD.js} +1 -1
  111. package/dist/client/assets/{input-jkT1z5r1.js → input-Bnf6c030.js} +1 -1
  112. package/dist/client/assets/{integration-icon-CZDEviNI.js → integration-icon-BZb9eAa5.js} +1 -1
  113. package/dist/client/assets/{label-CETsHBZ0.js → label-Di7vPCvs.js} +1 -1
  114. package/dist/client/assets/{login-eY2xl_Qt.js → login-2SyCeWam.js} +1 -1
  115. package/dist/client/assets/{mcp-oauth-BIBzZgcE.js → mcp-oauth-CkPjLCsH.js} +1 -1
  116. package/dist/client/assets/{members-BAHTTEXJ.js → members-CjaCp3dg.js} +2 -2
  117. package/dist/client/assets/{monaco-editor-tVsx1Jkl.js → monaco-editor-DwYoS9zw.js} +1 -1
  118. package/dist/client/assets/{monitoring-stats-row-CivwdnUP.js → monitoring-stats-row-DkqIQOcq.js} +1 -1
  119. package/dist/client/assets/{oauth-callback-BnrL3BsC.js → oauth-callback-CZp0JiJW.js} +1 -1
  120. package/dist/client/assets/{oauth-callback-ai-provider-D3_UsvKg.js → oauth-callback-ai-provider-Dg09kVke.js} +1 -1
  121. package/dist/client/assets/{onboarding-Cde-ZfY9.js → onboarding-BbfRp_j7.js} +1 -1
  122. package/dist/client/assets/{org-install-Cri2HTyv.js → org-install-C35OKz52.js} +1 -1
  123. package/dist/client/assets/{org-layout-DH1oGgfN.js → org-layout-DZByPEyS.js} +1 -1
  124. package/dist/client/assets/{organization-choice-BZIXFBHd.js → organization-choice-D-8Jpbxq.js} +1 -1
  125. package/dist/client/assets/{page-seo-form-DCgyqE3q.js → page-seo-form-DpKXv5ZW.js} +1 -1
  126. package/dist/client/assets/page-seo-sheet-BNm6Mm2L.js +1 -0
  127. package/dist/client/assets/{popover-1pFpRX6s.js → popover-BLg2uxUj.js} +1 -1
  128. package/dist/client/assets/post-editor-DtfgS5ZG.js +1 -0
  129. package/dist/client/assets/{preview-dialog-DRmrGWbh.js → preview-dialog-DqH-_Rmc.js} +1 -1
  130. package/dist/client/assets/{primitives-C06Pn9p4.js → primitives-DXpcMQqJ.js} +1 -1
  131. package/dist/client/assets/profile-BoEvNBMC.js +1 -0
  132. package/dist/client/assets/project-app-view-DMQWiDoZ.js +1 -0
  133. package/dist/client/assets/record-editor-GeUn2Cfg.js +1 -0
  134. package/dist/client/assets/registry-BnG2g9Fw.js +2 -0
  135. package/dist/client/assets/{registry-layout-Dww7dssY.js → registry-layout-DkLgn4PF.js} +2 -2
  136. package/dist/client/assets/{require-capability-BC8YsasG.js → require-capability-ghUcEykT.js} +1 -1
  137. package/dist/client/assets/{required-auth-layout-DjRtF3m8.js → required-auth-layout-SCPc1ODv.js} +1 -1
  138. package/dist/client/assets/{reset-password-DNWeSy4_.js → reset-password-ohLffP_O.js} +1 -1
  139. package/dist/client/assets/{roles-Cyz3Z1vr.js → roles-BjyevsY6.js} +1 -1
  140. package/dist/client/assets/{save-status-BsQDaUlP.js → save-status-COIKtaoc.js} +1 -1
  141. package/dist/client/assets/{scroll-area-D51A_KQ5.js → scroll-area-DFbOrGft.js} +1 -1
  142. package/dist/client/assets/{search-input-CEqRaXj6.js → search-input-Db1Wlp2M.js} +1 -1
  143. package/dist/client/assets/secrets-BORDpp9r.js +1 -0
  144. package/dist/client/assets/{sections-editor-331tz7B6.js → sections-editor-CsdioN2W.js} +2 -2
  145. package/dist/client/assets/select-Biv4m02a.js +1 -0
  146. package/dist/client/assets/{select-model-DJ7vH3M2.js → select-model-B6vWutyx.js} +1 -1
  147. package/dist/client/assets/seo-editor-CSTNL9M8.js +1 -0
  148. package/dist/client/assets/{settings-layout-CSyEHpma.js → settings-layout-5lmse1ub.js} +1 -1
  149. package/dist/client/assets/{settings-section-D6f1v8Lb.js → settings-section-CD_Cl2xg.js} +1 -1
  150. package/dist/client/assets/{sheet-CUfjkNRy.js → sheet-CLgUQ0k9.js} +1 -1
  151. package/dist/client/assets/{shell-controls-C6FYdYnB.js → shell-controls-DuKZWqgd.js} +1 -1
  152. package/dist/client/assets/{shell-layout-CR4YIb2n.js → shell-layout-fqgrNv9Y.js} +1 -1
  153. package/dist/client/assets/{shell-route-loading-fK7OWXny.js → shell-route-loading-B3Il8pQg.js} +1 -1
  154. package/dist/client/assets/{sidebar-C45GjVmp.js → sidebar-B6ogJK6o.js} +1 -1
  155. package/dist/client/assets/{skeleton-h95MLET_.js → skeleton-7DG8UULc.js} +1 -1
  156. package/dist/client/assets/{sortable.esm-CbeYFn14.js → sortable.esm-BBNRI0-0.js} +1 -1
  157. package/dist/client/assets/sso-50J9BcfO.js +1 -0
  158. package/dist/client/assets/{store-O5BcQA2t.js → store-D0nqcAbk.js} +1 -1
  159. package/dist/client/assets/store-registry-DZK1gxtR.js +2 -0
  160. package/dist/client/assets/{studio-tools-BgUSKeCY.js → studio-tools-DCyngkzJ.js} +1 -1
  161. package/dist/client/assets/{switch-Cf_WUos9.js → switch-DQj88pZv.js} +1 -1
  162. package/dist/client/assets/{table-tHeeUiY0.js → table-Du45gWno.js} +1 -1
  163. package/dist/client/assets/{tabs-CNnqe_sK.js → tabs--E0r9_Sj.js} +1 -1
  164. package/dist/client/assets/{task-status-DzLkYYrk.js → task-status-B_9F2gh5.js} +1 -1
  165. package/dist/client/assets/{textarea-BzYVaGJ0.js → textarea-BFNmWFvP.js} +1 -1
  166. package/dist/client/assets/{toggle-group-BE1kDwdz.js → toggle-group-KbM3MWcV.js} +1 -1
  167. package/dist/client/assets/{toolbar-D5FkjLVB.js → toolbar-BgwgtfBD.js} +1 -1
  168. package/dist/client/assets/{tooltip-CAEDbADy.js → tooltip-Dcp4xtTX.js} +1 -1
  169. package/dist/client/assets/{types-Dw2dcWcn.js → types-BhFW6kUE.js} +1 -1
  170. package/dist/client/assets/{use-ai-providers-BcLob6tS.js → use-ai-providers-BMg8Dsli.js} +1 -1
  171. package/dist/client/assets/{use-automations-CfP4AmpB.js → use-automations-D4GU11Hn.js} +1 -1
  172. package/dist/client/assets/{use-capability-CbeJheXW.js → use-capability-CAL5M8kW.js} +1 -1
  173. package/dist/client/assets/{use-clock-tick-DHvuEFIJ.js → use-clock-tick-CG1lc4nO.js} +1 -1
  174. package/dist/client/assets/{use-collections-yHRKnSEt.js → use-collections-BYr7pEmZ.js} +1 -1
  175. package/dist/client/assets/use-connection-D9HsjWxg.js +1 -0
  176. package/dist/client/assets/{use-copy-DOTEBoID.js → use-copy-B6e0ArXF.js} +1 -1
  177. package/dist/client/assets/{use-create-virtual-mcp-C88JBuQM.js → use-create-virtual-mcp-UIYeNsla.js} +1 -1
  178. package/dist/client/assets/{use-debounced-autosave-BnfFXRc0.js → use-debounced-autosave-xepBeP7W.js} +1 -1
  179. package/dist/client/assets/{use-delete-connection-D1yU7B0G.js → use-delete-connection-BEeKZ9NT.js} +1 -1
  180. package/dist/client/assets/{use-file-configs-C8z3zSDD.js → use-file-configs-BmyLNtzY.js} +1 -1
  181. package/dist/client/assets/{use-infinite-scroll-V4l3DQJD.js → use-infinite-scroll-CJlKxIxa.js} +1 -1
  182. package/dist/client/assets/{use-join-requests-Duz0LeuZ.js → use-join-requests-Dh4DPnmF.js} +1 -1
  183. package/dist/client/assets/{use-mcp-client-DYpZuPPA.js → use-mcp-client-7EfqWxgd.js} +1 -1
  184. package/dist/client/assets/{use-mcp-prompts-BxOgLeZF.js → use-mcp-prompts-DIkRTD9t.js} +1 -1
  185. package/dist/client/assets/{use-mcp-tools-xhV-ENX5.js → use-mcp-tools-W08KOK_v.js} +1 -1
  186. package/dist/client/assets/{use-members-CJKZdynB.js → use-members-DyLgAHg5.js} +1 -1
  187. package/dist/client/assets/{use-mobile-CPyq18pe.js → use-mobile-CeVjRMu3.js} +1 -1
  188. package/dist/client/assets/{use-navigate-to-agent-Bhu6dr_a.js → use-navigate-to-agent-CfSjeQwH.js} +1 -1
  189. package/dist/client/assets/use-org-auth-client-CVfi2bFZ.js +1 -0
  190. package/dist/client/assets/{use-org-sso-DGBv3Hvc.js → use-org-sso-3_seOFru.js} +1 -1
  191. package/dist/client/assets/{use-organization-roles-1exN43Rd.js → use-organization-roles-BBD5Uy2k.js} +1 -1
  192. package/dist/client/assets/{use-organization-settings-DFnXSR7Z.js → use-organization-settings-Bvieu16r.js} +1 -1
  193. package/dist/client/assets/{use-registry-connections-Czx1u2H6.js → use-registry-connections-DgPJKdCX.js} +1 -1
  194. package/dist/client/assets/{use-secrets-DqgJI3yC.js → use-secrets-Bpmq5HaY.js} +1 -1
  195. package/dist/client/assets/{use-status-sounds-DRhhwMt0.js → use-status-sounds-Dsmk_M7Y.js} +1 -1
  196. package/dist/client/assets/{use-view-mode-BB9Jcv_5.js → use-view-mode-DhQbMx-b.js} +1 -1
  197. package/dist/client/assets/{use-virtual-mcp-DnY7c9gE.js → use-virtual-mcp-CTBnE7sF.js} +1 -1
  198. package/dist/client/assets/useInfiniteQuery-B8aLEC__.js +1 -0
  199. package/dist/client/assets/{useQueries-D96G2W1b.js → useQueries-DRRNcEOA.js} +1 -1
  200. package/dist/client/assets/useSuspenseInfiniteQuery-BJo3aYmp.js +1 -0
  201. package/dist/client/assets/variant-calendar-D-QL2C_C.js +1 -0
  202. package/dist/client/assets/{view-mode-toggle-ncGR_sPB.js → view-mode-toggle-9We3fjVd.js} +1 -1
  203. package/dist/client/index.html +1 -1
  204. package/dist/server/cli.js +1 -1
  205. package/package.json +4 -5
  206. package/dist/client/assets/Form-Czxo_N56.js +0 -26
  207. package/dist/client/assets/ai-providers-6xIkfdtm.js +0 -1
  208. package/dist/client/assets/app-editor-k7Nl_uKp.js +0 -1
  209. package/dist/client/assets/automations-TTHh4EuE.js +0 -1
  210. package/dist/client/assets/buckets-CM0nkgpJ.js +0 -1
  211. package/dist/client/assets/category-editor-Bx9oTK3B.js +0 -1
  212. package/dist/client/assets/collection-detail-BcWtgoUr.js +0 -1
  213. package/dist/client/assets/command-DyJgh8wP.js +0 -1
  214. package/dist/client/assets/commerce-onboarding-CJHzpHob.js +0 -1
  215. package/dist/client/assets/connection-detail-CCaFPgvC.js +0 -1
  216. package/dist/client/assets/connections-DZYmLj7X.js +0 -1
  217. package/dist/client/assets/file-explorer-BveBp463.js +0 -2
  218. package/dist/client/assets/general-FW5Wth3b.js +0 -1
  219. package/dist/client/assets/index-BdQq_4o_.js +0 -1
  220. package/dist/client/assets/index-D5RW_4sI.js +0 -1
  221. package/dist/client/assets/index-DAWoaMpc.js +0 -1
  222. package/dist/client/assets/index-DoculpR5.js +0 -1
  223. package/dist/client/assets/index-UgEhsCuR.js +0 -1
  224. package/dist/client/assets/page-seo-sheet-o3dCAhA-.js +0 -1
  225. package/dist/client/assets/post-editor-CWr-_gb_.js +0 -1
  226. package/dist/client/assets/profile-62y90jm_.js +0 -1
  227. package/dist/client/assets/project-app-view-BeZFUwcQ.js +0 -1
  228. package/dist/client/assets/record-editor-BsdzrkRD.js +0 -1
  229. package/dist/client/assets/registry-DpNbpkzg.js +0 -2
  230. package/dist/client/assets/secrets-C6bKEzDN.js +0 -1
  231. package/dist/client/assets/select-Ct-_FhWe.js +0 -1
  232. package/dist/client/assets/seo-editor-Ad8X__jc.js +0 -1
  233. package/dist/client/assets/sso-DGooE6a8.js +0 -1
  234. package/dist/client/assets/store-registry-BPQHh-y5.js +0 -2
  235. package/dist/client/assets/tools-list-BKN97Z6h.js +0 -1
  236. package/dist/client/assets/use-connection-BPcAXa47.js +0 -1
  237. package/dist/client/assets/use-org-auth-client-Tiq6Yt9b.js +0 -1
  238. package/dist/client/assets/useInfiniteQuery-DlRMWoIP.js +0 -1
  239. package/dist/client/assets/useSuspenseInfiniteQuery-BjlxN-DZ.js +0 -1
  240. package/dist/client/assets/variant-calendar-BlIkgRxn.js +0 -1
@@ -1 +0,0 @@
1
- import{c as N,j as s,v as ls,r as z,l as Q,i as Bs,s as te,w as pe,a as Ie,x as Us,K as as,k as cs,b as Ge,e as qs,u as Jn,y as Zn,R as er,D as tr,z as sr,C as nr,F as rr,G as or,d as ir,B as ft,H as lr,I as ar,t as Oe,J as cr,M as dr,n as ur,m as mr,o as fr,P as pr,T as xr,U as hr,V as Pe,W as Ws,X as gr,Y as Ks,Z as br,_ as jr,$ as vr,a0 as yr,a1 as Sr,a2 as _r,a3 as Nr,a4 as Cr,E as Vs,O as wr}from"./index-BkSIY6JJ.js";import{u as Ve,S as he,a as Te,b as Lt,c as Ht,d as De,e as Ys,f as Xs,g as kr,h as Ir,i as ts,j as Tr,k as $r,l as Ar}from"./sidebar-C45GjVmp.js";import{u as ds}from"./use-mobile-CPyq18pe.js";import{u as zr,S as vs,M as Or}from"./shell-controls-C6FYdYnB.js";import{a as Pr,b as Dr,c as Mr}from"./ZoomOut-BdBjpsIq.js";import{T as ge,a as ce}from"./toolbar-D5FkjLVB.js";import{a as Me,b as Re,T as Ee,c as ys}from"./tooltip-CAEDbADy.js";import{S as we}from"./skeleton-h95MLET_.js";import{P as Bt,a as pt,b as Ut}from"./popover-1pFpRX6s.js";import{D as Qs,a as Js,b as Zs}from"./drawer-C4RJ4_GY.js";import{i as en}from"./SearchMd-uzKFlzQB.js";import{s as Rr}from"./Star01-BrkbxV-A.js";import{s as ke}from"./Plus-jFajoMCA.js";import{i as Er,a as Fr}from"./use-mcp-client-DYpZuPPA.js";import{u as tn,a as vt,b as Gr}from"./use-virtual-mcp-DnY7c9gE.js";import{u as Lr}from"./use-create-virtual-mcp-C88JBuQM.js";import{I as Hr,u as Br,W as Ur,H as qr,S as Wr}from"./import-from-deco-dialog-Nrpq_g30.js";import{A as Fe,a as Ss,i as _s,b as sn,c as Kr,d as Vr,e as Yr,f as Xr}from"./agent-icon-C6bJxQ04.js";import{G as Qr,a as Jr}from"./github-repo-picker-Db_ehY6e.js";import{u as nn,a as Zr,b as rn,T as eo}from"./hooks-chgqRyLj.js";import{r as to,u as so,R as no,a as ro,b as on}from"./shell-layout-CR4YIb2n.js";import{u as oo,g as ln,a as io,b as lo,s as ao,c as co,r as uo,d as mo,e as fo,f as po,p as xo,T as an,h as ho,i as go,j as bo,k as jo,l as vo,m as yo,n as So,o as _o,q as No,S as Ns,t as cn}from"./use-navigate-to-agent-Bhu6dr_a.js";import{g as Co,u as dn,A as un,a as wo,b as ko,c as Cs,K as Io,P as To,s as $o,S as Ao,v as zo,D as Oo,d as Po,e as Do,C as Mo,f as Ro}from"./sortable.esm-CbeYFn14.js";import{i as Eo}from"./LayoutLeft-BqtFvEWV.js";import{i as mn}from"./Monitor01-CZ30bS8J.js";import{u as Fo,v as Go,C as Lo}from"./connect-desktop-dialog-ByWaevjw.js";import{A as ss}from"./avatar-oAcdiJ9v.js";import{i as us}from"./ChevronUp-BhWz3ylT.js";import{a as ws}from"./Eye-DWTUBTZ_.js";import{n as Ho,i as Bo}from"./Globe01-BgRW2EiE.js";import{i as Uo,a as fn}from"./ZapSquare-DdgE8vy-.js";import{n as qo,a as Wo}from"./Sun-9FxiCes3.js";import{a as yt,i as Ko,b as Vo}from"./Settings02-47eDNk4K.js";import{i as Yo}from"./Shield01-BgRa80OR.js";import{a as Xo}from"./Users03-gvBLUtvG.js";import{s as ms}from"./XClose-Doj89HqF.js";import{A as Qo,a as Jo,b as Zo,c as ei,d as ti,e as si,f as ni}from"./alert-dialog-HmiP05XU.js";import{F as ri,a as oi,b as ii,c as li,d as ai,e as ci,f as di}from"./form-CPJbrMq5.js";import{I as ui}from"./input-jkT1z5r1.js";import{S as mi,C as fi}from"./chat-context-DN0_9Gee.js";import"./index-K-17SMjl.js";import{n as fs}from"./Stars02-DlImJz_z.js";import{u as pi,a as xi}from"./use-join-requests-Duz0LeuZ.js";import{i as ps}from"./ChevronRight-ChYOVgWd.js";import{i as hi}from"./FilterLines-Djqj6uj_.js";import{t as gi}from"./Users01-BUyczaeV.js";import{S as ks,a as pn,b as Is,c as Ts,d as $s}from"./select-Ct-_FhWe.js";import{b as bi,D as ji,a as vi,d as yi,e as Si}from"./dialog-BLvz2lK8.js";import{C as _i,a as Ni,b as Ci,c as wi,d as ki}from"./command-DyJgh8wP.js";import{u as xn}from"./studio-tools-BgUSKeCY.js";import{i as hn}from"./Zap-BCqTHl-x.js";import{u as Ii}from"./use-org-auth-client-Tiq6Yt9b.js";import{C as Ot,a as As,b as gn,c as bn,d as jn}from"./context-menu-Bt-E5y3C.js";import{g as Ti,S as $i}from"./task-status-DzLkYYrk.js";import{u as Ai,f as zi}from"./use-clock-tick-DHvuEFIJ.js";import{t as vn}from"./ChevronDown-BWfuTI7r.js";import{S as Oi}from"./shell-route-loading-fK7OWXny.js";import"./sheet-CUfjkNRy.js";import"./X-B-cRV-7d.js";import"./ChevronLeft-BNcg18cx.js";import"./auth-B9Q1UUsp.js";import"./use-collections-yHRKnSEt.js";import"./use-connection-BPcAXa47.js";import"./collection-search-DbQr2iji.js";import"./AlertCircle-flSoo6uw.js";import"./Tool01-rx0lKYM8.js";import"./SwitchHorizontal01-CB5mOBIf.js";import"./XCircle-CkhBWURn.js";import"./ArrowUpRight-BeOMO89N.js";import"./CheckCircle-B9ekAAw-.js";import"./DotsVertical-C0YWb9xq.js";import"./Globe04-XITcP2mp.js";import"./HardDrive-DS3VxDtU.js";import"./Key01-DX7L8s0Z.js";import"./LinkExternal01-Cf-6A1_h.js";import"./Palette-Dy2dQgqx.js";import"./Play-DvFnuZIO.js";import"./Stars01-Daq_eW6a.js";import"./Trash01-DI7qV1ow.js";import"./Upload01-Boqk1hvA.js";import"./User01-B3UbdHmL.js";import"./checkbox-Bi39v4Qa.js";import"./authenticate-and-persist-oauth-xCkDryiA.js";import"./mcp-oauth-BIBzZgcE.js";import"./use-mcp-tools-xhV-ENX5.js";import"./extract-connection-data-iACc8UZO.js";import"./decopilot-sse-pool-CKTJhrtc.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./required-auth-layout-DjRtF3m8.js";import"./tab-id-BptcWVWa.js";import"./use-organization-settings-DFnXSR7Z.js";import"./use-org-sso-DGBv3Hvc.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-DehsL0Sf.js";import"./use-registry-connections-Czx1u2H6.js";import"./useInfiniteQuery-DlRMWoIP.js";import"./use-infinite-scroll-V4l3DQJD.js";import"./card-BIwENur_.js";import"./integration-icon-CZDEviNI.js";import"./collection-tabs-D77_So6e.js";import"./badge-CpKEkIGn.js";import"./textarea-BzYVaGJ0.js";import"./connection-form-helpers-CASdXQaW.js";import"./useSuspenseInfiniteQuery-BjlxN-DZ.js";import"./use-ai-providers-BcLob6tS.js";import"./label-CETsHBZ0.js";import"./use-capability-CbeJheXW.js";import"./index-BdQq_4o_.js";import"./index-DAmj773w.js";import"./differenceInSeconds-NQ4PDo0z.js";function Pi(t){const e=N.c(5),{onPointerDown:n,onDoubleClick:r}=t,{state:o,isMobile:i}=Ve();if(i||o==="collapsed")return null;let l,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={left:"var(--sidebar-width)"},a=s.jsx("span",{className:"pointer-events-none absolute inset-y-0 left-1/2 w-px -translate-x-1/2 bg-transparent transition-colors duration-150 group-hover/resize:bg-border group-active/resize:bg-border"}),e[0]=l,e[1]=a):(l=e[0],a=e[1]);let c;return e[2]!==r||e[3]!==n?(c=s.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar",title:"Drag to resize, double-click to reset",onPointerDown:n,onDoubleClick:r,className:"group/resize absolute top-0 z-20 h-full w-2 -translate-x-1/2 cursor-col-resize",style:l,children:a}),e[2]=r,e[3]=n,e[4]=c):c=e[4],c}const xs=240,Di=400,Mi="sidebar.width";function jt(t){return Math.max(xs,Math.min(Di,t))}function Ri(){const t=N.c(11),[e,n]=ls(Mi,Ei),r=z.useRef(null);let o;t[0]!==n||t[1]!==e?(o=u=>{u.preventDefault();const m=u.clientX,f=jt(e),h=r.current??(typeof document<"u"?document.querySelector('[data-slot="sidebar-wrapper"]'):null),p=h?Array.from(h.querySelectorAll('[data-slot="sidebar"], [data-slot="sidebar-container"]')):[];for(const b of p)b.style.transition="none";const x=b=>{const j=jt(f+(b.clientX-m));h?.style.setProperty("--sidebar-width",`${j}px`)},g=b=>{const j=jt(f+(b.clientX-m));n(j);for(const y of p)y.style.transition="";window.removeEventListener("pointermove",x),window.removeEventListener("pointerup",g),document.body.style.userSelect="",document.body.style.cursor=""};document.body.style.userSelect="none",document.body.style.cursor="col-resize",window.addEventListener("pointermove",x),window.addEventListener("pointerup",g)},t[0]=n,t[1]=e,t[2]=o):o=t[2];const i=o;let l;t[3]!==n?(l=()=>{n(xs)},t[3]=n,t[4]=l):l=t[4];const a=l;let c;t[5]!==e?(c=jt(e),t[5]=e,t[6]=c):c=t[6];let d;return t[7]!==i||t[8]!==a||t[9]!==c?(d={width:c,wrapperRef:r,onStartResize:i,resetWidth:a},t[7]=i,t[8]=a,t[9]=c,t[10]=d):d=t[10],d}function Ei(t){return typeof t=="number"?jt(t):xs}function Fi(t){const e=N.c(21),{value:n,onChange:r,placeholder:o,onKeyDown:i,className:l,isSearching:a,disabled:c}=t,d=o===void 0?"Search...":o;let u;e[0]!==l?(u=Q("shrink-0 w-full border-b border-border h-12",l),e[0]=l,e[1]=u):u=e[1];const m=c?"cursor-not-allowed opacity-50":"cursor-text";let f;e[2]!==m?(f=Q("flex items-center gap-2.5 h-12 px-4",m),e[2]=m,e[3]=f):f=e[3];let h;e[4]!==a?(h=a?s.jsx(Bs,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):s.jsx(en,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=a,e[5]=h):h=e[5];let p;e[6]!==r?(p=j=>r(j.target.value),e[6]=r,e[7]=p):p=e[7];let x;e[8]!==c||e[9]!==i||e[10]!==d||e[11]!==p||e[12]!==n?(x=s.jsx("input",{type:"text",value:n,onChange:p,onKeyDown:i,placeholder:d,disabled:c,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=c,e[9]=i,e[10]=d,e[11]=p,e[12]=n,e[13]=x):x=e[13];let g;e[14]!==f||e[15]!==h||e[16]!==x?(g=s.jsxs("label",{className:f,children:[h,x]}),e[14]=f,e[15]=h,e[16]=x,e[17]=g):g=e[17];let b;return e[18]!==u||e[19]!==g?(b=s.jsx("div",{className:u,children:g}),e[18]=u,e[19]=g,e[20]=b):b=e[20],b}const Gi="Select an existing agent";function Li(t){const e=N.c(5),{children:n}=t;let r;e[0]!==n?(r=s.jsx(Me,{asChild:!0,children:n}),e[0]=n,e[1]=r):r=e[1];let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Re,{side:"right",sideOffset:8,children:Gi}),e[2]=o):o=e[2];let i;return e[3]!==r?(i=s.jsxs(Ee,{defaultOpen:!0,delayDuration:0,children:[r,o]}),e[3]=r,e[4]=i):i=e[4],i}function Hi(){const t=N.c(5),{enableDecoImport:e}=Us(),{data:n}=Ie.useSession();let r;t[0]!==n?.user?.email?(r=as.decoProfile(n?.user?.email),t[0]=n?.user?.email,t[1]=r):r=t[1];const o=!!e&&!!n?.user?.email;let i;t[2]!==r||t[3]!==o?(i={queryKey:r,queryFn:Bi,enabled:o,staleTime:3e5},t[2]=r,t[3]=o,t[4]=i):i=t[4];const{data:l}=cs(i);return l?.isDecoUser??!1}async function Bi(){const t=await fetch("/api/deco-sites/profile");return t.ok?t.json():{isDecoUser:!1}}function Ui(t){const e=Ge(),{create:n}=nn(),{locator:r}=pe(),o=qs({strict:!1}),i=Jn({strict:!1});return async l=>{const a=crypto.randomUUID(),c=l===i.virtualmcpid?to(t,r,o.taskId??""):null;try{await n({id:a,virtual_mcp_id:l,...c?{branch:c}:{}})}catch{}e({to:"/$org/$taskId",params:{org:t,taskId:a},search:{virtualmcpid:l}})}}function qi(t){const e=N.c(9),{agent:n,onClick:r}=t;let o;e[0]!==n.icon||e[1]!==n.title?(o=s.jsx(Fe,{icon:n.icon,name:n.title,size:"md",className:"transition-transform group-hover:scale-105"}),e[0]=n.icon,e[1]=n.title,e[2]=o):o=e[2];let i;e[3]!==n.title?(i=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground line-clamp-2 w-full",children:n.title}),e[3]=n.title,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==o||e[7]!==i?(l=s.jsxs("button",{type:"button",onClick:r,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group",children:[o,i]}),e[5]=r,e[6]=o,e[7]=i,e[8]=l):l=e[8],l}function Wi(t){const e=N.c(65),{onClose:n,onOpenImportDeco:r,onOpenGithubImport:o}=t,[i,l]=z.useState(""),a=tn(),c=a??[],{org:d}=pe(),{data:u}=Ie.useSession(),m=u?.user?.id??"anon",f=ln(a),h=io();let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p={navigateOnCreate:!0},e[0]=p):p=e[0];const{createVirtualMCP:x,isCreating:g}=Lr(p),{createFromTemplate:b,isCreating:j}=Br(),y=Hi(),v=Ui(d.slug),_=Co(a),w=i.toLowerCase(),S=c.filter(Ki).filter(Z=>!_.has(Z.id)).filter(Z=>!i||Z.title.toLowerCase().includes(w)),I=Z=>{lo({orgId:d.id,userId:m},Z.id,f),h(),n(),l(""),v(Z.id)},T="flex flex-col max-h-[min(640px,80dvh)]";let $;e[1]!==i?($=s.jsx(Fi,{value:i,onChange:l,placeholder:"Search agents..."}),e[1]=i,e[2]=$):$=e[2];const O="overflow-y-auto flex-1 min-h-0 px-3 pb-3";let A;e[3]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx("div",{className:"px-1 pt-3 pb-2",children:s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Agents"})}),e[3]=A):A=e[3];const C="grid grid-cols-3 gap-1";let M;e[4]!==x||e[5]!==n?(M=async()=>{te("agent_create_new_clicked",{source:"browse_popover"}),await x(),n()},e[4]=x,e[5]=n,e[6]=M):M=e[6];let K,U;e[7]===Symbol.for("react.memo_cache_sentinel")?(K=s.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-dashed border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:s.jsx(ke,{size:16,className:"text-muted-foreground"})}),U=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Create new"}),e[7]=K,e[8]=U):(K=e[7],U=e[8]);let E;e[9]!==g||e[10]!==M?(E=s.jsxs("button",{type:"button",disabled:g,onClick:M,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group disabled:opacity-50 disabled:cursor-not-allowed",children:[K,U]}),e[9]=g,e[10]=M,e[11]=E):E=e[11];let L;e[12]!==b||e[13]!==n?(L=async()=>{te("agent_create_clicked",{source:"browse_popover",method:"website"}),await b(Ur),n()},e[12]=b,e[13]=n,e[14]=L):L=e[14];let R,H;e[15]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:s.jsx(Rr,{className:"size-5 text-muted-foreground"})}),H=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Start Website"}),e[15]=R,e[16]=H):(R=e[15],H=e[16]);let P;e[17]!==j||e[18]!==L?(P=s.jsxs("button",{type:"button",disabled:j,onClick:L,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group disabled:opacity-50 disabled:cursor-not-allowed",children:[R,H]}),e[17]=j,e[18]=L,e[19]=P):P=e[19];let G;e[20]!==b||e[21]!==n?(G=async()=>{te("agent_create_clicked",{source:"browse_popover",method:"hydrogen"}),await b(qr),n()},e[20]=b,e[21]=n,e[22]=G):G=e[22];let D,B;e[23]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:s.jsx("img",{src:Wr,alt:"",className:"size-5 object-contain"})}),B=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Shopify Headless Store"}),e[23]=D,e[24]=B):(D=e[23],B=e[24]);let F;e[25]!==j||e[26]!==G?(F=s.jsxs("button",{type:"button",disabled:j,onClick:G,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group disabled:opacity-50 disabled:cursor-not-allowed",children:[D,B]}),e[25]=j,e[26]=G,e[27]=F):F=e[27];let Y;e[28]!==n||e[29]!==o?(Y=()=>{te("agent_import_clicked",{source:"github"}),o(),n()},e[28]=n,e[29]=o,e[30]=Y):Y=e[30];let ee,V;e[31]===Symbol.for("react.memo_cache_sentinel")?(ee=s.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:s.jsx(Jr,{className:"size-5 text-muted-foreground"})}),V=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Import GitHub"}),e[31]=ee,e[32]=V):(ee=e[31],V=e[32]);let J;e[33]!==Y?(J=s.jsxs("button",{type:"button",onClick:Y,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group",children:[ee,V]}),e[33]=Y,e[34]=J):J=e[34];let X;e[35]!==y||e[36]!==n||e[37]!==r?(X=y&&s.jsxs("button",{type:"button",onClick:()=>{te("agent_import_clicked",{source:"deco"}),r(),n()},className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group",children:[s.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"",className:"size-5 object-contain"})}),s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Import deco.cx"})]}),e[35]=y,e[36]=n,e[37]=r,e[38]=X):X=e[38];const W=S.map(Z=>s.jsx(qi,{agent:Z,onClick:()=>I(Z)},Z.id));let re;e[39]!==E||e[40]!==P||e[41]!==F||e[42]!==J||e[43]!==X||e[44]!==W?(re=s.jsxs("div",{className:C,children:[E,P,F,J,X,W]}),e[39]=E,e[40]=P,e[41]=F,e[42]=J,e[43]=X,e[44]=W,e[45]=re):re=e[45];let ie;e[46]!==g||e[47]!==i||e[48]!==S.length?(ie=S.length===0&&!g&&s.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:i?"No agents found":"No agents yet"}),e[46]=g,e[47]=i,e[48]=S.length,e[49]=ie):ie=e[49];let ue;e[50]!==re||e[51]!==ie||e[52]!==A?(ue=s.jsxs("div",{className:O,children:[A,re,ie]}),e[50]=re,e[51]=ie,e[52]=A,e[53]=ue):ue=e[53];let ne;e[54]!==d.slug?(ne={org:d.slug},e[54]=d.slug,e[55]=ne):ne=e[55];let oe;e[56]!==n?(oe=()=>n(),e[56]=n,e[57]=oe):oe=e[57];let le;e[58]!==ne||e[59]!==oe?(le=s.jsx("div",{className:"border-t border-border px-3 py-2.5",children:s.jsx(Zn,{to:"/$org/settings/agents",params:ne,onClick:oe,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:"See all agents"})}),e[58]=ne,e[59]=oe,e[60]=le):le=e[60];let xe;return e[61]!==ue||e[62]!==$||e[63]!==le?(xe=s.jsxs("div",{className:T,children:[$,ue,le]}),e[61]=ue,e[62]=$,e[63]=le,e[64]=xe):xe=e[64],xe}function Ki(t){return!Er(t.id)}function yn(t){const e=N.c(26);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const{compact:r}=n,o=r===void 0?!1:r,[i,l]=z.useState(!1),[a,c]=z.useState(!1),[d,u]=z.useState(!1),m=ds(),{setOpenMobile:f}=Ve(),h=oo(),p=h?"border border-border":void 0;let x;e[2]!==h?(x=T=>h?s.jsx(Li,{children:T}):T,e[2]=h,e[3]=x):x=e[3];const g=x;let b;e[4]!==m||e[5]!==f?(b=()=>{l(!1),m&&f(!1)},e[4]=m,e[5]=f,e[6]=b):b=e[6];const j=b;let y;e[7]!==j||e[8]!==i?(y=i&&s.jsx(z.Suspense,{fallback:s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(we,{className:"h-4 w-24"})}),children:s.jsx(Wi,{onClose:j,onOpenImportDeco:()=>c(!0),onOpenGithubImport:()=>{u(!0),j()}})}),e[7]=j,e[8]=i,e[9]=y):y=e[9];const v=y;let _;e[10]!==o||e[11]!==p||e[12]!==h||e[13]!==m||e[14]!==i||e[15]!==v||e[16]!==g?(_=m?s.jsxs(s.Fragment,{children:[o?g(s.jsx(ge,{"aria-label":"Browse agents",className:Q(p),onClick:()=>{te("agent_browser_opened",{surface:"mobile_drawer"}),l(!0)},children:s.jsx(ke,{className:"size-4"})})):s.jsx(he,{children:g(s.jsxs(Te,{tooltip:h?void 0:"Browse agents",className:Q(p),onClick:()=>{te("agent_browser_opened",{surface:"mobile_drawer"}),l(!0)},children:[s.jsx(ke,{}),s.jsx("span",{children:"New agent"})]}))}),s.jsx(Qs,{open:i,onOpenChange:l,direction:"bottom",children:s.jsxs(Js,{className:"max-h-[85dvh] p-0",children:[s.jsx(Zs,{className:"sr-only",children:"Browse agents"}),v]})})]}):s.jsxs(Bt,{open:i,onOpenChange:T=>{T&&!i&&te("agent_browser_opened",{surface:"desktop_popover"}),l(T)},children:[o?g(s.jsx(pt,{asChild:!0,children:s.jsx(ge,{"aria-label":"Browse agents",className:Q(p),children:s.jsx(ke,{className:"size-4"})})})):s.jsx(he,{children:g(s.jsx(pt,{asChild:!0,children:s.jsxs(Te,{tooltip:h?void 0:"Browse agents",className:Q(p),children:[s.jsx(ke,{}),s.jsx("span",{children:"New agent"})]})}))}),s.jsx(Ut,{className:"w-[380px] p-0 overflow-hidden",side:"right",align:"start",children:v})]}),e[10]=o,e[11]=p,e[12]=h,e[13]=m,e[14]=i,e[15]=v,e[16]=g,e[17]=_):_=e[17];let w;e[18]!==a?(w=s.jsx(Hr,{open:a,onOpenChange:c}),e[18]=a,e[19]=w):w=e[19];let S;e[20]!==d?(S=s.jsx(Qr,{open:d,onOpenChange:u}),e[20]=d,e[21]=S):S=e[21];let I;return e[22]!==_||e[23]!==w||e[24]!==S?(I=s.jsxs(s.Fragment,{children:[_,w,S]}),e[22]=_,e[23]=w,e[24]=S,e[25]=I):I=e[25],I}function Sn(){const t=N.c(24),{org:e}=pe(),n=Ge(),o=zr().location.pathname,i=e.slug,{state:l,isMobile:a}=Ve(),c=!a&&l==="collapsed";let d;t[0]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Pr,{className:"size-4!"}),t[0]=d):d=t[0];const u=o===`/${i}`||o===`/${i}/`;let m;t[1]!==n||t[2]!==i?(m=()=>{n({to:"/$org",params:{org:i}})},t[1]=n,t[2]=i,t[3]=m):m=t[3];let f;t[4]!==u||t[5]!==m?(f={key:"home",label:"Home",icon:d,isActive:u,onClick:m},t[4]=u,t[5]=m,t[6]=f):f=t[6];const h=f;let p;t[7]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(Dr,{className:"size-4!"}),t[7]=p):p=t[7];let x;t[8]!==o||t[9]!==i?(x=o.startsWith(`/${i}/files`),t[8]=o,t[9]=i,t[10]=x):x=t[10];let g;t[11]!==n||t[12]!==i?(g=()=>{n({to:"/$org/files",params:{org:i}})},t[11]=n,t[12]=i,t[13]=g):g=t[13];let b;t[14]!==x||t[15]!==g?(b={key:"files",label:"Library",icon:p,isActive:x,onClick:g},t[14]=x,t[15]=g,t[16]=b):b=t[16];const j=b;let y;t[17]!==j||t[18]!==h?(y={type:"items",items:[h,j]},t[17]=j,t[18]=h,t[19]=y):y=t[19];let v;if(t[20]!==c||t[21]!==y){if(v=[y],c){let _;t[23]===Symbol.for("react.memo_cache_sentinel")?(_={type:"custom",key:"new-task",content:s.jsx(Lt,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(Ht,{children:s.jsx(De,{className:"gap-1.5",children:s.jsx(yn,{})})})})},t[23]=_):_=t[23],v.push(_)}t[20]=c,t[21]=y,t[22]=v}else v=t[22];return v}function Rt(t){const e=N.c(12);let n,r,o,i;e[0]!==t?({className:n,orientation:o,decorative:i,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=i):(n=e[1],r=e[2],o=e[3],i=e[4]);const l=o===void 0?"horizontal":o,a=i===void 0?!0:i;let c;e[5]!==n?(c=Q("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",n),e[5]=n,e[6]=c):c=e[6];let d;return e[7]!==a||e[8]!==l||e[9]!==r||e[10]!==c?(d=s.jsx(er,{"data-slot":"separator-root",decorative:a,orientation:l,className:c,...r}),e[7]=a,e[8]=l,e[9]=r,e[10]=c,e[11]=d):d=e[11],d}function _n(t){const e=N.c(3),{children:n}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"flex h-6 items-center",children:s.jsx("div",{className:"h-0.5 w-16 rounded-full bg-sidebar-foreground/15"})}),e[0]=r):r=e[0];let o;return e[1]!==n?(o=s.jsxs(Lt,{className:"pt-0 pr-0 pb-2 pl-0 mt-2",children:[r,s.jsx(Ht,{children:s.jsx(De,{className:"gap-0.5",children:n})})]}),e[1]=n,e[2]=o):o=e[2],o}function Nn(t){const e=N.c(18),{item:n}=t,{isMobile:r,setOpenMobile:o}=Ve();let i;e[0]!==r||e[1]!==n||e[2]!==o?(i=()=>{te("nav_item_clicked",{nav_key:n.key,nav_label:n.label,is_active:!!n.isActive,is_mobile:r}),n.onClick?.(),r&&o(!1)},e[0]=r,e[1]=n,e[2]=o,e[3]=i):i=e[3];const l=i,a=n.key,c=n.isActive&&"z-10";let d;e[4]!==c?(d=Q(c),e[4]=c,e[5]=d):d=e[5];let u;e[6]!==n.label?(u=s.jsx("span",{children:n.label}),e[6]=n.label,e[7]=u):u=e[7];let m;e[8]!==l||e[9]!==n.icon||e[10]!==n.isActive||e[11]!==n.label||e[12]!==u?(m=s.jsxs(Te,{onClick:l,isActive:n.isActive,tooltip:n.label,children:[n.icon,u]}),e[8]=l,e[9]=n.icon,e[10]=n.isActive,e[11]=n.label,e[12]=u,e[13]=m):m=e[13];let f;return e[14]!==n.key||e[15]!==d||e[16]!==m?(f=s.jsx(he,{className:d,children:m},a),e[14]=n.key,e[15]=d,e[16]=m,e[17]=f):f=e[17],f}function Vi(t){const e=N.c(12),{section:n}=t;switch(n.type){case"divider":{let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Ys,{className:"my-2"}),e[0]=r):r=e[0],r}case"spacer":{let r;return e[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"flex-1"}),e[1]=r):r=e[1],r}case"group":{const r=n.group.label,o=n.group.defaultExpanded;let i;e[2]!==n.group.items?(i=n.group.items.map(Xi),e[2]=n.group.items,e[3]=i):i=e[3];let l;return e[4]!==n.group.defaultExpanded||e[5]!==n.group.label||e[6]!==i?(l=s.jsx(_n,{label:r,defaultExpanded:o,children:i}),e[4]=n.group.defaultExpanded,e[5]=n.group.label,e[6]=i,e[7]=l):l=e[7],l}case"items":{let r;e[8]!==n.items?(r=n.items.map(Yi),e[8]=n.items,e[9]=r):r=e[9];let o;return e[10]!==r?(o=s.jsx(Lt,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(Ht,{children:s.jsx(De,{className:"gap-1.5",children:r})})}),e[10]=r,e[11]=o):o=e[11],o}case"custom":return n.content}}function Yi(t){return s.jsx(Nn,{item:t},t.key)}function Xi(t){return s.jsx(Nn,{item:t},t.key)}function Qi(t){const e=N.c(14),{sections:n,footer:r,additionalContent:o,variant:i,contentClassName:l}=t,a=i===void 0?"sidebar":i;let c;e[0]!==l?(c=Q("flex flex-col flex-1 px-2 py-2 gap-0.5",l),e[0]=l,e[1]=c):c=e[1];let d;e[2]!==n?(d=n.map(Ji),e[2]=n,e[3]=d):d=e[3];let u;e[4]!==o?(u=o&&s.jsx("div",{className:"flex flex-col flex-1 min-h-0 group-data-[state=collapsed]/sidebar:mt-1 group-data-[state=expanded]/sidebar:mt-2",children:o}),e[4]=o,e[5]=u):u=e[5];let m;e[6]!==c||e[7]!==d||e[8]!==u?(m=s.jsxs(Xs,{className:c,children:[d,u]}),e[6]=c,e[7]=d,e[8]=u,e[9]=m):m=e[9];let f;return e[10]!==r||e[11]!==m||e[12]!==a?(f=s.jsxs(kr,{variant:a,children:[m,r]}),e[10]=r,e[11]=m,e[12]=a,e[13]=f):f=e[13],f}function Ji(t,e){return s.jsx(Vi,{section:t},e)}function Cn(t){const e=N.c(2);let n;return e[0]!==t?(n=s.jsx(Qi,{...t}),e[0]=t,e[1]=n):n=e[1],n}Cn.Skeleton=function(){return s.jsx("div",{className:"flex flex-col gap-0.5",children:Array.from({length:8}).map((e,n)=>s.jsx("div",{className:"w-full h-8",children:s.jsx(we,{className:"h-full bg-sidebar-accent rounded-md"})},n))})};function ns(){const t=N.c(22),e=Fo(),[n,r]=z.useState(!1);let o;if(t[0]!==e.capabilities||t[1]!==e.hostname||t[2]!==e.machineId||t[3]!==e.online){const x=Go(e.capabilities);o=e.online?s.jsxs("div",{className:"flex flex-col gap-0.5 text-xs",children:[s.jsx("span",{className:"font-medium",children:e.hostname??e.machineId??"Desktop linked"}),s.jsx("span",{className:"text-muted-foreground",children:x.length>0?`Available: ${x.join(", ")}`:"No CLI agents detected"})]}):s.jsx("span",{className:"text-xs",children:"Desktop disconnected"}),t[0]=e.capabilities,t[1]=e.hostname,t[2]=e.machineId,t[3]=e.online,t[4]=o}else o=t[4];const i=o;let l;t[5]===Symbol.for("react.memo_cache_sentinel")?(l=()=>r(!0),t[5]=l):l=t[5];const a=e.online?"Desktop linked":"Connect your desktop";let c;t[6]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(mn,{size:16}),t[6]=c):c=t[6];let d;t[7]!==e.online?(d=e.online&&s.jsx("span",{className:"absolute top-1 right-1 size-2 rounded-full bg-success ring-2 ring-background animate-pulse"}),t[7]=e.online,t[8]=d):d=t[8];let u;t[9]!==a||t[10]!==d?(u=s.jsx(Me,{asChild:!0,children:s.jsxs(ge,{onClick:l,"aria-label":a,children:[c,d]})}),t[9]=a,t[10]=d,t[11]=u):u=t[11];let m;t[12]!==i?(m=s.jsx(Re,{side:"bottom",children:i}),t[12]=i,t[13]=m):m=t[13];let f;t[14]!==u||t[15]!==m?(f=s.jsxs(Ee,{children:[u,m]}),t[14]=u,t[15]=m,t[16]=f):f=t[16];let h;t[17]!==n?(h=s.jsx(Lo,{open:n,onOpenChange:r}),t[17]=n,t[18]=h):h=t[18];let p;return t[19]!==f||t[20]!==h?(p=s.jsxs(s.Fragment,{children:[f,h]}),t[19]=f,t[20]=h,t[21]=p):p=t[21],p}function Zi(t){const e=N.c(17),{onToggle:n,className:r}=t,i=Us().logo??tr,l=typeof i=="string"?i:i.light,a=typeof i=="string"?i:i.dark;let c;e[0]!==r?(c=Q("flex flex-row items-center gap-2 md:gap-0.5 shrink-0 h-12 pl-1 pr-2 pt-0.25 pb-0","group-data-[collapsible=icon]/sidebar:hidden",r),e[0]=r,e[1]=c):c=e[1];let d;e[2]!==l?(d=s.jsx("img",{src:l,alt:"Logo",className:"size-6 object-contain dark:hidden"}),e[2]=l,e[3]=d):d=e[3];let u;e[4]!==a?(u=s.jsx("img",{src:a,alt:"Logo",className:"size-6 object-contain hidden dark:block"}),e[4]=a,e[5]=u):u=e[5];let m;e[6]!==d||e[7]!==u?(m=s.jsx("span",{className:"flex items-center shrink-0 pl-1",children:s.jsxs("span",{className:"flex items-center shrink-0 px-2",children:[d,u]})}),e[6]=d,e[7]=u,e[8]=m):m=e[8];let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(Eo,{size:16}),e[9]=f):f=e[9];let h;e[10]!==n?(h=s.jsx(ge,{onClick:n,"aria-label":"Toggle sidebar",children:f}),e[10]=n,e[11]=h):h=e[11];let p;e[12]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(ns,{}),e[12]=p):p=e[12];let x;return e[13]!==c||e[14]!==m||e[15]!==h?(x=s.jsxs(Ir,{className:c,children:[m,h,p]}),e[13]=c,e[14]=m,e[15]=h,e[16]=x):x=e[16],x}function zs(t){const e=N.c(18),{item:n,onClose:r}=t,o=n.isActive&&"z-10";let i;e[0]!==o?(i=Q(o),e[0]=o,e[1]=i):i=e[1];let l;e[2]!==n||e[3]!==r?(l=()=>{n.onClick?.(),r()},e[2]=n,e[3]=r,e[4]=l):l=e[4];let a;e[5]!==n.icon?(a=s.jsx("span",{className:"[&>svg]:size-5 shrink-0",children:n.icon}),e[5]=n.icon,e[6]=a):a=e[6];let c;e[7]!==n.label?(c=s.jsx("span",{children:n.label}),e[7]=n.label,e[8]=c):c=e[8];let d;e[9]!==n.isActive||e[10]!==n.label||e[11]!==l||e[12]!==a||e[13]!==c?(d=s.jsxs(Te,{onClick:l,isActive:n.isActive,tooltip:n.label,className:"h-10! text-sm!",children:[a,c]}),e[9]=n.isActive,e[10]=n.label,e[11]=l,e[12]=a,e[13]=c,e[14]=d):d=e[14];let u;return e[15]!==i||e[16]!==d?(u=s.jsx(he,{className:i,children:d}),e[15]=i,e[16]=d,e[17]=u):u=e[17],u}function el(t){const e=N.c(18),{section:n,onClose:r}=t;switch(n.type){case"divider":{let o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Ys,{className:"my-2"}),e[0]=o):o=e[0],o}case"spacer":{let o;return e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"flex-1"}),e[1]=o):o=e[1],o}case"group":{const o=n.group.label,i=n.group.defaultExpanded;let l;if(e[2]!==r||e[3]!==n.group.items){let c;e[5]!==r?(c=d=>s.jsx(zs,{item:d,onClose:r},d.key),e[5]=r,e[6]=c):c=e[6],l=n.group.items.map(c),e[2]=r,e[3]=n.group.items,e[4]=l}else l=e[4];let a;return e[7]!==n.group.defaultExpanded||e[8]!==n.group.label||e[9]!==l?(a=s.jsx(_n,{label:o,defaultExpanded:i,children:l}),e[7]=n.group.defaultExpanded,e[8]=n.group.label,e[9]=l,e[10]=a):a=e[10],a}case"items":{let o;if(e[11]!==r||e[12]!==n.items){let l;e[14]!==r?(l=a=>s.jsx(zs,{item:a,onClose:r},a.key),e[14]=r,e[15]=l):l=e[15],o=n.items.map(l),e[11]=r,e[12]=n.items,e[13]=o}else o=e[13];let i;return e[16]!==o?(i=s.jsx(Lt,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(Ht,{children:s.jsx(De,{className:"gap-1.5",children:o})})}),e[16]=o,e[17]=i):i=e[17],i}case"custom":return n.content}}function tl(t){const e=N.c(17),{sections:n,onClose:r,footer:o,additionalContent:i}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"h-12 shrink-0"}),e[0]=l):l=e[0];let a;e[1]!==r?(a=s.jsx(z.Suspense,{fallback:l,children:s.jsx(Zi,{onToggle:r})}),e[1]=r,e[2]=a):a=e[2];let c;if(e[3]!==r||e[4]!==n){let f;e[6]!==r?(f=(h,p)=>s.jsx(el,{section:h,onClose:r},p),e[6]=r,e[7]=f):f=e[7],c=n.map(f),e[3]=r,e[4]=n,e[5]=c}else c=e[5];let d;e[8]!==i?(d=i&&s.jsx("div",{className:"mt-3 flex flex-col flex-1 min-h-0",children:i}),e[8]=i,e[9]=d):d=e[9];let u;e[10]!==c||e[11]!==d?(u=s.jsxs(Xs,{className:"flex flex-col flex-1 px-2 py-2 gap-0",children:[c,d]}),e[10]=c,e[11]=d,e[12]=u):u=e[12];let m;return e[13]!==o||e[14]!==a||e[15]!==u?(m=s.jsxs("div",{className:"bg-sidebar flex h-full w-full flex-col","data-sidebar":"sidebar",children:[a,u,o]}),e[13]=o,e[14]=a,e[15]=u,e[16]=m):m=e[16],m}function wn(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const sl=sr({name:nr().min(2,"Organization name is required")});function nl(t){const e=N.c(41),{open:n,onOpenChange:r}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={resolver:rr(sl),defaultValues:{name:""}},e[0]=o):o=e[0];const i=or(o);let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l={mutationFn:ol,onSuccess:rl},e[1]=l):l=e[1];const a=ir(l),c=a.error instanceof Error?a.error.message:a.error?"Failed to create organization.":null;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsxs(Zo,{children:[s.jsx(ei,{children:"Create a new organization"}),s.jsx(ti,{children:"Set up a new organization to collaborate with others."})]}),e[2]=d):d=e[2];let u;if(e[3]!==a||e[4]!==i){let S;e[6]!==a?(S=I=>a.mutateAsync(I),e[6]=a,e[7]=S):S=e[7],u=i.handleSubmit(S),e[3]=a,e[4]=i,e[5]=u}else u=e[5];let m;e[8]!==i.formState.isSubmitting?(m=S=>{const{field:I}=S;return s.jsxs(ii,{children:[s.jsx(li,{children:"Organization Name"}),s.jsx(ai,{children:s.jsx(ui,{...I,placeholder:"Acme Inc.",disabled:i.formState.isSubmitting})}),s.jsx(ci,{children:"The name of your company or organization"}),I.value&&s.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Organization URL:"," ",s.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",wn(I.value)]})]}),s.jsx(di,{})]})},e[8]=i.formState.isSubmitting,e[9]=m):m=e[9];let f;e[10]!==i.control||e[11]!==m?(f=s.jsx(ri,{control:i.control,name:"name",render:m}),e[10]=i.control,e[11]=m,e[12]=f):f=e[12];let h;e[13]!==c?(h=c&&s.jsx("div",{className:"text-destructive text-sm mt-2",children:c}),e[13]=c,e[14]=h):h=e[14];let p;e[15]!==a||e[16]!==i?(p=()=>{a.reset(),i.reset()},e[15]=a,e[16]=i,e[17]=p):p=e[17];let x;e[18]!==i.formState.isSubmitting||e[19]!==p?(x=s.jsx(Qo,{disabled:i.formState.isSubmitting,onClick:p,children:"Cancel"}),e[18]=i.formState.isSubmitting,e[19]=p,e[20]=x):x=e[20];const g=!i.formState.isValid||i.formState.isSubmitting;let b;e[21]!==i.formState.isSubmitting?(b=i.formState.isSubmitting?s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(mi,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=i.formState.isSubmitting,e[22]=b):b=e[22];let j;e[23]!==g||e[24]!==b?(j=s.jsx(ft,{type:"submit",variant:"default",disabled:g,children:b}),e[23]=g,e[24]=b,e[25]=j):j=e[25];let y;e[26]!==j||e[27]!==x?(y=s.jsxs(si,{children:[x,j]}),e[26]=j,e[27]=x,e[28]=y):y=e[28];let v;e[29]!==y||e[30]!==u||e[31]!==f||e[32]!==h?(v=s.jsxs("form",{className:"space-y-6",onSubmit:u,autoComplete:"off",children:[f,h,y]}),e[29]=y,e[30]=u,e[31]=f,e[32]=h,e[33]=v):v=e[33];let _;e[34]!==i||e[35]!==v?(_=s.jsxs(Jo,{children:[d,s.jsx(oi,{...i,children:v})]}),e[34]=i,e[35]=v,e[36]=_):_=e[36];let w;return e[37]!==r||e[38]!==n||e[39]!==_?(w=s.jsx(ni,{open:n,onOpenChange:r,children:_}),e[37]=r,e[38]=n,e[39]=_,e[40]=w):w=e[40],w}function rl(t){const{orgSlug:e}=t;window.location.href=`/${e}`}async function ol(t){const e=wn(t.name);if(!e)throw new Error("Organization slug is invalid");const n=await Ie.organization.create({name:t.name,slug:e});if(n?.error)throw new Error(n.error.message||"Failed to create organization");const r=n?.data?.slug??e;if(!r)throw new Error("Failed to create organization");return{orgSlug:r}}function rs(t){let e=0;for(let r=0;r<t.length;r++)e=t.charCodeAt(r)+((e<<5)-e);const n=Math.abs(e)%360;return{backgroundColor:`hsl(${n} 55% 70%)`,color:`hsl(${n} 55% 20%)`}}function il(t){const e=N.c(13),{org:n,size:r}=t,o=r===void 0?"sm":r,i=o==="xs"?"size-5":"size-6",l=o==="xs"?"text-[9px]":"text-xs";let a;e[0]!==i?(a=Q(i,"shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=i,e[1]=a):a=e[1];let c;e[2]!==n.logo||e[3]!==n.name?(c=n.logo?void 0:rs(n.name),e[2]=n.logo,e[3]=n.name,e[4]=c):c=e[4];let d;e[5]!==n.logo||e[6]!==n.name||e[7]!==l?(d=n.logo?s.jsx("img",{src:n.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:Q("font-semibold leading-none",l),children:n.name.slice(0,2).toUpperCase()}),e[5]=n.logo,e[6]=n.name,e[7]=l,e[8]=d):d=e[8];let u;return e[9]!==a||e[10]!==c||e[11]!==d?(u=s.jsx("div",{className:a,style:c,children:d}),e[9]=a,e[10]=c,e[11]=d,e[12]=u):u=e[12],u}function Pt(t){const e=N.c(22),{item:n,onClose:r}=t;if(n.href){const c=n.external?"_blank":void 0,d=n.external?"noopener noreferrer":void 0;let u;e[0]!==n.icon?(u=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[0]=n.icon,e[1]=u):u=e[1];let m;e[2]!==n.label?(m=s.jsx("span",{className:"flex-1",children:n.label}),e[2]=n.label,e[3]=m):m=e[3];let f;return e[4]!==n.href||e[5]!==r||e[6]!==c||e[7]!==d||e[8]!==u||e[9]!==m?(f=s.jsxs("a",{href:n.href,target:c,rel:d,className:"flex items-center gap-2.5 px-3 py-2 rounded-md text-sm text-left w-full transition-colors text-foreground/80 hover:bg-sidebar-accent hover:text-foreground",onClick:r,children:[u,m]}),e[4]=n.href,e[5]=r,e[6]=c,e[7]=d,e[8]=u,e[9]=m,e[10]=f):f=e[10],f}let o;e[11]!==n||e[12]!==r?(o=()=>{n.onClick?.(),r()},e[11]=n,e[12]=r,e[13]=o):o=e[13];let i;e[14]!==n.icon?(i=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[14]=n.icon,e[15]=i):i=e[15];let l;e[16]!==n.label?(l=s.jsx("span",{className:"flex-1",children:n.label}),e[16]=n.label,e[17]=l):l=e[17];let a;return e[18]!==o||e[19]!==i||e[20]!==l?(a=s.jsxs("button",{type:"button",onClick:o,className:"flex items-center gap-2.5 px-3 py-2 rounded-md text-sm text-left w-full transition-colors text-foreground/80 hover:bg-sidebar-accent hover:text-foreground",children:[i,l]}),e[18]=o,e[19]=i,e[20]=l,e[21]=a):a=e[21],a}function Os(t){const e=N.c(31),{orgParam:n,onSelectOrg:r,onCreateOrg:o}=t,{data:i}=ur();let l;e[0]!==n?(l=(C,M)=>C.slug===n?-1:M.slug===n?1:C.name.localeCompare(M.name),e[0]=n,e[1]=l):l=e[1];const a=[...i??[]].sort(l),[c,d]=z.useState(!1),[u,m]=z.useState(""),f=u.toLowerCase(),h=f?a.filter(C=>C.name.toLowerCase().includes(f)||C.slug.toLowerCase().includes(f)):a;let p;e[2]!==c?(p=function(){c&&m(""),d(ll)},e[2]=c,e[3]=p):p=e[3];const x=p;let g;e[4]!==u||e[5]!==c||e[6]!==x?(g=c?s.jsx("input",{autoFocus:!0,type:"text",value:u,onChange:C=>m(C.target.value),onKeyDown:C=>C.key==="Escape"&&x(),placeholder:"Search organizations...",className:"flex-1 min-w-0 bg-transparent text-sm outline-none placeholder:text-muted-foreground/60"}):s.jsx("span",{className:"text-sm font-medium text-muted-foreground/60",children:"Your Organizations"}),e[4]=u,e[5]=c,e[6]=x,e[7]=g):g=e[7];let b;e[8]!==c?(b=c?s.jsx(ms,{size:16}):s.jsx(en,{size:16}),e[8]=c,e[9]=b):b=e[9];let j;e[10]!==b||e[11]!==x?(j=s.jsx("button",{type:"button",onClick:x,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:b}),e[10]=b,e[11]=x,e[12]=j):j=e[12];let y;e[13]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(ke,{size:16}),e[13]=y):y=e[13];let v;e[14]!==o?(v=s.jsx("button",{type:"button",onClick:o,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:y}),e[14]=o,e[15]=v):v=e[15];let _;e[16]!==j||e[17]!==v?(_=s.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[j,v]}),e[16]=j,e[17]=v,e[18]=_):_=e[18];let w;e[19]!==g||e[20]!==_?(w=s.jsxs("div",{className:"flex items-center justify-between px-4 py-3",children:[g,_]}),e[19]=g,e[20]=_,e[21]=w):w=e[21];const S="flex-1 min-h-0 overflow-y-auto p-1.5 flex flex-col gap-1",I=h.length===0&&s.jsx("p",{className:"px-3 py-4 text-sm text-muted-foreground/60 text-center",children:u?`No organizations match "${u}"`:"No organizations available"});let T;e[22]!==r||e[23]!==n?(T=C=>s.jsxs("button",{type:"button",onClick:()=>r(C.slug),className:Q("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",C.slug===n?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50"),children:[s.jsx(il,{org:C,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:C.name}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:C.slug})]}),C.slug===n&&s.jsx(us,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},C.id),e[22]=r,e[23]=n,e[24]=T):T=e[24];const $=h.map(T);let O;e[25]!==I||e[26]!==$?(O=s.jsxs("div",{className:S,children:[I,$]}),e[25]=I,e[26]=$,e[27]=O):O=e[27];let A;return e[28]!==O||e[29]!==w?(A=s.jsxs(s.Fragment,{children:[w,O]}),e[28]=O,e[29]=w,e[30]=A):A=e[30],A}function ll(t){return!t}function Ps(t){const e=N.c(142),{user:n,userImage:r,menuItems:o,signOutItem:i,themeOptions:l,preferences:a,setPreferences:c,orgParam:d,onSelectOrg:u,onCreateOrg:m,close:f,isMobile:h,open:p}=t;if(h){const X=n?.name??"U";let W;e[0]!==X||e[1]!==r?(W=s.jsx(ss,{url:r,fallback:X,shape:"circle",size:"sm",className:"shrink-0"}),e[0]=X,e[1]=r,e[2]=W):W=e[2];const re=n?.name??"User";let ie;e[3]!==re?(ie=s.jsx("p",{className:"text-sm font-medium truncate",children:re}),e[3]=re,e[4]=ie):ie=e[4];const ue=n?.email;let ne;e[5]!==ue?(ne=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:ue}),e[5]=ue,e[6]=ne):ne=e[6];let oe;e[7]!==ie||e[8]!==ne?(oe=s.jsxs("div",{className:"flex-1 min-w-0",children:[ie,ne]}),e[7]=ie,e[8]=ne,e[9]=oe):oe=e[9];let le;e[10]!==n?(le=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(ul)},e[10]=n,e[11]=le):le=e[11];let xe;e[12]===Symbol.for("react.memo_cache_sentinel")?(xe=s.jsx(ws,{size:14}),e[12]=xe):xe=e[12];let Z;e[13]!==le?(Z=s.jsx(Me,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:le,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:xe})}),e[13]=le,e[14]=Z):Z=e[14];let $e;e[15]===Symbol.for("react.memo_cache_sentinel")?($e=s.jsx(Re,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[15]=$e):$e=e[15];let me;e[16]!==Z?(me=s.jsx(ys,{delayDuration:300,children:s.jsxs(Ee,{children:[Z,$e]})}),e[16]=Z,e[17]=me):me=e[17];let be;e[18]!==me||e[19]!==W||e[20]!==oe?(be=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-4 border-b border-border",children:[W,oe,me]}),e[18]=me,e[19]=W,e[20]=oe,e[21]=be):be=e[21];const je=String(p);let Ae;e[22]!==m||e[23]!==u||e[24]!==d||e[25]!==je?(Ae=s.jsx("div",{className:"border-b border-border pb-2",children:s.jsx(Os,{orgParam:d,onSelectOrg:u,onCreateOrg:m},je)}),e[22]=m,e[23]=u,e[24]=d,e[25]=je,e[26]=Ae):Ae=e[26];let ve;if(e[27]!==f||e[28]!==o){let ae;e[30]!==f?(ae=ze=>s.jsx(Pt,{item:ze,onClose:f},ze.key),e[30]=f,e[31]=ae):ae=e[31],ve=o.map(ae),e[27]=f,e[28]=o,e[29]=ve}else ve=e[29];let Le;e[32]!==f||e[33]!==i?(Le=s.jsx(Pt,{item:i,onClose:f}),e[32]=f,e[33]=i,e[34]=Le):Le=e[34];let _e;e[35]!==ve||e[36]!==Le?(_e=s.jsxs("nav",{className:"flex flex-col px-2 pt-2 pb-2 gap-0.5",children:[ve,Le]}),e[35]=ve,e[36]=Le,e[37]=_e):_e=e[37];let ye;e[38]!==Ae||e[39]!==_e?(ye=s.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[Ae,_e]}),e[38]=Ae,e[39]=_e,e[40]=ye):ye=e[40];let He;if(e[41]!==a.theme||e[42]!==c||e[43]!==l){let ae;e[45]!==a.theme||e[46]!==c?(ae=ze=>{const{value:Ce,icon:gt,label:Xe}=ze;return s.jsx("button",{type:"button","aria-label":Xe,onClick:()=>c(bt=>({...bt,theme:Ce})),className:Q("size-8 rounded-md flex items-center justify-center transition-colors",a.theme===Ce?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:gt},Ce)},e[45]=a.theme,e[46]=c,e[47]=ae):ae=e[47],He=l.map(ae),e[41]=a.theme,e[42]=c,e[43]=l,e[44]=He}else He=e[44];let Be;e[48]!==He?(Be=s.jsx("div",{className:"flex items-center gap-0.5",children:He}),e[48]=He,e[49]=Be):Be=e[49];const xt=a.enableSounds?"Disable sounds":"Enable sounds";let Ue;e[50]!==c?(Ue=()=>c(dl),e[50]=c,e[51]=Ue):Ue=e[51];const Ye=a.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let de;e[52]!==Ye?(de=Q("size-8 rounded-md flex items-center justify-center transition-colors",Ye),e[52]=Ye,e[53]=de):de=e[53];let qe;e[54]!==a.enableSounds?(qe=a.enableSounds?s.jsx(Ss,{size:14}):s.jsx(_s,{size:14}),e[54]=a.enableSounds,e[55]=qe):qe=e[55];let We;e[56]!==xt||e[57]!==Ue||e[58]!==de||e[59]!==qe?(We=s.jsx("button",{type:"button","aria-label":xt,onClick:Ue,className:de,children:qe}),e[56]=xt,e[57]=Ue,e[58]=de,e[59]=qe,e[60]=We):We=e[60];let ht;e[61]===Symbol.for("react.memo_cache_sentinel")?(ht=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","3.89.2"]}),e[61]=ht):ht=e[61];let Ke;e[62]!==We?(Ke=s.jsxs("div",{className:"flex items-center gap-2",children:[We,ht]}),e[62]=We,e[63]=Ke):Ke=e[63];let Ne;e[64]!==Be||e[65]!==Ke?(Ne=s.jsxs("div",{className:"flex items-center justify-between px-3 py-3 border-t border-border/50",children:[Be,Ke]}),e[64]=Be,e[65]=Ke,e[66]=Ne):Ne=e[66];let Se;return e[67]!==be||e[68]!==ye||e[69]!==Ne?(Se=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[be,ye,Ne]}),e[67]=be,e[68]=ye,e[69]=Ne,e[70]=Se):Se=e[70],Se}const x=n?.name??"U";let g;e[71]!==x||e[72]!==r?(g=s.jsx(ss,{url:r,fallback:x,shape:"circle",size:"sm",className:"shrink-0"}),e[71]=x,e[72]=r,e[73]=g):g=e[73];const b=n?.name??"User";let j;e[74]!==b?(j=s.jsx("p",{className:"text-sm font-medium truncate",children:b}),e[74]=b,e[75]=j):j=e[75];const y=n?.email;let v;e[76]!==y?(v=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:y}),e[76]=y,e[77]=v):v=e[77];let _;e[78]!==j||e[79]!==v?(_=s.jsxs("div",{className:"flex-1 min-w-0",children:[j,v]}),e[78]=j,e[79]=v,e[80]=_):_=e[80];let w;e[81]!==n?(w=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(cl)},e[81]=n,e[82]=w):w=e[82];let S;e[83]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(ws,{size:14}),e[83]=S):S=e[83];let I;e[84]!==w?(I=s.jsx(Me,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:w,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:S})}),e[84]=w,e[85]=I):I=e[85];let T;e[86]===Symbol.for("react.memo_cache_sentinel")?(T=s.jsx(Re,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[86]=T):T=e[86];let $;e[87]!==I?($=s.jsx(ys,{delayDuration:300,children:s.jsxs(Ee,{children:[I,T]})}),e[87]=I,e[88]=$):$=e[88];let O;e[89]!==$||e[90]!==g||e[91]!==_?(O=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 mx-1 mt-1",children:[g,_,$]}),e[89]=$,e[90]=g,e[91]=_,e[92]=O):O=e[92];let A;if(e[93]!==f||e[94]!==o){let X;e[96]!==f?(X=W=>s.jsx(Pt,{item:W,onClose:f},W.key),e[96]=f,e[97]=X):X=e[97],A=o.map(X),e[93]=f,e[94]=o,e[95]=A}else A=e[95];let C;e[98]!==f||e[99]!==i?(C=s.jsx(Pt,{item:i,onClose:f}),e[98]=f,e[99]=i,e[100]=C):C=e[100];let M;e[101]!==A||e[102]!==C?(M=s.jsxs("nav",{className:"flex-1 flex flex-col px-2 pt-1 overflow-y-auto",children:[A,C]}),e[101]=A,e[102]=C,e[103]=M):M=e[103];let K;if(e[104]!==a.theme||e[105]!==c||e[106]!==l){let X;e[108]!==a.theme||e[109]!==c?(X=W=>{const{value:re,icon:ie,label:ue}=W;return s.jsx("button",{type:"button","aria-label":ue,onClick:()=>c(ne=>({...ne,theme:re})),className:Q("size-7 rounded-md flex items-center justify-center transition-colors",a.theme===re?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:ie},re)},e[108]=a.theme,e[109]=c,e[110]=X):X=e[110],K=l.map(X),e[104]=a.theme,e[105]=c,e[106]=l,e[107]=K}else K=e[107];let U;e[111]!==K?(U=s.jsx("div",{className:"flex items-center gap-0.5",children:K}),e[111]=K,e[112]=U):U=e[112];const E=a.enableSounds?"Disable sounds":"Enable sounds";let L;e[113]!==c?(L=()=>c(al),e[113]=c,e[114]=L):L=e[114];const R=a.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let H;e[115]!==R?(H=Q("size-7 rounded-md flex items-center justify-center transition-colors",R),e[115]=R,e[116]=H):H=e[116];let P;e[117]!==a.enableSounds?(P=a.enableSounds?s.jsx(Ss,{size:14}):s.jsx(_s,{size:14}),e[117]=a.enableSounds,e[118]=P):P=e[118];let G;e[119]!==E||e[120]!==L||e[121]!==H||e[122]!==P?(G=s.jsx("button",{type:"button","aria-label":E,onClick:L,className:H,children:P}),e[119]=E,e[120]=L,e[121]=H,e[122]=P,e[123]=G):G=e[123];let D;e[124]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","3.89.2"]}),e[124]=D):D=e[124];let B;e[125]!==G?(B=s.jsxs("div",{className:"flex items-center gap-2",children:[G,D]}),e[125]=G,e[126]=B):B=e[126];let F;e[127]!==U||e[128]!==B?(F=s.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5 border-t border-border/50",children:[U,B]}),e[127]=U,e[128]=B,e[129]=F):F=e[129];let Y;e[130]!==O||e[131]!==M||e[132]!==F?(Y=s.jsxs("div",{className:"w-60 shrink-0 flex flex-col border-r border-border bg-sidebar/75",children:[O,M,F]}),e[130]=O,e[131]=M,e[132]=F,e[133]=Y):Y=e[133];const ee=String(p);let V;e[134]!==m||e[135]!==u||e[136]!==d||e[137]!==ee?(V=s.jsx("div",{className:"flex-1 flex flex-col min-w-0 min-h-0 overflow-hidden",children:s.jsx(Os,{orgParam:d,onSelectOrg:u,onCreateOrg:m},ee)}),e[134]=m,e[135]=u,e[136]=d,e[137]=ee,e[138]=V):V=e[138];let J;return e[139]!==Y||e[140]!==V?(J=s.jsxs("div",{className:"flex min-h-[380px] w-full overflow-hidden",children:[Y,V]}),e[139]=Y,e[140]=V,e[141]=J):J=e[141],J}function al(t){return{...t,enableSounds:!t.enableSounds}}function cl(){Oe.success("User ID copied")}function dl(t){return{...t,enableSounds:!t.enableSounds}}function ul(){Oe.success("User ID copied")}function os(){const t=N.c(44),{data:e}=Ie.useSession(),{org:n}=pe(),r=Ge();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org",shouldThrow:!1},t[0]=o):o=t[0];const l=lr(o)?.params.org,[a,c]=ar(),d=ds(),[u,m]=z.useState(!1),[f,h]=z.useState(!1),p=e?.user,x=p?.image;let g;t[1]!==r?(g=Y=>{m(!1),r({to:"/$org",params:{org:Y}})},t[1]=r,t[2]=g):g=t[2];const b=g;let j;t[3]===Symbol.for("react.memo_cache_sentinel")?(j=()=>m(!1),t[3]=j):j=t[3];const y=j;let v;t[4]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(yt,{size:16}),t[4]=v):v=t[4];let _;t[5]!==r||t[6]!==l?(_={key:"preferences",label:"Preferences",icon:v,onClick:()=>{r({to:"/$org/settings/profile",params:{org:l??""}})}},t[5]=r,t[6]=l,t[7]=_):_=t[7];let w;t[8]!==n||t[9]!==r?(w=n?[{key:"install-app",label:"Add to Home Screen",icon:s.jsx(Ho,{size:16}),onClick:()=>{r({to:"/$org/install",params:{org:n.slug}})}}]:[],t[8]=n,t[9]=r,t[10]=w):w=t[10];let S;t[11]===Symbol.for("react.memo_cache_sentinel")?(S={key:"terms",label:"Terms of Use",icon:s.jsx(Mr,{size:16}),href:"https://www.decocms.com/terms-of-use",external:!0},t[11]=S):S=t[11];let I;t[12]===Symbol.for("react.memo_cache_sentinel")?(I={key:"privacy",label:"Privacy Policy",icon:s.jsx(Yo,{size:16}),href:"https://www.decocms.com/privacy-policy",external:!0},t[12]=I):I=t[12];let T;t[13]===Symbol.for("react.memo_cache_sentinel")?(T={key:"github",label:"decocms/studio",icon:s.jsx(cr,{className:"w-4 h-4"}),href:"https://github.com/decocms/studio",external:!0},t[13]=T):T=t[13];let $;t[14]===Symbol.for("react.memo_cache_sentinel")?($={key:"community",label:"Community",icon:s.jsx(Xo,{size:16}),href:"https://decocms.com/discord",external:!0},t[14]=$):$=t[14];let O;t[15]===Symbol.for("react.memo_cache_sentinel")?(O={key:"homepage",label:"Homepage",icon:s.jsx(Bo,{size:16}),href:"https://decocms.com",external:!0},t[15]=O):O=t[15];let A;t[16]!==_||t[17]!==w?(A=[_,...w,S,I,T,$,O],t[16]=_,t[17]=w,t[18]=A):A=t[18];const C=A;let M;t[19]===Symbol.for("react.memo_cache_sentinel")?(M={key:"logout",label:"Sign out",icon:s.jsx(Uo,{size:16}),onClick:fl},t[19]=M):M=t[19];const K=M;let U;t[20]===Symbol.for("react.memo_cache_sentinel")?(U={value:"light",icon:s.jsx(qo,{size:14}),label:"Light theme"},t[20]=U):U=t[20];let E;t[21]===Symbol.for("react.memo_cache_sentinel")?(E={value:"dark",icon:s.jsx(Wo,{size:14}),label:"Dark theme"},t[21]=E):E=t[21];let L;t[22]===Symbol.for("react.memo_cache_sentinel")?(L=[U,E,{value:"system",icon:s.jsx(mn,{size:14}),label:"System theme"}],t[22]=L):L=t[22];const R=L;let H;t[23]===Symbol.for("react.memo_cache_sentinel")?(H=()=>{m(!1),h(!0)},t[23]=H):H=t[23];let P;t[24]!==b||t[25]!==d||t[26]!==C||t[27]!==u||t[28]!==l||t[29]!==a||t[30]!==c||t[31]!==p||t[32]!==x?(P={user:p,userImage:x,menuItems:C,signOutItem:K,themeOptions:R,preferences:a,setPreferences:c,orgParam:l,onSelectOrg:b,onCreateOrg:H,close:y,isMobile:d,open:u},t[24]=b,t[25]=d,t[26]=C,t[27]=u,t[28]=l,t[29]=a,t[30]=c,t[31]=p,t[32]=x,t[33]=P):P=t[33];const G=P;let D;t[34]!==n||t[35]!==d||t[36]!==u||t[37]!==G?(D=d?s.jsxs(Qs,{open:u,onOpenChange:m,direction:"bottom",children:[s.jsxs("button",{type:"button",onClick:()=>m(!0),className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-lg transition-colors text-sm text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground",children:[s.jsx("div",{className:"shrink-0 size-5 rounded-md flex items-center justify-center border border-border/50 overflow-hidden",style:n?.logo?void 0:rs(n?.name??""),children:n?.logo?s.jsx("img",{src:n.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:"font-semibold leading-none text-[8px]",children:(n?.name??"?").slice(0,2).toUpperCase()})}),s.jsx("span",{className:"truncate",children:n?.name??"Account"})]}),s.jsxs(Js,{className:"h-[80dvh] p-0",children:[s.jsx(Zs,{className:"sr-only",children:"Account"}),s.jsx(Ps,{...G})]})]}):s.jsxs(Bt,{open:u,onOpenChange:m,children:[s.jsx(pt,{asChild:!0,children:s.jsxs(Te,{tooltip:n?.name??"Account",className:"rounded-md",children:[s.jsx("div",{className:"shrink-0 size-6 rounded-md flex items-center justify-center border border-border/50 overflow-hidden",style:n?.logo?void 0:rs(n?.name??""),children:n?.logo?s.jsx("img",{src:n.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:"font-semibold leading-none text-[9px]",children:(n?.name??"?").slice(0,2).toUpperCase()})}),s.jsx("span",{className:"truncate",children:n?.name??"Account"})]})}),s.jsx(Ut,{side:"right",align:"end",sideOffset:18,collisionPadding:16,className:"w-[520px] p-0 flex max-h-[520px]",onCloseAutoFocus:ml,children:s.jsx(Ps,{...G})})]}),t[34]=n,t[35]=d,t[36]=u,t[37]=G,t[38]=D):D=t[38];let B;t[39]!==f?(B=s.jsx(nl,{open:f,onOpenChange:h}),t[39]=f,t[40]=B):B=t[40];let F;return t[41]!==D||t[42]!==B?(F=s.jsxs(s.Fragment,{children:[D,B]}),t[41]=D,t[42]=B,t[43]=F):F=t[43],F}function ml(t){return t.preventDefault()}function fl(){te("signed_out",{source:"account_popover"}),dr(),Ie.signOut()}function pl({invitation:t}){const[e,n]=z.useState(!1),[r,o]=z.useState(!1),i=mr(),l=async()=>{n(!0);try{const d=await Ie.organization.acceptInvitation({invitationId:t.id});if(d.error){Oe.error(d.error.message),n(!1);return}}catch{Oe.error("Failed to accept invitation"),n(!1);return}Oe.success("Invitation accepted!"),fr();let c;try{c=(await Ie.organization.getFullOrganization({query:{organizationId:t.organizationId}}))?.data?.slug}catch{}window.location.href=c?`/${c}`:"/"},a=async()=>{o(!0);try{const c=await Ie.organization.rejectInvitation({invitationId:t.id});c.error?(Oe.error(c.error.message),o(!1)):(Oe.success("Invitation declined"),i.invalidateQueries())}catch{Oe.error("Failed to decline invitation"),o(!1)}};return s.jsxs("div",{className:"flex items-center gap-3 px-5 py-4 border-b border-border last:border-0 hover:bg-muted/25 transition-colors",children:[s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-xs text-muted-foreground",children:"You've been invited to join"}),s.jsx("p",{className:"text-sm font-medium truncate",children:t.organizationName??"Unknown organization"})]}),s.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[s.jsx(ft,{size:"icon",variant:"ghost",className:"size-7 text-green-600 hover:text-green-700 hover:bg-green-50 dark:hover:bg-green-950",onClick:l,disabled:e||r,"aria-label":"Accept invitation",children:s.jsx(us,{size:14})}),s.jsx(ft,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground hover:text-destructive hover:bg-destructive/10",onClick:a,disabled:e||r,"aria-label":"Decline invitation",children:s.jsx(ms,{size:14})})]})]})}function xl(t){const e=N.c(29),{request:n}=t,{approve:r,deny:o}=pi(),i=r.isPending||o.isPending,l=n.user?.name??n.user?.email??n.userId,a=n.user?.image??void 0;let c;e[0]!==l?(c=l.charAt(0).toUpperCase(),e[0]=l,e[1]=c):c=e[1];let d;e[2]!==a||e[3]!==c?(d=s.jsx(ss,{url:a,fallback:c,shape:"circle",size:"sm"}),e[2]=a,e[3]=c,e[4]=d):d=e[4];let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx("p",{className:"text-xs text-muted-foreground",children:"Requested to join"}),e[5]=u):u=e[5];let m;e[6]!==l?(m=s.jsxs("div",{className:"flex-1 min-w-0",children:[u,s.jsx("p",{className:"text-sm font-medium truncate",children:l})]}),e[6]=l,e[7]=m):m=e[7];let f;e[8]!==r||e[9]!==n.id?(f=()=>r.mutate(n.id),e[8]=r,e[9]=n.id,e[10]=f):f=e[10];let h;e[11]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(us,{size:14}),e[11]=h):h=e[11];let p;e[12]!==i||e[13]!==f?(p=s.jsx(ft,{size:"icon",variant:"ghost",className:"size-7 text-green-600 hover:text-green-700 hover:bg-green-50 dark:hover:bg-green-950",onClick:f,disabled:i,"aria-label":"Approve join request",children:h}),e[12]=i,e[13]=f,e[14]=p):p=e[14];let x;e[15]!==o||e[16]!==n.id?(x=()=>o.mutate(n.id),e[15]=o,e[16]=n.id,e[17]=x):x=e[17];let g;e[18]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(ms,{size:14}),e[18]=g):g=e[18];let b;e[19]!==i||e[20]!==x?(b=s.jsx(ft,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground hover:text-destructive hover:bg-destructive/10",onClick:x,disabled:i,"aria-label":"Deny join request",children:g}),e[19]=i,e[20]=x,e[21]=b):b=e[21];let j;e[22]!==b||e[23]!==p?(j=s.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[p,b]}),e[22]=b,e[23]=p,e[24]=j):j=e[24];let y;return e[25]!==j||e[26]!==d||e[27]!==m?(y=s.jsxs("div",{className:"flex items-center gap-3 px-5 py-4 border-b border-border last:border-0 hover:bg-muted/25 transition-colors",children:[d,m,j]}),e[25]=j,e[26]=d,e[27]=m,e[28]=y):y=e[28],y}function hl(t){const e=N.c(14),{release:n,isSeen:r,onSelect:o}=t;let i;e[0]!==r?(i=!r&&s.jsx("span",{"aria-label":"New release",className:"absolute left-2 top-1/2 -translate-y-1/2 size-1.5 rounded-full bg-primary"}),e[0]=r,e[1]=i):i=e[1];let l;e[2]!==n.eyebrow?(l=n.eyebrow&&s.jsx("p",{className:"text-xs text-muted-foreground",children:n.eyebrow}),e[2]=n.eyebrow,e[3]=l):l=e[3];let a;e[4]!==n.title?(a=s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:n.title}),e[4]=n.title,e[5]=a):a=e[5];let c;e[6]!==l||e[7]!==a?(c=s.jsxs("div",{className:"flex-1 min-w-0",children:[l,a]}),e[6]=l,e[7]=a,e[8]=c):c=e[8];let d;e[9]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(ps,{size:16,className:"text-muted-foreground shrink-0"}),e[9]=d):d=e[9];let u;return e[10]!==o||e[11]!==i||e[12]!==c?(u=s.jsxs("button",{type:"button",onClick:o,className:"relative w-full flex items-center gap-3 px-5 py-4 border-b border-border last:border-0 hover:bg-muted/25 transition-colors text-left",children:[i,c,d]}),e[10]=o,e[11]=i,e[12]=c,e[13]=u):u=e[13],u}function gl(){const t=z.useContext(pr),{data:e}=t.hooks.useListUserInvitations();return(e??[]).filter(r=>r.status==="pending"&&new Date(r.expiresAt)>new Date)}function kn(){const t=N.c(11),{isSeen:e,markSeen:n,unseenCount:r}=so(),o=gl(),i=xi();let l;if(t[0]!==e||t[1]!==o||t[2]!==i){const d=[...i].sort(Sl).map(yl),u=[...o].sort(vl).map(jl);let m;t[4]!==e?(m=h=>({type:"release",release:h,isSeen:e(h.id)}),t[4]=e,t[5]=m):m=t[5];const f=[...no].sort(bl).map(m);l=[...d,...u,...f],t[0]=e,t[1]=o,t[2]=i,t[3]=l}else l=t[3];const a=r+o.length+i.length;let c;return t[6]!==n||t[7]!==o||t[8]!==l||t[9]!==a?(c={items:l,pendingInvitations:o,redDotCount:a,markReleaseSeen:n},t[6]=n,t[7]=o,t[8]=l,t[9]=a,t[10]=c):c=t[10],c}function bl(t,e){return new Date(e.date).getTime()-new Date(t.date).getTime()}function jl(t){return{type:"invitation",invitation:t}}function vl(t,e){return new Date(t.expiresAt).getTime()-new Date(e.expiresAt).getTime()}function yl(t){return{type:"join-request",request:t}}function Sl(t,e){return new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime()}class In extends z.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,n){}render(){return this.state.hasError?null:this.props.children}}function Tn(t){return t<=1?"text-destructive":t<=5?"text-amber-500 dark:text-amber-400":"text-foreground/70"}function _l(){const t=N.c(17),e=Ge(),{org:n}=pe(),{hasDecoKey:r,balanceDollars:o}=dn();if(!r)return null;let i;t[0]!==o?(i=o!=null?`Credits: $${o.toFixed(2)}`:"Credits",t[0]=o,t[1]=i):i=t[1];let l;t[2]!==o?(l=Q(o!=null&&Tn(o)),t[2]=o,t[3]=l):l=t[3];let a;t[4]!==e||t[5]!==n.slug?(a=()=>e({to:"/$org/settings/ai-providers",params:{org:n.slug}}),t[4]=e,t[5]=n.slug,t[6]=a):a=t[6];let c;t[7]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(sn,{}),t[7]=c):c=t[7];let d;t[8]!==o?(d=o!=null?`$${o.toFixed(2)}`:"Credits",t[8]=o,t[9]=d):d=t[9];let u;t[10]!==d?(u=s.jsx("span",{children:d}),t[10]=d,t[11]=u):u=t[11];let m;return t[12]!==i||t[13]!==l||t[14]!==a||t[15]!==u?(m=s.jsx(De,{children:s.jsx(he,{children:s.jsxs(Te,{tooltip:i,className:l,onClick:a,children:[c,u]})})}),t[12]=i,t[13]=l,t[14]=a,t[15]=u,t[16]=m):m=t[16],m}function Nl(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(In,{children:s.jsx(z.Suspense,{fallback:null,children:s.jsx(_l,{})})}),t[0]=e):e=t[0],e}function Cl(){const t=N.c(17),e=Ge(),{org:n}=pe(),{hasDecoKey:r,balanceDollars:o}=dn();if(!r)return null;let i;t[0]!==o?(i=o!=null?`Credits: $${o.toFixed(2)}`:"Credits",t[0]=o,t[1]=i):i=t[1];const l=i;let a;t[2]!==e||t[3]!==n.slug?(a=()=>e({to:"/$org/settings/ai-providers",params:{org:n.slug}}),t[2]=e,t[3]=n.slug,t[4]=a):a=t[4];let c;t[5]!==o?(c=Q(o!=null&&Tn(o)),t[5]=o,t[6]=c):c=t[6];let d;t[7]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(sn,{className:"size-4"}),t[7]=d):d=t[7];let u;t[8]!==a||t[9]!==c||t[10]!==l?(u=s.jsx(Me,{asChild:!0,children:s.jsx(ge,{"aria-label":l,onClick:a,className:c,children:d})}),t[8]=a,t[9]=c,t[10]=l,t[11]=u):u=t[11];let m;t[12]!==l?(m=s.jsx(Re,{side:"top",children:l}),t[12]=l,t[13]=m):m=t[13];let f;return t[14]!==u||t[15]!==m?(f=s.jsxs(Ee,{delayDuration:300,children:[u,m]}),t[14]=u,t[15]=m,t[16]=f):f=t[16],f}function wl(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(In,{children:s.jsx(z.Suspense,{fallback:null,children:s.jsx(Cl,{})})}),t[0]=e):e=t[0],e}function $n(t){const e=N.c(15),{children:n}=t,{items:r,markReleaseSeen:o}=kn(),[i,l]=z.useState(null);let a;if(e[0]!==r||e[1]!==i){let x;e[3]!==i?(x=g=>g.type==="release"&&g.release.id===i,e[3]=i,e[4]=x):x=e[4],a=r.find(x),e[0]=r,e[1]=i,e[2]=a}else a=e[2];const c=a,d=c?.type==="release"?c.release:null;let u;e[5]!==o?(u=x=>{l(x),o(x)},e[5]=o,e[6]=u):u=e[6];const m=u;let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=x=>{x||l(null)},e[7]=f):f=e[7];let h;e[8]!==m||e[9]!==r||e[10]!==d?(h=s.jsx(Ut,{side:"right",align:"start",sideOffset:16,collisionPadding:16,className:"w-[min(400px,calc(100vw-2rem))] p-0 h-[min(650px,calc(100dvh-4rem))] flex flex-col",children:d?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center gap-2 px-3 py-3 border-b border-border shrink-0",children:[s.jsx(ft,{size:"icon",variant:"ghost","aria-label":"Back to inbox",className:"size-7 text-muted-foreground",onClick:()=>l(null),children:s.jsx(Ko,{size:16})}),s.jsx("h3",{className:"text-sm font-medium truncate",children:d.title})]}),s.jsx("div",{className:"overflow-y-auto flex-1 p-5",children:s.jsx(ro,{release:d})})]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"px-4 py-3 border-b border-border shrink-0",children:s.jsx("h3",{className:"text-sm font-medium",children:"Inbox"})}),r.length===0?s.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 px-6 text-center",children:[s.jsx(fs,{size:24,className:"text-muted-foreground/50"}),s.jsx("p",{className:"text-sm font-medium text-foreground",children:"Nothing here yet"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Invitations, join requests, and release updates will appear here"})]}):s.jsx("div",{className:"overflow-y-auto flex-1",children:r.map(x=>x.type==="join-request"?s.jsx(xl,{request:x.request},`req-${x.request.id}`):x.type==="invitation"?s.jsx(pl,{invitation:x.invitation},`inv-${x.invitation.id}`):s.jsx(hl,{release:x.release,isSeen:x.isSeen,onSelect:()=>m(x.release.id)},`rel-${x.release.id}`))})]})}),e[8]=m,e[9]=r,e[10]=d,e[11]=h):h=e[11];let p;return e[12]!==n||e[13]!==h?(p=s.jsxs(Bt,{onOpenChange:f,children:[n,h]}),e[12]=n,e[13]=h,e[14]=p):p=e[14],p}function An(){const{redDotCount:t}=kn();return t>0}function kl(){const t=N.c(6),e=An();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(fs,{}),t[0]=n):n=t[0];let r;t[1]!==e?(r=e&&s.jsx("span",{className:"absolute top-1 right-1 size-2 rounded-full bg-red-500 pointer-events-none"}),t[1]=e,t[2]=r):r=t[2];let o;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("span",{children:"Inbox"}),t[3]=o):o=t[3];let i;return t[4]!==r?(i=s.jsx($n,{children:s.jsx(pt,{asChild:!0,children:s.jsxs(Te,{tooltip:"Inbox",className:"relative",children:[n,r,o]})})}),t[4]=r,t[5]=i):i=t[5],i}function Il(){const t=N.c(8),e=An();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(fs,{className:"size-4"}),t[0]=n):n=t[0];let r;t[1]!==e?(r=e&&s.jsx("span",{className:"absolute top-0.5 right-0.5 size-2 rounded-full bg-red-500 pointer-events-none"}),t[1]=e,t[2]=r):r=t[2];let o;t[3]!==r?(o=s.jsx(pt,{asChild:!0,children:s.jsx(Me,{asChild:!0,children:s.jsxs(ge,{"aria-label":"Inbox",children:[n,r]})})}),t[3]=r,t[4]=o):o=t[4];let i;t[5]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Re,{side:"top",children:"Inbox"}),t[5]=i):i=t[5];let l;return t[6]!==o?(l=s.jsx($n,{children:s.jsxs(Ee,{delayDuration:300,children:[o,i]})}),t[6]=o,t[7]=l):l=t[7],l}function Tl(){const t=N.c(3),[e,n]=z.useState(!1);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs(Te,{tooltip:"Connections",onClick:()=>{te("connections_dialog_opened",{source:"sidebar_footer",mode:"browse"}),n(!0)},children:[s.jsx(fn,{}),s.jsx("span",{children:"Connections"})]}),t[0]=r):r=t[0];let o;return t[1]!==e?(o=s.jsxs(s.Fragment,{children:[r,s.jsx(un,{mode:"browse",open:e,onOpenChange:n,defaultTab:"all"})]}),t[1]=e,t[2]=o):o=t[2],o}function $l(){const t=N.c(3),[e,n]=z.useState(!1);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs(Ee,{delayDuration:300,children:[s.jsx(Me,{asChild:!0,children:s.jsx(ge,{"aria-label":"Connections",onClick:()=>{te("connections_dialog_opened",{source:"sidebar_footer",mode:"browse"}),n(!0)},children:s.jsx(fn,{className:"size-4"})})}),s.jsx(Re,{side:"top",children:"Connections"})]}),t[0]=r):r=t[0];let o;return t[1]!==e?(o=s.jsxs(s.Fragment,{children:[r,s.jsx(un,{mode:"browse",open:e,onOpenChange:n,defaultTab:"all"})]}),t[1]=e,t[2]=o):o=t[2],o}function Al(){const t=N.c(7),e=Ge(),{org:n}=pe();let r;t[0]!==e||t[1]!==n.slug?(r=()=>e({to:"/$org/settings",params:{org:n.slug}}),t[0]=e,t[1]=n.slug,t[2]=r):r=t[2];let o,i;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(yt,{}),i=s.jsx("span",{children:"Settings"}),t[3]=o,t[4]=i):(o=t[3],i=t[4]);let l;return t[5]!==r?(l=s.jsxs(Te,{tooltip:"Settings",onClick:r,children:[o,i]}),t[5]=r,t[6]=l):l=t[6],l}function zl(){const t=N.c(9),e=Ge(),{org:n}=pe();let r;t[0]!==e||t[1]!==n.slug?(r=()=>e({to:"/$org/settings",params:{org:n.slug}}),t[0]=e,t[1]=n.slug,t[2]=r):r=t[2];let o;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(yt,{className:"size-4"}),t[3]=o):o=t[3];let i;t[4]!==r?(i=s.jsx(Me,{asChild:!0,children:s.jsx(ge,{"aria-label":"Settings",onClick:r,children:o})}),t[4]=r,t[5]=i):i=t[5];let l;t[6]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Re,{side:"top",children:"Settings"}),t[6]=l):l=t[6];let a;return t[7]!==i?(a=s.jsxs(Ee,{delayDuration:300,children:[i,l]}),t[7]=i,t[8]=a):a=t[8],a}function Ol(){const t=N.c(6),{state:e}=Ve();if(e==="collapsed"){let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Nl,{}),t[0]=o):o=t[0];let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(he,{children:s.jsx(Tl,{})}),t[1]=i):i=t[1];let l;t[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(he,{children:s.jsx(kl,{})}),t[2]=l):l=t[2];let a;t[3]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(he,{children:s.jsx(Al,{})}),t[3]=a):a=t[3];let c;return t[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsxs(ts,{className:"px-2 pb-3 gap-1",children:[o,s.jsxs(De,{children:[i,l,a,s.jsx(he,{children:s.jsx(os,{})})]})]}),t[4]=c):c=t[4],c}let r;return t[5]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(ts,{className:"px-2 pb-3",children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(De,{children:s.jsx(he,{children:s.jsx(os,{})})})}),s.jsx(zl,{}),s.jsx(Il,{}),s.jsx($l,{}),s.jsx(wl,{})]})}),t[5]=r):r=t[5],r}function Pl(){const t=N.c(8),e=Ge(),{org:n}=pe(),{setOpenMobile:r}=Ve();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(De,{children:s.jsx(he,{children:s.jsx(os,{})})})}),t[0]=o):o=t[0];let i;t[1]!==e||t[2]!==n.slug||t[3]!==r?(i=()=>{e({to:"/$org/settings",params:{org:n.slug}}),r(!1)},t[1]=e,t[2]=n.slug,t[3]=r,t[4]=i):i=t[4];let l;t[5]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(yt,{className:"size-4"}),t[5]=l):l=t[5];let a;return t[6]!==i?(a=s.jsx(ts,{className:"px-2 pb-3",children:s.jsxs("div",{className:"flex items-center gap-1",children:[o,s.jsx(ge,{"aria-label":"Settings",onClick:i,children:l})]})}),t[6]=i,t[7]=a):a=t[7],a}function Dl(t){const e=N.c(8),{virtualMcpId:n,size:r,showAutomationBadge:o}=t,i=r===void 0?"sm":r;let l;e[0]!==i||e[1]!==n?(l=n?s.jsx(Ml,{virtualMcpId:n,size:i}):s.jsx(Fe,{icon:null,name:"?",size:i}),e[0]=i,e[1]=n,e[2]=l):l=e[2];let a;e[3]!==o?(a=o&&s.jsx("span",{"aria-label":"Automation-triggered",className:"absolute -bottom-0.5 -right-0.5 flex size-4 items-center justify-center rounded-full bg-blue-500 border border-blue-600 text-white",children:s.jsx(hn,{size:10,className:"text-white"})}),e[3]=o,e[4]=a):a=e[4];let c;return e[5]!==l||e[6]!==a?(c=s.jsxs("div",{className:"relative shrink-0",children:[l,a]}),e[5]=l,e[6]=a,e[7]=c):c=e[7],c}function Ml(t){const e=N.c(6),{virtualMcpId:n,size:r}=t,o=vt(n);if(!o){let a;return e[0]!==r?(a=s.jsx(Fe,{icon:null,name:"?",size:r}),e[0]=r,e[1]=a):a=e[1],a}const i=o.icon??null;let l;return e[2]!==o.title||e[3]!==r||e[4]!==i?(l=s.jsx(Fe,{icon:i,name:o.title,size:r}),e[2]=o.title,e[3]=r,e[4]=i,e[5]=l):l=e[5],l}function Rl(t){const e=N.c(36),{open:n,onOpenChange:r}=t,[o,i]=z.useState(""),{org:l}=pe(),{setTaskId:a}=on(),c=xn();let d,u,m;e[0]!==l.id||e[1]!==o?(m=o.trim(),u=cs,d=as.globalSearch(l.id,m),e[0]=l.id,e[1]=o,e[2]=d,e[3]=u,e[4]=m):(d=e[2],u=e[3],m=e[4]);const f=n&&m.length>0;let h;e[5]!==c||e[6]!==m?(h=async()=>await c.call("GLOBAL_SEARCH",{query:m,limit:20}),e[5]=c,e[6]=m,e[7]=h):h=e[7];let p;e[8]!==d||e[9]!==f||e[10]!==h?(p={queryKey:d,enabled:f,queryFn:h,staleTime:1e4},e[8]=d,e[9]=f,e[10]=h,e[11]=p):p=e[11];const{data:x,isFetching:g}=u(p);let b;e[12]!==x?.items?(b=x?.items??[],e[12]=x?.items,e[13]=b):b=e[13];const j=b;let y;e[14]!==r?(y=C=>{C||i(""),r(C)},e[14]=r,e[15]=y):y=e[15];const v=y;let _;e[16]!==v||e[17]!==a?(_=C=>{v(!1),a(C.id,C.virtual_mcp_id??void 0)},e[16]=v,e[17]=a,e[18]=_):_=e[18];const w=_;let S;e[19]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsxs(bi,{className:"sr-only",children:[s.jsx(ji,{children:"Search"}),s.jsx(vi,{children:"Search across your organization's resources."})]}),e[19]=S):S=e[19];let I;e[20]!==o?(I=s.jsx(Ci,{value:o,onValueChange:i,placeholder:"Search..."}),e[20]=o,e[21]=I):I=e[21];let T;e[22]!==w||e[23]!==g||e[24]!==j||e[25]!==m?(T=m?g&&j.length===0?s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Searching…"}):j.length===0?s.jsx(_i,{children:"No results."}):j.map(C=>C.type==="thread"?s.jsxs(Ni,{value:`thread:${C.id}:${C.title}`,onSelect:()=>w(C),className:"gap-2.5",children:[s.jsx(Dl,{virtualMcpId:C.virtual_mcp_id,size:"xs"}),s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("div",{className:"text-sm text-foreground truncate",children:C.title||"Untitled thread"})}),s.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:new Date(C.updated_at).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]},`thread:${C.id}`):null):s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Start typing to search."}),e[22]=w,e[23]=g,e[24]=j,e[25]=m,e[26]=T):T=e[26];let $;e[27]!==T?($=s.jsx(wi,{children:T}),e[27]=T,e[28]=$):$=e[28];let O;e[29]!==I||e[30]!==$?(O=s.jsxs(yi,{className:"overflow-hidden p-0",closeButtonClassName:"hidden",children:[S,s.jsxs(ki,{shouldFilter:!1,className:"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:[I,$]})]}),e[29]=I,e[30]=$,e[31]=O):O=e[31];let A;return e[32]!==v||e[33]!==n||e[34]!==O?(A=s.jsx(Si,{open:n,onOpenChange:v,children:O}),e[32]=v,e[33]=n,e[34]=O,e[35]=A):A=e[35],A}function El(t){return t==="owner"||t==="admin"}function Fl(){const t=N.c(11),{locator:e}=pe(),n=Ii(),{data:r}=Ie.useSession(),o=r?.user?.id;let i;t[0]!==e?(i=as.members(e),t[0]=e,t[1]=i):i=t[1];let l;t[2]!==n?(l=()=>n.organization.listMembers(),t[2]=n,t[3]=l):l=t[3];const a=!!o;let c;t[4]!==i||t[5]!==l||t[6]!==a?(c={queryKey:i,queryFn:l,enabled:a,staleTime:6e4},t[4]=i,t[5]=l,t[6]=a,t[7]=c):c=t[7];const{data:d}=cs(c);let u;if(t[8]!==d?.data?.members||t[9]!==o){const f=(d?.data?.members??[]).find(h=>h.userId===o)?.role;u=El(f??void 0),t[8]=d?.data?.members,t[9]=o,t[10]=u}else u=t[10];return u}var Zt,qt="HoverCard",[zn]=gr(qt,[Ws]),Wt=Ws(),[Gl,Kt]=zn(qt),On=t=>{const{__scopeHoverCard:e,children:n,open:r,defaultOpen:o,onOpenChange:i,openDelay:l=700,closeDelay:a=300}=t,c=Wt(e),d=z.useRef(0),u=z.useRef(0),m=z.useRef(!1),f=z.useRef(!1),[h,p]=_r({prop:r,defaultProp:o??!1,onChange:i,caller:qt}),x=z.useCallback(()=>{clearTimeout(u.current),d.current=window.setTimeout(()=>p(!0),l)},[l,p]),g=z.useCallback(()=>{clearTimeout(d.current),!m.current&&!f.current&&(u.current=window.setTimeout(()=>p(!1),a))},[a,p]),b=z.useCallback(()=>p(!1),[p]);return z.useEffect(()=>()=>{clearTimeout(d.current),clearTimeout(u.current)},[]),s.jsx(Gl,{scope:e,open:h,onOpenChange:p,onOpen:x,onClose:g,onDismiss:b,hasSelectionRef:m,isPointerDownOnContentRef:f,children:s.jsx(Nr,{...c,children:n})})};On.displayName=qt;var Pn="HoverCardTrigger",Dn=z.forwardRef((t,e)=>{const{__scopeHoverCard:n,...r}=t,o=Kt(Pn,n),i=Wt(n);return s.jsx(xr,{asChild:!0,...i,children:s.jsx(hr.a,{"data-state":o.open?"open":"closed",...r,ref:e,onPointerEnter:Pe(t.onPointerEnter,Ft(o.onOpen)),onPointerLeave:Pe(t.onPointerLeave,Ft(o.onClose)),onFocus:Pe(t.onFocus,o.onOpen),onBlur:Pe(t.onBlur,o.onClose),onTouchStart:Pe(t.onTouchStart,l=>l.preventDefault())})})});Dn.displayName=Pn;var hs="HoverCardPortal",[Ll,Hl]=zn(hs,{forceMount:void 0}),Mn=t=>{const{__scopeHoverCard:e,forceMount:n,children:r,container:o}=t,i=Kt(hs,e);return s.jsx(Ll,{scope:e,forceMount:n,children:s.jsx(Ks,{present:n||i.open,children:s.jsx(Sr,{asChild:!0,container:o,children:r})})})};Mn.displayName=hs;var Et="HoverCardContent",Rn=z.forwardRef((t,e)=>{const n=Hl(Et,t.__scopeHoverCard),{forceMount:r=n.forceMount,...o}=t,i=Kt(Et,t.__scopeHoverCard);return s.jsx(Ks,{present:r||i.open,children:s.jsx(Bl,{"data-state":i.open?"open":"closed",...o,onPointerEnter:Pe(t.onPointerEnter,Ft(i.onOpen)),onPointerLeave:Pe(t.onPointerLeave,Ft(i.onClose)),ref:e})})});Rn.displayName=Et;var Bl=z.forwardRef((t,e)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:l,...a}=t,c=Kt(Et,n),d=Wt(n),u=z.useRef(null),m=br(e,u),[f,h]=z.useState(!1);return z.useEffect(()=>{if(f){const p=document.body;return Zt=p.style.userSelect||p.style.webkitUserSelect,p.style.userSelect="none",p.style.webkitUserSelect="none",()=>{p.style.userSelect=Zt,p.style.webkitUserSelect=Zt}}},[f]),z.useEffect(()=>{if(u.current){const p=()=>{h(!1),c.isPointerDownOnContentRef.current=!1,setTimeout(()=>{document.getSelection()?.toString()!==""&&(c.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",p),()=>{document.removeEventListener("pointerup",p),c.hasSelectionRef.current=!1,c.isPointerDownOnContentRef.current=!1}}},[c.isPointerDownOnContentRef,c.hasSelectionRef]),z.useEffect(()=>{u.current&&Wl(u.current).forEach(x=>x.setAttribute("tabindex","-1"))}),s.jsx(jr,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:l,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:Pe(i,p=>{p.preventDefault()}),onDismiss:c.onDismiss,children:s.jsx(vr,{...d,...a,onPointerDown:Pe(a.onPointerDown,p=>{p.currentTarget.contains(p.target)&&h(!0),c.hasSelectionRef.current=!1,c.isPointerDownOnContentRef.current=!0}),ref:m,style:{...a.style,userSelect:f?"text":void 0,WebkitUserSelect:f?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),Ul="HoverCardArrow",ql=z.forwardRef((t,e)=>{const{__scopeHoverCard:n,...r}=t,o=Wt(n);return s.jsx(yr,{...o,...r,ref:e})});ql.displayName=Ul;function Ft(t){return e=>e.pointerType==="touch"?void 0:t()}function Wl(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)e.push(n.currentNode);return e}var Kl=On,Vl=Dn,Yl=Mn,Xl=Rn;function Ql(t){const e=N.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=s.jsx(Kl,{"data-slot":"hover-card",...n}),e[2]=n,e[3]=r):r=e[3],r}function Jl(t){const e=N.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=s.jsx(Vl,{"data-slot":"hover-card-trigger",...n}),e[2]=n,e[3]=r):r=e[3],r}function Zl(t){const e=N.c(12);let n,r,o,i;e[0]!==t?({className:n,align:o,sideOffset:i,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=i):(n=e[1],r=e[2],o=e[3],i=e[4]);const l=o===void 0?"center":o,a=i===void 0?4:i;let c;e[5]!==n?(c=Q("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",n),e[5]=n,e[6]=c):c=e[6];let d;return e[7]!==l||e[8]!==r||e[9]!==a||e[10]!==c?(d=s.jsx(Yl,{"data-slot":"hover-card-portal",children:s.jsx(Xl,{"data-slot":"hover-card-content",align:l,sideOffset:a,className:c,...r})}),e[7]=l,e[8]=r,e[9]=a,e[10]=c,e[11]=d):d=e[11],d}function En(t){const e=N.c(26),{virtualMcpId:n,isOrgPinned:r,canManageOrgPin:o,onNewTaskInGroup:i,onShowSettings:l,onToggleOrgPin:a,onHideGroup:c}=t;let d;e[0]!==i||e[1]!==n?(d=()=>i(n),e[0]=i,e[1]=n,e[2]=d):d=e[2];let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(ke,{size:14,className:"mr-2"}),e[3]=u):u=e[3];let m;e[4]!==d?(m=s.jsxs(Ot,{onSelect:d,children:[u,"New task"]}),e[4]=d,e[5]=m):m=e[5];let f;e[6]!==l||e[7]!==n?(f=()=>l(n),e[6]=l,e[7]=n,e[8]=f):f=e[8];let h;e[9]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(yt,{size:14,className:"mr-2"}),e[9]=h):h=e[9];let p;e[10]!==f?(p=s.jsxs(Ot,{onSelect:f,children:[h,"Settings"]}),e[10]=f,e[11]=p):p=e[11];let x;e[12]!==o||e[13]!==r||e[14]!==a||e[15]!==n?(x=o&&s.jsxs(s.Fragment,{children:[s.jsx(As,{}),s.jsxs(Ot,{onSelect:()=>a(n,!r),children:[s.jsx(Kr,{size:14,className:"mr-2"}),r?"Unpin for all members":"Pin for all members"]})]}),e[12]=o,e[13]=r,e[14]=a,e[15]=n,e[16]=x):x=e[16];let g;e[17]!==r||e[18]!==c||e[19]!==n?(g=!r&&s.jsxs(s.Fragment,{children:[s.jsx(As,{}),s.jsxs(Ot,{onSelect:()=>c(n),children:[s.jsx(Vo,{size:14,className:"mr-2"}),"Hide"]})]}),e[17]=r,e[18]=c,e[19]=n,e[20]=g):g=e[20];let b;return e[21]!==m||e[22]!==p||e[23]!==x||e[24]!==g?(b=s.jsxs(s.Fragment,{children:[m,p,x,g]}),e[21]=m,e[22]=p,e[23]=x,e[24]=g,e[25]=b):b=e[25],b}function ea(t){return t==="ephemeral"||t.startsWith("thread:")}function Vt(t){const e=N.c(46),{task:n,isActive:r,onClick:o,onArchive:i,showAutomationBadge:l,showAgentIcon:a,hideStatusIdle:c,indented:d}=t,u=Ti(n.status),m=u.icon,f=n.metadata?.kind==="tool_call_run",h=vt(f?void 0:n.virtual_mcp_id);let p;e[0]!==h?(p=wo(h),e[0]=h,e[1]=p):p=e[1];const x=p;Ai(6e4);const g=l||!!n.trigger_id,b=n.id,j="button",y=0;let v;e[2]!==o?(v=B=>{B.target===B.currentTarget&&(B.key==="Enter"||B.key===" ")&&(B.preventDefault(),o())},e[2]=o,e[3]=v):v=e[3];const _=d?"-ml-4 pl-6":"pl-2",w=r?"bg-accent text-accent-foreground":"hover:bg-accent/60";let S;e[4]!==_||e[5]!==w?(S=Q("group/row flex items-center gap-2 py-1.5 pr-2 rounded-md cursor-pointer transition-colors",_,"focus-visible:outline-none focus-visible:inset-ring-2 focus-visible:inset-ring-ring/50",w),e[4]=_,e[5]=w,e[6]=S):S=e[6];let I;e[7]!==f||e[8]!==a||e[9]!==h?.icon||e[10]!==h?.title?(I=a&&!f&&s.jsx(Fe,{icon:h?.icon??null,name:h?.title??"?",size:"2xs"}),e[7]=f,e[8]=a,e[9]=h?.icon,e[10]=h?.title,e[11]=I):I=e[11];let T;e[12]!==g?(T=g&&s.jsx(hn,{size:12,"aria-label":"Automation-triggered",className:"shrink-0 text-blue-500"}),e[12]=g,e[13]=T):T=e[13];const $=n.title||"Untitled task";let O;e[14]!==$?(O=s.jsx("div",{className:"text-sm text-foreground truncate",children:$}),e[14]=$,e[15]=O):O=e[15];let A;e[16]!==T||e[17]!==O?(A=s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[T,O]}),e[16]=T,e[17]=O,e[18]=A):A=e[18];let C;e[19]!==x||e[20]!==r||e[21]!==n.branch||e[22]!==n.updated_at?(C=n.updated_at&&s.jsxs("div",{className:Q("flex items-center gap-1 text-[11px] min-w-0",r?"text-accent-foreground/70":"text-muted-foreground/60"),children:[n.branch&&!ea(n.branch)?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"truncate font-mono",children:n.branch}),s.jsx("span",{className:"shrink-0",children:"·"})]}):x?s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"truncate",children:[x.owner,"/",x.name]}),s.jsx("span",{className:"shrink-0",children:"·"})]}):null,s.jsx("span",{className:"shrink-0",children:zi(new Date(n.updated_at))})]}),e[19]=x,e[20]=r,e[21]=n.branch,e[22]=n.updated_at,e[23]=C):C=e[23];let M;e[24]!==A||e[25]!==C?(M=s.jsxs("div",{className:"flex-1 min-w-0",children:[A,C]}),e[24]=A,e[25]=C,e[26]=M):M=e[26];const K="shrink-0 grid [grid-template-areas:'slot'] items-center justify-items-center",U=!c&&s.jsx("span",{className:"[grid-area:slot] flex size-7 items-center justify-center pointer-events-none transition-opacity group-hover/row:opacity-0","aria-label":u.label,children:s.jsx(m,{size:14,className:Q(u.iconClassName,n.status==="in_progress"&&"animate-spin")})});let E;e[27]!==i?(E=B=>{B.stopPropagation(),i()},e[27]=i,e[28]=E):E=e[28];let L;e[29]===Symbol.for("react.memo_cache_sentinel")?(L=s.jsx(Cr,{size:14}),e[29]=L):L=e[29];let R;e[30]!==E?(R=s.jsx(Me,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":"Archive task",onClick:E,className:"[grid-area:slot] opacity-0 pointer-events-none group-hover/row:opacity-100 group-hover/row:pointer-events-auto focus-visible:opacity-100 focus-visible:pointer-events-auto transition-opacity flex size-7 items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:L})}),e[30]=E,e[31]=R):R=e[31];let H;e[32]===Symbol.for("react.memo_cache_sentinel")?(H=s.jsx(Re,{side:"right",children:"Archive"}),e[32]=H):H=e[32];let P;e[33]!==R?(P=s.jsxs(Ee,{children:[R,H]}),e[33]=R,e[34]=P):P=e[34];let G;e[35]!==U||e[36]!==P?(G=s.jsxs("div",{className:K,children:[U,P]}),e[35]=U,e[36]=P,e[37]=G):G=e[37];let D;return e[38]!==o||e[39]!==M||e[40]!==G||e[41]!==v||e[42]!==S||e[43]!==I||e[44]!==n.id?(D=s.jsxs("div",{"data-task-id":b,role:j,tabIndex:y,onClick:o,onKeyDown:v,className:S,children:[I,M,G]}),e[38]=o,e[39]=M,e[40]=G,e[41]=v,e[42]=S,e[43]=I,e[44]=n.id,e[45]=D):D=e[45],D}function gs(t){const e=N.c(12),{onClick:n,isFetching:r,indented:o}=t,i=o?"-ml-4 pl-6 pr-2":"px-2";let l;e[0]!==i?(l=Q("flex items-center gap-2 py-1.5 rounded-md text-sm text-muted-foreground",i,"hover:bg-accent/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50","transition-colors disabled:cursor-progress disabled:opacity-60"),e[0]=i,e[1]=l):l=e[1];let a;e[2]!==r?(a=r&&s.jsx(Bs,{size:14,className:"animate-spin"}),e[2]=r,e[3]=a):a=e[3];const c=r?"Loading…":"Show more";let d;e[4]!==c?(d=s.jsx("span",{children:c}),e[4]=c,e[5]=d):d=e[5];let u;return e[6]!==r||e[7]!==n||e[8]!==l||e[9]!==a||e[10]!==d?(u=s.jsxs("button",{type:"button","aria-label":"Show more tasks",onClick:n,disabled:r,className:l,children:[a,d]}),e[6]=r,e[7]=n,e[8]=l,e[9]=a,e[10]=d,e[11]=u):u=e[11],u}function ta(t,e,n,r){return[t,e,n,r.type,r.member,r.currentUserId??""].join("|")}function sa(t){return t.member==="mine"&&!t.currentUserId}const Fn=4;let Mt=0;const is=[];function na(){for(;Mt<Fn&&is.length>0;){const t=is.shift();t&&t()}}function Gn(t){return new Promise((e,n)=>{const r=()=>{Mt++,t().then(e,n).finally(()=>{Mt--,na()})};Mt<Fn?r():is.push(r)})}const Yt=10;function Ds(t,e,n,r,o){const i={hidden:!1};t==="agent"&&(i.virtual_mcp_id=e),r.member==="mine"&&r.currentUserId&&(i.created_by=r.currentUserId),r.type==="automation"&&(i.has_trigger=!0),r.type==="manual"&&(i.has_trigger=!1);const l={where:i,limit:o,offset:n,orderBy:[{field:["updated_at"],direction:"desc"}]};return t==="status"&&(l.status=e),l}function ra(t,e,n,r){let o=0;for(const i of t)bs(i,e,n,r)&&o++;return o}function es(t,e,n,r){return ra(t,e,n,r)}function oa(t,e,n){const r=new Map;for(const o of t){const i=o.virtual_mcp_id;i&&bs(o,e,i,n)&&r.set(i,(r.get(i)??0)+1)}return r}function ia(t,e){return!!(t>=Yt||t===0&&e)}function Ms(t,e){return t<e}function la(t,e){return e===!1?!1:e===!0?!0:t}function bs(t,e,n,r){return!(t.hidden||e==="agent"&&t.virtual_mcp_id!==n||e==="status"&&(t.status??"completed")!==n||r.member==="mine"&&r.currentUserId&&t.created_by!==r.currentUserId||r.type==="automation"&&!t.trigger_id||r.type==="manual"&&t.trigger_id)}const Gt=new Map,Dt=new Map;function aa(t,e){return e?t>=Yt?!0:null:!1}function Rs(t){return Gt.get(t)}function ca(t,e){Gt.set(t,e)}function da(t,e,n){const r=Gt.get(t);if(r!==void 0){n(r);return}let o=Dt.get(t);o||(o=Gn(e).then(i=>(Gt.set(t,i),Dt.delete(t),i)).catch(()=>(Dt.delete(t),Promise.reject(new Error("group probe failed")))),Dt.set(t,o)),o.then(n,()=>n(!1))}function Es(t){const e=t,n=Array.isArray(e.items)?e.items:[];return{items:n,hasMore:e.hasMore??n.length===Yt,totalCount:typeof e.totalCount=="number"?e.totalCount:void 0}}function ua(t,e,n,r,o){let i=0;for(const l of t)e.has(l.id)||bs(l,n,r,o)&&i++;return i}function js(t,e,n,r){const o=N.c(8),{org:i}=pe(),l=ta(i.id,t,e,n);let a;o[0]!==n?(a=sa(n),o[0]=n,o[1]=a):a=o[1];const c=a,[d,u]=z.useState({isFetching:!1,isProbing:!1,identity:l,probeSubscribedIdentity:null,serverHasMore:null});d.identity!==l&&u({isFetching:!1,isProbing:!1,identity:l,probeSubscribedIdentity:null,serverHasMore:null});const m=Zr(),{threads:f,hasMore:h}=rn(),p=r??es(f,t,e,n),x=ia(p,h),g=aa(p,h),b=xn();if(d.identity===l&&d.serverHasMore===null){const S=g??Rs(l);S!==void 0&&u({isFetching:!1,isProbing:!1,identity:l,probeSubscribedIdentity:d.probeSubscribedIdentity,serverHasMore:S})}!c&&d.identity===l&&d.serverHasMore===null&&g===null&&Rs(l)===void 0&&d.probeSubscribedIdentity!==l&&(u(S=>S.identity===l?{...S,isProbing:!0,probeSubscribedIdentity:l}:S),da(l,async()=>{const S=Ds(t,e,0,n,1),I=await b.call("COLLECTION_THREADS_LIST",S),{totalCount:T}=Es(I),$=es(m.threads.get(),t,e,n);return T===void 0?!1:Ms($,T)},S=>{u(I=>I.identity!==l?I:{...I,isProbing:!1,serverHasMore:S})}));const y=async function(){if(d.isFetching||d.isProbing||c)return;const I=l;u(T=>T.identity===I?{...T,isFetching:!0}:T);try{const T=es(f,t,e,n),$=Ds(t,e,T,n,Yt),O=await Gn(()=>b.call("COLLECTION_THREADS_LIST",$)),{items:A,hasMore:C,totalCount:M}=Es(O),K=new Set(f.map(ma)),U=ua(A,K,t,e,n),E=T;m.mergeThreads(A),u(L=>{if(L.identity!==I)return L;let R;return M!==void 0?R=Ms(E+U,M):R=A.length===0||U===0?!1:C,ca(I,R),{...L,isFetching:!1,serverHasMore:R}})}catch(T){const $=T,O=$ instanceof Error?$.message:String($);Oe.error(`Could not load more tasks: ${O}`),u(A=>A.identity===I?{...A,isFetching:!1}:A)}},v=d.isFetching||d.isProbing,_=!c&&!v&&la(x,d.serverHasMore);let w;return o[2]!==v||o[3]!==y||o[4]!==_||o[5]!==d.isProbing||o[6]!==d.serverHasMore?(w={hasMore:_,isFetching:v,isProbing:d.isProbing,serverHasMore:d.serverHasMore,loadMore:y},o[2]=v,o[3]=y,o[4]=_,o[5]=d.isProbing,o[6]=d.serverHasMore,o[7]=w):w=o[7],w}function ma(t){return t.id}function Ln(t){const e=N.c(61),{virtualMcpId:n,threads:r,activeTaskId:o,filters:i,onSelectTask:l,onArchiveTask:a,onNewTaskInGroup:c,onShowSettings:d,onHideGroup:u,isOrgPinned:m,canManageOrgPin:f,onToggleOrgPin:h,sortable:p,groupVisibleCount:x}=t,g=m===void 0?!1:m,b=f===void 0?!1:f,j=vt(n),y=r[0];let v;e[0]!==y||e[1]!==c||e[2]!==l||e[3]!==n?(v=()=>{y?l(y):c(n)},e[0]=y,e[1]=c,e[2]=l,e[3]=n,e[4]=v):v=e[4];const _=v,w=p?.isDragging?!1:void 0;let S;e[5]!==p?.isDragging||e[6]!==n?(S=X=>{p?.isDragging||X&&te("sidebar_group_hover_popover_opened",{virtual_mcp_id:n})},e[5]=p?.isDragging,e[6]=n,e[7]=S):S=e[7];const I=!!(y&&o&&y.id===o),T=p?"Drag to reorder":void 0;let $;e[8]!==p?($=p?{...p.attributes,...p.listeners}:{},e[8]=p,e[9]=$):$=e[9];const O=p&&"cursor-pointer active:cursor-grabbing touch-none",A=p?.isDragging&&"cursor-grabbing";let C;e[10]!==A||e[11]!==O?(C=Q("group-data-[state=collapsed]/sidebar:!size-10 group-data-[state=collapsed]/sidebar:!max-w-none group-data-[state=collapsed]/sidebar:!overflow-visible group-data-[state=collapsed]/sidebar:[&_svg]:opacity-100",O,A),e[10]=A,e[11]=O,e[12]=C):C=e[12];const M=j?.icon??null,K=j?.title??"?";let U;e[13]!==M||e[14]!==K?(U=s.jsx(Fe,{icon:M,name:K,size:"sm+",className:"rounded-lg"}),e[13]=M,e[14]=K,e[15]=U):U=e[15];let E;e[16]!==_||e[17]!==C||e[18]!==U||e[19]!==I||e[20]!==T||e[21]!==$?(E=s.jsx(he,{children:s.jsx(gn,{asChild:!0,children:s.jsx(Jl,{asChild:!0,children:s.jsx(Te,{onClick:_,isActive:I,title:T,...$,className:C,children:U})})})}),e[16]=_,e[17]=C,e[18]=U,e[19]=I,e[20]=T,e[21]=$,e[22]=E):E=e[22];const L=h??fa;let R;e[23]!==b||e[24]!==g||e[25]!==u||e[26]!==c||e[27]!==d||e[28]!==L||e[29]!==n?(R=s.jsx(bn,{className:"w-56",children:s.jsx(En,{virtualMcpId:n,isOrgPinned:g,canManageOrgPin:b,onNewTaskInGroup:c,onShowSettings:d,onToggleOrgPin:L,onHideGroup:u})}),e[23]=b,e[24]=g,e[25]=u,e[26]=c,e[27]=d,e[28]=L,e[29]=n,e[30]=R):R=e[30];let H;e[31]!==E||e[32]!==R?(H=s.jsxs(jn,{children:[E,R]}),e[31]=E,e[32]=R,e[33]=H):H=e[33];const P=j?.title??"Agent";let G;e[34]!==P?(G=s.jsx("span",{className:"truncate",children:P}),e[34]=P,e[35]=G):G=e[35];let D;e[36]!==c||e[37]!==n?(D=()=>c(n),e[36]=c,e[37]=n,e[38]=D):D=e[38];let B;e[39]===Symbol.for("react.memo_cache_sentinel")?(B=s.jsx(ke,{size:14}),e[39]=B):B=e[39];let F;e[40]!==D?(F=s.jsx("button",{type:"button","aria-label":"New task in this agent",onClick:D,className:"flex size-6 items-center justify-center rounded-md hover:bg-accent text-muted-foreground hover:text-foreground",children:B}),e[40]=D,e[41]=F):F=e[41];let Y;e[42]!==G||e[43]!==F?(Y=s.jsxs("div",{className:"flex items-center justify-between px-1 pb-1 text-xs font-medium",children:[G,F]}),e[42]=G,e[43]=F,e[44]=Y):Y=e[44];let ee;e[45]!==o||e[46]!==i||e[47]!==x||e[48]!==a||e[49]!==l||e[50]!==r||e[51]!==n?(ee=s.jsx(pa,{virtualMcpId:n,threads:r,activeTaskId:o,filters:i,groupVisibleCount:x,onSelectTask:l,onArchiveTask:a}),e[45]=o,e[46]=i,e[47]=x,e[48]=a,e[49]=l,e[50]=r,e[51]=n,e[52]=ee):ee=e[52];let V;e[53]!==Y||e[54]!==ee?(V=s.jsxs(Zl,{side:"right",align:"start",sideOffset:8,className:"w-72 p-2",children:[Y,ee]}),e[53]=Y,e[54]=ee,e[55]=V):V=e[55];let J;return e[56]!==H||e[57]!==V||e[58]!==w||e[59]!==S?(J=s.jsxs(Ql,{open:w,openDelay:120,closeDelay:150,onOpenChange:S,children:[H,V]}),e[56]=H,e[57]=V,e[58]=w,e[59]=S,e[60]=J):J=e[60],J}function fa(){}function pa(t){const e=N.c(6),{virtualMcpId:n,threads:r,activeTaskId:o,filters:i,groupVisibleCount:l,onSelectTask:a,onArchiveTask:c}=t,d=js("agent",n,i,l);let u;return e[0]!==o||e[1]!==c||e[2]!==a||e[3]!==d||e[4]!==r?(u=s.jsx("div",{className:"flex flex-col gap-0.5 max-h-[60vh] overflow-y-auto",children:r.length===0&&!d.hasMore&&!d.isFetching?s.jsx("div",{className:"px-2 py-1.5 text-xs text-muted-foreground",children:"No tasks yet"}):s.jsxs(s.Fragment,{children:[r.map(m=>s.jsx(Vt,{task:m,isActive:o===m.id,onClick:()=>a(m),onArchive:()=>c(m),showAutomationBadge:!!m.trigger_id},m.id)),(d.hasMore||d.isFetching)&&s.jsx(gs,{onClick:()=>{d.loadMore()},isFetching:d.isFetching})]})}),e[0]=o,e[1]=c,e[2]=a,e[3]=d,e[4]=r,e[5]=u):u=e[5],u}function xa(t,e,n,r,o,i,l){const a=N.c(18),c=l===void 0?"expanded":l;let d;a[0]===Symbol.for("react.memo_cache_sentinel")?(d={activationConstraint:{distance:8}},a[0]=d):d=a[0];let u;a[1]===Symbol.for("react.memo_cache_sentinel")?(u={coordinateGetter:$o},a[1]=u):u=a[1];const m=ko(Cs(To,d),Cs(Io,u));let f;a[2]!==r||a[3]!==o||a[4]!==e||a[5]!==t?(f=ao(t,e,r,o),a[2]=r,a[3]=o,a[4]=e,a[5]=t,a[6]=f):f=a[6];const h=f;let p;a[7]!==i||a[8]!==n||a[9]!==o||a[10]!==e||a[11]!==h||a[12]!==c?(p=b=>{const{active:j,over:y}=b;if(!y||j.id===y.id)return;const v=String(j.id),_=String(y.id);if(!co(v,_,o))return;const w=uo(h,v,_),S=mo(e,n,o,w);e==="org"?fo(n.orgId,S):po(n,S),te("sidebar_group_reordered",{virtual_mcp_id:v,over_virtual_mcp_id:_,surface:c,section:e}),i()},a[7]=i,a[8]=n,a[9]=o,a[10]=e,a[11]=h,a[12]=c,a[13]=p):p=a[13];const x=p;let g;return a[14]!==x||a[15]!==m||a[16]!==h?(g={sensors:m,sortableIds:h,handleDragEnd:x},a[14]=x,a[15]=m,a[16]=h,a[17]=g):g=a[17],g}function ha(t){const e=N.c(2),{collapsed:n}=t;if(n===void 0?!1:n){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{role:"separator","aria-orientation":"horizontal",className:"mx-auto my-1 h-px w-6 shrink-0 bg-border"}),e[0]=i):i=e[0],i}let o;return e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{role:"separator","aria-orientation":"horizontal",className:"my-1.5 h-px w-full shrink-0 bg-border"}),e[1]=o):o=e[1],o}function ga(t){const e=N.c(12),{id:n,children:r}=t;let o;e[0]!==n?(o={id:n},e[0]=n,e[1]=o):o=e[1];const{attributes:i,listeners:l,setNodeRef:a,transform:c,transition:d,isDragging:u}=Do(o);let m;if(e[2]!==i||e[3]!==r||e[4]!==u||e[5]!==l||e[6]!==a||e[7]!==c||e[8]!==d){const h={transform:Mo.Transform.toString(c),transition:d,zIndex:u?100:void 0};m=r({setNodeRef:a,style:h,isDragging:u,attributes:i,listeners:l}),e[2]=i,e[3]=r,e[4]=u,e[5]=l,e[6]=a,e[7]=c,e[8]=d,e[9]=m}else m=e[9];let f;return e[10]!==m?(f=s.jsx(s.Fragment,{children:m}),e[10]=m,e[11]=f):f=e[11],f}function Fs(t){const e=N.c(18),{section:n,groups:r,orderScope:o,decopilotId:i,orgPinnedIds:l,onReorder:a,surface:c,renderGroup:d,renderSortable:u,renderFixed:m}=t,{sensors:f,sortableIds:h,handleDragEnd:p}=xa(r,n,o,i,l,a,c);if(r.length===0)return null;const x=h;let g;if(e[0]!==r||e[1]!==m||e[2]!==d||e[3]!==u||e[4]!==h){let y;e[6]!==m||e[7]!==d||e[8]!==u||e[9]!==h?(y=v=>{const _=d(v);return h.includes(v.virtualMcpId)?s.jsx(ga,{id:v.virtualMcpId,children:w=>{const{setNodeRef:S,style:I,isDragging:T,attributes:$,listeners:O}=w;return s.jsx("div",{ref:S,style:I,className:Q(T&&"opacity-50"),children:u(_,{attributes:$,listeners:O,isDragging:T})})}},v.virtualMcpId):s.jsx("div",{children:m(_)},v.virtualMcpId)},e[6]=m,e[7]=d,e[8]=u,e[9]=h,e[10]=y):y=e[10],g=r.map(y),e[0]=r,e[1]=m,e[2]=d,e[3]=u,e[4]=h,e[5]=g}else g=e[5];let b;e[11]!==x||e[12]!==g?(b=s.jsx(Ao,{items:x,strategy:zo,children:g}),e[11]=x,e[12]=g,e[13]=b):b=e[13];let j;return e[14]!==p||e[15]!==f||e[16]!==b?(j=s.jsx(Oo,{sensors:f,collisionDetection:Po,onDragEnd:p,children:b}),e[14]=p,e[15]=f,e[16]=b,e[17]=j):j=e[17],j}function Hn(t){const e=N.c(23),{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:l,surface:a,collapsedSeparator:c,renderGroup:d,renderSortable:u,renderFixed:m}=t;let f;if(e[0]!==c||e[1]!==o||e[2]!==n||e[3]!==l||e[4]!==r||e[5]!==i||e[6]!==m||e[7]!==d||e[8]!==u||e[9]!==a){const{decopilot:h,orgPinned:p,user:x,toolCallRuns:g}=xo(n,o,i),b=p.length>0&&x.length>0;let j;e[11]!==o||e[12]!==l||e[13]!==r||e[14]!==i||e[15]!==m||e[16]!==d||e[17]!==u||e[18]!==a?(j={orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:l,surface:a,renderGroup:d,renderSortable:u,renderFixed:m},e[11]=o,e[12]=l,e[13]=r,e[14]=i,e[15]=m,e[16]=d,e[17]=u,e[18]=a,e[19]=j):j=e[19];const y=j;let v;e[20]!==c||e[21]!==b?(v=b&&s.jsx(ha,{collapsed:c}),e[20]=c,e[21]=b,e[22]=v):v=e[22],f=s.jsxs(s.Fragment,{children:[h&&m(d(h)),s.jsx(Fs,{section:"org",groups:p,...y}),v,s.jsx(Fs,{section:"user",groups:x,...y}),g&&m(d(g))]}),e[0]=c,e[1]=o,e[2]=n,e[3]=l,e[4]=r,e[5]=i,e[6]=m,e[7]=d,e[8]=u,e[9]=a,e[10]=f}else f=e[10];return f}function ba(t){const e=N.c(7),{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:l,renderGroup:a}=t;let c;return e[0]!==o||e[1]!==n||e[2]!==l||e[3]!==r||e[4]!==i||e[5]!==a?(c=s.jsx(Hn,{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:l,surface:"collapsed_rail",collapsedSeparator:!0,renderGroup:a,renderFixed:va,renderSortable:ja}),e[0]=o,e[1]=n,e[2]=l,e[3]=r,e[4]=i,e[5]=a,e[6]=c):c=e[6],c}function ja(t,e){return s.jsx(Ln,{...t,sortable:{attributes:e.attributes,listeners:e.listeners,isDragging:e.isDragging}},t.virtualMcpId)}function va(t){return s.jsx(Ln,{...t},t.virtualMcpId)}const ya="sidebar.group.expanded.";function Bn(t,e){const n=N.c(3),[r,o]=ls(`${ya}${t}`,e);let i;return n[0]!==r||n[1]!==o?(i=[r,o],n[0]=r,n[1]=o,n[2]=i):i=n[2],i}function Un(t){const e=N.c(70),{virtualMcpId:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:l,onNewTaskInGroup:a,onShowSettings:c,onHideGroup:d,isOrgPinned:u,canManageOrgPin:m,onToggleOrgPin:f,filters:h,groupVisibleCount:p,devPartnerId:x,devGroupVisibleCount:g,sortable:b}=t,j=u===void 0?!1:u,y=m===void 0?!1:m,v=x===void 0?null:x,[_,w]=Bn(n,!1),S=n===an,I=b?.isDragging??!1;let T;e[0]!==v||e[1]!==r?(T=v?r.filter(W=>W.virtual_mcp_id===v):[],e[0]=v,e[1]=r,e[2]=T):T=e[2];const $=T;let O;e[3]!==v||e[4]!==r?(O=v?r.filter(W=>W.virtual_mcp_id!==v):r,e[3]=v,e[4]=r,e[5]=O):O=e[5];const A=O,C=!!v&&($.length>0||(g??0)>0);let M;e[6]!==_||e[7]!==w?(M=function(){w(!_)},e[6]=_,e[7]=w,e[8]=M):M=e[8];const K=M;let U;e[9]!==S||e[10]!==b?(U=b&&!S?{...b.attributes,...b.listeners}:{},e[9]=S,e[10]=b,e[11]=U):U=e[11];let E;e[12]!==K?(E=W=>{W.target===W.currentTarget&&(W.key==="Enter"||W.key===" ")&&(W.preventDefault(),K())},e[12]=K,e[13]=E):E=e[13];const L=b&&!S&&"touch-none active:cursor-grabbing",R=I&&"shadow-md bg-accent/40 cursor-grabbing";let H;e[14]!==R||e[15]!==L?(H=Q("group/group flex items-center gap-2 px-2 py-1.5 rounded-md text-sm font-medium text-foreground","cursor-pointer hover:bg-accent/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 transition-colors",L,R),e[14]=R,e[15]=L,e[16]=H):H=e[16];let P;e[17]!==S||e[18]!==n?(P=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center transition-opacity group-hover/group:opacity-0",children:s.jsx(_a,{virtualMcpId:n,isToolCallRuns:S})}),e[17]=S,e[18]=n,e[19]=P):P=e[19];let G;e[20]!==_?(G=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center text-muted-foreground opacity-0 transition-opacity group-hover/group:opacity-100",children:_?s.jsx(vn,{size:14}):s.jsx(ps,{size:14})}),e[20]=_,e[21]=G):G=e[21];let D;e[22]!==P||e[23]!==G?(D=s.jsxs("div",{className:"relative size-5 shrink-0 flex items-center justify-center",children:[P,G]}),e[22]=P,e[23]=G,e[24]=D):D=e[24];let B;e[25]!==S||e[26]!==n?(B=s.jsx("span",{className:"flex-1 truncate",children:s.jsx(Ca,{virtualMcpId:n,isToolCallRuns:S})}),e[25]=S,e[26]=n,e[27]=B):B=e[27];let F;e[28]!==S||e[29]!==a||e[30]!==n?(F=!S&&s.jsx("button",{type:"button","aria-label":"New task in this agent",onClick:W=>{W.stopPropagation(),a(n)},className:"opacity-0 group-hover/group:opacity-100 focus-visible:opacity-100 transition-opacity flex size-7 items-center justify-center rounded-md hover:bg-accent text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:s.jsx(ke,{size:14})}),e[28]=S,e[29]=a,e[30]=n,e[31]=F):F=e[31];let Y;e[32]!==_||e[33]!==K||e[34]!==H||e[35]!==D||e[36]!==B||e[37]!==F||e[38]!==U||e[39]!==E?(Y=s.jsxs("div",{...U,role:"button",tabIndex:0,"aria-expanded":_,onClick:K,onKeyDown:E,className:H,children:[D,B,F]}),e[32]=_,e[33]=K,e[34]=H,e[35]=D,e[36]=B,e[37]=F,e[38]=U,e[39]=E,e[40]=Y):Y=e[40];const ee=Y;let V;e[41]!==y||e[42]!==ee||e[43]!==j||e[44]!==S||e[45]!==d||e[46]!==a||e[47]!==c||e[48]!==f||e[49]!==n?(V=S?ee:s.jsxs(jn,{children:[s.jsx(gn,{asChild:!0,children:ee}),s.jsx(bn,{className:"w-56",children:s.jsx(En,{virtualMcpId:n,isOrgPinned:j,canManageOrgPin:y,onNewTaskInGroup:a,onShowSettings:c,onToggleOrgPin:f??Sa,onHideGroup:d})})]}),e[41]=y,e[42]=ee,e[43]=j,e[44]=S,e[45]=d,e[46]=a,e[47]=c,e[48]=f,e[49]=n,e[50]=V):V=e[50];let J;e[51]!==o||e[52]!==g||e[53]!==v||e[54]!==$||e[55]!==_||e[56]!==h||e[57]!==p||e[58]!==S||e[59]!==A||e[60]!==l||e[61]!==a||e[62]!==i||e[63]!==C||e[64]!==r||e[65]!==n?(J=_&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:S?r.map(W=>s.jsx(Vt,{task:W,isActive:o===W.id,onClick:()=>i(W),onArchive:()=>l(W),showAutomationBadge:!!W.trigger_id,indented:!0},W.id)):s.jsxs(s.Fragment,{children:[s.jsx(Gs,{virtualMcpId:n,threads:A,activeTaskId:o,onSelectTask:i,onArchiveTask:l,onNewTaskInGroup:a,filters:h,groupVisibleCount:p}),C&&v&&s.jsxs("div",{className:"flex flex-col gap-0.5 mt-1.5",children:[s.jsxs("div",{className:"flex items-center gap-1.5 px-2 pb-0.5 text-[10px] font-medium uppercase tracking-wider text-muted-foreground/80",children:[s.jsx(Vr,{size:11}),"Develop"]}),s.jsx(Gs,{virtualMcpId:v,threads:$,activeTaskId:o,onSelectTask:i,onArchiveTask:l,onNewTaskInGroup:a,filters:h,groupVisibleCount:g})]})]})}),e[51]=o,e[52]=g,e[53]=v,e[54]=$,e[55]=_,e[56]=h,e[57]=p,e[58]=S,e[59]=A,e[60]=l,e[61]=a,e[62]=i,e[63]=C,e[64]=r,e[65]=n,e[66]=J):J=e[66];let X;return e[67]!==V||e[68]!==J?(X=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[V,J]}),e[67]=V,e[68]=J,e[69]=X):X=e[69],X}function Sa(){}function _a(t){const e=N.c(3),{virtualMcpId:n,isToolCallRuns:r}=t;if(r){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Fe,{icon:null,name:"⚙",size:"2xs"}),e[0]=i):i=e[0],i}let o;return e[1]!==n?(o=s.jsx(Na,{virtualMcpId:n}),e[1]=n,e[2]=o):o=e[2],o}function Na(t){const e=N.c(4),{virtualMcpId:n}=t,r=vt(n);if(!r){let l;return e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Fe,{icon:null,name:"?",size:"2xs"}),e[0]=l):l=e[0],l}const o=r.icon??null;let i;return e[1]!==r.title||e[2]!==o?(i=s.jsx(Fe,{icon:o,name:r.title,size:"2xs"}),e[1]=r.title,e[2]=o,e[3]=i):i=e[3],i}function Ca(t){const e=N.c(3),{virtualMcpId:n,isToolCallRuns:r}=t;if(r){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(s.Fragment,{children:"Automation runs"}),e[0]=i):i=e[0],i}let o;return e[1]!==n?(o=s.jsx(wa,{virtualMcpId:n}),e[1]=n,e[2]=o):o=e[2],o}function wa(t){const e=N.c(2),{virtualMcpId:n}=t,o=vt(n)?.title??"Agent";let i;return e[0]!==o?(i=s.jsx(s.Fragment,{children:o}),e[0]=o,e[1]=i):i=e[1],i}function Gs(t){const e=N.c(10),{virtualMcpId:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:l,onNewTaskInGroup:a,filters:c,groupVisibleCount:d}=t,u=js("agent",n,c,d),{isFetching:m,isProbing:f,loadMore:h,serverHasMore:p}=u,[x,g]=z.useState(!1);!x&&r.length===0&&p===!0&&!m&&!f&&(g(!0),queueMicrotask(()=>{h()}));const{hasMore:b}=u;let j;return e[0]!==o||e[1]!==b||e[2]!==m||e[3]!==h||e[4]!==l||e[5]!==a||e[6]!==i||e[7]!==r||e[8]!==n?(j=s.jsx(s.Fragment,{children:r.length===0?s.jsxs("button",{type:"button",onClick:()=>a(n),className:"flex items-center gap-2 -ml-4 pl-6 pr-2 py-1.5 rounded-md cursor-pointer text-sm text-muted-foreground hover:bg-accent/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 transition-colors",children:[s.jsx(ke,{size:14}),s.jsx("span",{children:"New thread"})]}):s.jsxs(s.Fragment,{children:[r.map(y=>s.jsx(Vt,{task:y,isActive:o===y.id,onClick:()=>i(y),onArchive:()=>l(y),showAutomationBadge:!!y.trigger_id,indented:!0},y.id)),(b||m)&&s.jsx(gs,{onClick:()=>{h()},isFetching:m,indented:!0})]})}),e[0]=o,e[1]=b,e[2]=m,e[3]=h,e[4]=l,e[5]=a,e[6]=i,e[7]=r,e[8]=n,e[9]=j):j=e[9],j}function ka(t){const e=N.c(16),{status:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:l,filters:a}=t,{isFetching:c,isProbing:d,loadMore:u,hasMore:m,serverHasMore:f}=js("status",n,a),[h,p]=z.useState(!1);!h&&r.length===0&&f===!0&&!c&&!d&&(p(!0),queueMicrotask(()=>{u()}));let x;if(e[0]!==o||e[1]!==l||e[2]!==i||e[3]!==r){let j;e[5]!==o||e[6]!==l||e[7]!==i?(j=y=>s.jsx(Vt,{task:y,isActive:o===y.id,onClick:()=>i(y),onArchive:()=>l(y),showAutomationBadge:!!y.trigger_id,showAgentIcon:!0,hideStatusIdle:!0,indented:!0},y.id),e[5]=o,e[6]=l,e[7]=i,e[8]=j):j=e[8],x=r.map(j),e[0]=o,e[1]=l,e[2]=i,e[3]=r,e[4]=x}else x=e[4];let g;e[9]!==m||e[10]!==c||e[11]!==u?(g=(m||c)&&s.jsx(gs,{onClick:()=>{u()},isFetching:c,indented:!0}),e[9]=m,e[10]=c,e[11]=u,e[12]=g):g=e[12];let b;return e[13]!==x||e[14]!==g?(b=s.jsxs(s.Fragment,{children:[x,g]}),e[13]=x,e[14]=g,e[15]=b):b=e[15],b}function Ia(t){const e=N.c(35),{status:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:l,filters:a}=t,c=$i[n],d=c.icon,[u,m]=Bn(`status-${n}`,!1);let f;e[0]!==u||e[1]!==m?(f=function(){m(!u)},e[0]=u,e[1]=m,e[2]=f):f=e[2];const h=f;let p;e[3]!==h?(p=S=>{S.target===S.currentTarget&&(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),h())},e[3]=h,e[4]=p):p=e[4];let x;e[5]!==d||e[6]!==c.iconClassName?(x=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center transition-opacity group-hover/group:opacity-0",children:s.jsx(d,{size:12,className:c.iconClassName})}),e[5]=d,e[6]=c.iconClassName,e[7]=x):x=e[7];let g;e[8]!==u?(g=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center text-muted-foreground opacity-0 transition-opacity group-hover/group:opacity-100",children:u?s.jsx(vn,{size:14}):s.jsx(ps,{size:14})}),e[8]=u,e[9]=g):g=e[9];let b;e[10]!==x||e[11]!==g?(b=s.jsxs("div",{className:"relative size-5 shrink-0 flex items-center justify-center",children:[x,g]}),e[10]=x,e[11]=g,e[12]=b):b=e[12];let j;e[13]!==c.label?(j=s.jsx("span",{className:"flex-1 truncate",children:c.label}),e[13]=c.label,e[14]=j):j=e[14];let y;e[15]!==r.length?(y=s.jsx("div",{className:"size-5 shrink-0 flex items-center justify-center",children:s.jsx("span",{className:"text-xs text-muted-foreground tabular-nums",children:r.length})}),e[15]=r.length,e[16]=y):y=e[16];let v;e[17]!==u||e[18]!==h||e[19]!==p||e[20]!==b||e[21]!==j||e[22]!==y?(v=s.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":u,onClick:h,onKeyDown:p,className:"group/group flex items-center gap-2 px-2 py-1.5 rounded-md text-sm font-medium text-foreground cursor-pointer hover:bg-accent/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 transition-colors",children:[b,j,y]}),e[17]=u,e[18]=h,e[19]=p,e[20]=b,e[21]=j,e[22]=y,e[23]=v):v=e[23];let _;e[24]!==o||e[25]!==u||e[26]!==a||e[27]!==l||e[28]!==i||e[29]!==n||e[30]!==r?(_=u&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:s.jsx(ka,{status:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:l,filters:a})}),e[24]=o,e[25]=u,e[26]=a,e[27]=l,e[28]=i,e[29]=n,e[30]=r,e[31]=_):_=e[31];let w;return e[32]!==v||e[33]!==_?(w=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[v,_]}),e[32]=v,e[33]=_,e[34]=w):w=e[34],w}function Ta(t){const e=N.c(7),{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:l,renderGroup:a}=t;let c;return e[0]!==o||e[1]!==n||e[2]!==l||e[3]!==r||e[4]!==i||e[5]!==a?(c=s.jsx(Hn,{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:l,surface:"expanded",renderGroup:a,renderFixed:Aa,renderSortable:$a}),e[0]=o,e[1]=n,e[2]=l,e[3]=r,e[4]=i,e[5]=a,e[6]=c):c=e[6],c}function $a(t,e){return s.jsx(Un,{...t,sortable:e},t.virtualMcpId)}function Aa(t){return s.jsx(Un,{...t},t.virtualMcpId)}function za(t,e,n,r){return[t.orgId,t.userId,r,n.slice().sort().join(","),e.map(o=>o.virtualMcpId).sort().join(",")].join("|")}function Oa(t,e,n,r,o){const i=N.c(5),l=za(t,e,r,o),[a,c]=z.useState("");a!==l&&(ho(t,e,n,r),c(l));let d;return i[0]!==n||i[1]!==r||i[2]!==t||i[3]!==e?(d=go(t,e,n,r),i[0]=n,i[1]=r,i[2]=t,i[3]=e,i[4]=d):d=i[4],d}const qn={all:"All tasks",manual:"Chats",automation:"Automation"},Wn={all:"All members",mine:"Mine only"},Ls={agent:"Agent",status:"Status"};function Kn(t){const e=N.c(98);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const{onNavigate:r}=n,{data:o}=Ie.useSession(),i=o?.user?.id,l=i??"anon",{org:a}=pe(),c=Fr(a.id).id,d=tn(),{liveToDev:u,devToLive:m}=Ro(d),f=ln(d),h=Fl(),p=Gr();let x;e[2]===Symbol.for("react.memo_cache_sentinel")?(x={},e[2]=x):x=e[2];const[g,b]=z.useState(x),j=new Set(f),y={},v=[];let _;e[3]!==g?(_=Object.entries(g),e[3]=g,e[4]=_):_=e[4];for(const[k,q]of _)j.has(k)!==q?y[k]=q:v.push(k);v.length>0&&b(k=>{const q={...k};for(const se of v)delete q[se];return q});const w=new Set(f);for(const[k,q]of Object.entries(y))q?w.add(k):w.delete(k);const S=[...w],I=new Set(S),{threads:T}=rn(),$=T.filter(Ha),{hide:O}=nn(),A=Ge(),{setTaskId:C,createNewTask:M}=on();let K;e[5]===Symbol.for("react.memo_cache_sentinel")?(K={strict:!1},e[5]=K):K=e[5];const E=qs(K).taskId??null;let L;e[6]!==r?(L=()=>{r?.()},e[6]=r,e[7]=L):L=e[7];const R=L,H=[...$].sort(La),[P,G]=z.useState("all"),[D,B]=z.useState("mine"),[F,Y]=z.useState("agent"),[ee,V]=z.useState(!1),[J,X]=z.useState(!1),[W,re]=z.useState(0),ie=bo(),ue=W+ie;let ne;e[8]!==a.id||e[9]!==l?(ne={orgId:a.id,userId:l},e[8]=a.id,e[9]=l,e[10]=ne):ne=e[10];const oe=ne,le={type:P,member:D,currentUserId:i??null},xe=oa(H,"agent",le),Z=Oa(oe,jo(vo(H,c),m),c,S,ue);let $e;e[11]!==i||e[12]!==D?($e=k=>D==="mine"&&i?k.filter(q=>q.created_by===i):k,e[11]=i,e[12]=D,e[13]=$e):$e=e[13];const me=$e;let be;e[14]!==P?(be=k=>P==="automation"?k.filter(Ga):P==="manual"?k.filter(Fa):k,e[14]=P,e[15]=be):be=e[15];const je=be,Ae=k=>{const q=k.id===E;if(O(k.id),!q)return;const se=H.find(fe=>fe.id!==k.id&&fe.virtual_mcp_id===k.virtual_mcp_id&&fe.created_by===i);R(),se?C(se.id,se.virtual_mcp_id):A({to:"/$org",params:{org:a.slug}})};let ve;e[16]!==R||e[17]!==M?(ve=k=>{te("sidebar_group_new_clicked",{virtual_mcp_id:k}),R(),M(k)},e[16]=R,e[17]=M,e[18]=ve):ve=e[18];const Le=ve,_e=yo();let ye;e[19]!==R||e[20]!==_e?(ye=k=>{te("sidebar_group_settings_clicked",{virtual_mcp_id:k}),R(),_e(k,{search:{main:"instructions"}})},e[19]=R,e[20]=_e,e[21]=ye):ye=e[21];const He=ye,Be=k=>{if(I.has(k))return;te("sidebar_group_hide_clicked",{virtual_mcp_id:k});const q=Z.find(se=>se.virtualMcpId===k);if(q)for(const se of q.threads)O(se.id);_o(oe,k,S),re(Ea)},xt=async(k,q)=>{if(h&&y[k]===void 0){te("sidebar_group_org_pin_toggled",{virtual_mcp_id:k,pinned:q}),b(se=>({...se,[k]:q}));try{await p.update.mutateAsync({id:k,data:{pinned:q}})}catch{No(oe,k,!q),b(se=>{const fe={...se};return delete fe[k],fe})}}},Ue=k=>{const q=k===c||k===an;return{isOrgPinned:q||I.has(k),canManageOrgPin:q?!1:h,onToggleOrgPin:q?void 0:xt}},Ye=k=>{const q=je(me(k.threads)),se=u.get(k.virtualMcpId)??null;return{virtualMcpId:k.virtualMcpId,threads:q,devPartnerId:se,devGroupVisibleCount:se?xe.get(se)??0:0,activeTaskId:E,filters:le,groupVisibleCount:xe.get(k.virtualMcpId)??0,onSelectTask:fe=>{R(),C(fe.id,fe.virtual_mcp_id)},onArchiveTask:Ae,onNewTaskInGroup:Le,onShowSettings:He,onHideGroup:Be,...Ue(k.virtualMcpId)}},de=P!=="all"||D!=="mine",{state:qe,isMobile:We}=Ve();if(qe==="collapsed"&&!We){let k;if(e[22]!==de||e[23]!==Z||e[24]!==me||e[25]!==je){let mt;e[27]!==de||e[28]!==me||e[29]!==je?(mt=Xn=>{const Qn=je(me(Xn.threads));return!(de&&Qn.length===0)},e[27]=de,e[28]=me,e[29]=je,e[30]=mt):mt=e[30],k=Z.filter(mt),e[22]=de,e[23]=Z,e[24]=me,e[25]=je,e[26]=k}else k=e[26];const q=k,se=F==="agent"&&Z.length===0;let fe;e[31]!==se?(fe=s.jsx(Ns,{value:se}),e[31]=se,e[32]=fe):fe=e[32];let zt;return e[33]===Symbol.for("react.memo_cache_sentinel")?(zt=()=>re(Ra),e[33]=zt):zt=e[33],s.jsxs(s.Fragment,{children:[fe,s.jsx(De,{className:"min-h-0 gap-1.5 overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:s.jsx(ba,{groups:q,orderScope:oe,decopilotId:c,orgPinnedIds:S,onReorder:zt,renderGroup:mt=>Ye(mt)})})]})}const Ke="flex flex-col h-full min-h-0",Ne=F==="agent"&&Z.length===0;let Se;e[34]!==Ne?(Se=s.jsx(Ns,{value:Ne}),e[34]=Ne,e[35]=Se):Se=e[35];let ae;e[36]!==V?(ae=()=>{te("tasks_panel_search_opened"),X(!0),V(!0)},e[36]=V,e[37]=ae):ae=e[37];let ze;e[38]===Symbol.for("react.memo_cache_sentinel")?(ze=s.jsx(Yr,{size:16}),e[38]=ze):ze=e[38];let Ce;e[39]!==ae?(Ce=s.jsx(ge,{"aria-label":"Search threads",onClick:ae,children:ze}),e[39]=ae,e[40]=Ce):Ce=e[40];const gt=Ls[F==="agent"?"status":"agent"];let Xe;e[41]!==gt?(Xe=gt.toLowerCase(),e[41]=gt,e[42]=Xe):Xe=e[42];const bt=`Group by ${Xe}`,Xt=Ls[F];let St;e[43]!==Xt?(St=Xt.toLowerCase(),e[43]=Xt,e[44]=St):St=e[44];const Qt=`Grouped by ${St}`;let Qe,Je;e[45]!==F?(Qe=()=>{const k=F==="agent"?"status":"agent";te("tasks_panel_group_by_changed",{to_value:k}),Y(k)},Je=F==="agent"?s.jsx(gi,{size:16}):s.jsx(Xr,{size:16}),e[45]=F,e[46]=Qe,e[47]=Je):(Qe=e[46],Je=e[47]);let Ze;e[48]!==bt||e[49]!==Qt||e[50]!==Qe||e[51]!==Je?(Ze=s.jsx(ge,{"aria-label":bt,title:Qt,onClick:Qe,children:Je}),e[48]=bt,e[49]=Qt,e[50]=Qe,e[51]=Je,e[52]=Ze):Ze=e[52];let _t;e[53]===Symbol.for("react.memo_cache_sentinel")?(_t=s.jsx(hi,{size:16}),e[53]=_t):_t=e[53];let et;e[54]!==de?(et=de&&s.jsx("span",{className:"absolute top-0.5 right-0.5 size-2 rounded-full bg-red-500 ring-1 ring-sidebar pointer-events-none"}),e[54]=de,e[55]=et):et=e[55];let tt;e[56]!==et?(tt=s.jsx(pt,{asChild:!0,children:s.jsxs(ge,{"aria-label":"Filter tasks",children:[_t,et]})}),e[56]=et,e[57]=tt):tt=e[57];let st;e[58]!==D?(st=k=>{const q=k;q!==D&&te("tasks_panel_member_filter_changed",{to_value:q}),B(q)},e[58]=D,e[59]=st):st=e[59];let Nt;e[60]===Symbol.for("react.memo_cache_sentinel")?(Nt=s.jsx(Is,{size:"sm",className:"w-full",children:s.jsx(Ts,{})}),e[60]=Nt):Nt=e[60];let Ct;e[61]===Symbol.for("react.memo_cache_sentinel")?(Ct=Object.keys(Wn),e[61]=Ct):Ct=e[61];let wt;e[62]===Symbol.for("react.memo_cache_sentinel")?(wt=s.jsx(ks,{children:Ct.map(Ma)}),e[62]=wt):wt=e[62];let nt;e[63]!==D||e[64]!==st?(nt=s.jsx(Hs,{label:"Members",children:s.jsxs($s,{value:D,onValueChange:st,children:[Nt,wt]})}),e[63]=D,e[64]=st,e[65]=nt):nt=e[65];let rt;e[66]!==P?(rt=k=>{const q=k;q!==P&&te("tasks_panel_filter_changed",{to_value:q}),G(q)},e[66]=P,e[67]=rt):rt=e[67];let kt;e[68]===Symbol.for("react.memo_cache_sentinel")?(kt=s.jsx(Is,{size:"sm",className:"w-full",children:s.jsx(Ts,{})}),e[68]=kt):kt=e[68];let It;e[69]===Symbol.for("react.memo_cache_sentinel")?(It=Object.keys(qn),e[69]=It):It=e[69];let Tt;e[70]===Symbol.for("react.memo_cache_sentinel")?(Tt=s.jsx(ks,{children:It.map(Da)}),e[70]=Tt):Tt=e[70];let ot;e[71]!==rt||e[72]!==P?(ot=s.jsx(Hs,{label:"Type",children:s.jsxs($s,{value:P,onValueChange:rt,children:[kt,Tt]})}),e[71]=rt,e[72]=P,e[73]=ot):ot=e[73];let it;e[74]!==nt||e[75]!==ot?(it=s.jsx(Ut,{align:"start",sideOffset:8,collisionPadding:16,className:"w-72 p-3",children:s.jsxs("div",{className:"flex flex-col gap-2",children:[nt,ot]})}),e[74]=nt,e[75]=ot,e[76]=it):it=e[76];let lt;e[77]!==tt||e[78]!==it?(lt=s.jsxs(Bt,{children:[tt,it]}),e[77]=tt,e[78]=it,e[79]=lt):lt=e[79];let at;e[80]!==Ce||e[81]!==Ze||e[82]!==lt?(at=s.jsxs("div",{className:"flex items-center gap-0.5",children:[Ce,Ze,lt]}),e[80]=Ce,e[81]=Ze,e[82]=lt,e[83]=at):at=e[83];let $t;e[84]===Symbol.for("react.memo_cache_sentinel")?($t=s.jsx(yn,{compact:!0}),e[84]=$t):$t=e[84];let ct;e[85]!==at?(ct=s.jsxs("div",{className:"shrink-0 px-1 h-10 md:h-7 mb-2 flex items-center justify-between",children:[at,$t]}),e[85]=at,e[86]=ct):ct=e[86];const Yn="flex-1 min-h-0 overflow-y-auto overscroll-contain flex flex-col gap-0.5 -mr-2 pr-2",Jt=F==="status"?s.jsx(s.Fragment,{children:So(je(me(H))).map(k=>s.jsx(Ia,{status:k.status,threads:k.threads,activeTaskId:E,onSelectTask:q=>{R(),C(q.id,q.virtual_mcp_id)},onArchiveTask:Ae,filters:le},k.status))}):s.jsx(Ta,{groups:Z,orderScope:oe,decopilotId:c,orgPinnedIds:S,onReorder:()=>re(Pa),renderGroup:k=>({...Ye(k)})});let dt;e[87]!==Jt?(dt=s.jsx("div",{className:Yn,children:Jt}),e[87]=Jt,e[88]=dt):dt=e[88];let ut;e[89]!==J||e[90]!==ee||e[91]!==V?(ut=J&&s.jsx(Rl,{open:ee,onOpenChange:V}),e[89]=J,e[90]=ee,e[91]=V,e[92]=ut):ut=e[92];let At;return e[93]!==Se||e[94]!==ct||e[95]!==dt||e[96]!==ut?(At=s.jsxs("div",{className:Ke,children:[Se,ct,dt,ut]}),e[93]=Se,e[94]=ct,e[95]=dt,e[96]=ut,e[97]=At):At=e[97],At}function Pa(t){return t+1}function Da(t){return s.jsx(pn,{value:t,children:qn[t]},t)}function Ma(t){return s.jsx(pn,{value:t,children:Wn[t]},t)}function Ra(t){return t+1}function Ea(t){return t+1}function Fa(t){return!t.trigger_id}function Ga(t){return!!t.trigger_id}function La(t,e){return(e.updated_at??"").localeCompare(t.updated_at??"")}function Ha(t){return!t.hidden}function Hs(t){const e=N.c(7),{label:n,children:r}=t;let o;e[0]!==n?(o=s.jsx("span",{className:"text-sm text-muted-foreground",children:n}),e[0]=n,e[1]=o):o=e[1];let i;e[2]!==r?(i=s.jsx("div",{className:"w-36 shrink-0",children:r}),e[2]=r,e[3]=i):i=e[3];let l;return e[4]!==o||e[5]!==i?(l=s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[o,i]}),e[4]=o,e[5]=i,e[6]=l):l=e[6],l}const Ba=5,Ua=[{nameWidth:"w-24",taskRows:2},{nameWidth:"w-28",taskRows:0},{nameWidth:"w-20",taskRows:1},{nameWidth:"w-32",taskRows:0},{nameWidth:"w-24",taskRows:0}];function Vn(){const t=N.c(3),{state:e}=Ve();if(e==="collapsed"){let o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"flex flex-col gap-1.5",children:Array.from({length:Ba}).map(Ka)}),t[0]=o):o=t[0],o}let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{className:"shrink-0 px-1 h-10 md:h-7 mb-2 flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(we,{className:"size-6 rounded-md"}),s.jsx(we,{className:"size-6 rounded-md"}),s.jsx(we,{className:"size-6 rounded-md"})]}),s.jsx(we,{className:"h-6 w-20 rounded-md"})]}),t[1]=n):n=t[1];let r;return t[2]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[n,s.jsx("div",{className:"flex flex-col gap-0.5",children:Ua.map(qa)})]}),t[2]=r):r=t[2],r}function qa(t,e){return s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5",children:[s.jsx(we,{className:"size-5 rounded-full shrink-0"}),s.jsx(we,{className:Q("h-3",t.nameWidth,"rounded-sm")})]}),t.taskRows>0&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:Array.from({length:t.taskRows}).map(Wa)})]},e)}function Wa(t,e){return s.jsx("div",{className:"flex items-center gap-2 px-2 py-1.5",children:s.jsx(we,{className:"h-3 flex-1 rounded-sm"})},e)}function Ka(t,e){return s.jsx(we,{className:"size-10 rounded-lg mx-auto"},e)}function Va(){const t=N.c(4),e=Sn();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Ol,{}),t[0]=n):n=t[0];let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Vs,{children:s.jsxs(z.Suspense,{fallback:s.jsxs(s.Fragment,{children:[s.jsx(Rt,{className:"mb-2"}),s.jsx(Vn,{})]}),children:[s.jsx(Rt,{className:"mb-2"}),s.jsx(Kn,{})]})}),t[1]=r):r=t[1];let o;return t[2]!==e?(o=s.jsx(cn,{children:s.jsx(Cn,{sections:e,footer:n,additionalContent:r})}),t[2]=e,t[3]=o):o=t[3],o}function Ya(t){const e=N.c(9),{onClose:n}=t,r=Sn();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Pl,{}),e[0]=o):o=e[0];let i,l;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsxs(s.Fragment,{children:[s.jsx(Rt,{className:"mb-2"}),s.jsx(Vn,{})]}),l=s.jsx(Rt,{className:"mb-2"}),e[1]=i,e[2]=l):(i=e[1],l=e[2]);let a;e[3]!==n?(a=s.jsx(Vs,{children:s.jsxs(z.Suspense,{fallback:i,children:[l,s.jsx(Kn,{onNavigate:n})]})}),e[3]=n,e[4]=a):a=e[4];let c;return e[5]!==n||e[6]!==r||e[7]!==a?(c=s.jsx(cn,{children:s.jsx(tl,{sections:r,onClose:n,footer:o,additionalContent:a})}),e[5]=n,e[6]=r,e[7]=a,e[8]=c):c=e[8],c}const Xa="sidebar.open";function Qa(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Oi,{}),t[0]=e):e=t[0],e}function su(){const t=N.c(24),e=ds(),[n,r]=ls(Xa,!1),{width:o,wrapperRef:i,onStartResize:l,resetWidth:a}=Ri();let c;t[0]!==e?(c=e?s.jsxs(ce.Header,{className:"grid-cols-1 px-1 pr-1",children:[s.jsxs("div",{className:"grid w-full grid-cols-[auto_auto_auto_1fr_auto_auto_auto] items-center gap-2",children:[s.jsx(ce.LogoLink,{}),s.jsx(vs,{}),s.jsx(ns,{}),s.jsx("div",{"aria-hidden":!0,className:"min-w-0"}),s.jsx(ce.TogglesSlot,{}),s.jsx(ce.TabsSlot,{className:"min-w-0 justify-self-end"})]}),s.jsx(ce.CenterSlot,{}),s.jsx(ce.RightSlot,{})]}):s.jsxs(ce.Header,{children:[s.jsxs(ce.LeftColumn,{children:[s.jsx(ce.LogoLink,{}),s.jsx(vs,{}),s.jsx("span",{className:"hidden md:contents",children:s.jsx(ce.Nav,{})}),s.jsx(ce.TogglesSlot,{}),s.jsx(ns,{})]}),s.jsx(ce.CenterSlot,{}),s.jsxs(ce.RightColumn,{children:[s.jsx("div",{className:"min-w-0 flex-1 overflow-x-auto [scrollbar-width:none] flex justify-end",children:s.jsx(ce.TabsSlot,{})}),s.jsx(ce.RightSlot,{})]})]}),t[0]=e,t[1]=c):c=t[1];const d=`${o}px`;let u;t[2]!==d?(u={"--sidebar-width":d,"--sidebar-width-icon":"3.5rem"},t[2]=d,t[3]=u):u=t[3];const m=u;let f;t[4]!==e||t[5]!==l||t[6]!==a?(f=!e&&s.jsxs(s.Fragment,{children:[s.jsx(Va,{}),s.jsx(Pi,{onPointerDown:l,onDoubleClick:a})]}),t[4]=e,t[5]=l,t[6]=a,t[7]=f):f=t[7];let h;t[8]===Symbol.for("react.memo_cache_sentinel")?(h={background:"transparent",containerType:"inline-size"},t[8]=h):h=t[8];let p;t[9]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(Tr,{className:"flex flex-col",style:h,children:s.jsx("div",{className:"flex flex-col h-full min-h-0",children:s.jsx("div",{className:"relative flex-1 min-h-0 flex flex-row",children:s.jsx(z.Suspense,{fallback:s.jsx(Qa,{}),children:s.jsx(wr,{})})})})}),t[9]=p):p=t[9];let x;t[10]!==m||t[11]!==f||t[12]!==i?(x=s.jsxs($r,{ref:i,className:"flex-1 bg-sidebar relative min-h-0",style:m,children:[f,p]}),t[10]=m,t[11]=f,t[12]=i,t[13]=x):x=t[13];let g;t[14]!==e?(g=e&&s.jsx(Or,{renderSidebar:Ja}),t[14]=e,t[15]=g):g=t[15];let b;t[16]!==c||t[17]!==x||t[18]!==g?(b=s.jsx(fi,{children:s.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[c,x,g]})}),t[16]=c,t[17]=x,t[18]=g,t[19]=b):b=t[19];let j;return t[20]!==r||t[21]!==n||t[22]!==b?(j=s.jsx(eo,{children:s.jsx(ce.Provider,{children:s.jsx(Ar,{open:n,onOpenChange:r,children:b})})}),t[20]=r,t[21]=n,t[22]=b,t[23]=j):j=t[23],j}function Ja(t){const{onClose:e}=t;return s.jsx("div",{className:"flex h-full",children:s.jsx("div",{className:"w-full bg-sidebar flex flex-col overflow-y-auto group/sidebar","data-state":"expanded",children:s.jsx(Ya,{onClose:e})})})}export{su as default};
@@ -1 +0,0 @@
1
- import{am as st,c as k,j as n,r as $,w as J,m as xe,l as Q,i as le,an as Z,t as U,K as te,k as se,B as Y,d as nt,a7 as it,E as ot,a as rt}from"./index-BkSIY6JJ.js";import{u as ge}from"./use-mobile-CPyq18pe.js";import{u as lt}from"./useQueries-D96G2W1b.js";import{i as at,u as ae,m as ct,a as dt,S as mt}from"./use-mcp-client-DYpZuPPA.js";import{u as ut,b as ft,v as pt,a as ht}from"./use-virtual-mcp-DnY7c9gE.js";import{i as xt}from"./ChevronUp-BhWz3ylT.js";import{e as gt,A as ce,Y as yt,a8 as bt,D as jt,k as vt}from"./agent-icon-C6bJxQ04.js";import{s as ye}from"./Plus-jFajoMCA.js";import{i as $e}from"./X-B-cRV-7d.js";import{C as oe}from"./index-D7a1JQHt.js";import{b as Nt}from"./chat-context-DN0_9Gee.js";import{N as wt}from"./decopilot-BXlT8NLf.js";import{g as St,b as Ae,c as re,K as Pe,P as Ee,D as Me,d as _t,S as Ct,v as It,e as Tt,C as kt,s as $t,l as At,k as Pt,o as Et,u as Mt,j as zt,h as Ot}from"./sortable.esm-CbeYFn14.js";import{u as ze,a as Oe,o as Lt}from"./use-organization-settings-DFnXSR7Z.js";import{c as be,b as Dt,h as Ht}from"./shell-layout-CR4YIb2n.js";import{I as Le}from"./input-jkT1z5r1.js";import{S as Rt,t as je,P as Ft,j as Ut,s as Bt,g as Vt}from"./scroll-area-D51A_KQ5.js";import{S as Kt,a as qt,b as Wt,c as Gt,d as Qt}from"./sheet-CUfjkNRy.js";import{S as H}from"./skeleton-h95MLET_.js";import{t as De}from"./ChevronDown-BWfuTI7r.js";import{d as He}from"./ZoomOut-BdBjpsIq.js";import{g as Re,M as Jt}from"./types-Dw2dcWcn.js";import{I as Fe}from"./integration-icon-CZDEviNI.js";import{b as Xt,c as Zt,S as Yt,a as we,d as es}from"./select-Ct-_FhWe.js";import{T as ts}from"./textarea-BzYVaGJ0.js";import{u as Ue}from"./studio-tools-BgUSKeCY.js";import{a as ss}from"./use-mcp-tools-xhV-ENX5.js";import{i as ns}from"./XCircle-CkhBWURn.js";import{f as is}from"./tab-id-BptcWVWa.js";import{g as os}from"./use-mcp-prompts-BxOgLeZF.js";import{u as rs,w as ls}from"./hooks-chgqRyLj.js";import{a as as,g as cs,c as ds,b as ms,D as us}from"./dropdown-menu-CRyIPZil.js";import{s as fs}from"./Trash01-DI7qV1ow.js";import{a as ps,u as hs}from"./use-ai-providers-BcLob6tS.js";import{u as xs}from"./connect-desktop-dialog-ByWaevjw.js";import{a as gs}from"./toolbar-D5FkjLVB.js";import"./auth-B9Q1UUsp.js";import"./use-collections-yHRKnSEt.js";import"./AlertCircle-flSoo6uw.js";import"./Tool01-rx0lKYM8.js";import"./SwitchHorizontal01-CB5mOBIf.js";import"./Settings02-47eDNk4K.js";import"./ArrowUpRight-BeOMO89N.js";import"./ZapSquare-DdgE8vy-.js";import"./Users03-gvBLUtvG.js";import"./CheckCircle-B9ekAAw-.js";import"./ChevronLeft-BNcg18cx.js";import"./ChevronRight-ChYOVgWd.js";import"./DotsVertical-C0YWb9xq.js";import"./Stars02-DlImJz_z.js";import"./Eye-DWTUBTZ_.js";import"./Globe01-BgRW2EiE.js";import"./FilterLines-Djqj6uj_.js";import"./Star01-BrkbxV-A.js";import"./Globe04-XITcP2mp.js";import"./HardDrive-DS3VxDtU.js";import"./Key01-DX7L8s0Z.js";import"./LayoutLeft-BqtFvEWV.js";import"./LinkExternal01-Cf-6A1_h.js";import"./Monitor01-CZ30bS8J.js";import"./Sun-9FxiCes3.js";import"./Palette-Dy2dQgqx.js";import"./Play-DvFnuZIO.js";import"./SearchMd-uzKFlzQB.js";import"./Shield01-BgRa80OR.js";import"./Stars01-Daq_eW6a.js";import"./Upload01-Boqk1hvA.js";import"./User01-B3UbdHmL.js";import"./Users01-BUyczaeV.js";import"./XClose-Doj89HqF.js";import"./Zap-BCqTHl-x.js";import"./tooltip-CAEDbADy.js";import"./dialog-BLvz2lK8.js";import"./drawer-C4RJ4_GY.js";import"./collection-search-DbQr2iji.js";import"./form-CPJbrMq5.js";import"./label-CETsHBZ0.js";import"./tabs-CNnqe_sK.js";import"./toggle-group-BE1kDwdz.js";import"./popover-1pFpRX6s.js";import"./command-DyJgh8wP.js";import"./index-DAmj773w.js";import"./useInfiniteQuery-DlRMWoIP.js";import"./use-infinite-scroll-V4l3DQJD.js";import"./question-004-sINsf4GQ.js";import"./checkbox-Bi39v4Qa.js";import"./ai-providers-logos-DD3qZ33J.js";import"./avatar-oAcdiJ9v.js";import"./settings-section-D6f1v8Lb.js";import"./card-BIwENur_.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-DehsL0Sf.js";import"./use-registry-connections-Czx1u2H6.js";import"./use-connection-BPcAXa47.js";import"./extract-connection-data-iACc8UZO.js";import"./collection-tabs-D77_So6e.js";import"./badge-CpKEkIGn.js";import"./connection-form-helpers-CASdXQaW.js";import"./authenticate-and-persist-oauth-xCkDryiA.js";import"./mcp-oauth-BIBzZgcE.js";import"./useSuspenseInfiniteQuery-BjlxN-DZ.js";import"./required-auth-layout-DjRtF3m8.js";import"./use-org-sso-DGBv3Hvc.js";import"./use-clock-tick-DHvuEFIJ.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-DOTEBoID.js";import"./file-type-icon-Db262N7w.js";import"./content-blocks-o63cs2vh.js";import"./use-navigate-to-agent-Bhu6dr_a.js";import"./index-BdQq_4o_.js";import"./decopilot-sse-pool-CKTJhrtc.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";function ys(t,e){return lt({...t,queries:t.queries.map(s=>({...s,suspense:!0,throwOnError:st,enabled:!0,placeholderData:void 0}))},e)}function Be(t){const e=k.c(11),{properties:s,required:o,values:i,onChange:r}=t;let a;e[0]!==o?(a=o??[],e[0]=o,e[1]=a):a=e[1];let d;e[2]!==a?(d=new Set(a),e[2]=a,e[3]=d):d=e[3];const l=d;let m;e[4]!==s?(m=Object.entries(s),e[4]=s,e[5]=m):m=e[5];let c;return e[6]!==r||e[7]!==l||e[8]!==m||e[9]!==i?(c=n.jsx("div",{className:"flex flex-col gap-2",children:m.map(u=>{const[f,p]=u;return n.jsxs("div",{className:"flex flex-col gap-0.5",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("label",{className:"text-xs font-medium leading-none flex items-center gap-1",children:[f,l.has(f)&&n.jsx("span",{className:"text-red-500 text-[10px]",children:"*"})]}),n.jsx("span",{className:"text-[10px] text-muted-foreground font-mono",children:p.type})]}),p.description&&n.jsx("p",{className:"text-[10px] text-muted-foreground leading-snug",children:p.description}),n.jsx(bs,{type:p.type,fieldKey:f,value:i[f],onChange:h=>r(f,h)})]},f)})}),e[6]=r,e[7]=l,e[8]=m,e[9]=i,e[10]=c):c=e[10],c}function bs(t){const e=k.c(19),{type:s,fieldKey:o,value:i,onChange:r}=t;if(s==="object"||s==="array"){const c=i??"";let u;e[0]!==r?(u=h=>r(h.target.value),e[0]=r,e[1]=u):u=e[1];const f=`Enter ${o} as JSON…`;let p;return e[2]!==c||e[3]!==u||e[4]!==f?(p=n.jsx(ts,{className:"font-mono text-xs h-16",value:c,onChange:u,placeholder:f,rows:2}),e[2]=c,e[3]=u,e[4]=f,e[5]=p):p=e[5],p}if(s==="boolean"){const c=i!=null?String(i):"";let u;e[6]!==r?(u=x=>r(x==="true"),e[6]=r,e[7]=u):u=e[7];let f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(Xt,{className:"h-7 text-xs",children:n.jsx(Zt,{placeholder:"Select…"})}),e[8]=f):f=e[8];let p;e[9]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsxs(Yt,{children:[n.jsx(we,{value:"true",children:"true"}),n.jsx(we,{value:"false",children:"false"})]}),e[9]=p):p=e[9];let h;return e[10]!==c||e[11]!==u?(h=n.jsxs(es,{value:c,onValueChange:u,children:[f,p]}),e[10]=c,e[11]=u,e[12]=h):h=e[12],h}const a=i??"";let d;e[13]!==r?(d=c=>r(c.target.value),e[13]=r,e[14]=d):d=e[14];const l=`Enter ${o}…`;let m;return e[15]!==a||e[16]!==d||e[17]!==l?(m=n.jsx(Le,{className:"h-7 text-xs",value:a,onChange:d,placeholder:l}),e[15]=a,e[16]=d,e[17]=l,e[18]=m):m=e[18],m}const ne=8;function js(t){const e=k.c(16),{open:s,onOpenChange:o}=t,[i,r]=$.useState("");let a,d;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(Kt,{children:"Manage home"}),d=n.jsx(qt,{children:"Add agents to the home board and pin their interactive UIs or prompts."}),e[0]=a,e[1]=d):(a=e[0],d=e[1]);let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(gt,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none","aria-hidden":!0}),e[2]=l):l=e[2];let m;e[3]===Symbol.for("react.memo_cache_sentinel")?(m=x=>r(x.target.value),e[3]=m):m=e[3];let c;e[4]!==i?(c=n.jsxs(Wt,{className:"px-5 py-4 border-b border-border",children:[a,d,n.jsxs("div",{className:"relative mt-3",children:[l,n.jsx(Le,{value:i,onChange:m,placeholder:"Search agents…",className:"pl-8 h-8 text-sm"})]})]}),e[4]=i,e[5]=c):c=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(Js,{}),e[6]=u):u=e[6];let f;e[7]!==i?(f=n.jsx(Rt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"p-3 flex flex-col gap-4",children:n.jsx($.Suspense,{fallback:u,children:n.jsx(Ns,{search:i})})})}),e[7]=i,e[8]=f):f=e[8];let p;e[9]!==c||e[10]!==f?(p=n.jsxs(Gt,{side:"right",className:"w-full sm:max-w-md p-0 flex flex-col",children:[c,f]}),e[9]=c,e[10]=f,e[11]=p):p=e[11];let h;return e[12]!==o||e[13]!==s||e[14]!==p?(h=n.jsx(Qt,{open:s,onOpenChange:o,children:p}),e[12]=o,e[13]=s,e[14]=p,e[15]=h):h=e[15],h}function vs(t){const e=k.c(32),{org:s}=J(),o=ze();let i;e[0]!==o?.ids?(i=o?.ids??[],e[0]=o?.ids,e[1]=i):i=e[1];const r=i,a=Oe(),d=ft(),l=xe();let m;e[2]!==s||e[3]!==l?(m=()=>l.refetchQueries({queryKey:te.homeNextActions(s.slug),type:"active"}),e[2]=s,e[3]=l,e[4]=m):m=e[4];const c=m;let u;e[5]!==r?(u=_=>r.includes(_),e[5]=r,e[6]=u):u=e[6];const f=u;let p;e[7]!==r||e[8]!==t?(p=t?r.filter(_=>t.has(_)).length:r.length,e[7]=r,e[8]=t,e[9]=p):p=e[9];const x=p>=ne;let y;e[10]!==x||e[11]!==f||e[12]!==a?(y=_=>f(_)||x?Promise.resolve():a.apply(I=>I.includes(_)?null:[...I,_]),e[10]=x,e[11]=f,e[12]=a,e[13]=y):y=e[13];const b=y;let v;e[14]!==a?(v=_=>a.apply(I=>I.filter(T=>T!==_)),e[14]=a,e[15]=v):v=e[15];const N=v;let j;e[16]!==a?(j=_=>a.apply(()=>_),e[16]=a,e[17]=j):j=e[17];const g=j;let w;e[18]!==d||e[19]!==x||e[20]!==f||e[21]!==c||e[22]!==a?(w=async(_,I)=>{await d.update.mutateAsync({id:_.id,data:{metadata:I}}),!f(_.id)&&!x&&await a.apply(T=>T.includes(_.id)?null:[...T,_.id]),await c()},e[18]=d,e[19]=x,e[20]=f,e[21]=c,e[22]=a,e[23]=w):w=e[23];const S=w;let C;return e[24]!==b||e[25]!==x||e[26]!==r||e[27]!==f||e[28]!==N||e[29]!==g||e[30]!==S?(C={homeIds:r,isOnHome:f,atLimit:x,addAgent:b,removeAgent:N,reorder:g,saveAgentMetadata:S},e[24]=b,e[25]=x,e[26]=r,e[27]=f,e[28]=N,e[29]=g,e[30]=S,e[31]=C):C=e[31],C}function Ns(t){const e=k.c(21),{search:s}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={pageSize:1e3},e[0]=o):o=e[0];const i=ut(o);let r;e[1]!==i?(r=new Set(i.map(Is)),e[1]=i,e[2]=r):r=e[2];const a=vs(r);let d,l,m;if(e[3]!==i||e[4]!==a||e[5]!==s){const x=new Map(i.map(Cs));d=s.trim().toLowerCase();const y=N=>!d||N.title?.toLowerCase().includes(d);l=a.homeIds.map(N=>x.get(N)).filter(_s).filter(y);const b=St(i);let v;e[9]!==a?(v=N=>!a.isOnHome(N.id),e[9]=a,e[10]=v):v=e[10],m=i.filter(Ss).filter(N=>!b.has(N.id)).filter(v).filter(y).sort(ws),e[3]=i,e[4]=a,e[5]=s,e[6]=d,e[7]=l,e[8]=m}else d=e[6],l=e[7],m=e[8];const c=m;let u;e[11]!==a||e[12]!==l?(u=n.jsx(Ts,{home:a,agents:l}),e[11]=a,e[12]=l,e[13]=u):u=e[13];const f=!!d;let p;e[14]!==c||e[15]!==a||e[16]!==f?(p=n.jsx(As,{home:a,agents:c,hasSearch:f}),e[14]=c,e[15]=a,e[16]=f,e[17]=p):p=e[17];let h;return e[18]!==u||e[19]!==p?(h=n.jsxs(n.Fragment,{children:[u,p]}),e[18]=u,e[19]=p,e[20]=h):h=e[20],h}function ws(t,e){return(t.title??"").localeCompare(e.title??"")}function Ss(t){return t.id&&!at(t.id)}function _s(t){return!!t}function Cs(t){return[t.id,t]}function Is(t){return t.id}function Ve(t){const e=k.c(7),{title:s,hint:o}=t;let i;e[0]!==s?(i=n.jsx("span",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:s}),e[0]=s,e[1]=i):i=e[1];let r;e[2]!==o?(r=o&&n.jsx("span",{className:"text-xs text-muted-foreground",children:o}),e[2]=o,e[3]=r):r=e[3];let a;return e[4]!==i||e[5]!==r?(a=n.jsxs("div",{className:"flex items-center justify-between px-1",children:[i,r]}),e[4]=i,e[5]=r,e[6]=a):a=e[6],a}function Ts(t){const e=k.c(14),{home:s,agents:o}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={activationConstraint:{distance:5}},e[0]=i):i=e[0];let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r={coordinateGetter:$t},e[1]=r):r=e[1];const a=Ae(re(Ee,i),re(Pe,r));let d;e[2]!==s?(d=p=>{const{active:h,over:x}=p;if(!x||h.id===x.id)return;const y=s.homeIds,b=y.indexOf(h.id),v=y.indexOf(x.id);b===-1||v===-1||s.reorder(At([...y],b,v)).catch($s)},e[2]=s,e[3]=d):d=e[3];const l=d,m=`${s.homeIds.length}/${ne}`;let c;e[4]!==m?(c=n.jsx(Ve,{title:"On home",hint:m}),e[4]=m,e[5]=c):c=e[5];let u;e[6]!==o||e[7]!==l||e[8]!==s||e[9]!==a?(u=o.length===0?n.jsx("p",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:"No agents on the home yet."}):n.jsx(Me,{sensors:a,collisionDetection:_t,onDragEnd:l,children:n.jsx(Ct,{items:o.map(ks),strategy:It,children:n.jsx("div",{className:"flex flex-col gap-1",children:o.map(p=>n.jsx(Es,{agent:p,home:s},p.id))})})}),e[6]=o,e[7]=l,e[8]=s,e[9]=a,e[10]=u):u=e[10];let f;return e[11]!==c||e[12]!==u?(f=n.jsxs("div",{className:"flex flex-col gap-1.5",children:[c,u]}),e[11]=c,e[12]=u,e[13]=f):f=e[13],f}function ks(t){return t.id}function $s(){return U.error("Couldn't reorder home — please try again.")}function As(t){const e=k.c(6),{home:s,agents:o,hasSearch:i}=t,[r,a]=$.useState(20);let d;if(e[0]!==o||e[1]!==i||e[2]!==s||e[3]!==r){const l=o.slice(0,r);let m;e[5]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(Ve,{title:"Add to home"}),e[5]=m):m=e[5],d=n.jsxs("div",{className:"flex flex-col gap-1.5",children:[m,o.length===0?n.jsx("p",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:i?"No agents match.":"Every agent is on the home."}):n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"flex flex-col gap-1",children:l.map(c=>n.jsx(Os,{agent:c,home:s},c.id))}),o.length>r&&n.jsxs("button",{type:"button",onClick:()=>a(Ps),className:"mt-1 self-center rounded-md px-3 py-1.5 text-xs text-muted-foreground hover:bg-accent/40 hover:text-foreground",children:["Load more (",o.length-r,")"]})]})]}),e[0]=o,e[1]=i,e[2]=s,e[3]=r,e[4]=d}else d=e[4];return d}function Ps(t){return t+20}function Ke(t){const e=Z(t.metadata?.ui).filter(r=>!!r.resourceUri).length,s=t.metadata?.ui?.homePrompts,o=Array.isArray(s)?s.length:null,i=[];return e>0&&i.push(`${e} tile${e===1?"":"s"}`),o!==null&&o>0&&i.push(`${o} prompt${o===1?"":"s"}`),o===0&&i.push("prompts off"),i.join(" · ")}function Es(t){const e=k.c(57),{agent:s,home:o}=t,[i,r]=$.useState(!1);let a;e[0]!==s.id?(a={id:s.id},e[0]=s.id,e[1]=a):a=e[1];const{attributes:d,listeners:l,setNodeRef:m,transform:c,transition:u,isDragging:f}=Tt(a),p=Ke(s)||"Quick access";let h;e[2]!==c?(h=kt.Transform.toString(c),e[2]=c,e[3]=h):h=e[3];const x=f?.5:void 0,y=f?100:void 0;let b;e[4]!==h||e[5]!==x||e[6]!==y||e[7]!==u?(b={transform:h,transition:u,opacity:x,zIndex:y},e[4]=h,e[5]=x,e[6]=y,e[7]=u,e[8]=b):b=e[8];const v=b,N=f&&"shadow-lg";let j;e[9]!==N?(j=Q("rounded-lg border border-border bg-card",N),e[9]=N,e[10]=j):j=e[10];const g=`Drag to reorder ${s.title??s.id}`;let w;e[11]===Symbol.for("react.memo_cache_sentinel")?(w=n.jsx(He,{size:14}),e[11]=w):w=e[11];let S;e[12]!==d||e[13]!==l||e[14]!==g?(S=n.jsx("button",{type:"button",...d,...l,className:"shrink-0 text-muted-foreground hover:text-foreground cursor-grab active:cursor-grabbing outline-none focus-visible:ring-2 focus-visible:ring-ring rounded","aria-label":g,children:w}),e[12]=d,e[13]=l,e[14]=g,e[15]=S):S=e[15];let C;e[16]===Symbol.for("react.memo_cache_sentinel")?(C=()=>r(zs),e[16]=C):C=e[16];const _=s.title??s.id;let I;e[17]!==s.icon||e[18]!==_?(I=n.jsx(ce,{icon:s.icon,name:_,size:"sm"}),e[17]=s.icon,e[18]=_,e[19]=I):I=e[19];const T=s.title??s.id;let P;e[20]!==T?(P=n.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:T}),e[20]=T,e[21]=P):P=e[21];let M;e[22]!==p?(M=n.jsx("div",{className:"truncate text-xs text-muted-foreground",children:p}),e[22]=p,e[23]=M):M=e[23];let z;e[24]!==P||e[25]!==M?(z=n.jsxs("div",{className:"min-w-0 flex-1",children:[P,M]}),e[24]=P,e[25]=M,e[26]=z):z=e[26];const B=i&&"rotate-180";let O;e[27]!==B?(O=Q("shrink-0 text-muted-foreground transition-transform",B),e[27]=B,e[28]=O):O=e[28];let L;e[29]!==O?(L=n.jsx(De,{size:16,className:O}),e[29]=O,e[30]=L):L=e[30];let K;e[31]!==i||e[32]!==I||e[33]!==z||e[34]!==L?(K=n.jsxs("button",{type:"button",onClick:C,className:"flex min-w-0 flex-1 items-center gap-2.5 text-left outline-none","aria-expanded":i,children:[I,z,L]}),e[31]=i,e[32]=I,e[33]=z,e[34]=L,e[35]=K):K=e[35];let A;e[36]!==s.id||e[37]!==o?(A=()=>o.removeAgent(s.id).catch(Ms),e[36]=s.id,e[37]=o,e[38]=A):A=e[38];const V=`Remove ${s.title??s.id} from home`;let D;e[39]===Symbol.for("react.memo_cache_sentinel")?(D=n.jsx($e,{size:14}),e[39]=D):D=e[39];let E;e[40]!==A||e[41]!==V?(E=n.jsx("button",{type:"button",onClick:A,"aria-label":V,title:"Remove from home",className:"shrink-0 inline-flex size-7 items-center justify-center rounded-md text-muted-foreground hover:bg-destructive/10 hover:text-destructive",children:D}),e[40]=A,e[41]=V,e[42]=E):E=e[42];let R;e[43]!==S||e[44]!==K||e[45]!==E?(R=n.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-2.5",children:[S,K,E]}),e[43]=S,e[44]=K,e[45]=E,e[46]=R):R=e[46];let F;e[47]!==s||e[48]!==i||e[49]!==o?(F=i&&n.jsx(qe,{agent:s,home:o}),e[47]=s,e[48]=i,e[49]=o,e[50]=F):F=e[50];let W;return e[51]!==m||e[52]!==v||e[53]!==R||e[54]!==F||e[55]!==j?(W=n.jsxs("div",{ref:m,style:v,className:j,children:[R,F]}),e[51]=m,e[52]=v,e[53]=R,e[54]=F,e[55]=j,e[56]=W):W=e[56],W}function Ms(){return U.error("Couldn't remove from home — please try again.")}function zs(t){return!t}function Os({agent:t,home:e}){const[s,o]=$.useState(!1),[i,r]=$.useState(!1),a=Ke(t),d=async()=>{if(!e.atLimit){r(!0);try{await e.addAgent(t.id)}catch{U.error("Couldn't add to home — please try again.")}finally{r(!1)}}};return n.jsxs("div",{className:"rounded-lg border border-border bg-card",children:[n.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5",children:[n.jsxs("button",{type:"button",onClick:()=>o(l=>!l),className:"flex min-w-0 flex-1 items-center gap-3 text-left outline-none","aria-expanded":s,children:[n.jsx(ce,{icon:t.icon,name:t.title??t.id,size:"sm"}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:t.title??t.id}),a&&n.jsx("div",{className:"truncate text-xs text-muted-foreground",children:a})]}),n.jsx(De,{size:16,className:Q("shrink-0 text-muted-foreground transition-transform",s&&"rotate-180")})]}),n.jsx("button",{type:"button",onClick:d,disabled:i||e.atLimit,"aria-label":"Add to home",title:e.atLimit?`Home is full (${ne}) — remove an agent first`:"Add to home",className:"shrink-0 inline-flex size-7 items-center justify-center rounded-md bg-foreground text-background text-xs hover:opacity-90 disabled:opacity-40 disabled:cursor-not-allowed",children:i?n.jsx(le,{size:12,className:"animate-spin"}):n.jsx(ye,{size:14})})]}),s&&n.jsx(qe,{agent:t,home:e})]})}function qe(t){const e=k.c(17),{agent:s,home:o}=t,i=s.metadata?.ui;let r;e[0]!==i?(r=Z(i),e[0]=i,e[1]=r):r=e[1];const a=r;let d;e[2]!==s.connections?(d=(s.connections??[]).map(Ls).sort(),e[2]=s.connections,e[3]=d):d=e[3];const l=d,m=s.metadata?.ui?.homePrompts;let c;e[4]!==s||e[5]!==l||e[6]!==o||e[7]!==a?(c=n.jsx(Hs,{agent:s,home:o,connectionIds:l,pinnedTiles:a}),e[4]=s,e[5]=l,e[6]=o,e[7]=a,e[8]=c):c=e[8];let u;e[9]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(Ds,{}),e[9]=u):u=e[9];const f=m??null;let p;e[10]!==s||e[11]!==o||e[12]!==f?(p=n.jsx($.Suspense,{fallback:u,children:n.jsx(Vs,{agent:s,home:o,curated:f})}),e[10]=s,e[11]=o,e[12]=f,e[13]=p):p=e[13];let h;return e[14]!==c||e[15]!==p?(h=n.jsxs("div",{className:"border-t border-border px-3 py-2 flex flex-col gap-3",children:[c,p]}),e[14]=c,e[15]=p,e[16]=h):h=e[16],h}function Ls(t){return t.connection_id}function Ds(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsxs("div",{className:"flex flex-col gap-2 py-1",children:[n.jsx(H,{className:"h-8 w-full"}),n.jsx(H,{className:"h-8 w-2/3"})]}),t[0]=e):e=t[0],e}function Hs({agent:t,home:e,connectionIds:s,pinnedTiles:o}){const i=Ue(),{data:r,isLoading:a}=se({queryKey:te.projectConnectionDetails(t.id,s),enabled:s.length>0,queryFn:async()=>(await Promise.all(s.map(async u=>{try{const{item:f}=await i.call("COLLECTION_CONNECTIONS_GET",{id:u}),p=(f?.tools??[]).flatMap(h=>{const x=Re(h._meta);return x?[{name:h.name,description:h.description,resourceUri:x,inputSchema:h.inputSchema}]:[]});return{id:u,title:f?.title??u,icon:f?.icon??null,uiTools:p}}catch{return{id:u,title:u,icon:null,uiTools:[]}}}))).filter(u=>u.uiTools.length>0)});if(s.length===0)return null;if(a)return n.jsxs("div",{className:"flex flex-col gap-1 py-0.5",children:[n.jsx(H,{className:"h-7 w-full"}),n.jsx(H,{className:"h-7 w-2/3"})]});if(!r||r.length===0)return null;const d=new Map;for(const c of r)for(const u of c.uiTools)d.set(`${c.id}:${u.name}`,{conn:c,tool:u});const l=c=>{if(c.toolName&&c.connectionId)return d.get(`${c.connectionId}:${c.toolName}`);for(const[,u]of d)if(u.conn.id===c.connectionId&&u.tool.resourceUri===c.resourceUri)return u},m=o.some(c=>!!l(c));return n.jsxs("div",{className:"flex flex-col gap-2",children:[m&&n.jsxs("div",{className:"flex flex-col gap-0.5",children:[n.jsx("span",{className:"text-[10px] font-medium uppercase tracking-wide text-muted-foreground px-2",children:"Pinned tiles"}),o.map(c=>{const u=l(c);return u?n.jsx(Us,{agent:t,home:e,connection:u.conn,tool:u.tool,tile:c},c.tileId??`${c.connectionId}:${c.resourceUri}:${c.toolName}`):null})]}),n.jsxs("div",{className:"flex flex-col gap-0.5",children:[n.jsx("span",{className:"text-[10px] font-medium uppercase tracking-wide text-muted-foreground px-2",children:"Add tile"}),r.map(c=>c.uiTools.map(u=>n.jsx(Bs,{agent:t,home:e,connection:c,tool:u},`add:${c.id}:${u.name}`)))]})]})}function We(t,e){const s={};for(const[o,i]of Object.entries(t)){const r=e[o]?.type;if((r==="object"||r==="array")&&typeof i=="string"){if(!i.trim())continue;try{s[o]=JSON.parse(i)}catch{return null}}else if((r==="number"||r==="integer")&&typeof i=="string"){if(!i.trim())continue;s[o]=Number(i)}else i!==""&&i!=null&&(s[o]=i)}return s}function Rs(t,e){if(!t||!e)return{};const s={};for(const[o,i]of Object.entries(t)){const r=e[o]?.type;(r==="object"||r==="array")&&i!=null&&typeof i!="string"?s[o]=JSON.stringify(i,null,2):s[o]=i}return s}function Fs(t){if(!t)return"";const e=Object.entries(t).filter(([,s])=>s!=null&&s!=="");return e.length===0?"":e.slice(0,3).map(([s,o])=>{const i=typeof o=="object"?JSON.stringify(o):String(o);return`${s}=${i.length>20?`${i.slice(0,20)}…`:i}`}).join(", ")}function Us({agent:t,home:e,connection:s,tool:o,tile:i}){const[r,a]=$.useState(!1),[d,l]=$.useState(!1),m=o.inputSchema?.properties&&Object.keys(o.inputSchema.properties).length>0,[c,u]=$.useState(()=>Rs(i.toolInput,o.inputSchema?.properties)),f=async()=>{a(!0);try{const x=Z(t.metadata?.ui),y=i.tileId?x.filter(v=>v.tileId!==i.tileId):x.filter(v=>v!==i),b={...t.metadata??{},ui:{...t.metadata?.ui??{},homeTile:null,homeTiles:y}};await e.saveAgentMetadata(t,b),l(!1)}catch(x){console.error("[home-tiles] failed to remove tile",x),U.error("Couldn't update home — please try again.")}finally{a(!1)}},p=async()=>{a(!0);try{let x;if(m&&o.inputSchema?.properties){const N=We(c,o.inputSchema.properties);if(!N){U.error("Invalid JSON in one of the fields — please fix it."),a(!1);return}Object.keys(N).length>0&&(x=N)}const b=Z(t.metadata?.ui).map(N=>(i.tileId?N.tileId===i.tileId:N===i)?{...N,toolInput:x}:N),v={...t.metadata??{},ui:{...t.metadata?.ui??{},homeTile:null,homeTiles:b}};await e.saveAgentMetadata(t,v),l(!1)}catch(x){console.error("[home-tiles] failed to save tile",x),U.error("Couldn't update home — please try again.")}finally{a(!1)}},h=Fs(i.toolInput);return n.jsxs("div",{className:"flex flex-col rounded-md bg-accent/20",children:[n.jsxs("div",{className:"flex items-center gap-2.5 px-2 py-1",children:[n.jsx(Fe,{icon:s.icon,name:s.title,size:"xs"}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("div",{className:"truncate text-sm text-foreground",children:je(o.name)}),h&&n.jsx("div",{className:"truncate text-[10px] text-muted-foreground font-mono",children:h})]}),m&&n.jsx("button",{type:"button",onClick:()=>l(x=>!x),"aria-label":"Configure tile props",title:"Configure tile props",className:"inline-flex size-7 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-accent/60",children:n.jsx(yt,{size:14})}),n.jsx(ve,{isPinned:!0,submitting:r,onClick:f,label:"Remove from home"})]}),d&&m&&o.inputSchema?.properties&&n.jsxs("div",{className:"px-3 pb-2 pt-1 flex flex-col gap-2",children:[n.jsx(Be,{properties:o.inputSchema.properties,required:o.inputSchema.required,values:c,onChange:(x,y)=>u(b=>({...b,[x]:y}))}),n.jsxs("div",{className:"flex items-center gap-2 justify-end",children:[n.jsx(Y,{variant:"ghost",size:"sm",className:"h-7 text-xs",onClick:()=>l(!1),children:"Cancel"}),n.jsx(Y,{size:"sm",className:"h-7 text-xs",disabled:r,onClick:p,children:r?n.jsx(le,{size:12,className:"animate-spin"}):"Save"})]})]})]})}function Bs({agent:t,home:e,connection:s,tool:o}){const[i,r]=$.useState(!1),[a,d]=$.useState(!1),l=o.inputSchema?.properties&&Object.keys(o.inputSchema.properties).length>0,[m,c]=$.useState({}),u=async()=>{if(l&&!a){d(!0);return}if(!e.isOnHome(t.id)&&e.atLimit){U.error(`Home is full (${ne}) — remove an agent first`);return}await f()},f=async()=>{r(!0);try{let p;if(l&&o.inputSchema?.properties){const b=We(m,o.inputSchema.properties);if(!b){U.error("Invalid JSON in one of the fields — please fix it."),r(!1);return}Object.keys(b).length>0&&(p=b)}const x=[...Z(t.metadata?.ui),{tileId:crypto.randomUUID(),connectionId:s.id,resourceUri:o.resourceUri,toolName:o.name,...p?{toolInput:p}:{}}],y={...t.metadata??{},ui:{...t.metadata?.ui??{},homeTile:null,homeTiles:x}};await e.saveAgentMetadata(t,y),d(!1),c({})}catch(p){console.error("[home-tiles] failed to add tile",p),U.error("Couldn't update home — please try again.")}finally{r(!1)}};return n.jsxs("div",{className:"flex flex-col rounded-md hover:bg-accent/40",children:[n.jsxs("div",{className:"flex items-center gap-2.5 px-2 py-1",children:[n.jsx(Fe,{icon:s.icon,name:s.title,size:"xs"}),n.jsx("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:je(o.name)}),n.jsx(ve,{isPinned:!1,submitting:i,onClick:u,label:"Add to home"})]}),a&&l&&o.inputSchema?.properties&&n.jsxs("div",{className:"px-3 pb-2 pt-1 flex flex-col gap-2",children:[n.jsx(Be,{properties:o.inputSchema.properties,required:o.inputSchema.required,values:m,onChange:(p,h)=>c(x=>({...x,[p]:h}))}),n.jsxs("div",{className:"flex items-center gap-2 justify-end",children:[n.jsx(Y,{variant:"ghost",size:"sm",className:"h-7 text-xs",onClick:()=>{d(!1),c({})},children:"Cancel"}),n.jsx(Y,{size:"sm",className:"h-7 text-xs",disabled:i,onClick:f,children:i?n.jsx(le,{size:12,className:"animate-spin"}):"Pin"})]})]})]})}function ve(t){const e=k.c(11),{isPinned:s,submitting:o,onClick:i,label:r}=t,a=s?"text-muted-foreground hover:bg-destructive/10 hover:text-destructive":"bg-foreground text-background hover:opacity-90";let d;e[0]!==a?(d=Q("inline-flex size-7 shrink-0 items-center justify-center rounded-md text-xs transition-colors disabled:opacity-50 disabled:cursor-progress",a),e[0]=a,e[1]=d):d=e[1];let l;e[2]!==s||e[3]!==o?(l=o?n.jsx(le,{size:12,className:"animate-spin"}):s?n.jsx(bt,{size:14}):n.jsx(ye,{size:14}),e[2]=s,e[3]=o,e[4]=l):l=e[4];let m;return e[5]!==r||e[6]!==i||e[7]!==o||e[8]!==d||e[9]!==l?(m=n.jsx("button",{type:"button",onClick:i,disabled:o,"aria-label":r,title:r,className:d,children:l}),e[5]=r,e[6]=i,e[7]=o,e[8]=d,e[9]=l,e[10]=m):m=e[10],m}function Vs(t){const e=k.c(32),{agent:s,home:o,curated:i}=t,{org:r}=J();let a;e[0]!==s.id||e[1]!==r.id||e[2]!==r.slug?(a={connectionId:s.id,orgId:r.id,orgSlug:r.slug},e[0]=s.id,e[1]=r.id,e[2]=r.slug,e[3]=a):a=e[3];const d=ae(a);let l;e[4]!==s.id||e[5]!==r.id?(l=te.agentPrompts(r.id,s.id),e[4]=s.id,e[5]=r.id,e[6]=l):l=e[6];let m;e[7]!==d?(m=async()=>{const{prompts:g}=await d.listPrompts();return g.map(Gs)},e[7]=d,e[8]=m):m=e[8];let c;e[9]!==l||e[10]!==m?(c={queryKey:l,queryFn:m,staleTime:3e4,retry:!1},e[9]=l,e[10]=m,e[11]=c):c=e[11];const{data:u,isLoading:f,error:p}=se(c),h=be(r.slug);let x,y;if(e[12]!==s.id||e[13]!==u||e[14]!==h.prompts){let g;e[17]!==s.id?(g=S=>S.agentId===s.id&&S.promptName,e[17]=s.id,e[18]=g):g=e[18],x=h.prompts.filter(g).map(Ws);let w;e[19]!==u?(w=u??[],e[19]=u,e[20]=w):w=e[20],y=[...w];for(const S of x)y.some(C=>C.name===S.name)||y.push(S);e[12]=s.id,e[13]=u,e[14]=h.prompts,e[15]=x,e[16]=y}else x=e[15],y=e[16];if(f&&x.length===0){let g;return e[21]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx(H,{className:"h-7 w-full"}),n.jsx(H,{className:"h-7 w-2/3"})]}),e[21]=g):g=e[21],g}if(p&&x.length===0)return console.error("[home-tiles] listPrompts failed for agent",s.id,p),null;if(y.length===0)return null;let b;e[22]!==i||e[23]!==y?(b=i??y.map(qs),e[22]=i,e[23]=y,e[24]=b):b=e[24];let v;e[25]!==b?(v=new Set(b),e[25]=b,e[26]=v):v=e[26];const N=v;let j;return e[27]!==s||e[28]!==o||e[29]!==y||e[30]!==N?(j=n.jsx("div",{className:"flex flex-col gap-0.5",children:y.map(g=>n.jsx(Qs,{agent:s,home:o,prompt:g,allPromptNames:y.map(Ks),isPinned:N.has(g.name)},g.name))}),e[27]=s,e[28]=o,e[29]=y,e[30]=N,e[31]=j):j=e[31],j}function Ks(t){return t.name}function qs(t){return t.name}function Ws(t){return{name:t.promptName,title:t.title,description:t.description}}function Gs(t){return{name:t.name,title:t.title,description:t.description}}function Qs({agent:t,home:e,prompt:s,allPromptNames:o,isPinned:i}){const[r,a]=$.useState(!1),d=async()=>{if(!i&&!e.isOnHome(t.id)&&e.atLimit){U.error(`Home is full (${ne}) — remove an agent first`);return}a(!0);try{const l=t.metadata?.ui?.homePrompts;let m;Array.isArray(l)?m=i?l.filter(u=>u!==s.name):[...l,s.name]:m=i?o.filter(u=>u!==s.name):o;const c={...t.metadata??{},ui:{...t.metadata?.ui??{},homePrompts:m}};await e.saveAgentMetadata(t,c)}catch(l){console.error("[home-tiles] failed to toggle prompt",l),U.error("Couldn't update home — please try again.")}finally{a(!1)}};return n.jsxs("div",{className:"flex items-center gap-2.5 rounded-md px-2 py-1 hover:bg-accent/40",children:[n.jsx("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:s.title??je(s.name)}),n.jsx(ve,{isPinned:i,submitting:r,onClick:d,label:i?"Remove from home":"Add to home"})]})}function Js(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"flex flex-col gap-2 p-2",children:Array.from({length:4},Xs)}),t[0]=e):e=t[0],e}function Xs(t,e){return n.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-border p-2.5",children:[n.jsx(H,{className:"size-8 rounded-md"}),n.jsxs("div",{className:"flex-1 space-y-1.5",children:[n.jsx(H,{className:"h-3 w-1/2"}),n.jsx(H,{className:"h-2.5 w-1/3"})]})]},e)}const ee=1,Ge=`home-board.layout.v${ee}`;function Qe(t){return`home-board.layout.v${ee}.${t}`}const Je={version:ee,tiles:{},hidden:[]};function fe(t){return!t||t.version!==ee?Je:{version:ee,tiles:t.tiles??{},hidden:Array.isArray(t.hidden)?t.hidden:[]}}function Zs(t){return Object.keys(t.tiles).length>0||t.hidden.length>0}function Ys(t){try{const e=localStorage.getItem(Qe(t));return e?fe(JSON.parse(e)):void 0}catch{return}}function Se(t,e){try{localStorage.setItem(Qe(t),JSON.stringify(e))}catch{}}async function _e(t,e){if(!(await fetch(`/api/${t}/kv/${Ge}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok)throw new Error("Failed to save board layout")}function en(t){const e=k.c(24),s=xe();let o;e[0]!==t?(o=te.boardLayout(t),e[0]=t,e[1]=o):o=e[1];const i=o;let r;e[2]!==t?(r=Ys(t),e[2]=t,e[3]=r):r=e[3];const a=r;let d;e[4]!==a||e[5]!==t?(d=async()=>{const b=await fetch(`/api/${t}/kv/${Ge}`);if(b.status===404)return a&&Zs(a)?(await _e(t,a),a):Je;if(!b.ok)throw new Error("Failed to load board layout");const v=await b.json(),N=fe(v.value);return Se(t,N),N},e[4]=a,e[5]=t,e[6]=d):d=e[6];let l;e[7]!==a||e[8]!==i||e[9]!==d?(l={queryKey:i,queryFn:d,initialData:a,staleTime:0,refetchOnWindowFocus:!1},e[7]=a,e[8]=i,e[9]=d,e[10]=l):l=e[10];const{data:m,isLoading:c}=se(l);let u;e[11]!==t?(u={mutationFn:b=>_e(t,b)},e[11]=t,e[12]=u):u=e[12];const f=nt(u);let p;e[13]!==f||e[14]!==t||e[15]!==s||e[16]!==i?(p=b=>{Se(t,b),s.setQueryData(i,b),f.mutate(b)},e[13]=f,e[14]=t,e[15]=s,e[16]=i,e[17]=p):p=e[17];const h=p;let x;e[18]!==m?(x=fe(m),e[18]=m,e[19]=x):x=e[19];let y;return e[20]!==c||e[21]!==h||e[22]!==x?(y={layout:x,isLoading:c,save:h},e[20]=c,e[21]=h,e[22]=x,e[23]=y):y=e[23],y}const Xe=$.createContext(null);function tn(t){const e=k.c(24),{children:s}=t,{org:o}=J(),i=en(o.slug),[r,a]=$.useState(!1),[d,l]=$.useState(null);let m;e[0]!==i.layout?(m=()=>{l(i.layout),a(!0)},e[0]=i.layout,e[1]=m):m=e[1];const c=m;let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=()=>{l(null),a(!1)},e[2]=u):u=e[2];const f=u;let p;e[3]!==d||e[4]!==i?(p=()=>{d&&i.save(d),l(null),a(!1)},e[3]=d,e[4]=i,e[5]=p):p=e[5];const h=p,x=r&&d!==null,y=x?d:i.layout;let b;e[6]!==d||e[7]!==x||e[8]!==i.layout?(b=x?JSON.stringify(d)!==JSON.stringify(i.layout):!1,e[6]=d,e[7]=x,e[8]=i.layout,e[9]=b):b=e[9];const v=b;let N;e[10]!==r||e[11]!==i?(N=S=>{r?l(S):i.save(S)},e[10]=r,e[11]=i,e[12]=N):N=e[12];const j=N;let g;e[13]!==j||e[14]!==c||e[15]!==v||e[16]!==r||e[17]!==y||e[18]!==h||e[19]!==i.isLoading?(g={isEditMode:r,enter:c,cancel:f,save:h,hasChanges:v,layout:y,isLayoutLoading:i.isLoading,commitLayout:j},e[13]=j,e[14]=c,e[15]=v,e[16]=r,e[17]=y,e[18]=h,e[19]=i.isLoading,e[20]=g):g=e[20];let w;return e[21]!==s||e[22]!==g?(w=n.jsx(Xe.Provider,{value:g,children:s}),e[21]=s,e[22]=g,e[23]=w):w=e[23],w}function Ze(){const t=$.useContext(Xe);if(!t)throw new Error("useHomeEdit must be used within a HomeEditProvider");return t}function sn({agentId:t}){const{org:e,locator:s}=J(),o=ae({connectionId:t,orgId:e.id,orgSlug:e.slug}),{create:i}=rs(),{setTaskId:r}=Dt(),[a,d]=$.useState(null),[l,m]=$.useState(!1),c=$.useRef(!1),u=async(y,b)=>{if(!o){U.error("MCP client not available");return}if(!c.current){c.current=!0,m(!0);try{const v=await os(o,y.name,b),N={type:"doc",content:[{type:"paragraph",content:[Ut({id:y.name,name:Bt(y.name,Vt(y._meta)),metadata:v.messages,char:"/",kind:"prompt",args:b}),{type:"text",text:" "}]}]},j=crypto.randomUUID();ls(sessionStorage,s,j,{tiptapDoc:N}),await i({id:j,virtual_mcp_id:t}),r(j,t,{autosend:!0})}catch(v){console.error("[start-thread-from-prompt] failed",v),U.error("Failed to start thread. Please try again.")}finally{c.current=!1,m(!1)}}},f=async y=>{if(!c.current){if(y.arguments&&y.arguments.length>0){d(y);return}await u(y)}},p=async y=>{if(!a)return;const b=a;d(null),await u(b,y)};return{start:f,startBlank:async y=>{if(!c.current){c.current=!0,m(!0);try{const b=crypto.randomUUID();await i({id:b,virtual_mcp_id:t}),r(b,t,y?.main?{main:y.main}:void 0)}catch(b){console.error("[start-thread-from-prompt] startBlank failed",b),U.error("Failed to start thread. Please try again.")}finally{c.current=!1,m(!1)}}},dialog:n.jsx(Ft,{prompt:a,setPrompt:y=>d(y),onSubmit:p}),dialogPrompt:a,starting:l}}const q=4,G=100,Ce=12,nn=5,on={w:2,h:2};class pe extends $.Component{state={hasError:!1};static getDerivedStateFromError(e){return{hasError:!0,message:e instanceof Error?e.message:"Unknown error"}}componentDidCatch(e,s){console.error("[home-tiles] tile crashed:",e,s.componentStack)}render(){return this.state.hasError?n.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2 p-4 text-center",children:[n.jsx("span",{className:"flex size-8 items-center justify-center rounded-md bg-destructive/10 text-destructive",children:n.jsx(it,{size:16})}),n.jsx("p",{className:"text-sm font-medium text-foreground",children:"This tile crashed"}),n.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:this.state.message??"Something went wrong rendering this tile."})]}):this.props.children}}function rn(t){const e=k.c(72),{tiles:s,isEditMode:o,renderTile:i,onMove:r,onResize:a,onRemove:d}=t,l=ge(),m=$.useRef(null),[c,u]=$.useState(null),[f,p]=$.useState(null);let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h={activationConstraint:{distance:4}},e[0]=h):h=e[0];const x=Ae(re(Ee,h),re(Pe)),y=s.reduce(ln,0),b=o?Math.max(y+2,4):Math.max(y,1);let v;e[1]===Symbol.for("react.memo_cache_sentinel")?(v=()=>{const A=m.current?.getBoundingClientRect();return A?{cellWidth:A.width/q,cellHeight:G}:null},e[1]=v):v=e[1];const N=v;let j;e[2]===Symbol.for("react.memo_cache_sentinel")?(j=A=>{u(String(A.active.id)),p(N())},e[2]=j):j=e[2];const g=j;let w;e[3]!==f||e[4]!==r||e[5]!==s?(w=A=>{const V=String(A.active.id),D=f??N();if(u(null),p(null),!D||D.cellWidth<=0)return;const E=s.find(W=>W.id===V);if(!E)return;const R=Math.round(A.delta.x/D.cellWidth),F=Math.round(A.delta.y/D.cellHeight);R===0&&F===0||r(V,{x:E.x+R,y:E.y+F})},e[3]=f,e[4]=r,e[5]=s,e[6]=w):w=e[6];const S=w;if(l){let A;if(e[7]!==i||e[8]!==s){let D;e[10]!==i?(D=E=>n.jsx("div",{className:"group bg-card card-shadow rounded-2xl overflow-hidden",style:{minHeight:G},children:n.jsx(pe,{children:i(E)})},E.id),e[10]=i,e[11]=D):D=e[11],A=s.map(D),e[7]=i,e[8]=s,e[9]=A}else A=e[9];let V;return e[12]!==A?(V=n.jsx("div",{className:"flex flex-col gap-3 px-4 pb-8",children:A}),e[12]=A,e[13]=V):V=e[13],V}let C,_,I,T,P,M,z,B,O;if(e[14]!==c||e[15]!==f||e[16]!==o||e[17]!==S||e[18]!==d||e[19]!==a||e[20]!==i||e[21]!==x||e[22]!==s||e[23]!==b){const A=c?s.find(X=>X.id===c):null;_=Me,B=x,O=g,I=S;const V=b*G,D=o?G*4:G;let E;e[33]!==V||e[34]!==D?(E={height:V,minHeight:D},e[33]=V,e[34]=D,e[35]=E):E=e[35];let R;e[36]!==o||e[37]!==s||e[38]!==b?(R=o&&n.jsx(an,{rows:b,tiles:s}),e[36]=o,e[37]=s,e[38]=b,e[39]=R):R=e[39];let F;if(e[40]!==c||e[41]!==o||e[42]!==d||e[43]!==a||e[44]!==i||e[45]!==s){let X;e[47]!==c||e[48]!==o||e[49]!==d||e[50]!==a||e[51]!==i?(X=ie=>n.jsx(dn,{tile:ie,isEditMode:o,isDragging:c===ie.id,onResize:a,onRemove:d,children:i(ie)},ie.id),e[47]=c,e[48]=o,e[49]=d,e[50]=a,e[51]=i,e[52]=X):X=e[52],F=s.map(X),e[40]=c,e[41]=o,e[42]=d,e[43]=a,e[44]=i,e[45]=s,e[46]=F}else F=e[46];e[53]!==E||e[54]!==R||e[55]!==F?(T=n.jsxs("div",{ref:m,className:"relative w-full",style:E,children:[R,F]}),e[53]=E,e[54]=R,e[55]=F,e[56]=T):T=e[56],C=Pt,P=null;const W=A&&f?A.w*f.cellWidth-Ce:void 0,de=A&&f?A.h*f.cellHeight-Ce:void 0;e[57]!==W||e[58]!==de?(M={width:W,height:de},e[57]=W,e[58]=de,e[59]=M):M=e[59],z=A&&n.jsx("div",{className:"bg-card card-shadow rounded-2xl shadow-2xl ring-2 ring-primary/40 h-full overflow-hidden opacity-95",children:n.jsx(pe,{children:i(A)})}),e[14]=c,e[15]=f,e[16]=o,e[17]=S,e[18]=d,e[19]=a,e[20]=i,e[21]=x,e[22]=s,e[23]=b,e[24]=C,e[25]=_,e[26]=I,e[27]=T,e[28]=P,e[29]=M,e[30]=z,e[31]=B,e[32]=O}else C=e[24],_=e[25],I=e[26],T=e[27],P=e[28],M=e[29],z=e[30],B=e[31],O=e[32];let L;e[60]!==C||e[61]!==P||e[62]!==M||e[63]!==z?(L=n.jsx(C,{dropAnimation:P,style:M,children:z}),e[60]=C,e[61]=P,e[62]=M,e[63]=z,e[64]=L):L=e[64];let K;return e[65]!==_||e[66]!==I||e[67]!==T||e[68]!==L||e[69]!==B||e[70]!==O?(K=n.jsxs(_,{sensors:B,onDragStart:O,onDragEnd:I,children:[T,L]}),e[65]=_,e[66]=I,e[67]=T,e[68]=L,e[69]=B,e[70]=O,e[71]=K):K=e[71],K}function ln(t,e){return Math.max(t,e.y+e.h)}function an(t){const e=k.c(7),{rows:s,tiles:o}=t;let i;e[0]!==o?(i=(l,m)=>o.some(c=>l>=c.x&&l<c.x+c.w&&m>=c.y&&m<c.y+c.h),e[0]=o,e[1]=i):i=e[1];const r=i;let a;if(e[2]!==r||e[3]!==s){a=[];for(let l=0;l<s;l++)for(let m=0;m<q;m++)r(m,l)||a.push({x:m,y:l});e[2]=r,e[3]=s,e[4]=a}else a=e[4];let d;return e[5]!==a?(d=n.jsx("div",{className:"absolute inset-0 pointer-events-none",children:a.map(cn)}),e[5]=a,e[6]=d):d=e[6],d}function cn(t){return n.jsx("div",{className:"absolute p-1",style:{left:`${t.x/q*100}%`,top:t.y*G,width:`${1/q*100}%`,height:G},children:n.jsx("div",{className:"h-full w-full rounded-2xl border border-dashed border-border/60"})},`${t.x}-${t.y}`)}function dn(t){const e=k.c(31),{tile:s,isEditMode:o,isDragging:i,onResize:r,onRemove:a,children:d}=t,l=!o;let m;e[0]!==l||e[1]!==s.id?(m={id:s.id,disabled:l},e[0]=l,e[1]=s.id,e[2]=m):m=e[2];const{setNodeRef:c,attributes:u,listeners:f,isDragging:p}=Et(m),h=`${s.x/q*100}%`,x=`${s.w/q*100}%`,y=s.y*G,b=s.h*G,v=p||i,N=!v&&"transition-[left,top,width,height,opacity] duration-200 ease-out",j=v&&"opacity-30";let g;e[3]!==N||e[4]!==j?(g=Q("absolute p-1 will-change-[left,top,width,height,opacity]",N,j),e[3]=N,e[4]=j,e[5]=g):g=e[5];let w;e[6]!==b||e[7]!==h||e[8]!==y||e[9]!==x?(w={left:h,top:y,width:x,height:b},e[6]=b,e[7]=h,e[8]=y,e[9]=x,e[10]=w):w=e[10];const S=o&&"outline outline-1 outline-transparent hover:outline-primary/40";let C;e[11]!==S?(C=Q("group relative h-full bg-card card-shadow rounded-2xl overflow-hidden",S),e[11]=S,e[12]=C):C=e[12];let _;e[13]!==u||e[14]!==o||e[15]!==f||e[16]!==a||e[17]!==r||e[18]!==s?(_=o&&n.jsxs(n.Fragment,{children:[n.jsx("button",{type:"button",...u,...f,className:"absolute top-2 left-2 z-10 flex size-8 items-center justify-center rounded-md bg-background/90 border border-border text-muted-foreground hover:text-foreground hover:bg-muted cursor-grab active:cursor-grabbing","aria-label":"Drag tile",children:n.jsx(He,{size:16})}),n.jsx("div",{className:"absolute top-2 right-2 z-10 flex items-center gap-1",children:n.jsx(mn,{tile:s,onResize:r,onRemove:a})})]}),e[13]=u,e[14]=o,e[15]=f,e[16]=a,e[17]=r,e[18]=s,e[19]=_):_=e[19];let I;e[20]!==d?(I=n.jsx("div",{className:"h-full overflow-hidden",children:n.jsx(pe,{children:d})}),e[20]=d,e[21]=I):I=e[21];let T;e[22]!==I||e[23]!==C||e[24]!==_?(T=n.jsxs("div",{className:C,children:[_,I]}),e[22]=I,e[23]=C,e[24]=_,e[25]=T):T=e[25];let P;return e[26]!==c||e[27]!==T||e[28]!==g||e[29]!==w?(P=n.jsx("div",{ref:c,className:g,style:w,children:T}),e[26]=c,e[27]=T,e[28]=g,e[29]=w,e[30]=P):P=e[30],P}function mn(t){const e=k.c(20),{tile:s,onResize:o,onRemove:i}=t,[r,a]=$.useState(!1);let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(as,{asChild:!0,children:n.jsx("button",{type:"button",className:"flex size-8 items-center justify-center rounded-md bg-background/90 border border-border text-muted-foreground hover:text-foreground hover:bg-muted","aria-label":"Tile options",children:n.jsx(jt,{size:16})})}),e[0]=d):d=e[0];let l;e[1]!==o||e[2]!==s.id?(l=y=>{o(s.id,y),a(!1)},e[1]=o,e[2]=s.id,e[3]=l):l=e[3];let m;e[4]!==l||e[5]!==s?(m=n.jsx(un,{tile:s,onPick:l}),e[4]=l,e[5]=s,e[6]=m):m=e[6];let c;e[7]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(cs,{}),e[7]=c):c=e[7];let u;e[8]!==i||e[9]!==s.id?(u=()=>i(s.id),e[8]=i,e[9]=s.id,e[10]=u):u=e[10];let f;e[11]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(fs,{size:14,className:"mr-2"}),e[11]=f):f=e[11];let p;e[12]!==u?(p=n.jsxs(ds,{onSelect:u,className:"text-destructive focus:text-destructive",children:[f,"Remove tile"]}),e[12]=u,e[13]=p):p=e[13];let h;e[14]!==m||e[15]!==p?(h=n.jsxs(ms,{align:"end",className:"w-auto",children:[m,c,p]}),e[14]=m,e[15]=p,e[16]=h):h=e[16];let x;return e[17]!==r||e[18]!==h?(x=n.jsxs(us,{open:r,onOpenChange:a,children:[d,h]}),e[17]=r,e[18]=h,e[19]=x):x=e[19],x}function un(t){const e=k.c(19),{tile:s,onPick:o}=t,i=s.minW??1,r=s.minH??1,[a,d]=$.useState(null);let l;e[0]!==a||e[1]!==s.h||e[2]!==s.w?(l=a??{w:s.w,h:s.h},e[0]=a,e[1]=s.h,e[2]=s.w,e[3]=l):l=e[3];const m=l;let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx("span",{className:"text-xs text-muted-foreground",children:"Size"}),e[4]=c):c=e[4];let u;e[5]!==m.h||e[6]!==m.w?(u=n.jsxs("div",{className:"mb-2 flex items-center justify-between gap-4",children:[c,n.jsxs("span",{className:"text-xs font-medium tabular-nums",children:[m.w," × ",m.h]})]}),e[5]=m.h,e[6]=m.w,e[7]=u):u=e[7];let f,p;e[8]===Symbol.for("react.memo_cache_sentinel")?(f={gridTemplateColumns:`repeat(${q}, 1.25rem)`},p=()=>d(null),e[8]=f,e[9]=p):(f=e[8],p=e[9]);let h;e[10]!==m.h||e[11]!==m.w||e[12]!==r||e[13]!==i||e[14]!==o?(h=n.jsx("div",{className:"grid w-max gap-1",style:f,onPointerLeave:p,children:Array.from({length:nn},(y,b)=>Array.from({length:q},(v,N)=>{const j=N+1,g=b+1,w=j<i||g<r,S=j<=m.w&&g<=m.h;return n.jsx("button",{type:"button",disabled:w,"aria-label":`${j} by ${g}`,onPointerEnter:()=>d({w:j,h:g}),onClick:()=>o({w:j,h:g}),className:Q("size-5 rounded-sm border transition-colors",S?"border-primary bg-primary/30":"border-border bg-muted",w?"cursor-not-allowed opacity-40":"cursor-pointer hover:border-primary/60")},`${j}x${g}`)}))}),e[10]=m.h,e[11]=m.w,e[12]=r,e[13]=i,e[14]=o,e[15]=h):h=e[15];let x;return e[16]!==u||e[17]!==h?(x=n.jsxs("div",{className:"px-2 py-1.5",children:[u,h]}),e[16]=u,e[17]=h,e[18]=x):x=e[18],x}function fn(t,e,s){return t.some(o=>e>=o.x&&e<o.x+o.w&&s>=o.y&&s<o.y+o.h)}function he(t,e,s){for(let o=0;o<100;o++)for(let i=0;i<=q-e;i++){let r=!0;for(let a=0;a<s&&r;a++)for(let d=0;d<e&&r;d++)fn(t,i+d,o+a)&&(r=!1);if(r)return{x:i,y:o}}return{x:0,y:0}}function me(t,e,s={w:1,h:1}){const o=Math.max(s.w,Math.min(q,t)),i=Math.max(s.h,Math.min(6,e));return{w:o,h:i}}function ue(t,e,s){const o=Math.max(0,Math.min(q-s,t)),i=Math.max(0,e);return{x:o,y:i}}function pn(t,e,s){const o=t.find(l=>l.id===e);if(!o)return t;const i=t.filter(l=>l.id!==e),r=i.find(l=>s.x>=l.x&&s.x<l.x+l.w&&s.y>=l.y&&s.y<l.y+l.h);if(r&&r.w===o.w&&r.h===o.h)return t.map(l=>l.id===e?{...l,x:r.x,y:r.y}:l.id===r.id?{...l,x:o.x,y:o.y}:l);const d=[{...o,x:s.x,y:s.y}];for(const l of i){const m=he(d,l.w,l.h);d.push({...l,x:m.x,y:m.y})}return d}function hn(t){const e=k.c(35),{layout:s,isLayoutLoading:o,commitLayout:i}=Ze();let r;e[0]!==s.hidden?(r=new Set(s.hidden),e[0]=s.hidden,e[1]=r):r=e[1];const a=r;let d,l;if(e[2]!==t||e[3]!==a||e[4]!==s.tiles){l=[];let v;e[7]!==a?(v=j=>j.pinned||!a.has(j.id),e[7]=a,e[8]=v):v=e[8];const N=t.filter(v);d=new Map;for(const j of t)j.minSize&&d.set(j.id,j.minSize);for(const j of N){const g=s.tiles[j.id];if(!g)continue;const w=d.get(j.id),{w:S,h:C}=me(g.w,g.h,w),{x:_,y:I}=ue(g.x,g.y,S);l.push({id:j.id,x:_,y:I,w:S,h:C,minW:w?.w,minH:w?.h})}for(const j of N){if(l.some(I=>I.id===j.id))continue;const g=j.defaultSize??on,w=d.get(j.id),{w:S,h:C}=me(g.w,g.h,w),_=he(l,S,C);l.push({id:j.id,x:_.x,y:_.y,w:S,h:C,minW:w?.w,minH:w?.h})}e[2]=t,e[3]=a,e[4]=s.tiles,e[5]=d,e[6]=l}else d=e[5],l=e[6];let m;e[9]!==t?(m=new Set(t.map(xn)),e[9]=t,e[10]=m):m=e[10];const c=m;let u;e[11]!==c||e[12]!==i?(u=(v,N)=>{const j={};for(const g of v)j[g.id]={x:g.x,y:g.y,w:g.w,h:g.h};i({version:ee,tiles:j,hidden:N.filter(g=>c.has(g))})},e[11]=c,e[12]=i,e[13]=u):u=e[13];const f=u;let p;e[14]!==l?(p={visible:l},e[14]=l,e[15]=p):p=e[15];let h;e[16]!==f||e[17]!==s||e[18]!==l?(h=(v,N)=>{const j=l.find(S=>S.id===v);if(!j)return;const g=ue(N.x,N.y,j.w);if(g.x===j.x&&g.y===j.y)return;const w=pn(l,v,g);f(w,s.hidden)},e[16]=f,e[17]=s,e[18]=l,e[19]=h):h=e[19];let x;e[20]!==f||e[21]!==s||e[22]!==d||e[23]!==l?(x=(v,N)=>{const j=l.find(T=>T.id===v);if(!j)return;const g=d.get(v),{w,h:S}=me(N.w,N.h,g);if(w===j.w&&S===j.h)return;const C={...j,w,h:S,x:ue(j.x,j.y,w).x},_=l.filter(T=>T.id!==v),I=[C];for(const T of _){const P=he(I,T.w,T.h);I.push({...T,x:P.x,y:P.y})}f(I,s.hidden)},e[20]=f,e[21]=s,e[22]=d,e[23]=l,e[24]=x):x=e[24];let y;e[25]!==f||e[26]!==s||e[27]!==l?(y=v=>{const N=l.filter(j=>j.id!==v);f(N,Array.from(new Set([...s.hidden,v])))},e[25]=f,e[26]=s,e[27]=l,e[28]=y):y=e[28];let b;return e[29]!==o||e[30]!==p||e[31]!==h||e[32]!==x||e[33]!==y?(b={snapshot:p,isLoading:o,moveTile:h,resizeTile:x,hideTile:y},e[29]=o,e[30]=p,e[31]=h,e[32]=x,e[33]=y,e[34]=b):b=e[34],b}function xn(t){return t.id}const gn={w:2,h:4},yn={w:1,h:2},bn={w:1,h:1};function jn(t){return`prompt:${t.agentId}:${t.promptName||"blank"}`}function vn(t){return t.tileId?`tile:${t.tileId}`:`tile:${t.agentId}:${t.resourceUri}`}function Nn(t){return t.promptName?t.agentName:t.description}function wn(t){return{name:t.promptName,title:t.title,description:t.description,arguments:t.arguments,_meta:t._meta}}function Ye(t){const e=k.c(14),{org:s}=J();let o;e[0]!==s.id||e[1]!==s.slug||e[2]!==t.connectionId?(o=ct({connectionId:t.connectionId,orgId:s.id,orgSlug:s.slug}),e[0]=s.id,e[1]=s.slug,e[2]=t.connectionId,e[3]=o):o=e[3];const{data:i}=se(o),r=!!i&&!t.toolName;let a;e[4]!==i||e[5]!==r?(a={client:i,enabled:r},e[4]=i,e[5]=r,e[6]=a):a=e[6];const{data:d}=ss(a);let l;e[7]!==t.resourceUri||e[8]!==t.toolName||e[9]!==d?.tools?(l=t.toolName??d?.tools.find(u=>Re(u._meta)===t.resourceUri)?.name,e[7]=t.resourceUri,e[8]=t.toolName,e[9]=d?.tools,e[10]=l):l=e[10];const m=l;let c;return e[11]!==t.connectionId||e[12]!==m?(c=m?is(t.connectionId,m):void 0,e[11]=t.connectionId,e[12]=m,e[13]=c):c=e[13],c}function Ne(t){const e=k.c(10);let s;e[0]!==t?(s={agentId:t},e[0]=t,e[1]=s):s=e[1];const{start:o,startBlank:i,dialog:r,starting:a}=sn(s);let d;e[2]!==o||e[3]!==i?(d=c=>{if(!c.promptName){i();return}o(wn(c))},e[2]=o,e[3]=i,e[4]=d):d=e[4];const l=d;let m;return e[5]!==r||e[6]!==l||e[7]!==i||e[8]!==a?(m={open:l,startBlank:i,dialog:r,starting:a},e[5]=r,e[6]=l,e[7]=i,e[8]=a,e[9]=m):m=e[9],m}function Sn(t){const e=k.c(32),{entry:s,isEditMode:o}=t,{open:i,dialog:r,starting:a}=Ne(s.agentId);let d;e[0]!==s||e[1]!==i?(d=()=>i(s),e[0]=s,e[1]=i,e[2]=d):d=e[2];const l=a||o,m=!o&&"cursor-pointer transition-colors hover:bg-accent/40",c=o&&"cursor-default pl-12",u=a&&"opacity-60";let f;e[3]!==m||e[4]!==c||e[5]!==u?(f=Q("group/tile relative flex h-full w-full items-center gap-3 px-4 py-3 text-left bg-card",m,c,u),e[3]=m,e[4]=c,e[5]=u,e[6]=f):f=e[6];let p;e[7]!==s.agentIcon||e[8]!==s.agentName?(p=n.jsx(ce,{icon:s.agentIcon,name:s.agentName,size:"sm+"}),e[7]=s.agentIcon,e[8]=s.agentName,e[9]=p):p=e[9];let h;e[10]!==s.title?(h=n.jsx("div",{className:"line-clamp-2 text-sm font-medium text-foreground leading-snug",children:s.title}),e[10]=s.title,e[11]=h):h=e[11];let x;e[12]!==s?(x=Nn(s),e[12]=s,e[13]=x):x=e[13];let y;e[14]!==x?(y=n.jsx("div",{className:"truncate text-xs text-muted-foreground mt-0.5",children:x}),e[14]=x,e[15]=y):y=e[15];let b;e[16]!==y||e[17]!==h?(b=n.jsxs("div",{className:"min-w-0 flex-1",children:[h,y]}),e[16]=y,e[17]=h,e[18]=b):b=e[18];let v;e[19]!==o?(v=!o&&n.jsx(ns,{size:16,className:"shrink-0 text-muted-foreground opacity-0 -translate-x-1 transition-all duration-200 group-hover/tile:opacity-100 group-hover/tile:translate-x-0","aria-hidden":!0}),e[19]=o,e[20]=v):v=e[20];let N;e[21]!==a||e[22]!==d||e[23]!==b||e[24]!==v||e[25]!==l||e[26]!==f||e[27]!==p?(N=n.jsxs("button",{type:"button",onClick:d,disabled:l,"aria-busy":a,className:f,children:[p,b,v]}),e[21]=a,e[22]=d,e[23]=b,e[24]=v,e[25]=l,e[26]=f,e[27]=p,e[28]=N):N=e[28];let j;return e[29]!==r||e[30]!==N?(j=n.jsxs(n.Fragment,{children:[N,r]}),e[29]=r,e[30]=N,e[31]=j):j=e[31],j}function _n(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"mt-4 grid w-full grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",children:Array.from({length:3},Cn)}),t[0]=e):e=t[0],e}function Cn(t,e){return n.jsxs("div",{className:"flex w-full items-center gap-3 rounded-2xl bg-card card-shadow px-3 py-2.5",children:[n.jsx(H,{className:"size-10 rounded-xl"}),n.jsxs("div",{className:"flex-1 space-y-1.5",children:[n.jsx(H,{className:"h-3 w-2/3"}),n.jsx(H,{className:"h-2.5 w-1/3"})]})]},`chip-skeleton-${e}`)}function In(t){const e=k.c(17),{tile:s,prompts:o,isEditMode:i,tileWidth:r}=t,{org:a}=J(),{open:d,startBlank:l,dialog:m,starting:c}=Ne(s.agentId),u=o.filter(Tn),f=Ye(s),p="relative flex h-full w-full flex-col p-3";let h;e[0]!==i||e[1]!==f||e[2]!==l||e[3]!==c?(h=!i&&n.jsx("button",{type:"button",onClick:()=>{l(f?{main:f}:void 0)},disabled:c,"aria-busy":c,className:"mb-1 self-start rounded-md px-2 py-1 text-[10px] text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:"Open chat"}),e[0]=i,e[1]=f,e[2]=l,e[3]=c,e[4]=h):h=e[4];const x="flex min-h-0 flex-1 gap-3 overflow-hidden";let y;e[5]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsx($n,{}),e[5]=y):y=e[5];let b;e[6]!==a.id||e[7]!==a.slug||e[8]!==s?(b=n.jsx("div",{className:"min-h-0 flex-1 overflow-hidden rounded-lg border border-border",children:n.jsx($.Suspense,{fallback:y,children:n.jsx(kn,{tile:s,orgId:a.id,orgSlug:a.slug})})}),e[6]=a.id,e[7]=a.slug,e[8]=s,e[9]=b):b=e[9];const v=u.length>0&&!i&&r>=2&&n.jsx("div",{className:"flex w-44 shrink-0 flex-col gap-2 overflow-hidden",children:u.map(g=>n.jsx("button",{type:"button",onClick:()=>d(g),disabled:c,className:"shrink-0 rounded-lg border border-border bg-background px-2.5 py-2 text-left text-xs leading-snug text-foreground transition-colors hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:n.jsx("span",{className:"line-clamp-2",children:g.title})},g.promptName))});let N;e[10]!==b||e[11]!==v?(N=n.jsxs("div",{className:x,children:[b,v]}),e[10]=b,e[11]=v,e[12]=N):N=e[12];let j;return e[13]!==m||e[14]!==h||e[15]!==N?(j=n.jsxs("div",{className:p,children:[h,N,m]}),e[13]=m,e[14]=h,e[15]=N,e[16]=j):j=e[16],j}function Tn(t){return!!t.promptName}function kn(t){const e=k.c(13),{tile:s,orgId:o,orgSlug:i}=t;let r;e[0]!==o||e[1]!==i||e[2]!==s.connectionId?(r={connectionId:s.connectionId,orgId:o,orgSlug:i},e[0]=o,e[1]=i,e[2]=s.connectionId,e[3]=r):r=e[3];const a=ae(r),d=s.minHeight??200,l=s.maxHeight??4e3;let m;return e[4]!==a||e[5]!==o||e[6]!==i||e[7]!==d||e[8]!==l||e[9]!==s.connectionId||e[10]!==s.resourceUri||e[11]!==s.toolInput?(m=n.jsx(Jt,{resourceURI:s.resourceUri,orgId:o,orgSlug:i,connectionId:s.connectionId,client:a,toolInput:s.toolInput,displayMode:"fullscreen",minHeight:d,maxHeight:l,className:"h-full"}),e[4]=a,e[5]=o,e[6]=i,e[7]=d,e[8]=l,e[9]=s.connectionId,e[10]=s.resourceUri,e[11]=s.toolInput,e[12]=m):m=e[12],m}function $n(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsxs("div",{className:"flex h-full w-full flex-col gap-2 p-4",children:[n.jsx(H,{className:"h-3 w-2/3"}),n.jsx(H,{className:"h-3 w-1/2"}),n.jsx(H,{className:"mt-1 h-full w-full rounded-md"})]}),t[0]=e):e=t[0],e}function An(t){const e=k.c(14),{icon:s,name:o}=t;let i;e[0]!==s||e[1]!==o?(i=n.jsx(ce,{icon:s,name:o,size:"sm+"}),e[0]=s,e[1]=o,e[2]=i):i=e[2];let r;e[3]!==o?(r=n.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:o}),e[3]=o,e[4]=r):r=e[4];let a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx("div",{className:"truncate text-xs text-muted-foreground",children:"Loading tile…"}),e[5]=a):a=e[5];let d;e[6]!==r?(d=n.jsxs("div",{className:"min-w-0 flex-1",children:[r,a]}),e[6]=r,e[7]=d):d=e[7];let l;e[8]!==i||e[9]!==d?(l=n.jsxs("div",{className:"flex items-center gap-2.5",children:[i,d]}),e[8]=i,e[9]=d,e[10]=l):l=e[10];let m;e[11]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsxs("div",{className:"flex flex-1 flex-col gap-2 pt-1",children:[n.jsx(H,{className:"h-3 w-3/4"}),n.jsx(H,{className:"h-3 w-1/2"}),n.jsx(H,{className:"h-3 w-2/3"})]}),e[11]=m):m=e[11];let c;return e[12]!==l?(c=n.jsxs("div",{className:"flex h-full w-full flex-col gap-3 p-5 opacity-60",children:[l,m]}),e[12]=l,e[13]=c):c=e[13],c}function Pn(t){const e=k.c(10),{tile:s,prompts:o,isEditMode:i}=t,{open:r,startBlank:a,dialog:d,starting:l}=Ne(s.agentId),m=o.filter(En),c=Ye(s),u="flex h-full w-full flex-col gap-3 p-4";let f;e[0]!==c||e[1]!==a?(f=()=>{a(c?{main:c}:void 0)},e[0]=c,e[1]=a,e[2]=f):f=e[2];const p=l||i;let h;e[3]!==f||e[4]!==p?(h=n.jsx("button",{type:"button",onClick:f,disabled:p,className:"mb-1 self-start rounded-md px-2 py-1 text-[10px] text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:"Open chat"}),e[3]=f,e[4]=p,e[5]=h):h=e[5];const x=m.length>0&&!i&&n.jsx("div",{className:"grid grid-cols-1 gap-2 overflow-hidden sm:grid-cols-2",children:m.map(b=>n.jsx("button",{type:"button",onClick:()=>!i&&r(b),disabled:l,className:"rounded-lg border border-border bg-background px-2.5 py-2 text-left text-xs leading-snug text-foreground transition-colors hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:n.jsx("span",{className:"line-clamp-2",children:b.title})},b.promptName))});let y;return e[6]!==d||e[7]!==h||e[8]!==x?(y=n.jsxs("div",{className:u,children:[h,x,d]}),e[6]=d,e[7]=h,e[8]=x,e[9]=y):y=e[9],y}function En(t){return!!t.promptName}function et({isEditMode:t}){const{org:e}=J(),{isLoading:s,prompts:o,tiles:i}=be(e.slug),r=ze()?.ids??[],a=new Set(r),d=Oe(),l=Ue(),m=xe(),c=new Set(i.map(g=>g.agentId)),u=new Map;for(const g of o){const w=u.get(g.agentId);w?w.push(g):u.set(g.agentId,[g])}const f=o.filter(g=>!c.has(g.agentId)),p=[...i.map(g=>({kind:"tile",id:vn(g),data:g})),...f.map(g=>({kind:"prompt",id:jn(g),data:g}))],h=new Map(p.map(g=>[g.id,g])),x=hn(p.map(g=>({id:g.id,defaultSize:g.kind==="tile"?gn:bn,minSize:g.kind==="tile"?yn:void 0,pinned:a.has(g.data.agentId)}))),y=g=>{d.apply(w=>w.filter(S=>S!==g)).catch(()=>U.error("Couldn't remove from home — please try again."))},b=async g=>{if(i.filter(S=>S.agentId===g.agentId).length<=1){y(g.agentId);return}try{const C=(await l.call("COLLECTION_VIRTUAL_MCP_GET",{id:g.agentId})).item;if(!C)throw new Error("Agent not found");const _=Z(C.metadata?.ui),I=g.tileId?_.filter(T=>T.tileId!==g.tileId):_.filter(T=>T.connectionId!==g.connectionId||T.resourceUri!==g.resourceUri);await l.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:g.agentId,data:{metadata:{...C.metadata??{},ui:{...C.metadata?.ui??{},homeTile:null,homeTiles:I}}}}),m.invalidateQueries({queryKey:te.homeNextActions(e.slug)})}catch{U.error("Couldn't remove tile — please try again.")}},v=g=>{const w=h.get(g);if(w){if(!a.has(w.data.agentId)){x.hideTile(g);return}w.kind==="tile"?b(w.data):y(w.data.agentId)}},N=g=>{const w=h.get(g.id);if(!w)return null;if(w.kind==="tile"){const S=u.get(w.data.agentId)??[];return n.jsx(ot,{fallback:n.jsx(Pn,{tile:w.data,prompts:S,isEditMode:t}),children:n.jsx($.Suspense,{fallback:n.jsx(An,{icon:w.data.agentIcon,name:w.data.agentName}),children:n.jsx(In,{tile:w.data,prompts:S,isEditMode:t,tileWidth:g.w})})})}return n.jsx(Sn,{entry:w.data,isEditMode:t})};return s||x.isLoading?n.jsx(_n,{}):x.snapshot.visible.length===0&&!t?null:n.jsx("div",{className:"mt-4 flex w-full max-w-7xl flex-col gap-4",children:n.jsx(rn,{tiles:x.snapshot.visible,isEditMode:t,renderTile:N,onMove:x.moveTile,onResize:x.resizeTile,onRemove:v})})}function Mn(t){const e=k.c(2),{prompts:s,tiles:o}=be(t),i=o.length>0||s.length>0;let r;return e[0]!==i?(r={hasVisibleTiles:i},e[0]=i,e[1]=r):r=e[1],r}const Ie=420,Te=305;function tt(){const t=k.c(4);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("img",{src:"/home/bg-top-left.svg",alt:"",className:"absolute top-0 left-0 h-auto select-none opacity-80 dark:hidden",style:{width:Ie}}),t[0]=e):e=t[0];let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx("img",{src:"/home/bg-top-left-dark.svg",alt:"",className:"absolute top-0 left-0 hidden h-auto select-none opacity-80 dark:block",style:{width:Ie}}),t[1]=s):s=t[1];let o;t[2]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx("img",{src:"/home/bg-bottom-right.svg",alt:"",className:"absolute bottom-0 right-0 h-auto select-none opacity-80 dark:hidden",style:{width:Te}}),t[2]=o):o=t[2];let i;return t[3]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsxs("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 overflow-hidden",children:[e,s,o,n.jsx("img",{src:"/home/bg-bottom-right-dark.svg",alt:"",className:"absolute bottom-0 right-0 hidden h-auto select-none opacity-80 dark:block",style:{width:Te}})]}),t[3]=i):i=t[3],i}function ke(){const t=k.c(33),{data:e}=rt.useSession(),{org:s}=J(),o=ge(),i=xs(),{selectedVirtualMcp:r}=Nt();let a;t[0]!==s.id?(a=dt(s.id),t[0]=s.id,t[1]=a):a=t[1];const l=r??a;let m;t[2]!==s.slug?(m=Ht(s.slug),t[2]=s.slug,t[3]=m):m=t[3],se(m);let c;t[4]!==s.id||t[5]!==s.slug?(c={connectionId:mt,orgId:s.id,orgSlug:s.slug},t[4]=s.id,t[5]=s.slug,t[6]=c):c=t[6];const u=ae(c);let f;t[7]!==s.id||t[8]!==s.slug?(f=ps(s.slug,s.id),t[7]=s.id,t[8]=s.slug,t[9]=f):f=t[9];let p;t[10]!==s.id||t[11]!==s.slug?(p=Lt(s.slug,s.id),t[10]=s.id,t[11]=s.slug,t[12]=p):p=t[12];let h;t[13]!==l.id||t[14]!==s.id||t[15]!==u?(h=pt(s.id,l.id,u),t[13]=l.id,t[14]=s.id,t[15]=u,t[16]=h):h=t[16];let x;t[17]!==f||t[18]!==p||t[19]!==h?(x={queries:[f,p,h]},t[17]=f,t[18]=p,t[19]=h,t[20]=x):x=t[20],ys(x);const y=hs(),b=ht(l.id),{hasDecoKey:v,isZeroBalance:N,isInitialFreeCredit:j,balanceDollars:g,hasOnlyDecoProvider:w}=Mt(),{hasVisibleTiles:S}=Mn(s.slug),C=zt(b?.metadata);if(y.length===0&&!(C&&Ot(i))){let L;return t[21]===Symbol.for("react.memo_cache_sentinel")?(L=n.jsx("div",{className:"flex-1 overflow-y-auto",children:n.jsx("div",{className:"min-h-full flex items-center justify-center px-4 py-10",children:n.jsx(wt,{})})}),t[21]=L):L=t[21],L}let I;t[22]!==e?.user?.name?(I=e?.user?.name?.split(" ")[0]||"there",t[22]=e?.user?.name,t[23]=I):I=t[23];const T=I,P=v&&j&&g!=null,M=v&&N&&w;let z;t[24]!==g||t[25]!==P||t[26]!==M?(z=P?n.jsx(oe.CreditsEyebrow,{balanceDollars:g}):M?n.jsx(oe.NoCreditsEyebrow,{}):null,t[24]=g,t[25]=P,t[26]=M,t[27]=z):z=t[27];const B=z;let O;return t[28]!==B||t[29]!==S||t[30]!==o||t[31]!==T?(O=n.jsx(tn,{children:o?n.jsx(zn,{eyebrow:B,userName:T}):n.jsx(On,{eyebrow:B,userName:T,hasVisibleTiles:S})}),t[28]=B,t[29]=S,t[30]=o,t[31]=T,t[32]=O):O=t[32],O}function zn(t){const e=k.c(12),{eyebrow:s,userName:o}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(tt,{}),e[0]=i):i=e[0];let r;e[1]!==s?(r=s&&n.jsx("div",{className:"mb-4",children:s}),e[1]=s,e[2]=r):r=e[2];let a;e[3]!==o?(a=n.jsxs("p",{className:"text-3xl font-medium text-foreground text-center max-w-[280px]",children:["What's on your mind, ",o,"?"]}),e[3]=o,e[4]=a):a=e[4];let d;e[5]!==r||e[6]!==a?(d=n.jsxs("div",{className:"relative flex flex-col items-center justify-center w-full pt-28 pb-8 px-4",children:[r,a]}),e[5]=r,e[6]=a,e[7]=d):d=e[7];let l;e[8]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx("div",{className:"relative w-full flex flex-col gap-4 pb-8 px-4",children:n.jsx(oe.Input,{showConnectionsBanner:!0})}),e[8]=l):l=e[8];let m;e[9]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx("div",{className:"relative w-full px-4 pb-8",children:n.jsx(et,{isEditMode:!1})}),e[9]=m):m=e[9];let c;return e[10]!==d?(c=n.jsxs("div",{className:"flex-1 relative flex flex-col items-center overflow-y-auto",children:[i,d,l,m]}),e[10]=d,e[11]=c):c=e[11],c}function On(t){const e=k.c(32),{eyebrow:s,userName:o,hasVisibleTiles:i}=t,{isEditMode:r,enter:a,save:d,cancel:l,hasChanges:m}=Ze(),[c,u]=$.useState(!1);let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=()=>u(!0),e[0]=f):f=e[0];let p;e[1]!==l||e[2]!==a||e[3]!==m||e[4]!==r||e[5]!==d?(p=n.jsx(gs.Right,{children:n.jsx(Ln,{isEditMode:r,hasChanges:m,onEnter:a,onSave:d,onCancel:l,onAddTile:f})}),e[1]=l,e[2]=a,e[3]=m,e[4]=r,e[5]=d,e[6]=p):p=e[6];let h;e[7]!==c?(h=n.jsx(js,{open:c,onOpenChange:u}),e[7]=c,e[8]=h):h=e[8];let x;e[9]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(tt,{}),e[9]=x):x=e[9];const y=i||r?"pt-32":"flex-1 justify-center";let b;e[10]!==y?(b=Q("relative flex flex-col items-center px-10 pb-4",y),e[10]=y,e[11]=b):b=e[11];let v;e[12]!==s?(v=s&&n.jsx("div",{className:"mb-4",children:s}),e[12]=s,e[13]=v):v=e[13];let N;e[14]!==o?(N=n.jsxs("p",{className:"text-3xl font-medium text-foreground",children:["What's on your mind, ",o,"?"]}),e[14]=o,e[15]=N):N=e[15];let j;e[16]!==v||e[17]!==N?(j=n.jsxs("div",{className:"text-center mb-10",children:[v,N]}),e[16]=v,e[17]=N,e[18]=j):j=e[18];let g;e[19]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsxs("div",{className:"relative w-full",children:[n.jsx(Dn,{}),n.jsx(oe.Input,{showConnectionsBanner:!0})]}),e[19]=g):g=e[19];let w;e[20]!==j?(w=n.jsxs("div",{className:"flex flex-col items-center w-full max-w-[672px]",children:[j,g]}),e[20]=j,e[21]=w):w=e[21];let S;e[22]!==r?(S=n.jsx("div",{className:"relative w-full mt-10 mx-auto max-w-[1280px] px-2 pb-16",children:n.jsx(et,{isEditMode:r})}),e[22]=r,e[23]=S):S=e[23];let C;e[24]!==w||e[25]!==S||e[26]!==b?(C=n.jsxs("div",{className:"flex-1 relative flex flex-col min-h-0",children:[x,n.jsx("div",{className:"flex-1 relative flex flex-col overflow-y-auto",children:n.jsxs("div",{className:b,children:[w,S]})})]}),e[24]=w,e[25]=S,e[26]=b,e[27]=C):C=e[27];let _;return e[28]!==C||e[29]!==p||e[30]!==h?(_=n.jsxs(n.Fragment,{children:[p,h,C]}),e[28]=C,e[29]=p,e[30]=h,e[31]=_):_=e[31],_}function Ln(t){const e=k.c(17),{isEditMode:s,hasChanges:o,onEnter:i,onSave:r,onCancel:a,onAddTile:d}=t;if(s){let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(ye,{size:14}),e[0]=c):c=e[0];let u;e[1]!==d?(u=n.jsxs("button",{type:"button",onClick:d,className:"flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",title:"Add a tile from any agent",children:[c,"Add tile"]}),e[1]=d,e[2]=u):u=e[2];let f;e[3]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx($e,{size:14}),e[3]=f):f=e[3];let p;e[4]!==a?(p=n.jsxs(Y,{size:"sm",variant:"ghost",onClick:a,className:"gap-1.5 h-7 text-xs",children:[f,"Cancel"]}),e[4]=a,e[5]=p):p=e[5];const h=!o;let x;e[6]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(xt,{size:14}),e[6]=x):x=e[6];let y;e[7]!==r||e[8]!==h?(y=n.jsxs(Y,{size:"sm",onClick:r,disabled:h,className:"gap-1.5 h-7 text-xs",children:[x,"Save"]}),e[7]=r,e[8]=h,e[9]=y):y=e[9];let b;return e[10]!==u||e[11]!==p||e[12]!==y?(b=n.jsxs(n.Fragment,{children:[u,p,y]}),e[10]=u,e[11]=p,e[12]=y,e[13]=b):b=e[13],b}let l;e[14]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(vt,{size:14}),e[14]=l):l=e[14];let m;return e[15]!==i?(m=n.jsxs("button",{type:"button",onClick:i,className:"flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",title:"Customize your home",children:[l,"Customize"]}),e[15]=i,e[16]=m):m=e[16],m}function Dn(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("img",{src:"/home/capybara.png",alt:"","aria-hidden":!0,className:"pointer-events-none absolute -top-16 right-6 z-20 h-20 w-auto select-none"}),t[0]=e):e=t[0],e}function Ko(){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{Ko as default};
@@ -1 +0,0 @@
1
- import{c as it,r as E,j as e,i as rt}from"./index-BkSIY6JJ.js";import{S as mt,b as pt,c as st,d as at}from"./sheet-CUfjkNRy.js";import{S as nt}from"./scroll-area-D51A_KQ5.js";import{r as lt,c as ct,u as dt,a as St,i as ft,f as ut,d as vt,P as ht,S as gt}from"./page-seo-form-DCgyqE3q.js";import{p as xt}from"./index-1ECwD4fs.js";import"./X-B-cRV-7d.js";import"./agent-icon-C6bJxQ04.js";import"./AlertCircle-flSoo6uw.js";import"./Tool01-rx0lKYM8.js";import"./SwitchHorizontal01-CB5mOBIf.js";import"./Settings02-47eDNk4K.js";import"./XCircle-CkhBWURn.js";import"./ArrowUpRight-BeOMO89N.js";import"./ZapSquare-DdgE8vy-.js";import"./Users03-gvBLUtvG.js";import"./CheckCircle-B9ekAAw-.js";import"./ChevronUp-BhWz3ylT.js";import"./ChevronDown-BWfuTI7r.js";import"./ChevronLeft-BNcg18cx.js";import"./ChevronRight-ChYOVgWd.js";import"./DotsVertical-C0YWb9xq.js";import"./Stars02-DlImJz_z.js";import"./Eye-DWTUBTZ_.js";import"./ZoomOut-BdBjpsIq.js";import"./Globe01-BgRW2EiE.js";import"./FilterLines-Djqj6uj_.js";import"./Star01-BrkbxV-A.js";import"./Globe04-XITcP2mp.js";import"./HardDrive-DS3VxDtU.js";import"./Key01-DX7L8s0Z.js";import"./LayoutLeft-BqtFvEWV.js";import"./LinkExternal01-Cf-6A1_h.js";import"./Monitor01-CZ30bS8J.js";import"./Sun-9FxiCes3.js";import"./Palette-Dy2dQgqx.js";import"./Play-DvFnuZIO.js";import"./Plus-jFajoMCA.js";import"./SearchMd-uzKFlzQB.js";import"./Shield01-BgRa80OR.js";import"./Stars01-Daq_eW6a.js";import"./Trash01-DI7qV1ow.js";import"./Upload01-Boqk1hvA.js";import"./User01-B3UbdHmL.js";import"./Users01-BUyczaeV.js";import"./XClose-Doj89HqF.js";import"./Zap-BCqTHl-x.js";import"./use-clock-tick-DHvuEFIJ.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-DOTEBoID.js";import"./tooltip-CAEDbADy.js";import"./file-type-icon-Db262N7w.js";import"./dialog-BLvz2lK8.js";import"./use-mobile-CPyq18pe.js";import"./tab-id-BptcWVWa.js";import"./content-blocks-o63cs2vh.js";import"./types-Dw2dcWcn.js";import"./use-mcp-client-DYpZuPPA.js";import"./auth-B9Q1UUsp.js";import"./chat-context-DN0_9Gee.js";import"./hooks-chgqRyLj.js";import"./decopilot-sse-pool-CKTJhrtc.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-DnY7c9gE.js";import"./use-collections-yHRKnSEt.js";import"./use-ai-providers-BcLob6tS.js";import"./studio-tools-BgUSKeCY.js";import"./use-organization-settings-DFnXSR7Z.js";import"./shell-layout-CR4YIb2n.js";import"./avatar-oAcdiJ9v.js";import"./required-auth-layout-DjRtF3m8.js";import"./use-org-sso-DGBv3Hvc.js";import"./integration-icon-CZDEviNI.js";import"./use-navigate-to-agent-Bhu6dr_a.js";import"./use-connection-BPcAXa47.js";import"./use-mcp-prompts-BxOgLeZF.js";import"./form-CPJbrMq5.js";import"./label-CETsHBZ0.js";import"./input-jkT1z5r1.js";import"./index-BdQq_4o_.js";import"./switch-Cf_WUos9.js";import"./select-Ct-_FhWe.js";import"./index-D7a1JQHt.js";import"./drawer-C4RJ4_GY.js";import"./collection-search-DbQr2iji.js";import"./tabs-CNnqe_sK.js";import"./toggle-group-BE1kDwdz.js";import"./sortable.esm-CbeYFn14.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-DehsL0Sf.js";import"./use-registry-connections-Czx1u2H6.js";import"./useInfiniteQuery-DlRMWoIP.js";import"./use-infinite-scroll-V4l3DQJD.js";import"./extract-connection-data-iACc8UZO.js";import"./card-BIwENur_.js";import"./collection-tabs-D77_So6e.js";import"./badge-CpKEkIGn.js";import"./textarea-BzYVaGJ0.js";import"./connection-form-helpers-CASdXQaW.js";import"./authenticate-and-persist-oauth-xCkDryiA.js";import"./mcp-oauth-BIBzZgcE.js";import"./useSuspenseInfiniteQuery-BjlxN-DZ.js";import"./connect-desktop-dialog-ByWaevjw.js";import"./decopilot-BXlT8NLf.js";import"./checkbox-Bi39v4Qa.js";import"./skeleton-h95MLET_.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-D6f1v8Lb.js";import"./popover-1pFpRX6s.js";import"./command-DyJgh8wP.js";import"./index-DAmj773w.js";import"./dropdown-menu-CRyIPZil.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-DRhhwMt0.js";import"./empty-state-CmZpGujH.js";import"./toolbar-D5FkjLVB.js";import"./preview-dialog-DRmrGWbh.js";import"./index-DFNABgCe.js";import"./use-mcp-tools-xhV-ENX5.js";import"./use-capability-CbeJheXW.js";import"./shell-route-loading-fK7OWXny.js";import"./tools-list-BKN97Z6h.js";import"./alert-dialog-HmiP05XU.js";import"./use-debounced-autosave-BnfFXRc0.js";import"./index-RkQpccOp.js";import"./sidebar-C45GjVmp.js";import"./search-input-CEqRaXj6.js";import"./github-repo-picker-Db_ehY6e.js";import"./use-secrets-DqgJI3yC.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./view-mode-toggle-ncGR_sPB.js";import"./index-DAWoaMpc.js";import"./automation-runs-DxPUfxy1.js";import"./table-tHeeUiY0.js";import"./use-members-CJKZdynB.js";import"./use-org-auth-client-Tiq6Yt9b.js";import"./task-status-DzLkYYrk.js";import"./use-automations-CfP4AmpB.js";import"./use-file-configs-C8z3zSDD.js";import"./monaco-editor-tVsx1Jkl.js";import"./select-model-DJ7vH3M2.js";import"./automation-list-row-CLUMzxuG.js";function ii(u){const t=it.c(46),{open:N,onOpenChange:P,orgSlug:Q,virtualMcpId:U,branch:W,decofile:G,meta:s,target:m,onSaved:X}=u,o=lt(G,m,s),k=m.kind==="site"?"site":m.pageKey,[Y,Z]=E.useState(k),[tt,i]=E.useState(null),[J,g]=E.useState(void 0),[x,y]=E.useState(0);Y!==k&&(Z(k),i(null),g(void 0),y(wt));const{persistSeo:a,persistRawSeo:I,flush:K,isPending:D}=ct({orgSlug:Q,virtualMcpId:U,branch:W,target:m,resolved:o,onSaved:X}),w=m.kind==="page",ot=w?o?.rawSeoData:void 0,v=J!==void 0?J:ot,et=w?dt(v)??void 0:void 0,h=tt??et??o?.seoData??{},p=o?St(h,o):null,n=p&&(!w||ft(v))?xt(p,s):null,_=m.kind==="page"?ut(G,s)?.seoData??void 0:void 0;let j;t[0]!==s?(j=vt(s),t[0]=s,t[1]=j):j=t[1];const M=j;let R;t[2]!==a||t[3]!==o||t[4]!==i?(R=r=>{if(!o)return;const L=r;i(L),a(L)},t[2]=a,t[3]=o,t[4]=i,t[5]=R):R=t[5];const V=R;let F;t[6]!==K||t[7]!==P?(F=r=>{r||K(),P(r)},t[6]=K,t[7]=P,t[8]=F):F=t[8];const z=F,A=m.kind==="site"?"Site SEO":"Page SEO",T=w&&o,B=m.kind==="site"&&o&&n,H=m.kind==="site"?"No site-level SEO block found.":o?"SEO schema not found for this page.":"Could not load page SEO.";let C;t[9]!==i?(C=()=>i(null),t[9]=i,t[10]=C):C=t[10];const $=C;let O;t[11]!==y?(O=()=>y(yt),t[11]=y,t[12]=O):O=t[12];const q=O;let l;t[13]!==A?(l=e.jsx(mt,{className:"text-sm font-semibold",children:A}),t[13]=A,t[14]=l):l=t[14];let c;t[15]!==D?(c=D&&e.jsx(rt,{size:14,className:"animate-spin text-muted-foreground"}),t[15]=D,t[16]=c):c=t[16];let d;t[17]!==l||t[18]!==c?(d=e.jsxs(pt,{className:"px-4 py-3 border-b flex-row items-center justify-between space-y-0",children:[l,c]}),t[17]=l,t[18]=c,t[19]=d):d=t[19];let S;t[20]!==p||t[21]!==q||t[22]!==$||t[23]!==M||t[24]!==v||t[25]!==h||t[26]!==H||t[27]!==x||t[28]!==V||t[29]!==I||t[30]!==a||t[31]!==o||t[32]!==n||t[33]!==i||t[34]!==g||t[35]!==T||t[36]!==B||t[37]!==_?(S=!o||!T&&!B?e.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:H}):e.jsx(nt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:e.jsx("div",{className:"px-6 py-4",children:e.jsx("div",{className:"mx-auto max-w-sm",children:T?e.jsx(ht,{rawSeo:v,innerSeo:h,defaultResolveType:M,seoSchema:n,activeResolveType:p,seoTypeOptions:o.seoTypeOptions,formResetKey:x,siteDefaultSeo:_,onPersistRaw:r=>{g(r),I(r)},onInnerChange:r=>{i(r),a(r)},onClearForm:$,onBumpFormKey:q}):n&&p&&e.jsx(gt,{schema:n,resolveType:p,value:h,formResetKey:x,onChange:V})})})}),t[20]=p,t[21]=q,t[22]=$,t[23]=M,t[24]=v,t[25]=h,t[26]=H,t[27]=x,t[28]=V,t[29]=I,t[30]=a,t[31]=o,t[32]=n,t[33]=i,t[34]=g,t[35]=T,t[36]=B,t[37]=_,t[38]=S):S=t[38];let f;t[39]!==d||t[40]!==S?(f=e.jsxs(st,{side:"right",className:"w-[400px] sm:max-w-[440px] p-0 gap-0",children:[d,S]}),t[39]=d,t[40]=S,t[41]=f):f=t[41];let b;return t[42]!==z||t[43]!==N||t[44]!==f?(b=e.jsx(at,{open:N,onOpenChange:z,children:f}),t[42]=z,t[43]=N,t[44]=f,t[45]=b):b=t[45],b}function yt(u){return u+1}function wt(u){return u+1}export{ii as SeoSheet};
@@ -1 +0,0 @@
1
- import{c as H,j as t,B as ee}from"./index-BkSIY6JJ.js";import{n as te}from"./LinkExternal01-Cf-6A1_h.js";import{ay as oe,Y as ie}from"./agent-icon-C6bJxQ04.js";import{I as J}from"./input-jkT1z5r1.js";import{L as G}from"./label-CETsHBZ0.js";import{M as se}from"./automation-runs-DxPUfxy1.js";import{T as Q,a as le,b as W,c as re}from"./tabs-CNnqe_sK.js";import{T as ae}from"./textarea-BzYVaGJ0.js";import{as as me,at as pe,au as ne,av as ce,aw as de,ax as fe}from"./index-1ECwD4fs.js";import{b as ue,a as xe,B as he,c as ge}from"./block-document-BVHsyU-9.js";import{u as ve,s as F,E as ye,R as je,A as be}from"./primitives-C06Pn9p4.js";import{S as Ce}from"./save-status-BsQDaUlP.js";import"./AlertCircle-flSoo6uw.js";import"./Tool01-rx0lKYM8.js";import"./SwitchHorizontal01-CB5mOBIf.js";import"./Settings02-47eDNk4K.js";import"./XCircle-CkhBWURn.js";import"./ArrowUpRight-BeOMO89N.js";import"./ZapSquare-DdgE8vy-.js";import"./Users03-gvBLUtvG.js";import"./CheckCircle-B9ekAAw-.js";import"./ChevronUp-BhWz3ylT.js";import"./ChevronDown-BWfuTI7r.js";import"./ChevronLeft-BNcg18cx.js";import"./ChevronRight-ChYOVgWd.js";import"./DotsVertical-C0YWb9xq.js";import"./Stars02-DlImJz_z.js";import"./Eye-DWTUBTZ_.js";import"./ZoomOut-BdBjpsIq.js";import"./Globe01-BgRW2EiE.js";import"./FilterLines-Djqj6uj_.js";import"./Star01-BrkbxV-A.js";import"./Globe04-XITcP2mp.js";import"./HardDrive-DS3VxDtU.js";import"./Key01-DX7L8s0Z.js";import"./LayoutLeft-BqtFvEWV.js";import"./Monitor01-CZ30bS8J.js";import"./Sun-9FxiCes3.js";import"./Palette-Dy2dQgqx.js";import"./Play-DvFnuZIO.js";import"./Plus-jFajoMCA.js";import"./SearchMd-uzKFlzQB.js";import"./Shield01-BgRa80OR.js";import"./Stars01-Daq_eW6a.js";import"./Trash01-DI7qV1ow.js";import"./Upload01-Boqk1hvA.js";import"./User01-B3UbdHmL.js";import"./Users01-BUyczaeV.js";import"./XClose-Doj89HqF.js";import"./X-B-cRV-7d.js";import"./Zap-BCqTHl-x.js";import"./useInfiniteQuery-DlRMWoIP.js";import"./use-infinite-scroll-V4l3DQJD.js";import"./use-connection-BPcAXa47.js";import"./use-collections-yHRKnSEt.js";import"./use-mcp-client-DYpZuPPA.js";import"./auth-B9Q1UUsp.js";import"./use-virtual-mcp-DnY7c9gE.js";import"./card-BIwENur_.js";import"./sheet-CUfjkNRy.js";import"./table-tHeeUiY0.js";import"./empty-state-CmZpGujH.js";import"./use-members-CJKZdynB.js";import"./use-org-auth-client-Tiq6Yt9b.js";import"./task-status-DzLkYYrk.js";import"./use-automations-CfP4AmpB.js";import"./studio-tools-BgUSKeCY.js";import"./useSuspenseInfiniteQuery-BjlxN-DZ.js";import"./badge-CpKEkIGn.js";import"./select-Ct-_FhWe.js";import"./index-BdQq_4o_.js";import"./tooltip-CAEDbADy.js";import"./checkbox-Bi39v4Qa.js";import"./command-DyJgh8wP.js";import"./index-DAmj773w.js";import"./dialog-BLvz2lK8.js";import"./popover-1pFpRX6s.js";import"./avatar-oAcdiJ9v.js";import"./scroll-area-D51A_KQ5.js";import"./use-clock-tick-DHvuEFIJ.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-DOTEBoID.js";import"./file-type-icon-Db262N7w.js";import"./use-mobile-CPyq18pe.js";import"./tab-id-BptcWVWa.js";import"./content-blocks-o63cs2vh.js";import"./types-Dw2dcWcn.js";import"./chat-context-DN0_9Gee.js";import"./hooks-chgqRyLj.js";import"./decopilot-sse-pool-CKTJhrtc.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-ai-providers-BcLob6tS.js";import"./use-organization-settings-DFnXSR7Z.js";import"./shell-layout-CR4YIb2n.js";import"./required-auth-layout-DjRtF3m8.js";import"./use-org-sso-DGBv3Hvc.js";import"./integration-icon-CZDEviNI.js";import"./use-navigate-to-agent-Bhu6dr_a.js";import"./use-mcp-prompts-BxOgLeZF.js";import"./form-CPJbrMq5.js";import"./index-D7a1JQHt.js";import"./drawer-C4RJ4_GY.js";import"./collection-search-DbQr2iji.js";import"./toggle-group-BE1kDwdz.js";import"./sortable.esm-CbeYFn14.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-DehsL0Sf.js";import"./use-registry-connections-Czx1u2H6.js";import"./extract-connection-data-iACc8UZO.js";import"./collection-tabs-D77_So6e.js";import"./connection-form-helpers-CASdXQaW.js";import"./authenticate-and-persist-oauth-xCkDryiA.js";import"./mcp-oauth-BIBzZgcE.js";import"./connect-desktop-dialog-ByWaevjw.js";import"./decopilot-BXlT8NLf.js";import"./skeleton-h95MLET_.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-D6f1v8Lb.js";import"./dropdown-menu-CRyIPZil.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-DRhhwMt0.js";import"./toolbar-D5FkjLVB.js";import"./preview-dialog-DRmrGWbh.js";import"./index-DFNABgCe.js";import"./use-mcp-tools-xhV-ENX5.js";import"./use-capability-CbeJheXW.js";import"./shell-route-loading-fK7OWXny.js";import"./tools-list-BKN97Z6h.js";import"./alert-dialog-HmiP05XU.js";import"./switch-Cf_WUos9.js";import"./use-debounced-autosave-BnfFXRc0.js";import"./index-RkQpccOp.js";import"./sidebar-C45GjVmp.js";import"./search-input-CEqRaXj6.js";import"./github-repo-picker-Db_ehY6e.js";import"./use-secrets-DqgJI3yC.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./view-mode-toggle-ncGR_sPB.js";import"./index-DAWoaMpc.js";import"./use-file-configs-C8z3zSDD.js";import"./monaco-editor-tVsx1Jkl.js";import"./select-model-DJ7vH3M2.js";import"./automation-list-row-CLUMzxuG.js";function ke(A){return Array.isArray(A)?A.map(e=>({key:F(e?.key),value:F(e?.value)})):[]}function pi(A){const e=H.c(71),{orgSlug:i,virtualMcpId:m,branch:o,blockKey:l,block:n,decofile:p,meta:u,previewBaseUrl:x}=A;let y;e[0]!==o||e[1]!==i||e[2]!==m?(y={orgSlug:i,virtualMcpId:m,branch:o},e[0]=o,e[1]=i,e[2]=m,e[3]=y):y=e[3];const s=me(y);let c;e[4]!==n?(c=pe(n,"posts"),e[4]=n,e[5]=c):c=e[5];const j=c;let b;e[6]!==l||e[7]!==s?(b=T=>{s.mutate({blockKey:l,data:ne(l,"posts",T)})},e[6]=l,e[7]=s,e[8]=b):b=e[8];const[r,_]=ve(j,b);let C;e[9]!==r||e[10]!==_?(C=(T,Z)=>_({...r,[T]:Z}),e[9]=r,e[10]=_,e[11]=C):C=e[11];const h=C;let S;e[12]!==p||e[13]!==r||e[14]!==x?(S=ue({decofile:p,post:r,previewBaseUrl:x}),e[12]=p,e[13]=r,e[14]=x,e[15]=S):S=e[15];const f=S;let a;e[16]!==r.title?(a=F(r.title)||"Untitled post",e[16]=r.title,e[17]=a):a=e[17];let d;e[18]!==a?(d=t.jsx("span",{className:"truncate text-sm font-medium",children:a}),e[18]=a,e[19]=d):d=e[19];let g;e[20]!==s.isError||e[21]!==s.isPending?(g=t.jsx(Ce,{isPending:s.isPending,isError:s.isError}),e[20]=s.isError,e[21]=s.isPending,e[22]=g):g=e[22];const k=!f,P=f?"Open the post preview in a new tab":"Set the post slug (and its category) plus the blog app's pageSlug to preview";let N;e[23]!==f?(N=()=>{f&&window.open(f,"_blank","noopener,noreferrer")},e[23]=f,e[24]=N):N=e[24];let B;e[25]===Symbol.for("react.memo_cache_sentinel")?(B=t.jsx(te,{size:14}),e[25]=B):B=e[25];let w;e[26]!==P||e[27]!==N||e[28]!==k?(w=t.jsxs(ee,{type:"button",variant:"outline",size:"sm",disabled:k,title:P,onClick:N,children:[B,"See preview"]}),e[26]=P,e[27]=N,e[28]=k,e[29]=w):w=e[29];let E;e[30]!==w||e[31]!==g?(E=t.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[g,w]}),e[30]=w,e[31]=g,e[32]=E):E=e[32];let v;e[33]!==E||e[34]!==d?(v=t.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[d,E]}),e[33]=E,e[34]=d,e[35]=v):v=e[35];let L;e[36]!==r.title?(L=F(r.title),e[36]=r.title,e[37]=L):L=e[37];let R;e[38]!==h?(R=T=>h("title",T),e[38]=h,e[39]=R):R=e[39];let U;e[40]!==L||e[41]!==R?(U=t.jsx(ye,{value:L,onChange:R,placeholder:"Post title",className:"py-1 text-4xl font-bold text-foreground"}),e[40]=L,e[41]=R,e[42]=U):U=e[42];let K;e[43]===Symbol.for("react.memo_cache_sentinel")?(K=t.jsxs(Q,{value:"content",children:[t.jsx(oe,{}),"Content"]}),e[43]=K):K=e[43];let Y;e[44]===Symbol.for("react.memo_cache_sentinel")?(Y=t.jsxs(le,{children:[K,t.jsxs(Q,{value:"settings",children:[t.jsx(ie,{}),"Settings"]})]}),e[44]=Y):Y=e[44];let $;e[45]!==r.sections?($=xe(r.sections),e[45]=r.sections,e[46]=$):$=e[46];let I;e[47]!==h?(I=T=>h("sections",T),e[47]=h,e[48]=I):I=e[48];let M;e[49]!==u||e[50]!==$||e[51]!==I?(M=t.jsx(W,{value:"content",children:t.jsx("div",{className:"rounded-xl border bg-card p-8 shadow-sm",children:t.jsx(he,{value:$,onChange:I,meta:u,emptyMessage:"This post has no content yet. Use ⊕ to add your first block."})})}),e[49]=u,e[50]=$,e[51]=I,e[52]=M):M=e[52];let D;e[53]!==p||e[54]!==r||e[55]!==h?(D=t.jsx(W,{value:"settings",children:t.jsx("div",{className:"rounded-xl border bg-card p-6 shadow-sm",children:t.jsx(Se,{post:r,decofile:p,onChange:h})})}),e[53]=p,e[54]=r,e[55]=h,e[56]=D):D=e[56];let V;e[57]!==M||e[58]!==D?(V=t.jsxs(re,{defaultValue:"content",className:"mt-6 gap-4",children:[Y,M,D]}),e[57]=M,e[58]=D,e[59]=V):V=e[59];let z;e[60]!==U||e[61]!==V?(z=t.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:t.jsxs("div",{className:"mx-auto max-w-4xl px-8 py-8",children:[U,V]})}),e[60]=U,e[61]=V,e[62]=z):z=e[62];let O;e[63]!==v||e[64]!==z?(O=t.jsxs("div",{className:"flex h-full flex-col",children:[v,z]}),e[63]=v,e[64]=z,e[65]=O):O=e[65];let q;return e[66]!==o||e[67]!==i||e[68]!==O||e[69]!==m?(q=t.jsx(ge,{orgSlug:i,virtualMcpId:m,branch:o,children:O}),e[66]=o,e[67]=i,e[68]=O,e[69]=m,e[70]=q):q=e[70],q}function Se(A){const e=H.c(59),{post:i,decofile:m,onChange:o}=A;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(G,{htmlFor:"post-excerpt",children:"Excerpt"}),e[0]=l):l=e[0];let n;e[1]!==i.excerpt?(n=F(i.excerpt),e[1]=i.excerpt,e[2]=n):n=e[2];let p;e[3]!==o?(p=v=>o("excerpt",v.target.value),e[3]=o,e[4]=p):p=e[4];let u;e[5]!==n||e[6]!==p?(u=t.jsxs("div",{className:"space-y-2",children:[l,t.jsx(ae,{id:"post-excerpt",value:n,onChange:p,rows:2})]}),e[5]=n,e[6]=p,e[7]=u):u=e[7];let x;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(G,{htmlFor:"post-slug",children:"Slug"}),e[8]=x):x=e[8];let y;e[9]!==i.slug?(y=F(i.slug),e[9]=i.slug,e[10]=y):y=e[10];let s;e[11]!==o?(s=v=>o("slug",v.target.value),e[11]=o,e[12]=s):s=e[12];let c;e[13]!==y||e[14]!==s?(c=t.jsxs("div",{className:"space-y-2",children:[x,t.jsx(J,{id:"post-slug",value:y,onChange:s,placeholder:"my-post",className:"h-10"})]}),e[13]=y,e[14]=s,e[15]=c):c=e[15];let j;e[16]===Symbol.for("react.memo_cache_sentinel")?(j={type:"string",format:"date",title:"Date"},e[16]=j):j=e[16];let b;e[17]!==i.date?(b=F(i.date),e[17]=i.date,e[18]=b):b=e[18];let r;e[19]!==o?(r=v=>o("date",v),e[19]=o,e[20]=r):r=e[20];let _;e[21]!==b||e[22]!==r?(_=t.jsx(fe,{schema:j,value:b,onChange:r,path:"post-date",label:"Date"}),e[21]=b,e[22]=r,e[23]=_):_=e[23];let C;e[24]!==_||e[25]!==c?(C=t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[c,_]}),e[24]=_,e[25]=c,e[26]=C):C=e[26];let h;e[27]===Symbol.for("react.memo_cache_sentinel")?(h={type:"string",format:"image-uri",title:"Cover image"},e[27]=h):h=e[27];let S;e[28]!==o?(S=v=>o("image",v),e[28]=o,e[29]=S):S=e[29];let f;e[30]!==i.image||e[31]!==S?(f=t.jsx(ce,{schema:h,value:i.image,onChange:S,path:"post-image",label:"Cover image"}),e[30]=i.image,e[31]=S,e[32]=f):f=e[32];let a;e[33]===Symbol.for("react.memo_cache_sentinel")?(a=["email"],e[33]=a):a=e[33];let d;e[34]!==o?(d=v=>o("authors",v),e[34]=o,e[35]=d):d=e[35];let g;e[36]!==m||e[37]!==i.authors||e[38]!==d?(g=t.jsx(X,{label:"Authors",decofile:m,kind:"authors",valueField:"email",extraFields:a,selected:i.authors,onChange:d}),e[36]=m,e[37]=i.authors,e[38]=d,e[39]=g):g=e[39];let k;e[40]===Symbol.for("react.memo_cache_sentinel")?(k=["slug"],e[40]=k):k=e[40];let P;e[41]!==o?(P=v=>o("categories",v),e[41]=o,e[42]=P):P=e[42];let N;e[43]!==m||e[44]!==i.categories||e[45]!==P?(N=t.jsx(X,{label:"Categories",decofile:m,kind:"categories",valueField:"slug",extraFields:k,selected:i.categories,onChange:P}),e[43]=m,e[44]=i.categories,e[45]=P,e[46]=N):N=e[46];let B;e[47]!==o?(B=v=>o("extraProps",v),e[47]=o,e[48]=B):B=e[48];let w;e[49]!==i.extraProps||e[50]!==B?(w=t.jsx(Ne,{value:i.extraProps,onChange:B}),e[49]=i.extraProps,e[50]=B,e[51]=w):w=e[51];let E;return e[52]!==C||e[53]!==f||e[54]!==g||e[55]!==N||e[56]!==w||e[57]!==u?(E=t.jsxs("div",{className:"space-y-5",children:[u,C,f,g,N,w]}),e[52]=C,e[53]=f,e[54]=g,e[55]=N,e[56]=w,e[57]=u,e[58]=E):E=e[58],E}function Ne(A){const e=H.c(15),{value:i,onChange:m}=A;let o,l,n,p;if(e[0]!==m||e[1]!==i){o=ke(i);const y=(s,c)=>m(o.map((j,b)=>b===s?{...j,...c}:j));l="space-y-2",e[6]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(G,{children:"Extra props"}),e[6]=n):n=e[6],p=o.length>0&&t.jsx("ul",{className:"space-y-2",children:o.map((s,c)=>t.jsxs("li",{className:"group/item flex items-center gap-2",children:[t.jsx(J,{value:s.key,onChange:j=>y(c,{key:j.target.value}),placeholder:"key",className:"h-9 flex-1"}),t.jsx(J,{value:s.value,onChange:j=>y(c,{value:j.target.value}),placeholder:"value",className:"h-9 flex-1"}),t.jsx(je,{label:"Remove prop",onClick:()=>m(o.filter((j,b)=>b!==c))})]},c))}),e[0]=m,e[1]=i,e[2]=o,e[3]=l,e[4]=n,e[5]=p}else o=e[2],l=e[3],n=e[4],p=e[5];let u;e[7]!==o||e[8]!==m?(u=t.jsx(be,{label:"Add prop",onClick:()=>m([...o,{key:"",value:""}])}),e[7]=o,e[8]=m,e[9]=u):u=e[9];let x;return e[10]!==l||e[11]!==n||e[12]!==p||e[13]!==u?(x=t.jsxs("div",{className:l,children:[n,p,u]}),e[10]=l,e[11]=n,e[12]=p,e[13]=u,e[14]=x):x=e[14],x}function X(A){const e=H.c(31),{label:i,decofile:m,kind:o,valueField:l,extraFields:n,selected:p,onChange:u}=A;let x,y,s;if(e[0]!==m||e[1]!==o||e[2]!==l){x=de(m,o);let f;e[6]!==l?(f=(d,g)=>F(d[l])||g,e[6]=l,e[7]=f):f=e[7],s=f;let a;e[8]!==s?(a=d=>{const{key:g,payload:k}=d;return{value:s(k,g),label:F(k.name)||s(k,g)}},e[8]=s,e[9]=a):a=e[9],y=x.map(a),e[0]=m,e[1]=o,e[2]=l,e[3]=x,e[4]=y,e[5]=s}else x=e[3],y=e[4],s=e[5];const c=y;let j;if(e[10]!==p||e[11]!==l){const f=Array.isArray(p)?p:[];let a;e[13]!==l?(a=d=>F(d[l]),e[13]=l,e[14]=a):a=e[14],j=f.map(a).filter(Boolean),e[10]=p,e[11]=l,e[12]=j}else j=e[12];const b=j;let r;e[15]!==n||e[16]!==u||e[17]!==x||e[18]!==l||e[19]!==s?(r=f=>{u(f.map(a=>{const d=x.find(k=>{const{key:P,payload:N}=k;return s(N,P)===a});if(!d)return{name:a,[l]:a};const g={name:F(d.payload.name)};for(const k of n)g[k]=d.payload[k]??a;return g}))},e[15]=n,e[16]=u,e[17]=x,e[18]=l,e[19]=s,e[20]=r):r=e[20];const _=r;let C;e[21]!==i?(C=t.jsx(G,{children:i}),e[21]=i,e[22]=C):C=e[22];let h;e[23]!==b||e[24]!==_||e[25]!==i||e[26]!==c?(h=c.length===0?t.jsxs("p",{className:"text-xs text-muted-foreground",children:["No ",i.toLowerCase()," yet — create some in the"," ",i.toLowerCase()," collection."]}):t.jsx(se,{options:c,defaultValue:b,onValueChange:_,placeholder:`Select ${i.toLowerCase()}`,maxCount:4}),e[23]=b,e[24]=_,e[25]=i,e[26]=c,e[27]=h):h=e[27];let S;return e[28]!==C||e[29]!==h?(S=t.jsxs("div",{className:"space-y-2",children:[C,h]}),e[28]=C,e[29]=h,e[30]=S):S=e[30],S}export{pi as PostEditor};
@@ -1 +0,0 @@
1
- import{c as V,j as t,a as T,G as R,ae as q,I as B,s as N,t as I}from"./index-BkSIY6JJ.js";import{P as L}from"./index-RkQpccOp.js";import{A as G}from"./avatar-oAcdiJ9v.js";import{S as D}from"./switch-Cf_WUos9.js";import{d as U,b as Y,a as $,S as K}from"./select-Ct-_FhWe.js";import{T as O,a as z}from"./toggle-group-BE1kDwdz.js";import{I as H}from"./input-jkT1z5r1.js";import{i as J}from"./Monitor01-CZ30bS8J.js";import{n as M,a as Q}from"./Sun-9FxiCes3.js";import{i as W}from"./Play-DvFnuZIO.js";import{u as X}from"./use-debounced-autosave-BnfFXRc0.js";import{p as Z,q as ee}from"./question-004-sINsf4GQ.js";import"./index-K-17SMjl.js";import{c as te,b as A,S as E,a as F}from"./settings-section-D6f1v8Lb.js";import"./sidebar-C45GjVmp.js";import"./LayoutLeft-BqtFvEWV.js";import"./use-mobile-CPyq18pe.js";import"./sheet-CUfjkNRy.js";import"./X-B-cRV-7d.js";import"./tooltip-CAEDbADy.js";import"./User01-B3UbdHmL.js";import"./index-BdQq_4o_.js";import"./ChevronUp-BhWz3ylT.js";import"./ChevronDown-BWfuTI7r.js";import"./card-BIwENur_.js";import"./ArrowUpRight-BeOMO89N.js";function se(){const e=V.c(19),{data:s,isPending:o}=T.useSession(),v=s?.user,p=v?.image,h=v?.name??"";let S;e[0]!==h?(S={values:{name:h}},e[0]=h,e[1]=S):S=e[1];const n=R(S);let _;e[2]!==n?(_={save:async()=>{const g=n.control._formState.dirtyFields;if(Object.keys(g).length===0)return;const a=n.getValues(),f=n.control._defaultValues;n.reset(a,{keepValues:!0});try{await T.updateUser({name:a.name}),N("profile_updated",{fields:["name"]}),I.success("Profile updated successfully")}catch{n.reset(f,{keepValues:!0}),I.error("Failed to update profile")}}},e[2]=n,e[3]=_):_=e[3];const{schedule:x,flush:m}=X(_);if(o)return null;const j=v?.name??"U";let i;e[4]!==j||e[5]!==p?(i=t.jsx(A,{title:"Avatar",action:t.jsx(G,{url:p,fallback:j,shape:"circle",size:"base"})}),e[4]=j,e[5]=p,e[6]=i):i=e[6];let l;e[7]!==m||e[8]!==x?(l=g=>{const{field:a}=g;return t.jsx(H,{id:"display-name",...a,onChange:f=>{a.onChange(f),x()},onBlur:()=>{a.onBlur(),m()},onKeyDown:f=>{f.key==="Enter"&&m()},placeholder:"Your name",className:"w-[280px]"})},e[7]=m,e[8]=x,e[9]=l):l=e[9];let d;e[10]!==n.control||e[11]!==l?(d=t.jsx(A,{title:"Display name",action:t.jsx(q,{control:n.control,name:"name",render:l})}),e[10]=n.control,e[11]=l,e[12]=d):d=e[12];const b=v?.email;let r;e[13]!==b?(r=t.jsx(A,{title:"Email",action:t.jsx("span",{className:"text-sm text-muted-foreground",children:b})}),e[13]=b,e[14]=r):r=e[14];let u;return e[15]!==i||e[16]!==d||e[17]!==r?(u=t.jsx(E,{children:t.jsxs(F,{children:[i,d,r]})}),e[15]=i,e[16]=d,e[17]=r,e[18]=u):u=e[18],u}function oe(){const e=V.c(48),[s,o]=B();let v;e[0]!==o?(v=async c=>{if(c&&await Notification.requestPermission()!=="granted"){N("preferences_notifications_permission_denied"),I.error("Notifications denied. Please enable them in your browser settings."),o(re);return}N("preferences_notifications_toggled",{enabled:c}),o(y=>({...y,enableNotifications:c}))},e[0]=o,e[1]=v):v=e[1];const p=v;let h;e[2]!==o?(h=c=>{c&&(N("preferences_theme_changed",{to_value:c}),o(y=>({...y,theme:c})))},e[2]=o,e[3]=h):h=e[3];let S;e[4]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(z,{value:"light","aria-label":"Light theme",children:t.jsx(M,{size:14})}),e[4]=S):S=e[4];let n;e[5]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(z,{value:"dark","aria-label":"Dark theme",children:t.jsx(Q,{size:14})}),e[5]=n):n=e[5];let _;e[6]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(z,{value:"system","aria-label":"System theme",children:t.jsx(J,{size:14})}),e[6]=_):_=e[6];let x;e[7]!==s.theme||e[8]!==h?(x=t.jsx(A,{title:"Theme",description:"Your preferred color scheme.",action:t.jsxs(O,{type:"single",size:"sm",variant:"outline",value:s.theme,onValueChange:h,children:[S,n,_]})}),e[7]=s.theme,e[8]=h,e[9]=x):x=e[9];let m;e[10]!==p||e[11]!==s.enableNotifications?(m=typeof Notification<"u"?()=>p(!s.enableNotifications):void 0,e[10]=p,e[11]=s.enableNotifications,e[12]=m):m=e[12];let j;e[13]!==p||e[14]!==s.enableNotifications?(j=t.jsx(D,{disabled:typeof Notification>"u",checked:s.enableNotifications,onCheckedChange:p}),e[13]=p,e[14]=s.enableNotifications,e[15]=j):j=e[15];let i;e[16]!==m||e[17]!==j?(i=t.jsx(A,{title:"Notifications",description:"Receive browser notifications for important events.",onClick:m,action:j}),e[16]=m,e[17]=j,e[18]=i):i=e[18];let l;e[19]!==s.enableSounds||e[20]!==o?(l=()=>{N("preferences_sounds_toggled",{enabled:!s.enableSounds}),o(le)},e[19]=s.enableSounds,e[20]=o,e[21]=l):l=e[21];let d;e[22]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("button",{type:"button","aria-label":"Preview notification sound",onClick:ne,className:"size-6 rounded flex items-center justify-center text-muted-foreground hover:text-foreground hover:bg-accent/50 transition-colors cursor-pointer",children:t.jsx(W,{size:11})}),e[22]=d):d=e[22];let b;e[23]!==o?(b=c=>{N("preferences_sounds_toggled",{enabled:c}),o(y=>({...y,enableSounds:c}))},e[23]=o,e[24]=b):b=e[24];let r;e[25]!==s.enableSounds||e[26]!==b?(r=t.jsxs("div",{className:"flex items-center gap-2",children:[d,t.jsx(D,{checked:s.enableSounds,onCheckedChange:b})]}),e[25]=s.enableSounds,e[26]=b,e[27]=r):r=e[27];let u;e[28]!==r||e[29]!==l?(u=t.jsx(A,{title:"Sounds",description:"Play sounds for agent actions and notifications.",onClick:l,action:r}),e[28]=r,e[29]=l,e[30]=u):u=e[30];let g;e[31]!==o?(g=c=>{N("preferences_tool_approval_changed",{to_value:c}),o(y=>({...y,toolApprovalLevel:c}))},e[31]=o,e[32]=g):g=e[32];let a;e[33]!==s.toolApprovalLevel?(a={readonly:"Ask before edit",auto:"Auto approve"}[s.toolApprovalLevel]??"Ask before edit",e[33]=s.toolApprovalLevel,e[34]=a):a=e[34];let f;e[35]!==a?(f=t.jsx(Y,{className:"w-36 h-7 text-xs",children:t.jsx("span",{children:a})}),e[35]=a,e[36]=f):f=e[36];let C;e[37]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx($,{value:"readonly",textValue:"Ask before edit",children:t.jsxs("div",{className:"flex flex-col gap-0.5",children:[t.jsx("span",{className:"font-medium",children:"Ask before edit"}),t.jsx("span",{className:"text-xs text-muted-foreground",children:"Auto-approve read-only tools"})]})}),e[37]=C):C=e[37];let k;e[38]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsxs(K,{children:[C,t.jsx($,{value:"auto",textValue:"Auto approve",children:t.jsxs("div",{className:"flex flex-col gap-0.5",children:[t.jsx("span",{className:"font-medium",children:"Auto approve"}),t.jsx("span",{className:"text-xs text-muted-foreground",children:"Execute all without approval"})]})})]}),e[38]=k):k=e[38];let P;e[39]!==s.toolApprovalLevel||e[40]!==g||e[41]!==f?(P=t.jsx(A,{title:"Tool Approval",description:"Control how tools are approved before execution.",action:t.jsxs(U,{value:s.toolApprovalLevel,onValueChange:g,children:[f,k]})}),e[39]=s.toolApprovalLevel,e[40]=g,e[41]=f,e[42]=P):P=e[42];let w;return e[43]!==u||e[44]!==P||e[45]!==x||e[46]!==i?(w=t.jsx(E,{title:"Preferences",children:t.jsxs(F,{children:[x,i,u,P]})}),e[43]=u,e[44]=P,e[45]=x,e[46]=i,e[47]=w):w=e[47],w}function ne(){N("preferences_sounds_previewed"),Z(ee.dataUri).catch(ie)}function ie(){}function le(e){return{...e,enableSounds:!e.enableSounds}}function re(e){return{...e,enableNotifications:!1}}function ae(){const e=V.c(1);let s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx(L,{children:t.jsx(L.Content,{children:t.jsx(L.Body,{children:t.jsxs(te,{children:[t.jsx(L.Title,{children:"Profile & Preferences"}),t.jsx(se,{}),t.jsx(oe,{})]})})})}),e[0]=s):s=e[0],s}function De(){const e=V.c(1);let s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx(ae,{}),e[0]=s):s=e[0],s}export{De as default};