decocms 4.61.2 → 4.62.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (279) hide show
  1. package/dist/client/assets/{AlertCircle-BsA2wZmN.js → AlertCircle-pDwFaZ69.js} +1 -1
  2. package/dist/client/assets/{AreaChart-BHEk1VG5.js → AreaChart-CUV8xbg8.js} +1 -1
  3. package/dist/client/assets/{ArrowUp-CDnEKV2Y.js → ArrowUp-DtY9ye1M.js} +1 -1
  4. package/dist/client/assets/{ArrowUpRight-DdPCnlNm.js → ArrowUpRight-BF8RC7lQ.js} +1 -1
  5. package/dist/client/assets/{Check-CcLLJc-z.js → Check-c3mV_Uni.js} +1 -1
  6. package/dist/client/assets/{CheckCircle-lXciCGfG.js → CheckCircle-CE_q_EWl.js} +1 -1
  7. package/dist/client/assets/{ChevronDown-BmFaSDo8.js → ChevronDown-Be1kUurm.js} +1 -1
  8. package/dist/client/assets/{ChevronRight-C3Tgk-3m.js → ChevronRight-86cbncTU.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-Dew3RmKl.js → ChevronUp-7vDXTQHH.js} +1 -1
  10. package/dist/client/assets/{Circle-C_fdyhr8.js → Circle-Jj2lB_OB.js} +1 -1
  11. package/dist/client/assets/{Copy01-b3lIb5yu.js → Copy01-bnpfrlf8.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-CK1a4mKj.js → DotsVertical-Cw_RGd0K.js} +1 -1
  13. package/dist/client/assets/{Eye-DM8bmzm7.js → Eye-DSKes5cc.js} +1 -1
  14. package/dist/client/assets/{FilterLines-DCNZa1GS.js → FilterLines-AFo6zz8G.js} +1 -1
  15. package/dist/client/assets/{Globe01-B6kdhpV9.js → Globe01-CINqduC_.js} +1 -1
  16. package/dist/client/assets/{Globe04-CGLGspo5.js → Globe04-Df4bCIam.js} +1 -1
  17. package/dist/client/assets/{HardDrive-CR6Rs-a1.js → HardDrive-C9RJVCTC.js} +1 -1
  18. package/dist/client/assets/{Key01-1r4YrQER.js → Key01-BufYrbpv.js} +1 -1
  19. package/dist/client/assets/{LayoutLeft-DvNM8qhm.js → LayoutLeft-Dg-hdc1o.js} +1 -1
  20. package/dist/client/assets/{LinkExternal01-Ck4lryDE.js → LinkExternal01-jNsZTUJe.js} +1 -1
  21. package/dist/client/assets/{List-DfPIAPM_.js → List-jTag997N.js} +1 -1
  22. package/dist/client/assets/{Loading02-Dx-xiZND.js → Loading02-DXivv_GE.js} +1 -1
  23. package/dist/client/assets/{Monitor01-D_DrBwt_.js → Monitor01-Cgb6dKKW.js} +1 -1
  24. package/dist/client/assets/{Package-CV2Q9Uup.js → Package-Bm7E2eK0.js} +1 -1
  25. package/dist/client/assets/{Palette-BY5BmUDa.js → Palette-D0cmCBJm.js} +1 -1
  26. package/dist/client/assets/{Play-Ci1OqtIO.js → Play-DL5iVtNY.js} +1 -1
  27. package/dist/client/assets/{Plus-Cgq7ON9K.js → Plus-SxhLmH-g.js} +1 -1
  28. package/dist/client/assets/{SearchLg-2as_l8YT.js → SearchLg-DalS_9no.js} +1 -1
  29. package/dist/client/assets/{SearchMd-ZfoTl6vw.js → SearchMd-DXMQuWHS.js} +1 -1
  30. package/dist/client/assets/{Settings02-CS2jOfO5.js → Settings02-Ci6H3sb0.js} +1 -1
  31. package/dist/client/assets/{Shield01-C6TdRfmI.js → Shield01-CFnvQppZ.js} +1 -1
  32. package/dist/client/assets/{Star01-2DHf7kTZ.js → Star01-ZuQ9gpI3.js} +1 -1
  33. package/dist/client/assets/{Stars01-BEHbN5c3.js → Stars01-MX3VUC0h.js} +1 -1
  34. package/dist/client/assets/{Stars02-HLp9q8iP.js → Stars02-ClT22kUl.js} +1 -1
  35. package/dist/client/assets/{Sun-ByaEjJ0N.js → Sun-C2eqMrg3.js} +1 -1
  36. package/dist/client/assets/{SwitchHorizontal01-ilLzkPr_.js → SwitchHorizontal01-CTbgmfyn.js} +1 -1
  37. package/dist/client/assets/{Tool01-DVCGutKV.js → Tool01-CcmA_w81.js} +1 -1
  38. package/dist/client/assets/{Tool02-CSTMjTef.js → Tool02-DsdesO-0.js} +1 -1
  39. package/dist/client/assets/{Trash01--uX5q_ti.js → Trash01-RuXWiql6.js} +1 -1
  40. package/dist/client/assets/{TrendUp01-acR-ekUr.js → TrendUp01-RmaL7vVA.js} +1 -1
  41. package/dist/client/assets/{Upload01-BaheeKQP.js → Upload01-t4JMvfO4.js} +1 -1
  42. package/dist/client/assets/{User01-5hu8D3_O.js → User01-nY_0gSR5.js} +1 -1
  43. package/dist/client/assets/{Users01-Dh5E4dqf.js → Users01-COP9ABdE.js} +1 -1
  44. package/dist/client/assets/{Users03-tGwfKVJc.js → Users03-CwOsvMmx.js} +1 -1
  45. package/dist/client/assets/{X-OFSHASit.js → X-82Zaa9wO.js} +1 -1
  46. package/dist/client/assets/{XCircle-D3cI1Aep.js → XCircle-DFVEpL7j.js} +1 -1
  47. package/dist/client/assets/{XClose-D5Ra7e-f.js → XClose-DGRyO79b.js} +1 -1
  48. package/dist/client/assets/{Zap-CgjpaG4V.js → Zap-DGilRzov.js} +1 -1
  49. package/dist/client/assets/{ZapSquare-Dzb50Gix.js → ZapSquare-x5bylaAn.js} +1 -1
  50. package/dist/client/assets/{ZoomOut-DYAXxr_v.js → ZoomOut-d0pU1jsr.js} +1 -1
  51. package/dist/client/assets/{access-gate-B4XS-sin.js → access-gate-B9Uqf_RZ.js} +1 -1
  52. package/dist/client/assets/{add-section-modal-2QsV6sh6.js → add-section-modal-F3LoJMj-.js} +1 -1
  53. package/dist/client/assets/agent-icon-Bx7GZZkT.js +1 -0
  54. package/dist/client/assets/agents-list-DA2O4yFI.js +1 -0
  55. package/dist/client/assets/ai-providers-_h8FzskN.js +1 -0
  56. package/dist/client/assets/{alert-DBWDLZgp.js → alert-D7vvtYHx.js} +1 -1
  57. package/dist/client/assets/{alert-dialog-Bd5XLC3F.js → alert-dialog-BbUTua7Y.js} +3 -3
  58. package/dist/client/assets/{app-editor-CC9wPnl_.js → app-editor-Ba6EJE8k.js} +1 -1
  59. package/dist/client/assets/{auth-D_bm0-t3.js → auth-Cduc78Mk.js} +1 -1
  60. package/dist/client/assets/{auth-catchall-CDVAqOkY.js → auth-catchall-BiGQzMvA.js} +1 -1
  61. package/dist/client/assets/auth-entry-B1IjK16Y.js +1 -0
  62. package/dist/client/assets/{auth-split-layout-DB8qmgLK.js → auth-split-layout-B5WaIo2U.js} +1 -1
  63. package/dist/client/assets/{authenticate-and-persist-oauth-ClCvWDci.js → authenticate-and-persist-oauth-Bsjhlz6M.js} +1 -1
  64. package/dist/client/assets/{automation-list-row-ByoN-o6y.js → automation-list-row-tfqwgW_l.js} +1 -1
  65. package/dist/client/assets/{automation-runs-Y9TSuy3F.js → automation-runs-HchqpNoW.js} +1 -1
  66. package/dist/client/assets/automations-3g-k57eu.js +1 -0
  67. package/dist/client/assets/{autosend-qB5BaOSA.js → autosend-CFSFemh9.js} +1 -1
  68. package/dist/client/assets/{avatar-DOYkgu8W.js → avatar-ChSwYwdc.js} +1 -1
  69. package/dist/client/assets/{badge-BMMjntMn.js → badge-BDCVlL_X.js} +1 -1
  70. package/dist/client/assets/{block-document-CCtmnkDi.js → block-document-CwHUDj3Z.js} +1 -1
  71. package/dist/client/assets/brand-context-KxYFeM0J.js +1 -0
  72. package/dist/client/assets/{buckets-B22IEfKD.js → buckets-BB9qHXCG.js} +1 -1
  73. package/dist/client/assets/{bulk-category-panel-C3pu2Jik.js → bulk-category-panel-mDoc713s.js} +1 -1
  74. package/dist/client/assets/{calendar-Io_vhk-a.js → calendar-DkErgVju.js} +1 -1
  75. package/dist/client/assets/capability-load-error-C5KrMr5A.js +1 -0
  76. package/dist/client/assets/{card-Bc92PJFP.js → card-CZ_4AnzZ.js} +1 -1
  77. package/dist/client/assets/{category-editor-C1FxzSFF.js → category-editor-CoE1JSlR.js} +1 -1
  78. package/dist/client/assets/{chat-context-Awe2cIoY.js → chat-context-DHiffp4D.js} +6 -6
  79. package/dist/client/assets/{checkbox-B-y-IHdE.js → checkbox-B0y92ybh.js} +1 -1
  80. package/dist/client/assets/{cli-auth-success-BlIIxKPd.js → cli-auth-success-BJQaPA_u.js} +1 -1
  81. package/dist/client/assets/collection-detail-B85L8fXv.js +1 -0
  82. package/dist/client/assets/{collection-display-button-BVhQtAEp.js → collection-display-button-CTkls5Hq.js} +1 -1
  83. package/dist/client/assets/{collection-search-DSP3ov6A.js → collection-search-B1ZoXYDP.js} +1 -1
  84. package/dist/client/assets/{collection-table-wrapper-CeR2zvlX.js → collection-table-wrapper-CzOELqST.js} +1 -1
  85. package/dist/client/assets/{collection-tabs-PTC62n_G.js → collection-tabs-DSyyuCu8.js} +1 -1
  86. package/dist/client/assets/{command-DzGwZa9g.js → command-NscuxjlL.js} +1 -1
  87. package/dist/client/assets/commerce-onboarding-DS2bNsVf.js +1 -0
  88. package/dist/client/assets/{connect-desktop-dialog-DiutLBhU.js → connect-desktop-dialog-C_zkxzg2.js} +1 -1
  89. package/dist/client/assets/connection-card-DgJ4fCkV.js +1 -0
  90. package/dist/client/assets/connection-detail-BHWNvMoI.js +1 -0
  91. package/dist/client/assets/{connection-form-helpers-POWe2kJ-.js → connection-form-helpers-CoPiWrjw.js} +1 -1
  92. package/dist/client/assets/connections-ByyzNSeZ.js +1 -0
  93. package/dist/client/assets/{decopilot-sse-pool-CJtSg3wj.js → decopilot-sse-pool-jzNdhqzZ.js} +1 -1
  94. package/dist/client/assets/dialog-BxiPyolh.js +1 -0
  95. package/dist/client/assets/domain-settings-DixzI7vw.js +1 -0
  96. package/dist/client/assets/{drawer-Ck_Oak77.js → drawer-HMFyJ4Dn.js} +1 -1
  97. package/dist/client/assets/{dropdown-menu-C9SSwIby.js → dropdown-menu-B8LX4IYo.js} +1 -1
  98. package/dist/client/assets/{empty-state-DD15-E7x.js → empty-state-BJyyJcI7.js} +1 -1
  99. package/dist/client/assets/{extract-connection-data-Di6SAuY0.js → extract-connection-data-CgMMiKb9.js} +1 -1
  100. package/dist/client/assets/{file-explorer-CMqCjVts.js → file-explorer-B2mELjEV.js} +2 -2
  101. package/dist/client/assets/{file-type-icon-CuakGACj.js → file-type-icon-aF4rioSK.js} +1 -1
  102. package/dist/client/assets/{files-DrQIRu5a.js → files-DlatlTEv.js} +1 -1
  103. package/dist/client/assets/{form-YJrSMpNL.js → form-NWTw1_w9.js} +1 -1
  104. package/dist/client/assets/general-B6MHlXUW.js +1 -0
  105. package/dist/client/assets/github-repo-picker-BgT_NiIP.js +1 -0
  106. package/dist/client/assets/{hooks-GnFkomrq.js → hooks-7RE64ble.js} +1 -1
  107. package/dist/client/assets/index-6OJYzM5S.js +1 -0
  108. package/dist/client/assets/{index-DS3hrf0F.js → index-BQNtvMv8.js} +1 -1
  109. package/dist/client/assets/index-Bn17GDJi.js +1 -0
  110. package/dist/client/assets/{index-0yvnZiwb.js → index-C6SqXYAf.js} +1 -1
  111. package/dist/client/assets/{index-Cim2j5YD.js → index-CGtkbkWC.js} +1 -1
  112. package/dist/client/assets/{index-CCnsgP9d.js → index-CNXl1ql2.js} +5 -5
  113. package/dist/client/assets/{index-Dv19SgJH.js → index-CPLWHNIg.js} +5 -5
  114. package/dist/client/assets/{index-CsZhMKFM.js → index-CtlgC1KW.js} +26 -26
  115. package/dist/client/assets/{index-Cyr1IOqy.js → index-Cv4TIpz2.js} +1 -1
  116. package/dist/client/assets/index-D6W0Zja4.css +1 -0
  117. package/dist/client/assets/index-DX7CG04Y.js +1 -0
  118. package/dist/client/assets/index-Dz-SEkbI.js +1 -0
  119. package/dist/client/assets/{index-DPzJsdBC.js → index-FOhB290E.js} +1 -1
  120. package/dist/client/assets/{index-MwzluG1w.js → index-Fk54aBQb.js} +1 -1
  121. package/dist/client/assets/{index-redirect-Hp_EA6DJ.js → index-redirect-D_1i3wgr.js} +1 -1
  122. package/dist/client/assets/{index-BraRl60q.js → index-w9OsdEvg.js} +1 -1
  123. package/dist/client/assets/{input-D5ccsU_1.js → input-D0-jk8XC.js} +1 -1
  124. package/dist/client/assets/{integration-icon-6pGkEdul.js → integration-icon-BxCXFWwF.js} +1 -1
  125. package/dist/client/assets/invite-member-dialog-CczkEEVJ.js +3 -0
  126. package/dist/client/assets/{label-BULuaMoF.js → label-CI8zXgUl.js} +1 -1
  127. package/dist/client/assets/{layout-BloKJFhD.js → layout-DsSv6cI0.js} +1 -1
  128. package/dist/client/assets/{login-Dzlh5qYT.js → login-vc557tVg.js} +1 -1
  129. package/dist/client/assets/{mcp-oauth-z9GFPjDo.js → mcp-oauth-Crm2yFws.js} +1 -1
  130. package/dist/client/assets/members-BriZzAKO.js +1 -0
  131. package/dist/client/assets/{monaco-editor-CiP0ChuC.js → monaco-editor-BSERZA56.js} +1 -1
  132. package/dist/client/assets/{monitoring-stats-row-CLHK9ypI.js → monitoring-stats-row-Bzy4MOqt.js} +3 -3
  133. package/dist/client/assets/{oauth-callback-CdWGFVi8.js → oauth-callback-BweaHAfJ.js} +1 -1
  134. package/dist/client/assets/{oauth-callback-ai-provider-qp9LO32T.js → oauth-callback-ai-provider-DGFuYZT6.js} +1 -1
  135. package/dist/client/assets/{onboarding-iL9ZeHnE.js → onboarding-CGfqD1Pb.js} +1 -1
  136. package/dist/client/assets/{org-install-ZxTYabEU.js → org-install-C4kxLg_g.js} +1 -1
  137. package/dist/client/assets/{org-layout-DWaUEBqs.js → org-layout-DzZAcdj6.js} +1 -1
  138. package/dist/client/assets/{organization-choice-5GYvmez0.js → organization-choice-D69Iyg_P.js} +1 -1
  139. package/dist/client/assets/{orgs-CRRA1WCm.js → orgs-CvM6zK17.js} +1 -1
  140. package/dist/client/assets/{page-seo-form-C4SLs6YG.js → page-seo-form-C8i2PCcW.js} +1 -1
  141. package/dist/client/assets/page-seo-sheet-Bj1PQ_T3.js +1 -0
  142. package/dist/client/assets/{popover-C5PoRwEk.js → popover-4SjKIFSf.js} +1 -1
  143. package/dist/client/assets/{post-editor-DQzYF8Ef.js → post-editor-DwhUQfz3.js} +1 -1
  144. package/dist/client/assets/{primitives-BEmjSMO9.js → primitives-IUnUzi8K.js} +1 -1
  145. package/dist/client/assets/profile-op77lWAk.js +1 -0
  146. package/dist/client/assets/project-app-view-Bw5vRwKV.js +1 -0
  147. package/dist/client/assets/record-editor-CO3ZgdGS.js +1 -0
  148. package/dist/client/assets/registry-DasK6zXw.js +2 -0
  149. package/dist/client/assets/{registry-layout-BDNmgEhN.js → registry-layout-DPozdEQJ.js} +4 -4
  150. package/dist/client/assets/{reports-C6ascunL.js → reports-AOzd79LO.js} +1 -1
  151. package/dist/client/assets/{require-capability-BjscC7QS.js → require-capability-BIrGCy6a.js} +1 -1
  152. package/dist/client/assets/{required-auth-layout-R2McgzF5.js → required-auth-layout-CQN5hr5X.js} +1 -1
  153. package/dist/client/assets/{reset-password-Fw4tx_9w.js → reset-password-DyAxea_4.js} +1 -1
  154. package/dist/client/assets/roles-Bmag3QoK.js +1 -0
  155. package/dist/client/assets/{search-input-BREJK7qA.js → search-input-DAhQOW8w.js} +1 -1
  156. package/dist/client/assets/secrets-Bca-yEgx.js +1 -0
  157. package/dist/client/assets/{sections-editor-CKmy6jCA.js → sections-editor-A9ozMN_I.js} +1 -1
  158. package/dist/client/assets/{select-CVMXwLRV.js → select-DymbSi1i.js} +1 -1
  159. package/dist/client/assets/{select-model-Cg3FzUNI.js → select-model-CBmm5efp.js} +1 -1
  160. package/dist/client/assets/self-tool-result-DQZF7wnw.js +1 -0
  161. package/dist/client/assets/{seo-editor-DVVtxnZN.js → seo-editor-D8BRx5cO.js} +1 -1
  162. package/dist/client/assets/settings-layout-BbrrKyAB.js +1 -0
  163. package/dist/client/assets/{settings-section-BYCtjEaG.js → settings-section-BorHlHtt.js} +1 -1
  164. package/dist/client/assets/{shell-controls-Daj0PZIQ.js → shell-controls-D4pwQUJp.js} +1 -1
  165. package/dist/client/assets/shell-layout-DSlq9QDA.js +1 -0
  166. package/dist/client/assets/sidebar-BGBaPTiJ.js +1 -0
  167. package/dist/client/assets/{skeleton-BZzqWIif.js → skeleton-Cs7umMol.js} +1 -1
  168. package/dist/client/assets/sso-CSY_I7_s.js +1 -0
  169. package/dist/client/assets/store-CbwbkmsP.js +1 -0
  170. package/dist/client/assets/store-registry-3IML_T0w.js +2 -0
  171. package/dist/client/assets/studio-tools-Dm4swbDJ.js +1 -0
  172. package/dist/client/assets/{switch-B36ltQ63.js → switch-DenJ-Rqp.js} +1 -1
  173. package/dist/client/assets/{table-CLRsCUXA.js → table-6yLqG5BG.js} +1 -1
  174. package/dist/client/assets/{tabs-BoNNus4B.js → tabs-B41R3KT7.js} +1 -1
  175. package/dist/client/assets/{textarea-DPLwPKZJ.js → textarea-DDx4ded2.js} +1 -1
  176. package/dist/client/assets/{toggle-group-DkGsY2u-.js → toggle-group-DxbzbSVL.js} +1 -1
  177. package/dist/client/assets/{toolbar-CedVmC1P.js → toolbar-Dw7sJZzm.js} +1 -1
  178. package/dist/client/assets/{toolbar-icon-button-5fStNBy9.js → toolbar-icon-button-DRu94yPg.js} +1 -1
  179. package/dist/client/assets/tools-list-gF6CK4rd.js +1 -0
  180. package/dist/client/assets/{tooltip-Cs5hng3q.js → tooltip-2S76Z1GN.js} +1 -1
  181. package/dist/client/assets/use-ai-providers-BRJFSGox.js +1 -0
  182. package/dist/client/assets/use-automations-CtMMZwGK.js +1 -0
  183. package/dist/client/assets/use-capability-Cr4AoWjX.js +1 -0
  184. package/dist/client/assets/{use-clock-tick-CB7NlnVZ.js → use-clock-tick-YishFSE2.js} +1 -1
  185. package/dist/client/assets/{use-collections-Cl7KVWNQ.js → use-collections-Bq6tf4lW.js} +1 -1
  186. package/dist/client/assets/use-connection-C0xfUPl-.js +1 -0
  187. package/dist/client/assets/{use-copy-B-pxrD6E.js → use-copy-D7Lvwi_8.js} +1 -1
  188. package/dist/client/assets/{use-create-virtual-mcp-DPkT8FPW.js → use-create-virtual-mcp-CT3JpXjp.js} +1 -1
  189. package/dist/client/assets/{use-debounced-autosave-teletZQd.js → use-debounced-autosave-DnYuRWI8.js} +1 -1
  190. package/dist/client/assets/{use-debounced-value-ChKSUuxz.js → use-debounced-value-LiVhfciY.js} +1 -1
  191. package/dist/client/assets/use-deco-credits-DTpKn8hS.js +1 -0
  192. package/dist/client/assets/{use-decopilot-events-CWf9qNc0.js → use-decopilot-events-42PTdhf1.js} +1 -1
  193. package/dist/client/assets/use-delete-connection-CKLjJrR4.js +1 -0
  194. package/dist/client/assets/{use-deployment-admin-C3JCAXzA.js → use-deployment-admin-Cfv-0c-V.js} +1 -1
  195. package/dist/client/assets/use-file-configs-DRXMLwD-.js +1 -0
  196. package/dist/client/assets/use-infinite-scroll-BkP7H-cz.js +1 -0
  197. package/dist/client/assets/use-join-requests-l1azjTjY.js +1 -0
  198. package/dist/client/assets/{use-mcp-client-Bv8WGceO.js → use-mcp-client-8-W_7yBa.js} +4 -4
  199. package/dist/client/assets/{use-mcp-tools-_p3Gu3UX.js → use-mcp-tools-CUOQhfsg.js} +1 -1
  200. package/dist/client/assets/use-members-CynVAzPM.js +1 -0
  201. package/dist/client/assets/{use-mobile-DhhfLpzh.js → use-mobile-CcO0QCgb.js} +1 -1
  202. package/dist/client/assets/use-navigate-to-agent-DNjmGLp3.js +1 -0
  203. package/dist/client/assets/use-org-auth-client-mw0sCxV3.js +1 -0
  204. package/dist/client/assets/{use-org-sso-DDm0m5Eb.js → use-org-sso-BjHGhVgE.js} +1 -1
  205. package/dist/client/assets/use-organization-roles-Cjha62oV.js +1 -0
  206. package/dist/client/assets/use-organization-settings-B3aKfsZI.js +1 -0
  207. package/dist/client/assets/use-registry-connections-CVi0ypH7.js +1 -0
  208. package/dist/client/assets/use-secrets-C5knhQtS.js +1 -0
  209. package/dist/client/assets/use-status-sounds-C434uotZ.js +1 -0
  210. package/dist/client/assets/{use-view-mode-H6oFviHU.js → use-view-mode-BeALUlwT.js} +1 -1
  211. package/dist/client/assets/use-virtual-mcp-BjiOjpKa.js +1 -0
  212. package/dist/client/assets/useInfiniteQuery-C5v-SAtB.js +1 -0
  213. package/dist/client/assets/{useRouterState-DjtN_ggp.js → useRouterState-BRB-iA8I.js} +1 -1
  214. package/dist/client/assets/useSuspenseInfiniteQuery-BeixZw8P.js +1 -0
  215. package/dist/client/assets/{users-CwhV7o0r.js → users-D2x-LE8o.js} +1 -1
  216. package/dist/client/assets/{variant-calendar-5liHDWH_.js → variant-calendar-BcqsqX_c.js} +1 -1
  217. package/dist/client/assets/{view-mode-toggle-DovE7i8d.js → view-mode-toggle-JDik54gp.js} +1 -1
  218. package/dist/client/index.html +2 -2
  219. package/dist/server/cli.js +1 -1
  220. package/dist/server/server.js +1 -1
  221. package/package.json +1 -1
  222. package/dist/client/assets/agent-icon-dPkJbbXq.js +0 -1
  223. package/dist/client/assets/agents-list-CBbQQUEx.js +0 -1
  224. package/dist/client/assets/ai-providers-CeevjV97.js +0 -1
  225. package/dist/client/assets/auth-entry-Bo3LWJI9.js +0 -1
  226. package/dist/client/assets/automations-DDTM3E3g.js +0 -1
  227. package/dist/client/assets/brand-context-Bkaj5nz3.js +0 -1
  228. package/dist/client/assets/capability-load-error-COzn8-Xb.js +0 -1
  229. package/dist/client/assets/collection-detail-CcnshY5k.js +0 -1
  230. package/dist/client/assets/commerce-onboarding-v6NmdNz5.js +0 -1
  231. package/dist/client/assets/connection-card-CXwWR_5h.js +0 -1
  232. package/dist/client/assets/connection-detail-B_tl4TZx.js +0 -1
  233. package/dist/client/assets/connections-C1NH7yoX.js +0 -1
  234. package/dist/client/assets/dialog-DZtdYFi_.js +0 -1
  235. package/dist/client/assets/domain-settings-C7CfCyw6.js +0 -1
  236. package/dist/client/assets/general-XFvP4tXw.js +0 -1
  237. package/dist/client/assets/github-repo-picker-VDMXf52q.js +0 -1
  238. package/dist/client/assets/index-CEI6wi5Z.js +0 -1
  239. package/dist/client/assets/index-DFCCfX3B.js +0 -1
  240. package/dist/client/assets/index-DKyQrM3l.js +0 -1
  241. package/dist/client/assets/index-DPKpPAQv.js +0 -1
  242. package/dist/client/assets/index-DhnTILyr.css +0 -1
  243. package/dist/client/assets/invite-member-dialog-DV_-RNy8.js +0 -3
  244. package/dist/client/assets/members-BfULkB51.js +0 -1
  245. package/dist/client/assets/page-seo-sheet-CqzS0lEJ.js +0 -1
  246. package/dist/client/assets/profile-Dh73-0Iy.js +0 -1
  247. package/dist/client/assets/project-app-view-KN05BOuo.js +0 -1
  248. package/dist/client/assets/record-editor-BGeMoeUP.js +0 -1
  249. package/dist/client/assets/registry-DGAgXfxF.js +0 -2
  250. package/dist/client/assets/roles-D6vLw9pS.js +0 -1
  251. package/dist/client/assets/secrets-B2rqgV3S.js +0 -1
  252. package/dist/client/assets/settings-layout-CS4A10kE.js +0 -1
  253. package/dist/client/assets/shell-layout-Bi4LjwsI.js +0 -1
  254. package/dist/client/assets/sidebar-DRSu2iBz.js +0 -1
  255. package/dist/client/assets/sso-C6uqUsih.js +0 -1
  256. package/dist/client/assets/store-BZ7eoytz.js +0 -1
  257. package/dist/client/assets/store-registry-DA7t2U9g.js +0 -2
  258. package/dist/client/assets/studio-tools-CTswP4mA.js +0 -1
  259. package/dist/client/assets/tools-list-DyAKlhYk.js +0 -1
  260. package/dist/client/assets/use-ai-providers-D77UFwvU.js +0 -1
  261. package/dist/client/assets/use-automations-WNGih4F_.js +0 -1
  262. package/dist/client/assets/use-capability-DmeYLlad.js +0 -1
  263. package/dist/client/assets/use-connection-CcLotHiI.js +0 -1
  264. package/dist/client/assets/use-deco-credits-1Xd5keqC.js +0 -1
  265. package/dist/client/assets/use-delete-connection-BJuEHINL.js +0 -1
  266. package/dist/client/assets/use-file-configs-G_3bUBDS.js +0 -1
  267. package/dist/client/assets/use-infinite-scroll-BTdf9pFZ.js +0 -1
  268. package/dist/client/assets/use-join-requests-NgN8gue3.js +0 -1
  269. package/dist/client/assets/use-members-eaM3vNiv.js +0 -1
  270. package/dist/client/assets/use-navigate-to-agent-BsdctirU.js +0 -1
  271. package/dist/client/assets/use-org-auth-client-DYoTiK8H.js +0 -1
  272. package/dist/client/assets/use-organization-roles-CcwnCugJ.js +0 -1
  273. package/dist/client/assets/use-organization-settings-C4hP3pVq.js +0 -1
  274. package/dist/client/assets/use-registry-connections-xg-zrNmx.js +0 -1
  275. package/dist/client/assets/use-secrets-CdGKHqA-.js +0 -1
  276. package/dist/client/assets/use-status-sounds-Uz1qdvt2.js +0 -1
  277. package/dist/client/assets/use-virtual-mcp-CMvxAHEJ.js +0 -1
  278. package/dist/client/assets/useInfiniteQuery-BosqZeNZ.js +0 -1
  279. package/dist/client/assets/useSuspenseInfiniteQuery-Dh0QZdLF.js +0 -1
@@ -1 +0,0 @@
1
- import{c as ne,j as s,B as Q,a4 as de,n as fe,a as he,r as q,m as ge,K as te,d as xe,R as $,t as se,l as je}from"./index-CsZhMKFM.js";import{d as W,c as me,a as oe,D as ie}from"./dropdown-menu-C9SSwIby.js";import{a as be}from"./Users03-tGwfKVJc.js";import{a as ue,b as Ce,p as ye,G as we}from"./github-repo-picker-VDMXf52q.js";import{u as _e,b as Ne,c as Se}from"./use-virtual-mcp-CMvxAHEJ.js";import{P as Z}from"./index-DS3hrf0F.js";import{i as ve}from"./DotsVertical-CK1a4mKj.js";import{a as Ie,b as De}from"./Settings02-CS2jOfO5.js";import{s as Ee}from"./Trash01--uX5q_ti.js";import{A as Ae,aC as Te}from"./agent-icon-dPkJbbXq.js";import{c as pe}from"./use-navigate-to-agent-BsdctirU.js";import{C as ke}from"./card-Bc92PJFP.js";import{f as re}from"./formatDistanceToNow-Cb2QZZJn.js";import{u as Le}from"./use-capability-DmeYLlad.js";import{E as Ge}from"./empty-state-DD15-E7x.js";import{u as Oe}from"./use-create-virtual-mcp-DPkT8FPW.js";import{u as Pe}from"./use-connection-CcLotHiI.js";import{u as le}from"./use-mcp-client-Bv8WGceO.js";import{S as ze}from"./constants-CaIX_f5U.js";import{a as Me,f as $e,b as He}from"./github-installations-D2vHSx02.js";import{e as Re,d as Fe,D as Ue,a as Be,c as Ve}from"./dialog-DZtdYFi_.js";import{C as Ke}from"./collection-search-DSP3ov6A.js";import{c as qe,b as Qe,d as Je,A as We,e as Ye,g as Xe,a as Ze,f as et}from"./alert-dialog-Bd5XLC3F.js";import{S as tt}from"./search-input-BREJK7qA.js";import{s as ae}from"./Plus-Cgq7ON9K.js";import"./Check-CcLLJc-z.js";import"./ChevronRight-C3Tgk-3m.js";import"./Circle-C_fdyhr8.js";import"./use-debounced-value-ChKSUuxz.js";import"./authenticate-and-persist-oauth-ClCvWDci.js";import"./mcp-oauth-z9GFPjDo.js";import"./auth-D_bm0-t3.js";import"./use-mcp-tools-_p3Gu3UX.js";import"./extract-connection-data-Di6SAuY0.js";import"./use-collections-Cl7KVWNQ.js";import"./sidebar-DRSu2iBz.js";import"./LayoutLeft-DvNM8qhm.js";import"./use-mobile-DhhfLpzh.js";import"./X-OFSHASit.js";import"./tooltip-Cs5hng3q.js";import"./AlertCircle-BsA2wZmN.js";import"./Tool01-DVCGutKV.js";import"./ArrowUp-CDnEKV2Y.js";import"./Tool02-CSTMjTef.js";import"./XCircle-D3cI1Aep.js";import"./ArrowUpRight-DdPCnlNm.js";import"./TrendUp01-acR-ekUr.js";import"./ZapSquare-Dzb50Gix.js";import"./Loading02-Dx-xiZND.js";import"./CheckCircle-lXciCGfG.js";import"./ChevronDown-BmFaSDo8.js";import"./ChevronUp-Dew3RmKl.js";import"./Stars02-HLp9q8iP.js";import"./Copy01-b3lIb5yu.js";import"./ZoomOut-DYAXxr_v.js";import"./Globe01-B6kdhpV9.js";import"./Eye-DM8bmzm7.js";import"./FilterLines-DCNZa1GS.js";import"./Star01-2DHf7kTZ.js";import"./Globe04-CGLGspo5.js";import"./SwitchHorizontal01-ilLzkPr_.js";import"./HardDrive-CR6Rs-a1.js";import"./Key01-1r4YrQER.js";import"./LinkExternal01-Ck4lryDE.js";import"./List-DfPIAPM_.js";import"./Monitor01-D_DrBwt_.js";import"./Sun-ByaEjJ0N.js";import"./Package-CV2Q9Uup.js";import"./Palette-BY5BmUDa.js";import"./Play-Ci1OqtIO.js";import"./SearchLg-2as_l8YT.js";import"./SearchMd-ZfoTl6vw.js";import"./Shield01-C6TdRfmI.js";import"./Stars01-BEHbN5c3.js";import"./Upload01-BaheeKQP.js";import"./User01-5hu8D3_O.js";import"./Users01-Dh5E4dqf.js";import"./XClose-D5Ra7e-f.js";import"./Zap-CgjpaG4V.js";import"./hooks-GnFkomrq.js";import"./decopilot-sse-pool-CJtSg3wj.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./reusable-new-chat-CouMjkYR.js";import"./differenceInSeconds-NQ4PDo0z.js";function ce(t){const e=ne.c(19),{onCreateFromScratch:i,onImportGitHub:n,onImportDeco:c,isCreating:C,align:y,side:d,showBetaBadge:g}=t,w=y===void 0?"end":y;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(be,{size:14}),e[0]=x):x=e[0];let m;e[1]!==C||e[2]!==i?(m=s.jsxs(W,{disabled:C,onClick:i,children:[x,"Create from scratch"]}),e[1]=C,e[2]=i,e[3]=m):m=e[3];let p;e[4]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(ue,{className:"size-3.5"}),e[4]=p):p=e[4];let l;e[5]!==g?(l=g&&s.jsx("span",{className:"ml-auto text-[10px] font-medium text-muted-foreground bg-muted rounded px-1 py-0.5",children:"Beta"}),e[5]=g,e[6]=l):l=e[6];let f;e[7]!==n||e[8]!==l?(f=s.jsxs(W,{onClick:n,children:[p,"Import from GitHub",l]}),e[7]=n,e[8]=l,e[9]=f):f=e[9];let a;e[10]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"deco.cx",className:"size-3.5"}),e[10]=a):a=e[10];let r;e[11]!==c?(r=s.jsxs(W,{onClick:c,children:[a,"Import from deco.cx"]}),e[11]=c,e[12]=r):r=e[12];let u;return e[13]!==w||e[14]!==d||e[15]!==m||e[16]!==f||e[17]!==r?(u=s.jsxs(me,{side:d,align:w,className:"w-48",children:[m,f,r]}),e[13]=w,e[14]=d,e[15]=m,e[16]=f,e[17]=r,e[18]=u):u=e[18],u}function st(t){const e=ne.c(45),{project:i,lastUsedAt:n,onDeleteClick:c}=t,C=pe();let y;e[0]!==C||e[1]!==i.id?(y=()=>C(i.id),e[0]=C,e[1]=i.id,e[2]=y):y=e[2];let d;e[3]!==i.title||e[4]!==y?(d=s.jsx("button",{type:"button",onClick:y,className:"absolute inset-0 z-0","aria-label":i.title}),e[3]=i.title,e[4]=y,e[5]=d):d=e[5];let g;e[6]!==i.icon||e[7]!==i.title?(g=s.jsx(Ae,{icon:i.icon,name:i.title,size:"sm",className:"shrink-0 shadow-sm"}),e[6]=i.icon,e[7]=i.title,e[8]=g):g=e[8];let w;e[9]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(oe,{asChild:!0,children:s.jsx(Q,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:s.jsx(ve,{size:20})})}),e[9]=w):w=e[9];let x;e[10]!==C||e[11]!==i.id?(x=()=>C(i.id,{search:{main:"settings"}}),e[10]=C,e[11]=i.id,e[12]=x):x=e[12];let m;e[13]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(Ie,{size:16}),e[13]=m):m=e[13];let p;e[14]!==x?(p=s.jsxs(W,{onClick:x,children:[m,"Settings"]}),e[14]=x,e[15]=p):p=e[15];let l;e[16]!==c?(l=c&&s.jsxs(W,{variant:"destructive",onClick:G=>{G.stopPropagation(),c(G)},children:[s.jsx(Ee,{size:16}),"Delete"]}),e[16]=c,e[17]=l):l=e[17];let f;e[18]!==p||e[19]!==l?(f=s.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:s.jsxs(ie,{children:[w,s.jsxs(me,{align:"end",children:[p,l]})]})}),e[18]=p,e[19]=l,e[20]=f):f=e[20];let a;e[21]!==g||e[22]!==f?(a=s.jsxs("div",{className:"flex items-start justify-between",children:[g,f]}),e[21]=g,e[22]=f,e[23]=a):a=e[23];let r;e[24]!==i.title?(r=s.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:i.title}),e[24]=i.title,e[25]=r):r=e[25];const u=i.description||"No description";let I;e[26]!==u?(I=s.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:u}),e[26]=u,e[27]=I):I=e[27];let D;e[28]!==r||e[29]!==I?(D=s.jsxs("div",{className:"flex flex-col gap-1",children:[r,I]}),e[28]=r,e[29]=I,e[30]=D):D=e[30];let _;e[31]!==a||e[32]!==D?(_=s.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[a,D]}),e[31]=a,e[32]=D,e[33]=_):_=e[33];let T;e[34]!==n||e[35]!==i.updated_at?(T=n?`Last used ${re(new Date(n),{addSuffix:!0})}`:`Updated ${re(new Date(i.updated_at),{addSuffix:!0})}`,e[34]=n,e[35]=i.updated_at,e[36]=T):T=e[36];let N;e[37]!==T?(N=s.jsx("div",{className:"border-t border-border mt-auto",children:s.jsx("div",{className:"h-10 flex items-center px-4.5",children:s.jsx("p",{className:"text-xs text-muted-foreground",children:T})})}),e[37]=T,e[38]=N):N=e[38];let k;e[39]!==_||e[40]!==N?(k=s.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[_,N]}),e[39]=_,e[40]=N,e[41]=k):k=e[41];let S;return e[42]!==k||e[43]!==d?(S=s.jsxs(ke,{className:"relative transition-colors group overflow-hidden flex flex-col h-full hover:bg-muted/50",children:[d,k]}),e[42]=k,e[43]=d,e[44]=S):S=e[44],S}const ot="deco-sites";function it(t){if(!t||typeof t!="object")return null;const e=t.github;if(!e||typeof e!="object")return null;const i=e.owner,n=e.repo;return typeof i!="string"||typeof n!="string"||i.length===0||n.length===0?null:{owner:i,repo:n}}function nt(t,e){const i=e?it(e):null,n=i?.owner??ot,c=i?.repo??t;return{owner:n,name:c,url:`https://github.com/${n}/${c}`}}function rt(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}async function lt(t){const e=await fetch(`/api/${t}/deco-sites`);if(!e.ok){const i=await e.json().catch(()=>({}));throw new Error(i.error??`Failed to load sites (${e.status})`)}return e.json()}function at({open:t,onOpenChange:e,onBack:i}){const{org:n}=de(),c=pe(),C=fe(),{data:y}=he.useSession(),[d,g]=q.useState(null),[w,x]=q.useState(null),[m,p]=q.useState(""),l=le({connectionId:ze,orgId:n.id,orgSlug:n.slug}),f=Pe({slug:"mcp-github"}),a=Me(f),r=Ce({enabled:t&&a.length===0}),u=a.length===1?a[0]??null:w,I=a.length>1&&!u,D=le({connectionId:u?.id??"",orgId:n.id,orgSlug:n.slug}),_=t&&a.length===0&&(r.status==="installing"||r.status==="authenticating"||r.status==="idle"),{data:T,isLoading:N,error:k}=ge({queryKey:te.decoSites(y?.user?.email),queryFn:()=>lt(n.slug),enabled:t&&!!y?.user?.email,staleTime:6e4,retry:!1}),S=T?.sites??[],G=o=>{o||(g(null),x(null),p("")),e(o)},P=S.filter(o=>o.name.toLowerCase().includes(m.toLowerCase())||(o.domains?.[0]?.domain?.toLowerCase().includes(m.toLowerCase())??!1)),R=!d||P.some(o=>o.name===d),O=xe({mutationFn:async o=>{if(!u)throw new Error("GitHub is not connected. Complete GitHub setup and try again.");$("deco_site_import_started",{site_name:o});const{installations:L,appSlug:v}=await $e(b=>l.callTool(b),u.id),E=S.find(b=>b.name===o);if(!E)throw new Error("Selected site is no longer available");const j=nt(o,E.metadata),z=He(L,j.owner);if(!z){const b=v?`https://github.com/apps/${v}/installations/new`:"https://github.com/settings/installations";throw new Error(`Install the GitHub App on the "${j.owner}" organization to import this site. ${b}`)}let V=null,F=null,U=null;const J=async()=>{U&&await l.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:U}}).catch(()=>{}),F&&await l.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:F,force:!0}}).catch(()=>{}),V&&await l.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:V,force:!0}}).catch(()=>{})};try{const b=await fetch(`/api/${n.slug}/deco-sites/connection`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({siteName:o})}),B=await b.json().catch(()=>({}));if(!b.ok)throw new Error(B.error??`Failed to create connection (${b.status})`);const A=B.connId;if(!A)throw new Error("Server did not return a connection ID");V=A;const{childConnectionId:M}=await ye({orgSlug:n.slug,sourceConnection:u,installationId:z.installationId,owner:j.owner,repo:j.name,githubCallTool:ee=>D.callTool(ee),selfCallTool:ee=>l.callTool(ee)});F=M;const H=B.icon??null,K=rt(o),h=o.toLowerCase(),Y=await l.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:o,description:"Imported from deco.cx",pinned:!1,icon:H??null,subtype:"project",metadata:{instructions:null,enabled_plugins:[],siteSlug:h,githubRepo:{owner:j.owner,name:j.name,url:j.url,installationId:z.installationId,connectionId:M},ui:{banner:null,bannerColor:"#22C55E",icon:H,themeColor:"#22C55E",slug:K,pinnedViews:[{connectionId:A,toolName:"fetch_assets",label:"Assets",icon:null},{connectionId:A,toolName:"get_monitor_data",label:"Monitor",icon:null}],layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}},connections:[{connection_id:A},{connection_id:M}]}}}),X=Y.structuredContent??Y;if(!X.item?.id)throw new Error("Failed to create the imported agent");return U=X.item.id,{slug:K,virtualMcpId:X.item.id,connId:A,item:X.item}}catch(b){throw await J(),b}},onSuccess:({slug:o,virtualMcpId:L,item:v})=>{$("deco_site_import_succeeded",{site_name:v.title,virtual_mcp_id:L,slug:o}),C.setQueryData(te.collectionItem(l,n.id,"","VIRTUAL_MCP",L),{item:v}),C.invalidateQueries({predicate:E=>{const j=E.queryKey;return j[1]===n.id&&j[3]==="collection"&&j[4]==="VIRTUAL_MCP"}}),C.invalidateQueries({queryKey:te.projects(n.id)}),se.success(`Imported ${o} from deco.cx`),G(!1),localStorage.setItem("mesh:sidebar-open",JSON.stringify(!1)),c(L)},onError:o=>{$("deco_site_import_failed",{error:o instanceof Error?o.message:"Unknown error"}),se.error("Import failed: "+(o instanceof Error?o.message:"Unknown error"))}});return s.jsx(Re,{open:t,onOpenChange:G,children:s.jsxs(Fe,{className:"sm:max-w-[900px] p-0 gap-0 overflow-hidden",children:[s.jsx(Ue,{className:"sr-only",children:s.jsx(Be,{children:"Import from deco.cx"})}),s.jsxs("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3",children:[i&&s.jsx("button",{type:"button",onClick:i,className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors","aria-label":"Go back",children:s.jsx(De,{size:18})}),s.jsx("span",{className:"text-sm font-medium text-foreground",children:"Import from deco.cx"})]}),s.jsx("div",{children:s.jsx(Ke,{value:m,onChange:p,placeholder:"Search sites...",onKeyDown:o=>{o.key==="Escape"&&p("")}})}),s.jsxs("div",{className:"pb-0 min-h-[300px]",children:[r.status==="error"&&s.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 h-48 px-8 text-center",children:[s.jsx("p",{className:"text-sm text-destructive",children:r.error??"Failed to connect GitHub"}),s.jsx(Q,{variant:"outline",size:"sm",onClick:r.retry,children:"Retry GitHub setup"})]}),_&&r.status!=="error"&&s.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:"Setting up GitHub connection..."}),I&&!_&&r.status!=="error"&&s.jsxs("div",{className:"flex flex-col py-2",children:[s.jsx("div",{className:"px-8 py-2",children:s.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Select a GitHub connection"})}),a.map(o=>s.jsxs("button",{type:"button",onClick:()=>x(o),className:"flex items-center gap-3 px-8 py-3 hover:bg-accent transition-colors text-left",children:[o.icon?s.jsx("img",{src:o.icon,alt:o.title,className:"size-7 rounded-full shrink-0"}):s.jsx("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:s.jsx(ue,{className:"size-3.5 text-muted-foreground"})}),s.jsx("span",{className:"text-sm font-medium",children:o.title})]},o.id))]}),N&&!_&&r.status!=="error"&&s.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:"Loading sites..."}),!N&&!_&&!I&&r.status!=="error"&&!k&&S.length===0&&s.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:"No sites found for this account."}),!N&&!_&&!I&&r.status!=="error"&&S.length>0&&s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4 max-h-[420px] overflow-y-auto py-4 px-8 [scrollbar-gutter:stable]",children:[P.length===0&&s.jsxs("p",{className:"col-span-3 text-sm text-muted-foreground text-center py-8",children:["No sites match “",m,"”"]}),P.map(o=>{const L=o.domains?.find(E=>E.production)?.domain??o.domains?.[0]?.domain,v=d===o.name;return s.jsxs("button",{type:"button",onClick:()=>g(o.name),className:je("flex flex-col rounded-xl border overflow-hidden text-left transition-all cursor-pointer",v?"border-primary ring-1 ring-primary":"border-border hover:border-muted-foreground/40"),children:[s.jsx("div",{className:"w-full aspect-video bg-muted overflow-hidden",children:o.thumb_url?s.jsx("img",{src:o.thumb_url,alt:o.name,className:"w-full h-full object-cover",loading:"lazy"}):s.jsx("div",{className:"w-full h-full bg-muted"})}),s.jsxs("div",{className:"px-4 py-3",children:[s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:o.name}),L&&s.jsx("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:L})]})]},o.name)})]})]}),s.jsxs(Ve,{className:"px-8 py-5 border-t border-border",children:[s.jsx(Q,{variant:"outline",onClick:()=>G(!1),disabled:O.isPending,children:"Cancel"}),s.jsx(Q,{disabled:!d||!R||O.isPending||N||_||I||!u||r.status==="error",onClick:()=>d&&O.mutate(d),children:O.isPending?"Importing...":"Import"})]})]})})}function Rs(){const t=ne.c(46),{org:e}=de(),i=_e(),n=Ne(),[c,C]=q.useState("");let y;t[0]===Symbol.for("react.memo_cache_sentinel")?(y={navigateOnCreate:!0},t[0]=y):y=t[0];const{createVirtualMCP:d,isCreating:g}=Oe(y),[w,x]=q.useState(null),[m,p]=q.useState(!1),[l,f]=q.useState(!1),{granted:a}=Le("agents:manage"),r=c.toLowerCase(),u=i.filter(h=>h.id!==e.id&&(h.title.toLowerCase().includes(r)||h.description?.toLowerCase().includes(r))),{data:I}=Se(u.map(ct));let D;t[1]!==n||t[2]!==w?(D=async()=>{if(!w)return;const{id:h,title:Y}=w;x(null);try{await n.delete.mutateAsync(h),$("agent_deleted",{agent_id:h,source:"agents_list"}),se.success(`Deleted "${Y}"`)}catch{}},t[1]=n,t[2]=w,t[3]=D):D=t[3];const _=D,T=Z,N=Z,k=Z;let S;t[4]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(Z.Title,{children:"Agents"}),t[4]=S):S=t[4];let G;t[5]===Symbol.for("react.memo_cache_sentinel")?(G=h=>{h.key==="Escape"&&(C(""),h.target.blur())},t[5]=G):G=t[5];let P;t[6]!==c?(P=s.jsx(tt,{value:c,onChange:C,placeholder:"Search for an agent...",className:"w-full md:w-[375px]",onKeyDown:G}),t[6]=c,t[7]=P):P=t[7];let R;t[8]!==a||t[9]!==d||t[10]!==g?(R=a&&s.jsxs(ie,{children:[s.jsx(oe,{asChild:!0,children:s.jsxs(Q,{size:"sm",children:[s.jsx(ae,{size:14}),"Create Agent"]})}),s.jsx(ce,{onCreateFromScratch:()=>{$("agent_create_clicked",{source:"agents_list",method:"scratch"}),d()},onImportGitHub:()=>{$("agent_create_clicked",{source:"agents_list",method:"github"}),f(!0)},onImportDeco:()=>{$("agent_create_clicked",{source:"agents_list",method:"deco"}),p(!0)},isCreating:g,align:"end"})]}),t[8]=a,t[9]=d,t[10]=g,t[11]=R):R=t[11];let O;t[12]!==P||t[13]!==R?(O=s.jsxs("div",{className:"flex flex-col gap-6",children:[S,s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[P,R]})]}),t[12]=P,t[13]=R,t[14]=O):O=t[14];const o=u.length===0&&s.jsx("div",{className:"flex items-center justify-center py-20",children:s.jsx(Ge,{image:s.jsx(Te,{size:48,className:"text-muted-foreground"}),title:c?"No agents found":"No agents yet",description:c?`No agents match "${c}"`:a?"Create an agent to get started.":"Ask an organization admin to create one.",actions:!c&&a&&s.jsxs(ie,{children:[s.jsx(oe,{asChild:!0,children:s.jsxs(Q,{size:"sm",children:[s.jsx(ae,{size:14}),"Create Agent"]})}),s.jsx(ce,{onCreateFromScratch:()=>{$("agent_create_clicked",{source:"agents_list_empty",method:"scratch"}),d()},onImportGitHub:()=>{$("agent_create_clicked",{source:"agents_list_empty",method:"github"}),f(!0)},onImportDeco:()=>{$("agent_create_clicked",{source:"agents_list_empty",method:"deco"}),p(!0)},isCreating:g,align:"center",showBetaBadge:!0})]})})}),L=u.length>0&&s.jsxs("div",{className:"mt-6 @container",children:[s.jsx("h3",{className:"text-sm font-medium text-muted-foreground mb-3",children:"Agents"}),s.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:u.map(h=>s.jsx(st,{project:h,lastUsedAt:I?.get(h.id)?.last_used_at,onDeleteClick:a?()=>x({id:h.id,title:h.title}):void 0},h.id))})]});let v;t[15]!==L||t[16]!==k.Body||t[17]!==O||t[18]!==o?(v=s.jsxs(k.Body,{children:[O,o,L]}),t[15]=L,t[16]=k.Body,t[17]=O,t[18]=o,t[19]=v):v=t[19];let E;t[20]!==v||t[21]!==N.Content?(E=s.jsx(N.Content,{children:v}),t[20]=v,t[21]=N.Content,t[22]=E):E=t[22];let j;t[23]!==l?(j=s.jsx(we,{open:l,onOpenChange:f}),t[23]=l,t[24]=j):j=t[24];let z;t[25]!==m?(z=s.jsx(at,{open:m,onOpenChange:p}),t[25]=m,t[26]=z):z=t[26];const V=!!w;let F;t[27]===Symbol.for("react.memo_cache_sentinel")?(F=h=>!h&&x(null),t[27]=F):F=t[27];let U;t[28]===Symbol.for("react.memo_cache_sentinel")?(U=s.jsx(qe,{children:"Delete Agent?"}),t[28]=U):U=t[28];const J=w?.title;let b;t[29]!==J?(b=s.jsxs(Qe,{children:[U,s.jsxs(Je,{children:["This action cannot be undone. This will permanently delete"," ",s.jsx("span",{className:"font-medium text-foreground",children:J}),"."]})]}),t[29]=J,t[30]=b):b=t[30];let B;t[31]===Symbol.for("react.memo_cache_sentinel")?(B=s.jsx(We,{children:"Cancel"}),t[31]=B):B=t[31];let A;t[32]!==_?(A=s.jsxs(Ye,{children:[B,s.jsx(Xe,{onClick:_,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),t[32]=_,t[33]=A):A=t[33];let M;t[34]!==b||t[35]!==A?(M=s.jsxs(Ze,{children:[b,A]}),t[34]=b,t[35]=A,t[36]=M):M=t[36];let H;t[37]!==V||t[38]!==M?(H=s.jsx(et,{open:V,onOpenChange:F,children:M}),t[37]=V,t[38]=M,t[39]=H):H=t[39];let K;return t[40]!==T||t[41]!==E||t[42]!==j||t[43]!==z||t[44]!==H?(K=s.jsxs(T,{children:[E,j,z,H]}),t[40]=T,t[41]=E,t[42]=j,t[43]=z,t[44]=H,t[45]=K):K=t[45],K}function ct(t){return t.id}export{Rs as default};
@@ -1 +0,0 @@
1
- import{H as B,I as N,ab as ae,ad as le,ae as he,ac as xe,b2 as me,c as U,J as ge,M as be,r as M,j as s,af as Ee,t as G,aK as ye,a4 as re,n as oe,d as J,K as Q,m as ve,l as ue,B as V,R as je,U as Re}from"./index-CsZhMKFM.js";import{i as $e}from"./AlertCircle-BsA2wZmN.js";import{P as te}from"./index-DS3hrf0F.js";import{S as ne}from"./skeleton-BZzqWIif.js";import{b as _e,a as ce,S as de,c as Fe}from"./settings-section-BYCtjEaG.js";import{u as X,a as se,b as Se}from"./use-ai-providers-D77UFwvU.js";import{i as Me}from"./CheckCircle-lXciCGfG.js";import{n as Oe,o as Te,q as Ue,S as ze}from"./chat-context-Awe2cIoY.js";import{g as qe,h as Le}from"./use-organization-settings-C4hP3pVq.js";import{M as Ve,O as ke,P as Be,C as pe}from"./select-model-Cg3FzUNI.js";import{u as Qe}from"./use-debounced-autosave-teletZQd.js";import{I as ie}from"./input-D5ccsU_1.js";import{T as fe,a as Ge}from"./toggle-group-DkGsY2u-.js";import{b as Ie,c as Ce,d as Ne,A as Pe,a as we,e as De,g as Ae,f as Ke}from"./alert-dialog-Bd5XLC3F.js";import{u as H}from"./studio-tools-CTswP4mA.js";import{s as Ye}from"./Plus-Cgq7ON9K.js";import{c as We}from"./Tool01-DVCGutKV.js";import{s as He}from"./Trash01--uX5q_ti.js";import{A as Je}from"./avatar-DOYkgu8W.js";import{i as Xe}from"./Settings02-CS2jOfO5.js";import{s as Ze}from"./Eye-DM8bmzm7.js";import{c as et,D as tt,a as st,d as it,e as rt}from"./dialog-DZtdYFi_.js";import{f as ot}from"./formatDistanceToNow-Cb2QZZJn.js";import{R as lt}from"./require-capability-BjscC7QS.js";import"./sidebar-DRSu2iBz.js";import"./LayoutLeft-DvNM8qhm.js";import"./use-mobile-DhhfLpzh.js";import"./X-OFSHASit.js";import"./tooltip-Cs5hng3q.js";import"./card-Bc92PJFP.js";import"./ArrowUpRight-DdPCnlNm.js";import"./autosend-qB5BaOSA.js";import"./hooks-GnFkomrq.js";import"./use-mcp-client-Bv8WGceO.js";import"./constants-CaIX_f5U.js";import"./auth-D_bm0-t3.js";import"./decopilot-sse-pool-CJtSg3wj.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-CMvxAHEJ.js";import"./use-collections-Cl7KVWNQ.js";import"./use-decopilot-events-CWf9qNc0.js";import"./tab-id-bb-jjgGv.js";import"./drawer-Ck_Oak77.js";import"./checkbox-B-y-IHdE.js";import"./Check-CcLLJc-z.js";import"./select-CVMXwLRV.js";import"./ChevronDown-BmFaSDo8.js";import"./ChevronUp-Dew3RmKl.js";import"./Key01-1r4YrQER.js";import"./SearchMd-ZfoTl6vw.js";import"./ai-providers-logos-DD3qZ33J.js";import"./Monitor01-D_DrBwt_.js";import"./ChevronRight-C3Tgk-3m.js";import"./connect-desktop-dialog-DiutLBhU.js";import"./Copy01-b3lIb5yu.js";import"./Stars01-BEHbN5c3.js";import"./User01-5hu8D3_O.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-capability-DmeYLlad.js";import"./access-gate-B4XS-sin.js";import"./capability-load-error-COzn8-Xb.js";B({title:N(),url:N(),icon:N()});B({registries:le(N(),B({enabled:he()})).describe("Per-registry enabled/disabled state. Key is connection ID. Absent registries are treated as enabled."),blockedMcps:ae(N()).describe("List of MCP app_name or app_id values to hide from the store.")});const W=B({keyId:N(),modelId:N(),title:N().optional()}).nullable();xe(["fast","smart","thinking","image","web_search","deep_research"]);xe(["fast","smart","thinking"]);const at=B({tiers:B({fast:W,smart:W,thinking:W,image:W,web_search:W,deep_research:W})});B({ids:ae(N()).describe("Ordered list of custom virtual MCP agent ids to show on the home view.")});B({id:N().describe("Brand context ID"),name:N().describe("Company name"),domain:N().describe("Company domain (e.g. example.com)"),overview:N().describe("Company overview / description"),logo:N().nullable().optional().describe("Logo URL"),favicon:N().nullable().optional().describe("Favicon URL"),ogImage:N().nullable().optional().describe("OG image URL"),fonts:B({heading:N().optional().describe("Font family for headings"),body:N().optional().describe("Font family for body text"),code:N().optional().describe("Font family for code / monospace")}).nullable().optional().describe("Font families by semantic role"),colors:B({primary:N().optional().describe("Primary brand color (hex)"),secondary:N().optional().describe("Secondary brand color (hex)"),accent:N().optional().describe("Accent / highlight color (hex)"),background:N().optional().describe("Background color (hex)"),foreground:N().optional().describe("Foreground / text color (hex)")}).nullable().optional().describe("Semantic color palette"),images:ae(le(N(),me())).nullable().optional().describe("Brand images"),metadata:le(N(),me()).nullable().optional().describe("Extra design tokens (typography, components, spacing, layout, tone, etc.)"),archivedAt:N().nullable().optional().describe("Archive timestamp (null to unarchive)"),isDefault:he().optional().describe("Whether this is the default brand for the organization")});const nt=e=>e.capabilities?.includes("image")===!0,ct=e=>Oe(e),dt=e=>Te(e),mt=[{key:"fast",label:"Fast",description:"Fastest responses, best for quick tasks",filter:void 0},{key:"smart",label:"Smart",description:"Balanced speed and capability",filter:void 0},{key:"thinking",label:"Thinking",description:"Most capable, best for complex tasks",filter:void 0},{key:"image",label:"Image",description:"Image generation",filter:nt},{key:"web_search",label:"Web search",description:"Quick, up-to-date answers from the web",filter:ct},{key:"deep_research",label:"Deep research",description:"In-depth, multi-source research reports",filter:dt}];function ut(e){const t=U.c(20),{slot:i,onSlotChange:a,filterModels:r,defaultKeyId:l}=e,o=X(),[x,S]=M.useState(i?.keyId??l);let b;t[0]!==i?(b=()=>{i?.keyId&&S(i.keyId)},t[0]=i,t[1]=b):b=t[1];const d=i?.keyId;let n;t[2]!==d?(n=[d],t[2]=d,t[3]=n):n=t[3],M.useEffect(b,n);const m=x??l;let c;t[4]!==m||t[5]!==o?(c=m?o.find(y=>y.id===m):null,t[4]=m,t[5]=o,t[6]=c):c=t[6];const u=c,{models:g,isLoading:j}=se(r?m??void 0:void 0),_=r?j||g.some(r):!0;let p;t[7]!==i||t[8]!==u?.providerId?(p=i?{modelId:i.modelId,title:i.title??i.modelId,keyId:i.keyId,providerId:u?.providerId??"deco",description:null,logo:null,capabilities:[],limits:null,costs:null}:null,t[7]=i,t[8]=u?.providerId,t[9]=p):p=t[9];const k=p;if(r&&!_){let y;return t[10]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx("p",{className:"text-xs text-muted-foreground italic",children:"Not available with current provider"}),t[10]=y):y=t[10],y}let I;t[11]===Symbol.for("react.memo_cache_sentinel")?(I=y=>S(y),t[11]=I):I=t[11];let h;t[12]!==m||t[13]!==a?(h=y=>{const $=y.keyId??m??"";S($),a({keyId:$,modelId:y.modelId,title:y.title})},t[12]=m,t[13]=a,t[14]=h):h=t[14];let f;return t[15]!==m||t[16]!==r||t[17]!==k||t[18]!==h?(f=s.jsx(Ve,{variant:"bordered",placeholder:"Pick model",model:k,credentialId:m,filterModels:r,onCredentialChange:I,onModelChange:h}),t[15]=m,t[16]=r,t[17]=k,t[18]=h,t[19]=f):f=t[19],f}function pt(e){const t=U.c(2),{isPending:i,showSaved:a}=e;if(i){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[s.jsx(ye,{size:12,className:"animate-spin"}),"Saving…"]}),t[0]=r):r=t[0],r}if(a){let r;return t[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[s.jsx(Me,{size:12}),"Saved"]}),t[1]=r):r=t[1],r}return null}function ft(){const e=U.c(42),t=X(),i=qe(),a=t.length>0;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=ge(at),e[0]=r):r=e[0];let l;e[1]!==i?(l={resolver:r,values:i,mode:"onChange"},e[1]=i,e[2]=l):l=e[2];const o=be(l),{mutate:x,isPending:S,isSuccess:b}=Le(),d=o.formState.isDirty;let n;e[3]!==o||e[4]!==i||e[5]!==x?(n={delayMs:250,save:async()=>{const v=o.getValues();x(v,{onSuccess:()=>o.reset(v,{keepValues:!0}),onError:w=>{o.reset(i),G.error(`Failed to save: ${w.message}`)}})}},e[3]=o,e[4]=i,e[5]=x,e[6]=n):n=e[6];const{schedule:m}=Qe(n),c=t[0],u=t[1],g=t[2],{models:j}=se(c?.id),{models:_}=se(u?.id),{models:p}=se(g?.id);let k,I;e[7]!==o||e[8]!==a?(k=()=>{a||o.reset({tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}})},I=[a,o],e[7]=o,e[8]=a,e[9]=k,e[10]=I):(k=e[9],I=e[10]),M.useEffect(k,I);let h;e[11]!==t||e[12]!==o||e[13]!==c||e[14]!==u||e[15]!==g||e[16]!==j||e[17]!==_||e[18]!==p?(h=()=>{const v=o.getValues(),w=new Set(t.map(ht)),R={};c?.id&&(R[c.id]=j),u?.id&&(R[u.id]=_),g?.id&&(R[g.id]=p);const P=Y=>Y!=null&&!w.has(Y.keyId),C={fast:P(v.tiers.fast)?null:v.tiers.fast,smart:P(v.tiers.smart)?null:v.tiers.smart,thinking:P(v.tiers.thinking)?null:v.tiers.thinking,image:P(v.tiers.image)?null:v.tiers.image,web_search:P(v.tiers.web_search)?null:v.tiers.web_search,deep_research:P(v.tiers.deep_research)?null:v.tiers.deep_research},q=!C.fast||!C.smart||!C.thinking||!C.image||!C.web_search||!C.deep_research,z=C.fast===v.tiers.fast&&C.smart===v.tiers.smart&&C.thinking===v.tiers.thinking&&C.image===v.tiers.image&&C.web_search===v.tiers.web_search&&C.deep_research===v.tiers.deep_research;if(!q&&z)return;const L=Ue(t,R);o.reset({tiers:{fast:C.fast??L.chat.fast,smart:C.smart??L.chat.smart,thinking:C.thinking??L.chat.thinking,image:C.image??L.image,web_search:C.web_search??L.webSearch,deep_research:C.deep_research??L.deepResearch}},{keepDirty:!0})},e[11]=t,e[12]=o,e[13]=c,e[14]=u,e[15]=g,e[16]=j,e[17]=_,e[18]=p,e[19]=h):h=e[19];const f=c?.id,y=u?.id,$=g?.id;let O;e[20]!==t||e[21]!==o||e[22]!==j||e[23]!==_||e[24]!==p||e[25]!==f||e[26]!==y||e[27]!==$?(O=[o,t,j,_,p,f,y,$],e[20]=t,e[21]=o,e[22]=j,e[23]=_,e[24]=p,e[25]=f,e[26]=y,e[27]=$,e[28]=O):O=e[28],M.useEffect(h,O);let T;e[29]===Symbol.for("react.memo_cache_sentinel")?(T=s.jsx("p",{className:"text-sm text-muted-foreground",children:"These models power chat, automations, and tools across your organization."}),e[29]=T):T=e[29];const F=b&&!d;let D;e[30]!==S||e[31]!==F?(D=s.jsxs("div",{className:"flex items-center justify-between -mt-2 mb-2",children:[T,s.jsx(pt,{isPending:S,showSaved:F})]}),e[30]=S,e[31]=F,e[32]=D):D=e[32];let A;e[33]!==t[0]?.id||e[34]!==o.control||e[35]!==m?(A=mt.map(v=>s.jsx(Ee,{control:o.control,name:`tiers.${v.key}`,render:w=>{const{field:R}=w;return s.jsx(_e,{title:v.label,description:v.description,action:s.jsx(ut,{slot:R.value,defaultKeyId:t[0]?.id??null,filterModels:v.filter,onSlotChange:P=>{R.onChange(P),m()}})})}},v.key)),e[33]=t[0]?.id,e[34]=o.control,e[35]=m,e[36]=A):A=e[36];let K;e[37]!==A?(K=s.jsx(ce,{children:A}),e[37]=A,e[38]=K):K=e[38];let E;return e[39]!==D||e[40]!==K?(E=s.jsxs(de,{title:"Default models",headerClassName:"pl-0",children:[D,K]}),e[39]=D,e[40]=K,e[41]=E):E=e[41],E}function ht(e){return e.id}const xt={usd:[10,20,100],brl:[50,100,500]};function gt(){const e=U.c(26),t=H(),[i,a]=M.useState(!1),{mutate:r,isPending:l}=J({mutationFn:async h=>{const{url:f}=await t.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:h,currency:d});return f},onSuccess:yt,onError:bt}),[o,x]=M.useState(""),[S,b]=M.useState("usd"),d=S,n=parseFloat(o),m=!isNaN(n)&&n>=1,c=d==="brl"?"R$":"$";let u;e[0]!==b?(u=h=>{h&&b(h)},e[0]=b,e[1]=u):u=e[1];let g,j;e[2]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(fe,{value:"usd",className:"px-3.5 text-sm",children:"USD"}),j=s.jsx(fe,{value:"brl",className:"px-3.5 text-sm",children:"BRL"}),e[2]=g,e[3]=j):(g=e[2],j=e[3]);let _;e[4]!==d||e[5]!==u?(_=s.jsxs(Ge,{type:"single",variant:"outline",size:"default",value:d,onValueChange:u,children:[g,j]}),e[4]=d,e[5]=u,e[6]=_):_=e[6];let p;e[7]!==d||e[8]!==c||e[9]!==i||e[10]!==l||e[11]!==r?(p=!i&&s.jsxs(s.Fragment,{children:[xt[d].map(h=>s.jsxs(V,{variant:"outline",className:"h-10 px-4 text-sm font-medium tabular-nums",disabled:l,onClick:()=>r(h*100),children:[c,h]},h)),s.jsx(V,{variant:"ghost",className:"h-10 px-4 text-sm text-muted-foreground",onClick:()=>a(!0),disabled:l,children:"Custom"})]}),e[7]=d,e[8]=c,e[9]=i,e[10]=l,e[11]=r,e[12]=p):p=e[12];let k;e[13]!==c||e[14]!==o||e[15]!==n||e[16]!==i||e[17]!==m||e[18]!==l||e[19]!==x||e[20]!==r?(k=i&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"relative max-w-[140px]",children:[s.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground select-none",children:c}),s.jsx(ie,{type:"number",min:"1",step:"1",placeholder:"50",value:o,onChange:h=>x(h.target.value),className:"h-10 text-sm pl-7",autoFocus:!0})]}),s.jsx(V,{className:"h-10",disabled:!m||l,onClick:()=>r(Math.round(n*100)),children:l?"...":"Add"}),s.jsx(V,{variant:"ghost",className:"h-10 text-sm text-muted-foreground",onClick:()=>{a(!1),x("")},children:"Cancel"})]}),e[13]=c,e[14]=o,e[15]=n,e[16]=i,e[17]=m,e[18]=l,e[19]=x,e[20]=r,e[21]=k):k=e[21];let I;return e[22]!==_||e[23]!==p||e[24]!==k?(I=s.jsx("div",{className:"flex flex-col gap-2.5",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[_,p,k]})}),e[22]=_,e[23]=p,e[24]=k,e[25]=I):I=e[25],I}function bt(e){G.error(`Top-up failed: ${e.message}`)}function yt(e){e&&window.open(e,"_blank","noopener,noreferrer")}function vt(e){return e<=0?"text-destructive":e<=1?"text-amber-500 dark:text-amber-400":"text-foreground"}function jt(){const e=U.c(58),{org:t}=re(),i=H(),a=oe(),r=X();let l;e[0]!==r?(l=r.find(St),e[0]=r,e[1]=l):l=e[1];const o=l,[x,S]=M.useState(!1);let b;e[2]!==o||e[3]!==i?(b=async()=>{o&&await i.call("AI_PROVIDER_KEY_DELETE",{keyId:o.id})},e[2]=o,e[3]=i,e[4]=b):b=e[4];let d;e[5]!==t.id||e[6]!==a?(d=()=>{a.invalidateQueries({queryKey:Q.aiProviderKeys(t.id)}),a.invalidateQueries({queryKey:Q.aiProviders(t.id)}),G.success("Deco AI Gateway disconnected"),S(!1)},e[5]=t.id,e[6]=a,e[7]=d):d=e[7];let n;e[8]!==b||e[9]!==d?(n={mutationFn:b,onSuccess:d,onError:_t},e[8]=b,e[9]=d,e[10]=n):n=e[10];const{mutate:m,isPending:c}=J(n);let u;e[11]!==t.id?(u=Q.aiProviderCredits(t.id,"deco"),e[11]=t.id,e[12]=u):u=e[12];const g=!!o;let j;e[13]!==i?(j=async()=>{try{return await i.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}},e[13]=i,e[14]=j):j=e[14];let _;e[15]!==u||e[16]!==g||e[17]!==j?(_={queryKey:u,enabled:g,staleTime:6e4,queryFn:j},e[15]=u,e[16]=g,e[17]=j,e[18]=_):_=e[18];const{data:p,isLoading:k,refetch:I,isFetching:h}=ve(_);if(!o)return null;const f=p?.balanceCents!=null?p.balanceCents/100:null;let y;e[19]!==f?(y=f!=null?`$${f.toFixed(2)}`:"—",e[19]=f,e[20]=y):y=e[20];const $=y;let O;e[21]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"Deco AI Gateway",className:"size-9 rounded-lg object-contain dark:bg-white dark:p-0.5"}),s.jsx("div",{children:s.jsx("p",{className:"text-xs text-muted-foreground",children:"Access to 100+ models"})})]}),e[21]=O):O=e[21];let T;e[22]===Symbol.for("react.memo_cache_sentinel")?(T=()=>S(!0),e[22]=T):T=e[22];let F;e[23]!==c?(F=s.jsxs("div",{className:"flex items-center justify-between",children:[O,s.jsx(V,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground hover:text-destructive",onClick:T,disabled:c,children:"Disconnect"})]}),e[23]=c,e[24]=F):F=e[24];let D;e[25]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsxs(Ie,{children:[s.jsx(Ce,{children:"Disconnect Deco AI Gateway"}),s.jsx(Ne,{children:"This will remove the Deco AI Gateway from this workspace. Your credit balance is preserved and will be available if you reconnect."})]}),e[25]=D):D=e[25];let A;e[26]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(Pe,{children:"Cancel"}),e[26]=A):A=e[26];let K;e[27]!==m?(K=s.jsxs(we,{children:[D,s.jsxs(De,{children:[A,s.jsx(Ae,{onClick:()=>m(),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Disconnect"})]})]}),e[27]=m,e[28]=K):K=e[28];let E;e[29]!==x||e[30]!==K?(E=s.jsx(Ke,{open:x,onOpenChange:S,children:K}),e[29]=x,e[30]=K,e[31]=E):E=e[31];let v;e[32]!==f||e[33]!==$||e[34]!==h||e[35]!==k?(v=k||h?s.jsx(ne,{className:"h-9 w-24"}):s.jsx("span",{className:ue("text-3xl font-semibold tabular-nums tracking-tight",f!=null&&vt(f)),children:$}),e[32]=f,e[33]=$,e[34]=h,e[35]=k,e[36]=v):v=e[36];let w;e[37]!==I?(w=()=>I(),e[37]=I,e[38]=w):w=e[38];const R=h&&"animate-spin";let P;e[39]!==R?(P=ue(R),e[39]=R,e[40]=P):P=e[40];let C;e[41]!==P?(C=s.jsx(ye,{size:14,className:P}),e[41]=P,e[42]=C):C=e[42];let q;e[43]!==h||e[44]!==w||e[45]!==C?(q=s.jsx("button",{type:"button",onClick:w,disabled:h,className:"text-muted-foreground hover:text-foreground disabled:opacity-50 transition-colors p-1 rounded-md hover:bg-muted/50","aria-label":"Refresh balance",children:C}),e[43]=h,e[44]=w,e[45]=C,e[46]=q):q=e[46];let z;e[47]!==v||e[48]!==q?(z=s.jsxs("div",{className:"flex items-baseline gap-2",children:[v,q]}),e[47]=v,e[48]=q,e[49]=z):z=e[49];let L;e[50]===Symbol.for("react.memo_cache_sentinel")?(L=s.jsx("p",{className:"text-xs text-muted-foreground",children:"Available credit balance"}),e[50]=L):L=e[50];let Y;e[51]!==z?(Y=s.jsxs("div",{className:"flex flex-col gap-2 pt-2",children:[z,L]}),e[51]=z,e[52]=Y):Y=e[52];let Z;e[53]===Symbol.for("react.memo_cache_sentinel")?(Z=s.jsxs("div",{className:"pt-4 border-t border-border/60",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-2.5",children:"Add credits"}),s.jsx(gt,{})]}),e[53]=Z):Z=e[53];let ee;return e[54]!==F||e[55]!==E||e[56]!==Y?(ee=s.jsx(de,{title:"Deco AI Gateway",children:s.jsx(ce,{children:s.jsxs("div",{className:"px-5 py-5 flex flex-col gap-5",children:[F,E,Y,Z]})})}),e[54]=F,e[55]=E,e[56]=Y,e[57]=ee):ee=e[57],ee}function _t(e){G.error(`Failed to disconnect: ${e.message}`)}function St(e){return e.providerId==="deco"}function kt(){const e=U.c(8),{org:t}=re(),i=H(),a=oe();let r;e[0]!==i?(r=async()=>{await i.call("AI_PROVIDER_PROVISION_KEY",{providerId:"deco"})},e[0]=i,e[1]=r):r=e[1];let l;e[2]!==t||e[3]!==a?(l=()=>{je("ai_provider_provision_succeeded",{provider_id:"deco"}),a.invalidateQueries({queryKey:Q.aiProviderKeys(t.id)}),a.invalidateQueries({queryKey:Q.aiProviders(t.id)}),G.success("Deco AI Gateway connected successfully")},e[2]=t,e[3]=a,e[4]=l):l=e[4];let o;return e[5]!==r||e[6]!==l?(o={mutationFn:r,onSuccess:l,onError:It},e[5]=r,e[6]=l,e[7]=o):o=e[7],J(o)}function It(e){je("ai_provider_provision_failed",{provider_id:"deco",error:e.message}),G.error(`Failed to connect Deco AI Gateway: ${e.message}`)}function Ct(){const e=U.c(10),{mutate:t,isPending:i}=kt();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=["radial-gradient(ellipse 50% 150% at -15% 50%, rgba(165,149,255,0.14) 0%, transparent 60%)","radial-gradient(ellipse 50% 150% at 115% 50%, rgba(208,236,26,0.11) 0%, transparent 60%)"],e[0]=a):a=e[0];let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{backgroundImage:a.join(", ")}}),e[1]=r):r=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"Deco AI Gateway",className:"size-12 shrink-0 rounded-xl object-contain dark:bg-white dark:p-1"}),e[2]=l):l=e[2];let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[s.jsx("p",{className:"text-base font-semibold",children:"Deco AI Gateway"}),s.jsx("span",{className:"rounded-full border border-border/60 bg-background/60 px-2 py-0.5 text-[10px] font-medium text-muted-foreground",children:"Recommended"})]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"100+ models, one connection — pay as you go, no API keys to juggle."})]}),e[3]=o):o=e[3];let x;e[4]!==t?(x=()=>t(),e[4]=t,e[5]=x):x=e[5];const S=i?"Connecting…":"Connect Deco";let b;return e[6]!==i||e[7]!==x||e[8]!==S?(b=s.jsxs("div",{className:"relative rounded-xl border border-border overflow-hidden",children:[r,s.jsxs("div",{className:"relative flex items-center gap-5 px-6 py-5",children:[l,o,s.jsx(V,{variant:"outline",disabled:i,onClick:x,children:S})]})]}),e[6]=i,e[7]=x,e[8]=S,e[9]=b):b=e[9],b}const Nt=B({label:N().min(1,"Label is required").max(100),apiKey:N().optional(),baseUrl:N().optional()});function Pt({providerKey:e,provider:t,preset:i,maskedKey:a,currentLabel:r,currentBaseUrl:l,onCancel:o,onSuccess:x}){const{org:S}=re(),b=H(),d=oe(),[n,m]=M.useState(!1),c=t.id==="openai-compatible",u=t.supportedMethods.includes("api-key"),{register:g,handleSubmit:j,watch:_,formState:{errors:p}}=be({resolver:ge(Nt),defaultValues:{label:r,apiKey:"",baseUrl:l??""}}),k=_("apiKey")??"",{mutate:I,isPending:h}=J({mutationFn:async f=>{let y;f.apiKey?c?y=JSON.stringify({baseUrl:f.baseUrl||l||"",apiKey:f.apiKey}):y=f.apiKey:c&&f.baseUrl&&f.baseUrl!==l&&(y=JSON.stringify({baseUrl:f.baseUrl,apiKey:""})),await b.call("AI_PROVIDER_KEY_UPDATE",{keyId:e.id,label:f.label,...y!==void 0?{apiKey:y}:{}})},onSuccess:()=>{d.invalidateQueries({queryKey:Q.aiProviderKeys(S.id)}),d.invalidateQueries({queryKey:Q.aiProviders(S.id)}),G.success("Provider updated"),x()},onError:f=>G.error(`Failed to update: ${f.message}`)});return s.jsxs("form",{onSubmit:j(f=>I(f)),className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Label"}),s.jsx(ie,{placeholder:"e.g. Personal key",...g("label"),className:"h-8 text-sm"}),p.label&&s.jsx("p",{className:"text-xs text-destructive",children:p.label.message})]}),c&&!i?.defaultBaseUrl&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Base URL"}),s.jsx(ie,{type:"url",placeholder:i?.baseUrlPlaceholder??"http://localhost:4000/v1",...g("baseUrl"),className:"h-8 text-sm"})]}),u&&s.jsxs("div",{className:"space-y-1",children:[s.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["API key"," ",s.jsx("span",{className:"text-muted-foreground/60",children:"(leave blank to keep current)"})]}),s.jsxs("div",{className:"relative",children:[s.jsx(ie,{type:n&&k?"text":"password",placeholder:a,...g("apiKey"),className:"ph-no-capture h-8 text-sm pr-8"}),k&&s.jsx("button",{type:"button",onClick:()=>m(!n),className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:n?s.jsx(Xe,{size:14}):s.jsx(Ze,{size:14})})]})]}),i?.helpText&&s.jsx("p",{className:"text-xs text-muted-foreground",children:i.helpText}),s.jsxs(et,{children:[s.jsx(V,{type:"button",variant:"ghost",size:"sm",onClick:o,disabled:h,children:"Cancel"}),s.jsx(V,{type:"submit",size:"sm",disabled:h,children:h?"Saving...":"Save"})]})]})}function wt(e){const t=U.c(28),{providerKey:i,provider:a,open:r,onOpenChange:l}=e,o=H();let x;t[0]!==a.id||t[1]!==i.presetId?(x=a.id==="openai-compatible"&&i.presetId?ke.find(k=>k.id===i.presetId):void 0,t[0]=a.id,t[1]=i.presetId,t[2]=x):x=t[2];const S=x,b=S?.name??a.name;let d;t[3]!==i.id?(d=Q.aiProviderKeyPreview(i.id),t[3]=i.id,t[4]=d):d=t[4];let n;t[5]!==i.id||t[6]!==o?(n=()=>o.call("AI_PROVIDER_KEY_PREVIEW",{keyId:i.id}),t[5]=i.id,t[6]=o,t[7]=n):n=t[7];let m;t[8]!==r||t[9]!==d||t[10]!==n?(m={queryKey:d,queryFn:n,enabled:r,staleTime:0},t[8]=r,t[9]=d,t[10]=n,t[11]=m):m=t[11];const{data:c,isLoading:u}=ve(m);let g;t[12]!==b?(g=s.jsx(tt,{children:s.jsxs(st,{children:["Edit ",b]})}),t[12]=b,t[13]=g):g=t[13];let j;t[14]!==u||t[15]!==l||t[16]!==S||t[17]!==c||t[18]!==a||t[19]!==i?(j=u||!c?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(ze,{})}):s.jsx(Pt,{providerKey:i,provider:a,preset:S,maskedKey:c.maskedKey,currentLabel:c.label,currentBaseUrl:c.baseUrl,onCancel:()=>l(!1),onSuccess:()=>l(!1)}),t[14]=u,t[15]=l,t[16]=S,t[17]=c,t[18]=a,t[19]=i,t[20]=j):j=t[20];let _;t[21]!==g||t[22]!==j?(_=s.jsxs(it,{className:"sm:max-w-md",children:[g,j]}),t[21]=g,t[22]=j,t[23]=_):_=t[23];let p;return t[24]!==l||t[25]!==r||t[26]!==_?(p=s.jsx(rt,{open:r,onOpenChange:l,children:_}),t[24]=l,t[25]=r,t[26]=_,t[27]=p):p=t[27],p}function Dt(e){const t=U.c(48),{providerKey:i,provider:a}=e,{org:r}=re(),l=H(),o=oe(),[x,S]=M.useState(!1),[b,d]=M.useState(!1),n=a.id==="openai-compatible";let m;t[0]!==n||t[1]!==i.presetId?(m=n&&i.presetId?ke.find(q=>q.id===i.presetId):void 0,t[0]=n,t[1]=i.presetId,t[2]=m):m=t[2];const c=m,u=c?c.name:n?"Custom OpenAI-compatible":a.name,g=c?.logo??a.logo;let j;e:{if(n){j=i.label;break e}const q=i.label;let z;t[3]!==i.createdAt?(z=ot(new Date(i.createdAt)),t[3]=i.createdAt,t[4]=z):z=t[4],j=`${q} · added ${z} ago`}const _=j;let p;t[5]!==i.id||t[6]!==l?(p=async()=>{await l.call("AI_PROVIDER_KEY_DELETE",{keyId:i.id})},t[5]=i.id,t[6]=l,t[7]=p):p=t[7];let k;t[8]!==r||t[9]!==i.id||t[10]!==o?(k=()=>{o.invalidateQueries({queryKey:Q.aiProviderKeys(r.id)}),o.invalidateQueries({queryKey:Q.aiProviders(r.id)}),o.invalidateQueries({queryKey:Q.aiProviderModels(r.id,i.id)}),G.success("Key deleted"),S(!1)},t[8]=r,t[9]=i.id,t[10]=o,t[11]=k):k=t[11];let I;t[12]!==p||t[13]!==k?(I={mutationFn:p,onSuccess:k,onError:At},t[12]=p,t[13]=k,t[14]=I):I=t[14];const{mutate:h,isPending:f}=J(I);let y;t[15]!==u||t[16]!==g?(y=g?s.jsx("img",{src:g,alt:u,className:"size-8 rounded-md object-contain dark:bg-white dark:p-0.5"}):s.jsx(Je,{fallback:u.charAt(0),className:"size-8 bg-primary/10 text-primary"}),t[15]=u,t[16]=g,t[17]=y):y=t[17];let $;t[18]===Symbol.for("react.memo_cache_sentinel")?($=s.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:()=>d(!0),children:s.jsx(We,{size:14})}),t[18]=$):$=t[18];let O,T;t[19]===Symbol.for("react.memo_cache_sentinel")?(O=()=>S(!0),T=s.jsx(He,{size:14}),t[19]=O,t[20]=T):(O=t[19],T=t[20]);let F;t[21]!==f?(F=s.jsxs("div",{className:"flex items-center gap-0.5",children:[$,s.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",disabled:f,onClick:O,children:T})]}),t[21]=f,t[22]=F):F=t[22];let D;t[23]!==_||t[24]!==u||t[25]!==F||t[26]!==y?(D=s.jsx(_e,{icon:y,title:u,description:_,action:F}),t[23]=_,t[24]=u,t[25]=F,t[26]=y,t[27]=D):D=t[27];let A;t[28]!==b||t[29]!==a||t[30]!==i?(A=s.jsx(wt,{providerKey:i,provider:a,open:b,onOpenChange:d}),t[28]=b,t[29]=a,t[30]=i,t[31]=A):A=t[31];let K;t[32]===Symbol.for("react.memo_cache_sentinel")?(K=s.jsx(Ce,{children:"Delete API key"}),t[32]=K):K=t[32];let E;t[33]!==i.label?(E=s.jsxs(Ie,{children:[K,s.jsxs(Ne,{children:["This action cannot be undone. This will permanently delete"," ",s.jsx("span",{className:"font-medium text-foreground",children:i.label}),"."]})]}),t[33]=i.label,t[34]=E):E=t[34];let v;t[35]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(Pe,{children:"Cancel"}),t[35]=v):v=t[35];let w;t[36]!==h?(w=s.jsxs(De,{children:[v,s.jsx(Ae,{onClick:()=>h(),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),t[36]=h,t[37]=w):w=t[37];let R;t[38]!==E||t[39]!==w?(R=s.jsxs(we,{children:[E,w]}),t[38]=E,t[39]=w,t[40]=R):R=t[40];let P;t[41]!==x||t[42]!==R?(P=s.jsx(Ke,{open:x,onOpenChange:S,children:R}),t[41]=x,t[42]=R,t[43]=P):P=t[43];let C;return t[44]!==D||t[45]!==A||t[46]!==P?(C=s.jsxs(s.Fragment,{children:[D,A,P]}),t[44]=D,t[45]=A,t[46]=P,t[47]=C):C=t[47],C}function At(e){return G.error(`Failed to delete key: ${e.message}`)}function Kt(e){const t=U.c(11),{onConnectClick:i}=e,a=X(),r=Se();let l;t[0]!==r?.providers?(l=r?.providers??[],t[0]=r?.providers,t[1]=l):l=t[1];const o=l;let x;if(t[2]!==a||t[3]!==i||t[4]!==o){let S;t[6]!==o?(S=m=>({key:m,provider:o.find(c=>c.id===m.providerId)}),t[6]=o,t[7]=S):S=t[7];const b=a.filter($t).map(S).filter(Rt);let d;t[8]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Ye,{size:14}),t[8]=d):d=t[8];let n;t[9]!==i?(n=s.jsxs(V,{size:"sm",onClick:i,children:[d,"Connect provider"]}),t[9]=i,t[10]=n):n=t[10],x=s.jsx(de,{title:"Connected providers",headerClassName:"px-0",actions:n,children:b.length===0?s.jsx("p",{className:"text-sm text-muted-foreground px-1",children:"Bring your own keys to use specific models alongside Deco's gateway."}):s.jsx(ce,{children:b.map(Et)})}),t[2]=a,t[3]=i,t[4]=o,t[5]=x}else x=t[5];return x}function Et(e){const{key:t,provider:i}=e;return s.jsx(Dt,{providerKey:t,provider:i},t.id)}function Rt(e){return e.provider!==void 0}function $t(e){return e.providerId!=="deco"}function Ft(e){const t=U.c(3),{error:i}=e;let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx($e,{size:16}),t[0]=a):a=t[0];let r;return t[1]!==i.message?(r=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[a,s.jsxs("span",{className:"text-sm font-medium",children:["Failed to load AI providers: ",i.message]})]}),t[1]=i.message,t[2]=r):r=t[2],r}function Mt(){const e=U.c(23),t=X();let i;e[0]!==t?(i=t.some(Ot),e[0]=t,e[1]=i):i=e[1];const a=i,r=t.length>0,[l,o]=M.useState(!1),[x,S]=M.useState(null),b=Se();let d;e[2]!==b?.providers?(d=b?.providers??[],e[2]=b?.providers,e[3]=d):d=e[3];const n=d;if(!r){let _;e[4]===Symbol.for("react.memo_cache_sentinel")?(_=()=>o(!0),e[4]=_):_=e[4];let p;e[5]!==n?(p=s.jsx(Be,{providers:n,onSelect:S,onShowAll:_}),e[5]=n,e[6]=p):p=e[6];const k=x!==null||l;let I;e[7]===Symbol.for("react.memo_cache_sentinel")?(I=$=>{$||(S(null),o(!1))},e[7]=I):I=e[7];const h=x??void 0;let f;e[8]!==k||e[9]!==h?(f=s.jsx(pe,{open:k,onOpenChange:I,initialProvider:h}),e[8]=k,e[9]=h,e[10]=f):f=e[10];let y;return e[11]!==p||e[12]!==f?(y=s.jsxs(s.Fragment,{children:[p,f]}),e[11]=p,e[12]=f,e[13]=y):y=e[13],y}let m;e[14]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(M.Suspense,{fallback:s.jsx(ne,{className:"h-16 w-full"}),children:s.jsx(ft,{})}),e[14]=m):m=e[14];let c;e[15]!==a?(c=a?s.jsx(jt,{}):s.jsx(Ct,{}),e[15]=a,e[16]=c):c=e[16];let u;e[17]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(Kt,{onConnectClick:()=>o(!0)}),e[17]=u):u=e[17];let g;e[18]!==l?(g=s.jsx(pe,{open:l,onOpenChange:o}),e[18]=l,e[19]=g):g=e[19];let j;return e[20]!==c||e[21]!==g?(j=s.jsxs(s.Fragment,{children:[m,c,u,g]}),e[20]=c,e[21]=g,e[22]=j):j=e[22],j}function Ot(e){return e.providerId==="deco"}function Tt(){const e=U.c(2);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(te.Title,{children:"AI Providers"}),e[0]=t):t=e[0];let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(te,{children:s.jsx(te.Content,{children:s.jsx(te.Body,{children:s.jsxs(Fe,{children:[t,s.jsx(Re,{fallback:Ut,children:s.jsx(M.Suspense,{fallback:s.jsx(ne,{className:"h-64 w-full"}),children:s.jsx(Mt,{})})})]})})})}),e[1]=i):i=e[1],i}function Ut(e){const{error:t}=e;return s.jsx(Ft,{error:t??new Error("Failed to load AI providers")})}function Ws(){const e=U.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(lt,{capability:"ai-providers:manage",area:"AI providers",children:s.jsx(Tt,{})}),e[0]=t):t=e[0],t}export{Ws as default};
@@ -1 +0,0 @@
1
- import{a1 as he,r as v,d as K,R as T,a as R,j as e,l as f,B as ue,c as Ce,S as pe}from"./index-CsZhMKFM.js";import{I as $}from"./input-D5ccsU_1.js";import{e as Ae}from"./backoff-CrEUbyZT.js";import{d as Pe}from"./delay-CnY5UFtP.js";class fe extends Error{constructor(s,u){super(`Retrying exceeded the maxAttempts (${u}).`),this.name="RetryError",this.cause=s}}async function Ie(n,s){const{multiplier:u=2,maxTimeout:c=6e4,maxAttempts:o=5,minTimeout:g=1e3,jitter:l=1,isRetriable:m=()=>!0,signal:w}=s??{};if(!Number.isInteger(o)||o<1)throw new RangeError(`Cannot retry as 'maxAttempts' must be a positive integer: current value is ${o}`);if(!Number.isFinite(u)||u<1)throw new RangeError(`Cannot retry as 'multiplier' must be a finite number >= 1: current value is ${u}`);if(Number.isNaN(c)||c<=0)throw new RangeError(`Cannot retry as 'maxTimeout' must be a positive number: current value is ${c}`);if(Number.isNaN(g)||g<0)throw new RangeError(`Cannot retry as 'minTimeout' must be >= 0: current value is ${g}`);if(g>c)throw new RangeError(`Cannot retry as 'minTimeout' must be <= 'maxTimeout': current values 'minTimeout=${g}', 'maxTimeout=${c}'`);if(Number.isNaN(l)||l<0||l>1)throw new RangeError(`Cannot retry as 'jitter' must be between 0 and 1: current value is ${l}`);let C=0;for(;;){w?.throwIfAborted();try{return await n()}catch(y){if(!m(y))throw y;if(C+1>=o)throw new fe(y,o);const _=Ae(c,g,C,u,l);await Pe(_,w?{signal:w}:void 0)}C++}}const ke={signUpFailed:"Sign up failed",signInFailed:"Sign in failed",authenticationFailed:"Authentication failed",resetEmailFailed:"Failed to send reset email",otpSendFailed:"Failed to send code",invalidCode:"Invalid code",invalidEmail:"Invalid email address",invalidEmailOrPassword:"Invalid email or password. Please try again.",accountExists:"An account with this email already exists. Try signing in instead.",networkError:"Network error. Please check your connection and try again.",tooManyAttempts:"Too many attempts. Please wait a moment and try again.",invalidOrExpiredCode:"Invalid or expired code. Please try again.",genericError:"An error occurred. Please try again.",resetPasswordTitle:"Reset your password",verificationCodeTitle:"Enter verification code",welcomeTitle:"Welcome to deco",resetPasswordSubtitle:"We'll send you a reset link",codeSentTo:n=>`Code sent to ${n}`,defaultSubtitle:"Sign in or create a new account",resetEmailSent:"Check your email for a password reset link.",continueWith:n=>`Continue with ${n}`,divider:"or",emailLabel:"Email",emailPlaceholder:"Email address",sending:"Sending...",sendCode:"Send code",verificationCodeLabel:"Verification code",enterCodePlaceholder:"Enter code",verifying:"Verifying...",verify:"Verify",useDifferentEmail:"Use a different email",sendResetLink:"Send reset link",nameLabel:"Name",namePlaceholder:"Your name",passwordLabel:"Password",forgotPassword:"Forgot password?",creatingAccount:"Creating account...",signingIn:"Signing in...",continue:"Continue",backToSignIn:"Back to sign in",signInWithPassword:"Sign in with password instead",alreadyHaveAccount:"Already have an account? ",dontHaveAccount:"Don't have an account? ",signIn:"Sign in",signUp:"Sign up",signInWithEmailCode:"Sign in with email code"};function _e({redirectUrl:n,callbackUrl:s="/",title:u,subtitle:c,brand:o,copy:g,variant:l="default",allowedSocialProviders:m,allowPassword:w=!0,onAuthEvent:C}){const{emailAndPassword:y,resetPassword:_,emailOtp:p,socialProviders:A}=he(),h=t=>{try{C?.(t)}catch{}},x=l==="compact",V=m?A.providers.filter(t=>m.includes(t.name)):A.providers,H=A.enabled&&V.length>0,Q=y.enabled&&(w||!p.enabled&&!H),z=A.enabled&&A.providers.length>0&&!H&&!p.enabled&&!Q?A.providers:V,E=A.enabled&&z.length>0,j=y.enabled&&(w||!p.enabled&&!E),[i,Y]=v.useState(""),[J,xe]=v.useState(""),[X,ae]=v.useState(""),[Z,ee]=v.useState(""),[L,te]=v.useState(!1),[se,be]=v.useState(()=>p.enabled?"emailOtp":globalThis.localStorage?.getItem("hasLoggedIn")!=="true"?"signUp":"signIn"),[S,O]=v.useState(""),[ie,ne]=v.useState(!1),r={...ke,...g},b=se==="signUp",I=se==="forgotPassword",P=se==="emailOtp",D=K({mutationFn:async({email:t,password:a,name:k})=>{try{if(b){const N=await R.signUp.email({email:t,password:a,name:k||""});if(N.error)throw new Error(N.error.message||r.signUpFailed);return N}else{const N=await R.signIn.email({email:t,password:a});if(N.error)throw new Error(N.error.message||r.signInFailed);return N}}catch(N){throw N instanceof Error?N:new Error(r.authenticationFailed)}},onMutate:()=>{h({type:"started",method:"email_password",mode:b?"sign_up":"sign_in"})},onSuccess:()=>{h({type:"succeeded",method:"email_password",mode:b?"sign_up":"sign_in"}),globalThis.localStorage?.setItem("hasLoggedIn","true"),window.location.href=n??s},onError:t=>{h({type:"failed",method:"email_password",mode:b?"sign_up":"sign_in",stage:"authenticate",error:t instanceof Error?t.message:String(t)}),T(b?"user_signup_failed":"user_signin_failed",{error:t instanceof Error?t.message:String(t)})}}),q=K({mutationFn:async({email:t})=>{const a=await R.requestPasswordReset({email:t,redirectTo:"/reset-password"});if(a.error)throw new Error(a.error.message||r.resetEmailFailed);return a},onSuccess:()=>{T("password_reset_requested"),ne(!0)},onError:t=>{T("password_reset_request_failed",{error:t instanceof Error?t.message:String(t)})}}),M=K({mutationFn:async({email:t})=>{const a=await R.emailOtp.sendVerificationOtp({email:t,type:"sign-in"});if(a.error)throw new Error(a.error.message||r.otpSendFailed);return a},onMutate:()=>{h({type:"started",method:"email_otp"})},onSuccess:()=>{h({type:"otp_sent",method:"email_otp"}),T("email_otp_sent"),te(!0)},onError:t=>{h({type:"failed",method:"email_otp",stage:"send_otp",error:t instanceof Error?t.message:String(t)}),T("email_otp_send_failed",{error:t instanceof Error?t.message:String(t)})}}),U=K({mutationFn:async({email:t,otp:a})=>{const k=await R.signIn.emailOtp({email:t,otp:a});if(k.error)throw new Error(k.error.message||r.invalidCode);return k},onMutate:()=>{h({type:"otp_submitted",method:"email_otp"})},onSuccess:()=>{h({type:"succeeded",method:"email_otp"}),globalThis.localStorage?.setItem("hasLoggedIn","true"),window.location.href=n??s},onError:t=>{h({type:"failed",method:"email_otp",stage:"verify_otp",error:t instanceof Error?t.message:String(t)}),T("email_otp_verify_failed",{error:t instanceof Error?t.message:String(t)})}}),G=t=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t),re=()=>{i.trim()&&!G(i)&&O(r.invalidEmail)},ve=t=>{if(t.preventDefault(),!G(i)){O(r.invalidEmail),h({type:"failed",method:"email_password",mode:b?"sign_up":"sign_in",stage:"validation",error:"invalid_email"});return}D.mutate({email:i,password:J,name:X})},we=t=>{if(t.preventDefault(),!G(i)){O(r.invalidEmail);return}q.mutate({email:i})},ye=t=>{if(t.preventDefault(),!G(i)){O(r.invalidEmail),h({type:"failed",method:"email_otp",stage:"validation",error:"invalid_email"});return}M.mutate({email:i})},Ee=t=>{t.preventDefault(),U.mutate({email:i,otp:Z})},W=t=>a=>{t(a.target.value),oe&&D.reset(),le&&q.reset(),de&&(M.reset(),U.reset()),t===Y&&S&&O("")},B=t=>{be(t),ae(""),ee(""),te(!1),O(""),ne(!1),D.reset(),q.reset(),M.reset(),U.reset()},d=D.isPending||q.isPending||M.isPending||U.isPending,oe=D.error,le=q.error,de=M.error||U.error,F=b?i.trim()&&J.trim()&&X.trim():I?i.trim():P?L?Z.trim():i.trim():i.trim()&&J.trim(),je=t=>{if(!t)return null;const a=t.message.toLowerCase();return a.includes("unauthorized")||a.includes("401")?r.invalidEmailOrPassword:a.includes("already exists")||a.includes("409")?r.accountExists:a.includes("network")||a.includes("fetch")?r.networkError:a.includes("rate limit")||a.includes("429")?r.tooManyAttempts:a.includes("invalid")&&a.includes("otp")?r.invalidOrExpiredCode:t.message||r.genericError},ce=oe||le||de,Se=async t=>{h({type:"started",method:"social",provider:t});try{const a=await R.signIn.social({provider:t,callbackURL:n??s});if(a.error)throw new Error(a.error.message||r.authenticationFailed)}catch(a){const k=a instanceof Error?a.message:String(a);h({type:"failed",method:"social",provider:t,stage:"redirect",error:k}),T("social_signin_failed",{provider:t,error:k})}},Ne=I?r.resetPasswordTitle:P&&L?r.verificationCodeTitle:u??r.welcomeTitle,me=I?r.resetPasswordSubtitle:P&&L?r.codeSentTo(i):c===void 0?r.defaultSubtitle:c;return e.jsxs("div",{className:f("grid w-full",x?"gap-5":"gap-10"),children:[o??e.jsxs("div",{children:[e.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),e.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h1",{className:f("font-medium",x?"text-xl leading-7":"text-2xl leading-8"),children:Ne}),me&&e.jsx("p",{className:f("text-muted-foreground",x?"text-sm leading-5":"text-base leading-6"),children:me})]}),ce&&e.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:je(ce)}),ie&&e.jsx("div",{className:"rounded-xl bg-emerald-500/10 p-3 text-sm text-emerald-600 dark:text-emerald-400 text-center",children:r.resetEmailSent}),!I&&!(P&&L)&&E&&e.jsx("div",{className:"grid gap-2",children:z.map(t=>e.jsxs("button",{type:"button",disabled:d,onClick:()=>{Se(t.name)},className:f("flex w-full items-center justify-center gap-3 bg-background px-3 text-sm font-medium text-foreground card-shadow transition-colors hover:bg-accent hover:text-accent-foreground disabled:pointer-events-none disabled:opacity-50 dark:bg-input/30 dark:hover:bg-input/50",x?"h-11 rounded-lg":"h-12 rounded-xl"),children:[t.icon&&e.jsx("img",{src:t.icon,alt:"",className:f("h-5 w-5",t.name==="github"&&"dark:invert"),"aria-hidden":"true"}),r.continueWith(t.name.charAt(0).toUpperCase()+t.name.slice(1))]},t.name))}),!I&&!(P&&L)&&E&&(j||p.enabled)&&e.jsxs("div",{className:f("flex items-center gap-2.5",x?"my-0":"-my-4"),children:[e.jsx("div",{className:"h-px flex-1 bg-border"}),e.jsx("span",{className:f("text-muted-foreground",x?"text-sm":"text-base"),children:r.divider}),e.jsx("div",{className:"h-px flex-1 bg-border"})]}),P&&p.enabled&&e.jsx(e.Fragment,{children:L?e.jsxs("form",{onSubmit:Ee,className:f("grid gap-2",x&&"sm:grid-cols-[minmax(0,1fr)_auto] sm:items-start"),children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx("label",{className:f("text-sm font-medium text-foreground",x&&"sr-only"),children:r.verificationCodeLabel}),e.jsx($,{type:"text",placeholder:r.enterCodePlaceholder,value:Z,onChange:W(ee),required:!0,disabled:d,autoFocus:!0,inputMode:"numeric",autoComplete:"one-time-code",className:"h-11 rounded-lg"})]}),e.jsx("button",{type:"submit",disabled:d||!F,className:f("flex items-center justify-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:pointer-events-none disabled:opacity-50",x?"h-11 sm:w-auto":"h-12 w-full"),children:d?r.verifying:r.verify}),e.jsx("button",{type:"button",onClick:()=>{te(!1),ee(""),M.reset(),U.reset()},disabled:d,className:f("mt-1 text-sm text-muted-foreground transition-colors hover:text-foreground",x&&"sm:col-span-2"),children:r.useDifferentEmail})]}):e.jsxs("form",{onSubmit:ye,className:f("grid gap-2",x&&"sm:grid-cols-[minmax(0,1fr)_auto] sm:items-start"),children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx("label",{className:f("text-sm font-medium text-foreground",x&&"sr-only"),children:r.emailLabel}),e.jsx($,{type:"email",placeholder:r.emailPlaceholder,value:i,onChange:W(Y),onBlur:re,required:!0,disabled:d,"aria-invalid":!!S,className:"h-11 rounded-lg"}),S&&e.jsx("p",{className:"text-xs text-destructive",children:S})]}),e.jsx("button",{type:"submit",disabled:d||!F,className:f("flex items-center justify-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:pointer-events-none disabled:opacity-50",x?"h-11 sm:w-auto":"h-12 w-full"),children:d?r.sending:r.sendCode})]})}),I&&j&&!ie&&e.jsxs("form",{onSubmit:we,className:"grid gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:r.emailLabel}),e.jsx($,{type:"email",placeholder:"you@example.com",value:i,onChange:W(Y),onBlur:re,required:!0,disabled:d,"aria-invalid":!!S,className:"h-11 rounded-lg"}),S&&e.jsx("p",{className:"text-xs text-destructive mt-1.5",children:S})]}),e.jsx(ue,{type:"submit",disabled:d||!F,className:"w-full font-semibold",size:"xl",children:d?r.sending:r.sendResetLink})]}),!I&&!P&&j&&e.jsxs("form",{onSubmit:ve,className:"grid gap-5",children:[b&&e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:r.nameLabel}),e.jsx($,{type:"text",placeholder:r.namePlaceholder,value:X,onChange:W(ae),required:!0,disabled:d,className:"h-11 rounded-lg"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:r.emailLabel}),e.jsx($,{type:"email",placeholder:"you@example.com",value:i,onChange:W(Y),onBlur:re,required:!0,disabled:d,"aria-invalid":!!S,className:"h-11 rounded-lg"}),S&&e.jsx("p",{className:"text-xs text-destructive mt-1.5",children:S})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("label",{className:"block text-sm font-medium text-foreground",children:r.passwordLabel}),!b&&_.enabled&&e.jsx("button",{type:"button",onClick:()=>B("forgotPassword"),className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:r.forgotPassword})]}),e.jsx($,{type:"password",placeholder:"••••••••",value:J,onChange:W(xe),required:!0,disabled:d,className:"h-11 rounded-lg"})]}),e.jsx("div",{className:f("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",F?"max-h-[100px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:e.jsx("div",{className:f("p-1",!F&&"pointer-events-none"),children:e.jsx(ue,{type:"submit",disabled:d||!F,className:f("w-full font-semibold"),size:"xl","aria-hidden":!F,children:d?b?r.creatingAccount:r.signingIn:r.continue})})})]}),e.jsx("div",{className:"text-sm text-muted-foreground",children:I?e.jsx("button",{type:"button",onClick:()=>B("signIn"),disabled:d,className:"font-medium text-[#8CAA25] hover:underline disabled:opacity-50",children:r.backToSignIn}):P&&j?e.jsx("button",{type:"button",onClick:()=>B("signIn"),disabled:d,className:"font-medium text-[#8CAA25] hover:underline disabled:opacity-50",children:r.signInWithPassword}):!P&&j?e.jsxs(e.Fragment,{children:[b?r.alreadyHaveAccount:r.dontHaveAccount,e.jsx("button",{type:"button",onClick:()=>B(b?"signIn":"signUp"),disabled:d,className:"font-medium text-[#8CAA25] hover:underline disabled:opacity-50",children:b?r.signIn:r.signUp}),p.enabled&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"mx-2",children:"·"}),e.jsx("button",{type:"button",onClick:()=>B("emailOtp"),disabled:d,className:"font-medium text-[#8CAA25] hover:underline disabled:opacity-50",children:r.signInWithEmailCode})]})]}):null})]})}class ge{constructor(s){this.response=s}response}function Fe(n){return n.startsWith("/")&&!n.startsWith("//")?n:"/"}function Te({redirectTo:n,onAuthEvent:s}){const[u,c]=v.useState(null),o=v.useEffectEvent(g=>{try{s?.(g)}catch{}});return v.useEffect(()=>{let g=!1;return(async()=>{o({type:"started",method:"local"});try{let l;try{l=await Ie(async()=>{const m=await fetch("/api/auth/custom/local-session",{method:"POST",credentials:"include"});if(m.status>=500)throw new ge(m);return m},{maxAttempts:5,minTimeout:1e3,maxTimeout:1e4,multiplier:2,jitter:0})}catch(m){if(m instanceof fe&&m.cause instanceof ge)l=m.cause.response;else throw m}if(!l.ok){const m=await l.json().catch(()=>({}));throw new Error(m?.error||"Auto-login failed")}g||(o({type:"succeeded",method:"local"}),window.location.href=Fe(n))}catch(l){g||(o({type:"failed",method:"local",stage:"authenticate",error:l instanceof Error?l.message:String(l)}),c(l instanceof Error?l.message:"Auto-login failed"))}})(),()=>{g=!0}},[n]),u?e.jsx("div",{className:"flex min-h-screen items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsxs("p",{className:"text-destructive mb-2",children:["Auto-login failed: ",u]}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Try restarting the server."})]})}):e.jsx(pe,{})}function Re({callbackURL:n,providerId:s,onAuthEvent:u}){const c=v.useEffectEvent(o=>{try{u?.(o)}catch{}});return v.useEffect(()=>{(async()=>{c({type:"started",method:"sso",provider:s});try{const o=await R.signIn.sso({providerId:s,callbackURL:n});if(o.error)throw new Error(o.error.message||"SSO redirect failed")}catch(o){c({type:"failed",method:"sso",provider:s,stage:"redirect",error:o instanceof Error?o.message:String(o)})}})()},[s,n]),e.jsx(pe,{})}function We(n){const s=Ce.c(19),{callbackUrl:u,redirectUrl:c,allowAutoLogin:o,title:g,subtitle:l,brand:m,copy:w,variant:C,allowedSocialProviders:y,allowPassword:_,onAuthEvent:p}=n,A=o===void 0?!0:o,{sso:h,emailAndPassword:x,magicLink:V,emailOtp:H,socialProviders:Q,localMode:z}=he(),E=c||u;if(z&&A){let i;return s[0]!==p||s[1]!==E?(i=e.jsx(Te,{redirectTo:E,onAuthEvent:p}),s[0]=p,s[1]=E,s[2]=i):i=s[2],i}if(h.enabled){let i;return s[3]!==p||s[4]!==E||s[5]!==h.providerId?(i=e.jsx(Re,{callbackURL:E,providerId:h.providerId,onAuthEvent:p}),s[3]=p,s[4]=E,s[5]=h.providerId,s[6]=i):i=s[6],i}if(x.enabled||V.enabled||H.enabled||Q.enabled){let i;return s[7]!==_||s[8]!==y||s[9]!==m||s[10]!==u||s[11]!==w||s[12]!==p||s[13]!==c||s[14]!==l||s[15]!==g||s[16]!==C?(i=e.jsx(_e,{redirectUrl:c,callbackUrl:u,title:g,subtitle:l,brand:m,copy:w,variant:C,allowedSocialProviders:y,allowPassword:_,onAuthEvent:p}),s[7]=_,s[8]=y,s[9]=m,s[10]=u,s[11]=w,s[12]=p,s[13]=c,s[14]=l,s[15]=g,s[16]=C,s[17]=i):i=s[17],i}let j;return s[18]===Symbol.for("react.memo_cache_sentinel")?(j=e.jsx("div",{children:"No login options available"}),s[18]=j):j=s[18],j}export{We as A};
@@ -1 +0,0 @@
1
- import{c as R,j as o,a4 as L,b as T,r as $,B as M,R as N}from"./index-CsZhMKFM.js";import{s as q}from"./Plus-Cgq7ON9K.js";import{i as S}from"./Zap-CgjpaG4V.js";import{S as D}from"./search-input-BREJK7qA.js";import{P as l}from"./index-DS3hrf0F.js";import{E as b}from"./empty-state-DD15-E7x.js";import{c as O}from"./use-automations-WNGih4F_.js";import{c as V}from"./use-navigate-to-agent-BsdctirU.js";import{A as F}from"./automation-list-row-ByoN-o6y.js";import{e as G}from"./constants-CaIX_f5U.js";import{u as H}from"./use-virtual-mcp-CMvxAHEJ.js";import{R as J}from"./require-capability-BjscC7QS.js";import"./SearchMd-ZfoTl6vw.js";import"./sidebar-DRSu2iBz.js";import"./LayoutLeft-DvNM8qhm.js";import"./use-mobile-DhhfLpzh.js";import"./X-OFSHASit.js";import"./tooltip-Cs5hng3q.js";import"./use-mcp-client-Bv8WGceO.js";import"./auth-D_bm0-t3.js";import"./studio-tools-CTswP4mA.js";import"./hooks-GnFkomrq.js";import"./decopilot-sse-pool-CJtSg3wj.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./reusable-new-chat-CouMjkYR.js";import"./alert-dialog-Bd5XLC3F.js";import"./dropdown-menu-C9SSwIby.js";import"./Check-CcLLJc-z.js";import"./ChevronRight-C3Tgk-3m.js";import"./Circle-C_fdyhr8.js";import"./Stars02-HLp9q8iP.js";import"./DotsVertical-CK1a4mKj.js";import"./Trash01--uX5q_ti.js";import"./agent-icon-dPkJbbXq.js";import"./AlertCircle-BsA2wZmN.js";import"./Tool01-DVCGutKV.js";import"./ArrowUp-CDnEKV2Y.js";import"./Settings02-CS2jOfO5.js";import"./Tool02-CSTMjTef.js";import"./XCircle-D3cI1Aep.js";import"./ArrowUpRight-DdPCnlNm.js";import"./TrendUp01-acR-ekUr.js";import"./ZapSquare-Dzb50Gix.js";import"./Users03-tGwfKVJc.js";import"./Loading02-Dx-xiZND.js";import"./CheckCircle-lXciCGfG.js";import"./ChevronDown-BmFaSDo8.js";import"./ChevronUp-Dew3RmKl.js";import"./Copy01-b3lIb5yu.js";import"./ZoomOut-DYAXxr_v.js";import"./Globe01-B6kdhpV9.js";import"./Eye-DM8bmzm7.js";import"./FilterLines-DCNZa1GS.js";import"./Star01-2DHf7kTZ.js";import"./Globe04-CGLGspo5.js";import"./SwitchHorizontal01-ilLzkPr_.js";import"./HardDrive-CR6Rs-a1.js";import"./Key01-1r4YrQER.js";import"./LinkExternal01-Ck4lryDE.js";import"./List-DfPIAPM_.js";import"./Monitor01-D_DrBwt_.js";import"./Sun-ByaEjJ0N.js";import"./Package-CV2Q9Uup.js";import"./Palette-BY5BmUDa.js";import"./Play-Ci1OqtIO.js";import"./SearchLg-2as_l8YT.js";import"./Shield01-C6TdRfmI.js";import"./Stars01-BEHbN5c3.js";import"./Upload01-BaheeKQP.js";import"./User01-5hu8D3_O.js";import"./Users01-Dh5E4dqf.js";import"./XClose-D5Ra7e-f.js";import"./use-collections-Cl7KVWNQ.js";import"./use-capability-DmeYLlad.js";import"./access-gate-B4XS-sin.js";import"./capability-load-error-COzn8-Xb.js";function K(){const t=R.c(16),{org:i}=L(),{data:w}=O(void 0),u=w===void 0?[]:w,B=H(),k=V(),d=T(),[f,E]=$.useState(""),g=f.toLowerCase(),y=new Map(B.map(Q)),C=u.filter(e=>{if(!g||e.name.toLowerCase().includes(g))return!0;if(e.virtual_mcp_id){const a=y.get(e.virtual_mcp_id);if(a&&a.title.toLowerCase().includes(g))return!0}return!1}),P=(e,a)=>{const A=a&&y.has(a)?a:G(i.id);N("automations_list_row_clicked",{automation_id:e,agent_id:A,source:"settings_automations"}),k(A,{search:{main:"automation:"+e}})};let n;t[0]!==d||t[1]!==i.slug?(n=()=>{N("automations_empty_state_browse_agents_clicked"),d({to:"/$org/settings/agents",params:{org:i.slug}})},t[0]=d,t[1]=i.slug,t[2]=n):n=t[2];const z=n,x=l,h=l,j=l;let p;t[3]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsx(l.Title,{children:"Automations"}),t[3]=p):p=t[3];const _=u.length>0&&o.jsx(D,{value:f,onChange:E,placeholder:"Search automations...",className:"w-full md:w-[375px]"});let r;t[4]!==_?(r=o.jsxs("div",{className:"flex flex-col gap-6",children:[p,_]}),t[4]=_,t[5]=r):r=t[5];const v=u.length===0?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(b,{image:o.jsx(S,{size:48,className:"text-muted-foreground"}),title:"No automations yet",description:"Automations are created per agent. Open an agent and add one from its Automations tab.",actions:o.jsxs(M,{size:"sm",onClick:z,children:[o.jsx(q,{size:14}),"Browse agents"]})})}):C.length===0?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(b,{image:o.jsx(S,{size:48,className:"text-muted-foreground"}),title:"No automations found",description:`No automations match "${f}"`})}):o.jsx("div",{className:"mt-6 rounded-xl border border-border overflow-hidden",children:C.map(e=>o.jsx(F,{automation:e,showAgent:!0,onClick:()=>P(e.id,e.virtual_mcp_id)},e.id))});let s;t[6]!==j.Body||t[7]!==r||t[8]!==v?(s=o.jsxs(j.Body,{children:[r,v]}),t[6]=j.Body,t[7]=r,t[8]=v,t[9]=s):s=t[9];let m;t[10]!==h.Content||t[11]!==s?(m=o.jsx(h.Content,{children:s}),t[10]=h.Content,t[11]=s,t[12]=m):m=t[12];let c;return t[13]!==x||t[14]!==m?(c=o.jsx(x,{children:m}),t[13]=x,t[14]=m,t[15]=c):c=t[15],c}function Q(t){return[t.id,t]}function jo(){const t=R.c(1);let i;return t[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx(J,{capability:"automations:manage",area:"automations",children:o.jsx(K,{})}),t[0]=i):i=t[0],i}export{jo as default};
@@ -1 +0,0 @@
1
- import{c as K,ak as ze,a4 as Ie,n as Le,K as Oe,m as Ke,d as ge,j as n,B as Ae,R as H,t as L,r as Te,M as Ue,l as _e,af as fe}from"./index-CsZhMKFM.js";import{t as Xe}from"./ChevronDown-BmFaSDo8.js";import{i as He}from"./ChevronRight-C3Tgk-3m.js";import{s as qe,t as Me}from"./Star01-2DHf7kTZ.js";import{n as Ve}from"./LinkExternal01-Ck4lryDE.js";import{s as Re}from"./Plus-Cgq7ON9K.js";import{s as Qe}from"./Trash01--uX5q_ti.js";import{i as Ge}from"./Zap-CgjpaG4V.js";import{c as Ye,b as Je,d as We,A as Ze,g as et,e as tt,a as st,f as nt}from"./alert-dialog-Bd5XLC3F.js";import{I as ue}from"./input-D5ccsU_1.js";import{T as lt}from"./textarea-DPLwPKZJ.js";import{P as Ne}from"./index-DS3hrf0F.js";import{u as $e}from"./studio-tools-CTswP4mA.js";import{u as ot}from"./use-debounced-autosave-teletZQd.js";import{R as rt}from"./require-capability-BjscC7QS.js";import"./sidebar-DRSu2iBz.js";import"./LayoutLeft-DvNM8qhm.js";import"./use-mobile-DhhfLpzh.js";import"./X-OFSHASit.js";import"./tooltip-Cs5hng3q.js";import"./use-capability-DmeYLlad.js";import"./access-gate-B4XS-sin.js";import"./capability-load-error-COzn8-Xb.js";function we(t){const e=K.c(8),{title:s,children:o,className:l}=t;let r;e[0]!==l?(r=_e("rounded-2xl border border-border/60 bg-background p-5",l),e[0]=l,e[1]=r):r=e[1];let c;e[2]!==s?(c=n.jsx("div",{className:"mb-4",children:n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:s})}),e[2]=s,e[3]=c):c=e[3];let f;return e[4]!==o||e[5]!==r||e[6]!==c?(f=n.jsxs("div",{className:r,children:[c,o]}),e[4]=o,e[5]=r,e[6]=c,e[7]=f):f=e[7],f}function at(t){const e=K.c(25),{onExtract:s,isExtracting:o}=t,[l,r]=Te.useState("");let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-primary/10",children:n.jsx(Ge,{size:18,className:"text-primary"})}),e[0]=c):c=e[0];let f,g;e[1]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx("p",{className:"text-sm font-medium text-foreground",children:"Auto-extract brand context"}),g=n.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Enter your website URL and we'll automatically extract your brand colors, fonts, logos, and company overview."}),e[1]=f,e[2]=g):(f=e[1],g=e[2]);let b;e[3]===Symbol.for("react.memo_cache_sentinel")?(b=m=>r(m.target.value),e[3]=b):b=e[3];let p;e[4]!==l||e[5]!==o||e[6]!==s?(p=m=>{m.key==="Enter"&&l.trim()&&!o&&s(l.trim())},e[4]=l,e[5]=o,e[6]=s,e[7]=p):p=e[7];let d;e[8]!==l||e[9]!==p?(d=n.jsx(ue,{placeholder:"acme.com",value:l,onChange:b,className:"max-w-xs",onKeyDown:p}),e[8]=l,e[9]=p,e[10]=d):d=e[10];let a;e[11]!==l||e[12]!==o?(a=!l.trim()||o,e[11]=l,e[12]=o,e[13]=a):a=e[13];let i;e[14]!==l||e[15]!==s?(i=()=>s(l.trim()),e[14]=l,e[15]=s,e[16]=i):i=e[16];let u;e[17]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(qe,{size:14}),e[17]=u):u=e[17];const h=o?"Extracting...":"Extract";let x;e[18]!==h||e[19]!==a||e[20]!==i?(x=n.jsxs(Ae,{variant:"outline",disabled:a,onClick:i,children:[u,h]}),e[18]=h,e[19]=a,e[20]=i,e[21]=x):x=e[21];let v;return e[22]!==x||e[23]!==d?(v=n.jsx("div",{className:"rounded-2xl border border-dashed border-border bg-muted/30 p-5",children:n.jsxs("div",{className:"flex items-start gap-4",children:[c,n.jsxs("div",{className:"flex-1",children:[f,g,n.jsxs("div",{className:"mt-3 flex gap-2",children:[d,x]})]})]})}),e[22]=x,e[23]=d,e[24]=v):v=e[24],v}function it(t){const e=K.c(36),{form:s,onFieldChange:o,onFieldCommit:l}=t;let r;e[0]!==s?(r=s.watch("domain"),e[0]=s,e[1]=r):r=e[1];const c=r;let f;e[2]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx("label",{className:"mb-1 block text-xs text-muted-foreground",children:"Company name"}),e[2]=f):f=e[2];let g;e[3]!==o||e[4]!==l?(g=D=>{const{field:y}=D;return n.jsx(ue,{...y,onChange:_=>{y.onChange(_),o()},onBlur:()=>{y.onBlur(),l()},placeholder:"Acme Corp"})},e[3]=o,e[4]=l,e[5]=g):g=e[5];let b;e[6]!==s.control||e[7]!==g?(b=n.jsxs("div",{children:[f,n.jsx(fe,{control:s.control,name:"name",render:g})]}),e[6]=s.control,e[7]=g,e[8]=b):b=e[8];let p;e[9]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx("span",{children:"Domain"}),e[9]=p):p=e[9];let d;e[10]!==c?(d=c&&n.jsxs("a",{href:`https://${c}`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 transition-colors hover:text-foreground",children:[n.jsx(Ve,{size:10}),"open"]}),e[10]=c,e[11]=d):d=e[11];let a;e[12]!==d?(a=n.jsxs("label",{className:"mb-1 flex items-center justify-between text-xs text-muted-foreground",children:[p,d]}),e[12]=d,e[13]=a):a=e[13];let i;e[14]!==o||e[15]!==l?(i=D=>{const{field:y}=D;return n.jsx(ue,{...y,onChange:_=>{y.onChange(_),o()},onBlur:()=>{y.onBlur(),l()},placeholder:"acme.com"})},e[14]=o,e[15]=l,e[16]=i):i=e[16];let u;e[17]!==s.control||e[18]!==i?(u=n.jsx(fe,{control:s.control,name:"domain",render:i}),e[17]=s.control,e[18]=i,e[19]=u):u=e[19];let h;e[20]!==a||e[21]!==u?(h=n.jsxs("div",{children:[a,u]}),e[20]=a,e[21]=u,e[22]=h):h=e[22];let x;e[23]!==h||e[24]!==b?(x=n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[b,h]}),e[23]=h,e[24]=b,e[25]=x):x=e[25];let v;e[26]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx("label",{className:"mb-1 block text-xs text-muted-foreground",children:"Overview"}),e[26]=v):v=e[26];let m;e[27]!==o||e[28]!==l?(m=D=>{const{field:y}=D;return n.jsx(lt,{...y,onChange:_=>{y.onChange(_),o()},onBlur:()=>{y.onBlur(),l()},placeholder:"Brief description of what the company does...",rows:3})},e[27]=o,e[28]=l,e[29]=m):m=e[29];let C;e[30]!==s.control||e[31]!==m?(C=n.jsxs("div",{children:[v,n.jsx(fe,{control:s.control,name:"overview",render:m})]}),e[30]=s.control,e[31]=m,e[32]=C):C=e[32];let k;return e[33]!==x||e[34]!==C?(k=n.jsx(we,{title:"Company Overview",children:n.jsxs("div",{className:"space-y-3",children:[x,C]})}),e[33]=x,e[34]=C,e[35]=k):k=e[35],k}const ct={backgroundImage:"linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%), linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%)",backgroundSize:"8px 8px",backgroundPosition:"0 0, 4px 4px",backgroundColor:"#fff"};function Se(t){const e=K.c(22),{form:s,name:o,label:l,imgClassName:r,onFieldChange:c,onFieldCommit:f}=t,g=r===void 0?"h-full w-full object-contain p-3":r;let b;e[0]!==s||e[1]!==o?(b=s.watch(o),e[0]=s,e[1]=o,e[2]=b):b=e[2];const p=b;let d;e[3]!==g||e[4]!==l||e[5]!==p?(d=n.jsx("div",{className:"flex aspect-video w-28 shrink-0 items-center justify-center overflow-hidden rounded-xl",style:ct,children:p?n.jsx("img",{src:p,alt:l,className:g,loading:"lazy"}):n.jsxs("span",{className:"text-[10px] text-muted-foreground/70",children:["No ",l.toLowerCase()]})}),e[3]=g,e[4]=l,e[5]=p,e[6]=d):d=e[6];let a;e[7]!==l?(a=n.jsxs("label",{className:"mb-1 block text-xs text-muted-foreground",children:[l," URL"]}),e[7]=l,e[8]=a):a=e[8];let i;e[9]!==c||e[10]!==f?(i=v=>{const{field:m}=v;return n.jsx(ue,{...m,onChange:C=>{m.onChange(C),c()},onBlur:()=>{m.onBlur(),f()},placeholder:"https://..."})},e[9]=c,e[10]=f,e[11]=i):i=e[11];let u;e[12]!==s.control||e[13]!==o||e[14]!==i?(u=n.jsx(fe,{control:s.control,name:o,render:i}),e[12]=s.control,e[13]=o,e[14]=i,e[15]=u):u=e[15];let h;e[16]!==a||e[17]!==u?(h=n.jsxs("div",{className:"flex-1",children:[a,u]}),e[16]=a,e[17]=u,e[18]=h):h=e[18];let x;return e[19]!==d||e[20]!==h?(x=n.jsxs("div",{className:"flex items-start gap-3",children:[d,h]}),e[19]=d,e[20]=h,e[21]=x):x=e[21],x}function dt(t){const e=K.c(4),{form:s,onFieldChange:o,onFieldCommit:l}=t;let r;return e[0]!==s||e[1]!==o||e[2]!==l?(r=n.jsx(we,{title:"Logos & Images",children:n.jsxs("div",{className:"space-y-3",children:[n.jsx(Se,{form:s,name:"logo",label:"Logo",onFieldChange:o,onFieldCommit:l}),n.jsx(Se,{form:s,name:"favicon",label:"Favicon",imgClassName:"h-12 w-12 object-contain",onFieldChange:o,onFieldCommit:l}),n.jsx(Se,{form:s,name:"ogImage",label:"SEO / OG image",imgClassName:"h-full w-full object-contain",onFieldChange:o,onFieldCommit:l})]})}),e[0]=s,e[1]=o,e[2]=l,e[3]=r):r=e[3],r}const mt=[{key:"heading",label:"Headings"},{key:"body",label:"Body"},{key:"code",label:"Code"}];function ft(t){const e=K.c(6),{form:s,onFieldChange:o,onFieldCommit:l}=t;let r;e[0]!==s||e[1]!==o||e[2]!==l?(r=mt.map(f=>{const{key:g,label:b}=f,p=`fonts.${g}`,d=s.watch(p);return n.jsxs("div",{children:[n.jsxs("label",{className:"mb-1 flex items-center gap-3 text-xs text-muted-foreground",children:[n.jsx("span",{className:"w-7 text-base font-medium leading-none text-foreground",children:"Aa"}),n.jsx("span",{children:b}),d&&n.jsx("span",{className:"ml-auto truncate text-foreground",style:{fontFamily:d},children:d})]}),n.jsx(fe,{control:s.control,name:p,render:a=>{const{field:i}=a;return n.jsx(ue,{...i,value:i.value??"",onChange:u=>{i.onChange(u),o()},onBlur:()=>{i.onBlur(),l()},placeholder:`Font family for ${b.toLowerCase()}`})}})]},g)}),e[0]=s,e[1]=o,e[2]=l,e[3]=r):r=e[3];let c;return e[4]!==r?(c=n.jsx(we,{title:"Fonts",children:n.jsx("div",{className:"space-y-2",children:r})}),e[4]=r,e[5]=c):c=e[5],c}const ut=[{key:"primary",label:"Primary"},{key:"secondary",label:"Secondary"},{key:"accent",label:"Accent"},{key:"background",label:"Background"},{key:"foreground",label:"Foreground"}];function xt(t){const e=K.c(6),{form:s,onFieldChange:o,onFieldCommit:l}=t;let r;e[0]!==s||e[1]!==o||e[2]!==l?(r=ut.map(f=>{const{key:g,label:b}=f,p=`colors.${g}`;return n.jsx(fe,{control:s.control,name:p,render:d=>{const{field:a}=d;return n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("input",{type:"color",value:a.value??"#000000",onChange:i=>{a.onChange(i.target.value),o()},onBlur:()=>{a.onBlur(),l()},className:"h-9 w-9 shrink-0 cursor-pointer rounded-lg border border-border bg-transparent p-0.5"}),n.jsx(ue,{value:a.value??"",onChange:i=>{a.onChange(i.target.value),o()},onBlur:()=>{a.onBlur(),l()},placeholder:"#000000",className:"w-28"}),n.jsx("span",{className:"flex-1 text-xs text-muted-foreground",children:b})]})}},g)}),e[0]=s,e[1]=o,e[2]=l,e[3]=r):r=e[3];let c;return e[4]!==r?(c=n.jsx(we,{title:"Colors",children:n.jsx("div",{className:"space-y-2",children:r})}),e[4]=r,e[5]=c):c=e[5],c}function gt(t){const e=K.c(127),{brand:s,onChanged:o}=t,l=$e(),[r,c]=Te.useState(s.isDefault??!1),[f,g]=Te.useState(!1),b=s.name??"",p=s.domain??"",d=s.overview??"",a=s.logo??"",i=s.favicon??"",u=s.ogImage??"";let h;e[0]!==s.fonts?(h=s.fonts??{},e[0]=s.fonts,e[1]=h):h=e[1];let x;e[2]!==s.colors?(x=s.colors??{},e[2]=s.colors,e[3]=x):x=e[3];let v;e[4]!==b||e[5]!==p||e[6]!==d||e[7]!==a||e[8]!==i||e[9]!==u||e[10]!==h||e[11]!==x?(v={values:{name:b,domain:p,overview:d,logo:a,favicon:i,ogImage:u,fonts:h,colors:x}},e[4]=b,e[5]=p,e[6]=d,e[7]=a,e[8]=i,e[9]=u,e[10]=h,e[11]=x,e[12]=v):v=e[12];const m=Ue(v);let C;e[13]!==s.id||e[14]!==l?(C={mutationFn:async j=>{const ve=Object.values(j.fonts).some(wt),Ce=Object.values(j.colors).some(_t);await l.call("BRAND_CONTEXT_UPDATE",{id:s.id,name:j.name,domain:j.domain,overview:j.overview,logo:j.logo||null,favicon:j.favicon||null,ogImage:j.ogImage||null,fonts:ve?j.fonts:null,colors:Ce?j.colors:null})},onError:Nt},e[13]=s.id,e[14]=l,e[15]=C):C=e[15];const k=ge(C);let D;e[16]!==s.id||e[17]!==m||e[18]!==o||e[19]!==k?(D={delayMs:500,save:async()=>{const j=m.control._formState.dirtyFields,ve=Object.keys(j);if(ve.length===0)return;const Ce=m.getValues(),Pe=m.control._defaultValues;m.reset(Ce,{keepValues:!0});try{await k.mutateAsync(Ce),H("brand_updated",{brand_id:s.id,fields:ve}),L.success("Brand context updated successfully"),o()}catch{m.reset(Pe,{keepValues:!0})}}},e[16]=s.id,e[17]=m,e[18]=o,e[19]=k,e[20]=D):D=e[20];const{schedule:y,flush:_}=ot(D);let $;e[21]!==s.id||e[22]!==l?($=async()=>{await l.call("BRAND_CONTEXT_DELETE",{id:s.id})},e[21]=s.id,e[22]=l,e[23]=$):$=e[23];let P;e[24]!==s.id||e[25]!==o?(P=()=>{H("brand_deleted",{brand_id:s.id}),g(!1),o(),L.success("Brand deleted")},e[24]=s.id,e[25]=o,e[26]=P):P=e[26];let q;e[27]!==$||e[28]!==P?(q={mutationFn:$,onSuccess:P,onError:Ct},e[27]=$,e[28]=P,e[29]=q):q=e[29];const{mutate:U,isPending:N}=ge(q);let A;e[30]!==s.id||e[31]!==s.isDefault||e[32]!==l?(A=async()=>{await l.call("BRAND_CONTEXT_UPDATE",{id:s.id,isDefault:!s.isDefault})},e[30]=s.id,e[31]=s.isDefault,e[32]=l,e[33]=A):A=e[33];let B;e[34]!==s.id||e[35]!==s.isDefault||e[36]!==o?(B=()=>{H(s.isDefault?"brand_unset_as_default":"brand_set_as_default",{brand_id:s.id}),o(),L.success(s.isDefault?"Removed as default brand":"Set as default brand")},e[34]=s.id,e[35]=s.isDefault,e[36]=o,e[37]=B):B=e[37];let T;e[38]!==A||e[39]!==B?(T={mutationFn:A,onSuccess:B,onError:vt},e[38]=A,e[39]=B,e[40]=T):T=e[40];const{mutate:X}=ge(T),xe=s.isDefault?"border-primary/30":"border-border/60";let O;e[41]!==xe?(O=_e("rounded-2xl border bg-background",xe),e[41]=xe,e[42]=O):O=e[42];let z;e[43]!==r?(z=()=>c(!r),e[43]=r,e[44]=z):z=e[44];let E;e[45]!==r?(E=n.jsx("span",{className:"shrink-0 text-muted-foreground",children:r?n.jsx(Xe,{size:14}):n.jsx(He,{size:14})}),e[45]=r,e[46]=E):E=e[46];let F;e[47]!==s.logo||e[48]!==s.name?(F=s.logo?n.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center overflow-hidden rounded-lg",style:{backgroundImage:"linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%), linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%)",backgroundSize:"6px 6px",backgroundPosition:"0 0, 3px 3px",backgroundColor:"#fff"},children:n.jsx("img",{src:s.logo,alt:"",className:"h-full w-full object-contain p-1",onError:yt})}):n.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-muted",children:n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:s.name?.charAt(0)?.toUpperCase()||"?"})}),e[47]=s.logo,e[48]=s.name,e[49]=F):F=e[49];const I=s.name||"Untitled Brand";let S;e[50]!==I?(S=n.jsx("span",{className:"text-sm font-medium text-foreground",children:I}),e[50]=I,e[51]=S):S=e[51];let R;e[52]!==s.domain?(R=s.domain&&n.jsx("span",{className:"truncate text-xs text-muted-foreground",children:s.domain}),e[52]=s.domain,e[53]=R):R=e[53];let w;e[54]!==S||e[55]!==R?(w=n.jsxs("div",{className:"flex flex-1 flex-col items-start gap-0.5 overflow-hidden text-left",children:[S,R]}),e[54]=S,e[55]=R,e[56]=w):w=e[56];let M;e[57]!==s.colors||e[58]!==r?(M=!r&&s.colors&&Object.values(s.colors).some(jt)&&n.jsx("div",{className:"flex shrink-0 gap-1",children:Object.entries(s.colors).filter(bt).map(pt)}),e[57]=s.colors,e[58]=r,e[59]=M):M=e[59];let V;e[60]!==s.fonts||e[61]!==r?(V=!r&&s.fonts&&Object.values(s.fonts).some(ht)&&n.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:Object.values(s.fonts).filter(Boolean).join(", ")}),e[60]=s.fonts,e[61]=r,e[62]=V):V=e[62];const De=s.isDefault?"opacity-100":"opacity-0 hover:bg-muted group-hover:opacity-100";let Q;e[63]!==De?(Q=_e("flex h-7 w-7 shrink-0 items-center justify-center rounded-lg transition-opacity",De),e[63]=De,e[64]=Q):Q=e[64];let G,Y;e[65]!==X?(G=j=>{j.stopPropagation(),X()},Y=j=>{j.key==="Enter"&&(j.stopPropagation(),X())},e[65]=X,e[66]=G,e[67]=Y):(G=e[66],Y=e[67]);const ke=s.isDefault?"Unset as default":"Set as default",Be=s.isDefault?"text-primary fill-primary":"text-muted-foreground";let J;e[68]!==Be?(J=_e(Be),e[68]=Be,e[69]=J):J=e[69];let W;e[70]!==J?(W=n.jsx(Me,{size:13,className:J}),e[70]=J,e[71]=W):W=e[71];let Z;e[72]!==Q||e[73]!==G||e[74]!==Y||e[75]!==ke||e[76]!==W?(Z=n.jsx("span",{role:"button",tabIndex:0,className:Q,onClick:G,onKeyDown:Y,title:ke,children:W}),e[72]=Q,e[73]=G,e[74]=Y,e[75]=ke,e[76]=W,e[77]=Z):Z=e[77];let he,pe;e[78]===Symbol.for("react.memo_cache_sentinel")?(he=j=>{j.stopPropagation(),g(!0)},pe=j=>{j.key==="Enter"&&(j.stopPropagation(),g(!0))},e[78]=he,e[79]=pe):(he=e[78],pe=e[79]);let be;e[80]===Symbol.for("react.memo_cache_sentinel")?(be=n.jsx("span",{role:"button",tabIndex:0,className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-lg opacity-0 transition-opacity hover:bg-destructive/10 group-hover:opacity-100",onClick:he,onKeyDown:pe,title:"Delete brand",children:n.jsx(Qe,{size:13,className:"text-muted-foreground"})}),e[80]=be):be=e[80];let ee;e[81]!==z||e[82]!==E||e[83]!==F||e[84]!==w||e[85]!==M||e[86]!==V||e[87]!==Z?(ee=n.jsxs("button",{type:"button",className:"flex w-full items-center gap-3 p-5",onClick:z,children:[E,F,w,M,V,Z,be]}),e[81]=z,e[82]=E,e[83]=F,e[84]=w,e[85]=M,e[86]=V,e[87]=Z,e[88]=ee):ee=e[88];let te;e[89]!==r||e[90]!==_||e[91]!==m||e[92]!==y?(te=r&&n.jsxs("div",{className:"space-y-3 px-5 pb-5",children:[n.jsx(it,{form:m,onFieldChange:y,onFieldCommit:_}),n.jsx(dt,{form:m,onFieldChange:y,onFieldCommit:_}),n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsx(xt,{form:m,onFieldChange:y,onFieldCommit:_}),n.jsx(ft,{form:m,onFieldChange:y,onFieldCommit:_})]})]}),e[89]=r,e[90]=_,e[91]=m,e[92]=y,e[93]=te):te=e[93];let se;e[94]!==N?(se=j=>{!j&&!N&&g(!1)},e[94]=N,e[95]=se):se=e[95];let je;e[96]===Symbol.for("react.memo_cache_sentinel")?(je=n.jsx(Ye,{children:"Delete brand?"}),e[96]=je):je=e[96];const Ee=s.name||"this brand";let ne;e[97]!==Ee?(ne=n.jsxs("p",{children:["This will permanently delete"," ",n.jsx("span",{className:"font-medium text-foreground",children:Ee}),". This action cannot be undone."]}),e[97]=Ee,e[98]=ne):ne=e[98];let le;e[99]!==s.isDefault?(le=s.isDefault&&n.jsxs("p",{className:"mt-2 rounded-lg border border-destructive/30 bg-destructive/5 p-2 text-destructive",children:[n.jsx("span",{className:"font-medium",children:"Heads up:"})," this is your organization's default brand. Deleting it will leave your organization without a default brand until you set another."]}),e[99]=s.isDefault,e[100]=le):le=e[100];let oe;e[101]!==ne||e[102]!==le?(oe=n.jsxs(Je,{children:[je,n.jsx(We,{asChild:!0,children:n.jsxs("div",{children:[ne,le]})})]}),e[101]=ne,e[102]=le,e[103]=oe):oe=e[103];let re;e[104]!==N?(re=n.jsx(Ze,{disabled:N,children:"Cancel"}),e[104]=N,e[105]=re):re=e[105];let ae;e[106]!==U?(ae=j=>{j.preventDefault(),U()},e[106]=U,e[107]=ae):ae=e[107];const Fe=N?"Deleting...":"Delete";let ie;e[108]!==N||e[109]!==ae||e[110]!==Fe?(ie=n.jsx(et,{onClick:ae,disabled:N,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Fe}),e[108]=N,e[109]=ae,e[110]=Fe,e[111]=ie):ie=e[111];let ce;e[112]!==re||e[113]!==ie?(ce=n.jsxs(tt,{children:[re,ie]}),e[112]=re,e[113]=ie,e[114]=ce):ce=e[114];let de;e[115]!==oe||e[116]!==ce?(de=n.jsxs(st,{children:[oe,ce]}),e[115]=oe,e[116]=ce,e[117]=de):de=e[117];let me;e[118]!==f||e[119]!==se||e[120]!==de?(me=n.jsx(nt,{open:f,onOpenChange:se,children:de}),e[118]=f,e[119]=se,e[120]=de,e[121]=me):me=e[121];let ye;return e[122]!==O||e[123]!==ee||e[124]!==te||e[125]!==me?(ye=n.jsxs("div",{className:O,children:[ee,te,me]}),e[122]=O,e[123]=ee,e[124]=te,e[125]=me,e[126]=ye):ye=e[126],ye}function ht(t){return t}function pt(t){const[e,s]=t;return n.jsx("div",{className:"h-5 w-5 rounded-full border border-border/40",style:{backgroundColor:s},title:`${e}: ${s}`},e)}function bt(t){const[,e]=t;return e}function jt(t){return t}function yt(t){t.target.style.display="none"}function vt(){return L.error("Failed to update default brand")}function Ct(){return L.error("Failed to delete brand")}function Nt(){return L.error("Failed to save brand context")}function _t(t){return t?.trim()}function wt(t){return t?.trim()}function Dt(){const t=K.c(53),{brandExtractEnabled:e}=ze(),{org:s}=Ie(),o=$e(),l=Le();let r;t[0]!==s.id?(r=Oe.brandContext(s.id),t[0]=s.id,t[1]=r):r=t[1];let c;t[2]!==o?(c=async()=>{const{items:w}=await o.call("BRAND_CONTEXT_LIST",{includeArchived:!1});return w},t[2]=o,t[3]=c):c=t[3];let f;t[4]!==r||t[5]!==c?(f={queryKey:r,queryFn:c},t[4]=r,t[5]=c,t[6]=f):f=t[6];const{data:g}=Ke(f),p=(g===void 0?[]:g).filter(Et);let d;t[7]!==s.id||t[8]!==l?(d=()=>l.invalidateQueries({queryKey:Oe.brandContext(s.id),refetchType:"all"}),t[7]=s.id,t[8]=l,t[9]=d):d=t[9];const a=d;let i;t[10]!==o?(i=async()=>{await o.call("BRAND_CONTEXT_CREATE",{name:"New Brand",domain:"example.com",overview:""})},t[10]=o,t[11]=i):i=t[11];let u;t[12]!==a?(u=()=>{H("brand_created"),a(),L.success("Brand created")},t[12]=a,t[13]=u):u=t[13];let h;t[14]!==i||t[15]!==u?(h={mutationFn:i,onSuccess:u,onError:Bt},t[14]=i,t[15]=u,t[16]=h):h=t[16];const{mutate:x,isPending:v}=ge(h);let m;t[17]!==o?(m=async w=>{H("brand_extract_started",{domain:w}),await o.call("BRAND_CONTEXT_EXTRACT",{domain:w})},t[17]=o,t[18]=m):m=t[18];let C;t[19]!==a?(C=()=>{H("brand_extract_succeeded"),a(),L.success("Brand extracted successfully")},t[19]=a,t[20]=C):C=t[20];let k;t[21]!==m||t[22]!==C?(k={mutationFn:m,onSuccess:C,onError:kt},t[21]=m,t[22]=C,t[23]=k):k=t[23];const{mutate:D,isPending:y}=ge(k),_=Ne,$=Ne,P=Ne,q="flex flex-col gap-6";let U;t[24]===Symbol.for("react.memo_cache_sentinel")?(U=n.jsxs("div",{children:[n.jsx(Ne.Title,{children:"Brand Context"}),n.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Define your brand profiles. Each brand is available as an MCP prompt for AI clients."})]}),t[24]=U):U=t[24];let N;t[25]!==x?(N=()=>x(),t[25]=x,t[26]=N):N=t[26];let A;t[27]===Symbol.for("react.memo_cache_sentinel")?(A=n.jsx(Re,{size:14}),t[27]=A):A=t[27];let B;t[28]!==v||t[29]!==N?(B=n.jsxs("div",{className:"flex items-center justify-between",children:[U,n.jsxs(Ae,{variant:"outline",onClick:N,disabled:v,children:[A,"Add Brand"]})]}),t[28]=v,t[29]=N,t[30]=B):B=t[30];let T;t[31]!==e||t[32]!==D||t[33]!==y?(T=e&&n.jsx(at,{onExtract:w=>D(w),isExtracting:y}),t[31]=e,t[32]=D,t[33]=y,t[34]=T):T=t[34];const X=p.length===0&&n.jsxs("div",{className:"rounded-2xl border border-dashed border-border bg-muted/30 p-8 text-center",children:[n.jsx("p",{className:"text-sm text-muted-foreground",children:"No brands configured yet."}),n.jsxs(Ae,{variant:"outline",size:"sm",className:"mt-3",onClick:()=>x(),disabled:v,children:[n.jsx(Re,{size:14}),"Add your first brand"]})]}),xe="group space-y-3";let O;t[35]!==a?(O=w=>n.jsx(gt,{brand:w,onChanged:a},w.id),t[35]=a,t[36]=O):O=t[36];const z=p.map(O);let E;t[37]!==z?(E=n.jsx("div",{className:xe,children:z}),t[37]=z,t[38]=E):E=t[38];let F;t[39]!==B||t[40]!==T||t[41]!==X||t[42]!==E?(F=n.jsxs("div",{className:q,children:[B,T,X,E]}),t[39]=B,t[40]=T,t[41]=X,t[42]=E,t[43]=F):F=t[43];let I;t[44]!==P.Body||t[45]!==F?(I=n.jsx(P.Body,{children:F}),t[44]=P.Body,t[45]=F,t[46]=I):I=t[46];let S;t[47]!==$.Content||t[48]!==I?(S=n.jsx($.Content,{children:I}),t[47]=$.Content,t[48]=I,t[49]=S):S=t[49];let R;return t[50]!==_||t[51]!==S?(R=n.jsx(_,{children:S}),t[50]=_,t[51]=S,t[52]=R):R=t[52],R}function kt(t){H("brand_extract_failed",{error:t instanceof Error?t.message:"unknown"}),L.error(t instanceof Error?t.message:"Failed to extract brand")}function Bt(){return L.error("Failed to create brand")}function Et(t){return!t.archivedAt}function Zt(){const t=K.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(rt,{capability:"org:manage",area:"brand context",children:n.jsx(Dt,{})}),t[0]=e):e=t[0],e}export{Zt as default};
@@ -1 +0,0 @@
1
- import{c as a,n as o,a4 as c,j as t,$ as m,B as u,K as x}from"./index-CsZhMKFM.js";function f(){const e=a.c(5),l=o(),{locator:n}=c();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("div",{className:"flex h-16 w-16 items-center justify-center rounded-full bg-muted text-muted-foreground",children:t.jsx(m,{size:28})}),e[0]=s):s=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsxs("div",{className:"space-y-1",children:[t.jsx("h3",{className:"text-lg font-medium",children:"Couldn't load your permissions"}),t.jsx("p",{className:"mx-auto max-w-sm text-sm text-muted-foreground",children:"Something went wrong checking your access. This is usually temporary."})]}),e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==l?(r=t.jsxs("div",{className:"flex h-full min-h-[60vh] flex-1 flex-col items-center justify-center gap-4 p-6 text-center",children:[s,i,t.jsx(u,{variant:"outline",size:"sm",onClick:()=>l.invalidateQueries({queryKey:x.myCapabilities(n)}),children:"Try again"})]}),e[2]=n,e[3]=l,e[4]=r):r=e[4],r}export{f as C};
@@ -1 +0,0 @@
1
- import{c as y,j as t,B as F,i as X,H as Ye,I as se,U as Pe,r as T,a4 as ie,M as Ge,l as V,bc as Qe,u as Xe,L as Y,t as Ze,e as ae,aY as ke}from"./index-CsZhMKFM.js";import{E as Ae}from"./empty-state-DD15-E7x.js";import{u as et,a as Ee}from"./use-collections-Cl7KVWNQ.js";import{u as ce}from"./use-mcp-client-Bv8WGceO.js";import{F as ne,a as tt,b as de,d as me}from"./form-YJrSMpNL.js";import{I as ue}from"./input-D5ccsU_1.js";import{T as le}from"./textarea-DPLwPKZJ.js";import{a as st,b as nt,V as pe,O as ot,M as rt}from"./index-MwzluG1w.js";import{ar as lt,L as it,an as at,U as ct,ae as dt,as as mt,Y as be}from"./agent-icon-dPkJbbXq.js";import{g as ut,M as pt,a as Ne}from"./index-DPzJsdBC.js";import{A as xt,a as ft,b as ht}from"./alert-DBWDLZgp.js";import{S as ve,a as Se,b as ye,c as we,d as oe}from"./select-CVMXwLRV.js";import{c as gt,T as Ce,a as Ie,b as $e}from"./tooltip-Cs5hng3q.js";import{i as jt}from"./AlertCircle-BsA2wZmN.js";import{s as bt}from"./Stars02-HLp9q8iP.js";import{a as Nt}from"./Copy01-b3lIb5yu.js";import{i as vt}from"./Play-Ci1OqtIO.js";import{i as St}from"./ChevronRight-C3Tgk-3m.js";import{g as yt}from"./connection-slug-eyAPH6o3.js";import{u as wt,T as Ct}from"./tools-list-DyAKlhYk.js";import{a as Oe,u as Re}from"./use-connection-CcLotHiI.js";import{a as It}from"./use-mcp-tools-_p3Gu3UX.js";import{M as $t,c as Tt}from"./monaco-editor-CiP0ChuC.js";import{I as Te}from"./integration-icon-6pGkEdul.js";import{h as Pt,m as kt}from"./chat-context-Awe2cIoY.js";import{u as At}from"./shell-layout-Bi4LjwsI.js";import{n as Et}from"./Tool02-CSTMjTef.js";import"./constants-CaIX_f5U.js";import"./auth-D_bm0-t3.js";import"./label-BULuaMoF.js";import"./index-DS3hrf0F.js";import"./sidebar-DRSu2iBz.js";import"./LayoutLeft-DvNM8qhm.js";import"./use-mobile-DhhfLpzh.js";import"./X-OFSHASit.js";import"./ZoomOut-DYAXxr_v.js";import"./Key01-1r4YrQER.js";import"./extract-connection-data-Di6SAuY0.js";import"./use-registry-connections-xg-zrNmx.js";import"./use-organization-settings-C4hP3pVq.js";import"./studio-tools-CTswP4mA.js";import"./Plus-Cgq7ON9K.js";import"./index-Cyr1IOqy.js";import"./index-DKyQrM3l.js";import"./popover-C5PoRwEk.js";import"./use-virtual-mcp-CMvxAHEJ.js";import"./Check-CcLLJc-z.js";import"./SearchMd-ZfoTl6vw.js";import"./Users03-tGwfKVJc.js";import"./use-create-virtual-mcp-DPkT8FPW.js";import"./use-navigate-to-agent-BsdctirU.js";import"./hooks-GnFkomrq.js";import"./decopilot-sse-pool-CJtSg3wj.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./reusable-new-chat-CouMjkYR.js";import"./Tool01-DVCGutKV.js";import"./ArrowUp-CDnEKV2Y.js";import"./Settings02-CS2jOfO5.js";import"./XCircle-D3cI1Aep.js";import"./ArrowUpRight-DdPCnlNm.js";import"./TrendUp01-acR-ekUr.js";import"./ZapSquare-Dzb50Gix.js";import"./Loading02-Dx-xiZND.js";import"./CheckCircle-lXciCGfG.js";import"./ChevronDown-BmFaSDo8.js";import"./ChevronUp-Dew3RmKl.js";import"./Circle-C_fdyhr8.js";import"./DotsVertical-CK1a4mKj.js";import"./Globe01-B6kdhpV9.js";import"./Eye-DM8bmzm7.js";import"./FilterLines-DCNZa1GS.js";import"./Star01-2DHf7kTZ.js";import"./Globe04-CGLGspo5.js";import"./SwitchHorizontal01-ilLzkPr_.js";import"./HardDrive-CR6Rs-a1.js";import"./LinkExternal01-Ck4lryDE.js";import"./List-DfPIAPM_.js";import"./Monitor01-D_DrBwt_.js";import"./Sun-ByaEjJ0N.js";import"./Package-CV2Q9Uup.js";import"./Palette-BY5BmUDa.js";import"./SearchLg-2as_l8YT.js";import"./Shield01-C6TdRfmI.js";import"./Stars01-BEHbN5c3.js";import"./Trash01--uX5q_ti.js";import"./Upload01-BaheeKQP.js";import"./User01-5hu8D3_O.js";import"./Users01-Dh5E4dqf.js";import"./XClose-D5Ra7e-f.js";import"./Zap-CgjpaG4V.js";import"./mcp-oauth-z9GFPjDo.js";import"./badge-BMMjntMn.js";import"./index-Cim2j5YD.js";import"./autosend-qB5BaOSA.js";import"./use-ai-providers-D77UFwvU.js";import"./use-decopilot-events-CWf9qNc0.js";import"./tab-id-bb-jjgGv.js";import"./avatar-DOYkgu8W.js";import"./dialog-DZtdYFi_.js";import"./alert-dialog-Bd5XLC3F.js";import"./required-auth-layout-R2McgzF5.js";import"./use-org-sso-DDm0m5Eb.js";function Ot(s){const e=y.c(15),{onSave:o,onUndo:n,isDirty:r,isSaving:l,saveLabel:a,undoLabel:c}=s,i=a===void 0?"Save":a,u=c===void 0?"Undo":c;if(!r)return null;let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(lt,{size:14}),e[0]=p):p=e[0];let m;e[1]!==l||e[2]!==n||e[3]!==u?(m=t.jsxs(F,{variant:"outline",size:"sm",onClick:n,disabled:l,"aria-label":u,children:[p,u]}),e[1]=l,e[2]=n,e[3]=u,e[4]=m):m=e[4];let x;e[5]!==l?(x=l?t.jsx(X,{size:14,className:"animate-spin"}):t.jsx(it,{size:14}),e[5]=l,e[6]=x):x=e[6];let f;e[7]!==l||e[8]!==o||e[9]!==i||e[10]!==x?(f=t.jsxs(F,{variant:"default",size:"sm",onClick:o,disabled:l,"aria-label":i,children:[x,i]}),e[7]=l,e[8]=o,e[9]=i,e[10]=x,e[11]=f):f=e[11];let g;return e[12]!==m||e[13]!==f?(g=t.jsxs(t.Fragment,{children:[m,f]}),e[12]=m,e[13]=f,e[14]=g):g=e[14],g}Ye({title:se().min(1),description:se().nullable(),body:se()});function re(s){for(const e of s.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function Rt(){const s=window.location.pathname.split("/").filter(Boolean),e=s.findIndex(n=>n==="mcps"),o=e>=0?s[e+1]:void 0;return o?decodeURIComponent(o):void 0}function _t(s){const e=y.c(13),{form:o}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Details"}),e[0]=n):n=e[0];let r;e[1]!==o.control?(r=t.jsxs("div",{className:"flex flex-col gap-4",children:[n,t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsx(ne,{control:o.control,name:"title",render:zt}),t.jsx(ne,{control:o.control,name:"description",render:Dt})]})]}),e[1]=o.control,e[2]=r):r=e[2];let l,a;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Message"}),a=t.jsx("div",{className:"text-xs text-muted-foreground",children:"This becomes the user message in the prompt."}),e[3]=l,e[4]=a):(l=e[3],a=e[4]);let c;e[5]!==o.control?(c=t.jsxs("div",{className:"flex flex-col gap-2",children:[l,a,t.jsx(ne,{control:o.control,name:"body",render:Mt})]}),e[5]=o.control,e[6]=c):c=e[6];let i;e[7]!==r||e[8]!==c?(i=t.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:[r,c]}),e[7]=r,e[8]=c,e[9]=i):i=e[9];let u;return e[10]!==o||e[11]!==i?(u=t.jsx(tt,{...o,children:i}),e[10]=o,e[11]=i,e[12]=u):u=e[12],u}function Mt(s){const{field:e}=s;return t.jsx(de,{children:t.jsx(me,{children:t.jsx(le,{...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 Dt(s){const{field:e}=s;return t.jsxs(de,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),t.jsx(me,{children:t.jsx(ue,{...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 zt(s){const{field:e}=s;return t.jsxs(de,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),t.jsx(me,{children:t.jsx(ue,{...e,placeholder:"Untitled prompt",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Lt(s){const e=y.c(36),{providerId:o,promptId:n}=s,{org:r}=ie(),l=o||null;let a;e[0]!==r.id||e[1]!==r.slug||e[2]!==l?(a={connectionId:l,orgId:r.id,orgSlug:r.slug},e[0]=r.id,e[1]=r.slug,e[2]=l,e[3]=a):a=e[3];const c=ce(a),i=et(o,"PROMPT",n,c),u=Ee(o,"PROMPT",c),p=u.update.isPending;let m;e[4]!==i?(m=i?{title:i.title,description:i.description??null,body:re(i)}:void 0,e[4]=i,e[5]=m):m=e[5];let x;e[6]!==m?(x={values:m},e[6]=m,e[7]=x):x=e[7];const f=Ge(x);let g;e[8]!==f||e[9]!==i?(g=()=>{i&&f.reset({title:i.title,description:i.description??null,body:re(i)})},e[8]=f,e[9]=i,e[10]=g):g=e[10];const S=g;let I;e[11]!==u.update||e[12]!==f||e[13]!==n?(I=f.handleSubmit(async N=>{const E=await u.update.mutateAsync({id:n,data:{title:N.title,description:N.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:N.body}}]}});f.reset({title:E.title,description:E.description??null,body:re(E)})}),e[11]=u.update,e[12]=f,e[13]=n,e[14]=I):I=e[14];const R=I;if(!i){let N;return e[15]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ae,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[15]=N):N=e[15],N}let $;e[16]!==i.title?($=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:i.title}),e[16]=i.title,e[17]=$):$=e[17];let A;e[18]!==i.description?(A=i.description?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),t.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:i.description})]}):null,e[18]=i.description,e[19]=A):A=e[19];let P;e[20]!==$||e[21]!==A?(P=t.jsx(nt,{children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[$,A]})}),e[20]=$,e[21]=A,e[22]=P):P=e[22];let b;e[23]!==R?(b=()=>{R()},e[23]=R,e[24]=b):b=e[24];let w;e[25]!==f.formState.isDirty||e[26]!==p||e[27]!==S||e[28]!==b?(w=t.jsx(st,{children:t.jsx(Ot,{onSave:b,onUndo:S,isDirty:f.formState.isDirty,isSaving:p})}),e[25]=f.formState.isDirty,e[26]=p,e[27]=S,e[28]=b,e[29]=w):w=e[29];let C;e[30]!==f?(C=t.jsx("div",{className:"h-full",children:t.jsx(_t,{form:f})}),e[30]=f,e[31]=C):C=e[31];let k;return e[32]!==w||e[33]!==C||e[34]!==P?(k=t.jsxs(pe,{children:[P,w,C]}),e[32]=w,e[33]=C,e[34]=P,e[35]=k):k=e[35],k}function Ut(s){const e=y.c(4),{itemId:o}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=Rt(),e[0]=n):n=e[0];const r=n;if(!r){let a;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ae,{title:"Prompt not found",description:"Missing connection information in the current route."})}),e[1]=a):a=e[1],a}let l;return e[2]!==o?(l=t.jsx(Pe,{children:t.jsx(T.Suspense,{fallback:null,children:t.jsx(Lt,{providerId:r,promptId:o})})}),e[2]=o,e[3]=l):l=e[3],l}function _e(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let r;e[3]!==o?(r=V("min-w-0 overflow-hidden",o),e[3]=o,e[4]=r):r=e[4];let l;return e[5]!==n||e[6]!==r?(l=t.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",className:r,...n}),e[5]=n,e[6]=r,e[7]=l):l=e[7],l}function Me(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let r;e[3]!==o?(r=V("flex items-center gap-1.5 text-sm sm:gap-2 overflow-hidden",o),e[3]=o,e[4]=r):r=e[4];let l;return e[5]!==n||e[6]!==r?(l=t.jsx("ol",{"data-slot":"breadcrumb-list",className:r,...n}),e[5]=n,e[6]=r,e[7]=l):l=e[7],l}function q(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let r;e[3]!==o?(r=V("inline-flex items-center gap-1.5 min-w-0",o),e[3]=o,e[4]=r):r=e[4];let l;return e[5]!==n||e[6]!==r?(l=t.jsx("li",{"data-slot":"breadcrumb-item",className:r,...n}),e[5]=n,e[6]=r,e[7]=l):l=e[7],l}function G(s){const e=y.c(10);let o,n,r;e[0]!==s?({asChild:o,className:n,...r}=s,e[0]=s,e[1]=o,e[2]=n,e[3]=r):(o=e[1],n=e[2],r=e[3]);const l=o?Qe:"a";let a;e[4]!==n?(a=V("hover:text-foreground transition-colors truncate",n),e[4]=n,e[5]=a):a=e[5];let c;return e[6]!==l||e[7]!==r||e[8]!==a?(c=t.jsx(l,{"data-slot":"breadcrumb-link",className:a,...r}),e[6]=l,e[7]=r,e[8]=a,e[9]=c):c=e[9],c}function De(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let r;e[3]!==o?(r=V("text-foreground font-medium truncate",o),e[3]=o,e[4]=r):r=e[4];let l;return e[5]!==n||e[6]!==r?(l=t.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:r,...n}),e[5]=n,e[6]=r,e[7]=l):l=e[7],l}function Q(s){const e=y.c(12);let o,n,r;e[0]!==s?({children:o,className:n,...r}=s,e[0]=s,e[1]=o,e[2]=n,e[3]=r):(o=e[1],n=e[2],r=e[3]);let l;e[4]!==n?(l=V("[&>svg]:size-3.5 text-muted-foreground opacity-50 list-none shrink-0",n),e[4]=n,e[5]=l):l=e[5];let a;e[6]!==o?(a=o??t.jsx(St,{}),e[6]=o,e[7]=a):a=e[7];let c;return e[8]!==r||e[9]!==l||e[10]!==a?(c=t.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:l,...r,children:a}),e[8]=r,e[9]=l,e[10]=a,e[11]=c):c=e[11],c}const Bt=s=>s.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Ft(s){const e=y.c(11),{toolName:o,connectionId:n,siblings:r,onSelectInstance:l,onBack:a}=s;let c;e[0]!==n?(c={connectionId:n},e[0]=n,e[1]=c):c=e[1];const i=wt(c);if(!i.isAuthenticated){let m;return e[2]!==i.supportsOAuth||e[3]!==a?(m=t.jsx("div",{className:"flex h-full items-center justify-center",children:i.supportsOAuth?t.jsx(ot,{onAuthenticate:()=>a(),buttonText:"Go back to authenticate"}):t.jsx(rt,{hasReadme:!1})}),e[2]=i.supportsOAuth,e[3]=a,e[4]=m):m=e[4],m}const u=`${n}:${o}`;let p;return e[5]!==n||e[6]!==l||e[7]!==r||e[8]!==u||e[9]!==o?(p=t.jsx(Vt,{toolName:o,connectionId:n,siblings:r,onSelectInstance:l},u),e[5]=n,e[6]=l,e[7]=r,e[8]=u,e[9]=o,e[10]=p):p=e[10],p}function Vt({toolName:s,connectionId:e,siblings:o,onSelectInstance:n}){const{replayId:r}=Xe({strict:!1}),l=(()=>{if(!r)return null;const d=`replay-${r}`,h=sessionStorage.getItem(d);if(!h)return null;sessionStorage.removeItem(d);try{return JSON.parse(h)}catch{return null}})(),a=(()=>{if(!l)return null;const d={};for(const[h,v]of Object.entries(l))v!==null&&typeof v=="object"?d[h]=JSON.stringify(v,null,2):d[h]=v;return d})(),[c,i]=T.useState(a??{}),[u,p]=T.useState(l?JSON.stringify(l,null,2):"{}"),[m,x]=T.useState(null),[f,g]=T.useState(null),[S,I]=T.useState(null),[R,$]=T.useState(null),[A,P]=T.useState(!1),[b,w]=T.useState(null),{org:C}=ie(),k=Oe(e),N=Pt(),E=kt(),{openSidePanel:U}=At(),z=`${e}:${s}`,_=ce({connectionId:e,orgId:C.id,orgSlug:C.slug}),L=It({client:_}),j=L.data?.tools?.find(d=>d.name===s),O=ut(j?._meta),J=d=>{if(!N)return;const h=Tt(d.content);h.content.length>0&&(U("chat"),N.sendMessage({tiptapDoc:h}))},[M,Z]=T.useState("json"),[ze,Le]=T.useState(!1);O&&!ze&&(Z("ui"),Le(!0));const xe=j?.inputSchema?.properties,fe=xe?Object.keys(xe):[],H=fe.length>0,K={};if(H&&j?.inputSchema?.properties)for(const d of fe)K[d]=j.inputSchema.required?.includes(d)?"":void 0;const ee=d=>Object.prototype.hasOwnProperty.call(c,d),Ue=async()=>{P(!0),$(null),x(null),g(null),I(null),w(null);const d=performance.now();try{if(!_)throw new Error("MCP client is not available");const h=H?{...K,...c}:(()=>{const D=u.trim();if(!D)return{};const B=JSON.parse(D);if(B&&typeof B=="object")return B;throw new Error("Raw JSON input must be an object.")})();H&&j?.inputSchema?.properties&&Object.entries(j.inputSchema.properties).forEach(([D,B])=>{if((B.type==="object"||B.type==="array")&&typeof h[D]=="string")try{h[D]=JSON.parse(h[D])}catch{}else if((B.type==="number"||B.type==="integer")&&typeof h[D]=="string"&&h[D]!==""){const je=Number(h[D]);Number.isNaN(je)||(h[D]=je)}});const v=await _.callTool({name:s,arguments:h}),W=v.structuredContent??v,He=performance.now(),Ke=Math.round(He-d);x(W),g(v),I(h);const We=JSON.stringify(W),ge=new TextEncoder().encode(We).length;w({duration:`${Ke}ms`,bytes:`${ge} bytes`,tokens:`~${Math.ceil(ge/4)} tokens`,cost:"$0.0000"})}catch(h){const v=h instanceof Error?h.message:String(h);$(v||"Unknown error occurred");const W=performance.now();w({duration:`${Math.round(W-d)}ms`})}finally{P(!1)}},te=(d,h)=>{i(v=>({...v,[d]:h}))},Be=()=>{x(null),g(null),I(null),$(null),w(null)},Fe=j?.name??Bt(s),Ve=t.jsx(_e,{children:t.jsxs(Me,{children:[t.jsx(q,{children:t.jsx(G,{asChild:!0,children:t.jsx(Y,{to:"/$org/settings/connections",params:{org:C.slug},children:"Connections"})})}),t.jsx(Q,{}),k&&t.jsxs(t.Fragment,{children:[t.jsx(q,{children:t.jsx(G,{asChild:!0,children:t.jsx(Y,{to:"/$org/settings/connections/$appSlug",params:{org:C.slug,appSlug:yt(k)},search:{tab:"tools"},children:k.title})})}),t.jsx(Q,{})]}),t.jsx(q,{children:t.jsx(De,{children:Fe})})]})}),he=o.length>1&&t.jsxs(ve,{value:e,onValueChange:n,children:[t.jsx(Se,{className:"h-8 w-auto min-w-[200px]",children:t.jsx(ye,{})}),t.jsx(we,{children:o.map(d=>t.jsx(oe,{value:d.id,children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Te,{icon:d.icon,name:d.title,size:"xs",className:"shrink-0"}),d.title]})},d.id))})]}),Je=t.jsxs("div",{className:"flex flex-col p-6 gap-4 overflow-auto",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-foreground uppercase tracking-wide",children:"Parameters"}),j?.inputSchema?.required&&j.inputSchema.required.length>0&&t.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.jsx("span",{className:"text-red-500",children:"*"})," Required"]})]}),t.jsx("div",{className:"space-y-4",children:H&&j?.inputSchema?.properties?Object.entries(j.inputSchema.properties).map(([d,h])=>t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("label",{className:"text-sm font-medium leading-none flex items-center gap-1.5",children:[d,j.inputSchema?.required?.includes(d)&&t.jsx("span",{className:"text-red-500 text-xs",children:"*"})]}),t.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:h.type})]}),h.description&&t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:h.description}),h.type==="object"||h.type==="array"?t.jsx(le,{className:"font-mono text-xs",value:ee(d)?c[d]??"":K[d]??"",onChange:v=>te(d,v.target.value),placeholder:`Enter ${d} as JSON...`,rows:3}):h.type==="boolean"?t.jsxs(ve,{value:ee(d)?String(c[d]??""):"",onValueChange:v=>te(d,v==="true"),children:[t.jsx(Se,{children:t.jsx(ye,{placeholder:"Select true or false..."})}),t.jsxs(we,{children:[t.jsx(oe,{value:"true",children:"true"}),t.jsx(oe,{value:"false",children:"false"})]})]}):t.jsx(ue,{value:ee(d)?c[d]??"":K[d]??"",onChange:v=>te(d,v.target.value),placeholder:`Enter ${d}...`})]},d)):j?.inputSchema&&!H?t.jsxs("div",{className:"space-y-2",children:[t.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),t.jsx(le,{className:"font-mono text-xs min-h-[120px]",value:u,onChange:d=>p(d.target.value),placeholder:'e.g. { "foo": "bar" }'})]}):t.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"No parameters required"})})}),t.jsx("div",{className:"flex items-center gap-2 pt-2",children:A?t.jsxs(F,{size:"sm",variant:"destructive",className:"h-8 gap-2",onClick:Be,children:[t.jsx(at,{className:"h-3.5 w-3.5"}),"Cancel"]}):t.jsxs(F,{size:"sm",variant:"default",className:"h-8 gap-2",onClick:Ue,children:[t.jsx(vt,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})})]}),qe=t.jsxs("div",{className:"flex flex-col @3xl:h-full @3xl:overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-b border-border bg-background",children:[t.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:"Result"}),t.jsxs("div",{className:"flex items-center gap-3",children:[b&&t.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(bt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.duration})]}),b.tokens&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ct,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.tokens})]}),b.bytes&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(dt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.bytes})]}),b.cost&&t.jsx("div",{className:"flex items-center gap-1.5",children:t.jsx("span",{className:"font-mono text-foreground",children:b.cost})})]}),O&&t.jsx(gt,{children:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(F,{size:"icon",variant:M==="ui"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>Z("ui"),children:t.jsx(mt,{size:14})})}),t.jsx($e,{children:"Interactive view"})]}),t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(F,{size:"icon",variant:M==="json"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>Z("json"),children:t.jsx(be,{size:14})})}),t.jsx($e,{children:"JSON view"})]})]})})]})]}),R&&t.jsx("div",{className:"px-6 py-4 bg-background",children:t.jsx(xt,{variant:"destructive",children:t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(jt,{className:"h-4 w-4"}),t.jsx(ft,{className:"mb-0",children:"Execution Failed"})]}),t.jsx(ht,{className:"text-xs text-destructive",children:R})]})})}),t.jsx("div",{className:"relative flex-1 min-h-[400px] @3xl:min-h-0 @3xl:overflow-auto bg-muted/50",children:O&&M==="ui"&&_?t.jsx(T.Suspense,{fallback:t.jsx("div",{className:"flex items-center justify-center h-48",children:t.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[t.jsx("div",{className:"size-4 border-2 border-current border-t-transparent rounded-full animate-spin"}),t.jsx("span",{className:"text-sm",children:"Loading app..."})]})}),children:t.jsx(pt,{resourceURI:O,toolInfo:j?{tool:j}:void 0,toolInput:S??void 0,toolResult:f??void 0,displayMode:"fullscreen",minHeight:Ne.view.minHeight,maxHeight:Ne.view.maxHeight,client:_,onMessage:J,onUpdateModelContext:d=>E?.setAppContext(z,d),onTeardown:()=>E?.clearAppContext(z),className:"h-full"})}):m?t.jsxs(t.Fragment,{children:[t.jsx($t,{code:JSON.stringify(m,null,2),language:"json",height:"100%",readOnly:!0}),t.jsx(F,{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(m,null,2)),Ze.success("Copied to clipboard")},children:t.jsx(Nt,{className:"h-3.5 w-3.5"})})]}):t.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[t.jsx(be,{className:"h-12 w-12 mb-3 opacity-40"}),t.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]});return t.jsx(pe,{breadcrumb:Ve,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden @container",children:[t.jsxs("div",{className:"flex flex-col gap-3 py-7 px-8 bg-background border-b border-border shrink-0",children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx(Te,{icon:k?.icon||null,name:k?.title||s,size:"xl",className:"shrink-0"}),t.jsx("h1",{className:"text-xl font-semibold tracking-tight text-foreground leading-none truncate",children:s}),t.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-muted/50 rounded-md h-fit shrink-0",children:[L.isSuccess?t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):L.isLoading?t.jsx(X,{size:10,className:"animate-spin text-yellow-500 shrink-0"}):t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-red-500 shrink-0"}),t.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:L.isSuccess?"ready":L.isLoading?"connecting":"error"})]}),t.jsx(Ct,{annotations:j?.annotations,_meta:j?._meta}),t.jsx("div",{className:"hidden @3xl:flex items-center ml-auto shrink-0",children:he})]}),t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:j?.description||"No description available"})]}),o.length>1&&t.jsxs("div",{className:"flex @3xl:hidden items-center gap-3 px-8 py-3 border-b border-border",children:[t.jsx("span",{className:"text-xs font-medium text-muted-foreground shrink-0",children:"Instance"}),he]}),t.jsx("div",{className:"flex-1 overflow-auto @3xl:overflow-hidden",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-[minmax(0,2fr)_minmax(0,5fr)] @3xl:h-full @3xl:grid-rows-1",children:[t.jsx("div",{className:"@3xl:border-r border-border @3xl:overflow-auto",children:Je}),qe]})})]})})}function Jt(s){const e=y.c(10),{itemId:o,siblings:n,onBack:r}=s,[l,a]=T.useState(n[0]?.id??"");let c;e[0]!==l||e[1]!==n?(c=n.find(x=>x.id===l)?.id??n[0]?.id??"",e[0]=l,e[1]=n,e[2]=c):c=e[2];const i=c;if(!Oe(i||void 0)||!i){let x;return e[3]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[t.jsx("h3",{className:"text-lg font-semibold",children:"Connection not found"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection may have been deleted or you may not have access."})]})}),e[3]=x):x=e[3],x}let p;e[4]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(X,{size:32,className:"animate-spin text-muted-foreground"})}),e[4]=p):p=e[4];let m;return e[5]!==i||e[6]!==r||e[7]!==n||e[8]!==o?(m=t.jsx(T.Suspense,{fallback:p,children:t.jsx(Ft,{toolName:o,connectionId:i,siblings:n,onSelectInstance:a,onBack:r})}),e[5]=i,e[6]=r,e[7]=n,e[8]=o,e[9]=m):m=e[9],m}function qt(s){const e=y.c(21),{icon:o,illustration:n,title:r,description:l,buttonProps:a,buttonComponent:c,className:i,children:u}=s;let p;e[0]!==i?(p=V("flex flex-col items-center justify-center py-16 text-center",i),e[0]=i,e[1]=p):p=e[1];let m;e[2]!==o||e[3]!==n?(m=n?t.jsx("div",{className:"mb-4 text-muted-foreground/50",children:n}):o?t.jsx("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-xl bg-muted/50 text-muted-foreground",children:o}):null,e[2]=o,e[3]=n,e[4]=m):m=e[4];let x;e[5]!==r?(x=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:r}),e[5]=r,e[6]=x):x=e[6];let f;e[7]!==l?(f=l&&t.jsx("div",{className:"text-sm text-muted-foreground",children:l}),e[7]=l,e[8]=f):f=e[8];let g;e[9]!==x||e[10]!==f?(g=t.jsxs("div",{className:"flex flex-col items-center gap-1 max-w-sm",children:[x,f]}),e[9]=x,e[10]=f,e[11]=g):g=e[11];let S;e[12]!==c||e[13]!==a?(S=(c??a)&&t.jsx("div",{className:"mt-4",children:c??(a&&t.jsx(F,{size:"sm",className:V(a?.className),...a}))}),e[12]=c,e[13]=a,e[14]=S):S=e[14];let I;return e[15]!==u||e[16]!==p||e[17]!==m||e[18]!==g||e[19]!==S?(I=t.jsxs("div",{className:p,children:[m,g,S,u]}),e[15]=u,e[16]=p,e[17]=m,e[18]=g,e[19]=S,e[20]=I):I=e[20],I}const Ht={prompt:Ut};function Kt(){const s=y.c(9),e=ke();let o;s[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=o):o=s[0];const n=ae(o),r=decodeURIComponent(n.itemId);let l;s[1]!==n.appSlug?(l={slug:n.appSlug},s[1]=n.appSlug,s[2]=l):l=s[2];const a=Re(l);let c;s[3]!==e.history?(c=()=>{e.history.back()},s[3]=e.history,s[4]=c):c=s[4];const i=c,u=Wt;let p;return s[5]!==i||s[6]!==r||s[7]!==a?(p=t.jsx(Jt,{itemId:r,siblings:a,onBack:i,onUpdate:u}),s[5]=i,s[6]=r,s[7]=a,s[8]=p):p=s[8],p}async function Wt(s){return Promise.resolve()}function Yt(s){return s.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Gt(){const s=y.c(41),e=ke();let o;s[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=o):o=s[0];const n=ae(o),r=decodeURIComponent(n.collectionName),l=decodeURIComponent(n.itemId);let a;s[1]!==e.history?(a=()=>{e.history.back()},s[1]=e.history,s[2]=a):a=s[2];const c=a,{org:i}=ie();let u;s[3]!==n.appSlug?(u={slug:n.appSlug},s[3]=n.appSlug,s[4]=u):u=s[4];const m=Re(u)[0]??null,x=m?.id??"",f=x||"no-connection",g=x??null;let S;s[5]!==i.id||s[6]!==i.slug||s[7]!==g?(S={connectionId:g,orgId:i.id,orgSlug:i.slug},s[5]=i.id,s[6]=i.slug,s[7]=g,s[8]=S):S=s[8];const I=ce(S),R=Ee(f,r,I);let $;s[9]!==R||s[10]!==l?($=async M=>{l&&await R.update.mutateAsync({id:l,data:M})},s[9]=R,s[10]=l,s[11]=$):$=s[11];const A=$;let P;s[12]!==r?(P=r?.toLowerCase(),s[12]=r,s[13]=P):P=s[13];const b=P,w=b&&Ht[b];let C;s[14]!==r?(C=Yt(r),s[14]=r,s[15]=C):C=s[15];const k=C;let N;s[16]!==i.slug?(N=t.jsx(q,{children:t.jsx(G,{asChild:!0,children:t.jsx(Y,{to:"/$org/settings/connections",params:{org:i.slug},children:"Connections"})})}),s[16]=i.slug,s[17]=N):N=s[17];let E;s[18]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(Q,{}),s[18]=E):E=s[18];let U;s[19]!==r||s[20]!==m||s[21]!==i.slug||s[22]!==n.appSlug?(U=m&&t.jsxs(t.Fragment,{children:[t.jsx(q,{children:t.jsx(G,{asChild:!0,children:t.jsx(Y,{to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:n.appSlug},search:{tab:r},children:m.title})})}),t.jsx(Q,{})]}),s[19]=r,s[20]=m,s[21]=i.slug,s[22]=n.appSlug,s[23]=U):U=s[23];let z;s[24]!==k?(z=t.jsx(q,{children:t.jsx(De,{children:k})}),s[24]=k,s[25]=z):z=s[25];let _;s[26]!==U||s[27]!==z||s[28]!==N?(_=t.jsx(_e,{children:t.jsxs(Me,{children:[N,E,U,z]})}),s[26]=U,s[27]=z,s[28]=N,s[29]=_):_=s[29];const L=_;if(w){let M;return s[30]!==w||s[31]!==c||s[32]!==A||s[33]!==l?(M=t.jsx(w,{itemId:l,onBack:c,onUpdate:A}),s[30]=w,s[31]=c,s[32]=A,s[33]=l,s[34]=M):M=s[34],M}let j;s[35]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(Et,{size:36,className:"text-muted-foreground"}),s[35]=j):j=s[35];let O;s[36]!==c?(O=t.jsx(qt,{icon:j,title:"No component defined",description:"No component for this collection was defined",buttonProps:{onClick:c,children:"Go back"}}),s[36]=c,s[37]=O):O=s[37];let J;return s[38]!==L||s[39]!==O?(J=t.jsx(pe,{breadcrumb:L,children:O}),s[38]=L,s[39]=O,s[40]=J):J=s[40],J}function Qt(){const s=y.c(3);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=e):e=s[0];const o=ae(e);if(decodeURIComponent(o.collectionName)==="tools"){let a;return s[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(Kt,{}),s[1]=a):a=s[1],a}let l;return s[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(Gt,{}),s[2]=l):l=s[2],l}function Wn(){const s=y.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Pe,{children:t.jsx(T.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(X,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Qt,{})})}),s[0]=e):e=s[0],e}export{Wn as default};