decocms 2.185.0 → 2.186.1

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 (262) hide show
  1. package/dist/client/assets/{AlertCircle-BO0kzcBv.js → AlertCircle-K-Pdcic9.js} +1 -1
  2. package/dist/client/assets/{ArrowLeft-CrI91Scn.js → ArrowLeft-DbjuKsKJ.js} +1 -1
  3. package/dist/client/assets/{ArrowUp-FfROzAyV.js → ArrowUp-CVgf-IuM.js} +1 -1
  4. package/dist/client/assets/{Check-BXqqUm0J.js → Check-5J8pLufa.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-B6V9GzuP.js → ChevronDown-azX3X6AX.js} +1 -1
  6. package/dist/client/assets/{ChevronRight-BSFLHUtv.js → ChevronRight-BU9wyepR.js} +1 -1
  7. package/dist/client/assets/{ChevronUp-BYpnL-9F.js → ChevronUp-ISSymo50.js} +1 -1
  8. package/dist/client/assets/{Container-BZeblIrR.js → Container-DO3SbooR.js} +1 -1
  9. package/dist/client/assets/{Dataflow03-CTwEKVcs.js → Dataflow03-DDjLJJPt.js} +1 -1
  10. package/dist/client/assets/{Download01-D7T-WxGL.js → Download01-CSi5s7rT.js} +1 -1
  11. package/dist/client/assets/{FolderClosed-BPzjOG-5.js → FolderClosed-DG1khNab.js} +1 -1
  12. package/dist/client/assets/{Grid01-Bwsn0nh2.js → Grid01-1OtRlqYA.js} +1 -1
  13. package/dist/client/assets/{List-Bq1Yvo6z.js → List-CD8zd6Wa.js} +1 -1
  14. package/dist/client/assets/{Loading01-DCKwAh-U.js → Loading01-CYdiDh3l.js} +1 -1
  15. package/dist/client/assets/{Play-Bw_aeuhq.js → Play-3YhDYx27.js} +1 -1
  16. package/dist/client/assets/{Plus-BW2fNoEy.js → Plus-V1Th1jdv.js} +1 -1
  17. package/dist/client/assets/{RefreshCcw01-YXuL16Jx.js → RefreshCcw01-Bk3rOtaE.js} +1 -1
  18. package/dist/client/assets/{SearchMd-C_bEWIlQ.js → SearchMd-BvvZzTkV.js} +1 -1
  19. package/dist/client/assets/{Settings01-BoOhxJJj.js → Settings01-BhEewSHV.js} +1 -1
  20. package/dist/client/assets/{Trash01-D9O3UWX6.js → Trash01-DEYpLJs9.js} +1 -1
  21. package/dist/client/assets/{Type01-CjsMMlh6.js → Type01-DPCWeoOo.js} +1 -1
  22. package/dist/client/assets/{Upload01-Bpjo_QI4.js → Upload01-CVsYMTIG.js} +1 -1
  23. package/dist/client/assets/{User01-BRC1qZ-u.js → User01-B6InEsCV.js} +1 -1
  24. package/dist/client/assets/{VideoRecorder-DkcbdsZk.js → VideoRecorder-DWwuCAKx.js} +1 -1
  25. package/dist/client/assets/{X-BL1q6dsE.js → X-DSEUOZBv.js} +1 -1
  26. package/dist/client/assets/{XCircle-DxcmI8rf.js → XCircle-BDF0JqjY.js} +1 -1
  27. package/dist/client/assets/{XClose-CslgPORS.js → XClose-C-lSsuAr.js} +1 -1
  28. package/dist/client/assets/{Zap-DERWnfoj.js → Zap-Md9DJ6rv.js} +1 -1
  29. package/dist/client/assets/{agent-connections-preview-Dq0Ojrk0.js → agent-connections-preview-BjYZmjl3.js} +1 -1
  30. package/dist/client/assets/{agent-detail-YxF3rQGf.js → agent-detail-Dj0OUG-D.js} +1 -1
  31. package/dist/client/assets/{agents-C2G5xDCJ.js → agents-DZR4cSbV.js} +1 -1
  32. package/dist/client/assets/{ai-providers-logos-BbTN2hb6.js → ai-providers-logos-pBxdceXx.js} +1 -1
  33. package/dist/client/assets/{alert-dialog-yWVMNVBj.js → alert-dialog-CJVLkF8s.js} +1 -1
  34. package/dist/client/assets/{auth-catchall-CTzVQ5KH.js → auth-catchall-CyapYNp9.js} +1 -1
  35. package/dist/client/assets/{automation-detail-MKjn-Qas.js → automation-detail-DUb_NKWf.js} +1 -1
  36. package/dist/client/assets/{automations-DpKH4m8F.js → automations-B339F6Fn.js} +1 -1
  37. package/dist/client/assets/{avatar-87qJKKK_.js → avatar-BiJdl6Xf.js} +1 -1
  38. package/dist/client/assets/{badge-C2jHxnoS.js → badge-BbY1Vzps.js} +1 -1
  39. package/dist/client/assets/{binder-BaB8rAtx.js → binder-3anAL5WI.js} +1 -1
  40. package/dist/client/assets/{breadcrumb-CBpEGiAs.js → breadcrumb-BM2hSfLB.js} +1 -1
  41. package/dist/client/assets/{card-CUrYBr2J.js → card-D1l6f7HS.js} +1 -1
  42. package/dist/client/assets/{checkbox-RHvkU3ym.js → checkbox-GcV7rItk.js} +1 -1
  43. package/dist/client/assets/{collapsible-BaB71DBr.js → collapsible-E7EbAleb.js} +1 -1
  44. package/dist/client/assets/{collection-detail-iBwR9WNE.js → collection-detail-md2_reRY.js} +1 -1
  45. package/dist/client/assets/{collection-display-button-BetF6DhL.js → collection-display-button-BN69LmBz.js} +1 -1
  46. package/dist/client/assets/{collection-search-DcVVKJ8Q.js → collection-search-CcVBsN85.js} +1 -1
  47. package/dist/client/assets/{collection-table-wrapper-D9WWtdCi.js → collection-table-wrapper-BPFLr1-v.js} +1 -1
  48. package/dist/client/assets/{collection-tabs-Df3Ptc0I.js → collection-tabs-BijGeHYB.js} +1 -1
  49. package/dist/client/assets/{command-CMOZJSSv.js → command-KtP0d-HZ.js} +1 -1
  50. package/dist/client/assets/{connection-card-CKJwNgpO.js → connection-card-DT3Fx28T.js} +1 -1
  51. package/dist/client/assets/{connection-detail-Dbycfmu5.js → connection-detail-DwgDpXcB.js} +1 -1
  52. package/dist/client/assets/{connections-jKPi1hZg.js → connections-C_kRN8jY.js} +1 -1
  53. package/dist/client/assets/{constants-Dzy_AMuL.js → constants-2OCwh60p.js} +1 -1
  54. package/dist/client/assets/constants-BwEgB5ct.js +1 -0
  55. package/dist/client/assets/{context-BL_7JbXZ.js → context-CuNDOhoh.js} +1 -1
  56. package/dist/client/assets/{create-organization-dialog-Cycga0XC.js → create-organization-dialog-Cd0g9HkW.js} +1 -1
  57. package/dist/client/assets/{create-project-dialog-BRQDkCBr.js → create-project-dialog-CU5VLoep.js} +1 -1
  58. package/dist/client/assets/{danger-D5sT_SDt.js → danger-CFl_eB5k.js} +1 -1
  59. package/dist/client/assets/{danger-zone-CI7wNXdQ.js → danger-zone-BSvLmne8.js} +1 -1
  60. package/dist/client/assets/{dependencies-XXGkpDMX.js → dependencies-DDWJJnWt.js} +1 -1
  61. package/dist/client/assets/{dialog-Dmm_af5q.js → dialog-D46ZA88r.js} +1 -1
  62. package/dist/client/assets/{drawer-SktUP7-X.js → drawer-DsEaI2mC.js} +1 -1
  63. package/dist/client/assets/{dropdown-menu-BtgYu0Kc.js → dropdown-menu-BJLjCuY0.js} +1 -1
  64. package/dist/client/assets/{dynamic-plugin-layout-DncjSb8M.js → dynamic-plugin-layout-DQu_PXGi.js} +1 -1
  65. package/dist/client/assets/{editable-task-title-DBtH_3H-.js → editable-task-title-BXxkXNIX.js} +1 -1
  66. package/dist/client/assets/{empty-state-Cx44yC3Y.js → empty-state-B7nlLEUe.js} +1 -1
  67. package/dist/client/assets/{empty-state-BgKAQr0C.js → empty-state-unH0aOxb.js} +1 -1
  68. package/dist/client/assets/{env-vars-editor-DPFQeE92.js → env-vars-editor-COVavLgR.js} +1 -1
  69. package/dist/client/assets/{extract-connection-data-Zw5RYEyS.js → extract-connection-data-BxATAvFG.js} +1 -1
  70. package/dist/client/assets/{file-browser-AWmMc57j.js → file-browser-Y37oB16s.js} +2 -2
  71. package/dist/client/assets/{form-Obbe7UIk.js → form-BC654cr0.js} +1 -1
  72. package/dist/client/assets/{general-DDuzkv9d.js → general-DnNKCd5D.js} +1 -1
  73. package/dist/client/assets/{grid-view-DsTxgJvN.js → grid-view-DBiOShLC.js} +1 -1
  74. package/dist/client/assets/{home-C1G2fDyc.js → home-DoIljK7E.js} +1 -1
  75. package/dist/client/assets/{index-DLW7tZdu.js → index-BRbdC8tb.js} +3 -3
  76. package/dist/client/assets/{index-BtvKqHu_.js → index-BbKz4tLm.js} +1 -1
  77. package/dist/client/assets/{index-CQPlxt4u.js → index-CKlHjZGl.js} +1 -1
  78. package/dist/client/assets/{index-CdQYIu_6.js → index-CvdTWVPu.js} +1 -1
  79. package/dist/client/assets/{index-CDNLqNNq.js → index-DSSbY8iZ.js} +1 -1
  80. package/dist/client/assets/{index-CdK7iTUb.js → index-DSiECZF0.js} +1 -1
  81. package/dist/client/assets/{index-B1ylaSc7.js → index-DW3Gddt1.js} +1 -1
  82. package/dist/client/assets/{index-DCtU4ndp.js → index-DhwDaiqy.js} +1 -1
  83. package/dist/client/assets/{index-C0Ne6xGI.js → index-Do980wUe.js} +1 -1
  84. package/dist/client/assets/{index-75eZ1uI1.js → index-P1BeuVDU.js} +1 -1
  85. package/dist/client/assets/{index-CUtX0cOT.js → index-Z-Bosamk.js} +1 -1
  86. package/dist/client/assets/{infiniteQueryObserver-BdQSrFrR.js → infiniteQueryObserver-DozliAIg.js} +1 -1
  87. package/dist/client/assets/{input-DgJ0xjPE.js → input-BOjviNKP.js} +1 -1
  88. package/dist/client/assets/{integration-icon-C-I4Z6Dk.js → integration-icon-BxAcqR_W.js} +1 -1
  89. package/dist/client/assets/{label-BL4fRnZZ.js → label-h0Vcc2GK.js} +1 -1
  90. package/dist/client/assets/{layout-p-PoyTJz.js → layout-B-xxTjgY.js} +1 -1
  91. package/dist/client/assets/{layout-DAuICUV3.js → layout-B1L9zKc4.js} +1 -1
  92. package/dist/client/assets/{login-Bvsz1l56.js → login-DGiUNRC7.js} +1 -1
  93. package/dist/client/assets/{logo-upload-CGF8q63h.js → logo-upload-PCOmxOCx.js} +1 -1
  94. package/dist/client/assets/{mcp-app-renderer-DzztYEVX.js → mcp-app-renderer-CRS3A1HB.js} +1 -1
  95. package/dist/client/assets/{mcp-server-card-Dz2MeUmM.js → mcp-server-card-B6PFNGFX.js} +1 -1
  96. package/dist/client/assets/{mcp-server-detail-cX9p8Afl.js → mcp-server-detail-oU638r_U.js} +2 -2
  97. package/dist/client/assets/{members-BX_g15fi.js → members-CNzL9zLR.js} +1 -1
  98. package/dist/client/assets/{monaco-editor-DX4p-sBy.js → monaco-editor-vJr8RDGl.js} +1 -1
  99. package/dist/client/assets/{monitoring-C9346vXd.js → monitoring-CxIOWArS.js} +1 -1
  100. package/dist/client/assets/{monitoring-dashboard-edit-cUuCGr6O.js → monitoring-dashboard-edit-DxfJ4WNy.js} +1 -1
  101. package/dist/client/assets/{monitoring-dashboard-view-DFc0vQzd.js → monitoring-dashboard-view-BL4nPi_-.js} +1 -1
  102. package/dist/client/assets/{monitoring-stats-row-BDkVd8_E.js → monitoring-stats-row-CrNnPzpZ.js} +1 -1
  103. package/dist/client/assets/{oauth-callback-Bt5QJgEG.js → oauth-callback-Cq38djsA.js} +1 -1
  104. package/dist/client/assets/{oauth-callback-ai-provider-DgK7Rkwm.js → oauth-callback-ai-provider-CYTOAGu5.js} +1 -1
  105. package/dist/client/assets/{org-ai-providers-DQw8Ry8m.js → org-ai-providers-DtsI9IWI.js} +1 -1
  106. package/dist/client/assets/{page-BPTnb_7u.js → page-CYpcNv9e.js} +1 -1
  107. package/dist/client/assets/{page-BNkRheIf.js → page-zavfyW1i.js} +1 -1
  108. package/dist/client/assets/{plugin-empty-state-DZ2dLLg8.js → plugin-empty-state-CgDAJvPC.js} +1 -1
  109. package/dist/client/assets/{plugin-empty-state-D5d0HyD_.js → plugin-empty-state-Dl_2Uo0y.js} +1 -1
  110. package/dist/client/assets/{plugin-header-DToCRz-E.js → plugin-header-D43xaGJs.js} +1 -1
  111. package/dist/client/assets/{plugin-header-DaNytvgS.js → plugin-header-Dv9ESxEb.js} +1 -1
  112. package/dist/client/assets/plugins-DBMyeN4D.js +1 -0
  113. package/dist/client/assets/{popover-DnM-fBUa.js → popover-DWheVeA1.js} +1 -1
  114. package/dist/client/assets/{project-app-view-BmSeum6S.js → project-app-view-9tWFjZrt.js} +1 -1
  115. package/dist/client/assets/{project-layout-B6exvEKF.js → project-layout-Dv-Q6xBk.js} +1 -1
  116. package/dist/client/assets/{project-plugins-CzyuvjoL.js → project-plugins-Bw8tiinl.js} +1 -1
  117. package/dist/client/assets/{projects-list-C1JxN737.js → projects-list-DokYG2lJ.js} +1 -1
  118. package/dist/client/assets/{registry-layout-D-kGw5vE.js → registry-layout-CxVYwTXn.js} +1 -1
  119. package/dist/client/assets/{registry-utils-D6No_i4P.js → registry-utils-BSd5ITwa.js} +1 -1
  120. package/dist/client/assets/{reset-password-CUY6IwDL.js → reset-password-C7Dj7QEf.js} +1 -1
  121. package/dist/client/assets/{resizable-CAbzuUb1.js → resizable-DixBhzs0.js} +1 -1
  122. package/dist/client/assets/{save-actions-DGqTWEQL.js → save-actions-qtl58c-n.js} +1 -1
  123. package/dist/client/assets/{scroll-area-BCIFp-8p.js → scroll-area-COTWSYpJ.js} +1 -1
  124. package/dist/client/assets/{select-DeOQOwBi.js → select-Duo4-kjU.js} +1 -1
  125. package/dist/client/assets/{select-virtual-mcp-B78FWMF5.js → select-virtual-mcp-DmwglbWt.js} +1 -1
  126. package/dist/client/assets/{shell-layout-BX9tUo-C.js → shell-layout-BKPGcmv4.js} +2 -2
  127. package/dist/client/assets/{sidebar-settings-CxzW8gJz.js → sidebar-settings-Bvnz3xIL.js} +1 -1
  128. package/dist/client/assets/{skeleton-BwiQLrEa.js → skeleton-CxmuAljC.js} +1 -1
  129. package/dist/client/assets/{spinner-D4Lh5lMu.js → spinner-Bvsf8yBr.js} +1 -1
  130. package/dist/client/assets/{store-invite-CdO_aWdO.js → store-invite-B3ZITnmR.js} +1 -1
  131. package/dist/client/assets/{switch-DqWbwfAd.js → switch-DgSoD5A_.js} +1 -1
  132. package/dist/client/assets/{table-CbTCyRX5.js → table-6Exocylh.js} +1 -1
  133. package/dist/client/assets/{tabs-zzjdf6a0.js → tabs-BawFIUQp.js} +1 -1
  134. package/dist/client/assets/{task-status-hmfgdVgC.js → task-status-DCcRj1iH.js} +32 -32
  135. package/dist/client/assets/tasks-BXLnBJIq.js +1 -0
  136. package/dist/client/assets/{tasks-panel-BKxSsDFe.js → tasks-panel-DWjSzHZC.js} +1 -1
  137. package/dist/client/assets/{textarea-CJ-1DHFH.js → textarea-DdRl57bf.js} +1 -1
  138. package/dist/client/assets/{time-range-picker-BBbi_2IF.js → time-range-picker-DOqabEZA.js} +1 -1
  139. package/dist/client/assets/{toggle-group-DaaATQ-5.js → toggle-group-B0IrEjNf.js} +1 -1
  140. package/dist/client/assets/{tools-list-DLZSPKIc.js → tools-list-DbIvei1P.js} +1 -1
  141. package/dist/client/assets/{tooltip-D-QYbPJS.js → tooltip-xl3GoSVP.js} +1 -1
  142. package/dist/client/assets/{topbar-portal-D3vr1IIh.js → topbar-portal-DVwzk_zs.js} +1 -1
  143. package/dist/client/assets/{types-vQT8OD6B.js → types-DPAE4wXV.js} +1 -1
  144. package/dist/client/assets/{use-automations-BIoacnri.js → use-automations-BTjhSzA_.js} +1 -1
  145. package/dist/client/assets/{use-collections-BJxMmWLX.js → use-collections-Bqp5H9bu.js} +1 -1
  146. package/dist/client/assets/{use-connection-DPMknCkO.js → use-connection-De5rVqrE.js} +1 -1
  147. package/dist/client/assets/{use-copy-CkgWv__W.js → use-copy-CogCWJQ7.js} +1 -1
  148. package/dist/client/assets/{use-create-virtual-mcp-pWj6n63S.js → use-create-virtual-mcp-CdSUPhk5.js} +1 -1
  149. package/dist/client/assets/{use-infinite-scroll-BU1rPA0T.js → use-infinite-scroll-CQVKBMoy.js} +1 -1
  150. package/dist/client/assets/{use-install-from-registry-C1XqHuwX.js → use-install-from-registry-D7V-rpJ0.js} +1 -1
  151. package/dist/client/assets/{use-list-state-B6nYBLyk.js → use-list-state-BtvQgv8T.js} +1 -1
  152. package/dist/client/assets/{use-mcp-prompts-BmK_9UQh.js → use-mcp-prompts-k7CgkVwI.js} +1 -1
  153. package/dist/client/assets/{use-mcp-resources-DQ2GW_FE.js → use-mcp-resources-BfKeTtfq.js} +1 -1
  154. package/dist/client/assets/{use-mcp-tools-KIPxuDyk.js → use-mcp-tools-iD-VGNhw.js} +1 -1
  155. package/dist/client/assets/{use-members-BRZ5u_Eq.js → use-members-CYI2sNHs.js} +1 -1
  156. package/dist/client/assets/{use-project-DVq_144v.js → use-project-DdgxiICX.js} +1 -1
  157. package/dist/client/assets/{use-store-discovery-aQCBFuCU.js → use-store-discovery-DdbArpnw.js} +1 -1
  158. package/dist/client/assets/{use-view-mode-lmHuCoZm.js → use-view-mode-BiSEdh0M.js} +1 -1
  159. package/dist/client/assets/{use-virtual-mcp-BEia5q72.js → use-virtual-mcp-DxTKYWLn.js} +1 -1
  160. package/dist/client/assets/useInfiniteQuery-DMnx1-Vs.js +1 -0
  161. package/dist/client/assets/{useMutation-BatnVMWS.js → useMutation-C_Uj7oOe.js} +1 -1
  162. package/dist/client/assets/useQuery-C31bP6Ck.js +1 -0
  163. package/dist/client/assets/useSuspenseInfiniteQuery-D-WGLpBh.js +1 -0
  164. package/dist/client/assets/{user-Aw6SqZpK.js → user-tg9kwvXU.js} +1 -1
  165. package/dist/client/assets/{workflow-CRjl6sOP.js → workflow-D6TrKvm2.js} +1 -1
  166. package/dist/client/index.html +1 -1
  167. package/package.json +1 -1
  168. package/dist/client/assets/constants-BTMGn0Px.js +0 -1
  169. package/dist/client/assets/plugins-LyhHmrtr.js +0 -1
  170. package/dist/client/assets/tasks-C6cfAkGR.js +0 -1
  171. package/dist/client/assets/useInfiniteQuery-DpWHrz5z.js +0 -1
  172. package/dist/client/assets/useQuery-YHvrmKkI.js +0 -1
  173. package/dist/client/assets/useSuspenseInfiniteQuery-Cv31oWYI.js +0 -1
  174. package/dist/server/node_modules/pg-int8/LICENSE +0 -13
  175. package/dist/server/node_modules/pg-int8/README.md +0 -16
  176. package/dist/server/node_modules/pg-int8/index.js +0 -100
  177. package/dist/server/node_modules/pg-int8/package.json +0 -24
  178. package/dist/server/node_modules/pg-pool/LICENSE +0 -21
  179. package/dist/server/node_modules/pg-pool/README.md +0 -357
  180. package/dist/server/node_modules/pg-pool/esm/index.mjs +0 -5
  181. package/dist/server/node_modules/pg-pool/index.js +0 -517
  182. package/dist/server/node_modules/pg-pool/package.json +0 -51
  183. package/dist/server/node_modules/pg-protocol/LICENSE +0 -21
  184. package/dist/server/node_modules/pg-protocol/README.md +0 -3
  185. package/dist/server/node_modules/pg-protocol/dist/b.d.ts +0 -1
  186. package/dist/server/node_modules/pg-protocol/dist/b.js +0 -23
  187. package/dist/server/node_modules/pg-protocol/dist/b.js.map +0 -1
  188. package/dist/server/node_modules/pg-protocol/dist/buffer-reader.d.ts +0 -15
  189. package/dist/server/node_modules/pg-protocol/dist/buffer-reader.js +0 -55
  190. package/dist/server/node_modules/pg-protocol/dist/buffer-reader.js.map +0 -1
  191. package/dist/server/node_modules/pg-protocol/dist/buffer-writer.d.ts +0 -16
  192. package/dist/server/node_modules/pg-protocol/dist/buffer-writer.js +0 -81
  193. package/dist/server/node_modules/pg-protocol/dist/buffer-writer.js.map +0 -1
  194. package/dist/server/node_modules/pg-protocol/dist/inbound-parser.test.d.ts +0 -1
  195. package/dist/server/node_modules/pg-protocol/dist/inbound-parser.test.js +0 -530
  196. package/dist/server/node_modules/pg-protocol/dist/inbound-parser.test.js.map +0 -1
  197. package/dist/server/node_modules/pg-protocol/dist/index.d.ts +0 -6
  198. package/dist/server/node_modules/pg-protocol/dist/index.js +0 -15
  199. package/dist/server/node_modules/pg-protocol/dist/index.js.map +0 -1
  200. package/dist/server/node_modules/pg-protocol/dist/messages.d.ts +0 -162
  201. package/dist/server/node_modules/pg-protocol/dist/messages.js +0 -160
  202. package/dist/server/node_modules/pg-protocol/dist/messages.js.map +0 -1
  203. package/dist/server/node_modules/pg-protocol/dist/outbound-serializer.test.d.ts +0 -1
  204. package/dist/server/node_modules/pg-protocol/dist/outbound-serializer.test.js +0 -252
  205. package/dist/server/node_modules/pg-protocol/dist/outbound-serializer.test.js.map +0 -1
  206. package/dist/server/node_modules/pg-protocol/dist/parser.d.ts +0 -24
  207. package/dist/server/node_modules/pg-protocol/dist/parser.js +0 -324
  208. package/dist/server/node_modules/pg-protocol/dist/parser.js.map +0 -1
  209. package/dist/server/node_modules/pg-protocol/dist/serializer.d.ts +0 -42
  210. package/dist/server/node_modules/pg-protocol/dist/serializer.js +0 -189
  211. package/dist/server/node_modules/pg-protocol/dist/serializer.js.map +0 -1
  212. package/dist/server/node_modules/pg-protocol/esm/index.js +0 -11
  213. package/dist/server/node_modules/pg-protocol/package.json +0 -45
  214. package/dist/server/node_modules/pg-protocol/src/b.ts +0 -25
  215. package/dist/server/node_modules/pg-protocol/src/buffer-reader.ts +0 -58
  216. package/dist/server/node_modules/pg-protocol/src/buffer-writer.ts +0 -85
  217. package/dist/server/node_modules/pg-protocol/src/inbound-parser.test.ts +0 -575
  218. package/dist/server/node_modules/pg-protocol/src/index.ts +0 -11
  219. package/dist/server/node_modules/pg-protocol/src/messages.ts +0 -262
  220. package/dist/server/node_modules/pg-protocol/src/outbound-serializer.test.ts +0 -276
  221. package/dist/server/node_modules/pg-protocol/src/parser.ts +0 -413
  222. package/dist/server/node_modules/pg-protocol/src/serializer.ts +0 -274
  223. package/dist/server/node_modules/pg-protocol/src/testing/buffer-list.ts +0 -67
  224. package/dist/server/node_modules/pg-protocol/src/testing/test-buffers.ts +0 -166
  225. package/dist/server/node_modules/pg-protocol/src/types/chunky.d.ts +0 -1
  226. package/dist/server/node_modules/pg-types/.travis.yml +0 -7
  227. package/dist/server/node_modules/pg-types/Makefile +0 -14
  228. package/dist/server/node_modules/pg-types/README.md +0 -75
  229. package/dist/server/node_modules/pg-types/index.d.ts +0 -137
  230. package/dist/server/node_modules/pg-types/index.js +0 -47
  231. package/dist/server/node_modules/pg-types/index.test-d.ts +0 -21
  232. package/dist/server/node_modules/pg-types/lib/arrayParser.js +0 -11
  233. package/dist/server/node_modules/pg-types/lib/binaryParsers.js +0 -257
  234. package/dist/server/node_modules/pg-types/lib/builtins.js +0 -73
  235. package/dist/server/node_modules/pg-types/lib/textParsers.js +0 -215
  236. package/dist/server/node_modules/pg-types/package.json +0 -42
  237. package/dist/server/node_modules/pg-types/test/index.js +0 -24
  238. package/dist/server/node_modules/pg-types/test/types.js +0 -597
  239. package/dist/server/node_modules/postgres-array/index.d.ts +0 -4
  240. package/dist/server/node_modules/postgres-array/index.js +0 -97
  241. package/dist/server/node_modules/postgres-array/license +0 -21
  242. package/dist/server/node_modules/postgres-array/package.json +0 -35
  243. package/dist/server/node_modules/postgres-array/readme.md +0 -43
  244. package/dist/server/node_modules/postgres-bytea/index.js +0 -33
  245. package/dist/server/node_modules/postgres-bytea/license +0 -21
  246. package/dist/server/node_modules/postgres-bytea/package.json +0 -34
  247. package/dist/server/node_modules/postgres-bytea/readme.md +0 -34
  248. package/dist/server/node_modules/postgres-date/index.js +0 -116
  249. package/dist/server/node_modules/postgres-date/license +0 -21
  250. package/dist/server/node_modules/postgres-date/package.json +0 -33
  251. package/dist/server/node_modules/postgres-date/readme.md +0 -49
  252. package/dist/server/node_modules/postgres-interval/index.d.ts +0 -20
  253. package/dist/server/node_modules/postgres-interval/index.js +0 -125
  254. package/dist/server/node_modules/postgres-interval/license +0 -21
  255. package/dist/server/node_modules/postgres-interval/package.json +0 -36
  256. package/dist/server/node_modules/postgres-interval/readme.md +0 -48
  257. package/dist/server/node_modules/split2/LICENSE +0 -13
  258. package/dist/server/node_modules/split2/README.md +0 -85
  259. package/dist/server/node_modules/split2/bench.js +0 -27
  260. package/dist/server/node_modules/split2/index.js +0 -141
  261. package/dist/server/node_modules/split2/package.json +0 -39
  262. package/dist/server/node_modules/split2/test.js +0 -409
@@ -1 +1 @@
1
- import{c as B,g as ve,e as be,u as ae,r as T,j as t,G as _e,O as X,v as I,B as U,t as Ce,I as Ne,w as Se,K as q}from"./index-DLW7tZdu.js";import{E as le}from"./empty-state-Cx44yC3Y.js";import{a as ce,V as we}from"./layout-p-PoyTJz.js";import{S as ke}from"./save-actions-DGqTWEQL.js";import{u as De}from"./ai-providers-logos-BbTN2hb6.js";import{T as Ae,a as Te,M as Ie,S as Z}from"./task-status-hmfgdVgC.js";import{V as ee}from"./select-virtual-mcp-B78FWMF5.js";import{I as Me,e as Ee,t as te}from"./integration-icon-C-I4Z6Dk.js";import{U as $e}from"./user-Aw6SqZpK.js";import{c as ze,b as Oe,d as Re,e as Q,f as Pe}from"./use-automations-BIoacnri.js";import{a as de}from"./index-75eZ1uI1.js";import{b as me,d as ue,c as pe,A as fe,e as xe,h as he,a as ge,f as ye}from"./alert-dialog-yWVMNVBj.js";import{b as se,d as Ve,c as Fe,e as Le,B as Ue,a as Be}from"./breadcrumb-CBpEGiAs.js";import{I as He}from"./input-DgJ0xjPE.js";import{c as re,a as Ke,d as Ge,e as We,f as qe,b as Qe,D as Je}from"./dropdown-menu-BtgYu0Kc.js";import{a as ne,b as oe,P as ie}from"./popover-DnM-fBUa.js";import{S as Ye}from"./switch-DqWbwfAd.js";import{T as Xe,a as Ze,b as et}from"./tooltip-D-QYbPJS.js";import{u as tt}from"./useQuery-YHvrmKkI.js";import{i as st,u as rt,a as nt}from"./constants-Dzy_AMuL.js";import{b as ot}from"./use-virtual-mcp-BEia5q72.js";import{i as it}from"./ArrowUp-FfROzAyV.js";import{s as H}from"./Type01-CjsMMlh6.js";import{i as G}from"./Loading01-DCKwAh-U.js";import{s as at}from"./Plus-BW2fNoEy.js";import{s as lt}from"./Trash01-D9O3UWX6.js";import{s as J}from"./XClose-CslgPORS.js";import{a as je,t as ct,b as dt}from"./context-BL_7JbXZ.js";import{f as mt}from"./formatDistanceToNow-Cb2QZZJn.js";import"./XCircle-DxcmI8rf.js";import"./skeleton-BwiQLrEa.js";import"./spinner-D4Lh5lMu.js";import"./use-mcp-prompts-BmK_9UQh.js";import"./dialog-Dmm_af5q.js";import"./X-BL1q6dsE.js";import"./form-Obbe7UIk.js";import"./label-BL4fRnZZ.js";import"./index-C0Ne6xGI.js";import"./usage-BW6ztpN6.js";import"./ChevronDown-B6V9GzuP.js";import"./org-ai-providers-DQw8Ry8m.js";import"./useMutation-BatnVMWS.js";import"./AlertCircle-BO0kzcBv.js";import"./RefreshCcw01-YXuL16Jx.js";import"./Play-Bw_aeuhq.js";import"./card-CUrYBr2J.js";import"./toggle-group-DaaATQ-5.js";import"./avatar-87qJKKK_.js";import"./User01-BRC1qZ-u.js";import"./select-DeOQOwBi.js";import"./index-BdQq_4o_.js";import"./index-CQPlxt4u.js";import"./Check-BXqqUm0J.js";import"./ChevronUp-BYpnL-9F.js";import"./ArrowLeft-CrI91Scn.js";import"./use-copy-CkgWv__W.js";import"./marked.esm-BaswSlok.js";import"./tabs-zzjdf6a0.js";import"./checkbox-RHvkU3ym.js";import"./drawer-SktUP7-X.js";import"./VideoRecorder-DkcbdsZk.js";import"./SearchMd-C_bEWIlQ.js";import"./Settings01-BoOhxJJj.js";import"./use-mcp-resources-DQ2GW_FE.js";import"./ChevronRight-BSFLHUtv.js";import"./collapsible-BaB71DBr.js";import"./index-B1ylaSc7.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-DzztYEVX.js";import"./types-vQT8OD6B.js";import"./use-collections-BJxMmWLX.js";import"./useSuspenseInfiniteQuery-Cv31oWYI.js";import"./infiniteQueryObserver-BdQSrFrR.js";import"./use-create-virtual-mcp-pWj6n63S.js";import"./Container-BZeblIrR.js";import"./Dataflow03-CTwEKVcs.js";import"./Download01-D7T-WxGL.js";import"./List-Bq1Yvo6z.js";import"./FolderClosed-BPzjOG-5.js";import"./Grid01-Bwsn0nh2.js";import"./Upload01-Bpjo_QI4.js";import"./Zap-DERWnfoj.js";import"./decopilot-events-Brt4gAR6.js";import"./index-CdK7iTUb.js";import"./differenceInSeconds-NQ4PDo0z.js";function K(s){const e=s.trim().split(/\s+/);return e.length!==5?!1:e.every(r=>/^[\d*/,\-]+$/.test(r))}function ut(s){if(!s)return"Unknown schedule";const e=s.trim();if(e==="* * * * *")return"Every minute";if(e==="0 * * * *")return"Every hour";if(e==="0 0 * * *")return"Every day";if(e==="0 0 * * 1")return"Every week";const r=e.match(/^\*\/(\d+)\s+\*\s+\*\s+\*\s+\*$/);if(r)return`Every ${r[1]} minutes`;const n=e.match(/^0\s+\*\/(\d+)\s+\*\s+\*\s+\*$/);if(n)return`Every ${n[1]} hours`;const o=e.match(/^0\s+0\s+\*\/(\d+)\s+\*\s+\*$/);if(o){const f=parseInt(o[1]??"1");return f%7===0?`Every ${f/7} weeks`:`Every ${f} days`}const a=e.match(/^(\d+)\s+(\d+)\s+\*\s+\*\s+\*$/);if(a){const f=(a[2]??"0").padStart(2,"0"),d=(a[1]??"0").padStart(2,"0");return`Every day at ${f}:${d} UTC`}const x=e.match(/^(\d+)\s+(\d+)\s+\*\s+\*\s+(\d)$/);if(x){const d=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][parseInt(x[3]??"0")]??"day",l=(x[2]??"0").padStart(2,"0"),y=(x[1]??"0").padStart(2,"0");return`Every ${d} at ${l}:${y} UTC`}return s}function pt(s,e){const r=Math.max(1,s);switch(e){case"minutes":return r===1?"* * * * *":`*/${r} * * * *`;case"hours":return r===1?"0 * * * *":`0 */${r} * * *`;case"days":return r===1?"0 0 * * *":`0 0 */${r} * *`;case"weeks":return r===1?"0 0 * * 1":`0 0 */${r*7} * *`}}function ft(s){const e=s.trim();if(e==="* * * * *")return{count:1,unit:"minutes"};if(e==="0 * * * *")return{count:1,unit:"hours"};if(e==="0 0 * * *")return{count:1,unit:"days"};if(e==="0 0 * * 1")return{count:1,unit:"weeks"};const r=e.match(/^\*\/(\d+)\s+\*\s+\*\s+\*\s+\*$/);if(r)return{count:parseInt(r[1]),unit:"minutes"};const n=e.match(/^0\s+\*\/(\d+)\s+\*\s+\*\s+\*$/);if(n)return{count:parseInt(n[1]),unit:"hours"};const o=e.match(/^0\s+0\s+\*\/(\d+)\s+\*\s+\*$/);if(o){const a=parseInt(o[1]);return a%7===0?{count:a/7,unit:"weeks"}:{count:a,unit:"days"}}return null}function xt(s,e){return e===1?{minutes:"minute",hours:"hour",days:"day",weeks:"week"}[s]??s:s}const ht=[{label:"Minute",cron:"* * * * *"},{label:"Hour",cron:"0 * * * *"},{label:"Day",cron:"0 0 * * *"},{label:"Week",cron:"0 0 * * 1"}];function gt(s){const e=B.c(26),{automationId:r,open:n,onOpenChange:o,onCustomSelect:a}=s,x=Q(),[f,d]=T.useState(!1),l=n??f;let y;e[0]!==o?(y=N=>{o?o(N):d(N)},e[0]=o,e[1]=y):y=e[1];const m=y;let j;e[2]!==x||e[3]!==r||e[4]!==m?(j=async N=>{try{await x.mutateAsync({automation_id:r,type:"cron",cron_expression:N}),I.success("Starter added"),m(!1)}catch(D){const A=D,g=A instanceof Error?A.message:"Failed to add starter";I.error(g)}},e[2]=x,e[3]=r,e[4]=m,e[5]=j):j=e[5];const S=j;let p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(Ke,{asChild:!0,children:t.jsxs(U,{variant:"outline",size:"sm",children:[t.jsx(at,{size:14}),"Add Starter"]})}),e[6]=p):p=e[6];let _;e[7]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsxs(Ge,{className:"gap-2.5",children:[t.jsx(H,{size:14,className:"text-muted-foreground shrink-0"}),"Every..."]}),e[7]=_):_=e[7];let v;e[8]!==x||e[9]!==S?(v=ht.map(N=>t.jsxs(re,{className:"gap-2.5",onSelect:()=>S(N.cron),disabled:x.isPending,children:[t.jsx(H,{size:14,className:"text-muted-foreground shrink-0"}),"Every ",N.label]},N.cron)),e[8]=x,e[9]=S,e[10]=v):v=e[10];let i;e[11]!==v?(i=t.jsxs(We,{children:[_,t.jsx(qe,{className:"w-[160px]",children:v})]}),e[11]=v,e[12]=i):i=e[12];let u;e[13]!==m||e[14]!==a?(u=()=>{m(!1),a?.()},e[13]=m,e[14]=a,e[15]=u):u=e[15];let b;e[16]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(H,{size:14,className:"text-muted-foreground shrink-0"}),e[16]=b):b=e[16];let h;e[17]!==u?(h=t.jsxs(re,{className:"gap-2.5",onSelect:u,children:[b,"Custom (cron)"]}),e[17]=u,e[18]=h):h=e[18];let C;e[19]!==i||e[20]!==h?(C=t.jsxs(Qe,{align:"end",className:"w-[200px]",children:[i,h]}),e[19]=i,e[20]=h,e[21]=C):C=e[21];let w;return e[22]!==m||e[23]!==l||e[24]!==C?(w=t.jsxs(Je,{open:l,onOpenChange:m,children:[p,C]}),e[22]=m,e[23]=l,e[24]=C,e[25]=w):w=e[25],w}function yt(s){const e=B.c(56),{trigger:r,automationId:n}=s,o=Pe(),a=Q(),[x,f]=T.useState(!1);let d;e[0]!==r.cron_expression?(d=r.cron_expression?ft(r.cron_expression):null,e[0]=r.cron_expression,e[1]=d):d=e[1];const l=d,[y,m]=T.useState(l?.count??1),[j,S]=T.useState(!1),[p,_]=T.useState(r.cron_expression??""),v=o.isPending||a.isPending,i=r.type==="cron";let u;e[2]!==n||e[3]!==o||e[4]!==r.id?(u=async()=>{try{await o.mutateAsync({trigger_id:r.id,automation_id:n}),I.success("Starter removed")}catch{I.error("Failed to remove starter")}f(!1)},e[2]=n,e[3]=o,e[4]=r.id,e[5]=u):u=e[5];const b=u;let h;e[6]!==a||e[7]!==n||e[8]!==p||e[9]!==o||e[10]!==r.cron_expression||e[11]!==r.id?(h=async()=>{const k=p.trim();if(!k||!K(k)||k===r.cron_expression){S(!1),_(r.cron_expression??"");return}try{await a.mutateAsync({automation_id:n,type:"cron",cron_expression:k}),await o.mutateAsync({trigger_id:r.id,automation_id:n}),S(!1)}catch{I.error("Failed to update starter"),_(r.cron_expression??""),S(!1)}},e[6]=a,e[7]=n,e[8]=p,e[9]=o,e[10]=r.cron_expression,e[11]=r.id,e[12]=h):h=e[12];const C=h;let w;e[13]!==a||e[14]!==n||e[15]!==l||e[16]!==o||e[17]!==r.cron_expression||e[18]!==r.id?(w=async k=>{if(!l)return;const W=Math.max(1,k),c=pt(W,l.unit);if(c!==r.cron_expression)try{await a.mutateAsync({automation_id:n,type:"cron",cron_expression:c}),await o.mutateAsync({trigger_id:r.id,automation_id:n})}catch{I.error("Failed to update starter"),m(l.count)}},e[13]=a,e[14]=n,e[15]=l,e[16]=o,e[17]=r.cron_expression,e[18]=r.id,e[19]=w):w=e[19];const N=w;let D;e[20]===Symbol.for("react.memo_cache_sentinel")?(D=t.jsx(H,{size:14,className:"text-muted-foreground shrink-0"}),e[20]=D):D=e[20];let A;e[21]!==y||e[22]!==p||e[23]!==N||e[24]!==C||e[25]!==l||e[26]!==i||e[27]!==j||e[28]!==v||e[29]!==r.cron_expression||e[30]!==r.event_type?(A=l&&i?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-sm text-muted-foreground",children:"Every"}),t.jsx("input",{type:"number",min:1,value:y,onChange:k=>m(parseInt(k.target.value)||1),onBlur:()=>N(y),onKeyDown:k=>{k.key==="Enter"&&k.target.blur(),k.key==="Escape"&&m(l.count)},disabled:v,className:"w-12 text-center text-sm h-7 border border-border rounded-md bg-background px-1 focus:outline-none focus:ring-1 focus:ring-ring"}),t.jsx("span",{className:"text-sm",children:xt(l.unit,y)})]}):i&&j?t.jsxs(t.Fragment,{children:[t.jsx("input",{type:"text",value:p,onChange:k=>_(k.target.value),onBlur:C,onKeyDown:k=>{k.key==="Enter"&&k.target.blur(),k.key==="Escape"&&(S(!1),_(r.cron_expression??""))},className:"flex-1 text-sm font-mono bg-transparent outline-none",autoFocus:!0}),p&&!K(p)&&t.jsx("span",{className:"text-xs text-muted-foreground/60 shrink-0",children:"invalid"})]}):t.jsx("span",{className:"text-sm flex-1 font-mono text-xs text-muted-foreground",children:i?ut(r.cron_expression??""):`${r.event_type} event`}),e[21]=y,e[22]=p,e[23]=N,e[24]=C,e[25]=l,e[26]=i,e[27]=j,e[28]=v,e[29]=r.cron_expression,e[30]=r.event_type,e[31]=A):A=e[31];let g;e[32]!==v?(g=v&&t.jsx(G,{size:13,className:"animate-spin text-muted-foreground"}),e[32]=v,e[33]=g):g=e[33];let z;e[34]!==l||e[35]!==i||e[36]!==j||e[37]!==r.cron_expression?(z=i&&!l&&!j&&t.jsx(U,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>{_(r.cron_expression??""),S(!0)},children:t.jsx(Ee,{size:13,className:"text-muted-foreground"})}),e[34]=l,e[35]=i,e[36]=j,e[37]=r.cron_expression,e[38]=z):z=e[38];let R;e[39]===Symbol.for("react.memo_cache_sentinel")?(R=t.jsx(U,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>f(!0),children:t.jsx(J,{size:13,className:"text-muted-foreground"})}),e[39]=R):R=e[39];let M;e[40]!==g||e[41]!==z?(M=t.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[g,z,R]}),e[40]=g,e[41]=z,e[42]=M):M=e[42];let O;e[43]!==M||e[44]!==A?(O=t.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2.5 rounded-lg border border-border bg-background group",children:[D,A,M]}),e[43]=M,e[44]=A,e[45]=O):O=e[45];let P;e[46]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsxs(me,{children:[t.jsx(pe,{children:"Remove Starter"}),t.jsx(ue,{children:"Are you sure you want to remove this starter?"})]}),e[46]=P):P=e[46];let V;e[47]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsx(fe,{children:"Cancel"}),e[47]=V):V=e[47];let E;e[48]!==b?(E=t.jsxs(ge,{children:[P,t.jsxs(xe,{children:[V,t.jsx(he,{onClick:b,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Remove"})]})]}),e[48]=b,e[49]=E):E=e[49];let $;e[50]!==x||e[51]!==E?($=t.jsx(ye,{open:x,onOpenChange:f,children:E}),e[50]=x,e[51]=E,e[52]=$):$=e[52];let F;return e[53]!==O||e[54]!==$?(F=t.jsxs(t.Fragment,{children:[O,$]}),e[53]=O,e[54]=$,e[55]=F):F=e[55],F}function jt(s){const e=B.c(41),{selectedId:r,onChange:n}=s,[o,a]=T.useState(!1),x=ot();let f,d;e[0]!==x||e[1]!==r?(d=x.filter(vt),f=r?d.find(p=>p.id===r):null,e[0]=x,e[1]=r,e[2]=f,e[3]=d):(f=e[2],d=e[3]);const l=f;if(l){let p;e[4]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(te,{size:16}),e[4]=p):p=e[4];let _;e[5]!==l.icon||e[6]!==l.title?(_=t.jsx(Me,{icon:l.icon,name:l.title,size:"sm",fallbackIcon:p,className:"rounded-md shrink-0"}),e[5]=l.icon,e[6]=l.title,e[7]=_):_=e[7];let v;e[8]!==l.title?(v=t.jsx("span",{className:"text-sm font-medium truncate",children:l.title}),e[8]=l.title,e[9]=v):v=e[9];let i;e[10]!==_||e[11]!==v?(i=t.jsx(ne,{asChild:!0,children:t.jsxs("button",{type:"button",className:"flex items-center gap-3 flex-1 min-w-0 text-left cursor-pointer",children:[_,v]})}),e[10]=_,e[11]=v,e[12]=i):i=e[12];let u;e[13]!==n?(u=A=>{n(A),a(!1)},e[13]=n,e[14]=u):u=e[14];let b;e[15]!==r||e[16]!==u||e[17]!==d?(b=t.jsx(oe,{className:"w-[550px] p-0 overflow-hidden",align:"start",sideOffset:8,children:t.jsx(ee,{virtualMcps:d,selectedVirtualMcpId:r,onVirtualMcpChange:u})}),e[15]=r,e[16]=u,e[17]=d,e[18]=b):b=e[18];let h;e[19]!==o||e[20]!==i||e[21]!==b?(h=t.jsxs(ie,{open:o,onOpenChange:a,children:[i,b]}),e[19]=o,e[20]=i,e[21]=b,e[22]=h):h=e[22];let C;e[23]!==n?(C=()=>n(null),e[23]=n,e[24]=C):C=e[24];let w;e[25]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(J,{size:13}),e[25]=w):w=e[25];let N;e[26]!==C?(N=t.jsx(U,{type:"button",variant:"ghost",size:"icon",className:"shrink-0 size-7 text-muted-foreground hover:text-foreground",onClick:C,title:"Remove agent",children:w}),e[26]=C,e[27]=N):N=e[27];let D;return e[28]!==N||e[29]!==h?(D=t.jsxs("div",{className:"flex items-center gap-3 px-3 py-2.5 rounded-lg border border-border bg-background hover:bg-accent/50 transition-colors",children:[h,N]}),e[28]=N,e[29]=h,e[30]=D):D=e[30],D}let y;e[31]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(ne,{asChild:!0,children:t.jsxs("button",{type:"button",className:"flex items-center gap-3 px-3 py-2.5 rounded-lg border border-border hover:bg-accent/50 transition-colors w-full text-left cursor-pointer",children:[t.jsxs("div",{className:"relative flex items-center justify-center size-8 rounded-md text-muted-foreground/75 shrink-0",children:[t.jsxs("svg",{className:"absolute inset-0 size-full",fill:"none",children:[t.jsx("defs",{children:t.jsxs("linearGradient",{id:"agent-picker-border-gradient",gradientUnits:"userSpaceOnUse",x1:"0",y1:"0",x2:"32",y2:"32",children:[t.jsx("animateTransform",{attributeName:"gradientTransform",type:"rotate",from:"0 16 16",to:"360 16 16",dur:"6s",repeatCount:"indefinite"}),t.jsx("stop",{offset:"0%",stopColor:"var(--chart-1)"}),t.jsx("stop",{offset:"100%",stopColor:"var(--chart-4)"})]})}),t.jsx("rect",{x:"0.5",y:"0.5",width:"31",height:"31",rx:"5.5",stroke:"url(#agent-picker-border-gradient)",strokeWidth:"1",strokeDasharray:"3 3"})]}),t.jsx(te,{size:16})]}),t.jsx("span",{className:"text-sm text-muted-foreground",children:"No agent selected. All connections available."})]})}),e[31]=y):y=e[31];let m;e[32]!==n?(m=p=>{n(p),a(!1)},e[32]=n,e[33]=m):m=e[33];let j;e[34]!==r||e[35]!==m||e[36]!==d?(j=t.jsx(oe,{className:"w-[550px] p-0 overflow-hidden",align:"start",sideOffset:8,children:t.jsx(ee,{virtualMcps:d,selectedVirtualMcpId:r,onVirtualMcpChange:m})}),e[34]=r,e[35]=m,e[36]=d,e[37]=j):j=e[37];let S;return e[38]!==o||e[39]!==j?(S=t.jsxs(ie,{open:o,onOpenChange:a,children:[y,j]}),e[38]=o,e[39]=j,e[40]=S):S=e[40],S}function vt(s){return!s.id||!st(s.id)}function bt({automationId:s,automation:e}){const r=Re(),{createTask:n,setVirtualMcpId:o,setSelectedModel:a,sendMessage:x,credentialId:f,model:d}=je(),[,l]=de(),y=e.messages?.[0]?.metadata?.tiptapDoc??void 0,[m,j]=T.useState(y),[S,p]=T.useState(y),[_,v]=T.useState(!1),[i,u]=T.useState(!1),[b,h]=T.useState(""),C=Q(),w=T.useRef(!1),N=c=>{j(c),w.current||(w.current=!0,y||p(c))},D=e.models?.credentialId||f||"",A=e.models?.thinking?.id||d?.modelId||"",g=Ce({defaultValues:{name:e.name,active:e.active,agent_id:e.agent?.id??"",credential_id:D,model_id:A}}),z=g.watch("active"),R=g.watch("agent_id"),M=g.watch("credential_id"),O=g.watch("model_id"),{models:P,isLoading:V}=De(M||void 0),E=P.find(c=>c.modelId===O)??null,$=async()=>{const c=g.getValues();try{const L=c.credential_id&&c.model_id?c.credential_id:"",Y=c.credential_id&&c.model_id?c.model_id:"";return await r.mutateAsync({id:s,name:c.name,active:c.active,agent:{id:c.agent_id},models:{credentialId:L,thinking:{id:Y}},messages:ct(m),temperature:0}),g.reset({...c,credential_id:L,model_id:Y}),p(m),I.success("Automation saved"),!0}catch{return I.error("Failed to save automation"),!1}},F=()=>{g.reset(),N(S)},k=g.formState.isDirty||JSON.stringify(m??null)!==JSON.stringify(S??null),W=async()=>{if(k&&!await $())return;if(!m){I.error("No instructions configured for this automation");return}const c=g.getValues();o(c.agent_id||null),E&&M&&a({...E,keyId:M}),l(!0),n(),setTimeout(()=>{x(m,{toolApprovalLevel:"auto"})},0)};return t.jsxs(t.Fragment,{children:[t.jsx(ce,{children:t.jsx(ke,{onSave:async()=>{await $()},onUndo:F,isDirty:k,isSaving:r.isPending})}),t.jsxs("div",{className:"max-w-2xl mx-auto w-full px-6 py-6 flex flex-col gap-8",children:[t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx(He,{...g.register("name"),placeholder:"Automation name",className:"border border-transparent shadow-none px-0 text-2xl md:text-2xl font-semibold h-auto focus-visible:ring-0 focus-visible:border-border bg-transparent"}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Ne,{control:g.control,name:"active",render:({field:c})=>t.jsx(Ye,{checked:c.value,onCheckedChange:c.onChange,className:"cursor-pointer"})}),t.jsx("span",{className:"text-sm text-muted-foreground",children:z?"Active":"Inactive"}),t.jsx("span",{className:"text-muted-foreground/50 text-sm",children:"·"}),t.jsx($e,{id:e.created_by,size:"2xs",className:"text-sm text-muted-foreground"})]})]}),t.jsxs("div",{className:"flex flex-col gap-2.5",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:"Starter"}),t.jsx(gt,{automationId:s,open:_,onOpenChange:v,onCustomSelect:()=>{u(!0),h("")}})]}),e.triggers.length===0&&!i?t.jsx("div",{className:"rounded-lg border border-dashed border-border px-4 py-6 text-center",children:t.jsxs("p",{className:"text-sm text-muted-foreground",children:["When should this automation run?"," ",t.jsx("button",{type:"button",className:"text-foreground underline underline-offset-2 cursor-pointer hover:text-foreground/80 transition-colors",onClick:()=>v(!0),children:"Add a starter"})," ","to get going."]})}):t.jsx("div",{className:"flex flex-col gap-2",children:e.triggers.map(c=>t.jsx(yt,{trigger:c,automationId:s},c.id))}),i&&t.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2.5 rounded-lg border border-border bg-background group",children:[t.jsx(H,{size:14,className:"text-muted-foreground shrink-0"}),t.jsx("input",{type:"text",value:b,onChange:c=>h(c.target.value),onBlur:async()=>{const c=b.trim();if(!(!c||!K(c)))try{await C.mutateAsync({automation_id:s,type:"cron",cron_expression:c}),I.success("Starter added"),u(!1),h("")}catch{I.error("Failed to add starter")}},onKeyDown:async c=>{const L=b.trim();c.key==="Enter"&&L&&K(L)&&c.target.blur(),c.key==="Escape"&&(u(!1),h(""))},placeholder:"0 9 * * 1-5",className:"flex-1 text-sm font-mono bg-transparent outline-none placeholder:text-muted-foreground/40",autoFocus:!0}),b&&!K(b)&&t.jsx("span",{className:"text-xs text-muted-foreground/60 shrink-0",children:"invalid"}),C.isPending&&t.jsx(G,{size:13,className:"animate-spin text-muted-foreground shrink-0"}),t.jsx("button",{type:"button",className:"shrink-0 p-0.5 rounded text-muted-foreground opacity-0 group-hover:opacity-100 hover:text-foreground transition-opacity",onClick:()=>{u(!1),h("")},children:t.jsx(J,{size:13})})]})]}),t.jsxs("div",{className:"flex flex-col gap-2.5",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:"Agent"}),t.jsx(jt,{selectedId:R||null,onChange:c=>g.setValue("agent_id",c??"",{shouldDirty:!0})})]}),t.jsxs("div",{className:"flex flex-col gap-2.5",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:"Instructions"}),t.jsx(Ae,{tiptapDoc:m,setTiptapDoc:N,placeholder:"What should this automation do?",children:t.jsxs("div",{className:"rounded-xl border border-border min-h-[120px] flex flex-col",children:[t.jsx(Te,{virtualMcpId:R||null}),t.jsxs("div",{className:"flex items-center justify-end gap-1.5 p-2.5",children:[t.jsx(Ie,{model:E,isLoading:V,credentialId:M||null,onCredentialChange:c=>{g.setValue("credential_id",c??"",{shouldDirty:!0}),g.setValue("model_id","",{shouldDirty:!0})},onModelChange:c=>g.setValue("model_id",c.modelId,{shouldDirty:!0}),placeholder:"Model"}),t.jsxs(Xe,{children:[t.jsx(Ze,{asChild:!0,children:t.jsxs(U,{type:"button",variant:"default",className:"h-8 gap-1.5 rounded-md px-3 text-sm font-medium",onClick:W,children:[t.jsx(it,{size:16}),"Test"]})}),t.jsx(et,{children:"Test Automation"})]})]})]})})]}),t.jsxs("div",{className:"flex flex-col gap-2.5",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:"Run History"}),t.jsx(Ct,{automationId:s,triggerIds:e.triggers.map(c=>c.id)})]})]})]})}function _t(s,e,r){const n=B.c(13);let o;n[0]!==s?(o={connectionId:nt,orgId:s},n[0]=s,n[1]=o):o=n[1];const a=rt(o);let x;n[2]!==e||n[3]!==s||n[4]!==r?(x=q.automationRuns(s,e,r),n[2]=e,n[3]=s,n[4]=r,n[5]=x):x=n[5];let f;n[6]!==a||n[7]!==r?(f=async()=>{if(!a)throw new Error("MCP client not available");const y=await a.callTool({name:"COLLECTION_THREADS_LIST",arguments:{where:{trigger_ids:r},limit:20}});return(y.structuredContent??y).items??[]},n[6]=a,n[7]=r,n[8]=f):f=n[8];const d=r.length>0;let l;return n[9]!==x||n[10]!==f||n[11]!==d?(l={queryKey:x,queryFn:f,enabled:d},n[9]=x,n[10]=f,n[11]=d,n[12]=l):l=n[12],tt(l)}function Ct(s){const e=B.c(22),{automationId:r,triggerIds:n}=s,{org:o}=ae(),{switchToTask:a}=je(),[,x]=de(),f=Se(),{data:d,isLoading:l}=_t(o.id,r,n),y=n.length>0;let m;e[0]!==r||e[1]!==o.id||e[2]!==f||e[3]!==d||e[4]!==n?(m=i=>{const u=i.subject,b=d??[];b.find(C=>C.id===u)?f.setQueryData(q.automationRuns(o.id,r,n),b.map(C=>C.id===u?{...C,status:i.data.status,updated_at:new Date().toISOString()}:C)):f.invalidateQueries({queryKey:q.automationRuns(o.id,r,n)})},e[0]=r,e[1]=o.id,e[2]=f,e[3]=d,e[4]=n,e[5]=m):m=e[5];let j;if(e[6]!==o.id||e[7]!==y||e[8]!==m?(j={orgId:o.id,enabled:y,onTaskStatus:m},e[6]=o.id,e[7]=y,e[8]=m,e[9]=j):j=e[9],dt(j),l){let i;return e[10]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("div",{className:"flex items-center justify-center py-8",children:t.jsx(G,{size:18,className:"animate-spin text-muted-foreground"})}),e[10]=i):i=e[10],i}if(!d||d.length===0){let i;return e[11]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(le,{image:null,className:"mt-6",title:"No run history",description:"Run history will appear here when the automation has been triggered."}),e[11]=i):i=e[11],i}let S;e[12]!==x||e[13]!==a?(S=async i=>{await a(i),x(!0)},e[12]=x,e[13]=a,e[14]=S):S=e[14];const p=S;let _;if(e[15]!==p||e[16]!==d){let i;e[18]!==p?(i=u=>{const b=Z[u.status]??Z.completed,h=b.icon;return t.jsxs("button",{type:"button",className:"flex items-center gap-3 px-1 py-2.5 text-left hover:bg-accent/50 transition-colors cursor-pointer rounded-sm",onClick:()=>p(u.id),children:[t.jsx(h,{size:16,className:b.iconClassName}),t.jsx("span",{className:"flex-1 min-w-0 text-sm truncate",children:u.title}),t.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:mt(new Date(u.updated_at),{addSuffix:!0})})]},u.id)},e[18]=p,e[19]=i):i=e[19],_=d.map(i),e[15]=p,e[16]=d,e[17]=_}else _=e[17];let v;return e[20]!==_?(v=t.jsx("div",{className:"flex flex-col divide-y divide-border",children:_}),e[20]=_,e[21]=v):v=e[21],v}function tr(){const s=B.c(36);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},s[0]=e):e=s[0];const{automationId:r}=ve(e),n=be(),{org:o}=ae(),{data:a,isLoading:x}=ze(r),f=Oe(),[d,l]=T.useState(!1);let y;s[1]!==r||s[2]!==f||s[3]!==n||s[4]!==o?(y=async()=>{try{await f.mutateAsync(r),I.success("Automation deleted"),n({to:"/$org/$project/automations",params:{org:o.slug,project:X}})}catch{I.error("Failed to delete automation")}l(!1)},s[1]=r,s[2]=f,s[3]=n,s[4]=o,s[5]=y):y=s[5];const m=y;if(x){let g;return s[6]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("div",{className:"flex items-center justify-center h-full",children:t.jsx(G,{size:24,className:"animate-spin text-muted-foreground"})}),s[6]=g):g=s[6],g}if(!a){let g;return s[7]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(le,{title:"Automation not found",description:"This automation may have been deleted."}),s[7]=g):g=s[7],g}let j;s[8]!==o.slug?(j=t.jsx(se,{children:t.jsx(Ve,{asChild:!0,children:t.jsx(_e,{to:"/$org/$project/automations",params:{org:o.slug,project:X},children:"Automations"})})}),s[8]=o.slug,s[9]=j):j=s[9];let S;s[10]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(Le,{}),s[10]=S):S=s[10];let p;s[11]!==a.name?(p=t.jsx(se,{children:t.jsx(Fe,{children:a.name})}),s[11]=a.name,s[12]=p):p=s[12];let _;s[13]!==j||s[14]!==p?(_=t.jsx(Ue,{children:t.jsxs(Be,{children:[j,S,p]})}),s[13]=j,s[14]=p,s[15]=_):_=s[15];const v=_;let i;s[16]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(ce,{children:t.jsxs(U,{variant:"ghost",size:"sm",className:"h-7 text-destructive hover:text-destructive",onClick:()=>l(!0),children:[t.jsx(lt,{size:14}),"Delete"]})}),s[16]=i):i=s[16];let u;s[17]!==a||s[18]!==r?(u=t.jsx(bt,{automationId:r,automation:a},r),s[17]=a,s[18]=r,s[19]=u):u=s[19];let b;s[20]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(pe,{children:"Delete Automation"}),s[20]=b):b=s[20];let h;s[21]!==a.name?(h=t.jsxs(me,{children:[b,t.jsxs(ue,{children:['Are you sure you want to delete "',a.name,'"? This action cannot be undone.']})]}),s[21]=a.name,s[22]=h):h=s[22];let C;s[23]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(fe,{children:"Cancel"}),s[23]=C):C=s[23];let w;s[24]!==m?(w=t.jsxs(xe,{children:[C,t.jsx(he,{onClick:m,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),s[24]=m,s[25]=w):w=s[25];let N;s[26]!==w||s[27]!==h?(N=t.jsxs(ge,{children:[h,w]}),s[26]=w,s[27]=h,s[28]=N):N=s[28];let D;s[29]!==d||s[30]!==N?(D=t.jsx(ye,{open:d,onOpenChange:l,children:N}),s[29]=d,s[30]=N,s[31]=D):D=s[31];let A;return s[32]!==v||s[33]!==D||s[34]!==u?(A=t.jsxs(we,{breadcrumb:v,children:[i,u,D]}),s[32]=v,s[33]=D,s[34]=u,s[35]=A):A=s[35],A}export{tr as default};
1
+ import{c as B,g as ve,e as be,u as ae,r as T,j as t,G as _e,O as X,v as I,B as U,t as Ce,I as Ne,w as Se,K as q}from"./index-BRbdC8tb.js";import{E as le}from"./empty-state-B7nlLEUe.js";import{a as ce,V as we}from"./layout-B-xxTjgY.js";import{S as ke}from"./save-actions-qtl58c-n.js";import{u as De}from"./ai-providers-logos-pBxdceXx.js";import{T as Ae,a as Te,M as Ie,S as Z}from"./task-status-DCcRj1iH.js";import{V as ee}from"./select-virtual-mcp-DmwglbWt.js";import{I as Me,e as Ee,t as te}from"./integration-icon-BxAcqR_W.js";import{U as $e}from"./user-tg9kwvXU.js";import{c as ze,b as Oe,d as Re,e as Q,f as Pe}from"./use-automations-BTjhSzA_.js";import{a as de}from"./index-P1BeuVDU.js";import{b as me,d as ue,c as pe,A as fe,e as xe,h as he,a as ge,f as ye}from"./alert-dialog-CJVLkF8s.js";import{b as se,d as Ve,c as Fe,e as Le,B as Ue,a as Be}from"./breadcrumb-BM2hSfLB.js";import{I as He}from"./input-BOjviNKP.js";import{c as re,a as Ke,d as Ge,e as We,f as qe,b as Qe,D as Je}from"./dropdown-menu-BJLjCuY0.js";import{a as ne,b as oe,P as ie}from"./popover-DWheVeA1.js";import{S as Ye}from"./switch-DgSoD5A_.js";import{T as Xe,a as Ze,b as et}from"./tooltip-xl3GoSVP.js";import{u as tt}from"./useQuery-C31bP6Ck.js";import{i as st,u as rt,a as nt}from"./constants-2OCwh60p.js";import{b as ot}from"./use-virtual-mcp-DxTKYWLn.js";import{i as it}from"./ArrowUp-CVgf-IuM.js";import{s as H}from"./Type01-DPCWeoOo.js";import{i as G}from"./Loading01-CYdiDh3l.js";import{s as at}from"./Plus-V1Th1jdv.js";import{s as lt}from"./Trash01-DEYpLJs9.js";import{s as J}from"./XClose-C-lSsuAr.js";import{a as je,t as ct,b as dt}from"./context-CuNDOhoh.js";import{f as mt}from"./formatDistanceToNow-Cb2QZZJn.js";import"./XCircle-BDF0JqjY.js";import"./skeleton-CxmuAljC.js";import"./spinner-Bvsf8yBr.js";import"./use-mcp-prompts-k7CgkVwI.js";import"./dialog-D46ZA88r.js";import"./X-DSEUOZBv.js";import"./form-BC654cr0.js";import"./label-h0Vcc2GK.js";import"./index-Do980wUe.js";import"./usage-BW6ztpN6.js";import"./ChevronDown-azX3X6AX.js";import"./org-ai-providers-DtsI9IWI.js";import"./useMutation-C_Uj7oOe.js";import"./AlertCircle-K-Pdcic9.js";import"./RefreshCcw01-Bk3rOtaE.js";import"./Play-3YhDYx27.js";import"./card-D1l6f7HS.js";import"./toggle-group-B0IrEjNf.js";import"./avatar-BiJdl6Xf.js";import"./User01-B6InEsCV.js";import"./select-Duo4-kjU.js";import"./index-BdQq_4o_.js";import"./index-CKlHjZGl.js";import"./Check-5J8pLufa.js";import"./ChevronUp-ISSymo50.js";import"./ArrowLeft-DbjuKsKJ.js";import"./use-copy-CogCWJQ7.js";import"./marked.esm-BaswSlok.js";import"./tabs-BawFIUQp.js";import"./checkbox-GcV7rItk.js";import"./drawer-DsEaI2mC.js";import"./VideoRecorder-DWwuCAKx.js";import"./SearchMd-BvvZzTkV.js";import"./Settings01-BhEewSHV.js";import"./use-mcp-resources-BfKeTtfq.js";import"./ChevronRight-BU9wyepR.js";import"./collapsible-E7EbAleb.js";import"./index-DW3Gddt1.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-CRS3A1HB.js";import"./types-DPAE4wXV.js";import"./use-collections-Bqp5H9bu.js";import"./useSuspenseInfiniteQuery-D-WGLpBh.js";import"./infiniteQueryObserver-DozliAIg.js";import"./use-create-virtual-mcp-CdSUPhk5.js";import"./Container-DO3SbooR.js";import"./Dataflow03-DDjLJJPt.js";import"./Download01-CSi5s7rT.js";import"./List-CD8zd6Wa.js";import"./FolderClosed-DG1khNab.js";import"./Grid01-1OtRlqYA.js";import"./Upload01-CVsYMTIG.js";import"./Zap-Md9DJ6rv.js";import"./decopilot-events-Brt4gAR6.js";import"./index-DSiECZF0.js";import"./differenceInSeconds-NQ4PDo0z.js";function K(s){const e=s.trim().split(/\s+/);return e.length!==5?!1:e.every(r=>/^[\d*/,\-]+$/.test(r))}function ut(s){if(!s)return"Unknown schedule";const e=s.trim();if(e==="* * * * *")return"Every minute";if(e==="0 * * * *")return"Every hour";if(e==="0 0 * * *")return"Every day";if(e==="0 0 * * 1")return"Every week";const r=e.match(/^\*\/(\d+)\s+\*\s+\*\s+\*\s+\*$/);if(r)return`Every ${r[1]} minutes`;const n=e.match(/^0\s+\*\/(\d+)\s+\*\s+\*\s+\*$/);if(n)return`Every ${n[1]} hours`;const o=e.match(/^0\s+0\s+\*\/(\d+)\s+\*\s+\*$/);if(o){const f=parseInt(o[1]??"1");return f%7===0?`Every ${f/7} weeks`:`Every ${f} days`}const a=e.match(/^(\d+)\s+(\d+)\s+\*\s+\*\s+\*$/);if(a){const f=(a[2]??"0").padStart(2,"0"),d=(a[1]??"0").padStart(2,"0");return`Every day at ${f}:${d} UTC`}const x=e.match(/^(\d+)\s+(\d+)\s+\*\s+\*\s+(\d)$/);if(x){const d=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][parseInt(x[3]??"0")]??"day",l=(x[2]??"0").padStart(2,"0"),y=(x[1]??"0").padStart(2,"0");return`Every ${d} at ${l}:${y} UTC`}return s}function pt(s,e){const r=Math.max(1,s);switch(e){case"minutes":return r===1?"* * * * *":`*/${r} * * * *`;case"hours":return r===1?"0 * * * *":`0 */${r} * * *`;case"days":return r===1?"0 0 * * *":`0 0 */${r} * *`;case"weeks":return r===1?"0 0 * * 1":`0 0 */${r*7} * *`}}function ft(s){const e=s.trim();if(e==="* * * * *")return{count:1,unit:"minutes"};if(e==="0 * * * *")return{count:1,unit:"hours"};if(e==="0 0 * * *")return{count:1,unit:"days"};if(e==="0 0 * * 1")return{count:1,unit:"weeks"};const r=e.match(/^\*\/(\d+)\s+\*\s+\*\s+\*\s+\*$/);if(r)return{count:parseInt(r[1]),unit:"minutes"};const n=e.match(/^0\s+\*\/(\d+)\s+\*\s+\*\s+\*$/);if(n)return{count:parseInt(n[1]),unit:"hours"};const o=e.match(/^0\s+0\s+\*\/(\d+)\s+\*\s+\*$/);if(o){const a=parseInt(o[1]);return a%7===0?{count:a/7,unit:"weeks"}:{count:a,unit:"days"}}return null}function xt(s,e){return e===1?{minutes:"minute",hours:"hour",days:"day",weeks:"week"}[s]??s:s}const ht=[{label:"Minute",cron:"* * * * *"},{label:"Hour",cron:"0 * * * *"},{label:"Day",cron:"0 0 * * *"},{label:"Week",cron:"0 0 * * 1"}];function gt(s){const e=B.c(26),{automationId:r,open:n,onOpenChange:o,onCustomSelect:a}=s,x=Q(),[f,d]=T.useState(!1),l=n??f;let y;e[0]!==o?(y=N=>{o?o(N):d(N)},e[0]=o,e[1]=y):y=e[1];const m=y;let j;e[2]!==x||e[3]!==r||e[4]!==m?(j=async N=>{try{await x.mutateAsync({automation_id:r,type:"cron",cron_expression:N}),I.success("Starter added"),m(!1)}catch(D){const A=D,g=A instanceof Error?A.message:"Failed to add starter";I.error(g)}},e[2]=x,e[3]=r,e[4]=m,e[5]=j):j=e[5];const S=j;let p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(Ke,{asChild:!0,children:t.jsxs(U,{variant:"outline",size:"sm",children:[t.jsx(at,{size:14}),"Add Starter"]})}),e[6]=p):p=e[6];let _;e[7]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsxs(Ge,{className:"gap-2.5",children:[t.jsx(H,{size:14,className:"text-muted-foreground shrink-0"}),"Every..."]}),e[7]=_):_=e[7];let v;e[8]!==x||e[9]!==S?(v=ht.map(N=>t.jsxs(re,{className:"gap-2.5",onSelect:()=>S(N.cron),disabled:x.isPending,children:[t.jsx(H,{size:14,className:"text-muted-foreground shrink-0"}),"Every ",N.label]},N.cron)),e[8]=x,e[9]=S,e[10]=v):v=e[10];let i;e[11]!==v?(i=t.jsxs(We,{children:[_,t.jsx(qe,{className:"w-[160px]",children:v})]}),e[11]=v,e[12]=i):i=e[12];let u;e[13]!==m||e[14]!==a?(u=()=>{m(!1),a?.()},e[13]=m,e[14]=a,e[15]=u):u=e[15];let b;e[16]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(H,{size:14,className:"text-muted-foreground shrink-0"}),e[16]=b):b=e[16];let h;e[17]!==u?(h=t.jsxs(re,{className:"gap-2.5",onSelect:u,children:[b,"Custom (cron)"]}),e[17]=u,e[18]=h):h=e[18];let C;e[19]!==i||e[20]!==h?(C=t.jsxs(Qe,{align:"end",className:"w-[200px]",children:[i,h]}),e[19]=i,e[20]=h,e[21]=C):C=e[21];let w;return e[22]!==m||e[23]!==l||e[24]!==C?(w=t.jsxs(Je,{open:l,onOpenChange:m,children:[p,C]}),e[22]=m,e[23]=l,e[24]=C,e[25]=w):w=e[25],w}function yt(s){const e=B.c(56),{trigger:r,automationId:n}=s,o=Pe(),a=Q(),[x,f]=T.useState(!1);let d;e[0]!==r.cron_expression?(d=r.cron_expression?ft(r.cron_expression):null,e[0]=r.cron_expression,e[1]=d):d=e[1];const l=d,[y,m]=T.useState(l?.count??1),[j,S]=T.useState(!1),[p,_]=T.useState(r.cron_expression??""),v=o.isPending||a.isPending,i=r.type==="cron";let u;e[2]!==n||e[3]!==o||e[4]!==r.id?(u=async()=>{try{await o.mutateAsync({trigger_id:r.id,automation_id:n}),I.success("Starter removed")}catch{I.error("Failed to remove starter")}f(!1)},e[2]=n,e[3]=o,e[4]=r.id,e[5]=u):u=e[5];const b=u;let h;e[6]!==a||e[7]!==n||e[8]!==p||e[9]!==o||e[10]!==r.cron_expression||e[11]!==r.id?(h=async()=>{const k=p.trim();if(!k||!K(k)||k===r.cron_expression){S(!1),_(r.cron_expression??"");return}try{await a.mutateAsync({automation_id:n,type:"cron",cron_expression:k}),await o.mutateAsync({trigger_id:r.id,automation_id:n}),S(!1)}catch{I.error("Failed to update starter"),_(r.cron_expression??""),S(!1)}},e[6]=a,e[7]=n,e[8]=p,e[9]=o,e[10]=r.cron_expression,e[11]=r.id,e[12]=h):h=e[12];const C=h;let w;e[13]!==a||e[14]!==n||e[15]!==l||e[16]!==o||e[17]!==r.cron_expression||e[18]!==r.id?(w=async k=>{if(!l)return;const W=Math.max(1,k),c=pt(W,l.unit);if(c!==r.cron_expression)try{await a.mutateAsync({automation_id:n,type:"cron",cron_expression:c}),await o.mutateAsync({trigger_id:r.id,automation_id:n})}catch{I.error("Failed to update starter"),m(l.count)}},e[13]=a,e[14]=n,e[15]=l,e[16]=o,e[17]=r.cron_expression,e[18]=r.id,e[19]=w):w=e[19];const N=w;let D;e[20]===Symbol.for("react.memo_cache_sentinel")?(D=t.jsx(H,{size:14,className:"text-muted-foreground shrink-0"}),e[20]=D):D=e[20];let A;e[21]!==y||e[22]!==p||e[23]!==N||e[24]!==C||e[25]!==l||e[26]!==i||e[27]!==j||e[28]!==v||e[29]!==r.cron_expression||e[30]!==r.event_type?(A=l&&i?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-sm text-muted-foreground",children:"Every"}),t.jsx("input",{type:"number",min:1,value:y,onChange:k=>m(parseInt(k.target.value)||1),onBlur:()=>N(y),onKeyDown:k=>{k.key==="Enter"&&k.target.blur(),k.key==="Escape"&&m(l.count)},disabled:v,className:"w-12 text-center text-sm h-7 border border-border rounded-md bg-background px-1 focus:outline-none focus:ring-1 focus:ring-ring"}),t.jsx("span",{className:"text-sm",children:xt(l.unit,y)})]}):i&&j?t.jsxs(t.Fragment,{children:[t.jsx("input",{type:"text",value:p,onChange:k=>_(k.target.value),onBlur:C,onKeyDown:k=>{k.key==="Enter"&&k.target.blur(),k.key==="Escape"&&(S(!1),_(r.cron_expression??""))},className:"flex-1 text-sm font-mono bg-transparent outline-none",autoFocus:!0}),p&&!K(p)&&t.jsx("span",{className:"text-xs text-muted-foreground/60 shrink-0",children:"invalid"})]}):t.jsx("span",{className:"text-sm flex-1 font-mono text-xs text-muted-foreground",children:i?ut(r.cron_expression??""):`${r.event_type} event`}),e[21]=y,e[22]=p,e[23]=N,e[24]=C,e[25]=l,e[26]=i,e[27]=j,e[28]=v,e[29]=r.cron_expression,e[30]=r.event_type,e[31]=A):A=e[31];let g;e[32]!==v?(g=v&&t.jsx(G,{size:13,className:"animate-spin text-muted-foreground"}),e[32]=v,e[33]=g):g=e[33];let z;e[34]!==l||e[35]!==i||e[36]!==j||e[37]!==r.cron_expression?(z=i&&!l&&!j&&t.jsx(U,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>{_(r.cron_expression??""),S(!0)},children:t.jsx(Ee,{size:13,className:"text-muted-foreground"})}),e[34]=l,e[35]=i,e[36]=j,e[37]=r.cron_expression,e[38]=z):z=e[38];let R;e[39]===Symbol.for("react.memo_cache_sentinel")?(R=t.jsx(U,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>f(!0),children:t.jsx(J,{size:13,className:"text-muted-foreground"})}),e[39]=R):R=e[39];let M;e[40]!==g||e[41]!==z?(M=t.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[g,z,R]}),e[40]=g,e[41]=z,e[42]=M):M=e[42];let O;e[43]!==M||e[44]!==A?(O=t.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2.5 rounded-lg border border-border bg-background group",children:[D,A,M]}),e[43]=M,e[44]=A,e[45]=O):O=e[45];let P;e[46]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsxs(me,{children:[t.jsx(pe,{children:"Remove Starter"}),t.jsx(ue,{children:"Are you sure you want to remove this starter?"})]}),e[46]=P):P=e[46];let V;e[47]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsx(fe,{children:"Cancel"}),e[47]=V):V=e[47];let E;e[48]!==b?(E=t.jsxs(ge,{children:[P,t.jsxs(xe,{children:[V,t.jsx(he,{onClick:b,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Remove"})]})]}),e[48]=b,e[49]=E):E=e[49];let $;e[50]!==x||e[51]!==E?($=t.jsx(ye,{open:x,onOpenChange:f,children:E}),e[50]=x,e[51]=E,e[52]=$):$=e[52];let F;return e[53]!==O||e[54]!==$?(F=t.jsxs(t.Fragment,{children:[O,$]}),e[53]=O,e[54]=$,e[55]=F):F=e[55],F}function jt(s){const e=B.c(41),{selectedId:r,onChange:n}=s,[o,a]=T.useState(!1),x=ot();let f,d;e[0]!==x||e[1]!==r?(d=x.filter(vt),f=r?d.find(p=>p.id===r):null,e[0]=x,e[1]=r,e[2]=f,e[3]=d):(f=e[2],d=e[3]);const l=f;if(l){let p;e[4]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(te,{size:16}),e[4]=p):p=e[4];let _;e[5]!==l.icon||e[6]!==l.title?(_=t.jsx(Me,{icon:l.icon,name:l.title,size:"sm",fallbackIcon:p,className:"rounded-md shrink-0"}),e[5]=l.icon,e[6]=l.title,e[7]=_):_=e[7];let v;e[8]!==l.title?(v=t.jsx("span",{className:"text-sm font-medium truncate",children:l.title}),e[8]=l.title,e[9]=v):v=e[9];let i;e[10]!==_||e[11]!==v?(i=t.jsx(ne,{asChild:!0,children:t.jsxs("button",{type:"button",className:"flex items-center gap-3 flex-1 min-w-0 text-left cursor-pointer",children:[_,v]})}),e[10]=_,e[11]=v,e[12]=i):i=e[12];let u;e[13]!==n?(u=A=>{n(A),a(!1)},e[13]=n,e[14]=u):u=e[14];let b;e[15]!==r||e[16]!==u||e[17]!==d?(b=t.jsx(oe,{className:"w-[550px] p-0 overflow-hidden",align:"start",sideOffset:8,children:t.jsx(ee,{virtualMcps:d,selectedVirtualMcpId:r,onVirtualMcpChange:u})}),e[15]=r,e[16]=u,e[17]=d,e[18]=b):b=e[18];let h;e[19]!==o||e[20]!==i||e[21]!==b?(h=t.jsxs(ie,{open:o,onOpenChange:a,children:[i,b]}),e[19]=o,e[20]=i,e[21]=b,e[22]=h):h=e[22];let C;e[23]!==n?(C=()=>n(null),e[23]=n,e[24]=C):C=e[24];let w;e[25]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(J,{size:13}),e[25]=w):w=e[25];let N;e[26]!==C?(N=t.jsx(U,{type:"button",variant:"ghost",size:"icon",className:"shrink-0 size-7 text-muted-foreground hover:text-foreground",onClick:C,title:"Remove agent",children:w}),e[26]=C,e[27]=N):N=e[27];let D;return e[28]!==N||e[29]!==h?(D=t.jsxs("div",{className:"flex items-center gap-3 px-3 py-2.5 rounded-lg border border-border bg-background hover:bg-accent/50 transition-colors",children:[h,N]}),e[28]=N,e[29]=h,e[30]=D):D=e[30],D}let y;e[31]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(ne,{asChild:!0,children:t.jsxs("button",{type:"button",className:"flex items-center gap-3 px-3 py-2.5 rounded-lg border border-border hover:bg-accent/50 transition-colors w-full text-left cursor-pointer",children:[t.jsxs("div",{className:"relative flex items-center justify-center size-8 rounded-md text-muted-foreground/75 shrink-0",children:[t.jsxs("svg",{className:"absolute inset-0 size-full",fill:"none",children:[t.jsx("defs",{children:t.jsxs("linearGradient",{id:"agent-picker-border-gradient",gradientUnits:"userSpaceOnUse",x1:"0",y1:"0",x2:"32",y2:"32",children:[t.jsx("animateTransform",{attributeName:"gradientTransform",type:"rotate",from:"0 16 16",to:"360 16 16",dur:"6s",repeatCount:"indefinite"}),t.jsx("stop",{offset:"0%",stopColor:"var(--chart-1)"}),t.jsx("stop",{offset:"100%",stopColor:"var(--chart-4)"})]})}),t.jsx("rect",{x:"0.5",y:"0.5",width:"31",height:"31",rx:"5.5",stroke:"url(#agent-picker-border-gradient)",strokeWidth:"1",strokeDasharray:"3 3"})]}),t.jsx(te,{size:16})]}),t.jsx("span",{className:"text-sm text-muted-foreground",children:"No agent selected. All connections available."})]})}),e[31]=y):y=e[31];let m;e[32]!==n?(m=p=>{n(p),a(!1)},e[32]=n,e[33]=m):m=e[33];let j;e[34]!==r||e[35]!==m||e[36]!==d?(j=t.jsx(oe,{className:"w-[550px] p-0 overflow-hidden",align:"start",sideOffset:8,children:t.jsx(ee,{virtualMcps:d,selectedVirtualMcpId:r,onVirtualMcpChange:m})}),e[34]=r,e[35]=m,e[36]=d,e[37]=j):j=e[37];let S;return e[38]!==o||e[39]!==j?(S=t.jsxs(ie,{open:o,onOpenChange:a,children:[y,j]}),e[38]=o,e[39]=j,e[40]=S):S=e[40],S}function vt(s){return!s.id||!st(s.id)}function bt({automationId:s,automation:e}){const r=Re(),{createTask:n,setVirtualMcpId:o,setSelectedModel:a,sendMessage:x,credentialId:f,model:d}=je(),[,l]=de(),y=e.messages?.[0]?.metadata?.tiptapDoc??void 0,[m,j]=T.useState(y),[S,p]=T.useState(y),[_,v]=T.useState(!1),[i,u]=T.useState(!1),[b,h]=T.useState(""),C=Q(),w=T.useRef(!1),N=c=>{j(c),w.current||(w.current=!0,y||p(c))},D=e.models?.credentialId||f||"",A=e.models?.thinking?.id||d?.modelId||"",g=Ce({defaultValues:{name:e.name,active:e.active,agent_id:e.agent?.id??"",credential_id:D,model_id:A}}),z=g.watch("active"),R=g.watch("agent_id"),M=g.watch("credential_id"),O=g.watch("model_id"),{models:P,isLoading:V}=De(M||void 0),E=P.find(c=>c.modelId===O)??null,$=async()=>{const c=g.getValues();try{const L=c.credential_id&&c.model_id?c.credential_id:"",Y=c.credential_id&&c.model_id?c.model_id:"";return await r.mutateAsync({id:s,name:c.name,active:c.active,agent:{id:c.agent_id},models:{credentialId:L,thinking:{id:Y}},messages:ct(m),temperature:0}),g.reset({...c,credential_id:L,model_id:Y}),p(m),I.success("Automation saved"),!0}catch{return I.error("Failed to save automation"),!1}},F=()=>{g.reset(),N(S)},k=g.formState.isDirty||JSON.stringify(m??null)!==JSON.stringify(S??null),W=async()=>{if(k&&!await $())return;if(!m){I.error("No instructions configured for this automation");return}const c=g.getValues();o(c.agent_id||null),E&&M&&a({...E,keyId:M}),l(!0),n(),setTimeout(()=>{x(m,{toolApprovalLevel:"auto"})},0)};return t.jsxs(t.Fragment,{children:[t.jsx(ce,{children:t.jsx(ke,{onSave:async()=>{await $()},onUndo:F,isDirty:k,isSaving:r.isPending})}),t.jsxs("div",{className:"max-w-2xl mx-auto w-full px-6 py-6 flex flex-col gap-8",children:[t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx(He,{...g.register("name"),placeholder:"Automation name",className:"border border-transparent shadow-none px-0 text-2xl md:text-2xl font-semibold h-auto focus-visible:ring-0 focus-visible:border-border bg-transparent"}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Ne,{control:g.control,name:"active",render:({field:c})=>t.jsx(Ye,{checked:c.value,onCheckedChange:c.onChange,className:"cursor-pointer"})}),t.jsx("span",{className:"text-sm text-muted-foreground",children:z?"Active":"Inactive"}),t.jsx("span",{className:"text-muted-foreground/50 text-sm",children:"·"}),t.jsx($e,{id:e.created_by,size:"2xs",className:"text-sm text-muted-foreground"})]})]}),t.jsxs("div",{className:"flex flex-col gap-2.5",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:"Starter"}),t.jsx(gt,{automationId:s,open:_,onOpenChange:v,onCustomSelect:()=>{u(!0),h("")}})]}),e.triggers.length===0&&!i?t.jsx("div",{className:"rounded-lg border border-dashed border-border px-4 py-6 text-center",children:t.jsxs("p",{className:"text-sm text-muted-foreground",children:["When should this automation run?"," ",t.jsx("button",{type:"button",className:"text-foreground underline underline-offset-2 cursor-pointer hover:text-foreground/80 transition-colors",onClick:()=>v(!0),children:"Add a starter"})," ","to get going."]})}):t.jsx("div",{className:"flex flex-col gap-2",children:e.triggers.map(c=>t.jsx(yt,{trigger:c,automationId:s},c.id))}),i&&t.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2.5 rounded-lg border border-border bg-background group",children:[t.jsx(H,{size:14,className:"text-muted-foreground shrink-0"}),t.jsx("input",{type:"text",value:b,onChange:c=>h(c.target.value),onBlur:async()=>{const c=b.trim();if(!(!c||!K(c)))try{await C.mutateAsync({automation_id:s,type:"cron",cron_expression:c}),I.success("Starter added"),u(!1),h("")}catch{I.error("Failed to add starter")}},onKeyDown:async c=>{const L=b.trim();c.key==="Enter"&&L&&K(L)&&c.target.blur(),c.key==="Escape"&&(u(!1),h(""))},placeholder:"0 9 * * 1-5",className:"flex-1 text-sm font-mono bg-transparent outline-none placeholder:text-muted-foreground/40",autoFocus:!0}),b&&!K(b)&&t.jsx("span",{className:"text-xs text-muted-foreground/60 shrink-0",children:"invalid"}),C.isPending&&t.jsx(G,{size:13,className:"animate-spin text-muted-foreground shrink-0"}),t.jsx("button",{type:"button",className:"shrink-0 p-0.5 rounded text-muted-foreground opacity-0 group-hover:opacity-100 hover:text-foreground transition-opacity",onClick:()=>{u(!1),h("")},children:t.jsx(J,{size:13})})]})]}),t.jsxs("div",{className:"flex flex-col gap-2.5",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:"Agent"}),t.jsx(jt,{selectedId:R||null,onChange:c=>g.setValue("agent_id",c??"",{shouldDirty:!0})})]}),t.jsxs("div",{className:"flex flex-col gap-2.5",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:"Instructions"}),t.jsx(Ae,{tiptapDoc:m,setTiptapDoc:N,placeholder:"What should this automation do?",children:t.jsxs("div",{className:"rounded-xl border border-border min-h-[120px] flex flex-col",children:[t.jsx(Te,{virtualMcpId:R||null}),t.jsxs("div",{className:"flex items-center justify-end gap-1.5 p-2.5",children:[t.jsx(Ie,{model:E,isLoading:V,credentialId:M||null,onCredentialChange:c=>{g.setValue("credential_id",c??"",{shouldDirty:!0}),g.setValue("model_id","",{shouldDirty:!0})},onModelChange:c=>g.setValue("model_id",c.modelId,{shouldDirty:!0}),placeholder:"Model"}),t.jsxs(Xe,{children:[t.jsx(Ze,{asChild:!0,children:t.jsxs(U,{type:"button",variant:"default",className:"h-8 gap-1.5 rounded-md px-3 text-sm font-medium",onClick:W,children:[t.jsx(it,{size:16}),"Test"]})}),t.jsx(et,{children:"Test Automation"})]})]})]})})]}),t.jsxs("div",{className:"flex flex-col gap-2.5",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:"Run History"}),t.jsx(Ct,{automationId:s,triggerIds:e.triggers.map(c=>c.id)})]})]})]})}function _t(s,e,r){const n=B.c(13);let o;n[0]!==s?(o={connectionId:nt,orgId:s},n[0]=s,n[1]=o):o=n[1];const a=rt(o);let x;n[2]!==e||n[3]!==s||n[4]!==r?(x=q.automationRuns(s,e,r),n[2]=e,n[3]=s,n[4]=r,n[5]=x):x=n[5];let f;n[6]!==a||n[7]!==r?(f=async()=>{if(!a)throw new Error("MCP client not available");const y=await a.callTool({name:"COLLECTION_THREADS_LIST",arguments:{where:{trigger_ids:r},limit:20}});return(y.structuredContent??y).items??[]},n[6]=a,n[7]=r,n[8]=f):f=n[8];const d=r.length>0;let l;return n[9]!==x||n[10]!==f||n[11]!==d?(l={queryKey:x,queryFn:f,enabled:d},n[9]=x,n[10]=f,n[11]=d,n[12]=l):l=n[12],tt(l)}function Ct(s){const e=B.c(22),{automationId:r,triggerIds:n}=s,{org:o}=ae(),{switchToTask:a}=je(),[,x]=de(),f=Se(),{data:d,isLoading:l}=_t(o.id,r,n),y=n.length>0;let m;e[0]!==r||e[1]!==o.id||e[2]!==f||e[3]!==d||e[4]!==n?(m=i=>{const u=i.subject,b=d??[];b.find(C=>C.id===u)?f.setQueryData(q.automationRuns(o.id,r,n),b.map(C=>C.id===u?{...C,status:i.data.status,updated_at:new Date().toISOString()}:C)):f.invalidateQueries({queryKey:q.automationRuns(o.id,r,n)})},e[0]=r,e[1]=o.id,e[2]=f,e[3]=d,e[4]=n,e[5]=m):m=e[5];let j;if(e[6]!==o.id||e[7]!==y||e[8]!==m?(j={orgId:o.id,enabled:y,onTaskStatus:m},e[6]=o.id,e[7]=y,e[8]=m,e[9]=j):j=e[9],dt(j),l){let i;return e[10]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("div",{className:"flex items-center justify-center py-8",children:t.jsx(G,{size:18,className:"animate-spin text-muted-foreground"})}),e[10]=i):i=e[10],i}if(!d||d.length===0){let i;return e[11]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(le,{image:null,className:"mt-6",title:"No run history",description:"Run history will appear here when the automation has been triggered."}),e[11]=i):i=e[11],i}let S;e[12]!==x||e[13]!==a?(S=async i=>{await a(i),x(!0)},e[12]=x,e[13]=a,e[14]=S):S=e[14];const p=S;let _;if(e[15]!==p||e[16]!==d){let i;e[18]!==p?(i=u=>{const b=Z[u.status]??Z.completed,h=b.icon;return t.jsxs("button",{type:"button",className:"flex items-center gap-3 px-1 py-2.5 text-left hover:bg-accent/50 transition-colors cursor-pointer rounded-sm",onClick:()=>p(u.id),children:[t.jsx(h,{size:16,className:b.iconClassName}),t.jsx("span",{className:"flex-1 min-w-0 text-sm truncate",children:u.title}),t.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:mt(new Date(u.updated_at),{addSuffix:!0})})]},u.id)},e[18]=p,e[19]=i):i=e[19],_=d.map(i),e[15]=p,e[16]=d,e[17]=_}else _=e[17];let v;return e[20]!==_?(v=t.jsx("div",{className:"flex flex-col divide-y divide-border",children:_}),e[20]=_,e[21]=v):v=e[21],v}function tr(){const s=B.c(36);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},s[0]=e):e=s[0];const{automationId:r}=ve(e),n=be(),{org:o}=ae(),{data:a,isLoading:x}=ze(r),f=Oe(),[d,l]=T.useState(!1);let y;s[1]!==r||s[2]!==f||s[3]!==n||s[4]!==o?(y=async()=>{try{await f.mutateAsync(r),I.success("Automation deleted"),n({to:"/$org/$project/automations",params:{org:o.slug,project:X}})}catch{I.error("Failed to delete automation")}l(!1)},s[1]=r,s[2]=f,s[3]=n,s[4]=o,s[5]=y):y=s[5];const m=y;if(x){let g;return s[6]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("div",{className:"flex items-center justify-center h-full",children:t.jsx(G,{size:24,className:"animate-spin text-muted-foreground"})}),s[6]=g):g=s[6],g}if(!a){let g;return s[7]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(le,{title:"Automation not found",description:"This automation may have been deleted."}),s[7]=g):g=s[7],g}let j;s[8]!==o.slug?(j=t.jsx(se,{children:t.jsx(Ve,{asChild:!0,children:t.jsx(_e,{to:"/$org/$project/automations",params:{org:o.slug,project:X},children:"Automations"})})}),s[8]=o.slug,s[9]=j):j=s[9];let S;s[10]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(Le,{}),s[10]=S):S=s[10];let p;s[11]!==a.name?(p=t.jsx(se,{children:t.jsx(Fe,{children:a.name})}),s[11]=a.name,s[12]=p):p=s[12];let _;s[13]!==j||s[14]!==p?(_=t.jsx(Ue,{children:t.jsxs(Be,{children:[j,S,p]})}),s[13]=j,s[14]=p,s[15]=_):_=s[15];const v=_;let i;s[16]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(ce,{children:t.jsxs(U,{variant:"ghost",size:"sm",className:"h-7 text-destructive hover:text-destructive",onClick:()=>l(!0),children:[t.jsx(lt,{size:14}),"Delete"]})}),s[16]=i):i=s[16];let u;s[17]!==a||s[18]!==r?(u=t.jsx(bt,{automationId:r,automation:a},r),s[17]=a,s[18]=r,s[19]=u):u=s[19];let b;s[20]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(pe,{children:"Delete Automation"}),s[20]=b):b=s[20];let h;s[21]!==a.name?(h=t.jsxs(me,{children:[b,t.jsxs(ue,{children:['Are you sure you want to delete "',a.name,'"? This action cannot be undone.']})]}),s[21]=a.name,s[22]=h):h=s[22];let C;s[23]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(fe,{children:"Cancel"}),s[23]=C):C=s[23];let w;s[24]!==m?(w=t.jsxs(xe,{children:[C,t.jsx(he,{onClick:m,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),s[24]=m,s[25]=w):w=s[25];let N;s[26]!==w||s[27]!==h?(N=t.jsxs(ge,{children:[h,w]}),s[26]=w,s[27]=h,s[28]=N):N=s[28];let D;s[29]!==d||s[30]!==N?(D=t.jsx(ye,{open:d,onOpenChange:l,children:N}),s[29]=d,s[30]=N,s[31]=D):D=s[31];let A;return s[32]!==v||s[33]!==D||s[34]!==u?(A=t.jsxs(we,{breadcrumb:v,children:[i,u,D]}),s[32]=v,s[33]=D,s[34]=u,s[35]=A):A=s[35],A}export{tr as default};
@@ -1 +1 @@
1
- import{e as S,u as _,r as $,O as u,j as e,B as p,D as B,v as h}from"./index-DLW7tZdu.js";import{C as I}from"./collection-search-DcVVKJ8Q.js";import{E as L}from"./empty-state-Cx44yC3Y.js";import{P as l}from"./index-75eZ1uI1.js";import{u as M,a as E,b as H}from"./use-automations-BIoacnri.js";import{u as O}from"./use-list-state-B6nYBLyk.js";import{U as R}from"./user-Aw6SqZpK.js";import{f as F,a as K,b as U,c as G,d as J,e as V,A as q,h as Q}from"./alert-dialog-yWVMNVBj.js";import{B as W}from"./badge-C2jHxnoS.js";import{B as X,a as Y,b as Z,c as ee}from"./breadcrumb-CBpEGiAs.js";import{D as se,a as te,b as ae,c as C}from"./dropdown-menu-BtgYu0Kc.js";import{T as re,a as ie,b as y,c as ne,d as oe,e as c}from"./table-CbTCyRX5.js";import{i as le,n as ce}from"./ArrowUp-FfROzAyV.js";import{a as de,i as me,s as ue}from"./RefreshCcw01-YXuL16Jx.js";import{i as x}from"./Loading01-DCKwAh-U.js";import{s as A}from"./Plus-BW2fNoEy.js";import{s as pe}from"./Trash01-D9O3UWX6.js";import"./SearchMd-C_bEWIlQ.js";import"./input-DgJ0xjPE.js";import"./useQuery-YHvrmKkI.js";import"./useMutation-BatnVMWS.js";import"./tooltip-D-QYbPJS.js";import"./index-CQPlxt4u.js";import"./X-BL1q6dsE.js";import"./constants-Dzy_AMuL.js";import"./use-view-mode-lmHuCoZm.js";import"./avatar-87qJKKK_.js";import"./User01-BRC1qZ-u.js";import"./ChevronRight-BSFLHUtv.js";import"./Check-BXqqUm0J.js";function Ue(){const g=S(),{org:j,locator:D}=_(),{data:r,isLoading:k}=M(),n=E(),T=H(),[d,m]=$.useState(null),t=O({namespace:j.slug,resource:"automations",defaultViewMode:"table"}),f=D.split("/")[0]??j.slug??u,b=async()=>{try{const s=await n.mutateAsync({name:"New Automation",agent:{id:"",mode:"passthrough"},messages:[],models:{credentialId:"",thinking:{id:""}},temperature:.5,active:!0});g({to:"/$org/$project/automations/$automationId",params:{org:f,project:u,automationId:s.id}})}catch{h.error("Failed to create automation")}},z=async()=>{if(d)try{await T.mutateAsync(d.id),h.success("Automation deleted")}catch{h.error("Failed to delete automation")}finally{m(null)}},N=s=>{g({to:"/$org/$project/automations/$automationId",params:{org:f,project:u,automationId:s}})},v=(r??[]).filter(s=>t.searchTerm?s.name.toLowerCase().includes(t.searchTerm.toLowerCase()):!0).sort((s,a)=>{if(!t.sortDirection)return 0;const o=t.sortDirection==="asc"?1:-1,i=t.sortKey;return i==="name"?s.name.localeCompare(a.name)*o:i==="active"?((s.active?1:0)-(a.active?1:0))*o:i==="trigger_count"?((s.trigger_count??0)-(a.trigger_count??0))*o:0}),P="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-[11px] h-9 uppercase tracking-wider group transition-colors select-none";return e.jsxs(l,{children:[e.jsxs(l.Header,{children:[e.jsx(l.Header.Left,{children:e.jsx(X,{children:e.jsx(Y,{children:e.jsx(Z,{children:e.jsxs(ee,{className:"flex items-center gap-2",children:["Automations",r&&r.length>0&&e.jsxs("span",{className:"hidden sm:inline text-xs font-normal text-muted-foreground tabular-nums",children:[r.length," total"]})]})})})})}),e.jsx(l.Header.Right,{children:e.jsxs(p,{size:"sm",onClick:b,disabled:n.isPending,className:"h-7 w-7 px-0 sm:w-auto sm:px-3",children:[n.isPending?e.jsx(x,{size:14,className:"animate-spin"}):e.jsx(A,{size:14}),e.jsx("span",{className:"hidden sm:inline",children:"Create Automation"})]})})]}),e.jsx(I,{value:t.search,onChange:t.setSearch,placeholder:"Search automations...",onKeyDown:s=>{s.key==="Escape"&&(t.setSearch(""),s.target.blur())}}),e.jsxs(l.Content,{children:[k?e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsx(x,{size:24,className:"animate-spin text-muted-foreground"})}):!r||r.length===0?e.jsx("div",{className:"flex items-center h-full",children:e.jsx(L,{image:e.jsx(de,{size:48,className:"text-muted-foreground"}),title:"No automations yet",description:"Automations run tasks on a schedule or in response to events.",actions:e.jsxs(p,{size:"sm",onClick:b,disabled:n.isPending,children:[n.isPending?e.jsx(x,{size:14,className:"animate-spin"}):e.jsx(A,{size:14}),"Create Automation"]})})}):e.jsxs(re,{className:"w-full border-collapse",children:[e.jsx(ie,{className:"border-b-0",children:e.jsx(y,{className:"h-9 hover:bg-transparent border-b border-border",children:[{id:"name",label:"Name",className:"flex-1 min-w-0 cursor-pointer hover:bg-accent"},{id:"active",label:"Status",className:"w-24 shrink-0 cursor-pointer hover:bg-accent"},{id:"trigger_count",label:"Triggers",className:"w-24 shrink-0 cursor-pointer hover:bg-accent"},{id:"created_by",label:"Created by",className:"w-40 shrink-0"},{id:"_actions",label:"",className:"w-12 shrink-0"}].map(({id:s,label:a,className:o})=>{const i=t.sortKey===s,w=s!=="created_by"&&s!=="_actions";return e.jsx(ne,{className:B(P,o),onClick:w?()=>t.handleSort(s):void 0,children:e.jsxs("span",{className:"flex items-center gap-1",children:[a,w&&e.jsxs("span",{className:"w-4 flex items-center justify-center",children:[i&&t.sortDirection==="asc"&&e.jsx(le,{size:12,className:"text-muted-foreground"}),i&&t.sortDirection==="desc"&&e.jsx(ce,{size:12,className:"text-muted-foreground"})]})]})},s)})})}),e.jsx(oe,{children:v.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:5,className:"py-16 text-center",children:e.jsxs("span",{className:"text-sm text-muted-foreground",children:['No automations match "',t.search,'"']})})}):v.map(s=>e.jsxs(y,{className:"group/data-row border-b-0 hover:bg-accent/50 cursor-pointer transition-colors",onClick:()=>N(s.id),children:[e.jsx(c,{className:"px-5 py-4 h-16 align-middle text-sm font-medium text-foreground flex-1 min-w-0",children:s.name}),e.jsx(c,{className:"px-5 py-4 h-16 align-middle w-24 shrink-0",children:e.jsx(W,{variant:s.active?"default":"secondary",children:s.active?"Active":"Inactive"})}),e.jsx(c,{className:"px-5 py-4 h-16 align-middle text-sm text-muted-foreground w-24 shrink-0",children:s.trigger_count}),e.jsx(c,{className:"px-5 py-4 h-16 align-middle w-40 shrink-0",children:e.jsx(R,{id:s.created_by})}),e.jsx(c,{className:"px-5 py-4 h-16 align-middle w-12 shrink-0",children:e.jsxs(se,{children:[e.jsx(te,{asChild:!0,children:e.jsx(p,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:a=>a.stopPropagation(),children:e.jsx(me,{size:20})})}),e.jsxs(ae,{align:"end",onClick:a=>a.stopPropagation(),children:[e.jsxs(C,{onClick:a=>{a.stopPropagation(),N(s.id)},children:[e.jsx(ue,{size:16}),"Open"]}),e.jsxs(C,{variant:"destructive",onClick:a=>{a.stopPropagation(),m({id:s.id,name:s.name})},children:[e.jsx(pe,{size:16}),"Delete"]})]})]})})]},s.id))})]}),e.jsx(F,{open:!!d,onOpenChange:s=>!s&&m(null),children:e.jsxs(K,{children:[e.jsxs(U,{children:[e.jsx(G,{children:"Delete Automation?"}),e.jsxs(J,{children:["This action cannot be undone. This will permanently delete"," ",e.jsx("span",{className:"font-medium text-foreground",children:d?.name}),". All triggers will be removed."]})]}),e.jsxs(V,{children:[e.jsx(q,{children:"Cancel"}),e.jsx(Q,{onClick:z,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})})]})]})}export{Ue as default};
1
+ import{e as S,u as _,r as $,O as u,j as e,B as p,D as B,v as h}from"./index-BRbdC8tb.js";import{C as I}from"./collection-search-CcVBsN85.js";import{E as L}from"./empty-state-B7nlLEUe.js";import{P as l}from"./index-P1BeuVDU.js";import{u as M,a as E,b as H}from"./use-automations-BTjhSzA_.js";import{u as O}from"./use-list-state-BtvQgv8T.js";import{U as R}from"./user-tg9kwvXU.js";import{f as F,a as K,b as U,c as G,d as J,e as V,A as q,h as Q}from"./alert-dialog-CJVLkF8s.js";import{B as W}from"./badge-BbY1Vzps.js";import{B as X,a as Y,b as Z,c as ee}from"./breadcrumb-BM2hSfLB.js";import{D as se,a as te,b as ae,c as C}from"./dropdown-menu-BJLjCuY0.js";import{T as re,a as ie,b as y,c as ne,d as oe,e as c}from"./table-6Exocylh.js";import{i as le,n as ce}from"./ArrowUp-CVgf-IuM.js";import{a as de,i as me,s as ue}from"./RefreshCcw01-Bk3rOtaE.js";import{i as x}from"./Loading01-CYdiDh3l.js";import{s as A}from"./Plus-V1Th1jdv.js";import{s as pe}from"./Trash01-DEYpLJs9.js";import"./SearchMd-BvvZzTkV.js";import"./input-BOjviNKP.js";import"./useQuery-C31bP6Ck.js";import"./useMutation-C_Uj7oOe.js";import"./tooltip-xl3GoSVP.js";import"./index-CKlHjZGl.js";import"./X-DSEUOZBv.js";import"./constants-2OCwh60p.js";import"./use-view-mode-BiSEdh0M.js";import"./avatar-BiJdl6Xf.js";import"./User01-B6InEsCV.js";import"./ChevronRight-BU9wyepR.js";import"./Check-5J8pLufa.js";function Ue(){const g=S(),{org:j,locator:D}=_(),{data:r,isLoading:k}=M(),n=E(),T=H(),[d,m]=$.useState(null),t=O({namespace:j.slug,resource:"automations",defaultViewMode:"table"}),f=D.split("/")[0]??j.slug??u,b=async()=>{try{const s=await n.mutateAsync({name:"New Automation",agent:{id:"",mode:"passthrough"},messages:[],models:{credentialId:"",thinking:{id:""}},temperature:.5,active:!0});g({to:"/$org/$project/automations/$automationId",params:{org:f,project:u,automationId:s.id}})}catch{h.error("Failed to create automation")}},z=async()=>{if(d)try{await T.mutateAsync(d.id),h.success("Automation deleted")}catch{h.error("Failed to delete automation")}finally{m(null)}},N=s=>{g({to:"/$org/$project/automations/$automationId",params:{org:f,project:u,automationId:s}})},v=(r??[]).filter(s=>t.searchTerm?s.name.toLowerCase().includes(t.searchTerm.toLowerCase()):!0).sort((s,a)=>{if(!t.sortDirection)return 0;const o=t.sortDirection==="asc"?1:-1,i=t.sortKey;return i==="name"?s.name.localeCompare(a.name)*o:i==="active"?((s.active?1:0)-(a.active?1:0))*o:i==="trigger_count"?((s.trigger_count??0)-(a.trigger_count??0))*o:0}),P="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-[11px] h-9 uppercase tracking-wider group transition-colors select-none";return e.jsxs(l,{children:[e.jsxs(l.Header,{children:[e.jsx(l.Header.Left,{children:e.jsx(X,{children:e.jsx(Y,{children:e.jsx(Z,{children:e.jsxs(ee,{className:"flex items-center gap-2",children:["Automations",r&&r.length>0&&e.jsxs("span",{className:"hidden sm:inline text-xs font-normal text-muted-foreground tabular-nums",children:[r.length," total"]})]})})})})}),e.jsx(l.Header.Right,{children:e.jsxs(p,{size:"sm",onClick:b,disabled:n.isPending,className:"h-7 w-7 px-0 sm:w-auto sm:px-3",children:[n.isPending?e.jsx(x,{size:14,className:"animate-spin"}):e.jsx(A,{size:14}),e.jsx("span",{className:"hidden sm:inline",children:"Create Automation"})]})})]}),e.jsx(I,{value:t.search,onChange:t.setSearch,placeholder:"Search automations...",onKeyDown:s=>{s.key==="Escape"&&(t.setSearch(""),s.target.blur())}}),e.jsxs(l.Content,{children:[k?e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsx(x,{size:24,className:"animate-spin text-muted-foreground"})}):!r||r.length===0?e.jsx("div",{className:"flex items-center h-full",children:e.jsx(L,{image:e.jsx(de,{size:48,className:"text-muted-foreground"}),title:"No automations yet",description:"Automations run tasks on a schedule or in response to events.",actions:e.jsxs(p,{size:"sm",onClick:b,disabled:n.isPending,children:[n.isPending?e.jsx(x,{size:14,className:"animate-spin"}):e.jsx(A,{size:14}),"Create Automation"]})})}):e.jsxs(re,{className:"w-full border-collapse",children:[e.jsx(ie,{className:"border-b-0",children:e.jsx(y,{className:"h-9 hover:bg-transparent border-b border-border",children:[{id:"name",label:"Name",className:"flex-1 min-w-0 cursor-pointer hover:bg-accent"},{id:"active",label:"Status",className:"w-24 shrink-0 cursor-pointer hover:bg-accent"},{id:"trigger_count",label:"Triggers",className:"w-24 shrink-0 cursor-pointer hover:bg-accent"},{id:"created_by",label:"Created by",className:"w-40 shrink-0"},{id:"_actions",label:"",className:"w-12 shrink-0"}].map(({id:s,label:a,className:o})=>{const i=t.sortKey===s,w=s!=="created_by"&&s!=="_actions";return e.jsx(ne,{className:B(P,o),onClick:w?()=>t.handleSort(s):void 0,children:e.jsxs("span",{className:"flex items-center gap-1",children:[a,w&&e.jsxs("span",{className:"w-4 flex items-center justify-center",children:[i&&t.sortDirection==="asc"&&e.jsx(le,{size:12,className:"text-muted-foreground"}),i&&t.sortDirection==="desc"&&e.jsx(ce,{size:12,className:"text-muted-foreground"})]})]})},s)})})}),e.jsx(oe,{children:v.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:5,className:"py-16 text-center",children:e.jsxs("span",{className:"text-sm text-muted-foreground",children:['No automations match "',t.search,'"']})})}):v.map(s=>e.jsxs(y,{className:"group/data-row border-b-0 hover:bg-accent/50 cursor-pointer transition-colors",onClick:()=>N(s.id),children:[e.jsx(c,{className:"px-5 py-4 h-16 align-middle text-sm font-medium text-foreground flex-1 min-w-0",children:s.name}),e.jsx(c,{className:"px-5 py-4 h-16 align-middle w-24 shrink-0",children:e.jsx(W,{variant:s.active?"default":"secondary",children:s.active?"Active":"Inactive"})}),e.jsx(c,{className:"px-5 py-4 h-16 align-middle text-sm text-muted-foreground w-24 shrink-0",children:s.trigger_count}),e.jsx(c,{className:"px-5 py-4 h-16 align-middle w-40 shrink-0",children:e.jsx(R,{id:s.created_by})}),e.jsx(c,{className:"px-5 py-4 h-16 align-middle w-12 shrink-0",children:e.jsxs(se,{children:[e.jsx(te,{asChild:!0,children:e.jsx(p,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:a=>a.stopPropagation(),children:e.jsx(me,{size:20})})}),e.jsxs(ae,{align:"end",onClick:a=>a.stopPropagation(),children:[e.jsxs(C,{onClick:a=>{a.stopPropagation(),N(s.id)},children:[e.jsx(ue,{size:16}),"Open"]}),e.jsxs(C,{variant:"destructive",onClick:a=>{a.stopPropagation(),m({id:s.id,name:s.name})},children:[e.jsx(pe,{size:16}),"Delete"]})]})]})})]},s.id))})]}),e.jsx(F,{open:!!d,onOpenChange:s=>!s&&m(null),children:e.jsxs(K,{children:[e.jsxs(U,{children:[e.jsx(G,{children:"Delete Automation?"}),e.jsxs(J,{children:["This action cannot be undone. This will permanently delete"," ",e.jsx("span",{className:"font-medium text-foreground",children:d?.name}),". All triggers will be removed."]})]}),e.jsxs(V,{children:[e.jsx(q,{children:"Cancel"}),e.jsx(Q,{onClick:z,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})})]})]})}export{Ue as default};
@@ -1 +1 @@
1
- import{c as k,j as i,r as V,D as m,W as S,ay as $,az as O,aA as U}from"./index-DLW7tZdu.js";import{s as D}from"./User01-BRC1qZ-u.js";function L(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=m("relative flex size-8 shrink-0 overflow-hidden rounded-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx(U,{"data-slot":"avatar",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}function M(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=m("aspect-square size-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx($,{"data-slot":"avatar-image",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}function T(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=m("bg-muted flex size-full items-center justify-center rounded-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx(O,{"data-slot":"avatar-fallback",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}const R=["drop-shadow-lg bg-gradient-to-br from-red-100 to-red-300 text-red-800 shadow-lg shadow-red-300/40 ring-1 ring-red-300/30","drop-shadow-lg bg-gradient-to-br from-lime-100 to-lime-300 text-lime-800 shadow-lg shadow-lime-300/40 ring-1 ring-lime-300/30","drop-shadow-lg bg-gradient-to-br from-emerald-100 to-emerald-300 text-emerald-800 shadow-lg shadow-emerald-300/40 ring-1 ring-emerald-300/30","drop-shadow-lg bg-gradient-to-br from-orange-100 to-orange-300 text-orange-800 shadow-lg shadow-orange-300/40 ring-1 ring-orange-300/30","drop-shadow-lg bg-gradient-to-br from-amber-100 to-amber-300 text-amber-800 shadow-lg shadow-amber-300/40 ring-1 ring-amber-300/30","drop-shadow-lg bg-gradient-to-br from-yellow-100 to-yellow-300 text-yellow-800 shadow-lg shadow-yellow-300/40 ring-1 ring-yellow-300/30","drop-shadow-lg bg-gradient-to-br from-green-100 to-green-300 text-green-800 shadow-lg shadow-green-300/40 ring-1 ring-green-300/30","drop-shadow-lg bg-gradient-to-br from-teal-100 to-teal-300 text-teal-800 shadow-lg shadow-teal-300/40 ring-1 ring-teal-300/30","drop-shadow-lg bg-gradient-to-br from-cyan-100 to-cyan-300 text-cyan-800 shadow-lg shadow-cyan-300/40 ring-1 ring-cyan-300/30","drop-shadow-lg bg-gradient-to-br from-sky-100 to-sky-300 text-sky-800 shadow-lg shadow-sky-300/40 ring-1 ring-sky-300/30","drop-shadow-lg bg-gradient-to-br from-blue-100 to-blue-300 text-blue-800 shadow-lg shadow-blue-300/40 ring-1 ring-blue-300/30","drop-shadow-lg bg-gradient-to-br from-indigo-100 to-indigo-300 text-indigo-800 shadow-lg shadow-indigo-300/40 ring-1 ring-indigo-300/30","drop-shadow-lg bg-gradient-to-br from-violet-100 to-violet-300 text-violet-800 shadow-lg shadow-violet-300/40 ring-1 ring-violet-300/30","drop-shadow-lg bg-gradient-to-br from-purple-100 to-purple-300 text-purple-800 shadow-lg shadow-purple-300/40 ring-1 ring-purple-300/30","drop-shadow-lg bg-gradient-to-br from-fuchsia-100 to-fuchsia-300 text-fuchsia-800 shadow-lg shadow-fuchsia-300/40 ring-1 ring-fuchsia-300/30","drop-shadow-lg bg-gradient-to-br from-pink-100 to-pink-300 text-pink-800 shadow-lg shadow-pink-300/40 ring-1 ring-pink-300/30","drop-shadow-lg bg-gradient-to-br from-rose-100 to-rose-300 text-rose-800 shadow-lg shadow-rose-300/40 ring-1 ring-rose-300/30"],W="drop-shadow-lg text-muted-foreground bg-muted shadow-lg";function _(r){let e=0;for(let t=0;t<r.length;t++)e=r.charCodeAt(t)+((e<<5)-e);const s=Math.abs(e)%R.length;return R[s]}const I=S("border border-border",{variants:{shape:{circle:"rounded-full",square:""},size:{"3xs":"w-3 h-3 text-[7px] font-semibold","2xs":"w-4 h-4 text-[9px] font-semibold",xs:"w-6 h-6 text-sm font-semibold",sm:"w-8 h-8 text-lg font-semibold",base:"w-10 h-10 text-2xl font-semibold",lg:"w-12 h-12 text-3xl font-semibold",xl:"w-16 h-16 text-4xl font-semibold","2xl":"w-20 h-20 text-5xl font-semibold","3xl":"w-32 h-32 text-7xl font-semibold"}},compoundVariants:[{shape:"square",size:"xs",class:"rounded-lg"},{shape:"square",size:"sm",class:"rounded-xl"},{shape:"square",size:"base",class:"rounded-xl"},{shape:"square",size:"lg",class:"rounded-xl"},{shape:"square",size:"xl",class:"rounded-2xl"},{shape:"square",size:"2xl",class:"rounded-3xl"},{shape:"square",size:"3xl",class:"rounded-[40px]"}],defaultVariants:{shape:"square",size:"base"}}),B=S("",{variants:{objectFit:{contain:"object-contain",cover:"object-cover"}},defaultVariants:{objectFit:"cover"}}),G=r=>{const e={"3xs":8,"2xs":8,xs:12,sm:16,base:24,lg:28,xl:36,"2xl":48,"3xl":80};return e[r]||e.base};function H(r){const e=k.c(35);let s,t,o,a,n,d,g,l;e[0]!==r?({url:l,fallback:t,shape:a,size:n,objectFit:d,className:s,muted:g,...o}=r,e[0]=r,e[1]=s,e[2]=t,e[3]=o,e[4]=a,e[5]=n,e[6]=d,e[7]=g,e[8]=l):(s=e[1],t=e[2],o=e[3],a=e[4],n=e[5],d=e[6],g=e[7],l=e[8]);const b=a===void 0?"square":a,h=n===void 0?"base":n,u=d===void 0?"cover":d,j=g===void 0?!1:g,[f,x]=V.useState(!1);let F;e:{if(typeof t=="string"){let c;e[9]!==t?(c=t.trim().slice(0,2).toUpperCase(),e[9]=t,e[10]=c):c=e[10],F=c;break e}F=t}const C=F;let z;e:{if(j){z=W;break e}if(typeof t=="string"){let c;e[11]!==t?(c=_(t),e[11]=t,e[12]=c):c=e[12],z=c;break e}z=R[0]}const y=z;let N;e[13]!==l?(N=l?.startsWith("icon://"),e[13]=l,e[14]=N):N=e[14];const p=N;let q;e[15]!==p||e[16]!==l?(q=p?l?.replace("icon://",""):void 0,e[15]=p,e[16]=l,e[17]=q):q=e[17];const E=q;let w;e[18]!==s||e[19]!==b||e[20]!==h?(w=m(I({shape:b,size:h}),s),e[18]=s,e[19]=b,e[20]=h,e[21]=w):w=e[21];let v;e[22]!==y||e[23]!==C||e[24]!==E||e[25]!==f||e[26]!==p||e[27]!==u||e[28]!==h||e[29]!==l?(v=p&&E?i.jsx("div",{className:m("flex items-center justify-center w-full h-full",y),children:i.jsx(D,{size:G(h)})}):i.jsxs(i.Fragment,{children:[l&&!f&&i.jsx(M,{src:l,loading:"lazy",alt:"Avatar",className:m(B({objectFit:u})),onError:()=>x(!0)}),(!l||f)&&i.jsx(T,{className:m(y,"rounded-none"),children:C})]}),e[22]=y,e[23]=C,e[24]=E,e[25]=f,e[26]=p,e[27]=u,e[28]=h,e[29]=l,e[30]=v):v=e[30];let A;return e[31]!==o||e[32]!==v||e[33]!==w?(A=i.jsx(L,{className:w,...o,children:v}),e[31]=o,e[32]=v,e[33]=w,e[34]=A):A=e[34],A}function J(r){const e=k.c(18);let s,t,o,a,n,d,g,l;e[0]!==r?({shape:a,size:n,url:l,fallback:t,objectFit:d,className:s,muted:g,...o}=r,e[0]=r,e[1]=s,e[2]=t,e[3]=o,e[4]=a,e[5]=n,e[6]=d,e[7]=g,e[8]=l):(s=e[1],t=e[2],o=e[3],a=e[4],n=e[5],d=e[6],g=e[7],l=e[8]);const b=a===void 0?"square":a,h=n===void 0?"base":n,u=d===void 0?"cover":d,j=g===void 0?!1:g,f=h??"base";let x;return e[9]!==s||e[10]!==t||e[11]!==j||e[12]!==u||e[13]!==o||e[14]!==b||e[15]!==f||e[16]!==l?(x=i.jsx(H,{shape:b,url:l,fallback:t,size:f,objectFit:u,className:s,muted:j,...o}),e[9]=s,e[10]=t,e[11]=j,e[12]=u,e[13]=o,e[14]=b,e[15]=f,e[16]=l,e[17]=x):x=e[17],x}J.Skeleton=function({shape:e="square",size:s="base",className:t}){return i.jsx("div",{className:m(I({shape:e,size:s}),"bg-muted animate-pulse",t)})};export{J as A};
1
+ import{c as k,j as i,r as V,D as m,W as S,ay as $,az as O,aA as U}from"./index-BRbdC8tb.js";import{s as D}from"./User01-B6InEsCV.js";function L(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=m("relative flex size-8 shrink-0 overflow-hidden rounded-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx(U,{"data-slot":"avatar",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}function M(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=m("aspect-square size-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx($,{"data-slot":"avatar-image",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}function T(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=m("bg-muted flex size-full items-center justify-center rounded-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx(O,{"data-slot":"avatar-fallback",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}const R=["drop-shadow-lg bg-gradient-to-br from-red-100 to-red-300 text-red-800 shadow-lg shadow-red-300/40 ring-1 ring-red-300/30","drop-shadow-lg bg-gradient-to-br from-lime-100 to-lime-300 text-lime-800 shadow-lg shadow-lime-300/40 ring-1 ring-lime-300/30","drop-shadow-lg bg-gradient-to-br from-emerald-100 to-emerald-300 text-emerald-800 shadow-lg shadow-emerald-300/40 ring-1 ring-emerald-300/30","drop-shadow-lg bg-gradient-to-br from-orange-100 to-orange-300 text-orange-800 shadow-lg shadow-orange-300/40 ring-1 ring-orange-300/30","drop-shadow-lg bg-gradient-to-br from-amber-100 to-amber-300 text-amber-800 shadow-lg shadow-amber-300/40 ring-1 ring-amber-300/30","drop-shadow-lg bg-gradient-to-br from-yellow-100 to-yellow-300 text-yellow-800 shadow-lg shadow-yellow-300/40 ring-1 ring-yellow-300/30","drop-shadow-lg bg-gradient-to-br from-green-100 to-green-300 text-green-800 shadow-lg shadow-green-300/40 ring-1 ring-green-300/30","drop-shadow-lg bg-gradient-to-br from-teal-100 to-teal-300 text-teal-800 shadow-lg shadow-teal-300/40 ring-1 ring-teal-300/30","drop-shadow-lg bg-gradient-to-br from-cyan-100 to-cyan-300 text-cyan-800 shadow-lg shadow-cyan-300/40 ring-1 ring-cyan-300/30","drop-shadow-lg bg-gradient-to-br from-sky-100 to-sky-300 text-sky-800 shadow-lg shadow-sky-300/40 ring-1 ring-sky-300/30","drop-shadow-lg bg-gradient-to-br from-blue-100 to-blue-300 text-blue-800 shadow-lg shadow-blue-300/40 ring-1 ring-blue-300/30","drop-shadow-lg bg-gradient-to-br from-indigo-100 to-indigo-300 text-indigo-800 shadow-lg shadow-indigo-300/40 ring-1 ring-indigo-300/30","drop-shadow-lg bg-gradient-to-br from-violet-100 to-violet-300 text-violet-800 shadow-lg shadow-violet-300/40 ring-1 ring-violet-300/30","drop-shadow-lg bg-gradient-to-br from-purple-100 to-purple-300 text-purple-800 shadow-lg shadow-purple-300/40 ring-1 ring-purple-300/30","drop-shadow-lg bg-gradient-to-br from-fuchsia-100 to-fuchsia-300 text-fuchsia-800 shadow-lg shadow-fuchsia-300/40 ring-1 ring-fuchsia-300/30","drop-shadow-lg bg-gradient-to-br from-pink-100 to-pink-300 text-pink-800 shadow-lg shadow-pink-300/40 ring-1 ring-pink-300/30","drop-shadow-lg bg-gradient-to-br from-rose-100 to-rose-300 text-rose-800 shadow-lg shadow-rose-300/40 ring-1 ring-rose-300/30"],W="drop-shadow-lg text-muted-foreground bg-muted shadow-lg";function _(r){let e=0;for(let t=0;t<r.length;t++)e=r.charCodeAt(t)+((e<<5)-e);const s=Math.abs(e)%R.length;return R[s]}const I=S("border border-border",{variants:{shape:{circle:"rounded-full",square:""},size:{"3xs":"w-3 h-3 text-[7px] font-semibold","2xs":"w-4 h-4 text-[9px] font-semibold",xs:"w-6 h-6 text-sm font-semibold",sm:"w-8 h-8 text-lg font-semibold",base:"w-10 h-10 text-2xl font-semibold",lg:"w-12 h-12 text-3xl font-semibold",xl:"w-16 h-16 text-4xl font-semibold","2xl":"w-20 h-20 text-5xl font-semibold","3xl":"w-32 h-32 text-7xl font-semibold"}},compoundVariants:[{shape:"square",size:"xs",class:"rounded-lg"},{shape:"square",size:"sm",class:"rounded-xl"},{shape:"square",size:"base",class:"rounded-xl"},{shape:"square",size:"lg",class:"rounded-xl"},{shape:"square",size:"xl",class:"rounded-2xl"},{shape:"square",size:"2xl",class:"rounded-3xl"},{shape:"square",size:"3xl",class:"rounded-[40px]"}],defaultVariants:{shape:"square",size:"base"}}),B=S("",{variants:{objectFit:{contain:"object-contain",cover:"object-cover"}},defaultVariants:{objectFit:"cover"}}),G=r=>{const e={"3xs":8,"2xs":8,xs:12,sm:16,base:24,lg:28,xl:36,"2xl":48,"3xl":80};return e[r]||e.base};function H(r){const e=k.c(35);let s,t,o,a,n,d,g,l;e[0]!==r?({url:l,fallback:t,shape:a,size:n,objectFit:d,className:s,muted:g,...o}=r,e[0]=r,e[1]=s,e[2]=t,e[3]=o,e[4]=a,e[5]=n,e[6]=d,e[7]=g,e[8]=l):(s=e[1],t=e[2],o=e[3],a=e[4],n=e[5],d=e[6],g=e[7],l=e[8]);const b=a===void 0?"square":a,h=n===void 0?"base":n,u=d===void 0?"cover":d,j=g===void 0?!1:g,[f,x]=V.useState(!1);let F;e:{if(typeof t=="string"){let c;e[9]!==t?(c=t.trim().slice(0,2).toUpperCase(),e[9]=t,e[10]=c):c=e[10],F=c;break e}F=t}const C=F;let z;e:{if(j){z=W;break e}if(typeof t=="string"){let c;e[11]!==t?(c=_(t),e[11]=t,e[12]=c):c=e[12],z=c;break e}z=R[0]}const y=z;let N;e[13]!==l?(N=l?.startsWith("icon://"),e[13]=l,e[14]=N):N=e[14];const p=N;let q;e[15]!==p||e[16]!==l?(q=p?l?.replace("icon://",""):void 0,e[15]=p,e[16]=l,e[17]=q):q=e[17];const E=q;let w;e[18]!==s||e[19]!==b||e[20]!==h?(w=m(I({shape:b,size:h}),s),e[18]=s,e[19]=b,e[20]=h,e[21]=w):w=e[21];let v;e[22]!==y||e[23]!==C||e[24]!==E||e[25]!==f||e[26]!==p||e[27]!==u||e[28]!==h||e[29]!==l?(v=p&&E?i.jsx("div",{className:m("flex items-center justify-center w-full h-full",y),children:i.jsx(D,{size:G(h)})}):i.jsxs(i.Fragment,{children:[l&&!f&&i.jsx(M,{src:l,loading:"lazy",alt:"Avatar",className:m(B({objectFit:u})),onError:()=>x(!0)}),(!l||f)&&i.jsx(T,{className:m(y,"rounded-none"),children:C})]}),e[22]=y,e[23]=C,e[24]=E,e[25]=f,e[26]=p,e[27]=u,e[28]=h,e[29]=l,e[30]=v):v=e[30];let A;return e[31]!==o||e[32]!==v||e[33]!==w?(A=i.jsx(L,{className:w,...o,children:v}),e[31]=o,e[32]=v,e[33]=w,e[34]=A):A=e[34],A}function J(r){const e=k.c(18);let s,t,o,a,n,d,g,l;e[0]!==r?({shape:a,size:n,url:l,fallback:t,objectFit:d,className:s,muted:g,...o}=r,e[0]=r,e[1]=s,e[2]=t,e[3]=o,e[4]=a,e[5]=n,e[6]=d,e[7]=g,e[8]=l):(s=e[1],t=e[2],o=e[3],a=e[4],n=e[5],d=e[6],g=e[7],l=e[8]);const b=a===void 0?"square":a,h=n===void 0?"base":n,u=d===void 0?"cover":d,j=g===void 0?!1:g,f=h??"base";let x;return e[9]!==s||e[10]!==t||e[11]!==j||e[12]!==u||e[13]!==o||e[14]!==b||e[15]!==f||e[16]!==l?(x=i.jsx(H,{shape:b,url:l,fallback:t,size:f,objectFit:u,className:s,muted:j,...o}),e[9]=s,e[10]=t,e[11]=j,e[12]=u,e[13]=o,e[14]=b,e[15]=f,e[16]=l,e[17]=x):x=e[17],x}J.Skeleton=function({shape:e="square",size:s="base",className:t}){return i.jsx("div",{className:m(I({shape:e,size:s}),"bg-muted animate-pulse",t)})};export{J as A};
@@ -1 +1 @@
1
- import{c as d,D as u,j as l,M as v,W as g}from"./index-DLW7tZdu.js";const b=g("inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",success:"border-transparent bg-success text-success-foreground [a&]:hover:bg-success/90 focus-visible:ring-success/20 dark:focus-visible:ring-success/40",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function x(o){const e=d.c(12);let r,s,a,t;e[0]!==o?({className:r,variant:t,asChild:a,...s}=o,e[0]=o,e[1]=r,e[2]=s,e[3]=a,e[4]=t):(r=e[1],s=e[2],a=e[3],t=e[4]);const c=(a===void 0?!1:a)?v:"span";let i;e[5]!==r||e[6]!==t?(i=u(b({variant:t}),r),e[5]=r,e[6]=t,e[7]=i):i=e[7];let n;return e[8]!==c||e[9]!==s||e[10]!==i?(n=l.jsx(c,{"data-slot":"badge",className:i,...s}),e[8]=c,e[9]=s,e[10]=i,e[11]=n):n=e[11],n}export{x as B};
1
+ import{c as d,D as u,j as l,M as v,W as g}from"./index-BRbdC8tb.js";const b=g("inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",success:"border-transparent bg-success text-success-foreground [a&]:hover:bg-success/90 focus-visible:ring-success/20 dark:focus-visible:ring-success/40",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function x(o){const e=d.c(12);let r,s,a,t;e[0]!==o?({className:r,variant:t,asChild:a,...s}=o,e[0]=o,e[1]=r,e[2]=s,e[3]=a,e[4]=t):(r=e[1],s=e[2],a=e[3],t=e[4]);const c=(a===void 0?!1:a)?v:"span";let i;e[5]!==r||e[6]!==t?(i=u(b({variant:t}),r),e[5]=r,e[6]=t,e[7]=i):i=e[7];let n;return e[8]!==c||e[9]!==s||e[10]!==i?(n=l.jsx(c,{"data-slot":"badge",className:i,...s}),e[8]=c,e[9]=s,e[10]=i,e[11]=n):n=e[11],n}export{x as B};
@@ -1 +1 @@
1
- import"./index-DLW7tZdu.js";function a(o){return{isImplementedBy:c=>{for(const e of o){const r=typeof e.name=="string"?new RegExp(`^${e.name}$`):e.name,t=c.find(i=>r.test(i.name));if(!(!t&&e.opt)&&!t)return!1}return!0}}}function s(o,c){const e=o.tools;if(!e||e.length===0)return!1;const r=e.map(n=>({name:n.name,inputSchema:n.inputSchema})),t=c.map(n=>({name:n.name,inputSchema:n.inputSchema,opt:n.opt}));return a(t).isImplementedBy(r)}export{a,s as c};
1
+ import"./index-BRbdC8tb.js";function a(o){return{isImplementedBy:c=>{for(const e of o){const r=typeof e.name=="string"?new RegExp(`^${e.name}$`):e.name,t=c.find(i=>r.test(i.name));if(!(!t&&e.opt)&&!t)return!1}return!0}}}function s(o,c){const e=o.tools;if(!e||e.length===0)return!1;const r=e.map(n=>({name:n.name,inputSchema:n.inputSchema})),t=c.map(n=>({name:n.name,inputSchema:n.inputSchema,opt:n.opt}));return a(t).isImplementedBy(r)}export{a,s as c};
@@ -1 +1 @@
1
- import{c,D as m,j as o,M as u}from"./index-DLW7tZdu.js";import{i as d}from"./ChevronRight-BSFLHUtv.js";function b(r){const e=c.c(8);let a,t;e[0]!==r?({className:a,...t}=r,e[0]=r,e[1]=a,e[2]=t):(a=e[1],t=e[2]);let s;e[3]!==a?(s=m("min-w-0 overflow-hidden",a),e[3]=a,e[4]=s):s=e[4];let l;return e[5]!==t||e[6]!==s?(l=o.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",className:s,...t}),e[5]=t,e[6]=s,e[7]=l):l=e[7],l}function x(r){const e=c.c(8);let a,t;e[0]!==r?({className:a,...t}=r,e[0]=r,e[1]=a,e[2]=t):(a=e[1],t=e[2]);let s;e[3]!==a?(s=m("flex items-center gap-1.5 text-sm sm:gap-2 overflow-hidden",a),e[3]=a,e[4]=s):s=e[4];let l;return e[5]!==t||e[6]!==s?(l=o.jsx("ol",{"data-slot":"breadcrumb-list",className:s,...t}),e[5]=t,e[6]=s,e[7]=l):l=e[7],l}function N(r){const e=c.c(8);let a,t;e[0]!==r?({className:a,...t}=r,e[0]=r,e[1]=a,e[2]=t):(a=e[1],t=e[2]);let s;e[3]!==a?(s=m("inline-flex items-center gap-1.5 min-w-0",a),e[3]=a,e[4]=s):s=e[4];let l;return e[5]!==t||e[6]!==s?(l=o.jsx("li",{"data-slot":"breadcrumb-item",className:s,...t}),e[5]=t,e[6]=s,e[7]=l):l=e[7],l}function g(r){const e=c.c(10);let a,t,s;e[0]!==r?({asChild:a,className:t,...s}=r,e[0]=r,e[1]=a,e[2]=t,e[3]=s):(a=e[1],t=e[2],s=e[3]);const l=a?u:"a";let i;e[4]!==t?(i=m("hover:text-foreground transition-colors truncate",t),e[4]=t,e[5]=i):i=e[5];let n;return e[6]!==l||e[7]!==s||e[8]!==i?(n=o.jsx(l,{"data-slot":"breadcrumb-link",className:i,...s}),e[6]=l,e[7]=s,e[8]=i,e[9]=n):n=e[9],n}function j(r){const e=c.c(8);let a,t;e[0]!==r?({className:a,...t}=r,e[0]=r,e[1]=a,e[2]=t):(a=e[1],t=e[2]);let s;e[3]!==a?(s=m("text-foreground font-medium truncate",a),e[3]=a,e[4]=s):s=e[4];let l;return e[5]!==t||e[6]!==s?(l=o.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:s,...t}),e[5]=t,e[6]=s,e[7]=l):l=e[7],l}function h(r){const e=c.c(12);let a,t,s;e[0]!==r?({children:a,className:t,...s}=r,e[0]=r,e[1]=a,e[2]=t,e[3]=s):(a=e[1],t=e[2],s=e[3]);let l;e[4]!==t?(l=m("[&>svg]:size-3.5 text-muted-foreground opacity-50 list-none shrink-0",t),e[4]=t,e[5]=l):l=e[5];let i;e[6]!==a?(i=a??o.jsx(d,{}),e[6]=a,e[7]=i):i=e[7];let n;return e[8]!==s||e[9]!==l||e[10]!==i?(n=o.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:l,...s,children:i}),e[8]=s,e[9]=l,e[10]=i,e[11]=n):n=e[11],n}export{b as B,x as a,N as b,j as c,g as d,h as e};
1
+ import{c,D as m,j as o,M as u}from"./index-BRbdC8tb.js";import{i as d}from"./ChevronRight-BU9wyepR.js";function b(r){const e=c.c(8);let a,t;e[0]!==r?({className:a,...t}=r,e[0]=r,e[1]=a,e[2]=t):(a=e[1],t=e[2]);let s;e[3]!==a?(s=m("min-w-0 overflow-hidden",a),e[3]=a,e[4]=s):s=e[4];let l;return e[5]!==t||e[6]!==s?(l=o.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",className:s,...t}),e[5]=t,e[6]=s,e[7]=l):l=e[7],l}function x(r){const e=c.c(8);let a,t;e[0]!==r?({className:a,...t}=r,e[0]=r,e[1]=a,e[2]=t):(a=e[1],t=e[2]);let s;e[3]!==a?(s=m("flex items-center gap-1.5 text-sm sm:gap-2 overflow-hidden",a),e[3]=a,e[4]=s):s=e[4];let l;return e[5]!==t||e[6]!==s?(l=o.jsx("ol",{"data-slot":"breadcrumb-list",className:s,...t}),e[5]=t,e[6]=s,e[7]=l):l=e[7],l}function N(r){const e=c.c(8);let a,t;e[0]!==r?({className:a,...t}=r,e[0]=r,e[1]=a,e[2]=t):(a=e[1],t=e[2]);let s;e[3]!==a?(s=m("inline-flex items-center gap-1.5 min-w-0",a),e[3]=a,e[4]=s):s=e[4];let l;return e[5]!==t||e[6]!==s?(l=o.jsx("li",{"data-slot":"breadcrumb-item",className:s,...t}),e[5]=t,e[6]=s,e[7]=l):l=e[7],l}function g(r){const e=c.c(10);let a,t,s;e[0]!==r?({asChild:a,className:t,...s}=r,e[0]=r,e[1]=a,e[2]=t,e[3]=s):(a=e[1],t=e[2],s=e[3]);const l=a?u:"a";let i;e[4]!==t?(i=m("hover:text-foreground transition-colors truncate",t),e[4]=t,e[5]=i):i=e[5];let n;return e[6]!==l||e[7]!==s||e[8]!==i?(n=o.jsx(l,{"data-slot":"breadcrumb-link",className:i,...s}),e[6]=l,e[7]=s,e[8]=i,e[9]=n):n=e[9],n}function j(r){const e=c.c(8);let a,t;e[0]!==r?({className:a,...t}=r,e[0]=r,e[1]=a,e[2]=t):(a=e[1],t=e[2]);let s;e[3]!==a?(s=m("text-foreground font-medium truncate",a),e[3]=a,e[4]=s):s=e[4];let l;return e[5]!==t||e[6]!==s?(l=o.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:s,...t}),e[5]=t,e[6]=s,e[7]=l):l=e[7],l}function h(r){const e=c.c(12);let a,t,s;e[0]!==r?({children:a,className:t,...s}=r,e[0]=r,e[1]=a,e[2]=t,e[3]=s):(a=e[1],t=e[2],s=e[3]);let l;e[4]!==t?(l=m("[&>svg]:size-3.5 text-muted-foreground opacity-50 list-none shrink-0",t),e[4]=t,e[5]=l):l=e[5];let i;e[6]!==a?(i=a??o.jsx(d,{}),e[6]=a,e[7]=i):i=e[7];let n;return e[8]!==s||e[9]!==l||e[10]!==i?(n=o.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:l,...s,children:i}),e[8]=s,e[9]=l,e[10]=i,e[11]=n):n=e[11],n}export{b as B,x as a,N as b,j as c,g as d,h as e};
@@ -1 +1 @@
1
- import{c as l,D as c,j as d}from"./index-DLW7tZdu.js";function x(a){const e=l.c(8);let r,s;e[0]!==a?({className:r,...s}=a,e[0]=a,e[1]=r,e[2]=s):(r=e[1],s=e[2]);let o;e[3]!==r?(o=c("bg-card text-card-foreground hover:bg-accent/50 flex flex-col gap-6 rounded-xl border border-border shadow-xs",r),e[3]=r,e[4]=o):o=e[4];let t;return e[5]!==s||e[6]!==o?(t=d.jsx("div",{"data-slot":"card",className:o,...s}),e[5]=s,e[6]=o,e[7]=t):t=e[7],t}export{x as C};
1
+ import{c as l,D as c,j as d}from"./index-BRbdC8tb.js";function x(a){const e=l.c(8);let r,s;e[0]!==a?({className:r,...s}=a,e[0]=a,e[1]=r,e[2]=s):(r=e[1],s=e[2]);let o;e[3]!==r?(o=c("bg-card text-card-foreground hover:bg-accent/50 flex flex-col gap-6 rounded-xl border border-border shadow-xs",r),e[3]=r,e[4]=o):o=e[4];let t;return e[5]!==s||e[6]!==o?(t=d.jsx("div",{"data-slot":"card",className:o,...s}),e[5]=s,e[6]=o,e[7]=t):t=e[7],t}export{x as C};
@@ -1 +1 @@
1
- import{c as d,D as n,j as c,aE as l,aF as m}from"./index-DLW7tZdu.js";import{i as b}from"./Check-BXqqUm0J.js";function x(o){const e=d.c(9);let r,a;e[0]!==o?({className:r,...a}=o,e[0]=o,e[1]=r,e[2]=a):(r=e[1],a=e[2]);let i;e[3]!==r?(i=n("peer border-foreground dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",r),e[3]=r,e[4]=i):i=e[4];let t;e[5]===Symbol.for("react.memo_cache_sentinel")?(t=c.jsx(m,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-primary-foreground transition-none",children:c.jsx(b,{className:"size-3.5"})}),e[5]=t):t=e[5];let s;return e[6]!==a||e[7]!==i?(s=c.jsx(l,{"data-slot":"checkbox",className:i,...a,children:t}),e[6]=a,e[7]=i,e[8]=s):s=e[8],s}export{x as C};
1
+ import{c as d,D as n,j as c,aE as l,aF as m}from"./index-BRbdC8tb.js";import{i as b}from"./Check-5J8pLufa.js";function x(o){const e=d.c(9);let r,a;e[0]!==o?({className:r,...a}=o,e[0]=o,e[1]=r,e[2]=a):(r=e[1],a=e[2]);let i;e[3]!==r?(i=n("peer border-foreground dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",r),e[3]=r,e[4]=i):i=e[4];let t;e[5]===Symbol.for("react.memo_cache_sentinel")?(t=c.jsx(m,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-primary-foreground transition-none",children:c.jsx(b,{className:"size-3.5"})}),e[5]=t):t=e[5];let s;return e[6]!==a||e[7]!==i?(s=c.jsx(l,{"data-slot":"checkbox",className:i,...a,children:t}),e[6]=a,e[7]=i,e[8]=s):s=e[8],s}export{x as C};
@@ -1 +1 @@
1
- import{c as t,j as i}from"./index-DLW7tZdu.js";import{R as a,C as r,a as n}from"./index-B1ylaSc7.js";function f(o){const l=t.c(4);let e;l[0]!==o?({...e}=o,l[0]=o,l[1]=e):e=l[1];let s;return l[2]!==e?(s=i.jsx(a,{"data-slot":"collapsible",...e}),l[2]=e,l[3]=s):s=l[3],s}function b(o){const l=t.c(4);let e;l[0]!==o?({...e}=o,l[0]=o,l[1]=e):e=l[1];let s;return l[2]!==e?(s=i.jsx(r,{"data-slot":"collapsible-trigger",...e}),l[2]=e,l[3]=s):s=l[3],s}function C(o){const l=t.c(4);let e;l[0]!==o?({...e}=o,l[0]=o,l[1]=e):e=l[1];let s;return l[2]!==e?(s=i.jsx(n,{"data-slot":"collapsible-content",...e}),l[2]=e,l[3]=s):s=l[3],s}export{f as C,b as a,C as b};
1
+ import{c as t,j as i}from"./index-BRbdC8tb.js";import{R as a,C as r,a as n}from"./index-DW3Gddt1.js";function f(o){const l=t.c(4);let e;l[0]!==o?({...e}=o,l[0]=o,l[1]=e):e=l[1];let s;return l[2]!==e?(s=i.jsx(a,{"data-slot":"collapsible",...e}),l[2]=e,l[3]=s):s=l[3],s}function b(o){const l=t.c(4);let e;l[0]!==o?({...e}=o,l[0]=o,l[1]=e):e=l[1];let s;return l[2]!==e?(s=i.jsx(r,{"data-slot":"collapsible-trigger",...e}),l[2]=e,l[3]=s):s=l[3],s}function C(o){const l=t.c(4);let e;l[0]!==o?({...e}=o,l[0]=o,l[1]=e):e=l[1];let s;return l[2]!==e?(s=i.jsx(n,{"data-slot":"collapsible-content",...e}),l[2]=e,l[3]=s):s=l[3],s}export{f as C,b as a,C as b};
@@ -1,4 +1,4 @@
1
- import{bk as ce,o as qs,n as Ot,c as N,j as o,E as Dn,r as _,u as Z,t as Ks,D as R,W as Js,d as Gs,G as at,O as dt,B as Y,v as zn,bR as X,cj as Xs,ck as Qs,b3 as Ys,_ as Xt,a1 as pe,a3 as Wn,b4 as Zs,Y as Qt,b2 as eo,b5 as Fn,$ as Hn,bb as to,bc as no,a4 as Vn,bd as so,cl as Yt,cm as oo,a9 as ro,be as io,X as lo,w as co,g as Ne,cn as ao,co as uo,cp as Un}from"./index-DLW7tZdu.js";import{E as Bn}from"./empty-state-Cx44yC3Y.js";import{d as Zt,u as en}from"./use-collections-BJxMmWLX.js";import{u as ae,g as Ye,i as fo}from"./constants-Dzy_AMuL.js";import{F as Rt,a as mo,b as tn,d as nn}from"./form-Obbe7UIk.js";import{I as sn}from"./input-DgJ0xjPE.js";import{T as Ft}from"./textarea-CJ-1DHFH.js";import{a as qn,b as Kn,V as we}from"./layout-p-PoyTJz.js";import{S as Jn}from"./save-actions-DGqTWEQL.js";import{M as po}from"./mcp-app-renderer-DzztYEVX.js";import{g as xo,M as Nn}from"./types-vQT8OD6B.js";import{S as Ht,a as Vt,b as Ut,c as Bt,d as Ge}from"./select-DeOQOwBi.js";import{c as on,T as ut,a as ft,b as mt}from"./tooltip-D-QYbPJS.js";import{i as ho}from"./AlertCircle-BO0kzcBv.js";import{I as Qe,_ as go,$ as bo,a0 as jo,f as vo,a1 as So,a2 as yo,a3 as wo,a4 as No,O as Co,a5 as Gn,D as ko,a6 as Io,a7 as _o,R as At}from"./integration-icon-C-I4Z6Dk.js";import{s as To,i as Cn,b as $o}from"./Type01-CjsMMlh6.js";import{i as rn,c as Eo}from"./Play-Bw_aeuhq.js";import{i as jt}from"./Loading01-DCKwAh-U.js";import{B as Xn,a as Qn,b as He,d as pt,e as xt,c as Yn}from"./breadcrumb-CBpEGiAs.js";import{u as Oo,O as Ro,M as Ao,F as Mo,v as Po}from"./index-CDNLqNNq.js";import{g as Ze}from"./connection-slug-Bw8dtz1U.js";import{u as ln,b as et}from"./use-connection-DPMknCkO.js";import{d as cn,b as an,a as dn}from"./use-mcp-tools-KIPxuDyk.js";import{c as Lo}from"./content-blocks-o63cs2vh.js";import{T as Do}from"./tools-list-DLZSPKIc.js";import{u as zo,c as Wo}from"./context-BL_7JbXZ.js";import{a as Fo}from"./index-75eZ1uI1.js";import{M as Ve}from"./monaco-editor-DX4p-sBy.js";import{E as un}from"./empty-state-BgKAQr0C.js";import{n as Ho}from"./Container-BZeblIrR.js";import{b as Zn}from"./use-virtual-mcp-BEia5q72.js";import{b as Vo,R as kn,a as Uo}from"./resizable-CAbzuUb1.js";import{B as ve}from"./badge-C2jHxnoS.js";import{S as vt}from"./spinner-D4Lh5lMu.js";import{V as Bo}from"./collection-display-button-BetF6DhL.js";import{d as qo}from"./registry-utils-D6No_i4P.js";import{b as Ko,c as Jo,d as Go,e as Xo,a as Qo,D as Yo}from"./dialog-Dmm_af5q.js";import"./index-CUtX0cOT.js";import{N as Zo,S as er,a as tr,c as nr,m as lt,P as sr,i as or,R as rr,u as ir,b as lr,d as In,E as cr}from"./index-C0Ne6xGI.js";import{s as es}from"./Plus-BW2fNoEy.js";import{i as St}from"./Check-BXqqUm0J.js";import{s as fn}from"./XClose-CslgPORS.js";import{D as ar,a as dr,b as ur,c as _n}from"./dropdown-menu-BtgYu0Kc.js";import{T as fr,R as mr,b as pr,c as ts}from"./index-B1ylaSc7.js";import{i as xr}from"./ChevronRight-BSFLHUtv.js";import{a as hr,S as gr}from"./scroll-area-BCIFp-8p.js";import"./index-CdK7iTUb.js";import{i as ns}from"./X-BL1q6dsE.js";import"./useMutation-BatnVMWS.js";import"./label-BL4fRnZZ.js";import"./XCircle-DxcmI8rf.js";import"./use-mcp-resources-DQ2GW_FE.js";import"./useQuery-YHvrmKkI.js";import"./index-BdQq_4o_.js";import"./index-CQPlxt4u.js";import"./ChevronDown-B6V9GzuP.js";import"./ChevronUp-BYpnL-9F.js";import"./ArrowUp-FfROzAyV.js";import"./ArrowLeft-CrI91Scn.js";import"./RefreshCcw01-YXuL16Jx.js";import"./Dataflow03-CTwEKVcs.js";import"./Download01-D7T-WxGL.js";import"./List-Bq1Yvo6z.js";import"./VideoRecorder-DkcbdsZk.js";import"./FolderClosed-BPzjOG-5.js";import"./Grid01-Bwsn0nh2.js";import"./SearchMd-C_bEWIlQ.js";import"./Settings01-BoOhxJJj.js";import"./Trash01-D9O3UWX6.js";import"./Upload01-Bpjo_QI4.js";import"./User01-BRC1qZ-u.js";import"./Zap-DERWnfoj.js";import"./constants-BTMGn0Px.js";import"./extract-connection-data-Zw5RYEyS.js";import"./generate-id-Dyweu44Y.js";import"./use-install-from-registry-C1XqHuwX.js";import"./index-BtvKqHu_.js";import"./index-DCtU4ndp.js";import"./select-virtual-mcp-B78FWMF5.js";import"./popover-DnM-fBUa.js";import"./use-create-virtual-mcp-pWj6n63S.js";import"./slugify-CEUa2lfQ.js";import"./collection-search-DcVVKJ8Q.js";import"./collection-table-wrapper-D9WWtdCi.js";import"./table-CbTCyRX5.js";import"./card-CUrYBr2J.js";import"./decopilot-events-Brt4gAR6.js";import"./binder-BaB8rAtx.js";const ss=ce("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);const os=ce("Braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]);const mn=ce("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const pn=ce("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const br=ce("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const jr=ce("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);const vr=ce("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const rs=ce("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const is=ce("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);const ls=ce("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);const Sr=ce("OctagonAlert",[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]]);const cs=ce("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);const as=ce("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);qs({title:Ot().min(1),description:Ot().nullable(),body:Ot()});function Mt(t){for(const e of t.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function yr(){const t=window.location.pathname.split("/").filter(Boolean),e=t.findIndex(s=>s==="mcps"),n=e>=0?t[e+1]:void 0;return n?decodeURIComponent(n):void 0}function wr(t){const e=N.c(13),{form:n}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx("div",{className:"text-sm font-medium text-foreground",children:"Details"}),e[0]=s):s=e[0];let i;e[1]!==n.control?(i=o.jsxs("div",{className:"flex flex-col gap-4",children:[s,o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[o.jsx(Rt,{control:n.control,name:"title",render:kr}),o.jsx(Rt,{control:n.control,name:"description",render:Cr})]})]}),e[1]=n.control,e[2]=i):i=e[2];let r,l;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx("div",{className:"text-sm font-medium text-foreground",children:"Message"}),l=o.jsx("div",{className:"text-xs text-muted-foreground",children:"This becomes the user message in the prompt."}),e[3]=r,e[4]=l):(r=e[3],l=e[4]);let c;e[5]!==n.control?(c=o.jsxs("div",{className:"flex flex-col gap-2",children:[r,l,o.jsx(Rt,{control:n.control,name:"body",render:Nr})]}),e[5]=n.control,e[6]=c):c=e[6];let a;e[7]!==i||e[8]!==c?(a=o.jsxs("div",{className:"h-full py-6 flex flex-col max-w-3xl mx-auto w-full min-w-0 gap-8 overflow-y-auto px-4",children:[i,c]}),e[7]=i,e[8]=c,e[9]=a):a=e[9];let d;return e[10]!==n||e[11]!==a?(d=o.jsx(mo,{...n,children:a}),e[10]=n,e[11]=a,e[12]=d):d=e[12],d}function Nr(t){const{field:e}=t;return o.jsx(tn,{children:o.jsx(nn,{children:o.jsx(Ft,{...e,value:e.value??"",placeholder:"Write the prompt message…",className:"min-h-[240px] resize-none text-base leading-relaxed font-normal rounded-xl border border-border bg-muted/20 px-4 py-3 shadow-none focus-visible:ring-0"})})})}function Cr(t){const{field:e}=t;return o.jsxs(tn,{children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),o.jsx(nn,{children:o.jsx(sn,{...e,value:e.value??"",placeholder:"Add a description…",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function kr(t){const{field:e}=t;return o.jsxs(tn,{children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),o.jsx(nn,{children:o.jsx(sn,{...e,placeholder:"Untitled prompt",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Ir(t){const e=N.c(35),{providerId:n,promptId:s}=t,{org:i}=Z(),r=n||null;let l;e[0]!==i.id||e[1]!==r?(l={connectionId:r,orgId:i.id},e[0]=i.id,e[1]=r,e[2]=l):l=e[2];const c=ae(l),a=Zt(n,"PROMPT",s,c),d=en(n,"PROMPT",c),u=d.update.isPending;let f;e[3]!==a?(f=a?{title:a.title,description:a.description??null,body:Mt(a)}:void 0,e[3]=a,e[4]=f):f=e[4];let m;e[5]!==f?(m={values:f},e[5]=f,e[6]=m):m=e[6];const x=Ks(m);let p;e[7]!==x||e[8]!==a?(p=()=>{a&&x.reset({title:a.title,description:a.description??null,body:Mt(a)})},e[7]=x,e[8]=a,e[9]=p):p=e[9];const h=p;let g;e[10]!==d.update||e[11]!==x||e[12]!==s?(g=x.handleSubmit(async I=>{const E=await d.update.mutateAsync({id:s,data:{title:I.title,description:I.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:I.body}}]}});x.reset({title:E.title,description:E.description??null,body:Mt(E)})}),e[10]=d.update,e[11]=x,e[12]=s,e[13]=g):g=e[13];const b=g;if(!a){let I;return e[14]===Symbol.for("react.memo_cache_sentinel")?(I=o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(Bn,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[14]=I):I=e[14],I}let j;e[15]!==a.title?(j=o.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:a.title}),e[15]=a.title,e[16]=j):j=e[16];let S;e[17]!==a.description?(S=a.description?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),o.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:a.description})]}):null,e[17]=a.description,e[18]=S):S=e[18];let y;e[19]!==j||e[20]!==S?(y=o.jsx(Kn,{children:o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[j,S]})}),e[19]=j,e[20]=S,e[21]=y):y=e[21];let v;e[22]!==b?(v=()=>{b()},e[22]=b,e[23]=v):v=e[23];let w;e[24]!==x.formState.isDirty||e[25]!==u||e[26]!==h||e[27]!==v?(w=o.jsx(qn,{children:o.jsx(Jn,{onSave:v,onUndo:h,isDirty:x.formState.isDirty,isSaving:u})}),e[24]=x.formState.isDirty,e[25]=u,e[26]=h,e[27]=v,e[28]=w):w=e[28];let C;e[29]!==x?(C=o.jsx("div",{className:"h-full",children:o.jsx(wr,{form:x})}),e[29]=x,e[30]=C):C=e[30];let k;return e[31]!==w||e[32]!==C||e[33]!==y?(k=o.jsxs(we,{children:[y,w,C]}),e[31]=w,e[32]=C,e[33]=y,e[34]=k):k=e[34],k}function _r(t){const e=N.c(4),{itemId:n}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=yr(),e[0]=s):s=e[0];const i=s;if(!i){let l;return e[1]===Symbol.for("react.memo_cache_sentinel")?(l=o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(Bn,{title:"Prompt not found",description:"Missing connection information in the current route."})}),e[1]=l):l=e[1],l}let r;return e[2]!==n?(r=o.jsx(Dn,{children:o.jsx(_.Suspense,{fallback:null,children:o.jsx(Ir,{providerId:i,promptId:n})})}),e[2]=n,e[3]=r):r=e[3],r}const Tr=Js("relative w-full rounded-lg border px-4 py-3 text-sm flex items-start gap-3 [&>svg]:size-4 [&>svg]:flex-shrink-0 [&>svg]:mt-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-destructive/5 text-destructive border-destructive/25 [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",warning:"bg-warning/10 text-warning-foreground border-warning [&>svg]:text-current *:data-[slot=alert-description]:text-warning-foreground/90",success:"bg-success/10 text-success-foreground border-success [&>svg]:text-current *:data-[slot=alert-description]:text-success-foreground/90",info:"bg-card text-card-foreground border-border [&>svg]:text-current *:data-[slot=alert-description]:text-muted-foreground/90"}},defaultVariants:{variant:"default"}});function $r(t){const e=N.c(10);let n,s,i;e[0]!==t?({className:n,variant:i,...s}=t,e[0]=t,e[1]=n,e[2]=s,e[3]=i):(n=e[1],s=e[2],i=e[3]);let r;e[4]!==n||e[5]!==i?(r=R(Tr({variant:i}),n),e[4]=n,e[5]=i,e[6]=r):r=e[6];let l;return e[7]!==s||e[8]!==r?(l=o.jsx("div",{"data-slot":"alert",role:"alert",className:r,...s}),e[7]=s,e[8]=r,e[9]=l):l=e[9],l}function Er(t){const e=N.c(8);let n,s;e[0]!==t?({className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);let i;e[3]!==n?(i=R("line-clamp-1 min-h-4 font-medium tracking-tight",n),e[3]=n,e[4]=i):i=e[4];let r;return e[5]!==s||e[6]!==i?(r=o.jsx("div",{"data-slot":"alert-title",className:i,...s}),e[5]=s,e[6]=i,e[7]=r):r=e[7],r}function Or(t){const e=N.c(8);let n,s;e[0]!==t?({className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);let i;e[3]!==n?(i=R("text-muted-foreground leading-relaxed",n),e[3]=n,e[4]=i):i=e[4];let r;return e[5]!==s||e[6]!==i?(r=o.jsx("div",{"data-slot":"alert-description",className:i,...s}),e[5]=s,e[6]=i,e[7]=r):r=e[7],r}const Rr=t=>t.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Ar(t){const e=N.c(11),{toolName:n,connectionId:s,siblings:i,onSelectInstance:r,onBack:l}=t;let c;e[0]!==s?(c={connectionId:s},e[0]=s,e[1]=c):c=e[1];const a=Oo(c);if(!a.isAuthenticated){let f;return e[2]!==a.supportsOAuth||e[3]!==l?(f=o.jsx("div",{className:"flex h-full items-center justify-center",children:a.supportsOAuth?o.jsx(Ro,{onAuthenticate:()=>l(),buttonText:"Go back to authenticate"}):o.jsx(Ao,{hasReadme:!1})}),e[2]=a.supportsOAuth,e[3]=l,e[4]=f):f=e[4],f}const d=`${s}:${n}`;let u;return e[5]!==s||e[6]!==r||e[7]!==i||e[8]!==d||e[9]!==n?(u=o.jsx(Mr,{toolName:n,connectionId:s,siblings:i,onSelectInstance:r},d),e[5]=s,e[6]=r,e[7]=i,e[8]=d,e[9]=n,e[10]=u):u=e[10],u}function Mr({toolName:t,connectionId:e,siblings:n,onSelectInstance:s}){const{replayId:i}=Gs({strict:!1}),r=(()=>{if(!i)return null;const $=`replay-${i}`,P=sessionStorage.getItem($);if(!P)return null;sessionStorage.removeItem($);try{return JSON.parse(P)}catch{return null}})(),l=(()=>{if(!r)return null;const $={};for(const[P,H]of Object.entries(r))H!==null&&typeof H=="object"?$[P]=JSON.stringify(H,null,2):$[P]=H;return $})(),[c,a]=_.useState(l??{}),[d,u]=_.useState(r?JSON.stringify(r,null,2):"{}"),[f,m]=_.useState(null),[x,p]=_.useState(null),[h,g]=_.useState(null),[b,j]=_.useState(null),[S,y]=_.useState(!1),[v,w]=_.useState(null),{org:C}=Z(),k=ln(e),{sendMessage:I,setAppContext:E,clearAppContext:M}=zo(),[,z]=Fo(),T=`${e}:${t}`,A=ae({connectionId:e,orgId:C.id}),W=cn({client:A}),O=W.data?.tools?.find($=>$.name===t),V=xo(O?._meta),L=$=>{const P=Lo($.content);P.content.length>0&&(z(!0),I(P))},[F,Q]=_.useState("json"),[fe,ee]=_.useState(!1);V&&!fe&&(Q("ui"),ee(!0));const U=O?.inputSchema?.properties,J=U?Object.keys(U):[],B=J.length>0,G={};if(B&&O?.inputSchema?.properties)for(const $ of J)G[$]=O.inputSchema.required?.includes($)?"":void 0;const te=$=>Object.prototype.hasOwnProperty.call(c,$),de=async()=>{y(!0),j(null),m(null),p(null),g(null),w(null);const $=performance.now();try{if(!A)throw new Error("MCP client is not available");const P=B?{...G,...c}:(()=>{const je=d.trim();if(!je)return{};const le=JSON.parse(je);if(le&&typeof le=="object")return le;throw new Error("Raw JSON input must be an object.")})();B&&O?.inputSchema?.properties&&Object.entries(O.inputSchema.properties).forEach(([je,le])=>{if((le.type==="object"||le.type==="array")&&typeof P[je]=="string")try{P[je]=JSON.parse(P[je])}catch{}});const H=await A.callTool({name:t,arguments:P}),ge=H.structuredContent??H,qe=performance.now(),Ke=Math.round(qe-$);m(ge),p(H),g(P);const be=JSON.stringify(ge),rt=new TextEncoder().encode(be).length;w({duration:`${Ke}ms`,bytes:`${rt} bytes`,tokens:`~${Math.ceil(rt/4)} tokens`,cost:"$0.0000"})}catch(P){const H=P instanceof Error?P.message:String(P);j(H||"Unknown error occurred");const ge=performance.now();w({duration:`${Math.round(ge-$)}ms`})}finally{y(!1)}},ne=($,P)=>{a(H=>({...H,[$]:P}))},oe=()=>{m(null),p(null),g(null),j(null),w(null)},ue=O?.name??Rr(t),re=o.jsx(Xn,{children:o.jsxs(Qn,{children:[o.jsx(He,{children:o.jsx(pt,{asChild:!0,children:o.jsx(at,{to:"/$org/$project/mcps",params:{org:C.slug,project:dt},children:"Connections"})})}),o.jsx(xt,{}),k&&o.jsxs(o.Fragment,{children:[o.jsx(He,{children:o.jsx(pt,{asChild:!0,children:o.jsx(at,{to:"/$org/$project/mcps/$appSlug",params:{org:C.slug,project:dt,appSlug:Ze(k)},search:{tab:"tools"},children:k.title})})}),o.jsx(xt,{})]}),o.jsx(He,{children:o.jsx(Yn,{children:ue})})]})}),ie=n.length>1&&o.jsxs(Ht,{value:e,onValueChange:s,children:[o.jsx(Vt,{className:"h-8 w-auto min-w-[200px]",children:o.jsx(Ut,{})}),o.jsx(Bt,{children:n.map($=>o.jsx(Ge,{value:$.id,children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Qe,{icon:$.icon,name:$.title,size:"xs",className:"shrink-0"}),$.title]})},$.id))})]}),q=o.jsxs("div",{className:"flex flex-col p-6 gap-4 overflow-auto",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("h2",{className:"text-sm font-semibold text-foreground uppercase tracking-wide",children:"Parameters"}),O?.inputSchema?.required&&O.inputSchema.required.length>0&&o.jsxs("span",{className:"text-xs text-muted-foreground",children:[o.jsx("span",{className:"text-red-500",children:"*"})," Required"]})]}),o.jsx("div",{className:"space-y-4",children:B&&O?.inputSchema?.properties?Object.entries(O.inputSchema.properties).map(([$,P])=>o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("label",{className:"text-sm font-medium leading-none flex items-center gap-1.5",children:[$,O.inputSchema?.required?.includes($)&&o.jsx("span",{className:"text-red-500 text-xs",children:"*"})]}),o.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:P.type})]}),P.description&&o.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:P.description}),P.type==="object"||P.type==="array"?o.jsx(Ft,{className:"font-mono text-xs",value:te($)?c[$]??"":G[$]??"",onChange:H=>ne($,H.target.value),placeholder:`Enter ${$} as JSON...`,rows:3}):P.type==="boolean"?o.jsxs(Ht,{value:te($)?String(c[$]??""):"",onValueChange:H=>ne($,H==="true"),children:[o.jsx(Vt,{children:o.jsx(Ut,{placeholder:"Select true or false..."})}),o.jsxs(Bt,{children:[o.jsx(Ge,{value:"true",children:"true"}),o.jsx(Ge,{value:"false",children:"false"})]})]}):o.jsx(sn,{value:te($)?c[$]??"":G[$]??"",onChange:H=>ne($,H.target.value),placeholder:`Enter ${$}...`})]},$)):O?.inputSchema&&!B?o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),o.jsx(Ft,{className:"font-mono text-xs min-h-[120px]",value:d,onChange:$=>u($.target.value),placeholder:'e.g. { "foo": "bar" }'})]}):o.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:o.jsx("p",{className:"text-sm text-muted-foreground",children:"No parameters required"})})}),o.jsx("div",{className:"flex items-center gap-2 pt-2",children:S?o.jsxs(Y,{size:"sm",variant:"destructive",className:"h-8 gap-2",onClick:oe,children:[o.jsx(go,{className:"h-3.5 w-3.5"}),"Cancel"]}):o.jsxs(Y,{size:"sm",variant:"default",className:"h-8 gap-2",onClick:de,children:[o.jsx(rn,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})})]}),Se=o.jsxs("div",{className:"flex flex-col @3xl:h-full @3xl:overflow-hidden",children:[o.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-b border-border bg-background",children:[o.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:"Result"}),o.jsxs("div",{className:"flex items-center gap-3",children:[v&&o.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(To,{className:"h-3 w-3 text-muted-foreground"}),o.jsx("span",{className:"font-mono text-foreground",children:v.duration})]}),v.tokens&&o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(bo,{className:"h-3 w-3 text-muted-foreground"}),o.jsx("span",{className:"font-mono text-foreground",children:v.tokens})]}),v.bytes&&o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(jo,{className:"h-3 w-3 text-muted-foreground"}),o.jsx("span",{className:"font-mono text-foreground",children:v.bytes})]}),v.cost&&o.jsx("div",{className:"flex items-center gap-1.5",children:o.jsx("span",{className:"font-mono text-foreground",children:v.cost})})]}),V&&o.jsx(on,{children:o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsxs(ut,{children:[o.jsx(ft,{asChild:!0,children:o.jsx(Y,{size:"icon",variant:F==="ui"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>Q("ui"),children:o.jsx(vo,{size:14})})}),o.jsx(mt,{children:"Interactive view"})]}),o.jsxs(ut,{children:[o.jsx(ft,{asChild:!0,children:o.jsx(Y,{size:"icon",variant:F==="json"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>Q("json"),children:o.jsx(Cn,{size:14})})}),o.jsx(mt,{children:"JSON view"})]})]})})]})]}),b&&o.jsx("div",{className:"px-6 py-4 bg-background",children:o.jsx($r,{variant:"destructive",children:o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(ho,{className:"h-4 w-4"}),o.jsx(Er,{className:"mb-0",children:"Execution Failed"})]}),o.jsx(Or,{className:"text-xs text-destructive",children:b})]})})}),o.jsx("div",{className:"relative flex-1 min-h-[400px] @3xl:min-h-0 @3xl:overflow-auto bg-muted/50",children:V&&F==="ui"&&A?o.jsx(_.Suspense,{fallback:o.jsx("div",{className:"flex items-center justify-center h-48",children:o.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[o.jsx("div",{className:"size-4 border-2 border-current border-t-transparent rounded-full animate-spin"}),o.jsx("span",{className:"text-sm",children:"Loading app..."})]})}),children:o.jsx(po,{resourceURI:V,toolInfo:O?{tool:O}:void 0,toolInput:h??void 0,toolResult:x??void 0,displayMode:"fullscreen",minHeight:Nn.view.minHeight,maxHeight:Nn.view.maxHeight,client:A,onMessage:L,onUpdateModelContext:$=>E(T,$),onTeardown:()=>M(T),className:"h-full"})}):f?o.jsxs(o.Fragment,{children:[o.jsx(Ve,{code:JSON.stringify(f,null,2),language:"json",height:"100%",readOnly:!0}),o.jsx(Y,{size:"icon",variant:"ghost",className:"absolute top-4 right-4 h-8 w-8 bg-background/80 hover:bg-background border border-border shadow-sm",onClick:()=>{navigator.clipboard.writeText(JSON.stringify(f,null,2)),zn.success("Copied to clipboard")},children:o.jsx(Eo,{className:"h-3.5 w-3.5"})})]}):o.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[o.jsx(Cn,{className:"h-12 w-12 mb-3 opacity-40"}),o.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]});return o.jsx(we,{breadcrumb:re,children:o.jsxs("div",{className:"flex flex-col h-full overflow-hidden @container",children:[o.jsxs("div",{className:"flex flex-col gap-3 py-7 px-8 bg-background border-b border-border shrink-0",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx(Qe,{icon:k?.icon||null,name:k?.title||t,size:"xl",className:"shrink-0"}),o.jsx("h1",{className:"text-xl font-semibold tracking-tight text-foreground leading-none truncate",children:t}),o.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-muted/50 rounded-md h-fit shrink-0",children:[W.isSuccess?o.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):W.isLoading?o.jsx(jt,{size:10,className:"animate-spin text-yellow-500 shrink-0"}):o.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-red-500 shrink-0"}),o.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:W.isSuccess?"ready":W.isLoading?"connecting":"error"})]}),o.jsx(Do,{annotations:O?.annotations,_meta:O?._meta}),o.jsx("div",{className:"hidden @3xl:flex items-center ml-auto shrink-0",children:ie})]}),o.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:O?.description||"No description available"})]}),n.length>1&&o.jsxs("div",{className:"flex @3xl:hidden items-center gap-3 px-8 py-3 border-b border-border",children:[o.jsx("span",{className:"text-xs font-medium text-muted-foreground shrink-0",children:"Instance"}),ie]}),o.jsx("div",{className:"flex-1 overflow-auto @3xl:overflow-hidden",children:o.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-[minmax(0,2fr)_minmax(0,5fr)] @3xl:h-full @3xl:grid-rows-1",children:[o.jsx("div",{className:"@3xl:border-r border-border @3xl:overflow-auto",children:q}),Se]})})]})})}function Pr(t){const e=N.c(10),{itemId:n,siblings:s,onBack:i}=t,[r,l]=_.useState(s[0]?.id??"");let c;e[0]!==r||e[1]!==s?(c=s.find(m=>m.id===r)?.id??s[0]?.id??"",e[0]=r,e[1]=s,e[2]=c):c=e[2];const a=c;if(!ln(a||void 0)||!a){let m;return e[3]===Symbol.for("react.memo_cache_sentinel")?(m=o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[o.jsx("h3",{className:"text-lg font-semibold",children:"Connection not found"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection may have been deleted or you may not have access."})]})}),e[3]=m):m=e[3],m}let u;e[4]===Symbol.for("react.memo_cache_sentinel")?(u=o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(jt,{size:32,className:"animate-spin text-muted-foreground"})}),e[4]=u):u=e[4];let f;return e[5]!==a||e[6]!==i||e[7]!==s||e[8]!==n?(f=o.jsx(_.Suspense,{fallback:u,children:o.jsx(Ar,{toolName:n,connectionId:a,siblings:s,onSelectInstance:l,onBack:i})}),e[5]=a,e[6]=i,e[7]=s,e[8]=n,e[9]=f):f=e[9],f}const Tn=t=>{let e;const n=new Set,s=(d,u)=>{const f=typeof d=="function"?d(e):d;if(!Object.is(f,e)){const m=e;e=u??(typeof f!="object"||f===null)?f:Object.assign({},e,f),n.forEach(x=>x(e,m))}},i=()=>e,c={setState:s,getState:i,getInitialState:()=>a,subscribe:d=>(n.add(d),()=>n.delete(d))},a=e=t(s,i,c);return c},xn=(t=>t?Tn(t):Tn),Lr=t=>t;function qt(t,e=Lr){const n=X.useSyncExternalStore(t.subscribe,X.useCallback(()=>e(t.getState()),[t,e]),X.useCallback(()=>e(t.getInitialState()),[t,e]));return X.useDebugValue(n),n}const Dr=t=>{const e=xn(t),n=s=>qt(e,s);return Object.assign(n,e),n},zr=(t=>Dr);function ds(t,e){let n;try{n=t()}catch{return}return{getItem:i=>{var r;const l=a=>a===null?null:JSON.parse(a,void 0),c=(r=n.getItem(i))!=null?r:null;return c instanceof Promise?c.then(l):l(c)},setItem:(i,r)=>n.setItem(i,JSON.stringify(r,void 0)),removeItem:i=>n.removeItem(i)}}const Kt=t=>e=>{try{const n=t(e);return n instanceof Promise?n:{then(s){return Kt(s)(n)},catch(s){return this}}}catch(n){return{then(s){return this},catch(s){return Kt(s)(n)}}}},Wr=(t,e)=>(n,s,i)=>{let r={storage:ds(()=>window.localStorage),partialize:g=>g,version:0,merge:(g,b)=>({...b,...g}),...e},l=!1,c=0;const a=new Set,d=new Set;let u=r.storage;if(!u)return t((...g)=>{console.warn(`[zustand persist middleware] Unable to update item '${r.name}', the given storage is currently unavailable.`),n(...g)},s,i);const f=()=>{const g=r.partialize({...s()});return u.setItem(r.name,{state:g,version:r.version})},m=i.setState;i.setState=(g,b)=>(m(g,b),f());const x=t((...g)=>(n(...g),f()),s,i);i.getInitialState=()=>x;let p;const h=()=>{var g,b;if(!u)return;const j=++c;l=!1,a.forEach(y=>{var v;return y((v=s())!=null?v:x)});const S=((b=r.onRehydrateStorage)==null?void 0:b.call(r,(g=s())!=null?g:x))||void 0;return Kt(u.getItem.bind(u))(r.name).then(y=>{if(y)if(typeof y.version=="number"&&y.version!==r.version){if(r.migrate){const v=r.migrate(y.state,y.version);return v instanceof Promise?v.then(w=>[!0,w]):[!0,v]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,y.state];return[!1,void 0]}).then(y=>{var v;if(j!==c)return;const[w,C]=y;if(p=r.merge(C,(v=s())!=null?v:x),n(p,!0),w)return f()}).then(()=>{j===c&&(S?.(p,void 0),p=s(),l=!0,d.forEach(y=>y(p)))}).catch(y=>{j===c&&S?.(void 0,y)})};return i.persist={setOptions:g=>{r={...r,...g},g.storage&&(u=g.storage)},clearStorage:()=>{u?.removeItem(r.name)},getOptions:()=>r,rehydrate:()=>h(),hasHydrated:()=>l,onHydrate:g=>(a.add(g),()=>{a.delete(g)}),onFinishHydration:g=>(d.add(g),()=>{d.delete(g)})},r.skipHydration||h(),p||x},us=Wr,{useSyncExternalStoreWithSelector:Fr}=Xs,Hr=t=>t;function Vr(t,e=Hr,n){const s=Fr(t.subscribe,t.getState,t.getInitialState,e,n);return X.useDebugValue(s),s}const $n=t=>Symbol.iterator in t,En=t=>"entries"in t,On=(t,e)=>{const n=t instanceof Map?t:new Map(t.entries()),s=e instanceof Map?e:new Map(e.entries());if(n.size!==s.size)return!1;for(const[i,r]of n)if(!s.has(i)||!Object.is(r,s.get(i)))return!1;return!0},Ur=(t,e)=>{const n=t[Symbol.iterator](),s=e[Symbol.iterator]();let i=n.next(),r=s.next();for(;!i.done&&!r.done;){if(!Object.is(i.value,r.value))return!1;i=n.next(),r=s.next()}return!!i.done&&!!r.done};function Br(t,e){return Object.is(t,e)?!0:typeof t!="object"||t===null||typeof e!="object"||e===null||Object.getPrototypeOf(t)!==Object.getPrototypeOf(e)?!1:$n(t)&&$n(e)?En(t)&&En(e)?On(t,e):Ur(t,e):On({entries:()=>Object.entries(t)},{entries:()=>Object.entries(e)})}function qr(t,e="Output"){if(!t)return`interface ${e} {}`;function n(r){if(!r||typeof r!="object")return"unknown";const l=r.type;if(Array.isArray(l))return l.map(c=>s(c)).join(" | ");switch(l){case"string":return r.enum?r.enum.map(c=>`"${c}"`).join(" | "):"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";case"array":{const c=r.items;return c?`${n(c)}[]`:"unknown[]"}case"object":return i(r);default:return r.anyOf?r.anyOf.map(n).join(" | "):r.oneOf?r.oneOf.map(n).join(" | "):r.allOf?r.allOf.map(n).join(" & "):"unknown"}}function s(r){switch(r){case"string":return"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";default:return"unknown"}}function i(r){const l=r.properties;if(!l)return"Record<string, unknown>";const c=new Set(r.required||[]);return`{
1
+ import{bk as ce,o as qs,n as Ot,c as N,j as o,E as Dn,r as _,u as Z,t as Ks,D as R,W as Js,d as Gs,G as at,O as dt,B as Y,v as zn,bR as X,cj as Xs,ck as Qs,b3 as Ys,_ as Xt,a1 as pe,a3 as Wn,b4 as Zs,Y as Qt,b2 as eo,b5 as Fn,$ as Hn,bb as to,bc as no,a4 as Vn,bd as so,cl as Yt,cm as oo,a9 as ro,be as io,X as lo,w as co,g as Ne,cn as ao,co as uo,cp as Un}from"./index-BRbdC8tb.js";import{E as Bn}from"./empty-state-B7nlLEUe.js";import{d as Zt,u as en}from"./use-collections-Bqp5H9bu.js";import{u as ae,g as Ye,i as fo}from"./constants-2OCwh60p.js";import{F as Rt,a as mo,b as tn,d as nn}from"./form-BC654cr0.js";import{I as sn}from"./input-BOjviNKP.js";import{T as Ft}from"./textarea-DdRl57bf.js";import{a as qn,b as Kn,V as we}from"./layout-B-xxTjgY.js";import{S as Jn}from"./save-actions-qtl58c-n.js";import{M as po}from"./mcp-app-renderer-CRS3A1HB.js";import{g as xo,M as Nn}from"./types-DPAE4wXV.js";import{S as Ht,a as Vt,b as Ut,c as Bt,d as Ge}from"./select-Duo4-kjU.js";import{c as on,T as ut,a as ft,b as mt}from"./tooltip-xl3GoSVP.js";import{i as ho}from"./AlertCircle-K-Pdcic9.js";import{I as Qe,_ as go,$ as bo,a0 as jo,f as vo,a1 as So,a2 as yo,a3 as wo,a4 as No,O as Co,a5 as Gn,D as ko,a6 as Io,a7 as _o,R as At}from"./integration-icon-BxAcqR_W.js";import{s as To,i as Cn,b as $o}from"./Type01-DPCWeoOo.js";import{i as rn,c as Eo}from"./Play-3YhDYx27.js";import{i as jt}from"./Loading01-CYdiDh3l.js";import{B as Xn,a as Qn,b as He,d as pt,e as xt,c as Yn}from"./breadcrumb-BM2hSfLB.js";import{u as Oo,O as Ro,M as Ao,F as Mo,v as Po}from"./index-DSSbY8iZ.js";import{g as Ze}from"./connection-slug-Bw8dtz1U.js";import{u as ln,b as et}from"./use-connection-De5rVqrE.js";import{d as cn,b as an,a as dn}from"./use-mcp-tools-iD-VGNhw.js";import{c as Lo}from"./content-blocks-o63cs2vh.js";import{T as Do}from"./tools-list-DbIvei1P.js";import{u as zo,c as Wo}from"./context-CuNDOhoh.js";import{a as Fo}from"./index-P1BeuVDU.js";import{M as Ve}from"./monaco-editor-vJr8RDGl.js";import{E as un}from"./empty-state-unH0aOxb.js";import{n as Ho}from"./Container-DO3SbooR.js";import{b as Zn}from"./use-virtual-mcp-DxTKYWLn.js";import{b as Vo,R as kn,a as Uo}from"./resizable-DixBhzs0.js";import{B as ve}from"./badge-BbY1Vzps.js";import{S as vt}from"./spinner-Bvsf8yBr.js";import{V as Bo}from"./collection-display-button-BN69LmBz.js";import{d as qo}from"./registry-utils-BSd5ITwa.js";import{b as Ko,c as Jo,d as Go,e as Xo,a as Qo,D as Yo}from"./dialog-D46ZA88r.js";import"./index-Z-Bosamk.js";import{N as Zo,S as er,a as tr,c as nr,m as lt,P as sr,i as or,R as rr,u as ir,b as lr,d as In,E as cr}from"./index-Do980wUe.js";import{s as es}from"./Plus-V1Th1jdv.js";import{i as St}from"./Check-5J8pLufa.js";import{s as fn}from"./XClose-C-lSsuAr.js";import{D as ar,a as dr,b as ur,c as _n}from"./dropdown-menu-BJLjCuY0.js";import{T as fr,R as mr,b as pr,c as ts}from"./index-DW3Gddt1.js";import{i as xr}from"./ChevronRight-BU9wyepR.js";import{a as hr,S as gr}from"./scroll-area-COTWSYpJ.js";import"./index-DSiECZF0.js";import{i as ns}from"./X-DSEUOZBv.js";import"./useMutation-C_Uj7oOe.js";import"./label-h0Vcc2GK.js";import"./XCircle-BDF0JqjY.js";import"./use-mcp-resources-BfKeTtfq.js";import"./useQuery-C31bP6Ck.js";import"./index-BdQq_4o_.js";import"./index-CKlHjZGl.js";import"./ChevronDown-azX3X6AX.js";import"./ChevronUp-ISSymo50.js";import"./ArrowUp-CVgf-IuM.js";import"./ArrowLeft-DbjuKsKJ.js";import"./RefreshCcw01-Bk3rOtaE.js";import"./Dataflow03-DDjLJJPt.js";import"./Download01-CSi5s7rT.js";import"./List-CD8zd6Wa.js";import"./VideoRecorder-DWwuCAKx.js";import"./FolderClosed-DG1khNab.js";import"./Grid01-1OtRlqYA.js";import"./SearchMd-BvvZzTkV.js";import"./Settings01-BhEewSHV.js";import"./Trash01-DEYpLJs9.js";import"./Upload01-CVsYMTIG.js";import"./User01-B6InEsCV.js";import"./Zap-Md9DJ6rv.js";import"./constants-BwEgB5ct.js";import"./extract-connection-data-BxATAvFG.js";import"./generate-id-Dyweu44Y.js";import"./use-install-from-registry-D7V-rpJ0.js";import"./index-BbKz4tLm.js";import"./index-DhwDaiqy.js";import"./select-virtual-mcp-DmwglbWt.js";import"./popover-DWheVeA1.js";import"./use-create-virtual-mcp-CdSUPhk5.js";import"./slugify-CEUa2lfQ.js";import"./collection-search-CcVBsN85.js";import"./collection-table-wrapper-BPFLr1-v.js";import"./table-6Exocylh.js";import"./card-D1l6f7HS.js";import"./decopilot-events-Brt4gAR6.js";import"./binder-3anAL5WI.js";const ss=ce("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);const os=ce("Braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]);const mn=ce("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const pn=ce("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const br=ce("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const jr=ce("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);const vr=ce("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const rs=ce("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const is=ce("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);const ls=ce("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);const Sr=ce("OctagonAlert",[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]]);const cs=ce("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);const as=ce("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);qs({title:Ot().min(1),description:Ot().nullable(),body:Ot()});function Mt(t){for(const e of t.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function yr(){const t=window.location.pathname.split("/").filter(Boolean),e=t.findIndex(s=>s==="mcps"),n=e>=0?t[e+1]:void 0;return n?decodeURIComponent(n):void 0}function wr(t){const e=N.c(13),{form:n}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx("div",{className:"text-sm font-medium text-foreground",children:"Details"}),e[0]=s):s=e[0];let i;e[1]!==n.control?(i=o.jsxs("div",{className:"flex flex-col gap-4",children:[s,o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[o.jsx(Rt,{control:n.control,name:"title",render:kr}),o.jsx(Rt,{control:n.control,name:"description",render:Cr})]})]}),e[1]=n.control,e[2]=i):i=e[2];let r,l;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx("div",{className:"text-sm font-medium text-foreground",children:"Message"}),l=o.jsx("div",{className:"text-xs text-muted-foreground",children:"This becomes the user message in the prompt."}),e[3]=r,e[4]=l):(r=e[3],l=e[4]);let c;e[5]!==n.control?(c=o.jsxs("div",{className:"flex flex-col gap-2",children:[r,l,o.jsx(Rt,{control:n.control,name:"body",render:Nr})]}),e[5]=n.control,e[6]=c):c=e[6];let a;e[7]!==i||e[8]!==c?(a=o.jsxs("div",{className:"h-full py-6 flex flex-col max-w-3xl mx-auto w-full min-w-0 gap-8 overflow-y-auto px-4",children:[i,c]}),e[7]=i,e[8]=c,e[9]=a):a=e[9];let d;return e[10]!==n||e[11]!==a?(d=o.jsx(mo,{...n,children:a}),e[10]=n,e[11]=a,e[12]=d):d=e[12],d}function Nr(t){const{field:e}=t;return o.jsx(tn,{children:o.jsx(nn,{children:o.jsx(Ft,{...e,value:e.value??"",placeholder:"Write the prompt message…",className:"min-h-[240px] resize-none text-base leading-relaxed font-normal rounded-xl border border-border bg-muted/20 px-4 py-3 shadow-none focus-visible:ring-0"})})})}function Cr(t){const{field:e}=t;return o.jsxs(tn,{children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),o.jsx(nn,{children:o.jsx(sn,{...e,value:e.value??"",placeholder:"Add a description…",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function kr(t){const{field:e}=t;return o.jsxs(tn,{children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),o.jsx(nn,{children:o.jsx(sn,{...e,placeholder:"Untitled prompt",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Ir(t){const e=N.c(35),{providerId:n,promptId:s}=t,{org:i}=Z(),r=n||null;let l;e[0]!==i.id||e[1]!==r?(l={connectionId:r,orgId:i.id},e[0]=i.id,e[1]=r,e[2]=l):l=e[2];const c=ae(l),a=Zt(n,"PROMPT",s,c),d=en(n,"PROMPT",c),u=d.update.isPending;let f;e[3]!==a?(f=a?{title:a.title,description:a.description??null,body:Mt(a)}:void 0,e[3]=a,e[4]=f):f=e[4];let m;e[5]!==f?(m={values:f},e[5]=f,e[6]=m):m=e[6];const x=Ks(m);let p;e[7]!==x||e[8]!==a?(p=()=>{a&&x.reset({title:a.title,description:a.description??null,body:Mt(a)})},e[7]=x,e[8]=a,e[9]=p):p=e[9];const h=p;let g;e[10]!==d.update||e[11]!==x||e[12]!==s?(g=x.handleSubmit(async I=>{const E=await d.update.mutateAsync({id:s,data:{title:I.title,description:I.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:I.body}}]}});x.reset({title:E.title,description:E.description??null,body:Mt(E)})}),e[10]=d.update,e[11]=x,e[12]=s,e[13]=g):g=e[13];const b=g;if(!a){let I;return e[14]===Symbol.for("react.memo_cache_sentinel")?(I=o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(Bn,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[14]=I):I=e[14],I}let j;e[15]!==a.title?(j=o.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:a.title}),e[15]=a.title,e[16]=j):j=e[16];let S;e[17]!==a.description?(S=a.description?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),o.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:a.description})]}):null,e[17]=a.description,e[18]=S):S=e[18];let y;e[19]!==j||e[20]!==S?(y=o.jsx(Kn,{children:o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[j,S]})}),e[19]=j,e[20]=S,e[21]=y):y=e[21];let v;e[22]!==b?(v=()=>{b()},e[22]=b,e[23]=v):v=e[23];let w;e[24]!==x.formState.isDirty||e[25]!==u||e[26]!==h||e[27]!==v?(w=o.jsx(qn,{children:o.jsx(Jn,{onSave:v,onUndo:h,isDirty:x.formState.isDirty,isSaving:u})}),e[24]=x.formState.isDirty,e[25]=u,e[26]=h,e[27]=v,e[28]=w):w=e[28];let C;e[29]!==x?(C=o.jsx("div",{className:"h-full",children:o.jsx(wr,{form:x})}),e[29]=x,e[30]=C):C=e[30];let k;return e[31]!==w||e[32]!==C||e[33]!==y?(k=o.jsxs(we,{children:[y,w,C]}),e[31]=w,e[32]=C,e[33]=y,e[34]=k):k=e[34],k}function _r(t){const e=N.c(4),{itemId:n}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=yr(),e[0]=s):s=e[0];const i=s;if(!i){let l;return e[1]===Symbol.for("react.memo_cache_sentinel")?(l=o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(Bn,{title:"Prompt not found",description:"Missing connection information in the current route."})}),e[1]=l):l=e[1],l}let r;return e[2]!==n?(r=o.jsx(Dn,{children:o.jsx(_.Suspense,{fallback:null,children:o.jsx(Ir,{providerId:i,promptId:n})})}),e[2]=n,e[3]=r):r=e[3],r}const Tr=Js("relative w-full rounded-lg border px-4 py-3 text-sm flex items-start gap-3 [&>svg]:size-4 [&>svg]:flex-shrink-0 [&>svg]:mt-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-destructive/5 text-destructive border-destructive/25 [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",warning:"bg-warning/10 text-warning-foreground border-warning [&>svg]:text-current *:data-[slot=alert-description]:text-warning-foreground/90",success:"bg-success/10 text-success-foreground border-success [&>svg]:text-current *:data-[slot=alert-description]:text-success-foreground/90",info:"bg-card text-card-foreground border-border [&>svg]:text-current *:data-[slot=alert-description]:text-muted-foreground/90"}},defaultVariants:{variant:"default"}});function $r(t){const e=N.c(10);let n,s,i;e[0]!==t?({className:n,variant:i,...s}=t,e[0]=t,e[1]=n,e[2]=s,e[3]=i):(n=e[1],s=e[2],i=e[3]);let r;e[4]!==n||e[5]!==i?(r=R(Tr({variant:i}),n),e[4]=n,e[5]=i,e[6]=r):r=e[6];let l;return e[7]!==s||e[8]!==r?(l=o.jsx("div",{"data-slot":"alert",role:"alert",className:r,...s}),e[7]=s,e[8]=r,e[9]=l):l=e[9],l}function Er(t){const e=N.c(8);let n,s;e[0]!==t?({className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);let i;e[3]!==n?(i=R("line-clamp-1 min-h-4 font-medium tracking-tight",n),e[3]=n,e[4]=i):i=e[4];let r;return e[5]!==s||e[6]!==i?(r=o.jsx("div",{"data-slot":"alert-title",className:i,...s}),e[5]=s,e[6]=i,e[7]=r):r=e[7],r}function Or(t){const e=N.c(8);let n,s;e[0]!==t?({className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);let i;e[3]!==n?(i=R("text-muted-foreground leading-relaxed",n),e[3]=n,e[4]=i):i=e[4];let r;return e[5]!==s||e[6]!==i?(r=o.jsx("div",{"data-slot":"alert-description",className:i,...s}),e[5]=s,e[6]=i,e[7]=r):r=e[7],r}const Rr=t=>t.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Ar(t){const e=N.c(11),{toolName:n,connectionId:s,siblings:i,onSelectInstance:r,onBack:l}=t;let c;e[0]!==s?(c={connectionId:s},e[0]=s,e[1]=c):c=e[1];const a=Oo(c);if(!a.isAuthenticated){let f;return e[2]!==a.supportsOAuth||e[3]!==l?(f=o.jsx("div",{className:"flex h-full items-center justify-center",children:a.supportsOAuth?o.jsx(Ro,{onAuthenticate:()=>l(),buttonText:"Go back to authenticate"}):o.jsx(Ao,{hasReadme:!1})}),e[2]=a.supportsOAuth,e[3]=l,e[4]=f):f=e[4],f}const d=`${s}:${n}`;let u;return e[5]!==s||e[6]!==r||e[7]!==i||e[8]!==d||e[9]!==n?(u=o.jsx(Mr,{toolName:n,connectionId:s,siblings:i,onSelectInstance:r},d),e[5]=s,e[6]=r,e[7]=i,e[8]=d,e[9]=n,e[10]=u):u=e[10],u}function Mr({toolName:t,connectionId:e,siblings:n,onSelectInstance:s}){const{replayId:i}=Gs({strict:!1}),r=(()=>{if(!i)return null;const $=`replay-${i}`,P=sessionStorage.getItem($);if(!P)return null;sessionStorage.removeItem($);try{return JSON.parse(P)}catch{return null}})(),l=(()=>{if(!r)return null;const $={};for(const[P,H]of Object.entries(r))H!==null&&typeof H=="object"?$[P]=JSON.stringify(H,null,2):$[P]=H;return $})(),[c,a]=_.useState(l??{}),[d,u]=_.useState(r?JSON.stringify(r,null,2):"{}"),[f,m]=_.useState(null),[x,p]=_.useState(null),[h,g]=_.useState(null),[b,j]=_.useState(null),[S,y]=_.useState(!1),[v,w]=_.useState(null),{org:C}=Z(),k=ln(e),{sendMessage:I,setAppContext:E,clearAppContext:M}=zo(),[,z]=Fo(),T=`${e}:${t}`,A=ae({connectionId:e,orgId:C.id}),W=cn({client:A}),O=W.data?.tools?.find($=>$.name===t),V=xo(O?._meta),L=$=>{const P=Lo($.content);P.content.length>0&&(z(!0),I(P))},[F,Q]=_.useState("json"),[fe,ee]=_.useState(!1);V&&!fe&&(Q("ui"),ee(!0));const U=O?.inputSchema?.properties,J=U?Object.keys(U):[],B=J.length>0,G={};if(B&&O?.inputSchema?.properties)for(const $ of J)G[$]=O.inputSchema.required?.includes($)?"":void 0;const te=$=>Object.prototype.hasOwnProperty.call(c,$),de=async()=>{y(!0),j(null),m(null),p(null),g(null),w(null);const $=performance.now();try{if(!A)throw new Error("MCP client is not available");const P=B?{...G,...c}:(()=>{const je=d.trim();if(!je)return{};const le=JSON.parse(je);if(le&&typeof le=="object")return le;throw new Error("Raw JSON input must be an object.")})();B&&O?.inputSchema?.properties&&Object.entries(O.inputSchema.properties).forEach(([je,le])=>{if((le.type==="object"||le.type==="array")&&typeof P[je]=="string")try{P[je]=JSON.parse(P[je])}catch{}});const H=await A.callTool({name:t,arguments:P}),ge=H.structuredContent??H,qe=performance.now(),Ke=Math.round(qe-$);m(ge),p(H),g(P);const be=JSON.stringify(ge),rt=new TextEncoder().encode(be).length;w({duration:`${Ke}ms`,bytes:`${rt} bytes`,tokens:`~${Math.ceil(rt/4)} tokens`,cost:"$0.0000"})}catch(P){const H=P instanceof Error?P.message:String(P);j(H||"Unknown error occurred");const ge=performance.now();w({duration:`${Math.round(ge-$)}ms`})}finally{y(!1)}},ne=($,P)=>{a(H=>({...H,[$]:P}))},oe=()=>{m(null),p(null),g(null),j(null),w(null)},ue=O?.name??Rr(t),re=o.jsx(Xn,{children:o.jsxs(Qn,{children:[o.jsx(He,{children:o.jsx(pt,{asChild:!0,children:o.jsx(at,{to:"/$org/$project/mcps",params:{org:C.slug,project:dt},children:"Connections"})})}),o.jsx(xt,{}),k&&o.jsxs(o.Fragment,{children:[o.jsx(He,{children:o.jsx(pt,{asChild:!0,children:o.jsx(at,{to:"/$org/$project/mcps/$appSlug",params:{org:C.slug,project:dt,appSlug:Ze(k)},search:{tab:"tools"},children:k.title})})}),o.jsx(xt,{})]}),o.jsx(He,{children:o.jsx(Yn,{children:ue})})]})}),ie=n.length>1&&o.jsxs(Ht,{value:e,onValueChange:s,children:[o.jsx(Vt,{className:"h-8 w-auto min-w-[200px]",children:o.jsx(Ut,{})}),o.jsx(Bt,{children:n.map($=>o.jsx(Ge,{value:$.id,children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Qe,{icon:$.icon,name:$.title,size:"xs",className:"shrink-0"}),$.title]})},$.id))})]}),q=o.jsxs("div",{className:"flex flex-col p-6 gap-4 overflow-auto",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("h2",{className:"text-sm font-semibold text-foreground uppercase tracking-wide",children:"Parameters"}),O?.inputSchema?.required&&O.inputSchema.required.length>0&&o.jsxs("span",{className:"text-xs text-muted-foreground",children:[o.jsx("span",{className:"text-red-500",children:"*"})," Required"]})]}),o.jsx("div",{className:"space-y-4",children:B&&O?.inputSchema?.properties?Object.entries(O.inputSchema.properties).map(([$,P])=>o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("label",{className:"text-sm font-medium leading-none flex items-center gap-1.5",children:[$,O.inputSchema?.required?.includes($)&&o.jsx("span",{className:"text-red-500 text-xs",children:"*"})]}),o.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:P.type})]}),P.description&&o.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:P.description}),P.type==="object"||P.type==="array"?o.jsx(Ft,{className:"font-mono text-xs",value:te($)?c[$]??"":G[$]??"",onChange:H=>ne($,H.target.value),placeholder:`Enter ${$} as JSON...`,rows:3}):P.type==="boolean"?o.jsxs(Ht,{value:te($)?String(c[$]??""):"",onValueChange:H=>ne($,H==="true"),children:[o.jsx(Vt,{children:o.jsx(Ut,{placeholder:"Select true or false..."})}),o.jsxs(Bt,{children:[o.jsx(Ge,{value:"true",children:"true"}),o.jsx(Ge,{value:"false",children:"false"})]})]}):o.jsx(sn,{value:te($)?c[$]??"":G[$]??"",onChange:H=>ne($,H.target.value),placeholder:`Enter ${$}...`})]},$)):O?.inputSchema&&!B?o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),o.jsx(Ft,{className:"font-mono text-xs min-h-[120px]",value:d,onChange:$=>u($.target.value),placeholder:'e.g. { "foo": "bar" }'})]}):o.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:o.jsx("p",{className:"text-sm text-muted-foreground",children:"No parameters required"})})}),o.jsx("div",{className:"flex items-center gap-2 pt-2",children:S?o.jsxs(Y,{size:"sm",variant:"destructive",className:"h-8 gap-2",onClick:oe,children:[o.jsx(go,{className:"h-3.5 w-3.5"}),"Cancel"]}):o.jsxs(Y,{size:"sm",variant:"default",className:"h-8 gap-2",onClick:de,children:[o.jsx(rn,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})})]}),Se=o.jsxs("div",{className:"flex flex-col @3xl:h-full @3xl:overflow-hidden",children:[o.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-b border-border bg-background",children:[o.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:"Result"}),o.jsxs("div",{className:"flex items-center gap-3",children:[v&&o.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(To,{className:"h-3 w-3 text-muted-foreground"}),o.jsx("span",{className:"font-mono text-foreground",children:v.duration})]}),v.tokens&&o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(bo,{className:"h-3 w-3 text-muted-foreground"}),o.jsx("span",{className:"font-mono text-foreground",children:v.tokens})]}),v.bytes&&o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(jo,{className:"h-3 w-3 text-muted-foreground"}),o.jsx("span",{className:"font-mono text-foreground",children:v.bytes})]}),v.cost&&o.jsx("div",{className:"flex items-center gap-1.5",children:o.jsx("span",{className:"font-mono text-foreground",children:v.cost})})]}),V&&o.jsx(on,{children:o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsxs(ut,{children:[o.jsx(ft,{asChild:!0,children:o.jsx(Y,{size:"icon",variant:F==="ui"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>Q("ui"),children:o.jsx(vo,{size:14})})}),o.jsx(mt,{children:"Interactive view"})]}),o.jsxs(ut,{children:[o.jsx(ft,{asChild:!0,children:o.jsx(Y,{size:"icon",variant:F==="json"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>Q("json"),children:o.jsx(Cn,{size:14})})}),o.jsx(mt,{children:"JSON view"})]})]})})]})]}),b&&o.jsx("div",{className:"px-6 py-4 bg-background",children:o.jsx($r,{variant:"destructive",children:o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(ho,{className:"h-4 w-4"}),o.jsx(Er,{className:"mb-0",children:"Execution Failed"})]}),o.jsx(Or,{className:"text-xs text-destructive",children:b})]})})}),o.jsx("div",{className:"relative flex-1 min-h-[400px] @3xl:min-h-0 @3xl:overflow-auto bg-muted/50",children:V&&F==="ui"&&A?o.jsx(_.Suspense,{fallback:o.jsx("div",{className:"flex items-center justify-center h-48",children:o.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[o.jsx("div",{className:"size-4 border-2 border-current border-t-transparent rounded-full animate-spin"}),o.jsx("span",{className:"text-sm",children:"Loading app..."})]})}),children:o.jsx(po,{resourceURI:V,toolInfo:O?{tool:O}:void 0,toolInput:h??void 0,toolResult:x??void 0,displayMode:"fullscreen",minHeight:Nn.view.minHeight,maxHeight:Nn.view.maxHeight,client:A,onMessage:L,onUpdateModelContext:$=>E(T,$),onTeardown:()=>M(T),className:"h-full"})}):f?o.jsxs(o.Fragment,{children:[o.jsx(Ve,{code:JSON.stringify(f,null,2),language:"json",height:"100%",readOnly:!0}),o.jsx(Y,{size:"icon",variant:"ghost",className:"absolute top-4 right-4 h-8 w-8 bg-background/80 hover:bg-background border border-border shadow-sm",onClick:()=>{navigator.clipboard.writeText(JSON.stringify(f,null,2)),zn.success("Copied to clipboard")},children:o.jsx(Eo,{className:"h-3.5 w-3.5"})})]}):o.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[o.jsx(Cn,{className:"h-12 w-12 mb-3 opacity-40"}),o.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]});return o.jsx(we,{breadcrumb:re,children:o.jsxs("div",{className:"flex flex-col h-full overflow-hidden @container",children:[o.jsxs("div",{className:"flex flex-col gap-3 py-7 px-8 bg-background border-b border-border shrink-0",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx(Qe,{icon:k?.icon||null,name:k?.title||t,size:"xl",className:"shrink-0"}),o.jsx("h1",{className:"text-xl font-semibold tracking-tight text-foreground leading-none truncate",children:t}),o.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-muted/50 rounded-md h-fit shrink-0",children:[W.isSuccess?o.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):W.isLoading?o.jsx(jt,{size:10,className:"animate-spin text-yellow-500 shrink-0"}):o.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-red-500 shrink-0"}),o.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:W.isSuccess?"ready":W.isLoading?"connecting":"error"})]}),o.jsx(Do,{annotations:O?.annotations,_meta:O?._meta}),o.jsx("div",{className:"hidden @3xl:flex items-center ml-auto shrink-0",children:ie})]}),o.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:O?.description||"No description available"})]}),n.length>1&&o.jsxs("div",{className:"flex @3xl:hidden items-center gap-3 px-8 py-3 border-b border-border",children:[o.jsx("span",{className:"text-xs font-medium text-muted-foreground shrink-0",children:"Instance"}),ie]}),o.jsx("div",{className:"flex-1 overflow-auto @3xl:overflow-hidden",children:o.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-[minmax(0,2fr)_minmax(0,5fr)] @3xl:h-full @3xl:grid-rows-1",children:[o.jsx("div",{className:"@3xl:border-r border-border @3xl:overflow-auto",children:q}),Se]})})]})})}function Pr(t){const e=N.c(10),{itemId:n,siblings:s,onBack:i}=t,[r,l]=_.useState(s[0]?.id??"");let c;e[0]!==r||e[1]!==s?(c=s.find(m=>m.id===r)?.id??s[0]?.id??"",e[0]=r,e[1]=s,e[2]=c):c=e[2];const a=c;if(!ln(a||void 0)||!a){let m;return e[3]===Symbol.for("react.memo_cache_sentinel")?(m=o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[o.jsx("h3",{className:"text-lg font-semibold",children:"Connection not found"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection may have been deleted or you may not have access."})]})}),e[3]=m):m=e[3],m}let u;e[4]===Symbol.for("react.memo_cache_sentinel")?(u=o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(jt,{size:32,className:"animate-spin text-muted-foreground"})}),e[4]=u):u=e[4];let f;return e[5]!==a||e[6]!==i||e[7]!==s||e[8]!==n?(f=o.jsx(_.Suspense,{fallback:u,children:o.jsx(Ar,{toolName:n,connectionId:a,siblings:s,onSelectInstance:l,onBack:i})}),e[5]=a,e[6]=i,e[7]=s,e[8]=n,e[9]=f):f=e[9],f}const Tn=t=>{let e;const n=new Set,s=(d,u)=>{const f=typeof d=="function"?d(e):d;if(!Object.is(f,e)){const m=e;e=u??(typeof f!="object"||f===null)?f:Object.assign({},e,f),n.forEach(x=>x(e,m))}},i=()=>e,c={setState:s,getState:i,getInitialState:()=>a,subscribe:d=>(n.add(d),()=>n.delete(d))},a=e=t(s,i,c);return c},xn=(t=>t?Tn(t):Tn),Lr=t=>t;function qt(t,e=Lr){const n=X.useSyncExternalStore(t.subscribe,X.useCallback(()=>e(t.getState()),[t,e]),X.useCallback(()=>e(t.getInitialState()),[t,e]));return X.useDebugValue(n),n}const Dr=t=>{const e=xn(t),n=s=>qt(e,s);return Object.assign(n,e),n},zr=(t=>Dr);function ds(t,e){let n;try{n=t()}catch{return}return{getItem:i=>{var r;const l=a=>a===null?null:JSON.parse(a,void 0),c=(r=n.getItem(i))!=null?r:null;return c instanceof Promise?c.then(l):l(c)},setItem:(i,r)=>n.setItem(i,JSON.stringify(r,void 0)),removeItem:i=>n.removeItem(i)}}const Kt=t=>e=>{try{const n=t(e);return n instanceof Promise?n:{then(s){return Kt(s)(n)},catch(s){return this}}}catch(n){return{then(s){return this},catch(s){return Kt(s)(n)}}}},Wr=(t,e)=>(n,s,i)=>{let r={storage:ds(()=>window.localStorage),partialize:g=>g,version:0,merge:(g,b)=>({...b,...g}),...e},l=!1,c=0;const a=new Set,d=new Set;let u=r.storage;if(!u)return t((...g)=>{console.warn(`[zustand persist middleware] Unable to update item '${r.name}', the given storage is currently unavailable.`),n(...g)},s,i);const f=()=>{const g=r.partialize({...s()});return u.setItem(r.name,{state:g,version:r.version})},m=i.setState;i.setState=(g,b)=>(m(g,b),f());const x=t((...g)=>(n(...g),f()),s,i);i.getInitialState=()=>x;let p;const h=()=>{var g,b;if(!u)return;const j=++c;l=!1,a.forEach(y=>{var v;return y((v=s())!=null?v:x)});const S=((b=r.onRehydrateStorage)==null?void 0:b.call(r,(g=s())!=null?g:x))||void 0;return Kt(u.getItem.bind(u))(r.name).then(y=>{if(y)if(typeof y.version=="number"&&y.version!==r.version){if(r.migrate){const v=r.migrate(y.state,y.version);return v instanceof Promise?v.then(w=>[!0,w]):[!0,v]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,y.state];return[!1,void 0]}).then(y=>{var v;if(j!==c)return;const[w,C]=y;if(p=r.merge(C,(v=s())!=null?v:x),n(p,!0),w)return f()}).then(()=>{j===c&&(S?.(p,void 0),p=s(),l=!0,d.forEach(y=>y(p)))}).catch(y=>{j===c&&S?.(void 0,y)})};return i.persist={setOptions:g=>{r={...r,...g},g.storage&&(u=g.storage)},clearStorage:()=>{u?.removeItem(r.name)},getOptions:()=>r,rehydrate:()=>h(),hasHydrated:()=>l,onHydrate:g=>(a.add(g),()=>{a.delete(g)}),onFinishHydration:g=>(d.add(g),()=>{d.delete(g)})},r.skipHydration||h(),p||x},us=Wr,{useSyncExternalStoreWithSelector:Fr}=Xs,Hr=t=>t;function Vr(t,e=Hr,n){const s=Fr(t.subscribe,t.getState,t.getInitialState,e,n);return X.useDebugValue(s),s}const $n=t=>Symbol.iterator in t,En=t=>"entries"in t,On=(t,e)=>{const n=t instanceof Map?t:new Map(t.entries()),s=e instanceof Map?e:new Map(e.entries());if(n.size!==s.size)return!1;for(const[i,r]of n)if(!s.has(i)||!Object.is(r,s.get(i)))return!1;return!0},Ur=(t,e)=>{const n=t[Symbol.iterator](),s=e[Symbol.iterator]();let i=n.next(),r=s.next();for(;!i.done&&!r.done;){if(!Object.is(i.value,r.value))return!1;i=n.next(),r=s.next()}return!!i.done&&!!r.done};function Br(t,e){return Object.is(t,e)?!0:typeof t!="object"||t===null||typeof e!="object"||e===null||Object.getPrototypeOf(t)!==Object.getPrototypeOf(e)?!1:$n(t)&&$n(e)?En(t)&&En(e)?On(t,e):Ur(t,e):On({entries:()=>Object.entries(t)},{entries:()=>Object.entries(e)})}function qr(t,e="Output"){if(!t)return`interface ${e} {}`;function n(r){if(!r||typeof r!="object")return"unknown";const l=r.type;if(Array.isArray(l))return l.map(c=>s(c)).join(" | ");switch(l){case"string":return r.enum?r.enum.map(c=>`"${c}"`).join(" | "):"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";case"array":{const c=r.items;return c?`${n(c)}[]`:"unknown[]"}case"object":return i(r);default:return r.anyOf?r.anyOf.map(n).join(" | "):r.oneOf?r.oneOf.map(n).join(" | "):r.allOf?r.allOf.map(n).join(" & "):"unknown"}}function s(r){switch(r){case"string":return"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";default:return"unknown"}}function i(r){const l=r.properties;if(!l)return"Record<string, unknown>";const c=new Set(r.required||[]);return`{
2
2
  ${Object.entries(l).map(([d,u])=>{const f=c.has(d)?"":"?";return`${u.description?` /** ${u.description} */
3
3
  `:""} ${d}${f}: ${n(u)};`}).join(`
4
4
  `)}
@@ -1 +1 @@
1
- import{c as U,r as F,D as b,j as s,B as te}from"./index-DLW7tZdu.js";import{c as X,a as se,b as le,D as oe}from"./dropdown-menu-BtgYu0Kc.js";import{i as ie,n as ne}from"./ArrowUp-FfROzAyV.js";import{i as Y}from"./Check-BXqqUm0J.js";import{c as re}from"./Grid01-Bwsn0nh2.js";import{i as ae}from"./List-Bq1Yvo6z.js";import{m as ce}from"./integration-icon-C-I4Z6Dk.js";import{a as de,b as ue,c as fe,T as xe}from"./tooltip-D-QYbPJS.js";import{B as me}from"./badge-C2jHxnoS.js";const pe={sm:{button:"size-7",icon:"size-4"},md:{button:"size-9",icon:"size-5"},lg:{button:"size-12",icon:"size-6"}};function he(r){const e=U.c(66),{value:l,onValueChange:a,options:t,size:w,fullWidth:z,className:j}=r,D=w===void 0?"sm":w,x=z===void 0?!1:z,C=F.useRef(null),k=F.useRef(null);let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c={left:0,width:0,opacity:0},e[0]=c):c=e[0];const[m,S]=F.useState(c);let g;e[1]===Symbol.for("react.memo_cache_sentinel")?(g=A=>{if(!A.current)return;const{offsetLeft:Z,offsetWidth:ee}=A.current;S({left:Z,width:ee,opacity:1})},e[1]=g):g=e[1];const N=g;let d;e[2]!==t[0].value||e[3]!==l?(d=()=>{const A=l===t[0].value?C:k;N(A)},e[2]=t[0].value,e[3]=l,e[4]=d):d=e[4];let v;e[5]!==t||e[6]!==l?(v=[l,t],e[5]=t,e[6]=l,e[7]=v):v=e[7],F.useEffect(d,v);const o=pe[D];let i;e[8]!==j?(i=b("relative flex gap-0 bg-muted rounded-lg",j),e[8]=j,e[9]=i):i=e[9];let n;e[10]!==a||e[11]!==t[0].value?(n=()=>a(t[0].value),e[10]=a,e[11]=t[0].value,e[12]=n):n=e[12];const p=x?"flex-1 h-12 px-4":o.button,h=!x&&t[0].label?"px-3":"";let u;e[13]!==h||e[14]!==p?(u=b("relative z-10 flex items-center justify-center gap-2 rounded-lg transition-colors [transition-timing-function:var(--ease-out-cubic)] duration-200",p,h),e[13]=h,e[14]=p,e[15]=u):u=e[15];const y=l===t[0].value?"text-foreground":"text-muted-foreground";let f;e[16]!==o.icon||e[17]!==y?(f=b("transition-colors ease-out duration-200 flex items-center justify-center [&>svg]:size-[1em]",o.icon,y),e[16]=o.icon,e[17]=y,e[18]=f):f=e[18];let _;e[19]!==t[0].icon||e[20]!==f?(_=s.jsx("span",{className:f,children:t[0].icon}),e[19]=t[0].icon,e[20]=f,e[21]=_):_=e[21];let T;e[22]!==t[0].label||e[23]!==t[0].value||e[24]!==l?(T=t[0].label&&s.jsx("span",{className:b("text-xs transition-colors ease-out duration-200 whitespace-nowrap",l===t[0].value?"text-foreground":"text-muted-foreground"),children:t[0].label}),e[22]=t[0].label,e[23]=t[0].value,e[24]=l,e[25]=T):T=e[25];let M;e[26]!==u||e[27]!==_||e[28]!==T||e[29]!==n?(M=s.jsxs("button",{ref:C,type:"button",onClick:n,className:u,children:[_,T]}),e[26]=u,e[27]=_,e[28]=T,e[29]=n,e[30]=M):M=e[30];let $;e[31]!==a||e[32]!==t[1].value?($=()=>a(t[1].value),e[31]=a,e[32]=t[1].value,e[33]=$):$=e[33];const K=x?"flex-1 h-12 px-4":o.button,q=!x&&t[1].label?"px-3":"";let R;e[34]!==K||e[35]!==q?(R=b("relative z-10 flex items-center justify-center gap-2 rounded-lg transition-colors [transition-timing-function:var(--ease-out-cubic)] duration-200",K,q),e[34]=K,e[35]=q,e[36]=R):R=e[36];const G=l===t[1].value?"text-foreground":"text-muted-foreground";let B;e[37]!==o.icon||e[38]!==G?(B=b("transition-colors ease-out duration-200 flex items-center justify-center [&>svg]:size-[1em]",o.icon,G),e[37]=o.icon,e[38]=G,e[39]=B):B=e[39];let V;e[40]!==t[1].icon||e[41]!==B?(V=s.jsx("span",{className:B,children:t[1].icon}),e[40]=t[1].icon,e[41]=B,e[42]=V):V=e[42];let E;e[43]!==t[1].label||e[44]!==t[1].value||e[45]!==l?(E=t[1].label&&s.jsx("span",{className:b("text-xs transition-colors ease-out duration-200 whitespace-nowrap",l===t[1].value?"text-foreground":"text-muted-foreground"),children:t[1].label}),e[43]=t[1].label,e[44]=t[1].value,e[45]=l,e[46]=E):E=e[46];let W;e[47]!==$||e[48]!==R||e[49]!==V||e[50]!==E?(W=s.jsxs("button",{ref:k,type:"button",onClick:$,className:R,children:[V,E]}),e[47]=$,e[48]=R,e[49]=V,e[50]=E,e[51]=W):W=e[51];const H=x?"h-12":o.button;let I;e[52]!==H?(I=b("absolute z-0 bg-background rounded-lg border-shadow transition-all [transition-timing-function:var(--ease-out-cubic)] duration-200",H),e[52]=H,e[53]=I):I=e[53];const J=`${m.left}px`,Q=`${m.width}px`;let L;e[54]!==m.opacity||e[55]!==J||e[56]!==Q?(L={left:J,width:Q,opacity:m.opacity},e[54]=m.opacity,e[55]=J,e[56]=Q,e[57]=L):L=e[57];let P;e[58]!==I||e[59]!==L?(P=s.jsx("div",{className:I,style:L}),e[58]=I,e[59]=L,e[60]=P):P=e[60];let O;return e[61]!==M||e[62]!==W||e[63]!==P||e[64]!==i?(O=s.jsxs("div",{className:i,children:[M,W,P]}),e[61]=M,e[62]=W,e[63]=P,e[64]=i,e[65]=O):O=e[65],O}function Se(r){const e=U.c(31),{viewMode:l,onViewModeChange:a,sortKey:t,sortDirection:w,onSort:z,sortOptions:j,filters:D}=r;let x;e[0]!==j?(x=j===void 0?[]:j,e[0]=j,e[1]=x):x=e[1];const C=x;let k;e[2]!==D?(k=D===void 0?[]:D,e[2]=D,e[3]=k):k=e[3];const c=k;let m;e[4]!==c?(m=c.filter(ge),e[4]=c,e[5]=m):m=e[5];const S=m.length;let g;e[6]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(ce,{size:16}),e[6]=g):g=e[6];let N;e[7]!==S?(N=S>0&&s.jsx(me,{variant:"default",className:"absolute -top-1.5 -right-1.5 h-4 min-w-4 px-1 text-[10px] leading-none",children:S}),e[7]=S,e[8]=N):N=e[8];let d;e[9]!==N?(d=s.jsx(de,{asChild:!0,children:s.jsx(se,{asChild:!0,children:s.jsxs(te,{variant:"outline",size:"icon",className:"size-7 border border-input relative",children:[g,N]})})}),e[9]=N,e[10]=d):d=e[10];let v;e[11]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(ue,{children:"Display & filters"}),e[11]=v):v=e[11];let o;e[12]!==d?(o=s.jsx(fe,{children:s.jsxs(xe,{children:[d,v]})}),e[12]=d,e[13]=o):o=e[13];let i;e[14]!==a||e[15]!==l?(i=a&&l&&s.jsx("div",{className:"p-2 border-b border-border",children:s.jsx(he,{value:l,onValueChange:a,fullWidth:!0,options:[{value:"table",icon:s.jsx(ae,{})},{value:"cards",icon:s.jsx(re,{})}]})}),e[14]=a,e[15]=l,e[16]=i):i=e[16];let n;e[17]!==z||e[18]!==w||e[19]!==t||e[20]!==C?(n=C.length>0&&z&&s.jsxs("div",{className:"p-1 flex flex-col gap-0.5 border-b border-border",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Sort by"}),C.map(y=>{const f=t===y.id;return s.jsx(X,{onClick:()=>z(y.id),className:b("h-8 px-2 py-0 cursor-pointer",f&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[f&&s.jsx(Y,{size:16,className:"text-foreground shrink-0"}),!f&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:y.label}),f&&w&&(w==="asc"?s.jsx(ie,{size:16,className:"text-foreground shrink-0"}):s.jsx(ne,{size:16,className:"text-foreground shrink-0"}))]})},y.id)})]}),e[17]=z,e[18]=w,e[19]=t,e[20]=C,e[21]=n):n=e[21];let p;e[22]!==c?(p=c.map(be),e[22]=c,e[23]=p):p=e[23];let h;e[24]!==i||e[25]!==n||e[26]!==p?(h=s.jsxs(le,{align:"end",className:"w-[200px] p-0 gap-0",children:[i,n,p]}),e[24]=i,e[25]=n,e[26]=p,e[27]=h):h=e[27];let u;return e[28]!==o||e[29]!==h?(u=s.jsxs(oe,{children:[o,h]}),e[28]=o,e[29]=h,e[30]=u):u=e[30],u}function be(r){return s.jsxs("div",{className:"p-1 flex flex-col gap-0.5 border-b border-border last:border-b-0",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:r.label}),r.options.map(e=>{const l=r.value===e.id;return s.jsx(X,{onClick:()=>r.onChange(e.id),className:b("h-8 px-2 py-0 cursor-pointer",l&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[l&&s.jsx(Y,{size:16,className:"text-foreground shrink-0"}),!l&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:e.label})]})},e.id)})]},r.label)}function ge(r){return r.value!=="ALL"}export{Se as C,he as V};
1
+ import{c as U,r as F,D as b,j as s,B as te}from"./index-BRbdC8tb.js";import{c as X,a as se,b as le,D as oe}from"./dropdown-menu-BJLjCuY0.js";import{i as ie,n as ne}from"./ArrowUp-CVgf-IuM.js";import{i as Y}from"./Check-5J8pLufa.js";import{c as re}from"./Grid01-1OtRlqYA.js";import{i as ae}from"./List-CD8zd6Wa.js";import{m as ce}from"./integration-icon-BxAcqR_W.js";import{a as de,b as ue,c as fe,T as xe}from"./tooltip-xl3GoSVP.js";import{B as me}from"./badge-BbY1Vzps.js";const pe={sm:{button:"size-7",icon:"size-4"},md:{button:"size-9",icon:"size-5"},lg:{button:"size-12",icon:"size-6"}};function he(r){const e=U.c(66),{value:l,onValueChange:a,options:t,size:w,fullWidth:z,className:j}=r,D=w===void 0?"sm":w,x=z===void 0?!1:z,C=F.useRef(null),k=F.useRef(null);let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c={left:0,width:0,opacity:0},e[0]=c):c=e[0];const[m,S]=F.useState(c);let g;e[1]===Symbol.for("react.memo_cache_sentinel")?(g=A=>{if(!A.current)return;const{offsetLeft:Z,offsetWidth:ee}=A.current;S({left:Z,width:ee,opacity:1})},e[1]=g):g=e[1];const N=g;let d;e[2]!==t[0].value||e[3]!==l?(d=()=>{const A=l===t[0].value?C:k;N(A)},e[2]=t[0].value,e[3]=l,e[4]=d):d=e[4];let v;e[5]!==t||e[6]!==l?(v=[l,t],e[5]=t,e[6]=l,e[7]=v):v=e[7],F.useEffect(d,v);const o=pe[D];let i;e[8]!==j?(i=b("relative flex gap-0 bg-muted rounded-lg",j),e[8]=j,e[9]=i):i=e[9];let n;e[10]!==a||e[11]!==t[0].value?(n=()=>a(t[0].value),e[10]=a,e[11]=t[0].value,e[12]=n):n=e[12];const p=x?"flex-1 h-12 px-4":o.button,h=!x&&t[0].label?"px-3":"";let u;e[13]!==h||e[14]!==p?(u=b("relative z-10 flex items-center justify-center gap-2 rounded-lg transition-colors [transition-timing-function:var(--ease-out-cubic)] duration-200",p,h),e[13]=h,e[14]=p,e[15]=u):u=e[15];const y=l===t[0].value?"text-foreground":"text-muted-foreground";let f;e[16]!==o.icon||e[17]!==y?(f=b("transition-colors ease-out duration-200 flex items-center justify-center [&>svg]:size-[1em]",o.icon,y),e[16]=o.icon,e[17]=y,e[18]=f):f=e[18];let _;e[19]!==t[0].icon||e[20]!==f?(_=s.jsx("span",{className:f,children:t[0].icon}),e[19]=t[0].icon,e[20]=f,e[21]=_):_=e[21];let T;e[22]!==t[0].label||e[23]!==t[0].value||e[24]!==l?(T=t[0].label&&s.jsx("span",{className:b("text-xs transition-colors ease-out duration-200 whitespace-nowrap",l===t[0].value?"text-foreground":"text-muted-foreground"),children:t[0].label}),e[22]=t[0].label,e[23]=t[0].value,e[24]=l,e[25]=T):T=e[25];let M;e[26]!==u||e[27]!==_||e[28]!==T||e[29]!==n?(M=s.jsxs("button",{ref:C,type:"button",onClick:n,className:u,children:[_,T]}),e[26]=u,e[27]=_,e[28]=T,e[29]=n,e[30]=M):M=e[30];let $;e[31]!==a||e[32]!==t[1].value?($=()=>a(t[1].value),e[31]=a,e[32]=t[1].value,e[33]=$):$=e[33];const K=x?"flex-1 h-12 px-4":o.button,q=!x&&t[1].label?"px-3":"";let R;e[34]!==K||e[35]!==q?(R=b("relative z-10 flex items-center justify-center gap-2 rounded-lg transition-colors [transition-timing-function:var(--ease-out-cubic)] duration-200",K,q),e[34]=K,e[35]=q,e[36]=R):R=e[36];const G=l===t[1].value?"text-foreground":"text-muted-foreground";let B;e[37]!==o.icon||e[38]!==G?(B=b("transition-colors ease-out duration-200 flex items-center justify-center [&>svg]:size-[1em]",o.icon,G),e[37]=o.icon,e[38]=G,e[39]=B):B=e[39];let V;e[40]!==t[1].icon||e[41]!==B?(V=s.jsx("span",{className:B,children:t[1].icon}),e[40]=t[1].icon,e[41]=B,e[42]=V):V=e[42];let E;e[43]!==t[1].label||e[44]!==t[1].value||e[45]!==l?(E=t[1].label&&s.jsx("span",{className:b("text-xs transition-colors ease-out duration-200 whitespace-nowrap",l===t[1].value?"text-foreground":"text-muted-foreground"),children:t[1].label}),e[43]=t[1].label,e[44]=t[1].value,e[45]=l,e[46]=E):E=e[46];let W;e[47]!==$||e[48]!==R||e[49]!==V||e[50]!==E?(W=s.jsxs("button",{ref:k,type:"button",onClick:$,className:R,children:[V,E]}),e[47]=$,e[48]=R,e[49]=V,e[50]=E,e[51]=W):W=e[51];const H=x?"h-12":o.button;let I;e[52]!==H?(I=b("absolute z-0 bg-background rounded-lg border-shadow transition-all [transition-timing-function:var(--ease-out-cubic)] duration-200",H),e[52]=H,e[53]=I):I=e[53];const J=`${m.left}px`,Q=`${m.width}px`;let L;e[54]!==m.opacity||e[55]!==J||e[56]!==Q?(L={left:J,width:Q,opacity:m.opacity},e[54]=m.opacity,e[55]=J,e[56]=Q,e[57]=L):L=e[57];let P;e[58]!==I||e[59]!==L?(P=s.jsx("div",{className:I,style:L}),e[58]=I,e[59]=L,e[60]=P):P=e[60];let O;return e[61]!==M||e[62]!==W||e[63]!==P||e[64]!==i?(O=s.jsxs("div",{className:i,children:[M,W,P]}),e[61]=M,e[62]=W,e[63]=P,e[64]=i,e[65]=O):O=e[65],O}function Se(r){const e=U.c(31),{viewMode:l,onViewModeChange:a,sortKey:t,sortDirection:w,onSort:z,sortOptions:j,filters:D}=r;let x;e[0]!==j?(x=j===void 0?[]:j,e[0]=j,e[1]=x):x=e[1];const C=x;let k;e[2]!==D?(k=D===void 0?[]:D,e[2]=D,e[3]=k):k=e[3];const c=k;let m;e[4]!==c?(m=c.filter(ge),e[4]=c,e[5]=m):m=e[5];const S=m.length;let g;e[6]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(ce,{size:16}),e[6]=g):g=e[6];let N;e[7]!==S?(N=S>0&&s.jsx(me,{variant:"default",className:"absolute -top-1.5 -right-1.5 h-4 min-w-4 px-1 text-[10px] leading-none",children:S}),e[7]=S,e[8]=N):N=e[8];let d;e[9]!==N?(d=s.jsx(de,{asChild:!0,children:s.jsx(se,{asChild:!0,children:s.jsxs(te,{variant:"outline",size:"icon",className:"size-7 border border-input relative",children:[g,N]})})}),e[9]=N,e[10]=d):d=e[10];let v;e[11]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(ue,{children:"Display & filters"}),e[11]=v):v=e[11];let o;e[12]!==d?(o=s.jsx(fe,{children:s.jsxs(xe,{children:[d,v]})}),e[12]=d,e[13]=o):o=e[13];let i;e[14]!==a||e[15]!==l?(i=a&&l&&s.jsx("div",{className:"p-2 border-b border-border",children:s.jsx(he,{value:l,onValueChange:a,fullWidth:!0,options:[{value:"table",icon:s.jsx(ae,{})},{value:"cards",icon:s.jsx(re,{})}]})}),e[14]=a,e[15]=l,e[16]=i):i=e[16];let n;e[17]!==z||e[18]!==w||e[19]!==t||e[20]!==C?(n=C.length>0&&z&&s.jsxs("div",{className:"p-1 flex flex-col gap-0.5 border-b border-border",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Sort by"}),C.map(y=>{const f=t===y.id;return s.jsx(X,{onClick:()=>z(y.id),className:b("h-8 px-2 py-0 cursor-pointer",f&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[f&&s.jsx(Y,{size:16,className:"text-foreground shrink-0"}),!f&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:y.label}),f&&w&&(w==="asc"?s.jsx(ie,{size:16,className:"text-foreground shrink-0"}):s.jsx(ne,{size:16,className:"text-foreground shrink-0"}))]})},y.id)})]}),e[17]=z,e[18]=w,e[19]=t,e[20]=C,e[21]=n):n=e[21];let p;e[22]!==c?(p=c.map(be),e[22]=c,e[23]=p):p=e[23];let h;e[24]!==i||e[25]!==n||e[26]!==p?(h=s.jsxs(le,{align:"end",className:"w-[200px] p-0 gap-0",children:[i,n,p]}),e[24]=i,e[25]=n,e[26]=p,e[27]=h):h=e[27];let u;return e[28]!==o||e[29]!==h?(u=s.jsxs(oe,{children:[o,h]}),e[28]=o,e[29]=h,e[30]=u):u=e[30],u}function be(r){return s.jsxs("div",{className:"p-1 flex flex-col gap-0.5 border-b border-border last:border-b-0",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:r.label}),r.options.map(e=>{const l=r.value===e.id;return s.jsx(X,{onClick:()=>r.onChange(e.id),className:b("h-8 px-2 py-0 cursor-pointer",l&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[l&&s.jsx(Y,{size:16,className:"text-foreground shrink-0"}),!l&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:e.label})]})},e.id)})]},r.label)}function ge(r){return r.value!=="ALL"}export{Se as C,he as V};
@@ -1 +1 @@
1
- import{c as v,D as b,j as i}from"./index-DLW7tZdu.js";import{i as w}from"./Loading01-DCKwAh-U.js";import{i as C}from"./SearchMd-C_bEWIlQ.js";import{I as k}from"./input-DgJ0xjPE.js";function E(j){const e=v.c(21),{value:m,onChange:d,placeholder:g,onKeyDown:f,className:p,isSearching:u,disabled:n}=j,x=g===void 0?"Search...":g;let t;e[0]!==p?(t=b("shrink-0 w-full border-b border-border h-12",p),e[0]=p,e[1]=t):t=e[1];const h=n?"cursor-not-allowed opacity-50":"cursor-text";let s;e[2]!==h?(s=b("flex items-center gap-2.5 h-12 px-4",h),e[2]=h,e[3]=s):s=e[3];let r;e[4]!==u?(r=u?i.jsx(w,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):i.jsx(C,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=u,e[5]=r):r=e[5];let l;e[6]!==d?(l=N=>d(N.target.value),e[6]=d,e[7]=l):l=e[7];let o;e[8]!==n||e[9]!==f||e[10]!==x||e[11]!==l||e[12]!==m?(o=i.jsx(k,{value:m,onChange:l,onKeyDown:f,placeholder:x,disabled:n,className:"flex-1 border-0 shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"}),e[8]=n,e[9]=f,e[10]=x,e[11]=l,e[12]=m,e[13]=o):o=e[13];let a;e[14]!==s||e[15]!==r||e[16]!==o?(a=i.jsxs("label",{className:s,children:[r,o]}),e[14]=s,e[15]=r,e[16]=o,e[17]=a):a=e[17];let c;return e[18]!==t||e[19]!==a?(c=i.jsx("div",{className:t,children:a}),e[18]=t,e[19]=a,e[20]=c):c=e[20],c}export{E as C};
1
+ import{c as v,D as b,j as i}from"./index-BRbdC8tb.js";import{i as w}from"./Loading01-CYdiDh3l.js";import{i as C}from"./SearchMd-BvvZzTkV.js";import{I as k}from"./input-BOjviNKP.js";function E(j){const e=v.c(21),{value:m,onChange:d,placeholder:g,onKeyDown:f,className:p,isSearching:u,disabled:n}=j,x=g===void 0?"Search...":g;let t;e[0]!==p?(t=b("shrink-0 w-full border-b border-border h-12",p),e[0]=p,e[1]=t):t=e[1];const h=n?"cursor-not-allowed opacity-50":"cursor-text";let s;e[2]!==h?(s=b("flex items-center gap-2.5 h-12 px-4",h),e[2]=h,e[3]=s):s=e[3];let r;e[4]!==u?(r=u?i.jsx(w,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):i.jsx(C,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=u,e[5]=r):r=e[5];let l;e[6]!==d?(l=N=>d(N.target.value),e[6]=d,e[7]=l):l=e[7];let o;e[8]!==n||e[9]!==f||e[10]!==x||e[11]!==l||e[12]!==m?(o=i.jsx(k,{value:m,onChange:l,onKeyDown:f,placeholder:x,disabled:n,className:"flex-1 border-0 shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"}),e[8]=n,e[9]=f,e[10]=x,e[11]=l,e[12]=m,e[13]=o):o=e[13];let a;e[14]!==s||e[15]!==r||e[16]!==o?(a=i.jsxs("label",{className:s,children:[r,o]}),e[14]=s,e[15]=r,e[16]=o,e[17]=a):a=e[17];let c;return e[18]!==t||e[19]!==a?(c=i.jsx("div",{className:t,children:a}),e[18]=t,e[19]=a,e[20]=c):c=e[20],c}export{E as C};
@@ -1 +1 @@
1
- import{c as k,j as s,D as C}from"./index-DLW7tZdu.js";import{c as S,a as R,b as T,e as H,d as L,T as D}from"./table-CbTCyRX5.js";import{i as z,n as E}from"./ArrowUp-FfROzAyV.js";function I(y){const e=k.c(29),{columns:r,data:f,sortKey:u,sortDirection:x,onSort:i,onRowClick:n,rowClassName:c}=y;let p;e[0]!==x?(p=function(t,h){return s.jsx("div",{className:"w-4 flex items-center justify-center",children:h&&x&&(x==="asc"?s.jsx(z,{size:16,className:"text-muted-foreground transition-colors"}):s.jsx(E,{size:16,className:"text-muted-foreground transition-colors"}))})},e[0]=x,e[1]=p):p=e[1];const b=p;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=function(t,h){let N="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-[11px] h-9 uppercase tracking-wider";return t===h-1&&(N="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-[11px] h-9 uppercase tracking-wider w-8"),N},e[2]=d):d=e[2];const a=d;let l;if(e[3]!==r||e[4]!==i||e[5]!==b||e[6]!==u){let o;e[8]!==r.length||e[9]!==i||e[10]!==b||e[11]!==u?(o=(t,h)=>{const N=u===t.id;return s.jsx(S,{className:C(a(h,r.length),"group transition-colors select-none",t.sortable&&"hover:bg-accent cursor-pointer",t.rowClassName,t.cellClassName),onClick:t.sortable&&i?()=>i(t.id):void 0,children:s.jsxs("span",{className:"flex items-center gap-1",children:[t.header,t.sortable&&b(t.id,N)]})},t.id)},e[8]=r.length,e[9]=i,e[10]=b,e[11]=u,e[12]=o):o=e[12],l=r.map(o),e[3]=r,e[4]=i,e[5]=b,e[6]=u,e[7]=l}else l=e[7];let g;e[13]!==l?(g=s.jsx(R,{className:"border-b-0",children:s.jsx(T,{className:"h-9 hover:bg-transparent border-b border-border",children:l})}),e[13]=l,e[14]=g):g=e[14];let j;if(e[15]!==r||e[16]!==f||e[17]!==n||e[18]!==c){let o;e[20]!==r||e[21]!==n||e[22]!==c?(o=(t,h)=>{const N=c?.(t);return s.jsx(T,{"data-row-index":h,className:C("group/data-row transition-colors border-b-0 hover:bg-accent/50",n?"cursor-pointer":"",N),onClick:n?()=>n(t):void 0,children:r.map(m=>s.jsx(H,{className:C("px-5 py-4 h-16 align-middle text-sm text-foreground",m.cellClassName,m.wrap?"whitespace-normal wrap-break-word":""),children:s.jsx("div",{className:C(m.wrap?"w-full":"min-w-0 w-full",!m.wrap&&"truncate overflow-hidden whitespace-nowrap"),children:m.render?m.render(t):m.accessor?m.accessor(t):null})},m.id))},h)},e[20]=r,e[21]=n,e[22]=c,e[23]=o):o=e[23],j=f.map(o),e[15]=r,e[16]=f,e[17]=n,e[18]=c,e[19]=j}else j=e[19];let w;e[24]!==j?(w=s.jsx(L,{children:j}),e[24]=j,e[25]=w):w=e[25];let v;return e[26]!==g||e[27]!==w?(v=s.jsxs(D,{className:"w-full border-collapse",children:[g,w]}),e[26]=g,e[27]=w,e[28]=v):v=e[28],v}function B(y){const e=k.c(12),{columns:r,data:f,isLoading:u,sortKey:x,sortDirection:i,onSort:n,onRowClick:c,emptyState:p}=y;if(u===void 0?!1:u){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("div",{className:"text-muted-foreground",children:"Loading..."})}),e[0]=a):a=e[0],a}if(f.length===0){let a;e[1]!==p?(a=p||s.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"No items found"}),e[1]=p,e[2]=a):a=e[2];let l;return e[3]!==a?(l=s.jsx("div",{className:"flex items-center justify-center h-full",children:a}),e[3]=a,e[4]=l):l=e[4],l}let d;return e[5]!==r||e[6]!==f||e[7]!==c||e[8]!==n||e[9]!==i||e[10]!==x?(d=s.jsx("div",{className:"flex-1 overflow-auto",children:s.jsx(I,{columns:r,data:f,sortKey:x,sortDirection:i,onSort:n,onRowClick:c})}),e[5]=r,e[6]=f,e[7]=c,e[8]=n,e[9]=i,e[10]=x,e[11]=d):d=e[11],d}export{B as C};
1
+ import{c as k,j as s,D as C}from"./index-BRbdC8tb.js";import{c as S,a as R,b as T,e as H,d as L,T as D}from"./table-6Exocylh.js";import{i as z,n as E}from"./ArrowUp-CVgf-IuM.js";function I(y){const e=k.c(29),{columns:r,data:f,sortKey:u,sortDirection:x,onSort:i,onRowClick:n,rowClassName:c}=y;let p;e[0]!==x?(p=function(t,h){return s.jsx("div",{className:"w-4 flex items-center justify-center",children:h&&x&&(x==="asc"?s.jsx(z,{size:16,className:"text-muted-foreground transition-colors"}):s.jsx(E,{size:16,className:"text-muted-foreground transition-colors"}))})},e[0]=x,e[1]=p):p=e[1];const b=p;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=function(t,h){let N="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-[11px] h-9 uppercase tracking-wider";return t===h-1&&(N="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-[11px] h-9 uppercase tracking-wider w-8"),N},e[2]=d):d=e[2];const a=d;let l;if(e[3]!==r||e[4]!==i||e[5]!==b||e[6]!==u){let o;e[8]!==r.length||e[9]!==i||e[10]!==b||e[11]!==u?(o=(t,h)=>{const N=u===t.id;return s.jsx(S,{className:C(a(h,r.length),"group transition-colors select-none",t.sortable&&"hover:bg-accent cursor-pointer",t.rowClassName,t.cellClassName),onClick:t.sortable&&i?()=>i(t.id):void 0,children:s.jsxs("span",{className:"flex items-center gap-1",children:[t.header,t.sortable&&b(t.id,N)]})},t.id)},e[8]=r.length,e[9]=i,e[10]=b,e[11]=u,e[12]=o):o=e[12],l=r.map(o),e[3]=r,e[4]=i,e[5]=b,e[6]=u,e[7]=l}else l=e[7];let g;e[13]!==l?(g=s.jsx(R,{className:"border-b-0",children:s.jsx(T,{className:"h-9 hover:bg-transparent border-b border-border",children:l})}),e[13]=l,e[14]=g):g=e[14];let j;if(e[15]!==r||e[16]!==f||e[17]!==n||e[18]!==c){let o;e[20]!==r||e[21]!==n||e[22]!==c?(o=(t,h)=>{const N=c?.(t);return s.jsx(T,{"data-row-index":h,className:C("group/data-row transition-colors border-b-0 hover:bg-accent/50",n?"cursor-pointer":"",N),onClick:n?()=>n(t):void 0,children:r.map(m=>s.jsx(H,{className:C("px-5 py-4 h-16 align-middle text-sm text-foreground",m.cellClassName,m.wrap?"whitespace-normal wrap-break-word":""),children:s.jsx("div",{className:C(m.wrap?"w-full":"min-w-0 w-full",!m.wrap&&"truncate overflow-hidden whitespace-nowrap"),children:m.render?m.render(t):m.accessor?m.accessor(t):null})},m.id))},h)},e[20]=r,e[21]=n,e[22]=c,e[23]=o):o=e[23],j=f.map(o),e[15]=r,e[16]=f,e[17]=n,e[18]=c,e[19]=j}else j=e[19];let w;e[24]!==j?(w=s.jsx(L,{children:j}),e[24]=j,e[25]=w):w=e[25];let v;return e[26]!==g||e[27]!==w?(v=s.jsxs(D,{className:"w-full border-collapse",children:[g,w]}),e[26]=g,e[27]=w,e[28]=v):v=e[28],v}function B(y){const e=k.c(12),{columns:r,data:f,isLoading:u,sortKey:x,sortDirection:i,onSort:n,onRowClick:c,emptyState:p}=y;if(u===void 0?!1:u){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("div",{className:"text-muted-foreground",children:"Loading..."})}),e[0]=a):a=e[0],a}if(f.length===0){let a;e[1]!==p?(a=p||s.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"No items found"}),e[1]=p,e[2]=a):a=e[2];let l;return e[3]!==a?(l=s.jsx("div",{className:"flex items-center justify-center h-full",children:a}),e[3]=a,e[4]=l):l=e[4],l}let d;return e[5]!==r||e[6]!==f||e[7]!==c||e[8]!==n||e[9]!==i||e[10]!==x?(d=s.jsx("div",{className:"flex-1 overflow-auto",children:s.jsx(I,{columns:r,data:f,sortKey:x,sortDirection:i,onSort:n,onRowClick:c})}),e[5]=r,e[6]=f,e[7]=c,e[8]=n,e[9]=i,e[10]=x,e[11]=d):d=e[11],d}export{B as C};
@@ -1 +1 @@
1
- import{c as f,D as u,j as m}from"./index-DLW7tZdu.js";import{B as g}from"./badge-C2jHxnoS.js";function h(x){const e=f.c(12),{tabs:l,activeTab:n,onTabChange:s,className:a}=x;let t;e[0]!==a?(t=u("flex items-center gap-2 overflow-x-auto no-scrollbar",a),e[0]=a,e[1]=t):t=e[1];let r;if(e[2]!==n||e[3]!==s||e[4]!==l){let c;e[6]!==n||e[7]!==s?(c=o=>{const d=n===o.id;return m.jsxs("button",{type:"button",onClick:()=>s(o.id),className:u("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex gap-1.5 items-center",d&&"bg-accent border-border text-foreground",!d&&"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),children:[o.label,o.count!==void 0&&m.jsx(g,{variant:"secondary",className:u("h-5 min-w-5 px-1 rounded-full text-[10px] font-mono inline-flex items-center justify-center",d?"bg-background text-foreground":"bg-muted-foreground/10 text-muted-foreground"),children:o.count})]},o.id)},e[6]=n,e[7]=s,e[8]=c):c=e[8],r=l.map(c),e[2]=n,e[3]=s,e[4]=l,e[5]=r}else r=e[5];let i;return e[9]!==t||e[10]!==r?(i=m.jsx("div",{className:t,children:r}),e[9]=t,e[10]=r,e[11]=i):i=e[11],i}export{h as C};
1
+ import{c as f,D as u,j as m}from"./index-BRbdC8tb.js";import{B as g}from"./badge-BbY1Vzps.js";function h(x){const e=f.c(12),{tabs:l,activeTab:n,onTabChange:s,className:a}=x;let t;e[0]!==a?(t=u("flex items-center gap-2 overflow-x-auto no-scrollbar",a),e[0]=a,e[1]=t):t=e[1];let r;if(e[2]!==n||e[3]!==s||e[4]!==l){let c;e[6]!==n||e[7]!==s?(c=o=>{const d=n===o.id;return m.jsxs("button",{type:"button",onClick:()=>s(o.id),className:u("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex gap-1.5 items-center",d&&"bg-accent border-border text-foreground",!d&&"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),children:[o.label,o.count!==void 0&&m.jsx(g,{variant:"secondary",className:u("h-5 min-w-5 px-1 rounded-full text-[10px] font-mono inline-flex items-center justify-center",d?"bg-background text-foreground":"bg-muted-foreground/10 text-muted-foreground"),children:o.count})]},o.id)},e[6]=n,e[7]=s,e[8]=c):c=e[8],r=l.map(c),e[2]=n,e[3]=s,e[4]=l,e[5]=r}else r=e[5];let i;return e[9]!==t||e[10]!==r?(i=m.jsx("div",{className:t,children:r}),e[9]=t,e[10]=r,e[11]=i):i=e[11],i}export{h as C};
@@ -1 +1 @@
1
- import{c as r,D as m,j as n}from"./index-DLW7tZdu.js";import{_ as d}from"./index-DCtU4ndp.js";import{i}from"./SearchMd-C_bEWIlQ.js";function x(l){const e=r.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 o;e[3]!==t?(o=m("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",t),e[3]=t,e[4]=o):o=e[4];let a;return e[5]!==s||e[6]!==o?(a=n.jsx(d,{"data-slot":"command",className:o,...s}),e[5]=s,e[6]=o,e[7]=a):a=e[7],a}function g(l){const e=r.c(9);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 o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(i,{className:"size-5 shrink-0 text-foreground"}),e[3]=o):o=e[3];let a;e[4]!==t?(a=m("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",t),e[4]=t,e[5]=a):a=e[5];let c;return e[6]!==s||e[7]!==a?(c=n.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-10 items-center gap-2 border-b px-3",children:[o,n.jsx(d.Input,{"data-slot":"command-input",className:a,...s})]}),e[6]=s,e[7]=a,e[8]=c):c=e[8],c}function h(l){const e=r.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 o;e[3]!==t?(o=m("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",t),e[3]=t,e[4]=o):o=e[4];let a;return e[5]!==s||e[6]!==o?(a=n.jsx(d.List,{"data-slot":"command-list",className:o,...s}),e[5]=s,e[6]=o,e[7]=a):a=e[7],a}function N(l){const e=r.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=n.jsx(d.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...t}),e[2]=t,e[3]=s):s=e[3],s}function v(l){const e=r.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 o;e[3]!==t?(o=m("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",t),e[3]=t,e[4]=o):o=e[4];let a;return e[5]!==s||e[6]!==o?(a=n.jsx(d.Group,{"data-slot":"command-group",className:o,...s}),e[5]=s,e[6]=o,e[7]=a):a=e[7],a}function b(l){const e=r.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 o;e[3]!==t?(o=m("bg-border -mx-1 h-px",t),e[3]=t,e[4]=o):o=e[4];let a;return e[5]!==s||e[6]!==o?(a=n.jsx(d.Separator,{"data-slot":"command-separator",className:o,...s}),e[5]=s,e[6]=o,e[7]=a):a=e[7],a}function _(l){const e=r.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 o;e[3]!==t?(o=m("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[3]=t,e[4]=o):o=e[4];let a;return e[5]!==s||e[6]!==o?(a=n.jsx(d.Item,{"data-slot":"command-item",className:o,...s}),e[5]=s,e[6]=o,e[7]=a):a=e[7],a}export{v as C,h as a,x as b,g as c,N as d,_ as e,b as f};
1
+ import{c as r,D as m,j as n}from"./index-BRbdC8tb.js";import{_ as d}from"./index-DhwDaiqy.js";import{i}from"./SearchMd-BvvZzTkV.js";function x(l){const e=r.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 o;e[3]!==t?(o=m("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",t),e[3]=t,e[4]=o):o=e[4];let a;return e[5]!==s||e[6]!==o?(a=n.jsx(d,{"data-slot":"command",className:o,...s}),e[5]=s,e[6]=o,e[7]=a):a=e[7],a}function g(l){const e=r.c(9);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 o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(i,{className:"size-5 shrink-0 text-foreground"}),e[3]=o):o=e[3];let a;e[4]!==t?(a=m("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",t),e[4]=t,e[5]=a):a=e[5];let c;return e[6]!==s||e[7]!==a?(c=n.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-10 items-center gap-2 border-b px-3",children:[o,n.jsx(d.Input,{"data-slot":"command-input",className:a,...s})]}),e[6]=s,e[7]=a,e[8]=c):c=e[8],c}function h(l){const e=r.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 o;e[3]!==t?(o=m("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",t),e[3]=t,e[4]=o):o=e[4];let a;return e[5]!==s||e[6]!==o?(a=n.jsx(d.List,{"data-slot":"command-list",className:o,...s}),e[5]=s,e[6]=o,e[7]=a):a=e[7],a}function N(l){const e=r.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=n.jsx(d.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...t}),e[2]=t,e[3]=s):s=e[3],s}function v(l){const e=r.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 o;e[3]!==t?(o=m("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",t),e[3]=t,e[4]=o):o=e[4];let a;return e[5]!==s||e[6]!==o?(a=n.jsx(d.Group,{"data-slot":"command-group",className:o,...s}),e[5]=s,e[6]=o,e[7]=a):a=e[7],a}function b(l){const e=r.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 o;e[3]!==t?(o=m("bg-border -mx-1 h-px",t),e[3]=t,e[4]=o):o=e[4];let a;return e[5]!==s||e[6]!==o?(a=n.jsx(d.Separator,{"data-slot":"command-separator",className:o,...s}),e[5]=s,e[6]=o,e[7]=a):a=e[7],a}function _(l){const e=r.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 o;e[3]!==t?(o=m("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[3]=t,e[4]=o):o=e[4];let a;return e[5]!==s||e[6]!==o?(a=n.jsx(d.Item,{"data-slot":"command-item",className:o,...s}),e[5]=s,e[6]=o,e[7]=a):a=e[7],a}export{v as C,h as a,x as b,g as c,N as d,_ as e,b as f};