decocms 3.99.1 → 3.99.3

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 (213) hide show
  1. package/dist/client/assets/{AlertCircle-VcwplCRi.js → AlertCircle-Bgopcarv.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-CAv7CUnJ.js → ArrowUpRight-7XR-z7Ge.js} +1 -1
  3. package/dist/client/assets/{CheckCircle-V30FMM2D.js → CheckCircle-DsdDhP4L.js} +1 -1
  4. package/dist/client/assets/{ChevronDown-URo4LveF.js → ChevronDown-CpzTl0cf.js} +1 -1
  5. package/dist/client/assets/{ChevronLeft-aMkPes9N.js → ChevronLeft-BuOnLJw9.js} +1 -1
  6. package/dist/client/assets/{ChevronRight-oz8o6WPV.js → ChevronRight-DqDeYsel.js} +1 -1
  7. package/dist/client/assets/{ChevronUp-HJUE3-BD.js → ChevronUp-Cr2g1GDa.js} +1 -1
  8. package/dist/client/assets/{DotsVertical-QF46dzdi.js → DotsVertical-BGprjE03.js} +1 -1
  9. package/dist/client/assets/{Eye-BSiFxHQB.js → Eye-B9uHZVsM.js} +1 -1
  10. package/dist/client/assets/{FilterLines-CEzORaPw.js → FilterLines-DgCFEQWk.js} +1 -1
  11. package/dist/client/assets/{Globe01-wGomueqV.js → Globe01-H40eMg8D.js} +1 -1
  12. package/dist/client/assets/{Globe04-CsKOsQ4z.js → Globe04-BNaAcUBp.js} +1 -1
  13. package/dist/client/assets/{HardDrive-BuI4Q48l.js → HardDrive-l0WQMFU9.js} +1 -1
  14. package/dist/client/assets/{Key01-r6MDYdDw.js → Key01-BDd1iQS4.js} +1 -1
  15. package/dist/client/assets/{LayoutLeft-BFxGsVdk.js → LayoutLeft-DQOl0C9j.js} +1 -1
  16. package/dist/client/assets/{LinkExternal01-BWnRnxGs.js → LinkExternal01-BAME6PCB.js} +1 -1
  17. package/dist/client/assets/{Monitor01-SEZLDRFN.js → Monitor01-CaJkUXyc.js} +1 -1
  18. package/dist/client/assets/{Palette-CEjENuG4.js → Palette-C1u1Sxuh.js} +1 -1
  19. package/dist/client/assets/{Play-BDoh8EAp.js → Play-DSjj50Z1.js} +1 -1
  20. package/dist/client/assets/{Plus-Bw9lc6SR.js → Plus-rHk0VScG.js} +1 -1
  21. package/dist/client/assets/{SearchMd-BMfw7gZ4.js → SearchMd-Bc8RVvtx.js} +1 -1
  22. package/dist/client/assets/{Settings02-DbH9OAzT.js → Settings02-bfgJ4jKJ.js} +1 -1
  23. package/dist/client/assets/{Shield01-C1R4fpvK.js → Shield01-C0erkp7L.js} +1 -1
  24. package/dist/client/assets/{Star01-BwAv907s.js → Star01-DnRxcrb2.js} +1 -1
  25. package/dist/client/assets/{Stars01-D1icdaCh.js → Stars01-DN0i_OuW.js} +1 -1
  26. package/dist/client/assets/{Stars02-PPXsboxW.js → Stars02-DXKYKZ_y.js} +1 -1
  27. package/dist/client/assets/{Sun-Dw86eVev.js → Sun-BvgQbAIe.js} +1 -1
  28. package/dist/client/assets/{SwitchHorizontal01-F_1MjTR3.js → SwitchHorizontal01-CTCDUfta.js} +1 -1
  29. package/dist/client/assets/{Tool01-DvTGD1Yt.js → Tool01-Dvmkyh1g.js} +1 -1
  30. package/dist/client/assets/{Trash01-d58N8w5a.js → Trash01-BrvLbqQk.js} +1 -1
  31. package/dist/client/assets/{Upload01-C_hHbDSF.js → Upload01-Cghimx9V.js} +1 -1
  32. package/dist/client/assets/{User01-BDtU1dk1.js → User01-BPjc8LiD.js} +1 -1
  33. package/dist/client/assets/{Users01-PX3eYoC8.js → Users01-DKr-dGyn.js} +1 -1
  34. package/dist/client/assets/{Users03-CL71IAQ8.js → Users03-CBNK0aq-.js} +1 -1
  35. package/dist/client/assets/{X-D7X7Z50V.js → X-BZf8Ua-f.js} +1 -1
  36. package/dist/client/assets/{XCircle-PlbEvjyp.js → XCircle-CxfDN97v.js} +1 -1
  37. package/dist/client/assets/{XClose-BbuWQhNb.js → XClose-Ca4NBXw9.js} +1 -1
  38. package/dist/client/assets/{Zap-BQKeuD4l.js → Zap-D8ndRUQT.js} +1 -1
  39. package/dist/client/assets/{ZapSquare-CvkoTQDM.js → ZapSquare-BY_c_0SN.js} +1 -1
  40. package/dist/client/assets/{ZoomOut-DxqRFWA_.js → ZoomOut-C9_8nvys.js} +1 -1
  41. package/dist/client/assets/{access-gate-6AWas-Ss.js → access-gate-CCm9ALRG.js} +1 -1
  42. package/dist/client/assets/{add-section-modal-jgpkoBcW.js → add-section-modal-BsBYigCm.js} +1 -1
  43. package/dist/client/assets/{agent-icon-B2N3zGQH.js → agent-icon-BbjKuSxW.js} +1 -1
  44. package/dist/client/assets/{agents-list-Cd9i8250.js → agents-list-g0HlqLD8.js} +1 -1
  45. package/dist/client/assets/{ai-providers-CG207wTX.js → ai-providers-P6gTuznf.js} +1 -1
  46. package/dist/client/assets/{alert-Cg3WXwSx.js → alert-DpnpKBfm.js} +1 -1
  47. package/dist/client/assets/{alert-dialog-DvWgcmQI.js → alert-dialog-CWTgvZp_.js} +1 -1
  48. package/dist/client/assets/{app-editor-tLSi5KV_.js → app-editor-CJVdYBr2.js} +1 -1
  49. package/dist/client/assets/{auth-DZDiXt1m.js → auth-DtR4b91D.js} +1 -1
  50. package/dist/client/assets/{auth-catchall-kuEh1_rd.js → auth-catchall-BfgSkxA3.js} +1 -1
  51. package/dist/client/assets/{auth-entry-CavsOUDq.js → auth-entry-DiMotG9E.js} +1 -1
  52. package/dist/client/assets/{auth-split-layout-dFpcxyJe.js → auth-split-layout-Bithe63j.js} +1 -1
  53. package/dist/client/assets/{authenticate-and-persist-oauth-CGYbK6H8.js → authenticate-and-persist-oauth-BYDKbSTj.js} +1 -1
  54. package/dist/client/assets/{automation-list-row-CAUoBpVq.js → automation-list-row-DmMT-Lmk.js} +1 -1
  55. package/dist/client/assets/{automation-runs-DyKvgj21.js → automation-runs-CglgtIyd.js} +1 -1
  56. package/dist/client/assets/{automations-wXAz-GXj.js → automations-DfhbzTi8.js} +1 -1
  57. package/dist/client/assets/{avatar-Dv3IrttI.js → avatar-DosbYSVo.js} +1 -1
  58. package/dist/client/assets/{badge-toKsUzoB.js → badge-7eW-Y90w.js} +1 -1
  59. package/dist/client/assets/{block-document-DRbnuwCo.js → block-document-CU1UWO2l.js} +1 -1
  60. package/dist/client/assets/{brand-context-BaVxi4M4.js → brand-context-Bc4eOtey.js} +1 -1
  61. package/dist/client/assets/{buckets-BKwGKvkZ.js → buckets-C0c0s9n9.js} +1 -1
  62. package/dist/client/assets/{capability-load-error-BRyHg_Rt.js → capability-load-error-BQe9cGJ_.js} +1 -1
  63. package/dist/client/assets/{card-Chq65iX4.js → card-ChgC15JC.js} +1 -1
  64. package/dist/client/assets/{category-editor-LeiO5-YX.js → category-editor-BWGJADot.js} +1 -1
  65. package/dist/client/assets/{chat-context-Bspy4m-d.js → chat-context-C7e3nmPB.js} +1 -1
  66. package/dist/client/assets/{checkbox-KUrNOBQk.js → checkbox-D1J6-HGS.js} +1 -1
  67. package/dist/client/assets/{cli-auth-success-B36KwAFt.js → cli-auth-success-Biv357Zc.js} +1 -1
  68. package/dist/client/assets/{collection-detail-CbhoYXmP.js → collection-detail-B-FYgzNz.js} +1 -1
  69. package/dist/client/assets/{collection-display-button-DNbt3d2y.js → collection-display-button-zkui4HfF.js} +1 -1
  70. package/dist/client/assets/{collection-search-BPoBI_I5.js → collection-search-SCB2wfQm.js} +1 -1
  71. package/dist/client/assets/{collection-tabs-FH3-RtUV.js → collection-tabs-CasRXW3s.js} +1 -1
  72. package/dist/client/assets/{command-DMsCjDdA.js → command-BP2NK5GV.js} +1 -1
  73. package/dist/client/assets/{commerce-onboarding-Cv30K_3D.js → commerce-onboarding-CCTWN0Dv.js} +1 -1
  74. package/dist/client/assets/{connect-desktop-dialog-G37q3fkg.js → connect-desktop-dialog-CUoIMZ9P.js} +1 -1
  75. package/dist/client/assets/{connection-card-BG_Nwlzj.js → connection-card-Cw-v3-1B.js} +1 -1
  76. package/dist/client/assets/{connection-detail-oU0C71F8.js → connection-detail-D66t6r8n.js} +1 -1
  77. package/dist/client/assets/{connection-form-helpers-DLOiycDJ.js → connection-form-helpers-BE_9JHz-.js} +1 -1
  78. package/dist/client/assets/{connections-BgFAjnb1.js → connections-B7dKDvRD.js} +1 -1
  79. package/dist/client/assets/{context-menu-BRDnNrnF.js → context-menu-Cbyc6J5M.js} +1 -1
  80. package/dist/client/assets/{decopilot-DfFzELja.js → decopilot-D1XiRpB_.js} +1 -1
  81. package/dist/client/assets/{decopilot-sse-pool-TIer_srZ.js → decopilot-sse-pool-DsG4E7i_.js} +1 -1
  82. package/dist/client/assets/{dialog-CxQBoX40.js → dialog-DKiQlf0Y.js} +1 -1
  83. package/dist/client/assets/{domain-settings-gFWo85oP.js → domain-settings-DZg105GS.js} +1 -1
  84. package/dist/client/assets/{drawer-CoRZTii0.js → drawer-UishvVn_.js} +1 -1
  85. package/dist/client/assets/{dropdown-menu-5CWPgj7f.js → dropdown-menu-B_TYOovI.js} +1 -1
  86. package/dist/client/assets/{empty-state-B-ezQrZT.js → empty-state-BVh7wBPS.js} +1 -1
  87. package/dist/client/assets/{extract-connection-data-BaXkJtVr.js → extract-connection-data-C9MdxGy0.js} +1 -1
  88. package/dist/client/assets/{file-explorer-CwlDpz6e.js → file-explorer-Dvmu_Dcb.js} +1 -1
  89. package/dist/client/assets/{file-type-icon-Cd8oKt-R.js → file-type-icon-DouhlgA1.js} +1 -1
  90. package/dist/client/assets/{files-CkNnfKPK.js → files-pYWmrODj.js} +1 -1
  91. package/dist/client/assets/{form-CpFt_4sy.js → form-B4g755Hl.js} +1 -1
  92. package/dist/client/assets/{general-9kWrBaDN.js → general-5Yc9vnsv.js} +1 -1
  93. package/dist/client/assets/{github-repo-picker-CvyWRbaM.js → github-repo-picker-DDcB4OPT.js} +1 -1
  94. package/dist/client/assets/{hooks-BAG9TZjZ.js → hooks-DWc2KmvK.js} +1 -1
  95. package/dist/client/assets/{import-from-deco-dialog-ga5lUGZx.js → import-from-deco-dialog-Bih2Fm5A.js} +1 -1
  96. package/dist/client/assets/{index-BU8Nad-n.js → index-87hVDe9f.js} +1 -1
  97. package/dist/client/assets/{index-DZCgQXLz.js → index-BQjoq239.js} +1 -1
  98. package/dist/client/assets/{index-DPI_0XE-.js → index-BSPCA2yy.js} +1 -1
  99. package/dist/client/assets/{index-JhgoGL0k.js → index-BgnTiSnU.js} +1 -1
  100. package/dist/client/assets/{index-DUdLsOJu.js → index-Blw_ez7B.js} +1 -1
  101. package/dist/client/assets/{index-ALZP0-mx.js → index-C0RjSTYg.js} +1 -1
  102. package/dist/client/assets/{index-BLMNER8l.js → index-CQ5sDlCR.js} +1 -1
  103. package/dist/client/assets/{index-CiVkOVzW.js → index-CkflryUu.js} +6 -6
  104. package/dist/client/assets/{index-DS2I5JM3.js → index-Cl3nu1dQ.js} +1 -1
  105. package/dist/client/assets/{index-C_Ih0jtP.js → index-DJGRW9ro.js} +1 -1
  106. package/dist/client/assets/{index-BeB2S664.js → index-DZqx_Cnp.js} +1 -1
  107. package/dist/client/assets/{index-BwC0cAdP.js → index-GbBrtIUx.js} +1 -1
  108. package/dist/client/assets/{index-BAfXUZ9K.js → index-V36Mlak_.js} +1 -1
  109. package/dist/client/assets/{index-redirect-CP9ATXDl.js → index-redirect-DwYyA5dK.js} +1 -1
  110. package/dist/client/assets/{index-I8Uum3Jx.js → index-tHbNbVHJ.js} +3 -3
  111. package/dist/client/assets/{input-CutcETvq.js → input-C1uF2dQ1.js} +1 -1
  112. package/dist/client/assets/{integration-icon-D3W1euXX.js → integration-icon-DOeD9Yy1.js} +1 -1
  113. package/dist/client/assets/{label-DtGUWURu.js → label-Bg0TZhOq.js} +1 -1
  114. package/dist/client/assets/{login-DUTSfri0.js → login-C4tPjUdy.js} +1 -1
  115. package/dist/client/assets/{mcp-oauth-CSZ5TVrK.js → mcp-oauth-DxJiJ187.js} +1 -1
  116. package/dist/client/assets/{members-Dq59tJj1.js → members-DwE4NR-t.js} +1 -1
  117. package/dist/client/assets/{monaco-editor-x5JEAvo5.js → monaco-editor-C6tm250p.js} +1 -1
  118. package/dist/client/assets/{monitoring-stats-row-BsPY2-bU.js → monitoring-stats-row-BF3MVgko.js} +1 -1
  119. package/dist/client/assets/{oauth-callback-BXF1WEWL.js → oauth-callback-DDvAz-C3.js} +1 -1
  120. package/dist/client/assets/{oauth-callback-ai-provider-MpQ7zAqW.js → oauth-callback-ai-provider-PWS5W0qh.js} +1 -1
  121. package/dist/client/assets/{onboarding-CKZFzjtY.js → onboarding-BfXFCDPk.js} +1 -1
  122. package/dist/client/assets/{org-install-DVysq6Hz.js → org-install-CRksScXH.js} +1 -1
  123. package/dist/client/assets/{org-layout-hE5dYTZz.js → org-layout-D3Fm0DP7.js} +1 -1
  124. package/dist/client/assets/{organization-choice-y8WYOYM0.js → organization-choice-D0-tUZZw.js} +1 -1
  125. package/dist/client/assets/{page-seo-form-gPXTm6pw.js → page-seo-form-BvkRv9HV.js} +1 -1
  126. package/dist/client/assets/page-seo-sheet-DTF7F_WK.js +1 -0
  127. package/dist/client/assets/{popover-C8AJAJSa.js → popover-eHXpDYJ1.js} +1 -1
  128. package/dist/client/assets/{post-editor-DrZmKifS.js → post-editor-DOULNreh.js} +1 -1
  129. package/dist/client/assets/{preview-dialog-D1-LAakL.js → preview-dialog-QbgIb_4T.js} +1 -1
  130. package/dist/client/assets/{primitives-D7qGIw1V.js → primitives-CkRAfBR-.js} +1 -1
  131. package/dist/client/assets/{profile-DwtHhCaD.js → profile-CEx7RbYh.js} +1 -1
  132. package/dist/client/assets/project-app-view-DHWSkD1u.js +1 -0
  133. package/dist/client/assets/record-editor-Dq4SLOu9.js +1 -0
  134. package/dist/client/assets/registry-fpLTXF0f.js +2 -0
  135. package/dist/client/assets/{registry-layout-CZALtE-Q.js → registry-layout-BlqjOMOH.js} +1 -1
  136. package/dist/client/assets/{require-capability-DAovjPYR.js → require-capability-BOr4zKTd.js} +1 -1
  137. package/dist/client/assets/{required-auth-layout-BFGUeccA.js → required-auth-layout-DCkraGAX.js} +1 -1
  138. package/dist/client/assets/{reset-password-CrnrgmIx.js → reset-password-BJpJyj5W.js} +1 -1
  139. package/dist/client/assets/{roles-DRg1cyfq.js → roles-C6kCiv-A.js} +1 -1
  140. package/dist/client/assets/{save-status-BmnvufMt.js → save-status-DVA4IHRx.js} +1 -1
  141. package/dist/client/assets/{scroll-area-DnauLcxE.js → scroll-area-IfNZ394n.js} +1 -1
  142. package/dist/client/assets/{search-input-BVF4N9EW.js → search-input-DWWTgewM.js} +1 -1
  143. package/dist/client/assets/{secrets-DPqx_gXC.js → secrets-BKFEeATT.js} +1 -1
  144. package/dist/client/assets/{sections-editor-BLU0buUC.js → sections-editor-uQUAGEex.js} +1 -1
  145. package/dist/client/assets/{select-CeO9pIG_.js → select-Ufh1328y.js} +1 -1
  146. package/dist/client/assets/{select-model-mprfSN1i.js → select-model-CQ-f9ftL.js} +1 -1
  147. package/dist/client/assets/{seo-editor-Dyh0ncgL.js → seo-editor-BuTMaAaQ.js} +1 -1
  148. package/dist/client/assets/{settings-layout-BcPbOkgS.js → settings-layout-DZdRUGWz.js} +1 -1
  149. package/dist/client/assets/{settings-section-B3kXnqLg.js → settings-section-B4a4SAqB.js} +1 -1
  150. package/dist/client/assets/{sheet-CaSXRGPU.js → sheet-DW12PvFQ.js} +1 -1
  151. package/dist/client/assets/{shell-controls-D2Qn9uVj.js → shell-controls-xlIGzcZ3.js} +1 -1
  152. package/dist/client/assets/{shell-layout-BgovnITR.js → shell-layout-C09jnc4C.js} +1 -1
  153. package/dist/client/assets/{shell-route-loading-w2qYEgt-.js → shell-route-loading-B_CHvxTG.js} +1 -1
  154. package/dist/client/assets/{sidebar-BNKGZwsk.js → sidebar-Cy5GVw74.js} +1 -1
  155. package/dist/client/assets/{skeleton-1BUBAFib.js → skeleton-CpSca80L.js} +1 -1
  156. package/dist/client/assets/{sortable.esm-BQBGtGRV.js → sortable.esm-CoB59DXJ.js} +1 -1
  157. package/dist/client/assets/{sso-B5RA5Egt.js → sso-DMV0Y_YX.js} +1 -1
  158. package/dist/client/assets/{store-Ni3ANns9.js → store-B6JtITOy.js} +1 -1
  159. package/dist/client/assets/store-registry-BoPJCgP8.js +2 -0
  160. package/dist/client/assets/{studio-tools-bjPFQfXc.js → studio-tools-Dd7dXWQL.js} +1 -1
  161. package/dist/client/assets/{switch-B9PlH85E.js → switch-CuKs1fR0.js} +1 -1
  162. package/dist/client/assets/{table-Bh38Wtyx.js → table-BfyoFEgz.js} +1 -1
  163. package/dist/client/assets/{tabs-C0RM8s7M.js → tabs-C3buIvx_.js} +1 -1
  164. package/dist/client/assets/{task-status-sw3Y4pwg.js → task-status-DXhUoFwL.js} +1 -1
  165. package/dist/client/assets/{textarea-CvR7iHW3.js → textarea-BiYr__3G.js} +1 -1
  166. package/dist/client/assets/{toggle-group-qpErv2AC.js → toggle-group-DFSFo_vP.js} +1 -1
  167. package/dist/client/assets/{toolbar-CB27CeHy.js → toolbar-DMYgRw5l.js} +1 -1
  168. package/dist/client/assets/{tooltip-Cs84Kx7a.js → tooltip-DW1HpudV.js} +1 -1
  169. package/dist/client/assets/{types-pQkRXbdZ.js → types-BpY6lzqy.js} +1 -1
  170. package/dist/client/assets/{use-ai-providers-BgadC07_.js → use-ai-providers-DS_7m4pz.js} +1 -1
  171. package/dist/client/assets/{use-automations-P1MHR3DS.js → use-automations-BOSdn9Us.js} +1 -1
  172. package/dist/client/assets/{use-capability-BUm2GwYJ.js → use-capability-CeF0OpPy.js} +1 -1
  173. package/dist/client/assets/{use-clock-tick-DNfOIVGO.js → use-clock-tick-DLGdZmyk.js} +1 -1
  174. package/dist/client/assets/{use-collections-KLUYE1x1.js → use-collections-GNpTGYUv.js} +1 -1
  175. package/dist/client/assets/{use-connection-BcZ8SPdu.js → use-connection-B65sInnd.js} +1 -1
  176. package/dist/client/assets/{use-copy-3_Rhxcs5.js → use-copy-I4sZTiJp.js} +1 -1
  177. package/dist/client/assets/{use-create-virtual-mcp-BUg1GOjA.js → use-create-virtual-mcp-mtRixRQv.js} +1 -1
  178. package/dist/client/assets/{use-debounced-autosave-CSkDAooO.js → use-debounced-autosave-Hw4VW15I.js} +1 -1
  179. package/dist/client/assets/{use-delete-connection-CRtYZbhZ.js → use-delete-connection-DV4DJUaY.js} +1 -1
  180. package/dist/client/assets/{use-file-configs-YBpYKsXP.js → use-file-configs-DObQhPxD.js} +1 -1
  181. package/dist/client/assets/{use-infinite-scroll-BJoUj4tJ.js → use-infinite-scroll-Bk__8TxT.js} +1 -1
  182. package/dist/client/assets/{use-join-requests-7lEKJyAD.js → use-join-requests-D-QyHVW_.js} +1 -1
  183. package/dist/client/assets/{use-mcp-client-Bq9g8m5J.js → use-mcp-client-0BRd9S75.js} +1 -1
  184. package/dist/client/assets/{use-mcp-prompts-B5FIxmOZ.js → use-mcp-prompts-D4ll_rda.js} +1 -1
  185. package/dist/client/assets/{use-mcp-tools-LraQQ1bu.js → use-mcp-tools-UJVs9gTs.js} +1 -1
  186. package/dist/client/assets/{use-members-D283HZiN.js → use-members-BAva2zEC.js} +1 -1
  187. package/dist/client/assets/{use-mobile-C0mpADhR.js → use-mobile-BD2-gXK-.js} +1 -1
  188. package/dist/client/assets/{use-navigate-to-agent-CRQ9sIAj.js → use-navigate-to-agent-CFNRRTVg.js} +1 -1
  189. package/dist/client/assets/{use-org-auth-client-WATciLg3.js → use-org-auth-client-7sV0tnvK.js} +1 -1
  190. package/dist/client/assets/{use-org-sso-HWNvOeDC.js → use-org-sso-CWJ7VJxn.js} +1 -1
  191. package/dist/client/assets/{use-organization-roles-Cyp5dthQ.js → use-organization-roles-GhUkwr8O.js} +1 -1
  192. package/dist/client/assets/{use-organization-settings-oh1iUWuA.js → use-organization-settings-CLeV359D.js} +1 -1
  193. package/dist/client/assets/{use-registry-connections-d6Abj3O4.js → use-registry-connections-D7ZBIfwl.js} +1 -1
  194. package/dist/client/assets/{use-secrets-CkVHtz_G.js → use-secrets-_avq30K6.js} +1 -1
  195. package/dist/client/assets/{use-status-sounds-MBoAiBsc.js → use-status-sounds-DAUtYLJA.js} +1 -1
  196. package/dist/client/assets/{use-view-mode-Dhn_wt1k.js → use-view-mode-DROl2yq4.js} +1 -1
  197. package/dist/client/assets/{use-virtual-mcp-C5aoCVVQ.js → use-virtual-mcp-CI9qouIO.js} +1 -1
  198. package/dist/client/assets/useInfiniteQuery-jWCtindg.js +1 -0
  199. package/dist/client/assets/useSuspenseInfiniteQuery-CwejNwQJ.js +1 -0
  200. package/dist/client/assets/{useSuspenseQueries-C6KWJru5.js → useSuspenseQueries-DuDQjlvx.js} +1 -1
  201. package/dist/client/assets/{variant-calendar-krPIZ_Rp.js → variant-calendar-2pJ_kR62.js} +1 -1
  202. package/dist/client/assets/{view-mode-toggle-DTMt6lCZ.js → view-mode-toggle-Del-VZlp.js} +1 -1
  203. package/dist/client/index.html +1 -1
  204. package/dist/server/cli.js +145 -145
  205. package/dist/server/server.js +139 -139
  206. package/package.json +1 -1
  207. package/dist/client/assets/page-seo-sheet-CpMq28JR.js +0 -1
  208. package/dist/client/assets/project-app-view-H9YA_3uu.js +0 -1
  209. package/dist/client/assets/record-editor-C64a4aNL.js +0 -1
  210. package/dist/client/assets/registry-CxYUBbU6.js +0 -2
  211. package/dist/client/assets/store-registry-kIHn_jDR.js +0 -2
  212. package/dist/client/assets/useInfiniteQuery-RfoATJAI.js +0 -1
  213. package/dist/client/assets/useSuspenseInfiniteQuery-DBiSYggu.js +0 -1
@@ -1 +1 @@
1
- import{c as h,r as y,l as j,j as f}from"./index-I8Uum3Jx.js";import{a0 as A}from"./agent-icon-B2N3zGQH.js";import{s as N}from"./Plus-Bw9lc6SR.js";import{s as _}from"./Trash01-d58N8w5a.js";const S=700;function R(r,e,o){const t=h.c(7),s=S,[n,c]=y.useState(r),[l,u]=y.useState(r),[x,p]=y.useState(!1),i=y.useRef(null);r!==l&&(u(r),x||c(r));let a;t[0]!==s||t[1]!==e?(a=g=>{c(g),p(!0),i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{i.current=null,p(!1),e(g)},s)},t[0]=s,t[1]=e,t[2]=a):a=t[2];const d=a;let m;t[3]===Symbol.for("react.memo_cache_sentinel")?(m=g=>{c(g),i.current&&clearTimeout(i.current),i.current=null,p(!1)},t[3]=m):m=t[3];const v=m;let b;return t[4]!==n||t[5]!==d?(b=[n,d,v],t[4]=n,t[5]=d,t[6]=b):b=t[6],b}function T(r){const e=h.c(14),{value:o,onChange:t,placeholder:s,className:n,onFocus:c,onBlur:l,onKeyDown:u,spellCheck:x,inputRef:p}=r,i=x===void 0?!0:x;let a;e[0]!==t?(a=v=>t(v.target.value),e[0]=t,e[1]=a):a=e[1];let d;e[2]!==n?(d=j("w-full resize-none border-0 bg-transparent p-0 outline-none [field-sizing:content] placeholder:text-muted-foreground/50 focus:ring-0",n),e[2]=n,e[3]=d):d=e[3];let m;return e[4]!==p||e[5]!==l||e[6]!==c||e[7]!==u||e[8]!==s||e[9]!==i||e[10]!==a||e[11]!==d||e[12]!==o?(m=f.jsx("textarea",{ref:p,value:o,onChange:a,onInput:w,onFocus:c,onBlur:l,onKeyDown:u,placeholder:s,spellCheck:i,rows:1,className:d}),e[4]=p,e[5]=l,e[6]=c,e[7]=u,e[8]=s,e[9]=i,e[10]=a,e[11]=d,e[12]=o,e[13]=m):m=e[13],m}function w(r){const e=r.currentTarget;e.style.height="auto",e.style.height=`${e.scrollHeight}px`}function D(r){return typeof r=="string"?r:""}function B(r){const e=h.c(11);let o,t;e[0]!==r?({className:o,...t}=r,e[0]=r,e[1]=o,e[2]=t):(o=e[1],t=e[2]);let s;e[3]!==o?(s=j(o,"pr-9"),e[3]=o,e[4]=s):s=e[4];let n;e[5]!==t||e[6]!==s?(n=f.jsx(T,{...t,className:s}),e[5]=t,e[6]=s,e[7]=n):n=e[7];let c;e[8]===Symbol.for("react.memo_cache_sentinel")?(c=f.jsx(A,{size:18,"aria-hidden":!0,className:"pointer-events-none absolute right-2 top-3 text-muted-foreground/40 transition-opacity group-hover/editable:text-muted-foreground group-focus-within/editable:text-muted-foreground"}),e[8]=c):c=e[8];let l;return e[9]!==n?(l=f.jsxs("div",{className:"group/editable relative -mx-2 rounded-md px-2 transition-colors hover:bg-muted/50 focus-within:bg-muted/50",children:[n,c]}),e[9]=n,e[10]=l):l=e[10],l}function F(r){const e=h.c(5),{label:o,onClick:t,disabled:s}=r;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=f.jsx(N,{size:13}),e[0]=n):n=e[0];let c;return e[1]!==s||e[2]!==o||e[3]!==t?(c=f.jsxs("button",{type:"button",onClick:t,disabled:s,className:"flex items-center gap-1.5 rounded-md border border-dashed px-2.5 py-1.5 text-xs text-muted-foreground transition-colors hover:border-foreground/30 hover:text-foreground disabled:opacity-40 disabled:hover:border-dashed disabled:hover:text-muted-foreground cursor-pointer",children:[n,o]}),e[1]=s,e[2]=o,e[3]=t,e[4]=c):c=e[4],c}function I(r){const e=h.c(4),{label:o,onClick:t}=r;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=f.jsx(_,{size:13}),e[0]=s):s=e[0];let n;return e[1]!==o||e[2]!==t?(n=f.jsx("button",{type:"button","aria-label":o,onClick:t,className:"flex h-6 w-6 shrink-0 items-center justify-center rounded text-muted-foreground/60 opacity-0 transition-opacity hover:text-destructive group-hover/item:opacity-100 cursor-pointer",children:s}),e[1]=o,e[2]=t,e[3]=n):n=e[3],n}function J(r){const e=h.c(2),{children:o}=r;let t;return e[0]!==o?(t=f.jsx("div",{className:"absolute -top-9 left-0 z-10 flex items-center gap-0.5 rounded-md border bg-popover p-0.5 shadow-md",children:o}),e[0]=o,e[1]=t):t=e[1],t}function O(r){const e=h.c(8),{active:o,label:t,onClick:s,children:n}=r,c=o?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground";let l;e[0]!==c?(l=j("flex h-7 min-w-7 items-center justify-center rounded px-1.5 text-sm transition-colors cursor-pointer",c),e[0]=c,e[1]=l):l=e[1];let u;return e[2]!==o||e[3]!==n||e[4]!==t||e[5]!==s||e[6]!==l?(u=f.jsx("button",{type:"button","aria-label":t,"aria-pressed":o,onMouseDown:$,onClick:s,className:l,children:n}),e[2]=o,e[3]=n,e[4]=t,e[5]=s,e[6]=l,e[7]=u):u=e[7],u}function $(r){return r.preventDefault()}function H(r){if(Array.isArray(r))return r;if(typeof r!="string"||r.trim()==="")return[];try{const e=JSON.parse(r);return Array.isArray(e)?e:[]}catch{return[]}}export{F as A,B as E,J as F,T as I,I as R,O as T,H as p,D as s,R as u};
1
+ import{c as h,r as y,l as j,j as f}from"./index-tHbNbVHJ.js";import{a0 as A}from"./agent-icon-BbjKuSxW.js";import{s as N}from"./Plus-rHk0VScG.js";import{s as _}from"./Trash01-BrvLbqQk.js";const S=700;function R(r,e,o){const t=h.c(7),s=S,[n,c]=y.useState(r),[l,u]=y.useState(r),[x,p]=y.useState(!1),i=y.useRef(null);r!==l&&(u(r),x||c(r));let a;t[0]!==s||t[1]!==e?(a=g=>{c(g),p(!0),i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{i.current=null,p(!1),e(g)},s)},t[0]=s,t[1]=e,t[2]=a):a=t[2];const d=a;let m;t[3]===Symbol.for("react.memo_cache_sentinel")?(m=g=>{c(g),i.current&&clearTimeout(i.current),i.current=null,p(!1)},t[3]=m):m=t[3];const v=m;let b;return t[4]!==n||t[5]!==d?(b=[n,d,v],t[4]=n,t[5]=d,t[6]=b):b=t[6],b}function T(r){const e=h.c(14),{value:o,onChange:t,placeholder:s,className:n,onFocus:c,onBlur:l,onKeyDown:u,spellCheck:x,inputRef:p}=r,i=x===void 0?!0:x;let a;e[0]!==t?(a=v=>t(v.target.value),e[0]=t,e[1]=a):a=e[1];let d;e[2]!==n?(d=j("w-full resize-none border-0 bg-transparent p-0 outline-none [field-sizing:content] placeholder:text-muted-foreground/50 focus:ring-0",n),e[2]=n,e[3]=d):d=e[3];let m;return e[4]!==p||e[5]!==l||e[6]!==c||e[7]!==u||e[8]!==s||e[9]!==i||e[10]!==a||e[11]!==d||e[12]!==o?(m=f.jsx("textarea",{ref:p,value:o,onChange:a,onInput:w,onFocus:c,onBlur:l,onKeyDown:u,placeholder:s,spellCheck:i,rows:1,className:d}),e[4]=p,e[5]=l,e[6]=c,e[7]=u,e[8]=s,e[9]=i,e[10]=a,e[11]=d,e[12]=o,e[13]=m):m=e[13],m}function w(r){const e=r.currentTarget;e.style.height="auto",e.style.height=`${e.scrollHeight}px`}function D(r){return typeof r=="string"?r:""}function B(r){const e=h.c(11);let o,t;e[0]!==r?({className:o,...t}=r,e[0]=r,e[1]=o,e[2]=t):(o=e[1],t=e[2]);let s;e[3]!==o?(s=j(o,"pr-9"),e[3]=o,e[4]=s):s=e[4];let n;e[5]!==t||e[6]!==s?(n=f.jsx(T,{...t,className:s}),e[5]=t,e[6]=s,e[7]=n):n=e[7];let c;e[8]===Symbol.for("react.memo_cache_sentinel")?(c=f.jsx(A,{size:18,"aria-hidden":!0,className:"pointer-events-none absolute right-2 top-3 text-muted-foreground/40 transition-opacity group-hover/editable:text-muted-foreground group-focus-within/editable:text-muted-foreground"}),e[8]=c):c=e[8];let l;return e[9]!==n?(l=f.jsxs("div",{className:"group/editable relative -mx-2 rounded-md px-2 transition-colors hover:bg-muted/50 focus-within:bg-muted/50",children:[n,c]}),e[9]=n,e[10]=l):l=e[10],l}function F(r){const e=h.c(5),{label:o,onClick:t,disabled:s}=r;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=f.jsx(N,{size:13}),e[0]=n):n=e[0];let c;return e[1]!==s||e[2]!==o||e[3]!==t?(c=f.jsxs("button",{type:"button",onClick:t,disabled:s,className:"flex items-center gap-1.5 rounded-md border border-dashed px-2.5 py-1.5 text-xs text-muted-foreground transition-colors hover:border-foreground/30 hover:text-foreground disabled:opacity-40 disabled:hover:border-dashed disabled:hover:text-muted-foreground cursor-pointer",children:[n,o]}),e[1]=s,e[2]=o,e[3]=t,e[4]=c):c=e[4],c}function I(r){const e=h.c(4),{label:o,onClick:t}=r;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=f.jsx(_,{size:13}),e[0]=s):s=e[0];let n;return e[1]!==o||e[2]!==t?(n=f.jsx("button",{type:"button","aria-label":o,onClick:t,className:"flex h-6 w-6 shrink-0 items-center justify-center rounded text-muted-foreground/60 opacity-0 transition-opacity hover:text-destructive group-hover/item:opacity-100 cursor-pointer",children:s}),e[1]=o,e[2]=t,e[3]=n):n=e[3],n}function J(r){const e=h.c(2),{children:o}=r;let t;return e[0]!==o?(t=f.jsx("div",{className:"absolute -top-9 left-0 z-10 flex items-center gap-0.5 rounded-md border bg-popover p-0.5 shadow-md",children:o}),e[0]=o,e[1]=t):t=e[1],t}function O(r){const e=h.c(8),{active:o,label:t,onClick:s,children:n}=r,c=o?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground";let l;e[0]!==c?(l=j("flex h-7 min-w-7 items-center justify-center rounded px-1.5 text-sm transition-colors cursor-pointer",c),e[0]=c,e[1]=l):l=e[1];let u;return e[2]!==o||e[3]!==n||e[4]!==t||e[5]!==s||e[6]!==l?(u=f.jsx("button",{type:"button","aria-label":t,"aria-pressed":o,onMouseDown:$,onClick:s,className:l,children:n}),e[2]=o,e[3]=n,e[4]=t,e[5]=s,e[6]=l,e[7]=u):u=e[7],u}function $(r){return r.preventDefault()}function H(r){if(Array.isArray(r))return r;if(typeof r!="string"||r.trim()==="")return[];try{const e=JSON.parse(r);return Array.isArray(e)?e:[]}catch{return[]}}export{F as A,B as E,J as F,T as I,I as R,O as T,H as p,D as s,R as u};
@@ -1 +1 @@
1
- import{c as V,j as t,a as D,p as R,af as q,J as B,w as N,t as T}from"./index-I8Uum3Jx.js";import{P as L}from"./index-BU8Nad-n.js";import{A as U}from"./avatar-Dv3IrttI.js";import{S as I}from"./switch-B9PlH85E.js";import{d as G,b as Y,a as $,S as J}from"./select-CeO9pIG_.js";import{T as K,a as z}from"./toggle-group-qpErv2AC.js";import{I as O}from"./input-CutcETvq.js";import{i as H}from"./Monitor01-SEZLDRFN.js";import{n as M,a as Q}from"./Sun-Dw86eVev.js";import{i as W}from"./Play-BDoh8EAp.js";import{u as X}from"./use-debounced-autosave-CSkDAooO.js";import{p as Z,q as ee}from"./question-004-sINsf4GQ.js";import"./index-BeB2S664.js";import{c as te,b as A,S as E,a as F}from"./settings-section-B3kXnqLg.js";import"./sidebar-BNKGZwsk.js";import"./LayoutLeft-BFxGsVdk.js";import"./use-mobile-C0mpADhR.js";import"./sheet-CaSXRGPU.js";import"./X-D7X7Z50V.js";import"./tooltip-Cs84Kx7a.js";import"./User01-BDtU1dk1.js";import"./ChevronUp-HJUE3-BD.js";import"./ChevronDown-URo4LveF.js";import"./card-Chq65iX4.js";import"./ArrowUpRight-CAv7CUnJ.js";function se(){const e=V.c(19),{data:s,isPending:o}=D.useSession(),v=s?.user,p=v?.image,h=v?.name??"";let S;e[0]!==h?(S={values:{name:h}},e[0]=h,e[1]=S):S=e[1];const n=R(S);let _;e[2]!==n?(_={save:async()=>{const g=n.control._formState.dirtyFields;if(Object.keys(g).length===0)return;const a=n.getValues(),f=n.control._defaultValues;n.reset(a,{keepValues:!0});try{await D.updateUser({name:a.name}),N("profile_updated",{fields:["name"]}),T.success("Profile updated successfully")}catch{n.reset(f,{keepValues:!0}),T.error("Failed to update profile")}}},e[2]=n,e[3]=_):_=e[3];const{schedule:x,flush:m}=X(_);if(o)return null;const j=v?.name??"U";let i;e[4]!==j||e[5]!==p?(i=t.jsx(A,{title:"Avatar",action:t.jsx(U,{url:p,fallback:j,shape:"circle",size:"base"})}),e[4]=j,e[5]=p,e[6]=i):i=e[6];let l;e[7]!==m||e[8]!==x?(l=g=>{const{field:a}=g;return t.jsx(O,{id:"display-name",...a,onChange:f=>{a.onChange(f),x()},onBlur:()=>{a.onBlur(),m()},onKeyDown:f=>{f.key==="Enter"&&m()},placeholder:"Your name",className:"w-[280px]"})},e[7]=m,e[8]=x,e[9]=l):l=e[9];let d;e[10]!==n.control||e[11]!==l?(d=t.jsx(A,{title:"Display name",action:t.jsx(q,{control:n.control,name:"name",render:l})}),e[10]=n.control,e[11]=l,e[12]=d):d=e[12];const b=v?.email;let r;e[13]!==b?(r=t.jsx(A,{title:"Email",action:t.jsx("span",{className:"text-sm text-muted-foreground",children:b})}),e[13]=b,e[14]=r):r=e[14];let u;return e[15]!==i||e[16]!==d||e[17]!==r?(u=t.jsx(E,{children:t.jsxs(F,{children:[i,d,r]})}),e[15]=i,e[16]=d,e[17]=r,e[18]=u):u=e[18],u}function oe(){const e=V.c(48),[s,o]=B();let v;e[0]!==o?(v=async c=>{if(c&&await Notification.requestPermission()!=="granted"){N("preferences_notifications_permission_denied"),T.error("Notifications denied. Please enable them in your browser settings."),o(re);return}N("preferences_notifications_toggled",{enabled:c}),o(y=>({...y,enableNotifications:c}))},e[0]=o,e[1]=v):v=e[1];const p=v;let h;e[2]!==o?(h=c=>{c&&(N("preferences_theme_changed",{to_value:c}),o(y=>({...y,theme:c})))},e[2]=o,e[3]=h):h=e[3];let S;e[4]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(z,{value:"light","aria-label":"Light theme",children:t.jsx(M,{size:14})}),e[4]=S):S=e[4];let n;e[5]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(z,{value:"dark","aria-label":"Dark theme",children:t.jsx(Q,{size:14})}),e[5]=n):n=e[5];let _;e[6]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(z,{value:"system","aria-label":"System theme",children:t.jsx(H,{size:14})}),e[6]=_):_=e[6];let x;e[7]!==s.theme||e[8]!==h?(x=t.jsx(A,{title:"Theme",description:"Your preferred color scheme.",action:t.jsxs(K,{type:"single",size:"sm",variant:"outline",value:s.theme,onValueChange:h,children:[S,n,_]})}),e[7]=s.theme,e[8]=h,e[9]=x):x=e[9];let m;e[10]!==p||e[11]!==s.enableNotifications?(m=typeof Notification<"u"?()=>p(!s.enableNotifications):void 0,e[10]=p,e[11]=s.enableNotifications,e[12]=m):m=e[12];let j;e[13]!==p||e[14]!==s.enableNotifications?(j=t.jsx(I,{disabled:typeof Notification>"u",checked:s.enableNotifications,onCheckedChange:p}),e[13]=p,e[14]=s.enableNotifications,e[15]=j):j=e[15];let i;e[16]!==m||e[17]!==j?(i=t.jsx(A,{title:"Notifications",description:"Receive browser notifications for important events.",onClick:m,action:j}),e[16]=m,e[17]=j,e[18]=i):i=e[18];let l;e[19]!==s.enableSounds||e[20]!==o?(l=()=>{N("preferences_sounds_toggled",{enabled:!s.enableSounds}),o(le)},e[19]=s.enableSounds,e[20]=o,e[21]=l):l=e[21];let d;e[22]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("button",{type:"button","aria-label":"Preview notification sound",onClick:ne,className:"size-6 rounded flex items-center justify-center text-muted-foreground hover:text-foreground hover:bg-accent/50 transition-colors cursor-pointer",children:t.jsx(W,{size:11})}),e[22]=d):d=e[22];let b;e[23]!==o?(b=c=>{N("preferences_sounds_toggled",{enabled:c}),o(y=>({...y,enableSounds:c}))},e[23]=o,e[24]=b):b=e[24];let r;e[25]!==s.enableSounds||e[26]!==b?(r=t.jsxs("div",{className:"flex items-center gap-2",children:[d,t.jsx(I,{checked:s.enableSounds,onCheckedChange:b})]}),e[25]=s.enableSounds,e[26]=b,e[27]=r):r=e[27];let u;e[28]!==r||e[29]!==l?(u=t.jsx(A,{title:"Sounds",description:"Play sounds for agent actions and notifications.",onClick:l,action:r}),e[28]=r,e[29]=l,e[30]=u):u=e[30];let g;e[31]!==o?(g=c=>{N("preferences_tool_approval_changed",{to_value:c}),o(y=>({...y,toolApprovalLevel:c}))},e[31]=o,e[32]=g):g=e[32];let a;e[33]!==s.toolApprovalLevel?(a={readonly:"Ask before edit",auto:"Auto approve"}[s.toolApprovalLevel]??"Ask before edit",e[33]=s.toolApprovalLevel,e[34]=a):a=e[34];let f;e[35]!==a?(f=t.jsx(Y,{className:"w-36 h-7 text-xs",children:t.jsx("span",{children:a})}),e[35]=a,e[36]=f):f=e[36];let C;e[37]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx($,{value:"readonly",textValue:"Ask before edit",children:t.jsxs("div",{className:"flex flex-col gap-0.5",children:[t.jsx("span",{className:"font-medium",children:"Ask before edit"}),t.jsx("span",{className:"text-xs text-muted-foreground",children:"Auto-approve read-only tools"})]})}),e[37]=C):C=e[37];let k;e[38]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsxs(J,{children:[C,t.jsx($,{value:"auto",textValue:"Auto approve",children:t.jsxs("div",{className:"flex flex-col gap-0.5",children:[t.jsx("span",{className:"font-medium",children:"Auto approve"}),t.jsx("span",{className:"text-xs text-muted-foreground",children:"Execute all without approval"})]})})]}),e[38]=k):k=e[38];let P;e[39]!==s.toolApprovalLevel||e[40]!==g||e[41]!==f?(P=t.jsx(A,{title:"Tool Approval",description:"Control how tools are approved before execution.",action:t.jsxs(G,{value:s.toolApprovalLevel,onValueChange:g,children:[f,k]})}),e[39]=s.toolApprovalLevel,e[40]=g,e[41]=f,e[42]=P):P=e[42];let w;return e[43]!==u||e[44]!==P||e[45]!==x||e[46]!==i?(w=t.jsx(E,{title:"Preferences",children:t.jsxs(F,{children:[x,i,u,P]})}),e[43]=u,e[44]=P,e[45]=x,e[46]=i,e[47]=w):w=e[47],w}function ne(){N("preferences_sounds_previewed"),Z(ee.dataUri).catch(ie)}function ie(){}function le(e){return{...e,enableSounds:!e.enableSounds}}function re(e){return{...e,enableNotifications:!1}}function ae(){const e=V.c(1);let s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx(L,{children:t.jsx(L.Content,{children:t.jsx(L.Body,{children:t.jsxs(te,{children:[t.jsx(L.Title,{children:"Profile & Preferences"}),t.jsx(se,{}),t.jsx(oe,{})]})})})}),e[0]=s):s=e[0],s}function De(){const e=V.c(1);let s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx(ae,{}),e[0]=s):s=e[0],s}export{De as default};
1
+ import{c as V,j as t,a as D,p as R,af as q,J as B,w as N,t as T}from"./index-tHbNbVHJ.js";import{P as L}from"./index-87hVDe9f.js";import{A as U}from"./avatar-DosbYSVo.js";import{S as I}from"./switch-CuKs1fR0.js";import{d as G,b as Y,a as $,S as J}from"./select-Ufh1328y.js";import{T as K,a as z}from"./toggle-group-DFSFo_vP.js";import{I as O}from"./input-C1uF2dQ1.js";import{i as H}from"./Monitor01-CaJkUXyc.js";import{n as M,a as Q}from"./Sun-BvgQbAIe.js";import{i as W}from"./Play-DSjj50Z1.js";import{u as X}from"./use-debounced-autosave-Hw4VW15I.js";import{p as Z,q as ee}from"./question-004-sINsf4GQ.js";import"./index-DZqx_Cnp.js";import{c as te,b as A,S as E,a as F}from"./settings-section-B4a4SAqB.js";import"./sidebar-Cy5GVw74.js";import"./LayoutLeft-DQOl0C9j.js";import"./use-mobile-BD2-gXK-.js";import"./sheet-DW12PvFQ.js";import"./X-BZf8Ua-f.js";import"./tooltip-DW1HpudV.js";import"./User01-BPjc8LiD.js";import"./ChevronUp-Cr2g1GDa.js";import"./ChevronDown-CpzTl0cf.js";import"./card-ChgC15JC.js";import"./ArrowUpRight-7XR-z7Ge.js";function se(){const e=V.c(19),{data:s,isPending:o}=D.useSession(),v=s?.user,p=v?.image,h=v?.name??"";let S;e[0]!==h?(S={values:{name:h}},e[0]=h,e[1]=S):S=e[1];const n=R(S);let _;e[2]!==n?(_={save:async()=>{const g=n.control._formState.dirtyFields;if(Object.keys(g).length===0)return;const a=n.getValues(),f=n.control._defaultValues;n.reset(a,{keepValues:!0});try{await D.updateUser({name:a.name}),N("profile_updated",{fields:["name"]}),T.success("Profile updated successfully")}catch{n.reset(f,{keepValues:!0}),T.error("Failed to update profile")}}},e[2]=n,e[3]=_):_=e[3];const{schedule:x,flush:m}=X(_);if(o)return null;const j=v?.name??"U";let i;e[4]!==j||e[5]!==p?(i=t.jsx(A,{title:"Avatar",action:t.jsx(U,{url:p,fallback:j,shape:"circle",size:"base"})}),e[4]=j,e[5]=p,e[6]=i):i=e[6];let l;e[7]!==m||e[8]!==x?(l=g=>{const{field:a}=g;return t.jsx(O,{id:"display-name",...a,onChange:f=>{a.onChange(f),x()},onBlur:()=>{a.onBlur(),m()},onKeyDown:f=>{f.key==="Enter"&&m()},placeholder:"Your name",className:"w-[280px]"})},e[7]=m,e[8]=x,e[9]=l):l=e[9];let d;e[10]!==n.control||e[11]!==l?(d=t.jsx(A,{title:"Display name",action:t.jsx(q,{control:n.control,name:"name",render:l})}),e[10]=n.control,e[11]=l,e[12]=d):d=e[12];const b=v?.email;let r;e[13]!==b?(r=t.jsx(A,{title:"Email",action:t.jsx("span",{className:"text-sm text-muted-foreground",children:b})}),e[13]=b,e[14]=r):r=e[14];let u;return e[15]!==i||e[16]!==d||e[17]!==r?(u=t.jsx(E,{children:t.jsxs(F,{children:[i,d,r]})}),e[15]=i,e[16]=d,e[17]=r,e[18]=u):u=e[18],u}function oe(){const e=V.c(48),[s,o]=B();let v;e[0]!==o?(v=async c=>{if(c&&await Notification.requestPermission()!=="granted"){N("preferences_notifications_permission_denied"),T.error("Notifications denied. Please enable them in your browser settings."),o(re);return}N("preferences_notifications_toggled",{enabled:c}),o(y=>({...y,enableNotifications:c}))},e[0]=o,e[1]=v):v=e[1];const p=v;let h;e[2]!==o?(h=c=>{c&&(N("preferences_theme_changed",{to_value:c}),o(y=>({...y,theme:c})))},e[2]=o,e[3]=h):h=e[3];let S;e[4]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(z,{value:"light","aria-label":"Light theme",children:t.jsx(M,{size:14})}),e[4]=S):S=e[4];let n;e[5]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(z,{value:"dark","aria-label":"Dark theme",children:t.jsx(Q,{size:14})}),e[5]=n):n=e[5];let _;e[6]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(z,{value:"system","aria-label":"System theme",children:t.jsx(H,{size:14})}),e[6]=_):_=e[6];let x;e[7]!==s.theme||e[8]!==h?(x=t.jsx(A,{title:"Theme",description:"Your preferred color scheme.",action:t.jsxs(K,{type:"single",size:"sm",variant:"outline",value:s.theme,onValueChange:h,children:[S,n,_]})}),e[7]=s.theme,e[8]=h,e[9]=x):x=e[9];let m;e[10]!==p||e[11]!==s.enableNotifications?(m=typeof Notification<"u"?()=>p(!s.enableNotifications):void 0,e[10]=p,e[11]=s.enableNotifications,e[12]=m):m=e[12];let j;e[13]!==p||e[14]!==s.enableNotifications?(j=t.jsx(I,{disabled:typeof Notification>"u",checked:s.enableNotifications,onCheckedChange:p}),e[13]=p,e[14]=s.enableNotifications,e[15]=j):j=e[15];let i;e[16]!==m||e[17]!==j?(i=t.jsx(A,{title:"Notifications",description:"Receive browser notifications for important events.",onClick:m,action:j}),e[16]=m,e[17]=j,e[18]=i):i=e[18];let l;e[19]!==s.enableSounds||e[20]!==o?(l=()=>{N("preferences_sounds_toggled",{enabled:!s.enableSounds}),o(le)},e[19]=s.enableSounds,e[20]=o,e[21]=l):l=e[21];let d;e[22]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("button",{type:"button","aria-label":"Preview notification sound",onClick:ne,className:"size-6 rounded flex items-center justify-center text-muted-foreground hover:text-foreground hover:bg-accent/50 transition-colors cursor-pointer",children:t.jsx(W,{size:11})}),e[22]=d):d=e[22];let b;e[23]!==o?(b=c=>{N("preferences_sounds_toggled",{enabled:c}),o(y=>({...y,enableSounds:c}))},e[23]=o,e[24]=b):b=e[24];let r;e[25]!==s.enableSounds||e[26]!==b?(r=t.jsxs("div",{className:"flex items-center gap-2",children:[d,t.jsx(I,{checked:s.enableSounds,onCheckedChange:b})]}),e[25]=s.enableSounds,e[26]=b,e[27]=r):r=e[27];let u;e[28]!==r||e[29]!==l?(u=t.jsx(A,{title:"Sounds",description:"Play sounds for agent actions and notifications.",onClick:l,action:r}),e[28]=r,e[29]=l,e[30]=u):u=e[30];let g;e[31]!==o?(g=c=>{N("preferences_tool_approval_changed",{to_value:c}),o(y=>({...y,toolApprovalLevel:c}))},e[31]=o,e[32]=g):g=e[32];let a;e[33]!==s.toolApprovalLevel?(a={readonly:"Ask before edit",auto:"Auto approve"}[s.toolApprovalLevel]??"Ask before edit",e[33]=s.toolApprovalLevel,e[34]=a):a=e[34];let f;e[35]!==a?(f=t.jsx(Y,{className:"w-36 h-7 text-xs",children:t.jsx("span",{children:a})}),e[35]=a,e[36]=f):f=e[36];let C;e[37]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx($,{value:"readonly",textValue:"Ask before edit",children:t.jsxs("div",{className:"flex flex-col gap-0.5",children:[t.jsx("span",{className:"font-medium",children:"Ask before edit"}),t.jsx("span",{className:"text-xs text-muted-foreground",children:"Auto-approve read-only tools"})]})}),e[37]=C):C=e[37];let k;e[38]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsxs(J,{children:[C,t.jsx($,{value:"auto",textValue:"Auto approve",children:t.jsxs("div",{className:"flex flex-col gap-0.5",children:[t.jsx("span",{className:"font-medium",children:"Auto approve"}),t.jsx("span",{className:"text-xs text-muted-foreground",children:"Execute all without approval"})]})})]}),e[38]=k):k=e[38];let P;e[39]!==s.toolApprovalLevel||e[40]!==g||e[41]!==f?(P=t.jsx(A,{title:"Tool Approval",description:"Control how tools are approved before execution.",action:t.jsxs(G,{value:s.toolApprovalLevel,onValueChange:g,children:[f,k]})}),e[39]=s.toolApprovalLevel,e[40]=g,e[41]=f,e[42]=P):P=e[42];let w;return e[43]!==u||e[44]!==P||e[45]!==x||e[46]!==i?(w=t.jsx(E,{title:"Preferences",children:t.jsxs(F,{children:[x,i,u,P]})}),e[43]=u,e[44]=P,e[45]=x,e[46]=i,e[47]=w):w=e[47],w}function ne(){N("preferences_sounds_previewed"),Z(ee.dataUri).catch(ie)}function ie(){}function le(e){return{...e,enableSounds:!e.enableSounds}}function re(e){return{...e,enableNotifications:!1}}function ae(){const e=V.c(1);let s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx(L,{children:t.jsx(L.Content,{children:t.jsx(L.Body,{children:t.jsxs(te,{children:[t.jsx(L.Title,{children:"Profile & Preferences"}),t.jsx(se,{}),t.jsx(oe,{})]})})})}),e[0]=s):s=e[0],s}function De(){const e=V.c(1);let s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx(ae,{}),e[0]=s):s=e[0],s}export{De as default};
@@ -0,0 +1 @@
1
+ import{c as $,D as H,j as A}from"./index-tHbNbVHJ.js";import{l as L,g as E,s as y}from"./scroll-area-IfNZ394n.js";import{p as O,u as k}from"./use-mcp-client-0BRd9S75.js";import{b as q,c as B}from"./use-mcp-tools-UJVs9gTs.js";import{u as Y}from"./index-CkflryUu.js";import{c as G}from"./content-blocks-o63cs2vh.js";import{g as K,M as V,a as w}from"./types-BpY6lzqy.js";import{u as z,b as F}from"./chat-context-C7e3nmPB.js";import{b as J}from"./shell-layout-C09jnc4C.js";import"./agent-icon-BbjKuSxW.js";import"./AlertCircle-Bgopcarv.js";import"./Tool01-Dvmkyh1g.js";import"./SwitchHorizontal01-CTCDUfta.js";import"./Settings02-bfgJ4jKJ.js";import"./XCircle-CxfDN97v.js";import"./ArrowUpRight-7XR-z7Ge.js";import"./ZapSquare-BY_c_0SN.js";import"./Users03-CBNK0aq-.js";import"./CheckCircle-DsdDhP4L.js";import"./ChevronUp-Cr2g1GDa.js";import"./ChevronDown-CpzTl0cf.js";import"./ChevronLeft-BuOnLJw9.js";import"./ChevronRight-DqDeYsel.js";import"./DotsVertical-BGprjE03.js";import"./Stars02-DXKYKZ_y.js";import"./Eye-B9uHZVsM.js";import"./ZoomOut-C9_8nvys.js";import"./Globe01-H40eMg8D.js";import"./FilterLines-DgCFEQWk.js";import"./Star01-DnRxcrb2.js";import"./Globe04-BNaAcUBp.js";import"./HardDrive-l0WQMFU9.js";import"./Key01-BDd1iQS4.js";import"./LayoutLeft-DQOl0C9j.js";import"./LinkExternal01-BAME6PCB.js";import"./Monitor01-CaJkUXyc.js";import"./Sun-BvgQbAIe.js";import"./Palette-C1u1Sxuh.js";import"./Play-DSjj50Z1.js";import"./Plus-rHk0VScG.js";import"./SearchMd-Bc8RVvtx.js";import"./Shield01-C0erkp7L.js";import"./Stars01-DN0i_OuW.js";import"./Trash01-BrvLbqQk.js";import"./Upload01-Cghimx9V.js";import"./User01-BPjc8LiD.js";import"./Users01-DKr-dGyn.js";import"./XClose-Ca4NBXw9.js";import"./X-BZf8Ua-f.js";import"./Zap-D8ndRUQT.js";import"./use-clock-tick-DLGdZmyk.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-I4sZTiJp.js";import"./tooltip-DW1HpudV.js";import"./file-type-icon-DouhlgA1.js";import"./dialog-DKiQlf0Y.js";import"./use-mobile-BD2-gXK-.js";import"./tab-id-BptcWVWa.js";import"./hooks-DWc2KmvK.js";import"./decopilot-sse-pool-DsG4E7i_.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./studio-tools-Dd7dXWQL.js";import"./sheet-DW12PvFQ.js";import"./integration-icon-DOeD9Yy1.js";import"./use-virtual-mcp-CI9qouIO.js";import"./use-collections-GNpTGYUv.js";import"./use-navigate-to-agent-CFNRRTVg.js";import"./use-connection-B65sInnd.js";import"./use-mcp-prompts-D4ll_rda.js";import"./form-B4g755Hl.js";import"./label-Bg0TZhOq.js";import"./input-C1uF2dQ1.js";import"./select-Ufh1328y.js";import"./auth-DtR4b91D.js";import"./index-DJGRW9ro.js";import"./drawer-UishvVn_.js";import"./collection-search-SCB2wfQm.js";import"./tabs-C3buIvx_.js";import"./toggle-group-DFSFo_vP.js";import"./sortable.esm-CoB59DXJ.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-Cw-v3-1B.js";import"./use-registry-connections-D7ZBIfwl.js";import"./use-organization-settings-CLeV359D.js";import"./useInfiniteQuery-jWCtindg.js";import"./use-infinite-scroll-Bk__8TxT.js";import"./extract-connection-data-C9MdxGy0.js";import"./card-ChgC15JC.js";import"./collection-tabs-CasRXW3s.js";import"./badge-7eW-Y90w.js";import"./textarea-BiYr__3G.js";import"./connection-form-helpers-BE_9JHz-.js";import"./authenticate-and-persist-oauth-BYDKbSTj.js";import"./mcp-oauth-DxJiJ187.js";import"./useSuspenseInfiniteQuery-CwejNwQJ.js";import"./use-ai-providers-DS_7m4pz.js";import"./connect-desktop-dialog-CUoIMZ9P.js";import"./decopilot-D1XiRpB_.js";import"./checkbox-D1J6-HGS.js";import"./skeleton-CpSca80L.js";import"./ai-providers-logos-DD3qZ33J.js";import"./avatar-DosbYSVo.js";import"./settings-section-B4a4SAqB.js";import"./popover-eHXpDYJ1.js";import"./command-BP2NK5GV.js";import"./index-CQ5sDlCR.js";import"./dropdown-menu-B_TYOovI.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-DAUtYLJA.js";import"./empty-state-BVh7wBPS.js";import"./toolbar-DMYgRw5l.js";import"./preview-dialog-QbgIb_4T.js";import"./index-BSPCA2yy.js";import"./use-capability-CeF0OpPy.js";import"./shell-route-loading-B_CHvxTG.js";import"./index-BgnTiSnU.js";import"./alert-dialog-CWTgvZp_.js";import"./switch-CuKs1fR0.js";import"./use-debounced-autosave-Hw4VW15I.js";import"./index-87hVDe9f.js";import"./sidebar-Cy5GVw74.js";import"./search-input-DWWTgewM.js";import"./github-repo-picker-DDcB4OPT.js";import"./use-secrets-_avq30K6.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./view-mode-toggle-Del-VZlp.js";import"./automation-runs-CglgtIyd.js";import"./table-BfyoFEgz.js";import"./use-members-BAva2zEC.js";import"./use-org-auth-client-7sV0tnvK.js";import"./task-status-DXhUoFwL.js";import"./use-automations-BOSdn9Us.js";import"./use-file-configs-DObQhPxD.js";import"./monaco-editor-C6tm250p.js";import"./select-model-CQ-f9ftL.js";import"./automation-list-row-DmMT-Lmk.js";import"./required-auth-layout-DCkraGAX.js";import"./use-org-sso-CWJ7VJxn.js";const Q={};function W(S){const t=$.c(37),{client:r,resourceURI:h,tool:o,connectionId:p,orgId:l,args:M}=S,{sendMessage:I}=z(),{setAppContext:u,clearAppContext:n}=F(),{setChatOpen:f,openTab:g}=J(),e=`${p}:${o.name}`;let a;t[0]!==g?(a=C=>C==="inline"?(g("0"),"inline"):"fullscreen",t[0]=g,t[1]=a):a=t[1];const m=a,s=M??Q;let c;t[2]!==r||t[3]!==o.name||t[4]!==s?(c={client:r,toolName:o.name,toolArguments:s},t[2]=r,t[3]=o.name,t[4]=s,t[5]=c):c=t[5];const{data:i}=B(c);let x;if(t[6]!==o._meta||t[7]!==o.name){const C=E(o._meta);x=y(o.name,C),t[6]=o._meta,t[7]=o.name,t[8]=x}else x=t[8];const U=x;let d;t[9]!==o.inputSchema?(d=o.inputSchema??{type:"object"},t[9]=o.inputSchema,t[10]=d):d=t[10];let N;t[11]!==U||t[12]!==d||t[13]!==o?(N={...o,name:U,inputSchema:d},t[11]=U,t[12]=d,t[13]=o,t[14]=N):N=t[14];const b=N;let _;t[15]!==I||t[16]!==f?(_=C=>{const D=G(C.content);D.content.length>0&&(f(!0),I({tiptapDoc:D}))},t[15]=I,t[16]=f,t[17]=_):_=t[17];const j=_;let P;t[18]!==b?(P={tool:b},t[18]=b,t[19]=P):P=t[19];let T;t[20]!==u||t[21]!==e?(T=C=>u(e,C),t[20]=u,t[21]=e,t[22]=T):T=t[22];let R;t[23]!==n||t[24]!==e?(R=()=>n(e),t[23]=n,t[24]=e,t[25]=R):R=t[25];let v;return t[26]!==r||t[27]!==j||t[28]!==m||t[29]!==l||t[30]!==h||t[31]!==P||t[32]!==T||t[33]!==R||t[34]!==s||t[35]!==i?(v=A.jsx(V,{resourceURI:h,orgId:l,toolInfo:P,toolInput:s,toolResult:i,displayMode:"fullscreen",minHeight:w.fullscreen.minHeight,maxHeight:w.fullscreen.maxHeight,client:r,onMessage:j,onUpdateModelContext:T,onTeardown:R,onRequestDisplayMode:m,className:"h-full"}),t[26]=r,t[27]=j,t[28]=m,t[29]=l,t[30]=h,t[31]=P,t[32]=T,t[33]=R,t[34]=s,t[35]=i,t[36]=v):v=t[36],v}function be(S){const t=$.c(24),{connectionId:r,toolName:h,args:o}=S,{org:p}=H(),l=Y();let M;t[0]!==r||t[1]!==l?(M=O(r)&&l.vmEntry?.sandboxProviderKind==="user-desktop"&&l.previewUrl?`${l.previewUrl.replace(/\/+$/,"")}/api/mcp`:void 0,t[0]=r,t[1]=l,t[2]=M):M=t[2];const I=M;let u;t[3]!==r||t[4]!==I||t[5]!==p.id||t[6]!==p.slug?(u={connectionId:r,orgId:p.id,orgSlug:p.slug,mcpUrl:I},t[3]=r,t[4]=I,t[5]=p.id,t[6]=p.slug,t[7]=u):u=t[7];const n=k(u);let f;t[8]!==n?(f={client:n},t[8]=n,t[9]=f):f=t[9];const{data:g}=q(f);let e,a,m;t[10]!==h||t[11]!==g.tools?(e=L(decodeURIComponent(h)),m=g.tools.find(i=>i.name===e)??g.tools.find(i=>{const x=E(i._meta);if(!x)return!1;if(y(i.name,x)===e)return!0;const d=y(e,x);return d!==e&&i.name===d}),a=m?._meta?K(m._meta):void 0,t[10]=h,t[11]=g.tools,t[12]=e,t[13]=a,t[14]=m):(e=t[12],a=t[13],m=t[14]);const s=a;if(!m||!s){let i;return t[15]!==e?(i=A.jsx("div",{className:"flex items-center justify-center h-full w-full",children:A.jsxs("p",{className:"text-sm text-muted-foreground",children:['Tool "',e,'" not found or has no UI']})}),t[15]=e,t[16]=i):i=t[16],i}let c;return t[17]!==o||t[18]!==n||t[19]!==r||t[20]!==p.id||t[21]!==s||t[22]!==m?(c=A.jsx(W,{client:n,resourceURI:s,tool:m,connectionId:r,orgId:p.id,args:o}),t[17]=o,t[18]=n,t[19]=r,t[20]=p.id,t[21]=s,t[22]=m,t[23]=c):c=t[23],c}export{be as AppViewContent};
@@ -0,0 +1 @@
1
+ import{c as F,j as r}from"./index-tHbNbVHJ.js";import{I as T}from"./input-C1uF2dQ1.js";import{L as C}from"./label-Bg0TZhOq.js";import{T as L}from"./textarea-BiYr__3G.js";import{as as A,at as R,au as D,av as J}from"./index-CkflryUu.js";import{u as K,s as P}from"./primitives-CkRAfBR-.js";import{S as M}from"./save-status-DVA4IHRx.js";import"./index-DJGRW9ro.js";import"./chat-context-C7e3nmPB.js";import"./hooks-DWc2KmvK.js";import"./use-mcp-client-0BRd9S75.js";import"./auth-DtR4b91D.js";import"./decopilot-sse-pool-DsG4E7i_.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-CI9qouIO.js";import"./use-collections-GNpTGYUv.js";import"./use-ai-providers-DS_7m4pz.js";import"./studio-tools-Dd7dXWQL.js";import"./tab-id-BptcWVWa.js";import"./use-organization-settings-CLeV359D.js";import"./scroll-area-IfNZ394n.js";import"./agent-icon-BbjKuSxW.js";import"./AlertCircle-Bgopcarv.js";import"./Tool01-Dvmkyh1g.js";import"./SwitchHorizontal01-CTCDUfta.js";import"./Settings02-bfgJ4jKJ.js";import"./XCircle-CxfDN97v.js";import"./ArrowUpRight-7XR-z7Ge.js";import"./ZapSquare-BY_c_0SN.js";import"./Users03-CBNK0aq-.js";import"./CheckCircle-DsdDhP4L.js";import"./ChevronUp-Cr2g1GDa.js";import"./ChevronDown-CpzTl0cf.js";import"./ChevronLeft-BuOnLJw9.js";import"./ChevronRight-DqDeYsel.js";import"./DotsVertical-BGprjE03.js";import"./Stars02-DXKYKZ_y.js";import"./Eye-B9uHZVsM.js";import"./ZoomOut-C9_8nvys.js";import"./Globe01-H40eMg8D.js";import"./FilterLines-DgCFEQWk.js";import"./Star01-DnRxcrb2.js";import"./Globe04-BNaAcUBp.js";import"./HardDrive-l0WQMFU9.js";import"./Key01-BDd1iQS4.js";import"./LayoutLeft-DQOl0C9j.js";import"./LinkExternal01-BAME6PCB.js";import"./Monitor01-CaJkUXyc.js";import"./Sun-BvgQbAIe.js";import"./Palette-C1u1Sxuh.js";import"./Play-DSjj50Z1.js";import"./Plus-rHk0VScG.js";import"./SearchMd-Bc8RVvtx.js";import"./Shield01-C0erkp7L.js";import"./Stars01-DN0i_OuW.js";import"./Trash01-BrvLbqQk.js";import"./Upload01-Cghimx9V.js";import"./User01-BPjc8LiD.js";import"./Users01-DKr-dGyn.js";import"./XClose-Ca4NBXw9.js";import"./X-BZf8Ua-f.js";import"./Zap-D8ndRUQT.js";import"./use-clock-tick-DLGdZmyk.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-I4sZTiJp.js";import"./tooltip-DW1HpudV.js";import"./file-type-icon-DouhlgA1.js";import"./dialog-DKiQlf0Y.js";import"./use-mobile-BD2-gXK-.js";import"./content-blocks-o63cs2vh.js";import"./types-BpY6lzqy.js";import"./shell-layout-C09jnc4C.js";import"./avatar-DosbYSVo.js";import"./required-auth-layout-DCkraGAX.js";import"./use-org-sso-CWJ7VJxn.js";import"./sheet-DW12PvFQ.js";import"./integration-icon-DOeD9Yy1.js";import"./use-navigate-to-agent-CFNRRTVg.js";import"./use-connection-B65sInnd.js";import"./use-mcp-prompts-D4ll_rda.js";import"./form-B4g755Hl.js";import"./select-Ufh1328y.js";import"./drawer-UishvVn_.js";import"./collection-search-SCB2wfQm.js";import"./tabs-C3buIvx_.js";import"./toggle-group-DFSFo_vP.js";import"./sortable.esm-CoB59DXJ.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-Cw-v3-1B.js";import"./use-registry-connections-D7ZBIfwl.js";import"./useInfiniteQuery-jWCtindg.js";import"./use-infinite-scroll-Bk__8TxT.js";import"./extract-connection-data-C9MdxGy0.js";import"./card-ChgC15JC.js";import"./collection-tabs-CasRXW3s.js";import"./badge-7eW-Y90w.js";import"./connection-form-helpers-BE_9JHz-.js";import"./authenticate-and-persist-oauth-BYDKbSTj.js";import"./mcp-oauth-DxJiJ187.js";import"./useSuspenseInfiniteQuery-CwejNwQJ.js";import"./connect-desktop-dialog-CUoIMZ9P.js";import"./decopilot-D1XiRpB_.js";import"./checkbox-D1J6-HGS.js";import"./skeleton-CpSca80L.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-B4a4SAqB.js";import"./popover-eHXpDYJ1.js";import"./command-BP2NK5GV.js";import"./index-CQ5sDlCR.js";import"./dropdown-menu-B_TYOovI.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-DAUtYLJA.js";import"./empty-state-BVh7wBPS.js";import"./toolbar-DMYgRw5l.js";import"./preview-dialog-QbgIb_4T.js";import"./index-BSPCA2yy.js";import"./use-mcp-tools-UJVs9gTs.js";import"./use-capability-CeF0OpPy.js";import"./shell-route-loading-B_CHvxTG.js";import"./index-BgnTiSnU.js";import"./alert-dialog-CWTgvZp_.js";import"./switch-CuKs1fR0.js";import"./use-debounced-autosave-Hw4VW15I.js";import"./index-87hVDe9f.js";import"./sidebar-Cy5GVw74.js";import"./search-input-DWWTgewM.js";import"./github-repo-picker-DDcB4OPT.js";import"./use-secrets-_avq30K6.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./view-mode-toggle-Del-VZlp.js";import"./automation-runs-CglgtIyd.js";import"./table-BfyoFEgz.js";import"./use-members-BAva2zEC.js";import"./use-org-auth-client-7sV0tnvK.js";import"./task-status-DXhUoFwL.js";import"./use-automations-BOSdn9Us.js";import"./use-file-configs-DObQhPxD.js";import"./monaco-editor-C6tm250p.js";import"./select-model-CQ-f9ftL.js";import"./automation-list-row-DmMT-Lmk.js";const $={authors:[{key:"name",label:"Name",widget:"text"},{key:"email",label:"Email",widget:"text",placeholder:"author@example.com"},{key:"jobTitle",label:"Job title",widget:"text"},{key:"company",label:"Company",widget:"text"},{key:"avatar",label:"Avatar",widget:"image"}]},q={authors:"Author"};function fr(S){const t=F.c(34),{orgSlug:v,virtualMcpId:j,branch:f,kind:p,blockKey:g,block:w}=S;let y;t[0]!==f||t[1]!==v||t[2]!==j?(y={orgSlug:v,virtualMcpId:j,branch:f},t[0]=f,t[1]=v,t[2]=j,t[3]=y):y=t[3];const m=A(y);let d;t[4]!==w||t[5]!==p?(d=R(w,p),t[4]=w,t[5]=p,t[6]=d):d=t[6];const B=d;let h;t[7]!==g||t[8]!==p||t[9]!==m?(h=e=>{m.mutate({blockKey:g,data:D(g,p,e)})},t[7]=g,t[8]=p,t[9]=m,t[10]=h):h=t[10];const[i,E]=K(B,h);let k;t[11]!==i||t[12]!==E?(k=(e,o)=>E({...i,[e]:o}),t[11]=i,t[12]=E,t[13]=k):k=t[13];const a=k,N=q[p];let s;t[14]!==N?(s=r.jsx("span",{className:"text-sm font-medium",children:N}),t[14]=N,t[15]=s):s=t[15];let l;t[16]!==m.isError||t[17]!==m.isPending?(l=r.jsx(M,{isPending:m.isPending,isError:m.isError}),t[16]=m.isError,t[17]=m.isPending,t[18]=l):l=t[18];let n;t[19]!==s||t[20]!==l?(n=r.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[s,l]}),t[19]=s,t[20]=l,t[21]=n):n=t[21];const I=$[p];let c;if(t[22]!==i||t[23]!==a||t[24]!==I){let e;t[26]!==i||t[27]!==a?(e=o=>r.jsx("div",{className:"space-y-2",children:o.widget==="image"?r.jsx(J,{schema:{type:"string",format:"image-uri",title:o.label},value:i[o.key],onChange:u=>a(o.key,u),path:o.key,label:o.label}):r.jsxs(r.Fragment,{children:[r.jsx(C,{htmlFor:o.key,children:o.label}),o.widget==="textarea"?r.jsx(L,{id:o.key,value:P(i[o.key]),onChange:u=>a(o.key,u.target.value),rows:3}):r.jsx(T,{id:o.key,value:P(i[o.key]),placeholder:o.placeholder,onChange:u=>a(o.key,u.target.value),className:"h-10"})]})},o.key),t[26]=i,t[27]=a,t[28]=e):e=t[28],c=I.map(e),t[22]=i,t[23]=a,t[24]=I,t[25]=c}else c=t[25];let x;t[29]!==c?(x=r.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto px-6 py-6",children:r.jsx("div",{className:"mx-auto max-w-xl space-y-6",children:c})}),t[29]=c,t[30]=x):x=t[30];let b;return t[31]!==x||t[32]!==n?(b=r.jsxs("div",{className:"flex h-full flex-col",children:[n,x]}),t[31]=x,t[32]=n,t[33]=b):b=t[33],b}export{fr as RecordEditor};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/registry-layout-BlqjOMOH.js","assets/index-tHbNbVHJ.js","assets/index-NVhaWgyE.css","assets/XCircle-CxfDN97v.js","assets/CheckCircle-DsdDhP4L.js","assets/Settings02-bfgJ4jKJ.js","assets/use-mcp-client-0BRd9S75.js","assets/auth-DtR4b91D.js","assets/useInfiniteQuery-jWCtindg.js","assets/use-infinite-scroll-Bk__8TxT.js","assets/studio-tools-Dd7dXWQL.js","assets/badge-7eW-Y90w.js","assets/input-C1uF2dQ1.js","assets/dropdown-menu-B_TYOovI.js","assets/ChevronUp-Cr2g1GDa.js","assets/ChevronRight-DqDeYsel.js","assets/DotsVertical-BGprjE03.js","assets/table-BfyoFEgz.js","assets/toggle-group-DFSFo_vP.js","assets/use-view-mode-DROl2yq4.js","assets/use-mobile-BD2-gXK-.js","assets/FilterLines-DgCFEQWk.js","assets/Globe01-H40eMg8D.js","assets/SearchMd-Bc8RVvtx.js","assets/dialog-DKiQlf0Y.js","assets/X-BZf8Ua-f.js","assets/AlertCircle-Bgopcarv.js","assets/Upload01-Cghimx9V.js","assets/alert-dialog-CWTgvZp_.js","assets/card-ChgC15JC.js","assets/Trash01-BrvLbqQk.js","assets/label-Bg0TZhOq.js","assets/select-Ufh1328y.js","assets/tooltip-DW1HpudV.js","assets/ChevronDown-CpzTl0cf.js","assets/switch-CuKs1fR0.js","assets/textarea-BiYr__3G.js","assets/checkbox-D1J6-HGS.js","assets/Eye-B9uHZVsM.js","assets/LinkExternal01-BAME6PCB.js","assets/use-copy-I4sZTiJp.js","assets/Key01-BDd1iQS4.js","assets/Plus-rHk0VScG.js","assets/mcp-oauth-DxJiJ187.js","assets/Play-DSjj50Z1.js"])))=>i.map(i=>d[i]);
2
+ import{c as s,j as e,r as i,i as a,am as o}from"./index-tHbNbVHJ.js";import{R as m}from"./require-capability-BOr4zKTd.js";import"./use-capability-CeF0OpPy.js";import"./access-gate-CCm9ALRG.js";import"./capability-load-error-BQe9cGJ_.js";const n=i.lazy(()=>o(()=>import("./registry-layout-BlqjOMOH.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])));function f(){const r=s.c(1);let t;return r[0]===Symbol.for("react.memo_cache_sentinel")?(t=e.jsx(m,{capability:"registry:manage",area:"the registry",children:e.jsx(i.Suspense,{fallback:e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsx(a,{size:20,className:"animate-spin text-muted-foreground"})}),children:e.jsx(n,{})})}),r[0]=t):t=r[0],t}export{f as default};
@@ -1,4 +1,4 @@
1
- import{c as W,D as fe,k as Re,m as Te,d as be,t as Q,r as T,j as t,B as V,i as Fe,l as Z,be as qs,bf as Bs}from"./index-I8Uum3Jx.js";import{c as Jt,b as Qs,d as ds,i as Vs,a as Gs,t as Ks,f as Ys,n as Hs,e as Ws}from"./XCircle-PlbEvjyp.js";import{i as qe}from"./CheckCircle-V30FMM2D.js";import{s as Mt,c as Js,b as Zs,i as Xs,a as er}from"./Settings02-DbH9OAzT.js";import{S as Me,u as Ie,W as tr}from"./use-mcp-client-Bq9g8m5J.js";import{u as us}from"./useInfiniteQuery-RfoATJAI.js";import{u as _e}from"./studio-tools-bjPFQfXc.js";import{B as F}from"./badge-toKsUzoB.js";import{I as ue}from"./input-CutcETvq.js";import{a as dt,c as Ne,D as ut,b as mt,h as Zt,k as Xt,g as sr}from"./dropdown-menu-5CWPgj7f.js";import{c as Et,d as Dt,a as Be,e as ae,b as At,T as oe}from"./table-Bh38Wtyx.js";import{T as rr,a as es}from"./toggle-group-qpErv2AC.js";import{u as nr}from"./use-view-mode-Dhn_wt1k.js";import{a as $t}from"./DotsVertical-QF46dzdi.js";import{i as ir}from"./FilterLines-CEzORaPw.js";import{n as lr,i as ms}from"./Globe01-wGomueqV.js";import{i as ar}from"./SearchMd-BMfw7gZ4.js";import{c as xt,d as pt,e as ht,D as ft,b as gt,a as jt}from"./dialog-CxQBoX40.js";import{i as Ye}from"./AlertCircle-VcwplCRi.js";import{i as ts}from"./Upload01-C_hHbDSF.js";import{c as He,b as We,d as Je,A as Ze,g as Xe,e as et,a as tt,f as st}from"./alert-dialog-DvWgcmQI.js";import{C as ne}from"./card-Chq65iX4.js";import{s as rt}from"./Trash01-d58N8w5a.js";import{L as te}from"./label-DtGUWURu.js";import{d as or,b as cr,c as dr,S as ur,a as St}from"./select-CeO9pIG_.js";import{S as ze}from"./switch-B9PlH85E.js";import{T as vt}from"./textarea-CvR7iHW3.js";import{i as mr}from"./X-D7X7Z50V.js";import{t as xr}from"./ChevronDown-URo4LveF.js";import{n as pr,i as Rt}from"./ChevronUp-HJUE3-BD.js";import{C as ss}from"./checkbox-KUrNOBQk.js";import{s as xs,a as Tt}from"./Eye-BSiFxHQB.js";import{n as hr}from"./LinkExternal01-BWnRnxGs.js";import{u as fr}from"./use-infinite-scroll-BJoUj4tJ.js";import{u as It}from"./use-copy-3_Rhxcs5.js";import{i as gr}from"./Key01-r6MDYdDw.js";import{s as jr}from"./Plus-Bw9lc6SR.js";import{a as vr,b as br,T as yr}from"./tooltip-Cs84Kx7a.js";import{i as Nr,a as wr}from"./mcp-oauth-CSZ5TVrK.js";import{i as _r}from"./Play-BDoh8EAp.js";import"./auth-DZDiXt1m.js";import"./ChevronRight-oz8o6WPV.js";import"./use-mobile-C0mpADhR.js";const Ue="private-registry",Cr=`
1
+ import{c as W,D as fe,k as Re,m as Te,d as be,t as Q,r as T,j as t,B as V,i as Fe,l as Z,be as qs,bf as Bs}from"./index-tHbNbVHJ.js";import{c as Jt,b as Qs,d as ds,i as Vs,a as Gs,t as Ks,f as Ys,n as Hs,e as Ws}from"./XCircle-CxfDN97v.js";import{i as qe}from"./CheckCircle-DsdDhP4L.js";import{s as Mt,c as Js,b as Zs,i as Xs,a as er}from"./Settings02-bfgJ4jKJ.js";import{S as Me,u as Ie,W as tr}from"./use-mcp-client-0BRd9S75.js";import{u as us}from"./useInfiniteQuery-jWCtindg.js";import{u as _e}from"./studio-tools-Dd7dXWQL.js";import{B as F}from"./badge-7eW-Y90w.js";import{I as ue}from"./input-C1uF2dQ1.js";import{a as dt,c as Ne,D as ut,b as mt,h as Zt,k as Xt,g as sr}from"./dropdown-menu-B_TYOovI.js";import{c as Et,d as Dt,a as Be,e as ae,b as At,T as oe}from"./table-BfyoFEgz.js";import{T as rr,a as es}from"./toggle-group-DFSFo_vP.js";import{u as nr}from"./use-view-mode-DROl2yq4.js";import{a as $t}from"./DotsVertical-BGprjE03.js";import{i as ir}from"./FilterLines-DgCFEQWk.js";import{n as lr,i as ms}from"./Globe01-H40eMg8D.js";import{i as ar}from"./SearchMd-Bc8RVvtx.js";import{c as xt,d as pt,e as ht,D as ft,b as gt,a as jt}from"./dialog-DKiQlf0Y.js";import{i as Ye}from"./AlertCircle-Bgopcarv.js";import{i as ts}from"./Upload01-Cghimx9V.js";import{c as He,b as We,d as Je,A as Ze,g as Xe,e as et,a as tt,f as st}from"./alert-dialog-CWTgvZp_.js";import{C as ne}from"./card-ChgC15JC.js";import{s as rt}from"./Trash01-BrvLbqQk.js";import{L as te}from"./label-Bg0TZhOq.js";import{d as or,b as cr,c as dr,S as ur,a as St}from"./select-Ufh1328y.js";import{S as ze}from"./switch-CuKs1fR0.js";import{T as vt}from"./textarea-BiYr__3G.js";import{i as mr}from"./X-BZf8Ua-f.js";import{t as xr}from"./ChevronDown-CpzTl0cf.js";import{n as pr,i as Rt}from"./ChevronUp-Cr2g1GDa.js";import{C as ss}from"./checkbox-D1J6-HGS.js";import{s as xs,a as Tt}from"./Eye-B9uHZVsM.js";import{n as hr}from"./LinkExternal01-BAME6PCB.js";import{u as fr}from"./use-infinite-scroll-Bk__8TxT.js";import{u as It}from"./use-copy-I4sZTiJp.js";import{i as gr}from"./Key01-BDd1iQS4.js";import{s as jr}from"./Plus-rHk0VScG.js";import{a as vr,b as br,T as yr}from"./tooltip-DW1HpudV.js";import{i as Nr,a as wr}from"./mcp-oauth-DxJiJ187.js";import{i as _r}from"./Play-DSjj50Z1.js";import"./auth-DtR4b91D.js";import"./ChevronRight-DqDeYsel.js";import"./use-mobile-BD2-gXK-.js";const Ue="private-registry",Cr=`
2
2
  You are an MCP tool tester running automated integration checks.
3
3
 
4
4
  Goal:
@@ -1 +1 @@
1
- import{c as p,j as m}from"./index-I8Uum3Jx.js";import{u as l}from"./use-capability-BUm2GwYJ.js";import{A as u}from"./access-gate-6AWas-Ss.js";function b(c){const t=p.c(6),{capability:n,area:e,children:i}=c,{granted:a,loading:o,error:s}=l(n);let r;return t[0]!==e||t[1]!==i||t[2]!==s||t[3]!==a||t[4]!==o?(r=m.jsx(u,{granted:a,loading:o,error:s,area:e,children:i}),t[0]=e,t[1]=i,t[2]=s,t[3]=a,t[4]=o,t[5]=r):r=t[5],r}export{b as R};
1
+ import{c as p,j as m}from"./index-tHbNbVHJ.js";import{u as l}from"./use-capability-CeF0OpPy.js";import{A as u}from"./access-gate-CCm9ALRG.js";function b(c){const t=p.c(6),{capability:n,area:e,children:i}=c,{granted:a,loading:o,error:s}=l(n);let r;return t[0]!==e||t[1]!==i||t[2]!==s||t[3]!==a||t[4]!==o?(r=m.jsx(u,{granted:a,loading:o,error:s,area:e,children:i}),t[0]=e,t[1]=i,t[2]=s,t[3]=a,t[4]=o,t[5]=r):r=t[5],r}export{b as R};
@@ -1 +1 @@
1
- import{c as l,j as s,A as a,S as m,f as h,h as u,N as f}from"./index-I8Uum3Jx.js";function x(){const o=l.c(1),e=window.location.pathname+window.location.search;let t;if(o[0]===Symbol.for("react.memo_cache_sentinel")){const n=e==="/login"||e.startsWith("/login?")?{}:{next:e};t=s.jsx(f,{to:"/login",search:n,replace:!0}),o[0]=t}else t=o[0];return t}function g(o){const e=l.c(6),{children:t}=o;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(a,{children:s.jsx(m,{})}),e[0]=i):i=e[0];let n;e[1]!==t?(n=s.jsx(h,{children:t}),e[1]=t,e[2]=n):n=e[2];let r;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(u,{children:s.jsx(x,{})}),e[3]=r):r=e[3];let c;return e[4]!==n?(c=s.jsxs(s.Fragment,{children:[i,n,r]}),e[4]=n,e[5]=c):c=e[5],c}export{g as R};
1
+ import{c as l,j as s,A as a,S as m,f as h,h as u,N as f}from"./index-tHbNbVHJ.js";function x(){const o=l.c(1),e=window.location.pathname+window.location.search;let t;if(o[0]===Symbol.for("react.memo_cache_sentinel")){const n=e==="/login"||e.startsWith("/login?")?{}:{next:e};t=s.jsx(f,{to:"/login",search:n,replace:!0}),o[0]=t}else t=o[0];return t}function g(o){const e=l.c(6),{children:t}=o;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(a,{children:s.jsx(m,{})}),e[0]=i):i=e[0];let n;e[1]!==t?(n=s.jsx(h,{children:t}),e[1]=t,e[2]=n):n=e[2];let r;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(u,{children:s.jsx(x,{})}),e[3]=r):r=e[3];let c;return e[4]!==n?(c=s.jsxs(s.Fragment,{children:[i,n,r]}),e[4]=n,e[5]=c):c=e[5],c}export{g as R};
@@ -1 +1 @@
1
- import{c as q,u as Y,b as A,r as B,d as G,j as s,B as z,a as K}from"./index-I8Uum3Jx.js";import{I as L}from"./input-CutcETvq.js";function H(){const e=q.c(45);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/reset-password"},e[0]=n):n=e[0];const{token:r,error:h}=Y(n),a=A(),[o,D]=B.useState(""),[l,M]=B.useState(""),[t,T]=B.useState(!1),i=h==="INVALID_TOKEN";let j;e[1]===Symbol.for("react.memo_cache_sentinel")?(j={mutationFn:O,onSuccess:()=>{T(!0)}},e[1]=j):j=e[1];const w=G(j),v=o===l,c=o.length>=8&&l.length>=8&&v,d=w.isPending,N=w.error;let y;e[2]!==c||e[3]!==o||e[4]!==w||e[5]!==r?(y=b=>{b.preventDefault(),!(!r||!c)&&w.mutate({newPassword:o,token:r})},e[2]=c,e[3]=o,e[4]=w,e[5]=r,e[6]=y):y=e[6];const F=y;let k;e[7]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"radial-gradient(circle, var(--primary-foreground) 1px, transparent 1px)",backgroundSize:"16px 16px",opacity:.15}}),e[7]=k):k=e[7];let S,_,P,C;e[8]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),_=s.jsx("div",{className:"absolute bottom-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),P=s.jsx("div",{className:"absolute left-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),C=s.jsx("div",{className:"absolute right-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),e[8]=S,e[9]=_,e[10]=P,e[11]=C):(S=e[8],_=e[9],P=e[10],C=e[11]);let E;e[12]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsx("div",{className:"flex justify-center",children:s.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12"})}),e[12]=E):E=e[12];const I=t?"Password reset successful":"Set a new password";let m;e[13]!==I?(m=s.jsx("div",{className:"text-center space-y-1",children:s.jsx("p",{className:"text-sm text-foreground/70",children:I})}),e[13]=I,e[14]=m):m=e[14];let u;e[15]!==i||e[16]!==a||e[17]!==t||e[18]!==r?(u=(i||!r&&!t)&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:"This reset link is invalid or has expired."}),s.jsx(z,{onClick:()=>a({to:"/login"}),className:"w-full font-semibold",size:"lg",children:"Back to login"})]}),e[15]=i,e[16]=a,e[17]=t,e[18]=r,e[19]=u):u=e[19];let x;e[20]!==N?(x=N&&s.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:N.message||"Failed to reset password. Please try again."}),e[20]=N,e[21]=x):x=e[21];let g;e[22]!==a||e[23]!==t?(g=t&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"rounded-xl bg-emerald-500/10 p-3 text-sm text-emerald-600 dark:text-emerald-400 text-center",children:"Your password has been reset. You can now sign in with your new password."}),s.jsx(z,{onClick:()=>a({to:"/login"}),className:"w-full font-semibold",size:"lg",children:"Go to login"})]}),e[22]=a,e[23]=t,e[24]=g):g=e[24];let f;e[25]!==c||e[26]!==l||e[27]!==F||e[28]!==i||e[29]!==d||e[30]!==o||e[31]!==v||e[32]!==t||e[33]!==r?(f=r&&!i&&!t&&s.jsxs("form",{onSubmit:F,className:"grid gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"New password"}),s.jsx(L,{type:"password",placeholder:"••••••••",value:o,onChange:b=>D(b.target.value),required:!0,minLength:8,disabled:d})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Confirm password"}),s.jsx(L,{type:"password",placeholder:"••••••••",value:l,onChange:b=>M(b.target.value),required:!0,minLength:8,disabled:d}),l&&!v&&s.jsx("p",{className:"text-xs text-destructive mt-1.5",children:"Passwords do not match"})]}),s.jsx(z,{type:"submit",disabled:d||!c,className:"w-full font-semibold",size:"lg",children:d?"Resetting...":"Reset password"})]}),e[25]=c,e[26]=l,e[27]=F,e[28]=i,e[29]=d,e[30]=o,e[31]=v,e[32]=t,e[33]=r,e[34]=f):f=e[34];let p;e[35]!==a||e[36]!==t?(p=!t&&s.jsx("div",{className:"text-center",children:s.jsx(z,{type:"button",variant:"link",onClick:()=>a({to:"/login"}),className:"text-sm text-muted-foreground hover:text-foreground",children:"Back to sign in"})}),e[35]=a,e[36]=t,e[37]=p):p=e[37];let R;return e[38]!==m||e[39]!==u||e[40]!==x||e[41]!==g||e[42]!==f||e[43]!==p?(R=s.jsxs("main",{className:"relative flex min-h-screen items-center justify-center bg-gradient-to-br from-primary to-primary/75 p-4",children:[k,s.jsxs("div",{className:"relative z-10",children:[S,_,P,C,s.jsxs("div",{className:"mx-auto w-full min-w-[400px] max-w-md grid gap-6 bg-card p-10 border border-primary-foreground/20",children:[E,m,u,x,g,f,p]})]})]}),e[38]=m,e[39]=u,e[40]=x,e[41]=g,e[42]=f,e[43]=p,e[44]=R):R=e[44],R}async function O(e){const{newPassword:n,token:r}=e,h=await K.resetPassword({newPassword:n,token:r});if(h.error)throw new Error(h.error.message||"Failed to reset password");return h}export{H as default};
1
+ import{c as q,u as Y,b as A,r as B,d as G,j as s,B as z,a as K}from"./index-tHbNbVHJ.js";import{I as L}from"./input-C1uF2dQ1.js";function H(){const e=q.c(45);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/reset-password"},e[0]=n):n=e[0];const{token:r,error:h}=Y(n),a=A(),[o,D]=B.useState(""),[l,M]=B.useState(""),[t,T]=B.useState(!1),i=h==="INVALID_TOKEN";let j;e[1]===Symbol.for("react.memo_cache_sentinel")?(j={mutationFn:O,onSuccess:()=>{T(!0)}},e[1]=j):j=e[1];const w=G(j),v=o===l,c=o.length>=8&&l.length>=8&&v,d=w.isPending,N=w.error;let y;e[2]!==c||e[3]!==o||e[4]!==w||e[5]!==r?(y=b=>{b.preventDefault(),!(!r||!c)&&w.mutate({newPassword:o,token:r})},e[2]=c,e[3]=o,e[4]=w,e[5]=r,e[6]=y):y=e[6];const F=y;let k;e[7]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"radial-gradient(circle, var(--primary-foreground) 1px, transparent 1px)",backgroundSize:"16px 16px",opacity:.15}}),e[7]=k):k=e[7];let S,_,P,C;e[8]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),_=s.jsx("div",{className:"absolute bottom-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),P=s.jsx("div",{className:"absolute left-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),C=s.jsx("div",{className:"absolute right-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),e[8]=S,e[9]=_,e[10]=P,e[11]=C):(S=e[8],_=e[9],P=e[10],C=e[11]);let E;e[12]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsx("div",{className:"flex justify-center",children:s.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12"})}),e[12]=E):E=e[12];const I=t?"Password reset successful":"Set a new password";let m;e[13]!==I?(m=s.jsx("div",{className:"text-center space-y-1",children:s.jsx("p",{className:"text-sm text-foreground/70",children:I})}),e[13]=I,e[14]=m):m=e[14];let u;e[15]!==i||e[16]!==a||e[17]!==t||e[18]!==r?(u=(i||!r&&!t)&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:"This reset link is invalid or has expired."}),s.jsx(z,{onClick:()=>a({to:"/login"}),className:"w-full font-semibold",size:"lg",children:"Back to login"})]}),e[15]=i,e[16]=a,e[17]=t,e[18]=r,e[19]=u):u=e[19];let x;e[20]!==N?(x=N&&s.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:N.message||"Failed to reset password. Please try again."}),e[20]=N,e[21]=x):x=e[21];let g;e[22]!==a||e[23]!==t?(g=t&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"rounded-xl bg-emerald-500/10 p-3 text-sm text-emerald-600 dark:text-emerald-400 text-center",children:"Your password has been reset. You can now sign in with your new password."}),s.jsx(z,{onClick:()=>a({to:"/login"}),className:"w-full font-semibold",size:"lg",children:"Go to login"})]}),e[22]=a,e[23]=t,e[24]=g):g=e[24];let f;e[25]!==c||e[26]!==l||e[27]!==F||e[28]!==i||e[29]!==d||e[30]!==o||e[31]!==v||e[32]!==t||e[33]!==r?(f=r&&!i&&!t&&s.jsxs("form",{onSubmit:F,className:"grid gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"New password"}),s.jsx(L,{type:"password",placeholder:"••••••••",value:o,onChange:b=>D(b.target.value),required:!0,minLength:8,disabled:d})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Confirm password"}),s.jsx(L,{type:"password",placeholder:"••••••••",value:l,onChange:b=>M(b.target.value),required:!0,minLength:8,disabled:d}),l&&!v&&s.jsx("p",{className:"text-xs text-destructive mt-1.5",children:"Passwords do not match"})]}),s.jsx(z,{type:"submit",disabled:d||!c,className:"w-full font-semibold",size:"lg",children:d?"Resetting...":"Reset password"})]}),e[25]=c,e[26]=l,e[27]=F,e[28]=i,e[29]=d,e[30]=o,e[31]=v,e[32]=t,e[33]=r,e[34]=f):f=e[34];let p;e[35]!==a||e[36]!==t?(p=!t&&s.jsx("div",{className:"text-center",children:s.jsx(z,{type:"button",variant:"link",onClick:()=>a({to:"/login"}),className:"text-sm text-muted-foreground hover:text-foreground",children:"Back to sign in"})}),e[35]=a,e[36]=t,e[37]=p):p=e[37];let R;return e[38]!==m||e[39]!==u||e[40]!==x||e[41]!==g||e[42]!==f||e[43]!==p?(R=s.jsxs("main",{className:"relative flex min-h-screen items-center justify-center bg-gradient-to-br from-primary to-primary/75 p-4",children:[k,s.jsxs("div",{className:"relative z-10",children:[S,_,P,C,s.jsxs("div",{className:"mx-auto w-full min-w-[400px] max-w-md grid gap-6 bg-card p-10 border border-primary-foreground/20",children:[E,m,u,x,g,f,p]})]})]}),e[38]=m,e[39]=u,e[40]=x,e[41]=g,e[42]=f,e[43]=p,e[44]=R):R=e[44],R}async function O(e){const{newPassword:n,token:r}=e,h=await K.resetPassword({newPassword:n,token:r});if(h.error)throw new Error(h.error.message||"Failed to reset password");return h}export{H as default};
@@ -1 +1 @@
1
- import{r as $,D as Ne,K as re,b8 as dt,k as Re,j as s,l as K,i as fe,B as ne,c as q,o as Pe,aD as Ie,s as se,aF as De,aG as ke,m as $e,p as mt,n as ut,d as Fe,t as he,w as Oe,ag as Ke,a8 as ft,E as ht,b as gt,u as xt}from"./index-I8Uum3Jx.js";import{u as pt,C as bt}from"./use-organization-roles-Cyp5dthQ.js";import{u as je}from"./use-org-auth-client-WATciLg3.js";import{B as ge}from"./badge-toKsUzoB.js";import{f as Qe,a as qe,b as He,c as Ze,d as Xe,A as Je,e as We,g as et}from"./alert-dialog-DvWgcmQI.js";import{D as Tt,a as Et,b as _t,c as It}from"./dropdown-menu-5CWPgj7f.js";import{a as Nt}from"./DotsVertical-QF46dzdi.js";import{s as Ae}from"./Plus-Bw9lc6SR.js";import{s as St}from"./Trash01-d58N8w5a.js";import{P as te}from"./index-BU8Nad-n.js";import{E as Ge}from"./empty-state-B-ezQrZT.js";import{S as ve}from"./search-input-BVF4N9EW.js";import{P as tt,D as st}from"./ai-providers-logos-DD3qZ33J.js";import{I as ye}from"./integration-icon-D3W1euXX.js";import{u as Ct}from"./use-infinite-scroll-BJoUj4tJ.js";import{C as we}from"./checkbox-KUrNOBQk.js";import{b as At}from"./Settings02-DbH9OAzT.js";import{u as Rt}from"./useSuspenseInfiniteQuery-DBiSYggu.js";import{u as Ot,S as jt}from"./use-mcp-client-Bq9g8m5J.js";import{C as vt}from"./collection-search-BPoBI_I5.js";import{u as nt}from"./use-members-D283HZiN.js";import{u as yt}from"./use-connection-BcZ8SPdu.js";import{u as wt,d as Mt}from"./use-ai-providers-BgadC07_.js";import{A as lt}from"./avatar-Dv3IrttI.js";import{S as xe}from"./switch-B9PlH85E.js";import{c as pe,T as be,a as Te,b as Ee}from"./tooltip-Cs84Kx7a.js";import{S as Ue,a as Be,b as Ve}from"./settings-section-B3kXnqLg.js";import{t as Lt}from"./ChevronDown-URo4LveF.js";import{i as Pt}from"./ChevronRight-oz8o6WPV.js";import{i as ze}from"./X-D7X7Z50V.js";import{a as Dt}from"./use-capability-BUm2GwYJ.js";import{A as kt}from"./access-gate-6AWas-Ss.js";import"./table-Bh38Wtyx.js";import"./SwitchHorizontal01-F_1MjTR3.js";import"./ChevronUp-HJUE3-BD.js";import"./sidebar-BNKGZwsk.js";import"./LayoutLeft-BFxGsVdk.js";import"./use-mobile-C0mpADhR.js";import"./sheet-CaSXRGPU.js";import"./SearchMd-BMfw7gZ4.js";import"./XCircle-PlbEvjyp.js";import"./agent-icon-B2N3zGQH.js";import"./AlertCircle-VcwplCRi.js";import"./Tool01-DvTGD1Yt.js";import"./ArrowUpRight-CAv7CUnJ.js";import"./ZapSquare-CvkoTQDM.js";import"./Users03-CL71IAQ8.js";import"./CheckCircle-V30FMM2D.js";import"./ChevronLeft-aMkPes9N.js";import"./Stars02-PPXsboxW.js";import"./Eye-BSiFxHQB.js";import"./ZoomOut-DxqRFWA_.js";import"./Globe01-wGomueqV.js";import"./FilterLines-CEzORaPw.js";import"./Star01-BwAv907s.js";import"./Globe04-CsKOsQ4z.js";import"./HardDrive-BuI4Q48l.js";import"./Key01-r6MDYdDw.js";import"./LinkExternal01-BWnRnxGs.js";import"./Monitor01-SEZLDRFN.js";import"./Sun-Dw86eVev.js";import"./Palette-CEjENuG4.js";import"./Play-BDoh8EAp.js";import"./Shield01-C1R4fpvK.js";import"./Stars01-D1icdaCh.js";import"./Upload01-C_hHbDSF.js";import"./User01-BDtU1dk1.js";import"./Users01-PX3eYoC8.js";import"./XClose-BbuWQhNb.js";import"./Zap-BQKeuD4l.js";import"./auth-DZDiXt1m.js";import"./use-collections-KLUYE1x1.js";import"./studio-tools-bjPFQfXc.js";import"./card-Chq65iX4.js";import"./capability-load-error-BRyHg_Rt.js";const Me="basic-usage",Le=[{id:Me,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"]},{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"],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}];[...Le.find(t=>t.id===Me)?.tools??[]];const Gt=["agents:manage","connections:manage"];new Set(Le.filter(t=>Gt.includes(t.id)).flatMap(t=>t.tools));function Ut(){const t=new Map;for(const e of Le){if(e.id===Me)continue;const n=t.get(e.section)??[];n.push(e),t.set(e.section,n)}return Array.from(t.entries()).map(([e,n])=>({section:e,capabilities:n}))}function Bt(t,e,n){return n?!0:t.tools.every(l=>e.includes(l))}function Vt(t,e,n){if(n){const i=new Set(e);for(const r of t.tools)i.add(r);return Array.from(i)}const l=new Set(e);for(const i of t.tools)l.delete(i);return Array.from(l)}function zt(t){const e=q.c(21),{connection:n,isSelected:l,hasToolsEnabled:i,activeToolsCount:r,totalToolsCount:d,onSelect:h,onToggle:c}=t,g=l?"bg-accent/50":"hover:bg-muted/50";let f;e[0]!==g?(f=K("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",g),e[0]=g,e[1]=f):f=e[1];let a;e[2]!==n.icon||e[3]!==n.title?(a=s.jsx(ye,{icon:n.icon,name:n.title,size:"xs"}),e[2]=n.icon,e[3]=n.title,e[4]=a):a=e[4];let x;e[5]!==n.title?(x=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:n.title})}),e[5]=n.title,e[6]=x):x=e[6];let o;e[7]!==h||e[8]!==a||e[9]!==x?(o=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:h,children:[a,x]}),e[7]=h,e[8]=a,e[9]=x,e[10]=o):o=e[10];let m;e[11]!==r||e[12]!==n.tools||e[13]!==i||e[14]!==c||e[15]!==d?(m=n.tools&&n.tools.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[r,"/",d]}),s.jsx(we,{checked:i,onCheckedChange:c,onClick:Yt})]}),e[11]=r,e[12]=n.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 $t(t){const e=q.c(18),{connectionId:n,tool:l,isSelected:i,onToggle:r}=t,d=`tool-${n}-${l.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 g;e[2]!==c||e[3]!==l.name?(g=s.jsx("div",{className:"flex items-center gap-2 mb-1",children:s.jsx("span",{className:c,children:l.name})}),e[2]=c,e[3]=l.name,e[4]=g):g=e[4];let f;e[5]!==l.description?(f=l.description&&s.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:l.description}),e[5]=l.description,e[6]=f):f=e[6];let a;e[7]!==g||e[8]!==f?(a=s.jsxs("div",{className:"flex-1 min-w-0",children:[g,f]}),e[7]=g,e[8]=f,e[9]=a):a=e[9];const x=`tool-${n}-${l.name}`;let o;e[10]!==i||e[11]!==r||e[12]!==x?(o=s.jsx("div",{className:"flex items-center shrink-0",children:s.jsx(we,{id:x,checked:i,onCheckedChange:r,onClick:Ft})}),e[10]=i,e[11]=r,e[12]=x,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 Ft(t){return t.stopPropagation()}function Kt({toolSet:t,onToolSetChange:e,excludeVirtualMcpId:n,searchQuery:l}){const[i,r]=$.useState(""),d=l!==void 0?l:i,h=$.useDeferredValue(d),[c,g]=$.useState("all"),[f,a]=$.useState(!1),x=$.useRef(new Set(Object.keys(t))),{org:o}=Ne(),m=Ot({connectionId:jt,orgId:o.id,orgSlug:o.slug}),N=100,E=h.trim(),T=E?{operator:"or",conditions:[{field:["title"],operator:"contains",value:E},{field:["description"],operator:"contains",value:E}]}:void 0,S=!!n,C={...T&&{where:T},orderBy:[{field:["updated_at"],direction:"asc"}],limit:N,offset:0,...S&&{include_virtual:!0}},v=JSON.stringify(C),{data:_,fetchNextPage:R,hasNextPage:p,isFetchingNextPage:O}=Rt({queryKey:re.collectionListInfinite(m,o.id,"","CONNECTIONS",v),queryFn:async({pageParam:b=0})=>(await m.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...T&&{where:T},orderBy:[{field:["updated_at"],direction:"asc"}],limit:N,offset:b,...S&&{include_virtual:!0}}})).structuredContent,initialPageParam:0,getNextPageParam:(b,D)=>{if(b?.hasMore)return D.reduce((Q,H)=>Q+(H?.items?.length??0),0)},staleTime:3e4}),I=_?.pages.flatMap(b=>b?.items??[])??[],j=Ct(R,p??!1,O),u=n?I.filter(b=>b.connection_type!=="VIRTUAL"?!0:dt(b.connection_url)!==n):I,w=x.current,A=[...w.values()].map(b=>u.find(D=>D.id===b)).filter(b=>b!==void 0),k=u.filter(b=>!w.has(b.id)),G=[...A,...k],U=b=>{const D=t[b];return D!==void 0&&D.length>0},B=G.filter(b=>{if(c==="all")return!0;const D=U(b.id);return c==="selected"?D:c==="unselected"?!D:!0}),[M,z]=$.useState(G[0]?.id??null),y=M?G.find(b=>b.id===M)??null:null,{data:L,isFetching:Y}=Re({queryKey:re.collectionItem(m,o.id,"","CONNECTIONS",M??""),queryFn:async()=>M?(await m.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:M}})).structuredContent?.item??null:null,enabled:!!M,staleTime:3e4}),F=L?.tools??[],X=(b,D)=>t[b]?.includes(D)??!1,J=(b,D)=>{const Q=t[b]??[],H=Q.includes(D),W={...t};if(H){const Z=Q.filter(ee=>ee!==D);Z.length===0?delete W[b]:W[b]=Z}else W[b]=[...Q,D];e(W)},le=b=>{const D=b===M?F:[];if(!D.length)return;const Q=t[b]??[],H=D.map(ee=>ee.name),W=Q.length>0&&H.every(ee=>Q.includes(ee)),Z={...t};W?delete Z[b]:(Z[b]=H,z(b)),e(Z)},oe=b=>{z(b),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:[l===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:()=>g("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:()=>g("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:()=>g("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(b=>{const D=M===b.id,Q=D?F.length:0,H=t[b.id]?.length??0;return s.jsx(zt,{connection:{...b,tools:D?F:b.tools},isSelected:D,hasToolsEnabled:U(b.id),activeToolsCount:H,totalToolsCount:Q,onSelect:()=>oe(b.id),onToggle:()=>le(b.id)},b.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(ne,{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(ye,{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"})}):F.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:F.map(b=>s.jsx($t,{connectionId:y.id,tool:b,isSelected:X(y.id,b.name),onToggle:()=>J(y.id,b.name)},b.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 Se=["bg-red-500","bg-orange-500","bg-amber-500","bg-yellow-500","bg-lime-500","bg-green-500","bg-emerald-500","bg-teal-500","bg-cyan-500","bg-sky-500","bg-blue-500","bg-indigo-500","bg-violet-500","bg-purple-500","bg-fuchsia-500","bg-pink-500","bg-rose-500"],Qt={owner:"bg-red-500",admin:"bg-blue-500",user:"bg-green-500"};function qt(t){if(!t)return"bg-neutral-400";let e=0;for(let l=0;l<t.length;l++){const i=t.charCodeAt(l);e=(e<<5)-e+i,e=e&e}const n=Math.abs(e)%Se.length;return Se[n]??Se[0]}function Ht(t,e){return Qt[t]??"bg-neutral-400"}const Zt=Pe({role:Pe({id:se().optional(),slug:se().optional(),label:se()}),allowAllStaticPermissions:ke(),staticPermissions:Ie(se()),toolSet:De(se(),Ie(se())),allowAllModels:ke(),modelSet:De(se(),Ie(se())),memberIds:Ie(se())});function ot(t){return t?t.split(" ").map(e=>e[0]).join("").toUpperCase().slice(0,2):"?"}function Ye(t,e,n){const l=s.jsx(xe,{checked:t,disabled:e,onCheckedChange:n});return e?s.jsx(pe,{children:s.jsxs(be,{children:[s.jsx(Te,{asChild:!0,children:s.jsx("div",{children:l})}),s.jsx(Ee,{children:s.jsx("p",{children:"Built-in role permissions cannot be changed"})})]})}):l}function Xt(t){const e=q.c(28),{allowAllStaticPermissions:n,staticPermissions:l,onAllowAllChange:i,onPermissionsChange:r,readOnly:d,searchQuery:h}=t,c=d===void 0?!1:d;let g;e[0]!==h?(g=h.trim().toLowerCase(),e[0]=h,e[1]=g):g=e[1];const f=$.useDeferredValue(g);let a;if(e[2]!==n||e[3]!==f||e[4]!==i||e[5]!==r||e[6]!==c||e[7]!==h||e[8]!==l){const x=Ut(),o=(v,_)=>{if(!c){if(n&&_){const R=x.flatMap(es).flatMap(Wt);i(!1),r(R.filter(p=>!v.tools.includes(p)));return}n||r(Vt(v,l,!_))}};let m;e[10]!==f?(m=v=>{const{section:_,capabilities:R}=v;return{section:_,capabilities:R.filter(p=>!f||p.label.toLowerCase().includes(f)||p.description.toLowerCase().includes(f))}},e[10]=f,e[11]=m):m=e[11];const N=x.map(m).filter(Jt);let E;e[12]!==n||e[13]!==i||e[14]!==r?(E=()=>{i(!n),r([])},e[12]=n,e[13]=i,e[14]=r,e[15]=E):E=e[15];let T;e[16]!==n||e[17]!==c||e[18]!==E?(T=Ye(n,c,E),e[16]=n,e[17]=c,e[18]=E,e[19]=T):T=e[19];let S;e[20]!==n||e[21]!==i||e[22]!==r||e[23]!==c?(S=c?void 0:()=>{i(!n),r([])},e[20]=n,e[21]=i,e[22]=r,e[23]=c,e[24]=S):S=e[24];let C;e[25]!==T||e[26]!==S?(C=s.jsx(Ue,{title:"General",children:s.jsx(Be,{children:s.jsx(Ve,{title:"All organization permissions",description:"Grant full access to all features below",action:T,onClick:S})})}),e[25]=T,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:_,capabilities:R}=v;return s.jsx(Ue,{title:_,children:s.jsx(Be,{children:R.map(p=>{const O=Bt(p,l,n);return s.jsx(Ve,{title:s.jsxs("span",{className:"flex items-center gap-1.5",children:[p.label,p.dangerous&&s.jsx(ft,{size:12,className:"text-amber-500 shrink-0"})]}),description:p.description,action:Ye(O,c,()=>o(p,O)),onClick:c?void 0:()=>o(p,O)},p.id)})})},_)})]})}),e[2]=n,e[3]=f,e[4]=i,e[5]=r,e[6]=c,e[7]=h,e[8]=l,e[9]=a}else a=e[9];return a}function Jt(t){return t.capabilities.length>0}function Wt(t){return t.tools}function es(t){return t.capabilities}const it={anthropic:"Anthropic",openrouter:"OpenRouter"},ts={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 ss(t,e){const n=t.indexOf("/"),l=n>0?t.slice(0,n):e;return l.startsWith("~")?l.slice(1):l}function ns(t){return ts[t]??it[t]??t}function ls(t){const e=t.indexOf(": ");return e>0&&e<32?t.slice(e+2):t}const rt=30;function os(t){const e=q.c(44),{connectionId:n,subProviderId:l,subProviderName:i,groupLogo:r,models:d,allConnectionModelIds:h,selectedModels:c,allowAllModels:g,allConnectionModelsSelected:f,onToggleModel:a,onExitAllowAll:x,readOnly:o,defaultExpanded:m}=t,[N,E]=$.useState(m),T=m||N,S=E,[C,v]=$.useState(rt);let _;e[0]!==f||e[1]!==g||e[2]!==c?(_=j=>g||f||c.includes("*")||c.includes(j),e[0]=f,e[1]=g,e[2]=c,e[3]=_):_=e[3];const R=_;let p;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],p=d.filter(j),e[4]=R,e[5]=d,e[6]=p}else p=e[6];const O=p.length;let I;if(e[9]!==h||e[10]!==g||e[11]!==n||e[12]!==O||e[13]!==T||e[14]!==r||e[15]!==R||e[16]!==d||e[17]!==x||e[18]!==a||e[19]!==o||e[20]!==l||e[21]!==i||e[22]!==C){const j=d.slice(0,C),u=d.length>C;let w;e[24]===Symbol.for("react.memo_cache_sentinel")?(w=()=>S(cs),e[24]=w):w=e[24];const A=r??tt[l]??st;let k;e[25]!==i||e[26]!==A?(k=s.jsx(ye,{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(ge,{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 M;e[36]!==T?(M=T?s.jsx(Lt,{size:16,className:"text-muted-foreground shrink-0"}):s.jsx(Pt,{size:16,className:"text-muted-foreground shrink-0"}),e[36]=T,e[37]=M):M=e[37];let z;e[38]!==M||e[39]!==B?(z=s.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[B,M]}),e[38]=M,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:w,children:[U,z]}),e[41]=z,e[42]=U,e[43]=y):y=e[43],I=s.jsxs("div",{className:"border border-border rounded-lg overflow-hidden bg-card",children:[y,T&&s.jsxs("div",{className:"border-t border-border bg-muted/20",children:[j.map(L=>{const Y=R(L.id),F=()=>{if(!o){if(g){x(n,h,L.id);return}a(n,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:F,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:as,children:o?s.jsx(pe,{children:s.jsxs(be,{children:[s.jsx(Te,{asChild:!0,children:s.jsx("div",{children:s.jsx(xe,{checked:Y,disabled:!0,onCheckedChange:rs})})}),s.jsx(Ee,{children:s.jsx("p",{children:"Built-in role permissions cannot be changed"})})]})}):s.jsx(xe,{checked:Y,onCheckedChange:F})})]},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(is),children:["Show more (",d.length-C," remaining)"]})]})]}),e[9]=h,e[10]=g,e[11]=n,e[12]=O,e[13]=T,e[14]=r,e[15]=R,e[16]=d,e[17]=x,e[18]=a,e[19]=o,e[20]=l,e[21]=i,e[22]=C,e[23]=I}else I=e[23];return I}function is(t){return t+rt}function rs(){}function as(t){return t.stopPropagation()}function cs(t){return!t}function ds(t){const e=q.c(33),{connection:n,selectedModels:l,allowAllModels:i,onToggleModel:r,onExitAllowAll:d,allConnectionModelsSelected:h,searchQuery:c,readOnly:g}=t,f=Mt(n.id);let a,x,o,m,N;if(e[0]!==h||e[1]!==i||e[2]!==n.id||e[3]!==n.label||e[4]!==n.providerId||e[5]!==d||e[6]!==r||e[7]!==f||e[8]!==g||e[9]!==c||e[10]!==l){N=Symbol.for("react.early_return_sentinel");e:{let S;e[16]!==n.label?(S=A=>({...A,id:A.modelId,provider:n.label}),e[16]=n.label,e[17]=S):S=e[17];const C=f.filter(hs).map(S),v=c.trim().toLowerCase(),_=v?C.filter(A=>A.title.toLowerCase().includes(v)||A.id.toLowerCase().includes(v)||A.provider?.toLowerCase().includes(v)):C;if(_.length===0){N=null;break e}const R=new Map;for(const A of _){const k=ss(A.id,n.providerId),G=R.get(k)??{models:[],logo:null};G.models.push({id:A.id,title:ls(A.title),logo:A.logo}),!G.logo&&A.logo&&(G.logo=A.logo),R.set(k,G)}const p=Array.from(R.entries()).map(fs).sort(us),O=p.length===1||v.length>0;o="flex flex-col gap-3";const I=tt[n.providerId]??st;let j;e[18]!==n.providerId||e[19]!==I?(j=s.jsx("img",{src:I,alt:n.providerId,className:"w-4 h-4 rounded-sm dark:bg-white dark:rounded-sm dark:p-px"}),e[18]=n.providerId,e[19]=I,e[20]=j):j=e[20];const u=it[n.providerId]??n.providerId;let w;e[21]!==u?(w=s.jsx("h4",{className:"text-sm font-medium",children:u}),e[21]=u,e[22]=w):w=e[22],e[23]!==w||e[24]!==j?(m=s.jsxs("div",{className:"flex items-center gap-2",children:[j,w]}),e[23]=w,e[24]=j,e[25]=m):m=e[25],a="flex flex-col gap-3",x=p.map(A=>s.jsx(os,{connectionId:n.id,subProviderId:A.id,subProviderName:A.name,groupLogo:A.logo,models:A.models,allConnectionModelIds:C.map(ms),selectedModels:l,allowAllModels:i,allConnectionModelsSelected:h,onToggleModel:r,onExitAllowAll:d,readOnly:g,defaultExpanded:O},A.id))}e[0]=h,e[1]=i,e[2]=n.id,e[3]=n.label,e[4]=n.providerId,e[5]=d,e[6]=r,e[7]=f,e[8]=g,e[9]=c,e[10]=l,e[11]=a,e[12]=x,e[13]=o,e[14]=m,e[15]=N}else a=e[11],x=e[12],o=e[13],m=e[14],N=e[15];if(N!==Symbol.for("react.early_return_sentinel"))return N;let E;e[26]!==a||e[27]!==x?(E=s.jsx("div",{className:a,children:x}),e[26]=a,e[27]=x,e[28]=E):E=e[28];let T;return e[29]!==o||e[30]!==m||e[31]!==E?(T=s.jsxs("div",{className:o,children:[m,E]}),e[29]=o,e[30]=m,e[31]=E,e[32]=T):T=e[32],T}function ms(t){return t.id}function us(t,e){return t.name.localeCompare(e.name)}function fs(t){const[e,n]=t;return{id:e,name:ns(e),logo:n.logo,models:n.models}}function hs(t,e,n){return n.findIndex(l=>l.modelId===t.modelId)===e}function gs(t){const e=q.c(35),{allowAllModels:n,modelSet:l,onAllowAllChange:i,onModelSetChange:r,readOnly:d,searchQuery:h}=t,c=d===void 0?!1:d,g=$.useDeferredValue(h),f=wt();let a;e[0]!==l||e[1]!==r?(a=(p,O)=>{const I=l[p]??[],j={...l};if(I.includes(O)){const u=I.filter(w=>w!==O);u.length===0?delete j[p]:j[p]=u}else j[p]=[...I,O];r(j)},e[0]=l,e[1]=r,e[2]=a):a=e[2];const x=a;let o;e[3]!==l||e[4]!==i||e[5]!==r?(o=(p,O,I)=>{i(!1),r({...l,[p]:O.filter(j=>j!==I)})},e[3]=l,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;e[7]!==N?(E=K("flex items-center justify-between px-4 py-3 rounded-lg border border-border bg-card",N),e[7]=N,e[8]=E):E=e[8];let T;e[9]!==n||e[10]!==i||e[11]!==r||e[12]!==c?(T=()=>{if(c)return;const p=!n;i(p),p&&r({})},e[9]=n,e[10]=i,e[11]=r,e[12]=c,e[13]=T):T=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]!==n||e[16]!==i||e[17]!==r||e[18]!==c?(C=s.jsx("div",{onClick:ps,children:c?s.jsx(pe,{children:s.jsxs(be,{children:[s.jsx(Te,{asChild:!0,children:s.jsx("div",{children:s.jsx(xe,{checked:n,disabled:!0,onCheckedChange:xs})})}),s.jsx(Ee,{children:s.jsx("p",{children:"Built-in role permissions cannot be changed"})})]})}):s.jsx(xe,{checked:n,onCheckedChange:p=>{i(p),p&&r({})}})}),e[15]=n,e[16]=i,e[17]=r,e[18]=c,e[19]=C):C=e[19];let v;e[20]!==E||e[21]!==T||e[22]!==C?(v=s.jsxs("div",{className:E,onClick:T,children:[S,C]}),e[20]=E,e[21]=T,e[22]=C,e[23]=v):v=e[23];let _;e[24]!==f||e[25]!==n||e[26]!==g||e[27]!==m||e[28]!==l||e[29]!==c||e[30]!==x?(_=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(p=>s.jsx($.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(ds,{connection:p,selectedModels:l[p.id]??[],allowAllModels:n,onToggleModel:x,onExitAllowAll:m,allConnectionModelsSelected:(l[p.id]??[]).includes("*"),searchQuery:g,readOnly:c})},p.id)),e[24]=f,e[25]=n,e[26]=g,e[27]=m,e[28]=l,e[29]=c,e[30]=x,e[31]=_):_=e[31];let R;return e[32]!==_||e[33]!==v?(R=s.jsxs("div",{className:"flex flex-col h-full overflow-auto gap-6 pb-6",children:[v,_]}),e[32]=_,e[33]=v,e[34]=R):R=e[34],R}function xs(){}function ps(t){return t.stopPropagation()}function bs(t){const e=q.c(52),{open:n,onOpenChange:l,selectedMemberIds:i,onAddMembers:r}=t,[d,h]=$.useState(""),c=$.useDeferredValue(d);let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=[],e[0]=g):g=e[0];const[f,a]=$.useState(g),{data:x}=nt();let o,m,N,E,T,S,C,v,_,R,p;if(e[1]!==x?.data?.members||e[2]!==c||e[3]!==r||e[4]!==l||e[5]!==n||e[6]!==f||e[7]!==d||e[8]!==i){const U=x?.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 M=U.filter(B);let z;e[22]!==r||e[23]!==l||e[24]!==f?(z=()=>{r(f),a([]),l(!1)},e[22]=r,e[23]=l,e[24]=f,e[25]=z):z=e[25],N=z,m=Qe,R=n,p=l,o=qe,v="sm:max-w-md p-0",e[26]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsxs(He,{className:"px-6 pt-6",children:[s.jsx(Ze,{children:"Add Members to Role"}),s.jsx(Xe,{children:"Select members to add to this role."})]}),e[26]=_):_=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(ve,{value:d,onChange:h,placeholder:"Search members...",className:"w-full"})}),e[27]=d,e[28]=C):C=e[28],E="flex-1 overflow-auto",T=M.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:M.map(y=>{const L=y.role!=="owner",Y=i.includes(y.id),F=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(we,{checked:F||Y,onCheckedChange:()=>{!L||Y||a(X=>X.includes(y.id)?X.filter(J=>J!==y.id):[...X,y.id])},disabled:!L||Y}),s.jsx(lt,{url:y.user?.image??void 0,fallback:ot(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(ge,{variant:"secondary",className:"shrink-0",children:"Owner"}),Y&&L&&s.jsx(ge,{variant:"outline",className:"shrink-0",children:"Added"})]},y.id)})}),e[1]=x?.data?.members,e[2]=c,e[3]=r,e[4]=l,e[5]=n,e[6]=f,e[7]=d,e[8]=i,e[9]=o,e[10]=m,e[11]=N,e[12]=E,e[13]=T,e[14]=S,e[15]=C,e[16]=v,e[17]=_,e[18]=R,e[19]=p}else o=e[9],m=e[10],N=e[11],E=e[12],T=e[13],S=e[14],C=e[15],v=e[16],_=e[17],R=e[18],p=e[19];let O;e[29]!==E||e[30]!==T?(O=s.jsx("div",{className:E,children:T}),e[29]=E,e[30]=T,e[31]=O):O=e[31];let I;e[32]!==O||e[33]!==S||e[34]!==C?(I=s.jsxs("div",{className:S,children:[C,O]}),e[32]=O,e[33]=S,e[34]=C,e[35]=I):I=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,w=f.length>0&&`(${f.length})`;let A;e[37]!==N||e[38]!==u||e[39]!==w?(A=s.jsxs(We,{className:"px-6 pb-6",children:[j,s.jsxs(et,{onClick:N,disabled:u,children:["Add ",w]})]}),e[37]=N,e[38]=u,e[39]=w,e[40]=A):A=e[40];let k;e[41]!==o||e[42]!==I||e[43]!==A||e[44]!==v||e[45]!==_?(k=s.jsxs(o,{className:v,children:[_,I,A]}),e[41]=o,e[42]=I,e[43]=A,e[44]=v,e[45]=_,e[46]=k):k=e[46];let G;return e[47]!==m||e[48]!==k||e[49]!==R||e[50]!==p?(G=s.jsx(m,{open:R,onOpenChange:p,children:k}),e[47]=m,e[48]=k,e[49]=R,e[50]=p,e[51]=G):G=e[51],G}function Ts(t){const e=q.c(29),{memberIds:n,onMemberIdsChange:l,readOnly:i,readOnlyMessage:r,searchQuery:d,addMemberDialogOpen:h,onAddMemberDialogOpenChange:c}=t,g=i===void 0?!1:i,f=r===void 0?"Owner membership cannot be changed":r,a=$.useDeferredValue(d),{data:x}=nt();let o,m,N;if(e[0]!==x?.data?.members||e[1]!==a||e[2]!==n||e[3]!==l||e[4]!==g||e[5]!==f||e[6]!==d){const v=x?.data?.members??[];let _;e[10]!==n?(_=I=>n.includes(I.id),e[10]=n,e[11]=_):_=e[11];const R=v.filter(_);let p;e[12]!==a?(p=I=>{const j=a.toLowerCase();return I.user?.name?.toLowerCase().includes(j)||I.user?.email?.toLowerCase().includes(j)},e[12]=a,e[13]=p):p=e[13];const O=R.filter(p);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(I=>s.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-muted/30",children:[s.jsx(lt,{url:I.user?.image??void 0,fallback:ot(I.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:I.user?.name||"Unknown"}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:I.user?.email})]}),g?s.jsx(pe,{children:s.jsxs(be,{children:[s.jsx(Te,{asChild:!0,children:s.jsx("div",{children:s.jsx(ne,{variant:"ghost",size:"sm",disabled:!0,children:s.jsx(ze,{size:16})})})}),s.jsx(Ee,{children:s.jsx("p",{children:f})})]})}):s.jsx(ne,{variant:"ghost",size:"sm",onClick:()=>l(n.filter(j=>j!==I.id)),children:s.jsx(ze,{size:16})})]},I.id))}),e[0]=x?.data?.members,e[1]=a,e[2]=n,e[3]=l,e[4]=g,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;e[14]!==o||e[15]!==m?(E=s.jsx("div",{className:o,children:m}),e[14]=o,e[15]=m,e[16]=E):E=e[16];let T;e[17]!==n||e[18]!==l?(T=v=>l([...n,...v]),e[17]=n,e[18]=l,e[19]=T):T=e[19];let S;e[20]!==h||e[21]!==n||e[22]!==c||e[23]!==T?(S=s.jsx(bs,{open:h,onOpenChange:c,selectedMemberIds:n,onAddMembers:T}),e[20]=h,e[21]=n,e[22]=c,e[23]=T,e[24]=S):S=e[24];let C;return e[25]!==N||e[26]!==E||e[27]!==S?(C=s.jsxs("div",{className:N,children:[E,S]}),e[25]=N,e[26]=E,e[27]=S,e[28]=C):C=e[28],C}function Es(t){const e=q.c(3);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=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]=n):n=e[0];let l;return e[1]!==t?(l=s.jsx($.Suspense,{fallback:n,children:s.jsx(Ts,{...t})}),e[1]=t,e[2]=l):l=e[2],l}const _s={owner:[],admin:[],user:[]};function Is(t,e,n,l){const i=t==="owner"||t==="admin";return{role:{id:n?.id,slug:t,label:t.charAt(0).toUpperCase()+t.slice(1)},allowAllStaticPermissions:i,staticPermissions:_s[t],toolSet:{},allowAllModels:!0,modelSet:{},memberIds:e.filter(r=>r.role===t).map(r=>r.id)}}function Ns(t,e,n){const l=t.permission||{},i=l.self||[],r=i.includes("*"),d=r?[]:i.filter(a=>a!=="*"),h={};for(const[a,x]of Object.entries(l))if(!(a==="self"||a==="models"))if(a==="*")for(const o of n)h[o.id]=x.includes("*")?o.tools?.map(m=>m.name)??[]:x;else{const o=n.find(m=>m.id===a);o&&(h[a]=x.includes("*")?o.tools?.map(m=>m.name)??[]:x)}const c=l.models||[],g=c.length===0||c.includes("*:*"),f={};if(!g)for(const a of c){const x=a.indexOf(":");if(x===-1)continue;const o=a.slice(0,x),m=a.slice(x+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:g,modelSet:f,memberIds:e.filter(a=>a.role===t.role).map(a=>a.id)}}function Ss(t,e){const n={};t.allowAllStaticPermissions?n.self=["*"]:t.staticPermissions.length>0&&(n.self=t.staticPermissions);for(const[l,i]of Object.entries(t.toolSet))if(i.length>0){const d=e.find(h=>h.id===l)?.tools?.map(h=>h.name)??[];n[l]=d.length>0&&d.every(h=>i.includes(h))?["*"]:i}if(t.allowAllModels)n.models=["*:*"];else{const l=[];for(const[i,r]of Object.entries(t.modelSet))for(const d of r)l.push(`${i}:${d}`);l.length>0&&(n.models=l)}return n}function Cs(t,e,n){return t.kind==="builtin"?Is(t.role,e,void 0):t.kind==="custom"?Ns(t.role,e,n):{role:{id:void 0,slug:void 0,label:""},allowAllStaticPermissions:!1,staticPermissions:[],toolSet:{},allowAllModels:!0,modelSet:{},memberIds:[]}}function As(t){const e=q.c(6),{readOnly:n,readOnlyMessage:l,onOpen:i}=t,r=l===void 0?"Owner membership cannot be changed":l;if(n){let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Te,{asChild:!0,children:s.jsx("div",{children:s.jsxs(ne,{variant:"outline",size:"sm",disabled:!0,children:[s.jsx(Ae,{size:16}),"Add Member"]})})}),e[0]=c):c=e[0];let g;return e[1]!==r?(g=s.jsx(pe,{children:s.jsxs(be,{children:[c,s.jsx(Ee,{children:s.jsx("p",{children:r})})]})}),e[1]=r,e[2]=g):g=e[2],g}let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Ae,{size:16}),e[3]=d):d=e[3];let h;return e[4]!==i?(h=s.jsxs(ne,{variant:"outline",size:"sm",onClick:i,children:[d,"Add Member"]}),e[4]=i,e[5]=h):h=e[5],h}function Rs(t){const e=q.c(14),{locator:n}=Ne(),l=je(),i=yt();let r;e[0]!==n?(r=re.members(n),e[0]=n,e[1]=r):r=e[1];let d;e[2]!==l?(d=()=>l.organization.listMembers(),e[2]=l,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:g}=Re(h);if(g||!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 x;return e[10]!==i||e[11]!==a||e[12]!==t?(x=s.jsx(Os,{...t,members:a,connections:i}),e[10]=i,e[11]=a,e[12]=t,e[13]=x):x=e[13],x}function Os({target:t,onBack:e,onSaved:n,members:l,connections:i}){const{locator:r}=Ne(),d=je(),h=$e(),c=t.kind==="builtin",g=t.kind==="builtin"&&t.role==="owner",f=t.kind==="new",[a,x]=$.useState(c?"org":"mcp"),o=mt({resolver:ut(Zt),defaultValues:Cs(t,l,i)}),m=o.formState.isValid,N=o.formState.isDirty,E=Fe({mutationFn:async u=>{const w=Ss(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 M=l.filter(L=>L.role===(B??U)).map(L=>L.id),z=u.memberIds.filter(L=>!M.includes(L)),y=M.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,M=U!==B,z=await d.organization.updateRole({roleId:u.role.id,data:{permission:w,...M?{roleName:U}:{}}});if(z?.error)throw new Error(z.error.message??"Something went wrong");return await G(M?U:B,M?B:void 0),M?{...u,role:{...u.role,slug:U}}:u}else{const U=await d.organization.createRole({role:A,permission:w});if(U?.error)throw new Error(U.error.message??"Something went wrong");for(const B of u.memberIds){const M=await d.organization.updateMemberRole({memberId:B,role:[A]});if(M?.error)throw new Error(M.error.message)}return{...u,role:{...u.role,id:U.data?.roleData?.id,slug:A}}}},onSuccess:(u,w)=>{h.invalidateQueries({queryKey:re.members(r)}),h.invalidateQueries({queryKey:re.organizationRoles(r)});const A=!w.role.id&&!w.role.slug,k=w.role.slug==="owner"&&!w.role.id;Oe(k?"role_members_updated":A?"role_created":"role_updated",{role_slug:w.role.slug??null}),he.success(k?"Members updated successfully!":A?"Role created successfully!":"Role updated successfully!"),o.reset(u),n(u.role.id)},onError:u=>{he.error(u instanceof Error?u.message:"Failed to save role")}}),T=o.handleSubmit(u=>{if(!u.role.label.trim()){he.error("Role name is required"),o.setFocus("role.label");return}E.mutate(u)}),S=!g,C=t.kind==="builtin"?t.role.charAt(0).toUpperCase()+t.role.slice(1):t.kind==="custom"?t.role.label:"",v=[...g?[]:[{id:"mcp",label:"MCP Permissions"}],{id:"org",label:"Organization Permissions"},{id:"models",label:"Models"},{id:"members",label:"Members"}],[_,R]=$.useState(""),[p,O]=$.useState(!1),I=u=>{x(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(ne,{variant:"outline",size:"sm",onClick:e,disabled:E.isPending,children:"Cancel"}),s.jsx(ne,{size:"sm",onClick:T,disabled:E.isPending||!m||!N,children:E.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"?Ht(t.role):qt(o.watch("role.label")))}),g&&s.jsx(Ke,{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:()=>I(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(ve,{value:_,onChange:R,placeholder:j[a]??"Search...",className:"w-full md:w-[375px]"}),a==="members"&&s.jsx(As,{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"&&!g&&s.jsx(Kt,{toolSet:o.watch("toolSet"),onToolSetChange:u=>o.setValue("toolSet",u,{shouldDirty:!0}),searchQuery:_}),a==="org"&&s.jsx(Xt,{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:g,searchQuery:_}),a==="models"&&s.jsx(gs,{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:g,searchQuery:_}),a==="members"&&s.jsx(Es,{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:_,addMemberDialogOpen:p,onAddMemberDialogOpenChange:O})]})})]})})}function js(t){return t.kind==="builtin"?`builtin-${t.role}`:t.kind==="custom"?`custom-${t.role.id}`:"new"}function vs(t){const e=q.c(6),{area:n,children:l}=t,{isPrivileged:i,loading:r,error:d}=Dt();let h;return e[0]!==n||e[1]!==l||e[2]!==d||e[3]!==i||e[4]!==r?(h=s.jsx(kt,{granted:i,loading:r,error:d,area:n,children:l}),e[0]=n,e[1]=l,e[2]=d,e[3]=i,e[4]=r,e[5]=h):h=e[5],h}const ys=[{role:"owner",label:"Owner",color:"bg-red-500"},{role:"admin",label:"Admin",color:"bg-blue-500"},{role:"user",label:"User",color:"bg-green-500"}],Ce=["bg-red-500","bg-orange-500","bg-amber-500","bg-yellow-500","bg-lime-500","bg-green-500","bg-emerald-500","bg-teal-500","bg-cyan-500","bg-sky-500","bg-blue-500","bg-indigo-500","bg-violet-500","bg-purple-500","bg-fuchsia-500","bg-pink-500","bg-rose-500"];function ws(t){if(!t)return"bg-neutral-400";let e=0;for(let l=0;l<t.length;l++){const i=t.charCodeAt(l);e=(e<<5)-e+i,e=e&e}const n=Math.abs(e)%Ce.length;return Ce[n]??Ce[0]}const Ms={owner:"bg-red-500",admin:"bg-blue-500",user:"bg-green-500"};function Ls(t,e){return e?Ms[t]??"bg-neutral-400":ws(t)}function Ps(){const t=q.c(77),[e,n]=$.useState(""),[l,i]=$.useState(null),r=gt();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(),g=je(),f=$e(),{customRoles:a,refetch:x}=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 E=N;let T;t[5]!==c?(T=re.members(c),t[5]=c,t[6]=T):T=t[6];let S;t[7]!==g?(S=()=>g.organization.listMembers(),t[7]=g,t[8]=S):S=t[8];let C;t[9]!==T||t[10]!==S?(C={queryKey:T,queryFn:S},t[9]=T,t[10]=S,t[11]=C):C=t[11];const{data:v}=Re(C);let _;t[12]!==v?.data?.members?(_=v?.data?.members??[],t[12]=v?.data?.members,t[13]=_):_=t[13];const R=_;let p;t[14]!==R?(p=P=>R.filter(V=>V.role===P).length,t[14]=R,t[15]=p):p=t[15];const O=p;let I;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=ys.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 at=a.map(ae);if(I=[...V,...at],e){const ce=e.toLowerCase();I=I.filter(ct=>ct.role.label.toLowerCase().includes(ce))}t[16]=a,t[17]=O,t[18]=e,t[19]=I}else I=t[19];let j;t[24]!==g?(j=async P=>{const V=await g.organization.deleteRole({roleId:P});if(V?.error)throw new Error(V.error.message);return V?.data},t[24]=g,t[25]=j):j=t[25];const u=Fe({mutationFn:j,onSuccess:(P,V)=>{Oe("role_deleted",{role_id:V}),f.invalidateQueries({queryKey:re.members(c)}),f.invalidateQueries({queryKey:re.organizationRoles(c)}),he.success("Role deleted successfully!"),x(),E?.kind==="custom"&&E.role.id===V&&m(void 0)},onError:zs});let w,A,k,G;t[26]===Symbol.for("react.memo_cache_sentinel")?(G={id:"role",header:"Role",render:Vs,cellClassName:"flex-1 min-w-0",sortable:!0},w={id:"type",header:"Type",render:Bs,cellClassName:"w-28 shrink-0"},A={id:"permissions",header:"Permissions",render:Us,cellClassName:"flex-1 min-w-0"},k={id:"members",header:"Members",render:Gs,cellClassName:"w-24 shrink-0"},t[26]=w,t[27]=A,t[28]=k,t[29]=G):(w=t[26],A=t[27],k=t[28],G=t[29]);let U;t[30]===Symbol.for("react.memo_cache_sentinel")?(U=[G,w,A,k,{id:"actions",header:"",render:P=>P.kind==="builtin"?null:s.jsxs(Tt,{children:[s.jsx(Et,{asChild:!0,children:s.jsx(ne,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:ks,children:s.jsx(Nt,{size:16})})}),s.jsx(_t,{align:"end",onClick:Ds,children:s.jsxs(It,{variant:"destructive",onClick:()=>{const V=P.role;V.id&&i({id:V.id,label:V.label})},children:[s.jsx(St,{size:16}),"Delete"]})})]}),cellClassName:"w-12 shrink-0"}],t[30]=U):U=t[30];const B=U;let M;t[31]!==m?(M=P=>{if(P.kind==="builtin")m(`builtin-${P.role.role}`);else{const V=P.role;m(V.id)}},t[31]=m,t[32]=M):M=t[32];const z=M;if(E){let P;t[33]!==m?(P=()=>m(void 0),t[33]=m,t[34]=P):P=t[34];let V;return t[35]!==x||t[36]!==m?(V=()=>{x(),m(void 0)},t[35]=x,t[36]=m,t[37]=V):V=t[37],s.jsx(Rs,{target:E,onBack:P,onSaved:V},js(E))}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"&&(n(""),P.target.blur())},t[39]=L):L=t[39];let Y;t[40]!==e?(Y=s.jsx(ve,{value:e,onChange:n,placeholder:"Search roles...",className:"w-full md:w-[375px]",onKeyDown:L}),t[40]=e,t[41]=Y):Y=t[41];let F;t[42]!==m?(F=()=>m("new"),t[42]=m,t[43]=F):F=t[43];let X;t[44]===Symbol.for("react.memo_cache_sentinel")?(X=s.jsx(Ae,{size:16}),t[44]=X):X=t[44];let J;t[45]!==F?(J=s.jsxs(ne,{onClick:F,children:[X,"Create Role"]}),t[45]=F,t[46]=J):J=t[46];let le;t[47]!==Y||t[48]!==J?(le=s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[Y,J]}),t[47]=Y,t[48]=J,t[49]=le):le=t[49];let oe;t[50]!==e?(oe=e?s.jsx(Ge,{title:"No roles found",description:`No roles match "${e}"`}):s.jsx(Ge,{title:"No roles",description:"Create a role to get started."}),t[50]=e,t[51]=oe):oe=t[51];let ie;t[52]!==I||t[53]!==B||t[54]!==z||t[55]!==oe?(ie=s.jsx(bt,{columns:B,data:I,isLoading:!1,onRowClick:z,emptyState:oe}),t[52]=I,t[53]=B,t[54]=z,t[55]=oe,t[56]=ie):ie=t[56];let b;t[57]!==le||t[58]!==ie?(b=s.jsx(te.Content,{children:s.jsx(te.Body,{children:s.jsxs("div",{className:"flex flex-col gap-6",children:[y,le,ie]})})}),t[57]=le,t[58]=ie,t[59]=b):b=t[59];const D=l!==null;let Q;t[60]===Symbol.for("react.memo_cache_sentinel")?(Q=P=>!P&&i(null),t[60]=Q):Q=t[60];let H;t[61]===Symbol.for("react.memo_cache_sentinel")?(H=s.jsx(Ze,{children:"Delete Role"}),t[61]=H):H=t[61];const W=l?.label;let Z;t[62]!==W?(Z=s.jsxs(He,{children:[H,s.jsxs(Xe,{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]!==l?(de=s.jsxs(We,{children:[ee,s.jsx(et,{onClick:()=>{l?.id&&u.mutate(l.id),i(null)},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),t[65]=u,t[66]=l,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(Qe,{open:D,onOpenChange:Q,children:me}),t[71]=D,t[72]=me,t[73]=ue):ue=t[73];let _e;return t[74]!==b||t[75]!==ue?(_e=s.jsxs(te,{children:[b,ue]}),t[74]=b,t[75]=ue,t[76]=_e):_e=t[76],_e}function Ds(t){return t.stopPropagation()}function ks(t){return t.stopPropagation()}function Gs(t){return s.jsx("span",{className:"text-sm text-foreground",children:t.role.memberCount})}function Us(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,n=[];return e.allowsAllStaticPermissions?n.push("Full org access"):e.staticPermissionCount&&e.staticPermissionCount>0&&n.push(`${e.staticPermissionCount} org perm${e.staticPermissionCount!==1?"s":""}`),e.allowsAllConnections?n.push("All connections"):e.connectionCount&&e.connectionCount>0&&n.push(`${e.connectionCount} connection${e.connectionCount!==1?"s":""}`),s.jsx("span",{className:"text-sm text-muted-foreground truncate",children:n.length>0?n.join(", "):"No permissions"})}function Bs(t){return t.kind==="builtin"?s.jsx(ge,{variant:"secondary",className:"text-xs",children:"Built-in"}):s.jsx(ge,{variant:"outline",className:"text-xs",children:"Custom"})}function Vs(t){return s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:K("size-2.5 rounded-full shrink-0",Ls(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(Ke,{size:12,className:"text-muted-foreground shrink-0"})]})}function zs(t,e){Oe("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 Ys(){const t=q.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 n;return t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(ht,{fallback:e,children:s.jsx($.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(Ps,{})})}),t[1]=n):n=t[1],n}function ul(){const t=q.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(vs,{area:"roles",children:s.jsx(Ys,{})}),t[0]=e):e=t[0],e}export{ul as default};
1
+ import{r as $,D as Ne,K as re,b8 as dt,k as Re,j as s,l as K,i as fe,B as ne,c as q,o as Pe,aD as Ie,s as se,aF as De,aG as ke,m as $e,p as mt,n as ut,d as Fe,t as he,w as Oe,ag as Ke,a8 as ft,E as ht,b as gt,u as xt}from"./index-tHbNbVHJ.js";import{u as pt,C as bt}from"./use-organization-roles-GhUkwr8O.js";import{u as je}from"./use-org-auth-client-7sV0tnvK.js";import{B as ge}from"./badge-7eW-Y90w.js";import{f as Qe,a as qe,b as He,c as Ze,d as Xe,A as Je,e as We,g as et}from"./alert-dialog-CWTgvZp_.js";import{D as Tt,a as Et,b as _t,c as It}from"./dropdown-menu-B_TYOovI.js";import{a as Nt}from"./DotsVertical-BGprjE03.js";import{s as Ae}from"./Plus-rHk0VScG.js";import{s as St}from"./Trash01-BrvLbqQk.js";import{P as te}from"./index-87hVDe9f.js";import{E as Ge}from"./empty-state-BVh7wBPS.js";import{S as ve}from"./search-input-DWWTgewM.js";import{P as tt,D as st}from"./ai-providers-logos-DD3qZ33J.js";import{I as ye}from"./integration-icon-DOeD9Yy1.js";import{u as Ct}from"./use-infinite-scroll-Bk__8TxT.js";import{C as we}from"./checkbox-D1J6-HGS.js";import{b as At}from"./Settings02-bfgJ4jKJ.js";import{u as Rt}from"./useSuspenseInfiniteQuery-CwejNwQJ.js";import{u as Ot,S as jt}from"./use-mcp-client-0BRd9S75.js";import{C as vt}from"./collection-search-SCB2wfQm.js";import{u as nt}from"./use-members-BAva2zEC.js";import{u as yt}from"./use-connection-B65sInnd.js";import{u as wt,d as Mt}from"./use-ai-providers-DS_7m4pz.js";import{A as lt}from"./avatar-DosbYSVo.js";import{S as xe}from"./switch-CuKs1fR0.js";import{c as pe,T as be,a as Te,b as Ee}from"./tooltip-DW1HpudV.js";import{S as Ue,a as Be,b as Ve}from"./settings-section-B4a4SAqB.js";import{t as Lt}from"./ChevronDown-CpzTl0cf.js";import{i as Pt}from"./ChevronRight-DqDeYsel.js";import{i as ze}from"./X-BZf8Ua-f.js";import{a as Dt}from"./use-capability-CeF0OpPy.js";import{A as kt}from"./access-gate-CCm9ALRG.js";import"./table-BfyoFEgz.js";import"./SwitchHorizontal01-CTCDUfta.js";import"./ChevronUp-Cr2g1GDa.js";import"./sidebar-Cy5GVw74.js";import"./LayoutLeft-DQOl0C9j.js";import"./use-mobile-BD2-gXK-.js";import"./sheet-DW12PvFQ.js";import"./SearchMd-Bc8RVvtx.js";import"./XCircle-CxfDN97v.js";import"./agent-icon-BbjKuSxW.js";import"./AlertCircle-Bgopcarv.js";import"./Tool01-Dvmkyh1g.js";import"./ArrowUpRight-7XR-z7Ge.js";import"./ZapSquare-BY_c_0SN.js";import"./Users03-CBNK0aq-.js";import"./CheckCircle-DsdDhP4L.js";import"./ChevronLeft-BuOnLJw9.js";import"./Stars02-DXKYKZ_y.js";import"./Eye-B9uHZVsM.js";import"./ZoomOut-C9_8nvys.js";import"./Globe01-H40eMg8D.js";import"./FilterLines-DgCFEQWk.js";import"./Star01-DnRxcrb2.js";import"./Globe04-BNaAcUBp.js";import"./HardDrive-l0WQMFU9.js";import"./Key01-BDd1iQS4.js";import"./LinkExternal01-BAME6PCB.js";import"./Monitor01-CaJkUXyc.js";import"./Sun-BvgQbAIe.js";import"./Palette-C1u1Sxuh.js";import"./Play-DSjj50Z1.js";import"./Shield01-C0erkp7L.js";import"./Stars01-DN0i_OuW.js";import"./Upload01-Cghimx9V.js";import"./User01-BPjc8LiD.js";import"./Users01-DKr-dGyn.js";import"./XClose-Ca4NBXw9.js";import"./Zap-D8ndRUQT.js";import"./auth-DtR4b91D.js";import"./use-collections-GNpTGYUv.js";import"./studio-tools-Dd7dXWQL.js";import"./card-ChgC15JC.js";import"./capability-load-error-BQe9cGJ_.js";const Me="basic-usage",Le=[{id:Me,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"]},{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"],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}];[...Le.find(t=>t.id===Me)?.tools??[]];const Gt=["agents:manage","connections:manage"];new Set(Le.filter(t=>Gt.includes(t.id)).flatMap(t=>t.tools));function Ut(){const t=new Map;for(const e of Le){if(e.id===Me)continue;const n=t.get(e.section)??[];n.push(e),t.set(e.section,n)}return Array.from(t.entries()).map(([e,n])=>({section:e,capabilities:n}))}function Bt(t,e,n){return n?!0:t.tools.every(l=>e.includes(l))}function Vt(t,e,n){if(n){const i=new Set(e);for(const r of t.tools)i.add(r);return Array.from(i)}const l=new Set(e);for(const i of t.tools)l.delete(i);return Array.from(l)}function zt(t){const e=q.c(21),{connection:n,isSelected:l,hasToolsEnabled:i,activeToolsCount:r,totalToolsCount:d,onSelect:h,onToggle:c}=t,g=l?"bg-accent/50":"hover:bg-muted/50";let f;e[0]!==g?(f=K("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",g),e[0]=g,e[1]=f):f=e[1];let a;e[2]!==n.icon||e[3]!==n.title?(a=s.jsx(ye,{icon:n.icon,name:n.title,size:"xs"}),e[2]=n.icon,e[3]=n.title,e[4]=a):a=e[4];let x;e[5]!==n.title?(x=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:n.title})}),e[5]=n.title,e[6]=x):x=e[6];let o;e[7]!==h||e[8]!==a||e[9]!==x?(o=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:h,children:[a,x]}),e[7]=h,e[8]=a,e[9]=x,e[10]=o):o=e[10];let m;e[11]!==r||e[12]!==n.tools||e[13]!==i||e[14]!==c||e[15]!==d?(m=n.tools&&n.tools.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[r,"/",d]}),s.jsx(we,{checked:i,onCheckedChange:c,onClick:Yt})]}),e[11]=r,e[12]=n.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 $t(t){const e=q.c(18),{connectionId:n,tool:l,isSelected:i,onToggle:r}=t,d=`tool-${n}-${l.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 g;e[2]!==c||e[3]!==l.name?(g=s.jsx("div",{className:"flex items-center gap-2 mb-1",children:s.jsx("span",{className:c,children:l.name})}),e[2]=c,e[3]=l.name,e[4]=g):g=e[4];let f;e[5]!==l.description?(f=l.description&&s.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:l.description}),e[5]=l.description,e[6]=f):f=e[6];let a;e[7]!==g||e[8]!==f?(a=s.jsxs("div",{className:"flex-1 min-w-0",children:[g,f]}),e[7]=g,e[8]=f,e[9]=a):a=e[9];const x=`tool-${n}-${l.name}`;let o;e[10]!==i||e[11]!==r||e[12]!==x?(o=s.jsx("div",{className:"flex items-center shrink-0",children:s.jsx(we,{id:x,checked:i,onCheckedChange:r,onClick:Ft})}),e[10]=i,e[11]=r,e[12]=x,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 Ft(t){return t.stopPropagation()}function Kt({toolSet:t,onToolSetChange:e,excludeVirtualMcpId:n,searchQuery:l}){const[i,r]=$.useState(""),d=l!==void 0?l:i,h=$.useDeferredValue(d),[c,g]=$.useState("all"),[f,a]=$.useState(!1),x=$.useRef(new Set(Object.keys(t))),{org:o}=Ne(),m=Ot({connectionId:jt,orgId:o.id,orgSlug:o.slug}),N=100,E=h.trim(),T=E?{operator:"or",conditions:[{field:["title"],operator:"contains",value:E},{field:["description"],operator:"contains",value:E}]}:void 0,S=!!n,C={...T&&{where:T},orderBy:[{field:["updated_at"],direction:"asc"}],limit:N,offset:0,...S&&{include_virtual:!0}},v=JSON.stringify(C),{data:_,fetchNextPage:R,hasNextPage:p,isFetchingNextPage:O}=Rt({queryKey:re.collectionListInfinite(m,o.id,"","CONNECTIONS",v),queryFn:async({pageParam:b=0})=>(await m.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...T&&{where:T},orderBy:[{field:["updated_at"],direction:"asc"}],limit:N,offset:b,...S&&{include_virtual:!0}}})).structuredContent,initialPageParam:0,getNextPageParam:(b,D)=>{if(b?.hasMore)return D.reduce((Q,H)=>Q+(H?.items?.length??0),0)},staleTime:3e4}),I=_?.pages.flatMap(b=>b?.items??[])??[],j=Ct(R,p??!1,O),u=n?I.filter(b=>b.connection_type!=="VIRTUAL"?!0:dt(b.connection_url)!==n):I,w=x.current,A=[...w.values()].map(b=>u.find(D=>D.id===b)).filter(b=>b!==void 0),k=u.filter(b=>!w.has(b.id)),G=[...A,...k],U=b=>{const D=t[b];return D!==void 0&&D.length>0},B=G.filter(b=>{if(c==="all")return!0;const D=U(b.id);return c==="selected"?D:c==="unselected"?!D:!0}),[M,z]=$.useState(G[0]?.id??null),y=M?G.find(b=>b.id===M)??null:null,{data:L,isFetching:Y}=Re({queryKey:re.collectionItem(m,o.id,"","CONNECTIONS",M??""),queryFn:async()=>M?(await m.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:M}})).structuredContent?.item??null:null,enabled:!!M,staleTime:3e4}),F=L?.tools??[],X=(b,D)=>t[b]?.includes(D)??!1,J=(b,D)=>{const Q=t[b]??[],H=Q.includes(D),W={...t};if(H){const Z=Q.filter(ee=>ee!==D);Z.length===0?delete W[b]:W[b]=Z}else W[b]=[...Q,D];e(W)},le=b=>{const D=b===M?F:[];if(!D.length)return;const Q=t[b]??[],H=D.map(ee=>ee.name),W=Q.length>0&&H.every(ee=>Q.includes(ee)),Z={...t};W?delete Z[b]:(Z[b]=H,z(b)),e(Z)},oe=b=>{z(b),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:[l===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:()=>g("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:()=>g("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:()=>g("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(b=>{const D=M===b.id,Q=D?F.length:0,H=t[b.id]?.length??0;return s.jsx(zt,{connection:{...b,tools:D?F:b.tools},isSelected:D,hasToolsEnabled:U(b.id),activeToolsCount:H,totalToolsCount:Q,onSelect:()=>oe(b.id),onToggle:()=>le(b.id)},b.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(ne,{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(ye,{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"})}):F.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:F.map(b=>s.jsx($t,{connectionId:y.id,tool:b,isSelected:X(y.id,b.name),onToggle:()=>J(y.id,b.name)},b.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 Se=["bg-red-500","bg-orange-500","bg-amber-500","bg-yellow-500","bg-lime-500","bg-green-500","bg-emerald-500","bg-teal-500","bg-cyan-500","bg-sky-500","bg-blue-500","bg-indigo-500","bg-violet-500","bg-purple-500","bg-fuchsia-500","bg-pink-500","bg-rose-500"],Qt={owner:"bg-red-500",admin:"bg-blue-500",user:"bg-green-500"};function qt(t){if(!t)return"bg-neutral-400";let e=0;for(let l=0;l<t.length;l++){const i=t.charCodeAt(l);e=(e<<5)-e+i,e=e&e}const n=Math.abs(e)%Se.length;return Se[n]??Se[0]}function Ht(t,e){return Qt[t]??"bg-neutral-400"}const Zt=Pe({role:Pe({id:se().optional(),slug:se().optional(),label:se()}),allowAllStaticPermissions:ke(),staticPermissions:Ie(se()),toolSet:De(se(),Ie(se())),allowAllModels:ke(),modelSet:De(se(),Ie(se())),memberIds:Ie(se())});function ot(t){return t?t.split(" ").map(e=>e[0]).join("").toUpperCase().slice(0,2):"?"}function Ye(t,e,n){const l=s.jsx(xe,{checked:t,disabled:e,onCheckedChange:n});return e?s.jsx(pe,{children:s.jsxs(be,{children:[s.jsx(Te,{asChild:!0,children:s.jsx("div",{children:l})}),s.jsx(Ee,{children:s.jsx("p",{children:"Built-in role permissions cannot be changed"})})]})}):l}function Xt(t){const e=q.c(28),{allowAllStaticPermissions:n,staticPermissions:l,onAllowAllChange:i,onPermissionsChange:r,readOnly:d,searchQuery:h}=t,c=d===void 0?!1:d;let g;e[0]!==h?(g=h.trim().toLowerCase(),e[0]=h,e[1]=g):g=e[1];const f=$.useDeferredValue(g);let a;if(e[2]!==n||e[3]!==f||e[4]!==i||e[5]!==r||e[6]!==c||e[7]!==h||e[8]!==l){const x=Ut(),o=(v,_)=>{if(!c){if(n&&_){const R=x.flatMap(es).flatMap(Wt);i(!1),r(R.filter(p=>!v.tools.includes(p)));return}n||r(Vt(v,l,!_))}};let m;e[10]!==f?(m=v=>{const{section:_,capabilities:R}=v;return{section:_,capabilities:R.filter(p=>!f||p.label.toLowerCase().includes(f)||p.description.toLowerCase().includes(f))}},e[10]=f,e[11]=m):m=e[11];const N=x.map(m).filter(Jt);let E;e[12]!==n||e[13]!==i||e[14]!==r?(E=()=>{i(!n),r([])},e[12]=n,e[13]=i,e[14]=r,e[15]=E):E=e[15];let T;e[16]!==n||e[17]!==c||e[18]!==E?(T=Ye(n,c,E),e[16]=n,e[17]=c,e[18]=E,e[19]=T):T=e[19];let S;e[20]!==n||e[21]!==i||e[22]!==r||e[23]!==c?(S=c?void 0:()=>{i(!n),r([])},e[20]=n,e[21]=i,e[22]=r,e[23]=c,e[24]=S):S=e[24];let C;e[25]!==T||e[26]!==S?(C=s.jsx(Ue,{title:"General",children:s.jsx(Be,{children:s.jsx(Ve,{title:"All organization permissions",description:"Grant full access to all features below",action:T,onClick:S})})}),e[25]=T,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:_,capabilities:R}=v;return s.jsx(Ue,{title:_,children:s.jsx(Be,{children:R.map(p=>{const O=Bt(p,l,n);return s.jsx(Ve,{title:s.jsxs("span",{className:"flex items-center gap-1.5",children:[p.label,p.dangerous&&s.jsx(ft,{size:12,className:"text-amber-500 shrink-0"})]}),description:p.description,action:Ye(O,c,()=>o(p,O)),onClick:c?void 0:()=>o(p,O)},p.id)})})},_)})]})}),e[2]=n,e[3]=f,e[4]=i,e[5]=r,e[6]=c,e[7]=h,e[8]=l,e[9]=a}else a=e[9];return a}function Jt(t){return t.capabilities.length>0}function Wt(t){return t.tools}function es(t){return t.capabilities}const it={anthropic:"Anthropic",openrouter:"OpenRouter"},ts={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 ss(t,e){const n=t.indexOf("/"),l=n>0?t.slice(0,n):e;return l.startsWith("~")?l.slice(1):l}function ns(t){return ts[t]??it[t]??t}function ls(t){const e=t.indexOf(": ");return e>0&&e<32?t.slice(e+2):t}const rt=30;function os(t){const e=q.c(44),{connectionId:n,subProviderId:l,subProviderName:i,groupLogo:r,models:d,allConnectionModelIds:h,selectedModels:c,allowAllModels:g,allConnectionModelsSelected:f,onToggleModel:a,onExitAllowAll:x,readOnly:o,defaultExpanded:m}=t,[N,E]=$.useState(m),T=m||N,S=E,[C,v]=$.useState(rt);let _;e[0]!==f||e[1]!==g||e[2]!==c?(_=j=>g||f||c.includes("*")||c.includes(j),e[0]=f,e[1]=g,e[2]=c,e[3]=_):_=e[3];const R=_;let p;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],p=d.filter(j),e[4]=R,e[5]=d,e[6]=p}else p=e[6];const O=p.length;let I;if(e[9]!==h||e[10]!==g||e[11]!==n||e[12]!==O||e[13]!==T||e[14]!==r||e[15]!==R||e[16]!==d||e[17]!==x||e[18]!==a||e[19]!==o||e[20]!==l||e[21]!==i||e[22]!==C){const j=d.slice(0,C),u=d.length>C;let w;e[24]===Symbol.for("react.memo_cache_sentinel")?(w=()=>S(cs),e[24]=w):w=e[24];const A=r??tt[l]??st;let k;e[25]!==i||e[26]!==A?(k=s.jsx(ye,{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(ge,{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 M;e[36]!==T?(M=T?s.jsx(Lt,{size:16,className:"text-muted-foreground shrink-0"}):s.jsx(Pt,{size:16,className:"text-muted-foreground shrink-0"}),e[36]=T,e[37]=M):M=e[37];let z;e[38]!==M||e[39]!==B?(z=s.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[B,M]}),e[38]=M,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:w,children:[U,z]}),e[41]=z,e[42]=U,e[43]=y):y=e[43],I=s.jsxs("div",{className:"border border-border rounded-lg overflow-hidden bg-card",children:[y,T&&s.jsxs("div",{className:"border-t border-border bg-muted/20",children:[j.map(L=>{const Y=R(L.id),F=()=>{if(!o){if(g){x(n,h,L.id);return}a(n,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:F,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:as,children:o?s.jsx(pe,{children:s.jsxs(be,{children:[s.jsx(Te,{asChild:!0,children:s.jsx("div",{children:s.jsx(xe,{checked:Y,disabled:!0,onCheckedChange:rs})})}),s.jsx(Ee,{children:s.jsx("p",{children:"Built-in role permissions cannot be changed"})})]})}):s.jsx(xe,{checked:Y,onCheckedChange:F})})]},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(is),children:["Show more (",d.length-C," remaining)"]})]})]}),e[9]=h,e[10]=g,e[11]=n,e[12]=O,e[13]=T,e[14]=r,e[15]=R,e[16]=d,e[17]=x,e[18]=a,e[19]=o,e[20]=l,e[21]=i,e[22]=C,e[23]=I}else I=e[23];return I}function is(t){return t+rt}function rs(){}function as(t){return t.stopPropagation()}function cs(t){return!t}function ds(t){const e=q.c(33),{connection:n,selectedModels:l,allowAllModels:i,onToggleModel:r,onExitAllowAll:d,allConnectionModelsSelected:h,searchQuery:c,readOnly:g}=t,f=Mt(n.id);let a,x,o,m,N;if(e[0]!==h||e[1]!==i||e[2]!==n.id||e[3]!==n.label||e[4]!==n.providerId||e[5]!==d||e[6]!==r||e[7]!==f||e[8]!==g||e[9]!==c||e[10]!==l){N=Symbol.for("react.early_return_sentinel");e:{let S;e[16]!==n.label?(S=A=>({...A,id:A.modelId,provider:n.label}),e[16]=n.label,e[17]=S):S=e[17];const C=f.filter(hs).map(S),v=c.trim().toLowerCase(),_=v?C.filter(A=>A.title.toLowerCase().includes(v)||A.id.toLowerCase().includes(v)||A.provider?.toLowerCase().includes(v)):C;if(_.length===0){N=null;break e}const R=new Map;for(const A of _){const k=ss(A.id,n.providerId),G=R.get(k)??{models:[],logo:null};G.models.push({id:A.id,title:ls(A.title),logo:A.logo}),!G.logo&&A.logo&&(G.logo=A.logo),R.set(k,G)}const p=Array.from(R.entries()).map(fs).sort(us),O=p.length===1||v.length>0;o="flex flex-col gap-3";const I=tt[n.providerId]??st;let j;e[18]!==n.providerId||e[19]!==I?(j=s.jsx("img",{src:I,alt:n.providerId,className:"w-4 h-4 rounded-sm dark:bg-white dark:rounded-sm dark:p-px"}),e[18]=n.providerId,e[19]=I,e[20]=j):j=e[20];const u=it[n.providerId]??n.providerId;let w;e[21]!==u?(w=s.jsx("h4",{className:"text-sm font-medium",children:u}),e[21]=u,e[22]=w):w=e[22],e[23]!==w||e[24]!==j?(m=s.jsxs("div",{className:"flex items-center gap-2",children:[j,w]}),e[23]=w,e[24]=j,e[25]=m):m=e[25],a="flex flex-col gap-3",x=p.map(A=>s.jsx(os,{connectionId:n.id,subProviderId:A.id,subProviderName:A.name,groupLogo:A.logo,models:A.models,allConnectionModelIds:C.map(ms),selectedModels:l,allowAllModels:i,allConnectionModelsSelected:h,onToggleModel:r,onExitAllowAll:d,readOnly:g,defaultExpanded:O},A.id))}e[0]=h,e[1]=i,e[2]=n.id,e[3]=n.label,e[4]=n.providerId,e[5]=d,e[6]=r,e[7]=f,e[8]=g,e[9]=c,e[10]=l,e[11]=a,e[12]=x,e[13]=o,e[14]=m,e[15]=N}else a=e[11],x=e[12],o=e[13],m=e[14],N=e[15];if(N!==Symbol.for("react.early_return_sentinel"))return N;let E;e[26]!==a||e[27]!==x?(E=s.jsx("div",{className:a,children:x}),e[26]=a,e[27]=x,e[28]=E):E=e[28];let T;return e[29]!==o||e[30]!==m||e[31]!==E?(T=s.jsxs("div",{className:o,children:[m,E]}),e[29]=o,e[30]=m,e[31]=E,e[32]=T):T=e[32],T}function ms(t){return t.id}function us(t,e){return t.name.localeCompare(e.name)}function fs(t){const[e,n]=t;return{id:e,name:ns(e),logo:n.logo,models:n.models}}function hs(t,e,n){return n.findIndex(l=>l.modelId===t.modelId)===e}function gs(t){const e=q.c(35),{allowAllModels:n,modelSet:l,onAllowAllChange:i,onModelSetChange:r,readOnly:d,searchQuery:h}=t,c=d===void 0?!1:d,g=$.useDeferredValue(h),f=wt();let a;e[0]!==l||e[1]!==r?(a=(p,O)=>{const I=l[p]??[],j={...l};if(I.includes(O)){const u=I.filter(w=>w!==O);u.length===0?delete j[p]:j[p]=u}else j[p]=[...I,O];r(j)},e[0]=l,e[1]=r,e[2]=a):a=e[2];const x=a;let o;e[3]!==l||e[4]!==i||e[5]!==r?(o=(p,O,I)=>{i(!1),r({...l,[p]:O.filter(j=>j!==I)})},e[3]=l,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;e[7]!==N?(E=K("flex items-center justify-between px-4 py-3 rounded-lg border border-border bg-card",N),e[7]=N,e[8]=E):E=e[8];let T;e[9]!==n||e[10]!==i||e[11]!==r||e[12]!==c?(T=()=>{if(c)return;const p=!n;i(p),p&&r({})},e[9]=n,e[10]=i,e[11]=r,e[12]=c,e[13]=T):T=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]!==n||e[16]!==i||e[17]!==r||e[18]!==c?(C=s.jsx("div",{onClick:ps,children:c?s.jsx(pe,{children:s.jsxs(be,{children:[s.jsx(Te,{asChild:!0,children:s.jsx("div",{children:s.jsx(xe,{checked:n,disabled:!0,onCheckedChange:xs})})}),s.jsx(Ee,{children:s.jsx("p",{children:"Built-in role permissions cannot be changed"})})]})}):s.jsx(xe,{checked:n,onCheckedChange:p=>{i(p),p&&r({})}})}),e[15]=n,e[16]=i,e[17]=r,e[18]=c,e[19]=C):C=e[19];let v;e[20]!==E||e[21]!==T||e[22]!==C?(v=s.jsxs("div",{className:E,onClick:T,children:[S,C]}),e[20]=E,e[21]=T,e[22]=C,e[23]=v):v=e[23];let _;e[24]!==f||e[25]!==n||e[26]!==g||e[27]!==m||e[28]!==l||e[29]!==c||e[30]!==x?(_=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(p=>s.jsx($.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(ds,{connection:p,selectedModels:l[p.id]??[],allowAllModels:n,onToggleModel:x,onExitAllowAll:m,allConnectionModelsSelected:(l[p.id]??[]).includes("*"),searchQuery:g,readOnly:c})},p.id)),e[24]=f,e[25]=n,e[26]=g,e[27]=m,e[28]=l,e[29]=c,e[30]=x,e[31]=_):_=e[31];let R;return e[32]!==_||e[33]!==v?(R=s.jsxs("div",{className:"flex flex-col h-full overflow-auto gap-6 pb-6",children:[v,_]}),e[32]=_,e[33]=v,e[34]=R):R=e[34],R}function xs(){}function ps(t){return t.stopPropagation()}function bs(t){const e=q.c(52),{open:n,onOpenChange:l,selectedMemberIds:i,onAddMembers:r}=t,[d,h]=$.useState(""),c=$.useDeferredValue(d);let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=[],e[0]=g):g=e[0];const[f,a]=$.useState(g),{data:x}=nt();let o,m,N,E,T,S,C,v,_,R,p;if(e[1]!==x?.data?.members||e[2]!==c||e[3]!==r||e[4]!==l||e[5]!==n||e[6]!==f||e[7]!==d||e[8]!==i){const U=x?.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 M=U.filter(B);let z;e[22]!==r||e[23]!==l||e[24]!==f?(z=()=>{r(f),a([]),l(!1)},e[22]=r,e[23]=l,e[24]=f,e[25]=z):z=e[25],N=z,m=Qe,R=n,p=l,o=qe,v="sm:max-w-md p-0",e[26]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsxs(He,{className:"px-6 pt-6",children:[s.jsx(Ze,{children:"Add Members to Role"}),s.jsx(Xe,{children:"Select members to add to this role."})]}),e[26]=_):_=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(ve,{value:d,onChange:h,placeholder:"Search members...",className:"w-full"})}),e[27]=d,e[28]=C):C=e[28],E="flex-1 overflow-auto",T=M.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:M.map(y=>{const L=y.role!=="owner",Y=i.includes(y.id),F=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(we,{checked:F||Y,onCheckedChange:()=>{!L||Y||a(X=>X.includes(y.id)?X.filter(J=>J!==y.id):[...X,y.id])},disabled:!L||Y}),s.jsx(lt,{url:y.user?.image??void 0,fallback:ot(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(ge,{variant:"secondary",className:"shrink-0",children:"Owner"}),Y&&L&&s.jsx(ge,{variant:"outline",className:"shrink-0",children:"Added"})]},y.id)})}),e[1]=x?.data?.members,e[2]=c,e[3]=r,e[4]=l,e[5]=n,e[6]=f,e[7]=d,e[8]=i,e[9]=o,e[10]=m,e[11]=N,e[12]=E,e[13]=T,e[14]=S,e[15]=C,e[16]=v,e[17]=_,e[18]=R,e[19]=p}else o=e[9],m=e[10],N=e[11],E=e[12],T=e[13],S=e[14],C=e[15],v=e[16],_=e[17],R=e[18],p=e[19];let O;e[29]!==E||e[30]!==T?(O=s.jsx("div",{className:E,children:T}),e[29]=E,e[30]=T,e[31]=O):O=e[31];let I;e[32]!==O||e[33]!==S||e[34]!==C?(I=s.jsxs("div",{className:S,children:[C,O]}),e[32]=O,e[33]=S,e[34]=C,e[35]=I):I=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,w=f.length>0&&`(${f.length})`;let A;e[37]!==N||e[38]!==u||e[39]!==w?(A=s.jsxs(We,{className:"px-6 pb-6",children:[j,s.jsxs(et,{onClick:N,disabled:u,children:["Add ",w]})]}),e[37]=N,e[38]=u,e[39]=w,e[40]=A):A=e[40];let k;e[41]!==o||e[42]!==I||e[43]!==A||e[44]!==v||e[45]!==_?(k=s.jsxs(o,{className:v,children:[_,I,A]}),e[41]=o,e[42]=I,e[43]=A,e[44]=v,e[45]=_,e[46]=k):k=e[46];let G;return e[47]!==m||e[48]!==k||e[49]!==R||e[50]!==p?(G=s.jsx(m,{open:R,onOpenChange:p,children:k}),e[47]=m,e[48]=k,e[49]=R,e[50]=p,e[51]=G):G=e[51],G}function Ts(t){const e=q.c(29),{memberIds:n,onMemberIdsChange:l,readOnly:i,readOnlyMessage:r,searchQuery:d,addMemberDialogOpen:h,onAddMemberDialogOpenChange:c}=t,g=i===void 0?!1:i,f=r===void 0?"Owner membership cannot be changed":r,a=$.useDeferredValue(d),{data:x}=nt();let o,m,N;if(e[0]!==x?.data?.members||e[1]!==a||e[2]!==n||e[3]!==l||e[4]!==g||e[5]!==f||e[6]!==d){const v=x?.data?.members??[];let _;e[10]!==n?(_=I=>n.includes(I.id),e[10]=n,e[11]=_):_=e[11];const R=v.filter(_);let p;e[12]!==a?(p=I=>{const j=a.toLowerCase();return I.user?.name?.toLowerCase().includes(j)||I.user?.email?.toLowerCase().includes(j)},e[12]=a,e[13]=p):p=e[13];const O=R.filter(p);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(I=>s.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-muted/30",children:[s.jsx(lt,{url:I.user?.image??void 0,fallback:ot(I.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:I.user?.name||"Unknown"}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:I.user?.email})]}),g?s.jsx(pe,{children:s.jsxs(be,{children:[s.jsx(Te,{asChild:!0,children:s.jsx("div",{children:s.jsx(ne,{variant:"ghost",size:"sm",disabled:!0,children:s.jsx(ze,{size:16})})})}),s.jsx(Ee,{children:s.jsx("p",{children:f})})]})}):s.jsx(ne,{variant:"ghost",size:"sm",onClick:()=>l(n.filter(j=>j!==I.id)),children:s.jsx(ze,{size:16})})]},I.id))}),e[0]=x?.data?.members,e[1]=a,e[2]=n,e[3]=l,e[4]=g,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;e[14]!==o||e[15]!==m?(E=s.jsx("div",{className:o,children:m}),e[14]=o,e[15]=m,e[16]=E):E=e[16];let T;e[17]!==n||e[18]!==l?(T=v=>l([...n,...v]),e[17]=n,e[18]=l,e[19]=T):T=e[19];let S;e[20]!==h||e[21]!==n||e[22]!==c||e[23]!==T?(S=s.jsx(bs,{open:h,onOpenChange:c,selectedMemberIds:n,onAddMembers:T}),e[20]=h,e[21]=n,e[22]=c,e[23]=T,e[24]=S):S=e[24];let C;return e[25]!==N||e[26]!==E||e[27]!==S?(C=s.jsxs("div",{className:N,children:[E,S]}),e[25]=N,e[26]=E,e[27]=S,e[28]=C):C=e[28],C}function Es(t){const e=q.c(3);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=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]=n):n=e[0];let l;return e[1]!==t?(l=s.jsx($.Suspense,{fallback:n,children:s.jsx(Ts,{...t})}),e[1]=t,e[2]=l):l=e[2],l}const _s={owner:[],admin:[],user:[]};function Is(t,e,n,l){const i=t==="owner"||t==="admin";return{role:{id:n?.id,slug:t,label:t.charAt(0).toUpperCase()+t.slice(1)},allowAllStaticPermissions:i,staticPermissions:_s[t],toolSet:{},allowAllModels:!0,modelSet:{},memberIds:e.filter(r=>r.role===t).map(r=>r.id)}}function Ns(t,e,n){const l=t.permission||{},i=l.self||[],r=i.includes("*"),d=r?[]:i.filter(a=>a!=="*"),h={};for(const[a,x]of Object.entries(l))if(!(a==="self"||a==="models"))if(a==="*")for(const o of n)h[o.id]=x.includes("*")?o.tools?.map(m=>m.name)??[]:x;else{const o=n.find(m=>m.id===a);o&&(h[a]=x.includes("*")?o.tools?.map(m=>m.name)??[]:x)}const c=l.models||[],g=c.length===0||c.includes("*:*"),f={};if(!g)for(const a of c){const x=a.indexOf(":");if(x===-1)continue;const o=a.slice(0,x),m=a.slice(x+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:g,modelSet:f,memberIds:e.filter(a=>a.role===t.role).map(a=>a.id)}}function Ss(t,e){const n={};t.allowAllStaticPermissions?n.self=["*"]:t.staticPermissions.length>0&&(n.self=t.staticPermissions);for(const[l,i]of Object.entries(t.toolSet))if(i.length>0){const d=e.find(h=>h.id===l)?.tools?.map(h=>h.name)??[];n[l]=d.length>0&&d.every(h=>i.includes(h))?["*"]:i}if(t.allowAllModels)n.models=["*:*"];else{const l=[];for(const[i,r]of Object.entries(t.modelSet))for(const d of r)l.push(`${i}:${d}`);l.length>0&&(n.models=l)}return n}function Cs(t,e,n){return t.kind==="builtin"?Is(t.role,e,void 0):t.kind==="custom"?Ns(t.role,e,n):{role:{id:void 0,slug:void 0,label:""},allowAllStaticPermissions:!1,staticPermissions:[],toolSet:{},allowAllModels:!0,modelSet:{},memberIds:[]}}function As(t){const e=q.c(6),{readOnly:n,readOnlyMessage:l,onOpen:i}=t,r=l===void 0?"Owner membership cannot be changed":l;if(n){let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Te,{asChild:!0,children:s.jsx("div",{children:s.jsxs(ne,{variant:"outline",size:"sm",disabled:!0,children:[s.jsx(Ae,{size:16}),"Add Member"]})})}),e[0]=c):c=e[0];let g;return e[1]!==r?(g=s.jsx(pe,{children:s.jsxs(be,{children:[c,s.jsx(Ee,{children:s.jsx("p",{children:r})})]})}),e[1]=r,e[2]=g):g=e[2],g}let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Ae,{size:16}),e[3]=d):d=e[3];let h;return e[4]!==i?(h=s.jsxs(ne,{variant:"outline",size:"sm",onClick:i,children:[d,"Add Member"]}),e[4]=i,e[5]=h):h=e[5],h}function Rs(t){const e=q.c(14),{locator:n}=Ne(),l=je(),i=yt();let r;e[0]!==n?(r=re.members(n),e[0]=n,e[1]=r):r=e[1];let d;e[2]!==l?(d=()=>l.organization.listMembers(),e[2]=l,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:g}=Re(h);if(g||!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 x;return e[10]!==i||e[11]!==a||e[12]!==t?(x=s.jsx(Os,{...t,members:a,connections:i}),e[10]=i,e[11]=a,e[12]=t,e[13]=x):x=e[13],x}function Os({target:t,onBack:e,onSaved:n,members:l,connections:i}){const{locator:r}=Ne(),d=je(),h=$e(),c=t.kind==="builtin",g=t.kind==="builtin"&&t.role==="owner",f=t.kind==="new",[a,x]=$.useState(c?"org":"mcp"),o=mt({resolver:ut(Zt),defaultValues:Cs(t,l,i)}),m=o.formState.isValid,N=o.formState.isDirty,E=Fe({mutationFn:async u=>{const w=Ss(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 M=l.filter(L=>L.role===(B??U)).map(L=>L.id),z=u.memberIds.filter(L=>!M.includes(L)),y=M.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,M=U!==B,z=await d.organization.updateRole({roleId:u.role.id,data:{permission:w,...M?{roleName:U}:{}}});if(z?.error)throw new Error(z.error.message??"Something went wrong");return await G(M?U:B,M?B:void 0),M?{...u,role:{...u.role,slug:U}}:u}else{const U=await d.organization.createRole({role:A,permission:w});if(U?.error)throw new Error(U.error.message??"Something went wrong");for(const B of u.memberIds){const M=await d.organization.updateMemberRole({memberId:B,role:[A]});if(M?.error)throw new Error(M.error.message)}return{...u,role:{...u.role,id:U.data?.roleData?.id,slug:A}}}},onSuccess:(u,w)=>{h.invalidateQueries({queryKey:re.members(r)}),h.invalidateQueries({queryKey:re.organizationRoles(r)});const A=!w.role.id&&!w.role.slug,k=w.role.slug==="owner"&&!w.role.id;Oe(k?"role_members_updated":A?"role_created":"role_updated",{role_slug:w.role.slug??null}),he.success(k?"Members updated successfully!":A?"Role created successfully!":"Role updated successfully!"),o.reset(u),n(u.role.id)},onError:u=>{he.error(u instanceof Error?u.message:"Failed to save role")}}),T=o.handleSubmit(u=>{if(!u.role.label.trim()){he.error("Role name is required"),o.setFocus("role.label");return}E.mutate(u)}),S=!g,C=t.kind==="builtin"?t.role.charAt(0).toUpperCase()+t.role.slice(1):t.kind==="custom"?t.role.label:"",v=[...g?[]:[{id:"mcp",label:"MCP Permissions"}],{id:"org",label:"Organization Permissions"},{id:"models",label:"Models"},{id:"members",label:"Members"}],[_,R]=$.useState(""),[p,O]=$.useState(!1),I=u=>{x(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(ne,{variant:"outline",size:"sm",onClick:e,disabled:E.isPending,children:"Cancel"}),s.jsx(ne,{size:"sm",onClick:T,disabled:E.isPending||!m||!N,children:E.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"?Ht(t.role):qt(o.watch("role.label")))}),g&&s.jsx(Ke,{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:()=>I(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(ve,{value:_,onChange:R,placeholder:j[a]??"Search...",className:"w-full md:w-[375px]"}),a==="members"&&s.jsx(As,{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"&&!g&&s.jsx(Kt,{toolSet:o.watch("toolSet"),onToolSetChange:u=>o.setValue("toolSet",u,{shouldDirty:!0}),searchQuery:_}),a==="org"&&s.jsx(Xt,{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:g,searchQuery:_}),a==="models"&&s.jsx(gs,{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:g,searchQuery:_}),a==="members"&&s.jsx(Es,{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:_,addMemberDialogOpen:p,onAddMemberDialogOpenChange:O})]})})]})})}function js(t){return t.kind==="builtin"?`builtin-${t.role}`:t.kind==="custom"?`custom-${t.role.id}`:"new"}function vs(t){const e=q.c(6),{area:n,children:l}=t,{isPrivileged:i,loading:r,error:d}=Dt();let h;return e[0]!==n||e[1]!==l||e[2]!==d||e[3]!==i||e[4]!==r?(h=s.jsx(kt,{granted:i,loading:r,error:d,area:n,children:l}),e[0]=n,e[1]=l,e[2]=d,e[3]=i,e[4]=r,e[5]=h):h=e[5],h}const ys=[{role:"owner",label:"Owner",color:"bg-red-500"},{role:"admin",label:"Admin",color:"bg-blue-500"},{role:"user",label:"User",color:"bg-green-500"}],Ce=["bg-red-500","bg-orange-500","bg-amber-500","bg-yellow-500","bg-lime-500","bg-green-500","bg-emerald-500","bg-teal-500","bg-cyan-500","bg-sky-500","bg-blue-500","bg-indigo-500","bg-violet-500","bg-purple-500","bg-fuchsia-500","bg-pink-500","bg-rose-500"];function ws(t){if(!t)return"bg-neutral-400";let e=0;for(let l=0;l<t.length;l++){const i=t.charCodeAt(l);e=(e<<5)-e+i,e=e&e}const n=Math.abs(e)%Ce.length;return Ce[n]??Ce[0]}const Ms={owner:"bg-red-500",admin:"bg-blue-500",user:"bg-green-500"};function Ls(t,e){return e?Ms[t]??"bg-neutral-400":ws(t)}function Ps(){const t=q.c(77),[e,n]=$.useState(""),[l,i]=$.useState(null),r=gt();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(),g=je(),f=$e(),{customRoles:a,refetch:x}=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 E=N;let T;t[5]!==c?(T=re.members(c),t[5]=c,t[6]=T):T=t[6];let S;t[7]!==g?(S=()=>g.organization.listMembers(),t[7]=g,t[8]=S):S=t[8];let C;t[9]!==T||t[10]!==S?(C={queryKey:T,queryFn:S},t[9]=T,t[10]=S,t[11]=C):C=t[11];const{data:v}=Re(C);let _;t[12]!==v?.data?.members?(_=v?.data?.members??[],t[12]=v?.data?.members,t[13]=_):_=t[13];const R=_;let p;t[14]!==R?(p=P=>R.filter(V=>V.role===P).length,t[14]=R,t[15]=p):p=t[15];const O=p;let I;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=ys.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 at=a.map(ae);if(I=[...V,...at],e){const ce=e.toLowerCase();I=I.filter(ct=>ct.role.label.toLowerCase().includes(ce))}t[16]=a,t[17]=O,t[18]=e,t[19]=I}else I=t[19];let j;t[24]!==g?(j=async P=>{const V=await g.organization.deleteRole({roleId:P});if(V?.error)throw new Error(V.error.message);return V?.data},t[24]=g,t[25]=j):j=t[25];const u=Fe({mutationFn:j,onSuccess:(P,V)=>{Oe("role_deleted",{role_id:V}),f.invalidateQueries({queryKey:re.members(c)}),f.invalidateQueries({queryKey:re.organizationRoles(c)}),he.success("Role deleted successfully!"),x(),E?.kind==="custom"&&E.role.id===V&&m(void 0)},onError:zs});let w,A,k,G;t[26]===Symbol.for("react.memo_cache_sentinel")?(G={id:"role",header:"Role",render:Vs,cellClassName:"flex-1 min-w-0",sortable:!0},w={id:"type",header:"Type",render:Bs,cellClassName:"w-28 shrink-0"},A={id:"permissions",header:"Permissions",render:Us,cellClassName:"flex-1 min-w-0"},k={id:"members",header:"Members",render:Gs,cellClassName:"w-24 shrink-0"},t[26]=w,t[27]=A,t[28]=k,t[29]=G):(w=t[26],A=t[27],k=t[28],G=t[29]);let U;t[30]===Symbol.for("react.memo_cache_sentinel")?(U=[G,w,A,k,{id:"actions",header:"",render:P=>P.kind==="builtin"?null:s.jsxs(Tt,{children:[s.jsx(Et,{asChild:!0,children:s.jsx(ne,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:ks,children:s.jsx(Nt,{size:16})})}),s.jsx(_t,{align:"end",onClick:Ds,children:s.jsxs(It,{variant:"destructive",onClick:()=>{const V=P.role;V.id&&i({id:V.id,label:V.label})},children:[s.jsx(St,{size:16}),"Delete"]})})]}),cellClassName:"w-12 shrink-0"}],t[30]=U):U=t[30];const B=U;let M;t[31]!==m?(M=P=>{if(P.kind==="builtin")m(`builtin-${P.role.role}`);else{const V=P.role;m(V.id)}},t[31]=m,t[32]=M):M=t[32];const z=M;if(E){let P;t[33]!==m?(P=()=>m(void 0),t[33]=m,t[34]=P):P=t[34];let V;return t[35]!==x||t[36]!==m?(V=()=>{x(),m(void 0)},t[35]=x,t[36]=m,t[37]=V):V=t[37],s.jsx(Rs,{target:E,onBack:P,onSaved:V},js(E))}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"&&(n(""),P.target.blur())},t[39]=L):L=t[39];let Y;t[40]!==e?(Y=s.jsx(ve,{value:e,onChange:n,placeholder:"Search roles...",className:"w-full md:w-[375px]",onKeyDown:L}),t[40]=e,t[41]=Y):Y=t[41];let F;t[42]!==m?(F=()=>m("new"),t[42]=m,t[43]=F):F=t[43];let X;t[44]===Symbol.for("react.memo_cache_sentinel")?(X=s.jsx(Ae,{size:16}),t[44]=X):X=t[44];let J;t[45]!==F?(J=s.jsxs(ne,{onClick:F,children:[X,"Create Role"]}),t[45]=F,t[46]=J):J=t[46];let le;t[47]!==Y||t[48]!==J?(le=s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[Y,J]}),t[47]=Y,t[48]=J,t[49]=le):le=t[49];let oe;t[50]!==e?(oe=e?s.jsx(Ge,{title:"No roles found",description:`No roles match "${e}"`}):s.jsx(Ge,{title:"No roles",description:"Create a role to get started."}),t[50]=e,t[51]=oe):oe=t[51];let ie;t[52]!==I||t[53]!==B||t[54]!==z||t[55]!==oe?(ie=s.jsx(bt,{columns:B,data:I,isLoading:!1,onRowClick:z,emptyState:oe}),t[52]=I,t[53]=B,t[54]=z,t[55]=oe,t[56]=ie):ie=t[56];let b;t[57]!==le||t[58]!==ie?(b=s.jsx(te.Content,{children:s.jsx(te.Body,{children:s.jsxs("div",{className:"flex flex-col gap-6",children:[y,le,ie]})})}),t[57]=le,t[58]=ie,t[59]=b):b=t[59];const D=l!==null;let Q;t[60]===Symbol.for("react.memo_cache_sentinel")?(Q=P=>!P&&i(null),t[60]=Q):Q=t[60];let H;t[61]===Symbol.for("react.memo_cache_sentinel")?(H=s.jsx(Ze,{children:"Delete Role"}),t[61]=H):H=t[61];const W=l?.label;let Z;t[62]!==W?(Z=s.jsxs(He,{children:[H,s.jsxs(Xe,{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]!==l?(de=s.jsxs(We,{children:[ee,s.jsx(et,{onClick:()=>{l?.id&&u.mutate(l.id),i(null)},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),t[65]=u,t[66]=l,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(Qe,{open:D,onOpenChange:Q,children:me}),t[71]=D,t[72]=me,t[73]=ue):ue=t[73];let _e;return t[74]!==b||t[75]!==ue?(_e=s.jsxs(te,{children:[b,ue]}),t[74]=b,t[75]=ue,t[76]=_e):_e=t[76],_e}function Ds(t){return t.stopPropagation()}function ks(t){return t.stopPropagation()}function Gs(t){return s.jsx("span",{className:"text-sm text-foreground",children:t.role.memberCount})}function Us(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,n=[];return e.allowsAllStaticPermissions?n.push("Full org access"):e.staticPermissionCount&&e.staticPermissionCount>0&&n.push(`${e.staticPermissionCount} org perm${e.staticPermissionCount!==1?"s":""}`),e.allowsAllConnections?n.push("All connections"):e.connectionCount&&e.connectionCount>0&&n.push(`${e.connectionCount} connection${e.connectionCount!==1?"s":""}`),s.jsx("span",{className:"text-sm text-muted-foreground truncate",children:n.length>0?n.join(", "):"No permissions"})}function Bs(t){return t.kind==="builtin"?s.jsx(ge,{variant:"secondary",className:"text-xs",children:"Built-in"}):s.jsx(ge,{variant:"outline",className:"text-xs",children:"Custom"})}function Vs(t){return s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:K("size-2.5 rounded-full shrink-0",Ls(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(Ke,{size:12,className:"text-muted-foreground shrink-0"})]})}function zs(t,e){Oe("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 Ys(){const t=q.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 n;return t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(ht,{fallback:e,children:s.jsx($.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(Ps,{})})}),t[1]=n):n=t[1],n}function ul(){const t=q.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(vs,{area:"roles",children:s.jsx(Ys,{})}),t[0]=e):e=t[0],e}export{ul as default};
@@ -1 +1 @@
1
- import{c as m,j as s,i as o}from"./index-I8Uum3Jx.js";import{i as c}from"./AlertCircle-VcwplCRi.js";import{i as l}from"./ChevronUp-HJUE3-BD.js";function u(r){const e=m.c(3),{isPending:a,isError:n}=r;if(n){let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-destructive",children:[s.jsx(c,{size:13}),"Couldn't save"]}),e[0]=t):t=e[0],t}if(a){let t;return e[1]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[s.jsx(o,{size:13,className:"animate-spin"}),"Saving…"]}),e[1]=t):t=e[1],t}let i;return e[2]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground/70",children:[s.jsx(l,{size:13}),"Saved"]}),e[2]=i):i=e[2],i}export{u as S};
1
+ import{c as m,j as s,i as o}from"./index-tHbNbVHJ.js";import{i as c}from"./AlertCircle-Bgopcarv.js";import{i as l}from"./ChevronUp-Cr2g1GDa.js";function u(r){const e=m.c(3),{isPending:a,isError:n}=r;if(n){let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-destructive",children:[s.jsx(c,{size:13}),"Couldn't save"]}),e[0]=t):t=e[0],t}if(a){let t;return e[1]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[s.jsx(o,{size:13,className:"animate-spin"}),"Saving…"]}),e[1]=t):t=e[1],t}let i;return e[2]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground/70",children:[s.jsx(l,{size:13}),"Saved"]}),e[2]=i):i=e[2],i}export{u as S};