decocms 4.381.0 → 4.381.1

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 (367) hide show
  1. package/dist/client/assets/{AlertCircle-DRm80850.js → AlertCircle-BwHVY35o.js} +1 -1
  2. package/dist/client/assets/{AreaChart-B6A2Hh8L.js → AreaChart-D84rGbXX.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-C-6qKzGl.js → ArrowLeft-DnFqk-Hp.js} +1 -1
  4. package/dist/client/assets/{ArrowRight-BioszTvC.js → ArrowRight-CG7y79q3.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-BYsS0mdx.js → ArrowUp-Bm0X834W.js} +1 -1
  6. package/dist/client/assets/{CartesianChart-JLZp1PXE.js → CartesianChart-DXRzAXkY.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-mF7clgex.js → CheckCircle-C-wVqn9s.js} +1 -1
  8. package/dist/client/assets/{ChevronUp-C-mJ4yLa.js → ChevronUp-DjGa4Boj.js} +1 -1
  9. package/dist/client/assets/{Copy01-WToEL8yK.js → Copy01-BRhhBrd-.js} +1 -1
  10. package/dist/client/assets/{CreditCard01-BoEWz7x3.js → CreditCard01-DBWDwJPr.js} +1 -1
  11. package/dist/client/assets/{DotsVertical-BdXTux4Q.js → DotsVertical-DnSyCHLw.js} +1 -1
  12. package/dist/client/assets/{Download01-CHE961G_.js → Download01-BtC1xWJa.js} +1 -1
  13. package/dist/client/assets/{ErrorBarContext-B0A7dacM.js → ErrorBarContext-wx_trV65.js} +1 -1
  14. package/dist/client/assets/{Eye-IjKfX9o8.js → Eye-DjWZWqC5.js} +1 -1
  15. package/dist/client/assets/{Globe01-C_CZtN5r.js → Globe01-CcPzGZAq.js} +1 -1
  16. package/dist/client/assets/{Globe04-B85WJ-Aa.js → Globe04-oytGbm52.js} +1 -1
  17. package/dist/client/assets/{Image01-BDLUws38.js → Image01-DBJlfnbG.js} +1 -1
  18. package/dist/client/assets/{Key01-BdH2PX1n.js → Key01-BSzDlvgU.js} +1 -1
  19. package/dist/client/assets/{LayoutLeft-B0PlRM99.js → LayoutLeft-uhMwovcu.js} +1 -1
  20. package/dist/client/assets/{Line-BxiLHDUQ.js → Line-B1CDKPTZ.js} +1 -1
  21. package/dist/client/assets/{Link01-C9Y0BBRe.js → Link01-YtEzcC3O.js} +1 -1
  22. package/dist/client/assets/{LinkExternal01-DIS-ugNh.js → LinkExternal01-B_tP0lGk.js} +1 -1
  23. package/dist/client/assets/{Monitor01-Ba46t5H5.js → Monitor01-DZ9Fq-Na.js} +1 -1
  24. package/dist/client/assets/{Package-DunNAz5T.js → Package-B52pYozJ.js} +1 -1
  25. package/dist/client/assets/{Palette-D5P-K0no.js → Palette-k3jDn-tr.js} +1 -1
  26. package/dist/client/assets/{Play-DrTEe1DD.js → Play-TbA_0tTu.js} +1 -1
  27. package/dist/client/assets/{Plus-C-PmR46O.js → Plus-BMzoc0gw.js} +1 -1
  28. package/dist/client/assets/{SearchLg-CKklIQBK.js → SearchLg-Dd6xPdrU.js} +1 -1
  29. package/dist/client/assets/{SearchMd-w2kAyM0h.js → SearchMd-_UV4M1B1.js} +1 -1
  30. package/dist/client/assets/{Sector-BKcNljSW.js → Sector-Cy-35iXL.js} +1 -1
  31. package/dist/client/assets/{Settings02-B23lEJQ_.js → Settings02-9i68UkBW.js} +1 -1
  32. package/dist/client/assets/{Share07-CqLE5DCF.js → Share07-CL5mbh1y.js} +1 -1
  33. package/dist/client/assets/{Stars01-B3lEx1Rv.js → Stars01-DlXoxgwa.js} +1 -1
  34. package/dist/client/assets/{Sun-iGQ6fzMW.js → Sun-_MKalIqR.js} +1 -1
  35. package/dist/client/assets/{Tool01-BjvhUZR8.js → Tool01-CU565kli.js} +1 -1
  36. package/dist/client/assets/{Tool02-CJ1YPr9M.js → Tool02-Bb6Dmyzo.js} +1 -1
  37. package/dist/client/assets/{Trash01-DpHvryKg.js → Trash01-DBKmXLFe.js} +1 -1
  38. package/dist/client/assets/{TrendUp01-Ct_gORpk.js → TrendUp01-2Ud1bdxk.js} +1 -1
  39. package/dist/client/assets/{Upload01-cKRw4EJm.js → Upload01-Cj6T5I7O.js} +1 -1
  40. package/dist/client/assets/{User01-jpO1fu6m.js → User01-C2ZiXxql.js} +1 -1
  41. package/dist/client/assets/{UserSquare-DFnOMuvf.js → UserSquare-DKnU_ZuL.js} +1 -1
  42. package/dist/client/assets/{Users01-BH4y7klV.js → Users01-kERUftBn.js} +1 -1
  43. package/dist/client/assets/{X-Kva1-1w6.js → X-BhzA_1fc.js} +1 -1
  44. package/dist/client/assets/{XCircle-is5Yz5zC.js → XCircle-5bxw-TCO.js} +1 -1
  45. package/dist/client/assets/{XClose-CTi-Jfjf.js → XClose-Wb3kb2wQ.js} +1 -1
  46. package/dist/client/assets/{Zap-BaNiFF73.js → Zap-C7SsP-IX.js} +1 -1
  47. package/dist/client/assets/{ZoomOut-B4bCZT0v.js → ZoomOut-DD63PTKM.js} +1 -1
  48. package/dist/client/assets/{access-gate-BIJUwHgU.js → access-gate-CF90D6ZN.js} +1 -1
  49. package/dist/client/assets/{add-connection-dialog-meZHqquz.js → add-connection-dialog-DW65U6Wq.js} +1 -1
  50. package/dist/client/assets/{agent-analytics-BNio_Xoa.js → agent-analytics-XBQDhiev.js} +1 -1
  51. package/dist/client/assets/agent-app-DzMKE0bK.js +1 -0
  52. package/dist/client/assets/{agent-assets-CrBmJTwb.js → agent-assets-BuN3RBoX.js} +1 -1
  53. package/dist/client/assets/{agent-automation-CMfYmOqA.js → agent-automation-CrEsEqJi.js} +1 -1
  54. package/dist/client/assets/{agent-automations-DCUziLFb.js → agent-automations-DjEr5OON.js} +1 -1
  55. package/dist/client/assets/{agent-connect-sources-CwuA44eN.js → agent-connect-sources-C1qjhYRh.js} +1 -1
  56. package/dist/client/assets/agent-deck-DtjwfP_s.js +1 -0
  57. package/dist/client/assets/{agent-e2e-q13uurpy.js → agent-e2e-Cfg26cM_.js} +1 -1
  58. package/dist/client/assets/{agent-experiments-Cx09CiYJ.js → agent-experiments-BIEq8Lo9.js} +1 -1
  59. package/dist/client/assets/agent-file-qEpGLLaq.js +1 -0
  60. package/dist/client/assets/{agent-git-DzjS7TA-.js → agent-git-D7wfr3_G.js} +1 -1
  61. package/dist/client/assets/{agent-hosting-DeY3Fxvw.js → agent-hosting-CilFkS1d.js} +1 -1
  62. package/dist/client/assets/{agent-icon-Dea2QsJ5.js → agent-icon-evl-xYsS.js} +1 -1
  63. package/dist/client/assets/agent-library-file-8ZuJr1v5.js +1 -0
  64. package/dist/client/assets/{agent-monitor-CxFGwLAH.js → agent-monitor-C0Fm4BUv.js} +1 -1
  65. package/dist/client/assets/{agent-overview-BK0Ly3j7.js → agent-overview-BjM__Csy.js} +1 -1
  66. package/dist/client/assets/agent-settings-bF0PHMwv.js +1 -0
  67. package/dist/client/assets/{agent-site-editor-DoqZzjS4.js → agent-site-editor-DX54ZFDP.js} +1 -1
  68. package/dist/client/assets/agent-site-editor-code-DQcBjkuE.js +2 -0
  69. package/dist/client/assets/{agent-site-editor-content-BgfGo5fz.js → agent-site-editor-content-DLuPYCjb.js} +2 -2
  70. package/dist/client/assets/{agent-site-editor-preview-CG3QbZz5.js → agent-site-editor-preview-B7EGGax5.js} +3 -3
  71. package/dist/client/assets/agent-view-CzBjw4N4.js +1 -0
  72. package/dist/client/assets/{agent-view-guard-u4P6ATvB.js → agent-view-guard-CCd22E1L.js} +1 -1
  73. package/dist/client/assets/{agents-list-DlpAMFxu.js → agents-list-D93GLjoE.js} +1 -1
  74. package/dist/client/assets/{ai-providers-DOwb34Gp.js → ai-providers-B9EE6Evb.js} +1 -1
  75. package/dist/client/assets/{alert-DjLHClqz.js → alert-DGEbBMaM.js} +1 -1
  76. package/dist/client/assets/{alert-dialog-D-E1S18Y.js → alert-dialog-i5Kug417.js} +1 -1
  77. package/dist/client/assets/api-keys-BJNqXGRk.js +1 -0
  78. package/dist/client/assets/{api-keys-C8ERA1BS.js → api-keys-C6WYCwY7.js} +1 -1
  79. package/dist/client/assets/app-editor-CLSwHRy5.js +1 -0
  80. package/dist/client/assets/{asset-utils-bWUI5ZgC.js → asset-utils-DpED9-PH.js} +1 -1
  81. package/dist/client/assets/{auth-BmR-l5Yo.js → auth-BSa1jG6_.js} +1 -1
  82. package/dist/client/assets/{auth-catchall-BRJJVRKl.js → auth-catchall-C6Yfki6S.js} +1 -1
  83. package/dist/client/assets/{auth-entry-DUgoxFbj.js → auth-entry-DesK7O7A.js} +1 -1
  84. package/dist/client/assets/{auth-split-layout-CJxyhLqt.js → auth-split-layout-BBjCOPFN.js} +1 -1
  85. package/dist/client/assets/{authenticate-and-persist-oauth-k1l_ccih.js → authenticate-and-persist-oauth-R7mrW7Ic.js} +1 -1
  86. package/dist/client/assets/{automation-list-row-DB7YW85_.js → automation-list-row-DyFJiE-i.js} +1 -1
  87. package/dist/client/assets/{automation-runs-BOpb8six.js → automation-runs-1dbZvXFH.js} +1 -1
  88. package/dist/client/assets/{automations-BmakHAFO.js → automations-7EQqwttv.js} +1 -1
  89. package/dist/client/assets/{autosend-Depmmptr.js → autosend-Cqvvj0w1.js} +1 -1
  90. package/dist/client/assets/{avatar-O6wTdnIX.js → avatar-FK7QRIag.js} +1 -1
  91. package/dist/client/assets/{badge-DoAzEZn5.js → badge-u9Hsr2d5.js} +1 -1
  92. package/dist/client/assets/block-document-D10w--Mb.js +3 -0
  93. package/dist/client/assets/{blocks-preview-workspace-context-Car-K0uy.js → blocks-preview-workspace-context-DI5uf_jB.js} +1 -1
  94. package/dist/client/assets/{breadcrumb-BmkIA-fv.js → breadcrumb-UAWwfJqE.js} +1 -1
  95. package/dist/client/assets/{buckets-h_pHyvSy.js → buckets-BW8c0lp3.js} +1 -1
  96. package/dist/client/assets/{build-improve-prompt-doc-BEUB8P7A.js → build-improve-prompt-doc-C3cWYyT9.js} +1 -1
  97. package/dist/client/assets/{bulk-category-panel-Ckd0FuR3.js → bulk-category-panel-DP5C4hjp.js} +1 -1
  98. package/dist/client/assets/{calendar-D4Craz7_.js → calendar-CIMSGrCu.js} +1 -1
  99. package/dist/client/assets/{capability-load-error-BloIwmrF.js → capability-load-error-DhHYfXLK.js} +1 -1
  100. package/dist/client/assets/category-editor-7J26OnED.js +1 -0
  101. package/dist/client/assets/{chart-Bn2p5h0c.js → chart-DIj8Q5yX.js} +1 -1
  102. package/dist/client/assets/{chat-context-B06uBhCi.js → chat-context-B7MmQdh-.js} +1 -1
  103. package/dist/client/assets/{chat-draft-4cBKna-O.js → chat-draft-SlXrLeIK.js} +1 -1
  104. package/dist/client/assets/{checkbox-cLpyandh.js → checkbox-CWmkLo2r.js} +1 -1
  105. package/dist/client/assets/{choose-editor-BQHy-4Ny.js → choose-editor-t1hiEvab.js} +1 -1
  106. package/dist/client/assets/{cli-auth-success-BU8Y5A6a.js → cli-auth-success-BQOVKJZe.js} +1 -1
  107. package/dist/client/assets/{client-icons-Cje86OHl.js → client-icons-A_s8whpB.js} +1 -1
  108. package/dist/client/assets/{collapsible-CrphyGjf.js → collapsible-BasgjGsI.js} +1 -1
  109. package/dist/client/assets/{collection-detail-Z1ViTGh_.js → collection-detail-GuNnbLui.js} +1 -1
  110. package/dist/client/assets/collection-display-button-Bw590BAk.js +1 -0
  111. package/dist/client/assets/{collection-search-BRxo-Fi-.js → collection-search-BVYMWeyx.js} +1 -1
  112. package/dist/client/assets/{collection-table-wrapper-CRXilOoQ.js → collection-table-wrapper-6wf20wao.js} +1 -1
  113. package/dist/client/assets/{collection-tabs-C_myPCym.js → collection-tabs-Df2TTdMU.js} +1 -1
  114. package/dist/client/assets/{combobox-Dq5uEMj4.js → combobox-D77wlVAX.js} +1 -1
  115. package/dist/client/assets/{command-BbtwoX_6.js → command-DMx0q2L2.js} +1 -1
  116. package/dist/client/assets/{companion-mcps-section-CT8bkRr-.js → companion-mcps-section-b6HVbGuh.js} +1 -1
  117. package/dist/client/assets/{connect-DWr8OnxD.js → connect-D5pNOzTk.js} +1 -1
  118. package/dist/client/assets/{connect-layout-DC2D1YF_.js → connect-layout-B1WF-_cs.js} +1 -1
  119. package/dist/client/assets/{connection-B0pc1GcJ.js → connection-cXvwUyEO.js} +1 -1
  120. package/dist/client/assets/{connection-card-BIhZjUDe.js → connection-card-BFbHrstW.js} +1 -1
  121. package/dist/client/assets/connection-detail-sYpfkRBw.js +1 -0
  122. package/dist/client/assets/{connection-form-helpers-Br3fa97m.js → connection-form-helpers-J4WV5pE2.js} +1 -1
  123. package/dist/client/assets/{connections-CFqGUj8Y.js → connections-BQOAUYAD.js} +1 -1
  124. package/dist/client/assets/{create-organization-dialog-nZ4WptrO.js → create-organization-dialog-Dj28D26q.js} +1 -1
  125. package/dist/client/assets/{decofile-api-CfrmgxQx.js → decofile-api-DFzAXCWe.js} +1 -1
  126. package/dist/client/assets/{decopilot-VqaWYdeg.js → decopilot-xo8VMJYt.js} +1 -1
  127. package/dist/client/assets/{dialog-Bf8N5U1x.js → dialog-B4CC36y2.js} +1 -1
  128. package/dist/client/assets/{discover-ZWgrxxUF.js → discover-BRjDF7of.js} +1 -1
  129. package/dist/client/assets/{domain-settings-D0jN4PTM.js → domain-settings-ZTnCw-uE.js} +1 -1
  130. package/dist/client/assets/{download-app-dialog-D2pEwDoL.js → download-app-dialog-C7q-uW_M.js} +1 -1
  131. package/dist/client/assets/{drawer-C7OGj6bl.js → drawer-cDeYKE_5.js} +1 -1
  132. package/dist/client/assets/{editor-BNDn2u8l.js → editor-CceEDKnu.js} +1 -1
  133. package/dist/client/assets/{empty-state-Du9T7RNW.js → empty-state-D0-uMFNS.js} +1 -1
  134. package/dist/client/assets/{empty-state-owsBueg1.js → empty-state-DqQcz2gx.js} +1 -1
  135. package/dist/client/assets/{extract-connection-data-DSvxXI-l.js → extract-connection-data-DrFb-pU-.js} +1 -1
  136. package/dist/client/assets/{feature-gate-oyoKwzdQ.js → feature-gate-BHdDRx8A.js} +1 -1
  137. package/dist/client/assets/{feature-paywall-7FJzzTOu.js → feature-paywall-CzYUyr6D.js} +1 -1
  138. package/dist/client/assets/{file-explorer-BPcXKhss.js → file-explorer-DQ4A2Ehe.js} +1 -1
  139. package/dist/client/assets/{file-preview-Ntsv7U1c.js → file-preview-Bxu-E3tU.js} +1 -1
  140. package/dist/client/assets/{file-share-button-jZIN7RwA.js → file-share-button-tMOIQK1_.js} +1 -1
  141. package/dist/client/assets/{file-type-icon-BXPKfBjf.js → file-type-icon-DBFIRgFa.js} +1 -1
  142. package/dist/client/assets/{folder-icon-D3MffFJj.js → folder-icon-B02qSVJf.js} +1 -1
  143. package/dist/client/assets/{form-C5tY8FAE.js → form-DqH1g4Ki.js} +1 -1
  144. package/dist/client/assets/{gateway-client-dD2sYw12.js → gateway-client-BFmXQ1k7.js} +1 -1
  145. package/dist/client/assets/{general-DbIEaBtt.js → general-C5ZOXLR-.js} +1 -1
  146. package/dist/client/assets/{github-icon-BNIJPWs2.js → github-icon-Cb9Axcg7.js} +1 -1
  147. package/dist/client/assets/{home-zBCJylG4.js → home-Cvyw1zpI.js} +1 -1
  148. package/dist/client/assets/{hooks-C6wmVP1j.js → hooks-BCp_JYxn.js} +1 -1
  149. package/dist/client/assets/{hooks-DB2KtQF1.js → hooks-mKjK2JU6.js} +1 -1
  150. package/dist/client/assets/{icon-button-ByfHOna3.js → icon-button-DIo1zDHA.js} +1 -1
  151. package/dist/client/assets/{index-BvOit_NC.js → index-5FNlOK9S.js} +1 -1
  152. package/dist/client/assets/{index-BJXxq6kp.js → index-BJqjsSyt.js} +1 -1
  153. package/dist/client/assets/{index-CiTMciGd.js → index-BpVScA85.js} +1 -1
  154. package/dist/client/assets/{index-RyrXTX_U.js → index-CAxE8yKu.js} +1 -1
  155. package/dist/client/assets/{index-CW8Zn5Vo.js → index-CF31XFHg.js} +1 -1
  156. package/dist/client/assets/{index-DmAcZcEg.js → index-DNzOKAP1.js} +1 -1
  157. package/dist/client/assets/{index-OnVTieMy.js → index-DOFkemEL.js} +2 -2
  158. package/dist/client/assets/{index-Cth4b0Ft.js → index-DgKwQYwb.js} +1 -1
  159. package/dist/client/assets/{index-MMfySMVA.js → index-DpP6xBRQ.js} +1 -1
  160. package/dist/client/assets/{index-BwHZ6yYD.js → index-Lb0s3gkO.js} +1 -1
  161. package/dist/client/assets/{index-Cr3HNIfx.js → index-T2tMBbkz.js} +1 -1
  162. package/dist/client/assets/{index-Dm-8Hb4L.js → index-Yd3WEM80.js} +2 -2
  163. package/dist/client/assets/{index-CDhBwotI.js → index-ngZ_yuYG.js} +1 -1
  164. package/dist/client/assets/{index-Dfn6iQr2.js → index-o-L6_2ka.js} +1 -1
  165. package/dist/client/assets/{index-redirect-BM1uBMfC.js → index-redirect-Cf-YjMNH.js} +1 -1
  166. package/dist/client/assets/{infiniteQueryObserver-CAEqmV_2.js → infiniteQueryObserver-CN-NqOxs.js} +1 -1
  167. package/dist/client/assets/{infra-billing-C5A9Wz4R.js → infra-billing-BLgi6Owe.js} +1 -1
  168. package/dist/client/assets/{input-CWQy3Tya.js → input-CvnDClDE.js} +1 -1
  169. package/dist/client/assets/{input--O5KUqzs.js → input-KJgBOsyt.js} +1 -1
  170. package/dist/client/assets/{input-C_oDShrp.js → input-M1Rf1qIc.js} +1 -1
  171. package/dist/client/assets/{integration-icon-CISeHTVW.js → integration-icon-Cg53nCZC.js} +1 -1
  172. package/dist/client/assets/{label-C-2BWfwg.js → label-CgaAtTIX.js} +1 -1
  173. package/dist/client/assets/{last-preview-page-BVeY9P7x.js → last-preview-page-DglwZwTU.js} +1 -1
  174. package/dist/client/assets/{layout-DM0z_8an.js → layout-CFr9zDwj.js} +1 -1
  175. package/dist/client/assets/{legacy-agents-deep-CJ0u_ZEK.js → legacy-agents-deep-DxAgZvFx.js} +1 -1
  176. package/dist/client/assets/{legacy-main-redirect-BpsgPVEv.js → legacy-main-redirect-CXezOh_v.js} +1 -1
  177. package/dist/client/assets/{library-CuMQZATJ.js → library-fMfRvxtI.js} +1 -1
  178. package/dist/client/assets/{login-3NR-JbuJ.js → login-DMJQuXm5.js} +1 -1
  179. package/dist/client/assets/{markdown-DPl9yjdo.js → markdown-BKiG9T-f.js} +1 -1
  180. package/dist/client/assets/{mcp-app-renderer-DBAAr1YD.js → mcp-app-renderer-DCYIDykQ.js} +2 -2
  181. package/dist/client/assets/{mcp-oauth-lrxK5SpS.js → mcp-oauth-Bvz7f0mY.js} +1 -1
  182. package/dist/client/assets/members-B_NKVr1s.js +1 -0
  183. package/dist/client/assets/{message-templates-C6gTcE8J.js → message-templates-CjqJSnkj.js} +1 -1
  184. package/dist/client/assets/{mini-report-page-DmC7p3nN.js → mini-report-page-BdpMf22c.js} +1 -1
  185. package/dist/client/assets/{mock-board-Cp-nJCws.js → mock-board-BdQLGWWZ.js} +3 -3
  186. package/dist/client/assets/{monaco-editor-CzOxIPWR.js → monaco-editor-BDIyAK-M.js} +1 -1
  187. package/dist/client/assets/{monitoring-stats-row-C-rPlhe5.js → monitoring-stats-row-C4fMrM6s.js} +1 -1
  188. package/dist/client/assets/multi-select-BzwcvZFJ.js +1 -0
  189. package/dist/client/assets/{mustache-jAJ0Dh0T.js → mustache-qCmONE00.js} +1 -1
  190. package/dist/client/assets/{oauth-callback-DF4kRsdh.js → oauth-callback-Bx8ukslY.js} +1 -1
  191. package/dist/client/assets/{oauth-callback-ai-provider-Zo7RI1Og.js → oauth-callback-ai-provider-Dy4mtlFe.js} +1 -1
  192. package/dist/client/assets/{onboarding-D3Ed8kZT.js → onboarding-D7xPPSO8.js} +1 -1
  193. package/dist/client/assets/{optimistic-project-sidebar-views-CG5DBe8M.js → optimistic-project-sidebar-views-Crsjc8Ek.js} +1 -1
  194. package/dist/client/assets/{org-file-open-context-zwzXTKUN.js → org-file-open-context-CRpZmGcx.js} +1 -1
  195. package/dist/client/assets/{organization-choice-obicC5t3.js → organization-choice-fCF1vpZQ.js} +1 -1
  196. package/dist/client/assets/{orgs-DIOemkQl.js → orgs-nJcrPLKV.js} +1 -1
  197. package/dist/client/assets/{page-seo-form-luCLG0Ke.js → page-seo-form-4xkVuHnu.js} +1 -1
  198. package/dist/client/assets/{pair-CFCbh-9t.js → pair-Da7tLUJm.js} +1 -1
  199. package/dist/client/assets/{plan-ladder-D4qNTX3a.js → plan-ladder-D2AKJRvg.js} +1 -1
  200. package/dist/client/assets/{popover-DcRnZbRB.js → popover-JLFGljNy.js} +1 -1
  201. package/dist/client/assets/{post-calendar-DmhkkILr.js → post-calendar-vGm6mZu3.js} +1 -1
  202. package/dist/client/assets/{post-editor-Bd4oeY0P.js → post-editor-Dt3_9Fhb.js} +1 -1
  203. package/dist/client/assets/{preview-content-BteE7j6t.js → preview-content-BwWN9AnE.js} +1 -1
  204. package/dist/client/assets/{preview-dialog-1a15xXlz.js → preview-dialog-Bn_N1fKa.js} +1 -1
  205. package/dist/client/assets/{primitives-D9cBEamz.js → primitives-DAP3QnJa.js} +1 -1
  206. package/dist/client/assets/{profile-B4g9CgTJ.js → profile-Db8455hP.js} +1 -1
  207. package/dist/client/assets/{project-app-view-yOXhNy3w.js → project-app-view-BAeM8uog.js} +1 -1
  208. package/dist/client/assets/{project-feed-VgI9_pqj.js → project-feed-CO6D2qPp.js} +1 -1
  209. package/dist/client/assets/{project-icon-DBp2PUWA.js → project-icon-DpfxAXQD.js} +1 -1
  210. package/dist/client/assets/project-reports-ChSmIDxx.js +1 -0
  211. package/dist/client/assets/project-tasks-CQHAi3Wq.js +1 -0
  212. package/dist/client/assets/{prompts-Dc-0RVxx.js → prompts-DBq4J52h.js} +1 -1
  213. package/dist/client/assets/record-editor-4vVGitSN.js +1 -0
  214. package/dist/client/assets/{redirect-editor-BdR1iS4Z.js → redirect-editor-DlSJNMhh.js} +1 -1
  215. package/dist/client/assets/registry-CND3YEim.js +2 -0
  216. package/dist/client/assets/{registry-layout-CEa46E4k.js → registry-layout-DwB-OdYN.js} +4 -4
  217. package/dist/client/assets/reports-B8pQqdBF.js +1 -0
  218. package/dist/client/assets/{reports-BN6w3xEY.js → reports-DIzScOuV.js} +26 -26
  219. package/dist/client/assets/{reports-onboarding-WdznsHgB.js → reports-onboarding-BIML3oTp.js} +1 -1
  220. package/dist/client/assets/{reports-tab-Dm6YKojQ.js → reports-tab-BVlRmNTA.js} +2 -2
  221. package/dist/client/assets/{repositories-BIKfLGsT.js → repositories-DmqjleLq.js} +1 -1
  222. package/dist/client/assets/{repository-import-picker-C4oLk9z7.js → repository-import-picker-BpXr4DO5.js} +1 -1
  223. package/dist/client/assets/{repository-picker-UnQe6RSu.js → repository-picker-C_TY_073.js} +1 -1
  224. package/dist/client/assets/{require-capability-B56EQxaC.js → require-capability-C9mVQudO.js} +1 -1
  225. package/dist/client/assets/{required-auth-layout-PDYBfJne.js → required-auth-layout-Cnz59w5M.js} +1 -1
  226. package/dist/client/assets/{reset-password-rG_LDLia.js → reset-password-DS6Hktkf.js} +1 -1
  227. package/dist/client/assets/{resizable-BgQ3eO5u.js → resizable-aSmI0A8Q.js} +1 -1
  228. package/dist/client/assets/{review-settings-FmPoj8-i.js → review-settings-DyikUvXC.js} +1 -1
  229. package/dist/client/assets/{rich-text-link-control-7sVqLwEk.js → rich-text-link-control-Bi59I-f7.js} +1 -1
  230. package/dist/client/assets/roles-BZ1wWV9R.js +1 -0
  231. package/dist/client/assets/{route-aRC5D9BU.js → route-8cXPOntp.js} +1 -1
  232. package/dist/client/assets/{route-DG7ERQE6.js → route-BGRZC3Bb.js} +1 -1
  233. package/dist/client/assets/{route-C-gcaaWb.js → route-Doa0au1w.js} +1 -1
  234. package/dist/client/assets/{route-page-header-43Ptqqp7.js → route-page-header-zyCpd9Cy.js} +1 -1
  235. package/dist/client/assets/runnable-block-editor-B4lPvDr3.js +16 -0
  236. package/dist/client/assets/{sandbox-lifecycle-context-DKgfqt8t.js → sandbox-lifecycle-context-BmtjzOPx.js} +1 -1
  237. package/dist/client/assets/{schema-pB_r1rh1.js → schema-CiBz9Elt.js} +1 -1
  238. package/dist/client/assets/{scroll-area-P-WFOaz6.js → scroll-area-gFog9x80.js} +1 -1
  239. package/dist/client/assets/{search-input-2pUrrqxc.js → search-input-CueqnTPs.js} +1 -1
  240. package/dist/client/assets/{search-toggle-D0z8gZkO.js → search-toggle-CQ81Mckm.js} +1 -1
  241. package/dist/client/assets/{secrets-xeL6zP7o.js → secrets-lng2mgWf.js} +1 -1
  242. package/dist/client/assets/{sections-editor-CLVk2UFF.js → sections-editor-DtMr7K7w.js} +2 -2
  243. package/dist/client/assets/{select-BiV8HM0k.js → select-CUtt4ZPU.js} +1 -1
  244. package/dist/client/assets/{select-model-CTog4nuz.js → select-model-Cg9wK6vb.js} +1 -1
  245. package/dist/client/assets/{seo-editor-CQPoWxYq.js → seo-editor-HlWWnxrn.js} +1 -1
  246. package/dist/client/assets/{separator-BTuW146r.js → separator-BGGxSB8n.js} +1 -1
  247. package/dist/client/assets/{settings-tab-BnMhHaER.js → settings-tab-wpZUEiSI.js} +1 -1
  248. package/dist/client/assets/{sheet-Co-bJKEy.js → sheet-BhrsEbbC.js} +1 -1
  249. package/dist/client/assets/{shell-layout-DdfrGT4U.js → shell-layout-eBzlZCHd.js} +1 -1
  250. package/dist/client/assets/{sidebar-CV_fP5cy.js → sidebar-3oMF2fjm.js} +1 -1
  251. package/dist/client/assets/{skill-preview-MtBrrxXz.js → skill-preview-DEqPLZjQ.js} +1 -1
  252. package/dist/client/assets/{skills-D5zuxZnx.js → skills-DjzFwZKo.js} +1 -1
  253. package/dist/client/assets/{sso-zjUa8YT7.js → sso-hecsHwbv.js} +1 -1
  254. package/dist/client/assets/{store-HfwFgi9t.js → store-Byhr4xr4.js} +1 -1
  255. package/dist/client/assets/store-registry-DfYDevII.js +2 -0
  256. package/dist/client/assets/{switch-CsmQv6c2.js → switch-DNsx8Rt5.js} +1 -1
  257. package/dist/client/assets/{synced-repos-CnfWJEo6.js → synced-repos-CTPTQlVz.js} +1 -1
  258. package/dist/client/assets/{table-D_8EmVvM.js → table-B5etRYRw.js} +1 -1
  259. package/dist/client/assets/{tabs-DZaWw4Bv.js → tabs-CpPOnj2_.js} +1 -1
  260. package/dist/client/assets/{task-board-7XKwz8Ro.js → task-board-Bk94AJKx.js} +1 -1
  261. package/dist/client/assets/{task-route-i0Kxok_Z.js → task-route-C9Eyo0iP.js} +1 -1
  262. package/dist/client/assets/{task-status-C172kMHp.js → task-status-xLTUNGzE.js} +1 -1
  263. package/dist/client/assets/{taskboard-analytics-D8RecqC3.js → taskboard-analytics-PTthbKgn.js} +1 -1
  264. package/dist/client/assets/{tasks-COu_me01.js → tasks-BcjXqTVo.js} +1 -1
  265. package/dist/client/assets/tasks-C2RS9Psh.js +1 -0
  266. package/dist/client/assets/{textarea-2-xerRa1.js → textarea-D85Taief.js} +1 -1
  267. package/dist/client/assets/{thread-button-x4InzahY.js → thread-button-D1ekzN6t.js} +1 -1
  268. package/dist/client/assets/{thread-intent-lt6l9AZJ.js → thread-intent-nPmQi6Ey.js} +1 -1
  269. package/dist/client/assets/{thread-route-BRg2UXMv.js → thread-route-B0qYywlW.js} +1 -1
  270. package/dist/client/assets/{thread-route-D7T1aorF.js → thread-route-uYlGJPx9.js} +1 -1
  271. package/dist/client/assets/{thread-sheet-body-Bq1bI51m.js → thread-sheet-body-Bp--GLPF.js} +1 -1
  272. package/dist/client/assets/{toggle-group-B0bgIr9u.js → toggle-group-B1Wf2ufn.js} +1 -1
  273. package/dist/client/assets/{toolbar-icon-button-BdjLCzch.js → toolbar-icon-button-Fowm5FMa.js} +1 -1
  274. package/dist/client/assets/{tooltip-DxGTcO6w.js → tooltip-CdoeOmsY.js} +1 -1
  275. package/dist/client/assets/{track-Cisk3tlu.js → track-C3jNEfoB.js} +1 -1
  276. package/dist/client/assets/{types-DRjbTzJZ.js → types-0F-H2LwE.js} +1 -1
  277. package/dist/client/assets/{usage-stats-CuUs_glM.js → usage-stats-BKa4kYOk.js} +1 -1
  278. package/dist/client/assets/{use-ai-providers-C0jBxurc.js → use-ai-providers-l3af7V8M.js} +1 -1
  279. package/dist/client/assets/{use-automations-yfAl_uNY.js → use-automations-DxhcJUEN.js} +1 -1
  280. package/dist/client/assets/{use-autosave-BKZX9oou.js → use-autosave-CzqqYyjs.js} +1 -1
  281. package/dist/client/assets/{use-connect-companion-miaVZXu5.js → use-connect-companion-BYMql-HO.js} +1 -1
  282. package/dist/client/assets/{use-connection-BOx7hns0.js → use-connection-CHfH5o2Y.js} +1 -1
  283. package/dist/client/assets/{use-copy-uBBaT1b4.js → use-copy-D5oP9OR0.js} +1 -1
  284. package/dist/client/assets/{use-create-virtual-mcp-CNCStEri.js → use-create-virtual-mcp-RO04se4f.js} +1 -1
  285. package/dist/client/assets/{use-date-fns-locale-CtLLovwR.js → use-date-fns-locale-DBzXctI9.js} +1 -1
  286. package/dist/client/assets/{use-debounced-autosave-Bey-3wHM.js → use-debounced-autosave-B-bNJu4f.js} +1 -1
  287. package/dist/client/assets/{use-debounced-value-CLSe2Xom.js → use-debounced-value-BsdRTOOo.js} +1 -1
  288. package/dist/client/assets/{use-deco-credits-Cw1qj1v-.js → use-deco-credits-BD7jKxjN.js} +1 -1
  289. package/dist/client/assets/{use-decopilot-events-POHlKqKk.js → use-decopilot-events-CseTP-XA.js} +1 -1
  290. package/dist/client/assets/{use-delete-connection-DltcweLd.js → use-delete-connection-DIyXv1iC.js} +1 -1
  291. package/dist/client/assets/{use-deployment-admin-Cm06_t3e.js → use-deployment-admin-DJzDQ-pl.js} +1 -1
  292. package/dist/client/assets/{use-entitlements-4qi-wHe5.js → use-entitlements-F2FeEQvE.js} +1 -1
  293. package/dist/client/assets/{use-fast-preview-draft-url-YN9G6ooq.js → use-fast-preview-draft-url-B1VVH72n.js} +1 -1
  294. package/dist/client/assets/{use-file-configs-BYWO8pQy.js → use-file-configs-CayPd4N1.js} +1 -1
  295. package/dist/client/assets/{use-in-settings-Dgua5GWF.js → use-in-settings-D-QMJwir.js} +1 -1
  296. package/dist/client/assets/{use-infinite-scroll-C6L_ctN7.js → use-infinite-scroll-KvBwMzoE.js} +1 -1
  297. package/dist/client/assets/{use-join-requests-DWcdshpS.js → use-join-requests-DZRRrORA.js} +1 -1
  298. package/dist/client/assets/{use-main-panel-tabs-wkC8W2JG.js → use-main-panel-tabs-BJhPu6IR.js} +1 -1
  299. package/dist/client/assets/{use-mcp-auth-status-X95kM0LL.js → use-mcp-auth-status-47ZgdGsc.js} +1 -1
  300. package/dist/client/assets/{use-mcp-client--UmG7uJi.js → use-mcp-client-DeAm9BB5.js} +1 -1
  301. package/dist/client/assets/{use-mcp-prompts-HlnuulK9.js → use-mcp-prompts-BNwQ051-.js} +1 -1
  302. package/dist/client/assets/{use-mcp-tools-BUHu4Og_.js → use-mcp-tools-DYrUZ35N.js} +1 -1
  303. package/dist/client/assets/{use-members-sSTdK_5S.js → use-members-DuAWZpQi.js} +1 -1
  304. package/dist/client/assets/{use-mobile-DFNr-t29.js → use-mobile-ChHoUAvP.js} +1 -1
  305. package/dist/client/assets/{use-navigate-to-agent-Bno9g2Xm.js → use-navigate-to-agent-CBBHpKVC.js} +1 -1
  306. package/dist/client/assets/{use-open-billing-url-BIFQy_yG.js → use-open-billing-url-D7QlXiDv.js} +1 -1
  307. package/dist/client/assets/{use-org-auth-client-CW9BnSfs.js → use-org-auth-client-CeC2zNw8.js} +1 -1
  308. package/dist/client/assets/{use-org-fs-B4juj07O.js → use-org-fs-DJqJjHE6.js} +1 -1
  309. package/dist/client/assets/{use-org-repo-syncs-B7EI5qGt.js → use-org-repo-syncs-qt-ndim1.js} +1 -1
  310. package/dist/client/assets/{use-org-sso-Cq8BipRK.js → use-org-sso-Dgw9Eqau.js} +1 -1
  311. package/dist/client/assets/{use-organization-roles-Dp9OUWEX.js → use-organization-roles-BuakYscg.js} +1 -1
  312. package/dist/client/assets/{use-organization-settings-Bcjyhr6h.js → use-organization-settings-BZDRLE_8.js} +1 -1
  313. package/dist/client/assets/{use-panel-navigate-B-rvq4Am.js → use-panel-navigate-BIUuLVau.js} +1 -1
  314. package/dist/client/assets/{use-project-native-view-presence-D2PDI5Hk.js → use-project-native-view-presence-BXbyWnN5.js} +1 -1
  315. package/dist/client/assets/{use-project-scope-7VfyYZg4.js → use-project-scope-JD-WFsZ8.js} +1 -1
  316. package/dist/client/assets/{use-registry-connections-nh08j8_a.js → use-registry-connections-JkWY7Rlf.js} +1 -1
  317. package/dist/client/assets/{use-releases-OVrSqa56.js → use-releases-Bj_Ymy_W.js} +1 -1
  318. package/dist/client/assets/{use-reports-diagnostic-DFrfBw9G.js → use-reports-diagnostic-BgUzApZd.js} +1 -1
  319. package/dist/client/assets/{use-route-default-main-CWRdl2BJ.js → use-route-default-main-CYJvgdxd.js} +1 -1
  320. package/dist/client/assets/{use-secrets-B5BLhJgE.js → use-secrets-BzYTFxAZ.js} +1 -1
  321. package/dist/client/assets/{use-section-preview-base-C2rAZli-.js → use-section-preview-base-kOUY2OiG.js} +1 -1
  322. package/dist/client/assets/{use-session-runtime-CBJ7ORoa.js → use-session-runtime-56LtAg98.js} +1 -1
  323. package/dist/client/assets/{use-tags-BzpfziGO.js → use-tags-BOpjVam6.js} +1 -1
  324. package/dist/client/assets/{use-task-board-analytics-Dgef6FGn.js → use-task-board-analytics-qYaGd8yG.js} +1 -1
  325. package/dist/client/assets/{use-task-metadata-DZP-UjSO.js → use-task-metadata-DT6NHJG8.js} +1 -1
  326. package/dist/client/assets/{use-thread-outputs-CvWDQ3he.js → use-thread-outputs-CXuIcLvd.js} +1 -1
  327. package/dist/client/assets/{use-view-mode-J6vCl_iY.js → use-view-mode-D6MhO34a.js} +1 -1
  328. package/dist/client/assets/{use-virtual-mcp-CMfWtZ1X.js → use-virtual-mcp-rS90dDab.js} +1 -1
  329. package/dist/client/assets/useInfiniteQuery-Bfgd7a2b.js +1 -0
  330. package/dist/client/assets/{useQueries-51Axgr5J.js → useQueries-N7Njeopg.js} +1 -1
  331. package/dist/client/assets/useSuspenseInfiniteQuery-08sNGvo6.js +1 -0
  332. package/dist/client/assets/{users-HL_b9_VE.js → users-Dr-YNEas.js} +1 -1
  333. package/dist/client/assets/{utils-Rw83cu6v.js → utils-ICA_NEq2.js} +1 -1
  334. package/dist/client/assets/{variant-calendar-OuoW0bWr.js → variant-calendar-CrZ19ffw.js} +1 -1
  335. package/dist/client/assets/{variant-matcher-override-DJ1eiY8u.js → variant-matcher-override-Ba-vWMhx.js} +1 -1
  336. package/dist/client/assets/{view-mode-toggle-BlPRaK-D.js → view-mode-toggle-jxA0OExK.js} +1 -1
  337. package/dist/client/assets/{virtual-mcp-D-wB99Xb.js → virtual-mcp-BU8h6LUw.js} +1 -1
  338. package/dist/client/index.html +1 -1
  339. package/dist/server/cli.js +1 -1
  340. package/dist/server/server.js +1 -1
  341. package/package.json +1 -1
  342. package/dist/client/assets/agent-app-9FVd6FC-.js +0 -1
  343. package/dist/client/assets/agent-deck-BFnegUvy.js +0 -1
  344. package/dist/client/assets/agent-file-C2kx-d1u.js +0 -1
  345. package/dist/client/assets/agent-library-file-rX7_RYzq.js +0 -1
  346. package/dist/client/assets/agent-settings-DsKeIx9K.js +0 -1
  347. package/dist/client/assets/agent-site-editor-code-Bpyk3Wbh.js +0 -2
  348. package/dist/client/assets/agent-view-1Ji5y2X1.js +0 -1
  349. package/dist/client/assets/api-keys-XdErFgq7.js +0 -1
  350. package/dist/client/assets/app-editor-D7hcCrUA.js +0 -1
  351. package/dist/client/assets/block-document-Cj-Jl_-4.js +0 -3
  352. package/dist/client/assets/category-editor-HPl4vytm.js +0 -1
  353. package/dist/client/assets/collection-display-button-CNuFWdfa.js +0 -1
  354. package/dist/client/assets/connection-detail-F07X2xeh.js +0 -1
  355. package/dist/client/assets/members-GvM0pw_z.js +0 -1
  356. package/dist/client/assets/multi-select-TMnS224X.js +0 -1
  357. package/dist/client/assets/project-reports-CJLosTLH.js +0 -1
  358. package/dist/client/assets/project-tasks-_n2Qhjp9.js +0 -1
  359. package/dist/client/assets/record-editor-DaqmuLvj.js +0 -1
  360. package/dist/client/assets/registry-D7W9oufb.js +0 -2
  361. package/dist/client/assets/reports-Bu0wbKBT.js +0 -1
  362. package/dist/client/assets/roles-BBETILy3.js +0 -1
  363. package/dist/client/assets/runnable-block-editor-B--Iqh2n.js +0 -16
  364. package/dist/client/assets/store-registry-C5IhGjMq.js +0 -2
  365. package/dist/client/assets/tasks-Ag9i2trK.js +0 -1
  366. package/dist/client/assets/useInfiniteQuery-DnwP6DsX.js +0 -1
  367. package/dist/client/assets/useSuspenseInfiniteQuery-DJiyBZ4z.js +0 -1
@@ -1 +1 @@
1
- import{c as O,b as A,u as K,d as V,r as z,e as $,j as s,B as T,a as G}from"./index-Dm-8Hb4L.js";import{I as D}from"./input--O5KUqzs.js";function U(){const e=O.c(53),t=A();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/reset-password"},e[0]=n):n=e[0];const{token:o,error:F}=K(n),a=V(),[l,M]=z.useState(""),[i,q]=z.useState(""),[r,B]=z.useState(!1),c=F==="INVALID_TOKEN";let v;e[1]===Symbol.for("react.memo_cache_sentinel")?(v={mutationFn:H,onSuccess:()=>{B(!0)}},e[1]=v):v=e[1];const b=$(v),N=l===i,d=l.length>=8&&i.length>=8&&N,m=b.isPending,P=b.error;let y;e[2]!==d||e[3]!==l||e[4]!==b||e[5]!==o?(y=j=>{j.preventDefault(),!(!o||!d)&&b.mutate({newPassword:l,token:o})},e[2]=d,e[3]=l,e[4]=b,e[5]=o,e[6]=y):y=e[6];const I=y;let k;e[7]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"radial-gradient(circle, var(--primary-foreground) 1px, transparent 1px)",backgroundSize:"16px 16px",opacity:.15}}),e[7]=k):k=e[7];let S,_,L,E;e[8]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),_=s.jsx("div",{className:"absolute bottom-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),L=s.jsx("div",{className:"absolute left-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),E=s.jsx("div",{className:"absolute right-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),e[8]=S,e[9]=_,e[10]=L,e[11]=E):(S=e[8],_=e[9],L=e[10],E=e[11]);let C;e[12]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx("div",{className:"flex justify-center",children:s.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12"})}),e[12]=C):C=e[12];let u;e[13]!==r||e[14]!==t?(u=t(r?"routes.resetPassword.passwordResetSuccessful":"routes.resetPassword.setNewPassword"),e[13]=r,e[14]=t,e[15]=u):u=e[15];let x;e[16]!==u?(x=s.jsx("div",{className:"text-center space-y-1",children:s.jsx("p",{className:"text-sm text-foreground/70",children:u})}),e[16]=u,e[17]=x):x=e[17];let f;e[18]!==c||e[19]!==a||e[20]!==r||e[21]!==t||e[22]!==o?(f=(c||!o&&!r)&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:t("routes.resetPassword.invalidOrExpiredLink")}),s.jsx(T,{onClick:()=>a({to:"/login"}),className:"w-full font-semibold",size:"lg",children:t("routes.resetPassword.backToLogin")})]}),e[18]=c,e[19]=a,e[20]=r,e[21]=t,e[22]=o,e[23]=f):f=e[23];let g;e[24]!==P||e[25]!==t?(g=P&&s.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:P.message||t("routes.resetPassword.failedToReset")}),e[24]=P,e[25]=t,e[26]=g):g=e[26];let p;e[27]!==a||e[28]!==r||e[29]!==t?(p=r&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"rounded-xl bg-success/10 p-3 text-sm text-success text-center",children:t("routes.resetPassword.passwordResetDescription")}),s.jsx(T,{onClick:()=>a({to:"/login"}),className:"w-full font-semibold",size:"lg",children:t("routes.resetPassword.goToLogin")})]}),e[27]=a,e[28]=r,e[29]=t,e[30]=p):p=e[30];let w;e[31]!==d||e[32]!==i||e[33]!==I||e[34]!==c||e[35]!==m||e[36]!==l||e[37]!==N||e[38]!==r||e[39]!==t||e[40]!==o?(w=o&&!c&&!r&&s.jsxs("form",{onSubmit:I,className:"grid gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:t("routes.resetPassword.newPasswordLabel")}),s.jsx(D,{type:"password",placeholder:"••••••••",value:l,onChange:j=>M(j.target.value),required:!0,minLength:8,disabled:m})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:t("routes.resetPassword.confirmPasswordLabel")}),s.jsx(D,{type:"password",placeholder:"••••••••",value:i,onChange:j=>q(j.target.value),required:!0,minLength:8,disabled:m}),i&&!N&&s.jsx("p",{className:"text-xs text-destructive mt-1.5",children:t("routes.resetPassword.passwordsDoNotMatch")})]}),s.jsx(T,{type:"submit",disabled:m||!d,className:"w-full font-semibold",size:"lg",children:t(m?"routes.resetPassword.resetting":"routes.resetPassword.resetPassword")})]}),e[31]=d,e[32]=i,e[33]=I,e[34]=c,e[35]=m,e[36]=l,e[37]=N,e[38]=r,e[39]=t,e[40]=o,e[41]=w):w=e[41];let h;e[42]!==a||e[43]!==r||e[44]!==t?(h=!r&&s.jsx("div",{className:"text-center",children:s.jsx(T,{type:"button",variant:"link",onClick:()=>a({to:"/login"}),className:"text-sm text-muted-foreground hover:text-foreground",children:t("routes.resetPassword.backToSignIn")})}),e[42]=a,e[43]=r,e[44]=t,e[45]=h):h=e[45];let R;return e[46]!==x||e[47]!==f||e[48]!==g||e[49]!==p||e[50]!==w||e[51]!==h?(R=s.jsxs("main",{className:"relative flex min-h-screen items-center justify-center bg-gradient-to-br from-primary to-primary/75 p-4",children:[k,s.jsxs("div",{className:"relative z-10",children:[S,_,L,E,s.jsxs("div",{className:"mx-auto w-full min-w-[400px] max-w-md grid gap-6 bg-card p-10 border border-primary-foreground/20",children:[C,x,f,g,p,w,h]})]})]}),e[46]=x,e[47]=f,e[48]=g,e[49]=p,e[50]=w,e[51]=h,e[52]=R):R=e[52],R}async function H(e){const{newPassword:t,token:n}=e,o=await G.resetPassword({newPassword:t,token:n});if(o.error)throw new Error(o.error.message||"Failed to reset password");return o}export{U as default};
1
+ import{c as O,b as A,u as K,d as V,r as z,e as $,j as s,B as T,a as G}from"./index-Yd3WEM80.js";import{I as D}from"./input-KJgBOsyt.js";function U(){const e=O.c(53),t=A();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/reset-password"},e[0]=n):n=e[0];const{token:o,error:F}=K(n),a=V(),[l,M]=z.useState(""),[i,q]=z.useState(""),[r,B]=z.useState(!1),c=F==="INVALID_TOKEN";let v;e[1]===Symbol.for("react.memo_cache_sentinel")?(v={mutationFn:H,onSuccess:()=>{B(!0)}},e[1]=v):v=e[1];const b=$(v),N=l===i,d=l.length>=8&&i.length>=8&&N,m=b.isPending,P=b.error;let y;e[2]!==d||e[3]!==l||e[4]!==b||e[5]!==o?(y=j=>{j.preventDefault(),!(!o||!d)&&b.mutate({newPassword:l,token:o})},e[2]=d,e[3]=l,e[4]=b,e[5]=o,e[6]=y):y=e[6];const I=y;let k;e[7]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"radial-gradient(circle, var(--primary-foreground) 1px, transparent 1px)",backgroundSize:"16px 16px",opacity:.15}}),e[7]=k):k=e[7];let S,_,L,E;e[8]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),_=s.jsx("div",{className:"absolute bottom-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),L=s.jsx("div",{className:"absolute left-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),E=s.jsx("div",{className:"absolute right-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),e[8]=S,e[9]=_,e[10]=L,e[11]=E):(S=e[8],_=e[9],L=e[10],E=e[11]);let C;e[12]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx("div",{className:"flex justify-center",children:s.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12"})}),e[12]=C):C=e[12];let u;e[13]!==r||e[14]!==t?(u=t(r?"routes.resetPassword.passwordResetSuccessful":"routes.resetPassword.setNewPassword"),e[13]=r,e[14]=t,e[15]=u):u=e[15];let x;e[16]!==u?(x=s.jsx("div",{className:"text-center space-y-1",children:s.jsx("p",{className:"text-sm text-foreground/70",children:u})}),e[16]=u,e[17]=x):x=e[17];let f;e[18]!==c||e[19]!==a||e[20]!==r||e[21]!==t||e[22]!==o?(f=(c||!o&&!r)&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:t("routes.resetPassword.invalidOrExpiredLink")}),s.jsx(T,{onClick:()=>a({to:"/login"}),className:"w-full font-semibold",size:"lg",children:t("routes.resetPassword.backToLogin")})]}),e[18]=c,e[19]=a,e[20]=r,e[21]=t,e[22]=o,e[23]=f):f=e[23];let g;e[24]!==P||e[25]!==t?(g=P&&s.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:P.message||t("routes.resetPassword.failedToReset")}),e[24]=P,e[25]=t,e[26]=g):g=e[26];let p;e[27]!==a||e[28]!==r||e[29]!==t?(p=r&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"rounded-xl bg-success/10 p-3 text-sm text-success text-center",children:t("routes.resetPassword.passwordResetDescription")}),s.jsx(T,{onClick:()=>a({to:"/login"}),className:"w-full font-semibold",size:"lg",children:t("routes.resetPassword.goToLogin")})]}),e[27]=a,e[28]=r,e[29]=t,e[30]=p):p=e[30];let w;e[31]!==d||e[32]!==i||e[33]!==I||e[34]!==c||e[35]!==m||e[36]!==l||e[37]!==N||e[38]!==r||e[39]!==t||e[40]!==o?(w=o&&!c&&!r&&s.jsxs("form",{onSubmit:I,className:"grid gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:t("routes.resetPassword.newPasswordLabel")}),s.jsx(D,{type:"password",placeholder:"••••••••",value:l,onChange:j=>M(j.target.value),required:!0,minLength:8,disabled:m})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:t("routes.resetPassword.confirmPasswordLabel")}),s.jsx(D,{type:"password",placeholder:"••••••••",value:i,onChange:j=>q(j.target.value),required:!0,minLength:8,disabled:m}),i&&!N&&s.jsx("p",{className:"text-xs text-destructive mt-1.5",children:t("routes.resetPassword.passwordsDoNotMatch")})]}),s.jsx(T,{type:"submit",disabled:m||!d,className:"w-full font-semibold",size:"lg",children:t(m?"routes.resetPassword.resetting":"routes.resetPassword.resetPassword")})]}),e[31]=d,e[32]=i,e[33]=I,e[34]=c,e[35]=m,e[36]=l,e[37]=N,e[38]=r,e[39]=t,e[40]=o,e[41]=w):w=e[41];let h;e[42]!==a||e[43]!==r||e[44]!==t?(h=!r&&s.jsx("div",{className:"text-center",children:s.jsx(T,{type:"button",variant:"link",onClick:()=>a({to:"/login"}),className:"text-sm text-muted-foreground hover:text-foreground",children:t("routes.resetPassword.backToSignIn")})}),e[42]=a,e[43]=r,e[44]=t,e[45]=h):h=e[45];let R;return e[46]!==x||e[47]!==f||e[48]!==g||e[49]!==p||e[50]!==w||e[51]!==h?(R=s.jsxs("main",{className:"relative flex min-h-screen items-center justify-center bg-gradient-to-br from-primary to-primary/75 p-4",children:[k,s.jsxs("div",{className:"relative z-10",children:[S,_,L,E,s.jsxs("div",{className:"mx-auto w-full min-w-[400px] max-w-md grid gap-6 bg-card p-10 border border-primary-foreground/20",children:[C,x,f,g,p,w,h]})]})]}),e[46]=x,e[47]=f,e[48]=g,e[49]=p,e[50]=w,e[51]=h,e[52]=R):R=e[52],R}async function H(e){const{newPassword:t,token:n}=e,o=await G.resetPassword({newPassword:t,token:n});if(o.error)throw new Error(o.error.message||"Failed to reset password");return o}export{U as default};
@@ -1 +1 @@
1
- import{r as L,j as A,c as ve,l as He}from"./index-Dm-8Hb4L.js";import{a2 as ft}from"./agent-icon-Dea2QsJ5.js";function pt(e,t){const n=getComputedStyle(e),o=parseFloat(n.fontSize);return t*o}function ht(e,t){const n=getComputedStyle(e.ownerDocument.documentElement),o=parseFloat(n.fontSize);return t*o}function gt(e){return e/100*window.innerHeight}function vt(e){return e/100*window.innerWidth}function mt(e){switch(typeof e){case"number":return[e,"px"];case"string":{const t=parseFloat(e);return e.endsWith("%")?[t,"%"]:e.endsWith("px")?[t,"px"]:e.endsWith("rem")?[t,"rem"]:e.endsWith("em")?[t,"em"]:e.endsWith("vh")?[t,"vh"]:e.endsWith("vw")?[t,"vw"]:[t,"%"]}}}function re({groupSize:e,panelElement:t,styleProp:n}){let o;const[r,a]=mt(n);switch(a){case"%":{o=r/100*e;break}case"px":{o=r;break}case"rem":{o=ht(t,r);break}case"em":{o=pt(t,r);break}case"vh":{o=gt(r);break}case"vw":{o=vt(r);break}}return o}function T(e){return parseFloat(e.toFixed(3))}function te({group:e}){const{orientation:t,panels:n}=e;return n.reduce((o,r)=>(o+=t==="horizontal"?r.element.offsetWidth:r.element.offsetHeight,o),0)}function he(e){const{panels:t}=e,n=te({group:e});return n===0?t.map(o=>({groupResizeBehavior:o.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:o.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:o.panelConstraints.disabled,minSize:0,maxSize:100,panelId:o.id})):t.map(o=>{const{element:r,panelConstraints:a}=o;let l=0;if(a.collapsedSize!==void 0){const c=re({groupSize:n,panelElement:r,styleProp:a.collapsedSize});l=T(c/n*100)}let s;if(a.defaultSize!==void 0){const c=re({groupSize:n,panelElement:r,styleProp:a.defaultSize});s=T(c/n*100)}let i=0;if(a.minSize!==void 0){const c=re({groupSize:n,panelElement:r,styleProp:a.minSize});i=T(c/n*100)}let u=100;if(a.maxSize!==void 0){const c=re({groupSize:n,panelElement:r,styleProp:a.maxSize});u=T(c/n*100)}return{groupResizeBehavior:a.groupResizeBehavior,collapsedSize:l,collapsible:a.collapsible===!0,defaultSize:s,disabled:a.disabled,minSize:i,maxSize:u,panelId:o.id}})}function P(e,t="Assertion error"){if(!e)throw Error(t)}function ge(e,t){return Array.from(t).sort(e==="horizontal"?bt:yt)}function bt(e,t){const n=e.element.offsetLeft-t.element.offsetLeft;return n!==0?n:e.element.offsetWidth-t.element.offsetWidth}function yt(e,t){const n=e.element.offsetTop-t.element.offsetTop;return n!==0?n:e.element.offsetHeight-t.element.offsetHeight}function Ve(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function Ue(e,t){return{x:e.x>=t.left&&e.x<=t.right?0:Math.min(Math.abs(e.x-t.left),Math.abs(e.x-t.right)),y:e.y>=t.top&&e.y<=t.bottom?0:Math.min(Math.abs(e.y-t.top),Math.abs(e.y-t.bottom))}}function zt({orientation:e,rects:t,targetRect:n}){const o={x:n.x+n.width/2,y:n.y+n.height/2};let r,a=Number.MAX_VALUE;for(const l of t){const{x:s,y:i}=Ue(o,l),u=e==="horizontal"?s:i;u<a&&(a=u,r=l)}return P(r,"No rect found"),r}let ue;function St(){return ue===void 0&&(typeof matchMedia=="function"?ue=!!matchMedia("(pointer:coarse)").matches:ue=!1),ue}function Ye(e){const{element:t,orientation:n,panels:o,separators:r}=e,a=ge(n,Array.from(t.children).filter(Ve).map(m=>({element:m}))).map(({element:m})=>m),l=[];let s=!1,i=!1,u=-1,c=-1,h=0,d,S=[];{let m=-1;for(const f of a)f.hasAttribute("data-panel")&&(m++,f.hasAttribute("data-disabled")||(h++,u===-1&&(u=m),c=m))}if(h>1){let m=-1;for(const f of a)if(f.hasAttribute("data-panel")){m++;const g=o.find(p=>p.element===f);if(g){if(d){const p=d.element.getBoundingClientRect(),y=f.getBoundingClientRect();let z;if(i){const b=n==="horizontal"?new DOMRect(p.right,p.top,0,p.height):new DOMRect(p.left,p.bottom,p.width,0),v=n==="horizontal"?new DOMRect(y.left,y.top,0,y.height):new DOMRect(y.left,y.top,y.width,0);switch(S.length){case 0:{z=[b,v];break}case 1:{const R=S[0],E=zt({orientation:n,rects:[p,y],targetRect:R.element.getBoundingClientRect()});z=[R,E===p?v:b];break}default:{z=S;break}}}else S.length?z=S:z=[n==="horizontal"?new DOMRect(p.right,y.top,y.left-p.right,y.height):new DOMRect(y.left,p.bottom,y.width,y.top-p.bottom)];for(const b of z){let v="width"in b?b:b.element.getBoundingClientRect();const R=St()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(v.width<R){const M=R-v.width;v=new DOMRect(v.x-M/2,v.y,v.width+M,v.height)}if(v.height<R){const M=R-v.height;v=new DOMRect(v.x,v.y-M/2,v.width,v.height+M)}const E=m<=u||m>c;!s&&!E&&l.push({group:e,groupSize:te({group:e}),panels:[d,g],separator:"width"in b?void 0:b,rect:v}),s=!1}}i=!1,d=g,S=[]}}else if(f.hasAttribute("data-separator")){f.ariaDisabled!==null&&(s=!0);const g=r.find(p=>p.element===f);g?S.push(g):(d=void 0,S=[])}else i=!0}return l}class Xe{#e={};addListener(t,n){const o=this.#e[t];return o===void 0?this.#e[t]=[n]:o.includes(n)||o.push(n),()=>{this.removeListener(t,n)}}emit(t,n){const o=this.#e[t];if(o!==void 0)if(o.length===1)o[0].call(null,n);else{let r=!1,a=null;const l=Array.from(o);for(let s=0;s<l.length;s++){const i=l[s];try{i.call(null,n)}catch(u){a===null&&(r=!0,a=u)}}if(r)throw a}}removeAllListeners(){this.#e={}}removeListener(t,n){const o=this.#e[t];if(o!==void 0){const r=o.indexOf(n);r>=0&&o.splice(r,1)}}}let Q={cursorFlags:0,state:"inactive"};const me=new Xe;function U(){return Q}function wt(e){return me.addListener("change",e)}function xt(e){const t=Q,n={...Q};n.cursorFlags=e,Q=n,me.emit("change",{prev:t,next:n})}function ee(e){const t=Q;Q=e,me.emit("change",{prev:t,next:e})}const Ct=e=>e,pe=()=>{},_e=1,Je=2,qe=4,Ke=8,Le=3,Re=12;let ce;function Ee(){return ce===void 0&&(ce=!1,typeof window<"u"&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(ce=!0)),ce}function Pt({cursorFlags:e,groups:t,state:n}){let o=0,r=0;switch(n){case"active":case"hover":t.forEach(a=>{if(!a.mutableState.disableCursor)switch(a.orientation){case"horizontal":{o++;break}case"vertical":{r++;break}}})}if(!(o===0&&r===0)){switch(n){case"active":{if(e&&Ee()){const a=(e&_e)!==0,l=(e&Je)!==0,s=(e&qe)!==0,i=(e&Ke)!==0;if(a)return s?"se-resize":i?"ne-resize":"e-resize";if(l)return s?"sw-resize":i?"nw-resize":"w-resize";if(s)return"s-resize";if(i)return"n-resize"}break}}return Ee()?o>0&&r>0?"move":o>0?"ew-resize":"ns-resize":o>0&&r>0?"grab":o>0?"col-resize":"row-resize"}}const ke=new WeakMap;function be(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:t,styleSheet:n}=ke.get(e)??{};n===void 0&&(n=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&(Object.isExtensible(e.adoptedStyleSheets)?e.adoptedStyleSheets.push(n):e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]));const o=U();switch(o.state){case"active":case"hover":{const r=Pt({cursorFlags:o.cursorFlags,groups:o.hitRegions.map(l=>l.group),state:o.state}),a=`*, *:hover {cursor: ${r} !important; }`;if(t===a)return;t=a,r?n.cssRules.length===0?n.insertRule(a):n.replaceSync(a):n.cssRules.length===1&&n.deleteRule(0);break}case"inactive":{t=void 0,n.cssRules.length===1&&n.deleteRule(0);break}}ke.set(e,{prevStyle:t,styleSheet:n})}let F=new Map;const Ze=new Xe;function Lt(e){F=new Map(F),F.delete(e)}function Me(e,t){for(const[n]of F)if(n.id===e)return n}function H(e,t){for(const[n,o]of F)if(n.id===e)return o;if(t)throw Error(`Could not find data for Group with id ${e}`)}function _(){return F}function ye(e,t){return Ze.addListener("groupChange",n=>{n.group.id===e&&t(n)})}function W(e,t,n){const o=F.get(e);F=new Map(F),F.set(e,t),Ze.emit("groupChange",{group:e,isUserInteraction:n?.isUserInteraction===!0,prev:o,next:t})}function Qe(e){const t=U();let n=!1;return t.state==="active"&&(ee({cursorFlags:0,state:"inactive"}),t.hitRegions.length>0&&(be(e),n=!0,t.hitRegions.forEach(o=>{const r=H(o.group.id,!0);W(o.group,r,{isUserInteraction:!0})}))),n}function De(e){e.defaultPrevented||Qe(e.currentTarget)}function Rt(e,t,n){let o,r={x:1/0,y:1/0};for(const a of t){const l=Ue(n,a.rect);switch(e){case"horizontal":{l.x<=r.x&&(o=a,r=l);break}case"vertical":{l.y<=r.y&&(o=a,r=l);break}}}return o?{distance:r,hitRegion:o}:void 0}function Et(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function kt(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:Ne(e),b:Ne(t)};let o;for(;n.a.at(-1)===n.b.at(-1);)o=n.a.pop(),n.b.pop();P(o,"Stacking order can only be calculated for elements with a common ancestor");const r={a:Te(Ie(n.a)),b:Te(Ie(n.b))};if(r.a===r.b){const a=o.childNodes,l={a:n.a.at(-1),b:n.b.at(-1)};let s=a.length;for(;s--;){const i=a[s];if(i===l.a)return 1;if(i===l.b)return-1}}return Math.sign(r.a-r.b)}const Mt=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Dt(e){const t=getComputedStyle(et(e)??e).display;return t==="flex"||t==="inline-flex"}function It(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||Dt(e))||+t.opacity<1||"transform"in t&&t.transform!=="none"||"webkitTransform"in t&&t.webkitTransform!=="none"||"mixBlendMode"in t&&t.mixBlendMode!=="normal"||"filter"in t&&t.filter!=="none"||"webkitFilter"in t&&t.webkitFilter!=="none"||"isolation"in t&&t.isolation==="isolate"||Mt.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function Ie(e){let t=e.length;for(;t--;){const n=e[t];if(P(n,"Missing node"),It(n))return n}return null}function Te(e){return e&&Number(getComputedStyle(e).zIndex)||0}function Ne(e){const t=[];for(;e;)t.push(e),e=et(e);return t}function et(e){const{parentNode:t}=e;return Et(t)?t.host:t}function Tt(e,t){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function Nt({groupElement:e,hitRegion:t,pointerEventTarget:n}){if(!Ve(n)||n.contains(e)||e.contains(n))return!0;if(kt(n,e)>0){let o=n;for(;o;){if(o.contains(e))return!0;if(Tt(o.getBoundingClientRect(),t))return!1;o=o.parentElement}}return!0}function ze(e,t){const n=[];return t.forEach((o,r)=>{if(r.disabled)return;const a=Ye(r),l=Rt(r.orientation,a,{x:e.clientX,y:e.clientY});l&&l.distance.x<=0&&l.distance.y<=0&&Nt({groupElement:r.element,hitRegion:l.hitRegion.rect,pointerEventTarget:e.target})&&n.push(l.hitRegion)}),n}function jt(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function I(e,t,n=0){return Math.abs(T(e)-T(t))<=n}function O(e,t){return I(e,t)?0:e>t?1:-1}function Z({overrideDisabledPanels:e,panelConstraints:t,prevSize:n,size:o}){const{collapsedSize:r=0,collapsible:a,disabled:l,maxSize:s=100,minSize:i=0}=t;if(l&&!e)return n;if(O(o,i)<0)if(a){const u=(r+i)/2;O(o,u)<0?o=r:o=i}else o=i;return o=Math.min(s,o),o=T(o),o}function ie({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:o,prevLayout:r,trigger:a}){if(I(e,0))return t;const l=a==="imperative-api",s=Object.values(t),i=Object.values(r),u=[...s],[c,h]=o;P(c!=null,"Invalid first pivot index"),P(h!=null,"Invalid second pivot index");let d=0;switch(a){case"keyboard":{{const f=e<0?h:c,g=n[f];P(g,`Panel constraints not found for index ${f}`);const{collapsedSize:p=0,collapsible:y,minSize:z=0}=g;if(y){const b=s[f];if(P(b!=null,`Previous layout not found for panel index ${f}`),I(b,p)){const v=z-b;O(v,Math.abs(e))>0&&(e=e<0?0-v:v)}}}{const f=e<0?c:h,g=n[f];P(g,`No panel constraints found for index ${f}`);const{collapsedSize:p=0,collapsible:y,minSize:z=0}=g;if(y){const b=s[f];if(P(b!=null,`Previous layout not found for panel index ${f}`),I(b,z)){const v=b-p;O(v,Math.abs(e))>0&&(e=e<0?0-v:v)}}}break}default:{const f=e<0?h:c,g=n[f];P(g,`Panel constraints not found for index ${f}`);const p=s[f],{collapsible:y,collapsedSize:z,minSize:b}=g;if(y&&O(p,b)<0)if(e>0){const v=b-z,R=v/2,E=p+e;O(E,b)<0&&(e=O(e,R)<=0?0:v)}else{const v=b-z,R=100-v/2,E=p-e;O(E,b)<0&&(e=O(100+e,R)>0?0:-v)}break}}{const f=e<0?1:-1;let g=e<0?h:c,p=0;for(;;){const z=s[g];P(z!=null,`Previous layout not found for panel index ${g}`);const b=Z({overrideDisabledPanels:l,panelConstraints:n[g],prevSize:z,size:100})-z;if(p+=b,g+=f,g<0||g>=n.length)break}const y=Math.min(Math.abs(e),Math.abs(p));e=e<0?0-y:y}{let f=e<0?c:h;for(;f>=0&&f<n.length;){const g=Math.abs(e)-Math.abs(d),p=s[f];P(p!=null,`Previous layout not found for panel index ${f}`);const y=p-g,z=Z({overrideDisabledPanels:l,panelConstraints:n[f],prevSize:p,size:y});if(!I(p,z)&&(d+=p-z,u[f]=z,d.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?f--:f++}}if(jt(i,u))return r;{const f=e<0?h:c,g=s[f];P(g!=null,`Previous layout not found for panel index ${f}`);const p=g+d,y=Z({overrideDisabledPanels:l,panelConstraints:n[f],prevSize:g,size:p});if(u[f]=y,!I(y,p)){let z=p-y,b=e<0?h:c;for(;b>=0&&b<n.length;){const v=u[b];P(v!=null,`Previous layout not found for panel index ${b}`);const R=v+z,E=Z({overrideDisabledPanels:l,panelConstraints:n[b],prevSize:v,size:R});if(I(v,E)||(z-=E-v,u[b]=E),I(z,0))break;e>0?b--:b++}}}const S=Object.values(u).reduce((f,g)=>g+f,0);if(!I(S,100,.1))return r;const m=Object.keys(r);return u.reduce((f,g,p)=>(f[m[p]]=g,f),{})}function Y(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(t[n]===void 0||O(e[n],t[n])!==0)return!1;return!0}function X({layout:e,panelConstraints:t}){const n=Object.values(e),o=[...n],r=o.reduce((s,i)=>s+i,0);if(o.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${o.map(s=>`${s}%`).join(", ")}`);if(!I(r,100)&&o.length>0)for(let s=0;s<t.length;s++){const i=o[s];P(i!=null,`No layout data found for index ${s}`);const u=100/r*i;o[s]=u}let a=0;for(let s=0;s<t.length;s++){const i=n[s];P(i!=null,`No layout data found for index ${s}`);const u=o[s];P(u!=null,`No layout data found for index ${s}`);const c=Z({overrideDisabledPanels:!0,panelConstraints:t[s],prevSize:i,size:u});u!=c&&(a+=u-c,o[s]=c)}if(!I(a,0))for(let s=0;s<t.length;s++){const i=o[s];P(i!=null,`No layout data found for index ${s}`);const u=i+a,c=Z({overrideDisabledPanels:!0,panelConstraints:t[s],prevSize:i,size:u});if(i!==c&&(a-=c-i,o[s]=c,I(a,0)))break}const l=Object.keys(e);return o.reduce((s,i,u)=>(s[l[u]]=i,s),{})}function tt({groupId:e,panelId:t}){const n=()=>{const i=_();for(const[u,{defaultLayoutDeferred:c,derivedPanelConstraints:h,layout:d,groupSize:S,separatorToPanels:m}]of i)if(u.id===e)return{defaultLayoutDeferred:c,derivedPanelConstraints:h,group:u,groupSize:S,layout:d,separatorToPanels:m};throw Error(`Group ${e} not found`)},o=()=>{const i=n().derivedPanelConstraints.find(u=>u.panelId===t);if(i!==void 0)return i;throw Error(`Panel constraints not found for Panel ${t}`)},r=()=>{const i=n().group.panels.find(u=>u.id===t);if(i!==void 0)return i;throw Error(`Layout not found for Panel ${t}`)},a=()=>{const i=n().layout[t];if(i!==void 0)return i;throw Error(`Layout not found for Panel ${t}`)},l=({nextSize:i,panels:u,prevLayout:c,derivedPanelConstraints:h})=>{const d=a(),S=u.findIndex(g=>g.id===t),m=S===0,f=S===u.length-1;if(f&&i<d&&(m||u.slice(0,S).every((g,p)=>{const y=h[p];return y?.collapsible&&I(y.collapsedSize,c[y.panelId])}))){const g=u.slice(0,S).reduce((p,y)=>p+c[y.id],0);return{...c,[t]:T(100-g)}}return ie({delta:f?d-i:i-d,initialLayout:c,panelConstraints:h,pivotIndices:f?[S-1,S]:[S,S+1],prevLayout:c,trigger:"imperative-api"})},s=i=>{const u=a();if(i===u)return;const{defaultLayoutDeferred:c,derivedPanelConstraints:h,group:d,groupSize:S,layout:m,separatorToPanels:f}=n(),g=l({nextSize:i,panels:d.panels,prevLayout:m,derivedPanelConstraints:h}),p=X({layout:g,panelConstraints:h});Y(m,p)||W(d,{defaultLayoutDeferred:c,derivedPanelConstraints:h,groupSize:S,layout:p,separatorToPanels:f})};return{collapse:()=>{const{collapsible:i,collapsedSize:u}=o(),{mutableValues:c}=r(),h=a();i&&h!==u&&(c.expandToSize=h,s(u))},expand:()=>{const{collapsible:i,collapsedSize:u,minSize:c}=o(),{mutableValues:h}=r(),d=a();if(i&&d===u){let S=h.expandToSize??c;S===0&&(S=1),s(S)}},getSize:()=>{const{group:i}=n(),u=a(),{element:c}=r(),h=i.orientation==="horizontal"?c.offsetWidth:c.offsetHeight;return{asPercentage:u,inPixels:h}},isCollapsed:()=>{const{collapsible:i,collapsedSize:u}=o(),c=a();return i&&I(u,c)},resize:i=>{const{group:u}=n(),{element:c}=r(),h=te({group:u}),d=re({groupSize:h,panelElement:c,styleProp:i}),S=T(d/h*100);s(S)}}}function je(e){if(e.defaultPrevented)return;const t=_();ze(e,t).forEach(n=>{if(n.separator&&!n.separator.disableDoubleClick){const o=n.panels.find(r=>r.panelConstraints.defaultSize!==void 0);if(o){const r=o.panelConstraints.defaultSize,a=tt({groupId:n.group.id,panelId:o.id});a&&r!==void 0&&(a.resize(r),e.preventDefault())}}})}function de(e){const t=_();for(const[n]of t)if(n.separators.some(o=>o.element===e))return n;throw Error("Could not find parent Group for separator element")}function nt({groupId:e}){const t=()=>{const n=_();for(const[o,r]of n)if(o.id===e)return{group:o,...r};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){const{defaultLayoutDeferred:n,layout:o}=t();return n?{}:o},setLayout(n){const{defaultLayoutDeferred:o,derivedPanelConstraints:r,group:a,groupSize:l,layout:s,separatorToPanels:i}=t(),u=X({layout:n,panelConstraints:r});return o?s:(Y(s,u)||W(a,{defaultLayoutDeferred:o,derivedPanelConstraints:r,groupSize:l,layout:u,separatorToPanels:i}),u)}}}function V(e,t){const n=de(e),o=H(n.id,!0),r=n.separators.find(c=>c.element===e);P(r,"Matching separator not found");const a=o.separatorToPanels.get(r);P(a,"Matching panels not found");const l=a.map(c=>n.panels.indexOf(c)),s=nt({groupId:n.id}).getLayout(),i=ie({delta:t,initialLayout:s,panelConstraints:o.derivedPanelConstraints,pivotIndices:l,prevLayout:s,trigger:"keyboard"}),u=X({layout:i,panelConstraints:o.derivedPanelConstraints});Y(s,u)||W(n,{defaultLayoutDeferred:o.defaultLayoutDeferred,derivedPanelConstraints:o.derivedPanelConstraints,groupSize:o.groupSize,layout:u,separatorToPanels:o.separatorToPanels},{isUserInteraction:!0})}function Oe(e){if(e.defaultPrevented)return;const t=e.currentTarget,n=de(t);if(!n.disabled)switch(e.key){case"ArrowDown":{e.preventDefault(),n.orientation==="vertical"&&V(t,5);break}case"ArrowLeft":{e.preventDefault(),n.orientation==="horizontal"&&V(t,-5);break}case"ArrowRight":{e.preventDefault(),n.orientation==="horizontal"&&V(t,5);break}case"ArrowUp":{e.preventDefault(),n.orientation==="vertical"&&V(t,-5);break}case"End":{e.preventDefault(),V(t,100);break}case"Enter":{e.preventDefault();const o=de(t),r=H(o.id,!0),{derivedPanelConstraints:a,layout:l,separatorToPanels:s}=r,i=o.separators.find(d=>d.element===t);P(i,"Matching separator not found");const u=s.get(i);P(u,"Matching panels not found");const c=u[0],h=a.find(d=>d.panelId===c.id);if(P(h,"Panel metadata not found"),h.collapsible){const d=l[c.id],S=h.collapsedSize===d?o.mutableState.expandedPanelSizes[c.id]??h.minSize:h.collapsedSize;V(t,S-d)}break}case"F6":{e.preventDefault();const o=de(t).separators.map(l=>l.element),r=Array.from(o).findIndex(l=>l===e.currentTarget);P(r!==null,"Index not found");const a=e.shiftKey?r>0?r-1:o.length-1:r+1<o.length?r+1:0;o[a].focus({preventScroll:!0});break}case"Home":{e.preventDefault(),V(t,-100);break}}}function Fe(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const t=_(),n=ze(e,t),o=new Map;let r=!1;n.forEach(a=>{a.separator&&(r||(r=!0,a.separator.element.focus({focusVisible:!1,preventScroll:!0})));const l=t.get(a.group);l&&o.set(a.group,l.layout)}),ee({cursorFlags:0,hitRegions:n,initialLayoutMap:o,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:"active"}),n.length&&e.preventDefault()}function ot({document:e,event:t,hitRegions:n,initialLayoutMap:o,mountedGroups:r,pointerDownAtPoint:a,prevCursorFlags:l}){let s=0;n.forEach(u=>{const{group:c,groupSize:h}=u,{orientation:d,panels:S}=c,{disableCursor:m}=c.mutableState;let f=0;a?d==="horizontal"?f=(t.clientX-a.x)/h*100:f=(t.clientY-a.y)/h*100:d==="horizontal"?f=t.clientX<0?-100:100:f=t.clientY<0?-100:100;const g=o.get(c),p=r.get(c);if(!g||!p)return;const{defaultLayoutDeferred:y,derivedPanelConstraints:z,groupSize:b,layout:v,separatorToPanels:R}=p;if(z&&v&&R){const E=ie({delta:f,initialLayout:g,panelConstraints:z,pivotIndices:u.panels.map(M=>S.indexOf(M)),prevLayout:v,trigger:"mouse-or-touch"});if(Y(E,v)){if(f!==0&&!m)switch(d){case"horizontal":{s|=f<0?_e:Je;break}case"vertical":{s|=f<0?qe:Ke;break}}}else W(u.group,{defaultLayoutDeferred:y,derivedPanelConstraints:z,groupSize:b,layout:E,separatorToPanels:R})}});let i=0;t.movementX===0?i|=l&Le:i|=s&Le,t.movementY===0?i|=l&Re:i|=s&Re,xt(i),be(e)}function Ae(e){const t=_(),n=U();n.state==="active"&&ot({document:e.currentTarget,event:e,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:t,prevCursorFlags:n.cursorFlags})}function Ge(e){if(e.defaultPrevented)return;const t=U(),n=_();switch(t.state){case"active":{if(e.buttons===0){ee({cursorFlags:0,state:"inactive"}),t.hitRegions.forEach(o=>{const r=H(o.group.id,!0);W(o.group,r,{isUserInteraction:!0})});return}for(const o of t.hitRegions)if(o.separator){const{element:r}=o.separator;r.hasPointerCapture?.(e.pointerId)||r.setPointerCapture?.(e.pointerId)}ot({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break}default:{const o=ze(e,n);o.length===0?t.state!=="inactive"&&ee({cursorFlags:0,state:"inactive"}):ee({cursorFlags:0,hitRegions:o,state:"hover"}),be(e.currentTarget);break}}}function $e(e){e.relatedTarget instanceof HTMLIFrameElement&&U().state==="hover"&&ee({cursorFlags:0,state:"inactive"})}function Be(e){e.defaultPrevented||e.pointerType==="mouse"&&e.button>0||Qe(e.currentTarget)&&e.preventDefault()}function We(e){let t=0,n=0;const o={};for(const a of e)if(a.defaultSize!==void 0){t++;const l=T(a.defaultSize);n+=l,o[a.panelId]=l}else o[a.panelId]=void 0;const r=e.length-t;if(r!==0){const a=T((100-n)/r);for(const l of e)l.defaultSize===void 0&&(o[l.panelId]=a)}return o}function Ot(e,t,n){if(!n[0])return;const o=e.panels.find(i=>i.element===t);if(!o||!o.onResize)return;const r=te({group:e}),a=e.orientation==="horizontal"?o.element.offsetWidth:o.element.offsetHeight,l=o.mutableValues.prevSize,s={asPercentage:T(a/r*100),inPixels:a};o.mutableValues.prevSize=s,o.onResize(s,o.id,l)}function Ft(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function At({group:e,nextGroupSize:t,prevGroupSize:n,prevLayout:o}){if(n<=0||t<=0||n===t)return o;let r=0,a=0,l=!1;const s=new Map,i=[];for(const h of e.panels){const d=o[h.id]??0;if(h.panelConstraints.groupResizeBehavior==="preserve-pixel-size"){l=!0;const S=d/100*n,m=T(S/t*100);s.set(h.id,m),r+=m}else i.push(h.id),a+=d}if(!l||i.length===0)return o;const u=100-r,c={...o};if(s.forEach((h,d)=>{c[d]=h}),a>0)for(const h of i){const d=o[h]??0;c[h]=T(d/a*u)}else{const h=T(u/i.length);for(const d of i)c[d]=h}return c}function Gt(e,t){const n=e.map(r=>r.id),o=Object.keys(t);if(n.length!==o.length)return!1;for(const r of n)if(!o.includes(r))return!1;return!0}const K=new Map;function $t(e){let t=!0;P(e.element.ownerDocument.defaultView,"Cannot register an unmounted Group");const n=e.element.ownerDocument.defaultView.ResizeObserver,o=new Set,r=new Set,a=new n(m=>{for(const f of m){const{borderBoxSize:g,target:p}=f;if(p===e.element){if(t){const y=te({group:e});if(y===0)return;const z=H(e.id);if(!z)return;const b=he(e),v=z.defaultLayoutDeferred?We(b):z.layout,R=At({group:e,nextGroupSize:y,prevGroupSize:z.groupSize,prevLayout:v}),E=X({layout:R,panelConstraints:b});if(!z.defaultLayoutDeferred&&Y(z.layout,E)&&Ft(z.derivedPanelConstraints,b)&&z.groupSize===y)return;W(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:b,groupSize:y,layout:E,separatorToPanels:z.separatorToPanels})}}else Ot(e,p,g)}});a.observe(e.element),e.panels.forEach(m=>{P(!o.has(m.id),`Panel ids must be unique; id "${m.id}" was used more than once`),o.add(m.id),m.onResize&&a.observe(m.element)});const l=te({group:e}),s=he(e),i=e.panels.map(({id:m})=>m).join(",");let u=e.mutableState.defaultLayout;u&&(Gt(e.panels,u)||(u=void 0));const c=e.mutableState.layouts[i]??u??We(s),h=X({layout:c,panelConstraints:s}),d=e.element.ownerDocument;K.set(d,(K.get(d)??0)+1);const S=new Map;return Ye(e).forEach(m=>{m.separator&&S.set(m.separator,m.panels)}),W(e,{defaultLayoutDeferred:l===0,derivedPanelConstraints:s,groupSize:l,layout:h,separatorToPanels:S}),e.separators.forEach(m=>{P(!r.has(m.id),`Separator ids must be unique; id "${m.id}" was used more than once`),r.add(m.id),m.element.addEventListener("keydown",Oe)}),K.get(d)===1&&(d.addEventListener("contextmenu",De,!0),d.addEventListener("dblclick",je,!0),d.addEventListener("pointerdown",Fe,!0),d.addEventListener("pointerleave",Ae),d.addEventListener("pointermove",Ge),d.addEventListener("pointerout",$e),d.addEventListener("pointerup",Be,!0)),function(){t=!1,K.set(d,Math.max(0,(K.get(d)??0)-1)),Lt(e),e.separators.forEach(m=>{m.element.removeEventListener("keydown",Oe)}),K.get(d)||(d.removeEventListener("contextmenu",De,!0),d.removeEventListener("dblclick",je,!0),d.removeEventListener("pointerdown",Fe,!0),d.removeEventListener("pointerleave",Ae),d.removeEventListener("pointermove",Ge),d.removeEventListener("pointerout",$e),d.removeEventListener("pointerup",Be,!0)),a.disconnect()}}function Bt(){const[e,t]=L.useState({}),n=L.useCallback(()=>t({}),[]);return[e,n]}function Se(e){const t=L.useId();return`${e??t}`}const J=typeof window<"u"?L.useLayoutEffect:L.useEffect;function ae(e){const t=L.useRef(e);return J(()=>{t.current=e},[e]),L.useCallback((...n)=>t.current?.(...n),[t])}function we(...e){return ae(t=>{e.forEach(n=>{if(n)switch(typeof n){case"function":{n(t);break}case"object":{n.current=t;break}}})})}function xe(e){const t=L.useRef({...e});return J(()=>{for(const n in e)t.current[n]=e[n]},[e]),t.current}const rt=L.createContext(null);function Wt(e,t){const n=L.useRef({getLayout:()=>({}),setLayout:Ct});L.useImperativeHandle(t,()=>n.current,[]),J(()=>{Object.assign(n.current,nt({groupId:e}))})}function at({children:e,className:t,defaultLayout:n,disableCursor:o,disabled:r,elementRef:a,groupRef:l,id:s,onLayoutChange:i,onLayoutChanged:u,orientation:c="horizontal",resizeTargetMinimumSize:h={coarse:20,fine:10},style:d,...S}){const m=L.useRef({onLayoutChange:{},onLayoutChanged:{}}),f=ae(w=>{Y(m.current.onLayoutChange,w)||(m.current.onLayoutChange=w,i?.(w))}),g=ae((w,x)=>{Y(m.current.onLayoutChanged,w)||(m.current.onLayoutChanged=w,u?.(w,{isUserInteraction:x}))}),p=Se(s),y=L.useRef(null),[z,b]=Bt(),v=L.useRef({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:h,separators:[]}),R=we(y,a);Wt(p,l);const E=ae((w,x)=>{const k=U(),C=Me(w),D=H(w);if(D){let N=!1;return k.state==="active"&&(N=k.hitRegions.some(ne=>ne.group===C)),{flexGrow:D.layout[x]??1,pointerEvents:N?"none":void 0}}if(n?.[x])return{flexGrow:n?.[x]}}),M=xe({defaultLayout:n,disableCursor:o}),j=L.useMemo(()=>({get disableCursor(){return!!M.disableCursor},getPanelStyles:E,id:p,orientation:c,registerPanel:w=>{const x=v.current;return x.panels=ge(c,[...x.panels,w]),b(),()=>{x.panels=x.panels.filter(k=>k!==w),b()}},registerSeparator:w=>{const x=v.current;return x.separators=ge(c,[...x.separators,w]),b(),()=>{x.separators=x.separators.filter(k=>k!==w),b()}},updatePanelProps:(w,{disabled:x})=>{const k=v.current.panels.find(N=>N.id===w);k&&(k.panelConstraints.disabled=x);const C=Me(p),D=H(p);C&&D&&W(C,{...D,derivedPanelConstraints:he(C)})},updateSeparatorProps:(w,{disabled:x,disableDoubleClick:k})=>{const C=v.current.separators.find(D=>D.id===w);C&&(C.disabled=x,C.disableDoubleClick=k)}}),[E,p,b,c,M]),G=L.useRef(null);return J(()=>{const w=y.current;if(w===null)return;const x=v.current;let k;if(M.defaultLayout!==void 0&&Object.keys(M.defaultLayout).length===x.panels.length){k={};for(const $ of x.panels){const q=M.defaultLayout[$.id];q!==void 0&&(k[$.id]=q)}}const C={disabled:!!r,element:w,id:p,mutableState:{defaultLayout:k,disableCursor:!!M.disableCursor,expandedPanelSizes:v.current.lastExpandedPanelSizes,layouts:v.current.layouts},orientation:c,panels:x.panels,resizeTargetMinimumSize:x.resizeTargetMinimumSize,separators:x.separators};G.current=C;const D=$t(C),{defaultLayoutDeferred:N,derivedPanelConstraints:ne,layout:se}=H(C.id,!0);!N&&ne.length>0&&(f(se),g(se,!1));const oe=ye(p,$=>{const{defaultLayoutDeferred:q,derivedPanelConstraints:Pe,layout:le}=$.next;if(q||Pe.length===0)return;const lt=C.panels.map(({id:B})=>B).join(",");C.mutableState.layouts[lt]=le,Pe.forEach(B=>{if(B.collapsible){const{layout:fe}=$.prev??{};if(fe){const ct=I(B.collapsedSize,le[B.panelId]),dt=I(B.collapsedSize,fe[B.panelId]);ct&&!dt&&(C.mutableState.expandedPanelSizes[B.panelId]=fe[B.panelId])}}});const ut=U().state!=="active";f(le),ut&&g(le,$.isUserInteraction)});return()=>{G.current=null,D(),oe()}},[r,p,g,f,c,z,M]),L.useEffect(()=>{const w=G.current;w&&(w.mutableState.defaultLayout=n,w.mutableState.disableCursor=!!o)}),A.jsx(rt.Provider,{value:j,children:A.jsx("div",{...S,className:t,"data-group":!0,"data-testid":p,id:p,ref:R,style:{height:"100%",width:"100%",overflow:"hidden",...d,display:"flex",flexDirection:c==="horizontal"?"row":"column",flexWrap:"nowrap",touchAction:c==="horizontal"?"pan-y":"pan-x"},children:e})})}at.displayName="Group";function Ce(){const e=L.useContext(rt);return P(e,"Group Context not found; did you render a Panel or Separator outside of a Group?"),e}function Ht(e,t){const{id:n}=Ce(),o=L.useRef({collapse:pe,expand:pe,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:pe});L.useImperativeHandle(t,()=>o.current,[]),J(()=>{Object.assign(o.current,tt({groupId:n,panelId:e}))})}function it({children:e,className:t,collapsedSize:n="0%",collapsible:o=!1,defaultSize:r,disabled:a,elementRef:l,groupResizeBehavior:s="preserve-relative-size",id:i,maxSize:u="100%",minSize:c="0%",onResize:h,panelRef:d,style:S,...m}){const f=!!i,g=Se(i),p=xe({disabled:a}),y=L.useRef(null),z=we(y,l),{getPanelStyles:b,id:v,orientation:R,registerPanel:E,updatePanelProps:M}=Ce(),j=h!==null,G=ae((C,D,N)=>{h?.(C,i,N)});J(()=>{const C=y.current;if(C!==null){const D={element:C,id:g,idIsStable:f,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:j?G:void 0,panelConstraints:{groupResizeBehavior:s,collapsedSize:n,collapsible:o,defaultSize:r,disabled:p.disabled,maxSize:u,minSize:c}};return E(D)}},[s,n,o,r,j,g,f,u,c,G,E,p]),L.useEffect(()=>{M(g,{disabled:a})},[a,g,M]),Ht(g,d);const w=()=>{const C=b(v,g);if(C)return JSON.stringify(C)},x=L.useSyncExternalStore(C=>ye(v,C),w,w);let k;return x?k=JSON.parse(x):r!==void 0?k={flexGrow:void 0,flexShrink:void 0,flexBasis:r}:k={flexGrow:1},A.jsx("div",{...m,"data-disabled":a||void 0,"data-panel":!0,"data-testid":g,id:g,ref:z,style:{...Vt,display:"flex",flexBasis:0,flexShrink:1,overflow:"visible",...k},children:A.jsx("div",{className:t,style:{maxHeight:"100%",maxWidth:"100%",flexGrow:1,overflow:"auto",...S,touchAction:R==="horizontal"?"pan-y":"pan-x"},children:e})})}it.displayName="Panel";const Vt={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function Ut({layout:e,panelConstraints:t,panelId:n,panelIndex:o}){let r,a;const l=e[n],s=t.find(i=>i.panelId===n);if(s){const i=s.maxSize,u=s.collapsible?s.collapsedSize:s.minSize,c=[o,o+1];a=X({layout:ie({delta:u-l,initialLayout:e,panelConstraints:t,pivotIndices:c,prevLayout:e}),panelConstraints:t})[n],r=X({layout:ie({delta:i-l,initialLayout:e,panelConstraints:t,pivotIndices:c,prevLayout:e}),panelConstraints:t})[n]}return{valueControls:n,valueMax:r,valueMin:a,valueNow:l}}function st({children:e,className:t,disabled:n,disableDoubleClick:o,elementRef:r,id:a,style:l,...s}){const i=Se(a),u=xe({disabled:n,disableDoubleClick:o}),[c,h]=L.useState({}),[d,S]=L.useState("inactive"),[m,f]=L.useState(!1),g=L.useRef(null),p=we(g,r),{disableCursor:y,id:z,orientation:b,registerSeparator:v,updateSeparatorProps:R}=Ce(),E=b==="horizontal"?"vertical":"horizontal";J(()=>{const G=g.current;if(G!==null){const w={disabled:u.disabled,disableDoubleClick:u.disableDoubleClick,element:G,id:i},x=v(w),k=wt(D=>{S(D.next.state!=="inactive"&&D.next.hitRegions.some(N=>N.separator===w)?D.next.state:"inactive")}),C=ye(z,D=>{const{derivedPanelConstraints:N,layout:ne,separatorToPanels:se}=D.next,oe=se.get(w);if(oe){const $=oe[0],q=oe.indexOf($);h(Ut({layout:ne,panelConstraints:N,panelId:$.id,panelIndex:q}))}});return()=>{k(),C(),x()}}},[z,i,v,u]),L.useEffect(()=>{R(i,{disabled:n,disableDoubleClick:o})},[n,o,i,R]);let M;n&&!y&&(M="not-allowed");let j;return n?j="disabled":d==="active"?j="active":m?j="focus":j=d,A.jsx("div",{...s,"aria-controls":c.valueControls,"aria-disabled":n||void 0,"aria-orientation":E,"aria-valuemax":c.valueMax,"aria-valuemin":c.valueMin,"aria-valuenow":c.valueNow,children:e,className:t,"data-separator":j,"data-testid":i,id:i,onBlur:()=>f(!1),onFocus:()=>f(!0),ref:p,role:"separator",style:{flexBasis:"auto",cursor:M,...l,flexGrow:0,flexShrink:0,touchAction:"none"},tabIndex:n?void 0:0})}st.displayName="Separator";function _t(e){const t=ve.c(10);let n,o,r;t[0]!==e?({className:n,ref:r,...o}=e,t[0]=e,t[1]=n,t[2]=o,t[3]=r):(n=t[1],o=t[2],r=t[3]);let a;t[4]!==n?(a=He("flex h-full w-full",n),t[4]=n,t[5]=a):a=t[5];let l;return t[6]!==o||t[7]!==r||t[8]!==a?(l=A.jsx(at,{groupRef:r,"data-slot":"resizable-panel-group",className:a,...o}),t[6]=o,t[7]=r,t[8]=a,t[9]=l):l=t[9],l}function Jt(e){const t=ve.c(10);let n,o,r;t[0]!==e?({ref:o,style:r,...n}=e,t[0]=e,t[1]=n,t[2]=o,t[3]=r):(n=t[1],o=t[2],r=t[3]);let a;t[4]!==r?(a={overflow:"hidden",...r},t[4]=r,t[5]=a):a=t[5];let l;return t[6]!==n||t[7]!==o||t[8]!==a?(l=A.jsx(it,{panelRef:o,"data-slot":"resizable-panel",style:a,...n}),t[6]=n,t[7]=o,t[8]=a,t[9]=l):l=t[9],l}function qt(e){const t=ve.c(12);let n,o,r;t[0]!==e?({withHandle:r,className:n,...o}=e,t[0]=e,t[1]=n,t[2]=o,t[3]=r):(n=t[1],o=t[2],r=t[3]);let a;t[4]!==n?(a=He("bg-border focus-visible:ring-ring relative flex w-[0.5px] items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:-translate-y-1/2 aria-[orientation=horizontal]:after:translate-x-0 [&[aria-orientation=horizontal]>div]:rotate-90",n),t[4]=n,t[5]=a):a=t[5];let l;t[6]!==r?(l=r&&A.jsx("div",{className:"bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border",children:A.jsx(ft,{className:"size-2.5"})}),t[6]=r,t[7]=l):l=t[7];let s;return t[8]!==o||t[9]!==a||t[10]!==l?(s=A.jsx(st,{"data-slot":"resizable-handle",className:a,...o,children:l}),t[8]=o,t[9]=a,t[10]=l,t[11]=s):s=t[11],s}export{_t as R,Jt as a,qt as b};
1
+ import{r as L,j as A,c as ve,l as He}from"./index-Yd3WEM80.js";import{a2 as ft}from"./agent-icon-evl-xYsS.js";function pt(e,t){const n=getComputedStyle(e),o=parseFloat(n.fontSize);return t*o}function ht(e,t){const n=getComputedStyle(e.ownerDocument.documentElement),o=parseFloat(n.fontSize);return t*o}function gt(e){return e/100*window.innerHeight}function vt(e){return e/100*window.innerWidth}function mt(e){switch(typeof e){case"number":return[e,"px"];case"string":{const t=parseFloat(e);return e.endsWith("%")?[t,"%"]:e.endsWith("px")?[t,"px"]:e.endsWith("rem")?[t,"rem"]:e.endsWith("em")?[t,"em"]:e.endsWith("vh")?[t,"vh"]:e.endsWith("vw")?[t,"vw"]:[t,"%"]}}}function re({groupSize:e,panelElement:t,styleProp:n}){let o;const[r,a]=mt(n);switch(a){case"%":{o=r/100*e;break}case"px":{o=r;break}case"rem":{o=ht(t,r);break}case"em":{o=pt(t,r);break}case"vh":{o=gt(r);break}case"vw":{o=vt(r);break}}return o}function T(e){return parseFloat(e.toFixed(3))}function te({group:e}){const{orientation:t,panels:n}=e;return n.reduce((o,r)=>(o+=t==="horizontal"?r.element.offsetWidth:r.element.offsetHeight,o),0)}function he(e){const{panels:t}=e,n=te({group:e});return n===0?t.map(o=>({groupResizeBehavior:o.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:o.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:o.panelConstraints.disabled,minSize:0,maxSize:100,panelId:o.id})):t.map(o=>{const{element:r,panelConstraints:a}=o;let l=0;if(a.collapsedSize!==void 0){const c=re({groupSize:n,panelElement:r,styleProp:a.collapsedSize});l=T(c/n*100)}let s;if(a.defaultSize!==void 0){const c=re({groupSize:n,panelElement:r,styleProp:a.defaultSize});s=T(c/n*100)}let i=0;if(a.minSize!==void 0){const c=re({groupSize:n,panelElement:r,styleProp:a.minSize});i=T(c/n*100)}let u=100;if(a.maxSize!==void 0){const c=re({groupSize:n,panelElement:r,styleProp:a.maxSize});u=T(c/n*100)}return{groupResizeBehavior:a.groupResizeBehavior,collapsedSize:l,collapsible:a.collapsible===!0,defaultSize:s,disabled:a.disabled,minSize:i,maxSize:u,panelId:o.id}})}function P(e,t="Assertion error"){if(!e)throw Error(t)}function ge(e,t){return Array.from(t).sort(e==="horizontal"?bt:yt)}function bt(e,t){const n=e.element.offsetLeft-t.element.offsetLeft;return n!==0?n:e.element.offsetWidth-t.element.offsetWidth}function yt(e,t){const n=e.element.offsetTop-t.element.offsetTop;return n!==0?n:e.element.offsetHeight-t.element.offsetHeight}function Ve(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function Ue(e,t){return{x:e.x>=t.left&&e.x<=t.right?0:Math.min(Math.abs(e.x-t.left),Math.abs(e.x-t.right)),y:e.y>=t.top&&e.y<=t.bottom?0:Math.min(Math.abs(e.y-t.top),Math.abs(e.y-t.bottom))}}function zt({orientation:e,rects:t,targetRect:n}){const o={x:n.x+n.width/2,y:n.y+n.height/2};let r,a=Number.MAX_VALUE;for(const l of t){const{x:s,y:i}=Ue(o,l),u=e==="horizontal"?s:i;u<a&&(a=u,r=l)}return P(r,"No rect found"),r}let ue;function St(){return ue===void 0&&(typeof matchMedia=="function"?ue=!!matchMedia("(pointer:coarse)").matches:ue=!1),ue}function Ye(e){const{element:t,orientation:n,panels:o,separators:r}=e,a=ge(n,Array.from(t.children).filter(Ve).map(m=>({element:m}))).map(({element:m})=>m),l=[];let s=!1,i=!1,u=-1,c=-1,h=0,d,S=[];{let m=-1;for(const f of a)f.hasAttribute("data-panel")&&(m++,f.hasAttribute("data-disabled")||(h++,u===-1&&(u=m),c=m))}if(h>1){let m=-1;for(const f of a)if(f.hasAttribute("data-panel")){m++;const g=o.find(p=>p.element===f);if(g){if(d){const p=d.element.getBoundingClientRect(),y=f.getBoundingClientRect();let z;if(i){const b=n==="horizontal"?new DOMRect(p.right,p.top,0,p.height):new DOMRect(p.left,p.bottom,p.width,0),v=n==="horizontal"?new DOMRect(y.left,y.top,0,y.height):new DOMRect(y.left,y.top,y.width,0);switch(S.length){case 0:{z=[b,v];break}case 1:{const R=S[0],E=zt({orientation:n,rects:[p,y],targetRect:R.element.getBoundingClientRect()});z=[R,E===p?v:b];break}default:{z=S;break}}}else S.length?z=S:z=[n==="horizontal"?new DOMRect(p.right,y.top,y.left-p.right,y.height):new DOMRect(y.left,p.bottom,y.width,y.top-p.bottom)];for(const b of z){let v="width"in b?b:b.element.getBoundingClientRect();const R=St()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(v.width<R){const M=R-v.width;v=new DOMRect(v.x-M/2,v.y,v.width+M,v.height)}if(v.height<R){const M=R-v.height;v=new DOMRect(v.x,v.y-M/2,v.width,v.height+M)}const E=m<=u||m>c;!s&&!E&&l.push({group:e,groupSize:te({group:e}),panels:[d,g],separator:"width"in b?void 0:b,rect:v}),s=!1}}i=!1,d=g,S=[]}}else if(f.hasAttribute("data-separator")){f.ariaDisabled!==null&&(s=!0);const g=r.find(p=>p.element===f);g?S.push(g):(d=void 0,S=[])}else i=!0}return l}class Xe{#e={};addListener(t,n){const o=this.#e[t];return o===void 0?this.#e[t]=[n]:o.includes(n)||o.push(n),()=>{this.removeListener(t,n)}}emit(t,n){const o=this.#e[t];if(o!==void 0)if(o.length===1)o[0].call(null,n);else{let r=!1,a=null;const l=Array.from(o);for(let s=0;s<l.length;s++){const i=l[s];try{i.call(null,n)}catch(u){a===null&&(r=!0,a=u)}}if(r)throw a}}removeAllListeners(){this.#e={}}removeListener(t,n){const o=this.#e[t];if(o!==void 0){const r=o.indexOf(n);r>=0&&o.splice(r,1)}}}let Q={cursorFlags:0,state:"inactive"};const me=new Xe;function U(){return Q}function wt(e){return me.addListener("change",e)}function xt(e){const t=Q,n={...Q};n.cursorFlags=e,Q=n,me.emit("change",{prev:t,next:n})}function ee(e){const t=Q;Q=e,me.emit("change",{prev:t,next:e})}const Ct=e=>e,pe=()=>{},_e=1,Je=2,qe=4,Ke=8,Le=3,Re=12;let ce;function Ee(){return ce===void 0&&(ce=!1,typeof window<"u"&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(ce=!0)),ce}function Pt({cursorFlags:e,groups:t,state:n}){let o=0,r=0;switch(n){case"active":case"hover":t.forEach(a=>{if(!a.mutableState.disableCursor)switch(a.orientation){case"horizontal":{o++;break}case"vertical":{r++;break}}})}if(!(o===0&&r===0)){switch(n){case"active":{if(e&&Ee()){const a=(e&_e)!==0,l=(e&Je)!==0,s=(e&qe)!==0,i=(e&Ke)!==0;if(a)return s?"se-resize":i?"ne-resize":"e-resize";if(l)return s?"sw-resize":i?"nw-resize":"w-resize";if(s)return"s-resize";if(i)return"n-resize"}break}}return Ee()?o>0&&r>0?"move":o>0?"ew-resize":"ns-resize":o>0&&r>0?"grab":o>0?"col-resize":"row-resize"}}const ke=new WeakMap;function be(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:t,styleSheet:n}=ke.get(e)??{};n===void 0&&(n=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&(Object.isExtensible(e.adoptedStyleSheets)?e.adoptedStyleSheets.push(n):e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]));const o=U();switch(o.state){case"active":case"hover":{const r=Pt({cursorFlags:o.cursorFlags,groups:o.hitRegions.map(l=>l.group),state:o.state}),a=`*, *:hover {cursor: ${r} !important; }`;if(t===a)return;t=a,r?n.cssRules.length===0?n.insertRule(a):n.replaceSync(a):n.cssRules.length===1&&n.deleteRule(0);break}case"inactive":{t=void 0,n.cssRules.length===1&&n.deleteRule(0);break}}ke.set(e,{prevStyle:t,styleSheet:n})}let F=new Map;const Ze=new Xe;function Lt(e){F=new Map(F),F.delete(e)}function Me(e,t){for(const[n]of F)if(n.id===e)return n}function H(e,t){for(const[n,o]of F)if(n.id===e)return o;if(t)throw Error(`Could not find data for Group with id ${e}`)}function _(){return F}function ye(e,t){return Ze.addListener("groupChange",n=>{n.group.id===e&&t(n)})}function W(e,t,n){const o=F.get(e);F=new Map(F),F.set(e,t),Ze.emit("groupChange",{group:e,isUserInteraction:n?.isUserInteraction===!0,prev:o,next:t})}function Qe(e){const t=U();let n=!1;return t.state==="active"&&(ee({cursorFlags:0,state:"inactive"}),t.hitRegions.length>0&&(be(e),n=!0,t.hitRegions.forEach(o=>{const r=H(o.group.id,!0);W(o.group,r,{isUserInteraction:!0})}))),n}function De(e){e.defaultPrevented||Qe(e.currentTarget)}function Rt(e,t,n){let o,r={x:1/0,y:1/0};for(const a of t){const l=Ue(n,a.rect);switch(e){case"horizontal":{l.x<=r.x&&(o=a,r=l);break}case"vertical":{l.y<=r.y&&(o=a,r=l);break}}}return o?{distance:r,hitRegion:o}:void 0}function Et(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function kt(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:Ne(e),b:Ne(t)};let o;for(;n.a.at(-1)===n.b.at(-1);)o=n.a.pop(),n.b.pop();P(o,"Stacking order can only be calculated for elements with a common ancestor");const r={a:Te(Ie(n.a)),b:Te(Ie(n.b))};if(r.a===r.b){const a=o.childNodes,l={a:n.a.at(-1),b:n.b.at(-1)};let s=a.length;for(;s--;){const i=a[s];if(i===l.a)return 1;if(i===l.b)return-1}}return Math.sign(r.a-r.b)}const Mt=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Dt(e){const t=getComputedStyle(et(e)??e).display;return t==="flex"||t==="inline-flex"}function It(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||Dt(e))||+t.opacity<1||"transform"in t&&t.transform!=="none"||"webkitTransform"in t&&t.webkitTransform!=="none"||"mixBlendMode"in t&&t.mixBlendMode!=="normal"||"filter"in t&&t.filter!=="none"||"webkitFilter"in t&&t.webkitFilter!=="none"||"isolation"in t&&t.isolation==="isolate"||Mt.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function Ie(e){let t=e.length;for(;t--;){const n=e[t];if(P(n,"Missing node"),It(n))return n}return null}function Te(e){return e&&Number(getComputedStyle(e).zIndex)||0}function Ne(e){const t=[];for(;e;)t.push(e),e=et(e);return t}function et(e){const{parentNode:t}=e;return Et(t)?t.host:t}function Tt(e,t){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function Nt({groupElement:e,hitRegion:t,pointerEventTarget:n}){if(!Ve(n)||n.contains(e)||e.contains(n))return!0;if(kt(n,e)>0){let o=n;for(;o;){if(o.contains(e))return!0;if(Tt(o.getBoundingClientRect(),t))return!1;o=o.parentElement}}return!0}function ze(e,t){const n=[];return t.forEach((o,r)=>{if(r.disabled)return;const a=Ye(r),l=Rt(r.orientation,a,{x:e.clientX,y:e.clientY});l&&l.distance.x<=0&&l.distance.y<=0&&Nt({groupElement:r.element,hitRegion:l.hitRegion.rect,pointerEventTarget:e.target})&&n.push(l.hitRegion)}),n}function jt(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function I(e,t,n=0){return Math.abs(T(e)-T(t))<=n}function O(e,t){return I(e,t)?0:e>t?1:-1}function Z({overrideDisabledPanels:e,panelConstraints:t,prevSize:n,size:o}){const{collapsedSize:r=0,collapsible:a,disabled:l,maxSize:s=100,minSize:i=0}=t;if(l&&!e)return n;if(O(o,i)<0)if(a){const u=(r+i)/2;O(o,u)<0?o=r:o=i}else o=i;return o=Math.min(s,o),o=T(o),o}function ie({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:o,prevLayout:r,trigger:a}){if(I(e,0))return t;const l=a==="imperative-api",s=Object.values(t),i=Object.values(r),u=[...s],[c,h]=o;P(c!=null,"Invalid first pivot index"),P(h!=null,"Invalid second pivot index");let d=0;switch(a){case"keyboard":{{const f=e<0?h:c,g=n[f];P(g,`Panel constraints not found for index ${f}`);const{collapsedSize:p=0,collapsible:y,minSize:z=0}=g;if(y){const b=s[f];if(P(b!=null,`Previous layout not found for panel index ${f}`),I(b,p)){const v=z-b;O(v,Math.abs(e))>0&&(e=e<0?0-v:v)}}}{const f=e<0?c:h,g=n[f];P(g,`No panel constraints found for index ${f}`);const{collapsedSize:p=0,collapsible:y,minSize:z=0}=g;if(y){const b=s[f];if(P(b!=null,`Previous layout not found for panel index ${f}`),I(b,z)){const v=b-p;O(v,Math.abs(e))>0&&(e=e<0?0-v:v)}}}break}default:{const f=e<0?h:c,g=n[f];P(g,`Panel constraints not found for index ${f}`);const p=s[f],{collapsible:y,collapsedSize:z,minSize:b}=g;if(y&&O(p,b)<0)if(e>0){const v=b-z,R=v/2,E=p+e;O(E,b)<0&&(e=O(e,R)<=0?0:v)}else{const v=b-z,R=100-v/2,E=p-e;O(E,b)<0&&(e=O(100+e,R)>0?0:-v)}break}}{const f=e<0?1:-1;let g=e<0?h:c,p=0;for(;;){const z=s[g];P(z!=null,`Previous layout not found for panel index ${g}`);const b=Z({overrideDisabledPanels:l,panelConstraints:n[g],prevSize:z,size:100})-z;if(p+=b,g+=f,g<0||g>=n.length)break}const y=Math.min(Math.abs(e),Math.abs(p));e=e<0?0-y:y}{let f=e<0?c:h;for(;f>=0&&f<n.length;){const g=Math.abs(e)-Math.abs(d),p=s[f];P(p!=null,`Previous layout not found for panel index ${f}`);const y=p-g,z=Z({overrideDisabledPanels:l,panelConstraints:n[f],prevSize:p,size:y});if(!I(p,z)&&(d+=p-z,u[f]=z,d.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?f--:f++}}if(jt(i,u))return r;{const f=e<0?h:c,g=s[f];P(g!=null,`Previous layout not found for panel index ${f}`);const p=g+d,y=Z({overrideDisabledPanels:l,panelConstraints:n[f],prevSize:g,size:p});if(u[f]=y,!I(y,p)){let z=p-y,b=e<0?h:c;for(;b>=0&&b<n.length;){const v=u[b];P(v!=null,`Previous layout not found for panel index ${b}`);const R=v+z,E=Z({overrideDisabledPanels:l,panelConstraints:n[b],prevSize:v,size:R});if(I(v,E)||(z-=E-v,u[b]=E),I(z,0))break;e>0?b--:b++}}}const S=Object.values(u).reduce((f,g)=>g+f,0);if(!I(S,100,.1))return r;const m=Object.keys(r);return u.reduce((f,g,p)=>(f[m[p]]=g,f),{})}function Y(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(t[n]===void 0||O(e[n],t[n])!==0)return!1;return!0}function X({layout:e,panelConstraints:t}){const n=Object.values(e),o=[...n],r=o.reduce((s,i)=>s+i,0);if(o.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${o.map(s=>`${s}%`).join(", ")}`);if(!I(r,100)&&o.length>0)for(let s=0;s<t.length;s++){const i=o[s];P(i!=null,`No layout data found for index ${s}`);const u=100/r*i;o[s]=u}let a=0;for(let s=0;s<t.length;s++){const i=n[s];P(i!=null,`No layout data found for index ${s}`);const u=o[s];P(u!=null,`No layout data found for index ${s}`);const c=Z({overrideDisabledPanels:!0,panelConstraints:t[s],prevSize:i,size:u});u!=c&&(a+=u-c,o[s]=c)}if(!I(a,0))for(let s=0;s<t.length;s++){const i=o[s];P(i!=null,`No layout data found for index ${s}`);const u=i+a,c=Z({overrideDisabledPanels:!0,panelConstraints:t[s],prevSize:i,size:u});if(i!==c&&(a-=c-i,o[s]=c,I(a,0)))break}const l=Object.keys(e);return o.reduce((s,i,u)=>(s[l[u]]=i,s),{})}function tt({groupId:e,panelId:t}){const n=()=>{const i=_();for(const[u,{defaultLayoutDeferred:c,derivedPanelConstraints:h,layout:d,groupSize:S,separatorToPanels:m}]of i)if(u.id===e)return{defaultLayoutDeferred:c,derivedPanelConstraints:h,group:u,groupSize:S,layout:d,separatorToPanels:m};throw Error(`Group ${e} not found`)},o=()=>{const i=n().derivedPanelConstraints.find(u=>u.panelId===t);if(i!==void 0)return i;throw Error(`Panel constraints not found for Panel ${t}`)},r=()=>{const i=n().group.panels.find(u=>u.id===t);if(i!==void 0)return i;throw Error(`Layout not found for Panel ${t}`)},a=()=>{const i=n().layout[t];if(i!==void 0)return i;throw Error(`Layout not found for Panel ${t}`)},l=({nextSize:i,panels:u,prevLayout:c,derivedPanelConstraints:h})=>{const d=a(),S=u.findIndex(g=>g.id===t),m=S===0,f=S===u.length-1;if(f&&i<d&&(m||u.slice(0,S).every((g,p)=>{const y=h[p];return y?.collapsible&&I(y.collapsedSize,c[y.panelId])}))){const g=u.slice(0,S).reduce((p,y)=>p+c[y.id],0);return{...c,[t]:T(100-g)}}return ie({delta:f?d-i:i-d,initialLayout:c,panelConstraints:h,pivotIndices:f?[S-1,S]:[S,S+1],prevLayout:c,trigger:"imperative-api"})},s=i=>{const u=a();if(i===u)return;const{defaultLayoutDeferred:c,derivedPanelConstraints:h,group:d,groupSize:S,layout:m,separatorToPanels:f}=n(),g=l({nextSize:i,panels:d.panels,prevLayout:m,derivedPanelConstraints:h}),p=X({layout:g,panelConstraints:h});Y(m,p)||W(d,{defaultLayoutDeferred:c,derivedPanelConstraints:h,groupSize:S,layout:p,separatorToPanels:f})};return{collapse:()=>{const{collapsible:i,collapsedSize:u}=o(),{mutableValues:c}=r(),h=a();i&&h!==u&&(c.expandToSize=h,s(u))},expand:()=>{const{collapsible:i,collapsedSize:u,minSize:c}=o(),{mutableValues:h}=r(),d=a();if(i&&d===u){let S=h.expandToSize??c;S===0&&(S=1),s(S)}},getSize:()=>{const{group:i}=n(),u=a(),{element:c}=r(),h=i.orientation==="horizontal"?c.offsetWidth:c.offsetHeight;return{asPercentage:u,inPixels:h}},isCollapsed:()=>{const{collapsible:i,collapsedSize:u}=o(),c=a();return i&&I(u,c)},resize:i=>{const{group:u}=n(),{element:c}=r(),h=te({group:u}),d=re({groupSize:h,panelElement:c,styleProp:i}),S=T(d/h*100);s(S)}}}function je(e){if(e.defaultPrevented)return;const t=_();ze(e,t).forEach(n=>{if(n.separator&&!n.separator.disableDoubleClick){const o=n.panels.find(r=>r.panelConstraints.defaultSize!==void 0);if(o){const r=o.panelConstraints.defaultSize,a=tt({groupId:n.group.id,panelId:o.id});a&&r!==void 0&&(a.resize(r),e.preventDefault())}}})}function de(e){const t=_();for(const[n]of t)if(n.separators.some(o=>o.element===e))return n;throw Error("Could not find parent Group for separator element")}function nt({groupId:e}){const t=()=>{const n=_();for(const[o,r]of n)if(o.id===e)return{group:o,...r};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){const{defaultLayoutDeferred:n,layout:o}=t();return n?{}:o},setLayout(n){const{defaultLayoutDeferred:o,derivedPanelConstraints:r,group:a,groupSize:l,layout:s,separatorToPanels:i}=t(),u=X({layout:n,panelConstraints:r});return o?s:(Y(s,u)||W(a,{defaultLayoutDeferred:o,derivedPanelConstraints:r,groupSize:l,layout:u,separatorToPanels:i}),u)}}}function V(e,t){const n=de(e),o=H(n.id,!0),r=n.separators.find(c=>c.element===e);P(r,"Matching separator not found");const a=o.separatorToPanels.get(r);P(a,"Matching panels not found");const l=a.map(c=>n.panels.indexOf(c)),s=nt({groupId:n.id}).getLayout(),i=ie({delta:t,initialLayout:s,panelConstraints:o.derivedPanelConstraints,pivotIndices:l,prevLayout:s,trigger:"keyboard"}),u=X({layout:i,panelConstraints:o.derivedPanelConstraints});Y(s,u)||W(n,{defaultLayoutDeferred:o.defaultLayoutDeferred,derivedPanelConstraints:o.derivedPanelConstraints,groupSize:o.groupSize,layout:u,separatorToPanels:o.separatorToPanels},{isUserInteraction:!0})}function Oe(e){if(e.defaultPrevented)return;const t=e.currentTarget,n=de(t);if(!n.disabled)switch(e.key){case"ArrowDown":{e.preventDefault(),n.orientation==="vertical"&&V(t,5);break}case"ArrowLeft":{e.preventDefault(),n.orientation==="horizontal"&&V(t,-5);break}case"ArrowRight":{e.preventDefault(),n.orientation==="horizontal"&&V(t,5);break}case"ArrowUp":{e.preventDefault(),n.orientation==="vertical"&&V(t,-5);break}case"End":{e.preventDefault(),V(t,100);break}case"Enter":{e.preventDefault();const o=de(t),r=H(o.id,!0),{derivedPanelConstraints:a,layout:l,separatorToPanels:s}=r,i=o.separators.find(d=>d.element===t);P(i,"Matching separator not found");const u=s.get(i);P(u,"Matching panels not found");const c=u[0],h=a.find(d=>d.panelId===c.id);if(P(h,"Panel metadata not found"),h.collapsible){const d=l[c.id],S=h.collapsedSize===d?o.mutableState.expandedPanelSizes[c.id]??h.minSize:h.collapsedSize;V(t,S-d)}break}case"F6":{e.preventDefault();const o=de(t).separators.map(l=>l.element),r=Array.from(o).findIndex(l=>l===e.currentTarget);P(r!==null,"Index not found");const a=e.shiftKey?r>0?r-1:o.length-1:r+1<o.length?r+1:0;o[a].focus({preventScroll:!0});break}case"Home":{e.preventDefault(),V(t,-100);break}}}function Fe(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const t=_(),n=ze(e,t),o=new Map;let r=!1;n.forEach(a=>{a.separator&&(r||(r=!0,a.separator.element.focus({focusVisible:!1,preventScroll:!0})));const l=t.get(a.group);l&&o.set(a.group,l.layout)}),ee({cursorFlags:0,hitRegions:n,initialLayoutMap:o,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:"active"}),n.length&&e.preventDefault()}function ot({document:e,event:t,hitRegions:n,initialLayoutMap:o,mountedGroups:r,pointerDownAtPoint:a,prevCursorFlags:l}){let s=0;n.forEach(u=>{const{group:c,groupSize:h}=u,{orientation:d,panels:S}=c,{disableCursor:m}=c.mutableState;let f=0;a?d==="horizontal"?f=(t.clientX-a.x)/h*100:f=(t.clientY-a.y)/h*100:d==="horizontal"?f=t.clientX<0?-100:100:f=t.clientY<0?-100:100;const g=o.get(c),p=r.get(c);if(!g||!p)return;const{defaultLayoutDeferred:y,derivedPanelConstraints:z,groupSize:b,layout:v,separatorToPanels:R}=p;if(z&&v&&R){const E=ie({delta:f,initialLayout:g,panelConstraints:z,pivotIndices:u.panels.map(M=>S.indexOf(M)),prevLayout:v,trigger:"mouse-or-touch"});if(Y(E,v)){if(f!==0&&!m)switch(d){case"horizontal":{s|=f<0?_e:Je;break}case"vertical":{s|=f<0?qe:Ke;break}}}else W(u.group,{defaultLayoutDeferred:y,derivedPanelConstraints:z,groupSize:b,layout:E,separatorToPanels:R})}});let i=0;t.movementX===0?i|=l&Le:i|=s&Le,t.movementY===0?i|=l&Re:i|=s&Re,xt(i),be(e)}function Ae(e){const t=_(),n=U();n.state==="active"&&ot({document:e.currentTarget,event:e,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:t,prevCursorFlags:n.cursorFlags})}function Ge(e){if(e.defaultPrevented)return;const t=U(),n=_();switch(t.state){case"active":{if(e.buttons===0){ee({cursorFlags:0,state:"inactive"}),t.hitRegions.forEach(o=>{const r=H(o.group.id,!0);W(o.group,r,{isUserInteraction:!0})});return}for(const o of t.hitRegions)if(o.separator){const{element:r}=o.separator;r.hasPointerCapture?.(e.pointerId)||r.setPointerCapture?.(e.pointerId)}ot({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break}default:{const o=ze(e,n);o.length===0?t.state!=="inactive"&&ee({cursorFlags:0,state:"inactive"}):ee({cursorFlags:0,hitRegions:o,state:"hover"}),be(e.currentTarget);break}}}function $e(e){e.relatedTarget instanceof HTMLIFrameElement&&U().state==="hover"&&ee({cursorFlags:0,state:"inactive"})}function Be(e){e.defaultPrevented||e.pointerType==="mouse"&&e.button>0||Qe(e.currentTarget)&&e.preventDefault()}function We(e){let t=0,n=0;const o={};for(const a of e)if(a.defaultSize!==void 0){t++;const l=T(a.defaultSize);n+=l,o[a.panelId]=l}else o[a.panelId]=void 0;const r=e.length-t;if(r!==0){const a=T((100-n)/r);for(const l of e)l.defaultSize===void 0&&(o[l.panelId]=a)}return o}function Ot(e,t,n){if(!n[0])return;const o=e.panels.find(i=>i.element===t);if(!o||!o.onResize)return;const r=te({group:e}),a=e.orientation==="horizontal"?o.element.offsetWidth:o.element.offsetHeight,l=o.mutableValues.prevSize,s={asPercentage:T(a/r*100),inPixels:a};o.mutableValues.prevSize=s,o.onResize(s,o.id,l)}function Ft(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function At({group:e,nextGroupSize:t,prevGroupSize:n,prevLayout:o}){if(n<=0||t<=0||n===t)return o;let r=0,a=0,l=!1;const s=new Map,i=[];for(const h of e.panels){const d=o[h.id]??0;if(h.panelConstraints.groupResizeBehavior==="preserve-pixel-size"){l=!0;const S=d/100*n,m=T(S/t*100);s.set(h.id,m),r+=m}else i.push(h.id),a+=d}if(!l||i.length===0)return o;const u=100-r,c={...o};if(s.forEach((h,d)=>{c[d]=h}),a>0)for(const h of i){const d=o[h]??0;c[h]=T(d/a*u)}else{const h=T(u/i.length);for(const d of i)c[d]=h}return c}function Gt(e,t){const n=e.map(r=>r.id),o=Object.keys(t);if(n.length!==o.length)return!1;for(const r of n)if(!o.includes(r))return!1;return!0}const K=new Map;function $t(e){let t=!0;P(e.element.ownerDocument.defaultView,"Cannot register an unmounted Group");const n=e.element.ownerDocument.defaultView.ResizeObserver,o=new Set,r=new Set,a=new n(m=>{for(const f of m){const{borderBoxSize:g,target:p}=f;if(p===e.element){if(t){const y=te({group:e});if(y===0)return;const z=H(e.id);if(!z)return;const b=he(e),v=z.defaultLayoutDeferred?We(b):z.layout,R=At({group:e,nextGroupSize:y,prevGroupSize:z.groupSize,prevLayout:v}),E=X({layout:R,panelConstraints:b});if(!z.defaultLayoutDeferred&&Y(z.layout,E)&&Ft(z.derivedPanelConstraints,b)&&z.groupSize===y)return;W(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:b,groupSize:y,layout:E,separatorToPanels:z.separatorToPanels})}}else Ot(e,p,g)}});a.observe(e.element),e.panels.forEach(m=>{P(!o.has(m.id),`Panel ids must be unique; id "${m.id}" was used more than once`),o.add(m.id),m.onResize&&a.observe(m.element)});const l=te({group:e}),s=he(e),i=e.panels.map(({id:m})=>m).join(",");let u=e.mutableState.defaultLayout;u&&(Gt(e.panels,u)||(u=void 0));const c=e.mutableState.layouts[i]??u??We(s),h=X({layout:c,panelConstraints:s}),d=e.element.ownerDocument;K.set(d,(K.get(d)??0)+1);const S=new Map;return Ye(e).forEach(m=>{m.separator&&S.set(m.separator,m.panels)}),W(e,{defaultLayoutDeferred:l===0,derivedPanelConstraints:s,groupSize:l,layout:h,separatorToPanels:S}),e.separators.forEach(m=>{P(!r.has(m.id),`Separator ids must be unique; id "${m.id}" was used more than once`),r.add(m.id),m.element.addEventListener("keydown",Oe)}),K.get(d)===1&&(d.addEventListener("contextmenu",De,!0),d.addEventListener("dblclick",je,!0),d.addEventListener("pointerdown",Fe,!0),d.addEventListener("pointerleave",Ae),d.addEventListener("pointermove",Ge),d.addEventListener("pointerout",$e),d.addEventListener("pointerup",Be,!0)),function(){t=!1,K.set(d,Math.max(0,(K.get(d)??0)-1)),Lt(e),e.separators.forEach(m=>{m.element.removeEventListener("keydown",Oe)}),K.get(d)||(d.removeEventListener("contextmenu",De,!0),d.removeEventListener("dblclick",je,!0),d.removeEventListener("pointerdown",Fe,!0),d.removeEventListener("pointerleave",Ae),d.removeEventListener("pointermove",Ge),d.removeEventListener("pointerout",$e),d.removeEventListener("pointerup",Be,!0)),a.disconnect()}}function Bt(){const[e,t]=L.useState({}),n=L.useCallback(()=>t({}),[]);return[e,n]}function Se(e){const t=L.useId();return`${e??t}`}const J=typeof window<"u"?L.useLayoutEffect:L.useEffect;function ae(e){const t=L.useRef(e);return J(()=>{t.current=e},[e]),L.useCallback((...n)=>t.current?.(...n),[t])}function we(...e){return ae(t=>{e.forEach(n=>{if(n)switch(typeof n){case"function":{n(t);break}case"object":{n.current=t;break}}})})}function xe(e){const t=L.useRef({...e});return J(()=>{for(const n in e)t.current[n]=e[n]},[e]),t.current}const rt=L.createContext(null);function Wt(e,t){const n=L.useRef({getLayout:()=>({}),setLayout:Ct});L.useImperativeHandle(t,()=>n.current,[]),J(()=>{Object.assign(n.current,nt({groupId:e}))})}function at({children:e,className:t,defaultLayout:n,disableCursor:o,disabled:r,elementRef:a,groupRef:l,id:s,onLayoutChange:i,onLayoutChanged:u,orientation:c="horizontal",resizeTargetMinimumSize:h={coarse:20,fine:10},style:d,...S}){const m=L.useRef({onLayoutChange:{},onLayoutChanged:{}}),f=ae(w=>{Y(m.current.onLayoutChange,w)||(m.current.onLayoutChange=w,i?.(w))}),g=ae((w,x)=>{Y(m.current.onLayoutChanged,w)||(m.current.onLayoutChanged=w,u?.(w,{isUserInteraction:x}))}),p=Se(s),y=L.useRef(null),[z,b]=Bt(),v=L.useRef({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:h,separators:[]}),R=we(y,a);Wt(p,l);const E=ae((w,x)=>{const k=U(),C=Me(w),D=H(w);if(D){let N=!1;return k.state==="active"&&(N=k.hitRegions.some(ne=>ne.group===C)),{flexGrow:D.layout[x]??1,pointerEvents:N?"none":void 0}}if(n?.[x])return{flexGrow:n?.[x]}}),M=xe({defaultLayout:n,disableCursor:o}),j=L.useMemo(()=>({get disableCursor(){return!!M.disableCursor},getPanelStyles:E,id:p,orientation:c,registerPanel:w=>{const x=v.current;return x.panels=ge(c,[...x.panels,w]),b(),()=>{x.panels=x.panels.filter(k=>k!==w),b()}},registerSeparator:w=>{const x=v.current;return x.separators=ge(c,[...x.separators,w]),b(),()=>{x.separators=x.separators.filter(k=>k!==w),b()}},updatePanelProps:(w,{disabled:x})=>{const k=v.current.panels.find(N=>N.id===w);k&&(k.panelConstraints.disabled=x);const C=Me(p),D=H(p);C&&D&&W(C,{...D,derivedPanelConstraints:he(C)})},updateSeparatorProps:(w,{disabled:x,disableDoubleClick:k})=>{const C=v.current.separators.find(D=>D.id===w);C&&(C.disabled=x,C.disableDoubleClick=k)}}),[E,p,b,c,M]),G=L.useRef(null);return J(()=>{const w=y.current;if(w===null)return;const x=v.current;let k;if(M.defaultLayout!==void 0&&Object.keys(M.defaultLayout).length===x.panels.length){k={};for(const $ of x.panels){const q=M.defaultLayout[$.id];q!==void 0&&(k[$.id]=q)}}const C={disabled:!!r,element:w,id:p,mutableState:{defaultLayout:k,disableCursor:!!M.disableCursor,expandedPanelSizes:v.current.lastExpandedPanelSizes,layouts:v.current.layouts},orientation:c,panels:x.panels,resizeTargetMinimumSize:x.resizeTargetMinimumSize,separators:x.separators};G.current=C;const D=$t(C),{defaultLayoutDeferred:N,derivedPanelConstraints:ne,layout:se}=H(C.id,!0);!N&&ne.length>0&&(f(se),g(se,!1));const oe=ye(p,$=>{const{defaultLayoutDeferred:q,derivedPanelConstraints:Pe,layout:le}=$.next;if(q||Pe.length===0)return;const lt=C.panels.map(({id:B})=>B).join(",");C.mutableState.layouts[lt]=le,Pe.forEach(B=>{if(B.collapsible){const{layout:fe}=$.prev??{};if(fe){const ct=I(B.collapsedSize,le[B.panelId]),dt=I(B.collapsedSize,fe[B.panelId]);ct&&!dt&&(C.mutableState.expandedPanelSizes[B.panelId]=fe[B.panelId])}}});const ut=U().state!=="active";f(le),ut&&g(le,$.isUserInteraction)});return()=>{G.current=null,D(),oe()}},[r,p,g,f,c,z,M]),L.useEffect(()=>{const w=G.current;w&&(w.mutableState.defaultLayout=n,w.mutableState.disableCursor=!!o)}),A.jsx(rt.Provider,{value:j,children:A.jsx("div",{...S,className:t,"data-group":!0,"data-testid":p,id:p,ref:R,style:{height:"100%",width:"100%",overflow:"hidden",...d,display:"flex",flexDirection:c==="horizontal"?"row":"column",flexWrap:"nowrap",touchAction:c==="horizontal"?"pan-y":"pan-x"},children:e})})}at.displayName="Group";function Ce(){const e=L.useContext(rt);return P(e,"Group Context not found; did you render a Panel or Separator outside of a Group?"),e}function Ht(e,t){const{id:n}=Ce(),o=L.useRef({collapse:pe,expand:pe,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:pe});L.useImperativeHandle(t,()=>o.current,[]),J(()=>{Object.assign(o.current,tt({groupId:n,panelId:e}))})}function it({children:e,className:t,collapsedSize:n="0%",collapsible:o=!1,defaultSize:r,disabled:a,elementRef:l,groupResizeBehavior:s="preserve-relative-size",id:i,maxSize:u="100%",minSize:c="0%",onResize:h,panelRef:d,style:S,...m}){const f=!!i,g=Se(i),p=xe({disabled:a}),y=L.useRef(null),z=we(y,l),{getPanelStyles:b,id:v,orientation:R,registerPanel:E,updatePanelProps:M}=Ce(),j=h!==null,G=ae((C,D,N)=>{h?.(C,i,N)});J(()=>{const C=y.current;if(C!==null){const D={element:C,id:g,idIsStable:f,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:j?G:void 0,panelConstraints:{groupResizeBehavior:s,collapsedSize:n,collapsible:o,defaultSize:r,disabled:p.disabled,maxSize:u,minSize:c}};return E(D)}},[s,n,o,r,j,g,f,u,c,G,E,p]),L.useEffect(()=>{M(g,{disabled:a})},[a,g,M]),Ht(g,d);const w=()=>{const C=b(v,g);if(C)return JSON.stringify(C)},x=L.useSyncExternalStore(C=>ye(v,C),w,w);let k;return x?k=JSON.parse(x):r!==void 0?k={flexGrow:void 0,flexShrink:void 0,flexBasis:r}:k={flexGrow:1},A.jsx("div",{...m,"data-disabled":a||void 0,"data-panel":!0,"data-testid":g,id:g,ref:z,style:{...Vt,display:"flex",flexBasis:0,flexShrink:1,overflow:"visible",...k},children:A.jsx("div",{className:t,style:{maxHeight:"100%",maxWidth:"100%",flexGrow:1,overflow:"auto",...S,touchAction:R==="horizontal"?"pan-y":"pan-x"},children:e})})}it.displayName="Panel";const Vt={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function Ut({layout:e,panelConstraints:t,panelId:n,panelIndex:o}){let r,a;const l=e[n],s=t.find(i=>i.panelId===n);if(s){const i=s.maxSize,u=s.collapsible?s.collapsedSize:s.minSize,c=[o,o+1];a=X({layout:ie({delta:u-l,initialLayout:e,panelConstraints:t,pivotIndices:c,prevLayout:e}),panelConstraints:t})[n],r=X({layout:ie({delta:i-l,initialLayout:e,panelConstraints:t,pivotIndices:c,prevLayout:e}),panelConstraints:t})[n]}return{valueControls:n,valueMax:r,valueMin:a,valueNow:l}}function st({children:e,className:t,disabled:n,disableDoubleClick:o,elementRef:r,id:a,style:l,...s}){const i=Se(a),u=xe({disabled:n,disableDoubleClick:o}),[c,h]=L.useState({}),[d,S]=L.useState("inactive"),[m,f]=L.useState(!1),g=L.useRef(null),p=we(g,r),{disableCursor:y,id:z,orientation:b,registerSeparator:v,updateSeparatorProps:R}=Ce(),E=b==="horizontal"?"vertical":"horizontal";J(()=>{const G=g.current;if(G!==null){const w={disabled:u.disabled,disableDoubleClick:u.disableDoubleClick,element:G,id:i},x=v(w),k=wt(D=>{S(D.next.state!=="inactive"&&D.next.hitRegions.some(N=>N.separator===w)?D.next.state:"inactive")}),C=ye(z,D=>{const{derivedPanelConstraints:N,layout:ne,separatorToPanels:se}=D.next,oe=se.get(w);if(oe){const $=oe[0],q=oe.indexOf($);h(Ut({layout:ne,panelConstraints:N,panelId:$.id,panelIndex:q}))}});return()=>{k(),C(),x()}}},[z,i,v,u]),L.useEffect(()=>{R(i,{disabled:n,disableDoubleClick:o})},[n,o,i,R]);let M;n&&!y&&(M="not-allowed");let j;return n?j="disabled":d==="active"?j="active":m?j="focus":j=d,A.jsx("div",{...s,"aria-controls":c.valueControls,"aria-disabled":n||void 0,"aria-orientation":E,"aria-valuemax":c.valueMax,"aria-valuemin":c.valueMin,"aria-valuenow":c.valueNow,children:e,className:t,"data-separator":j,"data-testid":i,id:i,onBlur:()=>f(!1),onFocus:()=>f(!0),ref:p,role:"separator",style:{flexBasis:"auto",cursor:M,...l,flexGrow:0,flexShrink:0,touchAction:"none"},tabIndex:n?void 0:0})}st.displayName="Separator";function _t(e){const t=ve.c(10);let n,o,r;t[0]!==e?({className:n,ref:r,...o}=e,t[0]=e,t[1]=n,t[2]=o,t[3]=r):(n=t[1],o=t[2],r=t[3]);let a;t[4]!==n?(a=He("flex h-full w-full",n),t[4]=n,t[5]=a):a=t[5];let l;return t[6]!==o||t[7]!==r||t[8]!==a?(l=A.jsx(at,{groupRef:r,"data-slot":"resizable-panel-group",className:a,...o}),t[6]=o,t[7]=r,t[8]=a,t[9]=l):l=t[9],l}function Jt(e){const t=ve.c(10);let n,o,r;t[0]!==e?({ref:o,style:r,...n}=e,t[0]=e,t[1]=n,t[2]=o,t[3]=r):(n=t[1],o=t[2],r=t[3]);let a;t[4]!==r?(a={overflow:"hidden",...r},t[4]=r,t[5]=a):a=t[5];let l;return t[6]!==n||t[7]!==o||t[8]!==a?(l=A.jsx(it,{panelRef:o,"data-slot":"resizable-panel",style:a,...n}),t[6]=n,t[7]=o,t[8]=a,t[9]=l):l=t[9],l}function qt(e){const t=ve.c(12);let n,o,r;t[0]!==e?({withHandle:r,className:n,...o}=e,t[0]=e,t[1]=n,t[2]=o,t[3]=r):(n=t[1],o=t[2],r=t[3]);let a;t[4]!==n?(a=He("bg-border focus-visible:ring-ring relative flex w-[0.5px] items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:-translate-y-1/2 aria-[orientation=horizontal]:after:translate-x-0 [&[aria-orientation=horizontal]>div]:rotate-90",n),t[4]=n,t[5]=a):a=t[5];let l;t[6]!==r?(l=r&&A.jsx("div",{className:"bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border",children:A.jsx(ft,{className:"size-2.5"})}),t[6]=r,t[7]=l):l=t[7];let s;return t[8]!==o||t[9]!==a||t[10]!==l?(s=A.jsx(st,{"data-slot":"resizable-handle",className:a,...o,children:l}),t[8]=o,t[9]=a,t[10]=l,t[11]=s):s=t[11],s}export{_t as R,Jt as a,qt as b};
@@ -1 +1 @@
1
- import{c as y,b as B,j as i,dY as ne,dX as oe,t as le,dZ as re,aj as ge,r as Q,a0 as fe,B as se,aQ as me,W as G}from"./index-Dm-8Hb4L.js";import{I as ue}from"./input--O5KUqzs.js";import{S as ce}from"./switch-CsmQv6c2.js";import{d as pe,b as xe,i as he,e as je,f as ve,c as be,a as ye}from"./UserSquare-DFnOMuvf.js";import{i as Se}from"./SearchLg-CKklIQBK.js";import{a as ae,h as Te,i as _e,j as we,k as ke}from"./use-organization-settings-Bcjyhr6h.js";import{u as Me}from"./use-connection-BOx7hns0.js";function We(){const e=y.c(13),t=B();let s;e[0]!==t?(s=t("settings.review.title"),e[0]=t,e[1]=s):s=e[1];let n;e[2]!==t?(n=t("settings.review.description"),e[2]=t,e[3]=n):n=e[3];let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx(_,{flag:"reviewer_enabled",icon:i.jsx(pe,{size:16}),titleKey:"settings.review.reviewerTitle",descriptionKey:"settings.review.reviewerDescription"}),e[4]=l):l=e[4];let o;e[5]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx(_,{flag:"cheap_reviewer_model",icon:i.jsx(xe,{size:16}),titleKey:"settings.review.cheapReviewerModelTitle",descriptionKey:"settings.review.cheapReviewerModelDescription"}),e[5]=o):o=e[5];let r,c;e[6]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(_,{flag:"auto_merge",icon:i.jsx(he,{size:16}),titleKey:"settings.review.autoMergeTitle",descriptionKey:"settings.review.autoMergeDescription"}),c=i.jsx(Re,{}),e[6]=r,e[7]=c):(r=e[6],c=e[7]);let h;e[8]===Symbol.for("react.memo_cache_sentinel")?(h=i.jsx(_,{flag:"delivery_lanes_enabled",icon:i.jsx(je,{size:16}),titleKey:"settings.review.deliveryLanesTitle",descriptionKey:"settings.review.deliveryLanesDescription"}),e[8]=h):h=e[8];let j;e[9]===Symbol.for("react.memo_cache_sentinel")?(j=i.jsxs(ne,{children:[l,o,r,c,h,i.jsx(_,{flag:"auto_assign_report_tasks_to_super_agent",icon:i.jsx(ve,{size:16}),titleKey:"settings.review.autoAssignReportTasksTitle",descriptionKey:"settings.review.autoAssignReportTasksDescription"})]}),e[9]=j):j=e[9];let m;return e[10]!==s||e[11]!==n?(m=i.jsx(oe,{title:s,description:n,children:j}),e[10]=s,e[11]=n,e[12]=m):m=e[12],m}function Ye(){const e=y.c(8),t=B();let s;e[0]!==t?(s=t("settings.agentTools.title"),e[0]=t,e[1]=s):s=e[1];let n;e[2]!==t?(n=t("settings.agentTools.description"),e[2]=t,e[3]=n):n=e[3];let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsxs(ne,{children:[i.jsx(_,{flag:"coding_agent_org_mcps",icon:i.jsx(be,{size:16}),titleKey:"settings.agentTools.orgMcpsTitle",descriptionKey:"settings.agentTools.orgMcpsDescription"}),i.jsx(Ce,{})]}),e[4]=l):l=e[4];let o;return e[5]!==s||e[6]!==n?(o=i.jsx(oe,{title:s,description:n,children:l}),e[5]=s,e[6]=n,e[7]=o):o=e[7],o}function Ce(){const e=y.c(1);if(!ae("coding_agent_org_mcps"))return null;let s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx(Q.Suspense,{fallback:i.jsx(Pe,{}),children:i.jsx(Ke,{})}),e[0]=s):s=e[0],s}function Pe(){const e=y.c(5),t=B();let s;e[0]!==t?(s=t("settings.agentTools.orgMcpsPickTitle"),e[0]=t,e[1]=s):s=e[1];let n;e[2]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsx(me,{className:"mt-3 h-24 w-full"}),e[2]=n):n=e[2];let l;return e[3]!==s?(l=i.jsx(re,{title:s,children:n}),e[3]=s,e[4]=l):l=e[4],l}function ie(e){return[...e].sort().join("\0")}function Ee(e,t){return[G.SELF,G.REGISTRY,G.COMMUNITY_REGISTRY,G.DEV_ASSETS,G.REPORTS].some(s=>s(e)===t)}function Ke(){const e=y.c(84),t=B(),{org:s}=fe(),n=Me(),l=we(),o=ke(),[r,c]=Q.useState(l);let h;e[0]!==l?(h=ie(l),e[0]=l,e[1]=h):h=e[1];const[j,m]=Q.useState(h),[u,S]=Q.useState("");let w;e[2]!==l?(w=ie(l),e[2]=l,e[3]=w):w=e[3];const x=w;j!==x&&(m(x),c(l));let g,f,d,k,p;if(e[4]!==n||e[5]!==r||e[6]!==s||e[7]!==u||e[8]!==x){let a;e[14]!==s?(a=b=>!Ee(s.id,b.id),e[14]=s,e[15]=a):a=e[15],d=n.filter(a);const v=u.trim().toLowerCase();p=v?d.filter(b=>`${b.title} ${b.slug??""}`.toLowerCase().includes(v)):d;let T;e[16]!==r?(T=new Set(r),e[16]=r,e[17]=T):T=e[17],f=T,g=ie(r.filter(b=>d.some(de=>de.id===b)))!==x,k=p.length>0&&p.every(b=>!f.has(b.id)),e[4]=n,e[5]=r,e[6]=s,e[7]=u,e[8]=x,e[9]=g,e[10]=f,e[11]=d,e[12]=k,e[13]=p}else g=e[9],f=e[10],d=e[11],k=e[12],p=e[13];const M=k;let U;e[18]!==r?(U=(a,v)=>{const T=new Set(a);c(v?r.filter(b=>!T.has(b)):[...new Set([...r,...a])])},e[18]=r,e[19]=U):U=e[19];const C=U;let q;e[20]!==r||e[21]!==d||e[22]!==o||e[23]!==t?(q=()=>o.mutate(r.filter(a=>d.some(v=>v.id===a)),{onSuccess:()=>le.success(t("settings.agentTools.orgMcpsPickSaved")),onError:()=>le.error(t("settings.agentTools.orgMcpsPickFailed"))}),e[20]=r,e[21]=d,e[22]=o,e[23]=t,e[24]=q):q=e[24];const J=q;let P;e[25]!==t?(P=t("settings.agentTools.orgMcpsPickTitle"),e[25]=t,e[26]=P):P=e[26];let E;e[27]!==t?(E=t("settings.agentTools.orgMcpsPickDescription"),e[27]=t,e[28]=E):E=e[28];let X;e[29]===Symbol.for("react.memo_cache_sentinel")?(X=i.jsx(Se,{size:14,className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),e[29]=X):X=e[29];let Z;e[30]===Symbol.for("react.memo_cache_sentinel")?(Z=a=>S(a.target.value),e[30]=Z):Z=e[30];let K;e[31]!==t?(K=t("settings.agentTools.orgMcpsPickSearch"),e[31]=t,e[32]=K):K=e[32];let N;e[33]!==t?(N=t("settings.agentTools.orgMcpsPickSearch"),e[33]=t,e[34]=N):N=e[34];let A;e[35]!==u||e[36]!==N||e[37]!==K?(A=i.jsxs("div",{className:"relative flex-1",children:[X,i.jsx(ue,{value:u,onChange:Z,placeholder:K,"aria-label":N,className:"h-8 pl-8 text-xs"})]}),e[35]=u,e[36]=N,e[37]=K,e[38]=A):A=e[38];const ee=p.length===0;let R;e[39]!==M||e[40]!==C||e[41]!==p?(R=()=>C(p.map(Ne),!M),e[39]=M,e[40]=C,e[41]=p,e[42]=R):R=e[42];let $;e[43]!==M||e[44]!==t?($=t(M?"settings.agentTools.orgMcpsPickDisableAll":"settings.agentTools.orgMcpsPickEnableAll"),e[43]=M,e[44]=t,e[45]=$):$=e[45];let z;e[46]!==ee||e[47]!==R||e[48]!==$?(z=i.jsx(se,{variant:"outline",size:"sm",className:"shrink-0",disabled:ee,onClick:R,children:$}),e[46]=ee,e[47]=R,e[48]=$,e[49]=z):z=e[49];let D;e[50]!==A||e[51]!==z?(D=i.jsxs("div",{className:"flex items-center gap-2",children:[A,z]}),e[50]=A,e[51]=z,e[52]=D):D=e[52];let O;e[53]!==f||e[54]!==d.length||e[55]!==C||e[56]!==t||e[57]!==p?(O=d.length===0?i.jsx("p",{className:"p-3 text-xs text-muted-foreground",children:t("settings.agentTools.orgMcpsPickEmpty")}):p.length===0?i.jsx("p",{className:"p-3 text-xs text-muted-foreground",children:t("settings.agentTools.orgMcpsPickNoMatch")}):p.map(a=>{const v=a.title||a.id;return i.jsxs("div",{className:"flex items-center justify-between gap-3 px-3 py-2",children:[i.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[i.jsx(Ae,{icon:a.icon,title:v}),i.jsxs("div",{className:"flex min-w-0 flex-col",children:[i.jsx("span",{className:"truncate text-sm leading-tight",children:v}),a.slug&&i.jsx("span",{className:"truncate text-xs text-muted-foreground",children:a.slug})]})]}),i.jsx(ce,{checked:!f.has(a.id),"aria-label":t("settings.agentTools.orgMcpsPickAriaLabel",{name:v}),onCheckedChange:T=>C([a.id],T)})]},a.id)}),e[53]=f,e[54]=d.length,e[55]=C,e[56]=t,e[57]=p,e[58]=O):O=e[58];let F;e[59]!==O?(F=i.jsx("div",{className:"max-h-64 overflow-y-auto rounded-xl border border-border divide-y divide-border",children:O}),e[59]=O,e[60]=F):F=e[60];const te=!g||o.isPending;let I;e[61]!==o.isPending||e[62]!==t?(I=o.isPending?t("settings.agentTools.orgMcpsPickSaving"):t("settings.agentTools.orgMcpsPickSave"),e[61]=o.isPending,e[62]=t,e[63]=I):I=e[63];let L;e[64]!==J||e[65]!==te||e[66]!==I?(L=i.jsx(se,{size:"sm",disabled:te,onClick:J,children:I}),e[64]=J,e[65]=te,e[66]=I,e[67]=L):L=e[67];let W;e[68]!==g||e[69]!==l||e[70]!==o.isPending||e[71]!==t?(W=g&&i.jsx(se,{variant:"ghost",size:"sm",disabled:o.isPending,onClick:()=>c(l),children:t("settings.agentTools.orgMcpsPickDiscard")}),e[68]=g,e[69]=l,e[70]=o.isPending,e[71]=t,e[72]=W):W=e[72];let Y;e[73]!==L||e[74]!==W?(Y=i.jsxs("div",{className:"flex items-center gap-2",children:[L,W]}),e[73]=L,e[74]=W,e[75]=Y):Y=e[75];let V;e[76]!==D||e[77]!==F||e[78]!==Y?(V=i.jsxs("div",{className:"mt-3 flex w-full flex-col gap-2",children:[D,F,Y]}),e[76]=D,e[77]=F,e[78]=Y,e[79]=V):V=e[79];let H;return e[80]!==V||e[81]!==P||e[82]!==E?(H=i.jsx(re,{title:P,description:E,children:V}),e[80]=V,e[81]=P,e[82]=E,e[83]=H):H=e[83],H}function Ne(e){return e.id}function Ae(e){const t=y.c(4),{icon:s,title:n}=e,[l,o]=Q.useState(!1);let r;return t[0]!==l||t[1]!==s||t[2]!==n?(r=i.jsx("div",{className:"flex size-7 shrink-0 items-center justify-center overflow-hidden rounded-md border border-border bg-muted/20",children:s&&!l?i.jsx("img",{src:s,alt:"",loading:"lazy",className:"h-full w-full object-cover",onError:()=>o(!0)}):i.jsx("span",{className:"text-[10px] font-semibold text-muted-foreground",children:n.charAt(0).toUpperCase()})}),t[0]=l,t[1]=s,t[2]=n,t[3]=r):r=t[3],r}function Ve(){const e=y.c(5),t=B();let s;e[0]!==t?(s=t("sidebar.agentsSection.codeAgents"),e[0]=t,e[1]=s):s=e[1];let n;e[2]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsx(ne,{children:i.jsx(_,{flag:"coding_agents_claude_code",icon:i.jsx(ye,{size:16}),titleKey:"settings.agentTools.codingAgentsClaudeCodeTitle",descriptionKey:"settings.agentTools.codingAgentsClaudeCodeDescription"})}),e[2]=n):n=e[2];let l;return e[3]!==s?(l=i.jsx(oe,{title:s,children:n}),e[3]=s,e[4]=l):l=e[4],l}function Re(){const e=y.c(3),t=Te();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx(ge,{size:16}),e[0]=s):s=e[0];let n;return e[1]!==t?(n=i.jsx(_,{flag:"auto_resolve_conflicts",icon:s,titleKey:"settings.review.autoResolveConflictsTitle",descriptionKey:"settings.review.autoResolveConflictsDescription",enabled:t}),e[1]=t,e[2]=n):n=e[2],n}function _(e){const t=y.c(23),{flag:s,icon:n,titleKey:l,descriptionKey:o,enabled:r}=e,c=B(),h=ae(s),j=r??h,m=_e();let u;t[0]!==c||t[1]!==l?(u=c(l),t[0]=c,t[1]=l,t[2]=u):u=t[2];let S;t[3]!==o||t[4]!==c?(S=c(o),t[3]=o,t[4]=c,t[5]=S):S=t[5];const w=m.isPending;let x;t[6]!==c||t[7]!==l?(x=c(l),t[6]=c,t[7]=l,t[8]=x):x=t[8];let g;t[9]!==s||t[10]!==m||t[11]!==c?(g=k=>m.mutate(s,k,{onError:()=>le.error(c("settings.review.updateError"))}),t[9]=s,t[10]=m,t[11]=c,t[12]=g):g=t[12];let f;t[13]!==j||t[14]!==m.isPending||t[15]!==x||t[16]!==g?(f=i.jsx(ce,{checked:j,disabled:w,"aria-label":x,onCheckedChange:g}),t[13]=j,t[14]=m.isPending,t[15]=x,t[16]=g,t[17]=f):f=t[17];let d;return t[18]!==n||t[19]!==u||t[20]!==S||t[21]!==f?(d=i.jsx(re,{icon:n,title:u,description:S,action:f}),t[18]=n,t[19]=u,t[20]=S,t[21]=f,t[22]=d):d=t[22],d}export{Ye as A,Ve as C,We as R};
1
+ import{c as y,b as B,j as i,dY as ne,dX as oe,t as le,dZ as re,aj as ge,r as Q,a0 as fe,B as se,aQ as me,W as G}from"./index-Yd3WEM80.js";import{I as ue}from"./input-KJgBOsyt.js";import{S as ce}from"./switch-DNsx8Rt5.js";import{d as pe,b as xe,i as he,e as je,f as ve,c as be,a as ye}from"./UserSquare-DKnU_ZuL.js";import{i as Se}from"./SearchLg-Dd6xPdrU.js";import{a as ae,h as Te,i as _e,j as we,k as ke}from"./use-organization-settings-BZDRLE_8.js";import{u as Me}from"./use-connection-CHfH5o2Y.js";function We(){const e=y.c(13),t=B();let s;e[0]!==t?(s=t("settings.review.title"),e[0]=t,e[1]=s):s=e[1];let n;e[2]!==t?(n=t("settings.review.description"),e[2]=t,e[3]=n):n=e[3];let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx(_,{flag:"reviewer_enabled",icon:i.jsx(pe,{size:16}),titleKey:"settings.review.reviewerTitle",descriptionKey:"settings.review.reviewerDescription"}),e[4]=l):l=e[4];let o;e[5]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx(_,{flag:"cheap_reviewer_model",icon:i.jsx(xe,{size:16}),titleKey:"settings.review.cheapReviewerModelTitle",descriptionKey:"settings.review.cheapReviewerModelDescription"}),e[5]=o):o=e[5];let r,c;e[6]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(_,{flag:"auto_merge",icon:i.jsx(he,{size:16}),titleKey:"settings.review.autoMergeTitle",descriptionKey:"settings.review.autoMergeDescription"}),c=i.jsx(Re,{}),e[6]=r,e[7]=c):(r=e[6],c=e[7]);let h;e[8]===Symbol.for("react.memo_cache_sentinel")?(h=i.jsx(_,{flag:"delivery_lanes_enabled",icon:i.jsx(je,{size:16}),titleKey:"settings.review.deliveryLanesTitle",descriptionKey:"settings.review.deliveryLanesDescription"}),e[8]=h):h=e[8];let j;e[9]===Symbol.for("react.memo_cache_sentinel")?(j=i.jsxs(ne,{children:[l,o,r,c,h,i.jsx(_,{flag:"auto_assign_report_tasks_to_super_agent",icon:i.jsx(ve,{size:16}),titleKey:"settings.review.autoAssignReportTasksTitle",descriptionKey:"settings.review.autoAssignReportTasksDescription"})]}),e[9]=j):j=e[9];let m;return e[10]!==s||e[11]!==n?(m=i.jsx(oe,{title:s,description:n,children:j}),e[10]=s,e[11]=n,e[12]=m):m=e[12],m}function Ye(){const e=y.c(8),t=B();let s;e[0]!==t?(s=t("settings.agentTools.title"),e[0]=t,e[1]=s):s=e[1];let n;e[2]!==t?(n=t("settings.agentTools.description"),e[2]=t,e[3]=n):n=e[3];let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsxs(ne,{children:[i.jsx(_,{flag:"coding_agent_org_mcps",icon:i.jsx(be,{size:16}),titleKey:"settings.agentTools.orgMcpsTitle",descriptionKey:"settings.agentTools.orgMcpsDescription"}),i.jsx(Ce,{})]}),e[4]=l):l=e[4];let o;return e[5]!==s||e[6]!==n?(o=i.jsx(oe,{title:s,description:n,children:l}),e[5]=s,e[6]=n,e[7]=o):o=e[7],o}function Ce(){const e=y.c(1);if(!ae("coding_agent_org_mcps"))return null;let s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx(Q.Suspense,{fallback:i.jsx(Pe,{}),children:i.jsx(Ke,{})}),e[0]=s):s=e[0],s}function Pe(){const e=y.c(5),t=B();let s;e[0]!==t?(s=t("settings.agentTools.orgMcpsPickTitle"),e[0]=t,e[1]=s):s=e[1];let n;e[2]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsx(me,{className:"mt-3 h-24 w-full"}),e[2]=n):n=e[2];let l;return e[3]!==s?(l=i.jsx(re,{title:s,children:n}),e[3]=s,e[4]=l):l=e[4],l}function ie(e){return[...e].sort().join("\0")}function Ee(e,t){return[G.SELF,G.REGISTRY,G.COMMUNITY_REGISTRY,G.DEV_ASSETS,G.REPORTS].some(s=>s(e)===t)}function Ke(){const e=y.c(84),t=B(),{org:s}=fe(),n=Me(),l=we(),o=ke(),[r,c]=Q.useState(l);let h;e[0]!==l?(h=ie(l),e[0]=l,e[1]=h):h=e[1];const[j,m]=Q.useState(h),[u,S]=Q.useState("");let w;e[2]!==l?(w=ie(l),e[2]=l,e[3]=w):w=e[3];const x=w;j!==x&&(m(x),c(l));let g,f,d,k,p;if(e[4]!==n||e[5]!==r||e[6]!==s||e[7]!==u||e[8]!==x){let a;e[14]!==s?(a=b=>!Ee(s.id,b.id),e[14]=s,e[15]=a):a=e[15],d=n.filter(a);const v=u.trim().toLowerCase();p=v?d.filter(b=>`${b.title} ${b.slug??""}`.toLowerCase().includes(v)):d;let T;e[16]!==r?(T=new Set(r),e[16]=r,e[17]=T):T=e[17],f=T,g=ie(r.filter(b=>d.some(de=>de.id===b)))!==x,k=p.length>0&&p.every(b=>!f.has(b.id)),e[4]=n,e[5]=r,e[6]=s,e[7]=u,e[8]=x,e[9]=g,e[10]=f,e[11]=d,e[12]=k,e[13]=p}else g=e[9],f=e[10],d=e[11],k=e[12],p=e[13];const M=k;let U;e[18]!==r?(U=(a,v)=>{const T=new Set(a);c(v?r.filter(b=>!T.has(b)):[...new Set([...r,...a])])},e[18]=r,e[19]=U):U=e[19];const C=U;let q;e[20]!==r||e[21]!==d||e[22]!==o||e[23]!==t?(q=()=>o.mutate(r.filter(a=>d.some(v=>v.id===a)),{onSuccess:()=>le.success(t("settings.agentTools.orgMcpsPickSaved")),onError:()=>le.error(t("settings.agentTools.orgMcpsPickFailed"))}),e[20]=r,e[21]=d,e[22]=o,e[23]=t,e[24]=q):q=e[24];const J=q;let P;e[25]!==t?(P=t("settings.agentTools.orgMcpsPickTitle"),e[25]=t,e[26]=P):P=e[26];let E;e[27]!==t?(E=t("settings.agentTools.orgMcpsPickDescription"),e[27]=t,e[28]=E):E=e[28];let X;e[29]===Symbol.for("react.memo_cache_sentinel")?(X=i.jsx(Se,{size:14,className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),e[29]=X):X=e[29];let Z;e[30]===Symbol.for("react.memo_cache_sentinel")?(Z=a=>S(a.target.value),e[30]=Z):Z=e[30];let K;e[31]!==t?(K=t("settings.agentTools.orgMcpsPickSearch"),e[31]=t,e[32]=K):K=e[32];let N;e[33]!==t?(N=t("settings.agentTools.orgMcpsPickSearch"),e[33]=t,e[34]=N):N=e[34];let A;e[35]!==u||e[36]!==N||e[37]!==K?(A=i.jsxs("div",{className:"relative flex-1",children:[X,i.jsx(ue,{value:u,onChange:Z,placeholder:K,"aria-label":N,className:"h-8 pl-8 text-xs"})]}),e[35]=u,e[36]=N,e[37]=K,e[38]=A):A=e[38];const ee=p.length===0;let R;e[39]!==M||e[40]!==C||e[41]!==p?(R=()=>C(p.map(Ne),!M),e[39]=M,e[40]=C,e[41]=p,e[42]=R):R=e[42];let $;e[43]!==M||e[44]!==t?($=t(M?"settings.agentTools.orgMcpsPickDisableAll":"settings.agentTools.orgMcpsPickEnableAll"),e[43]=M,e[44]=t,e[45]=$):$=e[45];let z;e[46]!==ee||e[47]!==R||e[48]!==$?(z=i.jsx(se,{variant:"outline",size:"sm",className:"shrink-0",disabled:ee,onClick:R,children:$}),e[46]=ee,e[47]=R,e[48]=$,e[49]=z):z=e[49];let D;e[50]!==A||e[51]!==z?(D=i.jsxs("div",{className:"flex items-center gap-2",children:[A,z]}),e[50]=A,e[51]=z,e[52]=D):D=e[52];let O;e[53]!==f||e[54]!==d.length||e[55]!==C||e[56]!==t||e[57]!==p?(O=d.length===0?i.jsx("p",{className:"p-3 text-xs text-muted-foreground",children:t("settings.agentTools.orgMcpsPickEmpty")}):p.length===0?i.jsx("p",{className:"p-3 text-xs text-muted-foreground",children:t("settings.agentTools.orgMcpsPickNoMatch")}):p.map(a=>{const v=a.title||a.id;return i.jsxs("div",{className:"flex items-center justify-between gap-3 px-3 py-2",children:[i.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[i.jsx(Ae,{icon:a.icon,title:v}),i.jsxs("div",{className:"flex min-w-0 flex-col",children:[i.jsx("span",{className:"truncate text-sm leading-tight",children:v}),a.slug&&i.jsx("span",{className:"truncate text-xs text-muted-foreground",children:a.slug})]})]}),i.jsx(ce,{checked:!f.has(a.id),"aria-label":t("settings.agentTools.orgMcpsPickAriaLabel",{name:v}),onCheckedChange:T=>C([a.id],T)})]},a.id)}),e[53]=f,e[54]=d.length,e[55]=C,e[56]=t,e[57]=p,e[58]=O):O=e[58];let F;e[59]!==O?(F=i.jsx("div",{className:"max-h-64 overflow-y-auto rounded-xl border border-border divide-y divide-border",children:O}),e[59]=O,e[60]=F):F=e[60];const te=!g||o.isPending;let I;e[61]!==o.isPending||e[62]!==t?(I=o.isPending?t("settings.agentTools.orgMcpsPickSaving"):t("settings.agentTools.orgMcpsPickSave"),e[61]=o.isPending,e[62]=t,e[63]=I):I=e[63];let L;e[64]!==J||e[65]!==te||e[66]!==I?(L=i.jsx(se,{size:"sm",disabled:te,onClick:J,children:I}),e[64]=J,e[65]=te,e[66]=I,e[67]=L):L=e[67];let W;e[68]!==g||e[69]!==l||e[70]!==o.isPending||e[71]!==t?(W=g&&i.jsx(se,{variant:"ghost",size:"sm",disabled:o.isPending,onClick:()=>c(l),children:t("settings.agentTools.orgMcpsPickDiscard")}),e[68]=g,e[69]=l,e[70]=o.isPending,e[71]=t,e[72]=W):W=e[72];let Y;e[73]!==L||e[74]!==W?(Y=i.jsxs("div",{className:"flex items-center gap-2",children:[L,W]}),e[73]=L,e[74]=W,e[75]=Y):Y=e[75];let V;e[76]!==D||e[77]!==F||e[78]!==Y?(V=i.jsxs("div",{className:"mt-3 flex w-full flex-col gap-2",children:[D,F,Y]}),e[76]=D,e[77]=F,e[78]=Y,e[79]=V):V=e[79];let H;return e[80]!==V||e[81]!==P||e[82]!==E?(H=i.jsx(re,{title:P,description:E,children:V}),e[80]=V,e[81]=P,e[82]=E,e[83]=H):H=e[83],H}function Ne(e){return e.id}function Ae(e){const t=y.c(4),{icon:s,title:n}=e,[l,o]=Q.useState(!1);let r;return t[0]!==l||t[1]!==s||t[2]!==n?(r=i.jsx("div",{className:"flex size-7 shrink-0 items-center justify-center overflow-hidden rounded-md border border-border bg-muted/20",children:s&&!l?i.jsx("img",{src:s,alt:"",loading:"lazy",className:"h-full w-full object-cover",onError:()=>o(!0)}):i.jsx("span",{className:"text-[10px] font-semibold text-muted-foreground",children:n.charAt(0).toUpperCase()})}),t[0]=l,t[1]=s,t[2]=n,t[3]=r):r=t[3],r}function Ve(){const e=y.c(5),t=B();let s;e[0]!==t?(s=t("sidebar.agentsSection.codeAgents"),e[0]=t,e[1]=s):s=e[1];let n;e[2]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsx(ne,{children:i.jsx(_,{flag:"coding_agents_claude_code",icon:i.jsx(ye,{size:16}),titleKey:"settings.agentTools.codingAgentsClaudeCodeTitle",descriptionKey:"settings.agentTools.codingAgentsClaudeCodeDescription"})}),e[2]=n):n=e[2];let l;return e[3]!==s?(l=i.jsx(oe,{title:s,children:n}),e[3]=s,e[4]=l):l=e[4],l}function Re(){const e=y.c(3),t=Te();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx(ge,{size:16}),e[0]=s):s=e[0];let n;return e[1]!==t?(n=i.jsx(_,{flag:"auto_resolve_conflicts",icon:s,titleKey:"settings.review.autoResolveConflictsTitle",descriptionKey:"settings.review.autoResolveConflictsDescription",enabled:t}),e[1]=t,e[2]=n):n=e[2],n}function _(e){const t=y.c(23),{flag:s,icon:n,titleKey:l,descriptionKey:o,enabled:r}=e,c=B(),h=ae(s),j=r??h,m=_e();let u;t[0]!==c||t[1]!==l?(u=c(l),t[0]=c,t[1]=l,t[2]=u):u=t[2];let S;t[3]!==o||t[4]!==c?(S=c(o),t[3]=o,t[4]=c,t[5]=S):S=t[5];const w=m.isPending;let x;t[6]!==c||t[7]!==l?(x=c(l),t[6]=c,t[7]=l,t[8]=x):x=t[8];let g;t[9]!==s||t[10]!==m||t[11]!==c?(g=k=>m.mutate(s,k,{onError:()=>le.error(c("settings.review.updateError"))}),t[9]=s,t[10]=m,t[11]=c,t[12]=g):g=t[12];let f;t[13]!==j||t[14]!==m.isPending||t[15]!==x||t[16]!==g?(f=i.jsx(ce,{checked:j,disabled:w,"aria-label":x,onCheckedChange:g}),t[13]=j,t[14]=m.isPending,t[15]=x,t[16]=g,t[17]=f):f=t[17];let d;return t[18]!==n||t[19]!==u||t[20]!==S||t[21]!==f?(d=i.jsx(re,{icon:n,title:u,description:S,action:f}),t[18]=n,t[19]=u,t[20]=S,t[21]=f,t[22]=d):d=t[22],d}export{Ye as A,Ve as C,We as R};
@@ -1,4 +1,4 @@
1
- import{r as c,e8 as I,aO as Ne,c as xt,l as Ct,b as Pn,j as P,a9 as jn}from"./index-Dm-8Hb4L.js";import{i as Bn}from"./Link01-C9Y0BBRe.js";import{s as $n}from"./Trash01-DpHvryKg.js";function Fn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return c.useMemo(()=>r=>{t.forEach(o=>o(r))},t)}const ot=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function xe(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Dt(e){return"nodeType"in e}function j(e){var t,n;return e?xe(e)?e:Dt(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function St(e){const{Document:t}=j(e);return e instanceof t}function $e(e){return xe(e)?!1:e instanceof j(e).HTMLElement}function Jt(e){return e instanceof j(e).SVGElement}function Ce(e){return e?xe(e)?e.document:Dt(e)?St(e)?e:$e(e)||Jt(e)?e.ownerDocument:document:document:document}const _=ot?c.useLayoutEffect:c.useEffect;function it(e){const t=c.useRef(e);return _(()=>{t.current=e}),c.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}function Xn(){const e=c.useRef(null),t=c.useCallback((r,o)=>{e.current=setInterval(r,o)},[]),n=c.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function Pe(e,t){t===void 0&&(t=[e]);const n=c.useRef(e);return _(()=>{n.current!==e&&(n.current=e)},t),n}function Fe(e,t){const n=c.useRef();return c.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function Ze(e){const t=it(e),n=c.useRef(null),r=c.useCallback(o=>{o!==n.current&&t?.(o,n.current),n.current=o},[]);return[n,r]}function Qe(e){const t=c.useRef();return c.useEffect(()=>{t.current=e},[e]),t.current}let ht={};function Xe(e,t){return c.useMemo(()=>{if(t)return t;const n=ht[e]==null?0:ht[e]+1;return ht[e]=n,e+"-"+n},[e,t])}function Zt(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((i,s)=>{const a=Object.entries(s);for(const[l,u]of a){const f=i[l];f!=null&&(i[l]=f+e*u)}return i},{...t})}}const we=Zt(1),je=Zt(-1);function Yn(e){return"clientX"in e&&"clientY"in e}function st(e){if(!e)return!1;const{KeyboardEvent:t}=j(e.target);return t&&e instanceof t}function Wn(e){if(!e)return!1;const{TouchEvent:t}=j(e.target);return t&&e instanceof t}function et(e){if(Wn(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return Yn(e)?{x:e.clientX,y:e.clientY}:null}const he=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[he.Translate.toString(e),he.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),Pt="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Kn(e){return e.matches(Pt)?e:e.querySelector(Pt)}const Un={display:"none"};function Hn(e){let{id:t,value:n}=e;return I.createElement("div",{id:t,style:Un},n)}function Vn(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return I.createElement("div",{id:t,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function _n(){const[e,t]=c.useState("");return{announce:c.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const Qt=c.createContext(null);function qn(e){const t=c.useContext(Qt);c.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function Gn(){const[e]=c.useState(()=>new Set),t=c.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[c.useCallback(r=>{let{type:o,event:i}=r;e.forEach(s=>{var a;return(a=s[o])==null?void 0:a.call(s,i)})},[e]),t]}const Jn={draggable:`
1
+ import{r as c,e8 as I,aO as Ne,c as xt,l as Ct,b as Pn,j as P,a9 as jn}from"./index-Yd3WEM80.js";import{i as Bn}from"./Link01-YtEzcC3O.js";import{s as $n}from"./Trash01-DBKmXLFe.js";function Fn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return c.useMemo(()=>r=>{t.forEach(o=>o(r))},t)}const ot=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function xe(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Dt(e){return"nodeType"in e}function j(e){var t,n;return e?xe(e)?e:Dt(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function St(e){const{Document:t}=j(e);return e instanceof t}function $e(e){return xe(e)?!1:e instanceof j(e).HTMLElement}function Jt(e){return e instanceof j(e).SVGElement}function Ce(e){return e?xe(e)?e.document:Dt(e)?St(e)?e:$e(e)||Jt(e)?e.ownerDocument:document:document:document}const _=ot?c.useLayoutEffect:c.useEffect;function it(e){const t=c.useRef(e);return _(()=>{t.current=e}),c.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}function Xn(){const e=c.useRef(null),t=c.useCallback((r,o)=>{e.current=setInterval(r,o)},[]),n=c.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function Pe(e,t){t===void 0&&(t=[e]);const n=c.useRef(e);return _(()=>{n.current!==e&&(n.current=e)},t),n}function Fe(e,t){const n=c.useRef();return c.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function Ze(e){const t=it(e),n=c.useRef(null),r=c.useCallback(o=>{o!==n.current&&t?.(o,n.current),n.current=o},[]);return[n,r]}function Qe(e){const t=c.useRef();return c.useEffect(()=>{t.current=e},[e]),t.current}let ht={};function Xe(e,t){return c.useMemo(()=>{if(t)return t;const n=ht[e]==null?0:ht[e]+1;return ht[e]=n,e+"-"+n},[e,t])}function Zt(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((i,s)=>{const a=Object.entries(s);for(const[l,u]of a){const f=i[l];f!=null&&(i[l]=f+e*u)}return i},{...t})}}const we=Zt(1),je=Zt(-1);function Yn(e){return"clientX"in e&&"clientY"in e}function st(e){if(!e)return!1;const{KeyboardEvent:t}=j(e.target);return t&&e instanceof t}function Wn(e){if(!e)return!1;const{TouchEvent:t}=j(e.target);return t&&e instanceof t}function et(e){if(Wn(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return Yn(e)?{x:e.clientX,y:e.clientY}:null}const he=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[he.Translate.toString(e),he.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),Pt="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Kn(e){return e.matches(Pt)?e:e.querySelector(Pt)}const Un={display:"none"};function Hn(e){let{id:t,value:n}=e;return I.createElement("div",{id:t,style:Un},n)}function Vn(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return I.createElement("div",{id:t,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function _n(){const[e,t]=c.useState("");return{announce:c.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const Qt=c.createContext(null);function qn(e){const t=c.useContext(Qt);c.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function Gn(){const[e]=c.useState(()=>new Set),t=c.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[c.useCallback(r=>{let{type:o,event:i}=r;e.forEach(s=>{var a;return(a=s[o])==null?void 0:a.call(s,i)})},[e]),t]}const Jn={draggable:`
2
2
  To pick up a draggable item, press the space bar.
3
3
  While dragging, use the arrow keys to move the item.
4
4
  Press space again to drop the item in its new position, or press escape to cancel.
@@ -0,0 +1 @@
1
+ import{b as ie,r as z,a0 as ke,z as Mt,K as me,m as ze,j as s,l as Z,h as je,B as ce,c as X,ao as Xe,bN as ve,ap as re,bM as Ye,bO as et,Z as at,o as ct,ar as Lt,aq as vt,e as dt,t as ye,q as $e,bU as yt,p as wt,n as ae,R as mt,P as Gt,dX as tt,dY as st,dZ as lt,T as Ut,an as kt,ah as Bt,u as ut,fs as ft,fx as Vt,E as Kt,d as Yt,I as Ft,F as zt,H as $t,G as Qt}from"./index-Yd3WEM80.js";import{u as Ht}from"./use-organization-roles-BuakYscg.js";import{u as Qe}from"./use-org-auth-client-CeC2zNw8.js";import{g as gt,a as Zt}from"./role-color-Dn2tXDDF.js";import{B as we}from"./badge-u9Hsr2d5.js";import{f as Tt,e as ht,A as _t,a as xt,b as pt,c as Et,g as It,d as Rt}from"./alert-dialog-i5Kug417.js";import{i as qt}from"./DotsVertical-DnSyCHLw.js";import{s as Fe}from"./Plus-BMzoc0gw.js";import{s as Jt}from"./Trash01-DBKmXLFe.js";import{C as Wt}from"./collection-table-wrapper-6wf20wao.js";import{E as ot}from"./empty-state-DqQcz2gx.js";import{S as He}from"./search-input-CueqnTPs.js";import{P as St,D as At}from"./ai-providers-logos-DD3qZ33J.js";import{I as Ze}from"./integration-icon-Cg53nCZC.js";import{u as Xt}from"./use-infinite-scroll-KvBwMzoE.js";import{C as Be}from"./checkbox-CWmkLo2r.js";import{i as es}from"./ArrowLeft-DnFqk-Hp.js";import{u as ts}from"./useSuspenseInfiniteQuery-08sNGvo6.js";import{u as ss}from"./use-mcp-client-DeAm9BB5.js";import{C as ls}from"./collection-search-BVYMWeyx.js";import{p as os}from"./connection-cXvwUyEO.js";import{a as Nt}from"./use-members-DuAWZpQi.js";import{g as Ot}from"./get-initials-D-f_fDFw.js";import{u as ns}from"./use-connection-CHfH5o2Y.js";import{e as is}from"./use-virtual-mcp-rS90dDab.js";import{u as rs,g as as}from"./use-ai-providers-l3af7V8M.js";import{A as Ct}from"./avatar-FK7QRIag.js";import{S as ue}from"./switch-DNsx8Rt5.js";import{b as Pe,c as De,T as Me,a as Le}from"./tooltip-CdoeOmsY.js";import{P as cs}from"./project-icon-DpfxAXQD.js";import{s as ds}from"./use-project-scope-JD-WFsZ8.js";import{t as ms}from"./Globe04-oytGbm52.js";import{t as us}from"./ChevronUp-DjGa4Boj.js";import{i as fs}from"./Share07-CL5mbh1y.js";import{i as nt}from"./X-BhzA_1fc.js";import{k as gs}from"./agent-icon-evl-xYsS.js";import{A as Ts}from"./access-gate-CF90D6ZN.js";import"./table-B5etRYRw.js";import"./ArrowUp-Bm0X834W.js";import"./SearchMd-_UV4M1B1.js";import"./Tool02-Bb6Dmyzo.js";import"./infiniteQueryObserver-CN-NqOxs.js";import"./auth-BSa1jG6_.js";import"./User01-C2ZiXxql.js";import"./index-5FNlOK9S.js";import"./github-repo-BknN0SVI.js";import"./AlertCircle-BwHVY35o.js";import"./Tool01-CU565kli.js";import"./ArrowRight-CG7y79q3.js";import"./TrendUp01-2Ud1bdxk.js";import"./ZoomOut-DD63PTKM.js";import"./CheckCircle-C-wVqn9s.js";import"./UserSquare-DKnU_ZuL.js";import"./Copy01-BRhhBrd-.js";import"./CreditCard01-DBWDwJPr.js";import"./Download01-BtC1xWJa.js";import"./Settings02-9i68UkBW.js";import"./Eye-DjWZWqC5.js";import"./Globe01-CcPzGZAq.js";import"./XClose-Wb3kb2wQ.js";import"./Image01-DBJlfnbG.js";import"./Key01-BSzDlvgU.js";import"./LayoutLeft-uhMwovcu.js";import"./Link01-YtEzcC3O.js";import"./LinkExternal01-B_tP0lGk.js";import"./Monitor01-DZ9Fq-Na.js";import"./Sun-_MKalIqR.js";import"./Package-B52pYozJ.js";import"./Palette-k3jDn-tr.js";import"./Play-TbA_0tTu.js";import"./SearchLg-Dd6xPdrU.js";import"./Stars01-DlXoxgwa.js";import"./Upload01-Cj6T5I7O.js";import"./Users01-kERUftBn.js";import"./XCircle-5bxw-TCO.js";import"./Zap-C7SsP-IX.js";import"./capability-load-error-DhHYfXLK.js";const qe="basic-usage",Je=[{id:qe,label:"Basic Usage",description:"Tools all org members can access by default",section:"Basic Usage",tools:["COLLECTION_CONNECTIONS_LIST","COLLECTION_CONNECTIONS_GET","CONNECTION_TEST","COLLECTION_VIRTUAL_MCP_LIST","COLLECTION_VIRTUAL_MCP_GET","VIRTUAL_MCP_PLUGIN_CONFIG_GET","VIRTUAL_MCP_LAST_USED_LIST","AUTOMATION_GET","AUTOMATION_LIST","AUTOMATION_RUN_STATS","AI_PROVIDERS_LIST","AI_PROVIDERS_LIST_MODELS","AI_PROVIDERS_ACTIVE","AI_PROVIDER_KEY_LIST","AI_PROVIDER_CREDITS","AI_PLAN_ENTITLEMENTS","AI_PLAN_LIST","ORGANIZATION_BILLING_PLAN_PRICES","AI_PROVIDER_TOPUP_URL","LIST_OBJECTS","GET_OBJECT_METADATA","GET_PRESIGNED_URL","PUT_PRESIGNED_URL","FILE_OBJECTS_LIST","ORG_REPO_SYNC_LIST","SANDBOX_START","SANDBOX_DELETE","REPOSITORY_SEARCH_BRANCHES","GIT_PROVIDER_CAPABILITIES","GIT_ACCOUNT_LIST","REPOSITORY_LIST","REPOSITORY_SEARCH","CHANGE_REQUEST_STATE","CHANGE_REQUEST_LAST_MERGED","CHANGE_REQUEST_LIST_OPEN","CHANGE_REQUEST_CHECK_LOG","GLOBAL_SEARCH","ORGANIZATION_SETTINGS_GET","USER_GET","BRAND_CONTEXT_LIST","ORGANIZATION_HAS_SITE","COLLECTION_THREADS_CREATE","COLLECTION_THREADS_LIST","COLLECTION_THREADS_GET","COLLECTION_THREADS_UPDATE","COLLECTION_THREADS_DELETE","COLLECTION_THREAD_MESSAGES_LIST","TASK_BOARD_ITEM_CREATE","TASK_BOARD_ITEM_LIST","TASK_BOARD_ITEM_UPDATE","TASK_BOARD_ITEM_DELETE","TASK_BOARD_AUTOMATION_LIST","TASK_BOARD_AUTOMATION_UPSERT","TASK_BOARD_AUTOMATION_DELETE","TASK_BOARD_PROMPT_LIST","TASK_BOARD_PROMPT_UPSERT","TASK_BOARD_PROMPT_DELETE","TASK_BOARD_ITEM_PRS_GET","TASK_BOARD_PREVIEW_PROBE","TASK_BOARD_ITEM_RERUN","TASK_BOARD_RUN_REVIEWER","TASK_BOARD_REVIEW_DECISION","TASK_BOARD_PROMOTE_TO_PRODUCTION","TASK_BOARD_ACTIVITY_LIST","TASK_BOARD_COMMENT_LIST","TASK_BOARD_COMMENT_CREATE","TASK_BOARD_COMMENT_UPDATE","TASK_BOARD_COMMENT_DELETE","TASK_BOARD_DISMISSED_LIST","TASK_BOARD_DISMISSED_RESTORE","TASK_BOARD_ADMIN_ORG_LIST","TASK_BOARD_DELIVERY","TASK_BOARD_STUCK","TASK_BOARD_COST","TASK_BOARD_QUALITY","TASK_BOARD_ERRORS","TASK_BOARD_TENANTS","NOTIFICATION_LIST","NOTIFICATION_MARK_READ","NOTIFICATION_SUBSCRIPTION_SET","NOTIFICATION_SUBSCRIPTION_LIST"]},{id:"org:manage",label:"Manage organization",description:"Edit organization settings, brand context, and domain configuration",section:"Organization",tools:["ORGANIZATION_GET","ORGANIZATION_LIST","ORGANIZATION_UPDATE","ORGANIZATION_SETTINGS_GET","ORGANIZATION_SETTINGS_UPDATE","BRAND_CONTEXT_LIST","BRAND_CONTEXT_GET","BRAND_CONTEXT_CREATE","BRAND_CONTEXT_UPDATE","BRAND_CONTEXT_DELETE","BRAND_CONTEXT_EXTRACT","BRAND_GET","BRAND_LIST","ORGANIZATION_DOMAIN_LIST","ORGANIZATION_DOMAIN_ADD","ORGANIZATION_DOMAIN_UPDATE","ORGANIZATION_DOMAIN_VERIFY","ORGANIZATION_DOMAIN_REMOVE","JIRA_INTEGRATION_GET","JIRA_INTEGRATION_UPSERT","JIRA_INTEGRATION_DELETE","JIRA_BOARDS_LIST","JIRA_BOARD_COLUMNS_LIST","JIRA_AUTOMATION_LIST","JIRA_AUTOMATION_UPSERT","JIRA_AUTOMATION_DELETE","JIRA_RUN_START"]},{id:"members:manage",label:"Manage members",description:"Invite members, remove them, and change their roles",section:"Organization",tools:["ORGANIZATION_MEMBER_LIST","ORGANIZATION_MEMBER_ADD","ORGANIZATION_MEMBER_REMOVE","ORGANIZATION_MEMBER_UPDATE_ROLE","ORGANIZATION_BILLING_CHECKOUT_START","ORGANIZATION_BILLING_PORTAL","ORGANIZATION_TASK_QUOTA_GET","INFRA_BILLING_SITES_LIST","INFRA_BILLING_GET","INFRA_BILLING_PORTAL","ORGANIZATION_JOIN_REQUEST_LIST","ORGANIZATION_JOIN_REQUEST_APPROVE","ORGANIZATION_JOIN_REQUEST_DENY"],dangerous:!0},{id:"connections:manage",label:"Manage connections",description:"Create, update, and delete connections",section:"Connections & Agents",tools:["COLLECTION_CONNECTIONS_CREATE","COLLECTION_CONNECTIONS_UPDATE","COLLECTION_CONNECTIONS_DELETE","REPORTS_SETUP","REPORTS_RUN","REPORTS_BIND","REPORTS_CONNECTION_STATUS","REPORTS_SET_REPOSITORY"],dangerous:!0},{id:"agents:manage",label:"Manage agents",description:"Create, configure, and delete agents",section:"Connections & Agents",tools:["COLLECTION_VIRTUAL_MCP_CREATE","COLLECTION_VIRTUAL_MCP_UPDATE","COLLECTION_VIRTUAL_MCP_DELETE","VIRTUAL_MCP_PLUGIN_CONFIG_UPDATE","VIRTUAL_MCP_PINNED_VIEWS_UPDATE"],dangerous:!0},{id:"automations:manage",label:"Manage automations",description:"Create, update, run, and delete automations",section:"Automations",tools:["AUTOMATION_CREATE","AUTOMATION_UPDATE","AUTOMATION_DELETE","AUTOMATION_TRIGGER_ADD","AUTOMATION_TRIGGER_REMOVE","AUTOMATION_TRIGGER_ROTATE_TOKEN","AUTOMATION_RUN"],dangerous:!0},{id:"monitoring:view",label:"View monitoring",description:"Access logs and usage statistics",section:"Monitoring",tools:["MONITORING_HEATMAP","MONITORING_LOG_GET","MONITORING_LOGS_LIST","MONITORING_STATS","MONITORING_THREAD_USAGE"]},{id:"secrets:manage",label:"Manage secrets",description:"Create and list secrets stored in the credential vault",section:"Organization",tools:["SECRET_CREATE","SECRET_LIST"]},{id:"file-configs:manage",label:"Manage file configs",description:"Create, list, update and delete S3 bucket configurations and synced GitHub repositories",section:"Organization",tools:["FILE_CONFIG_CREATE","FILE_CONFIG_LIST","FILE_CONFIG_UPDATE","FILE_CONFIG_DELETE","FILE_OBJECTS_LIST","FILE_OBJECT_DELETE","ORG_REPO_SYNC_CREATE","ORG_REPO_SYNC_LIST","ORG_REPO_SYNC_UPDATE","ORG_REPO_SYNC_DELETE","ORG_REPO_SYNC_RUN"]},{id:"ai-providers:manage",label:"Manage AI providers",description:"Add or remove API keys and provision provider credentials",section:"AI Providers",tools:["AI_PROVIDER_KEY_CREATE","AI_PROVIDER_KEY_LIST","AI_PROVIDER_KEY_DELETE","AI_PROVIDER_KEY_UPDATE","AI_PROVIDER_KEY_PREVIEW","AI_PROVIDER_OAUTH_URL","AI_PROVIDER_OAUTH_EXCHANGE","AI_PROVIDER_PROVISION_KEY","AI_PROVIDER_TOPUP_URL","AI_PROVIDER_CREDITS","AI_PLAN_ENTITLEMENTS","AI_PLAN_LIST","AI_PLAN_SET","CLAUDE_SUBSCRIPTION_CONNECT","CLAUDE_SUBSCRIPTION_STATUS","CLAUDE_SUBSCRIPTION_DISCONNECT"]},{id:"tags:manage",label:"Manage tags",description:"Create, assign, and delete organization tags",section:"Organization",tools:["TAGS_LIST","TAGS_CREATE","TAGS_DELETE","MEMBER_TAGS_GET","MEMBER_TAGS_SET"]},{id:"registry:manage",label:"Manage registry",description:"Browse, publish, and manage items in the registry",section:"Store & Registry",tools:["COLLECTION_REGISTRY_APP_LIST","COLLECTION_REGISTRY_APP_GET","COLLECTION_REGISTRY_APP_VERSIONS","COLLECTION_REGISTRY_APP_FILTERS","REGISTRY_ITEM_LIST","REGISTRY_ITEM_SEARCH","REGISTRY_ITEM_GET","REGISTRY_ITEM_VERSIONS","REGISTRY_ITEM_FILTERS","REGISTRY_DISCOVER_TOOLS","REGISTRY_ITEM_CREATE","REGISTRY_ITEM_BULK_CREATE","REGISTRY_ITEM_UPDATE","REGISTRY_ITEM_DELETE","REGISTRY_AI_GENERATE","REGISTRY_PUBLISH_REQUEST_LIST","REGISTRY_PUBLISH_REQUEST_REVIEW","REGISTRY_PUBLISH_REQUEST_COUNT","REGISTRY_PUBLISH_REQUEST_DELETE","REGISTRY_PUBLISH_API_KEY_GENERATE","REGISTRY_PUBLISH_API_KEY_LIST","REGISTRY_PUBLISH_API_KEY_REVOKE"],dangerous:!0},{id:"registry:monitor",label:"Monitor registry health",description:"Run health checks on registry connections and view results",section:"Store & Registry",tools:["REGISTRY_MONITOR_RUN_START","REGISTRY_MONITOR_RUN_LIST","REGISTRY_MONITOR_RUN_GET","REGISTRY_MONITOR_RUN_CANCEL","REGISTRY_MONITOR_RESULT_LIST","REGISTRY_MONITOR_CONNECTION_LIST","REGISTRY_MONITOR_CONNECTION_SYNC","REGISTRY_MONITOR_CONNECTION_UPDATE_AUTH"]},{id:"api-keys:manage",label:"Manage API keys",description:"Create, update, and revoke API keys",section:"Developer",tools:["API_KEY_CREATE","API_KEY_LIST","API_KEY_UPDATE","API_KEY_DELETE"]},{id:"storage:delete",label:"Delete from storage",description:"Permanently delete files from object storage",section:"Developer",tools:["DELETE_OBJECT","DELETE_OBJECTS"],dangerous:!0},{id:"connections:sql",label:"Run SQL queries",description:"Execute raw SQL against connected databases",section:"Developer",tools:["DATABASES_RUN_SQL"],dangerous:!0}];[...Je.find(t=>t.id===qe)?.tools??[]];const hs=["agents:manage","connections:manage"];new Set(Je.filter(t=>hs.includes(t.id)).flatMap(t=>t.tools));function _s(){const t=new Map;for(const e of Je){if(e.id===qe)continue;const l=t.get(e.section)??[];l.push(e),t.set(e.section,l)}return Array.from(t.entries()).map(([e,l])=>({section:e,capabilities:l}))}function xs(t,e,l){return l?!0:t.tools.every(n=>e.includes(n))}function ps(t,e,l){if(l){const i=new Set(e);for(const a of t.tools)i.add(a);return Array.from(i)}const n=new Set(e);for(const i of t.tools)n.delete(i);return Array.from(n)}const We="projects",it="*";function Es(t){if(!t)return null;const e=t[We];return Array.isArray(e)?e:null}function Is(t){const e=X.c(21),{connection:l,isSelected:n,hasToolsEnabled:i,activeToolsCount:a,totalToolsCount:o,onSelect:T,onToggle:m}=t,r=n?"bg-accent/50":"hover:bg-muted/50";let h;e[0]!==r?(h=Z("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",r),e[0]=r,e[1]=h):h=e[1];let d;e[2]!==l.icon||e[3]!==l.title?(d=s.jsx(Ze,{icon:l.icon,name:l.title,size:"xs"}),e[2]=l.icon,e[3]=l.title,e[4]=d):d=e[4];let _;e[5]!==l.title?(_=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:l.title})}),e[5]=l.title,e[6]=_):_=e[6];let g;e[7]!==T||e[8]!==d||e[9]!==_?(g=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:T,children:[d,_]}),e[7]=T,e[8]=d,e[9]=_,e[10]=g):g=e[10];let f;e[11]!==a||e[12]!==l.tools||e[13]!==i||e[14]!==m||e[15]!==o?(f=l.tools&&l.tools.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[a,"/",o]}),s.jsx(Be,{checked:i,onCheckedChange:m,onClick:Rs})]}),e[11]=a,e[12]=l.tools,e[13]=i,e[14]=m,e[15]=o,e[16]=f):f=e[16];let u;return e[17]!==h||e[18]!==g||e[19]!==f?(u=s.jsxs("div",{className:h,children:[g,f]}),e[17]=h,e[18]=g,e[19]=f,e[20]=u):u=e[20],u}function Rs(t){return t.stopPropagation()}function Ss(t){const e=X.c(18),{connectionId:l,tool:n,isSelected:i,onToggle:a}=t,o=`tool-${l}-${n.name}`,T=i?"text-foreground":"text-muted-foreground";let m;e[0]!==T?(m=Z("text-sm font-medium",T),e[0]=T,e[1]=m):m=e[1];let r;e[2]!==m||e[3]!==n.name?(r=s.jsx("div",{className:"flex items-center gap-2 mb-1",children:s.jsx("span",{className:m,children:n.name})}),e[2]=m,e[3]=n.name,e[4]=r):r=e[4];let h;e[5]!==n.description?(h=n.description&&s.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:n.description}),e[5]=n.description,e[6]=h):h=e[6];let d;e[7]!==r||e[8]!==h?(d=s.jsxs("div",{className:"flex-1 min-w-0",children:[r,h]}),e[7]=r,e[8]=h,e[9]=d):d=e[9];const _=`tool-${l}-${n.name}`;let g;e[10]!==i||e[11]!==a||e[12]!==_?(g=s.jsx("div",{className:"flex items-center shrink-0",children:s.jsx(Be,{id:_,checked:i,onCheckedChange:a,onClick:As})}),e[10]=i,e[11]=a,e[12]=_,e[13]=g):g=e[13];let f;return e[14]!==o||e[15]!==d||e[16]!==g?(f=s.jsxs("label",{className:"flex items-center gap-3 p-3 rounded-lg hover:bg-muted/50 cursor-pointer group will-change-auto",htmlFor:o,children:[d,g]}),e[14]=o,e[15]=d,e[16]=g,e[17]=f):f=e[17],f}function As(t){return t.stopPropagation()}function Ns({toolSet:t,onToolSetChange:e,excludeVirtualMcpId:l,searchQuery:n}){const i=ie(),[a,o]=z.useState(""),T=n!==void 0?n:a,m=z.useDeferredValue(T),[r,h]=z.useState("all"),[d,_]=z.useState(!1),g=z.useRef(new Set(Object.keys(t))),{org:f}=ke(),u=ss({connectionId:Mt,orgId:f.id,orgSlug:f.slug}),x=100,A=m.trim(),E=A?{operator:"or",conditions:[{field:["title"],operator:"contains",value:A},{field:["description"],operator:"contains",value:A}]}:void 0,b=!!l,N={...E&&{where:E},orderBy:[{field:["updated_at"],direction:"asc"}],limit:x,offset:0,...b&&{include_virtual:!0}},P=JSON.stringify(N),{data:j,fetchNextPage:O,hasNextPage:D,isFetchingNextPage:I}=ts({queryKey:me.collectionListInfinite(u,f.id,"","CONNECTIONS",P),queryFn:async({pageParam:R=0})=>(await u.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...E&&{where:E},orderBy:[{field:["updated_at"],direction:"asc"}],limit:x,offset:R,...b&&{include_virtual:!0}}})).structuredContent,initialPageParam:0,getNextPageParam:(R,w)=>{if(R?.hasMore)return w.reduce((H,J)=>H+(J?.items?.length??0),0)},staleTime:3e4}),C=j?.pages.flatMap(R=>R?.items??[])??[],S=Xt(O,D??!1,I),p=l?C.filter(R=>R.connection_type!=="VIRTUAL"?!0:os(R.connection_url)!==l):C,c=g.current,G=[...c.values()].map(R=>p.find(w=>w.id===R)).filter(R=>R!==void 0),y=p.filter(R=>!c.has(R.id)),K=[...G,...y],F=R=>{const w=t[R];return w!==void 0&&w.length>0},V=K.filter(R=>{if(r==="all")return!0;const w=F(R.id);return r==="selected"?w:r==="unselected"?!w:!0}),[U,k]=z.useState(K[0]?.id??null),B=U?K.find(R=>R.id===U)??null:null,{data:$,isFetching:L}=ze({queryKey:me.collectionItem(u,f.id,"","CONNECTIONS",U??""),queryFn:async()=>U?(await u.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:U}})).structuredContent?.item??null:null,enabled:!!U,staleTime:3e4}),Y=$?.tools??[],W=(R,w)=>t[R]?.includes(w)??!1,le=(R,w)=>{const H=t[R]??[],J=H.includes(w),ne={...t};if(J){const se=H.filter(oe=>oe!==w);se.length===0?delete ne[R]:ne[R]=se}else ne[R]=[...H,w];e(ne)},te=R=>{const w=R===U?Y:[];if(!w.length)return;const H=t[R]??[],J=w.map(oe=>oe.name),ne=H.length>0&&J.every(oe=>H.includes(oe)),se={...t};ne?delete se[R]:(se[R]=J,k(R)),e(se)},Q=R=>{k(R),_(!0)},q=()=>{_(!1)};return s.jsxs("div",{className:"flex h-full",children:[s.jsxs("div",{className:Z("w-full md:w-80 border-r border-border flex flex-col",d&&"hidden md:flex"),children:[n===void 0&&s.jsx(ls,{value:a,onChange:o,placeholder:i("common.toolSetSelector.searchPlaceholder")}),s.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[s.jsx("button",{type:"button",onClick:()=>h("all"),className:Z("flex-1 px-3 py-1.5 text-xs font-medium classic:rounded-md compact:rounded-lg transition-colors border cursor-pointer",r==="all"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:i("common.toolSetSelector.filterAll")}),s.jsx("button",{type:"button",onClick:()=>h("selected"),className:Z("flex-1 px-3 py-1.5 text-xs font-medium classic:rounded-md compact:rounded-lg transition-colors border cursor-pointer",r==="selected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:i("common.toolSetSelector.filterSelected")}),s.jsx("button",{type:"button",onClick:()=>h("unselected"),className:Z("flex-1 px-3 py-1.5 text-xs font-medium classic:rounded-md compact:rounded-lg transition-colors border cursor-pointer",r==="unselected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:i("common.toolSetSelector.filterUnselected")})]}),s.jsx("div",{className:"flex-1 overflow-auto",children:V.length===0?s.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:i(T?"common.toolSetSelector.noConnectionsFound":r==="selected"?"common.toolSetSelector.noServersSelected":r==="unselected"?"common.toolSetSelector.noUnselectedServers":"common.toolSetSelector.noConnectionsAvailable")}):s.jsxs("div",{className:"p-2 space-y-1",children:[V.map(R=>{const w=U===R.id,H=w?Y.length:0,J=t[R.id]?.length??0;return s.jsx(Is,{connection:{...R,tools:w?Y:R.tools},isSelected:w,hasToolsEnabled:F(R.id),activeToolsCount:J,totalToolsCount:H,onSelect:()=>Q(R.id),onToggle:()=>te(R.id)},R.id)}),s.jsx("div",{ref:S,className:"h-4"}),I&&s.jsx("div",{className:"flex justify-center py-3",children:s.jsx(je,{className:"size-4.5 text-muted-foreground"})})]})})]}),s.jsx("div",{className:Z("flex-1 flex-col",d?"flex":"hidden md:flex"),children:B?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"md:hidden border-b border-border p-4 flex items-center gap-3",children:[s.jsx(ce,{variant:"ghost",size:"sm",onClick:q,className:"h-8 w-8 p-0 shrink-0",children:s.jsx(es,{size:20})}),s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[s.jsx(Ze,{icon:B.icon,name:B.title,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:B.title}),B.description&&s.jsx("p",{className:"text-sm text-muted-foreground truncate",children:B.description})]})]})]}),s.jsx("div",{className:"flex-1 overflow-auto p-4",children:L?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(je,{className:"size-4.5 text-muted-foreground"})}):Y.length===0?s.jsx("div",{className:"text-sm text-muted-foreground text-center py-8",children:i("common.toolSetSelector.noToolsAvailable")}):s.jsx("div",{className:"space-y-2",children:Y.map(R=>s.jsx(Ss,{connectionId:B.id,tool:R,isSelected:W(B.id,R.name),onToggle:()=>le(B.id,R.name)},R.name))})})]}):s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsx("div",{className:"text-sm text-muted-foreground text-center",children:i("common.toolSetSelector.selectConnection")})})})]})}const Os=Xe({role:Xe({id:re().optional(),slug:re().optional(),label:re()}),allowAllStaticPermissions:Ye(),staticPermissions:ve(re()),toolSet:et(re(),ve(re())),allowAllModels:Ye(),modelSet:et(re(),ve(re())),allowAllProjects:Ye(),projectSet:ve(re()),memberIds:ve(re())});function rt(t,e,l,n){const i=s.jsx(ue,{checked:e,disabled:l,onCheckedChange:n});return l?s.jsx(Pe,{children:s.jsxs(De,{children:[s.jsx(Me,{asChild:!0,children:s.jsx("div",{children:i})}),s.jsx(Le,{children:s.jsx("p",{children:t("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):i}function Cs(t){const e=X.c(41),{allowAllStaticPermissions:l,staticPermissions:n,onAllowAllChange:i,onPermissionsChange:a,readOnly:o,searchQuery:T}=t,m=o===void 0?!1:o,r=ie();let h;e[0]!==T?(h=T.trim().toLowerCase(),e[0]=T,e[1]=h):h=e[1];const d=z.useDeferredValue(h);let _;if(e[2]!==l||e[3]!==d||e[4]!==i||e[5]!==a||e[6]!==m||e[7]!==T||e[8]!==n||e[9]!==r){const g=_s(),f=(I,C)=>{if(!m){if(l&&C){const S=g.flatMap(Ps).flatMap(js);i(!1),a(S.filter(p=>!I.tools.includes(p)));return}l||a(ps(I,n,!C))}};let u;e[11]!==d?(u=I=>{const{section:C,capabilities:S}=I;return{section:C,capabilities:S.filter(p=>!d||p.label.toLowerCase().includes(d)||p.description.toLowerCase().includes(d))}},e[11]=d,e[12]=u):u=e[12];const x=g.map(u).filter(bs);let A;e[13]!==r?(A=r("settings.orgRoleDetail.general"),e[13]=r,e[14]=A):A=e[14];let E;e[15]!==r?(E=r("settings.orgRoleDetail.allOrgPermissions"),e[15]=r,e[16]=E):E=e[16];let b;e[17]!==r?(b=r("settings.orgRoleDetail.grantFullAccessToAllFeaturesBelow"),e[17]=r,e[18]=b):b=e[18];let N;e[19]!==l||e[20]!==i||e[21]!==a?(N=()=>{i(!l),a([])},e[19]=l,e[20]=i,e[21]=a,e[22]=N):N=e[22];let P;e[23]!==l||e[24]!==m||e[25]!==r||e[26]!==N?(P=rt(r,l,m,N),e[23]=l,e[24]=m,e[25]=r,e[26]=N,e[27]=P):P=e[27];let j;e[28]!==l||e[29]!==i||e[30]!==a||e[31]!==m?(j=m?void 0:()=>{i(!l),a([])},e[28]=l,e[29]=i,e[30]=a,e[31]=m,e[32]=j):j=e[32];let O;e[33]!==j||e[34]!==E||e[35]!==b||e[36]!==P?(O=s.jsx(st,{children:s.jsx(lt,{title:E,description:b,action:P,onClick:j})}),e[33]=j,e[34]=E,e[35]=b,e[36]=P,e[37]=O):O=e[37];let D;e[38]!==O||e[39]!==A?(D=s.jsx(tt,{title:A,children:O}),e[38]=O,e[39]=A,e[40]=D):D=e[40],_=s.jsx("div",{children:s.jsxs("div",{className:"flex flex-col gap-10 py-4",children:[D,x.length===0&&d?s.jsx("p",{className:"text-sm text-muted-foreground py-4",children:r("settings.orgRoleDetail.noPermissionsMatch",{searchQuery:T})}):x.map(I=>{const{section:C,capabilities:S}=I;return s.jsx(tt,{title:C,children:s.jsx(st,{children:S.map(p=>{const c=xs(p,n,l);return s.jsx(lt,{title:s.jsxs("span",{className:"flex items-center gap-1.5",children:[p.label,p.dangerous&&s.jsx(Ut,{size:12,className:"text-warning shrink-0"})]}),description:p.description,action:rt(r,c,m,()=>f(p,c)),onClick:m?void 0:()=>f(p,c)},p.id)})})},C)})]})}),e[2]=l,e[3]=d,e[4]=i,e[5]=a,e[6]=m,e[7]=T,e[8]=n,e[9]=r,e[10]=_}else _=e[10];return _}function bs(t){return t.capabilities.length>0}function js(t){return t.tools}function Ps(t){return t.capabilities}const bt={anthropic:"Anthropic",openrouter:"OpenRouter"},Ds={openai:"OpenAI",anthropic:"Anthropic",google:"Google","meta-llama":"Meta",mistralai:"Mistral","x-ai":"xAI",deepseek:"DeepSeek",qwen:"Qwen",moonshotai:"MoonshotAI",nvidia:"NVIDIA",perplexity:"Perplexity",cohere:"Cohere",amazon:"Amazon",microsoft:"Microsoft","z-ai":"Z.ai","ibm-granite":"IBM Granite",alibaba:"Alibaba",baidu:"Baidu",bytedance:"ByteDance",tencent:"Tencent",minimax:"MiniMax",nousresearch:"Nous Research",allenai:"Allen AI",inception:"Inception"};function Ms(t,e){const l=t.indexOf("/"),n=l>0?t.slice(0,l):e;return n.startsWith("~")?n.slice(1):n}function Ls(t){return Ds[t]??bt[t]??t}function vs(t){const e=t.indexOf(": ");return e>0&&e<32?t.slice(e+2):t}const jt=30;function ys(t){const e=X.c(40),{connectionId:l,subProviderId:n,subProviderName:i,groupLogo:a,models:o,allConnectionModelIds:T,selectedModels:m,allowAllModels:r,allConnectionModelsSelected:h,onToggleModel:d,onExitAllowAll:_,readOnly:g,defaultExpanded:f}=t,u=ie(),[x,A]=z.useState(f),E=f||x,b=A,[N,P]=z.useState(jt);let j;e[0]!==h||e[1]!==r||e[2]!==m?(j=I=>r||h||m.includes("*")||m.includes(I),e[0]=h,e[1]=r,e[2]=m,e[3]=j):j=e[3];const O=j;let D;if(e[4]!==T||e[5]!==r||e[6]!==l||e[7]!==E||e[8]!==a||e[9]!==O||e[10]!==o||e[11]!==_||e[12]!==d||e[13]!==g||e[14]!==n||e[15]!==i||e[16]!==u||e[17]!==N){let I;e[19]!==O?(I=L=>O(L.id),e[19]=O,e[20]=I):I=e[20];const C=o.filter(I).length,S=o.slice(0,N),p=o.length>N;let c;e[21]===Symbol.for("react.memo_cache_sentinel")?(c=()=>b(ks),e[21]=c):c=e[21];const G=a??St[n]??At;let y;e[22]!==i||e[23]!==G?(y=s.jsx(Ze,{icon:G,name:i,size:"sm"}),e[22]=i,e[23]=G,e[24]=y):y=e[24];let K;e[25]!==i?(K=s.jsx("span",{className:"text-sm font-medium truncate",children:i}),e[25]=i,e[26]=K):K=e[26];let F;e[27]!==y||e[28]!==K?(F=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[y,K]}),e[27]=y,e[28]=K,e[29]=F):F=e[29];const V=u("settings.orgRoleDetail.enabledCount",{enabledCount:C,total:o.length});let U;e[30]!==V?(U=s.jsx(we,{variant:"secondary",className:"text-xs text-muted-foreground",children:V}),e[30]=V,e[31]=U):U=e[31];let k;e[32]!==E?(k=E?s.jsx(us,{size:16,className:"text-muted-foreground shrink-0"}):s.jsx(kt,{size:16,className:"text-muted-foreground shrink-0"}),e[32]=E,e[33]=k):k=e[33];let B;e[34]!==U||e[35]!==k?(B=s.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[U,k]}),e[34]=U,e[35]=k,e[36]=B):B=e[36];let $;e[37]!==B||e[38]!==F?($=s.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3 hover:bg-muted/50 cursor-pointer",onClick:c,children:[F,B]}),e[37]=B,e[38]=F,e[39]=$):$=e[39],D=s.jsxs("div",{className:"border border-border rounded-lg overflow-hidden bg-card",children:[$,E&&s.jsxs("div",{className:"border-t border-border bg-muted/20",children:[S.map(L=>{const Y=O(L.id),W=()=>{if(!g){if(r){_(l,T,L.id);return}d(l,L.id)}};return s.jsxs("div",{className:Z("flex items-center justify-between gap-3 px-4 py-3 border-b border-border last:border-b-0",!g&&"hover:bg-muted/50 cursor-pointer"),onClick:W,children:[s.jsx("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:s.jsx("span",{className:"text-sm truncate",children:L.title})}),s.jsx("div",{onClick:Us,children:g?s.jsx(Pe,{children:s.jsxs(De,{children:[s.jsx(Me,{asChild:!0,children:s.jsx("div",{children:s.jsx(ue,{checked:Y,disabled:!0,onCheckedChange:Gs})})}),s.jsx(Le,{children:s.jsx("p",{children:u("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):s.jsx(ue,{checked:Y,onCheckedChange:W})})]},L.id)}),p&&s.jsx("button",{type:"button",className:"w-full px-4 py-2 text-xs text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors",onClick:()=>P(ws),children:u("settings.orgRoleDetail.showMore",{remaining:o.length-N})})]})]}),e[4]=T,e[5]=r,e[6]=l,e[7]=E,e[8]=a,e[9]=O,e[10]=o,e[11]=_,e[12]=d,e[13]=g,e[14]=n,e[15]=i,e[16]=u,e[17]=N,e[18]=D}else D=e[18];return D}function ws(t){return t+jt}function Gs(){}function Us(t){return t.stopPropagation()}function ks(t){return!t}function Bs(t){const e=X.c(33),{connection:l,selectedModels:n,allowAllModels:i,onToggleModel:a,onExitAllowAll:o,allConnectionModelsSelected:T,searchQuery:m,readOnly:r}=t,h=as(l.id);let d,_,g,f,u;if(e[0]!==T||e[1]!==i||e[2]!==l.id||e[3]!==l.label||e[4]!==l.providerId||e[5]!==o||e[6]!==a||e[7]!==h||e[8]!==r||e[9]!==m||e[10]!==n){u=Symbol.for("react.early_return_sentinel");e:{let E;e[16]!==l.label?(E=c=>({...c,id:c.modelId,provider:l.label}),e[16]=l.label,e[17]=E):E=e[17];const b=h.filter(Fs).map(E),N=m.trim().toLowerCase(),P=N?b.filter(c=>c.title.toLowerCase().includes(N)||c.id.toLowerCase().includes(N)||c.provider?.toLowerCase().includes(N)):b;if(P.length===0){u=null;break e}const j=new Map;for(const c of P){const G=Ms(c.id,l.providerId),y=j.get(G)??{models:[],logo:null};y.models.push({id:c.id,title:vs(c.title),logo:c.logo}),!y.logo&&c.logo&&(y.logo=c.logo),j.set(G,y)}const O=Array.from(j.entries()).map(Ys).sort(Ks),D=O.length===1||N.length>0;g="flex flex-col gap-3";const I=St[l.providerId]??At;let C;e[18]!==l.providerId||e[19]!==I?(C=s.jsx("img",{src:I,alt:l.providerId,className:"w-4 h-4 rounded-sm dark:bg-white dark:rounded-sm dark:p-px"}),e[18]=l.providerId,e[19]=I,e[20]=C):C=e[20];const S=bt[l.providerId]??l.providerId;let p;e[21]!==S?(p=s.jsx("h4",{className:"text-sm font-medium",children:S}),e[21]=S,e[22]=p):p=e[22],e[23]!==p||e[24]!==C?(f=s.jsxs("div",{className:"flex items-center gap-2",children:[C,p]}),e[23]=p,e[24]=C,e[25]=f):f=e[25],d="flex flex-col gap-3",_=O.map(c=>s.jsx(ys,{connectionId:l.id,subProviderId:c.id,subProviderName:c.name,groupLogo:c.logo,models:c.models,allConnectionModelIds:b.map(Vs),selectedModels:n,allowAllModels:i,allConnectionModelsSelected:T,onToggleModel:a,onExitAllowAll:o,readOnly:r,defaultExpanded:D},c.id))}e[0]=T,e[1]=i,e[2]=l.id,e[3]=l.label,e[4]=l.providerId,e[5]=o,e[6]=a,e[7]=h,e[8]=r,e[9]=m,e[10]=n,e[11]=d,e[12]=_,e[13]=g,e[14]=f,e[15]=u}else d=e[11],_=e[12],g=e[13],f=e[14],u=e[15];if(u!==Symbol.for("react.early_return_sentinel"))return u;let x;e[26]!==d||e[27]!==_?(x=s.jsx("div",{className:d,children:_}),e[26]=d,e[27]=_,e[28]=x):x=e[28];let A;return e[29]!==g||e[30]!==f||e[31]!==x?(A=s.jsxs("div",{className:g,children:[f,x]}),e[29]=g,e[30]=f,e[31]=x,e[32]=A):A=e[32],A}function Vs(t){return t.id}function Ks(t,e){return t.name.localeCompare(e.name)}function Ys(t){const[e,l]=t;return{id:e,name:Ls(e),logo:l.logo,models:l.models}}function Fs(t,e,l){return l.findIndex(n=>n.modelId===t.modelId)===e}function zs(t){const e=X.c(41),{allowAllModels:l,modelSet:n,onAllowAllChange:i,onModelSetChange:a,readOnly:o,searchQuery:T}=t,m=o===void 0?!1:o,r=ie(),h=z.useDeferredValue(T),d=rs();let _;e[0]!==n||e[1]!==a?(_=(I,C)=>{const S=n[I]??[],p={...n};if(S.includes(C)){const c=S.filter(G=>G!==C);c.length===0?delete p[I]:p[I]=c}else p[I]=[...S,C];a(p)},e[0]=n,e[1]=a,e[2]=_):_=e[2];const g=_;let f;e[3]!==n||e[4]!==i||e[5]!==a?(f=(I,C,S)=>{i(!1),a({...n,[I]:C.filter(p=>p!==S)})},e[3]=n,e[4]=i,e[5]=a,e[6]=f):f=e[6];const u=f,x=!m&&"hover:bg-muted/50 cursor-pointer";let A;e[7]!==x?(A=Z("flex items-center justify-between px-4 py-3 rounded-lg border border-border bg-card",x),e[7]=x,e[8]=A):A=e[8];let E;e[9]!==l||e[10]!==i||e[11]!==a||e[12]!==m?(E=()=>{if(m)return;const I=!l;i(I),I&&a({})},e[9]=l,e[10]=i,e[11]=a,e[12]=m,e[13]=E):E=e[13];let b;e[14]!==r?(b=r("settings.orgRoleDetail.allModels"),e[14]=r,e[15]=b):b=e[15];let N;e[16]!==b?(N=s.jsx("span",{className:"text-sm font-medium",children:b}),e[16]=b,e[17]=N):N=e[17];let P;e[18]!==l||e[19]!==i||e[20]!==a||e[21]!==m||e[22]!==r?(P=s.jsx("div",{onClick:Qs,children:m?s.jsx(Pe,{children:s.jsxs(De,{children:[s.jsx(Me,{asChild:!0,children:s.jsx("div",{children:s.jsx(ue,{checked:l,disabled:!0,onCheckedChange:$s})})}),s.jsx(Le,{children:s.jsx("p",{children:r("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):s.jsx(ue,{checked:l,onCheckedChange:I=>{i(I),I&&a({})}})}),e[18]=l,e[19]=i,e[20]=a,e[21]=m,e[22]=r,e[23]=P):P=e[23];let j;e[24]!==A||e[25]!==E||e[26]!==N||e[27]!==P?(j=s.jsxs("div",{className:A,onClick:E,children:[N,P]}),e[24]=A,e[25]=E,e[26]=N,e[27]=P,e[28]=j):j=e[28];let O;e[29]!==d||e[30]!==l||e[31]!==h||e[32]!==u||e[33]!==n||e[34]!==m||e[35]!==r||e[36]!==g?(O=d.length===0?s.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:r("settings.orgRoleDetail.noLlmConnectionsConfigured")}):d.map(I=>s.jsx(z.Suspense,{fallback:s.jsxs("div",{className:"px-4 py-3 flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(je,{className:"size-4"}),r("settings.orgRoleDetail.loadingModels")]}),children:s.jsx(Bs,{connection:I,selectedModels:n[I.id]??[],allowAllModels:l,onToggleModel:g,onExitAllowAll:u,allConnectionModelsSelected:(n[I.id]??[]).includes("*"),searchQuery:h,readOnly:m})},I.id)),e[29]=d,e[30]=l,e[31]=h,e[32]=u,e[33]=n,e[34]=m,e[35]=r,e[36]=g,e[37]=O):O=e[37];let D;return e[38]!==j||e[39]!==O?(D=s.jsxs("div",{className:"flex flex-col h-full overflow-auto gap-6 pb-6",children:[j,O]}),e[38]=j,e[39]=O,e[40]=D):D=e[40],D}function $s(){}function Qs(t){return t.stopPropagation()}function Hs(t){const e=X.c(39),{allowAllProjects:l,projectSet:n,onAllowAllChange:i,onProjectSetChange:a,readOnly:o,searchQuery:T}=t,m=o===void 0?!1:o,r=ie(),h=z.useDeferredValue(T),d=is();let _;if(e[0]!==l||e[1]!==h||e[2]!==i||e[3]!==a||e[4]!==n||e[5]!==m||e[6]!==T||e[7]!==r||e[8]!==d){const g=ds(d),f=h.trim().toLowerCase(),u=f?g.filter(S=>S.title.toLowerCase().includes(f)):g,x=S=>{if(l){i(!1),a(g.map(Js).filter(p=>p!==S));return}n.includes(S)?a(n.filter(p=>p!==S)):a([...n,S])},A=!m&&"hover:bg-muted/50 cursor-pointer";let E;e[10]!==A?(E=Z("flex items-center justify-between px-4 py-3 rounded-lg border border-border bg-card",A),e[10]=A,e[11]=E):E=e[11];let b;e[12]!==l||e[13]!==i||e[14]!==a||e[15]!==m?(b=()=>{if(m)return;const S=!l;i(S),S&&a([])},e[12]=l,e[13]=i,e[14]=a,e[15]=m,e[16]=b):b=e[16];let N;e[17]!==r?(N=r("settings.orgRoleDetail.allProjects"),e[17]=r,e[18]=N):N=e[18];let P;e[19]!==N?(P=s.jsx("span",{className:"text-sm font-medium",children:N}),e[19]=N,e[20]=P):P=e[20];let j;e[21]!==r?(j=r("settings.orgRoleDetail.allProjectsDescription"),e[21]=r,e[22]=j):j=e[22];let O;e[23]!==j?(O=s.jsx("span",{className:"text-xs text-muted-foreground",children:j}),e[23]=j,e[24]=O):O=e[24];let D;e[25]!==P||e[26]!==O?(D=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[P,O]}),e[25]=P,e[26]=O,e[27]=D):D=e[27];let I;e[28]!==l||e[29]!==i||e[30]!==a||e[31]!==m||e[32]!==r?(I=s.jsx("div",{onClick:qs,children:m?s.jsx(Pe,{children:s.jsxs(De,{children:[s.jsx(Me,{asChild:!0,children:s.jsx("div",{children:s.jsx(ue,{checked:l,disabled:!0,onCheckedChange:Zs})})}),s.jsx(Le,{children:s.jsx("p",{children:r("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):s.jsx(ue,{checked:l,onCheckedChange:S=>{i(S),S&&a([])}})}),e[28]=l,e[29]=i,e[30]=a,e[31]=m,e[32]=r,e[33]=I):I=e[33];let C;e[34]!==D||e[35]!==I||e[36]!==E||e[37]!==b?(C=s.jsxs("div",{className:E,onClick:b,children:[D,I]}),e[34]=D,e[35]=I,e[36]=E,e[37]=b,e[38]=C):C=e[38],_=s.jsxs("div",{className:"flex flex-col h-full overflow-auto gap-6 p-4",children:[C,g.length===0?s.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:r("settings.orgRoleDetail.noProjectsAvailable")}):u.length===0?s.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:r("settings.orgRoleDetail.noProjectsMatch",{searchQuery:T})}):s.jsx("div",{className:"flex flex-col gap-1",children:u.map(S=>{const p=l||n.includes(S.id);return s.jsxs("label",{className:Z("flex items-center gap-3 px-3 py-2 rounded-lg border border-transparent",m?"cursor-default":"hover:bg-muted/50 cursor-pointer"),children:[s.jsx(Be,{checked:p,disabled:m,onCheckedChange:()=>{m||x(S.id)}}),s.jsx(cs,{icon:S.icon,name:S.title}),s.jsx("span",{className:"text-sm truncate",children:S.title})]},S.id)})})]}),e[0]=l,e[1]=h,e[2]=i,e[3]=a,e[4]=n,e[5]=m,e[6]=T,e[7]=r,e[8]=d,e[9]=_}else _=e[9];return _}function Zs(){}function qs(t){return t.stopPropagation()}function Js(t){return t.id}function Ws(t){const e=X.c(75),{open:l,onOpenChange:n,selectedMemberIds:i,onAddMembers:a}=t,o=ie(),[T,m]=z.useState(""),r=z.useDeferredValue(T);let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=[],e[0]=h):h=e[0];const[d,_]=z.useState(h),{data:g}=Nt();let f,u,x,A,E,b,N,P,j,O,D;if(e[1]!==g?.data?.members||e[2]!==r||e[3]!==a||e[4]!==n||e[5]!==l||e[6]!==d||e[7]!==T||e[8]!==i||e[9]!==o){const U=g?.data?.members??[];let k;e[21]!==r?(k=Q=>{const q=r.toLowerCase();return Q.user?.name?.toLowerCase().includes(q)||Q.user?.email?.toLowerCase().includes(q)},e[21]=r,e[22]=k):k=e[22];const B=U.filter(k);let $;e[23]!==a||e[24]!==n||e[25]!==d?($=()=>{a(d),_([]),n(!1)},e[23]=a,e[24]=n,e[25]=d,e[26]=$):$=e[26],x=$,u=Tt,O=l,D=n,f=ht,P="sm:max-w-md p-0";let L;e[27]!==o?(L=o("settings.orgRoleDetail.addMembersToRole"),e[27]=o,e[28]=L):L=e[28];let Y;e[29]!==L?(Y=s.jsx(_t,{children:L}),e[29]=L,e[30]=Y):Y=e[30];let W;e[31]!==o?(W=o("settings.orgRoleDetail.selectMembersToAddToThisRole"),e[31]=o,e[32]=W):W=e[32];let le;e[33]!==W?(le=s.jsx(xt,{children:W}),e[33]=W,e[34]=le):le=e[34],e[35]!==Y||e[36]!==le?(j=s.jsxs(pt,{className:"px-6 pt-6",children:[Y,le]}),e[35]=Y,e[36]=le,e[37]=j):j=e[37],b="flex flex-col h-80";let te;e[38]!==o?(te=o("settings.orgRoleDetail.searchMembers"),e[38]=o,e[39]=te):te=e[39],e[40]!==T||e[41]!==te?(N=s.jsx("div",{className:"border-b border-border px-4 py-3",children:s.jsx(He,{value:T,onChange:m,placeholder:te,className:"w-full"})}),e[40]=T,e[41]=te,e[42]=N):N=e[42],A="flex-1 overflow-auto",E=B.length===0?s.jsx("div",{className:"flex items-center justify-center h-full px-6",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:o(T?"settings.orgRoleDetail.noMembersFound":"settings.orgRoleDetail.noMembersAvailable")})}):s.jsx("div",{className:"px-6 py-2 space-y-1",children:B.map(Q=>{const q=Q.role!=="owner",R=i.includes(Q.id),w=d.includes(Q.id);return s.jsxs("label",{className:Z("flex items-center gap-3 p-2 rounded-lg",!q||R?"opacity-50 cursor-not-allowed":"cursor-pointer hover:bg-muted/50"),children:[s.jsx(Be,{checked:w||R,onCheckedChange:()=>{!q||R||_(H=>H.includes(Q.id)?H.filter(J=>J!==Q.id):[...H,Q.id])},disabled:!q||R}),s.jsx(Ct,{url:Q.user?.image??void 0,fallback:Ot(Q.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:Q.user?.name||o("settings.orgRoleDetail.unknown")}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:Q.user?.email})]}),!q&&s.jsx(we,{variant:"secondary",className:"shrink-0",children:o("settings.orgRoleDetail.owner")}),R&&q&&s.jsx(we,{variant:"outline",className:"shrink-0",children:o("settings.orgRoleDetail.added")})]},Q.id)})}),e[1]=g?.data?.members,e[2]=r,e[3]=a,e[4]=n,e[5]=l,e[6]=d,e[7]=T,e[8]=i,e[9]=o,e[10]=f,e[11]=u,e[12]=x,e[13]=A,e[14]=E,e[15]=b,e[16]=N,e[17]=P,e[18]=j,e[19]=O,e[20]=D}else f=e[10],u=e[11],x=e[12],A=e[13],E=e[14],b=e[15],N=e[16],P=e[17],j=e[18],O=e[19],D=e[20];let I;e[43]!==A||e[44]!==E?(I=s.jsx("div",{className:A,children:E}),e[43]=A,e[44]=E,e[45]=I):I=e[45];let C;e[46]!==I||e[47]!==b||e[48]!==N?(C=s.jsxs("div",{className:b,children:[N,I]}),e[46]=I,e[47]=b,e[48]=N,e[49]=C):C=e[49];let S;e[50]!==o?(S=o("settings.orgRoleDetail.cancel"),e[50]=o,e[51]=S):S=e[51];let p;e[52]!==S?(p=s.jsx(Et,{children:S}),e[52]=S,e[53]=p):p=e[53];const c=d.length===0;let G;e[54]!==d.length||e[55]!==o?(G=o("settings.orgRoleDetail.addWithCount",{count:d.length}),e[54]=d.length,e[55]=o,e[56]=G):G=e[56];let y;e[57]!==x||e[58]!==c||e[59]!==G?(y=s.jsx(It,{onClick:x,disabled:c,children:G}),e[57]=x,e[58]=c,e[59]=G,e[60]=y):y=e[60];let K;e[61]!==p||e[62]!==y?(K=s.jsxs(Rt,{className:"px-6 pb-6",children:[p,y]}),e[61]=p,e[62]=y,e[63]=K):K=e[63];let F;e[64]!==f||e[65]!==C||e[66]!==K||e[67]!==P||e[68]!==j?(F=s.jsxs(f,{className:P,children:[j,C,K]}),e[64]=f,e[65]=C,e[66]=K,e[67]=P,e[68]=j,e[69]=F):F=e[69];let V;return e[70]!==u||e[71]!==F||e[72]!==O||e[73]!==D?(V=s.jsx(u,{open:O,onOpenChange:D,children:F}),e[70]=u,e[71]=F,e[72]=O,e[73]=D,e[74]=V):V=e[74],V}function Xs(t){const e=X.c(33),{memberIds:l,onMemberIdsChange:n,readOnly:i,readOnlyMessage:a,searchQuery:o,addMemberDialogOpen:T,onAddMemberDialogOpenChange:m}=t,r=i===void 0?!1:i,h=a===void 0?void 0:a,d=ie(),_=z.useDeferredValue(o),{data:g}=Nt();let f,u,x;if(e[0]!==g?.data?.members||e[1]!==_||e[2]!==l||e[3]!==n||e[4]!==r||e[5]!==h||e[6]!==o||e[7]!==d){const P=g?.data?.members??[];let j;e[11]!==l?(j=p=>l.includes(p.id),e[11]=l,e[12]=j):j=e[12];const O=P.filter(j);let D;e[13]!==_?(D=p=>{const c=_.toLowerCase();return p.user?.name?.toLowerCase().includes(c)||p.user?.email?.toLowerCase().includes(c)},e[13]=_,e[14]=D):D=e[14];const I=O.filter(D);let C;e[15]!==h||e[16]!==d?(C=h??d("settings.orgRoleDetail.ownerMembershipCannotBeChanged"),e[15]=h,e[16]=d,e[17]=C):C=e[17];const S=C;x="flex flex-col h-full",f="flex-1 overflow-auto",u=O.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsxs("div",{className:"text-center",children:[s.jsx("h3",{className:"text-base font-medium mb-1",children:d("settings.orgRoleDetail.noMembers")}),s.jsx("p",{className:"text-sm text-muted-foreground",children:d("settings.orgRoleDetail.addMembersToGrantPermissions")})]})}):I.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:d("settings.orgRoleDetail.noMembersMatch",{searchQuery:o})})}):s.jsx("div",{className:"p-4 space-y-2",children:I.map(p=>s.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-muted/30",children:[s.jsx(Ct,{url:p.user?.image??void 0,fallback:Ot(p.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:p.user?.name||d("settings.orgRoleDetail.unknown")}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:p.user?.email})]}),r?s.jsx(Pe,{children:s.jsxs(De,{children:[s.jsx(Me,{asChild:!0,children:s.jsx("div",{children:s.jsx(ce,{variant:"ghost",size:"sm",disabled:!0,"aria-label":d("settings.orgRoleDetail.removeMember",{name:p.user?.name||d("settings.orgRoleDetail.unknown")}),children:s.jsx(nt,{size:16})})})}),s.jsx(Le,{children:s.jsx("p",{children:S})})]})}):s.jsx(ce,{variant:"ghost",size:"sm","aria-label":d("settings.orgRoleDetail.removeMember",{name:p.user?.name||d("settings.orgRoleDetail.unknown")}),onClick:()=>n(l.filter(c=>c!==p.id)),children:s.jsx(nt,{size:16})})]},p.id))}),e[0]=g?.data?.members,e[1]=_,e[2]=l,e[3]=n,e[4]=r,e[5]=h,e[6]=o,e[7]=d,e[8]=f,e[9]=u,e[10]=x}else f=e[8],u=e[9],x=e[10];let A;e[18]!==f||e[19]!==u?(A=s.jsx("div",{className:f,children:u}),e[18]=f,e[19]=u,e[20]=A):A=e[20];let E;e[21]!==l||e[22]!==n?(E=P=>n([...l,...P]),e[21]=l,e[22]=n,e[23]=E):E=e[23];let b;e[24]!==T||e[25]!==l||e[26]!==m||e[27]!==E?(b=s.jsx(Ws,{open:T,onOpenChange:m,selectedMemberIds:l,onAddMembers:E}),e[24]=T,e[25]=l,e[26]=m,e[27]=E,e[28]=b):b=e[28];let N;return e[29]!==x||e[30]!==A||e[31]!==b?(N=s.jsxs("div",{className:x,children:[A,b]}),e[29]=x,e[30]=A,e[31]=b,e[32]=N):N=e[32],N}function el(t){const e=X.c(3);let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(je,{className:"size-6 text-muted-foreground"})}),e[0]=l):l=e[0];let n;return e[1]!==t?(n=s.jsx(z.Suspense,{fallback:l,children:s.jsx(Xs,{...t})}),e[1]=t,e[2]=n):n=e[2],n}const tl={owner:[],admin:[],user:[]};function sl(t,e,l,n){const i=t==="owner"||t==="admin";return{role:{id:l?.id,slug:t,label:t.charAt(0).toUpperCase()+t.slice(1)},allowAllStaticPermissions:i,staticPermissions:tl[t],toolSet:{},allowAllModels:!0,modelSet:{},allowAllProjects:!0,projectSet:[],memberIds:e.filter(a=>a.role===t).map(a=>a.id)}}function ll(t,e,l){const n=t.permission||{},i=n.self||[],a=i.includes("*"),o=a?[]:i.filter(f=>f!=="*"),T={};for(const[f,u]of Object.entries(n))if(!(f==="self"||f==="models"||f===We))if(f==="*")for(const x of l)T[x.id]=u.includes("*")?x.tools?.map(A=>A.name)??[]:u;else{const x=l.find(A=>A.id===f);x&&(T[f]=u.includes("*")?x.tools?.map(A=>A.name)??[]:u)}const m=n.models||[],r=m.length===0||m.includes("*:*"),h={};if(!r)for(const f of m){const u=f.indexOf(":");if(u===-1)continue;const x=f.slice(0,u),A=f.slice(u+1);h[x]||(h[x]=[]),h[x].push(A)}const d=Es(n),_=d===null||d.includes(it),g=_?[]:d.filter(f=>f!==it);return{role:{id:t.id,slug:t.role,label:t.label},allowAllStaticPermissions:a,staticPermissions:o,toolSet:T,allowAllModels:r,modelSet:h,allowAllProjects:_,projectSet:g,memberIds:e.filter(f=>f.role===t.role).map(f=>f.id)}}function ol(t,e){const l={};t.allowAllStaticPermissions?l.self=["*"]:t.staticPermissions.length>0&&(l.self=t.staticPermissions);for(const[n,i]of Object.entries(t.toolSet))if(i.length>0){const o=e.find(T=>T.id===n)?.tools?.map(T=>T.name)??[];l[n]=o.length>0&&o.every(T=>i.includes(T))?["*"]:i}if(t.allowAllModels)l.models=["*:*"];else{const n=[];for(const[i,a]of Object.entries(t.modelSet))for(const o of a)n.push(`${i}:${o}`);n.length>0&&(l.models=n)}return t.allowAllProjects||(l[We]=t.projectSet),l}function nl(t,e,l){return t.kind==="builtin"?sl(t.role,e,void 0):t.kind==="custom"?ll(t.role,e,l):{role:{id:void 0,slug:void 0,label:""},allowAllStaticPermissions:!1,staticPermissions:[],toolSet:{},allowAllModels:!0,modelSet:{},allowAllProjects:!0,projectSet:[],memberIds:[]}}function il(t){const e=X.c(19),{readOnly:l,readOnlyMessage:n,onOpen:i}=t,a=n===void 0?void 0:n,o=ie();let T;e[0]!==a||e[1]!==o?(T=a??o("settings.orgRoleDetail.ownerMembershipCannotBeChanged"),e[0]=a,e[1]=o,e[2]=T):T=e[2];const m=T;if(l){let _;e[3]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(Fe,{size:16}),e[3]=_):_=e[3];let g;e[4]!==o?(g=o("settings.orgRoleDetail.addMember"),e[4]=o,e[5]=g):g=e[5];let f;e[6]!==g?(f=s.jsx(Me,{asChild:!0,children:s.jsx("div",{children:s.jsxs(ce,{variant:"outline",size:"sm",disabled:!0,children:[_,g]})})}),e[6]=g,e[7]=f):f=e[7];let u;e[8]!==m?(u=s.jsx(Le,{children:s.jsx("p",{children:m})}),e[8]=m,e[9]=u):u=e[9];let x;return e[10]!==f||e[11]!==u?(x=s.jsx(Pe,{children:s.jsxs(De,{children:[f,u]})}),e[10]=f,e[11]=u,e[12]=x):x=e[12],x}let r;e[13]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Fe,{size:16}),e[13]=r):r=e[13];let h;e[14]!==o?(h=o("settings.orgRoleDetail.addMember"),e[14]=o,e[15]=h):h=e[15];let d;return e[16]!==i||e[17]!==h?(d=s.jsxs(ce,{variant:"outline",size:"sm",onClick:i,children:[r,h]}),e[16]=i,e[17]=h,e[18]=d):d=e[18],d}function rl(t){const e=X.c(14),{locator:l}=ke(),n=Qe(),i=ns();let a;e[0]!==l?(a=me.members(l),e[0]=l,e[1]=a):a=e[1];let o;e[2]!==n?(o=()=>n.organization.listMembers(),e[2]=n,e[3]=o):o=e[3];let T;e[4]!==a||e[5]!==o?(T={queryKey:a,queryFn:o},e[4]=a,e[5]=o,e[6]=T):T=e[6];const{data:m,isPending:r}=ze(T);if(r||!i){let g;return e[7]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(ae,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(je,{className:"size-8 text-muted-foreground"})})}),e[7]=g):g=e[7],g}let h;e[8]!==m?.data?.members?(h=m?.data?.members??[],e[8]=m?.data?.members,e[9]=h):h=e[9];const d=h;let _;return e[10]!==i||e[11]!==d||e[12]!==t?(_=s.jsx(al,{...t,members:d,connections:i}),e[10]=i,e[11]=d,e[12]=t,e[13]=_):_=e[13],_}function al({target:t,onBack:e,onSaved:l,members:n,connections:i}){const a=at(),o=ie(),{locator:T}=ke(),m=Qe(),r=ct(),h=t.kind==="builtin",d=t.kind==="builtin"&&t.role==="owner",_=t.kind==="new",[g,f]=z.useState(h?"org":"mcp"),u=Lt({resolver:vt(Os),defaultValues:nl(t,n,i)}),x=u.formState.isValid,A=u.formState.isDirty,E=dt({mutationFn:async c=>{const G=ol(c,i),y=c.role.slug||c.role.label.toLowerCase().replace(/\s+/g,"-"),K=(c.role.slug==="owner"||c.role.slug==="admin"||c.role.slug==="user")&&!c.role.id,F=async(V,U)=>{const k=n.filter(L=>L.role===(U??V)).map(L=>L.id),B=c.memberIds.filter(L=>!k.includes(L)),$=k.filter(L=>!c.memberIds.includes(L));for(const L of B){const Y=await m.organization.updateMemberRole({memberId:L,role:[V]});if(Y?.error)throw new Error(Y.error.message??o("settings.orgRoleDetail.somethingWentWrong"))}for(const L of $){const Y=await m.organization.updateMemberRole({memberId:L,role:["user"]});if(Y?.error)throw new Error(Y.error.message??o("settings.orgRoleDetail.somethingWentWrong"))}};if(K)return await F(c.role.slug),c;if(c.role.id){const V=c.role.label.toLowerCase().replace(/\s+/g,"-"),U=c.role.slug,k=V!==U,B=await m.organization.updateRole({roleId:c.role.id,data:{permission:G,...k?{roleName:V}:{}}});if(B?.error)throw new Error(B.error.message??o("settings.orgRoleDetail.somethingWentWrong"));return await F(k?V:U,k?U:void 0),k?{...c,role:{...c.role,slug:V}}:c}else{const V=await m.organization.createRole({role:y,permission:G});if(V?.error)throw new Error(V.error.message??o("settings.orgRoleDetail.somethingWentWrong"));for(const U of c.memberIds){const k=await m.organization.updateMemberRole({memberId:U,role:[y]});if(k?.error)throw new Error(k.error.message)}return{...c,role:{...c.role,id:V.data?.roleData?.id,slug:y}}}},onSuccess:(c,G)=>{r.invalidateQueries({queryKey:me.members(T)}),r.invalidateQueries({queryKey:me.organizationRoles(T)});const y=!G.role.id&&!G.role.slug,K=G.role.slug==="owner"&&!G.role.id;$e(K?"role_members_updated":y?"role_created":"role_updated",{role_slug:G.role.slug??null}),ye.success(o(K?"settings.orgRoleDetail.membersUpdatedSuccessfully":y?"settings.orgRoleDetail.roleCreatedSuccessfully":"settings.orgRoleDetail.roleUpdatedSuccessfully")),u.reset(c),l(c.role.id)},onError:c=>{ye.error(c instanceof Error?c.message:o("settings.orgRoleDetail.failedToSaveRole"))}}),b=u.handleSubmit(c=>{if(!c.role.label.trim()){ye.error(o("settings.orgRoleDetail.roleNameIsRequired")),u.setFocus("role.label");return}E.mutate(c)}),N=!d,P=t.kind==="builtin"?t.role.charAt(0).toUpperCase()+t.role.slice(1):t.kind==="custom"?t.role.label:"",j=[...d?[]:[{id:"mcp",label:o("settings.orgRoleDetail.mcpPermissions"),icon:gs}],{id:"org",label:o("settings.orgRoleDetail.organizationPermissions"),icon:ms},{id:"models",label:o("settings.orgRoleDetail.models"),icon:yt},{id:"projects",label:o("settings.orgRoleDetail.projects"),icon:fs},{id:"members",label:o("settings.orgRoleDetail.members"),icon:wt}],[O,D]=z.useState(""),[I,C]=z.useState(!1),S=c=>{f(c),D("")},p={mcp:o("settings.orgRoleDetail.searchMcpServers"),org:o("settings.orgRoleDetail.searchPermissions"),models:o("settings.orgRoleDetail.searchModels"),projects:o("settings.orgRoleDetail.searchProjects"),members:o("settings.orgRoleDetail.searchMembers")};return s.jsx(ae,{children:s.jsxs(ae.Content,{className:Z("flex flex-col",g!=="org"&&"overflow-hidden"),children:[s.jsx("div",{className:"shrink-0 mx-auto w-full max-w-[1200px] px-4 md:px-10 pt-8 md:pt-12 pb-4",children:s.jsxs("div",{className:"flex flex-col gap-5",children:[s.jsx(ae.Title,{actions:N&&s.jsxs(s.Fragment,{children:[s.jsx(ce,{variant:"outline",size:"sm",onClick:e,disabled:E.isPending,children:o("settings.orgRoleDetail.cancel")}),s.jsx(ce,{size:"sm",onClick:b,disabled:E.isPending||!x||!A,children:E.isPending?o("settings.orgRoleDetail.saving"):o(_?"settings.orgRoleDetail.createRole":"settings.orgRoleDetail.saveChanges")})]}),children:s.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[s.jsx("div",{className:Z("size-2.5 rounded-full shrink-0",t.kind==="builtin"?gt(t.role,!0):Zt(u.watch("role.label")))}),d&&s.jsx(mt,{size:16,className:"text-muted-foreground shrink-0"}),_||t.kind==="custom"?s.jsx("input",{...u.register("role.label"),placeholder:o("settings.orgRoleDetail.roleName"),className:"leading-tight text-foreground bg-transparent border-none outline-none px-1 -mx-1 rounded hover:bg-input/25 focus:bg-input/25 transition-colors w-64 placeholder:text-muted-foreground/50",autoFocus:_}):s.jsx("span",{className:"truncate",children:P})]})}),a?s.jsx(s.Fragment,{children:s.jsx(Gt.Toolbar.Left.Portal,{children:s.jsx(ae.Tabs,{children:j.map(c=>s.jsx(ae.Tab,{active:g===c.id,onClick:()=>S(c.id),children:c.label},c.id))})})}):s.jsx(s.Fragment,{children:s.jsx("div",{className:"flex items-center gap-2",children:j.map(c=>s.jsx("button",{type:"button",onClick:()=>S(c.id),className:Z("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex items-center",g===c.id?"bg-accent border-border text-foreground":"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),children:c.label},c.id))})}),s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[s.jsx(He,{value:O,onChange:D,placeholder:p[g]??"Search...",className:"w-full md:w-[375px]"}),g==="members"&&s.jsx(il,{readOnly:t.kind==="builtin"&&t.role==="owner",onOpen:()=>C(!0)})]})]})}),s.jsx("div",{className:Z("mx-auto w-full max-w-[1200px] px-4 md:px-10 pb-6",g!=="org"&&"flex-1 min-h-0"),children:s.jsxs("div",{className:Z(g!=="org"&&"h-full overflow-hidden",g!=="models"&&g!=="projects"&&g!=="org"&&"border border-border rounded-xl bg-card"),children:[g==="mcp"&&!d&&s.jsx(Ns,{toolSet:u.watch("toolSet"),onToolSetChange:c=>u.setValue("toolSet",c,{shouldDirty:!0}),searchQuery:O}),g==="org"&&s.jsx(Cs,{allowAllStaticPermissions:u.watch("allowAllStaticPermissions"),staticPermissions:u.watch("staticPermissions"),onAllowAllChange:c=>u.setValue("allowAllStaticPermissions",c,{shouldDirty:!0}),onPermissionsChange:c=>u.setValue("staticPermissions",c,{shouldDirty:!0}),readOnly:d,searchQuery:O}),g==="models"&&s.jsx(zs,{allowAllModels:u.watch("allowAllModels"),modelSet:u.watch("modelSet"),onAllowAllChange:c=>u.setValue("allowAllModels",c,{shouldDirty:!0}),onModelSetChange:c=>u.setValue("modelSet",c,{shouldDirty:!0}),readOnly:d,searchQuery:O}),g==="projects"&&s.jsx(Hs,{allowAllProjects:u.watch("allowAllProjects"),projectSet:u.watch("projectSet"),onAllowAllChange:c=>u.setValue("allowAllProjects",c,{shouldDirty:!0}),onProjectSetChange:c=>u.setValue("projectSet",c,{shouldDirty:!0}),readOnly:d,searchQuery:O}),g==="members"&&s.jsx(el,{memberIds:u.watch("memberIds"),onMemberIdsChange:c=>u.setValue("memberIds",c,{shouldDirty:!0}),readOnly:t.kind==="builtin"&&(t.role==="owner"||t.role==="user"),readOnlyMessage:t.kind==="builtin"&&t.role==="user"?o("settings.orgRoleDetail.userIsDefaultRoleMessage"):o("settings.orgRoleDetail.ownerMembershipCannotBeChanged"),searchQuery:O,addMemberDialogOpen:I,onAddMemberDialogOpenChange:C})]})})]})})}function cl(t){return t.kind==="builtin"?`builtin-${t.role}`:t.kind==="custom"?`custom-${t.role.id}`:"new"}function dl(t){const e=X.c(6),{area:l,children:n}=t,{isPrivileged:i,loading:a,error:o}=Bt();let T;return e[0]!==l||e[1]!==n||e[2]!==o||e[3]!==i||e[4]!==a?(T=s.jsx(Ts,{granted:i,loading:a,error:o,area:l,children:n}),e[0]=l,e[1]=n,e[2]=o,e[3]=i,e[4]=a,e[5]=T):T=e[5],T}const ml=[{role:"owner",labelKey:"settings.roles.roleOwner"},{role:"admin",labelKey:"settings.roles.roleAdmin"},{role:"user",labelKey:"settings.roles.roleUser"}];function ul(){const t=X.c(129),e=at(),l=ie(),[n,i]=z.useState(""),[a,o]=z.useState(null),T=Yt();let m;t[0]===Symbol.for("react.memo_cache_sentinel")?(m={strict:!1},t[0]=m):m=t[0];const{role:r}=ut(m),{locator:h}=ke(),d=Qe(),_=ct(),{customRoles:g,refetch:f}=Ht();let u;t[1]!==T?(u=M=>T({to:".",search:v=>({...v,role:M})}),t[1]=T,t[2]=u):u=t[2];const x=u;let A;e:{if(!r){A=null;break e}if(r==="new"){A={kind:"new"};break e}if(r.startsWith("builtin-")){A={kind:"builtin",role:r.slice(8)};break e}let M;t[3]!==r?(M=ee=>ee.id===r,t[3]=r,t[4]=M):M=t[4];const v=g.find(M);A=v?{kind:"custom",role:v}:null}const E=A;let b;t[5]!==h?(b=me.members(h),t[5]=h,t[6]=b):b=t[6];let N;t[7]!==d?(N=()=>d.organization.listMembers(),t[7]=d,t[8]=N):N=t[8];let P;t[9]!==b||t[10]!==N?(P={queryKey:b,queryFn:N},t[9]=b,t[10]=N,t[11]=P):P=t[11];const{data:j}=ze(P);let O;t[12]!==j?.data?.members?(O=j?.data?.members??[],t[12]=j?.data?.members,t[13]=O):O=t[13];const D=O;let I;t[14]!==D?(I=M=>D.filter(v=>v.role===M).length,t[14]=D,t[15]=I):I=t[15];const C=I;let S;if(t[16]!==g||t[17]!==C||t[18]!==n||t[19]!==l){let M;t[21]!==C||t[22]!==l?(M=de=>({kind:"builtin",role:{...de,memberCount:C(de.role),label:l(de.labelKey)}}),t[21]=C,t[22]=l,t[23]=M):M=t[23];const v=ml.map(M);let ee;t[24]!==C?(ee=de=>({kind:"custom",role:{...de,memberCount:C(de.role)}}),t[24]=C,t[25]=ee):ee=t[25];const Pt=g.map(ee);if(S=[...v,...Pt],n){const de=n.toLowerCase();S=S.filter(Dt=>Dt.role.label.toLowerCase().includes(de))}t[16]=g,t[17]=C,t[18]=n,t[19]=l,t[20]=S}else S=t[20];let p;t[26]!==d?(p=async M=>{const v=await d.organization.deleteRole({roleId:M});if(v?.error)throw new Error(v.error.message);return v?.data},t[26]=d,t[27]=p):p=t[27];const c=dt({mutationFn:p,onSuccess:(M,v)=>{$e("role_deleted",{role_id:v}),_.invalidateQueries({queryKey:me.members(h)}),_.invalidateQueries({queryKey:me.organizationRoles(h)}),ye.success(l("settings.roles.deletedSuccessfully")),f(),E?.kind==="custom"&&E.role.id===v&&x(void 0)},onError:_l});let G;t[28]!==l?(G=l("settings.roles.columnRole"),t[28]=l,t[29]=G):G=t[29];let y;t[30]!==G?(y={id:"role",header:G,render:hl,cellClassName:"flex-1 min-w-0",sortable:!0},t[30]=G,t[31]=y):y=t[31];let K;t[32]!==l?(K=l("settings.roles.columnType"),t[32]=l,t[33]=K):K=t[33];let F;t[34]!==l?(F=M=>M.kind==="builtin"?s.jsx(we,{variant:"secondary",className:"text-xs",children:l("settings.roles.builtIn")}):s.jsx(we,{variant:"outline",className:"text-xs",children:l("settings.roles.custom")}),t[34]=l,t[35]=F):F=t[35];let V;t[36]!==K||t[37]!==F?(V={id:"type",header:K,render:F,cellClassName:"w-28 shrink-0"},t[36]=K,t[37]=F,t[38]=V):V=t[38];let U;t[39]!==l?(U=l("settings.roles.columnPermissions"),t[39]=l,t[40]=U):U=t[40];let k;t[41]!==l?(k=M=>{if(M.kind==="builtin")return M.role.role==="owner"||M.role.role==="admin"?s.jsx("span",{className:"text-sm text-muted-foreground",children:l("settings.roles.fullAccess")}):s.jsx("span",{className:"text-sm text-muted-foreground",children:l("settings.roles.basicAccess")});const v=M.role,ee=[];return v.allowsAllStaticPermissions?ee.push(l("settings.roles.fullOrgAccess")):v.staticPermissionCount&&v.staticPermissionCount>0&&ee.push(l("settings.roles.orgPermsCount",{count:v.staticPermissionCount})),v.allowsAllConnections?ee.push(l("settings.roles.allConnections")):v.connectionCount&&v.connectionCount>0&&ee.push(l("settings.roles.connectionCount",{count:v.connectionCount})),s.jsx("span",{className:"text-sm text-muted-foreground truncate",children:ee.length>0?ee.join(", "):l("settings.roles.noPermissions")})},t[41]=l,t[42]=k):k=t[42];let B;t[43]!==U||t[44]!==k?(B={id:"permissions",header:U,render:k,cellClassName:"flex-1 min-w-0"},t[43]=U,t[44]=k,t[45]=B):B=t[45];let $;t[46]!==l?($=l("settings.roles.columnMembers"),t[46]=l,t[47]=$):$=t[47];let L;t[48]!==$?(L={id:"members",header:$,render:Tl,cellClassName:"w-24 shrink-0"},t[48]=$,t[49]=L):L=t[49];let Y;t[50]!==l?(Y={id:"actions",header:"",render:M=>M.kind==="builtin"?null:s.jsxs(Ft,{children:[s.jsx(zt,{asChild:!0,children:s.jsx(ce,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:gl,children:s.jsx(qt,{size:16})})}),s.jsx($t,{align:"end",onClick:fl,children:s.jsxs(Qt,{variant:"destructive",onClick:()=>{const v=M.role;v.id&&o({id:v.id,label:v.label})},children:[s.jsx(Jt,{size:16}),l("settings.roles.delete")]})})]}),cellClassName:"w-12 shrink-0"},t[50]=l,t[51]=Y):Y=t[51];let W;t[52]!==y||t[53]!==V||t[54]!==B||t[55]!==L||t[56]!==Y?(W=[y,V,B,L,Y],t[52]=y,t[53]=V,t[54]=B,t[55]=L,t[56]=Y,t[57]=W):W=t[57];const le=W;let te;t[58]!==x?(te=M=>{if(M.kind==="builtin")x(`builtin-${M.role.role}`);else{const v=M.role;x(v.id)}},t[58]=x,t[59]=te):te=t[59];const Q=te;if(E){let M;t[60]!==x?(M=()=>x(void 0),t[60]=x,t[61]=M):M=t[61];let v;return t[62]!==f||t[63]!==x?(v=()=>{f(),x(void 0)},t[62]=f,t[63]=x,t[64]=v):v=t[64],s.jsx(rl,{target:E,onBack:M,onSaved:v},cl(E))}let q;t[65]!==l?(q=l("settings.roles.searchPlaceholder"),t[65]=l,t[66]=q):q=t[66];let R;t[67]===Symbol.for("react.memo_cache_sentinel")?(R=M=>{M.key==="Escape"&&(i(""),M.target.blur())},t[67]=R):R=t[67];let w;t[68]!==n||t[69]!==q?(w=s.jsx(He,{value:n,onChange:i,placeholder:q,className:"w-full md:w-[375px]",onKeyDown:R}),t[68]=n,t[69]=q,t[70]=w):w=t[70];const H=e?"sm":"default";let J;t[71]!==x?(J=()=>x("new"),t[71]=x,t[72]=J):J=t[72];let ne;t[73]===Symbol.for("react.memo_cache_sentinel")?(ne=s.jsx(Fe,{size:16}),t[73]=ne):ne=t[73];let se;t[74]!==l?(se=l("settings.roles.createRole"),t[74]=l,t[75]=se):se=t[75];let oe;t[76]!==H||t[77]!==J||t[78]!==se?(oe=s.jsx(ae.Actions,{children:s.jsxs(ce,{size:H,onClick:J,children:[ne,se]})}),t[76]=H,t[77]=J,t[78]=se,t[79]=oe):oe=t[79];let fe;t[80]!==w||t[81]!==oe?(fe=s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[w,oe]}),t[80]=w,t[81]=oe,t[82]=fe):fe=t[82];let ge;t[83]!==n||t[84]!==l?(ge=n?s.jsx(ot,{title:l("settings.roles.noRolesFound"),description:l("settings.roles.noRolesMatchSearch",{search:n})}):s.jsx(ot,{title:l("settings.roles.noRoles"),description:l("settings.roles.createRoleGetStarted")}),t[83]=n,t[84]=l,t[85]=ge):ge=t[85];let Te;t[86]!==S||t[87]!==le||t[88]!==Q||t[89]!==ge?(Te=s.jsx(Wt,{columns:le,data:S,isLoading:!1,onRowClick:Q,emptyState:ge}),t[86]=S,t[87]=le,t[88]=Q,t[89]=ge,t[90]=Te):Te=t[90];const Ve=a!==null;let Ge;t[91]===Symbol.for("react.memo_cache_sentinel")?(Ge=M=>!M&&o(null),t[91]=Ge):Ge=t[91];let he;t[92]!==l?(he=l("settings.roles.deleteRoleTitle"),t[92]=l,t[93]=he):he=t[93];let _e;t[94]!==he?(_e=s.jsx(_t,{children:he}),t[94]=he,t[95]=_e):_e=t[95];const Ke=a?.label??"";let xe;t[96]!==l||t[97]!==Ke?(xe=l("settings.roles.deleteRoleConfirm",{role:Ke}),t[96]=l,t[97]=Ke,t[98]=xe):xe=t[98];let pe;t[99]!==xe?(pe=s.jsx(xt,{children:xe}),t[99]=xe,t[100]=pe):pe=t[100];let Ee;t[101]!==_e||t[102]!==pe?(Ee=s.jsxs(pt,{children:[_e,pe]}),t[101]=_e,t[102]=pe,t[103]=Ee):Ee=t[103];let Ie;t[104]!==l?(Ie=l("settings.roles.cancel"),t[104]=l,t[105]=Ie):Ie=t[105];let Re;t[106]!==Ie?(Re=s.jsx(Et,{children:Ie}),t[106]=Ie,t[107]=Re):Re=t[107];let Se;t[108]!==c||t[109]!==a?(Se=()=>{a?.id&&c.mutate(a.id),o(null)},t[108]=c,t[109]=a,t[110]=Se):Se=t[110];let Ae;t[111]!==l?(Ae=l("settings.roles.delete"),t[111]=l,t[112]=Ae):Ae=t[112];let Ne;t[113]!==Se||t[114]!==Ae?(Ne=s.jsx(It,{onClick:Se,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Ae}),t[113]=Se,t[114]=Ae,t[115]=Ne):Ne=t[115];let Oe;t[116]!==Re||t[117]!==Ne?(Oe=s.jsxs(Rt,{children:[Re,Ne]}),t[116]=Re,t[117]=Ne,t[118]=Oe):Oe=t[118];let Ce;t[119]!==Ee||t[120]!==Oe?(Ce=s.jsxs(ht,{children:[Ee,Oe]}),t[119]=Ee,t[120]=Oe,t[121]=Ce):Ce=t[121];let be;t[122]!==Ve||t[123]!==Ce?(be=s.jsx(Tt,{open:Ve,onOpenChange:Ge,children:Ce}),t[122]=Ve,t[123]=Ce,t[124]=be):be=t[124];let Ue;return t[125]!==fe||t[126]!==Te||t[127]!==be?(Ue=s.jsxs(ft,{group:"members",className:"gap-6",children:[fe,Te,be]}),t[125]=fe,t[126]=Te,t[127]=be,t[128]=Ue):Ue=t[128],Ue}function fl(t){return t.stopPropagation()}function gl(t){return t.stopPropagation()}function Tl(t){return s.jsx("span",{className:"text-sm text-foreground",children:t.role.memberCount})}function hl(t){return s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:Z("size-2.5 rounded-full shrink-0",gt(t.role.role,t.kind==="builtin"))}),s.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:t.role.label}),t.kind==="builtin"&&s.jsx(mt,{size:12,className:"text-muted-foreground shrink-0"})]})}function _l(t,e){$e("role_delete_failed",{role_id:e,error:t instanceof Error?t.message:String(t)}),ye.error(t instanceof Error?t.message:"Failed to delete role")}function xl(){const t=X.c(13),e=ie();let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l={strict:!1},t[0]=l):l=t[0];const{role:n}=ut(l);let i;t[1]!==e?(i=e("settings.roles.failedToLoad"),t[1]=e,t[2]=i):i=t[2];let a;t[3]!==i?(a=s.jsx(ae,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("div",{className:"text-sm text-muted-foreground",children:i})})}),t[3]=i,t[4]=a):a=t[4];let o;t[5]!==n?(o=n?s.jsx(ae,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(je,{className:"size-8 text-muted-foreground"})})}):s.jsx(ft,{group:"members",className:"gap-6",children:s.jsx(Vt,{})}),t[5]=n,t[6]=o):o=t[6];let T;t[7]===Symbol.for("react.memo_cache_sentinel")?(T=s.jsx(ul,{}),t[7]=T):T=t[7];let m;t[8]!==o?(m=s.jsx(z.Suspense,{fallback:o,children:T}),t[8]=o,t[9]=m):m=t[9];let r;return t[10]!==a||t[11]!==m?(r=s.jsx(Kt,{fallback:a,children:m}),t[10]=a,t[11]=m,t[12]=r):r=t[12],r}function Yo(){const t=X.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(dl,{area:"roles",children:s.jsx(xl,{})}),t[0]=e):e=t[0],e}export{Yo as default};