decocms 2.316.3 → 2.317.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 (207) hide show
  1. package/dist/client/assets/{AlertCircle-CIhNxTTl.js → AlertCircle-DBGfLjQw.js} +1 -1
  2. package/dist/client/assets/{Archive-DOUYQc8s.js → Archive-BKT9Dg_O.js} +1 -1
  3. package/dist/client/assets/{ArrowNarrowLeft-B1LOVgdw.js → ArrowNarrowLeft-CukpweKs.js} +1 -1
  4. package/dist/client/assets/{ArrowUpRight-BXCPGKW0.js → ArrowUpRight-D9dARFlG.js} +1 -1
  5. package/dist/client/assets/{Check-CV-PYcTx.js → Check-BXg4TGxE.js} +1 -1
  6. package/dist/client/assets/{CheckCircle-DSnO-ZRF.js → CheckCircle-Bo4QB9pu.js} +1 -1
  7. package/dist/client/assets/{ChevronDown-d1XZuPx_.js → ChevronDown-DEP8rKZT.js} +1 -1
  8. package/dist/client/assets/{ChevronRight-OA6RE0bm.js → ChevronRight-CXiW90Fz.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-BPXArXn4.js → ChevronUp-BhNdg10c.js} +1 -1
  10. package/dist/client/assets/{Container-D2TENyxw.js → Container-CxQrLgnS.js} +1 -1
  11. package/dist/client/assets/{DotsVertical-CkjufnVc.js → DotsVertical-Caoo-NuL.js} +1 -1
  12. package/dist/client/assets/{LayoutLeft-CdHsorDG.js → LayoutLeft-Br6mPXCN.js} +1 -1
  13. package/dist/client/assets/{LinkExternal01-C_Dp-9up.js → LinkExternal01-FDsQXojs.js} +1 -1
  14. package/dist/client/assets/{Lock01-DbAsRqsB.js → Lock01-CjoGpFGs.js} +1 -1
  15. package/dist/client/assets/{Palette-TGj5HRZ0.js → Palette-C1Yvme6Z.js} +1 -1
  16. package/dist/client/assets/{Play-Bqd6KoLL.js → Play-BFNsKgtb.js} +1 -1
  17. package/dist/client/assets/{Plus-DU1c_qIh.js → Plus-BPcc_-zf.js} +1 -1
  18. package/dist/client/assets/{RefreshCcw01-D_ZQRj8n.js → RefreshCcw01-DebjkWfq.js} +1 -1
  19. package/dist/client/assets/{SearchMd-D2HCX03E.js → SearchMd-CePuFGwO.js} +1 -1
  20. package/dist/client/assets/{Settings02-DvgEzqo-.js → Settings02-B5jIAnK4.js} +1 -1
  21. package/dist/client/assets/{Shield01-Bam4M-YR.js → Shield01-CKYDfpKE.js} +1 -1
  22. package/dist/client/assets/{Star01-eRHoMpoz.js → Star01-CxJjtPnY.js} +1 -1
  23. package/dist/client/assets/{Sun-CK-d8u_d.js → Sun-CBmGK6wu.js} +1 -1
  24. package/dist/client/assets/{Tool01-DXA_DwTO.js → Tool01-YKVy1yNP.js} +1 -1
  25. package/dist/client/assets/{Trash01-C98MAtHO.js → Trash01--KbsY2dn.js} +1 -1
  26. package/dist/client/assets/{User01-Ci3O3rgG.js → User01-BLvWkS9e.js} +1 -1
  27. package/dist/client/assets/{Users03-BE87UJzh.js → Users03-C4su_vOM.js} +1 -1
  28. package/dist/client/assets/{X-C8gNxXPZ.js → X-CNAnrf0f.js} +1 -1
  29. package/dist/client/assets/{XCircle-DcF4hahE.js → XCircle-QSJN9xhv.js} +1 -1
  30. package/dist/client/assets/{XClose-DM_WC7Hv.js → XClose-CPKu5cnb.js} +1 -1
  31. package/dist/client/assets/{Zap-BtcijgPp.js → Zap-B4MS-NKo.js} +1 -1
  32. package/dist/client/assets/{ZapSquare-ugGzur7h.js → ZapSquare-D07uWeTi.js} +1 -1
  33. package/dist/client/assets/{accordion-eVPt3AxV.js → accordion-DK_H38Gy.js} +1 -1
  34. package/dist/client/assets/{agent-icon-BaSFWyhf.js → agent-icon-ChigV_SM.js} +1 -1
  35. package/dist/client/assets/{agents-list-Bs-Qg8TC.js → agents-list-CQyCCUIN.js} +1 -1
  36. package/dist/client/assets/{ai-providers-goX3mYeT.js → ai-providers-D8YlgZiZ.js} +1 -1
  37. package/dist/client/assets/{alert-dialog-B28bzmjR.js → alert-dialog-B-CFL8EO.js} +1 -1
  38. package/dist/client/assets/{auth-catchall-D8AsZk2D.js → auth-catchall-CI1pA1WK.js} +1 -1
  39. package/dist/client/assets/{automation-list-row-Cw-nvI9t.js → automation-list-row-exexu0fc.js} +1 -1
  40. package/dist/client/assets/{automations-CIogEm_v.js → automations-Ch8DHfAX.js} +1 -1
  41. package/dist/client/assets/{avatar-BccIYZD6.js → avatar-DLcW-A0B.js} +1 -1
  42. package/dist/client/assets/{badge-B7UYPtu8.js → badge-Bovdptse.js} +1 -1
  43. package/dist/client/assets/{brand-context-GjgBMUq2.js → brand-context-BEky_t3d.js} +1 -1
  44. package/dist/client/assets/{card-e_SApZv-.js → card-Bij24Dhu.js} +1 -1
  45. package/dist/client/assets/{chat-context-BGitM-1g.js → chat-context-C_XiURbM.js} +1 -1
  46. package/dist/client/assets/{checkbox-BwDKjjzH.js → checkbox-DepLdWR1.js} +1 -1
  47. package/dist/client/assets/{collection-detail-CWgaM8qe.js → collection-detail-CWWkHJjz.js} +1 -1
  48. package/dist/client/assets/{collection-display-button-C5UVbYH9.js → collection-display-button-U6oQljTt.js} +1 -1
  49. package/dist/client/assets/{collection-search-BSC882az.js → collection-search-BCf7pr5A.js} +1 -1
  50. package/dist/client/assets/{collection-search-CXkehpMy.js → collection-search-oUHE77Ko.js} +1 -1
  51. package/dist/client/assets/{collection-table-wrapper-DBwS-ncE.js → collection-table-wrapper-CIXt2Qna.js} +1 -1
  52. package/dist/client/assets/{collection-tabs-BIBHPtug.js → collection-tabs-CHoGEXEE.js} +1 -1
  53. package/dist/client/assets/{collections-CgxUTBvp.js → collections-DbmVPIqC.js} +1 -1
  54. package/dist/client/assets/{command-DTQGiHmi.js → command-BJXJqdxz.js} +1 -1
  55. package/dist/client/assets/{connection-card-BrngMsBW.js → connection-card-DvWQmocE.js} +1 -1
  56. package/dist/client/assets/{connection-detail-CCeKFmMl.js → connection-detail-DMePaT7A.js} +1 -1
  57. package/dist/client/assets/{connection-form-helpers-DlHOUpQU.js → connection-form-helpers-z7ekyahw.js} +1 -1
  58. package/dist/client/assets/{connections-BZs9OYYi.js → connections-C2W6I3Kx.js} +1 -1
  59. package/dist/client/assets/{constants-CiNOCN3_.js → constants-CrCZOO5F.js} +1 -1
  60. package/dist/client/assets/{constants-aoAzOZlb.js → constants-D2ruRIzu.js} +1 -1
  61. package/dist/client/assets/{dialog-D9JDljl1.js → dialog-zxbh5ng1.js} +1 -1
  62. package/dist/client/assets/{domain-settings-b037kHqN.js → domain-settings-CG6GaRrK.js} +1 -1
  63. package/dist/client/assets/{drawer-CPYyZD60.js → drawer-DNDd7AZJ.js} +1 -1
  64. package/dist/client/assets/{dropdown-menu-v2GBEFa6.js → dropdown-menu-BHUBCwIp.js} +1 -1
  65. package/dist/client/assets/{dynamic-plugin-layout-DmLmlikq.js → dynamic-plugin-layout-DuN_fdev.js} +1 -1
  66. package/dist/client/assets/{empty-state-DzxY5CBA.js → empty-state-16qSOU0O.js} +1 -1
  67. package/dist/client/assets/{empty-state-Qo0QLKm5.js → empty-state-9cIH1OSj.js} +1 -1
  68. package/dist/client/assets/{extract-connection-data-C2xJ0Fj_.js → extract-connection-data-CA-1nswb.js} +1 -1
  69. package/dist/client/assets/{features-_6JkrMwd.js → features-CemeaDAi.js} +1 -1
  70. package/dist/client/assets/{form-B4UBGEp5.js → form-DK_rcfC8.js} +1 -1
  71. package/dist/client/assets/{general-BHYjmLRM.js → general-C8mtE7AK.js} +1 -1
  72. package/dist/client/assets/{index-yZgZglUT.js → index-77yxUsUU.js} +1 -1
  73. package/dist/client/assets/{index-Ciepzli1.js → index-7mIMVlht.js} +9 -9
  74. package/dist/client/assets/{index-C45moMcG.js → index-B19uc8uS.js} +1 -1
  75. package/dist/client/assets/{index-DTJ_e6nL.js → index-BOMQKZYe.js} +1 -1
  76. package/dist/client/assets/index-BSzZmTb_.js +1 -0
  77. package/dist/client/assets/{index-cnKKVRZj.js → index-By1GUFmc.js} +1 -1
  78. package/dist/client/assets/index-C-NbBgOF.js +1 -0
  79. package/dist/client/assets/{index-DoCu980b.js → index-CCt7tyZ0.js} +1 -1
  80. package/dist/client/assets/{index-D379-Ra5.js → index-CEKdquZV.js} +1 -1
  81. package/dist/client/assets/{index-CNmK2UE6.js → index-CLwT6SqX.js} +1 -1
  82. package/dist/client/assets/{index--m7BENdv.js → index-CMD-gSoU.js} +1 -1
  83. package/dist/client/assets/{index-DXRwI8-Q.js → index-CVz9D9gf.js} +1 -1
  84. package/dist/client/assets/{index-CsB6QrBB.js → index-CzOMQ7ME.js} +2 -2
  85. package/dist/client/assets/index-D8oXDizB.js +1 -0
  86. package/dist/client/assets/index-DHNiGAXq.js +547 -0
  87. package/dist/client/assets/index-DtJ8d1aI.css +1 -0
  88. package/dist/client/assets/{index-B85sFotX.js → index-nTgL534f.js} +1 -1
  89. package/dist/client/assets/{infiniteQueryObserver-C-liTxtI.js → infiniteQueryObserver-C3rVl4tZ.js} +1 -1
  90. package/dist/client/assets/{input-C-eXOMYP.js → input-B0c-2DIW.js} +1 -1
  91. package/dist/client/assets/{integration-icon-Ckowj_b4.js → integration-icon-BaScZvO6.js} +1 -1
  92. package/dist/client/assets/{label-C3Wj5fRJ.js → label-gqBY6uyz.js} +1 -1
  93. package/dist/client/assets/{layout-DyhaKtIo.js → layout-CYKmcI2j.js} +1 -1
  94. package/dist/client/assets/{lean-canvas-recruit-modal-B7oEpItL.js → lean-canvas-recruit-modal-CHTxHUjM.js} +1 -1
  95. package/dist/client/assets/{login-BfSyXKzY.js → login-DClTL_nN.js} +1 -1
  96. package/dist/client/assets/{members-2l-bN7R0.js → members-DhsQ9190.js} +1 -1
  97. package/dist/client/assets/{monaco-editor-2DI4BCuN.js → monaco-editor-BBalufRy.js} +1 -1
  98. package/dist/client/assets/{monitoring-stats-row-O0i0E0sX.js → monitoring-stats-row-Dv-X2RbZ.js} +1 -1
  99. package/dist/client/assets/{oauth-callback-FXnsziuV.js → oauth-callback-B-3DKhKg.js} +1 -1
  100. package/dist/client/assets/{oauth-callback-ai-provider-B_mMMBGP.js → oauth-callback-ai-provider-Bkh9HG7z.js} +1 -1
  101. package/dist/client/assets/{onboarding-C3R9iT7_.js → onboarding-D7bymWNF.js} +1 -1
  102. package/dist/client/assets/{org-layout-C5vsvaCJ.js → org-layout-CYfpIgy5.js} +1 -1
  103. package/dist/client/assets/{org-plugin-layout-TVmKREDe.js → org-plugin-layout-C8RFioa3.js} +1 -1
  104. package/dist/client/assets/{pair-C-p-DbTv.js → pair-Bg3A59Mm.js} +2 -2
  105. package/dist/client/assets/{plugin-empty-state-DsUYr3t-.js → plugin-empty-state-BrALBpmq.js} +1 -1
  106. package/dist/client/assets/{plugin-header-92zfiruf.js → plugin-header-ClLf_cJL.js} +1 -1
  107. package/dist/client/assets/{plugin-layout-Ci2Gezpo.js → plugin-layout-C1cPizmH.js} +1 -1
  108. package/dist/client/assets/{popover-DaEdoMLv.js → popover-DVDtU_6G.js} +1 -1
  109. package/dist/client/assets/{profile-C64u-o9k.js → profile-OTfGZyjY.js} +1 -1
  110. package/dist/client/assets/{project-app-view-__Y1p7Pu.js → project-app-view-C5TQg2cG.js} +1 -1
  111. package/dist/client/assets/registry-CXDPGCG2.js +2 -0
  112. package/dist/client/assets/{registry-layout-BA3b7Khm.js → registry-layout-CmjO7_QP.js} +1 -1
  113. package/dist/client/assets/{required-auth-layout-CKWnvSJk.js → required-auth-layout-BRR_6ANi.js} +1 -1
  114. package/dist/client/assets/{reset-password-BqmAkVAO.js → reset-password-BIYV3F1f.js} +1 -1
  115. package/dist/client/assets/{roles-99Si_WzF.js → roles-DjfHoeEL.js} +1 -1
  116. package/dist/client/assets/{scroll-area-BMqRsz1X.js → scroll-area-9lFTzWCb.js} +1 -1
  117. package/dist/client/assets/{search-input-DsCiCzet.js → search-input-BWH3fQpv.js} +1 -1
  118. package/dist/client/assets/{select-B7los4LB.js → select-Ilj6kxB7.js} +1 -1
  119. package/dist/client/assets/{select-model-CC6Vrb5m.js → select-model-Ca5uLyFK.js} +1 -1
  120. package/dist/client/assets/{settings-layout-nfV08EHo.js → settings-layout-DGVGgKqW.js} +1 -1
  121. package/dist/client/assets/{settings-section-CkhTzM-S.js → settings-section-DfJOrTB5.js} +1 -1
  122. package/dist/client/assets/{shell-layout-kk9CghF9.js → shell-layout-DbyGG6Wz.js} +1 -1
  123. package/dist/client/assets/{sidebar-YQQk47mU.js → sidebar-CHkSPfi1.js} +1 -1
  124. package/dist/client/assets/{skeleton-DyIf1f58.js → skeleton-BhYsT5bA.js} +1 -1
  125. package/dist/client/assets/{spinner-Cx3i9jg1.js → spinner-DRDdaYJh.js} +1 -1
  126. package/dist/client/assets/{sso-BdnItz6L.js → sso-BWvJitB4.js} +1 -1
  127. package/dist/client/assets/{store-BkZwsjod.js → store-CRnNdTmg.js} +1 -1
  128. package/dist/client/assets/store-registry-6e--RkKu.js +2 -0
  129. package/dist/client/assets/{switch-Ba58imnw.js → switch-MdXM9LTQ.js} +1 -1
  130. package/dist/client/assets/{table-BR31N60P.js → table-DqMsTisq.js} +1 -1
  131. package/dist/client/assets/{tabs-DgJzKZHT.js → tabs-BOCdrF2i.js} +1 -1
  132. package/dist/client/assets/{task-status-BAiKcdqG.js → task-status-BMDGQef8.js} +1 -1
  133. package/dist/client/assets/{textarea-CT2Jghcd.js → textarea-BqfIjmtd.js} +1 -1
  134. package/dist/client/assets/{toggle-group-BwCswIiA.js → toggle-group-i_HO-0bV.js} +1 -1
  135. package/dist/client/assets/{tools-list-Dkz550hJ.js → tools-list-BdLDYsTK.js} +1 -1
  136. package/dist/client/assets/{tooltip-v9goNoMa.js → tooltip-Dk-x7ks3.js} +1 -1
  137. package/dist/client/assets/{types-D30V4GBK.js → types-G67jsjMK.js} +1 -1
  138. package/dist/client/assets/{use-ai-providers-DuJ557zy.js → use-ai-providers-Bo9kqLtW.js} +1 -1
  139. package/dist/client/assets/{use-collections-CfoSjDkZ.js → use-collections-DaGR-TK3.js} +1 -1
  140. package/dist/client/assets/{use-connection-CL8Sz4aB.js → use-connection-Bw3IdOYX.js} +1 -1
  141. package/dist/client/assets/{use-copy-9B_lKCQP.js → use-copy-B-uFxHk6.js} +1 -1
  142. package/dist/client/assets/{use-create-virtual-mcp-B4YkhF26.js → use-create-virtual-mcp-CCKFB_a7.js} +1 -1
  143. package/dist/client/assets/{use-debounced-autosave-CnKA4yL_.js → use-debounced-autosave-T0GvbwUO.js} +1 -1
  144. package/dist/client/assets/{use-decopilot-events-CKsjNSwH.js → use-decopilot-events-Co1GYuP2.js} +1 -1
  145. package/dist/client/assets/{use-delete-connection-CdrzrkWw.js → use-delete-connection-kRigiWM3.js} +1 -1
  146. package/dist/client/assets/{use-infinite-scroll-BYU0Szfl.js → use-infinite-scroll-BNHelzzC.js} +1 -1
  147. package/dist/client/assets/{use-list-state-BV6nWWeI.js → use-list-state-DUJmWeK2.js} +1 -1
  148. package/dist/client/assets/{use-mcp-tools-C0h3zeNG.js → use-mcp-tools-DVY8KcMA.js} +1 -1
  149. package/dist/client/assets/{use-members-Bc88CE0J.js → use-members-BgQ7Ica2.js} +1 -1
  150. package/dist/client/assets/{use-navigate-to-agent-D3pu_YG_.js → use-navigate-to-agent-BQ5qza3f.js} +1 -1
  151. package/dist/client/assets/{use-org-auth-client-DKocDk2P.js → use-org-auth-client-CJlh_N8L.js} +1 -1
  152. package/dist/client/assets/{use-org-sso-Cow3Y2YN.js → use-org-sso-B3swYyz4.js} +1 -1
  153. package/dist/client/assets/{use-organization-roles-B-MXbHky.js → use-organization-roles-BIsWMlMh.js} +1 -1
  154. package/dist/client/assets/{use-organization-settings-BtgJutO3.js → use-organization-settings-BMveAMB5.js} +1 -1
  155. package/dist/client/assets/{use-registry-connections-CGJfCg9t.js → use-registry-connections-Cld8pkRO.js} +1 -1
  156. package/dist/client/assets/{use-status-sounds-IPRVjHSk.js → use-status-sounds-DsCr5ian.js} +1 -1
  157. package/dist/client/assets/{use-tasks-LPt7s23P.js → use-tasks-ChwW8r_K.js} +1 -1
  158. package/dist/client/assets/{use-view-mode-NK71s2Nx.js → use-view-mode-MWDbD9TW.js} +1 -1
  159. package/dist/client/assets/{use-virtual-mcp-CcbuH5vn.js → use-virtual-mcp-lxX8wI4d.js} +1 -1
  160. package/dist/client/assets/useInfiniteQuery-ImrWnFFo.js +1 -0
  161. package/dist/client/assets/useSuspenseInfiniteQuery-CpJJnQ6p.js +1 -0
  162. package/dist/client/assets/{user-CHg0uxVs.js → user-BesiartC.js} +1 -1
  163. package/dist/client/assets/{view-mode-toggle-Ck5p4f38.js → view-mode-toggle-Dn0_DV4a.js} +1 -1
  164. package/dist/client/assets/{workflow-DBHhsoUK.js → workflow-8tifDY_U.js} +1 -1
  165. package/dist/client/assets/workflow-detail-8AQCTpUe.js +1 -0
  166. package/dist/client/index.html +2 -2
  167. package/dist/server/cli.js +1 -1
  168. package/dist/server/node_modules/get-east-asian-width/index.d.ts +60 -0
  169. package/dist/server/node_modules/get-east-asian-width/index.js +30 -0
  170. package/dist/server/node_modules/get-east-asian-width/lookup-data.js +18 -0
  171. package/dist/server/node_modules/get-east-asian-width/lookup.js +135 -0
  172. package/dist/server/node_modules/get-east-asian-width/package.json +71 -0
  173. package/dist/server/node_modules/get-east-asian-width/readme.md +65 -0
  174. package/dist/server/node_modules/get-east-asian-width/utilities.js +24 -0
  175. package/package.json +1 -1
  176. package/dist/client/assets/index-9VIcQuRp.js +0 -1
  177. package/dist/client/assets/index-BJOFaTKm.js +0 -1
  178. package/dist/client/assets/index-Bo94M6wo.css +0 -1
  179. package/dist/client/assets/index-D5NG6paH.js +0 -547
  180. package/dist/client/assets/index-DW1EySXD.js +0 -1
  181. package/dist/client/assets/registry-LJpFNvAF.js +0 -2
  182. package/dist/client/assets/store-registry-Dr7mJzaG.js +0 -2
  183. package/dist/client/assets/useInfiniteQuery-BIRZrmWs.js +0 -1
  184. package/dist/client/assets/useSuspenseInfiniteQuery-Bq4CZEUT.js +0 -1
  185. package/dist/client/assets/workflow-detail-BIpbk5VT.js +0 -1
  186. package/dist/server/node_modules/ansi-styles/index.d.ts +0 -236
  187. package/dist/server/node_modules/ansi-styles/index.js +0 -223
  188. package/dist/server/node_modules/ansi-styles/package.json +0 -54
  189. package/dist/server/node_modules/ansi-styles/readme.md +0 -173
  190. package/dist/server/node_modules/is-fullwidth-code-point/index.d.ts +0 -17
  191. package/dist/server/node_modules/is-fullwidth-code-point/index.js +0 -12
  192. package/dist/server/node_modules/is-fullwidth-code-point/license +0 -9
  193. package/dist/server/node_modules/is-fullwidth-code-point/package.json +0 -53
  194. package/dist/server/node_modules/is-fullwidth-code-point/readme.md +0 -31
  195. package/dist/server/node_modules/onetime/index.d.ts +0 -64
  196. package/dist/server/node_modules/onetime/index.js +0 -44
  197. package/dist/server/node_modules/onetime/license +0 -9
  198. package/dist/server/node_modules/onetime/package.json +0 -43
  199. package/dist/server/node_modules/onetime/readme.md +0 -94
  200. package/dist/server/node_modules/xtend/.jshintrc +0 -30
  201. package/dist/server/node_modules/xtend/LICENSE +0 -20
  202. package/dist/server/node_modules/xtend/README.md +0 -32
  203. package/dist/server/node_modules/xtend/immutable.js +0 -19
  204. package/dist/server/node_modules/xtend/mutable.js +0 -17
  205. package/dist/server/node_modules/xtend/package.json +0 -55
  206. package/dist/server/node_modules/xtend/test.js +0 -103
  207. /package/dist/server/node_modules/{ansi-styles → get-east-asian-width}/license +0 -0
@@ -1,4 +1,4 @@
1
- import{ci as ne,e as _,j as o,B as te,l as ln,bb as ze,cj as ms,r as T,s as oe,c as O,g as ps,o as cn,c4 as xs,a7 as hs,a8 as fe,aV as an,c5 as gs,aS as bs,c3 as Ss,c6 as un,b5 as js,cc as ys,cd as vs,ae as ws,ce as Ns,ck as $t,cl as dn,x as ks,y as _s,cm as Cs,cn as Is}from"./index-CsB6QrBB.js";import{D as Ts,F as Es,B as $s}from"./index-cnKKVRZj.js";import{e as Fe,i as Os,u as ae}from"./constants-CiNOCN3_.js";import{b as fn}from"./use-virtual-mcp-CcbuH5vn.js";import{M as Re}from"./monaco-editor-2DI4BCuN.js";import{A as Rs,c as Ms,a as Ls,b as Ps,e as As,R as Ut,d as zs}from"./accordion-eVPt3AxV.js";import{B as le}from"./badge-B7UYPtu8.js";import{c as vt,S as wt,d as nt,b as Nt,a as kt}from"./select-B7los4LB.js";import{S as st}from"./spinner-Cx3i9jg1.js";import{V as Ws}from"./view-mode-toggle-Ck5p4f38.js";import{a8 as Ds,a9 as Fs,i as Hs,a0 as mn,aa as Vs,P as Us,u as qs,ab as pn,X as Ks,T as xn,ac as Bs,ad as Xs,R as bt,ae as Js}from"./agent-icon-BaSFWyhf.js";import{i as hn}from"./Play-Bqd6KoLL.js";import{b as Gs,a as Qs,V as Qe}from"./layout-DyhaKtIo.js";import{c as gn,b as bn,T as Sn,a as jn}from"./tooltip-v9goNoMa.js";import{u as Ys,a as Zs}from"./use-connection-CL8Sz4aB.js";import{u as Ot,d as Rt,b as yn}from"./use-mcp-tools-C0h3zeNG.js";import{c as eo,d as to,e as no,D as so,a as oo,b as ro}from"./dialog-D9JDljl1.js";import"./index-CNmK2UE6.js";import{N as io,h as lo,j as co,m as Be,P as ao,i as uo,R as fo,c as mo,k as po,e as qt,d as xo}from"./index-B85sFotX.js";import{S as ho}from"./index-DTJ_e6nL.js";import{D as vn,a as wn,b as Nn,c as Ye}from"./dropdown-menu-v2GBEFa6.js";import{s as go}from"./Plus-DU1c_qIh.js";import{b as kn}from"./Tool01-DXA_DwTO.js";import{i as He}from"./Check-CV-PYcTx.js";import{s as Mt}from"./XClose-DM_WC7Hv.js";import{I as Lt}from"./integration-icon-Ckowj_b4.js";import{a as bo,S as So}from"./scroll-area-BMqRsz1X.js";import"./index-DXRwI8-Q.js";import{i as _n}from"./X-C8gNxXPZ.js";import{u as Cn,a as jo}from"./use-collections-CfoSjDkZ.js";import{E as In}from"./empty-state-DzxY5CBA.js";import{c as yo}from"./create-sse-subscription-CxkOgzKf.js";import{I as Kt}from"./input-C-eXOMYP.js";const Tn=ne("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);const En=ne("Braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]);const ot=ne("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const rt=ne("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const vo=ne("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const $n=ne("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);const wo=ne("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const On=ne("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const Rn=ne("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);const Mn=ne("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);const No=ne("OctagonAlert",[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]]);const Ln=ne("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const Pn=ne("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);const ko=ne("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);const An=ne("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);function _o(t){const e=_.c(15),{onSave:n,onUndo:s,isDirty:i,isSaving:r,saveLabel:l,undoLabel:c}=t,a=l===void 0?"Save":l,u=c===void 0?"Undo":c;if(!i)return null;let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=o.jsx(Ds,{size:14}),e[0]=d):d=e[0];let f;e[1]!==r||e[2]!==s||e[3]!==u?(f=o.jsxs(te,{variant:"outline",size:"sm",onClick:s,disabled:r,"aria-label":u,children:[d,u]}),e[1]=r,e[2]=s,e[3]=u,e[4]=f):f=e[4];let m;e[5]!==r?(m=r?o.jsx(ln,{size:14,className:"animate-spin"}):o.jsx(Fs,{size:14}),e[5]=r,e[6]=m):m=e[6];let x;e[7]!==r||e[8]!==n||e[9]!==a||e[10]!==m?(x=o.jsxs(te,{variant:"default",size:"sm",onClick:n,disabled:r,"aria-label":a,children:[m,a]}),e[7]=r,e[8]=n,e[9]=a,e[10]=m,e[11]=x):x=e[11];let p;return e[12]!==f||e[13]!==x?(p=o.jsxs(o.Fragment,{children:[f,x]}),e[12]=f,e[13]=x,e[14]=p):p=e[14],p}const Bt=t=>{let e;const n=new Set,s=(u,d)=>{const f=typeof u=="function"?u(e):u;if(!Object.is(f,e)){const m=e;e=d??(typeof f!="object"||f===null)?f:Object.assign({},e,f),n.forEach(x=>x(e,m))}},i=()=>e,c={setState:s,getState:i,getInitialState:()=>a,subscribe:u=>(n.add(u),()=>n.delete(u))},a=e=t(s,i,c);return c},Pt=(t=>t?Bt(t):Bt),Co=t=>t;function _t(t,e=Co){const n=ze.useSyncExternalStore(t.subscribe,ze.useCallback(()=>e(t.getState()),[t,e]),ze.useCallback(()=>e(t.getInitialState()),[t,e]));return ze.useDebugValue(n),n}const Io=t=>{const e=Pt(t),n=s=>_t(e,s);return Object.assign(n,e),n},To=(t=>Io);function zn(t,e){let n;try{n=t()}catch{return}return{getItem:i=>{var r;const l=a=>a===null?null:JSON.parse(a,void 0),c=(r=n.getItem(i))!=null?r:null;return c instanceof Promise?c.then(l):l(c)},setItem:(i,r)=>n.setItem(i,JSON.stringify(r,void 0)),removeItem:i=>n.removeItem(i)}}const Ct=t=>e=>{try{const n=t(e);return n instanceof Promise?n:{then(s){return Ct(s)(n)},catch(s){return this}}}catch(n){return{then(s){return this},catch(s){return Ct(s)(n)}}}},Eo=(t,e)=>(n,s,i)=>{let r={storage:zn(()=>window.localStorage),partialize:g=>g,version:0,merge:(g,b)=>({...b,...g}),...e},l=!1,c=0;const a=new Set,u=new Set;let d=r.storage;if(!d)return t((...g)=>{console.warn(`[zustand persist middleware] Unable to update item '${r.name}', the given storage is currently unavailable.`),n(...g)},s,i);const f=()=>{const g=r.partialize({...s()});return d.setItem(r.name,{state:g,version:r.version})},m=i.setState;i.setState=(g,b)=>(m(g,b),f());const x=t((...g)=>(n(...g),f()),s,i);i.getInitialState=()=>x;let p;const h=()=>{var g,b;if(!d)return;const j=++c;l=!1,a.forEach(y=>{var S;return y((S=s())!=null?S:x)});const v=((b=r.onRehydrateStorage)==null?void 0:b.call(r,(g=s())!=null?g:x))||void 0;return Ct(d.getItem.bind(d))(r.name).then(y=>{if(y)if(typeof y.version=="number"&&y.version!==r.version){if(r.migrate){const S=r.migrate(y.state,y.version);return S instanceof Promise?S.then(w=>[!0,w]):[!0,S]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,y.state];return[!1,void 0]}).then(y=>{var S;if(j!==c)return;const[w,N]=y;if(p=r.merge(N,(S=s())!=null?S:x),n(p,!0),w)return f()}).then(()=>{j===c&&(v?.(s(),void 0),p=s(),l=!0,u.forEach(y=>y(p)))}).catch(y=>{j===c&&v?.(void 0,y)})};return i.persist={setOptions:g=>{r={...r,...g},g.storage&&(d=g.storage)},clearStorage:()=>{d?.removeItem(r.name)},getOptions:()=>r,rehydrate:()=>h(),hasHydrated:()=>l,onHydrate:g=>(a.add(g),()=>{a.delete(g)}),onFinishHydration:g=>(u.add(g),()=>{u.delete(g)})},r.skipHydration||h(),p||x},Wn=Eo,{useSyncExternalStoreWithSelector:$o}=ms,Oo=t=>t;function Ro(t,e=Oo,n){const s=$o(t.subscribe,t.getState,t.getInitialState,e,n);return ze.useDebugValue(s),s}const Xt=t=>Symbol.iterator in t,Jt=t=>"entries"in t,Gt=(t,e)=>{const n=t instanceof Map?t:new Map(t.entries()),s=e instanceof Map?e:new Map(e.entries());if(n.size!==s.size)return!1;for(const[i,r]of n)if(!s.has(i)||!Object.is(r,s.get(i)))return!1;return!0},Mo=(t,e)=>{const n=t[Symbol.iterator](),s=e[Symbol.iterator]();let i=n.next(),r=s.next();for(;!i.done&&!r.done;){if(!Object.is(i.value,r.value))return!1;i=n.next(),r=s.next()}return!!i.done&&!!r.done};function Lo(t,e){return Object.is(t,e)?!0:typeof t!="object"||t===null||typeof e!="object"||e===null||Object.getPrototypeOf(t)!==Object.getPrototypeOf(e)?!1:Xt(t)&&Xt(e)?Jt(t)&&Jt(e)?Gt(t,e):Mo(t,e):Gt({entries:()=>Object.entries(t)},{entries:()=>Object.entries(e)})}function Dn(t,e="Output"){if(!t)return`interface ${e} {}`;function n(r){if(!r||typeof r!="object")return"unknown";const l=r.type;if(Array.isArray(l))return l.map(c=>s(c)).join(" | ");switch(l){case"string":return r.enum?r.enum.map(c=>`"${c}"`).join(" | "):"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";case"array":{const c=r.items;return c?`${n(c)}[]`:"unknown[]"}case"object":return i(r);default:return r.anyOf?r.anyOf.map(n).join(" | "):r.oneOf?r.oneOf.map(n).join(" | "):r.allOf?r.allOf.map(n).join(" & "):"unknown"}}function s(r){switch(r){case"string":return"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";default:return"unknown"}}function i(r){const l=r.properties;if(!l)return"Record<string, unknown>";const c=new Set(r.required||[]);return`{
1
+ import{ci as ne,e as _,j as o,B as te,l as ln,bb as ze,cj as ms,r as T,s as oe,c as O,g as ps,o as cn,c4 as xs,a7 as hs,a8 as fe,aV as an,c5 as gs,aS as bs,c3 as Ss,c6 as un,b5 as js,cc as ys,cd as vs,ae as ws,ce as Ns,ck as $t,cl as dn,x as ks,y as _s,cm as Cs,cn as Is}from"./index-CzOMQ7ME.js";import{D as Ts,F as Es,B as $s}from"./index-By1GUFmc.js";import{e as Fe,i as Os,u as ae}from"./constants-CrCZOO5F.js";import{b as fn}from"./use-virtual-mcp-lxX8wI4d.js";import{M as Re}from"./monaco-editor-BBalufRy.js";import{A as Rs,c as Ms,a as Ls,b as Ps,e as As,R as Ut,d as zs}from"./accordion-DK_H38Gy.js";import{B as le}from"./badge-Bovdptse.js";import{c as vt,S as wt,d as nt,b as Nt,a as kt}from"./select-Ilj6kxB7.js";import{S as st}from"./spinner-DRDdaYJh.js";import{V as Ws}from"./view-mode-toggle-Dn0_DV4a.js";import{a8 as Ds,a9 as Fs,i as Hs,a0 as mn,aa as Vs,P as Us,u as qs,ab as pn,X as Ks,T as xn,ac as Bs,ad as Xs,R as bt,ae as Js}from"./agent-icon-ChigV_SM.js";import{i as hn}from"./Play-BFNsKgtb.js";import{b as Gs,a as Qs,V as Qe}from"./layout-CYKmcI2j.js";import{c as gn,b as bn,T as Sn,a as jn}from"./tooltip-Dk-x7ks3.js";import{u as Ys,a as Zs}from"./use-connection-Bw3IdOYX.js";import{u as Ot,d as Rt,b as yn}from"./use-mcp-tools-DVY8KcMA.js";import{c as eo,d as to,e as no,D as so,a as oo,b as ro}from"./dialog-zxbh5ng1.js";import"./index-CLwT6SqX.js";import{N as io,h as lo,j as co,m as Be,P as ao,i as uo,R as fo,c as mo,k as po,e as qt,d as xo}from"./index-nTgL534f.js";import{S as ho}from"./index-BOMQKZYe.js";import{D as vn,a as wn,b as Nn,c as Ye}from"./dropdown-menu-BHUBCwIp.js";import{s as go}from"./Plus-BPcc_-zf.js";import{b as kn}from"./Tool01-YKVy1yNP.js";import{i as He}from"./Check-BXg4TGxE.js";import{s as Mt}from"./XClose-CPKu5cnb.js";import{I as Lt}from"./integration-icon-BaScZvO6.js";import{a as bo,S as So}from"./scroll-area-9lFTzWCb.js";import"./index-CVz9D9gf.js";import{i as _n}from"./X-CNAnrf0f.js";import{u as Cn,a as jo}from"./use-collections-DaGR-TK3.js";import{E as In}from"./empty-state-16qSOU0O.js";import{c as yo}from"./create-sse-subscription-CxkOgzKf.js";import{I as Kt}from"./input-B0c-2DIW.js";const Tn=ne("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);const En=ne("Braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]);const ot=ne("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const rt=ne("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const vo=ne("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const $n=ne("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);const wo=ne("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const On=ne("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const Rn=ne("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);const Mn=ne("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);const No=ne("OctagonAlert",[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]]);const Ln=ne("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const Pn=ne("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);const ko=ne("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);const An=ne("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);function _o(t){const e=_.c(15),{onSave:n,onUndo:s,isDirty:i,isSaving:r,saveLabel:l,undoLabel:c}=t,a=l===void 0?"Save":l,u=c===void 0?"Undo":c;if(!i)return null;let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=o.jsx(Ds,{size:14}),e[0]=d):d=e[0];let f;e[1]!==r||e[2]!==s||e[3]!==u?(f=o.jsxs(te,{variant:"outline",size:"sm",onClick:s,disabled:r,"aria-label":u,children:[d,u]}),e[1]=r,e[2]=s,e[3]=u,e[4]=f):f=e[4];let m;e[5]!==r?(m=r?o.jsx(ln,{size:14,className:"animate-spin"}):o.jsx(Fs,{size:14}),e[5]=r,e[6]=m):m=e[6];let x;e[7]!==r||e[8]!==n||e[9]!==a||e[10]!==m?(x=o.jsxs(te,{variant:"default",size:"sm",onClick:n,disabled:r,"aria-label":a,children:[m,a]}),e[7]=r,e[8]=n,e[9]=a,e[10]=m,e[11]=x):x=e[11];let p;return e[12]!==f||e[13]!==x?(p=o.jsxs(o.Fragment,{children:[f,x]}),e[12]=f,e[13]=x,e[14]=p):p=e[14],p}const Bt=t=>{let e;const n=new Set,s=(u,d)=>{const f=typeof u=="function"?u(e):u;if(!Object.is(f,e)){const m=e;e=d??(typeof f!="object"||f===null)?f:Object.assign({},e,f),n.forEach(x=>x(e,m))}},i=()=>e,c={setState:s,getState:i,getInitialState:()=>a,subscribe:u=>(n.add(u),()=>n.delete(u))},a=e=t(s,i,c);return c},Pt=(t=>t?Bt(t):Bt),Co=t=>t;function _t(t,e=Co){const n=ze.useSyncExternalStore(t.subscribe,ze.useCallback(()=>e(t.getState()),[t,e]),ze.useCallback(()=>e(t.getInitialState()),[t,e]));return ze.useDebugValue(n),n}const Io=t=>{const e=Pt(t),n=s=>_t(e,s);return Object.assign(n,e),n},To=(t=>Io);function zn(t,e){let n;try{n=t()}catch{return}return{getItem:i=>{var r;const l=a=>a===null?null:JSON.parse(a,void 0),c=(r=n.getItem(i))!=null?r:null;return c instanceof Promise?c.then(l):l(c)},setItem:(i,r)=>n.setItem(i,JSON.stringify(r,void 0)),removeItem:i=>n.removeItem(i)}}const Ct=t=>e=>{try{const n=t(e);return n instanceof Promise?n:{then(s){return Ct(s)(n)},catch(s){return this}}}catch(n){return{then(s){return this},catch(s){return Ct(s)(n)}}}},Eo=(t,e)=>(n,s,i)=>{let r={storage:zn(()=>window.localStorage),partialize:g=>g,version:0,merge:(g,b)=>({...b,...g}),...e},l=!1,c=0;const a=new Set,u=new Set;let d=r.storage;if(!d)return t((...g)=>{console.warn(`[zustand persist middleware] Unable to update item '${r.name}', the given storage is currently unavailable.`),n(...g)},s,i);const f=()=>{const g=r.partialize({...s()});return d.setItem(r.name,{state:g,version:r.version})},m=i.setState;i.setState=(g,b)=>(m(g,b),f());const x=t((...g)=>(n(...g),f()),s,i);i.getInitialState=()=>x;let p;const h=()=>{var g,b;if(!d)return;const j=++c;l=!1,a.forEach(y=>{var S;return y((S=s())!=null?S:x)});const v=((b=r.onRehydrateStorage)==null?void 0:b.call(r,(g=s())!=null?g:x))||void 0;return Ct(d.getItem.bind(d))(r.name).then(y=>{if(y)if(typeof y.version=="number"&&y.version!==r.version){if(r.migrate){const S=r.migrate(y.state,y.version);return S instanceof Promise?S.then(w=>[!0,w]):[!0,S]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,y.state];return[!1,void 0]}).then(y=>{var S;if(j!==c)return;const[w,N]=y;if(p=r.merge(N,(S=s())!=null?S:x),n(p,!0),w)return f()}).then(()=>{j===c&&(v?.(s(),void 0),p=s(),l=!0,u.forEach(y=>y(p)))}).catch(y=>{j===c&&v?.(void 0,y)})};return i.persist={setOptions:g=>{r={...r,...g},g.storage&&(d=g.storage)},clearStorage:()=>{d?.removeItem(r.name)},getOptions:()=>r,rehydrate:()=>h(),hasHydrated:()=>l,onHydrate:g=>(a.add(g),()=>{a.delete(g)}),onFinishHydration:g=>(u.add(g),()=>{u.delete(g)})},r.skipHydration||h(),p||x},Wn=Eo,{useSyncExternalStoreWithSelector:$o}=ms,Oo=t=>t;function Ro(t,e=Oo,n){const s=$o(t.subscribe,t.getState,t.getInitialState,e,n);return ze.useDebugValue(s),s}const Xt=t=>Symbol.iterator in t,Jt=t=>"entries"in t,Gt=(t,e)=>{const n=t instanceof Map?t:new Map(t.entries()),s=e instanceof Map?e:new Map(e.entries());if(n.size!==s.size)return!1;for(const[i,r]of n)if(!s.has(i)||!Object.is(r,s.get(i)))return!1;return!0},Mo=(t,e)=>{const n=t[Symbol.iterator](),s=e[Symbol.iterator]();let i=n.next(),r=s.next();for(;!i.done&&!r.done;){if(!Object.is(i.value,r.value))return!1;i=n.next(),r=s.next()}return!!i.done&&!!r.done};function Lo(t,e){return Object.is(t,e)?!0:typeof t!="object"||t===null||typeof e!="object"||e===null||Object.getPrototypeOf(t)!==Object.getPrototypeOf(e)?!1:Xt(t)&&Xt(e)?Jt(t)&&Jt(e)?Gt(t,e):Mo(t,e):Gt({entries:()=>Object.entries(t)},{entries:()=>Object.entries(e)})}function Dn(t,e="Output"){if(!t)return`interface ${e} {}`;function n(r){if(!r||typeof r!="object")return"unknown";const l=r.type;if(Array.isArray(l))return l.map(c=>s(c)).join(" | ");switch(l){case"string":return r.enum?r.enum.map(c=>`"${c}"`).join(" | "):"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";case"array":{const c=r.items;return c?`${n(c)}[]`:"unknown[]"}case"object":return i(r);default:return r.anyOf?r.anyOf.map(n).join(" | "):r.oneOf?r.oneOf.map(n).join(" | "):r.allOf?r.allOf.map(n).join(" & "):"unknown"}}function s(r){switch(r){case"string":return"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";default:return"unknown"}}function i(r){const l=r.properties;if(!l)return"Record<string, unknown>";const c=new Set(r.required||[]);return`{
2
2
  ${Object.entries(l).map(([u,d])=>{const f=c.has(u)?"":"?";return`${d.description?` /** ${d.description} */
3
3
  `:""} ${u}${f}: ${n(d)};`}).join(`
4
4
  `)}
@@ -1 +1 @@
1
- import{P as z,a as G,D as H,o as J,p as Q}from"./index-B85sFotX.js";function V(x){var l;const{char:D,allowSpaces:b,allowToIncludeChar:P,allowedPrefixes:E,startOfLine:F,$position:v}=x,B=b&&!P,y=Q(D),K=new RegExp(`\\s${y}$`),h=F?"^":"",M=P?"":y,N=B?new RegExp(`${h}${y}.*?(?=\\s${M}|$)`,"gm"):new RegExp(`${h}(?:^)?${y}[^\\s${M}]*`,"gm"),q=((l=v.nodeBefore)==null?void 0:l.isText)&&v.nodeBefore.text;if(!q)return null;const O=v.pos-q.length,u=Array.from(q.matchAll(N)).pop();if(!u||u.input===void 0||u.index===void 0)return null;const d=u.input.slice(Math.max(0,u.index-1),u.index),e=new RegExp(`^[${E?.join("")}\0]?$`).test(d);if(E!==null&&!e)return null;const I=O+u.index;let p=I+u[0].length;return B&&K.test(q.slice(p-1,p+1))&&(u[0]+=" ",p+=1),I<v.pos&&p>=v.pos?{range:{from:I,to:p},query:u[0].slice(D.length),text:u[0]}:null}var W=new z("suggestion");function Y({pluginKey:x=W,editor:l,char:D="@",allowSpaces:b=!1,allowToIncludeChar:P=!1,allowedPrefixes:E=[" "],startOfLine:F=!1,decorationTag:v="span",decorationClass:B="suggestion",decorationContent:y="",decorationEmptyClass:K="is-empty",command:h=()=>null,items:M=()=>[],render:N=()=>({}),allow:q=()=>!0,findSuggestionMatch:O=V,shouldShow:u}){let d;const e=N?.(),I=()=>{const n=l.state.selection.$anchor.pos,a=l.view.coordsAtPos(n),{top:r,right:s,bottom:o,left:c}=a;try{return new DOMRect(c,r,s-c,o-r)}catch{return null}},p=(n,a)=>a?()=>{const r=x.getState(l.state),s=r?.decorationId,o=n.dom.querySelector(`[data-decoration-id="${s}"]`);return o?.getBoundingClientRect()||null}:I;function U(n,a){var r;try{const o=x.getState(n.state),c=o?.decorationId?n.dom.querySelector(`[data-decoration-id="${o.decorationId}"]`):null,g={editor:l,range:o?.range||{from:0,to:0},query:o?.query||null,text:o?.text||null,items:[],command:m=>h({editor:l,range:o?.range||{from:0,to:0},props:m}),decorationNode:c,clientRect:p(n,c)};(r=e?.onExit)==null||r.call(e,g)}catch{}const s=n.state.tr.setMeta(a,{exit:!0});n.dispatch(s)}const C=new G({key:x,view(){return{update:async(n,a)=>{var r,s,o,c,g,m,S;const t=(r=this.key)==null?void 0:r.getState(a),f=(s=this.key)==null?void 0:s.getState(n.state),i=t.active&&f.active&&t.range.from!==f.range.from,_=!t.active&&f.active,A=t.active&&!f.active,R=!_&&!A&&t.query!==f.query,w=_||i&&R,k=R||i,j=A||i&&R;if(!w&&!k&&!j)return;const $=j&&!w?t:f,T=n.dom.querySelector(`[data-decoration-id="${$.decorationId}"]`);d={editor:l,range:$.range,query:$.query,text:$.text,items:[],command:L=>h({editor:l,range:$.range,props:L}),decorationNode:T,clientRect:p(n,T)},w&&((o=e?.onBeforeStart)==null||o.call(e,d)),k&&((c=e?.onBeforeUpdate)==null||c.call(e,d)),(k||w)&&(d.items=await M({editor:l,query:$.query})),j&&((g=e?.onExit)==null||g.call(e,d)),k&&((m=e?.onUpdate)==null||m.call(e,d)),w&&((S=e?.onStart)==null||S.call(e,d))},destroy:()=>{var n;d&&((n=e?.onExit)==null||n.call(e,d))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(n,a,r,s){const{isEditable:o}=l,{composing:c}=l.view,{selection:g}=n,{empty:m,from:S}=g,t={...a},f=n.getMeta(x);if(f&&f.exit)return t.active=!1,t.decorationId=null,t.range={from:0,to:0},t.query=null,t.text=null,t;if(t.composing=c,o&&(m||l.view.composing)){(S<a.range.from||S>a.range.to)&&!c&&!a.composing&&(t.active=!1);const i=O({char:D,allowSpaces:b,allowToIncludeChar:P,allowedPrefixes:E,startOfLine:F,$position:g.$from}),_=`id_${Math.floor(Math.random()*4294967295)}`;i&&q({editor:l,state:s,range:i.range,isActive:a.active})&&(!u||u({editor:l,range:i.range,query:i.query,text:i.text,transaction:n}))?(t.active=!0,t.decorationId=a.decorationId?a.decorationId:_,t.range=i.range,t.query=i.query,t.text=i.text):t.active=!1}else t.active=!1;return t.active||(t.decorationId=null,t.range={from:0,to:0},t.query=null,t.text=null),t}},props:{handleKeyDown(n,a){var r,s,o,c;const{active:g,range:m}=C.getState(n.state);if(!g)return!1;if(a.key==="Escape"||a.key==="Esc"){const t=C.getState(n.state),f=(r=d?.decorationNode)!=null?r:null,i=f??(t?.decorationId?n.dom.querySelector(`[data-decoration-id="${t.decorationId}"]`):null);if(((s=e?.onKeyDown)==null?void 0:s.call(e,{view:n,event:a,range:t.range}))||!1)return!0;const A={editor:l,range:t.range,query:t.query,text:t.text,items:[],command:R=>h({editor:l,range:t.range,props:R}),decorationNode:i,clientRect:i?()=>i.getBoundingClientRect()||null:null};return(o=e?.onExit)==null||o.call(e,A),U(n,x),!0}return((c=e?.onKeyDown)==null?void 0:c.call(e,{view:n,event:a,range:m}))||!1},decorations(n){const{active:a,range:r,decorationId:s,query:o}=C.getState(n);if(!a)return null;const c=!o?.length,g=[B];return c&&g.push(K),H.create(n.doc,[J.inline(r.from,r.to,{nodeName:v,class:g.join(" "),"data-decoration-id":s,"data-decoration-content":y})])}}});return C}export{Y as S};
1
+ import{P as z,a as G,D as H,o as J,p as Q}from"./index-nTgL534f.js";function V(x){var l;const{char:D,allowSpaces:b,allowToIncludeChar:P,allowedPrefixes:E,startOfLine:F,$position:v}=x,B=b&&!P,y=Q(D),K=new RegExp(`\\s${y}$`),h=F?"^":"",M=P?"":y,N=B?new RegExp(`${h}${y}.*?(?=\\s${M}|$)`,"gm"):new RegExp(`${h}(?:^)?${y}[^\\s${M}]*`,"gm"),q=((l=v.nodeBefore)==null?void 0:l.isText)&&v.nodeBefore.text;if(!q)return null;const O=v.pos-q.length,u=Array.from(q.matchAll(N)).pop();if(!u||u.input===void 0||u.index===void 0)return null;const d=u.input.slice(Math.max(0,u.index-1),u.index),e=new RegExp(`^[${E?.join("")}\0]?$`).test(d);if(E!==null&&!e)return null;const I=O+u.index;let p=I+u[0].length;return B&&K.test(q.slice(p-1,p+1))&&(u[0]+=" ",p+=1),I<v.pos&&p>=v.pos?{range:{from:I,to:p},query:u[0].slice(D.length),text:u[0]}:null}var W=new z("suggestion");function Y({pluginKey:x=W,editor:l,char:D="@",allowSpaces:b=!1,allowToIncludeChar:P=!1,allowedPrefixes:E=[" "],startOfLine:F=!1,decorationTag:v="span",decorationClass:B="suggestion",decorationContent:y="",decorationEmptyClass:K="is-empty",command:h=()=>null,items:M=()=>[],render:N=()=>({}),allow:q=()=>!0,findSuggestionMatch:O=V,shouldShow:u}){let d;const e=N?.(),I=()=>{const n=l.state.selection.$anchor.pos,a=l.view.coordsAtPos(n),{top:r,right:s,bottom:o,left:c}=a;try{return new DOMRect(c,r,s-c,o-r)}catch{return null}},p=(n,a)=>a?()=>{const r=x.getState(l.state),s=r?.decorationId,o=n.dom.querySelector(`[data-decoration-id="${s}"]`);return o?.getBoundingClientRect()||null}:I;function U(n,a){var r;try{const o=x.getState(n.state),c=o?.decorationId?n.dom.querySelector(`[data-decoration-id="${o.decorationId}"]`):null,g={editor:l,range:o?.range||{from:0,to:0},query:o?.query||null,text:o?.text||null,items:[],command:m=>h({editor:l,range:o?.range||{from:0,to:0},props:m}),decorationNode:c,clientRect:p(n,c)};(r=e?.onExit)==null||r.call(e,g)}catch{}const s=n.state.tr.setMeta(a,{exit:!0});n.dispatch(s)}const C=new G({key:x,view(){return{update:async(n,a)=>{var r,s,o,c,g,m,S;const t=(r=this.key)==null?void 0:r.getState(a),f=(s=this.key)==null?void 0:s.getState(n.state),i=t.active&&f.active&&t.range.from!==f.range.from,_=!t.active&&f.active,A=t.active&&!f.active,R=!_&&!A&&t.query!==f.query,w=_||i&&R,k=R||i,j=A||i&&R;if(!w&&!k&&!j)return;const $=j&&!w?t:f,T=n.dom.querySelector(`[data-decoration-id="${$.decorationId}"]`);d={editor:l,range:$.range,query:$.query,text:$.text,items:[],command:L=>h({editor:l,range:$.range,props:L}),decorationNode:T,clientRect:p(n,T)},w&&((o=e?.onBeforeStart)==null||o.call(e,d)),k&&((c=e?.onBeforeUpdate)==null||c.call(e,d)),(k||w)&&(d.items=await M({editor:l,query:$.query})),j&&((g=e?.onExit)==null||g.call(e,d)),k&&((m=e?.onUpdate)==null||m.call(e,d)),w&&((S=e?.onStart)==null||S.call(e,d))},destroy:()=>{var n;d&&((n=e?.onExit)==null||n.call(e,d))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(n,a,r,s){const{isEditable:o}=l,{composing:c}=l.view,{selection:g}=n,{empty:m,from:S}=g,t={...a},f=n.getMeta(x);if(f&&f.exit)return t.active=!1,t.decorationId=null,t.range={from:0,to:0},t.query=null,t.text=null,t;if(t.composing=c,o&&(m||l.view.composing)){(S<a.range.from||S>a.range.to)&&!c&&!a.composing&&(t.active=!1);const i=O({char:D,allowSpaces:b,allowToIncludeChar:P,allowedPrefixes:E,startOfLine:F,$position:g.$from}),_=`id_${Math.floor(Math.random()*4294967295)}`;i&&q({editor:l,state:s,range:i.range,isActive:a.active})&&(!u||u({editor:l,range:i.range,query:i.query,text:i.text,transaction:n}))?(t.active=!0,t.decorationId=a.decorationId?a.decorationId:_,t.range=i.range,t.query=i.query,t.text=i.text):t.active=!1}else t.active=!1;return t.active||(t.decorationId=null,t.range={from:0,to:0},t.query=null,t.text=null),t}},props:{handleKeyDown(n,a){var r,s,o,c;const{active:g,range:m}=C.getState(n.state);if(!g)return!1;if(a.key==="Escape"||a.key==="Esc"){const t=C.getState(n.state),f=(r=d?.decorationNode)!=null?r:null,i=f??(t?.decorationId?n.dom.querySelector(`[data-decoration-id="${t.decorationId}"]`):null);if(((s=e?.onKeyDown)==null?void 0:s.call(e,{view:n,event:a,range:t.range}))||!1)return!0;const A={editor:l,range:t.range,query:t.query,text:t.text,items:[],command:R=>h({editor:l,range:t.range,props:R}),decorationNode:i,clientRect:i?()=>i.getBoundingClientRect()||null:null};return(o=e?.onExit)==null||o.call(e,A),U(n,x),!0}return((c=e?.onKeyDown)==null?void 0:c.call(e,{view:n,event:a,range:m}))||!1},decorations(n){const{active:a,range:r,decorationId:s,query:o}=C.getState(n);if(!a)return null;const c=!o?.length,g=[B];return c&&g.push(K),H.create(n.doc,[J.inline(r.from,r.to,{nodeName:v,class:g.join(" "),"data-decoration-id":s,"data-decoration-content":y})])}}});return C}export{Y as S};
@@ -0,0 +1 @@
1
+ import{e as R,s as he,f as Se,U as St,g as et,d as Ct,W as xs,X as ps,Y as hs,j as s,Z as gs,c as J,t as se,r as S,$ as Nt,a0 as kt,H as bs,J as js,D as vs,z as _s,a as ys,B as Qe,b as _e,a1 as Ss,P as wt,x as be,a2 as Cs,a3 as Ns,o as Be,a4 as ks,a5 as ws,a6 as Is,a7 as Ms,a8 as Oe,a9 as As,aa as $s,ab as Os,ac as zs,ad as It,ae as Ps,af as Ts,ag as Rs,ah as Es,ai as Ds,aj as Ls,ak as Fs,al as Us,am as Gs,an as Bs,ao as Hs,L as Vs,E as tt,K as Mt}from"./index-CzOMQ7ME.js";import{p as Ks,g as Ws,C as qs,D as lt,E as rt,F as Qs,G as at,H as Ys,A as $e,j as Xs,I as Js,J as Zs}from"./agent-icon-ChigV_SM.js";import{i as en}from"./LayoutLeft-Br6mPXCN.js";import{u as At,r as tn}from"./shell-layout-DbyGG6Wz.js";import{f as sn,g as nn}from"./pair-Bg3A59Mm.js";import{f as Pe,g as Te,h as pe,u as He,i as xe,j as le,k as $t,l as Ot,m as on,n as zt,o as Pt}from"./sidebar-CHkSPfi1.js";import{S as Ue}from"./skeleton-BhYsT5bA.js";import{b as st,P as nt,a as ot}from"./popover-DVDtU_6G.js";import{b as Tt,a as Rt,D as Et}from"./drawer-DNDd7AZJ.js";import{A as ct}from"./avatar-DLcW-A0B.js";import{u as Dt,T as Ye,a as Xe,c as dt,b as Je}from"./tooltip-Dk-x7ks3.js";import{i as Lt}from"./Check-BXg4TGxE.js";import{c as ut,a as ln,e as rn}from"./XCircle-QSJN9xhv.js";import{i as an,b as cn}from"./ZapSquare-D07uWeTi.js";import{n as dn,a as un,i as mn}from"./Sun-CBmGK6wu.js";import{s as Ge}from"./Plus-BPcc_-zf.js";import{a as Ve}from"./Settings02-B5jIAnK4.js";import{i as fn}from"./Shield01-CKYDfpKE.js";import{a as Ft}from"./Users03-C4su_vOM.js";import{f as xn,a as pn,b as hn,c as gn,d as bn,e as jn,A as vn}from"./alert-dialog-B-CFL8EO.js";import{F as _n,a as yn,b as Sn,c as Cn,d as Nn,e as kn,f as wn}from"./form-DK_rcfC8.js";import{I as In}from"./input-B0c-2DIW.js";import{S as Mn}from"./spinner-DRDdaYJh.js";import"./index-CVz9D9gf.js";import{s as An}from"./XClose-CPKu5cnb.js";import{S as Ut,u as Gt,W as ze,i as $n,b as On}from"./constants-CrCZOO5F.js";import{u as zn}from"./use-mcp-tools-DVY8KcMA.js";import{u as Pn}from"./use-ai-providers-Bo9kqLtW.js";import{A as Tn,h as Rn,i as En,j as Dn,k as Ln,C as Fn}from"./index-DHNiGAXq.js";import{u as Un,a as mt,K as Gn,P as Bn,S as Hn,v as Vn,D as Kn,c as Wn,s as qn,b as Qn,d as Yn,C as Xn,e as Jn}from"./collection-search-BCf7pr5A.js";import{i as ft}from"./X-CNAnrf0f.js";import{b as Bt,u as Ht}from"./use-virtual-mcp-lxX8wI4d.js";import{u as Vt,a as Zn}from"./use-navigate-to-agent-BQ5qza3f.js";import{u as eo}from"./use-create-virtual-mcp-CCKFB_a7.js";import{I as to,a as so,S as no,L as oo,b as io,G as lo}from"./lean-canvas-recruit-modal-CHTxHUjM.js";import{u as ro}from"./use-tasks-ChwW8r_K.js";import{E as ao}from"./empty-state-9cIH1OSj.js";import{e as xt,f as co}from"./chat-context-C_XiURbM.js";import{u as uo}from"./use-decopilot-events-Co1GYuP2.js";import{g as Kt,a as pt,b as ht,h as gt,D as bt}from"./dropdown-menu-BHUBCwIp.js";import{i as mo}from"./Archive-BKT9Dg_O.js";import{i as fo}from"./Zap-B4MS-NKo.js";import{g as xo}from"./task-status-BMDGQef8.js";function Wt(){const t=R.c(77),{org:e}=he(),n=Se(),o=St(),{setTasksOpen:i,openTab:l}=At(),r=e.slug,a=he().project;let c;t[0]===Symbol.for("react.memo_cache_sentinel")?(c={strict:!1},t[0]=c):c=t[0];const u=et(c);let d;t[1]===Symbol.for("react.memo_cache_sentinel")?(d={strict:!1},t[1]=d):d=t[1];const m=Ct(d),x=o.location.pathname;let f;t[2]!==a.enabledPlugins?(f=a.enabledPlugins??[],t[2]=a.enabledPlugins,t[3]=f):f=t[3];const p=f;let C;t[4]!==a.ui?(C=a.ui?.pinnedViews??[],t[4]=a.ui,t[5]=C):C=t[5];const $=C;let g,N,h,y;if(t[6]!==a.id||t[7]!==p||t[8]!==n||t[9]!==r||t[10]!==u.pluginId||t[11]!==u.taskId||t[12]!==m.virtualmcpid){let _;t[17]!==p?(_=X=>p.includes(X.pluginId),t[17]=p,t[18]=_):_=t[18];const K=xs.filter(_),W=m.virtualmcpid??a.id;N=!!m.virtualmcpid;const G=u.taskId??"",Y=u.pluginId;let ee;t[19]!==Y?(ee=X=>Y===X,t[19]=Y,t[20]=ee):ee=t[20],g=ee;let Z;t[21]!==G||t[22]!==n||t[23]!==r||t[24]!==W?(Z=X=>{const oe=G||crypto.randomUUID();n({to:"/$org/$taskId/$pluginId",params:{org:r,taskId:oe,pluginId:X},search:re=>({...re,virtualmcpid:W})})},t[21]=G,t[22]=n,t[23]=r,t[24]=W,t[25]=Z):Z=t[25],h=Z;let ne;t[26]!==g||t[27]!==h?(ne=X=>({key:X.pluginId,label:X.label,icon:X.icon,isActive:g(X.pluginId),onClick:()=>h(X.pluginId)}),t[26]=g,t[27]=h,t[28]=ne):ne=t[28],y=K.map(ne),t[6]=a.id,t[7]=p,t[8]=n,t[9]=r,t[10]=u.pluginId,t[11]=u.taskId,t[12]=m.virtualmcpid,t[13]=g,t[14]=N,t[15]=h,t[16]=y}else g=t[13],N=t[14],h=t[15],y=t[16];const j=y;let b;if(t[29]!==p||t[30]!==g||t[31]!==h){let _;t[33]!==p?(_=G=>p.includes(G.pluginId),t[33]=p,t[34]=_):_=t[34];const K=ps.filter(_);let W;t[35]!==g||t[36]!==h?(W=G=>({type:"group",group:{id:`${G.pluginId}-${G.id}`,label:G.label,items:G.items.map((Y,ee)=>({key:`${G.pluginId}-${G.id}-${ee}`,label:Y.label,icon:Y.icon,isActive:g(G.pluginId),onClick:()=>h(G.pluginId)})),defaultExpanded:G.defaultExpanded??!0}}),t[35]=g,t[36]=h,t[37]=W):W=t[37],b=K.map(W),t[29]=p,t[30]=g,t[31]=h,t[32]=b}else b=t[32];const v=b;let I;if(t[38]!==l||t[39]!==$){let _;t[41]!==l?(_=K=>{const W=Ks(K.icon),G=W.type==="icon"?Ws(W.name):null;return{key:`app-${K.connectionId}-${K.toolName}`,label:K.label||K.toolName,icon:G?s.jsx(G,{size:16,className:"text-muted-foreground"}):W.type==="url"?s.jsx("img",{src:W.url,alt:"",className:"size-4 rounded"}):s.jsx(en,{size:16,className:"text-muted-foreground"}),isActive:!1,onClick:()=>l(sn(K.connectionId,K.toolName))}},t[41]=l,t[42]=_):_=t[42],I=$.map(_),t[38]=l,t[39]=$,t[40]=I}else I=t[40];const F=I;let O;t[43]!==F?(O=F.length>0?{type:"group",group:{id:"apps",label:"Apps",items:F,defaultExpanded:!0}}:null,t[43]=F,t[44]=O):O=t[44];const z=O;let E;t[45]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsx(qs,{className:"size-4!"}),t[45]=E):E=t[45];const P=x===`/${r}`||x===`/${r}/`;let k;t[46]!==n||t[47]!==r||t[48]!==i?(k=()=>{i(!1),n({to:"/$org",params:{org:r}})},t[46]=n,t[47]=r,t[48]=i,t[49]=k):k=t[49];let w;t[50]!==k||t[51]!==P?(w={key:"home",label:"Home",icon:E,isActive:P,onClick:k},t[50]=k,t[51]=P,t[52]=w):w=t[52];const M=w;let D;t[53]!==p?(D=p.includes(hs),t[53]=p,t[54]=D):D=t[54];const A=D;let B;t[55]===Symbol.for("react.memo_cache_sentinel")?(B=s.jsx(gs,{className:"size-4!"}),t[55]=B):B=t[55];let U;t[56]!==r||t[57]!==x?(U=x.startsWith(`/${r}/settings/workflows`),t[56]=r,t[57]=x,t[58]=U):U=t[58];let L;t[59]!==n||t[60]!==r?(L=()=>n({to:"/$org/settings/workflows",params:{org:r}}),t[59]=n,t[60]=r,t[61]=L):L=t[61];let H;t[62]!==U||t[63]!==L?(H={key:"workflows",label:"Workflows",icon:B,isActive:U,onClick:L},t[62]=U,t[63]=L,t[64]=H):H=t[64];const V=H;let q;if(t[65]!==M||t[66]!==N||t[67]!==A||t[68]!==V){const _=[M];N&&A&&_.push(V),q={type:"items",items:_},t[65]=M,t[66]=N,t[67]=A,t[68]=V,t[69]=q}else q=t[69];let Q;if(t[70]!==z||t[71]!==v||t[72]!==j||t[73]!==q){if(Q=[q],j.length>0){let _;t[75]!==j?(_={type:"items",items:j},t[75]=j,t[76]=_):_=t[76],Q.push(_)}v.length>0&&Q.push(...v),z&&Q.push(z),t[70]=z,t[71]=v,t[72]=j,t[73]=q,t[74]=Q}else Q=t[74];return Q}function qt(t){const e=R.c(3),{children:n}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=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]=o):o=e[0];let i;return e[1]!==n?(i=s.jsxs(Pe,{className:"pt-0 pr-0 pb-2 pl-0 mt-2",children:[o,s.jsx(Te,{children:s.jsx(pe,{className:"gap-0.5",children:n})})]}),e[1]=n,e[2]=i):i=e[2],i}function po(){const t=R.c(7),n=Nt().logo??kt,o=typeof n=="string"?n:n.light,i=typeof n=="string"?n:n.dark;let l;t[0]!==o?(l=s.jsx("img",{src:o,alt:"Logo",className:"size-6 object-contain dark:hidden"}),t[0]=o,t[1]=l):l=t[1];let r;t[2]!==i?(r=s.jsx("img",{src:i,alt:"Logo",className:"size-6 object-contain hidden dark:block"}),t[2]=i,t[3]=r):r=t[3];let a;return t[4]!==l||t[5]!==r?(a=s.jsx(zt,{className:"flex items-center justify-center shrink-0 px-2 pb-0",children:s.jsxs("div",{className:"flex w-full aspect-square items-center justify-center",children:[l,r]})}),t[4]=l,t[5]=r,t[6]=a):a=t[6],a}function Qt(t){const e=R.c(15),{item:n}=t,{isMobile:o,setOpenMobile:i}=He();let l;e[0]!==o||e[1]!==n||e[2]!==i?(l=()=>{se("nav_item_clicked",{nav_key:n.key,nav_label:n.label,is_active:!!n.isActive,is_mobile:o}),n.onClick?.(),o&&i(!1)},e[0]=o,e[1]=n,e[2]=i,e[3]=l):l=e[3];const r=l,a=n.key,c=n.isActive&&"z-10";let u;e[4]!==c?(u=J(c),e[4]=c,e[5]=u):u=e[5];let d;e[6]!==r||e[7]!==n.icon||e[8]!==n.isActive||e[9]!==n.label?(d=s.jsx(xe,{onClick:r,isActive:n.isActive,tooltip:n.label,className:"bg-muted/75",children:n.icon}),e[6]=r,e[7]=n.icon,e[8]=n.isActive,e[9]=n.label,e[10]=d):d=e[10];let m;return e[11]!==n.key||e[12]!==u||e[13]!==d?(m=s.jsx(le,{className:u,children:d},a),e[11]=n.key,e[12]=u,e[13]=d,e[14]=m):m=e[14],m}function ho(t){const e=R.c(12),{section:n}=t;switch(n.type){case"divider":{let o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx($t,{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;e[2]!==n.group.items?(l=n.group.items.map(bo),e[2]=n.group.items,e[3]=l):l=e[3];let r;return e[4]!==n.group.defaultExpanded||e[5]!==n.group.label||e[6]!==l?(r=s.jsx(qt,{label:o,defaultExpanded:i,children:l}),e[4]=n.group.defaultExpanded,e[5]=n.group.label,e[6]=l,e[7]=r):r=e[7],r}case"items":{let o;e[8]!==n.items?(o=n.items.map(go),e[8]=n.items,e[9]=o):o=e[9];let i;return e[10]!==o?(i=s.jsx(Pe,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(Te,{children:s.jsx(pe,{className:"gap-1.5",children:o})})}),e[10]=o,e[11]=i):i=e[11],i}}}function go(t){return s.jsx(Qt,{item:t},t.key)}function bo(t){return s.jsx(Qt,{item:t},t.key)}function jo(t){const e=R.c(14),{sections:n,header:o,footer:i,additionalContent:l,variant:r,contentClassName:a}=t,c=r===void 0?"sidebar":r;let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(S.Suspense,{fallback:s.jsx("div",{className:"h-10 shrink-0"}),children:s.jsx(po,{})}),e[0]=u):u=e[0];let d;e[1]!==a?(d=J("flex flex-col flex-1 px-2 py-2 gap-0",a),e[1]=a,e[2]=d):d=e[2];let m;e[3]!==n?(m=n.map(vo),e[3]=n,e[4]=m):m=e[4];let x;e[5]!==l||e[6]!==d||e[7]!==m?(x=s.jsxs(Ot,{className:d,children:[m,l]}),e[5]=l,e[6]=d,e[7]=m,e[8]=x):x=e[8];let f;return e[9]!==i||e[10]!==o||e[11]!==x||e[12]!==c?(f=s.jsxs(on,{variant:c,children:[u,o,x,i]}),e[9]=i,e[10]=o,e[11]=x,e[12]=c,e[13]=f):f=e[13],f}function vo(t,e){return s.jsx(ho,{section:t},e)}function Yt(t){const e=R.c(2);let n;return e[0]!==t?(n=s.jsx(jo,{...t}),e[0]=t,e[1]=n):n=e[1],n}Yt.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(Ue,{className:"h-full bg-sidebar-accent rounded-md"})},n))})};function _o(){const t=R.c(7),n=Nt().logo??kt,o=typeof n=="string"?n:n.light,i=typeof n=="string"?n:n.dark;let l;t[0]!==o?(l=s.jsx("img",{src:o,alt:"Logo",className:"size-6 object-contain dark:hidden"}),t[0]=o,t[1]=l):l=t[1];let r;t[2]!==i?(r=s.jsx("img",{src:i,alt:"Logo",className:"size-6 object-contain hidden dark:block"}),t[2]=i,t[3]=r):r=t[3];let a;return t[4]!==l||t[5]!==r?(a=s.jsx(zt,{className:"flex items-center justify-center shrink-0 px-2 pb-0",children:s.jsxs("div",{className:"flex w-full aspect-square items-center justify-center",children:[l,r]})}),t[4]=l,t[5]=r,t[6]=a):a=t[6],a}function jt(t){const e=R.c(15),{item:n,onClose:o}=t,i=n.isActive&&"z-10";let l;e[0]!==i?(l=J(i),e[0]=i,e[1]=l):l=e[1];let r;e[2]!==n||e[3]!==o?(r=()=>{n.onClick?.(),o()},e[2]=n,e[3]=o,e[4]=r):r=e[4];let a;e[5]!==n.icon?(a=s.jsx("span",{className:"[&>svg]:size-8",children:n.icon}),e[5]=n.icon,e[6]=a):a=e[6];let c;e[7]!==n.isActive||e[8]!==n.label||e[9]!==r||e[10]!==a?(c=s.jsx(xe,{onClick:r,isActive:n.isActive,tooltip:n.label,className:"bg-muted/75",children:a}),e[7]=n.isActive,e[8]=n.label,e[9]=r,e[10]=a,e[11]=c):c=e[11];let u;return e[12]!==l||e[13]!==c?(u=s.jsx(le,{className:l,children:c}),e[12]=l,e[13]=c,e[14]=u):u=e[14],u}function yo(t){const e=R.c(18),{section:n,onClose:o}=t;switch(n.type){case"divider":{let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx($t,{className:"my-2"}),e[0]=i):i=e[0],i}case"spacer":{let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"flex-1"}),e[1]=i):i=e[1],i}case"group":{const i=n.group.label,l=n.group.defaultExpanded;let r;if(e[2]!==o||e[3]!==n.group.items){let c;e[5]!==o?(c=u=>s.jsx(jt,{item:u,onClose:o},u.key),e[5]=o,e[6]=c):c=e[6],r=n.group.items.map(c),e[2]=o,e[3]=n.group.items,e[4]=r}else r=e[4];let a;return e[7]!==n.group.defaultExpanded||e[8]!==n.group.label||e[9]!==r?(a=s.jsx(qt,{label:i,defaultExpanded:l,children:r}),e[7]=n.group.defaultExpanded,e[8]=n.group.label,e[9]=r,e[10]=a):a=e[10],a}case"items":{let i;if(e[11]!==o||e[12]!==n.items){let r;e[14]!==o?(r=a=>s.jsx(jt,{item:a,onClose:o},a.key),e[14]=o,e[15]=r):r=e[15],i=n.items.map(r),e[11]=o,e[12]=n.items,e[13]=i}else i=e[13];let l;return e[16]!==i?(l=s.jsx(Pe,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(Te,{children:s.jsx(pe,{className:"gap-1.5",children:i})})}),e[16]=i,e[17]=l):l=e[17],l}}}function So(t){const e=R.c(12),{sections:n,onClose:o,footer:i,additionalContent:l}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(S.Suspense,{fallback:s.jsx("div",{className:"h-10 shrink-0"}),children:s.jsx(_o,{})}),e[0]=r):r=e[0];let a;if(e[1]!==o||e[2]!==n){let d;e[4]!==o?(d=(m,x)=>s.jsx(yo,{section:m,onClose:o},x),e[4]=o,e[5]=d):d=e[5],a=n.map(d),e[1]=o,e[2]=n,e[3]=a}else a=e[3];let c;e[6]!==l||e[7]!==a?(c=s.jsxs(Ot,{className:"flex flex-col flex-1 px-2 py-2 gap-0",children:[a,l]}),e[6]=l,e[7]=a,e[8]=c):c=e[8];let u;return e[9]!==i||e[10]!==c?(u=s.jsxs("div",{className:"bg-sidebar flex h-full w-full flex-col","data-sidebar":"sidebar",children:[r,c,i]}),e[9]=i,e[10]=c,e[11]=u):u=e[11],u}function Xt(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Co=bs({name:js().min(2,"Organization name is required")});function No(t){const e=R.c(41),{open:n,onOpenChange:o}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={resolver:vs(Co),defaultValues:{name:""}},e[0]=i):i=e[0];const l=_s(i);let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r={mutationFn:wo,onSuccess:ko},e[1]=r):r=e[1];const a=ys(r),c=a.error instanceof Error?a.error.message:a.error?"Failed to create organization.":null;let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsxs(hn,{children:[s.jsx(gn,{children:"Create a new organization"}),s.jsx(bn,{children:"Set up a new organization to collaborate with others."})]}),e[2]=u):u=e[2];let d;if(e[3]!==a||e[4]!==l){let v;e[6]!==a?(v=I=>a.mutateAsync(I),e[6]=a,e[7]=v):v=e[7],d=l.handleSubmit(v),e[3]=a,e[4]=l,e[5]=d}else d=e[5];let m;e[8]!==l.formState.isSubmitting?(m=v=>{const{field:I}=v;return s.jsxs(Sn,{children:[s.jsx(Cn,{children:"Organization Name"}),s.jsx(Nn,{children:s.jsx(In,{...I,placeholder:"Acme Inc.",disabled:l.formState.isSubmitting})}),s.jsx(kn,{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:"","/",Xt(I.value)]})]}),s.jsx(wn,{})]})},e[8]=l.formState.isSubmitting,e[9]=m):m=e[9];let x;e[10]!==l.control||e[11]!==m?(x=s.jsx(_n,{control:l.control,name:"name",render:m}),e[10]=l.control,e[11]=m,e[12]=x):x=e[12];let f;e[13]!==c?(f=c&&s.jsx("div",{className:"text-destructive text-sm mt-2",children:c}),e[13]=c,e[14]=f):f=e[14];let p;e[15]!==a||e[16]!==l?(p=()=>{a.reset(),l.reset()},e[15]=a,e[16]=l,e[17]=p):p=e[17];let C;e[18]!==l.formState.isSubmitting||e[19]!==p?(C=s.jsx(xn,{disabled:l.formState.isSubmitting,onClick:p,children:"Cancel"}),e[18]=l.formState.isSubmitting,e[19]=p,e[20]=C):C=e[20];const $=!l.formState.isValid||l.formState.isSubmitting;let g;e[21]!==l.formState.isSubmitting?(g=l.formState.isSubmitting?s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(Mn,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=l.formState.isSubmitting,e[22]=g):g=e[22];let N;e[23]!==$||e[24]!==g?(N=s.jsx(Qe,{type:"submit",variant:"default",disabled:$,children:g}),e[23]=$,e[24]=g,e[25]=N):N=e[25];let h;e[26]!==N||e[27]!==C?(h=s.jsxs(jn,{children:[C,N]}),e[26]=N,e[27]=C,e[28]=h):h=e[28];let y;e[29]!==h||e[30]!==d||e[31]!==x||e[32]!==f?(y=s.jsxs("form",{className:"space-y-6",onSubmit:d,autoComplete:"off",children:[x,f,h]}),e[29]=h,e[30]=d,e[31]=x,e[32]=f,e[33]=y):y=e[33];let j;e[34]!==l||e[35]!==y?(j=s.jsxs(pn,{children:[u,s.jsx(yn,{...l,children:y})]}),e[34]=l,e[35]=y,e[36]=j):j=e[36];let b;return e[37]!==o||e[38]!==n||e[39]!==j?(b=s.jsx(vn,{open:n,onOpenChange:o,children:j}),e[37]=o,e[38]=n,e[39]=j,e[40]=b):b=e[40],b}function ko(t){const{orgSlug:e}=t;window.location.href=`/${e}`}async function wo(t){const e=Xt(t.name);if(!e)throw new Error("Organization slug is invalid");const n=await _e.organization.create({name:t.name,slug:e});if(n?.error)throw new Error(n.error.message||"Failed to create organization");const o=n?.data?.slug??e;if(!o)throw new Error("Failed to create organization");return{orgSlug:o}}function Ze(t){let e=0;for(let o=0;o<t.length;o++)e=t.charCodeAt(o)+((e<<5)-e);const n=Math.abs(e)%360;return{backgroundColor:`hsl(${n} 55% 70%)`,color:`hsl(${n} 55% 20%)`}}function Io(t){const e=R.c(13),{org:n,size:o}=t,i=o===void 0?"sm":o,l=i==="xs"?"size-5":"size-6",r=i==="xs"?"text-[9px]":"text-xs";let a;e[0]!==l?(a=J(l,"shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=l,e[1]=a):a=e[1];let c;e[2]!==n.logo||e[3]!==n.name?(c=n.logo?void 0:Ze(n.name),e[2]=n.logo,e[3]=n.name,e[4]=c):c=e[4];let u;e[5]!==n.logo||e[6]!==n.name||e[7]!==r?(u=n.logo?s.jsx("img",{src:n.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:J("font-semibold leading-none",r),children:n.name.slice(0,2).toUpperCase()}),e[5]=n.logo,e[6]=n.name,e[7]=r,e[8]=u):u=e[8];let d;return e[9]!==a||e[10]!==c||e[11]!==u?(d=s.jsx("div",{className:a,style:c,children:u}),e[9]=a,e[10]=c,e[11]=u,e[12]=d):d=e[12],d}function Le(t){const e=R.c(22),{item:n,onClose:o}=t;if(n.href){const c=n.external?"_blank":void 0,u=n.external?"noopener noreferrer":void 0;let d;e[0]!==n.icon?(d=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[0]=n.icon,e[1]=d):d=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 x;return e[4]!==n.href||e[5]!==o||e[6]!==c||e[7]!==u||e[8]!==d||e[9]!==m?(x=s.jsxs("a",{href:n.href,target:c,rel:u,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:o,children:[d,m]}),e[4]=n.href,e[5]=o,e[6]=c,e[7]=u,e[8]=d,e[9]=m,e[10]=x):x=e[10],x}let i;e[11]!==n||e[12]!==o?(i=()=>{n.onClick?.(),o()},e[11]=n,e[12]=o,e[13]=i):i=e[13];let l;e[14]!==n.icon?(l=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[14]=n.icon,e[15]=l):l=e[15];let r;e[16]!==n.label?(r=s.jsx("span",{className:"flex-1",children:n.label}),e[16]=n.label,e[17]=r):r=e[17];let a;return e[18]!==i||e[19]!==l||e[20]!==r?(a=s.jsxs("button",{type:"button",onClick:i,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:[l,r]}),e[18]=i,e[19]=l,e[20]=r,e[21]=a):a=e[21],a}function vt(t){const e=R.c(16),{sortedOrgs:n,orgParam:o,onSelectOrg:i,onCreateOrg:l}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("span",{className:"text-sm font-medium text-muted-foreground/60",children:"Your Organizations"}),e[0]=r):r=e[0];let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Ge,{size:16}),e[1]=a):a=e[1];let c;e[2]!==l?(c=s.jsxs("div",{className:"flex items-center justify-between px-4 py-3",children:[r,s.jsx("button",{type:"button",onClick:l,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:a})]}),e[2]=l,e[3]=c):c=e[3];let u;if(e[4]!==i||e[5]!==o||e[6]!==n){let x;e[8]!==i||e[9]!==o?(x=f=>s.jsxs("button",{type:"button",onClick:()=>i(f.slug),className:J("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",f.slug===o?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50"),children:[s.jsx(Io,{org:f,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:f.name}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:f.slug})]}),f.slug===o&&s.jsx(Lt,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},f.id),e[8]=i,e[9]=o,e[10]=x):x=e[10],u=n.map(x),e[4]=i,e[5]=o,e[6]=n,e[7]=u}else u=e[7];let d;e[11]!==u?(d=s.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto p-1.5 flex flex-col gap-1",children:u}),e[11]=u,e[12]=d):d=e[12];let m;return e[13]!==c||e[14]!==d?(m=s.jsxs(s.Fragment,{children:[c,d]}),e[13]=c,e[14]=d,e[15]=m):m=e[15],m}function _t(t){const e=R.c(142),{user:n,userImage:o,menuItems:i,signOutItem:l,themeOptions:r,preferences:a,setPreferences:c,sortedOrgs:u,orgParam:d,onSelectOrg:m,onCreateOrg:x,close:f,isMobile:p}=t;if(p){const G=n?.name??"U";let Y;e[0]!==G||e[1]!==o?(Y=s.jsx(ct,{url:o,fallback:G,shape:"circle",size:"sm",className:"shrink-0"}),e[0]=G,e[1]=o,e[2]=Y):Y=e[2];const ee=n?.name??"User";let Z;e[3]!==ee?(Z=s.jsx("p",{className:"text-sm font-medium truncate",children:ee}),e[3]=ee,e[4]=Z):Z=e[4];const ne=n?.email;let X;e[5]!==ne?(X=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:ne}),e[5]=ne,e[6]=X):X=e[6];let oe;e[7]!==Z||e[8]!==X?(oe=s.jsxs("div",{className:"flex-1 min-w-0",children:[Z,X]}),e[7]=Z,e[8]=X,e[9]=oe):oe=e[9];let re;e[10]!==n?(re=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(Oo)},e[10]=n,e[11]=re):re=e[11];let ye;e[12]===Symbol.for("react.memo_cache_sentinel")?(ye=s.jsx(ut,{size:14}),e[12]=ye):ye=e[12];let ae;e[13]!==re?(ae=s.jsx(Ye,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:re,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:ye})}),e[13]=re,e[14]=ae):ae=e[14];let je;e[15]===Symbol.for("react.memo_cache_sentinel")?(je=s.jsx(Xe,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[15]=je):je=e[15];let ve;e[16]!==ae?(ve=s.jsx(dt,{delayDuration:300,children:s.jsxs(Je,{children:[ae,je]})}),e[16]=ae,e[17]=ve):ve=e[17];let ie;e[18]!==ve||e[19]!==Y||e[20]!==oe?(ie=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-4 border-b border-border",children:[Y,oe,ve]}),e[18]=ve,e[19]=Y,e[20]=oe,e[21]=ie):ie=e[21];let ce;e[22]!==x||e[23]!==m||e[24]!==d||e[25]!==u?(ce=s.jsx("div",{className:"border-b border-border pb-2",children:s.jsx(vt,{sortedOrgs:u,orgParam:d,onSelectOrg:m,onCreateOrg:x})}),e[22]=x,e[23]=m,e[24]=d,e[25]=u,e[26]=ce):ce=e[26];let de;if(e[27]!==f||e[28]!==i){let ge;e[30]!==f?(ge=De=>s.jsx(Le,{item:De,onClose:f},De.key),e[30]=f,e[31]=ge):ge=e[31],de=i.map(ge),e[27]=f,e[28]=i,e[29]=de}else de=e[29];let ue;e[32]!==f||e[33]!==l?(ue=s.jsx(Le,{item:l,onClose:f}),e[32]=f,e[33]=l,e[34]=ue):ue=e[34];let me;e[35]!==de||e[36]!==ue?(me=s.jsxs("nav",{className:"flex flex-col px-2 pt-2 pb-2 gap-0.5",children:[de,ue]}),e[35]=de,e[36]=ue,e[37]=me):me=e[37];let fe;e[38]!==ce||e[39]!==me?(fe=s.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[ce,me]}),e[38]=ce,e[39]=me,e[40]=fe):fe=e[40];let T;if(e[41]!==a.theme||e[42]!==c||e[43]!==r){let ge;e[45]!==a.theme||e[46]!==c?(ge=De=>{const{value:qe,icon:us,label:ms}=De;return s.jsx("button",{type:"button","aria-label":ms,onClick:()=>c(fs=>({...fs,theme:qe})),className:J("size-8 rounded-md flex items-center justify-center transition-colors",a.theme===qe?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:us},qe)},e[45]=a.theme,e[46]=c,e[47]=ge):ge=e[47],T=r.map(ge),e[41]=a.theme,e[42]=c,e[43]=r,e[44]=T}else T=e[44];let Ce;e[48]!==T?(Ce=s.jsx("div",{className:"flex items-center gap-0.5",children:T}),e[48]=T,e[49]=Ce):Ce=e[49];const Ke=a.enableSounds?"Disable sounds":"Enable sounds";let Ne;e[50]!==c?(Ne=()=>c($o),e[50]=c,e[51]=Ne):Ne=e[51];const We=a.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let ke;e[52]!==We?(ke=J("size-8 rounded-md flex items-center justify-center transition-colors",We),e[52]=We,e[53]=ke):ke=e[53];let we;e[54]!==a.enableSounds?(we=a.enableSounds?s.jsx(lt,{size:14}):s.jsx(rt,{size:14}),e[54]=a.enableSounds,e[55]=we):we=e[55];let Ie;e[56]!==Ke||e[57]!==Ne||e[58]!==ke||e[59]!==we?(Ie=s.jsx("button",{type:"button","aria-label":Ke,onClick:Ne,className:ke,children:we}),e[56]=Ke,e[57]=Ne,e[58]=ke,e[59]=we,e[60]=Ie):Ie=e[60];let Re;e[61]===Symbol.for("react.memo_cache_sentinel")?(Re=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","2.317.0"]}),e[61]=Re):Re=e[61];let Me;e[62]!==Ie?(Me=s.jsxs("div",{className:"flex items-center gap-2",children:[Ie,Re]}),e[62]=Ie,e[63]=Me):Me=e[63];let Ae;e[64]!==Ce||e[65]!==Me?(Ae=s.jsxs("div",{className:"flex items-center justify-between px-3 py-3 border-t border-border/50",children:[Ce,Me]}),e[64]=Ce,e[65]=Me,e[66]=Ae):Ae=e[66];let Ee;return e[67]!==ie||e[68]!==fe||e[69]!==Ae?(Ee=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[ie,fe,Ae]}),e[67]=ie,e[68]=fe,e[69]=Ae,e[70]=Ee):Ee=e[70],Ee}const C=n?.name??"U";let $;e[71]!==C||e[72]!==o?($=s.jsx(ct,{url:o,fallback:C,shape:"circle",size:"sm",className:"shrink-0"}),e[71]=C,e[72]=o,e[73]=$):$=e[73];const g=n?.name??"User";let N;e[74]!==g?(N=s.jsx("p",{className:"text-sm font-medium truncate",children:g}),e[74]=g,e[75]=N):N=e[75];const h=n?.email;let y;e[76]!==h?(y=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:h}),e[76]=h,e[77]=y):y=e[77];let j;e[78]!==N||e[79]!==y?(j=s.jsxs("div",{className:"flex-1 min-w-0",children:[N,y]}),e[78]=N,e[79]=y,e[80]=j):j=e[80];let b;e[81]!==n?(b=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(Ao)},e[81]=n,e[82]=b):b=e[82];let v;e[83]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(ut,{size:14}),e[83]=v):v=e[83];let I;e[84]!==b?(I=s.jsx(Ye,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:b,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:v})}),e[84]=b,e[85]=I):I=e[85];let F;e[86]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsx(Xe,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[86]=F):F=e[86];let O;e[87]!==I?(O=s.jsx(dt,{delayDuration:300,children:s.jsxs(Je,{children:[I,F]})}),e[87]=I,e[88]=O):O=e[88];let z;e[89]!==O||e[90]!==$||e[91]!==j?(z=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 mx-1 mt-1",children:[$,j,O]}),e[89]=O,e[90]=$,e[91]=j,e[92]=z):z=e[92];let E;if(e[93]!==f||e[94]!==i){let G;e[96]!==f?(G=Y=>s.jsx(Le,{item:Y,onClose:f},Y.key),e[96]=f,e[97]=G):G=e[97],E=i.map(G),e[93]=f,e[94]=i,e[95]=E}else E=e[95];let P;e[98]!==f||e[99]!==l?(P=s.jsx(Le,{item:l,onClose:f}),e[98]=f,e[99]=l,e[100]=P):P=e[100];let k;e[101]!==E||e[102]!==P?(k=s.jsxs("nav",{className:"flex-1 flex flex-col px-2 pt-1 overflow-y-auto",children:[E,P]}),e[101]=E,e[102]=P,e[103]=k):k=e[103];let w;if(e[104]!==a.theme||e[105]!==c||e[106]!==r){let G;e[108]!==a.theme||e[109]!==c?(G=Y=>{const{value:ee,icon:Z,label:ne}=Y;return s.jsx("button",{type:"button","aria-label":ne,onClick:()=>c(X=>({...X,theme:ee})),className:J("size-7 rounded-md flex items-center justify-center transition-colors",a.theme===ee?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:Z},ee)},e[108]=a.theme,e[109]=c,e[110]=G):G=e[110],w=r.map(G),e[104]=a.theme,e[105]=c,e[106]=r,e[107]=w}else w=e[107];let M;e[111]!==w?(M=s.jsx("div",{className:"flex items-center gap-0.5",children:w}),e[111]=w,e[112]=M):M=e[112];const D=a.enableSounds?"Disable sounds":"Enable sounds";let A;e[113]!==c?(A=()=>c(Mo),e[113]=c,e[114]=A):A=e[114];const B=a.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let U;e[115]!==B?(U=J("size-7 rounded-md flex items-center justify-center transition-colors",B),e[115]=B,e[116]=U):U=e[116];let L;e[117]!==a.enableSounds?(L=a.enableSounds?s.jsx(lt,{size:14}):s.jsx(rt,{size:14}),e[117]=a.enableSounds,e[118]=L):L=e[118];let H;e[119]!==D||e[120]!==A||e[121]!==U||e[122]!==L?(H=s.jsx("button",{type:"button","aria-label":D,onClick:A,className:U,children:L}),e[119]=D,e[120]=A,e[121]=U,e[122]=L,e[123]=H):H=e[123];let V;e[124]===Symbol.for("react.memo_cache_sentinel")?(V=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","2.317.0"]}),e[124]=V):V=e[124];let q;e[125]!==H?(q=s.jsxs("div",{className:"flex items-center gap-2",children:[H,V]}),e[125]=H,e[126]=q):q=e[126];let Q;e[127]!==M||e[128]!==q?(Q=s.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5 border-t border-border/50",children:[M,q]}),e[127]=M,e[128]=q,e[129]=Q):Q=e[129];let _;e[130]!==z||e[131]!==k||e[132]!==Q?(_=s.jsxs("div",{className:"w-60 shrink-0 flex flex-col border-r border-border bg-sidebar/75",children:[z,k,Q]}),e[130]=z,e[131]=k,e[132]=Q,e[133]=_):_=e[133];let K;e[134]!==x||e[135]!==m||e[136]!==d||e[137]!==u?(K=s.jsx("div",{className:"flex-1 flex flex-col min-w-0 min-h-0 overflow-hidden",children:s.jsx(vt,{sortedOrgs:u,orgParam:d,onSelectOrg:m,onCreateOrg:x})}),e[134]=x,e[135]=m,e[136]=d,e[137]=u,e[138]=K):K=e[138];let W;return e[139]!==_||e[140]!==K?(W=s.jsxs("div",{className:"flex min-h-[380px] w-full overflow-hidden",children:[_,K]}),e[139]=_,e[140]=K,e[141]=W):W=e[141],W}function Mo(t){return{...t,enableSounds:!t.enableSounds}}function Ao(){be.success("User ID copied")}function $o(t){return{...t,enableSounds:!t.enableSounds}}function Oo(){be.success("User ID copied")}function Jt(){const t=R.c(50),{data:e}=_e.useSession(),{data:n}=_e.useListOrganizations(),o=Se();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i={from:"/shell/$org",shouldThrow:!1},t[0]=i):i=t[0];const r=Ss(i)?.params.org,[a,c]=wt(),u=Dt(),[d,m]=S.useState(!1),[x,f]=S.useState(!1),p=e?.user,C=p?.image;let $;if(t[1]!==u||t[2]!==o||t[3]!==d||t[4]!==r||t[5]!==n||t[6]!==a||t[7]!==c||t[8]!==p||t[9]!==C){const h=n?.find(W=>W.slug===r);let y;if(t[11]!==r||t[12]!==n){let W;t[14]!==r?(W=(G,Y)=>G.slug===r?-1:Y.slug===r?1:G.name.localeCompare(Y.name),t[14]=r,t[15]=W):W=t[15],y=[...n??[]].sort(W),t[11]=r,t[12]=n,t[13]=y}else y=t[13];const j=y;let b;t[16]!==o?(b=W=>{m(!1),o({to:"/$org",params:{org:W}})},t[16]=o,t[17]=b):b=t[17];const v=b;let I;t[18]===Symbol.for("react.memo_cache_sentinel")?(I=()=>m(!1),t[18]=I):I=t[18];const F=I;let O;t[19]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx(Ve,{size:16}),t[19]=O):O=t[19];let z;t[20]!==o||t[21]!==r?(z={key:"preferences",label:"Preferences",icon:O,onClick:()=>{o({to:"/$org/settings/profile",params:{org:r??""}})}},t[20]=o,t[21]=r,t[22]=z):z=t[22];let E;t[23]===Symbol.for("react.memo_cache_sentinel")?(E={key:"terms",label:"Terms of Use",icon:s.jsx(Qs,{size:16}),href:"https://www.decocms.com/terms-of-use",external:!0},t[23]=E):E=t[23];let P;t[24]===Symbol.for("react.memo_cache_sentinel")?(P={key:"privacy",label:"Privacy Policy",icon:s.jsx(fn,{size:16}),href:"https://www.decocms.com/privacy-policy",external:!0},t[24]=P):P=t[24];let k;t[25]===Symbol.for("react.memo_cache_sentinel")?(k={key:"github",label:"decocms/studio",icon:s.jsx(Cs,{className:"w-4 h-4"}),href:"https://github.com/decocms/studio",external:!0},t[25]=k):k=t[25];let w;t[26]===Symbol.for("react.memo_cache_sentinel")?(w={key:"community",label:"Community",icon:s.jsx(Ft,{size:16}),href:"https://decocms.com/discord",external:!0},t[26]=w):w=t[26];let M;t[27]===Symbol.for("react.memo_cache_sentinel")?(M={key:"homepage",label:"Homepage",icon:s.jsx(ln,{size:16}),href:"https://decocms.com",external:!0},t[27]=M):M=t[27];let D;t[28]!==z?(D=[z,E,P,k,w,M],t[28]=z,t[29]=D):D=t[29];const A=D;let B;t[30]===Symbol.for("react.memo_cache_sentinel")?(B={key:"logout",label:"Sign out",icon:s.jsx(an,{size:16}),onClick:Po},t[30]=B):B=t[30];const U=B;let L;t[31]===Symbol.for("react.memo_cache_sentinel")?(L={value:"light",icon:s.jsx(dn,{size:14}),label:"Light theme"},t[31]=L):L=t[31];let H;t[32]===Symbol.for("react.memo_cache_sentinel")?(H={value:"dark",icon:s.jsx(un,{size:14}),label:"Dark theme"},t[32]=H):H=t[32];let V;t[33]===Symbol.for("react.memo_cache_sentinel")?(V=[L,H,{value:"system",icon:s.jsx(mn,{size:14}),label:"System theme"}],t[33]=V):V=t[33];const q=V;let Q;t[34]===Symbol.for("react.memo_cache_sentinel")?(Q=()=>{m(!1),f(!0)},t[34]=Q):Q=t[34];let _;t[35]!==v||t[36]!==u||t[37]!==A||t[38]!==r||t[39]!==a||t[40]!==c||t[41]!==j||t[42]!==p||t[43]!==C?(_={user:p,userImage:C,menuItems:A,signOutItem:U,themeOptions:q,preferences:a,setPreferences:c,sortedOrgs:j,orgParam:r,onSelectOrg:v,onCreateOrg:Q,close:F,isMobile:u},t[35]=v,t[36]=u,t[37]=A,t[38]=r,t[39]=a,t[40]=c,t[41]=j,t[42]=p,t[43]=C,t[44]=_):_=t[44];const K=_;$=u?s.jsxs(Tt,{open:d,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:h?.logo?void 0:Ze(h?.name??""),children:h?.logo?s.jsx("img",{src:h.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:"font-semibold leading-none text-[8px]",children:(h?.name??"?").slice(0,2).toUpperCase()})}),s.jsx("span",{className:"truncate",children:h?.name??"Account"})]}),s.jsxs(Rt,{className:"h-[80dvh] p-0",children:[s.jsx(Et,{className:"sr-only",children:"Account"}),s.jsx(_t,{...K})]})]}):s.jsxs(st,{open:d,onOpenChange:m,children:[s.jsx(nt,{asChild:!0,children:s.jsx(xe,{tooltip:h?.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:h?.logo?void 0:Ze(h?.name??""),children:h?.logo?s.jsx("img",{src:h.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:"font-semibold leading-none text-[9px]",children:(h?.name??"?").slice(0,2).toUpperCase()})})})}),s.jsx(ot,{side:"right",align:"end",sideOffset:18,collisionPadding:16,className:"w-[520px] p-0 flex max-h-[520px]",onCloseAutoFocus:zo,children:s.jsx(_t,{...K})})]}),t[1]=u,t[2]=o,t[3]=d,t[4]=r,t[5]=n,t[6]=a,t[7]=c,t[8]=p,t[9]=C,t[10]=$}else $=t[10];let g;t[45]!==x?(g=s.jsx(No,{open:x,onOpenChange:f}),t[45]=x,t[46]=g):g=t[46];let N;return t[47]!==$||t[48]!==g?(N=s.jsxs(s.Fragment,{children:[$,g]}),t[47]=$,t[48]=g,t[49]=N):N=t[49],N}function zo(t){return t.preventDefault()}function Po(){se("signed_out",{source:"account_popover"}),_e.signOut()}function To({invitation:t}){const[e,n]=S.useState(!1),[o,i]=S.useState(!1),l=Be(),r=async()=>{n(!0);try{const c=await _e.organization.acceptInvitation({invitationId:t.id});if(c.error)be.error(c.error.message),n(!1);else{const u=await _e.organization.getFullOrganization({query:{organizationId:t.organizationId}});be.success("Invitation accepted!");const d=u?.data?.slug;window.location.href=d?`/${d}`:"/"}}catch{be.error("Failed to accept invitation"),n(!1)}},a=async()=>{i(!0);try{const c=await _e.organization.rejectInvitation({invitationId:t.id});c.error?(be.error(c.error.message),i(!1)):(be.success("Invitation declined"),l.invalidateQueries())}catch{be.error("Failed to decline invitation"),i(!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(Qe,{size:"icon",variant:"ghost",className:"size-7 text-green-600 hover:text-green-700 hover:bg-green-50 dark:hover:bg-green-950",onClick:r,disabled:e||o,"aria-label":"Accept invitation",children:s.jsx(Lt,{size:14})}),s.jsx(Qe,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground hover:text-destructive hover:bg-destructive/10",onClick:a,disabled:e||o,"aria-label":"Decline invitation",children:s.jsx(An,{size:14})})]})]})}function Ro(){const t=S.useContext(Ns),{data:e}=t.hooks.useListUserInvitations();return(e??[]).filter(o=>o.status==="pending"&&new Date(o.expiresAt)>new Date)}class Eo extends S.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 Do(t){return t<=1?"text-destructive":t<=5?"text-amber-500 dark:text-amber-400":"text-foreground/70"}function Lo(){const t=R.c(20),e=Se(),{org:n}=he();let o;t[0]!==n.id||t[1]!==n.slug?(o={connectionId:Ut,orgId:n.id,orgSlug:n.slug},t[0]=n.id,t[1]=n.slug,t[2]=o):o=t[2];const i=Gt(o);let l;t[3]===Symbol.for("react.memo_cache_sentinel")?(l={providerId:"deco"},t[3]=l):l=t[3];let r;t[4]!==i?(r={client:i,toolName:"AI_PROVIDER_CREDITS",toolArguments:l,staleTime:6e4,select:Fo},t[4]=i,t[5]=r):r=t[5];const{data:a,isPending:c,isError:u}=zn(r),d=a?.balanceCents!=null?a.balanceCents/100:null;let m;t[6]!==d||t[7]!==u||t[8]!==c?(m=c||u||d==null?"Credits":`Credits: $${d.toFixed(2)}`,t[6]=d,t[7]=u,t[8]=c,t[9]=m):m=t[9];const x=m;let f;t[10]!==d?(f=J(d!=null&&Do(d)),t[10]=d,t[11]=f):f=t[11];let p;t[12]!==e||t[13]!==n.slug?(p=()=>e({to:"/$org/settings/ai-providers",params:{org:n.slug}}),t[12]=e,t[13]=n.slug,t[14]=p):p=t[14];let C;t[15]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(Ys,{size:24}),t[15]=C):C=t[15];let $;return t[16]!==f||t[17]!==p||t[18]!==x?($=s.jsx(pe,{children:s.jsx(le,{children:s.jsx(xe,{tooltip:x,className:f,onClick:p,children:C})})}),t[16]=f,t[17]=p,t[18]=x,t[19]=$):$=t[19],$}function Fo(t){return t.structuredContent}function Uo(){const t=R.c(1);if(!Pn().some(Go))return null;let o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Lo,{}),t[0]=o):o=t[0],o}function Go(t){return t.providerId==="deco"}function Bo(){const t=R.c(3),[e,n]=S.useState(!1);let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(pe,{children:s.jsx(le,{children:s.jsx(xe,{tooltip:"Connections",onClick:()=>{se("connections_dialog_opened",{source:"sidebar_footer",mode:"browse"}),n(!0)},children:s.jsx(cn,{size:24})})})}),t[0]=o):o=t[0];let i;return t[1]!==e?(i=s.jsxs(s.Fragment,{children:[o,s.jsx(Tn,{mode:"browse",open:e,onOpenChange:n,defaultTab:"all"})]}),t[1]=e,t[2]=i):i=t[2],i}function Ho(){const t=R.c(11),e=Ro();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(at,{size:24}),t[0]=n):n=t[0];let o;t[1]!==e.length?(o=e.length>0&&s.jsx("span",{className:"absolute top-1 right-1 size-2 rounded-full bg-red-500 pointer-events-none"}),t[1]=e.length,t[2]=o):o=t[2];let i;t[3]!==o?(i=s.jsx(pe,{children:s.jsx(le,{children:s.jsx(nt,{asChild:!0,children:s.jsxs(xe,{tooltip:"Inbox",className:"relative",children:[n,o]})})})}),t[3]=o,t[4]=i):i=t[4];let l;t[5]===Symbol.for("react.memo_cache_sentinel")?(l=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"})}),t[5]=l):l=t[5];let r;t[6]!==e?(r=s.jsxs(ot,{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:[l,e.length===0?s.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 px-6 text-center",children:[s.jsx(at,{size:24,className:"text-muted-foreground/50"}),s.jsx("p",{className:"text-sm font-medium text-foreground",children:"No invites pending"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Organization invitations will appear here"})]}):s.jsx("div",{className:"overflow-y-auto flex-1",children:e.map(Vo)})]}),t[6]=e,t[7]=r):r=t[7];let a;return t[8]!==i||t[9]!==r?(a=s.jsxs(st,{children:[i,r]}),t[8]=i,t[9]=r,t[10]=a):a=t[10],a}function Vo(t){return s.jsx(To,{invitation:t},t.id)}function Ko(){const t=R.c(6),e=Se(),{org:n}=he();let o;t[0]!==e||t[1]!==n.slug?(o=()=>e({to:"/$org/settings",params:{org:n.slug}}),t[0]=e,t[1]=n.slug,t[2]=o):o=t[2];let i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Ve,{size:24}),t[3]=i):i=t[3];let l;return t[4]!==o?(l=s.jsx(pe,{children:s.jsx(le,{children:s.jsx(xe,{tooltip:"Settings",onClick:o,children:i})})}),t[4]=o,t[5]=l):l=t[5],l}function Wo(){const t=R.c(5);let e,n,o,i;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Eo,{children:s.jsx(S.Suspense,{fallback:null,children:s.jsx(Uo,{})})}),n=s.jsx(Bo,{}),o=s.jsx(Ho,{}),i=s.jsx(Ko,{}),t[0]=e,t[1]=n,t[2]=o,t[3]=i):(e=t[0],n=t[1],o=t[2],i=t[3]);let l;return t[4]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsxs(Pt,{className:"px-2 pb-3 gap-1",children:[e,n,o,i,s.jsx(pe,{children:s.jsx(le,{children:s.jsx(Jt,{})})})]}),t[4]=l):l=t[4],l}function qo(){const t=R.c(10),e=Se(),{org:n}=he(),{setOpenMobile:o}=He();let i;t[0]!==e||t[1]!==n.slug||t[2]!==o?(i=()=>{e({to:"/$org/settings",params:{org:n.slug}}),o(!1)},t[0]=e,t[1]=n.slug,t[2]=o,t[3]=i):i=t[3];let l;t[4]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Ve,{}),t[4]=l):l=t[4];let r;t[5]!==i?(r=s.jsx(le,{children:s.jsx(xe,{tooltip:"Settings",onClick:i,children:l})}),t[5]=i,t[6]=r):r=t[6];let a;t[7]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(le,{children:s.jsx(Jt,{})}),t[7]=a):a=t[7];let c;return t[8]!==r?(c=s.jsx(Pt,{children:s.jsxs(pe,{children:[r,a]})}),t[8]=r,t[9]=c):c=t[9],c}var it="ContextMenu",[Qo]=Ps(it,[It]),te=It(),[Yo,Zt]=Qo(it),es=t=>{const{__scopeContextMenu:e,children:n,onOpenChange:o,dir:i,modal:l=!0}=t,[r,a]=S.useState(!1),c=te(e),u=ks(o),d=S.useCallback(m=>{a(m),u(m)},[u]);return s.jsx(Yo,{scope:e,open:r,onOpenChange:d,modal:l,children:s.jsx(ws,{...c,dir:i,open:r,onOpenChange:d,modal:l,children:n})})};es.displayName=it;var ts="ContextMenuTrigger",ss=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,disabled:o=!1,...i}=t,l=Zt(ts,n),r=te(n),a=S.useRef({x:0,y:0}),c=S.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...a.current})}),u=S.useRef(0),d=S.useCallback(()=>window.clearTimeout(u.current),[]),m=x=>{a.current={x:x.clientX,y:x.clientY},l.onOpenChange(!0)};return S.useEffect(()=>d,[d]),S.useEffect(()=>{o&&d()},[o,d]),s.jsxs(s.Fragment,{children:[s.jsx(Is,{...r,virtualRef:c}),s.jsx(Ms.span,{"data-state":l.open?"open":"closed","data-disabled":o?"":void 0,...i,ref:e,style:{WebkitTouchCallout:"none",...t.style},onContextMenu:o?t.onContextMenu:Oe(t.onContextMenu,x=>{d(),m(x),x.preventDefault()}),onPointerDown:o?t.onPointerDown:Oe(t.onPointerDown,Fe(x=>{d(),u.current=window.setTimeout(()=>m(x),700)})),onPointerMove:o?t.onPointerMove:Oe(t.onPointerMove,Fe(d)),onPointerCancel:o?t.onPointerCancel:Oe(t.onPointerCancel,Fe(d)),onPointerUp:o?t.onPointerUp:Oe(t.onPointerUp,Fe(d))})]})});ss.displayName=ts;var Xo="ContextMenuPortal",ns=t=>{const{__scopeContextMenu:e,...n}=t,o=te(e);return s.jsx(As,{...o,...n})};ns.displayName=Xo;var os="ContextMenuContent",is=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...o}=t,i=Zt(os,n),l=te(n),r=S.useRef(!1);return s.jsx($s,{...l,...o,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:a=>{t.onCloseAutoFocus?.(a),!a.defaultPrevented&&r.current&&a.preventDefault(),r.current=!1},onInteractOutside:a=>{t.onInteractOutside?.(a),!a.defaultPrevented&&!i.modal&&(r.current=!0)},style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});is.displayName=os;var Jo="ContextMenuGroup",Zo=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...o}=t,i=te(n);return s.jsx(Ts,{...i,...o,ref:e})});Zo.displayName=Jo;var ei="ContextMenuLabel",ti=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...o}=t,i=te(n);return s.jsx(Rs,{...i,...o,ref:e})});ti.displayName=ei;var si="ContextMenuItem",ls=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...o}=t,i=te(n);return s.jsx(Os,{...i,...o,ref:e})});ls.displayName=si;var ni="ContextMenuCheckboxItem",oi=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...o}=t,i=te(n);return s.jsx(Es,{...i,...o,ref:e})});oi.displayName=ni;var ii="ContextMenuRadioGroup",li=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...o}=t,i=te(n);return s.jsx(Ds,{...i,...o,ref:e})});li.displayName=ii;var ri="ContextMenuRadioItem",ai=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...o}=t,i=te(n);return s.jsx(Ls,{...i,...o,ref:e})});ai.displayName=ri;var ci="ContextMenuItemIndicator",di=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...o}=t,i=te(n);return s.jsx(Fs,{...i,...o,ref:e})});di.displayName=ci;var ui="ContextMenuSeparator",rs=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...o}=t,i=te(n);return s.jsx(zs,{...i,...o,ref:e})});rs.displayName=ui;var mi="ContextMenuArrow",fi=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...o}=t,i=te(n);return s.jsx(Us,{...i,...o,ref:e})});fi.displayName=mi;var xi="ContextMenuSubTrigger",pi=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...o}=t,i=te(n);return s.jsx(Gs,{...i,...o,ref:e})});pi.displayName=xi;var hi="ContextMenuSubContent",gi=S.forwardRef((t,e)=>{const{__scopeContextMenu:n,...o}=t,i=te(n);return s.jsx(Bs,{...i,...o,ref:e,style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});gi.displayName=hi;function Fe(t){return e=>e.pointerType!=="mouse"?t(e):void 0}var bi=es,ji=ss,vi=ns,_i=is,yi=ls,Si=rs;function Ci(t){const e=R.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let o;return e[2]!==n?(o=s.jsx(bi,{"data-slot":"context-menu",...n}),e[2]=n,e[3]=o):o=e[3],o}function Ni(t){const e=R.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let o;return e[2]!==n?(o=s.jsx(ji,{"data-slot":"context-menu-trigger",...n}),e[2]=n,e[3]=o):o=e[3],o}function ki(t){const e=R.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let i;e[3]!==n?(i=J("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 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",n),e[3]=n,e[4]=i):i=e[4];let l;return e[5]!==o||e[6]!==i?(l=s.jsx(vi,{children:s.jsx(_i,{"data-slot":"context-menu-content",className:i,...o})}),e[5]=o,e[6]=i,e[7]=l):l=e[7],l}function yt(t){const e=R.c(12);let n,o,i,l;e[0]!==t?({className:n,inset:o,variant:l,...i}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=i,e[4]=l):(n=e[1],o=e[2],i=e[3],l=e[4]);const r=l===void 0?"default":l;let a;e[5]!==n?(a=J("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",n),e[5]=n,e[6]=a):a=e[6];let c;return e[7]!==o||e[8]!==i||e[9]!==a||e[10]!==r?(c=s.jsx(yi,{"data-slot":"context-menu-item","data-inset":o,"data-variant":r,className:a,...i}),e[7]=o,e[8]=i,e[9]=a,e[10]=r,e[11]=c):c=e[11],c}function wi(t){const e=R.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let i;e[3]!==n?(i=J("bg-border -mx-1 my-1 h-px",n),e[3]=n,e[4]=i):i=e[4];let l;return e[5]!==o||e[6]!==i?(l=s.jsx(Si,{"data-slot":"context-menu-separator",className:i,...o}),e[5]=o,e[6]=i,e[7]=l):l=e[7],l}function Ii(t){const e=Se(),n=Be(),o=ro(),{locator:i}=he(),l=et({strict:!1}),r=Ct({strict:!1});return async a=>{const c=crypto.randomUUID(),u=a===r.virtualmcpid?tn(n,i,l.taskId??""):null;try{await o.create.mutateAsync({id:c,virtual_mcp_id:a,...u?{branch:u}:{}})}catch{}e({to:"/$org/$taskId",params:{org:t,taskId:c},search:{virtualmcpid:a}})}}function Mi({agent:t,org:e,onUnpin:n,isDragging:o}){const i=Se(),{isMobile:l,setOpenMobile:r}=He(),a=Rn(e),u=St({select:h=>h.location.pathname}).startsWith(`/${e}/${t.id}`),[d,m]=S.useState(null),x=S.useRef(null),f=S.useRef(null),p=S.useRef(!1);p.current=!!o,o&&(d||f.current)&&(f.current&&(clearTimeout(f.current),f.current=null),d&&m(null));const C=h=>{if(p.current)return;const y=h.currentTarget.getBoundingClientRect();f.current=setTimeout(()=>{p.current||m(y)},550)},$=h=>{f.current&&(clearTimeout(f.current),f.current=null),!(x.current&&h.relatedTarget instanceof Node&&x.current.contains(h.relatedTarget))&&m(null)},g=d?Math.round(d.height*.9):0,N=d?d.width+g:0;return s.jsx(Ci,{children:s.jsxs(le,{className:J(d&&"z-[55]"),children:[s.jsx(Ni,{asChild:!0,children:s.jsx(xe,{tooltip:d?void 0:t.title,isActive:u,onClick:async()=>{l&&r(!1);const{resumed:h}=await a(t.id);se("sidebar_agent_pin_clicked",{agent_id:t.id,agent_title:t.title,resumed:h})},onMouseEnter:C,onMouseLeave:$,children:s.jsx($e,{icon:t.icon,name:t.title,size:"xs",className:"w-full h-full [&_svg]:w-1/2 [&_svg]:h-1/2"})})}),s.jsxs(ki,{children:[s.jsxs(yt,{onClick:()=>{const h=crypto.randomUUID();i({to:"/$org/$taskId",params:{org:e,taskId:h},search:{virtualmcpid:t.id}})},children:[s.jsx(Ve,{size:14}),"Settings"]}),s.jsx(wi,{}),s.jsxs(yt,{onClick:()=>{n(),u&&i({to:"/$org",params:{org:e}})},className:"",children:[s.jsx(ft,{size:14}),"Unpin"]})]}),d&&Hs.createPortal(s.jsx("button",{ref:x,type:"button",onMouseLeave:()=>m(null),onClick:h=>{h.stopPropagation(),m(null),n(),i({to:"/$org",params:{org:e}})},className:J("flex items-center justify-center","bg-sidebar-accent text-muted-foreground","rounded-xl cursor-pointer","animate-in fade-in-0 slide-in-from-right-2","duration-150 [animation-timing-function:cubic-bezier(0.165,0.84,0.44,1)]","hover:text-foreground transition-colors"),style:{position:"fixed",top:d.top,left:d.left,height:d.height,width:N,paddingLeft:d.width,zIndex:50,boxShadow:"inset 0 0 0.5px 1px hsla(0, 0%, 100%, 0.075), 0 0 0 0.5px hsla(0, 0%, 0%, 0.12)"},children:s.jsx(ft,{size:14})}),document.body)]})})}function Ai(t){const e=R.c(18);let n;e[0]!==t.agent.id?(n={id:t.agent.id},e[0]=t.agent.id,e[1]=n):n=e[1];const{attributes:o,listeners:i,setNodeRef:l,transform:r,transition:a,isDragging:c}=Yn(n);let u;e[2]!==r?(u=Xn.Transform.toString(r?{...r,x:0}:null),e[2]=r,e[3]=u):u=e[3];const d=c?.5:void 0,m=c?100:void 0;let x;e[4]!==u||e[5]!==d||e[6]!==m||e[7]!==a?(x={transform:u,transition:a,opacity:d,zIndex:m},e[4]=u,e[5]=d,e[6]=m,e[7]=a,e[8]=x):x=e[8];const f=x;let p;e[9]!==c||e[10]!==t?(p=s.jsx(Mi,{...t,isDragging:c}),e[9]=c,e[10]=t,e[11]=p):p=e[11];let C;return e[12]!==o||e[13]!==i||e[14]!==l||e[15]!==f||e[16]!==p?(C=s.jsx("div",{ref:l,style:f,...o,...i,tabIndex:-1,className:"w-full",children:p}),e[12]=o,e[13]=i,e[14]=l,e[15]=f,e[16]=p,e[17]=C):C=e[17],C}function $i(t){const e=R.c(9),{agent:n,onClick:o}=t;let i;e[0]!==n.icon||e[1]!==n.title?(i=s.jsx($e,{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]=i):i=e[2];let l;e[3]!==n.title?(l=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]=l):l=e[4];let r;return e[5]!==o||e[6]!==i||e[7]!==l?(r=s.jsxs("button",{type:"button",onClick:o,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group",children:[i,l]}),e[5]=o,e[6]=i,e[7]=l,e[8]=r):r=e[8],r}function Oi(t){const e=R.c(80),{onClose:n,onOpenImportDeco:o,onOpenGithubImport:i,onOpenSelfHealing:l,onOpenDiagnosticsModal:r,onOpenLeanCanvasModal:a,onOpenStudioPackModal:c,onOpenAiImageModal:u,onOpenAiResearchModal:d}=t,[m,x]=S.useState(""),f=Bt(),{org:p}=he();let C;e[0]!==f?(C=f.filter(Fi).map(Li),e[0]=f,e[1]=C):C=e[1];const $=C,{pin:g,isPinned:N}=Vt(p.id,$);let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h={navigateOnCreate:!0},e[2]=h):h=e[2];const{createVirtualMCP:y,isCreating:j}=eo(h),[b]=wt(),v=Ii(p.slug),I=Zn();let F,O,z,E,P,k,w,M;if(e[3]!==f||e[4]!==y||e[5]!==j||e[6]!==N||e[7]!==I||e[8]!==v||e[9]!==n||e[10]!==u||e[11]!==d||e[12]!==r||e[13]!==i||e[14]!==o||e[15]!==a||e[16]!==l||e[17]!==c||e[18]!==g||e[19]!==b.experimental_vibecode||e[20]!==m){const V=m.toLowerCase();M=f.filter(Di).filter(T=>!m||T.title.toLowerCase().includes(V));let q;e[29]!==f?(q=f.some(Ei),e[29]=f,e[30]=q):q=e[30];const Q=q;F=ze.filter(T=>(!m||T.title.toLowerCase().includes(V))&&!(T.id==="studio-pack"&&Q)&&!(T.id==="self-healing-storefront"&&!b.experimental_vibecode));let _;e[31]===Symbol.for("react.memo_cache_sentinel")?(_=ze.find(Ri),e[31]=_):_=e[31];const K=_,W=K?f.find(T=>T.metadata?.type===K.id):void 0;let G;e[32]===Symbol.for("react.memo_cache_sentinel")?(G=ze.find(Ti),e[32]=G):G=e[32];const Y=G,ee=Y?f.find(T=>T.metadata?.type===Y.id):void 0;let Z;e[33]===Symbol.for("react.memo_cache_sentinel")?(Z=ze.find(Pi),e[33]=Z):Z=e[33];const ne=Z,X=ne?f.find(T=>T.metadata?.type===ne.id):void 0;let oe;e[34]===Symbol.for("react.memo_cache_sentinel")?(oe=ze.find(zi),e[34]=oe):oe=e[34];const re=oe,ye=re?f.find(T=>T.metadata?.type===re.id):void 0;let ae;e[35]!==N||e[36]!==v||e[37]!==n||e[38]!==g?(ae=T=>{N(T.id)||g(T.id),n(),x(""),v(T.id)},e[35]=N,e[36]=v,e[37]=n,e[38]=g,e[39]=ae):ae=e[39];const je=ae,ve=T=>{n(),x(""),T==="self-healing-storefront"?l():T==="site-editor"?o():T==="site-diagnostics"?W?I(W.id):r():T==="lean-canvas"?ee?I(ee.id):a():T==="ai-image"?X?I(X.id):u():T==="ai-research"?ye?I(ye.id):d():T==="studio-pack"?c():v(T)};k="flex flex-col max-h-[min(640px,80dvh)]",e[40]!==m?(w=s.jsx(Jn,{value:m,onChange:x,placeholder:"Search agents..."}),e[40]=m,e[41]=w):w=e[41],O="overflow-y-auto flex-1 min-h-0 px-3 pb-3",e[42]===Symbol.for("react.memo_cache_sentinel")?(z=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[42]=z):z=e[42];let ie;e[43]!==y||e[44]!==n?(ie=async()=>{se("agent_create_new_clicked",{source:"browse_popover"}),await y(),n()},e[43]=y,e[44]=n,e[45]=ie):ie=e[45];let ce,de;e[46]===Symbol.for("react.memo_cache_sentinel")?(ce=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(Ge,{size:16,className:"text-muted-foreground"})}),de=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Create new"}),e[46]=ce,e[47]=de):(ce=e[46],de=e[47]);let ue;e[48]!==j||e[49]!==ie?(ue=s.jsxs("button",{type:"button",disabled:j,onClick:ie,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:[ce,de]}),e[48]=j,e[49]=ie,e[50]=ue):ue=e[50];let me;e[51]!==n||e[52]!==i||e[53]!==b.experimental_vibecode?(me=b.experimental_vibecode&&s.jsxs("button",{type:"button",onClick:()=>{se("agent_import_clicked",{source:"github"}),i(),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(lo,{className:"size-5 text-muted-foreground"})}),s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Import GitHub"})]}),e[51]=n,e[52]=i,e[53]=b.experimental_vibecode,e[54]=me):me=e[54];let fe;e[55]!==je?(fe=T=>s.jsx($i,{agent:T,onClick:()=>je(T)},T.id),e[55]=je,e[56]=fe):fe=e[56],E=s.jsxs("div",{className:"grid grid-cols-3 gap-1",children:[ue,me,M.map(fe)]}),P=F.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"px-1 pt-4 pb-2",children:s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Agent templates"})}),s.jsx("div",{className:"grid grid-cols-3 gap-1",children:F.map(T=>s.jsxs("button",{type:"button",onClick:()=>{se("agent_template_clicked",{template_id:T.id,template_title:T.title}),ve(T.id)},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:[s.jsx($e,{icon:T.icon,name:T.title,size:"md",className:"transition-transform group-hover:scale-105"}),s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground line-clamp-2 w-full",children:T.title})]},T.id))})]}),e[3]=f,e[4]=y,e[5]=j,e[6]=N,e[7]=I,e[8]=v,e[9]=n,e[10]=u,e[11]=d,e[12]=r,e[13]=i,e[14]=o,e[15]=a,e[16]=l,e[17]=c,e[18]=g,e[19]=b.experimental_vibecode,e[20]=m,e[21]=F,e[22]=O,e[23]=z,e[24]=E,e[25]=P,e[26]=k,e[27]=w,e[28]=M}else F=e[21],O=e[22],z=e[23],E=e[24],P=e[25],k=e[26],w=e[27],M=e[28];let D;e[57]!==F||e[58]!==j||e[59]!==m||e[60]!==M.length?(D=M.length===0&&F.length===0&&!j&&s.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:m?"No agents found":"No agents yet"}),e[57]=F,e[58]=j,e[59]=m,e[60]=M.length,e[61]=D):D=e[61];let A;e[62]!==O||e[63]!==z||e[64]!==E||e[65]!==P||e[66]!==D?(A=s.jsxs("div",{className:O,children:[z,E,P,D]}),e[62]=O,e[63]=z,e[64]=E,e[65]=P,e[66]=D,e[67]=A):A=e[67];let B;e[68]!==p.slug?(B={org:p.slug},e[68]=p.slug,e[69]=B):B=e[69];let U;e[70]!==n?(U=()=>n(),e[70]=n,e[71]=U):U=e[71];let L;e[72]!==B||e[73]!==U?(L=s.jsx("div",{className:"border-t border-border px-3 py-2.5",children:s.jsx(Vs,{to:"/$org/settings/agents",params:B,onClick:U,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:"See all agents"})}),e[72]=B,e[73]=U,e[74]=L):L=e[74];let H;return e[75]!==A||e[76]!==L||e[77]!==k||e[78]!==w?(H=s.jsxs("div",{className:k,children:[w,A,L]}),e[75]=A,e[76]=L,e[77]=k,e[78]=w,e[79]=H):H=e[79],H}function zi(t){return t.id==="ai-research"}function Pi(t){return t.id==="ai-image"}function Ti(t){return t.id==="lean-canvas"}function Ri(t){return t.id==="site-diagnostics"}function Ei(t){return On(t.id)}function Di(t){return!$n(t.id)}function Li(t){return t.id}function Fi(t){return t.pinned}function Ui(){const t=R.c(36),[e,n]=S.useState(!1),[o,i]=S.useState(!1),[l,r]=S.useState(!1),[a,c]=S.useState(!1),[u,d]=S.useState(!1),[m,x]=S.useState(!1),[f,p]=S.useState(!1),[C,$]=S.useState(!1),[g,N]=S.useState(!1),h=Dt(),{setOpenMobile:y}=He();let j;t[0]!==h||t[1]!==y?(j=()=>{n(!1),h&&y(!1)},t[0]=h,t[1]=y,t[2]=j):j=t[2];const b=j;let v;t[3]!==b||t[4]!==e?(v=e&&s.jsx(S.Suspense,{fallback:s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(Ue,{className:"h-4 w-24"})}),children:s.jsx(Oi,{onClose:b,onOpenImportDeco:()=>i(!0),onOpenGithubImport:()=>{r(!0),b()},onOpenSelfHealing:()=>{c(!0),b()},onOpenDiagnosticsModal:()=>d(!0),onOpenLeanCanvasModal:()=>x(!0),onOpenStudioPackModal:()=>p(!0),onOpenAiImageModal:()=>$(!0),onOpenAiResearchModal:()=>N(!0)})}),t[3]=b,t[4]=e,t[5]=v):v=t[5];const I=v;let F;t[6]!==h||t[7]!==e||t[8]!==I?(F=h?s.jsxs(s.Fragment,{children:[s.jsx(le,{children:s.jsx(xe,{tooltip:"Browse agents",className:"bg-muted/75 hover:bg-sidebar-accent",onClick:()=>{se("agent_browser_opened",{surface:"mobile_drawer"}),n(!0)},children:s.jsx(Ge,{className:"!opacity-100"})})}),s.jsx(Tt,{open:e,onOpenChange:n,direction:"bottom",children:s.jsxs(Rt,{className:"max-h-[85dvh] p-0",children:[s.jsx(Et,{className:"sr-only",children:"Browse agents"}),I]})})]}):s.jsxs(st,{open:e,onOpenChange:B=>{B&&!e&&se("agent_browser_opened",{surface:"desktop_popover"}),n(B)},children:[s.jsx(le,{children:s.jsx(nt,{asChild:!0,children:s.jsx(xe,{tooltip:"Browse agents",className:"bg-muted/75 hover:bg-sidebar-accent",children:s.jsx(Ge,{className:"!opacity-100"})})})}),s.jsx(ot,{className:"w-[380px] p-0 overflow-hidden",side:"right",align:"start",children:I})]}),t[6]=h,t[7]=e,t[8]=I,t[9]=F):F=t[9];let O;t[10]!==o?(O=s.jsx(to,{open:o,onOpenChange:i}),t[10]=o,t[11]=O):O=t[11];let z;t[12]!==l?(z=s.jsx(so,{open:l,onOpenChange:r}),t[12]=l,t[13]=z):z=t[13];let E;t[14]!==a?(E=s.jsx(En,{open:a,onOpenChange:c}),t[14]=a,t[15]=E):E=t[15];let P;t[16]!==u?(P=s.jsx(no,{open:u,onOpenChange:d}),t[16]=u,t[17]=P):P=t[17];let k;t[18]!==m?(k=s.jsx(oo,{open:m,onOpenChange:x}),t[18]=m,t[19]=k):k=t[19];let w;t[20]!==f?(w=s.jsx(io,{open:f,onOpenChange:p}),t[20]=f,t[21]=w):w=t[21];let M;t[22]!==C?(M=s.jsx(Dn,{open:C,onOpenChange:$}),t[22]=C,t[23]=M):M=t[23];let D;t[24]!==g?(D=s.jsx(Ln,{open:g,onOpenChange:N}),t[24]=g,t[25]=D):D=t[25];let A;return t[26]!==D||t[27]!==F||t[28]!==O||t[29]!==z||t[30]!==E||t[31]!==P||t[32]!==k||t[33]!==w||t[34]!==M?(A=s.jsxs(s.Fragment,{children:[F,O,z,E,P,k,w,M,D]}),t[26]=D,t[27]=F,t[28]=O,t[29]=z,t[30]=E,t[31]=P,t[32]=k,t[33]=w,t[34]=M,t[35]=A):A=t[35],A}function Gi(){const t=R.c(34),e=Bt(),{org:n}=he();let o;t[0]!==e?(o=e.filter(Ki).map(Vi),t[0]=e,t[1]=o):o=t[1];const i=o,{pinnedIds:l,unpin:r,reorder:a}=Vt(n.id,i),c=new Map(e.map(Hi)),u=l.map(A=>c.get(A)).filter(Bi);let d;t[2]===Symbol.for("react.memo_cache_sentinel")?(d={activationConstraint:{distance:5}},t[2]=d):d=t[2];let m;t[3]===Symbol.for("react.memo_cache_sentinel")?(m={coordinateGetter:qn},t[3]=m):m=t[3];const x=Un(mt(Bn,d),mt(Gn,m));let f;t[4]!==l||t[5]!==a?(f=A=>{const{active:B,over:U}=A;if(!U||B.id===U.id)return;const L=l.indexOf(B.id),H=l.indexOf(U.id);L===-1||H===-1||a(Qn([...l],L,H))},t[4]=l,t[5]=a,t[6]=f):f=t[6];const p=f,C=Pe,$="py-0 px-0 mt-2 flex-1 min-h-0";let g;t[7]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx("div",{className:"h-px bg-border mx-2 mb-2"}),t[7]=g):g=t[7];const N=Te,h="flex flex-1 min-h-0 flex-col overflow-y-auto [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden",y=pe,j="gap-2";let b;t[8]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(Ui,{}),t[8]=b):b=t[8];const v=Kn,I=Wn,F=Hn,O=Vn;let z;t[9]!==n.slug||t[10]!==r?(z=A=>s.jsx(Ai,{agent:A,org:n.slug,onUnpin:()=>r(A.id)},A.id),t[9]=n.slug,t[10]=r,t[11]=z):z=t[11];const E=u.map(z);let P;t[12]!==F||t[13]!==l||t[14]!==O||t[15]!==E?(P=s.jsx(F,{items:l,strategy:O,children:E}),t[12]=F,t[13]=l,t[14]=O,t[15]=E,t[16]=P):P=t[16];let k;t[17]!==v||t[18]!==p||t[19]!==x||t[20]!==P||t[21]!==I?(k=s.jsx(v,{sensors:x,collisionDetection:I,onDragEnd:p,children:P}),t[17]=v,t[18]=p,t[19]=x,t[20]=P,t[21]=I,t[22]=k):k=t[22];let w;t[23]!==y||t[24]!==k||t[25]!==b?(w=s.jsxs(y,{className:j,children:[b,k]}),t[23]=y,t[24]=k,t[25]=b,t[26]=w):w=t[26];let M;t[27]!==N||t[28]!==w?(M=s.jsx(N,{className:h,children:w}),t[27]=N,t[28]=w,t[29]=M):M=t[29];let D;return t[30]!==C||t[31]!==M||t[32]!==g?(D=s.jsxs(C,{className:$,children:[g,M]}),t[30]=C,t[31]=M,t[32]=g,t[33]=D):D=t[33],D}function Bi(t){return!!t}function Hi(t){return[t.id,t]}function Vi(t){return t.id}function Ki(t){return t.pinned}function as(){const t=R.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(S.Suspense,{fallback:s.jsx(Pe,{className:"py-0 px-0",children:s.jsx(Te,{children:s.jsx(pe,{className:"gap-2",children:s.jsx(le,{children:s.jsxs("div",{className:"flex items-center gap-2 px-2 py-2",children:[s.jsx(Ue,{className:"h-4 w-4 rounded"}),s.jsx(Ue,{className:"h-4 flex-1"})]})})})})}),children:s.jsx(Gi,{})}),t[0]=e):e=t[0],e}function Xl(){const t=R.c(4),e=Wt();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Wo,{}),t[0]=n):n=t[0];let o;t[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(tt,{children:s.jsx(S.Suspense,{fallback:null,children:s.jsx(as,{})})}),t[1]=o):o=t[1];let i;return t[2]!==e?(i=s.jsx(Yt,{sections:e,footer:n,additionalContent:o}),t[2]=e,t[3]=i):i=t[3],i}function Jl(t){const e=R.c(5),{onClose:n}=t,o=Wt();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(qo,{}),e[0]=i):i=e[0];let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(tt,{children:s.jsx(S.Suspense,{fallback:null,children:s.jsx(as,{})})}),e[1]=l):l=e[1];let r;return e[2]!==n||e[3]!==o?(r=s.jsx(So,{sections:o,onClose:n,footer:i,additionalContent:l}),e[2]=n,e[3]=o,e[4]=r):r=e[4],r}function Wi(){const t=R.c(6),{org:e,locator:n}=he(),o=Be();let i;t[0]!==n||t[1]!==o?(i=()=>{o.invalidateQueries({queryKey:Mt.tasksPrefix(n)})},t[0]=n,t[1]=o,t[2]=i):i=t[2];let l;t[3]!==e.slug||t[4]!==i?(l={orgSlug:e.slug,onTaskStatus:i},t[3]=e.slug,t[4]=i,t[5]=l):l=t[5],uo(l)}function qi(t){const e=R.c(8),{virtualMcpId:n,size:o,showAutomationBadge:i}=t,l=o===void 0?"sm":o;let r;e[0]!==l||e[1]!==n?(r=n?s.jsx(Qi,{virtualMcpId:n,size:l}):s.jsx($e,{icon:null,name:"?",size:l}),e[0]=l,e[1]=n,e[2]=r):r=e[2];let a;e[3]!==i?(a=i&&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(fo,{size:10,className:"text-white"})}),e[3]=i,e[4]=a):a=e[4];let c;return e[5]!==r||e[6]!==a?(c=s.jsxs("div",{className:"relative shrink-0",children:[r,a]}),e[5]=r,e[6]=a,e[7]=c):c=e[7],c}function Qi(t){const e=R.c(6),{virtualMcpId:n,size:o}=t,i=Ht(n);if(!i){let a;return e[0]!==o?(a=s.jsx($e,{icon:null,name:"?",size:o}),e[0]=o,e[1]=a):a=e[1],a}const l=i.icon??null;let r;return e[2]!==i.title||e[3]!==o||e[4]!==l?(r=s.jsx($e,{icon:l,name:i.title,size:o}),e[2]=i.title,e[3]=o,e[4]=l,e[5]=r):r=e[5],r}function Yi(t){const e=t?.metadata?.githubRepo;return e?.connectionId&&t?.connections?.some(o=>o.connection_id===e.connectionId)?e:null}function Xi(t){const e=R.c(47),{task:n,isActive:o,onClick:i,onArchive:l,showAutomationBadge:r}=t,a=xo(n.status),c=a.icon,u=Ht(n.virtual_mcp_id);let d;e[0]!==u?(d=Yi(u),e[0]=u,e[1]=d):d=e[1];const m=d,x=S.useRef(null);let f;e[2]!==o?(f=()=>{if(!o)return;const V=x.current;V&&(V.focus({preventScroll:!0}),V.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"}))},e[2]=o,e[3]=f):f=e[3];let p;e[4]!==o||e[5]!==n.id?(p=[o,n.id],e[4]=o,e[5]=n.id,e[6]=p):p=e[6],S.useEffect(f,p);const C="button",$=0;let g;e[7]!==i?(g=V=>{V.target===V.currentTarget&&(V.key==="Enter"||V.key===" ")&&(V.preventDefault(),i())},e[7]=i,e[8]=g):g=e[8];const N=o?"bg-accent":"hover:bg-accent/60";let h;e[9]!==N?(h=J("group/row flex items-center gap-3 px-2 py-1.5 rounded-md cursor-pointer transition-colors","focus-visible:outline-none focus-visible:inset-ring-2 focus-visible:inset-ring-ring/50",N),e[9]=N,e[10]=h):h=e[10];let y;e[11]!==r||e[12]!==n.virtual_mcp_id?(y=s.jsx(qi,{virtualMcpId:n.virtual_mcp_id,size:"xs",showAutomationBadge:r}),e[11]=r,e[12]=n.virtual_mcp_id,e[13]=y):y=e[13];const j=n.title||"Untitled task";let b;e[14]!==j?(b=s.jsx("div",{className:"text-sm text-foreground truncate",children:j}),e[14]=j,e[15]=b):b=e[15];let v;e[16]!==m||e[17]!==n.branch||e[18]!==n.updated_at?(v=n.updated_at&&s.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground min-w-0",children:[n.branch?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"truncate font-mono",children:n.branch}),s.jsx("span",{className:"shrink-0",children:"·"})]}):m?s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"truncate",children:[m.owner,"/",m.name]}),s.jsx("span",{className:"shrink-0",children:"·"})]}):null,s.jsx("span",{className:"shrink-0",children:nn(new Date(n.updated_at))})]}),e[16]=m,e[17]=n.branch,e[18]=n.updated_at,e[19]=v):v=e[19];let I;e[20]!==b||e[21]!==v?(I=s.jsxs("div",{className:"flex-1 min-w-0",children:[b,v]}),e[20]=b,e[21]=v,e[22]=I):I=e[22];const F="shrink-0 grid [grid-template-areas:'slot'] items-center justify-items-center",O="[grid-area:slot] flex size-7 items-center justify-center group-hover/row:invisible",z=a.label,E=14,P=J(a.iconClassName,n.status==="in_progress"&&"animate-spin");let k;e[23]!==c||e[24]!==P?(k=s.jsx(c,{size:E,className:P}),e[23]=c,e[24]=P,e[25]=k):k=e[25];let w;e[26]!==a||e[27]!==k?(w=s.jsx("span",{className:O,"aria-label":z,children:k}),e[26]=a,e[27]=k,e[28]=w):w=e[28];let M;e[29]!==l?(M=V=>{V.stopPropagation(),l()},e[29]=l,e[30]=M):M=e[30];let D;e[31]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx(mo,{size:14}),e[31]=D):D=e[31];let A;e[32]!==M?(A=s.jsx(Ye,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":"Archive task",onClick:M,className:"[grid-area:slot] invisible group-hover/row:visible flex size-7 items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-muted",children:D})}),e[32]=M,e[33]=A):A=e[33];let B;e[34]===Symbol.for("react.memo_cache_sentinel")?(B=s.jsx(Xe,{side:"right",children:"Archive"}),e[34]=B):B=e[34];let U;e[35]!==A?(U=s.jsxs(Je,{children:[A,B]}),e[35]=A,e[36]=U):U=e[36];let L;e[37]!==w||e[38]!==U?(L=s.jsxs("div",{className:F,children:[w,U]}),e[37]=w,e[38]=U,e[39]=L):L=e[39];let H;return e[40]!==i||e[41]!==I||e[42]!==L||e[43]!==g||e[44]!==h||e[45]!==y?(H=s.jsxs("div",{ref:x,role:C,tabIndex:$,onClick:i,onKeyDown:g,className:h,children:[y,I,L]}),e[40]=i,e[41]=I,e[42]=L,e[43]=g,e[44]=h,e[45]=y,e[46]=H):H=e[46],H}const cs={all:"All tasks",manual:"Chats",automation:"Automation"},ds={all:"All members",mine:"Mine only"};function Ji(t){const e=R.c(59),{title:n,tasks:o,activeTaskId:i,onSelect:l,onArchive:r,onNew:a,showNewButton:c,showAutomationBadge:u,emptyLabel:d,currentUserId:m}=t,[x,f]=S.useState("all"),[p,C]=S.useState("mine");let $;e[0]!==m||e[1]!==p||e[2]!==o?($=p==="mine"&&m?o.filter(_=>_.created_by===m):o,e[0]=m,e[1]=p,e[2]=o,e[3]=$):$=e[3];const g=$;let N;e[4]!==x||e[5]!==g?(N=x==="automation"?g.filter(sl):x==="manual"?g.filter(tl):g,e[4]=x,e[5]=g,e[6]=N):N=e[6];const h=N;let y;e[7]!==n?(y=s.jsx("span",{children:n}),e[7]=n,e[8]=y):y=e[8];let j;e[9]!==p?(j=s.jsx(pt,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":"Filter by member",className:"flex size-8 items-center justify-center rounded-md hover:bg-muted hover:text-foreground",children:p==="mine"?s.jsx(Js,{size:16}):s.jsx(Ft,{size:16})})}),e[9]=p,e[10]=j):j=e[10];let b;e[11]!==p?(b=_=>{const K=_;K!==p&&se("tasks_panel_member_filter_changed",{to_value:K}),C(K)},e[11]=p,e[12]=b):b=e[12];let v;e[13]===Symbol.for("react.memo_cache_sentinel")?(v=Object.keys(ds),e[13]=v):v=e[13];let I;e[14]===Symbol.for("react.memo_cache_sentinel")?(I=v.map(el),e[14]=I):I=e[14];let F;e[15]!==p||e[16]!==b?(F=s.jsx(ht,{align:"end",children:s.jsx(gt,{value:p,onValueChange:b,children:I})}),e[15]=p,e[16]=b,e[17]=F):F=e[17];let O;e[18]!==j||e[19]!==F?(O=s.jsxs(bt,{children:[j,F]}),e[18]=j,e[19]=F,e[20]=O):O=e[20];const z=x!=="all"&&"text-purple-500";let E;e[21]!==z?(E=J("flex size-8 items-center justify-center rounded-md hover:bg-muted hover:text-foreground",z),e[21]=z,e[22]=E):E=e[22];let P;e[23]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsx(rn,{size:16}),e[23]=P):P=e[23];let k;e[24]!==E?(k=s.jsx(pt,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":"Filter tasks",className:E,children:P})}),e[24]=E,e[25]=k):k=e[25];let w;e[26]!==x?(w=_=>{const K=_;K!==x&&se("tasks_panel_filter_changed",{to_value:K}),f(K)},e[26]=x,e[27]=w):w=e[27];let M;e[28]===Symbol.for("react.memo_cache_sentinel")?(M=Object.keys(cs),e[28]=M):M=e[28];let D;e[29]===Symbol.for("react.memo_cache_sentinel")?(D=M.map(Zi),e[29]=D):D=e[29];let A;e[30]!==x||e[31]!==w?(A=s.jsx(ht,{align:"end",children:s.jsx(gt,{value:x,onValueChange:w,children:D})}),e[30]=x,e[31]=w,e[32]=A):A=e[32];let B;e[33]!==k||e[34]!==A?(B=s.jsxs(bt,{children:[k,A]}),e[33]=k,e[34]=A,e[35]=B):B=e[35];let U;e[36]!==a||e[37]!==c||e[38]!==n?(U=c&&a&&s.jsx("button",{type:"button",onClick:()=>{se("tasks_panel_new_clicked"),a()},"aria-label":`New ${n.toLowerCase()}`,className:"flex size-8 items-center justify-center rounded-md hover:bg-muted hover:text-foreground",children:s.jsx(Xs,{size:16})}),e[36]=a,e[37]=c,e[38]=n,e[39]=U):U=e[39];let L;e[40]!==B||e[41]!==U||e[42]!==O?(L=s.jsxs("div",{className:"flex items-center gap-0.5",children:[O,B,U]}),e[40]=B,e[41]=U,e[42]=O,e[43]=L):L=e[43];let H;e[44]!==L||e[45]!==y?(H=s.jsxs("div",{className:"shrink-0 pl-2 pr-1.5 h-7 flex items-center justify-between text-xs font-medium text-muted-foreground mb-1",children:[y,L]}),e[44]=L,e[45]=y,e[46]=H):H=e[46];let V;e[47]!==i||e[48]!==d||e[49]!==r||e[50]!==l||e[51]!==u||e[52]!==h?(V=h.length===0&&d?s.jsx("div",{className:"px-2 py-1.5 text-xs text-muted-foreground/70",children:d}):h.map(_=>s.jsx(Xi,{task:_,isActive:i===_.id,onClick:()=>{i!==_.id&&se("tasks_panel_task_clicked",{thread_id:_.id,virtual_mcp_id:_.virtual_mcp_id??null,from_automation:!!_.fromAutomation}),l(_)},onArchive:()=>{se("tasks_panel_task_archived",{thread_id:_.id,virtual_mcp_id:_.virtual_mcp_id??null}),r(_)},showAutomationBadge:u||_.fromAutomation},_.id)),e[47]=i,e[48]=d,e[49]=r,e[50]=l,e[51]=u,e[52]=h,e[53]=V):V=e[53];let q;e[54]!==V?(q=s.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto flex flex-col gap-0.5",children:V}),e[54]=V,e[55]=q):q=e[55];let Q;return e[56]!==H||e[57]!==q?(Q=s.jsxs("div",{className:"flex flex-col h-full min-h-0 mt-1",children:[H,q]}),e[56]=H,e[57]=q,e[58]=Q):Q=e[58],Q}function Zi(t){return s.jsx(Kt,{value:t,children:cs[t]},t)}function el(t){return s.jsx(Kt,{value:t,children:ds[t]},t)}function tl(t){return!t.fromAutomation}function sl(t){return t.fromAutomation}function nl(){const t=R.c(23);Wi();const{data:e}=_e.useSession(),n=e?.user?.id;let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={owner:"me",status:"open",hasTrigger:!1},t[0]=o):o=t[0];const{tasks:i}=xt(o);let l;t[1]===Symbol.for("react.memo_cache_sentinel")?(l={owner:"all",status:"open",hasTrigger:!0},t[1]=l):l=t[1];const{tasks:r}=xt(l),{setTaskId:a,createNewTask:c}=At();let u;t[2]===Symbol.for("react.memo_cache_sentinel")?(u={strict:!1},t[2]=u):u=t[2];const d=et(u),{locator:m,org:x}=he(),f=Be();let p;t[3]!==x.id||t[4]!==x.slug?(p={connectionId:Ut,orgId:x.id,orgSlug:x.slug},t[3]=x.id,t[4]=x.slug,t[5]=p):p=t[5];const C=Gt(p),$=d.taskId??null;let g;t[6]!==r||t[7]!==i?(g=[...i,...r.map(il)].sort(ol),t[6]=r,t[7]=i,t[8]=g):g=t[8];const N=g;let h;t[9]!==C||t[10]!==m||t[11]!==f?(h=async v=>{try{await co(C,v.id,{hidden:!0}),f.invalidateQueries({queryKey:Mt.tasksPrefix(m)})}catch(I){const O=I;be.error(`Failed to archive task: ${O.message}`)}},t[9]=C,t[10]=m,t[11]=f,t[12]=h):h=t[12];const y=h;if(N.length===0){let v;return t[13]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx("div",{className:"h-full flex items-center justify-center p-4",children:s.jsx(ao,{image:s.jsx(Zs,{size:48,className:"text-muted-foreground"}),title:"No tasks yet",description:"Start a conversation to create your first task."})}),t[13]=v):v=t[13],v}let j;t[14]!==a?(j=v=>a(v.id,v.virtual_mcp_id),t[14]=a,t[15]=j):j=t[15];let b;return t[16]!==$||t[17]!==N||t[18]!==c||t[19]!==n||t[20]!==y||t[21]!==j?(b=s.jsx("div",{className:"flex flex-col h-full min-h-0 p-2 gap-3",children:s.jsx(Ji,{title:"Tasks",tasks:N,activeTaskId:$,onSelect:j,onArchive:y,onNew:c,showNewButton:!0,currentUserId:n})}),t[16]=$,t[17]=N,t[18]=c,t[19]=n,t[20]=y,t[21]=j,t[22]=b):b=t[22],b}function ol(t,e){return(e.updated_at??"").localeCompare(t.updated_at??"")}function il(t){return{...t,fromAutomation:!0}}function ll(){const t=R.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex flex-col h-full p-2 gap-1.5",children:Array.from({length:6}).map(rl)}),t[0]=e):e=t[0],e}function rl(t,e){return s.jsx("div",{className:"h-10 rounded-md bg-muted/60 animate-pulse"},e)}function Zl(){const t=R.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Fn.Skeleton,{}),t[0]=e):e=t[0];let n;return t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(tt,{fallback:e,children:s.jsx(S.Suspense,{fallback:s.jsx(ll,{}),children:s.jsx(nl,{})})}),t[1]=n):n=t[1],n}export{Xl as S,Zl as T,Jl as a,Yi as g};
@@ -1,4 +1,4 @@
1
- import{co as Fe,bm as Os,J as oe,I as ge,aZ as ti,bR as _i,aJ as Ie,bk as mt,a_ as qe,ap as mr,cp as rn,H as _e,cq as Ii,cr as ws,cs as ec,bP as tc,ct as ia,cu as nc,cv as rc,cw as ic,cx as fn,cy as Tr,cz as xs,bK as sa,bC as sc,aI as ze,bQ as oc,aH as On,ba as Ci,cA as ac,r as N,j as w,cB as oa,cC as lc}from"./index-CsB6QrBB.js";import{f as cc,h as uc,n as fc,j as dc,C as hc,A as pc}from"./constants-CiNOCN3_.js";import{B as Ti,c as Pi}from"./collections-CgxUTBvp.js";import{R as Es}from"./index-CNmK2UE6.js";var mc=class{apply(e,t){if(!t.type)return;const n=Array.isArray(t.type)?t.type:[t.type],r=new Set(n);if(r.has("string")||(e.string=!1),!r.has("number")&&!r.has("integer")&&(e.number=!1),r.has("boolean")||(e.boolean=!1),r.has("null")||(e.null=!1),r.has("array")||(e.array=!1),r.has("object")||(e.object=!1),r.has("integer")&&e.number!==!1){const i=e.number||ge();i instanceof rn&&(e.number=i.int())}}},yc=class{apply(e,t){if(t.const===void 0)return;const n=t.const;e.string=!1,e.number=!1,e.boolean=!1,e.null=!1,e.array=!1,e.object=!1,typeof n=="string"?e.string=qe(n):typeof n=="number"?e.number=qe(n):typeof n=="boolean"?e.boolean=qe(n):n===null?e.null=_i():Array.isArray(n)?e.array=void 0:typeof n=="object"&&(e.object=void 0)}},gc=class{apply(e,t){if(!t.enum)return;if(t.enum.length===0){t.type||(e.string=!1,e.number=!1,e.boolean=!1,e.null=!1,e.array=!1,e.object=!1);return}const n={string:t.enum.filter(r=>typeof r=="string"),number:t.enum.filter(r=>typeof r=="number"),boolean:t.enum.filter(r=>typeof r=="boolean"),null:t.enum.filter(r=>r===null),array:t.enum.filter(r=>Array.isArray(r)),object:t.enum.filter(r=>typeof r=="object"&&r!==null&&!Array.isArray(r))};e.string=this.createTypeSchema(n.string,"string"),e.number=this.createTypeSchema(n.number,"number"),e.boolean=this.createTypeSchema(n.boolean,"boolean"),e.null=n.null.length>0?_i():!1,e.array=n.array.length>0?void 0:!1,e.object=n.object.length>0?void 0:!1}createTypeSchema(e,t){if(e.length===0)return!1;if(e.length===1)return qe(e[0]);if(t==="string")return mr(e);if(t==="number"){const[n,r,...i]=e;return mt([qe(n),qe(r),...i.map(s=>qe(s))])}return t==="boolean"?mt([qe(!0),qe(!1)]):!1}},bc=class{apply(e,t){const n=t;if(n.type==="string"&&n.format==="binary"&&n.contentEncoding==="binary"){let r=ic();n.minLength!==void 0&&(r=r.min(n.minLength)),n.maxLength!==void 0&&(r=r.max(n.maxLength)),n.contentMediaType!==void 0&&(r=r.mime(n.contentMediaType)),e.file=r,e.string=!1}}},Sc=class{apply(e,t){const n=t;t.type===void 0&&(n.minLength!==void 0||n.maxLength!==void 0||n.pattern!==void 0)&&e.string===void 0&&(e.string=oe())}},vc=class{apply(e,t){const n=t;if(n.minLength!==void 0&&e.string!==!1){const r=e.string||oe();r instanceof Ii&&(e.string=r.refine(i=>Array.from(i).length>=n.minLength,{message:`String must be at least ${n.minLength} characters long`}))}}},Oc=class{apply(e,t){const n=t;if(n.maxLength!==void 0&&e.string!==!1){const r=e.string||oe();r instanceof Ii&&(e.string=r.refine(i=>Array.from(i).length<=n.maxLength,{message:`String must be at most ${n.maxLength} characters long`}))}}},wc=class{apply(e,t){const n=t;if(n.pattern&&e.string!==!1){const r=e.string||oe();if(r instanceof Ii){const i=new RegExp(n.pattern);e.string=r.regex(i)}}}},xc=class{apply(e,t){const n=t;if(n.minimum!==void 0&&e.number!==!1){const r=e.number||ge();r instanceof rn&&(e.number=r.min(n.minimum))}}},Ec=class{apply(e,t){const n=t;if(n.maximum!==void 0&&e.number!==!1){const r=e.number||ge();r instanceof rn&&(e.number=r.max(n.maximum))}}},Ac=class{apply(e,t){const n=t;if(n.exclusiveMinimum!==void 0&&e.number!==!1){const r=e.number||ge();r instanceof rn&&(typeof n.exclusiveMinimum=="number"?e.number=r.gt(n.exclusiveMinimum):e.number=!1)}}},_c=class{apply(e,t){const n=t;if(n.exclusiveMaximum!==void 0&&e.number!==!1){const r=e.number||ge();r instanceof rn&&(typeof n.exclusiveMaximum=="number"?e.number=r.lt(n.exclusiveMaximum):e.number=!1)}}},Ic=class{apply(e,t){const n=t;if(n.multipleOf!==void 0&&e.number!==!1){const r=e.number||ge();r instanceof rn&&(e.number=r.refine(i=>{if(n.multipleOf===0)return!1;const s=i/n.multipleOf,o=Math.round(s),a=Math.min(Math.abs(i)*Number.EPSILON*10,Math.abs(n.multipleOf)*Number.EPSILON*10);return Math.abs(s-o)<=a/Math.abs(n.multipleOf)},{message:`Must be a multiple of ${n.multipleOf}`}))}}},Cc=class{apply(e,t){const n=t;t.type===void 0&&(n.minItems!==void 0||n.maxItems!==void 0||n.items!==void 0||n.prefixItems!==void 0)&&e.array===void 0&&(e.array=Ie(Fe()))}},Tc=class{apply(e,t){const n=t;n.minItems!==void 0&&e.array!==!1&&(e.array=(e.array||Ie(Fe())).min(n.minItems))}},Pc=class{apply(e,t){const n=t;n.maxItems!==void 0&&e.array!==!1&&(e.array=(e.array||Ie(Fe())).max(n.maxItems))}},Fc=class{apply(e,t){const n=t;if(e.array!==!1)if(Array.isArray(n.items))e.array=e.array||Ie(Fe());else if(n.items&&typeof n.items!="boolean"&&!n.prefixItems){const r=Ae(n.items);let i=Ie(r);if(e.array&&e.array instanceof ec){const s=e.array._def;s.checks&&s.checks.forEach(o=>{if(o._zod&&o._zod.def){const a=o._zod.def;a.check==="min_length"&&a.minimum!==void 0?i=i.min(a.minimum):a.check==="max_length"&&a.maximum!==void 0&&(i=i.max(a.maximum))}})}e.array=i}else typeof n.items=="boolean"&&n.items===!1?n.prefixItems?e.array=e.array||Ie(Fe()):e.array=Ie(Fe()).max(0):typeof n.items=="boolean"&&n.items===!0?e.array=e.array||Ie(Fe()):n.prefixItems&&(e.array=e.array||Ie(Fe()))}},jc=class{apply(e,t){if(t.type!=="array")return;const n=t;if(!Array.isArray(n.items)||e.array===!1)return;const r=n.items.map(s=>Ae(s));let i;r.length===0?i=ws([]):i=ws(r),n.minItems!==void 0&&n.minItems>r.length&&(i=!1),n.maxItems!==void 0&&n.maxItems<r.length&&(i=!1),e.tuple=i,e.array=!1}},$c=class{apply(e,t){const n=t;e.object!==!1&&(n.properties||n.required||n.additionalProperties!==void 0)&&(e.object=e.object||_e({}).passthrough())}},Dc=class{apply(e,t){const n=t;t.type===void 0&&(n.maxProperties!==void 0||n.minProperties!==void 0)&&e.object===void 0&&(e.object=_e({}).passthrough())}},Nc=class{apply(e,t){const n=t;if(n.maxProperties!==void 0&&e.object!==!1){const r=e.object||_e({}).passthrough();e.object=r.refine(i=>Object.keys(i).length<=n.maxProperties,{message:`Object must have at most ${n.maxProperties} properties`})}}},Rc=class{apply(e,t){const n=t;if(n.minProperties!==void 0&&e.object!==!1){const r=e.object||_e({}).passthrough();e.object=r.refine(i=>Object.keys(i).length>=n.minProperties,{message:`Object must have at least ${n.minProperties} properties`})}}};function Tn(e,t){if(e===t)return!0;if(e==null||t==null)return e===t;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t))return e.length!==t.length?!1:e.every((n,r)=>Tn(n,t[r]));if(typeof e=="object"&&typeof t=="object"){const n=Object.keys(e),r=Object.keys(t);return n.length!==r.length?!1:n.every(i=>r.includes(i)&&Tn(e[i],t[i]))}return!1}function Mc(){return e=>{if(!Array.isArray(e))return!0;const t=[];return e.every(n=>t.some(i=>Tn(n,i))?!1:(t.push(n),!0))}}function cr(e,t){return e.safeParse(t).success}var Uc=class{apply(e,t){if(!t.not)return e;const n=Ae(t.not);return e.refine(r=>!cr(n,r),{message:"Value must not match the 'not' schema"})}},kc=class{apply(e,t){return t.uniqueItems!==!0?e:e.refine(Mc(),{message:"Array items must be unique"})}},Lc=class{apply(e,t){return!t.allOf||t.allOf.length===0?e:t.allOf.map(r=>Ae(r)).reduce((r,i)=>ia(r,i),e)}},Bc=class{apply(e,t){if(!t.anyOf||t.anyOf.length===0)return e;const n=t.anyOf.length===1?Ae(t.anyOf[0]):mt([Ae(t.anyOf[0]),Ae(t.anyOf[1]),...t.anyOf.slice(2).map(r=>Ae(r))]);return ia(e,n)}},Wc=class{apply(e,t){if(!t.oneOf||t.oneOf.length===0)return e;const n=t.oneOf.map(r=>Ae(r));return e.refine(r=>{let i=0;for(const s of n)if(s.safeParse(r).success&&(i++,i>1))return!1;return i===1},{message:"Value must match exactly one of the oneOf schemas"})}},qc=class{apply(e,t){const n=t;if(n.prefixItems&&Array.isArray(n.prefixItems)){const i=n.prefixItems.map(s=>Ae(s));return e.refine(s=>{if(!Array.isArray(s))return!0;for(let o=0;o<Math.min(s.length,i.length);o++)if(!cr(i[o],s[o]))return!1;if(s.length>i.length){if(typeof n.items=="boolean"&&n.items===!1)return!1;if(n.items&&typeof n.items=="object"&&!Array.isArray(n.items)){const o=Ae(n.items);for(let a=i.length;a<s.length;a++)if(!cr(o,s[a]))return!1}}return!0},{message:"Array does not match prefixItems schema"})}return e}},Vc=class{apply(e,t){const n=t;if(!n.properties&&!n.required&&n.additionalProperties!==!1)return e;if(e instanceof nc||e instanceof rc){const r={};if(n.properties)for(const[i,s]of Object.entries(n.properties))s!==void 0&&(r[i]=Ae(s));if(n.required&&Array.isArray(n.required)){const i=new Set(n.required);for(const s of Object.keys(r))i.has(s)||(r[s]=r[s].optional())}else for(const i of Object.keys(r))r[i]=r[i].optional();return n.additionalProperties===!1?_e(r):_e(r).passthrough()}return e.refine(r=>{if(typeof r!="object"||r===null||Array.isArray(r))return!0;if(n.properties){for(const[i,s]of Object.entries(n.properties))if(s!==void 0&&Object.getOwnPropertyDescriptor(r,i)!==void 0&&!Ae(s).safeParse(r[i]).success)return!1}if(n.required&&Array.isArray(n.required)){for(const i of n.required)if(!(Object.getOwnPropertyDescriptor(r,i)!==void 0))return!1}if(n.additionalProperties===!1&&n.properties){const i=new Set(Object.keys(n.properties));for(const s in r)if(!i.has(s))return!1}return!0},{message:"Object constraints validation failed"})}},Hc=class{apply(e,t){if(!t.enum||t.enum.length===0)return e;const n=t.enum.filter(r=>Array.isArray(r)||typeof r=="object"&&r!==null);return n.length===0?e:e.refine(r=>typeof r!="object"||r===null?!0:n.some(i=>Tn(r,i)),{message:"Value must match one of the enum values"})}},Kc=class{apply(e,t){if(t.const===void 0)return e;const n=t.const;return typeof n!="object"||n===null?e:e.refine(r=>Tn(r,n),{message:"Value must equal the const value"})}},Gc=class{apply(e,t){return t.description&&(e=e.describe(t.description)),e}},zc=class{apply(e,t){var n;const r=t;return!((n=r.required)!=null&&n.includes("__proto__"))||t.type!==void 0?e:Fe().refine(i=>this.validateRequired(i,r.required),{message:"Missing required properties"})}validateRequired(e,t){return typeof e!="object"||e===null||Array.isArray(e)?!0:t.every(n=>Object.prototype.hasOwnProperty.call(e,n))}},Yc=class{apply(e,t){var n;const r=t;if(r.contains===void 0)return e;const i=Ae(r.contains),s=(n=r.minContains)!=null?n:1,o=r.maxContains;return e.refine(a=>{if(!Array.isArray(a))return!0;let l=0;for(const c of a)cr(i,c)&&l++;return!(l<s||o!==void 0&&l>o)},{message:"Array must contain required items matching the schema"})}},Jc=class{apply(e,t){const{default:n}=t;return n===void 0||!e.safeParse(n).success?e:e.default(n)}},Zc=[new yc,new gc,new mc,new bc,new Sc,new Cc,new Dc,new vc,new Oc,new wc,new xc,new Ec,new Ac,new _c,new Ic,new jc,new Tc,new Pc,new Fc,new Nc,new Rc,new $c],Xc=[new zc,new Hc,new Kc,new Lc,new Bc,new Wc,new qc,new Vc,new Yc,new Uc,new kc,new Jc,new Gc];function Ae(e){if(typeof e=="boolean")return e?Fe():Os();const t={};for(const i of Zc)i.apply(t,e);const n=[];if(t.string!==!1&&n.push(t.string||oe()),t.number!==!1&&n.push(t.number||ge()),t.boolean!==!1&&n.push(t.boolean||ti()),t.null!==!1&&n.push(t.null||_i()),t.array!==!1&&n.push(t.array||Ie(Fe())),t.tuple!==!1&&t.tuple!==void 0&&n.push(t.tuple),t.object!==!1)if(t.object)n.push(t.object);else{const i=tc(s=>typeof s=="object"&&s!==null&&!Array.isArray(s),"Must be an object, not an array");n.push(i)}t.file!==!1&&t.file!==void 0&&n.push(t.file);let r;n.length===0?r=Os():n.length===1?r=n[0]:Object.keys(e).some(s=>s!=="$schema"&&s!=="title"&&s!=="description")?r=mt(n):r=Fe();for(const i of Xc)r=i.apply(r,e);return r}class As extends Event{constructor(t,n){var r,i;super(t),this.code=(r=n?.code)!=null?r:void 0,this.message=(i=n?.message)!=null?i:void 0}[Symbol.for("nodejs.util.inspect.custom")](t,n,r){return r(_s(this),n)}[Symbol.for("Deno.customInspect")](t,n){return t(_s(this),n)}}function Qc(e){const t=globalThis.DOMException;return typeof t=="function"?new t(e,"SyntaxError"):new SyntaxError(e)}function ni(e){return e instanceof Error?"errors"in e&&Array.isArray(e.errors)?e.errors.map(ni).join(", "):"cause"in e&&e.cause instanceof Error?`${e}: ${ni(e.cause)}`:e.message:`${e}`}function _s(e){return{type:e.type,message:e.message,code:e.code,defaultPrevented:e.defaultPrevented,cancelable:e.cancelable,timeStamp:e.timeStamp}}var aa=e=>{throw TypeError(e)},Fi=(e,t,n)=>t.has(e)||aa("Cannot "+n),G=(e,t,n)=>(Fi(e,t,"read from private field"),n?n.call(e):t.get(e)),Se=(e,t,n)=>t.has(e)?aa("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),he=(e,t,n,r)=>(Fi(e,t,"write to private field"),t.set(e,n),n),Qe=(e,t,n)=>(Fi(e,t,"access private method"),n),Ce,Et,kt,Qn,ur,wn,qt,xn,ct,Lt,Gt,Bt,mn,Re,ri,ii,si,Is,oi,ai,yn,li,ci;class er extends EventTarget{constructor(t,n){var r,i;super(),Se(this,Re),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,Se(this,Ce),Se(this,Et),Se(this,kt),Se(this,Qn),Se(this,ur),Se(this,wn),Se(this,qt),Se(this,xn,null),Se(this,ct),Se(this,Lt),Se(this,Gt,null),Se(this,Bt,null),Se(this,mn,null),Se(this,ii,async s=>{var o;G(this,Lt).reset();const{body:a,redirected:l,status:c,headers:u}=s;if(c===204){Qe(this,Re,yn).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(l?he(this,kt,new URL(s.url)):he(this,kt,void 0),c!==200){Qe(this,Re,yn).call(this,`Non-200 status code (${c})`,c);return}if(!(u.get("content-type")||"").startsWith("text/event-stream")){Qe(this,Re,yn).call(this,'Invalid content type, expected "text/event-stream"',c);return}if(G(this,Ce)===this.CLOSED)return;he(this,Ce,this.OPEN);const f=new Event("open");if((o=G(this,mn))==null||o.call(this,f),this.dispatchEvent(f),typeof a!="object"||!a||!("getReader"in a)){Qe(this,Re,yn).call(this,"Invalid response body, expected a web ReadableStream",c),this.close();return}const h=new TextDecoder,m=a.getReader();let d=!0;do{const{done:p,value:y}=await m.read();y&&G(this,Lt).feed(h.decode(y,{stream:!p})),p&&(d=!1,G(this,Lt).reset(),Qe(this,Re,li).call(this))}while(d)}),Se(this,si,s=>{he(this,ct,void 0),!(s.name==="AbortError"||s.type==="aborted")&&Qe(this,Re,li).call(this,ni(s))}),Se(this,oi,s=>{typeof s.id=="string"&&he(this,xn,s.id);const o=new MessageEvent(s.event||"message",{data:s.data,origin:G(this,kt)?G(this,kt).origin:G(this,Et).origin,lastEventId:s.id||""});G(this,Bt)&&(!s.event||s.event==="message")&&G(this,Bt).call(this,o),this.dispatchEvent(o)}),Se(this,ai,s=>{he(this,wn,s)}),Se(this,ci,()=>{he(this,qt,void 0),G(this,Ce)===this.CONNECTING&&Qe(this,Re,ri).call(this)});try{if(t instanceof URL)he(this,Et,t);else if(typeof t=="string")he(this,Et,new URL(t,eu()));else throw new Error("Invalid URL")}catch{throw Qc("An invalid or illegal string was specified")}he(this,Lt,cc({onEvent:G(this,oi),onRetry:G(this,ai)})),he(this,Ce,this.CONNECTING),he(this,wn,3e3),he(this,ur,(r=n?.fetch)!=null?r:globalThis.fetch),he(this,Qn,(i=n?.withCredentials)!=null?i:!1),Qe(this,Re,ri).call(this)}get readyState(){return G(this,Ce)}get url(){return G(this,Et).href}get withCredentials(){return G(this,Qn)}get onerror(){return G(this,Gt)}set onerror(t){he(this,Gt,t)}get onmessage(){return G(this,Bt)}set onmessage(t){he(this,Bt,t)}get onopen(){return G(this,mn)}set onopen(t){he(this,mn,t)}addEventListener(t,n,r){const i=n;super.addEventListener(t,i,r)}removeEventListener(t,n,r){const i=n;super.removeEventListener(t,i,r)}close(){G(this,qt)&&clearTimeout(G(this,qt)),G(this,Ce)!==this.CLOSED&&(G(this,ct)&&G(this,ct).abort(),he(this,Ce,this.CLOSED),he(this,ct,void 0))}}Ce=new WeakMap,Et=new WeakMap,kt=new WeakMap,Qn=new WeakMap,ur=new WeakMap,wn=new WeakMap,qt=new WeakMap,xn=new WeakMap,ct=new WeakMap,Lt=new WeakMap,Gt=new WeakMap,Bt=new WeakMap,mn=new WeakMap,Re=new WeakSet,ri=function(){he(this,Ce,this.CONNECTING),he(this,ct,new AbortController),G(this,ur)(G(this,Et),Qe(this,Re,Is).call(this)).then(G(this,ii)).catch(G(this,si))},ii=new WeakMap,si=new WeakMap,Is=function(){var e;const t={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...G(this,xn)?{"Last-Event-ID":G(this,xn)}:void 0},cache:"no-store",signal:(e=G(this,ct))==null?void 0:e.signal};return"window"in globalThis&&(t.credentials=this.withCredentials?"include":"same-origin"),t},oi=new WeakMap,ai=new WeakMap,yn=function(e,t){var n;G(this,Ce)!==this.CLOSED&&he(this,Ce,this.CLOSED);const r=new As("error",{code:t,message:e});(n=G(this,Gt))==null||n.call(this,r),this.dispatchEvent(r)},li=function(e,t){var n;if(G(this,Ce)===this.CLOSED)return;he(this,Ce,this.CONNECTING);const r=new As("error",{code:t,message:e});(n=G(this,Gt))==null||n.call(this,r),this.dispatchEvent(r),he(this,qt,setTimeout(G(this,ci),G(this,wn)))},ci=new WeakMap,er.CONNECTING=0,er.OPEN=1,er.CLOSED=2;function eu(){const e="document"in globalThis?globalThis.document:void 0;return e&&typeof e=="object"&&"baseURI"in e&&typeof e.baseURI=="string"?e.baseURI:void 0}class tu extends Error{constructor(t,n,r){super(`SSE error: ${n}`),this.code=t,this.event=r}}class nu{constructor(t,n){this._url=t,this._resourceMetadataUrl=void 0,this._scope=void 0,this._eventSourceInit=n?.eventSourceInit,this._requestInit=n?.requestInit,this._authProvider=n?.authProvider,this._fetch=n?.fetch,this._fetchWithInit=uc(n?.fetch,n?.requestInit)}async _authThenStart(){if(!this._authProvider)throw new fn("No auth provider");let t;try{t=await Tr(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(n){throw this.onerror?.(n),n}if(t!=="AUTHORIZED")throw new fn;return await this._startOrAuth()}async _commonHeaders(){const t={};if(this._authProvider){const r=await this._authProvider.tokens();r&&(t.Authorization=`Bearer ${r.access_token}`)}this._protocolVersion&&(t["mcp-protocol-version"]=this._protocolVersion);const n=fc(this._requestInit?.headers);return new Headers({...t,...n})}_startOrAuth(){const t=this?._eventSourceInit?.fetch??this._fetch??fetch;return new Promise((n,r)=>{this._eventSource=new er(this._url.href,{...this._eventSourceInit,fetch:async(i,s)=>{const o=await this._commonHeaders();o.set("Accept","text/event-stream");const a=await t(i,{...s,headers:o});if(a.status===401&&a.headers.has("www-authenticate")){const{resourceMetadataUrl:l,scope:c}=xs(a);this._resourceMetadataUrl=l,this._scope=c}return a}}),this._abortController=new AbortController,this._eventSource.onerror=i=>{if(i.code===401&&this._authProvider){this._authThenStart().then(n,r);return}const s=new tu(i.code,i.message,i);r(s),this.onerror?.(s)},this._eventSource.onopen=()=>{},this._eventSource.addEventListener("endpoint",i=>{const s=i;try{if(this._endpoint=new URL(s.data,this._url),this._endpoint.origin!==this._url.origin)throw new Error(`Endpoint origin does not match connection origin: ${this._endpoint.origin}`)}catch(o){r(o),this.onerror?.(o),this.close();return}n()}),this._eventSource.onmessage=i=>{const s=i;let o;try{o=sa.parse(JSON.parse(s.data))}catch(a){this.onerror?.(a);return}this.onmessage?.(o)}})}async start(){if(this._eventSource)throw new Error("SSEClientTransport already started! If using Client class, note that connect() calls start() automatically.");return await this._startOrAuth()}async finishAuth(t){if(!this._authProvider)throw new fn("No auth provider");if(await Tr(this._authProvider,{serverUrl:this._url,authorizationCode:t,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new fn("Failed to authorize")}async close(){this._abortController?.abort(),this._eventSource?.close(),this.onclose?.()}async send(t){if(!this._endpoint)throw new Error("Not connected");try{const n=await this._commonHeaders();n.set("content-type","application/json");const r={...this._requestInit,method:"POST",headers:n,body:JSON.stringify(t),signal:this._abortController?.signal},i=await(this._fetch??fetch)(this._endpoint,r);if(!i.ok){const s=await i.text().catch(()=>null);if(i.status===401&&this._authProvider){const{resourceMetadataUrl:o,scope:a}=xs(i);if(this._resourceMetadataUrl=o,this._scope=a,await Tr(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new fn;return this.send(t)}throw new Error(`Error POSTing to endpoint (HTTP ${i.status}): ${s}`)}await i.body?.cancel()}catch(n){throw this.onerror?.(n),n}}setProtocolVersion(t){this._protocolVersion=t}}const ru="mcp";class iu{constructor(t){this._url=t}start(){if(this._socket)throw new Error("WebSocketClientTransport already started! If using Client class, note that connect() calls start() automatically.");return new Promise((t,n)=>{this._socket=new WebSocket(this._url,ru),this._socket.onerror=r=>{const i="error"in r?r.error:new Error(`WebSocket error: ${JSON.stringify(r)}`);n(i),this.onerror?.(i)},this._socket.onopen=()=>{t()},this._socket.onclose=()=>{this.onclose?.()},this._socket.onmessage=r=>{let i;try{i=sa.parse(JSON.parse(r.data))}catch(s){this.onerror?.(s);return}this.onmessage?.(i)}})}async close(){this._socket?.close()}send(t){return new Promise((n,r)=>{if(!this._socket){r(new Error("Not connected"));return}this._socket?.send(JSON.stringify(t)),n()})}}class su extends dc{constructor(t,n){super(t,n)}send(t,n){const r=ou(t);return r?.type==="emit"?(this.onmessage?.(r.message),Promise.resolve()):r?.type==="suppress"?Promise.resolve():super.send(t,n)}}function ou(e){const t=e;if(!t||typeof t!="object"||!("method"in t))return null;switch(t.method){case"initialize":{const n=t?.params?.protocolVersion;return n?{type:"emit",message:{result:{protocolVersion:n,capabilities:{tools:{}},serverInfo:{name:"deco-chat-server",version:"1.0.0"}},jsonrpc:t.jsonrpc??"2.0",id:t.id}}:null}case"notifications/roots/list_changed":case"notifications/initialized":case"notifications/cancelled":case"notifications/progress":return{type:"suppress"};default:return null}}class au extends hc{constructor(t,n){super(t,n)}async listTools(t,n){return await this.request({method:"tools/list",params:t},sc,n)}}const lu=async(e,t,n)=>{const r=cu(e.connection,t,n);if(!r)throw new Error("Unknown MCP connection type");const i=new au({name:e?.name??"MCP Client",version:"1.0.0"});return await i.connect(r),{client:i}},cu=(e,t,n)=>{if(e.type==="Websocket")return new iu(new URL(e.url));if(e.type!=="SSE"&&e.type!=="HTTP")return null;const i={...e.token?{authorization:`Bearer ${e.token}`}:{},...n??{},..."headers"in e?e.headers||{}:{}};if(e.type==="SSE"){const s={requestInit:{headers:i,signal:t}};return e.token&&(s.eventSourceInit={fetch:(o,a)=>fetch(o,{...a,headers:{...i,Accept:"text/event-stream"},signal:t})}),new nu(new URL(e.url),s)}return new su(new URL(e.url),{requestInit:{headers:i,signal:t,credentials:"include"}})},Cs=e=>{try{return JSON.parse(e)}catch{return e}},zn=new Map,Ts=(e,t)=>({...e,id:e.name,inputSchema:e.inputSchema?Ae(e.inputSchema):void 0,outputSchema:e.outputSchema?Ae(e.outputSchema):void 0,execute:n=>t(n.context,e.name)});function uu(e){const t=n=>"connection"in e?lu({connection:e.connection},void 0,n):e.client;return new Proxy({},{get(n,r){if(r==="toJSON")return null;if(typeof r!="string")throw new Error("Name must be a string");if(r==="listTools")return a;async function i(l,c=r){const u=e?.debugId?.(),f=u?{"x-trace-debug-id":u}:void 0,{client:h}=await t(f),{structuredContent:m,isError:d,content:p}=await h.callTool({name:String(c),arguments:l});if(d){const S=p?.[0]?.text,O=typeof S=="string"?Cs(S):null,E=O?.code&&typeof e?.getErrorByStatusCode=="function"?e.getErrorByStatusCode(O.code,O.message,O.traceId):null;throw E||new Error(`Tool ${String(c)} returned an error: ${JSON.stringify(m??p)}`)}if(m!==void 0)return m;const y=p?.[0]?.text;return typeof y=="string"?Cs(y):void 0}async function s(){const{client:l}=await t(),{tools:c}=await l.listTools();return c}async function o(){if(!("connection"in e))return s();const l=e.connection,c=JSON.stringify(l);try{return zn.has(c)||zn.set(c,s()),await zn.get(c)}catch(u){console.error("Failed to list tools",u),zn.delete(c);return}}async function a(){return(await o()??[]).map(c=>Ts(c,i))}return i.asTool=async()=>{const c=(await o()??[]).find(u=>u.name===r);if(!c)throw new Error(`Tool ${r} not found`);return Ts(c,i)},i}})}new Proxy({},{get(e,t){return t==="toJSON"?null:t==="forConnection"?n=>fu({connection:n}):global[t]}});function fu(e){return uu(e)}const du=_e({toolName:oe().describe("Name of the tool to invoke on that connection"),transformCode:oe().optional().describe("Pure TypeScript function for data transformation of the tool call result. Must be a TypeScript file that declares the Output interface and exports a default function: `interface Output { ... } export default async function(stepInput): Output { ... }`\n The stepInput will match with the tool call outputSchema. If transformCode is not provided, the tool call result will be used as the step output.\n Providing an transformCode is recommended because it both allows you to transform the data and validate it against a JSON Schema - tools are ephemeral and may return unexpected data.")}),hu=_e({code:oe().describe(`Pure TypeScript function for data transformation. Useful to merge data from multiple steps and transform it. Must be a TypeScript file that declares the Output interface and exports a default function: \`interface Output { ... } export default async function(stepInput): Output { ... }\`
1
+ import{co as Fe,bm as Os,J as oe,I as ge,aZ as ti,bR as _i,aJ as Ie,bk as mt,a_ as qe,ap as mr,cp as rn,H as _e,cq as Ii,cr as ws,cs as ec,bP as tc,ct as ia,cu as nc,cv as rc,cw as ic,cx as fn,cy as Tr,cz as xs,bK as sa,bC as sc,aI as ze,bQ as oc,aH as On,ba as Ci,cA as ac,r as N,j as w,cB as oa,cC as lc}from"./index-CzOMQ7ME.js";import{f as cc,h as uc,n as fc,j as dc,C as hc,A as pc}from"./constants-CrCZOO5F.js";import{B as Ti,c as Pi}from"./collections-DbmVPIqC.js";import{R as Es}from"./index-CLwT6SqX.js";var mc=class{apply(e,t){if(!t.type)return;const n=Array.isArray(t.type)?t.type:[t.type],r=new Set(n);if(r.has("string")||(e.string=!1),!r.has("number")&&!r.has("integer")&&(e.number=!1),r.has("boolean")||(e.boolean=!1),r.has("null")||(e.null=!1),r.has("array")||(e.array=!1),r.has("object")||(e.object=!1),r.has("integer")&&e.number!==!1){const i=e.number||ge();i instanceof rn&&(e.number=i.int())}}},yc=class{apply(e,t){if(t.const===void 0)return;const n=t.const;e.string=!1,e.number=!1,e.boolean=!1,e.null=!1,e.array=!1,e.object=!1,typeof n=="string"?e.string=qe(n):typeof n=="number"?e.number=qe(n):typeof n=="boolean"?e.boolean=qe(n):n===null?e.null=_i():Array.isArray(n)?e.array=void 0:typeof n=="object"&&(e.object=void 0)}},gc=class{apply(e,t){if(!t.enum)return;if(t.enum.length===0){t.type||(e.string=!1,e.number=!1,e.boolean=!1,e.null=!1,e.array=!1,e.object=!1);return}const n={string:t.enum.filter(r=>typeof r=="string"),number:t.enum.filter(r=>typeof r=="number"),boolean:t.enum.filter(r=>typeof r=="boolean"),null:t.enum.filter(r=>r===null),array:t.enum.filter(r=>Array.isArray(r)),object:t.enum.filter(r=>typeof r=="object"&&r!==null&&!Array.isArray(r))};e.string=this.createTypeSchema(n.string,"string"),e.number=this.createTypeSchema(n.number,"number"),e.boolean=this.createTypeSchema(n.boolean,"boolean"),e.null=n.null.length>0?_i():!1,e.array=n.array.length>0?void 0:!1,e.object=n.object.length>0?void 0:!1}createTypeSchema(e,t){if(e.length===0)return!1;if(e.length===1)return qe(e[0]);if(t==="string")return mr(e);if(t==="number"){const[n,r,...i]=e;return mt([qe(n),qe(r),...i.map(s=>qe(s))])}return t==="boolean"?mt([qe(!0),qe(!1)]):!1}},bc=class{apply(e,t){const n=t;if(n.type==="string"&&n.format==="binary"&&n.contentEncoding==="binary"){let r=ic();n.minLength!==void 0&&(r=r.min(n.minLength)),n.maxLength!==void 0&&(r=r.max(n.maxLength)),n.contentMediaType!==void 0&&(r=r.mime(n.contentMediaType)),e.file=r,e.string=!1}}},Sc=class{apply(e,t){const n=t;t.type===void 0&&(n.minLength!==void 0||n.maxLength!==void 0||n.pattern!==void 0)&&e.string===void 0&&(e.string=oe())}},vc=class{apply(e,t){const n=t;if(n.minLength!==void 0&&e.string!==!1){const r=e.string||oe();r instanceof Ii&&(e.string=r.refine(i=>Array.from(i).length>=n.minLength,{message:`String must be at least ${n.minLength} characters long`}))}}},Oc=class{apply(e,t){const n=t;if(n.maxLength!==void 0&&e.string!==!1){const r=e.string||oe();r instanceof Ii&&(e.string=r.refine(i=>Array.from(i).length<=n.maxLength,{message:`String must be at most ${n.maxLength} characters long`}))}}},wc=class{apply(e,t){const n=t;if(n.pattern&&e.string!==!1){const r=e.string||oe();if(r instanceof Ii){const i=new RegExp(n.pattern);e.string=r.regex(i)}}}},xc=class{apply(e,t){const n=t;if(n.minimum!==void 0&&e.number!==!1){const r=e.number||ge();r instanceof rn&&(e.number=r.min(n.minimum))}}},Ec=class{apply(e,t){const n=t;if(n.maximum!==void 0&&e.number!==!1){const r=e.number||ge();r instanceof rn&&(e.number=r.max(n.maximum))}}},Ac=class{apply(e,t){const n=t;if(n.exclusiveMinimum!==void 0&&e.number!==!1){const r=e.number||ge();r instanceof rn&&(typeof n.exclusiveMinimum=="number"?e.number=r.gt(n.exclusiveMinimum):e.number=!1)}}},_c=class{apply(e,t){const n=t;if(n.exclusiveMaximum!==void 0&&e.number!==!1){const r=e.number||ge();r instanceof rn&&(typeof n.exclusiveMaximum=="number"?e.number=r.lt(n.exclusiveMaximum):e.number=!1)}}},Ic=class{apply(e,t){const n=t;if(n.multipleOf!==void 0&&e.number!==!1){const r=e.number||ge();r instanceof rn&&(e.number=r.refine(i=>{if(n.multipleOf===0)return!1;const s=i/n.multipleOf,o=Math.round(s),a=Math.min(Math.abs(i)*Number.EPSILON*10,Math.abs(n.multipleOf)*Number.EPSILON*10);return Math.abs(s-o)<=a/Math.abs(n.multipleOf)},{message:`Must be a multiple of ${n.multipleOf}`}))}}},Cc=class{apply(e,t){const n=t;t.type===void 0&&(n.minItems!==void 0||n.maxItems!==void 0||n.items!==void 0||n.prefixItems!==void 0)&&e.array===void 0&&(e.array=Ie(Fe()))}},Tc=class{apply(e,t){const n=t;n.minItems!==void 0&&e.array!==!1&&(e.array=(e.array||Ie(Fe())).min(n.minItems))}},Pc=class{apply(e,t){const n=t;n.maxItems!==void 0&&e.array!==!1&&(e.array=(e.array||Ie(Fe())).max(n.maxItems))}},Fc=class{apply(e,t){const n=t;if(e.array!==!1)if(Array.isArray(n.items))e.array=e.array||Ie(Fe());else if(n.items&&typeof n.items!="boolean"&&!n.prefixItems){const r=Ae(n.items);let i=Ie(r);if(e.array&&e.array instanceof ec){const s=e.array._def;s.checks&&s.checks.forEach(o=>{if(o._zod&&o._zod.def){const a=o._zod.def;a.check==="min_length"&&a.minimum!==void 0?i=i.min(a.minimum):a.check==="max_length"&&a.maximum!==void 0&&(i=i.max(a.maximum))}})}e.array=i}else typeof n.items=="boolean"&&n.items===!1?n.prefixItems?e.array=e.array||Ie(Fe()):e.array=Ie(Fe()).max(0):typeof n.items=="boolean"&&n.items===!0?e.array=e.array||Ie(Fe()):n.prefixItems&&(e.array=e.array||Ie(Fe()))}},jc=class{apply(e,t){if(t.type!=="array")return;const n=t;if(!Array.isArray(n.items)||e.array===!1)return;const r=n.items.map(s=>Ae(s));let i;r.length===0?i=ws([]):i=ws(r),n.minItems!==void 0&&n.minItems>r.length&&(i=!1),n.maxItems!==void 0&&n.maxItems<r.length&&(i=!1),e.tuple=i,e.array=!1}},$c=class{apply(e,t){const n=t;e.object!==!1&&(n.properties||n.required||n.additionalProperties!==void 0)&&(e.object=e.object||_e({}).passthrough())}},Dc=class{apply(e,t){const n=t;t.type===void 0&&(n.maxProperties!==void 0||n.minProperties!==void 0)&&e.object===void 0&&(e.object=_e({}).passthrough())}},Nc=class{apply(e,t){const n=t;if(n.maxProperties!==void 0&&e.object!==!1){const r=e.object||_e({}).passthrough();e.object=r.refine(i=>Object.keys(i).length<=n.maxProperties,{message:`Object must have at most ${n.maxProperties} properties`})}}},Rc=class{apply(e,t){const n=t;if(n.minProperties!==void 0&&e.object!==!1){const r=e.object||_e({}).passthrough();e.object=r.refine(i=>Object.keys(i).length>=n.minProperties,{message:`Object must have at least ${n.minProperties} properties`})}}};function Tn(e,t){if(e===t)return!0;if(e==null||t==null)return e===t;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t))return e.length!==t.length?!1:e.every((n,r)=>Tn(n,t[r]));if(typeof e=="object"&&typeof t=="object"){const n=Object.keys(e),r=Object.keys(t);return n.length!==r.length?!1:n.every(i=>r.includes(i)&&Tn(e[i],t[i]))}return!1}function Mc(){return e=>{if(!Array.isArray(e))return!0;const t=[];return e.every(n=>t.some(i=>Tn(n,i))?!1:(t.push(n),!0))}}function cr(e,t){return e.safeParse(t).success}var Uc=class{apply(e,t){if(!t.not)return e;const n=Ae(t.not);return e.refine(r=>!cr(n,r),{message:"Value must not match the 'not' schema"})}},kc=class{apply(e,t){return t.uniqueItems!==!0?e:e.refine(Mc(),{message:"Array items must be unique"})}},Lc=class{apply(e,t){return!t.allOf||t.allOf.length===0?e:t.allOf.map(r=>Ae(r)).reduce((r,i)=>ia(r,i),e)}},Bc=class{apply(e,t){if(!t.anyOf||t.anyOf.length===0)return e;const n=t.anyOf.length===1?Ae(t.anyOf[0]):mt([Ae(t.anyOf[0]),Ae(t.anyOf[1]),...t.anyOf.slice(2).map(r=>Ae(r))]);return ia(e,n)}},Wc=class{apply(e,t){if(!t.oneOf||t.oneOf.length===0)return e;const n=t.oneOf.map(r=>Ae(r));return e.refine(r=>{let i=0;for(const s of n)if(s.safeParse(r).success&&(i++,i>1))return!1;return i===1},{message:"Value must match exactly one of the oneOf schemas"})}},qc=class{apply(e,t){const n=t;if(n.prefixItems&&Array.isArray(n.prefixItems)){const i=n.prefixItems.map(s=>Ae(s));return e.refine(s=>{if(!Array.isArray(s))return!0;for(let o=0;o<Math.min(s.length,i.length);o++)if(!cr(i[o],s[o]))return!1;if(s.length>i.length){if(typeof n.items=="boolean"&&n.items===!1)return!1;if(n.items&&typeof n.items=="object"&&!Array.isArray(n.items)){const o=Ae(n.items);for(let a=i.length;a<s.length;a++)if(!cr(o,s[a]))return!1}}return!0},{message:"Array does not match prefixItems schema"})}return e}},Vc=class{apply(e,t){const n=t;if(!n.properties&&!n.required&&n.additionalProperties!==!1)return e;if(e instanceof nc||e instanceof rc){const r={};if(n.properties)for(const[i,s]of Object.entries(n.properties))s!==void 0&&(r[i]=Ae(s));if(n.required&&Array.isArray(n.required)){const i=new Set(n.required);for(const s of Object.keys(r))i.has(s)||(r[s]=r[s].optional())}else for(const i of Object.keys(r))r[i]=r[i].optional();return n.additionalProperties===!1?_e(r):_e(r).passthrough()}return e.refine(r=>{if(typeof r!="object"||r===null||Array.isArray(r))return!0;if(n.properties){for(const[i,s]of Object.entries(n.properties))if(s!==void 0&&Object.getOwnPropertyDescriptor(r,i)!==void 0&&!Ae(s).safeParse(r[i]).success)return!1}if(n.required&&Array.isArray(n.required)){for(const i of n.required)if(!(Object.getOwnPropertyDescriptor(r,i)!==void 0))return!1}if(n.additionalProperties===!1&&n.properties){const i=new Set(Object.keys(n.properties));for(const s in r)if(!i.has(s))return!1}return!0},{message:"Object constraints validation failed"})}},Hc=class{apply(e,t){if(!t.enum||t.enum.length===0)return e;const n=t.enum.filter(r=>Array.isArray(r)||typeof r=="object"&&r!==null);return n.length===0?e:e.refine(r=>typeof r!="object"||r===null?!0:n.some(i=>Tn(r,i)),{message:"Value must match one of the enum values"})}},Kc=class{apply(e,t){if(t.const===void 0)return e;const n=t.const;return typeof n!="object"||n===null?e:e.refine(r=>Tn(r,n),{message:"Value must equal the const value"})}},Gc=class{apply(e,t){return t.description&&(e=e.describe(t.description)),e}},zc=class{apply(e,t){var n;const r=t;return!((n=r.required)!=null&&n.includes("__proto__"))||t.type!==void 0?e:Fe().refine(i=>this.validateRequired(i,r.required),{message:"Missing required properties"})}validateRequired(e,t){return typeof e!="object"||e===null||Array.isArray(e)?!0:t.every(n=>Object.prototype.hasOwnProperty.call(e,n))}},Yc=class{apply(e,t){var n;const r=t;if(r.contains===void 0)return e;const i=Ae(r.contains),s=(n=r.minContains)!=null?n:1,o=r.maxContains;return e.refine(a=>{if(!Array.isArray(a))return!0;let l=0;for(const c of a)cr(i,c)&&l++;return!(l<s||o!==void 0&&l>o)},{message:"Array must contain required items matching the schema"})}},Jc=class{apply(e,t){const{default:n}=t;return n===void 0||!e.safeParse(n).success?e:e.default(n)}},Zc=[new yc,new gc,new mc,new bc,new Sc,new Cc,new Dc,new vc,new Oc,new wc,new xc,new Ec,new Ac,new _c,new Ic,new jc,new Tc,new Pc,new Fc,new Nc,new Rc,new $c],Xc=[new zc,new Hc,new Kc,new Lc,new Bc,new Wc,new qc,new Vc,new Yc,new Uc,new kc,new Jc,new Gc];function Ae(e){if(typeof e=="boolean")return e?Fe():Os();const t={};for(const i of Zc)i.apply(t,e);const n=[];if(t.string!==!1&&n.push(t.string||oe()),t.number!==!1&&n.push(t.number||ge()),t.boolean!==!1&&n.push(t.boolean||ti()),t.null!==!1&&n.push(t.null||_i()),t.array!==!1&&n.push(t.array||Ie(Fe())),t.tuple!==!1&&t.tuple!==void 0&&n.push(t.tuple),t.object!==!1)if(t.object)n.push(t.object);else{const i=tc(s=>typeof s=="object"&&s!==null&&!Array.isArray(s),"Must be an object, not an array");n.push(i)}t.file!==!1&&t.file!==void 0&&n.push(t.file);let r;n.length===0?r=Os():n.length===1?r=n[0]:Object.keys(e).some(s=>s!=="$schema"&&s!=="title"&&s!=="description")?r=mt(n):r=Fe();for(const i of Xc)r=i.apply(r,e);return r}class As extends Event{constructor(t,n){var r,i;super(t),this.code=(r=n?.code)!=null?r:void 0,this.message=(i=n?.message)!=null?i:void 0}[Symbol.for("nodejs.util.inspect.custom")](t,n,r){return r(_s(this),n)}[Symbol.for("Deno.customInspect")](t,n){return t(_s(this),n)}}function Qc(e){const t=globalThis.DOMException;return typeof t=="function"?new t(e,"SyntaxError"):new SyntaxError(e)}function ni(e){return e instanceof Error?"errors"in e&&Array.isArray(e.errors)?e.errors.map(ni).join(", "):"cause"in e&&e.cause instanceof Error?`${e}: ${ni(e.cause)}`:e.message:`${e}`}function _s(e){return{type:e.type,message:e.message,code:e.code,defaultPrevented:e.defaultPrevented,cancelable:e.cancelable,timeStamp:e.timeStamp}}var aa=e=>{throw TypeError(e)},Fi=(e,t,n)=>t.has(e)||aa("Cannot "+n),G=(e,t,n)=>(Fi(e,t,"read from private field"),n?n.call(e):t.get(e)),Se=(e,t,n)=>t.has(e)?aa("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),he=(e,t,n,r)=>(Fi(e,t,"write to private field"),t.set(e,n),n),Qe=(e,t,n)=>(Fi(e,t,"access private method"),n),Ce,Et,kt,Qn,ur,wn,qt,xn,ct,Lt,Gt,Bt,mn,Re,ri,ii,si,Is,oi,ai,yn,li,ci;class er extends EventTarget{constructor(t,n){var r,i;super(),Se(this,Re),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,Se(this,Ce),Se(this,Et),Se(this,kt),Se(this,Qn),Se(this,ur),Se(this,wn),Se(this,qt),Se(this,xn,null),Se(this,ct),Se(this,Lt),Se(this,Gt,null),Se(this,Bt,null),Se(this,mn,null),Se(this,ii,async s=>{var o;G(this,Lt).reset();const{body:a,redirected:l,status:c,headers:u}=s;if(c===204){Qe(this,Re,yn).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(l?he(this,kt,new URL(s.url)):he(this,kt,void 0),c!==200){Qe(this,Re,yn).call(this,`Non-200 status code (${c})`,c);return}if(!(u.get("content-type")||"").startsWith("text/event-stream")){Qe(this,Re,yn).call(this,'Invalid content type, expected "text/event-stream"',c);return}if(G(this,Ce)===this.CLOSED)return;he(this,Ce,this.OPEN);const f=new Event("open");if((o=G(this,mn))==null||o.call(this,f),this.dispatchEvent(f),typeof a!="object"||!a||!("getReader"in a)){Qe(this,Re,yn).call(this,"Invalid response body, expected a web ReadableStream",c),this.close();return}const h=new TextDecoder,m=a.getReader();let d=!0;do{const{done:p,value:y}=await m.read();y&&G(this,Lt).feed(h.decode(y,{stream:!p})),p&&(d=!1,G(this,Lt).reset(),Qe(this,Re,li).call(this))}while(d)}),Se(this,si,s=>{he(this,ct,void 0),!(s.name==="AbortError"||s.type==="aborted")&&Qe(this,Re,li).call(this,ni(s))}),Se(this,oi,s=>{typeof s.id=="string"&&he(this,xn,s.id);const o=new MessageEvent(s.event||"message",{data:s.data,origin:G(this,kt)?G(this,kt).origin:G(this,Et).origin,lastEventId:s.id||""});G(this,Bt)&&(!s.event||s.event==="message")&&G(this,Bt).call(this,o),this.dispatchEvent(o)}),Se(this,ai,s=>{he(this,wn,s)}),Se(this,ci,()=>{he(this,qt,void 0),G(this,Ce)===this.CONNECTING&&Qe(this,Re,ri).call(this)});try{if(t instanceof URL)he(this,Et,t);else if(typeof t=="string")he(this,Et,new URL(t,eu()));else throw new Error("Invalid URL")}catch{throw Qc("An invalid or illegal string was specified")}he(this,Lt,cc({onEvent:G(this,oi),onRetry:G(this,ai)})),he(this,Ce,this.CONNECTING),he(this,wn,3e3),he(this,ur,(r=n?.fetch)!=null?r:globalThis.fetch),he(this,Qn,(i=n?.withCredentials)!=null?i:!1),Qe(this,Re,ri).call(this)}get readyState(){return G(this,Ce)}get url(){return G(this,Et).href}get withCredentials(){return G(this,Qn)}get onerror(){return G(this,Gt)}set onerror(t){he(this,Gt,t)}get onmessage(){return G(this,Bt)}set onmessage(t){he(this,Bt,t)}get onopen(){return G(this,mn)}set onopen(t){he(this,mn,t)}addEventListener(t,n,r){const i=n;super.addEventListener(t,i,r)}removeEventListener(t,n,r){const i=n;super.removeEventListener(t,i,r)}close(){G(this,qt)&&clearTimeout(G(this,qt)),G(this,Ce)!==this.CLOSED&&(G(this,ct)&&G(this,ct).abort(),he(this,Ce,this.CLOSED),he(this,ct,void 0))}}Ce=new WeakMap,Et=new WeakMap,kt=new WeakMap,Qn=new WeakMap,ur=new WeakMap,wn=new WeakMap,qt=new WeakMap,xn=new WeakMap,ct=new WeakMap,Lt=new WeakMap,Gt=new WeakMap,Bt=new WeakMap,mn=new WeakMap,Re=new WeakSet,ri=function(){he(this,Ce,this.CONNECTING),he(this,ct,new AbortController),G(this,ur)(G(this,Et),Qe(this,Re,Is).call(this)).then(G(this,ii)).catch(G(this,si))},ii=new WeakMap,si=new WeakMap,Is=function(){var e;const t={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...G(this,xn)?{"Last-Event-ID":G(this,xn)}:void 0},cache:"no-store",signal:(e=G(this,ct))==null?void 0:e.signal};return"window"in globalThis&&(t.credentials=this.withCredentials?"include":"same-origin"),t},oi=new WeakMap,ai=new WeakMap,yn=function(e,t){var n;G(this,Ce)!==this.CLOSED&&he(this,Ce,this.CLOSED);const r=new As("error",{code:t,message:e});(n=G(this,Gt))==null||n.call(this,r),this.dispatchEvent(r)},li=function(e,t){var n;if(G(this,Ce)===this.CLOSED)return;he(this,Ce,this.CONNECTING);const r=new As("error",{code:t,message:e});(n=G(this,Gt))==null||n.call(this,r),this.dispatchEvent(r),he(this,qt,setTimeout(G(this,ci),G(this,wn)))},ci=new WeakMap,er.CONNECTING=0,er.OPEN=1,er.CLOSED=2;function eu(){const e="document"in globalThis?globalThis.document:void 0;return e&&typeof e=="object"&&"baseURI"in e&&typeof e.baseURI=="string"?e.baseURI:void 0}class tu extends Error{constructor(t,n,r){super(`SSE error: ${n}`),this.code=t,this.event=r}}class nu{constructor(t,n){this._url=t,this._resourceMetadataUrl=void 0,this._scope=void 0,this._eventSourceInit=n?.eventSourceInit,this._requestInit=n?.requestInit,this._authProvider=n?.authProvider,this._fetch=n?.fetch,this._fetchWithInit=uc(n?.fetch,n?.requestInit)}async _authThenStart(){if(!this._authProvider)throw new fn("No auth provider");let t;try{t=await Tr(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(n){throw this.onerror?.(n),n}if(t!=="AUTHORIZED")throw new fn;return await this._startOrAuth()}async _commonHeaders(){const t={};if(this._authProvider){const r=await this._authProvider.tokens();r&&(t.Authorization=`Bearer ${r.access_token}`)}this._protocolVersion&&(t["mcp-protocol-version"]=this._protocolVersion);const n=fc(this._requestInit?.headers);return new Headers({...t,...n})}_startOrAuth(){const t=this?._eventSourceInit?.fetch??this._fetch??fetch;return new Promise((n,r)=>{this._eventSource=new er(this._url.href,{...this._eventSourceInit,fetch:async(i,s)=>{const o=await this._commonHeaders();o.set("Accept","text/event-stream");const a=await t(i,{...s,headers:o});if(a.status===401&&a.headers.has("www-authenticate")){const{resourceMetadataUrl:l,scope:c}=xs(a);this._resourceMetadataUrl=l,this._scope=c}return a}}),this._abortController=new AbortController,this._eventSource.onerror=i=>{if(i.code===401&&this._authProvider){this._authThenStart().then(n,r);return}const s=new tu(i.code,i.message,i);r(s),this.onerror?.(s)},this._eventSource.onopen=()=>{},this._eventSource.addEventListener("endpoint",i=>{const s=i;try{if(this._endpoint=new URL(s.data,this._url),this._endpoint.origin!==this._url.origin)throw new Error(`Endpoint origin does not match connection origin: ${this._endpoint.origin}`)}catch(o){r(o),this.onerror?.(o),this.close();return}n()}),this._eventSource.onmessage=i=>{const s=i;let o;try{o=sa.parse(JSON.parse(s.data))}catch(a){this.onerror?.(a);return}this.onmessage?.(o)}})}async start(){if(this._eventSource)throw new Error("SSEClientTransport already started! If using Client class, note that connect() calls start() automatically.");return await this._startOrAuth()}async finishAuth(t){if(!this._authProvider)throw new fn("No auth provider");if(await Tr(this._authProvider,{serverUrl:this._url,authorizationCode:t,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new fn("Failed to authorize")}async close(){this._abortController?.abort(),this._eventSource?.close(),this.onclose?.()}async send(t){if(!this._endpoint)throw new Error("Not connected");try{const n=await this._commonHeaders();n.set("content-type","application/json");const r={...this._requestInit,method:"POST",headers:n,body:JSON.stringify(t),signal:this._abortController?.signal},i=await(this._fetch??fetch)(this._endpoint,r);if(!i.ok){const s=await i.text().catch(()=>null);if(i.status===401&&this._authProvider){const{resourceMetadataUrl:o,scope:a}=xs(i);if(this._resourceMetadataUrl=o,this._scope=a,await Tr(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new fn;return this.send(t)}throw new Error(`Error POSTing to endpoint (HTTP ${i.status}): ${s}`)}await i.body?.cancel()}catch(n){throw this.onerror?.(n),n}}setProtocolVersion(t){this._protocolVersion=t}}const ru="mcp";class iu{constructor(t){this._url=t}start(){if(this._socket)throw new Error("WebSocketClientTransport already started! If using Client class, note that connect() calls start() automatically.");return new Promise((t,n)=>{this._socket=new WebSocket(this._url,ru),this._socket.onerror=r=>{const i="error"in r?r.error:new Error(`WebSocket error: ${JSON.stringify(r)}`);n(i),this.onerror?.(i)},this._socket.onopen=()=>{t()},this._socket.onclose=()=>{this.onclose?.()},this._socket.onmessage=r=>{let i;try{i=sa.parse(JSON.parse(r.data))}catch(s){this.onerror?.(s);return}this.onmessage?.(i)}})}async close(){this._socket?.close()}send(t){return new Promise((n,r)=>{if(!this._socket){r(new Error("Not connected"));return}this._socket?.send(JSON.stringify(t)),n()})}}class su extends dc{constructor(t,n){super(t,n)}send(t,n){const r=ou(t);return r?.type==="emit"?(this.onmessage?.(r.message),Promise.resolve()):r?.type==="suppress"?Promise.resolve():super.send(t,n)}}function ou(e){const t=e;if(!t||typeof t!="object"||!("method"in t))return null;switch(t.method){case"initialize":{const n=t?.params?.protocolVersion;return n?{type:"emit",message:{result:{protocolVersion:n,capabilities:{tools:{}},serverInfo:{name:"deco-chat-server",version:"1.0.0"}},jsonrpc:t.jsonrpc??"2.0",id:t.id}}:null}case"notifications/roots/list_changed":case"notifications/initialized":case"notifications/cancelled":case"notifications/progress":return{type:"suppress"};default:return null}}class au extends hc{constructor(t,n){super(t,n)}async listTools(t,n){return await this.request({method:"tools/list",params:t},sc,n)}}const lu=async(e,t,n)=>{const r=cu(e.connection,t,n);if(!r)throw new Error("Unknown MCP connection type");const i=new au({name:e?.name??"MCP Client",version:"1.0.0"});return await i.connect(r),{client:i}},cu=(e,t,n)=>{if(e.type==="Websocket")return new iu(new URL(e.url));if(e.type!=="SSE"&&e.type!=="HTTP")return null;const i={...e.token?{authorization:`Bearer ${e.token}`}:{},...n??{},..."headers"in e?e.headers||{}:{}};if(e.type==="SSE"){const s={requestInit:{headers:i,signal:t}};return e.token&&(s.eventSourceInit={fetch:(o,a)=>fetch(o,{...a,headers:{...i,Accept:"text/event-stream"},signal:t})}),new nu(new URL(e.url),s)}return new su(new URL(e.url),{requestInit:{headers:i,signal:t,credentials:"include"}})},Cs=e=>{try{return JSON.parse(e)}catch{return e}},zn=new Map,Ts=(e,t)=>({...e,id:e.name,inputSchema:e.inputSchema?Ae(e.inputSchema):void 0,outputSchema:e.outputSchema?Ae(e.outputSchema):void 0,execute:n=>t(n.context,e.name)});function uu(e){const t=n=>"connection"in e?lu({connection:e.connection},void 0,n):e.client;return new Proxy({},{get(n,r){if(r==="toJSON")return null;if(typeof r!="string")throw new Error("Name must be a string");if(r==="listTools")return a;async function i(l,c=r){const u=e?.debugId?.(),f=u?{"x-trace-debug-id":u}:void 0,{client:h}=await t(f),{structuredContent:m,isError:d,content:p}=await h.callTool({name:String(c),arguments:l});if(d){const S=p?.[0]?.text,O=typeof S=="string"?Cs(S):null,E=O?.code&&typeof e?.getErrorByStatusCode=="function"?e.getErrorByStatusCode(O.code,O.message,O.traceId):null;throw E||new Error(`Tool ${String(c)} returned an error: ${JSON.stringify(m??p)}`)}if(m!==void 0)return m;const y=p?.[0]?.text;return typeof y=="string"?Cs(y):void 0}async function s(){const{client:l}=await t(),{tools:c}=await l.listTools();return c}async function o(){if(!("connection"in e))return s();const l=e.connection,c=JSON.stringify(l);try{return zn.has(c)||zn.set(c,s()),await zn.get(c)}catch(u){console.error("Failed to list tools",u),zn.delete(c);return}}async function a(){return(await o()??[]).map(c=>Ts(c,i))}return i.asTool=async()=>{const c=(await o()??[]).find(u=>u.name===r);if(!c)throw new Error(`Tool ${r} not found`);return Ts(c,i)},i}})}new Proxy({},{get(e,t){return t==="toJSON"?null:t==="forConnection"?n=>fu({connection:n}):global[t]}});function fu(e){return uu(e)}const du=_e({toolName:oe().describe("Name of the tool to invoke on that connection"),transformCode:oe().optional().describe("Pure TypeScript function for data transformation of the tool call result. Must be a TypeScript file that declares the Output interface and exports a default function: `interface Output { ... } export default async function(stepInput): Output { ... }`\n The stepInput will match with the tool call outputSchema. If transformCode is not provided, the tool call result will be used as the step output.\n Providing an transformCode is recommended because it both allows you to transform the data and validate it against a JSON Schema - tools are ephemeral and may return unexpected data.")}),hu=_e({code:oe().describe(`Pure TypeScript function for data transformation. Useful to merge data from multiple steps and transform it. Must be a TypeScript file that declares the Output interface and exports a default function: \`interface Output { ... } export default async function(stepInput): Output { ... }\`
2
2
  The stepInput is the resolved value of the references in the input field. Example:
3
3
  {
4
4
  "input": {
@@ -0,0 +1 @@
1
+ import{e as D,j as i,r as B,s as me,P as Se,f as je,c as se,t as ne,b as ke,K as we,n as Ie}from"./index-CzOMQ7ME.js";import{u as _e,T as Ae,a as Oe,b as Te}from"./tooltip-Dk-x7ks3.js";import{y as Ee}from"./agent-icon-ChigV_SM.js";import{h as De,j as Me,k as Pe,i as Re,b as $e,C as q,a as Le,u as ze}from"./index-DHNiGAXq.js";import{I as ye}from"./integration-icon-BaScZvO6.js";import{S as ue}from"./skeleton-BhYsT5bA.js";import{W as H,i as ve}from"./constants-CrCZOO5F.js";import{b as Be}from"./use-virtual-mcp-lxX8wI4d.js";import{u as Fe}from"./use-organization-settings-BMveAMB5.js";import{i as He}from"./ChevronRight-CXiW90Fz.js";import{s as Ge}from"./Plus-BPcc_-zf.js";import{a as Ke}from"./Users03-C4su_vOM.js";import{I as ce,S as Ue,L as Ve,b as We}from"./lean-canvas-recruit-modal-CHTxHUjM.js";import{u as qe}from"./use-create-virtual-mcp-CCKFB_a7.js";import{N as Ye}from"./select-model-Ca5uLyFK.js";import{u as Je}from"./use-ai-providers-Bo9kqLtW.js";import{d as Qe}from"./XCircle-QSJN9xhv.js";import"./AlertCircle-DBGfLjQw.js";import"./Tool01-YKVy1yNP.js";import"./Archive-BKT9Dg_O.js";import"./XClose-CPKu5cnb.js";import"./RefreshCcw01-DebjkWfq.js";import"./ArrowNarrowLeft-CukpweKs.js";import"./ArrowUpRight-D9dARFlG.js";import"./ZapSquare-D07uWeTi.js";import"./CheckCircle-Bo4QB9pu.js";import"./Check-BXg4TGxE.js";import"./ChevronDown-DEP8rKZT.js";import"./ChevronUp-BhNdg10c.js";import"./DotsVertical-Caoo-NuL.js";import"./Container-CxQrLgnS.js";import"./Star01-CxJjtPnY.js";import"./Palette-C1Yvme6Z.js";import"./SearchMd-CePuFGwO.js";import"./LayoutLeft-Br6mPXCN.js";import"./LinkExternal01-FDsQXojs.js";import"./Lock01-CjoGpFGs.js";import"./Sun-CBmGK6wu.js";import"./Play-BFNsKgtb.js";import"./Settings02-B5jIAnK4.js";import"./Shield01-CKYDfpKE.js";import"./Trash01--KbsY2dn.js";import"./User01-BLvWkS9e.js";import"./X-CNAnrf0f.js";import"./Zap-B4MS-NKo.js";import"./dialog-zxbh5ng1.js";import"./switch-MdXM9LTQ.js";import"./input-B0c-2DIW.js";import"./use-connection-Bw3IdOYX.js";import"./use-collections-DaGR-TK3.js";import"./use-navigate-to-agent-BQ5qza3f.js";import"./chat-context-C_XiURbM.js";import"./use-decopilot-events-Co1GYuP2.js";import"./create-sse-subscription-CxkOgzKf.js";import"./use-tasks-ChwW8r_K.js";import"./drawer-DNDd7AZJ.js";import"./shell-layout-DbyGG6Wz.js";import"./required-auth-layout-BRR_6ANi.js";import"./use-org-sso-B3swYyz4.js";import"./pair-Bg3A59Mm.js";import"./index-nTgL534f.js";import"./use-copy-B-uFxHk6.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./content-blocks-o63cs2vh.js";import"./types-G67jsjMK.js";import"./spinner-DRDdaYJh.js";import"./collection-search-oUHE77Ko.js";import"./tabs-BOCdrF2i.js";import"./form-DK_rcfC8.js";import"./label-gqBY6uyz.js";import"./select-Ilj6kxB7.js";import"./toggle-group-i_HO-0bV.js";import"./dropdown-menu-BHUBCwIp.js";import"./index-BOMQKZYe.js";import"./question-004-sINsf4GQ.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-DvWQmocE.js";import"./use-registry-connections-Cld8pkRO.js";import"./useInfiniteQuery-ImrWnFFo.js";import"./infiniteQueryObserver-C3rVl4tZ.js";import"./extract-connection-data-CA-1nswb.js";import"./constants-D2ruRIzu.js";import"./collections-DbmVPIqC.js";import"./card-Bij24Dhu.js";import"./collection-tabs-CHoGEXEE.js";import"./badge-Bovdptse.js";import"./textarea-BqfIjmtd.js";import"./connection-form-helpers-z7ekyahw.js";import"./use-infinite-scroll-BNHelzzC.js";import"./useSuspenseInfiniteQuery-CpJJnQ6p.js";import"./checkbox-DepLdWR1.js";import"./use-mcp-tools-DVY8KcMA.js";import"./ai-providers-logos-DD3qZ33J.js";import"./avatar-DLcW-A0B.js";import"./settings-section-DfJOrTB5.js";import"./unwrap-tool-result-BYXdCQMg.js";function Xe(e){try{const t=localStorage.getItem(`mesh:chat:recent-agents:${e}`);return t?JSON.parse(t):[]}catch{return[]}}const Ze=8;function xe(e){const t=D.c(21),{agent:s,onSpecialClick:r,tracking:n}=e,{org:l}=me(),a=je();let o;t[0]!==s.id||t[1]!==s.title||t[2]!==a||t[3]!==r||t[4]!==l||t[5]!==n.action||t[6]!==n.template_id||t[7]!==n.tile_kind?(o=()=>{if(ne("home_agent_tile_clicked",{template_id:n.template_id,agent_id:s.id,agent_title:s.title,tile_kind:n.tile_kind,action:n.action}),r)r();else{const I=crypto.randomUUID();a({to:"/$org/$taskId",params:{org:l.slug,taskId:I},search:{virtualmcpid:s.id}})}},t[0]=s.id,t[1]=s.title,t[2]=a,t[3]=r,t[4]=l,t[5]=n.action,t[6]=n.template_id,t[7]=n.tile_kind,t[8]=o):o=t[8];const m=o;let g;t[9]===Symbol.for("react.memo_cache_sentinel")?(g=se("flex flex-col items-center gap-3 p-2 rounded-lg","transition-colors","cursor-pointer","w-[100px] shrink-0","group"),t[9]=g):g=t[9];const b=`Select agent ${s.title}`;let M;t[10]===Symbol.for("react.memo_cache_sentinel")?(M=i.jsx(Ke,{size:24}),t[10]=M):M=t[10];let j;t[11]!==s.icon||t[12]!==s.title?(j=i.jsx(ye,{icon:s.icon,name:s.title,size:"md",fallbackIcon:M,className:"transition-transform group-hover:scale-110"}),t[11]=s.icon,t[12]=s.title,t[13]=j):j=t[13];let f;t[14]!==s.title?(f=i.jsx("p",{className:"text-xs sm:text-sm text-foreground text-center leading-tight line-clamp-2 break-words w-full",children:s.title}),t[14]=s.title,t[15]=f):f=t[15];let k;return t[16]!==m||t[17]!==b||t[18]!==j||t[19]!==f?(k=i.jsxs("button",{type:"button",onClick:m,className:g,"aria-label":b,children:[j,f]}),t[16]=m,t[17]=b,t[18]=j,t[19]=f,t[20]=k):k=t[20],k}function et(){const e=D.c(8),t=je(),{org:s}=me();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=se("flex flex-col items-center gap-3 p-2 rounded-lg","transition-colors","cursor-pointer","w-[100px] shrink-0","group"),e[0]=r):r=e[0];let n;e[1]!==t||e[2]!==s.slug?(n=()=>{ne("home_see_all_agents_clicked"),t({to:"/$org/settings/agents",params:{org:s.slug}})},e[1]=t,e[2]=s.slug,e[3]=n):n=e[3];let l,a;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx("div",{className:"size-12 rounded-xl bg-accent flex items-center justify-center shrink-0 transition-transform group-hover:scale-110",children:i.jsx(He,{size:20,className:"text-foreground"})}),a=i.jsx("p",{className:"text-xs sm:text-sm text-foreground text-center leading-tight",children:"See all"}),e[4]=l,e[5]=a):(l=e[4],a=e[5]);let o;return e[6]!==n?(o=i.jsxs("button",{type:"button",className:r,"aria-label":"See all agents",onClick:n,children:[l,a]}),e[6]=n,e[7]=o):o=e[7],o}function tt(){const e=D.c(9);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={navigateOnCreate:!0},e[0]=t):t=e[0];const{createVirtualMCP:s,isCreating:r}=qe(t);let n;e[1]!==s?(n=()=>{ne("home_create_agent_clicked"),s()},e[1]=s,e[2]=n):n=e[2];let l;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=se("flex flex-col items-center gap-3 p-2 rounded-lg","transition-colors","cursor-pointer","w-[100px] shrink-0","group","disabled:opacity-50 disabled:cursor-not-allowed"),e[3]=l):l=e[3];let a,o;e[4]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx("div",{className:"size-12 rounded-xl bg-background border-2 border-dashed border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-110",children:i.jsx(Ge,{size:20,className:"text-muted-foreground"})}),o=i.jsx("p",{className:"text-xs sm:text-sm text-foreground text-center leading-tight",children:"Create agent"}),e[4]=a,e[5]=o):(a=e[4],o=e[5]);let m;return e[6]!==r||e[7]!==n?(m=i.jsxs("button",{type:"button",onClick:n,disabled:r,className:l,"aria-label":"Create agent",children:[a,o]}),e[6]=r,e[7]=n,e[8]=m):m=e[8],m}function ie(e,t,s){return e.find(r=>r.id!==null&&(r.metadata?.type===t||r.title===s))}function it(){const e=D.c(52),t=Be(),{locator:s,org:r}=me(),n=Fe(),[l,a]=B.useState(!1),[o,m]=B.useState(!1),[g,b]=B.useState(!1),[M,j]=B.useState(!1),[f,k]=B.useState(!1),[I,L]=B.useState(!1),[P,z]=B.useState(!1),[R]=Se(),$=De(r.slug);let p,h,u,x,_,y,A,d;if(e[0]!==s||e[1]!==$||e[2]!==n||e[3]!==R||e[4]!==t){const re=H.find(ut),Y=H.find(pt),J=H.find(ft),Q=H.find(dt),Z=H.find(mt),de=H.find(ct),le=H.find(at);u=ie(t,Y.id,Y.title),p=ie(t,J.id,J.title),h=ie(t,Q.id,Q.title),x=ie(t,Z.id,Z.title);const fe=c=>{if(c===re.id)return{key:c,kind:"template-recruit",templateId:"site-editor",agent:re,onClick:"import-deco"};if(c===Y.id)return u?{key:u.id,kind:"existing",templateId:"site-diagnostics",agent:u}:{key:c,kind:"template-recruit",templateId:"site-diagnostics",agent:Y,onClick:"diagnostics"};if(c===J.id)return p?{key:p.id,kind:"existing",templateId:"ai-image",agent:p}:{key:c,kind:"template-recruit",templateId:"ai-image",agent:J,onClick:"ai-image"};if(c===Z.id)return x?{key:x.id,kind:"existing",templateId:"lean-canvas",agent:x}:{key:c,kind:"template-recruit",templateId:"lean-canvas",agent:Z,onClick:"lean-canvas"};if(c===de.id)return{key:c,kind:"template-recruit",templateId:"studio-pack",agent:de,onClick:"studio-pack"};if(c===le.id)return R.experimental_vibecode?{key:c,kind:"template-recruit",templateId:"self-healing-storefront",agent:le,onClick:"self-healing"}:null;if(c===Q.id)return h?{key:h.id,kind:"existing",templateId:"ai-research",agent:h}:{key:c,kind:"template-recruit",templateId:"ai-research",agent:Q,onClick:"ai-research"};const F=t.find(V=>V.id!==null&&V.id===c&&!ve(V.id));return F?{key:F.id,kind:"existing",templateId:null,agent:F}:null};let ee;if(n?.ids)ee=n.ids.map(fe).filter(ot).slice(0,Ze);else{const F=[re.id,le.id,Y.id,J.id,Q.id].map(fe).filter(lt),V=Xe(s),Ce=t.filter(rt).filter(W=>W.id!==u?.id&&W.id!==p?.id&&W.id!==h?.id).sort((W,pe)=>{const oe=V.indexOf(W.id),ae=V.indexOf(pe.id);return oe!==-1&&ae!==-1?oe-ae:oe!==-1?-1:ae!==-1?1:new Date(pe.updated_at).getTime()-new Date(W.updated_at).getTime()}).slice(0,4).map(nt);ee=[...F,...Ce]}_=ee.some(st);let te;e[13]!==$?(te=c=>{if(c.kind==="template-recruit"){const F={"import-deco":()=>a(!0),diagnostics:()=>m(!0),"ai-image":()=>b(!0),"ai-research":()=>j(!0),"lean-canvas":()=>k(!0),"studio-pack":()=>L(!0),"self-healing":()=>z(!0)}[c.onClick];return i.jsx(xe,{agent:c.agent,onSpecialClick:F,tracking:{template_id:c.templateId,tile_kind:"template",action:"open_modal"}},c.key)}return i.jsx(xe,{agent:c.agent,onSpecialClick:()=>$(c.agent.id),tracking:{template_id:c.templateId,tile_kind:c.templateId?"existing":"recent",action:"navigate"}},c.key)},e[13]=$,e[14]=te):te=e[14];const Ne=te;d="w-full max-md:overflow-x-auto max-md:[scrollbar-width:none] max-md:[&::-webkit-scrollbar]:hidden",y="flex flex-wrap justify-center gap-1.5 max-md:flex-nowrap max-md:justify-start md:max-h-52 md:overflow-hidden",A=ee.map(Ne),e[0]=s,e[1]=$,e[2]=n,e[3]=R,e[4]=t,e[5]=p,e[6]=h,e[7]=u,e[8]=x,e[9]=_,e[10]=y,e[11]=A,e[12]=d}else p=e[5],h=e[6],u=e[7],x=e[8],_=e[9],y=e[10],A=e[11],d=e[12];let O;e[15]===Symbol.for("react.memo_cache_sentinel")?(O=i.jsx(tt,{}),e[15]=O):O=e[15];let v;e[16]!==_?(v=_&&i.jsx(et,{}),e[16]=_,e[17]=v):v=e[17];let N;e[18]!==y||e[19]!==A||e[20]!==v?(N=i.jsxs("div",{className:y,children:[A,O,v]}),e[18]=y,e[19]=A,e[20]=v,e[21]=N):N=e[21];let T;e[22]!==d||e[23]!==N?(T=i.jsx("div",{className:d,children:N}),e[22]=d,e[23]=N,e[24]=T):T=e[24];let C;e[25]!==l?(C=i.jsx(ce,{open:l,onOpenChange:a}),e[25]=l,e[26]=C):C=e[26];let S;e[27]!==o||e[28]!==u?(S=i.jsx(Ue,{open:o,onOpenChange:m,existingAgent:u}),e[27]=o,e[28]=u,e[29]=S):S=e[29];let w;e[30]!==g||e[31]!==p?(w=i.jsx(Me,{open:g,onOpenChange:b,existingAgent:p}),e[30]=g,e[31]=p,e[32]=w):w=e[32];let E;e[33]!==M||e[34]!==h?(E=i.jsx(Pe,{open:M,onOpenChange:j,existingAgent:h}),e[33]=M,e[34]=h,e[35]=E):E=e[35];let G;e[36]!==x||e[37]!==f?(G=i.jsx(Ve,{open:f,onOpenChange:k,existingAgent:x}),e[36]=x,e[37]=f,e[38]=G):G=e[38];let K;e[39]!==I?(K=i.jsx(We,{open:I,onOpenChange:L}),e[39]=I,e[40]=K):K=e[40];let U;e[41]!==P?(U=i.jsx(Re,{open:P,onOpenChange:z}),e[41]=P,e[42]=U):U=e[42];let X;return e[43]!==E||e[44]!==G||e[45]!==K||e[46]!==U||e[47]!==T||e[48]!==C||e[49]!==S||e[50]!==w?(X=i.jsxs(i.Fragment,{children:[T,C,S,w,E,G,K,U]}),e[43]=E,e[44]=G,e[45]=K,e[46]=U,e[47]=T,e[48]=C,e[49]=S,e[50]=w,e[51]=X):X=e[51],X}function st(e){return e.kind==="existing"&&e.templateId===null}function nt(e){return{key:e.id,kind:"existing",templateId:null,agent:e}}function rt(e){return e.id!==null&&!ve(e.id)}function lt(e){return e!==null}function ot(e){return e!==null}function at(e){return e.id==="self-healing-storefront"}function ct(e){return e.id==="studio-pack"}function mt(e){return e.id==="lean-canvas"}function dt(e){return e.id==="ai-research"}function ft(e){return e.id==="ai-image"}function pt(e){return e.id==="site-diagnostics"}function ut(e){return e.id==="site-editor"}function xt(){const e=D.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsx("div",{className:"w-full max-md:overflow-x-auto max-md:[scrollbar-width:none] max-md:[&::-webkit-scrollbar]:hidden",children:i.jsx("div",{className:"flex flex-wrap justify-center gap-1.5 max-md:flex-nowrap max-md:justify-start md:max-h-52 md:overflow-hidden",children:Array.from({length:7}).map(gt)})}),e[0]=t):t=e[0],t}function gt(e,t){return i.jsxs("div",{className:"flex flex-col items-center gap-3 p-2 w-[100px] shrink-0",children:[i.jsx(ue,{className:"size-12 rounded-xl shrink-0"}),i.jsx(ue,{className:"h-3 sm:h-4 w-full"})]},t)}function ge(){const e=D.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsx(B.Suspense,{fallback:i.jsx(xt,{}),children:i.jsx(it,{})}),e[0]=t):t=e[0],t}const ht=["radial-gradient(ellipse 25% 220% at -5% 120%, rgba(165,149,255,0.35) 0%, transparent 100%)","radial-gradient(ellipse 25% 220% at 105% -20%, rgba(208,236,26,0.32) 0%, transparent 100%)"].join(", "),bt="/decotexture.svg";function he(e){const t=D.c(7),{onClick:s}=e;let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={backgroundImage:ht},t[0]=r):r=t[0];let n,l;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsx("div",{className:"relative shrink-0 p-1.5 bg-[var(--brand-green-light)] rounded-lg border border-border",children:i.jsx(ye,{icon:"/logos/deco%20logo.svg",name:"deco.cx",size:"xs",className:"border-0 rounded-none bg-transparent"})}),l=i.jsx("p",{className:"flex-1 relative text-sm font-medium text-foreground leading-none whitespace-nowrap",children:"Import your deco.cx site"}),t[1]=n,t[2]=l):(n=t[1],l=t[2]);let a;t[3]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx("img",{src:bt,alt:"","aria-hidden":!0,className:"absolute pointer-events-none",style:{width:"274.5px",height:"272.25px",left:"calc(50% + 145.5px)",top:"calc(50% + 40px)",transform:"translate(-50%, -50%)"}}),t[3]=a):a=t[3];let o;t[4]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx("div",{className:"relative bg-background flex items-center justify-center size-8 rounded-md shrink-0",children:i.jsx(Qe,{size:16,className:"text-foreground transition-transform group-hover:translate-x-0.5"})}),t[4]=o):o=t[4];let m;return t[5]!==s?(m=i.jsxs("button",{type:"button",onClick:s,className:"w-full relative flex items-center gap-4 px-4 py-4 rounded-lg border border-border bg-background overflow-hidden transition-colors text-left cursor-pointer group",style:r,children:[n,l,a,o]}),t[5]=s,t[6]=m):m=t[6],m}function jt(){const e=D.c(5),{data:t}=ke.useSession();let s;e[0]!==t?.user?.email?(s=we.decoProfile(t?.user?.email),e[0]=t?.user?.email,e[1]=s):s=e[1];const r=!!t?.user?.email;let n;e[2]!==s||e[3]!==r?(n={queryKey:s,queryFn:kt,enabled:r,staleTime:3e5},e[2]=s,e[3]=r,e[4]=n):n=e[4];const{data:l}=Ie(n);return l?.isDecoUser??!1}async function kt(){const e=await fetch("/api/deco-sites/profile");return e.ok?e.json():{isDecoUser:!1}}function be(){const e=D.c(52),{data:t}=ke.useSession(),[s,r]=B.useState(!1),n=jt(),l=_e(),a=Je(),{hasDecoKey:o,isZeroBalance:m,isInitialFreeCredit:g,balanceDollars:b,hasOnlyDecoProvider:M}=$e();if(a.length===0){let d;return e[0]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx("div",{className:"flex-1 flex items-center justify-center px-4 py-10",children:i.jsx(Ye,{})}),e[0]=d):d=e[0],d}let j;e[1]!==t?.user?.name?(j=t?.user?.name?.split(" ")[0]||"there",e[1]=t?.user?.name,e[2]=j):j=e[2];const f=j,k=o&&g&&b!=null,I=o&&m&&M;if(l){let d;e[3]!==b||e[4]!==k?(d=k&&i.jsx("div",{className:"mb-4",children:i.jsx(q.CreditsEyebrow,{balanceDollars:b})}),e[3]=b,e[4]=k,e[5]=d):d=e[5];let O;e[6]!==I?(O=I&&i.jsx("div",{className:"mb-4",children:i.jsx(q.NoCreditsEyebrow,{})}),e[6]=I,e[7]=O):O=e[7];let v;e[8]!==f?(v=i.jsxs("p",{className:"text-3xl font-medium text-foreground text-center max-w-[280px]",children:["What's on your mind, ",f,"?"]}),e[8]=f,e[9]=v):v=e[9];let N;e[10]!==d||e[11]!==O||e[12]!==v?(N=i.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center w-full",children:[d,O,v]}),e[10]=d,e[11]=O,e[12]=v,e[13]=N):N=e[13];let T;e[14]===Symbol.for("react.memo_cache_sentinel")?(T=i.jsxs("div",{className:"w-full flex flex-col gap-4 pb-4",children:[i.jsx(ge,{}),i.jsx(q.Input,{showConnectionsBanner:!0})]}),e[14]=T):T=e[14];let C;e[15]!==n?(C=n&&i.jsx("div",{className:"w-full",children:i.jsx(he,{onClick:()=>r(!0)})}),e[15]=n,e[16]=C):C=e[16];let S;e[17]!==N||e[18]!==C?(S=i.jsxs("div",{className:"flex-1 relative flex flex-col items-center px-4",children:[N,T,C]}),e[17]=N,e[18]=C,e[19]=S):S=e[19];let w;e[20]!==s?(w=i.jsx(ce,{open:s,onOpenChange:r}),e[20]=s,e[21]=w):w=e[21];let E;return e[22]!==S||e[23]!==w?(E=i.jsxs(i.Fragment,{children:[S,w]}),e[22]=S,e[23]=w,e[24]=E):E=e[24],E}let L;e[25]!==b||e[26]!==k?(L=k&&i.jsx("div",{className:"mb-4",children:i.jsx(q.CreditsEyebrow,{balanceDollars:b})}),e[25]=b,e[26]=k,e[27]=L):L=e[27];let P;e[28]!==I?(P=I&&i.jsx("div",{className:"mb-4",children:i.jsx(q.NoCreditsEyebrow,{})}),e[28]=I,e[29]=P):P=e[29];let z;e[30]!==f?(z=i.jsxs("p",{className:"text-3xl font-medium text-foreground",children:["What's on your mind, ",f,"?"]}),e[30]=f,e[31]=z):z=e[31];let R;e[32]!==L||e[33]!==P||e[34]!==z?(R=i.jsxs("div",{className:"text-center mb-10",children:[L,P,z]}),e[32]=L,e[33]=P,e[34]=z,e[35]=R):R=e[35];let $;e[36]===Symbol.for("react.memo_cache_sentinel")?($=i.jsx("div",{className:"w-full",children:i.jsx(q.Input,{showConnectionsBanner:!0})}),e[36]=$):$=e[36];let p;e[37]!==R?(p=i.jsxs("div",{className:"flex flex-col items-center w-full max-w-[672px]",children:[R,$]}),e[37]=R,e[38]=p):p=e[38];let h;e[39]===Symbol.for("react.memo_cache_sentinel")?(h=i.jsx("div",{className:"w-full mt-10 mx-auto",children:i.jsx(ge,{})}),e[39]=h):h=e[39];let u;e[40]!==p?(u=i.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center w-full",children:[p,h]}),e[40]=p,e[41]=u):u=e[41];let x;e[42]!==n?(x=n&&i.jsx("div",{className:"absolute bottom-6 left-0 right-0 px-10",children:i.jsx("div",{className:"w-full max-w-[500px] mx-auto",children:i.jsx(he,{onClick:()=>r(!0)})})}),e[42]=n,e[43]=x):x=e[43];let _;e[44]!==u||e[45]!==x?(_=i.jsxs("div",{className:"flex-1 relative flex flex-col items-center px-10",children:[u,x]}),e[44]=u,e[45]=x,e[46]=_):_=e[46];let y;e[47]!==s?(y=i.jsx(ce,{open:s,onOpenChange:r}),e[47]=s,e[48]=y):y=e[48];let A;return e[49]!==_||e[50]!==y?(A=i.jsxs(i.Fragment,{children:[_,y]}),e[49]=_,e[50]=y,e[51]=A):A=e[51],A}const _t="flex size-7 shrink-0 items-center justify-center rounded-md transition-colors",yt="bg-sidebar-accent text-sidebar-foreground",vt="text-sidebar-foreground/60 hover:bg-sidebar-accent hover:text-sidebar-foreground";function Nt(){const e=D.c(13),{tasksOpen:t,toggleTasks:s}=ze();let r;e[0]!==t||e[1]!==s?(r=()=>{ne("home_toolbar_toggled",{button:"tasks",next_state:t?"closed":"open"}),s()},e[0]=t,e[1]=s,e[2]=r):r=e[2];const n=t?yt:vt;let l;e[3]!==n?(l=se(_t,n),e[3]=n,e[4]=l):l=e[4];let a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(Ee,{size:16}),e[5]=a):a=e[5];let o;e[6]!==r||e[7]!==l||e[8]!==t?(o=i.jsx(Ae,{asChild:!0,children:i.jsx("button",{type:"button",onClick:r,"aria-pressed":t,className:l,children:a})}),e[6]=r,e[7]=l,e[8]=t,e[9]=o):o=e[9];let m;e[10]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(Oe,{side:"bottom",children:"Tasks"}),e[10]=m):m=e[10];let g;return e[11]!==o?(g=i.jsxs(Te,{delayDuration:300,children:[o,m]}),e[11]=o,e[12]=g):g=e[12],g}function ps(){const e=D.c(3);if(_e()){let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsx("div",{className:"flex-1 min-h-0 flex flex-col bg-background overflow-hidden",children:i.jsx(be,{})}),e[0]=n):n=e[0],n}let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx(Le.Toggles,{children:i.jsx(Nt,{})}),e[1]=s):s=e[1];let r;return e[2]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsxs(i.Fragment,{children:[s,i.jsx("div",{className:"flex-1 min-h-0 pb-1 pr-1 pl-0 pt-0",children:i.jsx("div",{className:"h-full p-0.5 pt-0.25",children:i.jsx("div",{className:"flex flex-col h-full bg-background overflow-hidden card-shadow rounded-[0.75rem]",children:i.jsx(be,{})})})})]}),e[2]=r):r=e[2],r}export{ps as default};
@@ -1 +1 @@
1
- import{r as n,aT as q,bY as R,bZ as Ee,b_ as ke,b$ as Se,bd as xe,c0 as j}from"./index-CsB6QrBB.js";var de=1,Ie=.9,Ce=.8,Re=.17,Z=.1,Q=.999,Ae=.9999,Me=.99,$e=/[\\\/_+.#"@\[\(\{&]/,De=/[\\\/_+.#"@\[\(\{&]/g,Fe=/[\s-]/,ve=/[\s-]/g;function ee(t,l,r,f,u,c,d){if(c===l.length)return u===t.length?de:Me;var v=`${u},${c}`;if(d[v]!==void 0)return d[v];for(var b=f.charAt(c),i=r.indexOf(b,u),p=0,h,x,E,I;i>=0;)h=ee(t,l,r,f,i+1,c+1,d),h>p&&(i===u?h*=de:$e.test(t.charAt(i-1))?(h*=Ce,E=t.slice(u,i-1).match(De),E&&u>0&&(h*=Math.pow(Q,E.length))):Fe.test(t.charAt(i-1))?(h*=Ie,I=t.slice(u,i-1).match(ve),I&&u>0&&(h*=Math.pow(Q,I.length))):(h*=Re,u>0&&(h*=Math.pow(Q,i-u))),t.charAt(i)!==l.charAt(c)&&(h*=Ae)),(h<Z&&r.charAt(i-1)===f.charAt(c+1)||f.charAt(c+1)===f.charAt(c)&&r.charAt(i-1)!==f.charAt(c))&&(x=ee(t,l,r,f,i+1,c+2,d),x*Z>h&&(h=x*Z)),h>p&&(p=h),i=r.indexOf(b,i+1);return d[v]=p,p}function se(t){return t.toLowerCase().replace(ve," ")}function Ke(t,l,r){return t=r&&r.length>0?`${t+" "+r.join(" ")}`:t,ee(t,l,se(t),se(l),0,0,{})}var V='[cmdk-group=""]',_='[cmdk-group-items=""]',qe='[cmdk-group-heading=""]',me='[cmdk-item=""]',fe=`${me}:not([aria-disabled="true"])`,te="cmdk-item-select",F="data-value",Pe=(t,l,r)=>Ke(t,l,r),pe=n.createContext(void 0),L=()=>n.useContext(pe),he=n.createContext(void 0),re=()=>n.useContext(he),ge=n.createContext(void 0),be=n.forwardRef((t,l)=>{let r=K(()=>{var e,o;return{search:"",value:(o=(e=t.value)!=null?e:t.defaultValue)!=null?o:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),f=K(()=>new Set),u=K(()=>new Map),c=K(()=>new Map),d=K(()=>new Set),v=we(t),{label:b,children:i,value:p,onValueChange:h,filter:x,shouldFilter:E,loop:I,disablePointerSelection:T=!1,vimBindings:A=!0,...O}=t,U=q(),ne=q(),H=q(),M=n.useRef(null),w=We();$(()=>{if(p!==void 0){let e=p.trim();r.current.value=e,k.emit()}},[p]),$(()=>{w(6,ae)},[]);let k=n.useMemo(()=>({subscribe:e=>(d.current.add(e),()=>d.current.delete(e)),snapshot:()=>r.current,setState:(e,o,s)=>{var a,m,g,S;if(!Object.is(r.current[e],o)){if(r.current[e]=o,e==="search")G(),W(),w(1,Y);else if(e==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let y=document.getElementById(H);y?y.focus():(a=document.getElementById(U))==null||a.focus()}if(w(7,()=>{var y;r.current.selectedItemId=(y=D())==null?void 0:y.id,k.emit()}),s||w(5,ae),((m=v.current)==null?void 0:m.value)!==void 0){let y=o??"";(S=(g=v.current).onValueChange)==null||S.call(g,y);return}}k.emit()}},emit:()=>{d.current.forEach(e=>e())}}),[]),N=n.useMemo(()=>({value:(e,o,s)=>{var a;o!==((a=c.current.get(e))==null?void 0:a.value)&&(c.current.set(e,{value:o,keywords:s}),r.current.filtered.items.set(e,le(o,s)),w(2,()=>{W(),k.emit()}))},item:(e,o)=>(f.current.add(e),o&&(u.current.has(o)?u.current.get(o).add(e):u.current.set(o,new Set([e]))),w(3,()=>{G(),W(),r.current.value||Y(),k.emit()}),()=>{c.current.delete(e),f.current.delete(e),r.current.filtered.items.delete(e);let s=D();w(4,()=>{G(),s?.getAttribute("id")===e&&Y(),k.emit()})}),group:e=>(u.current.has(e)||u.current.set(e,new Set),()=>{c.current.delete(e),u.current.delete(e)}),filter:()=>v.current.shouldFilter,label:b||t["aria-label"],getDisablePointerSelection:()=>v.current.disablePointerSelection,listId:U,inputId:H,labelId:ne,listInnerRef:M}),[]);function le(e,o){var s,a;let m=(a=(s=v.current)==null?void 0:s.filter)!=null?a:Pe;return e?m(e,r.current.search,o):0}function W(){if(!r.current.search||v.current.shouldFilter===!1)return;let e=r.current.filtered.items,o=[];r.current.filtered.groups.forEach(a=>{let m=u.current.get(a),g=0;m.forEach(S=>{let y=e.get(S);g=Math.max(y,g)}),o.push([a,g])});let s=M.current;P().sort((a,m)=>{var g,S;let y=a.getAttribute("id"),B=m.getAttribute("id");return((g=e.get(B))!=null?g:0)-((S=e.get(y))!=null?S:0)}).forEach(a=>{let m=a.closest(_);m?m.appendChild(a.parentElement===m?a:a.closest(`${_} > *`)):s.appendChild(a.parentElement===s?a:a.closest(`${_} > *`))}),o.sort((a,m)=>m[1]-a[1]).forEach(a=>{var m;let g=(m=M.current)==null?void 0:m.querySelector(`${V}[${F}="${encodeURIComponent(a[0])}"]`);g?.parentElement.appendChild(g)})}function Y(){let e=P().find(s=>s.getAttribute("aria-disabled")!=="true"),o=e?.getAttribute(F);k.setState("value",o||void 0)}function G(){var e,o,s,a;if(!r.current.search||v.current.shouldFilter===!1){r.current.filtered.count=f.current.size;return}r.current.filtered.groups=new Set;let m=0;for(let g of f.current){let S=(o=(e=c.current.get(g))==null?void 0:e.value)!=null?o:"",y=(a=(s=c.current.get(g))==null?void 0:s.keywords)!=null?a:[],B=le(S,y);r.current.filtered.items.set(g,B),B>0&&m++}for(let[g,S]of u.current)for(let y of S)if(r.current.filtered.items.get(y)>0){r.current.filtered.groups.add(g);break}r.current.filtered.count=m}function ae(){var e,o,s;let a=D();a&&(((e=a.parentElement)==null?void 0:e.firstChild)===a&&((s=(o=a.closest(V))==null?void 0:o.querySelector(qe))==null||s.scrollIntoView({block:"nearest"})),a.scrollIntoView({block:"nearest"}))}function D(){var e;return(e=M.current)==null?void 0:e.querySelector(`${me}[aria-selected="true"]`)}function P(){var e;return Array.from(((e=M.current)==null?void 0:e.querySelectorAll(fe))||[])}function J(e){let o=P()[e];o&&k.setState("value",o.getAttribute(F))}function X(e){var o;let s=D(),a=P(),m=a.findIndex(S=>S===s),g=a[m+e];(o=v.current)!=null&&o.loop&&(g=m+e<0?a[a.length-1]:m+e===a.length?a[0]:a[m+e]),g&&k.setState("value",g.getAttribute(F))}function ue(e){let o=D(),s=o?.closest(V),a;for(;s&&!a;)s=e>0?He(s,V):Ne(s,V),a=s?.querySelector(fe);a?k.setState("value",a.getAttribute(F)):X(e)}let ie=()=>J(P().length-1),oe=e=>{e.preventDefault(),e.metaKey?ie():e.altKey?ue(1):X(1)},ce=e=>{e.preventDefault(),e.metaKey?J(0):e.altKey?ue(-1):X(-1)};return n.createElement(R.div,{ref:l,tabIndex:-1,...O,"cmdk-root":"",onKeyDown:e=>{var o;(o=O.onKeyDown)==null||o.call(O,e);let s=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||s))switch(e.key){case"n":case"j":{A&&e.ctrlKey&&oe(e);break}case"ArrowDown":{oe(e);break}case"p":case"k":{A&&e.ctrlKey&&ce(e);break}case"ArrowUp":{ce(e);break}case"Home":{e.preventDefault(),J(0);break}case"End":{e.preventDefault(),ie();break}case"Enter":{e.preventDefault();let a=D();if(a){let m=new Event(te);a.dispatchEvent(m)}}}}},n.createElement("label",{"cmdk-label":"",htmlFor:N.inputId,id:N.labelId,style:Ge},b),z(t,e=>n.createElement(he.Provider,{value:k},n.createElement(pe.Provider,{value:N},e))))}),Ve=n.forwardRef((t,l)=>{var r,f;let u=q(),c=n.useRef(null),d=n.useContext(ge),v=L(),b=we(t),i=(f=(r=b.current)==null?void 0:r.forceMount)!=null?f:d?.forceMount;$(()=>{if(!i)return v.item(u,d?.id)},[i]);let p=ye(u,c,[t.value,t.children,c],t.keywords),h=re(),x=C(w=>w.value&&w.value===p.current),E=C(w=>i||v.filter()===!1?!0:w.search?w.filtered.items.get(u)>0:!0);n.useEffect(()=>{let w=c.current;if(!(!w||t.disabled))return w.addEventListener(te,I),()=>w.removeEventListener(te,I)},[E,t.onSelect,t.disabled]);function I(){var w,k;T(),(k=(w=b.current).onSelect)==null||k.call(w,p.current)}function T(){h.setState("value",p.current,!0)}if(!E)return null;let{disabled:A,value:O,onSelect:U,forceMount:ne,keywords:H,...M}=t;return n.createElement(R.div,{ref:j(c,l),...M,id:u,"cmdk-item":"",role:"option","aria-disabled":!!A,"aria-selected":!!x,"data-disabled":!!A,"data-selected":!!x,onPointerMove:A||v.getDisablePointerSelection()?void 0:T,onClick:A?void 0:I},t.children)}),je=n.forwardRef((t,l)=>{let{heading:r,children:f,forceMount:u,...c}=t,d=q(),v=n.useRef(null),b=n.useRef(null),i=q(),p=L(),h=C(E=>u||p.filter()===!1?!0:E.search?E.filtered.groups.has(d):!0);$(()=>p.group(d),[]),ye(d,v,[t.value,t.heading,b]);let x=n.useMemo(()=>({id:d,forceMount:u}),[u]);return n.createElement(R.div,{ref:j(v,l),...c,"cmdk-group":"",role:"presentation",hidden:h?void 0:!0},r&&n.createElement("div",{ref:b,"cmdk-group-heading":"","aria-hidden":!0,id:i},r),z(t,E=>n.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?i:void 0},n.createElement(ge.Provider,{value:x},E))))}),Le=n.forwardRef((t,l)=>{let{alwaysRender:r,...f}=t,u=n.useRef(null),c=C(d=>!d.search);return!r&&!c?null:n.createElement(R.div,{ref:j(u,l),...f,"cmdk-separator":"",role:"separator"})}),Oe=n.forwardRef((t,l)=>{let{onValueChange:r,...f}=t,u=t.value!=null,c=re(),d=C(i=>i.search),v=C(i=>i.selectedItemId),b=L();return n.useEffect(()=>{t.value!=null&&c.setState("search",t.value)},[t.value]),n.createElement(R.input,{ref:l,...f,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":b.listId,"aria-labelledby":b.labelId,"aria-activedescendant":v,id:b.inputId,type:"text",value:u?t.value:d,onChange:i=>{u||c.setState("search",i.target.value),r?.(i.target.value)}})}),Be=n.forwardRef((t,l)=>{let{children:r,label:f="Suggestions",...u}=t,c=n.useRef(null),d=n.useRef(null),v=C(i=>i.selectedItemId),b=L();return n.useEffect(()=>{if(d.current&&c.current){let i=d.current,p=c.current,h,x=new ResizeObserver(()=>{h=requestAnimationFrame(()=>{let E=i.offsetHeight;p.style.setProperty("--cmdk-list-height",E.toFixed(1)+"px")})});return x.observe(i),()=>{cancelAnimationFrame(h),x.unobserve(i)}}},[]),n.createElement(R.div,{ref:j(c,l),...u,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":v,"aria-label":f,id:b.listId},z(t,i=>n.createElement("div",{ref:j(d,b.listInnerRef),"cmdk-list-sizer":""},i)))}),ze=n.forwardRef((t,l)=>{let{open:r,onOpenChange:f,overlayClassName:u,contentClassName:c,container:d,...v}=t;return n.createElement(Ee,{open:r,onOpenChange:f},n.createElement(ke,{container:d},n.createElement(Se,{"cmdk-overlay":"",className:u}),n.createElement(xe,{"aria-label":t.label,"cmdk-dialog":"",className:c},n.createElement(be,{ref:l,...v}))))}),Te=n.forwardRef((t,l)=>C(r=>r.filtered.count===0)?n.createElement(R.div,{ref:l,...t,"cmdk-empty":"",role:"presentation"}):null),Ue=n.forwardRef((t,l)=>{let{progress:r,children:f,label:u="Loading...",...c}=t;return n.createElement(R.div,{ref:l,...c,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":u},z(t,d=>n.createElement("div",{"aria-hidden":!0},d)))}),Xe=Object.assign(be,{List:Be,Item:Ve,Input:Oe,Group:je,Separator:Le,Dialog:ze,Empty:Te,Loading:Ue});function He(t,l){let r=t.nextElementSibling;for(;r;){if(r.matches(l))return r;r=r.nextElementSibling}}function Ne(t,l){let r=t.previousElementSibling;for(;r;){if(r.matches(l))return r;r=r.previousElementSibling}}function we(t){let l=n.useRef(t);return $(()=>{l.current=t}),l}var $=typeof window>"u"?n.useEffect:n.useLayoutEffect;function K(t){let l=n.useRef();return l.current===void 0&&(l.current=t()),l}function C(t){let l=re(),r=()=>t(l.snapshot());return n.useSyncExternalStore(l.subscribe,r,r)}function ye(t,l,r,f=[]){let u=n.useRef(),c=L();return $(()=>{var d;let v=(()=>{var i;for(let p of r){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(i=p.current.textContent)==null?void 0:i.trim():u.current}})(),b=f.map(i=>i.trim());c.value(t,v,b),(d=l.current)==null||d.setAttribute(F,v),u.current=v}),u}var We=()=>{let[t,l]=n.useState(),r=K(()=>new Map);return $(()=>{r.current.forEach(f=>f()),r.current=new Map},[t]),(f,u)=>{r.current.set(f,u),l({})}};function Ye(t){let l=t.type;return typeof l=="function"?l(t.props):"render"in l?l.render(t.props):t}function z({asChild:t,children:l},r){return t&&n.isValidElement(l)?n.cloneElement(Ye(l),{ref:l.ref},r(l.props.children)):r(l)}var Ge={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};export{Xe as _};
1
+ import{r as n,aT as q,bY as R,bZ as Ee,b_ as ke,b$ as Se,bd as xe,c0 as j}from"./index-CzOMQ7ME.js";var de=1,Ie=.9,Ce=.8,Re=.17,Z=.1,Q=.999,Ae=.9999,Me=.99,$e=/[\\\/_+.#"@\[\(\{&]/,De=/[\\\/_+.#"@\[\(\{&]/g,Fe=/[\s-]/,ve=/[\s-]/g;function ee(t,l,r,f,u,c,d){if(c===l.length)return u===t.length?de:Me;var v=`${u},${c}`;if(d[v]!==void 0)return d[v];for(var b=f.charAt(c),i=r.indexOf(b,u),p=0,h,x,E,I;i>=0;)h=ee(t,l,r,f,i+1,c+1,d),h>p&&(i===u?h*=de:$e.test(t.charAt(i-1))?(h*=Ce,E=t.slice(u,i-1).match(De),E&&u>0&&(h*=Math.pow(Q,E.length))):Fe.test(t.charAt(i-1))?(h*=Ie,I=t.slice(u,i-1).match(ve),I&&u>0&&(h*=Math.pow(Q,I.length))):(h*=Re,u>0&&(h*=Math.pow(Q,i-u))),t.charAt(i)!==l.charAt(c)&&(h*=Ae)),(h<Z&&r.charAt(i-1)===f.charAt(c+1)||f.charAt(c+1)===f.charAt(c)&&r.charAt(i-1)!==f.charAt(c))&&(x=ee(t,l,r,f,i+1,c+2,d),x*Z>h&&(h=x*Z)),h>p&&(p=h),i=r.indexOf(b,i+1);return d[v]=p,p}function se(t){return t.toLowerCase().replace(ve," ")}function Ke(t,l,r){return t=r&&r.length>0?`${t+" "+r.join(" ")}`:t,ee(t,l,se(t),se(l),0,0,{})}var V='[cmdk-group=""]',_='[cmdk-group-items=""]',qe='[cmdk-group-heading=""]',me='[cmdk-item=""]',fe=`${me}:not([aria-disabled="true"])`,te="cmdk-item-select",F="data-value",Pe=(t,l,r)=>Ke(t,l,r),pe=n.createContext(void 0),L=()=>n.useContext(pe),he=n.createContext(void 0),re=()=>n.useContext(he),ge=n.createContext(void 0),be=n.forwardRef((t,l)=>{let r=K(()=>{var e,o;return{search:"",value:(o=(e=t.value)!=null?e:t.defaultValue)!=null?o:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),f=K(()=>new Set),u=K(()=>new Map),c=K(()=>new Map),d=K(()=>new Set),v=we(t),{label:b,children:i,value:p,onValueChange:h,filter:x,shouldFilter:E,loop:I,disablePointerSelection:T=!1,vimBindings:A=!0,...O}=t,U=q(),ne=q(),H=q(),M=n.useRef(null),w=We();$(()=>{if(p!==void 0){let e=p.trim();r.current.value=e,k.emit()}},[p]),$(()=>{w(6,ae)},[]);let k=n.useMemo(()=>({subscribe:e=>(d.current.add(e),()=>d.current.delete(e)),snapshot:()=>r.current,setState:(e,o,s)=>{var a,m,g,S;if(!Object.is(r.current[e],o)){if(r.current[e]=o,e==="search")G(),W(),w(1,Y);else if(e==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let y=document.getElementById(H);y?y.focus():(a=document.getElementById(U))==null||a.focus()}if(w(7,()=>{var y;r.current.selectedItemId=(y=D())==null?void 0:y.id,k.emit()}),s||w(5,ae),((m=v.current)==null?void 0:m.value)!==void 0){let y=o??"";(S=(g=v.current).onValueChange)==null||S.call(g,y);return}}k.emit()}},emit:()=>{d.current.forEach(e=>e())}}),[]),N=n.useMemo(()=>({value:(e,o,s)=>{var a;o!==((a=c.current.get(e))==null?void 0:a.value)&&(c.current.set(e,{value:o,keywords:s}),r.current.filtered.items.set(e,le(o,s)),w(2,()=>{W(),k.emit()}))},item:(e,o)=>(f.current.add(e),o&&(u.current.has(o)?u.current.get(o).add(e):u.current.set(o,new Set([e]))),w(3,()=>{G(),W(),r.current.value||Y(),k.emit()}),()=>{c.current.delete(e),f.current.delete(e),r.current.filtered.items.delete(e);let s=D();w(4,()=>{G(),s?.getAttribute("id")===e&&Y(),k.emit()})}),group:e=>(u.current.has(e)||u.current.set(e,new Set),()=>{c.current.delete(e),u.current.delete(e)}),filter:()=>v.current.shouldFilter,label:b||t["aria-label"],getDisablePointerSelection:()=>v.current.disablePointerSelection,listId:U,inputId:H,labelId:ne,listInnerRef:M}),[]);function le(e,o){var s,a;let m=(a=(s=v.current)==null?void 0:s.filter)!=null?a:Pe;return e?m(e,r.current.search,o):0}function W(){if(!r.current.search||v.current.shouldFilter===!1)return;let e=r.current.filtered.items,o=[];r.current.filtered.groups.forEach(a=>{let m=u.current.get(a),g=0;m.forEach(S=>{let y=e.get(S);g=Math.max(y,g)}),o.push([a,g])});let s=M.current;P().sort((a,m)=>{var g,S;let y=a.getAttribute("id"),B=m.getAttribute("id");return((g=e.get(B))!=null?g:0)-((S=e.get(y))!=null?S:0)}).forEach(a=>{let m=a.closest(_);m?m.appendChild(a.parentElement===m?a:a.closest(`${_} > *`)):s.appendChild(a.parentElement===s?a:a.closest(`${_} > *`))}),o.sort((a,m)=>m[1]-a[1]).forEach(a=>{var m;let g=(m=M.current)==null?void 0:m.querySelector(`${V}[${F}="${encodeURIComponent(a[0])}"]`);g?.parentElement.appendChild(g)})}function Y(){let e=P().find(s=>s.getAttribute("aria-disabled")!=="true"),o=e?.getAttribute(F);k.setState("value",o||void 0)}function G(){var e,o,s,a;if(!r.current.search||v.current.shouldFilter===!1){r.current.filtered.count=f.current.size;return}r.current.filtered.groups=new Set;let m=0;for(let g of f.current){let S=(o=(e=c.current.get(g))==null?void 0:e.value)!=null?o:"",y=(a=(s=c.current.get(g))==null?void 0:s.keywords)!=null?a:[],B=le(S,y);r.current.filtered.items.set(g,B),B>0&&m++}for(let[g,S]of u.current)for(let y of S)if(r.current.filtered.items.get(y)>0){r.current.filtered.groups.add(g);break}r.current.filtered.count=m}function ae(){var e,o,s;let a=D();a&&(((e=a.parentElement)==null?void 0:e.firstChild)===a&&((s=(o=a.closest(V))==null?void 0:o.querySelector(qe))==null||s.scrollIntoView({block:"nearest"})),a.scrollIntoView({block:"nearest"}))}function D(){var e;return(e=M.current)==null?void 0:e.querySelector(`${me}[aria-selected="true"]`)}function P(){var e;return Array.from(((e=M.current)==null?void 0:e.querySelectorAll(fe))||[])}function J(e){let o=P()[e];o&&k.setState("value",o.getAttribute(F))}function X(e){var o;let s=D(),a=P(),m=a.findIndex(S=>S===s),g=a[m+e];(o=v.current)!=null&&o.loop&&(g=m+e<0?a[a.length-1]:m+e===a.length?a[0]:a[m+e]),g&&k.setState("value",g.getAttribute(F))}function ue(e){let o=D(),s=o?.closest(V),a;for(;s&&!a;)s=e>0?He(s,V):Ne(s,V),a=s?.querySelector(fe);a?k.setState("value",a.getAttribute(F)):X(e)}let ie=()=>J(P().length-1),oe=e=>{e.preventDefault(),e.metaKey?ie():e.altKey?ue(1):X(1)},ce=e=>{e.preventDefault(),e.metaKey?J(0):e.altKey?ue(-1):X(-1)};return n.createElement(R.div,{ref:l,tabIndex:-1,...O,"cmdk-root":"",onKeyDown:e=>{var o;(o=O.onKeyDown)==null||o.call(O,e);let s=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||s))switch(e.key){case"n":case"j":{A&&e.ctrlKey&&oe(e);break}case"ArrowDown":{oe(e);break}case"p":case"k":{A&&e.ctrlKey&&ce(e);break}case"ArrowUp":{ce(e);break}case"Home":{e.preventDefault(),J(0);break}case"End":{e.preventDefault(),ie();break}case"Enter":{e.preventDefault();let a=D();if(a){let m=new Event(te);a.dispatchEvent(m)}}}}},n.createElement("label",{"cmdk-label":"",htmlFor:N.inputId,id:N.labelId,style:Ge},b),z(t,e=>n.createElement(he.Provider,{value:k},n.createElement(pe.Provider,{value:N},e))))}),Ve=n.forwardRef((t,l)=>{var r,f;let u=q(),c=n.useRef(null),d=n.useContext(ge),v=L(),b=we(t),i=(f=(r=b.current)==null?void 0:r.forceMount)!=null?f:d?.forceMount;$(()=>{if(!i)return v.item(u,d?.id)},[i]);let p=ye(u,c,[t.value,t.children,c],t.keywords),h=re(),x=C(w=>w.value&&w.value===p.current),E=C(w=>i||v.filter()===!1?!0:w.search?w.filtered.items.get(u)>0:!0);n.useEffect(()=>{let w=c.current;if(!(!w||t.disabled))return w.addEventListener(te,I),()=>w.removeEventListener(te,I)},[E,t.onSelect,t.disabled]);function I(){var w,k;T(),(k=(w=b.current).onSelect)==null||k.call(w,p.current)}function T(){h.setState("value",p.current,!0)}if(!E)return null;let{disabled:A,value:O,onSelect:U,forceMount:ne,keywords:H,...M}=t;return n.createElement(R.div,{ref:j(c,l),...M,id:u,"cmdk-item":"",role:"option","aria-disabled":!!A,"aria-selected":!!x,"data-disabled":!!A,"data-selected":!!x,onPointerMove:A||v.getDisablePointerSelection()?void 0:T,onClick:A?void 0:I},t.children)}),je=n.forwardRef((t,l)=>{let{heading:r,children:f,forceMount:u,...c}=t,d=q(),v=n.useRef(null),b=n.useRef(null),i=q(),p=L(),h=C(E=>u||p.filter()===!1?!0:E.search?E.filtered.groups.has(d):!0);$(()=>p.group(d),[]),ye(d,v,[t.value,t.heading,b]);let x=n.useMemo(()=>({id:d,forceMount:u}),[u]);return n.createElement(R.div,{ref:j(v,l),...c,"cmdk-group":"",role:"presentation",hidden:h?void 0:!0},r&&n.createElement("div",{ref:b,"cmdk-group-heading":"","aria-hidden":!0,id:i},r),z(t,E=>n.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?i:void 0},n.createElement(ge.Provider,{value:x},E))))}),Le=n.forwardRef((t,l)=>{let{alwaysRender:r,...f}=t,u=n.useRef(null),c=C(d=>!d.search);return!r&&!c?null:n.createElement(R.div,{ref:j(u,l),...f,"cmdk-separator":"",role:"separator"})}),Oe=n.forwardRef((t,l)=>{let{onValueChange:r,...f}=t,u=t.value!=null,c=re(),d=C(i=>i.search),v=C(i=>i.selectedItemId),b=L();return n.useEffect(()=>{t.value!=null&&c.setState("search",t.value)},[t.value]),n.createElement(R.input,{ref:l,...f,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":b.listId,"aria-labelledby":b.labelId,"aria-activedescendant":v,id:b.inputId,type:"text",value:u?t.value:d,onChange:i=>{u||c.setState("search",i.target.value),r?.(i.target.value)}})}),Be=n.forwardRef((t,l)=>{let{children:r,label:f="Suggestions",...u}=t,c=n.useRef(null),d=n.useRef(null),v=C(i=>i.selectedItemId),b=L();return n.useEffect(()=>{if(d.current&&c.current){let i=d.current,p=c.current,h,x=new ResizeObserver(()=>{h=requestAnimationFrame(()=>{let E=i.offsetHeight;p.style.setProperty("--cmdk-list-height",E.toFixed(1)+"px")})});return x.observe(i),()=>{cancelAnimationFrame(h),x.unobserve(i)}}},[]),n.createElement(R.div,{ref:j(c,l),...u,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":v,"aria-label":f,id:b.listId},z(t,i=>n.createElement("div",{ref:j(d,b.listInnerRef),"cmdk-list-sizer":""},i)))}),ze=n.forwardRef((t,l)=>{let{open:r,onOpenChange:f,overlayClassName:u,contentClassName:c,container:d,...v}=t;return n.createElement(Ee,{open:r,onOpenChange:f},n.createElement(ke,{container:d},n.createElement(Se,{"cmdk-overlay":"",className:u}),n.createElement(xe,{"aria-label":t.label,"cmdk-dialog":"",className:c},n.createElement(be,{ref:l,...v}))))}),Te=n.forwardRef((t,l)=>C(r=>r.filtered.count===0)?n.createElement(R.div,{ref:l,...t,"cmdk-empty":"",role:"presentation"}):null),Ue=n.forwardRef((t,l)=>{let{progress:r,children:f,label:u="Loading...",...c}=t;return n.createElement(R.div,{ref:l,...c,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":u},z(t,d=>n.createElement("div",{"aria-hidden":!0},d)))}),Xe=Object.assign(be,{List:Be,Item:Ve,Input:Oe,Group:je,Separator:Le,Dialog:ze,Empty:Te,Loading:Ue});function He(t,l){let r=t.nextElementSibling;for(;r;){if(r.matches(l))return r;r=r.nextElementSibling}}function Ne(t,l){let r=t.previousElementSibling;for(;r;){if(r.matches(l))return r;r=r.previousElementSibling}}function we(t){let l=n.useRef(t);return $(()=>{l.current=t}),l}var $=typeof window>"u"?n.useEffect:n.useLayoutEffect;function K(t){let l=n.useRef();return l.current===void 0&&(l.current=t()),l}function C(t){let l=re(),r=()=>t(l.snapshot());return n.useSyncExternalStore(l.subscribe,r,r)}function ye(t,l,r,f=[]){let u=n.useRef(),c=L();return $(()=>{var d;let v=(()=>{var i;for(let p of r){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(i=p.current.textContent)==null?void 0:i.trim():u.current}})(),b=f.map(i=>i.trim());c.value(t,v,b),(d=l.current)==null||d.setAttribute(F,v),u.current=v}),u}var We=()=>{let[t,l]=n.useState(),r=K(()=>new Map);return $(()=>{r.current.forEach(f=>f()),r.current=new Map},[t]),(f,u)=>{r.current.set(f,u),l({})}};function Ye(t){let l=t.type;return typeof l=="function"?l(t.props):"render"in l?l.render(t.props):t}function z({asChild:t,children:l},r){return t&&n.isValidElement(l)?n.cloneElement(Ye(l),{ref:l.ref},r(l.props.children)):r(l)}var Ge={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};export{Xe as _};