decocms 4.88.0 → 4.89.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (251) hide show
  1. package/dist/client/assets/{AlertCircle-TjPHcEnP.js → AlertCircle-r81KDCkg.js} +1 -1
  2. package/dist/client/assets/{AreaChart-Cn-bvgNR.js → AreaChart-24Arw-iU.js} +1 -1
  3. package/dist/client/assets/{ArrowUp-D620niSP.js → ArrowUp-as8SHvC8.js} +1 -1
  4. package/dist/client/assets/{ArrowUpRight-BH4m-RJh.js → ArrowUpRight-Dnnbc3sc.js} +1 -1
  5. package/dist/client/assets/{CheckCircle-wgdag1z7.js → CheckCircle-C_M62nkl.js} +1 -1
  6. package/dist/client/assets/{ChevronDown-C3MkOcZJ.js → ChevronDown-B75aPsCE.js} +1 -1
  7. package/dist/client/assets/{ChevronRight-D7I_d6Rs.js → ChevronRight-PDwav88t.js} +1 -1
  8. package/dist/client/assets/{ChevronUp-BcAa4Ljr.js → ChevronUp-RnOoN8Gm.js} +1 -1
  9. package/dist/client/assets/{Copy01-ybfnME4F.js → Copy01-3TK575sB.js} +1 -1
  10. package/dist/client/assets/{DotsVertical-BkJg419g.js → DotsVertical-0aRvko9I.js} +1 -1
  11. package/dist/client/assets/{Eye-CeD9rgkI.js → Eye-BU5M66-B.js} +1 -1
  12. package/dist/client/assets/{FilterLines-DTDvdHSv.js → FilterLines-C0aYck1r.js} +1 -1
  13. package/dist/client/assets/{Globe01-e5qIDEbr.js → Globe01-Cx4waOlW.js} +1 -1
  14. package/dist/client/assets/{Globe04-Bxmic94-.js → Globe04-BuRGemFB.js} +1 -1
  15. package/dist/client/assets/{HardDrive-Bo4OGyrd.js → HardDrive-DxAvi6ek.js} +1 -1
  16. package/dist/client/assets/{Image01-Cm0pa05N.js → Image01-ocYmq6gl.js} +1 -1
  17. package/dist/client/assets/{Key01-Dz6Z8ZMZ.js → Key01-ClqtFARw.js} +1 -1
  18. package/dist/client/assets/{LayoutLeft--D_GxkO2.js → LayoutLeft-hYkAnieh.js} +1 -1
  19. package/dist/client/assets/{LinkExternal01-eA6vVQM3.js → LinkExternal01-BBN1EF_2.js} +1 -1
  20. package/dist/client/assets/{Monitor01-CbDoyDRV.js → Monitor01-BCZRvrq1.js} +1 -1
  21. package/dist/client/assets/{Package-BRrJc9sL.js → Package-Cjzokjh9.js} +1 -1
  22. package/dist/client/assets/{Palette-D12yKiV2.js → Palette-iejUcrr_.js} +1 -1
  23. package/dist/client/assets/{Play-CQU4qZuG.js → Play-BFZ9mFZ3.js} +1 -1
  24. package/dist/client/assets/{Plus-CaVUuJOD.js → Plus-D7Q_fBsD.js} +1 -1
  25. package/dist/client/assets/{SearchLg-CIPUU7M2.js → SearchLg-oN9DiuUL.js} +1 -1
  26. package/dist/client/assets/{SearchMd-7xF40qNR.js → SearchMd-ywrBhyjb.js} +1 -1
  27. package/dist/client/assets/{Settings02-BNJ32xSl.js → Settings02-U-q0qmT6.js} +1 -1
  28. package/dist/client/assets/{Shield01-CfES6vR4.js → Shield01-pBaED0kN.js} +1 -1
  29. package/dist/client/assets/{Star01-5GqPaTBh.js → Star01-fuKCqcEY.js} +1 -1
  30. package/dist/client/assets/{Stars01-DrN-Oz3U.js → Stars01-Cisad8Qn.js} +1 -1
  31. package/dist/client/assets/{Stars02-7EGkcn1l.js → Stars02-DtAXhSux.js} +1 -1
  32. package/dist/client/assets/{Sun-C4Fwh1Vu.js → Sun-BhjGBR7J.js} +1 -1
  33. package/dist/client/assets/{SwitchHorizontal01-CWRzX-Fm.js → SwitchHorizontal01-DJ_n1gld.js} +1 -1
  34. package/dist/client/assets/{Tool01-DTY-fPyM.js → Tool01-sRr0otc1.js} +1 -1
  35. package/dist/client/assets/{Tool02-C5wUTAFe.js → Tool02-Dot3PlzY.js} +1 -1
  36. package/dist/client/assets/{Trash01-D4xE6JK2.js → Trash01-Bc1zlKju.js} +1 -1
  37. package/dist/client/assets/{TrendUp01--_jCdLU4.js → TrendUp01-DV1ovCKN.js} +1 -1
  38. package/dist/client/assets/{Upload01-Baccrojk.js → Upload01-DMecuRvr.js} +1 -1
  39. package/dist/client/assets/{User01-B_wV9DLb.js → User01-CEmcmsWO.js} +1 -1
  40. package/dist/client/assets/{Users01--ZODDl59.js → Users01-CZRWCPzK.js} +1 -1
  41. package/dist/client/assets/{Users03-Bk7hrtUP.js → Users03-BjalM9H6.js} +1 -1
  42. package/dist/client/assets/{X-Dg7rsVai.js → X-BDaWTSie.js} +1 -1
  43. package/dist/client/assets/{XCircle-Di7Lb4ZU.js → XCircle-C9M3iiTQ.js} +1 -1
  44. package/dist/client/assets/{XClose-BWc8duIO.js → XClose-B0ZRZoQ5.js} +1 -1
  45. package/dist/client/assets/{Zap-BS9GJrhH.js → Zap-B9eAPyIn.js} +1 -1
  46. package/dist/client/assets/{ZapSquare-CqcwFWlA.js → ZapSquare-DQnlvdJ_.js} +1 -1
  47. package/dist/client/assets/{ZoomOut-C_Zu7-Q5.js → ZoomOut-DOT5_qVW.js} +1 -1
  48. package/dist/client/assets/{access-gate-BPnO_2yT.js → access-gate-C1nwArQr.js} +1 -1
  49. package/dist/client/assets/{add-section-modal-Pogj97RR.js → add-section-modal-D0JUeFXk.js} +1 -1
  50. package/dist/client/assets/agent-icon-DNPAcO5x.js +1 -0
  51. package/dist/client/assets/{agents-list-Dla05byu.js → agents-list-DDM98Nyx.js} +1 -1
  52. package/dist/client/assets/ai-providers-Vjwqil3e.js +1 -0
  53. package/dist/client/assets/{alert-dialog-CRKyaNBx.js → alert-dialog-DgWT8z1K.js} +1 -1
  54. package/dist/client/assets/{alert-DE6IRFu8.js → alert-zcdx8kGP.js} +1 -1
  55. package/dist/client/assets/app-editor-CJuIOSnO.js +1 -0
  56. package/dist/client/assets/{auth-DgHUqP65.js → auth--oMr7vHq.js} +1 -1
  57. package/dist/client/assets/{auth-catchall-SZ57eR91.js → auth-catchall-Dtde_QiI.js} +1 -1
  58. package/dist/client/assets/{auth-entry-CUg_odDe.js → auth-entry-dh-xtV19.js} +1 -1
  59. package/dist/client/assets/{auth-split-layout-CyOQ3TVW.js → auth-split-layout-D4NasHtD.js} +1 -1
  60. package/dist/client/assets/{authenticate-and-persist-oauth-ClWKGwOW.js → authenticate-and-persist-oauth-B3cA_kpS.js} +1 -1
  61. package/dist/client/assets/{automation-list-row-aKON7NTD.js → automation-list-row-DO0_r5kd.js} +1 -1
  62. package/dist/client/assets/{automation-runs-IA98DU4N.js → automation-runs-BzjUDXYk.js} +1 -1
  63. package/dist/client/assets/automations-cekW9qpk.js +1 -0
  64. package/dist/client/assets/{autosend-TZVzvR_1.js → autosend-9JdqkLoP.js} +1 -1
  65. package/dist/client/assets/{avatar-Cg58Qi4s.js → avatar-D971ZDsG.js} +1 -1
  66. package/dist/client/assets/{badge-D2XsHW2Y.js → badge-CV81FXza.js} +1 -1
  67. package/dist/client/assets/{block-document-DqdDdm8l.js → block-document-YIs2gzFe.js} +1 -1
  68. package/dist/client/assets/brand-context-BkJp5YSZ.js +1 -0
  69. package/dist/client/assets/buckets-BEZsry37.js +1 -0
  70. package/dist/client/assets/{bulk-category-panel-CYYYEfij.js → bulk-category-panel-NOjxtfw2.js} +1 -1
  71. package/dist/client/assets/{calendar-DxMjhXOp.js → calendar-DAn0kDG7.js} +1 -1
  72. package/dist/client/assets/{capability-load-error-96MaJwmz.js → capability-load-error-CgU5Osnl.js} +1 -1
  73. package/dist/client/assets/{card-CPTg8fDY.js → card-1eLvKqkr.js} +1 -1
  74. package/dist/client/assets/category-editor-COElea-U.js +1 -0
  75. package/dist/client/assets/{chat-context-BAovwxgU.js → chat-context-zxnotAFI.js} +1 -1
  76. package/dist/client/assets/{checkbox-BdHs-X49.js → checkbox-DxsqLSdM.js} +1 -1
  77. package/dist/client/assets/{cli-auth-success-B9Wv_KIW.js → cli-auth-success-CBCxPxk6.js} +1 -1
  78. package/dist/client/assets/{collection-detail-CU8cSNyP.js → collection-detail-CmaGlLFi.js} +1 -1
  79. package/dist/client/assets/{collection-display-button-cV3Ifql1.js → collection-display-button-x2H6ZkW0.js} +1 -1
  80. package/dist/client/assets/{collection-search-Btrf8Diq.js → collection-search-Dt9WnUiF.js} +1 -1
  81. package/dist/client/assets/{collection-table-wrapper-BSrBvNF0.js → collection-table-wrapper-BNqjKtQs.js} +1 -1
  82. package/dist/client/assets/{collection-tabs-kwELhDMx.js → collection-tabs-xily9TbN.js} +1 -1
  83. package/dist/client/assets/{command-0HaDsh2Q.js → command-BRhEt2mB.js} +1 -1
  84. package/dist/client/assets/{commerce-onboarding-DFEZmF5u.js → commerce-onboarding-mjAySeIT.js} +1 -1
  85. package/dist/client/assets/{companions-core-DJ2SKsFs.js → companions-core-DTZjodsk.js} +1 -1
  86. package/dist/client/assets/{connect-desktop-dialog-CkUcaE26.js → connect-desktop-dialog-2mqj4v9U.js} +1 -1
  87. package/dist/client/assets/{connection-card-DwBQfP1R.js → connection-card-DM2aBX12.js} +1 -1
  88. package/dist/client/assets/{connection-detail-DT13KT-v.js → connection-detail-DSbsz45h.js} +1 -1
  89. package/dist/client/assets/{connection-form-helpers-7cL_OUk8.js → connection-form-helpers-ltSs9w6R.js} +1 -1
  90. package/dist/client/assets/{connections-DlBTCw9k.js → connections-Bfwqd9Qb.js} +1 -1
  91. package/dist/client/assets/{decopilot-sse-pool-C_pTq61C.js → decopilot-sse-pool-BM0BzocA.js} +1 -1
  92. package/dist/client/assets/{dialog-DT5S2RMB.js → dialog-DXVKHwUI.js} +1 -1
  93. package/dist/client/assets/domain-settings-B1_19eYE.js +1 -0
  94. package/dist/client/assets/{drawer-XzD4hvpg.js → drawer-DGXKP3qx.js} +1 -1
  95. package/dist/client/assets/{dropdown-menu-EMizUbgW.js → dropdown-menu-BktGVlNL.js} +1 -1
  96. package/dist/client/assets/{empty-state-D9Dn1Lnz.js → empty-state-D9rkwJcX.js} +1 -1
  97. package/dist/client/assets/{extract-connection-data-nMVGabj3.js → extract-connection-data-CJOU7Xr1.js} +1 -1
  98. package/dist/client/assets/file-explorer-CiWaG3-n.js +2 -0
  99. package/dist/client/assets/{file-type-icon-XKnElsdT.js → file-type-icon-DC3EtIF-.js} +1 -1
  100. package/dist/client/assets/{files-Das55Z1g.js → files-BB_KssK5.js} +1 -1
  101. package/dist/client/assets/{form-CFqk5lJy.js → form-0J7Chu5U.js} +1 -1
  102. package/dist/client/assets/general-B6aLzs6U.js +1 -0
  103. package/dist/client/assets/{github-repo-picker-DpzVLTnS.js → github-repo-picker-tl9VdVLZ.js} +1 -1
  104. package/dist/client/assets/{hooks-CKtulQ0t.js → hooks-Df-FarZV.js} +1 -1
  105. package/dist/client/assets/{index-o1hGdX20.js → index-68ky2YtL.js} +1 -1
  106. package/dist/client/assets/{index-B5m8CMLz.js → index-BRPCFhNw.js} +1 -1
  107. package/dist/client/assets/{index-MzuqcCtH.js → index-BbXpAsRZ.js} +1 -1
  108. package/dist/client/assets/{index-DoiBq52a.js → index-BbuFSBoX.js} +1 -1
  109. package/dist/client/assets/{index-DyWjSb5y.js → index-CA-ztSZz.js} +1 -1
  110. package/dist/client/assets/{index-D-9E1u1o.js → index-CmzQtMA6.js} +1 -1
  111. package/dist/client/assets/{index-zUbtwv_f.js → index-Cz1_LYvq.js} +1 -1
  112. package/dist/client/assets/{index-gfVsktdz.js → index-DIKxS-GD.js} +1 -1
  113. package/dist/client/assets/{index-Dq2GzmIa.js → index-DLtaZicx.js} +3 -3
  114. package/dist/client/assets/{index-BojbkbvA.js → index-DlvOwv1G.js} +1 -1
  115. package/dist/client/assets/{index-DpAoOgpk.js → index-FYxXdz5k.js} +5 -5
  116. package/dist/client/assets/{index-B0JPF-6M.js → index-ZKLmMqC_.js} +2 -2
  117. package/dist/client/assets/{index-D1cQ6lKh.js → index-ZvRKWpVk.js} +1 -1
  118. package/dist/client/assets/{index-DkcdY0vj.js → index-hvILk34b.js} +1 -1
  119. package/dist/client/assets/{index-redirect-BbVVWqBd.js → index-redirect-O8SrnbUe.js} +1 -1
  120. package/dist/client/assets/{input-_HbUXqOS.js → input-D4SXILkS.js} +1 -1
  121. package/dist/client/assets/{integration-icon-CGshMm4e.js → integration-icon-OvniHnox.js} +1 -1
  122. package/dist/client/assets/{invite-member-dialog-DdKcrFqE.js → invite-member-dialog-COhsBo3c.js} +1 -1
  123. package/dist/client/assets/{label-BtGdlmhk.js → label-ZYeR1Zgi.js} +1 -1
  124. package/dist/client/assets/{layout-D95FKywt.js → layout-BZNRmuiQ.js} +1 -1
  125. package/dist/client/assets/{login-zud_aQzP.js → login-DM2Sx9VK.js} +1 -1
  126. package/dist/client/assets/{mcp-oauth-D4aGhRIx.js → mcp-oauth-1wFcqSXg.js} +1 -1
  127. package/dist/client/assets/members-HGQdD7oZ.js +1 -0
  128. package/dist/client/assets/{monaco-editor-Bq9EBE_u.js → monaco-editor-CfnP-PZQ.js} +1 -1
  129. package/dist/client/assets/{monitoring-stats-row-DmVQG9w3.js → monitoring-stats-row-FEieeE07.js} +1 -1
  130. package/dist/client/assets/{multi-select-3t05WJXi.js → multi-select-CHumoKUU.js} +1 -1
  131. package/dist/client/assets/{oauth-callback-DdheS-J2.js → oauth-callback-BVIA4l-j.js} +1 -1
  132. package/dist/client/assets/{oauth-callback-ai-provider-DdfUZcx9.js → oauth-callback-ai-provider-hF2jSQfu.js} +1 -1
  133. package/dist/client/assets/{onboarding-BqdIolPn.js → onboarding-CqpP6t4u.js} +1 -1
  134. package/dist/client/assets/{org-install-CByiJjw4.js → org-install-snwR0Z1A.js} +1 -1
  135. package/dist/client/assets/{org-layout-DxOz3rME.js → org-layout-CPanXGjO.js} +1 -1
  136. package/dist/client/assets/{organization-choice-D1TpPmhr.js → organization-choice-CC5Ypqcv.js} +1 -1
  137. package/dist/client/assets/{orgs-CnUPKV1B.js → orgs-CgexNN1j.js} +1 -1
  138. package/dist/client/assets/{page-seo-form-ByR9Z__k.js → page-seo-form-BHu5rgfM.js} +1 -1
  139. package/dist/client/assets/page-seo-sheet-BoZDUfHh.js +1 -0
  140. package/dist/client/assets/{popover-DuDwu8ZY.js → popover-B7sciFe_.js} +1 -1
  141. package/dist/client/assets/post-editor-Bpfe0b-9.js +1 -0
  142. package/dist/client/assets/{primitives-DIHB4xXI.js → primitives-BL3Xfwnn.js} +1 -1
  143. package/dist/client/assets/{profile-Blhh0cSR.js → profile-0s0admj0.js} +1 -1
  144. package/dist/client/assets/project-app-view-BYei90Jg.js +1 -0
  145. package/dist/client/assets/record-editor-D7xSjDi1.js +1 -0
  146. package/dist/client/assets/redirect-editor-kTDjL9Hv.js +1 -0
  147. package/dist/client/assets/registry-6gudiXxO.js +2 -0
  148. package/dist/client/assets/registry-layout-DjF5lv4n.js +27 -0
  149. package/dist/client/assets/{reports-Brd8qQ2b.js → reports-ByrA0cXI.js} +1 -1
  150. package/dist/client/assets/{require-capability-DXSues5j.js → require-capability-EioOfE-2.js} +1 -1
  151. package/dist/client/assets/{required-auth-layout-DLhyslwf.js → required-auth-layout-pHt0OsLo.js} +1 -1
  152. package/dist/client/assets/{reset-password-CQOlKwx7.js → reset-password-B6Gpr9Kp.js} +1 -1
  153. package/dist/client/assets/roles-D6KlmsKQ.js +1 -0
  154. package/dist/client/assets/{search-input-CuP775da.js → search-input-vbWEGrI6.js} +1 -1
  155. package/dist/client/assets/secrets-6rzeG5FO.js +1 -0
  156. package/dist/client/assets/{sections-editor-TvxP5dFH.js → sections-editor-DQ1SXQ_8.js} +2 -2
  157. package/dist/client/assets/{select-CrSxwLpY.js → select-CzLxLtJh.js} +1 -1
  158. package/dist/client/assets/select-model-BNaFvry_.js +4 -0
  159. package/dist/client/assets/{self-tool-result-DPbzkBXp.js → self-tool-result-C4O6aZvM.js} +1 -1
  160. package/dist/client/assets/seo-editor-FgUtxr74.js +1 -0
  161. package/dist/client/assets/{settings-layout-DgOodmsx.js → settings-layout-DGMNN-Xz.js} +1 -1
  162. package/dist/client/assets/{settings-section-DpMc0HVT.js → settings-section-CCsiHGh0.js} +1 -1
  163. package/dist/client/assets/{shell-controls-9Iq5Z7Tb.js → shell-controls-DYfeNUt3.js} +1 -1
  164. package/dist/client/assets/{shell-layout-DQaGi35E.js → shell-layout-CCvA5kmY.js} +1 -1
  165. package/dist/client/assets/{sidebar-C5_XfNYh.js → sidebar-Bnisj3jU.js} +1 -1
  166. package/dist/client/assets/{skeleton-CFwDF8gK.js → skeleton-o2YDszzm.js} +1 -1
  167. package/dist/client/assets/sso-BZjdPxdz.js +1 -0
  168. package/dist/client/assets/store-WmvVplo5.js +1 -0
  169. package/dist/client/assets/store-registry-D6JFzLfK.js +2 -0
  170. package/dist/client/assets/{studio-tools-DT3M_Vdz.js → studio-tools-CU40YCgH.js} +1 -1
  171. package/dist/client/assets/{switch-BlPs3ERk.js → switch-Cp0ens4B.js} +1 -1
  172. package/dist/client/assets/{table-CjtfrukD.js → table-BcmEbJS2.js} +1 -1
  173. package/dist/client/assets/{tabs-Ca1nnDrk.js → tabs-BnbuyDOQ.js} +1 -1
  174. package/dist/client/assets/{textarea-BHzi6Dhm.js → textarea-BInhN2wa.js} +1 -1
  175. package/dist/client/assets/{toggle-group-a5DM2sSK.js → toggle-group-C8JF82Zm.js} +1 -1
  176. package/dist/client/assets/{toolbar-icon-button-BAMgsY3V.js → toolbar-icon-button-DHVQqruZ.js} +1 -1
  177. package/dist/client/assets/{toolbar-BptqFiOS.js → toolbar-jQNk4aBF.js} +1 -1
  178. package/dist/client/assets/{tooltip-BI-udduQ.js → tooltip-CbqyhFNU.js} +1 -1
  179. package/dist/client/assets/{use-ai-providers-w9d34g0F.js → use-ai-providers-Ce-mBe80.js} +1 -1
  180. package/dist/client/assets/{use-automations-CqRQFXK6.js → use-automations-fHbcdoWF.js} +1 -1
  181. package/dist/client/assets/{use-autosave-k2g5KpMJ.js → use-autosave-PnEHmRFm.js} +1 -1
  182. package/dist/client/assets/{use-capability-DMFGKIH5.js → use-capability-7FhSHK1j.js} +1 -1
  183. package/dist/client/assets/{use-clock-tick-DOOmIKzq.js → use-clock-tick-BSzPHVV9.js} +1 -1
  184. package/dist/client/assets/{use-collections-BakROzwv.js → use-collections-DymFqXTj.js} +1 -1
  185. package/dist/client/assets/{use-connection-BYUOXcTZ.js → use-connection-nHpSOixh.js} +1 -1
  186. package/dist/client/assets/{use-copy-X1Kg3Hp6.js → use-copy-CVRfmVcr.js} +1 -1
  187. package/dist/client/assets/{use-create-virtual-mcp-ScupYh0A.js → use-create-virtual-mcp-CYdsmSu7.js} +1 -1
  188. package/dist/client/assets/{use-debounced-autosave-C2vhIJrv.js → use-debounced-autosave-DzZy5CMV.js} +1 -1
  189. package/dist/client/assets/{use-debounced-value-BcV326dl.js → use-debounced-value-DDXj5yG7.js} +1 -1
  190. package/dist/client/assets/{use-deco-credits-DGCPQWxL.js → use-deco-credits-qPcUG_H1.js} +1 -1
  191. package/dist/client/assets/{use-decopilot-events-DDc7EwGs.js → use-decopilot-events-CwfGNClb.js} +1 -1
  192. package/dist/client/assets/{use-delete-connection-B_tvesBX.js → use-delete-connection-UW6-mwvP.js} +1 -1
  193. package/dist/client/assets/{use-deployment-admin-NaQfMW3G.js → use-deployment-admin-BZhJT9d8.js} +1 -1
  194. package/dist/client/assets/{use-file-configs-dAie7zDN.js → use-file-configs-mo5v3z-L.js} +1 -1
  195. package/dist/client/assets/{use-infinite-scroll-C_M049Oj.js → use-infinite-scroll-DKI6Jm_Z.js} +1 -1
  196. package/dist/client/assets/{use-join-requests-C982hQhS.js → use-join-requests-B8SSn-6X.js} +1 -1
  197. package/dist/client/assets/{use-mcp-auth-status-ClCJfdlL.js → use-mcp-auth-status-BoxBiUjh.js} +1 -1
  198. package/dist/client/assets/{use-mcp-client-BET4cVQ2.js → use-mcp-client-BDjzJl1W.js} +1 -1
  199. package/dist/client/assets/{use-mcp-tools-z0J_EOSL.js → use-mcp-tools-D3DsU015.js} +1 -1
  200. package/dist/client/assets/{use-members-Dmwu4pSZ.js → use-members-BURpqXiY.js} +1 -1
  201. package/dist/client/assets/{use-mobile-BjsEeYVy.js → use-mobile-mEwfb7Wb.js} +1 -1
  202. package/dist/client/assets/{use-navigate-to-agent-C4BCBCv3.js → use-navigate-to-agent-Cs7YA5M3.js} +1 -1
  203. package/dist/client/assets/{use-org-auth-client-BZS4V2Lt.js → use-org-auth-client-CfFt4dzT.js} +1 -1
  204. package/dist/client/assets/{use-org-sso-DIQMNs43.js → use-org-sso-Cu8oZrtw.js} +1 -1
  205. package/dist/client/assets/{use-organization-roles-C3RoqVvc.js → use-organization-roles-CwjU6Mn1.js} +1 -1
  206. package/dist/client/assets/{use-organization-settings-C0IXRiP_.js → use-organization-settings-ClKWg8Ku.js} +1 -1
  207. package/dist/client/assets/{use-registry-app-COi_RGkf.js → use-registry-app-Bvi7D6KG.js} +1 -1
  208. package/dist/client/assets/{use-registry-connections-BThC_Q4I.js → use-registry-connections-Z27WGDwm.js} +1 -1
  209. package/dist/client/assets/{use-secrets-C4jt5KwT.js → use-secrets-DH9dvdls.js} +1 -1
  210. package/dist/client/assets/{use-status-sounds-D8lhFnWZ.js → use-status-sounds-B_cMuOqc.js} +1 -1
  211. package/dist/client/assets/use-t-CKsegaGu.js +1 -0
  212. package/dist/client/assets/{use-view-mode-B_UKRIZ6.js → use-view-mode-I-DdpMfg.js} +1 -1
  213. package/dist/client/assets/{use-virtual-mcp-B1v9ZXLU.js → use-virtual-mcp-DfgOuy17.js} +1 -1
  214. package/dist/client/assets/useInfiniteQuery-DeEG7MZZ.js +1 -0
  215. package/dist/client/assets/{useRouterState-DUO8mZul.js → useRouterState-DQn2fBkZ.js} +1 -1
  216. package/dist/client/assets/useSuspenseInfiniteQuery-BLlnoP7W.js +1 -0
  217. package/dist/client/assets/{users-N2quvYT2.js → users-Dmdb2Gdp.js} +1 -1
  218. package/dist/client/assets/{variant-calendar-CInZZr41.js → variant-calendar-ZVMFoRqO.js} +1 -1
  219. package/dist/client/assets/{view-mode-toggle-52AzCdiS.js → view-mode-toggle-BEfnqPkj.js} +1 -1
  220. package/dist/client/index.html +1 -1
  221. package/dist/server/cli.js +175 -175
  222. package/dist/server/server.js +96 -96
  223. package/package.json +1 -1
  224. package/dist/client/assets/agent-icon-cR-VXBAA.js +0 -1
  225. package/dist/client/assets/ai-providers-Fm3Yt85-.js +0 -1
  226. package/dist/client/assets/app-editor-CwhqVCG1.js +0 -1
  227. package/dist/client/assets/automations-XfRoHwch.js +0 -1
  228. package/dist/client/assets/brand-context-DHR7TQrR.js +0 -1
  229. package/dist/client/assets/buckets-CmEZAuoA.js +0 -1
  230. package/dist/client/assets/category-editor-D7J7rN3F.js +0 -1
  231. package/dist/client/assets/domain-settings-B5aXl5-3.js +0 -1
  232. package/dist/client/assets/file-explorer-BUzI6LY3.js +0 -2
  233. package/dist/client/assets/general-CQPIeQa7.js +0 -1
  234. package/dist/client/assets/members-BG3nsJki.js +0 -1
  235. package/dist/client/assets/page-seo-sheet-DqhnQQyz.js +0 -1
  236. package/dist/client/assets/post-editor-DQXQRD8M.js +0 -1
  237. package/dist/client/assets/project-app-view-BM4iHZMp.js +0 -1
  238. package/dist/client/assets/record-editor-TBLNbsuJ.js +0 -1
  239. package/dist/client/assets/redirect-editor-C47yCFL3.js +0 -1
  240. package/dist/client/assets/registry-Br5lgFoU.js +0 -2
  241. package/dist/client/assets/registry-layout-BfglNjIQ.js +0 -27
  242. package/dist/client/assets/roles-CA9bRsRk.js +0 -1
  243. package/dist/client/assets/secrets-CxXZO-8x.js +0 -1
  244. package/dist/client/assets/select-model-CPc7lxVf.js +0 -4
  245. package/dist/client/assets/seo-editor-BDKx3e-e.js +0 -1
  246. package/dist/client/assets/sso-C-6YVyZZ.js +0 -1
  247. package/dist/client/assets/store-BUr1OKTO.js +0 -1
  248. package/dist/client/assets/store-registry-BURcb76O.js +0 -2
  249. package/dist/client/assets/use-t-CguyLWE3.js +0 -1
  250. package/dist/client/assets/useInfiniteQuery-CErl8eUD.js +0 -1
  251. package/dist/client/assets/useSuspenseInfiniteQuery-CqYcpPIQ.js +0 -1
@@ -1 +0,0 @@
1
- import{r as F,C as Ne,K as re,b4 as ct,m as Ce,j as s,l as K,i as fe,B as le,c as H,H as we,ad as be,I as se,af as Le,ag as Pe,n as ze,M as dt,J as mt,d as Ye,t as he,p as Ae,w as Fe,x as ut,E as ft,b as ht,u as xt}from"./index-Dq2GzmIa.js";import{u as pt}from"./use-organization-roles-C3RoqVvc.js";import{u as Re}from"./use-org-auth-client-BZS4V2Lt.js";import{g as $e,a as gt}from"./role-color-Dn2tXDDF.js";import{B as xe}from"./badge-D2XsHW2Y.js";import{f as Ke,a as Qe,b as He,c as qe,d as Ze,A as Je,e as Xe,g as We}from"./alert-dialog-CRKyaNBx.js";import{D as Tt,a as Et,c as _t,d as It}from"./dropdown-menu-EMizUbgW.js";import{i as bt}from"./DotsVertical-BkJg419g.js";import{s as Se}from"./Plus-CaVUuJOD.js";import{s as Nt}from"./Trash01-D4xE6JK2.js";import{C as St}from"./collection-table-wrapper-BSrBvNF0.js";import{P as te}from"./index-DoiBq52a.js";import{E as De}from"./empty-state-D9Dn1Lnz.js";import{S as Oe}from"./search-input-CuP775da.js";import{P as et,D as tt}from"./ai-providers-logos-DD3qZ33J.js";import{I as je}from"./integration-icon-CGshMm4e.js";import{u as Ct}from"./use-infinite-scroll-C_M049Oj.js";import{C as ve}from"./checkbox-BdHs-X49.js";import{b as At}from"./Settings02-BNJ32xSl.js";import{u as Rt}from"./useSuspenseInfiniteQuery-CqYcpPIQ.js";import{u as Ot,S as jt}from"./use-mcp-client-BET4cVQ2.js";import{C as vt}from"./collection-search-Btrf8Diq.js";import{u as st}from"./use-members-Dmwu4pSZ.js";import{g as lt}from"./get-initials-D-f_fDFw.js";import{u as yt}from"./use-connection-BYUOXcTZ.js";import{u as Mt,c as wt}from"./use-ai-providers-w9d34g0F.js";import{A as nt}from"./avatar-Cg58Qi4s.js";import{S as pe}from"./switch-BlPs3ERk.js";import{c as ge,b as Te,T as Ee,a as _e}from"./tooltip-BI-udduQ.js";import{S as ke,a as Ge,b as Ue}from"./settings-section-DpMc0HVT.js";import{t as Lt}from"./ChevronDown-C3MkOcZJ.js";import{i as Pt}from"./ChevronRight-D7I_d6Rs.js";import{i as Be}from"./X-Dg7rsVai.js";import{a as Dt}from"./use-capability-DMFGKIH5.js";import{A as kt}from"./access-gate-BPnO_2yT.js";import"./ChevronUp-BcAa4Ljr.js";import"./table-CjtfrukD.js";import"./ArrowUp-D620niSP.js";import"./sidebar-C5_XfNYh.js";import"./LayoutLeft--D_GxkO2.js";import"./use-mobile-BjsEeYVy.js";import"./SearchMd-7xF40qNR.js";import"./Tool02-C5wUTAFe.js";import"./agent-icon-cR-VXBAA.js";import"./AlertCircle-TjPHcEnP.js";import"./Tool01-DTY-fPyM.js";import"./XCircle-Di7Lb4ZU.js";import"./ArrowUpRight-BH4m-RJh.js";import"./TrendUp01--_jCdLU4.js";import"./ZapSquare-CqcwFWlA.js";import"./ZoomOut-C_Zu7-Q5.js";import"./Users03-Bk7hrtUP.js";import"./CheckCircle-wgdag1z7.js";import"./Stars02-7EGkcn1l.js";import"./Copy01-ybfnME4F.js";import"./Globe01-e5qIDEbr.js";import"./Eye-CeD9rgkI.js";import"./FilterLines-DTDvdHSv.js";import"./Star01-5GqPaTBh.js";import"./Globe04-Bxmic94-.js";import"./SwitchHorizontal01-CWRzX-Fm.js";import"./HardDrive-Bo4OGyrd.js";import"./Image01-Cm0pa05N.js";import"./Key01-Dz6Z8ZMZ.js";import"./LinkExternal01-eA6vVQM3.js";import"./Monitor01-CbDoyDRV.js";import"./Sun-C4Fwh1Vu.js";import"./Package-BRrJc9sL.js";import"./Palette-D12yKiV2.js";import"./Play-CQU4qZuG.js";import"./SearchLg-CIPUU7M2.js";import"./Shield01-CfES6vR4.js";import"./Stars01-DrN-Oz3U.js";import"./Upload01-Baccrojk.js";import"./User01-B_wV9DLb.js";import"./Users01--ZODDl59.js";import"./XClose-BWc8duIO.js";import"./Zap-BS9GJrhH.js";import"./auth-DgHUqP65.js";import"./use-collections-BakROzwv.js";import"./studio-tools-DT3M_Vdz.js";import"./card-CPTg8fDY.js";import"./capability-load-error-96MaJwmz.js";const ye="basic-usage",Me=[{id:ye,label:"Basic Usage",description:"Tools all org members can access by default",section:"Basic Usage",tools:["COLLECTION_CONNECTIONS_LIST","COLLECTION_CONNECTIONS_GET","CONNECTION_TEST","COLLECTION_VIRTUAL_MCP_LIST","COLLECTION_VIRTUAL_MCP_GET","VIRTUAL_MCP_PLUGIN_CONFIG_GET","VIRTUAL_MCP_LAST_USED_LIST","AUTOMATION_GET","AUTOMATION_LIST","AUTOMATION_RUN_STATS","AI_PROVIDERS_LIST","AI_PROVIDERS_LIST_MODELS","AI_PROVIDERS_ACTIVE","AI_PROVIDER_KEY_LIST","AI_PROVIDER_CREDITS","AI_PROVIDER_TOPUP_URL","LIST_OBJECTS","GET_OBJECT_METADATA","GET_PRESIGNED_URL","PUT_PRESIGNED_URL","FILE_OBJECTS_LIST","SANDBOX_START","SANDBOX_DELETE","GLOBAL_SEARCH","ORGANIZATION_SETTINGS_GET","USER_GET","LINK_CURRENT_GET","LINK_DISCONNECT","BRAND_CONTEXT_LIST","COLLECTION_THREADS_CREATE","COLLECTION_THREADS_LIST","COLLECTION_THREADS_GET","COLLECTION_THREADS_UPDATE","COLLECTION_THREADS_DELETE","COLLECTION_THREAD_MESSAGES_LIST","THREAD_BACKGROUND_TOOL_START","THREAD_SUBTASK_DELIVER","TASK_BOARD_ITEM_CREATE","TASK_BOARD_ITEM_LIST","TASK_BOARD_ITEM_UPDATE","TASK_BOARD_ITEM_DELETE","TASK_BOARD_ITEM_PRS_GET"]},{id:"org:manage",label:"Manage organization",description:"Edit organization settings, brand context, and domain configuration",section:"Organization",tools:["ORGANIZATION_GET","ORGANIZATION_LIST","ORGANIZATION_UPDATE","ORGANIZATION_SETTINGS_GET","ORGANIZATION_SETTINGS_UPDATE","BRAND_CONTEXT_LIST","BRAND_CONTEXT_GET","BRAND_CONTEXT_CREATE","BRAND_CONTEXT_UPDATE","BRAND_CONTEXT_DELETE","BRAND_CONTEXT_EXTRACT","BRAND_GET","BRAND_LIST","ORGANIZATION_DOMAIN_LIST","ORGANIZATION_DOMAIN_ADD","ORGANIZATION_DOMAIN_UPDATE","ORGANIZATION_DOMAIN_VERIFY","ORGANIZATION_DOMAIN_REMOVE"]},{id:"members:manage",label:"Manage members",description:"Invite members, remove them, and change their roles",section:"Organization",tools:["ORGANIZATION_MEMBER_LIST","ORGANIZATION_MEMBER_ADD","ORGANIZATION_MEMBER_REMOVE","ORGANIZATION_MEMBER_UPDATE_ROLE","ORGANIZATION_JOIN_REQUEST_LIST","ORGANIZATION_JOIN_REQUEST_APPROVE","ORGANIZATION_JOIN_REQUEST_DENY"],dangerous:!0},{id:"connections:manage",label:"Manage connections",description:"Create, update, and delete connections",section:"Connections & Agents",tools:["COLLECTION_CONNECTIONS_CREATE","COLLECTION_CONNECTIONS_UPDATE","COLLECTION_CONNECTIONS_DELETE","COMMERCE_DISCOVERY_SETUP","COMMERCE_DISCOVERY_RUN","COMMERCE_DISCOVERY_BIND","COMMERCE_DISCOVERY_CONNECTION_STATUS"],dangerous:!0},{id:"agents:manage",label:"Manage agents",description:"Create, configure, and delete agents",section:"Connections & Agents",tools:["COLLECTION_VIRTUAL_MCP_CREATE","COLLECTION_VIRTUAL_MCP_UPDATE","COLLECTION_VIRTUAL_MCP_DELETE","VIRTUAL_MCP_PLUGIN_CONFIG_UPDATE","VIRTUAL_MCP_PINNED_VIEWS_UPDATE"],dangerous:!0},{id:"automations:manage",label:"Manage automations",description:"Create, update, run, and delete automations",section:"Automations",tools:["AUTOMATION_CREATE","AUTOMATION_UPDATE","AUTOMATION_DELETE","AUTOMATION_TRIGGER_ADD","AUTOMATION_TRIGGER_REMOVE","AUTOMATION_TRIGGER_ROTATE_TOKEN","AUTOMATION_RUN"],dangerous:!0},{id:"monitoring:view",label:"View monitoring",description:"Access logs and usage statistics",section:"Monitoring",tools:["MONITORING_LOG_GET","MONITORING_LOGS_LIST","MONITORING_STATS","MONITORING_THREAD_USAGE"]},{id:"secrets:manage",label:"Manage secrets",description:"Create and list secrets stored in the credential vault",section:"Organization",tools:["SECRET_CREATE","SECRET_LIST"]},{id:"file-configs:manage",label:"Manage file configs",description:"Create, list, update and delete S3 bucket configurations",section:"Organization",tools:["FILE_CONFIG_CREATE","FILE_CONFIG_LIST","FILE_CONFIG_UPDATE","FILE_CONFIG_DELETE","FILE_OBJECTS_LIST"]},{id:"ai-providers:manage",label:"Manage AI providers",description:"Add or remove API keys and provision provider credentials",section:"AI Providers",tools:["AI_PROVIDER_KEY_CREATE","AI_PROVIDER_KEY_LIST","AI_PROVIDER_KEY_DELETE","AI_PROVIDER_KEY_UPDATE","AI_PROVIDER_KEY_PREVIEW","AI_PROVIDER_OAUTH_URL","AI_PROVIDER_OAUTH_EXCHANGE","AI_PROVIDER_PROVISION_KEY","AI_PROVIDER_TOPUP_URL","AI_PROVIDER_CREDITS"]},{id:"tags:manage",label:"Manage tags",description:"Create, assign, and delete organization tags",section:"Organization",tools:["TAGS_LIST","TAGS_CREATE","TAGS_DELETE","MEMBER_TAGS_GET","MEMBER_TAGS_SET"]},{id:"registry:manage",label:"Manage registry",description:"Browse, publish, and manage items in the registry",section:"Store & Registry",tools:["COLLECTION_REGISTRY_APP_LIST","COLLECTION_REGISTRY_APP_GET","COLLECTION_REGISTRY_APP_VERSIONS","COLLECTION_REGISTRY_APP_FILTERS","REGISTRY_ITEM_LIST","REGISTRY_ITEM_SEARCH","REGISTRY_ITEM_GET","REGISTRY_ITEM_VERSIONS","REGISTRY_ITEM_FILTERS","REGISTRY_DISCOVER_TOOLS","REGISTRY_ITEM_CREATE","REGISTRY_ITEM_BULK_CREATE","REGISTRY_ITEM_UPDATE","REGISTRY_ITEM_DELETE","REGISTRY_AI_GENERATE","REGISTRY_PUBLISH_REQUEST_LIST","REGISTRY_PUBLISH_REQUEST_REVIEW","REGISTRY_PUBLISH_REQUEST_COUNT","REGISTRY_PUBLISH_REQUEST_DELETE","REGISTRY_PUBLISH_API_KEY_GENERATE","REGISTRY_PUBLISH_API_KEY_LIST","REGISTRY_PUBLISH_API_KEY_REVOKE"],dangerous:!0},{id:"registry:monitor",label:"Monitor registry health",description:"Run health checks on registry connections and view results",section:"Store & Registry",tools:["REGISTRY_MONITOR_RUN_START","REGISTRY_MONITOR_RUN_LIST","REGISTRY_MONITOR_RUN_GET","REGISTRY_MONITOR_RUN_CANCEL","REGISTRY_MONITOR_RESULT_LIST","REGISTRY_MONITOR_CONNECTION_LIST","REGISTRY_MONITOR_CONNECTION_SYNC","REGISTRY_MONITOR_CONNECTION_UPDATE_AUTH"]},{id:"api-keys:manage",label:"Manage API keys",description:"Create, update, and revoke API keys",section:"Developer",tools:["API_KEY_CREATE","API_KEY_LIST","API_KEY_UPDATE","API_KEY_DELETE"]},{id:"storage:delete",label:"Delete from storage",description:"Permanently delete files from object storage",section:"Developer",tools:["DELETE_OBJECT","DELETE_OBJECTS"],dangerous:!0},{id:"connections:sql",label:"Run SQL queries",description:"Execute raw SQL against connected databases",section:"Developer",tools:["DATABASES_RUN_SQL"],dangerous:!0}];[...Me.find(t=>t.id===ye)?.tools??[]];const Gt=["agents:manage","connections:manage"];new Set(Me.filter(t=>Gt.includes(t.id)).flatMap(t=>t.tools));function Ut(){const t=new Map;for(const e of Me){if(e.id===ye)continue;const l=t.get(e.section)??[];l.push(e),t.set(e.section,l)}return Array.from(t.entries()).map(([e,l])=>({section:e,capabilities:l}))}function Bt(t,e,l){return l?!0:t.tools.every(n=>e.includes(n))}function Vt(t,e,l){if(l){const i=new Set(e);for(const r of t.tools)i.add(r);return Array.from(i)}const n=new Set(e);for(const i of t.tools)n.delete(i);return Array.from(n)}function zt(t){const e=H.c(21),{connection:l,isSelected:n,hasToolsEnabled:i,activeToolsCount:r,totalToolsCount:d,onSelect:h,onToggle:c}=t,x=n?"bg-accent/50":"hover:bg-muted/50";let f;e[0]!==x?(f=K("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",x),e[0]=x,e[1]=f):f=e[1];let a;e[2]!==l.icon||e[3]!==l.title?(a=s.jsx(je,{icon:l.icon,name:l.title,size:"xs"}),e[2]=l.icon,e[3]=l.title,e[4]=a):a=e[4];let p;e[5]!==l.title?(p=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:l.title})}),e[5]=l.title,e[6]=p):p=e[6];let o;e[7]!==h||e[8]!==a||e[9]!==p?(o=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:h,children:[a,p]}),e[7]=h,e[8]=a,e[9]=p,e[10]=o):o=e[10];let m;e[11]!==r||e[12]!==l.tools||e[13]!==i||e[14]!==c||e[15]!==d?(m=l.tools&&l.tools.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[r,"/",d]}),s.jsx(ve,{checked:i,onCheckedChange:c,onClick:Yt})]}),e[11]=r,e[12]=l.tools,e[13]=i,e[14]=c,e[15]=d,e[16]=m):m=e[16];let N;return e[17]!==f||e[18]!==o||e[19]!==m?(N=s.jsxs("div",{className:f,children:[o,m]}),e[17]=f,e[18]=o,e[19]=m,e[20]=N):N=e[20],N}function Yt(t){return t.stopPropagation()}function Ft(t){const e=H.c(18),{connectionId:l,tool:n,isSelected:i,onToggle:r}=t,d=`tool-${l}-${n.name}`,h=i?"text-foreground":"text-muted-foreground";let c;e[0]!==h?(c=K("text-sm font-medium",h),e[0]=h,e[1]=c):c=e[1];let x;e[2]!==c||e[3]!==n.name?(x=s.jsx("div",{className:"flex items-center gap-2 mb-1",children:s.jsx("span",{className:c,children:n.name})}),e[2]=c,e[3]=n.name,e[4]=x):x=e[4];let f;e[5]!==n.description?(f=n.description&&s.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:n.description}),e[5]=n.description,e[6]=f):f=e[6];let a;e[7]!==x||e[8]!==f?(a=s.jsxs("div",{className:"flex-1 min-w-0",children:[x,f]}),e[7]=x,e[8]=f,e[9]=a):a=e[9];const p=`tool-${l}-${n.name}`;let o;e[10]!==i||e[11]!==r||e[12]!==p?(o=s.jsx("div",{className:"flex items-center shrink-0",children:s.jsx(ve,{id:p,checked:i,onCheckedChange:r,onClick:$t})}),e[10]=i,e[11]=r,e[12]=p,e[13]=o):o=e[13];let m;return e[14]!==d||e[15]!==a||e[16]!==o?(m=s.jsxs("label",{className:"flex items-center gap-3 p-3 rounded-lg hover:bg-muted/50 cursor-pointer group will-change-auto",htmlFor:d,children:[a,o]}),e[14]=d,e[15]=a,e[16]=o,e[17]=m):m=e[17],m}function $t(t){return t.stopPropagation()}function Kt({toolSet:t,onToolSetChange:e,excludeVirtualMcpId:l,searchQuery:n}){const[i,r]=F.useState(""),d=n!==void 0?n:i,h=F.useDeferredValue(d),[c,x]=F.useState("all"),[f,a]=F.useState(!1),p=F.useRef(new Set(Object.keys(t))),{org:o}=Ne(),m=Ot({connectionId:jt,orgId:o.id,orgSlug:o.slug}),N=100,_=h.trim(),E=_?{operator:"or",conditions:[{field:["title"],operator:"contains",value:_},{field:["description"],operator:"contains",value:_}]}:void 0,S=!!l,C={...E&&{where:E},orderBy:[{field:["updated_at"],direction:"asc"}],limit:N,offset:0,...S&&{include_virtual:!0}},v=JSON.stringify(C),{data:I,fetchNextPage:R,hasNextPage:g,isFetchingNextPage:O}=Rt({queryKey:re.collectionListInfinite(m,o.id,"","CONNECTIONS",v),queryFn:async({pageParam:T=0})=>(await m.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...E&&{where:E},orderBy:[{field:["updated_at"],direction:"asc"}],limit:N,offset:T,...S&&{include_virtual:!0}}})).structuredContent,initialPageParam:0,getNextPageParam:(T,D)=>{if(T?.hasMore)return D.reduce((Q,q)=>Q+(q?.items?.length??0),0)},staleTime:3e4}),b=I?.pages.flatMap(T=>T?.items??[])??[],j=Ct(R,g??!1,O),u=l?b.filter(T=>T.connection_type!=="VIRTUAL"?!0:ct(T.connection_url)!==l):b,M=p.current,A=[...M.values()].map(T=>u.find(D=>D.id===T)).filter(T=>T!==void 0),k=u.filter(T=>!M.has(T.id)),G=[...A,...k],U=T=>{const D=t[T];return D!==void 0&&D.length>0},B=G.filter(T=>{if(c==="all")return!0;const D=U(T.id);return c==="selected"?D:c==="unselected"?!D:!0}),[w,z]=F.useState(G[0]?.id??null),y=w?G.find(T=>T.id===w)??null:null,{data:L,isFetching:Y}=Ce({queryKey:re.collectionItem(m,o.id,"","CONNECTIONS",w??""),queryFn:async()=>w?(await m.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:w}})).structuredContent?.item??null:null,enabled:!!w,staleTime:3e4}),$=L?.tools??[],J=(T,D)=>t[T]?.includes(D)??!1,X=(T,D)=>{const Q=t[T]??[],q=Q.includes(D),W={...t};if(q){const Z=Q.filter(ee=>ee!==D);Z.length===0?delete W[T]:W[T]=Z}else W[T]=[...Q,D];e(W)},ne=T=>{const D=T===w?$:[];if(!D.length)return;const Q=t[T]??[],q=D.map(ee=>ee.name),W=Q.length>0&&q.every(ee=>Q.includes(ee)),Z={...t};W?delete Z[T]:(Z[T]=q,z(T)),e(Z)},oe=T=>{z(T),a(!0)},ie=()=>{a(!1)};return s.jsxs("div",{className:"flex h-full",children:[s.jsxs("div",{className:K("w-full md:w-80 border-r border-border flex flex-col",f&&"hidden md:flex"),children:[n===void 0&&s.jsx(vt,{value:i,onChange:r,placeholder:"Search MCP Servers..."}),s.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[s.jsx("button",{onClick:()=>x("all"),className:K("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",c==="all"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"All"}),s.jsx("button",{onClick:()=>x("selected"),className:K("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",c==="selected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Selected"}),s.jsx("button",{onClick:()=>x("unselected"),className:K("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",c==="unselected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Unselected"})]}),s.jsx("div",{className:"flex-1 overflow-auto",children:B.length===0?s.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:d?"No connections found":c==="selected"?"No servers selected":c==="unselected"?"No unselected servers":"No connections available"}):s.jsxs("div",{className:"p-2 space-y-1",children:[B.map(T=>{const D=w===T.id,Q=D?$.length:0,q=t[T.id]?.length??0;return s.jsx(zt,{connection:{...T,tools:D?$:T.tools},isSelected:D,hasToolsEnabled:U(T.id),activeToolsCount:q,totalToolsCount:Q,onSelect:()=>oe(T.id),onToggle:()=>ne(T.id)},T.id)}),s.jsx("div",{ref:j,className:"h-4"}),O&&s.jsx("div",{className:"flex justify-center py-3",children:s.jsx(fe,{size:18,className:"animate-spin text-muted-foreground"})})]})})]}),s.jsx("div",{className:K("flex-1 flex-col",f?"flex":"hidden md:flex"),children:y?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"md:hidden border-b border-border p-4 flex items-center gap-3",children:[s.jsx(le,{variant:"ghost",size:"sm",onClick:ie,className:"h-8 w-8 p-0 shrink-0",children:s.jsx(At,{size:20})}),s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[s.jsx(je,{icon:y.icon,name:y.title,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:y.title}),y.description&&s.jsx("p",{className:"text-sm text-muted-foreground truncate",children:y.description})]})]})]}),s.jsx("div",{className:"flex-1 overflow-auto p-4",children:Y?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(fe,{size:18,className:"animate-spin text-muted-foreground"})}):$.length===0?s.jsx("div",{className:"text-sm text-muted-foreground text-center py-8",children:"This connection has no tools available"}):s.jsx("div",{className:"space-y-2",children:$.map(T=>s.jsx(Ft,{connectionId:y.id,tool:T,isSelected:J(y.id,T.name),onToggle:()=>X(y.id,T.name)},T.name))})})]}):s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsx("div",{className:"text-sm text-muted-foreground text-center",children:"Select a connection to view its tools"})})})]})}const Qt=we({role:we({id:se().optional(),slug:se().optional(),label:se()}),allowAllStaticPermissions:Pe(),staticPermissions:be(se()),toolSet:Le(se(),be(se())),allowAllModels:Pe(),modelSet:Le(se(),be(se())),memberIds:be(se())});function Ve(t,e,l){const n=s.jsx(pe,{checked:t,disabled:e,onCheckedChange:l});return e?s.jsx(ge,{children:s.jsxs(Te,{children:[s.jsx(Ee,{asChild:!0,children:s.jsx("div",{children:n})}),s.jsx(_e,{children:s.jsx("p",{children:"Built-in role permissions cannot be changed"})})]})}):n}function Ht(t){const e=H.c(28),{allowAllStaticPermissions:l,staticPermissions:n,onAllowAllChange:i,onPermissionsChange:r,readOnly:d,searchQuery:h}=t,c=d===void 0?!1:d;let x;e[0]!==h?(x=h.trim().toLowerCase(),e[0]=h,e[1]=x):x=e[1];const f=F.useDeferredValue(x);let a;if(e[2]!==l||e[3]!==f||e[4]!==i||e[5]!==r||e[6]!==c||e[7]!==h||e[8]!==n){const p=Ut(),o=(v,I)=>{if(!c){if(l&&I){const R=p.flatMap(Jt).flatMap(Zt);i(!1),r(R.filter(g=>!v.tools.includes(g)));return}l||r(Vt(v,n,!I))}};let m;e[10]!==f?(m=v=>{const{section:I,capabilities:R}=v;return{section:I,capabilities:R.filter(g=>!f||g.label.toLowerCase().includes(f)||g.description.toLowerCase().includes(f))}},e[10]=f,e[11]=m):m=e[11];const N=p.map(m).filter(qt);let _;e[12]!==l||e[13]!==i||e[14]!==r?(_=()=>{i(!l),r([])},e[12]=l,e[13]=i,e[14]=r,e[15]=_):_=e[15];let E;e[16]!==l||e[17]!==c||e[18]!==_?(E=Ve(l,c,_),e[16]=l,e[17]=c,e[18]=_,e[19]=E):E=e[19];let S;e[20]!==l||e[21]!==i||e[22]!==r||e[23]!==c?(S=c?void 0:()=>{i(!l),r([])},e[20]=l,e[21]=i,e[22]=r,e[23]=c,e[24]=S):S=e[24];let C;e[25]!==E||e[26]!==S?(C=s.jsx(ke,{title:"General",children:s.jsx(Ge,{children:s.jsx(Ue,{title:"All organization permissions",description:"Grant full access to all features below",action:E,onClick:S})})}),e[25]=E,e[26]=S,e[27]=C):C=e[27],a=s.jsx("div",{children:s.jsxs("div",{className:"flex flex-col gap-10 py-4",children:[C,N.length===0&&f?s.jsxs("p",{className:"text-sm text-muted-foreground py-4",children:["No permissions match “",h,"”"]}):N.map(v=>{const{section:I,capabilities:R}=v;return s.jsx(ke,{title:I,children:s.jsx(Ge,{children:R.map(g=>{const O=Bt(g,n,l);return s.jsx(Ue,{title:s.jsxs("span",{className:"flex items-center gap-1.5",children:[g.label,g.dangerous&&s.jsx(ut,{size:12,className:"text-warning shrink-0"})]}),description:g.description,action:Ve(O,c,()=>o(g,O)),onClick:c?void 0:()=>o(g,O)},g.id)})})},I)})]})}),e[2]=l,e[3]=f,e[4]=i,e[5]=r,e[6]=c,e[7]=h,e[8]=n,e[9]=a}else a=e[9];return a}function qt(t){return t.capabilities.length>0}function Zt(t){return t.tools}function Jt(t){return t.capabilities}const ot={anthropic:"Anthropic",openrouter:"OpenRouter"},Xt={openai:"OpenAI",anthropic:"Anthropic",google:"Google","meta-llama":"Meta",mistralai:"Mistral","x-ai":"xAI",deepseek:"DeepSeek",qwen:"Qwen",moonshotai:"MoonshotAI",nvidia:"NVIDIA",perplexity:"Perplexity",cohere:"Cohere",amazon:"Amazon",microsoft:"Microsoft","z-ai":"Z.ai","ibm-granite":"IBM Granite",alibaba:"Alibaba",baidu:"Baidu",bytedance:"ByteDance",tencent:"Tencent",minimax:"MiniMax",nousresearch:"Nous Research",allenai:"Allen AI",inception:"Inception"};function Wt(t,e){const l=t.indexOf("/"),n=l>0?t.slice(0,l):e;return n.startsWith("~")?n.slice(1):n}function es(t){return Xt[t]??ot[t]??t}function ts(t){const e=t.indexOf(": ");return e>0&&e<32?t.slice(e+2):t}const it=30;function ss(t){const e=H.c(44),{connectionId:l,subProviderId:n,subProviderName:i,groupLogo:r,models:d,allConnectionModelIds:h,selectedModels:c,allowAllModels:x,allConnectionModelsSelected:f,onToggleModel:a,onExitAllowAll:p,readOnly:o,defaultExpanded:m}=t,[N,_]=F.useState(m),E=m||N,S=_,[C,v]=F.useState(it);let I;e[0]!==f||e[1]!==x||e[2]!==c?(I=j=>x||f||c.includes("*")||c.includes(j),e[0]=f,e[1]=x,e[2]=c,e[3]=I):I=e[3];const R=I;let g;if(e[4]!==R||e[5]!==d){let j;e[7]!==R?(j=u=>R(u.id),e[7]=R,e[8]=j):j=e[8],g=d.filter(j),e[4]=R,e[5]=d,e[6]=g}else g=e[6];const O=g.length;let b;if(e[9]!==h||e[10]!==x||e[11]!==l||e[12]!==O||e[13]!==E||e[14]!==r||e[15]!==R||e[16]!==d||e[17]!==p||e[18]!==a||e[19]!==o||e[20]!==n||e[21]!==i||e[22]!==C){const j=d.slice(0,C),u=d.length>C;let M;e[24]===Symbol.for("react.memo_cache_sentinel")?(M=()=>S(is),e[24]=M):M=e[24];const A=r??et[n]??tt;let k;e[25]!==i||e[26]!==A?(k=s.jsx(je,{icon:A,name:i,size:"sm"}),e[25]=i,e[26]=A,e[27]=k):k=e[27];let G;e[28]!==i?(G=s.jsx("span",{className:"text-sm font-medium truncate",children:i}),e[28]=i,e[29]=G):G=e[29];let U;e[30]!==k||e[31]!==G?(U=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[k,G]}),e[30]=k,e[31]=G,e[32]=U):U=e[32];let B;e[33]!==O||e[34]!==d.length?(B=s.jsxs(xe,{variant:"secondary",className:"text-xs text-muted-foreground",children:[O,"/",d.length," enabled"]}),e[33]=O,e[34]=d.length,e[35]=B):B=e[35];let w;e[36]!==E?(w=E?s.jsx(Lt,{size:16,className:"text-muted-foreground shrink-0"}):s.jsx(Pt,{size:16,className:"text-muted-foreground shrink-0"}),e[36]=E,e[37]=w):w=e[37];let z;e[38]!==w||e[39]!==B?(z=s.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[B,w]}),e[38]=w,e[39]=B,e[40]=z):z=e[40];let y;e[41]!==z||e[42]!==U?(y=s.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3 hover:bg-muted/50 cursor-pointer",onClick:M,children:[U,z]}),e[41]=z,e[42]=U,e[43]=y):y=e[43],b=s.jsxs("div",{className:"border border-border rounded-lg overflow-hidden bg-card",children:[y,E&&s.jsxs("div",{className:"border-t border-border bg-muted/20",children:[j.map(L=>{const Y=R(L.id),$=()=>{if(!o){if(x){p(l,h,L.id);return}a(l,L.id)}};return s.jsxs("div",{className:K("flex items-center justify-between gap-3 px-4 py-3 border-b border-border last:border-b-0",!o&&"hover:bg-muted/50 cursor-pointer"),onClick:$,children:[s.jsx("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:s.jsx("span",{className:"text-sm truncate",children:L.title})}),s.jsx("div",{onClick:os,children:o?s.jsx(ge,{children:s.jsxs(Te,{children:[s.jsx(Ee,{asChild:!0,children:s.jsx("div",{children:s.jsx(pe,{checked:Y,disabled:!0,onCheckedChange:ns})})}),s.jsx(_e,{children:s.jsx("p",{children:"Built-in role permissions cannot be changed"})})]})}):s.jsx(pe,{checked:Y,onCheckedChange:$})})]},L.id)}),u&&s.jsxs("button",{type:"button",className:"w-full px-4 py-2 text-xs text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors",onClick:()=>v(ls),children:["Show more (",d.length-C," remaining)"]})]})]}),e[9]=h,e[10]=x,e[11]=l,e[12]=O,e[13]=E,e[14]=r,e[15]=R,e[16]=d,e[17]=p,e[18]=a,e[19]=o,e[20]=n,e[21]=i,e[22]=C,e[23]=b}else b=e[23];return b}function ls(t){return t+it}function ns(){}function os(t){return t.stopPropagation()}function is(t){return!t}function rs(t){const e=H.c(33),{connection:l,selectedModels:n,allowAllModels:i,onToggleModel:r,onExitAllowAll:d,allConnectionModelsSelected:h,searchQuery:c,readOnly:x}=t,f=wt(l.id);let a,p,o,m,N;if(e[0]!==h||e[1]!==i||e[2]!==l.id||e[3]!==l.label||e[4]!==l.providerId||e[5]!==d||e[6]!==r||e[7]!==f||e[8]!==x||e[9]!==c||e[10]!==n){N=Symbol.for("react.early_return_sentinel");e:{let S;e[16]!==l.label?(S=A=>({...A,id:A.modelId,provider:l.label}),e[16]=l.label,e[17]=S):S=e[17];const C=f.filter(ms).map(S),v=c.trim().toLowerCase(),I=v?C.filter(A=>A.title.toLowerCase().includes(v)||A.id.toLowerCase().includes(v)||A.provider?.toLowerCase().includes(v)):C;if(I.length===0){N=null;break e}const R=new Map;for(const A of I){const k=Wt(A.id,l.providerId),G=R.get(k)??{models:[],logo:null};G.models.push({id:A.id,title:ts(A.title),logo:A.logo}),!G.logo&&A.logo&&(G.logo=A.logo),R.set(k,G)}const g=Array.from(R.entries()).map(ds).sort(cs),O=g.length===1||v.length>0;o="flex flex-col gap-3";const b=et[l.providerId]??tt;let j;e[18]!==l.providerId||e[19]!==b?(j=s.jsx("img",{src:b,alt:l.providerId,className:"w-4 h-4 rounded-sm dark:bg-white dark:rounded-sm dark:p-px"}),e[18]=l.providerId,e[19]=b,e[20]=j):j=e[20];const u=ot[l.providerId]??l.providerId;let M;e[21]!==u?(M=s.jsx("h4",{className:"text-sm font-medium",children:u}),e[21]=u,e[22]=M):M=e[22],e[23]!==M||e[24]!==j?(m=s.jsxs("div",{className:"flex items-center gap-2",children:[j,M]}),e[23]=M,e[24]=j,e[25]=m):m=e[25],a="flex flex-col gap-3",p=g.map(A=>s.jsx(ss,{connectionId:l.id,subProviderId:A.id,subProviderName:A.name,groupLogo:A.logo,models:A.models,allConnectionModelIds:C.map(as),selectedModels:n,allowAllModels:i,allConnectionModelsSelected:h,onToggleModel:r,onExitAllowAll:d,readOnly:x,defaultExpanded:O},A.id))}e[0]=h,e[1]=i,e[2]=l.id,e[3]=l.label,e[4]=l.providerId,e[5]=d,e[6]=r,e[7]=f,e[8]=x,e[9]=c,e[10]=n,e[11]=a,e[12]=p,e[13]=o,e[14]=m,e[15]=N}else a=e[11],p=e[12],o=e[13],m=e[14],N=e[15];if(N!==Symbol.for("react.early_return_sentinel"))return N;let _;e[26]!==a||e[27]!==p?(_=s.jsx("div",{className:a,children:p}),e[26]=a,e[27]=p,e[28]=_):_=e[28];let E;return e[29]!==o||e[30]!==m||e[31]!==_?(E=s.jsxs("div",{className:o,children:[m,_]}),e[29]=o,e[30]=m,e[31]=_,e[32]=E):E=e[32],E}function as(t){return t.id}function cs(t,e){return t.name.localeCompare(e.name)}function ds(t){const[e,l]=t;return{id:e,name:es(e),logo:l.logo,models:l.models}}function ms(t,e,l){return l.findIndex(n=>n.modelId===t.modelId)===e}function us(t){const e=H.c(35),{allowAllModels:l,modelSet:n,onAllowAllChange:i,onModelSetChange:r,readOnly:d,searchQuery:h}=t,c=d===void 0?!1:d,x=F.useDeferredValue(h),f=Mt();let a;e[0]!==n||e[1]!==r?(a=(g,O)=>{const b=n[g]??[],j={...n};if(b.includes(O)){const u=b.filter(M=>M!==O);u.length===0?delete j[g]:j[g]=u}else j[g]=[...b,O];r(j)},e[0]=n,e[1]=r,e[2]=a):a=e[2];const p=a;let o;e[3]!==n||e[4]!==i||e[5]!==r?(o=(g,O,b)=>{i(!1),r({...n,[g]:O.filter(j=>j!==b)})},e[3]=n,e[4]=i,e[5]=r,e[6]=o):o=e[6];const m=o,N=!c&&"hover:bg-muted/50 cursor-pointer";let _;e[7]!==N?(_=K("flex items-center justify-between px-4 py-3 rounded-lg border border-border bg-card",N),e[7]=N,e[8]=_):_=e[8];let E;e[9]!==l||e[10]!==i||e[11]!==r||e[12]!==c?(E=()=>{if(c)return;const g=!l;i(g),g&&r({})},e[9]=l,e[10]=i,e[11]=r,e[12]=c,e[13]=E):E=e[13];let S;e[14]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx("span",{className:"text-sm font-medium",children:"All models"}),e[14]=S):S=e[14];let C;e[15]!==l||e[16]!==i||e[17]!==r||e[18]!==c?(C=s.jsx("div",{onClick:hs,children:c?s.jsx(ge,{children:s.jsxs(Te,{children:[s.jsx(Ee,{asChild:!0,children:s.jsx("div",{children:s.jsx(pe,{checked:l,disabled:!0,onCheckedChange:fs})})}),s.jsx(_e,{children:s.jsx("p",{children:"Built-in role permissions cannot be changed"})})]})}):s.jsx(pe,{checked:l,onCheckedChange:g=>{i(g),g&&r({})}})}),e[15]=l,e[16]=i,e[17]=r,e[18]=c,e[19]=C):C=e[19];let v;e[20]!==_||e[21]!==E||e[22]!==C?(v=s.jsxs("div",{className:_,onClick:E,children:[S,C]}),e[20]=_,e[21]=E,e[22]=C,e[23]=v):v=e[23];let I;e[24]!==f||e[25]!==l||e[26]!==x||e[27]!==m||e[28]!==n||e[29]!==c||e[30]!==p?(I=f.length===0?s.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:"No LLM connections configured"}):f.map(g=>s.jsx(F.Suspense,{fallback:s.jsxs("div",{className:"px-4 py-3 flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(fe,{className:"size-4 animate-spin"}),"Loading models..."]}),children:s.jsx(rs,{connection:g,selectedModels:n[g.id]??[],allowAllModels:l,onToggleModel:p,onExitAllowAll:m,allConnectionModelsSelected:(n[g.id]??[]).includes("*"),searchQuery:x,readOnly:c})},g.id)),e[24]=f,e[25]=l,e[26]=x,e[27]=m,e[28]=n,e[29]=c,e[30]=p,e[31]=I):I=e[31];let R;return e[32]!==I||e[33]!==v?(R=s.jsxs("div",{className:"flex flex-col h-full overflow-auto gap-6 pb-6",children:[v,I]}),e[32]=I,e[33]=v,e[34]=R):R=e[34],R}function fs(){}function hs(t){return t.stopPropagation()}function xs(t){const e=H.c(52),{open:l,onOpenChange:n,selectedMemberIds:i,onAddMembers:r}=t,[d,h]=F.useState(""),c=F.useDeferredValue(d);let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=[],e[0]=x):x=e[0];const[f,a]=F.useState(x),{data:p}=st();let o,m,N,_,E,S,C,v,I,R,g;if(e[1]!==p?.data?.members||e[2]!==c||e[3]!==r||e[4]!==n||e[5]!==l||e[6]!==f||e[7]!==d||e[8]!==i){const U=p?.data?.members??[];let B;e[20]!==c?(B=y=>{const L=c.toLowerCase();return y.user?.name?.toLowerCase().includes(L)||y.user?.email?.toLowerCase().includes(L)},e[20]=c,e[21]=B):B=e[21];const w=U.filter(B);let z;e[22]!==r||e[23]!==n||e[24]!==f?(z=()=>{r(f),a([]),n(!1)},e[22]=r,e[23]=n,e[24]=f,e[25]=z):z=e[25],N=z,m=Ke,R=l,g=n,o=Qe,v="sm:max-w-md p-0",e[26]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsxs(He,{className:"px-6 pt-6",children:[s.jsx(qe,{children:"Add Members to Role"}),s.jsx(Ze,{children:"Select members to add to this role."})]}),e[26]=I):I=e[26],S="flex flex-col h-80",e[27]!==d?(C=s.jsx("div",{className:"border-b border-border px-4 py-3",children:s.jsx(Oe,{value:d,onChange:h,placeholder:"Search members...",className:"w-full"})}),e[27]=d,e[28]=C):C=e[28],_="flex-1 overflow-auto",E=w.length===0?s.jsx("div",{className:"flex items-center justify-center h-full px-6",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:d?"No members found":"No members available"})}):s.jsx("div",{className:"px-6 py-2 space-y-1",children:w.map(y=>{const L=y.role!=="owner",Y=i.includes(y.id),$=f.includes(y.id);return s.jsxs("label",{className:K("flex items-center gap-3 p-2 rounded-lg",!L||Y?"opacity-50 cursor-not-allowed":"cursor-pointer hover:bg-muted/50"),children:[s.jsx(ve,{checked:$||Y,onCheckedChange:()=>{!L||Y||a(J=>J.includes(y.id)?J.filter(X=>X!==y.id):[...J,y.id])},disabled:!L||Y}),s.jsx(nt,{url:y.user?.image??void 0,fallback:lt(y.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:y.user?.name||"Unknown"}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:y.user?.email})]}),!L&&s.jsx(xe,{variant:"secondary",className:"shrink-0",children:"Owner"}),Y&&L&&s.jsx(xe,{variant:"outline",className:"shrink-0",children:"Added"})]},y.id)})}),e[1]=p?.data?.members,e[2]=c,e[3]=r,e[4]=n,e[5]=l,e[6]=f,e[7]=d,e[8]=i,e[9]=o,e[10]=m,e[11]=N,e[12]=_,e[13]=E,e[14]=S,e[15]=C,e[16]=v,e[17]=I,e[18]=R,e[19]=g}else o=e[9],m=e[10],N=e[11],_=e[12],E=e[13],S=e[14],C=e[15],v=e[16],I=e[17],R=e[18],g=e[19];let O;e[29]!==_||e[30]!==E?(O=s.jsx("div",{className:_,children:E}),e[29]=_,e[30]=E,e[31]=O):O=e[31];let b;e[32]!==O||e[33]!==S||e[34]!==C?(b=s.jsxs("div",{className:S,children:[C,O]}),e[32]=O,e[33]=S,e[34]=C,e[35]=b):b=e[35];let j;e[36]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(Je,{children:"Cancel"}),e[36]=j):j=e[36];const u=f.length===0,M=f.length>0&&`(${f.length})`;let A;e[37]!==N||e[38]!==u||e[39]!==M?(A=s.jsxs(Xe,{className:"px-6 pb-6",children:[j,s.jsxs(We,{onClick:N,disabled:u,children:["Add ",M]})]}),e[37]=N,e[38]=u,e[39]=M,e[40]=A):A=e[40];let k;e[41]!==o||e[42]!==b||e[43]!==A||e[44]!==v||e[45]!==I?(k=s.jsxs(o,{className:v,children:[I,b,A]}),e[41]=o,e[42]=b,e[43]=A,e[44]=v,e[45]=I,e[46]=k):k=e[46];let G;return e[47]!==m||e[48]!==k||e[49]!==R||e[50]!==g?(G=s.jsx(m,{open:R,onOpenChange:g,children:k}),e[47]=m,e[48]=k,e[49]=R,e[50]=g,e[51]=G):G=e[51],G}function ps(t){const e=H.c(29),{memberIds:l,onMemberIdsChange:n,readOnly:i,readOnlyMessage:r,searchQuery:d,addMemberDialogOpen:h,onAddMemberDialogOpenChange:c}=t,x=i===void 0?!1:i,f=r===void 0?"Owner membership cannot be changed":r,a=F.useDeferredValue(d),{data:p}=st();let o,m,N;if(e[0]!==p?.data?.members||e[1]!==a||e[2]!==l||e[3]!==n||e[4]!==x||e[5]!==f||e[6]!==d){const v=p?.data?.members??[];let I;e[10]!==l?(I=b=>l.includes(b.id),e[10]=l,e[11]=I):I=e[11];const R=v.filter(I);let g;e[12]!==a?(g=b=>{const j=a.toLowerCase();return b.user?.name?.toLowerCase().includes(j)||b.user?.email?.toLowerCase().includes(j)},e[12]=a,e[13]=g):g=e[13];const O=R.filter(g);N="flex flex-col h-full",o="flex-1 overflow-auto",m=R.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsxs("div",{className:"text-center",children:[s.jsx("h3",{className:"text-base font-medium mb-1",children:"No members"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Add members to grant them the configured permissions."})]})}):O.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsxs("p",{className:"text-sm text-muted-foreground",children:['No members match "',d,'"']})}):s.jsx("div",{className:"p-4 space-y-2",children:O.map(b=>s.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-muted/30",children:[s.jsx(nt,{url:b.user?.image??void 0,fallback:lt(b.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:b.user?.name||"Unknown"}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:b.user?.email})]}),x?s.jsx(ge,{children:s.jsxs(Te,{children:[s.jsx(Ee,{asChild:!0,children:s.jsx("div",{children:s.jsx(le,{variant:"ghost",size:"sm",disabled:!0,children:s.jsx(Be,{size:16})})})}),s.jsx(_e,{children:s.jsx("p",{children:f})})]})}):s.jsx(le,{variant:"ghost",size:"sm",onClick:()=>n(l.filter(j=>j!==b.id)),children:s.jsx(Be,{size:16})})]},b.id))}),e[0]=p?.data?.members,e[1]=a,e[2]=l,e[3]=n,e[4]=x,e[5]=f,e[6]=d,e[7]=o,e[8]=m,e[9]=N}else o=e[7],m=e[8],N=e[9];let _;e[14]!==o||e[15]!==m?(_=s.jsx("div",{className:o,children:m}),e[14]=o,e[15]=m,e[16]=_):_=e[16];let E;e[17]!==l||e[18]!==n?(E=v=>n([...l,...v]),e[17]=l,e[18]=n,e[19]=E):E=e[19];let S;e[20]!==h||e[21]!==l||e[22]!==c||e[23]!==E?(S=s.jsx(xs,{open:h,onOpenChange:c,selectedMemberIds:l,onAddMembers:E}),e[20]=h,e[21]=l,e[22]=c,e[23]=E,e[24]=S):S=e[24];let C;return e[25]!==N||e[26]!==_||e[27]!==S?(C=s.jsxs("div",{className:N,children:[_,S]}),e[25]=N,e[26]=_,e[27]=S,e[28]=C):C=e[28],C}function gs(t){const e=H.c(3);let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(fe,{size:24,className:"animate-spin text-muted-foreground"})}),e[0]=l):l=e[0];let n;return e[1]!==t?(n=s.jsx(F.Suspense,{fallback:l,children:s.jsx(ps,{...t})}),e[1]=t,e[2]=n):n=e[2],n}const Ts={owner:[],admin:[],user:[]};function Es(t,e,l,n){const i=t==="owner"||t==="admin";return{role:{id:l?.id,slug:t,label:t.charAt(0).toUpperCase()+t.slice(1)},allowAllStaticPermissions:i,staticPermissions:Ts[t],toolSet:{},allowAllModels:!0,modelSet:{},memberIds:e.filter(r=>r.role===t).map(r=>r.id)}}function _s(t,e,l){const n=t.permission||{},i=n.self||[],r=i.includes("*"),d=r?[]:i.filter(a=>a!=="*"),h={};for(const[a,p]of Object.entries(n))if(!(a==="self"||a==="models"))if(a==="*")for(const o of l)h[o.id]=p.includes("*")?o.tools?.map(m=>m.name)??[]:p;else{const o=l.find(m=>m.id===a);o&&(h[a]=p.includes("*")?o.tools?.map(m=>m.name)??[]:p)}const c=n.models||[],x=c.length===0||c.includes("*:*"),f={};if(!x)for(const a of c){const p=a.indexOf(":");if(p===-1)continue;const o=a.slice(0,p),m=a.slice(p+1);f[o]||(f[o]=[]),f[o].push(m)}return{role:{id:t.id,slug:t.role,label:t.label},allowAllStaticPermissions:r,staticPermissions:d,toolSet:h,allowAllModels:x,modelSet:f,memberIds:e.filter(a=>a.role===t.role).map(a=>a.id)}}function Is(t,e){const l={};t.allowAllStaticPermissions?l.self=["*"]:t.staticPermissions.length>0&&(l.self=t.staticPermissions);for(const[n,i]of Object.entries(t.toolSet))if(i.length>0){const d=e.find(h=>h.id===n)?.tools?.map(h=>h.name)??[];l[n]=d.length>0&&d.every(h=>i.includes(h))?["*"]:i}if(t.allowAllModels)l.models=["*:*"];else{const n=[];for(const[i,r]of Object.entries(t.modelSet))for(const d of r)n.push(`${i}:${d}`);n.length>0&&(l.models=n)}return l}function bs(t,e,l){return t.kind==="builtin"?Es(t.role,e,void 0):t.kind==="custom"?_s(t.role,e,l):{role:{id:void 0,slug:void 0,label:""},allowAllStaticPermissions:!1,staticPermissions:[],toolSet:{},allowAllModels:!0,modelSet:{},memberIds:[]}}function Ns(t){const e=H.c(6),{readOnly:l,readOnlyMessage:n,onOpen:i}=t,r=n===void 0?"Owner membership cannot be changed":n;if(l){let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Ee,{asChild:!0,children:s.jsx("div",{children:s.jsxs(le,{variant:"outline",size:"sm",disabled:!0,children:[s.jsx(Se,{size:16}),"Add Member"]})})}),e[0]=c):c=e[0];let x;return e[1]!==r?(x=s.jsx(ge,{children:s.jsxs(Te,{children:[c,s.jsx(_e,{children:s.jsx("p",{children:r})})]})}),e[1]=r,e[2]=x):x=e[2],x}let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Se,{size:16}),e[3]=d):d=e[3];let h;return e[4]!==i?(h=s.jsxs(le,{variant:"outline",size:"sm",onClick:i,children:[d,"Add Member"]}),e[4]=i,e[5]=h):h=e[5],h}function Ss(t){const e=H.c(14),{locator:l}=Ne(),n=Re(),i=yt();let r;e[0]!==l?(r=re.members(l),e[0]=l,e[1]=r):r=e[1];let d;e[2]!==n?(d=()=>n.organization.listMembers(),e[2]=n,e[3]=d):d=e[3];let h;e[4]!==r||e[5]!==d?(h={queryKey:r,queryFn:d},e[4]=r,e[5]=d,e[6]=h):h=e[6];const{data:c,isPending:x}=Ce(h);if(x||!i){let o;return e[7]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(te,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(fe,{size:32,className:"animate-spin text-muted-foreground"})})}),e[7]=o):o=e[7],o}let f;e[8]!==c?.data?.members?(f=c?.data?.members??[],e[8]=c?.data?.members,e[9]=f):f=e[9];const a=f;let p;return e[10]!==i||e[11]!==a||e[12]!==t?(p=s.jsx(Cs,{...t,members:a,connections:i}),e[10]=i,e[11]=a,e[12]=t,e[13]=p):p=e[13],p}function Cs({target:t,onBack:e,onSaved:l,members:n,connections:i}){const{locator:r}=Ne(),d=Re(),h=ze(),c=t.kind==="builtin",x=t.kind==="builtin"&&t.role==="owner",f=t.kind==="new",[a,p]=F.useState(c?"org":"mcp"),o=dt({resolver:mt(Qt),defaultValues:bs(t,n,i)}),m=o.formState.isValid,N=o.formState.isDirty,_=Ye({mutationFn:async u=>{const M=Is(u,i),A=u.role.slug||u.role.label.toLowerCase().replace(/\s+/g,"-"),k=(u.role.slug==="owner"||u.role.slug==="admin"||u.role.slug==="user")&&!u.role.id,G=async(U,B)=>{const w=n.filter(L=>L.role===(B??U)).map(L=>L.id),z=u.memberIds.filter(L=>!w.includes(L)),y=w.filter(L=>!u.memberIds.includes(L));for(const L of z){const Y=await d.organization.updateMemberRole({memberId:L,role:[U]});if(Y?.error)throw new Error(Y.error.message??"Something went wrong")}for(const L of y){const Y=await d.organization.updateMemberRole({memberId:L,role:["user"]});if(Y?.error)throw new Error(Y.error.message??"Something went wrong")}};if(k)return await G(u.role.slug),u;if(u.role.id){const U=u.role.label.toLowerCase().replace(/\s+/g,"-"),B=u.role.slug,w=U!==B,z=await d.organization.updateRole({roleId:u.role.id,data:{permission:M,...w?{roleName:U}:{}}});if(z?.error)throw new Error(z.error.message??"Something went wrong");return await G(w?U:B,w?B:void 0),w?{...u,role:{...u.role,slug:U}}:u}else{const U=await d.organization.createRole({role:A,permission:M});if(U?.error)throw new Error(U.error.message??"Something went wrong");for(const B of u.memberIds){const w=await d.organization.updateMemberRole({memberId:B,role:[A]});if(w?.error)throw new Error(w.error.message)}return{...u,role:{...u.role,id:U.data?.roleData?.id,slug:A}}}},onSuccess:(u,M)=>{h.invalidateQueries({queryKey:re.members(r)}),h.invalidateQueries({queryKey:re.organizationRoles(r)});const A=!M.role.id&&!M.role.slug,k=M.role.slug==="owner"&&!M.role.id;Ae(k?"role_members_updated":A?"role_created":"role_updated",{role_slug:M.role.slug??null}),he.success(k?"Members updated successfully!":A?"Role created successfully!":"Role updated successfully!"),o.reset(u),l(u.role.id)},onError:u=>{he.error(u instanceof Error?u.message:"Failed to save role")}}),E=o.handleSubmit(u=>{if(!u.role.label.trim()){he.error("Role name is required"),o.setFocus("role.label");return}_.mutate(u)}),S=!x,C=t.kind==="builtin"?t.role.charAt(0).toUpperCase()+t.role.slice(1):t.kind==="custom"?t.role.label:"",v=[...x?[]:[{id:"mcp",label:"MCP Permissions"}],{id:"org",label:"Organization Permissions"},{id:"models",label:"Models"},{id:"members",label:"Members"}],[I,R]=F.useState(""),[g,O]=F.useState(!1),b=u=>{p(u),R("")},j={mcp:"Search MCP servers...",org:"Search permissions...",models:"Search models...",members:"Search members..."};return s.jsx(te,{children:s.jsxs(te.Content,{className:K("flex flex-col",a!=="org"&&"overflow-hidden"),children:[s.jsx("div",{className:"shrink-0 mx-auto w-full max-w-[1200px] px-4 md:px-10 pt-8 md:pt-12 pb-4",children:s.jsxs("div",{className:"flex flex-col gap-5",children:[s.jsx(te.Title,{actions:S&&s.jsxs(s.Fragment,{children:[s.jsx(le,{variant:"outline",size:"sm",onClick:e,disabled:_.isPending,children:"Cancel"}),s.jsx(le,{size:"sm",onClick:E,disabled:_.isPending||!m||!N,children:_.isPending?"Saving...":f?"Create Role":"Save Changes"})]}),children:s.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[s.jsx("div",{className:K("size-2.5 rounded-full shrink-0",t.kind==="builtin"?$e(t.role,!0):gt(o.watch("role.label")))}),x&&s.jsx(Fe,{size:16,className:"text-muted-foreground shrink-0"}),f||t.kind==="custom"?s.jsx("input",{...o.register("role.label"),placeholder:"Role name",className:"leading-tight text-foreground bg-transparent border-none outline-none px-1 -mx-1 rounded hover:bg-input/25 focus:bg-input/25 transition-colors w-64 placeholder:text-muted-foreground/50",autoFocus:f}):s.jsx("span",{className:"truncate",children:C})]})}),s.jsx("div",{className:"flex items-center gap-2",children:v.map(u=>s.jsx("button",{type:"button",onClick:()=>b(u.id),className:K("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex items-center",a===u.id?"bg-accent border-border text-foreground":"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),children:u.label},u.id))}),s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[s.jsx(Oe,{value:I,onChange:R,placeholder:j[a]??"Search...",className:"w-full md:w-[375px]"}),a==="members"&&s.jsx(Ns,{readOnly:t.kind==="builtin"&&t.role==="owner",onOpen:()=>O(!0)})]})]})}),s.jsx("div",{className:K("mx-auto w-full max-w-[1200px] px-4 md:px-10 pb-6",a!=="org"&&"flex-1 min-h-0"),children:s.jsxs("div",{className:K(a!=="org"&&"h-full overflow-hidden",a!=="models"&&a!=="org"&&"border border-border rounded-xl bg-card"),children:[a==="mcp"&&!x&&s.jsx(Kt,{toolSet:o.watch("toolSet"),onToolSetChange:u=>o.setValue("toolSet",u,{shouldDirty:!0}),searchQuery:I}),a==="org"&&s.jsx(Ht,{allowAllStaticPermissions:o.watch("allowAllStaticPermissions"),staticPermissions:o.watch("staticPermissions"),onAllowAllChange:u=>o.setValue("allowAllStaticPermissions",u,{shouldDirty:!0}),onPermissionsChange:u=>o.setValue("staticPermissions",u,{shouldDirty:!0}),readOnly:x,searchQuery:I}),a==="models"&&s.jsx(us,{allowAllModels:o.watch("allowAllModels"),modelSet:o.watch("modelSet"),onAllowAllChange:u=>o.setValue("allowAllModels",u,{shouldDirty:!0}),onModelSetChange:u=>o.setValue("modelSet",u,{shouldDirty:!0}),readOnly:x,searchQuery:I}),a==="members"&&s.jsx(gs,{memberIds:o.watch("memberIds"),onMemberIdsChange:u=>o.setValue("memberIds",u,{shouldDirty:!0}),readOnly:t.kind==="builtin"&&(t.role==="owner"||t.role==="user"),readOnlyMessage:t.kind==="builtin"&&t.role==="user"?"User is the default role — members can't be removed from it; assign another role to change their access":"Owner membership cannot be changed",searchQuery:I,addMemberDialogOpen:g,onAddMemberDialogOpenChange:O})]})})]})})}function As(t){return t.kind==="builtin"?`builtin-${t.role}`:t.kind==="custom"?`custom-${t.role.id}`:"new"}function Rs(t){const e=H.c(6),{area:l,children:n}=t,{isPrivileged:i,loading:r,error:d}=Dt();let h;return e[0]!==l||e[1]!==n||e[2]!==d||e[3]!==i||e[4]!==r?(h=s.jsx(kt,{granted:i,loading:r,error:d,area:l,children:n}),e[0]=l,e[1]=n,e[2]=d,e[3]=i,e[4]=r,e[5]=h):h=e[5],h}const Os=[{role:"owner",label:"Owner"},{role:"admin",label:"Admin"},{role:"user",label:"User"}];function js(){const t=H.c(77),[e,l]=F.useState(""),[n,i]=F.useState(null),r=ht();let d;t[0]===Symbol.for("react.memo_cache_sentinel")?(d={strict:!1},t[0]=d):d=t[0];const{role:h}=xt(d),{locator:c}=Ne(),x=Re(),f=ze(),{customRoles:a,refetch:p}=pt();let o;t[1]!==r?(o=P=>r({to:".",search:V=>({...V,role:P})}),t[1]=r,t[2]=o):o=t[2];const m=o;let N;e:{if(!h){N=null;break e}if(h==="new"){N={kind:"new"};break e}if(h.startsWith("builtin-")){N={kind:"builtin",role:h.slice(8)};break e}let P;t[3]!==h?(P=ae=>ae.id===h,t[3]=h,t[4]=P):P=t[4];const V=a.find(P);N=V?{kind:"custom",role:V}:null}const _=N;let E;t[5]!==c?(E=re.members(c),t[5]=c,t[6]=E):E=t[6];let S;t[7]!==x?(S=()=>x.organization.listMembers(),t[7]=x,t[8]=S):S=t[8];let C;t[9]!==E||t[10]!==S?(C={queryKey:E,queryFn:S},t[9]=E,t[10]=S,t[11]=C):C=t[11];const{data:v}=Ce(C);let I;t[12]!==v?.data?.members?(I=v?.data?.members??[],t[12]=v?.data?.members,t[13]=I):I=t[13];const R=I;let g;t[14]!==R?(g=P=>R.filter(V=>V.role===P).length,t[14]=R,t[15]=g):g=t[15];const O=g;let b;if(t[16]!==a||t[17]!==O||t[18]!==e){let P;t[20]!==O?(P=ce=>({kind:"builtin",role:{...ce,memberCount:O(ce.role)}}),t[20]=O,t[21]=P):P=t[21];const V=Os.map(P);let ae;t[22]!==O?(ae=ce=>({kind:"custom",role:{...ce,memberCount:O(ce.role)}}),t[22]=O,t[23]=ae):ae=t[23];const rt=a.map(ae);if(b=[...V,...rt],e){const ce=e.toLowerCase();b=b.filter(at=>at.role.label.toLowerCase().includes(ce))}t[16]=a,t[17]=O,t[18]=e,t[19]=b}else b=t[19];let j;t[24]!==x?(j=async P=>{const V=await x.organization.deleteRole({roleId:P});if(V?.error)throw new Error(V.error.message);return V?.data},t[24]=x,t[25]=j):j=t[25];const u=Ye({mutationFn:j,onSuccess:(P,V)=>{Ae("role_deleted",{role_id:V}),f.invalidateQueries({queryKey:re.members(c)}),f.invalidateQueries({queryKey:re.organizationRoles(c)}),he.success("Role deleted successfully!"),p(),_?.kind==="custom"&&_.role.id===V&&m(void 0)},onError:Ds});let M,A,k,G;t[26]===Symbol.for("react.memo_cache_sentinel")?(G={id:"role",header:"Role",render:Ps,cellClassName:"flex-1 min-w-0",sortable:!0},M={id:"type",header:"Type",render:Ls,cellClassName:"w-28 shrink-0"},A={id:"permissions",header:"Permissions",render:ws,cellClassName:"flex-1 min-w-0"},k={id:"members",header:"Members",render:Ms,cellClassName:"w-24 shrink-0"},t[26]=M,t[27]=A,t[28]=k,t[29]=G):(M=t[26],A=t[27],k=t[28],G=t[29]);let U;t[30]===Symbol.for("react.memo_cache_sentinel")?(U=[G,M,A,k,{id:"actions",header:"",render:P=>P.kind==="builtin"?null:s.jsxs(Tt,{children:[s.jsx(Et,{asChild:!0,children:s.jsx(le,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:ys,children:s.jsx(bt,{size:16})})}),s.jsx(_t,{align:"end",onClick:vs,children:s.jsxs(It,{variant:"destructive",onClick:()=>{const V=P.role;V.id&&i({id:V.id,label:V.label})},children:[s.jsx(Nt,{size:16}),"Delete"]})})]}),cellClassName:"w-12 shrink-0"}],t[30]=U):U=t[30];const B=U;let w;t[31]!==m?(w=P=>{if(P.kind==="builtin")m(`builtin-${P.role.role}`);else{const V=P.role;m(V.id)}},t[31]=m,t[32]=w):w=t[32];const z=w;if(_){let P;t[33]!==m?(P=()=>m(void 0),t[33]=m,t[34]=P):P=t[34];let V;return t[35]!==p||t[36]!==m?(V=()=>{p(),m(void 0)},t[35]=p,t[36]=m,t[37]=V):V=t[37],s.jsx(Ss,{target:_,onBack:P,onSaved:V},As(_))}let y;t[38]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(te.Title,{children:"Roles"}),t[38]=y):y=t[38];let L;t[39]===Symbol.for("react.memo_cache_sentinel")?(L=P=>{P.key==="Escape"&&(l(""),P.target.blur())},t[39]=L):L=t[39];let Y;t[40]!==e?(Y=s.jsx(Oe,{value:e,onChange:l,placeholder:"Search roles...",className:"w-full md:w-[375px]",onKeyDown:L}),t[40]=e,t[41]=Y):Y=t[41];let $;t[42]!==m?($=()=>m("new"),t[42]=m,t[43]=$):$=t[43];let J;t[44]===Symbol.for("react.memo_cache_sentinel")?(J=s.jsx(Se,{size:16}),t[44]=J):J=t[44];let X;t[45]!==$?(X=s.jsxs(le,{onClick:$,children:[J,"Create Role"]}),t[45]=$,t[46]=X):X=t[46];let ne;t[47]!==Y||t[48]!==X?(ne=s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[Y,X]}),t[47]=Y,t[48]=X,t[49]=ne):ne=t[49];let oe;t[50]!==e?(oe=e?s.jsx(De,{title:"No roles found",description:`No roles match "${e}"`}):s.jsx(De,{title:"No roles",description:"Create a role to get started."}),t[50]=e,t[51]=oe):oe=t[51];let ie;t[52]!==b||t[53]!==B||t[54]!==z||t[55]!==oe?(ie=s.jsx(St,{columns:B,data:b,isLoading:!1,onRowClick:z,emptyState:oe}),t[52]=b,t[53]=B,t[54]=z,t[55]=oe,t[56]=ie):ie=t[56];let T;t[57]!==ne||t[58]!==ie?(T=s.jsx(te.Content,{children:s.jsx(te.Body,{children:s.jsxs("div",{className:"flex flex-col gap-6",children:[y,ne,ie]})})}),t[57]=ne,t[58]=ie,t[59]=T):T=t[59];const D=n!==null;let Q;t[60]===Symbol.for("react.memo_cache_sentinel")?(Q=P=>!P&&i(null),t[60]=Q):Q=t[60];let q;t[61]===Symbol.for("react.memo_cache_sentinel")?(q=s.jsx(qe,{children:"Delete Role"}),t[61]=q):q=t[61];const W=n?.label;let Z;t[62]!==W?(Z=s.jsxs(He,{children:[q,s.jsxs(Ze,{children:['Are you sure you want to delete the "',W,'" role? This action cannot be undone.']})]}),t[62]=W,t[63]=Z):Z=t[63];let ee;t[64]===Symbol.for("react.memo_cache_sentinel")?(ee=s.jsx(Je,{children:"Cancel"}),t[64]=ee):ee=t[64];let de;t[65]!==u||t[66]!==n?(de=s.jsxs(Xe,{children:[ee,s.jsx(We,{onClick:()=>{n?.id&&u.mutate(n.id),i(null)},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),t[65]=u,t[66]=n,t[67]=de):de=t[67];let me;t[68]!==Z||t[69]!==de?(me=s.jsxs(Qe,{children:[Z,de]}),t[68]=Z,t[69]=de,t[70]=me):me=t[70];let ue;t[71]!==D||t[72]!==me?(ue=s.jsx(Ke,{open:D,onOpenChange:Q,children:me}),t[71]=D,t[72]=me,t[73]=ue):ue=t[73];let Ie;return t[74]!==T||t[75]!==ue?(Ie=s.jsxs(te,{children:[T,ue]}),t[74]=T,t[75]=ue,t[76]=Ie):Ie=t[76],Ie}function vs(t){return t.stopPropagation()}function ys(t){return t.stopPropagation()}function Ms(t){return s.jsx("span",{className:"text-sm text-foreground",children:t.role.memberCount})}function ws(t){if(t.kind==="builtin")return t.role.role==="owner"||t.role.role==="admin"?s.jsx("span",{className:"text-sm text-muted-foreground",children:"Full access"}):s.jsx("span",{className:"text-sm text-muted-foreground",children:"Basic access"});const e=t.role,l=[];return e.allowsAllStaticPermissions?l.push("Full org access"):e.staticPermissionCount&&e.staticPermissionCount>0&&l.push(`${e.staticPermissionCount} org perm${e.staticPermissionCount!==1?"s":""}`),e.allowsAllConnections?l.push("All connections"):e.connectionCount&&e.connectionCount>0&&l.push(`${e.connectionCount} connection${e.connectionCount!==1?"s":""}`),s.jsx("span",{className:"text-sm text-muted-foreground truncate",children:l.length>0?l.join(", "):"No permissions"})}function Ls(t){return t.kind==="builtin"?s.jsx(xe,{variant:"secondary",className:"text-xs",children:"Built-in"}):s.jsx(xe,{variant:"outline",className:"text-xs",children:"Custom"})}function Ps(t){return s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:K("size-2.5 rounded-full shrink-0",$e(t.role.role,t.kind==="builtin"))}),s.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:t.role.label}),t.kind==="builtin"&&s.jsx(Fe,{size:12,className:"text-muted-foreground shrink-0"})]})}function Ds(t,e){Ae("role_delete_failed",{role_id:e,error:t instanceof Error?t.message:String(t)}),he.error(t instanceof Error?t.message:"Failed to delete role")}function ks(){const t=H.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(te,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("div",{className:"text-sm text-muted-foreground",children:"Failed to load roles"})})}),t[0]=e):e=t[0];let l;return t[1]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(ft,{fallback:e,children:s.jsx(F.Suspense,{fallback:s.jsx(te,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(fe,{size:32,className:"animate-spin text-muted-foreground"})})}),children:s.jsx(js,{})})}),t[1]=l):l=t[1],l}function hn(){const t=H.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Rs,{area:"roles",children:s.jsx(ks,{})}),t[0]=e):e=t[0],e}export{hn as default};
@@ -1 +0,0 @@
1
- import{c as p,j as t,E as P,r as j,w,B as S,t as y}from"./index-Dq2GzmIa.js";import{i as k}from"./AlertCircle-TjPHcEnP.js";import{s as z}from"./Plus-CaVUuJOD.js";import{s as E}from"./User01-B_wV9DLb.js";import{t as F}from"./Users01--ZODDl59.js";import{e as $,d as I,D as O,a as A,h as R,c as T}from"./dialog-DT5S2RMB.js";import{I as N}from"./input-_HbUXqOS.js";import{L as g}from"./label-BtGdlmhk.js";import{S as B,a as V,b as L,c as q,d as C}from"./select-CrSxwLpY.js";import{S as H}from"./skeleton-CFwDF8gK.js";import{T as K}from"./textarea-BHzi6Dhm.js";import{P as b}from"./index-DoiBq52a.js";import{c as W}from"./settings-section-DpMc0HVT.js";import{u as Y,a as G}from"./use-secrets-C4jt5KwT.js";import{R as J}from"./require-capability-DXSues5j.js";import"./X-Dg7rsVai.js";import"./tooltip-BI-udduQ.js";import"./ChevronUp-BcAa4Ljr.js";import"./ChevronDown-C3MkOcZJ.js";import"./sidebar-C5_XfNYh.js";import"./LayoutLeft--D_GxkO2.js";import"./use-mobile-BjsEeYVy.js";import"./card-CPTg8fDY.js";import"./ArrowUpRight-BH4m-RJh.js";import"./studio-tools-DT3M_Vdz.js";import"./use-capability-DMFGKIH5.js";import"./access-gate-BPnO_2yT.js";import"./capability-load-error-96MaJwmz.js";function M(s){const e=p.c(3),{error:r}=s;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(k,{size:16}),e[0]=c):c=e[0];let n;return e[1]!==r.message?(n=t.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[c,t.jsxs("span",{className:"text-sm font-medium",children:["Failed to load secrets: ",r.message]})]}),e[1]=r.message,e[2]=n):n=e[2],n}function Q(s){const e=p.c(5),{scope:r}=s,c=r==="user"?E:F,n=r==="user"?"Private":"Organization";let i;e[0]!==c?(i=t.jsx(c,{size:12}),e[0]=c,e[1]=i):i=e[1];let a;return e[2]!==n||e[3]!==i?(a=t.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-md bg-muted text-muted-foreground text-xs",children:[i,n]}),e[2]=n,e[3]=i,e[4]=a):a=e[4],a}function D(s){const e=p.c(20),{secret:r}=s;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:t.jsx(w,{size:16,className:"text-muted-foreground"})}),e[0]=c):c=e[0];let n;e[1]!==r.name?(n=t.jsx("span",{className:"font-medium text-sm truncate",children:r.name}),e[1]=r.name,e[2]=n):n=e[2];let i;e[3]!==r.scope?(i=t.jsx(Q,{scope:r.scope}),e[3]=r.scope,e[4]=i):i=e[4];let a;e[5]!==n||e[6]!==i?(a=t.jsxs("div",{className:"flex items-center gap-2",children:[n,i]}),e[5]=n,e[6]=i,e[7]=a):a=e[7];let d;e[8]!==r.description?(d=r.description?t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:r.description}):null,e[8]=r.description,e[9]=d):d=e[9];let u;e[10]!==a||e[11]!==d?(u=t.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[c,t.jsxs("div",{className:"min-w-0",children:[a,d]})]}),e[10]=a,e[11]=d,e[12]=u):u=e[12];let l;e[13]!==r.createdAt?(l=new Date(r.createdAt).toLocaleDateString(),e[13]=r.createdAt,e[14]=l):l=e[14];let o;e[15]!==l?(o=t.jsx("div",{className:"text-xs text-muted-foreground shrink-0",children:l}),e[15]=l,e[16]=o):o=e[16];let x;return e[17]!==u||e[18]!==o?(x=t.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[u,o]}),e[17]=u,e[18]=o,e[19]=x):x=e[19],x}function U(s){const e=p.c(5),{onCreate:r}=s;let c,n;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:t.jsx(w,{size:20,className:"text-muted-foreground"})}),n=t.jsxs("div",{children:[t.jsx("p",{className:"font-medium text-sm",children:"No secrets yet"}),t.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:"Store API keys, tokens, and other sensitive values. Values are encrypted at rest and never returned over the API."})]}),e[0]=c,e[1]=n):(c=e[0],n=e[1]);let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(z,{size:14}),e[2]=i):i=e[2];let a;return e[3]!==r?(a=t.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[c,n,t.jsxs(S,{onClick:r,size:"sm",className:"mt-2",children:[i,"New secret"]})]}),e[3]=r,e[4]=a):a=e[4],a}function _({open:s,onOpenChange:e}){const[r,c]=j.useState("organization"),[n,i]=j.useState(""),[a,d]=j.useState(""),[u,l]=j.useState(""),o=G();function x(){c("organization"),i(""),d(""),l("")}function f(){x(),e(!1)}async function h(m){if(m.preventDefault(),!(!n.trim()||!a))try{await o.mutateAsync({scope:r,name:n.trim(),value:a,description:u.trim()||void 0}),y.success(`Secret "${n.trim()}" created`),f()}catch(v){y.error(v instanceof Error?v.message:"Failed to create secret")}}return t.jsx($,{open:s,onOpenChange:m=>{m?e(m):f()},children:t.jsxs(I,{className:"sm:max-w-lg",children:[t.jsxs(O,{children:[t.jsx(A,{children:"New secret"}),t.jsx(R,{children:"Stored encrypted in the credential vault. Choose who can read it."})]}),t.jsxs("form",{onSubmit:h,className:"space-y-4",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-scope",children:"Scope"}),t.jsxs(B,{value:r,onValueChange:m=>c(m),children:[t.jsx(V,{id:"secret-scope",children:t.jsx(L,{})}),t.jsxs(q,{children:[t.jsx(C,{value:"organization",children:"Organization — visible to all members"}),t.jsx(C,{value:"user",children:"Private — only visible to me"})]})]})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-name",children:"Name"}),t.jsx(N,{id:"secret-name",value:n,onChange:m=>i(m.target.value),placeholder:"STRIPE_API_KEY",autoComplete:"off",required:!0}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Letters, digits, underscore, dot, hyphen. Case-insensitive within its scope."})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-value",children:"Value"}),t.jsx(N,{id:"secret-value",type:"password",value:a,onChange:m=>d(m.target.value),autoComplete:"new-password",required:!0})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-description",children:"Description (optional)"}),t.jsx(K,{id:"secret-description",value:u,onChange:m=>l(m.target.value),rows:2,placeholder:"What is this secret used for?"})]}),t.jsxs(T,{children:[t.jsx(S,{type:"button",variant:"outline",onClick:f,disabled:o.isPending,children:"Cancel"}),t.jsx(S,{type:"submit",disabled:o.isPending||!n.trim()||!a,children:o.isPending?"Creating…":"Create secret"})]})]})]})})}function X(){const s=p.c(21),e=Y(),[r,c]=j.useState(!1);if(e.length===0){let l;s[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(U,{onCreate:()=>c(!0)}),s[0]=l):l=s[0];let o;return s[1]!==r?(o=t.jsxs(t.Fragment,{children:[l,t.jsx(_,{open:r,onOpenChange:c})]}),s[1]=r,s[2]=o):o=s[2],o}let n,i,a;if(s[3]!==e){const l=e.filter(se),o=e.filter(te),x=e.length===1?"":"s";let f;s[7]!==e.length||s[8]!==x?(f=t.jsxs("p",{className:"text-sm text-muted-foreground",children:[e.length," secret",x," stored"]}),s[7]=e.length,s[8]=x,s[9]=f):f=s[9];let h;s[10]===Symbol.for("react.memo_cache_sentinel")?(h=()=>c(!0),s[10]=h):h=s[10];let m;s[11]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsxs(S,{onClick:h,size:"sm",children:[t.jsx(z,{size:14}),"New secret"]}),s[11]=m):m=s[11],s[12]!==f?(n=t.jsxs("div",{className:"flex items-center justify-between",children:[f,m]}),s[12]=f,s[13]=n):n=s[13],i=l.length>0?t.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[t.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Organization"}),t.jsx("div",{children:l.map(ee)})]}):null,a=o.length>0?t.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[t.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Private to me"}),t.jsx("div",{children:o.map(Z)})]}):null,s[3]=e,s[4]=n,s[5]=i,s[6]=a}else n=s[4],i=s[5],a=s[6];let d;s[14]!==r?(d=t.jsx(_,{open:r,onOpenChange:c}),s[14]=r,s[15]=d):d=s[15];let u;return s[16]!==n||s[17]!==i||s[18]!==a||s[19]!==d?(u=t.jsxs(t.Fragment,{children:[n,i,a,d]}),s[16]=n,s[17]=i,s[18]=a,s[19]=d,s[20]=u):u=s[20],u}function Z(s){return t.jsx(D,{secret:s},s.id)}function ee(s){return t.jsx(D,{secret:s},s.id)}function te(s){return s.scope==="user"}function se(s){return s.scope==="organization"}function re(){const s=p.c(2);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(b.Title,{children:"Secrets"}),s[0]=e):e=s[0];let r;return s[1]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(b,{children:t.jsx(b.Content,{children:t.jsx(b.Body,{children:t.jsxs(W,{children:[e,t.jsx(P,{fallback:ne,children:t.jsx(j.Suspense,{fallback:t.jsx(H,{className:"h-32 w-full"}),children:t.jsx(X,{})})})]})})})}),s[1]=r):r=s[1],r}function ne(s){const{error:e}=s;return t.jsx(M,{error:e??new Error("Failed to load secrets")})}function $e(){const s=p.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(J,{capability:"secrets:manage",area:"secrets",children:t.jsx(re,{})}),s[0]=e):e=s[0],e}export{$e as default};
@@ -1,4 +0,0 @@
1
- import{r as D,at as ot,c as U,j as s,H as Pe,I as ae,C as oe,n as xe,J as Re,M as Le,d as he,K as te,t as Z,B as ee,p as J,z as rt,l as ne,m as at,b as ct,E as dt,x as ut}from"./index-Dq2GzmIa.js";import{c as $e,e as De,d as Fe,D as mt,a as Ke,h as ft,b as ht}from"./dialog-DT5S2RMB.js";import{g as pt,b as xt,a as gt,D as vt}from"./drawer-XzD4hvpg.js";import{u as bt}from"./use-mobile-BjsEeYVy.js";import{S as Se,u as jt,m as yt,a as ge}from"./chat-context-BAovwxgU.js";import{C as St}from"./checkbox-BdHs-X49.js";import{I as le}from"./input-_HbUXqOS.js";import{S as kt,a as Nt,b as Ct,c as wt,d as It}from"./select-CrSxwLpY.js";import{S as Y}from"./skeleton-CFwDF8gK.js";import{i as Be,b as Ue,c as _t,a as Mt,s as Et}from"./Settings02-BNJ32xSl.js";import{c as Ot,a as At,i as Tt}from"./Tool01-DTY-fPyM.js";import{i as zt}from"./Key01-Dz6Z8ZMZ.js";import{i as We}from"./SearchMd-7xF40qNR.js";import{b as ve,u as Pt,a as Rt}from"./use-ai-providers-w9d34g0F.js";import{g as be}from"./ai-providers-logos-DD3qZ33J.js";import{i as Lt}from"./Monitor01-CbDoyDRV.js";import{i as $t}from"./AlertCircle-TjPHcEnP.js";import{u as pe}from"./studio-tools-DT3M_Vdz.js";import{i as Dt}from"./ChevronRight-D7I_d6Rs.js";import{A as Ft}from"./avatar-Cg58Qi4s.js";import{S as ke,a as Ne,b as He}from"./settings-section-DpMc0HVT.js";import{s as Ve}from"./Eye-CeD9rgkI.js";import{a as me,b as fe,C as Kt}from"./connect-desktop-dialog-CkUcaE26.js";import{t as Ce}from"./ChevronDown-C3MkOcZJ.js";import{a as Bt}from"./Image01-Cm0pa05N.js";import{t as Ut}from"./Stars01-DrN-Oz3U.js";function ie(i,e,t){let l=t.initialDeps??[],n,o=!0;function r(){var a,c,d;let u;t.key&&((a=t.debug)!=null&&a.call(t))&&(u=Date.now());const m=i();if(!(m.length!==l.length||m.some((g,x)=>l[x]!==g)))return n;l=m;let f;if(t.key&&((c=t.debug)!=null&&c.call(t))&&(f=Date.now()),n=e(...m),t.key&&((d=t.debug)!=null&&d.call(t))){const g=Math.round((Date.now()-u)*100)/100,x=Math.round((Date.now()-f)*100)/100,j=x/16,k=(w,I)=>{for(w=String(w);w.length<I;)w=" "+w;return w};console.info(`%c⏱ ${k(x,5)} /${k(g,5)} ms`,`
2
- font-size: .6rem;
3
- font-weight: bold;
4
- color: hsl(${Math.max(0,Math.min(120-120*j,120))}deg 100% 31%);`,t?.key)}return t?.onChange&&!(o&&t.skipInitialOnChange)&&t.onChange(n),o=!1,n}return r.updateDeps=a=>{l=a},r}function we(i,e){if(i===void 0)throw new Error("Unexpected undefined");return i}const Wt=(i,e)=>Math.abs(i-e)<1.01,Ht=(i,e,t)=>{let l;return function(...n){i.clearTimeout(l),l=i.setTimeout(()=>e.apply(this,n),t)}},Ie=i=>{const{offsetWidth:e,offsetHeight:t}=i;return{width:e,height:t}},Vt=i=>i,qt=i=>{const e=Math.max(i.startIndex-i.overscan,0),t=Math.min(i.endIndex+i.overscan,i.count-1),l=[];for(let n=e;n<=t;n++)l.push(n);return l},Gt=(i,e)=>{const t=i.scrollElement;if(!t)return;const l=i.targetWindow;if(!l)return;const n=r=>{const{width:a,height:c}=r;e({width:Math.round(a),height:Math.round(c)})};if(n(Ie(t)),!l.ResizeObserver)return()=>{};const o=new l.ResizeObserver(r=>{const a=()=>{const c=r[0];if(c?.borderBoxSize){const d=c.borderBoxSize[0];if(d){n({width:d.inlineSize,height:d.blockSize});return}}n(Ie(t))};i.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return o.observe(t,{box:"border-box"}),()=>{o.unobserve(t)}},_e={passive:!0},Me=typeof window>"u"?!0:"onscrollend"in window,Xt=(i,e)=>{const t=i.scrollElement;if(!t)return;const l=i.targetWindow;if(!l)return;let n=0;const o=i.options.useScrollendEvent&&Me?()=>{}:Ht(l,()=>{e(n,!1)},i.options.isScrollingResetDelay),r=u=>()=>{const{horizontal:m,isRtl:h}=i.options;n=m?t.scrollLeft*(h&&-1||1):t.scrollTop,o(),e(n,u)},a=r(!0),c=r(!1);t.addEventListener("scroll",a,_e);const d=i.options.useScrollendEvent&&Me;return d&&t.addEventListener("scrollend",c,_e),()=>{t.removeEventListener("scroll",a),d&&t.removeEventListener("scrollend",c)}},Yt=(i,e,t)=>{if(e?.borderBoxSize){const l=e.borderBoxSize[0];if(l)return Math.round(l[t.options.horizontal?"inlineSize":"blockSize"])}return i[t.options.horizontal?"offsetWidth":"offsetHeight"]},Qt=(i,{adjustments:e=0,behavior:t},l)=>{var n,o;const r=i+e;(o=(n=l.scrollElement)==null?void 0:n.scrollTo)==null||o.call(n,{[l.options.horizontal?"left":"top"]:r,behavior:t})};class Jt{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.now=()=>{var t,l,n;return((n=(l=(t=this.targetWindow)==null?void 0:t.performance)==null?void 0:l.now)==null?void 0:n.call(l))??Date.now()},this.observer=(()=>{let t=null;const l=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(n=>{n.forEach(o=>{const r=()=>{const a=o.target,c=this.indexFromElement(a);if(!a.isConnected){this.observer.unobserve(a);return}this.shouldMeasureDuringScroll(c)&&this.resizeItem(c,this.options.measureElement(a,o,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()})}));return{disconnect:()=>{var n;(n=l())==null||n.disconnect(),t=null},observe:n=>{var o;return(o=l())==null?void 0:o.observe(n,{box:"border-box"})},unobserve:n=>{var o;return(o=l())==null?void 0:o.unobserve(n)}}})(),this.range=null,this.setOptions=t=>{Object.entries(t).forEach(([l,n])=>{typeof n>"u"&&delete t[l]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Vt,rangeExtractor:qt,onChange:()=>{},measureElement:Yt,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",...t}},this.notify=t=>{var l,n;(n=(l=this.options).onChange)==null||n.call(l,this,t)},this.maybeNotify=ie(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const l=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==l){if(this.cleanup(),!l){this.maybeNotify();return}this.scrollElement=l,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(n=>{this.observer.observe(n)}),this.unsubs.push(this.options.observeElementRect(this,n=>{this.scrollRect=n,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(n,o)=>{this.scrollAdjustments=0,this.scrollDirection=o?this.getScrollOffset()<n?"forward":"backward":null,this.scrollOffset=n,this.isScrolling=o,this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(t,l)=>{const n=new Map,o=new Map;for(let r=l-1;r>=0;r--){const a=t[r];if(n.has(a.lane))continue;const c=o.get(a.lane);if(c==null||a.end>c.end?o.set(a.lane,a):a.end<c.end&&n.set(a.lane,!0),n.size===this.options.lanes)break}return o.size===this.options.lanes?Array.from(o.values()).sort((r,a)=>r.end===a.end?r.index-a.index:r.end-a.end)[0]:void 0},this.getMeasurementOptions=ie(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode],(t,l,n,o,r,a,c)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMeasuredCacheIndexes=[],{count:t,paddingStart:l,scrollMargin:n,getItemKey:o,enabled:r,lanes:a,laneAssignmentMode:c}),{key:!1}),this.getMeasurements=ie(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:t,paddingStart:l,scrollMargin:n,getItemKey:o,enabled:r,lanes:a,laneAssignmentMode:c},d)=>{if(!r)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>t)for(const f of this.laneAssignments.keys())f>=t&&this.laneAssignments.delete(f);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(f=>{this.itemSizeCache.set(f.key,f.size)}));const u=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===t&&(this.lanesSettling=!1);const m=this.measurementsCache.slice(0,u),h=new Array(a).fill(void 0);for(let f=0;f<u;f++){const g=m[f];g&&(h[g.lane]=f)}for(let f=u;f<t;f++){const g=o(f),x=this.laneAssignments.get(f);let j,k;const w=c==="estimate"||d.has(g);if(x!==void 0&&this.options.lanes>1){j=x;const b=h[j],N=b!==void 0?m[b]:void 0;k=N?N.end+this.options.gap:l+n}else{const b=this.options.lanes===1?m[f-1]:this.getFurthestMeasurement(m,f);k=b?b.end+this.options.gap:l+n,j=b?b.lane:f%this.options.lanes,this.options.lanes>1&&w&&this.laneAssignments.set(f,j)}const I=d.get(g),_=typeof I=="number"?I:this.options.estimateSize(f),M=k+_;m[f]={index:f,start:k,size:_,end:M,key:g,lane:j},h[j]=f}return this.measurementsCache=m,m},{key:!1,debug:()=>this.options.debug}),this.calculateRange=ie(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,l,n,o)=>this.range=t.length>0&&l>0?Zt({measurements:t,outerSize:l,scrollOffset:n,lanes:o}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=ie(()=>{let t=null,l=null;const n=this.calculateRange();return n&&(t=n.startIndex,l=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,l]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,l]},(t,l,n,o,r)=>o===null||r===null?[]:t({startIndex:o,endIndex:r,overscan:l,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=t=>{const l=this.options.indexAttribute,n=t.getAttribute(l);return n?parseInt(n,10):(console.warn(`Missing attribute name '${l}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=t=>{var l;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const n=this.scrollState.index??((l=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:l.index);if(n!==void 0&&this.range){const o=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,n-o),a=Math.min(this.options.count-1,n+o);return t>=r&&t<=a}return!0},this.measureElement=t=>{if(!t){this.elementsCache.forEach((r,a)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(a))});return}const l=this.indexFromElement(t),n=this.options.getItemKey(l),o=this.elementsCache.get(n);o!==t&&(o&&this.observer.unobserve(o),this.observer.observe(t),this.elementsCache.set(n,t)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(l)&&this.resizeItem(l,this.options.measureElement(t,void 0,this))},this.resizeItem=(t,l)=>{var n;const o=this.measurementsCache[t];if(!o)return;const r=this.itemSizeCache.get(o.key)??o.size,a=l-r;a!==0&&(((n=this.scrollState)==null?void 0:n.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(o,a,this):o.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=a,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(o.index),this.itemSizeCache=new Map(this.itemSizeCache.set(o.key,l)),this.notify(!1))},this.getVirtualItems=ie(()=>[this.getVirtualIndexes(),this.getMeasurements()],(t,l)=>{const n=[];for(let o=0,r=t.length;o<r;o++){const a=t[o],c=l[a];n.push(c)}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=t=>{const l=this.getMeasurements();if(l.length!==0)return we(l[qe(0,l.length-1,n=>we(l[n]).start,t)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const t=this.scrollElement.document.documentElement;return this.options.horizontal?t.scrollWidth-this.scrollElement.innerWidth:t.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(t,l,n=0)=>{if(!this.scrollElement)return 0;const o=this.getSize(),r=this.getScrollOffset();l==="auto"&&(l=t>=r+o?"end":"start"),l==="center"?t+=(n-o)/2:l==="end"&&(t-=o);const a=this.getMaxScrollOffset();return Math.max(Math.min(a,t),0)},this.getOffsetForIndex=(t,l="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const n=this.getSize(),o=this.getScrollOffset(),r=this.measurementsCache[t];if(!r)return;if(l==="auto")if(r.end>=o+n-this.options.scrollPaddingEnd)l="end";else if(r.start<=o+this.options.scrollPaddingStart)l="start";else return[o,l];if(l==="end"&&t===this.options.count-1)return[this.getMaxScrollOffset(),l];const a=l==="end"?r.end+this.options.scrollPaddingEnd:r.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,l,r.size),l]},this.scrollToOffset=(t,{align:l="start",behavior:n="auto"}={})=>{const o=this.getOffsetForAlignment(t,l),r=this.now();this.scrollState={index:null,align:l,behavior:n,startedAt:r,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollToIndex=(t,{align:l="auto",behavior:n="auto"}={})=>{t=Math.max(0,Math.min(t,this.options.count-1));const o=this.getOffsetForIndex(t,l);if(!o)return;const[r,a]=o,c=this.now();this.scrollState={index:t,align:a,behavior:n,startedAt:c,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollBy=(t,{behavior:l="auto"}={})=>{const n=this.getScrollOffset()+t,o=this.now();this.scrollState={index:null,align:"start",behavior:l,startedAt:o,lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:l}),this.scheduleScrollReconcile()},this.getTotalSize=()=>{var t;const l=this.getMeasurements();let n;if(l.length===0)n=this.options.paddingStart;else if(this.options.lanes===1)n=((t=l[l.length-1])==null?void 0:t.end)??0;else{const o=Array(this.options.lanes).fill(null);let r=l.length-1;for(;r>=0&&o.some(a=>a===null);){const a=l[r];o[a.lane]===null&&(o[a.lane]=a.end),r--}n=Math.max(...o.filter(a=>a!==null))}return Math.max(n-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(t,{adjustments:l,behavior:n})=>{this.options.scrollToFn(t,{behavior:n,adjustments:l},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(e)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const l=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,n=l?l[0]:this.scrollState.lastTargetOffset,o=1,r=n!==this.scrollState.lastTargetOffset;if(!r&&Wt(n,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=o){this.scrollState=null;return}}else this.scrollState.stableFrames=0,r&&(this.scrollState.lastTargetOffset=n,this.scrollState.behavior="auto",this._scrollToOffset(n,{adjustments:void 0,behavior:"auto"}));this.scheduleScrollReconcile()}}const qe=(i,e,t,l)=>{for(;i<=e;){const n=(i+e)/2|0,o=t(n);if(o<l)i=n+1;else if(o>l)e=n-1;else return n}return i>0?i-1:0};function Zt({measurements:i,outerSize:e,scrollOffset:t,lanes:l}){const n=i.length-1,o=c=>i[c].start;if(i.length<=l)return{startIndex:0,endIndex:n};let r=qe(0,n,o,t),a=r;if(l===1)for(;a<n&&i[a].end<t+e;)a++;else if(l>1){const c=Array(l).fill(0);for(;a<n&&c.some(u=>u<t+e);){const u=i[a];c[u.lane]=u.end,a++}const d=Array(l).fill(t+e);for(;r>=0&&d.some(u=>u>=t);){const u=i[r];d[u.lane]=u.start,r--}r=Math.max(0,r-r%l),a=Math.min(n,a+(l-1-a%l))}return{startIndex:r,endIndex:a}}const Ee=typeof document<"u"?D.useLayoutEffect:D.useEffect;function es({useFlushSync:i=!0,...e}){const t=D.useReducer(()=>({}),{})[1],l={...e,onChange:(o,r)=>{var a;i&&r?ot.flushSync(t):t(),(a=e.onChange)==null||a.call(e,o,r)}},[n]=D.useState(()=>new Jt(l));return n.setOptions(l),Ee(()=>n._didMount(),[]),Ee(()=>n._willUpdate()),n}function ts(i){return es({observeElementRect:Gt,observeElementOffset:Xt,scrollToFn:Qt,...i})}const Ge=[{id:"openai",name:"OpenAI",description:"GPT-4, GPT-5, and other OpenAI models",logo:"https://decoims.com/decocms/b51001ef-ae58-4db4-8a75-9e6d2df2dd8e/openai.png",baseUrlPlaceholder:"https://api.openai.com/v1",defaultBaseUrl:"https://api.openai.com/v1",apiKeyRecommended:!0,helpText:"Use your OpenAI API key (starts with sk-)."},{id:"litellm",name:"LiteLLM",description:"Connect to a LiteLLM gateway your team manages",logo:"https://decoims.com/decocms/e974ae05-ad64-4b4a-8444-d9705f019b85/litellm.png",baseUrlPlaceholder:"http://localhost:4000",apiKeyRecommended:!0,helpText:"Point at your LiteLLM proxy. The base URL should be the root of the proxy (we'll append /v1)."},{id:"ollama",name:"Ollama",description:"Run open-source models on your own computer",logo:"https://decoims.com/decocms/2bb2f822-5288-4b7c-a541-dcbef76525a0/ollama.png",baseUrlPlaceholder:"http://localhost:11434",apiKeyRecommended:!1,helpText:"Ollama exposes /v1 by default — no API key required for local use."},{id:"lm-studio",name:"LM Studio",description:"Open models running through LM Studio",logo:"https://decoims.com/decocms/9f0ab1a9-d2d5-4f3e-9de0-aadd4926428d/lmstudio.webp",baseUrlPlaceholder:"http://localhost:1234",apiKeyRecommended:!1,helpText:"Start the local server in LM Studio, then paste its base URL here."},{id:"vllm",name:"vLLM",description:"Connect to your team's self-hosted vLLM server",logo:"https://decoims.com/decocms/b6c60e4f-a4aa-443c-981f-ad0f31640e22/vllm.png",baseUrlPlaceholder:"http://localhost:8000",apiKeyRecommended:!1}];function ce(i){if(i)return Ge.find(e=>e.id===i)}const Oe=4;function re(i){const e=U.c(8),{logo:t,name:l,description:n,onClick:o}=i;let r;e[0]!==t||e[1]!==l?(r=t?s.jsx("img",{src:t,alt:l,className:"size-8 rounded-md object-contain dark:bg-white dark:p-0.5"}):s.jsx(Ft,{fallback:l.charAt(0),className:"size-8 bg-primary/10 text-primary"}),e[0]=t,e[1]=l,e[2]=r):r=e[2];let a;return e[3]!==n||e[4]!==l||e[5]!==o||e[6]!==r?(a=s.jsx(He,{onClick:o,icon:r,title:l,description:n}),e[3]=n,e[4]=l,e[5]=o,e[6]=r,e[7]=a):a=e[7],a}function Xe(i){const e=U.c(32),{providers:t,onSelect:l,onShowAll:n}=i;let o;e[0]!==t?(o=t.find(ns),e[0]=t,e[1]=o):o=e[1];const r=o;let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a={openrouter:0,llmapi:1,anthropic:2,google:3},e[2]=a):a=e[2];const c=a;let d;if(e[3]!==l||e[4]!==t){let I;e[6]===Symbol.for("react.memo_cache_sentinel")?(I=(v,E)=>{const A=c[v.id]??Number.MAX_SAFE_INTEGER,z=c[E.id]??Number.MAX_SAFE_INTEGER;return A-z},e[6]=I):I=e[6];const _=t.filter(ls).sort(I);let M;e[7]!==t?(M=t.find(is),e[7]=t,e[8]=M):M=e[8];const b=M;let N;e[9]===Symbol.for("react.memo_cache_sentinel")?(N=ce("openai"),e[9]=N):N=e[9];const S=N;let C;e[10]!==l?(C=v=>s.jsx(re,{logo:v.logo,name:v.name,description:v.description,onClick:()=>l({kind:"provider",provider:v})},v.id),e[10]=l,e[11]=C):C=e[11];let p,y;e[12]!==l||e[13]!==b?(p=b&&S?[s.jsx(re,{logo:S.logo,name:S.name,description:S.description,onClick:()=>l({kind:"openai-compatible",provider:b,preset:S})},S.id)]:[],y=b?[...Ge.filter(ss).map(v=>s.jsx(re,{logo:v.logo,name:v.name,description:v.description,onClick:()=>l({kind:"openai-compatible",provider:b,preset:v})},v.id)),s.jsx(re,{logo:b.logo,name:"Custom OpenAI-compatible",description:"Bring your own model server (advanced)",onClick:()=>l({kind:"openai-compatible",provider:b,preset:null})},"custom")]:[],e[12]=l,e[13]=b,e[14]=p,e[15]=y):(p=e[14],y=e[15]),d=[..._.map(C),...p,...y],e[3]=l,e[4]=t,e[5]=d}else d=e[5];const u=d,m=u.length-Oe,h=!!n&&m>0;let f;e[16]!==u||e[17]!==h?(f=h?u.slice(0,Oe):u,e[16]=u,e[17]=h,e[18]=f):f=e[18];const g=f;let x;e[19]!==r||e[20]!==l?(x=r&&s.jsx(ke,{children:s.jsxs("div",{className:"relative rounded-xl border border-violet-400/30 bg-gradient-to-br from-violet-50/50 via-transparent to-lime-50/30 dark:from-violet-950/20 dark:to-lime-950/10 p-1.5",children:[s.jsx("div",{className:"absolute inset-0 rounded-xl bg-gradient-to-br from-violet-400/5 to-lime-400/5 pointer-events-none"}),s.jsx("p",{className:"text-xs font-medium text-violet-700 dark:text-violet-400 mb-1.5 px-2 pt-2 relative",children:"Recommended — 100+ models, pay as you go"}),s.jsx(Ne,{className:"relative",children:s.jsx(re,{logo:r.logo,name:r.name,description:r.description,onClick:()=>l({kind:"provider",provider:r})})})]})}),e[19]=r,e[20]=l,e[21]=x):x=e[21];let j;e[22]!==m||e[23]!==n||e[24]!==h?(j=h&&s.jsx(He,{onClick:n,title:`${m} more provider${m===1?"":"s"}`,action:s.jsx(Dt,{size:16,className:"text-muted-foreground"})}),e[22]=m,e[23]=n,e[24]=h,e[25]=j):j=e[25];let k;e[26]!==j||e[27]!==g?(k=s.jsx(ke,{children:s.jsxs(Ne,{children:[g,j]})}),e[26]=j,e[27]=g,e[28]=k):k=e[28];let w;return e[29]!==x||e[30]!==k?(w=s.jsxs("div",{className:"flex flex-col gap-6",children:[x,k]}),e[29]=x,e[30]=k,e[31]=w):w=e[31],w}function ss(i){return i.id!=="openai"}function is(i){return i.id==="openai-compatible"}function ls(i){return i.id!=="deco"&&i.id!=="openai-compatible"}function ns(i){return i.id==="deco"}const os=Pe({label:ae().optional(),apiKey:ae().min(1,"API key is required")});function rs(i){const e=U.c(60),{providerId:t,onCancel:l,onSuccess:n}=i,{org:o}=oe(),r=pe(),a=xe(),[c,d]=D.useState(!1);let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u={resolver:Re(os),defaultValues:{label:"",apiKey:""}},e[0]=u):u=e[0];const{register:m,handleSubmit:h,formState:f}=Le(u),{errors:g}=f;let x;e[1]!==t||e[2]!==r?(x=async H=>{await r.call("AI_PROVIDER_KEY_CREATE",{providerId:t,label:H.label||"Personal key",apiKey:H.apiKey})},e[1]=t,e[2]=r,e[3]=x):x=e[3];let j;e[4]!==n||e[5]!==o||e[6]!==a?(j=()=>{a.invalidateQueries({queryKey:te.aiProviderKeys(o.id)}),a.invalidateQueries({queryKey:te.aiProviders(o.id)}),Z.success("Key saved successfully"),n()},e[4]=n,e[5]=o,e[6]=a,e[7]=j):j=e[7];let k;e[8]!==x||e[9]!==j?(k={mutationFn:x,onSuccess:j,onError:as},e[8]=x,e[9]=j,e[10]=k):k=e[10];const{mutate:w,isPending:I,error:_}=he(k);let M;e[11]!==w?(M=H=>w(H),e[11]=w,e[12]=M):M=e[12];let b;e[13]!==h||e[14]!==M?(b=h(M),e[13]=h,e[14]=M,e[15]=b):b=e[15];let N;e[16]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Label"}),e[16]=N):N=e[16];let S;e[17]!==m?(S=m("label"),e[17]=m,e[18]=S):S=e[18];let C;e[19]!==S?(C=s.jsxs("div",{className:"space-y-1",children:[N,s.jsx(le,{placeholder:"e.g. Personal key",...S,className:"h-8 text-sm"})]}),e[19]=S,e[20]=C):C=e[20];let p;e[21]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"API Key"}),e[21]=p):p=e[21];const y=c?"text":"password";let v;e[22]!==m?(v=m("apiKey"),e[22]=m,e[23]=v):v=e[23];let E;e[24]!==y||e[25]!==v?(E=s.jsx(le,{type:y,placeholder:"sk-...",...v,className:"ph-no-capture h-8 text-sm pr-8"}),e[24]=y,e[25]=v,e[26]=E):E=e[26];let A;e[27]!==c?(A=()=>d(!c),e[27]=c,e[28]=A):A=e[28];const z=c?"Hide API key":"Show API key";let O;e[29]!==c?(O=c?s.jsx(Be,{size:14}):s.jsx(Ve,{size:14}),e[29]=c,e[30]=O):O=e[30];let R;e[31]!==A||e[32]!==z||e[33]!==O?(R=s.jsx("button",{type:"button",onClick:A,"aria-label":z,className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:O}),e[31]=A,e[32]=z,e[33]=O,e[34]=R):R=e[34];let P;e[35]!==E||e[36]!==R?(P=s.jsxs("div",{className:"relative",children:[E,R]}),e[35]=E,e[36]=R,e[37]=P):P=e[37];let L;e[38]!==g.apiKey?(L=g.apiKey&&s.jsx("p",{className:"text-xs text-destructive",children:g.apiKey.message}),e[38]=g.apiKey,e[39]=L):L=e[39];let F;e[40]!==P||e[41]!==L?(F=s.jsxs("div",{className:"space-y-1",children:[p,P,L]}),e[40]=P,e[41]=L,e[42]=F):F=e[42];let W;e[43]!==_?(W=_&&s.jsx("p",{className:"text-xs text-destructive",children:_.message}),e[43]=_,e[44]=W):W=e[44];let B;e[45]!==I||e[46]!==l?(B=s.jsx(ee,{type:"button",variant:"ghost",size:"sm",onClick:l,disabled:I,children:"Cancel"}),e[45]=I,e[46]=l,e[47]=B):B=e[47];const G=I?"Saving...":"Save Key";let K;e[48]!==I||e[49]!==G?(K=s.jsx(ee,{type:"submit",size:"sm",disabled:I,children:G}),e[48]=I,e[49]=G,e[50]=K):K=e[50];let V;e[51]!==B||e[52]!==K?(V=s.jsxs($e,{children:[B,K]}),e[51]=B,e[52]=K,e[53]=V):V=e[53];let T;return e[54]!==C||e[55]!==F||e[56]!==W||e[57]!==V||e[58]!==b?(T=s.jsxs("form",{onSubmit:b,className:"space-y-3",children:[C,F,W,V]}),e[54]=C,e[55]=F,e[56]=W,e[57]=V,e[58]=b,e[59]=T):T=e[59],T}function as(i){Z.error(`Failed to save key: ${i.message}`)}const cs=Pe({label:ae().optional(),baseUrl:ae().min(1,"Base URL is required"),apiKey:ae().optional()});function ds(i){const e=U.c(71),{preset:t,onCancel:l,onSuccess:n}=i,{org:o}=oe(),r=pe(),a=xe(),[c,d]=D.useState(!1);let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=Re(cs),e[0]=u):u=e[0];const m=t?.defaultBaseUrl??"";let h;e[1]!==m?(h={resolver:u,defaultValues:{label:"",baseUrl:m,apiKey:""}},e[1]=m,e[2]=h):h=e[2];const{register:f,handleSubmit:g,formState:x}=Le(h),{errors:j}=x;let k;e[3]!==t||e[4]!==r?(k=async se=>{const nt=JSON.stringify({baseUrl:se.baseUrl,apiKey:se.apiKey||""});await r.call("AI_PROVIDER_KEY_CREATE",{providerId:"openai-compatible",label:se.label||t?.name||se.baseUrl,apiKey:nt,...t?{presetId:t.id}:{}})},e[3]=t,e[4]=r,e[5]=k):k=e[5];let w;e[6]!==n||e[7]!==o||e[8]!==a?(w=()=>{a.invalidateQueries({queryKey:te.aiProviderKeys(o.id)}),a.invalidateQueries({queryKey:te.aiProviders(o.id)}),Z.success("Connection saved successfully"),n()},e[6]=n,e[7]=o,e[8]=a,e[9]=w):w=e[9];let I;e[10]!==k||e[11]!==w?(I={mutationFn:k,onSuccess:w,onError:us},e[10]=k,e[11]=w,e[12]=I):I=e[12];const{mutate:_,isPending:M,error:b}=he(I),N=t?`e.g. ${t.name} prod, ${t.name} dev`:"e.g. My OpenAI-compatible server",S=t?.baseUrlPlaceholder??"http://localhost:4000/v1";let C;e[13]!==_?(C=se=>_(se),e[13]=_,e[14]=C):C=e[14];let p;e[15]!==g||e[16]!==C?(p=g(C),e[15]=g,e[16]=C,e[17]=p):p=e[17];let y;e[18]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Label"}),e[18]=y):y=e[18];let v;e[19]!==f?(v=f("label"),e[19]=f,e[20]=v):v=e[20];let E;e[21]!==N||e[22]!==v?(E=s.jsxs("div",{className:"space-y-1",children:[y,s.jsx(le,{placeholder:N,...v,className:"h-8 text-sm"})]}),e[21]=N,e[22]=v,e[23]=E):E=e[23];let A;e[24]!==S||e[25]!==j||e[26]!==t?.defaultBaseUrl||e[27]!==f?(A=t?.defaultBaseUrl?s.jsx("input",{type:"hidden",...f("baseUrl")}):s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Base URL"}),s.jsx(le,{type:"url",placeholder:S,...f("baseUrl"),className:"h-8 text-sm"}),j.baseUrl&&s.jsx("p",{className:"text-xs text-destructive",children:j.baseUrl.message})]}),e[24]=S,e[25]=j,e[26]=t?.defaultBaseUrl,e[27]=f,e[28]=A):A=e[28];const z=t?.apiKeyRecommended?"recommended":"optional";let O;e[29]!==z?(O=s.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["API Key"," ",s.jsxs("span",{className:"text-muted-foreground/60",children:["(",z,")"]})]}),e[29]=z,e[30]=O):O=e[30];const R=c?"text":"password";let P;e[31]!==f?(P=f("apiKey"),e[31]=f,e[32]=P):P=e[32];let L;e[33]!==R||e[34]!==P?(L=s.jsx(le,{type:R,placeholder:"sk-...",...P,className:"ph-no-capture h-8 text-sm pr-8"}),e[33]=R,e[34]=P,e[35]=L):L=e[35];let F;e[36]!==c?(F=()=>d(!c),e[36]=c,e[37]=F):F=e[37];const W=c?"Hide API key":"Show API key";let B;e[38]!==c?(B=c?s.jsx(Be,{size:14}):s.jsx(Ve,{size:14}),e[38]=c,e[39]=B):B=e[39];let G;e[40]!==F||e[41]!==W||e[42]!==B?(G=s.jsx("button",{type:"button",onClick:F,"aria-label":W,className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:B}),e[40]=F,e[41]=W,e[42]=B,e[43]=G):G=e[43];let K;e[44]!==L||e[45]!==G?(K=s.jsxs("div",{className:"relative",children:[L,G]}),e[44]=L,e[45]=G,e[46]=K):K=e[46];let V;e[47]!==O||e[48]!==K?(V=s.jsxs("div",{className:"space-y-1",children:[O,K]}),e[47]=O,e[48]=K,e[49]=V):V=e[49];let T;e[50]!==t?(T=t?.helpText&&s.jsx("p",{className:"text-xs text-muted-foreground",children:t.helpText}),e[50]=t,e[51]=T):T=e[51];let H;e[52]!==b?(H=b&&s.jsx("p",{className:"text-xs text-destructive",children:b.message}),e[52]=b,e[53]=H):H=e[53];let q;e[54]!==M||e[55]!==l?(q=s.jsx(ee,{type:"button",variant:"ghost",size:"sm",onClick:l,disabled:M,children:"Cancel"}),e[54]=M,e[55]=l,e[56]=q):q=e[56];const Q=M?"Saving...":"Save Connection";let X;e[57]!==M||e[58]!==Q?(X=s.jsx(ee,{type:"submit",size:"sm",disabled:M,children:Q}),e[57]=M,e[58]=Q,e[59]=X):X=e[59];let $;e[60]!==q||e[61]!==X?($=s.jsxs($e,{children:[q,X]}),e[60]=q,e[61]=X,e[62]=$):$=e[62];let de;return e[63]!==E||e[64]!==A||e[65]!==V||e[66]!==T||e[67]!==H||e[68]!==$||e[69]!==p?(de=s.jsxs("form",{onSubmit:p,className:"space-y-3",children:[E,A,V,T,H,$]}),e[63]=E,e[64]=A,e[65]=V,e[66]=T,e[67]=H,e[68]=$,e[69]=p,e[70]=de):de=e[70],de}function us(i){Z.error(`Failed to save connection: ${i.message}`)}const ms={kind:"closed"};function fs(i,e){switch(e.type){case"open":return i.kind==="closed"?{kind:"grid"}:i;case"close":return{kind:"closed"};case"back":switch(i.kind){case"form":case"oauth-pending":case"provision-pending":case"provision-error":return{kind:"grid"};default:return i}case"select-form":return i.kind!=="grid"?i:{kind:"form",providerId:e.providerId,presetId:e.presetId};case"select-oauth":return i.kind!=="grid"?i:{kind:"oauth-pending",providerId:e.providerId,stateToken:e.stateToken};case"oauth-failed":return i.kind==="oauth-pending"?{kind:"grid"}:i;case"select-provision":return i.kind!=="grid"?i:{kind:"provision-pending",providerId:e.providerId};case"provision-error":return i.kind!=="provision-pending"?i:{kind:"provision-error",providerId:i.providerId,error:e.error};case"retry-provision":return i.kind!=="provision-error"?i:{kind:"provision-pending",providerId:i.providerId}}}function hs(i){switch(i.kind){case"form":case"oauth-pending":case"provision-pending":case"provision-error":return i.providerId;default:return null}}function ps({open:i,onOpenChange:e,initialProvider:t}){const n=ve()?.providers??[],{org:o}=oe(),r=pe(),a=xe(),[c,d]=D.useReducer(fs,ms),u=D.useRef(!1);D.useEffect(()=>{i&&c.kind==="closed"?d({type:"open"}):!i&&c.kind!=="closed"&&d({type:"close"})},[i,c.kind]);const m=()=>{u.current=!1,d({type:"close"}),e(!1)},h=()=>{a.invalidateQueries({queryKey:te.aiProviderKeys(o.id)}),a.invalidateQueries({queryKey:te.aiProviders(o.id)})},{mutate:f}=he({mutationFn:async({providerId:p,code:y,stateToken:v,label:E})=>(await r.call("AI_PROVIDER_OAUTH_EXCHANGE",{providerId:p,code:y,stateToken:v,label:E}),p),onSuccess:p=>{J("ai_provider_oauth_succeeded",{provider_id:p}),h();const y=n.find(v=>v.id===p);Z.success(`${y?.name??"Provider"} connected successfully`),m()},onError:(p,y)=>{J("ai_provider_oauth_failed",{provider_id:y.providerId,error:p.message}),Z.error(`OAuth connection failed: ${p.message}`),d({type:"oauth-failed"})}}),{mutate:g}=he({mutationFn:async p=>(await r.call("AI_PROVIDER_PROVISION_KEY",{providerId:p}),p),onSuccess:p=>{J("ai_provider_provision_succeeded",{provider_id:p}),h();const y=n.find(v=>v.id===p);Z.success(`${y?.name??"Provider"} connected successfully`),m()},onError:(p,y)=>{J("ai_provider_provision_failed",{provider_id:y,error:p.message}),d({type:"provision-error",error:p.message})}}),x=async p=>{const{provider:y}=p,v=p.kind==="openai-compatible"?p.preset?.id??null:null,E=y.supportedMethods.includes("oauth-pkce"),A=y.supportedMethods.includes("api-key");if(y.supportsProvision===!0){J("ai_provider_connect_clicked",{provider_id:y.id,method:"provision"}),d({type:"select-provision",providerId:y.id}),g(y.id);return}if(E){J("ai_provider_connect_clicked",{provider_id:y.id,method:"oauth-pkce"});try{const O=await r.call("AI_PROVIDER_OAUTH_URL",{providerId:y.id,callbackUrl:`${window.location.origin}/oauth/callback/ai-provider`});if(!O?.url)throw new Error("Invalid response from AI_PROVIDER_OAUTH_URL");d({type:"select-oauth",providerId:y.id,stateToken:O.stateToken}),window.open(O.url,"AiProviderOAuth","width=600,height=700")}catch(O){Z.error(`Failed to start OAuth: ${O instanceof Error?O.message:String(O)}`)}return}A&&(J("ai_provider_connect_clicked",{provider_id:y.id,...v!==null?{preset_id:v}:{},method:"api-key"}),d({type:"select-form",providerId:y.id,presetId:v}))},j=D.useRef(x);j.current=x;const k=D.useRef(t);k.current=t,D.useEffect(()=>{!k.current||c.kind!=="grid"||u.current||(u.current=!0,j.current(k.current))},[c.kind]);const w=c.kind==="oauth-pending"?c.stateToken:null,I=c.kind==="oauth-pending"?c.providerId:null;D.useEffect(()=>{if(c.kind!=="oauth-pending")return;let p=!1;const y=c.stateToken,v=c.providerId,E=z=>{if(z.origin!==window.location.origin||z.data?.type!=="AI_PROVIDER_OAUTH_CALLBACK")return;const{code:O,stateToken:R}=z.data;if(R!==y){Z.error("Security check failed: State token mismatch"),d({type:"oauth-failed"});return}p=!0;const P=n.find(L=>L.id===v);f({providerId:v,code:O,stateToken:y,label:P?.name??v})};window.addEventListener("message",E);const A=setTimeout(()=>{p||(J("ai_provider_oauth_timeout",{provider_id:v}),d({type:"oauth-failed"}),Z.error("Connection timed out"))},12e4);return()=>{window.removeEventListener("message",E),clearTimeout(A)}},[c.kind,w,I,f]);const _=hs(c),M=_?n.find(p=>p.id===_):null,N=(c.kind==="form"&&c.presetId?ce(c.presetId):null)?.name??M?.name??"Connect an AI provider",S=c.kind!=="grid"&&c.kind!=="closed",C=()=>{t?m():d({type:"back"})};return s.jsx(De,{open:c.kind!=="closed",onOpenChange:p=>!p&&m(),children:s.jsxs(Fe,{className:"sm:max-w-md max-h-[90vh] overflow-y-auto",children:[s.jsxs(mt,{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[S&&s.jsx(ee,{variant:"ghost",size:"icon","aria-label":"Back",className:"h-7 w-7",onClick:C,children:s.jsx(Ue,{size:16})}),s.jsx(Ke,{children:N})]}),c.kind==="grid"&&!t&&s.jsx(ft,{children:"Pick a provider — we'll handle the rest."})]}),c.kind==="grid"&&!t&&s.jsx(Xe,{providers:n,onSelect:x}),c.kind==="form"&&(c.providerId==="openai-compatible"?s.jsx(ds,{preset:c.presetId?ce(c.presetId):void 0,onCancel:()=>d({type:"back"}),onSuccess:()=>{h(),m()}}):s.jsx(rs,{providerId:c.providerId,onCancel:()=>d({type:"back"}),onSuccess:()=>{h(),m()}})),c.kind==="oauth-pending"&&s.jsxs("div",{className:"flex flex-col items-center gap-4 py-8",children:[s.jsx(Se,{size:"lg"}),s.jsx("p",{className:"text-sm text-muted-foreground text-center",children:"Authorize the connection in the popup window. This dialog will close once authorization completes."})]}),c.kind==="provision-pending"&&s.jsxs("div",{className:"flex flex-col items-center gap-4 py-8",children:[s.jsx(Se,{size:"lg"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Connecting…"})]}),c.kind==="provision-error"&&s.jsxs("div",{className:"flex flex-col items-center gap-4 py-6",children:[s.jsx($t,{size:28,className:"text-destructive"}),s.jsx("p",{className:"text-sm text-foreground text-center",children:c.error}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(ee,{variant:"outline",size:"sm",onClick:()=>d({type:"back"}),children:"Back"}),s.jsx(ee,{size:"sm",onClick:()=>{d({type:"retry-provision"}),g(c.providerId)},children:"Retry"})]})]})]})})}function xs(){const i=U.c(7),{org:e}=oe(),t=pe();let l;i[0]!==e.id?(l=te.defaultBrand(e.id),i[0]=e.id,i[1]=l):l=i[1];let n;i[2]!==t?(n=async()=>{const{items:a}=await t.call("BRAND_CONTEXT_LIST",{});return(Array.isArray(a)?a:[]).find(gs)??null},i[2]=t,i[3]=n):n=i[3];let o;i[4]!==l||i[5]!==n?(o={queryKey:l,queryFn:n},i[4]=l,i[5]=n,i[6]=o):o=i[6];const{data:r}=at(o);return r??null}function gs(i){return i.isDefault&&!i.archivedAt}function vs(i){const e=i.colors;if(!e)return null;if(Array.isArray(e)){const t=e.find(n=>typeof n=="object"&&n!==null&&"label"in n&&/primary|brand|main/i.test(n.label)),l=t?t.value:e[0]?.value;return typeof l=="string"?l:null}if(typeof e=="object"){const t=e;return t.primary??Object.values(t)[0]??null}return null}function bs(i){const e=U.c(50);let t;e[0]!==i?(t=i===void 0?{}:i,e[0]=i,e[1]=t):t=e[1];const{title:l,description:n,onLocalRuntimePicked:o}=t,{org:r}=oe(),{localMode:a}=rt(),c=xs(),d=jt(),u=yt(),[m,h]=D.useState(null),[f,g]=D.useState(!1),[x,j]=D.useState(!1),k=ve();let w;e[2]!==k?.providers?(w=k?.providers??[],e[2]=k?.providers,e[3]=w):w=e[3];const I=w;let _;if(e[4]!==d.capabilities||e[5]!==d.online){if(_=[],d.online){if(d.capabilities.includes("claude-code")){let $;e[7]===Symbol.for("react.memo_cache_sentinel")?($={option:"claude-code-desktop",label:"Claude Code",icon:s.jsx(me,{size:16})},e[7]=$):$=e[7],_.push($)}if(d.capabilities.includes("codex")){let $;e[8]===Symbol.for("react.memo_cache_sentinel")?($={option:"codex-desktop",label:"Codex",icon:s.jsx(fe,{size:16})},e[8]=$):$=e[8],_.push($)}}e[4]=d.capabilities,e[5]=d.online,e[6]=_}else _=e[6];const M=_.length>0&&u!==null,b=r.name;let N;e[9]!==c?(N=c?vs(c):null,e[9]=c,e[10]=N):N=e[10];const S=N,C=c?.favicon??c?.logo??null,p=l??(b?`${b} is ready for agents`:"Your agents are almost ready"),y=n??(M?"Your desktop is linked — start now with a local coding agent, or connect a cloud provider for hosted models.":a?"Connect a provider, or run `bunx decocms@latest link` on your desktop for Claude Code, Codex, and local files.":"Connect a provider — or run `bunx decocms@latest link` on your desktop to use Claude Code, Codex, or your local files."),v=!!(C||S);let E;e[11]!==S?(E=S?{backgroundColor:`${S}18`,borderColor:`${S}30`}:void 0,e[11]=S,e[12]=E):E=e[12];const A=E,z=v?"flex items-center justify-center size-14 rounded-2xl border":"flex items-center justify-center size-14 rounded-2xl bg-muted border border-border";let O;e[13]!==z||e[14]!==A||e[15]!==C||e[16]!==d.online||e[17]!==S?(O=C?s.jsx("div",{className:z,style:A,children:s.jsx("img",{src:C,alt:"",className:"size-7 rounded object-contain"})}):s.jsx("button",{type:"button",onClick:()=>j(!0),"aria-label":d.online?"Desktop linked":"Connect your desktop",className:ne(z,"cursor-pointer transition-colors hover:bg-accent"),style:A,children:s.jsxs("span",{className:"relative inline-flex items-center justify-center",children:[s.jsx(Lt,{size:24,style:S?{color:S}:void 0,className:ne(!S&&"text-muted-foreground")}),d.online&&s.jsx("span",{className:"absolute -top-0.5 -right-0.5 size-2.5 rounded-full bg-success ring-2 ring-background animate-pulse"})]})}),e[13]=z,e[14]=A,e[15]=C,e[16]=d.online,e[17]=S,e[18]=O):O=e[18];let R;e[19]!==p?(R=s.jsx("p",{className:"text-xl font-semibold text-foreground tracking-tight",children:p}),e[19]=p,e[20]=R):R=e[20];let P;e[21]!==y?(P=s.jsx("p",{className:"text-sm text-muted-foreground max-w-md",children:y}),e[21]=y,e[22]=P):P=e[22];let L;e[23]!==R||e[24]!==P?(L=s.jsxs("div",{className:"space-y-2",children:[R,P]}),e[23]=R,e[24]=P,e[25]=L):L=e[25];let F;e[26]!==O||e[27]!==L?(F=s.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[O,L]}),e[26]=O,e[27]=L,e[28]=F):F=e[28];let W;e[29]!==u||e[30]!==M||e[31]!==_||e[32]!==o?(W=M&&s.jsxs("div",{className:"flex flex-col items-center gap-3 w-full",children:[s.jsx("div",{className:"flex flex-wrap items-center justify-center gap-2",children:_.map($=>s.jsxs(ee,{variant:"default",className:"gap-2",onClick:()=>{u?.setPendingAgentOption($.option),o?.($.option)},children:[$.icon,"Use ",$.label]},$.option))}),s.jsxs("div",{className:"flex items-center gap-3 w-full max-w-xs text-xs text-muted-foreground",children:[s.jsx("span",{className:"h-px flex-1 bg-border"}),"or connect a cloud provider",s.jsx("span",{className:"h-px flex-1 bg-border"})]})]}),e[29]=u,e[30]=M,e[31]=_,e[32]=o,e[33]=W):W=e[33];let B,G;e[34]===Symbol.for("react.memo_cache_sentinel")?(B=$=>h($),G=()=>g(!0),e[34]=B,e[35]=G):(B=e[34],G=e[35]);let K;e[36]!==I?(K=s.jsx("div",{className:"w-full",children:s.jsx(Xe,{providers:I,onSelect:B,onShowAll:G})}),e[36]=I,e[37]=K):K=e[37];const V=m!==null||f;let T;e[38]===Symbol.for("react.memo_cache_sentinel")?(T=$=>{$||(h(null),g(!1))},e[38]=T):T=e[38];const H=m??void 0;let q;e[39]!==V||e[40]!==H?(q=s.jsx(ps,{open:V,onOpenChange:T,initialProvider:H}),e[39]=V,e[40]=H,e[41]=q):q=e[41];let Q;e[42]!==x?(Q=s.jsx(Kt,{open:x,onOpenChange:j}),e[42]=x,e[43]=Q):Q=e[43];let X;return e[44]!==W||e[45]!==K||e[46]!==q||e[47]!==Q||e[48]!==F?(X=s.jsxs("div",{className:"flex flex-col items-center gap-8 w-full max-w-3xl px-4",children:[F,W,K,q,Q]}),e[44]=W,e[45]=K,e[46]=q,e[47]=Q,e[48]=F,e[49]=X):X=e[49],X}function je(i){const e=i.title.includes(": ");return{provider:e?i.title.split(": ")[0]??"":i.modelId.split("/")[0]??"",displayName:e?i.title.split(": ").slice(1).join(": "):i.title}}function js(i){return i<32e3?{level:1,label:"Small",description:"Short conversations"}:i<2e5?{level:2,label:"Medium",description:"Good for most tasks"}:i<5e5?{level:3,label:"Large",description:"Long projects & research"}:{level:4,label:"Very large",description:"Massive files & data"}}const ys=["bg-destructive","bg-warning","bg-success","bg-success"],Ss=["text-success","text-warning","text-warning","text-destructive"];function ks(i){const e=Math.round(i*.75/1e3);return e>=1?`~${e}K words`:`~${Math.round(i*.75)} words`}function Ns(i){return i<1?{level:1,label:"Cheap"}:i<5?{level:2,label:"Moderate"}:i<15?{level:3,label:"High"}:{level:4,label:"Expensive"}}const Cs={text:{icon:s.jsx(At,{className:"size-3.5"}),label:"Text"},vision:{icon:s.jsx(Bt,{className:"size-3.5"}),label:"Vision"},image:{icon:s.jsx(_t,{className:"size-3.5"}),label:"Image"},tools:{icon:s.jsx(Ot,{className:"size-3.5"}),label:"Tools"},reasoning:{icon:s.jsx(Ut,{className:"size-3.5"}),label:"Reasoning"},"web-search":{icon:s.jsx(We,{className:"size-3.5"}),label:"Web search"}};function ws(i){const e=U.c(5),{capability:t}=i;let l;e[0]!==t?(l=Cs[t]??{icon:null,label:t.charAt(0).toUpperCase()+t.slice(1)},e[0]=t,e[1]=l):l=e[1];const n=l;let o;return e[2]!==n.icon||e[3]!==n.label?(o=s.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground border border-border rounded px-2 py-0.5",children:[n.icon,n.label]}),e[2]=n.icon,e[3]=n.label,e[4]=o):o=e[4],o}function Is(i){const e=U.c(49),{model:t,compact:l}=i,n=l===void 0?!1:l;if(!t){let b;return e[0]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:"Hover to preview"}),e[0]=b):b=e[0],b}const o=t.costs?.input!=null?t.costs.input*1e6:null,r=t.costs?.output!=null?t.costs.output*1e6:null;let a;e[1]!==t?(a=je(t),e[1]=t,e[2]=a):a=e[2];const{provider:c,displayName:d}=a;if(n){let b;e[3]!==t.limits?(b=t.limits?.contextWindow&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Context"}),s.jsxs("span",{className:"text-foreground font-medium",children:[t.limits.contextWindow.toLocaleString()," tokens"]})]}),e[3]=t.limits,e[4]=b):b=e[4];let N;e[5]!==o?(N=o!=null&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Input"}),s.jsxs("span",{className:"text-foreground font-medium",children:["$",o.toFixed(2)," / 1M"]})]}),e[5]=o,e[6]=N):N=e[6];let S;e[7]!==r?(S=r!=null&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Output"}),s.jsxs("span",{className:"text-foreground font-medium",children:["$",r.toFixed(2)," / 1M"]})]}),e[7]=r,e[8]=S):S=e[8];let C;e[9]!==t.limits?(C=t.limits?.maxOutputTokens&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Output limit"}),s.jsxs("span",{className:"text-foreground font-medium",children:[t.limits.maxOutputTokens.toLocaleString()," tokens"]})]}),e[9]=t.limits,e[10]=C):C=e[10];let p;return e[11]!==b||e[12]!==N||e[13]!==S||e[14]!==C?(p=s.jsxs("div",{className:"flex flex-col gap-2 pt-3 pb-3 px-3 text-xs",children:[b,N,S,C]}),e[11]=b,e[12]=N,e[13]=S,e[14]=C,e[15]=p):p=e[15],p}let u;e[16]!==c?(u=s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:c}),e[16]=c,e[17]=u):u=e[17];let m;e[18]!==t.logo||e[19]!==t.title?(m=t.logo&&s.jsx("img",{src:t.logo,className:"size-6 shrink-0 rounded-md dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[18]=t.logo,e[19]=t.title,e[20]=m):m=e[20];let h;e[21]!==d?(h=s.jsx("p",{className:"text-lg font-semibold leading-snug tracking-tight",children:d}),e[21]=d,e[22]=h):h=e[22];let f;e[23]!==m||e[24]!==h?(f=s.jsxs("div",{className:"flex items-center gap-2.5",children:[m,h]}),e[23]=m,e[24]=h,e[25]=f):f=e[25];let g;e[26]!==t.modelId?(g=s.jsx("p",{className:"text-xs text-muted-foreground/50 font-mono",children:t.modelId}),e[26]=t.modelId,e[27]=g):g=e[27];let x;e[28]!==u||e[29]!==f||e[30]!==g?(x=s.jsxs("div",{className:"flex flex-col gap-1 pt-1 pr-6",children:[u,f,g]}),e[28]=u,e[29]=f,e[30]=g,e[31]=x):x=e[31];let j;e[32]!==t.capabilities?(j=t.capabilities&&t.capabilities.length>0&&s.jsx("div",{className:"flex flex-wrap items-center gap-1.5 pb-4 border-b border-border",children:[...new Set(t.capabilities)].map(_s)}),e[32]=t.capabilities,e[33]=j):j=e[33];let k;e[34]!==t.limits?(k=t.limits?.contextWindow&&(()=>{const{level:b,label:N,description:S}=js(t.limits.contextWindow);return s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Context window"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"flex items-center gap-0.5",children:[1,2,3,4].map(C=>s.jsx("div",{className:ne("w-2 h-2 rounded-full",C<=b?ys[b-1]:"bg-muted")},C))}),s.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:N}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:["— ",S]})]}),s.jsxs("span",{className:"text-sm text-muted-foreground",children:[t.limits.contextWindow.toLocaleString()," tokens"]})]})})(),e[34]=t.limits,e[35]=k):k=e[35];let w;e[36]!==t.limits?(w=t.limits?.maxOutputTokens&&s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Output limit"}),s.jsxs("div",{className:"flex items-baseline gap-2",children:[s.jsxs("span",{className:"text-sm text-foreground",children:[t.limits.maxOutputTokens.toLocaleString()," tokens"]}),s.jsx("span",{className:"text-sm text-muted-foreground",children:ks(t.limits.maxOutputTokens)})]})]}),e[36]=t.limits,e[37]=w):w=e[37];let I;e[38]!==o||e[39]!==r?(I=(o!=null||r!=null)&&(()=>{const{level:b,label:N}=o!=null?Ns(o):{level:0,label:""};return s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Pricing"}),o!=null&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"flex items-center",children:[1,2,3,4].map(S=>s.jsx("span",{className:ne("text-sm font-bold leading-none",S<=b?Ss[b-1]:"text-muted-foreground/20"),children:"$"},S))}),s.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:N})]}),s.jsxs("div",{className:"flex flex-col gap-1",children:[o!=null&&s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:"Input"}),s.jsxs("span",{className:"text-xs text-foreground",children:["$",o.toFixed(2)," / 1M tokens"]})]}),r!=null&&s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:"Output"}),s.jsxs("span",{className:"text-xs text-foreground",children:["$",r.toFixed(2)," / 1M tokens"]})]})]})]})})(),e[38]=o,e[39]=r,e[40]=I):I=e[40];let _;e[41]!==k||e[42]!==w||e[43]!==I?(_=s.jsxs("div",{className:"flex flex-col gap-6",children:[k,w,I]}),e[41]=k,e[42]=w,e[43]=I,e[44]=_):_=e[44];let M;return e[45]!==_||e[46]!==x||e[47]!==j?(M=s.jsxs("div",{className:"flex flex-col gap-5 py-1 px-1.5",children:[x,j,_]}),e[45]=_,e[46]=x,e[47]=j,e[48]=M):M=e[48],M}function _s(i){return s.jsx(ws,{capability:i},i)}function Ye(i){const e=U.c(19),{model:t,placeholder:l,isLoading:n}=i,o=l===void 0?"Select model":l;if(n===void 0?!1:n){let x;return e[0]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx(Y,{className:"w-5 h-5 rounded-sm shrink-0"}),s.jsx(Y,{className:"w-16 h-3 hidden md:block"})]}),e[0]=x):x=e[0],x}if(!t){let x;e[1]!==o?(x=s.jsx("span",{className:"text-sm text-muted-foreground",children:o}),e[1]=o,e[2]=x):x=e[2];let j;e[3]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(Ce,{size:14,className:"text-muted-foreground opacity-50 shrink-0"}),e[3]=j):j=e[3];let k;return e[4]!==x?(k=s.jsxs("div",{className:"flex items-center gap-1.5",children:[x,j]}),e[4]=x,e[5]=k):k=e[5],k}let a;e[6]!==t?(a=je(t),e[6]=t,e[7]=a):a=e[7];const{displayName:c}=a;let d;e[8]!==t?(d=be(t),e[8]=t,e[9]=d):d=e[9];const u=d;let m;e[10]!==t.title||e[11]!==u?(m=s.jsx("img",{src:u,className:"w-3.5 h-3.5 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[10]=t.title,e[11]=u,e[12]=m):m=e[12];let h;e[13]!==c?(h=s.jsx("span",{className:"text-sm truncate whitespace-nowrap text-muted-foreground max-w-[100px] sm:max-w-none",children:c}),e[13]=c,e[14]=h):h=e[14];let f;e[15]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(Ce,{size:14,className:"text-muted-foreground opacity-50 shrink-0"}),e[15]=f):f=e[15];let g;return e[16]!==m||e[17]!==h?(g=s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0 overflow-hidden",children:[m,h,f]}),e[16]=m,e[17]=h,e[18]=g):g=e[18],g}const Ms=["vision","image","file","audio","video"],Qe=["image/png","image/jpeg","image/gif","image/webp"],Je=["application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"];function ye(i){const e=i?.capabilities;return e?Ms.some(t=>e.includes(t)):!1}function Di(i,e){if(!i)return!1;if(i.startsWith("text/"))return!0;const t=e?.capabilities??[],l=t.includes("vision")||t.includes("image"),n=t.includes("file"),o=t.includes("audio"),r=t.includes("video");return!!(l&&Qe.includes(i)||n&&i==="application/pdf"||o&&i.startsWith("audio/")||r&&i.startsWith("video/")||ye(e)&&Je.includes(i))}function Fi(i){const e=i?.capabilities??[],t=["text/*"];return(e.includes("vision")||e.includes("image"))&&t.push(...Qe),e.includes("file")&&t.push("application/pdf"),e.includes("audio")&&t.push("audio/*"),e.includes("video")&&t.push("video/*"),ye(i)&&t.push(...Je),t.join(",")}function Ki(i){const e=i?.capabilities??[],t=[];return(e.includes("vision")||e.includes("image"))&&t.push("images"),e.includes("file")&&t.push("PDFs"),e.includes("audio")&&t.push("audio"),e.includes("video")&&t.push("video"),ye(i)&&t.push("Office files"),t.length===0?"text only":t.length===1?t[0]:t.length===2?`${t[0]} and ${t[1]}`:`${t.slice(0,-1).join(", ")}, and ${t.at(-1)}`}const Ze=["smarter","faster","cheaper"],et={smarter:"Smarter",faster:"Faster",cheaper:"Cheaper"},Es=[{tier:"smarter",prefixes:["anthropic/claude-opus-4.8","anthropic/claude-sonnet-4.6","anthropic/claude-4.6-sonnet","openai/gpt-5.3-codex","google/gemini-3-pro","google/gemini-2.5-pro","cohere/command-r-plus","cohere/command-a"]},{tier:"faster",prefixes:["anthropic/claude-haiku-4.5","anthropic/claude-4.5-haiku","google/gemini-3-flash","openai/gpt-5.1-codex-mini","x-ai/grok-code-fast","x-ai/grok-3","mistralai/mistral-large","mistralai/codestral","mistralai/mistral-medium","minimax/minimax-m1"]},{tier:"cheaper",prefixes:["google/gemini-2.5-flash-lite","google/gemini-2.5-flash","google/gemini-2.0-flash","deepseek/deepseek-v3","openai/gpt-oss-120b","mistralai/mistral-small","mistralai/pixtral","cohere/command-r"]}],Os=Es.flatMap(({tier:i,prefixes:e})=>e.map(t=>({tier:i,prefix:t}))).sort((i,e)=>e.prefix.length-i.prefix.length),As="google/gemini-2.5-pro",Ae=new Map;function Ts(i){const e=Ae.get(i);if(e!==void 0)return e;let t=null;if(i.endsWith(":free"))t="cheaper";else for(const{tier:l,prefix:n}of Os)if(i.startsWith(n)){if(n===As&&i.length>n.length&&i[n.length]==="-"){const r=i[n.length+1];if(!r||!/\d/.test(r))continue}t=l;break}return Ae.set(i,t),t}function Te(i){const e={smarter:[],faster:[],cheaper:[],other:[]};for(const t of i){const l=Ts(t.modelId);e[l??"other"].push(t)}for(const t of Object.keys(e))e[t].sort((l,n)=>l.title.localeCompare(n.title));return e}const tt="mesh:model-shortlist:",zs=new Set(["anthropic/claude-opus-4.8","anthropic/claude-sonnet-4.6","anthropic/claude-4.6-sonnet","anthropic/claude-sonnet-4.6:extended","openai/gpt-5.3-codex","google/gemini-3-pro-preview","google/gemini-2.5-pro","anthropic/claude-haiku-4.5","anthropic/claude-haiku-4.5-20251001","anthropic/claude-4.5-haiku","google/gemini-3-flash-preview","openai/gpt-5.1-codex-mini","x-ai/grok-code-fast-1","google/gemini-2.5-flash","deepseek/deepseek-v3.2","google/gemini-2.5-flash-lite","openai/gpt-oss-120b:free"]);function Ps(i){try{const e=localStorage.getItem(tt+i);return e?new Set(JSON.parse(e)):null}catch{return null}}function Rs(i,e){localStorage.setItem(tt+i,JSON.stringify([...e]))}function Ls(i){const e=U.c(21),{model:t,onHover:l}=i;let n;e[0]!==t?(n=je(t),e[0]=t,e[1]=n):n=e[1];const{displayName:o,provider:r}=n;let a;e[2]!==t?(a=be(t),e[2]=t,e[3]=a):a=e[3];const c=a;let d;e[4]!==t||e[5]!==l?(d=()=>l(t),e[4]=t,e[5]=l,e[6]=d):d=e[6];let u;e[7]!==t.title||e[8]!==c?(u=s.jsx("img",{src:c,className:"w-4 h-4 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[7]=t.title,e[8]=c,e[9]=u):u=e[9];let m;e[10]!==o?(m=s.jsx("span",{className:"text-sm text-foreground leading-tight truncate",children:o}),e[10]=o,e[11]=m):m=e[11];let h;e[12]!==r?(h=s.jsx("span",{className:"text-xs text-muted-foreground/60 leading-tight",children:r}),e[12]=r,e[13]=h):h=e[13];let f;e[14]!==m||e[15]!==h?(f=s.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[m,h]}),e[14]=m,e[15]=h,e[16]=f):f=e[16];let g;return e[17]!==d||e[18]!==u||e[19]!==f?(g=s.jsxs("div",{className:"flex items-center gap-2.5 py-2 px-3 hover:bg-accent cursor-pointer rounded-lg",onMouseEnter:d,children:[u,f]}),e[17]=d,e[18]=u,e[19]=f,e[20]=g):g=e[20],g}function $s(i){const e=U.c(10),{error:t,onRetry:l}=i;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("div",{className:"bg-destructive/10 p-2 rounded-full",children:s.jsx(ut,{className:"size-5 text-destructive"})}),e[0]=n):n=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("p",{className:"text-sm font-medium text-foreground",children:"Failed to load models"}),e[1]=o):o=e[1];const r=t?.message||"Could not fetch models from this provider.";let a;e[2]!==r?(a=s.jsxs("div",{className:"flex flex-col gap-1",children:[o,s.jsxs("p",{className:"text-xs text-muted-foreground max-w-[260px]",children:[r," Try another provider or retry."]})]}),e[2]=r,e[3]=a):a=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Et,{className:"size-3.5"}),e[4]=c):c=e[4];let d;e[5]!==l?(d=s.jsx("div",{className:"flex items-center gap-2",children:s.jsxs(ee,{variant:"outline",size:"sm",onClick:l,className:"gap-1.5",children:[c,"Retry"]})}),e[5]=l,e[6]=d):d=e[6];let u;return e[7]!==a||e[8]!==d?(u=s.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-4 py-8 text-center",children:[n,a,d]}),e[7]=a,e[8]=d,e[9]=u):u=e[9],u}function Ds(){const i=U.c(1);let e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex-1 overflow-y-auto p-2 space-y-1",children:Array.from({length:6}).map(Fs)}),i[0]=e):e=i[0],e}function Fs(i,e){return s.jsxs("div",{className:"flex items-center gap-2 min-h-8 py-3 px-3 rounded-lg",children:[s.jsx(Y,{className:"size-5 shrink-0 rounded-sm"}),s.jsx(Y,{className:"flex-1 h-4"}),s.jsx(Y,{className:"w-16 h-5 shrink-0 rounded-md"})]},e)}function ze(i){const e=U.c(12),{label:t,models:l,onSelect:n,onHover:o}=i;if(l.length===0)return null;let r;e[0]!==t?(r=s.jsx("div",{className:"text-xs font-medium text-muted-foreground px-3 pt-3 pb-1",children:t}),e[0]=t,e[1]=r):r=e[1];let a;if(e[2]!==l||e[3]!==o||e[4]!==n){let d;e[6]!==o||e[7]!==n?(d=u=>s.jsx("div",{onClick:()=>n(u),className:"cursor-pointer",children:s.jsx(Ls,{model:u,onHover:o})},u.modelId),e[6]=o,e[7]=n,e[8]=d):d=e[8],a=l.map(d),e[2]=l,e[3]=o,e[4]=n,e[5]=a}else a=e[5];let c;return e[9]!==r||e[10]!==a?(c=s.jsxs("div",{children:[r,a]}),e[9]=r,e[10]=a,e[11]=c):c=e[11],c}function Ks(i){const e=U.c(21),{model:t,isChecked:l,onToggle:n,onHover:o}=i,[r,a]=D.useState(l);r!==l&&a(l);let c;e[0]!==t?(c=be(t),e[0]=t,e[1]=c):c=e[1];const d=c;let u;e[2]!==t||e[3]!==o?(u=()=>o(t),e[2]=t,e[3]=o,e[4]=u):u=e[4];let m;e[5]!==t.modelId||e[6]!==n?(m=()=>{a(Bs),n(t.modelId)},e[5]=t.modelId,e[6]=n,e[7]=m):m=e[7];let h;e[8]!==r||e[9]!==m?(h=s.jsx(St,{checked:r,onCheckedChange:m}),e[8]=r,e[9]=m,e[10]=h):h=e[10];let f;e[11]!==d||e[12]!==t.title?(f=s.jsx("img",{src:d,className:"w-5 h-5 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[11]=d,e[12]=t.title,e[13]=f):f=e[13];let g;e[14]!==t.title?(g=s.jsx("span",{className:"text-sm text-foreground flex-1 min-w-0 line-clamp-1",children:t.title}),e[14]=t.title,e[15]=g):g=e[15];let x;return e[16]!==u||e[17]!==h||e[18]!==f||e[19]!==g?(x=s.jsxs("label",{className:"flex items-center gap-3 min-h-8 py-2.5 px-3 hover:bg-accent cursor-pointer rounded-lg",onMouseEnter:u,children:[h,f,g]}),e[16]=u,e[17]=h,e[18]=f,e[19]=g,e[20]=x):x=e[20],x}function Bs(i){return!i}function Us(i){const e=[];for(const t of Ze)if(i[t].length>0){e.push({type:"header",label:et[t]});for(const l of i[t])e.push({type:"model",model:l})}if(i.other.length>0){e.push({type:"header",label:"Other"});for(const t of i.other)e.push({type:"model",model:t})}return e}function Ws({items:i,shortlistSet:e,onToggle:t,onHover:l}){const n=D.useRef(null),o=ts({count:i.length,getScrollElement:()=>n.current,estimateSize:r=>i[r]?.type==="header"?36:44,overscan:6});return s.jsx("div",{ref:n,className:"flex-1 overflow-y-auto",children:s.jsx("div",{className:"relative",style:{height:o.getTotalSize()},children:o.getVirtualItems().map(r=>{const a=i[r.index];return a?s.jsx("div",{"data-index":r.index,ref:o.measureElement,className:"absolute left-0 right-0 top-0 px-0.5",style:{transform:`translateY(${r.start}px)`},children:a.type==="header"?s.jsx("div",{className:"text-xs font-medium text-muted-foreground px-3 pt-3 pb-1",children:a.label}):s.jsx(Ks,{model:a.model,isChecked:e.has(a.model.modelId),onToggle:t,onHover:l})},r.key):null})})})}function Hs(i){const e=U.c(23),{keyId:t,searchTerm:l,onHover:n,onModelSelect:o,managing:r,onToggleManage:a,filterModels:c}=i,{models:d}=Rt(t),u=c?d.filter(c):d.filter(Vs);let m;e[0]!==t?(m=()=>(t?Ps(t):null)??zs,e[0]=t,e[1]=m):m=e[1];const[h,f]=D.useState(m),[,g]=D.useTransition();let x;e[2]!==t||e[3]!==g?(x=p=>{t&&g(()=>{f(y=>{const v=new Set(y);return v.has(p)?v.delete(p):v.add(p),Rs(t,v),v})})},e[2]=t,e[3]=g,e[4]=x):x=e[4];const j=x,k=l.toLowerCase().trim(),w=p=>k?p.filter(y=>y.title.toLowerCase().includes(k)||y.modelId.toLowerCase().includes(k)):p;if(r){const p=Te(w(u)),y=Us(p);let v;e[5]!==h?(v=O=>h.has(O.modelId),e[5]=h,e[6]=v):v=e[6];const E=u.filter(v).length;let A;e[7]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(Ue,{size:14}),e[7]=A):A=e[7];let z;return e[8]!==a?(z=s.jsxs("button",{type:"button",onClick:a,className:"flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground cursor-pointer",children:[A,"Back"]}),e[8]=a,e[9]=z):z=e[9],s.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[s.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border",children:[z,s.jsxs("span",{className:"text-xs text-muted-foreground",children:[E," selected"]})]}),s.jsx(Ws,{items:y,shortlistSet:h,onToggle:j,onHover:n})]})}let I;e[10]!==h?(I=p=>h.has(p.modelId),e[10]=h,e[11]=I):I=e[11];const _=u.filter(I),M=_.length>0?_:u,b=Te(w(M));let N;e[12]!==b||e[13]!==n||e[14]!==o?(N=Ze.map(p=>s.jsx(ze,{label:et[p],models:b[p],onSelect:o,onHover:n},p)),e[12]=b,e[13]=n,e[14]=o,e[15]=N):N=e[15];let S;e[16]!==b.other||e[17]!==n||e[18]!==o?(S=s.jsx(ze,{label:"Other",models:b.other,onSelect:o,onHover:n}),e[16]=b.other,e[17]=n,e[18]=o,e[19]=S):S=e[19];let C;return e[20]!==N||e[21]!==S?(C=s.jsxs("div",{className:"flex-1 overflow-y-auto px-0.5 pt-1 [touch-action:pan-y]",children:[N,S]}),e[20]=N,e[21]=S,e[22]=C):C=e[22],C}function Vs(i){return i.asyncResearch!==!0}function qs(){const i=U.c(6);let e;i[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"border-b border-border h-12 bg-background/95 backdrop-blur sticky top-0 z-10",children:s.jsxs("div",{className:"flex items-center gap-2.5 h-12 px-4",children:[s.jsx(Y,{className:"size-4 shrink-0"}),s.jsx(Y,{className:"flex-1 h-6"}),s.jsx(Y,{className:"w-[140px] h-8 shrink-0"})]})}),i[0]=e):e=i[0];let t;i[1]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsxs("div",{className:"flex-1 flex flex-col md:border-r md:w-[420px] md:min-w-[420px] min-h-0 overflow-hidden",children:[e,s.jsx("div",{className:"flex-1 overflow-y-auto p-2 space-y-1",children:Array.from({length:8}).map(Gs)})]}),i[1]=t):t=i[1];let l;i[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[s.jsx(Y,{className:"size-6 shrink-0"}),s.jsx(Y,{className:"h-6 w-32"})]}),i[2]=l):l=i[2];let n;i[3]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{className:"flex flex-col gap-3 py-2 px-0",children:[l,s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Y,{className:"h-6 w-20 rounded-md"}),s.jsx(Y,{className:"h-6 w-24 rounded-md"})]})]}),i[3]=n):n=i[3];let o;i[4]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(Y,{className:"h-4 w-24"}),s.jsx(Y,{className:"h-4 w-32"})]}),i[4]=o):o=i[4];let r;return i[5]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("div",{className:"flex flex-col md:flex-row h-full sm:h-[460px] min-h-0",children:[t,s.jsx("div",{className:"hidden md:block md:w-[320px] md:shrink-0 p-3",children:s.jsxs("div",{className:"flex flex-col gap-3 py-1 px-1.5",children:[n,s.jsxs("div",{className:"flex flex-col gap-4",children:[o,s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(Y,{className:"h-4 w-16"}),s.jsx(Y,{className:"h-4 w-40"})]})]})]})})]}),i[5]=r):r=i[5],r}function Gs(i,e){return s.jsxs("div",{className:"flex items-center gap-2 min-h-8 py-3 px-3 rounded-lg",children:[s.jsx(Y,{className:"size-5 shrink-0 rounded-sm"}),s.jsx(Y,{className:"flex-1 h-4"}),s.jsx(Y,{className:"w-16 h-5 shrink-0 rounded-md"})]},e)}function st(i){const e=U.c(49),{onClose:t,credentialId:l,onCredentialChange:n,selectedModel:o,onModelChange:r,filterModels:a}=i,[c,d]=D.useState(null),[u,m]=D.useState(""),[h,f]=D.useState(!1),g=D.useRef(null),x=ve(),j=Pt();let k;e[0]!==x?.providers?(k=Object.fromEntries((x?.providers??[]).map(Qs)),e[0]=x?.providers,e[1]=k):k=e[1];const w=k,I=ct(),{org:_}=oe();let M;e[2]!==n?(M=T=>{n(T),d(null)},e[2]=n,e[3]=M):M=e[3];const b=M;let N;e[4]!==l||e[5]!==t||e[6]!==r?(N=T=>{l&&(r(T),m(""),t())},e[4]=l,e[5]=t,e[6]=r,e[7]=N):N=e[7];const S=N;if(j.length===0){let T;return e[8]===Symbol.for("react.memo_cache_sentinel")?(T=s.jsx("div",{className:"flex items-center justify-center p-8 w-full sm:w-[740px]",children:s.jsx(bs,{})}),e[8]=T):T=e[8],T}let C;e[9]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(We,{size:16,className:"text-muted-foreground shrink-0"}),e[9]=C):C=e[9];const p=h?"Search all models...":"Search for a model...";let y;e[10]===Symbol.for("react.memo_cache_sentinel")?(y=T=>m(T.target.value),e[10]=y):y=e[10];let v;e[11]!==u||e[12]!==p?(v=s.jsx(le,{ref:g,type:"text",placeholder:p,value:u,onChange:y,className:"flex-1 min-w-0 border-0 !shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"}),e[11]=u,e[12]=p,e[13]=v):v=e[13];let E;e[14]!==l||e[15]!==b||e[16]!==j||e[17]!==w?(E=j.length>0&&s.jsxs(kt,{value:l??"",onValueChange:b,children:[s.jsxs(Nt,{size:"sm",className:"w-auto max-w-[140px] h-8 shrink-0 gap-1.5 px-2 [&>svg:last-child]:hidden",onClick:Ys,children:[s.jsx(Ct,{placeholder:"Key",children:(()=>{const T=j.find($=>$.id===l),H=T?w[T.providerId]:void 0,q=ce(T?.presetId),Q=q?.logo??H?.logo,X=q?.name??H?.name??T?.providerId??"Key";return s.jsxs("span",{className:"flex items-center gap-1.5 min-w-0",children:[Q?s.jsx("img",{src:Q,alt:X,className:"w-4 h-4 rounded shrink-0 dark:bg-white dark:rounded-sm dark:p-px"}):s.jsx("div",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary shrink-0",children:X.slice(0,1).toUpperCase()}),s.jsx("span",{className:"text-xs truncate",children:X})]})})()}),s.jsx(Tt,{className:"size-4 opacity-50 shrink-0 pointer-events-none"})]}),s.jsx(wt,{children:j.map(T=>{const H=w[T.providerId],q=ce(T.presetId),Q=q?.logo??H?.logo,X=q?.name??H?.name??T.providerId;return s.jsx(It,{value:T.id,children:s.jsxs("div",{className:"flex items-center gap-2",children:[Q?s.jsx("img",{src:Q,alt:X,className:"w-4 h-4 rounded dark:bg-white dark:rounded-sm dark:p-px"}):s.jsx("div",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:X.slice(0,1).toUpperCase()}),s.jsxs("span",{children:[X," — ",T.label]})]})},T.id)})})]}),e[14]=l,e[15]=b,e[16]=j,e[17]=w,e[18]=E):E=e[18];let A;e[19]!==v||e[20]!==E?(A=s.jsx("div",{className:"border-b border-border h-12 bg-background/95 backdrop-blur sticky top-0 z-10",children:s.jsxs("label",{className:"flex items-center gap-2.5 h-12 px-4 pr-12 md:pr-4 cursor-text",children:[C,v,E]})}),e[19]=v,e[20]=E,e[21]=A):A=e[21];let z;e[22]!==l?(z=T=>{const{error:H,resetError:q}=T;return s.jsx($s,{error:H,onRetry:q,credentialId:l??void 0})},e[22]=l,e[23]=z):z=e[23];let O;e[24]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx(Ds,{}),e[24]=O):O=e[24];const R=l??void 0;let P;e[25]===Symbol.for("react.memo_cache_sentinel")?(P=()=>f(Xs),e[25]=P):P=e[25];let L;e[26]!==a||e[27]!==S||e[28]!==h||e[29]!==u||e[30]!==R?(L=s.jsx(D.Suspense,{fallback:O,children:s.jsx(Hs,{keyId:R,searchTerm:u,onHover:d,onModelSelect:S,managing:h,onToggleManage:P,filterModels:a})}),e[26]=a,e[27]=S,e[28]=h,e[29]=u,e[30]=R,e[31]=L):L=e[31];let F;e[32]!==l||e[33]!==z||e[34]!==L?(F=s.jsx(dt,{fallback:z,children:L},l),e[32]=l,e[33]=z,e[34]=L,e[35]=F):F=e[35];let W;e[36]!==h||e[37]!==I||e[38]!==_?(W=!h&&s.jsxs("div",{className:"border-t border-border flex",children:[s.jsxs("button",{type:"button",onClick:()=>D.startTransition(()=>f(!0)),className:"flex items-center gap-2 flex-1 px-4 py-2.5 text-xs text-muted-foreground hover:text-foreground hover:bg-accent cursor-pointer",children:[s.jsx(Mt,{className:"size-3.5 shrink-0"}),"Manage models"]}),s.jsx("div",{className:"w-px bg-border shrink-0"}),s.jsxs("button",{type:"button",onClick:()=>I({to:"/$org/settings/ai-providers",params:{org:_.slug}}),className:"flex items-center gap-2 flex-1 px-4 py-2.5 text-xs text-muted-foreground hover:text-foreground hover:bg-accent cursor-pointer",children:[s.jsx(zt,{className:"size-3.5 shrink-0"}),"Manage API keys"]})]}),e[36]=h,e[37]=I,e[38]=_,e[39]=W):W=e[39];let B;e[40]!==F||e[41]!==W||e[42]!==A?(B=s.jsxs("div",{className:"flex-1 flex flex-col md:border-r md:w-[420px] md:min-w-[420px] min-h-0 overflow-hidden",children:[A,F,W]}),e[40]=F,e[41]=W,e[42]=A,e[43]=B):B=e[43];const G=c??o??null;let K;e[44]!==G?(K=s.jsx("div",{className:"hidden md:flex md:flex-col md:w-[320px] md:shrink-0 p-3",children:s.jsx(Is,{model:G})}),e[44]=G,e[45]=K):K=e[45];let V;return e[46]!==B||e[47]!==K?(V=s.jsxs("div",{className:"flex flex-col md:flex-row h-full sm:h-[460px] min-h-0",children:[B,K]}),e[46]=B,e[47]=K,e[48]=V):V=e[48],V}function Xs(i){return!i}function Ys(i){return i.stopPropagation()}function Qs(i){return[i.id,i]}function Js(i){const e=U.c(12),{onClose:t}=i,{credentialId:l,setCredentialId:n,selectedModel:o,setModel:r}=ge();let a;e[0]!==n?(a=u=>{J("chat_credential_changed",{credential_id:u}),n(u)},e[0]=n,e[1]=a):a=e[1];let c;e[2]!==l||e[3]!==o?.modelId||e[4]!==r?(c=u=>{l&&(J("chat_model_changed",{from_model_id:o?.modelId??null,to_model_id:u.modelId,to_model_provider:u.providerId??null,credential_id:l}),r({...u,keyId:l}))},e[2]=l,e[3]=o?.modelId,e[4]=r,e[5]=c):c=e[5];let d;return e[6]!==l||e[7]!==t||e[8]!==o||e[9]!==a||e[10]!==c?(d=s.jsx(st,{onClose:t,credentialId:l,onCredentialChange:a,selectedModel:o,onModelChange:c}),e[6]=l,e[7]=t,e[8]=o,e[9]=a,e[10]=c,e[11]=d):d=e[11],d}function Zs(i){const e=U.c(2),{onClose:t}=i;let l;return e[0]!==t?(l=s.jsx(Js,{onClose:t}),e[0]=t,e[1]=l):l=e[1],l}function ei(i){const e=U.c(2);let t;return e[0]!==i?(t=s.jsx(st,{...i}),e[0]=i,e[1]=t):t=e[1],t}const ti=[{tier:"fast",description:"Quicker responses"},{tier:"smart",description:"Balanced quality"},{tier:"thinking",description:"Deeper reasoning"}];function it(i){const e=U.c(10),{modelSet:t,selectedModelId:l,onSelect:n}=i;let o,r;if(e[0]!==t.logo||e[1]!==t.models||e[2]!==t.tiers||e[3]!==n||e[4]!==l){const c=Object.fromEntries(t.models.map(si));o="flex flex-col p-2 w-[320px]",r=ti.map(d=>{const{tier:u,description:m}=d,h=t.tiers[u];if(!h.modelId)return null;const f=c[h.modelId];if(!f)return null;const g=l===h.modelId;return s.jsxs("button",{type:"button",onClick:()=>n(f),className:ne("flex items-center gap-3 px-3 py-2.5 rounded-lg text-left hover:bg-accent",g&&"bg-accent/50"),children:[s.jsx("img",{src:t.logo,alt:h.label,className:"size-5 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px"}),s.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[s.jsx("span",{className:"text-sm text-foreground leading-tight truncate",children:h.label}),s.jsx("span",{className:"text-xs text-muted-foreground leading-tight",children:m})]})]},u)}),e[0]=t.logo,e[1]=t.models,e[2]=t.tiers,e[3]=n,e[4]=l,e[5]=o,e[6]=r}else o=e[5],r=e[6];let a;return e[7]!==o||e[8]!==r?(a=s.jsx("div",{className:o,children:r}),e[7]=o,e[8]=r,e[9]=a):a=e[9],a}function si(i){return[i.modelId,i]}const ii=[{providerId:"claude-code",modelId:"claude-code:haiku",title:"Claude Code Haiku",description:"Fast and lightweight",capabilities:["text"],limits:null,costs:null},{providerId:"claude-code",modelId:"claude-code:sonnet",title:"Claude Code Sonnet 5",description:"Balanced performance",capabilities:["text","reasoning"],limits:null,costs:null},{providerId:"claude-code",modelId:"claude-code:opus",title:"Claude Code Opus",description:"Most capable",capabilities:["text","reasoning"],limits:null,costs:null},{providerId:"claude-code",modelId:"claude-code:opus-1m",title:"Claude Code Opus 4.8 1M",description:"Most capable, 1M context window",capabilities:["text","reasoning"],limits:{contextWindow:1e6,maxOutputTokens:null},costs:null}],ue="https://assets.decocache.com/decocms/6ac44f1c-c0cf-4480-84b5-2ae6fe742d0b/codex-app.png.png",li=[{providerId:"codex",modelId:"codex:gpt-5.6-sol",title:"GPT-5.6 Sol",description:"Frontier Codex model for deep reasoning, complex coding, and real-world work",capabilities:["text","reasoning"],logo:ue,limits:null,costs:null},{providerId:"codex",modelId:"codex:gpt-5.6-terra",title:"GPT-5.6 Terra",description:"Balanced Codex model for everyday coding and agent work",capabilities:["text","reasoning"],logo:ue,limits:null,costs:null},{providerId:"codex",modelId:"codex:gpt-5.6-luna",title:"GPT-5.6 Luna",description:"Fast Codex model for lightweight coding tasks and titles",capabilities:["text","reasoning"],logo:ue,limits:null,costs:null},{providerId:"codex",modelId:"codex:gpt-5.3-codex-spark",title:"GPT-5.3 Codex Spark",description:"Ultra-fast coding model",capabilities:["text","reasoning"],logo:ue,limits:null,costs:null}],ni="https://decoims.com/decocms/93e4059c-e598-412b-87eb-54d72a946ec8/claude-stroke-rounded.svg",oi="https://decoims.com/decocms/9170ffd4-b9cc-4661-ad8f-ae2eea019e00/codex.svg",ri={fast:{modelId:"claude-code:haiku",label:"Haiku 4.5",description:"Quicker responses",iconNode:s.jsx(me,{size:16})},smart:{modelId:"claude-code:sonnet",label:"Sonnet 5",description:"Balanced quality",iconNode:s.jsx(me,{size:16})},thinking:{modelId:"claude-code:opus-1m",label:"Opus 4.8 1M",description:"Deeper reasoning",iconNode:s.jsx(me,{size:16})}},ai={fast:{modelId:"codex:gpt-5.6-luna",label:"GPT-5.6 Luna",description:"Quicker responses",iconNode:s.jsx(fe,{size:16})},smart:{modelId:"codex:gpt-5.6-terra",label:"GPT-5.6 Terra",description:"Balanced quality",iconNode:s.jsx(fe,{size:16})},thinking:{modelId:"codex:gpt-5.6-sol",label:"GPT-5.6 Sol",description:"Deeper reasoning",iconNode:s.jsx(fe,{size:16})}};function lt(i){return i==="claude-code"?{logo:ni,tiers:ri,models:ii}:i==="codex"?{logo:oi,tiers:ai,models:li}:null}function ci(i){const e=U.c(11),{onClose:t,agent:l}=i,n=ge(),o=l??n.pendingHarnessId??"decopilot";let r;e[0]!==o?(r=lt(o),e[0]=o,e[1]=r):r=e[1];const a=r;if(!a){let m;return e[2]!==t?(m=s.jsx(Zs,{onClose:t}),e[2]=t,e[3]=m):m=e[3],m}const c=n.selectedModel?.modelId??a.tiers[n.simpleModeTier].modelId;let d;e[4]!==t||e[5]!==n?(d=m=>{n.setModel({...m,keyId:void 0}),t()},e[4]=t,e[5]=n,e[6]=d):d=e[6];let u;return e[7]!==a||e[8]!==c||e[9]!==d?(u=s.jsx(it,{modelSet:a,selectedModelId:c,onSelect:d}),e[7]=a,e[8]=c,e[9]=d,e[10]=u):u=e[10],u}function di(i){const e=U.c(13);let t,l;e[0]!==i?({agent:t,...l}=i,e[0]=i,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let n;e[3]!==t?(n=t?lt(t):null,e[3]=t,e[4]=n):n=e[4];const o=n;if(!o){let d;return e[5]!==l?(d=s.jsx(ei,{...l}),e[5]=l,e[6]=d):d=e[6],d}const r=l.selectedModel?.modelId??o.tiers.smart.modelId;let a;e[7]!==l?(a=d=>{l.onModelChange(d),l.onClose()},e[7]=l,e[8]=a):a=e[8];let c;return e[9]!==o||e[10]!==r||e[11]!==a?(c=s.jsx(it,{modelSet:o,selectedModelId:r,onSelect:a}),e[9]=o,e[10]=r,e[11]=a,e[12]=c):c=e[12],c}function Bi(i){const e=U.c(39),{variant:t,className:l,placeholder:n,model:o,isLoading:r,credentialId:a,onCredentialChange:c,onModelChange:d,filterModels:u,agent:m}=i,h=t===void 0?"borderless":t,f=n===void 0?"Select model":n,[g,x]=D.useState(!1),j=d!==void 0,k=bt(),w=h==="borderless"?"ghost":"outline",I=h==="borderless"&&"md:border-none";let _;e[0]!==l||e[1]!==I?(_=ne("text-sm hover:bg-accent rounded-lg py-0.5 px-1 gap-1 shadow-none cursor-pointer border-0 group focus-visible:ring-0 focus-visible:ring-offset-0 min-w-0 shrink justify-start overflow-hidden",I,l),e[0]=l,e[1]=I,e[2]=_):_=e[2];let M;e[3]!==r||e[4]!==o||e[5]!==f||e[6]!==j?(M=j?s.jsx(Ye,{model:o??null,placeholder:f,isLoading:r}):s.jsx(mi,{placeholder:f}),e[3]=r,e[4]=o,e[5]=f,e[6]=j,e[7]=M):M=e[7];let b;e[8]!==w||e[9]!==_||e[10]!==M?(b=s.jsx(ee,{variant:w,size:"sm",className:_,children:M}),e[8]=w,e[9]=_,e[10]=M,e[11]=b):b=e[11];const N=b;let S;e[12]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(qs,{}),e[12]=S):S=e[12];let C;e[13]!==m||e[14]!==a||e[15]!==u||e[16]!==o||e[17]!==c||e[18]!==d||e[19]!==j?(C=s.jsx(D.Suspense,{fallback:S,children:j?s.jsx(di,{onClose:()=>x(!1),agent:m,credentialId:a??null,onCredentialChange:c??ui,selectedModel:o??null,onModelChange:d,filterModels:u}):s.jsx(ci,{onClose:()=>x(!1),agent:m})}),e[13]=m,e[14]=a,e[15]=u,e[16]=o,e[17]=c,e[18]=d,e[19]=j,e[20]=C):C=e[20];const p=C;if(k){let z;e[21]!==N?(z=s.jsx(pt,{asChild:!0,children:N}),e[21]=N,e[22]=z):z=e[22];let O;e[23]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx(xt,{className:"sr-only",children:"Select model"}),e[23]=O):O=e[23];let R;e[24]!==p?(R=s.jsxs(gt,{className:"p-0 flex flex-col max-h-[95vh]",children:[O,s.jsx("div",{className:"flex-1 flex flex-col min-h-0 overflow-hidden",children:p})]}),e[24]=p,e[25]=R):R=e[25];let P;return e[26]!==g||e[27]!==z||e[28]!==R?(P=s.jsxs(vt,{open:g,onOpenChange:x,children:[z,R]}),e[26]=g,e[27]=z,e[28]=R,e[29]=P):P=e[29],P}let y;e[30]!==N?(y=s.jsx(ht,{asChild:!0,children:N}),e[30]=N,e[31]=y):y=e[31];let v;e[32]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(Ke,{className:"sr-only",children:"Select model"}),e[32]=v):v=e[32];let E;e[33]!==p?(E=s.jsxs(Fe,{className:"p-0 gap-0 sm:max-w-fit overflow-hidden h-[100dvh] sm:h-auto max-h-[100dvh] sm:max-h-[85vh] w-full max-w-full sm:max-w-fit rounded-none sm:rounded-xl border-0 sm:border",closeButtonClassName:"top-3.5 right-3.5 z-20",children:[v,p]}),e[33]=p,e[34]=E):E=e[34];let A;return e[35]!==g||e[36]!==y||e[37]!==E?(A=s.jsxs(De,{open:g,onOpenChange:x,children:[y,E]}),e[35]=g,e[36]=y,e[37]=E,e[38]=A):A=e[38],A}function ui(){}function mi(i){const e=U.c(4),{placeholder:t}=i,{selectedModel:l,isModelsLoading:n}=ge();let o;return e[0]!==n||e[1]!==l||e[2]!==t?(o=s.jsx(Ye,{model:l,placeholder:t,isLoading:n}),e[0]=n,e[1]=l,e[2]=t,e[3]=o):o=e[3],o}export{ps as C,Bi as M,bs as N,Xe as P,Fi as a,ce as b,Ki as g,Di as i,ye as m};
@@ -1 +0,0 @@
1
- import{c as T,j as t,r as Q,B as je,i as be}from"./index-Dq2GzmIa.js";import{i as Se}from"./ChevronRight-D7I_d6Rs.js";import{Y as fe}from"./agent-icon-cR-VXBAA.js";import{m as ue}from"./automation-runs-IA98DU4N.js";import{r as Ne,u as ke,a as _e,b as we,i as Ce,d as Te,f as Fe,P as Re,S as Ee}from"./page-seo-form-ByR9Z__k.js";import{a2 as xe,r as ze}from"./index-DpAoOgpk.js";import{a as ge}from"./Image01-Cm0pa05N.js";import"./AlertCircle-TjPHcEnP.js";import"./Tool01-DTY-fPyM.js";import"./ArrowUp-D620niSP.js";import"./Settings02-BNJ32xSl.js";import"./Tool02-C5wUTAFe.js";import"./XCircle-Di7Lb4ZU.js";import"./ArrowUpRight-BH4m-RJh.js";import"./TrendUp01--_jCdLU4.js";import"./ZapSquare-CqcwFWlA.js";import"./ZoomOut-C_Zu7-Q5.js";import"./Users03-Bk7hrtUP.js";import"./CheckCircle-wgdag1z7.js";import"./ChevronUp-BcAa4Ljr.js";import"./ChevronDown-C3MkOcZJ.js";import"./DotsVertical-BkJg419g.js";import"./Stars02-7EGkcn1l.js";import"./Copy01-ybfnME4F.js";import"./Globe01-e5qIDEbr.js";import"./Eye-CeD9rgkI.js";import"./FilterLines-DTDvdHSv.js";import"./Star01-5GqPaTBh.js";import"./Globe04-Bxmic94-.js";import"./SwitchHorizontal01-CWRzX-Fm.js";import"./HardDrive-Bo4OGyrd.js";import"./Key01-Dz6Z8ZMZ.js";import"./LayoutLeft--D_GxkO2.js";import"./LinkExternal01-eA6vVQM3.js";import"./Monitor01-CbDoyDRV.js";import"./Sun-C4Fwh1Vu.js";import"./Package-BRrJc9sL.js";import"./Palette-D12yKiV2.js";import"./Play-CQU4qZuG.js";import"./Plus-CaVUuJOD.js";import"./SearchLg-CIPUU7M2.js";import"./SearchMd-7xF40qNR.js";import"./Shield01-CfES6vR4.js";import"./Stars01-DrN-Oz3U.js";import"./Trash01-D4xE6JK2.js";import"./Upload01-Baccrojk.js";import"./User01-B_wV9DLb.js";import"./Users01--ZODDl59.js";import"./XClose-BWc8duIO.js";import"./X-Dg7rsVai.js";import"./Zap-BS9GJrhH.js";import"./select-CrSxwLpY.js";import"./tooltip-BI-udduQ.js";import"./useInfiniteQuery-CErl8eUD.js";import"./use-infinite-scroll-C_M049Oj.js";import"./use-connection-BYUOXcTZ.js";import"./use-collections-BakROzwv.js";import"./use-mcp-client-BET4cVQ2.js";import"./auth-DgHUqP65.js";import"./use-virtual-mcp-B1v9ZXLU.js";import"./card-CPTg8fDY.js";import"./sidebar-C5_XfNYh.js";import"./use-mobile-BjsEeYVy.js";import"./table-CjtfrukD.js";import"./empty-state-D9Dn1Lnz.js";import"./use-members-Dmwu4pSZ.js";import"./use-org-auth-client-BZS4V2Lt.js";import"./use-clock-tick-DOOmIKzq.js";import"./use-automations-CqRQFXK6.js";import"./studio-tools-DT3M_Vdz.js";import"./useSuspenseInfiniteQuery-CqYcpPIQ.js";import"./avatar-Cg58Qi4s.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-X1Kg3Hp6.js";import"./file-type-icon-XKnElsdT.js";import"./dialog-DT5S2RMB.js";import"./tab-id-BijBBRwE.js";import"./hooks-CKtulQ0t.js";import"./decopilot-sse-pool-C_pTq61C.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./chat-context-BAovwxgU.js";import"./autosend-TZVzvR_1.js";import"./use-ai-providers-w9d34g0F.js";import"./location-BpLtHjTZ.js";import"./use-decopilot-events-DDc7EwGs.js";import"./use-organization-settings-C0IXRiP_.js";import"./monaco-editor-Bq9EBE_u.js";import"./index-D1cQ6lKh.js";import"./index-DyWjSb5y.js";import"./calendar-DxMjhXOp.js";import"./shell-layout-DQaGi35E.js";import"./required-auth-layout-DLhyslwf.js";import"./use-org-sso-DIQMNs43.js";import"./integration-icon-CGshMm4e.js";import"./use-navigate-to-agent-C4BCBCv3.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-Cn-bvgNR.js";import"./form-CFqk5lJy.js";import"./label-BtGdlmhk.js";import"./input-_HbUXqOS.js";import"./switch-BlPs3ERk.js";import"./drawer-XzD4hvpg.js";import"./collection-search-Btrf8Diq.js";import"./index-B0JPF-6M.js";import"./get-initials-D-f_fDFw.js";import"./use-registry-app-COi_RGkf.js";import"./use-mcp-tools-z0J_EOSL.js";import"./github-repo-scope-DjMZbiKa.js";import"./authenticate-and-persist-oauth-ClWKGwOW.js";import"./mcp-oauth-D4aGhRIx.js";import"./extract-connection-data-nMVGabj3.js";import"./dropdown-menu-EMizUbgW.js";import"./popover-DuDwu8ZY.js";import"./command-0HaDsh2Q.js";import"./index-BojbkbvA.js";import"./companions-core-DJ2SKsFs.js";import"./tabs-Ca1nnDrk.js";import"./toggle-group-a5DM2sSK.js";import"./use-deco-credits-DGCPQWxL.js";import"./connection-card-DwBQfP1R.js";import"./use-registry-connections-BThC_Q4I.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-BHzi6Dhm.js";import"./connection-form-helpers-7cL_OUk8.js";import"./collection-tabs-kwELhDMx.js";import"./badge-D2XsHW2Y.js";import"./connect-desktop-dialog-CkUcaE26.js";import"./select-model-CPc7lxVf.js";import"./checkbox-BdHs-X49.js";import"./skeleton-CFwDF8gK.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-DpMc0HVT.js";import"./index-MzuqcCtH.js";import"./alert-dialog-CRKyaNBx.js";import"./toolbar-BptqFiOS.js";import"./use-debounced-value-BcV326dl.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-D8lhFnWZ.js";import"./use-capability-DMFGKIH5.js";import"./toolbar-icon-button-BAMgsY3V.js";import"./use-debounced-autosave-C2vhIJrv.js";import"./index-DoiBq52a.js";import"./search-input-CuP775da.js";import"./use-mcp-auth-status-ClCJfdlL.js";import"./github-repo-picker-DpzVLTnS.js";import"./provision-repo-scoped-github-connection-2iDn-wQ1.js";import"./use-secrets-C4jt5KwT.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./use-file-configs-dAie7zDN.js";import"./automation-list-row-aKON7NTD.js";function U(n){return typeof n=="string"&&n.trim()?n:void 0}function he(n,e){if(n){if(e)try{const i=new URL(n,e).href;return xe(i)}catch{return}return xe(n)}}function Pe(n){if(!n)return{};const e=U(n.title),i=U(n.titleTemplate);return{title:e&&i?.includes("%s")?i.replace(/%s/g,e):e,description:U(n.description),image:U(n.image),favicon:U(n.favicon)}}function Oe(n){if(!n)return"example.com";try{return new URL(n).host}catch{return"example.com"}}const Z="Your page title",ee="Your meta description will appear here.",Le=[{id:"google",label:"Google",color:"#4285F4",layout:"search"},{id:"facebook",label:"Facebook",color:"#1877F2",layout:"card"},{id:"twitter",label:"X (Twitter)",color:"#0f1419",layout:"card"},{id:"linkedin",label:"LinkedIn",color:"#0A66C2",layout:"card"},{id:"whatsapp",label:"WhatsApp",color:"#25D366",layout:"chat"},{id:"telegram",label:"Telegram",color:"#229ED9",layout:"chat"},{id:"slack",label:"Slack",color:"#611f69",layout:"attachment"},{id:"discord",label:"Discord",color:"#5865F2",layout:"attachment"}];function pe(n){const e=T.c(10),{src:i,className:r,iconSize:h}=n,a=h===void 0?20:h;if(i){let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m={objectFit:"cover"},e[0]=m):m=e[0];let p;return e[1]!==r||e[2]!==i?(p=t.jsx("img",{src:i,alt:"",referrerPolicy:"no-referrer",className:r,style:m}),e[1]=r,e[2]=i,e[3]=p):p=e[3],p}let s;e[4]===Symbol.for("react.memo_cache_sentinel")?(s={display:"flex",alignItems:"center",justifyContent:"center",background:"#e5e7eb",color:"#9ca3af"},e[4]=s):s=e[4];let o;e[5]!==a?(o=t.jsx(ge,{size:a}),e[5]=a,e[6]=o):o=e[6];let l;return e[7]!==r||e[8]!==o?(l=t.jsx("div",{className:r,style:s,children:o}),e[7]=r,e[8]=o,e[9]=l):l=e[9],l}function $e(n){const e=T.c(27),{seo:i,host:r,path:h}=n;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={background:"#fff",border:"1px solid #dadce0"},e[0]=a):a=e[0];let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s={background:"#f1f3f4"},e[1]=s):s=e[1];let o;e[2]!==i.favicon?(o=t.jsx("div",{className:"flex size-6 shrink-0 items-center justify-center overflow-hidden rounded-full",style:s,children:i.favicon?t.jsx("img",{src:i.favicon,alt:"",className:"size-full object-cover"}):t.jsx(ge,{size:12,color:"#9aa0a6"})}),e[2]=i.favicon,e[3]=o):o=e[3];let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l={color:"#202124"},e[4]=l):l=e[4];let m;e[5]!==r?(m=t.jsx("div",{className:"truncate text-[13px] leading-tight",style:l,children:r}),e[5]=r,e[6]=m):m=e[6];let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p={color:"#4d5156"},e[7]=p):p=e[7];let d;e[8]!==r||e[9]!==h?(d=t.jsxs("div",{className:"truncate text-[12px] leading-tight",style:p,children:[r,h]}),e[8]=r,e[9]=h,e[10]=d):d=e[10];let c;e[11]!==m||e[12]!==d?(c=t.jsxs("div",{className:"min-w-0",children:[m,d]}),e[11]=m,e[12]=d,e[13]=c):c=e[13];let g;e[14]!==o||e[15]!==c?(g=t.jsxs("div",{className:"flex items-center gap-2",children:[o,c]}),e[14]=o,e[15]=c,e[16]=g):g=e[16];let f;e[17]===Symbol.for("react.memo_cache_sentinel")?(f={color:"#1a0dab"},e[17]=f):f=e[17];const x=i.title??Z;let u;e[18]!==x?(u=t.jsx("div",{className:"mt-1.5 truncate text-[18px] leading-snug",style:f,children:x}),e[18]=x,e[19]=u):u=e[19];let j;e[20]===Symbol.for("react.memo_cache_sentinel")?(j={color:"#4d5156"},e[20]=j):j=e[20];const v=i.description??ee;let y;e[21]!==v?(y=t.jsx("div",{className:"mt-0.5 line-clamp-2 text-[13px] leading-snug",style:j,children:v}),e[21]=v,e[22]=y):y=e[22];let b;return e[23]!==u||e[24]!==y||e[25]!==g?(b=t.jsxs("div",{className:"rounded-lg p-3 text-left",style:a,children:[g,u,y]}),e[23]=u,e[24]=y,e[25]=g,e[26]=b):b=e[26],b}function De(n){const e=T.c(20),{seo:i,host:r}=n;let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h={background:"#fff",border:"1px solid #e2e8f0"},e[0]=h):h=e[0];let a;e[1]!==i.image?(a=t.jsx(pe,{src:i.image,className:"h-40 w-full"}),e[1]=i.image,e[2]=a):a=e[2];let s;e[3]===Symbol.for("react.memo_cache_sentinel")?(s={borderTop:"1px solid #e2e8f0"},e[3]=s):s=e[3];let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o={color:"#8a9099"},e[4]=o):o=e[4];let l;e[5]!==r?(l=t.jsx("div",{className:"truncate text-[11px]",style:o,children:r}),e[5]=r,e[6]=l):l=e[6];let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m={color:"#1c2024"},e[7]=m):m=e[7];const p=i.title??Z;let d;e[8]!==p?(d=t.jsx("div",{className:"line-clamp-1 text-[14px] font-semibold",style:m,children:p}),e[8]=p,e[9]=d):d=e[9];let c;e[10]===Symbol.for("react.memo_cache_sentinel")?(c={color:"#60666c"},e[10]=c):c=e[10];const g=i.description??ee;let f;e[11]!==g?(f=t.jsx("div",{className:"line-clamp-2 text-[12px]",style:c,children:g}),e[11]=g,e[12]=f):f=e[12];let x;e[13]!==f||e[14]!==l||e[15]!==d?(x=t.jsxs("div",{className:"px-3 py-2",style:s,children:[l,d,f]}),e[13]=f,e[14]=l,e[15]=d,e[16]=x):x=e[16];let u;return e[17]!==x||e[18]!==a?(u=t.jsxs("div",{className:"overflow-hidden rounded-lg text-left",style:h,children:[a,x]}),e[17]=x,e[18]=a,e[19]=u):u=e[19],u}function Ie(n){const e=T.c(23),{seo:i,host:r,accent:h}=n;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={background:"#f0f2f5"},e[0]=a):a=e[0];let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("p",{className:"px-1 pb-1.5 text-[12px]",style:{color:"#3b4045"},children:"Here's a post you might write with the link of your website:"}),e[1]=s):s=e[1];const o=`3px solid ${h}`;let l;e[2]!==o?(l={background:"#fff",borderLeft:o},e[2]=o,e[3]=l):l=e[3];let m;e[4]!==i.image?(m=t.jsx(pe,{src:i.image,className:"h-28 w-full",iconSize:18}),e[4]=i.image,e[5]=m):m=e[5];let p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p={color:"#1c2024"},e[6]=p):p=e[6];const d=i.title??Z;let c;e[7]!==d?(c=t.jsx("div",{className:"line-clamp-1 text-[12px] font-semibold",style:p,children:d}),e[7]=d,e[8]=c):c=e[8];let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g={color:"#60666c"},e[9]=g):g=e[9];const f=i.description??ee;let x;e[10]!==f?(x=t.jsx("div",{className:"line-clamp-2 text-[11px]",style:g,children:f}),e[10]=f,e[11]=x):x=e[11];let u;e[12]===Symbol.for("react.memo_cache_sentinel")?(u={color:"#8a9099"},e[12]=u):u=e[12];let j;e[13]!==r?(j=t.jsx("div",{className:"mt-0.5 text-[10px]",style:u,children:r}),e[13]=r,e[14]=j):j=e[14];let v;e[15]!==x||e[16]!==j||e[17]!==c?(v=t.jsxs("div",{className:"px-2.5 py-1.5",children:[c,x,j]}),e[15]=x,e[16]=j,e[17]=c,e[18]=v):v=e[18];let y;return e[19]!==v||e[20]!==l||e[21]!==m?(y=t.jsxs("div",{className:"rounded-lg p-2 text-left",style:a,children:[s,t.jsxs("div",{className:"overflow-hidden rounded-md",style:l,children:[m,v]})]}),e[19]=v,e[20]=l,e[21]=m,e[22]=y):y=e[22],y}function Ae(n){const e=T.c(33),{seo:i,host:r,accent:h,dark:a}=n,s=a?"#2b2d31":"#fff",o=a?"#00a8fc":"#1264a3",l=a?"#dbdee1":"#3b4045",m=a?"#949ba4":"#8a9099",p=a?"none":"1px solid #e2e8f0";let d;e[0]!==s||e[1]!==p?(d={background:s,border:p},e[0]=s,e[1]=p,e[2]=d):d=e[2];const c=`3px solid ${h}`;let g;e[3]!==c?(g={borderLeft:c,borderRadius:2},e[3]=c,e[4]=g):g=e[4];let f;e[5]!==m?(f={color:m},e[5]=m,e[6]=f):f=e[6];let x;e[7]!==r||e[8]!==f?(x=t.jsx("div",{className:"text-[10px]",style:f,children:r}),e[7]=r,e[8]=f,e[9]=x):x=e[9];let u;e[10]!==o?(u={color:o},e[10]=o,e[11]=u):u=e[11];const j=i.title??Z;let v;e[12]!==u||e[13]!==j?(v=t.jsx("div",{className:"line-clamp-1 text-[13px] font-semibold",style:u,children:j}),e[12]=u,e[13]=j,e[14]=v):v=e[14];let y;e[15]!==l?(y={color:l},e[15]=l,e[16]=y):y=e[16];const b=i.description??ee;let _;e[17]!==y||e[18]!==b?(_=t.jsx("div",{className:"line-clamp-2 text-[12px]",style:y,children:b}),e[17]=y,e[18]=b,e[19]=_):_=e[19];let N;e[20]!==_||e[21]!==x||e[22]!==v?(N=t.jsxs("div",{className:"min-w-0 flex-1",children:[x,v,_]}),e[20]=_,e[21]=x,e[22]=v,e[23]=N):N=e[23];let S;e[24]!==i.image?(S=t.jsx(pe,{src:i.image,className:"size-14 shrink-0 rounded",iconSize:16}),e[24]=i.image,e[25]=S):S=e[25];let k;e[26]!==N||e[27]!==S||e[28]!==g?(k=t.jsxs("div",{className:"flex gap-2.5 pl-2.5",style:g,children:[N,S]}),e[26]=N,e[27]=S,e[28]=g,e[29]=k):k=e[29];let C;return e[30]!==k||e[31]!==d?(C=t.jsx("div",{className:"rounded-lg p-2.5 text-left",style:d,children:k}),e[30]=k,e[31]=d,e[32]=C):C=e[32],C}function Be(n){const e=T.c(17),{platform:i,seo:r,host:h,path:a}=n;let s;e[0]!==h||e[1]!==a||e[2]!==i.color||e[3]!==i.id||e[4]!==i.layout||e[5]!==r?(s=i.layout==="search"?t.jsx($e,{seo:r,host:h,path:a}):i.layout==="card"?t.jsx(De,{seo:r,host:h,path:a}):i.layout==="chat"?t.jsx(Ie,{seo:r,host:h,path:a,accent:i.color}):t.jsx(Ae,{seo:r,host:h,path:a,accent:i.color,dark:i.id==="discord"}),e[0]=h,e[1]=a,e[2]=i.color,e[3]=i.id,e[4]=i.layout,e[5]=r,e[6]=s):s=e[6];const o=s;let l;e[7]!==i.color?(l=t.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{background:i.color}}),e[7]=i.color,e[8]=l):l=e[8];let m;e[9]!==i.label?(m=t.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:i.label}),e[9]=i.label,e[10]=m):m=e[10];let p;e[11]!==l||e[12]!==m?(p=t.jsxs("div",{className:"mb-1.5 flex items-center gap-1.5",children:[l,m]}),e[11]=l,e[12]=m,e[13]=p):p=e[13];let d;return e[14]!==o||e[15]!==p?(d=t.jsxs("div",{children:[p,o]}),e[14]=o,e[15]=p,e[16]=d):d=e[16],d}function Ue(n){const e=T.c(17),{seo:i,url:r,path:h}=n,a=h===void 0?"/":h;let s,o,l;if(e[0]!==i||e[1]!==r){const u=Pe(i);s=u,o=he(u.image,r),l=he(u.favicon,r),e[0]=i,e[1]=r,e[2]=s,e[3]=o,e[4]=l}else s=e[2],o=e[3],l=e[4];let m;e[5]!==s||e[6]!==o||e[7]!==l?(m={...s,image:o,favicon:l},e[5]=s,e[6]=o,e[7]=l,e[8]=m):m=e[8];const p=m;let d;e[9]!==r?(d=Oe(r),e[9]=r,e[10]=d):d=e[10];const c=d,g=a==="/"?"":a;let f;e[11]!==g||e[12]!==c||e[13]!==p?(f=Le.map(u=>t.jsx(Be,{platform:u,seo:p,host:c,path:g},u.id)),e[11]=g,e[12]=c,e[13]=p,e[14]=f):f=e[14];let x;return e[15]!==f?(x=t.jsx("div",{className:"grid grid-cols-1 gap-4 @2xl:grid-cols-2",children:f}),e[15]=f,e[16]=x):x=e[16],x}function Ii(n){const e=T.c(63),{orgSlug:i,virtualMcpId:r,branch:h,decofile:a,meta:s,target:o,previewBaseUrl:l,onSaved:m,onEditDefaultSeo:p,onBack:d}=n,c=Ne(a,o,s),g=c?.seoData,f=o.kind==="site"?"site":o.pageKey,[x,u]=Q.useState(f),[j,v]=Q.useState(null),[y,b]=Q.useState(0),[_,N]=Q.useState(void 0);x!==f&&(u(f),v(null),N(void 0),b(Me));const{persistSeo:S,persistRawSeo:k,flush:C,isPending:te}=ke({orgSlug:i,virtualMcpId:r,branch:h,target:o,resolved:c,onSaved:m}),K=o.kind==="page",ve=K?c?.rawSeoData:void 0,B=_!==void 0?_:ve,ye=K?_e(B)??void 0:void 0,w=j??ye??g??{},F=c?we(w,c):null,z=F&&(!K||Ce(B))?ze(F,s):null;let M;e[0]!==s?(M=Te(s),e[0]=s,e[1]=M):M=e[1];const oe=M;let R,Y;e[2]!==a||e[3]!==w||e[4]!==s||e[5]!==o.kind?(R=o.kind==="page"?Fe(a,s)?.seoData??{}:{},Y=o.kind==="page"?Ge(R,w):w,e[2]=a,e[3]=w,e[4]=s,e[5]=o.kind,e[6]=R,e[7]=Y):(R=e[6],Y=e[7]);const ie=Y;let G;e[8]!==S||e[9]!==c||e[10]!==v?(G=E=>{if(!c)return;const de=E;v(de),S(de)},e[8]=S,e[9]=c,e[10]=v,e[11]=G):G=e[11];const se=G;let V;e[12]!==v?(V=()=>v(null),e[12]=v,e[13]=V):V=e[13];const le=V;let H;e[14]!==b?(H=()=>b(Ke),e[14]=b,e[15]=H):H=e[15];const re=H;let W;e[16]!==C||e[17]!==d?(W=()=>{C(),d?.()},e[16]=C,e[17]=d,e[18]=W):W=e[18];const ae=W,P=o.kind==="page"?o.path:"/";let X;e[19]!==P||e[20]!==l||e[21]!==o.kind?(X=o.kind==="page"&&l?Ye(P,l):l??null,e[19]=P,e[20]=l,e[21]=o.kind,e[22]=X):X=e[22];const ne=X,ce=o.kind==="site"?"No site-level SEO block found.":c?"SEO schema not found for this page.":"Could not load page SEO.",q=K&&c,me=o.kind==="site"&&c&&z;let O;e[23]!==ae||e[24]!==o.kind||e[25]!==o.pageName?(O=o.kind==="page"?t.jsxs("nav",{className:"flex min-w-0 items-center gap-1 text-sm",children:[t.jsx("button",{type:"button",onClick:ae,title:o.pageName,className:"min-w-0 truncate rounded-md px-1 py-0.5 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground",children:o.pageName}),t.jsx(Se,{className:"size-3 shrink-0 text-muted-foreground/60"}),t.jsx("span",{className:"px-1 py-0.5 font-medium text-foreground",children:"SEO"})]}):t.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[t.jsx(fe,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsx("span",{className:"text-sm font-medium",children:"Default SEO"}),t.jsx("span",{className:"hidden truncate text-xs text-muted-foreground sm:inline",children:"· applied to every page unless overridden"})]}),e[23]=ae,e[24]=o.kind,e[25]=o.pageName,e[26]=O):O=e[26];let L;e[27]!==te?(L=te&&t.jsx(be,{size:14,className:"animate-spin text-muted-foreground"}),e[27]=te,e[28]=L):L=e[28];let $;e[29]!==p||e[30]!==o.kind?($=o.kind==="page"&&p&&t.jsxs(je,{type:"button",variant:"outline",size:"sm",onClick:p,children:[t.jsx(fe,{size:14}),"Edit default SEO"]}),e[29]=p,e[30]=o.kind,e[31]=$):$=e[31];let D;e[32]!==$||e[33]!==L?(D=t.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:[L,$]}),e[32]=$,e[33]=L,e[34]=D):D=e[34];let I;e[35]!==D||e[36]!==O?(I=t.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-2 border-b px-4",children:[O,D]}),e[35]=D,e[36]=O,e[37]=I):I=e[37];let A;e[38]!==F||e[39]!==re||e[40]!==le||e[41]!==oe||e[42]!==B||e[43]!==w||e[44]!==ce||e[45]!==y||e[46]!==se||e[47]!==P||e[48]!==k||e[49]!==S||e[50]!==ie||e[51]!==ne||e[52]!==c||e[53]!==z||e[54]!==v||e[55]!==N||e[56]!==q||e[57]!==me||e[58]!==R?(A=!c||!q&&!me?t.jsx("div",{className:"flex flex-1 items-center justify-center px-6 text-center text-sm text-muted-foreground",children:ce}):t.jsxs("div",{className:"flex min-h-0 flex-1",children:[t.jsx(ue,{className:"w-full max-w-md shrink-0 border-r [&_[data-slot=scroll-area-viewport]>div]:!block",children:t.jsx("div",{className:"px-5 py-4",children:q?t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"mb-3 text-xs text-muted-foreground",children:"Empty fields inherit the default SEO. The preview shows the resolved result."}),t.jsx(Re,{rawSeo:B,innerSeo:w,defaultResolveType:oe,seoSchema:z,activeResolveType:F,seoTypeOptions:c.seoTypeOptions,formResetKey:y,siteDefaultSeo:R,onPersistRaw:E=>{N(E),k(E)},onInnerChange:E=>{v(E),S(E)},onClearForm:le,onBumpFormKey:re})]}):z&&F&&t.jsx(Ee,{schema:z,resolveType:F,value:w,formResetKey:y,onChange:se})})}),t.jsx(ue,{className:"min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:t.jsx("div",{className:"@container px-5 py-4",children:t.jsx(Ue,{seo:ie,url:ne,path:P})})})]}),e[38]=F,e[39]=re,e[40]=le,e[41]=oe,e[42]=B,e[43]=w,e[44]=ce,e[45]=y,e[46]=se,e[47]=P,e[48]=k,e[49]=S,e[50]=ie,e[51]=ne,e[52]=c,e[53]=z,e[54]=v,e[55]=N,e[56]=q,e[57]=me,e[58]=R,e[59]=A):A=e[59];let J;return e[60]!==I||e[61]!==A?(J=t.jsxs("div",{className:"flex h-full w-full flex-col",children:[I,A]}),e[60]=I,e[61]=A,e[62]=J):J=e[62],J}function Ke(n){return n+1}function Me(n){return n+1}function Ye(n,e){try{return new URL(n,e).href}catch{return e}}function Ge(n,e){const i=e.__resolveType,r=n.__resolveType;if(typeof i=="string"&&typeof r=="string"&&i!==r)return{...e};const h={...n};for(const[a,s]of Object.entries(e))a!=="__resolveType"&&s!=null&&(typeof s=="string"&&s.trim()===""||(h[a]=s));return h}export{Ii as SeoEditor};
@@ -1 +0,0 @@
1
- import{C as D,r as v,j as e,B as p,p as S,t as c,c as N}from"./index-Dq2GzmIa.js";import{D as k}from"./domain-settings-B5aXl5-3.js";import{P as f}from"./index-DoiBq52a.js";import{I as l}from"./input-_HbUXqOS.js";import{S as z}from"./switch-BlPs3ERk.js";import{a as P,b as R,c as A,d as T}from"./use-org-sso-DIQMNs43.js";import{c as F,S as y,a as C,b as r,d as O}from"./settings-section-DpMc0HVT.js";import{s as L}from"./Trash01-D4xE6JK2.js";import{R as q}from"./require-capability-DXSues5j.js";import"./studio-tools-DT3M_Vdz.js";import"./badge-D2XsHW2Y.js";import"./select-CrSxwLpY.js";import"./tooltip-BI-udduQ.js";import"./ChevronUp-BcAa4Ljr.js";import"./ChevronDown-C3MkOcZJ.js";import"./sidebar-C5_XfNYh.js";import"./LayoutLeft--D_GxkO2.js";import"./use-mobile-BjsEeYVy.js";import"./X-Dg7rsVai.js";import"./card-CPTg8fDY.js";import"./ArrowUpRight-BH4m-RJh.js";import"./use-capability-DMFGKIH5.js";import"./access-gate-BPnO_2yT.js";import"./capability-load-error-96MaJwmz.js";function B(){const{org:s}=D(),{data:a,isLoading:E}=P(s.id,s.slug),x=R(s.id,s.slug),h=A(s.id,s.slug),j=T(s.id,s.slug),[t,d]=v.useState({issuer:"",clientId:"",clientSecret:"",discoveryEndpoint:"",domain:"",scopes:"openid email profile"}),[m,g]=v.useState(!1),u=a?.configured&&a.config,o=a?.config,I=()=>{o&&d({issuer:o.issuer,clientId:o.clientId,clientSecret:"",discoveryEndpoint:o.discoveryEndpoint??"",domain:o.domain,scopes:o.scopes.join(" ")}),g(!0)},b=async()=>{if(!t.issuer||!t.clientId||!t.domain){c.error("Issuer, Client ID, and Domain are required");return}if(!u&&!t.clientSecret){c.error("Client Secret is required for initial setup");return}try{await x.mutateAsync({issuer:t.issuer,clientId:t.clientId,clientSecret:t.clientSecret,discoveryEndpoint:t.discoveryEndpoint||void 0,scopes:t.scopes.split(/\s+/).filter(Boolean),domain:t.domain,enforced:o?.enforced??!1}),S(u?"sso_config_updated":"sso_configured",{organization_id:s.id,email_domain:t.domain}),c.success("SSO configuration saved"),g(!1)}catch(i){c.error(i instanceof Error?i.message:"Failed to save SSO config")}},w=async()=>{if(confirm("Are you sure you want to remove SSO configuration?"))try{await h.mutateAsync(),S("sso_config_removed",{organization_id:s.id}),c.success("SSO configuration removed"),g(!1)}catch{c.error("Failed to remove SSO config")}},_=async i=>{try{await j.mutateAsync(i),S("sso_enforcement_toggled",{organization_id:s.id,enforced:i}),c.success(i?"SSO enforcement enabled":"SSO enforcement disabled")}catch{c.error("Failed to toggle SSO enforcement")}};return e.jsx(f,{children:e.jsx(f.Content,{children:e.jsx(f.Body,{children:e.jsxs(F,{children:[e.jsx(f.Title,{children:"Security"}),e.jsx(k,{}),E?e.jsx("div",{className:"text-sm text-muted-foreground",children:"Loading..."}):e.jsxs(e.Fragment,{children:[u&&!m&&e.jsx(y,{title:"Single Sign-On",children:e.jsxs(C,{children:[e.jsx(r,{title:"Provider",action:e.jsx("span",{className:"font-medium",children:o.issuer})}),e.jsx(r,{title:"Client ID",action:e.jsx("span",{className:"font-mono text-xs",children:o.clientId})}),e.jsx(r,{title:"Domain",action:e.jsx("span",{className:"font-medium",children:o.domain})}),e.jsx(r,{title:"Scopes",action:e.jsx("span",{className:"font-mono text-xs",children:o.scopes.join(" ")})}),e.jsx("div",{className:"h-px bg-border mx-5"}),e.jsx(r,{title:"Enforce SSO",description:"Require all members to authenticate via SSO",action:e.jsx(z,{checked:o.enforced,onCheckedChange:_,disabled:j.isPending})}),e.jsxs(O,{children:[e.jsxs(p,{variant:"ghost",size:"sm",onClick:w,disabled:h.isPending,className:"text-destructive hover:text-destructive mr-auto",children:[e.jsx(L,{size:14}),"Remove"]}),e.jsx(p,{variant:"outline",size:"sm",onClick:()=>{window.open(`/api/${s.slug}/sso/authorize`,"_blank")},children:"Test SSO"}),e.jsx(p,{variant:"outline",size:"sm",onClick:I,children:"Edit configuration"})]})]})}),(!u||m)&&e.jsx(y,{title:"Single Sign-On",children:e.jsxs(C,{children:[e.jsx(r,{title:"Issuer URL",description:"The OIDC issuer URL of your identity provider.",action:e.jsx(l,{id:"sso-issuer",placeholder:"https://login.microsoftonline.com/{tenant}/v2.0",value:t.issuer,onChange:i=>d(n=>({...n,issuer:i.target.value})),className:"w-[280px]"})}),e.jsx(r,{title:"Client ID",action:e.jsx(l,{id:"sso-client-id",placeholder:"your-client-id",value:t.clientId,onChange:i=>d(n=>({...n,clientId:i.target.value})),className:"w-[280px]"})}),e.jsx(r,{title:"Client Secret",description:m&&u?"Leave empty to keep current":void 0,action:e.jsx(l,{id:"sso-client-secret",type:"password",placeholder:"your-client-secret",value:t.clientSecret,onChange:i=>d(n=>({...n,clientSecret:i.target.value})),className:"w-[280px]"})}),e.jsx(r,{title:"Email Domain",description:"The email domain this SSO provider covers.",action:e.jsx(l,{id:"sso-domain",placeholder:"company.com",value:t.domain,onChange:i=>d(n=>({...n,domain:i.target.value})),className:"w-[280px]"})}),e.jsx(r,{title:"Scopes",action:e.jsx(l,{id:"sso-scopes",placeholder:"openid email profile",value:t.scopes,onChange:i=>d(n=>({...n,scopes:i.target.value})),className:"w-[280px]"})}),e.jsx(r,{title:"Discovery Endpoint",description:"Optional — auto-detected from issuer if omitted.",action:e.jsx(l,{id:"sso-discovery",placeholder:"Auto-detected from issuer",value:t.discoveryEndpoint,onChange:i=>d(n=>({...n,discoveryEndpoint:i.target.value})),className:"w-[280px]"})}),e.jsxs(O,{children:[m&&e.jsx(p,{variant:"outline",size:"sm",onClick:()=>g(!1),children:"Cancel"}),e.jsx(p,{onClick:b,disabled:x.isPending,size:"sm",children:x.isPending?"Saving...":m?"Update":"Configure SSO"})]})]})})]})]})})})})}function me(){const s=N.c(1);let a;return s[0]===Symbol.for("react.memo_cache_sentinel")?(a=e.jsx(q,{capability:"org:manage",area:"security",children:e.jsx(B,{})}),s[0]=a):a=s[0],a}export{me as default};
@@ -1 +0,0 @@
1
- import{c as D,j as s,E as le,r as K,C as ae,n as ce,b as de,e as me,B as Y,p as te,K as fe,d as ge,t as ie}from"./index-Dq2GzmIa.js";import{i as ue}from"./AlertCircle-TjPHcEnP.js";import{i as pe}from"./ChevronRight-D7I_d6Rs.js";import{s as xe}from"./Plus-CaVUuJOD.js";import{s as he}from"./Trash01-D4xE6JK2.js";import{I as X}from"./input-_HbUXqOS.js";import{S as oe}from"./switch-BlPs3ERk.js";import{S as ye}from"./skeleton-CFwDF8gK.js";import{A as ne}from"./avatar-Cg58Qi4s.js";import{b as je,P as Ce,a as Se}from"./popover-DuDwu8ZY.js";import{b as re}from"./use-connection-BYUOXcTZ.js";import{W as Z}from"./use-mcp-client-BET4cVQ2.js";import{P as G}from"./index-DoiBq52a.js";import{u as ve}from"./use-registry-connections-BThC_Q4I.js";import{g as _e,h as be}from"./use-organization-settings-C0IXRiP_.js";import{c as Pe,b as I,S as ee,a as Q}from"./settings-section-DpMc0HVT.js";import{R as Re}from"./require-capability-DXSues5j.js";import"./User01-B_wV9DLb.js";import"./use-collections-BakROzwv.js";import"./auth-DgHUqP65.js";import"./sidebar-C5_XfNYh.js";import"./LayoutLeft--D_GxkO2.js";import"./use-mobile-BjsEeYVy.js";import"./X-Dg7rsVai.js";import"./tooltip-BI-udduQ.js";import"./studio-tools-DT3M_Vdz.js";import"./card-CPTg8fDY.js";import"./ArrowUpRight-BH4m-RJh.js";import"./use-capability-DMFGKIH5.js";import"./access-gate-BPnO_2yT.js";import"./capability-load-error-96MaJwmz.js";function ke(t){const e=D.c(3),{error:o}=t;let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(ue,{size:16}),e[0]=m):m=e[0];let n;return e[1]!==o.message?(n=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[m,s.jsxs("span",{className:"text-sm font-medium",children:["Failed to load store settings: ",o.message]})]}),e[1]=o.message,e[2]=n):n=e[2],n}function we(t){const e=D.c(36),{onCancel:o,onSuccess:m}=t,n=re(),[r,j]=K.useState(""),[a,S]=K.useState(""),[x,v]=K.useState("");let h;e[0]!==n||e[1]!==r||e[2]!==x||e[3]!==a?(h=async()=>(await n.create.mutateAsync({title:r||"Private Registry",description:"Private MCP registry",connection_type:"HTTP",connection_url:a,connection_token:x||null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{type:"registry"},app_name:null,app_id:null,icon:null})).id,e[0]=n,e[1]=r,e[2]=x,e[3]=a,e[4]=h):h=e[4];let f;e[5]!==m?(f=C=>{te("store_private_registry_added",{connection_id:C}),ie.success("Private registry added"),m(C)},e[5]=m,e[6]=f):f=e[6];let y;e[7]!==h||e[8]!==f?(y={mutationFn:h,onSuccess:f,onError:Ne},e[7]=h,e[8]=f,e[9]=y):y=e[9];const{mutate:c,isPending:d}=ge(y);let g;e[10]===Symbol.for("react.memo_cache_sentinel")?(g=C=>j(C.target.value),e[10]=g):g=e[10];let u;e[11]!==r?(u=s.jsx(I,{title:"Name",action:s.jsx(X,{placeholder:"e.g. Acme Corp Registry",value:r,onChange:g,className:"w-[280px]"})}),e[11]=r,e[12]=u):u=e[12];let p;e[13]===Symbol.for("react.memo_cache_sentinel")?(p=C=>S(C.target.value),e[13]=p):p=e[13];let l;e[14]!==a?(l=s.jsx(I,{title:"Registry URL",action:s.jsx(X,{placeholder:"https://registry.example.com/mcp",value:a,onChange:p,className:"w-[280px]"})}),e[14]=a,e[15]=l):l=e[15];let _;e[16]===Symbol.for("react.memo_cache_sentinel")?(_=C=>v(C.target.value),e[16]=_):_=e[16];let b;e[17]!==x?(b=s.jsx(I,{title:"Auth Token",description:"Optional",action:s.jsx(X,{type:"password",placeholder:"Bearer token...",value:x,onChange:_,className:"w-[280px]"})}),e[17]=x,e[18]=b):b=e[18];let k;e[19]!==d||e[20]!==o?(k=s.jsx(Y,{variant:"ghost",size:"sm",onClick:o,disabled:d,children:"Cancel"}),e[19]=d,e[20]=o,e[21]=k):k=e[21];let N;e[22]!==c?(N=()=>c(),e[22]=c,e[23]=N):N=e[23];const O=!a||d,B=d?"Adding...":"Add Registry";let A;e[24]!==N||e[25]!==O||e[26]!==B?(A=s.jsx(Y,{size:"sm",onClick:N,disabled:O,children:B}),e[24]=N,e[25]=O,e[26]=B,e[27]=A):A=e[27];let R;e[28]!==k||e[29]!==A?(R=s.jsxs("div",{className:"px-5 py-4 flex justify-end gap-2",children:[k,A]}),e[28]=k,e[29]=A,e[30]=R):R=e[30];let P;return e[31]!==R||e[32]!==u||e[33]!==l||e[34]!==b?(P=s.jsxs(Q,{children:[u,l,b,R]}),e[31]=R,e[32]=u,e[33]=l,e[34]=b,e[35]=P):P=e[35],P}function Ne(t){ie.error(`Failed to add registry: ${t.message}`)}function L(t){const e=D.c(29),{name:o,description:m,icon:n,enabled:r,onToggle:j,onDelete:a,href:S}=t,x=de();let v;e[0]===Symbol.for("react.memo_cache_sentinel")?(v={from:"/shell/$org"},e[0]=v):v=e[0];const{org:h}=me(v);let f;e[1]!==r||e[2]!==S||e[3]!==x||e[4]!==j||e[5]!==h?(f=()=>{S?x({to:S,params:{org:h}}):j(!r)},e[1]=r,e[2]=S,e[3]=x,e[4]=j,e[5]=h,e[6]=f):f=e[6];const y=f;let c;e[7]!==n||e[8]!==o?(c=n?s.jsx("img",{src:n,alt:o,className:"size-8 rounded-md object-contain"}):s.jsx(ne,{fallback:o.charAt(0),className:"size-8 bg-primary/10 text-primary"}),e[7]=n,e[8]=o,e[9]=c):c=e[9];let d;e[10]!==a?(d=a&&s.jsxs(je,{children:[s.jsx(Ce,{asChild:!0,children:s.jsx(Y,{variant:"ghost",size:"icon",className:"h-6 w-6 text-muted-foreground hover:text-destructive",onClick:Me,children:s.jsx(he,{size:14})})}),s.jsx(Se,{className:"w-auto p-2",align:"end",children:s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("p",{className:"text-xs font-medium",children:"Remove this registry?"}),s.jsx(Y,{variant:"destructive",size:"xs",onClick:b=>{b.stopPropagation(),a()},children:"Remove"})]})})]}),e[10]=a,e[11]=d):d=e[11];let g;e[12]!==j?(g=b=>j(b),e[12]=j,e[13]=g):g=e[13];let u;e[14]!==r||e[15]!==g?(u=s.jsx(oe,{checked:r,onClick:Ae,onCheckedChange:g}),e[14]=r,e[15]=g,e[16]=u):u=e[16];let p;e[17]!==S?(p=S&&s.jsx(pe,{size:14,className:"text-muted-foreground"}),e[17]=S,e[18]=p):p=e[18];let l;e[19]!==d||e[20]!==u||e[21]!==p?(l=s.jsxs("div",{className:"flex items-center gap-2",children:[d,u,p]}),e[19]=d,e[20]=u,e[21]=p,e[22]=l):l=e[22];let _;return e[23]!==m||e[24]!==y||e[25]!==o||e[26]!==c||e[27]!==l?(_=s.jsx(I,{title:o,description:m,onClick:y,icon:c,action:l}),e[23]=m,e[24]=y,e[25]=o,e[26]=c,e[27]=l,e[28]=_):_=e[28],_}function Ae(t){return t.stopPropagation()}function Me(t){return t.stopPropagation()}function Te(){const t=D.c(59),{org:e}=ae(),o=ve(),m=re(),n=_e(),{mutateAsync:r}=be(),j=ce(),[a,S]=K.useState(!1);let x,v,h,f,y,c;if(t[0]!==m||t[1]!==e.id||t[2]!==j||t[3]!==n||t[4]!==o||t[5]!==a||t[6]!==r){const p=Z.REGISTRY(e.id),l=i=>{if(!n)return i===p;const w=n.registries[i];return w?w.enabled:i===p},_=Z.COMMUNITY_REGISTRY(e.id),b=o.find(i=>i.id===p),k=o.find(i=>i.id===_||i.id==="community-registry"),N=k?.id??_,O=Z.SELF(e.id),B=new Set([p,_,"community-registry",O]),A=o.filter(i=>!B.has(i.id));let R;t[13]!==n||t[14]!==r?(R=async(i,w)=>{te("store_registry_toggled",{connection_id:i,enabled:w});const se=n??{registries:{},blockedMcps:[]};await r({...se,registries:{...se.registries,[i]:{enabled:w}}})},t[13]=n,t[14]=r,t[15]=R):R=t[15];const P=R;let C;t[16]!==m||t[17]!==e.id||t[18]!==j?(C=async i=>{te("store_private_registry_removed",{connection_id:i}),await m.delete.mutateAsync(i),j.invalidateQueries({queryKey:fe.organizationSettings(e.id)})},t[16]=m,t[17]=e.id,t[18]=j,t[19]=C):C=t[19];const W=C;let U;t[20]!==n||t[21]!==r?(U=async i=>{S(!1);const w=n??{registries:{},blockedMcps:[]};await r({...w,registries:{...w.registries,[i]:{enabled:!0}}})},t[20]=n,t[21]=r,t[22]=U):U=t[22];const H=U,J=b?s.jsx(L,{name:"Deco Store",description:"Official deco MCP registry with curated integrations",icon:b.icon,enabled:l(p),onToggle:i=>P(p,i)}):s.jsx(I,{title:"Deco Store",description:"Connection not found — will be created automatically."});t[23]!==J?(y=s.jsx(ee,{title:"Deco Store",children:s.jsx(Q,{children:J})}),t[23]=J,t[24]=y):y=t[24];let M;t[25]!==a?(M=a?void 0:s.jsxs(Y,{variant:"outline",size:"sm",onClick:()=>S(!0),children:[s.jsx(xe,{size:14}),"Add registry"]}),t[25]=a,t[26]=M):M=t[26];let T;t[27]!==H||t[28]!==a?(T=a&&s.jsx(we,{onCancel:()=>S(!1),onSuccess:H}),t[27]=H,t[28]=a,t[29]=T):T=t[29];let z;t[30]!==l?(z=l("self"),t[30]=l,t[31]=z):z=t[31];let E;t[32]!==P?(E=i=>P("self",i),t[32]=P,t[33]=E):E=t[33];let $;t[34]!==z||t[35]!==E?($=s.jsx(L,{name:"Private Registry",description:"Your organization's private MCP registry",enabled:z,onToggle:E,href:"/$org/settings/store/registry"}),t[34]=z,t[35]=E,t[36]=$):$=t[36];let q;t[37]!==W||t[38]!==P||t[39]!==l?(q=i=>s.jsx(L,{name:i.title,description:i.description??"Private MCP registry",icon:i.icon,enabled:l(i.id),onToggle:w=>P(i.id,w),onDelete:()=>W(i.id)},i.id),t[37]=W,t[38]=P,t[39]=l,t[40]=q):q=t[40];const V=A.map(q);let F;t[41]!==$||t[42]!==V?(F=s.jsxs(Q,{children:[$,V]}),t[41]=$,t[42]=V,t[43]=F):F=t[43],t[44]!==F||t[45]!==M||t[46]!==T?(c=s.jsxs(ee,{title:"Private Registries",actions:M,children:[T,F]}),t[44]=F,t[45]=M,t[46]=T,t[47]=c):c=t[47],v=ee,f="Community",x=Q,h=k?s.jsx(L,{name:"MCP Registry",description:"Community MCP registry with thousands of handy MCPs",icon:k.icon,enabled:l(N),onToggle:i=>P(N,i)}):s.jsx(I,{title:"MCP Registry",description:"Community MCP registry — not yet added",icon:s.jsx(ne,{fallback:"M",className:"size-8 bg-primary/10 text-primary"}),action:s.jsx(oe,{checked:!1,disabled:!0,onCheckedChange:ze})}),t[0]=m,t[1]=e.id,t[2]=j,t[3]=n,t[4]=o,t[5]=a,t[6]=r,t[7]=x,t[8]=v,t[9]=h,t[10]=f,t[11]=y,t[12]=c}else x=t[7],v=t[8],h=t[9],f=t[10],y=t[11],c=t[12];let d;t[48]!==x||t[49]!==h?(d=s.jsx(x,{children:h}),t[48]=x,t[49]=h,t[50]=d):d=t[50];let g;t[51]!==v||t[52]!==f||t[53]!==d?(g=s.jsx(v,{title:f,children:d}),t[51]=v,t[52]=f,t[53]=d,t[54]=g):g=t[54];let u;return t[55]!==y||t[56]!==c||t[57]!==g?(u=s.jsxs(s.Fragment,{children:[y,c,g]}),t[55]=y,t[56]=c,t[57]=g,t[58]=u):u=t[58],u}function ze(){}function Ee(){const t=D.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(ye,{className:"h-64 w-full"}),t[0]=e):e=t[0];let o;return t[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(le,{fallback:$e,children:s.jsx(K.Suspense,{fallback:e,children:s.jsx(G,{children:s.jsx(G.Content,{children:s.jsx(G.Body,{children:s.jsxs(Pe,{children:[s.jsx(G.Title,{children:"Store"}),s.jsx(Te,{})]})})})})})}),t[1]=o):o=t[1],o}function $e(t){const{error:e}=t;return s.jsx(ke,{error:e??new Error("Failed to load store settings")})}function gt(){const t=D.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Re,{capability:"registry:manage",area:"the store",children:s.jsx(Ee,{})}),t[0]=e):e=t[0],e}export{gt as default};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/registry-layout-BfglNjIQ.js","assets/index-Dq2GzmIa.js","assets/index-BtiM-Rn6.css","assets/Tool02-C5wUTAFe.js","assets/CheckCircle-wgdag1z7.js","assets/Settings02-BNJ32xSl.js","assets/use-mcp-client-BET4cVQ2.js","assets/auth-DgHUqP65.js","assets/useInfiniteQuery-CErl8eUD.js","assets/use-infinite-scroll-C_M049Oj.js","assets/studio-tools-DT3M_Vdz.js","assets/badge-D2XsHW2Y.js","assets/input-_HbUXqOS.js","assets/dropdown-menu-EMizUbgW.js","assets/ChevronUp-BcAa4Ljr.js","assets/ChevronRight-D7I_d6Rs.js","assets/DotsVertical-BkJg419g.js","assets/table-CjtfrukD.js","assets/toggle-group-a5DM2sSK.js","assets/use-view-mode-B_UKRIZ6.js","assets/use-mobile-BjsEeYVy.js","assets/FilterLines-DTDvdHSv.js","assets/Globe01-e5qIDEbr.js","assets/SearchMd-7xF40qNR.js","assets/dialog-DT5S2RMB.js","assets/X-Dg7rsVai.js","assets/AlertCircle-TjPHcEnP.js","assets/Upload01-Baccrojk.js","assets/alert-dialog-CRKyaNBx.js","assets/card-CPTg8fDY.js","assets/Trash01-D4xE6JK2.js","assets/label-BtGdlmhk.js","assets/select-CrSxwLpY.js","assets/tooltip-BI-udduQ.js","assets/ChevronDown-C3MkOcZJ.js","assets/switch-BlPs3ERk.js","assets/textarea-BHzi6Dhm.js","assets/XCircle-Di7Lb4ZU.js","assets/checkbox-BdHs-X49.js","assets/Eye-CeD9rgkI.js","assets/LinkExternal01-eA6vVQM3.js","assets/use-copy-X1Kg3Hp6.js","assets/Copy01-ybfnME4F.js","assets/Key01-Dz6Z8ZMZ.js","assets/Plus-CaVUuJOD.js","assets/mcp-oauth-D4aGhRIx.js","assets/Play-CQU4qZuG.js"])))=>i.map(i=>d[i]);
2
- import{c as m,b as n,e as c,j as t,i as p,r as l,aX as f}from"./index-Dq2GzmIa.js";import{R as u}from"./require-capability-DXSues5j.js";import"./use-capability-DMFGKIH5.js";import"./access-gate-BPnO_2yT.js";import"./capability-load-error-96MaJwmz.js";const g=l.lazy(()=>f(()=>import("./registry-layout-BfglNjIQ.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46])));function j(){const e=m.c(5),i=n();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org"},e[0]=s):s=e[0];const{org:o}=c(s);let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"h-full flex items-center justify-center",children:t.jsx(p,{size:20,className:"animate-spin text-muted-foreground"})}),e[1]=r):r=e[1];let a;return e[2]!==i||e[3]!==o?(a=t.jsx(u,{capability:"registry:manage",area:"the registry",children:t.jsx(l.Suspense,{fallback:r,children:t.jsx(g,{onBack:()=>i({to:"/$org/settings/store",params:{org:o}})})})}),e[2]=i,e[3]=o,e[4]=a):a=e[4],a}export{j as default};
@@ -1 +0,0 @@
1
- import{c as o,U as a}from"./index-Dq2GzmIa.js";const c={"settings.title":"Profile & Preferences","settings.nav.organization":"Organization","settings.nav.general":"General","settings.nav.brandContext":"Brand Context","settings.nav.aiProviders":"AI Providers","settings.nav.secrets":"Secrets","settings.nav.buckets":"Buckets","settings.nav.build":"Build","settings.nav.connections":"Connections","settings.nav.agents":"Agents","settings.nav.automations":"Automations","settings.nav.store":"Store","settings.nav.manage":"Manage","settings.nav.monitor":"Monitor","settings.nav.members":"Members","settings.nav.roles":"Roles","settings.nav.security":"Security","settings.nav.account":"Account","settings.nav.profile":"Profile & Preferences","settings.nav.signOut":"Sign Out","settings.profile.avatar":"Avatar","settings.profile.displayName":"Display name","settings.profile.displayNamePlaceholder":"Your name","settings.profile.email":"Email","settings.profile.updateSuccess":"Profile updated successfully","settings.profile.updateError":"Failed to update profile","settings.preferences.title":"Preferences","settings.preferences.theme":"Theme","settings.preferences.themeDescription":"Your preferred color scheme.","settings.preferences.themeLight":"Light theme","settings.preferences.themeDark":"Dark theme","settings.preferences.themeSystem":"System theme","settings.preferences.language":"Language","settings.preferences.languageDescription":"The language of the interface.","settings.preferences.notifications":"Notifications","settings.preferences.notificationsDescription":"Receive browser notifications for important events.","settings.preferences.notificationsDenied":"Notifications denied. Please enable them in your browser settings.","settings.preferences.sounds":"Sounds","settings.preferences.soundsDescription":"Play sounds for agent actions and notifications.","settings.preferences.soundsPreview":"Preview notification sound","settings.preferences.toolApproval":"Tool Approval","settings.preferences.toolApprovalDescription":"Control how tools are approved before execution.","settings.preferences.toolApprovalAsk":"Ask before edit","settings.preferences.toolApprovalAskDescription":"Auto-approve read-only tools","settings.preferences.toolApprovalAuto":"Auto approve","settings.preferences.toolApprovalAutoDescription":"Execute all without approval"},g={...c};function p(e,s){return s?e.replace(/\{(\w+)\}/g,(n,t)=>Object.hasOwn(s,t)?String(s[t]):n):e}const l={"settings.title":"Perfil e preferências","settings.nav.organization":"Organização","settings.nav.general":"Geral","settings.nav.brandContext":"Contexto da marca","settings.nav.aiProviders":"Provedores de IA","settings.nav.secrets":"Segredos","settings.nav.buckets":"Buckets","settings.nav.build":"Criação","settings.nav.connections":"Conexões","settings.nav.agents":"Agentes","settings.nav.automations":"Automações","settings.nav.store":"Loja","settings.nav.manage":"Gerenciar","settings.nav.monitor":"Monitoramento","settings.nav.members":"Membros","settings.nav.roles":"Papéis","settings.nav.security":"Segurança","settings.nav.account":"Conta","settings.nav.profile":"Perfil e preferências","settings.nav.signOut":"Sair","settings.profile.avatar":"Avatar","settings.profile.displayName":"Nome de exibição","settings.profile.displayNamePlaceholder":"Seu nome","settings.profile.email":"E-mail","settings.profile.updateSuccess":"Perfil atualizado com sucesso","settings.profile.updateError":"Falha ao atualizar o perfil","settings.preferences.title":"Preferências","settings.preferences.theme":"Tema","settings.preferences.themeDescription":"Seu esquema de cores preferido.","settings.preferences.themeLight":"Tema claro","settings.preferences.themeDark":"Tema escuro","settings.preferences.themeSystem":"Tema do sistema","settings.preferences.language":"Idioma","settings.preferences.languageDescription":"O idioma da interface.","settings.preferences.notifications":"Notificações","settings.preferences.notificationsDescription":"Receba notificações do navegador para eventos importantes.","settings.preferences.notificationsDenied":"Notificações negadas. Habilite-as nas configurações do seu navegador.","settings.preferences.sounds":"Sons","settings.preferences.soundsDescription":"Reproduza sons para ações de agentes e notificações.","settings.preferences.soundsPreview":"Ouvir som de notificação","settings.preferences.toolApproval":"Aprovação de ferramentas","settings.preferences.toolApprovalDescription":"Controle como as ferramentas são aprovadas antes da execução.","settings.preferences.toolApprovalAsk":"Perguntar antes de editar","settings.preferences.toolApprovalAskDescription":"Aprova automaticamente ferramentas somente leitura","settings.preferences.toolApprovalAuto":"Aprovar automaticamente","settings.preferences.toolApprovalAutoDescription":"Executa tudo sem aprovação"},f={...l},u={en:g,"pt-BR":f};function m(){const e=o.c(2),[s]=a(),n=u[s.language];let t;return e[0]!==n?(t=(i,r)=>p(n[i],r),e[0]=n,e[1]=t):t=e[1],t}export{m as u};
@@ -1 +0,0 @@
1
- import{I as u}from"./use-infinite-scroll-C_M049Oj.js";import{dK as i}from"./index-Dq2GzmIa.js";function t(e,r){return i(e,u,r)}export{t as u};
@@ -1 +0,0 @@
1
- import{I as s}from"./use-infinite-scroll-C_M049Oj.js";import{dK as u,ab as n}from"./index-Dq2GzmIa.js";function a(r,e){return u({...r,enabled:!0,suspense:!0,throwOnError:n},s,e)}export{a as u};