@decocms/mesh 2.125.2 → 2.126.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 (213) hide show
  1. package/dist/client/assets/{AlertCircle-Cnw5GhjM.js → AlertCircle-LGpS_W0y.js} +1 -1
  2. package/dist/client/assets/{AlertOctagon-PE1D_d6N.js → AlertOctagon-B8MQnfim.js} +1 -1
  3. package/dist/client/assets/{AlertTriangle-DiiOmxZ5.js → AlertTriangle-BauDdA9B.js} +1 -1
  4. package/dist/client/assets/{ArrowDown-Dq_ix_a5.js → ArrowDown-OoKXTEnQ.js} +1 -1
  5. package/dist/client/assets/{ArrowLeft-2v2jDyMq.js → ArrowLeft-Dn8aVT34.js} +1 -1
  6. package/dist/client/assets/{ArrowUp-CP0dzs2U.js → ArrowUp-C43RK3lv.js} +1 -1
  7. package/dist/client/assets/{Check-IyJXmB3D.js → Check-DM3yWukQ.js} +1 -1
  8. package/dist/client/assets/{CheckCircle-D3-L-7q8.js → CheckCircle-s30iekcd.js} +1 -1
  9. package/dist/client/assets/{CheckDone01-Bl3K1H3i.js → CheckDone01-C4PaB87i.js} +1 -1
  10. package/dist/client/assets/{CheckVerified02-BTHXPwp3.js → CheckVerified02-DU8VH_8T.js} +1 -1
  11. package/dist/client/assets/{ChevronDown-CrA0GhEu.js → ChevronDown-Bvtjl1_J.js} +1 -1
  12. package/dist/client/assets/{ChevronRight-CQzN9ZtD.js → ChevronRight-BKg32aVF.js} +1 -1
  13. package/dist/client/assets/{Clock-BMY1eaW0.js → Clock-Db0q0BRR.js} +1 -1
  14. package/dist/client/assets/{Code01-CeGRGPJZ.js → Code01-B3OBXj9k.js} +1 -1
  15. package/dist/client/assets/{Container-BgkRftdL.js → Container-C5C-QC37.js} +1 -1
  16. package/dist/client/assets/{Copy01-B7sbyU73.js → Copy01-DzvhIVnU.js} +1 -1
  17. package/dist/client/assets/{Dataflow03-YIKw6rhG.js → Dataflow03-97xXCxRc.js} +1 -1
  18. package/dist/client/assets/{DotsHorizontal-CStsW4jn.js → DotsHorizontal-DMaXCWHm.js} +1 -1
  19. package/dist/client/assets/{DotsVertical-BPB7nTxW.js → DotsVertical-JJuFY8qc.js} +1 -1
  20. package/dist/client/assets/{Download01-Iy9CsXT2.js → Download01-DQldvQzj.js} +1 -1
  21. package/dist/client/assets/{Edit01-BpchkiZj.js → Edit01-BWtM7ub2.js} +1 -1
  22. package/dist/client/assets/{Eye-CF7Jsi4h.js → Eye-msaxJPjl.js} +1 -1
  23. package/dist/client/assets/{File02-CNIaQNnA.js → File02-BTq_raQ0.js} +1 -1
  24. package/dist/client/assets/{File06-CN-CUlfW.js → File06-CkssxHwK.js} +1 -1
  25. package/dist/client/assets/{FilterLines-DKhKP4R7.js → FilterLines-DzDnwBbY.js} +1 -1
  26. package/dist/client/assets/{Globe01-C1WtitJR.js → Globe01-yf3RJj7g.js} +1 -1
  27. package/dist/client/assets/{Globe02-CLsJ4yCM.js → Globe02-DKs0xoZA.js} +1 -1
  28. package/dist/client/assets/{Grid01-BfcTdCmK.js → Grid01-BHkfA168.js} +1 -1
  29. package/dist/client/assets/{Hash02-66QHm8zh.js → Hash02-Dp3aQkYF.js} +1 -1
  30. package/dist/client/assets/{Home02-CLBx-CYf.js → Home02-AwwZSxVR.js} +1 -1
  31. package/dist/client/assets/{Image01-DiX4EYL6.js → Image01-BNys_Mns.js} +1 -1
  32. package/dist/client/assets/{Inbox01-uvAm2NdJ.js → Inbox01-NqZ6AxHy.js} +1 -1
  33. package/dist/client/assets/{InfoCircle-D8WkBwCV.js → InfoCircle-COa3ThIj.js} +1 -1
  34. package/dist/client/assets/{Key01-CRfrhjcx.js → Key01-CtmMXgET.js} +1 -1
  35. package/dist/client/assets/{LinkExternal01-Dmi80ZqJ.js → LinkExternal01-B3-zqscw.js} +1 -1
  36. package/dist/client/assets/{List-DHYjADtQ.js → List-Cnm7l2wU.js} +1 -1
  37. package/dist/client/assets/{Loading01-5Os1EBQC.js → Loading01-BQNDOWoE.js} +1 -1
  38. package/dist/client/assets/{Lock01-CMu9e9I1.js → Lock01-CBVbJi0G.js} +1 -1
  39. package/dist/client/assets/{Pin01-Dtlca92y.js → Pin01-T7uk7ccW.js} +1 -1
  40. package/dist/client/assets/{Play-DpYyJNLB.js → Play-CDz_Acji.js} +1 -1
  41. package/dist/client/assets/{Plus-BZOdPpEn.js → Plus-WCxYwLGA.js} +1 -1
  42. package/dist/client/assets/{RefreshCcw01-BU6Us9RR.js → RefreshCcw01-Ce4Zz6-L.js} +1 -1
  43. package/dist/client/assets/{RefreshCw01-ClksFdlE.js → RefreshCw01-Bg7WUwR3.js} +1 -1
  44. package/dist/client/assets/{Rows03-iLB6Pjez.js → Rows03-CDFo4INw.js} +1 -1
  45. package/dist/client/assets/{Save01-ipX1ktUE.js → Save01-C6t04HUj.js} +1 -1
  46. package/dist/client/assets/{SearchMd-C4hV7R8V.js → SearchMd-7zTlMjUG.js} +1 -1
  47. package/dist/client/assets/{Settings01-KIfOk1bg.js → Settings01-DnNomfd3.js} +1 -1
  48. package/dist/client/assets/{Shield01-Nc9e9wCl.js → Shield01-DdcqF-Gb.js} +1 -1
  49. package/dist/client/assets/{Terminal-1Out0GjX.js → Terminal-DMjgMuI5.js} +1 -1
  50. package/dist/client/assets/Tool01-DoJfr-IU.js +1 -0
  51. package/dist/client/assets/{Trash01-DA9Iy0yG.js → Trash01-DTKgec-l.js} +1 -1
  52. package/dist/client/assets/{Upload01-Co__isOw.js → Upload01-CppGjF6X.js} +1 -1
  53. package/dist/client/assets/{Users03-D2hf7hmK.js → Users03-CyGMH8pS.js} +1 -1
  54. package/dist/client/assets/{X-gSzwTkxQ.js → X-DhzUfCBr.js} +1 -1
  55. package/dist/client/assets/{XCircle-C6_3gAM6.js → XCircle-Bq0_f5be.js} +1 -1
  56. package/dist/client/assets/{XClose-MRwdozeO.js → XClose-kI_2EClC.js} +1 -1
  57. package/dist/client/assets/{agent-connections-preview-D6JhcHHQ.js → agent-connections-preview-HN-oaDES.js} +1 -1
  58. package/dist/client/assets/agent-detail-B74TC3B0.js +2 -0
  59. package/dist/client/assets/agents-BYGMiTiE.js +1 -0
  60. package/dist/client/assets/alert-dialog-YaiDdNnH.js +7 -0
  61. package/dist/client/assets/{auth-catchall-B4V1ZqhA.js → auth-catchall-CkvlF1AK.js} +1 -1
  62. package/dist/client/assets/{avatar-DvchIe54.js → avatar-DxO_71W5.js} +1 -1
  63. package/dist/client/assets/{badge-DU-tZMJX.js → badge-DriFi26e.js} +1 -1
  64. package/dist/client/assets/{binder-DYtUzpSy.js → binder-BGgM6Lg4.js} +1 -1
  65. package/dist/client/assets/{breadcrumb-Btg1z4US.js → breadcrumb-DrHiC5wf.js} +1 -1
  66. package/dist/client/assets/{button-SrN4bZ1L.js → button-TXPV9u45.js} +1 -1
  67. package/dist/client/assets/{card-qnGcUCM7.js → card-C58nCIMb.js} +1 -1
  68. package/dist/client/assets/{chart-Dv2iFlyz.js → chart-DNbePsMl.js} +5 -5
  69. package/dist/client/assets/{checkbox-CysU4JNH.js → checkbox-CtqaJz_f.js} +1 -1
  70. package/dist/client/assets/{circle-alert-BCTsSu2I.js → circle-alert-BU4T93kt.js} +1 -1
  71. package/dist/client/assets/collection-detail-RXSILc2C.js +26 -0
  72. package/dist/client/assets/collection-search-BKBrWx0L.js +1 -0
  73. package/dist/client/assets/collection-tab-Du_MsYkg.js +1 -0
  74. package/dist/client/assets/collection-table-wrapper-D4ORko-B.js +1 -0
  75. package/dist/client/assets/{collection-tabs-GSP6CAnl.js → collection-tabs-DwdXqSDI.js} +1 -1
  76. package/dist/client/assets/{command-Du6rS94S.js → command-CrETjPM6.js} +1 -1
  77. package/dist/client/assets/{connect-DOymnzkM.js → connect-Bftioi5k.js} +1 -1
  78. package/dist/client/assets/{connection-card-CMw5gBsW.js → connection-card-DJtPsQXC.js} +1 -1
  79. package/dist/client/assets/connection-detail-UgsAzzHi.js +1 -0
  80. package/dist/client/assets/connections-CIVV_4Z5.js +1 -0
  81. package/dist/client/assets/constants-CZUfxf6O.js +1 -0
  82. package/dist/client/assets/{constants-DisK0xae.js → constants-DEI8O4hQ.js} +1 -1
  83. package/dist/client/assets/{context-C_I7xFo7.js → context-C5W0brIi.js} +2 -2
  84. package/dist/client/assets/{create-organization-dialog-yQPBfpjD.js → create-organization-dialog-CjitkLS5.js} +1 -1
  85. package/dist/client/assets/{create-project-dialog-OPPYG5uC.js → create-project-dialog-Btom6Pv1.js} +1 -1
  86. package/dist/client/assets/{deco-constants-GtDdHPMJ.js → deco-constants-DBAyO8EZ.js} +1 -1
  87. package/dist/client/assets/{dialog-DH6FGz6L.js → dialog-wuqlToby.js} +1 -1
  88. package/dist/client/assets/{dropdown-menu-CvPfeATW.js → dropdown-menu-Ba6gkTmn.js} +1 -1
  89. package/dist/client/assets/{dynamic-plugin-layout-deQJwm8k.js → dynamic-plugin-layout-DHAky12t.js} +1 -1
  90. package/dist/client/assets/{empty-state-B_zGNEf7.js → empty-state-D8Gg0QJT.js} +1 -1
  91. package/dist/client/assets/{env-vars-editor-DpLZr7Mp.js → env-vars-editor-BiT3HGiU.js} +1 -1
  92. package/dist/client/assets/{error-boundary-CgOqOmL9.js → error-boundary-zygCkG0M.js} +1 -1
  93. package/dist/client/assets/{extract-connection-data-qY6ONXDc.js → extract-connection-data-CJpPKJk0.js} +1 -1
  94. package/dist/client/assets/{file-browser-iY7A5vK5.js → file-browser-BBzx58qW.js} +2 -2
  95. package/dist/client/assets/{form-DdSGRLg9.js → form-CdePd7Pv.js} +1 -1
  96. package/dist/client/assets/{grid-view-Nx0znnGe.js → grid-view-DflJZBdy.js} +1 -1
  97. package/dist/client/assets/{home-WDKWnX-6.js → home-Dbo5eVtn.js} +1 -1
  98. package/dist/client/assets/{index-BNESb5f9.js → index-B6YmkzTH.js} +1 -1
  99. package/dist/client/assets/index-B7FUMscm.css +1 -0
  100. package/dist/client/assets/{index-p3omciU2.js → index-BDPRLX-4.js} +37 -37
  101. package/dist/client/assets/{index-Cr3EE_Oz.js → index-BWyutPV5.js} +1 -1
  102. package/dist/client/assets/{index-BGG0J_lN.js → index-Bk-0u2bj.js} +72 -62
  103. package/dist/client/assets/{index-BmoMauUd.js → index-DMbcW5ts.js} +1 -1
  104. package/dist/client/assets/{index-C4EDt4lI.js → index-DaDJqKaJ.js} +1 -1
  105. package/dist/client/assets/{index-CqCSkLvQ.js → index-DyqsChsw.js} +1 -1
  106. package/dist/client/assets/index-YRFd6HJw.js +1 -0
  107. package/dist/client/assets/{index-BQJHl8k7.js → index-qq_KAj9h.js} +1 -1
  108. package/dist/client/assets/{infiniteQueryObserver-Bwh-NMGh.js → infiniteQueryObserver-C0Lkx8tQ.js} +1 -1
  109. package/dist/client/assets/{input-C19rUyj9.js → input-D_ph6wQi.js} +1 -1
  110. package/dist/client/assets/{integration-icon-CMj9-FPS.js → integration-icon-CWe3aQ6t.js} +1 -1
  111. package/dist/client/assets/{label-vYcgzZeb.js → label-C1HpB4GV.js} +1 -1
  112. package/dist/client/assets/{layout-B39Q-9q3.js → layout-Bd96cPIt.js} +1 -1
  113. package/dist/client/assets/{localstorage-keys-DIWr3Ek_.js → localstorage-keys-DPvmMmhc.js} +1 -1
  114. package/dist/client/assets/{login-CA6nx1du.js → login-BSCfq1-U.js} +1 -1
  115. package/dist/client/assets/{markdown-Dc-S7aGn.js → markdown-DRSGrJ01.js} +1 -1
  116. package/dist/client/assets/mcp-oauth-C2nS4eVY.js +1 -0
  117. package/dist/client/assets/{mcp-server-card-ByBnE-vj.js → mcp-server-card-xAMTxIFp.js} +1 -1
  118. package/dist/client/assets/mcp-server-detail-DWeC-d7q.js +2 -0
  119. package/dist/client/assets/members-D2sHhm7P.js +3 -0
  120. package/dist/client/assets/{monitoring-WM-Rk7qO.js → monitoring-DmDaA6pX.js} +2 -2
  121. package/dist/client/assets/{monitoring-dashboard-edit-Dp8NRuZd.js → monitoring-dashboard-edit-D-CjBdg5.js} +1 -1
  122. package/dist/client/assets/{monitoring-dashboard-view-wLbkoGo1.js → monitoring-dashboard-view-DLtVeEmh.js} +1 -1
  123. package/dist/client/assets/{oauth-callback-CaX2c7Wu.js → oauth-callback-Dxel0vXg.js} +1 -1
  124. package/dist/client/assets/page-BsvuXDx0.js +1 -0
  125. package/dist/client/assets/page-DafO9Vsq.js +1 -0
  126. package/dist/client/assets/{plugin-empty-state-CVngkfX3.js → plugin-empty-state-dfX9T95D.js} +1 -1
  127. package/dist/client/assets/{plugin-empty-state-D0_za-x_.js → plugin-empty-state-rzJ3vtCR.js} +1 -1
  128. package/dist/client/assets/{plugin-header-CqyTjT8y.js → plugin-header-CsWU692q.js} +1 -1
  129. package/dist/client/assets/{plugin-header-PVE46n-W.js → plugin-header-Wka6wy0Q.js} +1 -1
  130. package/dist/client/assets/{popover-Bz-dtYC4.js → popover-Dt4_z2id.js} +1 -1
  131. package/dist/client/assets/{project-layout-Cz0HYNyh.js → project-layout-DI1hNjLJ.js} +1 -1
  132. package/dist/client/assets/projects-list-DOU4Z6y2.js +1 -0
  133. package/dist/client/assets/{ranking-layout-CiiVJptK.js → ranking-layout-6RB09MfT.js} +1 -1
  134. package/dist/client/assets/{readme-viewer-C7GbD9G5.js → readme-viewer-BGtJvXCC.js} +1 -1
  135. package/dist/client/assets/{registry-layout-ChpSfSFu.js → registry-layout-CcqSqRDx.js} +1 -1
  136. package/dist/client/assets/{registry-utils-B61PMbF-.js → registry-utils-B0iZy2Nk.js} +1 -1
  137. package/dist/client/assets/{reports-layout-BvKe5aI3.js → reports-layout-B5LghGJo.js} +2 -2
  138. package/dist/client/assets/{reset-password-B7ISHNC0.js → reset-password-R4LjbQ2i.js} +1 -1
  139. package/dist/client/assets/{resizable-Cu9ocREr.js → resizable-h7fEF3zV.js} +1 -1
  140. package/dist/client/assets/{save-actions-CAz6Fzpg.js → save-actions-jSFDRjsZ.js} +1 -1
  141. package/dist/client/assets/{scroll-area-CVHsk4Pe.js → scroll-area-DIiM0juX.js} +4 -4
  142. package/dist/client/assets/{select-DFuMzqKt.js → select-DNtTB4Bo.js} +1 -1
  143. package/dist/client/assets/shell-layout-AyiHAnWo.js +3 -0
  144. package/dist/client/assets/{skeleton-DQTz2Cfy.js → skeleton-DNzAW1SF.js} +1 -1
  145. package/dist/client/assets/{spinner-DxDNcb59.js → spinner-DjxJ1r6s.js} +1 -1
  146. package/dist/client/assets/{store-invite-SskJUHyO.js → store-invite-Bh32JaEx.js} +1 -1
  147. package/dist/client/assets/switch-C4IhOA6e.js +1 -0
  148. package/dist/client/assets/{table-CQcuIfNu.js → table-CMEfP9H3.js} +1 -1
  149. package/dist/client/assets/tasks-Gduw0sMp.js +1 -0
  150. package/dist/client/assets/{textarea-BDWEwIDH.js → textarea-Db3p0Rx5.js} +1 -1
  151. package/dist/client/assets/{time-range-picker-kirfhhc9.js → time-range-picker-CT5RhAAM.js} +1 -1
  152. package/dist/client/assets/{toggle-group-BMIOl_5K.js → toggle-group-C7Kfwbwx.js} +1 -1
  153. package/dist/client/assets/tools-list-DGeXMyE8.js +1 -0
  154. package/dist/client/assets/{tooltip-BbsUVNzK.js → tooltip-D4BVYhMw.js} +1 -1
  155. package/dist/client/assets/{topbar-portal-BRE2WBz7.js → topbar-portal-BiKG3YrO.js} +1 -1
  156. package/dist/client/assets/types-BOpB4sEB.js +155 -0
  157. package/dist/client/assets/{typewriter-title-BILoCXrZ.js → typewriter-title-CFGwN_v6.js} +1 -1
  158. package/dist/client/assets/{use-binding-BdZ1UVgx.js → use-binding-aajuNegG.js} +1 -1
  159. package/dist/client/assets/{use-connection-DkSSfi9a.js → use-connection-DtRMRT7L.js} +1 -1
  160. package/dist/client/assets/{use-copy-BB2kbW8i.js → use-copy-BGqPeXhk.js} +1 -1
  161. package/dist/client/assets/{use-create-virtual-mcp-CHG7UVpA.js → use-create-virtual-mcp-BVu6cs2B.js} +1 -1
  162. package/dist/client/assets/use-deco-chat-open-BIVGrLhn.js +1 -0
  163. package/dist/client/assets/{use-install-from-registry-BqPjgCPd.js → use-install-from-registry-DJL5tOsu.js} +1 -1
  164. package/dist/client/assets/{use-list-state-DpzviSdT.js → use-list-state-BCruWJWf.js} +1 -1
  165. package/dist/client/assets/{use-llm-DTPk3_13.js → use-llm-Bv-6sCcC.js} +1 -1
  166. package/dist/client/assets/use-mcp-prompts-DpRM5L66.js +1 -0
  167. package/dist/client/assets/{use-mcp-tools-CGC3tcmA.js → use-mcp-tools-Bko1eKF9.js} +1 -1
  168. package/dist/client/assets/{use-mobile-CjVgJBva.js → use-mobile-D74rFejl.js} +1 -1
  169. package/dist/client/assets/{use-organization-settings-rYyRzSoT.js → use-organization-settings-D0kwnOS2.js} +1 -1
  170. package/dist/client/assets/{use-project-CnwCxI-j.js → use-project-C0JtBRdq.js} +1 -1
  171. package/dist/client/assets/{use-settings-modal-tv8Da55W.js → use-settings-modal-BI2pyMdc.js} +1 -1
  172. package/dist/client/assets/{use-view-mode-DDLmSRVK.js → use-view-mode-C0BRp2tQ.js} +1 -1
  173. package/dist/client/assets/{use-virtual-mcp-gsGIP_cY.js → use-virtual-mcp-DH4qIlbr.js} +1 -1
  174. package/dist/client/assets/useInfiniteQuery-BX2g8PmS.js +1 -0
  175. package/dist/client/assets/{useMutation-GHxEJTN4.js → useMutation-B2OXPKQT.js} +1 -1
  176. package/dist/client/assets/useQuery-Cf9H-zdg.js +1 -0
  177. package/dist/client/assets/useSuspenseInfiniteQuery-BvCS7sCC.js +1 -0
  178. package/dist/client/assets/workflow-Bh9fK-oW.js +1 -0
  179. package/dist/client/index.html +2 -2
  180. package/dist/server/cli.js +9 -9
  181. package/dist/server/migrate.js +6 -6
  182. package/dist/server/server.js +9 -9
  183. package/package.json +2 -1
  184. package/dist/client/assets/agent-detail-BpcgS_WA.js +0 -2
  185. package/dist/client/assets/agents-CiEGGxbH.js +0 -1
  186. package/dist/client/assets/alert-dialog-BwY-RhAj.js +0 -7
  187. package/dist/client/assets/collection-detail-BYSxk4oE.js +0 -26
  188. package/dist/client/assets/collection-search-B9NZ4RH6.js +0 -1
  189. package/dist/client/assets/collection-tab-BcJoa4qY.js +0 -1
  190. package/dist/client/assets/collection-table-wrapper-ByW-kXsd.js +0 -1
  191. package/dist/client/assets/connection-detail-dcoyE7_9.js +0 -1
  192. package/dist/client/assets/connections-C-xjHvMP.js +0 -1
  193. package/dist/client/assets/constants-XXbgLKEI.js +0 -1
  194. package/dist/client/assets/empty-state-DUeMScV0.js +0 -1
  195. package/dist/client/assets/index-CrsSJxhW.js +0 -1
  196. package/dist/client/assets/index-D1eaSCBW.css +0 -1
  197. package/dist/client/assets/mcp-oauth-C04X2g0h.js +0 -1
  198. package/dist/client/assets/mcp-server-detail-C68kfF_y.js +0 -2
  199. package/dist/client/assets/members-Yn81rJ_1.js +0 -3
  200. package/dist/client/assets/page-BvMChlEF.js +0 -1
  201. package/dist/client/assets/page-CXSHaeva.js +0 -1
  202. package/dist/client/assets/projects-list-BfIgV1F1.js +0 -1
  203. package/dist/client/assets/shell-layout-Wquvsd36.js +0 -3
  204. package/dist/client/assets/switch-D4ggk_Yk.js +0 -1
  205. package/dist/client/assets/tasks-CnBGBvBV.js +0 -1
  206. package/dist/client/assets/tools-list-Cn1p3mLu.js +0 -1
  207. package/dist/client/assets/use-deco-chat-open-BD3xJReE.js +0 -1
  208. package/dist/client/assets/use-mcp-prompts-CB93WJg8.js +0 -1
  209. package/dist/client/assets/useInfiniteQuery-DrLsISf0.js +0 -1
  210. package/dist/client/assets/useQuery-KFMXc5Td.js +0 -1
  211. package/dist/client/assets/useSuspenseInfiniteQuery-Cw1MYhE7.js +0 -1
  212. package/dist/client/assets/view-mode-toggle-BeStXEmg.js +0 -1
  213. package/dist/client/assets/workflow-DujY0Kfk.js +0 -1
@@ -0,0 +1 @@
1
+ import{c as X,j as t,b as Te,O as Ce,aE as ft,u as We,bX as nt,aj as St,p as wt,bV as qe,r as q,o as xt,bv as Tt,bD as kt,s as H,ak as ot,al as Pt,e as It,a as $t,m as At,k as Vt,l as Mt,i as Dt,t as we,K as rt}from"./index-BDPRLX-4.js";import{E as ne,C as Qe}from"./collection-search-BKBrWx0L.js";import{E as ht}from"./error-boundary-zygCkG0M.js";import{E as Ot,r as Rt,e as gt}from"./env-vars-editor-BiT3HGiU.js";import{g as Ge}from"./types-BOpB4sEB.js";import{P as Je}from"./index-DyqsChsw.js";import{S as Et}from"./save-actions-jSFDRjsZ.js";import{b as Lt,a as Ut}from"./use-binding-aajuNegG.js";import{u as Ft,S as Bt}from"./index-B6YmkzTH.js";import{f as Ye,g as jt}from"./use-connection-DtRMRT7L.js";import{u as bt}from"./constants-DEI8O4hQ.js";import{d as zt}from"./use-mcp-tools-Bko1eKF9.js";import{b as Xt,e as Kt}from"./use-mcp-prompts-DpRM5L66.js";import{a as Ht}from"./mcp-oauth-C2nS4eVY.js";import{b as it,c as Wt,d as qt,e as Qt,B as Gt,a as Jt}from"./breadcrumb-DrHiC5wf.js";import{B as Ke}from"./button-TXPV9u45.js";import{C as Yt}from"./collection-tabs-DwdXqSDI.js";import{i as Ue}from"./Loading01-BQNDOWoE.js";import{V as Ze,a as Zt}from"./layout-Bd96cPIt.js";import{C as es}from"./collection-tab-Du_MsYkg.js";import{I as Fe}from"./integration-icon-CWe3aQ6t.js";import{B as He}from"./badge-DriFi26e.js";import{D as ts,a as ss,b as ns,c as at}from"./dropdown-menu-Ba6gkTmn.js";import{F as J,a as os,b as Y,d as W,f as Z,c as se,e as rs}from"./form-CdePd7Pv.js";import{I as ee}from"./input-D_ph6wQi.js";import{S as ct,a as lt,b as dt,c as mt,d as G}from"./select-DNtTB4Bo.js";import{i as vt}from"./CheckCircle-s30iekcd.js";import{t as is}from"./ChevronDown-Bvtjl1_J.js";import{n as as}from"./Container-C5C-QC37.js";import{s as Le}from"./Globe02-DKs0xoZA.js";import{s as cs}from"./RefreshCcw01-Ce4Zz6-L.js";import{i as ls}from"./Terminal-DMjgMuI5.js";import{s as ds}from"./Trash01-DTKgec-l.js";import{t as et}from"./Users03-CyGMH8pS.js";import{s as ms}from"./XClose-kI_2EClC.js";import{U as us}from"./use-list-state-BCruWJWf.js";import{b as ps,a as fs}from"./use-virtual-mcp-DH4qIlbr.js";import{i as xs}from"./ChevronRight-BKg32aVF.js";import{s as hs}from"./Plus-WCxYwLGA.js";import{f as gs}from"./formatDistanceToNow-Cb2QZZJn.js";import{a as Nt,C as yt}from"./collection-table-wrapper-D4ORko-B.js";import{C as tt}from"./card-C58nCIMb.js";import{R as js}from"./readme-viewer-BGtJvXCC.js";import{T as bs,a as vs}from"./tools-list-DGeXMyE8.js";import{M as Ns}from"./index-Bk-0u2bj.js";import"./SearchMd-7zTlMjUG.js";import"./AlertTriangle-BauDdA9B.js";import"./tooltip-D4BVYhMw.js";import"./index-qq_KAj9h.js";import"./Pin01-T7uk7ccW.js";import"./use-organization-settings-D0kwnOS2.js";import"./useMutation-B2OXPKQT.js";import"./Save01-C6t04HUj.js";import"./binder-BGgM6Lg4.js";import"./File06-CkssxHwK.js";import"./Key01-CtmMXgET.js";import"./constants-CZUfxf6O.js";import"./registry-utils-B0iZy2Nk.js";import"./extract-connection-data-CJpPKJk0.js";import"./github-icon-Dp3wHhYE.js";import"./generate-id-Dyweu44Y.js";import"./use-install-from-registry-DJL5tOsu.js";import"./index-BWyutPV5.js";import"./circle-alert-BU4T93kt.js";import"./index-DMbcW5ts.js";import"./context-C5W0brIi.js";import"./decopilot-events-Brt4gAR6.js";import"./use-llm-Bv-6sCcC.js";import"./useQuery-Cf9H-zdg.js";import"./localstorage-keys-DPvmMmhc.js";import"./skeleton-DNzAW1SF.js";import"./popover-Dt4_z2id.js";import"./Grid01-BHkfA168.js";import"./Image01-BNys_Mns.js";import"./Settings01-DnNomfd3.js";import"./useSuspenseInfiniteQuery-BvCS7sCC.js";import"./infiniteQueryObserver-C0Lkx8tQ.js";import"./index-DaDJqKaJ.js";import"./use-mobile-D74rFejl.js";import"./X-DhzUfCBr.js";import"./Copy01-DzvhIVnU.js";import"./DotsVertical-JJuFY8qc.js";import"./Edit01-BWtM7ub2.js";import"./Eye-msaxJPjl.js";import"./empty-state-D8Gg0QJT.js";import"./Inbox01-NqZ6AxHy.js";import"./alert-dialog-YaiDdNnH.js";import"./Check-DM3yWukQ.js";import"./label-C1HpB4GV.js";import"./avatar-DxO_71W5.js";import"./use-view-mode-C0BRp2tQ.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./ArrowDown-OoKXTEnQ.js";import"./ArrowUp-C43RK3lv.js";import"./List-Cnm7l2wU.js";import"./table-CMEfP9H3.js";import"./RefreshCw01-Bg7WUwR3.js";import"./spinner-DjxJ1r6s.js";import"./dialog-wuqlToby.js";import"./usage-B8eRkRZY.js";import"./XCircle-Bq0_f5be.js";import"./AlertCircle-LGpS_W0y.js";import"./use-deco-chat-open-BIVGrLhn.js";import"./ArrowLeft-Dn8aVT34.js";import"./use-copy-BGqPeXhk.js";import"./Code01-B3OBXj9k.js";import"./use-create-virtual-mcp-BVu6cs2B.js";import"./deco-constants-DBAyO8EZ.js";import"./marked.esm-BaswSlok.js";import"./markdown-DRSGrJ01.js";import"./Clock-Db0q0BRR.js";function ys(s){const e=X.c(14),{virtualMcp:n,org:o}=s;let r;e[0]!==o||e[1]!==n.id?(r={org:o,project:Ce,agentId:n.id},e[0]=o,e[1]=n.id,e[2]=r):r=e[2];let a;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(et,{size:16}),e[3]=a):a=e[3];let c;e[4]!==n.icon||e[5]!==n.title?(c=t.jsx(Fe,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:a}),e[4]=n.icon,e[5]=n.title,e[6]=c):c=e[6];let p;e[7]!==n.title?(p=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[7]=n.title,e[8]=p):p=e[8];let x;e[9]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(xs,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[9]=x):x=e[9];let l;return e[10]!==r||e[11]!==c||e[12]!==p?(l=t.jsxs(ft,{to:"/$org/$project/agents/$agentId",params:r,className:"flex items-center gap-3 p-2 pr-1 rounded-lg hover:bg-muted/50 transition-colors group",children:[c,p,x]}),e[10]=r,e[11]=c,e[12]=p,e[13]=l):l=e[13],l}function ut(s){const e=X.c(20),{connectionId:n,connectionTitle:o,connectionDescription:r,connectionIcon:a,org:c,hasExistingVirtualMcps:p}=s,x=Te(),l=fs();let h;e[0]!==l.create||e[1]!==r||e[2]!==a||e[3]!==n||e[4]!==o||e[5]!==x||e[6]!==c?(h=async()=>{const m=await l.create.mutateAsync({title:`${o} Agent`,description:r??null,icon:a??null,status:"active",connections:[{connection_id:n,selected_tools:null,selected_resources:null,selected_prompts:null}]});x({to:"/$org/$project/agents/$agentId",params:{org:c,project:Ce,agentId:m.id}})},e[0]=l.create,e[1]=r,e[2]=a,e[3]=n,e[4]=o,e[5]=x,e[6]=c,e[7]=h):h=e[7];const d=h;if(p){let m;e[8]!==l.create.isPending?(m=l.create.isPending?t.jsx(Ue,{size:16,className:"animate-spin"}):t.jsx(hs,{size:16}),e[8]=l.create.isPending,e[9]=m):m=e[9];let u;return e[10]!==l.create.isPending||e[11]!==d||e[12]!==m?(u=t.jsx(Ke,{variant:"ghost",className:"size-6 p-0",onClick:d,disabled:l.create.isPending,children:m}),e[10]=l.create.isPending,e[11]=d,e[12]=m,e[13]=u):u=e[13],u}let i;e[14]!==l.create.isPending?(i=l.create.isPending?t.jsx(Ue,{className:"animate-spin text-muted-foreground"}):t.jsx(et,{className:"size-3 text-muted-foreground"}),e[14]=l.create.isPending,e[15]=i):i=e[15];let b;return e[16]!==l.create.isPending||e[17]!==d||e[18]!==i?(b=t.jsxs(Ke,{variant:"outline",size:"sm",onClick:d,disabled:l.create.isPending,children:[i,"Create an agent"]}),e[16]=l.create.isPending,e[17]=d,e[18]=i,e[19]=b):b=e[19],b}function _s(s){const e=X.c(26),{connectionId:n,connectionTitle:o,connectionDescription:r,connectionIcon:a,org:c}=s;let p;e[0]!==n?(p={filters:[{column:"connection_id",value:n}]},e[0]=n,e[1]=p):p=e[1];const x=ps(p);if(!(x.length>0)){let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("h4",{className:"text-xs text-muted-foreground font-medium",children:"Use in your IDE"}),e[2]=u):u=e[2];let g;return e[3]!==r||e[4]!==a||e[5]!==n||e[6]!==o||e[7]!==c?(g=t.jsxs("div",{className:"p-5 flex items-center justify-between gap-3",children:[u,t.jsx(ut,{connectionId:n,connectionTitle:o,connectionDescription:r,connectionIcon:a,org:c,hasExistingVirtualMcps:!1})]}),e[3]=r,e[4]=a,e[5]=n,e[6]=o,e[7]=c,e[8]=g):g=e[8],g}let h;e[9]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("h4",{className:"text-xs text-muted-foreground font-medium",children:"Agents"}),e[9]=h):h=e[9];let d;e[10]!==r||e[11]!==a||e[12]!==n||e[13]!==o||e[14]!==c?(d=t.jsx("div",{className:"flex flex-col gap-1",children:t.jsxs("div",{className:"flex items-center justify-between",children:[h,t.jsx(ut,{connectionId:n,connectionTitle:o,connectionDescription:r,connectionIcon:a,org:c,hasExistingVirtualMcps:!0})]})}),e[10]=r,e[11]=a,e[12]=n,e[13]=o,e[14]=c,e[15]=d):d=e[15];let i;if(e[16]!==c||e[17]!==x){let u;e[19]!==c?(u=g=>t.jsx(ys,{virtualMcp:g,org:c},g.id),e[19]=c,e[20]=u):u=e[20],i=x.map(u),e[16]=c,e[17]=x,e[18]=i}else i=e[18];let b;e[21]!==i?(b=t.jsx("div",{className:"flex flex-col gap-2",children:i}),e[21]=i,e[22]=b):b=e[22];let m;return e[23]!==d||e[24]!==b?(m=t.jsxs("div",{className:"p-5 flex flex-col gap-3",children:[d,b]}),e[23]=d,e[24]=b,e[25]=m):m=e[25],m}function Cs({form:s,connection:e,hasOAuthToken:n,onReauthenticate:o,onRemoveOAuth:r}){const a=nt({control:s.control,name:"ui_type"}),c=nt({control:s.control,name:"connection_url"}),{stdioEnabled:p}=St(),x=(()=>{if(typeof c!="string"||!c)return!1;try{const i=new URL(c);return i.hostname==="api.githubcopilot.com"&&i.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),l=p||e.connection_type==="STDIO",h=e.connection_type==="VIRTUAL",d=h?wt(e.connection_url):null;return h?t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Type"}),t.jsxs("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:[t.jsx(et,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:"Virtual MCP"})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"This connection references a Virtual MCP. Tools and resources are aggregated dynamically from the Virtual MCP's underlying connections."})]}),d&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Virtual MCP ID"}),t.jsx("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:t.jsx("code",{className:"text-sm text-muted-foreground",children:d})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[t.jsx(J,{control:s.control,name:"ui_type",render:({field:i})=>t.jsxs(Y,{className:"flex flex-col gap-3",children:[t.jsx(se,{className:"text-xs text-muted-foreground font-medium",children:"Connection"}),a!=="NPX"&&a!=="STDIO"?t.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[t.jsxs(ct,{value:i.value,onValueChange:i.onChange,children:[t.jsx(W,{children:t.jsxs(lt,{className:"h-10 w-auto min-w-[90px] border-0 rounded-none bg-muted/50 focus:ring-0 focus:ring-offset-0",children:[t.jsx(Le,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(dt,{})]})}),t.jsxs(mt,{children:[t.jsx(G,{value:"HTTP",children:"HTTP"}),t.jsx(G,{value:"SSE",children:"SSE"}),t.jsx(G,{value:"Websocket",children:"Websocket"}),l&&t.jsxs(t.Fragment,{children:[t.jsx(G,{value:"NPX",children:"NPX Package"}),t.jsx(G,{value:"STDIO",children:"Custom Command"})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(J,{control:s.control,name:"connection_url",render:({field:b})=>t.jsx(Y,{className:"flex-1 min-w-0",children:t.jsx(W,{children:t.jsx(ee,{placeholder:"https://example.com/mcp",...b,value:b.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(ct,{value:i.value,onValueChange:i.onChange,children:[t.jsx(W,{children:t.jsx(lt,{className:"h-10",children:t.jsx(dt,{})})}),t.jsxs(mt,{children:[t.jsx(G,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Le,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(G,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Le,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(G,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Le,{className:"w-4 h-4"}),"Websocket"]})}),l&&t.jsxs(t.Fragment,{children:[t.jsx(G,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(as,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(G,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ls,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(Z,{})]})}),a==="NPX"&&t.jsx(J,{control:s.control,name:"npx_package",render:({field:i})=>t.jsxs(Y,{className:"flex flex-col gap-3",children:[t.jsx(se,{className:"text-xs text-muted-foreground font-medium",children:"NPM Package"}),t.jsx(W,{children:t.jsx(ee,{placeholder:"@perplexity-ai/mcp-server",...i,value:i.value||"",className:"h-10 rounded-lg"})}),t.jsx(Z,{})]})}),a==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(J,{control:s.control,name:"stdio_command",render:({field:i})=>t.jsxs(Y,{className:"flex flex-col gap-3",children:[t.jsx(se,{className:"text-xs text-muted-foreground font-medium",children:"Command"}),t.jsx(W,{children:t.jsx(ee,{placeholder:"node, bun, python...",...i,value:i.value||"",className:"h-10 rounded-lg"})}),t.jsx(Z,{})]})}),t.jsx(J,{control:s.control,name:"stdio_args",render:({field:i})=>t.jsxs(Y,{className:"flex flex-col gap-3",children:[t.jsx(se,{className:"text-xs text-muted-foreground font-medium",children:"Arguments"}),t.jsx(W,{children:t.jsx(ee,{placeholder:"arg1 arg2 --flag value",...i,value:i.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Space-separated arguments"}),t.jsx(Z,{})]})})]}),t.jsx(J,{control:s.control,name:"stdio_cwd",render:({field:i})=>t.jsxs(Y,{className:"flex flex-col gap-3",children:[t.jsx(se,{className:"text-xs text-muted-foreground font-medium",children:"Working Directory"}),t.jsx(W,{children:t.jsx(ee,{placeholder:"/path/to/project (optional)",...i,value:i.value||"",className:"h-10 rounded-lg"})}),t.jsx(Z,{})]})})]}),(a==="NPX"||a==="STDIO")&&t.jsx(J,{control:s.control,name:"env_vars",render:({field:i})=>t.jsxs(Y,{className:"flex flex-col gap-3",children:[t.jsx(se,{className:"text-xs text-muted-foreground font-medium",children:"Environment Variables"}),t.jsx(W,{children:t.jsx(Ot,{value:i.value??[],onChange:i.onChange})}),t.jsx(Z,{})]})}),a!=="NPX"&&a!=="STDIO"&&t.jsx(J,{control:s.control,name:"connection_token",render:({field:i})=>t.jsxs(Y,{className:"flex flex-col gap-3",children:[t.jsx(se,{className:"text-xs text-muted-foreground font-medium",children:x?"GitHub Personal Access Token":"Token"}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(ts,{children:[t.jsx(ss,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(He,{variant:"success",className:"gap-1.5",children:[t.jsx(vt,{size:12}),"Authenticated via OAuth",t.jsx(is,{size:12})]})})}),t.jsxs(ns,{align:"start",children:[t.jsxs(at,{onClick:o,children:[t.jsx(cs,{size:16}),"Re-authenticate"]}),t.jsxs(at,{variant:"destructive",onClick:r,children:[t.jsx(ds,{size:16}),"Remove OAuth"]})]})]})}):e.connection_token&&i.value===null?t.jsxs("div",{className:"relative group",children:[t.jsx("div",{className:"h-10 px-3 flex items-center rounded-lg border border-border bg-muted/50 text-muted-foreground font-mono text-sm",children:"••••••••••••••••"}),t.jsx("button",{type:"button",onClick:()=>i.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 rounded hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity",title:"Clear and replace token",children:t.jsx(ms,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(W,{children:t.jsx(ee,{type:"password",placeholder:x?"Paste your GitHub PAT":"Enter access token...",...i,value:i.value||"",className:"h-10 rounded-lg"})}),x&&t.jsxs(rs,{children:["Create a PAT at"," ",t.jsx("a",{href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"github.com/settings/personal-access-tokens"})]})]}),t.jsx(Z,{})]})})]})}function Ss(s){const e=X.c(43),{form:n,connection:o,isMCPAuthenticated:r,hasOAuthToken:a,onReauthenticate:c,onRemoveOAuth:p}=s,{org:x}=We();let l;e[0]!==o.icon||e[1]!==o.title?(l=t.jsx(Fe,{icon:o.icon,name:o.title,size:"lg",className:"shadow-sm"}),e[0]=o.icon,e[1]=o.title,e[2]=l):l=e[2];let h;e[3]!==n.control?(h=t.jsxs("div",{className:"flex flex-col",children:[t.jsx(J,{control:n.control,name:"title",render:Ts}),t.jsx(J,{control:n.control,name:"description",render:ws})]}),e[3]=n.control,e[4]=h):h=e[4];let d;e[5]!==l||e[6]!==h?(d=t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[l,h]}),e[5]=l,e[6]=h,e[7]=d):d=e[7];let i;e[8]!==o||e[9]!==n||e[10]!==a||e[11]!==c||e[12]!==p?(i=t.jsx(Cs,{form:n,connection:o,hasOAuthToken:a,onReauthenticate:c,onRemoveOAuth:p}),e[8]=o,e[9]=n,e[10]=a,e[11]=c,e[12]=p,e[13]=i):i=e[13];let b;e[14]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Status"}),e[14]=b):b=e[14];let m;e[15]!==r?(m=t.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[b,r?t.jsxs(He,{variant:"success",className:"gap-1.5 bg-success-foreground text-success",children:[t.jsx(vt,{size:12}),"Connected"]}):t.jsx(He,{variant:"outline",className:"text-muted-foreground",children:"Not connected"})]}),e[15]=r,e[16]=m):m=e[16];let u;e[17]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Created by"}),e[17]=u):u=e[17];let g;e[18]!==o.created_by?(g=t.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[u,t.jsx(us,{id:o.created_by,size:"2xs"})]}),e[18]=o.created_by,e[19]=g):g=e[19];let w;e[20]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Updated"}),e[20]=w):w=e[20];let N;e[21]!==o.updated_at?(N=o.updated_at?gs(new Date(o.updated_at),{addSuffix:!0}):"Unknown",e[21]=o.updated_at,e[22]=N):N=e[22];let C;e[23]!==N?(C=t.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[w,t.jsx("span",{className:"text-sm text-foreground",children:N})]}),e[23]=N,e[24]=C):C=e[24];let y;e[25]!==C||e[26]!==m||e[27]!==g?(y=t.jsxs("div",{className:"flex flex-col gap-2 p-5 border-b border-border",children:[m,g,C]}),e[25]=C,e[26]=m,e[27]=g,e[28]=y):y=e[28];let _;e[29]!==o.description||e[30]!==o.icon||e[31]!==o.id||e[32]!==o.title||e[33]!==x.slug?(_=t.jsx(_s,{connectionId:o.id,connectionTitle:o.title,connectionDescription:o.description,connectionIcon:o.icon,org:x.slug}),e[29]=o.description,e[30]=o.icon,e[31]=o.id,e[32]=o.title,e[33]=x.slug,e[34]=_):_=e[34];let f;e[35]!==y||e[36]!==_||e[37]!==d||e[38]!==i?(f=t.jsxs("div",{className:"flex flex-col h-full overflow-auto",children:[d,i,y,_]}),e[35]=y,e[36]=_,e[37]=d,e[38]=i,e[39]=f):f=e[39];let j;return e[40]!==n||e[41]!==f?(j=t.jsx(os,{...n,children:f}),e[40]=n,e[41]=f,e[42]=j):j=e[42],j}function ws(s){const{field:e}=s;return t.jsxs(Y,{className:"w-full space-y-0",children:[t.jsx(W,{children:t.jsx(ee,{...e,value:e.value||"",className:"h-auto py-0.5 text-base text-muted-foreground leading-6 px-2 -mx-2 border-transparent hover:bg-input/25 focus:border-input bg-transparent transition-all",placeholder:"Add a description..."})}),t.jsx(Z,{})]})}function Ts(s){const{field:e}=s;return t.jsxs(Y,{className:"flex-1 space-y-0",children:[t.jsx(W,{children:t.jsx(ee,{...e,className:"h-auto py-0.5 text-lg! font-medium leading-7 px-2 -mx-2 border-transparent hover:bg-input/25 focus:border-input bg-transparent transition-all",placeholder:"Connection Name"})}),t.jsx(Z,{})]})}function ks(s){const e=X.c(42),{prompts:n,connectionId:o,org:r,connectionTitle:a,connectionIcon:c,onPromptClick:p,showToolbar:x,emptyMessage:l}=s,h=x===void 0?!0:x,d=l===void 0?"This connection doesn't have any prompts yet.":l,i=Te(),m=qe().location.href,[u,g]=q.useState(""),[w,N]=q.useState("table"),[C,y]=q.useState("name"),[_,f]=q.useState("asc");let j;e[0]!==_||e[1]!==C?(j=T=>{C===T?(f(Vs),_==="desc"&&y(void 0)):(y(T),f("asc"))},e[0]=_,e[1]=C,e[2]=j):j=e[2];const E=j;let $;e[3]!==o||e[4]!==i||e[5]!==p||e[6]!==r?($=T=>{p?p(T):o&&r&&i({to:"/$org/$project/mcps/$connectionId/$collectionName/$itemId",params:{org:r,project:Ce,connectionId:o,collectionName:"prompts",itemId:encodeURIComponent(T.name)}})},e[3]=o,e[4]=i,e[5]=p,e[6]=r,e[7]=$):$=e[7];const D=$;let A;if(e[8]!==n||e[9]!==u||e[10]!==_||e[11]!==C){const T=!n||n.length===0?[]:u.trim()?(()=>{const Q=u.toLowerCase();return n.filter(K=>K.name.toLowerCase().includes(Q)||K.description&&K.description.toLowerCase().includes(Q))})():n;A=!C||!_?T:[...T].sort((Q,K)=>{const oe=Q[C]||"",re=K[C]||"",te=String(oe).localeCompare(String(re));return _==="asc"?te:-te}),e[8]=n,e[9]=u,e[10]=_,e[11]=C,e[12]=A}else A=e[12];const I=A;let L;e[13]===Symbol.for("react.memo_cache_sentinel")?(L=[{id:"name",header:"Name",render:As,sortable:!0},{id:"description",header:"Description",render:$s,cellClassName:"flex-1",sortable:!0}],e[13]=L):L=e[13];const U=L;let S;e[14]===Symbol.for("react.memo_cache_sentinel")?(S=U.filter(Is).map(Ps),e[14]=S):S=e[14];const z=S;let P;e[15]!==c||e[16]!==a||e[17]!==E||e[18]!==h||e[19]!==_||e[20]!==C||e[21]!==m||e[22]!==w?(P=h&&t.jsxs(Ze,{children:[t.jsx(yt,{viewMode:w,onViewModeChange:N,sortKey:C,sortDirection:_,onSort:E,sortOptions:z}),t.jsx(Je,{title:a?`${a}: Prompts`:"Prompts",url:m,icon:c??"description"})]}),e[15]=c,e[16]=a,e[17]=E,e[18]=h,e[19]=_,e[20]=C,e[21]=m,e[22]=w,e[23]=P):P=e[23];let O;e[24]===Symbol.for("react.memo_cache_sentinel")?(O=T=>{T.key==="Escape"&&(g(""),T.target.blur())},e[24]=O):O=e[24];let V;e[25]!==u?(V=t.jsx(Qe,{value:u,onChange:g,placeholder:"Search prompts...",onKeyDown:O}),e[25]=u,e[26]=V):V=e[26];let v;e[27]!==d||e[28]!==D||e[29]!==E||e[30]!==u||e[31]!==_||e[32]!==C||e[33]!==I||e[34]!==w?(v=w==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:I.length===0?t.jsx(ne,{image:null,title:u?"No prompts found":"No prompts available",description:u?"Try adjusting your search terms":d}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:I.map(T=>t.jsx(tt,{className:"cursor-pointer transition-colors",onClick:()=>D(T),children:t.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[t.jsx(Fe,{icon:null,name:T.name,size:"md",className:"shrink-0 shadow-sm"}),t.jsxs("div",{className:"flex flex-col gap-0",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:T.name}),t.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:T.description||"No description"})]})]})},T.name))})}):t.jsx(Nt,{columns:U,data:I,isLoading:!1,sortKey:C,sortDirection:_,onSort:E,onRowClick:T=>D(T),emptyState:t.jsx(ne,{image:null,title:u?"No prompts found":"No prompts available",description:u?"Try adjusting your search terms":d})}),e[27]=d,e[28]=D,e[29]=E,e[30]=u,e[31]=_,e[32]=C,e[33]=I,e[34]=w,e[35]=v):v=e[35];let B;e[36]!==V||e[37]!==v?(B=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[V,v]}),e[36]=V,e[37]=v,e[38]=B):B=e[38];let R;return e[39]!==B||e[40]!==P?(R=t.jsxs(t.Fragment,{children:[P,B]}),e[39]=B,e[40]=P,e[41]=R):R=e[41],R}function Ps(s){return{id:s.id,label:typeof s.header=="string"?s.header:s.id}}function Is(s){return s.sortable}function $s(s){return t.jsx("span",{className:"text-sm text-foreground",children:s.description||"—"})}function As(s){return t.jsx("span",{className:"text-sm font-medium font-mono text-foreground",children:s.name})}function Vs(s){return s==="asc"?"desc":s==="desc"?null:"asc"}function Ms(s){const e=X.c(6),{prompts:n,connectionId:o,org:r}=s,a=Ye(o),c=a?.title,p=a?.icon;let x;return e[0]!==o||e[1]!==r||e[2]!==n||e[3]!==c||e[4]!==p?(x=t.jsx(ks,{prompts:n,connectionId:o,org:r,connectionTitle:c,connectionIcon:p}),e[0]=o,e[1]=r,e[2]=n,e[3]=c,e[4]=p,e[5]=x):x=e[5],x}function Ds(s){const e=X.c(2),{repository:n}=s;let o;return e[0]!==n?(o=t.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:t.jsx(js,{repository:n})}),e[0]=n,e[1]=o):o=e[1],o}function Os(s){const e=X.c(39),{resources:n,connectionTitle:o,connectionIcon:r,onResourceClick:a,showToolbar:c,emptyMessage:p}=s,x=c===void 0?!0:c,l=p===void 0?"This connection doesn't have any resources yet.":p,d=qe().location.href,[i,b]=q.useState(""),[m,u]=q.useState("table"),[g,w]=q.useState("name"),[N,C]=q.useState("asc");let y;e[0]!==N||e[1]!==g?(y=v=>{g===v?(C(zs),N==="desc"&&w(void 0)):(w(v),C("asc"))},e[0]=N,e[1]=g,e[2]=y):y=e[2];const _=y;let f;e[3]!==a?(f=v=>{a&&a(v)},e[3]=a,e[4]=f):f=e[4];const j=f;let E;if(e[5]!==n||e[6]!==i||e[7]!==N||e[8]!==g){const v=!n||n.length===0?[]:i.trim()?(()=>{const B=i.toLowerCase();return n.filter(R=>R.uri.toLowerCase().includes(B)||R.name&&R.name.toLowerCase().includes(B)||R.description&&R.description.toLowerCase().includes(B))})():n;E=!g||!N?v:[...v].sort((B,R)=>{const T=B[g]||"",Q=R[g]||"",K=String(T).localeCompare(String(Q));return N==="asc"?K:-K}),e[5]=n,e[6]=i,e[7]=N,e[8]=g,e[9]=E}else E=e[9];const $=E;let D;e[10]===Symbol.for("react.memo_cache_sentinel")?(D=[{id:"name",header:"Name",render:Bs,sortable:!0},{id:"uri",header:"URI",render:Fs,sortable:!0},{id:"description",header:"Description",render:Us,cellClassName:"flex-1",sortable:!0},{id:"mimeType",header:"Type",render:Ls,sortable:!0}],e[10]=D):D=e[10];const A=D;let I;e[11]===Symbol.for("react.memo_cache_sentinel")?(I=A.filter(Es).map(Rs),e[11]=I):I=e[11];const L=I;let U;e[12]!==r||e[13]!==o||e[14]!==_||e[15]!==x||e[16]!==N||e[17]!==g||e[18]!==d||e[19]!==m?(U=x&&t.jsxs(Ze,{children:[t.jsx(yt,{viewMode:m,onViewModeChange:u,sortKey:g,sortDirection:N,onSort:_,sortOptions:L}),t.jsx(Je,{title:o?`${o}: Resources`:"Resources",url:d,icon:r??"folder"})]}),e[12]=r,e[13]=o,e[14]=_,e[15]=x,e[16]=N,e[17]=g,e[18]=d,e[19]=m,e[20]=U):U=e[20];let S;e[21]===Symbol.for("react.memo_cache_sentinel")?(S=v=>{v.key==="Escape"&&(b(""),v.target.blur())},e[21]=S):S=e[21];let z;e[22]!==i?(z=t.jsx(Qe,{value:i,onChange:b,placeholder:"Search resources...",onKeyDown:S}),e[22]=i,e[23]=z):z=e[23];let P;e[24]!==l||e[25]!==j||e[26]!==_||e[27]!==i||e[28]!==N||e[29]!==g||e[30]!==$||e[31]!==m?(P=m==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:$.length===0?t.jsx(ne,{image:null,title:i?"No resources found":"No resources available",description:i?"Try adjusting your search terms":l}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:$.map(v=>t.jsx(tt,{className:"cursor-pointer transition-colors",onClick:()=>j(v),children:t.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[t.jsx(Fe,{icon:null,name:v.name||v.uri,size:"md",className:"shrink-0 shadow-sm"}),t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:v.name||v.uri}),t.jsx("p",{className:"text-xs font-mono text-muted-foreground truncate",children:v.uri}),v.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mt-1",children:v.description})]})]})},v.uri))})}):t.jsx(Nt,{columns:A,data:$,isLoading:!1,sortKey:g,sortDirection:N,onSort:_,onRowClick:v=>j(v),emptyState:t.jsx(ne,{image:null,title:i?"No resources found":"No resources available",description:i?"Try adjusting your search terms":l})}),e[24]=l,e[25]=j,e[26]=_,e[27]=i,e[28]=N,e[29]=g,e[30]=$,e[31]=m,e[32]=P):P=e[32];let O;e[33]!==z||e[34]!==P?(O=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[z,P]}),e[33]=z,e[34]=P,e[35]=O):O=e[35];let V;return e[36]!==O||e[37]!==U?(V=t.jsxs(t.Fragment,{children:[U,O]}),e[36]=O,e[37]=U,e[38]=V):V=e[38],V}function Rs(s){return{id:s.id,label:typeof s.header=="string"?s.header:s.id}}function Es(s){return s.sortable}function Ls(s){return t.jsx("span",{className:"text-sm text-muted-foreground",children:s.mimeType||"—"})}function Us(s){return t.jsx("span",{className:"text-sm text-foreground",children:s.description||"—"})}function Fs(s){return t.jsx("span",{className:"text-sm font-mono text-muted-foreground",children:s.uri})}function Bs(s){return t.jsx("span",{className:"text-sm font-medium text-foreground",children:s.name||s.uri})}function zs(s){return s==="asc"?"desc":s==="desc"?null:"asc"}function Xs(s){const e=X.c(6),{resources:n,connectionId:o,org:r}=s,a=Ye(o),c=a?.title,p=a?.icon;let x;return e[0]!==o||e[1]!==r||e[2]!==n||e[3]!==c||e[4]!==p?(x=t.jsx(Os,{resources:n,connectionId:o,org:r,connectionTitle:c,connectionIcon:p}),e[0]=o,e[1]=r,e[2]=n,e[3]=c,e[4]=p,e[5]=x):x=e[5],x}const Ks=xt({key:H().min(1,"Key is required"),value:H()}),Hs=xt({title:H().min(1,"Name is required"),description:H().nullable().optional(),ui_type:Pt(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:H().optional(),connection_token:H().nullable().optional(),npx_package:H().optional(),stdio_command:H().optional(),stdio_args:H().optional(),stdio_cwd:H().optional(),env_vars:ot(Ks).optional(),configuration_scopes:ot(H()).nullable().optional(),configuration_state:Tt(H(),kt()).nullable().optional()}).refine(s=>s.ui_type==="NPX"?!!s.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(s=>s.ui_type==="STDIO"?!!s.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(s=>s.ui_type==="HTTP"||s.ui_type==="SSE"||s.ui_type==="Websocket"?!!s.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function Ws(s){const e=X.c(5),{tools:n,connectionId:o,org:r,isLoading:a}=s;let c;return e[0]!==o||e[1]!==a||e[2]!==r||e[3]!==n?(c=t.jsx(bs,{tools:n,connectionId:o,org:r,isLoading:a}),e[0]=o,e[1]=a,e[2]=r,e[3]=n,e[4]=c):c=e[4],c}function qs(s){const e=X.c(27),{tools:n,connectionId:o,org:r}=s,a=Te(),{org:c}=We();let p;e[0]!==o||e[1]!==c.id?(p={connectionId:o,orgId:c.id},e[0]=o,e[1]=c.id,e[2]=p):p=e[2];const x=bt(p),[l,h]=q.useState("");let d,i,b,m;if(e[3]!==x||e[4]!==o||e[5]!==a||e[6]!==r||e[7]!==l||e[8]!==n){const w=(n??[]).filter(Qs),N=l.toLowerCase().trim(),C=N?w.filter(j=>j.name.toLowerCase().includes(N)||j.description&&j.description.toLowerCase().includes(N)):w;let y;e[13]!==o||e[14]!==a||e[15]!==r?(y=j=>{a({to:"/$org/$project/mcps/$connectionId/$collectionName/$itemId",params:{org:r,project:Ce,connectionId:o,collectionName:"tools",itemId:encodeURIComponent(j.name)}})},e[13]=o,e[14]=a,e[15]=r,e[16]=y):y=e[16];const _=y;b="flex flex-col h-full overflow-hidden";let f;e[17]===Symbol.for("react.memo_cache_sentinel")?(f=j=>{j.key==="Escape"&&(h(""),j.target.blur())},e[17]=f):f=e[17],e[18]!==l?(m=t.jsx(Qe,{value:l,onChange:h,placeholder:"Search apps...",onKeyDown:f}),e[18]=l,e[19]=m):m=e[19],d="flex-1 overflow-auto p-5",i=C.length===0?t.jsx(ne,{image:null,title:l?"No apps found":"No apps available",description:l?"Try adjusting your search terms":"This connection doesn't have any tools with interactive UIs yet."}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:C.map(j=>{const E=Ge(j._meta);return t.jsxs(tt,{className:"cursor-pointer transition-colors overflow-hidden",onClick:()=>_(j),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(Ns,{resourceURI:E,toolName:j.name,displayMode:"inline",minHeight:200,maxHeight:200,client:x})}),t.jsxs("div",{className:"flex flex-col gap-2 p-4",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:j.name}),t.jsx(vs,{annotations:j.annotations,_meta:j._meta})]}),j.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:j.description})]})]},j.name)})}),e[3]=x,e[4]=o,e[5]=a,e[6]=r,e[7]=l,e[8]=n,e[9]=d,e[10]=i,e[11]=b,e[12]=m}else d=e[9],i=e[10],b=e[11],m=e[12];let u;e[20]!==d||e[21]!==i?(u=t.jsx("div",{className:d,children:i}),e[20]=d,e[21]=i,e[22]=u):u=e[22];let g;return e[23]!==b||e[24]!==m||e[25]!==u?(g=t.jsxs("div",{className:b,children:[m,u]}),e[23]=b,e[24]=m,e[25]=u,e[26]=g):g=e[26],g}function Qs(s){return!!Ge(s._meta)}function Gs(s){return s.command==="npx"}function Js(s){return s.args?.find(e=>!e.startsWith("-"))??""}function Ys(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function Zs(s,e){const n={command:"npx",args:["-y",s]},o=gt(e);return Object.keys(o).length>0&&(n.envVars=o),n}function en(s,e,n,o){const r={command:s};e.trim()&&(r.args=e.trim().split(/\s+/)),n?.trim()&&(r.cwd=n.trim());const a=gt(o);return Object.keys(a).length>0&&(r.envVars=a),r}function pt(s,e){const n={title:s.title,description:s.description??"",configuration_state:s.configuration_state??{},configuration_scopes:s.configuration_scopes||[]};if(s.connection_type==="STDIO"&&Dt(s.connection_headers)){const o=s.connection_headers,r=Rt(o.envVars);if(Gs(o)){const c=Js(o);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:c,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:r}}const a=Ys(o);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:a.command,stdio_args:a.args,stdio_cwd:a.cwd,env_vars:r}}return{...n,ui_type:s.connection_type,connection_url:s.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}function tn(s){let e,n=null,o=null,r=null;return s.ui_type==="NPX"?(e="STDIO",n="",r=Zs(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",r=en(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",o=s.connection_token||null),{title:s.title,description:s.description||null,connection_type:e,connection_url:n,...o&&{connection_token:o},...r&&{connection_headers:r},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function sn(s){const e=X.c(123),{connection:n,connectionId:o,org:r,requestedTabId:a,collections:c,onUpdate:p,isUpdating:x,prompts:l,resources:h,tools:d,isLoadingTools:i}=s;let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b={from:"/$org/$project/mcps/$connectionId"},e[0]=b):b=e[0];const m=Te(b),u=At(),w=qe().location.href,N=jt();let C;e[1]!==o?(C={connectionId:o},e[1]=o,e[2]=C):C=e[2];const y=Ft(C),f=n?.connection_type==="VIRTUAL"||y.isAuthenticated;let j;e[3]!==n?(j={connections:[n],binding:"MCP"},e[3]=n,e[4]=j):j=e[4];const $=Ut(j).length>0,D=n?.metadata?.repository,A=!!D?.url;let I;e[5]===Symbol.for("react.memo_cache_sentinel")?(I=Vt(Hs),e[5]=I):I=e[5];let L;e[6]!==n?(L=pt(n),e[6]=n,e[7]=L):L=e[7];let U;e[8]!==L?(U={resolver:I,values:L},e[8]=L,e[9]=U):U=e[9];const S=Mt(U),z=S.formState.isDirty;let P;e[10]!==S||e[11]!==p?(P=async()=>{if(!await S.trigger())return;const F=S.getValues(),_e=tn(F);await p(_e),S.reset(F)},e[10]=S,e[11]=p,e[12]=P):P=e[12];const O=P;let V;e[13]!==n||e[14]!==S?(V=()=>{S.reset(pt(n))},e[13]=n,e[14]=S,e[15]=V):V=e[15];const v=V;let B;e[16]!==n.id||e[17]!==N||e[18]!==u?(B=async()=>{const{token:k,tokenInfo:F,error:_e}=await Ht({connectionId:n.id});if(_e||!k){we.error(`Authentication failed: ${_e}`);return}if(F)try{const Ee=await fetch(`/api/connections/${n.id}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:F.accessToken,refreshToken:F.refreshToken,expiresIn:F.expiresIn,scope:F.scope,clientId:F.clientId,clientSecret:F.clientSecret,tokenEndpoint:F.tokenEndpoint})});if(!Ee.ok)console.error("Failed to save OAuth token:",await Ee.text()),await N.update.mutateAsync({id:n.id,data:{connection_token:k}});else try{await N.update.mutateAsync({id:n.id,data:{}})}catch(st){console.warn("Failed to refresh connection tools after OAuth:",st)}}catch(Ee){console.error("Error saving OAuth token:",Ee),await N.update.mutateAsync({id:n.id,data:{connection_token:k}})}else await N.update.mutateAsync({id:n.id,data:{connection_token:k}});const Ct=new URL(`/mcp/${n.id}`,window.location.origin);await u.invalidateQueries({queryKey:rt.isMCPAuthenticated(Ct.href,null)}),we.success("Authentication successful")},e[16]=n.id,e[17]=N,e[18]=u,e[19]=B):B=e[19];const R=B;let T;e[20]!==n.id||e[21]!==u?(T=async()=>{try{const k=await fetch(`/api/connections/${n.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!k.ok){const _e=await k.text();we.error(`Failed to remove OAuth: ${_e}`);return}const F=new URL(`/mcp/${n.id}`,window.location.origin);await u.invalidateQueries({queryKey:rt.isMCPAuthenticated(F.href,null)}),we.success("OAuth removed. You can now re-authenticate with a different account.")}catch(k){console.error("Error removing OAuth token:",k),we.error("Failed to remove OAuth")}},e[20]=n.id,e[21]=u,e[22]=T):T=e[22];const Q=T,K=d.length,oe=l.length,re=h.length;let te;e[23]!==d?(te=d.filter(rn),e[23]=d,e[24]=te):te=e[24];const ke=te.length,Be=K>0||i;let Pe;e[25]===Symbol.for("react.memo_cache_sentinel")?(Pe={id:"settings",label:"Settings"},e[25]=Pe):Pe=e[25];let ie;e[26]!==i||e[27]!==f||e[28]!==Be||e[29]!==K?(ie=f&&Be?[{id:"tools",label:"Tools",count:i?void 0:K}]:[],e[26]=i,e[27]=f,e[28]=Be,e[29]=K,e[30]=ie):ie=e[30];let ae;e[31]!==f||e[32]!==oe?(ae=f&&oe>0?[{id:"prompts",label:"Prompts",count:oe}]:[],e[31]=f,e[32]=oe,e[33]=ae):ae=e[33];let ce;e[34]!==f||e[35]!==re?(ce=f&&re>0?[{id:"resources",label:"Resources",count:re}]:[],e[34]=f,e[35]=re,e[36]=ce):ce=e[36];let le;e[37]!==f||e[38]!==ke?(le=f&&ke>0?[{id:"ui",label:"UI",count:ke}]:[],e[37]=f,e[38]=ke,e[39]=le):le=e[39];let Ie;if(e[40]!==c||e[41]!==A||e[42]!==f||e[43]!==ie||e[44]!==ae||e[45]!==ce||e[46]!==le){let k;e[48]!==A?(k=A?[{id:"readme",label:"README"}]:[],e[48]=A,e[49]=k):k=e[49],Ie=[Pe,...ie,...ae,...ce,...le,...f?(c||[]).map(on):[],...k],e[40]=c,e[41]=A,e[42]=f,e[43]=ie,e[44]=ae,e[45]=ce,e[46]=le,e[47]=Ie}else Ie=e[47];const Se=Ie,_t=f&&Se.some(nn)?"tools":"settings",M=Se.some(k=>k.id===a)?a:_t;let $e;e[50]!==m?($e=k=>{m({search:F=>({...F,tab:k}),replace:!0})},e[50]=m,e[51]=$e):$e=e[51];const de=$e;let me;e[52]!==c?(me=c||[],e[52]=c,e[53]=me):me=e[53];let Ae;if(e[54]!==M||e[55]!==me){let k;e[57]!==M?(k=F=>F.name===M,e[57]=M,e[58]=k):k=e[58],Ae=me.find(k),e[54]=M,e[55]=me,e[56]=Ae}else Ae=e[56];const Ve=Ae;let ue;e[59]!==r?(ue=t.jsx(it,{children:t.jsx(qt,{asChild:!0,children:t.jsx(ft,{to:"/$org/$project/mcps",params:{org:r,project:Ce},children:"Connections"})})}),e[59]=r,e[60]=ue):ue=e[60];let Me;e[61]===Symbol.for("react.memo_cache_sentinel")?(Me=t.jsx(Qt,{}),e[61]=Me):Me=e[61];let pe;e[62]!==n.title?(pe=t.jsx(it,{children:t.jsx(Wt,{children:n.title})}),e[62]=n.title,e[63]=pe):pe=e[63];let De;e[64]!==ue||e[65]!==pe?(De=t.jsx(Gt,{children:t.jsxs(Jt,{children:[ue,Me,pe]})}),e[64]=ue,e[65]=pe,e[66]=De):De=e[66];const ze=De;let fe;e[67]!==O||e[68]!==v||e[69]!==z||e[70]!==x?(fe=t.jsx(Et,{onSave:O,onUndo:v,isDirty:z,isSaving:x}),e[67]=O,e[68]=v,e[69]=z,e[70]=x,e[71]=fe):fe=e[71];const Xe=n.icon??"settings";let xe;e[72]!==n.title||e[73]!==Xe||e[74]!==w?(xe=t.jsx(Je,{title:n.title,url:w,icon:Xe}),e[72]=n.title,e[73]=Xe,e[74]=w,e[75]=xe):xe=e[75];let he;e[76]!==fe||e[77]!==xe?(he=t.jsxs(Ze,{children:[fe,xe]}),e[76]=fe,e[77]=xe,e[78]=he):he=e[78];let ge;e[79]!==y.hasOAuthToken||e[80]!==n||e[81]!==S||e[82]!==R||e[83]!==Q||e[84]!==f?(ge=t.jsx("div",{className:"w-100 shrink-0 border-r border-border bg-background",children:t.jsx(Ss,{form:S,connection:n,isMCPAuthenticated:f,hasOAuthToken:y.hasOAuthToken,onReauthenticate:R,onRemoveOAuth:Q})}),e[79]=y.hasOAuthToken,e[80]=n,e[81]=S,e[82]=R,e[83]=Q,e[84]=f,e[85]=ge):ge=e[85];let je;e[86]!==M||e[87]!==de||e[88]!==Se?(je=t.jsx("div",{className:"shrink-0 flex items-center gap-4 px-5 py-3 border-b border-border",children:t.jsx(Yt,{tabs:Se,activeTab:M,onTabChange:de,className:"flex-1"})}),e[86]=M,e[87]=de,e[88]=Se,e[89]=je):je=e[89];let Oe;e[90]===Symbol.for("react.memo_cache_sentinel")?(Oe=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Ue,{size:32,className:"animate-spin text-muted-foreground"})}),e[90]=Oe):Oe=e[90];let be;e[91]!==Ve||e[92]!==M||e[93]!==y.isServerError||e[94]!==y.supportsOAuth||e[95]!==n||e[96]!==o||e[97]!==S||e[98]!==R||e[99]!==de||e[100]!==$||e[101]!==A||e[102]!==i||e[103]!==f||e[104]!==r||e[105]!==l||e[106]!==D||e[107]!==h||e[108]!==d?(be=t.jsx(q.Suspense,{fallback:Oe,children:M==="tools"?t.jsx(Ws,{tools:d,connectionId:o,org:r,isLoading:i}):M==="ui"?t.jsx(qs,{tools:d,connectionId:o,org:r}):M==="prompts"?t.jsx(Ms,{prompts:l,connectionId:o,org:r}):M==="resources"?t.jsx(Xs,{resources:h,connectionId:o,org:r}):M==="settings"?t.jsx(Bt,{connection:n,form:S,hasMcpBinding:$,isMCPAuthenticated:f,supportsOAuth:y.supportsOAuth,isServerError:y.isServerError,onAuthenticate:R,onViewReadme:A?()=>de("readme"):void 0}):M==="readme"&&A?t.jsx(Ds,{repository:D}):Ve&&f?t.jsx(es,{connectionId:o,org:r,activeCollection:Ve},M):t.jsx(ne,{title:"Collection not found",description:"This collection may have been deleted or you may not have access."})}),e[91]=Ve,e[92]=M,e[93]=y.isServerError,e[94]=y.supportsOAuth,e[95]=n,e[96]=o,e[97]=S,e[98]=R,e[99]=de,e[100]=$,e[101]=A,e[102]=i,e[103]=f,e[104]=r,e[105]=l,e[106]=D,e[107]=h,e[108]=d,e[109]=be):be=e[109];let ve;e[110]!==M||e[111]!==be?(ve=t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsx(ht,{children:be},M)}),e[110]=M,e[111]=be,e[112]=ve):ve=e[112];let Ne;e[113]!==je||e[114]!==ve?(Ne=t.jsxs("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-hidden",children:[je,ve]}),e[113]=je,e[114]=ve,e[115]=Ne):Ne=e[115];let ye;e[116]!==ge||e[117]!==Ne?(ye=t.jsxs("div",{className:"flex h-full w-full bg-background overflow-hidden",children:[ge,Ne]}),e[116]=ge,e[117]=Ne,e[118]=ye):ye=e[118];let Re;return e[119]!==ze||e[120]!==he||e[121]!==ye?(Re=t.jsxs(Zt,{breadcrumb:ze,children:[he,ye]}),e[119]=ze,e[120]=he,e[121]=ye,e[122]=Re):Re=e[122],Re}function nn(s){return s.id==="tools"}function on(s){return{id:s.name,label:s.displayName}}function rn(s){return!!Ge(s._meta)}function an(){const s=X.c(43);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/$project/mcps/$connectionId"},s[0]=e):e=s[0];const n=Te(e);let o;s[1]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/$project/mcps/$connectionId"},s[1]=o):o=s[1];const{connectionId:r,org:a}=It(o),{org:c}=We();let p;s[2]===Symbol.for("react.memo_cache_sentinel")?(p={from:"/shell/$org/$project/mcps/$connectionId"},s[2]=p):p=s[2];const l=$t(p).tab??"",h=Ye(r),d=jt(),i=Lt(h??void 0);let b;s[3]!==r||s[4]!==c.id?(b={connectionId:r,orgId:c.id},s[3]=r,s[4]=c.id,s[5]=b):b=s[5];const m=bt(b);let u;s[6]!==m?(u={client:m},s[6]=m,s[7]=u):u=s[7];const{data:g}=Xt(u);let w;s[8]!==m?(w={client:m},s[8]=m,s[9]=w):w=s[9];const{data:N}=Kt(w),y=!(h?.connection_type==="VIRTUAL")&&h?.tools&&h.tools.length>0,_=!y;let f;s[10]!==m||s[11]!==_?(f={client:m,enabled:_},s[10]=m,s[11]=_,s[12]=f):f=s[12];const{data:j,isLoading:E}=zt(f);let $;s[13]!==g?.prompts?($=g?.prompts??[],s[13]=g?.prompts,s[14]=$):$=s[14];let D;s[15]!==$?(D=$.map(dn),s[15]=$,s[16]=D):D=s[16];const A=D;let I;s[17]!==N?.resources?(I=N?.resources??[],s[17]=N?.resources,s[18]=I):I=s[18];let L;s[19]!==I?(L=I.map(ln),s[19]=I,s[20]=L):L=s[20];const U=L;let S;s[21]!==h||s[22]!==y||s[23]!==j?.tools?(S=y?h.tools??[]:(j?.tools??[]).map(cn),s[21]=h,s[22]=y,s[23]=j?.tools,s[24]=S):S=s[24];const z=S;let P;s[25]!==d.update||s[26]!==r?(P=async v=>{await d.update.mutateAsync({id:r,data:v})},s[25]=d.update,s[26]=r,s[27]=P):P=s[27];const O=P;if(!h){let v;return s[28]!==n||s[29]!==a?(v=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(ne,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:t.jsx(Ke,{variant:"outline",onClick:()=>n({to:"/$org/$project/mcps",params:{org:a,project:Ce}}),children:"Back to connections"})})}),s[28]=n,s[29]=a,s[30]=v):v=s[30],v}let V;return s[31]!==d.update.isPending||s[32]!==i||s[33]!==h||s[34]!==r||s[35]!==O||s[36]!==E||s[37]!==a||s[38]!==A||s[39]!==l||s[40]!==U||s[41]!==z?(V=t.jsx(sn,{org:a,connection:h,connectionId:r,requestedTabId:l,collections:i,onUpdate:O,isUpdating:d.update.isPending,prompts:A,resources:U,tools:z,isLoadingTools:E}),s[31]=d.update.isPending,s[32]=i,s[33]=h,s[34]=r,s[35]=O,s[36]=E,s[37]=a,s[38]=A,s[39]=l,s[40]=U,s[41]=z,s[42]=V):V=s[42],V}function cn(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,annotations:s.annotations,_meta:s._meta}}function ln(s){return{uri:s.uri,name:s.name,description:s.description}}function dn(s){return{name:s.name,description:s.description}}function mn(){const s=X.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ht,{children:t.jsx(q.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(Ue,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(an,{})})}),s[0]=e):e=s[0],e}function gr(){const s=X.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(mn,{}),s[0]=e):e=s[0],e}export{gr as default};
@@ -0,0 +1 @@
1
+ import{c as be,j as e,r as X,u as Fe,m as Be,b as Ue,a as He,d as Le,aj as Me,l as ze,k as Re,i as Xe,O as g,t as D,o as ke,ak as We,s as C,al as Ke}from"./index-BDPRLX-4.js";import{g as Ge}from"./generate-id-Dyweu44Y.js";import{C as qe,a as Qe}from"./collection-table-wrapper-D4ORko-B.js";import{C as Je,E as L}from"./collection-search-BKBrWx0L.js";import{C as Ye}from"./connection-card-DJtPsQXC.js";import{B as M}from"./badge-DriFi26e.js";import{i as Ze}from"./AlertCircle-LGpS_W0y.js";import{i as et}from"./CheckCircle-s30iekcd.js";import{E as tt}from"./error-boundary-zygCkG0M.js";import{I as nt}from"./integration-icon-CWe3aQ6t.js";import{P as E}from"./index-DaDJqKaJ.js";import{u as st,U as re}from"./use-list-state-BCruWJWf.js";import{u as ot}from"./use-binding-aajuNegG.js";import{f as rt,e as it}from"./registry-utils-B0iZy2Nk.js";import{f as ie,a as ae,b as ce,c as le,d as de,e as me,A as ue,g as pe}from"./alert-dialog-YaiDdNnH.js";import{B as at,a as ct,b as lt,c as dt}from"./breadcrumb-DrHiC5wf.js";import{B as S}from"./button-TXPV9u45.js";import{D as mt,a as ut,b as pt,c as xt,d as ht,e as gt}from"./dialog-wuqlToby.js";import{D as xe,a as he,b as ge,c as F}from"./dropdown-menu-Ba6gkTmn.js";import{a as ft,F as f,b as j,c as y,d as v,f as _}from"./form-CdePd7Pv.js";import{I as T}from"./input-D_ph6wQi.js";import{S as jt,a as yt,b as vt,c as _t,d as $}from"./select-DNtTB4Bo.js";import{T as Ct}from"./textarea-Db3p0Rx5.js";import{g as Nt,h as bt}from"./use-connection-DtRMRT7L.js";import{u as fe,a as kt}from"./constants-DEI8O4hQ.js";import{b as wt}from"./use-mcp-tools-Bko1eKF9.js";import{n as z}from"./Container-C5C-QC37.js";import{i as je}from"./DotsVertical-JJuFY8qc.js";import{s as ye}from"./Eye-msaxJPjl.js";import{s as R}from"./Globe02-DKs0xoZA.js";import{i as St}from"./Loading01-BQNDOWoE.js";import{i as Tt}from"./Terminal-DMjgMuI5.js";import{s as ve}from"./Trash01-DTKgec-l.js";import{f as _e}from"./format-time-CMKyl-GC.js";import{r as Dt,E as Pt,e as we}from"./env-vars-editor-BiT3HGiU.js";import"./ArrowDown-OoKXTEnQ.js";import"./ArrowUp-C43RK3lv.js";import"./Check-DM3yWukQ.js";import"./Grid01-BHkfA168.js";import"./List-Cnm7l2wU.js";import"./tooltip-D4BVYhMw.js";import"./index-qq_KAj9h.js";import"./table-CMEfP9H3.js";import"./SearchMd-7zTlMjUG.js";import"./card-C58nCIMb.js";import"./AlertTriangle-BauDdA9B.js";import"./use-mobile-D74rFejl.js";import"./X-DhzUfCBr.js";import"./avatar-DxO_71W5.js";import"./useQuery-Cf9H-zdg.js";import"./use-view-mode-C0BRp2tQ.js";import"./binder-BGgM6Lg4.js";import"./ChevronRight-BKg32aVF.js";import"./label-C1HpB4GV.js";import"./ChevronDown-Bvtjl1_J.js";import"./useMutation-B2OXPKQT.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./Plus-WCxYwLGA.js";function Ce(s){const o=be.c(3),{status:i}=s;if(i==="active"){let c;return o[0]===Symbol.for("react.memo_cache_sentinel")?(c=e.jsxs(M,{variant:"success",className:"gap-1.5 text-success border-success/40 bg-background",children:[e.jsx(et,{size:12}),"Active"]}),o[0]=c):c=o[0],c}if(i==="error"){let c;return o[1]===Symbol.for("react.memo_cache_sentinel")?(c=e.jsxs(M,{variant:"outline",className:"gap-1.5 text-destructive border-destructive/40 bg-background",children:[e.jsx(Ze,{size:12}),"Error"]}),o[1]=c):c=o[1],c}let d;return o[2]===Symbol.for("react.memo_cache_sentinel")?(d=e.jsx(M,{variant:"outline",className:"text-muted-foreground",children:"Inactive"}),o[2]=d):d=o[2],d}const It=ke({key:C(),value:C()}),Et=ke({title:C().min(1,"Name is required"),description:C().nullable().optional(),ui_type:Ke(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:C().optional(),connection_token:C().nullable().optional(),npx_package:C().optional(),stdio_command:C().optional(),stdio_args:C().optional(),stdio_cwd:C().optional(),env_vars:We(It).optional()}).refine(s=>s.ui_type==="NPX"?!!s.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(s=>s.ui_type==="STDIO"?!!s.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(s=>s.ui_type==="HTTP"||s.ui_type==="SSE"||s.ui_type==="Websocket"?!!s.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function U(s){const o=s.trim();if(!o)return"";try{const i=new URL(o),d=i.pathname.length>1?i.pathname.replace(/\/+$/,""):i.pathname;return`${i.origin}${d}`}catch{return o.replace(/\/+$/,"")}}function $t(s){const o=s.trim().split(/\s+/).filter(Boolean);if(o.length<2)return null;const i=o[0]?.toLowerCase();if(i!=="npx"&&i!=="bunx")return null;const c=o.slice(1).find(N=>!N.startsWith("-"));return c?{packageName:c}:null}function B(s){const{uiType:o}=s,i=U(s.connectionUrl??"");if((o==="HTTP"||o==="SSE"||o==="Websocket")&&i===U("https://api.githubcopilot.com/mcp/"))return{id:"github",title:"GitHub",description:"GitHub Copilot MCP",token:{label:"GitHub PAT",placeholder:"github_pat_…",helperText:"Paste a GitHub Personal Access Token (PAT)"}};const d=(s.npxPackage??"").trim();return o==="NPX"&&d==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function Ne(s){if(s.registryItems.length===0||s.uiType!=="HTTP"&&s.uiType!=="SSE"&&s.uiType!=="Websocket")return null;const o=U(s.connectionUrl??"");if(!o)return null;const i=s.registryItems.find(N=>(N.server?.remotes??[]).some(O=>U(O.url??"")===o));if(!i)return null;const d=i.title||i.name||i.server?.title||i.server?.name||"",c=i.server?.description||i.description||i.summary||null;return d?{id:"registry",title:d,description:c}:null}function Ot(s,o){const i={command:"npx",args:["-y",s]},d=we(o);return Object.keys(d).length>0&&(i.envVars=d),i}function At(s,o,i,d){const c={command:s};o.trim()&&(c.args=o.trim().split(/\s+/)),i?.trim()&&(c.cwd=i.trim());const N=we(d);return Object.keys(N).length>0&&(c.envVars=N),c}function Vt(s){return s.command==="npx"}function Ft(s){return s.args?.find(o=>!o.startsWith("-"))??""}function Bt(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function Ut(s,o){switch(o.type){case"edit":return{mode:"editing",connection:o.connection};case"delete":return{mode:"deleting",connection:o.connection};case"force-delete":return{mode:"force-deleting",connection:o.connection,agentNames:o.agentNames};case"close":return{mode:"idle"}}}function Ht(){const{org:s}=Fe(),o=Be(),i=Ue(),d=He({strict:!1}),{data:c}=Le.useSession(),{stdioEnabled:N}=Me(),l=st({namespace:s.slug,resource:"connections"}),O=Nt(),A=bt(l),[u,b]=X.useReducer(Ut,{mode:"idle"}),W=ot(A)[0],K=W?.id??"",G=rt(W?.tools),Se=fe({connectionId:K||null,orgId:s.id}),{data:Te}=wt({client:Se,toolName:G,toolArguments:{limit:200},enabled:!!(K&&G),staleTime:3600*1e3,select:t=>t.structuredContent??t}),q=it(Te??[]),Q=d.action==="create",De=()=>{i({to:"/$org/$project/mcps",params:{org:s.slug,project:g},search:{action:"create"}})},J=()=>{i({to:"/$org/$project/mcps",params:{org:s.slug,project:g},search:{}})},r=ze({resolver:Re(Et),defaultValues:{title:"",description:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),p=r.watch("ui_type"),Y=r.watch("connection_url"),Pe=r.watch("npx_package"),P=B({uiType:p,connectionUrl:Y??"",npxPackage:Pe??""})??Ne({uiType:p,connectionUrl:Y??"",registryItems:q}),m=u.mode==="editing"?u.connection:null;X.useEffect(()=>{if(m){const t=Xe(m.connection_headers)?m.connection_headers:null;if(t&&m.connection_type==="STDIO"){const n=Dt(t.envVars);if(Vt(t)){const a=Ft(t);r.reset({title:m.title,description:m.description,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:a,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:n})}else{const a=Bt(t);r.reset({title:m.title,description:m.description,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:a.command,stdio_args:a.args,stdio_cwd:a.cwd,env_vars:n})}}else r.reset({title:m.title,description:m.description,ui_type:m.connection_type,connection_url:m.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]})}else r.reset({title:"",description:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]})},[m,r]);const Z=fe({connectionId:kt,orgId:s.id}),ee=()=>{o.invalidateQueries({predicate:t=>{const n=t.queryKey;return n[1]===s.id&&n[3]==="collection"&&n[4]==="CONNECTIONS"}})},te=t=>{const n=t.content;return Array.isArray(n)&&n[0]?.type==="text"&&typeof n[0].text=="string"?n[0].text:"Unknown error"},Ie=async()=>{if(u.mode!=="deleting")return;const t=u.connection;b({type:"close"});try{const n=await Z.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:t.id}});if(n.isError){const a=te(n),k=a.replace(/^Error:\s*/,"");try{const x=JSON.parse(k);if(x.code==="CONNECTION_IN_USE"&&x.agentNames){b({type:"force-delete",connection:t,agentNames:x.agentNames.map(w=>`"${w}"`).join(", ")});return}}catch{}D.error(`Failed to delete connection: ${a}`);return}ee(),D.success("Connection deleted successfully")}catch(n){const a=n instanceof Error?n.message:String(n);D.error(`Failed to delete connection: ${a}`)}},Ee=async()=>{if(u.mode!=="force-deleting")return;const t=u.connection.id;b({type:"close"});try{const n=await Z.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:t,force:!0}});if(n.isError){D.error(`Failed to delete connection: ${te(n)}`);return}ee(),D.success("Connection deleted successfully")}catch(n){const a=n instanceof Error?n.message:String(n);D.error(`Failed to delete connection: ${a}`)}},$e=async t=>{let n,a=null,k=null,x=null;if(t.ui_type==="NPX"?(n="STDIO",a="",x=Ot(t.npx_package||"",t.env_vars||[])):t.ui_type==="STDIO"?(n="STDIO",a="",x=At(t.stdio_command||"",t.stdio_args||"",t.stdio_cwd,t.env_vars||[])):(n=t.ui_type,a=t.connection_url||"",k=t.connection_token||null),m){await O.update.mutateAsync({id:m.id,data:{title:t.title,description:t.description||null,connection_type:n,connection_url:a,...k&&{connection_token:k},...x&&{connection_headers:x}}}),b({type:"close"}),r.reset();return}const w=Ge("conn");await O.create.mutateAsync({id:w,title:t.title,description:t.description||null,connection_type:n,connection_url:a,connection_token:k,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:c?.user?.id||"system",organization_id:s.id,icon:null,app_name:null,app_id:null,connection_headers:x,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),J(),r.reset(),i({to:"/$org/$project/mcps/$connectionId",params:{org:s.slug,project:g,connectionId:w}})},ne=t=>{t||(Q?J():b({type:"close"}),r.reset())},V=t=>{const n=t.trim();if(!n)return;const a=!!r.formState.dirtyFields.title,k=!!r.formState.dirtyFields.description,x=!!r.formState.dirtyFields.env_vars,w=h=>{if(h&&(!a&&!r.getValues("title").trim()&&h.title&&r.setValue("title",h.title,{shouldDirty:!1}),!k&&!(r.getValues("description")??"").trim()&&h.description&&r.setValue("description",h.description,{shouldDirty:!1}),!x&&h.envVarKeys?.length)){const se=r.getValues("env_vars")??[],Ve=new Set(se.map(I=>I.key)),oe=h.envVarKeys.filter(I=>!Ve.has(I));oe.length>0&&r.setValue("env_vars",[...se,...oe.map(I=>({key:I,value:""}))],{shouldDirty:!0})}},H=$t(n);if(H&&N){r.setValue("ui_type","NPX",{shouldDirty:!0}),r.setValue("npx_package",H.packageName,{shouldDirty:!0}),r.setValue("connection_url","",{shouldDirty:!0}),r.setValue("connection_token",null,{shouldDirty:!0}),w(B({uiType:"NPX",npxPackage:H.packageName}));return}if(n.startsWith("http://")||n.startsWith("https://")){const h=p==="HTTP"||p==="SSE"||p==="Websocket"?p:"HTTP";r.setValue("ui_type",h,{shouldDirty:!0}),r.setValue("connection_url",n,{shouldDirty:!0}),w(B({uiType:h,connectionUrl:n})??Ne({uiType:h,connectionUrl:n,registryItems:q}));return}p==="NPX"&&w(B({uiType:"NPX",npxPackage:n}))},Oe=[{id:"title",header:"Name",render:t=>e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(nt,{icon:t.icon,name:t.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:e.jsx(z,{})}),e.jsx("span",{className:"text-sm font-medium text-foreground truncate block",title:t.title,children:t.title})]}),cellClassName:"w-32 min-w-0 shrink-0",sortable:!0},{id:"description",header:"Description",render:t=>e.jsx("span",{className:"text-sm text-muted-foreground truncate block",title:t.description||"",children:t.description||"—"}),cellClassName:"flex-1 min-w-0 max-w-0",wrap:!1,sortable:!0},{id:"connection_type",header:"Type",accessor:t=>e.jsx("span",{className:"text-xs font-medium",children:t.connection_type}),cellClassName:"w-16 shrink-0",sortable:!0},{id:"status",header:"Status",render:t=>e.jsx(Ce,{status:t.status}),cellClassName:"w-28 shrink-0",sortable:!1},{id:"updated_by",header:"Updated by",render:t=>e.jsx(re,{id:t.updated_by??t.created_by,size:"3xs"}),cellClassName:"w-32 shrink-0",sortable:!0},{id:"updated_at",header:"Updated",render:t=>e.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:t.updated_at?_e(new Date(t.updated_at)):"—"}),cellClassName:"max-w-24 w-24 shrink-0",sortable:!0},{id:"actions",header:"",render:t=>e.jsxs(xe,{children:[e.jsx(he,{asChild:!0,children:e.jsx(S,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:n=>n.stopPropagation(),children:e.jsx(je,{size:20})})}),e.jsxs(ge,{align:"end",onClick:n=>n.stopPropagation(),children:[e.jsxs(F,{onClick:n=>{n.stopPropagation(),i({to:"/$org/$project/mcps/$connectionId",params:{org:s.slug,project:g,connectionId:t.id}})},children:[e.jsx(ye,{size:16}),"Open"]}),e.jsxs(F,{variant:"destructive",onClick:n=>{n.stopPropagation(),b({type:"delete",connection:t})},children:[e.jsx(ve,{size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],Ae=e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(S,{variant:"outline",onClick:()=>i({to:"/$org/$project/store",params:{org:s.slug,project:g}}),size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Browse Store"}),e.jsx(S,{onClick:De,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Custom Connection"})]});return e.jsxs(E,{children:[e.jsx(mt,{open:Q||u.mode==="editing",onOpenChange:ne,children:e.jsxs(ut,{className:"sm:max-w-[525px]",children:[e.jsxs(pt,{children:[e.jsx(xt,{children:m?"Edit Connection":"Create Connection"}),e.jsx(ht,{children:m?"Update the connection details below.":"Create a custom connection in your organization. Fill in the details below."})]}),e.jsx(ft,{...r,children:e.jsxs("form",{onSubmit:r.handleSubmit($e),children:[e.jsxs("div",{className:"grid gap-4 py-4",children:[e.jsx(f,{control:r.control,name:"ui_type",render:({field:t})=>e.jsxs(j,{children:[e.jsx(y,{children:"Type *"}),e.jsxs(jt,{value:t.value,onValueChange:t.onChange,children:[e.jsx(v,{children:e.jsx(yt,{children:e.jsx(vt,{})})}),e.jsxs(_t,{children:[e.jsx($,{value:"HTTP",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(R,{className:"w-4 h-4"}),"HTTP"]})}),e.jsx($,{value:"SSE",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(R,{className:"w-4 h-4"}),"SSE"]})}),e.jsx($,{value:"Websocket",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(R,{className:"w-4 h-4"}),"Websocket"]})}),N&&e.jsxs(e.Fragment,{children:[e.jsx($,{value:"NPX",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(z,{className:"w-4 h-4"}),"NPX Package"]})}),e.jsx($,{value:"STDIO",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(Tt,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),e.jsx(_,{})]})}),p==="NPX"&&e.jsx(e.Fragment,{children:e.jsx(f,{control:r.control,name:"npx_package",render:({field:t})=>e.jsxs(j,{children:[e.jsx(y,{children:"NPM Package *"}),e.jsx(v,{children:e.jsx(T,{placeholder:"@perplexity-ai/mcp-server",...t,value:t.value??"",onPaste:n=>{const a=n.clipboardData.getData("text");a&&(n.preventDefault(),r.setValue("npx_package",a.trim(),{shouldDirty:!0}),V(a))},onBlur:n=>{V(n.target.value),t.onBlur()}})}),e.jsx(_,{})]})})}),p==="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[e.jsx(f,{control:r.control,name:"stdio_command",render:({field:t})=>e.jsxs(j,{children:[e.jsx(y,{children:"Command *"}),e.jsx(v,{children:e.jsx(T,{placeholder:"node, bun, python...",...t,value:t.value??""})}),e.jsx(_,{})]})}),e.jsx(f,{control:r.control,name:"stdio_args",render:({field:t})=>e.jsxs(j,{children:[e.jsx(y,{children:"Arguments"}),e.jsx(v,{children:e.jsx(T,{placeholder:"arg1 arg2 --flag value",...t,value:t.value??""})}),e.jsx(_,{})]})})]}),e.jsx(f,{control:r.control,name:"stdio_cwd",render:({field:t})=>e.jsxs(j,{children:[e.jsx(y,{children:"Working Directory"}),e.jsx(v,{children:e.jsx(T,{placeholder:"/path/to/project (optional)",...t,value:t.value??""})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),e.jsx(_,{})]})})]}),(p==="NPX"||p==="STDIO")&&e.jsx(f,{control:r.control,name:"env_vars",render:({field:t})=>e.jsxs(j,{children:[e.jsx(y,{children:"Environment Variables"}),e.jsx(v,{children:e.jsx(Pt,{value:t.value??[],onChange:t.onChange})}),e.jsx(_,{})]})}),p!=="NPX"&&p!=="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsx(f,{control:r.control,name:"connection_url",render:({field:t})=>e.jsxs(j,{children:[e.jsx(y,{children:"URL *"}),e.jsx(v,{children:e.jsx(T,{placeholder:"https://example.com/mcp",...t,value:t.value??"",onPaste:n=>{const a=n.clipboardData.getData("text");a&&(n.preventDefault(),r.setValue("connection_url",a.trim(),{shouldDirty:!0}),V(a))},onBlur:n=>{V(n.target.value),t.onBlur()}})}),e.jsx(_,{})]})}),e.jsx(f,{control:r.control,name:"connection_token",render:({field:t})=>e.jsxs(j,{children:[e.jsx(y,{children:P?.token?.label??"Token (optional)"}),e.jsx(v,{children:e.jsx(T,{type:"password",placeholder:P?.token?.placeholder??"Bearer token or API key",...t,value:t.value??""})}),P?.token?.helperText&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:[P.token.helperText,P.id==="github"&&e.jsxs(e.Fragment,{children:[" ","·"," ",e.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:"Open GitHub PAT settings"})]})]}),e.jsx(_,{})]})})]}),e.jsx(f,{control:r.control,name:"title",render:({field:t})=>e.jsxs(j,{children:[e.jsx(y,{children:"Name *"}),e.jsx(v,{children:e.jsx(T,{placeholder:"My Connection",...t})}),e.jsx(_,{})]})}),e.jsx(f,{control:r.control,name:"description",render:({field:t})=>e.jsxs(j,{children:[e.jsx(y,{children:"Description"}),e.jsx(v,{children:e.jsx(Ct,{placeholder:"A brief description of this connection",rows:3,...t,value:t.value??""})}),e.jsx(_,{})]})})]}),e.jsxs(gt,{children:[e.jsx(S,{type:"button",variant:"outline",onClick:()=>ne(!1),children:"Cancel"}),e.jsx(S,{type:"submit",disabled:r.formState.isSubmitting,className:"min-w-40",children:r.formState.isSubmitting?"Saving...":m?"Update Connection":"Create Connection"})]})]})})]})}),e.jsx(ie,{open:u.mode==="deleting",onOpenChange:t=>!t&&b({type:"close"}),children:e.jsxs(ae,{children:[e.jsxs(ce,{children:[e.jsx(le,{children:"Delete Connection?"}),e.jsxs(de,{children:["This action cannot be undone. This will permanently delete"," ",e.jsx("span",{className:"font-medium text-foreground",children:u.mode==="deleting"&&u.connection.title}),"."]})]}),e.jsxs(me,{children:[e.jsx(ue,{children:"Cancel"}),e.jsx(pe,{onClick:Ie,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})}),e.jsx(ie,{open:u.mode==="force-deleting",onOpenChange:t=>!t&&b({type:"close"}),children:e.jsxs(ae,{children:[e.jsxs(ce,{children:[e.jsx(le,{children:"Connection Used by Agents"}),e.jsx(de,{asChild:!0,children:e.jsxs("div",{children:[e.jsxs("p",{children:["The connection"," ",e.jsx("span",{className:"font-medium text-foreground",children:u.mode==="force-deleting"&&u.connection.title})," ","is currently used by the following agent(s):"," ",e.jsx("span",{className:"font-medium text-foreground",children:u.mode==="force-deleting"&&u.agentNames}),"."]}),e.jsx("p",{className:"mt-2",children:"Deleting this connection will remove it from those agents, which may impact existing workflows that depend on them."})]})})]}),e.jsxs(me,{children:[e.jsx(ue,{children:"Cancel"}),e.jsx(pe,{onClick:Ee,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete Anyway"})]})]})}),e.jsxs(E.Header,{children:[e.jsx(E.Header.Left,{children:e.jsx(at,{children:e.jsx(ct,{children:e.jsx(lt,{children:e.jsx(dt,{children:"Connections"})})})})}),e.jsxs(E.Header.Right,{children:[e.jsx(qe,{viewMode:l.viewMode,onViewModeChange:l.setViewMode,sortKey:l.sortKey,sortDirection:l.sortDirection,onSort:l.handleSort,sortOptions:[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"connection_type",label:"Type"},{id:"updated_by",label:"Updated by"},{id:"updated_at",label:"Updated"}]}),Ae]})]}),e.jsx(Je,{value:l.search,onChange:l.setSearch,placeholder:"Search for a Connection...",onKeyDown:t=>{t.key==="Escape"&&(l.setSearch(""),t.target.blur())}}),e.jsx(E.Content,{children:l.viewMode==="cards"?e.jsx("div",{className:"flex-1 overflow-auto p-5",children:A.length===0?e.jsx(L,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:(l.search,"No Connections found"),description:l.search?`No Connections match "${l.search}"`:"Create a connection to get started.",actions:!l.search&&e.jsx(S,{variant:"outline",onClick:()=>i({to:"/$org/$project/store",params:{org:s.slug,project:g}}),children:"Browse Store"})}):e.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:A.map(t=>e.jsx(Ye,{connection:t,fallbackIcon:e.jsx(z,{}),onClick:()=>i({to:"/$org/$project/mcps/$connectionId",params:{org:s.slug,project:g,connectionId:t.id}}),headerActions:e.jsxs(xe,{children:[e.jsx(he,{asChild:!0,children:e.jsx(S,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:n=>n.stopPropagation(),children:e.jsx(je,{size:20})})}),e.jsxs(ge,{align:"end",onClick:n=>n.stopPropagation(),children:[e.jsxs(F,{onClick:n=>{n.stopPropagation(),i({to:"/$org/$project/mcps/$connectionId",params:{org:s.slug,project:g,connectionId:t.id}})},children:[e.jsx(ye,{size:16}),"Open"]}),e.jsxs(F,{variant:"destructive",onClick:n=>{n.stopPropagation(),b({type:"delete",connection:t})},children:[e.jsx(ve,{size:16}),"Delete"]})]})]}),body:e.jsx(Ce,{status:t.status}),footer:e.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground w-full min-w-0",children:[e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx(re,{id:t.updated_by??t.created_by,size:"3xs"})}),e.jsx("span",{className:"shrink-0 ml-2",children:t.updated_at?_e(new Date(t.updated_at)):"—"})]})},t.id))})}):e.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:e.jsx("div",{className:"flex-1 overflow-auto min-w-0",children:e.jsx("div",{className:"min-w-[1000px]",children:e.jsx(Qe,{columns:Oe,data:A,isLoading:!1,sortKey:l.sortKey,sortDirection:l.sortDirection,onSort:l.handleSort,onRowClick:t=>i({to:"/$org/$project/mcps/$connectionId",params:{org:s.slug,project:g,connectionId:t.id}}),emptyState:l.search?e.jsx(L,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:400,height:178,"aria-hidden":"true"}),title:"No Connections found",description:`No Connections match "${l.search}"`}):e.jsx(L,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:400,height:178,"aria-hidden":"true"}),title:"No Connections found",description:"Create a connection to get started.",actions:e.jsx(S,{variant:"outline",onClick:()=>i({to:"/$org/$project/store",params:{org:s.slug,project:g}}),children:"Browse Store"})})})})})})})]})}function Wn(){const s=be.c(1);let o;return s[0]===Symbol.for("react.memo_cache_sentinel")?(o=e.jsx(tt,{children:e.jsx(X.Suspense,{fallback:e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsx(St,{size:32,className:"animate-spin text-muted-foreground"})}),children:e.jsx(Ht,{})})}),s[0]=o):o=s[0],o}export{Wn as default};
@@ -0,0 +1 @@
1
+ import{D as t,E as a}from"./index-BDPRLX-4.js";const e=t(a,{target:"draft-7"});export{e as B};
@@ -1 +1 @@
1
- import{bp as h,c as d,n as f,bq as _}from"./index-p3omciU2.js";const m={authConfig:()=>["authConfig"],threads:t=>["threads",t],virtualMcpThreads:(t,e)=>["threads",t,"virtual-mcp",e],thread:(t,e)=>["thread",t,e],threadMessages:(t,e)=>["thread-messages",t,e],messages:t=>["messages",t],organizations:()=>["organizations"],members:t=>[t,"members"],invitations:t=>[t,"invitations"],organizationRoles:t=>[t,"organization-roles"],connections:t=>[t,"connections"],connectionsByBinding:(t,e)=>[t,"connections",`binding:${e}`],connection:(t,e)=>[t,"connection",e],isMCPAuthenticated:(t,e)=>["is-mcp-authenticated",t,e],mcpTools:(t,e)=>["mcp","tools",t,e],mcpClient:(t,e,n,o)=>["mcp","client",t,e,n,o],mcpToolsList:t=>["mcp","client",t,"tools"],mcpResourcesList:t=>["mcp","client",t,"resources"],mcpPromptsList:t=>["mcp","client",t,"prompts"],mcpReadResource:(t,e)=>["mcp","client",t,"resource",e],mcpGetPrompt:(t,e,n)=>["mcp","client",t,"prompt",e,n],mcpToolCall:(t,e,n)=>["mcp","client",t,"tool-call",e,n],organizationSettings:t=>["organization-settings",t],activeOrganization:t=>["activeOrganization",t],modelsList:t=>["models-list",t],connectionCollections:t=>[t,"collections","discovery"],toolCall:(t,e,n)=>["tool-call",t,e,n],collectionItems:(t,e)=>["collection",t,e],collection:(t,e,n)=>[t,e,"collection",n],collectionItem:(t,e,n,o,i)=>[t,e,n,"collection",o,i],collectionList:(t,e,n,o,i)=>[t,e,n,"collection",o,"list",i],collectionListInfinite:(t,e,n,o,i)=>[t,e,n,"collection",o,"list-infinite",i],githubReadme:(t,e)=>["github-readme",t,e],monitoringStats:()=>["monitoring","stats"],monitoringLogs:t=>["monitoring","logs",t],monitoringLogsInfinite:(t,e)=>["monitoring","logs-infinite",t,e],virtualMcpPrompts:t=>["virtual-mcp",t,"prompts"],connectionPrompts:t=>["connection",t,"prompts"],connectionResources:t=>["connection",t,"resources"],user:t=>["user",t]};class y extends h{constructor(e,n){super(e,n)}send(e,n){const o=b(e);return o?.type==="emit"?(this.onmessage?.(o.message),Promise.resolve()):o?.type==="suppress"?Promise.resolve():super.send(e,n)}}function b(t){const e=t;if(!e||typeof e!="object"||!("method"in e))return null;switch(e.method){case"initialize":{const n=e?.params?.protocolVersion;return n?{type:"emit",message:{result:{protocolVersion:n,capabilities:{tools:{},resources:{},prompts:{},tasks:{list:{},cancel:{},requests:{tool:{call:{}}}}},serverInfo:{name:"mesh-virtual-mcp",version:"1.0.0"}},jsonrpc:e.jsonrpc??"2.0",id:e.id}}:null}case"notifications/roots/list_changed":case"notifications/initialized":case"notifications/cancelled":case"notifications/progress":return{type:"suppress"};default:return null}}const C={name:"mesh-sdk",version:"1.0.0"};function T(t,e){const n=e??(typeof window<"u"?window.location.origin:void 0);if(!n)throw new Error("MCP client requires either meshUrl option or a browser environment.");const o=t?`/mcp/${t}`:"/mcp";return new URL(o,n).href}async function g({connectionId:t,orgId:e,token:n,meshUrl:o}){const i=T(t,o),c=new _(C,{capabilities:{tasks:{list:{},cancel:{},requests:{tool:{call:{}}}}}}),r=new y(new URL(i),{requestInit:{headers:{"Content-Type":"application/json",Accept:"application/json, text/event-stream","x-org-id":e,...n?{Authorization:`Bearer ${n}`}:{}}}});await c.connect(r);const a=m.mcpClient(e,t??"self",n??"",o??"");return c.toJSON=()=>`mcp-client:${a.join(":")}`,c}function S(t){const e=d.c(13),{connectionId:n,orgId:o,token:i,meshUrl:c}=t;let r;e[0]!==n||e[1]!==c||e[2]!==o||e[3]!==i?(r=m.mcpClient(o,n??"self",i??"",c??""),e[0]=n,e[1]=c,e[2]=o,e[3]=i,e[4]=r):r=e[4];const a=r;let s;e[5]!==n||e[6]!==c||e[7]!==o||e[8]!==i?(s=()=>g({connectionId:n,orgId:o,token:i,meshUrl:c}),e[5]=n,e[6]=c,e[7]=o,e[8]=i,e[9]=s):s=e[9];let l;e[10]!==a||e[11]!==s?(l={queryKey:a,queryFn:s,staleTime:1/0,gcTime:0},e[10]=a,e[11]=s,e[12]=l):l=e[12];const{data:u}=f(l);return u}function I(t){const e=d.c(13),{connectionId:n,orgId:o,token:i,meshUrl:c}=t;let r;e[0]!==n||e[1]!==c||e[2]!==o||e[3]!==i?(r=n!==void 0?m.mcpClient(o,n??"self",i??"",c??""):["mcp","client","skip",o],e[0]=n,e[1]=c,e[2]=o,e[3]=i,e[4]=r):r=e[4];const a=r;let s;e[5]!==n||e[6]!==c||e[7]!==o||e[8]!==i?(s=async()=>n===void 0?null:g({connectionId:n,orgId:o,token:i,meshUrl:c}),e[5]=n,e[6]=c,e[7]=o,e[8]=i,e[9]=s):s=e[9];let l;e[10]!==a||e[11]!==s?(l={queryKey:a,queryFn:s,staleTime:1/0,gcTime:0},e[10]=a,e[11]=s,e[12]=l):l=e[12];const{data:u}=f(l);return u??null}const P={SELF:t=>`${t}_self`,REGISTRY:t=>`${t}_registry`,COMMUNITY_REGISTRY:t=>`${t}_community-registry`,DEV_ASSETS:t=>`${t}_dev-assets`},M="self";function R(t){return{id:P.REGISTRY(t),title:"Deco Store",description:"Official deco MCP registry with curated integrations",connection_type:"HTTP",connection_url:"https://api.decocms.com/mcp/registry",icon:"https://assets.decocache.com/decocms/00ccf6c3-9e13-4517-83b0-75ab84554bb9/596364c63320075ca58483660156b6d9de9b526e.png",app_name:"deco-registry",app_id:null,connection_token:null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{isDefault:!0,type:"registry"}}}function L(){return{id:"community-registry",title:"MCP Registry",description:"Community MCP registry with thousands of handy MCPs",connection_type:"HTTP",connection_url:"https://sites-registry.decocache.com/mcp",icon:"https://assets.decocache.com/decocms/cd7ca472-0f72-463a-b0de-6e44bdd0f9b4/mcp.png",app_name:"mcp-registry",app_id:null,connection_token:null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{isDefault:!0,type:"registry"}}}function D(t={}){return{id:t.id,title:"OpenRouter",description:"Access hundreds of LLM models from a single API",icon:"https://assets.decocache.com/decocms/b2e2f64f-6025-45f7-9e8c-3b3ebdd073d8/openrouter_logojpg.jpg",app_name:"openrouter",app_id:"openrouter",connection_type:"HTTP",connection_url:"https://sites-openrouter.decocache.com/mcp",connection_token:null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{source:"chat",verified:!1,scopeName:"deco",toolsCount:0,publishedAt:null,repository:null}}}function E(){return{title:"MCP Studio",description:"An app that allows you to create and manage MCPs",icon:"https://assets.decocache.com/mcp/09e44283-f47d-4046-955f-816d227c626f/app.png",app_name:"mcp-studio",app_id:"65a1b407-b6af-41e2-a89f-ce9450c05bbc",connection_type:"HTTP",connection_url:"https://sites-vibemcp.decocache.com/mcp",connection_token:null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{isDefault:!1,type:"mcp-studio"}}}function O(t){return{id:v(t),organization_id:t,title:"Decopilot",description:"Default agent that aggregates all organization connections",icon:"https://assets.decocache.com/decocms/fd07a578-6b1c-40f1-bc05-88a3b981695d/f7fc4ffa81aec04e37ae670c3cd4936643a7b269.png",status:"active",created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:"system",updated_by:void 0,metadata:{instructions:null},connections:[]}}const p="decopilot_";function $(t){return!t||!t.startsWith(p)?null:t.slice(p.length)||null}function v(t){return`${p}${t}`}export{m as K,y as S,P as W,M as a,L as b,g as c,O as d,E as e,D as f,v as g,R as h,$ as i,I as j,S as u};
1
+ import{bN as h,c as d,n as f,bO as _}from"./index-BDPRLX-4.js";const m={authConfig:()=>["authConfig"],threads:t=>["threads",t],virtualMcpThreads:(t,e)=>["threads",t,"virtual-mcp",e],thread:(t,e)=>["thread",t,e],threadMessages:(t,e)=>["thread-messages",t,e],messages:t=>["messages",t],organizations:()=>["organizations"],members:t=>[t,"members"],invitations:t=>[t,"invitations"],organizationRoles:t=>[t,"organization-roles"],connections:t=>[t,"connections"],connectionsByBinding:(t,e)=>[t,"connections",`binding:${e}`],connection:(t,e)=>[t,"connection",e],isMCPAuthenticated:(t,e)=>["is-mcp-authenticated",t,e],mcpTools:(t,e)=>["mcp","tools",t,e],mcpClient:(t,e,n,o)=>["mcp","client",t,e,n,o],mcpToolsList:t=>["mcp","client",t,"tools"],mcpResourcesList:t=>["mcp","client",t,"resources"],mcpPromptsList:t=>["mcp","client",t,"prompts"],mcpReadResource:(t,e)=>["mcp","client",t,"resource",e],mcpGetPrompt:(t,e,n)=>["mcp","client",t,"prompt",e,n],mcpToolCall:(t,e,n)=>["mcp","client",t,"tool-call",e,n],organizationSettings:t=>["organization-settings",t],activeOrganization:t=>["activeOrganization",t],modelsList:t=>["models-list",t],connectionCollections:t=>[t,"collections","discovery"],toolCall:(t,e,n)=>["tool-call",t,e,n],collectionItems:(t,e)=>["collection",t,e],collection:(t,e,n)=>[t,e,"collection",n],collectionItem:(t,e,n,o,i)=>[t,e,n,"collection",o,i],collectionList:(t,e,n,o,i)=>[t,e,n,"collection",o,"list",i],collectionListInfinite:(t,e,n,o,i)=>[t,e,n,"collection",o,"list-infinite",i],githubReadme:(t,e)=>["github-readme",t,e],monitoringStats:()=>["monitoring","stats"],monitoringLogs:t=>["monitoring","logs",t],monitoringLogsInfinite:(t,e)=>["monitoring","logs-infinite",t,e],virtualMcpPrompts:t=>["virtual-mcp",t,"prompts"],connectionPrompts:t=>["connection",t,"prompts"],connectionResources:t=>["connection",t,"resources"],user:t=>["user",t]};class y extends h{constructor(e,n){super(e,n)}send(e,n){const o=b(e);return o?.type==="emit"?(this.onmessage?.(o.message),Promise.resolve()):o?.type==="suppress"?Promise.resolve():super.send(e,n)}}function b(t){const e=t;if(!e||typeof e!="object"||!("method"in e))return null;switch(e.method){case"initialize":{const n=e?.params?.protocolVersion;return n?{type:"emit",message:{result:{protocolVersion:n,capabilities:{tools:{},resources:{},prompts:{},tasks:{list:{},cancel:{},requests:{tool:{call:{}}}}},serverInfo:{name:"mesh-virtual-mcp",version:"1.0.0"}},jsonrpc:e.jsonrpc??"2.0",id:e.id}}:null}case"notifications/roots/list_changed":case"notifications/initialized":case"notifications/cancelled":case"notifications/progress":return{type:"suppress"};default:return null}}const C={name:"mesh-sdk",version:"1.0.0"};function T(t,e){const n=e??(typeof window<"u"?window.location.origin:void 0);if(!n)throw new Error("MCP client requires either meshUrl option or a browser environment.");const o=t?`/mcp/${t}`:"/mcp";return new URL(o,n).href}async function g({connectionId:t,orgId:e,token:n,meshUrl:o}){const i=T(t,o),c=new _(C,{capabilities:{tasks:{list:{},cancel:{},requests:{tool:{call:{}}}}}}),r=new y(new URL(i),{requestInit:{headers:{"Content-Type":"application/json",Accept:"application/json, text/event-stream","x-org-id":e,...n?{Authorization:`Bearer ${n}`}:{}}}});await c.connect(r);const a=m.mcpClient(e,t??"self",n??"",o??"");return c.toJSON=()=>`mcp-client:${a.join(":")}`,c}function S(t){const e=d.c(13),{connectionId:n,orgId:o,token:i,meshUrl:c}=t;let r;e[0]!==n||e[1]!==c||e[2]!==o||e[3]!==i?(r=m.mcpClient(o,n??"self",i??"",c??""),e[0]=n,e[1]=c,e[2]=o,e[3]=i,e[4]=r):r=e[4];const a=r;let s;e[5]!==n||e[6]!==c||e[7]!==o||e[8]!==i?(s=()=>g({connectionId:n,orgId:o,token:i,meshUrl:c}),e[5]=n,e[6]=c,e[7]=o,e[8]=i,e[9]=s):s=e[9];let l;e[10]!==a||e[11]!==s?(l={queryKey:a,queryFn:s,staleTime:1/0,gcTime:0},e[10]=a,e[11]=s,e[12]=l):l=e[12];const{data:u}=f(l);return u}function I(t){const e=d.c(13),{connectionId:n,orgId:o,token:i,meshUrl:c}=t;let r;e[0]!==n||e[1]!==c||e[2]!==o||e[3]!==i?(r=n!==void 0?m.mcpClient(o,n??"self",i??"",c??""):["mcp","client","skip",o],e[0]=n,e[1]=c,e[2]=o,e[3]=i,e[4]=r):r=e[4];const a=r;let s;e[5]!==n||e[6]!==c||e[7]!==o||e[8]!==i?(s=async()=>n===void 0?null:g({connectionId:n,orgId:o,token:i,meshUrl:c}),e[5]=n,e[6]=c,e[7]=o,e[8]=i,e[9]=s):s=e[9];let l;e[10]!==a||e[11]!==s?(l={queryKey:a,queryFn:s,staleTime:1/0,gcTime:0},e[10]=a,e[11]=s,e[12]=l):l=e[12];const{data:u}=f(l);return u??null}const P={SELF:t=>`${t}_self`,REGISTRY:t=>`${t}_registry`,COMMUNITY_REGISTRY:t=>`${t}_community-registry`,DEV_ASSETS:t=>`${t}_dev-assets`},M="self";function R(t){return{id:P.REGISTRY(t),title:"Deco Store",description:"Official deco MCP registry with curated integrations",connection_type:"HTTP",connection_url:"https://api.decocms.com/mcp/registry",icon:"https://assets.decocache.com/decocms/00ccf6c3-9e13-4517-83b0-75ab84554bb9/596364c63320075ca58483660156b6d9de9b526e.png",app_name:"deco-registry",app_id:null,connection_token:null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{isDefault:!0,type:"registry"}}}function L(){return{id:"community-registry",title:"MCP Registry",description:"Community MCP registry with thousands of handy MCPs",connection_type:"HTTP",connection_url:"https://sites-registry.decocache.com/mcp",icon:"https://assets.decocache.com/decocms/cd7ca472-0f72-463a-b0de-6e44bdd0f9b4/mcp.png",app_name:"mcp-registry",app_id:null,connection_token:null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{isDefault:!0,type:"registry"}}}function D(t={}){return{id:t.id,title:"OpenRouter",description:"Access hundreds of LLM models from a single API",icon:"https://assets.decocache.com/decocms/b2e2f64f-6025-45f7-9e8c-3b3ebdd073d8/openrouter_logojpg.jpg",app_name:"openrouter",app_id:"openrouter",connection_type:"HTTP",connection_url:"https://sites-openrouter.decocache.com/mcp",connection_token:null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{source:"chat",verified:!1,scopeName:"deco",toolsCount:0,publishedAt:null,repository:null}}}function O(){return{title:"MCP Studio",description:"An app that allows you to create and manage MCPs",icon:"https://assets.decocache.com/mcp/09e44283-f47d-4046-955f-816d227c626f/app.png",app_name:"mcp-studio",app_id:"65a1b407-b6af-41e2-a89f-ce9450c05bbc",connection_type:"HTTP",connection_url:"https://sites-vibemcp.decocache.com/mcp",connection_token:null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{isDefault:!1,type:"mcp-studio"}}}function E(t){return{id:v(t),organization_id:t,title:"Decopilot",description:"Default agent that aggregates all organization connections",icon:"https://assets.decocache.com/decocms/fd07a578-6b1c-40f1-bc05-88a3b981695d/f7fc4ffa81aec04e37ae670c3cd4936643a7b269.png",status:"active",created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:"system",updated_by:void 0,metadata:{instructions:null},connections:[]}}const p="decopilot_";function $(t){return!t||!t.startsWith(p)?null:t.slice(p.length)||null}function v(t){return`${p}${t}`}export{m as K,y as S,P as W,M as a,L as b,g as c,E as d,O as e,D as f,v as g,R as h,$ as i,I as j,S as u};
@@ -1,10 +1,10 @@
1
- import{r as I,bJ as es,bK as ts,D as as,bc as q,s as x,bL as Be,bM as Qt,bg as ss,bh as rs,bb as os,bd as B,b7 as ke,ak as $e,o as j,be as S,bf as ue,bN as ns,bO as k,al as is,br as ls,c as D,u as be,K as ye,e as Xt,m as We,t as Te,j as d,b as cs,O as us,d as ds}from"./index-p3omciU2.js";import{u as ft,a as ht,d as ps}from"./constants-DisK0xae.js";import{b as ms}from"./use-virtual-mcp-gsGIP_cY.js";import{A as Nt,D as Ke}from"./decopilot-events-Brt4gAR6.js";import{u as gt,a as fs}from"./use-llm-DTPk3_13.js";import{u as hs}from"./useQuery-KFMXc5Td.js";import{u as qe,L as vt}from"./localstorage-keys-DIWr3Ek_.js";import{E as yt}from"./error-boundary-CgOqOmL9.js";import{S as U,u as gs}from"./skeleton-DQTz2Cfy.js";import{c as Kt,B as ot}from"./button-SrN4bZ1L.js";import{I as vs}from"./input-C19rUyj9.js";import{P as ys,a as xs,b as bs}from"./popover-Bz-dtYC4.js";import{S as _s,a as Es,b as Ss,c as Is,d as ws}from"./select-DFuMzqKt.js";import{i as Ts}from"./AlertTriangle-DiiOmxZ5.js";import{t as nt}from"./ChevronDown-CrA0GhEu.js";import{i as Ns}from"./File06-CN-CUlfW.js";import{c as Cs}from"./Grid01-BfcTdCmK.js";import{a as As}from"./Image01-DiX4EYL6.js";import{s as Ms}from"./RefreshCcw01-BU6Us9RR.js";import{i as ea}from"./SearchMd-C4hV7R8V.js";import{t as Rs}from"./Settings01-KIfOk1bg.js";import{b as xt,c as js,a as ks,e as Os}from"./use-connection-DkSSfi9a.js";import{u as Ps}from"./useSuspenseInfiniteQuery-Cw1MYhE7.js";var Oe;(function(t){t.assertEqual=r=>{};function e(r){}t.assertIs=e;function a(r){throw new Error}t.assertNever=a,t.arrayToEnum=r=>{const o={};for(const i of r)o[i]=i;return o},t.getValidEnumValues=r=>{const o=t.objectKeys(r).filter(n=>typeof r[r[n]]!="number"),i={};for(const n of o)i[n]=r[n];return t.objectValues(i)},t.objectValues=r=>t.objectKeys(r).map(function(o){return r[o]}),t.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{const o=[];for(const i in r)Object.prototype.hasOwnProperty.call(r,i)&&o.push(i);return o},t.find=(r,o)=>{for(const i of r)if(o(i))return i},t.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&Number.isFinite(r)&&Math.floor(r)===r;function s(r,o=" | "){return r.map(i=>typeof i=="string"?`'${i}'`:i).join(o)}t.joinValues=s,t.jsonStringifyReplacer=(r,o)=>typeof o=="bigint"?o.toString():o})(Oe||(Oe={}));var Ct;(function(t){t.mergeShapes=(e,a)=>({...e,...a})})(Ct||(Ct={}));Oe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);Oe.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class He extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};const a=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,a):this.__proto__=a,this.name="ZodError",this.issues=e}format(e){const a=e||function(o){return o.message},s={_errors:[]},r=o=>{for(const i of o.issues)if(i.code==="invalid_union")i.unionErrors.map(r);else if(i.code==="invalid_return_type")r(i.returnTypeError);else if(i.code==="invalid_arguments")r(i.argumentsError);else if(i.path.length===0)s._errors.push(a(i));else{let n=s,c=0;for(;c<i.path.length;){const l=i.path[c];c===i.path.length-1?(n[l]=n[l]||{_errors:[]},n[l]._errors.push(a(i))):n[l]=n[l]||{_errors:[]},n=n[l],c++}}};return r(this),s}static assert(e){if(!(e instanceof He))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Oe.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=a=>a.message){const a=Object.create(null),s=[];for(const r of this.issues)if(r.path.length>0){const o=r.path[0];a[o]=a[o]||[],a[o].push(e(r))}else s.push(e(r));return{formErrors:s,fieldErrors:a}}get formErrors(){return this.flatten()}}He.create=t=>new He(t);var At;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(At||(At={}));var T;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(T||(T={}));const ta=({size:t=24,color:e="currentColor",...a})=>I.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...a},I.createElement("path",{d:"m7 15 5 5 5-5M7 9l5-5 5 5"}));ta.displayName="ChevronSelectorVertical";const aa=({size:t=24,color:e="currentColor",...a})=>I.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...a},I.createElement("path",{d:"M6 16a4 4 0 0 0 4 4h4a4 4 0 0 0 0-8h-4a4 4 0 0 1 0-8h4a4 4 0 0 1 4 4m-6-6v20"}));aa.displayName="CurrencyDollar";const sa=({size:t=24,color:e="currentColor",...a})=>I.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...a},I.createElement("path",{d:"m18 8 4 4m0 0-4 4m4-4H9m6-7.796A8.383 8.383 0 0 0 10.667 3C5.88 3 2 7.03 2 12s3.88 9 8.667 9A8.384 8.384 0 0 0 15 19.796"}));sa.displayName="LogOut04";const ra=({size:t=24,color:e="currentColor",...a})=>I.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...a},I.createElement("path",{d:"m6.5 13 .784 1.569c.266.53.399.796.576 1.026a3 3 0 0 0 .545.545c.23.177.495.31 1.026.575L11 17.5l-1.569.785c-.53.265-.796.398-1.026.575a3 3 0 0 0-.545.545c-.177.23-.31.495-.576 1.026L6.5 22l-.784-1.569c-.266-.53-.399-.796-.576-1.026a3 3 0 0 0-.545-.545c-.23-.177-.495-.31-1.026-.575L2 17.5l1.569-.785c.53-.265.796-.398 1.026-.575a3 3 0 0 0 .545-.545c.177-.23.31-.495.576-1.026L6.5 13ZM15 2l1.179 3.064c.282.734.423 1.1.642 1.409a3 3 0 0 0 .706.706c.309.22.675.36 1.409.642L22 9l-3.064 1.179c-.734.282-1.1.423-1.409.642a3 3 0 0 0-.706.706c-.22.309-.36.675-.642 1.409L15 16l-1.179-3.064c-.282-.734-.423-1.1-.642-1.409a3 3 0 0 0-.706-.706c-.309-.22-.675-.36-1.409-.642L8 9l3.064-1.179c.734-.282 1.1-.423 1.409-.642a3 3 0 0 0 .706-.706c.22-.309.36-.675.642-1.409L15 2Z"}));ra.displayName="Stars01";var oa="vercel.ai.error",Ds=Symbol.for(oa),Mt,Rt,K=class na extends(Rt=Error,Mt=Ds,Rt){constructor({name:e,message:a,cause:s}){super(a),this[Mt]=!0,this.name=e,this.cause=s}static isInstance(e){return na.hasMarker(e,oa)}static hasMarker(e,a){const s=Symbol.for(a);return e!=null&&typeof e=="object"&&s in e&&typeof e[s]=="boolean"&&e[s]===!0}};function ia(t){return t==null?"unknown error":typeof t=="string"?t:t instanceof Error?t.message:JSON.stringify(t)}var la="AI_InvalidArgumentError",ca=`vercel.ai.error.${la}`,$s=Symbol.for(ca),jt,kt,Ls=class extends(kt=K,jt=$s,kt){constructor({message:t,cause:e,argument:a}){super({name:la,message:t,cause:e}),this[jt]=!0,this.argument=a}static isInstance(t){return K.hasMarker(t,ca)}},ua="AI_JSONParseError",da=`vercel.ai.error.${ua}`,Zs=Symbol.for(da),Ot,Pt,Dt=class extends(Pt=K,Ot=Zs,Pt){constructor({text:t,cause:e}){super({name:ua,message:`JSON parsing failed: Text: ${t}.
1
+ import{r as I,c5 as es,c6 as ts,D as as,bA as q,s as x,c7 as Be,c8 as Qt,bE as ss,bF as rs,bz as os,bB as B,bv as ke,ak as $e,o as j,bC as S,bD as ue,c9 as ns,ca as k,al as is,bP as ls,c as D,u as be,K as ye,e as Xt,m as We,t as Te,j as d,b as cs,O as us,d as ds}from"./index-BDPRLX-4.js";import{u as ft,a as ht,d as ps}from"./constants-DEI8O4hQ.js";import{b as ms}from"./use-virtual-mcp-DH4qIlbr.js";import{A as Nt,D as Ke}from"./decopilot-events-Brt4gAR6.js";import{u as gt,a as fs}from"./use-llm-Bv-6sCcC.js";import{u as hs}from"./useQuery-Cf9H-zdg.js";import{u as qe,L as vt}from"./localstorage-keys-DPvmMmhc.js";import{E as yt}from"./error-boundary-zygCkG0M.js";import{S as U,u as gs}from"./skeleton-DNzAW1SF.js";import{c as Kt,B as ot}from"./button-TXPV9u45.js";import{I as vs}from"./input-D_ph6wQi.js";import{P as ys,a as xs,b as bs}from"./popover-Dt4_z2id.js";import{S as _s,a as Es,b as Ss,c as Is,d as ws}from"./select-DNtTB4Bo.js";import{i as Ts}from"./AlertTriangle-BauDdA9B.js";import{t as nt}from"./ChevronDown-Bvtjl1_J.js";import{i as Ns}from"./File06-CkssxHwK.js";import{c as Cs}from"./Grid01-BHkfA168.js";import{a as As}from"./Image01-BNys_Mns.js";import{s as Ms}from"./RefreshCcw01-Ce4Zz6-L.js";import{i as ea}from"./SearchMd-7zTlMjUG.js";import{t as Rs}from"./Settings01-DnNomfd3.js";import{b as xt,c as js,a as ks,e as Os}from"./use-connection-DtRMRT7L.js";import{u as Ps}from"./useSuspenseInfiniteQuery-BvCS7sCC.js";var Oe;(function(t){t.assertEqual=r=>{};function e(r){}t.assertIs=e;function a(r){throw new Error}t.assertNever=a,t.arrayToEnum=r=>{const o={};for(const i of r)o[i]=i;return o},t.getValidEnumValues=r=>{const o=t.objectKeys(r).filter(n=>typeof r[r[n]]!="number"),i={};for(const n of o)i[n]=r[n];return t.objectValues(i)},t.objectValues=r=>t.objectKeys(r).map(function(o){return r[o]}),t.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{const o=[];for(const i in r)Object.prototype.hasOwnProperty.call(r,i)&&o.push(i);return o},t.find=(r,o)=>{for(const i of r)if(o(i))return i},t.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&Number.isFinite(r)&&Math.floor(r)===r;function s(r,o=" | "){return r.map(i=>typeof i=="string"?`'${i}'`:i).join(o)}t.joinValues=s,t.jsonStringifyReplacer=(r,o)=>typeof o=="bigint"?o.toString():o})(Oe||(Oe={}));var Ct;(function(t){t.mergeShapes=(e,a)=>({...e,...a})})(Ct||(Ct={}));Oe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);Oe.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class He extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};const a=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,a):this.__proto__=a,this.name="ZodError",this.issues=e}format(e){const a=e||function(o){return o.message},s={_errors:[]},r=o=>{for(const i of o.issues)if(i.code==="invalid_union")i.unionErrors.map(r);else if(i.code==="invalid_return_type")r(i.returnTypeError);else if(i.code==="invalid_arguments")r(i.argumentsError);else if(i.path.length===0)s._errors.push(a(i));else{let n=s,c=0;for(;c<i.path.length;){const l=i.path[c];c===i.path.length-1?(n[l]=n[l]||{_errors:[]},n[l]._errors.push(a(i))):n[l]=n[l]||{_errors:[]},n=n[l],c++}}};return r(this),s}static assert(e){if(!(e instanceof He))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Oe.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=a=>a.message){const a=Object.create(null),s=[];for(const r of this.issues)if(r.path.length>0){const o=r.path[0];a[o]=a[o]||[],a[o].push(e(r))}else s.push(e(r));return{formErrors:s,fieldErrors:a}}get formErrors(){return this.flatten()}}He.create=t=>new He(t);var At;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(At||(At={}));var T;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(T||(T={}));const ta=({size:t=24,color:e="currentColor",...a})=>I.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...a},I.createElement("path",{d:"m7 15 5 5 5-5M7 9l5-5 5 5"}));ta.displayName="ChevronSelectorVertical";const aa=({size:t=24,color:e="currentColor",...a})=>I.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...a},I.createElement("path",{d:"M6 16a4 4 0 0 0 4 4h4a4 4 0 0 0 0-8h-4a4 4 0 0 1 0-8h4a4 4 0 0 1 4 4m-6-6v20"}));aa.displayName="CurrencyDollar";const sa=({size:t=24,color:e="currentColor",...a})=>I.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...a},I.createElement("path",{d:"m18 8 4 4m0 0-4 4m4-4H9m6-7.796A8.383 8.383 0 0 0 10.667 3C5.88 3 2 7.03 2 12s3.88 9 8.667 9A8.384 8.384 0 0 0 15 19.796"}));sa.displayName="LogOut04";const ra=({size:t=24,color:e="currentColor",...a})=>I.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...a},I.createElement("path",{d:"m6.5 13 .784 1.569c.266.53.399.796.576 1.026a3 3 0 0 0 .545.545c.23.177.495.31 1.026.575L11 17.5l-1.569.785c-.53.265-.796.398-1.026.575a3 3 0 0 0-.545.545c-.177.23-.31.495-.576 1.026L6.5 22l-.784-1.569c-.266-.53-.399-.796-.576-1.026a3 3 0 0 0-.545-.545c-.23-.177-.495-.31-1.026-.575L2 17.5l1.569-.785c.53-.265.796-.398 1.026-.575a3 3 0 0 0 .545-.545c.177-.23.31-.495.576-1.026L6.5 13ZM15 2l1.179 3.064c.282.734.423 1.1.642 1.409a3 3 0 0 0 .706.706c.309.22.675.36 1.409.642L22 9l-3.064 1.179c-.734.282-1.1.423-1.409.642a3 3 0 0 0-.706.706c-.22.309-.36.675-.642 1.409L15 16l-1.179-3.064c-.282-.734-.423-1.1-.642-1.409a3 3 0 0 0-.706-.706c-.309-.22-.675-.36-1.409-.642L8 9l3.064-1.179c.734-.282 1.1-.423 1.409-.642a3 3 0 0 0 .706-.706c.22-.309.36-.675.642-1.409L15 2Z"}));ra.displayName="Stars01";var oa="vercel.ai.error",Ds=Symbol.for(oa),Mt,Rt,K=class na extends(Rt=Error,Mt=Ds,Rt){constructor({name:e,message:a,cause:s}){super(a),this[Mt]=!0,this.name=e,this.cause=s}static isInstance(e){return na.hasMarker(e,oa)}static hasMarker(e,a){const s=Symbol.for(a);return e!=null&&typeof e=="object"&&s in e&&typeof e[s]=="boolean"&&e[s]===!0}};function ia(t){return t==null?"unknown error":typeof t=="string"?t:t instanceof Error?t.message:JSON.stringify(t)}var la="AI_InvalidArgumentError",ca=`vercel.ai.error.${la}`,$s=Symbol.for(ca),jt,kt,Ls=class extends(kt=K,jt=$s,kt){constructor({message:t,cause:e,argument:a}){super({name:la,message:t,cause:e}),this[jt]=!0,this.argument=a}static isInstance(t){return K.hasMarker(t,ca)}},ua="AI_JSONParseError",da=`vercel.ai.error.${ua}`,Zs=Symbol.for(da),Ot,Pt,Dt=class extends(Pt=K,Ot=Zs,Pt){constructor({text:t,cause:e}){super({name:ua,message:`JSON parsing failed: Text: ${t}.
2
2
  Error message: ${ia(e)}`,cause:e}),this[Ot]=!0,this.text=t}static isInstance(t){return K.hasMarker(t,da)}},pa="AI_TypeValidationError",ma=`vercel.ai.error.${pa}`,Fs=Symbol.for(ma),$t,Lt,Ne=class it extends(Lt=K,$t=Fs,Lt){constructor({value:e,cause:a,context:s}){let r="Type validation failed";if(s?.field&&(r+=` for ${s.field}`),s?.entityName||s?.entityId){r+=" (";const o=[];s.entityName&&o.push(s.entityName),s.entityId&&o.push(`id: "${s.entityId}"`),r+=o.join(", "),r+=")"}super({name:pa,message:`${r}: Value: ${JSON.stringify(e)}.
3
3
  Error message: ${ia(a)}`,cause:a}),this[$t]=!0,this.value=e,this.context=s}static isInstance(e){return K.hasMarker(e,ma)}static wrap({value:e,cause:a,context:s}){var r,o,i;return it.isInstance(a)&&a.value===e&&((r=a.context)==null?void 0:r.field)===s?.field&&((o=a.context)==null?void 0:o.entityName)===s?.entityName&&((i=a.context)==null?void 0:i.entityId)===s?.entityId?a:new it({value:e,cause:a,context:s})}},Le=({prefix:t,size:e=16,alphabet:a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:s="-"}={})=>{const r=()=>{const o=a.length,i=new Array(e);for(let n=0;n<e;n++)i[n]=a[Math.random()*o|0];return i.join("")};if(t==null)return r;if(a.includes(s))throw new Ls({argument:"separator",message:`The separator "${s}" must not be part of the alphabet "${a}".`});return()=>`${t}${s}${r()}`},Us=Le();function Zt(t=globalThis){var e,a,s;return t.window?"runtime/browser":(e=t.navigator)!=null&&e.userAgent?`runtime/${t.navigator.userAgent.toLowerCase()}`:(s=(a=t.process)==null?void 0:a.versions)!=null&&s.node?`runtime/node.js/${t.process.version.substring(0)}`:t.EdgeRuntime?"runtime/vercel-edge":"runtime/unknown"}function ve(t){if(t==null)return{};const e={};if(t instanceof Headers)t.forEach((a,s)=>{e[s.toLowerCase()]=a});else{Array.isArray(t)||(t=Object.entries(t));for(const[a,s]of t)s!=null&&(e[a.toLowerCase()]=s)}return e}function Ft(t,...e){const a=new Headers(ve(t)),s=a.get("user-agent")||"";return a.set("user-agent",[s,...e].filter(Boolean).join(" ")),Object.fromEntries(a.entries())}var zs=/"__proto__"\s*:/,Vs=/"constructor"\s*:/;function Ut(t){const e=JSON.parse(t);return e===null||typeof e!="object"||zs.test(t)===!1&&Vs.test(t)===!1?e:Bs(e)}function Bs(t){let e=[t];for(;e.length;){const a=e;e=[];for(const s of a){if(Object.prototype.hasOwnProperty.call(s,"__proto__"))throw new SyntaxError("Object contains forbidden prototype property");if(Object.prototype.hasOwnProperty.call(s,"constructor")&&Object.prototype.hasOwnProperty.call(s.constructor,"prototype"))throw new SyntaxError("Object contains forbidden prototype property");for(const r in s){const o=s[r];o&&typeof o=="object"&&e.push(o)}}}return t}function qs(t){const{stackTraceLimit:e}=Error;try{Error.stackTraceLimit=0}catch{return Ut(t)}try{return Ut(t)}finally{Error.stackTraceLimit=e}}function bt(t){if(t.type==="object"||Array.isArray(t.type)&&t.type.includes("object")){t.additionalProperties=!1;const{properties:a}=t;if(a!=null)for(const s of Object.keys(a))a[s]=ge(a[s])}t.items!=null&&(t.items=Array.isArray(t.items)?t.items.map(ge):ge(t.items)),t.anyOf!=null&&(t.anyOf=t.anyOf.map(ge)),t.allOf!=null&&(t.allOf=t.allOf.map(ge)),t.oneOf!=null&&(t.oneOf=t.oneOf.map(ge));const{definitions:e}=t;if(e!=null)for(const a of Object.keys(e))e[a]=ge(e[a]);return t}function ge(t){return typeof t=="boolean"?t:bt(t)}var Hs=Symbol("Let zodToJsonSchema decide on which parser to use"),zt={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"},Ws=t=>typeof t=="string"?{...zt,name:t}:{...zt,...t};function W(){return{}}function Js(t,e){var a,s,r;const o={type:"array"};return(a=t.type)!=null&&a._def&&((r=(s=t.type)==null?void 0:s._def)==null?void 0:r.typeName)!==T.ZodAny&&(o.items=R(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&(o.minItems=t.minLength.value),t.maxLength&&(o.maxItems=t.maxLength.value),t.exactLength&&(o.minItems=t.exactLength.value,o.maxItems=t.exactLength.value),o}function Gs(t){const e={type:"integer",format:"int64"};if(!t.checks)return e;for(const a of t.checks)switch(a.kind){case"min":a.inclusive?e.minimum=a.value:e.exclusiveMinimum=a.value;break;case"max":a.inclusive?e.maximum=a.value:e.exclusiveMaximum=a.value;break;case"multipleOf":e.multipleOf=a.value;break}return e}function Ys(){return{type:"boolean"}}function fa(t,e){return R(t.type._def,e)}var Qs=(t,e)=>R(t.innerType._def,e);function ha(t,e,a){const s=a??e.dateStrategy;if(Array.isArray(s))return{anyOf:s.map((r,o)=>ha(t,e,r))};switch(s){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return Xs(t)}}var Xs=t=>{const e={type:"integer",format:"unix-time"};for(const a of t.checks)switch(a.kind){case"min":e.minimum=a.value;break;case"max":e.maximum=a.value;break}return e};function Ks(t,e){return{...R(t.innerType._def,e),default:t.defaultValue()}}function er(t,e){return e.effectStrategy==="input"?R(t.schema._def,e):W()}function tr(t){return{type:"string",enum:Array.from(t.values)}}var ar=t=>"type"in t&&t.type==="string"?!1:"allOf"in t;function sr(t,e){const a=[R(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),R(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(r=>!!r),s=[];return a.forEach(r=>{if(ar(r))s.push(...r.allOf);else{let o=r;if("additionalProperties"in r&&r.additionalProperties===!1){const{additionalProperties:i,...n}=r;o=n}s.push(o)}}),s.length?{allOf:s}:void 0}function rr(t){const e=typeof t.value;return e!=="bigint"&&e!=="number"&&e!=="boolean"&&e!=="string"?{type:Array.isArray(t.value)?"array":"object"}:{type:e==="bigint"?"integer":e,const:t.value}}var et=void 0,G={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(et===void 0&&(et=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),et),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function ga(t,e){const a={type:"string"};if(t.checks)for(const s of t.checks)switch(s.kind){case"min":a.minLength=typeof a.minLength=="number"?Math.max(a.minLength,s.value):s.value;break;case"max":a.maxLength=typeof a.maxLength=="number"?Math.min(a.maxLength,s.value):s.value;break;case"email":switch(e.emailStrategy){case"format:email":Y(a,"email",s.message,e);break;case"format:idn-email":Y(a,"idn-email",s.message,e);break;case"pattern:zod":V(a,G.email,s.message,e);break}break;case"url":Y(a,"uri",s.message,e);break;case"uuid":Y(a,"uuid",s.message,e);break;case"regex":V(a,s.regex,s.message,e);break;case"cuid":V(a,G.cuid,s.message,e);break;case"cuid2":V(a,G.cuid2,s.message,e);break;case"startsWith":V(a,RegExp(`^${tt(s.value,e)}`),s.message,e);break;case"endsWith":V(a,RegExp(`${tt(s.value,e)}$`),s.message,e);break;case"datetime":Y(a,"date-time",s.message,e);break;case"date":Y(a,"date",s.message,e);break;case"time":Y(a,"time",s.message,e);break;case"duration":Y(a,"duration",s.message,e);break;case"length":a.minLength=typeof a.minLength=="number"?Math.max(a.minLength,s.value):s.value,a.maxLength=typeof a.maxLength=="number"?Math.min(a.maxLength,s.value):s.value;break;case"includes":{V(a,RegExp(tt(s.value,e)),s.message,e);break}case"ip":{s.version!=="v6"&&Y(a,"ipv4",s.message,e),s.version!=="v4"&&Y(a,"ipv6",s.message,e);break}case"base64url":V(a,G.base64url,s.message,e);break;case"jwt":V(a,G.jwt,s.message,e);break;case"cidr":{s.version!=="v6"&&V(a,G.ipv4Cidr,s.message,e),s.version!=="v4"&&V(a,G.ipv6Cidr,s.message,e);break}case"emoji":V(a,G.emoji(),s.message,e);break;case"ulid":{V(a,G.ulid,s.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{Y(a,"binary",s.message,e);break}case"contentEncoding:base64":{a.contentEncoding="base64";break}case"pattern:zod":{V(a,G.base64,s.message,e);break}}break}case"nanoid":V(a,G.nanoid,s.message,e)}return a}function tt(t,e){return e.patternStrategy==="escape"?nr(t):t}var or=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function nr(t){let e="";for(let a=0;a<t.length;a++)or.has(t[a])||(e+="\\"),e+=t[a];return e}function Y(t,e,a,s){var r;t.format||(r=t.anyOf)!=null&&r.some(o=>o.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push({format:t.format}),delete t.format),t.anyOf.push({format:e,...a&&s.errorMessages&&{errorMessage:{format:a}}})):t.format=e}function V(t,e,a,s){var r;t.pattern||(r=t.allOf)!=null&&r.some(o=>o.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern}),delete t.pattern),t.allOf.push({pattern:Vt(e,s),...a&&s.errorMessages&&{errorMessage:{pattern:a}}})):t.pattern=Vt(e,s)}function Vt(t,e){var a;if(!e.applyRegexFlags||!t.flags)return t.source;const s={i:t.flags.includes("i"),m:t.flags.includes("m"),s:t.flags.includes("s")},r=s.i?t.source.toLowerCase():t.source;let o="",i=!1,n=!1,c=!1;for(let l=0;l<r.length;l++){if(i){o+=r[l],i=!1;continue}if(s.i){if(n){if(r[l].match(/[a-z]/)){c?(o+=r[l],o+=`${r[l-2]}-${r[l]}`.toUpperCase(),c=!1):r[l+1]==="-"&&((a=r[l+2])!=null&&a.match(/[a-z]/))?(o+=r[l],c=!0):o+=`${r[l]}${r[l].toUpperCase()}`;continue}}else if(r[l].match(/[a-z]/)){o+=`[${r[l]}${r[l].toUpperCase()}]`;continue}}if(s.m){if(r[l]==="^"){o+=`(^|(?<=[\r
4
4
  ]))`;continue}else if(r[l]==="$"){o+=`($|(?=[\r
5
5
  ]))`;continue}}if(s.s&&r[l]==="."){o+=n?`${r[l]}\r
6
6
  `:`[${r[l]}\r
7
- ]`;continue}o+=r[l],r[l]==="\\"?i=!0:n&&r[l]==="]"?n=!1:!n&&r[l]==="["&&(n=!0)}try{new RegExp(o)}catch{return console.warn(`Could not convert regex pattern at ${e.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),t.source}return o}function va(t,e){var a,s,r,o,i,n;const c={type:"object",additionalProperties:(a=R(t.valueType._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]}))!=null?a:e.allowedAdditionalProperties};if(((s=t.keyType)==null?void 0:s._def.typeName)===T.ZodString&&((r=t.keyType._def.checks)!=null&&r.length)){const{type:l,...p}=ga(t.keyType._def,e);return{...c,propertyNames:p}}else{if(((o=t.keyType)==null?void 0:o._def.typeName)===T.ZodEnum)return{...c,propertyNames:{enum:t.keyType._def.values}};if(((i=t.keyType)==null?void 0:i._def.typeName)===T.ZodBranded&&t.keyType._def.type._def.typeName===T.ZodString&&((n=t.keyType._def.type._def.checks)!=null&&n.length)){const{type:l,...p}=fa(t.keyType._def,e);return{...c,propertyNames:p}}}return c}function ir(t,e){if(e.mapStrategy==="record")return va(t,e);const a=R(t.keyType._def,{...e,currentPath:[...e.currentPath,"items","items","0"]})||W(),s=R(t.valueType._def,{...e,currentPath:[...e.currentPath,"items","items","1"]})||W();return{type:"array",maxItems:125,items:{type:"array",items:[a,s],minItems:2,maxItems:2}}}function lr(t){const e=t.values,s=Object.keys(t.values).filter(o=>typeof e[e[o]]!="number").map(o=>e[o]),r=Array.from(new Set(s.map(o=>typeof o)));return{type:r.length===1?r[0]==="string"?"string":"number":["string","number"],enum:s}}function cr(){return{not:W()}}function ur(){return{type:"null"}}var lt={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function dr(t,e){const a=t.options instanceof Map?Array.from(t.options.values()):t.options;if(a.every(s=>s._def.typeName in lt&&(!s._def.checks||!s._def.checks.length))){const s=a.reduce((r,o)=>{const i=lt[o._def.typeName];return i&&!r.includes(i)?[...r,i]:r},[]);return{type:s.length>1?s:s[0]}}else if(a.every(s=>s._def.typeName==="ZodLiteral"&&!s.description)){const s=a.reduce((r,o)=>{const i=typeof o._def.value;switch(i){case"string":case"number":case"boolean":return[...r,i];case"bigint":return[...r,"integer"];case"object":if(o._def.value===null)return[...r,"null"];default:return r}},[]);if(s.length===a.length){const r=s.filter((o,i,n)=>n.indexOf(o)===i);return{type:r.length>1?r:r[0],enum:a.reduce((o,i)=>o.includes(i._def.value)?o:[...o,i._def.value],[])}}}else if(a.every(s=>s._def.typeName==="ZodEnum"))return{type:"string",enum:a.reduce((s,r)=>[...s,...r._def.values.filter(o=>!s.includes(o))],[])};return pr(t,e)}var pr=(t,e)=>{const a=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((s,r)=>R(s._def,{...e,currentPath:[...e.currentPath,"anyOf",`${r}`]})).filter(s=>!!s&&(!e.strictUnions||typeof s=="object"&&Object.keys(s).length>0));return a.length?{anyOf:a}:void 0};function mr(t,e){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(t.innerType._def.typeName)&&(!t.innerType._def.checks||!t.innerType._def.checks.length))return{type:[lt[t.innerType._def.typeName],"null"]};const a=R(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","0"]});return a&&{anyOf:[a,{type:"null"}]}}function fr(t){const e={type:"number"};if(!t.checks)return e;for(const a of t.checks)switch(a.kind){case"int":e.type="integer";break;case"min":a.inclusive?e.minimum=a.value:e.exclusiveMinimum=a.value;break;case"max":a.inclusive?e.maximum=a.value:e.exclusiveMaximum=a.value;break;case"multipleOf":e.multipleOf=a.value;break}return e}function hr(t,e){const a={type:"object",properties:{}},s=[],r=t.shape();for(const i in r){let n=r[i];if(n===void 0||n._def===void 0)continue;const c=vr(n),l=R(n._def,{...e,currentPath:[...e.currentPath,"properties",i],propertyPath:[...e.currentPath,"properties",i]});l!==void 0&&(a.properties[i]=l,c||s.push(i))}s.length&&(a.required=s);const o=gr(t,e);return o!==void 0&&(a.additionalProperties=o),a}function gr(t,e){if(t.catchall._def.typeName!=="ZodNever")return R(t.catchall._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]});switch(t.unknownKeys){case"passthrough":return e.allowedAdditionalProperties;case"strict":return e.rejectedAdditionalProperties;case"strip":return e.removeAdditionalStrategy==="strict"?e.allowedAdditionalProperties:e.rejectedAdditionalProperties}}function vr(t){try{return t.isOptional()}catch{return!0}}var yr=(t,e)=>{var a;if(e.currentPath.toString()===((a=e.propertyPath)==null?void 0:a.toString()))return R(t.innerType._def,e);const s=R(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","1"]});return s?{anyOf:[{not:W()},s]}:W()},xr=(t,e)=>{if(e.pipeStrategy==="input")return R(t.in._def,e);if(e.pipeStrategy==="output")return R(t.out._def,e);const a=R(t.in._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),s=R(t.out._def,{...e,currentPath:[...e.currentPath,"allOf",a?"1":"0"]});return{allOf:[a,s].filter(r=>r!==void 0)}};function br(t,e){return R(t.type._def,e)}function _r(t,e){const s={type:"array",uniqueItems:!0,items:R(t.valueType._def,{...e,currentPath:[...e.currentPath,"items"]})};return t.minSize&&(s.minItems=t.minSize.value),t.maxSize&&(s.maxItems=t.maxSize.value),s}function Er(t,e){return t.rest?{type:"array",minItems:t.items.length,items:t.items.map((a,s)=>R(a._def,{...e,currentPath:[...e.currentPath,"items",`${s}`]})).reduce((a,s)=>s===void 0?a:[...a,s],[]),additionalItems:R(t.rest._def,{...e,currentPath:[...e.currentPath,"additionalItems"]})}:{type:"array",minItems:t.items.length,maxItems:t.items.length,items:t.items.map((a,s)=>R(a._def,{...e,currentPath:[...e.currentPath,"items",`${s}`]})).reduce((a,s)=>s===void 0?a:[...a,s],[])}}function Sr(){return{not:W()}}function Ir(){return W()}var wr=(t,e)=>R(t.innerType._def,e),Tr=(t,e,a)=>{switch(e){case T.ZodString:return ga(t,a);case T.ZodNumber:return fr(t);case T.ZodObject:return hr(t,a);case T.ZodBigInt:return Gs(t);case T.ZodBoolean:return Ys();case T.ZodDate:return ha(t,a);case T.ZodUndefined:return Sr();case T.ZodNull:return ur();case T.ZodArray:return Js(t,a);case T.ZodUnion:case T.ZodDiscriminatedUnion:return dr(t,a);case T.ZodIntersection:return sr(t,a);case T.ZodTuple:return Er(t,a);case T.ZodRecord:return va(t,a);case T.ZodLiteral:return rr(t);case T.ZodEnum:return tr(t);case T.ZodNativeEnum:return lr(t);case T.ZodNullable:return mr(t,a);case T.ZodOptional:return yr(t,a);case T.ZodMap:return ir(t,a);case T.ZodSet:return _r(t,a);case T.ZodLazy:return()=>t.getter()._def;case T.ZodPromise:return br(t,a);case T.ZodNaN:case T.ZodNever:return cr();case T.ZodEffects:return er(t,a);case T.ZodAny:return W();case T.ZodUnknown:return Ir();case T.ZodDefault:return Ks(t,a);case T.ZodBranded:return fa(t,a);case T.ZodReadonly:return wr(t,a);case T.ZodCatch:return Qs(t,a);case T.ZodPipeline:return xr(t,a);case T.ZodFunction:case T.ZodVoid:case T.ZodSymbol:return;default:return(s=>{})()}},Nr=(t,e)=>{let a=0;for(;a<t.length&&a<e.length&&t[a]===e[a];a++);return[(t.length-a).toString(),...e.slice(a)].join("/")};function R(t,e,a=!1){var s;const r=e.seen.get(t);if(e.override){const c=(s=e.override)==null?void 0:s.call(e,t,e,r,a);if(c!==Hs)return c}if(r&&!a){const c=Cr(r,e);if(c!==void 0)return c}const o={def:t,path:e.currentPath,jsonSchema:void 0};e.seen.set(t,o);const i=Tr(t,t.typeName,e),n=typeof i=="function"?R(i(),e):i;if(n&&Ar(t,e,n),e.postProcess){const c=e.postProcess(n,t,e);return o.jsonSchema=n,c}return o.jsonSchema=n,n}var Cr=(t,e)=>{switch(e.$refStrategy){case"root":return{$ref:t.path.join("/")};case"relative":return{$ref:Nr(e.currentPath,t.path)};case"none":case"seen":return t.path.length<e.currentPath.length&&t.path.every((a,s)=>e.currentPath[s]===a)?(console.warn(`Recursive reference detected at ${e.currentPath.join("/")}! Defaulting to any`),W()):e.$refStrategy==="seen"?W():void 0}},Ar=(t,e,a)=>(t.description&&(a.description=t.description),a),Mr=t=>{const e=Ws(t),a=e.name!==void 0?[...e.basePath,e.definitionPath,e.name]:e.basePath;return{...e,currentPath:a,propertyPath:void 0,seen:new Map(Object.entries(e.definitions).map(([s,r])=>[r._def,{def:r._def,path:[...e.basePath,e.definitionPath,s],jsonSchema:void 0}]))}},Rr=(t,e)=>{var a;const s=Mr(e);let r=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((l,[p,m])=>{var g;return{...l,[p]:(g=R(m._def,{...s,currentPath:[...s.basePath,s.definitionPath,p]},!0))!=null?g:W()}},{}):void 0;const o=typeof e=="string"?e:e?.nameStrategy==="title"?void 0:e?.name,i=(a=R(t._def,o===void 0?s:{...s,currentPath:[...s.basePath,s.definitionPath,o]},!1))!=null?a:W(),n=typeof e=="object"&&e.name!==void 0&&e.nameStrategy==="title"?e.name:void 0;n!==void 0&&(i.title=n);const c=o===void 0?r?{...i,[s.definitionPath]:r}:i:{$ref:[...s.$refStrategy==="relative"?[]:s.basePath,s.definitionPath,o].join("/"),[s.definitionPath]:{...r,[o]:i}};return c.$schema="http://json-schema.org/draft-07/schema#",c},ct=Symbol.for("vercel.ai.schema");function jr(t){let e;return()=>(e==null&&(e=t()),e)}function Je(t,{validate:e}={}){return{[ct]:!0,_type:void 0,get jsonSchema(){return typeof t=="function"&&(t=t()),t},validate:e}}function kr(t){return typeof t=="object"&&t!==null&&ct in t&&t[ct]===!0&&"jsonSchema"in t&&"validate"in t}function _t(t){return t==null?Je({properties:{},additionalProperties:!1}):kr(t)?t:"~standard"in t?t["~standard"].vendor==="zod"?ya(t):Or(t):t()}function Or(t){return Je(()=>bt(t["~standard"].jsonSchema.input({target:"draft-07"})),{validate:async e=>{const a=await t["~standard"].validate(e);return"value"in a?{success:!0,value:a.value}:{success:!1,error:new Ne({value:e,cause:a.issues})}}})}function Pr(t,e){var a;const s=(a=void 0)!=null?a:!1;return Je(()=>Rr(t,{$refStrategy:s?"root":"none"}),{validate:async r=>{const o=await t.safeParseAsync(r);return o.success?{success:!0,value:o.data}:{success:!1,error:o.error}}})}function Dr(t,e){var a;const s=(a=void 0)!=null?a:!1;return Je(()=>bt(as(t,{target:"draft-7",io:"input",reused:s?"ref":"inline"})),{validate:async r=>{const o=await ts(t,r);return o.success?{success:!0,value:o.data}:{success:!1,error:o.error}}})}function $r(t){return"_zod"in t}function ya(t,e){return $r(t)?Dr(t):Pr(t)}async function Bt({value:t,schema:e,context:a}){const s=await Pe({value:t,schema:e,context:a});if(!s.success)throw Ne.wrap({value:t,cause:s.error,context:a});return s.value}async function Pe({value:t,schema:e,context:a}){const s=_t(e);try{if(s.validate==null)return{success:!0,value:t,rawValue:t};const r=await s.validate(t);return r.success?{success:!0,value:r.value,rawValue:t}:{success:!1,error:Ne.wrap({value:t,cause:r.error,context:a}),rawValue:t}}catch(r){return{success:!1,error:Ne.wrap({value:t,cause:r,context:a}),rawValue:t}}}async function xe({text:t,schema:e}){try{const a=qs(t);return e==null?{success:!0,value:a,rawValue:a}:await Pe({value:a,schema:e})}catch(a){return{success:!1,error:Dt.isInstance(a)?a:new Dt({text:t,cause:a}),rawValue:void 0}}}function Lr({stream:t,schema:e}){return t.pipeThrough(new TextDecoderStream).pipeThrough(new es).pipeThrough(new TransformStream({async transform({data:a},s){a!=="[DONE]"&&s.enqueue(await xe({text:a,schema:e}))}}))}async function pe(t){return typeof t=="function"&&(t=t()),Promise.resolve(t)}var Zr=Object.defineProperty,Fr=(t,e)=>{for(var a in e)Zr(t,a,{get:e[a],enumerable:!0})},xa="AI_NoObjectGeneratedError",ba=`vercel.ai.error.${xa}`,Ur=Symbol.for(ba),_a,me=class extends K{constructor({message:t="No object generated.",cause:e,text:a,response:s,usage:r,finishReason:o}){super({name:xa,message:t,cause:e}),this[_a]=!0,this.text=a,this.response=s,this.usage=r,this.finishReason=o}static isInstance(t){return K.hasMarker(t,ba)}};_a=Ur;var Ea="AI_UIMessageStreamError",Sa=`vercel.ai.error.${Ea}`,zr=Symbol.for(Sa),Ia,Se=class extends K{constructor({chunkType:t,chunkId:e,message:a}){super({name:Ea,message:a}),this[Ia]=!0,this.chunkType=t,this.chunkId=e}static isInstance(t){return K.hasMarker(t,Sa)}};Ia=zr;var qt="6.0.106",wa=q([x(),Be(Uint8Array),Be(ArrayBuffer),Qt(t=>{var e,a;return(a=(e=globalThis.Buffer)==null?void 0:e.isBuffer(t))!=null?a:!1},{message:"Must be a Buffer"})]),De=ss(()=>q([rs(),x(),os(),B(),ke(x(),De.optional()),$e(De)])),M=ke(x(),ke(x(),De.optional())),Ta=j({type:S("text"),text:x(),providerOptions:M.optional()}),Vr=j({type:S("image"),image:q([wa,Be(URL)]),mediaType:x().optional(),providerOptions:M.optional()}),Na=j({type:S("file"),data:q([wa,Be(URL)]),filename:x().optional(),mediaType:x(),providerOptions:M.optional()}),Br=j({type:S("reasoning"),text:x(),providerOptions:M.optional()}),qr=j({type:S("tool-call"),toolCallId:x(),toolName:x(),input:ue(),providerOptions:M.optional(),providerExecuted:B().optional()}),Hr=ns("type",[j({type:S("text"),value:x(),providerOptions:M.optional()}),j({type:S("json"),value:De,providerOptions:M.optional()}),j({type:S("execution-denied"),reason:x().optional(),providerOptions:M.optional()}),j({type:S("error-text"),value:x(),providerOptions:M.optional()}),j({type:S("error-json"),value:De,providerOptions:M.optional()}),j({type:S("content"),value:$e(q([j({type:S("text"),text:x(),providerOptions:M.optional()}),j({type:S("media"),data:x(),mediaType:x()}),j({type:S("file-data"),data:x(),mediaType:x(),filename:x().optional(),providerOptions:M.optional()}),j({type:S("file-url"),url:x(),providerOptions:M.optional()}),j({type:S("file-id"),fileId:q([x(),ke(x(),x())]),providerOptions:M.optional()}),j({type:S("image-data"),data:x(),mediaType:x(),providerOptions:M.optional()}),j({type:S("image-url"),url:x(),providerOptions:M.optional()}),j({type:S("image-file-id"),fileId:q([x(),ke(x(),x())]),providerOptions:M.optional()}),j({type:S("custom"),providerOptions:M.optional()})]))})]),Ca=j({type:S("tool-result"),toolCallId:x(),toolName:x(),output:Hr,providerOptions:M.optional()}),Wr=j({type:S("tool-approval-request"),approvalId:x(),toolCallId:x()}),Jr=j({type:S("tool-approval-response"),approvalId:x(),approved:B(),reason:x().optional()}),Gr=j({role:S("system"),content:x(),providerOptions:M.optional()}),Yr=j({role:S("user"),content:q([x(),$e(q([Ta,Vr,Na]))]),providerOptions:M.optional()}),Qr=j({role:S("assistant"),content:q([x(),$e(q([Ta,Na,Br,qr,Ca,Wr]))]),providerOptions:M.optional()}),Xr=j({role:S("tool"),content:$e(q([Ca,Jr])),providerOptions:M.optional()});q([Gr,Yr,Qr,Xr]);function Aa(t,e){if(t===void 0&&e===void 0)return;if(t===void 0)return e;if(e===void 0)return t;const a={...t};for(const s in e)if(Object.prototype.hasOwnProperty.call(e,s)){const r=e[s];if(r===void 0)continue;const o=s in t?t[s]:void 0,i=r!==null&&typeof r=="object"&&!Array.isArray(r)&&!(r instanceof Date)&&!(r instanceof RegExp),n=o!=null&&typeof o=="object"&&!Array.isArray(o)&&!(o instanceof Date)&&!(o instanceof RegExp);i&&n?a[s]=Aa(o,r):a[s]=r}return a}var Kr={};Fr(Kr,{array:()=>so,choice:()=>ro,json:()=>oo,object:()=>ao,text:()=>to});function eo(t){const e=["ROOT"];let a=-1,s=null;function r(c,l,p){switch(c){case'"':{a=l,e.pop(),e.push(p),e.push("INSIDE_STRING");break}case"f":case"t":case"n":{a=l,s=l,e.pop(),e.push(p),e.push("INSIDE_LITERAL");break}case"-":{e.pop(),e.push(p),e.push("INSIDE_NUMBER");break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{a=l,e.pop(),e.push(p),e.push("INSIDE_NUMBER");break}case"{":{a=l,e.pop(),e.push(p),e.push("INSIDE_OBJECT_START");break}case"[":{a=l,e.pop(),e.push(p),e.push("INSIDE_ARRAY_START");break}}}function o(c,l){switch(c){case",":{e.pop(),e.push("INSIDE_OBJECT_AFTER_COMMA");break}case"}":{a=l,e.pop();break}}}function i(c,l){switch(c){case",":{e.pop(),e.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{a=l,e.pop();break}}}for(let c=0;c<t.length;c++){const l=t[c];switch(e[e.length-1]){case"ROOT":r(l,c,"FINISH");break;case"INSIDE_OBJECT_START":{switch(l){case'"':{e.pop(),e.push("INSIDE_OBJECT_KEY");break}case"}":{a=c,e.pop();break}}break}case"INSIDE_OBJECT_AFTER_COMMA":{l==='"'&&(e.pop(),e.push("INSIDE_OBJECT_KEY"));break}case"INSIDE_OBJECT_KEY":{l==='"'&&(e.pop(),e.push("INSIDE_OBJECT_AFTER_KEY"));break}case"INSIDE_OBJECT_AFTER_KEY":{l===":"&&(e.pop(),e.push("INSIDE_OBJECT_BEFORE_VALUE"));break}case"INSIDE_OBJECT_BEFORE_VALUE":{r(l,c,"INSIDE_OBJECT_AFTER_VALUE");break}case"INSIDE_OBJECT_AFTER_VALUE":{o(l,c);break}case"INSIDE_STRING":{switch(l){case'"':{e.pop(),a=c;break}case"\\":{e.push("INSIDE_STRING_ESCAPE");break}default:a=c}break}case"INSIDE_ARRAY_START":{l==="]"?(a=c,e.pop()):(a=c,r(l,c,"INSIDE_ARRAY_AFTER_VALUE"));break}case"INSIDE_ARRAY_AFTER_VALUE":{switch(l){case",":{e.pop(),e.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{a=c,e.pop();break}default:{a=c;break}}break}case"INSIDE_ARRAY_AFTER_COMMA":{r(l,c,"INSIDE_ARRAY_AFTER_VALUE");break}case"INSIDE_STRING_ESCAPE":{e.pop(),a=c;break}case"INSIDE_NUMBER":{switch(l){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{a=c;break}case"e":case"E":case"-":case".":break;case",":{e.pop(),e[e.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&i(l,c),e[e.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&o(l,c);break}case"}":{e.pop(),e[e.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&o(l,c);break}case"]":{e.pop(),e[e.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&i(l,c);break}default:{e.pop();break}}break}case"INSIDE_LITERAL":{const m=t.substring(s,c+1);!"false".startsWith(m)&&!"true".startsWith(m)&&!"null".startsWith(m)?(e.pop(),e[e.length-1]==="INSIDE_OBJECT_AFTER_VALUE"?o(l,c):e[e.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&i(l,c)):a=c;break}}}let n=t.slice(0,a+1);for(let c=e.length-1;c>=0;c--)switch(e[c]){case"INSIDE_STRING":{n+='"';break}case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":{n+="}";break}case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":{n+="]";break}case"INSIDE_LITERAL":{const p=t.substring(s,t.length);"true".startsWith(p)?n+="true".slice(p.length):"false".startsWith(p)?n+="false".slice(p.length):"null".startsWith(p)&&(n+="null".slice(p.length))}}return n}async function Ze(t){if(t===void 0)return{value:void 0,state:"undefined-input"};let e=await xe({text:t});return e.success?{value:e.value,state:"successful-parse"}:(e=await xe({text:eo(t)}),e.success?{value:e.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"})}var to=()=>({name:"text",responseFormat:Promise.resolve({type:"text"}),async parseCompleteOutput({text:t}){return t},async parsePartialOutput({text:t}){return{partial:t}},createElementStreamTransform(){}}),ao=({schema:t,name:e,description:a})=>{const s=_t(t);return{name:"object",responseFormat:pe(s.jsonSchema).then(r=>({type:"json",schema:r,...e!=null&&{name:e},...a!=null&&{description:a}})),async parseCompleteOutput({text:r},o){const i=await xe({text:r});if(!i.success)throw new me({message:"No object generated: could not parse the response.",cause:i.error,text:r,response:o.response,usage:o.usage,finishReason:o.finishReason});const n=await Pe({value:i.value,schema:s});if(!n.success)throw new me({message:"No object generated: response did not match schema.",cause:n.error,text:r,response:o.response,usage:o.usage,finishReason:o.finishReason});return n.value},async parsePartialOutput({text:r}){const o=await Ze(r);switch(o.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return{partial:o.value}}},createElementStreamTransform(){}}},so=({element:t,name:e,description:a})=>{const s=_t(t);return{name:"array",responseFormat:pe(s.jsonSchema).then(r=>{const{$schema:o,...i}=r;return{type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{elements:{type:"array",items:i}},required:["elements"],additionalProperties:!1},...e!=null&&{name:e},...a!=null&&{description:a}}}),async parseCompleteOutput({text:r},o){const i=await xe({text:r});if(!i.success)throw new me({message:"No object generated: could not parse the response.",cause:i.error,text:r,response:o.response,usage:o.usage,finishReason:o.finishReason});const n=i.value;if(n==null||typeof n!="object"||!("elements"in n)||!Array.isArray(n.elements))throw new me({message:"No object generated: response did not match schema.",cause:new Ne({value:n,cause:"response must be an object with an elements array"}),text:r,response:o.response,usage:o.usage,finishReason:o.finishReason});for(const c of n.elements){const l=await Pe({value:c,schema:s});if(!l.success)throw new me({message:"No object generated: response did not match schema.",cause:l.error,text:r,response:o.response,usage:o.usage,finishReason:o.finishReason})}return n.elements},async parsePartialOutput({text:r}){const o=await Ze(r);switch(o.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{const i=o.value;if(i==null||typeof i!="object"||!("elements"in i)||!Array.isArray(i.elements))return;const n=o.state==="repaired-parse"&&i.elements.length>0?i.elements.slice(0,-1):i.elements,c=[];for(const l of n){const p=await Pe({value:l,schema:s});p.success&&c.push(p.value)}return{partial:c}}}},createElementStreamTransform(){let r=0;return new TransformStream({transform({partialOutput:o},i){if(o!=null)for(;r<o.length;r++)i.enqueue(o[r])}})}}},ro=({options:t,name:e,description:a})=>({name:"choice",responseFormat:Promise.resolve({type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{result:{type:"string",enum:t}},required:["result"],additionalProperties:!1},...e!=null&&{name:e},...a!=null&&{description:a}}),async parseCompleteOutput({text:s},r){const o=await xe({text:s});if(!o.success)throw new me({message:"No object generated: could not parse the response.",cause:o.error,text:s,response:r.response,usage:r.usage,finishReason:r.finishReason});const i=o.value;if(i==null||typeof i!="object"||!("result"in i)||typeof i.result!="string"||!t.includes(i.result))throw new me({message:"No object generated: response did not match schema.",cause:new Ne({value:i,cause:"response must be an object that contains a choice value."}),text:s,response:r.response,usage:r.usage,finishReason:r.finishReason});return i.result},async parsePartialOutput({text:s}){const r=await Ze(s);switch(r.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{const o=r.value;if(o==null||typeof o!="object"||!("result"in o)||typeof o.result!="string")return;const i=t.filter(n=>n.startsWith(o.result));return r.state==="successful-parse"?i.includes(o.result)?{partial:o.result}:void 0:i.length===1?{partial:i[0]}:void 0}}},createElementStreamTransform(){}}),oo=({name:t,description:e}={})=>({name:"json",responseFormat:Promise.resolve({type:"json",...t!=null&&{name:t},...e!=null&&{description:e}}),async parseCompleteOutput({text:a},s){const r=await xe({text:a});if(!r.success)throw new me({message:"No object generated: could not parse the response.",cause:r.error,text:a,response:s.response,usage:s.usage,finishReason:s.finishReason});return r.value},async parsePartialOutput({text:a}){const s=await Ze(a);switch(s.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return s.value===void 0?void 0:{partial:s.value}}},createElementStreamTransform(){}});Le({prefix:"aitxt",size:24});(class extends TransformStream{constructor(){super({transform(t,e){e.enqueue(`data: ${JSON.stringify(t)}
7
+ ]`;continue}o+=r[l],r[l]==="\\"?i=!0:n&&r[l]==="]"?n=!1:!n&&r[l]==="["&&(n=!0)}try{new RegExp(o)}catch{return console.warn(`Could not convert regex pattern at ${e.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),t.source}return o}function va(t,e){var a,s,r,o,i,n;const c={type:"object",additionalProperties:(a=R(t.valueType._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]}))!=null?a:e.allowedAdditionalProperties};if(((s=t.keyType)==null?void 0:s._def.typeName)===T.ZodString&&((r=t.keyType._def.checks)!=null&&r.length)){const{type:l,...p}=ga(t.keyType._def,e);return{...c,propertyNames:p}}else{if(((o=t.keyType)==null?void 0:o._def.typeName)===T.ZodEnum)return{...c,propertyNames:{enum:t.keyType._def.values}};if(((i=t.keyType)==null?void 0:i._def.typeName)===T.ZodBranded&&t.keyType._def.type._def.typeName===T.ZodString&&((n=t.keyType._def.type._def.checks)!=null&&n.length)){const{type:l,...p}=fa(t.keyType._def,e);return{...c,propertyNames:p}}}return c}function ir(t,e){if(e.mapStrategy==="record")return va(t,e);const a=R(t.keyType._def,{...e,currentPath:[...e.currentPath,"items","items","0"]})||W(),s=R(t.valueType._def,{...e,currentPath:[...e.currentPath,"items","items","1"]})||W();return{type:"array",maxItems:125,items:{type:"array",items:[a,s],minItems:2,maxItems:2}}}function lr(t){const e=t.values,s=Object.keys(t.values).filter(o=>typeof e[e[o]]!="number").map(o=>e[o]),r=Array.from(new Set(s.map(o=>typeof o)));return{type:r.length===1?r[0]==="string"?"string":"number":["string","number"],enum:s}}function cr(){return{not:W()}}function ur(){return{type:"null"}}var lt={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function dr(t,e){const a=t.options instanceof Map?Array.from(t.options.values()):t.options;if(a.every(s=>s._def.typeName in lt&&(!s._def.checks||!s._def.checks.length))){const s=a.reduce((r,o)=>{const i=lt[o._def.typeName];return i&&!r.includes(i)?[...r,i]:r},[]);return{type:s.length>1?s:s[0]}}else if(a.every(s=>s._def.typeName==="ZodLiteral"&&!s.description)){const s=a.reduce((r,o)=>{const i=typeof o._def.value;switch(i){case"string":case"number":case"boolean":return[...r,i];case"bigint":return[...r,"integer"];case"object":if(o._def.value===null)return[...r,"null"];default:return r}},[]);if(s.length===a.length){const r=s.filter((o,i,n)=>n.indexOf(o)===i);return{type:r.length>1?r:r[0],enum:a.reduce((o,i)=>o.includes(i._def.value)?o:[...o,i._def.value],[])}}}else if(a.every(s=>s._def.typeName==="ZodEnum"))return{type:"string",enum:a.reduce((s,r)=>[...s,...r._def.values.filter(o=>!s.includes(o))],[])};return pr(t,e)}var pr=(t,e)=>{const a=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((s,r)=>R(s._def,{...e,currentPath:[...e.currentPath,"anyOf",`${r}`]})).filter(s=>!!s&&(!e.strictUnions||typeof s=="object"&&Object.keys(s).length>0));return a.length?{anyOf:a}:void 0};function mr(t,e){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(t.innerType._def.typeName)&&(!t.innerType._def.checks||!t.innerType._def.checks.length))return{type:[lt[t.innerType._def.typeName],"null"]};const a=R(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","0"]});return a&&{anyOf:[a,{type:"null"}]}}function fr(t){const e={type:"number"};if(!t.checks)return e;for(const a of t.checks)switch(a.kind){case"int":e.type="integer";break;case"min":a.inclusive?e.minimum=a.value:e.exclusiveMinimum=a.value;break;case"max":a.inclusive?e.maximum=a.value:e.exclusiveMaximum=a.value;break;case"multipleOf":e.multipleOf=a.value;break}return e}function hr(t,e){const a={type:"object",properties:{}},s=[],r=t.shape();for(const i in r){let n=r[i];if(n===void 0||n._def===void 0)continue;const c=vr(n),l=R(n._def,{...e,currentPath:[...e.currentPath,"properties",i],propertyPath:[...e.currentPath,"properties",i]});l!==void 0&&(a.properties[i]=l,c||s.push(i))}s.length&&(a.required=s);const o=gr(t,e);return o!==void 0&&(a.additionalProperties=o),a}function gr(t,e){if(t.catchall._def.typeName!=="ZodNever")return R(t.catchall._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]});switch(t.unknownKeys){case"passthrough":return e.allowedAdditionalProperties;case"strict":return e.rejectedAdditionalProperties;case"strip":return e.removeAdditionalStrategy==="strict"?e.allowedAdditionalProperties:e.rejectedAdditionalProperties}}function vr(t){try{return t.isOptional()}catch{return!0}}var yr=(t,e)=>{var a;if(e.currentPath.toString()===((a=e.propertyPath)==null?void 0:a.toString()))return R(t.innerType._def,e);const s=R(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","1"]});return s?{anyOf:[{not:W()},s]}:W()},xr=(t,e)=>{if(e.pipeStrategy==="input")return R(t.in._def,e);if(e.pipeStrategy==="output")return R(t.out._def,e);const a=R(t.in._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),s=R(t.out._def,{...e,currentPath:[...e.currentPath,"allOf",a?"1":"0"]});return{allOf:[a,s].filter(r=>r!==void 0)}};function br(t,e){return R(t.type._def,e)}function _r(t,e){const s={type:"array",uniqueItems:!0,items:R(t.valueType._def,{...e,currentPath:[...e.currentPath,"items"]})};return t.minSize&&(s.minItems=t.minSize.value),t.maxSize&&(s.maxItems=t.maxSize.value),s}function Er(t,e){return t.rest?{type:"array",minItems:t.items.length,items:t.items.map((a,s)=>R(a._def,{...e,currentPath:[...e.currentPath,"items",`${s}`]})).reduce((a,s)=>s===void 0?a:[...a,s],[]),additionalItems:R(t.rest._def,{...e,currentPath:[...e.currentPath,"additionalItems"]})}:{type:"array",minItems:t.items.length,maxItems:t.items.length,items:t.items.map((a,s)=>R(a._def,{...e,currentPath:[...e.currentPath,"items",`${s}`]})).reduce((a,s)=>s===void 0?a:[...a,s],[])}}function Sr(){return{not:W()}}function Ir(){return W()}var wr=(t,e)=>R(t.innerType._def,e),Tr=(t,e,a)=>{switch(e){case T.ZodString:return ga(t,a);case T.ZodNumber:return fr(t);case T.ZodObject:return hr(t,a);case T.ZodBigInt:return Gs(t);case T.ZodBoolean:return Ys();case T.ZodDate:return ha(t,a);case T.ZodUndefined:return Sr();case T.ZodNull:return ur();case T.ZodArray:return Js(t,a);case T.ZodUnion:case T.ZodDiscriminatedUnion:return dr(t,a);case T.ZodIntersection:return sr(t,a);case T.ZodTuple:return Er(t,a);case T.ZodRecord:return va(t,a);case T.ZodLiteral:return rr(t);case T.ZodEnum:return tr(t);case T.ZodNativeEnum:return lr(t);case T.ZodNullable:return mr(t,a);case T.ZodOptional:return yr(t,a);case T.ZodMap:return ir(t,a);case T.ZodSet:return _r(t,a);case T.ZodLazy:return()=>t.getter()._def;case T.ZodPromise:return br(t,a);case T.ZodNaN:case T.ZodNever:return cr();case T.ZodEffects:return er(t,a);case T.ZodAny:return W();case T.ZodUnknown:return Ir();case T.ZodDefault:return Ks(t,a);case T.ZodBranded:return fa(t,a);case T.ZodReadonly:return wr(t,a);case T.ZodCatch:return Qs(t,a);case T.ZodPipeline:return xr(t,a);case T.ZodFunction:case T.ZodVoid:case T.ZodSymbol:return;default:return(s=>{})()}},Nr=(t,e)=>{let a=0;for(;a<t.length&&a<e.length&&t[a]===e[a];a++);return[(t.length-a).toString(),...e.slice(a)].join("/")};function R(t,e,a=!1){var s;const r=e.seen.get(t);if(e.override){const c=(s=e.override)==null?void 0:s.call(e,t,e,r,a);if(c!==Hs)return c}if(r&&!a){const c=Cr(r,e);if(c!==void 0)return c}const o={def:t,path:e.currentPath,jsonSchema:void 0};e.seen.set(t,o);const i=Tr(t,t.typeName,e),n=typeof i=="function"?R(i(),e):i;if(n&&Ar(t,e,n),e.postProcess){const c=e.postProcess(n,t,e);return o.jsonSchema=n,c}return o.jsonSchema=n,n}var Cr=(t,e)=>{switch(e.$refStrategy){case"root":return{$ref:t.path.join("/")};case"relative":return{$ref:Nr(e.currentPath,t.path)};case"none":case"seen":return t.path.length<e.currentPath.length&&t.path.every((a,s)=>e.currentPath[s]===a)?(console.warn(`Recursive reference detected at ${e.currentPath.join("/")}! Defaulting to any`),W()):e.$refStrategy==="seen"?W():void 0}},Ar=(t,e,a)=>(t.description&&(a.description=t.description),a),Mr=t=>{const e=Ws(t),a=e.name!==void 0?[...e.basePath,e.definitionPath,e.name]:e.basePath;return{...e,currentPath:a,propertyPath:void 0,seen:new Map(Object.entries(e.definitions).map(([s,r])=>[r._def,{def:r._def,path:[...e.basePath,e.definitionPath,s],jsonSchema:void 0}]))}},Rr=(t,e)=>{var a;const s=Mr(e);let r=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((l,[p,m])=>{var g;return{...l,[p]:(g=R(m._def,{...s,currentPath:[...s.basePath,s.definitionPath,p]},!0))!=null?g:W()}},{}):void 0;const o=typeof e=="string"?e:e?.nameStrategy==="title"?void 0:e?.name,i=(a=R(t._def,o===void 0?s:{...s,currentPath:[...s.basePath,s.definitionPath,o]},!1))!=null?a:W(),n=typeof e=="object"&&e.name!==void 0&&e.nameStrategy==="title"?e.name:void 0;n!==void 0&&(i.title=n);const c=o===void 0?r?{...i,[s.definitionPath]:r}:i:{$ref:[...s.$refStrategy==="relative"?[]:s.basePath,s.definitionPath,o].join("/"),[s.definitionPath]:{...r,[o]:i}};return c.$schema="http://json-schema.org/draft-07/schema#",c},ct=Symbol.for("vercel.ai.schema");function jr(t){let e;return()=>(e==null&&(e=t()),e)}function Je(t,{validate:e}={}){return{[ct]:!0,_type:void 0,get jsonSchema(){return typeof t=="function"&&(t=t()),t},validate:e}}function kr(t){return typeof t=="object"&&t!==null&&ct in t&&t[ct]===!0&&"jsonSchema"in t&&"validate"in t}function _t(t){return t==null?Je({properties:{},additionalProperties:!1}):kr(t)?t:"~standard"in t?t["~standard"].vendor==="zod"?ya(t):Or(t):t()}function Or(t){return Je(()=>bt(t["~standard"].jsonSchema.input({target:"draft-07"})),{validate:async e=>{const a=await t["~standard"].validate(e);return"value"in a?{success:!0,value:a.value}:{success:!1,error:new Ne({value:e,cause:a.issues})}}})}function Pr(t,e){var a;const s=(a=void 0)!=null?a:!1;return Je(()=>Rr(t,{$refStrategy:s?"root":"none"}),{validate:async r=>{const o=await t.safeParseAsync(r);return o.success?{success:!0,value:o.data}:{success:!1,error:o.error}}})}function Dr(t,e){var a;const s=(a=void 0)!=null?a:!1;return Je(()=>bt(as(t,{target:"draft-7",io:"input",reused:s?"ref":"inline"})),{validate:async r=>{const o=await ts(t,r);return o.success?{success:!0,value:o.data}:{success:!1,error:o.error}}})}function $r(t){return"_zod"in t}function ya(t,e){return $r(t)?Dr(t):Pr(t)}async function Bt({value:t,schema:e,context:a}){const s=await Pe({value:t,schema:e,context:a});if(!s.success)throw Ne.wrap({value:t,cause:s.error,context:a});return s.value}async function Pe({value:t,schema:e,context:a}){const s=_t(e);try{if(s.validate==null)return{success:!0,value:t,rawValue:t};const r=await s.validate(t);return r.success?{success:!0,value:r.value,rawValue:t}:{success:!1,error:Ne.wrap({value:t,cause:r.error,context:a}),rawValue:t}}catch(r){return{success:!1,error:Ne.wrap({value:t,cause:r,context:a}),rawValue:t}}}async function xe({text:t,schema:e}){try{const a=qs(t);return e==null?{success:!0,value:a,rawValue:a}:await Pe({value:a,schema:e})}catch(a){return{success:!1,error:Dt.isInstance(a)?a:new Dt({text:t,cause:a}),rawValue:void 0}}}function Lr({stream:t,schema:e}){return t.pipeThrough(new TextDecoderStream).pipeThrough(new es).pipeThrough(new TransformStream({async transform({data:a},s){a!=="[DONE]"&&s.enqueue(await xe({text:a,schema:e}))}}))}async function pe(t){return typeof t=="function"&&(t=t()),Promise.resolve(t)}var Zr=Object.defineProperty,Fr=(t,e)=>{for(var a in e)Zr(t,a,{get:e[a],enumerable:!0})},xa="AI_NoObjectGeneratedError",ba=`vercel.ai.error.${xa}`,Ur=Symbol.for(ba),_a,me=class extends K{constructor({message:t="No object generated.",cause:e,text:a,response:s,usage:r,finishReason:o}){super({name:xa,message:t,cause:e}),this[_a]=!0,this.text=a,this.response=s,this.usage=r,this.finishReason=o}static isInstance(t){return K.hasMarker(t,ba)}};_a=Ur;var Ea="AI_UIMessageStreamError",Sa=`vercel.ai.error.${Ea}`,zr=Symbol.for(Sa),Ia,Se=class extends K{constructor({chunkType:t,chunkId:e,message:a}){super({name:Ea,message:a}),this[Ia]=!0,this.chunkType=t,this.chunkId=e}static isInstance(t){return K.hasMarker(t,Sa)}};Ia=zr;var qt="6.0.108",wa=q([x(),Be(Uint8Array),Be(ArrayBuffer),Qt(t=>{var e,a;return(a=(e=globalThis.Buffer)==null?void 0:e.isBuffer(t))!=null?a:!1},{message:"Must be a Buffer"})]),De=ss(()=>q([rs(),x(),os(),B(),ke(x(),De.optional()),$e(De)])),M=ke(x(),ke(x(),De.optional())),Ta=j({type:S("text"),text:x(),providerOptions:M.optional()}),Vr=j({type:S("image"),image:q([wa,Be(URL)]),mediaType:x().optional(),providerOptions:M.optional()}),Na=j({type:S("file"),data:q([wa,Be(URL)]),filename:x().optional(),mediaType:x(),providerOptions:M.optional()}),Br=j({type:S("reasoning"),text:x(),providerOptions:M.optional()}),qr=j({type:S("tool-call"),toolCallId:x(),toolName:x(),input:ue(),providerOptions:M.optional(),providerExecuted:B().optional()}),Hr=ns("type",[j({type:S("text"),value:x(),providerOptions:M.optional()}),j({type:S("json"),value:De,providerOptions:M.optional()}),j({type:S("execution-denied"),reason:x().optional(),providerOptions:M.optional()}),j({type:S("error-text"),value:x(),providerOptions:M.optional()}),j({type:S("error-json"),value:De,providerOptions:M.optional()}),j({type:S("content"),value:$e(q([j({type:S("text"),text:x(),providerOptions:M.optional()}),j({type:S("media"),data:x(),mediaType:x()}),j({type:S("file-data"),data:x(),mediaType:x(),filename:x().optional(),providerOptions:M.optional()}),j({type:S("file-url"),url:x(),providerOptions:M.optional()}),j({type:S("file-id"),fileId:q([x(),ke(x(),x())]),providerOptions:M.optional()}),j({type:S("image-data"),data:x(),mediaType:x(),providerOptions:M.optional()}),j({type:S("image-url"),url:x(),providerOptions:M.optional()}),j({type:S("image-file-id"),fileId:q([x(),ke(x(),x())]),providerOptions:M.optional()}),j({type:S("custom"),providerOptions:M.optional()})]))})]),Ca=j({type:S("tool-result"),toolCallId:x(),toolName:x(),output:Hr,providerOptions:M.optional()}),Wr=j({type:S("tool-approval-request"),approvalId:x(),toolCallId:x()}),Jr=j({type:S("tool-approval-response"),approvalId:x(),approved:B(),reason:x().optional()}),Gr=j({role:S("system"),content:x(),providerOptions:M.optional()}),Yr=j({role:S("user"),content:q([x(),$e(q([Ta,Vr,Na]))]),providerOptions:M.optional()}),Qr=j({role:S("assistant"),content:q([x(),$e(q([Ta,Na,Br,qr,Ca,Wr]))]),providerOptions:M.optional()}),Xr=j({role:S("tool"),content:$e(q([Ca,Jr])),providerOptions:M.optional()});q([Gr,Yr,Qr,Xr]);function Aa(t,e){if(t===void 0&&e===void 0)return;if(t===void 0)return e;if(e===void 0)return t;const a={...t};for(const s in e)if(Object.prototype.hasOwnProperty.call(e,s)){const r=e[s];if(r===void 0)continue;const o=s in t?t[s]:void 0,i=r!==null&&typeof r=="object"&&!Array.isArray(r)&&!(r instanceof Date)&&!(r instanceof RegExp),n=o!=null&&typeof o=="object"&&!Array.isArray(o)&&!(o instanceof Date)&&!(o instanceof RegExp);i&&n?a[s]=Aa(o,r):a[s]=r}return a}var Kr={};Fr(Kr,{array:()=>so,choice:()=>ro,json:()=>oo,object:()=>ao,text:()=>to});function eo(t){const e=["ROOT"];let a=-1,s=null;function r(c,l,p){switch(c){case'"':{a=l,e.pop(),e.push(p),e.push("INSIDE_STRING");break}case"f":case"t":case"n":{a=l,s=l,e.pop(),e.push(p),e.push("INSIDE_LITERAL");break}case"-":{e.pop(),e.push(p),e.push("INSIDE_NUMBER");break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{a=l,e.pop(),e.push(p),e.push("INSIDE_NUMBER");break}case"{":{a=l,e.pop(),e.push(p),e.push("INSIDE_OBJECT_START");break}case"[":{a=l,e.pop(),e.push(p),e.push("INSIDE_ARRAY_START");break}}}function o(c,l){switch(c){case",":{e.pop(),e.push("INSIDE_OBJECT_AFTER_COMMA");break}case"}":{a=l,e.pop();break}}}function i(c,l){switch(c){case",":{e.pop(),e.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{a=l,e.pop();break}}}for(let c=0;c<t.length;c++){const l=t[c];switch(e[e.length-1]){case"ROOT":r(l,c,"FINISH");break;case"INSIDE_OBJECT_START":{switch(l){case'"':{e.pop(),e.push("INSIDE_OBJECT_KEY");break}case"}":{a=c,e.pop();break}}break}case"INSIDE_OBJECT_AFTER_COMMA":{l==='"'&&(e.pop(),e.push("INSIDE_OBJECT_KEY"));break}case"INSIDE_OBJECT_KEY":{l==='"'&&(e.pop(),e.push("INSIDE_OBJECT_AFTER_KEY"));break}case"INSIDE_OBJECT_AFTER_KEY":{l===":"&&(e.pop(),e.push("INSIDE_OBJECT_BEFORE_VALUE"));break}case"INSIDE_OBJECT_BEFORE_VALUE":{r(l,c,"INSIDE_OBJECT_AFTER_VALUE");break}case"INSIDE_OBJECT_AFTER_VALUE":{o(l,c);break}case"INSIDE_STRING":{switch(l){case'"':{e.pop(),a=c;break}case"\\":{e.push("INSIDE_STRING_ESCAPE");break}default:a=c}break}case"INSIDE_ARRAY_START":{l==="]"?(a=c,e.pop()):(a=c,r(l,c,"INSIDE_ARRAY_AFTER_VALUE"));break}case"INSIDE_ARRAY_AFTER_VALUE":{switch(l){case",":{e.pop(),e.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{a=c,e.pop();break}default:{a=c;break}}break}case"INSIDE_ARRAY_AFTER_COMMA":{r(l,c,"INSIDE_ARRAY_AFTER_VALUE");break}case"INSIDE_STRING_ESCAPE":{e.pop(),a=c;break}case"INSIDE_NUMBER":{switch(l){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{a=c;break}case"e":case"E":case"-":case".":break;case",":{e.pop(),e[e.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&i(l,c),e[e.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&o(l,c);break}case"}":{e.pop(),e[e.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&o(l,c);break}case"]":{e.pop(),e[e.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&i(l,c);break}default:{e.pop();break}}break}case"INSIDE_LITERAL":{const m=t.substring(s,c+1);!"false".startsWith(m)&&!"true".startsWith(m)&&!"null".startsWith(m)?(e.pop(),e[e.length-1]==="INSIDE_OBJECT_AFTER_VALUE"?o(l,c):e[e.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&i(l,c)):a=c;break}}}let n=t.slice(0,a+1);for(let c=e.length-1;c>=0;c--)switch(e[c]){case"INSIDE_STRING":{n+='"';break}case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":{n+="}";break}case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":{n+="]";break}case"INSIDE_LITERAL":{const p=t.substring(s,t.length);"true".startsWith(p)?n+="true".slice(p.length):"false".startsWith(p)?n+="false".slice(p.length):"null".startsWith(p)&&(n+="null".slice(p.length))}}return n}async function Ze(t){if(t===void 0)return{value:void 0,state:"undefined-input"};let e=await xe({text:t});return e.success?{value:e.value,state:"successful-parse"}:(e=await xe({text:eo(t)}),e.success?{value:e.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"})}var to=()=>({name:"text",responseFormat:Promise.resolve({type:"text"}),async parseCompleteOutput({text:t}){return t},async parsePartialOutput({text:t}){return{partial:t}},createElementStreamTransform(){}}),ao=({schema:t,name:e,description:a})=>{const s=_t(t);return{name:"object",responseFormat:pe(s.jsonSchema).then(r=>({type:"json",schema:r,...e!=null&&{name:e},...a!=null&&{description:a}})),async parseCompleteOutput({text:r},o){const i=await xe({text:r});if(!i.success)throw new me({message:"No object generated: could not parse the response.",cause:i.error,text:r,response:o.response,usage:o.usage,finishReason:o.finishReason});const n=await Pe({value:i.value,schema:s});if(!n.success)throw new me({message:"No object generated: response did not match schema.",cause:n.error,text:r,response:o.response,usage:o.usage,finishReason:o.finishReason});return n.value},async parsePartialOutput({text:r}){const o=await Ze(r);switch(o.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return{partial:o.value}}},createElementStreamTransform(){}}},so=({element:t,name:e,description:a})=>{const s=_t(t);return{name:"array",responseFormat:pe(s.jsonSchema).then(r=>{const{$schema:o,...i}=r;return{type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{elements:{type:"array",items:i}},required:["elements"],additionalProperties:!1},...e!=null&&{name:e},...a!=null&&{description:a}}}),async parseCompleteOutput({text:r},o){const i=await xe({text:r});if(!i.success)throw new me({message:"No object generated: could not parse the response.",cause:i.error,text:r,response:o.response,usage:o.usage,finishReason:o.finishReason});const n=i.value;if(n==null||typeof n!="object"||!("elements"in n)||!Array.isArray(n.elements))throw new me({message:"No object generated: response did not match schema.",cause:new Ne({value:n,cause:"response must be an object with an elements array"}),text:r,response:o.response,usage:o.usage,finishReason:o.finishReason});for(const c of n.elements){const l=await Pe({value:c,schema:s});if(!l.success)throw new me({message:"No object generated: response did not match schema.",cause:l.error,text:r,response:o.response,usage:o.usage,finishReason:o.finishReason})}return n.elements},async parsePartialOutput({text:r}){const o=await Ze(r);switch(o.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{const i=o.value;if(i==null||typeof i!="object"||!("elements"in i)||!Array.isArray(i.elements))return;const n=o.state==="repaired-parse"&&i.elements.length>0?i.elements.slice(0,-1):i.elements,c=[];for(const l of n){const p=await Pe({value:l,schema:s});p.success&&c.push(p.value)}return{partial:c}}}},createElementStreamTransform(){let r=0;return new TransformStream({transform({partialOutput:o},i){if(o!=null)for(;r<o.length;r++)i.enqueue(o[r])}})}}},ro=({options:t,name:e,description:a})=>({name:"choice",responseFormat:Promise.resolve({type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{result:{type:"string",enum:t}},required:["result"],additionalProperties:!1},...e!=null&&{name:e},...a!=null&&{description:a}}),async parseCompleteOutput({text:s},r){const o=await xe({text:s});if(!o.success)throw new me({message:"No object generated: could not parse the response.",cause:o.error,text:s,response:r.response,usage:r.usage,finishReason:r.finishReason});const i=o.value;if(i==null||typeof i!="object"||!("result"in i)||typeof i.result!="string"||!t.includes(i.result))throw new me({message:"No object generated: response did not match schema.",cause:new Ne({value:i,cause:"response must be an object that contains a choice value."}),text:s,response:r.response,usage:r.usage,finishReason:r.finishReason});return i.result},async parsePartialOutput({text:s}){const r=await Ze(s);switch(r.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{const o=r.value;if(o==null||typeof o!="object"||!("result"in o)||typeof o.result!="string")return;const i=t.filter(n=>n.startsWith(o.result));return r.state==="successful-parse"?i.includes(o.result)?{partial:o.result}:void 0:i.length===1?{partial:i[0]}:void 0}}},createElementStreamTransform(){}}),oo=({name:t,description:e}={})=>({name:"json",responseFormat:Promise.resolve({type:"json",...t!=null&&{name:t},...e!=null&&{description:e}}),async parseCompleteOutput({text:a},s){const r=await xe({text:a});if(!r.success)throw new me({message:"No object generated: could not parse the response.",cause:r.error,text:a,response:s.response,usage:s.usage,finishReason:s.finishReason});return r.value},async parsePartialOutput({text:a}){const s=await Ze(a);switch(s.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return s.value===void 0?void 0:{partial:s.value}}},createElementStreamTransform(){}});Le({prefix:"aitxt",size:24});(class extends TransformStream{constructor(){super({transform(t,e){e.enqueue(`data: ${JSON.stringify(t)}
8
8
 
9
9
  `)},flush(t){t.enqueue(`data: [DONE]
10
10
 
@@ -1 +1 @@
1
- import{o as A,s as D,c as O,k as v,l as E,j as r,d as N}from"./index-p3omciU2.js";import{A as I,a as M,b as L,c as R,d as T,e as $,f as k}from"./alert-dialog-BwY-RhAj.js";import{B}from"./button-SrN4bZ1L.js";import{F as V,a as q,b as H,c as U,d as G,e as J,f as K}from"./form-DdSGRLg9.js";import{I as P}from"./input-C19rUyj9.js";import{S as Q}from"./spinner-DxDNcb59.js";import{u as W}from"./useMutation-GHxEJTN4.js";function _(o){return o.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const X=A({name:D().min(2,"Organization name is required")});function ne(o){const e=O.c(41),{open:a,onOpenChange:s}=o;let j;e[0]===Symbol.for("react.memo_cache_sentinel")?(j={resolver:v(X),defaultValues:{name:""}},e[0]=j):j=e[0];const t=E(j);let w;e[1]===Symbol.for("react.memo_cache_sentinel")?(w={mutationFn:Z,onSuccess:Y},e[1]=w):w=e[1];const i=W(w),z=i.error instanceof Error?i.error.message:i.error?"Failed to create organization.":null;let F;e[2]===Symbol.for("react.memo_cache_sentinel")?(F=r.jsxs(L,{children:[r.jsx(R,{children:"Create a new organization"}),r.jsx(T,{children:"Set up a new organization to collaborate with others."})]}),e[2]=F):F=e[2];let n;if(e[3]!==i||e[4]!==t){let x;e[6]!==i?(x=b=>i.mutateAsync(b),e[6]=i,e[7]=x):x=e[7],n=t.handleSubmit(x),e[3]=i,e[4]=t,e[5]=n}else n=e[5];let l;e[8]!==t.formState.isSubmitting?(l=x=>{const{field:b}=x;return r.jsxs(H,{children:[r.jsx(U,{children:"Organization Name"}),r.jsx(G,{children:r.jsx(P,{...b,placeholder:"Acme Inc.",disabled:t.formState.isSubmitting})}),r.jsx(J,{children:"The name of your company or organization"}),b.value&&r.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Organization URL:"," ",r.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",_(b.value)]})]}),r.jsx(K,{})]})},e[8]=t.formState.isSubmitting,e[9]=l):l=e[9];let m;e[10]!==t.control||e[11]!==l?(m=r.jsx(V,{control:t.control,name:"name",render:l}),e[10]=t.control,e[11]=l,e[12]=m):m=e[12];let c;e[13]!==z?(c=z&&r.jsx("div",{className:"text-destructive text-sm mt-2",children:z}),e[13]=z,e[14]=c):c=e[14];let f;e[15]!==i||e[16]!==t?(f=()=>{i.reset(),t.reset()},e[15]=i,e[16]=t,e[17]=f):f=e[17];let g;e[18]!==t.formState.isSubmitting||e[19]!==f?(g=r.jsx(I,{disabled:t.formState.isSubmitting,onClick:f,children:"Cancel"}),e[18]=t.formState.isSubmitting,e[19]=f,e[20]=g):g=e[20];const y=!t.formState.isValid||t.formState.isSubmitting;let u;e[21]!==t.formState.isSubmitting?(u=t.formState.isSubmitting?r.jsxs("span",{className:"flex items-center gap-2",children:[r.jsx(Q,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=t.formState.isSubmitting,e[22]=u):u=e[22];let d;e[23]!==y||e[24]!==u?(d=r.jsx(B,{type:"submit",variant:"default",disabled:y,children:u}),e[23]=y,e[24]=u,e[25]=d):d=e[25];let S;e[26]!==d||e[27]!==g?(S=r.jsxs($,{children:[g,d]}),e[26]=d,e[27]=g,e[28]=S):S=e[28];let h;e[29]!==S||e[30]!==n||e[31]!==m||e[32]!==c?(h=r.jsxs("form",{className:"space-y-6",onSubmit:n,autoComplete:"off",children:[m,c,S]}),e[29]=S,e[30]=n,e[31]=m,e[32]=c,e[33]=h):h=e[33];let p;e[34]!==t||e[35]!==h?(p=r.jsxs(M,{children:[F,r.jsx(q,{...t,children:h})]}),e[34]=t,e[35]=h,e[36]=p):p=e[36];let C;return e[37]!==s||e[38]!==a||e[39]!==p?(C=r.jsx(k,{open:a,onOpenChange:s,children:p}),e[37]=s,e[38]=a,e[39]=p,e[40]=C):C=e[40],C}function Y(o){const{orgSlug:e}=o;window.location.href=`/${e}`}async function Z(o){const e=_(o.name);if(!e)throw new Error("Organization slug is invalid");const a=await N.organization.create({name:o.name,slug:e});if(a?.error)throw new Error(a.error.message||"Failed to create organization");const s=a?.data?.slug??e;if(!s)throw new Error("Failed to create organization");return{orgSlug:s}}export{ne as C};
1
+ import{o as A,s as D,c as O,k as v,l as E,j as r,d as N}from"./index-BDPRLX-4.js";import{A as I,a as M,b as L,c as R,d as T,e as $,f as k}from"./alert-dialog-YaiDdNnH.js";import{B}from"./button-TXPV9u45.js";import{F as V,a as q,b as H,c as U,d as G,e as J,f as K}from"./form-CdePd7Pv.js";import{I as P}from"./input-D_ph6wQi.js";import{S as Q}from"./spinner-DjxJ1r6s.js";import{u as W}from"./useMutation-B2OXPKQT.js";function _(o){return o.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const X=A({name:D().min(2,"Organization name is required")});function ne(o){const e=O.c(41),{open:a,onOpenChange:s}=o;let j;e[0]===Symbol.for("react.memo_cache_sentinel")?(j={resolver:v(X),defaultValues:{name:""}},e[0]=j):j=e[0];const t=E(j);let w;e[1]===Symbol.for("react.memo_cache_sentinel")?(w={mutationFn:Z,onSuccess:Y},e[1]=w):w=e[1];const i=W(w),z=i.error instanceof Error?i.error.message:i.error?"Failed to create organization.":null;let F;e[2]===Symbol.for("react.memo_cache_sentinel")?(F=r.jsxs(L,{children:[r.jsx(R,{children:"Create a new organization"}),r.jsx(T,{children:"Set up a new organization to collaborate with others."})]}),e[2]=F):F=e[2];let n;if(e[3]!==i||e[4]!==t){let x;e[6]!==i?(x=b=>i.mutateAsync(b),e[6]=i,e[7]=x):x=e[7],n=t.handleSubmit(x),e[3]=i,e[4]=t,e[5]=n}else n=e[5];let l;e[8]!==t.formState.isSubmitting?(l=x=>{const{field:b}=x;return r.jsxs(H,{children:[r.jsx(U,{children:"Organization Name"}),r.jsx(G,{children:r.jsx(P,{...b,placeholder:"Acme Inc.",disabled:t.formState.isSubmitting})}),r.jsx(J,{children:"The name of your company or organization"}),b.value&&r.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Organization URL:"," ",r.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",_(b.value)]})]}),r.jsx(K,{})]})},e[8]=t.formState.isSubmitting,e[9]=l):l=e[9];let m;e[10]!==t.control||e[11]!==l?(m=r.jsx(V,{control:t.control,name:"name",render:l}),e[10]=t.control,e[11]=l,e[12]=m):m=e[12];let c;e[13]!==z?(c=z&&r.jsx("div",{className:"text-destructive text-sm mt-2",children:z}),e[13]=z,e[14]=c):c=e[14];let f;e[15]!==i||e[16]!==t?(f=()=>{i.reset(),t.reset()},e[15]=i,e[16]=t,e[17]=f):f=e[17];let g;e[18]!==t.formState.isSubmitting||e[19]!==f?(g=r.jsx(I,{disabled:t.formState.isSubmitting,onClick:f,children:"Cancel"}),e[18]=t.formState.isSubmitting,e[19]=f,e[20]=g):g=e[20];const y=!t.formState.isValid||t.formState.isSubmitting;let u;e[21]!==t.formState.isSubmitting?(u=t.formState.isSubmitting?r.jsxs("span",{className:"flex items-center gap-2",children:[r.jsx(Q,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=t.formState.isSubmitting,e[22]=u):u=e[22];let d;e[23]!==y||e[24]!==u?(d=r.jsx(B,{type:"submit",variant:"default",disabled:y,children:u}),e[23]=y,e[24]=u,e[25]=d):d=e[25];let S;e[26]!==d||e[27]!==g?(S=r.jsxs($,{children:[g,d]}),e[26]=d,e[27]=g,e[28]=S):S=e[28];let h;e[29]!==S||e[30]!==n||e[31]!==m||e[32]!==c?(h=r.jsxs("form",{className:"space-y-6",onSubmit:n,autoComplete:"off",children:[m,c,S]}),e[29]=S,e[30]=n,e[31]=m,e[32]=c,e[33]=h):h=e[33];let p;e[34]!==t||e[35]!==h?(p=r.jsxs(M,{children:[F,r.jsx(q,{...t,children:h})]}),e[34]=t,e[35]=h,e[36]=p):p=e[36];let C;return e[37]!==s||e[38]!==a||e[39]!==p?(C=r.jsx(k,{open:a,onOpenChange:s,children:p}),e[37]=s,e[38]=a,e[39]=p,e[40]=C):C=e[40],C}function Y(o){const{orgSlug:e}=o;window.location.href=`/${e}`}async function Z(o){const e=_(o.name);if(!e)throw new Error("Organization slug is invalid");const a=await N.organization.create({name:o.name,slug:e});if(a?.error)throw new Error(a.error.message||"Failed to create organization");const s=a?.data?.slug??e;if(!s)throw new Error("Failed to create organization");return{orgSlug:s}}export{ne as C};
@@ -1 +1 @@
1
- import{c as A,j as e,u as L,b as R,m as k,r as z,l as M,t as B,K as T,O as j,o as V,s as f}from"./index-p3omciU2.js";import{u as $}from"./useMutation-GHxEJTN4.js";import{u as q,a as O}from"./constants-DisK0xae.js";import{D as K,a as U,b as G,c as J,d as Q,e as Y}from"./dialog-DH6FGz6L.js";import{c as H,B as D}from"./button-SrN4bZ1L.js";import{a as W,F as v,b as F,c as N,d as S,f as w}from"./form-DdSGRLg9.js";import{I}from"./input-C19rUyj9.js";import{T as X}from"./textarea-BDWEwIDH.js";import{L as Z}from"./label-vYcgzZeb.js";import{i as ee}from"./Check-IyJXmB3D.js";function se(l){return l.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}function _(l){return/^[a-z0-9-]+$/.test(l)&&l.length>0&&l.length<=100}const te=["#3B82F6","#8B5CF6","#EC4899","#EF4444","#F97316","#EAB308","#22C55E","#14B8A6","#06B6D4","#6366F1","#64748B","#000000"];function re(l){const s=A.c(16),{value:n,onChange:i}=l;let c;s[0]!==i||s[1]!==n?(c=te.map(o=>e.jsx("button",{type:"button",onClick:()=>i(o),className:H("size-8 rounded-lg transition-all",n===o&&"ring-2 ring-offset-2 ring-primary"),style:{backgroundColor:o},children:n===o&&e.jsx(ee,{className:"size-4 text-white mx-auto"})},o)),s[0]=i,s[1]=n,s[2]=c):c=s[2];let u;s[3]!==c?(u=e.jsx("div",{className:"grid grid-cols-6 gap-2",children:c}),s[3]=c,s[4]=u):u=s[4];const g=n??"#3B82F6";let d;s[5]!==i?(d=o=>i(o.target.value),s[5]=i,s[6]=d):d=s[6];let t;s[7]!==g||s[8]!==d?(t=e.jsx("input",{type:"color",value:g,onChange:d,className:"size-8 rounded cursor-pointer"}),s[7]=g,s[8]=d,s[9]=t):t=s[9];let a;s[10]===Symbol.for("react.memo_cache_sentinel")?(a=e.jsx("span",{className:"text-sm text-muted-foreground",children:"Custom color"}),s[10]=a):a=s[10];let m;s[11]!==t?(m=e.jsxs("div",{className:"flex items-center gap-2",children:[t,a]}),s[11]=t,s[12]=m):m=s[12];let x;return s[13]!==u||s[14]!==m?(x=e.jsxs("div",{className:"space-y-3",children:[u,m]}),s[13]=u,s[14]=m,s[15]=x):x=s[15],x}V({name:f().min(1,"Name is required").max(200),slug:f().min(1,"Slug is required").max(100),description:f().max(1e3).optional(),bannerColor:f().nullable().optional()});function xe({open:l,onOpenChange:s}){const{org:n}=L(),i=R(),c=k(),[u,g]=z.useState(!1),d=q({connectionId:O,orgId:n.id}),t=M({mode:"onChange",defaultValues:{name:"",slug:"",description:"",bannerColor:"#3B82F6"}}),a=$({mutationFn:async r=>{const h=await d.callTool({name:"PROJECT_CREATE",arguments:{organizationId:n.id,slug:r.slug,name:r.name,description:r.description||null,enabledPlugins:[],ui:{banner:null,bannerColor:r.bannerColor??null,icon:null,themeColor:r.bannerColor??null}}});return h.structuredContent??h},onSuccess:r=>{c.invalidateQueries({queryKey:T.projects(n.id)}),B.success("Project created successfully"),s(!1),t.reset({name:"",slug:"",description:"",bannerColor:"#3B82F6"}),g(!1),i({to:"/$org/$project",params:{org:n.slug,project:r.project.slug}})},onError:r=>{B.error("Failed to create project: "+(r instanceof Error?r.message:"Unknown error"))}}),m=async r=>{if(!_(r.slug)){t.setError("slug",{message:"Slug must be lowercase alphanumeric with hyphens only"});return}if(r.slug===j){t.setError("slug",{message:`"${j}" is a reserved slug`});return}await a.mutateAsync(r)},x=r=>{const h=r.target.value;if(t.setValue("name",h),!u){const P=se(h);t.setValue("slug",P)}},o=r=>{g(!0),t.setValue("slug",r.target.value.toLowerCase().replace(/[^a-z0-9-]/g,""))},C=t.watch("bannerColor"),p=t.watch("slug"),b=t.watch("name"),y=p===j,E=p.length>0&&!_(p);return e.jsx(K,{open:l,onOpenChange:s,children:e.jsxs(U,{className:"max-w-lg max-h-[90vh] overflow-y-auto",children:[e.jsxs(G,{children:[e.jsx(J,{children:"Create New Project"}),e.jsxs(Q,{children:["Set up a new project in ",n.name,". You can configure plugins and settings after creation."]})]}),e.jsx(W,{...t,children:e.jsxs("form",{onSubmit:t.handleSubmit(m),className:"space-y-6",children:[e.jsx("div",{className:"h-20 rounded-lg relative",style:{backgroundColor:C??"#3B82F6"},children:e.jsx("div",{className:"absolute -bottom-4 left-4",children:e.jsx("div",{className:"size-12 rounded-lg border-2 border-background flex items-center justify-center text-lg font-semibold text-white",style:{backgroundColor:C??"#3B82F6"},children:b?.charAt(0)?.toUpperCase()||"P"})})}),e.jsxs("div",{className:"space-y-2 pt-4",children:[e.jsx(Z,{children:"Banner Color"}),e.jsx(re,{value:C??null,onChange:r=>t.setValue("bannerColor",r)})]}),e.jsx(v,{control:t.control,name:"name",render:()=>e.jsxs(F,{children:[e.jsx(N,{children:"Project Name *"}),e.jsx(S,{children:e.jsx(I,{value:b,onChange:x,placeholder:"My Awesome Project",autoFocus:!0,disabled:a.isPending})}),e.jsx(w,{})]})}),e.jsx(v,{control:t.control,name:"slug",render:()=>e.jsxs(F,{children:[e.jsx(N,{children:"Slug *"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"text-sm text-muted-foreground",children:["/",n.slug,"/"]}),e.jsx(S,{children:e.jsx(I,{value:p,onChange:o,placeholder:"my-awesome-project",className:"flex-1",disabled:a.isPending})})]}),y&&e.jsxs("p",{className:"text-xs text-destructive",children:['"',j,'" is a reserved slug']}),E&&!y&&e.jsx("p",{className:"text-xs text-destructive",children:"Slug must be lowercase alphanumeric with hyphens only"}),e.jsx(w,{})]})}),e.jsx(v,{control:t.control,name:"description",render:({field:r})=>e.jsxs(F,{children:[e.jsx(N,{children:"Description"}),e.jsx(S,{children:e.jsx(X,{...r,placeholder:"What is this project for?",rows:2,disabled:a.isPending})}),e.jsx(w,{})]})}),e.jsxs(Y,{children:[e.jsx(D,{type:"button",variant:"outline",onClick:()=>s(!1),disabled:a.isPending,children:"Cancel"}),e.jsx(D,{type:"submit",disabled:a.isPending||y||E||!b||!p,children:a.isPending?"Creating...":"Create Project"})]})]})})]})})}export{xe as C};
1
+ import{c as A,j as e,u as L,b as R,m as k,r as z,l as M,t as B,K as T,O as j,o as V,s as f}from"./index-BDPRLX-4.js";import{u as $}from"./useMutation-B2OXPKQT.js";import{u as q,a as O}from"./constants-DEI8O4hQ.js";import{D as K,a as U,b as G,c as J,d as Q,e as Y}from"./dialog-wuqlToby.js";import{c as H,B as D}from"./button-TXPV9u45.js";import{a as W,F as v,b as F,c as N,d as S,f as w}from"./form-CdePd7Pv.js";import{I}from"./input-D_ph6wQi.js";import{T as X}from"./textarea-Db3p0Rx5.js";import{L as Z}from"./label-C1HpB4GV.js";import{i as ee}from"./Check-DM3yWukQ.js";function se(l){return l.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}function _(l){return/^[a-z0-9-]+$/.test(l)&&l.length>0&&l.length<=100}const te=["#3B82F6","#8B5CF6","#EC4899","#EF4444","#F97316","#EAB308","#22C55E","#14B8A6","#06B6D4","#6366F1","#64748B","#000000"];function re(l){const s=A.c(16),{value:n,onChange:i}=l;let c;s[0]!==i||s[1]!==n?(c=te.map(o=>e.jsx("button",{type:"button",onClick:()=>i(o),className:H("size-8 rounded-lg transition-all",n===o&&"ring-2 ring-offset-2 ring-primary"),style:{backgroundColor:o},children:n===o&&e.jsx(ee,{className:"size-4 text-white mx-auto"})},o)),s[0]=i,s[1]=n,s[2]=c):c=s[2];let u;s[3]!==c?(u=e.jsx("div",{className:"grid grid-cols-6 gap-2",children:c}),s[3]=c,s[4]=u):u=s[4];const g=n??"#3B82F6";let d;s[5]!==i?(d=o=>i(o.target.value),s[5]=i,s[6]=d):d=s[6];let t;s[7]!==g||s[8]!==d?(t=e.jsx("input",{type:"color",value:g,onChange:d,className:"size-8 rounded cursor-pointer"}),s[7]=g,s[8]=d,s[9]=t):t=s[9];let a;s[10]===Symbol.for("react.memo_cache_sentinel")?(a=e.jsx("span",{className:"text-sm text-muted-foreground",children:"Custom color"}),s[10]=a):a=s[10];let m;s[11]!==t?(m=e.jsxs("div",{className:"flex items-center gap-2",children:[t,a]}),s[11]=t,s[12]=m):m=s[12];let x;return s[13]!==u||s[14]!==m?(x=e.jsxs("div",{className:"space-y-3",children:[u,m]}),s[13]=u,s[14]=m,s[15]=x):x=s[15],x}V({name:f().min(1,"Name is required").max(200),slug:f().min(1,"Slug is required").max(100),description:f().max(1e3).optional(),bannerColor:f().nullable().optional()});function xe({open:l,onOpenChange:s}){const{org:n}=L(),i=R(),c=k(),[u,g]=z.useState(!1),d=q({connectionId:O,orgId:n.id}),t=M({mode:"onChange",defaultValues:{name:"",slug:"",description:"",bannerColor:"#3B82F6"}}),a=$({mutationFn:async r=>{const h=await d.callTool({name:"PROJECT_CREATE",arguments:{organizationId:n.id,slug:r.slug,name:r.name,description:r.description||null,enabledPlugins:[],ui:{banner:null,bannerColor:r.bannerColor??null,icon:null,themeColor:r.bannerColor??null}}});return h.structuredContent??h},onSuccess:r=>{c.invalidateQueries({queryKey:T.projects(n.id)}),B.success("Project created successfully"),s(!1),t.reset({name:"",slug:"",description:"",bannerColor:"#3B82F6"}),g(!1),i({to:"/$org/$project",params:{org:n.slug,project:r.project.slug}})},onError:r=>{B.error("Failed to create project: "+(r instanceof Error?r.message:"Unknown error"))}}),m=async r=>{if(!_(r.slug)){t.setError("slug",{message:"Slug must be lowercase alphanumeric with hyphens only"});return}if(r.slug===j){t.setError("slug",{message:`"${j}" is a reserved slug`});return}await a.mutateAsync(r)},x=r=>{const h=r.target.value;if(t.setValue("name",h),!u){const P=se(h);t.setValue("slug",P)}},o=r=>{g(!0),t.setValue("slug",r.target.value.toLowerCase().replace(/[^a-z0-9-]/g,""))},C=t.watch("bannerColor"),p=t.watch("slug"),b=t.watch("name"),y=p===j,E=p.length>0&&!_(p);return e.jsx(K,{open:l,onOpenChange:s,children:e.jsxs(U,{className:"max-w-lg max-h-[90vh] overflow-y-auto",children:[e.jsxs(G,{children:[e.jsx(J,{children:"Create New Project"}),e.jsxs(Q,{children:["Set up a new project in ",n.name,". You can configure plugins and settings after creation."]})]}),e.jsx(W,{...t,children:e.jsxs("form",{onSubmit:t.handleSubmit(m),className:"space-y-6",children:[e.jsx("div",{className:"h-20 rounded-lg relative",style:{backgroundColor:C??"#3B82F6"},children:e.jsx("div",{className:"absolute -bottom-4 left-4",children:e.jsx("div",{className:"size-12 rounded-lg border-2 border-background flex items-center justify-center text-lg font-semibold text-white",style:{backgroundColor:C??"#3B82F6"},children:b?.charAt(0)?.toUpperCase()||"P"})})}),e.jsxs("div",{className:"space-y-2 pt-4",children:[e.jsx(Z,{children:"Banner Color"}),e.jsx(re,{value:C??null,onChange:r=>t.setValue("bannerColor",r)})]}),e.jsx(v,{control:t.control,name:"name",render:()=>e.jsxs(F,{children:[e.jsx(N,{children:"Project Name *"}),e.jsx(S,{children:e.jsx(I,{value:b,onChange:x,placeholder:"My Awesome Project",autoFocus:!0,disabled:a.isPending})}),e.jsx(w,{})]})}),e.jsx(v,{control:t.control,name:"slug",render:()=>e.jsxs(F,{children:[e.jsx(N,{children:"Slug *"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"text-sm text-muted-foreground",children:["/",n.slug,"/"]}),e.jsx(S,{children:e.jsx(I,{value:p,onChange:o,placeholder:"my-awesome-project",className:"flex-1",disabled:a.isPending})})]}),y&&e.jsxs("p",{className:"text-xs text-destructive",children:['"',j,'" is a reserved slug']}),E&&!y&&e.jsx("p",{className:"text-xs text-destructive",children:"Slug must be lowercase alphanumeric with hyphens only"}),e.jsx(w,{})]})}),e.jsx(v,{control:t.control,name:"description",render:({field:r})=>e.jsxs(F,{children:[e.jsx(N,{children:"Description"}),e.jsx(S,{children:e.jsx(X,{...r,placeholder:"What is this project for?",rows:2,disabled:a.isPending})}),e.jsx(w,{})]})}),e.jsxs(Y,{children:[e.jsx(D,{type:"button",variant:"outline",onClick:()=>s(!1),disabled:a.isPending,children:"Cancel"}),e.jsx(D,{type:"submit",disabled:a.isPending||y||E||!b||!p,children:a.isPending?"Creating...":"Create Project"})]})]})})]})})}export{xe as C};
@@ -1 +1 @@
1
- import{r as s}from"./index-p3omciU2.js";const c=({size:e=24,color:t="currentColor",...o})=>s.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},s.createElement("path",{d:"M15.938 15.938A7.001 7.001 0 0 0 15 2a7.001 7.001 0 0 0-6.938 6.062M16 15a7 7 0 1 1-14 0 7 7 0 0 1 14 0Z"}));c.displayName="Coins01";const p="https://sites-openrouter.decocache.com/mcp",a="https://sites-deco-ai-gateway.decocache.com/mcp",n=[a];function d(e){if(!e)return!1;try{const t=new URL(e);return n.some(o=>{const r=new URL(o);return t.origin===r.origin&&t.pathname.replace(/\/$/,"")===r.pathname})}catch{return!1}}const h="https://assets.decocache.com/decocms/b2e2f64f-6025-45f7-9e8c-3b3ebdd073d8/openrouter_logojpg.jpg";export{h as O,c as a,p as b,d as i};
1
+ import{r as s}from"./index-BDPRLX-4.js";const c=({size:e=24,color:t="currentColor",...o})=>s.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},s.createElement("path",{d:"M15.938 15.938A7.001 7.001 0 0 0 15 2a7.001 7.001 0 0 0-6.938 6.062M16 15a7 7 0 1 1-14 0 7 7 0 0 1 14 0Z"}));c.displayName="Coins01";const p="https://sites-openrouter.decocache.com/mcp",a="https://sites-deco-ai-gateway.decocache.com/mcp",n=[a];function d(e){if(!e)return!1;try{const t=new URL(e);return n.some(o=>{const r=new URL(o);return t.origin===r.origin&&t.pathname.replace(/\/$/,"")===r.pathname})}catch{return!1}}const h="https://assets.decocache.com/decocms/b2e2f64f-6025-45f7-9e8c-3b3ebdd073d8/openrouter_logojpg.jpg";export{h as O,c as a,p as b,d as i};
@@ -1 +1 @@
1
- import{c as n,j as i,I as m,J as g,T as u,M as x,Q as j,U as N,W as b,X as D}from"./index-p3omciU2.js";import{i as h}from"./X-gSzwTkxQ.js";import{c}from"./button-SrN4bZ1L.js";function k(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(m,{"data-slot":"dialog",...t}),e[2]=t,e[3]=s):s=e[3],s}function w(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(D,{"data-slot":"dialog-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function v(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(j,{"data-slot":"dialog-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}function y(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/45 backdrop-blur-[0.15px]",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(N,{"data-slot":"dialog-overlay",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function $(l){const e=n.c(6),{className:t}=l;let s;e[0]!==t?(s=c("cursor-pointer ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground","absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2","focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[0]=t,e[1]=s):s=e[1];let a,o;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(h,{}),o=i.jsx("span",{className:"sr-only",children:"Close"}),e[2]=a,e[3]=o):(a=e[2],o=e[3]);let r;return e[4]!==s?(r=i.jsxs(b,{className:s,children:[a,o]}),e[4]=s,e[5]=r):r=e[5],r}function T(l){const e=n.c(15);let t,s,a,o;e[0]!==l?({className:s,children:t,closeButtonClassName:a,...o}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(y,{}),e[5]=r):r=e[5];let d;e[6]!==s?(d=c("bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border p-6 shadow-md duration-200 sm:max-w-lg",s),e[6]=s,e[7]=d):d=e[7];let f;e[8]!==a?(f=i.jsx($,{className:a}),e[8]=a,e[9]=f):f=e[9];let p;return e[10]!==t||e[11]!==o||e[12]!==d||e[13]!==f?(p=i.jsxs(v,{"data-slot":"dialog-portal",children:[r,i.jsxs(g,{"data-slot":"dialog-content",className:d,...o,children:[t,f]})]}),e[10]=t,e[11]=o,e[12]=d,e[13]=f,e[14]=p):p=e[14],p}function R(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col gap-2 text-center sm:text-left",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-header",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function B(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-footer",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function E(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-lg leading-none font-semibold",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(u,{"data-slot":"dialog-title",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function O(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(x,{"data-slot":"dialog-description",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{k as D,T as a,R as b,E as c,O as d,B as e,w as f};
1
+ import{c as n,j as i,I as m,J as g,T as u,M as x,Q as j,U as N,W as b,X as D}from"./index-BDPRLX-4.js";import{i as h}from"./X-DhzUfCBr.js";import{c}from"./button-TXPV9u45.js";function k(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(m,{"data-slot":"dialog",...t}),e[2]=t,e[3]=s):s=e[3],s}function w(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(D,{"data-slot":"dialog-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function v(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(j,{"data-slot":"dialog-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}function y(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/45 backdrop-blur-[0.15px]",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(N,{"data-slot":"dialog-overlay",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function $(l){const e=n.c(6),{className:t}=l;let s;e[0]!==t?(s=c("cursor-pointer ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground","absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2","focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[0]=t,e[1]=s):s=e[1];let a,o;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(h,{}),o=i.jsx("span",{className:"sr-only",children:"Close"}),e[2]=a,e[3]=o):(a=e[2],o=e[3]);let r;return e[4]!==s?(r=i.jsxs(b,{className:s,children:[a,o]}),e[4]=s,e[5]=r):r=e[5],r}function T(l){const e=n.c(15);let t,s,a,o;e[0]!==l?({className:s,children:t,closeButtonClassName:a,...o}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(y,{}),e[5]=r):r=e[5];let d;e[6]!==s?(d=c("bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border p-6 shadow-md duration-200 sm:max-w-lg",s),e[6]=s,e[7]=d):d=e[7];let f;e[8]!==a?(f=i.jsx($,{className:a}),e[8]=a,e[9]=f):f=e[9];let p;return e[10]!==t||e[11]!==o||e[12]!==d||e[13]!==f?(p=i.jsxs(v,{"data-slot":"dialog-portal",children:[r,i.jsxs(g,{"data-slot":"dialog-content",className:d,...o,children:[t,f]})]}),e[10]=t,e[11]=o,e[12]=d,e[13]=f,e[14]=p):p=e[14],p}function R(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col gap-2 text-center sm:text-left",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-header",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function B(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-footer",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function E(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-lg leading-none font-semibold",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(u,{"data-slot":"dialog-title",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function O(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(x,{"data-slot":"dialog-description",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{k as D,T as a,R as b,E as c,O as d,B as e,w as f};
@@ -1 +1 @@
1
- import{c,j as d,Y as p,Z as f,_ as m,$ as g,a0 as x,a1 as v,a2 as b,a3 as h,a4 as w,a5 as j,a6 as N,a7 as z}from"./index-p3omciU2.js";import{i as _}from"./Check-IyJXmB3D.js";import{i as $}from"./ChevronRight-CQzN9ZtD.js";import{c as u}from"./button-SrN4bZ1L.js";function k(n){const e=c.c(4);let t;e[0]!==n?({...t}=n,e[0]=n,e[1]=t):t=e[1];let s;return e[2]!==t?(s=d.jsx(p,{"data-slot":"dropdown-menu",...t}),e[2]=t,e[3]=s):s=e[3],s}function C(n){const e=c.c(4);let t;e[0]!==n?({...t}=n,e[0]=n,e[1]=t):t=e[1];let s;return e[2]!==t?(s=d.jsx(f,{"data-slot":"dropdown-menu-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function I(n){const e=c.c(10);let t,s,a;e[0]!==n?({className:t,sideOffset:a,...s}=n,e[0]=n,e[1]=t,e[2]=s,e[3]=a):(t=e[1],s=e[2],a=e[3]);const o=a===void 0?4:a;let r;e[4]!==t?(r=u("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-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border p-1 shadow-md",t),e[4]=t,e[5]=r):r=e[5];let i;return e[6]!==s||e[7]!==o||e[8]!==r?(i=d.jsx(m,{children:d.jsx(g,{"data-slot":"dropdown-menu-content",sideOffset:o,className:r,...s})}),e[6]=s,e[7]=o,e[8]=r,e[9]=i):i=e[9],i}function T(n){const e=c.c(12);let t,s,a,o;e[0]!==n?({className:t,inset:s,variant:o,...a}=n,e[0]=n,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);const r=o===void 0?"default":o;let i;e[5]!==t?(i=u("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-pointer items-center gap-2 rounded-lg 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",t),e[5]=t,e[6]=i):i=e[6];let l;return e[7]!==s||e[8]!==a||e[9]!==i||e[10]!==r?(l=d.jsx(x,{"data-slot":"dropdown-menu-item","data-inset":s,"data-variant":r,className:i,...a}),e[7]=s,e[8]=a,e[9]=i,e[10]=r,e[11]=l):l=e[11],l}function R(n){const e=c.c(13);let t,s,a,o;e[0]!==n?({className:a,children:s,checked:t,...o}=n,e[0]=n,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]!==a?(r=u("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-lg py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",a),e[5]=a,e[6]=r):r=e[6];let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:d.jsx(w,{children:d.jsx(_,{className:"size-4"})})}),e[7]=i):i=e[7];let l;return e[8]!==t||e[9]!==s||e[10]!==o||e[11]!==r?(l=d.jsxs(v,{"data-slot":"dropdown-menu-checkbox-item",className:r,checked:t,...o,children:[i,s]}),e[8]=t,e[9]=s,e[10]=o,e[11]=r,e[12]=l):l=e[12],l}function E(n){const e=c.c(10);let t,s,a;e[0]!==n?({className:t,inset:s,...a}=n,e[0]=n,e[1]=t,e[2]=s,e[3]=a):(t=e[1],s=e[2],a=e[3]);let o;e[4]!==t?(o=u("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",t),e[4]=t,e[5]=o):o=e[5];let r;return e[6]!==s||e[7]!==a||e[8]!==o?(r=d.jsx(b,{"data-slot":"dropdown-menu-label","data-inset":s,className:o,...a}),e[6]=s,e[7]=a,e[8]=o,e[9]=r):r=e[9],r}function L(n){const e=c.c(8);let t,s;e[0]!==n?({className:t,...s}=n,e[0]=n,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=u("bg-border -mx-1 my-1 h-px",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=d.jsx(h,{"data-slot":"dropdown-menu-separator",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function O(n){const e=c.c(4);let t;e[0]!==n?({...t}=n,e[0]=n,e[1]=t):t=e[1];let s;return e[2]!==t?(s=d.jsx(j,{"data-slot":"dropdown-menu-sub",...t}),e[2]=t,e[3]=s):s=e[3],s}function P(n){const e=c.c(13);let t,s,a,o;e[0]!==n?({className:s,inset:a,children:t,...o}=n,e[0]=n,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]!==s?(r=u("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",s),e[5]=s,e[6]=r):r=e[6];let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx($,{className:"ml-auto size-4"}),e[7]=i):i=e[7];let l;return e[8]!==t||e[9]!==a||e[10]!==o||e[11]!==r?(l=d.jsxs(N,{"data-slot":"dropdown-menu-sub-trigger","data-inset":a,className:r,...o,children:[t,i]}),e[8]=t,e[9]=a,e[10]=o,e[11]=r,e[12]=l):l=e[12],l}function Y(n){const e=c.c(8);let t,s;e[0]!==n?({className:t,...s}=n,e[0]=n,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=u("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 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=d.jsx(z,{"data-slot":"dropdown-menu-sub-content",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{k as D,C as a,I as b,T as c,O as d,P as e,Y as f,L as g,R as h,E as i};
1
+ import{c,j as d,Y as p,Z as f,_ as m,$ as g,a0 as x,a1 as v,a2 as b,a3 as h,a4 as w,a5 as j,a6 as N,a7 as z}from"./index-BDPRLX-4.js";import{i as _}from"./Check-DM3yWukQ.js";import{i as $}from"./ChevronRight-BKg32aVF.js";import{c as u}from"./button-TXPV9u45.js";function k(n){const e=c.c(4);let t;e[0]!==n?({...t}=n,e[0]=n,e[1]=t):t=e[1];let s;return e[2]!==t?(s=d.jsx(p,{"data-slot":"dropdown-menu",...t}),e[2]=t,e[3]=s):s=e[3],s}function C(n){const e=c.c(4);let t;e[0]!==n?({...t}=n,e[0]=n,e[1]=t):t=e[1];let s;return e[2]!==t?(s=d.jsx(f,{"data-slot":"dropdown-menu-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function I(n){const e=c.c(10);let t,s,a;e[0]!==n?({className:t,sideOffset:a,...s}=n,e[0]=n,e[1]=t,e[2]=s,e[3]=a):(t=e[1],s=e[2],a=e[3]);const o=a===void 0?4:a;let r;e[4]!==t?(r=u("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-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border p-1 shadow-md",t),e[4]=t,e[5]=r):r=e[5];let i;return e[6]!==s||e[7]!==o||e[8]!==r?(i=d.jsx(m,{children:d.jsx(g,{"data-slot":"dropdown-menu-content",sideOffset:o,className:r,...s})}),e[6]=s,e[7]=o,e[8]=r,e[9]=i):i=e[9],i}function T(n){const e=c.c(12);let t,s,a,o;e[0]!==n?({className:t,inset:s,variant:o,...a}=n,e[0]=n,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);const r=o===void 0?"default":o;let i;e[5]!==t?(i=u("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-pointer items-center gap-2 rounded-lg 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",t),e[5]=t,e[6]=i):i=e[6];let l;return e[7]!==s||e[8]!==a||e[9]!==i||e[10]!==r?(l=d.jsx(x,{"data-slot":"dropdown-menu-item","data-inset":s,"data-variant":r,className:i,...a}),e[7]=s,e[8]=a,e[9]=i,e[10]=r,e[11]=l):l=e[11],l}function R(n){const e=c.c(13);let t,s,a,o;e[0]!==n?({className:a,children:s,checked:t,...o}=n,e[0]=n,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]!==a?(r=u("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-lg py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",a),e[5]=a,e[6]=r):r=e[6];let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:d.jsx(w,{children:d.jsx(_,{className:"size-4"})})}),e[7]=i):i=e[7];let l;return e[8]!==t||e[9]!==s||e[10]!==o||e[11]!==r?(l=d.jsxs(v,{"data-slot":"dropdown-menu-checkbox-item",className:r,checked:t,...o,children:[i,s]}),e[8]=t,e[9]=s,e[10]=o,e[11]=r,e[12]=l):l=e[12],l}function E(n){const e=c.c(10);let t,s,a;e[0]!==n?({className:t,inset:s,...a}=n,e[0]=n,e[1]=t,e[2]=s,e[3]=a):(t=e[1],s=e[2],a=e[3]);let o;e[4]!==t?(o=u("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",t),e[4]=t,e[5]=o):o=e[5];let r;return e[6]!==s||e[7]!==a||e[8]!==o?(r=d.jsx(b,{"data-slot":"dropdown-menu-label","data-inset":s,className:o,...a}),e[6]=s,e[7]=a,e[8]=o,e[9]=r):r=e[9],r}function L(n){const e=c.c(8);let t,s;e[0]!==n?({className:t,...s}=n,e[0]=n,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=u("bg-border -mx-1 my-1 h-px",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=d.jsx(h,{"data-slot":"dropdown-menu-separator",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function O(n){const e=c.c(4);let t;e[0]!==n?({...t}=n,e[0]=n,e[1]=t):t=e[1];let s;return e[2]!==t?(s=d.jsx(j,{"data-slot":"dropdown-menu-sub",...t}),e[2]=t,e[3]=s):s=e[3],s}function P(n){const e=c.c(13);let t,s,a,o;e[0]!==n?({className:s,inset:a,children:t,...o}=n,e[0]=n,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]!==s?(r=u("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",s),e[5]=s,e[6]=r):r=e[6];let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx($,{className:"ml-auto size-4"}),e[7]=i):i=e[7];let l;return e[8]!==t||e[9]!==a||e[10]!==o||e[11]!==r?(l=d.jsxs(N,{"data-slot":"dropdown-menu-sub-trigger","data-inset":a,className:r,...o,children:[t,i]}),e[8]=t,e[9]=a,e[10]=o,e[11]=r,e[12]=l):l=e[12],l}function Y(n){const e=c.c(8);let t,s;e[0]!==n?({className:t,...s}=n,e[0]=n,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=u("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 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=d.jsx(z,{"data-slot":"dropdown-menu-sub-content",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{k as D,C as a,I as b,T as c,O as d,P as e,Y as f,L as g,R as h,E as i};