decocms 3.86.1 → 3.87.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (235) hide show
  1. package/dist/client/assets/{AlertCircle-DKDv1c5a.js → AlertCircle-DCaILIxy.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-CL_ND2fd.js → ArrowUpRight-X5amVRyC.js} +1 -1
  3. package/dist/client/assets/{CheckCircle-Cf7Vfzh1.js → CheckCircle-CbsNhQn0.js} +1 -1
  4. package/dist/client/assets/{ChevronDown-BZMxGINT.js → ChevronDown-CVjUKz-z.js} +1 -1
  5. package/dist/client/assets/{ChevronLeft-DdoGlJfU.js → ChevronLeft-D1-Kt_O_.js} +1 -1
  6. package/dist/client/assets/{ChevronRight-DW1FHwl9.js → ChevronRight-B5vIIazE.js} +1 -1
  7. package/dist/client/assets/{ChevronUp-DK-p-OwS.js → ChevronUp-BVstlWuJ.js} +1 -1
  8. package/dist/client/assets/{DotsVertical-Dj0bH-G-.js → DotsVertical-jXbP9E3i.js} +1 -1
  9. package/dist/client/assets/{Eye-C1cT97Dr.js → Eye-CZMmu7ZU.js} +1 -1
  10. package/dist/client/assets/{FilterLines-BbZdzGgI.js → FilterLines-PGGfujeb.js} +1 -1
  11. package/dist/client/assets/Form-otBZ0aYe.js +26 -0
  12. package/dist/client/assets/{Globe01-MmdfsJuj.js → Globe01-Dkk22t5V.js} +1 -1
  13. package/dist/client/assets/{Globe04-C1xLhm_u.js → Globe04-DqCAznfy.js} +1 -1
  14. package/dist/client/assets/{HardDrive-CTxqPq4g.js → HardDrive-Dm-8T9iU.js} +1 -1
  15. package/dist/client/assets/{Key01-D_aQKwoU.js → Key01-BNThvF9O.js} +1 -1
  16. package/dist/client/assets/{LayoutLeft-DGVVcFUt.js → LayoutLeft-IEoSRkSV.js} +1 -1
  17. package/dist/client/assets/{LinkExternal01-CjjlbDYr.js → LinkExternal01-AFpRcUMN.js} +1 -1
  18. package/dist/client/assets/{Monitor01-Bdmau1Kt.js → Monitor01-ge-8I-dx.js} +1 -1
  19. package/dist/client/assets/{Palette-B2UGmW-_.js → Palette-DOfcM3Kq.js} +1 -1
  20. package/dist/client/assets/{Play-BMlmnmbt.js → Play-BpkgKRX8.js} +1 -1
  21. package/dist/client/assets/{Plus-Dw7ZaPZJ.js → Plus-BAnxALLT.js} +1 -1
  22. package/dist/client/assets/{SearchMd-B7uVTp5E.js → SearchMd-D72ymOya.js} +1 -1
  23. package/dist/client/assets/{Settings02-BOrHnhSy.js → Settings02-BYzbH49L.js} +1 -1
  24. package/dist/client/assets/{Shield01-DoXHEBfW.js → Shield01-DzzrgcSm.js} +1 -1
  25. package/dist/client/assets/{Star01-DNV8Ma9Q.js → Star01-CfUlqnJc.js} +1 -1
  26. package/dist/client/assets/{Stars01-DkrXqc8-.js → Stars01-DOOJ-cpD.js} +1 -1
  27. package/dist/client/assets/{Stars02-Ceo2qvgP.js → Stars02-BcDfq8PM.js} +1 -1
  28. package/dist/client/assets/{Sun-8teVrEhL.js → Sun-r3rOsIIR.js} +1 -1
  29. package/dist/client/assets/{SwitchHorizontal01-DzDSRTn8.js → SwitchHorizontal01-D3QmyK-N.js} +1 -1
  30. package/dist/client/assets/{Tool01-Cnycw8Ef.js → Tool01-Bahn8UbK.js} +1 -1
  31. package/dist/client/assets/{Trash01-4tPF0VaH.js → Trash01-BNbAqaqW.js} +1 -1
  32. package/dist/client/assets/{Upload01-CmdzZ7sb.js → Upload01-4k3hmRFX.js} +1 -1
  33. package/dist/client/assets/{User01-DG6-o1bh.js → User01-_ttgUTw7.js} +1 -1
  34. package/dist/client/assets/{Users01-Cjr16PQI.js → Users01-BwX0Mh9G.js} +1 -1
  35. package/dist/client/assets/{Users03-Hhn2gOWC.js → Users03-Bp6iF_8k.js} +1 -1
  36. package/dist/client/assets/{X-Dothba_A.js → X-D-dT8MOl.js} +1 -1
  37. package/dist/client/assets/{XCircle-Et4HA60-.js → XCircle-BGPqJ1Ro.js} +1 -1
  38. package/dist/client/assets/{XClose-DVjO_TNn.js → XClose-CNxbnD3N.js} +1 -1
  39. package/dist/client/assets/{Zap-CxpukXGS.js → Zap-CxIlaYID.js} +1 -1
  40. package/dist/client/assets/{ZapSquare-CvpHTkF6.js → ZapSquare-BDFHxBEC.js} +1 -1
  41. package/dist/client/assets/{ZoomOut-KuF6xRRI.js → ZoomOut-Bw1ZSU5L.js} +1 -1
  42. package/dist/client/assets/{access-gate-D0uXb2Ny.js → access-gate-CCJp4m8K.js} +1 -1
  43. package/dist/client/assets/{add-section-modal-D1rIVSOl.js → add-section-modal-BgrC9Ld1.js} +1 -1
  44. package/dist/client/assets/{agent-icon-C9Jofb-u.js → agent-icon-DLeN3d18.js} +1 -1
  45. package/dist/client/assets/{agents-list-4OBz6WwE.js → agents-list-Q3tDYSwW.js} +1 -1
  46. package/dist/client/assets/ai-providers-BqFV0dkm.js +1 -0
  47. package/dist/client/assets/{alert-VMQRKJYl.js → alert-Dry1jh9V.js} +1 -1
  48. package/dist/client/assets/{alert-dialog-DBza5R0g.js → alert-dialog-BRxMo-sj.js} +1 -1
  49. package/dist/client/assets/app-editor-CmSP6n2r.js +1 -0
  50. package/dist/client/assets/{auth-2-m6wz4w.js → auth-BmpBXuc6.js} +1 -1
  51. package/dist/client/assets/{auth-catchall-DFXOmfkX.js → auth-catchall-C2f_hrTA.js} +1 -1
  52. package/dist/client/assets/{auth-entry-CrYVmm9E.js → auth-entry-Dc0ISy_Q.js} +1 -1
  53. package/dist/client/assets/{auth-split-layout-YC_3poi7.js → auth-split-layout-vIU-YxKv.js} +1 -1
  54. package/dist/client/assets/{authenticate-and-persist-oauth-jYJBnNn_.js → authenticate-and-persist-oauth-Ch8j6yff.js} +1 -1
  55. package/dist/client/assets/{automation-list-row-RLnrAaQk.js → automation-list-row-DuiEBMt2.js} +1 -1
  56. package/dist/client/assets/{automation-runs-Df9J1bXw.js → automation-runs-Cdam9_64.js} +1 -1
  57. package/dist/client/assets/{automations-B60pVFVi.js → automations-CdkAIVKM.js} +1 -1
  58. package/dist/client/assets/{avatar-IZb76xF5.js → avatar-ByeXDTC_.js} +1 -1
  59. package/dist/client/assets/{badge-DFWqydWM.js → badge-DUd6QA6I.js} +1 -1
  60. package/dist/client/assets/{block-document-CzdI7hiv.js → block-document-CC_dKbbH.js} +1 -1
  61. package/dist/client/assets/{brand-context-I2Ic4n1X.js → brand-context-EyJOR9fi.js} +1 -1
  62. package/dist/client/assets/buckets-Du6WAmVO.js +1 -0
  63. package/dist/client/assets/{capability-load-error-B9IOpVHT.js → capability-load-error-hf3qlFQ9.js} +1 -1
  64. package/dist/client/assets/{card-CYcWxwTq.js → card-BL8IT_Xq.js} +1 -1
  65. package/dist/client/assets/category-editor-BkcL4gtt.js +1 -0
  66. package/dist/client/assets/{chat-context-BUGEnk3o.js → chat-context-8aInoVVs.js} +1 -1
  67. package/dist/client/assets/{checkbox-D6DN5wX2.js → checkbox-BvC4eja3.js} +1 -1
  68. package/dist/client/assets/{cli-auth-success-DEQ283KZ.js → cli-auth-success-BzKwknZh.js} +1 -1
  69. package/dist/client/assets/collection-detail-DGACG0zf.js +1 -0
  70. package/dist/client/assets/{collection-display-button-CwjAZxJL.js → collection-display-button-CWZcD7VW.js} +1 -1
  71. package/dist/client/assets/{collection-search-CFs0gBmh.js → collection-search-xJgITIyC.js} +1 -1
  72. package/dist/client/assets/{collection-tabs-D6hMQ7Uk.js → collection-tabs-rwQ7O1FC.js} +1 -1
  73. package/dist/client/assets/{command-DWtuH3XL.js → command-DrqBy6cr.js} +1 -1
  74. package/dist/client/assets/commerce-onboarding-PAEJK5wr.js +1 -0
  75. package/dist/client/assets/{connect-desktop-dialog-BQ2QKxzW.js → connect-desktop-dialog-CN-nGv3X.js} +1 -1
  76. package/dist/client/assets/{connection-card-BBo-mCQ3.js → connection-card-_vJp-QnB.js} +1 -1
  77. package/dist/client/assets/connection-detail-ja-xrIwZ.js +1 -0
  78. package/dist/client/assets/{connection-form-helpers-BkiVmzh-.js → connection-form-helpers-I0PYYuLM.js} +1 -1
  79. package/dist/client/assets/connections-B1jNaws1.js +1 -0
  80. package/dist/client/assets/{context-menu-BcYjb5Fc.js → context-menu-HarJm6y_.js} +1 -1
  81. package/dist/client/assets/{decopilot-C6k4C-5x.js → decopilot-DlerL3TD.js} +1 -1
  82. package/dist/client/assets/{decopilot-sse-pool-BWdhrrzW.js → decopilot-sse-pool-D0qyyVP7.js} +1 -1
  83. package/dist/client/assets/{dialog-C6Huna5L.js → dialog-BuyMoIGd.js} +1 -1
  84. package/dist/client/assets/{domain-settings-Dirc71GY.js → domain-settings-DKI84wPN.js} +1 -1
  85. package/dist/client/assets/{drawer-DSl868BV.js → drawer-R83GIfSJ.js} +1 -1
  86. package/dist/client/assets/{dropdown-menu-DZcXfAzz.js → dropdown-menu-6KXvVkGj.js} +1 -1
  87. package/dist/client/assets/{empty-state-CiKyH8Zu.js → empty-state-8wIqOHhT.js} +1 -1
  88. package/dist/client/assets/{extract-connection-data-CxsQnV0o.js → extract-connection-data-BlAuqFCc.js} +1 -1
  89. package/dist/client/assets/file-explorer-Xu0RpKKj.js +2 -0
  90. package/dist/client/assets/{file-type-icon-BWw9UmKa.js → file-type-icon-CvUBwDjL.js} +1 -1
  91. package/dist/client/assets/{files-CFA7zBKC.js → files-aEPuOJ77.js} +1 -1
  92. package/dist/client/assets/{form-C0qrZ_x_.js → form-DrdYYSH7.js} +1 -1
  93. package/dist/client/assets/general-ItE-Caya.js +1 -0
  94. package/dist/client/assets/{github-repo-picker-D1khnJFy.js → github-repo-picker-B9itq1xr.js} +1 -1
  95. package/dist/client/assets/{hooks-DQdOsZp5.js → hooks-B2hm8dgB.js} +1 -1
  96. package/dist/client/assets/{import-from-deco-dialog-BO45XrD3.js → import-from-deco-dialog-LpeKak-8.js} +1 -1
  97. package/dist/client/assets/{index-DV9_3Xnk.js → index-01iYleW9.js} +1 -1
  98. package/dist/client/assets/index-8j69uwRU.js +1 -0
  99. package/dist/client/assets/{index-5v8F2WfF.js → index-B0KuFfZg.js} +2 -2
  100. package/dist/client/assets/{index-CnMpta5V.js → index-BD-GJSKU.js} +1 -1
  101. package/dist/client/assets/index-BP-ioQEj.js +1 -0
  102. package/dist/client/assets/index-BdQq_4o_.js +1 -0
  103. package/dist/client/assets/{index-Dxusy0LN.js → index-BneU-diW.js} +1 -1
  104. package/dist/client/assets/index-BpzEWYcj.js +1 -0
  105. package/dist/client/assets/{index-4sp0XNgi.js → index-C4Pfm5Oe.js} +1 -1
  106. package/dist/client/assets/{index-CpFSes0G.js → index-C5jRpoWd.js} +1 -1
  107. package/dist/client/assets/index-CDSjl7Ui.js +1 -0
  108. package/dist/client/assets/{index-Dc0NbcTT.js → index-CZObCZGR.js} +1 -1
  109. package/dist/client/assets/{index-CYxs6fVn.js → index-CdH9ADyr.js} +10 -10
  110. package/dist/client/assets/{index-D10xo2Wm.js → index-DP_mpTaG.js} +4 -4
  111. package/dist/client/assets/{index-C1Ri0RYU.js → index-oY9SWynr.js} +1 -1
  112. package/dist/client/assets/{index-redirect-Ej9UkabN.js → index-redirect-CLJSuvD8.js} +1 -1
  113. package/dist/client/assets/{input-D3Hn-5fP.js → input-BIu7fT2w.js} +1 -1
  114. package/dist/client/assets/{integration-icon-D_K0I1bc.js → integration-icon-DM5W4vtE.js} +1 -1
  115. package/dist/client/assets/{label-BaI9WHK8.js → label-DPhUzMw-.js} +1 -1
  116. package/dist/client/assets/{login-joo9haqp.js → login-c1Klklse.js} +1 -1
  117. package/dist/client/assets/{mcp-oauth-Ca5pqK3O.js → mcp-oauth-CzalxeD0.js} +1 -1
  118. package/dist/client/assets/{members-Byfyv7Md.js → members-B3SDcfGH.js} +2 -2
  119. package/dist/client/assets/{monaco-editor-C1JQgPRk.js → monaco-editor-OzwRuboT.js} +1 -1
  120. package/dist/client/assets/{monitoring-stats-row-BStPmHDn.js → monitoring-stats-row-CZFGN_Ar.js} +1 -1
  121. package/dist/client/assets/{oauth-callback-ai-provider-BikJ5qDi.js → oauth-callback-ai-provider-Zibshrw4.js} +1 -1
  122. package/dist/client/assets/{oauth-callback-D1tHpSQP.js → oauth-callback-rILtKGBx.js} +1 -1
  123. package/dist/client/assets/{onboarding-qDsQ0nBN.js → onboarding-Ba1_LMfh.js} +1 -1
  124. package/dist/client/assets/{org-install-Qft7bFjM.js → org-install-B3ClN2KG.js} +1 -1
  125. package/dist/client/assets/{org-layout-CLW9NRqs.js → org-layout-BIcSmhzR.js} +1 -1
  126. package/dist/client/assets/{organization-choice-COn9cJVO.js → organization-choice-Djr2j4p7.js} +1 -1
  127. package/dist/client/assets/{page-seo-form-lit_xaiS.js → page-seo-form-Cygtl0_G.js} +1 -1
  128. package/dist/client/assets/page-seo-sheet-Ca_ed5x4.js +1 -0
  129. package/dist/client/assets/{popover-C5gLQmVJ.js → popover-CoSr2FBy.js} +1 -1
  130. package/dist/client/assets/post-editor-DlBTWEb0.js +1 -0
  131. package/dist/client/assets/{preview-dialog-DUP6mqXn.js → preview-dialog-Ew97vZX-.js} +1 -1
  132. package/dist/client/assets/{primitives-CM2raXR1.js → primitives-Y5zOyEze.js} +1 -1
  133. package/dist/client/assets/profile-Bv93_4sd.js +1 -0
  134. package/dist/client/assets/project-app-view-B-FRjb71.js +1 -0
  135. package/dist/client/assets/record-editor-CnrRrpeQ.js +1 -0
  136. package/dist/client/assets/registry-DXqXIJ3q.js +2 -0
  137. package/dist/client/assets/{registry-layout-IkZHM-V4.js → registry-layout-DJX2uyJL.js} +2 -2
  138. package/dist/client/assets/{require-capability-0MVu6DnF.js → require-capability-CaEtxlmL.js} +1 -1
  139. package/dist/client/assets/{required-auth-layout-C-olAxiD.js → required-auth-layout-DaTmuUAT.js} +1 -1
  140. package/dist/client/assets/{reset-password-DgcYgCPi.js → reset-password-DOCud_M1.js} +1 -1
  141. package/dist/client/assets/{roles-Bnwxynaw.js → roles-CxxJGu2W.js} +1 -1
  142. package/dist/client/assets/{save-status-f7sYfXY0.js → save-status-CzIIhKYY.js} +1 -1
  143. package/dist/client/assets/{scroll-area-C5IE_o87.js → scroll-area-DqRON9QZ.js} +1 -1
  144. package/dist/client/assets/{search-input-DwJIqEE6.js → search-input-CBG595Ow.js} +1 -1
  145. package/dist/client/assets/secrets-CI45M6t4.js +1 -0
  146. package/dist/client/assets/{sections-editor-Ct6160yl.js → sections-editor-DGK7CeFk.js} +2 -2
  147. package/dist/client/assets/select-Cr3vICrM.js +1 -0
  148. package/dist/client/assets/{select-model-Rd3CwALX.js → select-model-Bg44O4qj.js} +1 -1
  149. package/dist/client/assets/seo-editor-BnPhYxBs.js +1 -0
  150. package/dist/client/assets/{settings-layout-BiZ0pREw.js → settings-layout-B3cOf57A.js} +1 -1
  151. package/dist/client/assets/{settings-section-Coavx4GZ.js → settings-section-C9C9TZId.js} +1 -1
  152. package/dist/client/assets/{sheet-Cz4-_oqg.js → sheet-CTaEFOuN.js} +1 -1
  153. package/dist/client/assets/{shell-controls-BlanwPNq.js → shell-controls-DTok3_fO.js} +1 -1
  154. package/dist/client/assets/{shell-layout-Cwicrerl.js → shell-layout-BAiMOktM.js} +1 -1
  155. package/dist/client/assets/{shell-route-loading-nz7JKsGk.js → shell-route-loading-s4EoOI9P.js} +1 -1
  156. package/dist/client/assets/{sidebar-DUFS7nKD.js → sidebar-BSjkOAEq.js} +1 -1
  157. package/dist/client/assets/{skeleton-DAm19Q1Q.js → skeleton-DBbnbGFm.js} +1 -1
  158. package/dist/client/assets/{sortable.esm-BROfP1EO.js → sortable.esm-DW_CXYvf.js} +1 -1
  159. package/dist/client/assets/sso-B0FMpGZK.js +1 -0
  160. package/dist/client/assets/{store-BiRnVl7h.js → store-DmCUraJs.js} +1 -1
  161. package/dist/client/assets/store-registry-DWQAV-zh.js +2 -0
  162. package/dist/client/assets/{studio-tools-z5PzgEZo.js → studio-tools-D3_SJ0_N.js} +1 -1
  163. package/dist/client/assets/{switch-CNShaHWc.js → switch-BSnmwd67.js} +1 -1
  164. package/dist/client/assets/{table-BybNndQa.js → table-B4QqlN52.js} +1 -1
  165. package/dist/client/assets/{tabs-EKQE067O.js → tabs-B7KtNlAY.js} +1 -1
  166. package/dist/client/assets/{task-status-DjWhdyec.js → task-status-CN8kElP5.js} +1 -1
  167. package/dist/client/assets/{textarea-CVcNewnq.js → textarea-B5r3kbSQ.js} +1 -1
  168. package/dist/client/assets/{toggle-group-CvHp9qT6.js → toggle-group-BoZF2OOS.js} +1 -1
  169. package/dist/client/assets/{toolbar-KNQEPZYT.js → toolbar-D_dUXYk3.js} +1 -1
  170. package/dist/client/assets/tools-list-Bw8CpHV0.js +1 -0
  171. package/dist/client/assets/{tooltip-VrGyigcV.js → tooltip-CYe5fPCQ.js} +1 -1
  172. package/dist/client/assets/{types-DvdTHMVs.js → types-CJgIJauG.js} +1 -1
  173. package/dist/client/assets/{use-ai-providers-exBfYy9L.js → use-ai-providers-BQTrck2T.js} +1 -1
  174. package/dist/client/assets/{use-automations-SvpwcTEI.js → use-automations-aeYDYpbz.js} +1 -1
  175. package/dist/client/assets/{use-capability-DfeHNCP3.js → use-capability-DhoZz-If.js} +1 -1
  176. package/dist/client/assets/{use-clock-tick-6K15zpKz.js → use-clock-tick-BlJ7-hRX.js} +1 -1
  177. package/dist/client/assets/{use-collections-DVArJb6w.js → use-collections-CSCQtjHx.js} +1 -1
  178. package/dist/client/assets/{use-connection-X4N-9XqT.js → use-connection-CCWvfaxs.js} +1 -1
  179. package/dist/client/assets/{use-copy-CmqBXSyr.js → use-copy-DJR4tQ3-.js} +1 -1
  180. package/dist/client/assets/{use-create-virtual-mcp-Bm0kv2kQ.js → use-create-virtual-mcp-CCvXLRxb.js} +1 -1
  181. package/dist/client/assets/{use-debounced-autosave-qbwQlmr6.js → use-debounced-autosave-C4Qmf5qO.js} +1 -1
  182. package/dist/client/assets/{use-delete-connection-DPXoOLFF.js → use-delete-connection-gqYfcWeD.js} +1 -1
  183. package/dist/client/assets/{use-file-configs-D1wVoLUY.js → use-file-configs-B7ZdH4sp.js} +1 -1
  184. package/dist/client/assets/{use-infinite-scroll-nYPek78V.js → use-infinite-scroll-CU-J9rqm.js} +1 -1
  185. package/dist/client/assets/{use-join-requests-B7A90YDT.js → use-join-requests-DrugHR3B.js} +1 -1
  186. package/dist/client/assets/{use-mcp-client-NkS_1XHm.js → use-mcp-client-B_wvxVvi.js} +1 -1
  187. package/dist/client/assets/{use-mcp-prompts-7I02SPnr.js → use-mcp-prompts-B5ITx1M8.js} +1 -1
  188. package/dist/client/assets/{use-mcp-tools-Cf3odfCU.js → use-mcp-tools--Zcng6MU.js} +1 -1
  189. package/dist/client/assets/{use-members-D-sIksyD.js → use-members-DRYUtb_4.js} +1 -1
  190. package/dist/client/assets/{use-navigate-to-agent-DNVrD-VA.js → use-navigate-to-agent-VYoT0How.js} +1 -1
  191. package/dist/client/assets/{use-org-auth-client-DoX-hmrG.js → use-org-auth-client-p32QdZVr.js} +1 -1
  192. package/dist/client/assets/{use-org-sso-B_sMXWs_.js → use-org-sso-DuGGcbA7.js} +1 -1
  193. package/dist/client/assets/{use-organization-roles-DSU5Ysr9.js → use-organization-roles-DshdakDm.js} +1 -1
  194. package/dist/client/assets/{use-organization-settings-DCsUye9Y.js → use-organization-settings-DNzEj3SY.js} +1 -1
  195. package/dist/client/assets/{use-registry-connections--RtvB6B0.js → use-registry-connections-t5X0dgE2.js} +1 -1
  196. package/dist/client/assets/{use-secrets-9BtDHXYX.js → use-secrets-CdtjD3HA.js} +1 -1
  197. package/dist/client/assets/{use-status-sounds-CynODP2T.js → use-status-sounds-SmT5_iKp.js} +1 -1
  198. package/dist/client/assets/{use-view-mode-mNE_J7Nn.js → use-view-mode-BCaeLPRd.js} +1 -1
  199. package/dist/client/assets/{use-virtual-mcp-Cd0H2SUN.js → use-virtual-mcp-DTNF-w70.js} +1 -1
  200. package/dist/client/assets/useInfiniteQuery-Bziqv5Nz.js +1 -0
  201. package/dist/client/assets/{useQueries-BRwSjq8w.js → useQueries-B88iFaFv.js} +1 -1
  202. package/dist/client/assets/useSuspenseInfiniteQuery-Dx7jl2bl.js +1 -0
  203. package/dist/client/assets/variant-calendar-zBAnpIIP.js +1 -0
  204. package/dist/client/assets/{view-mode-toggle-CUjiraWr.js → view-mode-toggle-dKl9f2N6.js} +1 -1
  205. package/dist/client/index.html +1 -1
  206. package/dist/server/cli.js +253 -206
  207. package/package.json +1 -1
  208. package/dist/client/assets/ai-providers-BJcuIwEn.js +0 -1
  209. package/dist/client/assets/app-editor-B8_gOBlR.js +0 -1
  210. package/dist/client/assets/buckets-D5woD5_m.js +0 -1
  211. package/dist/client/assets/category-editor-D0g3eb2o.js +0 -1
  212. package/dist/client/assets/collection-detail-CId7MJ6g.js +0 -1
  213. package/dist/client/assets/commerce-onboarding-BQr7CbHu.js +0 -1
  214. package/dist/client/assets/connection-detail-QOqPohJx.js +0 -1
  215. package/dist/client/assets/connections-CmDq1jbC.js +0 -1
  216. package/dist/client/assets/file-explorer-DXh9qucR.js +0 -2
  217. package/dist/client/assets/general-8E2Fd8Xp.js +0 -1
  218. package/dist/client/assets/index-B_1K0N-o.js +0 -1
  219. package/dist/client/assets/index-BfcjTli9.js +0 -26
  220. package/dist/client/assets/index-COzOrUXj.js +0 -1
  221. package/dist/client/assets/index-DA2BVD0O.js +0 -1
  222. package/dist/client/assets/page-seo-sheet-Doai3xQ4.js +0 -1
  223. package/dist/client/assets/post-editor-BbP_1gEB.js +0 -1
  224. package/dist/client/assets/profile-CsWpcgUp.js +0 -1
  225. package/dist/client/assets/project-app-view-CQ4DSeTz.js +0 -1
  226. package/dist/client/assets/record-editor-BEO2w03L.js +0 -1
  227. package/dist/client/assets/registry-m5ukPQJI.js +0 -2
  228. package/dist/client/assets/secrets--5Lpz1MU.js +0 -1
  229. package/dist/client/assets/select-mHWPzm7G.js +0 -1
  230. package/dist/client/assets/seo-editor-BGMBSuKS.js +0 -1
  231. package/dist/client/assets/sso-Cyw0tK--.js +0 -1
  232. package/dist/client/assets/store-registry-DKixrJwi.js +0 -2
  233. package/dist/client/assets/useInfiniteQuery-DrFl9S4A.js +0 -1
  234. package/dist/client/assets/useSuspenseInfiniteQuery-Cbf8ULb8.js +0 -1
  235. package/dist/client/assets/variant-calendar-C4usc2cz.js +0 -1
@@ -1 +0,0 @@
1
- import{r as E,c as oe,j as t,E as Ye,i as ce,w as be,b as _e,u as Ze,a as Ne,q as et,v as tt,L as nt,G as st,F as ot,B as U,s as te,m as it,l as de,t as W,K as rt}from"./index-D10xo2Wm.js";import{a as lt,b as De,g as at,e as ct}from"./extract-connection-data-CxsQnV0o.js";import{C as dt}from"./collection-display-button-CwjAZxJL.js";import{S as mt}from"./search-input-DwJIqEE6.js";import{C as ut}from"./collection-tabs-D6hMQ7Uk.js";import{u as pt,a as ke,g as ht,C as Ce}from"./connection-card-BBo-mCQ3.js";import{E as gt}from"./empty-state-CiKyH8Zu.js";import{I as xt}from"./integration-icon-D_K0I1bc.js";import{P as ue}from"./index-4sp0XNgi.js";import{u as ft,D as jt}from"./use-delete-connection-DPXoOLFF.js";import{u as ye}from"./use-capability-DfeHNCP3.js";import{u as yt}from"./use-infinite-scroll-nYPek78V.js";import{u as Ct}from"./use-view-mode-mNE_J7Nn.js";import{g as he}from"./connection-slug-eyAPH6o3.js";import{c as Ae,d as we,b as Te,A as Ie,e as Pe,g as $e,a as Le,f as Oe}from"./alert-dialog-DBza5R0g.js";import{C as Fe}from"./checkbox-D6DN5wX2.js";import{d as Me,c as ze,D as Ve,a as Ee,b as Be,e as Ke}from"./dialog-C6Huna5L.js";import{D as vt,a as St,c as bt,b as _t,d as Nt,e as Dt,f as kt}from"./drawer-DSl868BV.js";import{u as At}from"./tooltip-VrGyigcV.js";import{D as Ue,a as Re,b as He,c as re}from"./dropdown-menu-DZcXfAzz.js";import{F as Q,b as J,c as Y,d as Z,f as ee,a as ve}from"./form-C0qrZ_x_.js";import{I as ie}from"./input-D3Hn-5fP.js";import{d as wt,b as Tt,c as It,S as Pt,a as ae}from"./select-mHWPzm7G.js";import{T as $t}from"./textarea-CVcNewnq.js";import{b as We,u as Lt}from"./use-connection-X4N-9XqT.js";import{u as Ot}from"./use-virtual-mcp-Cd0H2SUN.js";import{u as Ft}from"./studio-tools-z5PzgEZo.js";import{a4 as Mt,ae as zt,C as Vt,z as Et}from"./agent-icon-C9Jofb-u.js";import{n as ge}from"./XCircle-Et4HA60-.js";import{a as Xe}from"./DotsVertical-Dj0bH-G-.js";import{s as qe}from"./Eye-C1cT97Dr.js";import{s as je}from"./Star01-DNV8Ma9Q.js";import{s as Ge}from"./Plus-Dw7ZaPZJ.js";import{s as Qe}from"./Trash01-4tPF0VaH.js";import{s as Je}from"./XClose-DVjO_TNn.js";import{i as pe,a as Se,E as Bt,c as Kt,p as Ut,b as Rt,d as Ht}from"./connection-form-helpers-BkiVmzh-.js";import{a as Wt}from"./authenticate-and-persist-oauth-jYJBnNn_.js";import"./use-mcp-client-NkS_1XHm.js";import"./auth-2-m6wz4w.js";import"./SwitchHorizontal01-DzDSRTn8.js";import"./ChevronUp-DK-p-OwS.js";import"./view-mode-toggle-CUjiraWr.js";import"./badge-DFWqydWM.js";import"./SearchMd-B7uVTp5E.js";import"./use-registry-connections--RtvB6B0.js";import"./use-organization-settings-DCsUye9Y.js";import"./useInfiniteQuery-DrFl9S4A.js";import"./card-CYcWxwTq.js";import"./sidebar-DUFS7nKD.js";import"./LayoutLeft-DGVVcFUt.js";import"./sheet-Cz4-_oqg.js";import"./X-Dothba_A.js";import"./ChevronRight-DW1FHwl9.js";import"./label-BaI9WHK8.js";import"./ChevronDown-BZMxGINT.js";import"./use-collections-DVArJb6w.js";import"./AlertCircle-DKDv1c5a.js";import"./Tool01-Cnycw8Ef.js";import"./Settings02-BOrHnhSy.js";import"./ArrowUpRight-CL_ND2fd.js";import"./ZapSquare-CvpHTkF6.js";import"./Users03-Hhn2gOWC.js";import"./CheckCircle-Cf7Vfzh1.js";import"./ChevronLeft-DdoGlJfU.js";import"./Stars02-Ceo2qvgP.js";import"./ZoomOut-KuF6xRRI.js";import"./Globe01-MmdfsJuj.js";import"./FilterLines-BbZdzGgI.js";import"./Globe04-C1xLhm_u.js";import"./HardDrive-CTxqPq4g.js";import"./Key01-D_aQKwoU.js";import"./LinkExternal01-CjjlbDYr.js";import"./Monitor01-Bdmau1Kt.js";import"./Sun-8teVrEhL.js";import"./Palette-B2UGmW-_.js";import"./Play-BMlmnmbt.js";import"./Shield01-DoXHEBfW.js";import"./Stars01-DkrXqc8-.js";import"./Upload01-CmdzZ7sb.js";import"./User01-DG6-o1bh.js";import"./Users01-Cjr16PQI.js";import"./Zap-CxpukXGS.js";import"./mcp-oauth-Ca5pqK3O.js";function Xt(f){const e=`deco-filters-${f}`,[n,p]=E.useState(()=>{try{const o=globalThis.localStorage?.getItem(e);if(o)return JSON.parse(o)}catch(o){console.error("Failed to parse stored filters:",o)}return[]});return[n,o=>{p(o);try{globalThis.localStorage?.setItem(e,JSON.stringify(o))}catch(i){console.error("Failed to save filters:",i)}}]}function qt(f){const e=oe.c(7),[n,p]=E.useState(f),[l,o]=E.useState(f?"desc":null);let i;e[0]!==l||e[1]!==n?(i=j=>{n!==j?(p(j),o("asc")):l==="asc"?o("desc"):l==="desc"&&(p(void 0),o(null))},e[0]=l,e[1]=n,e[2]=i):i=e[2];const g=i;let h;return e[3]!==g||e[4]!==l||e[5]!==n?(h={sortKey:n,sortDirection:l,handleSort:g},e[3]=g,e[4]=l,e[5]=n,e[6]=h):h=e[6],h}function Gt(f){const e=oe.c(20),{namespace:n,resource:p,defaultSortKey:l,defaultViewMode:o}=f,i=l===void 0?"title":l,g=o===void 0?"table":o,[h,j]=E.useState(""),y=E.useDeferredValue(h),N=`${n}-${p}`,[b,a]=Xt(N),x=`mesh-${p}-filter-visible-${n}`;let m;e[0]!==x?(m=()=>globalThis.localStorage?.getItem(x)==="true",e[0]=x,e[1]=m):m=e[1];const[v,_]=E.useState(m);let D;e[2]!==x?(D=T=>{_(T),globalThis.localStorage?.setItem(x,String(T))},e[2]=x,e[3]=D):D=e[3];const L=D;let O;e[4]!==v||e[5]!==L?(O=()=>{L(!v)},e[4]=v,e[5]=L,e[6]=O):O=e[6];const s=O,[A,F]=Ct(`mesh-${p}-${n}`,g),{sortKey:M,sortDirection:w,handleSort:P}=qt(i),z=M;let C;return e[7]!==v||e[8]!==b||e[9]!==P||e[10]!==h||e[11]!==y||e[12]!==L||e[13]!==a||e[14]!==F||e[15]!==w||e[16]!==z||e[17]!==s||e[18]!==A?(C={search:h,searchTerm:y,setSearch:j,filters:b,setFilters:a,filterBarVisible:v,setFilterBarVisible:L,toggleFilterBar:s,viewMode:A,setViewMode:F,sortKey:z,sortDirection:w,handleSort:P},e[7]=v,e[8]=b,e[9]=P,e[10]=h,e[11]=y,e[12]=L,e[13]=a,e[14]=F,e[15]=w,e[16]=z,e[17]=s,e[18]=A,e[19]=C):C=e[19],C}function Qt(f){const e=oe.c(51),{group:n,onOpen:p,selectionMode:l,selectedIds:o,onToggleSelect:i}=f;let g;if(e[0]!==n.connections||e[1]!==o){let C;e[3]!==o?(C=T=>o.has(T.id),e[3]=o,e[4]=C):C=e[4],g=n.connections.every(C),e[0]=n.connections,e[1]=o,e[2]=g}else g=e[2];const h=g;let j;if(e[5]!==n.connections||e[6]!==o){let C;e[8]!==o?(C=T=>o.has(T.id),e[8]=o,e[9]=C):C=e[9],j=n.connections.some(C),e[5]=n.connections,e[6]=o,e[7]=j}else j=e[7];const y=j,N=`${n.connections.length} instances`;let b;e[10]!==n.icon||e[11]!==n.title||e[12]!==N?(b={title:n.title,icon:n.icon,description:N},e[10]=n.icon,e[11]=n.title,e[12]=N,e[13]=b):b=e[13];let a;e[14]!==h||e[15]!==n.connections||e[16]!==p||e[17]!==i||e[18]!==o||e[19]!==l?(a=()=>l?(()=>{for(const C of n.connections)h?o.has(C.id)&&i(C.id):o.has(C.id)||i(C.id)})():p(),e[14]=h,e[15]=n.connections,e[16]=p,e[17]=i,e[18]=o,e[19]=l,e[20]=a):a=e[20];const x=l&&h&&"ring-2 ring-primary",m=l&&y&&!h&&"ring-1 ring-primary/50";let v;e[21]!==x||e[22]!==m?(v=de(x,m),e[21]=x,e[22]=m,e[23]=v):v=e[23];let _;e[24]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(ge,{}),e[24]=_):_=e[24];let D;e[25]!==h||e[26]!==n.connections||e[27]!==i||e[28]!==o||e[29]!==l||e[30]!==y?(D=l?t.jsx(Fe,{checked:h?!0:y?"indeterminate":!1,onCheckedChange:()=>{for(const C of n.connections)h?o.has(C.id)&&i(C.id):o.has(C.id)||i(C.id)}}):t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}),t.jsxs("span",{className:"text-xs text-muted-foreground font-normal tabular-nums",children:["x",n.connections.length]})]}),e[25]=h,e[26]=n.connections,e[27]=i,e[28]=o,e[29]=l,e[30]=y,e[31]=D):D=e[31];const L=l?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let O;e[32]!==L?(O=de("overflow-hidden transition-all duration-150 ease-out",L),e[32]=L,e[33]=O):O=e[33];let s;e[34]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx(Re,{asChild:!0,children:t.jsx(U,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Yt,children:t.jsx(Xe,{size:20})})}),e[34]=s):s=e[34];let A;e[35]!==p?(A=C=>{C.stopPropagation(),p()},e[35]=p,e[36]=A):A=e[36];let F;e[37]===Symbol.for("react.memo_cache_sentinel")?(F=t.jsx(qe,{size:16}),e[37]=F):F=e[37];let M;e[38]!==A?(M=t.jsxs(Ue,{children:[s,t.jsx(He,{align:"end",onClick:Jt,children:t.jsxs(re,{onClick:A,children:[F,"Open"]})})]}),e[38]=A,e[39]=M):M=e[39];let w;e[40]!==O||e[41]!==M?(w=t.jsx("div",{className:O,children:M}),e[40]=O,e[41]=M,e[42]=w):w=e[42];let P;e[43]!==D||e[44]!==w?(P=t.jsxs("div",{className:"flex items-center gap-1",children:[D,w]}),e[43]=D,e[44]=w,e[45]=P):P=e[45];let z;return e[46]!==P||e[47]!==b||e[48]!==a||e[49]!==v?(z=t.jsx(t.Fragment,{children:t.jsx(Ce,{connection:b,onClick:a,className:v,fallbackIcon:_,headerActionsAlwaysVisible:!0,headerActions:P})}),e[46]=P,e[47]=b,e[48]=a,e[49]=v,e[50]=z):z=e[50],z}function Jt(f){return f.stopPropagation()}function Yt(f){return f.stopPropagation()}function Zt(f){const e=oe.c(23),{count:n,total:p,canManage:l,canManageAgents:o,onSelectAll:i,onDeselectAll:g,onDelete:h,onAddToAgent:j,onToggleStatus:y,onCancel:N}=f;if(n===0)return null;let b;e[0]!==n?(b=t.jsxs("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:[n," selected"]}),e[0]=n,e[1]=b):b=e[1];let a;e[2]!==n||e[3]!==g||e[4]!==i||e[5]!==p?(a=n<p?t.jsxs(U,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:i,children:["Select all (",p,")"]}):t.jsx(U,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:g,children:"Clear selection"}),e[2]=n,e[3]=g,e[4]=i,e[5]=p,e[6]=a):a=e[6];let x;e[7]!==o||e[8]!==j?(x=o&&t.jsxs(U,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:j,children:[t.jsx(Ge,{size:13}),"Add to Agent"]}),e[7]=o,e[8]=j,e[9]=x):x=e[9];let m;e[10]!==l||e[11]!==h||e[12]!==y?(m=l&&t.jsxs(t.Fragment,{children:[t.jsx(U,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>y("active"),children:"Enable"}),t.jsx(U,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>y("inactive"),children:"Disable"}),t.jsxs(U,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:h,children:[t.jsx(Qe,{size:13}),"Delete"]})]}),e[10]=l,e[11]=h,e[12]=y,e[13]=m):m=e[13];let v;e[14]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(Je,{size:13}),e[14]=v):v=e[14];let _;e[15]!==N?(_=t.jsx(U,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:N,children:v}),e[15]=N,e[16]=_):_=e[16];let D;return e[17]!==b||e[18]!==a||e[19]!==x||e[20]!==m||e[21]!==_?(D=t.jsx("div",{className:"fixed bottom-4 left-1/2 z-50 -translate-x-1/2",children:t.jsxs("div",{className:"rounded-xl border border-border bg-background/95 shadow-lg backdrop-blur px-3 py-2 flex items-center gap-2",children:[b,a,x,m,_]})}),e[17]=b,e[18]=a,e[19]=x,e[20]=m,e[21]=_,e[22]=D):D=e[22],D}function en(f){const e=oe.c(25),{open:n,onOpenChange:p,agents:l,onConfirm:o}=f,[i,g]=E.useState(null);let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsxs(Ve,{children:[t.jsx(Ee,{children:"Add to Agent"}),t.jsx(Be,{children:"Select an agent to add the selected connections to."})]}),e[0]=h):h=e[0];let j;e[1]!==l||e[2]!==i?(j=l.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No agents found"}):l.map(D=>t.jsxs("button",{type:"button",onClick:()=>g(D.id),className:de("flex items-center gap-3 w-full rounded-md px-3 py-2 text-left transition-colors",i===D.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(xt,{icon:D.icon,name:D.title,size:"sm",className:"shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:D.title}),D.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:D.description})]})]},D.id)),e[1]=l,e[2]=i,e[3]=j):j=e[3];let y;e[4]!==j?(y=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:j}),e[4]=j,e[5]=y):y=e[5];let N;e[6]!==p?(N=t.jsx(U,{variant:"outline",onClick:()=>p(!1),children:"Cancel"}),e[6]=p,e[7]=N):N=e[7];const b=!i;let a;e[8]!==o||e[9]!==p||e[10]!==i?(a=()=>{i&&(o(i),p(!1),g(null))},e[8]=o,e[9]=p,e[10]=i,e[11]=a):a=e[11];let x;e[12]!==b||e[13]!==a?(x=t.jsx(U,{disabled:b,onClick:a,children:"Add"}),e[12]=b,e[13]=a,e[14]=x):x=e[14];let m;e[15]!==N||e[16]!==x?(m=t.jsxs(Ke,{children:[N,x]}),e[15]=N,e[16]=x,e[17]=m):m=e[17];let v;e[18]!==y||e[19]!==m?(v=t.jsxs(ze,{className:"sm:max-w-[400px]",children:[h,y,m]}),e[18]=y,e[19]=m,e[20]=v):v=e[20];let _;return e[21]!==p||e[22]!==n||e[23]!==v?(_=t.jsx(Me,{open:n,onOpenChange:p,children:v}),e[21]=p,e[22]=n,e[23]=v,e[24]=_):_=e[24],_}function tn(f){const e=oe.c(20),{open:n,onOpenChange:p,count:l,onConfirm:o}=f,i=l!==1?"s":"";let g;e[0]!==l||e[1]!==i?(g=t.jsxs(Ae,{children:["Delete ",l," connection",i,"?"]}),e[0]=l,e[1]=i,e[2]=g):g=e[2];const h=l!==1?"s":"";let j;e[3]!==h?(j=t.jsxs(we,{children:["This will permanently delete the selected connection",h,". This action cannot be undone."]}),e[3]=h,e[4]=j):j=e[4];let y;e[5]!==g||e[6]!==j?(y=t.jsxs(Te,{children:[g,j]}),e[5]=g,e[6]=j,e[7]=y):y=e[7];let N;e[8]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(Ie,{children:"Cancel"}),e[8]=N):N=e[8];const b=l!==1?"s":"";let a;e[9]!==l||e[10]!==o||e[11]!==b?(a=t.jsxs(Pe,{children:[N,t.jsxs($e,{onClick:o,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:["Delete ",l," connection",b]})]}),e[9]=l,e[10]=o,e[11]=b,e[12]=a):a=e[12];let x;e[13]!==y||e[14]!==a?(x=t.jsxs(Le,{children:[y,a]}),e[13]=y,e[14]=a,e[15]=x):x=e[15];let m;return e[16]!==p||e[17]!==n||e[18]!==x?(m=t.jsx(Oe,{open:n,onOpenChange:p,children:x}),e[16]=p,e[17]=n,e[18]=x,e[19]=m):m=e[19],m}function nn(f){return f._registryId?.includes("community-registry")===!0}function sn(f){const e=oe.c(58),{item:n,canManage:p,allConnections:l,connectedAppNames:o,connectingItemId:i,onNavigateConnected:g,onConnect:h}=f,[j,y]=E.useState(!1),[N,b]=E.useState(null);let a,x;e[0]!==o||e[1]!==n?(a=De(n)??"",x=o.has(a),e[0]=o,e[1]=n,e[2]=a,e[3]=x):(a=e[2],x=e[3]);const m=x,v=n._meta?.["mcp.mesh"],_=v?.friendlyName||v?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",D=n.server?.description||n.description||null;let L;e[4]!==n.server?.icons?.[0]?.src||e[5]!==n.server?.repository?(L=n.server?.icons?.[0]?.src||at(n.server?.repository)||null,e[4]=n.server?.icons?.[0]?.src,e[5]=n.server?.repository,e[6]=L):L=e[6];const O=L;let s;if(e[7]!==l||e[8]!==a){let k;e[10]!==a?(k=se=>se.connection_type!=="VIRTUAL"&&se.app_name===a,e[10]=a,e[11]=k):k=e[11],s=l.filter(k),e[7]=l,e[8]=a,e[9]=s}else s=e[9];const A=s;let F;e[12]!==n?(F=nn(n),e[12]=n,e[13]=F):F=e[13];const M=F;let w,P;e[14]!==A||e[15]!==p||e[16]!==M||e[17]!==m||e[18]!==n||e[19]!==h||e[20]!==g?(w=()=>{if(m){const k=A[0];k&&g(k);return}p&&P()},P=()=>{M?(b("connect"),y(!0)):h(n)},e[14]=A,e[15]=p,e[16]=M,e[17]=m,e[18]=n,e[19]=h,e[20]=g,e[21]=w,e[22]=P):(w=e[21],P=e[22]);let z;e[23]!==n||e[24]!==h||e[25]!==N?(z=()=>{te("connections_community_warning_confirmed",{registry_item_id:n.id}),y(!1),N==="connect"&&h(n),b(null)},e[23]=n,e[24]=h,e[25]=N,e[26]=z):z=e[26];const C=z;let T;e[27]!==D||e[28]!==O||e[29]!==_?(T={title:_,description:D,icon:O},e[27]=D,e[28]=O,e[29]=_,e[30]=T):T=e[30];let G;e[31]===Symbol.for("react.memo_cache_sentinel")?(G=t.jsx(ge,{}),e[31]=G):G=e[31];let H;e[32]!==M||e[33]!==n._sourceIcon?(H=M&&n._sourceIcon&&t.jsx("img",{src:n._sourceIcon,alt:"Community",className:"size-4 rounded-sm object-contain"}),e[32]=M,e[33]=n._sourceIcon,e[34]=H):H=e[34];let X;e[35]!==p||e[36]!==i||e[37]!==P||e[38]!==m||e[39]!==n.id?(X=m?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}):p&&t.jsx(U,{variant:"outline",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:i!==null,onClick:k=>{k.stopPropagation(),P()},children:i===n.id?t.jsx(ce,{size:14,className:"animate-spin"}):"Connect"}),e[35]=p,e[36]=i,e[37]=P,e[38]=m,e[39]=n.id,e[40]=X):X=e[40];let c;e[41]!==H||e[42]!==X?(c=t.jsxs("div",{className:"flex items-center gap-2",children:[H,X]}),e[41]=H,e[42]=X,e[43]=c):c=e[43];let S;e[44]!==w||e[45]!==c||e[46]!==T?(S=t.jsx(Ce,{connection:T,fallbackIcon:G,onClick:w,headerActionsAlwaysVisible:!0,headerActions:c}),e[44]=w,e[45]=c,e[46]=T,e[47]=S):S=e[47];let V;e[48]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsxs(Te,{children:[t.jsx(Ae,{children:"Community MCP Server"}),t.jsx(we,{children:"This MCP server is from the Community MCP Registry and is not maintained or verified by Deco. Community servers may have varying levels of quality, security, and reliability. Proceed with caution and review the server details before connecting."})]}),e[48]=V):V=e[48];let R;e[49]===Symbol.for("react.memo_cache_sentinel")?(R=t.jsx(Ie,{children:"Cancel"}),e[49]=R):R=e[49];let B;e[50]!==C?(B=t.jsxs(Le,{children:[V,t.jsxs(Pe,{children:[R,t.jsx($e,{onClick:C,children:"Continue"})]})]}),e[50]=C,e[51]=B):B=e[51];let u;e[52]!==j||e[53]!==B?(u=t.jsx(Oe,{open:j,onOpenChange:y,children:B}),e[52]=j,e[53]=B,e[54]=u):u=e[54];let $;return e[55]!==S||e[56]!==u?($=t.jsxs(t.Fragment,{children:[S,u]}),e[55]=S,e[56]=u,e[57]=$):$=e[57],$}function on({listState:f,activeTab:e,typeFilter:n,statusFilter:p,registryFilter:l,enabledRegistries:o}){const{org:i}=be(),g=it(),h=_e(),{data:j}=Ne.useSession(),y=We(),N=Lt(f),b=ft(),{granted:a}=ye("connections:manage"),{granted:x}=ye("agents:manage"),[m,v]=E.useState(new Set),_=m.size>0,[D,L]=E.useState(!1),[O,s]=E.useState(!1),[A,F]=E.useState(null),M=Ot(),w=N.filter(r=>!(n!=="ALL"&&r.connection_type!==n||p!=="ALL"&&r.status!==p)),P=ht(w),z=r=>{v(d=>{const K=new Set(d);return K.has(r)?K.delete(r):K.add(r),K})},C=()=>{v(new Set)},T=ke(o,f.searchTerm),G=T.items,H=yt(T.loadMore,T.hasMore,T.isLoadingMore),X=new Set(N.filter(r=>r.app_name).map(r=>r.app_name)),c=l==="ALL"||o.some(r=>r.id===l)?l:"ALL",S=f.search.length>0,V=e==="all"||S?G.filter(r=>{if(c!=="ALL"&&r._registryId!==c)return!1;if(S){const d=De(r);if(d&&X.has(d))return!1}return!0}):[],R=e==="connected"||S?P:[],B=async r=>{if(!(!i||!j?.user?.id)){te("connection_add_clicked",{action:"connect_new",registry_item_id:r.id,source:"connections_page"}),F(r.id);try{const d=ct(r,i.id,j.user.id,{remoteIndex:0}),K=d.connection_type==="STDIO",I=!!d.connection_url,q=K&&d.connection_headers&&typeof d.connection_headers=="object"&&"command"in d.connection_headers;if(!I&&!q){W.error("This MCP Server cannot be connected: no connection method available"),F(null);return}const{id:ne}=await y.create.mutateAsync(d),le=await Wt({connectionId:ne,orgId:i.id,orgSlug:i.slug,persistFallback:fe=>y.update.mutateAsync({id:ne,data:{connection_token:fe}}).then(()=>{})});if(le.ran&&!le.ok){te("connection_oauth_failed",{connection_id:ne,flow:"connections_page_connect",error:le.error??"no_token"}),W.error(`Authentication failed: ${le.error??"no token received"}`);return}if(le.ran){te("connection_oauth_succeeded",{connection_id:ne,flow:"connections_page_connect"});const fe=new URL(`/api/${i.slug}/mcp/${ne}`,window.location.origin);await g.invalidateQueries({queryKey:rt.isMCPAuthenticated(fe.href,null)}),$(),W.success("Authentication successful")}W.success("Connected successfully")}catch(d){W.error(`Failed to connect: ${d instanceof Error?d.message:String(d)}`)}finally{F(null)}}},u=Ft(),$=()=>{g.invalidateQueries({predicate:r=>{const d=r.queryKey;return d[1]===i.id&&d[3]==="collection"&&d[4]==="CONNECTIONS"}})},k=async()=>{L(!1);const r=[...m];te("connections_bulk_delete",{count:r.length});let d=0;for(const K of r)try{await u.call("COLLECTION_CONNECTIONS_DELETE",{id:K,force:!0}),d++}catch{}$(),W.success(`Deleted ${d} connection${d!==1?"s":""}`),C()},se=async(r,d)=>{try{await y.update.mutateAsync({id:r,data:{status:d}}),$(),W.success(d==="active"?"Connection enabled":"Connection disabled")}catch{W.error("Failed to update connection")}},xe=async r=>{const d=[...m];te("connections_bulk_status_toggled",{count:d.length,to_status:r});let K=0;for(const I of d)try{await y.update.mutateAsync({id:I,data:{status:r}}),K++}catch{}$(),W.success(`${r==="active"?"Enabled":"Disabled"} ${K} connection${K!==1?"s":""}`),C()},me=async r=>{const d=M.find(q=>q.id===r);if(!d)return;te("connections_bulk_add_to_agent",{agent_id:r,count:m.size});const K=new Set(d.connections.map(q=>q.connection_id)),I=[...m].filter(q=>!K.has(q)).map(q=>({connection_id:q,selected_tools:null,selected_resources:null,selected_prompts:null}));if(I.length===0){W.info("All selected connections are already in that agent");return}try{await u.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:r,data:{connections:[...d.connections,...I]}}),g.invalidateQueries({predicate:q=>{const ne=q.queryKey;return ne[1]===i.id&&ne[3]==="collection"&&ne[4]==="VIRTUAL_MCP"}}),W.success(`Added ${I.length} connection${I.length!==1?"s":""} to "${d.title}"`),C()}catch{W.error("Failed to add connections to agent")}};return t.jsxs(t.Fragment,{children:[t.jsx(jt,{...b}),t.jsx(tn,{open:D,onOpenChange:L,count:m.size,onConfirm:k}),t.jsx(en,{open:O,onOpenChange:s,agents:M,onConfirm:me}),T.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ce,{size:32,className:"animate-spin text-muted-foreground"})}):t.jsx("div",{children:(S?V.length===0&&w.length===0:e==="all"?V.length===0:w.length===0)?t.jsx(gt,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:"No Connections found",description:f.search?`No Connections match "${f.search}"`:a?"Create a connection to get started.":"Ask an organization admin to add one."}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[R.map(r=>{if(r.type==="group")return t.jsx(Qt,{group:r,onOpen:()=>{h({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:r.key}})},selectionMode:_,selectedIds:m,onToggleSelect:z},r.key);const d=r.connection,K=m.has(d.id);return t.jsx(Ce,{connection:d,fallbackIcon:t.jsx(ge,{}),onClick:()=>_?z(d.id):h({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:he(d)}}),className:de(K&&"ring-2 ring-primary bg-primary/5"),headerActionsAlwaysVisible:!0,headerActions:t.jsxs("div",{className:"flex items-center gap-1",children:[_?t.jsx(Fe,{checked:K,onCheckedChange:()=>z(d.id),onClick:I=>I.stopPropagation()}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}),t.jsx("div",{className:de("overflow-hidden transition-all duration-150 ease-out",_?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100"),children:t.jsxs(Ue,{children:[t.jsx(Re,{asChild:!0,children:t.jsx(U,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:I=>I.stopPropagation(),children:t.jsx(Xe,{size:20})})}),t.jsxs(He,{align:"end",onClick:I=>I.stopPropagation(),children:[t.jsxs(re,{onClick:I=>{I.stopPropagation(),h({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:he(d)}})},children:[t.jsx(qe,{size:16}),"Open"]}),(a||x)&&t.jsxs(re,{onClick:I=>{I.stopPropagation(),z(d.id)},children:[t.jsx(zt,{size:16}),"Select"]}),a&&(d.status==="active"?t.jsxs(re,{onClick:I=>{I.stopPropagation(),se(d.id,"inactive")},children:[t.jsx(Vt,{size:16}),"Disable"]}):t.jsxs(re,{onClick:I=>{I.stopPropagation(),se(d.id,"active")},children:[t.jsx(Et,{size:16}),"Enable"]})),a&&t.jsxs(re,{variant:"destructive",onClick:I=>{I.stopPropagation(),b.requestDelete(d)},children:[t.jsx(Qe,{size:16}),"Delete"]})]})]})})]})},d.id)}),V.map(r=>t.jsx(sn,{item:r,canManage:a,allConnections:N,connectedAppNames:X,connectingItemId:A,onNavigateConnected:d=>h({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:he(d)}}),onConnect:B},`catalog-${r._registryId}:${r.id}`)),(e==="all"||S)&&o.length>0&&t.jsx("div",{ref:H,className:"col-span-full h-4"}),(e==="all"||S)&&T.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(ce,{size:24,className:"animate-spin text-muted-foreground"})})]})}),_&&t.jsx(Zt,{count:m.size,total:w.length,canManage:a,canManageAgents:x,onSelectAll:()=>{v(new Set(w.map(r=>r.id)))},onDeselectAll:()=>v(new Set),onDelete:()=>L(!0),onAddToAgent:()=>s(!0),onToggleStatus:xe,onCancel:C})]})}function rn(){const{org:f}=be(),e=_e(),n=Ze({strict:!1}),{data:p}=Ne.useSession(),{stdioEnabled:l}=et(),o=At(),{granted:i}=ye("connections:manage"),g=Gt({namespace:f.slug,resource:"connections"}),h=We(),[j,y]=tt(nt.connectionsTab(f.slug),c=>n.tab==="all"||n.tab==="connected"?n.tab:c??"all"),[N,b]=E.useState("ALL"),[a,x]=E.useState("ALL"),[m,v]=E.useState("ALL"),_=pt(),L=ke(_,g.searchTerm).items,O=g.search!==g.searchTerm,s=st({resolver:ot(Kt),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),A=s.watch("ui_type"),F=s.watch("connection_url"),M=s.watch("npx_package"),w=pe({uiType:A,connectionUrl:F??"",npxPackage:M??""})??Se({uiType:A,connectionUrl:F??"",registryItems:L}),P=i&&n.action==="create",z=()=>{te("connections_custom_dialog_opened",{source:"connections_page"}),e({to:"/$org/settings/connections",params:{org:f.slug},search:{action:"create"}})},C=()=>{e({to:"/$org/settings/connections",params:{org:f.slug},search:{}})},T=async c=>{let S,V=null,R=null,B=null;c.ui_type==="NPX"?(S="STDIO",V="",B=Rt(c.npx_package||"",c.env_vars||[])):c.ui_type==="STDIO"?(S="STDIO",V="",B=Ht(c.stdio_command||"",c.stdio_args||"",c.stdio_cwd,c.env_vars||[])):(S=c.ui_type,V=c.connection_url||"",R=c.connection_token||null);const u=lt("conn");te("connection_custom_created",{connection_type:S,ui_type:c.ui_type}),await h.create.mutateAsync({id:u,title:c.title,description:c.description||null,connection_type:S,connection_url:V,connection_token:R,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:p?.user?.id||"system",organization_id:f.id,icon:c.icon??null,app_name:null,app_id:null,connection_headers:B,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),C(),s.reset(),e({to:"/$org/settings/connections/$appSlug",params:{org:f.slug,appSlug:he({app_name:null,connection_url:V,title:c.title,id:u})}})},G=c=>{c||(P&&C(),s.reset())},H=c=>{const S=c.trim();if(!S)return;const V=!!s.formState.dirtyFields.title,R=!!s.formState.dirtyFields.description,B=!!s.formState.dirtyFields.env_vars,u=k=>{if(k&&(!V&&!s.getValues("title").trim()&&k.title&&s.setValue("title",k.title,{shouldDirty:!1}),!R&&!(s.getValues("description")??"").trim()&&k.description&&s.setValue("description",k.description,{shouldDirty:!1}),!B&&k.envVarKeys?.length)){const se=s.getValues("env_vars")??[],xe=new Set(se.map(r=>r.key)),me=k.envVarKeys.filter(r=>!xe.has(r));me.length>0&&s.setValue("env_vars",[...se,...me.map(r=>({key:r,value:""}))],{shouldDirty:!0})}},$=Ut(S);if($&&l){s.setValue("ui_type","NPX",{shouldDirty:!0}),s.setValue("npx_package",$.packageName,{shouldDirty:!0}),s.setValue("connection_url","",{shouldDirty:!0}),s.setValue("connection_token",null,{shouldDirty:!0}),u(pe({uiType:"NPX",npxPackage:$.packageName}));return}if(S.startsWith("http://")||S.startsWith("https://")){const k=A==="HTTP"||A==="SSE"||A==="Websocket"?A:"HTTP";s.setValue("ui_type",k,{shouldDirty:!0}),s.setValue("connection_url",S,{shouldDirty:!0}),u(pe({uiType:k,connectionUrl:S})??Se({uiType:k,connectionUrl:S,registryItems:L}));return}A==="NPX"&&u(pe({uiType:"NPX",npxPackage:S}))},X=i?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(U,{variant:"outline",onClick:z,children:[t.jsx(Ge,{size:14,className:"sm:hidden"}),t.jsx("span",{className:"hidden sm:inline",children:"Custom Connection"})]})}):null;return t.jsx(t.Fragment,{children:t.jsxs(ue,{children:[(()=>{const c="Create Connection",S="Create a custom connection in your organization. Fill in the details below.",V=s.formState.isSubmitting?"Saving...":"Create Connection",R=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(Q,{control:s.control,name:"ui_type",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Type *"}),t.jsxs(wt,{value:u.value,onValueChange:u.onChange,children:[t.jsx(Z,{children:t.jsx(Tt,{children:t.jsx(It,{})})}),t.jsxs(Pt,{children:[t.jsx(ae,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(je,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(ae,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(je,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(ae,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(je,{className:"w-4 h-4"}),"Websocket"]})}),l&&t.jsxs(t.Fragment,{children:[t.jsx(ae,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ge,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(ae,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Mt,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(ee,{})]})}),A==="NPX"&&t.jsx(Q,{control:s.control,name:"npx_package",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:"NPM Package *"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"@perplexity-ai/mcp-server",...u,value:u.value??"",onPaste:$=>{const k=$.clipboardData.getData("text");k&&($.preventDefault(),s.setValue("npx_package",k.trim(),{shouldDirty:!0}),H(k))},onBlur:$=>{H($.target.value),u.onBlur()}})}),t.jsx(ee,{})]})}),A==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(Q,{control:s.control,name:"stdio_command",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Command *"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"node, bun, python...",...u,value:u.value??""})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:s.control,name:"stdio_args",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Arguments"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"arg1 arg2 --flag value",...u,value:u.value??""})}),t.jsx(ee,{})]})})]}),t.jsx(Q,{control:s.control,name:"stdio_cwd",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Working Directory"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"/path/to/project (optional)",...u,value:u.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),t.jsx(ee,{})]})})]}),(A==="NPX"||A==="STDIO")&&t.jsx(Q,{control:s.control,name:"env_vars",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Environment Variables"}),t.jsx(Z,{children:t.jsx(Bt,{value:u.value??[],onChange:u.onChange})}),t.jsx(ee,{})]})}),A!=="NPX"&&A!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(Q,{control:s.control,name:"connection_url",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:"URL *"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"https://example.com/mcp",...u,value:u.value??"",onPaste:$=>{const k=$.clipboardData.getData("text");k&&($.preventDefault(),s.setValue("connection_url",k.trim(),{shouldDirty:!0}),H(k))},onBlur:$=>{H($.target.value),u.onBlur()}})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:s.control,name:"connection_token",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:w?.token?.label??"Token (optional)"}),t.jsx(Z,{children:t.jsx(ie,{type:"password",placeholder:w?.token?.placeholder??"Bearer token or API key",...u,value:u.value??""})}),w?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[w.token.helperText,w.id==="github"&&t.jsxs(t.Fragment,{children:[" ","·"," ",t.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:"Open GitHub PAT settings"})]})]}),t.jsx(ee,{})]})})]}),t.jsx(Q,{control:s.control,name:"title",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Name *"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"My Connection",...u})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:s.control,name:"description",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Description"}),t.jsx(Z,{children:t.jsx($t,{placeholder:"A brief description of this connection",rows:3,...u,value:u.value??""})}),t.jsx(ee,{})]})})]}),B=P;return o?t.jsx(vt,{open:B,onOpenChange:G,children:t.jsxs(St,{className:"max-h-[90vh]",children:[t.jsx(bt,{className:"pb-2",children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"flex-1 text-left",children:[t.jsx(_t,{children:c}),t.jsx(Nt,{className:"mt-1",children:S})]}),t.jsx(Dt,{asChild:!0,children:t.jsx(U,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:t.jsx(Je,{size:16})})})]})}),t.jsx(ve,{...s,children:t.jsxs("form",{onSubmit:s.handleSubmit(T),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:R}),t.jsx(kt,{children:t.jsx(U,{type:"submit",disabled:s.formState.isSubmitting,className:"w-full",children:V})})]})})]})}):t.jsx(Me,{open:B,onOpenChange:G,children:t.jsxs(ze,{className:"sm:max-w-[525px]",children:[t.jsxs(Ve,{children:[t.jsx(Ee,{children:c}),t.jsx(Be,{children:S})]}),t.jsx(ve,{...s,children:t.jsxs("form",{onSubmit:s.handleSubmit(T),children:[t.jsx("div",{className:"py-4",children:R}),t.jsxs(Ke,{children:[t.jsx(U,{type:"button",variant:"outline",onClick:()=>G(!1),children:"Cancel"}),t.jsx(U,{type:"submit",disabled:s.formState.isSubmitting,className:"min-w-40",children:V})]})]})})]})})})(),t.jsx(ue.Content,{children:t.jsx(ue.Body,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(ue.Title,{children:"Connections"}),t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(mt,{value:g.search,onChange:g.setSearch,placeholder:"Search for a connection",className:"w-full md:w-[375px]",onKeyDown:c=>{c.key==="Escape"&&(g.setSearch(""),c.target.blur())}}),t.jsx(dt,{sortKey:g.sortKey,sortDirection:g.sortDirection,onSort:g.handleSort,sortOptions:[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"connection_type",label:"Type"},{id:"updated_by",label:"Updated by"},{id:"updated_at",label:"Updated"}],filters:[{label:"Type",value:N,onChange:c=>b(c||"ALL"),options:[{id:"ALL",label:"All"},{id:"HTTP",label:"HTTP"},{id:"SSE",label:"SSE"},{id:"Websocket",label:"WebSocket"},{id:"STDIO",label:"STDIO"}]},{label:"Status",value:a,onChange:c=>x(c||"ALL"),options:[{id:"ALL",label:"All"},{id:"active",label:"Active"},{id:"inactive",label:"Inactive"},{id:"error",label:"Error"}]},..._.length>1?[{label:"Registry",value:m,onChange:c=>v(c||"ALL"),options:[{id:"ALL",label:"All registries"},..._.map(c=>({id:c.id,label:c.id.includes("community-registry")?"Community MCP Registry":c.title}))]}]:[]]})]}),X]}),t.jsx(ut,{tabs:[{id:"all",label:"All"},{id:"connected",label:"Connected"}],activeTab:j,onTabChange:c=>{const S=c;S!==j&&te("connections_page_tab_changed",{to_tab:S}),y(S)}}),t.jsx(E.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ce,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:O?.5:1,transition:O?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:O?"none":"auto"},children:t.jsx(on,{listState:g,activeTab:j,typeFilter:N,statusFilter:a,registryFilter:m,enabledRegistries:_})})})]})})})]})})}function Fs(){const f=oe.c(1);let e;return f[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ye,{children:t.jsx(E.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ce,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(rn,{})})}),f[0]=e):e=f[0],e}export{Fs as default};
@@ -1,2 +0,0 @@
1
- import{c as Ke,r as l,j as i,i as re,B as fe,l as Ve,m as ut,t as $,K as Te}from"./index-D10xo2Wm.js";import{F as mt,l as pt}from"./index-CnMpta5V.js";import{e as ht,at as xt,au as gt,av as ae,aw as yt,U as $e}from"./agent-icon-C9Jofb-u.js";import{a as wt}from"./Tool01-Cnycw8Ef.js";import{s as jt}from"./XClose-DVjO_TNn.js";import{S as bt}from"./scroll-area-C5IE_o87.js";import{b as Oe,T as Re,a as ze}from"./tooltip-VrGyigcV.js";import{f as vt,a as Ct,b as Nt,c as St,d as Dt,e as kt,A as Ft,g as Lt}from"./alert-dialog-DBza5R0g.js";import{u as Et}from"./chat-context-BUGEnk3o.js";import{b as Pt}from"./shell-layout-Cwicrerl.js";import{al as le,am as Ae,an as Tt}from"./index-CYxs6fVn.js";import{a as $t,b as Ot,D as Rt,e as zt,c as At,d as Wt}from"./dialog-C6Huna5L.js";import{I as We}from"./input-D3Hn-5fP.js";import{b as It,C as _,a as Ie,c as Mt,d as Kt}from"./context-menu-BcYjb5Fc.js";import{t as Vt}from"./ChevronDown-BZMxGINT.js";import{i as Bt}from"./ChevronRight-DW1FHwl9.js";import{a as Gt}from"./ZoomOut-KuF6xRRI.js";import{E as qt,z as Me,A as he,B as Qt,C as Ut,D as Jt,G as M,I as ce,g as xe,J as ge,K as Ht,M as Xt,N as ye,O as de,P as we,Q as Yt,U as Zt}from"./preview-dialog-DUP6mqXn.js";import"./AlertCircle-DKDv1c5a.js";import"./SwitchHorizontal01-DzDSRTn8.js";import"./Settings02-BOrHnhSy.js";import"./XCircle-Et4HA60-.js";import"./ArrowUpRight-CL_ND2fd.js";import"./ZapSquare-CvpHTkF6.js";import"./Users03-Hhn2gOWC.js";import"./CheckCircle-Cf7Vfzh1.js";import"./ChevronUp-DK-p-OwS.js";import"./ChevronLeft-DdoGlJfU.js";import"./DotsVertical-Dj0bH-G-.js";import"./Stars02-Ceo2qvgP.js";import"./Eye-C1cT97Dr.js";import"./Globe01-MmdfsJuj.js";import"./FilterLines-BbZdzGgI.js";import"./Star01-DNV8Ma9Q.js";import"./Globe04-C1xLhm_u.js";import"./HardDrive-CTxqPq4g.js";import"./Key01-D_aQKwoU.js";import"./LayoutLeft-DGVVcFUt.js";import"./LinkExternal01-CjjlbDYr.js";import"./Monitor01-Bdmau1Kt.js";import"./Sun-8teVrEhL.js";import"./Palette-B2UGmW-_.js";import"./Play-BMlmnmbt.js";import"./Plus-Dw7ZaPZJ.js";import"./SearchMd-B7uVTp5E.js";import"./Shield01-DoXHEBfW.js";import"./Stars01-DkrXqc8-.js";import"./Trash01-4tPF0VaH.js";import"./Upload01-CmdzZ7sb.js";import"./User01-DG6-o1bh.js";import"./Users01-Cjr16PQI.js";import"./X-Dothba_A.js";import"./Zap-CxpukXGS.js";import"./use-clock-tick-6K15zpKz.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-CmqBXSyr.js";import"./file-type-icon-BWw9UmKa.js";import"./tab-id-BptcWVWa.js";import"./content-blocks-o63cs2vh.js";import"./types-DvdTHMVs.js";import"./use-mcp-client-NkS_1XHm.js";import"./auth-2-m6wz4w.js";import"./hooks-DQdOsZp5.js";import"./decopilot-sse-pool-BWdhrrzW.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./studio-tools-z5PzgEZo.js";import"./sheet-Cz4-_oqg.js";import"./integration-icon-D_K0I1bc.js";import"./use-virtual-mcp-Cd0H2SUN.js";import"./use-collections-DVArJb6w.js";import"./use-navigate-to-agent-DNVrD-VA.js";import"./use-connection-X4N-9XqT.js";import"./use-mcp-prompts-7I02SPnr.js";import"./form-C0qrZ_x_.js";import"./label-BaI9WHK8.js";import"./select-mHWPzm7G.js";import"./use-ai-providers-exBfYy9L.js";import"./use-organization-settings-DCsUye9Y.js";import"./avatar-IZb76xF5.js";import"./required-auth-layout-C-olAxiD.js";import"./use-org-sso-B_sMXWs_.js";import"./index-CpFSes0G.js";import"./drawer-DSl868BV.js";import"./collection-search-CFs0gBmh.js";import"./tabs-EKQE067O.js";import"./toggle-group-CvHp9qT6.js";import"./sortable.esm-BROfP1EO.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-BBo-mCQ3.js";import"./use-registry-connections--RtvB6B0.js";import"./useInfiniteQuery-DrFl9S4A.js";import"./use-infinite-scroll-nYPek78V.js";import"./extract-connection-data-CxsQnV0o.js";import"./card-CYcWxwTq.js";import"./collection-tabs-D6hMQ7Uk.js";import"./badge-DFWqydWM.js";import"./textarea-CVcNewnq.js";import"./connection-form-helpers-BkiVmzh-.js";import"./authenticate-and-persist-oauth-jYJBnNn_.js";import"./mcp-oauth-Ca5pqK3O.js";import"./useSuspenseInfiniteQuery-Cbf8ULb8.js";import"./connect-desktop-dialog-BQ2QKxzW.js";import"./decopilot-C6k4C-5x.js";import"./checkbox-D6DN5wX2.js";import"./skeleton-DAm19Q1Q.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-Coavx4GZ.js";import"./popover-C5gLQmVJ.js";import"./command-DWtuH3XL.js";import"./index-DV9_3Xnk.js";import"./dropdown-menu-DZcXfAzz.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-CynODP2T.js";import"./empty-state-CiKyH8Zu.js";import"./toolbar-KNQEPZYT.js";import"./use-mcp-tools-Cf3odfCU.js";import"./use-capability-DfeHNCP3.js";import"./shell-route-loading-nz7JKsGk.js";import"./index-COzOrUXj.js";import"./switch-CNShaHWc.js";import"./use-debounced-autosave-qbwQlmr6.js";import"./index-4sp0XNgi.js";import"./sidebar-DUFS7nKD.js";import"./search-input-DwJIqEE6.js";import"./github-repo-picker-D1khnJFy.js";import"./use-secrets-9BtDHXYX.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./view-mode-toggle-CUjiraWr.js";import"./automation-runs-Df9J1bXw.js";import"./table-BybNndQa.js";import"./use-members-D-sIksyD.js";import"./use-org-auth-client-DoX-hmrG.js";import"./task-status-DjWhdyec.js";import"./use-automations-SvpwcTEI.js";import"./use-file-configs-D1wVoLUY.js";import"./monaco-editor-C1JQgPRk.js";import"./select-model-Rd3CwALX.js";import"./automation-list-row-RLnrAaQk.js";const _t={"new-file":{title:"New File",description:"Enter a name for the new file.",submit:"Create",placeholder:"filename.ts"},"new-folder":{title:"New Folder",description:"Enter a name for the new folder.",submit:"Create",placeholder:"folder-name"},rename:{title:"Rename",description:"Enter a new name for this item.",submit:"Rename",placeholder:"new-name"}};function en(y){const e=Ke.c(51),{open:c,mode:K,initialName:X,parentLabel:Q,isPending:A,onSubmit:V,onOpenChange:P}=y,W=X===void 0?"":X,o=A===void 0?!1:A,[p,O]=l.useState(W),[I,B]=l.useState(c),f=_t[K];c!==I&&(B(c),c&&O(W));let F;e[0]!==o||e[1]!==P?(F=E=>{!E&&!o&&P(!1)},e[0]=o,e[1]=P,e[2]=F):F=e[2];const U=F;let G;e[3]!==o||e[4]!==p||e[5]!==V?(G=async E=>{E.preventDefault();const z=p.trim();!z||o||await V(z)},e[3]=o,e[4]=p,e[5]=V,e[6]=G):G=e[6];const q=G;let L;e[7]!==f.title?(L=i.jsx($t,{children:f.title}),e[7]=f.title,e[8]=L):L=e[8];let N;e[9]!==f.description?(N=i.jsx(Ot,{children:f.description}),e[9]=f.description,e[10]=N):N=e[10];let R;e[11]!==L||e[12]!==N?(R=i.jsxs(Rt,{children:[L,N]}),e[11]=L,e[12]=N,e[13]=R):R=e[13];let S;e[14]!==Q?(S=Q&&i.jsxs("div",{className:"space-y-1.5",children:[i.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Location"}),i.jsx(We,{value:Q,readOnly:!0,disabled:!0,className:"font-mono text-xs"})]}),e[14]=Q,e[15]=S):S=e[15];let D;e[16]===Symbol.for("react.memo_cache_sentinel")?(D=i.jsx("label",{htmlFor:"file-explorer-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[16]=D):D=e[16];let j;e[17]===Symbol.for("react.memo_cache_sentinel")?(j=E=>O(E.target.value),e[17]=j):j=e[17];let b;e[18]!==f.placeholder||e[19]!==o||e[20]!==p?(b=i.jsxs("div",{className:"space-y-1.5",children:[D,i.jsx(We,{id:"file-explorer-name",value:p,onChange:j,placeholder:f.placeholder,autoFocus:!0,disabled:o})]}),e[18]=f.placeholder,e[19]=o,e[20]=p,e[21]=b):b=e[21];let h;e[22]!==b||e[23]!==S?(h=i.jsxs("div",{className:"space-y-4 py-4",children:[S,b]}),e[22]=b,e[23]=S,e[24]=h):h=e[24];let x;e[25]!==P?(x=()=>P(!1),e[25]=P,e[26]=x):x=e[26];let v;e[27]!==o||e[28]!==x?(v=i.jsx(fe,{type:"button",variant:"outline",onClick:x,disabled:o,children:"Cancel"}),e[27]=o,e[28]=x,e[29]=v):v=e[29];let C;e[30]!==o||e[31]!==p?(C=!p.trim()||o,e[30]=o,e[31]=p,e[32]=C):C=e[32];let u;e[33]!==f.submit||e[34]!==o?(u=o?i.jsxs(i.Fragment,{children:[i.jsx(re,{size:14,className:"animate-spin"}),"Saving…"]}):f.submit,e[33]=f.submit,e[34]=o,e[35]=u):u=e[35];let k;e[36]!==C||e[37]!==u?(k=i.jsx(fe,{type:"submit",disabled:C,children:u}),e[36]=C,e[37]=u,e[38]=k):k=e[38];let m;e[39]!==v||e[40]!==k?(m=i.jsxs(zt,{children:[v,k]}),e[39]=v,e[40]=k,e[41]=m):m=e[41];let g;e[42]!==q||e[43]!==h||e[44]!==m||e[45]!==R?(g=i.jsx(At,{className:"sm:max-w-md",children:i.jsxs("form",{onSubmit:q,children:[R,h,m]})}),e[42]=q,e[43]=h,e[44]=m,e[45]=R,e[46]=g):g=e[46];let T;return e[47]!==U||e[48]!==c||e[49]!==g?(T=i.jsx(Wt,{open:c,onOpenChange:U,children:g}),e[47]=U,e[48]=c,e[49]=g,e[50]=T):T=e[50],T}const tn="#d9a441";function nn(y){const e=Ke.c(45),{node:c,depth:K,isExpanded:X,isSelected:Q,isLoading:A,fileVisual:V,onOpen:P,onSelect:W,onNewFile:o,onNewFolder:p,onCopyPath:O,onCopyRelativePath:I,onRename:B,onDelete:f}=y,F=A===void 0?!1:A,U=c.kind==="directory",{Icon:G,color:q}=V,L=Q&&"bg-accent";let N;e[0]!==L?(N=Ve("flex w-full items-center gap-1.5 px-2 py-1.5 text-left text-[13px] hover:bg-accent transition-colors",L),e[0]=L,e[1]=N):N=e[1];const R=`${K*14+8}px`;let S;e[2]!==R?(S={paddingLeft:R},e[2]=R,e[3]=S):S=e[3];let D;e[4]!==P||e[5]!==W?(D=()=>{W(),P()},e[4]=P,e[5]=W,e[6]=D):D=e[6];let j;e[7]!==G||e[8]!==q||e[9]!==U||e[10]!==X||e[11]!==F?(j=U?i.jsxs(i.Fragment,{children:[F?i.jsx(re,{size:14,className:"shrink-0 animate-spin text-muted-foreground"}):X?i.jsx(Vt,{size:14,className:"shrink-0 text-muted-foreground"}):i.jsx(Bt,{size:14,className:"shrink-0 text-muted-foreground"}),i.jsx(Gt,{size:16,className:"shrink-0",style:{color:tn}})]}):i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"w-3.5 shrink-0"}),i.jsx(G,{size:16,className:"shrink-0",style:{color:q}})]}),e[7]=G,e[8]=q,e[9]=U,e[10]=X,e[11]=F,e[12]=j):j=e[12];let b;e[13]!==c.name?(b=i.jsx("span",{className:"truncate",children:c.name}),e[13]=c.name,e[14]=b):b=e[14];let h;e[15]!==N||e[16]!==S||e[17]!==D||e[18]!==j||e[19]!==b?(h=i.jsx(It,{asChild:!0,children:i.jsxs("button",{type:"button",className:N,style:S,onClick:D,children:[j,b]})}),e[15]=N,e[16]=S,e[17]=D,e[18]=j,e[19]=b,e[20]=h):h=e[20];let x;e[21]!==o?(x=i.jsx(_,{onSelect:o,children:"New File"}),e[21]=o,e[22]=x):x=e[22];let v;e[23]!==p?(v=i.jsx(_,{onSelect:p,children:"New Folder"}),e[23]=p,e[24]=v):v=e[24];let C;e[25]===Symbol.for("react.memo_cache_sentinel")?(C=i.jsx(Ie,{}),e[25]=C):C=e[25];let u;e[26]!==O?(u=i.jsx(_,{onSelect:O,children:"Copy Path"}),e[26]=O,e[27]=u):u=e[27];let k;e[28]!==I?(k=i.jsx(_,{onSelect:I,children:"Copy Relative Path"}),e[28]=I,e[29]=k):k=e[29];let m;e[30]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(Ie,{}),e[30]=m):m=e[30];let g;e[31]!==B?(g=i.jsx(_,{onSelect:B,children:"Rename"}),e[31]=B,e[32]=g):g=e[32];let T;e[33]!==f?(T=i.jsx(_,{variant:"destructive",onSelect:f,children:"Delete"}),e[33]=f,e[34]=T):T=e[34];let E;e[35]!==x||e[36]!==v||e[37]!==u||e[38]!==k||e[39]!==g||e[40]!==T?(E=i.jsxs(Mt,{className:"w-52",children:[x,v,C,u,k,m,g,T]}),e[35]=x,e[36]=v,e[37]=u,e[38]=k,e[39]=g,e[40]=T,e[41]=E):E=e[41];let z;return e[42]!==E||e[43]!==h?(z=i.jsxs(Kt,{children:[h,E]}),e[42]=E,e[43]=h,e[44]=z):z=e[44],z}pt.config({paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.0/min/vs"}});function je(y,e,c,K){return`/api/${y}/sandbox/${encodeURIComponent(e)}/${encodeURIComponent(c)}/${K}`}function rn(y){const e=M(y);return!e||e.includes("..")||e.includes("\\")?!1:e.startsWith(".deco/blocks/")||!e.startsWith("/")&&!e.includes("://")}const sn="#94a3b8";function on(y){const e=y.toLowerCase();return e.endsWith(".tsx")||e.endsWith(".ts")?{Icon:ae,color:"#3b82f6"}:e.endsWith(".jsx")||e.endsWith(".js")||e.endsWith(".mjs")||e.endsWith(".cjs")?{Icon:ae,color:"#d9a441"}:e.endsWith(".json")?{Icon:yt,color:"#cb9b3f"}:e.endsWith(".css")||e.endsWith(".scss")?{Icon:ae,color:"#06b6d4"}:e.endsWith(".html")||e.endsWith(".xml")?{Icon:ae,color:"#f97316"}:/\.(png|jpe?g|gif|webp|avif|ico|svg)$/.test(e)?{Icon:wt,color:"#a855f7"}:e.endsWith(".md")||e.endsWith(".mdx")?{Icon:$e,color:"#64748b"}:{Icon:$e,color:sn}}function Wi({orgSlug:y,virtualMcpId:e,branch:c,openPath:K}){const[X,Q]=l.useState({files:[],directories:[],truncated:!1}),{files:A,directories:V}=X,[P,W]=l.useState(new Set),[o,p]=l.useState(null),[O,I]=l.useState(null),[B,f]=l.useState([]),[F,U]=l.useState(""),[G,q]=l.useState(!1),[L,N]=l.useState(!1),[,R]=l.useState(new Set),[S,D]=l.useState(new Set),j=l.useRef(0),b=l.useRef(null),h=l.useRef(new Set),x=l.useRef(new Map);function v(t){R(n=>{const r=typeof t=="function"?t(n):t;return h.current=r,r})}const[C,u]=l.useState(new Map),k=l.useRef(null),[m,g]=l.useState(null),{sendMessage:T}=Et(),{setChatOpen:E}=Pt(),z=ut(),[w,J]=l.useState(null),[H,ue]=l.useState(null),[ee,ie]=l.useState(!1);async function te(t,n){const r=await fetch(je(y,e,c,t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(n)});if(!r.ok){const s=await r.json().catch(()=>({}));throw new Error(s.error??`Request failed (${r.status})`)}return r.json()}async function se(){z.invalidateQueries({queryKey:Ae(y,e,c)})}function be(t,n){navigator.clipboard.writeText(n).then(()=>$.success(`${t} copied`),()=>$.error(`Failed to copy ${t.toLowerCase()}`))}function Be(t){const n=Yt(t);if(!n)return;const r=`${y}/${e}/${c}`;z.setQueryData(Te.decofile(r),s=>{if(!s)return s;const{[n]:a,...d}=s;return d}),z.invalidateQueries({queryKey:Te.liveMeta(r)})}function Ge(t){const n=t.kind==="file"?[t.path]:A.filter(r=>r.startsWith(".deco/blocks/")).map(r=>ce(r)).filter(r=>r===t.path||r.startsWith(`${t.path}/`));for(const r of n)Be(r)}function qe(t){const n=ce(t);return B.filter(r=>{if(r!==n&&!r.startsWith(`${n}/`))return!1;const s=C.get(r);return!!(s?.loaded&&s.editorValue!==s.savedContent)})}function ve(t){f(n=>n.map(r=>t(r)).filter(r=>r!==null)),p(n=>n&&t(n)),u(n=>{const r=new Map;for(const[s,a]of n){const d=t(s);d&&r.set(d,a)}return r}),I(n=>{if(!n)return n;const r=t(n.path);return r?r===n.path?n:{...n,path:r,name:r.split("/").pop()??r}:null})}function Qe(t){const n=ce(t);I(r=>r&&(r.path===n||r.path.startsWith(`${n}/`)?null:r)),ve(r=>r===n||r.startsWith(`${n}/`)?null:r)}async function Ue(t){if(!w)return;const n=de(w.parentDir,t);if(we(n,A,V))throw new Error(`"${t}" already exists`);await te("write",{path:M(n),content:""}),await ne(),await se(),J(null),me(n)}async function Je(t){if(!w)return;const n=de(w.parentDir,t);if(we(n,A,V))throw new Error(`"${t}" already exists`);const r=M(n);await te("mkdir",{path:r}),Q(s=>({...s,directories:s.directories.includes(r)?s.directories:[...s.directories,r]})),await ne(),await se(),J(null),W(s=>{const a=new Set(s);for(const d of he(n))a.add(d);return a.add(n),a}),I({name:t,path:n,kind:"directory",children:[]})}async function He(t){if(!w)return;const n=w.node.path,r=ye(n),s=de(r,t);if(s===n){J(null);return}if(we(s,A,V))throw new Error(`"${t}" already exists`);await te("rename",{from:M(n),to:M(s)}),ve(a=>a===n?s:a.startsWith(`${n}/`)?de(s,a.slice(n.length+1)):a),await ne(),await se(),J(null)}async function Xe(t){ie(!0);try{await te("unlink",{path:M(t.path),recursive:t.kind==="directory"}),Ge(t),Qe(t.path),await ne(),await se(),ue(null),$.success(`Deleted "${t.name}"`)}catch(n){$.error(n instanceof Error?n.message:"Delete failed")}finally{ie(!1)}}async function Ye(t){const n=Xt(t);if(n){$.error(n);return}ie(!0);try{w?.mode==="new-file"?(await Ue(t),$.success(`Created "${t}"`)):w?.mode==="new-folder"?(await Je(t),$.success(`Created folder "${t}"`)):w?.mode==="rename"&&(await He(t),$.success(`Renamed to "${t}"`))}catch(r){$.error(r instanceof Error?r.message:"Operation failed")}finally{ie(!1)}}const Ce=l.useRef(!1);Ce.current||(Ce.current=!0,b.current=ne());const[Ze,_e]=l.useState(null);if(K&&K!==Ze){_e(K);const t=K;queueMicrotask(()=>{rn(t)&&me(t).catch(n=>{$.error(n instanceof Error?n.message:"Failed to open file")})})}async function Ne(t){const n=await te("glob",t);return{files:n.files??[],directories:n.directories??[],truncated:n.truncated}}function Se(t,n,r){if(r!==j.current)return!1;let s=!1;return Q(a=>{const d=n?Zt(a.files,a.directories,t,a.truncated):{files:t.files,directories:t.directories??[],truncated:!!t.truncated};return s=!!d.truncated,{files:d.files,directories:d.directories,truncated:s}}),s&&$.warning("File list truncated — some files may be hidden"),s}async function et(t){const n=x.current.get(t);if(n)return n;const r=j.current,s=(async()=>{const a=await Ne({pattern:"**/*",path:M(t),limit:Me}),d=Se(a,!0,r);return!d&&r===j.current&&v(Y=>{const oe=new Set(Y);return oe.add(t),oe}),d})();x.current.set(t,s);try{return await s}finally{x.current.delete(t)}}async function De(t){if(!ge(t,h.current))return!1;D(n=>new Set(n).add(t));try{return await et(t)}finally{D(n=>{const r=new Set(n);return r.delete(t),r})}}async function tt(t){const n=new Set(h.current);for(const r of he(t)){if(!ge(r,n))continue;if(await De(r))throw new Error("Folder listing truncated — expand again to load more");n.add(r)}}async function ne(){const t=++j.current;x.current.clear(),q(!0),v(new Set),W(new Set),D(new Set);try{const n=await Ne({pattern:"**/*",limit:Me,maxDepth:qt});Se(n,!1,t),N(!0)}catch{L&&$.error("Failed to refresh file tree")}finally{q(!1)}}async function ke(t){if(!C.get(t)?.loaded){u(r=>{const s=new Map(r);return s.set(t,{savedContent:"",editorValue:"",loaded:!1}),s});try{const r=await fetch(je(y,e,c,"read"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:M(t),full:!0})});if(!r.ok)return;const s=await r.json(),a=Ht(s.content??"");u(d=>{const Y=new Map(d);return Y.set(t,{savedContent:a,editorValue:a,loaded:!0}),Y})}catch{}}}async function nt(t,n){try{const r=await fetch(je(y,e,c,"write"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:M(t),content:n})});if(!r.ok){le("file save failed",{path:t,status:r.status});return}le("file saved via sandbox /write",{path:t}),z.invalidateQueries({queryKey:Ae(y,e,c)});try{const s=await Tt(y,e,c);le("git status after save",s)}catch(s){le("git status after save failed",{path:t,error:s instanceof Error?s.message:String(s)})}u(s=>{const a=new Map(s),d=a.get(t);return d&&a.set(t,{...d,savedContent:n}),a})}catch{}}function rt(t){p(t),I({name:t.split("/").pop()??t,path:t,kind:"file",children:[]}),g(null),B.includes(t)||f(n=>[...n,t]),ke(t)}function it(t){f(n=>{const r=n.filter(s=>s!==t);return o===t&&p(r[r.length-1]??null),r}),u(n=>{const r=new Map(n);return r.delete(t),r})}function Fe(t){W(n=>{const r=new Set(n);return r.has(t)?r.delete(t):r.add(t),r})}async function st(t){if(ge(t,h.current))try{if(await De(t))return}catch(n){$.error(n instanceof Error?n.message:"Failed to load folder");return}Fe(t)}async function ot(t,n){if(n){Fe(t);return}await st(t)}async function me(t){await b.current,await tt(t);const n=he(t);W(r=>{const s=new Set(r);for(const a of n)s.add(a);return s}),rt(t)}function at(){return O?.kind==="directory"?O.path:O?.kind==="file"?ye(O.path):o?ye(o):"/"}function Le(t){const n=at();J({mode:t,parentDir:n,node:{name:"",path:n,kind:"directory",children:[]}})}const lt=Qt(A,V),Ee=Ut(lt,P),Pe=F?Ee.filter(t=>t.node.name.toLowerCase().includes(F.toLowerCase())):Ee,Z=o?C.get(o):null,ct=Z?.loaded&&Z.editorValue!==Z.savedContent,pe=H?qe(H.path):[],dt=(t,n)=>{k.current=t,t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyS,async()=>{if(!o)return;const r=t.getValue();await nt(o,r)}),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyK,()=>{const r=t.getSelection(),s=t.getModel();if(!r||!s||!o)return;const a=s.getValueInRange(r);g({filePath:o,lineStart:r.startLineNumber,lineEnd:r.endLineNumber,selectedCode:a})})};function ft(t){if(!m)return;const n=[`The user selected code in the file explorer and asked: **"${t.trim()}"**`,"",`**File:** \`${m.filePath}\``,`**Lines:** ${m.lineStart}–${m.lineEnd}`];if(m.selectedCode){const r=xe(m.filePath),s=m.selectedCode.replace(/```/g,"`` `");n.push("","**Selected code:**","```"+r,s,"```")}n.push("","Please read the source file, locate the code, and apply the requested change."),E(!0),T({parts:[{type:"text",text:n.join(`
2
- `)}]}),g(null)}return G&&!L?i.jsx("div",{className:"flex items-center justify-center h-full w-full",children:i.jsx(re,{size:20,className:"animate-spin text-muted-foreground"})}):i.jsxs("div",{className:"flex h-full w-full overflow-hidden",children:[i.jsxs("div",{className:"w-64 shrink-0 border-r flex flex-col overflow-hidden",children:[i.jsxs("div",{className:"flex items-center gap-1 p-2 border-b",children:[i.jsxs("div",{className:"relative min-w-0 flex-1",children:[i.jsx(ht,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground"}),i.jsx("input",{type:"text",value:F,onChange:t=>U(t.target.value),placeholder:"Search files...","aria-label":"Search files",className:"w-full rounded-md border border-input bg-transparent pl-7 pr-2 py-1.5 text-xs outline-none placeholder:text-muted-foreground focus:ring-1 focus:ring-ring"})]}),i.jsxs(Oe,{children:[i.jsx(Re,{asChild:!0,children:i.jsx(fe,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"New file",onClick:()=>Le("new-file"),children:i.jsx(xt,{size:14})})}),i.jsx(ze,{side:"bottom",children:"New file"})]}),i.jsxs(Oe,{children:[i.jsx(Re,{asChild:!0,children:i.jsx(fe,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"New folder",onClick:()=>Le("new-folder"),children:i.jsx(gt,{size:14})})}),i.jsx(ze,{side:"bottom",children:"New folder"})]})]}),i.jsx(bt,{className:"flex-1",children:i.jsxs("div",{className:"py-1",children:[Pe.map(t=>{const{node:n,depth:r}=t,s=n.kind==="directory",a=P.has(n.path),d=O?.path===n.path,Y=Jt(n.path,n.kind),oe=s&&S.has(n.path);return i.jsx(nn,{node:n,depth:r,isExpanded:a,isSelected:d,isLoading:oe,fileVisual:on(n.name),onSelect:()=>I(n),onOpen:()=>{s?ot(n.path,a):me(n.path)},onNewFile:()=>J({mode:"new-file",node:n,parentDir:Y}),onNewFolder:()=>J({mode:"new-folder",node:n,parentDir:Y}),onCopyPath:()=>be("Path",ce(n.path)),onCopyRelativePath:()=>be("Relative path",M(n.path)),onRename:()=>J({mode:"rename",node:n,parentDir:Y}),onDelete:()=>ue(n)},n.path)}),L&&Pe.length===0&&i.jsx("div",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:F?`No files match "${F}"`:"No files found"})]})})]}),i.jsxs("div",{className:"relative flex-1 flex flex-col overflow-hidden",children:[B.length>0&&i.jsx("div",{className:"flex items-center border-b overflow-x-auto shrink-0",children:B.map(t=>{const n=C.get(t),r=n?.loaded&&n.editorValue!==n.savedContent,s=o===t,a=t.split("/").pop()??t;return i.jsxs("div",{className:Ve("flex items-center gap-1 px-3 py-1.5 text-xs border-r cursor-pointer transition-colors",s?"bg-background text-foreground":"bg-muted/50 text-muted-foreground hover:bg-accent"),onClick:()=>{p(t),ke(t)},onKeyDown:()=>{},role:"tab",tabIndex:0,"aria-selected":s,children:[i.jsx("span",{className:"truncate max-w-32",children:a}),r&&i.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-foreground/60 shrink-0"}),i.jsx("button",{type:"button",className:"ml-1 rounded p-0.5 hover:bg-accent-foreground/10",onClick:d=>{d.stopPropagation(),it(t)},children:i.jsx(jt,{size:12})})]},t)})}),m&&i.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 z-20 mt-2",style:{width:"360px"},children:i.jsxs("form",{className:"flex w-full items-center gap-1.5 rounded-xl border border-border bg-background/95 px-3 py-1.5 shadow-lg backdrop-blur",onSubmit:t=>{t.preventDefault();const r=t.currentTarget.elements.namedItem("askAiInput");r.value.trim()&&ft(r.value)},children:[i.jsx("input",{name:"askAiInput",autoFocus:!0,type:"text",placeholder:"Ask the AI...",className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground",onKeyDown:t=>{t.stopPropagation(),t.key==="Escape"&&g(null)}}),i.jsx("button",{type:"submit",className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-foreground text-background transition-opacity",title:"Send",children:i.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[i.jsx("title",{children:"Send"}),i.jsx("path",{d:"M5 9V1M1 5l4-4 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})}),i.jsx("div",{className:"flex-1 overflow-hidden",children:o&&Z?.loaded?i.jsx(mt,{language:xe(o),theme:document.documentElement.classList.contains("dark")?"vs-dark":"light",value:Z.editorValue,path:o,onChange:t=>{const n=o;n&&u(r=>{const s=new Map(r),a=s.get(n);return a&&s.set(n,{...a,editorValue:t??""}),s})},onMount:dt,loading:i.jsx("div",{className:"flex items-center justify-center h-full w-full",children:i.jsx(re,{size:20,className:"animate-spin text-muted-foreground"})}),options:{fontSize:13,scrollBeyondLastLine:!1,automaticLayout:!0,lineNumbersMinChars:2,wordWrap:"on",minimap:{enabled:!1},padding:{top:12,bottom:12},scrollbar:{vertical:"auto",horizontal:"auto",verticalScrollbarSize:8,horizontalScrollbarSize:8}}},o):o&&!Z?.loaded?i.jsx("div",{className:"flex items-center justify-center h-full w-full",children:i.jsx(re,{size:20,className:"animate-spin text-muted-foreground"})}):i.jsx("div",{className:"flex items-center justify-center h-full w-full text-sm text-muted-foreground",children:"Select a file to edit"})}),o&&i.jsxs("div",{className:"flex items-center justify-between px-3 py-1 border-t text-[11px] text-muted-foreground shrink-0",children:[i.jsx("span",{className:"truncate",children:o}),i.jsxs("span",{children:[ct?"Modified":"Saved"," ·"," ",xe(o)]})]})]}),i.jsx(en,{open:w!==null,mode:w?.mode??"new-file",initialName:w?.mode==="rename"?w.node.name:"",parentLabel:w&&w.mode!=="rename"?w.parentDir==="/"?"/":M(w.parentDir):void 0,isPending:ee,onSubmit:Ye,onOpenChange:t=>{!t&&!ee&&J(null)}}),i.jsx(vt,{open:H!==null,onOpenChange:t=>{!t&&!ee&&ue(null)},children:i.jsxs(Ct,{children:[i.jsxs(Nt,{children:[i.jsxs(St,{children:["Delete ",H?.kind==="directory"?"folder":"file","?"]}),i.jsxs(Dt,{children:["This will permanently delete"," ",i.jsx("span",{className:"font-mono",children:H?.name}),H?.kind==="directory"?" and everything inside it.":".",pe.length>0&&i.jsxs(i.Fragment,{children:[" ",pe.length===1?"One open file has unsaved changes that will be lost.":`${pe.length} open files have unsaved changes that will be lost.`]})]})]}),i.jsxs(kt,{children:[i.jsx(Ft,{disabled:ee,children:"Cancel"}),i.jsx(Lt,{disabled:ee||!H,onClick:t=>{t.preventDefault(),H&&Xe(H)},children:"Delete"})]})]})})]})}export{Wi as FileExplorer};
@@ -1 +0,0 @@
1
- import{b as M,w as $,m as U,G as Q,F as Y,d as q,s as P,t as w,K as L,j as n,ae as I,z as Z,C as k,c as F,r as T,B as H,L as B,o as J}from"./index-D10xo2Wm.js";import{P as N}from"./index-4sp0XNgi.js";import{u as W}from"./use-org-auth-client-DoX-hmrG.js";import{u as X}from"./use-debounced-autosave-qbwQlmr6.js";import{A as ee}from"./avatar-IZb76xF5.js";import{I as V}from"./input-D3Hn-5fP.js";import{S as G,a as K,b as A,c as te}from"./settings-section-Coavx4GZ.js";import{D as ne}from"./domain-settings-Dirc71GY.js";import{u as ae}from"./studio-tools-z5PzgEZo.js";import{c as se,b as oe,d as ie,A as re,e as le,g as ce,a as ue,f as de}from"./alert-dialog-DBza5R0g.js";import{R as me}from"./require-capability-0MVu6DnF.js";import"./sidebar-DUFS7nKD.js";import"./LayoutLeft-DGVVcFUt.js";import"./tooltip-VrGyigcV.js";import"./sheet-Cz4-_oqg.js";import"./X-Dothba_A.js";import"./User01-DG6-o1bh.js";import"./card-CYcWxwTq.js";import"./ArrowUpRight-CL_ND2fd.js";import"./badge-DFWqydWM.js";import"./select-mHWPzm7G.js";import"./ChevronUp-DK-p-OwS.js";import"./ChevronDown-BZMxGINT.js";import"./use-capability-DfeHNCP3.js";import"./access-gate-D0uXb2Ny.js";import"./capability-load-error-B9IOpVHT.js";const ge=Z({name:k().min(1,"Name is required").max(255,"Name is too long"),slug:k().min(1,"Slug is required").max(50,"Slug is too long").regex(/^[a-z0-9-]+$/,"Slug must contain only lowercase letters, numbers, and hyphens"),logo:k().optional()});function fe(e){const t=F.c(13),{value:v,onChange:h,name:o,disabled:d}=e,m=T.useRef(null);let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=()=>m.current?.click(),t[0]=l):l=t[0];const r=l;let c;t[1]!==h?(c=x=>{const j=x.target.files?.[0];if(!j)return;if(j.size>2097152){w.error("Image must be smaller than 2MB");return}const u=new FileReader;u.onerror=pe,u.onloadend=()=>{u.result&&h(u.result),m.current&&(m.current.value="")},u.readAsDataURL(j)},t[1]=h,t[2]=c):c=t[2];const a=c;let s;t[3]!==d||t[4]!==a?(s=n.jsx("input",{ref:m,type:"file",accept:"image/*",onChange:a,className:"hidden",disabled:d}),t[3]=d,t[4]=a,t[5]=s):s=t[5];const i=v||void 0,p=o??"?";let g;t[6]!==i||t[7]!==p?(g=n.jsx(ee,{url:i,fallback:p,shape:"square",size:"base"}),t[6]=i,t[7]=p,t[8]=g):g=t[8];let f;return t[9]!==d||t[10]!==s||t[11]!==g?(f=n.jsxs("button",{type:"button",onClick:r,disabled:d,className:"rounded-lg overflow-hidden hover:ring-2 hover:ring-border transition-all disabled:opacity-50","aria-label":"Upload organization logo",children:[s,g]}),t[9]=d,t[10]=s,t[11]=g,t[12]=f):f=t[12],f}function pe(){return w.error("Failed to read image")}function he(){const e=M(),{org:t}=$(),v=W(),h=U(),o=Q({resolver:Y(ge),values:{name:t.name??"",slug:t.slug??"",logo:t.logo??""}}),d=q({mutationFn:async a=>{const s={name:a.name,slug:a.slug};a.logo&&(s.logo=a.logo);const i=await v.organization.update({data:s});if(i?.error)throw new Error(i.error.message||"Failed to update organization");return i},onSuccess:(a,s)=>{P("organization_settings_updated",{organization_id:t.id,fields:Object.keys(s)}),h.invalidateQueries({queryKey:L.organizations()}),h.invalidateQueries({queryKey:L.activeOrganization(t.slug)}),w.success("Organization updated successfully"),a?.data?.slug&&a.data.slug!==t.slug&&e({to:"/$org/settings/general",params:{org:a.data.slug}})},onError:(a,s)=>{P("organization_settings_update_failed",{organization_id:t.id,fields:Object.keys(s),error:a instanceof Error?a.message:String(a)}),w.error(a instanceof Error?a.message:"Failed to update organization")}}),{schedule:m,flush:l}=X({save:async()=>{const a=o.control._formState.dirtyFields;if(Object.keys(a).length===0||!await o.trigger())return;const i=o.getValues(),p=o.control._defaultValues;o.reset(i,{keepValues:!0});try{await d.mutateAsync(i)}catch{o.reset(p,{keepValues:!0})}}}),r=o.formState.errors,c=typeof window<"u"?`${window.location.host}/`:"";return n.jsx(G,{children:n.jsxs(K,{children:[n.jsx(A,{title:"Logo",description:"Recommended size is 256x256px",action:n.jsx(fe,{value:o.watch("logo"),onChange:a=>{o.setValue("logo",a??"",{shouldDirty:!0}),l()},name:o.watch("name")})}),n.jsx(A,{title:"Name",action:n.jsx(I,{control:o.control,name:"name",render:({field:a})=>n.jsx(V,{id:"org-name",...a,onChange:s=>{a.onChange(s),m()},onBlur:()=>{a.onBlur(),l()},placeholder:"Organization name",className:"w-[280px]"})})}),n.jsx(A,{title:"URL",action:n.jsxs("div",{className:"flex items-center w-[280px] rounded-md border border-input bg-input/30 focus-within:ring-2 focus-within:ring-ring/50 overflow-hidden",children:[c&&n.jsx("span",{className:"pl-3 text-sm text-muted-foreground select-none",children:c}),n.jsx(I,{control:o.control,name:"slug",render:({field:a})=>n.jsx("input",{id:"org-slug",value:a.value??"",name:a.name,ref:a.ref,placeholder:"my-organization",className:"flex-1 min-w-0 bg-transparent px-2 py-1.5 text-sm text-foreground placeholder:text-muted-foreground/60 outline-none",onChange:s=>{const i=s.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");o.setValue("slug",i,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0}),m()},onBlur:()=>{a.onBlur(),l()}})})]})}),(r.name||r.slug||r.logo)&&n.jsxs("div",{className:"px-5 pb-3 flex flex-col gap-1",children:[r.name&&n.jsx("p",{className:"text-xs text-destructive",children:r.name.message}),r.slug&&n.jsx("p",{className:"text-xs text-destructive",children:r.slug.message}),r.logo&&n.jsx("p",{className:"text-xs text-destructive",children:r.logo.message})]})]})})}function xe(){const e=F.c(42),{org:t}=$(),[v,h]=T.useState(!1),[o,d]=T.useState(""),m=ae();let l;e[0]!==t.id||e[1]!==m?(l=async()=>{await m.call("ORGANIZATION_DELETE",{id:t.id})},e[0]=t.id,e[1]=m,e[2]=l):l=e[2];let r;e[3]!==t.id||e[4]!==t.slug?(r=()=>{P("organization_deleted",{organization_id:t.id}),localStorage.getItem(B.lastOrgSlug())===t.slug&&localStorage.removeItem(B.lastOrgSlug()),J(),w.success("Organization deleted"),window.location.href="/"},e[3]=t.id,e[4]=t.slug,e[5]=r):r=e[5];let c;e[6]!==l||e[7]!==r?(c={mutationFn:l,onSuccess:r,onError:je},e[6]=l,e[7]=r,e[8]=c):c=e[8];const a=q(c);let s;e[9]===Symbol.for("react.memo_cache_sentinel")?(s=()=>h(!0),e[9]=s):s=e[9];let i;e[10]!==a.isPending?(i=n.jsx(G,{title:"Danger Zone",description:"Irreversible actions that affect your entire organization.",children:n.jsx(K,{className:"border-destructive/40",children:n.jsx(A,{title:"Delete organization",description:"Permanently delete this organization and all of its data. This action cannot be undone.",action:n.jsx(H,{variant:"destructive",size:"sm",onClick:s,disabled:a.isPending,children:"Delete"})})})}),e[10]=a.isPending,e[11]=i):i=e[11];let p;e[12]===Symbol.for("react.memo_cache_sentinel")?(p=O=>{h(O),O||d("")},e[12]=p):p=e[12];let g;e[13]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(se,{children:"Delete Organization?"}),e[13]=g):g=e[13];let f;e[14]!==t.name?(f=n.jsxs("p",{children:["This will permanently delete all data associated with"," ",n.jsx("span",{className:"font-medium text-foreground",children:t.name}),". This action cannot be undone."]}),e[14]=t.name,e[15]=f):f=e[15];let x;e[16]!==t.name?(x=n.jsxs("p",{className:"mt-3 mb-1.5",children:["Type"," ",n.jsx("span",{className:"font-medium text-foreground",children:t.name})," ","to confirm:"]}),e[16]=t.name,e[17]=x):x=e[17];let j;e[18]===Symbol.for("react.memo_cache_sentinel")?(j=O=>d(O.target.value),e[18]=j):j=e[18];let u;e[19]!==o||e[20]!==t.name?(u=n.jsx(V,{value:o,onChange:j,placeholder:t.name,autoFocus:!0}),e[19]=o,e[20]=t.name,e[21]=u):u=e[21];let b;e[22]!==u||e[23]!==f||e[24]!==x?(b=n.jsxs(oe,{children:[g,n.jsx(ie,{asChild:!0,children:n.jsxs("div",{children:[f,x,u]})})]}),e[22]=u,e[23]=f,e[24]=x,e[25]=b):b=e[25];let D;e[26]===Symbol.for("react.memo_cache_sentinel")?(D=n.jsx(re,{children:"Cancel"}),e[26]=D):D=e[26];let y;e[27]!==a?(y=()=>a.mutate(),e[27]=a,e[28]=y):y=e[28];const E=o!==t.name||a.isPending,R=a.isPending?"Deleting…":"Delete organization";let S;e[29]!==y||e[30]!==E||e[31]!==R?(S=n.jsxs(le,{children:[D,n.jsx(ce,{onClick:y,disabled:E,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90 disabled:opacity-50",children:R})]}),e[29]=y,e[30]=E,e[31]=R,e[32]=S):S=e[32];let z;e[33]!==b||e[34]!==S?(z=n.jsxs(ue,{children:[b,S]}),e[33]=b,e[34]=S,e[35]=z):z=e[35];let C;e[36]!==v||e[37]!==z?(C=n.jsx(de,{open:v,onOpenChange:p,children:z}),e[36]=v,e[37]=z,e[38]=C):C=e[38];let _;return e[39]!==C||e[40]!==i?(_=n.jsxs(n.Fragment,{children:[i,C]}),e[39]=C,e[40]=i,e[41]=_):_=e[41],_}function je(e){w.error(e instanceof Error?e.message:"Failed to delete organization")}function ve(){const e=F.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(N,{children:n.jsx(N.Content,{children:n.jsx(N.Body,{children:n.jsxs(te,{children:[n.jsx(N.Title,{children:"Organization"}),n.jsx(he,{}),n.jsx(ne,{}),n.jsx(xe,{})]})})})}),e[0]=t):t=e[0],t}function Ue(){const e=F.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(me,{capability:"org:manage",area:"general settings",children:n.jsx(ve,{})}),e[0]=t):t=e[0],t}export{Ue as default};
@@ -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-D10xo2Wm.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-DUFS7nKD.js";import{u as ds,T as Me,a as Re,b as Ee,c as vs}from"./tooltip-VrGyigcV.js";import{u as zr,S as ys,M as Or}from"./shell-controls-BlanwPNq.js";import{i as Pr,a as Dr,b as Mr}from"./ZoomOut-KuF6xRRI.js";import{T as ge,a as ce}from"./toolbar-KNQEPZYT.js";import{S as we}from"./skeleton-DAm19Q1Q.js";import{P as Bt,a as pt,b as Ut}from"./popover-C5gLQmVJ.js";import{D as Qs,a as Js,b as Zs}from"./drawer-DSl868BV.js";import{i as en}from"./SearchMd-B7uVTp5E.js";import{s as Rr}from"./Star01-DNV8Ma9Q.js";import{s as ke}from"./Plus-Dw7ZaPZJ.js";import{i as Er,a as Fr}from"./use-mcp-client-NkS_1XHm.js";import{u as tn,a as vt,b as Gr}from"./use-virtual-mcp-Cd0H2SUN.js";import{u as Lr}from"./use-create-virtual-mcp-Bm0kv2kQ.js";import{I as Hr,u as Br,W as Ur,H as qr,S as Wr}from"./import-from-deco-dialog-BO45XrD3.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-C9Jofb-u.js";import{G as Qr,a as Jr}from"./github-repo-picker-D1khnJFy.js";import{u as nn,a as Zr,b as rn,T as eo}from"./hooks-DQdOsZp5.js";import{r as to,u as so,R as no,a as ro,b as on}from"./shell-layout-Cwicrerl.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-DNVrD-VA.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-BROfP1EO.js";import{i as Eo}from"./LayoutLeft-DGVVcFUt.js";import{i as mn}from"./Monitor01-Bdmau1Kt.js";import{u as Fo,v as Go,C as Lo}from"./connect-desktop-dialog-BQ2QKxzW.js";import{A as ss}from"./avatar-IZb76xF5.js";import{i as us}from"./ChevronUp-DK-p-OwS.js";import{a as ws}from"./Eye-C1cT97Dr.js";import{n as Ho,i as Bo}from"./Globe01-MmdfsJuj.js";import{i as Uo,a as fn}from"./ZapSquare-CvpHTkF6.js";import{n as qo,a as Wo}from"./Sun-8teVrEhL.js";import{a as yt,i as Ko,b as Vo}from"./Settings02-BOrHnhSy.js";import{i as Yo}from"./Shield01-DoXHEBfW.js";import{a as Xo}from"./Users03-Hhn2gOWC.js";import{s as ms}from"./XClose-DVjO_TNn.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-DBza5R0g.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-C0qrZ_x_.js";import{I as ui}from"./input-D3Hn-5fP.js";import{S as mi,C as fi}from"./chat-context-BUGEnk3o.js";import"./index-Dc0NbcTT.js";import{n as fs}from"./Stars02-Ceo2qvgP.js";import{u as pi,a as xi}from"./use-join-requests-B7A90YDT.js";import{i as ps}from"./ChevronRight-DW1FHwl9.js";import{i as hi}from"./FilterLines-BbZdzGgI.js";import{t as gi}from"./Users01-Cjr16PQI.js";import{S as ks,a as pn,b as Is,c as Ts,d as $s}from"./select-mHWPzm7G.js";import{D as bi,a as ji,b as vi,c as yi,d as Si}from"./dialog-C6Huna5L.js";import{C as _i,a as Ni,b as Ci,c as wi,d as ki}from"./command-DWtuH3XL.js";import{u as xn}from"./studio-tools-z5PzgEZo.js";import{i as hn}from"./Zap-CxpukXGS.js";import{u as Ii}from"./use-org-auth-client-DoX-hmrG.js";import{C as Ot,a as As,b as gn,c as bn,d as jn}from"./context-menu-BcYjb5Fc.js";import{g as Ti,S as $i}from"./task-status-DjWhdyec.js";import{u as Ai,f as zi}from"./use-clock-tick-6K15zpKz.js";import{t as vn}from"./ChevronDown-BZMxGINT.js";import{S as Oi}from"./shell-route-loading-nz7JKsGk.js";import"./sheet-Cz4-_oqg.js";import"./X-Dothba_A.js";import"./ChevronLeft-DdoGlJfU.js";import"./auth-2-m6wz4w.js";import"./use-collections-DVArJb6w.js";import"./use-connection-X4N-9XqT.js";import"./collection-search-CFs0gBmh.js";import"./AlertCircle-DKDv1c5a.js";import"./Tool01-Cnycw8Ef.js";import"./SwitchHorizontal01-DzDSRTn8.js";import"./XCircle-Et4HA60-.js";import"./ArrowUpRight-CL_ND2fd.js";import"./CheckCircle-Cf7Vfzh1.js";import"./DotsVertical-Dj0bH-G-.js";import"./Globe04-C1xLhm_u.js";import"./HardDrive-CTxqPq4g.js";import"./Key01-D_aQKwoU.js";import"./LinkExternal01-CjjlbDYr.js";import"./Palette-B2UGmW-_.js";import"./Play-BMlmnmbt.js";import"./Stars01-DkrXqc8-.js";import"./Trash01-4tPF0VaH.js";import"./Upload01-CmdzZ7sb.js";import"./User01-DG6-o1bh.js";import"./checkbox-D6DN5wX2.js";import"./authenticate-and-persist-oauth-jYJBnNn_.js";import"./mcp-oauth-Ca5pqK3O.js";import"./use-mcp-tools-Cf3odfCU.js";import"./extract-connection-data-CxsQnV0o.js";import"./decopilot-sse-pool-BWdhrrzW.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./required-auth-layout-C-olAxiD.js";import"./tab-id-BptcWVWa.js";import"./use-organization-settings-DCsUye9Y.js";import"./use-org-sso-B_sMXWs_.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-BBo-mCQ3.js";import"./use-registry-connections--RtvB6B0.js";import"./useInfiniteQuery-DrFl9S4A.js";import"./use-infinite-scroll-nYPek78V.js";import"./card-CYcWxwTq.js";import"./integration-icon-D_K0I1bc.js";import"./collection-tabs-D6hMQ7Uk.js";import"./badge-DFWqydWM.js";import"./textarea-CVcNewnq.js";import"./connection-form-helpers-BkiVmzh-.js";import"./useSuspenseInfiniteQuery-Cbf8ULb8.js";import"./use-ai-providers-exBfYy9L.js";import"./label-BaI9WHK8.js";import"./use-capability-DfeHNCP3.js";import"./index-DV9_3Xnk.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.86.1"]}),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.86.1"]}),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 eu(){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{eu as default};