decocms 4.92.3 → 4.93.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 (274) hide show
  1. package/dist/client/assets/{AlertCircle-B9GlbKHh.js → AlertCircle-Njhn01cX.js} +1 -1
  2. package/dist/client/assets/{AreaChart-DHN9bK0l.js → AreaChart-DRbAqxKW.js} +1 -1
  3. package/dist/client/assets/ArrowRight-esEXrLxn.js +1 -0
  4. package/dist/client/assets/{ArrowUp-DNZsq7Zt.js → ArrowUp-DxvzPWYP.js} +1 -1
  5. package/dist/client/assets/{ArrowUpRight-DZZygrAi.js → ArrowUpRight-CxuPu6Tj.js} +1 -1
  6. package/dist/client/assets/Check-C8xezRP_.js +1 -0
  7. package/dist/client/assets/{CheckCircle-BEcdXH7-.js → CheckCircle-BQxAiBVq.js} +1 -1
  8. package/dist/client/assets/{ChevronDown-BSRiDjXd.js → ChevronDown-DnZfSUpf.js} +1 -1
  9. package/dist/client/assets/{ChevronRight-YmTewr_B.js → ChevronRight-DsMfUSaC.js} +1 -1
  10. package/dist/client/assets/ChevronUp-DGO207B8.js +1 -0
  11. package/dist/client/assets/{Copy01-BkGYkmm-.js → Copy01-BvTvgPMW.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-BmTi7wpl.js → DotsVertical-Cpk8Ctc8.js} +1 -1
  13. package/dist/client/assets/{Eye-B-ZfWIGj.js → Eye-BsbSF6dM.js} +1 -1
  14. package/dist/client/assets/{FilterLines-BwWG7tAk.js → FilterLines-DBjnKQVG.js} +1 -1
  15. package/dist/client/assets/{Globe01-D3vBqhI7.js → Globe01-QTXFA3Hg.js} +1 -1
  16. package/dist/client/assets/{Globe04-pvxBukgJ.js → Globe04-Dpy9nX58.js} +1 -1
  17. package/dist/client/assets/{HardDrive-DutZPQFL.js → HardDrive-B9qgGqhY.js} +1 -1
  18. package/dist/client/assets/{Image01-PIeYnf-K.js → Image01-CMr6OOW9.js} +1 -1
  19. package/dist/client/assets/{Key01-DhLD806C.js → Key01-uLXewYdO.js} +1 -1
  20. package/dist/client/assets/{LayoutLeft-BI-sXAac.js → LayoutLeft-tArvHAmP.js} +1 -1
  21. package/dist/client/assets/{LinkExternal01-DO3QnLus.js → LinkExternal01-DXy81AX9.js} +1 -1
  22. package/dist/client/assets/{Monitor01-BOILvS2u.js → Monitor01-XHtWWQke.js} +1 -1
  23. package/dist/client/assets/{Package-DbEcG94t.js → Package-B0zWER5V.js} +1 -1
  24. package/dist/client/assets/{Palette-CyZvWKmI.js → Palette-00Ixb1J1.js} +1 -1
  25. package/dist/client/assets/{Play-B8fWmOst.js → Play-CzcsEB-0.js} +1 -1
  26. package/dist/client/assets/{Plus-2c1jULco.js → Plus-edG6Flwm.js} +1 -1
  27. package/dist/client/assets/{SearchLg-XmvudKlH.js → SearchLg-BZaz6095.js} +1 -1
  28. package/dist/client/assets/{SearchMd-lwIiBODG.js → SearchMd-CCfeLY5x.js} +1 -1
  29. package/dist/client/assets/{Settings02-DMpqOK24.js → Settings02-Bx_qgDLp.js} +1 -1
  30. package/dist/client/assets/{Shield01-gTFc9c17.js → Shield01-BiDz13pn.js} +1 -1
  31. package/dist/client/assets/{Star01-DoUbKevt.js → Star01-8Dyem59l.js} +1 -1
  32. package/dist/client/assets/{Stars01-CJsm_THn.js → Stars01-3-zqXKvS.js} +1 -1
  33. package/dist/client/assets/{Stars02-B08FvcHQ.js → Stars02-BQXVdDN3.js} +1 -1
  34. package/dist/client/assets/{Sun-nDXz4jeM.js → Sun-CB79h_pC.js} +1 -1
  35. package/dist/client/assets/{SwitchHorizontal01-Rgis0XWf.js → SwitchHorizontal01-BvyA4hac.js} +1 -1
  36. package/dist/client/assets/{Tool01-BR3IBeV9.js → Tool01-B13YSnrO.js} +1 -1
  37. package/dist/client/assets/{Tool02-B0-a0UMl.js → Tool02-egoF7acO.js} +1 -1
  38. package/dist/client/assets/{Trash01-Ba6bCbNY.js → Trash01-DLyQDi2Y.js} +1 -1
  39. package/dist/client/assets/{TrendUp01-CeRF_789.js → TrendUp01-B_4HE6HC.js} +1 -1
  40. package/dist/client/assets/{Upload01-B14IruoN.js → Upload01-C-fdZkjY.js} +1 -1
  41. package/dist/client/assets/{User01-ByIE6k8L.js → User01-ndlF2LEv.js} +1 -1
  42. package/dist/client/assets/{Users01-BdldAr7H.js → Users01-BRUbM3mR.js} +1 -1
  43. package/dist/client/assets/{Users03-Bx4g7VTC.js → Users03-D_q12QHD.js} +1 -1
  44. package/dist/client/assets/{X-Dif5I5BD.js → X-BLwtZL0s.js} +1 -1
  45. package/dist/client/assets/XCircle-DHvjqByD.js +1 -0
  46. package/dist/client/assets/{XClose-DomD4542.js → XClose-CeJxo_5O.js} +1 -1
  47. package/dist/client/assets/{Zap-CEUVQQOc.js → Zap-Biv_hWgJ.js} +1 -1
  48. package/dist/client/assets/{ZapSquare-EvC2T9CP.js → ZapSquare-CUzmnXYD.js} +1 -1
  49. package/dist/client/assets/{ZoomOut-BprgOfkE.js → ZoomOut-BtlatfMa.js} +1 -1
  50. package/dist/client/assets/{access-gate-NCJKEJqO.js → access-gate-DlRgf45B.js} +1 -1
  51. package/dist/client/assets/add-section-modal-Cnzkvby6.js +1 -0
  52. package/dist/client/assets/agent-icon-DpP8KzFU.js +1 -0
  53. package/dist/client/assets/agents-list-DvnAEWGc.js +1 -0
  54. package/dist/client/assets/ai-providers-CDx5RbfA.js +1 -0
  55. package/dist/client/assets/{alert-C_4AvGUo.js → alert-DiBfJ3z6.js} +1 -1
  56. package/dist/client/assets/{alert-dialog-DDtUbhoS.js → alert-dialog-BnLog6BT.js} +2 -2
  57. package/dist/client/assets/app-editor-DTp5bYYF.js +1 -0
  58. package/dist/client/assets/{auth-CsHQFHV_.js → auth-CmoeLSjh.js} +1 -1
  59. package/dist/client/assets/{auth-catchall-_TQy6GDd.js → auth-catchall-CyJqULXt.js} +1 -1
  60. package/dist/client/assets/{auth-entry-_ePf9_J1.js → auth-entry-oOVL70ba.js} +1 -1
  61. package/dist/client/assets/{auth-split-layout-D9UYTbxy.js → auth-split-layout-BCda3jzi.js} +1 -1
  62. package/dist/client/assets/{authenticate-and-persist-oauth-CEv4KtcH.js → authenticate-and-persist-oauth-CJ808iDy.js} +1 -1
  63. package/dist/client/assets/{automation-list-row-CyDHI_uf.js → automation-list-row-BZr8L7Uh.js} +1 -1
  64. package/dist/client/assets/{automation-runs-D8v8nlly.js → automation-runs-DS0XzTMW.js} +5 -5
  65. package/dist/client/assets/automations-BrHkbwwm.js +1 -0
  66. package/dist/client/assets/{autosend-BgYoPuWD.js → autosend-CQ-47-85.js} +1 -1
  67. package/dist/client/assets/{avatar-BVdHZbMN.js → avatar-CGcwSkmr.js} +1 -1
  68. package/dist/client/assets/{badge-C_9mnuBd.js → badge-BUVU0rMR.js} +1 -1
  69. package/dist/client/assets/{block-document-CcMdXbqY.js → block-document-B2r_hLd8.js} +1 -1
  70. package/dist/client/assets/{brand-context-B-nZCoNx.js → brand-context-Bpk1Tuz_.js} +1 -1
  71. package/dist/client/assets/buckets-Ba5z9iiC.js +1 -0
  72. package/dist/client/assets/bulk-category-panel-i79BTudx.js +1 -0
  73. package/dist/client/assets/{calendar-Bxkf6gvE.js → calendar-COt9TyKT.js} +1 -1
  74. package/dist/client/assets/{capability-load-error-i6NCyxxk.js → capability-load-error-DOgFzcPM.js} +1 -1
  75. package/dist/client/assets/{card-C3gg1LtP.js → card-BoM9PVle.js} +1 -1
  76. package/dist/client/assets/category-editor-CZOD4Saa.js +1 -0
  77. package/dist/client/assets/{chat-context-DSveBxCg.js → chat-context-B5VF42iB.js} +7 -7
  78. package/dist/client/assets/checkbox-8MRm635N.js +1 -0
  79. package/dist/client/assets/{cli-auth-success-Cc2B25iW.js → cli-auth-success-CTl9Esai.js} +1 -1
  80. package/dist/client/assets/collection-detail-JnTCc17l.js +1 -0
  81. package/dist/client/assets/collection-display-button-DZt1zLnf.js +1 -0
  82. package/dist/client/assets/{collection-search-TcSAZpqK.js → collection-search-3CKEWWZt.js} +1 -1
  83. package/dist/client/assets/{collection-table-wrapper-H4bzUKoO.js → collection-table-wrapper-D20SVTuI.js} +1 -1
  84. package/dist/client/assets/{collection-tabs-CIRa_M2W.js → collection-tabs-8kNejI0g.js} +1 -1
  85. package/dist/client/assets/{command-3z1R7bvy.js → command-BEYKuuWi.js} +1 -1
  86. package/dist/client/assets/commerce-onboarding-eKB7r6Ch.js +1 -0
  87. package/dist/client/assets/{companions-core-C68sN4Wc.js → companions-core-C3_LmblJ.js} +1 -1
  88. package/dist/client/assets/connect-DT6CnTMJ.js +8 -0
  89. package/dist/client/assets/connect-desktop-dialog-DwQ8Mjza.js +1 -0
  90. package/dist/client/assets/{connection-card-D_K36Swx.js → connection-card-WnbGcpbb.js} +1 -1
  91. package/dist/client/assets/connection-detail-Dd3EkXAN.js +1 -0
  92. package/dist/client/assets/{connection-form-helpers-DyOAEqE9.js → connection-form-helpers-BCcxv-0Z.js} +1 -1
  93. package/dist/client/assets/connections-CfhypjVY.js +1 -0
  94. package/dist/client/assets/{decopilot-sse-pool-CEQrv8Fn.js → decopilot-sse-pool-SXkhxj1m.js} +1 -1
  95. package/dist/client/assets/{dialog-DUqhzGiD.js → dialog-CV70WKsd.js} +1 -1
  96. package/dist/client/assets/{domain-settings-CRIqu0Bs.js → domain-settings-BwZkfjuf.js} +1 -1
  97. package/dist/client/assets/{drawer-DvhdIHph.js → drawer-DjOdYDA9.js} +1 -1
  98. package/dist/client/assets/dropdown-menu-mvaVV4Vk.js +1 -0
  99. package/dist/client/assets/{empty-state-BHuw6cM9.js → empty-state-DXghlCSF.js} +1 -1
  100. package/dist/client/assets/{extract-connection-data-_NDoBHMa.js → extract-connection-data-JVWAWvFf.js} +1 -1
  101. package/dist/client/assets/file-explorer-BHCYY9cJ.js +2 -0
  102. package/dist/client/assets/{file-type-icon-BOCZKON3.js → file-type-icon-CZv5YRkA.js} +1 -1
  103. package/dist/client/assets/{files-CelFf8dg.js → files-CxsC_UPe.js} +1 -1
  104. package/dist/client/assets/{form-C9InGmo4.js → form-DQ-7zIby.js} +1 -1
  105. package/dist/client/assets/general-CrovKb2x.js +1 -0
  106. package/dist/client/assets/{github-repo-picker-Biy9UFu8.js → github-repo-picker-BfsQbNwu.js} +1 -1
  107. package/dist/client/assets/{hooks-DU-2h9eZ.js → hooks-DQwk0XaJ.js} +1 -1
  108. package/dist/client/assets/{index-DnrPO2j2.js → index-4lUYXs_O.js} +1 -1
  109. package/dist/client/assets/{index-DivFugQC.js → index-9nw_Dv5I.js} +1 -1
  110. package/dist/client/assets/index-B7jBuFkn.css +1 -0
  111. package/dist/client/assets/{index-CbhDnqOu.js → index-BCiQIrz6.js} +1 -1
  112. package/dist/client/assets/index-C4jaN42X.js +2 -0
  113. package/dist/client/assets/{index-Du80fsxC.js → index-CF-xkULI.js} +5 -5
  114. package/dist/client/assets/{index-DBhNC4I_.js → index-COh-8QN3.js} +1 -1
  115. package/dist/client/assets/index-CSe3WpII.js +1 -0
  116. package/dist/client/assets/{index-BOgwoJjn.js → index-CdbTrQGO.js} +1 -1
  117. package/dist/client/assets/{index-CO3868Cu.js → index-Ckjl1Fry.js} +1 -1
  118. package/dist/client/assets/{index-Cs6hIS7C.js → index-Csozlno7.js} +3 -3
  119. package/dist/client/assets/index-DZseYmOn.js +1 -0
  120. package/dist/client/assets/{index-nNhZx5bw.js → index-G0zgTDdu.js} +14 -14
  121. package/dist/client/assets/{index-f6gbzJ8b.js → index-KNJ3OCd2.js} +1 -1
  122. package/dist/client/assets/{index-DmhdwAgP.js → index-cMDjfUVQ.js} +14 -14
  123. package/dist/client/assets/{index-redirect-hJFu02mm.js → index-redirect-D10_sM2p.js} +1 -1
  124. package/dist/client/assets/{input-TkvVVsQL.js → input-ChzvExXm.js} +1 -1
  125. package/dist/client/assets/{integration-icon-CWb3OXTV.js → integration-icon-Bhn0_xtP.js} +1 -1
  126. package/dist/client/assets/{invite-member-dialog-BA1mFY2X.js → invite-member-dialog-SQrGzC-z.js} +1 -1
  127. package/dist/client/assets/{label-CB2o7dZ2.js → label-CuJFo9yJ.js} +1 -1
  128. package/dist/client/assets/{layout-CqMMMVMm.js → layout-CwrVNWCG.js} +1 -1
  129. package/dist/client/assets/{login-B0EX352Z.js → login-C7gBuFYu.js} +1 -1
  130. package/dist/client/assets/{mcp-oauth-B5rKpHdd.js → mcp-oauth-BVO-f6t7.js} +1 -1
  131. package/dist/client/assets/members-Dlx5k3-8.js +1 -0
  132. package/dist/client/assets/{monaco-editor-DfuNvLfy.js → monaco-editor-CjU5L-zs.js} +1 -1
  133. package/dist/client/assets/{monitoring-stats-row-B43TP1bq.js → monitoring-stats-row-B9gtpPq-.js} +1 -1
  134. package/dist/client/assets/{multi-select-DhXl88EK.js → multi-select-De7VgXHU.js} +1 -1
  135. package/dist/client/assets/{oauth-callback-ai-provider-BiKjtCpj.js → oauth-callback-ai-provider-UmcAlyJ2.js} +1 -1
  136. package/dist/client/assets/{oauth-callback-CZ8I3e9V.js → oauth-callback-w52ryAZO.js} +1 -1
  137. package/dist/client/assets/{onboarding-U4YqP9I9.js → onboarding-BBWoRpXr.js} +1 -1
  138. package/dist/client/assets/{org-install-BYDat95r.js → org-install-ml9Q1TCX.js} +1 -1
  139. package/dist/client/assets/{org-layout-CVqWtNQa.js → org-layout-DmAo9qk4.js} +1 -1
  140. package/dist/client/assets/{organization-choice-CkG6QFWH.js → organization-choice-5F6o2RZD.js} +1 -1
  141. package/dist/client/assets/orgs-j7U5FSTV.js +1 -0
  142. package/dist/client/assets/{page-seo-form-8ToiuKnD.js → page-seo-form-CTnrck0_.js} +1 -1
  143. package/dist/client/assets/page-seo-sheet-fmIm-MrR.js +1 -0
  144. package/dist/client/assets/{popover-DwV6WXHS.js → popover-1mcOD1Dn.js} +1 -1
  145. package/dist/client/assets/post-editor-Dv_wlt7_.js +1 -0
  146. package/dist/client/assets/{primitives-RdkZFzQM.js → primitives-BaeBEsVv.js} +1 -1
  147. package/dist/client/assets/profile-CTuz7Go7.js +1 -0
  148. package/dist/client/assets/project-app-view-BtXFxvLq.js +1 -0
  149. package/dist/client/assets/record-editor-ZKO7gQiD.js +1 -0
  150. package/dist/client/assets/redirect-editor-qRjlDXct.js +1 -0
  151. package/dist/client/assets/registry-DtoSMqLy.js +2 -0
  152. package/dist/client/assets/{registry-layout-C2NoRJs0.js → registry-layout-WEtqp3AF.js} +3 -3
  153. package/dist/client/assets/{reports-J4B5GOoc.js → reports-CpbSj3oU.js} +2 -2
  154. package/dist/client/assets/{require-capability-DnfzULDW.js → require-capability-DF8ibYEg.js} +1 -1
  155. package/dist/client/assets/{required-auth-layout-ABsqitxw.js → required-auth-layout-rQ3tDKtk.js} +1 -1
  156. package/dist/client/assets/{reset-password-CbrThkFS.js → reset-password-D7FhrF53.js} +1 -1
  157. package/dist/client/assets/roles-BsYIEd1e.js +1 -0
  158. package/dist/client/assets/{search-input-B-RkAjzQ.js → search-input-75Re6Uqa.js} +1 -1
  159. package/dist/client/assets/secrets-B8bCoicB.js +1 -0
  160. package/dist/client/assets/{sections-editor-BW9cZUKJ.js → sections-editor-CM3ROkK7.js} +2 -2
  161. package/dist/client/assets/{select-model-BAk08l-M.js → select-model-CvnCrbwF.js} +1 -1
  162. package/dist/client/assets/select-sG3MQo05.js +1 -0
  163. package/dist/client/assets/self-tool-result-DR1KhJAE.js +1 -0
  164. package/dist/client/assets/seo-editor-Dz2QCY6k.js +1 -0
  165. package/dist/client/assets/settings-layout-rnH8GMkk.js +1 -0
  166. package/dist/client/assets/{settings-section-CNVe03BK.js → settings-section-DAwHE86q.js} +1 -1
  167. package/dist/client/assets/{shell-controls-5d4ZCRmi.js → shell-controls-Ck0Rc32A.js} +1 -1
  168. package/dist/client/assets/{shell-layout-6KUu0MA6.js → shell-layout-BXBrTj2H.js} +1 -1
  169. package/dist/client/assets/{sidebar-DnKMI8jz.js → sidebar-CCj6ri6x.js} +1 -1
  170. package/dist/client/assets/{skeleton-xDZ5Iwb8.js → skeleton-CoquA_ea.js} +1 -1
  171. package/dist/client/assets/sso-BOWh8JUl.js +1 -0
  172. package/dist/client/assets/store-registry-3_Y48Wu9.js +2 -0
  173. package/dist/client/assets/{store-BoCHTDSB.js → store-tszIV4qx.js} +1 -1
  174. package/dist/client/assets/{studio-tools-DIWsVaKg.js → studio-tools-Cet6XIhz.js} +1 -1
  175. package/dist/client/assets/{switch-DS9vYGS-.js → switch-DuPEp97y.js} +1 -1
  176. package/dist/client/assets/{table-DnoPpUup.js → table-LpLpROAI.js} +1 -1
  177. package/dist/client/assets/{tabs-2srR2H7A.js → tabs-CmiAgAjG.js} +1 -1
  178. package/dist/client/assets/{textarea-DjtAtA2l.js → textarea-CnNzHRRt.js} +1 -1
  179. package/dist/client/assets/{toggle-group-DGvoaiio.js → toggle-group-CKOvvRSl.js} +1 -1
  180. package/dist/client/assets/{toolbar-icon-button-Cr-N30KB.js → toolbar-icon-button-D8Ebc4H2.js} +1 -1
  181. package/dist/client/assets/{toolbar-CvkbyWaX.js → toolbar-uJC2H1eB.js} +1 -1
  182. package/dist/client/assets/{tooltip-cvFTpZ9W.js → tooltip-OGhXfeBg.js} +1 -1
  183. package/dist/client/assets/{use-ai-providers-ZLuBEaKb.js → use-ai-providers-BEU7q_EV.js} +1 -1
  184. package/dist/client/assets/use-api-keys-Bv4LYzyW.js +1 -0
  185. package/dist/client/assets/{use-automations-COcieFX-.js → use-automations-3WBbPXBU.js} +1 -1
  186. package/dist/client/assets/{use-autosave-C46oRXRb.js → use-autosave-GvQRDmC-.js} +1 -1
  187. package/dist/client/assets/{use-capability-3dRU8tE2.js → use-capability-RkVuWZII.js} +1 -1
  188. package/dist/client/assets/{use-clock-tick-BzcS25hV.js → use-clock-tick-CVs1XDyl.js} +1 -1
  189. package/dist/client/assets/{use-collections-DaXoNaLL.js → use-collections-DR_d-Teb.js} +1 -1
  190. package/dist/client/assets/{use-connection-DM1ROgj3.js → use-connection-CwuiKrFd.js} +1 -1
  191. package/dist/client/assets/{use-copy-DC217syR.js → use-copy-B6IC0gpM.js} +1 -1
  192. package/dist/client/assets/{use-create-virtual-mcp-Clu62lnk.js → use-create-virtual-mcp-sGGDSwNA.js} +1 -1
  193. package/dist/client/assets/{use-debounced-autosave-DYog9M6N.js → use-debounced-autosave-BwK3M221.js} +1 -1
  194. package/dist/client/assets/{use-debounced-value-CSp0_yRg.js → use-debounced-value-DLpyoptp.js} +1 -1
  195. package/dist/client/assets/use-deco-credits-q4i1Uz5r.js +1 -0
  196. package/dist/client/assets/{use-decopilot-events-CX_EuT5c.js → use-decopilot-events-BWABMe_S.js} +1 -1
  197. package/dist/client/assets/{use-delete-connection-CxGr7t4A.js → use-delete-connection-CzZLtWQx.js} +1 -1
  198. package/dist/client/assets/{use-deployment-admin-C6-1CBki.js → use-deployment-admin-CMiQgY9e.js} +1 -1
  199. package/dist/client/assets/{use-file-configs-DASxzk9O.js → use-file-configs-DzR4CKUR.js} +1 -1
  200. package/dist/client/assets/{use-infinite-scroll-XidGSyic.js → use-infinite-scroll-7EbHWl5i.js} +1 -1
  201. package/dist/client/assets/{use-join-requests-CjypbTMc.js → use-join-requests-DGeGKSqv.js} +1 -1
  202. package/dist/client/assets/{use-mcp-auth-status-BpAt0IbR.js → use-mcp-auth-status-Dc0BBxuQ.js} +1 -1
  203. package/dist/client/assets/{use-mcp-client-DseZ3Mea.js → use-mcp-client-CX21NflZ.js} +4 -4
  204. package/dist/client/assets/{use-mcp-tools-DJGNLf9H.js → use-mcp-tools-BsmNzwNJ.js} +1 -1
  205. package/dist/client/assets/{use-members-CncY3QG2.js → use-members-Dg0Z4TCy.js} +1 -1
  206. package/dist/client/assets/{use-mobile-D8w2xyip.js → use-mobile-iuGXq52B.js} +1 -1
  207. package/dist/client/assets/{use-navigate-to-agent-YScxPu5L.js → use-navigate-to-agent-BGBWLfKe.js} +1 -1
  208. package/dist/client/assets/{use-org-auth-client-DjREcL_I.js → use-org-auth-client-BWQzTMi-.js} +1 -1
  209. package/dist/client/assets/{use-org-sso-diAgeADE.js → use-org-sso-C0w-Y45A.js} +1 -1
  210. package/dist/client/assets/{use-organization-roles-BuFi-QNO.js → use-organization-roles-3XOjGEsU.js} +1 -1
  211. package/dist/client/assets/{use-organization-settings-bBY4klS6.js → use-organization-settings-DVcDvmS7.js} +1 -1
  212. package/dist/client/assets/{use-registry-app-Cy7ipz7c.js → use-registry-app-9JpMfNFa.js} +1 -1
  213. package/dist/client/assets/{use-registry-connections-BZ0Z0jCg.js → use-registry-connections-hPmj3HSR.js} +1 -1
  214. package/dist/client/assets/{use-secrets-q_kPvC5B.js → use-secrets-BlieysxK.js} +1 -1
  215. package/dist/client/assets/{use-status-sounds-DG0Zyz9B.js → use-status-sounds-B7xlxGt9.js} +1 -1
  216. package/dist/client/assets/{use-t-BjZG1zRp.js → use-t-DpDrKRdg.js} +1 -1
  217. package/dist/client/assets/{use-view-mode-B02hzmMj.js → use-view-mode-DjI_33ML.js} +1 -1
  218. package/dist/client/assets/{use-virtual-mcp-urYy02xb.js → use-virtual-mcp-CMX7Masu.js} +1 -1
  219. package/dist/client/assets/useInfiniteQuery-BtjzjNju.js +1 -0
  220. package/dist/client/assets/{useRouterState-C7tRHRC7.js → useRouterState-BtVYUlaA.js} +1 -1
  221. package/dist/client/assets/useSuspenseInfiniteQuery-DzpLVyna.js +1 -0
  222. package/dist/client/assets/{users-CZVOiXsq.js → users-B-S76Gnf.js} +1 -1
  223. package/dist/client/assets/variant-calendar-C5Z-PHCg.js +1 -0
  224. package/dist/client/assets/{view-mode-toggle-DziN7a9n.js → view-mode-toggle-DT808FUj.js} +1 -1
  225. package/dist/client/index.html +2 -2
  226. package/dist/server/cli.js +488 -488
  227. package/dist/server/server.js +313 -313
  228. package/package.json +1 -1
  229. package/dist/client/assets/ChevronUp-D5F6V6Tm.js +0 -1
  230. package/dist/client/assets/XCircle-C0OdV3N_.js +0 -1
  231. package/dist/client/assets/add-section-modal-DBjaDtzc.js +0 -1
  232. package/dist/client/assets/agent-icon-DicjSkHu.js +0 -1
  233. package/dist/client/assets/agents-list-Bt1R4ueI.js +0 -1
  234. package/dist/client/assets/ai-providers-TK1CCOpK.js +0 -1
  235. package/dist/client/assets/app-editor-ptKJtHHM.js +0 -1
  236. package/dist/client/assets/automations-BoSNNWPc.js +0 -1
  237. package/dist/client/assets/buckets-DcRE1RUQ.js +0 -1
  238. package/dist/client/assets/bulk-category-panel-BkJQrEio.js +0 -1
  239. package/dist/client/assets/category-editor-CaGAyBNX.js +0 -1
  240. package/dist/client/assets/checkbox-Ba2-hx8r.js +0 -1
  241. package/dist/client/assets/collection-detail-D9ZCPDhA.js +0 -1
  242. package/dist/client/assets/collection-display-button-D_kIgil2.js +0 -1
  243. package/dist/client/assets/commerce-onboarding-DbQ0hYyA.js +0 -1
  244. package/dist/client/assets/connect-desktop-dialog-DEEL81vf.js +0 -1
  245. package/dist/client/assets/connection-detail-CKGrDl_p.js +0 -1
  246. package/dist/client/assets/connections-BJO0R_-8.js +0 -1
  247. package/dist/client/assets/dropdown-menu-D5BTIZvH.js +0 -1
  248. package/dist/client/assets/file-explorer-CUr9mfMv.js +0 -2
  249. package/dist/client/assets/general-DlHL1tW3.js +0 -1
  250. package/dist/client/assets/index-629FAmzK.js +0 -1
  251. package/dist/client/assets/index-BQK4XWOD.js +0 -2
  252. package/dist/client/assets/index-Cb_X1LK0.js +0 -1
  253. package/dist/client/assets/index-oE__K1ye.css +0 -1
  254. package/dist/client/assets/members-Ds_Onv02.js +0 -1
  255. package/dist/client/assets/orgs-B4DrO8iC.js +0 -1
  256. package/dist/client/assets/page-seo-sheet-BTyypxho.js +0 -1
  257. package/dist/client/assets/post-editor-j9JAXwQN.js +0 -1
  258. package/dist/client/assets/profile-DwVJzm_R.js +0 -1
  259. package/dist/client/assets/project-app-view-e40sJb24.js +0 -1
  260. package/dist/client/assets/record-editor-BBPLTix7.js +0 -1
  261. package/dist/client/assets/redirect-editor-C8EDxpmx.js +0 -1
  262. package/dist/client/assets/registry-CFSvMZwJ.js +0 -2
  263. package/dist/client/assets/roles-BqueMkJJ.js +0 -1
  264. package/dist/client/assets/secrets-CEZOniOS.js +0 -1
  265. package/dist/client/assets/select-AzuoAc3H.js +0 -1
  266. package/dist/client/assets/self-tool-result-C94YNykg.js +0 -1
  267. package/dist/client/assets/seo-editor-CR8P7sfk.js +0 -1
  268. package/dist/client/assets/settings-layout-9yQD_m0n.js +0 -1
  269. package/dist/client/assets/sso-DNsZ7Hie.js +0 -1
  270. package/dist/client/assets/store-registry-WZUtBjlh.js +0 -2
  271. package/dist/client/assets/use-deco-credits-Bm6Hzrca.js +0 -1
  272. package/dist/client/assets/useInfiniteQuery-nK_JPgM8.js +0 -1
  273. package/dist/client/assets/useSuspenseInfiniteQuery-_ObcRUnC.js +0 -1
  274. package/dist/client/assets/variant-calendar-DibyF3zD.js +0 -1
@@ -1 +0,0 @@
1
- import{c as ie,j as s,B as J,C as ce,n as fe,a as he,r as K,m as ge,K as ee,d as xe,p as $,t as te,l as je}from"./index-DmhdwAgP.js";import{d as Y,c as de,a as se,D as oe}from"./dropdown-menu-D5BTIZvH.js";import{a as be}from"./Users03-Bx4g7VTC.js";import{G as me}from"./use-registry-app-Cy7ipz7c.js";import{u as Ce,b as ye,c as we}from"./use-virtual-mcp-urYy02xb.js";import{P as X}from"./index-DBhNC4I_.js";import{i as _e}from"./DotsVertical-BmTi7wpl.js";import{a as Ne,b as Se}from"./Settings02-DMpqOK24.js";import{s as ve}from"./Trash01-Ba6bCbNY.js";import{A as Ie,aK as De}from"./agent-icon-DicjSkHu.js";import{c as ue}from"./use-navigate-to-agent-YScxPu5L.js";import{C as Ae}from"./card-C3gg1LtP.js";import{f as ne}from"./formatDistanceToNow-Cb2QZZJn.js";import{u as Ee}from"./use-capability-3dRU8tE2.js";import{E as Te}from"./empty-state-BHuw6cM9.js";import{u as ke}from"./use-create-virtual-mcp-Clu62lnk.js";import{u as Ge}from"./use-connection-DM1ROgj3.js";import{u as re,S as Le}from"./use-mcp-client-DseZ3Mea.js";import{u as Oe,G as Pe}from"./github-repo-picker-Biy9UFu8.js";import{g as ze}from"./github-repo-scope-DjMZbiKa.js";import{f as Me,a as $e,p as He}from"./provision-repo-scoped-github-connection-2iDn-wQ1.js";import{e as Fe,d as Re,D as Ue,a as Be,c as Ve}from"./dialog-DUqhzGiD.js";import{C as Ke}from"./collection-search-TcSAZpqK.js";import{c as qe,b as Qe,d as Je,A as We,e as Ye,g as Xe,a as Ze,f as et}from"./alert-dialog-DDtUbhoS.js";import{S as tt}from"./search-input-B-RkAjzQ.js";import{s as le}from"./Plus-2c1jULco.js";import"./ChevronUp-D5F6V6Tm.js";import"./ChevronRight-YmTewr_B.js";import"./use-mcp-tools-DJGNLf9H.js";import"./use-collections-DaXoNaLL.js";import"./sidebar-DnKMI8jz.js";import"./LayoutLeft-BI-sXAac.js";import"./use-mobile-D8w2xyip.js";import"./X-Dif5I5BD.js";import"./tooltip-cvFTpZ9W.js";import"./AlertCircle-B9GlbKHh.js";import"./Tool01-BR3IBeV9.js";import"./ArrowUp-DNZsq7Zt.js";import"./Tool02-B0-a0UMl.js";import"./XCircle-C0OdV3N_.js";import"./ArrowUpRight-DZZygrAi.js";import"./TrendUp01-CeRF_789.js";import"./ZapSquare-EvC2T9CP.js";import"./ZoomOut-BprgOfkE.js";import"./CheckCircle-BEcdXH7-.js";import"./ChevronDown-BSRiDjXd.js";import"./Stars02-B08FvcHQ.js";import"./Copy01-BkGYkmm-.js";import"./Globe01-D3vBqhI7.js";import"./Eye-B-ZfWIGj.js";import"./FilterLines-BwWG7tAk.js";import"./Star01-DoUbKevt.js";import"./Globe04-pvxBukgJ.js";import"./SwitchHorizontal01-Rgis0XWf.js";import"./HardDrive-DutZPQFL.js";import"./Image01-PIeYnf-K.js";import"./Key01-DhLD806C.js";import"./LinkExternal01-DO3QnLus.js";import"./Monitor01-BOILvS2u.js";import"./Sun-nDXz4jeM.js";import"./Package-DbEcG94t.js";import"./Palette-CyZvWKmI.js";import"./Play-B8fWmOst.js";import"./SearchLg-XmvudKlH.js";import"./SearchMd-lwIiBODG.js";import"./Shield01-gTFc9c17.js";import"./Stars01-CJsm_THn.js";import"./Upload01-B14IruoN.js";import"./User01-ByIE6k8L.js";import"./Users01-BdldAr7H.js";import"./XClose-DomD4542.js";import"./Zap-CEUVQQOc.js";import"./hooks-DU-2h9eZ.js";import"./decopilot-sse-pool-CEQrv8Fn.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./reusable-new-chat-CouMjkYR.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./auth-CsHQFHV_.js";import"./use-debounced-value-CSp0_yRg.js";import"./authenticate-and-persist-oauth-CEv4KtcH.js";import"./mcp-oauth-B5rKpHdd.js";import"./extract-connection-data-_NDoBHMa.js";function ae(t){const e=ie.c(19),{onCreateFromScratch:i,onImportGitHub:n,onImportDeco:l,isCreating:b,align:C,side:d,showBetaBadge:g}=t,y=C===void 0?"end":C;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(be,{size:14}),e[0]=x):x=e[0];let m;e[1]!==b||e[2]!==i?(m=s.jsxs(Y,{disabled:b,onClick:i,children:[x,"Create from scratch"]}),e[1]=b,e[2]=i,e[3]=m):m=e[3];let f;e[4]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(me,{className:"size-3.5"}),e[4]=f):f=e[4];let a;e[5]!==g?(a=g&&s.jsx("span",{className:"ml-auto text-[10px] font-medium text-muted-foreground bg-muted rounded px-1 py-0.5",children:"Beta"}),e[5]=g,e[6]=a):a=e[6];let h;e[7]!==n||e[8]!==a?(h=s.jsxs(Y,{onClick:n,children:[f,"Import from GitHub",a]}),e[7]=n,e[8]=a,e[9]=h):h=e[9];let c;e[10]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"deco.cx",className:"size-3.5"}),e[10]=c):c=e[10];let r;e[11]!==l?(r=s.jsxs(Y,{onClick:l,children:[c,"Import from deco.cx"]}),e[11]=l,e[12]=r):r=e[12];let u;return e[13]!==y||e[14]!==d||e[15]!==m||e[16]!==h||e[17]!==r?(u=s.jsxs(de,{side:d,align:y,className:"w-48",children:[m,h,r]}),e[13]=y,e[14]=d,e[15]=m,e[16]=h,e[17]=r,e[18]=u):u=e[18],u}function st(t){const e=ie.c(45),{project:i,lastUsedAt:n,onDeleteClick:l}=t,b=ue();let C;e[0]!==b||e[1]!==i.id?(C=()=>b(i.id),e[0]=b,e[1]=i.id,e[2]=C):C=e[2];let d;e[3]!==i.title||e[4]!==C?(d=s.jsx("button",{type:"button",onClick:C,className:"absolute inset-0 z-0","aria-label":i.title}),e[3]=i.title,e[4]=C,e[5]=d):d=e[5];let g;e[6]!==i.icon||e[7]!==i.title?(g=s.jsx(Ie,{icon:i.icon,name:i.title,size:"sm",className:"shrink-0 shadow-sm"}),e[6]=i.icon,e[7]=i.title,e[8]=g):g=e[8];let y;e[9]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(se,{asChild:!0,children:s.jsx(J,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:s.jsx(_e,{size:20})})}),e[9]=y):y=e[9];let x;e[10]!==b||e[11]!==i.id?(x=()=>b(i.id,{search:{main:"settings"}}),e[10]=b,e[11]=i.id,e[12]=x):x=e[12];let m;e[13]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(Ne,{size:16}),e[13]=m):m=e[13];let f;e[14]!==x?(f=s.jsxs(Y,{onClick:x,children:[m,"Settings"]}),e[14]=x,e[15]=f):f=e[15];let a;e[16]!==l?(a=l&&s.jsxs(Y,{variant:"destructive",onClick:G=>{G.stopPropagation(),l(G)},children:[s.jsx(ve,{size:16}),"Delete"]}),e[16]=l,e[17]=a):a=e[17];let h;e[18]!==f||e[19]!==a?(h=s.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:s.jsxs(oe,{children:[y,s.jsxs(de,{align:"end",children:[f,a]})]})}),e[18]=f,e[19]=a,e[20]=h):h=e[20];let c;e[21]!==g||e[22]!==h?(c=s.jsxs("div",{className:"flex items-start justify-between",children:[g,h]}),e[21]=g,e[22]=h,e[23]=c):c=e[23];let r;e[24]!==i.title?(r=s.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:i.title}),e[24]=i.title,e[25]=r):r=e[25];const u=i.description||"No description";let I;e[26]!==u?(I=s.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:u}),e[26]=u,e[27]=I):I=e[27];let D;e[28]!==r||e[29]!==I?(D=s.jsxs("div",{className:"flex flex-col gap-1",children:[r,I]}),e[28]=r,e[29]=I,e[30]=D):D=e[30];let w;e[31]!==c||e[32]!==D?(w=s.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[c,D]}),e[31]=c,e[32]=D,e[33]=w):w=e[33];let E;e[34]!==n||e[35]!==i.updated_at?(E=n?`Last used ${ne(new Date(n),{addSuffix:!0})}`:`Updated ${ne(new Date(i.updated_at),{addSuffix:!0})}`,e[34]=n,e[35]=i.updated_at,e[36]=E):E=e[36];let N;e[37]!==E?(N=s.jsx("div",{className:"border-t border-border mt-auto",children:s.jsx("div",{className:"h-10 flex items-center px-4.5",children:s.jsx("p",{className:"text-xs text-muted-foreground",children:E})})}),e[37]=E,e[38]=N):N=e[38];let T;e[39]!==w||e[40]!==N?(T=s.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[w,N]}),e[39]=w,e[40]=N,e[41]=T):T=e[41];let S;return e[42]!==T||e[43]!==d?(S=s.jsxs(Ae,{className:"relative transition-colors group overflow-hidden flex flex-col h-full hover:bg-muted/50",children:[d,T]}),e[42]=T,e[43]=d,e[44]=S):S=e[44],S}const ot="deco-sites";function it(t){if(!t||typeof t!="object")return null;const e=t.github;if(!e||typeof e!="object")return null;const i=e.owner,n=e.repo;return typeof i!="string"||typeof n!="string"||i.length===0||n.length===0?null:{owner:i,repo:n}}function nt(t,e){const i=e?it(e):null,n=i?.owner??ot,l=i?.repo??t;return{owner:n,name:l,url:`https://github.com/${n}/${l}`}}function rt(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}async function pe(t,e,i){const n=await fetch(t,e),l=await n.json().catch(()=>({}));if(!n.ok)throw new Error(l.error??`${i} (${n.status})`);return l}function lt(t){return pe(`/api/${t}/deco-sites`,void 0,"Failed to load sites")}function at({open:t,onOpenChange:e,onBack:i}){const{org:n}=ce(),l=ue(),b=fe(),{data:C}=he.useSession(),[d,g]=K.useState(null),[y,x]=K.useState(null),[m,f]=K.useState(""),a=re({connectionId:Le,orgId:n.id,orgSlug:n.slug}),h=Ge({slug:"mcp-github"}),c=ze(h),r=Oe({enabled:t&&c.length===0}),u=c.length===1?c[0]??null:y,I=c.length>1&&!u,D=re({connectionId:u?.id??"",orgId:n.id,orgSlug:n.slug}),w=t&&c.length===0&&(r.status==="installing"||r.status==="authenticating"||r.status==="idle"),{data:E,isLoading:N,error:T}=ge({queryKey:ee.decoSites(C?.user?.email),queryFn:()=>lt(n.slug),enabled:t&&!!C?.user?.email,staleTime:6e4,retry:!1}),S=E?.sites??[],G=o=>{o||(g(null),x(null),f("")),e(o)},P=S.filter(o=>o.name.toLowerCase().includes(m.toLowerCase())||(o.domains?.[0]?.domain?.toLowerCase().includes(m.toLowerCase())??!1)),R=!d||P.some(o=>o.name===d),L=xe({mutationFn:async o=>{if(!u)throw new Error("GitHub is not connected. Complete GitHub setup and try again.");$("deco_site_import_started",{site_name:o});const{installations:k,appSlug:v}=await Me(_=>a.callTool(_),u.id),A=S.find(_=>_.name===o);if(!A)throw new Error("Selected site is no longer available");const j=nt(o,A.metadata),z=$e(k,j.owner);if(!z){const _=v?`https://github.com/apps/${v}/installations/new`:"https://github.com/settings/installations";throw new Error(`Install the GitHub App on the "${j.owner}" organization to import this site. ${_}`)}let V=null,U=null,B=null;const W=async()=>{B&&await a.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:B}}).catch(()=>{}),U&&await a.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:U,force:!0}}).catch(()=>{}),V&&await a.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:V,force:!0}}).catch(()=>{})};try{const _=await pe(`/api/${n.slug}/deco-sites/connection`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({siteName:o})},"Failed to create connection"),O=_.connId;if(!O)throw new Error("Server did not return a connection ID");V=O;const{childConnectionId:M}=await He({orgSlug:n.slug,sourceConnection:u,installationId:z.installationId,owner:j.owner,repo:j.name,githubCallTool:Z=>D.callTool(Z),selfCallTool:Z=>a.callTool(Z)});U=M;const H=_.icon??null,F=rt(o),q=o.toLowerCase(),p=await a.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:o,description:"Imported from deco.cx",pinned:!1,icon:H??null,subtype:"project",metadata:{instructions:null,enabled_plugins:[],siteSlug:q,githubRepo:{owner:j.owner,name:j.name,url:j.url,installationId:z.installationId,connectionId:M},ui:{banner:null,bannerColor:"#22C55E",icon:H,themeColor:"#22C55E",slug:F,pinnedViews:[{connectionId:O,toolName:"fetch_assets",label:"Assets",icon:null},{connectionId:O,toolName:"get_monitor_data",label:"Monitor",icon:null}],layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}},connections:[{connection_id:O},{connection_id:M}]}}}),Q=p.structuredContent??p;if(!Q.item?.id)throw new Error("Failed to create the imported agent");return B=Q.item.id,{slug:F,virtualMcpId:Q.item.id,connId:O,item:Q.item}}catch(_){throw await W(),_}},onSuccess:({slug:o,virtualMcpId:k,item:v})=>{$("deco_site_import_succeeded",{site_name:v.title,virtual_mcp_id:k,slug:o}),b.setQueryData(ee.collectionItem(a,n.id,"","VIRTUAL_MCP",k),{item:v}),b.invalidateQueries({predicate:A=>{const j=A.queryKey;return j[1]===n.id&&j[3]==="collection"&&j[4]==="VIRTUAL_MCP"}}),b.invalidateQueries({queryKey:ee.projects(n.id)}),te.success(`Imported ${o} from deco.cx`),G(!1),localStorage.setItem("mesh:sidebar-open",JSON.stringify(!1)),l(k)},onError:o=>{$("deco_site_import_failed",{error:o instanceof Error?o.message:"Unknown error"}),te.error("Import failed: "+(o instanceof Error?o.message:"Unknown error"))}});return s.jsx(Fe,{open:t,onOpenChange:G,children:s.jsxs(Re,{className:"sm:max-w-[900px] p-0 gap-0 overflow-hidden",children:[s.jsx(Ue,{className:"sr-only",children:s.jsx(Be,{children:"Import from deco.cx"})}),s.jsxs("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3",children:[i&&s.jsx("button",{type:"button",onClick:i,className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors","aria-label":"Go back",children:s.jsx(Se,{size:18})}),s.jsx("span",{className:"text-sm font-medium text-foreground",children:"Import from deco.cx"})]}),s.jsx("div",{children:s.jsx(Ke,{value:m,onChange:f,placeholder:"Search sites...",onKeyDown:o=>{o.key==="Escape"&&f("")}})}),s.jsxs("div",{className:"pb-0 min-h-[300px]",children:[r.status==="error"&&s.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 h-48 px-8 text-center",children:[s.jsx("p",{className:"text-sm text-destructive",children:r.error??"Failed to connect GitHub"}),s.jsx(J,{variant:"outline",size:"sm",onClick:r.retry,children:"Retry GitHub setup"})]}),w&&r.status!=="error"&&s.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:"Setting up GitHub connection..."}),I&&!w&&r.status!=="error"&&s.jsxs("div",{className:"flex flex-col py-2",children:[s.jsx("div",{className:"px-8 py-2",children:s.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Select a GitHub connection"})}),c.map(o=>s.jsxs("button",{type:"button",onClick:()=>x(o),className:"flex items-center gap-3 px-8 py-3 hover:bg-accent transition-colors text-left",children:[o.icon?s.jsx("img",{src:o.icon,alt:o.title,className:"size-7 rounded-full shrink-0"}):s.jsx("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:s.jsx(me,{className:"size-3.5 text-muted-foreground"})}),s.jsx("span",{className:"text-sm font-medium",children:o.title})]},o.id))]}),N&&!w&&r.status!=="error"&&s.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:"Loading sites..."}),!N&&!w&&!I&&r.status!=="error"&&!T&&S.length===0&&s.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:"No sites found for this account."}),!N&&!w&&!I&&r.status!=="error"&&S.length>0&&s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4 max-h-[420px] overflow-y-auto py-4 px-8 [scrollbar-gutter:stable]",children:[P.length===0&&s.jsxs("p",{className:"col-span-3 text-sm text-muted-foreground text-center py-8",children:["No sites match “",m,"”"]}),P.map(o=>{const k=o.domains?.find(A=>A.production)?.domain??o.domains?.[0]?.domain,v=d===o.name;return s.jsxs("button",{type:"button",onClick:()=>g(o.name),className:je("flex flex-col rounded-xl border overflow-hidden text-left transition-all cursor-pointer",v?"border-primary ring-1 ring-primary":"border-border hover:border-muted-foreground/40"),children:[s.jsx("div",{className:"w-full aspect-video bg-muted overflow-hidden",children:o.thumb_url?s.jsx("img",{src:o.thumb_url,alt:o.name,className:"w-full h-full object-cover",loading:"lazy"}):s.jsx("div",{className:"w-full h-full bg-muted"})}),s.jsxs("div",{className:"px-4 py-3",children:[s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:o.name}),k&&s.jsx("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:k})]})]},o.name)})]})]}),s.jsxs(Ve,{className:"px-8 py-5 border-t border-border",children:[s.jsx(J,{variant:"outline",onClick:()=>G(!1),disabled:L.isPending,children:"Cancel"}),s.jsx(J,{disabled:!d||!R||L.isPending||N||w||I||!u||r.status==="error",onClick:()=>d&&L.mutate(d),children:L.isPending?"Importing...":"Import"})]})]})})}function $s(){const t=ie.c(46),{org:e}=ce(),i=Ce(),n=ye(),[l,b]=K.useState("");let C;t[0]===Symbol.for("react.memo_cache_sentinel")?(C={navigateOnCreate:!0},t[0]=C):C=t[0];const{createVirtualMCP:d,isCreating:g}=ke(C),[y,x]=K.useState(null),[m,f]=K.useState(!1),[a,h]=K.useState(!1),{granted:c}=Ee("agents:manage"),r=l.toLowerCase(),u=i.filter(p=>p.id!==e.id&&(p.title.toLowerCase().includes(r)||p.description?.toLowerCase().includes(r))),{data:I}=we(u.map(ct));let D;t[1]!==n||t[2]!==y?(D=async()=>{if(!y)return;const{id:p,title:Q}=y;x(null);try{await n.delete.mutateAsync(p),$("agent_deleted",{agent_id:p,source:"agents_list"}),te.success(`Deleted "${Q}"`)}catch{}},t[1]=n,t[2]=y,t[3]=D):D=t[3];const w=D,E=X,N=X,T=X;let S;t[4]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(X.Title,{children:"Agents"}),t[4]=S):S=t[4];let G;t[5]===Symbol.for("react.memo_cache_sentinel")?(G=p=>{p.key==="Escape"&&(b(""),p.target.blur())},t[5]=G):G=t[5];let P;t[6]!==l?(P=s.jsx(tt,{value:l,onChange:b,placeholder:"Search for an agent...",className:"w-full md:w-[375px]",onKeyDown:G}),t[6]=l,t[7]=P):P=t[7];let R;t[8]!==c||t[9]!==d||t[10]!==g?(R=c&&s.jsxs(oe,{children:[s.jsx(se,{asChild:!0,children:s.jsxs(J,{size:"sm",children:[s.jsx(le,{size:14}),"Create Agent"]})}),s.jsx(ae,{onCreateFromScratch:()=>{$("agent_create_clicked",{source:"agents_list",method:"scratch"}),d()},onImportGitHub:()=>{$("agent_create_clicked",{source:"agents_list",method:"github"}),h(!0)},onImportDeco:()=>{$("agent_create_clicked",{source:"agents_list",method:"deco"}),f(!0)},isCreating:g,align:"end"})]}),t[8]=c,t[9]=d,t[10]=g,t[11]=R):R=t[11];let L;t[12]!==P||t[13]!==R?(L=s.jsxs("div",{className:"flex flex-col gap-6",children:[S,s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[P,R]})]}),t[12]=P,t[13]=R,t[14]=L):L=t[14];const o=u.length===0&&s.jsx("div",{className:"flex items-center justify-center py-20",children:s.jsx(Te,{image:s.jsx(De,{size:48,className:"text-muted-foreground"}),title:l?"No agents found":"No agents yet",description:l?`No agents match "${l}"`:c?"Create an agent to get started.":"Ask an organization admin to create one.",actions:!l&&c&&s.jsxs(oe,{children:[s.jsx(se,{asChild:!0,children:s.jsxs(J,{size:"sm",children:[s.jsx(le,{size:14}),"Create Agent"]})}),s.jsx(ae,{onCreateFromScratch:()=>{$("agent_create_clicked",{source:"agents_list_empty",method:"scratch"}),d()},onImportGitHub:()=>{$("agent_create_clicked",{source:"agents_list_empty",method:"github"}),h(!0)},onImportDeco:()=>{$("agent_create_clicked",{source:"agents_list_empty",method:"deco"}),f(!0)},isCreating:g,align:"center",showBetaBadge:!0})]})})}),k=u.length>0&&s.jsxs("div",{className:"mt-6 @container",children:[s.jsx("h3",{className:"text-sm font-medium text-muted-foreground mb-3",children:"Agents"}),s.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:u.map(p=>s.jsx(st,{project:p,lastUsedAt:I?.get(p.id)?.last_used_at,onDeleteClick:c?()=>x({id:p.id,title:p.title}):void 0},p.id))})]});let v;t[15]!==k||t[16]!==T.Body||t[17]!==L||t[18]!==o?(v=s.jsxs(T.Body,{children:[L,o,k]}),t[15]=k,t[16]=T.Body,t[17]=L,t[18]=o,t[19]=v):v=t[19];let A;t[20]!==v||t[21]!==N.Content?(A=s.jsx(N.Content,{children:v}),t[20]=v,t[21]=N.Content,t[22]=A):A=t[22];let j;t[23]!==a?(j=s.jsx(Pe,{open:a,onOpenChange:h}),t[23]=a,t[24]=j):j=t[24];let z;t[25]!==m?(z=s.jsx(at,{open:m,onOpenChange:f}),t[25]=m,t[26]=z):z=t[26];const V=!!y;let U;t[27]===Symbol.for("react.memo_cache_sentinel")?(U=p=>!p&&x(null),t[27]=U):U=t[27];let B;t[28]===Symbol.for("react.memo_cache_sentinel")?(B=s.jsx(qe,{children:"Delete Agent?"}),t[28]=B):B=t[28];const W=y?.title;let _;t[29]!==W?(_=s.jsxs(Qe,{children:[B,s.jsxs(Je,{children:["This action cannot be undone. This will permanently delete"," ",s.jsx("span",{className:"font-medium text-foreground",children:W}),"."]})]}),t[29]=W,t[30]=_):_=t[30];let O;t[31]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx(We,{children:"Cancel"}),t[31]=O):O=t[31];let M;t[32]!==w?(M=s.jsxs(Ye,{children:[O,s.jsx(Xe,{onClick:w,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),t[32]=w,t[33]=M):M=t[33];let H;t[34]!==_||t[35]!==M?(H=s.jsxs(Ze,{children:[_,M]}),t[34]=_,t[35]=M,t[36]=H):H=t[36];let F;t[37]!==V||t[38]!==H?(F=s.jsx(et,{open:V,onOpenChange:U,children:H}),t[37]=V,t[38]=H,t[39]=F):F=t[39];let q;return t[40]!==E||t[41]!==A||t[42]!==j||t[43]!==z||t[44]!==F?(q=s.jsxs(E,{children:[A,j,z,F]}),t[40]=E,t[41]=A,t[42]=j,t[43]=z,t[44]=F,t[45]=q):q=t[45],q}function ct(t){return t.id}export{$s as default};
@@ -1 +0,0 @@
1
- import{H as se,I as D,ad as Ae,af as we,ag as Ue,ae as He,b3 as Fe,c as X,J as qe,M as ze,r as J,j as s,ah as rt,t as re,aL as Be,C as Ie,n as De,d as je,K as ie,m as Le,l as Te,B as te,p as Ve,E as ot}from"./index-DmhdwAgP.js";import{i as nt}from"./AlertCircle-B9GlbKHh.js";import{P as ke}from"./index-DBhNC4I_.js";import{S as Me}from"./skeleton-xDZ5Iwb8.js";import{b as Qe,a as Ee,S as Re,c as at}from"./settings-section-CNVe03BK.js";import{u as Se,a as Pe,b as Ge}from"./use-ai-providers-ZLuBEaKb.js";import{i as ct}from"./CheckCircle-BEcdXH7-.js";import{n as dt,o as mt,q as ft,S as ut}from"./chat-context-DSveBxCg.js";import{e as pt,f as gt}from"./use-organization-settings-bBY4klS6.js";import{M as ht,b as Ye,P as xt,C as $e}from"./select-model-BAk08l-M.js";import{u as bt}from"./use-debounced-autosave-DYog9M6N.js";import{u as oe}from"./use-t-BjZG1zRp.js";import{I as Ne}from"./input-TkvVVsQL.js";import{T as Oe,a as vt}from"./toggle-group-DGvoaiio.js";import{c as We,d as Je,b as Xe,A as Ze,g as et,e as tt,a as st,f as it}from"./alert-dialog-DDtUbhoS.js";import{u as ye}from"./studio-tools-DIWsVaKg.js";import{s as yt}from"./Plus-2c1jULco.js";import{b as jt}from"./Tool01-BR3IBeV9.js";import{s as St}from"./Trash01-Ba6bCbNY.js";import{A as _t}from"./avatar-BVdHZbMN.js";import{i as Ct}from"./Settings02-DMpqOK24.js";import{s as kt}from"./Eye-B-ZfWIGj.js";import{a as Pt,D as Nt,d as It,e as Dt,c as Kt}from"./dialog-DUqhzGiD.js";import{f as wt}from"./formatDistanceToNow-Cb2QZZJn.js";import{R as At}from"./require-capability-DnfzULDW.js";import"./sidebar-DnKMI8jz.js";import"./LayoutLeft-BI-sXAac.js";import"./use-mobile-D8w2xyip.js";import"./X-Dif5I5BD.js";import"./tooltip-cvFTpZ9W.js";import"./card-C3gg1LtP.js";import"./ArrowUpRight-DZZygrAi.js";import"./autosend-BgYoPuWD.js";import"./hooks-DU-2h9eZ.js";import"./use-mcp-client-DseZ3Mea.js";import"./auth-CsHQFHV_.js";import"./decopilot-sse-pool-CEQrv8Fn.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-urYy02xb.js";import"./use-collections-DaXoNaLL.js";import"./location-BpLtHjTZ.js";import"./tab-id-BijBBRwE.js";import"./use-decopilot-events-CX_EuT5c.js";import"./drawer-DvhdIHph.js";import"./checkbox-Ba2-hx8r.js";import"./ChevronUp-D5F6V6Tm.js";import"./select-AzuoAc3H.js";import"./ChevronDown-BSRiDjXd.js";import"./Key01-DhLD806C.js";import"./SearchMd-lwIiBODG.js";import"./ai-providers-logos-DD3qZ33J.js";import"./Monitor01-BOILvS2u.js";import"./ChevronRight-YmTewr_B.js";import"./connect-desktop-dialog-DEEL81vf.js";import"./Copy01-BkGYkmm-.js";import"./Image01-PIeYnf-K.js";import"./Stars01-CJsm_THn.js";import"./User01-ByIE6k8L.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-capability-3dRU8tE2.js";import"./access-gate-NCJKEJqO.js";import"./capability-load-error-i6NCyxxk.js";se({title:D(),url:D(),icon:D()});se({registries:we(D(),se({enabled:Ue()})).describe("Per-registry enabled/disabled state. Key is connection ID. Absent registries are treated as enabled."),blockedMcps:Ae(D()).describe("List of MCP app_name or app_id values to hide from the store.")});const ve=se({keyId:D(),modelId:D(),title:D().optional()}).nullable();He(["fast","smart","thinking","image","web_search","deep_research"]);He(["fast","smart","thinking"]);const Mt=se({tiers:se({fast:ve,smart:ve,thinking:ve,image:ve,web_search:ve,deep_research:ve})});se({ids:Ae(D()).describe("Ordered list of custom virtual MCP agent ids to show on the home view.")});se({id:D().describe("Brand context ID"),name:D().describe("Company name"),domain:D().describe("Company domain (e.g. example.com)"),overview:D().describe("Company overview / description"),logo:D().nullable().optional().describe("Logo URL"),favicon:D().nullable().optional().describe("Favicon URL"),ogImage:D().nullable().optional().describe("OG image URL"),fonts:se({heading:D().optional().describe("Font family for headings"),body:D().optional().describe("Font family for body text"),code:D().optional().describe("Font family for code / monospace")}).nullable().optional().describe("Font families by semantic role"),colors:se({primary:D().optional().describe("Primary brand color (hex)"),secondary:D().optional().describe("Secondary brand color (hex)"),accent:D().optional().describe("Accent / highlight color (hex)"),background:D().optional().describe("Background color (hex)"),foreground:D().optional().describe("Foreground / text color (hex)")}).nullable().optional().describe("Semantic color palette"),images:Ae(we(D(),Fe())).nullable().optional().describe("Brand images"),metadata:we(D(),Fe()).nullable().optional().describe("Extra design tokens (typography, components, spacing, layout, tone, etc.)"),archivedAt:D().nullable().optional().describe("Archive timestamp (null to unarchive)"),isDefault:Ue().optional().describe("Whether this is the default brand for the organization")});const Et=e=>e.capabilities?.includes("image")===!0,Rt=e=>dt(e),Ft=e=>mt(e),Tt=[{key:"fast",filter:void 0},{key:"smart",filter:void 0},{key:"thinking",filter:void 0},{key:"image",filter:Et},{key:"web_search",filter:Rt},{key:"deep_research",filter:Ft}];function $t(e){const t=X.c(26),{slot:i,onSlotChange:r,filterModels:a,defaultKeyId:d}=e,n=Se(),[o,j]=J.useState(i?.keyId??d);let _;t[0]!==i?(_=()=>{i?.keyId&&j(i.keyId)},t[0]=i,t[1]=_):_=t[1];const S=i?.keyId;let l;t[2]!==S?(l=[S],t[2]=S,t[3]=l):l=t[3],J.useEffect(_,l);const c=o??d;let m;t[4]!==c||t[5]!==n?(m=c?n.find(x=>x.id===c):null,t[4]=c,t[5]=n,t[6]=m):m=t[6];const p=m,{models:f,isLoading:g}=Pe(a?c??void 0:void 0),k=a?g||f.some(a):!0;let h;t[7]!==i||t[8]!==p?.providerId?(h=i?{modelId:i.modelId,title:i.title??i.modelId,keyId:i.keyId,providerId:p?.providerId??"deco",description:null,logo:null,capabilities:[],limits:null,costs:null}:null,t[7]=i,t[8]=p?.providerId,t[9]=h):h=t[9];const y=h,P=oe();if(a&&!k){let x;t[10]!==P?(x=P("settings.simpleModeSection.notAvailableWithCurrentProvider"),t[10]=P,t[11]=x):x=t[11];let K;return t[12]!==x?(K=s.jsx("p",{className:"text-xs text-muted-foreground italic",children:x}),t[12]=x,t[13]=K):K=t[13],K}let v;t[14]!==P?(v=P("settings.simpleModeSection.pickModel"),t[14]=P,t[15]=v):v=t[15];let C;t[16]===Symbol.for("react.memo_cache_sentinel")?(C=x=>j(x),t[16]=C):C=t[16];let u;t[17]!==c||t[18]!==r?(u=x=>{const K=x.keyId??c??"";j(K),r({keyId:K,modelId:x.modelId,title:x.title})},t[17]=c,t[18]=r,t[19]=u):u=t[19];let N;return t[20]!==c||t[21]!==a||t[22]!==y||t[23]!==v||t[24]!==u?(N=s.jsx(ht,{variant:"bordered",placeholder:v,model:y,credentialId:c,filterModels:a,onCredentialChange:C,onModelChange:u}),t[20]=c,t[21]=a,t[22]=y,t[23]=v,t[24]=u,t[25]=N):N=t[25],N}function Ot(e){const t=X.c(10),{isPending:i,showSaved:r}=e,a=oe();if(i){let d;t[0]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Be,{size:12,className:"animate-spin"}),t[0]=d):d=t[0];let n;t[1]!==a?(n=a("settings.simpleModeSection.saving"),t[1]=a,t[2]=n):n=t[2];let o;return t[3]!==n?(o=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[d,n]}),t[3]=n,t[4]=o):o=t[4],o}if(r){let d;t[5]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(ct,{size:12}),t[5]=d):d=t[5];let n;t[6]!==a?(n=a("settings.simpleModeSection.saved"),t[6]=a,t[7]=n):n=t[7];let o;return t[8]!==n?(o=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[d,n]}),t[8]=n,t[9]=o):o=t[9],o}return null}function Ut(){const e=X.c(58),t=oe(),i=Se(),r=pt(),a=i.length>0;let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=qe(Mt),e[0]=d):d=e[0];let n;e[1]!==r?(n={resolver:d,values:r,mode:"onChange"},e[1]=r,e[2]=n):n=e[2];const o=ze(n),{mutate:j,isPending:_,isSuccess:S}=gt(),l=o.formState.isDirty;let c;e[3]!==o||e[4]!==r||e[5]!==t||e[6]!==j?(c={delayMs:250,save:async()=>{const b=o.getValues();j(b,{onSuccess:()=>o.reset(b,{keepValues:!0}),onError:A=>{o.reset(r),re.error(t("settings.simpleModeSection.failedToSave",{error:A.message}))}})}},e[3]=o,e[4]=r,e[5]=t,e[6]=j,e[7]=c):c=e[7];const{schedule:m}=bt(c),p=i[0],f=i[1],g=i[2],{models:k}=Pe(p?.id),{models:h}=Pe(f?.id),{models:y}=Pe(g?.id);let P,v;e[8]!==o||e[9]!==a?(P=()=>{a||o.reset({tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}})},v=[a,o],e[8]=o,e[9]=a,e[10]=P,e[11]=v):(P=e[10],v=e[11]),J.useEffect(P,v);let C;e[12]!==i||e[13]!==o||e[14]!==p||e[15]!==f||e[16]!==g||e[17]!==k||e[18]!==h||e[19]!==y?(C=()=>{const b=o.getValues(),A=new Set(i.map(Ht)),M={};p?.id&&(M[p.id]=k),f?.id&&(M[f.id]=h),g?.id&&(M[g.id]=y);const w=Q=>Q!=null&&!A.has(Q.keyId),I={fast:w(b.tiers.fast)?null:b.tiers.fast,smart:w(b.tiers.smart)?null:b.tiers.smart,thinking:w(b.tiers.thinking)?null:b.tiers.thinking,image:w(b.tiers.image)?null:b.tiers.image,web_search:w(b.tiers.web_search)?null:b.tiers.web_search,deep_research:w(b.tiers.deep_research)?null:b.tiers.deep_research},Y=!I.fast||!I.smart||!I.thinking||!I.image||!I.web_search||!I.deep_research,W=I.fast===b.tiers.fast&&I.smart===b.tiers.smart&&I.thinking===b.tiers.thinking&&I.image===b.tiers.image&&I.web_search===b.tiers.web_search&&I.deep_research===b.tiers.deep_research;if(!Y&&W)return;const $=ft(i,M);o.reset({tiers:{fast:I.fast??$.chat.fast,smart:I.smart??$.chat.smart,thinking:I.thinking??$.chat.thinking,image:I.image??$.image,web_search:I.web_search??$.webSearch,deep_research:I.deep_research??$.deepResearch}},{keepDirty:!0})},e[12]=i,e[13]=o,e[14]=p,e[15]=f,e[16]=g,e[17]=k,e[18]=h,e[19]=y,e[20]=C):C=e[20];const u=p?.id,N=f?.id,x=g?.id;let K;e[21]!==i||e[22]!==o||e[23]!==k||e[24]!==h||e[25]!==y||e[26]!==u||e[27]!==N||e[28]!==x?(K=[o,i,k,h,y,u,N,x],e[21]=i,e[22]=o,e[23]=k,e[24]=h,e[25]=y,e[26]=u,e[27]=N,e[28]=x,e[29]=K):K=e[29],J.useEffect(C,K);let V;e[30]!==t?(V=b=>({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")})[b]||b,e[30]=t,e[31]=V):V=e[31];const G=V;let O;e[32]!==t?(O=b=>({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")})[b]||"",e[32]=t,e[33]=O):O=e[33];const B=O;let U;e[34]!==t?(U=t("settings.simpleModeSection.defaultModels"),e[34]=t,e[35]=U):U=e[35];let H;e[36]!==t?(H=t("settings.simpleModeSection.modelsPowerDescription"),e[36]=t,e[37]=H):H=e[37];let q;e[38]!==H?(q=s.jsx("p",{className:"text-sm text-muted-foreground",children:H}),e[38]=H,e[39]=q):q=e[39];const L=S&&!l;let E;e[40]!==_||e[41]!==L?(E=s.jsx(Ot,{isPending:_,showSaved:L}),e[40]=_,e[41]=L,e[42]=E):E=e[42];let R;e[43]!==q||e[44]!==E?(R=s.jsxs("div",{className:"flex items-center justify-between -mt-2 mb-2",children:[q,E]}),e[43]=q,e[44]=E,e[45]=R):R=e[45];let F;e[46]!==i[0]?.id||e[47]!==o.control||e[48]!==B||e[49]!==G||e[50]!==m?(F=Tt.map(b=>s.jsx(rt,{control:o.control,name:`tiers.${b.key}`,render:A=>{const{field:M}=A;return s.jsx(Qe,{title:G(b.key),description:B(b.key),action:s.jsx($t,{slot:M.value,defaultKeyId:i[0]?.id??null,filterModels:b.filter,onSlotChange:w=>{M.onChange(w),m()}})})}},b.key)),e[46]=i[0]?.id,e[47]=o.control,e[48]=B,e[49]=G,e[50]=m,e[51]=F):F=e[51];let T;e[52]!==F?(T=s.jsx(Ee,{children:F}),e[52]=F,e[53]=T):T=e[53];let z;return e[54]!==U||e[55]!==R||e[56]!==T?(z=s.jsxs(Re,{title:U,headerClassName:"pl-0",children:[R,T]}),e[54]=U,e[55]=R,e[56]=T,e[57]=z):z=e[57],z}function Ht(e){return e.id}const qt={usd:[10,20,100],brl:[50,100,500]};function zt(){const e=X.c(30),t=oe(),i=ye(),[r,a]=J.useState(!1);let d;e[0]!==t?(d=u=>{re.error(t("settings.decoCreditsHero.topUpFailed",{message:u.message}))},e[0]=t,e[1]=d):d=e[1];const{mutate:n,isPending:o}=je({mutationFn:async u=>{const{url:N}=await i.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:u,currency:c});return N},onSuccess:Bt,onError:d}),[j,_]=J.useState(""),[S,l]=J.useState("usd"),c=S,m=parseFloat(j),p=!isNaN(m)&&m>=1,f=c==="brl"?"R$":"$";let g;e[2]!==l?(g=u=>{u&&l(u)},e[2]=l,e[3]=g):g=e[3];let k,h;e[4]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(Oe,{value:"usd",className:"px-3.5 text-sm",children:"USD"}),h=s.jsx(Oe,{value:"brl",className:"px-3.5 text-sm",children:"BRL"}),e[4]=k,e[5]=h):(k=e[4],h=e[5]);let y;e[6]!==c||e[7]!==g?(y=s.jsxs(vt,{type:"single",variant:"outline",size:"default",value:c,onValueChange:g,children:[k,h]}),e[6]=c,e[7]=g,e[8]=y):y=e[8];let P;e[9]!==c||e[10]!==f||e[11]!==r||e[12]!==o||e[13]!==t||e[14]!==n?(P=!r&&s.jsxs(s.Fragment,{children:[qt[c].map(u=>s.jsxs(te,{variant:"outline",className:"h-10 px-4 text-sm font-medium tabular-nums",disabled:o,onClick:()=>n(u*100),children:[f,u]},u)),s.jsx(te,{variant:"ghost",className:"h-10 px-4 text-sm text-muted-foreground",onClick:()=>a(!0),disabled:o,children:t("settings.decoCreditsHero.custom")})]}),e[9]=c,e[10]=f,e[11]=r,e[12]=o,e[13]=t,e[14]=n,e[15]=P):P=e[15];let v;e[16]!==f||e[17]!==j||e[18]!==m||e[19]!==r||e[20]!==p||e[21]!==o||e[22]!==_||e[23]!==t||e[24]!==n?(v=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:f}),s.jsx(Ne,{type:"number",min:"1",step:"1",placeholder:t("settings.decoCreditsHero.amountPlaceholder"),value:j,onChange:u=>_(u.target.value),className:"h-10 text-sm pl-7",autoFocus:!0})]}),s.jsx(te,{className:"h-10",disabled:!p||o,onClick:()=>n(Math.round(m*100)),children:o?"...":t("settings.decoCreditsHero.add")}),s.jsx(te,{variant:"ghost",className:"h-10 text-sm text-muted-foreground",onClick:()=>{a(!1),_("")},children:t("settings.decoCreditsHero.cancel")})]}),e[16]=f,e[17]=j,e[18]=m,e[19]=r,e[20]=p,e[21]=o,e[22]=_,e[23]=t,e[24]=n,e[25]=v):v=e[25];let C;return e[26]!==y||e[27]!==P||e[28]!==v?(C=s.jsx("div",{className:"flex flex-col gap-2.5",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[y,P,v]})}),e[26]=y,e[27]=P,e[28]=v,e[29]=C):C=e[29],C}function Bt(e){e&&window.open(e,"_blank","noopener,noreferrer")}function Lt(e){return e<=0?"text-destructive":e<=1?"text-warning":"text-foreground"}function Vt(){const e=X.c(121),t=oe(),{org:i}=Ie(),r=ye(),a=De(),d=Se();let n;e[0]!==d?(n=d.find(Qt),e[0]=d,e[1]=n):n=e[1];const o=n,[j,_]=J.useState(!1);let S;e[2]!==o||e[3]!==r?(S=async()=>{o&&await r.call("AI_PROVIDER_KEY_DELETE",{keyId:o.id})},e[2]=o,e[3]=r,e[4]=S):S=e[4];let l;e[5]!==i.id||e[6]!==a||e[7]!==t?(l=()=>{a.invalidateQueries({queryKey:ie.aiProviderKeys(i.id)}),a.invalidateQueries({queryKey:ie.aiProviders(i.id)}),re.success(t("settings.decoCreditsHero.disconnectSuccess")),_(!1)},e[5]=i.id,e[6]=a,e[7]=t,e[8]=l):l=e[8];let c;e[9]!==t?(c=lt=>{re.error(t("settings.decoCreditsHero.disconnectError",{message:lt.message}))},e[9]=t,e[10]=c):c=e[10];let m;e[11]!==S||e[12]!==l||e[13]!==c?(m={mutationFn:S,onSuccess:l,onError:c},e[11]=S,e[12]=l,e[13]=c,e[14]=m):m=e[14];const{mutate:p,isPending:f}=je(m);let g;e[15]!==i.id?(g=ie.aiProviderCredits(i.id,"deco"),e[15]=i.id,e[16]=g):g=e[16];const k=!!o;let h;e[17]!==r?(h=async()=>{try{return await r.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}},e[17]=r,e[18]=h):h=e[18];let y;e[19]!==g||e[20]!==k||e[21]!==h?(y={queryKey:g,enabled:k,staleTime:6e4,queryFn:h},e[19]=g,e[20]=k,e[21]=h,e[22]=y):y=e[22];const{data:P,isLoading:v,refetch:C,isFetching:u}=Le(y);if(!o)return null;const N=P?.balanceCents!=null?P.balanceCents/100:null;let x;e[23]!==N?(x=N!=null?`$${N.toFixed(2)}`:"—",e[23]=N,e[24]=x):x=e[24];const K=x;let V;e[25]!==t?(V=t("settings.decoCreditsHero.title"),e[25]=t,e[26]=V):V=e[26];let G;e[27]!==t?(G=t("settings.decoCreditsHero.decoAiGatewayAlt"),e[27]=t,e[28]=G):G=e[28];let O;e[29]!==G?(O=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:G,className:"size-9 rounded-lg object-contain dark:bg-white dark:p-0.5"}),e[29]=G,e[30]=O):O=e[30];let B;e[31]!==t?(B=t("settings.decoCreditsHero.accessModels"),e[31]=t,e[32]=B):B=e[32];let U;e[33]!==B?(U=s.jsx("div",{children:s.jsx("p",{className:"text-xs text-muted-foreground",children:B})}),e[33]=B,e[34]=U):U=e[34];let H;e[35]!==O||e[36]!==U?(H=s.jsxs("div",{className:"flex items-center gap-3",children:[O,U]}),e[35]=O,e[36]=U,e[37]=H):H=e[37];let q;e[38]===Symbol.for("react.memo_cache_sentinel")?(q=()=>_(!0),e[38]=q):q=e[38];let L;e[39]!==t?(L=t("settings.decoCreditsHero.disconnect"),e[39]=t,e[40]=L):L=e[40];let E;e[41]!==f||e[42]!==L?(E=s.jsx(te,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground hover:text-destructive",onClick:q,disabled:f,children:L}),e[41]=f,e[42]=L,e[43]=E):E=e[43];let R;e[44]!==H||e[45]!==E?(R=s.jsxs("div",{className:"flex items-center justify-between",children:[H,E]}),e[44]=H,e[45]=E,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 z;e[51]!==t?(z=t("settings.decoCreditsHero.disconnectDescription"),e[51]=t,e[52]=z):z=e[52];let b;e[53]!==z?(b=s.jsx(Je,{children:z}),e[53]=z,e[54]=b):b=e[54];let A;e[55]!==T||e[56]!==b?(A=s.jsxs(Xe,{children:[T,b]}),e[55]=T,e[56]=b,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 I;e[62]!==p?(I=()=>p(),e[62]=p,e[63]=I):I=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]!==I||e[67]!==Y?(W=s.jsx(et,{onClick:I,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Y}),e[66]=I,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 Q;e[72]!==A||e[73]!==$?(Q=s.jsxs(st,{children:[A,$]}),e[72]=A,e[73]=$,e[74]=Q):Q=e[74];let Z;e[75]!==j||e[76]!==Q?(Z=s.jsx(it,{open:j,onOpenChange:_,children:Q}),e[75]=j,e[76]=Q,e[77]=Z):Z=e[77];let le;e[78]!==N||e[79]!==K||e[80]!==u||e[81]!==v?(le=v||u?s.jsx(Me,{className:"h-9 w-24"}):s.jsx("span",{className:Te("text-3xl font-semibold tabular-nums tracking-tight",N!=null&&Lt(N)),children:K}),e[78]=N,e[79]=K,e[80]=u,e[81]=v,e[82]=le):le=e[82];let ee;e[83]!==C?(ee=()=>C(),e[83]=C,e[84]=ee):ee=e[84];let ne;e[85]!==t?(ne=t("settings.decoCreditsHero.refreshBalance"),e[85]=t,e[86]=ne):ne=e[86];const Ke=u&&"animate-spin";let ae;e[87]!==Ke?(ae=Te(Ke),e[87]=Ke,e[88]=ae):ae=e[88];let ce;e[89]!==ae?(ce=s.jsx(Be,{size:14,className:ae}),e[89]=ae,e[90]=ce):ce=e[90];let de;e[91]!==u||e[92]!==ee||e[93]!==ne||e[94]!==ce?(de=s.jsx("button",{type:"button",onClick:ee,disabled:u,className:"text-muted-foreground hover:text-foreground disabled:opacity-50 transition-colors p-1 rounded-md hover:bg-muted/50","aria-label":ne,children:ce}),e[91]=u,e[92]=ee,e[93]=ne,e[94]=ce,e[95]=de):de=e[95];let me;e[96]!==le||e[97]!==de?(me=s.jsxs("div",{className:"flex items-baseline gap-2",children:[le,de]}),e[96]=le,e[97]=de,e[98]=me):me=e[98];let fe;e[99]!==t?(fe=t("settings.decoCreditsHero.availableBalance"),e[99]=t,e[100]=fe):fe=e[100];let ue;e[101]!==fe?(ue=s.jsx("p",{className:"text-xs text-muted-foreground",children:fe}),e[101]=fe,e[102]=ue):ue=e[102];let pe;e[103]!==me||e[104]!==ue?(pe=s.jsxs("div",{className:"flex flex-col gap-2 pt-2",children:[me,ue]}),e[103]=me,e[104]=ue,e[105]=pe):pe=e[105];let ge;e[106]!==t?(ge=t("settings.decoCreditsHero.addCredits"),e[106]=t,e[107]=ge):ge=e[107];let he;e[108]!==ge?(he=s.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-2.5",children:ge}),e[108]=ge,e[109]=he):he=e[109];let _e;e[110]===Symbol.for("react.memo_cache_sentinel")?(_e=s.jsx(zt,{}),e[110]=_e):_e=e[110];let xe;e[111]!==he?(xe=s.jsxs("div",{className:"pt-4 border-t border-border/60",children:[he,_e]}),e[111]=he,e[112]=xe):xe=e[112];let be;e[113]!==R||e[114]!==Z||e[115]!==pe||e[116]!==xe?(be=s.jsx(Ee,{children:s.jsxs("div",{className:"px-5 py-5 flex flex-col gap-5",children:[R,Z,pe,xe]})}),e[113]=R,e[114]=Z,e[115]=pe,e[116]=xe,e[117]=be):be=e[117];let Ce;return e[118]!==V||e[119]!==be?(Ce=s.jsx(Re,{title:V,children:be}),e[118]=V,e[119]=be,e[120]=Ce):Ce=e[120],Ce}function Qt(e){return e.providerId==="deco"}function Gt(){const e=X.c(8),{org:t}=Ie(),i=ye(),r=De();let a;e[0]!==i?(a=async()=>{await i.call("AI_PROVIDER_PROVISION_KEY",{providerId:"deco"})},e[0]=i,e[1]=a):a=e[1];let d;e[2]!==t||e[3]!==r?(d=()=>{Ve("ai_provider_provision_succeeded",{provider_id:"deco"}),r.invalidateQueries({queryKey:ie.aiProviderKeys(t.id)}),r.invalidateQueries({queryKey:ie.aiProviders(t.id)}),re.success("Deco AI Gateway connected successfully")},e[2]=t,e[3]=r,e[4]=d):d=e[4];let n;return e[5]!==a||e[6]!==d?(n={mutationFn:a,onSuccess:d,onError:Yt},e[5]=a,e[6]=d,e[7]=n):n=e[7],je(n)}function Yt(e){Ve("ai_provider_provision_failed",{provider_id:"deco",error:e.message}),re.error(`Failed to connect Deco AI Gateway: ${e.message}`)}function Wt(){const e=X.c(37),t=oe(),{mutate:i,isPending:r}=Gt();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=["radial-gradient(ellipse 50% 150% at -15% 50%, rgba(165,149,255,0.14) 0%, transparent 60%)","radial-gradient(ellipse 50% 150% at 115% 50%, rgba(208,236,26,0.11) 0%, transparent 60%)"],e[0]=a):a=e[0];let d;e[1]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{backgroundImage:a.join(", ")}}),e[1]=d):d=e[1];let n;e[2]!==t?(n=t("settings.decoNudgeCard.decoAiGateway"),e[2]=t,e[3]=n):n=e[3];let o;e[4]!==n?(o=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:n,className:"size-12 shrink-0 rounded-xl object-contain dark:bg-white dark:p-1"}),e[4]=n,e[5]=o):o=e[5];let j;e[6]!==t?(j=t("settings.decoNudgeCard.decoAiGateway"),e[6]=t,e[7]=j):j=e[7];let _;e[8]!==j?(_=s.jsx("p",{className:"text-base font-semibold",children:j}),e[8]=j,e[9]=_):_=e[9];let S;e[10]!==t?(S=t("settings.decoNudgeCard.recommended"),e[10]=t,e[11]=S):S=e[11];let l;e[12]!==S?(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:S}),e[12]=S,e[13]=l):l=e[13];let c;e[14]!==_||e[15]!==l?(c=s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[_,l]}),e[14]=_,e[15]=l,e[16]=c):c=e[16];let m;e[17]!==t?(m=t("settings.decoNudgeCard.description"),e[17]=t,e[18]=m):m=e[18];let p;e[19]!==m?(p=s.jsx("p",{className:"text-sm text-muted-foreground",children:m}),e[19]=m,e[20]=p):p=e[20];let f;e[21]!==p||e[22]!==c?(f=s.jsxs("div",{className:"flex-1 min-w-0",children:[c,p]}),e[21]=p,e[22]=c,e[23]=f):f=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 h;e[29]!==r||e[30]!==g||e[31]!==k?(h=s.jsx(te,{variant:"outline",disabled:r,onClick:g,children:k}),e[29]=r,e[30]=g,e[31]=k,e[32]=h):h=e[32];let y;return e[33]!==f||e[34]!==h||e[35]!==o?(y=s.jsxs("div",{className:"relative rounded-xl border border-border overflow-hidden",children:[d,s.jsxs("div",{className:"relative flex items-center gap-5 px-6 py-5",children:[o,f,h]})]}),e[33]=f,e[34]=h,e[35]=o,e[36]=y):y=e[36],y}const Jt=e=>se({label:D().min(1,e("settings.editProviderDialog.labelRequired")).max(100),apiKey:D().optional(),baseUrl:D().optional()});function Xt({isOpenAICompatible:e,baseUrl:t,currentBaseUrl:i,apiKey:r}){return e&&!!t&&t!==i&&!r}function Zt({providerKey:e,provider:t,preset:i,maskedKey:r,currentLabel:a,currentBaseUrl:d,onCancel:n,onSuccess:o}){const{org:j}=Ie(),_=ye(),S=De(),l=oe(),[c,m]=J.useState(!1),p=t.id==="openai-compatible",f=t.supportedMethods.includes("api-key"),g=Jt(l),{register:k,handleSubmit:h,watch:y,setError:P,formState:{errors:v}}=ze({resolver:qe(g),defaultValues:{label:a,apiKey:"",baseUrl:d??""}}),C=y("apiKey")??"",{mutate:u,isPending:N}=je({mutationFn:async x=>{let K;x.apiKey&&(p?K=JSON.stringify({baseUrl:x.baseUrl||d||"",apiKey:x.apiKey}):K=x.apiKey),await _.call("AI_PROVIDER_KEY_UPDATE",{keyId:e.id,label:x.label,...K!==void 0?{apiKey:K}:{}})},onSuccess:()=>{S.invalidateQueries({queryKey:ie.aiProviderKeys(j.id)}),S.invalidateQueries({queryKey:ie.aiProviders(j.id)}),re.success(l("settings.editProviderDialog.providerUpdated")),o()},onError:x=>re.error(l("settings.editProviderDialog.failedToUpdate",{error:x.message}))});return s.jsxs("form",{onSubmit:h(x=>{if(Xt({isOpenAICompatible:p,baseUrl:x.baseUrl,currentBaseUrl:d,apiKey:x.apiKey})){P("apiKey",{message:l("settings.editProviderDialog.apiKeyRequiredForBaseUrlChange")});return}u(x)}),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(Ne,{placeholder:l("settings.editProviderDialog.labelPlaceholder"),...k("label"),className:"h-8 text-sm"}),v.label&&s.jsx("p",{className:"text-xs text-destructive",children:v.label.message})]}),p&&!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(Ne,{type:"url",placeholder:i?.baseUrlPlaceholder??l("settings.editProviderDialog.baseUrlPlaceholder"),...k("baseUrl"),className:"h-8 text-sm"})]}),f&&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(Ne,{type:c&&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(!c),"aria-label":l(c?"settings.editProviderDialog.hideApiKey":"settings.editProviderDialog.showApiKey"),className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:c?s.jsx(Ct,{size:14}):s.jsx(kt,{size:14})})]}),v.apiKey&&s.jsx("p",{className:"text-xs text-destructive",children:v.apiKey.message})]}),i?.helpText&&s.jsx("p",{className:"text-xs text-muted-foreground",children:i.helpText}),s.jsxs(Kt,{children:[s.jsx(te,{type:"button",variant:"ghost",size:"sm",onClick:n,disabled:N,children:l("settings.editProviderDialog.cancel")}),s.jsx(te,{type:"submit",size:"sm",disabled:N,children:l(N?"settings.editProviderDialog.saving":"settings.editProviderDialog.save")})]})]})}function es(e){const t=X.c(31),{providerKey:i,provider:r,open:a,onOpenChange:d}=e,n=oe(),o=ye(),j=r.id==="openai-compatible"&&i.presetId?Ye(i.presetId):void 0,_=j?.name??r.name;let S;t[0]!==i.id?(S=ie.aiProviderKeyPreview(i.id),t[0]=i.id,t[1]=S):S=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 c;t[5]!==a||t[6]!==S||t[7]!==l?(c={queryKey:S,queryFn:l,enabled:a,staleTime:0},t[5]=a,t[6]=S,t[7]=l,t[8]=c):c=t[8];const{data:m,isLoading:p}=Le(c),f=Dt,g=It,k="sm:max-w-md",h=Nt,y=Pt,P=n("settings.editProviderDialog.editTitle",{name:_});let v;t[9]!==y||t[10]!==P?(v=s.jsx(y,{children:P}),t[9]=y,t[10]=P,t[11]=v):v=t[11];let C;t[12]!==h||t[13]!==v?(C=s.jsx(h,{children:v}),t[12]=h,t[13]=v,t[14]=C):C=t[14];let u;t[15]!==p||t[16]!==d||t[17]!==j||t[18]!==m||t[19]!==r||t[20]!==i?(u=p||!m?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(ut,{})}):s.jsx(Zt,{providerKey:i,provider:r,preset:j,maskedKey:m.maskedKey,currentLabel:m.label,currentBaseUrl:m.baseUrl,onCancel:()=>d(!1),onSuccess:()=>d(!1)}),t[15]=p,t[16]=d,t[17]=j,t[18]=m,t[19]=r,t[20]=i,t[21]=u):u=t[21];let N;t[22]!==g||t[23]!==C||t[24]!==u?(N=s.jsxs(g,{className:k,children:[C,u]}),t[22]=g,t[23]=C,t[24]=u,t[25]=N):N=t[25];let x;return t[26]!==f||t[27]!==d||t[28]!==a||t[29]!==N?(x=s.jsx(f,{open:a,onOpenChange:d,children:N}),t[26]=f,t[27]=d,t[28]=a,t[29]=N,t[30]=x):x=t[30],x}function ts(e){const t=X.c(80),{providerKey:i,provider:r}=e,{org:a}=Ie(),d=ye(),n=De(),[o,j]=J.useState(!1),[_,S]=J.useState(!1),l=oe(),c=r.id==="openai-compatible";let m;t[0]!==c||t[1]!==i.presetId?(m=c&&i.presetId?Ye(i.presetId):void 0,t[0]=c,t[1]=i.presetId,t[2]=m):m=t[2];const p=m,f=p?p.name:c?"Custom OpenAI-compatible":r.name,g=p?.logo??r.logo;let k;e:{if(c){k=i.label;break e}const le=i.label;let ee;t[3]!==i.createdAt?(ee=wt(new Date(i.createdAt)),t[3]=i.createdAt,t[4]=ee):ee=t[4],k=`${le} · added ${ee} ago`}const h=k;let y;t[5]!==i.id||t[6]!==d?(y=async()=>{await d.call("AI_PROVIDER_KEY_DELETE",{keyId:i.id})},t[5]=i.id,t[6]=d,t[7]=y):y=t[7];let P;t[8]!==a||t[9]!==i.id||t[10]!==n||t[11]!==l?(P=()=>{n.invalidateQueries({queryKey:ie.aiProviderKeys(a.id)}),n.invalidateQueries({queryKey:ie.aiProviders(a.id)}),n.invalidateQueries({queryKey:ie.aiProviderModels(a.id,i.id)}),re.success(l("settings.providerKeyRow.keyDeleted")),j(!1)},t[8]=a,t[9]=i.id,t[10]=n,t[11]=l,t[12]=P):P=t[12];let v;t[13]!==l?(v=le=>re.error(l("settings.providerKeyRow.failedToDeleteKey",{error:le.message})),t[13]=l,t[14]=v):v=t[14];let C;t[15]!==y||t[16]!==P||t[17]!==v?(C={mutationFn:y,onSuccess:P,onError:v},t[15]=y,t[16]=P,t[17]=v,t[18]=C):C=t[18];const{mutate:u,isPending:N}=je(C);let x;t[19]!==f||t[20]!==g?(x=g?s.jsx("img",{src:g,alt:f,className:"size-8 rounded-md object-contain dark:bg-white dark:p-0.5"}):s.jsx(_t,{fallback:f.charAt(0),className:"size-8 bg-primary/10 text-primary"}),t[19]=f,t[20]=g,t[21]=x):x=t[21];let K;t[22]!==l?(K=l("settings.providerKeyRow.editProviderKey"),t[22]=l,t[23]=K):K=t[23];let V,G;t[24]===Symbol.for("react.memo_cache_sentinel")?(G=()=>S(!0),V=s.jsx(jt,{size:14}),t[24]=V,t[25]=G):(V=t[24],G=t[25]);let O;t[26]!==K?(O=s.jsx(te,{variant:"ghost",size:"icon","aria-label":K,className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:G,children:V}),t[26]=K,t[27]=O):O=t[27];let B;t[28]!==l?(B=l("settings.providerKeyRow.deleteProviderKey"),t[28]=l,t[29]=B):B=t[29];let U,H;t[30]===Symbol.for("react.memo_cache_sentinel")?(U=()=>j(!0),H=s.jsx(St,{size:14}),t[30]=U,t[31]=H):(U=t[30],H=t[31]);let q;t[32]!==N||t[33]!==B?(q=s.jsx(te,{variant:"ghost",size:"icon","aria-label":B,className:"h-7 w-7 text-muted-foreground hover:text-destructive",disabled:N,onClick:U,children:H}),t[32]=N,t[33]=B,t[34]=q):q=t[34];let L;t[35]!==O||t[36]!==q?(L=s.jsxs("div",{className:"flex items-center gap-0.5",children:[O,q]}),t[35]=O,t[36]=q,t[37]=L):L=t[37];let E;t[38]!==h||t[39]!==f||t[40]!==L||t[41]!==x?(E=s.jsx(Qe,{icon:x,title:f,description:h,action:L}),t[38]=h,t[39]=f,t[40]=L,t[41]=x,t[42]=E):E=t[42];let R;t[43]!==_||t[44]!==r||t[45]!==i?(R=s.jsx(es,{providerKey:i,provider:r,open:_,onOpenChange:S}),t[43]=_,t[44]=r,t[45]=i,t[46]=R):R=t[46];let F;t[47]!==l?(F=l("settings.providerKeyRow.deleteApiKey"),t[47]=l,t[48]=F):F=t[48];let T;t[49]!==F?(T=s.jsx(We,{children:F}),t[49]=F,t[50]=T):T=t[50];let z;t[51]!==i.label?(z=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[51]=i.label,t[52]=z):z=t[52];let b;t[53]!==T||t[54]!==z?(b=s.jsxs(Xe,{children:[T,z]}),t[53]=T,t[54]=z,t[55]=b):b=t[55];let A;t[56]!==l?(A=l("settings.providerKeyRow.cancel"),t[56]=l,t[57]=A):A=t[57];let M;t[58]!==A?(M=s.jsx(Ze,{children:A}),t[58]=A,t[59]=M):M=t[59];let w;t[60]!==u?(w=()=>u(),t[60]=u,t[61]=w):w=t[61];let I;t[62]!==l?(I=l("settings.providerKeyRow.delete"),t[62]=l,t[63]=I):I=t[63];let Y;t[64]!==w||t[65]!==I?(Y=s.jsx(et,{onClick:w,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:I}),t[64]=w,t[65]=I,t[66]=Y):Y=t[66];let W;t[67]!==M||t[68]!==Y?(W=s.jsxs(tt,{children:[M,Y]}),t[67]=M,t[68]=Y,t[69]=W):W=t[69];let $;t[70]!==b||t[71]!==W?($=s.jsxs(st,{children:[b,W]}),t[70]=b,t[71]=W,t[72]=$):$=t[72];let Q;t[73]!==o||t[74]!==$?(Q=s.jsx(it,{open:o,onOpenChange:j,children:$}),t[73]=o,t[74]=$,t[75]=Q):Q=t[75];let Z;return t[76]!==E||t[77]!==R||t[78]!==Q?(Z=s.jsxs(s.Fragment,{children:[E,R,Q]}),t[76]=E,t[77]=R,t[78]=Q,t[79]=Z):Z=t[79],Z}function ss(e){const t=X.c(17),{onConnectClick:i}=e,r=oe(),a=Se(),d=Ge();let n;t[0]!==d?.providers?(n=d?.providers??[],t[0]=d?.providers,t[1]=n):n=t[1];const o=n;let j;if(t[2]!==a||t[3]!==i||t[4]!==o||t[5]!==r){let _;t[7]!==o?(_=f=>({key:f,provider:o.find(g=>g.id===f.providerId)}),t[7]=o,t[8]=_):_=t[8];const S=a.filter(rs).map(_).filter(ls);let l;t[9]!==r?(l=r("settings.connectedProvidersSection.sectionTitle"),t[9]=r,t[10]=l):l=t[10];let c;t[11]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(yt,{size:14}),t[11]=c):c=t[11];let m;t[12]!==r?(m=r("settings.connectedProvidersSection.connectButton"),t[12]=r,t[13]=m):m=t[13];let p;t[14]!==i||t[15]!==m?(p=s.jsxs(te,{size:"sm",onClick:i,children:[c,m]}),t[14]=i,t[15]=m,t[16]=p):p=t[16],j=s.jsx(Re,{title:l,headerClassName:"px-0",actions:p,children:S.length===0?s.jsx("p",{className:"text-sm text-muted-foreground px-1",children:r("settings.connectedProvidersSection.emptyState")}):s.jsx(Ee,{children:S.map(is)})}),t[2]=a,t[3]=i,t[4]=o,t[5]=r,t[6]=j}else j=t[6];return j}function is(e){const{key:t,provider:i}=e;return s.jsx(ts,{providerKey:t,provider:i},t.id)}function ls(e){return e.provider!==void 0}function rs(e){return e.providerId!=="deco"}function os(e){const t=X.c(3),{error:i}=e;let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(nt,{size:16}),t[0]=r):r=t[0];let a;return t[1]!==i.message?(a=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]=a):a=t[2],a}function ns(){const e=X.c(23),t=Se();let i;e[0]!==t?(i=t.some(as),e[0]=t,e[1]=i):i=e[1];const r=i,a=t.length>0,[d,n]=J.useState(!1),[o,j]=J.useState(null),_=Ge();let S;e[2]!==_?.providers?(S=_?.providers??[],e[2]=_?.providers,e[3]=S):S=e[3];const l=S;if(!a){let k;e[4]===Symbol.for("react.memo_cache_sentinel")?(k=()=>n(!0),e[4]=k):k=e[4];let h;e[5]!==l?(h=s.jsx(xt,{providers:l,onSelect:j,onShowAll:k}),e[5]=l,e[6]=h):h=e[6];const y=o!==null||d;let P;e[7]===Symbol.for("react.memo_cache_sentinel")?(P=N=>{N||(j(null),n(!1))},e[7]=P):P=e[7];const v=o??void 0;let C;e[8]!==y||e[9]!==v?(C=s.jsx($e,{open:y,onOpenChange:P,initialProvider:v}),e[8]=y,e[9]=v,e[10]=C):C=e[10];let u;return e[11]!==h||e[12]!==C?(u=s.jsxs(s.Fragment,{children:[h,C]}),e[11]=h,e[12]=C,e[13]=u):u=e[13],u}let c;e[14]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(J.Suspense,{fallback:s.jsx(Me,{className:"h-16 w-full"}),children:s.jsx(Ut,{})}),e[14]=c):c=e[14];let m;e[15]!==r?(m=r?s.jsx(Vt,{}):s.jsx(Wt,{}),e[15]=r,e[16]=m):m=e[16];let p;e[17]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(ss,{onConnectClick:()=>n(!0)}),e[17]=p):p=e[17];let f;e[18]!==d?(f=s.jsx($e,{open:d,onOpenChange:n}),e[18]=d,e[19]=f):f=e[19];let g;return e[20]!==m||e[21]!==f?(g=s.jsxs(s.Fragment,{children:[c,m,p,f]}),e[20]=m,e[21]=f,e[22]=g):g=e[22],g}function as(e){return e.providerId==="deco"}function cs(){const e=X.c(2);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(ke.Title,{children:"AI Providers"}),e[0]=t):t=e[0];let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(ke,{children:s.jsx(ke.Content,{children:s.jsx(ke.Body,{children:s.jsxs(at,{children:[t,s.jsx(ot,{fallback:ds,children:s.jsx(J.Suspense,{fallback:s.jsx(Me,{className:"h-64 w-full"}),children:s.jsx(ns,{})})})]})})})}),e[1]=i):i=e[1],i}function ds(e){const{error:t}=e;return s.jsx(os,{error:t??new Error("Failed to load AI providers")})}function yi(){const e=X.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(At,{capability:"ai-providers:manage",area:"AI providers",children:s.jsx(cs,{})}),e[0]=t):t=e[0],t}export{yi as default};
@@ -1 +0,0 @@
1
- import{c as gt,r as w,j as o,l as yt,t as ut,i as St}from"./index-DmhdwAgP.js";import{i as jt}from"./ChevronRight-YmTewr_B.js";import{m as kt}from"./automation-runs-D8v8nlly.js";import{A as _t}from"./add-section-modal-DBjaDtzc.js";import{n as Bt,h as wt,j as At,e as Nt,k as Rt,l as Ct,m as Et,o as Kt,S as Tt}from"./index-nNhZx5bw.js";import"./select-AzuoAc3H.js";import"./tooltip-cvFTpZ9W.js";import"./ChevronUp-D5F6V6Tm.js";import"./ChevronDown-BSRiDjXd.js";import"./useInfiniteQuery-nK_JPgM8.js";import"./use-infinite-scroll-XidGSyic.js";import"./use-connection-DM1ROgj3.js";import"./use-collections-DaXoNaLL.js";import"./use-mcp-client-DseZ3Mea.js";import"./auth-CsHQFHV_.js";import"./use-virtual-mcp-urYy02xb.js";import"./card-C3gg1LtP.js";import"./sidebar-DnKMI8jz.js";import"./LayoutLeft-BI-sXAac.js";import"./use-mobile-D8w2xyip.js";import"./X-Dif5I5BD.js";import"./table-DnoPpUup.js";import"./empty-state-BHuw6cM9.js";import"./use-members-CncY3QG2.js";import"./use-org-auth-client-DjREcL_I.js";import"./use-clock-tick-BzcS25hV.js";import"./AlertCircle-B9GlbKHh.js";import"./CheckCircle-BEcdXH7-.js";import"./DotsVertical-BmTi7wpl.js";import"./agent-icon-DicjSkHu.js";import"./Tool01-BR3IBeV9.js";import"./ArrowUp-DNZsq7Zt.js";import"./Settings02-DMpqOK24.js";import"./Tool02-B0-a0UMl.js";import"./XCircle-C0OdV3N_.js";import"./ArrowUpRight-DZZygrAi.js";import"./TrendUp01-CeRF_789.js";import"./ZapSquare-EvC2T9CP.js";import"./ZoomOut-BprgOfkE.js";import"./Users03-Bx4g7VTC.js";import"./Stars02-B08FvcHQ.js";import"./Copy01-BkGYkmm-.js";import"./Globe01-D3vBqhI7.js";import"./Eye-B-ZfWIGj.js";import"./FilterLines-BwWG7tAk.js";import"./Star01-DoUbKevt.js";import"./Globe04-pvxBukgJ.js";import"./SwitchHorizontal01-Rgis0XWf.js";import"./HardDrive-DutZPQFL.js";import"./Image01-PIeYnf-K.js";import"./Key01-DhLD806C.js";import"./LinkExternal01-DO3QnLus.js";import"./Monitor01-BOILvS2u.js";import"./Sun-nDXz4jeM.js";import"./Package-DbEcG94t.js";import"./Palette-CyZvWKmI.js";import"./Play-B8fWmOst.js";import"./Plus-2c1jULco.js";import"./SearchLg-XmvudKlH.js";import"./SearchMd-lwIiBODG.js";import"./Shield01-gTFc9c17.js";import"./Stars01-CJsm_THn.js";import"./Trash01-Ba6bCbNY.js";import"./Upload01-B14IruoN.js";import"./User01-ByIE6k8L.js";import"./Users01-BdldAr7H.js";import"./XClose-DomD4542.js";import"./Zap-CEUVQQOc.js";import"./use-automations-COcieFX-.js";import"./studio-tools-DIWsVaKg.js";import"./useSuspenseInfiniteQuery-_ObcRUnC.js";import"./avatar-BVdHZbMN.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-DC217syR.js";import"./file-type-icon-BOCZKON3.js";import"./dialog-DUqhzGiD.js";import"./tab-id-BijBBRwE.js";import"./hooks-DU-2h9eZ.js";import"./decopilot-sse-pool-CEQrv8Fn.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./chat-context-DSveBxCg.js";import"./autosend-BgYoPuWD.js";import"./use-ai-providers-ZLuBEaKb.js";import"./location-BpLtHjTZ.js";import"./use-decopilot-events-CX_EuT5c.js";import"./use-organization-settings-bBY4klS6.js";import"./monaco-editor-DfuNvLfy.js";import"./index-DnrPO2j2.js";import"./index-f6gbzJ8b.js";import"./calendar-Bxkf6gvE.js";import"./use-t-BjZG1zRp.js";import"./shell-layout-6KUu0MA6.js";import"./required-auth-layout-ABsqitxw.js";import"./use-org-sso-diAgeADE.js";import"./integration-icon-CWb3OXTV.js";import"./use-navigate-to-agent-YScxPu5L.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-DHN9bK0l.js";import"./form-C9InGmo4.js";import"./label-CB2o7dZ2.js";import"./input-TkvVVsQL.js";import"./drawer-DvhdIHph.js";import"./collection-search-TcSAZpqK.js";import"./index-BQK4XWOD.js";import"./get-initials-D-f_fDFw.js";import"./use-registry-app-Cy7ipz7c.js";import"./use-mcp-tools-DJGNLf9H.js";import"./github-repo-scope-DjMZbiKa.js";import"./authenticate-and-persist-oauth-CEv4KtcH.js";import"./mcp-oauth-B5rKpHdd.js";import"./extract-connection-data-_NDoBHMa.js";import"./dropdown-menu-D5BTIZvH.js";import"./popover-DwV6WXHS.js";import"./command-3z1R7bvy.js";import"./index-CO3868Cu.js";import"./companions-core-C68sN4Wc.js";import"./tabs-2srR2H7A.js";import"./toggle-group-DGvoaiio.js";import"./use-deco-credits-Bm6Hzrca.js";import"./connection-card-D_K36Swx.js";import"./use-registry-connections-BZ0Z0jCg.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-DjtAtA2l.js";import"./connection-form-helpers-DyOAEqE9.js";import"./collection-tabs-CIRa_M2W.js";import"./badge-C_9mnuBd.js";import"./connect-desktop-dialog-DEEL81vf.js";import"./select-model-BAk08l-M.js";import"./checkbox-Ba2-hx8r.js";import"./skeleton-xDZ5Iwb8.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-CNVe03BK.js";import"./index-Du80fsxC.js";import"./alert-dialog-DDtUbhoS.js";import"./toolbar-CvkbyWaX.js";import"./use-debounced-value-CSp0_yRg.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-DG0Zyz9B.js";import"./use-capability-3dRU8tE2.js";import"./toolbar-icon-button-Cr-N30KB.js";import"./use-debounced-autosave-DYog9M6N.js";import"./index-DBhNC4I_.js";import"./search-input-B-RkAjzQ.js";import"./use-mcp-auth-status-BpAt0IbR.js";import"./switch-DS9vYGS-.js";import"./github-repo-picker-Biy9UFu8.js";import"./provision-repo-scoped-github-connection-2iDn-wQ1.js";import"./use-secrets-q_kPvC5B.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./use-file-configs-DASxzk9O.js";import"./automation-list-row-CyDHI_uf.js";function $t(l,t){const s=(l.title||l.resolveType.split("/").pop()||"").replace(/\.(tsx?|jsx?)$/,"").replace(/[^A-Za-z0-9_-]/g,""),f=/^[A-Za-z]/.test(s)&&s.length>0?s:"Section",n=Bt(t,f);return{blockKey:n,data:{__resolveType:l.resolveType,name:n}}}function Cr(l){const t=gt.c(77),{orgSlug:s,virtualMcpId:f,branch:n,blockKey:i,block:a,meta:m,decofile:c,title:D,excludeFields:H,schemaPending:nt,previewBaseUrl:at}=l,G=nt===void 0?!1:nt,u=at===void 0?null:at,x=typeof a?.__resolveType=="string"?a.__resolveType:"";let R;t[0]!==H||t[1]!==m||t[2]!==x?(R=wt(x,m,H),t[0]=H,t[1]=m,t[2]=x,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 J=C;let E;t[6]!==a||t[7]!==i||t[8]!==m||t[9]!==D?(E=D??(a?At(i,a,m):i),t[6]=a,t[7]=i,t[8]=m,t[9]=D,t[10]=E):E=t[10];const v=E;let K;t[11]!==n||t[12]!==s||t[13]!==f?(K={orgSlug:s,virtualMcpId:f,branch:n},t[11]=n,t[12]=s,t[13]=f,t[14]=K):K=t[14];const{save:b,flush:Q,isPending:W}=Nt(K);let T;t[15]!==n||t[16]!==s||t[17]!==f?(T={orgSlug:s,virtualMcpId:f,branch:n},t[15]=n,t[16]=s,t[17]=f,t[18]=T):T=t[18];const X=Rt(T);let $;t[19]!==b?($=Et((e,r)=>b(e,r)),t[19]=b,t[20]=$):$=t[20];const Y=$,[ht,xt]=w.useState(i),[tt,ct]=w.useState(null),[et,dt]=w.useState(0);let F;t[21]===Symbol.for("react.memo_cache_sentinel")?(F=[],t[21]=F):F=t[21];const[p,ft]=w.useState(F),[ot,rt]=w.useState(!1),P=w.useRef(null);ht!==i&&(xt(i),ct(null),dt(Pt),ft([]));let O;t[22]!==a?(O=a??{},t[22]=a,t[23]=O):O=t[23];const it=O;let g;t[24]!==tt?(g=tt??{},t[24]=tt,t[25]=g):g=t[25];let z;t[26]!==it||t[27]!==g?(z={...it,...g},t[26]=it,t[27]=g,t[28]=z):z=t[28];const mt=z;let L;t[29]!==i||t[30]!==x||t[31]!==b?(L=e=>{const r=e;ct(r),b(i,{...r,__resolveType:x})},t[29]=i,t[30]=x,t[31]=b,t[32]=L):L=t[32];const st=L;let V;t[33]===Symbol.for("react.memo_cache_sentinel")?(V=e=>{ft(e)},t[33]=V):V=t[33];const pt=V;let q;t[34]!==c||t[35]!==Q||t[36]!==X?(q=async(e,r)=>{try{const{blockKey:d,data:N}=$t(e,c);await X.mutateAsync({blockKey:d,data:N}),ut.success(`Created section "${d}"`),r({__resolveType:d}),Q()}catch(d){const N=d,bt=N instanceof Error?N.message:"Could not add section";throw ut.error(bt),N}},t[34]=c,t[35]=Q,t[36]=X,t[37]=q):q=t[37];const y=q;let I;t[38]===Symbol.for("react.memo_cache_sentinel")?(I=e=>{P.current=e.append,rt(!0)},t[38]=I):I=t[38];const vt=I;let U;t[39]!==y?(U=async e=>{const r=P.current;if(r)try{await y(e,d=>{r(d),rt(!1),P.current=null})}catch{}},t[39]=y,t[40]=U):U=t[40];const lt=U;let M;t[41]!==p||t[42]!==v?(M=p.length>0?[v,...p]:[],t[41]=p,t[42]=v,t[43]=M):M=t[43];const A=M;let S;t[44]!==p||t[45]!==A||t[46]!==v?(S=A.length>0?o.jsx("nav",{"aria-label":"Editing breadcrumb",className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:A.map((e,r)=>{const d=r===A.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:()=>{pt(r===0?[]:Ct(p,r)),dt(Ft)},title:e,className:yt("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",d?"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[44]=p,t[45]=A,t[46]=v,t[47]=S):S=t[47];let j;t[48]!==W?(j=o.jsx(Kt,{isPending:W,isError:!1}),t[48]=W,t[49]=j):j=t[49];let k;t[50]!==S||t[51]!==j?(k=o.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[S,j]}),t[50]=S,t[51]=j,t[52]=k):k=t[52];let _;t[53]!==i||t[54]!==p||t[55]!==c||t[56]!==mt||t[57]!==et||t[58]!==y||t[59]!==st||t[60]!==J||t[61]!==m||t[62]!==u||t[63]!==Y||t[64]!==h||t[65]!==G?(_=o.jsx(kt,{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:J?o.jsx(Tt,{schema:h,value:mt,onChange:st,basePath:"",breadcrumbPath:p,onBreadcrumbChange:pt,decofile:c,meta:m,onSaveReferencedBlock:Y,previewBaseUrl:u,onAddSectionItem:y,onRequestAddSection:vt},`${i}:${et}`):G?o.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center text-xs text-muted-foreground",children:[o.jsx(St,{size:16,className:"animate-spin"}),"Loading app schema…"]}):o.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:"No editable schema found for this app."})})})}),t[53]=i,t[54]=p,t[55]=c,t[56]=mt,t[57]=et,t[58]=y,t[59]=st,t[60]=J,t[61]=m,t[62]=u,t[63]=Y,t[64]=h,t[65]=G,t[66]=_):_=t[66];let B;t[67]!==ot||t[68]!==c||t[69]!==lt||t[70]!==m||t[71]!==u?(B=u&&o.jsx(_t,{open:ot,onOpenChange:e=>{rt(e),e||(P.current=null)},meta:m,decofile:c,previewBaseUrl:u,onSelect:e=>{lt(e)}}),t[67]=ot,t[68]=c,t[69]=lt,t[70]=m,t[71]=u,t[72]=B):B=t[72];let Z;return t[73]!==k||t[74]!==_||t[75]!==B?(Z=o.jsxs("div",{className:"flex h-full flex-col",children:[k,_,B]}),t[73]=k,t[74]=_,t[75]=B,t[76]=Z):Z=t[76],Z}function Ft(l){return l+1}function Pt(l){return l+1}export{Cr as AppEditor};
@@ -1 +0,0 @@
1
- import{c as B,j as o,C as D,b as M,r as $,B as q,p as R}from"./index-DmhdwAgP.js";import{s as V}from"./Plus-2c1jULco.js";import{i as S}from"./Zap-CEUVQQOc.js";import{S as F}from"./search-input-B-RkAjzQ.js";import{P as d}from"./index-DBhNC4I_.js";import{E as T}from"./empty-state-BHuw6cM9.js";import{c as G}from"./use-automations-COcieFX-.js";import{c as H}from"./use-navigate-to-agent-YScxPu5L.js";import{A as J}from"./automation-list-row-CyDHI_uf.js";import{q as K}from"./use-mcp-client-DseZ3Mea.js";import{u as O}from"./use-virtual-mcp-urYy02xb.js";import{R as Q}from"./require-capability-DnfzULDW.js";import{u as U}from"./use-t-BjZG1zRp.js";import"./SearchMd-lwIiBODG.js";import"./sidebar-DnKMI8jz.js";import"./LayoutLeft-BI-sXAac.js";import"./use-mobile-D8w2xyip.js";import"./X-Dif5I5BD.js";import"./tooltip-cvFTpZ9W.js";import"./studio-tools-DIWsVaKg.js";import"./hooks-DU-2h9eZ.js";import"./decopilot-sse-pool-CEQrv8Fn.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./reusable-new-chat-CouMjkYR.js";import"./alert-dialog-DDtUbhoS.js";import"./dropdown-menu-D5BTIZvH.js";import"./ChevronUp-D5F6V6Tm.js";import"./ChevronRight-YmTewr_B.js";import"./DotsVertical-BmTi7wpl.js";import"./Stars02-B08FvcHQ.js";import"./Trash01-Ba6bCbNY.js";import"./agent-icon-DicjSkHu.js";import"./AlertCircle-B9GlbKHh.js";import"./Tool01-BR3IBeV9.js";import"./ArrowUp-DNZsq7Zt.js";import"./Settings02-DMpqOK24.js";import"./Tool02-B0-a0UMl.js";import"./XCircle-C0OdV3N_.js";import"./ArrowUpRight-DZZygrAi.js";import"./TrendUp01-CeRF_789.js";import"./ZapSquare-EvC2T9CP.js";import"./ZoomOut-BprgOfkE.js";import"./Users03-Bx4g7VTC.js";import"./CheckCircle-BEcdXH7-.js";import"./ChevronDown-BSRiDjXd.js";import"./Copy01-BkGYkmm-.js";import"./Globe01-D3vBqhI7.js";import"./Eye-B-ZfWIGj.js";import"./FilterLines-BwWG7tAk.js";import"./Star01-DoUbKevt.js";import"./Globe04-pvxBukgJ.js";import"./SwitchHorizontal01-Rgis0XWf.js";import"./HardDrive-DutZPQFL.js";import"./Image01-PIeYnf-K.js";import"./Key01-DhLD806C.js";import"./LinkExternal01-DO3QnLus.js";import"./Monitor01-BOILvS2u.js";import"./Sun-nDXz4jeM.js";import"./Package-DbEcG94t.js";import"./Palette-CyZvWKmI.js";import"./Play-B8fWmOst.js";import"./SearchLg-XmvudKlH.js";import"./Shield01-gTFc9c17.js";import"./Stars01-CJsm_THn.js";import"./Upload01-B14IruoN.js";import"./User01-ByIE6k8L.js";import"./Users01-BdldAr7H.js";import"./XClose-DomD4542.js";import"./auth-CsHQFHV_.js";import"./use-collections-DaXoNaLL.js";import"./use-capability-3dRU8tE2.js";import"./access-gate-NCJKEJqO.js";import"./capability-load-error-i6NCyxxk.js";function W(){const t=B.c(20),e=U(),{org:c}=D(),{data:C}=G(void 0),g=C===void 0?[]:C,k=O(),P=H(),f=M(),[x,E]=$.useState(""),h=x.toLowerCase(),A=new Map(k.map(X)),b=g.filter(i=>{if(!h||i.name.toLowerCase().includes(h))return!0;if(i.virtual_mcp_id){const p=A.get(i.virtual_mcp_id);if(p&&p.title.toLowerCase().includes(h))return!0}return!1}),z=(i,p)=>{const N=p&&A.has(p)?p:K(c.id);R("automations_list_row_clicked",{automation_id:i,agent_id:N,source:"settings_automations"}),P(N,{search:{main:"automation:"+i}})};let l;t[0]!==f||t[1]!==c.slug?(l=()=>{R("automations_empty_state_browse_agents_clicked"),f({to:"/$org/settings/agents",params:{org:c.slug}})},t[0]=f,t[1]=c.slug,t[2]=l):l=t[2];const L=l,j=d,v=d,w=d;let s;t[3]!==e?(s=e("settings.automations.pageTitle"),t[3]=e,t[4]=s):s=t[4];let r;t[5]!==s?(r=o.jsx(d.Title,{children:s}),t[5]=s,t[6]=r):r=t[6];const _=g.length>0&&o.jsx(F,{value:x,onChange:E,placeholder:e("settings.automations.searchPlaceholder"),className:"w-full md:w-[375px]"});let m;t[7]!==r||t[8]!==_?(m=o.jsxs("div",{className:"flex flex-col gap-6",children:[r,_]}),t[7]=r,t[8]=_,t[9]=m):m=t[9];const y=g.length===0?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(T,{image:o.jsx(S,{size:48,className:"text-muted-foreground"}),title:e("settings.automations.emptyTitle"),description:e("settings.automations.emptyDescription"),actions:o.jsxs(q,{size:"sm",onClick:L,children:[o.jsx(V,{size:14}),e("settings.automations.browseAgentsButton")]})})}):b.length===0?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(T,{image:o.jsx(S,{size:48,className:"text-muted-foreground"}),title:e("settings.automations.noResultsTitle"),description:e("settings.automations.noResultsDescription",{search:x})})}):o.jsx("div",{className:"mt-6 rounded-xl border border-border overflow-hidden",children:b.map(i=>o.jsx(J,{automation:i,showAgent:!0,onClick:()=>z(i.id,i.virtual_mcp_id)},i.id))});let n;t[10]!==w.Body||t[11]!==m||t[12]!==y?(n=o.jsxs(w.Body,{children:[m,y]}),t[10]=w.Body,t[11]=m,t[12]=y,t[13]=n):n=t[13];let a;t[14]!==v.Content||t[15]!==n?(a=o.jsx(v.Content,{children:n}),t[14]=v.Content,t[15]=n,t[16]=a):a=t[16];let u;return t[17]!==j||t[18]!==a?(u=o.jsx(j,{children:a}),t[17]=j,t[18]=a,t[19]=u):u=t[19],u}function X(t){return[t.id,t]}function jo(){const t=B.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx(Q,{capability:"automations:manage",area:"automations",children:o.jsx(W,{})}),t[0]=e):e=t[0],e}export{jo as default};
@@ -1 +0,0 @@
1
- import{c as T,j as t,r as C,E as W,B as L,t as K}from"./index-DmhdwAgP.js";import{i as X}from"./AlertCircle-B9GlbKHh.js";import{i as I}from"./HardDrive-DutZPQFL.js";import{s as V}from"./Plus-2c1jULco.js";import{s as Y}from"./Trash01-Ba6bCbNY.js";import{g as Z,c as ee,d as te,b as se,A as ie,e as le,a as ne,f as re}from"./alert-dialog-DDtUbhoS.js";import{e as ce,d as ae,D as oe,a as de,h as ue,c as me}from"./dialog-DUqhzGiD.js";import{I as P}from"./input-TkvVVsQL.js";import{L as B}from"./label-CB2o7dZ2.js";import{S as fe,a as ge,b as xe,c as pe,d as q}from"./select-AzuoAc3H.js";import{S as he}from"./switch-DS9vYGS-.js";import{S as be}from"./skeleton-xDZ5Iwb8.js";import{T as je}from"./textarea-DjtAtA2l.js";import{u as F}from"./use-t-BjZG1zRp.js";import{P as E}from"./index-DBhNC4I_.js";import{c as ke}from"./settings-section-CNVe03BK.js";import{u as ye,b as ve,c as Se}from"./use-file-configs-DASxzk9O.js";import{R as Ce}from"./require-capability-DnfzULDW.js";import"./X-Dif5I5BD.js";import"./tooltip-cvFTpZ9W.js";import"./ChevronUp-D5F6V6Tm.js";import"./ChevronDown-BSRiDjXd.js";import"./sidebar-DnKMI8jz.js";import"./LayoutLeft-BI-sXAac.js";import"./use-mobile-D8w2xyip.js";import"./card-C3gg1LtP.js";import"./ArrowUpRight-DZZygrAi.js";import"./studio-tools-DIWsVaKg.js";import"./use-capability-3dRU8tE2.js";import"./access-gate-NCJKEJqO.js";import"./capability-load-error-i6NCyxxk.js";function Ne(i,e){if(!(i instanceof Error))return e;const s=i.message.match(/\[\s*\{[\s\S]*\}\s*\]/);if(s)try{const l=JSON.parse(s[0])[0];if(l?.message){const n=l.path?.join(".");return n?`${n}: ${l.message}`:l.message}}catch{}return i.message||e}function Be(i){const e=T.c(6),{error:s}=i,r=F();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(X,{size:16}),e[0]=l):l=e[0];let n;e[1]!==s.message||e[2]!==r?(n=r("settings.buckets.failedToLoadConfigs",{error:s.message}),e[1]=s.message,e[2]=r,e[3]=n):n=e[3];let c;return e[4]!==n?(c=t.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[l,t.jsx("span",{className:"text-sm font-medium",children:n})]}),e[4]=n,e[5]=c):c=e[5],c}function Pe(i){const e=T.c(51),{config:s,onDelete:r}=i,l=F();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:t.jsx(I,{size:16,className:"text-muted-foreground"})}),e[0]=n):n=e[0];let c;e[1]!==s.name?(c=t.jsx("span",{className:"font-medium text-sm truncate",children:s.name}),e[1]=s.name,e[2]=c):c=e[2];let a;e[3]!==s.credentialType||e[4]!==l?(a=s.credentialType==="sts-session"?t.jsx("span",{className:"text-[10px] uppercase tracking-wide font-medium px-1.5 py-0.5 rounded bg-muted text-muted-foreground shrink-0",children:"STS"}):s.credentialType==="managed"?t.jsx("span",{className:"text-[10px] uppercase tracking-wide font-medium px-1.5 py-0.5 rounded bg-muted text-muted-foreground shrink-0",children:l("settings.buckets.managed")}):null,e[3]=s.credentialType,e[4]=l,e[5]=a):a=e[5];let u;e[6]!==s.bucket||e[7]!==s.region?(u=t.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:[s.bucket," · ",s.region]}),e[6]=s.bucket,e[7]=s.region,e[8]=u):u=e[8];let o;e[9]!==c||e[10]!==a||e[11]!==u?(o=t.jsxs("div",{className:"flex items-center gap-2",children:[c,a,u]}),e[9]=c,e[10]=a,e[11]=u,e[12]=o):o=e[12];let g;e[13]!==s.description?(g=s.description?t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:s.description}):null,e[13]=s.description,e[14]=g):g=e[14];let d;e[15]!==s.endpoint||e[16]!==s.forcePathStyle||e[17]!==l?(d=s.endpoint?t.jsxs("p",{className:"text-xs text-muted-foreground/80 mt-0.5 truncate font-mono",children:[s.endpoint,s.forcePathStyle?` (${l("settings.buckets.pathStyle")})`:""]}):null,e[15]=s.endpoint,e[16]=s.forcePathStyle,e[17]=l,e[18]=d):d=e[18];let f;e[19]!==s.prefix||e[20]!==l?(f=s.prefix?t.jsx("p",{className:"text-xs text-muted-foreground/80 mt-0.5 truncate font-mono",children:l("settings.buckets.prefix",{prefix:s.prefix})}):null,e[19]=s.prefix,e[20]=l,e[21]=f):f=e[21];let m;e[22]!==s.publicUrlBase||e[23]!==l?(m=s.publicUrlBase?t.jsx("p",{className:"text-xs text-muted-foreground/80 mt-0.5 truncate font-mono",children:l("settings.buckets.public",{url:s.publicUrlBase})}):null,e[22]=s.publicUrlBase,e[23]=l,e[24]=m):m=e[24];let b;e[25]!==o||e[26]!==g||e[27]!==d||e[28]!==f||e[29]!==m?(b=t.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[n,t.jsxs("div",{className:"min-w-0",children:[o,g,d,f,m]})]}),e[25]=o,e[26]=g,e[27]=d,e[28]=f,e[29]=m,e[30]=b):b=e[30];let j;e[31]!==s.createdAt?(j=new Date(s.createdAt).toLocaleDateString(),e[31]=s.createdAt,e[32]=j):j=e[32];let S;e[33]!==j?(S=t.jsx("span",{className:"text-xs text-muted-foreground",children:j}),e[33]=j,e[34]=S):S=e[34];let v;e[35]!==s||e[36]!==r?(v=()=>r(s),e[35]=s,e[36]=r,e[37]=v):v=e[37];let k;e[38]!==s.name||e[39]!==l?(k=l("settings.buckets.deleteButton",{name:s.name}),e[38]=s.name,e[39]=l,e[40]=k):k=e[40];let y;e[41]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(Y,{size:14}),e[41]=y):y=e[41];let x;e[42]!==v||e[43]!==k?(x=t.jsx(L,{variant:"ghost",size:"sm",onClick:v,"aria-label":k,children:y}),e[42]=v,e[43]=k,e[44]=x):x=e[44];let p;e[45]!==S||e[46]!==x?(p=t.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[S,x]}),e[45]=S,e[46]=x,e[47]=p):p=e[47];let N;return e[48]!==b||e[49]!==p?(N=t.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[b,p]}),e[48]=b,e[49]=p,e[50]=N):N=e[50],N}function De(i){const e=T.c(21),{onCreate:s}=i,r=F();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:t.jsx(I,{size:20,className:"text-muted-foreground"})}),e[0]=l):l=e[0];let n;e[1]!==r?(n=r("settings.buckets.noBucketsConfigured"),e[1]=r,e[2]=n):n=e[2];let c;e[3]!==n?(c=t.jsx("p",{className:"font-medium text-sm",children:n}),e[3]=n,e[4]=c):c=e[4];let a;e[5]!==r?(a=r("settings.buckets.emptyStateDescription"),e[5]=r,e[6]=a):a=e[6];let u;e[7]!==a?(u=t.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:a}),e[7]=a,e[8]=u):u=e[8];let o;e[9]!==c||e[10]!==u?(o=t.jsxs("div",{children:[c,u]}),e[9]=c,e[10]=u,e[11]=o):o=e[11];let g;e[12]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(V,{size:14}),e[12]=g):g=e[12];let d;e[13]!==r?(d=r("settings.buckets.addBucket"),e[13]=r,e[14]=d):d=e[14];let f;e[15]!==s||e[16]!==d?(f=t.jsxs(L,{onClick:s,size:"sm",className:"mt-2",children:[g,d]}),e[15]=s,e[16]=d,e[17]=f):f=e[17];let m;return e[18]!==o||e[19]!==f?(m=t.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[l,o,f]}),e[18]=o,e[19]=f,e[20]=m):m=e[20],m}function O({open:i,onOpenChange:e}){const s=F(),[r,l]=C.useState(""),[n,c]=C.useState(""),[a,u]=C.useState(""),[o,g]=C.useState(""),[d,f]=C.useState(""),[m,b]=C.useState(!1),[j,S]=C.useState(""),[v,k]=C.useState(""),[y,x]=C.useState("static"),[p,N]=C.useState(""),[D,w]=C.useState(""),[_,A]=C.useState(""),[$,z]=C.useState(""),U=ve();function H(){l(""),c(""),u(""),g(""),f(""),b(!1),S(""),k(""),x("static"),N(""),w(""),A(""),z("")}const R=y==="sts-session"?!!(_.trim()&&$.trim()):!!(p&&D);async function J(h){if(h.preventDefault(),!r.trim()||!a.trim()||!o.trim()||!R)return;const M=y==="sts-session"?{credentialType:"sts-session",refreshUrl:_.trim(),apiKey:$.trim()}:{credentialType:"static",accessKeyId:p,secretAccessKey:D};try{await U.mutateAsync({name:r.trim(),description:n.trim()||void 0,bucket:a.trim(),region:o.trim(),endpoint:d.trim()||void 0,forcePathStyle:m,prefix:j.trim()||void 0,publicUrlBase:v.trim()||void 0,...M}),K.success(s("settings.buckets.bucketAdded",{name:r.trim()})),H(),e(!1)}catch(Q){K.error(Ne(Q,s("settings.buckets.failedToAddBucket")))}}const G=U.isPending||!r.trim()||!a.trim()||!o.trim()||!R;return t.jsx(ce,{open:i,onOpenChange:e,children:t.jsxs(ae,{className:"sm:max-w-lg max-h-[90vh] overflow-y-auto",children:[t.jsxs(oe,{children:[t.jsx(de,{children:s("settings.buckets.addS3Bucket")}),t.jsx(ue,{children:s("settings.buckets.credentialsEncryptedDescription")})]}),t.jsxs("form",{onSubmit:J,className:"space-y-4",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(B,{htmlFor:"file-config-name",children:s("settings.buckets.nameLabel")}),t.jsx(P,{id:"file-config-name",value:r,onChange:h=>l(h.target.value),placeholder:s("settings.buckets.namePlaceholder"),autoComplete:"off",required:!0}),t.jsx("p",{className:"text-xs text-muted-foreground",children:s("settings.buckets.nameHelperText")})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(B,{htmlFor:"file-config-bucket",children:s("settings.buckets.bucketLabel")}),t.jsx(P,{id:"file-config-bucket",value:a,onChange:h=>u(h.target.value),placeholder:s("settings.buckets.bucketPlaceholder"),autoComplete:"off",required:!0})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(B,{htmlFor:"file-config-region",children:s("settings.buckets.regionLabel")}),t.jsx(P,{id:"file-config-region",value:o,onChange:h=>g(h.target.value),placeholder:s("settings.buckets.regionPlaceholder"),autoComplete:"off",required:!0})]})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(B,{htmlFor:"file-config-endpoint",children:s("settings.buckets.endpointLabel")}),t.jsx(P,{id:"file-config-endpoint",type:"url",value:d,onChange:h=>f(h.target.value),placeholder:s("settings.buckets.endpointPlaceholder"),autoComplete:"off"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:s("settings.buckets.endpointHelperText")})]}),t.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-md border border-border/60 p-3",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx(B,{htmlFor:"file-config-path-style",className:"text-sm",children:s("settings.buckets.forcePathStyleLabel")}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:s("settings.buckets.forcePathStyleHelperText")})]}),t.jsx(he,{id:"file-config-path-style",checked:m,onCheckedChange:b})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(B,{htmlFor:"file-config-prefix",children:s("settings.buckets.prefixLabel")}),t.jsx(P,{id:"file-config-prefix",value:j,onChange:h=>S(h.target.value),placeholder:s("settings.buckets.prefixPlaceholder"),autoComplete:"off"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:s("settings.buckets.prefixHelperText")})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(B,{htmlFor:"file-config-public-url-base",children:s("settings.buckets.publicUrlBaseLabel")}),t.jsx(P,{id:"file-config-public-url-base",type:"url",value:v,onChange:h=>k(h.target.value),placeholder:s("settings.buckets.publicUrlBasePlaceholder"),autoComplete:"off"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:s("settings.buckets.publicUrlBaseHelperText")})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(B,{htmlFor:"file-config-credential-type",children:s("settings.buckets.credentialsLabel")}),t.jsxs(fe,{value:y,onValueChange:h=>x(h),children:[t.jsx(ge,{id:"file-config-credential-type",className:"w-full",children:t.jsx(xe,{})}),t.jsxs(pe,{children:[t.jsx(q,{value:"static",children:s("settings.buckets.staticKeyOption")}),t.jsx(q,{value:"sts-session",children:s("settings.buckets.temporarySessionOption")})]})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:s(y==="sts-session"?"settings.buckets.stsSessionHelperText":"settings.buckets.staticKeyHelperText")})]}),y==="static"?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(B,{htmlFor:"file-config-access-key",children:s("settings.buckets.accessKeyIdLabel")}),t.jsx(P,{id:"file-config-access-key",value:p,onChange:h=>N(h.target.value),autoComplete:"off",required:!0})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(B,{htmlFor:"file-config-secret-key",children:s("settings.buckets.secretAccessKeyLabel")}),t.jsx(P,{id:"file-config-secret-key",type:"password",value:D,onChange:h=>w(h.target.value),autoComplete:"new-password",required:!0})]})]}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(B,{htmlFor:"file-config-refresh-url",children:s("settings.buckets.refreshUrlLabel")}),t.jsx(P,{id:"file-config-refresh-url",type:"url",value:_,onChange:h=>A(h.target.value),placeholder:s("settings.buckets.refreshUrlPlaceholder"),autoComplete:"off",required:!0}),t.jsx("p",{className:"text-xs text-muted-foreground",children:s("settings.buckets.refreshUrlHelperText")})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(B,{htmlFor:"file-config-api-key",children:s("settings.buckets.apiKeyLabel")}),t.jsx(P,{id:"file-config-api-key",type:"password",value:$,onChange:h=>z(h.target.value),autoComplete:"new-password",required:!0}),t.jsx("p",{className:"text-xs text-muted-foreground",children:s("settings.buckets.apiKeyHelperText")})]})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(B,{htmlFor:"file-config-description",children:s("settings.buckets.descriptionLabel")}),t.jsx(je,{id:"file-config-description",value:n,onChange:h=>c(h.target.value),rows:2,placeholder:s("settings.buckets.descriptionPlaceholder")})]}),t.jsxs(me,{children:[t.jsx(L,{type:"button",variant:"outline",onClick:()=>{H(),e(!1)},disabled:U.isPending,children:s("settings.buckets.cancelButton")}),t.jsx(L,{type:"submit",disabled:G,children:U.isPending?s("settings.buckets.addingButton"):s("settings.buckets.addBucketButton")})]})]})]})})}function Te(i){const e=T.c(41),{config:s,onClose:r}=i,l=F(),n=Se();let c;e[0]!==s||e[1]!==n||e[2]!==r||e[3]!==l?(c=async function(){if(s)try{await n.mutateAsync(s.id),K.success(l("settings.buckets.bucketRemoved",{name:s.name})),r()}catch(_){const A=_;K.error(A instanceof Error?A.message:l("settings.buckets.failedToRemoveBucket"))}},e[0]=s,e[1]=n,e[2]=r,e[3]=l,e[4]=c):c=e[4];const a=c,u=s!==null;let o;e[5]!==r?(o=w=>!w&&r(),e[5]=r,e[6]=o):o=e[6];let g;e[7]!==l?(g=l("settings.buckets.removeBucketTitle"),e[7]=l,e[8]=g):g=e[8];let d;e[9]!==g?(d=t.jsx(ee,{children:g}),e[9]=g,e[10]=d):d=e[10];const f=s?.name??"";let m;e[11]!==l||e[12]!==f?(m=l("settings.buckets.removeBucketDescription",{name:f}),e[11]=l,e[12]=f,e[13]=m):m=e[13];let b;e[14]!==m?(b=t.jsx(te,{children:m}),e[14]=m,e[15]=b):b=e[15];let j;e[16]!==d||e[17]!==b?(j=t.jsxs(se,{children:[d,b]}),e[16]=d,e[17]=b,e[18]=j):j=e[18];const S=n.isPending;let v;e[19]!==l?(v=l("settings.buckets.cancelButton"),e[19]=l,e[20]=v):v=e[20];let k;e[21]!==n.isPending||e[22]!==v?(k=t.jsx(ie,{disabled:S,children:v}),e[21]=n.isPending,e[22]=v,e[23]=k):k=e[23];let y;e[24]!==n.isPending||e[25]!==l?(y=n.isPending?l("settings.buckets.removingButton"):l("settings.buckets.removeButton"),e[24]=n.isPending,e[25]=l,e[26]=y):y=e[26];let x;e[27]!==n.isPending||e[28]!==a||e[29]!==y?(x=t.jsx(Z,{onClick:a,disabled:n.isPending,children:y}),e[27]=n.isPending,e[28]=a,e[29]=y,e[30]=x):x=e[30];let p;e[31]!==k||e[32]!==x?(p=t.jsxs(le,{children:[k,x]}),e[31]=k,e[32]=x,e[33]=p):p=e[33];let N;e[34]!==p||e[35]!==j?(N=t.jsxs(ne,{children:[j,p]}),e[34]=p,e[35]=j,e[36]=N):N=e[36];let D;return e[37]!==N||e[38]!==u||e[39]!==o?(D=t.jsx(re,{open:u,onOpenChange:o,children:N}),e[37]=N,e[38]=u,e[39]=o,e[40]=D):D=e[40],D}function Fe(){const i=T.c(32),e=F(),s=ye(),[r,l]=C.useState(!1),[n,c]=C.useState(null);if(s.length===0){let x;i[0]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(De,{onCreate:()=>l(!0)}),i[0]=x):x=i[0];let p;return i[1]!==r?(p=t.jsxs(t.Fragment,{children:[x,t.jsx(O,{open:r,onOpenChange:l})]}),i[1]=r,i[2]=p):p=i[2],p}let a;i[3]!==s.length||i[4]!==e?(a=e("settings.buckets.bucketsConfigured",{count:s.length}),i[3]=s.length,i[4]=e,i[5]=a):a=i[5];let u;i[6]!==a?(u=t.jsx("p",{className:"text-sm text-muted-foreground",children:a}),i[6]=a,i[7]=u):u=i[7];let o;i[8]===Symbol.for("react.memo_cache_sentinel")?(o=()=>l(!0),i[8]=o):o=i[8];let g;i[9]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(V,{size:14}),i[9]=g):g=i[9];let d;i[10]!==e?(d=e("settings.buckets.addBucket"),i[10]=e,i[11]=d):d=i[11];let f;i[12]!==d?(f=t.jsxs(L,{onClick:o,size:"sm",children:[g,d]}),i[12]=d,i[13]=f):f=i[13];let m;i[14]!==u||i[15]!==f?(m=t.jsxs("div",{className:"flex items-center justify-between",children:[u,f]}),i[14]=u,i[15]=f,i[16]=m):m=i[16];let b;if(i[17]!==s){let x;i[19]===Symbol.for("react.memo_cache_sentinel")?(x=p=>t.jsx(Pe,{config:p,onDelete:c},p.id),i[19]=x):x=i[19],b=s.map(x),i[17]=s,i[18]=b}else b=i[18];let j;i[20]!==b?(j=t.jsx("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:t.jsx("div",{children:b})}),i[20]=b,i[21]=j):j=i[21];let S;i[22]!==r?(S=t.jsx(O,{open:r,onOpenChange:l}),i[22]=r,i[23]=S):S=i[23];let v;i[24]===Symbol.for("react.memo_cache_sentinel")?(v=()=>c(null),i[24]=v):v=i[24];let k;i[25]!==n?(k=t.jsx(Te,{config:n,onClose:v}),i[25]=n,i[26]=k):k=i[26];let y;return i[27]!==k||i[28]!==m||i[29]!==j||i[30]!==S?(y=t.jsxs(t.Fragment,{children:[m,j,S,k]}),i[27]=k,i[28]=m,i[29]=j,i[30]=S,i[31]=y):y=i[31],y}function we(){const i=T.c(12),e=F();let s;i[0]!==e?(s=e("settings.buckets.pageTitle"),i[0]=e,i[1]=s):s=i[1];let r;i[2]!==s?(r=t.jsx(E.Title,{children:s}),i[2]=s,i[3]=r):r=i[3];let l;i[4]!==e?(l=u=>{const{error:o}=u;return t.jsx(Be,{error:o??new Error(e("settings.buckets.failedToLoadConfigsFallback"))})},i[4]=e,i[5]=l):l=i[5];let n;i[6]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(C.Suspense,{fallback:t.jsx(be,{className:"h-32 w-full"}),children:t.jsx(Fe,{})}),i[6]=n):n=i[6];let c;i[7]!==l?(c=t.jsx(W,{fallback:l,children:n}),i[7]=l,i[8]=c):c=i[8];let a;return i[9]!==r||i[10]!==c?(a=t.jsx(E,{children:t.jsx(E.Content,{children:t.jsx(E.Body,{children:t.jsxs(ke,{children:[r,c]})})})}),i[9]=r,i[10]=c,i[11]=a):a=i[11],a}function ot(){const i=T.c(1);let e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ce,{capability:"file-configs:manage",area:"files",children:t.jsx(we,{})}),i[0]=e):e=i[0],e}export{ot as default};
@@ -1 +0,0 @@
1
- import{c as Q,l as Y,j as s,r as W,B as J,i as le}from"./index-DmhdwAgP.js";import{c as Z}from"./ZoomOut-BprgOfkE.js";import{i as ae}from"./X-Dif5I5BD.js";import{L as O}from"./label-CB2o7dZ2.js";import{I as ie,R as oe,a as re}from"./index-629FAmzK.js";import{a as ce}from"./DotsVertical-BmTi7wpl.js";import{S as ne,a as de,b as me,c as xe,d as pe}from"./select-AzuoAc3H.js";import{T as fe,a as ue,b as he}from"./tooltip-cvFTpZ9W.js";import"./ChevronUp-D5F6V6Tm.js";import"./ChevronDown-BSRiDjXd.js";function ge(a){const e=Q.c(8);let i,t;e[0]!==a?({className:i,...t}=a,e[0]=a,e[1]=i,e[2]=t):(i=e[1],t=e[2]);let o;e[3]!==i?(o=Y("grid gap-3",i),e[3]=i,e[4]=o):o=e[4];let l;return e[5]!==t||e[6]!==o?(l=s.jsx(oe,{"data-slot":"radio-group",className:o,...t}),e[5]=t,e[6]=o,e[7]=l):l=e[7],l}function X(a){const e=Q.c(9);let i,t;e[0]!==a?({className:i,...t}=a,e[0]=a,e[1]=i,e[2]=t):(i=e[1],t=e[2]);let o;e[3]!==i?(o=Y("border-input text-primary focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[2px] disabled:opacity-50",i),e[3]=i,e[4]=o):o=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(re,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:s.jsx(ce,{className:"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})}),e[5]=l):l=e[5];let c;return e[6]!==t||e[7]!==o?(c=s.jsx(ie,{"data-slot":"radio-group-item",className:o,...t,children:l}),e[6]=t,e[7]=o,e[8]=c):c=e[8],c}function ze(a){const e=Q.c(69),{posts:i,categories:t,initialSlug:o,isPending:l,onApply:c,onClose:m}=a,[n,ee]=W.useState(o&&t.some(d=>d.slug===o)?o:t[0]?.slug??""),[x,se]=W.useState("add");let T;if(e[0]!==t||e[1]!==n){let d;e[3]!==n?(d=te=>te.slug===n,e[3]=n,e[4]=d):d=e[4],T=t.find(d),e[0]=t,e[1]=n,e[2]=T}else T=e[2];const p=T,r=i.length,K=r===1?"post":"posts";let f;e[5]!==r||e[6]!==K?(f=s.jsxs("span",{className:"truncate text-sm font-medium",children:[r," ",K," selected"]}),e[5]=r,e[6]=K,e[7]=f):f=e[7];let E;e[8]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsx(ae,{size:14}),e[8]=E):E=e[8];let u;e[9]!==l||e[10]!==m?(u=s.jsx(fe,{asChild:!0,children:s.jsx(J,{type:"button",variant:"ghost",size:"icon",disabled:l,onClick:m,"aria-label":"Exit selection",children:E})}),e[9]=l,e[10]=m,e[11]=u):u=e[11];let I;e[12]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsx(ue,{side:"bottom",children:"Exit selection"}),e[12]=I):I=e[12];let h;e[13]!==u?(h=s.jsxs(he,{children:[u,I]}),e[13]=u,e[14]=h):h=e[14];let g;e[15]!==f||e[16]!==h?(g=s.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[f,h]}),e[15]=f,e[16]=h,e[17]=g):g=e[17];let A;e[18]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx("h2",{className:"text-2xl font-bold text-foreground",children:"Update category"}),e[18]=A):A=e[18];const M=r===0?"Select posts from the list to choose what this update applies to.":`Choose a category to apply to ${r} ${r===1?"post":"posts"}.`;let j;e[19]!==M?(j=s.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:M}),e[19]=M,e[20]=j):j=e[20];let B;e[21]===Symbol.for("react.memo_cache_sentinel")?(B=s.jsx(O,{children:"Category"}),e[21]=B):B=e[21];let b;e[22]!==t||e[23]!==n?(b=s.jsxs("div",{className:"space-y-2",children:[B,t.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No categories yet — create one in the Categories collection."}):s.jsxs(ne,{value:n,onValueChange:ee,children:[s.jsx(de,{className:"w-full",children:s.jsx(me,{placeholder:"Select a category"})}),s.jsx(xe,{children:t.map(be)})]})]}),e[22]=t,e[23]=n,e[24]=b):b=e[24];let F;e[25]===Symbol.for("react.memo_cache_sentinel")?(F=d=>se(d),e[25]=F):F=e[25];let V;e[26]===Symbol.for("react.memo_cache_sentinel")?(V=s.jsx(X,{value:"add",id:"cat-mode-add",className:"mt-0.5"}),e[26]=V):V=e[26];let G;e[27]===Symbol.for("react.memo_cache_sentinel")?(G=s.jsxs(O,{htmlFor:"cat-mode-add",className:"flex cursor-pointer items-start gap-2.5 rounded-lg border p-3",children:[V,s.jsxs("span",{className:"space-y-0.5",children:[s.jsx("span",{className:"block text-sm font-medium",children:"Add category"}),s.jsx("span",{className:"block text-xs text-muted-foreground",children:"Keep existing categories and add this one."})]})]}),e[27]=G):G=e[27];let L;e[28]===Symbol.for("react.memo_cache_sentinel")?(L=s.jsx(X,{value:"replace",id:"cat-mode-replace",className:"mt-0.5"}),e[28]=L):L=e[28];let P;e[29]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsxs(O,{htmlFor:"cat-mode-replace",className:"flex cursor-pointer items-start gap-2.5 rounded-lg border p-3",children:[L,s.jsxs("span",{className:"space-y-0.5",children:[s.jsx("span",{className:"block text-sm font-medium",children:"Replace category"}),s.jsx("span",{className:"block text-xs text-muted-foreground",children:"Remove all current categories and set only this one."})]})]}),e[29]=P):P=e[29];let y;e[30]!==x?(y=s.jsxs(ge,{value:x,onValueChange:F,className:"gap-2",children:[G,P]}),e[30]=x,e[31]=y):y=e[31];let N;e[32]!==l||e[33]!==m?(N=s.jsx(J,{type:"button",variant:"outline",onClick:m,disabled:l,children:"Cancel"}),e[32]=l,e[33]=m,e[34]=N):N=e[34];const D=!p||l||r===0;let v;e[35]!==x||e[36]!==c||e[37]!==p?(v=()=>p&&c(x,{name:p.name,slug:p.slug}),e[35]=x,e[36]=c,e[37]=p,e[38]=v):v=e[38];let S;e[39]!==l?(S=l?s.jsxs(s.Fragment,{children:[s.jsx(le,{size:14,className:"animate-spin"}),"Updating…"]}):"Apply",e[39]=l,e[40]=S):S=e[40];let _;e[41]!==D||e[42]!==v||e[43]!==S?(_=s.jsx(J,{type:"button",disabled:D,onClick:v,children:S}),e[41]=D,e[42]=v,e[43]=S,e[44]=_):_=e[44];let k;e[45]!==N||e[46]!==_?(k=s.jsxs("div",{className:"flex justify-end gap-2",children:[N,_]}),e[45]=N,e[46]=_,e[47]=k):k=e[47];let C;e[48]!==b||e[49]!==y||e[50]!==k?(C=s.jsxs("div",{className:"mt-6 space-y-4",children:[b,y,k]}),e[48]=b,e[49]=y,e[50]=k,e[51]=C):C=e[51];let U;e[52]===Symbol.for("react.memo_cache_sentinel")?(U=s.jsx(Z,{size:16,className:"shrink-0 text-muted-foreground"}),e[52]=U):U=e[52];const H=r===1?"post":"posts";let w;e[53]!==r||e[54]!==H?(w=s.jsxs("div",{className:"flex items-center gap-2 px-4 py-3",children:[U,s.jsxs("span",{className:"text-sm",children:[r," selected ",H]})]}),e[53]=r,e[54]=H,e[55]=w):w=e[55];let R;e[56]!==r||e[57]!==i?(R=r===0?s.jsx("p",{className:"border-t bg-background px-4 py-3 text-sm text-muted-foreground",children:"No posts selected yet — pick them from the list on the left."}):s.jsx("ul",{className:"divide-y border-t bg-background",children:i.map(je)}),e[56]=r,e[57]=i,e[58]=R):R=e[58];let $;e[59]!==w||e[60]!==R?($=s.jsxs("div",{className:"mt-8 overflow-hidden rounded-lg border bg-muted/30",children:[w,R]}),e[59]=w,e[60]=R,e[61]=$):$=e[61];let z;e[62]!==j||e[63]!==C||e[64]!==$?(z=s.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:s.jsxs("div",{className:"mx-auto max-w-2xl px-8 py-8",children:[A,j,C,$]})}),e[62]=j,e[63]=C,e[64]=$,e[65]=z):z=e[65];let q;return e[66]!==z||e[67]!==g?(q=s.jsxs("div",{className:"flex h-full flex-col",children:[g,z]}),e[66]=z,e[67]=g,e[68]=q):q=e[68],q}function je(a){return s.jsxs("li",{className:"flex items-center gap-2.5 px-4 py-2.5",children:[s.jsx(Z,{size:14,className:"shrink-0 text-muted-foreground"}),s.jsxs("span",{className:"min-w-0 flex-1",children:[s.jsx("span",{className:"block truncate text-sm",children:a.title}),a.slug&&s.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:a.slug})]})]},a.key)}function be(a){return s.jsx(pe,{value:a.slug,children:s.jsx("span",{className:"truncate",children:a.name})},a.slug)}export{ze as BulkCategoryPanel};
@@ -1 +0,0 @@
1
- import{c as J,r as S,l as Q,j as t,B as U,i as V,t as T}from"./index-DmhdwAgP.js";import{i as X}from"./XCircle-C0OdV3N_.js";import{c as I}from"./ZoomOut-BprgOfkE.js";import{n as Y}from"./LinkExternal01-DO3QnLus.js";import{aN as Z}from"./agent-icon-DicjSkHu.js";import{f as _,a as K,b as tt,c as et,d as ot,e as rt,A as it,g as st}from"./alert-dialog-DDtUbhoS.js";import{I as L}from"./input-TkvVVsQL.js";import{L as q}from"./label-CB2o7dZ2.js";import{w as at,v as mt,x as nt,$ as lt,o as pt,z as B,C as ct,a0 as dt,A as ut}from"./index-nNhZx5bw.js";import{c as gt,B as xt,a as ft}from"./block-document-CcMdXbqY.js";import{u as ht}from"./use-autosave-C46oRXRb.js";import{t as jt}from"./ChevronDown-BSRiDjXd.js";import{p as yt,q as vt,o as bt}from"./automation-runs-D8v8nlly.js";import{s as v,E as Ct}from"./primitives-RdkZFzQM.js";import"./AlertCircle-B9GlbKHh.js";import"./Tool01-BR3IBeV9.js";import"./ArrowUp-DNZsq7Zt.js";import"./Settings02-DMpqOK24.js";import"./Tool02-B0-a0UMl.js";import"./ArrowUpRight-DZZygrAi.js";import"./TrendUp01-CeRF_789.js";import"./ZapSquare-EvC2T9CP.js";import"./Users03-Bx4g7VTC.js";import"./CheckCircle-BEcdXH7-.js";import"./ChevronUp-D5F6V6Tm.js";import"./ChevronRight-YmTewr_B.js";import"./DotsVertical-BmTi7wpl.js";import"./Stars02-B08FvcHQ.js";import"./Copy01-BkGYkmm-.js";import"./Globe01-D3vBqhI7.js";import"./Eye-B-ZfWIGj.js";import"./FilterLines-BwWG7tAk.js";import"./Star01-DoUbKevt.js";import"./Globe04-pvxBukgJ.js";import"./SwitchHorizontal01-Rgis0XWf.js";import"./HardDrive-DutZPQFL.js";import"./Image01-PIeYnf-K.js";import"./Key01-DhLD806C.js";import"./LayoutLeft-BI-sXAac.js";import"./Monitor01-BOILvS2u.js";import"./Sun-nDXz4jeM.js";import"./Package-DbEcG94t.js";import"./Palette-CyZvWKmI.js";import"./Play-B8fWmOst.js";import"./Plus-2c1jULco.js";import"./SearchLg-XmvudKlH.js";import"./SearchMd-lwIiBODG.js";import"./Shield01-gTFc9c17.js";import"./Stars01-CJsm_THn.js";import"./Trash01-Ba6bCbNY.js";import"./Upload01-B14IruoN.js";import"./User01-ByIE6k8L.js";import"./Users01-BdldAr7H.js";import"./XClose-DomD4542.js";import"./X-Dif5I5BD.js";import"./Zap-CEUVQQOc.js";import"./chat-context-DSveBxCg.js";import"./autosend-BgYoPuWD.js";import"./hooks-DU-2h9eZ.js";import"./use-mcp-client-DseZ3Mea.js";import"./auth-CsHQFHV_.js";import"./decopilot-sse-pool-CEQrv8Fn.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./studio-tools-DIWsVaKg.js";import"./use-virtual-mcp-urYy02xb.js";import"./use-collections-DaXoNaLL.js";import"./use-ai-providers-ZLuBEaKb.js";import"./location-BpLtHjTZ.js";import"./tab-id-BijBBRwE.js";import"./use-decopilot-events-CX_EuT5c.js";import"./use-organization-settings-bBY4klS6.js";import"./tooltip-cvFTpZ9W.js";import"./dialog-DUqhzGiD.js";import"./drawer-DvhdIHph.js";import"./collection-search-TcSAZpqK.js";import"./use-mobile-D8w2xyip.js";import"./AreaChart-DHN9bK0l.js";import"./index-f6gbzJ8b.js";import"./calendar-Bxkf6gvE.js";import"./use-t-BjZG1zRp.js";import"./shell-layout-6KUu0MA6.js";import"./avatar-BVdHZbMN.js";import"./required-auth-layout-ABsqitxw.js";import"./use-org-sso-diAgeADE.js";import"./index-BQK4XWOD.js";import"./get-initials-D-f_fDFw.js";import"./use-registry-app-Cy7ipz7c.js";import"./use-mcp-tools-DJGNLf9H.js";import"./use-connection-DM1ROgj3.js";import"./github-repo-scope-DjMZbiKa.js";import"./authenticate-and-persist-oauth-CEv4KtcH.js";import"./mcp-oauth-B5rKpHdd.js";import"./extract-connection-data-_NDoBHMa.js";import"./use-members-CncY3QG2.js";import"./use-org-auth-client-DjREcL_I.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./dropdown-menu-D5BTIZvH.js";import"./popover-DwV6WXHS.js";import"./command-3z1R7bvy.js";import"./index-CO3868Cu.js";import"./use-copy-DC217syR.js";import"./companions-core-C68sN4Wc.js";import"./form-C9InGmo4.js";import"./select-AzuoAc3H.js";import"./tabs-2srR2H7A.js";import"./toggle-group-DGvoaiio.js";import"./use-deco-credits-Bm6Hzrca.js";import"./connection-card-D_K36Swx.js";import"./use-registry-connections-BZ0Z0jCg.js";import"./useInfiniteQuery-nK_JPgM8.js";import"./use-infinite-scroll-XidGSyic.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./card-C3gg1LtP.js";import"./integration-icon-CWb3OXTV.js";import"./textarea-DjtAtA2l.js";import"./connection-form-helpers-DyOAEqE9.js";import"./collection-tabs-CIRa_M2W.js";import"./badge-C_9mnuBd.js";import"./useSuspenseInfiniteQuery-_ObcRUnC.js";import"./connect-desktop-dialog-DEEL81vf.js";import"./select-model-BAk08l-M.js";import"./checkbox-Ba2-hx8r.js";import"./skeleton-xDZ5Iwb8.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-CNVe03BK.js";import"./index-Du80fsxC.js";import"./file-type-icon-BOCZKON3.js";import"./toolbar-CvkbyWaX.js";import"./use-debounced-value-CSp0_yRg.js";import"./index-DnrPO2j2.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-DG0Zyz9B.js";import"./empty-state-BHuw6cM9.js";import"./use-capability-3dRU8tE2.js";import"./toolbar-icon-button-Cr-N30KB.js";import"./use-debounced-autosave-DYog9M6N.js";import"./index-DBhNC4I_.js";import"./sidebar-DnKMI8jz.js";import"./search-input-B-RkAjzQ.js";import"./use-mcp-auth-status-BpAt0IbR.js";import"./switch-DS9vYGS-.js";import"./github-repo-picker-Biy9UFu8.js";import"./use-navigate-to-agent-YScxPu5L.js";import"./reusable-new-chat-CouMjkYR.js";import"./provision-repo-scoped-github-connection-2iDn-wQ1.js";import"./use-secrets-q_kPvC5B.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./monaco-editor-DfuNvLfy.js";import"./use-file-configs-DASxzk9O.js";import"./use-automations-COcieFX-.js";import"./automation-list-row-CyDHI_uf.js";import"./table-DnoPpUup.js";import"./use-clock-tick-BzcS25hV.js";function Nt(b){const e=J.c(18),{icon:x,title:n,defaultOpen:C,children:d}=b,A=C===void 0?!1:C,[f,D]=S.useState(A);let l;e[0]!==x?(l=t.jsx(x,{size:15}),e[0]=x,e[1]=l):l=e[1];let i;e[2]!==n?(i=t.jsx("span",{className:"flex-1 text-left",children:n}),e[2]=n,e[3]=i):i=e[3];const h=f&&"rotate-180";let r;e[4]!==h?(r=Q("transition-transform",h),e[4]=h,e[5]=r):r=e[5];let p;e[6]!==r?(p=t.jsx(jt,{size:15,className:r}),e[6]=r,e[7]=p):p=e[7];let c;e[8]!==l||e[9]!==i||e[10]!==p?(c=t.jsx(yt,{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,i,p]})}),e[8]=l,e[9]=i,e[10]=p,e[11]=c):c=e[11];let s;e[12]!==d?(s=t.jsx(vt,{className:"px-2 pt-4",children:d}),e[12]=d,e[13]=s):s=e[13];let u;return e[14]!==f||e[15]!==c||e[16]!==s?(u=t.jsxs(bt,{open:f,onOpenChange:D,className:"mt-4",children:[c,s]}),e[14]=f,e[15]=c,e[16]=s,e[17]=u):u=e[17],u}function yr({orgSlug:b,virtualMcpId:e,branch:x,blockKey:n,block:C,decofile:d,meta:A,onManagePosts:f,onOpenPost:D,previewBaseUrl:l}){const i=at({orgSlug:b,virtualMcpId:e,branch:x,packagePath:mt(e)}),h=nt(C,"categories"),[r,p,c]=ht(h,o=>{i.mutate({blockKey:n,data:B(n,"categories",o)})}),s=(o,k)=>p({...r,[o]:k}),u=gt({decofile:d,category:r,previewBaseUrl:l}),a=v(r.slug),[R,j]=S.useState(a),[m,N]=S.useState(null),[w,P]=S.useState(!1),$=a?lt(d).filter(o=>o.categorySlugs.includes(a)):[],y=$.length,H=o=>s("slug",o),M=async(o,k)=>{const G=v(r.name);P(!0);try{let g=0;for(const{key:E,payload:O}of ct(d,"posts")){const F=dt(O,o,{name:G,slug:k});F!==O&&(await i.mutateAsync({blockKey:E,data:B(E,"posts",ut(F))}),g+=1)}const z={...r,slug:k};await i.mutateAsync({blockKey:n,data:B(n,"categories",z)}),c(z),T.success(g>0?`Renamed slug and updated ${g} ${g===1?"post":"posts"}`:"Renamed slug"),N(null)}catch(g){j(o),N(null),T.error(g instanceof Error?g.message:"Rename failed")}finally{P(!1)}},W=()=>{const o=R.trim();if(o===a){R!==o&&j(o);return}if(!o){j(a);return}if(y===0){H(o);return}N({oldSlug:a,newSlug:o,count:y})};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:v(r.name)||"Untitled category"}),t.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[t.jsx(pt,{isPending:i.isPending,isError:i.isError}),u&&t.jsxs(U,{type:"button",variant:"outline",size:"sm",title:"Open the category preview in a new tab",onClick:()=>window.open(u,"_blank","noopener,noreferrer"),children:[t.jsx(Y,{size:14}),"See category preview"]})]})]}),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:v(r.name),onChange:o=>s("name",o),placeholder:"Category name",className:"py-1 text-3xl font-bold text-foreground"}),t.jsxs("div",{className:"mt-4 space-y-2",children:[t.jsx(q,{htmlFor:"category-slug",children:"Slug"}),t.jsx(L,{id:"category-slug",value:R,onChange:o=>j(o.target.value),onBlur:W,placeholder:"my-category",className:"h-10"})]}),t.jsxs("div",{className:"mt-4 space-y-2",children:[t.jsx(q,{htmlFor:"category-description",children:"Description"}),t.jsx(L,{id:"category-description",value:v(r.description),onChange:o=>s("description",o.target.value),placeholder:"Short description for this category",className:"h-10"})]}),t.jsx(Nt,{icon:Z,title:"Content",defaultOpen:!0,children:t.jsx(xt,{value:ft(r.sections),onChange:o=>s("sections",o),meta:A,sandboxRef:{orgSlug:b,virtualMcpId:e,branch:x},emptyMessage:"This category has no content yet. Use ⊕ to add your first block."})}),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(I,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"text-sm",children:[y," ",y===1?"post":"posts"," in this category"]})]}),t.jsxs(U,{type:"button",variant:"outline",size:"sm",disabled:!a,title:a?"Pick posts to add to this category":"Set a slug to add posts to this category",onClick:()=>f(a),children:["Add posts",t.jsx(X,{size:14})]})]}),y>0&&t.jsx("ul",{className:"divide-y border-t bg-background",children:$.map(o=>t.jsx("li",{children:t.jsxs("button",{type:"button",onClick:()=>D(o.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(I,{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:o.title||"Untitled post"}),o.slug&&t.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:o.slug})]})]})},o.key))})]})]})})]}),t.jsx(_,{open:!!m,onOpenChange:o=>{o||w||(j(a),N(null))},children:t.jsxs(K,{children:[t.jsxs(tt,{children:[t.jsx(et,{children:"Rename category slug?"}),t.jsx(ot,{children:m?`Changing the slug from "${m.oldSlug}" to "${m.newSlug}" will update ${m.count} ${m.count===1?"post":"posts"} that reference this category.`:null})]}),t.jsxs(rt,{children:[t.jsx(it,{disabled:w,children:"Cancel"}),t.jsx(st,{onClick:o=>{o.preventDefault(),m&&M(m.oldSlug,m.newSlug)},disabled:w,children:w?t.jsxs(t.Fragment,{children:[t.jsx(V,{size:14,className:"animate-spin"}),"Renaming…"]}):"Rename & update posts"})]})]})})]})}export{yr as CategoryEditor};
@@ -1 +0,0 @@
1
- import{c as n,l as d,j as c,bD as l,bE as b}from"./index-DmhdwAgP.js";import{i as m}from"./ChevronUp-D5F6V6Tm.js";function u(o){const e=n.c(9);let r,i;e[0]!==o?({className:r,...i}=o,e[0]=o,e[1]=r,e[2]=i):(r=e[1],i=e[2]);let a;e[3]!==r?(a=d("peer border-foreground dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[2px] disabled:opacity-50",r),e[3]=r,e[4]=a):a=e[4];let t;e[5]===Symbol.for("react.memo_cache_sentinel")?(t=c.jsx(b,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-primary-foreground transition-none",children:c.jsx(m,{className:"size-3.5"})}),e[5]=t):t=e[5];let s;return e[6]!==i||e[7]!==a?(s=c.jsx(l,{"data-slot":"checkbox",className:a,...i,children:t}),e[6]=i,e[7]=a,e[8]=s):s=e[8],s}export{u as C};
@@ -1 +0,0 @@
1
- import{c as y,j as t,B as F,i as Z,H as Ge,I as se,E as Pe,r as T,C as re,M as Qe,l as V,bd as Ye,u as Ze,L as G,t as Xe,e as ae,aZ as ke}from"./index-DmhdwAgP.js";import{E as Ae}from"./empty-state-BHuw6cM9.js";import{u as et,a as Ee}from"./use-collections-DaXoNaLL.js";import{u as ce}from"./use-mcp-client-DseZ3Mea.js";import{F as ne,a as tt,b as de,d as me}from"./form-C9InGmo4.js";import{I as ue}from"./input-TkvVVsQL.js";import{T as le}from"./textarea-DjtAtA2l.js";import{a as st,b as nt,V as pe,O as ot,M as it}from"./index-CbhDnqOu.js";import{az as lt,R as rt,aq as at,Y as ct,a7 as dt,aA as mt,a0 as be}from"./agent-icon-DicjSkHu.js";import{g as ut,M as pt,a as Ne}from"./index-f6gbzJ8b.js";import{A as xt,a as ft,b as ht}from"./alert-C_4AvGUo.js";import{S as ve,a as Se,b as ye,c as we,d as oe}from"./select-AzuoAc3H.js";import{c as gt,b as Ce,T as Ie,a as $e}from"./tooltip-cvFTpZ9W.js";import{i as jt}from"./AlertCircle-B9GlbKHh.js";import{s as bt}from"./Stars02-B08FvcHQ.js";import{a as Nt}from"./Copy01-BkGYkmm-.js";import{i as vt}from"./Play-B8fWmOst.js";import{i as St}from"./ChevronRight-YmTewr_B.js";import{g as yt}from"./connection-slug-eyAPH6o3.js";import{u as wt,T as Ct}from"./use-mcp-auth-status-BpAt0IbR.js";import{a as Re,u as Oe}from"./use-connection-DM1ROgj3.js";import{a as It}from"./use-mcp-tools-DJGNLf9H.js";import{M as $t,c as Tt}from"./monaco-editor-DfuNvLfy.js";import{I as Te}from"./integration-icon-CWb3OXTV.js";import{h as Pt,m as kt}from"./chat-context-DSveBxCg.js";import{u as At}from"./shell-layout-6KUu0MA6.js";import{n as Et}from"./Tool02-B0-a0UMl.js";import"./auth-CsHQFHV_.js";import"./label-CB2o7dZ2.js";import"./index-DBhNC4I_.js";import"./sidebar-DnKMI8jz.js";import"./LayoutLeft-BI-sXAac.js";import"./use-mobile-D8w2xyip.js";import"./X-Dif5I5BD.js";import"./ZoomOut-BprgOfkE.js";import"./Key01-DhLD806C.js";import"./extract-connection-data-_NDoBHMa.js";import"./use-registry-connections-BZ0Z0jCg.js";import"./use-organization-settings-bBY4klS6.js";import"./studio-tools-DIWsVaKg.js";import"./Plus-2c1jULco.js";import"./index-629FAmzK.js";import"./index-CO3868Cu.js";import"./popover-DwV6WXHS.js";import"./use-virtual-mcp-urYy02xb.js";import"./ChevronUp-D5F6V6Tm.js";import"./SearchMd-lwIiBODG.js";import"./Users03-Bx4g7VTC.js";import"./use-create-virtual-mcp-Clu62lnk.js";import"./use-navigate-to-agent-YScxPu5L.js";import"./hooks-DU-2h9eZ.js";import"./decopilot-sse-pool-CEQrv8Fn.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./reusable-new-chat-CouMjkYR.js";import"./Tool01-BR3IBeV9.js";import"./ArrowUp-DNZsq7Zt.js";import"./Settings02-DMpqOK24.js";import"./XCircle-C0OdV3N_.js";import"./ArrowUpRight-DZZygrAi.js";import"./TrendUp01-CeRF_789.js";import"./ZapSquare-EvC2T9CP.js";import"./CheckCircle-BEcdXH7-.js";import"./ChevronDown-BSRiDjXd.js";import"./DotsVertical-BmTi7wpl.js";import"./Globe01-D3vBqhI7.js";import"./Eye-B-ZfWIGj.js";import"./FilterLines-BwWG7tAk.js";import"./Star01-DoUbKevt.js";import"./Globe04-pvxBukgJ.js";import"./SwitchHorizontal01-Rgis0XWf.js";import"./HardDrive-DutZPQFL.js";import"./Image01-PIeYnf-K.js";import"./LinkExternal01-DO3QnLus.js";import"./Monitor01-BOILvS2u.js";import"./Sun-nDXz4jeM.js";import"./Package-DbEcG94t.js";import"./Palette-CyZvWKmI.js";import"./SearchLg-XmvudKlH.js";import"./Shield01-gTFc9c17.js";import"./Stars01-CJsm_THn.js";import"./Trash01-Ba6bCbNY.js";import"./Upload01-B14IruoN.js";import"./User01-ByIE6k8L.js";import"./Users01-BdldAr7H.js";import"./XClose-DomD4542.js";import"./Zap-CEUVQQOc.js";import"./badge-C_9mnuBd.js";import"./mcp-oauth-B5rKpHdd.js";import"./index-DnrPO2j2.js";import"./autosend-BgYoPuWD.js";import"./use-ai-providers-ZLuBEaKb.js";import"./location-BpLtHjTZ.js";import"./tab-id-BijBBRwE.js";import"./use-decopilot-events-CX_EuT5c.js";import"./avatar-BVdHZbMN.js";import"./use-t-BjZG1zRp.js";import"./dialog-DUqhzGiD.js";import"./required-auth-layout-ABsqitxw.js";import"./use-org-sso-diAgeADE.js";function Rt(s){const e=y.c(15),{onSave:o,onUndo:n,isDirty:i,isSaving:l,saveLabel:a,undoLabel:c}=s,r=a===void 0?"Save":a,u=c===void 0?"Undo":c;if(!i)return null;let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(lt,{size:14}),e[0]=p):p=e[0];let m;e[1]!==l||e[2]!==n||e[3]!==u?(m=t.jsxs(F,{variant:"outline",size:"sm",onClick:n,disabled:l,"aria-label":u,children:[p,u]}),e[1]=l,e[2]=n,e[3]=u,e[4]=m):m=e[4];let x;e[5]!==l?(x=l?t.jsx(Z,{size:14,className:"animate-spin"}):t.jsx(rt,{size:14}),e[5]=l,e[6]=x):x=e[6];let f;e[7]!==l||e[8]!==o||e[9]!==r||e[10]!==x?(f=t.jsxs(F,{variant:"default",size:"sm",onClick:o,disabled:l,"aria-label":r,children:[x,r]}),e[7]=l,e[8]=o,e[9]=r,e[10]=x,e[11]=f):f=e[11];let g;return e[12]!==m||e[13]!==f?(g=t.jsxs(t.Fragment,{children:[m,f]}),e[12]=m,e[13]=f,e[14]=g):g=e[14],g}Ge({title:se().min(1),description:se().nullable(),body:se()});function ie(s){for(const e of s.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function Ot(){const s=window.location.pathname.split("/").filter(Boolean),e=s.findIndex(n=>n==="mcps"),o=e>=0?s[e+1]:void 0;return o?decodeURIComponent(o):void 0}function _t(s){const e=y.c(13),{form:o}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Details"}),e[0]=n):n=e[0];let i;e[1]!==o.control?(i=t.jsxs("div",{className:"flex flex-col gap-4",children:[n,t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsx(ne,{control:o.control,name:"title",render:Dt}),t.jsx(ne,{control:o.control,name:"description",render:zt})]})]}),e[1]=o.control,e[2]=i):i=e[2];let l,a;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Message"}),a=t.jsx("div",{className:"text-xs text-muted-foreground",children:"This becomes the user message in the prompt."}),e[3]=l,e[4]=a):(l=e[3],a=e[4]);let c;e[5]!==o.control?(c=t.jsxs("div",{className:"flex flex-col gap-2",children:[l,a,t.jsx(ne,{control:o.control,name:"body",render:Mt})]}),e[5]=o.control,e[6]=c):c=e[6];let r;e[7]!==i||e[8]!==c?(r=t.jsxs("div",{className:"h-full py-6 flex flex-col max-w-3xl mx-auto w-full min-w-0 gap-8 overflow-y-auto px-4",children:[i,c]}),e[7]=i,e[8]=c,e[9]=r):r=e[9];let u;return e[10]!==o||e[11]!==r?(u=t.jsx(tt,{...o,children:r}),e[10]=o,e[11]=r,e[12]=u):u=e[12],u}function Mt(s){const{field:e}=s;return t.jsx(de,{children:t.jsx(me,{children:t.jsx(le,{...e,value:e.value??"",placeholder:"Write the prompt message…",className:"min-h-[240px] resize-none text-base leading-relaxed font-normal rounded-xl border border-border bg-muted/20 px-4 py-3 shadow-none focus-visible:ring-0"})})})}function zt(s){const{field:e}=s;return t.jsxs(de,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),t.jsx(me,{children:t.jsx(ue,{...e,value:e.value??"",placeholder:"Add a description…",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Dt(s){const{field:e}=s;return t.jsxs(de,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),t.jsx(me,{children:t.jsx(ue,{...e,placeholder:"Untitled prompt",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Lt(s){const e=y.c(36),{providerId:o,promptId:n}=s,{org:i}=re(),l=o||null;let a;e[0]!==i.id||e[1]!==i.slug||e[2]!==l?(a={connectionId:l,orgId:i.id,orgSlug:i.slug},e[0]=i.id,e[1]=i.slug,e[2]=l,e[3]=a):a=e[3];const c=ce(a),r=et(o,"PROMPT",n,c),u=Ee(o,"PROMPT",c),p=u.update.isPending;let m;e[4]!==r?(m=r?{title:r.title,description:r.description??null,body:ie(r)}:void 0,e[4]=r,e[5]=m):m=e[5];let x;e[6]!==m?(x={values:m},e[6]=m,e[7]=x):x=e[7];const f=Qe(x);let g;e[8]!==f||e[9]!==r?(g=()=>{r&&f.reset({title:r.title,description:r.description??null,body:ie(r)})},e[8]=f,e[9]=r,e[10]=g):g=e[10];const S=g;let I;e[11]!==u.update||e[12]!==f||e[13]!==n?(I=f.handleSubmit(async N=>{const E=await u.update.mutateAsync({id:n,data:{title:N.title,description:N.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:N.body}}]}});f.reset({title:E.title,description:E.description??null,body:ie(E)})}),e[11]=u.update,e[12]=f,e[13]=n,e[14]=I):I=e[14];const O=I;if(!r){let N;return e[15]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ae,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[15]=N):N=e[15],N}let $;e[16]!==r.title?($=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:r.title}),e[16]=r.title,e[17]=$):$=e[17];let A;e[18]!==r.description?(A=r.description?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),t.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:r.description})]}):null,e[18]=r.description,e[19]=A):A=e[19];let P;e[20]!==$||e[21]!==A?(P=t.jsx(nt,{children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[$,A]})}),e[20]=$,e[21]=A,e[22]=P):P=e[22];let b;e[23]!==O?(b=()=>{O()},e[23]=O,e[24]=b):b=e[24];let w;e[25]!==f.formState.isDirty||e[26]!==p||e[27]!==S||e[28]!==b?(w=t.jsx(st,{children:t.jsx(Rt,{onSave:b,onUndo:S,isDirty:f.formState.isDirty,isSaving:p})}),e[25]=f.formState.isDirty,e[26]=p,e[27]=S,e[28]=b,e[29]=w):w=e[29];let C;e[30]!==f?(C=t.jsx("div",{className:"h-full",children:t.jsx(_t,{form:f})}),e[30]=f,e[31]=C):C=e[31];let k;return e[32]!==w||e[33]!==C||e[34]!==P?(k=t.jsxs(pe,{children:[P,w,C]}),e[32]=w,e[33]=C,e[34]=P,e[35]=k):k=e[35],k}function Ut(s){const e=y.c(4),{itemId:o}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=Ot(),e[0]=n):n=e[0];const i=n;if(!i){let a;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ae,{title:"Prompt not found",description:"Missing connection information in the current route."})}),e[1]=a):a=e[1],a}let l;return e[2]!==o?(l=t.jsx(Pe,{children:t.jsx(T.Suspense,{fallback:null,children:t.jsx(Lt,{providerId:i,promptId:o})})}),e[2]=o,e[3]=l):l=e[3],l}function _e(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let i;e[3]!==o?(i=V("min-w-0 overflow-hidden",o),e[3]=o,e[4]=i):i=e[4];let l;return e[5]!==n||e[6]!==i?(l=t.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",className:i,...n}),e[5]=n,e[6]=i,e[7]=l):l=e[7],l}function Me(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let i;e[3]!==o?(i=V("flex items-center gap-1.5 text-sm sm:gap-2 overflow-hidden",o),e[3]=o,e[4]=i):i=e[4];let l;return e[5]!==n||e[6]!==i?(l=t.jsx("ol",{"data-slot":"breadcrumb-list",className:i,...n}),e[5]=n,e[6]=i,e[7]=l):l=e[7],l}function q(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let i;e[3]!==o?(i=V("inline-flex items-center gap-1.5 min-w-0",o),e[3]=o,e[4]=i):i=e[4];let l;return e[5]!==n||e[6]!==i?(l=t.jsx("li",{"data-slot":"breadcrumb-item",className:i,...n}),e[5]=n,e[6]=i,e[7]=l):l=e[7],l}function Q(s){const e=y.c(10);let o,n,i;e[0]!==s?({asChild:o,className:n,...i}=s,e[0]=s,e[1]=o,e[2]=n,e[3]=i):(o=e[1],n=e[2],i=e[3]);const l=o?Ye:"a";let a;e[4]!==n?(a=V("hover:text-foreground transition-colors truncate",n),e[4]=n,e[5]=a):a=e[5];let c;return e[6]!==l||e[7]!==i||e[8]!==a?(c=t.jsx(l,{"data-slot":"breadcrumb-link",className:a,...i}),e[6]=l,e[7]=i,e[8]=a,e[9]=c):c=e[9],c}function ze(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let i;e[3]!==o?(i=V("text-foreground font-medium truncate",o),e[3]=o,e[4]=i):i=e[4];let l;return e[5]!==n||e[6]!==i?(l=t.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:i,...n}),e[5]=n,e[6]=i,e[7]=l):l=e[7],l}function Y(s){const e=y.c(12);let o,n,i;e[0]!==s?({children:o,className:n,...i}=s,e[0]=s,e[1]=o,e[2]=n,e[3]=i):(o=e[1],n=e[2],i=e[3]);let l;e[4]!==n?(l=V("[&>svg]:size-3.5 text-muted-foreground opacity-50 list-none shrink-0",n),e[4]=n,e[5]=l):l=e[5];let a;e[6]!==o?(a=o??t.jsx(St,{}),e[6]=o,e[7]=a):a=e[7];let c;return e[8]!==i||e[9]!==l||e[10]!==a?(c=t.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:l,...i,children:a}),e[8]=i,e[9]=l,e[10]=a,e[11]=c):c=e[11],c}const Bt=s=>s.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Ft(s){const e=y.c(11),{toolName:o,connectionId:n,siblings:i,onSelectInstance:l,onBack:a}=s;let c;e[0]!==n?(c={connectionId:n},e[0]=n,e[1]=c):c=e[1];const r=wt(c);if(!r.isAuthenticated){let m;return e[2]!==r.supportsOAuth||e[3]!==a?(m=t.jsx("div",{className:"flex h-full items-center justify-center",children:r.supportsOAuth?t.jsx(ot,{onAuthenticate:()=>a(),buttonText:"Go back to authenticate"}):t.jsx(it,{hasReadme:!1})}),e[2]=r.supportsOAuth,e[3]=a,e[4]=m):m=e[4],m}const u=`${n}:${o}`;let p;return e[5]!==n||e[6]!==l||e[7]!==i||e[8]!==u||e[9]!==o?(p=t.jsx(Vt,{toolName:o,connectionId:n,siblings:i,onSelectInstance:l},u),e[5]=n,e[6]=l,e[7]=i,e[8]=u,e[9]=o,e[10]=p):p=e[10],p}function Vt({toolName:s,connectionId:e,siblings:o,onSelectInstance:n}){const{replayId:i}=Ze({strict:!1}),l=(()=>{if(!i)return null;const d=`replay-${i}`,h=sessionStorage.getItem(d);if(!h)return null;sessionStorage.removeItem(d);try{return JSON.parse(h)}catch{return null}})(),a=(()=>{if(!l)return null;const d={};for(const[h,v]of Object.entries(l))v!==null&&typeof v=="object"?d[h]=JSON.stringify(v,null,2):d[h]=v;return d})(),[c,r]=T.useState(a??{}),[u,p]=T.useState(l?JSON.stringify(l,null,2):"{}"),[m,x]=T.useState(null),[f,g]=T.useState(null),[S,I]=T.useState(null),[O,$]=T.useState(null),[A,P]=T.useState(!1),[b,w]=T.useState(null),{org:C}=re(),k=Re(e),N=Pt(),E=kt(),{openSidePanel:U}=At(),D=`${e}:${s}`,_=ce({connectionId:e,orgId:C.id,orgSlug:C.slug}),L=It({client:_}),j=L.data?.tools?.find(d=>d.name===s),R=ut(j?._meta),J=d=>{if(!N)return;const h=Tt(d.content);h.content.length>0&&(U("chat"),N.sendMessage({tiptapDoc:h}))},[M,X]=T.useState("json"),[De,Le]=T.useState(!1);R&&!De&&(X("ui"),Le(!0));const xe=j?.inputSchema?.properties,fe=xe?Object.keys(xe):[],H=fe.length>0,K={};if(H&&j?.inputSchema?.properties)for(const d of fe)K[d]=j.inputSchema.required?.includes(d)?"":void 0;const ee=d=>Object.prototype.hasOwnProperty.call(c,d),Ue=async()=>{P(!0),$(null),x(null),g(null),I(null),w(null);const d=performance.now();try{if(!_)throw new Error("MCP client is not available");const h=H?{...K,...c}:(()=>{const z=u.trim();if(!z)return{};const B=JSON.parse(z);if(B&&typeof B=="object")return B;throw new Error("Raw JSON input must be an object.")})();H&&j?.inputSchema?.properties&&Object.entries(j.inputSchema.properties).forEach(([z,B])=>{if((B.type==="object"||B.type==="array")&&typeof h[z]=="string")try{h[z]=JSON.parse(h[z])}catch{}else if((B.type==="number"||B.type==="integer")&&typeof h[z]=="string"&&h[z]!==""){const je=Number(h[z]);Number.isNaN(je)||(h[z]=je)}});const v=await _.callTool({name:s,arguments:h}),W=v.structuredContent??v,He=performance.now(),Ke=Math.round(He-d);x(W),g(v),I(h);const We=JSON.stringify(W),ge=new TextEncoder().encode(We).length;w({duration:`${Ke}ms`,bytes:`${ge} bytes`,tokens:`~${Math.ceil(ge/4)} tokens`,cost:"$0.0000"})}catch(h){const v=h instanceof Error?h.message:String(h);$(v||"Unknown error occurred");const W=performance.now();w({duration:`${Math.round(W-d)}ms`})}finally{P(!1)}},te=(d,h)=>{r(v=>({...v,[d]:h}))},Be=()=>{x(null),g(null),I(null),$(null),w(null)},Fe=j?.name??Bt(s),Ve=t.jsx(_e,{children:t.jsxs(Me,{children:[t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections",params:{org:C.slug},children:"Connections"})})}),t.jsx(Y,{}),k&&t.jsxs(t.Fragment,{children:[t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections/$appSlug",params:{org:C.slug,appSlug:yt(k)},search:{tab:"tools"},children:k.title})})}),t.jsx(Y,{})]}),t.jsx(q,{children:t.jsx(ze,{children:Fe})})]})}),he=o.length>1&&t.jsxs(ve,{value:e,onValueChange:n,children:[t.jsx(Se,{className:"h-8 w-auto min-w-[200px]",children:t.jsx(ye,{})}),t.jsx(we,{children:o.map(d=>t.jsx(oe,{value:d.id,children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Te,{icon:d.icon,name:d.title,size:"xs",className:"shrink-0"}),d.title]})},d.id))})]}),Je=t.jsxs("div",{className:"flex flex-col p-6 gap-4 overflow-auto",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-foreground uppercase tracking-wide",children:"Parameters"}),j?.inputSchema?.required&&j.inputSchema.required.length>0&&t.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.jsx("span",{className:"text-destructive",children:"*"})," Required"]})]}),t.jsx("div",{className:"space-y-4",children:H&&j?.inputSchema?.properties?Object.entries(j.inputSchema.properties).map(([d,h])=>t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("label",{className:"text-sm font-medium leading-none flex items-center gap-1.5",children:[d,j.inputSchema?.required?.includes(d)&&t.jsx("span",{className:"text-destructive text-xs",children:"*"})]}),t.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:h.type})]}),h.description&&t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:h.description}),h.type==="object"||h.type==="array"?t.jsx(le,{className:"font-mono text-xs",value:ee(d)?c[d]??"":K[d]??"",onChange:v=>te(d,v.target.value),placeholder:`Enter ${d} as JSON...`,rows:3}):h.type==="boolean"?t.jsxs(ve,{value:ee(d)?String(c[d]??""):"",onValueChange:v=>te(d,v==="true"),children:[t.jsx(Se,{children:t.jsx(ye,{placeholder:"Select true or false..."})}),t.jsxs(we,{children:[t.jsx(oe,{value:"true",children:"true"}),t.jsx(oe,{value:"false",children:"false"})]})]}):t.jsx(ue,{value:ee(d)?c[d]??"":K[d]??"",onChange:v=>te(d,v.target.value),placeholder:`Enter ${d}...`})]},d)):j?.inputSchema&&!H?t.jsxs("div",{className:"space-y-2",children:[t.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),t.jsx(le,{className:"font-mono text-xs min-h-[120px]",value:u,onChange:d=>p(d.target.value),placeholder:'e.g. { "foo": "bar" }'})]}):t.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"No parameters required"})})}),t.jsx("div",{className:"flex items-center gap-2 pt-2",children:A?t.jsxs(F,{size:"sm",variant:"destructive",className:"h-8 gap-2",onClick:Be,children:[t.jsx(at,{className:"h-3.5 w-3.5"}),"Cancel"]}):t.jsxs(F,{size:"sm",variant:"default",className:"h-8 gap-2",onClick:Ue,children:[t.jsx(vt,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})})]}),qe=t.jsxs("div",{className:"flex flex-col @3xl:h-full @3xl:overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-b border-border bg-background",children:[t.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:"Result"}),t.jsxs("div",{className:"flex items-center gap-3",children:[b&&t.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(bt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.duration})]}),b.tokens&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ct,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.tokens})]}),b.bytes&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(dt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.bytes})]}),b.cost&&t.jsx("div",{className:"flex items-center gap-1.5",children:t.jsx("span",{className:"font-mono text-foreground",children:b.cost})})]}),R&&t.jsx(gt,{children:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(F,{size:"icon",variant:M==="ui"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>X("ui"),children:t.jsx(mt,{size:14})})}),t.jsx($e,{children:"Interactive view"})]}),t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(F,{size:"icon",variant:M==="json"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>X("json"),children:t.jsx(be,{size:14})})}),t.jsx($e,{children:"JSON view"})]})]})})]})]}),O&&t.jsx("div",{className:"px-6 py-4 bg-background",children:t.jsx(xt,{variant:"destructive",children:t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(jt,{className:"h-4 w-4"}),t.jsx(ft,{className:"mb-0",children:"Execution Failed"})]}),t.jsx(ht,{className:"text-xs text-destructive",children:O})]})})}),t.jsx("div",{className:"relative flex-1 min-h-[400px] @3xl:min-h-0 @3xl:overflow-auto bg-muted/50",children:R&&M==="ui"&&_?t.jsx(T.Suspense,{fallback:t.jsx("div",{className:"flex items-center justify-center h-48",children:t.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[t.jsx("div",{className:"size-4 border-2 border-current border-t-transparent rounded-full animate-spin"}),t.jsx("span",{className:"text-sm",children:"Loading app..."})]})}),children:t.jsx(pt,{resourceURI:R,toolInfo:j?{tool:j}:void 0,toolInput:S??void 0,toolResult:f??void 0,displayMode:"fullscreen",minHeight:Ne.view.minHeight,maxHeight:Ne.view.maxHeight,client:_,onMessage:J,onUpdateModelContext:d=>E?.setAppContext(D,d),onTeardown:()=>E?.clearAppContext(D),className:"h-full"})}):m?t.jsxs(t.Fragment,{children:[t.jsx($t,{code:JSON.stringify(m,null,2),language:"json",height:"100%",readOnly:!0}),t.jsx(F,{size:"icon",variant:"ghost",className:"absolute top-4 right-4 h-8 w-8 bg-background/80 hover:bg-background border border-border shadow-sm",onClick:()=>{navigator.clipboard.writeText(JSON.stringify(m,null,2)),Xe.success("Copied to clipboard")},children:t.jsx(Nt,{className:"h-3.5 w-3.5"})})]}):t.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[t.jsx(be,{className:"h-12 w-12 mb-3 opacity-40"}),t.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]});return t.jsx(pe,{breadcrumb:Ve,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden @container",children:[t.jsxs("div",{className:"flex flex-col gap-3 py-7 px-8 bg-background border-b border-border shrink-0",children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx(Te,{icon:k?.icon||null,name:k?.title||s,size:"xl",className:"shrink-0"}),t.jsx("h1",{className:"text-xl font-semibold tracking-tight text-foreground leading-none truncate",children:s}),t.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-muted/50 rounded-md h-fit shrink-0",children:[L.isSuccess?t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-success animate-pulse shrink-0"}):L.isLoading?t.jsx(Z,{size:10,className:"animate-spin text-warning shrink-0"}):t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-destructive shrink-0"}),t.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:L.isSuccess?"ready":L.isLoading?"connecting":"error"})]}),t.jsx(Ct,{annotations:j?.annotations,_meta:j?._meta}),t.jsx("div",{className:"hidden @3xl:flex items-center ml-auto shrink-0",children:he})]}),t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:j?.description||"No description available"})]}),o.length>1&&t.jsxs("div",{className:"flex @3xl:hidden items-center gap-3 px-8 py-3 border-b border-border",children:[t.jsx("span",{className:"text-xs font-medium text-muted-foreground shrink-0",children:"Instance"}),he]}),t.jsx("div",{className:"flex-1 overflow-auto @3xl:overflow-hidden",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-[minmax(0,2fr)_minmax(0,5fr)] @3xl:h-full @3xl:grid-rows-1",children:[t.jsx("div",{className:"@3xl:border-r border-border @3xl:overflow-auto",children:Je}),qe]})})]})})}function Jt(s){const e=y.c(10),{itemId:o,siblings:n,onBack:i}=s,[l,a]=T.useState(n[0]?.id??"");let c;e[0]!==l||e[1]!==n?(c=n.find(x=>x.id===l)?.id??n[0]?.id??"",e[0]=l,e[1]=n,e[2]=c):c=e[2];const r=c;if(!Re(r||void 0)||!r){let x;return e[3]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[t.jsx("h3",{className:"text-lg font-semibold",children:"Connection not found"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection may have been deleted or you may not have access."})]})}),e[3]=x):x=e[3],x}let p;e[4]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Z,{size:32,className:"animate-spin text-muted-foreground"})}),e[4]=p):p=e[4];let m;return e[5]!==r||e[6]!==i||e[7]!==n||e[8]!==o?(m=t.jsx(T.Suspense,{fallback:p,children:t.jsx(Ft,{toolName:o,connectionId:r,siblings:n,onSelectInstance:a,onBack:i})}),e[5]=r,e[6]=i,e[7]=n,e[8]=o,e[9]=m):m=e[9],m}function qt(s){const e=y.c(21),{icon:o,illustration:n,title:i,description:l,buttonProps:a,buttonComponent:c,className:r,children:u}=s;let p;e[0]!==r?(p=V("flex flex-col items-center justify-center py-16 text-center",r),e[0]=r,e[1]=p):p=e[1];let m;e[2]!==o||e[3]!==n?(m=n?t.jsx("div",{className:"mb-4 text-muted-foreground/50",children:n}):o?t.jsx("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-xl bg-muted/50 text-muted-foreground",children:o}):null,e[2]=o,e[3]=n,e[4]=m):m=e[4];let x;e[5]!==i?(x=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:i}),e[5]=i,e[6]=x):x=e[6];let f;e[7]!==l?(f=l&&t.jsx("div",{className:"text-sm text-muted-foreground",children:l}),e[7]=l,e[8]=f):f=e[8];let g;e[9]!==x||e[10]!==f?(g=t.jsxs("div",{className:"flex flex-col items-center gap-1 max-w-sm",children:[x,f]}),e[9]=x,e[10]=f,e[11]=g):g=e[11];let S;e[12]!==c||e[13]!==a?(S=(c??a)&&t.jsx("div",{className:"mt-4",children:c??(a&&t.jsx(F,{size:"sm",className:V(a?.className),...a}))}),e[12]=c,e[13]=a,e[14]=S):S=e[14];let I;return e[15]!==u||e[16]!==p||e[17]!==m||e[18]!==g||e[19]!==S?(I=t.jsxs("div",{className:p,children:[m,g,S,u]}),e[15]=u,e[16]=p,e[17]=m,e[18]=g,e[19]=S,e[20]=I):I=e[20],I}const Ht={prompt:Ut};function Kt(){const s=y.c(9),e=ke();let o;s[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=o):o=s[0];const n=ae(o),i=decodeURIComponent(n.itemId);let l;s[1]!==n.appSlug?(l={slug:n.appSlug},s[1]=n.appSlug,s[2]=l):l=s[2];const a=Oe(l);let c;s[3]!==e.history?(c=()=>{e.history.back()},s[3]=e.history,s[4]=c):c=s[4];const r=c,u=Wt;let p;return s[5]!==r||s[6]!==i||s[7]!==a?(p=t.jsx(Jt,{itemId:i,siblings:a,onBack:r,onUpdate:u}),s[5]=r,s[6]=i,s[7]=a,s[8]=p):p=s[8],p}async function Wt(s){return Promise.resolve()}function Gt(s){return s.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Qt(){const s=y.c(41),e=ke();let o;s[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=o):o=s[0];const n=ae(o),i=decodeURIComponent(n.collectionName),l=decodeURIComponent(n.itemId);let a;s[1]!==e.history?(a=()=>{e.history.back()},s[1]=e.history,s[2]=a):a=s[2];const c=a,{org:r}=re();let u;s[3]!==n.appSlug?(u={slug:n.appSlug},s[3]=n.appSlug,s[4]=u):u=s[4];const m=Oe(u)[0]??null,x=m?.id??"",f=x||"no-connection",g=x??null;let S;s[5]!==r.id||s[6]!==r.slug||s[7]!==g?(S={connectionId:g,orgId:r.id,orgSlug:r.slug},s[5]=r.id,s[6]=r.slug,s[7]=g,s[8]=S):S=s[8];const I=ce(S),O=Ee(f,i,I);let $;s[9]!==O||s[10]!==l?($=async M=>{l&&await O.update.mutateAsync({id:l,data:M})},s[9]=O,s[10]=l,s[11]=$):$=s[11];const A=$;let P;s[12]!==i?(P=i?.toLowerCase(),s[12]=i,s[13]=P):P=s[13];const b=P,w=b&&Ht[b];let C;s[14]!==i?(C=Gt(i),s[14]=i,s[15]=C):C=s[15];const k=C;let N;s[16]!==r.slug?(N=t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections",params:{org:r.slug},children:"Connections"})})}),s[16]=r.slug,s[17]=N):N=s[17];let E;s[18]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(Y,{}),s[18]=E):E=s[18];let U;s[19]!==i||s[20]!==m||s[21]!==r.slug||s[22]!==n.appSlug?(U=m&&t.jsxs(t.Fragment,{children:[t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections/$appSlug",params:{org:r.slug,appSlug:n.appSlug},search:{tab:i},children:m.title})})}),t.jsx(Y,{})]}),s[19]=i,s[20]=m,s[21]=r.slug,s[22]=n.appSlug,s[23]=U):U=s[23];let D;s[24]!==k?(D=t.jsx(q,{children:t.jsx(ze,{children:k})}),s[24]=k,s[25]=D):D=s[25];let _;s[26]!==U||s[27]!==D||s[28]!==N?(_=t.jsx(_e,{children:t.jsxs(Me,{children:[N,E,U,D]})}),s[26]=U,s[27]=D,s[28]=N,s[29]=_):_=s[29];const L=_;if(w){let M;return s[30]!==w||s[31]!==c||s[32]!==A||s[33]!==l?(M=t.jsx(w,{itemId:l,onBack:c,onUpdate:A}),s[30]=w,s[31]=c,s[32]=A,s[33]=l,s[34]=M):M=s[34],M}let j;s[35]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(Et,{size:36,className:"text-muted-foreground"}),s[35]=j):j=s[35];let R;s[36]!==c?(R=t.jsx(qt,{icon:j,title:"No component defined",description:"No component for this collection was defined",buttonProps:{onClick:c,children:"Go back"}}),s[36]=c,s[37]=R):R=s[37];let J;return s[38]!==L||s[39]!==R?(J=t.jsx(pe,{breadcrumb:L,children:R}),s[38]=L,s[39]=R,s[40]=J):J=s[40],J}function Yt(){const s=y.c(3);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=e):e=s[0];const o=ae(e);if(decodeURIComponent(o.collectionName)==="tools"){let a;return s[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(Kt,{}),s[1]=a):a=s[1],a}let l;return s[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(Qt,{}),s[2]=l):l=s[2],l}function qn(){const s=y.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Pe,{children:t.jsx(T.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Z,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Yt,{})})}),s[0]=e):e=s[0],e}export{qn as default};
@@ -1 +0,0 @@
1
- import{c as B,j as s,l as M,B as V}from"./index-DmhdwAgP.js";import{d as z,a as _,c as $,D as E}from"./dropdown-menu-D5BTIZvH.js";import{i as L,n as O}from"./ArrowUp-DNZsq7Zt.js";import{i as S}from"./ChevronUp-D5F6V6Tm.js";import{a as R,i as A,c as F}from"./SwitchHorizontal01-Rgis0XWf.js";import{T as I,a as K,c as P,b as W}from"./tooltip-cvFTpZ9W.js";import{V as q}from"./view-mode-toggle-DziN7a9n.js";import{B as G}from"./badge-C_9mnuBd.js";function re(t){const e=B.c(31),{viewMode:r,onViewModeChange:m,sortKey:T,sortDirection:p,onSort:f,sortOptions:u,filters:h}=t;let g;e[0]!==u?(g=u===void 0?[]:u,e[0]=u,e[1]=g):g=e[1];const j=g;let b;e[2]!==h?(b=h===void 0?[]:h,e[2]=h,e[3]=b):b=e[3];const l=b;let v;e[4]!==l?(v=l.filter(J),e[4]=l,e[5]=v):v=e[5];const N=v.length;let w;e[6]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(R,{size:16}),e[6]=w):w=e[6];let i;e[7]!==N?(i=N>0&&s.jsx(G,{variant:"default",className:"absolute -top-1.5 -right-1.5 h-4 min-w-4 px-1 text-[10px] leading-none",children:N}),e[7]=N,e[8]=i):i=e[8];let o;e[9]!==i?(o=s.jsx(I,{asChild:!0,children:s.jsx(_,{asChild:!0,children:s.jsxs(V,{variant:"outline",size:"icon",className:"relative",children:[w,i]})})}),e[9]=i,e[10]=o):o=e[10];let C;e[11]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(K,{children:"Display & filters"}),e[11]=C):C=e[11];let n;e[12]!==o?(n=s.jsx(P,{children:s.jsxs(W,{children:[o,C]})}),e[12]=o,e[13]=n):n=e[13];let a;e[14]!==m||e[15]!==r?(a=m&&r&&s.jsx("div",{className:"p-2 border-b border-border",children:s.jsx(q,{value:r,onValueChange:m,fullWidth:!0,options:[{value:"table",icon:s.jsx(A,{})},{value:"cards",icon:s.jsx(F,{})}]})}),e[14]=m,e[15]=r,e[16]=a):a=e[16];let c;e[17]!==f||e[18]!==p||e[19]!==T||e[20]!==j?(c=j.length>0&&f&&s.jsxs("div",{className:"p-1 flex flex-col gap-0.5 border-b border-border",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Sort by"}),j.map(y=>{const D=T===y.id;return s.jsx(z,{onClick:()=>f(y.id),className:M("h-8 px-2 py-0 cursor-pointer",D&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[D&&s.jsx(S,{size:16,className:"text-foreground shrink-0"}),!D&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:y.label}),D&&p&&(p==="asc"?s.jsx(L,{size:16,className:"text-foreground shrink-0"}):s.jsx(O,{size:16,className:"text-foreground shrink-0"}))]})},y.id)})]}),e[17]=f,e[18]=p,e[19]=T,e[20]=j,e[21]=c):c=e[21];let d;e[22]!==l?(d=l.map(H),e[22]=l,e[23]=d):d=e[23];let x;e[24]!==a||e[25]!==c||e[26]!==d?(x=s.jsxs($,{align:"end",className:"w-[200px] p-0 gap-0",children:[a,c,d]}),e[24]=a,e[25]=c,e[26]=d,e[27]=x):x=e[27];let k;return e[28]!==n||e[29]!==x?(k=s.jsxs(E,{children:[n,x]}),e[28]=n,e[29]=x,e[30]=k):k=e[30],k}function H(t){return s.jsxs("div",{className:"p-1 flex flex-col gap-0.5 border-b border-border last:border-b-0",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:t.label}),t.options.map(e=>{const r=t.value===e.id;return s.jsx(z,{onClick:()=>t.onChange(e.id),className:M("h-8 px-2 py-0 cursor-pointer",r&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[r&&s.jsx(S,{size:16,className:"text-foreground shrink-0"}),!r&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:e.label})]})},e.id)})]},t.label)}function J(t){return t.value!=="ALL"}export{re as C};
@@ -1 +0,0 @@
1
- import{c as E,j as n,u as Ie,o as De,p as se,r as M,a as Se,b as Fe,q as qe,d as Te,s as Le,Q as He,E as Ve,K as _e,v as Ue,B as je,N as Be}from"./index-DmhdwAgP.js";import{L as Ke,s as ve,S as Pe,a as Ne,b as Ce,c as be,i as Qe,n as pe,C as we,p as xe}from"./self-tool-result-C94YNykg.js";import{A as We}from"./auth-entry-_ePf9_J1.js";import{A as Ge}from"./auth-split-layout-D9UYTbxy.js";import{O as Re}from"./organization-choice-CkG6QFWH.js";import{I as Ye}from"./input-TkvVVsQL.js";import{S as Je,u as Xe,W as Ze,g as et,a as tt}from"./use-mcp-client-DseZ3Mea.js";import{i as it}from"./XCircle-C0OdV3N_.js";import"./integration-icon-CWb3OXTV.js";import"./Tool02-B0-a0UMl.js";import"./agent-icon-DicjSkHu.js";import"./AlertCircle-B9GlbKHh.js";import"./Tool01-BR3IBeV9.js";import"./ArrowUp-DNZsq7Zt.js";import"./Settings02-DMpqOK24.js";import"./ArrowUpRight-DZZygrAi.js";import"./TrendUp01-CeRF_789.js";import"./ZapSquare-EvC2T9CP.js";import"./ZoomOut-BprgOfkE.js";import"./Users03-Bx4g7VTC.js";import"./CheckCircle-BEcdXH7-.js";import"./ChevronUp-D5F6V6Tm.js";import"./ChevronDown-BSRiDjXd.js";import"./ChevronRight-YmTewr_B.js";import"./DotsVertical-BmTi7wpl.js";import"./Stars02-B08FvcHQ.js";import"./Copy01-BkGYkmm-.js";import"./Globe01-D3vBqhI7.js";import"./Eye-B-ZfWIGj.js";import"./FilterLines-BwWG7tAk.js";import"./Star01-DoUbKevt.js";import"./Globe04-pvxBukgJ.js";import"./SwitchHorizontal01-Rgis0XWf.js";import"./HardDrive-DutZPQFL.js";import"./Image01-PIeYnf-K.js";import"./Key01-DhLD806C.js";import"./LayoutLeft-BI-sXAac.js";import"./LinkExternal01-DO3QnLus.js";import"./Monitor01-BOILvS2u.js";import"./Sun-nDXz4jeM.js";import"./Package-DbEcG94t.js";import"./Palette-CyZvWKmI.js";import"./Play-B8fWmOst.js";import"./Plus-2c1jULco.js";import"./SearchLg-XmvudKlH.js";import"./SearchMd-lwIiBODG.js";import"./Shield01-gTFc9c17.js";import"./Stars01-CJsm_THn.js";import"./Trash01-Ba6bCbNY.js";import"./Upload01-B14IruoN.js";import"./User01-ByIE6k8L.js";import"./Users01-BdldAr7H.js";import"./XClose-DomD4542.js";import"./X-Dif5I5BD.js";import"./Zap-CEUVQQOc.js";import"./dialog-DUqhzGiD.js";import"./tooltip-cvFTpZ9W.js";import"./companions-core-C68sN4Wc.js";import"./extract-connection-data-_NDoBHMa.js";import"./github-repo-scope-DjMZbiKa.js";import"./form-C9InGmo4.js";import"./label-CB2o7dZ2.js";import"./use-debounced-value-CSp0_yRg.js";import"./provision-repo-scoped-github-connection-2iDn-wQ1.js";import"./authenticate-and-persist-oauth-CEv4KtcH.js";import"./mcp-oauth-B5rKpHdd.js";import"./auth-CsHQFHV_.js";import"./retry-CErkP7V6.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./avatar-BVdHZbMN.js";const nt={workspace:"Preparando seu workspace de commerce...",generic:"Preparando..."};function ot(l){return nt[l]}function ye(l){const e=E.c(4),{variant:i}=l;let t;e[0]!==i?(t=ot(i),e[0]=i,e[1]=t):t=e[1];let s;return e[2]!==t?(s=n.jsx("div",{className:"flex justify-center py-4",role:"status","aria-live":"polite",children:n.jsx(Ke,{label:t,className:"text-muted-foreground"})}),e[2]=t,e[3]=s):s=e[3],s}function Ti(){const l=E.c(1);let e;return l[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(st,{}),l[0]=e):e=l[0],e}const Me=M.createContext(null),$e=()=>M.useContext(Me);function R(l){const e=E.c(13);let i,t;e[0]!==l?({visual:t,...i}=l,e[0]=l,e[1]=i,e[2]=t):(i=e[1],t=e[2]);let s;e[3]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/commerce-onboarding"},e[3]=s):s=e[3];const c=Ie(s),{data:a}=Se.useSession(),o=a?.user?.email;let m;e[4]!==c.siteUrl||e[5]!==o?(m=Ce({siteUrl:c.siteUrl,email:o}),e[4]=c.siteUrl,e[5]=o,e[6]=m):m=e[6];const d=m;let u;e[7]!==d||e[8]!==t?(u=t??n.jsx(be,{href:d}),e[7]=d,e[8]=t,e[9]=u):u=e[9];let v;return e[10]!==i||e[11]!==u?(v=n.jsx(Ge,{...i,visual:u}),e[10]=i,e[11]=u,e[12]=v):v=e[12],v}const rt={signUpFailed:"Falha ao criar conta",signInFailed:"Falha ao entrar",authenticationFailed:"Falha na autenticação",resetEmailFailed:"Não foi possível enviar o e-mail de redefinição",otpSendFailed:"Não foi possível enviar o código",invalidCode:"Código inválido",invalidEmail:"E-mail inválido",invalidEmailOrPassword:"E-mail ou senha inválidos. Tente novamente.",accountExists:"Já existe uma conta com este e-mail. Tente entrar em vez de criar uma nova conta.",networkError:"Erro de rede. Verifique sua conexão e tente novamente.",tooManyAttempts:"Muitas tentativas. Aguarde um momento e tente novamente.",invalidOrExpiredCode:"Código inválido ou expirado. Tente novamente.",genericError:"Algo deu errado. Tente novamente.",resetPasswordTitle:"Redefinir sua senha",verificationCodeTitle:"Informe o código de verificação",welcomeTitle:"Bem-vindo à deco",resetPasswordSubtitle:"Enviaremos um link de redefinição",codeSentTo:l=>`Código enviado para ${l}`,defaultSubtitle:"Entre ou crie uma nova conta",resetEmailSent:"Verifique seu e-mail para redefinir a senha.",continueWith:l=>`Continuar com ${l}`,divider:"ou",emailLabel:"E-mail",emailPlaceholder:"Endereço de e-mail",sending:"Enviando...",sendCode:"Enviar código",verificationCodeLabel:"Código de verificação",enterCodePlaceholder:"Informe o código",verifying:"Verificando...",verify:"Verificar",useDifferentEmail:"Usar outro e-mail",sendResetLink:"Enviar link de redefinição",nameLabel:"Nome",namePlaceholder:"Seu nome",passwordLabel:"Senha",forgotPassword:"Esqueceu a senha?",creatingAccount:"Criando conta...",signingIn:"Entrando...",continue:"Continuar",backToSignIn:"Voltar para entrar",signInWithPassword:"Entrar com senha",alreadyHaveAccount:"Já tem uma conta? ",dontHaveAccount:"Não tem uma conta? ",signIn:"Entrar",signUp:"Criar conta",signInWithEmailCode:"Entrar com código por e-mail"};function Oe(l){switch(l){case"Enter a website URL.":return"Informe a URL de um site.";case"Use an HTTP or HTTPS website URL.":return"Use uma URL de site HTTP ou HTTPS.";case"Enter a valid website URL.":return"Informe uma URL de site válida.";default:return l}}let ze=!1;function st(){const l=Ie({from:"/commerce-onboarding"}),{org:e,siteUrl:i}=l,t=ve(i);return!ze&&De()&&(ze=!0,se("commerce_onboarding_viewed",{site_url:i,domain:t??void 0,...t?{$set:{last_scanned_domain:t}}:{}})),n.jsx(Me.Provider,{value:t,children:n.jsx(at,{requestedOrgSlug:e,siteUrl:i})})}function at(l){const e=E.c(8),{requestedOrgSlug:i,siteUrl:t}=l,{data:s,isPending:c}=Se.useSession(),a=$e();if(c){let m;return e[0]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(R,{children:n.jsx(ye,{variant:"generic"})}),e[0]=m):m=e[0],m}if(!s){const m=typeof window>"u"?"/commerce-onboarding":`${window.location.pathname}${window.location.search}`;let d;e[1]!==a?(d=a?n.jsx(Pe,{host:a}):void 0,e[1]=a,e[2]=d):d=e[2];let u;return e[3]!==d?(u=n.jsx(R,{children:n.jsx(We,{callbackUrl:m,allowAutoLogin:!1,title:"Desbloqueie seu diagnóstico completo",subtitle:null,brand:d,copy:rt})}),e[3]=d,e[4]=u):u=e[4],u}let o;return e[5]!==i||e[6]!==t?(o=n.jsx(lt,{requestedOrgSlug:i,siteUrl:t}),e[5]=i,e[6]=t,e[7]=o):o=e[7],o}function lt(l){const e=E.c(43),{requestedOrgSlug:i,siteUrl:t}=l,s=Fe(),c=qe(),[a,o]=M.useState(null),[m,d]=M.useState(null),u=c.data?.map(mt)??[];let v;e[0]===Symbol.for("react.memo_cache_sentinel")?(v={mutationFn:ct,retry:!1,onSuccess:r=>{d(r)}},e[0]=v):v=e[0];const p=Te(v);if(c.isPending){let r;return e[1]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(R,{children:n.jsx(ye,{variant:"workspace"})}),e[1]=r):r=e[1],r}if(c.error){let r;return e[2]!==c?(r=n.jsx(ae,{title:"Não foi possível carregar suas organizações",description:"Tente novamente para continuar a configuração de commerce nesta página.",actionLabel:"Tentar novamente",onRetry:()=>c.refetch()}),e[2]=c,e[3]=r):r=e[3],r}const j=i?u.find(r=>r.slug===i):null;if(j){let r;return e[4]!==j||e[5]!==t?(r=n.jsx(re,{org:j,initialSiteUrl:t}),e[4]=j,e[5]=t,e[6]=r):r=e[6],r}if(i){let r;return e[7]!==c?(r=n.jsx(ae,{title:"Organização não encontrada",description:"Não conseguimos encontrar essa organização na sua conta.",actionLabel:"Tentar novamente",onRetry:()=>c.refetch()}),e[7]=c,e[8]=r):r=e[8],r}if(a){let r;return e[9]!==a||e[10]!==t?(r=n.jsx(re,{org:a,initialSiteUrl:t}),e[9]=a,e[10]=t,e[11]=r):r=e[11],r}if(u.length===1&&u[0]){let r;return e[12]!==u[0]||e[13]!==t?(r=n.jsx(re,{org:u[0],initialSiteUrl:t}),e[12]=u[0],e[13]=t,e[14]=r):r=e[14],r}if(u.length>1){let r;e[15]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(k,{title:"Escolha uma organização",description:"Selecione onde o diagnóstico de commerce deve continuar."}),e[15]=r):r=e[15];let h;e[16]!==s||e[17]!==t?(h=O=>s({to:"/commerce-onboarding",search:{org:O.slug,siteUrl:t}}),e[16]=s,e[17]=t,e[18]=h):h=e[18];let C;return e[19]!==u||e[20]!==h?(C=n.jsx(R,{children:n.jsxs("div",{className:"grid gap-10",children:[r,n.jsx(Ne,{className:"-mx-1 max-h-[60vh] overflow-y-auto px-1",children:n.jsx(Re,{organizations:u,selectLabel:"Continuar",onSelected:h})})]})}),e[19]=u,e[20]=h,e[21]=C):C=e[21],C}if(!m){let r;e[22]!==p?(r=()=>{p.reset(),p.mutate()},e[22]=p,e[23]=r):r=e[23];let h;return e[24]!==p||e[25]!==r?(h=n.jsx(dt,{mutation:p,onRetry:r}),e[24]=p,e[25]=r,e[26]=h):h=e[26],h}const g=m;if(g?.success&&(g.status==="created"||g.status==="joined"||g.status==="already_has_organization")&&g.organization){let r;return e[27]!==g.organization||e[28]!==t?(r=n.jsx(re,{org:g.organization,initialSiteUrl:t}),e[27]=g.organization,e[28]=t,e[29]=r):r=e[29],r}if(g?.status==="ambiguous"&&g.organizations&&g.organizations.length>0){let r;e[30]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(k,{title:"Escolha uma organização",description:"Seu e-mail pode acessar mais de uma organização. Escolha onde a configuração de commerce deve continuar."}),e[30]=r):r=e[30];const h=g.domain??void 0;let C;e[31]!==s||e[32]!==t?(C=($,P)=>{Le(),o({...$,slug:P}),s({to:"/commerce-onboarding",search:{org:P,siteUrl:t}})},e[31]=s,e[32]=t,e[33]=C):C=e[33];let O;return e[34]!==g.organizations||e[35]!==h||e[36]!==C?(O=n.jsx(R,{children:n.jsxs("div",{className:"grid gap-10",children:[r,n.jsx(Ne,{className:"-mx-1 max-h-[60vh] overflow-y-auto px-1",children:n.jsx(Re,{organizations:g.organizations,domain:h,onJoined:C})})]})}),e[34]=g.organizations,e[35]=h,e[36]=C,e[37]=O):O=e[37],O}const S=g?.error??"Não conseguimos determinar uma organização de commerce para esta conta.";let _;e[38]!==p?(_=()=>{d(null),p.reset()},e[38]=p,e[39]=_):_=e[39];let I;return e[40]!==S||e[41]!==_?(I=n.jsx(ae,{title:"O onboarding de commerce precisa de suporte",description:S,actionLabel:"Tentar novamente",onRetry:_}),e[40]=S,e[41]=_,e[42]=I):I=e[42],I}async function ct(){const e=await(await fetch("/api/auth/custom/ensure-organization",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"}})).json();return e.success&&(e.status==="created"||e.status==="joined"||e.status==="already_has_organization")&&e.organization&&Le(),e}function mt(l){return{id:l.id,name:l.name,slug:l.slug,logo:l.logo??null}}function dt(l){const e=E.c(7),{mutation:i,onRetry:t}=l,s=M.useRef(!1);let c;e[0]!==i?(c=d=>{!d||s.current||(s.current=!0,i.mutate())},e[0]=i,e[1]=c):c=e[1];const a=c;if(i.error){let d;return e[2]!==t?(d=n.jsx(ae,{title:"Onboarding de commerce indisponível",description:"Não foi possível preparar uma organização para a configuração de commerce. Tente novamente por esta página ou fale com o suporte.",actionLabel:"Tentar novamente",onRetry:t}),e[2]=t,e[3]=d):d=e[3],d}let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(ye,{variant:"generic"}),e[4]=o):o=e[4];let m;return e[5]!==a?(m=n.jsx(R,{children:n.jsx("div",{ref:a,children:o})}),e[5]=a,e[6]=m):m=e[6],m}function k(l){const e=E.c(8),{title:i,description:t}=l,s=$e();let c;e[0]!==s?(c=s?n.jsx(Pe,{host:s}):n.jsxs("div",{children:[n.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),n.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]}),e[0]=s,e[1]=c):c=e[1];let a;e[2]!==t||e[3]!==i?(a=(i||t)&&n.jsxs("div",{className:"space-y-2",children:[i&&n.jsx("h1",{className:"text-2xl font-medium leading-8",children:i}),t&&n.jsx("p",{className:"text-base text-muted-foreground leading-6",children:t})]}),e[2]=t,e[3]=i,e[4]=a):a=e[4];let o;return e[5]!==c||e[6]!==a?(o=n.jsxs("div",{className:"grid gap-10",children:[c,a]}),e[5]=c,e[6]=a,e[7]=o):o=e[7],o}function ae(l){const e=E.c(9),{title:i,description:t,actionLabel:s,onRetry:c}=l;let a;e[0]!==t||e[1]!==i?(a=n.jsx(k,{title:i,description:t}),e[0]=t,e[1]=i,e[2]=a):a=e[2];let o;e[3]!==s||e[4]!==c?(o=n.jsx(je,{type:"button",size:"xl",className:"w-full",onClick:c,children:s}),e[3]=s,e[4]=c,e[5]=o):o=e[5];let m;return e[6]!==a||e[7]!==o?(m=n.jsx(R,{children:n.jsxs("div",{className:"grid gap-10",children:[a,o]})}),e[6]=a,e[7]=o,e[8]=m):m=e[8],m}function re(l){const e=E.c(11),{org:i,initialSiteUrl:t}=l,{data:s}=Se.useSession(),c=s?.user?.email;let a;e[0]!==t||e[1]!==c?(a=Ce({siteUrl:t,email:c}),e[0]=t,e[1]=c,e[2]=a):a=e[2];const o=a;let m;e[3]!==o||e[4]!==i.id?(m=n.jsx(be,{href:o,orgId:i.id}),e[3]=o,e[4]=i.id,e[5]=m):m=e[5];const d=m;let u;return e[6]!==t||e[7]!==d||e[8]!==i||e[9]!==s?.user?.email?(u=n.jsx(He,{children:v=>{const{reset:p}=v;return n.jsx(Ve,{fallback:j=>{const{error:g,resetError:S}=j;return n.jsx(R,{visual:d,children:n.jsx(ut,{orgName:i.name,message:g instanceof Error?g.message:"Não foi possível verificar a configuração do Commerce Discovery.",onRetry:()=>{p(),S()}})})},children:n.jsx(M.Suspense,{fallback:n.jsx(ke,{visual:d}),children:n.jsx(ft,{org:i,initialSiteUrl:t,sessionEmail:s?.user?.email},`${i.id}:${t??""}`)})})}}),e[6]=t,e[7]=d,e[8]=i,e[9]=s?.user?.email,e[10]=u):u=e[10],u}function ke(l){const e=E.c(3),{visual:i}=l;let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-6 md:grid md:gap-4",children:[n.jsx(k,{}),n.jsx(we,{})]}),e[0]=t):t=e[0];let s;return e[1]!==i?(s=n.jsx(R,{align:"fill",visual:i,children:t}),e[1]=i,e[2]=s):s=e[2],s}function ut(l){const e=E.c(10),{orgName:i,message:t,onRetry:s}=l,c=`A configuração de commerce continuará em ${i}.`;let a;e[0]!==c?(a=n.jsx(k,{title:"Diagnóstico de commerce",description:c}),e[0]=c,e[1]=a):a=e[1];let o;e[2]!==t?(o=n.jsx(le,{message:t}),e[2]=t,e[3]=o):o=e[3];let m;e[4]!==s?(m=n.jsx(je,{type:"button",size:"xl",className:"w-full",onClick:s,children:"Tentar novamente"}),e[4]=s,e[5]=m):m=e[5];let d;return e[6]!==a||e[7]!==o||e[8]!==m?(d=n.jsxs("div",{className:"grid gap-10",children:[a,o,m]}),e[6]=a,e[7]=o,e[8]=m,e[9]=d):d=e[9],d}function ft(l){const e=E.c(109),{org:i,initialSiteUrl:t,sessionEmail:s}=l;let c;e[0]!==i.id||e[1]!==i.slug?(c={connectionId:Je,orgId:i.id,orgSlug:i.slug},e[0]=i.id,e[1]=i.slug,e[2]=c):c=e[2];const a=Xe(c),[o,m]=M.useState(t??""),[d,u]=M.useState(null),v=M.useRef(!1),p=Ze.COMMERCE_DISCOVERY(i.id),j=et(i.id),g=_e.commerceDiscoveryConnection(i.id,p);let S;e[3]!==p||e[4]!==a?(S=async()=>{const f=await a.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:p}});return xe(f)},e[3]=p,e[4]=a,e[5]=S):S=e[5];let _;e[6]!==g||e[7]!==S?(_={queryKey:g,queryFn:S,retry:!1},e[6]=g,e[7]=S,e[8]=_):_=e[8];const I=Ue(_),r=_e.commerceDiscoveryVirtualMcp(i.id,j);let h;e[9]!==a||e[10]!==j?(h=async()=>{const f=await a.callTool({name:"COLLECTION_VIRTUAL_MCP_GET",arguments:{id:j}});return xe(f)},e[9]=a,e[10]=j,e[11]=h):h=e[11];let C;e[12]!==r||e[13]!==h?(C={queryKey:r,queryFn:h,retry:!1},e[12]=r,e[13]=h,e[14]=C):C=e[14];const O=Ue(C);let $;e[15]!==a?($=async f=>{const x=await a.callTool({name:"COMMERCE_DISCOVERY_SETUP",arguments:{siteUrl:f}});return xe(x)},e[15]=a,e[16]=$):$=e[16];let P;e[17]!==I||e[18]!==i.id||e[19]!==O?(P=(f,x)=>{se("commerce_onboarding_setup_succeeded",{domain:ve(x)??void 0,organization_id:i.id}),u(null),I.refetch(),O.refetch()},e[17]=I,e[18]=i.id,e[19]=O,e[20]=P):P=e[20];let A;e[21]!==i.id?(A=(f,x)=>{se("commerce_onboarding_setup_failed",{domain:ve(x)??void 0,organization_id:i.id,error:f instanceof Error?f.message:String(f)}),u(f instanceof Error?f.message:"A configuração do Commerce Discovery falhou.")},e[21]=i.id,e[22]=A):A=e[22];let Q;e[23]!==A||e[24]!==$||e[25]!==P?(Q={mutationFn:$,retry:!1,onSuccess:P,onError:A},e[23]=A,e[24]=$,e[25]=P,e[26]=Q):Q=e[26];const b=Te(Q),Ae=!!I.data.item&&!!O.data.item,Ee=I.data.item,W=typeof Ee?.metadata?.siteUrl=="string"?Ee.metadata.siteUrl:void 0,ce=t||o||"";let G;e[27]!==W||e[28]!==ce?(G=Qe(ce,W),e[27]=W,e[28]=ce,e[29]=G):G=e[29];const Y=Ae&&G,J=t||o||W||"";let X;e[30]!==J||e[31]!==s?(X=Ce({siteUrl:J,email:s}),e[30]=J,e[31]=s,e[32]=X):X=e[32];const me=X;let Z;e[33]!==me||e[34]!==i.id?(Z=n.jsx(be,{href:me,orgId:i.id}),e[33]=me,e[34]=i.id,e[35]=Z):Z=e[35];const y=Z;let ee;e[36]!==b?(ee=f=>{const x=pe(f);if(!x.ok){u(Oe(x.error));return}u(null),b.mutate(x.value)},e[36]=b,e[37]=ee):ee=e[37];const D=ee;let te;e[38]!==t||e[39]!==D||e[40]!==Y?(te=f=>{!f||v.current||Y||!t||(v.current=!0,D(t))},e[38]=t,e[39]=D,e[40]=Y,e[41]=te):te=e[41];const de=te;let ie;e[42]!==i.id||e[43]!==D||e[44]!==o?(ie=f=>{f.preventDefault();const x=pe(o);x.ok&&se("commerce_onboarding_site_url_submitted",{domain:new URL(x.value).hostname,organization_id:i.id}),D(o)},e[42]=i.id,e[43]=D,e[44]=o,e[45]=ie):ie=e[45];const z=ie;if(Y){const f=i.slug;let x;e[46]===Symbol.for("react.memo_cache_sentinel")?(x=crypto.randomUUID(),e[46]=x):x=e[46];let T;e[47]!==i.slug?(T={org:f,taskId:x},e[47]=i.slug,e[48]=T):T=e[48];let U;e[49]!==i.id?(U=tt(i.id),e[49]=i.id,e[50]=U):U=e[50];const L=J||void 0;let N;e[51]!==U.id||e[52]!==L?(N={virtualmcpid:U.id,connect:"1",siteUrl:L},e[51]=U.id,e[52]=L,e[53]=N):N=e[53];let w;return e[54]!==T||e[55]!==N?(w=n.jsx(Be,{to:"/$org/$taskId",params:T,search:N,replace:!0}),e[54]=T,e[55]=N,e[56]=w):w=e[56],w}if(b.isPending){let f;return e[57]!==y?(f=n.jsx(ke,{visual:y}),e[57]=y,e[58]=f):f=e[58],f}if(t){let f,x;if(e[59]!==y||e[60]!==z||e[61]!==t||e[62]!==d||e[63]!==i.name||e[64]!==b.isPending||e[65]!==o){x=Symbol.for("react.early_return_sentinel");e:if(f=pe(t),!f.ok){const fe=`A configuração de commerce continuará em ${i.name}.`;let V;e[68]!==fe?(V=n.jsx(k,{title:"Diagnóstico de commerce",description:fe}),e[68]=fe,e[69]=V):V=e[69];const ge=n.jsx(le,{message:Oe(f.error)});let B;e[70]!==z||e[71]!==d||e[72]!==b.isPending||e[73]!==o?(B=n.jsx(he,{siteUrl:o,error:d,isSubmitting:b.isPending,onSiteUrlChange:m,onSubmit:z}),e[70]=z,e[71]=d,e[72]=b.isPending,e[73]=o,e[74]=B):B=e[74];let K;e[75]!==V||e[76]!==ge||e[77]!==B?(K=n.jsxs("div",{className:"grid gap-10",children:[V,ge,B]}),e[75]=V,e[76]=ge,e[77]=B,e[78]=K):K=e[78];let oe;e[79]!==y||e[80]!==K?(oe=n.jsx(R,{visual:y,children:K}),e[79]=y,e[80]=K,e[81]=oe):oe=e[81],x=oe;break e}e[59]=y,e[60]=z,e[61]=t,e[62]=d,e[63]=i.name,e[64]=b.isPending,e[65]=o,e[66]=f,e[67]=x}else f=e[66],x=e[67];if(x!==Symbol.for("react.early_return_sentinel"))return x;const T=`O Commerce Discovery está sendo preparado para ${f.value}.`;let U;e[82]!==T?(U=n.jsx(k,{title:"Diagnóstico de commerce",description:T}),e[82]=T,e[83]=U):U=e[83];let L;e[84]!==z||e[85]!==d||e[86]!==b.isPending||e[87]!==o?(L=d?n.jsxs(n.Fragment,{children:[n.jsx(le,{message:d}),n.jsx(he,{siteUrl:o,error:null,isSubmitting:b.isPending,onSiteUrlChange:m,onSubmit:z})]}):n.jsx(we,{}),e[84]=z,e[85]=d,e[86]=b.isPending,e[87]=o,e[88]=L):L=e[88];let N;e[89]!==U||e[90]!==L||e[91]!==de?(N=n.jsxs("div",{ref:de,className:"grid gap-10",children:[U,L]}),e[89]=U,e[90]=L,e[91]=de,e[92]=N):N=e[92];let w;return e[93]!==y||e[94]!==N?(w=n.jsx(R,{visual:y,children:N}),e[93]=y,e[94]=N,e[95]=w):w=e[95],w}const ue=`A configuração de commerce continuará em ${i.name}.`;let F;e[96]!==ue?(F=n.jsx(k,{title:"Diagnóstico de commerce",description:ue}),e[96]=ue,e[97]=F):F=e[97];let q;e[98]!==z||e[99]!==d||e[100]!==b.isPending||e[101]!==o?(q=n.jsx(he,{siteUrl:o,error:d,isSubmitting:b.isPending,onSiteUrlChange:m,onSubmit:z}),e[98]=z,e[99]=d,e[100]=b.isPending,e[101]=o,e[102]=q):q=e[102];let H;e[103]!==F||e[104]!==q?(H=n.jsxs("div",{className:"grid gap-10",children:[F,q]}),e[103]=F,e[104]=q,e[105]=H):H=e[105];let ne;return e[106]!==y||e[107]!==H?(ne=n.jsx(R,{visual:y,children:H}),e[106]=y,e[107]=H,e[108]=ne):ne=e[108],ne}function he(l){const e=E.c(20),{siteUrl:i,error:t,isSubmitting:s,onSiteUrlChange:c,onSubmit:a}=l;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx("label",{className:"text-sm font-medium",htmlFor:"commerce-site-url",children:"URL do site"}),e[0]=o):o=e[0];let m;e[1]!==c?(m=_=>c(_.target.value),e[1]=c,e[2]=m):m=e[2];const d=!!t;let u;e[3]!==s||e[4]!==i||e[5]!==m||e[6]!==d?(u=n.jsx(Ye,{id:"commerce-site-url",type:"text",inputMode:"url",value:i,onChange:m,placeholder:"https://example.com","aria-invalid":d,disabled:s}),e[3]=s,e[4]=i,e[5]=m,e[6]=d,e[7]=u):u=e[7];let v;e[8]!==t?(v=t?n.jsx(le,{message:t}):null,e[8]=t,e[9]=v):v=e[9];let p;e[10]!==u||e[11]!==v?(p=n.jsxs("div",{className:"grid gap-2",children:[o,u,v]}),e[10]=u,e[11]=v,e[12]=p):p=e[12];let j;e[13]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(it,{size:16}),e[13]=j):j=e[13];let g;e[14]!==s?(g=n.jsxs(je,{type:"submit",size:"xl",className:"w-full",disabled:s,children:["Continuar",j]}),e[14]=s,e[15]=g):g=e[15];let S;return e[16]!==a||e[17]!==p||e[18]!==g?(S=n.jsxs("form",{className:"grid gap-4",onSubmit:a,children:[p,g]}),e[16]=a,e[17]=p,e[18]=g,e[19]=S):S=e[19],S}function le(l){const e=E.c(2),{message:i}=l;let t;return e[0]!==i?(t=n.jsx("p",{className:"text-sm leading-5 text-destructive",role:"alert",children:i}),e[0]=i,e[1]=t):t=e[1],t}export{Ti as default};
@@ -1 +0,0 @@
1
- import{c as C,j as t,r as y,B as M,l as j}from"./index-DmhdwAgP.js";import{a as D,h as S,D as I,d as R,e as T}from"./dialog-DUqhzGiD.js";import{u as _,S as A}from"./chat-context-DSveBxCg.js";import{i as B}from"./ChevronUp-D5F6V6Tm.js";import{a as E}from"./Copy01-BkGYkmm-.js";function N(n){const e=C.c(3),{size:l}=n,o=l===void 0?16:l;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=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]=i):i=e[0];let s;return e[1]!==o?(s=t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:o,height:o,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:i}),e[1]=o,e[2]=s):s=e[2],s}function w(n){const e=C.c(3),{size:l}=n,o=l===void 0?16:l;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=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]=i):i=e[0];let s;return e[1]!==o?(s=t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:o,height:o,fill:"currentColor",fillRule:"evenodd","aria-hidden":"true",children:i}),e[1]=o,e[2]=s):s=e[2],s}const $={"claude-code":{label:"Claude Code",Icon:N},codex:{label:"Codex",Icon:w}};function Y(n){return(n&&$[n])??null}const L="bunx decocms@latest link",k=[{capability:"claude-code",label:"Claude Code",description:"Runs through the Claude Code CLI",icon:t.jsx(N,{size:18})},{capability:"codex",label:"Codex",description:"Runs through the Codex CLI",icon:t.jsx(w,{size:18})}];function q(n){return k.filter(e=>n.includes(e.capability)).map(e=>e.label)}function F(n){const e=C.c(23),{open:l,onOpenChange:o}=n;let i;e[0]!==l?(i={fast:l},e[0]=l,e[1]=i):i=e[1];const s=_(i),[h,v]=y.useState(!1),z=s.hostname??s.machineId??"Your desktop",g=s.online?`Connected to ${z}`:"Connect your desktop";let a;e[2]!==g?(a=t.jsx(D,{children:g}),e[2]=g,e[3]=a):a=e[3];const b=s.online?"This machine provides the following local agents.":"Run this command in your desktop terminal. The dialog will close once your desktop is online.";let c;e[4]!==b?(c=t.jsx(S,{children:b}),e[4]=b,e[5]=c):c=e[5];let r;e[6]!==a||e[7]!==c?(r=t.jsxs(I,{children:[a,c]}),e[6]=a,e[7]=c,e[8]=r):r=e[8];let d;e[9]!==h||e[10]!==s.online?(d=!s.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:L}),t.jsx(M,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>{navigator.clipboard.writeText(L),v(!0),setTimeout(()=>v(!1),1500)},children:h?t.jsx(B,{size:14}):t.jsx(E,{size:14})})]}),e[9]=h,e[10]=s.online,e[11]=d):d=e[11];let m;e[12]!==s.capabilities||e[13]!==s.online?(m=s.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(x=>{const f=s.capabilities.includes(x.capability);return t.jsxs("div",{className:j("flex items-center gap-3 rounded-md border px-3 py-2",f?"border-border bg-background text-foreground":"border-border/60 bg-muted/40 text-muted-foreground"),children:[t.jsx("div",{className:j("flex size-6 items-center justify-center",f?"text-foreground":"text-muted-foreground"),children:x.icon}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("p",{className:"font-medium",children:x.label}),t.jsx("p",{className:"text-xs text-muted-foreground",children:f?x.description:"Not detected"})]}),t.jsx("span",{className:j("size-2 rounded-full",f?"bg-success":"bg-muted-foreground/30")})]},x.capability)})})}):t.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[t.jsx(A,{size:"sm"}),"Waiting for desktop…"]}),e[12]=s.capabilities,e[13]=s.online,e[14]=m):m=e[14];let u;e[15]!==r||e[16]!==d||e[17]!==m?(u=t.jsxs(R,{className:"sm:max-w-md",children:[r,d,m]}),e[15]=r,e[16]=d,e[17]=m,e[18]=u):u=e[18];let p;return e[19]!==o||e[20]!==l||e[21]!==u?(p=t.jsx(T,{open:l,onOpenChange:o,children:u}),e[19]=o,e[20]=l,e[21]=u,e[22]=p):p=e[22],p}export{F as C,N as a,w as b,Y as l,q as v};