decocms 3.89.0 → 3.89.2

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 (246) hide show
  1. package/dist/client/assets/{AlertCircle-BMCh3ayd.js → AlertCircle-flSoo6uw.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-CwVMUp5O.js → ArrowUpRight-BeOMO89N.js} +1 -1
  3. package/dist/client/assets/{CheckCircle-BP2lb3AX.js → CheckCircle-B9ekAAw-.js} +1 -1
  4. package/dist/client/assets/{ChevronDown-CkcGr2qp.js → ChevronDown-BWfuTI7r.js} +1 -1
  5. package/dist/client/assets/{ChevronLeft-Cgw9JZYG.js → ChevronLeft-BNcg18cx.js} +1 -1
  6. package/dist/client/assets/{ChevronRight-DYe9AFXl.js → ChevronRight-ChYOVgWd.js} +1 -1
  7. package/dist/client/assets/{ChevronUp-CiXD4kQk.js → ChevronUp-BhWz3ylT.js} +1 -1
  8. package/dist/client/assets/{DotsVertical-Z_h1bSB3.js → DotsVertical-C0YWb9xq.js} +1 -1
  9. package/dist/client/assets/{Eye-B92Ff4dY.js → Eye-DWTUBTZ_.js} +1 -1
  10. package/dist/client/assets/{FilterLines-CMHeCbJ1.js → FilterLines-Djqj6uj_.js} +1 -1
  11. package/dist/client/assets/{Form-GDlYmtQN.js → Form-Czxo_N56.js} +1 -1
  12. package/dist/client/assets/{Globe01-MZlo2_34.js → Globe01-BgRW2EiE.js} +1 -1
  13. package/dist/client/assets/{Globe04-BPWbnzx0.js → Globe04-XITcP2mp.js} +1 -1
  14. package/dist/client/assets/{HardDrive-D8FSpDtM.js → HardDrive-DS3VxDtU.js} +1 -1
  15. package/dist/client/assets/{Key01-CZVV-ceU.js → Key01-DX7L8s0Z.js} +1 -1
  16. package/dist/client/assets/{LayoutLeft-CuTI_WR9.js → LayoutLeft-BqtFvEWV.js} +1 -1
  17. package/dist/client/assets/{LinkExternal01-DekFjc9P.js → LinkExternal01-Cf-6A1_h.js} +1 -1
  18. package/dist/client/assets/{Monitor01-BxGhRsUq.js → Monitor01-CZ30bS8J.js} +1 -1
  19. package/dist/client/assets/{Palette-BDlA8RUr.js → Palette-Dy2dQgqx.js} +1 -1
  20. package/dist/client/assets/{Play-BGGUeSDd.js → Play-DvFnuZIO.js} +1 -1
  21. package/dist/client/assets/{Plus-CQOl41pg.js → Plus-jFajoMCA.js} +1 -1
  22. package/dist/client/assets/{SearchMd-Da504yGV.js → SearchMd-uzKFlzQB.js} +1 -1
  23. package/dist/client/assets/{Settings02-ozrzAwut.js → Settings02-47eDNk4K.js} +1 -1
  24. package/dist/client/assets/{Shield01-CYPtC_lA.js → Shield01-BgRa80OR.js} +1 -1
  25. package/dist/client/assets/{Star01-BoZIiKCL.js → Star01-BrkbxV-A.js} +1 -1
  26. package/dist/client/assets/{Stars01-BJuGXG_N.js → Stars01-Daq_eW6a.js} +1 -1
  27. package/dist/client/assets/{Stars02-C4CXFnp9.js → Stars02-DlImJz_z.js} +1 -1
  28. package/dist/client/assets/{Sun-2eUdoD8j.js → Sun-9FxiCes3.js} +1 -1
  29. package/dist/client/assets/{SwitchHorizontal01-DXdcIz27.js → SwitchHorizontal01-CB5mOBIf.js} +1 -1
  30. package/dist/client/assets/{Tool01-WsqNh4er.js → Tool01-rx0lKYM8.js} +1 -1
  31. package/dist/client/assets/{Trash01-z6De146C.js → Trash01-DI7qV1ow.js} +1 -1
  32. package/dist/client/assets/{Upload01-C4sYhZ0M.js → Upload01-Boqk1hvA.js} +1 -1
  33. package/dist/client/assets/{User01-Cvp121NC.js → User01-B3UbdHmL.js} +1 -1
  34. package/dist/client/assets/{Users01-DcrlsWI1.js → Users01-BUyczaeV.js} +1 -1
  35. package/dist/client/assets/{Users03-CJuVy8Iz.js → Users03-gvBLUtvG.js} +1 -1
  36. package/dist/client/assets/{X-DgKWdqZ1.js → X-B-cRV-7d.js} +1 -1
  37. package/dist/client/assets/{XCircle-DFBcUexW.js → XCircle-CkhBWURn.js} +1 -1
  38. package/dist/client/assets/{XClose-BKWXOZkj.js → XClose-Doj89HqF.js} +1 -1
  39. package/dist/client/assets/{Zap-Cxu6aoRs.js → Zap-BCqTHl-x.js} +1 -1
  40. package/dist/client/assets/{ZapSquare-DOK7F1oe.js → ZapSquare-DdgE8vy-.js} +1 -1
  41. package/dist/client/assets/{ZoomOut-ryBmf3S4.js → ZoomOut-BdBjpsIq.js} +1 -1
  42. package/dist/client/assets/{access-gate-DvuwS2Bs.js → access-gate-BXDE0rsJ.js} +1 -1
  43. package/dist/client/assets/{add-section-modal-CEyStjwy.js → add-section-modal-7a6BUncs.js} +1 -1
  44. package/dist/client/assets/{agent-icon-pz8iT5cD.js → agent-icon-C6bJxQ04.js} +1 -1
  45. package/dist/client/assets/agents-list-sjsqj6Ot.js +1 -0
  46. package/dist/client/assets/ai-providers-6xIkfdtm.js +1 -0
  47. package/dist/client/assets/{alert-BwNlkWBE.js → alert-C81LnOX9.js} +1 -1
  48. package/dist/client/assets/{alert-dialog-CkCCiKt9.js → alert-dialog-HmiP05XU.js} +1 -1
  49. package/dist/client/assets/app-editor-k7Nl_uKp.js +1 -0
  50. package/dist/client/assets/{auth-xlfJjVrK.js → auth-B9Q1UUsp.js} +1 -1
  51. package/dist/client/assets/{auth-catchall-HTDRVC4_.js → auth-catchall-ClOrr_P8.js} +1 -1
  52. package/dist/client/assets/{auth-entry-BNYZmdvo.js → auth-entry-B7DIloAw.js} +1 -1
  53. package/dist/client/assets/{auth-split-layout-DuCP9Fwl.js → auth-split-layout-dWTaQKch.js} +1 -1
  54. package/dist/client/assets/{authenticate-and-persist-oauth-DPn6Vk96.js → authenticate-and-persist-oauth-xCkDryiA.js} +1 -1
  55. package/dist/client/assets/{automation-list-row-CCZ8TAPg.js → automation-list-row-CLUMzxuG.js} +1 -1
  56. package/dist/client/assets/{automation-runs-DBQv8Uvp.js → automation-runs-DxPUfxy1.js} +1 -1
  57. package/dist/client/assets/automations-TTHh4EuE.js +1 -0
  58. package/dist/client/assets/{avatar-Bh53txVX.js → avatar-oAcdiJ9v.js} +1 -1
  59. package/dist/client/assets/{badge-CdirlPdy.js → badge-CpKEkIGn.js} +1 -1
  60. package/dist/client/assets/{block-document-D978uGtK.js → block-document-BVHsyU-9.js} +1 -1
  61. package/dist/client/assets/brand-context-CwjLKTtp.js +1 -0
  62. package/dist/client/assets/buckets-CM0nkgpJ.js +1 -0
  63. package/dist/client/assets/{capability-load-error-DgQyDsKl.js → capability-load-error-CG-hWPTN.js} +1 -1
  64. package/dist/client/assets/{card-D_tApM0k.js → card-BIwENur_.js} +1 -1
  65. package/dist/client/assets/category-editor-Bx9oTK3B.js +1 -0
  66. package/dist/client/assets/{chat-context-Dz9rhizY.js → chat-context-DN0_9Gee.js} +1 -1
  67. package/dist/client/assets/{checkbox-OtNKSART.js → checkbox-Bi39v4Qa.js} +1 -1
  68. package/dist/client/assets/{cli-auth-success-BsGnTz93.js → cli-auth-success-pdfiwdy1.js} +1 -1
  69. package/dist/client/assets/collection-detail-BcWtgoUr.js +1 -0
  70. package/dist/client/assets/{collection-display-button-BgYBCk8T.js → collection-display-button-Bzf7YHNy.js} +1 -1
  71. package/dist/client/assets/{collection-search-JfLpXbmD.js → collection-search-DbQr2iji.js} +1 -1
  72. package/dist/client/assets/{collection-tabs-B5YA_dM5.js → collection-tabs-D77_So6e.js} +1 -1
  73. package/dist/client/assets/command-DyJgh8wP.js +1 -0
  74. package/dist/client/assets/commerce-onboarding-CJHzpHob.js +1 -0
  75. package/dist/client/assets/connect-desktop-dialog-ByWaevjw.js +1 -0
  76. package/dist/client/assets/{connection-card--7NnoNLM.js → connection-card-DehsL0Sf.js} +1 -1
  77. package/dist/client/assets/connection-detail-CCaFPgvC.js +1 -0
  78. package/dist/client/assets/{connection-form-helpers-BW7AB-E3.js → connection-form-helpers-CASdXQaW.js} +1 -1
  79. package/dist/client/assets/connections-DZYmLj7X.js +1 -0
  80. package/dist/client/assets/{context-menu-3RQyDKF5.js → context-menu-Bt-E5y3C.js} +1 -1
  81. package/dist/client/assets/{decopilot-CiHv6XGE.js → decopilot-BXlT8NLf.js} +1 -1
  82. package/dist/client/assets/{decopilot-sse-pool-DXv2T192.js → decopilot-sse-pool-CKTJhrtc.js} +1 -1
  83. package/dist/client/assets/{dialog-BFjL_my-.js → dialog-BLvz2lK8.js} +1 -1
  84. package/dist/client/assets/{domain-settings-CuN5wwNc.js → domain-settings-ed9WclHg.js} +1 -1
  85. package/dist/client/assets/{drawer-DZMXZPMN.js → drawer-C4RJ4_GY.js} +1 -1
  86. package/dist/client/assets/{dropdown-menu-B1DaP6vk.js → dropdown-menu-CRyIPZil.js} +1 -1
  87. package/dist/client/assets/{empty-state-Lmcbk0Zv.js → empty-state-CmZpGujH.js} +1 -1
  88. package/dist/client/assets/{extract-connection-data-Bau_aQvM.js → extract-connection-data-iACc8UZO.js} +1 -1
  89. package/dist/client/assets/file-explorer-BveBp463.js +2 -0
  90. package/dist/client/assets/{file-type-icon-CWgZWEkL.js → file-type-icon-Db262N7w.js} +1 -1
  91. package/dist/client/assets/{files-C6shWZY2.js → files-BwDocccC.js} +1 -1
  92. package/dist/client/assets/{form-B6Nf7hvD.js → form-CPJbrMq5.js} +1 -1
  93. package/dist/client/assets/general-FW5Wth3b.js +1 -0
  94. package/dist/client/assets/{github-repo-picker-CThHTj5h.js → github-repo-picker-Db_ehY6e.js} +1 -1
  95. package/dist/client/assets/{hooks-CFfc1t5D.js → hooks-chgqRyLj.js} +1 -1
  96. package/dist/client/assets/{import-from-deco-dialog-DnC_H8Us.js → import-from-deco-dialog-Nrpq_g30.js} +1 -1
  97. package/dist/client/assets/{index-C2QgbLxn.js → index-1ECwD4fs.js} +12 -12
  98. package/dist/client/assets/{index-CjtDPqlj.js → index-4GXqE9fp.js} +2 -2
  99. package/dist/client/assets/{index-CurNB2HG.js → index-BkSIY6JJ.js} +3 -3
  100. package/dist/client/assets/index-D5RW_4sI.js +1 -0
  101. package/dist/client/assets/{index-BVXtRunj.js → index-D7a1JQHt.js} +2 -2
  102. package/dist/client/assets/{index-ovnDLwrg.js → index-DAWoaMpc.js} +1 -1
  103. package/dist/client/assets/{index-BDyN-RAN.js → index-DAmj773w.js} +1 -1
  104. package/dist/client/assets/{index-BK0DpA7w.js → index-DC36sAC_.js} +2 -2
  105. package/dist/client/assets/{index-ZANilAX7.js → index-DFNABgCe.js} +1 -1
  106. package/dist/client/assets/index-DoculpR5.js +1 -0
  107. package/dist/client/assets/{index-C0_iRWcE.js → index-K-17SMjl.js} +1 -1
  108. package/dist/client/assets/{index-C_XJPG8Z.js → index-QdluHxPe.js} +1 -1
  109. package/dist/client/assets/{index-qZ5-LmpP.js → index-RkQpccOp.js} +1 -1
  110. package/dist/client/assets/index-UgEhsCuR.js +1 -0
  111. package/dist/client/assets/{index-BzszuDGF.css → index-rS_HhTdz.css} +1 -1
  112. package/dist/client/assets/{index-redirect-Cc9Y9Kn-.js → index-redirect-DO0D1qdv.js} +1 -1
  113. package/dist/client/assets/{input-RRjvrcUF.js → input-jkT1z5r1.js} +1 -1
  114. package/dist/client/assets/{integration-icon-Dpj2NSXY.js → integration-icon-CZDEviNI.js} +1 -1
  115. package/dist/client/assets/{label-DrXdAtn0.js → label-CETsHBZ0.js} +1 -1
  116. package/dist/client/assets/{login-CdGM36BM.js → login-eY2xl_Qt.js} +1 -1
  117. package/dist/client/assets/{mcp-oauth-B5dnAc7V.js → mcp-oauth-BIBzZgcE.js} +1 -1
  118. package/dist/client/assets/{members-C-wG0rnC.js → members-BAHTTEXJ.js} +2 -2
  119. package/dist/client/assets/{monaco-editor-zMbhl8rq.js → monaco-editor-tVsx1Jkl.js} +1 -1
  120. package/dist/client/assets/{monitoring-stats-row-BnDnFbz0.js → monitoring-stats-row-CivwdnUP.js} +1 -1
  121. package/dist/client/assets/{oauth-callback-Dkf89E49.js → oauth-callback-BnrL3BsC.js} +1 -1
  122. package/dist/client/assets/{oauth-callback-ai-provider-BzTdkWaI.js → oauth-callback-ai-provider-D3_UsvKg.js} +1 -1
  123. package/dist/client/assets/{onboarding-CK9ke2oh.js → onboarding-Cde-ZfY9.js} +1 -1
  124. package/dist/client/assets/{org-install-CyaR-8_i.js → org-install-Cri2HTyv.js} +1 -1
  125. package/dist/client/assets/{org-layout-BDwAg4pd.js → org-layout-DH1oGgfN.js} +1 -1
  126. package/dist/client/assets/{organization-choice-BcGxKG4I.js → organization-choice-BZIXFBHd.js} +1 -1
  127. package/dist/client/assets/{page-seo-form-CvCtyrxH.js → page-seo-form-DCgyqE3q.js} +1 -1
  128. package/dist/client/assets/page-seo-sheet-o3dCAhA-.js +1 -0
  129. package/dist/client/assets/{popover-D7BamlkK.js → popover-1pFpRX6s.js} +1 -1
  130. package/dist/client/assets/post-editor-CWr-_gb_.js +1 -0
  131. package/dist/client/assets/{preview-dialog-C9Rx0Dtg.js → preview-dialog-DRmrGWbh.js} +1 -1
  132. package/dist/client/assets/{primitives-BmW50XTY.js → primitives-C06Pn9p4.js} +1 -1
  133. package/dist/client/assets/profile-62y90jm_.js +1 -0
  134. package/dist/client/assets/project-app-view-BeZFUwcQ.js +1 -0
  135. package/dist/client/assets/record-editor-BsdzrkRD.js +1 -0
  136. package/dist/client/assets/registry-DpNbpkzg.js +2 -0
  137. package/dist/client/assets/{registry-layout-D86NULga.js → registry-layout-Dww7dssY.js} +2 -2
  138. package/dist/client/assets/{require-capability-CBJ6cwe3.js → require-capability-BC8YsasG.js} +1 -1
  139. package/dist/client/assets/{required-auth-layout-Be__d9RH.js → required-auth-layout-DjRtF3m8.js} +1 -1
  140. package/dist/client/assets/{reset-password-CFeeThio.js → reset-password-DNWeSy4_.js} +1 -1
  141. package/dist/client/assets/roles-Cyz3Z1vr.js +1 -0
  142. package/dist/client/assets/{save-status-C9pT75mA.js → save-status-BsQDaUlP.js} +1 -1
  143. package/dist/client/assets/{scroll-area-CbWYdgRA.js → scroll-area-D51A_KQ5.js} +1 -1
  144. package/dist/client/assets/{search-input-CeqwXCv0.js → search-input-CEqRaXj6.js} +1 -1
  145. package/dist/client/assets/secrets-C6bKEzDN.js +1 -0
  146. package/dist/client/assets/{sections-editor-uxePiNCk.js → sections-editor-331tz7B6.js} +2 -2
  147. package/dist/client/assets/{select-BePf1IJF.js → select-Ct-_FhWe.js} +1 -1
  148. package/dist/client/assets/select-model-DJ7vH3M2.js +1 -0
  149. package/dist/client/assets/seo-editor-Ad8X__jc.js +1 -0
  150. package/dist/client/assets/settings-layout-CSyEHpma.js +1 -0
  151. package/dist/client/assets/{settings-section-ELYurXQx.js → settings-section-D6f1v8Lb.js} +1 -1
  152. package/dist/client/assets/{sheet-Djk8ol5s.js → sheet-CUfjkNRy.js} +1 -1
  153. package/dist/client/assets/{shell-controls-CqOBDieU.js → shell-controls-C6FYdYnB.js} +1 -1
  154. package/dist/client/assets/{shell-layout-BkVrkYmb.js → shell-layout-CR4YIb2n.js} +1 -1
  155. package/dist/client/assets/{shell-route-loading-gKBpXu2h.js → shell-route-loading-fK7OWXny.js} +1 -1
  156. package/dist/client/assets/sidebar-C45GjVmp.js +1 -0
  157. package/dist/client/assets/{skeleton-DrM35KBr.js → skeleton-h95MLET_.js} +1 -1
  158. package/dist/client/assets/{sortable.esm-BN6bAoSL.js → sortable.esm-CbeYFn14.js} +2 -2
  159. package/dist/client/assets/sso-DGooE6a8.js +1 -0
  160. package/dist/client/assets/store-O5BcQA2t.js +1 -0
  161. package/dist/client/assets/store-registry-BPQHh-y5.js +2 -0
  162. package/dist/client/assets/{studio-tools-BvQ8Bli1.js → studio-tools-BgUSKeCY.js} +1 -1
  163. package/dist/client/assets/{switch-dEe0am9a.js → switch-Cf_WUos9.js} +1 -1
  164. package/dist/client/assets/{table-D_zHkpnq.js → table-tHeeUiY0.js} +1 -1
  165. package/dist/client/assets/{tabs-DOJ7e6Z7.js → tabs-CNnqe_sK.js} +1 -1
  166. package/dist/client/assets/{task-status-DLHF9SZS.js → task-status-DzLkYYrk.js} +1 -1
  167. package/dist/client/assets/{textarea-C7j7_npp.js → textarea-BzYVaGJ0.js} +1 -1
  168. package/dist/client/assets/{toggle-group-CSO_yZKm.js → toggle-group-BE1kDwdz.js} +1 -1
  169. package/dist/client/assets/{toolbar-D9CfLhAB.js → toolbar-D5FkjLVB.js} +1 -1
  170. package/dist/client/assets/{tools-list-DC6csFT2.js → tools-list-BKN97Z6h.js} +1 -1
  171. package/dist/client/assets/tooltip-CAEDbADy.js +1 -0
  172. package/dist/client/assets/{types-CDn4NSje.js → types-Dw2dcWcn.js} +1 -1
  173. package/dist/client/assets/{use-ai-providers-D-XhQ6_q.js → use-ai-providers-BcLob6tS.js} +1 -1
  174. package/dist/client/assets/{use-automations-BllXXW29.js → use-automations-CfP4AmpB.js} +1 -1
  175. package/dist/client/assets/{use-capability-DfdnXTfH.js → use-capability-CbeJheXW.js} +1 -1
  176. package/dist/client/assets/{use-clock-tick-DmUrmEeM.js → use-clock-tick-DHvuEFIJ.js} +1 -1
  177. package/dist/client/assets/{use-collections-w44ZyJ1t.js → use-collections-yHRKnSEt.js} +1 -1
  178. package/dist/client/assets/{use-connection-Cvfufzsw.js → use-connection-BPcAXa47.js} +1 -1
  179. package/dist/client/assets/{use-copy-BWQBaWRC.js → use-copy-DOTEBoID.js} +1 -1
  180. package/dist/client/assets/{use-create-virtual-mcp-CGofqNOQ.js → use-create-virtual-mcp-C88JBuQM.js} +1 -1
  181. package/dist/client/assets/{use-debounced-autosave-CaTQp8tz.js → use-debounced-autosave-BnfFXRc0.js} +1 -1
  182. package/dist/client/assets/{use-delete-connection-CNA7qawq.js → use-delete-connection-D1yU7B0G.js} +1 -1
  183. package/dist/client/assets/{use-file-configs-Bg9S5WW4.js → use-file-configs-C8z3zSDD.js} +1 -1
  184. package/dist/client/assets/{use-infinite-scroll-BlkXRVRw.js → use-infinite-scroll-V4l3DQJD.js} +1 -1
  185. package/dist/client/assets/{use-join-requests-ByqDno7o.js → use-join-requests-Duz0LeuZ.js} +1 -1
  186. package/dist/client/assets/{use-mcp-client-BbOUwA1H.js → use-mcp-client-DYpZuPPA.js} +1 -1
  187. package/dist/client/assets/{use-mcp-prompts-Y5le4syR.js → use-mcp-prompts-BxOgLeZF.js} +1 -1
  188. package/dist/client/assets/{use-mcp-tools-xGr1pN0n.js → use-mcp-tools-xhV-ENX5.js} +1 -1
  189. package/dist/client/assets/{use-members-blURElyD.js → use-members-CJKZdynB.js} +1 -1
  190. package/dist/client/assets/use-mobile-CPyq18pe.js +1 -0
  191. package/dist/client/assets/{use-navigate-to-agent-CidcWwFC.js → use-navigate-to-agent-Bhu6dr_a.js} +1 -1
  192. package/dist/client/assets/{use-org-auth-client-oMz0ubhe.js → use-org-auth-client-Tiq6Yt9b.js} +1 -1
  193. package/dist/client/assets/{use-org-sso-CIoYIaj1.js → use-org-sso-DGBv3Hvc.js} +1 -1
  194. package/dist/client/assets/{use-organization-roles-tA96x-8d.js → use-organization-roles-1exN43Rd.js} +1 -1
  195. package/dist/client/assets/{use-organization-settings-B5L78CqV.js → use-organization-settings-DFnXSR7Z.js} +1 -1
  196. package/dist/client/assets/{use-registry-connections-3CHe_VwJ.js → use-registry-connections-Czx1u2H6.js} +1 -1
  197. package/dist/client/assets/{use-secrets-DlUSWVTu.js → use-secrets-DqgJI3yC.js} +1 -1
  198. package/dist/client/assets/{use-status-sounds-Bbu_XWuO.js → use-status-sounds-DRhhwMt0.js} +1 -1
  199. package/dist/client/assets/use-view-mode-BB9Jcv_5.js +1 -0
  200. package/dist/client/assets/{use-virtual-mcp-CLJ6qnG1.js → use-virtual-mcp-DnY7c9gE.js} +1 -1
  201. package/dist/client/assets/useInfiniteQuery-DlRMWoIP.js +1 -0
  202. package/dist/client/assets/{useQueries-BqFctUi9.js → useQueries-D96G2W1b.js} +1 -1
  203. package/dist/client/assets/useSuspenseInfiniteQuery-BjlxN-DZ.js +1 -0
  204. package/dist/client/assets/variant-calendar-BlIkgRxn.js +1 -0
  205. package/dist/client/assets/{view-mode-toggle-CIiu6iGh.js → view-mode-toggle-ncGR_sPB.js} +1 -1
  206. package/dist/client/index.html +2 -2
  207. package/dist/server/cli.js +1 -1
  208. package/package.json +1 -1
  209. package/dist/client/assets/agents-list-C2TIIavL.js +0 -1
  210. package/dist/client/assets/ai-providers-bb2flxno.js +0 -1
  211. package/dist/client/assets/app-editor-mcTFLJlr.js +0 -1
  212. package/dist/client/assets/automations-D1p0mjNs.js +0 -1
  213. package/dist/client/assets/brand-context-Ds48Bazs.js +0 -1
  214. package/dist/client/assets/buckets-C6_Hhy5c.js +0 -1
  215. package/dist/client/assets/category-editor-DMZmSuPk.js +0 -1
  216. package/dist/client/assets/collection-detail-8pBdQXs6.js +0 -1
  217. package/dist/client/assets/command-iFNWkWs6.js +0 -1
  218. package/dist/client/assets/commerce-onboarding-CjPSY7Rg.js +0 -1
  219. package/dist/client/assets/connect-desktop-dialog-BxJ3X8re.js +0 -1
  220. package/dist/client/assets/connection-detail-Bak6_MXj.js +0 -1
  221. package/dist/client/assets/connections-MxbhAMWj.js +0 -1
  222. package/dist/client/assets/file-explorer-CdToudqs.js +0 -2
  223. package/dist/client/assets/general-BRjdlS0B.js +0 -1
  224. package/dist/client/assets/index-BtmyrH9L.js +0 -1
  225. package/dist/client/assets/index-DqUFDG_W.js +0 -1
  226. package/dist/client/assets/index-EwbYDv-_.js +0 -1
  227. package/dist/client/assets/page-seo-sheet-lBchETUb.js +0 -1
  228. package/dist/client/assets/post-editor-CJXGoikN.js +0 -1
  229. package/dist/client/assets/profile-CzQbXboe.js +0 -1
  230. package/dist/client/assets/project-app-view-CMzykg6f.js +0 -1
  231. package/dist/client/assets/record-editor-B__3b7h2.js +0 -1
  232. package/dist/client/assets/registry-DpRLil7D.js +0 -2
  233. package/dist/client/assets/roles-P1-HY2OT.js +0 -1
  234. package/dist/client/assets/secrets-EVcWk0yc.js +0 -1
  235. package/dist/client/assets/select-model-CgXZFBIr.js +0 -1
  236. package/dist/client/assets/seo-editor-BpqPSu1k.js +0 -1
  237. package/dist/client/assets/settings-layout-ljEOwxAc.js +0 -1
  238. package/dist/client/assets/sidebar-DLCPSSnc.js +0 -1
  239. package/dist/client/assets/sso-By4pryNN.js +0 -1
  240. package/dist/client/assets/store-BSz8T3hr.js +0 -1
  241. package/dist/client/assets/store-registry-mttn5AI8.js +0 -2
  242. package/dist/client/assets/tooltip-CUlMaf5E.js +0 -1
  243. package/dist/client/assets/use-view-mode-Dff0V9fY.js +0 -1
  244. package/dist/client/assets/useInfiniteQuery-BAIT4yxs.js +0 -1
  245. package/dist/client/assets/useSuspenseInfiniteQuery-DpmGs3CS.js +0 -1
  246. package/dist/client/assets/variant-calendar-CUrfAk6h.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-CurNB2HG.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-DLCPSSnc.js";import{u as ds,T as Me,a as Re,b as Ee,c as vs}from"./tooltip-CUlMaf5E.js";import{u as zr,S as ys,M as Or}from"./shell-controls-CqOBDieU.js";import{a as Pr,b as Dr,c as Mr}from"./ZoomOut-ryBmf3S4.js";import{T as ge,a as ce}from"./toolbar-D9CfLhAB.js";import{S as we}from"./skeleton-DrM35KBr.js";import{P as Bt,a as pt,b as Ut}from"./popover-D7BamlkK.js";import{D as Qs,a as Js,b as Zs}from"./drawer-DZMXZPMN.js";import{i as en}from"./SearchMd-Da504yGV.js";import{s as Rr}from"./Star01-BoZIiKCL.js";import{s as ke}from"./Plus-CQOl41pg.js";import{i as Er,a as Fr}from"./use-mcp-client-BbOUwA1H.js";import{u as tn,a as vt,b as Gr}from"./use-virtual-mcp-CLJ6qnG1.js";import{u as Lr}from"./use-create-virtual-mcp-CGofqNOQ.js";import{I as Hr,u as Br,W as Ur,H as qr,S as Wr}from"./import-from-deco-dialog-DnC_H8Us.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-pz8iT5cD.js";import{G as Qr,a as Jr}from"./github-repo-picker-CThHTj5h.js";import{u as nn,a as Zr,b as rn,T as eo}from"./hooks-CFfc1t5D.js";import{r as to,u as so,R as no,a as ro,b as on}from"./shell-layout-BkVrkYmb.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-CidcWwFC.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-BN6bAoSL.js";import{i as Eo}from"./LayoutLeft-CuTI_WR9.js";import{i as mn}from"./Monitor01-BxGhRsUq.js";import{u as Fo,v as Go,C as Lo}from"./connect-desktop-dialog-BxJ3X8re.js";import{A as ss}from"./avatar-Bh53txVX.js";import{i as us}from"./ChevronUp-CiXD4kQk.js";import{a as ws}from"./Eye-B92Ff4dY.js";import{n as Ho,i as Bo}from"./Globe01-MZlo2_34.js";import{i as Uo,a as fn}from"./ZapSquare-DOK7F1oe.js";import{n as qo,a as Wo}from"./Sun-2eUdoD8j.js";import{a as yt,i as Ko,b as Vo}from"./Settings02-ozrzAwut.js";import{i as Yo}from"./Shield01-CYPtC_lA.js";import{a as Xo}from"./Users03-CJuVy8Iz.js";import{s as ms}from"./XClose-BKWXOZkj.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-CkCCiKt9.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-B6Nf7hvD.js";import{I as ui}from"./input-RRjvrcUF.js";import{S as mi,C as fi}from"./chat-context-Dz9rhizY.js";import"./index-C0_iRWcE.js";import{n as fs}from"./Stars02-C4CXFnp9.js";import{u as pi,a as xi}from"./use-join-requests-ByqDno7o.js";import{i as ps}from"./ChevronRight-DYe9AFXl.js";import{i as hi}from"./FilterLines-CMHeCbJ1.js";import{t as gi}from"./Users01-DcrlsWI1.js";import{S as ks,a as pn,b as Is,c as Ts,d as $s}from"./select-BePf1IJF.js";import{D as bi,a as ji,b as vi,c as yi,d as Si}from"./dialog-BFjL_my-.js";import{C as _i,a as Ni,b as Ci,c as wi,d as ki}from"./command-iFNWkWs6.js";import{u as xn}from"./studio-tools-BvQ8Bli1.js";import{i as hn}from"./Zap-Cxu6aoRs.js";import{u as Ii}from"./use-org-auth-client-oMz0ubhe.js";import{C as Ot,a as As,b as gn,c as bn,d as jn}from"./context-menu-3RQyDKF5.js";import{g as Ti,S as $i}from"./task-status-DLHF9SZS.js";import{u as Ai,f as zi}from"./use-clock-tick-DmUrmEeM.js";import{t as vn}from"./ChevronDown-CkcGr2qp.js";import{S as Oi}from"./shell-route-loading-gKBpXu2h.js";import"./sheet-Djk8ol5s.js";import"./X-DgKWdqZ1.js";import"./ChevronLeft-Cgw9JZYG.js";import"./auth-xlfJjVrK.js";import"./use-collections-w44ZyJ1t.js";import"./use-connection-Cvfufzsw.js";import"./collection-search-JfLpXbmD.js";import"./AlertCircle-BMCh3ayd.js";import"./Tool01-WsqNh4er.js";import"./SwitchHorizontal01-DXdcIz27.js";import"./XCircle-DFBcUexW.js";import"./ArrowUpRight-CwVMUp5O.js";import"./CheckCircle-BP2lb3AX.js";import"./DotsVertical-Z_h1bSB3.js";import"./Globe04-BPWbnzx0.js";import"./HardDrive-D8FSpDtM.js";import"./Key01-CZVV-ceU.js";import"./LinkExternal01-DekFjc9P.js";import"./Palette-BDlA8RUr.js";import"./Play-BGGUeSDd.js";import"./Stars01-BJuGXG_N.js";import"./Trash01-z6De146C.js";import"./Upload01-C4sYhZ0M.js";import"./User01-Cvp121NC.js";import"./checkbox-OtNKSART.js";import"./authenticate-and-persist-oauth-DPn6Vk96.js";import"./mcp-oauth-B5dnAc7V.js";import"./use-mcp-tools-xGr1pN0n.js";import"./extract-connection-data-Bau_aQvM.js";import"./decopilot-sse-pool-DXv2T192.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./required-auth-layout-Be__d9RH.js";import"./tab-id-BptcWVWa.js";import"./use-organization-settings-B5L78CqV.js";import"./use-org-sso-CIoYIaj1.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card--7NnoNLM.js";import"./use-registry-connections-3CHe_VwJ.js";import"./useInfiniteQuery-BAIT4yxs.js";import"./use-infinite-scroll-BlkXRVRw.js";import"./card-D_tApM0k.js";import"./integration-icon-Dpj2NSXY.js";import"./collection-tabs-B5YA_dM5.js";import"./badge-CdirlPdy.js";import"./textarea-C7j7_npp.js";import"./connection-form-helpers-BW7AB-E3.js";import"./useSuspenseInfiniteQuery-DpmGs3CS.js";import"./use-ai-providers-D-XhQ6_q.js";import"./label-DrXdAtn0.js";import"./use-capability-DfdnXTfH.js";import"./index-BdQq_4o_.js";import"./index-BDyN-RAN.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(vs,{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.0"]}),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(vs,{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.0"]}),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 tu(){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(ys,{}),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(ys,{}),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{tu as default};
@@ -1 +0,0 @@
1
- import{bg as st,bh as q,bi as De,C as c,ak as A,aF as Y,bj as Le,aC as _,bk as pe,bl as G,aD as ee,bm as le,z as p,bn as He,bo as Ve,bp as nt,bq as it,br as Ke,bs as ot,bt as at,bu as lt,bv as Ye,bw as ct,b6 as Z,bx as ut,aE as K,by as dt,c as U,r as F,l as _e,j as o,aP as Qe,w as Ue,a as ft,t as xe,B as Ce,i as $e,b as mt,E as ht,aa as pt}from"./index-CurNB2HG.js";import{P as ce}from"./index-qZ5-LmpP.js";import{E as Xe}from"./empty-state-Lmcbk0Zv.js";import{A as gt,f as bt,h as yt,n as xt,j as vt,k as wt,i as St,u as jt}from"./use-mcp-client-BbOUwA1H.js";import{c as _t}from"./use-mcp-tools-xGr1pN0n.js";import{c as Ct}from"./ZoomOut-ryBmf3S4.js";import{i as Et}from"./Key01-CZVV-ceU.js";import{b as Nt,u as Ot,a as Tt}from"./use-connection-Cvfufzsw.js";import{U as ue,a as Ne,e as We}from"./auth-xlfJjVrK.js";import{i as kt,c as It,d as Pt,e as Mt}from"./extract-connection-data-Bau_aQvM.js";import{u as At}from"./use-registry-connections-3CHe_VwJ.js";import{b as Rt}from"./use-organization-settings-B5L78CqV.js";import{s as Lt}from"./Plus-CQOl41pg.js";import{d as Ht,b as Ut,c as $t,S as Ft,a as Bt}from"./select-BePf1IJF.js";import{F as Dt,v as Vt}from"./Form-GDlYmtQN.js";import"./index-C_XJPG8Z.js";import{A as et}from"./agent-icon-pz8iT5cD.js";import{I as Wt}from"./input-RRjvrcUF.js";import{a as qt,b as zt,P as Gt}from"./popover-D7BamlkK.js";import{u as Jt,a as Zt,T as Kt,c as Yt,b as Qt}from"./tooltip-CUlMaf5E.js";import{u as Xt}from"./use-virtual-mcp-CLJ6qnG1.js";import{i as er}from"./ChevronUp-CiXD4kQk.js";import{i as tr}from"./SearchMd-Da504yGV.js";import{a as rr}from"./Users03-CJuVy8Iz.js";import{u as sr}from"./use-create-virtual-mcp-CGofqNOQ.js";function nr(){const t=new gt({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0,code:{optimize:!1}});return st(t),t}class ir{#e=nr();#t=new Map;#r=new WeakMap;getValidator(e){const r=this.#r.get(e);if(r)return r;let s;const n=i=>{if(!s){const a=or(e);let l=this.#t.get(a);l||(l=this.#e.compile(e),this.#t.set(a,l)),s=l}return s(i)?{valid:!0,data:i,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this.#e.errorsText(s.errors)}};return this.#r.set(e,n),n}}function or(t){return JSON.stringify(t,(e,r)=>r&&typeof r=="object"&&!Array.isArray(r)?Object.fromEntries(Object.keys(r).sort().map(s=>[s,r[s]])):r)}const ar=new ir;var lr=class{apply(t,e){if(!e.type)return;const r=Array.isArray(e.type)?e.type:[e.type],s=new Set(r);if(s.has("string")||(t.string=!1),!s.has("number")&&!s.has("integer")&&(t.number=!1),s.has("boolean")||(t.boolean=!1),s.has("null")||(t.null=!1),s.has("array")||(t.array=!1),s.has("object")||(t.object=!1),s.has("integer")&&t.number!==!1){const n=t.number||A();n instanceof le&&(t.number=n.int())}}},cr=class{apply(t,e){if(e.const===void 0)return;const r=e.const;t.string=!1,t.number=!1,t.boolean=!1,t.null=!1,t.array=!1,t.object=!1,typeof r=="string"?t.string=G(r):typeof r=="number"?t.number=G(r):typeof r=="boolean"?t.boolean=G(r):r===null?t.null=Le():Array.isArray(r)?t.array=void 0:typeof r=="object"&&(t.object=void 0)}},ur=class{apply(t,e){if(!e.enum)return;if(e.enum.length===0){e.type||(t.string=!1,t.number=!1,t.boolean=!1,t.null=!1,t.array=!1,t.object=!1);return}const r={string:e.enum.filter(s=>typeof s=="string"),number:e.enum.filter(s=>typeof s=="number"),boolean:e.enum.filter(s=>typeof s=="boolean"),null:e.enum.filter(s=>s===null),array:e.enum.filter(s=>Array.isArray(s)),object:e.enum.filter(s=>typeof s=="object"&&s!==null&&!Array.isArray(s))};t.string=this.createTypeSchema(r.string,"string"),t.number=this.createTypeSchema(r.number,"number"),t.boolean=this.createTypeSchema(r.boolean,"boolean"),t.null=r.null.length>0?Le():!1,t.array=r.array.length>0?void 0:!1,t.object=r.object.length>0?void 0:!1}createTypeSchema(t,e){if(t.length===0)return!1;if(t.length===1)return G(t[0]);if(e==="string")return ee(t);if(e==="number"){const[r,s,...n]=t;return pe([G(r),G(s),...n.map(i=>G(i))])}return e==="boolean"?pe([G(!0),G(!1)]):!1}},dr=class{apply(t,e){const r=e;if(r.type==="string"&&r.format==="binary"&&r.contentEncoding==="binary"){let s=lt();r.minLength!==void 0&&(s=s.min(r.minLength)),r.maxLength!==void 0&&(s=s.max(r.maxLength)),r.contentMediaType!==void 0&&(s=s.mime(r.contentMediaType)),t.file=s,t.string=!1}}},fr=class{apply(t,e){const r=e;e.type===void 0&&(r.minLength!==void 0||r.maxLength!==void 0||r.pattern!==void 0)&&t.string===void 0&&(t.string=c())}},mr=class{apply(t,e){const r=e;if(r.minLength!==void 0&&t.string!==!1){const s=t.string||c();s instanceof He&&(t.string=s.refine(n=>Array.from(n).length>=r.minLength,{message:`String must be at least ${r.minLength} characters long`}))}}},hr=class{apply(t,e){const r=e;if(r.maxLength!==void 0&&t.string!==!1){const s=t.string||c();s instanceof He&&(t.string=s.refine(n=>Array.from(n).length<=r.maxLength,{message:`String must be at most ${r.maxLength} characters long`}))}}},pr=class{apply(t,e){const r=e;if(r.pattern&&t.string!==!1){const s=t.string||c();if(s instanceof He){const n=new RegExp(r.pattern);t.string=s.regex(n)}}}},gr=class{apply(t,e){const r=e;if(r.minimum!==void 0&&t.number!==!1){const s=t.number||A();s instanceof le&&(t.number=s.min(r.minimum))}}},br=class{apply(t,e){const r=e;if(r.maximum!==void 0&&t.number!==!1){const s=t.number||A();s instanceof le&&(t.number=s.max(r.maximum))}}},yr=class{apply(t,e){const r=e;if(r.exclusiveMinimum!==void 0&&t.number!==!1){const s=t.number||A();s instanceof le&&(typeof r.exclusiveMinimum=="number"?t.number=s.gt(r.exclusiveMinimum):t.number=!1)}}},xr=class{apply(t,e){const r=e;if(r.exclusiveMaximum!==void 0&&t.number!==!1){const s=t.number||A();s instanceof le&&(typeof r.exclusiveMaximum=="number"?t.number=s.lt(r.exclusiveMaximum):t.number=!1)}}},vr=class{apply(t,e){const r=e;if(r.multipleOf!==void 0&&t.number!==!1){const s=t.number||A();s instanceof le&&(t.number=s.refine(n=>{if(r.multipleOf===0)return!1;const i=n/r.multipleOf,a=Math.round(i),l=Math.min(Math.abs(n)*Number.EPSILON*10,Math.abs(r.multipleOf)*Number.EPSILON*10);return Math.abs(i-a)<=l/Math.abs(r.multipleOf)},{message:`Must be a multiple of ${r.multipleOf}`}))}}},wr=class{apply(t,e){const r=e;e.type===void 0&&(r.minItems!==void 0||r.maxItems!==void 0||r.items!==void 0||r.prefixItems!==void 0)&&t.array===void 0&&(t.array=_(q()))}},Sr=class{apply(t,e){const r=e;r.minItems!==void 0&&t.array!==!1&&(t.array=(t.array||_(q())).min(r.minItems))}},jr=class{apply(t,e){const r=e;r.maxItems!==void 0&&t.array!==!1&&(t.array=(t.array||_(q())).max(r.maxItems))}},_r=class{apply(t,e){const r=e;if(t.array!==!1)if(Array.isArray(r.items))t.array=t.array||_(q());else if(r.items&&typeof r.items!="boolean"&&!r.prefixItems){const s=$(r.items);let n=_(s);if(t.array&&t.array instanceof nt){const i=t.array._def;i.checks&&i.checks.forEach(a=>{if(a._zod&&a._zod.def){const l=a._zod.def;l.check==="min_length"&&l.minimum!==void 0?n=n.min(l.minimum):l.check==="max_length"&&l.maximum!==void 0&&(n=n.max(l.maximum))}})}t.array=n}else typeof r.items=="boolean"&&r.items===!1?r.prefixItems?t.array=t.array||_(q()):t.array=_(q()).max(0):typeof r.items=="boolean"&&r.items===!0?t.array=t.array||_(q()):r.prefixItems&&(t.array=t.array||_(q()))}},Cr=class{apply(t,e){if(e.type!=="array")return;const r=e;if(!Array.isArray(r.items)||t.array===!1)return;const s=r.items.map(i=>$(i));let n;s.length===0?n=Ve([]):n=Ve(s),r.minItems!==void 0&&r.minItems>s.length&&(n=!1),r.maxItems!==void 0&&r.maxItems<s.length&&(n=!1),t.tuple=n,t.array=!1}},Er=class{apply(t,e){const r=e;t.object!==!1&&(r.properties||r.required||r.additionalProperties!==void 0)&&(t.object=t.object||p({}).passthrough())}},Nr=class{apply(t,e){const r=e;e.type===void 0&&(r.maxProperties!==void 0||r.minProperties!==void 0)&&t.object===void 0&&(t.object=p({}).passthrough())}},Or=class{apply(t,e){const r=e;if(r.maxProperties!==void 0&&t.object!==!1){const s=t.object||p({}).passthrough();t.object=s.refine(n=>Object.keys(n).length<=r.maxProperties,{message:`Object must have at most ${r.maxProperties} properties`})}}},Tr=class{apply(t,e){const r=e;if(r.minProperties!==void 0&&t.object!==!1){const s=t.object||p({}).passthrough();t.object=s.refine(n=>Object.keys(n).length>=r.minProperties,{message:`Object must have at least ${r.minProperties} properties`})}}};function ge(t,e){if(t===e)return!0;if(t==null||e==null)return t===e;if(typeof t!=typeof e)return!1;if(Array.isArray(t)&&Array.isArray(e))return t.length!==e.length?!1:t.every((r,s)=>ge(r,e[s]));if(typeof t=="object"&&typeof e=="object"){const r=Object.keys(t),s=Object.keys(e);return r.length!==s.length?!1:r.every(n=>s.includes(n)&&ge(t[n],e[n]))}return!1}function kr(){return t=>{if(!Array.isArray(t))return!0;const e=[];return t.every(r=>e.some(n=>ge(r,n))?!1:(e.push(r),!0))}}function Se(t,e){return t.safeParse(e).success}var Ir=class{apply(t,e){if(!e.not)return t;const r=$(e.not);return t.refine(s=>!Se(r,s),{message:"Value must not match the 'not' schema"})}},Pr=class{apply(t,e){return e.uniqueItems!==!0?t:t.refine(kr(),{message:"Array items must be unique"})}},Mr=class{apply(t,e){return!e.allOf||e.allOf.length===0?t:e.allOf.map(s=>$(s)).reduce((s,n)=>Ke(s,n),t)}},Ar=class{apply(t,e){if(!e.anyOf||e.anyOf.length===0)return t;const r=e.anyOf.length===1?$(e.anyOf[0]):pe([$(e.anyOf[0]),$(e.anyOf[1]),...e.anyOf.slice(2).map(s=>$(s))]);return Ke(t,r)}},Rr=class{apply(t,e){if(!e.oneOf||e.oneOf.length===0)return t;const r=e.oneOf.map(s=>$(s));return t.refine(s=>{let n=0;for(const i of r)if(i.safeParse(s).success&&(n++,n>1))return!1;return n===1},{message:"Value must match exactly one of the oneOf schemas"})}},Lr=class{apply(t,e){const r=e;if(r.prefixItems&&Array.isArray(r.prefixItems)){const n=r.prefixItems.map(i=>$(i));return t.refine(i=>{if(!Array.isArray(i))return!0;for(let a=0;a<Math.min(i.length,n.length);a++)if(!Se(n[a],i[a]))return!1;if(i.length>n.length){if(typeof r.items=="boolean"&&r.items===!1)return!1;if(r.items&&typeof r.items=="object"&&!Array.isArray(r.items)){const a=$(r.items);for(let l=n.length;l<i.length;l++)if(!Se(a,i[l]))return!1}}return!0},{message:"Array does not match prefixItems schema"})}return t}},Hr=class{apply(t,e){const r=e;if(!r.properties&&!r.required&&r.additionalProperties!==!1)return t;if(t instanceof ot||t instanceof at){const s={};if(r.properties)for(const[n,i]of Object.entries(r.properties))i!==void 0&&(s[n]=$(i));if(r.required&&Array.isArray(r.required)){const n=new Set(r.required);for(const i of Object.keys(s))n.has(i)||(s[i]=s[i].optional())}else for(const n of Object.keys(s))s[n]=s[n].optional();return r.additionalProperties===!1?p(s):p(s).passthrough()}return t.refine(s=>{if(typeof s!="object"||s===null||Array.isArray(s))return!0;if(r.properties){for(const[n,i]of Object.entries(r.properties))if(i!==void 0&&Object.getOwnPropertyDescriptor(s,n)!==void 0&&!$(i).safeParse(s[n]).success)return!1}if(r.required&&Array.isArray(r.required)){for(const n of r.required)if(!(Object.getOwnPropertyDescriptor(s,n)!==void 0))return!1}if(r.additionalProperties===!1&&r.properties){const n=new Set(Object.keys(r.properties));for(const i in s)if(!n.has(i))return!1}return!0},{message:"Object constraints validation failed"})}},Ur=class{apply(t,e){if(!e.enum||e.enum.length===0)return t;const r=e.enum.filter(s=>Array.isArray(s)||typeof s=="object"&&s!==null);return r.length===0?t:t.refine(s=>typeof s!="object"||s===null?!0:r.some(n=>ge(s,n)),{message:"Value must match one of the enum values"})}},$r=class{apply(t,e){if(e.const===void 0)return t;const r=e.const;return typeof r!="object"||r===null?t:t.refine(s=>ge(s,r),{message:"Value must equal the const value"})}},Fr=class{apply(t,e){return e.description&&(t=t.describe(e.description)),t}},Br=class{apply(t,e){var r;const s=e;return!((r=s.required)!=null&&r.includes("__proto__"))||e.type!==void 0?t:q().refine(n=>this.validateRequired(n,s.required),{message:"Missing required properties"})}validateRequired(t,e){return typeof t!="object"||t===null||Array.isArray(t)?!0:e.every(r=>Object.prototype.hasOwnProperty.call(t,r))}},Dr=class{apply(t,e){var r;const s=e;if(s.contains===void 0)return t;const n=$(s.contains),i=(r=s.minContains)!=null?r:1,a=s.maxContains;return t.refine(l=>{if(!Array.isArray(l))return!0;let d=0;for(const u of l)Se(n,u)&&d++;return!(d<i||a!==void 0&&d>a)},{message:"Array must contain required items matching the schema"})}},Vr=class{apply(t,e){const{default:r}=e;return r===void 0||!t.safeParse(r).success?t:t.default(r)}},Wr=[new cr,new ur,new lr,new dr,new fr,new wr,new Nr,new mr,new hr,new pr,new gr,new br,new yr,new xr,new vr,new Cr,new Sr,new jr,new _r,new Or,new Tr,new Er],qr=[new Br,new Ur,new $r,new Mr,new Ar,new Rr,new Lr,new Hr,new Dr,new Ir,new Pr,new Vr,new Fr];function $(t){if(typeof t=="boolean")return t?q():De();const e={};for(const n of Wr)n.apply(e,t);const r=[];if(e.string!==!1&&r.push(e.string||c()),e.number!==!1&&r.push(e.number||A()),e.boolean!==!1&&r.push(e.boolean||Y()),e.null!==!1&&r.push(e.null||Le()),e.array!==!1&&r.push(e.array||_(q())),e.tuple!==!1&&e.tuple!==void 0&&r.push(e.tuple),e.object!==!1)if(e.object)r.push(e.object);else{const n=it(i=>typeof i=="object"&&i!==null&&!Array.isArray(i),"Must be an object, not an array");r.push(n)}e.file!==!1&&e.file!==void 0&&r.push(e.file);let s;r.length===0?s=De():r.length===1?s=r[0]:Object.keys(t).some(i=>i!=="$schema"&&i!=="title"&&i!=="description")?s=pe(r):s=q();for(const n of qr)s=n.apply(s,t);return s}class qe extends Event{constructor(e,r){var s,n;super(e),this.code=(s=r?.code)!=null?s:void 0,this.message=(n=r?.message)!=null?n:void 0}[Symbol.for("nodejs.util.inspect.custom")](e,r,s){return s(ze(this),r)}[Symbol.for("Deno.customInspect")](e,r){return e(ze(this),r)}}function zr(t){const e=globalThis.DOMException;return typeof e=="function"?new e(t,"SyntaxError"):new SyntaxError(t)}function Oe(t){return t instanceof Error?"errors"in t&&Array.isArray(t.errors)?t.errors.map(Oe).join(", "):"cause"in t&&t.cause instanceof Error?`${t}: ${Oe(t.cause)}`:t.message:`${t}`}function ze(t){return{type:t.type,message:t.message,code:t.code,defaultPrevented:t.defaultPrevented,cancelable:t.cancelable,timeStamp:t.timeStamp}}var tt=t=>{throw TypeError(t)},Fe=(t,e,r)=>e.has(t)||tt("Cannot "+r),v=(t,e,r)=>(Fe(t,e,"read from private field"),r?r.call(t):e.get(t)),H=(t,e,r)=>e.has(t)?tt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),T=(t,e,r,s)=>(Fe(t,e,"write to private field"),e.set(t,r),r),J=(t,e,r)=>(Fe(t,e,"access private method"),r),D,X,se,ve,je,me,oe,he,Q,ne,ae,ie,de,z,Te,ke,Ie,Ge,Pe,Me,fe,Ae,Re;class we extends EventTarget{constructor(e,r){var s,n;super(),H(this,z),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,H(this,D),H(this,X),H(this,se),H(this,ve),H(this,je),H(this,me),H(this,oe),H(this,he,null),H(this,Q),H(this,ne),H(this,ae,null),H(this,ie,null),H(this,de,null),H(this,ke,async i=>{var a;v(this,ne).reset();const{body:l,redirected:d,status:u,headers:m}=i;if(u===204){J(this,z,fe).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(d?T(this,se,new URL(i.url)):T(this,se,void 0),u!==200){J(this,z,fe).call(this,`Non-200 status code (${u})`,u);return}if(!(m.get("content-type")||"").startsWith("text/event-stream")){J(this,z,fe).call(this,'Invalid content type, expected "text/event-stream"',u);return}if(v(this,D)===this.CLOSED)return;T(this,D,this.OPEN);const f=new Event("open");if((a=v(this,de))==null||a.call(this,f),this.dispatchEvent(f),typeof l!="object"||!l||!("getReader"in l)){J(this,z,fe).call(this,"Invalid response body, expected a web ReadableStream",u),this.close();return}const h=new TextDecoder,x=l.getReader();let y=!0;do{const{done:b,value:w}=await x.read();w&&v(this,ne).feed(h.decode(w,{stream:!b})),b&&(y=!1,v(this,ne).reset(),J(this,z,Ae).call(this))}while(y)}),H(this,Ie,i=>{T(this,Q,void 0),!(i.name==="AbortError"||i.type==="aborted")&&J(this,z,Ae).call(this,Oe(i))}),H(this,Pe,i=>{typeof i.id=="string"&&T(this,he,i.id);const a=new MessageEvent(i.event||"message",{data:i.data,origin:v(this,se)?v(this,se).origin:v(this,X).origin,lastEventId:i.id||""});v(this,ie)&&(!i.event||i.event==="message")&&v(this,ie).call(this,a),this.dispatchEvent(a)}),H(this,Me,i=>{T(this,me,i)}),H(this,Re,()=>{T(this,oe,void 0),v(this,D)===this.CONNECTING&&J(this,z,Te).call(this)});try{if(e instanceof URL)T(this,X,e);else if(typeof e=="string")T(this,X,new URL(e,Gr()));else throw new Error("Invalid URL")}catch{throw zr("An invalid or illegal string was specified")}T(this,ne,bt({onEvent:v(this,Pe),onRetry:v(this,Me)})),T(this,D,this.CONNECTING),T(this,me,3e3),T(this,je,(s=r?.fetch)!=null?s:globalThis.fetch),T(this,ve,(n=r?.withCredentials)!=null?n:!1),J(this,z,Te).call(this)}get readyState(){return v(this,D)}get url(){return v(this,X).href}get withCredentials(){return v(this,ve)}get onerror(){return v(this,ae)}set onerror(e){T(this,ae,e)}get onmessage(){return v(this,ie)}set onmessage(e){T(this,ie,e)}get onopen(){return v(this,de)}set onopen(e){T(this,de,e)}addEventListener(e,r,s){const n=r;super.addEventListener(e,n,s)}removeEventListener(e,r,s){const n=r;super.removeEventListener(e,n,s)}close(){v(this,oe)&&clearTimeout(v(this,oe)),v(this,D)!==this.CLOSED&&(v(this,Q)&&v(this,Q).abort(),T(this,D,this.CLOSED),T(this,Q,void 0))}}D=new WeakMap,X=new WeakMap,se=new WeakMap,ve=new WeakMap,je=new WeakMap,me=new WeakMap,oe=new WeakMap,he=new WeakMap,Q=new WeakMap,ne=new WeakMap,ae=new WeakMap,ie=new WeakMap,de=new WeakMap,z=new WeakSet,Te=function(){T(this,D,this.CONNECTING),T(this,Q,new AbortController),v(this,je)(v(this,X),J(this,z,Ge).call(this)).then(v(this,ke)).catch(v(this,Ie))},ke=new WeakMap,Ie=new WeakMap,Ge=function(){var t;const e={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...v(this,he)?{"Last-Event-ID":v(this,he)}:void 0},cache:"no-store",signal:(t=v(this,Q))==null?void 0:t.signal};return"window"in globalThis&&(e.credentials=this.withCredentials?"include":"same-origin"),e},Pe=new WeakMap,Me=new WeakMap,fe=function(t,e){var r;v(this,D)!==this.CLOSED&&T(this,D,this.CLOSED);const s=new qe("error",{code:e,message:t});(r=v(this,ae))==null||r.call(this,s),this.dispatchEvent(s)},Ae=function(t,e){var r;if(v(this,D)===this.CLOSED)return;T(this,D,this.CONNECTING);const s=new qe("error",{code:e,message:t});(r=v(this,ae))==null||r.call(this,s),this.dispatchEvent(s),T(this,oe,setTimeout(v(this,Re),v(this,me)))},Re=new WeakMap,we.CONNECTING=0,we.OPEN=1,we.CLOSED=2;function Gr(){const t="document"in globalThis?globalThis.document:void 0;return t&&typeof t=="object"&&"baseURI"in t&&typeof t.baseURI=="string"?t.baseURI:void 0}class Jr extends Error{constructor(e,r,s){super(`SSE error: ${r}`),this.code=e,this.event=s}}class Zr{constructor(e,r){this._url=e,this._resourceMetadataUrl=void 0,this._scope=void 0,this._eventSourceInit=r?.eventSourceInit,this._requestInit=r?.requestInit,this._authProvider=r?.authProvider,this._fetch=r?.fetch,this._fetchWithInit=yt(r?.fetch,r?.requestInit)}async _authThenStart(){if(!this._authProvider)throw new ue("No auth provider");let e;try{e=await Ne(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(r){throw this.onerror?.(r),r}if(e!=="AUTHORIZED")throw new ue;return await this._startOrAuth()}async _commonHeaders(){const e={};if(this._authProvider){const s=await this._authProvider.tokens();s&&(e.Authorization=`Bearer ${s.access_token}`)}this._protocolVersion&&(e["mcp-protocol-version"]=this._protocolVersion);const r=xt(this._requestInit?.headers);return new Headers({...e,...r})}_startOrAuth(){const e=this?._eventSourceInit?.fetch??this._fetch??fetch;return new Promise((r,s)=>{this._eventSource=new we(this._url.href,{...this._eventSourceInit,fetch:async(n,i)=>{const a=await this._commonHeaders();a.set("Accept","text/event-stream");const l=await e(n,{...i,headers:a});if(l.status===401&&l.headers.has("www-authenticate")){const{resourceMetadataUrl:d,scope:u}=We(l);this._resourceMetadataUrl=d,this._scope=u}return l}}),this._abortController=new AbortController,this._eventSource.onerror=n=>{if(n.code===401&&this._authProvider){this._authThenStart().then(r,s);return}const i=new Jr(n.code,n.message,n);s(i),this.onerror?.(i)},this._eventSource.onopen=()=>{},this._eventSource.addEventListener("endpoint",n=>{const i=n;try{if(this._endpoint=new URL(i.data,this._url),this._endpoint.origin!==this._url.origin)throw new Error(`Endpoint origin does not match connection origin: ${this._endpoint.origin}`)}catch(a){s(a),this.onerror?.(a),this.close();return}r()}),this._eventSource.onmessage=n=>{const i=n;let a;try{a=Ye.parse(JSON.parse(i.data))}catch(l){this.onerror?.(l);return}this.onmessage?.(a)}})}async start(){if(this._eventSource)throw new Error("SSEClientTransport already started! If using Client class, note that connect() calls start() automatically.");return await this._startOrAuth()}async finishAuth(e){if(!this._authProvider)throw new ue("No auth provider");if(await Ne(this._authProvider,{serverUrl:this._url,authorizationCode:e,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new ue("Failed to authorize")}async close(){this._abortController?.abort(),this._eventSource?.close(),this.onclose?.()}async send(e){if(!this._endpoint)throw new Error("Not connected");try{const r=await this._commonHeaders();r.set("content-type","application/json");const s={...this._requestInit,method:"POST",headers:r,body:JSON.stringify(e),signal:this._abortController?.signal},n=await(this._fetch??fetch)(this._endpoint,s);if(!n.ok){const i=await n.text().catch(()=>null);if(n.status===401&&this._authProvider){const{resourceMetadataUrl:a,scope:l}=We(n);if(this._resourceMetadataUrl=a,this._scope=l,await Ne(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new ue;return this.send(e)}throw new Error(`Error POSTing to endpoint (HTTP ${n.status}): ${i}`)}await n.body?.cancel()}catch(r){throw this.onerror?.(r),r}}setProtocolVersion(e){this._protocolVersion=e}}const Kr="mcp";class Yr{constructor(e){this._url=e}start(){if(this._socket)throw new Error("WebSocketClientTransport already started! If using Client class, note that connect() calls start() automatically.");return new Promise((e,r)=>{this._socket=new WebSocket(this._url,Kr),this._socket.onerror=s=>{const n="error"in s?s.error:new Error(`WebSocket error: ${JSON.stringify(s)}`);r(n),this.onerror?.(n)},this._socket.onopen=()=>{e()},this._socket.onclose=()=>{this.onclose?.()},this._socket.onmessage=s=>{let n;try{n=Ye.parse(JSON.parse(s.data))}catch(i){this.onerror?.(i);return}this.onmessage?.(n)}})}async close(){this._socket?.close()}send(e){return new Promise((r,s)=>{if(!this._socket){s(new Error("Not connected"));return}this._socket?.send(JSON.stringify(e)),r()})}}class Qr extends vt{constructor(e,r){super(e,r)}send(e,r){const s=Xr(e);return s?.type==="emit"?(this.onmessage?.(s.message),Promise.resolve()):s?.type==="suppress"?Promise.resolve():super.send(e,r)}}function Xr(t){const e=t;if(!e||typeof e!="object"||!("method"in e))return null;switch(e.method){case"initialize":{const r=e?.params?.protocolVersion;return r?{type:"emit",message:{result:{protocolVersion:r,capabilities:{tools:{}},serverInfo:{name:"deco-chat-server",version:"1.0.0"}},jsonrpc:e.jsonrpc??"2.0",id:e.id}}:null}case"notifications/roots/list_changed":case"notifications/initialized":case"notifications/cancelled":case"notifications/progress":return{type:"suppress"};default:return null}}class es extends wt{constructor(e,r){super(e,{jsonSchemaValidator:ar,...r})}async listTools(e,r){return await this.request({method:"tools/list",params:e},ct,r)}}const ts=async(t,e,r)=>{const s=rs(t.connection,e,r);if(!s)throw new Error("Unknown MCP connection type");const n=new es({name:t?.name??"MCP Client",version:"1.0.0"});return await n.connect(s),{client:n}},rs=(t,e,r)=>{if(t.type==="Websocket")return new Yr(new URL(t.url));if(t.type!=="SSE"&&t.type!=="HTTP")return null;const n={...t.token?{authorization:`Bearer ${t.token}`}:{},...r??{},..."headers"in t?t.headers||{}:{}};if(t.type==="SSE"){const i={requestInit:{headers:n,signal:e}};return t.token&&(i.eventSourceInit={fetch:(a,l)=>fetch(a,{...l,headers:{...n,Accept:"text/event-stream"},signal:e})}),new Zr(new URL(t.url),i)}return new Qr(new URL(t.url),{requestInit:{headers:n,signal:e,credentials:"include"}})},Je=t=>{try{return JSON.parse(t)}catch{return t}},ye=new Map,Ze=(t,e)=>({...t,id:t.name,inputSchema:t.inputSchema?$(t.inputSchema):void 0,outputSchema:t.outputSchema?$(t.outputSchema):void 0,execute:r=>e(r.context,t.name)});function ss(t){const e=r=>"connection"in t?ts({connection:t.connection},void 0,r):t.client;return new Proxy({},{get(r,s){if(s==="toJSON")return null;if(typeof s!="string")throw new Error("Name must be a string");if(s==="listTools")return l;async function n(d,u=s){const m=t?.debugId?.(),f=m?{"x-trace-debug-id":m}:void 0,{client:h}=await e(f),{structuredContent:x,isError:y,content:b}=await h.callTool({name:String(u),arguments:d});if(y){const S=b?.[0]?.text,g=typeof S=="string"?Je(S):null,O=g?.code&&typeof t?.getErrorByStatusCode=="function"?t.getErrorByStatusCode(g.code,g.message,g.traceId):null;throw O||new Error(`Tool ${String(u)} returned an error: ${JSON.stringify(x??b)}`)}if(x!==void 0)return x;const w=b?.[0]?.text;return typeof w=="string"?Je(w):void 0}async function i(){const{client:d}=await e(),{tools:u}=await d.listTools();return u}async function a(){if(!("connection"in t))return i();const d=t.connection,u=JSON.stringify(d);try{return ye.has(u)||ye.set(u,i()),await ye.get(u)}catch(m){console.error("Failed to list tools",m),ye.delete(u);return}}async function l(){return(await a()??[]).map(u=>Ze(u,n))}return n.asTool=async()=>{const u=(await a()??[]).find(m=>m.name===s);if(!u)throw new Error(`Tool ${s} not found`);return Ze(u,n)},n}})}new Proxy({},{get(t,e){return e==="toJSON"?null:e==="forConnection"?r=>ns({connection:r}):global[e]}});function ns(t){return ss(t)}function is(t){return{isImplementedBy:e=>{for(const r of t){const s=typeof r.name=="string"?new RegExp(`^${r.name}$`):r.name,n=e.find(i=>s.test(i.name));if(!(!n&&r.opt)&&!n)return!1}return!0}}}const os=p({id:c().describe("Unique identifier for the entity"),title:c().describe("Human-readable title for the entity"),description:c().nullish().describe("Description of the entity"),created_at:c().datetime(),updated_at:c().datetime(),created_by:c().optional(),updated_by:c().optional()}),as=p({field:_(c()),operator:ee(["eq","gt","gte","lt","lte","in","like","contains"]),value:Z()}),rt=ut(()=>pe([as,p({operator:ee(["and","or","not"]),conditions:_(rt)})])),ls=p({field:_(c()),direction:ee(["asc","desc"]),nulls:ee(["first","last"]).optional()}),cs=p({where:rt.optional().describe("Filter expression"),orderBy:_(ls).optional().describe("Sort expressions"),limit:A().int().min(1).max(1e3).optional().describe("Maximum number of items to return"),offset:A().int().min(0).optional().describe("Number of items to skip")});function us(t){return p({items:_(t).describe("Array of collection items"),totalCount:A().int().min(0).optional().describe("Total number of matching items (if available)"),hasMore:Y().optional().describe("Whether there are more items available")})}const ds=p({id:c().describe("ID of the entity to retrieve")});function fs(t){return p({item:t.nullable().describe("The retrieved item, or null if not found")})}p({id:c().describe("ID of the entity to delete")});function ms(t,e,r){const s=t.toUpperCase();return[{name:`COLLECTION_${s}_LIST`,inputSchema:cs,outputSchema:us(e)},{name:`COLLECTION_${s}_GET`,inputSchema:ds,outputSchema:fs(e)}]}const hs=p({id:c(),name:c(),description:c().optional(),inputSchema:K(c(),Z()),outputSchema:K(c(),Z()).optional()}),ps=os.extend({_meta:p({"io.decocms":p({id:c(),verified:Y(),scopeName:c(),appName:c(),friendlyName:c().nullable().optional(),metadata:K(c(),Z()).nullable().optional(),publishedAt:c().datetime().optional(),updatedAt:c().datetime().optional(),tools:_(hs).nullable().optional().describe("Available tools exposed by this app")}).optional()}).optional(),server:p({$schema:c().optional(),_meta:K(c(),Z()).optional(),name:c().describe("The server name (scope/app)"),title:c().optional().describe("User-friendly title"),description:c().optional().describe("Server description"),icons:_(p({src:c(),mimeType:c().optional(),sizes:_(c()).optional(),theme:ee(["light","dark"]).optional()})).optional(),remotes:_(p({type:ee(["http","stdio","sse"]),url:c().optional(),headers:_(Z()).optional()})).optional(),packages:_(Z()).optional(),repository:p({url:c(),source:c().optional(),subfolder:c().optional()}).optional(),version:c().optional(),websiteUrl:c().optional()})});ms("registry_app",ps);const gs=p({specversion:G("1.0").describe("CloudEvents specification version"),id:c().describe("Unique identifier for this event (UUID recommended)"),source:c().describe("Connection ID of the event publisher"),type:c().describe("Event type (e.g., 'order.created', 'user.signup')"),time:c().datetime().optional().describe("Timestamp of when the event occurred (ISO 8601)"),subject:c().optional().describe("Subject/resource identifier (e.g., order ID, user ID)"),datacontenttype:c().optional().default("application/json").describe("Content type of the data attribute"),dataschema:c().url().optional().describe("URI to the schema for the data attribute"),data:Z().optional().describe("Event payload (any JSON value)")});p({events:_(gs).min(1).describe("Batch of CloudEvents to process")});const bs=p({success:Y().optional().describe("Whether this event was processed successfully"),error:c().optional().describe("Error message for this event"),retryAfter:A().int().positive().optional().describe("Re-deliver this event after this many ms")});p({success:Y().optional().describe("Batch success - applies to events not in results"),error:c().optional().describe("Batch error message - applies to events not in results"),processedCount:A().int().min(0).optional().describe("Number of events successfully processed"),retryAfter:A().int().positive().optional().describe("Batch retryAfter - applies to events not in results"),results:K(c(),bs).optional().describe("Per-event results keyed by event ID")});const ys=p({type:G("string"),enum:_(c()).optional(),description:c().optional()}),xs=p({type:c(),description:c(),paramsSchema:K(c(),ys)});p({});p({triggers:_(xs)});p({type:c(),params:K(c(),c()),enabled:Y(),callbackUrl:dt().optional(),callbackToken:c().min(1).optional()});p({success:Y()});p({prefix:c().optional().describe("Filter objects by prefix (e.g., 'folder/' for folder contents)"),maxKeys:A().optional().default(1e3).describe("Maximum number of keys to return (default: 1000)"),continuationToken:c().optional().describe("Token for pagination from previous response"),delimiter:c().optional().describe("Delimiter for grouping keys (typically '/'). When set, commonPrefixes returns folder paths.")});p({objects:_(p({key:c().describe("Object key/path"),size:A().describe("Object size in bytes"),lastModified:c().describe("Last modified timestamp"),etag:c().describe("Entity tag for the object")})),nextContinuationToken:c().optional().describe("Token for fetching next page of results"),isTruncated:Y().describe("Whether there are more results available"),commonPrefixes:_(c()).optional().describe("Folder paths when delimiter is used (e.g., ['photos/2024/', 'photos/2025/'])")});p({key:c().describe("Object key/path to get metadata for")});p({contentType:c().optional().describe("MIME type of the object"),contentLength:A().describe("Size of the object in bytes"),lastModified:c().describe("Last modified timestamp"),etag:c().describe("Entity tag for the object"),metadata:K(c(),c()).optional().describe("Custom metadata key-value pairs")});p({key:c().describe("Object key/path to generate URL for"),expiresIn:A().optional().describe("URL expiration time in seconds (default: from state config or 3600)")});p({url:c().describe("Presigned URL for downloading the object"),expiresIn:A().describe("Expiration time in seconds that was used")});p({key:c().describe("Object key/path for the upload"),expiresIn:A().optional().describe("URL expiration time in seconds (default: from state config or 3600)"),contentType:c().optional().describe("MIME type for the object being uploaded")});p({url:c().describe("Presigned URL for uploading the object"),expiresIn:A().describe("Expiration time in seconds that was used")});p({key:c().describe("Object key/path to delete")});p({success:Y().describe("Whether the deletion was successful"),key:c().describe("The key that was deleted")});p({keys:_(c()).max(1e3).describe("Array of object keys/paths to delete (max 1000)")});p({deleted:_(c()).describe("Array of successfully deleted keys"),errors:_(p({key:c(),message:c()})).describe("Array of errors for failed deletions")});const vs=p({primary:c().optional().describe("Primary brand color (hex)"),secondary:c().optional().describe("Secondary brand color (hex)"),accent:c().optional().describe("Accent / highlight color (hex)"),background:c().optional().describe("Background color (hex)"),foreground:c().optional().describe("Foreground / text color (hex)")}),ws=p({heading:c().optional().describe("Font family for headings"),body:c().optional().describe("Font family for body text"),code:c().optional().describe("Font family for code / monospace")}),Ss=p({logo:c().optional().describe("Logo URL"),favicon:c().optional().describe("Favicon URL"),ogImage:c().optional().describe("Open Graph image URL")}),js=p({id:c(),name:c().describe("Brand / company name"),domain:c().optional().describe("Company domain (e.g. example.com)"),colors:vs.optional().describe("Semantic color palette"),fonts:ws.optional().describe("Font families by role"),assets:Ss.optional().describe("Visual identity assets"),overview:c().optional().describe("Company overview / description"),tagline:c().optional().describe("Brand tagline"),tone:c().optional().describe("Tone of voice description"),metadata:K(c(),Z()).optional().describe("Extra design tokens and metadata")});p({id:c().optional().describe("Brand ID. Omit to get the default brand.")});p({});p({items:_(js)});const _s={"@deco/llm":"LLMS","@deco/trigger":"TRIGGER","@deco/object-storage":"OBJECT_STORAGE","@deco/brand":"BRAND"};function Cs(t){if(t)return _s[t]}function Cn(t,e){const r=t.tools;if(!r||r.length===0)return!1;const s=r.map(a=>({name:a.name,inputSchema:a.inputSchema})),n=e.map(a=>({name:a.name,inputSchema:a.inputSchema,opt:a.opt}));return is(n).isImplementedBy(s)}const Be=F.createContext(null);function En(t){const e=U.c(3),{children:r}=t,s=F.useContext(Be);if(!s?.tabsEl)return null;let n;return e[0]!==r||e[1]!==s.tabsEl?(n=Qe.createPortal(r,s.tabsEl),e[0]=r,e[1]=s.tabsEl,e[2]=n):n=e[2],n}function Es(t){const e=U.c(3),{children:r}=t,s=F.useContext(Be);if(!s?.actionsEl)return null;let n;return e[0]!==r||e[1]!==s.actionsEl?(n=Qe.createPortal(r,s.actionsEl),e[0]=r,e[1]=s.actionsEl,e[2]=n):n=e[2],n}const Nn=Es;function On(t){const e=U.c(21),{children:r,breadcrumb:s,hideHeader:n}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={leftEl:null,tabsEl:null,actionsEl:null},e[0]=i):i=e[0];const[a,l]=F.useState(i),d=F.useRef(null),u=F.useRef(null),m=F.useRef(null);let f;e[1]===Symbol.for("react.memo_cache_sentinel")?(f=j=>{d.current=j,j&&l(C=>C.leftEl===j?C:{...C,leftEl:j})},e[1]=f):f=e[1];const h=f;let x;e[2]===Symbol.for("react.memo_cache_sentinel")?(x=j=>{u.current=j,j&&l(C=>C.tabsEl===j?C:{...C,tabsEl:j})},e[2]=x):x=e[2];const y=x;let b;e[3]===Symbol.for("react.memo_cache_sentinel")?(b=j=>{m.current=j,j&&l(C=>C.actionsEl===j?C:{...C,actionsEl:j})},e[3]=b):b=e[3];const w=b,S=n&&"hidden";let g;e[4]!==S?(g=_e(S),e[4]=S,e[5]=g):g=e[5];let O;e[6]===Symbol.for("react.memo_cache_sentinel")?(O=o.jsx("div",{ref:h,className:"flex items-center gap-2 min-w-0"}),e[6]=O):O=e[6];let R;e[7]!==s?(R=o.jsxs(ce.Header.Left,{children:[s,O]}),e[7]=s,e[8]=R):R=e[8];let L;e[9]===Symbol.for("react.memo_cache_sentinel")?(L=o.jsxs(ce.Header.Right,{children:[o.jsx("div",{ref:y,className:"flex items-center gap-2 overflow-x-auto min-w-0"}),o.jsx("div",{ref:w,className:"flex items-center gap-2 shrink-0"})]}),e[9]=L):L=e[9];let k;e[10]!==g||e[11]!==R?(k=o.jsxs(ce.Header,{className:g,children:[R,L]}),e[10]=g,e[11]=R,e[12]=k):k=e[12];let I;e[13]!==r?(I=o.jsx(ce.Content,{children:r}),e[13]=r,e[14]=I):I=e[14];let P;e[15]!==k||e[16]!==I?(P=o.jsxs(ce,{children:[k,I]}),e[15]=k,e[16]=I,e[17]=P):P=e[17];let N;return e[18]!==a||e[19]!==P?(N=o.jsx(Be,{value:a,children:P}),e[18]=a,e[19]=P,e[20]=N):N=e[20],N}function Ns(t){return t.startsWith("@")?t:`@${t}`}function Os(){const{org:t}=Ue(),{data:e}=ft.useSession(),r=Nt(),s=At(),n=Rt(),i=s.filter(l=>n(l.id));return{installByBinding:async l=>{if(!t||!e?.user?.id){xe.error("Not authenticated");return}const d=Ns(l),m=(await Promise.all(i.map(async b=>{const w=kt(b.id,t.id);try{const S=await It(b.id,t.id,t.slug,w,{where:{appName:d}});return Pt(S??[])[0]??null}catch{return null}}))).find(b=>b!==null);if(!m){xe.error(`MCP Server not found in registry: ${l}`);return}const f=Mt(m,t.id,e.user.id),h=f.connection_type==="STDIO",x=!!f.connection_url,y=h&&f.connection_headers&&typeof f.connection_headers=="object"&&"command"in f.connection_headers;if(!x&&!y){xe.error("This MCP Server cannot be connected: no connection method available");return}return await r.create.mutateAsync(f),{id:f.id,connection:f}},isInstalling:r.create.isPending}}function Ts(t){const e=U.c(21),{virtualMcp:r,isSelected:s}=t,n=s&&"bg-accent";let i;e[0]!==n?(i=_e("flex items-start gap-3 py-3 px-3 hover:bg-accent cursor-pointer rounded-xl transition-colors",n),e[0]=n,e[1]=i):i=e[1];let a;e[2]!==r.icon||e[3]!==r.title?(a=o.jsx(et,{icon:r.icon,name:r.title,size:"sm"}),e[2]=r.icon,e[3]=r.title,e[4]=a):a=e[4];let l;e[5]!==r.title?(l=o.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:r.title}),e[5]=r.title,e[6]=l):l=e[6];let d;e[7]!==s?(d=s&&o.jsx(er,{size:16,className:"text-foreground shrink-0"}),e[7]=s,e[8]=d):d=e[8];let u;e[9]!==l||e[10]!==d?(u=o.jsxs("div",{className:"flex items-center justify-between",children:[l,d]}),e[9]=l,e[10]=d,e[11]=u):u=e[11];let m;e[12]!==r.description?(m=r.description&&o.jsx("p",{className:"text-xs text-muted-foreground line-clamp-1 leading-relaxed",children:r.description}),e[12]=r.description,e[13]=m):m=e[13];let f;e[14]!==u||e[15]!==m?(f=o.jsxs("div",{className:"flex flex-col flex-1 min-w-0 gap-0.5",children:[u,m]}),e[14]=u,e[15]=m,e[16]=f):f=e[16];let h;return e[17]!==i||e[18]!==a||e[19]!==f?(h=o.jsxs("div",{className:i,children:[a,f]}),e[17]=i,e[18]=a,e[19]=f,e[20]=h):h=e[20],h}function ks(){const t=U.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx("div",{className:"flex items-center justify-center py-12",children:o.jsx($e,{size:20,className:"animate-spin text-muted-foreground"})}),t[0]=e):e=t[0],e}function Is(t){const e=U.c(33),{selectedVirtualMcpId:r,onVirtualMcpChange:s,searchInputRef:n}=t,i=Xt(),[a,l]=F.useState(""),d=F.useRef(null),u=n??d;let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m={navigateOnCreate:!0},e[0]=m):m=e[0];const{createVirtualMCP:f,isCreating:h}=sr(m);let x,y,b,w;if(e[1]!==f||e[2]!==u||e[3]!==h||e[4]!==s||e[5]!==a||e[6]!==r||e[7]!==i){let O;e:{const E=i.filter(Ps);if(!a.trim()){O=E;break e}const M=a.toLowerCase();O=E.filter(B=>B.title.toLowerCase().includes(M)||B.description?.toLowerCase().includes(M))}const R=O;let L;e[12]!==s?(L=E=>{s(E),l("")},e[12]=s,e[13]=L):L=e[13];const k=L;b="flex flex-col max-h-[min(400px,60dvh)]";let I;e[14]===Symbol.for("react.memo_cache_sentinel")?(I=o.jsx(tr,{size:16,className:"text-muted-foreground pointer-events-none shrink-0"}),e[14]=I):I=e[14];let P;e[15]===Symbol.for("react.memo_cache_sentinel")?(P=E=>l(E.target.value),e[15]=P):P=e[15];let N;e[16]!==u||e[17]!==a?(N=o.jsx(Wt,{ref:u,type:"text",placeholder:"Search for an agent...",value:a,onChange:P,className:"flex-1 h-8 text-sm border-0 focus-visible:ring-0 focus-visible:ring-offset-0 shadow-none p-0"}),e[16]=u,e[17]=a,e[18]=N):N=e[18];const j=h?"Creating...":"Create Agent";let C;e[19]!==f||e[20]!==h||e[21]!==j?(C=o.jsx(Ce,{onClick:f,variant:"outline",size:"sm",className:"h-8 px-3 rounded-lg text-sm font-medium shrink-0",disabled:h,children:j}),e[19]=f,e[20]=h,e[21]=j,e[22]=C):C=e[22],e[23]!==N||e[24]!==C?(w=o.jsx("div",{className:"border-b px-4 py-3 bg-background/95 backdrop-blur sticky top-0 z-10",children:o.jsxs("div",{className:"relative flex items-center gap-2",children:[I,N,C]})}),e[23]=N,e[24]=C,e[25]=w):w=e[25],x="overflow-y-auto p-1.5 flex-1 min-h-0 [touch-action:pan-y]",y=R.length>0?o.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-0.5",children:R.map(E=>o.jsx("div",{role:"button",tabIndex:0,onClick:()=>k(E.id),onKeyDown:M=>{(M.key==="Enter"||M.key===" ")&&(M.preventDefault(),k(E.id))},className:"outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 rounded-xl",children:o.jsx(Ts,{virtualMcp:E,isSelected:E.id===r})},E.id))}):o.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:"No agents found"}),e[1]=f,e[2]=u,e[3]=h,e[4]=s,e[5]=a,e[6]=r,e[7]=i,e[8]=x,e[9]=y,e[10]=b,e[11]=w}else x=e[8],y=e[9],b=e[10],w=e[11];let S;e[26]!==x||e[27]!==y?(S=o.jsx("div",{className:x,children:y}),e[26]=x,e[27]=y,e[28]=S):S=e[28];let g;return e[29]!==b||e[30]!==w||e[31]!==S?(g=o.jsxs("div",{className:b,children:[w,S]}),e[29]=b,e[30]=w,e[31]=S,e[32]=g):g=e[32],g}function Ps(t){return!t.id||!St(t.id)}function Ms(t){const e=U.c(3);let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx(ks,{}),e[0]=r):r=e[0];let s;return e[1]!==t?(s=o.jsx(F.Suspense,{fallback:r,children:o.jsx(Is,{...t})}),e[1]=t,e[2]=s):s=e[2],s}function As(t){const e=U.c(32),{selectedVirtualMcpId:r,selectedVirtualMcp:s,onVirtualMcpChange:n,className:i,placeholder:a,showTooltip:l,disabled:d}=t,u=a===void 0?"Select Agent":a,m=l===void 0?!0:l,f=d===void 0?!1:d,[h,x]=F.useState(!1),y=F.useRef(null);let b;e[0]!==n?(b=W=>{n(W),x(!1)},e[0]=n,e[1]=b):b=e[1];const w=b,S=Jt();let g;e[2]===Symbol.for("react.memo_cache_sentinel")?(g=W=>{x(W)},e[2]=g):g=e[2];const O=g;let R,L;e[3]!==S||e[4]!==h?(R=()=>{h&&!S&&setTimeout(()=>{y.current?.focus()},0)},L=[h,S],e[3]=S,e[4]=h,e[5]=R,e[6]=L):(R=e[5],L=e[6]),F.useEffect(R,L);const k=f?!1:h,I=f?void 0:O,P=f?"cursor-not-allowed opacity-50":"cursor-pointer hover:text-muted-foreground";let N;e[7]!==i||e[8]!==P?(N=_e("relative flex items-center justify-center size-8 rounded-lg text-muted-foreground/75 transition-colors shrink-0",P,i),e[7]=i,e[8]=P,e[9]=N):N=e[9];let j;e[10]!==s?(j=s?o.jsx(et,{icon:s.icon,name:s.title,size:"sm",className:"absolute inset-0 size-full"}):o.jsxs(o.Fragment,{children:[o.jsxs("svg",{className:"absolute inset-0 size-full",fill:"none",children:[o.jsx("defs",{children:o.jsxs("linearGradient",{id:"agent-border-gradient",gradientUnits:"userSpaceOnUse",x1:"0",y1:"0",x2:"32",y2:"32",children:[o.jsx("animateTransform",{attributeName:"gradientTransform",type:"rotate",from:"0 16 16",to:"360 16 16",dur:"6s",repeatCount:"indefinite"}),o.jsx("stop",{offset:"0%",stopColor:"var(--chart-1)"}),o.jsx("stop",{offset:"100%",stopColor:"var(--chart-4)"})]})}),o.jsx("rect",{x:"0.5",y:"0.5",width:"31",height:"31",rx:"7.5",stroke:"url(#agent-border-gradient)",strokeWidth:"1",strokeDasharray:"3 3"})]}),o.jsx(rr,{size:16})]}),e[10]=s,e[11]=j):j=e[11];let C;e[12]!==f||e[13]!==u||e[14]!==N||e[15]!==j?(C=o.jsx(Kt,{asChild:!0,children:o.jsx(qt,{asChild:!0,children:o.jsx("button",{type:"button",disabled:f,className:N,"aria-label":u,children:j})})}),e[12]=f,e[13]=u,e[14]=N,e[15]=j,e[16]=C):C=e[16];let E;e[17]!==h||e[18]!==s?.title||e[19]!==m?(E=m&&!h&&o.jsx(Zt,{side:"top",className:"text-xs",children:s?.title??"Choose an agent to chat with"}),e[17]=h,e[18]=s?.title,e[19]=m,e[20]=E):E=e[20];let M;e[21]!==C||e[22]!==E?(M=o.jsx(Yt,{children:o.jsxs(Qt,{children:[C,E]})}),e[21]=C,e[22]=E,e[23]=M):M=e[23];let B;e[24]!==w||e[25]!==r?(B=o.jsx(zt,{className:"w-[min(550px,calc(100vw-2rem))] p-0 overflow-hidden",align:"start",side:"top",sideOffset:8,collisionPadding:16,children:o.jsx(Ms,{selectedVirtualMcpId:r,onVirtualMcpChange:w,searchInputRef:y})}),e[24]=w,e[25]=r,e[26]=B):B=e[26];let V;return e[27]!==M||e[28]!==B||e[29]!==k||e[30]!==I?(V=o.jsxs(Gt,{open:k,onOpenChange:I,children:[M,B]}),e[27]=M,e[28]=B,e[29]=k,e[30]=I,e[31]=V):V=e[31],V}function Rs(t){const e=t.properties;if(!e)return!1;const r=e.__type,s=e.__binding;return!!(r?.const||s?.const)}function Ls(t){const e=t.properties;if(!e)return{};const r=e.__type,s=e.__binding;return{bindingType:r?.const,bindingSchema:s?.const}}function Hs(t){const e=U.c(10),{bindingSchema:r,bindingType:s,currentValue:n,onValueChange:i,placeholder:a,onAddNew:l,className:d}=t;let u;e[0]!==s?(u=Cs(s),e[0]=s,e[1]=u):u=e[1];const f=u??(typeof r=="string"?r:r??void 0);let h;return e[2]!==s||e[3]!==d||e[4]!==n||e[5]!==l||e[6]!==i||e[7]!==a||e[8]!==f?(h=o.jsx(Us,{value:n,onValueChange:i,placeholder:a,binding:f,bindingType:s,onAddNew:l,className:d}),e[2]=s,e[3]=d,e[4]=n,e[5]=l,e[6]=i,e[7]=a,e[8]=f,e[9]=h):h=e[9],h}function Us({value:t,onValueChange:e,placeholder:r="Select a connection...",binding:s,bindingType:n,onAddNew:i,className:a}){const[l,d]=F.useState(!1),{installByBinding:u,isInstalling:m}=Os(),f=l||m,h=s?void 0:n||void 0,x=Ot(s?{binding:s}:h?{filters:[{column:"app_name",value:h}]}:{}),y=Tt(t&&!x.some(g=>g.id===t)?t:void 0),b=y?[y,...x]:x,w=n?.startsWith("@"),S=async()=>{if(w&&n){d(!0);try{const g=await u(n);g&&e(g.id)}catch(g){const O=g instanceof Error?g.message:String(g);xe.error(`Failed to connect MCP: ${O}`)}finally{d(!1)}return}i?.()};return o.jsxs(Ht,{value:t,onValueChange:e,children:[o.jsx(Ut,{size:"sm",className:_e("w-[200px]",a),children:o.jsx($t,{placeholder:r})}),o.jsxs(Ft,{children:[b.length===0?o.jsx("div",{className:"px-2 py-4 text-center text-sm text-muted-foreground",children:"No connections found"}):b.map(g=>o.jsx(Bt,{value:g.id,children:o.jsxs("div",{className:"flex items-center gap-2",children:[g.icon?o.jsx("img",{src:g.icon,alt:g.title,className:"w-4 h-4 rounded"}):o.jsx("div",{className:"w-4 h-4 rounded bg-linear-to-br from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:g.title.slice(0,1).toUpperCase()}),o.jsx("span",{children:g.title})]})},g.id)),(i||w)&&o.jsx("div",{className:"border-t border-border",children:o.jsx(Ce,{onClick:g=>{g.preventDefault(),g.stopPropagation(),S()},disabled:f,variant:"ghost",className:"w-full justify-start gap-2 px-2 py-2 h-auto hover:bg-muted rounded-md text-sm disabled:opacity-50 disabled:cursor-not-allowed",type:"button",children:f?o.jsxs(o.Fragment,{children:[o.jsx($e,{size:16,className:"animate-spin"}),o.jsx("span",{children:"Connecting..."})]}):o.jsxs(o.Fragment,{children:[o.jsx(Lt,{size:16}),o.jsx("span",{children:"Custom Connection"})]})})})]})]})}function $s(t){const e=U.c(49),{schema:r,formData:s,title:n,description:i,registry:a}=t,l=a.formContext,d=n||"",u=n||"";if(Rs(r)){const h=r;let x;e[0]!==h?(x=Ls(h),e[0]=h,e[1]=x):x=e[1];const{bindingType:y,bindingSchema:b}=x,S=(l?.formData?.[d]?.value??s?.value)||"";let g;e[2]!==y||e[3]!==d||e[4]!==l||e[5]!==s?(g=V=>{const W={...s,value:V??"",...y&&{__type:y}};l?.onFieldChange(d,W)},e[2]=y,e[3]=d,e[4]=l,e[5]=s,e[6]=g):g=e[6];const O=g,R=Bs;let L;e[7]!==u||e[8]!==d||e[9]!==n?(L=R(n||u||d),e[7]=u,e[8]=d,e[9]=n,e[10]=L):L=e[10];const k=L;if(y==="@deco/agent"){let V;e[11]!==k?(V=o.jsx("label",{className:"text-sm font-medium truncate block",children:k}),e[11]=k,e[12]=V):V=e[12];let W;e[13]!==i?(W=i&&o.jsx("p",{className:"text-xs text-muted-foreground truncate",children:i}),e[13]=i,e[14]=W):W=e[14];let te;e[15]!==V||e[16]!==W?(te=o.jsxs("div",{className:"flex-1 min-w-0",children:[V,W]}),e[15]=V,e[16]=W,e[17]=te):te=e[17];const Ee=S||void 0;let re;e[18]!==O||e[19]!==Ee?(re=o.jsx(As,{selectedVirtualMcpId:Ee,onVirtualMcpChange:O,variant:"bordered",placeholder:"Select Agent",className:"w-[200px] shrink-0"}),e[18]=O,e[19]=Ee,e[20]=re):re=e[20];let be;return e[21]!==te||e[22]!==re?(be=o.jsxs("div",{className:"flex items-center gap-3 justify-between",children:[te,re]}),e[21]=te,e[22]=re,e[23]=be):be=e[23],be}let I;e[24]!==k?(I=o.jsx("label",{className:"text-sm font-medium truncate block",children:k}),e[24]=k,e[25]=I):I=e[25];let P;e[26]!==i?(P=i&&o.jsx("p",{className:"text-xs text-muted-foreground truncate",children:i}),e[26]=i,e[27]=P):P=e[27];let N;e[28]!==I||e[29]!==P?(N=o.jsxs("div",{className:"flex-1 min-w-0",children:[I,P]}),e[28]=I,e[29]=P,e[30]=N):N=e[30];let j;e[31]!==k?(j=k.toLowerCase(),e[31]=k,e[32]=j):j=e[32];const C=`Select ${j}...`;let E;e[33]!==l?(E=()=>l?.onAddNew(),e[33]=l,e[34]=E):E=e[34];let M;e[35]!==b||e[36]!==y||e[37]!==S||e[38]!==O||e[39]!==C||e[40]!==E?(M=o.jsx(Hs,{bindingSchema:b,bindingType:y,currentValue:S,onValueChange:O,placeholder:C,onAddNew:E,className:"w-[200px] shrink-0"}),e[35]=b,e[36]=y,e[37]=S,e[38]=O,e[39]=C,e[40]=E,e[41]=M):M=e[41];let B;return e[42]!==M||e[43]!==N?(B=o.jsxs("div",{className:"flex items-center gap-3 justify-between",children:[N,M]}),e[42]=M,e[43]=N,e[44]=B):B=e[44],B}let m;e[45]!==t.properties?(m=t.properties.map(Fs),e[45]=t.properties,e[46]=m):m=e[46];let f;return e[47]!==m?(f=o.jsx("div",{className:"flex flex-col gap-4",children:m}),e[47]=m,e[48]=f):f=e[48],f}function Fs(t){return t.content}function Bs(t){return t.toLowerCase().replace(/_/g," ").replace(/\b\w/g,Ds)}function Ds(t){return t.toUpperCase()}function Vs(t){const e=U.c(13),{label:r,children:s,description:n,id:i,schema:a}=t;if(i.includes("__type")||i.includes("__binding"))return null;if(a.type==="object")return s;let l;e[0]!==i||e[1]!==r?(l=r&&o.jsx("label",{className:"text-sm font-medium truncate block",htmlFor:i,children:r}),e[0]=i,e[1]=r,e[2]=l):l=e[2];let d;e[3]!==n?(d=n&&o.jsx("div",{className:"text-xs text-muted-foreground truncate",children:n}),e[3]=n,e[4]=d):d=e[4];let u;e[5]!==l||e[6]!==d?(u=o.jsxs("div",{className:"flex-1 min-w-0",children:[l,d]}),e[5]=l,e[6]=d,e[7]=u):u=e[7];let m;e[8]!==s?(m=o.jsx("div",{className:"w-[200px] shrink-0",children:s}),e[8]=s,e[9]=m):m=e[9];let f;return e[10]!==u||e[11]!==m?(f=o.jsxs("div",{className:"flex items-center gap-3 justify-between",children:[u,m]}),e[10]=u,e[11]=m,e[12]=f):f=e[12],f}const Ws={ObjectFieldTemplate:$s,FieldTemplate:Vs};function qs(t){const e=U.c(19),{formKey:r,formState:s,onFormStateChange:n,stateSchema:i}=t,{org:a}=Ue(),l=mt();let d;e[0]!==n?(d=g=>{g.formData&&n(g.formData)},e[0]=n,e[1]=d):d=e[1];const u=d;let m;e[2]!==s||e[3]!==n?(m=(g,O)=>{const R={...s,[g]:O};n(R)},e[2]=s,e[3]=n,e[4]=m):m=e[4];const f=m;let h;e[5]!==l||e[6]!==a?(h=()=>{l({to:"/$org/settings/connections",params:{org:a.slug},search:{action:"create"}})},e[5]=l,e[6]=a,e[7]=h):h=e[7];const x=h;let y;e[8]!==s||e[9]!==x||e[10]!==f?(y={onFieldChange:f,formData:s,onAddNew:x},e[8]=s,e[9]=x,e[10]=f,e[11]=y):y=e[11];const b=y;let w;e[12]===Symbol.for("react.memo_cache_sentinel")?(w=o.jsx(o.Fragment,{}),e[12]=w):w=e[12];let S;return e[13]!==b||e[14]!==r||e[15]!==s||e[16]!==u||e[17]!==i?(S=o.jsx("div",{className:"flex flex-col h-full overflow-auto",children:o.jsx(Dt,{schema:i,validator:Vt,formData:s,onChange:u,formContext:b,liveValidate:!1,showErrorList:!1,templates:Ws,children:w},r)}),e[13]=b,e[14]=r,e[15]=s,e[16]=u,e[17]=i,e[18]=S):S=e[18],S}function zs(t){const e=U.c(14),{org:r}=Ue();let s;e[0]!==t||e[1]!==r.id||e[2]!==r.slug?(s={connectionId:t,orgId:r.id,orgSlug:r.slug},e[0]=t,e[1]=r.id,e[2]=r.slug,e[3]=s):s=e[3];const n=jt(s);let i;e[4]===Symbol.for("react.memo_cache_sentinel")?(i={},e[4]=i):i=e[4];let a;e[5]!==n?(a={client:n,toolName:"MCP_CONFIGURATION",toolArguments:i,select:Gs},e[5]=n,e[6]=a):a=e[6];const{data:l}=_t(a);let d;e[7]!==l.stateSchema?(d=l.stateSchema??{type:"object",properties:{}},e[7]=l.stateSchema,e[8]=d):d=e[8];const u=d;let m;e[9]!==l.scopes?(m=l.scopes??[],e[9]=l.scopes,e[10]=m):m=e[10];const f=m;let h;return e[11]!==f||e[12]!==u?(h={stateSchema:u,scopes:f},e[11]=f,e[12]=u,e[13]=h):h=e[13],h}function Gs(t){return t.structuredContent??t}function Js(t){const e=U.c(4),{onAuthenticate:r,buttonText:s}=t,n=s===void 0?"Authenticate":s;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsx("h3",{className:"text-sm font-semibold",children:"Authentication Required"}),o.jsx("p",{className:"text-xs text-muted-foreground max-w-md text-center",children:"This connection requires OAuth authentication to access resources."})]}),e[0]=i):i=e[0];let a;return e[1]!==n||e[2]!==r?(a=o.jsx("div",{className:"flex-1 flex items-center justify-center",children:o.jsxs("div",{className:"flex flex-col items-center gap-4 max-w-md text-center",children:[i,o.jsx(Ce,{onClick:r,size:"default",children:n})]})}),e[1]=n,e[2]=r,e[3]=a):a=e[3],a}function Zs(t){const e=U.c(7),{hasReadme:r,onViewReadme:s}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=o.jsx(Et,{size:36,className:"text-muted-foreground"}),e[0]=n):n=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsx("h3",{className:"text-sm font-semibold",children:"Manual Authentication Required"}),o.jsx("p",{className:"text-xs text-muted-foreground max-w-md text-center",children:"This server requires an API key or token that must be configured manually. Check the server's documentation for instructions on obtaining credentials."})]}),e[1]=i):i=e[1];let a;e[2]!==r||e[3]!==s?(a=r&&s&&o.jsxs(Ce,{onClick:s,variant:"outline",size:"lg",children:[o.jsx(Ct,{size:18,className:"mr-2"}),"View README"]}),e[2]=r,e[3]=s,e[4]=a):a=e[4];let l;return e[5]!==a?(l=o.jsx("div",{className:"flex-1 flex items-center justify-center",children:o.jsxs("div",{className:"flex flex-col items-center gap-4 max-w-md text-center",children:[n,i,a]})}),e[5]=a,e[6]=l):l=e[6],l}function Ks(){const t=U.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx("img",{src:"/empty-state-error.svg",alt:"",width:160,height:160,"aria-hidden":"true"}),t[0]=e):e=t[0];let r;return t[1]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx("div",{className:"flex-1 flex items-center justify-center",children:o.jsxs("div",{className:"flex flex-col items-center gap-4 max-w-md text-center",children:[e,o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsx("h3",{className:"text-lg font-semibold",children:"Server Error"}),o.jsx("p",{className:"text-sm text-muted-foreground max-w-md text-center",children:"The MCP server is currently experiencing issues. Please try again later or check the server's status."})]})]})}),t[1]=r):r=t[1],r}function Ys(t){const e=U.c(12),{connection:r,form:s}=t,{stateSchema:n}=zs(r.id);let i;e[0]!==s.control?(i={control:s.control,name:"configuration_state"},e[0]=s.control,e[1]=i):i=e[1];const a=pt(i);let l;e[2]!==s?(l=h=>{s.setValue("configuration_state",h,{shouldDirty:!0})},e[2]=s,e[3]=l):l=e[3];const d=l;if(!(n&&n.properties&&typeof n.properties=="object"&&Object.keys(n.properties).length>0)){let h;return e[4]===Symbol.for("react.memo_cache_sentinel")?(h=o.jsx("div",{className:"flex-1 flex items-center justify-center",children:o.jsx(Xe,{image:o.jsx("img",{src:"/empty-state-success-muted.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),title:"This server is all set!",description:"No additional configuration is needed. Everything is ready to go."})}),e[4]=h):h=e[4],h}let m;e[5]!==a?(m=a??{},e[5]=a,e[6]=m):m=e[6];let f;return e[7]!==r.id||e[8]!==d||e[9]!==n||e[10]!==m?(f=o.jsx("div",{className:"flex-1 overflow-auto",children:o.jsx(qs,{formKey:r.id,stateSchema:n,formState:m,onFormStateChange:d})}),e[7]=r.id,e[8]=d,e[9]=n,e[10]=m,e[11]=f):f=e[11],f}function Qs(t){const e=U.c(11),{connection:r,form:s,hasMcpBinding:n,isMCPAuthenticated:i,supportsOAuth:a,isServerError:l,onAuthenticate:d,onViewReadme:u}=t,f=!!r?.metadata?.repository?.url;if(!i){if(l){let b;return e[0]===Symbol.for("react.memo_cache_sentinel")?(b=o.jsx(Ks,{}),e[0]=b):b=e[0],b}if(a){let b;return e[1]!==d?(b=o.jsx(Js,{onAuthenticate:d}),e[1]=d,e[2]=b):b=e[2],b}let y;return e[3]!==f||e[4]!==u?(y=o.jsx(Zs,{hasReadme:f,onViewReadme:u}),e[3]=f,e[4]=u,e[5]=y):y=e[5],y}if(!n){let y;return e[6]===Symbol.for("react.memo_cache_sentinel")?(y=o.jsx("div",{className:"flex-1 flex items-center justify-center",children:o.jsx(Xe,{image:o.jsx("img",{src:"/empty-state-success-muted.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),title:"This server is all set!",description:"No additional configuration is needed. Everything is ready to go."})}),e[6]=y):y=e[6],y}let h;e[7]===Symbol.for("react.memo_cache_sentinel")?(h=o.jsx("div",{className:"flex-1 flex items-center justify-center",children:o.jsx($e,{size:32,className:"animate-spin text-muted-foreground"})}),e[7]=h):h=e[7];let x;return e[8]!==r||e[9]!==s?(x=o.jsx(ht,{children:o.jsx(F.Suspense,{fallback:h,children:o.jsx(Ys,{connection:r,form:s})})}),e[8]=r,e[9]=s,e[10]=x):x=e[10],x}function Tn(t){const e=U.c(2);let r;return e[0]!==t?(r=o.jsx("div",{className:"flex-1 flex h-full",children:o.jsx(Qs,{...t})}),e[0]=t,e[1]=r):r=e[1],r}export{Zs as M,Js as O,Tn as S,On as V,Nn as a,En as b,Cn as c};
@@ -1 +0,0 @@
1
- import{c as it,r as E,j as e,i as rt}from"./index-CurNB2HG.js";import{S as mt,b as pt,c as st,d as at}from"./sheet-Djk8ol5s.js";import{S as nt}from"./scroll-area-CbWYdgRA.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-CvCtyrxH.js";import{p as xt}from"./index-C2QgbLxn.js";import"./X-DgKWdqZ1.js";import"./agent-icon-pz8iT5cD.js";import"./AlertCircle-BMCh3ayd.js";import"./Tool01-WsqNh4er.js";import"./SwitchHorizontal01-DXdcIz27.js";import"./Settings02-ozrzAwut.js";import"./XCircle-DFBcUexW.js";import"./ArrowUpRight-CwVMUp5O.js";import"./ZapSquare-DOK7F1oe.js";import"./Users03-CJuVy8Iz.js";import"./CheckCircle-BP2lb3AX.js";import"./ChevronUp-CiXD4kQk.js";import"./ChevronDown-CkcGr2qp.js";import"./ChevronLeft-Cgw9JZYG.js";import"./ChevronRight-DYe9AFXl.js";import"./DotsVertical-Z_h1bSB3.js";import"./Stars02-C4CXFnp9.js";import"./Eye-B92Ff4dY.js";import"./ZoomOut-ryBmf3S4.js";import"./Globe01-MZlo2_34.js";import"./FilterLines-CMHeCbJ1.js";import"./Star01-BoZIiKCL.js";import"./Globe04-BPWbnzx0.js";import"./HardDrive-D8FSpDtM.js";import"./Key01-CZVV-ceU.js";import"./LayoutLeft-CuTI_WR9.js";import"./LinkExternal01-DekFjc9P.js";import"./Monitor01-BxGhRsUq.js";import"./Sun-2eUdoD8j.js";import"./Palette-BDlA8RUr.js";import"./Play-BGGUeSDd.js";import"./Plus-CQOl41pg.js";import"./SearchMd-Da504yGV.js";import"./Shield01-CYPtC_lA.js";import"./Stars01-BJuGXG_N.js";import"./Trash01-z6De146C.js";import"./Upload01-C4sYhZ0M.js";import"./User01-Cvp121NC.js";import"./Users01-DcrlsWI1.js";import"./XClose-BKWXOZkj.js";import"./Zap-Cxu6aoRs.js";import"./use-clock-tick-DmUrmEeM.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-BWQBaWRC.js";import"./tooltip-CUlMaf5E.js";import"./file-type-icon-CWgZWEkL.js";import"./dialog-BFjL_my-.js";import"./tab-id-BptcWVWa.js";import"./content-blocks-o63cs2vh.js";import"./types-CDn4NSje.js";import"./use-mcp-client-BbOUwA1H.js";import"./auth-xlfJjVrK.js";import"./chat-context-Dz9rhizY.js";import"./hooks-CFfc1t5D.js";import"./decopilot-sse-pool-DXv2T192.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-CLJ6qnG1.js";import"./use-collections-w44ZyJ1t.js";import"./use-ai-providers-D-XhQ6_q.js";import"./studio-tools-BvQ8Bli1.js";import"./use-organization-settings-B5L78CqV.js";import"./shell-layout-BkVrkYmb.js";import"./avatar-Bh53txVX.js";import"./required-auth-layout-Be__d9RH.js";import"./use-org-sso-CIoYIaj1.js";import"./integration-icon-Dpj2NSXY.js";import"./use-navigate-to-agent-CidcWwFC.js";import"./use-connection-Cvfufzsw.js";import"./use-mcp-prompts-Y5le4syR.js";import"./form-B6Nf7hvD.js";import"./label-DrXdAtn0.js";import"./input-RRjvrcUF.js";import"./index-BdQq_4o_.js";import"./switch-dEe0am9a.js";import"./select-BePf1IJF.js";import"./index-BVXtRunj.js";import"./drawer-DZMXZPMN.js";import"./collection-search-JfLpXbmD.js";import"./tabs-DOJ7e6Z7.js";import"./toggle-group-CSO_yZKm.js";import"./sortable.esm-BN6bAoSL.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card--7NnoNLM.js";import"./use-registry-connections-3CHe_VwJ.js";import"./useInfiniteQuery-BAIT4yxs.js";import"./use-infinite-scroll-BlkXRVRw.js";import"./extract-connection-data-Bau_aQvM.js";import"./card-D_tApM0k.js";import"./collection-tabs-B5YA_dM5.js";import"./badge-CdirlPdy.js";import"./textarea-C7j7_npp.js";import"./connection-form-helpers-BW7AB-E3.js";import"./authenticate-and-persist-oauth-DPn6Vk96.js";import"./mcp-oauth-B5dnAc7V.js";import"./useSuspenseInfiniteQuery-DpmGs3CS.js";import"./connect-desktop-dialog-BxJ3X8re.js";import"./decopilot-CiHv6XGE.js";import"./checkbox-OtNKSART.js";import"./skeleton-DrM35KBr.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-ELYurXQx.js";import"./popover-D7BamlkK.js";import"./command-iFNWkWs6.js";import"./index-BDyN-RAN.js";import"./dropdown-menu-B1DaP6vk.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-Bbu_XWuO.js";import"./empty-state-Lmcbk0Zv.js";import"./toolbar-D9CfLhAB.js";import"./preview-dialog-C9Rx0Dtg.js";import"./index-ZANilAX7.js";import"./use-mcp-tools-xGr1pN0n.js";import"./use-capability-DfdnXTfH.js";import"./shell-route-loading-gKBpXu2h.js";import"./tools-list-DC6csFT2.js";import"./alert-dialog-CkCCiKt9.js";import"./use-debounced-autosave-CaTQp8tz.js";import"./index-qZ5-LmpP.js";import"./sidebar-DLCPSSnc.js";import"./search-input-CeqwXCv0.js";import"./github-repo-picker-CThHTj5h.js";import"./use-secrets-DlUSWVTu.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./view-mode-toggle-CIiu6iGh.js";import"./index-ovnDLwrg.js";import"./automation-runs-DBQv8Uvp.js";import"./table-D_zHkpnq.js";import"./use-members-blURElyD.js";import"./use-org-auth-client-oMz0ubhe.js";import"./task-status-DLHF9SZS.js";import"./use-automations-BllXXW29.js";import"./use-file-configs-Bg9S5WW4.js";import"./monaco-editor-zMbhl8rq.js";import"./select-model-CgXZFBIr.js";import"./automation-list-row-CCZ8TAPg.js";function ei(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{ei as SeoSheet};
@@ -1 +0,0 @@
1
- import{c as H,j as t,B as ee}from"./index-CurNB2HG.js";import{n as te}from"./LinkExternal01-DekFjc9P.js";import{ay as oe,Y as ie}from"./agent-icon-pz8iT5cD.js";import{I as J}from"./input-RRjvrcUF.js";import{L as G}from"./label-DrXdAtn0.js";import{M as se}from"./automation-runs-DBQv8Uvp.js";import{T as Q,a as le,b as W,c as re}from"./tabs-DOJ7e6Z7.js";import{T as ae}from"./textarea-C7j7_npp.js";import{as as me,at as pe,au as ne,av as ce,aw as de,ax as fe}from"./index-C2QgbLxn.js";import{b as ue,a as xe,B as he,c as ge}from"./block-document-D978uGtK.js";import{u as ve,s as F,E as ye,R as je,A as be}from"./primitives-BmW50XTY.js";import{S as Ce}from"./save-status-C9pT75mA.js";import"./AlertCircle-BMCh3ayd.js";import"./Tool01-WsqNh4er.js";import"./SwitchHorizontal01-DXdcIz27.js";import"./Settings02-ozrzAwut.js";import"./XCircle-DFBcUexW.js";import"./ArrowUpRight-CwVMUp5O.js";import"./ZapSquare-DOK7F1oe.js";import"./Users03-CJuVy8Iz.js";import"./CheckCircle-BP2lb3AX.js";import"./ChevronUp-CiXD4kQk.js";import"./ChevronDown-CkcGr2qp.js";import"./ChevronLeft-Cgw9JZYG.js";import"./ChevronRight-DYe9AFXl.js";import"./DotsVertical-Z_h1bSB3.js";import"./Stars02-C4CXFnp9.js";import"./Eye-B92Ff4dY.js";import"./ZoomOut-ryBmf3S4.js";import"./Globe01-MZlo2_34.js";import"./FilterLines-CMHeCbJ1.js";import"./Star01-BoZIiKCL.js";import"./Globe04-BPWbnzx0.js";import"./HardDrive-D8FSpDtM.js";import"./Key01-CZVV-ceU.js";import"./LayoutLeft-CuTI_WR9.js";import"./Monitor01-BxGhRsUq.js";import"./Sun-2eUdoD8j.js";import"./Palette-BDlA8RUr.js";import"./Play-BGGUeSDd.js";import"./Plus-CQOl41pg.js";import"./SearchMd-Da504yGV.js";import"./Shield01-CYPtC_lA.js";import"./Stars01-BJuGXG_N.js";import"./Trash01-z6De146C.js";import"./Upload01-C4sYhZ0M.js";import"./User01-Cvp121NC.js";import"./Users01-DcrlsWI1.js";import"./XClose-BKWXOZkj.js";import"./X-DgKWdqZ1.js";import"./Zap-Cxu6aoRs.js";import"./useInfiniteQuery-BAIT4yxs.js";import"./use-infinite-scroll-BlkXRVRw.js";import"./use-connection-Cvfufzsw.js";import"./use-collections-w44ZyJ1t.js";import"./use-mcp-client-BbOUwA1H.js";import"./auth-xlfJjVrK.js";import"./use-virtual-mcp-CLJ6qnG1.js";import"./card-D_tApM0k.js";import"./sheet-Djk8ol5s.js";import"./table-D_zHkpnq.js";import"./empty-state-Lmcbk0Zv.js";import"./use-members-blURElyD.js";import"./use-org-auth-client-oMz0ubhe.js";import"./task-status-DLHF9SZS.js";import"./use-automations-BllXXW29.js";import"./studio-tools-BvQ8Bli1.js";import"./useSuspenseInfiniteQuery-DpmGs3CS.js";import"./badge-CdirlPdy.js";import"./select-BePf1IJF.js";import"./index-BdQq_4o_.js";import"./tooltip-CUlMaf5E.js";import"./checkbox-OtNKSART.js";import"./command-iFNWkWs6.js";import"./index-BDyN-RAN.js";import"./dialog-BFjL_my-.js";import"./popover-D7BamlkK.js";import"./avatar-Bh53txVX.js";import"./scroll-area-CbWYdgRA.js";import"./use-clock-tick-DmUrmEeM.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-BWQBaWRC.js";import"./file-type-icon-CWgZWEkL.js";import"./tab-id-BptcWVWa.js";import"./content-blocks-o63cs2vh.js";import"./types-CDn4NSje.js";import"./chat-context-Dz9rhizY.js";import"./hooks-CFfc1t5D.js";import"./decopilot-sse-pool-DXv2T192.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-ai-providers-D-XhQ6_q.js";import"./use-organization-settings-B5L78CqV.js";import"./shell-layout-BkVrkYmb.js";import"./required-auth-layout-Be__d9RH.js";import"./use-org-sso-CIoYIaj1.js";import"./integration-icon-Dpj2NSXY.js";import"./use-navigate-to-agent-CidcWwFC.js";import"./use-mcp-prompts-Y5le4syR.js";import"./form-B6Nf7hvD.js";import"./index-BVXtRunj.js";import"./drawer-DZMXZPMN.js";import"./collection-search-JfLpXbmD.js";import"./toggle-group-CSO_yZKm.js";import"./sortable.esm-BN6bAoSL.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card--7NnoNLM.js";import"./use-registry-connections-3CHe_VwJ.js";import"./extract-connection-data-Bau_aQvM.js";import"./collection-tabs-B5YA_dM5.js";import"./connection-form-helpers-BW7AB-E3.js";import"./authenticate-and-persist-oauth-DPn6Vk96.js";import"./mcp-oauth-B5dnAc7V.js";import"./connect-desktop-dialog-BxJ3X8re.js";import"./decopilot-CiHv6XGE.js";import"./skeleton-DrM35KBr.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-ELYurXQx.js";import"./dropdown-menu-B1DaP6vk.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-Bbu_XWuO.js";import"./toolbar-D9CfLhAB.js";import"./preview-dialog-C9Rx0Dtg.js";import"./index-ZANilAX7.js";import"./use-mcp-tools-xGr1pN0n.js";import"./use-capability-DfdnXTfH.js";import"./shell-route-loading-gKBpXu2h.js";import"./tools-list-DC6csFT2.js";import"./alert-dialog-CkCCiKt9.js";import"./switch-dEe0am9a.js";import"./use-debounced-autosave-CaTQp8tz.js";import"./index-qZ5-LmpP.js";import"./sidebar-DLCPSSnc.js";import"./search-input-CeqwXCv0.js";import"./github-repo-picker-CThHTj5h.js";import"./use-secrets-DlUSWVTu.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./view-mode-toggle-CIiu6iGh.js";import"./index-ovnDLwrg.js";import"./use-file-configs-Bg9S5WW4.js";import"./monaco-editor-zMbhl8rq.js";import"./select-model-CgXZFBIr.js";import"./automation-list-row-CCZ8TAPg.js";function ke(A){return Array.isArray(A)?A.map(e=>({key:F(e?.key),value:F(e?.value)})):[]}function mi(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{mi 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-CurNB2HG.js";import{P as L}from"./index-qZ5-LmpP.js";import{A as G}from"./avatar-Bh53txVX.js";import{S as D}from"./switch-dEe0am9a.js";import{d as U,b as Y,a as $,S as K}from"./select-BePf1IJF.js";import{T as O,a as z}from"./toggle-group-CSO_yZKm.js";import{I as H}from"./input-RRjvrcUF.js";import{i as J}from"./Monitor01-BxGhRsUq.js";import{n as M,a as Q}from"./Sun-2eUdoD8j.js";import{i as W}from"./Play-BGGUeSDd.js";import{u as X}from"./use-debounced-autosave-CaTQp8tz.js";import{p as Z,q as ee}from"./question-004-sINsf4GQ.js";import"./index-C0_iRWcE.js";import{c as te,b as A,S as E,a as F}from"./settings-section-ELYurXQx.js";import"./sidebar-DLCPSSnc.js";import"./LayoutLeft-CuTI_WR9.js";import"./tooltip-CUlMaf5E.js";import"./sheet-Djk8ol5s.js";import"./X-DgKWdqZ1.js";import"./User01-Cvp121NC.js";import"./index-BdQq_4o_.js";import"./ChevronUp-CiXD4kQk.js";import"./ChevronDown-CkcGr2qp.js";import"./card-D_tApM0k.js";import"./ArrowUpRight-CwVMUp5O.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 Te(){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{Te as default};
@@ -1 +0,0 @@
1
- import{c as $,w as H,j as A}from"./index-CurNB2HG.js";import{l as L,g as E,s as y}from"./scroll-area-CbWYdgRA.js";import{p as O,u as k}from"./use-mcp-client-BbOUwA1H.js";import{b as q,c as B}from"./use-mcp-tools-xGr1pN0n.js";import{u as Y}from"./index-C2QgbLxn.js";import{c as G}from"./content-blocks-o63cs2vh.js";import{g as K,M as V,a as D}from"./types-CDn4NSje.js";import{u as z,b as F}from"./chat-context-Dz9rhizY.js";import{b as J}from"./shell-layout-BkVrkYmb.js";import"./agent-icon-pz8iT5cD.js";import"./AlertCircle-BMCh3ayd.js";import"./Tool01-WsqNh4er.js";import"./SwitchHorizontal01-DXdcIz27.js";import"./Settings02-ozrzAwut.js";import"./XCircle-DFBcUexW.js";import"./ArrowUpRight-CwVMUp5O.js";import"./ZapSquare-DOK7F1oe.js";import"./Users03-CJuVy8Iz.js";import"./CheckCircle-BP2lb3AX.js";import"./ChevronUp-CiXD4kQk.js";import"./ChevronDown-CkcGr2qp.js";import"./ChevronLeft-Cgw9JZYG.js";import"./ChevronRight-DYe9AFXl.js";import"./DotsVertical-Z_h1bSB3.js";import"./Stars02-C4CXFnp9.js";import"./Eye-B92Ff4dY.js";import"./ZoomOut-ryBmf3S4.js";import"./Globe01-MZlo2_34.js";import"./FilterLines-CMHeCbJ1.js";import"./Star01-BoZIiKCL.js";import"./Globe04-BPWbnzx0.js";import"./HardDrive-D8FSpDtM.js";import"./Key01-CZVV-ceU.js";import"./LayoutLeft-CuTI_WR9.js";import"./LinkExternal01-DekFjc9P.js";import"./Monitor01-BxGhRsUq.js";import"./Sun-2eUdoD8j.js";import"./Palette-BDlA8RUr.js";import"./Play-BGGUeSDd.js";import"./Plus-CQOl41pg.js";import"./SearchMd-Da504yGV.js";import"./Shield01-CYPtC_lA.js";import"./Stars01-BJuGXG_N.js";import"./Trash01-z6De146C.js";import"./Upload01-C4sYhZ0M.js";import"./User01-Cvp121NC.js";import"./Users01-DcrlsWI1.js";import"./XClose-BKWXOZkj.js";import"./X-DgKWdqZ1.js";import"./Zap-Cxu6aoRs.js";import"./use-clock-tick-DmUrmEeM.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-BWQBaWRC.js";import"./tooltip-CUlMaf5E.js";import"./file-type-icon-CWgZWEkL.js";import"./dialog-BFjL_my-.js";import"./tab-id-BptcWVWa.js";import"./hooks-CFfc1t5D.js";import"./decopilot-sse-pool-DXv2T192.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./studio-tools-BvQ8Bli1.js";import"./sheet-Djk8ol5s.js";import"./integration-icon-Dpj2NSXY.js";import"./use-virtual-mcp-CLJ6qnG1.js";import"./use-collections-w44ZyJ1t.js";import"./use-navigate-to-agent-CidcWwFC.js";import"./use-connection-Cvfufzsw.js";import"./use-mcp-prompts-Y5le4syR.js";import"./form-B6Nf7hvD.js";import"./label-DrXdAtn0.js";import"./input-RRjvrcUF.js";import"./index-BdQq_4o_.js";import"./auth-xlfJjVrK.js";import"./index-BVXtRunj.js";import"./drawer-DZMXZPMN.js";import"./collection-search-JfLpXbmD.js";import"./select-BePf1IJF.js";import"./tabs-DOJ7e6Z7.js";import"./toggle-group-CSO_yZKm.js";import"./sortable.esm-BN6bAoSL.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card--7NnoNLM.js";import"./use-registry-connections-3CHe_VwJ.js";import"./use-organization-settings-B5L78CqV.js";import"./useInfiniteQuery-BAIT4yxs.js";import"./use-infinite-scroll-BlkXRVRw.js";import"./extract-connection-data-Bau_aQvM.js";import"./card-D_tApM0k.js";import"./collection-tabs-B5YA_dM5.js";import"./badge-CdirlPdy.js";import"./textarea-C7j7_npp.js";import"./connection-form-helpers-BW7AB-E3.js";import"./authenticate-and-persist-oauth-DPn6Vk96.js";import"./mcp-oauth-B5dnAc7V.js";import"./useSuspenseInfiniteQuery-DpmGs3CS.js";import"./use-ai-providers-D-XhQ6_q.js";import"./connect-desktop-dialog-BxJ3X8re.js";import"./decopilot-CiHv6XGE.js";import"./checkbox-OtNKSART.js";import"./skeleton-DrM35KBr.js";import"./ai-providers-logos-DD3qZ33J.js";import"./avatar-Bh53txVX.js";import"./settings-section-ELYurXQx.js";import"./popover-D7BamlkK.js";import"./command-iFNWkWs6.js";import"./index-BDyN-RAN.js";import"./dropdown-menu-B1DaP6vk.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-Bbu_XWuO.js";import"./empty-state-Lmcbk0Zv.js";import"./toolbar-D9CfLhAB.js";import"./preview-dialog-C9Rx0Dtg.js";import"./index-ZANilAX7.js";import"./use-capability-DfdnXTfH.js";import"./shell-route-loading-gKBpXu2h.js";import"./tools-list-DC6csFT2.js";import"./alert-dialog-CkCCiKt9.js";import"./switch-dEe0am9a.js";import"./use-debounced-autosave-CaTQp8tz.js";import"./index-qZ5-LmpP.js";import"./sidebar-DLCPSSnc.js";import"./search-input-CeqwXCv0.js";import"./github-repo-picker-CThHTj5h.js";import"./use-secrets-DlUSWVTu.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./view-mode-toggle-CIiu6iGh.js";import"./index-ovnDLwrg.js";import"./automation-runs-DBQv8Uvp.js";import"./table-D_zHkpnq.js";import"./use-members-blURElyD.js";import"./use-org-auth-client-oMz0ubhe.js";import"./task-status-DLHF9SZS.js";import"./use-automations-BllXXW29.js";import"./use-file-configs-Bg9S5WW4.js";import"./monaco-editor-zMbhl8rq.js";import"./select-model-CgXZFBIr.js";import"./automation-list-row-CCZ8TAPg.js";import"./required-auth-layout-Be__d9RH.js";import"./use-org-sso-CIoYIaj1.js";const Q={};function W(S){const t=$.c(37),{client:r,resourceURI:h,tool:o,connectionId:p,orgId:l,args:M}=S,{sendMessage:I}=z(),{setAppContext:u,clearAppContext:n}=F(),{setChatOpen:f,openTab:g}=J(),e=`${p}:${o.name}`;let a;t[0]!==g?(a=C=>C==="inline"?(g("0"),"inline"):"fullscreen",t[0]=g,t[1]=a):a=t[1];const m=a,s=M??Q;let c;t[2]!==r||t[3]!==o.name||t[4]!==s?(c={client:r,toolName:o.name,toolArguments:s},t[2]=r,t[3]=o.name,t[4]=s,t[5]=c):c=t[5];const{data:i}=B(c);let x;if(t[6]!==o._meta||t[7]!==o.name){const C=E(o._meta);x=y(o.name,C),t[6]=o._meta,t[7]=o.name,t[8]=x}else x=t[8];const U=x;let d;t[9]!==o.inputSchema?(d=o.inputSchema??{type:"object"},t[9]=o.inputSchema,t[10]=d):d=t[10];let N;t[11]!==U||t[12]!==d||t[13]!==o?(N={...o,name:U,inputSchema:d},t[11]=U,t[12]=d,t[13]=o,t[14]=N):N=t[14];const b=N;let _;t[15]!==I||t[16]!==f?(_=C=>{const w=G(C.content);w.content.length>0&&(f(!0),I({tiptapDoc:w}))},t[15]=I,t[16]=f,t[17]=_):_=t[17];const j=_;let P;t[18]!==b?(P={tool:b},t[18]=b,t[19]=P):P=t[19];let T;t[20]!==u||t[21]!==e?(T=C=>u(e,C),t[20]=u,t[21]=e,t[22]=T):T=t[22];let R;t[23]!==n||t[24]!==e?(R=()=>n(e),t[23]=n,t[24]=e,t[25]=R):R=t[25];let v;return t[26]!==r||t[27]!==j||t[28]!==m||t[29]!==l||t[30]!==h||t[31]!==P||t[32]!==T||t[33]!==R||t[34]!==s||t[35]!==i?(v=A.jsx(V,{resourceURI:h,orgId:l,toolInfo:P,toolInput:s,toolResult:i,displayMode:"fullscreen",minHeight:D.fullscreen.minHeight,maxHeight:D.fullscreen.maxHeight,client:r,onMessage:j,onUpdateModelContext:T,onTeardown:R,onRequestDisplayMode:m,className:"h-full"}),t[26]=r,t[27]=j,t[28]=m,t[29]=l,t[30]=h,t[31]=P,t[32]=T,t[33]=R,t[34]=s,t[35]=i,t[36]=v):v=t[36],v}function je(S){const t=$.c(24),{connectionId:r,toolName:h,args:o}=S,{org:p}=H(),l=Y();let M;t[0]!==r||t[1]!==l?(M=O(r)&&l.vmEntry?.sandboxProviderKind==="user-desktop"&&l.previewUrl?`${l.previewUrl.replace(/\/+$/,"")}/api/mcp`:void 0,t[0]=r,t[1]=l,t[2]=M):M=t[2];const I=M;let u;t[3]!==r||t[4]!==I||t[5]!==p.id||t[6]!==p.slug?(u={connectionId:r,orgId:p.id,orgSlug:p.slug,mcpUrl:I},t[3]=r,t[4]=I,t[5]=p.id,t[6]=p.slug,t[7]=u):u=t[7];const n=k(u);let f;t[8]!==n?(f={client:n},t[8]=n,t[9]=f):f=t[9];const{data:g}=q(f);let e,a,m;t[10]!==h||t[11]!==g.tools?(e=L(decodeURIComponent(h)),m=g.tools.find(i=>i.name===e)??g.tools.find(i=>{const x=E(i._meta);if(!x)return!1;if(y(i.name,x)===e)return!0;const d=y(e,x);return d!==e&&i.name===d}),a=m?._meta?K(m._meta):void 0,t[10]=h,t[11]=g.tools,t[12]=e,t[13]=a,t[14]=m):(e=t[12],a=t[13],m=t[14]);const s=a;if(!m||!s){let i;return t[15]!==e?(i=A.jsx("div",{className:"flex items-center justify-center h-full w-full",children:A.jsxs("p",{className:"text-sm text-muted-foreground",children:['Tool "',e,'" not found or has no UI']})}),t[15]=e,t[16]=i):i=t[16],i}let c;return t[17]!==o||t[18]!==n||t[19]!==r||t[20]!==p.id||t[21]!==s||t[22]!==m?(c=A.jsx(W,{client:n,resourceURI:s,tool:m,connectionId:r,orgId:p.id,args:o}),t[17]=o,t[18]=n,t[19]=r,t[20]=p.id,t[21]=s,t[22]=m,t[23]=c):c=t[23],c}export{je as AppViewContent};