decocms 4.145.4 → 4.146.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 (244) hide show
  1. package/dist/README.md +1 -0
  2. package/dist/client/assets/{AlertCircle-CSQCPj_V.js → AlertCircle-B7r3EaII.js} +1 -1
  3. package/dist/client/assets/{AreaChart-BMJ7Mtx-.js → AreaChart-BymqE9V8.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-B6IlW6Qi.js → ArrowUp-BQshHDSK.js} +1 -1
  5. package/dist/client/assets/{ArrowUpRight-eD5g-cFd.js → ArrowUpRight-BCZbaWin.js} +1 -1
  6. package/dist/client/assets/{Check-CWNssTV8.js → Check-DgYNB0_V.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-DDuWLqUq.js → CheckCircle-CN5-9xsQ.js} +1 -1
  8. package/dist/client/assets/{ChevronDown-BWHEr7M7.js → ChevronDown-CHc-y-Al.js} +1 -1
  9. package/dist/client/assets/{ChevronRight-Bqyf0yi2.js → ChevronRight-9d4jtA28.js} +1 -1
  10. package/dist/client/assets/{ChevronUp-ROaBb_s7.js → ChevronUp-B-O9_nTC.js} +1 -1
  11. package/dist/client/assets/{Copy01-_e4tlhaR.js → Copy01-C5QjOujR.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-C-UD1H-W.js → DotsVertical-BIcnJzPR.js} +1 -1
  13. package/dist/client/assets/{Eye-BZEDG_yV.js → Eye-Cvgl0KNf.js} +1 -1
  14. package/dist/client/assets/{FilterLines-B2iuWHYg.js → FilterLines-DGkZM5wO.js} +1 -1
  15. package/dist/client/assets/{HardDrive-1qI5HKiO.js → HardDrive-Cs2Ept5K.js} +1 -1
  16. package/dist/client/assets/{Key01-AWbv_wld.js → Key01-CABDssnL.js} +1 -1
  17. package/dist/client/assets/{LayoutLeft-CGP9_srE.js → LayoutLeft-B0iWGVbj.js} +1 -1
  18. package/dist/client/assets/{LinkExternal01-BHxU7hA5.js → LinkExternal01-CuFbC-Ib.js} +1 -1
  19. package/dist/client/assets/{LogOut01-BHFIF5pV.js → LogOut01-BTC97zIN.js} +1 -1
  20. package/dist/client/assets/{Monitor01-kMl_aKHS.js → Monitor01-CmLdEM36.js} +1 -1
  21. package/dist/client/assets/{Palette-BStHvqZ6.js → Palette-D7J1kWGW.js} +1 -1
  22. package/dist/client/assets/{Play-CgnGl0Ls.js → Play-eSj6vmxE.js} +1 -1
  23. package/dist/client/assets/{Plus-CSNWQMMp.js → Plus-Ca5ksK2g.js} +1 -1
  24. package/dist/client/assets/{SearchLg-LtdaD4ZG.js → SearchLg-CPBJr8DH.js} +1 -1
  25. package/dist/client/assets/{SearchMd-BEvxAPyw.js → SearchMd-B26GBZrh.js} +1 -1
  26. package/dist/client/assets/{Settings02-DWHb-lRw.js → Settings02-CxyT3aA1.js} +1 -1
  27. package/dist/client/assets/{Shield01-T-UpndO1.js → Shield01-Cv0doLKj.js} +1 -1
  28. package/dist/client/assets/{Star01-qAZqSHYs.js → Star01-CVXcsIV7.js} +1 -1
  29. package/dist/client/assets/{Stars01-CO4iRFT5.js → Stars01-C6tvzvYW.js} +1 -1
  30. package/dist/client/assets/{Stars02-DLFxhacf.js → Stars02-BiPhZp0l.js} +1 -1
  31. package/dist/client/assets/{Sun-Bmj9T9Hs.js → Sun-DuCKp6uv.js} +1 -1
  32. package/dist/client/assets/{SwitchHorizontal01-SFOutJ0F.js → SwitchHorizontal01-BTb2rFJr.js} +1 -1
  33. package/dist/client/assets/{Tool01-DluxhvbR.js → Tool01-CtxHxaVb.js} +1 -1
  34. package/dist/client/assets/{Tool02-5oU4U7Oz.js → Tool02-CT9ZXUaF.js} +1 -1
  35. package/dist/client/assets/{Trash01-BecpyKSB.js → Trash01-a9h5F5OE.js} +1 -1
  36. package/dist/client/assets/{TrendUp01-DxZS9i5H.js → TrendUp01-B0KTJh5U.js} +1 -1
  37. package/dist/client/assets/{Upload01-D6mhS0Il.js → Upload01-Cc8J1X67.js} +1 -1
  38. package/dist/client/assets/{User01-CAYZjCBh.js → User01-DYrVlXdz.js} +1 -1
  39. package/dist/client/assets/{Users01-CJn3nv4f.js → Users01-B0OeOpb3.js} +1 -1
  40. package/dist/client/assets/{Users03-DgykpOrm.js → Users03-CwkNhzLs.js} +1 -1
  41. package/dist/client/assets/{X-CalOG8rP.js → X-Dpv9CfhB.js} +1 -1
  42. package/dist/client/assets/{XCircle-CfbsFoSm.js → XCircle-_qYA_TW_.js} +1 -1
  43. package/dist/client/assets/{XClose-BFk0sz9G.js → XClose-DyN8kvjl.js} +1 -1
  44. package/dist/client/assets/{Zap-BNdcgXgA.js → Zap-CbUqvhH7.js} +1 -1
  45. package/dist/client/assets/{ZapSquare-Dm2_KtgV.js → ZapSquare-BJsaOMIO.js} +1 -1
  46. package/dist/client/assets/{access-gate-BPcsz4E2.js → access-gate-DRL0-3Sz.js} +1 -1
  47. package/dist/client/assets/{add-section-modal-BV6Pejty.js → add-section-modal-C-b1r5D8.js} +1 -1
  48. package/dist/client/assets/{agent-icon-aWRSFV3S.js → agent-icon-UVuzT1cN.js} +1 -1
  49. package/dist/client/assets/{agents-list-Doi_CXpl.js → agents-list-DSB9MzCv.js} +1 -1
  50. package/dist/client/assets/ai-providers-WhunEA4I.js +1 -0
  51. package/dist/client/assets/{alert-C7dLb2xM.js → alert-DzGSEr4W.js} +1 -1
  52. package/dist/client/assets/{alert-dialog-CI_jOgZR.js → alert-dialog-D7aaUEgg.js} +2 -2
  53. package/dist/client/assets/app-editor-DdGWFPsv.js +1 -0
  54. package/dist/client/assets/{auth-ByPgJhb1.js → auth-BIKfPH28.js} +1 -1
  55. package/dist/client/assets/{auth-catchall-BrR9Uohz.js → auth-catchall-EB957YqX.js} +1 -1
  56. package/dist/client/assets/auth-entry-Bw6_-UpI.js +1 -0
  57. package/dist/client/assets/{auth-split-layout-WhFDNx9E.js → auth-split-layout-CqVnmbzx.js} +1 -1
  58. package/dist/client/assets/{authenticate-and-persist-oauth-BjOG3bpy.js → authenticate-and-persist-oauth-CdKnhp_q.js} +1 -1
  59. package/dist/client/assets/{automation-list-row-xT8oiUOD.js → automation-list-row-IdmGWs3t.js} +1 -1
  60. package/dist/client/assets/{automation-runs-BZROadaX.js → automation-runs-qAKBH1Z0.js} +1 -1
  61. package/dist/client/assets/{automations-B0GAyss_.js → automations-BT0hUV83.js} +1 -1
  62. package/dist/client/assets/{avatar-2NkvJFhn.js → avatar-C6aV7hw3.js} +1 -1
  63. package/dist/client/assets/{badge-BkDtGQCF.js → badge-B33YJ7h5.js} +1 -1
  64. package/dist/client/assets/{block-document-5TIiP0i6.js → block-document-DfWCrJb2.js} +1 -1
  65. package/dist/client/assets/{brand-context-BMuLBGKb.js → brand-context-C4P0vyrn.js} +1 -1
  66. package/dist/client/assets/{buckets-DhwsPAZ0.js → buckets-BJGzD4J6.js} +1 -1
  67. package/dist/client/assets/bulk-category-panel-BcSXynyW.js +1 -0
  68. package/dist/client/assets/{calendar-Cd5zs7es.js → calendar-DYOKaG5a.js} +1 -1
  69. package/dist/client/assets/{capability-load-error-C0MHRICc.js → capability-load-error-qbPiIGZj.js} +1 -1
  70. package/dist/client/assets/{card-yJEtZ44f.js → card-CNJcSytc.js} +1 -1
  71. package/dist/client/assets/category-editor-BSunnGC9.js +1 -0
  72. package/dist/client/assets/chat-context-IQhFNrCK.js +36 -0
  73. package/dist/client/assets/{checkbox-5E1V-xvi.js → checkbox-DyIcCVMx.js} +1 -1
  74. package/dist/client/assets/{cli-auth-success-BoXabKLI.js → cli-auth-success-wGPbI1I0.js} +1 -1
  75. package/dist/client/assets/{collection-detail-6rxSJkCq.js → collection-detail-DDpdB3wI.js} +1 -1
  76. package/dist/client/assets/{collection-display-button-CBvgEV5M.js → collection-display-button-IQpgfmoE.js} +1 -1
  77. package/dist/client/assets/{collection-search-vT5mWioA.js → collection-search-DSPRiMjg.js} +1 -1
  78. package/dist/client/assets/{collection-table-wrapper-CEpWE0F9.js → collection-table-wrapper-Z05WN6kF.js} +1 -1
  79. package/dist/client/assets/{collection-tabs-Cm8oTUd7.js → collection-tabs-CrOZFtVh.js} +1 -1
  80. package/dist/client/assets/{command-Dq6iipS5.js → command-Bia5XJF-.js} +1 -1
  81. package/dist/client/assets/{commerce-onboarding-CdsU1n7i.js → commerce-onboarding-DH0DawO2.js} +1 -1
  82. package/dist/client/assets/{companions-core-DBWG3_HY.js → companions-core-HnFl8baM.js} +1 -1
  83. package/dist/client/assets/connect-x5iIXh5i.js +8 -0
  84. package/dist/client/assets/{connection-C42PVCSd.js → connection-BWCT-l_B.js} +1 -1
  85. package/dist/client/assets/{connection-card-CK8a5ay6.js → connection-card-BGFGJ3dJ.js} +1 -1
  86. package/dist/client/assets/connection-detail-qEKau9L0.js +1 -0
  87. package/dist/client/assets/{connection-form-helpers-C2rTDrzA.js → connection-form-helpers-GHi3zYxQ.js} +1 -1
  88. package/dist/client/assets/connections-ZqhZNVLK.js +1 -0
  89. package/dist/client/assets/{decopilot-sse-pool-C1RJsJS0.js → decopilot-sse-pool-BGikXbt8.js} +1 -1
  90. package/dist/client/assets/{dialog-Dq_peVG0.js → dialog-BPjvUNGD.js} +1 -1
  91. package/dist/client/assets/{domain-settings-CtzeSPRr.js → domain-settings-DVqzPc4K.js} +1 -1
  92. package/dist/client/assets/{drawer-BSvXGda-.js → drawer-D-mvJkqQ.js} +1 -1
  93. package/dist/client/assets/{dropdown-menu-BuPKJUY8.js → dropdown-menu-CaL7DApX.js} +1 -1
  94. package/dist/client/assets/{empty-state-BZSpYvM0.js → empty-state-0sZo57jy.js} +1 -1
  95. package/dist/client/assets/{extract-connection-data-ZTR7xcCD.js → extract-connection-data-Bq1iwuT1.js} +1 -1
  96. package/dist/client/assets/file-explorer-sI7DMd8g.js +2 -0
  97. package/dist/client/assets/{form-Da6Pak5q.js → form-CUC6wee5.js} +1 -1
  98. package/dist/client/assets/{general-Dxp-Gk6z.js → general-BtU55mHB.js} +1 -1
  99. package/dist/client/assets/{github-repo-picker-BjY_cbDW.js → github-repo-picker-BeYuKlOy.js} +1 -1
  100. package/dist/client/assets/{hooks-CiBCHAEU.js → hooks-Ckdzt-Nv.js} +2 -2
  101. package/dist/client/assets/{index-CXiIkJNe.js → index-BDZ-VwFU.js} +1 -1
  102. package/dist/client/assets/index-BmsAtj16.js +1 -0
  103. package/dist/client/assets/index-CCczML2o.js +8 -0
  104. package/dist/client/assets/{index-k6yNjC6u.js → index-CS6AKJgD.js} +1 -1
  105. package/dist/client/assets/{index-CVc4ITjm.js → index-C_usV78a.js} +1 -1
  106. package/dist/client/assets/{index-luz2_Kqi.js → index-Ca_3YTYR.js} +1 -1
  107. package/dist/client/assets/{index-Bl2gwdpO.js → index-CcB8mZk8.js} +1 -1
  108. package/dist/client/assets/{index-fII9c_kY.js → index-CpReHYcd.js} +37 -37
  109. package/dist/client/assets/{index-SsOp9DoN.js → index-DDHOxC3K.js} +1 -1
  110. package/dist/client/assets/{index-sd38S2ER.js → index-DDug671b.js} +27 -27
  111. package/dist/client/assets/{index-CHt7Tdc5.js → index-DPvg2w8m.js} +1 -1
  112. package/dist/client/assets/index-DolLSrq-.css +1 -0
  113. package/dist/client/assets/{index-redirect-DJUUAT-x.js → index-redirect-M0BGCOfn.js} +1 -1
  114. package/dist/client/assets/{input-Df5WqCIh.js → input-CGjm14VM.js} +1 -1
  115. package/dist/client/assets/{integration-icon-D-DwNzR1.js → integration-icon-CdNdqZ3V.js} +1 -1
  116. package/dist/client/assets/{invite-member-dialog-Rie9X6aX.js → invite-member-dialog-BnrRiacj.js} +1 -1
  117. package/dist/client/assets/{label-q5RWAz3v.js → label-DjBQc1IG.js} +1 -1
  118. package/dist/client/assets/{layout-4S09taad.js → layout-D7T8iG74.js} +1 -1
  119. package/dist/client/assets/{login-BT0MtgCn.js → login-B95uBFC4.js} +1 -1
  120. package/dist/client/assets/mcp-oauth-Cfiwi3-V.js +1 -0
  121. package/dist/client/assets/{members-BFl3wg6J.js → members-BY9BwWjA.js} +1 -1
  122. package/dist/client/assets/{monaco-editor-Cxpp-hMU.js → monaco-editor-CpDJSoQc.js} +4 -4
  123. package/dist/client/assets/{monitoring-stats-row-C_ZvOQMg.js → monitoring-stats-row-CmnOxXTZ.js} +1 -1
  124. package/dist/client/assets/{multi-select-BLzsq679.js → multi-select-CAhHEpPq.js} +1 -1
  125. package/dist/client/assets/{oauth-callback-DW7fVwr1.js → oauth-callback-UjIBoeiV.js} +1 -1
  126. package/dist/client/assets/{oauth-callback-ai-provider-CiK488OV.js → oauth-callback-ai-provider-l88D6VMW.js} +1 -1
  127. package/dist/client/assets/{onboarding-BG6NzFm2.js → onboarding-8HLGhCuk.js} +1 -1
  128. package/dist/client/assets/{org-install-DGkz2TMa.js → org-install-B4B99JK6.js} +1 -1
  129. package/dist/client/assets/{org-layout-B-rNRqK1.js → org-layout-UVBxFbNY.js} +1 -1
  130. package/dist/client/assets/{organization-choice-CeiMbljd.js → organization-choice-CKKJ8Ypb.js} +1 -1
  131. package/dist/client/assets/{orgs-KwuNkzmk.js → orgs-BjdOoHWm.js} +1 -1
  132. package/dist/client/assets/{page-seo-form-soQoyhZq.js → page-seo-form-DRzF-Mc_.js} +1 -1
  133. package/dist/client/assets/{popover-BxXBf9EH.js → popover-BPNEzQ0m.js} +1 -1
  134. package/dist/client/assets/post-editor-CgEdOmfW.js +1 -0
  135. package/dist/client/assets/{primitives-hG3gzivQ.js → primitives-BJ98RSW8.js} +1 -1
  136. package/dist/client/assets/{profile-0GWHiBFp.js → profile-BCbQwPC3.js} +1 -1
  137. package/dist/client/assets/project-app-view-BhAIxf5D.js +1 -0
  138. package/dist/client/assets/record-editor-YBfn4rg-.js +1 -0
  139. package/dist/client/assets/redirect-editor-avdBkJrC.js +1 -0
  140. package/dist/client/assets/registry-DufVFHM-.js +2 -0
  141. package/dist/client/assets/{registry-layout-BPmkJ_es.js → registry-layout-CmY2dO5z.js} +1 -1
  142. package/dist/client/assets/{reports-9uRBgUwC.js → reports-BaPkY152.js} +1 -1
  143. package/dist/client/assets/{require-capability-CqQ6B0ux.js → require-capability-DhQvBPSi.js} +1 -1
  144. package/dist/client/assets/{required-auth-layout-CIVjmrI-.js → required-auth-layout-2Mdec4Xs.js} +1 -1
  145. package/dist/client/assets/{reset-password-CWGs2cLw.js → reset-password-sZTFKMEK.js} +1 -1
  146. package/dist/client/assets/{roles-CdAcWw-W.js → roles-D9O9VAcM.js} +1 -1
  147. package/dist/client/assets/{search-input-C0Tu8jAx.js → search-input-D1r_hzL6.js} +1 -1
  148. package/dist/client/assets/{secrets-rhPict2d.js → secrets-C8Avtf_0.js} +1 -1
  149. package/dist/client/assets/{sections-editor-CVy2fhWn.js → sections-editor-C5gvXfu2.js} +2 -2
  150. package/dist/client/assets/{select-BaiNHGHX.js → select-Csj8R7k2.js} +1 -1
  151. package/dist/client/assets/select-model-U0fL_6_X.js +4 -0
  152. package/dist/client/assets/{self-tool-result-DKMkJU4m.js → self-tool-result-BGsopSDN.js} +1 -1
  153. package/dist/client/assets/seo-editor-D3h_SAyN.js +1 -0
  154. package/dist/client/assets/{settings-layout-C5m3Vodh.js → settings-layout-Bz4oLNkE.js} +1 -1
  155. package/dist/client/assets/{settings-section-BzmRZGKV.js → settings-section-BDJITHua.js} +1 -1
  156. package/dist/client/assets/{shell-controls-zNdpglpf.js → shell-controls-7CChtS3i.js} +1 -1
  157. package/dist/client/assets/{shell-layout-OumtAwy1.js → shell-layout-YbtfJ2t7.js} +1 -1
  158. package/dist/client/assets/{sidebar-DTxjIJ56.js → sidebar-BjwcFmHe.js} +1 -1
  159. package/dist/client/assets/{skeleton-Bqf4wcUq.js → skeleton-DJEY9mQO.js} +1 -1
  160. package/dist/client/assets/{sso-y15zIhWp.js → sso-CY40Ae_n.js} +1 -1
  161. package/dist/client/assets/{store-Bdo34j2n.js → store-HH-7F5MX.js} +1 -1
  162. package/dist/client/assets/store-registry-BOAH46-F.js +2 -0
  163. package/dist/client/assets/{studio-tools-C9O5T6hk.js → studio-tools-BVOWXGL8.js} +1 -1
  164. package/dist/client/assets/{switch-DzR4USnH.js → switch-xBTYAphU.js} +1 -1
  165. package/dist/client/assets/{tab-id-D67TyC-3.js → tab-id-B-A7fEMu.js} +1 -1
  166. package/dist/client/assets/{table-CW9azojk.js → table-C6TyHppk.js} +1 -1
  167. package/dist/client/assets/{tabs-Dg2fovl2.js → tabs-DeUeCPgO.js} +1 -1
  168. package/dist/client/assets/{textarea-B-mbIfJP.js → textarea-BS0D_b-K.js} +1 -1
  169. package/dist/client/assets/{toggle-group-Bd_5HjJ1.js → toggle-group-Cz7IyNF-.js} +1 -1
  170. package/dist/client/assets/{toolbar-BQhumIzA.js → toolbar-pO-Q748B.js} +1 -1
  171. package/dist/client/assets/{tooltip-Bjx5IK0l.js → tooltip-WZpxGeui.js} +1 -1
  172. package/dist/client/assets/{use-ai-providers-Dsmt_TQY.js → use-ai-providers-D_DNnD-Q.js} +1 -1
  173. package/dist/client/assets/{use-automations-DAZgpS9S.js → use-automations-Dupm5wzI.js} +1 -1
  174. package/dist/client/assets/{use-autosave-B5hezYu8.js → use-autosave-Z8Xd52Fx.js} +1 -1
  175. package/dist/client/assets/{use-capability-DbSBzq4m.js → use-capability-CSraCk_w.js} +1 -1
  176. package/dist/client/assets/{use-clock-tick-9uLrrBUm.js → use-clock-tick-D5KJnX9J.js} +1 -1
  177. package/dist/client/assets/{use-connection-DtVPu3zH.js → use-connection-BH3GAkyc.js} +1 -1
  178. package/dist/client/assets/{use-copy-BmXjtpVk.js → use-copy-yAEQGKxe.js} +1 -1
  179. package/dist/client/assets/{use-create-virtual-mcp-CZZVOBEo.js → use-create-virtual-mcp-ZxuwOjY4.js} +1 -1
  180. package/dist/client/assets/{use-debounced-autosave-CV9YJ4dj.js → use-debounced-autosave-CnxCSHa2.js} +1 -1
  181. package/dist/client/assets/{use-debounced-value-BhoOs69E.js → use-debounced-value-d1LbDD45.js} +1 -1
  182. package/dist/client/assets/use-deco-credits-BKe46R4j.js +1 -0
  183. package/dist/client/assets/{use-decopilot-events-Hca5p5mu.js → use-decopilot-events-Rl4pYnmz.js} +1 -1
  184. package/dist/client/assets/{use-delete-connection-BA2vzFXU.js → use-delete-connection-DqRcaJY_.js} +1 -1
  185. package/dist/client/assets/{use-deployment-admin-DmRm5A9N.js → use-deployment-admin-b6x6KmxH.js} +1 -1
  186. package/dist/client/assets/{use-file-configs-giwXdJFa.js → use-file-configs-DNPvjrq1.js} +1 -1
  187. package/dist/client/assets/{use-infinite-scroll-BOm4DukJ.js → use-infinite-scroll-BCQQzaQW.js} +1 -1
  188. package/dist/client/assets/{use-join-requests-DamNnIat.js → use-join-requests-6PSEubYq.js} +1 -1
  189. package/dist/client/assets/{use-mcp-auth-status-BggNWMN0.js → use-mcp-auth-status-DNePqWs9.js} +1 -1
  190. package/dist/client/assets/{use-mcp-client-Cav0AiKw.js → use-mcp-client-BHIx7JlY.js} +1 -1
  191. package/dist/client/assets/{use-mcp-tools-BvTay4jb.js → use-mcp-tools-Dv1bErmV.js} +1 -1
  192. package/dist/client/assets/{use-members-1alkNMLr.js → use-members-DMaPK1aF.js} +1 -1
  193. package/dist/client/assets/{use-mobile-DxvpAkbd.js → use-mobile-CnuHZAQe.js} +1 -1
  194. package/dist/client/assets/{use-navigate-to-agent-DWHbwpLC.js → use-navigate-to-agent-BUCfyhQC.js} +1 -1
  195. package/dist/client/assets/{use-org-auth-client-HGMDWZ37.js → use-org-auth-client-OPJSyera.js} +1 -1
  196. package/dist/client/assets/{use-org-sso-elnfvOdJ.js → use-org-sso-VUn3tGLY.js} +1 -1
  197. package/dist/client/assets/{use-organization-roles-Dlno3YRH.js → use-organization-roles-BUFxH_8r.js} +1 -1
  198. package/dist/client/assets/{use-organization-settings-C8aPcOm4.js → use-organization-settings-lxipe-fc.js} +1 -1
  199. package/dist/client/assets/{use-registry-connections-BJ4Y5FI-.js → use-registry-connections-z0q_Ein8.js} +1 -1
  200. package/dist/client/assets/{use-secrets-5yqKG0Fz.js → use-secrets-BPx1_drU.js} +1 -1
  201. package/dist/client/assets/{use-status-sounds-BkECfwLj.js → use-status-sounds-DCs1a_56.js} +1 -1
  202. package/dist/client/assets/{use-tags-DhH7fJ9n.js → use-tags-DBN4__BV.js} +1 -1
  203. package/dist/client/assets/{use-view-mode-QVi8YiL9.js → use-view-mode-BOoVU3bc.js} +1 -1
  204. package/dist/client/assets/{use-virtual-mcp-DzUwFLTQ.js → use-virtual-mcp-BlRB4Rkc.js} +1 -1
  205. package/dist/client/assets/useInfiniteQuery-BIQdmDG8.js +1 -0
  206. package/dist/client/assets/{useQueries-CHVnUdBY.js → useQueries-UeWiznkI.js} +1 -1
  207. package/dist/client/assets/{useRouterState-CJgrSpoY.js → useRouterState-DC4XQJbr.js} +1 -1
  208. package/dist/client/assets/useSuspenseInfiniteQuery-B1FcYDrn.js +1 -0
  209. package/dist/client/assets/{users-BHNa2I19.js → users-BWqTd_-2.js} +1 -1
  210. package/dist/client/assets/variant-calendar-TzpScg5D.js +1 -0
  211. package/dist/client/assets/{view-mode-toggle-CeRa3z7B.js → view-mode-toggle-CawzraQZ.js} +1 -1
  212. package/dist/client/index.html +2 -2
  213. package/dist/client/native-boot.js +20 -0
  214. package/dist/server/cli.js +7 -1
  215. package/dist/server/server.js +1 -1
  216. package/package.json +2 -2
  217. package/dist/client/assets/ai-providers-CmDhk4US.js +0 -1
  218. package/dist/client/assets/app-editor-Chpkqa2F.js +0 -1
  219. package/dist/client/assets/auth-entry-BFtkZTwu.js +0 -1
  220. package/dist/client/assets/bulk-category-panel-C5e6mdWG.js +0 -1
  221. package/dist/client/assets/category-editor-BB1Wibnh.js +0 -1
  222. package/dist/client/assets/chat-context-DoK0lfG3.js +0 -36
  223. package/dist/client/assets/connect-B_S04Bfy.js +0 -8
  224. package/dist/client/assets/connect-desktop-dialog-BUp1haXa.js +0 -1
  225. package/dist/client/assets/connection-detail-DP-88uz5.js +0 -1
  226. package/dist/client/assets/connections-PwhMV6Az.js +0 -1
  227. package/dist/client/assets/file-explorer-DOrJ6I00.js +0 -2
  228. package/dist/client/assets/index-CIJ4b6SD.js +0 -8
  229. package/dist/client/assets/index-CaPJLPSU.js +0 -1
  230. package/dist/client/assets/index-DSghpBCP.css +0 -1
  231. package/dist/client/assets/mcp-oauth-C159CTqw.js +0 -1
  232. package/dist/client/assets/post-editor-BOGVp1SK.js +0 -1
  233. package/dist/client/assets/project-app-view-DGcbWl7X.js +0 -1
  234. package/dist/client/assets/record-editor-BKkPOez0.js +0 -1
  235. package/dist/client/assets/redirect-editor-n2iW7SHJ.js +0 -1
  236. package/dist/client/assets/registry-CfztJypZ.js +0 -2
  237. package/dist/client/assets/select-model-C_5UqaCI.js +0 -4
  238. package/dist/client/assets/seo-editor-CbwzBxXD.js +0 -1
  239. package/dist/client/assets/store-registry-DscNaxt3.js +0 -2
  240. package/dist/client/assets/use-api-keys-CSaFJXfD.js +0 -1
  241. package/dist/client/assets/use-deco-credits-CWhdUeI9.js +0 -1
  242. package/dist/client/assets/useInfiniteQuery-cI69eqxa.js +0 -1
  243. package/dist/client/assets/useSuspenseInfiniteQuery-DXLjl_Ue.js +0 -1
  244. package/dist/client/assets/variant-calendar-Dx1J5lqR.js +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "decocms",
3
- "version": "4.145.4",
3
+ "version": "4.146.0",
4
4
  "description": "Deco CMS — Self-hostable MCP Gateway for managing AI connections and tools",
5
5
  "author": "Deco team",
6
6
  "repository": {
@@ -113,7 +113,7 @@
113
113
  "typescript": "^7.0.2",
114
114
  "typescript5": "npm:typescript@^5.9.3",
115
115
  "vite": "^7.2.1",
116
- "zod": "^4.0.0"
116
+ "zod": "4.3.6"
117
117
  },
118
118
  "homepage": "https://github.com/decocms/studio",
119
119
  "keywords": [
@@ -1 +0,0 @@
1
- import{X,Y as I,a2 as Me,a4 as Ae,a5 as Ie,a3 as ze,b0 as Te,c as Z,b as oe,Z as He,_ as qe,r as J,j as s,a6 as rt,t as ae,ax as Be,F as Ke,o as we,e as Se,K as re,n as Le,m as $e,B as le,p as Ve,v as ot,E as nt}from"./index-sd38S2ER.js";import{i as at}from"./AlertCircle-CSQCPj_V.js";import{P as Pe}from"./index-Bl2gwdpO.js";import{S as Ee}from"./skeleton-Bqf4wcUq.js";import{b as Qe,a as Re,S as Fe,c as ct}from"./settings-section-BzmRZGKV.js";import{u as Ce,b as Ne,i as dt,c as mt,p as ft,d as Ge}from"./use-ai-providers-Dsmt_TQY.js";import{i as ut}from"./CheckCircle-DDuWLqUq.js";import{b as pt,i as gt}from"./use-organization-settings-C8aPcOm4.js";import{c as ht,d as Ye,P as xt,C as Oe}from"./select-model-C_5UqaCI.js";import{u as bt}from"./use-debounced-autosave-CV9YJ4dj.js";import{I as De}from"./input-Df5WqCIh.js";import{T as Ue,a as vt}from"./toggle-group-Bd_5HjJ1.js";import{c as We,d as Je,b as Xe,f as Ze,g as et,e as tt,a as st,A as it}from"./alert-dialog-CI_jOgZR.js";import{u as je}from"./studio-tools-C9O5T6hk.js";import{s as yt}from"./Plus-CSNWQMMp.js";import{p as jt,f as St}from"./pt-BR-CLy76QW2.js";import{c as Ct}from"./Tool01-DluxhvbR.js";import{s as _t}from"./Trash01-BecpyKSB.js";import{A as kt}from"./avatar-2NkvJFhn.js";import{i as Pt}from"./Settings02-DWHb-lRw.js";import{s as Nt}from"./Eye-BZEDG_yV.js";import{b as Dt,a as It,d as Kt,e as wt,c as At}from"./dialog-Dq_peVG0.js";import{S as Mt}from"./chat-context-DoK0lfG3.js";import{R as Et}from"./require-capability-CqQ6B0ux.js";import"./sidebar-DTxjIJ56.js";import"./LayoutLeft-CGP9_srE.js";import"./use-mobile-DxvpAkbd.js";import"./X-CalOG8rP.js";import"./tooltip-Bjx5IK0l.js";import"./card-yJEtZ44f.js";import"./ArrowUpRight-eD5g-cFd.js";import"./use-mcp-client-Cav0AiKw.js";import"./auth-ByPgJhb1.js";import"./drawer-BSvXGda-.js";import"./checkbox-5E1V-xvi.js";import"./Check-CWNssTV8.js";import"./select-BaiNHGHX.js";import"./ChevronDown-BWHEr7M7.js";import"./ChevronUp-ROaBb_s7.js";import"./Key01-AWbv_wld.js";import"./SearchMd-BEvxAPyw.js";import"./ai-providers-logos-DD3qZ33J.js";import"./Monitor01-kMl_aKHS.js";import"./ChevronRight-Bqyf0yi2.js";import"./connect-desktop-dialog-BUp1haXa.js";import"./Copy01-_e4tlhaR.js";import"./Stars01-CO4iRFT5.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./User01-CAYZjCBh.js";import"./tab-id-D67TyC-3.js";import"./hooks-CiBCHAEU.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-C1RJsJS0.js";import"./use-virtual-mcp-DzUwFLTQ.js";import"./use-decopilot-events-Hca5p5mu.js";import"./use-capability-DbSBzq4m.js";import"./access-gate-BPcsz4E2.js";import"./capability-load-error-C0MHRICc.js";X({title:I(),url:I(),icon:I()});X({registries:Ae(I(),X({enabled:Ie()})).describe("Per-registry enabled/disabled state. Key is connection ID. Absent registries are treated as enabled."),blockedMcps:Me(I()).describe("List of MCP app_name or app_id values to hide from the store.")});const ce=X({keyId:I(),modelId:I(),title:I().optional()}).nullable();ze(["fast","smart","thinking","image","web_search","deep_research"]);ze(["fast","smart","thinking"]);const Rt=X({tiers:X({fast:ce,smart:ce,thinking:ce,image:ce,web_search:ce,deep_research:ce})});X({tiers:X({fast:ce.optional(),smart:ce.optional(),thinking:ce.optional()})});X({ids:Me(I()).describe("Ordered list of custom virtual MCP agent ids to show on the home view.")});X({demo_mode:Ie().optional().describe("Curated demo org: the commerce connect modal proceeds without a configured required data source."),reports_only:Ie().optional().describe("Curated commerce (reports) look: hides agent navigation, the home Customize button, and the Settings/Automations tabs. Defaulted on for orgs created by commerce onboarding.")});X({id:I().describe("Brand context ID"),name:I().describe("Company name"),domain:I().describe("Company domain (e.g. example.com)"),overview:I().describe("Company overview / description"),logo:I().nullable().optional().describe("Logo URL"),favicon:I().nullable().optional().describe("Favicon URL"),ogImage:I().nullable().optional().describe("OG image URL"),fonts:X({heading:I().optional().describe("Font family for headings"),body:I().optional().describe("Font family for body text"),code:I().optional().describe("Font family for code / monospace")}).nullable().optional().describe("Font families by semantic role"),colors:X({primary:I().optional().describe("Primary brand color (hex)"),secondary:I().optional().describe("Secondary brand color (hex)"),accent:I().optional().describe("Accent / highlight color (hex)"),background:I().optional().describe("Background color (hex)"),foreground:I().optional().describe("Foreground / text color (hex)")}).nullable().optional().describe("Semantic color palette"),images:Me(Ae(I(),Te())).nullable().optional().describe("Brand images"),metadata:Ae(I(),Te()).nullable().optional().describe("Extra design tokens (typography, components, spacing, layout, tone, etc.)"),archivedAt:I().nullable().optional().describe("Archive timestamp (null to unarchive)"),isDefault:Ie().optional().describe("Whether this is the default brand for the organization")});const Ft=e=>e.capabilities?.includes("image")===!0,Tt=e=>dt(e),$t=e=>mt(e),Ot=[{key:"fast",filter:void 0},{key:"smart",filter:void 0},{key:"thinking",filter:void 0},{key:"image",filter:Ft},{key:"web_search",filter:Tt},{key:"deep_research",filter:$t}];function Ut(e){const t=Z.c(26),{slot:i,onSlotChange:r,filterModels:n,defaultKeyId:a}=e,c=Ce(),[o,v]=J.useState(i?.keyId??a);let _;t[0]!==i?(_=()=>{i?.keyId&&v(i.keyId)},t[0]=i,t[1]=_):_=t[1];const y=i?.keyId;let l;t[2]!==y?(l=[y],t[2]=y,t[3]=l):l=t[3],J.useEffect(_,l);const d=o??a;let m;t[4]!==d||t[5]!==c?(m=d?c.find(b=>b.id===d):null,t[4]=d,t[5]=c,t[6]=m):m=t[6];const u=m,{models:h,isLoading:g}=Ne(n?d??void 0:void 0),k=n?g||h.some(n):!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 j=p,N=oe();if(n&&!k){let b;t[10]!==N?(b=N("settings.simpleModeSection.notAvailableWithCurrentProvider"),t[10]=N,t[11]=b):b=t[11];let K;return t[12]!==b?(K=s.jsx("p",{className:"text-xs text-muted-foreground italic",children:b}),t[12]=b,t[13]=K):K=t[13],K}let S;t[14]!==N?(S=N("settings.simpleModeSection.pickModel"),t[14]=N,t[15]=S):S=t[15];let C;t[16]===Symbol.for("react.memo_cache_sentinel")?(C=b=>v(b),t[16]=C):C=t[16];let f;t[17]!==d||t[18]!==r?(f=b=>{const K=b.keyId??d??"";v(K),r({keyId:K,modelId:b.modelId,title:b.title})},t[17]=d,t[18]=r,t[19]=f):f=t[19];let P;return t[20]!==d||t[21]!==n||t[22]!==j||t[23]!==S||t[24]!==f?(P=s.jsx(ht,{variant:"bordered",placeholder:S,model:j,credentialId:d,filterModels:n,onCredentialChange:C,onModelChange:f}),t[20]=d,t[21]=n,t[22]=j,t[23]=S,t[24]=f,t[25]=P):P=t[25],P}function zt(e){const t=Z.c(10),{isPending:i,showSaved:r}=e,n=oe();if(i){let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Be,{size:12,className:"animate-spin"}),t[0]=a):a=t[0];let c;t[1]!==n?(c=n("settings.simpleModeSection.saving"),t[1]=n,t[2]=c):c=t[2];let o;return t[3]!==c?(o=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[a,c]}),t[3]=c,t[4]=o):o=t[4],o}if(r){let a;t[5]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(ut,{size:12}),t[5]=a):a=t[5];let c;t[6]!==n?(c=n("settings.simpleModeSection.saved"),t[6]=n,t[7]=c):c=t[7];let o;return t[8]!==c?(o=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[a,c]}),t[8]=c,t[9]=o):o=t[9],o}return null}function Ht(){const e=Z.c(58),t=oe(),i=Ce(),r=pt(),n=i.length>0;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=He(Rt),e[0]=a):a=e[0];let c;e[1]!==r?(c={resolver:a,values:r,mode:"onChange"},e[1]=r,e[2]=c):c=e[2];const o=qe(c),{mutate:v,isPending:_,isSuccess:y}=gt(),l=o.formState.isDirty;let d;e[3]!==o||e[4]!==r||e[5]!==t||e[6]!==v?(d={delayMs:250,save:async()=>{const x=o.getValues();v(x,{onSuccess:()=>o.reset(x,{keepValues:!0}),onError:A=>{o.reset(r),ae.error(t("settings.simpleModeSection.failedToSave",{error:A.message}))}})}},e[3]=o,e[4]=r,e[5]=t,e[6]=v,e[7]=d):d=e[7];const{schedule:m}=bt(d),u=i[0],h=i[1],g=i[2],{models:k}=Ne(u?.id),{models:p}=Ne(h?.id),{models:j}=Ne(g?.id);let N,S;e[8]!==o||e[9]!==n?(N=()=>{n||o.reset({tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}})},S=[n,o],e[8]=o,e[9]=n,e[10]=N,e[11]=S):(N=e[10],S=e[11]),J.useEffect(N,S);let C;e[12]!==i||e[13]!==o||e[14]!==u||e[15]!==h||e[16]!==g||e[17]!==k||e[18]!==p||e[19]!==j?(C=()=>{const x=o.getValues(),A=new Set(i.map(qt)),M={};u?.id&&(M[u.id]=k),h?.id&&(M[h.id]=p),g?.id&&(M[g.id]=j);const w=L=>L!=null&&!A.has(L.keyId),D={fast:w(x.tiers.fast)?null:x.tiers.fast,smart:w(x.tiers.smart)?null:x.tiers.smart,thinking:w(x.tiers.thinking)?null:x.tiers.thinking,image:w(x.tiers.image)?null:x.tiers.image,web_search:w(x.tiers.web_search)?null:x.tiers.web_search,deep_research:w(x.tiers.deep_research)?null:x.tiers.deep_research},Y=!D.fast||!D.smart||!D.thinking||!D.image||!D.web_search||!D.deep_research,W=D.fast===x.tiers.fast&&D.smart===x.tiers.smart&&D.thinking===x.tiers.thinking&&D.image===x.tiers.image&&D.web_search===x.tiers.web_search&&D.deep_research===x.tiers.deep_research;if(!Y&&W)return;const $=ft(i,M);o.reset({tiers:{fast:D.fast??$.chat.fast,smart:D.smart??$.chat.smart,thinking:D.thinking??$.chat.thinking,image:D.image??$.image,web_search:D.web_search??$.webSearch,deep_research:D.deep_research??$.deepResearch}},{keepDirty:!0})},e[12]=i,e[13]=o,e[14]=u,e[15]=h,e[16]=g,e[17]=k,e[18]=p,e[19]=j,e[20]=C):C=e[20];const f=u?.id,P=h?.id,b=g?.id;let K;e[21]!==i||e[22]!==o||e[23]!==k||e[24]!==p||e[25]!==j||e[26]!==f||e[27]!==P||e[28]!==b?(K=[o,i,k,p,j,f,P,b],e[21]=i,e[22]=o,e[23]=k,e[24]=p,e[25]=j,e[26]=f,e[27]=P,e[28]=b,e[29]=K):K=e[29],J.useEffect(C,K);let V;e[30]!==t?(V=x=>({fast:t("settings.simpleModeSection.tierFast"),smart:t("settings.simpleModeSection.tierSmart"),thinking:t("settings.simpleModeSection.tierThinking"),image:t("settings.simpleModeSection.tierImage"),web_search:t("settings.simpleModeSection.tierWebSearch"),deep_research:t("settings.simpleModeSection.tierDeepResearch")})[x]||x,e[30]=t,e[31]=V):V=e[31];const B=V;let O;e[32]!==t?(O=x=>({fast:t("settings.simpleModeSection.tierFastDesc"),smart:t("settings.simpleModeSection.tierSmartDesc"),thinking:t("settings.simpleModeSection.tierThinkingDesc"),image:t("settings.simpleModeSection.tierImageDesc"),web_search:t("settings.simpleModeSection.tierWebSearchDesc"),deep_research:t("settings.simpleModeSection.tierDeepResearchDesc")})[x]||"",e[32]=t,e[33]=O):O=e[33];const Q=O;let U;e[34]!==t?(U=t("settings.simpleModeSection.defaultModels"),e[34]=t,e[35]=U):U=e[35];let E;e[36]!==t?(E=t("settings.simpleModeSection.modelsPowerDescription"),e[36]=t,e[37]=E):E=e[37];let z;e[38]!==E?(z=s.jsx("p",{className:"text-sm text-muted-foreground",children:E}),e[38]=E,e[39]=z):z=e[39];const G=y&&!l;let H;e[40]!==_||e[41]!==G?(H=s.jsx(zt,{isPending:_,showSaved:G}),e[40]=_,e[41]=G,e[42]=H):H=e[42];let R;e[43]!==z||e[44]!==H?(R=s.jsxs("div",{className:"flex items-center justify-between -mt-2 mb-2",children:[z,H]}),e[43]=z,e[44]=H,e[45]=R):R=e[45];let F;e[46]!==i[0]?.id||e[47]!==o.control||e[48]!==Q||e[49]!==B||e[50]!==m?(F=Ot.map(x=>s.jsx(rt,{control:o.control,name:`tiers.${x.key}`,render:A=>{const{field:M}=A;return s.jsx(Qe,{title:B(x.key),description:Q(x.key),action:s.jsx(Ut,{slot:M.value,defaultKeyId:i[0]?.id??null,filterModels:x.filter,onSlotChange:w=>{M.onChange(w),m()}})})}},x.key)),e[46]=i[0]?.id,e[47]=o.control,e[48]=Q,e[49]=B,e[50]=m,e[51]=F):F=e[51];let T;e[52]!==F?(T=s.jsx(Re,{children:F}),e[52]=F,e[53]=T):T=e[53];let q;return e[54]!==U||e[55]!==R||e[56]!==T?(q=s.jsxs(Fe,{title:U,headerClassName:"pl-0",children:[R,T]}),e[54]=U,e[55]=R,e[56]=T,e[57]=q):q=e[57],q}function qt(e){return e.id}const Bt={usd:[10,20,100],brl:[50,100,500]};function Lt(){const e=Z.c(30),t=oe(),i=je(),[r,n]=J.useState(!1);let a;e[0]!==t?(a=f=>{ae.error(t("settings.decoCreditsHero.topUpFailed",{message:f.message}))},e[0]=t,e[1]=a):a=e[1];const{mutate:c,isPending:o}=Se({mutationFn:async f=>{const{url:P}=await i.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:f,currency:d});return P},onSuccess:Vt,onError:a}),[v,_]=J.useState(""),[y,l]=J.useState("usd"),d=y,m=parseFloat(v),u=!isNaN(m)&&m>=1,h=d==="brl"?"R$":"$";let g;e[2]!==l?(g=f=>{f&&l(f)},e[2]=l,e[3]=g):g=e[3];let k,p;e[4]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(Ue,{value:"usd",className:"px-3.5 text-sm",children:"USD"}),p=s.jsx(Ue,{value:"brl",className:"px-3.5 text-sm",children:"BRL"}),e[4]=k,e[5]=p):(k=e[4],p=e[5]);let j;e[6]!==d||e[7]!==g?(j=s.jsxs(vt,{type:"single",variant:"outline",size:"default",value:d,onValueChange:g,children:[k,p]}),e[6]=d,e[7]=g,e[8]=j):j=e[8];let N;e[9]!==d||e[10]!==h||e[11]!==r||e[12]!==o||e[13]!==t||e[14]!==c?(N=!r&&s.jsxs(s.Fragment,{children:[Bt[d].map(f=>s.jsxs(le,{variant:"outline",className:"h-10 px-4 text-sm font-medium tabular-nums",disabled:o,onClick:()=>c(f*100),children:[h,f]},f)),s.jsx(le,{variant:"ghost",className:"h-10 px-4 text-sm text-muted-foreground",onClick:()=>n(!0),disabled:o,children:t("settings.decoCreditsHero.custom")})]}),e[9]=d,e[10]=h,e[11]=r,e[12]=o,e[13]=t,e[14]=c,e[15]=N):N=e[15];let S;e[16]!==h||e[17]!==v||e[18]!==m||e[19]!==r||e[20]!==u||e[21]!==o||e[22]!==_||e[23]!==t||e[24]!==c?(S=r&&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:h}),s.jsx(De,{type:"number",min:"1",step:"1",placeholder:t("settings.decoCreditsHero.amountPlaceholder"),value:v,onChange:f=>_(f.target.value),className:"h-10 text-sm pl-7",autoFocus:!0})]}),s.jsx(le,{className:"h-10",disabled:!u||o,onClick:()=>c(Math.round(m*100)),children:o?"...":t("settings.decoCreditsHero.add")}),s.jsx(le,{variant:"ghost",className:"h-10 text-sm text-muted-foreground",onClick:()=>{n(!1),_("")},children:t("settings.decoCreditsHero.cancel")})]}),e[16]=h,e[17]=v,e[18]=m,e[19]=r,e[20]=u,e[21]=o,e[22]=_,e[23]=t,e[24]=c,e[25]=S):S=e[25];let C;return e[26]!==j||e[27]!==N||e[28]!==S?(C=s.jsx("div",{className:"flex flex-col gap-2.5",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[j,N,S]})}),e[26]=j,e[27]=N,e[28]=S,e[29]=C):C=e[29],C}function Vt(e){e&&window.open(e,"_blank","noopener,noreferrer")}function Qt(e){return e<=0?"text-destructive":e<=1?"text-warning":"text-foreground"}function Gt(){const e=Z.c(121),t=oe(),{org:i}=Ke(),r=je(),n=we(),a=Ce();let c;e[0]!==a?(c=a.find(Yt),e[0]=a,e[1]=c):c=e[1];const o=c,[v,_]=J.useState(!1);let y;e[2]!==o||e[3]!==r?(y=async()=>{o&&await r.call("AI_PROVIDER_KEY_DELETE",{keyId:o.id})},e[2]=o,e[3]=r,e[4]=y):y=e[4];let l;e[5]!==i.id||e[6]!==n||e[7]!==t?(l=()=>{n.invalidateQueries({queryKey:re.aiProviderKeys(i.id)}),n.invalidateQueries({queryKey:re.aiProviders(i.id)}),ae.success(t("settings.decoCreditsHero.disconnectSuccess")),_(!1)},e[5]=i.id,e[6]=n,e[7]=t,e[8]=l):l=e[8];let d;e[9]!==t?(d=lt=>{ae.error(t("settings.decoCreditsHero.disconnectError",{message:lt.message}))},e[9]=t,e[10]=d):d=e[10];let m;e[11]!==y||e[12]!==l||e[13]!==d?(m={mutationFn:y,onSuccess:l,onError:d},e[11]=y,e[12]=l,e[13]=d,e[14]=m):m=e[14];const{mutate:u,isPending:h}=Se(m);let g;e[15]!==i.id?(g=re.aiProviderCredits(i.id,"deco"),e[15]=i.id,e[16]=g):g=e[16];const k=!!o;let p;e[17]!==r?(p=async()=>{try{return await r.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}},e[17]=r,e[18]=p):p=e[18];let j;e[19]!==g||e[20]!==k||e[21]!==p?(j={queryKey:g,enabled:k,staleTime:6e4,queryFn:p},e[19]=g,e[20]=k,e[21]=p,e[22]=j):j=e[22];const{data:N,isLoading:S,refetch:C,isFetching:f}=Le(j);if(!o)return null;const P=N?.balanceCents!=null?N.balanceCents/100:null;let b;e[23]!==P?(b=P!=null?`$${P.toFixed(2)}`:"—",e[23]=P,e[24]=b):b=e[24];const K=b;let V;e[25]!==t?(V=t("settings.decoCreditsHero.title"),e[25]=t,e[26]=V):V=e[26];let B;e[27]!==t?(B=t("settings.decoCreditsHero.decoAiGatewayAlt"),e[27]=t,e[28]=B):B=e[28];let O;e[29]!==B?(O=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:B,className:"size-9 rounded-lg object-contain dark:bg-white dark:p-0.5"}),e[29]=B,e[30]=O):O=e[30];let Q;e[31]!==t?(Q=t("settings.decoCreditsHero.accessModels"),e[31]=t,e[32]=Q):Q=e[32];let U;e[33]!==Q?(U=s.jsx("div",{children:s.jsx("p",{className:"text-xs text-muted-foreground",children:Q})}),e[33]=Q,e[34]=U):U=e[34];let E;e[35]!==O||e[36]!==U?(E=s.jsxs("div",{className:"flex items-center gap-3",children:[O,U]}),e[35]=O,e[36]=U,e[37]=E):E=e[37];let z;e[38]===Symbol.for("react.memo_cache_sentinel")?(z=()=>_(!0),e[38]=z):z=e[38];let G;e[39]!==t?(G=t("settings.decoCreditsHero.disconnect"),e[39]=t,e[40]=G):G=e[40];let H;e[41]!==h||e[42]!==G?(H=s.jsx(le,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground hover:text-destructive",onClick:z,disabled:h,children:G}),e[41]=h,e[42]=G,e[43]=H):H=e[43];let R;e[44]!==E||e[45]!==H?(R=s.jsxs("div",{className:"flex items-center justify-between",children:[E,H]}),e[44]=E,e[45]=H,e[46]=R):R=e[46];let F;e[47]!==t?(F=t("settings.decoCreditsHero.disconnectTitle"),e[47]=t,e[48]=F):F=e[48];let T;e[49]!==F?(T=s.jsx(We,{children:F}),e[49]=F,e[50]=T):T=e[50];let q;e[51]!==t?(q=t("settings.decoCreditsHero.disconnectDescription"),e[51]=t,e[52]=q):q=e[52];let x;e[53]!==q?(x=s.jsx(Je,{children:q}),e[53]=q,e[54]=x):x=e[54];let A;e[55]!==T||e[56]!==x?(A=s.jsxs(Xe,{children:[T,x]}),e[55]=T,e[56]=x,e[57]=A):A=e[57];let M;e[58]!==t?(M=t("settings.decoCreditsHero.cancelButton"),e[58]=t,e[59]=M):M=e[59];let w;e[60]!==M?(w=s.jsx(Ze,{children:M}),e[60]=M,e[61]=w):w=e[61];let D;e[62]!==u?(D=()=>u(),e[62]=u,e[63]=D):D=e[63];let Y;e[64]!==t?(Y=t("settings.decoCreditsHero.disconnectButton"),e[64]=t,e[65]=Y):Y=e[65];let W;e[66]!==D||e[67]!==Y?(W=s.jsx(et,{onClick:D,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Y}),e[66]=D,e[67]=Y,e[68]=W):W=e[68];let $;e[69]!==w||e[70]!==W?($=s.jsxs(tt,{children:[w,W]}),e[69]=w,e[70]=W,e[71]=$):$=e[71];let L;e[72]!==A||e[73]!==$?(L=s.jsxs(st,{children:[A,$]}),e[72]=A,e[73]=$,e[74]=L):L=e[74];let ee;e[75]!==v||e[76]!==L?(ee=s.jsx(it,{open:v,onOpenChange:_,children:L}),e[75]=v,e[76]=L,e[77]=ee):ee=e[77];let te;e[78]!==P||e[79]!==K||e[80]!==f||e[81]!==S?(te=S||f?s.jsx(Ee,{className:"h-9 w-24"}):s.jsx("span",{className:$e("text-3xl font-semibold tabular-nums tracking-tight",P!=null&&Qt(P)),children:K}),e[78]=P,e[79]=K,e[80]=f,e[81]=S,e[82]=te):te=e[82];let se;e[83]!==C?(se=()=>C(),e[83]=C,e[84]=se):se=e[84];let ie;e[85]!==t?(ie=t("settings.decoCreditsHero.refreshBalance"),e[85]=t,e[86]=ie):ie=e[86];const ne=f&&"animate-spin";let de;e[87]!==ne?(de=$e(ne),e[87]=ne,e[88]=de):de=e[88];let me;e[89]!==de?(me=s.jsx(Be,{size:14,className:de}),e[89]=de,e[90]=me):me=e[90];let fe;e[91]!==f||e[92]!==se||e[93]!==ie||e[94]!==me?(fe=s.jsx("button",{type:"button",onClick:se,disabled:f,className:"text-muted-foreground hover:text-foreground disabled:opacity-50 transition-colors p-1 rounded-md hover:bg-muted/50","aria-label":ie,children:me}),e[91]=f,e[92]=se,e[93]=ie,e[94]=me,e[95]=fe):fe=e[95];let ue;e[96]!==te||e[97]!==fe?(ue=s.jsxs("div",{className:"flex items-baseline gap-2",children:[te,fe]}),e[96]=te,e[97]=fe,e[98]=ue):ue=e[98];let pe;e[99]!==t?(pe=t("settings.decoCreditsHero.availableBalance"),e[99]=t,e[100]=pe):pe=e[100];let ge;e[101]!==pe?(ge=s.jsx("p",{className:"text-xs text-muted-foreground",children:pe}),e[101]=pe,e[102]=ge):ge=e[102];let he;e[103]!==ue||e[104]!==ge?(he=s.jsxs("div",{className:"flex flex-col gap-2 pt-2",children:[ue,ge]}),e[103]=ue,e[104]=ge,e[105]=he):he=e[105];let xe;e[106]!==t?(xe=t("settings.decoCreditsHero.addCredits"),e[106]=t,e[107]=xe):xe=e[107];let be;e[108]!==xe?(be=s.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-2.5",children:xe}),e[108]=xe,e[109]=be):be=e[109];let _e;e[110]===Symbol.for("react.memo_cache_sentinel")?(_e=s.jsx(Lt,{}),e[110]=_e):_e=e[110];let ve;e[111]!==be?(ve=s.jsxs("div",{className:"pt-4 border-t border-border/60",children:[be,_e]}),e[111]=be,e[112]=ve):ve=e[112];let ye;e[113]!==R||e[114]!==ee||e[115]!==he||e[116]!==ve?(ye=s.jsx(Re,{children:s.jsxs("div",{className:"px-5 py-5 flex flex-col gap-5",children:[R,ee,he,ve]})}),e[113]=R,e[114]=ee,e[115]=he,e[116]=ve,e[117]=ye):ye=e[117];let ke;return e[118]!==V||e[119]!==ye?(ke=s.jsx(Fe,{title:V,children:ye}),e[118]=V,e[119]=ye,e[120]=ke):ke=e[120],ke}function Yt(e){return e.providerId==="deco"}function Wt(){const e=Z.c(8),{org:t}=Ke(),i=je(),r=we();let n;e[0]!==i?(n=async()=>{await i.call("AI_PROVIDER_PROVISION_KEY",{providerId:"deco"})},e[0]=i,e[1]=n):n=e[1];let a;e[2]!==t||e[3]!==r?(a=()=>{Ve("ai_provider_provision_succeeded",{provider_id:"deco"}),r.invalidateQueries({queryKey:re.aiProviderKeys(t.id)}),r.invalidateQueries({queryKey:re.aiProviders(t.id)}),ae.success("Deco AI Gateway connected successfully")},e[2]=t,e[3]=r,e[4]=a):a=e[4];let c;return e[5]!==n||e[6]!==a?(c={mutationFn:n,onSuccess:a,onError:Jt},e[5]=n,e[6]=a,e[7]=c):c=e[7],Se(c)}function Jt(e){Ve("ai_provider_provision_failed",{provider_id:"deco",error:e.message}),ae.error(`Failed to connect Deco AI Gateway: ${e.message}`)}function Xt(){const e=Z.c(37),t=oe(),{mutate:i,isPending:r}=Wt();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=["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]=n):n=e[0];let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{backgroundImage:n.join(", ")}}),e[1]=a):a=e[1];let c;e[2]!==t?(c=t("settings.decoNudgeCard.decoAiGateway"),e[2]=t,e[3]=c):c=e[3];let o;e[4]!==c?(o=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:c,className:"size-12 shrink-0 rounded-xl object-contain dark:bg-white dark:p-1"}),e[4]=c,e[5]=o):o=e[5];let v;e[6]!==t?(v=t("settings.decoNudgeCard.decoAiGateway"),e[6]=t,e[7]=v):v=e[7];let _;e[8]!==v?(_=s.jsx("p",{className:"text-base font-semibold",children:v}),e[8]=v,e[9]=_):_=e[9];let y;e[10]!==t?(y=t("settings.decoNudgeCard.recommended"),e[10]=t,e[11]=y):y=e[11];let l;e[12]!==y?(l=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:y}),e[12]=y,e[13]=l):l=e[13];let d;e[14]!==_||e[15]!==l?(d=s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[_,l]}),e[14]=_,e[15]=l,e[16]=d):d=e[16];let m;e[17]!==t?(m=t("settings.decoNudgeCard.description"),e[17]=t,e[18]=m):m=e[18];let u;e[19]!==m?(u=s.jsx("p",{className:"text-sm text-muted-foreground",children:m}),e[19]=m,e[20]=u):u=e[20];let h;e[21]!==u||e[22]!==d?(h=s.jsxs("div",{className:"flex-1 min-w-0",children:[d,u]}),e[21]=u,e[22]=d,e[23]=h):h=e[23];let g;e[24]!==i?(g=()=>i(),e[24]=i,e[25]=g):g=e[25];let k;e[26]!==r||e[27]!==t?(k=t(r?"settings.decoNudgeCard.connecting":"settings.decoNudgeCard.connectDeco"),e[26]=r,e[27]=t,e[28]=k):k=e[28];let p;e[29]!==r||e[30]!==g||e[31]!==k?(p=s.jsx(le,{variant:"outline",disabled:r,onClick:g,children:k}),e[29]=r,e[30]=g,e[31]=k,e[32]=p):p=e[32];let j;return e[33]!==h||e[34]!==p||e[35]!==o?(j=s.jsxs("div",{className:"relative rounded-xl border border-border overflow-hidden",children:[a,s.jsxs("div",{className:"relative flex items-center gap-5 px-6 py-5",children:[o,h,p]})]}),e[33]=h,e[34]=p,e[35]=o,e[36]=j):j=e[36],j}const Zt=e=>X({label:I().min(1,e("settings.editProviderDialog.labelRequired")).max(100),apiKey:I().optional(),baseUrl:I().optional()});function es({isOpenAICompatible:e,baseUrl:t,currentBaseUrl:i,apiKey:r}){return e&&!!t&&t!==i&&!r}function ts({providerKey:e,provider:t,preset:i,maskedKey:r,currentLabel:n,currentBaseUrl:a,onCancel:c,onSuccess:o}){const{org:v}=Ke(),_=je(),y=we(),l=oe(),[d,m]=J.useState(!1),u=t.id==="openai-compatible",h=t.supportedMethods.includes("api-key"),g=Zt(l),{register:k,handleSubmit:p,watch:j,setError:N,formState:{errors:S}}=qe({resolver:He(g),defaultValues:{label:n,apiKey:"",baseUrl:a??""}}),C=j("apiKey")??"",{mutate:f,isPending:P}=Se({mutationFn:async b=>{let K;b.apiKey&&(u?K=JSON.stringify({baseUrl:b.baseUrl||a||"",apiKey:b.apiKey}):K=b.apiKey),await _.call("AI_PROVIDER_KEY_UPDATE",{keyId:e.id,label:b.label,...K!==void 0?{apiKey:K}:{}})},onSuccess:()=>{y.invalidateQueries({queryKey:re.aiProviderKeys(v.id)}),y.invalidateQueries({queryKey:re.aiProviders(v.id)}),ae.success(l("settings.editProviderDialog.providerUpdated")),o()},onError:b=>ae.error(l("settings.editProviderDialog.failedToUpdate",{error:b.message}))});return s.jsxs("form",{onSubmit:p(b=>{if(es({isOpenAICompatible:u,baseUrl:b.baseUrl,currentBaseUrl:a,apiKey:b.apiKey})){N("apiKey",{message:l("settings.editProviderDialog.apiKeyRequiredForBaseUrlChange")});return}f(b)}),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:l("settings.editProviderDialog.label")}),s.jsx(De,{placeholder:l("settings.editProviderDialog.labelPlaceholder"),...k("label"),className:"h-8 text-sm"}),S.label&&s.jsx("p",{className:"text-xs text-destructive",children:S.label.message})]}),u&&!i?.defaultBaseUrl&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:l("settings.editProviderDialog.baseUrl")}),s.jsx(De,{type:"url",placeholder:i?.baseUrlPlaceholder??l("settings.editProviderDialog.baseUrlPlaceholder"),...k("baseUrl"),className:"h-8 text-sm"})]}),h&&s.jsxs("div",{className:"space-y-1",children:[s.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:[l("settings.editProviderDialog.apiKey")," ",s.jsxs("span",{className:"text-muted-foreground/60",children:["(",l("settings.editProviderDialog.leaveBlankHint"),")"]})]}),s.jsxs("div",{className:"relative",children:[s.jsx(De,{type:d&&C?"text":"password",placeholder:r,...k("apiKey"),className:"ph-no-capture h-8 text-sm pr-8"}),C&&s.jsx("button",{type:"button",onClick:()=>m(!d),"aria-label":l(d?"settings.editProviderDialog.hideApiKey":"settings.editProviderDialog.showApiKey"),className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:d?s.jsx(Pt,{size:14}):s.jsx(Nt,{size:14})})]}),S.apiKey&&s.jsx("p",{className:"text-xs text-destructive",children:S.apiKey.message})]}),i?.helpText&&s.jsx("p",{className:"text-xs text-muted-foreground",children:i.helpText}),s.jsxs(At,{children:[s.jsx(le,{type:"button",variant:"ghost",size:"sm",onClick:c,disabled:P,children:l("settings.editProviderDialog.cancel")}),s.jsx(le,{type:"submit",size:"sm",disabled:P,children:l(P?"settings.editProviderDialog.saving":"settings.editProviderDialog.save")})]})]})}function ss(e){const t=Z.c(31),{providerKey:i,provider:r,open:n,onOpenChange:a}=e,c=oe(),o=je(),v=r.id==="openai-compatible"&&i.presetId?Ye(i.presetId):void 0,_=v?.name??r.name;let y;t[0]!==i.id?(y=re.aiProviderKeyPreview(i.id),t[0]=i.id,t[1]=y):y=t[1];let l;t[2]!==i.id||t[3]!==o?(l=()=>o.call("AI_PROVIDER_KEY_PREVIEW",{keyId:i.id}),t[2]=i.id,t[3]=o,t[4]=l):l=t[4];let d;t[5]!==n||t[6]!==y||t[7]!==l?(d={queryKey:y,queryFn:l,enabled:n,staleTime:0},t[5]=n,t[6]=y,t[7]=l,t[8]=d):d=t[8];const{data:m,isLoading:u}=Le(d),h=wt,g=Kt,k="sm:max-w-md",p=It,j=Dt,N=c("settings.editProviderDialog.editTitle",{name:_});let S;t[9]!==j||t[10]!==N?(S=s.jsx(j,{children:N}),t[9]=j,t[10]=N,t[11]=S):S=t[11];let C;t[12]!==p||t[13]!==S?(C=s.jsx(p,{children:S}),t[12]=p,t[13]=S,t[14]=C):C=t[14];let f;t[15]!==u||t[16]!==a||t[17]!==v||t[18]!==m||t[19]!==r||t[20]!==i?(f=u||!m?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(Mt,{})}):s.jsx(ts,{providerKey:i,provider:r,preset:v,maskedKey:m.maskedKey,currentLabel:m.label,currentBaseUrl:m.baseUrl,onCancel:()=>a(!1),onSuccess:()=>a(!1)}),t[15]=u,t[16]=a,t[17]=v,t[18]=m,t[19]=r,t[20]=i,t[21]=f):f=t[21];let P;t[22]!==g||t[23]!==C||t[24]!==f?(P=s.jsxs(g,{className:k,children:[C,f]}),t[22]=g,t[23]=C,t[24]=f,t[25]=P):P=t[25];let b;return t[26]!==h||t[27]!==a||t[28]!==n||t[29]!==P?(b=s.jsx(h,{open:n,onOpenChange:a,children:P}),t[26]=h,t[27]=a,t[28]=n,t[29]=P,t[30]=b):b=t[30],b}function is(e){const t=Z.c(88),{providerKey:i,provider:r}=e,{org:n}=Ke(),a=je(),c=we(),[o,v]=J.useState(!1),[_,y]=J.useState(!1),l=oe(),[d]=ot(),m=d.language==="pt-BR"?jt:void 0,u=r.id==="openai-compatible";let h;t[0]!==u||t[1]!==i.presetId?(h=u&&i.presetId?Ye(i.presetId):void 0,t[0]=u,t[1]=i.presetId,t[2]=h):h=t[2];const g=h;let k;t[3]!==u||t[4]!==g||t[5]!==r.name||t[6]!==l?(k=g?g.name:u?l("settings.aiProviders.customOpenAiCompatible"):r.name,t[3]=u,t[4]=g,t[5]=r.name,t[6]=l,t[7]=k):k=t[7];const p=k,j=g?.logo??r.logo;let N;e:{if(u){N=i.label;break e}let ne;t[8]!==m||t[9]!==i.createdAt||t[10]!==i.label||t[11]!==l?(ne=l("settings.providerKeyRow.addedTimeAgo",{label:i.label,time:St(new Date(i.createdAt),{locale:m})}),t[8]=m,t[9]=i.createdAt,t[10]=i.label,t[11]=l,t[12]=ne):ne=t[12],N=ne}const S=N;let C;t[13]!==i.id||t[14]!==a?(C=async()=>{await a.call("AI_PROVIDER_KEY_DELETE",{keyId:i.id})},t[13]=i.id,t[14]=a,t[15]=C):C=t[15];let f;t[16]!==n||t[17]!==i.id||t[18]!==c||t[19]!==l?(f=()=>{c.invalidateQueries({queryKey:re.aiProviderKeys(n.id)}),c.invalidateQueries({queryKey:re.aiProviders(n.id)}),c.invalidateQueries({queryKey:re.aiProviderModels(n.id,i.id)}),ae.success(l("settings.providerKeyRow.keyDeleted")),v(!1)},t[16]=n,t[17]=i.id,t[18]=c,t[19]=l,t[20]=f):f=t[20];let P;t[21]!==l?(P=ne=>ae.error(l("settings.providerKeyRow.failedToDeleteKey",{error:ne.message})),t[21]=l,t[22]=P):P=t[22];let b;t[23]!==C||t[24]!==f||t[25]!==P?(b={mutationFn:C,onSuccess:f,onError:P},t[23]=C,t[24]=f,t[25]=P,t[26]=b):b=t[26];const{mutate:K,isPending:V}=Se(b);let B;t[27]!==p||t[28]!==j?(B=j?s.jsx("img",{src:j,alt:p,className:"size-8 rounded-md object-contain dark:bg-white dark:p-0.5"}):s.jsx(kt,{fallback:p.charAt(0),className:"size-8 bg-primary/10 text-primary"}),t[27]=p,t[28]=j,t[29]=B):B=t[29];let O;t[30]!==l?(O=l("settings.providerKeyRow.editProviderKey"),t[30]=l,t[31]=O):O=t[31];let Q,U;t[32]===Symbol.for("react.memo_cache_sentinel")?(Q=()=>y(!0),U=s.jsx(Ct,{size:14}),t[32]=Q,t[33]=U):(Q=t[32],U=t[33]);let E;t[34]!==O?(E=s.jsx(le,{variant:"ghost",size:"icon","aria-label":O,className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:Q,children:U}),t[34]=O,t[35]=E):E=t[35];let z;t[36]!==l?(z=l("settings.providerKeyRow.deleteProviderKey"),t[36]=l,t[37]=z):z=t[37];let G,H;t[38]===Symbol.for("react.memo_cache_sentinel")?(G=()=>v(!0),H=s.jsx(_t,{size:14}),t[38]=G,t[39]=H):(G=t[38],H=t[39]);let R;t[40]!==V||t[41]!==z?(R=s.jsx(le,{variant:"ghost",size:"icon","aria-label":z,className:"h-7 w-7 text-muted-foreground hover:text-destructive",disabled:V,onClick:G,children:H}),t[40]=V,t[41]=z,t[42]=R):R=t[42];let F;t[43]!==E||t[44]!==R?(F=s.jsxs("div",{className:"flex items-center gap-0.5",children:[E,R]}),t[43]=E,t[44]=R,t[45]=F):F=t[45];let T;t[46]!==S||t[47]!==p||t[48]!==F||t[49]!==B?(T=s.jsx(Qe,{icon:B,title:p,description:S,action:F}),t[46]=S,t[47]=p,t[48]=F,t[49]=B,t[50]=T):T=t[50];let q;t[51]!==_||t[52]!==r||t[53]!==i?(q=s.jsx(ss,{providerKey:i,provider:r,open:_,onOpenChange:y}),t[51]=_,t[52]=r,t[53]=i,t[54]=q):q=t[54];let x;t[55]!==l?(x=l("settings.providerKeyRow.deleteApiKey"),t[55]=l,t[56]=x):x=t[56];let A;t[57]!==x?(A=s.jsx(We,{children:x}),t[57]=x,t[58]=A):A=t[58];let M;t[59]!==i.label?(M=s.jsxs(Je,{children:["This action cannot be undone. This will permanently delete"," ",s.jsx("span",{className:"font-medium text-foreground",children:i.label}),"."]}),t[59]=i.label,t[60]=M):M=t[60];let w;t[61]!==A||t[62]!==M?(w=s.jsxs(Xe,{children:[A,M]}),t[61]=A,t[62]=M,t[63]=w):w=t[63];let D;t[64]!==l?(D=l("settings.providerKeyRow.cancel"),t[64]=l,t[65]=D):D=t[65];let Y;t[66]!==D?(Y=s.jsx(Ze,{children:D}),t[66]=D,t[67]=Y):Y=t[67];let W;t[68]!==K?(W=()=>K(),t[68]=K,t[69]=W):W=t[69];let $;t[70]!==l?($=l("settings.providerKeyRow.delete"),t[70]=l,t[71]=$):$=t[71];let L;t[72]!==W||t[73]!==$?(L=s.jsx(et,{onClick:W,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:$}),t[72]=W,t[73]=$,t[74]=L):L=t[74];let ee;t[75]!==Y||t[76]!==L?(ee=s.jsxs(tt,{children:[Y,L]}),t[75]=Y,t[76]=L,t[77]=ee):ee=t[77];let te;t[78]!==w||t[79]!==ee?(te=s.jsxs(st,{children:[w,ee]}),t[78]=w,t[79]=ee,t[80]=te):te=t[80];let se;t[81]!==o||t[82]!==te?(se=s.jsx(it,{open:o,onOpenChange:v,children:te}),t[81]=o,t[82]=te,t[83]=se):se=t[83];let ie;return t[84]!==T||t[85]!==q||t[86]!==se?(ie=s.jsxs(s.Fragment,{children:[T,q,se]}),t[84]=T,t[85]=q,t[86]=se,t[87]=ie):ie=t[87],ie}function ls(e){const t=Z.c(17),{onConnectClick:i}=e,r=oe(),n=Ce(),a=Ge();let c;t[0]!==a?.providers?(c=a?.providers??[],t[0]=a?.providers,t[1]=c):c=t[1];const o=c;let v;if(t[2]!==n||t[3]!==i||t[4]!==o||t[5]!==r){let _;t[7]!==o?(_=h=>({key:h,provider:o.find(g=>g.id===h.providerId)}),t[7]=o,t[8]=_):_=t[8];const y=n.filter(ns).map(_).filter(os);let l;t[9]!==r?(l=r("settings.connectedProvidersSection.sectionTitle"),t[9]=r,t[10]=l):l=t[10];let d;t[11]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(yt,{size:14}),t[11]=d):d=t[11];let m;t[12]!==r?(m=r("settings.connectedProvidersSection.connectButton"),t[12]=r,t[13]=m):m=t[13];let u;t[14]!==i||t[15]!==m?(u=s.jsxs(le,{size:"sm",onClick:i,children:[d,m]}),t[14]=i,t[15]=m,t[16]=u):u=t[16],v=s.jsx(Fe,{title:l,headerClassName:"px-0",actions:u,children:y.length===0?s.jsx("p",{className:"text-sm text-muted-foreground px-1",children:r("settings.connectedProvidersSection.emptyState")}):s.jsx(Re,{children:y.map(rs)})}),t[2]=n,t[3]=i,t[4]=o,t[5]=r,t[6]=v}else v=t[6];return v}function rs(e){const{key:t,provider:i}=e;return s.jsx(is,{providerKey:t,provider:i},t.id)}function os(e){return e.provider!==void 0}function ns(e){return e.providerId!=="deco"}function as(e){const t=Z.c(3),{error:i}=e;let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(at,{size:16}),t[0]=r):r=t[0];let n;return t[1]!==i.message?(n=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[r,s.jsxs("span",{className:"text-sm font-medium",children:["Failed to load AI providers: ",i.message]})]}),t[1]=i.message,t[2]=n):n=t[2],n}function cs(){const e=Z.c(23),t=Ce();let i;e[0]!==t?(i=t.some(ds),e[0]=t,e[1]=i):i=e[1];const r=i,n=t.length>0,[a,c]=J.useState(!1),[o,v]=J.useState(null),_=Ge();let y;e[2]!==_?.providers?(y=_?.providers??[],e[2]=_?.providers,e[3]=y):y=e[3];const l=y;if(!n){let k;e[4]===Symbol.for("react.memo_cache_sentinel")?(k=()=>c(!0),e[4]=k):k=e[4];let p;e[5]!==l?(p=s.jsx(xt,{providers:l,onSelect:v,onShowAll:k}),e[5]=l,e[6]=p):p=e[6];const j=o!==null||a;let N;e[7]===Symbol.for("react.memo_cache_sentinel")?(N=P=>{P||(v(null),c(!1))},e[7]=N):N=e[7];const S=o??void 0;let C;e[8]!==j||e[9]!==S?(C=s.jsx(Oe,{open:j,onOpenChange:N,initialProvider:S}),e[8]=j,e[9]=S,e[10]=C):C=e[10];let f;return e[11]!==p||e[12]!==C?(f=s.jsxs(s.Fragment,{children:[p,C]}),e[11]=p,e[12]=C,e[13]=f):f=e[13],f}let d;e[14]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(J.Suspense,{fallback:s.jsx(Ee,{className:"h-16 w-full"}),children:s.jsx(Ht,{})}),e[14]=d):d=e[14];let m;e[15]!==r?(m=r?s.jsx(Gt,{}):s.jsx(Xt,{}),e[15]=r,e[16]=m):m=e[16];let u;e[17]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(ls,{onConnectClick:()=>c(!0)}),e[17]=u):u=e[17];let h;e[18]!==a?(h=s.jsx(Oe,{open:a,onOpenChange:c}),e[18]=a,e[19]=h):h=e[19];let g;return e[20]!==m||e[21]!==h?(g=s.jsxs(s.Fragment,{children:[d,m,u,h]}),e[20]=m,e[21]=h,e[22]=g):g=e[22],g}function ds(e){return e.providerId==="deco"}function ms(){const e=Z.c(7),t=oe();let i;e[0]!==t?(i=t("settings.nav.aiProviders"),e[0]=t,e[1]=i):i=e[1];let r;e[2]!==i?(r=s.jsx(Pe.Title,{children:i}),e[2]=i,e[3]=r):r=e[3];let n;e[4]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(nt,{fallback:fs,children:s.jsx(J.Suspense,{fallback:s.jsx(Ee,{className:"h-64 w-full"}),children:s.jsx(cs,{})})}),e[4]=n):n=e[4];let a;return e[5]!==r?(a=s.jsx(Pe,{children:s.jsx(Pe.Content,{children:s.jsx(Pe.Body,{children:s.jsxs(ct,{children:[r,n]})})})}),e[5]=r,e[6]=a):a=e[6],a}function fs(e){const{error:t}=e;return s.jsx(as,{error:t??new Error("Failed to load AI providers")})}function bi(){const e=Z.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(Et,{capability:"ai-providers:manage",area:"AI providers",children:s.jsx(ms,{})}),e[0]=t):t=e[0],t}export{bi as default};
@@ -1 +0,0 @@
1
- import{c as gt,b as yt,r as w,j as o,m as kt,k as _t,t as xt}from"./index-sd38S2ER.js";import{i as jt}from"./ChevronRight-Bqyf0yi2.js";import{n as Bt}from"./automation-runs-BZROadaX.js";import{A as At}from"./add-section-modal-BV6Pejty.js";import{A as wt,B as Et,C as Nt,D as Rt,F as Ct,G as Kt,S as Tt,H as Ft,I as $t}from"./index-fII9c_kY.js";import"./select-BaiNHGHX.js";import"./tooltip-Bjx5IK0l.js";import"./Check-CWNssTV8.js";import"./ChevronDown-BWHEr7M7.js";import"./ChevronUp-ROaBb_s7.js";import"./useInfiniteQuery-cI69eqxa.js";import"./use-infinite-scroll-BOm4DukJ.js";import"./use-connection-DtVPu3zH.js";import"./use-mcp-client-Cav0AiKw.js";import"./auth-ByPgJhb1.js";import"./use-virtual-mcp-DzUwFLTQ.js";import"./card-yJEtZ44f.js";import"./sidebar-DTxjIJ56.js";import"./LayoutLeft-CGP9_srE.js";import"./use-mobile-DxvpAkbd.js";import"./X-CalOG8rP.js";import"./table-CW9azojk.js";import"./empty-state-BZSpYvM0.js";import"./use-members-1alkNMLr.js";import"./use-org-auth-client-HGMDWZ37.js";import"./use-clock-tick-9uLrrBUm.js";import"./AlertCircle-CSQCPj_V.js";import"./CheckCircle-DDuWLqUq.js";import"./DotsVertical-C-UD1H-W.js";import"./agent-icon-aWRSFV3S.js";import"./Tool01-DluxhvbR.js";import"./ArrowUp-B6IlW6Qi.js";import"./Settings02-DWHb-lRw.js";import"./Tool02-5oU4U7Oz.js";import"./XCircle-CfbsFoSm.js";import"./ArrowUpRight-eD5g-cFd.js";import"./TrendUp01-DxZS9i5H.js";import"./ZapSquare-Dm2_KtgV.js";import"./Users03-DgykpOrm.js";import"./Stars02-DLFxhacf.js";import"./Copy01-_e4tlhaR.js";import"./Eye-BZEDG_yV.js";import"./FilterLines-B2iuWHYg.js";import"./Star01-qAZqSHYs.js";import"./Palette-BStHvqZ6.js";import"./SwitchHorizontal01-SFOutJ0F.js";import"./HardDrive-1qI5HKiO.js";import"./Key01-AWbv_wld.js";import"./LinkExternal01-BHxU7hA5.js";import"./LogOut01-BHFIF5pV.js";import"./Monitor01-kMl_aKHS.js";import"./Sun-Bmj9T9Hs.js";import"./Play-CgnGl0Ls.js";import"./Plus-CSNWQMMp.js";import"./SearchLg-LtdaD4ZG.js";import"./SearchMd-BEvxAPyw.js";import"./Shield01-T-UpndO1.js";import"./Stars01-CO4iRFT5.js";import"./Trash01-BecpyKSB.js";import"./Upload01-D6mhS0Il.js";import"./User01-CAYZjCBh.js";import"./Users01-CJn3nv4f.js";import"./XClose-BFk0sz9G.js";import"./Zap-BNdcgXgA.js";import"./use-automations-DAZgpS9S.js";import"./studio-tools-C9O5T6hk.js";import"./useSuspenseInfiniteQuery-DXLjl_Ue.js";import"./avatar-2NkvJFhn.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-BmXjtpVk.js";import"./dialog-Dq_peVG0.js";import"./tab-id-D67TyC-3.js";import"./hooks-CiBCHAEU.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-C1RJsJS0.js";import"./chat-context-DoK0lfG3.js";import"./use-ai-providers-Dsmt_TQY.js";import"./use-decopilot-events-Hca5p5mu.js";import"./use-organization-settings-C8aPcOm4.js";import"./monaco-editor-Cxpp-hMU.js";import"./index-luz2_Kqi.js";import"./calendar-Cd5zs7es.js";import"./shell-layout-OumtAwy1.js";import"./required-auth-layout-CIVjmrI-.js";import"./use-org-sso-elnfvOdJ.js";import"./integration-icon-D-DwNzR1.js";import"./use-navigate-to-agent-DWHbwpLC.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-BMJ7Mtx-.js";import"./form-Da6Pak5q.js";import"./label-q5RWAz3v.js";import"./input-Df5WqCIh.js";import"./drawer-BSvXGda-.js";import"./collection-search-vT5mWioA.js";import"./index-CIJ4b6SD.js";import"./get-initials-D-f_fDFw.js";import"./popover-BxXBf9EH.js";import"./dropdown-menu-BuPKJUY8.js";import"./github-repo-picker-BjY_cbDW.js";import"./use-debounced-value-BhoOs69E.js";import"./authenticate-and-persist-oauth-BjOG3bpy.js";import"./mcp-oauth-C159CTqw.js";import"./use-mcp-tools-BvTay4jb.js";import"./extract-connection-data-ZTR7xcCD.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-DWINBxtd.js";import"./use-tags-DhH7fJ9n.js";import"./command-Dq6iipS5.js";import"./index-k6yNjC6u.js";import"./companions-core-DBWG3_HY.js";import"./tabs-Dg2fovl2.js";import"./toggle-group-Bd_5HjJ1.js";import"./use-deco-credits-CWhdUeI9.js";import"./alert-dialog-CI_jOgZR.js";import"./toolbar-BQhumIzA.js";import"./skeleton-Bqf4wcUq.js";import"./agent-capabilities-cXfbMfjV.js";import"./connection-card-CK8a5ay6.js";import"./use-registry-connections-BJ4Y5FI-.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-B-mbIfJP.js";import"./connection-form-helpers-C2rTDrzA.js";import"./collection-tabs-Cm8oTUd7.js";import"./badge-BkDtGQCF.js";import"./connect-desktop-dialog-BUp1haXa.js";import"./select-model-C_5UqaCI.js";import"./checkbox-5E1V-xvi.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-BzmRZGKV.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-BkECfwLj.js";import"./deco-site-production-url-CaKZ7xBn.js";import"./use-capability-DbSBzq4m.js";import"./pt-BR-CLy76QW2.js";import"./use-mcp-auth-status-BggNWMN0.js";import"./use-debounced-autosave-CV9YJ4dj.js";import"./index-Bl2gwdpO.js";import"./search-input-C0Tu8jAx.js";import"./switch-DzR4USnH.js";import"./use-secrets-5yqKG0Fz.js";import"./useQueries-CHVnUdBY.js";import"./use-file-configs-giwXdJFa.js";import"./automation-list-row-xT8oiUOD.js";function Pt(l,t){const p=(l.title||l.resolveType.split("/").pop()||"").replace(/\.(tsx?|jsx?)$/,"").replace(/[^A-Za-z0-9_-]/g,""),u=/^[A-Za-z]/.test(p)&&p.length>0?p:"Section",n=wt(t,u);return{blockKey:n,data:{__resolveType:l.resolveType,name:n}}}function jr(l){const t=gt.c(80),{orgSlug:p,virtualMcpId:u,branch:n,blockKey:i,block:c,meta:m,decofile:d,title:Z,excludeFields:G,schemaPending:nt,previewBaseUrl:ct}=l,J=nt===void 0?!1:nt,x=ct===void 0?null:ct,s=yt(),b=typeof c?.__resolveType=="string"?c.__resolveType:"";let R;t[0]!==G||t[1]!==m||t[2]!==b?(R=Et(b,m,G),t[0]=G,t[1]=m,t[2]=b,t[3]=R):R=t[3];const h=R;let C;t[4]!==h?(C=!!h&&Object.keys(h.properties??{}).length>0,t[4]=h,t[5]=C):C=t[5];const Q=C;let K;t[6]!==c||t[7]!==i||t[8]!==m||t[9]!==Z?(K=Z??(c?Nt(i,c,m):i),t[6]=c,t[7]=i,t[8]=m,t[9]=Z,t[10]=K):K=t[10];const v=K;let T;t[11]!==n||t[12]!==p||t[13]!==u?(T={orgSlug:p,virtualMcpId:u,branch:n},t[11]=n,t[12]=p,t[13]=u,t[14]=T):T=t[14];const{save:S,flush:W,isPending:X}=Rt(T);let F;t[15]!==n||t[16]!==p||t[17]!==u?(F={orgSlug:p,virtualMcpId:u,branch:n},t[15]=n,t[16]=p,t[17]=u,t[18]=F):F=t[18];const Y=Ct(F);let $;t[19]!==S?($=Ft((e,r)=>S(e,r)),t[19]=S,t[20]=$):$=t[20];const tt=$,[ht,bt]=w.useState(i),[et,dt]=w.useState(null),[ot,ft]=w.useState(0);let P;t[21]===Symbol.for("react.memo_cache_sentinel")?(P=[],t[21]=P):P=t[21];const[a,ut]=w.useState(P),[rt,it]=w.useState(!1),O=w.useRef(null);ht!==i&&(bt(i),dt(null),ft(zt),ut([]));let z;t[22]!==c?(z=c??{},t[22]=c,t[23]=z):z=t[23];const mt=z;let g;t[24]!==et?(g=et??{},t[24]=et,t[25]=g):g=t[25];let I;t[26]!==mt||t[27]!==g?(I={...mt,...g},t[26]=mt,t[27]=g,t[28]=I):I=t[28];const st=I;let V;t[29]!==i||t[30]!==b||t[31]!==S?(V=e=>{const r=e;dt(r),S(i,{...r,__resolveType:b})},t[29]=i,t[30]=b,t[31]=S,t[32]=V):V=t[32];const pt=V;let q;t[33]===Symbol.for("react.memo_cache_sentinel")?(q=e=>{ut(e)},t[33]=q):q=t[33];const at=q;let L;t[34]!==d||t[35]!==W||t[36]!==Y||t[37]!==s?(L=async(e,r)=>{try{const{blockKey:f,data:N}=Pt(e,d);await Y.mutateAsync({blockKey:f,data:N}),xt.success(s("sandbox.appEditor.createdSection",{name:f})),r({__resolveType:f}),W()}catch(f){const N=f,St=N instanceof Error?N.message:s("sandbox.appEditor.failedAddSection");throw xt.error(St),N}},t[34]=d,t[35]=W,t[36]=Y,t[37]=s,t[38]=L):L=t[38];const y=L;let U;t[39]===Symbol.for("react.memo_cache_sentinel")?(U=e=>{O.current=e.append,it(!0)},t[39]=U):U=t[39];const vt=U;let D;t[40]!==y?(D=async e=>{const r=O.current;if(r)try{await y(e,f=>{r(f),it(!1),O.current=null})}catch{}},t[40]=y,t[41]=D):D=t[41];const lt=D;let H;t[42]!==a||t[43]!==v?(H=a.length>0?[v,...a]:[],t[42]=a,t[43]=v,t[44]=H):H=t[44];const E=H;let k;t[45]!==a||t[46]!==E||t[47]!==s||t[48]!==v?(k=E.length>0?o.jsx("nav",{"aria-label":s("sandbox.appEditor.editingBreadcrumb"),className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:E.map((e,r)=>{const f=r===E.length-1;return o.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[r>0&&o.jsx(jt,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("button",{type:"button",onClick:()=>{at(r===0?[]:Kt(a,r)),ft(Ot)},title:e,className:kt("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",f?"font-medium text-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:e})]},`${e}-${r}`)})}):o.jsx("span",{className:"text-sm font-medium",children:v}),t[45]=a,t[46]=E,t[47]=s,t[48]=v,t[49]=k):k=t[49];let _;t[50]!==X?(_=o.jsx($t,{isPending:X,isError:!1}),t[50]=X,t[51]=_):_=t[51];let j;t[52]!==k||t[53]!==_?(j=o.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[k,_]}),t[52]=k,t[53]=_,t[54]=j):j=t[54];let B;t[55]!==i||t[56]!==a||t[57]!==d||t[58]!==st||t[59]!==ot||t[60]!==y||t[61]!==pt||t[62]!==Q||t[63]!==m||t[64]!==x||t[65]!==tt||t[66]!==h||t[67]!==J||t[68]!==s?(B=o.jsx(Bt,{className:"min-h-0 min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"px-6 py-6",children:o.jsx("div",{className:"mx-auto max-w-xl",children:Q?o.jsx(Tt,{schema:h,value:st,onChange:pt,basePath:"",breadcrumbPath:a,onBreadcrumbChange:at,decofile:d,meta:m,onSaveReferencedBlock:tt,previewBaseUrl:x,onAddSectionItem:y,onRequestAddSection:vt},`${i}:${ot}`):J?o.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center text-xs text-muted-foreground",children:[o.jsx(_t,{size:16,className:"animate-spin"}),s("sandbox.appEditor.loadingSchema")]}):o.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:s("sandbox.appEditor.noEditableSchema")})})})}),t[55]=i,t[56]=a,t[57]=d,t[58]=st,t[59]=ot,t[60]=y,t[61]=pt,t[62]=Q,t[63]=m,t[64]=x,t[65]=tt,t[66]=h,t[67]=J,t[68]=s,t[69]=B):B=t[69];let A;t[70]!==rt||t[71]!==d||t[72]!==lt||t[73]!==m||t[74]!==x?(A=x&&o.jsx(At,{open:rt,onOpenChange:e=>{it(e),e||(O.current=null)},meta:m,decofile:d,previewBaseUrl:x,onSelect:e=>{lt(e)}}),t[70]=rt,t[71]=d,t[72]=lt,t[73]=m,t[74]=x,t[75]=A):A=t[75];let M;return t[76]!==j||t[77]!==B||t[78]!==A?(M=o.jsxs("div",{className:"flex h-full flex-col",children:[j,B,A]}),t[76]=j,t[77]=B,t[78]=A,t[79]=M):M=t[79],M}function Ot(l){return l+1}function zt(l){return l+1}export{jr as AppEditor};
@@ -1 +0,0 @@
1
- import{D as pe,r as v,e as J,p as _,a as L,j as e,m as h,B as ge,c as Ce,b as fe,S as xe}from"./index-sd38S2ER.js";import{I as W}from"./input-Df5WqCIh.js";import{r as Ie,R as ke}from"./retry-CErkP7V6.js";const Q="font-medium text-[#8CAA25] hover:underline disabled:opacity-50",Ae={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:r=>`Code sent to ${r}`,defaultSubtitle:"Sign in or create a new account",resetEmailSent:"Check your email for a password reset link.",continueWith:r=>`Continue with ${r}`,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:r,callbackUrl:s="/",title:f,subtitle:x,brand:p,copy:j,variant:w="default",allowedSocialProviders:c,allowPassword:m=!0,onAuthEvent:D}){const{emailAndPassword:F,resetPassword:q,emailOtp:u,socialProviders:N}=pe(),g=t=>{try{D?.(t)}catch{}},d=w==="compact",$=c?N.providers.filter(t=>c.includes(t.name)):N.providers,G=N.enabled&&$.length>0,X=F.enabled&&(m||!u.enabled&&!G),Y=N.enabled&&N.providers.length>0&&!G&&!u.enabled&&!X?N.providers:$,V=N.enabled&&Y.length>0,y=F.enabled&&(m||!u.enabled&&!V),[i,P]=v.useState(""),[l,be]=v.useState(""),[Z,ie]=v.useState(""),[ee,te]=v.useState(""),[O,se]=v.useState(!1),[ae,ve]=v.useState(()=>u.enabled?"emailOtp":globalThis.localStorage?.getItem("hasLoggedIn")!=="true"?"signUp":"signIn"),[E,T]=v.useState(""),[re,oe]=v.useState(!1),a={...Ae,...j},b=ae==="signUp",I=ae==="forgotPassword",C=ae==="emailOtp",B=J({mutationFn:async({email:t,password:n,name:k})=>{try{if(b){const S=await L.signUp.email({email:t,password:n,name:k||""});if(S.error)throw new Error(S.error.message||a.signUpFailed);return S}else{const S=await L.signIn.email({email:t,password:n});if(S.error)throw new Error(S.error.message||a.signInFailed);return S}}catch(S){throw S instanceof Error?S:new Error(a.authenticationFailed)}},onMutate:()=>{g({type:"started",method:"email_password",mode:b?"sign_up":"sign_in"})},onSuccess:()=>{g({type:"succeeded",method:"email_password",mode:b?"sign_up":"sign_in"}),globalThis.localStorage?.setItem("hasLoggedIn","true"),window.location.href=r??s},onError:t=>{g({type:"failed",method:"email_password",mode:b?"sign_up":"sign_in",stage:"authenticate",error:t instanceof Error?t.message:String(t)}),_(b?"user_signup_failed":"user_signin_failed",{error:t instanceof Error?t.message:String(t)})}}),H=J({mutationFn:async({email:t})=>{const n=await L.requestPasswordReset({email:t,redirectTo:"/reset-password"});if(n.error)throw new Error(n.error.message||a.resetEmailFailed);return n},onSuccess:()=>{_("password_reset_requested"),oe(!0)},onError:t=>{_("password_reset_request_failed",{error:t instanceof Error?t.message:String(t)})}}),R=J({mutationFn:async({email:t})=>{const n=await L.emailOtp.sendVerificationOtp({email:t,type:"sign-in"});if(n.error)throw new Error(n.error.message||a.otpSendFailed);return n},onMutate:()=>{g({type:"started",method:"email_otp"})},onSuccess:()=>{g({type:"otp_sent",method:"email_otp"}),_("email_otp_sent"),se(!0)},onError:t=>{g({type:"failed",method:"email_otp",stage:"send_otp",error:t instanceof Error?t.message:String(t)}),_("email_otp_send_failed",{error:t instanceof Error?t.message:String(t)})}}),M=J({mutationFn:async({email:t,otp:n})=>{const k=await L.signIn.emailOtp({email:t,otp:n});if(k.error)throw new Error(k.error.message||a.invalidCode);return k},onMutate:()=>{g({type:"otp_submitted",method:"email_otp"})},onSuccess:()=>{g({type:"succeeded",method:"email_otp"}),globalThis.localStorage?.setItem("hasLoggedIn","true"),window.location.href=r??s},onError:t=>{g({type:"failed",method:"email_otp",stage:"verify_otp",error:t instanceof Error?t.message:String(t)}),_("email_otp_verify_failed",{error:t instanceof Error?t.message:String(t)})}}),K=t=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t),ne=()=>{i.trim()&&!K(i)&&T(a.invalidEmail)},ye=t=>{if(t.preventDefault(),!K(i)){T(a.invalidEmail),g({type:"failed",method:"email_password",mode:b?"sign_up":"sign_in",stage:"validation",error:"invalid_email"});return}B.mutate({email:i,password:l,name:Z})},we=t=>{if(t.preventDefault(),!K(i)){T(a.invalidEmail);return}H.mutate({email:i})},Ee=t=>{if(t.preventDefault(),!K(i)){T(a.invalidEmail),g({type:"failed",method:"email_otp",stage:"validation",error:"invalid_email"});return}R.mutate({email:i})},Se=t=>{t.preventDefault(),M.mutate({email:i,otp:ee})},U=t=>n=>{t(n.target.value),le&&B.reset(),de&&H.reset(),ce&&(R.reset(),M.reset()),t===P&&E&&T("")},z=t=>{ve(t),ie(""),te(""),se(!1),T(""),oe(!1),B.reset(),H.reset(),R.reset(),M.reset()},o=B.isPending||H.isPending||R.isPending||M.isPending,le=B.error,de=H.error,ce=R.error||M.error,A=b?i.trim()&&l.trim()&&Z.trim():I?i.trim():C?O?ee.trim():i.trim():i.trim()&&l.trim(),je=t=>{if(!t)return null;const n=t.message.toLowerCase();return n.includes("unauthorized")||n.includes("401")?a.invalidEmailOrPassword:n.includes("already exists")||n.includes("409")?a.accountExists:n.includes("network")||n.includes("fetch")?a.networkError:n.includes("rate limit")||n.includes("429")?a.tooManyAttempts:n.includes("invalid")&&n.includes("otp")?a.invalidOrExpiredCode:t.message||a.genericError},me=le||de||ce,Ne=async t=>{g({type:"started",method:"social",provider:t});try{const n=await L.signIn.social({provider:t,callbackURL:r??s});if(n.error)throw new Error(n.error.message||a.authenticationFailed)}catch(n){const k=n instanceof Error?n.message:String(n);g({type:"failed",method:"social",provider:t,stage:"redirect",error:k}),_("social_signin_failed",{provider:t,error:k})}},Pe=I?a.resetPasswordTitle:C&&O?a.verificationCodeTitle:f??a.welcomeTitle,ue=I?a.resetPasswordSubtitle:C&&O?a.codeSentTo(i):x===void 0?a.defaultSubtitle:x;return e.jsxs("div",{className:h("grid w-full",d?"gap-5":"gap-10"),children:[p??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:h("font-medium",d?"text-xl leading-7":"text-2xl leading-8"),children:Pe}),ue&&e.jsx("p",{className:h("text-muted-foreground",d?"text-sm leading-5":"text-base leading-6"),children:ue})]}),me&&e.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:je(me)}),re&&e.jsx("div",{className:"rounded-xl bg-success/10 p-3 text-sm text-success text-center",children:a.resetEmailSent}),!I&&!(C&&O)&&V&&e.jsx("div",{className:"grid gap-2",children:Y.map(t=>e.jsxs("button",{type:"button",disabled:o,onClick:()=>{Ne(t.name)},className:h("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",d?"h-11 rounded-lg":"h-12 rounded-xl"),children:[t.icon&&e.jsx("img",{src:t.icon,alt:"",className:h("h-5 w-5",t.name==="github"&&"dark:invert"),"aria-hidden":"true"}),a.continueWith(t.name.charAt(0).toUpperCase()+t.name.slice(1))]},t.name))}),!I&&!(C&&O)&&V&&(y||u.enabled)&&e.jsxs("div",{className:h("flex items-center gap-2.5",d?"my-0":"-my-4"),children:[e.jsx("div",{className:"h-px flex-1 bg-border"}),e.jsx("span",{className:h("text-muted-foreground",d?"text-sm":"text-base"),children:a.divider}),e.jsx("div",{className:"h-px flex-1 bg-border"})]}),C&&u.enabled&&e.jsx(e.Fragment,{children:O?e.jsxs("form",{onSubmit:Se,className:h("grid gap-2",d&&"sm:grid-cols-[minmax(0,1fr)_auto] sm:items-start"),children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx("label",{className:h("text-sm font-medium text-foreground",d&&"sr-only"),children:a.verificationCodeLabel}),e.jsx(W,{type:"text",placeholder:a.enterCodePlaceholder,value:ee,onChange:U(te),required:!0,disabled:o,autoFocus:!0,inputMode:"numeric",autoComplete:"one-time-code",className:"h-11 rounded-lg"})]}),e.jsx("button",{type:"submit",disabled:o||!A,className:h("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",d?"h-11 sm:w-auto":"h-12 w-full"),children:o?a.verifying:a.verify}),e.jsx("button",{type:"button",onClick:()=>{se(!1),te(""),R.reset(),M.reset()},disabled:o,className:h("mt-1 text-sm text-muted-foreground transition-colors hover:text-foreground",d&&"sm:col-span-2"),children:a.useDifferentEmail})]}):e.jsxs("form",{onSubmit:Ee,className:h("grid gap-2",d&&"sm:grid-cols-[minmax(0,1fr)_auto] sm:items-start"),children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx("label",{className:h("text-sm font-medium text-foreground",d&&"sr-only"),children:a.emailLabel}),e.jsx(W,{type:"email",placeholder:a.emailPlaceholder,value:i,onChange:U(P),onBlur:ne,required:!0,disabled:o,"aria-invalid":!!E,className:"h-11 rounded-lg"}),E&&e.jsx("p",{className:"text-xs text-destructive",children:E})]}),e.jsx("button",{type:"submit",disabled:o||!A,className:h("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",d?"h-11 sm:w-auto":"h-12 w-full"),children:o?a.sending:a.sendCode})]})}),I&&y&&!re&&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:a.emailLabel}),e.jsx(W,{type:"email",placeholder:"you@example.com",value:i,onChange:U(P),onBlur:ne,required:!0,disabled:o,"aria-invalid":!!E,className:"h-11 rounded-lg"}),E&&e.jsx("p",{className:"text-xs text-destructive mt-1.5",children:E})]}),e.jsx(ge,{type:"submit",disabled:o||!A,className:"w-full font-semibold",size:"xl",children:o?a.sending:a.sendResetLink})]}),!I&&!C&&y&&e.jsxs("form",{onSubmit:ye,className:"grid gap-5",children:[b&&e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:a.nameLabel}),e.jsx(W,{type:"text",placeholder:a.namePlaceholder,value:Z,onChange:U(ie),required:!0,disabled:o,className:"h-11 rounded-lg"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:a.emailLabel}),e.jsx(W,{type:"email",placeholder:"you@example.com",value:i,onChange:U(P),onBlur:ne,required:!0,disabled:o,"aria-invalid":!!E,className:"h-11 rounded-lg"}),E&&e.jsx("p",{className:"text-xs text-destructive mt-1.5",children:E})]}),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:a.passwordLabel}),!b&&q.enabled&&e.jsx("button",{type:"button",onClick:()=>z("forgotPassword"),className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:a.forgotPassword})]}),e.jsx(W,{type:"password",placeholder:"••••••••",value:l,onChange:U(be),required:!0,disabled:o,className:"h-11 rounded-lg"})]}),e.jsx("div",{className:h("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",A?"max-h-[100px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:e.jsx("div",{className:h("p-1",!A&&"pointer-events-none"),children:e.jsx(ge,{type:"submit",disabled:o||!A,className:h("w-full font-semibold"),size:"xl","aria-hidden":!A,children:o?b?a.creatingAccount:a.signingIn:a.continue})})})]}),e.jsx("div",{className:"text-sm text-muted-foreground",children:I?e.jsx("button",{type:"button",onClick:()=>z("signIn"),disabled:o,className:Q,children:a.backToSignIn}):C&&y?e.jsx("button",{type:"button",onClick:()=>z("signIn"),disabled:o,className:Q,children:a.signInWithPassword}):!C&&y?e.jsxs(e.Fragment,{children:[b?a.alreadyHaveAccount:a.dontHaveAccount,e.jsx("button",{type:"button",onClick:()=>z(b?"signIn":"signUp"),disabled:o,className:Q,children:b?a.signIn:a.signUp}),u.enabled&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"mx-2",children:"·"}),e.jsx("button",{type:"button",onClick:()=>z("emailOtp"),disabled:o,className:Q,children:a.signInWithEmailCode})]})]}):null})]})}class he{constructor(s){this.response=s}response}function Le(r){return r.startsWith("/")&&!r.startsWith("//")?r:"/"}function Fe({redirectTo:r,onAuthEvent:s}){const f=fe(),[x,p]=v.useState(null),j=v.useEffectEvent(w=>{try{s?.(w)}catch{}});return v.useEffect(()=>{let w=!1;return(async()=>{j({type:"started",method:"local"});try{let c;try{c=await Ie(async()=>{const m=await fetch("/api/auth/custom/local-session",{method:"POST",credentials:"include"});if(m.status>=500)throw new he(m);return m},{maxAttempts:5,minTimeout:1e3,maxTimeout:1e4,multiplier:2,jitter:0})}catch(m){if(m instanceof ke&&m.cause instanceof he)c=m.cause.response;else throw m}if(!c.ok){const m=await c.json().catch(()=>({}));throw new Error(m?.error||f("common.authEntry.autoLoginFailed"))}w||(j({type:"succeeded",method:"local"}),window.location.href=Le(r))}catch(c){w||(j({type:"failed",method:"local",stage:"authenticate",error:c instanceof Error?c.message:String(c)}),p(c instanceof Error?c.message:f("common.authEntry.autoLoginFailed")))}})(),()=>{w=!0}},[r]),x?e.jsx("div",{className:"flex min-h-screen items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-destructive mb-2",children:f("common.authEntry.autoLoginFailedWithError",{error:x})}),e.jsx("p",{className:"text-muted-foreground text-sm",children:f("common.authEntry.tryRestartingServer")})]})}):e.jsx(xe,{})}function Oe({callbackURL:r,providerId:s,onAuthEvent:f}){const x=v.useEffectEvent(p=>{try{f?.(p)}catch{}});return v.useEffect(()=>{(async()=>{x({type:"started",method:"sso",provider:s});try{const p=await L.signIn.sso({providerId:s,callbackURL:r});if(p.error)throw new Error(p.error.message||"SSO redirect failed")}catch(p){x({type:"failed",method:"sso",provider:s,stage:"redirect",error:p instanceof Error?p.message:String(p)})}})()},[s,r]),e.jsx(xe,{})}function Ue(r){const s=Ce.c(22),{callbackUrl:f,redirectUrl:x,allowAutoLogin:p,title:j,subtitle:w,brand:c,copy:m,variant:D,allowedSocialProviders:F,allowPassword:q,onAuthEvent:u}=r,N=p===void 0?!0:p,g=fe(),{sso:d,emailAndPassword:$,magicLink:G,emailOtp:X,socialProviders:Y,localMode:V}=pe(),y=x||f;if(V&&N){let l;return s[0]!==u||s[1]!==y?(l=e.jsx(Fe,{redirectTo:y,onAuthEvent:u}),s[0]=u,s[1]=y,s[2]=l):l=s[2],l}if(d.enabled){let l;return s[3]!==u||s[4]!==y||s[5]!==d.providerId?(l=e.jsx(Oe,{callbackURL:y,providerId:d.providerId,onAuthEvent:u}),s[3]=u,s[4]=y,s[5]=d.providerId,s[6]=l):l=s[6],l}if($.enabled||G.enabled||X.enabled||Y.enabled){let l;return s[7]!==q||s[8]!==F||s[9]!==c||s[10]!==f||s[11]!==m||s[12]!==u||s[13]!==x||s[14]!==w||s[15]!==j||s[16]!==D?(l=e.jsx(_e,{redirectUrl:x,callbackUrl:f,title:j,subtitle:w,brand:c,copy:m,variant:D,allowedSocialProviders:F,allowPassword:q,onAuthEvent:u}),s[7]=q,s[8]=F,s[9]=c,s[10]=f,s[11]=m,s[12]=u,s[13]=x,s[14]=w,s[15]=j,s[16]=D,s[17]=l):l=s[17],l}let i;s[18]!==g?(i=g("common.authEntry.noLoginOptions"),s[18]=g,s[19]=i):i=s[19];let P;return s[20]!==i?(P=e.jsx("div",{children:i}),s[20]=i,s[21]=P):P=s[21],P}export{Ue as A};
@@ -1 +0,0 @@
1
- import{c as he,b as je,r as de,j as t,k as ye,B as ne}from"./index-sd38S2ER.js";import{E as ue}from"./agent-icon-aWRSFV3S.js";import{i as ke}from"./X-CalOG8rP.js";import{L as ce}from"./label-q5RWAz3v.js";import{ak as xe,al as Ne}from"./index-fII9c_kY.js";import{S as Ce,a as Pe,b as Se,c as ve,d as _e}from"./select-BaiNHGHX.js";import{T as Te,a as we,c as Be}from"./tooltip-Bjx5IK0l.js";import"./AlertCircle-CSQCPj_V.js";import"./Tool01-DluxhvbR.js";import"./ArrowUp-B6IlW6Qi.js";import"./Settings02-DWHb-lRw.js";import"./Tool02-5oU4U7Oz.js";import"./XCircle-CfbsFoSm.js";import"./ArrowUpRight-eD5g-cFd.js";import"./TrendUp01-DxZS9i5H.js";import"./ZapSquare-Dm2_KtgV.js";import"./Users03-DgykpOrm.js";import"./CheckCircle-DDuWLqUq.js";import"./Check-CWNssTV8.js";import"./ChevronDown-BWHEr7M7.js";import"./ChevronRight-Bqyf0yi2.js";import"./ChevronUp-ROaBb_s7.js";import"./DotsVertical-C-UD1H-W.js";import"./Stars02-DLFxhacf.js";import"./Copy01-_e4tlhaR.js";import"./Eye-BZEDG_yV.js";import"./FilterLines-B2iuWHYg.js";import"./Star01-qAZqSHYs.js";import"./Palette-BStHvqZ6.js";import"./SwitchHorizontal01-SFOutJ0F.js";import"./HardDrive-1qI5HKiO.js";import"./Key01-AWbv_wld.js";import"./LayoutLeft-CGP9_srE.js";import"./LinkExternal01-BHxU7hA5.js";import"./LogOut01-BHFIF5pV.js";import"./Monitor01-kMl_aKHS.js";import"./Sun-Bmj9T9Hs.js";import"./Play-CgnGl0Ls.js";import"./Plus-CSNWQMMp.js";import"./SearchLg-LtdaD4ZG.js";import"./SearchMd-BEvxAPyw.js";import"./Shield01-T-UpndO1.js";import"./Stars01-CO4iRFT5.js";import"./Trash01-BecpyKSB.js";import"./Upload01-D6mhS0Il.js";import"./User01-CAYZjCBh.js";import"./Users01-CJn3nv4f.js";import"./XClose-BFk0sz9G.js";import"./Zap-BNdcgXgA.js";import"./chat-context-DoK0lfG3.js";import"./tab-id-D67TyC-3.js";import"./hooks-CiBCHAEU.js";import"./use-mcp-client-Cav0AiKw.js";import"./auth-ByPgJhb1.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-C1RJsJS0.js";import"./studio-tools-C9O5T6hk.js";import"./use-virtual-mcp-DzUwFLTQ.js";import"./use-ai-providers-Dsmt_TQY.js";import"./use-decopilot-events-Hca5p5mu.js";import"./use-organization-settings-C8aPcOm4.js";import"./automation-runs-BZROadaX.js";import"./useInfiniteQuery-cI69eqxa.js";import"./use-infinite-scroll-BOm4DukJ.js";import"./use-connection-DtVPu3zH.js";import"./card-yJEtZ44f.js";import"./sidebar-DTxjIJ56.js";import"./use-mobile-DxvpAkbd.js";import"./table-CW9azojk.js";import"./empty-state-BZSpYvM0.js";import"./use-members-1alkNMLr.js";import"./use-org-auth-client-HGMDWZ37.js";import"./use-clock-tick-9uLrrBUm.js";import"./use-automations-DAZgpS9S.js";import"./useSuspenseInfiniteQuery-DXLjl_Ue.js";import"./avatar-2NkvJFhn.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-BmXjtpVk.js";import"./dialog-Dq_peVG0.js";import"./monaco-editor-Cxpp-hMU.js";import"./index-luz2_Kqi.js";import"./calendar-Cd5zs7es.js";import"./shell-layout-OumtAwy1.js";import"./required-auth-layout-CIVjmrI-.js";import"./use-org-sso-elnfvOdJ.js";import"./integration-icon-D-DwNzR1.js";import"./use-navigate-to-agent-DWHbwpLC.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-BMJ7Mtx-.js";import"./form-Da6Pak5q.js";import"./input-Df5WqCIh.js";import"./drawer-BSvXGda-.js";import"./collection-search-vT5mWioA.js";import"./index-CIJ4b6SD.js";import"./get-initials-D-f_fDFw.js";import"./popover-BxXBf9EH.js";import"./dropdown-menu-BuPKJUY8.js";import"./github-repo-picker-BjY_cbDW.js";import"./use-debounced-value-BhoOs69E.js";import"./authenticate-and-persist-oauth-BjOG3bpy.js";import"./mcp-oauth-C159CTqw.js";import"./use-mcp-tools-BvTay4jb.js";import"./extract-connection-data-ZTR7xcCD.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-DWINBxtd.js";import"./use-tags-DhH7fJ9n.js";import"./command-Dq6iipS5.js";import"./index-k6yNjC6u.js";import"./companions-core-DBWG3_HY.js";import"./tabs-Dg2fovl2.js";import"./toggle-group-Bd_5HjJ1.js";import"./use-deco-credits-CWhdUeI9.js";import"./alert-dialog-CI_jOgZR.js";import"./toolbar-BQhumIzA.js";import"./skeleton-Bqf4wcUq.js";import"./agent-capabilities-cXfbMfjV.js";import"./connection-card-CK8a5ay6.js";import"./use-registry-connections-BJ4Y5FI-.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-B-mbIfJP.js";import"./connection-form-helpers-C2rTDrzA.js";import"./collection-tabs-Cm8oTUd7.js";import"./badge-BkDtGQCF.js";import"./connect-desktop-dialog-BUp1haXa.js";import"./select-model-C_5UqaCI.js";import"./checkbox-5E1V-xvi.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-BzmRZGKV.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-BkECfwLj.js";import"./deco-site-production-url-CaKZ7xBn.js";import"./use-capability-DbSBzq4m.js";import"./pt-BR-CLy76QW2.js";import"./use-mcp-auth-status-BggNWMN0.js";import"./use-debounced-autosave-CV9YJ4dj.js";import"./index-Bl2gwdpO.js";import"./search-input-C0Tu8jAx.js";import"./switch-DzR4USnH.js";import"./use-secrets-5yqKG0Fz.js";import"./useQueries-CHVnUdBY.js";import"./use-file-configs-giwXdJFa.js";import"./automation-list-row-xT8oiUOD.js";function bi(i){const e=he.c(121),{posts:X,categories:r,initialSlug:le,isPending:s,onApply:re,onClose:p}=i,o=je(),[m,fe]=de.useState(le&&r.some(a=>a.slug===le)?le:r[0]?.slug??""),[n,ge]=de.useState("add");let Y;if(e[0]!==r||e[1]!==m){let a;e[3]!==m?(a=be=>be.slug===m,e[3]=m,e[4]=a):a=e[4],Y=r.find(a),e[0]=r,e[1]=m,e[2]=Y}else Y=e[2];const c=Y,l=X.length,me=String(l);let d;e[5]!==o||e[6]!==me?(d=o("sandbox.bulkCategoryPanel.selectedCount",{count:me}),e[5]=o,e[6]=me,e[7]=d):d=e[7];let x;e[8]!==d?(x=t.jsx("span",{className:"truncate text-sm font-medium",children:d}),e[8]=d,e[9]=x):x=e[9];let u;e[10]!==o?(u=o("sandbox.bulkCategoryPanel.exitSelection"),e[10]=o,e[11]=u):u=e[11];let Z;e[12]===Symbol.for("react.memo_cache_sentinel")?(Z=t.jsx(ke,{size:14}),e[12]=Z):Z=e[12];let f;e[13]!==s||e[14]!==p||e[15]!==u?(f=t.jsx(Te,{asChild:!0,children:t.jsx(ne,{type:"button",variant:"ghost",size:"icon",disabled:s,onClick:p,"aria-label":u,children:Z})}),e[13]=s,e[14]=p,e[15]=u,e[16]=f):f=e[16];let g;e[17]!==o?(g=o("sandbox.bulkCategoryPanel.exitSelection"),e[17]=o,e[18]=g):g=e[18];let b;e[19]!==g?(b=t.jsx(we,{side:"bottom",children:g}),e[19]=g,e[20]=b):b=e[20];let h;e[21]!==f||e[22]!==b?(h=t.jsxs(Be,{children:[f,b]}),e[21]=f,e[22]=b,e[23]=h):h=e[23];let j;e[24]!==h||e[25]!==x?(j=t.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[x,h]}),e[24]=h,e[25]=x,e[26]=j):j=e[26];let y;e[27]!==o?(y=o("sandbox.bulkCategoryPanel.title"),e[27]=o,e[28]=y):y=e[28];let k;e[29]!==y?(k=t.jsx("h2",{className:"text-2xl font-bold text-foreground",children:y}),e[29]=y,e[30]=k):k=e[30];let N;e[31]!==l||e[32]!==o?(N=l===0?o("sandbox.bulkCategoryPanel.descriptionEmpty"):o("sandbox.bulkCategoryPanel.descriptionWithCount",{count:String(l)}),e[31]=l,e[32]=o,e[33]=N):N=e[33];let C;e[34]!==N?(C=t.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:N}),e[34]=N,e[35]=C):C=e[35];let P;e[36]!==o?(P=o("sandbox.bulkCategoryPanel.categoryLabel"),e[36]=o,e[37]=P):P=e[37];let S;e[38]!==P?(S=t.jsx(ce,{children:P}),e[38]=P,e[39]=S):S=e[39];let v;e[40]!==r||e[41]!==m||e[42]!==o?(v=r.length===0?t.jsx("p",{className:"text-sm text-muted-foreground",children:o("sandbox.bulkCategoryPanel.noCategoriesMessage")}):t.jsxs(Ce,{value:m,onValueChange:fe,children:[t.jsx(Pe,{className:"w-full",children:t.jsx(Se,{placeholder:o("sandbox.bulkCategoryPanel.selectCategoryPlaceholder")})}),t.jsx(ve,{children:r.map(ze)})]}),e[40]=r,e[41]=m,e[42]=o,e[43]=v):v=e[43];let _;e[44]!==S||e[45]!==v?(_=t.jsxs("div",{className:"space-y-2",children:[S,v]}),e[44]=S,e[45]=v,e[46]=_):_=e[46];let ee;e[47]===Symbol.for("react.memo_cache_sentinel")?(ee=a=>ge(a),e[47]=ee):ee=e[47];let te;e[48]===Symbol.for("react.memo_cache_sentinel")?(te=t.jsx(xe,{value:"add",id:"cat-mode-add",className:"mt-0.5"}),e[48]=te):te=e[48];let T;e[49]!==o?(T=o("sandbox.bulkCategoryPanel.modeAddTitle"),e[49]=o,e[50]=T):T=e[50];let w;e[51]!==T?(w=t.jsx("span",{className:"block text-sm font-medium",children:T}),e[51]=T,e[52]=w):w=e[52];let B;e[53]!==o?(B=o("sandbox.bulkCategoryPanel.modeAddDescription"),e[53]=o,e[54]=B):B=e[54];let R;e[55]!==B?(R=t.jsx("span",{className:"block text-xs text-muted-foreground",children:B}),e[55]=B,e[56]=R):R=e[56];let z;e[57]!==w||e[58]!==R?(z=t.jsxs(ce,{htmlFor:"cat-mode-add",className:"flex cursor-pointer items-start gap-2.5 rounded-lg border p-3",children:[te,t.jsxs("span",{className:"space-y-0.5",children:[w,R]})]}),e[57]=w,e[58]=R,e[59]=z):z=e[59];let oe;e[60]===Symbol.for("react.memo_cache_sentinel")?(oe=t.jsx(xe,{value:"replace",id:"cat-mode-replace",className:"mt-0.5"}),e[60]=oe):oe=e[60];let E;e[61]!==o?(E=o("sandbox.bulkCategoryPanel.modeReplaceTitle"),e[61]=o,e[62]=E):E=e[62];let L;e[63]!==E?(L=t.jsx("span",{className:"block text-sm font-medium",children:E}),e[63]=E,e[64]=L):L=e[64];let A;e[65]!==o?(A=o("sandbox.bulkCategoryPanel.modeReplaceDescription"),e[65]=o,e[66]=A):A=e[66];let F;e[67]!==A?(F=t.jsx("span",{className:"block text-xs text-muted-foreground",children:A}),e[67]=A,e[68]=F):F=e[68];let M;e[69]!==L||e[70]!==F?(M=t.jsxs(ce,{htmlFor:"cat-mode-replace",className:"flex cursor-pointer items-start gap-2.5 rounded-lg border p-3",children:[oe,t.jsxs("span",{className:"space-y-0.5",children:[L,F]})]}),e[69]=L,e[70]=F,e[71]=M):M=e[71];let V;e[72]!==n||e[73]!==z||e[74]!==M?(V=t.jsxs(Ne,{value:n,onValueChange:ee,className:"gap-2",children:[z,M]}),e[72]=n,e[73]=z,e[74]=M,e[75]=V):V=e[75];let $;e[76]!==o?($=o("sandbox.bulkCategoryPanel.cancelButton"),e[76]=o,e[77]=$):$=e[77];let D;e[78]!==s||e[79]!==p||e[80]!==$?(D=t.jsx(ne,{type:"button",variant:"outline",onClick:p,disabled:s,children:$}),e[78]=s,e[79]=p,e[80]=$,e[81]=D):D=e[81];const ae=!c||s||l===0;let G;e[82]!==n||e[83]!==re||e[84]!==c?(G=()=>c&&re(n,{name:c.name,slug:c.slug}),e[82]=n,e[83]=re,e[84]=c,e[85]=G):G=e[85];let I;e[86]!==s||e[87]!==o?(I=s?t.jsxs(t.Fragment,{children:[t.jsx(ye,{size:14,className:"animate-spin"}),o("sandbox.bulkCategoryPanel.updatingButton")]}):o("sandbox.bulkCategoryPanel.applyButton"),e[86]=s,e[87]=o,e[88]=I):I=e[88];let W;e[89]!==ae||e[90]!==G||e[91]!==I?(W=t.jsx(ne,{type:"button",disabled:ae,onClick:G,children:I}),e[89]=ae,e[90]=G,e[91]=I,e[92]=W):W=e[92];let q;e[93]!==D||e[94]!==W?(q=t.jsxs("div",{className:"flex justify-end gap-2",children:[D,W]}),e[93]=D,e[94]=W,e[95]=q):q=e[95];let H;e[96]!==_||e[97]!==V||e[98]!==q?(H=t.jsxs("div",{className:"mt-6 space-y-4",children:[_,V,q]}),e[96]=_,e[97]=V,e[98]=q,e[99]=H):H=e[99];let ie;e[100]===Symbol.for("react.memo_cache_sentinel")?(ie=t.jsx(ue,{size:16,className:"shrink-0 text-muted-foreground"}),e[100]=ie):ie=e[100];const pe=String(l);let J;e[101]!==o||e[102]!==pe?(J=o("sandbox.bulkCategoryPanel.selectedPostsLabel",{count:pe}),e[101]=o,e[102]=pe,e[103]=J):J=e[103];let K;e[104]!==J?(K=t.jsxs("div",{className:"flex items-center gap-2 px-4 py-3",children:[ie,t.jsx("span",{className:"text-sm",children:J})]}),e[104]=J,e[105]=K):K=e[105];let O;e[106]!==l||e[107]!==X||e[108]!==o?(O=l===0?t.jsx("p",{className:"border-t bg-background px-4 py-3 text-sm text-muted-foreground",children:o("sandbox.bulkCategoryPanel.noPostsSelectedMessage")}):t.jsx("ul",{className:"divide-y border-t bg-background",children:X.map(Re)}),e[106]=l,e[107]=X,e[108]=o,e[109]=O):O=e[109];let Q;e[110]!==K||e[111]!==O?(Q=t.jsxs("div",{className:"mt-8 overflow-hidden rounded-lg border bg-muted/30",children:[K,O]}),e[110]=K,e[111]=O,e[112]=Q):Q=e[112];let U;e[113]!==k||e[114]!==C||e[115]!==H||e[116]!==Q?(U=t.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:t.jsxs("div",{className:"mx-auto max-w-2xl px-8 py-8",children:[k,C,H,Q]})}),e[113]=k,e[114]=C,e[115]=H,e[116]=Q,e[117]=U):U=e[117];let se;return e[118]!==j||e[119]!==U?(se=t.jsxs("div",{className:"flex h-full flex-col",children:[j,U]}),e[118]=j,e[119]=U,e[120]=se):se=e[120],se}function Re(i){return t.jsxs("li",{className:"flex items-center gap-2.5 px-4 py-2.5",children:[t.jsx(ue,{size:14,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"min-w-0 flex-1",children:[t.jsx("span",{className:"block truncate text-sm",children:i.title}),i.slug&&t.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:i.slug})]})]},i.key)}function ze(i){return t.jsx(_e,{value:i.slug,children:t.jsx("span",{className:"truncate",children:i.name})},i.slug)}export{bi as BulkCategoryPanel};
@@ -1 +0,0 @@
1
- import{c as J,r as k,m as V,j as t,b as X,B as I,k as Y,t as $}from"./index-sd38S2ER.js";import{i as Z}from"./XCircle-CfbsFoSm.js";import{b1 as _,E as U}from"./agent-icon-aWRSFV3S.js";import{n as K}from"./LinkExternal01-BHxU7hA5.js";import{A as tt,a as ot,b as et,c as rt,d as it,e as st,f as at,g as nt}from"./alert-dialog-CI_jOgZR.js";import{I as W}from"./input-Df5WqCIh.js";import{L as H}from"./label-q5RWAz3v.js";import{P as mt,O as lt,Q as pt,ai as ct,I as dt,T as B,W as gt,aj as ut,U as xt}from"./index-fII9c_kY.js";import{c as ft,B as ht,a as yt}from"./block-document-5TIiP0i6.js";import{u as bt}from"./use-autosave-B5hezYu8.js";import{t as jt}from"./ChevronDown-BWHEr7M7.js";import{t as vt,v as Et,r as Nt}from"./automation-runs-BZROadaX.js";import{s as b,E as Ct}from"./primitives-hG3gzivQ.js";import"./AlertCircle-CSQCPj_V.js";import"./Tool01-DluxhvbR.js";import"./ArrowUp-B6IlW6Qi.js";import"./Settings02-DWHb-lRw.js";import"./Tool02-5oU4U7Oz.js";import"./ArrowUpRight-eD5g-cFd.js";import"./TrendUp01-DxZS9i5H.js";import"./ZapSquare-Dm2_KtgV.js";import"./Users03-DgykpOrm.js";import"./CheckCircle-DDuWLqUq.js";import"./Check-CWNssTV8.js";import"./ChevronRight-Bqyf0yi2.js";import"./ChevronUp-ROaBb_s7.js";import"./DotsVertical-C-UD1H-W.js";import"./Stars02-DLFxhacf.js";import"./Copy01-_e4tlhaR.js";import"./Eye-BZEDG_yV.js";import"./FilterLines-B2iuWHYg.js";import"./Star01-qAZqSHYs.js";import"./Palette-BStHvqZ6.js";import"./SwitchHorizontal01-SFOutJ0F.js";import"./HardDrive-1qI5HKiO.js";import"./Key01-AWbv_wld.js";import"./LayoutLeft-CGP9_srE.js";import"./LogOut01-BHFIF5pV.js";import"./Monitor01-kMl_aKHS.js";import"./Sun-Bmj9T9Hs.js";import"./Play-CgnGl0Ls.js";import"./Plus-CSNWQMMp.js";import"./SearchLg-LtdaD4ZG.js";import"./SearchMd-BEvxAPyw.js";import"./Shield01-T-UpndO1.js";import"./Stars01-CO4iRFT5.js";import"./Trash01-BecpyKSB.js";import"./Upload01-D6mhS0Il.js";import"./User01-CAYZjCBh.js";import"./Users01-CJn3nv4f.js";import"./XClose-BFk0sz9G.js";import"./X-CalOG8rP.js";import"./Zap-BNdcgXgA.js";import"./chat-context-DoK0lfG3.js";import"./tab-id-D67TyC-3.js";import"./hooks-CiBCHAEU.js";import"./use-mcp-client-Cav0AiKw.js";import"./auth-ByPgJhb1.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-C1RJsJS0.js";import"./studio-tools-C9O5T6hk.js";import"./use-virtual-mcp-DzUwFLTQ.js";import"./use-ai-providers-Dsmt_TQY.js";import"./use-decopilot-events-Hca5p5mu.js";import"./use-organization-settings-C8aPcOm4.js";import"./tooltip-Bjx5IK0l.js";import"./dialog-Dq_peVG0.js";import"./drawer-BSvXGda-.js";import"./collection-search-vT5mWioA.js";import"./use-mobile-DxvpAkbd.js";import"./AreaChart-BMJ7Mtx-.js";import"./index-luz2_Kqi.js";import"./calendar-Cd5zs7es.js";import"./shell-layout-OumtAwy1.js";import"./avatar-2NkvJFhn.js";import"./required-auth-layout-CIVjmrI-.js";import"./use-org-sso-elnfvOdJ.js";import"./index-CIJ4b6SD.js";import"./get-initials-D-f_fDFw.js";import"./popover-BxXBf9EH.js";import"./dropdown-menu-BuPKJUY8.js";import"./github-repo-picker-BjY_cbDW.js";import"./use-debounced-value-BhoOs69E.js";import"./use-connection-DtVPu3zH.js";import"./authenticate-and-persist-oauth-BjOG3bpy.js";import"./mcp-oauth-C159CTqw.js";import"./use-mcp-tools-BvTay4jb.js";import"./extract-connection-data-ZTR7xcCD.js";import"./metadata-dUsYcpuu.js";import"./use-navigate-to-agent-DWHbwpLC.js";import"./reusable-new-chat-CouMjkYR.js";import"./provision-repo-scoped-github-connection-DWINBxtd.js";import"./use-members-1alkNMLr.js";import"./use-org-auth-client-HGMDWZ37.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-tags-DhH7fJ9n.js";import"./use-copy-BmXjtpVk.js";import"./command-Dq6iipS5.js";import"./index-k6yNjC6u.js";import"./companions-core-DBWG3_HY.js";import"./form-Da6Pak5q.js";import"./select-BaiNHGHX.js";import"./tabs-Dg2fovl2.js";import"./toggle-group-Bd_5HjJ1.js";import"./use-deco-credits-CWhdUeI9.js";import"./sidebar-DTxjIJ56.js";import"./toolbar-BQhumIzA.js";import"./skeleton-Bqf4wcUq.js";import"./agent-capabilities-cXfbMfjV.js";import"./connection-card-CK8a5ay6.js";import"./use-registry-connections-BJ4Y5FI-.js";import"./useInfiniteQuery-cI69eqxa.js";import"./use-infinite-scroll-BOm4DukJ.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./card-yJEtZ44f.js";import"./integration-icon-D-DwNzR1.js";import"./textarea-B-mbIfJP.js";import"./connection-form-helpers-C2rTDrzA.js";import"./collection-tabs-Cm8oTUd7.js";import"./badge-BkDtGQCF.js";import"./useSuspenseInfiniteQuery-DXLjl_Ue.js";import"./connect-desktop-dialog-BUp1haXa.js";import"./select-model-C_5UqaCI.js";import"./checkbox-5E1V-xvi.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-BzmRZGKV.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-BkECfwLj.js";import"./empty-state-BZSpYvM0.js";import"./deco-site-production-url-CaKZ7xBn.js";import"./use-capability-DbSBzq4m.js";import"./monaco-editor-Cxpp-hMU.js";import"./pt-BR-CLy76QW2.js";import"./use-mcp-auth-status-BggNWMN0.js";import"./use-debounced-autosave-CV9YJ4dj.js";import"./index-Bl2gwdpO.js";import"./search-input-C0Tu8jAx.js";import"./switch-DzR4USnH.js";import"./use-secrets-5yqKG0Fz.js";import"./useQueries-CHVnUdBY.js";import"./use-file-configs-giwXdJFa.js";import"./use-automations-DAZgpS9S.js";import"./automation-list-row-xT8oiUOD.js";import"./table-CW9azojk.js";import"./use-clock-tick-9uLrrBUm.js";function St(j){const o=J.c(18),{icon:x,title:m,defaultOpen:v,children:u}=j,w=v===void 0?!1:v,[f,P]=k.useState(w);let l;o[0]!==x?(l=t.jsx(x,{size:15}),o[0]=x,o[1]=l):l=o[1];let r;o[2]!==m?(r=t.jsx("span",{className:"flex-1 text-left",children:m}),o[2]=m,o[3]=r):r=o[3];const a=f&&"rotate-180";let p;o[4]!==a?(p=V("transition-transform",a),o[4]=a,o[5]=p):p=o[5];let i;o[6]!==p?(i=t.jsx(jt,{size:15,className:p}),o[6]=p,o[7]=i):i=o[7];let c;o[8]!==l||o[9]!==r||o[10]!==i?(c=t.jsx(vt,{asChild:!0,children:t.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground cursor-pointer",children:[l,r,i]})}),o[8]=l,o[9]=r,o[10]=i,o[11]=c):c=o[11];let d;o[12]!==u?(d=t.jsx(Et,{className:"px-2 pt-4",children:u}),o[12]=u,o[13]=d):d=o[13];let n;return o[14]!==f||o[15]!==c||o[16]!==d?(n=t.jsxs(Nt,{open:f,onOpenChange:P,className:"mt-4",children:[c,d]}),o[14]=f,o[15]=c,o[16]=d,o[17]=n):n=o[17],n}function gr({orgSlug:j,virtualMcpId:o,branch:x,blockKey:m,block:v,decofile:u,meta:w,onManagePosts:f,onOpenPost:P,previewBaseUrl:l}){const r=X(),a=mt({orgSlug:j,virtualMcpId:o,branch:x,packagePath:lt(o)}),p=pt(v,"categories"),[i,c,d]=bt(p,e=>{a.mutate({blockKey:m,data:B(m,"categories",e)})}),n=(e,S)=>c({...i,[e]:S}),A=ft({decofile:u,category:i,previewBaseUrl:l}),s=b(i.slug),[D,y]=k.useState(s),[g,E]=k.useState(null),[N,T]=k.useState(!1),z=s?ct(u).filter(e=>e.categorySlugs.includes(s)):[],C=z.length,M=e=>n("slug",e),Q=async(e,S)=>{const G=b(i.name);T(!0);try{let h=0;for(const{key:O,payload:R}of gt(u,"posts")){const L=ut(R,e,{name:G,slug:S});L!==R&&(await a.mutateAsync({blockKey:O,data:B(O,"posts",xt(L))}),h+=1)}const F={...i,slug:S};await a.mutateAsync({blockKey:m,data:B(m,"categories",F)}),d(F),$.success(h>0?r("sandbox.categoryEditor.renameSuccessWithPosts",{count:String(h)}):r("sandbox.categoryEditor.renameSuccessNoPosts")),E(null)}catch(h){y(e),E(null),$.error(h instanceof Error?h.message:r("sandbox.categoryEditor.renameFailed"))}finally{T(!1)}},q=()=>{const e=D.trim();if(e===s){D!==e&&y(e);return}if(!e){y(s);return}if(C===0){M(e);return}E({oldSlug:s,newSlug:e,count:C})};return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex h-full flex-col",children:[t.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[t.jsx("span",{className:"truncate text-sm font-medium",children:b(i.name)||r("sandbox.categoryEditor.untitledCategory")}),t.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[t.jsx(dt,{isPending:a.isPending,isError:a.isError}),A&&t.jsxs(I,{type:"button",variant:"outline",size:"sm",title:r("sandbox.categoryEditor.previewTooltip"),onClick:()=>window.open(A,"_blank","noopener,noreferrer"),children:[t.jsx(K,{size:14}),r("sandbox.categoryEditor.seeCategoryPreview")]})]})]}),t.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:t.jsxs("div",{className:"mx-auto max-w-4xl px-8 py-8",children:[t.jsx(Ct,{value:b(i.name),onChange:e=>n("name",e),placeholder:r("sandbox.categoryEditor.categoryNamePlaceholder"),className:"py-1 text-3xl font-bold text-foreground"}),t.jsxs("div",{className:"mt-4 space-y-2",children:[t.jsx(H,{htmlFor:"category-slug",children:r("sandbox.categoryEditor.slugLabel")}),t.jsx(W,{id:"category-slug",value:D,onChange:e=>y(e.target.value),onBlur:q,placeholder:r("sandbox.categoryEditor.slugPlaceholder"),className:"h-10"})]}),t.jsxs("div",{className:"mt-4 space-y-2",children:[t.jsx(H,{htmlFor:"category-description",children:r("sandbox.categoryEditor.descriptionLabel")}),t.jsx(W,{id:"category-description",value:b(i.description),onChange:e=>n("description",e.target.value),placeholder:r("sandbox.categoryEditor.descriptionPlaceholder"),className:"h-10"})]}),t.jsx(St,{icon:_,title:r("sandbox.categoryEditor.contentTitle"),defaultOpen:!0,children:t.jsx(ht,{value:yt(i.sections),onChange:e=>n("sections",e),meta:w,sandboxRef:{orgSlug:j,virtualMcpId:o,branch:x},emptyMessage:r("sandbox.categoryEditor.noContentEmpty")})}),t.jsxs("div",{className:"mt-6 overflow-hidden rounded-lg border bg-muted/30",children:[t.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3",children:[t.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[t.jsx(U,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:r("sandbox.categoryEditor.postsInCategory",{count:String(C)})})]}),t.jsxs(I,{type:"button",variant:"outline",size:"sm",disabled:!s,title:r(s?"sandbox.categoryEditor.pickPostsTooltip":"sandbox.categoryEditor.setSlugTooltip"),onClick:()=>f(s),children:[r("sandbox.categoryEditor.addPostsButton"),t.jsx(Z,{size:14})]})]}),C>0&&t.jsx("ul",{className:"divide-y border-t bg-background",children:z.map(e=>t.jsx("li",{children:t.jsxs("button",{type:"button",onClick:()=>P(e.key),className:"flex w-full items-center gap-2.5 px-4 py-2.5 text-left transition-colors hover:bg-muted cursor-pointer",children:[t.jsx(U,{size:14,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"min-w-0 flex-1",children:[t.jsx("span",{className:"block truncate text-sm",children:e.title||r("sandbox.categoryEditor.untitledPost")}),e.slug&&t.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:e.slug})]})]})},e.key))})]})]})})]}),t.jsx(tt,{open:!!g,onOpenChange:e=>{e||N||(y(s),E(null))},children:t.jsxs(ot,{children:[t.jsxs(et,{children:[t.jsx(rt,{children:r("sandbox.categoryEditor.renameDialogTitle")}),t.jsx(it,{children:g?r("sandbox.categoryEditor.renameDialogDescription",{oldSlug:g.oldSlug,newSlug:g.newSlug,count:String(g.count)}):null})]}),t.jsxs(st,{children:[t.jsx(at,{disabled:N,children:r("sandbox.categoryEditor.cancelButton")}),t.jsx(nt,{onClick:e=>{e.preventDefault(),g&&Q(g.oldSlug,g.newSlug)},disabled:N,children:N?t.jsxs(t.Fragment,{children:[t.jsx(Y,{size:14,className:"animate-spin"}),r("sandbox.categoryEditor.renamingLabel")]}):r("sandbox.categoryEditor.renameActionButton")})]})]})})]})}export{gr as CategoryEditor};
@@ -1,36 +0,0 @@
1
- import{X as x,a2 as M,Y as i,a5 as ke,a3 as de,a4 as Se,aI as Ie,cp as xt,bb as Ue,b0 as it,c as Z,m as kt,bu as It,j as X,F as Y,K as se,n as rt,J as lt,u as Ne,o as Fe,t as ce,I as fe,G as be,d as ct,f as wt,r as S,e as Ct,b as $e,p as Mt,a as Tt,v as Pt,a9 as At}from"./index-sd38S2ER.js";import{d as _t,q as Rt,A as dt,s as Et,t as $t,n as Dt,w as Ot}from"./tab-id-D67TyC-3.js";import{S as Ut,u as Lt,e as Nt,b as Ft}from"./hooks-CiBCHAEU.js";import{u as ut,c as jt}from"./studio-tools-C9O5T6hk.js";import{a as qt,u as Kt,S as Vt}from"./use-mcp-client-Cav0AiKw.js";import{u as Qt}from"./use-virtual-mcp-DzUwFLTQ.js";import{p as Bt,u as Ht,b as ye,i as Wt,c as zt}from"./use-ai-providers-Dsmt_TQY.js";import{u as Gt}from"./use-decopilot-events-Hca5p5mu.js";import{b as Xt}from"./use-organization-settings-C8aPcOm4.js";const ve=x({connection_id:i().describe("Connection ID"),selected_tools:M(i()).nullable().describe("Selected tool names. null = all tools included, array = only these tools included"),selected_resources:M(i()).nullable().describe("Selected resource URIs or patterns. Supports * and ** wildcards for pattern matching. null = all resources included, array = only these resources included"),selected_prompts:M(i()).nullable().describe("Selected prompt names. null = all prompts included, array = only these prompts included")}),pt=ve.extend({selected_tools:ve.shape.selected_tools.optional(),selected_resources:ve.shape.selected_resources.optional(),selected_prompts:ve.shape.selected_prompts.optional()}),Zt=x({connectionId:i(),toolName:i(),label:i(),icon:i().nullable().optional()}),Yt=x({id:i().describe("Stable id; used as React key and ?tab= value"),title:i().describe("Tab label"),icon:i().optional().describe("Optional lucide icon name"),view:x({type:Ue("ext-app"),appId:i(),args:Se(i(),it()).optional()})}),Jt=x({defaultMainView:x({type:i(),id:i().optional(),toolName:i().optional()}).nullable().optional(),chatDefaultOpen:ke().nullable().optional(),cmsDefaultOpen:ke().nullable().optional(),tabs:M(Yt).optional()}),Ye=x({tileId:i().optional(),connectionId:i().optional().describe("Connection that owns the resource — the host opens a direct MCP client to this connection so the iframe can call tools by their bare names."),resourceUri:i().describe("ui:// resource URI exposed by `connectionId`. Read on the home page and rendered via MCPAppRenderer."),toolName:i().optional().describe("Tool name — identifies which tool's inputSchema to display when editing tile props."),toolInput:Se(i(),it()).optional().describe("User-configured input props passed to MCPAppRenderer when rendering the tile."),minHeight:Ie().int().positive().optional(),maxHeight:Ie().int().positive().optional()}),je=x({banner:i().nullable().optional(),bannerColor:i().nullable().optional(),icon:i().nullable().optional(),themeColor:i().nullable().optional(),pinnedViews:M(Zt).nullable().optional(),layout:Jt.nullable().optional(),homeTile:Ye.nullable().optional(),homeTiles:M(Ye).nullable().optional(),homePrompts:M(i()).nullable().optional()});function as(t){const e=t?.homeTiles;if(Array.isArray(e)&&e.length>0)return e;const s=t?.homeTile;return s?[s]:[]}const en=/^[A-Za-z_][A-Za-z0-9_]*$/,Je=i().min(1).regex(en,{message:"Env var key must start with a letter or underscore and contain only letters, digits, and underscores."}),tn=xt("kind",[x({key:Je,kind:Ue("literal"),value:i()}),x({key:Je,kind:Ue("secret"),secretId:i().min(1)})]),nn=/^[a-zA-Z0-9.-]+(?::[0-9]+)?$/,sn=x({host:i().min(1).regex(nn).describe("Submodule host, e.g. 'github.com' (bare hostname, no scheme)."),secretId:i().min(1).describe("Vault secret id holding the PAT used to fetch this host.")}),qe=x({selected:i().nullable().optional().describe("User-selected package manager (npm | pnpm | yarn | bun | deno). Null/absent means autodetect on next SANDBOX_START."),port:i().nullable().optional().describe("User-selected dev server port as a string (allows '' / null for unset). Null/absent means autodetect."),path:i().nullable().optional().describe("Optional path (relative to repo root) to the directory containing package.json. Null/absent means repo root. Forwarded as `application.packageManager.path` to the daemon config."),env:M(tn).nullable().optional().describe("Env vars injected on every SANDBOX_START. Literal entries inline their value; secret entries store a secretId that Studio resolves via the credential vault before posting /_sandbox/config."),submoduleCredentials:M(sn).nullable().optional().describe("Git submodule credentials injected on every SANDBOX_START. Each entry maps a host to a vault secret (PAT) that Studio resolves before posting /_sandbox/config; the daemon uses it to authenticate `git submodule update` for submodules on that host.")}),Ke=x({url:i().describe("GitHub repository URL"),owner:i().describe("Repository owner"),name:i().describe("Repository name"),installationId:Ie().optional().describe("GitHub App installation ID. Absent when the repo was linked without a GitHub connection (public-clone mode)."),connectionId:i().optional().describe("ID of the mcp-github connection used for authentication. Absent for public repos cloned without credentials.")}),an=de(["agent-sandbox","user-desktop"]),on=de(["agent-sandbox","user-desktop","cluster"]);function Ve(t){return t==="cluster"?"agent-sandbox":t}const ht={sandboxHandle:i().describe("Provider-specific handle"),previewUrl:i().nullable().describe("URL where the sandbox's iframe-proxied UI is served, or null when the sandbox has no dev server (blank / tool sandboxes)."),sandboxApiUrl:i().nullable().optional().describe("Daemon's public URL — what cluster→daemon RPCs target. Equal to previewUrl for user-desktop; null/absent for the agent-sandbox provider (routes through hosted ingress)."),sandboxProviderKind:an.optional(),createdAt:Ie().optional().describe("Epoch ms the entry was first written by SANDBOX_START. Used by the booting overlay to show a stable elapsed timer that survives browser reloads. Optional for backward compatibility with entries written before this field existed."),startedWith:x({packageManager:i().nullable().optional().describe("metadata.runtime.selected at the time of SANDBOX_START"),port:i().nullable().optional().describe("metadata.runtime.port at the time of SANDBOX_START"),path:i().nullable().optional().describe("metadata.runtime.path at the time of SANDBOX_START")}).optional().describe("Snapshot of metadata.runtime fields (selected/port/path) used at SANDBOX_START. The Preview tab compares the live metadata.runtime against this to decide if a restart is required to apply changes.")},mt=x(ht),rn=x({...ht,sandboxProviderKind:on.optional()});function ln(t){const e=rn.parse(t);return mt.parse({...e,sandboxProviderKind:e.sandboxProviderKind?Ve(e.sandboxProviderKind):void 0})}function os(t){if(!t||typeof t!="object"||Array.isArray(t))return{};const e=t,s={};for(const[n,a]of Object.entries(e)){if(!a||typeof a!="object"||n!=="cluster"&&n!=="agent-sandbox"&&n!=="user-desktop")continue;const o=Ve(n);try{if(n==="cluster"&&s[o])continue;s[o]=ln(a)}catch{}}return s}const Qe=Se(i().describe("userId"),Se(i().describe("branch"),Se(i().describe("sandboxProviderKind"),mt))),cn=x({id:i().describe("Stable identifier for this knowledge file"),name:i().describe("File name shown in the UI"),kind:de(["file","skill"]).optional().describe("'file' (a single document) or 'skill' (a Claude Code skill folder containing SKILL.md). Defaults to 'file'."),volume:i().describe("Org filesystem (Library) volume the file lives in"),path:i().describe("Path within the volume"),url:i().describe("Same-origin URL to read the file (display/download)"),contentType:i().nullable().optional().describe("MIME type, used to decide whether to inline the content"),size:Ie().nullable().optional().describe("File size in bytes"),addedAt:i().describe("ISO timestamp when the file was attached")}),Be=M(cn).nullable().optional().describe("Files attached to the agent as reference knowledge. Surfaced in the system prompt: small text documents are inlined, others are listed as retrievable references."),dn=de(["smart","code-review","open"]),He=dn.nullable().optional().describe("Controls when this code agent's changes may be published directly vs. requiring PR review. 'smart' (default) uses AI to judge per change; 'code-review' requires review for any code; 'open' allows direct publish always."),is=x({id:i().describe("Unique identifier"),title:i().describe("Human-readable name"),description:i().nullable().describe("Description"),icon:i().nullable().describe("Icon URL"),created_at:i().describe("Creation timestamp"),updated_at:i().describe("Last update timestamp"),created_by:i().describe("User ID who created this item"),updated_by:i().optional().describe("User ID who last updated this item"),organization_id:i().describe("Organization ID this item belongs to"),status:de(["active","inactive"]).describe("Current status"),pinned:ke().describe("Whether this space is pinned to the sidebar"),metadata:x({instructions:i().nullable().describe("Instructions also used as system prompt"),enabled_plugins:M(i()).nullable().optional().describe("List of enabled plugin IDs"),subAgents:M(i()).nullable().optional().describe("Allowlist of Virtual MCP (agent) or concrete MCP connection IDs this agent may delegate to via subtask. Concrete connections create ephemeral subagents. null/absent = all active org targets; empty array = itself only."),liveAgentId:i().nullable().optional().describe("ID of the live agent this (dev) agent develops. Set only on dev agents; powers the Develop/Live toggle. A dev agent is hidden from the sidebar (reached via the toggle on its live counterpart)."),ui:je.nullable().optional().describe("UI customization settings"),githubRepo:Ke.nullable().optional().describe("Linked GitHub repository"),runtime:qe.nullable().optional().describe("User-pinned runtime config (package manager, dev port). Empty fields = autodetect."),sandboxMap:Qe.optional().describe("Per-user, per-branch sandbox mapping: sandboxMap[userId][branch] -> { sandboxHandle, previewUrl }"),knowledge:Be,siteSlug:i().nullable().optional().describe("Linked asset site slug (managed storage tenancy)"),publishPolicy:He,productionUrl:i().nullable().optional().describe("Live production URL of the linked site (e.g. https://acme.com). Painted in the preview iframe while the sandbox dev server is waking.")}).loose().describe("Metadata"),connections:M(ve).describe("Connections with their selected tools, resources, and prompts")}),ft=x({title:i().min(1).max(120).describe("Short label shown on the chip"),description:i().max(280).optional().describe("One-line subtitle shown under the title"),text:i().min(1).describe("The message sent to the agent when the prompt is clicked")});x({title:i().min(1).max(255).describe("Name for the virtual MCP"),description:i().nullable().optional().describe("Optional description"),icon:i().nullish().describe("Optional icon URL"),status:de(["active","inactive"]).optional().default("active").describe("Initial status"),pinned:ke().optional().default(!1).describe("Pin to sidebar"),metadata:x({instructions:i().nullable().optional().describe("MCP server instructions"),enabled_plugins:M(i()).nullable().optional().describe("List of enabled plugin IDs"),subAgents:M(i()).nullable().optional().describe("Allowlist of Virtual MCP (agent) or concrete MCP connection IDs this agent may delegate to via subtask. Concrete connections create ephemeral subagents. null/absent = all active org targets; empty array = itself only."),liveAgentId:i().nullable().optional().describe("ID of the live agent this (dev) agent develops. Set only on dev agents; powers the Develop/Live toggle. A dev agent is hidden from the sidebar (reached via the toggle on its live counterpart)."),ui:je.nullable().optional().describe("UI customization settings"),githubRepo:Ke.nullable().optional().describe("Linked GitHub repository"),runtime:qe.nullable().optional().describe("User-pinned runtime config (package manager, dev port). Empty fields = autodetect."),sandboxMap:Qe.optional().describe("Per-user, per-branch sandbox mapping: sandboxMap[userId][branch] -> { sandboxHandle, previewUrl }"),knowledge:Be,siteSlug:i().nullable().optional().describe("Linked asset site slug (managed storage tenancy)"),publishPolicy:He,productionUrl:i().nullable().optional().describe("Live production URL of the linked site (e.g. https://acme.com). Painted in the preview iframe while the sandbox dev server is waking.")}).loose().nullable().optional().describe("Additional metadata including MCP server instructions"),connections:M(pt).describe("Connections to include/exclude (can be empty for exclusion mode)"),prompts:M(ft).optional().describe("Optional kickstart prompts to seed on the agent. Each becomes a clickable conversation starter (icebreaker) on the agent. Author them from the agent's role and the tools it will have so they're coherent and immediately useful.")});x({title:i().min(1).max(255).optional().describe("New name"),description:i().nullable().optional().describe("New description (null to clear)"),icon:i().nullish().describe("New icon URL"),status:de(["active","inactive"]).optional().describe("New status"),pinned:ke().optional().describe("Pin/unpin from sidebar"),metadata:x({instructions:i().nullable().optional().describe("MCP server instructions"),enabled_plugins:M(i()).nullable().optional().describe("List of enabled plugin IDs"),subAgents:M(i()).nullable().optional().describe("Allowlist of Virtual MCP (agent) or concrete MCP connection IDs this agent may delegate to via subtask. Concrete connections create ephemeral subagents. null/absent = all active org targets; empty array = itself only."),liveAgentId:i().nullable().optional().describe("ID of the live agent this (dev) agent develops. Set only on dev agents; powers the Develop/Live toggle. A dev agent is hidden from the sidebar (reached via the toggle on its live counterpart)."),ui:je.nullable().optional().describe("UI customization settings"),githubRepo:Ke.nullable().optional().describe("Linked GitHub repository"),runtime:qe.nullable().optional().describe("User-pinned runtime config (package manager, dev port). Empty fields = autodetect."),sandboxMap:Qe.optional().describe("Per-user, per-branch sandbox mapping: sandboxMap[userId][branch] -> { sandboxHandle, previewUrl }"),knowledge:Be,siteSlug:i().nullable().optional().describe("Linked asset site slug (managed storage tenancy)"),publishPolicy:He,productionUrl:i().nullable().optional().describe("Live production URL of the linked site (e.g. https://acme.com). Painted in the preview iframe while the sandbox dev server is waking.")}).loose().nullable().optional().describe("Additional metadata including MCP server instructions"),connections:M(pt).optional().describe("New connections (replaces existing)"),prompts:M(ft).optional().describe("Replace the agent's kickstart prompts with this full set. Omit to leave them unchanged; pass an empty array to remove all. Each becomes a clickable conversation starter (icebreaker).")});const un=It("animate-spin",{variants:{variant:{default:"fill-primary text-gray-200",destructive:"fill-destructive text-gray-200",secondary:"fill-secondary text-gray-200",success:"fill-success text-gray-200",special:"fill-special text-background"},size:{default:"h-7 w-7",sm:"h-6 w-6",lg:"h-8 w-8",icon:"h-6 w-6",xs:"h-4 w-4"}},defaultVariants:{variant:"default",size:"default"}});function rs(t){const e=Z.c(10),{variant:s,size:n}=t;let a;e[0]!==n||e[1]!==s?(a=kt(un({variant:s,size:n})),e[0]=n,e[1]=s,e[2]=a):a=e[2];let o,r;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=X.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),r=X.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"}),e[3]=o,e[4]=r):(o=e[3],r=e[4]);let l;e[5]!==a?(l=X.jsxs("svg",{"aria-hidden":"true",className:a,viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[o,r]}),e[5]=a,e[6]=l):l=e[6];let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p=X.jsx("span",{className:"sr-only",children:"Loading..."}),e[7]=p):p=e[7];let u;return e[8]!==l?(u=X.jsxs("div",{role:"status",children:[l,p]}),e[8]=l,e[9]=u):u=e[9],u}const et={online:!1,capabilities:[],ready:!1};function pn(t){const e=Z.c(9),{org:s}=Y(),n=ut(),a=t?.fast??!1;let o;e[0]!==s.id?(o=se.currentLink(s.id),e[0]=s.id,e[1]=o):o=e[1];let r;e[2]!==n?(r=async()=>{const v=await n.call("LINK_CURRENT_GET",{});return v?{...v,ready:!0}:{...et,ready:!0}},e[2]=n,e[3]=r):r=e[3];const l=a?1e3:1e4,p=a?2e3:15e3;let u;e[4]!==o||e[5]!==r||e[6]!==l||e[7]!==p?(u={queryKey:o,queryFn:r,staleTime:l,refetchInterval:p,refetchOnWindowFocus:!0},e[4]=o,e[5]=r,e[6]=l,e[7]=p,e[8]=u):u=e[8];const{data:m}=rt(u);return m??et}function hn(t,e=[]){return t==="stop"?e.filter(a=>a.type==="text"&&a.text).map(a=>a.text).join(`
2
- `).replace(/https?:\/\/[^\s)>\]]+/g,"").includes("?")?"requires_action":"completed":t==="tool-calls"?e.some(n=>n.type==="tool-user_ask"&&n.state==="input-available"||n.state==="approval-requested")?"requires_action":"completed":"failed"}const Re={decopilot:{harness:"decopilot",sandbox:"agent-sandbox"},"claude-code-desktop":{harness:"claude-code",sandbox:"user-desktop"},"codex-desktop":{harness:"codex",sandbox:"user-desktop"}};function mn(t,e){if(!t)return null;const s=e?Ve(e):null;if(t==="decopilot"&&s===null)return"decopilot";for(const[n,a]of Object.entries(Re))if(a.harness===t&&a.sandbox===s)return n;return null}function ls(t){return t.claudeCode?"claude-code-desktop":t.codex?"codex-desktop":null}function fn(t,e){return e&&t&&Re[t].sandbox==="user-desktop"?"decopilot":t}function bn(t){return t.thread?.harness_id!=null?{}:{harnessId:t.globals.harnessId,sandboxProviderKind:t.globals.sandboxProviderKind,branch:t.globals.branch??null}}function gn(t){const e=t?t.split("/").filter(Boolean):[],s=e[0]==="public",n=s?e[1]??null:null,a=s?n?`public-${n}`:null:e[0]??null,o=(s?e.slice(2):e.slice(1)).join("/");return{segments:e,volume:a,dirPath:o,isPublic:s,publicSet:n,readOnly:s}}function cs(t,e){return t.isPublic&&t.publicSet?`public/${t.publicSet}/${e}`:t.volume?`${t.volume}/${e}`:e}const tt="public-";function bt(t){return t.startsWith(tt)?t.slice(tt.length):null}function ds(t,e){const s=bt(t);return s?`public/${s}/${e}`:`${t}/${e}`}function yn(t){const e=t.lastIndexOf("/");return e===-1?t:t.slice(e+1)}function vn(t){const{volume:e,dirPath:s}=gn(t);if(!e)return null;let n;if(e==="home")n="org/home";else if(e==="outputs")n="org/.outputs";else if(e==="uploads")n="org/.uploads";else{const a=bt(e);n=a?`org/public/${a}`:`org/${e}`}return s?`${n}/${s}`:n}function Sn(t){const e=Z.c(21);let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId",shouldThrow:!1},e[0]=s):s=e[0];const n=lt(s);let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},e[1]=a):a=e[1];const o=Ne(a);let r;e[2]!==o.brand||e[3]!==o.main||e[4]!==o.preview||e[5]!==o.skill?(r=(typeof o.main=="string"?_t(o.main)?.path:void 0)??o.preview??o.skill??o.brand??null,e[2]=o.brand,e[3]=o.main,e[4]=o.preview,e[5]=o.skill,e[6]=r):r=e[6];const l=r;let p;if(e[7]!==n?.params.appSlug||e[8]!==n?.params.collectionName||e[9]!==n?.params.itemId||e[10]!==l||e[11]!==t){if(p=[],t&&p.push(`### Selected Agent
3
- - ID: ${t}`),l){let m;e[13]!==l?(m=vn(l),e[13]=l,e[14]=m):m=e[14];const v=m;let w;e[15]!==l?(w=yn(l),e[15]=l,e[16]=w):w=e[16],p.push(`### Currently Open File
4
- The user has this file open in the Library and is most likely referring to it:
5
- - Name: ${w}
6
- - Library path: ${l}${v?`
7
- - Read/edit it with your file tools at: \`${v}\``:""}
8
-
9
- When a request is ambiguous about which file or resource it targets (e.g. "change the h1", "fix this", "what's in this file", "update the title"), assume it means this file unless the user clearly indicates otherwise.`)}let u;e[17]!==n?.params.appSlug||e[18]!==n?.params.collectionName||e[19]!==n?.params.itemId?(u=[],n?.params.appSlug&&u.push(`- Connection ID: ${n?.params.appSlug}`),n?.params.collectionName&&u.push(`- Collection: ${n?.params.collectionName}`),n?.params.itemId&&u.push(`- Item ID: ${n?.params.itemId}`),e[17]=n?.params.appSlug,e[18]=n?.params.collectionName,e[19]=n?.params.itemId,e[20]=u):u=e[20],u.length>0&&p.push(`### Current Resource
10
- The user is viewing the following resource:
11
- ${u.join(`
12
- `)}
13
-
14
- Help the user understand and work with this resource.`),e[7]=n?.params.appSlug,e[8]=n?.params.collectionName,e[9]=n?.params.itemId,e[10]=l,e[11]=t,e[12]=p}else p=e[12];return p.join(`
15
-
16
- `)}function xn(){const t=Z.c(5),e=Fe(),{org:s}=Y();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId",shouldThrow:!1},t[0]=n):n=t[0];const a=lt(n);let o;return t[1]!==a?.params||t[2]!==s||t[3]!==e?(o=r=>{const p=r.toolCall.toolName.match(/^COLLECTION_([A-Z_]+)_(CREATE|UPDATE|DELETE)$/);if(!p||!p[1])return;const u=p[1],m=a?.params.appSlug;if(!m)return;e.invalidateQueries({queryKey:se.collection(s.slug,m,u)});const v=u.toLowerCase().replace(/_/g," ");ce.success(`${v} updated`)},t[1]=a?.params,t[2]=s,t[3]=e,t[4]=o):o=t[4],o}function kn(){const t=Z.c(4),{org:e,project:s}=Y(),n=`${e.id}/${s.id}`;let a;t[0]!==n?(a=be.taskLastViewed(n),t[0]=n,t[1]=a):a=t[1];const[,o]=fe(a,In);let r;return t[2]!==o?(r={markTaskRead:p=>{o(u=>({...u,[p]:new Date().toISOString()}))}},t[2]=o,t[3]=r):r=t[3],r}function In(t){return t??{}}function gt(){const t=ct(),{org:e}=Y(),s=Ne({strict:!1}),n=wt({strict:!1}),a=s.virtualmcpid??qt(e.id).id,o=(p,u)=>{t({to:"/$org/$taskId",params:{org:e.slug,taskId:p},search:m=>{const v={},w=u?.virtualMcpId??m.virtualmcpid;w&&(v.virtualmcpid=w);const f=m.main;return f&&typeof f=="string"&&!Rt(f)&&(v.main=f),(m.sidepanel==="chat"||m.sidepanel===0)&&(v.sidepanel=m.sidepanel),u?.autosend&&(v.autosend=dt),v}})},r=S.useRef(crypto.randomUUID()),l=n.taskId??r.current;return{virtualMcpId:a,taskId:l,navigateToTask:o}}function wn(t,e){const{mimeType:s,data:n}=t;if(s.startsWith("text/"))try{const a=new TextDecoder().decode(Uint8Array.from(atob(n),o=>o.charCodeAt(0)));return[{type:"text",text:`${e}
17
- ${a}`}]}catch(a){console.error("Failed to decode text file:",a)}return[{type:"file",url:`data:${s};base64,${n}`,filename:e,mediaType:s}]}function nt(t,e){const s=[];for(const n of t)!n||typeof n!="object"||("text"in n&&n.text?s.push({type:"text",text:`[${e}]
18
- ${n.text}`}):"blob"in n&&n.blob&&n.mimeType&&s.push({type:"file",url:`data:${n.mimeType};base64,${n.blob}`,filename:String(n.uri),mediaType:String(n.mimeType)}));return s}function Cn(t,e){const s=(t.files??[]).filter(r=>r.content?.trim()),n=t.omittedPaths??[];if(s.length===0&&n.length===0)return[];const a=s.map(r=>`<skill-file path="${r.relPath}">
19
- ${r.content.trim()}
20
- </skill-file>`).join(`
21
-
22
- `),o=n.length>0?`
23
-
24
- Other files in \`${t.sandboxPath}/\`: ${n.join(", ")}`:"";return[{type:"text",text:`[${e}]
25
- ${a}${o}`}]}function Mn(t,e){const s=[];for(const n of t){if(n.role!=="user"||!n.content)continue;const a=Array.isArray(n.content)?n.content:[n.content];for(const o of a)switch(o.type){case"text":{const r=o.text?.trim();if(!r)continue;s.push({type:"text",text:`[${e}]
26
- ${r}`});break}case"image":case"audio":{if(!o.data||!o.mimeType)continue;s.push({type:"file",url:`data:${o.mimeType};base64,${o.data}`,mediaType:o.mimeType});break}case"resource":{const r=o.resource;if(!r||!r.mimeType)continue;r&&("text"in r&&r.text?s.push({type:"text",text:`[${e}]
27
- ${r.text}`}):"blob"in r&&r.blob&&r.mimeType&&s.push({type:"file",url:`data:${r.mimeType};base64,${r.blob}`,filename:String(r.uri),mediaType:String(r.mimeType)}));break}}}return s}function yt(t){if(!t)return[];const e=[];let s="";const n=a=>{if(a){if(a.type==="text"&&"text"in a&&typeof a.text=="string")s+=a.text;else if(a.type==="mention"&&a.attrs){const o=a.attrs.char??"/",r=`${o}${a.attrs.name}`;if(a.attrs.kind==="task"){const l=a.attrs.metadata,p=l?.title??a.attrs.name??"",u=l?.context?.trim()||[p,l?.description?.trim()].filter(Boolean).join(`
28
-
29
- `);u&&e.push({type:"text",text:u});return}if(s+=r,o==="@"){const l=a.attrs.metadata;l&&typeof l=="object"&&!Array.isArray(l)&&"agentId"in l?e.push({type:"text",text:`[DELEGATE TO AGENT: ${l.title??a.attrs.name} (agent_id: ${l.agentId})]
30
- Use the subtask tool to delegate this task to the agent above. Include the full relevant context from this conversation in the prompt field — the subagent has no conversation history.`}):Array.isArray(l)&&e.push(...nt(l,r))}else if(a.attrs.kind==="skill"){const l=a.attrs.metadata;l&&!Array.isArray(l)&&Array.isArray(l.files)&&e.push(...Cn(l,r))}else{const l=a.attrs.metadata||a.attrs.prompts||[];Array.isArray(l)&&l.length>0&&typeof l[0]=="object"&&l[0]!==null&&"role"in l[0]?e.push(...Mn(l,r)):Array.isArray(l)&&e.push(...nt(l,r))}}else if(a.type==="file"&&a.attrs){const o=a.attrs,r=`[file:://${encodeURIComponent(o.name)}]`;s+=r,e.push(...wn(o,r))}if("content"in a&&Array.isArray(a.content))for(const o of a.content)n(o)}};return n(t),s.trim()&&e.unshift({type:"text",text:s.trim()}),e}function us(t){const e=yt(t);return e.length===0?[]:[{id:crypto.randomUUID(),role:"user",parts:e,metadata:{tiptapDoc:t}}]}function ps(t){return new Set(t.filter(e=>e.status==="queued").map(e=>e.messageId))}function Tn(t){return(t??[]).map(e=>e?.type==="text"&&typeof e.text=="string"?e.text:"").join("").trim()}function hs(t){return t.filter(e=>e.status==="queued").sort((e,s)=>e.enqueuedAt-s.enqueuedAt)}function Pn(t,e){return t.some(s=>s.messageId===e.messageId)?t:[...t,e]}function An(t,e){return t.filter(s=>s.messageId!==e)}const st=new Map,We=new Set;function _n(t){We.add(t)}function Rn(t){return We.has(t)}function En(t){We.delete(t)}function we(t){let e=st.get(t);return e||(e=new Ut([]),st.set(t,e)),e}function vt(t,e){we(t).update(s=>Pn(s,e))}function Le(t,e){we(t).update(s=>An(s,e))}function $n(t,e){we(t).set(e)}const Ee=new Map;function Dn(t,e){Ee.set(`${t}:${e.id}`,e)}function On(t,e){const s=`${t}:${e}`,n=Ee.get(s);return Ee.delete(s),n}function at(t,e){Ee.delete(`${t}:${e}`)}async function ne(t,e){try{const s=await fetch(`/api/${encodeURIComponent(t)}/decopilot/queue/${encodeURIComponent(e)}`,{credentials:"include"});if(!s.ok)return;const n=await s.json();$n(e,n.items??[])}catch{}}function ms(t){const e=Z.c(2);let s;e[0]!==t?(s=we(t),e[0]=t,e[1]=s):s=e[1];const n=s;return S.useSyncExternalStore(n.subscribe,n.get,n.get)}function Un(){const{org:t}=Y();return{enqueue:vt,refresh:e=>ne(t.slug,e),cancel:async(e,s)=>{const n=`thread-run:${e}:${s}`;Le(e,s);try{const a=await fetch(`/api/${encodeURIComponent(t.slug)}/decopilot/queue/${encodeURIComponent(e)}/cancel/${encodeURIComponent(n)}`,{method:"POST",credentials:"include"});if(!a.ok&&a.status!==404)throw new Error(`Cancel failed: ${a.status}`);return!0}catch(a){return ce.error(a instanceof Error?a.message:"Failed to cancel"),!1}finally{await ne(t.slug,e)}}}}const xe={tiers:{}};function Ln(){const t=Z.c(7),{org:e}=Y();let s;t[0]!==e.id?(s=se.userModelPreferences(e.id),t[0]=e.id,t[1]=s):s=t[1];let n;t[2]!==e.slug?(n=async()=>{const o=await jt(e.slug,"USER_MODEL_PREFERENCES_GET",{});return o?.tiers?o:xe},t[2]=e.slug,t[3]=n):n=t[3];let a;return t[4]!==s||t[5]!==n?(a={queryKey:s,queryFn:n,staleTime:6e4},t[4]=s,t[5]=n,t[6]=a):a=t[6],rt(a)}function Nn(){return Ln().data??xe}function fs(){const t=Z.c(19),{org:e}=Y(),s=ut(),n=Fe();let a;t[0]!==e.id?(a=se.userModelPreferences(e.id),t[0]=e.id,t[1]=a):a=t[1];const o=a;let r;t[2]!==o||t[3]!==n||t[4]!==s?(r=async w=>{const f=n.getQueryData(o)??xe;return await s.call("USER_MODEL_PREFERENCES_UPDATE",f)??f},t[2]=o,t[3]=n,t[4]=s,t[5]=r):r=t[5];let l,p,u,m;t[6]!==o||t[7]!==n?(l=w=>{const{tier:f,slot:T}=w,q=n.getQueryData(o),N=q??xe;return n.setQueryData(o,{tiers:{...N.tiers,[f]:T}}),{prev:q}},p=(w,f,T)=>{n.setQueryData(o,T?.prev??xe)},u=w=>{n.setQueryData(o,w)},m=()=>{n.isMutating({mutationKey:o})===1&&n.invalidateQueries({queryKey:o})},t[6]=o,t[7]=n,t[8]=l,t[9]=p,t[10]=u,t[11]=m):(l=t[8],p=t[9],u=t[10],m=t[11]);let v;return t[12]!==o||t[13]!==r||t[14]!==l||t[15]!==p||t[16]!==u||t[17]!==m?(v={mutationKey:o,mutationFn:r,onMutate:l,onError:p,onSuccess:u,onSettled:m},t[12]=o,t[13]=r,t[14]=l,t[15]=p,t[16]=u,t[17]=m,t[18]=v):v=t[18],Ct(v)}function Fn(){const t=Z.c(5),e=Xt(),s=Nn(),n=s.tiers.fast??e.tiers.fast,a=s.tiers.smart??e.tiers.smart,o=s.tiers.thinking??e.tiers.thinking;let r;return t[0]!==e.tiers||t[1]!==n||t[2]!==a||t[3]!==o?(r={tiers:{...e.tiers,fast:n,smart:a,thinking:o}},t[0]=e.tiers,t[1]=n,t[2]=a,t[3]=o,t[4]=r):r=t[4],r}function re(t,e,s,n){if(!t)return null;const a=e.find(r=>r.id===t.keyId);if(!a)return null;const o=s.find(r=>r.modelId===t.modelId);return o?{...o,keyId:t.keyId}:{modelId:t.modelId,title:n??t.modelId,keyId:t.keyId,providerId:a.providerId,description:null,logo:null,capabilities:[],limits:null,costs:null}}function jn(t){return t==="fast"||t==="smart"||t==="thinking"?t:"smart"}function qn(t,e,s,n){if(!s||n.length===0)return null;const a=e.find(p=>p.id===s);if(!a)return null;const o=Bt([a],{[s]:n}),r=t==="fast"?o.chat.fast:t==="thinking"?o.chat.thinking:o.chat.smart;if(!r)return null;const l=n.find(p=>p.modelId===r.modelId);return l?{...l,keyId:s}:null}const ot=new Set,le=new Set;function me(t){return S.useSyncExternalStore(t.subscribe,t.get,t.get)}function Kn(t){return t.kind==="loading"?"ready":t.kind}const Vn=1e4,Qn=10,ze=S.createContext(null),Ge=S.createContext(null),Xe=S.createContext(null),St=S.createContext(null);function Bn({children:t}){const{locator:e}=Y(),{virtualMcpId:s}=gt(),[n,a]=fe(be.chatSelectedImageModel(e),null),[o,r]=fe(be.chatSelectedWebSearchModel(e),null),[l,p]=fe(be.chatSelectedDeepResearchModel(e),null),[u,m]=S.useState(null),[v,w]=S.useState("default"),f=Fn(),[T,q]=fe(be.chatSimpleModeTier(e),null),N=jn(T),C=Ht(),P=f.tiers[N],F=u&&C.some(c=>c.id===u)?u:P?.keyId??C[0]?.id??null,{models:j,isLoading:_}=ye(F??void 0),{models:H}=ye(P?.keyId),{models:ae}=ye(f.tiers.image?.keyId),{models:D}=ye(f.tiers.web_search?.keyId),{models:K}=ye(f.tiers.deep_research?.keyId),ee=re(P,C,H,P?.title)??qn(N,C,F,j),J=_,W=j.filter(c=>c.capabilities?.includes("image")),V=re(n,C,W),te=re(f.tiers.image,C,ae,f.tiers.image?.title)??V??W[0]??null,b=j.filter(Wt),L=re(o,C,b),z=b.find(c=>c.modelId==="perplexity/sonar")??b[0]??null,G=re(f.tiers.web_search,C,D,f.tiers.web_search?.title)??L??z,Q=j.filter(zt),A=re(l,C,Q),B=Q.find(c=>c.modelId==="perplexity/deep-research")??Q.find(c=>c.asyncResearch===!0)??Q[0]??null,E=re(f.tiers.deep_research,C,K,f.tiers.deep_research?.title)??A??B,De=Qt(s)??{id:s,title:"",description:null,icon:null},[Ce,Me]=S.useState({}),Te=(c,g)=>{const U=[];for(const I of g.content??[])I.type==="text"&&I.text?.trim()&&U.push(I.text.trim());const R=U.join(`
31
- `);if(!R){ge(c);return}new TextEncoder().encode(R).length>Vn||Me(I=>Object.keys(I).length>=Qn&&!(c in I)?I:{...I,[c]:R})},ge=c=>{Me(g=>{const{[c]:U,...R}=g;return R})},[Pe,ue]=fe(be.chatLastAgentOption(e),c=>c&&c in Re?c:null),ie=zn(),Oe=ie?.isThreadLocked&&ie.lockedHarness!=null?mn(ie.lockedHarness,ie.lockedSandbox):null,Ae=pn(),Ze=fn(Pe,Ae.ready&&!Ae.online),pe=ie?.isThreadLocked?Oe:Ze,_e=pe?Re[pe]:null,d=_e?.harness??null,h=_e?.sandbox??null,[$,O]=S.useState(void 0),y=S.useRef($);y.current=$;const k={selectedModel:ee,setModel:()=>{},credentialId:F,setCredentialId:m,allModelsConnections:C,isModelsLoading:J,selectedVirtualMcp:De,imageModel:te,setImageModel:c=>{a(c?.keyId?{keyId:c.keyId,modelId:c.modelId}:null)},webSearchModel:G,setWebSearchModel:c=>{r(c?.keyId?{keyId:c.keyId,modelId:c.modelId}:null)},deepResearchModel:E,setDeepResearchModel:c=>{p(c?.keyId?{keyId:c.keyId,modelId:c.modelId}:null)},chatMode:v,setChatMode:w,appContexts:Ce,setAppContext:Te,clearAppContext:ge,tiptapDoc:$,setTiptapDoc:O,tiptapDocRef:y,resetInteraction:()=>{},simpleModeTier:N,setSimpleModeTier:c=>q(c),pendingAgentOption:pe,setPendingAgentOption:ue,pendingHarnessId:d,pendingSandboxProviderKind:h};return X.jsx(Xe.Provider,{value:k,children:t})}function bs(t){const e=Z.c(41),{virtualMcpId:s,task:n,children:a}=t,{locator:o}=Y(),{data:r}=Tt.useSession(),l=r?.user??null,{taskId:p,virtualMcpId:u,navigateToTask:m}=gt(),[v]=Pt(),{markTaskRead:w}=kn(),f=Ft(),T=p,q=u,N=Sn(q);let C;e[0]!==w||e[1]!==m?(C=(A,B)=>{w(A),m(A,{virtualMcpId:B?.virtualMcpId,autosend:B?.autosend})},e[0]=w,e[1]=m,e[2]=C):C=e[2];const P=C,F=T&&n?.id===T?n:null,j=F?.harness_id??null,_=F?.sandbox_provider_kind??null,H=F?.branch??null,ae=j!=null,D=H;let K;e[3]!==D||e[4]!==P||e[5]!==f||e[6]!==s?(K=()=>{const A=crypto.randomUUID();return f.create({id:A,virtual_mcp_id:s,...D?{branch:D}:{}}).then(()=>P(A)).catch(()=>{P(A)}),A},e[3]=D,e[4]=P,e[5]=f,e[6]=s,e[7]=K):K=e[7];const ee=K;let J;e[8]!==D||e[9]!==o||e[10]!==P||e[11]!==f||e[12]!==s?(J=A=>{const B=crypto.randomUUID(),E=A.virtualMcpId??s,oe=E===s?D:null;Ot(sessionStorage,o,B,A.message),f.create({id:B,virtual_mcp_id:E,...oe?{branch:oe}:{}}).then(()=>P(B,{virtualMcpId:A.virtualMcpId,autosend:!0})).catch(()=>{P(B,{virtualMcpId:A.virtualMcpId,autosend:!0})})},e[8]=D,e[9]=o,e[10]=P,e[11]=f,e[12]=s,e[13]=J):J=e[13];const W=J;let V;e[14]!==T||e[15]!==f?(V=A=>{T&&f.setBranch(T,A)},e[14]=T,e[15]=f,e[16]=V):V=e[16];let te;e[17]!==F||e[18]!==ee||e[19]!==W||e[20]!==D||e[21]!==T||e[22]!==q||e[23]!==ae||e[24]!==H||e[25]!==j||e[26]!==_||e[27]!==P||e[28]!==V?(te={virtualMcpId:q,taskId:T,openTask:P,createTask:ee,createTaskWithMessage:W,activeTask:F,isThreadLocked:ae,lockedHarness:j,lockedSandbox:_,lockedBranch:H,currentBranch:D,setCurrentTaskBranch:V},e[17]=F,e[18]=ee,e[19]=W,e[20]=D,e[21]=T,e[22]=q,e[23]=ae,e[24]=H,e[25]=j,e[26]=_,e[27]=P,e[28]=V,e[29]=te):te=e[29];const b=te;let L;e[30]!==N||e[31]!==v||e[32]!==m||e[33]!==l?(L={user:l,contextPrompt:N,preferences:v,rawNavigateToTask:m},e[30]=N,e[31]=v,e[32]=m,e[33]=l,e[34]=L):L=e[34];const z=L;let G;e[35]!==a||e[36]!==z?(G=X.jsx(Bn,{children:X.jsx(St.Provider,{value:z,children:a})}),e[35]=a,e[36]=z,e[37]=G):G=e[37];let Q;return e[38]!==G||e[39]!==b?(Q=X.jsx(Ge.Provider,{value:b,children:G}),e[38]=G,e[39]=b,e[40]=Q):Q=e[40],Q}function gs({taskId:t,children:e}){const s=$e(),{virtualMcpId:n,activeTask:a,currentBranch:o}=Hn();t&&!ot.has(t)&&(ot.add(t),Mt("chat_opened",{thread_id:t}));const{imageModel:r,webSearchModel:l,deepResearchModel:p,chatMode:u,setChatMode:m,appContexts:v,setTiptapDoc:w,simpleModeTier:f,pendingSandboxProviderKind:T,pendingHarnessId:q}=Wn(),N=S.useContext(St);if(!N)throw new Error(s("chat.chatContext.activeTaskProviderMissingContext"));const{user:C,contextPrompt:P,preferences:F,rawNavigateToTask:j}=N,{org:_,locator:H}=Y(),ae=Un(),[D,K]=S.useState(null),ee=xn(),J=Fe(),W=Lt(),V=ct(),te=Kt({connectionId:Vt,orgId:_.id,orgSlug:_.slug}),b=Nt(_.slug,t,{client:te});S.use(b.ready);const L=me(b.messages),z=me(b.status),G=me(b.finishReason),Q=me(b.runStatusStage),A=me(b.hasMoreOlder),B=me(b.isFetchingOlder),E=S.useRef({onToolCall:ee,queryClient:J,rawNavigateToTask:j,taskId:t,manager:W,navigate:V,orgId:_.id,orgSlug:_.slug});E.current={onToolCall:ee,queryClient:J,rawNavigateToTask:j,taskId:t,manager:W,navigate:V,orgId:_.id,orgSlug:_.slug},Gt({orgSlug:_.slug,taskId:t,onTaskStatus:d=>{const h=E.current,$=d.data.message_id;if(d.data.status==="in_progress"&&$){Le(h.taskId,$);const O=On(h.taskId,$);O&&b.applyLocalMessage(O),ne(h.orgSlug,h.taskId)}Rn(h.taskId)&&(async()=>(await ne(h.orgSlug,h.taskId),await b.reconcileFromServer()&&we(h.taskId).get().length===0&&En(h.taskId)))()}}),S.useEffect(()=>{const d={onData:y=>{if(y.type==="data-thread-title"){const k=y.data;if(!k?.title)return;const c=E.current;if(!c.taskId)return;c.manager.patchThread({id:c.taskId,title:k.title,updated_at:new Date().toISOString()});return}if(y.type==="data-deck-updated"){const k=y.data;if(!k?.path)return;const c=k.path,g=E.current;g.queryClient.invalidateQueries({queryKey:se.orgFsStat(g.orgId,"home",c)}),g.queryClient.invalidateQueries({queryKey:se.orgFsRecent(g.orgId)}),g.navigate({to:".",search:U=>({...U,main:Dt(c)}),replace:!0});return}if(y.type==="data-open-preview"){const k=y.data,c=E.current,g=c.taskId;if(g){const U=c.manager.threads.get().find(R=>R.id===g);c.manager.patchThread({id:g,...k?.branch?{branch:k.branch}:{},...k?.sandboxProviderKind?{sandbox_provider_kind:k.sandboxProviderKind}:{},metadata:{...U?.metadata??{},...k?.githubRepo?{githubRepo:k.githubRepo}:{},...k?.sandboxMap?{sandboxMap:k.sandboxMap}:{}}})}c.navigate({to:".",search:U=>({...U,main:"preview"}),replace:!0});return}},onFinish:(y,k,c)=>{const g=E.current;g.taskId&&ne(g.orgSlug,g.taskId),g.taskId&&g.manager.patchThread({id:g.taskId,status:hn(c,y.parts),updated_at:new Date().toISOString()});const U=y.parts?.some(I=>{const he=I;return(he.type==="tool-share_with_user"||he.type==="tool-bash"||he.type==="tool-write")&&he.state==="output-available"});if(g.taskId&&U){const I=se.threadOutputs(g.taskId);for(const he of[0,1500,3e3,6e3,12e3,25e3])setTimeout(()=>{g.queryClient.invalidateQueries({queryKey:I})},he)}g.queryClient.invalidateQueries({queryKey:se.homeNextActions(g.orgSlug)});const R=y.metadata?.thread_id;R&&R!==g.taskId&&g.rawNavigateToTask(R)},onError:y=>{K(y),console.error("[chat] Error",y)},onToolCall:y=>E.current.onToolCall(y)};b.observer=d,ne(E.current.orgSlug,E.current.taskId);const h=y=>y==="submitted"||y==="streaming";let $=h(b.status.get().kind);const O=b.status.subscribe(()=>{const y=h(b.status.get().kind);if(y===$)return;$=y;const k=E.current;ne(k.orgSlug,k.taskId)});return()=>{b.observer===d&&(b.observer=null),O()}},[b]);const oe=z.kind==="submitted"||z.kind==="streaming",De=L.length===0,Ce=L.at(-1),Me=!oe&&Ce?.role==="assistant"&&Ce.parts.some(d=>"state"in d&&d.state==="approval-requested"),Te=a,ge=(Te?.status==="in_progress"||Te?.status==="expired")&&z.kind==="ready"&&L.length>0;async function Pe(d){const h=t,$=n,O=Object.entries(v),y=O.length>0?O.map(([R,I])=>`### App Context: ${R}
32
- ${I}`).join(`
33
-
34
- `):"",k=[P,y].filter(Boolean).join(`
35
-
36
- `);let c=u;c==="gen-image"&&!r&&(c="default"),c==="web-search"&&!l&&(c="default"),c==="deep-research"&&!p&&(c="default"),(c==="web-search"||c==="deep-research")&&m("default");const g=bn({thread:a?{harness_id:a.harness_id??null,sandbox_provider_kind:a.sandbox_provider_kind??null,branch:a.branch??null}:null,globals:{harnessId:q??void 0,sandboxProviderKind:T??void 0,branch:o}});a?.harness_id||W.patchThread({id:h,harness_id:g.harnessId??"decopilot",updated_at:new Date().toISOString()});const U={tier:f,mode:c,toolApprovalLevel:F.toolApprovalLevel??At(),system:k||void 0,agent:{id:$},thread_id:h,...g};try{if(oe||ge){let R=!0;try{Dn(h,d),await b.enqueue(d,U),vt(h,{workflowId:`thread-run:${h}:${d.id}`,messageId:d.id,text:Tn(d.parts),hasAttachments:d.parts.some(I=>I.type==="file"),status:"queued",enqueuedAt:Date.now(),optimistic:!0}),_n(h)}catch(I){R=!1,at(h,d.id),Le(h,d.id),K(I instanceof Error?I:new Error(String(I))),ce.error(I instanceof Error?I.message:s("chat.chatContext.failedToQueueMessage"))}return ne(_.slug,h),R}return await b.submit({kind:"message",message:d},U),!0}finally{le.delete(h)}}async function ue(d){const h=d.parts??yt(d.tiptapDoc);if(h.length===0||le.has(t))return;le.add(t),K(null),w(void 0);const $={tiptapDoc:d.tiptapDoc,created_at:new Date().toISOString(),user:{avatar:C?.image??void 0,name:C?.name??"you"}},O={id:crypto.randomUUID(),role:"user",parts:h,metadata:$};await Pe(O)}async function ie(d,h){if(le.has(t))return ce.info(s("chat.chatContext.stillSendingPreviousMessage")),!1;if(le.add(t),!await ae.cancel(t,d))return le.delete(t),ce.error(s("chat.chatContext.couldNotRemoveOriginalMessage")),!1;at(t,d),b.removeLocalMessage(d);const O={id:crypto.randomUUID(),role:"user",parts:[{type:"text",text:h}],metadata:{created_at:new Date().toISOString(),user:{avatar:C?.image??void 0,name:C?.name??"you"}}};try{return await Pe(O)}catch(y){return ce.error(y instanceof Error?y.message:s("chat.chatContext.failedToSendEditedMessage")),!1}}const Oe=async()=>{b.stop();try{const d=await fetch(`/api/${_.slug}/decopilot/cancel/${t}`,{method:"POST",credentials:"include"});if(d.status===404)return;if(!d.ok){const h=await d.json().catch(()=>({}));throw new Error(h.message??s("chat.chatContext.cancelFailedStatus",{status:d.status}))}}catch(d){const h=d instanceof Error?d.message:s("chat.chatContext.failedToCancel");ce.error(h),console.error("[chat] cancelRun",d)}},Ae=d=>d&&typeof d=="object"&&"type"in d?ue({tiptapDoc:d}):ue(d),pe=Ne({strict:!1}).autosend===dt;S.useEffect(()=>{if(!pe||L.length>0)return;const d=Et(sessionStorage,H,t);d&&ue(d.message).then(()=>{$t(sessionStorage,H,t)})},[pe,L.length,H,t,ue]);const _e={messages:L,status:Kn(z),sendMessage:Ae,editQueuedMessage:ie,stop:()=>{Oe()},submit:(d,h)=>b.submit(d,h),removeLocalMessage:d=>b.removeLocalMessage(d),isSendInFlight:()=>le.has(t),error:D,clearError:()=>K(null),finishReason:G,runStatusStage:Q,clearFinishReason:()=>b.finishReason.set(null),isStreaming:oe,isChatEmpty:De,isWaitingForApprovals:Me??!1,isRunInProgress:ge,hasMoreOlder:A,isFetchingOlder:B,fetchOlderMessages:b.fetchOlderMessages.bind(b)};return X.jsx(ze.Provider,{value:_e,children:e})}function ys(){const t=$e(),e=S.useContext(ze);if(!e)throw new Error(t("chat.chatContext.useChatStreamMissingContext"));return e}function vs(){return S.useContext(ze)}function Hn(){const t=$e(),e=S.useContext(Ge);if(!e)throw new Error(t("chat.chatContext.useChatTaskMissingContext"));return e}function Wn(){const t=$e(),e=S.useContext(Xe);if(!e)throw new Error(t("chat.chatContext.useChatPrefsMissingContext"));return e}function Ss(){return S.useContext(Xe)}function zn(){return S.useContext(Ge)}export{gs as A,gt as B,Bn as C,Ss as D,en as E,rs as S,is as V,Wn as a,ys as b,zn as c,Hn as d,ms as e,Un as f,at as g,Ln as h,fs as i,Fn as j,vs as k,bs as l,ps as m,os as n,nn as o,ls as p,as as q,yt as r,hs as s,us as t,pn as u,gn as v,yn as w,cs as x,bt as y,ds as z};
@@ -1,8 +0,0 @@
1
- import{c as k,j as s,B as C,F as H,r as U,z as Y,t as K}from"./index-sd38S2ER.js";import{A as J,b as V}from"./alert-C7dLb2xM.js";import{C as X}from"./card-yJEtZ44f.js";import{c as T,T as L,b as B,a as D}from"./tabs-Dg2fovl2.js";import{u as O}from"./use-copy-BmXjtpVk.js";import{i as F}from"./Check-CWNssTV8.js";import{a as I}from"./Copy01-_e4tlhaR.js";import{i as q}from"./Key01-AWbv_wld.js";import{n as Q}from"./LinkExternal01-BHxU7hA5.js";import{s as Z}from"./Trash01-BecpyKSB.js";import{P as z}from"./index-Bl2gwdpO.js";import{c as ee}from"./settings-section-BzmRZGKV.js";import{a as te,m as se,u as re,b as ne,d as ie}from"./use-api-keys-CSaFJXfD.js";import"./sidebar-DTxjIJ56.js";import"./LayoutLeft-CGP9_srE.js";import"./use-mobile-DxvpAkbd.js";import"./X-CalOG8rP.js";import"./tooltip-Bjx5IK0l.js";import"./ArrowUpRight-eD5g-cFd.js";import"./use-mcp-client-Cav0AiKw.js";import"./auth-ByPgJhb1.js";function ae({client:e,mode:t,url:i,apiKey:a}){const o=a??"<paste-your-api-key>",l=te();if(e==="claude-code")return t==="oauth"?{language:"bash",code:`claude mcp add --transport http --scope user ${l} ${i}`}:{language:"bash",code:`claude mcp add --transport http --scope user ${l} ${i} \\
2
- --header "Authorization: Bearer ${o}"`};if(e==="cursor"){const n={url:i};return t==="api-key"&&(n.headers={Authorization:`Bearer ${o}`}),{language:"json",pathHint:"~/.cursor/mcp.json",code:JSON.stringify({mcpServers:{[l]:n}},null,2)}}if(e==="codex"){const n=[`[mcp_servers.${l}]`,`url = "${i}"`];return t==="api-key"&&n.push(`http_headers = { "Authorization" = "Bearer ${o}" }`),{language:"toml",pathHint:"~/.codex/config.toml",code:n.join(`
3
- `)}}if(e==="claude-desktop"){const n={type:"http",url:i};return t==="api-key"&&(n.headers={Authorization:`Bearer ${o}`}),{language:"json",pathHint:"claude_desktop_config.json",code:JSON.stringify({mcpServers:{[l]:n}},null,2)}}return t==="oauth"?{language:"text",code:`${i}
4
-
5
- # OAuth: clients that support MCP OAuth 2.1 will discover
6
- # the auth flow via the WWW-Authenticate header on 401.`}:{language:"text",code:`${i}
7
-
8
- Authorization: Bearer ${o}`}}function R(e){const t=k.c(23),{client:i,mode:a,url:o,apiKey:l}=e;let n;t[0]!==l||t[1]!==i||t[2]!==a||t[3]!==o?(n=ae({client:i,mode:a,url:o,apiKey:l}),t[0]=l,t[1]=i,t[2]=a,t[3]=o,t[4]=n):n=t[4];const c=n,{handleCopy:m,copied:f}=O(),d=c.pathHint??c.language;let r;t[5]!==d?(r=s.jsx("span",{className:"text-[11px] text-muted-foreground font-medium uppercase tracking-wider",children:d}),t[5]=d,t[6]=r):r=t[6];let u;t[7]!==m||t[8]!==c.code?(u=()=>m(c.code),t[7]=m,t[8]=c.code,t[9]=u):u=t[9];let x;t[10]!==f?(x=f?s.jsx(F,{size:14}):s.jsx(I,{size:14}),t[10]=f,t[11]=x):x=t[11];let p;t[12]!==u||t[13]!==x?(p=s.jsx(C,{variant:"ghost",size:"icon",className:"size-7 shrink-0",onClick:u,"aria-label":"Copy snippet",children:x}),t[12]=u,t[13]=x,t[14]=p):p=t[14];let h;t[15]!==r||t[16]!==p?(h=s.jsxs("div",{className:"flex items-center justify-between px-3 py-1.5 border-b border-border",children:[r,p]}),t[15]=r,t[16]=p,t[17]=h):h=t[17];let g;t[18]!==c.code?(g=s.jsx("pre",{className:"p-3 text-xs overflow-x-auto font-mono",children:s.jsx("code",{children:c.code})}),t[18]=c.code,t[19]=g):g=t[19];let y;return t[20]!==h||t[21]!==g?(y=s.jsxs("div",{className:"relative rounded-md border border-border bg-muted/40",children:[h,g]}),t[20]=h,t[21]=g,t[22]=y):y=t[22],y}const A="Connect: ",E=[{id:"claude-code",label:"Claude Code"},{id:"cursor",label:"Cursor"},{id:"codex",label:"Codex"},{id:"claude-desktop",label:"Claude Desktop"},{id:"raw",label:"Raw URL"}];function M(e){return E.find(t=>t.id===e)?.label??e}function oe(){return typeof window>"u"?"unknown":window.location.hostname}function G(e){const t=k.c(8),{text:i}=e,{handleCopy:a,copied:o}=O();let l;t[0]!==a||t[1]!==i?(l=()=>a(i),t[0]=a,t[1]=i,t[2]=l):l=t[2];let n;t[3]!==o?(n=o?s.jsx(F,{size:14}):s.jsx(I,{size:14}),t[3]=o,t[4]=n):n=t[4];let c;return t[5]!==l||t[6]!==n?(c=s.jsx(C,{variant:"ghost",size:"icon",className:"size-7 shrink-0",onClick:l,"aria-label":"Copy",children:n}),t[5]=l,t[6]=n,t[7]=c):c=t[7],c}function le(e){const t=k.c(16),{client:i,url:a,newKey:o,onGenerate:l,isGenerating:n,onClearNewKey:c}=e;let m;t[0]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsxs(T,{children:[s.jsx(B,{value:"oauth",children:"OAuth"}),s.jsx(B,{value:"api-key",children:"API key"})]}),t[0]=m):m=t[0];let f;t[1]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx("p",{className:"text-xs text-muted-foreground",children:"Recommended for your laptop. Browser will open on first use to sign in — no token to manage."}),t[1]=f):f=t[1];let d;t[2]!==i||t[3]!==a?(d=s.jsxs(L,{value:"oauth",className:"mt-3 space-y-3",children:[f,s.jsx(R,{client:i,mode:"oauth",url:a})]}),t[2]=i,t[3]=a,t[4]=d):d=t[4];let r;t[5]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("p",{className:"text-xs text-muted-foreground",children:"For CI, Conductor, or headless agents that can't open a browser."}),t[5]=r):r=t[5];let u;t[6]!==i||t[7]!==n||t[8]!==o||t[9]!==c||t[10]!==l||t[11]!==a?(u=s.jsxs(L,{value:"api-key",className:"mt-3 space-y-3",children:[r,o?s.jsxs(s.Fragment,{children:[s.jsxs(J,{variant:"warning",className:"text-xs",children:[s.jsx(Y,{}),s.jsx(V,{children:"Copy this snippet now — the key won't be shown again. You can revoke it later from the list below."})]}),s.jsx(R,{client:i,mode:"api-key",url:a,apiKey:o}),s.jsx(C,{variant:"ghost",size:"sm",onClick:c,className:"text-xs",children:"Done, hide key"})]}):s.jsxs(s.Fragment,{children:[s.jsx(R,{client:i,mode:"api-key",url:a}),s.jsxs(C,{size:"sm",onClick:l,disabled:n,className:"gap-1.5",children:[s.jsx(q,{size:14}),n?"Generating…":`Generate key for ${M(i)}`]})]})]}),t[6]=i,t[7]=n,t[8]=o,t[9]=c,t[10]=l,t[11]=a,t[12]=u):u=t[12];let x;return t[13]!==d||t[14]!==u?(x=s.jsxs(D,{defaultValue:"oauth",className:"mt-4",children:[m,d,u]}),t[13]=d,t[14]=u,t[15]=x):x=t[15],x}function ce(){const e=k.c(16),{data:t,isLoading:i,error:a}=ne(),o=ie();let l,n,c;if(e[0]!==t||e[1]!==o||e[2]!==a||e[3]!==i){c=Symbol.for("react.early_return_sentinel");e:{const f=t?.filter(ue)??[];if(i){let r;e[7]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("p",{className:"text-xs text-muted-foreground",children:"Loading active keys…"}),e[7]=r):r=e[7],c=r;break e}if(a){let r;e[8]!==a.message?(r=s.jsxs("p",{className:"text-xs text-destructive",children:["Failed to load keys: ",a.message]}),e[8]=a.message,e[9]=r):r=e[9],c=r;break e}if(f.length===0){let r;e[10]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("p",{className:"text-xs text-muted-foreground",children:"No connect keys minted yet. Generate one from a client tab above for headless setups."}),e[10]=r):r=e[10],c=r;break e}l="divide-y divide-border rounded-md border border-border";let d;e[11]!==o?(d=r=>s.jsxs("li",{className:"flex items-center justify-between gap-3 px-3 py-2 text-xs",children:[s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("div",{className:"font-medium truncate",children:r.name.replace(A,"")}),s.jsxs("div",{className:"text-muted-foreground",children:["Created ",new Date(r.createdAt).toLocaleDateString()]})]}),s.jsxs(C,{variant:"ghost",size:"sm",onClick:()=>{confirm(`Revoke "${r.name}"? Any client still using this key will lose access.`)&&o.mutate(r.id,{onSuccess:me,onError:de})},disabled:o.isPending,className:"gap-1 text-destructive hover:text-destructive",children:[s.jsx(Z,{size:14}),"Revoke"]})]},r.id),e[11]=o,e[12]=d):d=e[12],n=f.map(d)}e[0]=t,e[1]=o,e[2]=a,e[3]=i,e[4]=l,e[5]=n,e[6]=c}else l=e[4],n=e[5],c=e[6];if(c!==Symbol.for("react.early_return_sentinel"))return c;let m;return e[13]!==l||e[14]!==n?(m=s.jsx("ul",{className:l,children:n}),e[13]=l,e[14]=n,e[15]=m):m=e[15],m}function de(e){return K.error(e.message)}function me(){return K.success("Key revoked")}function ue(e){return e.name.startsWith(A)}function xe(){const e=k.c(29),{org:t}=H();let i;e[0]!==t.slug?(i=se(t.slug),e[0]=t.slug,e[1]=i):i=e[1];const a=i,o=re();let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l={},e[2]=l):l=e[2];const[n,c]=U.useState(l);let m;e[3]!==o?(m=j=>{const P=`${A}${M(j)} on ${oe()}`;o.mutate({name:P,permissions:{"*":["*"]}},{onSuccess:$=>{c(W=>({...W,[j]:$.key})),K.success("Key created")},onError:pe})},e[3]=o,e[4]=m):m=e[4];const f=m,d=`${a}/.well-known/oauth-protected-resource`;let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(z.Title,{children:"Connect to clients"}),e[5]=r):r=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx("div",{className:"size-9 rounded-lg bg-muted/60 flex items-center justify-center text-muted-foreground shrink-0",children:s.jsx(Q,{size:18})}),e[6]=u):u=e[6];let x;e[7]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsxs("div",{className:"flex items-start gap-3",children:[u,s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("h2",{className:"text-[15px] font-medium leading-tight",children:"Your org's unified MCP"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1 leading-snug",children:"Plug this URL into any MCP client to give that runtime every connection enabled in this org, governed by your Decopilot rules."})]})]}),e[7]=x):x=e[7];let p;e[8]!==a?(p=s.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-border bg-muted/40 px-3 py-1.5",children:[s.jsx("code",{className:"text-xs flex-1 truncate",children:a}),s.jsx(G,{text:a})]}),e[8]=a,e[9]=p):p=e[9];let h;e[10]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx("summary",{className:"cursor-pointer hover:text-foreground",children:"Wiring a custom client?"}),e[10]=h):h=e[10];let g;e[11]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx("p",{children:"OAuth 2.1 Protected Resource Metadata is advertised on 401:"}),e[11]=g):g=e[11];let y;e[12]!==d?(y=s.jsxs("details",{className:"text-xs text-muted-foreground",children:[h,s.jsxs("div",{className:"mt-2 space-y-1",children:[g,s.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-border bg-background px-2 py-1",children:[s.jsx("code",{className:"text-[11px] flex-1 truncate",children:d}),s.jsx(G,{text:d})]})]})]}),e[12]=d,e[13]=y):y=e[13];let b;e[14]!==p||e[15]!==y?(b=s.jsxs(X,{className:"p-5 gap-3",children:[x,p,y]}),e[14]=p,e[15]=y,e[16]=b):b=e[16];let _;e[17]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(T,{variant:"underline",children:E.map(fe)}),e[17]=_):_=e[17];let v;e[18]!==o||e[19]!==f||e[20]!==n||e[21]!==a?(v=E.map(j=>s.jsx(L,{value:j.id,children:s.jsx(le,{client:j.id,url:a,newKey:n[j.id]??null,onGenerate:()=>f(j.id),isGenerating:o.isPending&&o.variables?.name?.startsWith(`${A}${j.label}`)===!0,onClearNewKey:()=>c(P=>{const $={...P};return delete $[j.id],$})})},j.id)),e[18]=o,e[19]=f,e[20]=n,e[21]=a,e[22]=v):v=e[22];let N;e[23]!==v?(N=s.jsxs(D,{defaultValue:"claude-code",variant:"underline",children:[_,v]}),e[23]=v,e[24]=N):N=e[24];let w;e[25]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsxs("section",{className:"flex flex-col gap-3",children:[s.jsxs("div",{className:"px-4",children:[s.jsx("h2",{className:"text-[15px] font-medium leading-tight",children:"Active keys"}),s.jsx("p",{className:"text-sm text-muted-foreground leading-snug mt-1",children:"Keys you've generated for headless clients. Revoke any time."})]}),s.jsx(ce,{})]}),e[25]=w):w=e[25];let S;return e[26]!==b||e[27]!==N?(S=s.jsx(z,{children:s.jsx(z.Content,{children:s.jsx(z.Body,{children:s.jsxs(ee,{children:[r,b,N,w]})})})}),e[26]=b,e[27]=N,e[28]=S):S=e[28],S}function fe(e){return s.jsx(B,{value:e.id,variant:"underline",children:e.label},e.id)}function pe(e){return K.error(e.message)}function Ge(){const e=k.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(xe,{}),e[0]=t):t=e[0],t}export{Ge as default};
@@ -1 +0,0 @@
1
- import{c as z,j as t,b as A,r as _,B,m as w}from"./index-sd38S2ER.js";import{e as E,d as R,a as O,b as H,h as $}from"./dialog-Dq_peVG0.js";import{u as P,S as F}from"./chat-context-DoK0lfG3.js";import{i as G}from"./Check-CWNssTV8.js";import{a as W}from"./Copy01-_e4tlhaR.js";function I(a){const e=z.c(3),{size:s}=a,l=s===void 0?16:s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("path",{d:"M13 12L18.5 5M7.63965 3L12.5 12L13.6865 3M4.48381 6.71679L11.9872 12M3 12L11.9872 12.473M12.2244 13.177L7 20M4.84194 16.8682L11.2824 12.9758M11.5 21L12.665 13.177M21 14L13.1846 12.668M21 10.5788L13 12.3223M16.779 19.646L12.8876 13.3772M19.3566 18.207L13.313 12.9893"}),e[0]=n):n=e[0];let i;return e[1]!==l?(i=t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:l,height:l,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:n}),e[1]=l,e[2]=i):i=e[2],i}function S(a){const e=z.c(3),{size:s}=a,l=s===void 0?16:s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("path",{clipRule:"evenodd",d:"M8.086.457a6.105 6.105 0 013.046-.415c1.333.153 2.521.72 3.564 1.7a.117.117 0 00.107.029c1.408-.346 2.762-.224 4.061.366l.063.03.154.076c1.357.703 2.33 1.77 2.918 3.198.278.679.418 1.388.421 2.126a5.655 5.655 0 01-.18 1.631.167.167 0 00.04.155 5.982 5.982 0 011.578 2.891c.385 1.901-.01 3.615-1.183 5.14l-.182.22a6.063 6.063 0 01-2.934 1.851.162.162 0 00-.108.102c-.255.736-.511 1.364-.987 1.992-1.199 1.582-2.962 2.462-4.948 2.451-1.583-.008-2.986-.587-4.21-1.736a.145.145 0 00-.14-.032c-.518.167-1.04.191-1.604.185a5.924 5.924 0 01-2.595-.622 6.058 6.058 0 01-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74 7.74 0 01-.495-1.283 6.11 6.11 0 01-.017-3.064.166.166 0 00.008-.074.115.115 0 00-.037-.064 5.958 5.958 0 01-1.38-2.202 5.196 5.196 0 01-.333-1.589 6.915 6.915 0 01.188-2.132c.45-1.484 1.309-2.648 2.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129 0 00.087-.087A6.016 6.016 0 015.635 2.31C6.315 1.464 7.132.846 8.086.457zm-.804 7.85a.848.848 0 00-1.473.842l1.694 2.965-1.688 2.848a.849.849 0 001.46.864l1.94-3.272a.849.849 0 00.007-.854l-1.94-3.393zm5.446 6.24a.849.849 0 000 1.695h4.848a.849.849 0 000-1.696h-4.848z"}),e[0]=n):n=e[0];let i;return e[1]!==l?(i=t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:l,height:l,fill:"currentColor",fillRule:"evenodd","aria-hidden":"true",children:n}),e[1]=l,e[2]=i):i=e[2],i}const Y={"claude-code":{labelKey:"chat.agentIcons.claudeCode",Icon:I},codex:{labelKey:"chat.agentIcons.codex",Icon:S}};function X(a){return(a&&Y[a])??null}const T="bunx decocms@latest link",K=[{capability:"claude-code",labelKey:"chat.connectDesktopDialog.agentClaudeCodeLabel",descriptionKey:"chat.connectDesktopDialog.agentClaudeCodeDescription",icon:t.jsx(I,{size:18})},{capability:"codex",labelKey:"chat.connectDesktopDialog.agentCodexLabel",descriptionKey:"chat.connectDesktopDialog.agentCodexDescription",icon:t.jsx(S,{size:18})}];function Z(a,e){return K.filter(s=>a.includes(s.capability)).map(s=>e(s.labelKey))}function ee(a){const e=z.c(46),{open:s,onOpenChange:l}=a,n=A();let i;e[0]!==s?(i={fast:s},e[0]=s,e[1]=i):i=e[1];const o=P(i),[N,M]=_.useState(!1);let r,d,m,p,x,u,h,f;if(e[2]!==o.hostname||e[3]!==o.machineId||e[4]!==o.online||e[5]!==l||e[6]!==s||e[7]!==n){const c=o.hostname??o.machineId??n("chat.connectDesktopDialog.yourDesktop");p=E,h=s,f=l,m=R,u="sm:max-w-md",d=O,r=H,x=o.online?n("chat.connectDesktopDialog.connectedTo",{desktopName:c}):n("chat.connectDesktopDialog.connectYourDesktop"),e[2]=o.hostname,e[3]=o.machineId,e[4]=o.online,e[5]=l,e[6]=s,e[7]=n,e[8]=r,e[9]=d,e[10]=m,e[11]=p,e[12]=x,e[13]=u,e[14]=h,e[15]=f}else r=e[8],d=e[9],m=e[10],p=e[11],x=e[12],u=e[13],h=e[14],f=e[15];let g;e[16]!==r||e[17]!==x?(g=t.jsx(r,{children:x}),e[16]=r,e[17]=x,e[18]=g):g=e[18];let D;e[19]!==o.online||e[20]!==n?(D=o.online?n("chat.connectDesktopDialog.machineAgentsDescription"):n("chat.connectDesktopDialog.runCommandDescription"),e[19]=o.online,e[20]=n,e[21]=D):D=e[21];let b;e[22]!==D?(b=t.jsx($,{children:D}),e[22]=D,e[23]=b):b=e[23];let j;e[24]!==d||e[25]!==g||e[26]!==b?(j=t.jsxs(d,{children:[g,b]}),e[24]=d,e[25]=g,e[26]=b,e[27]=j):j=e[27];let k;e[28]!==N||e[29]!==o.online?(k=!o.online&&t.jsxs("div",{className:"flex items-center gap-2 rounded-md bg-muted px-3 py-2 font-mono text-sm",children:[t.jsx("span",{className:"flex-1",children:T}),t.jsx(B,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>{navigator.clipboard.writeText(T).then(()=>{M(!0),setTimeout(()=>M(!1),1500)})},children:N?t.jsx(G,{size:14}):t.jsx(W,{size:14})})]}),e[28]=N,e[29]=o.online,e[30]=k):k=e[30];let C;e[31]!==o.capabilities||e[32]!==o.online||e[33]!==n?(C=o.online?t.jsx("div",{className:"flex flex-col gap-3 text-sm",children:t.jsx("div",{className:"flex flex-col gap-2",children:K.map(c=>{const y=o.capabilities.includes(c.capability);return t.jsxs("div",{className:w("flex items-center gap-3 rounded-md border px-3 py-2",y?"border-border bg-background text-foreground":"border-border/60 bg-muted/40 text-muted-foreground"),children:[t.jsx("div",{className:w("flex size-6 items-center justify-center",y?"text-foreground":"text-muted-foreground"),children:c.icon}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("p",{className:"font-medium",children:n(c.labelKey)}),t.jsx("p",{className:"text-xs text-muted-foreground",children:n(y?c.descriptionKey:"chat.connectDesktopDialog.notDetected")})]}),t.jsx("span",{className:w("size-2 rounded-full",y?"bg-success":"bg-muted-foreground/30")})]},c.capability)})})}):t.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[t.jsx(F,{size:"sm"}),n("chat.connectDesktopDialog.waitingForDesktop")]}),e[31]=o.capabilities,e[32]=o.online,e[33]=n,e[34]=C):C=e[34];let L;e[35]!==m||e[36]!==k||e[37]!==C||e[38]!==u||e[39]!==j?(L=t.jsxs(m,{className:u,children:[j,k,C]}),e[35]=m,e[36]=k,e[37]=C,e[38]=u,e[39]=j,e[40]=L):L=e[40];let v;return e[41]!==p||e[42]!==L||e[43]!==h||e[44]!==f?(v=t.jsx(p,{open:h,onOpenChange:f,children:L}),e[41]=p,e[42]=L,e[43]=h,e[44]=f,e[45]=v):v=e[45],v}export{ee as C,I as a,S as b,X as l,Z as v};