decocms 2.316.0 → 2.316.2

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 (407) hide show
  1. package/dist/client/assets/{AlertCircle-BhKIfxeV.js → AlertCircle-CUtXIfwC.js} +1 -1
  2. package/dist/client/assets/{Archive-Dz0wtILE.js → Archive-Btl9BXLu.js} +1 -1
  3. package/dist/client/assets/{ArrowNarrowLeft-D2IzKz0U.js → ArrowNarrowLeft-CVkIxPAV.js} +1 -1
  4. package/dist/client/assets/{ArrowUpRight-DQNhEvxd.js → ArrowUpRight-BrfnA0N_.js} +1 -1
  5. package/dist/client/assets/{Check-B3zx_U26.js → Check-Ccw422Wb.js} +1 -1
  6. package/dist/client/assets/{CheckCircle-S5ffz95T.js → CheckCircle-C3sPsdSO.js} +1 -1
  7. package/dist/client/assets/{ChevronDown-B2rzld2y.js → ChevronDown-cpZNJlz9.js} +1 -1
  8. package/dist/client/assets/{ChevronRight-E3ry5bv1.js → ChevronRight-CeUhrzuf.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-CR14Z0nx.js → ChevronUp-C-rBrlqd.js} +1 -1
  10. package/dist/client/assets/{Container-hpy3kvOB.js → Container-OQiFme-7.js} +1 -1
  11. package/dist/client/assets/{DotsVertical-DlBHJ9PJ.js → DotsVertical-BV7jVmIB.js} +1 -1
  12. package/dist/client/assets/{LayoutLeft-O15r8yaV.js → LayoutLeft-BuJA8_jK.js} +1 -1
  13. package/dist/client/assets/{LinkExternal01-CqYIOZ9A.js → LinkExternal01-CRxfzQ_Z.js} +1 -1
  14. package/dist/client/assets/{Lock01-BWTd97_q.js → Lock01-D2YNxdLq.js} +1 -1
  15. package/dist/client/assets/{Palette-48b46GGh.js → Palette-By9pNqp1.js} +1 -1
  16. package/dist/client/assets/{Play-CWd0g6Ov.js → Play-CcNC_puc.js} +1 -1
  17. package/dist/client/assets/{Plus-Dld8jPbl.js → Plus-D1tHeJo2.js} +1 -1
  18. package/dist/client/assets/{RefreshCcw01-DlZMdaR5.js → RefreshCcw01-BESGm5a8.js} +1 -1
  19. package/dist/client/assets/{SearchMd-BzVtNNV8.js → SearchMd-eCR8N7AG.js} +1 -1
  20. package/dist/client/assets/{Settings02-Yw9y8zcL.js → Settings02-xGJb-3cc.js} +1 -1
  21. package/dist/client/assets/{Shield01-Bryrtn4R.js → Shield01-CA7f1yxn.js} +1 -1
  22. package/dist/client/assets/{Star01-D7-_AozX.js → Star01-nv1oI22I.js} +1 -1
  23. package/dist/client/assets/{Sun-BRoJ4FPT.js → Sun-hmutQjwc.js} +1 -1
  24. package/dist/client/assets/{Tool01-C_J_zDPh.js → Tool01-DmFqON6q.js} +1 -1
  25. package/dist/client/assets/{Trash01-CWiWK8tz.js → Trash01-IeycYlZQ.js} +1 -1
  26. package/dist/client/assets/{User01-Cuf_FrNk.js → User01-CnizOinw.js} +1 -1
  27. package/dist/client/assets/{Users03-BvEJiMrD.js → Users03-y_ec4Rh1.js} +1 -1
  28. package/dist/client/assets/{X-DCaJ2DR_.js → X-C63lgCLS.js} +1 -1
  29. package/dist/client/assets/{XCircle-Xm8lpkAu.js → XCircle-BkB1Kg5O.js} +1 -1
  30. package/dist/client/assets/{XClose-BpbAJCm9.js → XClose-DA8jbEWY.js} +1 -1
  31. package/dist/client/assets/{Zap-DkdmeY_3.js → Zap-N-AnbCTG.js} +1 -1
  32. package/dist/client/assets/{ZapSquare-D31ZX-yT.js → ZapSquare-Biue2YhF.js} +1 -1
  33. package/dist/client/assets/{accordion-D2I2JgOz.js → accordion-C4V_UW2A.js} +1 -1
  34. package/dist/client/assets/{agent-icon-DIgcdFeV.js → agent-icon-CGz6_qSV.js} +1 -1
  35. package/dist/client/assets/{agents-list-DJEDnQKa.js → agents-list-TldZe4YF.js} +1 -1
  36. package/dist/client/assets/{ai-providers-BKQlREzu.js → ai-providers-DGBj5bEk.js} +1 -1
  37. package/dist/client/assets/{alert-dialog-CoBaZf61.js → alert-dialog-BTkTE2x9.js} +1 -1
  38. package/dist/client/assets/{auth-catchall-C__PbIds.js → auth-catchall-8PNCF3Wj.js} +1 -1
  39. package/dist/client/assets/{automation-list-row-BjJTW98i.js → automation-list-row-BY-_98AX.js} +1 -1
  40. package/dist/client/assets/{automations-sFtOtWq7.js → automations-CqPMUDuQ.js} +1 -1
  41. package/dist/client/assets/{avatar-C31fe2qO.js → avatar-Bb8VCoXQ.js} +1 -1
  42. package/dist/client/assets/{badge-wVDQydbB.js → badge-DP5IQfr9.js} +1 -1
  43. package/dist/client/assets/{brand-context-CQ0dSgsx.js → brand-context-CPtzFC3q.js} +1 -1
  44. package/dist/client/assets/{card-BsjNx5Cg.js → card-Bl-Rmbpi.js} +1 -1
  45. package/dist/client/assets/{chat-context-CXqWCM0D.js → chat-context-CZtWWj-u.js} +1 -1
  46. package/dist/client/assets/{checkbox-B5i71aX9.js → checkbox-B4-n2Voa.js} +1 -1
  47. package/dist/client/assets/{collection-detail-w94sCgAJ.js → collection-detail-DjrRkSmH.js} +1 -1
  48. package/dist/client/assets/{collection-display-button-Dy9WKszB.js → collection-display-button-BCIVtUBW.js} +1 -1
  49. package/dist/client/assets/{collection-search-DRd31o69.js → collection-search-ByjHguQI.js} +1 -1
  50. package/dist/client/assets/{collection-search-CkG6QTlc.js → collection-search-DEySGVjR.js} +1 -1
  51. package/dist/client/assets/{collection-table-wrapper-BIwFJIlS.js → collection-table-wrapper-BQ8LubEz.js} +1 -1
  52. package/dist/client/assets/{collection-tabs-DZIZ-iDz.js → collection-tabs-CU9XDvba.js} +1 -1
  53. package/dist/client/assets/{collections-BbDNQEWM.js → collections-D541sKCa.js} +1 -1
  54. package/dist/client/assets/{command-DGrDaXPR.js → command-MAfm8eaf.js} +1 -1
  55. package/dist/client/assets/{connection-card-CtNK-usI.js → connection-card-C9CMuiWA.js} +1 -1
  56. package/dist/client/assets/{connection-detail-Dy49P_Wb.js → connection-detail-Du5PjTQN.js} +1 -1
  57. package/dist/client/assets/{connection-form-helpers-Ck24jZcw.js → connection-form-helpers-1qctTRqV.js} +1 -1
  58. package/dist/client/assets/{connections-YpkySNNU.js → connections-DYgmyz3C.js} +1 -1
  59. package/dist/client/assets/{constants-hHr1XnHs.js → constants-CjJyIjLn.js} +1 -1
  60. package/dist/client/assets/{constants-ClujOLL0.js → constants-CmcFrIt1.js} +1 -1
  61. package/dist/client/assets/{dialog-DlXEbbro.js → dialog-C8PiJXDq.js} +1 -1
  62. package/dist/client/assets/{domain-settings-Bk8xfxCT.js → domain-settings-BqGEv34a.js} +1 -1
  63. package/dist/client/assets/{drawer-PL1KJG8h.js → drawer-SuAP4nw3.js} +1 -1
  64. package/dist/client/assets/{dropdown-menu-DX0TPN0k.js → dropdown-menu-B6XbAhub.js} +1 -1
  65. package/dist/client/assets/{dynamic-plugin-layout-BN4WTDcX.js → dynamic-plugin-layout-zW_YPWvS.js} +1 -1
  66. package/dist/client/assets/{empty-state-BDuWm3OO.js → empty-state-CG0ziTmf.js} +1 -1
  67. package/dist/client/assets/{empty-state-D8kZInFe.js → empty-state-ChZyciKg.js} +1 -1
  68. package/dist/client/assets/{extract-connection-data-D2pRgNGp.js → extract-connection-data-CH0LUcT-.js} +1 -1
  69. package/dist/client/assets/{features-Cfl0ad_g.js → features-BwQY7IjX.js} +1 -1
  70. package/dist/client/assets/{form-lvEVsZiS.js → form-C_Vw9izm.js} +1 -1
  71. package/dist/client/assets/{general-DTam8mrI.js → general-CLqSOIWH.js} +1 -1
  72. package/dist/client/assets/{index-xu72xd1g.js → index-4sYeFn0S.js} +1 -1
  73. package/dist/client/assets/{index-Bq8MNgeV.js → index-B3N0ijMe.js} +2 -2
  74. package/dist/client/assets/{index-CuEDzA2l.js → index-B5tvQ-SE.js} +1 -1
  75. package/dist/client/assets/{index-DF2eiQ1x.js → index-Bn0UKgPw.js} +1 -1
  76. package/dist/client/assets/{index-DJVBUrUD.js → index-BtaMjmKz.js} +1 -1
  77. package/dist/client/assets/{index-mhkzUFBK.js → index-CQv-4_0B.js} +1 -1
  78. package/dist/client/assets/{index-Ea3ltYi1.js → index-Ccxjprlf.js} +20 -20
  79. package/dist/client/assets/{index-BRQL1Qy9.js → index-CdOnHCPx.js} +1 -1
  80. package/dist/client/assets/{index-5QFk1v1j.js → index-CtJF4A1M.js} +1 -1
  81. package/dist/client/assets/{index-C0JHkPGv.js → index-D07mVDo7.js} +1 -1
  82. package/dist/client/assets/{index-C-ZizHKt.js → index-D5WZXYzH.js} +1 -1
  83. package/dist/client/assets/{index-Fz2lfOzM.js → index-DBM1DnAx.js} +1 -1
  84. package/dist/client/assets/{index-s_hf2jI7.js → index-DIhFNhBy.js} +1 -1
  85. package/dist/client/assets/{index-n7gxPtHW.js → index-DaDKcZx1.js} +1 -1
  86. package/dist/client/assets/{index-DhY6sTVx.js → index-MYhsZ8uD.js} +1 -1
  87. package/dist/client/assets/{index-DaOIazOa.js → index-VVahlVGx.js} +1 -1
  88. package/dist/client/assets/{infiniteQueryObserver-DKVQWAgx.js → infiniteQueryObserver-CFUccQoY.js} +1 -1
  89. package/dist/client/assets/{input-DTt32vul.js → input-t1YlgH6I.js} +1 -1
  90. package/dist/client/assets/{integration-icon-C60b_d7I.js → integration-icon-BtzcxrlN.js} +1 -1
  91. package/dist/client/assets/{label-BhsxXb5j.js → label-DqZ3xuXa.js} +1 -1
  92. package/dist/client/assets/{layout-R2hI-PPe.js → layout-CN45dcgI.js} +1 -1
  93. package/dist/client/assets/{lean-canvas-recruit-modal-cabC6cgI.js → lean-canvas-recruit-modal-Bjwqo_gw.js} +1 -1
  94. package/dist/client/assets/{login-Dva0Y2V_.js → login-AnZ_hiQc.js} +1 -1
  95. package/dist/client/assets/{members-Ou1keNAh.js → members-iSwHLVLc.js} +1 -1
  96. package/dist/client/assets/{monaco-editor-CMrJ86sf.js → monaco-editor-B-GoBXtk.js} +1 -1
  97. package/dist/client/assets/{monitoring-stats-row-tiSP7a3c.js → monitoring-stats-row-D2ikvjk9.js} +1 -1
  98. package/dist/client/assets/{oauth-callback-Cz2eV7A_.js → oauth-callback-DZdNeSYS.js} +1 -1
  99. package/dist/client/assets/{oauth-callback-ai-provider-C9l8YAob.js → oauth-callback-ai-provider-CmcHfY8z.js} +1 -1
  100. package/dist/client/assets/{onboarding-RgB912Pu.js → onboarding-CSFkAYKn.js} +1 -1
  101. package/dist/client/assets/{org-layout-B68eO6KC.js → org-layout-MhC4Qi2j.js} +1 -1
  102. package/dist/client/assets/{org-plugin-layout-Dy7mAYsZ.js → org-plugin-layout-v3On4cF4.js} +1 -1
  103. package/dist/client/assets/{pair-mPsfY4Tl.js → pair-C3CCgNgt.js} +52 -52
  104. package/dist/client/assets/{plugin-empty-state-DNUBfOpk.js → plugin-empty-state-A7iG48Mg.js} +1 -1
  105. package/dist/client/assets/{plugin-header-D-036HBF.js → plugin-header-Bs3leeaa.js} +1 -1
  106. package/dist/client/assets/{plugin-layout-MmU0m6ZW.js → plugin-layout-BS79Aht2.js} +1 -1
  107. package/dist/client/assets/{popover-BJlGGBoZ.js → popover-GjQldSsa.js} +1 -1
  108. package/dist/client/assets/{profile-CDeQH0Ne.js → profile-D-pIBEjg.js} +1 -1
  109. package/dist/client/assets/{project-app-view-DhcSNy7a.js → project-app-view-BqjrqgzX.js} +1 -1
  110. package/dist/client/assets/registry-BzLfRgnp.js +2 -0
  111. package/dist/client/assets/{registry-layout-DjRsP-ha.js → registry-layout-D60NS6tY.js} +1 -1
  112. package/dist/client/assets/{required-auth-layout-CanoKJcr.js → required-auth-layout-B7ZjdWLg.js} +1 -1
  113. package/dist/client/assets/{reset-password-CeQ244pS.js → reset-password-CmC0LepN.js} +1 -1
  114. package/dist/client/assets/{roles-ClefMxwg.js → roles-BsRaXL8k.js} +1 -1
  115. package/dist/client/assets/{scroll-area-Bg2pYWAU.js → scroll-area-DGuVxP9B.js} +1 -1
  116. package/dist/client/assets/{search-input-CtBB2Ogw.js → search-input-DUMgPofa.js} +1 -1
  117. package/dist/client/assets/{select-Bmu7KX9g.js → select-C6LJ-qZk.js} +1 -1
  118. package/dist/client/assets/{select-model-A6plReXc.js → select-model-CTQ1Ef9H.js} +1 -1
  119. package/dist/client/assets/{settings-layout-arVQNb4q.js → settings-layout-BORw4NbB.js} +1 -1
  120. package/dist/client/assets/{settings-section-Bh35ipKE.js → settings-section-BXgkeIdc.js} +1 -1
  121. package/dist/client/assets/{shell-layout-G1fWb3Wf.js → shell-layout-C-KiCZAL.js} +1 -1
  122. package/dist/client/assets/{sidebar-CaCy2pvj.js → sidebar-DC8b4t6M.js} +1 -1
  123. package/dist/client/assets/{skeleton-B2ZrUZa6.js → skeleton-DMpf-C3P.js} +1 -1
  124. package/dist/client/assets/{spinner-M0_j9E66.js → spinner-BN00SFRY.js} +1 -1
  125. package/dist/client/assets/{sso-BP3gjZB7.js → sso-Df0_hBqL.js} +1 -1
  126. package/dist/client/assets/{store-B88v1kcS.js → store-B6hVgdLD.js} +1 -1
  127. package/dist/client/assets/store-registry-BTMEZZNw.js +2 -0
  128. package/dist/client/assets/{switch-MKqFhI8u.js → switch-XlpH18pA.js} +1 -1
  129. package/dist/client/assets/{table-Dpz7V2d2.js → table-0An9LWy-.js} +1 -1
  130. package/dist/client/assets/{tabs-Jp4EeqTR.js → tabs-O1R9U7Ur.js} +1 -1
  131. package/dist/client/assets/{task-status-Ch-lJ70q.js → task-status-DIXYIX6U.js} +1 -1
  132. package/dist/client/assets/{textarea-D4e6a8Nz.js → textarea-BVeCELvS.js} +1 -1
  133. package/dist/client/assets/{toggle-group-BDnmrZSN.js → toggle-group-BrCYmglG.js} +1 -1
  134. package/dist/client/assets/{tools-list-DuzUp3Cr.js → tools-list-BBH__HqN.js} +1 -1
  135. package/dist/client/assets/{tooltip-Cop6BWIB.js → tooltip-D_KYUaTY.js} +1 -1
  136. package/dist/client/assets/{types-B1bS009C.js → types-D5VFAtuD.js} +1 -1
  137. package/dist/client/assets/{use-ai-providers-BGcGBNhE.js → use-ai-providers-D1Gd_B23.js} +1 -1
  138. package/dist/client/assets/{use-collections-8VzaVe93.js → use-collections-Cqjc7P8G.js} +1 -1
  139. package/dist/client/assets/{use-connection-Lr8heJ8D.js → use-connection-BIHmIl4c.js} +1 -1
  140. package/dist/client/assets/{use-copy-Cu8-dSUz.js → use-copy-C_1CDwM3.js} +1 -1
  141. package/dist/client/assets/{use-create-virtual-mcp-BobcuW0I.js → use-create-virtual-mcp-CAXfmcVs.js} +1 -1
  142. package/dist/client/assets/{use-debounced-autosave-CyEn9Ro2.js → use-debounced-autosave-CHZpR2fH.js} +1 -1
  143. package/dist/client/assets/{use-decopilot-events-CiJL_0vR.js → use-decopilot-events-C4C_kTbf.js} +1 -1
  144. package/dist/client/assets/{use-delete-connection-CiGpEvZr.js → use-delete-connection-s3Ve1Sl_.js} +1 -1
  145. package/dist/client/assets/{use-infinite-scroll-BkIExLyi.js → use-infinite-scroll-BHuVaefo.js} +1 -1
  146. package/dist/client/assets/{use-list-state-DbpCBDBf.js → use-list-state-BK9s1zn4.js} +1 -1
  147. package/dist/client/assets/{use-mcp-tools-DQxTqUp3.js → use-mcp-tools-CclZhRpl.js} +1 -1
  148. package/dist/client/assets/{use-members-B_II-0yJ.js → use-members-CZYThJQZ.js} +1 -1
  149. package/dist/client/assets/{use-navigate-to-agent-C4qiakGR.js → use-navigate-to-agent-Cz6wq5hE.js} +1 -1
  150. package/dist/client/assets/{use-org-auth-client-BACib0-t.js → use-org-auth-client-D-j4hyAV.js} +1 -1
  151. package/dist/client/assets/{use-org-sso-Dam1kDCD.js → use-org-sso-BFDAXwGH.js} +1 -1
  152. package/dist/client/assets/{use-organization-roles-STx8KC7J.js → use-organization-roles-NjEscIo4.js} +1 -1
  153. package/dist/client/assets/{use-organization-settings-4FSfpkha.js → use-organization-settings-CNcnwjVj.js} +1 -1
  154. package/dist/client/assets/{use-registry-connections-Dr0EGoqa.js → use-registry-connections-SMKAO0tY.js} +1 -1
  155. package/dist/client/assets/{use-status-sounds-DTHvTmo7.js → use-status-sounds-CfCko9iv.js} +1 -1
  156. package/dist/client/assets/{use-tasks-C2q1pKyD.js → use-tasks-BGvJcXek.js} +1 -1
  157. package/dist/client/assets/{use-view-mode-Bo1TFi-O.js → use-view-mode-DQdopV9M.js} +1 -1
  158. package/dist/client/assets/{use-virtual-mcp-CD_T-y85.js → use-virtual-mcp-fhETXyqA.js} +1 -1
  159. package/dist/client/assets/useInfiniteQuery-dYBf2D3j.js +1 -0
  160. package/dist/client/assets/useSuspenseInfiniteQuery-02EoyUEK.js +1 -0
  161. package/dist/client/assets/{user-DOkjJZQI.js → user-CgpKaSQi.js} +1 -1
  162. package/dist/client/assets/{view-mode-toggle-Cf3Unpm2.js → view-mode-toggle-f23VJfhB.js} +1 -1
  163. package/dist/client/assets/{workflow-CQNAZF1P.js → workflow-CpYJf0EI.js} +1 -1
  164. package/dist/client/assets/workflow-detail-lNDVTwYf.js +1 -0
  165. package/dist/client/index.html +1 -1
  166. package/dist/server/cli.js +52 -37
  167. package/dist/server/node_modules/ansi-styles/index.d.ts +236 -0
  168. package/dist/server/node_modules/ansi-styles/index.js +223 -0
  169. package/dist/server/node_modules/{slice-ansi → ansi-styles}/license +0 -1
  170. package/dist/server/node_modules/ansi-styles/package.json +54 -0
  171. package/dist/server/node_modules/ansi-styles/readme.md +173 -0
  172. package/dist/server/node_modules/environment/index.d.ts +74 -0
  173. package/dist/server/node_modules/environment/index.js +47 -0
  174. package/dist/server/node_modules/environment/license +9 -0
  175. package/dist/server/node_modules/environment/package.json +74 -0
  176. package/dist/server/node_modules/environment/readme.md +94 -0
  177. package/dist/server/node_modules/escape-string-regexp/index.d.ts +18 -0
  178. package/dist/server/node_modules/escape-string-regexp/index.js +11 -0
  179. package/dist/server/node_modules/escape-string-regexp/license +9 -0
  180. package/dist/server/node_modules/escape-string-regexp/package.json +43 -0
  181. package/dist/server/node_modules/escape-string-regexp/readme.md +29 -0
  182. package/dist/server/node_modules/ink/build/ansi-tokenizer.d.ts +38 -0
  183. package/dist/server/node_modules/ink/build/ansi-tokenizer.js +316 -0
  184. package/dist/server/node_modules/ink/build/ansi-tokenizer.js.map +1 -0
  185. package/dist/server/node_modules/ink/build/apply-styles.js +175 -0
  186. package/dist/server/node_modules/ink/build/build-layout.js +77 -0
  187. package/dist/server/node_modules/ink/build/calculate-wrapped-text.js +53 -0
  188. package/dist/server/node_modules/ink/build/colorize.d.ts +3 -0
  189. package/dist/server/node_modules/ink/build/colorize.js +48 -0
  190. package/dist/server/node_modules/ink/build/colorize.js.map +1 -0
  191. package/dist/server/node_modules/ink/build/components/AccessibilityContext.d.ts +3 -0
  192. package/dist/server/node_modules/ink/build/components/AccessibilityContext.js +5 -0
  193. package/dist/server/node_modules/ink/build/components/AccessibilityContext.js.map +1 -0
  194. package/dist/server/node_modules/ink/build/components/App.d.ts +18 -0
  195. package/dist/server/node_modules/ink/build/components/App.js +351 -0
  196. package/dist/server/node_modules/ink/build/components/App.js.map +1 -0
  197. package/dist/server/node_modules/ink/build/components/AppContext.d.ts +15 -0
  198. package/dist/server/node_modules/ink/build/components/AppContext.js +11 -0
  199. package/dist/server/node_modules/ink/build/components/AppContext.js.map +1 -0
  200. package/dist/server/node_modules/ink/build/components/BackgroundContext.d.ts +4 -0
  201. package/dist/server/node_modules/ink/build/components/BackgroundContext.js +3 -0
  202. package/dist/server/node_modules/ink/build/components/BackgroundContext.js.map +1 -0
  203. package/dist/server/node_modules/ink/build/components/Box.d.ts +117 -0
  204. package/dist/server/node_modules/ink/build/components/Box.js +34 -0
  205. package/dist/server/node_modules/ink/build/components/Box.js.map +1 -0
  206. package/dist/server/node_modules/ink/build/components/Color.js +62 -0
  207. package/dist/server/node_modules/ink/build/components/Cursor.d.ts +83 -0
  208. package/dist/server/node_modules/ink/build/components/Cursor.js +53 -0
  209. package/dist/server/node_modules/ink/build/components/Cursor.js.map +1 -0
  210. package/dist/server/node_modules/ink/build/components/CursorContext.d.ts +11 -0
  211. package/dist/server/node_modules/ink/build/components/CursorContext.js +8 -0
  212. package/dist/server/node_modules/ink/build/components/CursorContext.js.map +1 -0
  213. package/dist/server/node_modules/ink/build/components/ErrorBoundary.d.ts +18 -0
  214. package/dist/server/node_modules/ink/build/components/ErrorBoundary.js +23 -0
  215. package/dist/server/node_modules/ink/build/components/ErrorBoundary.js.map +1 -0
  216. package/dist/server/node_modules/ink/build/components/ErrorOverview.d.ts +6 -0
  217. package/dist/server/node_modules/ink/build/components/ErrorOverview.js +84 -0
  218. package/dist/server/node_modules/ink/build/components/ErrorOverview.js.map +1 -0
  219. package/dist/server/node_modules/ink/build/components/FocusContext.d.ts +16 -0
  220. package/dist/server/node_modules/ink/build/components/FocusContext.js +17 -0
  221. package/dist/server/node_modules/ink/build/components/FocusContext.js.map +1 -0
  222. package/dist/server/node_modules/ink/build/components/Newline.d.ts +13 -0
  223. package/dist/server/node_modules/ink/build/components/Newline.js +8 -0
  224. package/dist/server/node_modules/ink/build/components/Newline.js.map +1 -0
  225. package/dist/server/node_modules/ink/build/components/Spacer.d.ts +7 -0
  226. package/dist/server/node_modules/ink/build/components/Spacer.js +11 -0
  227. package/dist/server/node_modules/ink/build/components/Spacer.js.map +1 -0
  228. package/dist/server/node_modules/ink/build/components/Static.d.ts +24 -0
  229. package/dist/server/node_modules/ink/build/components/Static.js +28 -0
  230. package/dist/server/node_modules/ink/build/components/Static.js.map +1 -0
  231. package/dist/server/node_modules/ink/build/components/StderrContext.d.ts +15 -0
  232. package/dist/server/node_modules/ink/build/components/StderrContext.js +13 -0
  233. package/dist/server/node_modules/ink/build/components/StderrContext.js.map +1 -0
  234. package/dist/server/node_modules/ink/build/components/StdinContext.d.ts +22 -0
  235. package/dist/server/node_modules/ink/build/components/StdinContext.js +19 -0
  236. package/dist/server/node_modules/ink/build/components/StdinContext.js.map +1 -0
  237. package/dist/server/node_modules/ink/build/components/StdoutContext.d.ts +15 -0
  238. package/dist/server/node_modules/ink/build/components/StdoutContext.js +13 -0
  239. package/dist/server/node_modules/ink/build/components/StdoutContext.js.map +1 -0
  240. package/dist/server/node_modules/ink/build/components/Text.d.ts +55 -0
  241. package/dist/server/node_modules/ink/build/components/Text.js +50 -0
  242. package/dist/server/node_modules/ink/build/components/Text.js.map +1 -0
  243. package/dist/server/node_modules/ink/build/components/Transform.d.ts +16 -0
  244. package/dist/server/node_modules/ink/build/components/Transform.js +15 -0
  245. package/dist/server/node_modules/ink/build/components/Transform.js.map +1 -0
  246. package/dist/server/node_modules/ink/build/cursor-helpers.d.ts +38 -0
  247. package/dist/server/node_modules/ink/build/cursor-helpers.js +56 -0
  248. package/dist/server/node_modules/ink/build/cursor-helpers.js.map +1 -0
  249. package/dist/server/node_modules/ink/build/devtools-window-polyfill.d.ts +1 -0
  250. package/dist/server/node_modules/ink/build/devtools-window-polyfill.js +65 -0
  251. package/dist/server/node_modules/ink/build/devtools-window-polyfill.js.map +1 -0
  252. package/dist/server/node_modules/ink/build/devtools.d.ts +1 -0
  253. package/dist/server/node_modules/ink/build/devtools.js +11 -0
  254. package/dist/server/node_modules/ink/build/devtools.js.map +1 -0
  255. package/dist/server/node_modules/ink/build/dom.d.ts +56 -0
  256. package/dist/server/node_modules/ink/build/dom.js +124 -0
  257. package/dist/server/node_modules/ink/build/dom.js.map +1 -0
  258. package/dist/server/node_modules/ink/build/experimental/apply-style.js +140 -0
  259. package/dist/server/node_modules/ink/build/experimental/dom.js +123 -0
  260. package/dist/server/node_modules/ink/build/experimental/output.js +91 -0
  261. package/dist/server/node_modules/ink/build/experimental/reconciler.js +141 -0
  262. package/dist/server/node_modules/ink/build/experimental/renderer.js +81 -0
  263. package/dist/server/node_modules/ink/build/get-max-width.d.ts +3 -0
  264. package/dist/server/node_modules/ink/build/get-max-width.js +10 -0
  265. package/dist/server/node_modules/ink/build/get-max-width.js.map +1 -0
  266. package/dist/server/node_modules/ink/build/hooks/use-app.d.ts +5 -0
  267. package/dist/server/node_modules/ink/build/hooks/use-app.js +8 -0
  268. package/dist/server/node_modules/ink/build/hooks/use-app.js.map +1 -0
  269. package/dist/server/node_modules/ink/build/hooks/use-cursor.d.ts +12 -0
  270. package/dist/server/node_modules/ink/build/hooks/use-cursor.js +29 -0
  271. package/dist/server/node_modules/ink/build/hooks/use-cursor.js.map +1 -0
  272. package/dist/server/node_modules/ink/build/hooks/use-focus-manager.d.ts +28 -0
  273. package/dist/server/node_modules/ink/build/hooks/use-focus-manager.js +17 -0
  274. package/dist/server/node_modules/ink/build/hooks/use-focus-manager.js.map +1 -0
  275. package/dist/server/node_modules/ink/build/hooks/use-focus.d.ts +29 -0
  276. package/dist/server/node_modules/ink/build/hooks/use-focus.js +42 -0
  277. package/dist/server/node_modules/ink/build/hooks/use-focus.js.map +1 -0
  278. package/dist/server/node_modules/ink/build/hooks/use-input.d.ts +131 -0
  279. package/dist/server/node_modules/ink/build/hooks/use-input.js +124 -0
  280. package/dist/server/node_modules/ink/build/hooks/use-input.js.map +1 -0
  281. package/dist/server/node_modules/ink/build/hooks/use-is-screen-reader-enabled.d.ts +5 -0
  282. package/dist/server/node_modules/ink/build/hooks/use-is-screen-reader-enabled.js +11 -0
  283. package/dist/server/node_modules/ink/build/hooks/use-is-screen-reader-enabled.js.map +1 -0
  284. package/dist/server/node_modules/ink/build/hooks/use-stderr.d.ts +5 -0
  285. package/dist/server/node_modules/ink/build/hooks/use-stderr.js +8 -0
  286. package/dist/server/node_modules/ink/build/hooks/use-stderr.js.map +1 -0
  287. package/dist/server/node_modules/ink/build/hooks/use-stdin.d.ts +5 -0
  288. package/dist/server/node_modules/ink/build/hooks/use-stdin.js +8 -0
  289. package/dist/server/node_modules/ink/build/hooks/use-stdin.js.map +1 -0
  290. package/dist/server/node_modules/ink/build/hooks/use-stdout.d.ts +5 -0
  291. package/dist/server/node_modules/ink/build/hooks/use-stdout.js +8 -0
  292. package/dist/server/node_modules/ink/build/hooks/use-stdout.js.map +1 -0
  293. package/dist/server/node_modules/ink/build/hooks/useInput.js +38 -0
  294. package/dist/server/node_modules/ink/build/index.d.ts +34 -0
  295. package/dist/server/node_modules/ink/build/index.js +20 -0
  296. package/dist/server/node_modules/ink/build/index.js.map +1 -0
  297. package/dist/server/node_modules/ink/build/ink.d.ts +90 -0
  298. package/dist/server/node_modules/ink/build/ink.js +637 -0
  299. package/dist/server/node_modules/ink/build/ink.js.map +1 -0
  300. package/dist/server/node_modules/ink/build/input-parser.d.ts +7 -0
  301. package/dist/server/node_modules/ink/build/input-parser.js +154 -0
  302. package/dist/server/node_modules/ink/build/input-parser.js.map +1 -0
  303. package/dist/server/node_modules/ink/build/instance.js +205 -0
  304. package/dist/server/node_modules/ink/build/instances.d.ts +3 -0
  305. package/dist/server/node_modules/ink/build/instances.js +8 -0
  306. package/dist/server/node_modules/ink/build/instances.js.map +1 -0
  307. package/dist/server/node_modules/ink/build/kitty-keyboard.d.ts +23 -0
  308. package/dist/server/node_modules/ink/build/kitty-keyboard.js +32 -0
  309. package/dist/server/node_modules/ink/build/kitty-keyboard.js.map +1 -0
  310. package/dist/server/node_modules/ink/build/layout.d.ts +7 -0
  311. package/dist/server/node_modules/ink/build/layout.js +33 -0
  312. package/dist/server/node_modules/ink/build/layout.js.map +1 -0
  313. package/dist/server/node_modules/ink/build/log-update.d.ts +19 -0
  314. package/dist/server/node_modules/ink/build/log-update.js +242 -0
  315. package/dist/server/node_modules/ink/build/log-update.js.map +1 -0
  316. package/dist/server/node_modules/ink/build/measure-element.d.ts +16 -0
  317. package/dist/server/node_modules/ink/build/measure-element.js +9 -0
  318. package/dist/server/node_modules/ink/build/measure-element.js.map +1 -0
  319. package/dist/server/node_modules/ink/build/measure-text.d.ts +6 -0
  320. package/dist/server/node_modules/ink/build/measure-text.js +21 -0
  321. package/dist/server/node_modules/ink/build/measure-text.js.map +1 -0
  322. package/dist/server/node_modules/ink/build/options.d.ts +52 -0
  323. package/dist/server/node_modules/ink/build/options.js +2 -0
  324. package/dist/server/node_modules/ink/build/options.js.map +1 -0
  325. package/dist/server/node_modules/ink/build/output.d.ts +35 -0
  326. package/dist/server/node_modules/ink/build/output.js +183 -0
  327. package/dist/server/node_modules/ink/build/output.js.map +1 -0
  328. package/dist/server/node_modules/ink/build/parse-keypress.d.ts +22 -0
  329. package/dist/server/node_modules/ink/build/parse-keypress.js +493 -0
  330. package/dist/server/node_modules/ink/build/parse-keypress.js.map +1 -0
  331. package/dist/server/node_modules/ink/build/reconciler.d.ts +4 -0
  332. package/dist/server/node_modules/ink/build/reconciler.js +274 -0
  333. package/dist/server/node_modules/ink/build/reconciler.js.map +1 -0
  334. package/dist/server/node_modules/ink/build/render-background.d.ts +4 -0
  335. package/dist/server/node_modules/ink/build/render-background.js +25 -0
  336. package/dist/server/node_modules/ink/build/render-background.js.map +1 -0
  337. package/dist/server/node_modules/ink/build/render-border.d.ts +4 -0
  338. package/dist/server/node_modules/ink/build/render-border.js +73 -0
  339. package/dist/server/node_modules/ink/build/render-border.js.map +1 -0
  340. package/dist/server/node_modules/ink/build/render-node-to-output.d.ts +14 -0
  341. package/dist/server/node_modules/ink/build/render-node-to-output.js +147 -0
  342. package/dist/server/node_modules/ink/build/render-node-to-output.js.map +1 -0
  343. package/dist/server/node_modules/ink/build/render-to-string.d.ts +38 -0
  344. package/dist/server/node_modules/ink/build/render-to-string.js +115 -0
  345. package/dist/server/node_modules/ink/build/render-to-string.js.map +1 -0
  346. package/dist/server/node_modules/ink/build/render.d.ts +121 -0
  347. package/dist/server/node_modules/ink/build/render.js +55 -0
  348. package/dist/server/node_modules/ink/build/render.js.map +1 -0
  349. package/dist/server/node_modules/ink/build/renderer.d.ts +8 -0
  350. package/dist/server/node_modules/ink/build/renderer.js +55 -0
  351. package/dist/server/node_modules/ink/build/renderer.js.map +1 -0
  352. package/dist/server/node_modules/ink/build/sanitize-ansi.d.ts +2 -0
  353. package/dist/server/node_modules/ink/build/sanitize-ansi.js +27 -0
  354. package/dist/server/node_modules/ink/build/sanitize-ansi.js.map +1 -0
  355. package/dist/server/node_modules/ink/build/screen-reader-update.d.ts +13 -0
  356. package/dist/server/node_modules/ink/build/screen-reader-update.js +38 -0
  357. package/dist/server/node_modules/ink/build/screen-reader-update.js.map +1 -0
  358. package/dist/server/node_modules/ink/build/squash-text-nodes.d.ts +3 -0
  359. package/dist/server/node_modules/ink/build/squash-text-nodes.js +36 -0
  360. package/dist/server/node_modules/ink/build/squash-text-nodes.js.map +1 -0
  361. package/dist/server/node_modules/ink/build/styles.d.ts +240 -0
  362. package/dist/server/node_modules/ink/build/styles.js +232 -0
  363. package/dist/server/node_modules/ink/build/styles.js.map +1 -0
  364. package/dist/server/node_modules/ink/build/utils.d.ts +2 -0
  365. package/dist/server/node_modules/ink/build/utils.js +4 -0
  366. package/dist/server/node_modules/ink/build/utils.js.map +1 -0
  367. package/dist/server/node_modules/ink/build/wrap-text.d.ts +3 -0
  368. package/dist/server/node_modules/ink/build/wrap-text.js +31 -0
  369. package/dist/server/node_modules/ink/build/wrap-text.js.map +1 -0
  370. package/dist/server/node_modules/ink/build/write-synchronized.d.ts +4 -0
  371. package/dist/server/node_modules/ink/build/write-synchronized.js +7 -0
  372. package/dist/server/node_modules/ink/build/write-synchronized.js.map +1 -0
  373. package/dist/server/node_modules/ink/license +10 -0
  374. package/dist/server/node_modules/ink/package.json +201 -0
  375. package/dist/server/node_modules/ink/readme.md +2636 -0
  376. package/dist/server/node_modules/is-fullwidth-code-point/index.d.ts +17 -0
  377. package/dist/server/node_modules/is-fullwidth-code-point/index.js +12 -0
  378. package/dist/server/node_modules/is-fullwidth-code-point/license +9 -0
  379. package/dist/server/node_modules/is-fullwidth-code-point/package.json +53 -0
  380. package/dist/server/node_modules/is-fullwidth-code-point/readme.md +31 -0
  381. package/dist/server/node_modules/is-unicode-supported/index.d.ts +12 -0
  382. package/dist/server/node_modules/is-unicode-supported/index.js +21 -0
  383. package/dist/server/node_modules/is-unicode-supported/license +9 -0
  384. package/dist/server/node_modules/is-unicode-supported/package.json +47 -0
  385. package/dist/server/node_modules/is-unicode-supported/readme.md +35 -0
  386. package/dist/server/node_modules/restore-cursor/index.d.ts +11 -0
  387. package/dist/server/node_modules/restore-cursor/index.js +11 -0
  388. package/dist/server/node_modules/restore-cursor/license +9 -0
  389. package/dist/server/node_modules/restore-cursor/package.json +55 -0
  390. package/dist/server/node_modules/restore-cursor/readme.md +31 -0
  391. package/dist/server/node_modules/string-width/index.d.ts +39 -0
  392. package/dist/server/node_modules/string-width/index.js +82 -0
  393. package/dist/server/node_modules/string-width/license +9 -0
  394. package/dist/server/node_modules/string-width/package.json +64 -0
  395. package/dist/server/node_modules/string-width/readme.md +66 -0
  396. package/dist/server/server.js +51 -36
  397. package/package.json +1 -1
  398. package/dist/client/assets/registry-CXcvF-uz.js +0 -2
  399. package/dist/client/assets/store-registry-BebL2rFu.js +0 -2
  400. package/dist/client/assets/useInfiniteQuery-Dj_RSaBx.js +0 -1
  401. package/dist/client/assets/useSuspenseInfiniteQuery-DJb5VXkS.js +0 -1
  402. package/dist/client/assets/workflow-detail-E-UgwIFZ.js +0 -1
  403. package/dist/server/node_modules/slice-ansi/index.d.ts +0 -19
  404. package/dist/server/node_modules/slice-ansi/index.js +0 -260
  405. package/dist/server/node_modules/slice-ansi/package.json +0 -59
  406. package/dist/server/node_modules/slice-ansi/readme.md +0 -54
  407. package/dist/server/node_modules/slice-ansi/tokenize-ansi.js +0 -752
@@ -1 +1 @@
1
- import{e as ge,P as ke,j as s,B as pe,s as Ae,r as P,t as w,x as we}from"./index-Bq8MNgeV.js";import{c as U,b as Ce,a as ue,D as xe}from"./dropdown-menu-DX0TPN0k.js";import{a as Pe}from"./Users03-BvEJiMrD.js";import{G as Te,a as Me,I as Oe,S as ze,L as Le,b as Ie}from"./lean-canvas-recruit-modal-cabC6cgI.js";import{W as Ee,b as Ge}from"./constants-ClujOLL0.js";import{b as Be,a as He}from"./use-virtual-mcp-CD_T-y85.js";import{P as ne}from"./index-DF2eiQ1x.js";import{i as $e}from"./DotsVertical-DlBHJ9PJ.js";import{a as Re}from"./Settings02-Yw9y8zcL.js";import{s as Fe}from"./Trash01-CWiWK8tz.js";import{A as ve,ag as Ve}from"./agent-icon-DIgcdFeV.js";import{a as be}from"./use-navigate-to-agent-C4qiakGR.js";import{C as Ne}from"./card-BsjNx5Cg.js";import{f as We}from"./formatDistanceToNow-Cb2QZZJn.js";import{E as Ke}from"./empty-state-D8kZInFe.js";import{u as qe}from"./use-create-virtual-mcp-BobcuW0I.js";import{c as Je,b as Qe,d as Ue,f as Xe,e as Ye,g as Ze,a as et,A as tt}from"./alert-dialog-CoBaZf61.js";import{S as st}from"./search-input-CtBB2Ogw.js";import{s as je}from"./Plus-Dld8jPbl.js";import"./Check-B3zx_U26.js";import"./ChevronRight-E3ry5bv1.js";import"./dialog-DlXEbbro.js";import"./X-DCaJ2DR_.js";import"./RefreshCcw01-DlZMdaR5.js";import"./collection-search-CkG6QTlc.js";import"./SearchMd-BzVtNNV8.js";import"./checkbox-B5i71aX9.js";import"./use-connection-Lr8heJ8D.js";import"./use-collections-8VzaVe93.js";import"./Lock01-BWTd97_q.js";import"./extract-connection-data-D2pRgNGp.js";import"./constants-hHr1XnHs.js";import"./collections-BbDNQEWM.js";import"./drawer-PL1KJG8h.js";import"./tooltip-Cop6BWIB.js";import"./integration-icon-C60b_d7I.js";import"./Container-hpy3kvOB.js";import"./use-mcp-tools-DQxTqUp3.js";import"./sidebar-CaCy2pvj.js";import"./LayoutLeft-O15r8yaV.js";import"./AlertCircle-BhKIfxeV.js";import"./Tool01-C_J_zDPh.js";import"./Archive-Dz0wtILE.js";import"./XClose-BpbAJCm9.js";import"./ArrowNarrowLeft-D2IzKz0U.js";import"./XCircle-Xm8lpkAu.js";import"./ArrowUpRight-DQNhEvxd.js";import"./ZapSquare-D31ZX-yT.js";import"./CheckCircle-S5ffz95T.js";import"./ChevronDown-B2rzld2y.js";import"./ChevronUp-CR14Z0nx.js";import"./Star01-D7-_AozX.js";import"./Palette-48b46GGh.js";import"./LinkExternal01-CqYIOZ9A.js";import"./Sun-BRoJ4FPT.js";import"./Play-CWd0g6Ov.js";import"./Shield01-Bryrtn4R.js";import"./User01-Cuf_FrNk.js";import"./Zap-DkdmeY_3.js";import"./differenceInSeconds-NQ4PDo0z.js";function _e(e){const t=ge.c(17),{onCreateFromScratch:i,onImportGitHub:g,onImportDeco:d,isCreating:o,align:j,side:f,showBetaBadge:p}=e,a=j===void 0?"end":j,[n]=ke();let u;t[0]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(Pe,{size:14}),t[0]=u):u=t[0];let c;t[1]!==o||t[2]!==i?(c=s.jsxs(U,{disabled:o,onClick:i,children:[u,"Create from scratch"]}),t[1]=o,t[2]=i,t[3]=c):c=t[3];let r;t[4]!==g||t[5]!==n.experimental_vibecode||t[6]!==p?(r=n.experimental_vibecode&&s.jsxs(U,{onClick:g,children:[s.jsx(Te,{className:"size-3.5"}),"Import from GitHub",p&&s.jsx("span",{className:"ml-auto text-[10px] font-medium text-muted-foreground bg-muted rounded px-1 py-0.5",children:"Beta"})]}),t[4]=g,t[5]=n.experimental_vibecode,t[6]=p,t[7]=r):r=t[7];let x;t[8]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"deco.cx",className:"size-3.5"}),t[8]=x):x=t[8];let m;t[9]!==d?(m=s.jsxs(U,{onClick:d,children:[x,"Import from deco.cx"]}),t[9]=d,t[10]=m):m=t[10];let _;return t[11]!==a||t[12]!==f||t[13]!==c||t[14]!==r||t[15]!==m?(_=s.jsxs(Ce,{side:f,align:a,className:"w-48",children:[c,r,m]}),t[11]=a,t[12]=f,t[13]=c,t[14]=r,t[15]=m,t[16]=_):_=t[16],_}function it(e){const t=ge.c(44),{project:i,onDeleteClick:g}=e,d=be();let o;t[0]!==d||t[1]!==i.id?(o=()=>d(i.id),t[0]=d,t[1]=i.id,t[2]=o):o=t[2];let j;t[3]!==i.title||t[4]!==o?(j=s.jsx("button",{type:"button",onClick:o,className:"absolute inset-0 z-0","aria-label":i.title}),t[3]=i.title,t[4]=o,t[5]=j):j=t[5];let f;t[6]!==i.icon||t[7]!==i.title?(f=s.jsx(ve,{icon:i.icon,name:i.title,size:"sm",className:"shrink-0 shadow-sm"}),t[6]=i.icon,t[7]=i.title,t[8]=f):f=t[8];let p;t[9]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(ue,{asChild:!0,children:s.jsx(pe,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:s.jsx($e,{size:20})})}),t[9]=p):p=t[9];let a;t[10]!==d||t[11]!==i.id?(a=()=>d(i.id,{search:{main:"settings"}}),t[10]=d,t[11]=i.id,t[12]=a):a=t[12];let n;t[13]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Re,{size:16}),t[13]=n):n=t[13];let u;t[14]!==a?(u=s.jsxs(U,{onClick:a,children:[n,"Settings"]}),t[14]=a,t[15]=u):u=t[15];let c;t[16]!==g?(c=g&&s.jsxs(U,{variant:"destructive",onClick:y=>{y.stopPropagation(),g(y)},children:[s.jsx(Fe,{size:16}),"Delete"]}),t[16]=g,t[17]=c):c=t[17];let r;t[18]!==u||t[19]!==c?(r=s.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:s.jsxs(xe,{children:[p,s.jsxs(Ce,{align:"end",children:[u,c]})]})}),t[18]=u,t[19]=c,t[20]=r):r=t[20];let x;t[21]!==f||t[22]!==r?(x=s.jsxs("div",{className:"flex items-start justify-between",children:[f,r]}),t[21]=f,t[22]=r,t[23]=x):x=t[23];let m;t[24]!==i.title?(m=s.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:i.title}),t[24]=i.title,t[25]=m):m=t[25];const _=i.description||"No description";let N;t[26]!==_?(N=s.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:_}),t[26]=_,t[27]=N):N=t[27];let v;t[28]!==m||t[29]!==N?(v=s.jsxs("div",{className:"flex flex-col gap-1",children:[m,N]}),t[28]=m,t[29]=N,t[30]=v):v=t[30];let D;t[31]!==x||t[32]!==v?(D=s.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[x,v]}),t[31]=x,t[32]=v,t[33]=D):D=t[33];let b;t[34]!==i.updated_at?(b=We(new Date(i.updated_at),{addSuffix:!0}),t[34]=i.updated_at,t[35]=b):b=t[35];let S;t[36]!==b?(S=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:b})})}),t[36]=b,t[37]=S):S=t[37];let h;t[38]!==D||t[39]!==S?(h=s.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[D,S]}),t[38]=D,t[39]=S,t[40]=h):h=t[40];let C;return t[41]!==h||t[42]!==j?(C=s.jsxs(Ne,{className:"relative transition-colors group overflow-hidden flex flex-col h-full hover:bg-muted/50",children:[j,h]}),t[41]=h,t[42]=j,t[43]=C):C=t[43],C}function ps(){const e=ge.c(80),{org:t}=Ae(),i=Be(),g=He(),d=be(),[o,j]=P.useState("");let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f={navigateOnCreate:!0},e[0]=f):f=e[0];const{createVirtualMCP:p,isCreating:a}=qe(f),[n,u]=P.useState(null),[c,r]=P.useState(!1),[x,m]=P.useState(!1),[_,N]=P.useState(!1),[v,D]=P.useState(!1),[b,S]=P.useState(!1);let h,C,y,T,k,A,M,O,z;if(e[1]!==g||e[2]!==i||e[3]!==p||e[4]!==n||e[5]!==a||e[6]!==d||e[7]!==t||e[8]!==o){const Q=o.toLowerCase(),de=i.filter(l=>l.id!==t.id&&(l.title.toLowerCase().includes(Q)||l.description?.toLowerCase().includes(Q)));let te;e[18]!==i?(te=i.some(rt),e[18]=i,e[19]=te):te=e[19];const De=te,fe=Ee.filter(l=>(!o||l.title.toLowerCase().includes(Q))&&!(l.id==="studio-pack"&&De)),he=i.find(ot);k=i.find(lt);const Se=l=>{w("agents_list_template_clicked",{template_id:l}),l==="site-editor"?r(!0):l==="site-diagnostics"?he?d(he.id):N(!0):l==="lean-canvas"?k?d(k.id):S(!0):l==="studio-pack"&&D(!0)};let se;e[20]!==g||e[21]!==n?(se=async()=>{if(!n)return;const{id:l,title:ye}=n;u(null);try{await g.delete.mutateAsync(l),w("agent_deleted",{agent_id:l,source:"agents_list"}),we.success(`Deleted "${ye}"`)}catch{}},e[20]=g,e[21]=n,e[22]=se):se=e[22],T=se,y=ne,C=ne.Content,h=ne.Body;let ie;e[23]===Symbol.for("react.memo_cache_sentinel")?(ie=s.jsx(ne.Title,{children:"Agents"}),e[23]=ie):ie=e[23];let le;e[24]===Symbol.for("react.memo_cache_sentinel")?(le=l=>{l.key==="Escape"&&(j(""),l.target.blur())},e[24]=le):le=e[24];let K;e[25]!==o?(K=s.jsx(st,{value:o,onChange:j,placeholder:"Search for an agent...",className:"w-full md:w-[375px]",onKeyDown:le}),e[25]=o,e[26]=K):K=e[26];let oe;e[27]===Symbol.for("react.memo_cache_sentinel")?(oe=s.jsx(ue,{asChild:!0,children:s.jsxs(pe,{size:"sm",children:[s.jsx(je,{size:14}),"Create Agent"]})}),e[27]=oe):oe=e[27];let q;e[28]!==p?(q=()=>{w("agent_create_clicked",{source:"agents_list",method:"scratch"}),p()},e[28]=p,e[29]=q):q=e[29];let re,ae;e[30]===Symbol.for("react.memo_cache_sentinel")?(re=()=>{w("agent_create_clicked",{source:"agents_list",method:"github"}),m(!0)},ae=()=>{w("agent_create_clicked",{source:"agents_list",method:"deco"}),r(!0)},e[30]=re,e[31]=ae):(re=e[30],ae=e[31]);let J;e[32]!==a||e[33]!==q?(J=s.jsxs(xe,{children:[oe,s.jsx(_e,{onCreateFromScratch:q,onImportGitHub:re,onImportDeco:ae,isCreating:a,align:"end"})]}),e[32]=a,e[33]=q,e[34]=J):J=e[34],e[35]!==J||e[36]!==K?(A=s.jsxs("div",{className:"flex flex-col gap-6",children:[ie,s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[K,J]})]}),e[35]=J,e[36]=K,e[37]=A):A=e[37],M=de.length===0&&fe.length===0&&s.jsx("div",{className:"flex items-center justify-center py-20",children:s.jsx(Ke,{image:s.jsx(Ve,{size:48,className:"text-muted-foreground"}),title:o?"No agents found":"No agents yet",description:o?`No agents match "${o}"`:"Create an agent to get started.",actions:!o&&s.jsxs(xe,{children:[s.jsx(ue,{asChild:!0,children:s.jsxs(pe,{size:"sm",children:[s.jsx(je,{size:14}),"Create Agent"]})}),s.jsx(_e,{onCreateFromScratch:()=>{w("agent_create_clicked",{source:"agents_list_empty",method:"scratch"}),p()},onImportGitHub:()=>{w("agent_create_clicked",{source:"agents_list_empty",method:"github"}),m(!0)},onImportDeco:()=>{w("agent_create_clicked",{source:"agents_list_empty",method:"deco"}),r(!0)},isCreating:a,align:"center",showBetaBadge:!0})]})})}),O=de.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:de.map(l=>s.jsx(it,{project:l,onDeleteClick:()=>u({id:l.id,title:l.title})},l.id))})]}),z=fe.length>0&&s.jsxs("div",{className:"mt-6 @container",children:[s.jsx("h3",{className:"text-sm font-medium text-muted-foreground mb-3",children:"Agent Templates"}),s.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:fe.map(l=>s.jsx(Ne,{className:"relative transition-colors group overflow-hidden flex flex-col h-full hover:bg-muted/50 cursor-pointer",onClick:()=>Se(l.id),children:s.jsx("div",{className:"flex flex-col flex-1",children:s.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[s.jsx(ve,{icon:l.icon,name:l.title,size:"sm",className:"shrink-0 shadow-sm"}),s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:l.title}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Click to set up"})]})]})})},l.id))})]}),e[1]=g,e[2]=i,e[3]=p,e[4]=n,e[5]=a,e[6]=d,e[7]=t,e[8]=o,e[9]=h,e[10]=C,e[11]=y,e[12]=T,e[13]=k,e[14]=A,e[15]=M,e[16]=O,e[17]=z}else h=e[9],C=e[10],y=e[11],T=e[12],k=e[13],A=e[14],M=e[15],O=e[16],z=e[17];let L;e[38]!==h||e[39]!==A||e[40]!==M||e[41]!==O||e[42]!==z?(L=s.jsxs(h,{children:[A,M,O,z]}),e[38]=h,e[39]=A,e[40]=M,e[41]=O,e[42]=z,e[43]=L):L=e[43];let I;e[44]!==C||e[45]!==L?(I=s.jsx(C,{children:L}),e[44]=C,e[45]=L,e[46]=I):I=e[46];let E;e[47]!==x?(E=s.jsx(Me,{open:x,onOpenChange:m}),e[47]=x,e[48]=E):E=e[48];let G;e[49]!==c?(G=s.jsx(Oe,{open:c,onOpenChange:r}),e[49]=c,e[50]=G):G=e[50];let B;e[51]!==_?(B=s.jsx(ze,{open:_,onOpenChange:N}),e[51]=_,e[52]=B):B=e[52];let H;e[53]!==k||e[54]!==b?(H=s.jsx(Le,{open:b,onOpenChange:S,existingAgent:k}),e[53]=k,e[54]=b,e[55]=H):H=e[55];let $;e[56]!==v?($=s.jsx(Ie,{open:v,onOpenChange:D}),e[56]=v,e[57]=$):$=e[57];const ce=!!n;let X;e[58]===Symbol.for("react.memo_cache_sentinel")?(X=Q=>!Q&&u(null),e[58]=X):X=e[58];let Y;e[59]===Symbol.for("react.memo_cache_sentinel")?(Y=s.jsx(Je,{children:"Delete Agent?"}),e[59]=Y):Y=e[59];const me=n?.title;let R;e[60]!==me?(R=s.jsxs(Qe,{children:[Y,s.jsxs(Ue,{children:["This action cannot be undone. This will permanently delete"," ",s.jsx("span",{className:"font-medium text-foreground",children:me}),"."]})]}),e[60]=me,e[61]=R):R=e[61];let Z;e[62]===Symbol.for("react.memo_cache_sentinel")?(Z=s.jsx(Xe,{children:"Cancel"}),e[62]=Z):Z=e[62];let F;e[63]!==T?(F=s.jsxs(Ye,{children:[Z,s.jsx(Ze,{onClick:T,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),e[63]=T,e[64]=F):F=e[64];let V;e[65]!==R||e[66]!==F?(V=s.jsxs(et,{children:[R,F]}),e[65]=R,e[66]=F,e[67]=V):V=e[67];let W;e[68]!==ce||e[69]!==V?(W=s.jsx(tt,{open:ce,onOpenChange:X,children:V}),e[68]=ce,e[69]=V,e[70]=W):W=e[70];let ee;return e[71]!==y||e[72]!==H||e[73]!==$||e[74]!==W||e[75]!==I||e[76]!==E||e[77]!==G||e[78]!==B?(ee=s.jsxs(y,{children:[I,E,G,B,H,$,W]}),e[71]=y,e[72]=H,e[73]=$,e[74]=W,e[75]=I,e[76]=E,e[77]=G,e[78]=B,e[79]=ee):ee=e[79],ee}function lt(e){return e.metadata?.type==="lean-canvas"}function ot(e){return e.metadata?.type==="site-diagnostics"}function rt(e){return Ge(e.id)}export{ps as default};
1
+ import{e as ge,P as ke,j as s,B as pe,s as Ae,r as P,t as w,x as we}from"./index-B3N0ijMe.js";import{c as U,b as Ce,a as ue,D as xe}from"./dropdown-menu-B6XbAhub.js";import{a as Pe}from"./Users03-y_ec4Rh1.js";import{G as Te,a as Me,I as Oe,S as ze,L as Le,b as Ie}from"./lean-canvas-recruit-modal-Bjwqo_gw.js";import{W as Ee,b as Ge}from"./constants-CmcFrIt1.js";import{b as Be,a as He}from"./use-virtual-mcp-fhETXyqA.js";import{P as ne}from"./index-Bn0UKgPw.js";import{i as $e}from"./DotsVertical-BV7jVmIB.js";import{a as Re}from"./Settings02-xGJb-3cc.js";import{s as Fe}from"./Trash01-IeycYlZQ.js";import{A as ve,ag as Ve}from"./agent-icon-CGz6_qSV.js";import{a as be}from"./use-navigate-to-agent-Cz6wq5hE.js";import{C as Ne}from"./card-Bl-Rmbpi.js";import{f as We}from"./formatDistanceToNow-Cb2QZZJn.js";import{E as Ke}from"./empty-state-ChZyciKg.js";import{u as qe}from"./use-create-virtual-mcp-CAXfmcVs.js";import{c as Je,b as Qe,d as Ue,f as Xe,e as Ye,g as Ze,a as et,A as tt}from"./alert-dialog-BTkTE2x9.js";import{S as st}from"./search-input-DUMgPofa.js";import{s as je}from"./Plus-D1tHeJo2.js";import"./Check-Ccw422Wb.js";import"./ChevronRight-CeUhrzuf.js";import"./dialog-C8PiJXDq.js";import"./X-C63lgCLS.js";import"./RefreshCcw01-BESGm5a8.js";import"./collection-search-DEySGVjR.js";import"./SearchMd-eCR8N7AG.js";import"./checkbox-B4-n2Voa.js";import"./use-connection-BIHmIl4c.js";import"./use-collections-Cqjc7P8G.js";import"./Lock01-D2YNxdLq.js";import"./extract-connection-data-CH0LUcT-.js";import"./constants-CjJyIjLn.js";import"./collections-D541sKCa.js";import"./drawer-SuAP4nw3.js";import"./tooltip-D_KYUaTY.js";import"./integration-icon-BtzcxrlN.js";import"./Container-OQiFme-7.js";import"./use-mcp-tools-CclZhRpl.js";import"./sidebar-DC8b4t6M.js";import"./LayoutLeft-BuJA8_jK.js";import"./AlertCircle-CUtXIfwC.js";import"./Tool01-DmFqON6q.js";import"./Archive-Btl9BXLu.js";import"./XClose-DA8jbEWY.js";import"./ArrowNarrowLeft-CVkIxPAV.js";import"./XCircle-BkB1Kg5O.js";import"./ArrowUpRight-BrfnA0N_.js";import"./ZapSquare-Biue2YhF.js";import"./CheckCircle-C3sPsdSO.js";import"./ChevronDown-cpZNJlz9.js";import"./ChevronUp-C-rBrlqd.js";import"./Star01-nv1oI22I.js";import"./Palette-By9pNqp1.js";import"./LinkExternal01-CRxfzQ_Z.js";import"./Sun-hmutQjwc.js";import"./Play-CcNC_puc.js";import"./Shield01-CA7f1yxn.js";import"./User01-CnizOinw.js";import"./Zap-N-AnbCTG.js";import"./differenceInSeconds-NQ4PDo0z.js";function _e(e){const t=ge.c(17),{onCreateFromScratch:i,onImportGitHub:g,onImportDeco:d,isCreating:o,align:j,side:f,showBetaBadge:p}=e,a=j===void 0?"end":j,[n]=ke();let u;t[0]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(Pe,{size:14}),t[0]=u):u=t[0];let c;t[1]!==o||t[2]!==i?(c=s.jsxs(U,{disabled:o,onClick:i,children:[u,"Create from scratch"]}),t[1]=o,t[2]=i,t[3]=c):c=t[3];let r;t[4]!==g||t[5]!==n.experimental_vibecode||t[6]!==p?(r=n.experimental_vibecode&&s.jsxs(U,{onClick:g,children:[s.jsx(Te,{className:"size-3.5"}),"Import from GitHub",p&&s.jsx("span",{className:"ml-auto text-[10px] font-medium text-muted-foreground bg-muted rounded px-1 py-0.5",children:"Beta"})]}),t[4]=g,t[5]=n.experimental_vibecode,t[6]=p,t[7]=r):r=t[7];let x;t[8]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"deco.cx",className:"size-3.5"}),t[8]=x):x=t[8];let m;t[9]!==d?(m=s.jsxs(U,{onClick:d,children:[x,"Import from deco.cx"]}),t[9]=d,t[10]=m):m=t[10];let _;return t[11]!==a||t[12]!==f||t[13]!==c||t[14]!==r||t[15]!==m?(_=s.jsxs(Ce,{side:f,align:a,className:"w-48",children:[c,r,m]}),t[11]=a,t[12]=f,t[13]=c,t[14]=r,t[15]=m,t[16]=_):_=t[16],_}function it(e){const t=ge.c(44),{project:i,onDeleteClick:g}=e,d=be();let o;t[0]!==d||t[1]!==i.id?(o=()=>d(i.id),t[0]=d,t[1]=i.id,t[2]=o):o=t[2];let j;t[3]!==i.title||t[4]!==o?(j=s.jsx("button",{type:"button",onClick:o,className:"absolute inset-0 z-0","aria-label":i.title}),t[3]=i.title,t[4]=o,t[5]=j):j=t[5];let f;t[6]!==i.icon||t[7]!==i.title?(f=s.jsx(ve,{icon:i.icon,name:i.title,size:"sm",className:"shrink-0 shadow-sm"}),t[6]=i.icon,t[7]=i.title,t[8]=f):f=t[8];let p;t[9]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(ue,{asChild:!0,children:s.jsx(pe,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:s.jsx($e,{size:20})})}),t[9]=p):p=t[9];let a;t[10]!==d||t[11]!==i.id?(a=()=>d(i.id,{search:{main:"settings"}}),t[10]=d,t[11]=i.id,t[12]=a):a=t[12];let n;t[13]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Re,{size:16}),t[13]=n):n=t[13];let u;t[14]!==a?(u=s.jsxs(U,{onClick:a,children:[n,"Settings"]}),t[14]=a,t[15]=u):u=t[15];let c;t[16]!==g?(c=g&&s.jsxs(U,{variant:"destructive",onClick:y=>{y.stopPropagation(),g(y)},children:[s.jsx(Fe,{size:16}),"Delete"]}),t[16]=g,t[17]=c):c=t[17];let r;t[18]!==u||t[19]!==c?(r=s.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:s.jsxs(xe,{children:[p,s.jsxs(Ce,{align:"end",children:[u,c]})]})}),t[18]=u,t[19]=c,t[20]=r):r=t[20];let x;t[21]!==f||t[22]!==r?(x=s.jsxs("div",{className:"flex items-start justify-between",children:[f,r]}),t[21]=f,t[22]=r,t[23]=x):x=t[23];let m;t[24]!==i.title?(m=s.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:i.title}),t[24]=i.title,t[25]=m):m=t[25];const _=i.description||"No description";let N;t[26]!==_?(N=s.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:_}),t[26]=_,t[27]=N):N=t[27];let v;t[28]!==m||t[29]!==N?(v=s.jsxs("div",{className:"flex flex-col gap-1",children:[m,N]}),t[28]=m,t[29]=N,t[30]=v):v=t[30];let D;t[31]!==x||t[32]!==v?(D=s.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[x,v]}),t[31]=x,t[32]=v,t[33]=D):D=t[33];let b;t[34]!==i.updated_at?(b=We(new Date(i.updated_at),{addSuffix:!0}),t[34]=i.updated_at,t[35]=b):b=t[35];let S;t[36]!==b?(S=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:b})})}),t[36]=b,t[37]=S):S=t[37];let h;t[38]!==D||t[39]!==S?(h=s.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[D,S]}),t[38]=D,t[39]=S,t[40]=h):h=t[40];let C;return t[41]!==h||t[42]!==j?(C=s.jsxs(Ne,{className:"relative transition-colors group overflow-hidden flex flex-col h-full hover:bg-muted/50",children:[j,h]}),t[41]=h,t[42]=j,t[43]=C):C=t[43],C}function ps(){const e=ge.c(80),{org:t}=Ae(),i=Be(),g=He(),d=be(),[o,j]=P.useState("");let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f={navigateOnCreate:!0},e[0]=f):f=e[0];const{createVirtualMCP:p,isCreating:a}=qe(f),[n,u]=P.useState(null),[c,r]=P.useState(!1),[x,m]=P.useState(!1),[_,N]=P.useState(!1),[v,D]=P.useState(!1),[b,S]=P.useState(!1);let h,C,y,T,k,A,M,O,z;if(e[1]!==g||e[2]!==i||e[3]!==p||e[4]!==n||e[5]!==a||e[6]!==d||e[7]!==t||e[8]!==o){const Q=o.toLowerCase(),de=i.filter(l=>l.id!==t.id&&(l.title.toLowerCase().includes(Q)||l.description?.toLowerCase().includes(Q)));let te;e[18]!==i?(te=i.some(rt),e[18]=i,e[19]=te):te=e[19];const De=te,fe=Ee.filter(l=>(!o||l.title.toLowerCase().includes(Q))&&!(l.id==="studio-pack"&&De)),he=i.find(ot);k=i.find(lt);const Se=l=>{w("agents_list_template_clicked",{template_id:l}),l==="site-editor"?r(!0):l==="site-diagnostics"?he?d(he.id):N(!0):l==="lean-canvas"?k?d(k.id):S(!0):l==="studio-pack"&&D(!0)};let se;e[20]!==g||e[21]!==n?(se=async()=>{if(!n)return;const{id:l,title:ye}=n;u(null);try{await g.delete.mutateAsync(l),w("agent_deleted",{agent_id:l,source:"agents_list"}),we.success(`Deleted "${ye}"`)}catch{}},e[20]=g,e[21]=n,e[22]=se):se=e[22],T=se,y=ne,C=ne.Content,h=ne.Body;let ie;e[23]===Symbol.for("react.memo_cache_sentinel")?(ie=s.jsx(ne.Title,{children:"Agents"}),e[23]=ie):ie=e[23];let le;e[24]===Symbol.for("react.memo_cache_sentinel")?(le=l=>{l.key==="Escape"&&(j(""),l.target.blur())},e[24]=le):le=e[24];let K;e[25]!==o?(K=s.jsx(st,{value:o,onChange:j,placeholder:"Search for an agent...",className:"w-full md:w-[375px]",onKeyDown:le}),e[25]=o,e[26]=K):K=e[26];let oe;e[27]===Symbol.for("react.memo_cache_sentinel")?(oe=s.jsx(ue,{asChild:!0,children:s.jsxs(pe,{size:"sm",children:[s.jsx(je,{size:14}),"Create Agent"]})}),e[27]=oe):oe=e[27];let q;e[28]!==p?(q=()=>{w("agent_create_clicked",{source:"agents_list",method:"scratch"}),p()},e[28]=p,e[29]=q):q=e[29];let re,ae;e[30]===Symbol.for("react.memo_cache_sentinel")?(re=()=>{w("agent_create_clicked",{source:"agents_list",method:"github"}),m(!0)},ae=()=>{w("agent_create_clicked",{source:"agents_list",method:"deco"}),r(!0)},e[30]=re,e[31]=ae):(re=e[30],ae=e[31]);let J;e[32]!==a||e[33]!==q?(J=s.jsxs(xe,{children:[oe,s.jsx(_e,{onCreateFromScratch:q,onImportGitHub:re,onImportDeco:ae,isCreating:a,align:"end"})]}),e[32]=a,e[33]=q,e[34]=J):J=e[34],e[35]!==J||e[36]!==K?(A=s.jsxs("div",{className:"flex flex-col gap-6",children:[ie,s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[K,J]})]}),e[35]=J,e[36]=K,e[37]=A):A=e[37],M=de.length===0&&fe.length===0&&s.jsx("div",{className:"flex items-center justify-center py-20",children:s.jsx(Ke,{image:s.jsx(Ve,{size:48,className:"text-muted-foreground"}),title:o?"No agents found":"No agents yet",description:o?`No agents match "${o}"`:"Create an agent to get started.",actions:!o&&s.jsxs(xe,{children:[s.jsx(ue,{asChild:!0,children:s.jsxs(pe,{size:"sm",children:[s.jsx(je,{size:14}),"Create Agent"]})}),s.jsx(_e,{onCreateFromScratch:()=>{w("agent_create_clicked",{source:"agents_list_empty",method:"scratch"}),p()},onImportGitHub:()=>{w("agent_create_clicked",{source:"agents_list_empty",method:"github"}),m(!0)},onImportDeco:()=>{w("agent_create_clicked",{source:"agents_list_empty",method:"deco"}),r(!0)},isCreating:a,align:"center",showBetaBadge:!0})]})})}),O=de.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:de.map(l=>s.jsx(it,{project:l,onDeleteClick:()=>u({id:l.id,title:l.title})},l.id))})]}),z=fe.length>0&&s.jsxs("div",{className:"mt-6 @container",children:[s.jsx("h3",{className:"text-sm font-medium text-muted-foreground mb-3",children:"Agent Templates"}),s.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:fe.map(l=>s.jsx(Ne,{className:"relative transition-colors group overflow-hidden flex flex-col h-full hover:bg-muted/50 cursor-pointer",onClick:()=>Se(l.id),children:s.jsx("div",{className:"flex flex-col flex-1",children:s.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[s.jsx(ve,{icon:l.icon,name:l.title,size:"sm",className:"shrink-0 shadow-sm"}),s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:l.title}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Click to set up"})]})]})})},l.id))})]}),e[1]=g,e[2]=i,e[3]=p,e[4]=n,e[5]=a,e[6]=d,e[7]=t,e[8]=o,e[9]=h,e[10]=C,e[11]=y,e[12]=T,e[13]=k,e[14]=A,e[15]=M,e[16]=O,e[17]=z}else h=e[9],C=e[10],y=e[11],T=e[12],k=e[13],A=e[14],M=e[15],O=e[16],z=e[17];let L;e[38]!==h||e[39]!==A||e[40]!==M||e[41]!==O||e[42]!==z?(L=s.jsxs(h,{children:[A,M,O,z]}),e[38]=h,e[39]=A,e[40]=M,e[41]=O,e[42]=z,e[43]=L):L=e[43];let I;e[44]!==C||e[45]!==L?(I=s.jsx(C,{children:L}),e[44]=C,e[45]=L,e[46]=I):I=e[46];let E;e[47]!==x?(E=s.jsx(Me,{open:x,onOpenChange:m}),e[47]=x,e[48]=E):E=e[48];let G;e[49]!==c?(G=s.jsx(Oe,{open:c,onOpenChange:r}),e[49]=c,e[50]=G):G=e[50];let B;e[51]!==_?(B=s.jsx(ze,{open:_,onOpenChange:N}),e[51]=_,e[52]=B):B=e[52];let H;e[53]!==k||e[54]!==b?(H=s.jsx(Le,{open:b,onOpenChange:S,existingAgent:k}),e[53]=k,e[54]=b,e[55]=H):H=e[55];let $;e[56]!==v?($=s.jsx(Ie,{open:v,onOpenChange:D}),e[56]=v,e[57]=$):$=e[57];const ce=!!n;let X;e[58]===Symbol.for("react.memo_cache_sentinel")?(X=Q=>!Q&&u(null),e[58]=X):X=e[58];let Y;e[59]===Symbol.for("react.memo_cache_sentinel")?(Y=s.jsx(Je,{children:"Delete Agent?"}),e[59]=Y):Y=e[59];const me=n?.title;let R;e[60]!==me?(R=s.jsxs(Qe,{children:[Y,s.jsxs(Ue,{children:["This action cannot be undone. This will permanently delete"," ",s.jsx("span",{className:"font-medium text-foreground",children:me}),"."]})]}),e[60]=me,e[61]=R):R=e[61];let Z;e[62]===Symbol.for("react.memo_cache_sentinel")?(Z=s.jsx(Xe,{children:"Cancel"}),e[62]=Z):Z=e[62];let F;e[63]!==T?(F=s.jsxs(Ye,{children:[Z,s.jsx(Ze,{onClick:T,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),e[63]=T,e[64]=F):F=e[64];let V;e[65]!==R||e[66]!==F?(V=s.jsxs(et,{children:[R,F]}),e[65]=R,e[66]=F,e[67]=V):V=e[67];let W;e[68]!==ce||e[69]!==V?(W=s.jsx(tt,{open:ce,onOpenChange:X,children:V}),e[68]=ce,e[69]=V,e[70]=W):W=e[70];let ee;return e[71]!==y||e[72]!==H||e[73]!==$||e[74]!==W||e[75]!==I||e[76]!==E||e[77]!==G||e[78]!==B?(ee=s.jsxs(y,{children:[I,E,G,B,H,$,W]}),e[71]=y,e[72]=H,e[73]=$,e[74]=W,e[75]=I,e[76]=E,e[77]=G,e[78]=B,e[79]=ee):ee=e[79],ee}function lt(e){return e.metadata?.type==="lean-canvas"}function ot(e){return e.metadata?.type==="site-diagnostics"}function rt(e){return Ge(e.id)}export{ps as default};
@@ -1 +1 @@
1
- import{H as W,J as w,aJ as pe,aH as fe,aZ as Ie,ap as Se,aI as ye,e as G,D as Re,z as Te,r as O,j as s,C as Oe,x as Z,M as ke,s as de,o as ge,a as oe,K as J,n as ze,c as ve,B as Y,t as Ce,E as Le}from"./index-Bq8MNgeV.js";import{i as qe}from"./AlertCircle-BhKIfxeV.js";import{P as ae}from"./index-DF2eiQ1x.js";import{S as he}from"./skeleton-B2ZrUZa6.js";import{b as we,a as xe,S as be,d as Ue}from"./settings-section-Bh35ipKE.js";import{u as re,a as ce,b as Ne}from"./use-ai-providers-BGcGBNhE.js";import{i as Be}from"./CheckCircle-S5ffz95T.js";import{p as Ge}from"./chat-context-CXqWCM0D.js";import{e as Ve,f as Qe}from"./use-organization-settings-4FSfpkha.js";import{M as Ye,O as We,P as He,C as je}from"./select-model-A6plReXc.js";import{u as Je}from"./use-debounced-autosave-CyEn9Ro2.js";import{I as Ze}from"./input-DTt32vul.js";import{a as _e,T as Xe}from"./toggle-group-BDnmrZSN.js";import{b as Pe,c as Ae,d as De,f as Ee,a as Ke,e as Fe,g as $e,A as Me}from"./alert-dialog-CoBaZf61.js";import{S as me,u as ue}from"./constants-ClujOLL0.js";import{s as et}from"./Plus-Dld8jPbl.js";import{i as tt}from"./Check-B3zx_U26.js";import{i as st}from"./Tool01-C_J_zDPh.js";import{s as it}from"./Trash01-CWiWK8tz.js";import{i as ot}from"./X-DCaJ2DR_.js";import{A as rt}from"./avatar-C31fe2qO.js";import{f as lt}from"./formatDistanceToNow-Cb2QZZJn.js";import"./sidebar-CaCy2pvj.js";import"./LayoutLeft-O15r8yaV.js";import"./tooltip-Cop6BWIB.js";import"./card-BsjNx5Cg.js";import"./ArrowUpRight-DQNhEvxd.js";import"./use-virtual-mcp-CD_T-y85.js";import"./use-collections-8VzaVe93.js";import"./use-decopilot-events-CiJL_0vR.js";import"./create-sse-subscription-CxkOgzKf.js";import"./use-tasks-C2q1pKyD.js";import"./checkbox-B5i71aX9.js";import"./dialog-DlXEbbro.js";import"./drawer-PL1KJG8h.js";import"./select-Bmu7KX9g.js";import"./ChevronDown-B2rzld2y.js";import"./ChevronUp-CR14Z0nx.js";import"./RefreshCcw01-DlZMdaR5.js";import"./SearchMd-BzVtNNV8.js";import"./Settings02-Yw9y8zcL.js";import"./ai-providers-logos-DD3qZ33J.js";import"./Zap-DkdmeY_3.js";import"./spinner-M0_j9E66.js";import"./ChevronRight-E3ry5bv1.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./User01-Cuf_FrNk.js";import"./differenceInSeconds-NQ4PDo0z.js";W({title:w(),url:w(),icon:w()});W({registries:fe(w(),W({enabled:Ie()})).describe("Per-registry enabled/disabled state. Key is connection ID. Absent registries are treated as enabled."),blockedMcps:pe(w()).describe("List of MCP app_name or app_id values to hide from the store.")});const ie=W({keyId:w(),modelId:w(),title:w().optional()}).nullable();Se(["fast","smart","thinking","image","web_research"]);Se(["fast","smart","thinking"]);const nt=W({tiers:W({fast:ie,smart:ie,thinking:ie,image:ie,web_research:ie})});W({ids:pe(w()).describe("Ordered list of agent ids to show on the home view. Mix of well-known template ids and custom virtual MCP ids.")});W({id:w().describe("Brand context ID"),name:w().describe("Company name"),domain:w().describe("Company domain (e.g. example.com)"),overview:w().describe("Company overview / description"),logo:w().nullable().optional().describe("Logo URL"),favicon:w().nullable().optional().describe("Favicon URL"),ogImage:w().nullable().optional().describe("OG image URL"),fonts:W({heading:w().optional().describe("Font family for headings"),body:w().optional().describe("Font family for body text"),code:w().optional().describe("Font family for code / monospace")}).nullable().optional().describe("Font families by semantic role"),colors:W({primary:w().optional().describe("Primary brand color (hex)"),secondary:w().optional().describe("Secondary brand color (hex)"),accent:w().optional().describe("Accent / highlight color (hex)"),background:w().optional().describe("Background color (hex)"),foreground:w().optional().describe("Foreground / text color (hex)")}).nullable().optional().describe("Semantic color palette"),images:pe(fe(w(),ye())).nullable().optional().describe("Brand images"),metadata:fe(w(),ye()).nullable().optional().describe("Extra design tokens (typography, components, spacing, layout, tone, etc.)"),archivedAt:w().nullable().optional().describe("Archive timestamp (null to unarchive)"),isDefault:Ie().optional().describe("Whether this is the default brand for the organization")});const at=e=>e.capabilities?.includes("image")===!0,ct=e=>{if(e.asyncResearch===!0)return!0;const t=e.modelId.toLowerCase().replace(/[^a-z0-9]/g,"");return t.includes("sonar")||t.includes("deepresearch")},dt=[{key:"fast",label:"Fast",description:"Fastest responses, best for quick tasks",filter:void 0},{key:"smart",label:"Smart",description:"Balanced speed and capability",filter:void 0},{key:"thinking",label:"Thinking",description:"Most capable, best for complex tasks",filter:void 0},{key:"image",label:"Image",description:"Image generation",filter:at},{key:"web_research",label:"Web research",description:"Web search and deep research",filter:ct}];function mt(e){const t=G.c(20),{slot:i,onSlotChange:n,filterModels:o,defaultKeyId:d}=e,r=re(),[l,m]=O.useState(i?.keyId??d);let b;t[0]!==i?(b=()=>{i?.keyId&&m(i.keyId)},t[0]=i,t[1]=b):b=t[1];const h=i?.keyId;let f;t[2]!==h?(f=[h],t[2]=h,t[3]=f):f=t[3],O.useEffect(b,f);const c=l??d;let g;t[4]!==c||t[5]!==r?(g=c?r.find(a=>a.id===c):null,t[4]=c,t[5]=r,t[6]=g):g=t[6];const C=g,{models:p,isLoading:v}=ce(o?c??void 0:void 0),j=o?v||p.some(o):!0;let x;t[7]!==i||t[8]!==C?.providerId?(x=i?{modelId:i.modelId,title:i.title??i.modelId,keyId:i.keyId,providerId:C?.providerId??"deco",description:null,logo:null,capabilities:[],limits:null,costs:null}:null,t[7]=i,t[8]=C?.providerId,t[9]=x):x=t[9];const _=x;if(o&&!j){let a;return t[10]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("p",{className:"text-xs text-muted-foreground italic",children:"Not available with current provider"}),t[10]=a):a=t[10],a}let I;t[11]===Symbol.for("react.memo_cache_sentinel")?(I=a=>m(a),t[11]=I):I=t[11];let y;t[12]!==c||t[13]!==n?(y=a=>{const N=a.keyId??c??"";m(N),n({keyId:N,modelId:a.modelId,title:a.title})},t[12]=c,t[13]=n,t[14]=y):y=t[14];let S;return t[15]!==c||t[16]!==o||t[17]!==_||t[18]!==y?(S=s.jsx(Ye,{variant:"bordered",placeholder:"Pick model",model:_,credentialId:c,filterModels:o,onCredentialChange:I,onModelChange:y}),t[15]=c,t[16]=o,t[17]=_,t[18]=y,t[19]=S):S=t[19],S}function ut(e){const t=G.c(2),{isPending:i,showSaved:n}=e;if(i){let o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[s.jsx(ke,{size:12,className:"animate-spin"}),"Saving…"]}),t[0]=o):o=t[0],o}if(n){let o;return t[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[s.jsx(Be,{size:12}),"Saved"]}),t[1]=o):o=t[1],o}return null}function ft(){const e=G.c(42),t=re(),i=Ve(),n=t.length>0;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=Re(nt),e[0]=o):o=e[0];let d;e[1]!==i?(d={resolver:o,values:i,mode:"onChange"},e[1]=i,e[2]=d):d=e[2];const r=Te(d),{mutate:l,isPending:m,isSuccess:b}=Qe(),h=r.formState.isDirty;let f;e[3]!==r||e[4]!==i||e[5]!==l?(f={delayMs:250,save:async()=>{const u=r.getValues();l(u,{onSuccess:()=>r.reset(u,{keepValues:!0}),onError:E=>{r.reset(i),Z.error(`Failed to save: ${E.message}`)}})}},e[3]=r,e[4]=i,e[5]=l,e[6]=f):f=e[6];const{schedule:c}=Je(f),g=t[0],C=t[1],p=t[2],{models:v}=ce(g?.id),{models:j}=ce(C?.id),{models:x}=ce(p?.id);let _,I;e[7]!==r||e[8]!==n?(_=()=>{n||r.reset({tiers:{fast:null,smart:null,thinking:null,image:null,web_research:null}})},I=[n,r],e[7]=r,e[8]=n,e[9]=_,e[10]=I):(_=e[9],I=e[10]),O.useEffect(_,I);let y;e[11]!==t||e[12]!==r||e[13]!==g||e[14]!==C||e[15]!==p||e[16]!==v||e[17]!==j||e[18]!==x?(y=()=>{const u=r.getValues(),E=new Set(t.map(pt)),D={};g?.id&&(D[g.id]=v),C?.id&&(D[C.id]=j),p?.id&&(D[p.id]=x);const F=z=>z!=null&&!E.has(z.keyId),k={fast:F(u.tiers.fast)?null:u.tiers.fast,smart:F(u.tiers.smart)?null:u.tiers.smart,thinking:F(u.tiers.thinking)?null:u.tiers.thinking,image:F(u.tiers.image)?null:u.tiers.image,web_research:F(u.tiers.web_research)?null:u.tiers.web_research},R=!k.fast||!k.smart||!k.thinking||!k.image||!k.web_research,T=k.fast===u.tiers.fast&&k.smart===u.tiers.smart&&k.thinking===u.tiers.thinking&&k.image===u.tiers.image&&k.web_research===u.tiers.web_research;if(!R&&T)return;const $=Ge(t,D);r.reset({tiers:{fast:k.fast??$.chat.fast,smart:k.smart??$.chat.smart,thinking:k.thinking??$.chat.thinking,image:k.image??$.image,web_research:k.web_research??$.webResearch}},{keepDirty:!0})},e[11]=t,e[12]=r,e[13]=g,e[14]=C,e[15]=p,e[16]=v,e[17]=j,e[18]=x,e[19]=y):y=e[19];const S=g?.id,a=C?.id,N=p?.id;let L;e[20]!==t||e[21]!==r||e[22]!==v||e[23]!==j||e[24]!==x||e[25]!==S||e[26]!==a||e[27]!==N?(L=[r,t,v,j,x,S,a,N],e[20]=t,e[21]=r,e[22]=v,e[23]=j,e[24]=x,e[25]=S,e[26]=a,e[27]=N,e[28]=L):L=e[28],O.useEffect(y,L);let q;e[29]===Symbol.for("react.memo_cache_sentinel")?(q=s.jsx("p",{className:"text-sm text-muted-foreground",children:"These models power chat, automations, and tools across your organization."}),e[29]=q):q=e[29];const V=b&&!h;let P;e[30]!==m||e[31]!==V?(P=s.jsxs("div",{className:"flex items-center justify-between -mt-2 mb-2",children:[q,s.jsx(ut,{isPending:m,showSaved:V})]}),e[30]=m,e[31]=V,e[32]=P):P=e[32];let A;e[33]!==t[0]?.id||e[34]!==r.control||e[35]!==c?(A=dt.map(u=>s.jsx(Oe,{control:r.control,name:`tiers.${u.key}`,render:E=>{const{field:D}=E;return s.jsx(we,{title:u.label,description:u.description,action:s.jsx(mt,{slot:D.value,defaultKeyId:t[0]?.id??null,filterModels:u.filter,onSlotChange:F=>{D.onChange(F),c()}})})}},u.key)),e[33]=t[0]?.id,e[34]=r.control,e[35]=c,e[36]=A):A=e[36];let K;e[37]!==A?(K=s.jsx(xe,{children:A}),e[37]=A,e[38]=K):K=e[38];let M;return e[39]!==P||e[40]!==K?(M=s.jsxs(be,{title:"Default models",headerClassName:"pl-0",children:[P,K]}),e[39]=P,e[40]=K,e[41]=M):M=e[41],M}function pt(e){return e.id}const gt={usd:[10,20,100],brl:[50,100,500]};function ht(){const e=G.c(29),{org:t}=de();let i;e[0]!==t.id||e[1]!==t.slug?(i={connectionId:me,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=i):i=e[2];const n=ue(i),[o,d]=O.useState(!1),{mutate:r,isPending:l}=oe({mutationFn:async a=>{const N=await n.callTool({name:"AI_PROVIDER_TOPUP_URL",arguments:{providerId:"deco",amountCents:a,currency:c}});if(N?.isError)throw new Error(N.content?.[0]?.text??"Failed to get top-up URL");return N.structuredContent?.url},onSuccess:bt,onError:xt}),[m,b]=O.useState(""),[h,f]=O.useState("usd"),c=h,g=parseFloat(m),C=!isNaN(g)&&g>=1,p=c==="brl"?"R$":"$";let v;e[3]!==f?(v=a=>{a&&f(a)},e[3]=f,e[4]=v):v=e[4];let j,x;e[5]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(_e,{value:"usd",className:"px-3.5 text-sm",children:"USD"}),x=s.jsx(_e,{value:"brl",className:"px-3.5 text-sm",children:"BRL"}),e[5]=j,e[6]=x):(j=e[5],x=e[6]);let _;e[7]!==c||e[8]!==v?(_=s.jsxs(Xe,{type:"single",variant:"outline",size:"default",value:c,onValueChange:v,children:[j,x]}),e[7]=c,e[8]=v,e[9]=_):_=e[9];let I;e[10]!==c||e[11]!==p||e[12]!==o||e[13]!==l||e[14]!==r?(I=!o&&s.jsxs(s.Fragment,{children:[gt[c].map(a=>s.jsxs(Y,{variant:"outline",className:"h-10 px-4 text-sm font-medium tabular-nums",disabled:l,onClick:()=>r(a*100),children:[p,a]},a)),s.jsx(Y,{variant:"ghost",className:"h-10 px-4 text-sm text-muted-foreground",onClick:()=>d(!0),disabled:l,children:"Custom"})]}),e[10]=c,e[11]=p,e[12]=o,e[13]=l,e[14]=r,e[15]=I):I=e[15];let y;e[16]!==p||e[17]!==m||e[18]!==g||e[19]!==o||e[20]!==C||e[21]!==l||e[22]!==b||e[23]!==r?(y=o&&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:p}),s.jsx(Ze,{type:"number",min:"1",step:"1",placeholder:"50",value:m,onChange:a=>b(a.target.value),className:"h-10 text-sm pl-7",autoFocus:!0})]}),s.jsx(Y,{className:"h-10",disabled:!C||l,onClick:()=>r(Math.round(g*100)),children:l?"...":"Add"}),s.jsx(Y,{variant:"ghost",className:"h-10 text-sm text-muted-foreground",onClick:()=>{d(!1),b("")},children:"Cancel"})]}),e[16]=p,e[17]=m,e[18]=g,e[19]=o,e[20]=C,e[21]=l,e[22]=b,e[23]=r,e[24]=y):y=e[24];let S;return e[25]!==_||e[26]!==I||e[27]!==y?(S=s.jsx("div",{className:"flex flex-col gap-2.5",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[_,I,y]})}),e[25]=_,e[26]=I,e[27]=y,e[28]=S):S=e[28],S}function xt(e){Z.error(`Top-up failed: ${e.message}`)}function bt(e){e&&window.open(e,"_blank","noopener,noreferrer")}function yt(e){return e<=0?"text-destructive":e<=1?"text-amber-500 dark:text-amber-400":"text-foreground"}function vt(){const e=G.c(61),{org:t}=de();let i;e[0]!==t.id||e[1]!==t.slug?(i={connectionId:me,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=i):i=e[2];const n=ue(i),o=ge(),d=re();let r;e[3]!==d?(r=d.find(_t),e[3]=d,e[4]=r):r=e[4];const l=r,[m,b]=O.useState(!1);let h;e[5]!==n||e[6]!==l?(h=async()=>{l&&await n.callTool({name:"AI_PROVIDER_KEY_DELETE",arguments:{keyId:l.id}})},e[5]=n,e[6]=l,e[7]=h):h=e[7];let f;e[8]!==t.id||e[9]!==o?(f=()=>{o.invalidateQueries({queryKey:J.aiProviderKeys(t.id)}),o.invalidateQueries({queryKey:J.aiProviders(t.id)}),Z.success("Deco AI Gateway disconnected"),b(!1)},e[8]=t.id,e[9]=o,e[10]=f):f=e[10];let c;e[11]!==h||e[12]!==f?(c={mutationFn:h,onSuccess:f,onError:jt},e[11]=h,e[12]=f,e[13]=c):c=e[13];const{mutate:g,isPending:C}=oe(c);let p;e[14]!==t.id?(p=J.aiProviderCredits(t.id,"deco"),e[14]=t.id,e[15]=p):p=e[15];const v=!!l;let j;e[16]!==n?(j=async()=>{const X=await n.callTool({name:"AI_PROVIDER_CREDITS",arguments:{providerId:"deco"}});return X?.isError?null:X.structuredContent??null},e[16]=n,e[17]=j):j=e[17];let x;e[18]!==p||e[19]!==v||e[20]!==j?(x={queryKey:p,enabled:v,staleTime:6e4,queryFn:j},e[18]=p,e[19]=v,e[20]=j,e[21]=x):x=e[21];const{data:_,isLoading:I,refetch:y,isFetching:S}=ze(x);if(!l)return null;const a=_?.balanceCents!=null?_.balanceCents/100:null;let N;e[22]!==a?(N=a!=null?`$${a.toFixed(2)}`:"—",e[22]=a,e[23]=N):N=e[23];const L=N;let q;e[24]===Symbol.for("react.memo_cache_sentinel")?(q=s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"Deco AI Gateway",className:"size-9 rounded-lg object-contain dark:bg-white dark:p-0.5"}),s.jsx("div",{children:s.jsx("p",{className:"text-xs text-muted-foreground",children:"Access to 100+ models"})})]}),e[24]=q):q=e[24];let V;e[25]===Symbol.for("react.memo_cache_sentinel")?(V=()=>b(!0),e[25]=V):V=e[25];let P;e[26]!==C?(P=s.jsxs("div",{className:"flex items-center justify-between",children:[q,s.jsx(Y,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground hover:text-destructive",onClick:V,disabled:C,children:"Disconnect"})]}),e[26]=C,e[27]=P):P=e[27];let A;e[28]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsxs(Pe,{children:[s.jsx(Ae,{children:"Disconnect Deco AI Gateway"}),s.jsx(De,{children:"This will remove the Deco AI Gateway from this workspace. Your credit balance is preserved and will be available if you reconnect."})]}),e[28]=A):A=e[28];let K;e[29]===Symbol.for("react.memo_cache_sentinel")?(K=s.jsx(Ee,{children:"Cancel"}),e[29]=K):K=e[29];let M;e[30]!==g?(M=s.jsxs(Ke,{children:[A,s.jsxs(Fe,{children:[K,s.jsx($e,{onClick:()=>g(),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Disconnect"})]})]}),e[30]=g,e[31]=M):M=e[31];let u;e[32]!==m||e[33]!==M?(u=s.jsx(Me,{open:m,onOpenChange:b,children:M}),e[32]=m,e[33]=M,e[34]=u):u=e[34];let E;e[35]!==a||e[36]!==L||e[37]!==S||e[38]!==I?(E=I||S?s.jsx(he,{className:"h-9 w-24"}):s.jsx("span",{className:ve("text-3xl font-semibold tabular-nums tracking-tight",a!=null&&yt(a)),children:L}),e[35]=a,e[36]=L,e[37]=S,e[38]=I,e[39]=E):E=e[39];let D;e[40]!==y?(D=()=>y(),e[40]=y,e[41]=D):D=e[41];const F=S&&"animate-spin";let k;e[42]!==F?(k=ve(F),e[42]=F,e[43]=k):k=e[43];let R;e[44]!==k?(R=s.jsx(ke,{size:14,className:k}),e[44]=k,e[45]=R):R=e[45];let T;e[46]!==S||e[47]!==D||e[48]!==R?(T=s.jsx("button",{type:"button",onClick:D,disabled:S,className:"text-muted-foreground hover:text-foreground disabled:opacity-50 transition-colors p-1 rounded-md hover:bg-muted/50","aria-label":"Refresh balance",children:R}),e[46]=S,e[47]=D,e[48]=R,e[49]=T):T=e[49];let $;e[50]!==E||e[51]!==T?($=s.jsxs("div",{className:"flex items-baseline gap-2",children:[E,T]}),e[50]=E,e[51]=T,e[52]=$):$=e[52];let z;e[53]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsx("p",{className:"text-xs text-muted-foreground",children:"Available credit balance"}),e[53]=z):z=e[53];let U;e[54]!==$?(U=s.jsxs("div",{className:"flex flex-col gap-2 pt-2",children:[$,z]}),e[54]=$,e[55]=U):U=e[55];let H;e[56]===Symbol.for("react.memo_cache_sentinel")?(H=s.jsxs("div",{className:"pt-4 border-t border-border/60",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-2.5",children:"Add credits"}),s.jsx(ht,{})]}),e[56]=H):H=e[56];let Q;return e[57]!==P||e[58]!==u||e[59]!==U?(Q=s.jsx(be,{title:"Deco AI Gateway",children:s.jsx(xe,{children:s.jsxs("div",{className:"px-5 py-5 flex flex-col gap-5",children:[P,u,U,H]})})}),e[57]=P,e[58]=u,e[59]=U,e[60]=Q):Q=e[60],Q}function jt(e){Z.error(`Failed to disconnect: ${e.message}`)}function _t(e){return e.providerId==="deco"}function It(){const e=G.c(11),{org:t}=de();let i;e[0]!==t.id||e[1]!==t.slug?(i={connectionId:me,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=i):i=e[2];const n=ue(i),o=ge();let d;e[3]!==n?(d=async()=>{const m=await n.callTool({name:"AI_PROVIDER_PROVISION_KEY",arguments:{providerId:"deco"}});if(m?.isError)throw new Error(m.content?.[0]?.text??"Key provisioning failed")},e[3]=n,e[4]=d):d=e[4];let r;e[5]!==t.id||e[6]!==o?(r=()=>{Ce("ai_provider_provision_succeeded",{provider_id:"deco"}),o.invalidateQueries({queryKey:J.aiProviderKeys(t.id)}),o.invalidateQueries({queryKey:J.aiProviders(t.id)}),Z.success("Deco AI Gateway connected successfully")},e[5]=t.id,e[6]=o,e[7]=r):r=e[7];let l;return e[8]!==d||e[9]!==r?(l={mutationFn:d,onSuccess:r,onError:St},e[8]=d,e[9]=r,e[10]=l):l=e[10],oe(l)}function St(e){Ce("ai_provider_provision_failed",{provider_id:"deco",error:e.message}),Z.error(`Failed to connect Deco AI Gateway: ${e.message}`)}function kt(){const e=G.c(10),{mutate:t,isPending:i}=It();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=["radial-gradient(ellipse 50% 150% at -15% 50%, rgba(165,149,255,0.14) 0%, transparent 60%)","radial-gradient(ellipse 50% 150% at 115% 50%, rgba(208,236,26,0.11) 0%, transparent 60%)"],e[0]=n):n=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{backgroundImage:n.join(", ")}}),e[1]=o):o=e[1];let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"Deco AI Gateway",className:"size-12 shrink-0 rounded-xl object-contain dark:bg-white dark:p-1"}),e[2]=d):d=e[2];let r;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[s.jsx("p",{className:"text-base font-semibold",children:"Deco AI Gateway"}),s.jsx("span",{className:"rounded-full border border-border/60 bg-background/60 px-2 py-0.5 text-[10px] font-medium text-muted-foreground",children:"Recommended"})]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"100+ models, one connection — pay as you go, no API keys to juggle."})]}),e[3]=r):r=e[3];let l;e[4]!==t?(l=()=>t(),e[4]=t,e[5]=l):l=e[5];const m=i?"Connecting…":"Connect Deco";let b;return e[6]!==i||e[7]!==l||e[8]!==m?(b=s.jsxs("div",{className:"relative rounded-xl border border-border overflow-hidden",children:[o,s.jsxs("div",{className:"relative flex items-center gap-5 px-6 py-5",children:[d,r,s.jsx(Y,{variant:"outline",disabled:i,onClick:l,children:m})]})]}),e[6]=i,e[7]=l,e[8]=m,e[9]=b):b=e[9],b}function Ct(e){const t=G.c(70),{providerKey:i,provider:n}=e,{org:o}=de();let d;t[0]!==o.id||t[1]!==o.slug?(d={connectionId:me,orgId:o.id,orgSlug:o.slug},t[0]=o.id,t[1]=o.slug,t[2]=d):d=t[2];const r=ue(d),l=ge(),[m,b]=O.useState(!1),[h,f]=O.useState(!1),[c,g]=O.useState(i.label);let C;t[3]!==n.supportedMethods?(C=n.supportedMethods.includes("cli-activate"),t[3]=n.supportedMethods,t[4]=C):C=t[4];const p=C,v=n.id==="openai-compatible";let j;t[5]!==v||t[6]!==i.presetId?(j=v&&i.presetId?We.find(B=>B.id===i.presetId):void 0,t[5]=v,t[6]=i.presetId,t[7]=j):j=t[7];const x=j,_=x?x.name:v?"Custom OpenAI-compatible":n.name,I=x?.logo??n.logo;let y;e:{if(p){y="Authenticated via CLI";break e}if(v){y=i.label;break e}const B=i.label;let ne;t[8]!==i.createdAt?(ne=lt(new Date(i.createdAt)),t[8]=i.createdAt,t[9]=ne):ne=t[9],y=`${B} · added ${ne} ago`}const S=y;let a;t[10]!==r||t[11]!==i.id?(a=async B=>{await r.callTool({name:"AI_PROVIDER_KEY_UPDATE",arguments:{keyId:i.id,label:B}})},t[10]=r,t[11]=i.id,t[12]=a):a=t[12];let N;t[13]!==o.id||t[14]!==l?(N=()=>{l.invalidateQueries({queryKey:J.aiProviderKeys(o.id)}),f(!1)},t[13]=o.id,t[14]=l,t[15]=N):N=t[15];let L;t[16]!==a||t[17]!==N?(L={mutationFn:a,onSuccess:N,onError:Nt},t[16]=a,t[17]=N,t[18]=L):L=t[18];const{mutate:q,isPending:V}=oe(L);let P;t[19]!==r||t[20]!==i.id?(P=async()=>{await r.callTool({name:"AI_PROVIDER_KEY_DELETE",arguments:{keyId:i.id}})},t[19]=r,t[20]=i.id,t[21]=P):P=t[21];let A;t[22]!==o.id||t[23]!==i.id||t[24]!==l?(A=()=>{l.invalidateQueries({queryKey:J.aiProviderKeys(o.id)}),l.invalidateQueries({queryKey:J.aiProviders(o.id)}),l.invalidateQueries({queryKey:J.aiProviderModels(o.id,i.id)}),Z.success("Key deleted"),b(!1)},t[22]=o.id,t[23]=i.id,t[24]=l,t[25]=A):A=t[25];let K;t[26]!==P||t[27]!==A?(K={mutationFn:P,onSuccess:A,onError:wt},t[26]=P,t[27]=A,t[28]=K):K=t[28];const{mutate:M,isPending:u}=oe(K);let E;t[29]!==i.label?(E=()=>{g(i.label),f(!0)},t[29]=i.label,t[30]=E):E=t[30];const D=E;let F;t[31]!==c||t[32]!==q?(F=()=>{const B=c.trim();B&&q(B)},t[31]=c,t[32]=q,t[33]=F):F=t[33];const k=F;let R;t[34]!==_||t[35]!==I?(R=I?s.jsx("img",{src:I,alt:_,className:"size-8 rounded-md object-contain dark:bg-white dark:p-0.5"}):s.jsx(rt,{fallback:_.charAt(0),className:"size-8 bg-primary/10 text-primary"}),t[34]=_,t[35]=I,t[36]=R):R=t[36];let T;t[37]!==_||t[38]!==c||t[39]!==h||t[40]!==k?(T=h?s.jsx("input",{autoFocus:!0,className:"font-medium bg-transparent border-b border-border outline-none w-full",value:c,onChange:B=>g(B.target.value),onKeyDown:B=>{B.key==="Enter"&&k(),B.key==="Escape"&&f(!1)}}):_,t[37]=_,t[38]=c,t[39]=h,t[40]=k,t[41]=T):T=t[41];const $=h?null:S;let z;t[42]!==c||t[43]!==h||t[44]!==p||t[45]!==u||t[46]!==V||t[47]!==D||t[48]!==k?(z=s.jsx("div",{className:"flex items-center gap-0.5",children:h?s.jsxs(s.Fragment,{children:[s.jsx(Y,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-foreground",disabled:V||!c.trim(),onClick:k,children:s.jsx(tt,{size:14})}),s.jsx(Y,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:()=>f(!1),children:s.jsx(ot,{size:14})})]}):s.jsxs(s.Fragment,{children:[!p&&s.jsx(Y,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:D,children:s.jsx(st,{size:14})}),s.jsx(Y,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",disabled:u,onClick:()=>b(!0),children:s.jsx(it,{size:14})})]})}),t[42]=c,t[43]=h,t[44]=p,t[45]=u,t[46]=V,t[47]=D,t[48]=k,t[49]=z):z=t[49];let U;t[50]!==R||t[51]!==T||t[52]!==$||t[53]!==z?(U=s.jsx(we,{icon:R,title:T,description:$,action:z}),t[50]=R,t[51]=T,t[52]=$,t[53]=z,t[54]=U):U=t[54];let H;t[55]===Symbol.for("react.memo_cache_sentinel")?(H=s.jsx(Ae,{children:"Delete API Key"}),t[55]=H):H=t[55];let Q;t[56]!==i.label?(Q=s.jsxs(Pe,{children:[H,s.jsxs(De,{children:["This action cannot be undone. This will permanently delete"," ",s.jsx("span",{className:"font-medium text-foreground",children:i.label}),"."]})]}),t[56]=i.label,t[57]=Q):Q=t[57];let X;t[58]===Symbol.for("react.memo_cache_sentinel")?(X=s.jsx(Ee,{children:"Cancel"}),t[58]=X):X=t[58];let ee;t[59]!==M?(ee=s.jsxs(Fe,{children:[X,s.jsx($e,{onClick:()=>M(),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),t[59]=M,t[60]=ee):ee=t[60];let te;t[61]!==Q||t[62]!==ee?(te=s.jsxs(Ke,{children:[Q,ee]}),t[61]=Q,t[62]=ee,t[63]=te):te=t[63];let se;t[64]!==m||t[65]!==te?(se=s.jsx(Me,{open:m,onOpenChange:b,children:te}),t[64]=m,t[65]=te,t[66]=se):se=t[66];let le;return t[67]!==U||t[68]!==se?(le=s.jsxs(s.Fragment,{children:[U,se]}),t[67]=U,t[68]=se,t[69]=le):le=t[69],le}function wt(e){return Z.error(`Failed to delete key: ${e.message}`)}function Nt(){return Z.error("Failed to update key label")}function Pt(e){const t=G.c(11),{onConnectClick:i}=e,n=re(),o=Ne();let d;t[0]!==o?.providers?(d=o?.providers??[],t[0]=o?.providers,t[1]=d):d=t[1];const r=d;let l;if(t[2]!==n||t[3]!==i||t[4]!==r){let m;t[6]!==r?(m=c=>({key:c,provider:r.find(g=>g.id===c.providerId)}),t[6]=r,t[7]=m):m=t[7];const b=n.filter(Et).map(m).filter(Dt);let h;t[8]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(et,{size:14}),t[8]=h):h=t[8];let f;t[9]!==i?(f=s.jsxs(Y,{size:"sm",onClick:i,children:[h,"Connect provider"]}),t[9]=i,t[10]=f):f=t[10],l=s.jsx(be,{title:"Connected providers",headerClassName:"px-0",actions:f,children:b.length===0?s.jsx("p",{className:"text-sm text-muted-foreground px-1",children:"Bring your own keys to use specific models alongside Deco's gateway."}):s.jsx(xe,{children:b.map(At)})}),t[2]=n,t[3]=i,t[4]=r,t[5]=l}else l=t[5];return l}function At(e){const{key:t,provider:i}=e;return s.jsx(Ct,{providerKey:t,provider:i},t.id)}function Dt(e){return e.provider!==void 0}function Et(e){return e.providerId!=="deco"}function Kt(e){const t=G.c(3),{error:i}=e;let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(qe,{size:16}),t[0]=n):n=t[0];let o;return t[1]!==i.message?(o=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[n,s.jsxs("span",{className:"text-sm font-medium",children:["Failed to load AI providers: ",i.message]})]}),t[1]=i.message,t[2]=o):o=t[2],o}function Ft(){const e=G.c(23),t=re();let i;e[0]!==t?(i=t.some($t),e[0]=t,e[1]=i):i=e[1];const n=i,o=t.length>0,[d,r]=O.useState(!1),[l,m]=O.useState(null),b=Ne();let h;e[2]!==b?.providers?(h=b?.providers??[],e[2]=b?.providers,e[3]=h):h=e[3];const f=h;if(!o){let j;e[4]===Symbol.for("react.memo_cache_sentinel")?(j=()=>r(!0),e[4]=j):j=e[4];let x;e[5]!==f?(x=s.jsx(He,{providers:f,onSelect:m,onShowAll:j}),e[5]=f,e[6]=x):x=e[6];const _=l!==null||d;let I;e[7]===Symbol.for("react.memo_cache_sentinel")?(I=N=>{N||(m(null),r(!1))},e[7]=I):I=e[7];const y=l??void 0;let S;e[8]!==_||e[9]!==y?(S=s.jsx(je,{open:_,onOpenChange:I,initialProvider:y}),e[8]=_,e[9]=y,e[10]=S):S=e[10];let a;return e[11]!==x||e[12]!==S?(a=s.jsxs(s.Fragment,{children:[x,S]}),e[11]=x,e[12]=S,e[13]=a):a=e[13],a}let c;e[14]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(O.Suspense,{fallback:s.jsx(he,{className:"h-16 w-full"}),children:s.jsx(ft,{})}),e[14]=c):c=e[14];let g;e[15]!==n?(g=n?s.jsx(vt,{}):s.jsx(kt,{}),e[15]=n,e[16]=g):g=e[16];let C;e[17]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(Pt,{onConnectClick:()=>r(!0)}),e[17]=C):C=e[17];let p;e[18]!==d?(p=s.jsx(je,{open:d,onOpenChange:r}),e[18]=d,e[19]=p):p=e[19];let v;return e[20]!==g||e[21]!==p?(v=s.jsxs(s.Fragment,{children:[c,g,C,p]}),e[20]=g,e[21]=p,e[22]=v):v=e[22],v}function $t(e){return e.providerId==="deco"}function Mt(){const e=G.c(2);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(ae.Title,{children:"AI Providers"}),e[0]=t):t=e[0];let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(ae,{children:s.jsx(ae.Content,{children:s.jsx(ae.Body,{children:s.jsxs(Ue,{children:[t,s.jsx(Le,{fallback:Rt,children:s.jsx(O.Suspense,{fallback:s.jsx(he,{className:"h-64 w-full"}),children:s.jsx(Ft,{})})})]})})})}),e[1]=i):i=e[1],i}function Rt(e){const{error:t}=e;return s.jsx(Kt,{error:t??new Error("Failed to load AI providers")})}function Es(){const e=G.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(Mt,{}),e[0]=t):t=e[0],t}export{Es as default};
1
+ import{H as W,J as w,aJ as pe,aH as fe,aZ as Ie,ap as Se,aI as ye,e as G,D as Re,z as Te,r as O,j as s,C as Oe,x as Z,M as ke,s as de,o as ge,a as oe,K as J,n as ze,c as ve,B as Y,t as Ce,E as Le}from"./index-B3N0ijMe.js";import{i as qe}from"./AlertCircle-CUtXIfwC.js";import{P as ae}from"./index-Bn0UKgPw.js";import{S as he}from"./skeleton-DMpf-C3P.js";import{b as we,a as xe,S as be,d as Ue}from"./settings-section-BXgkeIdc.js";import{u as re,a as ce,b as Ne}from"./use-ai-providers-D1Gd_B23.js";import{i as Be}from"./CheckCircle-C3sPsdSO.js";import{p as Ge}from"./chat-context-CZtWWj-u.js";import{e as Ve,f as Qe}from"./use-organization-settings-CNcnwjVj.js";import{M as Ye,O as We,P as He,C as je}from"./select-model-CTQ1Ef9H.js";import{u as Je}from"./use-debounced-autosave-CHZpR2fH.js";import{I as Ze}from"./input-t1YlgH6I.js";import{a as _e,T as Xe}from"./toggle-group-BrCYmglG.js";import{b as Pe,c as Ae,d as De,f as Ee,a as Ke,e as Fe,g as $e,A as Me}from"./alert-dialog-BTkTE2x9.js";import{S as me,u as ue}from"./constants-CmcFrIt1.js";import{s as et}from"./Plus-D1tHeJo2.js";import{i as tt}from"./Check-Ccw422Wb.js";import{i as st}from"./Tool01-DmFqON6q.js";import{s as it}from"./Trash01-IeycYlZQ.js";import{i as ot}from"./X-C63lgCLS.js";import{A as rt}from"./avatar-Bb8VCoXQ.js";import{f as lt}from"./formatDistanceToNow-Cb2QZZJn.js";import"./sidebar-DC8b4t6M.js";import"./LayoutLeft-BuJA8_jK.js";import"./tooltip-D_KYUaTY.js";import"./card-Bl-Rmbpi.js";import"./ArrowUpRight-BrfnA0N_.js";import"./use-virtual-mcp-fhETXyqA.js";import"./use-collections-Cqjc7P8G.js";import"./use-decopilot-events-C4C_kTbf.js";import"./create-sse-subscription-CxkOgzKf.js";import"./use-tasks-BGvJcXek.js";import"./checkbox-B4-n2Voa.js";import"./dialog-C8PiJXDq.js";import"./drawer-SuAP4nw3.js";import"./select-C6LJ-qZk.js";import"./ChevronDown-cpZNJlz9.js";import"./ChevronUp-C-rBrlqd.js";import"./RefreshCcw01-BESGm5a8.js";import"./SearchMd-eCR8N7AG.js";import"./Settings02-xGJb-3cc.js";import"./ai-providers-logos-DD3qZ33J.js";import"./Zap-N-AnbCTG.js";import"./spinner-BN00SFRY.js";import"./ChevronRight-CeUhrzuf.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./User01-CnizOinw.js";import"./differenceInSeconds-NQ4PDo0z.js";W({title:w(),url:w(),icon:w()});W({registries:fe(w(),W({enabled:Ie()})).describe("Per-registry enabled/disabled state. Key is connection ID. Absent registries are treated as enabled."),blockedMcps:pe(w()).describe("List of MCP app_name or app_id values to hide from the store.")});const ie=W({keyId:w(),modelId:w(),title:w().optional()}).nullable();Se(["fast","smart","thinking","image","web_research"]);Se(["fast","smart","thinking"]);const nt=W({tiers:W({fast:ie,smart:ie,thinking:ie,image:ie,web_research:ie})});W({ids:pe(w()).describe("Ordered list of agent ids to show on the home view. Mix of well-known template ids and custom virtual MCP ids.")});W({id:w().describe("Brand context ID"),name:w().describe("Company name"),domain:w().describe("Company domain (e.g. example.com)"),overview:w().describe("Company overview / description"),logo:w().nullable().optional().describe("Logo URL"),favicon:w().nullable().optional().describe("Favicon URL"),ogImage:w().nullable().optional().describe("OG image URL"),fonts:W({heading:w().optional().describe("Font family for headings"),body:w().optional().describe("Font family for body text"),code:w().optional().describe("Font family for code / monospace")}).nullable().optional().describe("Font families by semantic role"),colors:W({primary:w().optional().describe("Primary brand color (hex)"),secondary:w().optional().describe("Secondary brand color (hex)"),accent:w().optional().describe("Accent / highlight color (hex)"),background:w().optional().describe("Background color (hex)"),foreground:w().optional().describe("Foreground / text color (hex)")}).nullable().optional().describe("Semantic color palette"),images:pe(fe(w(),ye())).nullable().optional().describe("Brand images"),metadata:fe(w(),ye()).nullable().optional().describe("Extra design tokens (typography, components, spacing, layout, tone, etc.)"),archivedAt:w().nullable().optional().describe("Archive timestamp (null to unarchive)"),isDefault:Ie().optional().describe("Whether this is the default brand for the organization")});const at=e=>e.capabilities?.includes("image")===!0,ct=e=>{if(e.asyncResearch===!0)return!0;const t=e.modelId.toLowerCase().replace(/[^a-z0-9]/g,"");return t.includes("sonar")||t.includes("deepresearch")},dt=[{key:"fast",label:"Fast",description:"Fastest responses, best for quick tasks",filter:void 0},{key:"smart",label:"Smart",description:"Balanced speed and capability",filter:void 0},{key:"thinking",label:"Thinking",description:"Most capable, best for complex tasks",filter:void 0},{key:"image",label:"Image",description:"Image generation",filter:at},{key:"web_research",label:"Web research",description:"Web search and deep research",filter:ct}];function mt(e){const t=G.c(20),{slot:i,onSlotChange:n,filterModels:o,defaultKeyId:d}=e,r=re(),[l,m]=O.useState(i?.keyId??d);let b;t[0]!==i?(b=()=>{i?.keyId&&m(i.keyId)},t[0]=i,t[1]=b):b=t[1];const h=i?.keyId;let f;t[2]!==h?(f=[h],t[2]=h,t[3]=f):f=t[3],O.useEffect(b,f);const c=l??d;let g;t[4]!==c||t[5]!==r?(g=c?r.find(a=>a.id===c):null,t[4]=c,t[5]=r,t[6]=g):g=t[6];const C=g,{models:p,isLoading:v}=ce(o?c??void 0:void 0),j=o?v||p.some(o):!0;let x;t[7]!==i||t[8]!==C?.providerId?(x=i?{modelId:i.modelId,title:i.title??i.modelId,keyId:i.keyId,providerId:C?.providerId??"deco",description:null,logo:null,capabilities:[],limits:null,costs:null}:null,t[7]=i,t[8]=C?.providerId,t[9]=x):x=t[9];const _=x;if(o&&!j){let a;return t[10]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("p",{className:"text-xs text-muted-foreground italic",children:"Not available with current provider"}),t[10]=a):a=t[10],a}let I;t[11]===Symbol.for("react.memo_cache_sentinel")?(I=a=>m(a),t[11]=I):I=t[11];let y;t[12]!==c||t[13]!==n?(y=a=>{const N=a.keyId??c??"";m(N),n({keyId:N,modelId:a.modelId,title:a.title})},t[12]=c,t[13]=n,t[14]=y):y=t[14];let S;return t[15]!==c||t[16]!==o||t[17]!==_||t[18]!==y?(S=s.jsx(Ye,{variant:"bordered",placeholder:"Pick model",model:_,credentialId:c,filterModels:o,onCredentialChange:I,onModelChange:y}),t[15]=c,t[16]=o,t[17]=_,t[18]=y,t[19]=S):S=t[19],S}function ut(e){const t=G.c(2),{isPending:i,showSaved:n}=e;if(i){let o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[s.jsx(ke,{size:12,className:"animate-spin"}),"Saving…"]}),t[0]=o):o=t[0],o}if(n){let o;return t[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[s.jsx(Be,{size:12}),"Saved"]}),t[1]=o):o=t[1],o}return null}function ft(){const e=G.c(42),t=re(),i=Ve(),n=t.length>0;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=Re(nt),e[0]=o):o=e[0];let d;e[1]!==i?(d={resolver:o,values:i,mode:"onChange"},e[1]=i,e[2]=d):d=e[2];const r=Te(d),{mutate:l,isPending:m,isSuccess:b}=Qe(),h=r.formState.isDirty;let f;e[3]!==r||e[4]!==i||e[5]!==l?(f={delayMs:250,save:async()=>{const u=r.getValues();l(u,{onSuccess:()=>r.reset(u,{keepValues:!0}),onError:E=>{r.reset(i),Z.error(`Failed to save: ${E.message}`)}})}},e[3]=r,e[4]=i,e[5]=l,e[6]=f):f=e[6];const{schedule:c}=Je(f),g=t[0],C=t[1],p=t[2],{models:v}=ce(g?.id),{models:j}=ce(C?.id),{models:x}=ce(p?.id);let _,I;e[7]!==r||e[8]!==n?(_=()=>{n||r.reset({tiers:{fast:null,smart:null,thinking:null,image:null,web_research:null}})},I=[n,r],e[7]=r,e[8]=n,e[9]=_,e[10]=I):(_=e[9],I=e[10]),O.useEffect(_,I);let y;e[11]!==t||e[12]!==r||e[13]!==g||e[14]!==C||e[15]!==p||e[16]!==v||e[17]!==j||e[18]!==x?(y=()=>{const u=r.getValues(),E=new Set(t.map(pt)),D={};g?.id&&(D[g.id]=v),C?.id&&(D[C.id]=j),p?.id&&(D[p.id]=x);const F=z=>z!=null&&!E.has(z.keyId),k={fast:F(u.tiers.fast)?null:u.tiers.fast,smart:F(u.tiers.smart)?null:u.tiers.smart,thinking:F(u.tiers.thinking)?null:u.tiers.thinking,image:F(u.tiers.image)?null:u.tiers.image,web_research:F(u.tiers.web_research)?null:u.tiers.web_research},R=!k.fast||!k.smart||!k.thinking||!k.image||!k.web_research,T=k.fast===u.tiers.fast&&k.smart===u.tiers.smart&&k.thinking===u.tiers.thinking&&k.image===u.tiers.image&&k.web_research===u.tiers.web_research;if(!R&&T)return;const $=Ge(t,D);r.reset({tiers:{fast:k.fast??$.chat.fast,smart:k.smart??$.chat.smart,thinking:k.thinking??$.chat.thinking,image:k.image??$.image,web_research:k.web_research??$.webResearch}},{keepDirty:!0})},e[11]=t,e[12]=r,e[13]=g,e[14]=C,e[15]=p,e[16]=v,e[17]=j,e[18]=x,e[19]=y):y=e[19];const S=g?.id,a=C?.id,N=p?.id;let L;e[20]!==t||e[21]!==r||e[22]!==v||e[23]!==j||e[24]!==x||e[25]!==S||e[26]!==a||e[27]!==N?(L=[r,t,v,j,x,S,a,N],e[20]=t,e[21]=r,e[22]=v,e[23]=j,e[24]=x,e[25]=S,e[26]=a,e[27]=N,e[28]=L):L=e[28],O.useEffect(y,L);let q;e[29]===Symbol.for("react.memo_cache_sentinel")?(q=s.jsx("p",{className:"text-sm text-muted-foreground",children:"These models power chat, automations, and tools across your organization."}),e[29]=q):q=e[29];const V=b&&!h;let P;e[30]!==m||e[31]!==V?(P=s.jsxs("div",{className:"flex items-center justify-between -mt-2 mb-2",children:[q,s.jsx(ut,{isPending:m,showSaved:V})]}),e[30]=m,e[31]=V,e[32]=P):P=e[32];let A;e[33]!==t[0]?.id||e[34]!==r.control||e[35]!==c?(A=dt.map(u=>s.jsx(Oe,{control:r.control,name:`tiers.${u.key}`,render:E=>{const{field:D}=E;return s.jsx(we,{title:u.label,description:u.description,action:s.jsx(mt,{slot:D.value,defaultKeyId:t[0]?.id??null,filterModels:u.filter,onSlotChange:F=>{D.onChange(F),c()}})})}},u.key)),e[33]=t[0]?.id,e[34]=r.control,e[35]=c,e[36]=A):A=e[36];let K;e[37]!==A?(K=s.jsx(xe,{children:A}),e[37]=A,e[38]=K):K=e[38];let M;return e[39]!==P||e[40]!==K?(M=s.jsxs(be,{title:"Default models",headerClassName:"pl-0",children:[P,K]}),e[39]=P,e[40]=K,e[41]=M):M=e[41],M}function pt(e){return e.id}const gt={usd:[10,20,100],brl:[50,100,500]};function ht(){const e=G.c(29),{org:t}=de();let i;e[0]!==t.id||e[1]!==t.slug?(i={connectionId:me,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=i):i=e[2];const n=ue(i),[o,d]=O.useState(!1),{mutate:r,isPending:l}=oe({mutationFn:async a=>{const N=await n.callTool({name:"AI_PROVIDER_TOPUP_URL",arguments:{providerId:"deco",amountCents:a,currency:c}});if(N?.isError)throw new Error(N.content?.[0]?.text??"Failed to get top-up URL");return N.structuredContent?.url},onSuccess:bt,onError:xt}),[m,b]=O.useState(""),[h,f]=O.useState("usd"),c=h,g=parseFloat(m),C=!isNaN(g)&&g>=1,p=c==="brl"?"R$":"$";let v;e[3]!==f?(v=a=>{a&&f(a)},e[3]=f,e[4]=v):v=e[4];let j,x;e[5]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(_e,{value:"usd",className:"px-3.5 text-sm",children:"USD"}),x=s.jsx(_e,{value:"brl",className:"px-3.5 text-sm",children:"BRL"}),e[5]=j,e[6]=x):(j=e[5],x=e[6]);let _;e[7]!==c||e[8]!==v?(_=s.jsxs(Xe,{type:"single",variant:"outline",size:"default",value:c,onValueChange:v,children:[j,x]}),e[7]=c,e[8]=v,e[9]=_):_=e[9];let I;e[10]!==c||e[11]!==p||e[12]!==o||e[13]!==l||e[14]!==r?(I=!o&&s.jsxs(s.Fragment,{children:[gt[c].map(a=>s.jsxs(Y,{variant:"outline",className:"h-10 px-4 text-sm font-medium tabular-nums",disabled:l,onClick:()=>r(a*100),children:[p,a]},a)),s.jsx(Y,{variant:"ghost",className:"h-10 px-4 text-sm text-muted-foreground",onClick:()=>d(!0),disabled:l,children:"Custom"})]}),e[10]=c,e[11]=p,e[12]=o,e[13]=l,e[14]=r,e[15]=I):I=e[15];let y;e[16]!==p||e[17]!==m||e[18]!==g||e[19]!==o||e[20]!==C||e[21]!==l||e[22]!==b||e[23]!==r?(y=o&&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:p}),s.jsx(Ze,{type:"number",min:"1",step:"1",placeholder:"50",value:m,onChange:a=>b(a.target.value),className:"h-10 text-sm pl-7",autoFocus:!0})]}),s.jsx(Y,{className:"h-10",disabled:!C||l,onClick:()=>r(Math.round(g*100)),children:l?"...":"Add"}),s.jsx(Y,{variant:"ghost",className:"h-10 text-sm text-muted-foreground",onClick:()=>{d(!1),b("")},children:"Cancel"})]}),e[16]=p,e[17]=m,e[18]=g,e[19]=o,e[20]=C,e[21]=l,e[22]=b,e[23]=r,e[24]=y):y=e[24];let S;return e[25]!==_||e[26]!==I||e[27]!==y?(S=s.jsx("div",{className:"flex flex-col gap-2.5",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[_,I,y]})}),e[25]=_,e[26]=I,e[27]=y,e[28]=S):S=e[28],S}function xt(e){Z.error(`Top-up failed: ${e.message}`)}function bt(e){e&&window.open(e,"_blank","noopener,noreferrer")}function yt(e){return e<=0?"text-destructive":e<=1?"text-amber-500 dark:text-amber-400":"text-foreground"}function vt(){const e=G.c(61),{org:t}=de();let i;e[0]!==t.id||e[1]!==t.slug?(i={connectionId:me,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=i):i=e[2];const n=ue(i),o=ge(),d=re();let r;e[3]!==d?(r=d.find(_t),e[3]=d,e[4]=r):r=e[4];const l=r,[m,b]=O.useState(!1);let h;e[5]!==n||e[6]!==l?(h=async()=>{l&&await n.callTool({name:"AI_PROVIDER_KEY_DELETE",arguments:{keyId:l.id}})},e[5]=n,e[6]=l,e[7]=h):h=e[7];let f;e[8]!==t.id||e[9]!==o?(f=()=>{o.invalidateQueries({queryKey:J.aiProviderKeys(t.id)}),o.invalidateQueries({queryKey:J.aiProviders(t.id)}),Z.success("Deco AI Gateway disconnected"),b(!1)},e[8]=t.id,e[9]=o,e[10]=f):f=e[10];let c;e[11]!==h||e[12]!==f?(c={mutationFn:h,onSuccess:f,onError:jt},e[11]=h,e[12]=f,e[13]=c):c=e[13];const{mutate:g,isPending:C}=oe(c);let p;e[14]!==t.id?(p=J.aiProviderCredits(t.id,"deco"),e[14]=t.id,e[15]=p):p=e[15];const v=!!l;let j;e[16]!==n?(j=async()=>{const X=await n.callTool({name:"AI_PROVIDER_CREDITS",arguments:{providerId:"deco"}});return X?.isError?null:X.structuredContent??null},e[16]=n,e[17]=j):j=e[17];let x;e[18]!==p||e[19]!==v||e[20]!==j?(x={queryKey:p,enabled:v,staleTime:6e4,queryFn:j},e[18]=p,e[19]=v,e[20]=j,e[21]=x):x=e[21];const{data:_,isLoading:I,refetch:y,isFetching:S}=ze(x);if(!l)return null;const a=_?.balanceCents!=null?_.balanceCents/100:null;let N;e[22]!==a?(N=a!=null?`$${a.toFixed(2)}`:"—",e[22]=a,e[23]=N):N=e[23];const L=N;let q;e[24]===Symbol.for("react.memo_cache_sentinel")?(q=s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"Deco AI Gateway",className:"size-9 rounded-lg object-contain dark:bg-white dark:p-0.5"}),s.jsx("div",{children:s.jsx("p",{className:"text-xs text-muted-foreground",children:"Access to 100+ models"})})]}),e[24]=q):q=e[24];let V;e[25]===Symbol.for("react.memo_cache_sentinel")?(V=()=>b(!0),e[25]=V):V=e[25];let P;e[26]!==C?(P=s.jsxs("div",{className:"flex items-center justify-between",children:[q,s.jsx(Y,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground hover:text-destructive",onClick:V,disabled:C,children:"Disconnect"})]}),e[26]=C,e[27]=P):P=e[27];let A;e[28]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsxs(Pe,{children:[s.jsx(Ae,{children:"Disconnect Deco AI Gateway"}),s.jsx(De,{children:"This will remove the Deco AI Gateway from this workspace. Your credit balance is preserved and will be available if you reconnect."})]}),e[28]=A):A=e[28];let K;e[29]===Symbol.for("react.memo_cache_sentinel")?(K=s.jsx(Ee,{children:"Cancel"}),e[29]=K):K=e[29];let M;e[30]!==g?(M=s.jsxs(Ke,{children:[A,s.jsxs(Fe,{children:[K,s.jsx($e,{onClick:()=>g(),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Disconnect"})]})]}),e[30]=g,e[31]=M):M=e[31];let u;e[32]!==m||e[33]!==M?(u=s.jsx(Me,{open:m,onOpenChange:b,children:M}),e[32]=m,e[33]=M,e[34]=u):u=e[34];let E;e[35]!==a||e[36]!==L||e[37]!==S||e[38]!==I?(E=I||S?s.jsx(he,{className:"h-9 w-24"}):s.jsx("span",{className:ve("text-3xl font-semibold tabular-nums tracking-tight",a!=null&&yt(a)),children:L}),e[35]=a,e[36]=L,e[37]=S,e[38]=I,e[39]=E):E=e[39];let D;e[40]!==y?(D=()=>y(),e[40]=y,e[41]=D):D=e[41];const F=S&&"animate-spin";let k;e[42]!==F?(k=ve(F),e[42]=F,e[43]=k):k=e[43];let R;e[44]!==k?(R=s.jsx(ke,{size:14,className:k}),e[44]=k,e[45]=R):R=e[45];let T;e[46]!==S||e[47]!==D||e[48]!==R?(T=s.jsx("button",{type:"button",onClick:D,disabled:S,className:"text-muted-foreground hover:text-foreground disabled:opacity-50 transition-colors p-1 rounded-md hover:bg-muted/50","aria-label":"Refresh balance",children:R}),e[46]=S,e[47]=D,e[48]=R,e[49]=T):T=e[49];let $;e[50]!==E||e[51]!==T?($=s.jsxs("div",{className:"flex items-baseline gap-2",children:[E,T]}),e[50]=E,e[51]=T,e[52]=$):$=e[52];let z;e[53]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsx("p",{className:"text-xs text-muted-foreground",children:"Available credit balance"}),e[53]=z):z=e[53];let U;e[54]!==$?(U=s.jsxs("div",{className:"flex flex-col gap-2 pt-2",children:[$,z]}),e[54]=$,e[55]=U):U=e[55];let H;e[56]===Symbol.for("react.memo_cache_sentinel")?(H=s.jsxs("div",{className:"pt-4 border-t border-border/60",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-2.5",children:"Add credits"}),s.jsx(ht,{})]}),e[56]=H):H=e[56];let Q;return e[57]!==P||e[58]!==u||e[59]!==U?(Q=s.jsx(be,{title:"Deco AI Gateway",children:s.jsx(xe,{children:s.jsxs("div",{className:"px-5 py-5 flex flex-col gap-5",children:[P,u,U,H]})})}),e[57]=P,e[58]=u,e[59]=U,e[60]=Q):Q=e[60],Q}function jt(e){Z.error(`Failed to disconnect: ${e.message}`)}function _t(e){return e.providerId==="deco"}function It(){const e=G.c(11),{org:t}=de();let i;e[0]!==t.id||e[1]!==t.slug?(i={connectionId:me,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=i):i=e[2];const n=ue(i),o=ge();let d;e[3]!==n?(d=async()=>{const m=await n.callTool({name:"AI_PROVIDER_PROVISION_KEY",arguments:{providerId:"deco"}});if(m?.isError)throw new Error(m.content?.[0]?.text??"Key provisioning failed")},e[3]=n,e[4]=d):d=e[4];let r;e[5]!==t.id||e[6]!==o?(r=()=>{Ce("ai_provider_provision_succeeded",{provider_id:"deco"}),o.invalidateQueries({queryKey:J.aiProviderKeys(t.id)}),o.invalidateQueries({queryKey:J.aiProviders(t.id)}),Z.success("Deco AI Gateway connected successfully")},e[5]=t.id,e[6]=o,e[7]=r):r=e[7];let l;return e[8]!==d||e[9]!==r?(l={mutationFn:d,onSuccess:r,onError:St},e[8]=d,e[9]=r,e[10]=l):l=e[10],oe(l)}function St(e){Ce("ai_provider_provision_failed",{provider_id:"deco",error:e.message}),Z.error(`Failed to connect Deco AI Gateway: ${e.message}`)}function kt(){const e=G.c(10),{mutate:t,isPending:i}=It();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=["radial-gradient(ellipse 50% 150% at -15% 50%, rgba(165,149,255,0.14) 0%, transparent 60%)","radial-gradient(ellipse 50% 150% at 115% 50%, rgba(208,236,26,0.11) 0%, transparent 60%)"],e[0]=n):n=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{backgroundImage:n.join(", ")}}),e[1]=o):o=e[1];let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"Deco AI Gateway",className:"size-12 shrink-0 rounded-xl object-contain dark:bg-white dark:p-1"}),e[2]=d):d=e[2];let r;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[s.jsx("p",{className:"text-base font-semibold",children:"Deco AI Gateway"}),s.jsx("span",{className:"rounded-full border border-border/60 bg-background/60 px-2 py-0.5 text-[10px] font-medium text-muted-foreground",children:"Recommended"})]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"100+ models, one connection — pay as you go, no API keys to juggle."})]}),e[3]=r):r=e[3];let l;e[4]!==t?(l=()=>t(),e[4]=t,e[5]=l):l=e[5];const m=i?"Connecting…":"Connect Deco";let b;return e[6]!==i||e[7]!==l||e[8]!==m?(b=s.jsxs("div",{className:"relative rounded-xl border border-border overflow-hidden",children:[o,s.jsxs("div",{className:"relative flex items-center gap-5 px-6 py-5",children:[d,r,s.jsx(Y,{variant:"outline",disabled:i,onClick:l,children:m})]})]}),e[6]=i,e[7]=l,e[8]=m,e[9]=b):b=e[9],b}function Ct(e){const t=G.c(70),{providerKey:i,provider:n}=e,{org:o}=de();let d;t[0]!==o.id||t[1]!==o.slug?(d={connectionId:me,orgId:o.id,orgSlug:o.slug},t[0]=o.id,t[1]=o.slug,t[2]=d):d=t[2];const r=ue(d),l=ge(),[m,b]=O.useState(!1),[h,f]=O.useState(!1),[c,g]=O.useState(i.label);let C;t[3]!==n.supportedMethods?(C=n.supportedMethods.includes("cli-activate"),t[3]=n.supportedMethods,t[4]=C):C=t[4];const p=C,v=n.id==="openai-compatible";let j;t[5]!==v||t[6]!==i.presetId?(j=v&&i.presetId?We.find(B=>B.id===i.presetId):void 0,t[5]=v,t[6]=i.presetId,t[7]=j):j=t[7];const x=j,_=x?x.name:v?"Custom OpenAI-compatible":n.name,I=x?.logo??n.logo;let y;e:{if(p){y="Authenticated via CLI";break e}if(v){y=i.label;break e}const B=i.label;let ne;t[8]!==i.createdAt?(ne=lt(new Date(i.createdAt)),t[8]=i.createdAt,t[9]=ne):ne=t[9],y=`${B} · added ${ne} ago`}const S=y;let a;t[10]!==r||t[11]!==i.id?(a=async B=>{await r.callTool({name:"AI_PROVIDER_KEY_UPDATE",arguments:{keyId:i.id,label:B}})},t[10]=r,t[11]=i.id,t[12]=a):a=t[12];let N;t[13]!==o.id||t[14]!==l?(N=()=>{l.invalidateQueries({queryKey:J.aiProviderKeys(o.id)}),f(!1)},t[13]=o.id,t[14]=l,t[15]=N):N=t[15];let L;t[16]!==a||t[17]!==N?(L={mutationFn:a,onSuccess:N,onError:Nt},t[16]=a,t[17]=N,t[18]=L):L=t[18];const{mutate:q,isPending:V}=oe(L);let P;t[19]!==r||t[20]!==i.id?(P=async()=>{await r.callTool({name:"AI_PROVIDER_KEY_DELETE",arguments:{keyId:i.id}})},t[19]=r,t[20]=i.id,t[21]=P):P=t[21];let A;t[22]!==o.id||t[23]!==i.id||t[24]!==l?(A=()=>{l.invalidateQueries({queryKey:J.aiProviderKeys(o.id)}),l.invalidateQueries({queryKey:J.aiProviders(o.id)}),l.invalidateQueries({queryKey:J.aiProviderModels(o.id,i.id)}),Z.success("Key deleted"),b(!1)},t[22]=o.id,t[23]=i.id,t[24]=l,t[25]=A):A=t[25];let K;t[26]!==P||t[27]!==A?(K={mutationFn:P,onSuccess:A,onError:wt},t[26]=P,t[27]=A,t[28]=K):K=t[28];const{mutate:M,isPending:u}=oe(K);let E;t[29]!==i.label?(E=()=>{g(i.label),f(!0)},t[29]=i.label,t[30]=E):E=t[30];const D=E;let F;t[31]!==c||t[32]!==q?(F=()=>{const B=c.trim();B&&q(B)},t[31]=c,t[32]=q,t[33]=F):F=t[33];const k=F;let R;t[34]!==_||t[35]!==I?(R=I?s.jsx("img",{src:I,alt:_,className:"size-8 rounded-md object-contain dark:bg-white dark:p-0.5"}):s.jsx(rt,{fallback:_.charAt(0),className:"size-8 bg-primary/10 text-primary"}),t[34]=_,t[35]=I,t[36]=R):R=t[36];let T;t[37]!==_||t[38]!==c||t[39]!==h||t[40]!==k?(T=h?s.jsx("input",{autoFocus:!0,className:"font-medium bg-transparent border-b border-border outline-none w-full",value:c,onChange:B=>g(B.target.value),onKeyDown:B=>{B.key==="Enter"&&k(),B.key==="Escape"&&f(!1)}}):_,t[37]=_,t[38]=c,t[39]=h,t[40]=k,t[41]=T):T=t[41];const $=h?null:S;let z;t[42]!==c||t[43]!==h||t[44]!==p||t[45]!==u||t[46]!==V||t[47]!==D||t[48]!==k?(z=s.jsx("div",{className:"flex items-center gap-0.5",children:h?s.jsxs(s.Fragment,{children:[s.jsx(Y,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-foreground",disabled:V||!c.trim(),onClick:k,children:s.jsx(tt,{size:14})}),s.jsx(Y,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:()=>f(!1),children:s.jsx(ot,{size:14})})]}):s.jsxs(s.Fragment,{children:[!p&&s.jsx(Y,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:D,children:s.jsx(st,{size:14})}),s.jsx(Y,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",disabled:u,onClick:()=>b(!0),children:s.jsx(it,{size:14})})]})}),t[42]=c,t[43]=h,t[44]=p,t[45]=u,t[46]=V,t[47]=D,t[48]=k,t[49]=z):z=t[49];let U;t[50]!==R||t[51]!==T||t[52]!==$||t[53]!==z?(U=s.jsx(we,{icon:R,title:T,description:$,action:z}),t[50]=R,t[51]=T,t[52]=$,t[53]=z,t[54]=U):U=t[54];let H;t[55]===Symbol.for("react.memo_cache_sentinel")?(H=s.jsx(Ae,{children:"Delete API Key"}),t[55]=H):H=t[55];let Q;t[56]!==i.label?(Q=s.jsxs(Pe,{children:[H,s.jsxs(De,{children:["This action cannot be undone. This will permanently delete"," ",s.jsx("span",{className:"font-medium text-foreground",children:i.label}),"."]})]}),t[56]=i.label,t[57]=Q):Q=t[57];let X;t[58]===Symbol.for("react.memo_cache_sentinel")?(X=s.jsx(Ee,{children:"Cancel"}),t[58]=X):X=t[58];let ee;t[59]!==M?(ee=s.jsxs(Fe,{children:[X,s.jsx($e,{onClick:()=>M(),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),t[59]=M,t[60]=ee):ee=t[60];let te;t[61]!==Q||t[62]!==ee?(te=s.jsxs(Ke,{children:[Q,ee]}),t[61]=Q,t[62]=ee,t[63]=te):te=t[63];let se;t[64]!==m||t[65]!==te?(se=s.jsx(Me,{open:m,onOpenChange:b,children:te}),t[64]=m,t[65]=te,t[66]=se):se=t[66];let le;return t[67]!==U||t[68]!==se?(le=s.jsxs(s.Fragment,{children:[U,se]}),t[67]=U,t[68]=se,t[69]=le):le=t[69],le}function wt(e){return Z.error(`Failed to delete key: ${e.message}`)}function Nt(){return Z.error("Failed to update key label")}function Pt(e){const t=G.c(11),{onConnectClick:i}=e,n=re(),o=Ne();let d;t[0]!==o?.providers?(d=o?.providers??[],t[0]=o?.providers,t[1]=d):d=t[1];const r=d;let l;if(t[2]!==n||t[3]!==i||t[4]!==r){let m;t[6]!==r?(m=c=>({key:c,provider:r.find(g=>g.id===c.providerId)}),t[6]=r,t[7]=m):m=t[7];const b=n.filter(Et).map(m).filter(Dt);let h;t[8]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(et,{size:14}),t[8]=h):h=t[8];let f;t[9]!==i?(f=s.jsxs(Y,{size:"sm",onClick:i,children:[h,"Connect provider"]}),t[9]=i,t[10]=f):f=t[10],l=s.jsx(be,{title:"Connected providers",headerClassName:"px-0",actions:f,children:b.length===0?s.jsx("p",{className:"text-sm text-muted-foreground px-1",children:"Bring your own keys to use specific models alongside Deco's gateway."}):s.jsx(xe,{children:b.map(At)})}),t[2]=n,t[3]=i,t[4]=r,t[5]=l}else l=t[5];return l}function At(e){const{key:t,provider:i}=e;return s.jsx(Ct,{providerKey:t,provider:i},t.id)}function Dt(e){return e.provider!==void 0}function Et(e){return e.providerId!=="deco"}function Kt(e){const t=G.c(3),{error:i}=e;let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(qe,{size:16}),t[0]=n):n=t[0];let o;return t[1]!==i.message?(o=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[n,s.jsxs("span",{className:"text-sm font-medium",children:["Failed to load AI providers: ",i.message]})]}),t[1]=i.message,t[2]=o):o=t[2],o}function Ft(){const e=G.c(23),t=re();let i;e[0]!==t?(i=t.some($t),e[0]=t,e[1]=i):i=e[1];const n=i,o=t.length>0,[d,r]=O.useState(!1),[l,m]=O.useState(null),b=Ne();let h;e[2]!==b?.providers?(h=b?.providers??[],e[2]=b?.providers,e[3]=h):h=e[3];const f=h;if(!o){let j;e[4]===Symbol.for("react.memo_cache_sentinel")?(j=()=>r(!0),e[4]=j):j=e[4];let x;e[5]!==f?(x=s.jsx(He,{providers:f,onSelect:m,onShowAll:j}),e[5]=f,e[6]=x):x=e[6];const _=l!==null||d;let I;e[7]===Symbol.for("react.memo_cache_sentinel")?(I=N=>{N||(m(null),r(!1))},e[7]=I):I=e[7];const y=l??void 0;let S;e[8]!==_||e[9]!==y?(S=s.jsx(je,{open:_,onOpenChange:I,initialProvider:y}),e[8]=_,e[9]=y,e[10]=S):S=e[10];let a;return e[11]!==x||e[12]!==S?(a=s.jsxs(s.Fragment,{children:[x,S]}),e[11]=x,e[12]=S,e[13]=a):a=e[13],a}let c;e[14]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(O.Suspense,{fallback:s.jsx(he,{className:"h-16 w-full"}),children:s.jsx(ft,{})}),e[14]=c):c=e[14];let g;e[15]!==n?(g=n?s.jsx(vt,{}):s.jsx(kt,{}),e[15]=n,e[16]=g):g=e[16];let C;e[17]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(Pt,{onConnectClick:()=>r(!0)}),e[17]=C):C=e[17];let p;e[18]!==d?(p=s.jsx(je,{open:d,onOpenChange:r}),e[18]=d,e[19]=p):p=e[19];let v;return e[20]!==g||e[21]!==p?(v=s.jsxs(s.Fragment,{children:[c,g,C,p]}),e[20]=g,e[21]=p,e[22]=v):v=e[22],v}function $t(e){return e.providerId==="deco"}function Mt(){const e=G.c(2);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(ae.Title,{children:"AI Providers"}),e[0]=t):t=e[0];let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(ae,{children:s.jsx(ae.Content,{children:s.jsx(ae.Body,{children:s.jsxs(Ue,{children:[t,s.jsx(Le,{fallback:Rt,children:s.jsx(O.Suspense,{fallback:s.jsx(he,{className:"h-64 w-full"}),children:s.jsx(Ft,{})})})]})})})}),e[1]=i):i=e[1],i}function Rt(e){const{error:t}=e;return s.jsx(Kt,{error:t??new Error("Failed to load AI providers")})}function Es(){const e=G.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(Mt,{}),e[0]=t):t=e[0],t}export{Es as default};
@@ -1,4 +1,4 @@
1
- import{r as i,b5 as m,j as r,cK as A,cH as w,cI as T,du as O,bd as M,a8 as I,bZ as z,dv as v,b_ as F,de as L,ae as G,cJ as H,b$ as k,e as n,c as p,b9 as D}from"./index-Bq8MNgeV.js";var x="AlertDialog",[V]=G(x,[v]),d=v(),N=l=>{const{__scopeAlertDialog:e,...t}=l,a=d(e);return r.jsx(z,{...a,...t,modal:!0})};N.displayName=x;var W="AlertDialogTrigger",Y=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(H,{...o,...a,ref:e})});Y.displayName=W;var q="AlertDialogPortal",y=l=>{const{__scopeAlertDialog:e,...t}=l,a=d(e);return r.jsx(F,{...a,...t})};y.displayName=q;var B="AlertDialogOverlay",_=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(k,{...o,...a,ref:e})});_.displayName=B;var f="AlertDialogContent",[J,K]=V(f),Z=L("AlertDialogContent"),b=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,children:a,...o}=l,s=d(t),c=i.useRef(null),P=m(e,c),u=i.useRef(null);return r.jsx(O,{contentName:f,titleName:j,docsSlug:"alert-dialog",children:r.jsx(J,{scope:t,cancelRef:u,children:r.jsxs(M,{role:"alertdialog",...s,...o,ref:P,onOpenAutoFocus:I(o.onOpenAutoFocus,g=>{g.preventDefault(),u.current?.focus({preventScroll:!0})}),onPointerDownOutside:g=>g.preventDefault(),onInteractOutside:g=>g.preventDefault(),children:[r.jsx(Z,{children:a}),r.jsx(U,{contentRef:c})]})})})});b.displayName=f;var j="AlertDialogTitle",h=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(w,{...o,...a,ref:e})});h.displayName=j;var E="AlertDialogDescription",R=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(T,{...o,...a,ref:e})});R.displayName=E;var Q="AlertDialogAction",$=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(A,{...o,...a,ref:e})});$.displayName=Q;var C="AlertDialogCancel",S=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,{cancelRef:o}=K(C,t),s=d(t),c=m(e,o);return r.jsx(A,{...s,...a,ref:c})});S.displayName=C;var U=({contentRef:l})=>{const e=`\`${f}\` requires a description for the component to be accessible for screen reader users.
1
+ import{r as i,b5 as m,j as r,cK as A,cH as w,cI as T,du as O,bd as M,a8 as I,bZ as z,dv as v,b_ as F,de as L,ae as G,cJ as H,b$ as k,e as n,c as p,b9 as D}from"./index-B3N0ijMe.js";var x="AlertDialog",[V]=G(x,[v]),d=v(),N=l=>{const{__scopeAlertDialog:e,...t}=l,a=d(e);return r.jsx(z,{...a,...t,modal:!0})};N.displayName=x;var W="AlertDialogTrigger",Y=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(H,{...o,...a,ref:e})});Y.displayName=W;var q="AlertDialogPortal",y=l=>{const{__scopeAlertDialog:e,...t}=l,a=d(e);return r.jsx(F,{...a,...t})};y.displayName=q;var B="AlertDialogOverlay",_=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(k,{...o,...a,ref:e})});_.displayName=B;var f="AlertDialogContent",[J,K]=V(f),Z=L("AlertDialogContent"),b=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,children:a,...o}=l,s=d(t),c=i.useRef(null),P=m(e,c),u=i.useRef(null);return r.jsx(O,{contentName:f,titleName:j,docsSlug:"alert-dialog",children:r.jsx(J,{scope:t,cancelRef:u,children:r.jsxs(M,{role:"alertdialog",...s,...o,ref:P,onOpenAutoFocus:I(o.onOpenAutoFocus,g=>{g.preventDefault(),u.current?.focus({preventScroll:!0})}),onPointerDownOutside:g=>g.preventDefault(),onInteractOutside:g=>g.preventDefault(),children:[r.jsx(Z,{children:a}),r.jsx(U,{contentRef:c})]})})})});b.displayName=f;var j="AlertDialogTitle",h=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(w,{...o,...a,ref:e})});h.displayName=j;var E="AlertDialogDescription",R=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(T,{...o,...a,ref:e})});R.displayName=E;var Q="AlertDialogAction",$=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(A,{...o,...a,ref:e})});$.displayName=Q;var C="AlertDialogCancel",S=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,{cancelRef:o}=K(C,t),s=d(t),c=m(e,o);return r.jsx(A,{...s,...a,ref:c})});S.displayName=C;var U=({contentRef:l})=>{const e=`\`${f}\` requires a description for the component to be accessible for screen reader users.
2
2
 
3
3
  You can add a description to the \`${f}\` by passing a \`${E}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
4
4
 
@@ -1 +1 @@
1
- import{e as l,g as m,j as t,A as f,S as h,h as x,i as r,k as p,N as u}from"./index-Bq8MNgeV.js";function d(){const e=l.c(1),a=window.location.pathname+window.location.search;let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(u,{to:"/login",search:{next:a},replace:!0}),e[0]=n):n=e[0],n}function g(){const e=l.c(6);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/auth/$pathname"},e[0]=a):a=e[0];const{pathname:n}=m(a);if(n==="accept-invitation"){let c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(f,{children:t.jsx(h,{})}),e[1]=c):c=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(x,{children:t.jsx("main",{className:"container mx-auto flex grow flex-col items-center justify-center gap-3 self-center p-4 md:p-6",children:t.jsx(r,{pathname:"accept-invitation"})})}),e[2]=i):i=e[2];let o;return e[3]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsxs(t.Fragment,{children:[c,i,t.jsx(p,{children:t.jsx(d,{})})]}),e[3]=o):o=e[3],o}let s;return e[4]!==n?(s=t.jsx("main",{className:"container mx-auto flex grow flex-col items-center justify-center gap-3 self-center p-4 md:p-6",children:t.jsx(r,{pathname:n})}),e[4]=n,e[5]=s):s=e[5],s}export{g as default};
1
+ import{e as l,g as m,j as t,A as f,S as h,h as x,i as r,k as p,N as u}from"./index-B3N0ijMe.js";function d(){const e=l.c(1),a=window.location.pathname+window.location.search;let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(u,{to:"/login",search:{next:a},replace:!0}),e[0]=n):n=e[0],n}function g(){const e=l.c(6);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/auth/$pathname"},e[0]=a):a=e[0];const{pathname:n}=m(a);if(n==="accept-invitation"){let c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(f,{children:t.jsx(h,{})}),e[1]=c):c=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(x,{children:t.jsx("main",{className:"container mx-auto flex grow flex-col items-center justify-center gap-3 self-center p-4 md:p-6",children:t.jsx(r,{pathname:"accept-invitation"})})}),e[2]=i):i=e[2];let o;return e[3]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsxs(t.Fragment,{children:[c,i,t.jsx(p,{children:t.jsx(d,{})})]}),e[3]=o):o=e[3],o}let s;return e[4]!==n?(s=t.jsx("main",{className:"container mx-auto flex grow flex-col items-center justify-center gap-3 self-center p-4 md:p-6",children:t.jsx(r,{pathname:n})}),e[4]=n,e[5]=s):s=e[5],s}export{g as default};
@@ -1 +1 @@
1
- import{e as P,s as q,K as $,n as M,o as z,a as K,x as k,r as U,c as Q,j as i,B}from"./index-Bq8MNgeV.js";import{b as V,d as H,e as Y,g as J,c as W,f as X,a as Z,A as ee}from"./alert-dialog-CoBaZf61.js";import{a as te,D as se,b as ne,c as oe}from"./dropdown-menu-DX0TPN0k.js";import{A as ie,x as ae}from"./agent-icon-DIgcdFeV.js";import{i as re}from"./DotsVertical-DlBHJ9PJ.js";import{s as le}from"./Trash01-CWiWK8tz.js";import{i as ce}from"./Zap-DkdmeY_3.js";import{u as ue}from"./use-virtual-mcp-CD_T-y85.js";import{S as G,u as L}from"./constants-ClujOLL0.js";function me(t){if(t.paramsSchema&&typeof t.paramsSchema=="object")return t;const e={};if(Array.isArray(t.params))for(const s of t.params)e[s.name]={type:s.type,description:s.description,enum:s.enum};else t.params&&typeof t.params=="object"&&Object.assign(e,t.params);return{type:t.type,description:t.description,paramsSchema:e}}function Ne(t){const e=P.c(12),{org:s}=q(),n=t??G;let a;e[0]!==s.id||e[1]!==s.slug||e[2]!==n?(a={connectionId:n,orgId:s.id,orgSlug:s.slug},e[0]=s.id,e[1]=s.slug,e[2]=n,e[3]=a):a=e[3];const r=L(a);let o;e[4]!==t?(o=$.toolCall(t??"","TRIGGER_LIST",""),e[4]=t,e[5]=o):o=e[5];let u;e[6]!==r?(u=async()=>{const g=await r.callTool({name:"TRIGGER_LIST",arguments:{}});return(g.structuredContent??g).triggers.map(me)},e[6]=r,e[7]=u):u=e[7];const l=!!t;let d;return e[8]!==o||e[9]!==u||e[10]!==l?(d={queryKey:o,queryFn:u,enabled:l,staleTime:3e4},e[8]=o,e[9]=u,e[10]=l,e[11]=d):d=e[11],M(d)}function Ee(t){const e=P.c(12),{org:s}=q();let n;e[0]!==s.id||e[1]!==s.slug?(n={connectionId:G,orgId:s.id,orgSlug:s.slug},e[0]=s.id,e[1]=s.slug,e[2]=n):n=e[2];const a=L(n);let r;e[3]!==s.id||e[4]!==t?(r=$.automations(s.id,t),e[3]=s.id,e[4]=t,e[5]=r):r=e[5];let o;e[6]!==a||e[7]!==t?(o=async()=>{const l=t!=null?{virtual_mcp_id:t}:{},d=await a.callTool({name:"AUTOMATION_LIST",arguments:l});return(d.structuredContent??d).automations},e[6]=a,e[7]=t,e[8]=o):o=e[8];let u;return e[9]!==r||e[10]!==o?(u={queryKey:r,queryFn:o,staleTime:1e4},e[9]=r,e[10]=o,e[11]=u):u=e[11],M(u)}function Oe(t){const e=P.c(13),{org:s}=q();let n;e[0]!==s.id||e[1]!==s.slug?(n={connectionId:G,orgId:s.id,orgSlug:s.slug},e[0]=s.id,e[1]=s.slug,e[2]=n):n=e[2];const a=L(n);let r;e[3]!==t||e[4]!==s.id?(r=$.automation(s.id,t),e[3]=t,e[4]=s.id,e[5]=r):r=e[5];let o;e[6]!==a||e[7]!==t?(o=async()=>{const d=await a.callTool({name:"AUTOMATION_GET",arguments:{id:t}});return(d.structuredContent??d).automation},e[6]=a,e[7]=t,e[8]=o):o=e[8];const u=!!t;let l;return e[9]!==r||e[10]!==o||e[11]!==u?(l={queryKey:r,queryFn:o,enabled:u,staleTime:1e4},e[9]=r,e[10]=o,e[11]=u,e[12]=l):l=e[12],M(l)}function we(t){return{name:"New Automation",messages:[],models:{tier:"smart"},temperature:.5,active:!0,virtual_mcp_id:t}}function de(){const t=P.c(55),{org:e}=q();let s;t[0]!==e.id||t[1]!==e.slug?(s={connectionId:G,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=s):s=t[2];const n=L(s),a=z();let r;t[3]!==e.id||t[4]!==a?(r=()=>a.invalidateQueries({queryKey:$.automationsAll(e.id)}),t[3]=e.id,t[4]=a,t[5]=r):r=t[5];const o=r;let u;t[6]!==e.id||t[7]!==a?(u=m=>a.invalidateQueries({queryKey:$.automation(e.id,m)}),t[6]=e.id,t[7]=a,t[8]=u):u=t[8];const l=u;let d;t[9]!==n?(d=async m=>{const c=await n.callTool({name:"AUTOMATION_CREATE",arguments:m});return c.structuredContent??c},t[9]=n,t[10]=d):d=t[10];let g;t[11]!==o?(g=()=>{o(),k.success("Automation created successfully")},t[11]=o,t[12]=g):g=t[12];let C;t[13]!==d||t[14]!==g?(C={mutationFn:d,onSuccess:g,onError:pe},t[13]=d,t[14]=g,t[15]=C):C=t[15];const F=K(C);let S;t[16]!==n?(S=async m=>{const c=await n.callTool({name:"AUTOMATION_UPDATE",arguments:m});return c.structuredContent??c},t[16]=n,t[17]=S):S=t[17];let f;t[18]!==o||t[19]!==l?(f=(m,c)=>{o(),typeof c.id=="string"&&l(c.id),k.success("Automation updated successfully")},t[18]=o,t[19]=l,t[20]=f):f=t[20];let E;t[21]!==S||t[22]!==f?(E={mutationFn:S,onSuccess:f,onError:fe},t[21]=S,t[22]=f,t[23]=E):E=t[23];const D=K(E);let p;t[24]!==n?(p=async m=>{const c=await n.callTool({name:"AUTOMATION_DELETE",arguments:{id:m}});return c.structuredContent??c},t[24]=n,t[25]=p):p=t[25];let x;t[26]!==o||t[27]!==e.id||t[28]!==a?(x=(m,c)=>{a.removeQueries({queryKey:$.automation(e.id,c)}),o(),k.success("Automation deleted successfully")},t[26]=o,t[27]=e.id,t[28]=a,t[29]=x):x=t[29];let A;t[30]!==x||t[31]!==p?(A={mutationFn:p,onSuccess:x,onError:ge},t[30]=x,t[31]=p,t[32]=A):A=t[32];const v=K(A);let _;t[33]!==n?(_=async m=>{const c=await n.callTool({name:"AUTOMATION_TRIGGER_ADD",arguments:m});if(c.isError){const R=c.content?.[0]?.text??"Failed to add trigger";throw new Error(R)}return c.structuredContent??c},t[33]=n,t[34]=_):_=t[34];let y;t[35]!==o||t[36]!==l?(y=m=>{o(),l(m.automation_id)},t[35]=o,t[36]=l,t[37]=y):y=t[37];let N;t[38]!==_||t[39]!==y?(N={mutationFn:_,onSuccess:y},t[38]=_,t[39]=y,t[40]=N):N=t[40];const O=K(N);let h;t[41]!==n?(h=async m=>{const c=await n.callTool({name:"AUTOMATION_TRIGGER_REMOVE",arguments:{trigger_id:m.trigger_id}});return c.structuredContent??c},t[41]=n,t[42]=h):h=t[42];let T;t[43]!==o||t[44]!==l?(T=(m,c)=>{o(),l(c.automation_id)},t[43]=o,t[44]=l,t[45]=T):T=t[45];let j;t[46]!==h||t[47]!==T?(j={mutationFn:h,onSuccess:T},t[46]=h,t[47]=T,t[48]=j):j=t[48];const w=K(j);let b;return t[49]!==F||t[50]!==v||t[51]!==O||t[52]!==w||t[53]!==D?(b={create:F,update:D,remove:v,triggerAdd:O,triggerRemove:w},t[49]=F,t[50]=v,t[51]=O,t[52]=w,t[53]=D,t[54]=b):b=t[54],b}function ge(t){const e=t instanceof Error?t.message:String(t);k.error(`Failed to delete automation: ${e}`)}function fe(t){const e=t instanceof Error?t.message:String(t);k.error(`Failed to update automation: ${e}`)}function pe(t){const e=t instanceof Error?t.message:String(t);k.error(`Failed to create automation: ${e}`)}function Fe(t){const e=P.c(53),{automation:s,showAgent:n,onClick:a}=t,{remove:r}=de(),[o,u]=U.useState(!1),l=ue(n?s.virtual_mcp_id:void 0);let d;e[0]!==s.id||e[1]!==r?(d=()=>{r.mutate(s.id),u(!1)},e[0]=s.id,e[1]=r,e[2]=d):d=e[2];const g=d;let C;e[3]!==a?(C=I=>{I.target===I.currentTarget&&(I.key==="Enter"||I.key===" ")&&(I.preventDefault(),a())},e[3]=a,e[4]=C):C=e[4];const F=C,S=s.active&&s.trigger_count>0?"bg-emerald-500":"bg-muted-foreground/40";let f;e[5]!==S?(f=Q("inline-block size-2 rounded-full shrink-0",S),e[5]=S,e[6]=f):f=e[6];const E=s.active&&s.trigger_count>0?"Active":s.active?"No triggers configured":"Paused";let D;e[7]!==f||e[8]!==E?(D=i.jsx("span",{className:f,"aria-label":E}),e[7]=f,e[8]=E,e[9]=D):D=e[9];let p;e[10]!==l?.icon||e[11]!==l?.title||e[12]!==s.name||e[13]!==n?(p=n&&i.jsx(ie,{icon:l?.icon??null,name:l?.title??s.name,size:"xs",className:"shrink-0"}),e[10]=l?.icon,e[11]=l?.title,e[12]=s.name,e[13]=n,e[14]=p):p=e[14];let x;e[15]!==s.name?(x=i.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:s.name}),e[15]=s.name,e[16]=x):x=e[16];let A;e[17]!==l||e[18]!==n?(A=n&&l&&i.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:["· ",l.title]}),e[17]=l,e[18]=n,e[19]=A):A=e[19];let v;e[20]!==x||e[21]!==A?(v=i.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[x,A]}),e[20]=x,e[21]=A,e[22]=v):v=e[22];let _;e[23]!==s.nearest_next_run_at||e[24]!==s.trigger_count?(_=i.jsx(ye,{triggerCount:s.trigger_count,nextRunAt:s.nearest_next_run_at}),e[23]=s.nearest_next_run_at,e[24]=s.trigger_count,e[25]=_):_=e[25];let y;e[26]!==v||e[27]!==_?(y=i.jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-0.5",children:[v,_]}),e[26]=v,e[27]=_,e[28]=y):y=e[28];let N;e[29]===Symbol.for("react.memo_cache_sentinel")?(N=i.jsx(te,{asChild:!0,children:i.jsx(B,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 opacity-0 group-hover:opacity-100 data-[state=open]:opacity-100 transition-opacity",children:i.jsx(re,{size:16})})}),e[29]=N):N=e[29];let O;e[30]===Symbol.for("react.memo_cache_sentinel")?(O=i.jsx("div",{onClick:_e,onKeyDown:xe,role:"presentation",className:"shrink-0",children:i.jsxs(se,{children:[N,i.jsx(ne,{align:"end",children:i.jsxs(oe,{variant:"destructive",onClick:I=>{I.stopPropagation(),u(!0)},children:[i.jsx(le,{size:16}),"Delete"]})})]})}),e[30]=O):O=e[30];let h;e[31]!==F||e[32]!==a||e[33]!==y||e[34]!==D||e[35]!==p?(h=i.jsxs("div",{role:"button",tabIndex:0,onClick:a,onKeyDown:F,className:"group w-full flex items-center gap-3 px-4 py-3 border-b border-border text-left hover:bg-muted/50 transition-colors cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[D,p,y,O]}),e[31]=F,e[32]=a,e[33]=y,e[34]=D,e[35]=p,e[36]=h):h=e[36];let T;e[37]===Symbol.for("react.memo_cache_sentinel")?(T=i.jsx(W,{children:"Delete automation?"}),e[37]=T):T=e[37];let j;e[38]!==s.name?(j=i.jsxs(V,{children:[T,i.jsxs(H,{children:["This removes"," ",i.jsx("span",{className:"font-medium text-foreground",children:s.name})," ","and all of its triggers. This action cannot be undone."]})]}),e[38]=s.name,e[39]=j):j=e[39];let w;e[40]===Symbol.for("react.memo_cache_sentinel")?(w=i.jsx(X,{children:"Cancel"}),e[40]=w):w=e[40];let b;e[41]!==g||e[42]!==r.isPending?(b=i.jsxs(Y,{children:[w,i.jsx(J,{onClick:g,disabled:r.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),e[41]=g,e[42]=r.isPending,e[43]=b):b=e[43];let m;e[44]!==j||e[45]!==b?(m=i.jsxs(Z,{children:[j,b]}),e[44]=j,e[45]=b,e[46]=m):m=e[46];let c;e[47]!==o||e[48]!==m?(c=i.jsx(ee,{open:o,onOpenChange:u,children:m}),e[47]=o,e[48]=m,e[49]=c):c=e[49];let R;return e[50]!==h||e[51]!==c?(R=i.jsxs(i.Fragment,{children:[h,c]}),e[50]=h,e[51]=c,e[52]=R):R=e[52],R}function xe(t){return t.stopPropagation()}function _e(t){return t.stopPropagation()}function ye(t){const e=P.c(4),{triggerCount:s,nextRunAt:n}=t;if(s===0){let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx("span",{className:"text-xs text-muted-foreground",children:"No triggers configured"}),e[0]=r):r=e[0],r}let a;return e[1]!==n||e[2]!==s?(a=i.jsx("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground min-w-0",children:n?i.jsxs(i.Fragment,{children:[i.jsx(ae,{size:12,className:"shrink-0"}),i.jsxs("span",{className:"truncate",children:["Next run ",new Date(n).toLocaleString()]})]}):i.jsxs(i.Fragment,{children:[i.jsx(ce,{size:12,className:"shrink-0"}),i.jsxs("span",{className:"truncate",children:[s," trigger",s===1?"":"s"]})]})}),e[1]=n,e[2]=s,e[3]=a):a=e[3],a}export{Fe as A,Ne as a,Oe as b,Ee as c,we as d,de as u};
1
+ import{e as P,s as q,K as $,n as M,o as z,a as K,x as k,r as U,c as Q,j as i,B}from"./index-B3N0ijMe.js";import{b as V,d as H,e as Y,g as J,c as W,f as X,a as Z,A as ee}from"./alert-dialog-BTkTE2x9.js";import{a as te,D as se,b as ne,c as oe}from"./dropdown-menu-B6XbAhub.js";import{A as ie,x as ae}from"./agent-icon-CGz6_qSV.js";import{i as re}from"./DotsVertical-BV7jVmIB.js";import{s as le}from"./Trash01-IeycYlZQ.js";import{i as ce}from"./Zap-N-AnbCTG.js";import{u as ue}from"./use-virtual-mcp-fhETXyqA.js";import{S as G,u as L}from"./constants-CmcFrIt1.js";function me(t){if(t.paramsSchema&&typeof t.paramsSchema=="object")return t;const e={};if(Array.isArray(t.params))for(const s of t.params)e[s.name]={type:s.type,description:s.description,enum:s.enum};else t.params&&typeof t.params=="object"&&Object.assign(e,t.params);return{type:t.type,description:t.description,paramsSchema:e}}function Ne(t){const e=P.c(12),{org:s}=q(),n=t??G;let a;e[0]!==s.id||e[1]!==s.slug||e[2]!==n?(a={connectionId:n,orgId:s.id,orgSlug:s.slug},e[0]=s.id,e[1]=s.slug,e[2]=n,e[3]=a):a=e[3];const r=L(a);let o;e[4]!==t?(o=$.toolCall(t??"","TRIGGER_LIST",""),e[4]=t,e[5]=o):o=e[5];let u;e[6]!==r?(u=async()=>{const g=await r.callTool({name:"TRIGGER_LIST",arguments:{}});return(g.structuredContent??g).triggers.map(me)},e[6]=r,e[7]=u):u=e[7];const l=!!t;let d;return e[8]!==o||e[9]!==u||e[10]!==l?(d={queryKey:o,queryFn:u,enabled:l,staleTime:3e4},e[8]=o,e[9]=u,e[10]=l,e[11]=d):d=e[11],M(d)}function Ee(t){const e=P.c(12),{org:s}=q();let n;e[0]!==s.id||e[1]!==s.slug?(n={connectionId:G,orgId:s.id,orgSlug:s.slug},e[0]=s.id,e[1]=s.slug,e[2]=n):n=e[2];const a=L(n);let r;e[3]!==s.id||e[4]!==t?(r=$.automations(s.id,t),e[3]=s.id,e[4]=t,e[5]=r):r=e[5];let o;e[6]!==a||e[7]!==t?(o=async()=>{const l=t!=null?{virtual_mcp_id:t}:{},d=await a.callTool({name:"AUTOMATION_LIST",arguments:l});return(d.structuredContent??d).automations},e[6]=a,e[7]=t,e[8]=o):o=e[8];let u;return e[9]!==r||e[10]!==o?(u={queryKey:r,queryFn:o,staleTime:1e4},e[9]=r,e[10]=o,e[11]=u):u=e[11],M(u)}function Oe(t){const e=P.c(13),{org:s}=q();let n;e[0]!==s.id||e[1]!==s.slug?(n={connectionId:G,orgId:s.id,orgSlug:s.slug},e[0]=s.id,e[1]=s.slug,e[2]=n):n=e[2];const a=L(n);let r;e[3]!==t||e[4]!==s.id?(r=$.automation(s.id,t),e[3]=t,e[4]=s.id,e[5]=r):r=e[5];let o;e[6]!==a||e[7]!==t?(o=async()=>{const d=await a.callTool({name:"AUTOMATION_GET",arguments:{id:t}});return(d.structuredContent??d).automation},e[6]=a,e[7]=t,e[8]=o):o=e[8];const u=!!t;let l;return e[9]!==r||e[10]!==o||e[11]!==u?(l={queryKey:r,queryFn:o,enabled:u,staleTime:1e4},e[9]=r,e[10]=o,e[11]=u,e[12]=l):l=e[12],M(l)}function we(t){return{name:"New Automation",messages:[],models:{tier:"smart"},temperature:.5,active:!0,virtual_mcp_id:t}}function de(){const t=P.c(55),{org:e}=q();let s;t[0]!==e.id||t[1]!==e.slug?(s={connectionId:G,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=s):s=t[2];const n=L(s),a=z();let r;t[3]!==e.id||t[4]!==a?(r=()=>a.invalidateQueries({queryKey:$.automationsAll(e.id)}),t[3]=e.id,t[4]=a,t[5]=r):r=t[5];const o=r;let u;t[6]!==e.id||t[7]!==a?(u=m=>a.invalidateQueries({queryKey:$.automation(e.id,m)}),t[6]=e.id,t[7]=a,t[8]=u):u=t[8];const l=u;let d;t[9]!==n?(d=async m=>{const c=await n.callTool({name:"AUTOMATION_CREATE",arguments:m});return c.structuredContent??c},t[9]=n,t[10]=d):d=t[10];let g;t[11]!==o?(g=()=>{o(),k.success("Automation created successfully")},t[11]=o,t[12]=g):g=t[12];let C;t[13]!==d||t[14]!==g?(C={mutationFn:d,onSuccess:g,onError:pe},t[13]=d,t[14]=g,t[15]=C):C=t[15];const F=K(C);let S;t[16]!==n?(S=async m=>{const c=await n.callTool({name:"AUTOMATION_UPDATE",arguments:m});return c.structuredContent??c},t[16]=n,t[17]=S):S=t[17];let f;t[18]!==o||t[19]!==l?(f=(m,c)=>{o(),typeof c.id=="string"&&l(c.id),k.success("Automation updated successfully")},t[18]=o,t[19]=l,t[20]=f):f=t[20];let E;t[21]!==S||t[22]!==f?(E={mutationFn:S,onSuccess:f,onError:fe},t[21]=S,t[22]=f,t[23]=E):E=t[23];const D=K(E);let p;t[24]!==n?(p=async m=>{const c=await n.callTool({name:"AUTOMATION_DELETE",arguments:{id:m}});return c.structuredContent??c},t[24]=n,t[25]=p):p=t[25];let x;t[26]!==o||t[27]!==e.id||t[28]!==a?(x=(m,c)=>{a.removeQueries({queryKey:$.automation(e.id,c)}),o(),k.success("Automation deleted successfully")},t[26]=o,t[27]=e.id,t[28]=a,t[29]=x):x=t[29];let A;t[30]!==x||t[31]!==p?(A={mutationFn:p,onSuccess:x,onError:ge},t[30]=x,t[31]=p,t[32]=A):A=t[32];const v=K(A);let _;t[33]!==n?(_=async m=>{const c=await n.callTool({name:"AUTOMATION_TRIGGER_ADD",arguments:m});if(c.isError){const R=c.content?.[0]?.text??"Failed to add trigger";throw new Error(R)}return c.structuredContent??c},t[33]=n,t[34]=_):_=t[34];let y;t[35]!==o||t[36]!==l?(y=m=>{o(),l(m.automation_id)},t[35]=o,t[36]=l,t[37]=y):y=t[37];let N;t[38]!==_||t[39]!==y?(N={mutationFn:_,onSuccess:y},t[38]=_,t[39]=y,t[40]=N):N=t[40];const O=K(N);let h;t[41]!==n?(h=async m=>{const c=await n.callTool({name:"AUTOMATION_TRIGGER_REMOVE",arguments:{trigger_id:m.trigger_id}});return c.structuredContent??c},t[41]=n,t[42]=h):h=t[42];let T;t[43]!==o||t[44]!==l?(T=(m,c)=>{o(),l(c.automation_id)},t[43]=o,t[44]=l,t[45]=T):T=t[45];let j;t[46]!==h||t[47]!==T?(j={mutationFn:h,onSuccess:T},t[46]=h,t[47]=T,t[48]=j):j=t[48];const w=K(j);let b;return t[49]!==F||t[50]!==v||t[51]!==O||t[52]!==w||t[53]!==D?(b={create:F,update:D,remove:v,triggerAdd:O,triggerRemove:w},t[49]=F,t[50]=v,t[51]=O,t[52]=w,t[53]=D,t[54]=b):b=t[54],b}function ge(t){const e=t instanceof Error?t.message:String(t);k.error(`Failed to delete automation: ${e}`)}function fe(t){const e=t instanceof Error?t.message:String(t);k.error(`Failed to update automation: ${e}`)}function pe(t){const e=t instanceof Error?t.message:String(t);k.error(`Failed to create automation: ${e}`)}function Fe(t){const e=P.c(53),{automation:s,showAgent:n,onClick:a}=t,{remove:r}=de(),[o,u]=U.useState(!1),l=ue(n?s.virtual_mcp_id:void 0);let d;e[0]!==s.id||e[1]!==r?(d=()=>{r.mutate(s.id),u(!1)},e[0]=s.id,e[1]=r,e[2]=d):d=e[2];const g=d;let C;e[3]!==a?(C=I=>{I.target===I.currentTarget&&(I.key==="Enter"||I.key===" ")&&(I.preventDefault(),a())},e[3]=a,e[4]=C):C=e[4];const F=C,S=s.active&&s.trigger_count>0?"bg-emerald-500":"bg-muted-foreground/40";let f;e[5]!==S?(f=Q("inline-block size-2 rounded-full shrink-0",S),e[5]=S,e[6]=f):f=e[6];const E=s.active&&s.trigger_count>0?"Active":s.active?"No triggers configured":"Paused";let D;e[7]!==f||e[8]!==E?(D=i.jsx("span",{className:f,"aria-label":E}),e[7]=f,e[8]=E,e[9]=D):D=e[9];let p;e[10]!==l?.icon||e[11]!==l?.title||e[12]!==s.name||e[13]!==n?(p=n&&i.jsx(ie,{icon:l?.icon??null,name:l?.title??s.name,size:"xs",className:"shrink-0"}),e[10]=l?.icon,e[11]=l?.title,e[12]=s.name,e[13]=n,e[14]=p):p=e[14];let x;e[15]!==s.name?(x=i.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:s.name}),e[15]=s.name,e[16]=x):x=e[16];let A;e[17]!==l||e[18]!==n?(A=n&&l&&i.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:["· ",l.title]}),e[17]=l,e[18]=n,e[19]=A):A=e[19];let v;e[20]!==x||e[21]!==A?(v=i.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[x,A]}),e[20]=x,e[21]=A,e[22]=v):v=e[22];let _;e[23]!==s.nearest_next_run_at||e[24]!==s.trigger_count?(_=i.jsx(ye,{triggerCount:s.trigger_count,nextRunAt:s.nearest_next_run_at}),e[23]=s.nearest_next_run_at,e[24]=s.trigger_count,e[25]=_):_=e[25];let y;e[26]!==v||e[27]!==_?(y=i.jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-0.5",children:[v,_]}),e[26]=v,e[27]=_,e[28]=y):y=e[28];let N;e[29]===Symbol.for("react.memo_cache_sentinel")?(N=i.jsx(te,{asChild:!0,children:i.jsx(B,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 opacity-0 group-hover:opacity-100 data-[state=open]:opacity-100 transition-opacity",children:i.jsx(re,{size:16})})}),e[29]=N):N=e[29];let O;e[30]===Symbol.for("react.memo_cache_sentinel")?(O=i.jsx("div",{onClick:_e,onKeyDown:xe,role:"presentation",className:"shrink-0",children:i.jsxs(se,{children:[N,i.jsx(ne,{align:"end",children:i.jsxs(oe,{variant:"destructive",onClick:I=>{I.stopPropagation(),u(!0)},children:[i.jsx(le,{size:16}),"Delete"]})})]})}),e[30]=O):O=e[30];let h;e[31]!==F||e[32]!==a||e[33]!==y||e[34]!==D||e[35]!==p?(h=i.jsxs("div",{role:"button",tabIndex:0,onClick:a,onKeyDown:F,className:"group w-full flex items-center gap-3 px-4 py-3 border-b border-border text-left hover:bg-muted/50 transition-colors cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[D,p,y,O]}),e[31]=F,e[32]=a,e[33]=y,e[34]=D,e[35]=p,e[36]=h):h=e[36];let T;e[37]===Symbol.for("react.memo_cache_sentinel")?(T=i.jsx(W,{children:"Delete automation?"}),e[37]=T):T=e[37];let j;e[38]!==s.name?(j=i.jsxs(V,{children:[T,i.jsxs(H,{children:["This removes"," ",i.jsx("span",{className:"font-medium text-foreground",children:s.name})," ","and all of its triggers. This action cannot be undone."]})]}),e[38]=s.name,e[39]=j):j=e[39];let w;e[40]===Symbol.for("react.memo_cache_sentinel")?(w=i.jsx(X,{children:"Cancel"}),e[40]=w):w=e[40];let b;e[41]!==g||e[42]!==r.isPending?(b=i.jsxs(Y,{children:[w,i.jsx(J,{onClick:g,disabled:r.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),e[41]=g,e[42]=r.isPending,e[43]=b):b=e[43];let m;e[44]!==j||e[45]!==b?(m=i.jsxs(Z,{children:[j,b]}),e[44]=j,e[45]=b,e[46]=m):m=e[46];let c;e[47]!==o||e[48]!==m?(c=i.jsx(ee,{open:o,onOpenChange:u,children:m}),e[47]=o,e[48]=m,e[49]=c):c=e[49];let R;return e[50]!==h||e[51]!==c?(R=i.jsxs(i.Fragment,{children:[h,c]}),e[50]=h,e[51]=c,e[52]=R):R=e[52],R}function xe(t){return t.stopPropagation()}function _e(t){return t.stopPropagation()}function ye(t){const e=P.c(4),{triggerCount:s,nextRunAt:n}=t;if(s===0){let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx("span",{className:"text-xs text-muted-foreground",children:"No triggers configured"}),e[0]=r):r=e[0],r}let a;return e[1]!==n||e[2]!==s?(a=i.jsx("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground min-w-0",children:n?i.jsxs(i.Fragment,{children:[i.jsx(ae,{size:12,className:"shrink-0"}),i.jsxs("span",{className:"truncate",children:["Next run ",new Date(n).toLocaleString()]})]}):i.jsxs(i.Fragment,{children:[i.jsx(ce,{size:12,className:"shrink-0"}),i.jsxs("span",{className:"truncate",children:[s," trigger",s===1?"":"s"]})]})}),e[1]=n,e[2]=s,e[3]=a):a=e[3],a}export{Fe as A,Ne as a,Oe as b,Ee as c,we as d,de as u};
@@ -1 +1 @@
1
- import{e as L,s as R,f as T,r as M,j as e,B as $,t as A}from"./index-Bq8MNgeV.js";import{s as D}from"./Plus-Dld8jPbl.js";import{i as S}from"./Zap-DkdmeY_3.js";import{S as O}from"./search-input-CtBB2Ogw.js";import{P as p}from"./index-DF2eiQ1x.js";import{E as b}from"./empty-state-D8kZInFe.js";import{c as V,A as q}from"./automation-list-row-BjJTW98i.js";import{a as F}from"./use-navigate-to-agent-C4qiakGR.js";import{e as G}from"./constants-ClujOLL0.js";import{b as H}from"./use-virtual-mcp-CD_T-y85.js";import"./SearchMd-BzVtNNV8.js";import"./sidebar-CaCy2pvj.js";import"./LayoutLeft-O15r8yaV.js";import"./tooltip-Cop6BWIB.js";import"./X-DCaJ2DR_.js";import"./alert-dialog-CoBaZf61.js";import"./dropdown-menu-DX0TPN0k.js";import"./Check-B3zx_U26.js";import"./ChevronRight-E3ry5bv1.js";import"./DotsVertical-DlBHJ9PJ.js";import"./agent-icon-DIgcdFeV.js";import"./AlertCircle-BhKIfxeV.js";import"./Tool01-C_J_zDPh.js";import"./Archive-Dz0wtILE.js";import"./XClose-BpbAJCm9.js";import"./RefreshCcw01-DlZMdaR5.js";import"./ArrowNarrowLeft-D2IzKz0U.js";import"./XCircle-Xm8lpkAu.js";import"./ArrowUpRight-DQNhEvxd.js";import"./ZapSquare-D31ZX-yT.js";import"./Users03-BvEJiMrD.js";import"./CheckCircle-S5ffz95T.js";import"./ChevronDown-B2rzld2y.js";import"./ChevronUp-CR14Z0nx.js";import"./Container-hpy3kvOB.js";import"./Star01-D7-_AozX.js";import"./Palette-48b46GGh.js";import"./LinkExternal01-CqYIOZ9A.js";import"./Lock01-BWTd97_q.js";import"./Sun-BRoJ4FPT.js";import"./Play-CWd0g6Ov.js";import"./Settings02-Yw9y8zcL.js";import"./Shield01-Bryrtn4R.js";import"./Trash01-CWiWK8tz.js";import"./User01-Cuf_FrNk.js";import"./use-collections-8VzaVe93.js";function Dt(){const t=L.c(16),{org:n}=R(),{data:_}=V(void 0),u=_===void 0?[]:_,B=H(),k=F(),d=T(),[f,E]=M.useState(""),g=f.toLowerCase(),C=new Map(B.map(I)),N=u.filter(o=>{if(!g||o.name.toLowerCase().includes(g))return!0;const a=C.get(o.virtual_mcp_id);return!!(a&&a.title.toLowerCase().includes(g))}),P=(o,a)=>{const y=C.has(a)?a:G(n.id);A("automations_list_row_clicked",{automation_id:o,agent_id:y,source:"settings_automations"}),k(y,{search:{main:"automation:"+o}})};let m;t[0]!==d||t[1]!==n.slug?(m=()=>{A("automations_empty_state_browse_agents_clicked"),d({to:"/$org/settings/agents",params:{org:n.slug}})},t[0]=d,t[1]=n.slug,t[2]=m):m=t[2];const z=m,x=p,h=p,j=p;let c;t[3]===Symbol.for("react.memo_cache_sentinel")?(c=e.jsx(p.Title,{children:"Automations"}),t[3]=c):c=t[3];const w=u.length>0&&e.jsx(O,{value:f,onChange:E,placeholder:"Search automations...",className:"w-full md:w-[375px]"});let s;t[4]!==w?(s=e.jsxs("div",{className:"flex flex-col gap-6",children:[c,w]}),t[4]=w,t[5]=s):s=t[5];const v=u.length===0?e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsx(b,{image:e.jsx(S,{size:48,className:"text-muted-foreground"}),title:"No automations yet",description:"Automations are created per agent. Open an agent and add one from its Automations tab.",actions:e.jsxs($,{size:"sm",onClick:z,children:[e.jsx(D,{size:14}),"Browse agents"]})})}):N.length===0?e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsx(b,{image:e.jsx(S,{size:48,className:"text-muted-foreground"}),title:"No automations found",description:`No automations match "${f}"`})}):e.jsx("div",{className:"mt-6 rounded-xl border border-border overflow-hidden",children:N.map(o=>e.jsx(q,{automation:o,showAgent:!0,onClick:()=>P(o.id,o.virtual_mcp_id)},o.id))});let i;t[6]!==j.Body||t[7]!==s||t[8]!==v?(i=e.jsxs(j.Body,{children:[s,v]}),t[6]=j.Body,t[7]=s,t[8]=v,t[9]=i):i=t[9];let r;t[10]!==h.Content||t[11]!==i?(r=e.jsx(h.Content,{children:i}),t[10]=h.Content,t[11]=i,t[12]=r):r=t[12];let l;return t[13]!==x||t[14]!==r?(l=e.jsx(x,{children:r}),t[13]=x,t[14]=r,t[15]=l):l=t[15],l}function I(t){return[t.id,t]}export{Dt as default};
1
+ import{e as L,s as R,f as T,r as M,j as e,B as $,t as A}from"./index-B3N0ijMe.js";import{s as D}from"./Plus-D1tHeJo2.js";import{i as S}from"./Zap-N-AnbCTG.js";import{S as O}from"./search-input-DUMgPofa.js";import{P as p}from"./index-Bn0UKgPw.js";import{E as b}from"./empty-state-ChZyciKg.js";import{c as V,A as q}from"./automation-list-row-BY-_98AX.js";import{a as F}from"./use-navigate-to-agent-Cz6wq5hE.js";import{e as G}from"./constants-CmcFrIt1.js";import{b as H}from"./use-virtual-mcp-fhETXyqA.js";import"./SearchMd-eCR8N7AG.js";import"./sidebar-DC8b4t6M.js";import"./LayoutLeft-BuJA8_jK.js";import"./tooltip-D_KYUaTY.js";import"./X-C63lgCLS.js";import"./alert-dialog-BTkTE2x9.js";import"./dropdown-menu-B6XbAhub.js";import"./Check-Ccw422Wb.js";import"./ChevronRight-CeUhrzuf.js";import"./DotsVertical-BV7jVmIB.js";import"./agent-icon-CGz6_qSV.js";import"./AlertCircle-CUtXIfwC.js";import"./Tool01-DmFqON6q.js";import"./Archive-Btl9BXLu.js";import"./XClose-DA8jbEWY.js";import"./RefreshCcw01-BESGm5a8.js";import"./ArrowNarrowLeft-CVkIxPAV.js";import"./XCircle-BkB1Kg5O.js";import"./ArrowUpRight-BrfnA0N_.js";import"./ZapSquare-Biue2YhF.js";import"./Users03-y_ec4Rh1.js";import"./CheckCircle-C3sPsdSO.js";import"./ChevronDown-cpZNJlz9.js";import"./ChevronUp-C-rBrlqd.js";import"./Container-OQiFme-7.js";import"./Star01-nv1oI22I.js";import"./Palette-By9pNqp1.js";import"./LinkExternal01-CRxfzQ_Z.js";import"./Lock01-D2YNxdLq.js";import"./Sun-hmutQjwc.js";import"./Play-CcNC_puc.js";import"./Settings02-xGJb-3cc.js";import"./Shield01-CA7f1yxn.js";import"./Trash01-IeycYlZQ.js";import"./User01-CnizOinw.js";import"./use-collections-Cqjc7P8G.js";function Dt(){const t=L.c(16),{org:n}=R(),{data:_}=V(void 0),u=_===void 0?[]:_,B=H(),k=F(),d=T(),[f,E]=M.useState(""),g=f.toLowerCase(),C=new Map(B.map(I)),N=u.filter(o=>{if(!g||o.name.toLowerCase().includes(g))return!0;const a=C.get(o.virtual_mcp_id);return!!(a&&a.title.toLowerCase().includes(g))}),P=(o,a)=>{const y=C.has(a)?a:G(n.id);A("automations_list_row_clicked",{automation_id:o,agent_id:y,source:"settings_automations"}),k(y,{search:{main:"automation:"+o}})};let m;t[0]!==d||t[1]!==n.slug?(m=()=>{A("automations_empty_state_browse_agents_clicked"),d({to:"/$org/settings/agents",params:{org:n.slug}})},t[0]=d,t[1]=n.slug,t[2]=m):m=t[2];const z=m,x=p,h=p,j=p;let c;t[3]===Symbol.for("react.memo_cache_sentinel")?(c=e.jsx(p.Title,{children:"Automations"}),t[3]=c):c=t[3];const w=u.length>0&&e.jsx(O,{value:f,onChange:E,placeholder:"Search automations...",className:"w-full md:w-[375px]"});let s;t[4]!==w?(s=e.jsxs("div",{className:"flex flex-col gap-6",children:[c,w]}),t[4]=w,t[5]=s):s=t[5];const v=u.length===0?e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsx(b,{image:e.jsx(S,{size:48,className:"text-muted-foreground"}),title:"No automations yet",description:"Automations are created per agent. Open an agent and add one from its Automations tab.",actions:e.jsxs($,{size:"sm",onClick:z,children:[e.jsx(D,{size:14}),"Browse agents"]})})}):N.length===0?e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsx(b,{image:e.jsx(S,{size:48,className:"text-muted-foreground"}),title:"No automations found",description:`No automations match "${f}"`})}):e.jsx("div",{className:"mt-6 rounded-xl border border-border overflow-hidden",children:N.map(o=>e.jsx(q,{automation:o,showAgent:!0,onClick:()=>P(o.id,o.virtual_mcp_id)},o.id))});let i;t[6]!==j.Body||t[7]!==s||t[8]!==v?(i=e.jsxs(j.Body,{children:[s,v]}),t[6]=j.Body,t[7]=s,t[8]=v,t[9]=i):i=t[9];let r;t[10]!==h.Content||t[11]!==i?(r=e.jsx(h.Content,{children:i}),t[10]=h.Content,t[11]=i,t[12]=r):r=t[12];let l;return t[13]!==x||t[14]!==r?(l=e.jsx(x,{children:r}),t[13]=x,t[14]=r,t[15]=l):l=t[15],l}function I(t){return[t.id,t]}export{Dt as default};
@@ -1 +1 @@
1
- import{e as k,j as i,r as V,c as m,aW as S,cf as $,cg as O,ch as U}from"./index-Bq8MNgeV.js";import{s as L}from"./User01-Cuf_FrNk.js";function M(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=m("relative flex size-8 shrink-0 overflow-hidden rounded-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx(U,{"data-slot":"avatar",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}function T(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=m("aspect-square size-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx($,{"data-slot":"avatar-image",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}function W(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=m("bg-muted flex size-full items-center justify-center rounded-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx(O,{"data-slot":"avatar-fallback",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}const R=["drop-shadow-lg bg-gradient-to-br from-red-100 to-red-300 text-red-800 shadow-lg shadow-red-300/40 ring-1 ring-red-300/30","drop-shadow-lg bg-gradient-to-br from-lime-100 to-lime-300 text-lime-800 shadow-lg shadow-lime-300/40 ring-1 ring-lime-300/30","drop-shadow-lg bg-gradient-to-br from-emerald-100 to-emerald-300 text-emerald-800 shadow-lg shadow-emerald-300/40 ring-1 ring-emerald-300/30","drop-shadow-lg bg-gradient-to-br from-orange-100 to-orange-300 text-orange-800 shadow-lg shadow-orange-300/40 ring-1 ring-orange-300/30","drop-shadow-lg bg-gradient-to-br from-amber-100 to-amber-300 text-amber-800 shadow-lg shadow-amber-300/40 ring-1 ring-amber-300/30","drop-shadow-lg bg-gradient-to-br from-yellow-100 to-yellow-300 text-yellow-800 shadow-lg shadow-yellow-300/40 ring-1 ring-yellow-300/30","drop-shadow-lg bg-gradient-to-br from-green-100 to-green-300 text-green-800 shadow-lg shadow-green-300/40 ring-1 ring-green-300/30","drop-shadow-lg bg-gradient-to-br from-teal-100 to-teal-300 text-teal-800 shadow-lg shadow-teal-300/40 ring-1 ring-teal-300/30","drop-shadow-lg bg-gradient-to-br from-cyan-100 to-cyan-300 text-cyan-800 shadow-lg shadow-cyan-300/40 ring-1 ring-cyan-300/30","drop-shadow-lg bg-gradient-to-br from-sky-100 to-sky-300 text-sky-800 shadow-lg shadow-sky-300/40 ring-1 ring-sky-300/30","drop-shadow-lg bg-gradient-to-br from-blue-100 to-blue-300 text-blue-800 shadow-lg shadow-blue-300/40 ring-1 ring-blue-300/30","drop-shadow-lg bg-gradient-to-br from-indigo-100 to-indigo-300 text-indigo-800 shadow-lg shadow-indigo-300/40 ring-1 ring-indigo-300/30","drop-shadow-lg bg-gradient-to-br from-violet-100 to-violet-300 text-violet-800 shadow-lg shadow-violet-300/40 ring-1 ring-violet-300/30","drop-shadow-lg bg-gradient-to-br from-purple-100 to-purple-300 text-purple-800 shadow-lg shadow-purple-300/40 ring-1 ring-purple-300/30","drop-shadow-lg bg-gradient-to-br from-fuchsia-100 to-fuchsia-300 text-fuchsia-800 shadow-lg shadow-fuchsia-300/40 ring-1 ring-fuchsia-300/30","drop-shadow-lg bg-gradient-to-br from-pink-100 to-pink-300 text-pink-800 shadow-lg shadow-pink-300/40 ring-1 ring-pink-300/30","drop-shadow-lg bg-gradient-to-br from-rose-100 to-rose-300 text-rose-800 shadow-lg shadow-rose-300/40 ring-1 ring-rose-300/30"],_="drop-shadow-lg text-muted-foreground bg-muted shadow-lg";function D(r){let e=0;for(let t=0;t<r.length;t++)e=r.charCodeAt(t)+((e<<5)-e);const s=Math.abs(e)%R.length;return R[s]}const I=S("border border-border",{variants:{shape:{circle:"rounded-full",square:""},size:{"3xs":"w-3 h-3 text-[7px] font-semibold","2xs":"w-4 h-4 text-[9px] font-semibold",xs:"w-6 h-6 text-sm font-semibold",sm:"w-8 h-8 text-lg font-semibold",base:"w-10 h-10 text-2xl font-semibold",lg:"w-12 h-12 text-3xl font-semibold",xl:"w-16 h-16 text-4xl font-semibold","2xl":"w-20 h-20 text-5xl font-semibold","3xl":"w-32 h-32 text-7xl font-semibold"}},compoundVariants:[{shape:"square",size:"xs",class:"rounded-lg"},{shape:"square",size:"sm",class:"rounded-xl"},{shape:"square",size:"base",class:"rounded-xl"},{shape:"square",size:"lg",class:"rounded-xl"},{shape:"square",size:"xl",class:"rounded-2xl"},{shape:"square",size:"2xl",class:"rounded-3xl"},{shape:"square",size:"3xl",class:"rounded-[40px]"}],defaultVariants:{shape:"square",size:"base"}}),B=S("",{variants:{objectFit:{contain:"object-contain",cover:"object-cover"}},defaultVariants:{objectFit:"cover"}}),G=r=>{const e={"3xs":8,"2xs":8,xs:12,sm:16,base:24,lg:28,xl:36,"2xl":48,"3xl":80};return e[r]||e.base};function H(r){const e=k.c(35);let s,t,o,a,n,d,g,l;e[0]!==r?({url:l,fallback:t,shape:a,size:n,objectFit:d,className:s,muted:g,...o}=r,e[0]=r,e[1]=s,e[2]=t,e[3]=o,e[4]=a,e[5]=n,e[6]=d,e[7]=g,e[8]=l):(s=e[1],t=e[2],o=e[3],a=e[4],n=e[5],d=e[6],g=e[7],l=e[8]);const b=a===void 0?"square":a,h=n===void 0?"base":n,u=d===void 0?"cover":d,j=g===void 0?!1:g,[f,x]=V.useState(!1);let F;e:{if(typeof t=="string"){let c;e[9]!==t?(c=t.trim().slice(0,2).toUpperCase(),e[9]=t,e[10]=c):c=e[10],F=c;break e}F=t}const C=F;let z;e:{if(j){z=_;break e}if(typeof t=="string"){let c;e[11]!==t?(c=D(t),e[11]=t,e[12]=c):c=e[12],z=c;break e}z=R[0]}const y=z;let N;e[13]!==l?(N=l?.startsWith("icon://"),e[13]=l,e[14]=N):N=e[14];const p=N;let q;e[15]!==p||e[16]!==l?(q=p?l?.replace("icon://",""):void 0,e[15]=p,e[16]=l,e[17]=q):q=e[17];const E=q;let w;e[18]!==s||e[19]!==b||e[20]!==h?(w=m(I({shape:b,size:h}),s),e[18]=s,e[19]=b,e[20]=h,e[21]=w):w=e[21];let v;e[22]!==y||e[23]!==C||e[24]!==E||e[25]!==f||e[26]!==p||e[27]!==u||e[28]!==h||e[29]!==l?(v=p&&E?i.jsx("div",{className:m("flex items-center justify-center w-full h-full",y),children:i.jsx(L,{size:G(h)})}):i.jsxs(i.Fragment,{children:[l&&!f&&i.jsx(T,{src:l,loading:"lazy",alt:"Avatar",className:m(B({objectFit:u})),onError:()=>x(!0)}),(!l||f)&&i.jsx(W,{className:m(y,"rounded-none"),children:C})]}),e[22]=y,e[23]=C,e[24]=E,e[25]=f,e[26]=p,e[27]=u,e[28]=h,e[29]=l,e[30]=v):v=e[30];let A;return e[31]!==o||e[32]!==v||e[33]!==w?(A=i.jsx(M,{className:w,...o,children:v}),e[31]=o,e[32]=v,e[33]=w,e[34]=A):A=e[34],A}function J(r){const e=k.c(18);let s,t,o,a,n,d,g,l;e[0]!==r?({shape:a,size:n,url:l,fallback:t,objectFit:d,className:s,muted:g,...o}=r,e[0]=r,e[1]=s,e[2]=t,e[3]=o,e[4]=a,e[5]=n,e[6]=d,e[7]=g,e[8]=l):(s=e[1],t=e[2],o=e[3],a=e[4],n=e[5],d=e[6],g=e[7],l=e[8]);const b=a===void 0?"square":a,h=n===void 0?"base":n,u=d===void 0?"cover":d,j=g===void 0?!1:g,f=h??"base";let x;return e[9]!==s||e[10]!==t||e[11]!==j||e[12]!==u||e[13]!==o||e[14]!==b||e[15]!==f||e[16]!==l?(x=i.jsx(H,{shape:b,url:l,fallback:t,size:f,objectFit:u,className:s,muted:j,...o}),e[9]=s,e[10]=t,e[11]=j,e[12]=u,e[13]=o,e[14]=b,e[15]=f,e[16]=l,e[17]=x):x=e[17],x}J.Skeleton=function({shape:e="square",size:s="base",className:t}){return i.jsx("div",{className:m(I({shape:e,size:s}),"bg-muted animate-pulse",t)})};export{J as A};
1
+ import{e as k,j as i,r as V,c as m,aW as S,cf as $,cg as O,ch as U}from"./index-B3N0ijMe.js";import{s as L}from"./User01-CnizOinw.js";function M(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=m("relative flex size-8 shrink-0 overflow-hidden rounded-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx(U,{"data-slot":"avatar",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}function T(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=m("aspect-square size-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx($,{"data-slot":"avatar-image",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}function W(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=m("bg-muted flex size-full items-center justify-center rounded-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx(O,{"data-slot":"avatar-fallback",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}const R=["drop-shadow-lg bg-gradient-to-br from-red-100 to-red-300 text-red-800 shadow-lg shadow-red-300/40 ring-1 ring-red-300/30","drop-shadow-lg bg-gradient-to-br from-lime-100 to-lime-300 text-lime-800 shadow-lg shadow-lime-300/40 ring-1 ring-lime-300/30","drop-shadow-lg bg-gradient-to-br from-emerald-100 to-emerald-300 text-emerald-800 shadow-lg shadow-emerald-300/40 ring-1 ring-emerald-300/30","drop-shadow-lg bg-gradient-to-br from-orange-100 to-orange-300 text-orange-800 shadow-lg shadow-orange-300/40 ring-1 ring-orange-300/30","drop-shadow-lg bg-gradient-to-br from-amber-100 to-amber-300 text-amber-800 shadow-lg shadow-amber-300/40 ring-1 ring-amber-300/30","drop-shadow-lg bg-gradient-to-br from-yellow-100 to-yellow-300 text-yellow-800 shadow-lg shadow-yellow-300/40 ring-1 ring-yellow-300/30","drop-shadow-lg bg-gradient-to-br from-green-100 to-green-300 text-green-800 shadow-lg shadow-green-300/40 ring-1 ring-green-300/30","drop-shadow-lg bg-gradient-to-br from-teal-100 to-teal-300 text-teal-800 shadow-lg shadow-teal-300/40 ring-1 ring-teal-300/30","drop-shadow-lg bg-gradient-to-br from-cyan-100 to-cyan-300 text-cyan-800 shadow-lg shadow-cyan-300/40 ring-1 ring-cyan-300/30","drop-shadow-lg bg-gradient-to-br from-sky-100 to-sky-300 text-sky-800 shadow-lg shadow-sky-300/40 ring-1 ring-sky-300/30","drop-shadow-lg bg-gradient-to-br from-blue-100 to-blue-300 text-blue-800 shadow-lg shadow-blue-300/40 ring-1 ring-blue-300/30","drop-shadow-lg bg-gradient-to-br from-indigo-100 to-indigo-300 text-indigo-800 shadow-lg shadow-indigo-300/40 ring-1 ring-indigo-300/30","drop-shadow-lg bg-gradient-to-br from-violet-100 to-violet-300 text-violet-800 shadow-lg shadow-violet-300/40 ring-1 ring-violet-300/30","drop-shadow-lg bg-gradient-to-br from-purple-100 to-purple-300 text-purple-800 shadow-lg shadow-purple-300/40 ring-1 ring-purple-300/30","drop-shadow-lg bg-gradient-to-br from-fuchsia-100 to-fuchsia-300 text-fuchsia-800 shadow-lg shadow-fuchsia-300/40 ring-1 ring-fuchsia-300/30","drop-shadow-lg bg-gradient-to-br from-pink-100 to-pink-300 text-pink-800 shadow-lg shadow-pink-300/40 ring-1 ring-pink-300/30","drop-shadow-lg bg-gradient-to-br from-rose-100 to-rose-300 text-rose-800 shadow-lg shadow-rose-300/40 ring-1 ring-rose-300/30"],_="drop-shadow-lg text-muted-foreground bg-muted shadow-lg";function D(r){let e=0;for(let t=0;t<r.length;t++)e=r.charCodeAt(t)+((e<<5)-e);const s=Math.abs(e)%R.length;return R[s]}const I=S("border border-border",{variants:{shape:{circle:"rounded-full",square:""},size:{"3xs":"w-3 h-3 text-[7px] font-semibold","2xs":"w-4 h-4 text-[9px] font-semibold",xs:"w-6 h-6 text-sm font-semibold",sm:"w-8 h-8 text-lg font-semibold",base:"w-10 h-10 text-2xl font-semibold",lg:"w-12 h-12 text-3xl font-semibold",xl:"w-16 h-16 text-4xl font-semibold","2xl":"w-20 h-20 text-5xl font-semibold","3xl":"w-32 h-32 text-7xl font-semibold"}},compoundVariants:[{shape:"square",size:"xs",class:"rounded-lg"},{shape:"square",size:"sm",class:"rounded-xl"},{shape:"square",size:"base",class:"rounded-xl"},{shape:"square",size:"lg",class:"rounded-xl"},{shape:"square",size:"xl",class:"rounded-2xl"},{shape:"square",size:"2xl",class:"rounded-3xl"},{shape:"square",size:"3xl",class:"rounded-[40px]"}],defaultVariants:{shape:"square",size:"base"}}),B=S("",{variants:{objectFit:{contain:"object-contain",cover:"object-cover"}},defaultVariants:{objectFit:"cover"}}),G=r=>{const e={"3xs":8,"2xs":8,xs:12,sm:16,base:24,lg:28,xl:36,"2xl":48,"3xl":80};return e[r]||e.base};function H(r){const e=k.c(35);let s,t,o,a,n,d,g,l;e[0]!==r?({url:l,fallback:t,shape:a,size:n,objectFit:d,className:s,muted:g,...o}=r,e[0]=r,e[1]=s,e[2]=t,e[3]=o,e[4]=a,e[5]=n,e[6]=d,e[7]=g,e[8]=l):(s=e[1],t=e[2],o=e[3],a=e[4],n=e[5],d=e[6],g=e[7],l=e[8]);const b=a===void 0?"square":a,h=n===void 0?"base":n,u=d===void 0?"cover":d,j=g===void 0?!1:g,[f,x]=V.useState(!1);let F;e:{if(typeof t=="string"){let c;e[9]!==t?(c=t.trim().slice(0,2).toUpperCase(),e[9]=t,e[10]=c):c=e[10],F=c;break e}F=t}const C=F;let z;e:{if(j){z=_;break e}if(typeof t=="string"){let c;e[11]!==t?(c=D(t),e[11]=t,e[12]=c):c=e[12],z=c;break e}z=R[0]}const y=z;let N;e[13]!==l?(N=l?.startsWith("icon://"),e[13]=l,e[14]=N):N=e[14];const p=N;let q;e[15]!==p||e[16]!==l?(q=p?l?.replace("icon://",""):void 0,e[15]=p,e[16]=l,e[17]=q):q=e[17];const E=q;let w;e[18]!==s||e[19]!==b||e[20]!==h?(w=m(I({shape:b,size:h}),s),e[18]=s,e[19]=b,e[20]=h,e[21]=w):w=e[21];let v;e[22]!==y||e[23]!==C||e[24]!==E||e[25]!==f||e[26]!==p||e[27]!==u||e[28]!==h||e[29]!==l?(v=p&&E?i.jsx("div",{className:m("flex items-center justify-center w-full h-full",y),children:i.jsx(L,{size:G(h)})}):i.jsxs(i.Fragment,{children:[l&&!f&&i.jsx(T,{src:l,loading:"lazy",alt:"Avatar",className:m(B({objectFit:u})),onError:()=>x(!0)}),(!l||f)&&i.jsx(W,{className:m(y,"rounded-none"),children:C})]}),e[22]=y,e[23]=C,e[24]=E,e[25]=f,e[26]=p,e[27]=u,e[28]=h,e[29]=l,e[30]=v):v=e[30];let A;return e[31]!==o||e[32]!==v||e[33]!==w?(A=i.jsx(M,{className:w,...o,children:v}),e[31]=o,e[32]=v,e[33]=w,e[34]=A):A=e[34],A}function J(r){const e=k.c(18);let s,t,o,a,n,d,g,l;e[0]!==r?({shape:a,size:n,url:l,fallback:t,objectFit:d,className:s,muted:g,...o}=r,e[0]=r,e[1]=s,e[2]=t,e[3]=o,e[4]=a,e[5]=n,e[6]=d,e[7]=g,e[8]=l):(s=e[1],t=e[2],o=e[3],a=e[4],n=e[5],d=e[6],g=e[7],l=e[8]);const b=a===void 0?"square":a,h=n===void 0?"base":n,u=d===void 0?"cover":d,j=g===void 0?!1:g,f=h??"base";let x;return e[9]!==s||e[10]!==t||e[11]!==j||e[12]!==u||e[13]!==o||e[14]!==b||e[15]!==f||e[16]!==l?(x=i.jsx(H,{shape:b,url:l,fallback:t,size:f,objectFit:u,className:s,muted:j,...o}),e[9]=s,e[10]=t,e[11]=j,e[12]=u,e[13]=o,e[14]=b,e[15]=f,e[16]=l,e[17]=x):x=e[17],x}J.Skeleton=function({shape:e="square",size:s="base",className:t}){return i.jsx("div",{className:m(I({shape:e,size:s}),"bg-muted animate-pulse",t)})};export{J as A};
@@ -1 +1 @@
1
- import{e as u,c as l,j as g,aX as v,aW as b}from"./index-Bq8MNgeV.js";const f=b("inline-flex items-center justify-center rounded-full border text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/20 focus-visible:ring-[2px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",success:"border-transparent bg-success text-success-foreground [a&]:hover:bg-success/90 focus-visible:ring-success/20 dark:focus-visible:ring-success/40",warning:"border-transparent bg-warning text-warning-foreground [a&]:hover:bg-warning/90 focus-visible:ring-warning/20 dark:focus-visible:ring-warning/40",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"},size:{default:"px-2 py-0.5",icon:"size-5"}},defaultVariants:{variant:"default",size:"default"}});function h(c){const e=u.c(14);let r,s,i,n,t;e[0]!==c?({className:r,variant:t,size:i,asChild:n,...s}=c,e[0]=c,e[1]=r,e[2]=s,e[3]=i,e[4]=n,e[5]=t):(r=e[1],s=e[2],i=e[3],n=e[4],t=e[5]);const d=(n===void 0?!1:n)?v:"span";let a;e[6]!==r||e[7]!==i||e[8]!==t?(a=l(f({variant:t,size:i}),r),e[6]=r,e[7]=i,e[8]=t,e[9]=a):a=e[9];let o;return e[10]!==d||e[11]!==s||e[12]!==a?(o=g.jsx(d,{"data-slot":"badge",className:a,...s}),e[10]=d,e[11]=s,e[12]=a,e[13]=o):o=e[13],o}export{h as B};
1
+ import{e as u,c as l,j as g,aX as v,aW as b}from"./index-B3N0ijMe.js";const f=b("inline-flex items-center justify-center rounded-full border text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/20 focus-visible:ring-[2px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",success:"border-transparent bg-success text-success-foreground [a&]:hover:bg-success/90 focus-visible:ring-success/20 dark:focus-visible:ring-success/40",warning:"border-transparent bg-warning text-warning-foreground [a&]:hover:bg-warning/90 focus-visible:ring-warning/20 dark:focus-visible:ring-warning/40",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"},size:{default:"px-2 py-0.5",icon:"size-5"}},defaultVariants:{variant:"default",size:"default"}});function h(c){const e=u.c(14);let r,s,i,n,t;e[0]!==c?({className:r,variant:t,size:i,asChild:n,...s}=c,e[0]=c,e[1]=r,e[2]=s,e[3]=i,e[4]=n,e[5]=t):(r=e[1],s=e[2],i=e[3],n=e[4],t=e[5]);const d=(n===void 0?!1:n)?v:"span";let a;e[6]!==r||e[7]!==i||e[8]!==t?(a=l(f({variant:t,size:i}),r),e[6]=r,e[7]=i,e[8]=t,e[9]=a):a=e[9];let o;return e[10]!==d||e[11]!==s||e[12]!==a?(o=g.jsx(d,{"data-slot":"badge",className:a,...s}),e[10]=d,e[11]=s,e[12]=a,e[13]=o):o=e[13],o}export{h as B};
@@ -1 +1 @@
1
- import{e as X,$ as Ie,s as ze,o as Le,K as $e,n as Ke,a as ge,j as n,B as Te,t as V,x as U,r as Oe,z as Ue,c as _e,C as fe}from"./index-Bq8MNgeV.js";import{S as Xe,u as He}from"./constants-ClujOLL0.js";import{t as Me}from"./ChevronDown-B2rzld2y.js";import{i as qe}from"./ChevronRight-E3ry5bv1.js";import{s as Ve,t as Qe}from"./Star01-D7-_AozX.js";import{n as Ge}from"./LinkExternal01-CqYIOZ9A.js";import{s as Pe}from"./Plus-Dld8jPbl.js";import{s as Ye}from"./Trash01-CWiWK8tz.js";import{i as Je}from"./Zap-DkdmeY_3.js";import{c as We,b as Ze,d as et,f as tt,g as st,e as nt,a as lt,A as ot}from"./alert-dialog-CoBaZf61.js";import{I as ue}from"./input-DTt32vul.js";import{T as rt}from"./textarea-D4e6a8Nz.js";import{P as Ne}from"./index-DF2eiQ1x.js";import{u as Re}from"./unwrap-tool-result-BYXdCQMg.js";import{u as at}from"./use-debounced-autosave-CyEn9Ro2.js";import"./sidebar-CaCy2pvj.js";import"./LayoutLeft-O15r8yaV.js";import"./tooltip-Cop6BWIB.js";import"./X-DCaJ2DR_.js";function we(t){const e=X.c(8),{title:s,children:o,className:l}=t;let r;e[0]!==l?(r=_e("rounded-2xl border border-border/60 bg-background p-5",l),e[0]=l,e[1]=r):r=e[1];let i;e[2]!==s?(i=n.jsx("div",{className:"mb-4",children:n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:s})}),e[2]=s,e[3]=i):i=e[3];let d;return e[4]!==o||e[5]!==r||e[6]!==i?(d=n.jsxs("div",{className:r,children:[i,o]}),e[4]=o,e[5]=r,e[6]=i,e[7]=d):d=e[7],d}function it(t){const e=X.c(25),{onExtract:s,isExtracting:o}=t,[l,r]=Oe.useState("");let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-primary/10",children:n.jsx(Je,{size:18,className:"text-primary"})}),e[0]=i):i=e[0];let d,u;e[1]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx("p",{className:"text-sm font-medium text-foreground",children:"Auto-extract brand context"}),u=n.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Enter your website URL and we'll automatically extract your brand colors, fonts, logos, and company overview."}),e[1]=d,e[2]=u):(d=e[1],u=e[2]);let p;e[3]===Symbol.for("react.memo_cache_sentinel")?(p=f=>r(f.target.value),e[3]=p):p=e[3];let b;e[4]!==l||e[5]!==o||e[6]!==s?(b=f=>{f.key==="Enter"&&l.trim()&&!o&&s(l.trim())},e[4]=l,e[5]=o,e[6]=s,e[7]=b):b=e[7];let m;e[8]!==l||e[9]!==b?(m=n.jsx(ue,{placeholder:"acme.com",value:l,onChange:p,className:"max-w-xs",onKeyDown:b}),e[8]=l,e[9]=b,e[10]=m):m=e[10];let c;e[11]!==l||e[12]!==o?(c=!l.trim()||o,e[11]=l,e[12]=o,e[13]=c):c=e[13];let a;e[14]!==l||e[15]!==s?(a=()=>s(l.trim()),e[14]=l,e[15]=s,e[16]=a):a=e[16];let x;e[17]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(Ve,{size:14}),e[17]=x):x=e[17];const g=o?"Extracting...":"Extract";let h;e[18]!==g||e[19]!==c||e[20]!==a?(h=n.jsxs(Te,{variant:"outline",disabled:c,onClick:a,children:[x,g]}),e[18]=g,e[19]=c,e[20]=a,e[21]=h):h=e[21];let v;return e[22]!==h||e[23]!==m?(v=n.jsx("div",{className:"rounded-2xl border border-dashed border-border bg-muted/30 p-5",children:n.jsxs("div",{className:"flex items-start gap-4",children:[i,n.jsxs("div",{className:"flex-1",children:[d,u,n.jsxs("div",{className:"mt-3 flex gap-2",children:[m,h]})]})]})}),e[22]=h,e[23]=m,e[24]=v):v=e[24],v}function ct(t){const e=X.c(36),{form:s,onFieldChange:o,onFieldCommit:l}=t;let r;e[0]!==s?(r=s.watch("domain"),e[0]=s,e[1]=r):r=e[1];const i=r;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx("label",{className:"mb-1 block text-xs text-muted-foreground",children:"Company name"}),e[2]=d):d=e[2];let u;e[3]!==o||e[4]!==l?(u=D=>{const{field:y}=D;return n.jsx(ue,{...y,onChange:N=>{y.onChange(N),o()},onBlur:()=>{y.onBlur(),l()},placeholder:"Acme Corp"})},e[3]=o,e[4]=l,e[5]=u):u=e[5];let p;e[6]!==s.control||e[7]!==u?(p=n.jsxs("div",{children:[d,n.jsx(fe,{control:s.control,name:"name",render:u})]}),e[6]=s.control,e[7]=u,e[8]=p):p=e[8];let b;e[9]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx("span",{children:"Domain"}),e[9]=b):b=e[9];let m;e[10]!==i?(m=i&&n.jsxs("a",{href:`https://${i}`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 transition-colors hover:text-foreground",children:[n.jsx(Ge,{size:10}),"open"]}),e[10]=i,e[11]=m):m=e[11];let c;e[12]!==m?(c=n.jsxs("label",{className:"mb-1 flex items-center justify-between text-xs text-muted-foreground",children:[b,m]}),e[12]=m,e[13]=c):c=e[13];let a;e[14]!==o||e[15]!==l?(a=D=>{const{field:y}=D;return n.jsx(ue,{...y,onChange:N=>{y.onChange(N),o()},onBlur:()=>{y.onBlur(),l()},placeholder:"acme.com"})},e[14]=o,e[15]=l,e[16]=a):a=e[16];let x;e[17]!==s.control||e[18]!==a?(x=n.jsx(fe,{control:s.control,name:"domain",render:a}),e[17]=s.control,e[18]=a,e[19]=x):x=e[19];let g;e[20]!==c||e[21]!==x?(g=n.jsxs("div",{children:[c,x]}),e[20]=c,e[21]=x,e[22]=g):g=e[22];let h;e[23]!==g||e[24]!==p?(h=n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[p,g]}),e[23]=g,e[24]=p,e[25]=h):h=e[25];let v;e[26]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx("label",{className:"mb-1 block text-xs text-muted-foreground",children:"Overview"}),e[26]=v):v=e[26];let f;e[27]!==o||e[28]!==l?(f=D=>{const{field:y}=D;return n.jsx(rt,{...y,onChange:N=>{y.onChange(N),o()},onBlur:()=>{y.onBlur(),l()},placeholder:"Brief description of what the company does...",rows:3})},e[27]=o,e[28]=l,e[29]=f):f=e[29];let C;e[30]!==s.control||e[31]!==f?(C=n.jsxs("div",{children:[v,n.jsx(fe,{control:s.control,name:"overview",render:f})]}),e[30]=s.control,e[31]=f,e[32]=C):C=e[32];let w;return e[33]!==h||e[34]!==C?(w=n.jsx(we,{title:"Company Overview",children:n.jsxs("div",{className:"space-y-3",children:[h,C]})}),e[33]=h,e[34]=C,e[35]=w):w=e[35],w}const dt={backgroundImage:"linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%), linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%)",backgroundSize:"8px 8px",backgroundPosition:"0 0, 4px 4px",backgroundColor:"#fff"};function Ae(t){const e=X.c(22),{form:s,name:o,label:l,imgClassName:r,onFieldChange:i,onFieldCommit:d}=t,u=r===void 0?"h-full w-full object-contain p-3":r;let p;e[0]!==s||e[1]!==o?(p=s.watch(o),e[0]=s,e[1]=o,e[2]=p):p=e[2];const b=p;let m;e[3]!==u||e[4]!==l||e[5]!==b?(m=n.jsx("div",{className:"flex aspect-video w-28 shrink-0 items-center justify-center overflow-hidden rounded-xl",style:dt,children:b?n.jsx("img",{src:b,alt:l,className:u,loading:"lazy"}):n.jsxs("span",{className:"text-[10px] text-muted-foreground/70",children:["No ",l.toLowerCase()]})}),e[3]=u,e[4]=l,e[5]=b,e[6]=m):m=e[6];let c;e[7]!==l?(c=n.jsxs("label",{className:"mb-1 block text-xs text-muted-foreground",children:[l," URL"]}),e[7]=l,e[8]=c):c=e[8];let a;e[9]!==i||e[10]!==d?(a=v=>{const{field:f}=v;return n.jsx(ue,{...f,onChange:C=>{f.onChange(C),i()},onBlur:()=>{f.onBlur(),d()},placeholder:"https://..."})},e[9]=i,e[10]=d,e[11]=a):a=e[11];let x;e[12]!==s.control||e[13]!==o||e[14]!==a?(x=n.jsx(fe,{control:s.control,name:o,render:a}),e[12]=s.control,e[13]=o,e[14]=a,e[15]=x):x=e[15];let g;e[16]!==c||e[17]!==x?(g=n.jsxs("div",{className:"flex-1",children:[c,x]}),e[16]=c,e[17]=x,e[18]=g):g=e[18];let h;return e[19]!==m||e[20]!==g?(h=n.jsxs("div",{className:"flex items-start gap-3",children:[m,g]}),e[19]=m,e[20]=g,e[21]=h):h=e[21],h}function mt(t){const e=X.c(4),{form:s,onFieldChange:o,onFieldCommit:l}=t;let r;return e[0]!==s||e[1]!==o||e[2]!==l?(r=n.jsx(we,{title:"Logos & Images",children:n.jsxs("div",{className:"space-y-3",children:[n.jsx(Ae,{form:s,name:"logo",label:"Logo",onFieldChange:o,onFieldCommit:l}),n.jsx(Ae,{form:s,name:"favicon",label:"Favicon",imgClassName:"h-12 w-12 object-contain",onFieldChange:o,onFieldCommit:l}),n.jsx(Ae,{form:s,name:"ogImage",label:"SEO / OG image",imgClassName:"h-full w-full object-contain",onFieldChange:o,onFieldCommit:l})]})}),e[0]=s,e[1]=o,e[2]=l,e[3]=r):r=e[3],r}const ft=[{key:"heading",label:"Headings"},{key:"body",label:"Body"},{key:"code",label:"Code"}];function ut(t){const e=X.c(6),{form:s,onFieldChange:o,onFieldCommit:l}=t;let r;e[0]!==s||e[1]!==o||e[2]!==l?(r=ft.map(d=>{const{key:u,label:p}=d,b=`fonts.${u}`,m=s.watch(b);return n.jsxs("div",{children:[n.jsxs("label",{className:"mb-1 flex items-center gap-3 text-xs text-muted-foreground",children:[n.jsx("span",{className:"w-7 text-base font-medium leading-none text-foreground",children:"Aa"}),n.jsx("span",{children:p}),m&&n.jsx("span",{className:"ml-auto truncate text-foreground",style:{fontFamily:m},children:m})]}),n.jsx(fe,{control:s.control,name:b,render:c=>{const{field:a}=c;return n.jsx(ue,{...a,value:a.value??"",onChange:x=>{a.onChange(x),o()},onBlur:()=>{a.onBlur(),l()},placeholder:`Font family for ${p.toLowerCase()}`})}})]},u)}),e[0]=s,e[1]=o,e[2]=l,e[3]=r):r=e[3];let i;return e[4]!==r?(i=n.jsx(we,{title:"Fonts",children:n.jsx("div",{className:"space-y-2",children:r})}),e[4]=r,e[5]=i):i=e[5],i}const xt=[{key:"primary",label:"Primary"},{key:"secondary",label:"Secondary"},{key:"accent",label:"Accent"},{key:"background",label:"Background"},{key:"foreground",label:"Foreground"}];function gt(t){const e=X.c(6),{form:s,onFieldChange:o,onFieldCommit:l}=t;let r;e[0]!==s||e[1]!==o||e[2]!==l?(r=xt.map(d=>{const{key:u,label:p}=d,b=`colors.${u}`;return n.jsx(fe,{control:s.control,name:b,render:m=>{const{field:c}=m;return n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("input",{type:"color",value:c.value??"#000000",onChange:a=>{c.onChange(a.target.value),o()},onBlur:()=>{c.onBlur(),l()},className:"h-9 w-9 shrink-0 cursor-pointer rounded-lg border border-border bg-transparent p-0.5"}),n.jsx(ue,{value:c.value??"",onChange:a=>{c.onChange(a.target.value),o()},onBlur:()=>{c.onBlur(),l()},placeholder:"#000000",className:"w-28"}),n.jsx("span",{className:"flex-1 text-xs text-muted-foreground",children:p})]})}},u)}),e[0]=s,e[1]=o,e[2]=l,e[3]=r):r=e[3];let i;return e[4]!==r?(i=n.jsx(we,{title:"Colors",children:n.jsx("div",{className:"space-y-2",children:r})}),e[4]=r,e[5]=i):i=e[5],i}function ht(t){const e=X.c(128),{brand:s,client:o,onChanged:l}=t,[r,i]=Oe.useState(s.isDefault??!1),[d,u]=Oe.useState(!1),p=s.name??"",b=s.domain??"",m=s.overview??"",c=s.logo??"",a=s.favicon??"",x=s.ogImage??"";let g;e[0]!==s.fonts?(g=s.fonts??{},e[0]=s.fonts,e[1]=g):g=e[1];let h;e[2]!==s.colors?(h=s.colors??{},e[2]=s.colors,e[3]=h):h=e[3];let v;e[4]!==p||e[5]!==b||e[6]!==m||e[7]!==c||e[8]!==a||e[9]!==x||e[10]!==g||e[11]!==h?(v={values:{name:p,domain:b,overview:m,logo:c,favicon:a,ogImage:x,fonts:g,colors:h}},e[4]=p,e[5]=b,e[6]=m,e[7]=c,e[8]=a,e[9]=x,e[10]=g,e[11]=h,e[12]=v):v=e[12];const f=Ue(v);let C;e[13]!==s.id||e[14]!==s.images||e[15]!==o?(C={mutationFn:async j=>{const ve=Object.values(j.fonts).some(Dt),Ce=Object.values(j.colors).some(wt),Se={id:s.id,name:j.name,domain:j.domain,overview:j.overview,logo:j.logo||null,favicon:j.favicon||null,ogImage:j.ogImage||null,fonts:ve?j.fonts:null,colors:Ce?j.colors:null,images:s.images};await o.callTool({name:"BRAND_CONTEXT_UPDATE",arguments:Se})},onError:_t},e[13]=s.id,e[14]=s.images,e[15]=o,e[16]=C):C=e[16];const w=ge(C);let D;e[17]!==s.id||e[18]!==f||e[19]!==l||e[20]!==w?(D={delayMs:500,save:async()=>{const j=f.control._formState.dirtyFields,ve=Object.keys(j);if(ve.length===0)return;const Ce=f.getValues(),Se=f.control._defaultValues;f.reset(Ce,{keepValues:!0});try{await w.mutateAsync(Ce),V("brand_updated",{brand_id:s.id,fields:ve}),U.success("Brand context updated successfully"),l()}catch{f.reset(Se,{keepValues:!0})}}},e[17]=s.id,e[18]=f,e[19]=l,e[20]=w,e[21]=D):D=e[21];const{schedule:y,flush:N}=at(D);let I;e[22]!==s.id||e[23]!==o?(I=async()=>{await o.callTool({name:"BRAND_CONTEXT_DELETE",arguments:{id:s.id}})},e[22]=s.id,e[23]=o,e[24]=I):I=e[24];let z;e[25]!==s.id||e[26]!==l?(z=()=>{V("brand_deleted",{brand_id:s.id}),u(!1),l(),U.success("Brand deleted")},e[25]=s.id,e[26]=l,e[27]=z):z=e[27];let H;e[28]!==I||e[29]!==z?(H={mutationFn:I,onSuccess:z,onError:Nt},e[28]=I,e[29]=z,e[30]=H):H=e[30];const{mutate:xe,isPending:k}=ge(H);let B;e[31]!==s.id||e[32]!==s.isDefault||e[33]!==o?(B=async()=>{await o.callTool({name:"BRAND_CONTEXT_UPDATE",arguments:{id:s.id,isDefault:!s.isDefault}})},e[31]=s.id,e[32]=s.isDefault,e[33]=o,e[34]=B):B=e[34];let A;e[35]!==s.id||e[36]!==s.isDefault||e[37]!==l?(A=()=>{V(s.isDefault?"brand_unset_as_default":"brand_set_as_default",{brand_id:s.id}),l(),U.success(s.isDefault?"Removed as default brand":"Set as default brand")},e[35]=s.id,e[36]=s.isDefault,e[37]=l,e[38]=A):A=e[38];let T;e[39]!==B||e[40]!==A?(T={mutationFn:B,onSuccess:A,onError:Ct},e[39]=B,e[40]=A,e[41]=T):T=e[41];const{mutate:O}=ge(T),q=s.isDefault?"border-primary/30":"border-border/60";let M;e[42]!==q?(M=_e("rounded-2xl border bg-background",q),e[42]=q,e[43]=M):M=e[43];let $;e[44]!==r?($=()=>i(!r),e[44]=r,e[45]=$):$=e[45];let L;e[46]!==r?(L=n.jsx("span",{className:"shrink-0 text-muted-foreground",children:r?n.jsx(Me,{size:14}):n.jsx(qe,{size:14})}),e[46]=r,e[47]=L):L=e[47];let E;e[48]!==s.logo||e[49]!==s.name?(E=s.logo?n.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center overflow-hidden rounded-lg",style:{backgroundImage:"linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%), linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%)",backgroundSize:"6px 6px",backgroundPosition:"0 0, 3px 3px",backgroundColor:"#fff"},children:n.jsx("img",{src:s.logo,alt:"",className:"h-full w-full object-contain p-1",onError:vt})}):n.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-muted",children:n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:s.name?.charAt(0)?.toUpperCase()||"?"})}),e[48]=s.logo,e[49]=s.name,e[50]=E):E=e[50];const K=s.name||"Untitled Brand";let F;e[51]!==K?(F=n.jsx("span",{className:"text-sm font-medium text-foreground",children:K}),e[51]=K,e[52]=F):F=e[52];let S;e[53]!==s.domain?(S=s.domain&&n.jsx("span",{className:"truncate text-xs text-muted-foreground",children:s.domain}),e[53]=s.domain,e[54]=S):S=e[54];let P;e[55]!==F||e[56]!==S?(P=n.jsxs("div",{className:"flex flex-1 flex-col items-start gap-0.5 overflow-hidden text-left",children:[F,S]}),e[55]=F,e[56]=S,e[57]=P):P=e[57];let _;e[58]!==s.colors||e[59]!==r?(_=!r&&s.colors&&Object.values(s.colors).some(yt)&&n.jsx("div",{className:"flex shrink-0 gap-1",children:Object.entries(s.colors).filter(jt).map(bt)}),e[58]=s.colors,e[59]=r,e[60]=_):_=e[60];let R;e[61]!==s.fonts||e[62]!==r?(R=!r&&s.fonts&&Object.values(s.fonts).some(pt)&&n.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:Object.values(s.fonts).filter(Boolean).join(", ")}),e[61]=s.fonts,e[62]=r,e[63]=R):R=e[63];const De=s.isDefault?"opacity-100":"opacity-0 hover:bg-muted group-hover:opacity-100";let Q;e[64]!==De?(Q=_e("flex h-7 w-7 shrink-0 items-center justify-center rounded-lg transition-opacity",De),e[64]=De,e[65]=Q):Q=e[65];let G,Y;e[66]!==O?(G=j=>{j.stopPropagation(),O()},Y=j=>{j.key==="Enter"&&(j.stopPropagation(),O())},e[66]=O,e[67]=G,e[68]=Y):(G=e[67],Y=e[68]);const ke=s.isDefault?"Unset as default":"Set as default",Be=s.isDefault?"text-primary fill-primary":"text-muted-foreground";let J;e[69]!==Be?(J=_e(Be),e[69]=Be,e[70]=J):J=e[70];let W;e[71]!==J?(W=n.jsx(Qe,{size:13,className:J}),e[71]=J,e[72]=W):W=e[72];let Z;e[73]!==Q||e[74]!==G||e[75]!==Y||e[76]!==ke||e[77]!==W?(Z=n.jsx("span",{role:"button",tabIndex:0,className:Q,onClick:G,onKeyDown:Y,title:ke,children:W}),e[73]=Q,e[74]=G,e[75]=Y,e[76]=ke,e[77]=W,e[78]=Z):Z=e[78];let he,pe;e[79]===Symbol.for("react.memo_cache_sentinel")?(he=j=>{j.stopPropagation(),u(!0)},pe=j=>{j.key==="Enter"&&(j.stopPropagation(),u(!0))},e[79]=he,e[80]=pe):(he=e[79],pe=e[80]);let be;e[81]===Symbol.for("react.memo_cache_sentinel")?(be=n.jsx("span",{role:"button",tabIndex:0,className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-lg opacity-0 transition-opacity hover:bg-destructive/10 group-hover:opacity-100",onClick:he,onKeyDown:pe,title:"Delete brand",children:n.jsx(Ye,{size:13,className:"text-muted-foreground"})}),e[81]=be):be=e[81];let ee;e[82]!==$||e[83]!==L||e[84]!==E||e[85]!==P||e[86]!==_||e[87]!==R||e[88]!==Z?(ee=n.jsxs("button",{type:"button",className:"flex w-full items-center gap-3 p-5",onClick:$,children:[L,E,P,_,R,Z,be]}),e[82]=$,e[83]=L,e[84]=E,e[85]=P,e[86]=_,e[87]=R,e[88]=Z,e[89]=ee):ee=e[89];let te;e[90]!==r||e[91]!==N||e[92]!==f||e[93]!==y?(te=r&&n.jsxs("div",{className:"space-y-3 px-5 pb-5",children:[n.jsx(ct,{form:f,onFieldChange:y,onFieldCommit:N}),n.jsx(mt,{form:f,onFieldChange:y,onFieldCommit:N}),n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsx(gt,{form:f,onFieldChange:y,onFieldCommit:N}),n.jsx(ut,{form:f,onFieldChange:y,onFieldCommit:N})]})]}),e[90]=r,e[91]=N,e[92]=f,e[93]=y,e[94]=te):te=e[94];let se;e[95]!==k?(se=j=>{!j&&!k&&u(!1)},e[95]=k,e[96]=se):se=e[96];let je;e[97]===Symbol.for("react.memo_cache_sentinel")?(je=n.jsx(We,{children:"Delete brand?"}),e[97]=je):je=e[97];const Ee=s.name||"this brand";let ne;e[98]!==Ee?(ne=n.jsxs("p",{children:["This will permanently delete"," ",n.jsx("span",{className:"font-medium text-foreground",children:Ee}),". This action cannot be undone."]}),e[98]=Ee,e[99]=ne):ne=e[99];let le;e[100]!==s.isDefault?(le=s.isDefault&&n.jsxs("p",{className:"mt-2 rounded-lg border border-destructive/30 bg-destructive/5 p-2 text-destructive",children:[n.jsx("span",{className:"font-medium",children:"Heads up:"})," this is your organization's default brand. Deleting it will leave your organization without a default brand until you set another."]}),e[100]=s.isDefault,e[101]=le):le=e[101];let oe;e[102]!==ne||e[103]!==le?(oe=n.jsxs(Ze,{children:[je,n.jsx(et,{asChild:!0,children:n.jsxs("div",{children:[ne,le]})})]}),e[102]=ne,e[103]=le,e[104]=oe):oe=e[104];let re;e[105]!==k?(re=n.jsx(tt,{disabled:k,children:"Cancel"}),e[105]=k,e[106]=re):re=e[106];let ae;e[107]!==xe?(ae=j=>{j.preventDefault(),xe()},e[107]=xe,e[108]=ae):ae=e[108];const Fe=k?"Deleting...":"Delete";let ie;e[109]!==k||e[110]!==ae||e[111]!==Fe?(ie=n.jsx(st,{onClick:ae,disabled:k,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Fe}),e[109]=k,e[110]=ae,e[111]=Fe,e[112]=ie):ie=e[112];let ce;e[113]!==re||e[114]!==ie?(ce=n.jsxs(nt,{children:[re,ie]}),e[113]=re,e[114]=ie,e[115]=ce):ce=e[115];let de;e[116]!==oe||e[117]!==ce?(de=n.jsxs(lt,{children:[oe,ce]}),e[116]=oe,e[117]=ce,e[118]=de):de=e[118];let me;e[119]!==d||e[120]!==se||e[121]!==de?(me=n.jsx(ot,{open:d,onOpenChange:se,children:de}),e[119]=d,e[120]=se,e[121]=de,e[122]=me):me=e[122];let ye;return e[123]!==M||e[124]!==ee||e[125]!==te||e[126]!==me?(ye=n.jsxs("div",{className:M,children:[ee,te,me]}),e[123]=M,e[124]=ee,e[125]=te,e[126]=me,e[127]=ye):ye=e[127],ye}function pt(t){return t}function bt(t){const[e,s]=t;return n.jsx("div",{className:"h-5 w-5 rounded-full border border-border/40",style:{backgroundColor:s},title:`${e}: ${s}`},e)}function jt(t){const[,e]=t;return e}function yt(t){return t}function vt(t){t.target.style.display="none"}function Ct(){return U.error("Failed to update default brand")}function Nt(){return U.error("Failed to delete brand")}function _t(){return U.error("Failed to save brand context")}function wt(t){return t?.trim()}function Dt(t){return t?.trim()}function kt(){const t=X.c(57),{brandExtractEnabled:e}=Ie(),{org:s}=ze();let o;t[0]!==s.id||t[1]!==s.slug?(o={connectionId:Xe,orgId:s.id,orgSlug:s.slug},t[0]=s.id,t[1]=s.slug,t[2]=o):o=t[2];const l=He(o),r=Le();let i;t[3]!==s.id?(i=$e.brandContext(s.id),t[3]=s.id,t[4]=i):i=t[4];let d;t[5]!==l?(d=async()=>{const _=await l.callTool({name:"BRAND_CONTEXT_LIST",arguments:{includeArchived:!1}}),R=Re(_);return Array.isArray(R?.items)?R.items:[]},t[5]=l,t[6]=d):d=t[6];let u;t[7]!==i||t[8]!==d?(u={queryKey:i,queryFn:d},t[7]=i,t[8]=d,t[9]=u):u=t[9];const{data:p}=Ke(u),m=(p===void 0?[]:p).filter(Ft);let c;t[10]!==s.id||t[11]!==r?(c=()=>r.invalidateQueries({queryKey:$e.brandContext(s.id),refetchType:"all"}),t[10]=s.id,t[11]=r,t[12]=c):c=t[12];const a=c;let x;t[13]!==l?(x=async()=>{await l.callTool({name:"BRAND_CONTEXT_CREATE",arguments:{name:"New Brand",domain:"example.com",overview:""}})},t[13]=l,t[14]=x):x=t[14];let g;t[15]!==a?(g=()=>{V("brand_created"),a(),U.success("Brand created")},t[15]=a,t[16]=g):g=t[16];let h;t[17]!==x||t[18]!==g?(h={mutationFn:x,onSuccess:g,onError:Et},t[17]=x,t[18]=g,t[19]=h):h=t[19];const{mutate:v,isPending:f}=ge(h);let C;t[20]!==l?(C=async _=>{V("brand_extract_started",{domain:_});const R=await l.callTool({name:"BRAND_CONTEXT_EXTRACT",arguments:{domain:_}});Re(R)},t[20]=l,t[21]=C):C=t[21];let w;t[22]!==a?(w=()=>{V("brand_extract_succeeded"),a(),U.success("Brand extracted successfully")},t[22]=a,t[23]=w):w=t[23];let D;t[24]!==w||t[25]!==C?(D={mutationFn:C,onSuccess:w,onError:Bt},t[24]=w,t[25]=C,t[26]=D):D=t[26];const{mutate:y,isPending:N}=ge(D),I=Ne,z=Ne,H=Ne,xe="flex flex-col gap-6";let k;t[27]===Symbol.for("react.memo_cache_sentinel")?(k=n.jsxs("div",{children:[n.jsx(Ne.Title,{children:"Brand Context"}),n.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Define your brand profiles. Each brand is available as an MCP prompt for AI clients."})]}),t[27]=k):k=t[27];let B;t[28]!==v?(B=()=>v(),t[28]=v,t[29]=B):B=t[29];let A;t[30]===Symbol.for("react.memo_cache_sentinel")?(A=n.jsx(Pe,{size:14}),t[30]=A):A=t[30];let T;t[31]!==f||t[32]!==B?(T=n.jsxs("div",{className:"flex items-center justify-between",children:[k,n.jsxs(Te,{variant:"outline",onClick:B,disabled:f,children:[A,"Add Brand"]})]}),t[31]=f,t[32]=B,t[33]=T):T=t[33];let O;t[34]!==e||t[35]!==y||t[36]!==N?(O=e&&n.jsx(it,{onExtract:_=>y(_),isExtracting:N}),t[34]=e,t[35]=y,t[36]=N,t[37]=O):O=t[37];const q=m.length===0&&n.jsxs("div",{className:"rounded-2xl border border-dashed border-border bg-muted/30 p-8 text-center",children:[n.jsx("p",{className:"text-sm text-muted-foreground",children:"No brands configured yet."}),n.jsxs(Te,{variant:"outline",size:"sm",className:"mt-3",onClick:()=>v(),disabled:f,children:[n.jsx(Pe,{size:14}),"Add your first brand"]})]}),M="group space-y-3";let $;t[38]!==l||t[39]!==a?($=_=>n.jsx(ht,{brand:_,client:l,onChanged:a},_.id),t[38]=l,t[39]=a,t[40]=$):$=t[40];const L=m.map($);let E;t[41]!==L?(E=n.jsx("div",{className:M,children:L}),t[41]=L,t[42]=E):E=t[42];let K;t[43]!==T||t[44]!==O||t[45]!==q||t[46]!==E?(K=n.jsxs("div",{className:xe,children:[T,O,q,E]}),t[43]=T,t[44]=O,t[45]=q,t[46]=E,t[47]=K):K=t[47];let F;t[48]!==H.Body||t[49]!==K?(F=n.jsx(H.Body,{children:K}),t[48]=H.Body,t[49]=K,t[50]=F):F=t[50];let S;t[51]!==z.Content||t[52]!==F?(S=n.jsx(z.Content,{children:F}),t[51]=z.Content,t[52]=F,t[53]=S):S=t[53];let P;return t[54]!==I||t[55]!==S?(P=n.jsx(I,{children:S}),t[54]=I,t[55]=S,t[56]=P):P=t[56],P}function Bt(t){V("brand_extract_failed",{error:t instanceof Error?t.message:"unknown"}),U.error(t instanceof Error?t.message:"Failed to extract brand")}function Et(){return U.error("Failed to create brand")}function Ft(t){return!t.archivedAt}function Yt(){const t=X.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(kt,{}),t[0]=e):e=t[0],e}export{Yt as default};
1
+ import{e as X,$ as Ie,s as ze,o as Le,K as $e,n as Ke,a as ge,j as n,B as Te,t as V,x as U,r as Oe,z as Ue,c as _e,C as fe}from"./index-B3N0ijMe.js";import{S as Xe,u as He}from"./constants-CmcFrIt1.js";import{t as Me}from"./ChevronDown-cpZNJlz9.js";import{i as qe}from"./ChevronRight-CeUhrzuf.js";import{s as Ve,t as Qe}from"./Star01-nv1oI22I.js";import{n as Ge}from"./LinkExternal01-CRxfzQ_Z.js";import{s as Pe}from"./Plus-D1tHeJo2.js";import{s as Ye}from"./Trash01-IeycYlZQ.js";import{i as Je}from"./Zap-N-AnbCTG.js";import{c as We,b as Ze,d as et,f as tt,g as st,e as nt,a as lt,A as ot}from"./alert-dialog-BTkTE2x9.js";import{I as ue}from"./input-t1YlgH6I.js";import{T as rt}from"./textarea-BVeCELvS.js";import{P as Ne}from"./index-Bn0UKgPw.js";import{u as Re}from"./unwrap-tool-result-BYXdCQMg.js";import{u as at}from"./use-debounced-autosave-CHZpR2fH.js";import"./sidebar-DC8b4t6M.js";import"./LayoutLeft-BuJA8_jK.js";import"./tooltip-D_KYUaTY.js";import"./X-C63lgCLS.js";function we(t){const e=X.c(8),{title:s,children:o,className:l}=t;let r;e[0]!==l?(r=_e("rounded-2xl border border-border/60 bg-background p-5",l),e[0]=l,e[1]=r):r=e[1];let i;e[2]!==s?(i=n.jsx("div",{className:"mb-4",children:n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:s})}),e[2]=s,e[3]=i):i=e[3];let d;return e[4]!==o||e[5]!==r||e[6]!==i?(d=n.jsxs("div",{className:r,children:[i,o]}),e[4]=o,e[5]=r,e[6]=i,e[7]=d):d=e[7],d}function it(t){const e=X.c(25),{onExtract:s,isExtracting:o}=t,[l,r]=Oe.useState("");let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-primary/10",children:n.jsx(Je,{size:18,className:"text-primary"})}),e[0]=i):i=e[0];let d,u;e[1]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx("p",{className:"text-sm font-medium text-foreground",children:"Auto-extract brand context"}),u=n.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Enter your website URL and we'll automatically extract your brand colors, fonts, logos, and company overview."}),e[1]=d,e[2]=u):(d=e[1],u=e[2]);let p;e[3]===Symbol.for("react.memo_cache_sentinel")?(p=f=>r(f.target.value),e[3]=p):p=e[3];let b;e[4]!==l||e[5]!==o||e[6]!==s?(b=f=>{f.key==="Enter"&&l.trim()&&!o&&s(l.trim())},e[4]=l,e[5]=o,e[6]=s,e[7]=b):b=e[7];let m;e[8]!==l||e[9]!==b?(m=n.jsx(ue,{placeholder:"acme.com",value:l,onChange:p,className:"max-w-xs",onKeyDown:b}),e[8]=l,e[9]=b,e[10]=m):m=e[10];let c;e[11]!==l||e[12]!==o?(c=!l.trim()||o,e[11]=l,e[12]=o,e[13]=c):c=e[13];let a;e[14]!==l||e[15]!==s?(a=()=>s(l.trim()),e[14]=l,e[15]=s,e[16]=a):a=e[16];let x;e[17]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(Ve,{size:14}),e[17]=x):x=e[17];const g=o?"Extracting...":"Extract";let h;e[18]!==g||e[19]!==c||e[20]!==a?(h=n.jsxs(Te,{variant:"outline",disabled:c,onClick:a,children:[x,g]}),e[18]=g,e[19]=c,e[20]=a,e[21]=h):h=e[21];let v;return e[22]!==h||e[23]!==m?(v=n.jsx("div",{className:"rounded-2xl border border-dashed border-border bg-muted/30 p-5",children:n.jsxs("div",{className:"flex items-start gap-4",children:[i,n.jsxs("div",{className:"flex-1",children:[d,u,n.jsxs("div",{className:"mt-3 flex gap-2",children:[m,h]})]})]})}),e[22]=h,e[23]=m,e[24]=v):v=e[24],v}function ct(t){const e=X.c(36),{form:s,onFieldChange:o,onFieldCommit:l}=t;let r;e[0]!==s?(r=s.watch("domain"),e[0]=s,e[1]=r):r=e[1];const i=r;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx("label",{className:"mb-1 block text-xs text-muted-foreground",children:"Company name"}),e[2]=d):d=e[2];let u;e[3]!==o||e[4]!==l?(u=D=>{const{field:y}=D;return n.jsx(ue,{...y,onChange:N=>{y.onChange(N),o()},onBlur:()=>{y.onBlur(),l()},placeholder:"Acme Corp"})},e[3]=o,e[4]=l,e[5]=u):u=e[5];let p;e[6]!==s.control||e[7]!==u?(p=n.jsxs("div",{children:[d,n.jsx(fe,{control:s.control,name:"name",render:u})]}),e[6]=s.control,e[7]=u,e[8]=p):p=e[8];let b;e[9]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx("span",{children:"Domain"}),e[9]=b):b=e[9];let m;e[10]!==i?(m=i&&n.jsxs("a",{href:`https://${i}`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 transition-colors hover:text-foreground",children:[n.jsx(Ge,{size:10}),"open"]}),e[10]=i,e[11]=m):m=e[11];let c;e[12]!==m?(c=n.jsxs("label",{className:"mb-1 flex items-center justify-between text-xs text-muted-foreground",children:[b,m]}),e[12]=m,e[13]=c):c=e[13];let a;e[14]!==o||e[15]!==l?(a=D=>{const{field:y}=D;return n.jsx(ue,{...y,onChange:N=>{y.onChange(N),o()},onBlur:()=>{y.onBlur(),l()},placeholder:"acme.com"})},e[14]=o,e[15]=l,e[16]=a):a=e[16];let x;e[17]!==s.control||e[18]!==a?(x=n.jsx(fe,{control:s.control,name:"domain",render:a}),e[17]=s.control,e[18]=a,e[19]=x):x=e[19];let g;e[20]!==c||e[21]!==x?(g=n.jsxs("div",{children:[c,x]}),e[20]=c,e[21]=x,e[22]=g):g=e[22];let h;e[23]!==g||e[24]!==p?(h=n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[p,g]}),e[23]=g,e[24]=p,e[25]=h):h=e[25];let v;e[26]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx("label",{className:"mb-1 block text-xs text-muted-foreground",children:"Overview"}),e[26]=v):v=e[26];let f;e[27]!==o||e[28]!==l?(f=D=>{const{field:y}=D;return n.jsx(rt,{...y,onChange:N=>{y.onChange(N),o()},onBlur:()=>{y.onBlur(),l()},placeholder:"Brief description of what the company does...",rows:3})},e[27]=o,e[28]=l,e[29]=f):f=e[29];let C;e[30]!==s.control||e[31]!==f?(C=n.jsxs("div",{children:[v,n.jsx(fe,{control:s.control,name:"overview",render:f})]}),e[30]=s.control,e[31]=f,e[32]=C):C=e[32];let w;return e[33]!==h||e[34]!==C?(w=n.jsx(we,{title:"Company Overview",children:n.jsxs("div",{className:"space-y-3",children:[h,C]})}),e[33]=h,e[34]=C,e[35]=w):w=e[35],w}const dt={backgroundImage:"linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%), linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%)",backgroundSize:"8px 8px",backgroundPosition:"0 0, 4px 4px",backgroundColor:"#fff"};function Ae(t){const e=X.c(22),{form:s,name:o,label:l,imgClassName:r,onFieldChange:i,onFieldCommit:d}=t,u=r===void 0?"h-full w-full object-contain p-3":r;let p;e[0]!==s||e[1]!==o?(p=s.watch(o),e[0]=s,e[1]=o,e[2]=p):p=e[2];const b=p;let m;e[3]!==u||e[4]!==l||e[5]!==b?(m=n.jsx("div",{className:"flex aspect-video w-28 shrink-0 items-center justify-center overflow-hidden rounded-xl",style:dt,children:b?n.jsx("img",{src:b,alt:l,className:u,loading:"lazy"}):n.jsxs("span",{className:"text-[10px] text-muted-foreground/70",children:["No ",l.toLowerCase()]})}),e[3]=u,e[4]=l,e[5]=b,e[6]=m):m=e[6];let c;e[7]!==l?(c=n.jsxs("label",{className:"mb-1 block text-xs text-muted-foreground",children:[l," URL"]}),e[7]=l,e[8]=c):c=e[8];let a;e[9]!==i||e[10]!==d?(a=v=>{const{field:f}=v;return n.jsx(ue,{...f,onChange:C=>{f.onChange(C),i()},onBlur:()=>{f.onBlur(),d()},placeholder:"https://..."})},e[9]=i,e[10]=d,e[11]=a):a=e[11];let x;e[12]!==s.control||e[13]!==o||e[14]!==a?(x=n.jsx(fe,{control:s.control,name:o,render:a}),e[12]=s.control,e[13]=o,e[14]=a,e[15]=x):x=e[15];let g;e[16]!==c||e[17]!==x?(g=n.jsxs("div",{className:"flex-1",children:[c,x]}),e[16]=c,e[17]=x,e[18]=g):g=e[18];let h;return e[19]!==m||e[20]!==g?(h=n.jsxs("div",{className:"flex items-start gap-3",children:[m,g]}),e[19]=m,e[20]=g,e[21]=h):h=e[21],h}function mt(t){const e=X.c(4),{form:s,onFieldChange:o,onFieldCommit:l}=t;let r;return e[0]!==s||e[1]!==o||e[2]!==l?(r=n.jsx(we,{title:"Logos & Images",children:n.jsxs("div",{className:"space-y-3",children:[n.jsx(Ae,{form:s,name:"logo",label:"Logo",onFieldChange:o,onFieldCommit:l}),n.jsx(Ae,{form:s,name:"favicon",label:"Favicon",imgClassName:"h-12 w-12 object-contain",onFieldChange:o,onFieldCommit:l}),n.jsx(Ae,{form:s,name:"ogImage",label:"SEO / OG image",imgClassName:"h-full w-full object-contain",onFieldChange:o,onFieldCommit:l})]})}),e[0]=s,e[1]=o,e[2]=l,e[3]=r):r=e[3],r}const ft=[{key:"heading",label:"Headings"},{key:"body",label:"Body"},{key:"code",label:"Code"}];function ut(t){const e=X.c(6),{form:s,onFieldChange:o,onFieldCommit:l}=t;let r;e[0]!==s||e[1]!==o||e[2]!==l?(r=ft.map(d=>{const{key:u,label:p}=d,b=`fonts.${u}`,m=s.watch(b);return n.jsxs("div",{children:[n.jsxs("label",{className:"mb-1 flex items-center gap-3 text-xs text-muted-foreground",children:[n.jsx("span",{className:"w-7 text-base font-medium leading-none text-foreground",children:"Aa"}),n.jsx("span",{children:p}),m&&n.jsx("span",{className:"ml-auto truncate text-foreground",style:{fontFamily:m},children:m})]}),n.jsx(fe,{control:s.control,name:b,render:c=>{const{field:a}=c;return n.jsx(ue,{...a,value:a.value??"",onChange:x=>{a.onChange(x),o()},onBlur:()=>{a.onBlur(),l()},placeholder:`Font family for ${p.toLowerCase()}`})}})]},u)}),e[0]=s,e[1]=o,e[2]=l,e[3]=r):r=e[3];let i;return e[4]!==r?(i=n.jsx(we,{title:"Fonts",children:n.jsx("div",{className:"space-y-2",children:r})}),e[4]=r,e[5]=i):i=e[5],i}const xt=[{key:"primary",label:"Primary"},{key:"secondary",label:"Secondary"},{key:"accent",label:"Accent"},{key:"background",label:"Background"},{key:"foreground",label:"Foreground"}];function gt(t){const e=X.c(6),{form:s,onFieldChange:o,onFieldCommit:l}=t;let r;e[0]!==s||e[1]!==o||e[2]!==l?(r=xt.map(d=>{const{key:u,label:p}=d,b=`colors.${u}`;return n.jsx(fe,{control:s.control,name:b,render:m=>{const{field:c}=m;return n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("input",{type:"color",value:c.value??"#000000",onChange:a=>{c.onChange(a.target.value),o()},onBlur:()=>{c.onBlur(),l()},className:"h-9 w-9 shrink-0 cursor-pointer rounded-lg border border-border bg-transparent p-0.5"}),n.jsx(ue,{value:c.value??"",onChange:a=>{c.onChange(a.target.value),o()},onBlur:()=>{c.onBlur(),l()},placeholder:"#000000",className:"w-28"}),n.jsx("span",{className:"flex-1 text-xs text-muted-foreground",children:p})]})}},u)}),e[0]=s,e[1]=o,e[2]=l,e[3]=r):r=e[3];let i;return e[4]!==r?(i=n.jsx(we,{title:"Colors",children:n.jsx("div",{className:"space-y-2",children:r})}),e[4]=r,e[5]=i):i=e[5],i}function ht(t){const e=X.c(128),{brand:s,client:o,onChanged:l}=t,[r,i]=Oe.useState(s.isDefault??!1),[d,u]=Oe.useState(!1),p=s.name??"",b=s.domain??"",m=s.overview??"",c=s.logo??"",a=s.favicon??"",x=s.ogImage??"";let g;e[0]!==s.fonts?(g=s.fonts??{},e[0]=s.fonts,e[1]=g):g=e[1];let h;e[2]!==s.colors?(h=s.colors??{},e[2]=s.colors,e[3]=h):h=e[3];let v;e[4]!==p||e[5]!==b||e[6]!==m||e[7]!==c||e[8]!==a||e[9]!==x||e[10]!==g||e[11]!==h?(v={values:{name:p,domain:b,overview:m,logo:c,favicon:a,ogImage:x,fonts:g,colors:h}},e[4]=p,e[5]=b,e[6]=m,e[7]=c,e[8]=a,e[9]=x,e[10]=g,e[11]=h,e[12]=v):v=e[12];const f=Ue(v);let C;e[13]!==s.id||e[14]!==s.images||e[15]!==o?(C={mutationFn:async j=>{const ve=Object.values(j.fonts).some(Dt),Ce=Object.values(j.colors).some(wt),Se={id:s.id,name:j.name,domain:j.domain,overview:j.overview,logo:j.logo||null,favicon:j.favicon||null,ogImage:j.ogImage||null,fonts:ve?j.fonts:null,colors:Ce?j.colors:null,images:s.images};await o.callTool({name:"BRAND_CONTEXT_UPDATE",arguments:Se})},onError:_t},e[13]=s.id,e[14]=s.images,e[15]=o,e[16]=C):C=e[16];const w=ge(C);let D;e[17]!==s.id||e[18]!==f||e[19]!==l||e[20]!==w?(D={delayMs:500,save:async()=>{const j=f.control._formState.dirtyFields,ve=Object.keys(j);if(ve.length===0)return;const Ce=f.getValues(),Se=f.control._defaultValues;f.reset(Ce,{keepValues:!0});try{await w.mutateAsync(Ce),V("brand_updated",{brand_id:s.id,fields:ve}),U.success("Brand context updated successfully"),l()}catch{f.reset(Se,{keepValues:!0})}}},e[17]=s.id,e[18]=f,e[19]=l,e[20]=w,e[21]=D):D=e[21];const{schedule:y,flush:N}=at(D);let I;e[22]!==s.id||e[23]!==o?(I=async()=>{await o.callTool({name:"BRAND_CONTEXT_DELETE",arguments:{id:s.id}})},e[22]=s.id,e[23]=o,e[24]=I):I=e[24];let z;e[25]!==s.id||e[26]!==l?(z=()=>{V("brand_deleted",{brand_id:s.id}),u(!1),l(),U.success("Brand deleted")},e[25]=s.id,e[26]=l,e[27]=z):z=e[27];let H;e[28]!==I||e[29]!==z?(H={mutationFn:I,onSuccess:z,onError:Nt},e[28]=I,e[29]=z,e[30]=H):H=e[30];const{mutate:xe,isPending:k}=ge(H);let B;e[31]!==s.id||e[32]!==s.isDefault||e[33]!==o?(B=async()=>{await o.callTool({name:"BRAND_CONTEXT_UPDATE",arguments:{id:s.id,isDefault:!s.isDefault}})},e[31]=s.id,e[32]=s.isDefault,e[33]=o,e[34]=B):B=e[34];let A;e[35]!==s.id||e[36]!==s.isDefault||e[37]!==l?(A=()=>{V(s.isDefault?"brand_unset_as_default":"brand_set_as_default",{brand_id:s.id}),l(),U.success(s.isDefault?"Removed as default brand":"Set as default brand")},e[35]=s.id,e[36]=s.isDefault,e[37]=l,e[38]=A):A=e[38];let T;e[39]!==B||e[40]!==A?(T={mutationFn:B,onSuccess:A,onError:Ct},e[39]=B,e[40]=A,e[41]=T):T=e[41];const{mutate:O}=ge(T),q=s.isDefault?"border-primary/30":"border-border/60";let M;e[42]!==q?(M=_e("rounded-2xl border bg-background",q),e[42]=q,e[43]=M):M=e[43];let $;e[44]!==r?($=()=>i(!r),e[44]=r,e[45]=$):$=e[45];let L;e[46]!==r?(L=n.jsx("span",{className:"shrink-0 text-muted-foreground",children:r?n.jsx(Me,{size:14}):n.jsx(qe,{size:14})}),e[46]=r,e[47]=L):L=e[47];let E;e[48]!==s.logo||e[49]!==s.name?(E=s.logo?n.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center overflow-hidden rounded-lg",style:{backgroundImage:"linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%), linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%)",backgroundSize:"6px 6px",backgroundPosition:"0 0, 3px 3px",backgroundColor:"#fff"},children:n.jsx("img",{src:s.logo,alt:"",className:"h-full w-full object-contain p-1",onError:vt})}):n.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-muted",children:n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:s.name?.charAt(0)?.toUpperCase()||"?"})}),e[48]=s.logo,e[49]=s.name,e[50]=E):E=e[50];const K=s.name||"Untitled Brand";let F;e[51]!==K?(F=n.jsx("span",{className:"text-sm font-medium text-foreground",children:K}),e[51]=K,e[52]=F):F=e[52];let S;e[53]!==s.domain?(S=s.domain&&n.jsx("span",{className:"truncate text-xs text-muted-foreground",children:s.domain}),e[53]=s.domain,e[54]=S):S=e[54];let P;e[55]!==F||e[56]!==S?(P=n.jsxs("div",{className:"flex flex-1 flex-col items-start gap-0.5 overflow-hidden text-left",children:[F,S]}),e[55]=F,e[56]=S,e[57]=P):P=e[57];let _;e[58]!==s.colors||e[59]!==r?(_=!r&&s.colors&&Object.values(s.colors).some(yt)&&n.jsx("div",{className:"flex shrink-0 gap-1",children:Object.entries(s.colors).filter(jt).map(bt)}),e[58]=s.colors,e[59]=r,e[60]=_):_=e[60];let R;e[61]!==s.fonts||e[62]!==r?(R=!r&&s.fonts&&Object.values(s.fonts).some(pt)&&n.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:Object.values(s.fonts).filter(Boolean).join(", ")}),e[61]=s.fonts,e[62]=r,e[63]=R):R=e[63];const De=s.isDefault?"opacity-100":"opacity-0 hover:bg-muted group-hover:opacity-100";let Q;e[64]!==De?(Q=_e("flex h-7 w-7 shrink-0 items-center justify-center rounded-lg transition-opacity",De),e[64]=De,e[65]=Q):Q=e[65];let G,Y;e[66]!==O?(G=j=>{j.stopPropagation(),O()},Y=j=>{j.key==="Enter"&&(j.stopPropagation(),O())},e[66]=O,e[67]=G,e[68]=Y):(G=e[67],Y=e[68]);const ke=s.isDefault?"Unset as default":"Set as default",Be=s.isDefault?"text-primary fill-primary":"text-muted-foreground";let J;e[69]!==Be?(J=_e(Be),e[69]=Be,e[70]=J):J=e[70];let W;e[71]!==J?(W=n.jsx(Qe,{size:13,className:J}),e[71]=J,e[72]=W):W=e[72];let Z;e[73]!==Q||e[74]!==G||e[75]!==Y||e[76]!==ke||e[77]!==W?(Z=n.jsx("span",{role:"button",tabIndex:0,className:Q,onClick:G,onKeyDown:Y,title:ke,children:W}),e[73]=Q,e[74]=G,e[75]=Y,e[76]=ke,e[77]=W,e[78]=Z):Z=e[78];let he,pe;e[79]===Symbol.for("react.memo_cache_sentinel")?(he=j=>{j.stopPropagation(),u(!0)},pe=j=>{j.key==="Enter"&&(j.stopPropagation(),u(!0))},e[79]=he,e[80]=pe):(he=e[79],pe=e[80]);let be;e[81]===Symbol.for("react.memo_cache_sentinel")?(be=n.jsx("span",{role:"button",tabIndex:0,className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-lg opacity-0 transition-opacity hover:bg-destructive/10 group-hover:opacity-100",onClick:he,onKeyDown:pe,title:"Delete brand",children:n.jsx(Ye,{size:13,className:"text-muted-foreground"})}),e[81]=be):be=e[81];let ee;e[82]!==$||e[83]!==L||e[84]!==E||e[85]!==P||e[86]!==_||e[87]!==R||e[88]!==Z?(ee=n.jsxs("button",{type:"button",className:"flex w-full items-center gap-3 p-5",onClick:$,children:[L,E,P,_,R,Z,be]}),e[82]=$,e[83]=L,e[84]=E,e[85]=P,e[86]=_,e[87]=R,e[88]=Z,e[89]=ee):ee=e[89];let te;e[90]!==r||e[91]!==N||e[92]!==f||e[93]!==y?(te=r&&n.jsxs("div",{className:"space-y-3 px-5 pb-5",children:[n.jsx(ct,{form:f,onFieldChange:y,onFieldCommit:N}),n.jsx(mt,{form:f,onFieldChange:y,onFieldCommit:N}),n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsx(gt,{form:f,onFieldChange:y,onFieldCommit:N}),n.jsx(ut,{form:f,onFieldChange:y,onFieldCommit:N})]})]}),e[90]=r,e[91]=N,e[92]=f,e[93]=y,e[94]=te):te=e[94];let se;e[95]!==k?(se=j=>{!j&&!k&&u(!1)},e[95]=k,e[96]=se):se=e[96];let je;e[97]===Symbol.for("react.memo_cache_sentinel")?(je=n.jsx(We,{children:"Delete brand?"}),e[97]=je):je=e[97];const Ee=s.name||"this brand";let ne;e[98]!==Ee?(ne=n.jsxs("p",{children:["This will permanently delete"," ",n.jsx("span",{className:"font-medium text-foreground",children:Ee}),". This action cannot be undone."]}),e[98]=Ee,e[99]=ne):ne=e[99];let le;e[100]!==s.isDefault?(le=s.isDefault&&n.jsxs("p",{className:"mt-2 rounded-lg border border-destructive/30 bg-destructive/5 p-2 text-destructive",children:[n.jsx("span",{className:"font-medium",children:"Heads up:"})," this is your organization's default brand. Deleting it will leave your organization without a default brand until you set another."]}),e[100]=s.isDefault,e[101]=le):le=e[101];let oe;e[102]!==ne||e[103]!==le?(oe=n.jsxs(Ze,{children:[je,n.jsx(et,{asChild:!0,children:n.jsxs("div",{children:[ne,le]})})]}),e[102]=ne,e[103]=le,e[104]=oe):oe=e[104];let re;e[105]!==k?(re=n.jsx(tt,{disabled:k,children:"Cancel"}),e[105]=k,e[106]=re):re=e[106];let ae;e[107]!==xe?(ae=j=>{j.preventDefault(),xe()},e[107]=xe,e[108]=ae):ae=e[108];const Fe=k?"Deleting...":"Delete";let ie;e[109]!==k||e[110]!==ae||e[111]!==Fe?(ie=n.jsx(st,{onClick:ae,disabled:k,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Fe}),e[109]=k,e[110]=ae,e[111]=Fe,e[112]=ie):ie=e[112];let ce;e[113]!==re||e[114]!==ie?(ce=n.jsxs(nt,{children:[re,ie]}),e[113]=re,e[114]=ie,e[115]=ce):ce=e[115];let de;e[116]!==oe||e[117]!==ce?(de=n.jsxs(lt,{children:[oe,ce]}),e[116]=oe,e[117]=ce,e[118]=de):de=e[118];let me;e[119]!==d||e[120]!==se||e[121]!==de?(me=n.jsx(ot,{open:d,onOpenChange:se,children:de}),e[119]=d,e[120]=se,e[121]=de,e[122]=me):me=e[122];let ye;return e[123]!==M||e[124]!==ee||e[125]!==te||e[126]!==me?(ye=n.jsxs("div",{className:M,children:[ee,te,me]}),e[123]=M,e[124]=ee,e[125]=te,e[126]=me,e[127]=ye):ye=e[127],ye}function pt(t){return t}function bt(t){const[e,s]=t;return n.jsx("div",{className:"h-5 w-5 rounded-full border border-border/40",style:{backgroundColor:s},title:`${e}: ${s}`},e)}function jt(t){const[,e]=t;return e}function yt(t){return t}function vt(t){t.target.style.display="none"}function Ct(){return U.error("Failed to update default brand")}function Nt(){return U.error("Failed to delete brand")}function _t(){return U.error("Failed to save brand context")}function wt(t){return t?.trim()}function Dt(t){return t?.trim()}function kt(){const t=X.c(57),{brandExtractEnabled:e}=Ie(),{org:s}=ze();let o;t[0]!==s.id||t[1]!==s.slug?(o={connectionId:Xe,orgId:s.id,orgSlug:s.slug},t[0]=s.id,t[1]=s.slug,t[2]=o):o=t[2];const l=He(o),r=Le();let i;t[3]!==s.id?(i=$e.brandContext(s.id),t[3]=s.id,t[4]=i):i=t[4];let d;t[5]!==l?(d=async()=>{const _=await l.callTool({name:"BRAND_CONTEXT_LIST",arguments:{includeArchived:!1}}),R=Re(_);return Array.isArray(R?.items)?R.items:[]},t[5]=l,t[6]=d):d=t[6];let u;t[7]!==i||t[8]!==d?(u={queryKey:i,queryFn:d},t[7]=i,t[8]=d,t[9]=u):u=t[9];const{data:p}=Ke(u),m=(p===void 0?[]:p).filter(Ft);let c;t[10]!==s.id||t[11]!==r?(c=()=>r.invalidateQueries({queryKey:$e.brandContext(s.id),refetchType:"all"}),t[10]=s.id,t[11]=r,t[12]=c):c=t[12];const a=c;let x;t[13]!==l?(x=async()=>{await l.callTool({name:"BRAND_CONTEXT_CREATE",arguments:{name:"New Brand",domain:"example.com",overview:""}})},t[13]=l,t[14]=x):x=t[14];let g;t[15]!==a?(g=()=>{V("brand_created"),a(),U.success("Brand created")},t[15]=a,t[16]=g):g=t[16];let h;t[17]!==x||t[18]!==g?(h={mutationFn:x,onSuccess:g,onError:Et},t[17]=x,t[18]=g,t[19]=h):h=t[19];const{mutate:v,isPending:f}=ge(h);let C;t[20]!==l?(C=async _=>{V("brand_extract_started",{domain:_});const R=await l.callTool({name:"BRAND_CONTEXT_EXTRACT",arguments:{domain:_}});Re(R)},t[20]=l,t[21]=C):C=t[21];let w;t[22]!==a?(w=()=>{V("brand_extract_succeeded"),a(),U.success("Brand extracted successfully")},t[22]=a,t[23]=w):w=t[23];let D;t[24]!==w||t[25]!==C?(D={mutationFn:C,onSuccess:w,onError:Bt},t[24]=w,t[25]=C,t[26]=D):D=t[26];const{mutate:y,isPending:N}=ge(D),I=Ne,z=Ne,H=Ne,xe="flex flex-col gap-6";let k;t[27]===Symbol.for("react.memo_cache_sentinel")?(k=n.jsxs("div",{children:[n.jsx(Ne.Title,{children:"Brand Context"}),n.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Define your brand profiles. Each brand is available as an MCP prompt for AI clients."})]}),t[27]=k):k=t[27];let B;t[28]!==v?(B=()=>v(),t[28]=v,t[29]=B):B=t[29];let A;t[30]===Symbol.for("react.memo_cache_sentinel")?(A=n.jsx(Pe,{size:14}),t[30]=A):A=t[30];let T;t[31]!==f||t[32]!==B?(T=n.jsxs("div",{className:"flex items-center justify-between",children:[k,n.jsxs(Te,{variant:"outline",onClick:B,disabled:f,children:[A,"Add Brand"]})]}),t[31]=f,t[32]=B,t[33]=T):T=t[33];let O;t[34]!==e||t[35]!==y||t[36]!==N?(O=e&&n.jsx(it,{onExtract:_=>y(_),isExtracting:N}),t[34]=e,t[35]=y,t[36]=N,t[37]=O):O=t[37];const q=m.length===0&&n.jsxs("div",{className:"rounded-2xl border border-dashed border-border bg-muted/30 p-8 text-center",children:[n.jsx("p",{className:"text-sm text-muted-foreground",children:"No brands configured yet."}),n.jsxs(Te,{variant:"outline",size:"sm",className:"mt-3",onClick:()=>v(),disabled:f,children:[n.jsx(Pe,{size:14}),"Add your first brand"]})]}),M="group space-y-3";let $;t[38]!==l||t[39]!==a?($=_=>n.jsx(ht,{brand:_,client:l,onChanged:a},_.id),t[38]=l,t[39]=a,t[40]=$):$=t[40];const L=m.map($);let E;t[41]!==L?(E=n.jsx("div",{className:M,children:L}),t[41]=L,t[42]=E):E=t[42];let K;t[43]!==T||t[44]!==O||t[45]!==q||t[46]!==E?(K=n.jsxs("div",{className:xe,children:[T,O,q,E]}),t[43]=T,t[44]=O,t[45]=q,t[46]=E,t[47]=K):K=t[47];let F;t[48]!==H.Body||t[49]!==K?(F=n.jsx(H.Body,{children:K}),t[48]=H.Body,t[49]=K,t[50]=F):F=t[50];let S;t[51]!==z.Content||t[52]!==F?(S=n.jsx(z.Content,{children:F}),t[51]=z.Content,t[52]=F,t[53]=S):S=t[53];let P;return t[54]!==I||t[55]!==S?(P=n.jsx(I,{children:S}),t[54]=I,t[55]=S,t[56]=P):P=t[56],P}function Bt(t){V("brand_extract_failed",{error:t instanceof Error?t.message:"unknown"}),U.error(t instanceof Error?t.message:"Failed to extract brand")}function Et(){return U.error("Failed to create brand")}function Ft(t){return!t.archivedAt}function Yt(){const t=X.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(kt,{}),t[0]=e):e=t[0],e}export{Yt as default};
@@ -1 +1 @@
1
- import{e as l,c as n,j as c}from"./index-Bq8MNgeV.js";function i(a){const e=l.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let r;e[3]!==t?(r=n("bg-card text-card-foreground flex flex-col gap-6 rounded-xl card-shadow",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==s||e[6]!==r?(o=c.jsx("div",{"data-slot":"card",className:r,...s}),e[5]=s,e[6]=r,e[7]=o):o=e[7],o}function f(a){const e=l.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=c.jsx("div",{"data-slot":"card-content",...t}),e[2]=t,e[3]=s):s=e[3],s}export{i as C,f as a};
1
+ import{e as l,c as n,j as c}from"./index-B3N0ijMe.js";function i(a){const e=l.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let r;e[3]!==t?(r=n("bg-card text-card-foreground flex flex-col gap-6 rounded-xl card-shadow",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==s||e[6]!==r?(o=c.jsx("div",{"data-slot":"card",className:r,...s}),e[5]=s,e[6]=r,e[7]=o):o=e[7],o}function f(a){const e=l.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=c.jsx("div",{"data-slot":"card-content",...t}),e[2]=t,e[3]=s):s=e[3],s}export{i as C,f as a};
@@ -1,4 +1,4 @@
1
- import{bM as er,bN as tr,bk as B,J as m,bO as it,bP as ra,bQ as ar,bR as rr,I as sr,aZ as V,aH as Be,aJ as Ge,H as D,a_ as _,aI as de,bS as nr,bT as $,ap as or,ba as ir,r as S,R as ne,e as Ye,a1 as sa,o as ut,s as ie,K as ge,x as xe,Q as _e,f as lr,d as na,g as cr,w as ur,b as oa,j as ke,t as dr,P as pr,bU as mr}from"./index-Bq8MNgeV.js";import{E as fr,g as hr,S as wt,u as At}from"./constants-ClujOLL0.js";import{u as ia}from"./use-virtual-mcp-CD_T-y85.js";import{u as la,a as fe}from"./use-ai-providers-BGcGBNhE.js";import{u as ca}from"./use-decopilot-events-CiJL_0vR.js";import{u as gr}from"./use-tasks-C2q1pKyD.js";import{b as vr,c as yr}from"./use-collections-8VzaVe93.js";import{e as ua}from"./use-organization-settings-4FSfpkha.js";var Je;(function(e){e.assertEqual=s=>{};function t(s){}e.assertIs=t;function a(s){throw new Error}e.assertNever=a,e.arrayToEnum=s=>{const n={};for(const i of s)n[i]=i;return n},e.getValidEnumValues=s=>{const n=e.objectKeys(s).filter(o=>typeof s[s[o]]!="number"),i={};for(const o of n)i[o]=s[o];return e.objectValues(i)},e.objectValues=s=>e.objectKeys(s).map(function(n){return s[n]}),e.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const n=[];for(const i in s)Object.prototype.hasOwnProperty.call(s,i)&&n.push(i);return n},e.find=(s,n)=>{for(const i of s)if(n(i))return i},e.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function r(s,n=" | "){return s.map(i=>typeof i=="string"?`'${i}'`:i).join(n)}e.joinValues=r,e.jsonStringifyReplacer=(s,n)=>typeof n=="bigint"?n.toString():n})(Je||(Je={}));var jt;(function(e){e.mergeShapes=(t,a)=>({...t,...a})})(jt||(jt={}));Je.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);Je.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class lt extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const a=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,a):this.__proto__=a,this.name="ZodError",this.issues=t}format(t){const a=t||function(n){return n.message},r={_errors:[]},s=n=>{for(const i of n.issues)if(i.code==="invalid_union")i.unionErrors.map(s);else if(i.code==="invalid_return_type")s(i.returnTypeError);else if(i.code==="invalid_arguments")s(i.argumentsError);else if(i.path.length===0)r._errors.push(a(i));else{let o=r,u=0;for(;u<i.path.length;){const l=i.path[u];u===i.path.length-1?(o[l]=o[l]||{_errors:[]},o[l]._errors.push(a(i))):o[l]=o[l]||{_errors:[]},o=o[l],u++}}};return s(this),r}static assert(t){if(!(t instanceof lt))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Je.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=a=>a.message){const a=Object.create(null),r=[];for(const s of this.issues)if(s.path.length>0){const n=s.path[0];a[n]=a[n]||[],a[n].push(t(s))}else r.push(t(s));return{formErrors:r,fieldErrors:a}}get formErrors(){return this.flatten()}}lt.create=e=>new lt(e);var Lt;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(Lt||(Lt={}));var w;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(w||(w={}));const br={anthropic:["claude-haiku-4-5","claude-haiku"],openrouter:["qwen/qwen3.5-flash","anthropic/claude-haiku-4.5","anthropic/claude-haiku","google/gemini-3-flash"],deco:["qwen/qwen3.5-flash","anthropic/claude-haiku"],google:["gemini-2.5-flash","gemini-3-flash"],"claude-code":["claude-code:haiku","claude-code:sonnet"]},Ir={anthropic:["claude-sonnet-4-6","claude-sonnet"],openrouter:["anthropic/claude-sonnet-4.6","anthropic/claude-sonnet","anthropic/claude-opus-4.7","google/gemini-3-pro"],deco:["anthropic/claude-sonnet-4.6","anthropic/claude-sonnet","anthropic/claude"],google:["gemini-3-pro","gemini-3-flash"],"claude-code":["claude-code:sonnet"]},Er={anthropic:["claude-opus-4-7","claude-sonnet-4-6","claude-sonnet"],openrouter:["anthropic/claude-opus-4.7","anthropic/claude-sonnet-4.6:extended","anthropic/claude-sonnet-4.6","google/gemini-3-pro"],deco:["anthropic/claude-opus","anthropic/claude-sonnet-4.6","anthropic/claude-sonnet"],google:["gemini-3-pro"],"claude-code":["claude-code:opus","claude-code:sonnet"]},_r={openrouter:["openai/gpt-image-1","google/gemini-2.0-flash-image"],deco:["openai/gpt-image-1","google/gemini-2.0-flash-image"],google:["gemini-2.0-flash-image"]},Sr={openrouter:["perplexity/sonar","perplexity/sonar-pro","perplexity/deep-research"],deco:["perplexity/sonar","perplexity/sonar-pro","perplexity/deep-research"]};function Ze(e,t,a,r){for(const s of a){const n=e.find(i=>i.modelId===s);if(n)return{keyId:t,modelId:n.modelId,title:n.title}}for(const s of a){const n=e.find(i=>i.modelId.includes(s));if(n)return{keyId:t,modelId:n.modelId,title:n.title}}if(r){const s=e.find(r);if(s)return{keyId:t,modelId:s.modelId,title:s.title}}return null}function Tr(e,t){const a={chat:{fast:null,smart:null,thinking:null},image:null,webResearch:null};for(const r of e){const s=t[r.id]??[],n=r.providerId;a.chat.fast||(a.chat.fast=Ze(s,r.id,br[n]??[])),a.chat.smart||(a.chat.smart=Ze(s,r.id,Ir[n]??[])),a.chat.thinking||(a.chat.thinking=Ze(s,r.id,Er[n]??[])),a.image||(a.image=Ze(s,r.id,_r[n]??[],i=>i.capabilities?.includes("image")===!0)),a.webResearch||(a.webResearch=Ze(s,r.id,Sr[n]??[],i=>{const o=i.modelId.toLowerCase().replace(/[^a-z0-9]/g,"");return o.includes("sonar")||o.includes("deepresearch")}))}return a}function Mr(e,t){const{mimeType:a,data:r}=e;if(a.startsWith("text/"))try{const s=new TextDecoder().decode(Uint8Array.from(atob(r),n=>n.charCodeAt(0)));return[{type:"text",text:`${t}
1
+ import{bM as er,bN as tr,bk as B,J as m,bO as it,bP as ra,bQ as ar,bR as rr,I as sr,aZ as V,aH as Be,aJ as Ge,H as D,a_ as _,aI as de,bS as nr,bT as $,ap as or,ba as ir,r as S,R as ne,e as Ye,a1 as sa,o as ut,s as ie,K as ge,x as xe,Q as _e,f as lr,d as na,g as cr,w as ur,b as oa,j as ke,t as dr,P as pr,bU as mr}from"./index-B3N0ijMe.js";import{E as fr,g as hr,S as wt,u as At}from"./constants-CmcFrIt1.js";import{u as ia}from"./use-virtual-mcp-fhETXyqA.js";import{u as la,a as fe}from"./use-ai-providers-D1Gd_B23.js";import{u as ca}from"./use-decopilot-events-C4C_kTbf.js";import{u as gr}from"./use-tasks-BGvJcXek.js";import{b as vr,c as yr}from"./use-collections-Cqjc7P8G.js";import{e as ua}from"./use-organization-settings-CNcnwjVj.js";var Je;(function(e){e.assertEqual=s=>{};function t(s){}e.assertIs=t;function a(s){throw new Error}e.assertNever=a,e.arrayToEnum=s=>{const n={};for(const i of s)n[i]=i;return n},e.getValidEnumValues=s=>{const n=e.objectKeys(s).filter(o=>typeof s[s[o]]!="number"),i={};for(const o of n)i[o]=s[o];return e.objectValues(i)},e.objectValues=s=>e.objectKeys(s).map(function(n){return s[n]}),e.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const n=[];for(const i in s)Object.prototype.hasOwnProperty.call(s,i)&&n.push(i);return n},e.find=(s,n)=>{for(const i of s)if(n(i))return i},e.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function r(s,n=" | "){return s.map(i=>typeof i=="string"?`'${i}'`:i).join(n)}e.joinValues=r,e.jsonStringifyReplacer=(s,n)=>typeof n=="bigint"?n.toString():n})(Je||(Je={}));var jt;(function(e){e.mergeShapes=(t,a)=>({...t,...a})})(jt||(jt={}));Je.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);Je.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class lt extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const a=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,a):this.__proto__=a,this.name="ZodError",this.issues=t}format(t){const a=t||function(n){return n.message},r={_errors:[]},s=n=>{for(const i of n.issues)if(i.code==="invalid_union")i.unionErrors.map(s);else if(i.code==="invalid_return_type")s(i.returnTypeError);else if(i.code==="invalid_arguments")s(i.argumentsError);else if(i.path.length===0)r._errors.push(a(i));else{let o=r,u=0;for(;u<i.path.length;){const l=i.path[u];u===i.path.length-1?(o[l]=o[l]||{_errors:[]},o[l]._errors.push(a(i))):o[l]=o[l]||{_errors:[]},o=o[l],u++}}};return s(this),r}static assert(t){if(!(t instanceof lt))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Je.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=a=>a.message){const a=Object.create(null),r=[];for(const s of this.issues)if(s.path.length>0){const n=s.path[0];a[n]=a[n]||[],a[n].push(t(s))}else r.push(t(s));return{formErrors:r,fieldErrors:a}}get formErrors(){return this.flatten()}}lt.create=e=>new lt(e);var Lt;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(Lt||(Lt={}));var w;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(w||(w={}));const br={anthropic:["claude-haiku-4-5","claude-haiku"],openrouter:["qwen/qwen3.5-flash","anthropic/claude-haiku-4.5","anthropic/claude-haiku","google/gemini-3-flash"],deco:["qwen/qwen3.5-flash","anthropic/claude-haiku"],google:["gemini-2.5-flash","gemini-3-flash"],"claude-code":["claude-code:haiku","claude-code:sonnet"]},Ir={anthropic:["claude-sonnet-4-6","claude-sonnet"],openrouter:["anthropic/claude-sonnet-4.6","anthropic/claude-sonnet","anthropic/claude-opus-4.7","google/gemini-3-pro"],deco:["anthropic/claude-sonnet-4.6","anthropic/claude-sonnet","anthropic/claude"],google:["gemini-3-pro","gemini-3-flash"],"claude-code":["claude-code:sonnet"]},Er={anthropic:["claude-opus-4-7","claude-sonnet-4-6","claude-sonnet"],openrouter:["anthropic/claude-opus-4.7","anthropic/claude-sonnet-4.6:extended","anthropic/claude-sonnet-4.6","google/gemini-3-pro"],deco:["anthropic/claude-opus","anthropic/claude-sonnet-4.6","anthropic/claude-sonnet"],google:["gemini-3-pro"],"claude-code":["claude-code:opus","claude-code:sonnet"]},_r={openrouter:["openai/gpt-image-1","google/gemini-2.0-flash-image"],deco:["openai/gpt-image-1","google/gemini-2.0-flash-image"],google:["gemini-2.0-flash-image"]},Sr={openrouter:["perplexity/sonar","perplexity/sonar-pro","perplexity/deep-research"],deco:["perplexity/sonar","perplexity/sonar-pro","perplexity/deep-research"]};function Ze(e,t,a,r){for(const s of a){const n=e.find(i=>i.modelId===s);if(n)return{keyId:t,modelId:n.modelId,title:n.title}}for(const s of a){const n=e.find(i=>i.modelId.includes(s));if(n)return{keyId:t,modelId:n.modelId,title:n.title}}if(r){const s=e.find(r);if(s)return{keyId:t,modelId:s.modelId,title:s.title}}return null}function Tr(e,t){const a={chat:{fast:null,smart:null,thinking:null},image:null,webResearch:null};for(const r of e){const s=t[r.id]??[],n=r.providerId;a.chat.fast||(a.chat.fast=Ze(s,r.id,br[n]??[])),a.chat.smart||(a.chat.smart=Ze(s,r.id,Ir[n]??[])),a.chat.thinking||(a.chat.thinking=Ze(s,r.id,Er[n]??[])),a.image||(a.image=Ze(s,r.id,_r[n]??[],i=>i.capabilities?.includes("image")===!0)),a.webResearch||(a.webResearch=Ze(s,r.id,Sr[n]??[],i=>{const o=i.modelId.toLowerCase().replace(/[^a-z0-9]/g,"");return o.includes("sonar")||o.includes("deepresearch")}))}return a}function Mr(e,t){const{mimeType:a,data:r}=e;if(a.startsWith("text/"))try{const s=new TextDecoder().decode(Uint8Array.from(atob(r),n=>n.charCodeAt(0)));return[{type:"text",text:`${t}
2
2
  ${s}`}]}catch(s){console.error("Failed to decode text file:",s)}return[{type:"file",url:`data:${a};base64,${r}`,filename:t,mediaType:a}]}function Zt(e,t){const a=[];for(const r of e)"text"in r&&r.text?a.push({type:"text",text:`[${t}]
3
3
  ${r.text}`}):"blob"in r&&r.blob&&r.mimeType&&a.push({type:"file",url:`data:${r.mimeType};base64,${r.blob}`,filename:String(r.uri),mediaType:String(r.mimeType)});return a}function wr(e,t){const a=[];for(const r of e){if(r.role!=="user"||!r.content)continue;const s=Array.isArray(r.content)?r.content:[r.content];for(const n of s)switch(n.type){case"text":{const i=n.text?.trim();if(!i)continue;a.push({type:"text",text:`[${t}]
4
4
  ${i}`});break}case"image":case"audio":{if(!n.data||!n.mimeType)continue;a.push({type:"file",url:`data:${n.mimeType};base64,${n.data}`,mediaType:n.mimeType});break}case"resource":{const i=n.resource;if(!i||!i.mimeType)continue;i&&("text"in i&&i.text?a.push({type:"text",text:`[${t}]
@@ -1 +1 @@
1
- import{e as n,c as d,j as c,b2 as l,b3 as b}from"./index-Bq8MNgeV.js";import{i as m}from"./Check-B3zx_U26.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
+ import{e as n,c as d,j as c,b2 as l,b3 as b}from"./index-B3N0ijMe.js";import{i as m}from"./Check-Ccw422Wb.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};