decocms 3.68.0 → 3.69.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (217) hide show
  1. package/dist/client/assets/{AlertCircle-DhaQx9Mx.js → AlertCircle-Dnqz3IxM.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-CfMwsozc.js → ArrowUpRight-B2NXgTf2.js} +1 -1
  3. package/dist/client/assets/{CheckCircle-DTbDatzD.js → CheckCircle-D9OslXZP.js} +1 -1
  4. package/dist/client/assets/{ChevronDown-6sFYQ_lK.js → ChevronDown-BldydMJ0.js} +1 -1
  5. package/dist/client/assets/{ChevronLeft-8zvGG53e.js → ChevronLeft-CXmppBJO.js} +1 -1
  6. package/dist/client/assets/{ChevronRight-BdMquS3m.js → ChevronRight-BsknZQE_.js} +1 -1
  7. package/dist/client/assets/{ChevronUp-BNOOOsT2.js → ChevronUp-CjDXfs3K.js} +1 -1
  8. package/dist/client/assets/{DotsVertical-DQ-WKmA2.js → DotsVertical-Ci1mVPsb.js} +1 -1
  9. package/dist/client/assets/{Eye-B4uYcIta.js → Eye-DifA9NHq.js} +1 -1
  10. package/dist/client/assets/{FilterLines-DCvNnP3i.js → FilterLines-CV07u96M.js} +1 -1
  11. package/dist/client/assets/{Globe01-C7fVaUrg.js → Globe01-CMUrlGmF.js} +1 -1
  12. package/dist/client/assets/{Globe04-Bwx3UG2x.js → Globe04-BplUDurZ.js} +1 -1
  13. package/dist/client/assets/{HardDrive-BOa3mtdo.js → HardDrive-B6V7BYZB.js} +1 -1
  14. package/dist/client/assets/{Key01-B-9ep-9Z.js → Key01-DGn_JEBu.js} +1 -1
  15. package/dist/client/assets/{LayoutLeft-XZqot3mq.js → LayoutLeft-BI32Ru47.js} +1 -1
  16. package/dist/client/assets/{LinkExternal01-iioOg4ap.js → LinkExternal01-DwIqUvLe.js} +1 -1
  17. package/dist/client/assets/{Monitor01-DL3Tirrd.js → Monitor01-C-tOv611.js} +1 -1
  18. package/dist/client/assets/{Palette-pv0gmxnS.js → Palette-pjBymHRy.js} +1 -1
  19. package/dist/client/assets/{Play-DXtyMrcP.js → Play-BEuZCxsN.js} +1 -1
  20. package/dist/client/assets/{Plus-J1K3Rh3s.js → Plus-DHJbi1i9.js} +1 -1
  21. package/dist/client/assets/{SearchMd-CjaRzuTt.js → SearchMd-yvCGxslh.js} +1 -1
  22. package/dist/client/assets/{Settings02-By0Jzp86.js → Settings02-BcW_Yd93.js} +1 -1
  23. package/dist/client/assets/{Shield01-M8Hvv7sS.js → Shield01-DXFrycnj.js} +1 -1
  24. package/dist/client/assets/{Star01-_Kd09vMY.js → Star01-DxJIcjLz.js} +1 -1
  25. package/dist/client/assets/{Stars01-DyLJc1qm.js → Stars01-Dr_rOBxK.js} +1 -1
  26. package/dist/client/assets/{Stars02-CDIgaXAV.js → Stars02-CB3UMWzf.js} +1 -1
  27. package/dist/client/assets/{Sun-TGwF56wV.js → Sun-CTchQz03.js} +1 -1
  28. package/dist/client/assets/{SwitchHorizontal01-X5LMtCou.js → SwitchHorizontal01-Ca_h3hG5.js} +1 -1
  29. package/dist/client/assets/{Tool01-Dw4_QC3_.js → Tool01-B4m3Gnpd.js} +1 -1
  30. package/dist/client/assets/{Trash01-Cib_Sg7t.js → Trash01-BDNQcRq9.js} +1 -1
  31. package/dist/client/assets/{Upload01-CJqoFPBG.js → Upload01-CuyZwIAy.js} +1 -1
  32. package/dist/client/assets/{User01-BywBiT-b.js → User01-kj3Bxvgl.js} +1 -1
  33. package/dist/client/assets/{Users01-CDCapXFR.js → Users01-DM4FmEoT.js} +1 -1
  34. package/dist/client/assets/{Users03-4g5nbjFJ.js → Users03-CJ4lkyfr.js} +1 -1
  35. package/dist/client/assets/{X-BL2gdXEj.js → X-Botvp-t_.js} +1 -1
  36. package/dist/client/assets/{XCircle-CCiKaJ__.js → XCircle-CpovmLEO.js} +1 -1
  37. package/dist/client/assets/{XClose-BtRDneKm.js → XClose-CnYr1LOo.js} +1 -1
  38. package/dist/client/assets/{Zap-B8ZLhQFM.js → Zap-8NdOr1pq.js} +1 -1
  39. package/dist/client/assets/{ZapSquare-J9sfjhfh.js → ZapSquare-ChOMpHGM.js} +1 -1
  40. package/dist/client/assets/{ZoomOut-DCv2Tq6d.js → ZoomOut-DYeUJTmS.js} +1 -1
  41. package/dist/client/assets/{access-gate-DFiTys6s.js → access-gate-lRgnLhCg.js} +1 -1
  42. package/dist/client/assets/{add-section-modal-ClOPZlnc.js → add-section-modal-CZwFVJh7.js} +1 -1
  43. package/dist/client/assets/{agent-icon-Cf9b4Ru9.js → agent-icon-B1KjkGhC.js} +1 -1
  44. package/dist/client/assets/{agents-list-C5u1JJrt.js → agents-list-BeGasDr4.js} +1 -1
  45. package/dist/client/assets/{ai-providers-5s3h35FZ.js → ai-providers-DhEaZvB4.js} +1 -1
  46. package/dist/client/assets/{alert-DGGvXsmf.js → alert-DVl9GMhN.js} +1 -1
  47. package/dist/client/assets/{alert-dialog-C20YoJ0a.js → alert-dialog-DvJDYQsM.js} +1 -1
  48. package/dist/client/assets/app-editor-Dd12zl9_.js +1 -0
  49. package/dist/client/assets/{auth-RitCYkp6.js → auth-DA6X7KBB.js} +1 -1
  50. package/dist/client/assets/{auth-catchall-DwJMWiTa.js → auth-catchall-BljhiRu2.js} +1 -1
  51. package/dist/client/assets/{auth-split-layout-BUqeR5HU.js → auth-split-layout-DeC-35_z.js} +1 -1
  52. package/dist/client/assets/{automation-list-row-BGAGsR0l.js → automation-list-row-BIiojY8I.js} +1 -1
  53. package/dist/client/assets/{automation-runs-Dzg3ROYw.js → automation-runs-CHVaaxN6.js} +1 -1
  54. package/dist/client/assets/{automations-CxAwu4Kg.js → automations-BZ212IOj.js} +1 -1
  55. package/dist/client/assets/{avatar-Nw1x5eGz.js → avatar-D7wKrjgH.js} +1 -1
  56. package/dist/client/assets/{badge-CuCfPx-y.js → badge-Rj4w6Y9D.js} +1 -1
  57. package/dist/client/assets/{block-document-ZFzIRxrN.js → block-document-Dr1GbIJR.js} +1 -1
  58. package/dist/client/assets/{brand-context-DzyWDcCk.js → brand-context-BHLNO4fC.js} +1 -1
  59. package/dist/client/assets/{buckets-XQexDwjp.js → buckets-C3GJftau.js} +1 -1
  60. package/dist/client/assets/{calendar-CKrH5d_Q.js → calendar-BETEvsL1.js} +1 -1
  61. package/dist/client/assets/{capability-load-error-gogxAwFW.js → capability-load-error-Caduk_d2.js} +1 -1
  62. package/dist/client/assets/{card-yVmBUFAg.js → card-BtNxdFil.js} +1 -1
  63. package/dist/client/assets/category-editor-D8faJ1-Q.js +1 -0
  64. package/dist/client/assets/{chat-context-WtXAdZJ4.js → chat-context-B_U1gcun.js} +1 -1
  65. package/dist/client/assets/{checkbox-BMArZ_ix.js → checkbox-CzoSEbjC.js} +1 -1
  66. package/dist/client/assets/{cli-auth-success-Cm2MX1PH.js → cli-auth-success-BaHruqex.js} +1 -1
  67. package/dist/client/assets/{collection-detail-CdcHUbmk.js → collection-detail-Dlkc-Hxo.js} +1 -1
  68. package/dist/client/assets/{collection-display-button-Deigak_t.js → collection-display-button-4X_RKgcc.js} +1 -1
  69. package/dist/client/assets/{collection-search-CDaYX9FR.js → collection-search-BSHmVsv0.js} +1 -1
  70. package/dist/client/assets/{collection-tabs-dRuAELuw.js → collection-tabs-CghGabs6.js} +1 -1
  71. package/dist/client/assets/{command-P8Wd0xDH.js → command-CYqVDIDi.js} +1 -1
  72. package/dist/client/assets/{connect-desktop-dialog-p3tqZ2_6.js → connect-desktop-dialog-Cq5se3ri.js} +1 -1
  73. package/dist/client/assets/{connection-card-CCMuozOG.js → connection-card-CzT4sqi7.js} +1 -1
  74. package/dist/client/assets/{connection-detail-JjdH17H6.js → connection-detail-BCjmmJh1.js} +1 -1
  75. package/dist/client/assets/{connection-form-helpers-BU4nsydd.js → connection-form-helpers-CuaSwKDp.js} +1 -1
  76. package/dist/client/assets/{connections-xjFDA3iN.js → connections-BEh7d4ax.js} +1 -1
  77. package/dist/client/assets/{context-menu-XATcg7cH.js → context-menu-CtPFsuQw.js} +1 -1
  78. package/dist/client/assets/{decopilot-CJM86E2F.js → decopilot-Bw9nv9Fa.js} +1 -1
  79. package/dist/client/assets/{decopilot-sse-pool-BVuJ_7ML.js → decopilot-sse-pool-DdZSTixQ.js} +1 -1
  80. package/dist/client/assets/{dialog-jhtlYWQH.js → dialog-BMBVdX8K.js} +1 -1
  81. package/dist/client/assets/{domain-settings-D18yHtBo.js → domain-settings-GHKCO0j2.js} +1 -1
  82. package/dist/client/assets/{drawer-Ca9qnNLt.js → drawer-TLQRWcN-.js} +1 -1
  83. package/dist/client/assets/{dropdown-menu-B4AhYSKY.js → dropdown-menu-gXn3xVef.js} +1 -1
  84. package/dist/client/assets/{empty-state-Cz0bAkoo.js → empty-state-SvMp_sYN.js} +1 -1
  85. package/dist/client/assets/{extract-connection-data-CObOyXJ4.js → extract-connection-data-BsbTS0uC.js} +1 -1
  86. package/dist/client/assets/{file-explorer-D0NTDf_o.js → file-explorer-C5eBRtME.js} +1 -1
  87. package/dist/client/assets/{file-type-icon-CzNWenEv.js → file-type-icon-DURyeK9L.js} +1 -1
  88. package/dist/client/assets/{files-DMaBuySQ.js → files-B43hGcq-.js} +1 -1
  89. package/dist/client/assets/{form-rLORGBZw.js → form-CdGhzS_x.js} +1 -1
  90. package/dist/client/assets/{general-BvPRQvS3.js → general-D01YsmbR.js} +1 -1
  91. package/dist/client/assets/{github-repo-picker-Cu20X1Oj.js → github-repo-picker-Db3xiFzy.js} +1 -1
  92. package/dist/client/assets/{hooks-D14HehpA.js → hooks-DlDryoZW.js} +1 -1
  93. package/dist/client/assets/{image-field-LMawai9Y.js → image-field-ZYWbFFqt.js} +1 -1
  94. package/dist/client/assets/{import-from-deco-dialog-BCZEU51-.js → import-from-deco-dialog-wt_cQutp.js} +1 -1
  95. package/dist/client/assets/{index-DVtTwolW.js → index-B66xjk-i.js} +1 -1
  96. package/dist/client/assets/{index-kcIuDE6u.js → index-BW5f_EaT.js} +22 -22
  97. package/dist/client/assets/{index-Bx5YRZw3.js → index-C35Pm7iN.js} +1 -1
  98. package/dist/client/assets/{index-C3gL9St4.js → index-COlSsy5J.js} +3 -3
  99. package/dist/client/assets/{index-CQ_hnxd_.js → index-C_H1H79r.js} +1 -1
  100. package/dist/client/assets/{index-Bf1YdrMc.js → index-CkC7ek4r.js} +1 -1
  101. package/dist/client/assets/{index-CK3Q6Lxn.js → index-CvuV8zWk.js} +1 -1
  102. package/dist/client/assets/{index-C2-nEDLj.js → index-D0cczQd_.js} +1 -1
  103. package/dist/client/assets/{index-DqifP8kh.js → index-D4WUCfu0.js} +1 -1
  104. package/dist/client/assets/{index-B9_waAhV.js → index-DEanDL8Y.js} +1 -1
  105. package/dist/client/assets/{index-Df7da_i0.js → index-DWvgpCdb.js} +1 -1
  106. package/dist/client/assets/{index-CBOm8PQT.js → index-H-_VOpOu.js} +1 -1
  107. package/dist/client/assets/{index-CaOvTlCR.js → index-dlN4JEF9.js} +1 -1
  108. package/dist/client/assets/{index-redirect-DD0m-QdY.js → index-redirect-CDQ9iDF3.js} +1 -1
  109. package/dist/client/assets/{index-i_JkZB27.js → index-swPX_OFH.js} +1 -1
  110. package/dist/client/assets/{input-BvSXiwAq.js → input-CuVtlRv5.js} +1 -1
  111. package/dist/client/assets/{integration-icon-BcoSEnuB.js → integration-icon-RqT66_6U.js} +1 -1
  112. package/dist/client/assets/{label-vllYe6cM.js → label-BCRIEPd0.js} +1 -1
  113. package/dist/client/assets/{login-DAeVvDXf.js → login-ByPZpD-o.js} +1 -1
  114. package/dist/client/assets/{mcp-oauth-BswvczAL.js → mcp-oauth-kSTvScdZ.js} +1 -1
  115. package/dist/client/assets/{members-CqwytKDG.js → members-AD1fVrNE.js} +1 -1
  116. package/dist/client/assets/{monaco-editor-DFjHxwB9.js → monaco-editor-DNLiFjHn.js} +1 -1
  117. package/dist/client/assets/{monitoring-stats-row-DzD-p2bQ.js → monitoring-stats-row-Bsctnbru.js} +1 -1
  118. package/dist/client/assets/{oauth-callback-tznqb9vz.js → oauth-callback-B6I9yHDk.js} +1 -1
  119. package/dist/client/assets/{oauth-callback-ai-provider-BrGqlBMJ.js → oauth-callback-ai-provider-D0iCPw3h.js} +1 -1
  120. package/dist/client/assets/{onboarding-BjK9ZeXA.js → onboarding-1ssRVacT.js} +1 -1
  121. package/dist/client/assets/{org-install-C_FZDV9k.js → org-install-r5xxUZ8-.js} +1 -1
  122. package/dist/client/assets/{org-layout-CsJuQ6Ei.js → org-layout-i53vnou1.js} +1 -1
  123. package/dist/client/assets/{page-seo-form-BFfGH2mD.js → page-seo-form-BRpnzyUP.js} +1 -1
  124. package/dist/client/assets/page-seo-sheet-C8gLGTPM.js +1 -0
  125. package/dist/client/assets/{popover-sSylEgHu.js → popover-rRtv1RUJ.js} +1 -1
  126. package/dist/client/assets/{post-editor-BWay_CVr.js → post-editor-B3yACnM8.js} +1 -1
  127. package/dist/client/assets/{preview-dialog-CRHdztnc.js → preview-dialog-HeEAXFdp.js} +1 -1
  128. package/dist/client/assets/{primitives-DDnm_QnL.js → primitives-DOHAd4Be.js} +1 -1
  129. package/dist/client/assets/{profile-CHd6ohYJ.js → profile-DxKVe_bi.js} +1 -1
  130. package/dist/client/assets/project-app-view-C1SP7U91.js +1 -0
  131. package/dist/client/assets/record-editor-CmQTYxNi.js +1 -0
  132. package/dist/client/assets/registry-BLAsKSMe.js +2 -0
  133. package/dist/client/assets/{registry-layout-BwUiqOJ3.js → registry-layout-Cqo7HGa-.js} +1 -1
  134. package/dist/client/assets/{require-capability-CHNIB1jg.js → require-capability-GPOwZTVN.js} +1 -1
  135. package/dist/client/assets/{required-auth-layout-DHjwTgi9.js → required-auth-layout-D9YU16Eu.js} +1 -1
  136. package/dist/client/assets/{reset-password-D0a0hqfd.js → reset-password-BvvmcRor.js} +1 -1
  137. package/dist/client/assets/{roles-CRte-FI6.js → roles-BG01ewdV.js} +1 -1
  138. package/dist/client/assets/save-referenced-block-qVgXMpcz.js +1 -0
  139. package/dist/client/assets/{save-status-N1v_enLx.js → save-status-2WDTqRnj.js} +1 -1
  140. package/dist/client/assets/schema-form-hXy8-pLC.js +1 -0
  141. package/dist/client/assets/{scroll-area-Dbsv4e6O.js → scroll-area-DOnfhZQE.js} +1 -1
  142. package/dist/client/assets/{search-input-ChrXBjj7.js → search-input-Dh2xeHiv.js} +1 -1
  143. package/dist/client/assets/{secrets-CzfeR8W_.js → secrets-x-a9-QDY.js} +1 -1
  144. package/dist/client/assets/{sections-editor-D2GO3ILI.js → sections-editor-DpVqLaiP.js} +3 -3
  145. package/dist/client/assets/{select-gQvIO328.js → select-Dqs7Z4yG.js} +1 -1
  146. package/dist/client/assets/{select-model-Dzwuphcu.js → select-model-bXVR8jvT.js} +1 -1
  147. package/dist/client/assets/{seo-editor-CwC2Qeg7.js → seo-editor-d5x7SvAU.js} +1 -1
  148. package/dist/client/assets/{settings-layout-A5O0niXa.js → settings-layout-CpPje1Xl.js} +1 -1
  149. package/dist/client/assets/{settings-section-0NTS3MkI.js → settings-section-BqnJtUWr.js} +1 -1
  150. package/dist/client/assets/{sheet-BBNc6H-H.js → sheet-Cn8FwYbD.js} +1 -1
  151. package/dist/client/assets/{shell-controls-Cc7-zEXH.js → shell-controls-nCD3gP3E.js} +1 -1
  152. package/dist/client/assets/{shell-layout-CrbOIA4d.js → shell-layout-Cx--9PV8.js} +1 -1
  153. package/dist/client/assets/{shell-route-loading-DJR-qsy8.js → shell-route-loading-Brmd2_HQ.js} +1 -1
  154. package/dist/client/assets/{sidebar-B5eoEEUh.js → sidebar-D1LCPjC8.js} +1 -1
  155. package/dist/client/assets/{skeleton-DOQx-oqC.js → skeleton-Bo_6Cq99.js} +1 -1
  156. package/dist/client/assets/{sortable.esm-XdYFSg_0.js → sortable.esm-yJWb24sN.js} +1 -1
  157. package/dist/client/assets/{sso-kYzS5Tqs.js → sso-DhhZEU-d.js} +1 -1
  158. package/dist/client/assets/{store-hoHB6kbc.js → store-COjaCE4s.js} +1 -1
  159. package/dist/client/assets/store-registry-nvoM6APm.js +2 -0
  160. package/dist/client/assets/{studio-tools-B1vmC7k4.js → studio-tools-CyTucPcW.js} +1 -1
  161. package/dist/client/assets/{switch-BH90tU73.js → switch-CorAlxCf.js} +1 -1
  162. package/dist/client/assets/{table-Borl2aRc.js → table-Gv4tJy7V.js} +1 -1
  163. package/dist/client/assets/{tabs-CznF-MMq.js → tabs-DAvIQWby.js} +1 -1
  164. package/dist/client/assets/{task-status-W8pectFm.js → task-status-BfeF--n0.js} +1 -1
  165. package/dist/client/assets/{textarea-BVXgXW3B.js → textarea-DsT2vsGj.js} +1 -1
  166. package/dist/client/assets/{toggle-group-Cn5J5q3D.js → toggle-group-WKZVvwQm.js} +1 -1
  167. package/dist/client/assets/{toolbar-6hNYKLLh.js → toolbar-BfY48AQu.js} +1 -1
  168. package/dist/client/assets/{tooltip-D9KNvVvr.js → tooltip-D5U362dF.js} +1 -1
  169. package/dist/client/assets/{types-C7TUAV0n.js → types-C-QYkfD4.js} +1 -1
  170. package/dist/client/assets/{use-ai-providers-CYtt5EvS.js → use-ai-providers-CLZQ64DO.js} +1 -1
  171. package/dist/client/assets/{use-automations-DB885IUH.js → use-automations-DNKM1hXI.js} +1 -1
  172. package/dist/client/assets/{use-capability-BgNNCaLI.js → use-capability-XIhIuFk7.js} +1 -1
  173. package/dist/client/assets/{use-clock-tick-BHE1f1YU.js → use-clock-tick-DkwKhG1v.js} +1 -1
  174. package/dist/client/assets/{use-collections-H8HuKWEE.js → use-collections-D4JsVK-B.js} +1 -1
  175. package/dist/client/assets/{use-connection-Cg1b4Um2.js → use-connection-C7Z8M26w.js} +1 -1
  176. package/dist/client/assets/{use-copy-BGWnHO-M.js → use-copy-CqTP6NE5.js} +1 -1
  177. package/dist/client/assets/{use-create-virtual-mcp-BTbe0O5T.js → use-create-virtual-mcp-fk0U59RA.js} +1 -1
  178. package/dist/client/assets/{use-debounced-autosave-DIcW3_zI.js → use-debounced-autosave-B8dr6XMC.js} +1 -1
  179. package/dist/client/assets/{use-deco-credits-D3w33USN.js → use-deco-credits-Cm6qycwc.js} +1 -1
  180. package/dist/client/assets/{use-delete-connection-CMXNBeGz.js → use-delete-connection-DTrOkfly.js} +1 -1
  181. package/dist/client/assets/{use-file-configs-BBtTR4ju.js → use-file-configs-DKTLvOxt.js} +1 -1
  182. package/dist/client/assets/{use-infinite-scroll-Cj-XExfy.js → use-infinite-scroll-SjuQvrxH.js} +1 -1
  183. package/dist/client/assets/{use-join-requests-Dl6EohPu.js → use-join-requests-DmU4yvI-.js} +1 -1
  184. package/dist/client/assets/{use-mcp-client-DYJrfczK.js → use-mcp-client-CK2bE_Wl.js} +9 -9
  185. package/dist/client/assets/{use-mcp-prompts-CSCDL01T.js → use-mcp-prompts--L5Py2oF.js} +1 -1
  186. package/dist/client/assets/{use-mcp-tools-D3AAnhTZ.js → use-mcp-tools-B7wduqbV.js} +1 -1
  187. package/dist/client/assets/{use-members-DJNn_Bxw.js → use-members-CYuArAru.js} +1 -1
  188. package/dist/client/assets/{use-navigate-to-agent-BlcN6V5v.js → use-navigate-to-agent-C2rXzvAb.js} +1 -1
  189. package/dist/client/assets/{use-org-auth-client-wIGZzMQc.js → use-org-auth-client-BYQp-Udb.js} +1 -1
  190. package/dist/client/assets/{use-org-sso-CwWfX4uS.js → use-org-sso-Dh5HCYSJ.js} +1 -1
  191. package/dist/client/assets/{use-organization-roles-BXV_PsbS.js → use-organization-roles-BR95hkZY.js} +1 -1
  192. package/dist/client/assets/{use-organization-settings-DouM9EgM.js → use-organization-settings-CiSDOMOC.js} +1 -1
  193. package/dist/client/assets/{use-registry-connections-QEmucmhH.js → use-registry-connections-rHz6zGP7.js} +1 -1
  194. package/dist/client/assets/{use-secrets-DVqtKaXp.js → use-secrets-DLuniCTL.js} +1 -1
  195. package/dist/client/assets/{use-status-sounds-Dl6bvWf3.js → use-status-sounds-BmR3uEUx.js} +1 -1
  196. package/dist/client/assets/{use-view-mode-BCnWJZTf.js → use-view-mode-CCFkxJ0W.js} +1 -1
  197. package/dist/client/assets/{use-virtual-mcp-oKPxaCky.js → use-virtual-mcp-DPWDEWCb.js} +1 -1
  198. package/dist/client/assets/useInfiniteQuery-BS_m7Y7W.js +1 -0
  199. package/dist/client/assets/{useRouterState-ysmOvmXv.js → useRouterState-q7ojL5Do.js} +1 -1
  200. package/dist/client/assets/useSuspenseInfiniteQuery-CHHT-uCm.js +1 -0
  201. package/dist/client/assets/{view-mode-toggle-CHlCGyzP.js → view-mode-toggle-CeXLSv0R.js} +1 -1
  202. package/dist/client/index.html +1 -1
  203. package/dist/server/cli.js +525 -521
  204. package/dist/server/migrate.js +113 -109
  205. package/dist/server/server.js +368 -368
  206. package/package.json +1 -1
  207. package/dist/client/assets/app-editor-B87jVOIH.js +0 -1
  208. package/dist/client/assets/category-editor-BEoXjeUW.js +0 -1
  209. package/dist/client/assets/page-seo-sheet-CitEZrcC.js +0 -1
  210. package/dist/client/assets/project-app-view-CXwN5Mnc.js +0 -1
  211. package/dist/client/assets/record-editor-D-0BBq6H.js +0 -1
  212. package/dist/client/assets/registry-BCkAgbHk.js +0 -2
  213. package/dist/client/assets/save-referenced-block-BwxGXLv8.js +0 -1
  214. package/dist/client/assets/schema-form-mwEmbM5O.js +0 -1
  215. package/dist/client/assets/store-registry-MgWAZcLM.js +0 -2
  216. package/dist/client/assets/useInfiniteQuery-YHehADCx.js +0 -1
  217. package/dist/client/assets/useSuspenseInfiniteQuery-xMSumVHF.js +0 -1
@@ -1,4 +1,4 @@
1
- import{e as S,r as U,j as t,m as Y,B as _,K as B,c as ee,p as Pe,F as Je,n as W,f as et,d as tt,a1 as Te,ac as Tt}from"./index-C3gL9St4.js";import{i as zt}from"./ChevronRight-BdMquS3m.js";import{s as st}from"./Eye-B4uYcIta.js";import{n as Ft,i as nt}from"./Globe01-C7fVaUrg.js";import{a as lt,d as Pt,e as Ot,i as Et}from"./ZoomOut-DCv2Tq6d.js";import{a as pe}from"./Palette-pv0gmxnS.js";import{s as At}from"./Plus-J1K3Rh3s.js";import{t as Mt}from"./Stars01-DyLJc1qm.js";import{i as xe}from"./Upload01-CJqoFPBG.js";import{i as Oe}from"./Zap-B8ZLhQFM.js";import{u as it}from"./tooltip-D9KNvVvr.js";import{f as Ut,a as Bt,b as Lt,c as _t,d as Rt,e as qt,A as It,g as Kt}from"./alert-dialog-C20YoJ0a.js";import{c as Ee,d as Ae,a as Me,f as rt,D as Ht,b as Vt,e as Gt}from"./dialog-jhtlYWQH.js";import{I as Ue}from"./input-BvSXiwAq.js";import{S as K}from"./skeleton-DOQx-oqC.js";import{F as ie,d as at,M as ot}from"./file-type-icon-CzNWenEv.js";import{a as Qt}from"./toolbar-6hNYKLLh.js";import{q as Be,r as A,a as be,s as Wt,u as Fe,t as Le,f as Yt,L as Xt,n as Zt,o as Jt,m as es,R as Ve,p as ts,S as ss,b as ns,v as ct,w as le,x as ls}from"./preview-dialog-CRHdztnc.js";import{a as ve}from"./DotsVertical-DQ-WKmA2.js";import{i as is}from"./Key01-B-9ep-9Z.js";import{s as je}from"./Trash01-Cib_Sg7t.js";import{a as ye,c as te,b as we,D as ke}from"./dropdown-menu-B4AhYSKY.js";import{T as rs}from"./textarea-BVXgXW3B.js";import{t as as}from"./ChevronDown-6sFYQ_lK.js";import{n as os}from"./ChevronUp-BNOOOsT2.js";import{i as ge}from"./X-BL2gdXEj.js";import"./tab-id-BptcWVWa.js";import"./ChevronLeft-8zvGG53e.js";import"./LinkExternal01-iioOg4ap.js";import"./XClose-BtRDneKm.js";import"./index-CQ_hnxd_.js";import"./LayoutLeft-XZqot3mq.js";import"./popover-sSylEgHu.js";const cs=new Set(["output","upload","public","home"]),ds=/^[A-Za-z0-9][A-Za-z0-9._-]*$/;function fs(s){return cs.has(s)||!ds.test(s)?"home":s}function us(s){const e=S.c(33);let n,i,l;e[0]!==s?({glyph:n,readOnly:l,...i}=s,e[0]=s,e[1]=n,e[2]=i,e[3]=l):(n=e[1],i=e[2],l=e[3]);const r=U.useId(),a=`${r}-back`,c=`${r}-front`,o=`url(#${a})`;let d;e[4]!==o?(d=t.jsx("path",{d:"M2.53738 2.55C1.13602 2.55 0 3.68602 0 5.08738V11.535H31.931V7.65326C31.931 6.23616 30.7822 5.08738 29.3651 5.08738H14.7681L13.8775 5.02542C13.3886 4.99141 12.9197 4.81809 12.5261 4.52596L10.7726 3.22419C10.1828 2.78638 9.46784 2.55 8.73334 2.55H2.53738Z",fill:o}),e[4]=o,e[5]=d):d=e[5];const u=`url(#${c})`;let f;e[6]!==u?(f=t.jsx("rect",{y:"8.72",width:"32",height:"21",rx:"2.566",fill:u}),e[6]=u,e[7]=f):f=e[7];let m,h,x;e[8]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("rect",{x:"0.3",y:"8.86",width:"31.4",height:"0.55",rx:"0.275",fill:"#FFFFFF",opacity:"0.25"}),h=t.jsx("rect",{y:"25.81",width:"32",height:"0.552",fill:"#84CDFB"}),x=t.jsx("rect",{y:"27.05",width:"32",height:"0.552",fill:"#84CDFB"}),e[8]=m,e[9]=h,e[10]=x):(m=e[8],h=e[9],x=e[10]);let v;e[11]!==n?(v=n&&t.jsx(n,{x:10.5,y:13.2,width:11,height:11,strokeWidth:2.2,style:{color:"#014AC9",opacity:.55}}),e[11]=n,e[12]=v):v=e[12];let j;e[13]!==l?(j=l&&t.jsxs(t.Fragment,{children:[t.jsx("circle",{cx:"25.5",cy:"25.5",r:"6.2",strokeWidth:"1",className:"fill-background stroke-border"}),t.jsx(st,{x:22.1,y:22.1,width:6.8,height:6.8,strokeWidth:2.2,className:"text-muted-foreground"})]}),e[13]=l,e[14]=j):j=e[14];let y,k;e[15]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx("stop",{offset:"0.3",stopColor:"#4D87DF"}),k=t.jsx("stop",{offset:"1",stopColor:"#296FE8"}),e[15]=y,e[16]=k):(y=e[15],k=e[16]);let N;e[17]!==a?(N=t.jsxs("linearGradient",{id:a,x1:"15.97",y1:"2.55",x2:"15.97",y2:"9.53",gradientUnits:"userSpaceOnUse",children:[y,k]}),e[17]=a,e[18]=N):N=e[18];let g,C;e[19]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("stop",{stopColor:"#72B6FA"}),C=t.jsx("stop",{offset:"1",stopColor:"#5BB1EF"}),e[19]=g,e[20]=C):(g=e[19],C=e[20]);let D;e[21]!==c?(D=t.jsxs("radialGradient",{id:c,cx:"0",cy:"0",r:"10",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(1.6 0 0 2.1538 16 19.22)",children:[g,C]}),e[21]=c,e[22]=D):D=e[22];let F;e[23]!==N||e[24]!==D?(F=t.jsxs("defs",{children:[N,D]}),e[23]=N,e[24]=D,e[25]=F):F=e[25];let $;return e[26]!==i||e[27]!==F||e[28]!==d||e[29]!==f||e[30]!==v||e[31]!==j?($=t.jsxs("svg",{viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",...i,children:[d,f,m,h,x,v,j,F]}),e[26]=i,e[27]=F,e[28]=d,e[29]=f,e[30]=v,e[31]=j,e[32]=$):$=e[32],$}function ms(s,e,n){return e?"color":n?"font":/^--brand-(text|fw|leading|tracking)/i.test(s)?"type":/^--brand-space/i.test(s)?"space":/^--brand-radius/i.test(s)?"radius":/^--brand-shadow/i.test(s)?"shadow":/^--brand-(duration|delay|ease)/i.test(s)?"motion":"other"}const hs=/^(rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color)\(/i,ps=/^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,xs=["svg","png","jpg","jpeg","webp","avif","gif"];function gs(s){return s.split(".").pop()?.toLowerCase()??""}function bs(s){return s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function vs(s){const e=s.trim();return ps.test(e)||hs.test(e)}function js(s){const e=s.trim(),n=e.match(/^#([0-9a-f]{3})$/i);return n?.[1]?`#${[...n[1]].map(i=>i+i).join("")}`:e}function dt(s){const e=[],n=new Map,i=/(--brand-[\w-]+)\s*:\s*([^;]+);/g;let l;for(;(l=i.exec(s))!==null;){const r=l[1],a=l[2].trim();n.has(r)||e.push(r),n.set(r,a)}return e.map(r=>{const a=n.get(r),c=vs(a),o=/^--brand-font/i.test(r);return{name:r,value:a,isColor:c,isFont:o,kind:ms(r,c,o)}})}const Ge=["primary","secondary","accent","neutral","success","warning","error","info","bg","fg","border","ring"];function ys(s){return s.match(/^--brand-([a-z]+)/i)?.[1]?.toLowerCase()??s}function ws(s){const e=[],n=new Map;for(const l of s){if(l.kind!=="color")continue;const r=ys(l.name);n.has(r)||(e.push(r),n.set(r,[])),n.get(r).push(l)}return e.map(l=>{const r=n.get(l);return{family:l,tokens:r,isRamp:r.filter(a=>/-\d+$/.test(a.name)).length>=5}}).sort((l,r)=>{const a=Ge.indexOf(l.family),c=Ge.indexOf(r.family);return a===-1&&c===-1?0:a===-1?1:c===-1?-1:a-c})}function ks(s,e,n){const i=new RegExp(`(${bs(e)}\\s*:\\s*)[^;]+(;)`);if(i.test(s))return s.replace(i,(a,c,o)=>`${c}${n}${o}`);const l=s.search(/:root\s*\{/);if(l!==-1){const a=s.indexOf("{",l)+1;return`${s.slice(0,a)}
1
+ import{e as S,r as U,j as t,m as Y,B as _,K as B,c as ee,p as Pe,F as Je,n as W,f as et,d as tt,a1 as Te,ac as Tt}from"./index-COlSsy5J.js";import{i as zt}from"./ChevronRight-BsknZQE_.js";import{s as st}from"./Eye-DifA9NHq.js";import{n as Ft,i as nt}from"./Globe01-CMUrlGmF.js";import{a as lt,d as Pt,e as Ot,i as Et}from"./ZoomOut-DYeUJTmS.js";import{a as pe}from"./Palette-pjBymHRy.js";import{s as At}from"./Plus-DHJbi1i9.js";import{t as Mt}from"./Stars01-Dr_rOBxK.js";import{i as xe}from"./Upload01-CuyZwIAy.js";import{i as Oe}from"./Zap-8NdOr1pq.js";import{u as it}from"./tooltip-D5U362dF.js";import{f as Ut,a as Bt,b as Lt,c as _t,d as Rt,e as qt,A as It,g as Kt}from"./alert-dialog-DvJDYQsM.js";import{c as Ee,d as Ae,a as Me,f as rt,D as Ht,b as Vt,e as Gt}from"./dialog-BMBVdX8K.js";import{I as Ue}from"./input-CuVtlRv5.js";import{S as K}from"./skeleton-Bo_6Cq99.js";import{F as ie,d as at,M as ot}from"./file-type-icon-DURyeK9L.js";import{a as Qt}from"./toolbar-BfY48AQu.js";import{q as Be,r as A,a as be,s as Wt,u as Fe,t as Le,f as Yt,L as Xt,n as Zt,o as Jt,m as es,R as Ve,p as ts,S as ss,b as ns,v as ct,w as le,x as ls}from"./preview-dialog-HeEAXFdp.js";import{a as ve}from"./DotsVertical-Ci1mVPsb.js";import{i as is}from"./Key01-DGn_JEBu.js";import{s as je}from"./Trash01-BDNQcRq9.js";import{a as ye,c as te,b as we,D as ke}from"./dropdown-menu-gXn3xVef.js";import{T as rs}from"./textarea-DsT2vsGj.js";import{t as as}from"./ChevronDown-BldydMJ0.js";import{n as os}from"./ChevronUp-CjDXfs3K.js";import{i as ge}from"./X-Botvp-t_.js";import"./tab-id-BptcWVWa.js";import"./ChevronLeft-CXmppBJO.js";import"./LinkExternal01-DwIqUvLe.js";import"./XClose-CnYr1LOo.js";import"./index-C_H1H79r.js";import"./LayoutLeft-BI32Ru47.js";import"./popover-rRtv1RUJ.js";const cs=new Set(["output","upload","public","home"]),ds=/^[A-Za-z0-9][A-Za-z0-9._-]*$/;function fs(s){return cs.has(s)||!ds.test(s)?"home":s}function us(s){const e=S.c(33);let n,i,l;e[0]!==s?({glyph:n,readOnly:l,...i}=s,e[0]=s,e[1]=n,e[2]=i,e[3]=l):(n=e[1],i=e[2],l=e[3]);const r=U.useId(),a=`${r}-back`,c=`${r}-front`,o=`url(#${a})`;let d;e[4]!==o?(d=t.jsx("path",{d:"M2.53738 2.55C1.13602 2.55 0 3.68602 0 5.08738V11.535H31.931V7.65326C31.931 6.23616 30.7822 5.08738 29.3651 5.08738H14.7681L13.8775 5.02542C13.3886 4.99141 12.9197 4.81809 12.5261 4.52596L10.7726 3.22419C10.1828 2.78638 9.46784 2.55 8.73334 2.55H2.53738Z",fill:o}),e[4]=o,e[5]=d):d=e[5];const u=`url(#${c})`;let f;e[6]!==u?(f=t.jsx("rect",{y:"8.72",width:"32",height:"21",rx:"2.566",fill:u}),e[6]=u,e[7]=f):f=e[7];let m,h,x;e[8]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("rect",{x:"0.3",y:"8.86",width:"31.4",height:"0.55",rx:"0.275",fill:"#FFFFFF",opacity:"0.25"}),h=t.jsx("rect",{y:"25.81",width:"32",height:"0.552",fill:"#84CDFB"}),x=t.jsx("rect",{y:"27.05",width:"32",height:"0.552",fill:"#84CDFB"}),e[8]=m,e[9]=h,e[10]=x):(m=e[8],h=e[9],x=e[10]);let v;e[11]!==n?(v=n&&t.jsx(n,{x:10.5,y:13.2,width:11,height:11,strokeWidth:2.2,style:{color:"#014AC9",opacity:.55}}),e[11]=n,e[12]=v):v=e[12];let j;e[13]!==l?(j=l&&t.jsxs(t.Fragment,{children:[t.jsx("circle",{cx:"25.5",cy:"25.5",r:"6.2",strokeWidth:"1",className:"fill-background stroke-border"}),t.jsx(st,{x:22.1,y:22.1,width:6.8,height:6.8,strokeWidth:2.2,className:"text-muted-foreground"})]}),e[13]=l,e[14]=j):j=e[14];let y,k;e[15]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx("stop",{offset:"0.3",stopColor:"#4D87DF"}),k=t.jsx("stop",{offset:"1",stopColor:"#296FE8"}),e[15]=y,e[16]=k):(y=e[15],k=e[16]);let N;e[17]!==a?(N=t.jsxs("linearGradient",{id:a,x1:"15.97",y1:"2.55",x2:"15.97",y2:"9.53",gradientUnits:"userSpaceOnUse",children:[y,k]}),e[17]=a,e[18]=N):N=e[18];let g,C;e[19]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("stop",{stopColor:"#72B6FA"}),C=t.jsx("stop",{offset:"1",stopColor:"#5BB1EF"}),e[19]=g,e[20]=C):(g=e[19],C=e[20]);let D;e[21]!==c?(D=t.jsxs("radialGradient",{id:c,cx:"0",cy:"0",r:"10",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(1.6 0 0 2.1538 16 19.22)",children:[g,C]}),e[21]=c,e[22]=D):D=e[22];let F;e[23]!==N||e[24]!==D?(F=t.jsxs("defs",{children:[N,D]}),e[23]=N,e[24]=D,e[25]=F):F=e[25];let $;return e[26]!==i||e[27]!==F||e[28]!==d||e[29]!==f||e[30]!==v||e[31]!==j?($=t.jsxs("svg",{viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",...i,children:[d,f,m,h,x,v,j,F]}),e[26]=i,e[27]=F,e[28]=d,e[29]=f,e[30]=v,e[31]=j,e[32]=$):$=e[32],$}function ms(s,e,n){return e?"color":n?"font":/^--brand-(text|fw|leading|tracking)/i.test(s)?"type":/^--brand-space/i.test(s)?"space":/^--brand-radius/i.test(s)?"radius":/^--brand-shadow/i.test(s)?"shadow":/^--brand-(duration|delay|ease)/i.test(s)?"motion":"other"}const hs=/^(rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color)\(/i,ps=/^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,xs=["svg","png","jpg","jpeg","webp","avif","gif"];function gs(s){return s.split(".").pop()?.toLowerCase()??""}function bs(s){return s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function vs(s){const e=s.trim();return ps.test(e)||hs.test(e)}function js(s){const e=s.trim(),n=e.match(/^#([0-9a-f]{3})$/i);return n?.[1]?`#${[...n[1]].map(i=>i+i).join("")}`:e}function dt(s){const e=[],n=new Map,i=/(--brand-[\w-]+)\s*:\s*([^;]+);/g;let l;for(;(l=i.exec(s))!==null;){const r=l[1],a=l[2].trim();n.has(r)||e.push(r),n.set(r,a)}return e.map(r=>{const a=n.get(r),c=vs(a),o=/^--brand-font/i.test(r);return{name:r,value:a,isColor:c,isFont:o,kind:ms(r,c,o)}})}const Ge=["primary","secondary","accent","neutral","success","warning","error","info","bg","fg","border","ring"];function ys(s){return s.match(/^--brand-([a-z]+)/i)?.[1]?.toLowerCase()??s}function ws(s){const e=[],n=new Map;for(const l of s){if(l.kind!=="color")continue;const r=ys(l.name);n.has(r)||(e.push(r),n.set(r,[])),n.get(r).push(l)}return e.map(l=>{const r=n.get(l);return{family:l,tokens:r,isRamp:r.filter(a=>/-\d+$/.test(a.name)).length>=5}}).sort((l,r)=>{const a=Ge.indexOf(l.family),c=Ge.indexOf(r.family);return a===-1&&c===-1?0:a===-1?1:c===-1?-1:a-c})}function ks(s,e,n){const i=new RegExp(`(${bs(e)}\\s*:\\s*)[^;]+(;)`);if(i.test(s))return s.replace(i,(a,c,o)=>`${c}${n}${o}`);const l=s.search(/:root\s*\{/);if(l!==-1){const a=s.indexOf("{",l)+1;return`${s.slice(0,a)}
2
2
  ${e}: ${n};${s.slice(a)}`}const r=s.length>0&&!s.endsWith(`
3
3
  `)?`
4
4
  `:"";return`${s}${r}:root {
@@ -1 +1 @@
1
- import{e as c,g as p,j as s,l as u,N as a}from"./index-C3gL9St4.js";import{a as x}from"./use-capability-BgNNCaLI.js";import{C as j}from"./capability-load-error-gogxAwFW.js";function v(){const t=c.c(21);let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org"},t[0]=o):o=t[0];const{org:r}=p(o),{capabilities:l,isPrivileged:m,loading:f,error:g}=x();if(f){let e;return t[1]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:s.jsx(u,{size:20,className:"animate-spin text-muted-foreground"})}),t[1]=e):e=t[1],e}if(g){let e;return t[2]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(j,{}),t[2]=e):e=t[2],e}const i=e=>m||l[e]===!0;if(i("org:manage")){let e;return t[3]!==r?(e=s.jsx(a,{to:"/$org/settings/general",params:{org:r},replace:!0}),t[3]=r,t[4]=e):e=t[4],e}if(i("ai-providers:manage")){let e;return t[5]!==r?(e=s.jsx(a,{to:"/$org/settings/ai-providers",params:{org:r},replace:!0}),t[5]=r,t[6]=e):e=t[6],e}if(i("secrets:manage")){let e;return t[7]!==r?(e=s.jsx(a,{to:"/$org/settings/secrets",params:{org:r},replace:!0}),t[7]=r,t[8]=e):e=t[8],e}if(i("file-configs:manage")){let e;return t[9]!==r?(e=s.jsx(a,{to:"/$org/settings/buckets",params:{org:r},replace:!0}),t[9]=r,t[10]=e):e=t[10],e}if(i("automations:manage")){let e;return t[11]!==r?(e=s.jsx(a,{to:"/$org/settings/automations",params:{org:r},replace:!0}),t[11]=r,t[12]=e):e=t[12],e}if(i("registry:manage")){let e;return t[13]!==r?(e=s.jsx(a,{to:"/$org/settings/store",params:{org:r},replace:!0}),t[13]=r,t[14]=e):e=t[14],e}if(i("monitoring:view")){let e;return t[15]!==r?(e=s.jsx(a,{to:"/$org/settings/monitor",params:{org:r},replace:!0}),t[15]=r,t[16]=e):e=t[16],e}if(i("members:manage")){let e;return t[17]!==r?(e=s.jsx(a,{to:"/$org/settings/members",params:{org:r},replace:!0}),t[17]=r,t[18]=e):e=t[18],e}let n;return t[19]!==r?(n=s.jsx(a,{to:"/$org/settings/profile",params:{org:r},replace:!0}),t[19]=r,t[20]=n):n=t[20],n}export{v as default};
1
+ import{e as c,g as p,j as s,l as u,N as a}from"./index-COlSsy5J.js";import{a as x}from"./use-capability-XIhIuFk7.js";import{C as j}from"./capability-load-error-Caduk_d2.js";function v(){const t=c.c(21);let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org"},t[0]=o):o=t[0];const{org:r}=p(o),{capabilities:l,isPrivileged:m,loading:f,error:g}=x();if(f){let e;return t[1]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:s.jsx(u,{size:20,className:"animate-spin text-muted-foreground"})}),t[1]=e):e=t[1],e}if(g){let e;return t[2]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(j,{}),t[2]=e):e=t[2],e}const i=e=>m||l[e]===!0;if(i("org:manage")){let e;return t[3]!==r?(e=s.jsx(a,{to:"/$org/settings/general",params:{org:r},replace:!0}),t[3]=r,t[4]=e):e=t[4],e}if(i("ai-providers:manage")){let e;return t[5]!==r?(e=s.jsx(a,{to:"/$org/settings/ai-providers",params:{org:r},replace:!0}),t[5]=r,t[6]=e):e=t[6],e}if(i("secrets:manage")){let e;return t[7]!==r?(e=s.jsx(a,{to:"/$org/settings/secrets",params:{org:r},replace:!0}),t[7]=r,t[8]=e):e=t[8],e}if(i("file-configs:manage")){let e;return t[9]!==r?(e=s.jsx(a,{to:"/$org/settings/buckets",params:{org:r},replace:!0}),t[9]=r,t[10]=e):e=t[10],e}if(i("automations:manage")){let e;return t[11]!==r?(e=s.jsx(a,{to:"/$org/settings/automations",params:{org:r},replace:!0}),t[11]=r,t[12]=e):e=t[12],e}if(i("registry:manage")){let e;return t[13]!==r?(e=s.jsx(a,{to:"/$org/settings/store",params:{org:r},replace:!0}),t[13]=r,t[14]=e):e=t[14],e}if(i("monitoring:view")){let e;return t[15]!==r?(e=s.jsx(a,{to:"/$org/settings/monitor",params:{org:r},replace:!0}),t[15]=r,t[16]=e):e=t[16],e}if(i("members:manage")){let e;return t[17]!==r?(e=s.jsx(a,{to:"/$org/settings/members",params:{org:r},replace:!0}),t[17]=r,t[18]=e):e=t[18],e}let n;return t[19]!==r?(n=s.jsx(a,{to:"/$org/settings/profile",params:{org:r},replace:!0}),t[19]=r,t[20]=n):n=t[20],n}export{v as default};
@@ -1,4 +1,4 @@
1
- import{e as le,r as K,f as yt,p as Be,j as t,B as Z,n as Se,c as de,K as it,m as wt,a6 as rs,d as ls,t as xt,a1 as os}from"./index-C3gL9St4.js";import{S as as}from"./search-input-ChrXBjj7.js";import{P as De}from"./index-Bf1YdrMc.js";import{E as St}from"./empty-state-Cz0bAkoo.js";import{R as ns}from"./require-capability-CHNIB1jg.js";import{J as Tt,S as is}from"./scroll-area-Dbsv4e6O.js";import{u as vt}from"./use-connection-Cg1b4Um2.js";import{g as Pt}from"./connection-slug-eyAPH6o3.js";import{B as rt}from"./badge-CuCfPx-y.js";import{P as ct,a as dt,b as mt}from"./popover-sSylEgHu.js";import{b as Ze,T as et,a as tt}from"./tooltip-D9KNvVvr.js";import{i as ft,n as cs}from"./ChevronUp-BNOOOsT2.js";import{a as Xe}from"./Eye-B4uYcIta.js";import{n as Mt}from"./Globe01-C7fVaUrg.js";import{i as At}from"./FilterLines-DCvNnP3i.js";import{i as ds}from"./Key01-B-9ep-9Z.js";import{i as ms}from"./Play-DXtyMrcP.js";import{ab as us,ac as xs,M as fs}from"./agent-icon-Cf9b4Ru9.js";import{M as _t}from"./monaco-editor-DFjHxwB9.js";import{u as ps}from"./use-members-DJNn_Bxw.js";import{S as hs,u as gs,W as js}from"./use-mcp-client-DYJrfczK.js";import{u as vs}from"./use-virtual-mcp-oKPxaCky.js";import{n as Qe}from"./XCircle-CCiKaJ__.js";import{c as Ns}from"./SwitchHorizontal01-X5LMtCou.js";import{s as bs}from"./Plus-J1K3Rh3s.js";import{s as ys}from"./Trash01-Cib_Sg7t.js";import{I as Ge}from"./input-BvSXiwAq.js";import{g as ws,b as Dt,f as st,a as Vt,c as pt,d as Ss,e as Lt,h as Ut,A as Is,T as Cs,i as ks,M as ht}from"./automation-runs-Dzg3ROYw.js";import{b as lt,c as ot,S as at,a as $e,d as nt}from"./select-gQvIO328.js";import{t as Kt}from"./ChevronDown-6sFYQ_lK.js";import{s as Ts}from"./Stars02-CDIgaXAV.js";import{C as Ms}from"./calendar-CKrH5d_Q.js";import{T as _s}from"./textarea-BVXgXW3B.js";import{C as qt}from"./collection-tabs-dRuAELuw.js";import{S as Ds}from"./switch-BH90tU73.js";import{L as Ls}from"./label-vllYe6cM.js";import{I as qe}from"./integration-icon-BcoSEnuB.js";import{A as Bt}from"./avatar-Nw1x5eGz.js";import{A as Fs,a as Rs,b as $s}from"./alert-DGGvXsmf.js";import{C as Ht}from"./card-yVmBUFAg.js";import{K as Me}from"./monitoring-stats-row-DzD-p2bQ.js";import{u as Jt}from"./studio-tools-B1vmC7k4.js";import{u as zs}from"./useSuspenseInfiniteQuery-xMSumVHF.js";import{b as Os,S as Es,c as Ps,d as As}from"./sheet-BBNc6H-H.js";import{T as Fe,a as ut,b as Gt,c as Qt,d as Wt,e as ae}from"./table-Borl2aRc.js";import{u as Vs}from"./use-infinite-scroll-Cj-XExfy.js";import{c as Us,b as Ks}from"./use-automations-DB885IUH.js";import"./SearchMd-CjaRzuTt.js";import"./sidebar-B5eoEEUh.js";import"./LayoutLeft-XZqot3mq.js";import"./use-capability-BgNNCaLI.js";import"./access-gate-DFiTys6s.js";import"./capability-load-error-gogxAwFW.js";import"./Stars01-DyLJc1qm.js";import"./ChevronRight-BdMquS3m.js";import"./use-clock-tick-BHE1f1YU.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-BGWnHO-M.js";import"./file-type-icon-CzNWenEv.js";import"./dialog-jhtlYWQH.js";import"./X-BL2gdXEj.js";import"./ZoomOut-DCv2Tq6d.js";import"./tab-id-BptcWVWa.js";import"./content-blocks-o63cs2vh.js";import"./types-C7TUAV0n.js";import"./chat-context-WtXAdZJ4.js";import"./hooks-D14HehpA.js";import"./decopilot-sse-pool-BVuJ_7ML.js";import"./use-ai-providers-CYtt5EvS.js";import"./use-organization-settings-DouM9EgM.js";import"./AlertCircle-DhaQx9Mx.js";import"./Star01-_Kd09vMY.js";import"./XClose-BtRDneKm.js";import"./ZapSquare-J9sfjhfh.js";import"./Tool01-Dw4_QC3_.js";import"./Monitor01-DL3Tirrd.js";import"./Upload01-CJqoFPBG.js";import"./shell-layout-CrbOIA4d.js";import"./Users03-4g5nbjFJ.js";import"./CheckCircle-DTbDatzD.js";import"./Zap-B8ZLhQFM.js";import"./required-auth-layout-DHjwTgi9.js";import"./useRouterState-ysmOvmXv.js";import"./use-org-sso-CwWfX4uS.js";import"./LinkExternal01-iioOg4ap.js";import"./ArrowUpRight-CfMwsozc.js";import"./Palette-pv0gmxnS.js";import"./use-navigate-to-agent-BlcN6V5v.js";import"./use-mcp-prompts-CSCDL01T.js";import"./form-rLORGBZw.js";import"./use-collections-H8HuKWEE.js";import"./Settings02-By0Jzp86.js";import"./ChevronLeft-8zvGG53e.js";import"./DotsVertical-DQ-WKmA2.js";import"./Globe04-Bwx3UG2x.js";import"./HardDrive-BOa3mtdo.js";import"./Sun-TGwF56wV.js";import"./Shield01-M8Hvv7sS.js";import"./User01-BywBiT-b.js";import"./Users01-CDCapXFR.js";import"./index-CQ_hnxd_.js";import"./use-org-auth-client-wIGZzMQc.js";import"./auth-RitCYkp6.js";import"./useInfiniteQuery-YHehADCx.js";import"./task-status-W8pectFm.js";import"./checkbox-BMArZ_ix.js";import"./command-P8Wd0xDH.js";import"./index-DqifP8kh.js";import"./index-Bx5YRZw3.js";const Nt={maxJsonRenderSize:5e4,pageSize:50,streamingRefetchInterval:3e3};function Re(s){return s.filter(e=>e.key.trim()).map(e=>{const r=encodeURIComponent(e.key.trim()),l=encodeURIComponent(e.value||"");return`${r}:${e.operator}:${l}`}).join(",")}function qs(s){return s?s.split(",").map(e=>{const[r,l,...a]=e.split(":");return{key:decodeURIComponent(r||""),operator:l||"eq",value:decodeURIComponent(a.join(":")||"")}}):[]}function Ye(s){return s.filter(e=>e.key.trim()).map(e=>{switch(e.operator){case"eq":return`${e.key}=${e.value}`;case"contains":return`${e.key}~${e.value}`;case"exists":return`${e.key}?`;case"in":return`${e.key}@${e.value}`}}).join(`
1
+ import{e as le,r as K,f as yt,p as Be,j as t,B as Z,n as Se,c as de,K as it,m as wt,a6 as rs,d as ls,t as xt,a1 as os}from"./index-COlSsy5J.js";import{S as as}from"./search-input-Dh2xeHiv.js";import{P as De}from"./index-CkC7ek4r.js";import{E as St}from"./empty-state-SvMp_sYN.js";import{R as ns}from"./require-capability-GPOwZTVN.js";import{J as Tt,S as is}from"./scroll-area-DOnfhZQE.js";import{u as vt}from"./use-connection-C7Z8M26w.js";import{g as Pt}from"./connection-slug-eyAPH6o3.js";import{B as rt}from"./badge-Rj4w6Y9D.js";import{P as ct,a as dt,b as mt}from"./popover-rRtv1RUJ.js";import{b as Ze,T as et,a as tt}from"./tooltip-D5U362dF.js";import{i as ft,n as cs}from"./ChevronUp-CjDXfs3K.js";import{a as Xe}from"./Eye-DifA9NHq.js";import{n as Mt}from"./Globe01-CMUrlGmF.js";import{i as At}from"./FilterLines-CV07u96M.js";import{i as ds}from"./Key01-DGn_JEBu.js";import{i as ms}from"./Play-BEuZCxsN.js";import{ab as us,ac as xs,M as fs}from"./agent-icon-B1KjkGhC.js";import{M as _t}from"./monaco-editor-DNLiFjHn.js";import{u as ps}from"./use-members-CYuArAru.js";import{S as hs,u as gs,W as js}from"./use-mcp-client-CK2bE_Wl.js";import{u as vs}from"./use-virtual-mcp-DPWDEWCb.js";import{n as Qe}from"./XCircle-CpovmLEO.js";import{c as Ns}from"./SwitchHorizontal01-Ca_h3hG5.js";import{s as bs}from"./Plus-DHJbi1i9.js";import{s as ys}from"./Trash01-BDNQcRq9.js";import{I as Ge}from"./input-CuVtlRv5.js";import{g as ws,b as Dt,f as st,a as Vt,c as pt,d as Ss,e as Lt,h as Ut,A as Is,T as Cs,i as ks,M as ht}from"./automation-runs-CHVaaxN6.js";import{b as lt,c as ot,S as at,a as $e,d as nt}from"./select-Dqs7Z4yG.js";import{t as Kt}from"./ChevronDown-BldydMJ0.js";import{s as Ts}from"./Stars02-CB3UMWzf.js";import{C as Ms}from"./calendar-BETEvsL1.js";import{T as _s}from"./textarea-DsT2vsGj.js";import{C as qt}from"./collection-tabs-CghGabs6.js";import{S as Ds}from"./switch-CorAlxCf.js";import{L as Ls}from"./label-BCRIEPd0.js";import{I as qe}from"./integration-icon-RqT66_6U.js";import{A as Bt}from"./avatar-D7wKrjgH.js";import{A as Fs,a as Rs,b as $s}from"./alert-DVl9GMhN.js";import{C as Ht}from"./card-BtNxdFil.js";import{K as Me}from"./monitoring-stats-row-Bsctnbru.js";import{u as Jt}from"./studio-tools-CyTucPcW.js";import{u as zs}from"./useSuspenseInfiniteQuery-CHHT-uCm.js";import{b as Os,S as Es,c as Ps,d as As}from"./sheet-Cn8FwYbD.js";import{T as Fe,a as ut,b as Gt,c as Qt,d as Wt,e as ae}from"./table-Gv4tJy7V.js";import{u as Vs}from"./use-infinite-scroll-SjuQvrxH.js";import{c as Us,b as Ks}from"./use-automations-DNKM1hXI.js";import"./SearchMd-yvCGxslh.js";import"./sidebar-D1LCPjC8.js";import"./LayoutLeft-BI32Ru47.js";import"./use-capability-XIhIuFk7.js";import"./access-gate-lRgnLhCg.js";import"./capability-load-error-Caduk_d2.js";import"./Stars01-Dr_rOBxK.js";import"./ChevronRight-BsknZQE_.js";import"./use-clock-tick-DkwKhG1v.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-CqTP6NE5.js";import"./file-type-icon-DURyeK9L.js";import"./dialog-BMBVdX8K.js";import"./X-Botvp-t_.js";import"./ZoomOut-DYeUJTmS.js";import"./tab-id-BptcWVWa.js";import"./content-blocks-o63cs2vh.js";import"./types-C-QYkfD4.js";import"./chat-context-B_U1gcun.js";import"./hooks-DlDryoZW.js";import"./decopilot-sse-pool-DdZSTixQ.js";import"./use-ai-providers-CLZQ64DO.js";import"./use-organization-settings-CiSDOMOC.js";import"./AlertCircle-Dnqz3IxM.js";import"./Star01-DxJIcjLz.js";import"./XClose-CnYr1LOo.js";import"./ZapSquare-ChOMpHGM.js";import"./Tool01-B4m3Gnpd.js";import"./Monitor01-C-tOv611.js";import"./Upload01-CuyZwIAy.js";import"./shell-layout-Cx--9PV8.js";import"./Users03-CJ4lkyfr.js";import"./CheckCircle-D9OslXZP.js";import"./Zap-8NdOr1pq.js";import"./required-auth-layout-D9YU16Eu.js";import"./useRouterState-q7ojL5Do.js";import"./use-org-sso-Dh5HCYSJ.js";import"./LinkExternal01-DwIqUvLe.js";import"./ArrowUpRight-B2NXgTf2.js";import"./Palette-pjBymHRy.js";import"./use-navigate-to-agent-C2rXzvAb.js";import"./use-mcp-prompts--L5Py2oF.js";import"./form-CdGhzS_x.js";import"./use-collections-D4JsVK-B.js";import"./Settings02-BcW_Yd93.js";import"./ChevronLeft-CXmppBJO.js";import"./DotsVertical-Ci1mVPsb.js";import"./Globe04-BplUDurZ.js";import"./HardDrive-B6V7BYZB.js";import"./Sun-CTchQz03.js";import"./Shield01-DXFrycnj.js";import"./User01-kj3Bxvgl.js";import"./Users01-DM4FmEoT.js";import"./index-C_H1H79r.js";import"./use-org-auth-client-BYQp-Udb.js";import"./auth-DA6X7KBB.js";import"./useInfiniteQuery-BS_m7Y7W.js";import"./task-status-BfeF--n0.js";import"./checkbox-CzoSEbjC.js";import"./command-CYqVDIDi.js";import"./index-D4WUCfu0.js";import"./index-C35Pm7iN.js";const Nt={maxJsonRenderSize:5e4,pageSize:50,streamingRefetchInterval:3e3};function Re(s){return s.filter(e=>e.key.trim()).map(e=>{const r=encodeURIComponent(e.key.trim()),l=encodeURIComponent(e.value||"");return`${r}:${e.operator}:${l}`}).join(",")}function qs(s){return s?s.split(",").map(e=>{const[r,l,...a]=e.split(":");return{key:decodeURIComponent(r||""),operator:l||"eq",value:decodeURIComponent(a.join(":")||"")}}):[]}function Ye(s){return s.filter(e=>e.key.trim()).map(e=>{switch(e.operator){case"eq":return`${e.key}=${e.value}`;case"contains":return`${e.key}~${e.value}`;case"exists":return`${e.key}?`;case"in":return`${e.key}@${e.value}`}}).join(`
2
2
  `)}function Ft(s){return s.trim()?s.split(`
3
3
  `).map(e=>e.trim()).filter(e=>e.length>0).map(e=>{if(e.endsWith("?"))return{key:e.slice(0,-1),operator:"exists",value:""};if(e.includes("=")){const[r,...l]=e.split("=");return{key:r||"",operator:"eq",value:l.join("=")}}if(e.includes("~")){const[r,...l]=e.split("~");return{key:r||"",operator:"contains",value:l.join("~")}}if(e.includes("@")){const[r,...l]=e.split("@");return{key:r||"",operator:"in",value:l.join("@")}}return{key:e,operator:"exists",value:""}}):[]}function Bs(s){const e={},r={},l=[],a={};for(const o of s)if(o.key.trim())switch(o.operator){case"eq":o.value&&(e[o.key]=o.value);break;case"contains":o.value&&(r[o.key]=`%${o.value}%`);break;case"exists":l.push(o.key);break;case"in":o.value&&(a[o.key]=o.value);break}return{properties:Object.keys(e).length>0?e:void 0,propertyPatterns:Object.keys(r).length>0?r:void 0,propertyKeys:l.length>0?l:void 0,propertyInValues:Object.keys(a).length>0?a:void 0}}function Rt(s){if(!s)return{content:"null",isTruncated:!1,originalSize:4};if(typeof s._decocms_truncated=="string")return{content:s._decocms_truncated,isTruncated:!0,originalSize:s._decocms_truncated.length};const e=JSON.stringify(s,null,2),r=e.length;return r<=Nt.maxJsonRenderSize?{content:e,isTruncated:!1,originalSize:r}:{content:e.slice(0,Nt.maxJsonRenderSize)+`
4
4
 
@@ -1 +1 @@
1
- import{e as s,c as a,j as d}from"./index-C3gL9St4.js";function f(l){const e=s.c(10);let i,t,r;e[0]!==l?({className:i,type:r,...t}=l,e[0]=l,e[1]=i,e[2]=t,e[3]=r):(i=e[1],t=e[2],r=e[3]);let n;e[4]!==i?(n=a("file:text-foreground text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground flex h-9 w-full min-w-0 rounded-lg bg-background dark:bg-input/30 px-3 py-1 text-sm transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:opacity-50 card-shadow","focus-visible:border-ring focus-visible:ring-ring/20 focus-visible:ring-[2px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",i),e[4]=i,e[5]=n):n=e[5];let o;return e[6]!==t||e[7]!==n||e[8]!==r?(o=d.jsx("input",{type:r,"data-slot":"input",className:n,...t}),e[6]=t,e[7]=n,e[8]=r,e[9]=o):o=e[9],o}export{f as I};
1
+ import{e as s,c as a,j as d}from"./index-COlSsy5J.js";function f(l){const e=s.c(10);let i,t,r;e[0]!==l?({className:i,type:r,...t}=l,e[0]=l,e[1]=i,e[2]=t,e[3]=r):(i=e[1],t=e[2],r=e[3]);let n;e[4]!==i?(n=a("file:text-foreground text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground flex h-9 w-full min-w-0 rounded-lg bg-background dark:bg-input/30 px-3 py-1 text-sm transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:opacity-50 card-shadow","focus-visible:border-ring focus-visible:ring-ring/20 focus-visible:ring-[2px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",i),e[4]=i,e[5]=n):n=e[5];let o;return e[6]!==t||e[7]!==n||e[8]!==r?(o=d.jsx("input",{type:r,"data-slot":"input",className:n,...t}),e[6]=t,e[7]=n,e[8]=r,e[9]=o):o=e[9],o}export{f as I};
@@ -1 +1 @@
1
- import{e as A,j as h,r as z,c as _}from"./index-C3gL9St4.js";import{n as L}from"./XCircle-CCiKaJ__.js";import{A as k}from"./agent-icon-Cf9b4Ru9.js";const C={"2xs":"h-4 w-4",xs:"h-6 w-6",sm:"h-9 w-9",md:"h-12 w-12",lg:"h-16 w-16",xl:"h-14 w-14"},Z={"2xs":"min-w-4",xs:"min-w-6",sm:"min-w-9",md:"min-w-12",lg:"min-w-16",xl:"min-w-14"},y={"2xs":8,xs:12,sm:16,md:24,lg:32,xl:28},M={"2xs":"xs",xs:"xs",sm:"sm",md:"md",lg:"lg",xl:"lg"};function q(E){const e=A.c(12),{icon:t,name:s,size:w,className:o,fallbackIcon:c}=E,n=w===void 0?"md":w;if(t?.startsWith("icon://")||t?.includes("#agentcolor=")){const r=M[n];let l;return e[0]!==o||e[1]!==t||e[2]!==s||e[3]!==r?(l=h.jsx(k,{icon:t,name:s,size:r,className:o}),e[0]=o,e[1]=t,e[2]=s,e[3]=r,e[4]=l):l=e[4],l}const g=t??"no-icon";let i;return e[5]!==o||e[6]!==c||e[7]!==t||e[8]!==s||e[9]!==n||e[10]!==g?(i=h.jsx(R,{icon:t,name:s,size:n,className:o,fallbackIcon:c},g),e[5]=o,e[6]=c,e[7]=t,e[8]=s,e[9]=n,e[10]=g,e[11]=i):i=e[11],i}function R(E){const e=A.c(24),{icon:t,name:s,size:w,className:o,fallbackIcon:c}=E,n=w===void 0?"md":w,[g,i]=z.useState(!1),r=!!t&&g,l=C[n],b=Z[n];let a;e[0]!==o||e[1]!==l||e[2]!==b?(a=_("rounded-lg border border-border shrink-0 overflow-hidden aspect-square bg-white",l,b,o),e[0]=o,e[1]=l,e[2]=b,e[3]=a):a=e[3];const p=t||void 0,N=!r&&"hidden";let m;e[4]!==N?(m=_("h-full w-full object-cover",N),e[4]=N,e[5]=m):m=e[5];let I,S;e[6]===Symbol.for("react.memo_cache_sentinel")?(I=()=>i(!1),S=()=>i(!0),e[6]=I,e[7]=S):(I=e[6],S=e[7]);let d;e[8]!==s||e[9]!==p||e[10]!==m?(d=h.jsx("img",{src:p,alt:s,className:m,onError:I,onLoad:S}),e[8]=s,e[9]=p,e[10]=m,e[11]=d):d=e[11];const v=r&&"hidden";let f;e[12]!==v?(f=_("h-full w-full flex items-center justify-center bg-muted/20",v),e[12]=v,e[13]=f):f=e[13];let x;e[14]!==c||e[15]!==n?(x=c??h.jsx(L,{size:y[n],className:"text-muted-foreground"}),e[14]=c,e[15]=n,e[16]=x):x=e[16];let u;e[17]!==f||e[18]!==x?(u=h.jsx("div",{className:f,children:x}),e[17]=f,e[18]=x,e[19]=u):u=e[19];let j;return e[20]!==d||e[21]!==u||e[22]!==a?(j=h.jsxs("div",{className:a,children:[d,u]}),e[20]=d,e[21]=u,e[22]=a,e[23]=j):j=e[23],j}export{q as I};
1
+ import{e as A,j as h,r as z,c as _}from"./index-COlSsy5J.js";import{n as L}from"./XCircle-CpovmLEO.js";import{A as k}from"./agent-icon-B1KjkGhC.js";const C={"2xs":"h-4 w-4",xs:"h-6 w-6",sm:"h-9 w-9",md:"h-12 w-12",lg:"h-16 w-16",xl:"h-14 w-14"},Z={"2xs":"min-w-4",xs:"min-w-6",sm:"min-w-9",md:"min-w-12",lg:"min-w-16",xl:"min-w-14"},y={"2xs":8,xs:12,sm:16,md:24,lg:32,xl:28},M={"2xs":"xs",xs:"xs",sm:"sm",md:"md",lg:"lg",xl:"lg"};function q(E){const e=A.c(12),{icon:t,name:s,size:w,className:o,fallbackIcon:c}=E,n=w===void 0?"md":w;if(t?.startsWith("icon://")||t?.includes("#agentcolor=")){const r=M[n];let l;return e[0]!==o||e[1]!==t||e[2]!==s||e[3]!==r?(l=h.jsx(k,{icon:t,name:s,size:r,className:o}),e[0]=o,e[1]=t,e[2]=s,e[3]=r,e[4]=l):l=e[4],l}const g=t??"no-icon";let i;return e[5]!==o||e[6]!==c||e[7]!==t||e[8]!==s||e[9]!==n||e[10]!==g?(i=h.jsx(R,{icon:t,name:s,size:n,className:o,fallbackIcon:c},g),e[5]=o,e[6]=c,e[7]=t,e[8]=s,e[9]=n,e[10]=g,e[11]=i):i=e[11],i}function R(E){const e=A.c(24),{icon:t,name:s,size:w,className:o,fallbackIcon:c}=E,n=w===void 0?"md":w,[g,i]=z.useState(!1),r=!!t&&g,l=C[n],b=Z[n];let a;e[0]!==o||e[1]!==l||e[2]!==b?(a=_("rounded-lg border border-border shrink-0 overflow-hidden aspect-square bg-white",l,b,o),e[0]=o,e[1]=l,e[2]=b,e[3]=a):a=e[3];const p=t||void 0,N=!r&&"hidden";let m;e[4]!==N?(m=_("h-full w-full object-cover",N),e[4]=N,e[5]=m):m=e[5];let I,S;e[6]===Symbol.for("react.memo_cache_sentinel")?(I=()=>i(!1),S=()=>i(!0),e[6]=I,e[7]=S):(I=e[6],S=e[7]);let d;e[8]!==s||e[9]!==p||e[10]!==m?(d=h.jsx("img",{src:p,alt:s,className:m,onError:I,onLoad:S}),e[8]=s,e[9]=p,e[10]=m,e[11]=d):d=e[11];const v=r&&"hidden";let f;e[12]!==v?(f=_("h-full w-full flex items-center justify-center bg-muted/20",v),e[12]=v,e[13]=f):f=e[13];let x;e[14]!==c||e[15]!==n?(x=c??h.jsx(L,{size:y[n],className:"text-muted-foreground"}),e[14]=c,e[15]=n,e[16]=x):x=e[16];let u;e[17]!==f||e[18]!==x?(u=h.jsx("div",{className:f,children:x}),e[17]=f,e[18]=x,e[19]=u):u=e[19];let j;return e[20]!==d||e[21]!==u||e[22]!==a?(j=h.jsxs("div",{className:a,children:[d,u]}),e[20]=d,e[21]=u,e[22]=a,e[23]=j):j=e[23],j}export{q as I};
@@ -1 +1 @@
1
- import{e as n,c as r,j as i,bF as p}from"./index-C3gL9St4.js";function c(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=r("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(p,{"data-slot":"label",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{c as L};
1
+ import{e as n,c as r,j as i,bF as p}from"./index-COlSsy5J.js";function c(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=r("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(p,{"data-slot":"label",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{c as L};
@@ -1 +1 @@
1
- import{u as X,r as m,a as z,t as P,b,j as e,c as B,B as Q,d as ie,S as W,N as oe,e as le}from"./index-C3gL9St4.js";import{I}from"./input-BvSXiwAq.js";import{A as de}from"./auth-split-layout-BUqeR5HU.js";function ce({redirectUrl:s,callbackUrl:n="/"}){const{emailAndPassword:d,resetPassword:u,emailOtp:i,socialProviders:l}=X(),[r,j]=m.useState(""),[y,D]=m.useState(""),[w,C]=m.useState(""),[A,O]=m.useState(""),[f,L]=m.useState(!1),[F,N]=m.useState(()=>i.enabled?"emailOtp":globalThis.localStorage?.getItem("hasLoggedIn")!=="true"?"signUp":"signIn"),[c,S]=m.useState(""),[$,Y]=m.useState(!1),h=F==="signUp",p=F==="forgotPassword",x=F==="emailOtp",R=z({mutationFn:async({email:t,password:a,name:q})=>{try{if(h){const g=await b.signUp.email({email:t,password:a,name:q||""});if(g.error)throw new Error(g.error.message||"Sign up failed");return g}else{const g=await b.signIn.email({email:t,password:a});if(g.error)throw new Error(g.error.message||"Sign in failed");return g}}catch(g){throw g instanceof Error?g:new Error("Authentication failed")}},onSuccess:()=>{globalThis.localStorage?.setItem("hasLoggedIn","true"),window.location.href=s??n},onError:t=>{P(h?"user_signup_failed":"user_signin_failed",{error:t instanceof Error?t.message:String(t)})}}),U=z({mutationFn:async({email:t})=>{const a=await b.requestPasswordReset({email:t,redirectTo:"/reset-password"});if(a.error)throw new Error(a.error.message||"Failed to send reset email");return a},onSuccess:()=>{P("password_reset_requested"),Y(!0)},onError:t=>{P("password_reset_request_failed",{error:t instanceof Error?t.message:String(t)})}}),E=z({mutationFn:async({email:t})=>{const a=await b.emailOtp.sendVerificationOtp({email:t,type:"sign-in"});if(a.error)throw new Error(a.error.message||"Failed to send code");return a},onSuccess:()=>{P("email_otp_sent"),L(!0)},onError:t=>{P("email_otp_send_failed",{error:t instanceof Error?t.message:String(t)})}}),_=z({mutationFn:async({email:t,otp:a})=>{const q=await b.signIn.emailOtp({email:t,otp:a});if(q.error)throw new Error(q.error.message||"Invalid code");return q},onSuccess:()=>{globalThis.localStorage?.setItem("hasLoggedIn","true"),window.location.href=s??n},onError:t=>{P("email_otp_verify_failed",{error:t instanceof Error?t.message:String(t)})}}),T=t=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t),V=()=>{r.trim()&&!T(r)&&S("Invalid email address")},Z=t=>{if(t.preventDefault(),!T(r)){S("Invalid email address");return}R.mutate({email:r,password:y,name:w})},ee=t=>{if(t.preventDefault(),!T(r)){S("Invalid email address");return}U.mutate({email:r})},te=t=>{if(t.preventDefault(),!T(r)){S("Invalid email address");return}E.mutate({email:r})},se=t=>{t.preventDefault(),_.mutate({email:r,otp:A})},k=t=>a=>{t(a.target.value),G&&R.reset(),H&&U.reset(),J&&(E.reset(),_.reset()),t===j&&c&&S("")},M=t=>{N(t),C(""),O(""),L(!1),S(""),Y(!1),R.reset(),U.reset(),E.reset(),_.reset()},o=R.isPending||U.isPending||E.isPending||_.isPending,G=R.error,H=U.error,J=E.error||_.error,v=h?r.trim()&&y.trim()&&w.trim():p?r.trim():x?f?A.trim():r.trim():r.trim()&&y.trim(),ne=t=>{if(!t)return null;const a=t.message.toLowerCase();return a.includes("unauthorized")||a.includes("401")?"Invalid email or password. Please try again.":a.includes("already exists")||a.includes("409")?"An account with this email already exists. Try signing in instead.":a.includes("network")||a.includes("fetch")?"Network error. Please check your connection and try again.":a.includes("rate limit")||a.includes("429")?"Too many attempts. Please wait a moment and try again.":a.includes("invalid")&&a.includes("otp")?"Invalid or expired code. Please try again.":t.message||"An error occurred. Please try again."},K=G||H||J,re=p?"Reset your password":x&&f?"Enter verification code":"Welcome to deco",ae=p?"We'll send you a reset link":x&&f?`Code sent to ${r}`:"Sign in or create a new account";return e.jsxs("div",{className:"w-full grid gap-10",children:[e.jsxs("div",{children:[e.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),e.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h1",{className:"text-2xl font-medium leading-8",children:re}),e.jsx("p",{className:"text-base text-muted-foreground leading-6",children:ae})]}),K&&e.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:ne(K)}),$&&e.jsx("div",{className:"rounded-xl bg-emerald-500/10 p-3 text-sm text-emerald-600 dark:text-emerald-400 text-center",children:"Check your email for a password reset link."}),!p&&!(x&&f)&&l.enabled&&e.jsx("div",{className:"grid gap-2",children:l.providers.map(t=>e.jsxs("button",{type:"button",disabled:o,onClick:()=>{b.signIn.social({provider:t.name,callbackURL:s??n})},className:"flex h-12 w-full items-center justify-center gap-3 rounded-xl bg-background dark:bg-input/30 px-3 text-sm font-medium text-foreground card-shadow transition-colors hover:bg-accent hover:text-accent-foreground dark:hover:bg-input/50 disabled:opacity-50 disabled:pointer-events-none",children:[t.icon&&e.jsx("img",{src:t.icon,alt:"",className:B("h-5 w-5",t.name==="github"&&"dark:invert"),"aria-hidden":"true"}),"Continue with"," ",t.name.charAt(0).toUpperCase()+t.name.slice(1)]},t.name))}),!p&&!(x&&f)&&l.enabled&&(d.enabled||i.enabled)&&e.jsxs("div",{className:"flex items-center gap-2.5 -my-4",children:[e.jsx("div",{className:"h-px flex-1 bg-border"}),e.jsx("span",{className:"text-base text-muted-foreground",children:"or"}),e.jsx("div",{className:"h-px flex-1 bg-border"})]}),x&&i.enabled&&e.jsx(e.Fragment,{children:f?e.jsxs("form",{onSubmit:se,className:"grid gap-2",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:"Verification code"}),e.jsx(I,{type:"text",placeholder:"Enter code",value:A,onChange:k(O),required:!0,disabled:o,autoFocus:!0,inputMode:"numeric",autoComplete:"one-time-code",className:"h-11 rounded-lg"})]}),e.jsx("button",{type:"submit",disabled:o||!v,className:"flex h-12 w-full items-center justify-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:opacity-50 disabled:pointer-events-none",children:o?"Verifying...":"Verify"}),e.jsx("button",{type:"button",onClick:()=>{L(!1),O(""),E.reset(),_.reset()},disabled:o,className:"mt-1 text-sm text-muted-foreground hover:text-foreground transition-colors",children:"Use a different email"})]}):e.jsxs("form",{onSubmit:te,className:"grid gap-2",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:"Email"}),e.jsx(I,{type:"email",placeholder:"Email address",value:r,onChange:k(j),onBlur:V,required:!0,disabled:o,"aria-invalid":!!c,className:"h-11 rounded-lg"}),c&&e.jsx("p",{className:"text-xs text-destructive",children:c})]}),e.jsx("button",{type:"submit",disabled:o||!v,className:"flex h-12 w-full items-center justify-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:opacity-50 disabled:pointer-events-none",children:o?"Sending...":"Send code"})]})}),p&&d.enabled&&!$&&e.jsxs("form",{onSubmit:ee,className:"grid gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Email"}),e.jsx(I,{type:"email",placeholder:"you@example.com",value:r,onChange:k(j),onBlur:V,required:!0,disabled:o,"aria-invalid":!!c,className:"h-11 rounded-lg"}),c&&e.jsx("p",{className:"text-xs text-destructive mt-1.5",children:c})]}),e.jsx(Q,{type:"submit",disabled:o||!v,className:"w-full font-semibold",size:"xl",children:o?"Sending...":"Send reset link"})]}),!p&&!x&&d.enabled&&e.jsxs("form",{onSubmit:Z,className:"grid gap-5",children:[h&&e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Name"}),e.jsx(I,{type:"text",placeholder:"Your name",value:w,onChange:k(C),required:!0,disabled:o,className:"h-11 rounded-lg"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Email"}),e.jsx(I,{type:"email",placeholder:"you@example.com",value:r,onChange:k(j),onBlur:V,required:!0,disabled:o,"aria-invalid":!!c,className:"h-11 rounded-lg"}),c&&e.jsx("p",{className:"text-xs text-destructive mt-1.5",children:c})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("label",{className:"block text-sm font-medium text-foreground",children:"Password"}),!h&&u.enabled&&e.jsx("button",{type:"button",onClick:()=>M("forgotPassword"),className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:"Forgot password?"})]}),e.jsx(I,{type:"password",placeholder:"••••••••",value:y,onChange:k(D),required:!0,disabled:o,className:"h-11 rounded-lg"})]}),e.jsx("div",{className:B("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",v?"max-h-[100px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:e.jsx("div",{className:B("p-1",!v&&"pointer-events-none"),children:e.jsx(Q,{type:"submit",disabled:o||!v,className:B("w-full font-semibold"),size:"xl","aria-hidden":!v,children:o?h?"Creating account...":"Signing in...":"Continue"})})})]}),e.jsx("div",{className:"text-sm text-muted-foreground",children:p?e.jsx("button",{type:"button",onClick:()=>M("signIn"),disabled:o,className:"font-medium text-[#8CAA25] hover:underline disabled:opacity-50",children:"Back to sign in"}):x&&d.enabled?e.jsx("button",{type:"button",onClick:()=>M("signIn"),disabled:o,className:"font-medium text-[#8CAA25] hover:underline disabled:opacity-50",children:"Sign in with password instead"}):!x&&d.enabled?e.jsxs(e.Fragment,{children:[h?"Already have an account? ":"Don't have an account? ",e.jsx("button",{type:"button",onClick:()=>M(h?"signIn":"signUp"),disabled:o,className:"font-medium text-[#8CAA25] hover:underline disabled:opacity-50",children:h?"Sign in":"Sign up"}),i.enabled&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"mx-2",children:"·"}),e.jsx("button",{type:"button",onClick:()=>M("emailOtp"),disabled:o,className:"font-medium text-[#8CAA25] hover:underline disabled:opacity-50",children:"Sign in with email code"})]})]}):null})]})}function ue({redirectTo:s}){const[n,d]=m.useState(null);return m.useEffect(()=>{let u=!1;return(async()=>{try{let i;for(let l=0;l<5&&(i=await fetch("/api/auth/custom/local-session",{method:"POST",credentials:"include"}),!(i.ok||i.status<500));l++)await new Promise(r=>setTimeout(r,Math.min(1e3*2**l,1e4)));if(!i?.ok){const l=await i?.json().catch(()=>({}));throw new Error(l?.error||"Auto-login failed")}if(!u){const l=s.startsWith("/")&&!s.startsWith("//")?s:"/";window.location.href=l}}catch(i){u||d(i instanceof Error?i.message:"Auto-login failed")}})(),()=>{u=!0}},[s]),n?e.jsx("div",{className:"flex min-h-screen items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsxs("p",{className:"text-destructive mb-2",children:["Auto-login failed: ",n]}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Try restarting the server."})]})}):e.jsx(W,{})}function me(s){if(!s.client_id||s.response_type!=="code")return null;const n=new URLSearchParams;return s.client_id&&n.set("client_id",s.client_id),s.redirect_uri&&n.set("redirect_uri",s.redirect_uri),s.response_type&&n.set("response_type",s.response_type),s.state&&n.set("state",s.state),s.scope&&n.set("scope",s.scope),s.code_challenge&&n.set("code_challenge",s.code_challenge),s.code_challenge_method&&n.set("code_challenge_method",s.code_challenge_method),`/api/auth/mcp/authorize?${n.toString()}`}function ge(s){const n=le.c(5),{callbackURL:d,providerId:u}=s;let i,l;n[0]!==d||n[1]!==u?(i=()=>{(async()=>await b.signIn.sso({providerId:u,callbackURL:d}))()},l=[u,d],n[0]=d,n[1]=u,n[2]=i,n[3]=l):(i=n[2],l=n[3]),m.useEffect(i,l);let r;return n[4]===Symbol.for("react.memo_cache_sentinel")?(r=e.jsx(W,{}),n[4]=r):r=n[4],r}function pe(){const s=b.useSession(),n=ie({from:"/login"}),{next:d="/",client_id:u,redirect_uri:i,response_type:l,state:r,scope:j,code_challenge:y,code_challenge_method:D}=n,w=d.startsWith("/")&&!d.startsWith("//")?d:"/",{sso:C,emailAndPassword:A,magicLink:O,emailOtp:f,socialProviders:L,localMode:F}=X(),N=me({client_id:u,redirect_uri:i,response_type:l,state:r,scope:j,code_challenge:y,code_challenge_method:D}),c=N||w;return s.data?N?(window.location.href=N,e.jsx(W,{})):e.jsx(oe,{to:w}):F?e.jsx(ue,{redirectTo:c}):C.enabled?e.jsx(ge,{callbackURL:c,providerId:C.providerId}):A.enabled||O.enabled||f.enabled||L.enabled?e.jsx(de,{children:e.jsx(ce,{redirectUrl:N,callbackUrl:w})}):e.jsx("div",{children:"No login options available"})}export{pe as default};
1
+ import{u as X,r as m,a as z,t as P,b,j as e,c as B,B as Q,d as ie,S as W,N as oe,e as le}from"./index-COlSsy5J.js";import{I}from"./input-CuVtlRv5.js";import{A as de}from"./auth-split-layout-DeC-35_z.js";function ce({redirectUrl:s,callbackUrl:n="/"}){const{emailAndPassword:d,resetPassword:u,emailOtp:i,socialProviders:l}=X(),[r,j]=m.useState(""),[y,D]=m.useState(""),[w,C]=m.useState(""),[A,O]=m.useState(""),[f,L]=m.useState(!1),[F,N]=m.useState(()=>i.enabled?"emailOtp":globalThis.localStorage?.getItem("hasLoggedIn")!=="true"?"signUp":"signIn"),[c,S]=m.useState(""),[$,Y]=m.useState(!1),h=F==="signUp",p=F==="forgotPassword",x=F==="emailOtp",R=z({mutationFn:async({email:t,password:a,name:q})=>{try{if(h){const g=await b.signUp.email({email:t,password:a,name:q||""});if(g.error)throw new Error(g.error.message||"Sign up failed");return g}else{const g=await b.signIn.email({email:t,password:a});if(g.error)throw new Error(g.error.message||"Sign in failed");return g}}catch(g){throw g instanceof Error?g:new Error("Authentication failed")}},onSuccess:()=>{globalThis.localStorage?.setItem("hasLoggedIn","true"),window.location.href=s??n},onError:t=>{P(h?"user_signup_failed":"user_signin_failed",{error:t instanceof Error?t.message:String(t)})}}),U=z({mutationFn:async({email:t})=>{const a=await b.requestPasswordReset({email:t,redirectTo:"/reset-password"});if(a.error)throw new Error(a.error.message||"Failed to send reset email");return a},onSuccess:()=>{P("password_reset_requested"),Y(!0)},onError:t=>{P("password_reset_request_failed",{error:t instanceof Error?t.message:String(t)})}}),E=z({mutationFn:async({email:t})=>{const a=await b.emailOtp.sendVerificationOtp({email:t,type:"sign-in"});if(a.error)throw new Error(a.error.message||"Failed to send code");return a},onSuccess:()=>{P("email_otp_sent"),L(!0)},onError:t=>{P("email_otp_send_failed",{error:t instanceof Error?t.message:String(t)})}}),_=z({mutationFn:async({email:t,otp:a})=>{const q=await b.signIn.emailOtp({email:t,otp:a});if(q.error)throw new Error(q.error.message||"Invalid code");return q},onSuccess:()=>{globalThis.localStorage?.setItem("hasLoggedIn","true"),window.location.href=s??n},onError:t=>{P("email_otp_verify_failed",{error:t instanceof Error?t.message:String(t)})}}),T=t=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t),V=()=>{r.trim()&&!T(r)&&S("Invalid email address")},Z=t=>{if(t.preventDefault(),!T(r)){S("Invalid email address");return}R.mutate({email:r,password:y,name:w})},ee=t=>{if(t.preventDefault(),!T(r)){S("Invalid email address");return}U.mutate({email:r})},te=t=>{if(t.preventDefault(),!T(r)){S("Invalid email address");return}E.mutate({email:r})},se=t=>{t.preventDefault(),_.mutate({email:r,otp:A})},k=t=>a=>{t(a.target.value),G&&R.reset(),H&&U.reset(),J&&(E.reset(),_.reset()),t===j&&c&&S("")},M=t=>{N(t),C(""),O(""),L(!1),S(""),Y(!1),R.reset(),U.reset(),E.reset(),_.reset()},o=R.isPending||U.isPending||E.isPending||_.isPending,G=R.error,H=U.error,J=E.error||_.error,v=h?r.trim()&&y.trim()&&w.trim():p?r.trim():x?f?A.trim():r.trim():r.trim()&&y.trim(),ne=t=>{if(!t)return null;const a=t.message.toLowerCase();return a.includes("unauthorized")||a.includes("401")?"Invalid email or password. Please try again.":a.includes("already exists")||a.includes("409")?"An account with this email already exists. Try signing in instead.":a.includes("network")||a.includes("fetch")?"Network error. Please check your connection and try again.":a.includes("rate limit")||a.includes("429")?"Too many attempts. Please wait a moment and try again.":a.includes("invalid")&&a.includes("otp")?"Invalid or expired code. Please try again.":t.message||"An error occurred. Please try again."},K=G||H||J,re=p?"Reset your password":x&&f?"Enter verification code":"Welcome to deco",ae=p?"We'll send you a reset link":x&&f?`Code sent to ${r}`:"Sign in or create a new account";return e.jsxs("div",{className:"w-full grid gap-10",children:[e.jsxs("div",{children:[e.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),e.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h1",{className:"text-2xl font-medium leading-8",children:re}),e.jsx("p",{className:"text-base text-muted-foreground leading-6",children:ae})]}),K&&e.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:ne(K)}),$&&e.jsx("div",{className:"rounded-xl bg-emerald-500/10 p-3 text-sm text-emerald-600 dark:text-emerald-400 text-center",children:"Check your email for a password reset link."}),!p&&!(x&&f)&&l.enabled&&e.jsx("div",{className:"grid gap-2",children:l.providers.map(t=>e.jsxs("button",{type:"button",disabled:o,onClick:()=>{b.signIn.social({provider:t.name,callbackURL:s??n})},className:"flex h-12 w-full items-center justify-center gap-3 rounded-xl bg-background dark:bg-input/30 px-3 text-sm font-medium text-foreground card-shadow transition-colors hover:bg-accent hover:text-accent-foreground dark:hover:bg-input/50 disabled:opacity-50 disabled:pointer-events-none",children:[t.icon&&e.jsx("img",{src:t.icon,alt:"",className:B("h-5 w-5",t.name==="github"&&"dark:invert"),"aria-hidden":"true"}),"Continue with"," ",t.name.charAt(0).toUpperCase()+t.name.slice(1)]},t.name))}),!p&&!(x&&f)&&l.enabled&&(d.enabled||i.enabled)&&e.jsxs("div",{className:"flex items-center gap-2.5 -my-4",children:[e.jsx("div",{className:"h-px flex-1 bg-border"}),e.jsx("span",{className:"text-base text-muted-foreground",children:"or"}),e.jsx("div",{className:"h-px flex-1 bg-border"})]}),x&&i.enabled&&e.jsx(e.Fragment,{children:f?e.jsxs("form",{onSubmit:se,className:"grid gap-2",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:"Verification code"}),e.jsx(I,{type:"text",placeholder:"Enter code",value:A,onChange:k(O),required:!0,disabled:o,autoFocus:!0,inputMode:"numeric",autoComplete:"one-time-code",className:"h-11 rounded-lg"})]}),e.jsx("button",{type:"submit",disabled:o||!v,className:"flex h-12 w-full items-center justify-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:opacity-50 disabled:pointer-events-none",children:o?"Verifying...":"Verify"}),e.jsx("button",{type:"button",onClick:()=>{L(!1),O(""),E.reset(),_.reset()},disabled:o,className:"mt-1 text-sm text-muted-foreground hover:text-foreground transition-colors",children:"Use a different email"})]}):e.jsxs("form",{onSubmit:te,className:"grid gap-2",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:"Email"}),e.jsx(I,{type:"email",placeholder:"Email address",value:r,onChange:k(j),onBlur:V,required:!0,disabled:o,"aria-invalid":!!c,className:"h-11 rounded-lg"}),c&&e.jsx("p",{className:"text-xs text-destructive",children:c})]}),e.jsx("button",{type:"submit",disabled:o||!v,className:"flex h-12 w-full items-center justify-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:opacity-50 disabled:pointer-events-none",children:o?"Sending...":"Send code"})]})}),p&&d.enabled&&!$&&e.jsxs("form",{onSubmit:ee,className:"grid gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Email"}),e.jsx(I,{type:"email",placeholder:"you@example.com",value:r,onChange:k(j),onBlur:V,required:!0,disabled:o,"aria-invalid":!!c,className:"h-11 rounded-lg"}),c&&e.jsx("p",{className:"text-xs text-destructive mt-1.5",children:c})]}),e.jsx(Q,{type:"submit",disabled:o||!v,className:"w-full font-semibold",size:"xl",children:o?"Sending...":"Send reset link"})]}),!p&&!x&&d.enabled&&e.jsxs("form",{onSubmit:Z,className:"grid gap-5",children:[h&&e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Name"}),e.jsx(I,{type:"text",placeholder:"Your name",value:w,onChange:k(C),required:!0,disabled:o,className:"h-11 rounded-lg"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Email"}),e.jsx(I,{type:"email",placeholder:"you@example.com",value:r,onChange:k(j),onBlur:V,required:!0,disabled:o,"aria-invalid":!!c,className:"h-11 rounded-lg"}),c&&e.jsx("p",{className:"text-xs text-destructive mt-1.5",children:c})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("label",{className:"block text-sm font-medium text-foreground",children:"Password"}),!h&&u.enabled&&e.jsx("button",{type:"button",onClick:()=>M("forgotPassword"),className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:"Forgot password?"})]}),e.jsx(I,{type:"password",placeholder:"••••••••",value:y,onChange:k(D),required:!0,disabled:o,className:"h-11 rounded-lg"})]}),e.jsx("div",{className:B("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",v?"max-h-[100px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:e.jsx("div",{className:B("p-1",!v&&"pointer-events-none"),children:e.jsx(Q,{type:"submit",disabled:o||!v,className:B("w-full font-semibold"),size:"xl","aria-hidden":!v,children:o?h?"Creating account...":"Signing in...":"Continue"})})})]}),e.jsx("div",{className:"text-sm text-muted-foreground",children:p?e.jsx("button",{type:"button",onClick:()=>M("signIn"),disabled:o,className:"font-medium text-[#8CAA25] hover:underline disabled:opacity-50",children:"Back to sign in"}):x&&d.enabled?e.jsx("button",{type:"button",onClick:()=>M("signIn"),disabled:o,className:"font-medium text-[#8CAA25] hover:underline disabled:opacity-50",children:"Sign in with password instead"}):!x&&d.enabled?e.jsxs(e.Fragment,{children:[h?"Already have an account? ":"Don't have an account? ",e.jsx("button",{type:"button",onClick:()=>M(h?"signIn":"signUp"),disabled:o,className:"font-medium text-[#8CAA25] hover:underline disabled:opacity-50",children:h?"Sign in":"Sign up"}),i.enabled&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"mx-2",children:"·"}),e.jsx("button",{type:"button",onClick:()=>M("emailOtp"),disabled:o,className:"font-medium text-[#8CAA25] hover:underline disabled:opacity-50",children:"Sign in with email code"})]})]}):null})]})}function ue({redirectTo:s}){const[n,d]=m.useState(null);return m.useEffect(()=>{let u=!1;return(async()=>{try{let i;for(let l=0;l<5&&(i=await fetch("/api/auth/custom/local-session",{method:"POST",credentials:"include"}),!(i.ok||i.status<500));l++)await new Promise(r=>setTimeout(r,Math.min(1e3*2**l,1e4)));if(!i?.ok){const l=await i?.json().catch(()=>({}));throw new Error(l?.error||"Auto-login failed")}if(!u){const l=s.startsWith("/")&&!s.startsWith("//")?s:"/";window.location.href=l}}catch(i){u||d(i instanceof Error?i.message:"Auto-login failed")}})(),()=>{u=!0}},[s]),n?e.jsx("div",{className:"flex min-h-screen items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsxs("p",{className:"text-destructive mb-2",children:["Auto-login failed: ",n]}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Try restarting the server."})]})}):e.jsx(W,{})}function me(s){if(!s.client_id||s.response_type!=="code")return null;const n=new URLSearchParams;return s.client_id&&n.set("client_id",s.client_id),s.redirect_uri&&n.set("redirect_uri",s.redirect_uri),s.response_type&&n.set("response_type",s.response_type),s.state&&n.set("state",s.state),s.scope&&n.set("scope",s.scope),s.code_challenge&&n.set("code_challenge",s.code_challenge),s.code_challenge_method&&n.set("code_challenge_method",s.code_challenge_method),`/api/auth/mcp/authorize?${n.toString()}`}function ge(s){const n=le.c(5),{callbackURL:d,providerId:u}=s;let i,l;n[0]!==d||n[1]!==u?(i=()=>{(async()=>await b.signIn.sso({providerId:u,callbackURL:d}))()},l=[u,d],n[0]=d,n[1]=u,n[2]=i,n[3]=l):(i=n[2],l=n[3]),m.useEffect(i,l);let r;return n[4]===Symbol.for("react.memo_cache_sentinel")?(r=e.jsx(W,{}),n[4]=r):r=n[4],r}function pe(){const s=b.useSession(),n=ie({from:"/login"}),{next:d="/",client_id:u,redirect_uri:i,response_type:l,state:r,scope:j,code_challenge:y,code_challenge_method:D}=n,w=d.startsWith("/")&&!d.startsWith("//")?d:"/",{sso:C,emailAndPassword:A,magicLink:O,emailOtp:f,socialProviders:L,localMode:F}=X(),N=me({client_id:u,redirect_uri:i,response_type:l,state:r,scope:j,code_challenge:y,code_challenge_method:D}),c=N||w;return s.data?N?(window.location.href=N,e.jsx(W,{})):e.jsx(oe,{to:w}):F?e.jsx(ue,{redirectTo:c}):C.enabled?e.jsx(ge,{callbackURL:c,providerId:C.providerId}):A.enabled||O.enabled||f.enabled||L.enabled?e.jsx(de,{children:e.jsx(ce,{redirectUrl:N,callbackUrl:w})}):e.jsx("div",{children:"No login options available"})}export{pe as default};
@@ -1 +1 @@
1
- import{d as x,b as N,c as z,a as D}from"./auth-RitCYkp6.js";function E(t){let e=0;for(let n=0;n<t.length;n++){const r=t.charCodeAt(n);e=(e<<5)-e+r,e=e&e}return Math.abs(e).toString(16)}function H(){return window.location.origin}function C(){try{const t=window.location.hostname;return t==="localhost"||t.endsWith(".localhost")||t==="127.0.0.1"||t==="::1"}catch{return!1}}const M=new Map,R="mcp:oauth:callback:";class W{serverUrl;_clientMetadata;_redirectUrl;_windowMode;_state=null;_codeVerifier=null;_clientInfo=null;_tokens=null;constructor(e){this.serverUrl=e.serverUrl,this._redirectUrl=e.callbackUrl??`${H()}/oauth/callback`,this._windowMode=e.windowMode??"popup";const n=e.scope?Array.isArray(e.scope)?e.scope.join(" "):e.scope:void 0;this._clientMetadata={redirect_uris:[this._redirectUrl],token_endpoint_auth_method:"none",grant_types:["authorization_code","refresh_token"],response_types:["code"],client_name:e.clientName??"@decocms/mesh MCP client",...n&&{scope:n}},M.set(E(this.serverUrl),this)}get redirectUrl(){return this._redirectUrl}get clientMetadata(){return this._clientMetadata}state(){return this._state||(this._state=crypto.randomUUID()),this._state}getStoredState(){return this._state}clientInformation(){return this._clientInfo??void 0}saveClientInformation(e){this._clientInfo=e}tokens(){return this._tokens??void 0}saveTokens(e){this._tokens=e}redirectToAuthorization(e){if(this._windowMode==="tab"){if(!window.open(e.toString(),"_blank"))throw new Error("Tab was blocked")}else{const o=window.screenX+(window.outerWidth-600)/2,s=window.screenY+(window.outerHeight-700)/2;if(!window.open(e.toString(),"mcp-oauth",`width=600,height=700,left=${o},top=${s},popup=yes`)&&!window.open(e.toString(),"_blank"))throw new Error("Popup was blocked")}}saveCodeVerifier(e){this._codeVerifier=e}codeVerifier(){if(!this._codeVerifier)throw new Error("Code verifier not found");return this._codeVerifier}invalidateCredentials(){this._clientInfo=null,this._tokens=null,this._codeVerifier=null,this._state=null}getServerUrl(){return this.serverUrl}cleanup(){M.delete(E(this.serverUrl))}}async function G(t){const e=t.meshUrl??window.location.origin,n=t.orgSlug?`/api/${encodeURIComponent(t.orgSlug)}/mcp/${t.connectionId}`:`/mcp/${t.connectionId}`,r=new URL(n,e),o=new W({serverUrl:r.href,clientName:t.clientName,clientUri:t.clientUri,callbackUrl:t.callbackUrl,scope:t.scope,windowMode:t.windowMode}),s={fn:null};try{const i=new Promise((l,d)=>{const k=t.timeout||12e4;let b,p=!1;const L=o.state(),A=`${R}${L}`,h=()=>{window.removeEventListener("message",v),window.removeEventListener("storage",O),clearTimeout(b);try{localStorage.removeItem(A)}catch{}};s.fn=u=>{p||(p=!0,h(),d(u))};const U=async u=>{if(p)return;if(p=!0,!u.success){h(),d(new Error(u.error||"OAuth authentication failed"));return}const{code:m,state:$}=u;if(!m){h(),d(new Error("Missing authorization code"));return}if(o.getStoredState()!==$){h(),d(new Error("OAuth state mismatch - possible CSRF attack"));return}try{const T=(await x(r))?.authorization_servers?.[0]||r,S=await N(T),g=o.clientInformation();if(!g){h(),d(new Error("Client information not found"));return}const P=o.codeVerifier(),V=await z(T,{metadata:S,clientInformation:g,authorizationCode:m,codeVerifier:P,redirectUri:o.redirectUrl,resource:new URL(r)});h(),l({tokens:V,clientId:g.client_id??null,clientSecret:"client_secret"in g?g.client_secret:null,tokenEndpoint:S?.token_endpoint??null,userinfoEndpoint:S?.userinfo_endpoint??null})}catch(I){h(),d(I)}},v=async u=>{!C()&&u.origin!==window.location.origin||u.data?.type==="mcp:oauth:callback"&&await U(u.data)},O=async u=>{if(!(u.key!==A||!u.newValue))try{const m=JSON.parse(u.newValue);await U(m)}catch{}};window.addEventListener("message",v),window.addEventListener("storage",O),b=setTimeout(()=>{p||(p=!0,h(),d(new Error("OAuth authentication timeout")))},k)});if(i.catch(()=>{}),await D(o,{serverUrl:r})==="REDIRECT"){const l=await i,d=l.tokens;return{token:l.tokens.access_token,tokenInfo:{accessToken:l.tokens.access_token,refreshToken:l.tokens.refresh_token??null,expiresIn:l.tokens.expires_in??null,scope:l.tokens.scope??null,clientId:l.clientId,clientSecret:l.clientSecret,tokenEndpoint:l.tokenEndpoint,userinfoEndpoint:l.userinfoEndpoint,idToken:typeof d.id_token=="string"?d.id_token:null},error:null}}const a=o.tokens(),w=o.clientInformation(),f=a;return{token:a?.access_token||null,tokenInfo:a?{accessToken:a.access_token,refreshToken:a.refresh_token??null,expiresIn:a.expires_in??null,scope:a.scope??null,clientId:w?.client_id??null,clientSecret:w&&"client_secret"in w?w.client_secret:null,tokenEndpoint:null,userinfoEndpoint:null,idToken:f&&typeof f.id_token=="string"?f.id_token:null}:null,error:null}}catch(i){return s.fn&&s.fn(i instanceof Error?i:new Error(String(i))),{token:null,tokenInfo:null,error:i instanceof Error?i.message:String(i)}}finally{o.cleanup()}}function y(t,e){if(window.opener&&!window.opener.closed){const n=C()?"*":window.location.origin;return window.opener.postMessage(t,n),!0}if(e)try{const n=`${R}${e}`;return localStorage.setItem(n,JSON.stringify(t)),!0}catch{}return!1}async function X(){const t=new URLSearchParams(window.location.search),e=t.get("code");let n=t.get("state");const r=t.get("error"),o=t.get("error_description");let s=n;if(n)try{const c=atob(n),a=JSON.parse(c);a.clientState&&(s=a.clientState)}catch{}if(r){const c=o||r;return y({type:"mcp:oauth:callback",success:!1,error:c},s),{success:!1,error:c}}if(!e||!n){const c="Missing code or state parameter";return y({type:"mcp:oauth:callback",success:!1,error:c},s),{success:!1,error:c}}return n=s||n,y({type:"mcp:oauth:callback",success:!0,code:e,state:n},n)?{success:!0}:{success:!1,error:"Parent window not available"}}function _(){if(typeof window<"u"&&window.location?.origin)return window.location.origin}function j(t){try{const e=_(),n=e?new URL(t,e):new URL(t),r=n.pathname.match(/^\/api\/[^/]+\/mcp\/([^/]+)/);return r?r[1]??null:n.pathname.match(/^\/mcp\/([^/]+)/)?.[1]??null}catch{return null}}function J(t){try{const e=_();return(e?new URL(t,e):new URL(t)).pathname.match(/^\/api\/([^/]+)\/mcp\//)?.[1]??null}catch{return null}}async function K(t,e,n){try{const r=`/api/${encodeURIComponent(e)}/connections/${t}/oauth-token/status`,o=n?new URL(r,n).href:r,s=_(),i=!n||new URL(n).origin===s,c=await fetch(o,{credentials:i?"include":"omit"});return c.ok?{hasToken:(await c.json()).hasToken===!0}:{hasToken:!1}}catch{return{hasToken:!1}}}async function q({url:t,token:e,orgId:n,meshUrl:r}){try{const o=new Headers;o.set("Content-Type","application/json"),o.set("Accept","application/json, text/event-stream");const s=await fetch(t,{method:"POST",headers:o,body:JSON.stringify({jsonrpc:"2.0",id:1,method:"initialize",params:{protocolVersion:"2025-06-18",capabilities:{},clientInfo:{name:"@decocms/mesh MCP client",version:"1.0.0"}}})}),i=j(t),c=J(t),a=_(),w=r??(a?new URL(t,a).origin:new URL(t).origin);if(s.ok)return{isAuthenticated:!0,supportsOAuth:!1,hasOAuthToken:(i&&c?await K(i,c,w):{hasToken:!1}).hasToken};let f;try{const k=await s.json();f=k.error||k.message}catch{}return s.status>=500?{isAuthenticated:!1,supportsOAuth:!1,hasOAuthToken:!1,error:f||`HTTP ${s.status}`,isServerError:!0}:{isAuthenticated:!1,supportsOAuth:!!s.headers.get("WWW-Authenticate"),hasOAuthToken:!1,error:f||`HTTP ${s.status}`}}catch(o){return console.error("[isConnectionAuthenticated] Error:",o),{isAuthenticated:!1,supportsOAuth:!1,hasOAuthToken:!1,error:o.message}}}export{G as a,X as h,q as i};
1
+ import{d as x,b as N,c as z,a as D}from"./auth-DA6X7KBB.js";function E(t){let e=0;for(let n=0;n<t.length;n++){const r=t.charCodeAt(n);e=(e<<5)-e+r,e=e&e}return Math.abs(e).toString(16)}function H(){return window.location.origin}function C(){try{const t=window.location.hostname;return t==="localhost"||t.endsWith(".localhost")||t==="127.0.0.1"||t==="::1"}catch{return!1}}const M=new Map,R="mcp:oauth:callback:";class W{serverUrl;_clientMetadata;_redirectUrl;_windowMode;_state=null;_codeVerifier=null;_clientInfo=null;_tokens=null;constructor(e){this.serverUrl=e.serverUrl,this._redirectUrl=e.callbackUrl??`${H()}/oauth/callback`,this._windowMode=e.windowMode??"popup";const n=e.scope?Array.isArray(e.scope)?e.scope.join(" "):e.scope:void 0;this._clientMetadata={redirect_uris:[this._redirectUrl],token_endpoint_auth_method:"none",grant_types:["authorization_code","refresh_token"],response_types:["code"],client_name:e.clientName??"@decocms/mesh MCP client",...n&&{scope:n}},M.set(E(this.serverUrl),this)}get redirectUrl(){return this._redirectUrl}get clientMetadata(){return this._clientMetadata}state(){return this._state||(this._state=crypto.randomUUID()),this._state}getStoredState(){return this._state}clientInformation(){return this._clientInfo??void 0}saveClientInformation(e){this._clientInfo=e}tokens(){return this._tokens??void 0}saveTokens(e){this._tokens=e}redirectToAuthorization(e){if(this._windowMode==="tab"){if(!window.open(e.toString(),"_blank"))throw new Error("Tab was blocked")}else{const o=window.screenX+(window.outerWidth-600)/2,s=window.screenY+(window.outerHeight-700)/2;if(!window.open(e.toString(),"mcp-oauth",`width=600,height=700,left=${o},top=${s},popup=yes`)&&!window.open(e.toString(),"_blank"))throw new Error("Popup was blocked")}}saveCodeVerifier(e){this._codeVerifier=e}codeVerifier(){if(!this._codeVerifier)throw new Error("Code verifier not found");return this._codeVerifier}invalidateCredentials(){this._clientInfo=null,this._tokens=null,this._codeVerifier=null,this._state=null}getServerUrl(){return this.serverUrl}cleanup(){M.delete(E(this.serverUrl))}}async function G(t){const e=t.meshUrl??window.location.origin,n=t.orgSlug?`/api/${encodeURIComponent(t.orgSlug)}/mcp/${t.connectionId}`:`/mcp/${t.connectionId}`,r=new URL(n,e),o=new W({serverUrl:r.href,clientName:t.clientName,clientUri:t.clientUri,callbackUrl:t.callbackUrl,scope:t.scope,windowMode:t.windowMode}),s={fn:null};try{const i=new Promise((l,d)=>{const k=t.timeout||12e4;let b,p=!1;const L=o.state(),A=`${R}${L}`,h=()=>{window.removeEventListener("message",v),window.removeEventListener("storage",O),clearTimeout(b);try{localStorage.removeItem(A)}catch{}};s.fn=u=>{p||(p=!0,h(),d(u))};const U=async u=>{if(p)return;if(p=!0,!u.success){h(),d(new Error(u.error||"OAuth authentication failed"));return}const{code:m,state:$}=u;if(!m){h(),d(new Error("Missing authorization code"));return}if(o.getStoredState()!==$){h(),d(new Error("OAuth state mismatch - possible CSRF attack"));return}try{const T=(await x(r))?.authorization_servers?.[0]||r,S=await N(T),g=o.clientInformation();if(!g){h(),d(new Error("Client information not found"));return}const P=o.codeVerifier(),V=await z(T,{metadata:S,clientInformation:g,authorizationCode:m,codeVerifier:P,redirectUri:o.redirectUrl,resource:new URL(r)});h(),l({tokens:V,clientId:g.client_id??null,clientSecret:"client_secret"in g?g.client_secret:null,tokenEndpoint:S?.token_endpoint??null,userinfoEndpoint:S?.userinfo_endpoint??null})}catch(I){h(),d(I)}},v=async u=>{!C()&&u.origin!==window.location.origin||u.data?.type==="mcp:oauth:callback"&&await U(u.data)},O=async u=>{if(!(u.key!==A||!u.newValue))try{const m=JSON.parse(u.newValue);await U(m)}catch{}};window.addEventListener("message",v),window.addEventListener("storage",O),b=setTimeout(()=>{p||(p=!0,h(),d(new Error("OAuth authentication timeout")))},k)});if(i.catch(()=>{}),await D(o,{serverUrl:r})==="REDIRECT"){const l=await i,d=l.tokens;return{token:l.tokens.access_token,tokenInfo:{accessToken:l.tokens.access_token,refreshToken:l.tokens.refresh_token??null,expiresIn:l.tokens.expires_in??null,scope:l.tokens.scope??null,clientId:l.clientId,clientSecret:l.clientSecret,tokenEndpoint:l.tokenEndpoint,userinfoEndpoint:l.userinfoEndpoint,idToken:typeof d.id_token=="string"?d.id_token:null},error:null}}const a=o.tokens(),w=o.clientInformation(),f=a;return{token:a?.access_token||null,tokenInfo:a?{accessToken:a.access_token,refreshToken:a.refresh_token??null,expiresIn:a.expires_in??null,scope:a.scope??null,clientId:w?.client_id??null,clientSecret:w&&"client_secret"in w?w.client_secret:null,tokenEndpoint:null,userinfoEndpoint:null,idToken:f&&typeof f.id_token=="string"?f.id_token:null}:null,error:null}}catch(i){return s.fn&&s.fn(i instanceof Error?i:new Error(String(i))),{token:null,tokenInfo:null,error:i instanceof Error?i.message:String(i)}}finally{o.cleanup()}}function y(t,e){if(window.opener&&!window.opener.closed){const n=C()?"*":window.location.origin;return window.opener.postMessage(t,n),!0}if(e)try{const n=`${R}${e}`;return localStorage.setItem(n,JSON.stringify(t)),!0}catch{}return!1}async function X(){const t=new URLSearchParams(window.location.search),e=t.get("code");let n=t.get("state");const r=t.get("error"),o=t.get("error_description");let s=n;if(n)try{const c=atob(n),a=JSON.parse(c);a.clientState&&(s=a.clientState)}catch{}if(r){const c=o||r;return y({type:"mcp:oauth:callback",success:!1,error:c},s),{success:!1,error:c}}if(!e||!n){const c="Missing code or state parameter";return y({type:"mcp:oauth:callback",success:!1,error:c},s),{success:!1,error:c}}return n=s||n,y({type:"mcp:oauth:callback",success:!0,code:e,state:n},n)?{success:!0}:{success:!1,error:"Parent window not available"}}function _(){if(typeof window<"u"&&window.location?.origin)return window.location.origin}function j(t){try{const e=_(),n=e?new URL(t,e):new URL(t),r=n.pathname.match(/^\/api\/[^/]+\/mcp\/([^/]+)/);return r?r[1]??null:n.pathname.match(/^\/mcp\/([^/]+)/)?.[1]??null}catch{return null}}function J(t){try{const e=_();return(e?new URL(t,e):new URL(t)).pathname.match(/^\/api\/([^/]+)\/mcp\//)?.[1]??null}catch{return null}}async function K(t,e,n){try{const r=`/api/${encodeURIComponent(e)}/connections/${t}/oauth-token/status`,o=n?new URL(r,n).href:r,s=_(),i=!n||new URL(n).origin===s,c=await fetch(o,{credentials:i?"include":"omit"});return c.ok?{hasToken:(await c.json()).hasToken===!0}:{hasToken:!1}}catch{return{hasToken:!1}}}async function q({url:t,token:e,orgId:n,meshUrl:r}){try{const o=new Headers;o.set("Content-Type","application/json"),o.set("Accept","application/json, text/event-stream");const s=await fetch(t,{method:"POST",headers:o,body:JSON.stringify({jsonrpc:"2.0",id:1,method:"initialize",params:{protocolVersion:"2025-06-18",capabilities:{},clientInfo:{name:"@decocms/mesh MCP client",version:"1.0.0"}}})}),i=j(t),c=J(t),a=_(),w=r??(a?new URL(t,a).origin:new URL(t).origin);if(s.ok)return{isAuthenticated:!0,supportsOAuth:!1,hasOAuthToken:(i&&c?await K(i,c,w):{hasToken:!1}).hasToken};let f;try{const k=await s.json();f=k.error||k.message}catch{}return s.status>=500?{isAuthenticated:!1,supportsOAuth:!1,hasOAuthToken:!1,error:f||`HTTP ${s.status}`,isServerError:!0}:{isAuthenticated:!1,supportsOAuth:!!s.headers.get("WWW-Authenticate"),hasOAuthToken:!1,error:f||`HTTP ${s.status}`}}catch(o){return console.error("[isConnectionAuthenticated] Error:",o),{isAuthenticated:!1,supportsOAuth:!1,hasOAuthToken:!1,error:o.message}}}export{G as a,X as h,q as i};
@@ -1,3 +1,3 @@
1
- import{v as $t,r as ce,p as he,F as ke,b as Dt,x as kt,a as xe,t as ue,n as G,K as ie,j as s,B as fe,e as J,a5 as Ft,m as Tt,c as $e,l as Xe,a1 as Ot}from"./index-C3gL9St4.js";import{C as Lt}from"./collection-display-button-Deigak_t.js";import{S as qt}from"./search-input-ChrXBjj7.js";import{P as _e}from"./index-Bf1YdrMc.js";import{u as It,C as Bt}from"./use-organization-roles-BXV_PsbS.js";import{E as We}from"./empty-state-Cz0bAkoo.js";import{d as Kt,i as Vt,c as Qt,D as Ut,a as Gt,e as Jt}from"./dialog-jhtlYWQH.js";import{a as Ht,F as rt,b as ct,c as Wt,d as mt,f as dt}from"./form-rLORGBZw.js";import{d as et,b as tt,c as st,S as nt,a as it}from"./select-gQvIO328.js";import{T as Yt}from"./textarea-BVXgXW3B.js";import{u as lt}from"./use-org-auth-client-wIGZzMQc.js";import{b as Zt,S as Xt,a as es}from"./settings-section-0NTS3MkI.js";import{a as ts,u as ss}from"./use-join-requests-Dl6EohPu.js";import{A as De}from"./avatar-Nw1x5eGz.js";import{u as ns}from"./use-members-DJNn_Bxw.js";import{u as Fe}from"./studio-tools-B1vmC7k4.js";import{T as is,a as as,c as ls,b as os}from"./tooltip-D9KNvVvr.js";import{a as ut,e as ft,g as ht,b as pt,c as gt,d as xt,A as bt,f as jt}from"./alert-dialog-C20YoJ0a.js";import{B as Ue}from"./badge-CuCfPx-y.js";import{C as vt}from"./card-yVmBUFAg.js";import{D as At,a as Pt,b as Mt,d as rs,e as cs,f as ms,c as at,g as ds}from"./dropdown-menu-B4AhYSKY.js";import{a as Et}from"./DotsVertical-DQ-WKmA2.js";import{i as us}from"./Key01-B-9ep-9Z.js";import{i as fs}from"./Shield01-M8Hvv7sS.js";import{a as hs}from"./SwitchHorizontal01-X5LMtCou.js";import{s as ps}from"./Trash01-Cib_Sg7t.js";import{s as _t}from"./XClose-BtRDneKm.js";import{C as Ct}from"./checkbox-BMArZ_ix.js";import{e as Ye,a as Ze,f as yt,C as gs,c as xs,d as bs,b as js}from"./command-P8Wd0xDH.js";import{b as vs,P as Cs,a as ys}from"./popover-sSylEgHu.js";import{t as Ss}from"./ChevronDown-6sFYQ_lK.js";import{s as ws}from"./Plus-J1K3Rh3s.js";import{R as Ns}from"./require-capability-CHNIB1jg.js";import"./ChevronUp-BNOOOsT2.js";import"./view-mode-toggle-CHlCGyzP.js";import"./SearchMd-CjaRzuTt.js";import"./sidebar-B5eoEEUh.js";import"./LayoutLeft-XZqot3mq.js";import"./sheet-BBNc6H-H.js";import"./X-BL2gdXEj.js";import"./table-Borl2aRc.js";import"./label-vllYe6cM.js";import"./ArrowUpRight-CfMwsozc.js";import"./use-capability-BgNNCaLI.js";import"./User01-BywBiT-b.js";import"./ChevronRight-BdMquS3m.js";import"./index-DqifP8kh.js";import"./access-gate-DFiTys6s.js";import"./capability-load-error-gogxAwFW.js";const Ts=$t().email("Invalid email address");function Is(t){if(!t.trim())return[];const e=t.split(/[,;\n]/).map(n=>n.trim().toLowerCase()).filter(n=>n.length>0);return Array.from(new Set(e))}function As({trigger:t}){const[e,n]=ce.useState(!1),{locator:l}=he(),i=lt(),a=ke(),{data:r}=Dt.useSession(),o=r?.user?.email,{roles:g,isLoading:x}=It(),j=g.filter(m=>m.role!=="owner"),p=kt({mode:"onChange",defaultValues:{emailsText:"",role:"user"}}),b=p.watch("emailsText"),P=p.watch("role"),v=Is(b).filter(m=>{const c=Ts.safeParse(m).success,f=!o||m!==o.toLowerCase();return c&&f}),N=xe({mutationFn:async({emails:m,role:c})=>{if(!c)throw new Error("Please select a role");const f=await Promise.allSettled(m.map(async w=>{const A=await i.organization.inviteMember({email:w,role:c});if(A.error)throw new Error(A.error.message);return A.data})),I=f.filter(w=>w.status==="rejected");if(I.length>0)throw new Error(`Failed to invite ${I.length} member${I.length>1?"s":""}`);return f},onSuccess:(m,{emails:c,role:f})=>{ue("member_invited",{count:c.length,role:f}),a.invalidateQueries({queryKey:ie.members(l)}),a.invalidateQueries({queryKey:ie.invitations(l)}),G.success(c.length===1?"Member invited successfully!":`${c.length} members invited successfully!`),p.reset({emailsText:"",role:"user"}),n(!1)},onError:(m,{emails:c,role:f})=>{ue("member_invite_failed",{count:c.length,role:f,error:m instanceof Error?m.message:String(m)}),G.error(m instanceof Error?m.message:"Failed to invite members")}}),y=m=>{if(v.length===0){G.error("Please enter at least one valid email address");return}if(!m.role){G.error("Please select a role");return}N.mutate({emails:v,role:m.role})},$=v.length>0&&!!P;return s.jsxs(Kt,{open:e,onOpenChange:n,children:[s.jsx(Vt,{asChild:!0,children:t}),s.jsxs(Qt,{className:"sm:max-w-lg",children:[s.jsx(Ut,{children:s.jsx(Gt,{children:"Invite members"})}),s.jsx(Ht,{...p,children:s.jsxs("form",{onSubmit:p.handleSubmit(y),className:"space-y-4",children:[s.jsx(rt,{control:p.control,name:"emailsText",render:({field:m})=>s.jsxs(ct,{children:[s.jsx(Wt,{children:"Email addresses"}),s.jsx(mt,{children:s.jsx(Yt,{...m,disabled:N.isPending,placeholder:`Enter email addresses separated by commas or new lines
1
+ import{v as $t,r as ce,p as he,F as ke,b as Dt,x as kt,a as xe,t as ue,n as G,K as ie,j as s,B as fe,e as J,a5 as Ft,m as Tt,c as $e,l as Xe,a1 as Ot}from"./index-COlSsy5J.js";import{C as Lt}from"./collection-display-button-4X_RKgcc.js";import{S as qt}from"./search-input-Dh2xeHiv.js";import{P as _e}from"./index-CkC7ek4r.js";import{u as It,C as Bt}from"./use-organization-roles-BR95hkZY.js";import{E as We}from"./empty-state-SvMp_sYN.js";import{d as Kt,i as Vt,c as Qt,D as Ut,a as Gt,e as Jt}from"./dialog-BMBVdX8K.js";import{a as Ht,F as rt,b as ct,c as Wt,d as mt,f as dt}from"./form-CdGhzS_x.js";import{d as et,b as tt,c as st,S as nt,a as it}from"./select-Dqs7Z4yG.js";import{T as Yt}from"./textarea-DsT2vsGj.js";import{u as lt}from"./use-org-auth-client-BYQp-Udb.js";import{b as Zt,S as Xt,a as es}from"./settings-section-BqnJtUWr.js";import{a as ts,u as ss}from"./use-join-requests-DmU4yvI-.js";import{A as De}from"./avatar-D7wKrjgH.js";import{u as ns}from"./use-members-CYuArAru.js";import{u as Fe}from"./studio-tools-CyTucPcW.js";import{T as is,a as as,c as ls,b as os}from"./tooltip-D5U362dF.js";import{a as ut,e as ft,g as ht,b as pt,c as gt,d as xt,A as bt,f as jt}from"./alert-dialog-DvJDYQsM.js";import{B as Ue}from"./badge-Rj4w6Y9D.js";import{C as vt}from"./card-BtNxdFil.js";import{D as At,a as Pt,b as Mt,d as rs,e as cs,f as ms,c as at,g as ds}from"./dropdown-menu-gXn3xVef.js";import{a as Et}from"./DotsVertical-Ci1mVPsb.js";import{i as us}from"./Key01-DGn_JEBu.js";import{i as fs}from"./Shield01-DXFrycnj.js";import{a as hs}from"./SwitchHorizontal01-Ca_h3hG5.js";import{s as ps}from"./Trash01-BDNQcRq9.js";import{s as _t}from"./XClose-CnYr1LOo.js";import{C as Ct}from"./checkbox-CzoSEbjC.js";import{e as Ye,a as Ze,f as yt,C as gs,c as xs,d as bs,b as js}from"./command-CYqVDIDi.js";import{b as vs,P as Cs,a as ys}from"./popover-rRtv1RUJ.js";import{t as Ss}from"./ChevronDown-BldydMJ0.js";import{s as ws}from"./Plus-DHJbi1i9.js";import{R as Ns}from"./require-capability-GPOwZTVN.js";import"./ChevronUp-CjDXfs3K.js";import"./view-mode-toggle-CeXLSv0R.js";import"./SearchMd-yvCGxslh.js";import"./sidebar-D1LCPjC8.js";import"./LayoutLeft-BI32Ru47.js";import"./sheet-Cn8FwYbD.js";import"./X-Botvp-t_.js";import"./table-Gv4tJy7V.js";import"./label-BCRIEPd0.js";import"./ArrowUpRight-B2NXgTf2.js";import"./use-capability-XIhIuFk7.js";import"./User01-kj3Bxvgl.js";import"./ChevronRight-BsknZQE_.js";import"./index-D4WUCfu0.js";import"./access-gate-lRgnLhCg.js";import"./capability-load-error-Caduk_d2.js";const Ts=$t().email("Invalid email address");function Is(t){if(!t.trim())return[];const e=t.split(/[,;\n]/).map(n=>n.trim().toLowerCase()).filter(n=>n.length>0);return Array.from(new Set(e))}function As({trigger:t}){const[e,n]=ce.useState(!1),{locator:l}=he(),i=lt(),a=ke(),{data:r}=Dt.useSession(),o=r?.user?.email,{roles:g,isLoading:x}=It(),j=g.filter(m=>m.role!=="owner"),p=kt({mode:"onChange",defaultValues:{emailsText:"",role:"user"}}),b=p.watch("emailsText"),P=p.watch("role"),v=Is(b).filter(m=>{const c=Ts.safeParse(m).success,f=!o||m!==o.toLowerCase();return c&&f}),N=xe({mutationFn:async({emails:m,role:c})=>{if(!c)throw new Error("Please select a role");const f=await Promise.allSettled(m.map(async w=>{const A=await i.organization.inviteMember({email:w,role:c});if(A.error)throw new Error(A.error.message);return A.data})),I=f.filter(w=>w.status==="rejected");if(I.length>0)throw new Error(`Failed to invite ${I.length} member${I.length>1?"s":""}`);return f},onSuccess:(m,{emails:c,role:f})=>{ue("member_invited",{count:c.length,role:f}),a.invalidateQueries({queryKey:ie.members(l)}),a.invalidateQueries({queryKey:ie.invitations(l)}),G.success(c.length===1?"Member invited successfully!":`${c.length} members invited successfully!`),p.reset({emailsText:"",role:"user"}),n(!1)},onError:(m,{emails:c,role:f})=>{ue("member_invite_failed",{count:c.length,role:f,error:m instanceof Error?m.message:String(m)}),G.error(m instanceof Error?m.message:"Failed to invite members")}}),y=m=>{if(v.length===0){G.error("Please enter at least one valid email address");return}if(!m.role){G.error("Please select a role");return}N.mutate({emails:v,role:m.role})},$=v.length>0&&!!P;return s.jsxs(Kt,{open:e,onOpenChange:n,children:[s.jsx(Vt,{asChild:!0,children:t}),s.jsxs(Qt,{className:"sm:max-w-lg",children:[s.jsx(Ut,{children:s.jsx(Gt,{children:"Invite members"})}),s.jsx(Ht,{...p,children:s.jsxs("form",{onSubmit:p.handleSubmit(y),className:"space-y-4",children:[s.jsx(rt,{control:p.control,name:"emailsText",render:({field:m})=>s.jsxs(ct,{children:[s.jsx(Wt,{children:"Email addresses"}),s.jsx(mt,{children:s.jsx(Yt,{...m,disabled:N.isPending,placeholder:`Enter email addresses separated by commas or new lines
2
2
  e.g. user1@example.com, user2@example.com
3
3
  or one per line`,className:"min-h-[120px] resize-none"})}),s.jsx(dt,{})]})}),s.jsx(rt,{control:p.control,name:"role",render:({field:m})=>s.jsxs(ct,{children:[s.jsx(mt,{children:s.jsxs(et,{value:m.value,onValueChange:m.onChange,disabled:N.isPending||x,children:[s.jsx(tt,{className:"w-full",children:s.jsx(st,{placeholder:"Select a role"})}),s.jsx(nt,{children:j.map(c=>{const f=[];return c.isBuiltin||(c.allowsAllStaticPermissions?f.push("Full org access"):c.staticPermissionCount&&c.staticPermissionCount>0&&f.push(`${c.staticPermissionCount} org perm${c.staticPermissionCount!==1?"s":""}`),c.allowsAllConnections?f.push("All connections"):c.connectionCount&&c.connectionCount>0&&f.push(`${c.connectionCount} connection${c.connectionCount!==1?"s":""}`),(c.connectionCount!==0||c.allowsAllConnections)&&(c.allowsAllTools?f.push("all tools"):c.toolCount&&c.toolCount>0&&f.push(`${c.toolCount} tool${c.toolCount!==1?"s":""}`))),s.jsx(it,{value:c.role,children:s.jsxs("div",{className:"flex flex-col",children:[s.jsx("span",{children:c.label}),!c.isBuiltin&&f.length>0&&s.jsx("span",{className:"text-xs text-muted-foreground",children:f.join(", ")})]})},c.role)})})]})}),s.jsx(dt,{})]})}),s.jsxs(Jt,{children:[s.jsx(fe,{variant:"outline",onClick:()=>{p.reset({emailsText:"",role:"user"}),n(!1)},type:"button",disabled:N.isPending,children:"Cancel"}),s.jsx(fe,{type:"submit",disabled:N.isPending||!$,children:N.isPending?"Inviting...":`Invite ${v.length||0} Member${v.length!==1?"s":""}`})]})]})})]})]})}function Ps(){const t=J.c(9),e=ts(),{approve:n,deny:l}=ss();if(e.length===0)return null;let i;if(t[0]!==n||t[1]!==l||t[2]!==e){let r;t[4]!==n||t[5]!==l?(r=o=>s.jsx(Zt,{icon:s.jsx(De,{url:o.user?.image??void 0,fallback:(o.user?.name??o.user?.email??"?").charAt(0).toUpperCase(),shape:"circle",size:"sm"}),title:o.user?.name??o.user?.email??o.userId,description:o.user?.email,action:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(fe,{size:"sm",variant:"outline",onClick:()=>l.mutate(o.id),disabled:l.isPending||n.isPending,children:"Deny"}),s.jsx(fe,{size:"sm",onClick:()=>n.mutate(o.id),disabled:n.isPending||l.isPending,children:"Approve"})]})},o.id),t[4]=n,t[5]=l,t[6]=r):r=t[6],i=e.map(r),t[0]=n,t[1]=l,t[2]=e,t[3]=i}else i=t[3];let a;return t[7]!==i?(a=s.jsx(Xt,{title:"Join requests",description:"People who requested to join via a domain in approval mode.",children:s.jsx(es,{children:i})}),t[7]=i,t[8]=a):a=t[8],a}function Ms(){const t=J.c(7),{locator:e}=he(),n=Fe();let l;t[0]!==e?(l=ie.invitations(e),t[0]=e,t[1]=l):l=t[1];let i;t[2]!==n?(i=async()=>(await n.call("ORGANIZATION_GET",{}))?.invitations??[],t[2]=n,t[3]=i):i=t[3];let a;return t[4]!==l||t[5]!==i?(a={queryKey:l,queryFn:i},t[4]=l,t[5]=i,t[6]=a):a=t[6],Ft(a)}function Es(){const t=J.c(10),{locator:e}=he(),n=lt(),l=ke();let i;t[0]!==n?(i=async x=>{const j=await n.organization.cancelInvitation({invitationId:x});if(j?.error)throw new Error(j.error.message);return j.data},t[0]=n,t[1]=i):i=t[1];let a;t[2]!==e||t[3]!==l?(a=()=>{l.invalidateQueries({queryKey:ie.invitations(e)}),G.success("Invitation cancelled")},t[2]=e,t[3]=l,t[4]=a):a=t[4];let r;t[5]!==i||t[6]!==a?(r={mutationFn:i,onSuccess:a,onError:_s},t[5]=i,t[6]=a,t[7]=r):r=t[7];const o=xe(r);let g;return t[8]!==o?(g={cancel:o},t[8]=o,t[9]=g):g=t[9],g}function _s(t){G.error(t instanceof Error?t.message:"Failed to cancel invitation")}function Rs(){const t=J.c(7),{locator:e}=he(),n=Fe();let l;t[0]!==e?(l=ie.tags(e),t[0]=e,t[1]=l):l=t[1];let i;t[2]!==n?(i=async()=>{const{tags:r}=await n.call("TAGS_LIST",{});return r},t[2]=n,t[3]=i):i=t[3];let a;return t[4]!==l||t[5]!==i?(a={queryKey:l,queryFn:i,staleTime:3e4},t[4]=l,t[5]=i,t[6]=a):a=t[6],Tt(a)}function zs(){const t=J.c(8),e=ke(),{locator:n}=he(),l=Fe();let i;t[0]!==l?(i=async o=>{const{tag:g}=await l.call("TAGS_CREATE",{name:o});return g},t[0]=l,t[1]=i):i=t[1];let a;t[2]!==n||t[3]!==e?(a=()=>{e.invalidateQueries({queryKey:ie.tags(n)})},t[2]=n,t[3]=e,t[4]=a):a=t[4];let r;return t[5]!==i||t[6]!==a?(r={mutationFn:i,onSuccess:a,onError:$s},t[5]=i,t[6]=a,t[7]=r):r=t[7],xe(r)}function $s(t){G.error(t instanceof Error?t.message:"Failed to create tag")}function Ds(t){const e=J.c(10),{locator:n}=he(),l=Fe();let i;e[0]!==n||e[1]!==t?(i=ie.memberTags(n,t),e[0]=n,e[1]=t,e[2]=i):i=e[2];let a;e[3]!==t||e[4]!==l?(a=async()=>{const{tags:g}=await l.call("MEMBER_TAGS_GET",{memberId:t});return g},e[3]=t,e[4]=l,e[5]=a):a=e[5];const r=!!t;let o;return e[6]!==i||e[7]!==a||e[8]!==r?(o={queryKey:i,queryFn:a,staleTime:3e4,enabled:r},e[6]=i,e[7]=a,e[8]=r,e[9]=o):o=e[9],Tt(o)}function ks(){const t=J.c(8),e=ke(),{locator:n}=he(),l=Fe();let i;t[0]!==l?(i=async o=>{const{memberId:g,tagIds:x}=o;return await l.call("MEMBER_TAGS_SET",{memberId:g,tagIds:x})},t[0]=l,t[1]=i):i=t[1];let a;t[2]!==n||t[3]!==e?(a=(o,g)=>{e.invalidateQueries({queryKey:ie.memberTags(n,g.memberId)})},t[2]=n,t[3]=e,t[4]=a):a=t[4];let r;return t[5]!==i||t[6]!==a?(r={mutationFn:i,onSuccess:a,onError:Fs},t[5]=i,t[6]=a,t[7]=r):r=t[7],xe(r)}function Fs(t){G.error(t instanceof Error?t.message:"Failed to update member tags")}function Rt(t){const e=J.c(44),{memberId:n,className:l,disabled:i,placeholder:a,maxDisplay:r}=t,o=i===void 0?!1:i,g=a===void 0?"Add tags...":a,x=r===void 0?2:r,[j,p]=ce.useState(!1),[b,P]=ce.useState(""),{data:R,isLoading:v}=Rs(),N=R===void 0?[]:R,{data:y,isLoading:$}=Ds(n),m=y===void 0?[]:y,c=zs(),f=ks(),I=v||$,w=m.map(Ls);let A;e[0]!==b?(A=S=>S.name.toLowerCase().includes(b.toLowerCase()),e[0]=b,e[1]=A):A=e[1];const z=N.filter(A);let T;e[2]!==b?(T=S=>S.name.toLowerCase()===b.toLowerCase(),e[2]=b,e[3]=T):T=e[3];const K=N.find(T),M=b.trim()&&!K,k=async S=>{const ge=w.includes(S.id)?w.filter(ve=>ve!==S.id):[...w,S.id];await f.mutateAsync({memberId:n,tagIds:ge})},E=async()=>{if(!b.trim())return;const S=await c.mutateAsync(b.trim());await f.mutateAsync({memberId:n,tagIds:[...w,S.id]}),P("")},d=async S=>{const ne=w.filter(ge=>ge!==S);await f.mutateAsync({memberId:n,tagIds:ne})},C=c.isPending||f.isPending,L=Cs;let D;e[4]!==j?(D=()=>p(!j),e[4]=j,e[5]=D):D=e[5];let F;e[6]!==l?(F=$e("h-auto min-h-8 px-2 py-1 justify-start font-normal","hover:bg-accent/50",l),e[6]=l,e[7]=F):F=e[7];const V=o||I,O=I?s.jsx(Xe,{size:14,className:"animate-spin text-muted-foreground"}):m.length>0?s.jsxs("div",{className:"flex items-center gap-1 flex-wrap",children:[m.slice(0,x).map(Os),m.length>x&&s.jsxs(Ue,{variant:"secondary",className:"text-xs px-1.5 py-0 h-5",children:["+",m.length-x]})]}):s.jsx("span",{className:"text-muted-foreground text-xs",children:g});let Q;e[8]===Symbol.for("react.memo_cache_sentinel")?(Q=s.jsx(Ss,{size:14,className:"ml-1 shrink-0 opacity-50"}),e[8]=Q):Q=e[8];let q;e[9]!==V||e[10]!==O||e[11]!==D||e[12]!==F?(q=s.jsx(ys,{asChild:!0,children:s.jsxs(fe,{variant:"ghost",size:"sm",onClick:D,className:F,disabled:V,children:[O,Q]})}),e[9]=V,e[10]=O,e[11]=D,e[12]=F,e[13]=q):q=e[13];const U=vs,H="w-56 p-0",W="start";let Y;e[14]===Symbol.for("react.memo_cache_sentinel")?(Y=()=>p(!1),e[14]=Y):Y=e[14];const ae=bs,be=!1;let Z;e[15]!==b?(Z=s.jsx(js,{placeholder:"Search or create...",value:b,onValueChange:P,className:"h-9"}),e[15]=b,e[16]=Z):Z=e[16];const le=xs,me=m.length>0&&s.jsxs(s.Fragment,{children:[s.jsx(Ye,{heading:"Selected",children:m.map(S=>s.jsx(Ze,{onSelect:()=>k(S),className:"cursor-pointer",children:s.jsxs("div",{className:"flex items-center justify-between w-full",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ct,{checked:!0,className:"[&_svg]:!text-primary-foreground"}),s.jsx("span",{children:S.name})]}),s.jsx("button",{onClick:ne=>{ne.stopPropagation(),d(S.id)},className:"opacity-50 hover:opacity-100",disabled:C,children:s.jsx(_t,{size:14})})]})},S.id))}),s.jsx(yt,{})]}),Re=Ye,je="Available",ze=z.length===0&&!M&&s.jsx(gs,{children:"No tags found."}),pe=z.filter(S=>!w.includes(S.id)).map(S=>s.jsx(Ze,{onSelect:()=>k(S),className:"cursor-pointer",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ct,{checked:!1,className:"[&_svg]:!text-primary-foreground"}),s.jsx("span",{children:S.name})]})},S.id));let oe;e[17]!==Re||e[18]!==ze||e[19]!==pe?(oe=s.jsxs(Re,{heading:je,children:[ze,pe]}),e[17]=Re,e[18]=ze,e[19]=pe,e[20]=oe):oe=e[20];let re;e[21]!==E||e[22]!==C||e[23]!==b||e[24]!==M?(re=M&&s.jsxs(s.Fragment,{children:[s.jsx(yt,{}),s.jsx(Ye,{children:s.jsx(Ze,{onSelect:E,className:"cursor-pointer",disabled:C,children:s.jsxs("div",{className:"flex items-center gap-2 text-primary",children:[C?s.jsx(Xe,{size:14,className:"animate-spin"}):s.jsx(ws,{size:14}),s.jsxs("span",{children:['Create "',b.trim(),'"']})]})})})]}),e[21]=E,e[22]=C,e[23]=b,e[24]=M,e[25]=re):re=e[25];let X;e[26]!==le||e[27]!==me||e[28]!==oe||e[29]!==re?(X=s.jsxs(le,{children:[me,oe,re]}),e[26]=le,e[27]=me,e[28]=oe,e[29]=re,e[30]=X):X=e[30];let ee;e[31]!==ae||e[32]!==Z||e[33]!==X?(ee=s.jsxs(ae,{shouldFilter:be,children:[Z,X]}),e[31]=ae,e[32]=Z,e[33]=X,e[34]=ee):ee=e[34];let te;e[35]!==U||e[36]!==Y||e[37]!==ee?(te=s.jsx(U,{className:H,align:W,onEscapeKeyDown:Y,children:ee}),e[35]=U,e[36]=Y,e[37]=ee,e[38]=te):te=e[38];let se;return e[39]!==L||e[40]!==j||e[41]!==q||e[42]!==te?(se=s.jsxs(L,{open:j,onOpenChange:p,children:[q,te]}),e[39]=L,e[40]=j,e[41]=q,e[42]=te,e[43]=se):se=e[43],se}function Os(t){return s.jsx(Ue,{variant:"secondary",className:"text-xs px-1.5 py-0 h-5",children:t.name},t.id)}function Ls(t){return t.id}const St=["bg-neutral-400","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","bg-slate-500"],qs={owner:"bg-red-500",admin:"bg-blue-500",user:"bg-green-500"};function Qe(t){return t?t.split(" ").map(e=>e[0]).join("").toUpperCase().slice(0,2):"?"}function Bs(t){const e=new Map;for(const[n,l]of Object.entries(qs))e.set(n,l);for(let n=0;n<t.length;n++){const l=t[n];l&&!e.has(l.role)&&e.set(l.role,St[n%St.length]??"bg-neutral-400")}return e}function Ks(t){return new Date(t).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})}function Ve(t){const e=J.c(79),{role:n,memberId:l,isOwner:i,roleColorMap:a,selectableRoles:r,onRoleChange:o,size:g,className:x}=t,j=g===void 0?"xs":g;let p,b,P,R,v,N,y,$,m,c,f;if(e[0]!==x||e[1]!==i||e[2]!==l||e[3]!==o||e[4]!==n||e[5]!==a||e[6]!==r||e[7]!==j){f=Symbol.for("react.early_return_sentinel");e:{const E=a.get(n)??"bg-neutral-400";if(i){let d;e[19]!==l||e[20]!==o?(d=H=>o(l,H),e[19]=l,e[20]=o,e[21]=d):d=e[21];let C;e[22]!==n?(C=s.jsx("span",{className:"capitalize truncate",children:n}),e[22]=n,e[23]=C):C=e[23];const L=s.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[s.jsx("div",{className:$e("size-2 rounded-full shrink-0",E)}),C]});let D;e[24]!==L?(D=s.jsx(st,{children:L}),e[24]=L,e[25]=D):D=e[25];let F;e[26]!==x||e[27]!==j||e[28]!==D?(F=s.jsx(tt,{size:j,className:x,children:D}),e[26]=x,e[27]=j,e[28]=D,e[29]=F):F=e[29];let V;if(e[30]!==a||e[31]!==r){let H;e[33]!==a?(H=W=>{const Y=a.get(W.role)??"bg-neutral-400";return s.jsx(it,{value:W.role,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:$e("size-3 rounded-full",Y)}),s.jsx("span",{className:"capitalize",children:W.label})]})},W.role)},e[33]=a,e[34]=H):H=e[34],V=r.map(H),e[30]=a,e[31]=r,e[32]=V}else V=e[32];let O;e[35]!==V?(O=s.jsx(nt,{children:V}),e[35]=V,e[36]=O):O=e[36];let Q;e[37]!==i||e[38]!==n||e[39]!==d||e[40]!==F||e[41]!==O?(Q=s.jsx(is,{asChild:!0,children:s.jsx("div",{className:"w-fit",children:s.jsxs(et,{value:n,onValueChange:d,disabled:i,children:[F,O]})})}),e[37]=i,e[38]=n,e[39]=d,e[40]=F,e[41]=O,e[42]=Q):Q=e[42];let q;e[43]===Symbol.for("react.memo_cache_sentinel")?(q=s.jsx(as,{children:s.jsx("p",{children:"The owner role cannot be changed"})}),e[43]=q):q=e[43];let U;e[44]!==Q?(U=s.jsx(ls,{children:s.jsxs(os,{children:[Q,q]})}),e[44]=Q,e[45]=U):U=e[45],f=U;break e}P=et,$=n,e[46]!==l||e[47]!==o?(m=d=>o(l,d),e[46]=l,e[47]=o,e[48]=m):m=e[48],c=i,b=tt,N=j,y=x,p=st,v="flex items-center gap-2 min-w-0",R=$e("size-2 rounded-full shrink-0",E)}e[0]=x,e[1]=i,e[2]=l,e[3]=o,e[4]=n,e[5]=a,e[6]=r,e[7]=j,e[8]=p,e[9]=b,e[10]=P,e[11]=R,e[12]=v,e[13]=N,e[14]=y,e[15]=$,e[16]=m,e[17]=c,e[18]=f}else p=e[8],b=e[9],P=e[10],R=e[11],v=e[12],N=e[13],y=e[14],$=e[15],m=e[16],c=e[17],f=e[18];if(f!==Symbol.for("react.early_return_sentinel"))return f;let I;e[49]!==R?(I=s.jsx("div",{className:R}),e[49]=R,e[50]=I):I=e[50];let w;e[51]!==n?(w=s.jsx("span",{className:"capitalize truncate",children:n}),e[51]=n,e[52]=w):w=e[52];let A;e[53]!==I||e[54]!==w||e[55]!==v?(A=s.jsxs("div",{className:v,children:[I,w]}),e[53]=I,e[54]=w,e[55]=v,e[56]=A):A=e[56];let z;e[57]!==p||e[58]!==A?(z=s.jsx(p,{children:A}),e[57]=p,e[58]=A,e[59]=z):z=e[59];let T;e[60]!==b||e[61]!==z||e[62]!==N||e[63]!==y?(T=s.jsx(b,{size:N,className:y,children:z}),e[60]=b,e[61]=z,e[62]=N,e[63]=y,e[64]=T):T=e[64];let K;if(e[65]!==a||e[66]!==r){let E;e[68]!==a?(E=d=>{const C=a.get(d.role)??"bg-neutral-400";return s.jsx(it,{value:d.role,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:$e("size-3 rounded-full",C)}),s.jsx("span",{className:"capitalize",children:d.label})]})},d.role)},e[68]=a,e[69]=E):E=e[69],K=r.map(E),e[65]=a,e[66]=r,e[67]=K}else K=e[67];let M;e[70]!==K?(M=s.jsx(nt,{children:K}),e[70]=K,e[71]=M):M=e[71];let k;return e[72]!==P||e[73]!==T||e[74]!==M||e[75]!==$||e[76]!==m||e[77]!==c?(k=s.jsxs(P,{value:$,onValueChange:m,disabled:c,children:[T,M]}),e[72]=P,e[73]=T,e[74]=M,e[75]=$,e[76]=m,e[77]=c,e[78]=k):k=e[78],k}function wt(t){const e=J.c(51),{member:n,roles:l,onChangeRole:i,onRemove:a,isUpdating:r}=t,o=r===void 0?!1:r,g=n.role==="owner";let x,j,p,b,P,R,v,N,y;if(e[0]!==g||e[1]!==o||e[2]!==n.id||e[3]!==n.role||e[4]!==i||e[5]!==l){let T;e[15]!==n.role?(T=d=>d.role!==n.role&&d.role!=="owner",e[15]=n.role,e[16]=T):T=e[16];const K=l.filter(T);b=At;let M;e[17]===Symbol.for("react.memo_cache_sentinel")?(M=s.jsx(Et,{size:20}),e[17]=M):M=e[17],e[18]!==g?(y=s.jsx(Pt,{asChild:!0,children:s.jsx(fe,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",disabled:g,onClick:Qs,children:M})}),e[18]=g,e[19]=y):y=e[19],p=Mt,v="end",N=Vs,j=rs;let k;e[20]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(hs,{size:16}),e[20]=k):k=e[20],e[21]!==o?(R=s.jsxs(cs,{disabled:o,children:[k,"Change Role"]}),e[21]=o,e[22]=R):R=e[22],x=ms;let E;e[23]!==o||e[24]!==n.id||e[25]!==i?(E=d=>{const C=[];return d.isBuiltin||(d.allowsAllStaticPermissions?C.push("Full org access"):d.staticPermissionCount&&d.staticPermissionCount>0&&C.push(`${d.staticPermissionCount} org perm${d.staticPermissionCount!==1?"s":""}`),d.allowsAllConnections?C.push("All connections"):d.connectionCount&&d.connectionCount>0&&C.push(`${d.connectionCount} connection${d.connectionCount!==1?"s":""}`),(d.connectionCount!==0||d.allowsAllConnections)&&(d.allowsAllTools?C.push("all tools"):d.toolCount&&d.toolCount>0&&C.push(`${d.toolCount} tool${d.toolCount!==1?"s":""}`))),s.jsxs(at,{onClick:L=>{L.stopPropagation(),i(n.id,d.role)},disabled:o,children:[d.isBuiltin?s.jsx(fs,{size:16}):s.jsx(us,{size:16}),s.jsxs("span",{className:"flex flex-col",children:[s.jsx("span",{children:d.label}),!d.isBuiltin&&C.length>0&&s.jsx("span",{className:"text-xs text-muted-foreground",children:C.join(", ")})]})]},d.role)},e[23]=o,e[24]=n.id,e[25]=i,e[26]=E):E=e[26],P=K.map(E),e[0]=g,e[1]=o,e[2]=n.id,e[3]=n.role,e[4]=i,e[5]=l,e[6]=x,e[7]=j,e[8]=p,e[9]=b,e[10]=P,e[11]=R,e[12]=v,e[13]=N,e[14]=y}else x=e[6],j=e[7],p=e[8],b=e[9],P=e[10],R=e[11],v=e[12],N=e[13],y=e[14];let $;e[27]!==x||e[28]!==P?($=s.jsx(x,{children:P}),e[27]=x,e[28]=P,e[29]=$):$=e[29];let m;e[30]!==j||e[31]!==R||e[32]!==$?(m=s.jsxs(j,{children:[R,$]}),e[30]=j,e[31]=R,e[32]=$,e[33]=m):m=e[33];let c;e[34]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(ds,{}),e[34]=c):c=e[34];let f;e[35]!==n.id||e[36]!==a?(f=T=>{T.stopPropagation(),a(n.id)},e[35]=n.id,e[36]=a,e[37]=f):f=e[37];let I;e[38]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsx(ps,{size:16}),e[38]=I):I=e[38];let w;e[39]!==f?(w=s.jsxs(at,{variant:"destructive",onClick:f,children:[I,"Remove Member"]}),e[39]=f,e[40]=w):w=e[40];let A;e[41]!==p||e[42]!==w||e[43]!==v||e[44]!==N||e[45]!==m?(A=s.jsxs(p,{align:v,onClick:N,children:[m,c,w]}),e[41]=p,e[42]=w,e[43]=v,e[44]=N,e[45]=m,e[46]=A):A=e[46];let z;return e[47]!==b||e[48]!==A||e[49]!==y?(z=s.jsxs(b,{children:[y,A]}),e[47]=b,e[48]=A,e[49]=y,e[50]=z):z=e[50],z}function Vs(t){return t.stopPropagation()}function Qs(t){return t.stopPropagation()}function Nt(t){const e=J.c(8),{invitationId:n,onCancel:l,isCancelling:i}=t,a=i===void 0?!1:i;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Pt,{asChild:!0,children:s.jsx(fe,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Gs,children:s.jsx(Et,{size:20})})}),e[0]=r):r=e[0];let o;e[1]!==n||e[2]!==l?(o=j=>{j.stopPropagation(),l(n)},e[1]=n,e[2]=l,e[3]=o):o=e[3];let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(_t,{size:16}),e[4]=g):g=e[4];let x;return e[5]!==a||e[6]!==o?(x=s.jsxs(At,{children:[r,s.jsx(Mt,{align:"end",onClick:Us,children:s.jsxs(at,{variant:"destructive",onClick:o,disabled:a,children:[g,"Cancel Invitation"]})})]}),e[5]=a,e[6]=o,e[7]=x):x=e[7],x}function Us(t){return t.stopPropagation()}function Gs(t){return t.stopPropagation()}function Js(){const t=J.c(103),{data:e}=ns(),{data:n}=Ms(),l=Es(),i=ke(),{locator:a}=he(),r=lt(),[o,g]=ce.useState(null),[x,j]=ce.useState(null),[p,b]=ce.useState(""),[P,R]=ce.useState("table"),[v,N]=ce.useState("member"),[y,$]=ce.useState("asc"),m=e?.data?.members;let c;t[0]!==v?(c=u=>{v===u?$(ln):(N(u),$("asc"))},t[0]=v,t[1]=c):c=t[1];const f=c;let I=m??[],w=n??[];if(p){const u=p.toLowerCase();I=I.filter(h=>h.user?.name?.toLowerCase().includes(u)||h.user?.email?.toLowerCase().includes(u)||h.role?.toLowerCase().includes(u)),w=w.filter(h=>h.email?.toLowerCase().includes(u)||h.role?.toLowerCase().includes(u))}if(v&&y){let u;t[2]!==y||t[3]!==v?(u=(h,_)=>{let B,de;e:switch(v){case"member":{B=h.user?.name||"",de=_.user?.name||"";break e}case"role":{B=h.role||"",de=_.role||"";break e}case"joined":{B=h.createdAt?typeof h.createdAt=="string"?h.createdAt:h.createdAt.toISOString():"",de=_.createdAt?typeof _.createdAt=="string"?_.createdAt:_.createdAt.toISOString():"";break e}default:return 0}return y==="asc"?B.localeCompare(de):de.localeCompare(B)},t[2]=y,t[3]=v,t[4]=u):u=t[4],I=[...I].sort(u)}const A=I;let z;t[5]!==r?(z=async u=>{const h=await r.organization.removeMember({memberIdOrEmail:u});if(h?.error)throw new Error(h.error.message)},t[5]=r,t[6]=z):z=t[6];let T;t[7]!==a||t[8]!==i?(T=()=>{ue("member_removed"),i.invalidateQueries({queryKey:ie.members(a)}),G.success("Member has been removed from the organization"),g(null)},t[7]=a,t[8]=i,t[9]=T):T=t[9];let K;t[10]!==z||t[11]!==T?(K={mutationFn:z,onSuccess:T,onError:an},t[10]=z,t[11]=T,t[12]=K):K=t[12];const M=xe(K);let k;t[13]!==r?(k=async u=>{const{memberId:h,role:_}=u,B=await r.organization.updateMemberRole({memberId:h,role:[_]});if(B?.error)throw new Error(B.error.message)},t[13]=r,t[14]=k):k=t[14];let E;t[15]!==a||t[16]!==i?(E=(u,h)=>{ue("member_role_updated",{new_role:h.role}),i.invalidateQueries({queryKey:ie.members(a)}),G.success("Member's role has been updated")},t[15]=a,t[16]=i,t[17]=E):E=t[17];let d;t[18]!==k||t[19]!==E?(d={mutationFn:k,onSuccess:E,onError:nn},t[18]=k,t[19]=E,t[20]=d):d=t[20];const C=xe(d);let L;t[21]!==r?(L=async u=>{const{invitationId:h,role:_,email:B}=u,de=await r.organization.cancelInvitation({invitationId:h});if(de?.error)throw new Error(de.error.message);const ot=await r.organization.inviteMember({email:B,role:_});if(ot?.error)throw new Error(ot.error.message)},t[21]=r,t[22]=L):L=t[22];let D;t[23]!==a||t[24]!==i?(D=(u,h)=>{ue("invitation_role_updated",{new_role:h.role}),i.invalidateQueries({queryKey:ie.invitations(a)}),G.success("Invitation role has been updated")},t[23]=a,t[24]=i,t[25]=D):D=t[25];let F;t[26]!==L||t[27]!==D?(F={mutationFn:L,onSuccess:D,onError:sn},t[26]=L,t[27]=D,t[28]=F):F=t[28];const V=xe(F),{roles:O,customRoles:Q}=It();let q;t[29]!==Q?(q=Bs(Q),t[29]=Q,t[30]=q):q=t[30];const U=q;let H;t[31]!==O?(H=O.filter(tn),t[31]=O,t[32]=H):H=t[32];const W=H;let Y;t[33]===Symbol.for("react.memo_cache_sentinel")?(Y={id:"member",header:"Member",render:en,cellClassName:"flex-1 min-w-0",sortable:!0},t[33]=Y):Y=t[33];let ae;t[34]!==U||t[35]!==W||t[36]!==V||t[37]!==C?(ae={id:"role",header:"Role",render:u=>u.type==="member"?s.jsx(Ve,{role:u.data.role,memberId:u.data.id,isOwner:u.data.role==="owner",roleColorMap:U,selectableRoles:W,onRoleChange:(h,_)=>C.mutate({memberId:h,role:_}),className:"w-36"}):s.jsx(Ve,{role:u.data.role,memberId:u.data.id,isOwner:!1,roleColorMap:U,selectableRoles:W,onRoleChange:(h,_)=>V.mutate({invitationId:h,role:_,email:u.data.email}),className:"w-36"}),cellClassName:"w-36 shrink-0",sortable:!0},t[34]=U,t[35]=W,t[36]=V,t[37]=C,t[38]=ae):ae=t[38];let be,Z;t[39]===Symbol.for("react.memo_cache_sentinel")?(be={id:"tags",header:"Tags",render:Xs,cellClassName:"w-40 shrink-0"},Z={id:"joined",header:"Joined",render:Zs,cellClassName:"w-48 shrink-0",sortable:!0},t[39]=be,t[40]=Z):(be=t[39],Z=t[40]);let le;t[41]!==l.cancel.isPending||t[42]!==O||t[43]!==C?(le={id:"actions",header:"",render:u=>u.type==="member"?s.jsx(wt,{member:u.data,roles:O,onChangeRole:(h,_)=>C.mutate({memberId:h,role:_}),onRemove:g,isUpdating:C.isPending}):s.jsx(Nt,{invitationId:u.data.id,onCancel:j,isCancelling:l.cancel.isPending}),cellClassName:"w-12 shrink-0"},t[41]=l.cancel.isPending,t[42]=O,t[43]=C,t[44]=le):le=t[44];let me;t[45]!==ae||t[46]!==le?(me=[Y,ae,be,Z,le],t[45]=ae,t[46]=le,t[47]=me):me=t[47];const Re=me;let je;t[48]===Symbol.for("react.memo_cache_sentinel")?(je=s.jsx("div",{className:"flex items-center gap-2",children:s.jsx(As,{trigger:s.jsx(fe,{children:"Invite Member"})})}),t[48]=je):je=t[48];const ze=je,pe=[...A.map(Ys),...w.filter(Ws).map(Hs)],oe=_e,re=!!x;let X;t[49]===Symbol.for("react.memo_cache_sentinel")?(X=()=>j(null),t[49]=X):X=t[49];let ee;t[50]===Symbol.for("react.memo_cache_sentinel")?(ee=s.jsxs(pt,{children:[s.jsx(gt,{children:"Cancel Invitation"}),s.jsx(xt,{children:"Are you sure you want to cancel this invitation? The invitee will no longer be able to join the organization with this invitation."})]}),t[50]=ee):ee=t[50];let te;t[51]===Symbol.for("react.memo_cache_sentinel")?(te=s.jsx(bt,{children:"Keep Invitation"}),t[51]=te):te=t[51];let se;t[52]!==l.cancel||t[53]!==x?(se=()=>{x&&(l.cancel.mutate(x),j(null))},t[52]=l.cancel,t[53]=x,t[54]=se):se=t[54];let S;t[55]!==l.cancel.isPending||t[56]!==se?(S=s.jsxs(ut,{children:[ee,s.jsxs(ft,{children:[te,s.jsx(ht,{onClick:se,disabled:l.cancel.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Cancel Invitation"})]})]}),t[55]=l.cancel.isPending,t[56]=se,t[57]=S):S=t[57];let ne;t[58]!==re||t[59]!==S?(ne=s.jsx(jt,{open:re,onOpenChange:X,children:S}),t[58]=re,t[59]=S,t[60]=ne):ne=t[60];const ge=!!o;let ve;t[61]===Symbol.for("react.memo_cache_sentinel")?(ve=()=>g(null),t[61]=ve):ve=t[61];let Oe;t[62]===Symbol.for("react.memo_cache_sentinel")?(Oe=s.jsxs(pt,{children:[s.jsx(gt,{children:"Remove Member"}),s.jsx(xt,{children:"Are you sure you want to remove this member from the organization? This action cannot be undone."})]}),t[62]=Oe):Oe=t[62];let Le;t[63]===Symbol.for("react.memo_cache_sentinel")?(Le=s.jsx(bt,{children:"Cancel"}),t[63]=Le):Le=t[63];let Ce;t[64]!==o||t[65]!==M?(Ce=()=>o&&M.mutate(o),t[64]=o,t[65]=M,t[66]=Ce):Ce=t[66];let ye;t[67]!==M.isPending||t[68]!==Ce?(ye=s.jsxs(ut,{children:[Oe,s.jsxs(ft,{children:[Le,s.jsx(ht,{onClick:Ce,disabled:M.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Remove"})]})]}),t[67]=M.isPending,t[68]=Ce,t[69]=ye):ye=t[69];let Se;t[70]!==ge||t[71]!==ye?(Se=s.jsx(jt,{open:ge,onOpenChange:ve,children:ye}),t[70]=ge,t[71]=ye,t[72]=Se):Se=t[72];const Ge=_e,Je=_e,zt="flex flex-col gap-6";let we,Ne;t[73]===Symbol.for("react.memo_cache_sentinel")?(we=s.jsx(Ps,{}),Ne=s.jsx(_e.Title,{children:"Members"}),t[73]=we,t[74]=Ne):(we=t[73],Ne=t[74]);let qe;t[75]===Symbol.for("react.memo_cache_sentinel")?(qe=u=>{u.key==="Escape"&&(b(""),u.target.blur())},t[75]=qe):qe=t[75];let Te;t[76]!==p?(Te=s.jsx(qt,{value:p,onChange:b,placeholder:"Search members...",className:"w-full md:w-[375px]",onKeyDown:qe}),t[76]=p,t[77]=Te):Te=t[77];let Be;t[78]===Symbol.for("react.memo_cache_sentinel")?(Be=[{id:"member",label:"Name"},{id:"role",label:"Role"},{id:"joined",label:"Joined"}],t[78]=Be):Be=t[78];let Ie;t[79]!==f||t[80]!==y||t[81]!==v||t[82]!==P?(Ie=s.jsx(Lt,{viewMode:P,onViewModeChange:R,sortKey:v,sortDirection:y,onSort:f,sortOptions:Be}),t[79]=f,t[80]=y,t[81]=v,t[82]=P,t[83]=Ie):Ie=t[83];let Ae;t[84]!==Te||t[85]!==Ie?(Ae=s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[Te,Ie]}),ze]}),t[84]=Te,t[85]=Ie,t[86]=Ae):Ae=t[86];const He=P==="cards"?s.jsx("div",{children:pe.length===0?s.jsx(We,{title:"No members found",description:p?`No members match "${p}"`:"Invite members to get started."}):s.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:pe.map(u=>{if(u.type==="invitation")return s.jsxs(vt,{className:"transition-colors relative opacity-75",children:[s.jsx("div",{className:"absolute top-4 right-4 z-10",children:s.jsx(Nt,{invitationId:u.data.id,onCancel:j,isCancelling:l.cancel.isPending})}),s.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[s.jsx(De,{fallback:Qe(u.data.email),shape:"circle",size:"lg",className:"shrink-0"}),s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:u.data.email}),s.jsx("div",{className:"flex items-center gap-2",children:s.jsx(Ue,{variant:"outline",className:"w-fit text-amber-600 border-amber-400",children:"Pending"})}),s.jsx(Ve,{role:u.data.role,memberId:u.data.id,isOwner:!1,roleColorMap:U,selectableRoles:W,onRoleChange:(_,B)=>V.mutate({invitationId:_,role:B,email:u.data.email}),className:"w-fit"})]})]})]},`inv-${u.data.id}`);const h=u.data;return s.jsxs(vt,{className:"transition-colors relative",children:[s.jsx("div",{className:"absolute top-4 right-4 z-10",children:s.jsx(wt,{member:h,roles:O,onChangeRole:(_,B)=>C.mutate({memberId:_,role:B}),onRemove:g,isUpdating:C.isPending})}),s.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[s.jsx(De,{url:h.user?.image??void 0,fallback:Qe(h.user?.name),shape:"circle",size:"lg",className:"shrink-0"}),s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:h.user?.name||"Unknown"}),s.jsx("p",{className:"text-sm text-muted-foreground truncate",children:h.user?.email}),s.jsx(Ve,{role:h.role,memberId:h.id,isOwner:h.role==="owner",roleColorMap:U,selectableRoles:W,onRoleChange:(_,B)=>C.mutate({memberId:_,role:B}),className:"w-fit"}),s.jsx(Rt,{memberId:h.id,maxDisplay:3})]})]})]},h.id)})})}):s.jsx(Bt,{columns:Re,data:pe,isLoading:!1,sortKey:v,sortDirection:y,onSort:f,emptyState:p?s.jsx(We,{title:"No members found",description:`No members match "${p}"`}):s.jsx(We,{title:"No members found",description:"Invite members to get started."})});let Pe;t[87]!==we||t[88]!==Ne||t[89]!==Ae||t[90]!==He?(Pe=s.jsxs("div",{className:zt,children:[we,Ne,Ae,He]}),t[87]=we,t[88]=Ne,t[89]=Ae,t[90]=He,t[91]=Pe):Pe=t[91];let Me;t[92]!==Je.Body||t[93]!==Pe?(Me=s.jsx(Je.Body,{children:Pe}),t[92]=Je.Body,t[93]=Pe,t[94]=Me):Me=t[94];let Ee;t[95]!==Ge.Content||t[96]!==Me?(Ee=s.jsx(Ge.Content,{children:Me}),t[95]=Ge.Content,t[96]=Me,t[97]=Ee):Ee=t[97];let Ke;return t[98]!==oe||t[99]!==ne||t[100]!==Se||t[101]!==Ee?(Ke=s.jsxs(oe,{children:[ne,Se,Ee]}),t[98]=oe,t[99]=ne,t[100]=Se,t[101]=Ee,t[102]=Ke):Ke=t[102],Ke}function Hs(t){return{type:"invitation",data:t}}function Ws(t){return t.status==="pending"}function Ys(t){return{type:"member",data:t}}function Zs(t){return t.type==="member"?s.jsx("span",{className:"text-sm text-foreground",children:t.data.createdAt?Ks(t.data.createdAt):"N/A"}):s.jsx(Ue,{variant:"outline",children:"Pending"})}function Xs(t){return t.type==="member"?s.jsx(Rt,{memberId:t.data.id,maxDisplay:2}):s.jsx("span",{className:"text-xs text-muted-foreground",children:"-"})}function en(t){return t.type==="member"?s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(De,{url:t.data.user?.image??void 0,fallback:Qe(t.data.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-sm font-medium text-foreground truncate",children:t.data.user?.name||"Unknown"}),s.jsx("div",{className:"text-sm text-muted-foreground truncate",children:t.data.user?.email})]})]}):s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(De,{fallback:Qe(t.data.email),shape:"circle",size:"sm"}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-sm font-medium text-foreground truncate",children:t.data.email}),s.jsx("div",{className:"text-sm text-muted-foreground truncate",children:"Invitation sent"})]})]})}function tn(t){return t.role!=="owner"}function sn(t,e){ue("invitation_role_update_failed",{new_role:e.role,error:t instanceof Error?t.message:String(t)}),G.error(t instanceof Error?t.message:"Failed to update invitation role")}function nn(t,e){ue("member_role_update_failed",{new_role:e.role,error:t instanceof Error?t.message:String(t)}),G.error(t instanceof Error?t.message:"Failed to update role")}function an(t){ue("member_remove_failed",{error:t instanceof Error?t.message:String(t)}),G.error(t instanceof Error?t.message:"Failed to remove member")}function ln(t){return t==="asc"?"desc":t==="desc"?null:"asc"}function on(){const t=J.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(_e,{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 members"})})}),t[0]=e):e=t[0];let n;return t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Ot,{fallback:e,children:s.jsx(ce.Suspense,{fallback:s.jsx(_e,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(Xe,{size:32,className:"animate-spin text-muted-foreground"})})}),children:s.jsx(Js,{})})}),t[1]=n):n=t[1],n}function ni(){const t=J.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Ns,{capability:"members:manage",area:"members",children:s.jsx(on,{})}),t[0]=e):e=t[0],e}export{ni as default};
@@ -1,4 +1,4 @@
1
- import{e as L,j as f,r as p,ak as O}from"./index-C3gL9St4.js";import{l as I,F as $}from"./index-CQ_hnxd_.js";import{S as N}from"./chat-context-WtXAdZJ4.js";async function K(e){const t=e.getModel();if(!t)throw new Error("[Monaco] No model found in editor");const n=t.getValue(),i=n.replace(/export default (async )?function/,"export default $1function __default")+`
1
+ import{e as L,j as f,r as p,ak as O}from"./index-COlSsy5J.js";import{l as I,F as $}from"./index-C_H1H79r.js";import{S as N}from"./chat-context-B_U1gcun.js";async function K(e){const t=e.getModel();if(!t)throw new Error("[Monaco] No model found in editor");const n=t.getValue(),i=n.replace(/export default (async )?function/,"export default $1function __default")+`
2
2
  type __ExpandRecursively<T> = T extends (...args: infer A) => infer R
3
3
  ? (...args: __ExpandRecursively<A>) => __ExpandRecursively<R>
4
4
  : T extends object