decocms 4.149.3 → 4.149.4

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 (220) hide show
  1. package/dist/client/assets/{AlertCircle-DCV-J_17.js → AlertCircle-Cem6ePeU.js} +1 -1
  2. package/dist/client/assets/{AreaChart-4o5_QIMN.js → AreaChart-eUXp69My.js} +1 -1
  3. package/dist/client/assets/{ArrowUp-BlWwKW4L.js → ArrowUp-C2eUAqJf.js} +1 -1
  4. package/dist/client/assets/{ArrowUpRight-CJ_7mRw-.js → ArrowUpRight-DfJzPFvU.js} +1 -1
  5. package/dist/client/assets/{Check-qJLO8g4w.js → Check-Dyt2_0ga.js} +1 -1
  6. package/dist/client/assets/{CheckCircle-DUp67_eI.js → CheckCircle-B-XbmPy7.js} +1 -1
  7. package/dist/client/assets/{ChevronDown-3-gbZo8q.js → ChevronDown-D6KfEPdr.js} +1 -1
  8. package/dist/client/assets/{ChevronRight-CJOIJTmS.js → ChevronRight-DILmeK7M.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-B3CtolQ8.js → ChevronUp-Bmy1l0Py.js} +1 -1
  10. package/dist/client/assets/{Copy01-DOfL1Wyb.js → Copy01-USV1_HJa.js} +1 -1
  11. package/dist/client/assets/{DotsVertical-DpBcrugn.js → DotsVertical-BhuMjSRb.js} +1 -1
  12. package/dist/client/assets/{Eye-CK6s5DvS.js → Eye-DLI5NPy9.js} +1 -1
  13. package/dist/client/assets/{FilterLines-DzH0NKwR.js → FilterLines-5S8WKVB6.js} +1 -1
  14. package/dist/client/assets/{HardDrive-CwqHmUxc.js → HardDrive-DQfGmY_Q.js} +1 -1
  15. package/dist/client/assets/{Key01-CKSbFlEj.js → Key01-jW_JyKg4.js} +1 -1
  16. package/dist/client/assets/{LayoutLeft-CrFA9fWe.js → LayoutLeft-UdAY9lHL.js} +1 -1
  17. package/dist/client/assets/{LinkExternal01-BeqUZ5mh.js → LinkExternal01-CxFcmhCv.js} +1 -1
  18. package/dist/client/assets/{LogOut01-Cx0bCNIs.js → LogOut01-DvI1_F9a.js} +1 -1
  19. package/dist/client/assets/{Monitor01-BWjooWlk.js → Monitor01-zHncMHvK.js} +1 -1
  20. package/dist/client/assets/{Palette-B2ca0bVn.js → Palette-CLw6FxLo.js} +1 -1
  21. package/dist/client/assets/{Play-C68U-efL.js → Play-C0sf4kYZ.js} +1 -1
  22. package/dist/client/assets/{Plus-B8mhYaf-.js → Plus-DmVmPu15.js} +1 -1
  23. package/dist/client/assets/{SearchLg-CcqZwpgI.js → SearchLg-mmh32yOh.js} +1 -1
  24. package/dist/client/assets/{SearchMd-BoHX07tM.js → SearchMd-BV0JzQs2.js} +1 -1
  25. package/dist/client/assets/{Settings02-CQm8x-Mo.js → Settings02-D-zT1K0J.js} +1 -1
  26. package/dist/client/assets/{Shield01-BZ0gGCjQ.js → Shield01-DaH6VmhZ.js} +1 -1
  27. package/dist/client/assets/{Star01-b9CKRdDr.js → Star01-CTYXgmts.js} +1 -1
  28. package/dist/client/assets/{Stars01-DBbpvSkt.js → Stars01-D42-h5Va.js} +1 -1
  29. package/dist/client/assets/{Stars02-CEkp7b-G.js → Stars02-D936Q5vu.js} +1 -1
  30. package/dist/client/assets/{Sun-tN9skZqx.js → Sun-SO-tAlk7.js} +1 -1
  31. package/dist/client/assets/{SwitchHorizontal01-CX0zzRKH.js → SwitchHorizontal01-DRBzItNZ.js} +1 -1
  32. package/dist/client/assets/{Tool01-J1ZnkFdg.js → Tool01-BhOhq1Lq.js} +1 -1
  33. package/dist/client/assets/{Tool02-CAeGe_oA.js → Tool02-CCtBgqj3.js} +1 -1
  34. package/dist/client/assets/{Trash01-DimX9kYZ.js → Trash01-BNbLXf93.js} +1 -1
  35. package/dist/client/assets/{TrendUp01-CDPaEeJa.js → TrendUp01-CiD1se1i.js} +1 -1
  36. package/dist/client/assets/{Upload01-B6ohqCNy.js → Upload01-BE-MvOgE.js} +1 -1
  37. package/dist/client/assets/{User01-DyigsrSz.js → User01-Bq5KW4vO.js} +1 -1
  38. package/dist/client/assets/{Users01-P5l8QOnd.js → Users01-CiMe0bfz.js} +1 -1
  39. package/dist/client/assets/{Users03-_2DmtKO7.js → Users03-Jpb3Rs6p.js} +1 -1
  40. package/dist/client/assets/{X-Bb4zY2_f.js → X-Cvof5f1Z.js} +1 -1
  41. package/dist/client/assets/{XCircle-CsSTNWPK.js → XCircle-BDBptK5c.js} +1 -1
  42. package/dist/client/assets/{XClose-BcoCd49U.js → XClose-CS8UpX89.js} +1 -1
  43. package/dist/client/assets/{Zap-Ba39SNX5.js → Zap-NmQQQZMA.js} +1 -1
  44. package/dist/client/assets/{ZapSquare-BtQYmRZ9.js → ZapSquare-DXB9EHwI.js} +1 -1
  45. package/dist/client/assets/{access-gate-DsDJYJZV.js → access-gate-CbW94wEf.js} +1 -1
  46. package/dist/client/assets/{add-section-modal-Dju3VdVM.js → add-section-modal-Bk3Oe2RT.js} +1 -1
  47. package/dist/client/assets/{agent-icon-dfCTMRkW.js → agent-icon-DCuaG5nE.js} +1 -1
  48. package/dist/client/assets/{agents-list-DT63BWyV.js → agents-list-DdAi-Yry.js} +1 -1
  49. package/dist/client/assets/{ai-providers-CKNR4ej6.js → ai-providers-fHhP762R.js} +1 -1
  50. package/dist/client/assets/{alert-CVSN7Bm8.js → alert-CUOdafoW.js} +1 -1
  51. package/dist/client/assets/{alert-dialog-nUW7phRB.js → alert-dialog-DegRzpzC.js} +1 -1
  52. package/dist/client/assets/{app-editor-CKC8Hoa1.js → app-editor-CE4GU1zo.js} +1 -1
  53. package/dist/client/assets/{auth-catchall-CWGo7UBJ.js → auth-catchall-BFK7E1pJ.js} +1 -1
  54. package/dist/client/assets/{auth-entry-Bx4WiEa3.js → auth-entry-BwVmvJ3X.js} +1 -1
  55. package/dist/client/assets/{auth-DuesnJ3t.js → auth-njKnK4H1.js} +1 -1
  56. package/dist/client/assets/{auth-split-layout-CgefhgE9.js → auth-split-layout-liW-Nrmb.js} +1 -1
  57. package/dist/client/assets/{authenticate-and-persist-oauth-Dgw0_gxc.js → authenticate-and-persist-oauth-QBHD9BB_.js} +1 -1
  58. package/dist/client/assets/{automation-list-row-CyTbS1So.js → automation-list-row-D0RC9AH1.js} +1 -1
  59. package/dist/client/assets/{automation-runs-C0ZOyXG3.js → automation-runs-CvtFUnmv.js} +1 -1
  60. package/dist/client/assets/{automations-BEg5iRbe.js → automations-DJt2joIh.js} +1 -1
  61. package/dist/client/assets/{avatar-DzM4poL0.js → avatar-lulgkVBD.js} +1 -1
  62. package/dist/client/assets/{badge-Dq0vpO1O.js → badge-X6hr_bP1.js} +1 -1
  63. package/dist/client/assets/{block-document-BFH2Px7h.js → block-document-rRRPfL2F.js} +1 -1
  64. package/dist/client/assets/{brand-context-BwDrJEm5.js → brand-context-CeGOX_AV.js} +1 -1
  65. package/dist/client/assets/{buckets-zcb9jEMz.js → buckets-DmNQbiTG.js} +1 -1
  66. package/dist/client/assets/{bulk-category-panel-CEsqU29t.js → bulk-category-panel-C7P16qHU.js} +1 -1
  67. package/dist/client/assets/{calendar-uC55ym82.js → calendar-CD5nT3ox.js} +1 -1
  68. package/dist/client/assets/{capability-load-error-tYGfRV_T.js → capability-load-error-B3z7rQwl.js} +1 -1
  69. package/dist/client/assets/{card-By2Ftpqp.js → card-K9NXEEZ3.js} +1 -1
  70. package/dist/client/assets/{category-editor-DIYBCzVI.js → category-editor-DctkYND3.js} +1 -1
  71. package/dist/client/assets/{chat-context-Dq62Fbos.js → chat-context-DE138twl.js} +1 -1
  72. package/dist/client/assets/{checkbox-DPh66MwY.js → checkbox-BAZ2VUBa.js} +1 -1
  73. package/dist/client/assets/{cli-auth-success-BJv9WFxD.js → cli-auth-success-DrqfNzua.js} +1 -1
  74. package/dist/client/assets/{collection-detail-C6G20fcE.js → collection-detail-Ba6zN7Zl.js} +1 -1
  75. package/dist/client/assets/{collection-display-button-Z8-mPncU.js → collection-display-button-B14rVoQg.js} +1 -1
  76. package/dist/client/assets/{collection-search-CsezHOBI.js → collection-search-mxPX78OM.js} +1 -1
  77. package/dist/client/assets/{collection-table-wrapper-CUrV0vvM.js → collection-table-wrapper-Bkd7YWxQ.js} +1 -1
  78. package/dist/client/assets/{collection-tabs-CDebuN4_.js → collection-tabs-DsjmXCy-.js} +1 -1
  79. package/dist/client/assets/{command-CrmRZzqe.js → command-B46E7rrG.js} +1 -1
  80. package/dist/client/assets/{commerce-onboarding-DMrmVsQQ.js → commerce-onboarding-qvsyKJ8s.js} +1 -1
  81. package/dist/client/assets/{companions-core-BjX3dRag.js → companions-core-CqeGIV51.js} +1 -1
  82. package/dist/client/assets/{connect-DokClhA1.js → connect-CphvQ4wI.js} +1 -1
  83. package/dist/client/assets/{connection-BI_qURfG.js → connection-CMjbZsyl.js} +1 -1
  84. package/dist/client/assets/{connection-card-Je9fGr_D.js → connection-card-XHraSHoo.js} +1 -1
  85. package/dist/client/assets/{connection-detail-DDmX4c7f.js → connection-detail-D8QT7TNK.js} +1 -1
  86. package/dist/client/assets/{connection-form-helpers-DeHqNHEG.js → connection-form-helpers-oVBbFTiT.js} +1 -1
  87. package/dist/client/assets/{connections-C6VaPq5Y.js → connections-DoS9utJq.js} +1 -1
  88. package/dist/client/assets/{decopilot-sse-pool-DF2dyY7L.js → decopilot-sse-pool-boA36psC.js} +1 -1
  89. package/dist/client/assets/{dialog-C35xFAax.js → dialog-Pi_xgHC0.js} +1 -1
  90. package/dist/client/assets/{domain-settings-D0QKeLfw.js → domain-settings-X-ltER7d.js} +1 -1
  91. package/dist/client/assets/{drawer-DSvvDd5I.js → drawer-EWP6-H-C.js} +1 -1
  92. package/dist/client/assets/{dropdown-menu-Bvkevh-y.js → dropdown-menu-CXH88k_k.js} +1 -1
  93. package/dist/client/assets/{empty-state-CPUkCVkl.js → empty-state-CsvH74tC.js} +1 -1
  94. package/dist/client/assets/{extract-connection-data-D61ZU_rY.js → extract-connection-data-DAPoTrnj.js} +1 -1
  95. package/dist/client/assets/{file-explorer-CJE8KGRH.js → file-explorer-C0TKY3ZH.js} +1 -1
  96. package/dist/client/assets/{form-B2wEFCds.js → form-zuTrl1XI.js} +1 -1
  97. package/dist/client/assets/{general-7-W3ReTB.js → general-S5-VFfo3.js} +1 -1
  98. package/dist/client/assets/{github-repo-picker-aJ_szzF7.js → github-repo-picker-D1KIwdhu.js} +1 -1
  99. package/dist/client/assets/{hooks-DKTnjQ7p.js → hooks-Dj4UYQoq.js} +1 -1
  100. package/dist/client/assets/{index-1MK4_xnA.js → index-5hW5oe3V.js} +1 -1
  101. package/dist/client/assets/{index-BUFbCCKt.js → index-B3wdQaZS.js} +1 -1
  102. package/dist/client/assets/{index-Dp3D61B6.js → index-BBstqQhT.js} +1 -1
  103. package/dist/client/assets/{index-_X8Hu152.js → index-CKHQvX6y.js} +5 -5
  104. package/dist/client/assets/{index-CpB-IlaU.js → index-CjF26QCG.js} +3 -3
  105. package/dist/client/assets/index-DAcffUvI.js +8 -0
  106. package/dist/client/assets/{index-DD4yxjnF.js → index-Dg5X15-s.js} +1 -1
  107. package/dist/client/assets/{index-UjzAqu9a.js → index-DpxOAuT-.js} +1 -1
  108. package/dist/client/assets/{index-UMCVtGoa.js → index-FbgXWMub.js} +1 -1
  109. package/dist/client/assets/{index-dIdebTuj.js → index-JHgS_7cQ.js} +1 -1
  110. package/dist/client/assets/{index-DLbh8nXf.js → index-WUBDU1FB.js} +1 -1
  111. package/dist/client/assets/{index-redirect-DzA1VdGX.js → index-redirect-B6vefq92.js} +1 -1
  112. package/dist/client/assets/{input-d_-U8Dix.js → input-IDFu6vm5.js} +1 -1
  113. package/dist/client/assets/{integration-icon-CVpCqCkL.js → integration-icon-CVSw-anG.js} +1 -1
  114. package/dist/client/assets/{invite-member-dialog--nCU6Y0Q.js → invite-member-dialog-BDb4qLWt.js} +1 -1
  115. package/dist/client/assets/{label-COIo3JhO.js → label-BuF4MPfP.js} +1 -1
  116. package/dist/client/assets/{layout--AGh5VKe.js → layout-DQ9DEg_C.js} +1 -1
  117. package/dist/client/assets/{login-C_jjURjk.js → login-CY92pUHI.js} +1 -1
  118. package/dist/client/assets/{mcp-oauth-BVFmcwr5.js → mcp-oauth-D2KZ3LUV.js} +1 -1
  119. package/dist/client/assets/{members-DeZ029Iq.js → members-sfEjr02q.js} +1 -1
  120. package/dist/client/assets/{monaco-editor-D9qPRIzl.js → monaco-editor-8X3kMk2i.js} +1 -1
  121. package/dist/client/assets/{monitoring-stats-row-DdLVibYe.js → monitoring-stats-row-Bm_bwn8F.js} +1 -1
  122. package/dist/client/assets/{multi-select-DuWhKen8.js → multi-select-C0BUOFQc.js} +1 -1
  123. package/dist/client/assets/{oauth-callback-DvtVRzgD.js → oauth-callback-BDX83GPd.js} +1 -1
  124. package/dist/client/assets/{oauth-callback-ai-provider-DbXvFhcI.js → oauth-callback-ai-provider-B-OL5Oa2.js} +1 -1
  125. package/dist/client/assets/{onboarding-Bq71rgvk.js → onboarding-D7REgMR-.js} +1 -1
  126. package/dist/client/assets/{org-install-DNHnYiu7.js → org-install-rC6F7bBI.js} +1 -1
  127. package/dist/client/assets/{org-layout-fxNEOaXk.js → org-layout-BI7ruwed.js} +1 -1
  128. package/dist/client/assets/{organization-choice-DMLt4JYU.js → organization-choice-BKiHG2hM.js} +1 -1
  129. package/dist/client/assets/{orgs-m75GBcFO.js → orgs-COTFB_t_.js} +1 -1
  130. package/dist/client/assets/{page-seo-form-DYXIHsX2.js → page-seo-form-D-9GA6jy.js} +1 -1
  131. package/dist/client/assets/{popover-C5wy-cA4.js → popover-JRycFW6L.js} +1 -1
  132. package/dist/client/assets/{post-editor-DG8uKeD_.js → post-editor-DlyzsB4C.js} +1 -1
  133. package/dist/client/assets/{primitives-CXWzNxwl.js → primitives-AUy2V9a6.js} +1 -1
  134. package/dist/client/assets/{profile-CLWJOyrN.js → profile-CnZUfcnQ.js} +1 -1
  135. package/dist/client/assets/project-app-view-BH4FvNdJ.js +1 -0
  136. package/dist/client/assets/record-editor-Dbv_2fCT.js +1 -0
  137. package/dist/client/assets/{redirect-editor-DByf9Hd-.js → redirect-editor-pbJvqMWG.js} +1 -1
  138. package/dist/client/assets/registry-jvTUyBpU.js +2 -0
  139. package/dist/client/assets/{registry-layout-Dkqycgq-.js → registry-layout-CymF3LMI.js} +1 -1
  140. package/dist/client/assets/{reports-CfkBm7aH.js → reports-BWBEMqGv.js} +1 -1
  141. package/dist/client/assets/{require-capability-CwWZRwbh.js → require-capability-Dqpucqyz.js} +1 -1
  142. package/dist/client/assets/{required-auth-layout-V20CMUEy.js → required-auth-layout-DB8umWNL.js} +1 -1
  143. package/dist/client/assets/{reset-password-CwBtSk7M.js → reset-password-B14X8hFz.js} +1 -1
  144. package/dist/client/assets/{roles-ap1OrJxI.js → roles-1AgaZ90j.js} +1 -1
  145. package/dist/client/assets/{search-input-0aFemSaC.js → search-input-CC86MHPM.js} +1 -1
  146. package/dist/client/assets/{secrets-ChJjKPOt.js → secrets-JCPTiDma.js} +1 -1
  147. package/dist/client/assets/{sections-editor-CyyZzqz7.js → sections-editor-COCqEl95.js} +1 -1
  148. package/dist/client/assets/{select-lph10Txc.js → select-CYXr2k1e.js} +1 -1
  149. package/dist/client/assets/{select-model-Bj885jOc.js → select-model-O_LgvrNh.js} +1 -1
  150. package/dist/client/assets/{self-tool-result-MFBkD0_q.js → self-tool-result-fmpw3BpA.js} +1 -1
  151. package/dist/client/assets/{seo-editor-CcobaQNX.js → seo-editor-BQw3qwj0.js} +1 -1
  152. package/dist/client/assets/{settings-layout-CWL8UH3n.js → settings-layout-DR4sDh-a.js} +1 -1
  153. package/dist/client/assets/{settings-section-DFb19YyU.js → settings-section-CQn6aKZC.js} +1 -1
  154. package/dist/client/assets/{shell-controls-C5rbO6lk.js → shell-controls-6ljtijs2.js} +1 -1
  155. package/dist/client/assets/{shell-layout-BUCFxsPz.js → shell-layout-hVA8oTRe.js} +1 -1
  156. package/dist/client/assets/{sidebar-LfWRhUzl.js → sidebar-C8SHXIOH.js} +1 -1
  157. package/dist/client/assets/{skeleton-TLHNqNsZ.js → skeleton-CVuAFcA8.js} +1 -1
  158. package/dist/client/assets/{sso-BEn4hNCx.js → sso-CGjLmOAn.js} +1 -1
  159. package/dist/client/assets/{store-D1bCZhBr.js → store-Dns-mqtV.js} +1 -1
  160. package/dist/client/assets/store-registry-q1s_IA8O.js +2 -0
  161. package/dist/client/assets/{studio-tools-D5VF1LfT.js → studio-tools-Cinrb_dT.js} +1 -1
  162. package/dist/client/assets/{switch-YFaKLIre.js → switch-CUY_GjpD.js} +1 -1
  163. package/dist/client/assets/{tab-id-Dcig-y_b.js → tab-id-ChQ_Nf-x.js} +1 -1
  164. package/dist/client/assets/{table-BJpE1-_1.js → table-CHmBCOra.js} +1 -1
  165. package/dist/client/assets/{tabs-BW1O983z.js → tabs-Ck0IiC4A.js} +1 -1
  166. package/dist/client/assets/{textarea-DGduoLl0.js → textarea-2SjkctT-.js} +1 -1
  167. package/dist/client/assets/{toggle-group-C54zcybT.js → toggle-group-D-W6Cfqy.js} +1 -1
  168. package/dist/client/assets/{toolbar-D9Mu1f21.js → toolbar-CzMwHqoE.js} +1 -1
  169. package/dist/client/assets/{tooltip-DIgwzaVn.js → tooltip-DASp4d0o.js} +1 -1
  170. package/dist/client/assets/{use-ai-providers-EGRXEeM0.js → use-ai-providers-CYR9cqcD.js} +1 -1
  171. package/dist/client/assets/{use-automations-BiKKZ5DB.js → use-automations-CFGJtaJi.js} +1 -1
  172. package/dist/client/assets/{use-autosave-CyFOk-3c.js → use-autosave-CjPCze4P.js} +1 -1
  173. package/dist/client/assets/{use-capability-DBGC11nS.js → use-capability-CvjJL9co.js} +1 -1
  174. package/dist/client/assets/{use-clock-tick-D_qXyi-a.js → use-clock-tick-saad32Ii.js} +1 -1
  175. package/dist/client/assets/{use-connection-DZ9yH8AT.js → use-connection-CxlwOHmS.js} +1 -1
  176. package/dist/client/assets/{use-copy-Cgp1WREv.js → use-copy-CH4yzWsd.js} +1 -1
  177. package/dist/client/assets/{use-create-virtual-mcp-Csg7y6O0.js → use-create-virtual-mcp-Bq7hkoso.js} +1 -1
  178. package/dist/client/assets/{use-debounced-autosave-DKkHA0__.js → use-debounced-autosave-J6WpwdLn.js} +1 -1
  179. package/dist/client/assets/{use-debounced-value-CbBPU7zd.js → use-debounced-value-DmKXCTEI.js} +1 -1
  180. package/dist/client/assets/{use-deco-credits-BTyCYUEI.js → use-deco-credits-Bvs8MgnA.js} +1 -1
  181. package/dist/client/assets/{use-decopilot-events-CoPRmIh1.js → use-decopilot-events---My6CTP.js} +1 -1
  182. package/dist/client/assets/{use-delete-connection-_Rvwmzkz.js → use-delete-connection-BMpSJvba.js} +1 -1
  183. package/dist/client/assets/{use-deployment-admin-Bdv9ISo-.js → use-deployment-admin-5G1LPB1d.js} +1 -1
  184. package/dist/client/assets/{use-file-configs-f4stKVI8.js → use-file-configs-SWmwhE7u.js} +1 -1
  185. package/dist/client/assets/{use-infinite-scroll-Cjxmjx6A.js → use-infinite-scroll-BKPCQUiM.js} +1 -1
  186. package/dist/client/assets/{use-join-requests-CeLDT3kg.js → use-join-requests-DbLKzMbz.js} +1 -1
  187. package/dist/client/assets/{use-mcp-auth-status-DZSlpAEm.js → use-mcp-auth-status-DF1Y9mBA.js} +1 -1
  188. package/dist/client/assets/{use-mcp-client-nWQQesMe.js → use-mcp-client-BGlPrg7w.js} +1 -1
  189. package/dist/client/assets/{use-mcp-tools-DszGK-_z.js → use-mcp-tools-rAYUC4rV.js} +1 -1
  190. package/dist/client/assets/{use-members-fLGpkGSl.js → use-members-6WuLtpPb.js} +1 -1
  191. package/dist/client/assets/{use-mobile-Z2zaMHdo.js → use-mobile-rYfTSvFb.js} +1 -1
  192. package/dist/client/assets/{use-navigate-to-agent-DuvGIrZp.js → use-navigate-to-agent-kFHXJGki.js} +1 -1
  193. package/dist/client/assets/{use-org-auth-client-B4AXfjB6.js → use-org-auth-client-YfI11Izs.js} +1 -1
  194. package/dist/client/assets/{use-org-sso-Dj03JEgE.js → use-org-sso-DF0HSba8.js} +1 -1
  195. package/dist/client/assets/{use-organization-roles-1OcndSR7.js → use-organization-roles-CakjCh04.js} +1 -1
  196. package/dist/client/assets/{use-organization-settings-CRMcF-sH.js → use-organization-settings-DytCiPyY.js} +1 -1
  197. package/dist/client/assets/{use-registry-connections-BUZ4K3em.js → use-registry-connections-C6iHTOsi.js} +1 -1
  198. package/dist/client/assets/{use-secrets-Dv5Alqqh.js → use-secrets-5rkcyWSN.js} +1 -1
  199. package/dist/client/assets/{use-status-sounds-mFeaoy3i.js → use-status-sounds-BoAmb66E.js} +1 -1
  200. package/dist/client/assets/{use-tags-4lM6_uxA.js → use-tags-Cm5qRjFb.js} +1 -1
  201. package/dist/client/assets/{use-view-mode-DkR4rAMi.js → use-view-mode-C09g_1Ul.js} +1 -1
  202. package/dist/client/assets/{use-virtual-mcp-BWv80DLH.js → use-virtual-mcp-DZ1qOoD6.js} +1 -1
  203. package/dist/client/assets/useInfiniteQuery-D8Y9iE3e.js +1 -0
  204. package/dist/client/assets/{useQueries-BHykKmN9.js → useQueries-dlQFGrcQ.js} +1 -1
  205. package/dist/client/assets/{useRouterState-CIzA3viz.js → useRouterState-lpGvmBN8.js} +1 -1
  206. package/dist/client/assets/useSuspenseInfiniteQuery-Bh9Im6EJ.js +1 -0
  207. package/dist/client/assets/{users-DHCJC9Zu.js → users-BcKjWTBq.js} +1 -1
  208. package/dist/client/assets/{variant-calendar-Bs_8SibF.js → variant-calendar-YZNIRuQz.js} +1 -1
  209. package/dist/client/assets/{view-mode-toggle-BAAe34Q5.js → view-mode-toggle-Bt6zgi1l.js} +1 -1
  210. package/dist/client/index.html +1 -1
  211. package/dist/server/cli.js +1 -1
  212. package/dist/server/server.js +1 -1
  213. package/package.json +1 -1
  214. package/dist/client/assets/index-CtpeLpoX.js +0 -8
  215. package/dist/client/assets/project-app-view-D45FUhON.js +0 -1
  216. package/dist/client/assets/record-editor-CSkH0gmr.js +0 -1
  217. package/dist/client/assets/registry-B0eVM6t4.js +0 -2
  218. package/dist/client/assets/store-registry-Boslb8E0.js +0 -2
  219. package/dist/client/assets/useInfiniteQuery-DK5SQ5J_.js +0 -1
  220. package/dist/client/assets/useSuspenseInfiniteQuery-ZdkbsRBz.js +0 -1
@@ -1,2 +1,2 @@
1
- import{c as se,b as Me,r as u,j as r,k as fe,B as De,d_ as Jt,ay as Zt,aE as xe,d$ as en,e0 as tn,e1 as nn,e2 as rn,bI as on,e3 as sn,e4 as lt,aA as an,e5 as ln,e6 as cn,e7 as dn,e8 as un,e9 as fn,ea as pn,eb as mn,ec as xn,ed as hn,m as le,o as gn,t as ne,K as Ze}from"./index-CpB-IlaU.js";import{F as bn,l as yn}from"./monaco-editor-D9qPRIzl.js";import{D as vn,f as Cn,a_ as wn,a$ as Nn}from"./agent-icon-dfCTMRkW.js";import{s as jn}from"./XClose-BcoCd49U.js";import{n as En}from"./automation-runs-C0ZOyXG3.js";import{c as et,T as tt,a as nt}from"./tooltip-DIgwzaVn.js";import{a as Sn}from"./chat-context-Dq62Fbos.js";import{u as Dn}from"./shell-layout-BUCFxsPz.js";import{i as Mn,E as Rn,a as Ae,b as Tn,f as Pn,g as kn,c as Fn,t as re,d as we,e as Le,h as Ne,j as Oe,k as Ie,l as An,s as Ln,v as On,m as $e,n as je,o as rt,p as In,q as Ee,r as Ke,w as $n,x as Kn,y as zn,z as _n}from"./index-_X8Hu152.js";import{b as Gn,h as Bn,a as Vn,c as Un,d as Hn,e as qn}from"./dialog-C35xFAax.js";import{I as ot}from"./input-d_-U8Dix.js";import{c as Wn,d as Qn,b as Xn,f as Yn,g as Jn,e as Zn,a as er,A as tr}from"./alert-dialog-nUW7phRB.js";import{t as nr}from"./ChevronDown-3-gbZo8q.js";import{i as rr}from"./ChevronRight-CJOIJTmS.js";import"./delay-CnY5UFtP.js";import"./AlertCircle-DCV-J_17.js";import"./Tool01-J1ZnkFdg.js";import"./ArrowUp-BlWwKW4L.js";import"./Settings02-CQm8x-Mo.js";import"./Tool02-CAeGe_oA.js";import"./XCircle-CsSTNWPK.js";import"./ArrowUpRight-CJ_7mRw-.js";import"./TrendUp01-CDPaEeJa.js";import"./ZapSquare-BtQYmRZ9.js";import"./Users03-_2DmtKO7.js";import"./CheckCircle-DUp67_eI.js";import"./Check-qJLO8g4w.js";import"./ChevronUp-B3CtolQ8.js";import"./DotsVertical-DpBcrugn.js";import"./Stars02-CEkp7b-G.js";import"./Copy01-DOfL1Wyb.js";import"./Eye-CK6s5DvS.js";import"./FilterLines-DzH0NKwR.js";import"./Star01-b9CKRdDr.js";import"./Palette-B2ca0bVn.js";import"./SwitchHorizontal01-CX0zzRKH.js";import"./HardDrive-CwqHmUxc.js";import"./Key01-CKSbFlEj.js";import"./LayoutLeft-CrFA9fWe.js";import"./LinkExternal01-BeqUZ5mh.js";import"./LogOut01-Cx0bCNIs.js";import"./Monitor01-BWjooWlk.js";import"./Sun-tN9skZqx.js";import"./Play-C68U-efL.js";import"./Plus-B8mhYaf-.js";import"./SearchLg-CcqZwpgI.js";import"./SearchMd-BoHX07tM.js";import"./Shield01-BZ0gGCjQ.js";import"./Stars01-DBbpvSkt.js";import"./Trash01-DimX9kYZ.js";import"./Upload01-B6ohqCNy.js";import"./User01-DyigsrSz.js";import"./Users01-P5l8QOnd.js";import"./X-Bb4zY2_f.js";import"./Zap-Ba39SNX5.js";import"./select-lph10Txc.js";import"./useInfiniteQuery-DK5SQ5J_.js";import"./use-infinite-scroll-Cjxmjx6A.js";import"./use-connection-DZ9yH8AT.js";import"./use-mcp-client-nWQQesMe.js";import"./auth-DuesnJ3t.js";import"./use-virtual-mcp-BWv80DLH.js";import"./card-By2Ftpqp.js";import"./sidebar-LfWRhUzl.js";import"./use-mobile-Z2zaMHdo.js";import"./table-BJpE1-_1.js";import"./empty-state-CPUkCVkl.js";import"./use-members-fLGpkGSl.js";import"./use-org-auth-client-B4AXfjB6.js";import"./use-clock-tick-D_qXyi-a.js";import"./use-automations-BiKKZ5DB.js";import"./studio-tools-D5VF1LfT.js";import"./useSuspenseInfiniteQuery-ZdkbsRBz.js";import"./avatar-DzM4poL0.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-Cgp1WREv.js";import"./tab-id-Dcig-y_b.js";import"./hooks-DKTnjQ7p.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-DF2dyY7L.js";import"./index-UMCVtGoa.js";import"./calendar-uC55ym82.js";import"./integration-icon-CVpCqCkL.js";import"./use-navigate-to-agent-DuvGIrZp.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-4o5_QIMN.js";import"./form-B2wEFCds.js";import"./label-COIo3JhO.js";import"./use-ai-providers-EGRXEeM0.js";import"./use-decopilot-events-CoPRmIh1.js";import"./use-organization-settings-CRMcF-sH.js";import"./required-auth-layout-V20CMUEy.js";import"./use-org-sso-Dj03JEgE.js";import"./drawer-DSvvDd5I.js";import"./collection-search-CsezHOBI.js";import"./index-CtpeLpoX.js";import"./get-initials-D-f_fDFw.js";import"./popover-C5wy-cA4.js";import"./dropdown-menu-Bvkevh-y.js";import"./github-repo-picker-aJ_szzF7.js";import"./use-debounced-value-CbBPU7zd.js";import"./authenticate-and-persist-oauth-Dgw0_gxc.js";import"./mcp-oauth-BVFmcwr5.js";import"./use-mcp-tools-DszGK-_z.js";import"./extract-connection-data-D61ZU_rY.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-DWINBxtd.js";import"./use-tags-4lM6_uxA.js";import"./command-CrmRZzqe.js";import"./index-BUFbCCKt.js";import"./companions-core-BjX3dRag.js";import"./tabs-BW1O983z.js";import"./toggle-group-C54zcybT.js";import"./use-deco-credits-BTyCYUEI.js";import"./toolbar-D9Mu1f21.js";import"./skeleton-TLHNqNsZ.js";import"./agent-capabilities-cXfbMfjV.js";import"./connection-card-Je9fGr_D.js";import"./use-registry-connections-BUZ4K3em.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-DGduoLl0.js";import"./connection-form-helpers-DeHqNHEG.js";import"./collection-tabs-CDebuN4_.js";import"./badge-Dq0vpO1O.js";import"./select-model-Bj885jOc.js";import"./checkbox-DPh66MwY.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-DFb19YyU.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-mFeaoy3i.js";import"./deco-site-production-url-CaKZ7xBn.js";import"./use-capability-DBGC11nS.js";import"./pt-BR-CLy76QW2.js";import"./use-mcp-auth-status-DZSlpAEm.js";import"./use-debounced-autosave-DKkHA0__.js";import"./index-1MK4_xnA.js";import"./search-input-0aFemSaC.js";import"./switch-YFaKLIre.js";import"./use-secrets-Dv5Alqqh.js";import"./useQueries-BHykKmN9.js";import"./use-file-configs-f4stKVI8.js";import"./automation-list-row-CyTbS1So.js";const or={"new-file":{titleKey:"sandbox.fileExplorerNameDialog.newFileTitle",descriptionKey:"sandbox.fileExplorerNameDialog.newFileDescription",submitKey:"sandbox.fileExplorerNameDialog.newFileSubmit",placeholderKey:"sandbox.fileExplorerNameDialog.newFilePlaceholder"},"new-folder":{titleKey:"sandbox.fileExplorerNameDialog.newFolderTitle",descriptionKey:"sandbox.fileExplorerNameDialog.newFolderDescription",submitKey:"sandbox.fileExplorerNameDialog.newFolderSubmit",placeholderKey:"sandbox.fileExplorerNameDialog.newFolderPlaceholder"},rename:{titleKey:"sandbox.fileExplorerNameDialog.renameTitle",descriptionKey:"sandbox.fileExplorerNameDialog.renameDescription",submitKey:"sandbox.fileExplorerNameDialog.renameSubmit",placeholderKey:"sandbox.fileExplorerNameDialog.renamePlaceholder"}};function sr(i){const e=se.c(71),{open:s,mode:a,initialName:l,parentLabel:m,isPending:h,onSubmit:f,onOpenChange:v}=i,j=l===void 0?"":l,d=h===void 0?!1:h,x=Me(),[g,k]=u.useState(j),[Z,q]=u.useState(s),y=or[a];s!==Z&&(q(s),s&&k(j));let b;e[0]!==d||e[1]!==v?(b=_=>{!_&&!d&&v(!1)},e[0]=d,e[1]=v,e[2]=b):b=e[2];const F=b;let A;e[3]!==d||e[4]!==g||e[5]!==f?(A=async _=>{_.preventDefault();const te=g.trim();!te||d||await f(te)},e[3]=d,e[4]=g,e[5]=f,e[6]=A):A=e[6];const I=A;let S;e[7]!==y.titleKey||e[8]!==x?(S=x(y.titleKey),e[7]=y.titleKey,e[8]=x,e[9]=S):S=e[9];let P;e[10]!==S?(P=r.jsx(Gn,{children:S}),e[10]=S,e[11]=P):P=e[11];let D;e[12]!==y.descriptionKey||e[13]!==x?(D=x(y.descriptionKey),e[12]=y.descriptionKey,e[13]=x,e[14]=D):D=e[14];let M;e[15]!==D?(M=r.jsx(Bn,{children:D}),e[15]=D,e[16]=M):M=e[16];let N;e[17]!==P||e[18]!==M?(N=r.jsxs(Vn,{children:[P,M]}),e[17]=P,e[18]=M,e[19]=N):N=e[19];let R;e[20]!==m||e[21]!==x?(R=m&&r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:x("sandbox.fileExplorerNameDialog.location")}),r.jsx(ot,{value:m,readOnly:!0,disabled:!0,className:"font-mono text-xs"})]}),e[20]=m,e[21]=x,e[22]=R):R=e[22];let E;e[23]!==x?(E=x("sandbox.fileExplorerNameDialog.name"),e[23]=x,e[24]=E):E=e[24];let T;e[25]!==E?(T=r.jsx("label",{htmlFor:"file-explorer-name",className:"text-xs font-medium text-muted-foreground",children:E}),e[25]=E,e[26]=T):T=e[26];let Q;e[27]===Symbol.for("react.memo_cache_sentinel")?(Q=_=>k(_.target.value),e[27]=Q):Q=e[27];let X;e[28]!==y.placeholderKey||e[29]!==x?(X=x(y.placeholderKey),e[28]=y.placeholderKey,e[29]=x,e[30]=X):X=e[30];let Y;e[31]!==d||e[32]!==g||e[33]!==X?(Y=r.jsx(ot,{id:"file-explorer-name",value:g,onChange:Q,placeholder:X,autoFocus:!0,disabled:d}),e[31]=d,e[32]=g,e[33]=X,e[34]=Y):Y=e[34];let G;e[35]!==T||e[36]!==Y?(G=r.jsxs("div",{className:"space-y-1.5",children:[T,Y]}),e[35]=T,e[36]=Y,e[37]=G):G=e[37];let $;e[38]!==R||e[39]!==G?($=r.jsxs("div",{className:"space-y-4 py-4",children:[R,G]}),e[38]=R,e[39]=G,e[40]=$):$=e[40];let W;e[41]!==v?(W=()=>v(!1),e[41]=v,e[42]=W):W=e[42];let K;e[43]!==x?(K=x("sandbox.fileExplorerNameDialog.cancel"),e[43]=x,e[44]=K):K=e[44];let z;e[45]!==d||e[46]!==W||e[47]!==K?(z=r.jsx(De,{type:"button",variant:"outline",onClick:W,disabled:d,children:K}),e[45]=d,e[46]=W,e[47]=K,e[48]=z):z=e[48];let B;e[49]!==d||e[50]!==g?(B=!g.trim()||d,e[49]=d,e[50]=g,e[51]=B):B=e[51];let L;e[52]!==y.submitKey||e[53]!==d||e[54]!==x?(L=d?r.jsxs(r.Fragment,{children:[r.jsx(fe,{size:14,className:"animate-spin"}),x("sandbox.fileExplorerNameDialog.saving")]}):x(y.submitKey),e[52]=y.submitKey,e[53]=d,e[54]=x,e[55]=L):L=e[55];let V;e[56]!==B||e[57]!==L?(V=r.jsx(De,{type:"submit",disabled:B,children:L}),e[56]=B,e[57]=L,e[58]=V):V=e[58];let O;e[59]!==z||e[60]!==V?(O=r.jsxs(Un,{children:[z,V]}),e[59]=z,e[60]=V,e[61]=O):O=e[61];let U;e[62]!==I||e[63]!==$||e[64]!==O||e[65]!==N?(U=r.jsx(Hn,{className:"sm:max-w-md",children:r.jsxs("form",{onSubmit:I,children:[N,$,O]})}),e[62]=I,e[63]=$,e[64]=O,e[65]=N,e[66]=U):U=e[66];let ee;return e[67]!==F||e[68]!==s||e[69]!==U?(ee=r.jsx(qn,{open:s,onOpenChange:F,children:U}),e[67]=F,e[68]=s,e[69]=U,e[70]=ee):ee=e[70],ee}function ar(i){const e=se.c(47),{deleteTarget:s,deleteDirtyPaths:a,fsActionPending:l,onOpenChange:m,onConfirm:h}=i,f=Me(),v=s?.kind==="directory",j=s!==null,d=v?"sandbox.fileExplorerDeleteDialog.titleFolder":"sandbox.fileExplorerDeleteDialog.titleFile";let x;e[0]!==f||e[1]!==d?(x=f(d),e[0]=f,e[1]=d,e[2]=x):x=e[2];let g;e[3]!==x?(g=r.jsx(Wn,{children:x}),e[3]=x,e[4]=g):g=e[4];let k;e[5]!==f?(k=f("sandbox.fileExplorerDeleteDialog.description"),e[5]=f,e[6]=k):k=e[6];const Z=s?.name;let q;e[7]!==Z?(q=r.jsx("span",{className:"font-mono",children:Z}),e[7]=Z,e[8]=q):q=e[8];let y;e[9]!==v||e[10]!==f?(y=v?f("sandbox.fileExplorerDeleteDialog.folderSuffix"):".",e[9]=v,e[10]=f,e[11]=y):y=e[11];let b;e[12]!==a.length||e[13]!==f?(b=a.length>0&&r.jsxs(r.Fragment,{children:[" ",a.length===1?f("sandbox.fileExplorerDeleteDialog.unsavedChangesOne"):f("sandbox.fileExplorerDeleteDialog.unsavedChangesMany",{count:a.length})]}),e[12]=a.length,e[13]=f,e[14]=b):b=e[14];let F;e[15]!==k||e[16]!==q||e[17]!==y||e[18]!==b?(F=r.jsxs(Qn,{children:[k," ",q,y,b]}),e[15]=k,e[16]=q,e[17]=y,e[18]=b,e[19]=F):F=e[19];let A;e[20]!==F||e[21]!==g?(A=r.jsxs(Xn,{children:[g,F]}),e[20]=F,e[21]=g,e[22]=A):A=e[22];let I;e[23]!==f?(I=f("sandbox.fileExplorerDeleteDialog.cancel"),e[23]=f,e[24]=I):I=e[24];let S;e[25]!==l||e[26]!==I?(S=r.jsx(Yn,{disabled:l,children:I}),e[25]=l,e[26]=I,e[27]=S):S=e[27];const P=l||!s;let D;e[28]!==s||e[29]!==h?(D=Q=>{Q.preventDefault(),s&&h(s)},e[28]=s,e[29]=h,e[30]=D):D=e[30];let M;e[31]!==f?(M=f("sandbox.fileExplorerDeleteDialog.delete"),e[31]=f,e[32]=M):M=e[32];let N;e[33]!==P||e[34]!==D||e[35]!==M?(N=r.jsx(Jn,{disabled:P,onClick:D,children:M}),e[33]=P,e[34]=D,e[35]=M,e[36]=N):N=e[36];let R;e[37]!==S||e[38]!==N?(R=r.jsxs(Zn,{children:[S,N]}),e[37]=S,e[38]=N,e[39]=R):R=e[39];let E;e[40]!==A||e[41]!==R?(E=r.jsxs(er,{children:[A,R]}),e[40]=A,e[41]=R,e[42]=E):E=e[42];let T;return e[43]!==m||e[44]!==j||e[45]!==E?(T=r.jsx(tr,{open:j,onOpenChange:m,children:E}),e[43]=m,e[44]=j,e[45]=E,e[46]=T):T=e[46],T}var ze="ContextMenu",[ir]=an(ze,[lt]),J=lt(),[lr,ct]=ir(ze),dt=i=>{const{__scopeContextMenu:e,children:s,onOpenChange:a,dir:l,modal:m=!0}=i,[h,f]=u.useState(!1),v=J(e),j=on(a),d=u.useCallback(x=>{f(x),j(x)},[j]);return r.jsx(lr,{scope:e,open:h,onOpenChange:d,modal:m,children:r.jsx(sn,{...v,dir:l,open:h,onOpenChange:d,modal:m,children:s})})};dt.displayName=ze;var ut="ContextMenuTrigger",ft=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,disabled:a=!1,...l}=i,m=ct(ut,s),h=J(s),f=u.useRef({x:0,y:0}),v=u.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...f.current})}),j=u.useRef(0),d=u.useCallback(()=>window.clearTimeout(j.current),[]),x=g=>{f.current={x:g.clientX,y:g.clientY},m.onOpenChange(!0)};return u.useEffect(()=>d,[d]),u.useEffect(()=>{a&&d()},[a,d]),r.jsxs(r.Fragment,{children:[r.jsx(Jt,{...h,virtualRef:v}),r.jsx(Zt.span,{"data-state":m.open?"open":"closed","data-disabled":a?"":void 0,...l,ref:e,style:{WebkitTouchCallout:"none",...i.style},onContextMenu:a?i.onContextMenu:xe(i.onContextMenu,g=>{d(),x(g),g.preventDefault()}),onPointerDown:a?i.onPointerDown:xe(i.onPointerDown,Se(g=>{d(),j.current=window.setTimeout(()=>x(g),700)})),onPointerMove:a?i.onPointerMove:xe(i.onPointerMove,Se(d)),onPointerCancel:a?i.onPointerCancel:xe(i.onPointerCancel,Se(d)),onPointerUp:a?i.onPointerUp:xe(i.onPointerUp,Se(d))})]})});ft.displayName=ut;var cr="ContextMenuPortal",pt=i=>{const{__scopeContextMenu:e,...s}=i,a=J(e);return r.jsx(nn,{...a,...s})};pt.displayName=cr;var mt="ContextMenuContent",xt=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=ct(mt,s),m=J(s),h=u.useRef(!1);return r.jsx(rn,{...m,...a,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:f=>{i.onCloseAutoFocus?.(f),!f.defaultPrevented&&h.current&&f.preventDefault(),h.current=!1},onInteractOutside:f=>{i.onInteractOutside?.(f),!f.defaultPrevented&&!l.modal&&(h.current=!0)},style:{...i.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});xt.displayName=mt;var dr="ContextMenuGroup",ur=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(ln,{...l,...a,ref:e})});ur.displayName=dr;var fr="ContextMenuLabel",pr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(cn,{...l,...a,ref:e})});pr.displayName=fr;var mr="ContextMenuItem",ht=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(en,{...l,...a,ref:e})});ht.displayName=mr;var xr="ContextMenuCheckboxItem",hr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(dn,{...l,...a,ref:e})});hr.displayName=xr;var gr="ContextMenuRadioGroup",br=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(un,{...l,...a,ref:e})});br.displayName=gr;var yr="ContextMenuRadioItem",vr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(fn,{...l,...a,ref:e})});vr.displayName=yr;var Cr="ContextMenuItemIndicator",wr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(pn,{...l,...a,ref:e})});wr.displayName=Cr;var Nr="ContextMenuSeparator",gt=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(tn,{...l,...a,ref:e})});gt.displayName=Nr;var jr="ContextMenuArrow",Er=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(mn,{...l,...a,ref:e})});Er.displayName=jr;var Sr="ContextMenuSubTrigger",Dr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(xn,{...l,...a,ref:e})});Dr.displayName=Sr;var Mr="ContextMenuSubContent",Rr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(hn,{...l,...a,ref:e,style:{...i.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Rr.displayName=Mr;function Se(i){return e=>e.pointerType!=="mouse"?i(e):void 0}var Tr=dt,Pr=ft,kr=pt,Fr=xt,Ar=ht,Lr=gt;function Or(i){const e=se.c(4);let s;e[0]!==i?({...s}=i,e[0]=i,e[1]=s):s=e[1];let a;return e[2]!==s?(a=r.jsx(Tr,{"data-slot":"context-menu",...s}),e[2]=s,e[3]=a):a=e[3],a}function Ir(i){const e=se.c(4);let s;e[0]!==i?({...s}=i,e[0]=i,e[1]=s):s=e[1];let a;return e[2]!==s?(a=r.jsx(Pr,{"data-slot":"context-menu-trigger",...s}),e[2]=s,e[3]=a):a=e[3],a}function $r(i){const e=se.c(8);let s,a;e[0]!==i?({className:s,...a}=i,e[0]=i,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let l;e[3]!==s?(l=le("notranslate bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",s),e[3]=s,e[4]=l):l=e[4];let m;return e[5]!==a||e[6]!==l?(m=r.jsx(kr,{children:r.jsx(Fr,{"data-slot":"context-menu-content",translate:"no",className:l,...a})}),e[5]=a,e[6]=l,e[7]=m):m=e[7],m}function ue(i){const e=se.c(12);let s,a,l,m;e[0]!==i?({className:s,inset:a,variant:m,...l}=i,e[0]=i,e[1]=s,e[2]=a,e[3]=l,e[4]=m):(s=e[1],a=e[2],l=e[3],m=e[4]);const h=m===void 0?"default":m;let f;e[5]!==s?(f=le("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",s),e[5]=s,e[6]=f):f=e[6];let v;return e[7]!==a||e[8]!==l||e[9]!==f||e[10]!==h?(v=r.jsx(Ar,{"data-slot":"context-menu-item","data-inset":a,"data-variant":h,className:f,...l}),e[7]=a,e[8]=l,e[9]=f,e[10]=h,e[11]=v):v=e[11],v}function st(i){const e=se.c(8);let s,a;e[0]!==i?({className:s,...a}=i,e[0]=i,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let l;e[3]!==s?(l=le("bg-border -mx-1 my-1 h-px",s),e[3]=s,e[4]=l):l=e[4];let m;return e[5]!==a||e[6]!==l?(m=r.jsx(Lr,{"data-slot":"context-menu-separator",className:l,...a}),e[5]=a,e[6]=l,e[7]=m):m=e[7],m}const Kr="#d9a441";function zr(i){const e=se.c(63),{node:s,depth:a,isExpanded:l,isSelected:m,isLoading:h,fileVisual:f,onOpen:v,onSelect:j,onNewFile:d,onNewFolder:x,onCopyPath:g,onCopyRelativePath:k,onRename:Z,onDelete:q}=i,y=h===void 0?!1:h,b=Me(),F=s.kind==="directory",{Icon:A,color:I}=f,S=m&&"bg-accent";let P;e[0]!==S?(P=le("flex w-full items-center gap-1.5 px-2 py-1.5 text-left text-[13px] hover:bg-accent transition-colors",S),e[0]=S,e[1]=P):P=e[1];const D=`${a*14+8}px`;let M;e[2]!==D?(M={paddingLeft:D},e[2]=D,e[3]=M):M=e[3];let N;e[4]!==v||e[5]!==j?(N=()=>{j(),v()},e[4]=v,e[5]=j,e[6]=N):N=e[6];let R;e[7]!==A||e[8]!==I||e[9]!==F||e[10]!==l||e[11]!==y?(R=F?r.jsxs(r.Fragment,{children:[y?r.jsx(fe,{size:14,className:"shrink-0 animate-spin text-muted-foreground"}):l?r.jsx(nr,{size:14,className:"shrink-0 text-muted-foreground"}):r.jsx(rr,{size:14,className:"shrink-0 text-muted-foreground"}),r.jsx(vn,{size:16,className:"shrink-0",style:{color:Kr}})]}):r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"w-3.5 shrink-0"}),r.jsx(A,{size:16,className:"shrink-0",style:{color:I}})]}),e[7]=A,e[8]=I,e[9]=F,e[10]=l,e[11]=y,e[12]=R):R=e[12];let E;e[13]!==s.name?(E=r.jsx("span",{className:"truncate",children:s.name}),e[13]=s.name,e[14]=E):E=e[14];let T;e[15]!==P||e[16]!==M||e[17]!==N||e[18]!==R||e[19]!==E?(T=r.jsx(Ir,{asChild:!0,children:r.jsxs("button",{type:"button",className:P,style:M,onClick:N,children:[R,E]})}),e[15]=P,e[16]=M,e[17]=N,e[18]=R,e[19]=E,e[20]=T):T=e[20];let Q;e[21]!==b?(Q=b("sandbox.fileTreeRow.newFile"),e[21]=b,e[22]=Q):Q=e[22];let X;e[23]!==d||e[24]!==Q?(X=r.jsx(ue,{onSelect:d,children:Q}),e[23]=d,e[24]=Q,e[25]=X):X=e[25];let Y;e[26]!==b?(Y=b("sandbox.fileTreeRow.newFolder"),e[26]=b,e[27]=Y):Y=e[27];let G;e[28]!==x||e[29]!==Y?(G=r.jsx(ue,{onSelect:x,children:Y}),e[28]=x,e[29]=Y,e[30]=G):G=e[30];let $;e[31]===Symbol.for("react.memo_cache_sentinel")?($=r.jsx(st,{}),e[31]=$):$=e[31];let W;e[32]!==b?(W=b("sandbox.fileTreeRow.copyPath"),e[32]=b,e[33]=W):W=e[33];let K;e[34]!==g||e[35]!==W?(K=r.jsx(ue,{onSelect:g,children:W}),e[34]=g,e[35]=W,e[36]=K):K=e[36];let z;e[37]!==b?(z=b("sandbox.fileTreeRow.copyRelativePath"),e[37]=b,e[38]=z):z=e[38];let B;e[39]!==k||e[40]!==z?(B=r.jsx(ue,{onSelect:k,children:z}),e[39]=k,e[40]=z,e[41]=B):B=e[41];let L;e[42]===Symbol.for("react.memo_cache_sentinel")?(L=r.jsx(st,{}),e[42]=L):L=e[42];let V;e[43]!==b?(V=b("sandbox.fileTreeRow.rename"),e[43]=b,e[44]=V):V=e[44];let O;e[45]!==Z||e[46]!==V?(O=r.jsx(ue,{onSelect:Z,children:V}),e[45]=Z,e[46]=V,e[47]=O):O=e[47];let U;e[48]!==b?(U=b("sandbox.fileTreeRow.delete"),e[48]=b,e[49]=U):U=e[49];let ee;e[50]!==q||e[51]!==U?(ee=r.jsx(ue,{variant:"destructive",onSelect:q,children:U}),e[50]=q,e[51]=U,e[52]=ee):ee=e[52];let _;e[53]!==X||e[54]!==G||e[55]!==K||e[56]!==B||e[57]!==O||e[58]!==ee?(_=r.jsxs($r,{className:"w-52",children:[X,G,$,K,B,L,O,ee]}),e[53]=X,e[54]=G,e[55]=K,e[56]=B,e[57]=O,e[58]=ee,e[59]=_):_=e[59];let te;return e[60]!==_||e[61]!==T?(te=r.jsxs(Or,{children:[T,_]}),e[60]=_,e[61]=T,e[62]=te):te=e[62],te}yn.config({paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.0/min/vs"}});const at=200,_r=2,Gr=250,it=200;function Br(i,e,s,a){return`/api/${i}/sandbox/${encodeURIComponent(e)}/${encodeURIComponent(s)}/${a}`}function Vr(i){const e=se.c(9),{text:s,query:a}=i;let l,m,h;if(e[0]!==a||e[1]!==s){const{leadingEllipsis:v,segments:j}=An(s,a);l="truncate font-mono text-muted-foreground",m=v&&r.jsx("span",{className:"text-muted-foreground/50",children:"…"}),h=j.map(Ur),e[0]=a,e[1]=s,e[2]=l,e[3]=m,e[4]=h}else l=e[2],m=e[3],h=e[4];let f;return e[5]!==l||e[6]!==m||e[7]!==h?(f=r.jsxs("span",{className:l,children:[m,h]}),e[5]=l,e[6]=m,e[7]=h,e[8]=f):f=e[8],f}function Ur(i,e){return i.match?r.jsx("span",{className:"rounded-[2px] bg-primary/20 text-foreground",children:i.text},e):r.jsx("span",{children:i.text},e)}function Ra({orgSlug:i,virtualMcpId:e,branch:s,openPath:a}){const[l,m]=u.useState({files:[],directories:[],truncated:!1}),{files:h,directories:f}=l,[v,j]=u.useState(new Set),[d,x]=u.useState(null),[g,k]=u.useState(null),[Z,q]=u.useState([]),[y,b]=u.useState(""),[F,A]=u.useState(null),[I,S]=u.useState(null),[P,D]=u.useState(!1),[M,N]=u.useState(!1),[R,E]=u.useState(!1),[T,Q]=u.useState(!1),[,X]=u.useState(new Set),[Y,G]=u.useState(new Set),$=u.useRef(0),W=u.useRef(null),K=u.useRef(new Set),z=u.useRef(new Map),B=u.useRef(null),L=u.useRef(0),V=u.useRef(null),O=u.useRef(null),U=u.useRef(null);function ee(t){X(n=>{const o=typeof t=="function"?t(n):t;return K.current=o,o})}const[_,te]=u.useState(new Map),Re=u.useRef(null),[ae,he]=u.useState(null),{sendMessage:bt}=Sn(),{openSidePanel:yt}=Dn(),ge=gn(),[H,oe]=u.useState(null),[Te,Pe]=u.useState(null),[be,ye]=u.useState(!1);async function ie(t,n){const o=await fetch(Br(i,e,s,t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(n)});if(!o.ok){const c=await o.json().catch(()=>({}));throw new Error(c.error??`Request failed (${o.status})`)}return o.json()}async function ve(){ge.invalidateQueries({queryKey:rt(i,e,s)})}function _e(t,n,o){navigator.clipboard.writeText(o).then(()=>ne.success(t("sandbox.fileExplorer.textCopied",{label:n})),()=>ne.error(t("sandbox.fileExplorer.failedToCopyText",{label:n.toLowerCase()})))}function vt(t){const n=zn(t);if(!n)return;const o=`${i}/${e}/${s}`;ge.setQueryData(Ze.decofile(o),c=>{if(!c)return c;const{[n]:p,...C}=c;return C}),ge.invalidateQueries({queryKey:Ze.liveMeta(i,e,s)})}function Ct(t){const n=t.kind==="file"?[t.path]:h.filter(o=>o.startsWith(".deco/blocks/")).map(o=>we(o)).filter(o=>o===t.path||o.startsWith(`${t.path}/`));for(const o of n)vt(o)}function wt(t){const n=we(t);return Z.filter(o=>{if(o!==n&&!o.startsWith(`${n}/`))return!1;const c=_.get(o);return!!(c?.loaded&&c.editorValue!==c.savedContent)})}function Ge(t){q(n=>n.map(o=>t(o)).filter(o=>o!==null)),x(n=>n&&t(n)),te(n=>{const o=new Map;for(const[c,p]of n){const C=t(c);C&&o.set(C,p)}return o}),k(n=>{if(!n)return n;const o=t(n.path);return o?o===n.path?n:{...n,path:o,name:o.split("/").pop()??o}:null})}function Nt(t){const n=we(t);k(o=>o&&(o.path===n||o.path.startsWith(`${n}/`)?null:o)),Ge(o=>o===n||o.startsWith(`${n}/`)?null:o)}async function jt(t,n){if(!H)return;const o=Ee(H.parentDir,n);if(Ke(o,h,f))throw new Error(t("sandbox.fileExplorer.fileAlreadyExists",{name:n}));await ie("write",{path:re(o),content:""}),await pe(),await ve(),oe(null),me(o)}async function Et(t,n){if(!H)return;const o=Ee(H.parentDir,n);if(Ke(o,h,f))throw new Error(t("sandbox.fileExplorer.fileAlreadyExists",{name:n}));const c=re(o);await ie("mkdir",{path:c}),m(p=>({...p,directories:p.directories.includes(c)?p.directories:[...p.directories,c]})),await pe(),await ve(),oe(null),j(p=>{const C=new Set(p);for(const ce of Ie(o))C.add(ce);return C.add(o),C}),k({name:n,path:o,kind:"directory",children:[]})}async function St(t,n){if(!H)return;const o=H.node.path,c=Ne(o),p=Ee(c,n);if(p===o){oe(null);return}if(Ke(p,h,f))throw new Error(t("sandbox.fileExplorer.fileAlreadyExists",{name:n}));await ie("rename",{from:re(o),to:re(p)}),Ge(C=>C===o?p:C.startsWith(`${o}/`)?Ee(p,C.slice(o.length+1)):C),await pe(),await ve(),oe(null)}async function Dt(t,n){ye(!0);try{await ie("unlink",{path:re(n.path),recursive:n.kind==="directory"}),Ct(n),Nt(n.path),await pe(),await ve(),Pe(null),ne.success(t("sandbox.fileExplorer.fileDeleted",{name:n.name}))}catch(o){ne.error(o instanceof Error?o.message:t("sandbox.fileExplorer.deleteFailed"))}finally{ye(!1)}}async function Mt(t,n){const o=On(n);if(o){ne.error(o);return}ye(!0);try{H?.mode==="new-file"?(await jt(t,n),ne.success(t("sandbox.fileExplorer.fileCreated",{name:n}))):H?.mode==="new-folder"?(await Et(t,n),ne.success(t("sandbox.fileExplorer.folderCreated",{name:n}))):H?.mode==="rename"&&(await St(t,n),ne.success(t("sandbox.fileExplorer.renamedTo",{name:n})))}catch(c){ne.error(c instanceof Error?c.message:t("sandbox.fileExplorer.operationFailed"))}finally{ye(!1)}}const Be=u.useRef(!1);Be.current||(Be.current=!0,W.current=pe());const[Rt,Tt]=u.useState(null),w=Me();if(a&&a!==Rt){Tt(a);const t=a;queueMicrotask(()=>{Mn(t)&&me(t)})}async function ke(t){const n=await ie("glob",t);return{files:n.files??[],directories:n.directories??[],truncated:n.truncated}}function Ve(t,n,o){if(o!==$.current)return!1;let c=!1;return m(p=>{const C=n?_n(p.files,p.directories,t,p.truncated):{files:t.files,directories:t.directories??[],truncated:!!t.truncated};return c=!!C.truncated,{files:C.files,directories:C.directories,truncated:c}}),c&&ne.warning(w("sandbox.fileExplorer.fileListTruncated")),c}async function Pt(t){const n=z.current.get(t);if(n)return n;const o=$.current,c=(async()=>{const p=await ke({pattern:"**/*",path:re(t),limit:Ae}),C=Ve(p,!0,o);return!C&&o===$.current&&ee(ce=>{const Ce=new Set(ce);return Ce.add(t),Ce}),C})();z.current.set(t,c);try{return await c}finally{z.current.delete(t)}}async function Ue(t){if(!$e(t,K.current))return!1;G(n=>new Set(n).add(t));try{return await Pt(t)}finally{G(n=>{const o=new Set(n);return o.delete(t),o})}}async function kt(t,n){const o=new Set(K.current);for(const c of Ie(n)){if(!$e(c,o))continue;if(await Ue(c))throw new Error(t("sandbox.fileExplorer.folderListingTruncated"));o.add(c)}}async function pe(){const t=++$.current;V.current=null,O.current=null,z.current.clear(),E(!0),ee(new Set),j(new Set),G(new Set);try{const n=await ke({pattern:"**/*",limit:Ae,maxDepth:Rn});Ve(n,!1,t),Q(!0)}catch{T&&ne.error(w("sandbox.fileExplorer.failedToRefreshFileTree"))}finally{E(!1)}}async function He(t){if(!_.get(t)?.loaded){te(o=>{const c=new Map(o);return c.set(t,{savedContent:"",editorValue:"",loaded:!1}),c});try{const o=await ie("read",{path:re(t),full:!0}),c=Ln(o.content??"");te(p=>{const C=new Map(p);return C.set(t,{savedContent:c,editorValue:c,loaded:!0}),C})}catch{}}}function Ft(){L.current++,A(null),S(null),D(!1),N(!1)}async function At(){const t=$.current,n=V.current;if(n&&n.generation===t)return n.files;const o=O.current;if(o&&o.generation===t)return o.promise;const c=(async()=>{const p=await ke({pattern:"**/*",limit:Ae});return $.current===t&&(V.current={generation:t,files:p.files}),p.files})();O.current={generation:t,promise:c};try{return await c}finally{O.current?.generation===t&&(O.current=null)}}async function Lt(t,n){try{const o=await At();if(n!==L.current)return;A($n(o,t,it))}catch{if(n!==L.current)return;A([])}}async function Ot(t,n){D(!0);try{const o=await ie("grep",{pattern:t,output_mode:"content",ignore_case:!0,fixed_strings:!0,limit:at});if(n!==L.current)return;S(Kn(o.results??"")),N((o.matchCount??0)>=at)}catch{if(n!==L.current)return;S([]),N(!1)}finally{n===L.current&&D(!1)}}function It(t){const n=t.trim(),o=++L.current;Lt(n,o),n.length<_r?(S(null),D(!1),N(!1)):Ot(n,o)}function $t(t){if(b(t),B.current&&clearTimeout(B.current),!t.trim()){Ft();return}B.current=setTimeout(()=>{It(t)},Gr)}function qe(t){const n=U.current;if(!n||n.path!==d)return;U.current=null;const o=Math.max(1,n.line);t.revealLineInCenter(o),t.setPosition({lineNumber:o,column:1}),t.focus()}function Kt(t){U.current={path:t.path,line:t.line};const n=d===t.path&&_.get(t.path)?.loaded;me(t.path),n&&Re.current&&qe(Re.current)}async function zt(t,n){try{await ie("write",{path:re(t),content:n}),je("file saved via sandbox /write",{path:t}),ge.invalidateQueries({queryKey:rt(i,e,s)});try{const o=await In(i,e,s);je("git status after save",o)}catch(o){je("git status after save failed",{path:t,error:o instanceof Error?o.message:String(o)})}te(o=>{const c=new Map(o),p=c.get(t);return p&&c.set(t,{...p,savedContent:n}),c})}catch(o){je("file save failed",{path:t,error:o instanceof Error?o.message:String(o)})}}function _t(t){x(t),k({name:t.split("/").pop()??t,path:t,kind:"file",children:[]}),he(null),Z.includes(t)||q(n=>[...n,t]),He(t)}function Gt(t){q(n=>{const o=n.filter(c=>c!==t);return d===t&&x(o[o.length-1]??null),o}),te(n=>{const o=new Map(n);return o.delete(t),o})}function We(t){j(n=>{const o=new Set(n);return o.has(t)?o.delete(t):o.add(t),o})}async function Bt(t){if($e(t,K.current))try{if(await Ue(t))return}catch(n){ne.error(n instanceof Error?n.message:w("sandbox.fileExplorer.failedToLoadFolder"));return}We(t)}async function Vt(t,n){if(n){We(t);return}await Bt(t)}async function Ut(t){await W.current,await kt(w,t);const n=Ie(t);j(o=>{const c=new Set(o);for(const p of n)c.add(p);return c}),_t(t)}function me(t){Ut(t).catch(n=>{ne.error(n instanceof Error?n.message:w("sandbox.fileExplorer.failedToOpenFile"))})}function Ht(){return g?.kind==="directory"?g.path:g?.kind==="file"?Ne(g.path):d?Ne(d):"/"}function Qe(t){const n=Ht();oe({mode:t,parentDir:n,node:{name:"",path:n,kind:"directory",children:[]}})}const qt=Tn(h,f),Xe=Pn(qt,v),Fe=F?.length??0,Ye=kn(I??[]),Je=I?.length??0,de=d?_.get(d):null,Wt=de?.loaded&&de.editorValue!==de.savedContent,Qt=Te?wt(Te.path):[],Xt=(t,n)=>{Re.current=t,qe(t),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyS,async()=>{if(!d)return;const o=t.getValue();await zt(d,o)}),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyK,()=>{const o=t.getSelection(),c=t.getModel();if(!o||!c||!d)return;const p=c.getValueInRange(o);he({filePath:d,lineStart:o.startLineNumber,lineEnd:o.endLineNumber,selectedCode:p})})};function Yt(t){if(!ae)return;const n=[`The user selected code in the file explorer and asked: **"${t.trim()}"**`,"",`**File:** \`${ae.filePath}\``,`**Lines:** ${ae.lineStart}–${ae.lineEnd}`];if(ae.selectedCode){const o=Oe(ae.filePath),c=ae.selectedCode.replace(/```/g,"`` `");n.push("","**Selected code:**","```"+o,c,"```")}n.push("","Please read the source file, locate the code, and apply the requested change."),yt("chat"),bt({parts:[{type:"text",text:n.join(`
1
+ import{c as se,b as Me,r as u,j as r,k as fe,B as De,d_ as Jt,ay as Zt,aE as xe,d$ as en,e0 as tn,e1 as nn,e2 as rn,bI as on,e3 as sn,e4 as lt,aA as an,e5 as ln,e6 as cn,e7 as dn,e8 as un,e9 as fn,ea as pn,eb as mn,ec as xn,ed as hn,m as le,o as gn,t as ne,K as Ze}from"./index-CjF26QCG.js";import{F as bn,l as yn}from"./monaco-editor-8X3kMk2i.js";import{D as vn,f as Cn,a_ as wn,a$ as Nn}from"./agent-icon-DCuaG5nE.js";import{s as jn}from"./XClose-CS8UpX89.js";import{n as En}from"./automation-runs-CvtFUnmv.js";import{c as et,T as tt,a as nt}from"./tooltip-DASp4d0o.js";import{a as Sn}from"./chat-context-DE138twl.js";import{u as Dn}from"./shell-layout-hVA8oTRe.js";import{i as Mn,E as Rn,a as Ae,b as Tn,f as Pn,g as kn,c as Fn,t as re,d as we,e as Le,h as Ne,j as Oe,k as Ie,l as An,s as Ln,v as On,m as $e,n as je,o as rt,p as In,q as Ee,r as Ke,w as $n,x as Kn,y as zn,z as _n}from"./index-CKHQvX6y.js";import{b as Gn,h as Bn,a as Vn,c as Un,d as Hn,e as qn}from"./dialog-Pi_xgHC0.js";import{I as ot}from"./input-IDFu6vm5.js";import{c as Wn,d as Qn,b as Xn,f as Yn,g as Jn,e as Zn,a as er,A as tr}from"./alert-dialog-DegRzpzC.js";import{t as nr}from"./ChevronDown-D6KfEPdr.js";import{i as rr}from"./ChevronRight-DILmeK7M.js";import"./delay-CnY5UFtP.js";import"./AlertCircle-Cem6ePeU.js";import"./Tool01-BhOhq1Lq.js";import"./ArrowUp-C2eUAqJf.js";import"./Settings02-D-zT1K0J.js";import"./Tool02-CCtBgqj3.js";import"./XCircle-BDBptK5c.js";import"./ArrowUpRight-DfJzPFvU.js";import"./TrendUp01-CiD1se1i.js";import"./ZapSquare-DXB9EHwI.js";import"./Users03-Jpb3Rs6p.js";import"./CheckCircle-B-XbmPy7.js";import"./Check-Dyt2_0ga.js";import"./ChevronUp-Bmy1l0Py.js";import"./DotsVertical-BhuMjSRb.js";import"./Stars02-D936Q5vu.js";import"./Copy01-USV1_HJa.js";import"./Eye-DLI5NPy9.js";import"./FilterLines-5S8WKVB6.js";import"./Star01-CTYXgmts.js";import"./Palette-CLw6FxLo.js";import"./SwitchHorizontal01-DRBzItNZ.js";import"./HardDrive-DQfGmY_Q.js";import"./Key01-jW_JyKg4.js";import"./LayoutLeft-UdAY9lHL.js";import"./LinkExternal01-CxFcmhCv.js";import"./LogOut01-DvI1_F9a.js";import"./Monitor01-zHncMHvK.js";import"./Sun-SO-tAlk7.js";import"./Play-C0sf4kYZ.js";import"./Plus-DmVmPu15.js";import"./SearchLg-mmh32yOh.js";import"./SearchMd-BV0JzQs2.js";import"./Shield01-DaH6VmhZ.js";import"./Stars01-D42-h5Va.js";import"./Trash01-BNbLXf93.js";import"./Upload01-BE-MvOgE.js";import"./User01-Bq5KW4vO.js";import"./Users01-CiMe0bfz.js";import"./X-Cvof5f1Z.js";import"./Zap-NmQQQZMA.js";import"./select-CYXr2k1e.js";import"./useInfiniteQuery-D8Y9iE3e.js";import"./use-infinite-scroll-BKPCQUiM.js";import"./use-connection-CxlwOHmS.js";import"./use-mcp-client-BGlPrg7w.js";import"./auth-njKnK4H1.js";import"./use-virtual-mcp-DZ1qOoD6.js";import"./card-K9NXEEZ3.js";import"./sidebar-C8SHXIOH.js";import"./use-mobile-rYfTSvFb.js";import"./table-CHmBCOra.js";import"./empty-state-CsvH74tC.js";import"./use-members-6WuLtpPb.js";import"./use-org-auth-client-YfI11Izs.js";import"./use-clock-tick-saad32Ii.js";import"./use-automations-CFGJtaJi.js";import"./studio-tools-Cinrb_dT.js";import"./useSuspenseInfiniteQuery-Bh9Im6EJ.js";import"./avatar-lulgkVBD.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-CH4yzWsd.js";import"./tab-id-ChQ_Nf-x.js";import"./hooks-Dj4UYQoq.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-boA36psC.js";import"./index-FbgXWMub.js";import"./calendar-CD5nT3ox.js";import"./integration-icon-CVSw-anG.js";import"./use-navigate-to-agent-kFHXJGki.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-eUXp69My.js";import"./form-zuTrl1XI.js";import"./label-BuF4MPfP.js";import"./use-ai-providers-CYR9cqcD.js";import"./use-decopilot-events---My6CTP.js";import"./use-organization-settings-DytCiPyY.js";import"./required-auth-layout-DB8umWNL.js";import"./use-org-sso-DF0HSba8.js";import"./drawer-EWP6-H-C.js";import"./collection-search-mxPX78OM.js";import"./index-DAcffUvI.js";import"./get-initials-D-f_fDFw.js";import"./popover-JRycFW6L.js";import"./dropdown-menu-CXH88k_k.js";import"./github-repo-picker-D1KIwdhu.js";import"./use-debounced-value-DmKXCTEI.js";import"./authenticate-and-persist-oauth-QBHD9BB_.js";import"./mcp-oauth-D2KZ3LUV.js";import"./use-mcp-tools-rAYUC4rV.js";import"./extract-connection-data-DAPoTrnj.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-DWINBxtd.js";import"./use-tags-Cm5qRjFb.js";import"./command-B46E7rrG.js";import"./index-B3wdQaZS.js";import"./companions-core-CqeGIV51.js";import"./tabs-Ck0IiC4A.js";import"./toggle-group-D-W6Cfqy.js";import"./use-deco-credits-Bvs8MgnA.js";import"./toolbar-CzMwHqoE.js";import"./skeleton-CVuAFcA8.js";import"./agent-capabilities-cXfbMfjV.js";import"./connection-card-XHraSHoo.js";import"./use-registry-connections-C6iHTOsi.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-2SjkctT-.js";import"./connection-form-helpers-oVBbFTiT.js";import"./collection-tabs-DsjmXCy-.js";import"./badge-X6hr_bP1.js";import"./select-model-O_LgvrNh.js";import"./checkbox-BAZ2VUBa.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-CQn6aKZC.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-BoAmb66E.js";import"./deco-site-production-url-CaKZ7xBn.js";import"./use-capability-CvjJL9co.js";import"./pt-BR-CLy76QW2.js";import"./use-mcp-auth-status-DF1Y9mBA.js";import"./use-debounced-autosave-J6WpwdLn.js";import"./index-5hW5oe3V.js";import"./search-input-CC86MHPM.js";import"./switch-CUY_GjpD.js";import"./use-secrets-5rkcyWSN.js";import"./useQueries-dlQFGrcQ.js";import"./use-file-configs-SWmwhE7u.js";import"./automation-list-row-D0RC9AH1.js";const or={"new-file":{titleKey:"sandbox.fileExplorerNameDialog.newFileTitle",descriptionKey:"sandbox.fileExplorerNameDialog.newFileDescription",submitKey:"sandbox.fileExplorerNameDialog.newFileSubmit",placeholderKey:"sandbox.fileExplorerNameDialog.newFilePlaceholder"},"new-folder":{titleKey:"sandbox.fileExplorerNameDialog.newFolderTitle",descriptionKey:"sandbox.fileExplorerNameDialog.newFolderDescription",submitKey:"sandbox.fileExplorerNameDialog.newFolderSubmit",placeholderKey:"sandbox.fileExplorerNameDialog.newFolderPlaceholder"},rename:{titleKey:"sandbox.fileExplorerNameDialog.renameTitle",descriptionKey:"sandbox.fileExplorerNameDialog.renameDescription",submitKey:"sandbox.fileExplorerNameDialog.renameSubmit",placeholderKey:"sandbox.fileExplorerNameDialog.renamePlaceholder"}};function sr(i){const e=se.c(71),{open:s,mode:a,initialName:l,parentLabel:m,isPending:h,onSubmit:f,onOpenChange:v}=i,j=l===void 0?"":l,d=h===void 0?!1:h,x=Me(),[g,k]=u.useState(j),[Z,q]=u.useState(s),y=or[a];s!==Z&&(q(s),s&&k(j));let b;e[0]!==d||e[1]!==v?(b=_=>{!_&&!d&&v(!1)},e[0]=d,e[1]=v,e[2]=b):b=e[2];const F=b;let A;e[3]!==d||e[4]!==g||e[5]!==f?(A=async _=>{_.preventDefault();const te=g.trim();!te||d||await f(te)},e[3]=d,e[4]=g,e[5]=f,e[6]=A):A=e[6];const I=A;let S;e[7]!==y.titleKey||e[8]!==x?(S=x(y.titleKey),e[7]=y.titleKey,e[8]=x,e[9]=S):S=e[9];let P;e[10]!==S?(P=r.jsx(Gn,{children:S}),e[10]=S,e[11]=P):P=e[11];let D;e[12]!==y.descriptionKey||e[13]!==x?(D=x(y.descriptionKey),e[12]=y.descriptionKey,e[13]=x,e[14]=D):D=e[14];let M;e[15]!==D?(M=r.jsx(Bn,{children:D}),e[15]=D,e[16]=M):M=e[16];let N;e[17]!==P||e[18]!==M?(N=r.jsxs(Vn,{children:[P,M]}),e[17]=P,e[18]=M,e[19]=N):N=e[19];let R;e[20]!==m||e[21]!==x?(R=m&&r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:x("sandbox.fileExplorerNameDialog.location")}),r.jsx(ot,{value:m,readOnly:!0,disabled:!0,className:"font-mono text-xs"})]}),e[20]=m,e[21]=x,e[22]=R):R=e[22];let E;e[23]!==x?(E=x("sandbox.fileExplorerNameDialog.name"),e[23]=x,e[24]=E):E=e[24];let T;e[25]!==E?(T=r.jsx("label",{htmlFor:"file-explorer-name",className:"text-xs font-medium text-muted-foreground",children:E}),e[25]=E,e[26]=T):T=e[26];let Q;e[27]===Symbol.for("react.memo_cache_sentinel")?(Q=_=>k(_.target.value),e[27]=Q):Q=e[27];let X;e[28]!==y.placeholderKey||e[29]!==x?(X=x(y.placeholderKey),e[28]=y.placeholderKey,e[29]=x,e[30]=X):X=e[30];let Y;e[31]!==d||e[32]!==g||e[33]!==X?(Y=r.jsx(ot,{id:"file-explorer-name",value:g,onChange:Q,placeholder:X,autoFocus:!0,disabled:d}),e[31]=d,e[32]=g,e[33]=X,e[34]=Y):Y=e[34];let G;e[35]!==T||e[36]!==Y?(G=r.jsxs("div",{className:"space-y-1.5",children:[T,Y]}),e[35]=T,e[36]=Y,e[37]=G):G=e[37];let $;e[38]!==R||e[39]!==G?($=r.jsxs("div",{className:"space-y-4 py-4",children:[R,G]}),e[38]=R,e[39]=G,e[40]=$):$=e[40];let W;e[41]!==v?(W=()=>v(!1),e[41]=v,e[42]=W):W=e[42];let K;e[43]!==x?(K=x("sandbox.fileExplorerNameDialog.cancel"),e[43]=x,e[44]=K):K=e[44];let z;e[45]!==d||e[46]!==W||e[47]!==K?(z=r.jsx(De,{type:"button",variant:"outline",onClick:W,disabled:d,children:K}),e[45]=d,e[46]=W,e[47]=K,e[48]=z):z=e[48];let B;e[49]!==d||e[50]!==g?(B=!g.trim()||d,e[49]=d,e[50]=g,e[51]=B):B=e[51];let L;e[52]!==y.submitKey||e[53]!==d||e[54]!==x?(L=d?r.jsxs(r.Fragment,{children:[r.jsx(fe,{size:14,className:"animate-spin"}),x("sandbox.fileExplorerNameDialog.saving")]}):x(y.submitKey),e[52]=y.submitKey,e[53]=d,e[54]=x,e[55]=L):L=e[55];let V;e[56]!==B||e[57]!==L?(V=r.jsx(De,{type:"submit",disabled:B,children:L}),e[56]=B,e[57]=L,e[58]=V):V=e[58];let O;e[59]!==z||e[60]!==V?(O=r.jsxs(Un,{children:[z,V]}),e[59]=z,e[60]=V,e[61]=O):O=e[61];let U;e[62]!==I||e[63]!==$||e[64]!==O||e[65]!==N?(U=r.jsx(Hn,{className:"sm:max-w-md",children:r.jsxs("form",{onSubmit:I,children:[N,$,O]})}),e[62]=I,e[63]=$,e[64]=O,e[65]=N,e[66]=U):U=e[66];let ee;return e[67]!==F||e[68]!==s||e[69]!==U?(ee=r.jsx(qn,{open:s,onOpenChange:F,children:U}),e[67]=F,e[68]=s,e[69]=U,e[70]=ee):ee=e[70],ee}function ar(i){const e=se.c(47),{deleteTarget:s,deleteDirtyPaths:a,fsActionPending:l,onOpenChange:m,onConfirm:h}=i,f=Me(),v=s?.kind==="directory",j=s!==null,d=v?"sandbox.fileExplorerDeleteDialog.titleFolder":"sandbox.fileExplorerDeleteDialog.titleFile";let x;e[0]!==f||e[1]!==d?(x=f(d),e[0]=f,e[1]=d,e[2]=x):x=e[2];let g;e[3]!==x?(g=r.jsx(Wn,{children:x}),e[3]=x,e[4]=g):g=e[4];let k;e[5]!==f?(k=f("sandbox.fileExplorerDeleteDialog.description"),e[5]=f,e[6]=k):k=e[6];const Z=s?.name;let q;e[7]!==Z?(q=r.jsx("span",{className:"font-mono",children:Z}),e[7]=Z,e[8]=q):q=e[8];let y;e[9]!==v||e[10]!==f?(y=v?f("sandbox.fileExplorerDeleteDialog.folderSuffix"):".",e[9]=v,e[10]=f,e[11]=y):y=e[11];let b;e[12]!==a.length||e[13]!==f?(b=a.length>0&&r.jsxs(r.Fragment,{children:[" ",a.length===1?f("sandbox.fileExplorerDeleteDialog.unsavedChangesOne"):f("sandbox.fileExplorerDeleteDialog.unsavedChangesMany",{count:a.length})]}),e[12]=a.length,e[13]=f,e[14]=b):b=e[14];let F;e[15]!==k||e[16]!==q||e[17]!==y||e[18]!==b?(F=r.jsxs(Qn,{children:[k," ",q,y,b]}),e[15]=k,e[16]=q,e[17]=y,e[18]=b,e[19]=F):F=e[19];let A;e[20]!==F||e[21]!==g?(A=r.jsxs(Xn,{children:[g,F]}),e[20]=F,e[21]=g,e[22]=A):A=e[22];let I;e[23]!==f?(I=f("sandbox.fileExplorerDeleteDialog.cancel"),e[23]=f,e[24]=I):I=e[24];let S;e[25]!==l||e[26]!==I?(S=r.jsx(Yn,{disabled:l,children:I}),e[25]=l,e[26]=I,e[27]=S):S=e[27];const P=l||!s;let D;e[28]!==s||e[29]!==h?(D=Q=>{Q.preventDefault(),s&&h(s)},e[28]=s,e[29]=h,e[30]=D):D=e[30];let M;e[31]!==f?(M=f("sandbox.fileExplorerDeleteDialog.delete"),e[31]=f,e[32]=M):M=e[32];let N;e[33]!==P||e[34]!==D||e[35]!==M?(N=r.jsx(Jn,{disabled:P,onClick:D,children:M}),e[33]=P,e[34]=D,e[35]=M,e[36]=N):N=e[36];let R;e[37]!==S||e[38]!==N?(R=r.jsxs(Zn,{children:[S,N]}),e[37]=S,e[38]=N,e[39]=R):R=e[39];let E;e[40]!==A||e[41]!==R?(E=r.jsxs(er,{children:[A,R]}),e[40]=A,e[41]=R,e[42]=E):E=e[42];let T;return e[43]!==m||e[44]!==j||e[45]!==E?(T=r.jsx(tr,{open:j,onOpenChange:m,children:E}),e[43]=m,e[44]=j,e[45]=E,e[46]=T):T=e[46],T}var ze="ContextMenu",[ir]=an(ze,[lt]),J=lt(),[lr,ct]=ir(ze),dt=i=>{const{__scopeContextMenu:e,children:s,onOpenChange:a,dir:l,modal:m=!0}=i,[h,f]=u.useState(!1),v=J(e),j=on(a),d=u.useCallback(x=>{f(x),j(x)},[j]);return r.jsx(lr,{scope:e,open:h,onOpenChange:d,modal:m,children:r.jsx(sn,{...v,dir:l,open:h,onOpenChange:d,modal:m,children:s})})};dt.displayName=ze;var ut="ContextMenuTrigger",ft=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,disabled:a=!1,...l}=i,m=ct(ut,s),h=J(s),f=u.useRef({x:0,y:0}),v=u.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...f.current})}),j=u.useRef(0),d=u.useCallback(()=>window.clearTimeout(j.current),[]),x=g=>{f.current={x:g.clientX,y:g.clientY},m.onOpenChange(!0)};return u.useEffect(()=>d,[d]),u.useEffect(()=>{a&&d()},[a,d]),r.jsxs(r.Fragment,{children:[r.jsx(Jt,{...h,virtualRef:v}),r.jsx(Zt.span,{"data-state":m.open?"open":"closed","data-disabled":a?"":void 0,...l,ref:e,style:{WebkitTouchCallout:"none",...i.style},onContextMenu:a?i.onContextMenu:xe(i.onContextMenu,g=>{d(),x(g),g.preventDefault()}),onPointerDown:a?i.onPointerDown:xe(i.onPointerDown,Se(g=>{d(),j.current=window.setTimeout(()=>x(g),700)})),onPointerMove:a?i.onPointerMove:xe(i.onPointerMove,Se(d)),onPointerCancel:a?i.onPointerCancel:xe(i.onPointerCancel,Se(d)),onPointerUp:a?i.onPointerUp:xe(i.onPointerUp,Se(d))})]})});ft.displayName=ut;var cr="ContextMenuPortal",pt=i=>{const{__scopeContextMenu:e,...s}=i,a=J(e);return r.jsx(nn,{...a,...s})};pt.displayName=cr;var mt="ContextMenuContent",xt=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=ct(mt,s),m=J(s),h=u.useRef(!1);return r.jsx(rn,{...m,...a,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:f=>{i.onCloseAutoFocus?.(f),!f.defaultPrevented&&h.current&&f.preventDefault(),h.current=!1},onInteractOutside:f=>{i.onInteractOutside?.(f),!f.defaultPrevented&&!l.modal&&(h.current=!0)},style:{...i.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});xt.displayName=mt;var dr="ContextMenuGroup",ur=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(ln,{...l,...a,ref:e})});ur.displayName=dr;var fr="ContextMenuLabel",pr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(cn,{...l,...a,ref:e})});pr.displayName=fr;var mr="ContextMenuItem",ht=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(en,{...l,...a,ref:e})});ht.displayName=mr;var xr="ContextMenuCheckboxItem",hr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(dn,{...l,...a,ref:e})});hr.displayName=xr;var gr="ContextMenuRadioGroup",br=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(un,{...l,...a,ref:e})});br.displayName=gr;var yr="ContextMenuRadioItem",vr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(fn,{...l,...a,ref:e})});vr.displayName=yr;var Cr="ContextMenuItemIndicator",wr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(pn,{...l,...a,ref:e})});wr.displayName=Cr;var Nr="ContextMenuSeparator",gt=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(tn,{...l,...a,ref:e})});gt.displayName=Nr;var jr="ContextMenuArrow",Er=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(mn,{...l,...a,ref:e})});Er.displayName=jr;var Sr="ContextMenuSubTrigger",Dr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(xn,{...l,...a,ref:e})});Dr.displayName=Sr;var Mr="ContextMenuSubContent",Rr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(hn,{...l,...a,ref:e,style:{...i.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Rr.displayName=Mr;function Se(i){return e=>e.pointerType!=="mouse"?i(e):void 0}var Tr=dt,Pr=ft,kr=pt,Fr=xt,Ar=ht,Lr=gt;function Or(i){const e=se.c(4);let s;e[0]!==i?({...s}=i,e[0]=i,e[1]=s):s=e[1];let a;return e[2]!==s?(a=r.jsx(Tr,{"data-slot":"context-menu",...s}),e[2]=s,e[3]=a):a=e[3],a}function Ir(i){const e=se.c(4);let s;e[0]!==i?({...s}=i,e[0]=i,e[1]=s):s=e[1];let a;return e[2]!==s?(a=r.jsx(Pr,{"data-slot":"context-menu-trigger",...s}),e[2]=s,e[3]=a):a=e[3],a}function $r(i){const e=se.c(8);let s,a;e[0]!==i?({className:s,...a}=i,e[0]=i,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let l;e[3]!==s?(l=le("notranslate bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",s),e[3]=s,e[4]=l):l=e[4];let m;return e[5]!==a||e[6]!==l?(m=r.jsx(kr,{children:r.jsx(Fr,{"data-slot":"context-menu-content",translate:"no",className:l,...a})}),e[5]=a,e[6]=l,e[7]=m):m=e[7],m}function ue(i){const e=se.c(12);let s,a,l,m;e[0]!==i?({className:s,inset:a,variant:m,...l}=i,e[0]=i,e[1]=s,e[2]=a,e[3]=l,e[4]=m):(s=e[1],a=e[2],l=e[3],m=e[4]);const h=m===void 0?"default":m;let f;e[5]!==s?(f=le("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",s),e[5]=s,e[6]=f):f=e[6];let v;return e[7]!==a||e[8]!==l||e[9]!==f||e[10]!==h?(v=r.jsx(Ar,{"data-slot":"context-menu-item","data-inset":a,"data-variant":h,className:f,...l}),e[7]=a,e[8]=l,e[9]=f,e[10]=h,e[11]=v):v=e[11],v}function st(i){const e=se.c(8);let s,a;e[0]!==i?({className:s,...a}=i,e[0]=i,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let l;e[3]!==s?(l=le("bg-border -mx-1 my-1 h-px",s),e[3]=s,e[4]=l):l=e[4];let m;return e[5]!==a||e[6]!==l?(m=r.jsx(Lr,{"data-slot":"context-menu-separator",className:l,...a}),e[5]=a,e[6]=l,e[7]=m):m=e[7],m}const Kr="#d9a441";function zr(i){const e=se.c(63),{node:s,depth:a,isExpanded:l,isSelected:m,isLoading:h,fileVisual:f,onOpen:v,onSelect:j,onNewFile:d,onNewFolder:x,onCopyPath:g,onCopyRelativePath:k,onRename:Z,onDelete:q}=i,y=h===void 0?!1:h,b=Me(),F=s.kind==="directory",{Icon:A,color:I}=f,S=m&&"bg-accent";let P;e[0]!==S?(P=le("flex w-full items-center gap-1.5 px-2 py-1.5 text-left text-[13px] hover:bg-accent transition-colors",S),e[0]=S,e[1]=P):P=e[1];const D=`${a*14+8}px`;let M;e[2]!==D?(M={paddingLeft:D},e[2]=D,e[3]=M):M=e[3];let N;e[4]!==v||e[5]!==j?(N=()=>{j(),v()},e[4]=v,e[5]=j,e[6]=N):N=e[6];let R;e[7]!==A||e[8]!==I||e[9]!==F||e[10]!==l||e[11]!==y?(R=F?r.jsxs(r.Fragment,{children:[y?r.jsx(fe,{size:14,className:"shrink-0 animate-spin text-muted-foreground"}):l?r.jsx(nr,{size:14,className:"shrink-0 text-muted-foreground"}):r.jsx(rr,{size:14,className:"shrink-0 text-muted-foreground"}),r.jsx(vn,{size:16,className:"shrink-0",style:{color:Kr}})]}):r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"w-3.5 shrink-0"}),r.jsx(A,{size:16,className:"shrink-0",style:{color:I}})]}),e[7]=A,e[8]=I,e[9]=F,e[10]=l,e[11]=y,e[12]=R):R=e[12];let E;e[13]!==s.name?(E=r.jsx("span",{className:"truncate",children:s.name}),e[13]=s.name,e[14]=E):E=e[14];let T;e[15]!==P||e[16]!==M||e[17]!==N||e[18]!==R||e[19]!==E?(T=r.jsx(Ir,{asChild:!0,children:r.jsxs("button",{type:"button",className:P,style:M,onClick:N,children:[R,E]})}),e[15]=P,e[16]=M,e[17]=N,e[18]=R,e[19]=E,e[20]=T):T=e[20];let Q;e[21]!==b?(Q=b("sandbox.fileTreeRow.newFile"),e[21]=b,e[22]=Q):Q=e[22];let X;e[23]!==d||e[24]!==Q?(X=r.jsx(ue,{onSelect:d,children:Q}),e[23]=d,e[24]=Q,e[25]=X):X=e[25];let Y;e[26]!==b?(Y=b("sandbox.fileTreeRow.newFolder"),e[26]=b,e[27]=Y):Y=e[27];let G;e[28]!==x||e[29]!==Y?(G=r.jsx(ue,{onSelect:x,children:Y}),e[28]=x,e[29]=Y,e[30]=G):G=e[30];let $;e[31]===Symbol.for("react.memo_cache_sentinel")?($=r.jsx(st,{}),e[31]=$):$=e[31];let W;e[32]!==b?(W=b("sandbox.fileTreeRow.copyPath"),e[32]=b,e[33]=W):W=e[33];let K;e[34]!==g||e[35]!==W?(K=r.jsx(ue,{onSelect:g,children:W}),e[34]=g,e[35]=W,e[36]=K):K=e[36];let z;e[37]!==b?(z=b("sandbox.fileTreeRow.copyRelativePath"),e[37]=b,e[38]=z):z=e[38];let B;e[39]!==k||e[40]!==z?(B=r.jsx(ue,{onSelect:k,children:z}),e[39]=k,e[40]=z,e[41]=B):B=e[41];let L;e[42]===Symbol.for("react.memo_cache_sentinel")?(L=r.jsx(st,{}),e[42]=L):L=e[42];let V;e[43]!==b?(V=b("sandbox.fileTreeRow.rename"),e[43]=b,e[44]=V):V=e[44];let O;e[45]!==Z||e[46]!==V?(O=r.jsx(ue,{onSelect:Z,children:V}),e[45]=Z,e[46]=V,e[47]=O):O=e[47];let U;e[48]!==b?(U=b("sandbox.fileTreeRow.delete"),e[48]=b,e[49]=U):U=e[49];let ee;e[50]!==q||e[51]!==U?(ee=r.jsx(ue,{variant:"destructive",onSelect:q,children:U}),e[50]=q,e[51]=U,e[52]=ee):ee=e[52];let _;e[53]!==X||e[54]!==G||e[55]!==K||e[56]!==B||e[57]!==O||e[58]!==ee?(_=r.jsxs($r,{className:"w-52",children:[X,G,$,K,B,L,O,ee]}),e[53]=X,e[54]=G,e[55]=K,e[56]=B,e[57]=O,e[58]=ee,e[59]=_):_=e[59];let te;return e[60]!==_||e[61]!==T?(te=r.jsxs(Or,{children:[T,_]}),e[60]=_,e[61]=T,e[62]=te):te=e[62],te}yn.config({paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.0/min/vs"}});const at=200,_r=2,Gr=250,it=200;function Br(i,e,s,a){return`/api/${i}/sandbox/${encodeURIComponent(e)}/${encodeURIComponent(s)}/${a}`}function Vr(i){const e=se.c(9),{text:s,query:a}=i;let l,m,h;if(e[0]!==a||e[1]!==s){const{leadingEllipsis:v,segments:j}=An(s,a);l="truncate font-mono text-muted-foreground",m=v&&r.jsx("span",{className:"text-muted-foreground/50",children:"…"}),h=j.map(Ur),e[0]=a,e[1]=s,e[2]=l,e[3]=m,e[4]=h}else l=e[2],m=e[3],h=e[4];let f;return e[5]!==l||e[6]!==m||e[7]!==h?(f=r.jsxs("span",{className:l,children:[m,h]}),e[5]=l,e[6]=m,e[7]=h,e[8]=f):f=e[8],f}function Ur(i,e){return i.match?r.jsx("span",{className:"rounded-[2px] bg-primary/20 text-foreground",children:i.text},e):r.jsx("span",{children:i.text},e)}function Ra({orgSlug:i,virtualMcpId:e,branch:s,openPath:a}){const[l,m]=u.useState({files:[],directories:[],truncated:!1}),{files:h,directories:f}=l,[v,j]=u.useState(new Set),[d,x]=u.useState(null),[g,k]=u.useState(null),[Z,q]=u.useState([]),[y,b]=u.useState(""),[F,A]=u.useState(null),[I,S]=u.useState(null),[P,D]=u.useState(!1),[M,N]=u.useState(!1),[R,E]=u.useState(!1),[T,Q]=u.useState(!1),[,X]=u.useState(new Set),[Y,G]=u.useState(new Set),$=u.useRef(0),W=u.useRef(null),K=u.useRef(new Set),z=u.useRef(new Map),B=u.useRef(null),L=u.useRef(0),V=u.useRef(null),O=u.useRef(null),U=u.useRef(null);function ee(t){X(n=>{const o=typeof t=="function"?t(n):t;return K.current=o,o})}const[_,te]=u.useState(new Map),Re=u.useRef(null),[ae,he]=u.useState(null),{sendMessage:bt}=Sn(),{openSidePanel:yt}=Dn(),ge=gn(),[H,oe]=u.useState(null),[Te,Pe]=u.useState(null),[be,ye]=u.useState(!1);async function ie(t,n){const o=await fetch(Br(i,e,s,t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(n)});if(!o.ok){const c=await o.json().catch(()=>({}));throw new Error(c.error??`Request failed (${o.status})`)}return o.json()}async function ve(){ge.invalidateQueries({queryKey:rt(i,e,s)})}function _e(t,n,o){navigator.clipboard.writeText(o).then(()=>ne.success(t("sandbox.fileExplorer.textCopied",{label:n})),()=>ne.error(t("sandbox.fileExplorer.failedToCopyText",{label:n.toLowerCase()})))}function vt(t){const n=zn(t);if(!n)return;const o=`${i}/${e}/${s}`;ge.setQueryData(Ze.decofile(o),c=>{if(!c)return c;const{[n]:p,...C}=c;return C}),ge.invalidateQueries({queryKey:Ze.liveMeta(i,e,s)})}function Ct(t){const n=t.kind==="file"?[t.path]:h.filter(o=>o.startsWith(".deco/blocks/")).map(o=>we(o)).filter(o=>o===t.path||o.startsWith(`${t.path}/`));for(const o of n)vt(o)}function wt(t){const n=we(t);return Z.filter(o=>{if(o!==n&&!o.startsWith(`${n}/`))return!1;const c=_.get(o);return!!(c?.loaded&&c.editorValue!==c.savedContent)})}function Ge(t){q(n=>n.map(o=>t(o)).filter(o=>o!==null)),x(n=>n&&t(n)),te(n=>{const o=new Map;for(const[c,p]of n){const C=t(c);C&&o.set(C,p)}return o}),k(n=>{if(!n)return n;const o=t(n.path);return o?o===n.path?n:{...n,path:o,name:o.split("/").pop()??o}:null})}function Nt(t){const n=we(t);k(o=>o&&(o.path===n||o.path.startsWith(`${n}/`)?null:o)),Ge(o=>o===n||o.startsWith(`${n}/`)?null:o)}async function jt(t,n){if(!H)return;const o=Ee(H.parentDir,n);if(Ke(o,h,f))throw new Error(t("sandbox.fileExplorer.fileAlreadyExists",{name:n}));await ie("write",{path:re(o),content:""}),await pe(),await ve(),oe(null),me(o)}async function Et(t,n){if(!H)return;const o=Ee(H.parentDir,n);if(Ke(o,h,f))throw new Error(t("sandbox.fileExplorer.fileAlreadyExists",{name:n}));const c=re(o);await ie("mkdir",{path:c}),m(p=>({...p,directories:p.directories.includes(c)?p.directories:[...p.directories,c]})),await pe(),await ve(),oe(null),j(p=>{const C=new Set(p);for(const ce of Ie(o))C.add(ce);return C.add(o),C}),k({name:n,path:o,kind:"directory",children:[]})}async function St(t,n){if(!H)return;const o=H.node.path,c=Ne(o),p=Ee(c,n);if(p===o){oe(null);return}if(Ke(p,h,f))throw new Error(t("sandbox.fileExplorer.fileAlreadyExists",{name:n}));await ie("rename",{from:re(o),to:re(p)}),Ge(C=>C===o?p:C.startsWith(`${o}/`)?Ee(p,C.slice(o.length+1)):C),await pe(),await ve(),oe(null)}async function Dt(t,n){ye(!0);try{await ie("unlink",{path:re(n.path),recursive:n.kind==="directory"}),Ct(n),Nt(n.path),await pe(),await ve(),Pe(null),ne.success(t("sandbox.fileExplorer.fileDeleted",{name:n.name}))}catch(o){ne.error(o instanceof Error?o.message:t("sandbox.fileExplorer.deleteFailed"))}finally{ye(!1)}}async function Mt(t,n){const o=On(n);if(o){ne.error(o);return}ye(!0);try{H?.mode==="new-file"?(await jt(t,n),ne.success(t("sandbox.fileExplorer.fileCreated",{name:n}))):H?.mode==="new-folder"?(await Et(t,n),ne.success(t("sandbox.fileExplorer.folderCreated",{name:n}))):H?.mode==="rename"&&(await St(t,n),ne.success(t("sandbox.fileExplorer.renamedTo",{name:n})))}catch(c){ne.error(c instanceof Error?c.message:t("sandbox.fileExplorer.operationFailed"))}finally{ye(!1)}}const Be=u.useRef(!1);Be.current||(Be.current=!0,W.current=pe());const[Rt,Tt]=u.useState(null),w=Me();if(a&&a!==Rt){Tt(a);const t=a;queueMicrotask(()=>{Mn(t)&&me(t)})}async function ke(t){const n=await ie("glob",t);return{files:n.files??[],directories:n.directories??[],truncated:n.truncated}}function Ve(t,n,o){if(o!==$.current)return!1;let c=!1;return m(p=>{const C=n?_n(p.files,p.directories,t,p.truncated):{files:t.files,directories:t.directories??[],truncated:!!t.truncated};return c=!!C.truncated,{files:C.files,directories:C.directories,truncated:c}}),c&&ne.warning(w("sandbox.fileExplorer.fileListTruncated")),c}async function Pt(t){const n=z.current.get(t);if(n)return n;const o=$.current,c=(async()=>{const p=await ke({pattern:"**/*",path:re(t),limit:Ae}),C=Ve(p,!0,o);return!C&&o===$.current&&ee(ce=>{const Ce=new Set(ce);return Ce.add(t),Ce}),C})();z.current.set(t,c);try{return await c}finally{z.current.delete(t)}}async function Ue(t){if(!$e(t,K.current))return!1;G(n=>new Set(n).add(t));try{return await Pt(t)}finally{G(n=>{const o=new Set(n);return o.delete(t),o})}}async function kt(t,n){const o=new Set(K.current);for(const c of Ie(n)){if(!$e(c,o))continue;if(await Ue(c))throw new Error(t("sandbox.fileExplorer.folderListingTruncated"));o.add(c)}}async function pe(){const t=++$.current;V.current=null,O.current=null,z.current.clear(),E(!0),ee(new Set),j(new Set),G(new Set);try{const n=await ke({pattern:"**/*",limit:Ae,maxDepth:Rn});Ve(n,!1,t),Q(!0)}catch{T&&ne.error(w("sandbox.fileExplorer.failedToRefreshFileTree"))}finally{E(!1)}}async function He(t){if(!_.get(t)?.loaded){te(o=>{const c=new Map(o);return c.set(t,{savedContent:"",editorValue:"",loaded:!1}),c});try{const o=await ie("read",{path:re(t),full:!0}),c=Ln(o.content??"");te(p=>{const C=new Map(p);return C.set(t,{savedContent:c,editorValue:c,loaded:!0}),C})}catch{}}}function Ft(){L.current++,A(null),S(null),D(!1),N(!1)}async function At(){const t=$.current,n=V.current;if(n&&n.generation===t)return n.files;const o=O.current;if(o&&o.generation===t)return o.promise;const c=(async()=>{const p=await ke({pattern:"**/*",limit:Ae});return $.current===t&&(V.current={generation:t,files:p.files}),p.files})();O.current={generation:t,promise:c};try{return await c}finally{O.current?.generation===t&&(O.current=null)}}async function Lt(t,n){try{const o=await At();if(n!==L.current)return;A($n(o,t,it))}catch{if(n!==L.current)return;A([])}}async function Ot(t,n){D(!0);try{const o=await ie("grep",{pattern:t,output_mode:"content",ignore_case:!0,fixed_strings:!0,limit:at});if(n!==L.current)return;S(Kn(o.results??"")),N((o.matchCount??0)>=at)}catch{if(n!==L.current)return;S([]),N(!1)}finally{n===L.current&&D(!1)}}function It(t){const n=t.trim(),o=++L.current;Lt(n,o),n.length<_r?(S(null),D(!1),N(!1)):Ot(n,o)}function $t(t){if(b(t),B.current&&clearTimeout(B.current),!t.trim()){Ft();return}B.current=setTimeout(()=>{It(t)},Gr)}function qe(t){const n=U.current;if(!n||n.path!==d)return;U.current=null;const o=Math.max(1,n.line);t.revealLineInCenter(o),t.setPosition({lineNumber:o,column:1}),t.focus()}function Kt(t){U.current={path:t.path,line:t.line};const n=d===t.path&&_.get(t.path)?.loaded;me(t.path),n&&Re.current&&qe(Re.current)}async function zt(t,n){try{await ie("write",{path:re(t),content:n}),je("file saved via sandbox /write",{path:t}),ge.invalidateQueries({queryKey:rt(i,e,s)});try{const o=await In(i,e,s);je("git status after save",o)}catch(o){je("git status after save failed",{path:t,error:o instanceof Error?o.message:String(o)})}te(o=>{const c=new Map(o),p=c.get(t);return p&&c.set(t,{...p,savedContent:n}),c})}catch(o){je("file save failed",{path:t,error:o instanceof Error?o.message:String(o)})}}function _t(t){x(t),k({name:t.split("/").pop()??t,path:t,kind:"file",children:[]}),he(null),Z.includes(t)||q(n=>[...n,t]),He(t)}function Gt(t){q(n=>{const o=n.filter(c=>c!==t);return d===t&&x(o[o.length-1]??null),o}),te(n=>{const o=new Map(n);return o.delete(t),o})}function We(t){j(n=>{const o=new Set(n);return o.has(t)?o.delete(t):o.add(t),o})}async function Bt(t){if($e(t,K.current))try{if(await Ue(t))return}catch(n){ne.error(n instanceof Error?n.message:w("sandbox.fileExplorer.failedToLoadFolder"));return}We(t)}async function Vt(t,n){if(n){We(t);return}await Bt(t)}async function Ut(t){await W.current,await kt(w,t);const n=Ie(t);j(o=>{const c=new Set(o);for(const p of n)c.add(p);return c}),_t(t)}function me(t){Ut(t).catch(n=>{ne.error(n instanceof Error?n.message:w("sandbox.fileExplorer.failedToOpenFile"))})}function Ht(){return g?.kind==="directory"?g.path:g?.kind==="file"?Ne(g.path):d?Ne(d):"/"}function Qe(t){const n=Ht();oe({mode:t,parentDir:n,node:{name:"",path:n,kind:"directory",children:[]}})}const qt=Tn(h,f),Xe=Pn(qt,v),Fe=F?.length??0,Ye=kn(I??[]),Je=I?.length??0,de=d?_.get(d):null,Wt=de?.loaded&&de.editorValue!==de.savedContent,Qt=Te?wt(Te.path):[],Xt=(t,n)=>{Re.current=t,qe(t),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyS,async()=>{if(!d)return;const o=t.getValue();await zt(d,o)}),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyK,()=>{const o=t.getSelection(),c=t.getModel();if(!o||!c||!d)return;const p=c.getValueInRange(o);he({filePath:d,lineStart:o.startLineNumber,lineEnd:o.endLineNumber,selectedCode:p})})};function Yt(t){if(!ae)return;const n=[`The user selected code in the file explorer and asked: **"${t.trim()}"**`,"",`**File:** \`${ae.filePath}\``,`**Lines:** ${ae.lineStart}–${ae.lineEnd}`];if(ae.selectedCode){const o=Oe(ae.filePath),c=ae.selectedCode.replace(/```/g,"`` `");n.push("","**Selected code:**","```"+o,c,"```")}n.push("","Please read the source file, locate the code, and apply the requested change."),yt("chat"),bt({parts:[{type:"text",text:n.join(`
2
2
  `)}]}),he(null)}return R&&!T?r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(fe,{size:20,className:"animate-spin text-muted-foreground"})}):r.jsxs("div",{className:"flex h-full w-full overflow-hidden",children:[r.jsxs("div",{className:"w-64 shrink-0 border-r flex flex-col overflow-hidden",children:[r.jsxs("div",{className:"flex items-center gap-1 p-2 border-b",children:[r.jsxs("div",{className:"relative min-w-0 flex-1",children:[r.jsx(Cn,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground"}),r.jsx("input",{type:"text",value:y,onChange:t=>$t(t.target.value),placeholder:w("sandbox.fileExplorer.searchFilesPlaceholder"),"aria-label":w("sandbox.fileExplorer.searchFilesLabel"),className:"w-full rounded-md border border-input bg-transparent pl-7 pr-2 py-1.5 text-xs outline-none placeholder:text-muted-foreground focus:ring-1 focus:ring-ring"})]}),r.jsxs(et,{children:[r.jsx(tt,{asChild:!0,children:r.jsx(De,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":w("sandbox.fileExplorer.newFileLabel"),onClick:()=>Qe("new-file"),children:r.jsx(wn,{size:14})})}),r.jsx(nt,{side:"bottom",children:w("sandbox.fileExplorer.newFile")})]}),r.jsxs(et,{children:[r.jsx(tt,{asChild:!0,children:r.jsx(De,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":w("sandbox.fileExplorer.newFolderLabel"),onClick:()=>Qe("new-folder"),children:r.jsx(Nn,{size:14})})}),r.jsx(nt,{side:"bottom",children:w("sandbox.fileExplorer.newFolder")})]})]}),r.jsx(En,{className:"flex-1",children:r.jsxs("div",{className:"py-1",children:[!y&&Xe.map(t=>{const{node:n,depth:o}=t,c=n.kind==="directory",p=v.has(n.path),C=g?.path===n.path,ce=Fn(n.path,n.kind),Ce=c&&Y.has(n.path);return r.jsx(zr,{node:n,depth:o,isExpanded:p,isSelected:C,isLoading:Ce,fileVisual:Le(n.name),onSelect:()=>k(n),onOpen:()=>{c?Vt(n.path,p):me(n.path)},onNewFile:()=>oe({mode:"new-file",node:n,parentDir:ce}),onNewFolder:()=>oe({mode:"new-folder",node:n,parentDir:ce}),onCopyPath:()=>_e(w,"Path",we(n.path)),onCopyRelativePath:()=>_e(w,"Relative path",re(n.path)),onRename:()=>oe({mode:"rename",node:n,parentDir:ce}),onDelete:()=>Pe(n)},n.path)}),!y&&T&&Xe.length===0&&r.jsx("div",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:w("sandbox.fileExplorer.noFilesFound")}),y&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"flex items-center gap-1.5 px-3 pb-0.5 pt-1 text-[10px] font-medium uppercase tracking-wide text-muted-foreground",children:[r.jsx("span",{children:w("sandbox.fileExplorer.files")}),Fe>0&&r.jsxs("span",{className:"normal-case tracking-normal text-muted-foreground/70",children:[Fe,Fe>=it?"+":""]})]}),F!==null&&F.length===0&&r.jsx("div",{className:"px-3 py-1 text-xs text-muted-foreground",children:w("sandbox.fileExplorer.noFileNamesMatch")}),F?.map(t=>{const n=t.split("/").pop()??t,o=Ne(t),{Icon:c,color:p}=Le(n),C=d===t;return r.jsxs("button",{type:"button",onClick:()=>me(t),title:t,className:le("flex w-full items-center gap-1.5 px-3 py-1 text-left text-xs hover:bg-accent",C&&"bg-accent"),children:[r.jsx(c,{size:14,className:le("shrink-0",p)}),r.jsx("span",{className:"max-w-40 shrink-0 truncate",children:n}),o!=="/"&&r.jsx("span",{className:"truncate text-muted-foreground/60",children:o})]},t)})]}),y&&r.jsxs("div",{className:"mt-1 border-t pt-1",children:[r.jsxs("div",{className:"flex items-center gap-1.5 px-3 pb-0.5 pt-1 text-[10px] font-medium uppercase tracking-wide text-muted-foreground",children:[r.jsx("span",{children:w("sandbox.fileExplorer.inFiles")}),Je>0&&r.jsxs("span",{className:"text-muted-foreground/70 normal-case tracking-normal",children:[Je,M?"+":""]}),P&&r.jsx(fe,{size:10,className:"animate-spin"})]}),!P&&I!==null&&Ye.length===0&&r.jsx("div",{className:"px-3 py-1 text-xs text-muted-foreground",children:w("sandbox.fileExplorer.noMatchesInFileContents")}),Ye.map(t=>{const n=t.path.split("/").pop()??t.path,{Icon:o,color:c}=Le(n);return r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1 text-xs text-muted-foreground",children:[r.jsx(o,{size:14,className:le("shrink-0",c)}),r.jsx("span",{className:"truncate",children:n}),r.jsx("span",{className:"text-muted-foreground/60",children:t.matches.length})]}),t.matches.map(p=>r.jsxs("button",{type:"button",onClick:()=>Kt(p),title:`${t.path}:${p.line}`,className:"flex w-full items-baseline gap-2 pl-8 pr-3 py-0.5 text-left text-xs hover:bg-accent",children:[r.jsx("span",{className:"shrink-0 tabular-nums text-muted-foreground",children:p.line}),r.jsx(Vr,{text:p.text,query:y})]},`${t.path}:${p.line}`))]},t.path)})]})]})})]}),r.jsxs("div",{className:"relative flex-1 flex flex-col overflow-hidden",children:[Z.length>0&&r.jsx("div",{className:"flex items-center border-b overflow-x-auto shrink-0",children:Z.map(t=>{const n=_.get(t),o=n?.loaded&&n.editorValue!==n.savedContent,c=d===t,p=t.split("/").pop()??t;return r.jsxs("div",{className:le("flex items-center gap-1 px-3 py-1.5 text-xs border-r cursor-pointer transition-colors",c?"bg-background text-foreground":"bg-muted/50 text-muted-foreground hover:bg-accent"),onClick:()=>{x(t),He(t)},onKeyDown:()=>{},role:"tab",tabIndex:0,"aria-selected":c,children:[r.jsx("span",{className:"truncate max-w-32",children:p}),o&&r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-foreground/60 shrink-0"}),r.jsx("button",{type:"button",className:"ml-1 rounded p-0.5 hover:bg-accent-foreground/10",onClick:C=>{C.stopPropagation(),Gt(t)},children:r.jsx(jn,{size:12})})]},t)})}),ae&&r.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 z-20 mt-2",style:{width:"360px"},children:r.jsxs("form",{className:"flex w-full items-center gap-1.5 rounded-xl border border-border bg-background/95 px-3 py-1.5 shadow-lg backdrop-blur",onSubmit:t=>{t.preventDefault();const o=t.currentTarget.elements.namedItem("askAiInput");o.value.trim()&&Yt(o.value)},children:[r.jsx("input",{name:"askAiInput",autoFocus:!0,type:"text",placeholder:w("sandbox.fileExplorer.askTheAiPlaceholder"),className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground",onKeyDown:t=>{t.stopPropagation(),t.key==="Escape"&&he(null)}}),r.jsx("button",{type:"submit",className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-foreground text-background transition-opacity",title:w("sandbox.fileExplorer.send"),children:r.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[r.jsx("title",{children:w("sandbox.fileExplorer.send")}),r.jsx("path",{d:"M5 9V1M1 5l4-4 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})}),r.jsx("div",{className:"flex-1 overflow-hidden",children:d&&de?.loaded?r.jsx(bn,{language:Oe(d),theme:document.documentElement.classList.contains("dark")?"vs-dark":"light",value:de.editorValue,path:d,onChange:t=>{const n=d;n&&te(o=>{const c=new Map(o),p=c.get(n);return p&&c.set(n,{...p,editorValue:t??""}),c})},onMount:Xt,loading:r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(fe,{size:20,className:"animate-spin text-muted-foreground"})}),options:{fontSize:13,scrollBeyondLastLine:!1,automaticLayout:!0,lineNumbersMinChars:2,wordWrap:"on",minimap:{enabled:!1},padding:{top:12,bottom:12},scrollbar:{vertical:"auto",horizontal:"auto",verticalScrollbarSize:8,horizontalScrollbarSize:8}}},d):d&&!de?.loaded?r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(fe,{size:20,className:"animate-spin text-muted-foreground"})}):r.jsx("div",{className:"flex items-center justify-center h-full w-full text-sm text-muted-foreground",children:w("sandbox.fileExplorer.selectFileToEdit")})}),d&&r.jsxs("div",{className:"flex items-center justify-between px-3 py-1 border-t text-[11px] text-muted-foreground shrink-0",children:[r.jsx("span",{className:"truncate",children:d}),r.jsxs("span",{children:[w(Wt?"sandbox.fileExplorer.modified":"sandbox.fileExplorer.saved")," ","· ",Oe(d)]})]})]}),r.jsx(sr,{open:H!==null,mode:H?.mode??"new-file",initialName:H?.mode==="rename"?H.node.name:"",parentLabel:H&&H.mode!=="rename"?H.parentDir==="/"?"/":re(H.parentDir):void 0,isPending:be,onSubmit:t=>Mt(w,t),onOpenChange:t=>{!t&&!be&&oe(null)}}),r.jsx(ar,{deleteTarget:Te,deleteDirtyPaths:Qt,fsActionPending:be,onOpenChange:t=>{!t&&!be&&Pe(null)},onConfirm:t=>{Dt(w,t)}})]})}export{Ra as FileExplorer};
@@ -1 +1 @@
1
- import{dO as C,c as d,j as c,a6 as j,r as f,m as p,b6 as b,dP as v,dQ as h}from"./index-CpB-IlaU.js";import{L as N}from"./label-COIo3JhO.js";const E=C,g=f.createContext({}),M=t=>{const e=d.c(9);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let o;e[2]!==s.name?(o={name:s.name},e[2]=s.name,e[3]=o):o=e[3];let n;e[4]!==s?(n=c.jsx(j,{...s}),e[4]=s,e[5]=n):n=e[5];let r;return e[6]!==o||e[7]!==n?(r=c.jsx(g.Provider,{value:o,children:n}),e[6]=o,e[7]=n,e[8]=r):r=e[8],r},x=()=>{const t=d.c(13),e=f.useContext(g),s=f.useContext($),{getFieldState:o}=v();let n;t[0]!==e.name?(n={name:e.name},t[0]=e.name,t[1]=n):n=t[1];const r=h(n);let a;t[2]!==e.name||t[3]!==r||t[4]!==o?(a=o(e.name,r),t[2]=e.name,t[3]=r,t[4]=o,t[5]=a):a=t[5];const l=a;if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=s,m=`${i}-form-item`,F=`${i}-form-item-description`,I=`${i}-form-item-message`;let u;return t[6]!==e.name||t[7]!==l||t[8]!==i||t[9]!==m||t[10]!==F||t[11]!==I?(u={id:i,name:e.name,formItemId:m,formDescriptionId:F,formMessageId:I,...l},t[6]=e.name,t[7]=l,t[8]=i,t[9]=m,t[10]=F,t[11]=I,t[12]=u):u=t[12],u},$=f.createContext({});function P(t){const e=d.c(13);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const n=f.useId();let r;e[3]!==n?(r={id:n},e[3]=n,e[4]=r):r=e[4];let a;e[5]!==s?(a=p("grid gap-2",s),e[5]=s,e[6]=a):a=e[6];let l;e[7]!==o||e[8]!==a?(l=c.jsx("div",{"data-slot":"form-item",className:a,...o}),e[7]=o,e[8]=a,e[9]=l):l=e[9];let i;return e[10]!==r||e[11]!==l?(i=c.jsx($.Provider,{value:r,children:l}),e[10]=r,e[11]=l,e[12]=i):i=e[12],i}function w(t){const e=d.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:n,formItemId:r}=x(),a=!!n;let l;e[3]!==s?(l=p("text-foreground data-[error=true]:text-destructive",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==r||e[6]!==o||e[7]!==a||e[8]!==l?(i=c.jsx(N,{"data-slot":"form-label","data-error":a,className:l,htmlFor:r,...o}),e[5]=r,e[6]=o,e[7]=a,e[8]=l,e[9]=i):i=e[9],i}function L(t){const e=d.c(7);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];const{error:o,formItemId:n,formDescriptionId:r,formMessageId:a}=x(),l=o?`${r} ${a}`:`${r}`,i=!!o;let m;return e[2]!==n||e[3]!==s||e[4]!==l||e[5]!==i?(m=c.jsx(b,{"data-slot":"form-control",id:n,"aria-describedby":l,"aria-invalid":i,...s}),e[2]=n,e[3]=s,e[4]=l,e[5]=i,e[6]=m):m=e[6],m}function y(t){const e=d.c(9);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{formDescriptionId:n}=x();let r;e[3]!==s?(r=p("text-muted-foreground text-sm",s),e[3]=s,e[4]=r):r=e[4];let a;return e[5]!==n||e[6]!==o||e[7]!==r?(a=c.jsx("p",{"data-slot":"form-description",id:n,className:r,...o}),e[5]=n,e[6]=o,e[7]=r,e[8]=a):a=e[8],a}function R(t){const e=d.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:n,formMessageId:r}=x(),a=n?String(n?.message??""):o.children;if(!a)return null;let l;e[3]!==s?(l=p("text-destructive text-sm",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==a||e[6]!==r||e[7]!==o||e[8]!==l?(i=c.jsx("p",{"data-slot":"form-message",id:r,className:l,...o,children:a}),e[5]=a,e[6]=r,e[7]=o,e[8]=l,e[9]=i):i=e[9],i}export{M as F,E as a,P as b,w as c,L as d,R as e,y as f};
1
+ import{dO as C,c as d,j as c,a6 as j,r as f,m as p,b6 as b,dP as v,dQ as h}from"./index-CjF26QCG.js";import{L as N}from"./label-BuF4MPfP.js";const E=C,g=f.createContext({}),M=t=>{const e=d.c(9);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let o;e[2]!==s.name?(o={name:s.name},e[2]=s.name,e[3]=o):o=e[3];let n;e[4]!==s?(n=c.jsx(j,{...s}),e[4]=s,e[5]=n):n=e[5];let r;return e[6]!==o||e[7]!==n?(r=c.jsx(g.Provider,{value:o,children:n}),e[6]=o,e[7]=n,e[8]=r):r=e[8],r},x=()=>{const t=d.c(13),e=f.useContext(g),s=f.useContext($),{getFieldState:o}=v();let n;t[0]!==e.name?(n={name:e.name},t[0]=e.name,t[1]=n):n=t[1];const r=h(n);let a;t[2]!==e.name||t[3]!==r||t[4]!==o?(a=o(e.name,r),t[2]=e.name,t[3]=r,t[4]=o,t[5]=a):a=t[5];const l=a;if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=s,m=`${i}-form-item`,F=`${i}-form-item-description`,I=`${i}-form-item-message`;let u;return t[6]!==e.name||t[7]!==l||t[8]!==i||t[9]!==m||t[10]!==F||t[11]!==I?(u={id:i,name:e.name,formItemId:m,formDescriptionId:F,formMessageId:I,...l},t[6]=e.name,t[7]=l,t[8]=i,t[9]=m,t[10]=F,t[11]=I,t[12]=u):u=t[12],u},$=f.createContext({});function P(t){const e=d.c(13);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const n=f.useId();let r;e[3]!==n?(r={id:n},e[3]=n,e[4]=r):r=e[4];let a;e[5]!==s?(a=p("grid gap-2",s),e[5]=s,e[6]=a):a=e[6];let l;e[7]!==o||e[8]!==a?(l=c.jsx("div",{"data-slot":"form-item",className:a,...o}),e[7]=o,e[8]=a,e[9]=l):l=e[9];let i;return e[10]!==r||e[11]!==l?(i=c.jsx($.Provider,{value:r,children:l}),e[10]=r,e[11]=l,e[12]=i):i=e[12],i}function w(t){const e=d.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:n,formItemId:r}=x(),a=!!n;let l;e[3]!==s?(l=p("text-foreground data-[error=true]:text-destructive",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==r||e[6]!==o||e[7]!==a||e[8]!==l?(i=c.jsx(N,{"data-slot":"form-label","data-error":a,className:l,htmlFor:r,...o}),e[5]=r,e[6]=o,e[7]=a,e[8]=l,e[9]=i):i=e[9],i}function L(t){const e=d.c(7);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];const{error:o,formItemId:n,formDescriptionId:r,formMessageId:a}=x(),l=o?`${r} ${a}`:`${r}`,i=!!o;let m;return e[2]!==n||e[3]!==s||e[4]!==l||e[5]!==i?(m=c.jsx(b,{"data-slot":"form-control",id:n,"aria-describedby":l,"aria-invalid":i,...s}),e[2]=n,e[3]=s,e[4]=l,e[5]=i,e[6]=m):m=e[6],m}function y(t){const e=d.c(9);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{formDescriptionId:n}=x();let r;e[3]!==s?(r=p("text-muted-foreground text-sm",s),e[3]=s,e[4]=r):r=e[4];let a;return e[5]!==n||e[6]!==o||e[7]!==r?(a=c.jsx("p",{"data-slot":"form-description",id:n,className:r,...o}),e[5]=n,e[6]=o,e[7]=r,e[8]=a):a=e[8],a}function R(t){const e=d.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:n,formMessageId:r}=x(),a=n?String(n?.message??""):o.children;if(!a)return null;let l;e[3]!==s?(l=p("text-destructive text-sm",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==a||e[6]!==r||e[7]!==o||e[8]!==l?(i=c.jsx("p",{"data-slot":"form-message",id:r,className:l,...o,children:a}),e[5]=a,e[6]=r,e[7]=o,e[8]=l,e[9]=i):i=e[9],i}export{M as F,E as a,P as b,w as c,L as d,R as e,y as f};
@@ -1 +1 @@
1
- import{c as P,F as H,r as Z,j as i,B as te,L as ue,X as fe,Y as J,b as K,d as pe,o as he,_ as xe,Z as je,e as le,p as ie,t as F,K as oe,a6 as re,G as ae,w as Se}from"./index-CpB-IlaU.js";import{P as W}from"./index-1MK4_xnA.js";import{A as ze,b as ve}from"./alert-CVSN7Bm8.js";import{i as be}from"./XCircle-CsSTNWPK.js";import{n as Ae}from"./LinkExternal01-BeqUZ5mh.js";import{s as ye}from"./XClose-BcoCd49U.js";import{u as Ce}from"./use-org-auth-client-B4AXfjB6.js";import{u as _e}from"./use-debounced-autosave-DKkHA0__.js";import{A as Oe}from"./avatar-DzM4poL0.js";import{I as ce}from"./input-d_-U8Dix.js";import{S as se,a as ne,b as Q,c as we}from"./settings-section-DFb19YyU.js";import{d as me,S as Ne,a as De,b as Te,c as Fe}from"./select-lph10Txc.js";import{S as Ee}from"./skeleton-TLHNqNsZ.js";import{A as ge}from"./agent-icon-dfCTMRkW.js";import{a as Pe,i as ke,f as Re}from"./use-mcp-client-nWQQesMe.js";import{a as Ie}from"./use-virtual-mcp-BWv80DLH.js";import{a as Le}from"./agent-capabilities-cXfbMfjV.js";import{e as Me,h as Ve}from"./use-organization-settings-CRMcF-sH.js";import{D as $e}from"./domain-settings-D0QKeLfw.js";import{u as Be}from"./studio-tools-D5VF1LfT.js";import{c as Ge,d as Ue,b as qe,f as Ke,g as Qe,e as Ze,a as Ye,A as We}from"./alert-dialog-nUW7phRB.js";import{R as He}from"./require-capability-CwWZRwbh.js";import"./sidebar-LfWRhUzl.js";import"./LayoutLeft-CrFA9fWe.js";import"./use-mobile-Z2zaMHdo.js";import"./X-Bb4zY2_f.js";import"./tooltip-DIgwzaVn.js";import"./User01-DyigsrSz.js";import"./card-By2Ftpqp.js";import"./ArrowUpRight-CJ_7mRw-.js";import"./Check-qJLO8g4w.js";import"./ChevronDown-3-gbZo8q.js";import"./ChevronUp-B3CtolQ8.js";import"./AlertCircle-DCV-J_17.js";import"./Tool01-J1ZnkFdg.js";import"./ArrowUp-BlWwKW4L.js";import"./Settings02-CQm8x-Mo.js";import"./Tool02-CAeGe_oA.js";import"./TrendUp01-CDPaEeJa.js";import"./ZapSquare-BtQYmRZ9.js";import"./Users03-_2DmtKO7.js";import"./CheckCircle-DUp67_eI.js";import"./ChevronRight-CJOIJTmS.js";import"./DotsVertical-DpBcrugn.js";import"./Stars02-CEkp7b-G.js";import"./Copy01-DOfL1Wyb.js";import"./Eye-CK6s5DvS.js";import"./FilterLines-DzH0NKwR.js";import"./Star01-b9CKRdDr.js";import"./Palette-B2ca0bVn.js";import"./SwitchHorizontal01-CX0zzRKH.js";import"./HardDrive-CwqHmUxc.js";import"./Key01-CKSbFlEj.js";import"./LogOut01-Cx0bCNIs.js";import"./Monitor01-BWjooWlk.js";import"./Sun-tN9skZqx.js";import"./Play-C68U-efL.js";import"./Plus-B8mhYaf-.js";import"./SearchLg-CcqZwpgI.js";import"./SearchMd-BoHX07tM.js";import"./Shield01-BZ0gGCjQ.js";import"./Stars01-DBbpvSkt.js";import"./Trash01-DimX9kYZ.js";import"./Upload01-B6ohqCNy.js";import"./Users01-P5l8QOnd.js";import"./Zap-Ba39SNX5.js";import"./auth-DuesnJ3t.js";import"./badge-Dq0vpO1O.js";import"./use-capability-DBGC11nS.js";import"./access-gate-DsDJYJZV.js";import"./capability-load-error-tYGfRV_T.js";function de(e){return`connect-banner-dismissed:${e}`}function Xe(e){if(typeof window>"u")return!0;try{return localStorage.getItem(de(e))==="1"}catch{return!1}}function Je(){const e=P.c(17),{org:t}=H();let s;e[0]!==t.id?(s=()=>Xe(t.id),e[0]=t.id,e[1]=s):s=e[1];const[g,u]=Z.useState(s);if(g)return null;let o;e[2]!==t.id?(o=()=>{u(!0);try{localStorage.setItem(de(t.id),"1")}catch{}},e[2]=t.id,e[3]=o):o=e[3];const d=o;let m;e[4]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(Ae,{}),e[4]=m):m=e[4];let a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx("span",{children:"Use Studio MCP anywhere — paste a command into Claude Code, Cursor, Codex, or any MCP client."}),e[5]=a):a=e[5];let c;e[6]!==t.slug?(c={org:t.slug},e[6]=t.slug,e[7]=c):c=e[7];let f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx(be,{size:12}),e[8]=f):f=e[8];let n;e[9]!==c?(n=i.jsx(te,{asChild:!0,size:"sm",variant:"ghost",className:"text-xs gap-1",children:i.jsxs(ue,{to:"/$org/settings/connect",params:c,children:["Connect to clients ",f]})}),e[9]=c,e[10]=n):n=e[10];let r;e[11]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(ye,{size:14}),e[11]=r):r=e[11];let l;e[12]!==d?(l=i.jsx(te,{variant:"ghost",size:"icon",className:"size-7",onClick:d,"aria-label":"Dismiss",children:r}),e[12]=d,e[13]=l):l=e[13];let p;return e[14]!==n||e[15]!==l?(p=i.jsxs(ze,{variant:"info",className:"items-center",children:[m,i.jsxs(ve,{className:"flex-1 flex items-center justify-between gap-2 text-sm",children:[a,i.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[n,l]})]})]}),e[14]=n,e[15]=l,e[16]=p):p=e[16],p}const et=new Set([".well-known","_admin","api","auth","cli","commerce-onboarding","dbos-queue-depth","health","hosted-run-pending","login","mcp","metrics","oauth","oauth-proxy","onboarding","org","report","reset-password"]);function tt(e){return typeof e=="string"&&et.has(e.trim().toLowerCase())}const it=fe({name:J().min(1,"Name is required").max(255,"Name is too long"),slug:J().min(1,"Slug is required").max(50,"Slug is too long").regex(/^[a-z0-9-]+$/,"Slug must contain only lowercase letters, numbers, and hyphens").refine(e=>!tt(e),"This organization URL is reserved by Studio"),logo:J().optional()});function st(e){const t=P.c(17),{value:s,onChange:g,name:u,disabled:o}=e,d=K(),m=Z.useRef(null);let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a=()=>m.current?.click(),t[0]=a):a=t[0];const c=a;let f;t[1]!==g||t[2]!==d?(f=O=>{const h=O.target.files?.[0];if(!h)return;if(h.size>2097152){F.error(d("settings.organizationForm.imageTooLarge"));return}const x=new FileReader;x.onerror=()=>F.error(d("settings.organizationForm.failedToReadImage")),x.onloadend=()=>{x.result&&g(x.result),m.current&&(m.current.value="")},x.readAsDataURL(h)},t[1]=g,t[2]=d,t[3]=f):f=t[3];const n=f;let r;t[4]!==d?(r=d("settings.organizationForm.uploadLogoLabel"),t[4]=d,t[5]=r):r=t[5];let l;t[6]!==o||t[7]!==n?(l=i.jsx("input",{ref:m,type:"file",accept:"image/*",onChange:n,className:"hidden",disabled:o}),t[6]=o,t[7]=n,t[8]=l):l=t[8];const p=s||void 0,j=u??"?";let S;t[9]!==p||t[10]!==j?(S=i.jsx(Oe,{url:p,fallback:j,shape:"square",size:"base"}),t[9]=p,t[10]=j,t[11]=S):S=t[11];let v;return t[12]!==o||t[13]!==r||t[14]!==l||t[15]!==S?(v=i.jsxs("button",{type:"button",onClick:c,disabled:o,className:"rounded-lg overflow-hidden hover:ring-2 hover:ring-border transition-all disabled:opacity-50","aria-label":r,children:[l,S]}),t[12]=o,t[13]=r,t[14]=l,t[15]=S,t[16]=v):v=t[16],v}function nt(){const e=K(),t=pe(),{org:s}=H(),g=Ce(),u=he(),o=xe({resolver:je(it),values:{name:s.name??"",slug:s.slug??"",logo:s.logo??""}}),d=le({mutationFn:async n=>{const r={name:n.name,slug:n.slug};n.logo&&(r.logo=n.logo);const l=await g.organization.update({data:r});if(l?.error)throw new Error(l.error.message||e("settings.organizationForm.failedToUpdateOrg"));return l},onSuccess:(n,r)=>{ie("organization_settings_updated",{organization_id:s.id,fields:Object.keys(r)}),u.invalidateQueries({queryKey:oe.organizations()}),u.invalidateQueries({queryKey:oe.activeOrganization(s.slug)}),F.success(e("settings.organizationForm.updateSuccess")),n?.data?.slug&&n.data.slug!==s.slug&&t({to:"/$org/settings/general",params:{org:n.data.slug}})},onError:(n,r)=>{ie("organization_settings_update_failed",{organization_id:s.id,fields:Object.keys(r),error:n instanceof Error?n.message:String(n)}),F.error(n instanceof Error?n.message:e("settings.organizationForm.failedToUpdateOrg"))}}),{schedule:m,flush:a}=_e({save:async()=>{const n=o.control._formState.dirtyFields;if(Object.keys(n).length===0||!await o.trigger())return;const l=o.getValues(),p=o.control._defaultValues;o.reset(l,{keepValues:!0});try{await d.mutateAsync(l)}catch{o.reset(p,{keepValues:!0})}}}),c=o.formState.errors,f=typeof window<"u"?`${window.location.host}/`:"";return i.jsx(se,{children:i.jsxs(ne,{children:[i.jsx(Q,{title:e("settings.organizationForm.logoTitle"),description:e("settings.organizationForm.logoDescription"),action:i.jsx(st,{value:o.watch("logo"),onChange:n=>{o.setValue("logo",n??"",{shouldDirty:!0}),a()},name:o.watch("name")})}),i.jsx(Q,{title:e("settings.organizationForm.nameTitle"),action:i.jsx(re,{control:o.control,name:"name",render:({field:n})=>i.jsx(ce,{id:"org-name",...n,onChange:r=>{n.onChange(r),m()},onBlur:()=>{n.onBlur(),a()},placeholder:e("settings.organizationForm.namePlaceholder"),className:"w-[280px]"})})}),i.jsx(Q,{title:e("settings.organizationForm.urlTitle"),action:i.jsxs("div",{className:"flex items-center w-[280px] rounded-md border border-input bg-input/30 focus-within:ring-2 focus-within:ring-ring/50 overflow-hidden",children:[f&&i.jsx("span",{className:"pl-3 text-sm text-muted-foreground select-none",children:f}),i.jsx(re,{control:o.control,name:"slug",render:({field:n})=>i.jsx("input",{id:"org-slug",value:n.value??"",name:n.name,ref:n.ref,placeholder:e("settings.organizationForm.slugPlaceholder"),className:"flex-1 min-w-0 bg-transparent px-2 py-1.5 text-sm text-foreground placeholder:text-muted-foreground/60 outline-none",onChange:r=>{const l=r.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");o.setValue("slug",l,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0}),m()},onBlur:()=>{n.onBlur(),a()}})})]})}),(c.name||c.slug||c.logo)&&i.jsxs("div",{className:"px-5 pb-3 flex flex-col gap-1",children:[c.name&&i.jsx("p",{className:"text-xs text-destructive",children:c.name.message}),c.slug&&i.jsx("p",{className:"text-xs text-destructive",children:c.slug.message}),c.logo&&i.jsx("p",{className:"text-xs text-destructive",children:c.logo.message})]})]})})}const ee="__super_agent__";function ot(){const e=P.c(42),t=K(),{org:s}=H(),g=Ie(),{mainAgentId:u}=Me(),o=Ve();let d,m,a,c,f,n,r,l;if(e[0]!==g||e[1]!==u||e[2]!==s.id||e[3]!==o||e[4]!==t){const S=Le(g),v=(g??[]).filter(lt).filter(z=>!S.has(z.id)).filter(at);let O;e[13]!==s.id?(O=Pe(s.id),e[13]=s.id,e[14]=O):O=e[14];const h=O,x=u!=null?(g??[]).find(z=>z.id===u):void 0,w=x?x.id:ee,N=x&&!v.some(z=>z.id===x.id)?[x,...v]:v;let _;e[15]!==g||e[16]!==o||e[17]!==h.title||e[18]!==t?(_=z=>{const C=z===ee?null:z,k=C===null?h.title:(g??[]).find(T=>T.id===C)?.title??"";o.mutate(C,{onSuccess:()=>F.success(C===null?t("settings.mainAgent.resetToast"):t("settings.mainAgent.setToast",{title:k})),onError:()=>F.error(t("settings.mainAgent.errorToast"))})},e[15]=g,e[16]=o,e[17]=h.title,e[18]=t,e[19]=_):_=e[19];const D=_;m=Ne,f=w,n=D,r=o.isPending,e[20]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx(De,{className:"w-full sm:w-[280px]",children:i.jsx(Te,{})}),e[20]=l):l=e[20],d=Fe;let b;e[21]!==h.icon||e[22]!==h.title?(b=i.jsx(ge,{icon:h.icon,name:h.title,size:"xs",className:"shrink-0"}),e[21]=h.icon,e[22]=h.title,e[23]=b):b=e[23];let A;e[24]!==t?(A=t("settings.mainAgent.superAgentOption"),e[24]=t,e[25]=A):A=e[25];let y;e[26]!==A?(y=i.jsx("span",{className:"truncate",children:A}),e[26]=A,e[27]=y):y=e[27],e[28]!==y||e[29]!==b?(a=i.jsx(me,{value:ee,children:i.jsxs("span",{className:"flex items-center gap-2",children:[b,y]})}),e[28]=y,e[29]=b,e[30]=a):a=e[30],c=N.map(rt),e[0]=g,e[1]=u,e[2]=s.id,e[3]=o,e[4]=t,e[5]=d,e[6]=m,e[7]=a,e[8]=c,e[9]=f,e[10]=n,e[11]=r,e[12]=l}else d=e[5],m=e[6],a=e[7],c=e[8],f=e[9],n=e[10],r=e[11],l=e[12];let p;e[31]!==d||e[32]!==a||e[33]!==c?(p=i.jsxs(d,{children:[a,c]}),e[31]=d,e[32]=a,e[33]=c,e[34]=p):p=e[34];let j;return e[35]!==m||e[36]!==f||e[37]!==n||e[38]!==r||e[39]!==l||e[40]!==p?(j=i.jsxs(m,{value:f,onValueChange:n,disabled:r,children:[l,p]}),e[35]=m,e[36]=f,e[37]=n,e[38]=r,e[39]=l,e[40]=p,e[41]=j):j=e[41],j}function rt(e){return i.jsx(me,{value:e.id,children:i.jsxs("span",{className:"flex items-center gap-2",children:[i.jsx(ge,{icon:e.icon,name:e.title,size:"xs",className:"shrink-0"}),i.jsx("span",{className:"truncate",children:e.title})]})},e.id)}function at(e){return!Re(e.id)}function lt(e){return!ke(e.id)}function ct(){const e=P.c(16),t=K();let s;e[0]!==t?(s=t("settings.mainAgent.title"),e[0]=t,e[1]=s):s=e[1];let g;e[2]!==t?(g=t("settings.mainAgent.description"),e[2]=t,e[3]=g):g=e[3];let u;e[4]!==t?(u=t("settings.mainAgent.itemTitle"),e[4]=t,e[5]=u):u=e[5];let o;e[6]!==t?(o=t("settings.mainAgent.itemDescription"),e[6]=t,e[7]=o):o=e[7];let d;e[8]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(Z.Suspense,{fallback:i.jsx(Ee,{className:"h-9 w-[280px]"}),children:i.jsx(ot,{})}),e[8]=d):d=e[8];let m;e[9]!==u||e[10]!==o?(m=i.jsx(ne,{children:i.jsx(Q,{title:u,description:o,action:d})}),e[9]=u,e[10]=o,e[11]=m):m=e[11];let a;return e[12]!==s||e[13]!==g||e[14]!==m?(a=i.jsx(se,{title:s,description:g,children:m}),e[12]=s,e[13]=g,e[14]=m,e[15]=a):a=e[15],a}function mt(){const e=P.c(86),t=K(),{org:s}=H(),[g,u]=Z.useState(!1),[o,d]=Z.useState(""),m=Be();let a;e[0]!==s.id||e[1]!==m?(a=async()=>{await m.call("ORGANIZATION_DELETE",{id:s.id})},e[0]=s.id,e[1]=m,e[2]=a):a=e[2];let c;e[3]!==s.id||e[4]!==s.slug||e[5]!==t?(c=()=>{ie("organization_deleted",{organization_id:s.id}),localStorage.getItem(ae.lastOrgSlug())===s.slug&&localStorage.removeItem(ae.lastOrgSlug()),Se(),F.success(t("settings.deleteOrganizationSection.organizationDeleted")),window.location.href="/"},e[3]=s.id,e[4]=s.slug,e[5]=t,e[6]=c):c=e[6];let f;e[7]!==t?(f=E=>{F.error(E instanceof Error?E.message:t("settings.deleteOrganizationSection.failedToDeleteOrganization"))},e[7]=t,e[8]=f):f=e[8];let n;e[9]!==a||e[10]!==c||e[11]!==f?(n={mutationFn:a,onSuccess:c,onError:f},e[9]=a,e[10]=c,e[11]=f,e[12]=n):n=e[12];const r=le(n);let l;e[13]!==t?(l=t("settings.deleteOrganizationSection.dangerZone"),e[13]=t,e[14]=l):l=e[14];let p;e[15]!==t?(p=t("settings.deleteOrganizationSection.irreversibleActionsDescription"),e[15]=t,e[16]=p):p=e[16];let j;e[17]!==t?(j=t("settings.deleteOrganizationSection.deleteOrganizationTitle"),e[17]=t,e[18]=j):j=e[18];let S;e[19]!==t?(S=t("settings.deleteOrganizationSection.deleteOrganizationDescription"),e[19]=t,e[20]=S):S=e[20];let v;e[21]===Symbol.for("react.memo_cache_sentinel")?(v=()=>u(!0),e[21]=v):v=e[21];const O=r.isPending;let h;e[22]!==t?(h=t("settings.deleteOrganizationSection.deleteButton"),e[22]=t,e[23]=h):h=e[23];let x;e[24]!==r.isPending||e[25]!==h?(x=i.jsx(te,{variant:"destructive",size:"sm",onClick:v,disabled:O,children:h}),e[24]=r.isPending,e[25]=h,e[26]=x):x=e[26];let w;e[27]!==x||e[28]!==j||e[29]!==S?(w=i.jsx(ne,{className:"border-destructive/40",children:i.jsx(Q,{title:j,description:S,action:x})}),e[27]=x,e[28]=j,e[29]=S,e[30]=w):w=e[30];let N;e[31]!==w||e[32]!==l||e[33]!==p?(N=i.jsx(se,{title:l,description:p,children:w}),e[31]=w,e[32]=l,e[33]=p,e[34]=N):N=e[34];let _;e[35]===Symbol.for("react.memo_cache_sentinel")?(_=E=>{u(E),E||d("")},e[35]=_):_=e[35];let D;e[36]!==t?(D=t("settings.deleteOrganizationSection.deleteOrganizationQuestion"),e[36]=t,e[37]=D):D=e[37];let b;e[38]!==D?(b=i.jsx(Ge,{children:D}),e[38]=D,e[39]=b):b=e[39];let A;e[40]!==s.name||e[41]!==t?(A=t("settings.deleteOrganizationSection.deleteWarning",{organizationName:s.name}),e[40]=s.name,e[41]=t,e[42]=A):A=e[42];let y;e[43]!==A?(y=i.jsx("p",{children:A}),e[43]=A,e[44]=y):y=e[44];let z;e[45]!==s.name||e[46]!==t?(z=t("settings.deleteOrganizationSection.typeToConfirm",{organizationName:s.name}),e[45]=s.name,e[46]=t,e[47]=z):z=e[47];let C;e[48]!==z?(C=i.jsx("p",{className:"mt-3 mb-1.5",children:z}),e[48]=z,e[49]=C):C=e[49];let k;e[50]===Symbol.for("react.memo_cache_sentinel")?(k=E=>d(E.target.value),e[50]=k):k=e[50];let T;e[51]!==o||e[52]!==s.name?(T=i.jsx(ce,{value:o,onChange:k,placeholder:s.name,autoFocus:!0}),e[51]=o,e[52]=s.name,e[53]=T):T=e[53];let R;e[54]!==y||e[55]!==C||e[56]!==T?(R=i.jsx(Ue,{asChild:!0,children:i.jsxs("div",{children:[y,C,T]})}),e[54]=y,e[55]=C,e[56]=T,e[57]=R):R=e[57];let I;e[58]!==b||e[59]!==R?(I=i.jsxs(qe,{children:[b,R]}),e[58]=b,e[59]=R,e[60]=I):I=e[60];let L;e[61]!==t?(L=t("settings.deleteOrganizationSection.cancel"),e[61]=t,e[62]=L):L=e[62];let M;e[63]!==L?(M=i.jsx(Ke,{children:L}),e[63]=L,e[64]=M):M=e[64];let V;e[65]!==r?(V=()=>r.mutate(),e[65]=r,e[66]=V):V=e[66];const X=o!==s.name||r.isPending;let $;e[67]!==r.isPending||e[68]!==t?($=r.isPending?t("settings.deleteOrganizationSection.deleting"):t("settings.deleteOrganizationSection.deleteOrganizationAction"),e[67]=r.isPending,e[68]=t,e[69]=$):$=e[69];let B;e[70]!==V||e[71]!==X||e[72]!==$?(B=i.jsx(Qe,{onClick:V,disabled:X,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90 disabled:opacity-50",children:$}),e[70]=V,e[71]=X,e[72]=$,e[73]=B):B=e[73];let G;e[74]!==M||e[75]!==B?(G=i.jsxs(Ze,{children:[M,B]}),e[74]=M,e[75]=B,e[76]=G):G=e[76];let U;e[77]!==I||e[78]!==G?(U=i.jsxs(Ye,{children:[I,G]}),e[77]=I,e[78]=G,e[79]=U):U=e[79];let q;e[80]!==g||e[81]!==U?(q=i.jsx(We,{open:g,onOpenChange:_,children:U}),e[80]=g,e[81]=U,e[82]=q):q=e[82];let Y;return e[83]!==N||e[84]!==q?(Y=i.jsxs(i.Fragment,{children:[N,q]}),e[83]=N,e[84]=q,e[85]=Y):Y=e[85],Y}function gt(){const e=P.c(11),t=K();let s;e[0]!==t?(s=t("settings.orgGeneral.organization"),e[0]=t,e[1]=s):s=e[1];let g;e[2]!==s?(g=i.jsx(W.Title,{children:s}),e[2]=s,e[3]=g):g=e[3];let u,o,d,m,a;e[4]===Symbol.for("react.memo_cache_sentinel")?(u=i.jsx(Je,{}),o=i.jsx(nt,{}),d=i.jsx(ct,{}),m=i.jsx($e,{}),a=i.jsx(mt,{}),e[4]=u,e[5]=o,e[6]=d,e[7]=m,e[8]=a):(u=e[4],o=e[5],d=e[6],m=e[7],a=e[8]);let c;return e[9]!==g?(c=i.jsx(W,{children:i.jsx(W.Content,{children:i.jsx(W.Body,{children:i.jsxs(we,{children:[g,u,o,d,m,a]})})})}),e[9]=g,e[10]=c):c=e[10],c}function Ni(){const e=P.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsx(He,{capability:"org:manage",area:"general settings",children:i.jsx(gt,{})}),e[0]=t):t=e[0],t}export{Ni as default};
1
+ import{c as P,F as H,r as Z,j as i,B as te,L as ue,X as fe,Y as J,b as K,d as pe,o as he,_ as xe,Z as je,e as le,p as ie,t as F,K as oe,a6 as re,G as ae,w as Se}from"./index-CjF26QCG.js";import{P as W}from"./index-5hW5oe3V.js";import{A as ze,b as ve}from"./alert-CUOdafoW.js";import{i as be}from"./XCircle-BDBptK5c.js";import{n as Ae}from"./LinkExternal01-CxFcmhCv.js";import{s as ye}from"./XClose-CS8UpX89.js";import{u as Ce}from"./use-org-auth-client-YfI11Izs.js";import{u as _e}from"./use-debounced-autosave-J6WpwdLn.js";import{A as Oe}from"./avatar-lulgkVBD.js";import{I as ce}from"./input-IDFu6vm5.js";import{S as se,a as ne,b as Q,c as we}from"./settings-section-CQn6aKZC.js";import{d as me,S as Ne,a as De,b as Te,c as Fe}from"./select-CYXr2k1e.js";import{S as Ee}from"./skeleton-CVuAFcA8.js";import{A as ge}from"./agent-icon-DCuaG5nE.js";import{a as Pe,i as ke,f as Re}from"./use-mcp-client-BGlPrg7w.js";import{a as Ie}from"./use-virtual-mcp-DZ1qOoD6.js";import{a as Le}from"./agent-capabilities-cXfbMfjV.js";import{e as Me,h as Ve}from"./use-organization-settings-DytCiPyY.js";import{D as $e}from"./domain-settings-X-ltER7d.js";import{u as Be}from"./studio-tools-Cinrb_dT.js";import{c as Ge,d as Ue,b as qe,f as Ke,g as Qe,e as Ze,a as Ye,A as We}from"./alert-dialog-DegRzpzC.js";import{R as He}from"./require-capability-Dqpucqyz.js";import"./sidebar-C8SHXIOH.js";import"./LayoutLeft-UdAY9lHL.js";import"./use-mobile-rYfTSvFb.js";import"./X-Cvof5f1Z.js";import"./tooltip-DASp4d0o.js";import"./User01-Bq5KW4vO.js";import"./card-K9NXEEZ3.js";import"./ArrowUpRight-DfJzPFvU.js";import"./Check-Dyt2_0ga.js";import"./ChevronDown-D6KfEPdr.js";import"./ChevronUp-Bmy1l0Py.js";import"./AlertCircle-Cem6ePeU.js";import"./Tool01-BhOhq1Lq.js";import"./ArrowUp-C2eUAqJf.js";import"./Settings02-D-zT1K0J.js";import"./Tool02-CCtBgqj3.js";import"./TrendUp01-CiD1se1i.js";import"./ZapSquare-DXB9EHwI.js";import"./Users03-Jpb3Rs6p.js";import"./CheckCircle-B-XbmPy7.js";import"./ChevronRight-DILmeK7M.js";import"./DotsVertical-BhuMjSRb.js";import"./Stars02-D936Q5vu.js";import"./Copy01-USV1_HJa.js";import"./Eye-DLI5NPy9.js";import"./FilterLines-5S8WKVB6.js";import"./Star01-CTYXgmts.js";import"./Palette-CLw6FxLo.js";import"./SwitchHorizontal01-DRBzItNZ.js";import"./HardDrive-DQfGmY_Q.js";import"./Key01-jW_JyKg4.js";import"./LogOut01-DvI1_F9a.js";import"./Monitor01-zHncMHvK.js";import"./Sun-SO-tAlk7.js";import"./Play-C0sf4kYZ.js";import"./Plus-DmVmPu15.js";import"./SearchLg-mmh32yOh.js";import"./SearchMd-BV0JzQs2.js";import"./Shield01-DaH6VmhZ.js";import"./Stars01-D42-h5Va.js";import"./Trash01-BNbLXf93.js";import"./Upload01-BE-MvOgE.js";import"./Users01-CiMe0bfz.js";import"./Zap-NmQQQZMA.js";import"./auth-njKnK4H1.js";import"./badge-X6hr_bP1.js";import"./use-capability-CvjJL9co.js";import"./access-gate-CbW94wEf.js";import"./capability-load-error-B3z7rQwl.js";function de(e){return`connect-banner-dismissed:${e}`}function Xe(e){if(typeof window>"u")return!0;try{return localStorage.getItem(de(e))==="1"}catch{return!1}}function Je(){const e=P.c(17),{org:t}=H();let s;e[0]!==t.id?(s=()=>Xe(t.id),e[0]=t.id,e[1]=s):s=e[1];const[g,u]=Z.useState(s);if(g)return null;let o;e[2]!==t.id?(o=()=>{u(!0);try{localStorage.setItem(de(t.id),"1")}catch{}},e[2]=t.id,e[3]=o):o=e[3];const d=o;let m;e[4]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(Ae,{}),e[4]=m):m=e[4];let a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx("span",{children:"Use Studio MCP anywhere — paste a command into Claude Code, Cursor, Codex, or any MCP client."}),e[5]=a):a=e[5];let c;e[6]!==t.slug?(c={org:t.slug},e[6]=t.slug,e[7]=c):c=e[7];let f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx(be,{size:12}),e[8]=f):f=e[8];let n;e[9]!==c?(n=i.jsx(te,{asChild:!0,size:"sm",variant:"ghost",className:"text-xs gap-1",children:i.jsxs(ue,{to:"/$org/settings/connect",params:c,children:["Connect to clients ",f]})}),e[9]=c,e[10]=n):n=e[10];let r;e[11]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(ye,{size:14}),e[11]=r):r=e[11];let l;e[12]!==d?(l=i.jsx(te,{variant:"ghost",size:"icon",className:"size-7",onClick:d,"aria-label":"Dismiss",children:r}),e[12]=d,e[13]=l):l=e[13];let p;return e[14]!==n||e[15]!==l?(p=i.jsxs(ze,{variant:"info",className:"items-center",children:[m,i.jsxs(ve,{className:"flex-1 flex items-center justify-between gap-2 text-sm",children:[a,i.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[n,l]})]})]}),e[14]=n,e[15]=l,e[16]=p):p=e[16],p}const et=new Set([".well-known","_admin","api","auth","cli","commerce-onboarding","dbos-queue-depth","health","hosted-run-pending","login","mcp","metrics","oauth","oauth-proxy","onboarding","org","report","reset-password"]);function tt(e){return typeof e=="string"&&et.has(e.trim().toLowerCase())}const it=fe({name:J().min(1,"Name is required").max(255,"Name is too long"),slug:J().min(1,"Slug is required").max(50,"Slug is too long").regex(/^[a-z0-9-]+$/,"Slug must contain only lowercase letters, numbers, and hyphens").refine(e=>!tt(e),"This organization URL is reserved by Studio"),logo:J().optional()});function st(e){const t=P.c(17),{value:s,onChange:g,name:u,disabled:o}=e,d=K(),m=Z.useRef(null);let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a=()=>m.current?.click(),t[0]=a):a=t[0];const c=a;let f;t[1]!==g||t[2]!==d?(f=O=>{const h=O.target.files?.[0];if(!h)return;if(h.size>2097152){F.error(d("settings.organizationForm.imageTooLarge"));return}const x=new FileReader;x.onerror=()=>F.error(d("settings.organizationForm.failedToReadImage")),x.onloadend=()=>{x.result&&g(x.result),m.current&&(m.current.value="")},x.readAsDataURL(h)},t[1]=g,t[2]=d,t[3]=f):f=t[3];const n=f;let r;t[4]!==d?(r=d("settings.organizationForm.uploadLogoLabel"),t[4]=d,t[5]=r):r=t[5];let l;t[6]!==o||t[7]!==n?(l=i.jsx("input",{ref:m,type:"file",accept:"image/*",onChange:n,className:"hidden",disabled:o}),t[6]=o,t[7]=n,t[8]=l):l=t[8];const p=s||void 0,j=u??"?";let S;t[9]!==p||t[10]!==j?(S=i.jsx(Oe,{url:p,fallback:j,shape:"square",size:"base"}),t[9]=p,t[10]=j,t[11]=S):S=t[11];let v;return t[12]!==o||t[13]!==r||t[14]!==l||t[15]!==S?(v=i.jsxs("button",{type:"button",onClick:c,disabled:o,className:"rounded-lg overflow-hidden hover:ring-2 hover:ring-border transition-all disabled:opacity-50","aria-label":r,children:[l,S]}),t[12]=o,t[13]=r,t[14]=l,t[15]=S,t[16]=v):v=t[16],v}function nt(){const e=K(),t=pe(),{org:s}=H(),g=Ce(),u=he(),o=xe({resolver:je(it),values:{name:s.name??"",slug:s.slug??"",logo:s.logo??""}}),d=le({mutationFn:async n=>{const r={name:n.name,slug:n.slug};n.logo&&(r.logo=n.logo);const l=await g.organization.update({data:r});if(l?.error)throw new Error(l.error.message||e("settings.organizationForm.failedToUpdateOrg"));return l},onSuccess:(n,r)=>{ie("organization_settings_updated",{organization_id:s.id,fields:Object.keys(r)}),u.invalidateQueries({queryKey:oe.organizations()}),u.invalidateQueries({queryKey:oe.activeOrganization(s.slug)}),F.success(e("settings.organizationForm.updateSuccess")),n?.data?.slug&&n.data.slug!==s.slug&&t({to:"/$org/settings/general",params:{org:n.data.slug}})},onError:(n,r)=>{ie("organization_settings_update_failed",{organization_id:s.id,fields:Object.keys(r),error:n instanceof Error?n.message:String(n)}),F.error(n instanceof Error?n.message:e("settings.organizationForm.failedToUpdateOrg"))}}),{schedule:m,flush:a}=_e({save:async()=>{const n=o.control._formState.dirtyFields;if(Object.keys(n).length===0||!await o.trigger())return;const l=o.getValues(),p=o.control._defaultValues;o.reset(l,{keepValues:!0});try{await d.mutateAsync(l)}catch{o.reset(p,{keepValues:!0})}}}),c=o.formState.errors,f=typeof window<"u"?`${window.location.host}/`:"";return i.jsx(se,{children:i.jsxs(ne,{children:[i.jsx(Q,{title:e("settings.organizationForm.logoTitle"),description:e("settings.organizationForm.logoDescription"),action:i.jsx(st,{value:o.watch("logo"),onChange:n=>{o.setValue("logo",n??"",{shouldDirty:!0}),a()},name:o.watch("name")})}),i.jsx(Q,{title:e("settings.organizationForm.nameTitle"),action:i.jsx(re,{control:o.control,name:"name",render:({field:n})=>i.jsx(ce,{id:"org-name",...n,onChange:r=>{n.onChange(r),m()},onBlur:()=>{n.onBlur(),a()},placeholder:e("settings.organizationForm.namePlaceholder"),className:"w-[280px]"})})}),i.jsx(Q,{title:e("settings.organizationForm.urlTitle"),action:i.jsxs("div",{className:"flex items-center w-[280px] rounded-md border border-input bg-input/30 focus-within:ring-2 focus-within:ring-ring/50 overflow-hidden",children:[f&&i.jsx("span",{className:"pl-3 text-sm text-muted-foreground select-none",children:f}),i.jsx(re,{control:o.control,name:"slug",render:({field:n})=>i.jsx("input",{id:"org-slug",value:n.value??"",name:n.name,ref:n.ref,placeholder:e("settings.organizationForm.slugPlaceholder"),className:"flex-1 min-w-0 bg-transparent px-2 py-1.5 text-sm text-foreground placeholder:text-muted-foreground/60 outline-none",onChange:r=>{const l=r.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");o.setValue("slug",l,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0}),m()},onBlur:()=>{n.onBlur(),a()}})})]})}),(c.name||c.slug||c.logo)&&i.jsxs("div",{className:"px-5 pb-3 flex flex-col gap-1",children:[c.name&&i.jsx("p",{className:"text-xs text-destructive",children:c.name.message}),c.slug&&i.jsx("p",{className:"text-xs text-destructive",children:c.slug.message}),c.logo&&i.jsx("p",{className:"text-xs text-destructive",children:c.logo.message})]})]})})}const ee="__super_agent__";function ot(){const e=P.c(42),t=K(),{org:s}=H(),g=Ie(),{mainAgentId:u}=Me(),o=Ve();let d,m,a,c,f,n,r,l;if(e[0]!==g||e[1]!==u||e[2]!==s.id||e[3]!==o||e[4]!==t){const S=Le(g),v=(g??[]).filter(lt).filter(z=>!S.has(z.id)).filter(at);let O;e[13]!==s.id?(O=Pe(s.id),e[13]=s.id,e[14]=O):O=e[14];const h=O,x=u!=null?(g??[]).find(z=>z.id===u):void 0,w=x?x.id:ee,N=x&&!v.some(z=>z.id===x.id)?[x,...v]:v;let _;e[15]!==g||e[16]!==o||e[17]!==h.title||e[18]!==t?(_=z=>{const C=z===ee?null:z,k=C===null?h.title:(g??[]).find(T=>T.id===C)?.title??"";o.mutate(C,{onSuccess:()=>F.success(C===null?t("settings.mainAgent.resetToast"):t("settings.mainAgent.setToast",{title:k})),onError:()=>F.error(t("settings.mainAgent.errorToast"))})},e[15]=g,e[16]=o,e[17]=h.title,e[18]=t,e[19]=_):_=e[19];const D=_;m=Ne,f=w,n=D,r=o.isPending,e[20]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx(De,{className:"w-full sm:w-[280px]",children:i.jsx(Te,{})}),e[20]=l):l=e[20],d=Fe;let b;e[21]!==h.icon||e[22]!==h.title?(b=i.jsx(ge,{icon:h.icon,name:h.title,size:"xs",className:"shrink-0"}),e[21]=h.icon,e[22]=h.title,e[23]=b):b=e[23];let A;e[24]!==t?(A=t("settings.mainAgent.superAgentOption"),e[24]=t,e[25]=A):A=e[25];let y;e[26]!==A?(y=i.jsx("span",{className:"truncate",children:A}),e[26]=A,e[27]=y):y=e[27],e[28]!==y||e[29]!==b?(a=i.jsx(me,{value:ee,children:i.jsxs("span",{className:"flex items-center gap-2",children:[b,y]})}),e[28]=y,e[29]=b,e[30]=a):a=e[30],c=N.map(rt),e[0]=g,e[1]=u,e[2]=s.id,e[3]=o,e[4]=t,e[5]=d,e[6]=m,e[7]=a,e[8]=c,e[9]=f,e[10]=n,e[11]=r,e[12]=l}else d=e[5],m=e[6],a=e[7],c=e[8],f=e[9],n=e[10],r=e[11],l=e[12];let p;e[31]!==d||e[32]!==a||e[33]!==c?(p=i.jsxs(d,{children:[a,c]}),e[31]=d,e[32]=a,e[33]=c,e[34]=p):p=e[34];let j;return e[35]!==m||e[36]!==f||e[37]!==n||e[38]!==r||e[39]!==l||e[40]!==p?(j=i.jsxs(m,{value:f,onValueChange:n,disabled:r,children:[l,p]}),e[35]=m,e[36]=f,e[37]=n,e[38]=r,e[39]=l,e[40]=p,e[41]=j):j=e[41],j}function rt(e){return i.jsx(me,{value:e.id,children:i.jsxs("span",{className:"flex items-center gap-2",children:[i.jsx(ge,{icon:e.icon,name:e.title,size:"xs",className:"shrink-0"}),i.jsx("span",{className:"truncate",children:e.title})]})},e.id)}function at(e){return!Re(e.id)}function lt(e){return!ke(e.id)}function ct(){const e=P.c(16),t=K();let s;e[0]!==t?(s=t("settings.mainAgent.title"),e[0]=t,e[1]=s):s=e[1];let g;e[2]!==t?(g=t("settings.mainAgent.description"),e[2]=t,e[3]=g):g=e[3];let u;e[4]!==t?(u=t("settings.mainAgent.itemTitle"),e[4]=t,e[5]=u):u=e[5];let o;e[6]!==t?(o=t("settings.mainAgent.itemDescription"),e[6]=t,e[7]=o):o=e[7];let d;e[8]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(Z.Suspense,{fallback:i.jsx(Ee,{className:"h-9 w-[280px]"}),children:i.jsx(ot,{})}),e[8]=d):d=e[8];let m;e[9]!==u||e[10]!==o?(m=i.jsx(ne,{children:i.jsx(Q,{title:u,description:o,action:d})}),e[9]=u,e[10]=o,e[11]=m):m=e[11];let a;return e[12]!==s||e[13]!==g||e[14]!==m?(a=i.jsx(se,{title:s,description:g,children:m}),e[12]=s,e[13]=g,e[14]=m,e[15]=a):a=e[15],a}function mt(){const e=P.c(86),t=K(),{org:s}=H(),[g,u]=Z.useState(!1),[o,d]=Z.useState(""),m=Be();let a;e[0]!==s.id||e[1]!==m?(a=async()=>{await m.call("ORGANIZATION_DELETE",{id:s.id})},e[0]=s.id,e[1]=m,e[2]=a):a=e[2];let c;e[3]!==s.id||e[4]!==s.slug||e[5]!==t?(c=()=>{ie("organization_deleted",{organization_id:s.id}),localStorage.getItem(ae.lastOrgSlug())===s.slug&&localStorage.removeItem(ae.lastOrgSlug()),Se(),F.success(t("settings.deleteOrganizationSection.organizationDeleted")),window.location.href="/"},e[3]=s.id,e[4]=s.slug,e[5]=t,e[6]=c):c=e[6];let f;e[7]!==t?(f=E=>{F.error(E instanceof Error?E.message:t("settings.deleteOrganizationSection.failedToDeleteOrganization"))},e[7]=t,e[8]=f):f=e[8];let n;e[9]!==a||e[10]!==c||e[11]!==f?(n={mutationFn:a,onSuccess:c,onError:f},e[9]=a,e[10]=c,e[11]=f,e[12]=n):n=e[12];const r=le(n);let l;e[13]!==t?(l=t("settings.deleteOrganizationSection.dangerZone"),e[13]=t,e[14]=l):l=e[14];let p;e[15]!==t?(p=t("settings.deleteOrganizationSection.irreversibleActionsDescription"),e[15]=t,e[16]=p):p=e[16];let j;e[17]!==t?(j=t("settings.deleteOrganizationSection.deleteOrganizationTitle"),e[17]=t,e[18]=j):j=e[18];let S;e[19]!==t?(S=t("settings.deleteOrganizationSection.deleteOrganizationDescription"),e[19]=t,e[20]=S):S=e[20];let v;e[21]===Symbol.for("react.memo_cache_sentinel")?(v=()=>u(!0),e[21]=v):v=e[21];const O=r.isPending;let h;e[22]!==t?(h=t("settings.deleteOrganizationSection.deleteButton"),e[22]=t,e[23]=h):h=e[23];let x;e[24]!==r.isPending||e[25]!==h?(x=i.jsx(te,{variant:"destructive",size:"sm",onClick:v,disabled:O,children:h}),e[24]=r.isPending,e[25]=h,e[26]=x):x=e[26];let w;e[27]!==x||e[28]!==j||e[29]!==S?(w=i.jsx(ne,{className:"border-destructive/40",children:i.jsx(Q,{title:j,description:S,action:x})}),e[27]=x,e[28]=j,e[29]=S,e[30]=w):w=e[30];let N;e[31]!==w||e[32]!==l||e[33]!==p?(N=i.jsx(se,{title:l,description:p,children:w}),e[31]=w,e[32]=l,e[33]=p,e[34]=N):N=e[34];let _;e[35]===Symbol.for("react.memo_cache_sentinel")?(_=E=>{u(E),E||d("")},e[35]=_):_=e[35];let D;e[36]!==t?(D=t("settings.deleteOrganizationSection.deleteOrganizationQuestion"),e[36]=t,e[37]=D):D=e[37];let b;e[38]!==D?(b=i.jsx(Ge,{children:D}),e[38]=D,e[39]=b):b=e[39];let A;e[40]!==s.name||e[41]!==t?(A=t("settings.deleteOrganizationSection.deleteWarning",{organizationName:s.name}),e[40]=s.name,e[41]=t,e[42]=A):A=e[42];let y;e[43]!==A?(y=i.jsx("p",{children:A}),e[43]=A,e[44]=y):y=e[44];let z;e[45]!==s.name||e[46]!==t?(z=t("settings.deleteOrganizationSection.typeToConfirm",{organizationName:s.name}),e[45]=s.name,e[46]=t,e[47]=z):z=e[47];let C;e[48]!==z?(C=i.jsx("p",{className:"mt-3 mb-1.5",children:z}),e[48]=z,e[49]=C):C=e[49];let k;e[50]===Symbol.for("react.memo_cache_sentinel")?(k=E=>d(E.target.value),e[50]=k):k=e[50];let T;e[51]!==o||e[52]!==s.name?(T=i.jsx(ce,{value:o,onChange:k,placeholder:s.name,autoFocus:!0}),e[51]=o,e[52]=s.name,e[53]=T):T=e[53];let R;e[54]!==y||e[55]!==C||e[56]!==T?(R=i.jsx(Ue,{asChild:!0,children:i.jsxs("div",{children:[y,C,T]})}),e[54]=y,e[55]=C,e[56]=T,e[57]=R):R=e[57];let I;e[58]!==b||e[59]!==R?(I=i.jsxs(qe,{children:[b,R]}),e[58]=b,e[59]=R,e[60]=I):I=e[60];let L;e[61]!==t?(L=t("settings.deleteOrganizationSection.cancel"),e[61]=t,e[62]=L):L=e[62];let M;e[63]!==L?(M=i.jsx(Ke,{children:L}),e[63]=L,e[64]=M):M=e[64];let V;e[65]!==r?(V=()=>r.mutate(),e[65]=r,e[66]=V):V=e[66];const X=o!==s.name||r.isPending;let $;e[67]!==r.isPending||e[68]!==t?($=r.isPending?t("settings.deleteOrganizationSection.deleting"):t("settings.deleteOrganizationSection.deleteOrganizationAction"),e[67]=r.isPending,e[68]=t,e[69]=$):$=e[69];let B;e[70]!==V||e[71]!==X||e[72]!==$?(B=i.jsx(Qe,{onClick:V,disabled:X,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90 disabled:opacity-50",children:$}),e[70]=V,e[71]=X,e[72]=$,e[73]=B):B=e[73];let G;e[74]!==M||e[75]!==B?(G=i.jsxs(Ze,{children:[M,B]}),e[74]=M,e[75]=B,e[76]=G):G=e[76];let U;e[77]!==I||e[78]!==G?(U=i.jsxs(Ye,{children:[I,G]}),e[77]=I,e[78]=G,e[79]=U):U=e[79];let q;e[80]!==g||e[81]!==U?(q=i.jsx(We,{open:g,onOpenChange:_,children:U}),e[80]=g,e[81]=U,e[82]=q):q=e[82];let Y;return e[83]!==N||e[84]!==q?(Y=i.jsxs(i.Fragment,{children:[N,q]}),e[83]=N,e[84]=q,e[85]=Y):Y=e[85],Y}function gt(){const e=P.c(11),t=K();let s;e[0]!==t?(s=t("settings.orgGeneral.organization"),e[0]=t,e[1]=s):s=e[1];let g;e[2]!==s?(g=i.jsx(W.Title,{children:s}),e[2]=s,e[3]=g):g=e[3];let u,o,d,m,a;e[4]===Symbol.for("react.memo_cache_sentinel")?(u=i.jsx(Je,{}),o=i.jsx(nt,{}),d=i.jsx(ct,{}),m=i.jsx($e,{}),a=i.jsx(mt,{}),e[4]=u,e[5]=o,e[6]=d,e[7]=m,e[8]=a):(u=e[4],o=e[5],d=e[6],m=e[7],a=e[8]);let c;return e[9]!==g?(c=i.jsx(W,{children:i.jsx(W.Content,{children:i.jsx(W.Body,{children:i.jsxs(we,{children:[g,u,o,d,m,a]})})})}),e[9]=g,e[10]=c):c=e[10],c}function Ni(){const e=P.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsx(He,{capability:"org:manage",area:"general settings",children:i.jsx(gt,{})}),e[0]=t):t=e[0],t}export{Ni as default};
@@ -1 +1 @@
1
- import{c as q,j as t,F as me,a as ye,o as fe,r as D,$ as le,b as te,k as ee,e as ge,t as re,dS as Ne,K as se,G as ve,n as ke,m as ue,B as ce,x as Ce,y as Re}from"./index-CpB-IlaU.js";import{a as we,b as Se,d as Pe,e as Ie}from"./dialog-C35xFAax.js";import{C as _e}from"./collection-search-CsezHOBI.js";import{u as Te}from"./use-debounced-value-CbBPU7zd.js";import{b as he,u as Ee}from"./use-connection-DZ9yH8AT.js";import{W as Ae,u as ne,S as pe}from"./use-mcp-client-nWQQesMe.js";import{a as be}from"./authenticate-and-persist-oauth-Dgw0_gxc.js";import{b as de}from"./Settings02-CQm8x-Mo.js";import{n as ze}from"./LinkExternal01-BeqUZ5mh.js";import{U as Le}from"./agent-icon-dfCTMRkW.js";import{u as Ge}from"./use-mcp-tools-DszGK-_z.js";import{e as Oe}from"./extract-connection-data-D61ZU_rY.js";import{c as Fe}from"./use-navigate-to-agent-DuvGIrZp.js";import{g as Ue,p as xe,f as $e}from"./provision-repo-scoped-github-connection-DWINBxtd.js";function M(k){const e=q.c(4),{size:n,className:l}=k;let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0016 8c0-4.42-3.58-8-8-8z"}),e[0]=h):h=e[0];let o;return e[1]!==l||e[2]!==n?(o=t.jsx("svg",{width:n,height:n,viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",className:l,children:h}),e[1]=l,e[2]=n,e[3]=o):o=e[3],o}function De(k,e){const n=q.c(12),{org:l}=me();let h;n[0]!==l.id?(h=Ae.REGISTRY(l.id),n[0]=l.id,n[1]=h):h=n[1];const o=h;let a;n[2]!==l.id||n[3]!==l.slug||n[4]!==o?(a={connectionId:o,orgId:l.id,orgSlug:l.slug},n[2]=l.id,n[3]=l.slug,n[4]=o,n[5]=a):a=n[5];const r=ne(a);let s;n[6]!==k?(s={name:k},n[6]=k,n[7]=s):s=n[7];const u=e?.enabled??!0;let y;return n[8]!==r||n[9]!==s||n[10]!==u?(y={client:r,toolName:"COLLECTION_REGISTRY_APP_GET",toolArguments:s,enabled:u,staleTime:3e5,select:He},n[8]=r,n[9]=s,n[10]=u,n[11]=y):y=n[11],Ge(y)}function He(k){return k.structuredContent?.item??null}const Me="deco/mcp-github";function qe(k){const{org:e}=me(),{data:n}=ye.useSession(),l=he(),h=fe(),[o,a]=D.useState("idle"),[r,s]=D.useState(null),[u,y]=D.useState(null),{data:N,isLoading:w}=De(Me,{enabled:k.enabled}),f=D.useRef(!1);k.enabled&&N&&!w&&!f.current&&n?.user?.id&&o==="idle"&&(f.current=!0,d());async function d(){if(!(!N||!n?.user?.id||!e))try{a("installing"),s(null);const c=Oe(N,e.id,n.user.id,{remoteIndex:0});if(!c.connection_url)throw new Error("Registry item is missing a remote URL for mcp-github");const{id:g}=await l.create.mutateAsync(c);a("authenticating");const j=await be({connectionId:g,orgId:e.id,orgSlug:e.slug,persistFallback:x=>l.update.mutateAsync({id:g,data:{connection_token:x}}).then(()=>{})});if(j.ran&&!j.ok){try{await l.delete.mutateAsync(g)}catch{}throw new Error(j.error&&j.error!=="no token received"?j.error:"No token received from GitHub")}le(h,e.id),y(c),a("ready")}catch(c){s(c instanceof Error?c.message:String(c)),a("error")}}function m(){a("idle"),s(null),y(null),f.current=!1}return k.enabled&&w&&o==="idle"?{status:"installing",error:null,connection:null,retry:m}:{status:o,error:r,connection:u,retry:m}}function dt(k){const e=q.c(27),{open:n,onOpenChange:l,title:h,onImportComplete:o,mode:a}=k,r=a===void 0?"agent":a,s=te();let u;e[0]!==r||e[1]!==s||e[2]!==h?(u=h??s(r==="connection"?"common.githubRepoPicker.addRepo":"common.githubRepoPicker.importFromGitHub"),e[0]=r,e[1]=s,e[2]=h,e[3]=u):u=e[3];const y=u,[N,w]=D.useState(null);let f;e[4]!==y?(f=t.jsx(we,{className:"sr-only",children:t.jsx(Se,{children:y})}),e[4]=y,e[5]=f):f=e[5];let d;e[6]!==y||e[7]!==N||e[8]!==s?(d=t.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3 shrink-0",children:N?t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:()=>w(null),className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors shrink-0","aria-label":s("common.githubRepoPicker.backToAccounts"),children:t.jsx(de,{size:16})}),t.jsx("img",{src:N.avatarUrl,alt:N.login,className:"size-5 rounded-full ring-1 ring-border shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:N.login})]}):t.jsxs(t.Fragment,{children:[t.jsx(M,{className:"size-4 text-foreground shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:y})]})}),e[6]=y,e[7]=N,e[8]=s,e[9]=d):d=e[9];let m;e[10]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(ee,{size:18,className:"animate-spin text-muted-foreground"})}),e[10]=m):m=e[10];let c;e[11]!==l?(c=()=>l(!1),e[11]=l,e[12]=c):c=e[12];let p;e[13]!==r||e[14]!==o||e[15]!==n||e[16]!==N||e[17]!==c?(p=t.jsx("div",{className:"flex-1 overflow-hidden flex flex-col min-w-0",children:t.jsx(D.Suspense,{fallback:m,children:t.jsx(Qe,{open:n,onComplete:c,selectedInstallation:N,onSelectInstallation:w,onImportComplete:o,mode:r})})}),e[13]=r,e[14]=o,e[15]=n,e[16]=N,e[17]=c,e[18]=p):p=e[18];let g;e[19]!==f||e[20]!==d||e[21]!==p?(g=t.jsxs(Pe,{className:"sm:max-w-[560px] h-[85svh] sm:h-[520px] p-0 gap-0 overflow-hidden flex flex-col",children:[f,d,p]}),e[19]=f,e[20]=d,e[21]=p,e[22]=g):g=e[22];let j;return e[23]!==l||e[24]!==n||e[25]!==g?(j=t.jsx(Ie,{open:n,onOpenChange:l,children:g}),e[23]=l,e[24]=n,e[25]=g,e[26]=j):j=e[26],j}function Qe({open:k,onComplete:e,selectedInstallation:n,onSelectInstallation:l,onImportComplete:h,mode:o="agent"}){const a=te(),{org:r}=me(),s=fe(),u=Fe(),[y,N]=D.useState(null),w=Ee({slug:"mcp-github"}),f=Ue(w),d=qe({enabled:k&&f.length===0}),m=f.length===1?f[0]??null:y,c=ne({connectionId:m?.id??"",orgId:r.id,orgSlug:r.slug}),p=ne({connectionId:pe,orgId:r.id,orgSlug:r.slug}),g=async(i,v)=>{try{const S=await c.callTool({name:"get_file_contents",arguments:{owner:i.owner,repo:i.name,path:v}});if(S.isError)return null;const P=S.content?.find(I=>I.type==="resource")?.resource?.text;if(!P)return null;try{const I=JSON.parse(P);return typeof I=="string"?I:JSON.stringify(I)}catch{return P}}catch{return null}},j=(i,v)=>{Promise.all([g(v,"AGENTS.md"),g(v,"CLAUDE.md")]).then(async([C,S])=>{const R=C??S??null;R&&(await p.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:i,data:{metadata:{instructions:R}}}}),le(s,r.id))}).catch(C=>{console.error("GitHub instructions fetch failed:",C)})},x=ge({mutationFn:async i=>{if(!m||!n)throw new Error("No GitHub connection or installation");const v=n.installationId;if(o==="connection"){const{childConnectionId:R}=await xe({orgSlug:r.slug,sourceConnection:m,installationId:v,owner:i.owner,repo:i.name,githubCallTool:P=>c.callTool(P),selfCallTool:P=>p.callTool(P),orgShared:!0});return{virtualMcpId:null,repo:i,connectionId:R,item:null}}const{childConnectionId:C}=await xe({orgSlug:r.slug,sourceConnection:m,installationId:v,owner:i.owner,repo:i.name,githubCallTool:R=>c.callTool(R),selfCallTool:R=>p.callTool(R)});let S=null;try{const R=await p.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:i.name,description:i.description||"Imported from GitHub",pinned:!1,icon:null,metadata:{githubRepo:{owner:i.owner,name:i.name,url:i.url,installationId:v,connectionId:C},instructions:null,ui:{pinnedViews:null,layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}},connections:[{connection_id:C}]}}}),P=R.structuredContent??R,I=P.item?.id;if(!P.item||!I)throw new Error("Failed to create the imported agent");return S=I,{virtualMcpId:I,repo:i,connectionId:C,item:P.item}}catch(R){throw S&&await p.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:S}}).catch(()=>{}),await p.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:C,force:!0}}).catch(()=>{}),R}},onSuccess:({virtualMcpId:i,repo:v,connectionId:C,item:S})=>{if(o==="connection"||!i||!S){le(s,r.id),Ne(s,r.id),re.success(a("common.githubRepoPicker.addedRepo",{name:v.name})),e();return}if(s.setQueryData(se.collectionItem(p,r.id,"","VIRTUAL_MCP",i),{item:S}),le(s,r.id),j(i,v),h){h({virtualMcpId:i,repo:v,connectionId:C});return}re.success(a("common.githubRepoPicker.importedRepo",{name:v.name})),e(),localStorage.setItem(ve.sidebarOpen(),JSON.stringify(!1)),u(i)},onError:i=>{re.error(a("common.githubRepoPicker.failedImport",{error:i instanceof Error?i.message:a("common.githubRepoPicker.unknownError")}))}});return d.status==="installing"||d.status==="authenticating"?t.jsx(ae,{status:d.status,error:null,retry:d.retry}):d.status==="error"?t.jsx(ae,{status:"error",error:d.error,retry:d.retry}):f.length===0&&d.status==="idle"?t.jsx(ae,{status:"installing",error:null,retry:d.retry}):f.length>1&&!m?t.jsxs("div",{className:"flex flex-col py-2",children:[t.jsx("div",{className:"px-4 py-2",children:t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:a("common.githubRepoPicker.selectConnection")})}),f.map(i=>t.jsxs("button",{type:"button",onClick:()=>N(i),className:"flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left",children:[i.icon?t.jsx("img",{src:i.icon,alt:i.title,className:"size-7 rounded-full shrink-0"}):t.jsx("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:t.jsx(M,{className:"size-3.5 text-muted-foreground"})}),t.jsx("span",{className:"text-sm font-medium",children:i.title})]},i.id))]}):m?n?t.jsx(Ke,{connectionId:m.id,orgId:r.id,orgSlug:r.slug,installation:n,onSelectRepo:i=>x.mutate(i),isSaving:x.isPending}):t.jsx(Be,{connectionId:m.id,orgId:r.id,orgSlug:r.slug,onSelect:l,showBackButton:f.length>1,onBack:()=>N(null)}):null}function Be(k){const e=q.c(126),{connectionId:n,orgId:l,orgSlug:h,onSelect:o,showBackButton:a,onBack:r}=k,s=te();let u;e[0]!==l||e[1]!==h?(u={connectionId:pe,orgId:l,orgSlug:h},e[0]=l,e[1]=h,e[2]=u):u=e[2];const y=ne(u),N=fe(),w=he();let f;e[3]!==n||e[4]!==l?(f=se.githubUserOrgs(l,n),e[3]=n,e[4]=l,e[5]=f):f=e[5];let d;e[6]!==n||e[7]!==y?(d=()=>$e(b=>y.callTool(b),n),e[6]=n,e[7]=y,e[8]=d):d=e[8];let m;e[9]!==f||e[10]!==d?(m={queryKey:f,queryFn:d},e[9]=f,e[10]=d,e[11]=m):m=e[11];const c=ke(m);let p;e[12]!==w||e[13]!==n||e[14]!==c||e[15]!==l||e[16]!==h||e[17]!==N?(p=async()=>{const b=await be({connectionId:n,orgId:l,orgSlug:h,persistFallback:A=>w.update.mutateAsync({id:n,data:{connection_token:A}}).then(Ve)});if(b.ran&&!b.ok)throw new Error(b.error??"no token received");const _=new URL(`/api/${h}/mcp/${n}`,window.location.origin);await N.invalidateQueries({queryKey:se.isMCPAuthenticated(_.href,null)}),await N.invalidateQueries({queryKey:se.mcpClientPrefix()}),await c.refetch()},e[12]=w,e[13]=n,e[14]=c,e[15]=l,e[16]=h,e[17]=N,e[18]=p):p=e[18];let g;e[19]!==s?(g=b=>{re.error(s("common.githubRepoPicker.failedReconnect",{error:b instanceof Error?b.message:s("common.githubRepoPicker.unknownError")}))},e[19]=s,e[20]=g):g=e[20];let j;e[21]!==p||e[22]!==g?(j={mutationFn:p,onError:g},e[21]=p,e[22]=g,e[23]=j):j=e[23];const x=ge(j);if(c.isLoading){let b;return e[24]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(ee,{size:18,className:"animate-spin text-muted-foreground"})}),e[24]=b):b=e[24],b}if(c.isError){let b;e[25]!==s?(b=s("common.githubRepoPicker.failedLoadAccounts"),e[25]=s,e[26]=b):b=e[26];let _;e[27]!==b?(_=t.jsx("p",{className:"text-sm text-destructive",children:b}),e[27]=b,e[28]=_):_=e[28];let A;e[29]!==s?(A=s("common.githubRepoPicker.connectionExpiredMessage"),e[29]=s,e[30]=A):A=e[30];let z;e[31]!==A?(z=t.jsx("p",{className:"text-xs text-muted-foreground max-w-[280px] leading-relaxed",children:A}),e[31]=A,e[32]=z):z=e[32];let L;e[33]!==x?(L=()=>x.mutate(),e[33]=x,e[34]=L):L=e[34];const H=x.isPending;let G;e[35]!==x.isPending?(G=x.isPending?t.jsx(ee,{size:14,className:"animate-spin"}):t.jsx(M,{className:"size-3.5"}),e[35]=x.isPending,e[36]=G):G=e[36];let O;e[37]!==s?(O=s("common.githubRepoPicker.reconnectGitHub"),e[37]=s,e[38]=O):O=e[38];let F;e[39]!==x.isPending||e[40]!==L||e[41]!==G||e[42]!==O?(F=t.jsxs(ce,{type:"button",variant:"outline",size:"sm",onClick:L,disabled:H,children:[G,O]}),e[39]=x.isPending,e[40]=L,e[41]=G,e[42]=O,e[43]=F):F=e[43];let $;return e[44]!==z||e[45]!==F||e[46]!==_?($=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-6 text-center",children:[_,z,F]}),e[44]=z,e[45]=F,e[46]=_,e[47]=$):$=e[47],$}const i=c.data;if(!i)return null;const v=i.appSlug?`https://github.com/apps/${i.appSlug}/installations/new`:"https://github.com/settings/installations";if(i.installations.length===0){let b;e[48]!==r||e[49]!==a||e[50]!==s?(b=a&&t.jsx("div",{className:"flex items-center gap-1 px-4 pt-3 pb-1 shrink-0",children:t.jsxs("button",{type:"button",onClick:r,className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[t.jsx(de,{size:12}),s("common.githubRepoPicker.changeConnection")]})}),e[48]=r,e[49]=a,e[50]=s,e[51]=b):b=e[51];let _;e[52]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx("div",{className:"size-16 rounded-2xl bg-muted flex items-center justify-center",children:t.jsx(M,{className:"size-8 text-foreground"})}),e[52]=_):_=e[52];let A;e[53]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx("span",{className:"size-1.5 rounded-full bg-success"}),e[53]=A):A=e[53];let z;e[54]!==s?(z=s("common.githubRepoPicker.githubConnected"),e[54]=s,e[55]=z):z=e[55];let L;e[56]!==z?(L=t.jsxs("div",{className:"mt-4 flex items-center gap-1.5 text-xs font-medium text-success",children:[A,z]}),e[56]=z,e[57]=L):L=e[57];let H;e[58]!==s?(H=s("common.githubRepoPicker.setupRepositoriesTitle"),e[58]=s,e[59]=H):H=e[59];let G;e[60]!==H?(G=t.jsx("h2",{className:"mt-2 text-base font-semibold text-foreground",children:H}),e[60]=H,e[61]=G):G=e[61];let O;e[62]!==s?(O=s("common.githubRepoPicker.noRepositoriesShared"),e[62]=s,e[63]=O):O=e[63];let F;e[64]!==O?(F=t.jsx("p",{className:"mt-1.5 max-w-[360px] text-xs leading-relaxed text-muted-foreground",children:O}),e[64]=O,e[65]=F):F=e[65];let $;e[66]!==s?($=s("common.githubRepoPicker.chooseRepositories"),e[66]=s,e[67]=$):$=e[67];let ie;e[68]===Symbol.for("react.memo_cache_sentinel")?(ie=t.jsx(ze,{size:14}),e[68]=ie):ie=e[68];let Q;e[69]!==v||e[70]!==$?(Q=t.jsx(ce,{asChild:!0,size:"sm",children:t.jsxs("a",{href:v,target:"_blank",rel:"noopener noreferrer",children:[$,ie]})}),e[69]=v,e[70]=$,e[71]=Q):Q=e[71];let B;e[72]!==c?(B=()=>{c.refetch()},e[72]=c,e[73]=B):B=e[73];const je=c.isFetching;let V;e[74]!==c.isFetching?(V=c.isFetching&&t.jsx(ee,{size:14,className:"animate-spin"}),e[74]=c.isFetching,e[75]=V):V=e[75];let K;e[76]!==s?(K=s("common.githubRepoPicker.checkAgain"),e[76]=s,e[77]=K):K=e[77];let J;e[78]!==c.isFetching||e[79]!==B||e[80]!==V||e[81]!==K?(J=t.jsxs(ce,{type:"button",variant:"outline",size:"sm",onClick:B,disabled:je,children:[V,K]}),e[78]=c.isFetching,e[79]=B,e[80]=V,e[81]=K,e[82]=J):J=e[82];let W;e[83]!==Q||e[84]!==J?(W=t.jsxs("div",{className:"mt-5 flex items-center gap-2",children:[Q,J]}),e[83]=Q,e[84]=J,e[85]=W):W=e[85];let Y;e[86]!==s?(Y=s("common.githubRepoPicker.repositoryAccessNote"),e[86]=s,e[87]=Y):Y=e[87];let X;e[88]!==Y?(X=t.jsx("p",{className:"mt-4 max-w-[360px] rounded-lg bg-muted/50 px-3 py-2 text-xs leading-relaxed text-muted-foreground",children:Y}),e[88]=Y,e[89]=X):X=e[89];let Z;e[90]!==L||e[91]!==G||e[92]!==F||e[93]!==W||e[94]!==X?(Z=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center px-8 py-6 text-center",children:[_,L,G,F,W,X]}),e[90]=L,e[91]=G,e[92]=F,e[93]=W,e[94]=X,e[95]=Z):Z=e[95];let oe;return e[96]!==Z||e[97]!==b?(oe=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[b,Z]}),e[96]=Z,e[97]=b,e[98]=oe):oe=e[98],oe}let C;e[99]!==r||e[100]!==a||e[101]!==s?(C=a&&t.jsx("div",{className:"flex items-center gap-1 px-4 pt-3 pb-1 shrink-0",children:t.jsxs("button",{type:"button",onClick:r,className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[t.jsx(de,{size:12}),s("common.githubRepoPicker.changeConnection")]})}),e[99]=r,e[100]=a,e[101]=s,e[102]=C):C=e[102];let S;if(e[103]!==i.installations||e[104]!==o||e[105]!==s){let b;e[107]!==o||e[108]!==s?(b=_=>t.jsxs("button",{type:"button",onClick:()=>o(_),className:"w-full flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left group",children:[t.jsx("img",{src:_.avatarUrl,alt:_.login,className:"size-7 rounded-full shrink-0 ring-1 ring-border"}),t.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[t.jsx("span",{className:"text-sm font-medium leading-none",children:_.login}),_.type==="User"&&t.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:s("common.githubRepoPicker.personalAccount")})]}),t.jsxs("span",{className:"text-xs text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity shrink-0",children:[s("common.githubRepoPicker.select")," →"]})]},_.installationId),e[107]=o,e[108]=s,e[109]=b):b=e[109],S=i.installations.map(b),e[103]=i.installations,e[104]=o,e[105]=s,e[106]=S}else S=e[106];let R;e[110]!==S?(R=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden [scrollbar-gutter:stable]",children:S}),e[110]=S,e[111]=R):R=e[111];let P;e[112]!==s?(P=s("common.githubRepoPicker.accountNotListed"),e[112]=s,e[113]=P):P=e[113];let I;e[114]!==s?(I=s("common.githubRepoPicker.installGitHubApp"),e[114]=s,e[115]=I):I=e[115];let T;e[116]!==I?(T=t.jsx("span",{className:"underline underline-offset-2",children:I}),e[116]=I,e[117]=T):T=e[117];let E;e[118]!==v||e[119]!==P||e[120]!==T?(E=t.jsx("div",{className:"px-4 py-3 border-t border-border shrink-0",children:t.jsxs("a",{href:v,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:[P," ",T]})}),e[118]=v,e[119]=P,e[120]=T,e[121]=E):E=e[121];let U;return e[122]!==R||e[123]!==E||e[124]!==C?(U=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[C,R,E]}),e[122]=R,e[123]=E,e[124]=C,e[125]=U):U=e[125],U}function Ve(){}function Ke(k){const e=q.c(23),{connectionId:n,orgId:l,orgSlug:h,installation:o,onSelectRepo:a,isSaving:r}=k,s=te(),[u,y]=D.useState(""),N=Te(u,300),w=D.useDeferredValue(N),f=u!==w;let d;e[0]!==s?(d=s("common.githubRepoPicker.searchRepositories"),e[0]=s,e[1]=d):d=e[1];let m;e[2]!==f||e[3]!==u||e[4]!==d?(m=t.jsx(_e,{placeholder:d,value:u,onChange:y,isSearching:f}),e[2]=f,e[3]=u,e[4]=d,e[5]=m):m=e[5];const c=f?"opacity-40":"opacity-100";let p;e[6]!==c?(p=ue("flex-1 overflow-hidden flex flex-col transition-opacity duration-150",c),e[6]=c,e[7]=p):p=e[7];let g;e[8]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(ee,{size:18,className:"animate-spin text-muted-foreground"})}),e[8]=g):g=e[8];let j;e[9]!==n||e[10]!==w||e[11]!==o||e[12]!==r||e[13]!==a||e[14]!==l||e[15]!==h?(j=t.jsx(D.Suspense,{fallback:g,children:t.jsx(Je,{connectionId:n,orgId:l,orgSlug:h,installation:o,query:w,onSelectRepo:a,isSaving:r})}),e[9]=n,e[10]=w,e[11]=o,e[12]=r,e[13]=a,e[14]=l,e[15]=h,e[16]=j):j=e[16];let x;e[17]!==p||e[18]!==j?(x=t.jsx("div",{className:p,children:j}),e[17]=p,e[18]=j,e[19]=x):x=e[19];let i;return e[20]!==m||e[21]!==x?(i=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[m,x]}),e[20]=m,e[21]=x,e[22]=i):i=e[22],i}function Je(k){const e=q.c(36),{connectionId:n,orgId:l,orgSlug:h,installation:o,query:a,onSelectRepo:r,isSaving:s}=k,u=te();let y;e[0]!==n||e[1]!==l||e[2]!==h?(y={connectionId:n,orgId:l,orgSlug:h},e[0]=n,e[1]=l,e[2]=h,e[3]=y):y=e[3];const N=ne(y),w=o.type==="User"?"user":"org",f=a?`${w}:${o.login} ${a} in:name`:`${w}:${o.login}`;let d;e[4]!==n||e[5]!==o.login||e[6]!==l||e[7]!==a?(d=se.githubOrgRepos(l,n,o.login,a),e[4]=n,e[5]=o.login,e[6]=l,e[7]=a,e[8]=d):d=e[8];let m;e[9]!==N||e[10]!==f?(m=async x=>{const{signal:i}=x,C=(await N.callTool({name:"search_repositories",arguments:{query:f,page:1,perPage:30}},void 0,{signal:i})).content?.[0]?.text;if(!C)throw new Error("No response from search_repositories");return(JSON.parse(C).items??[]).map(We)},e[9]=N,e[10]=f,e[11]=m):m=e[11];let c;e[12]!==d||e[13]!==m?(c={queryKey:d,queryFn:m},e[12]=d,e[13]=m,e[14]=c):c=e[14];const{data:p}=Ce(c);if(p.length===0){let x;e[15]!==u?(x=u("common.githubRepoPicker.noRepositoriesFound"),e[15]=u,e[16]=x):x=e[16];let i;e[17]!==x?(i=t.jsx("p",{className:"text-sm text-muted-foreground",children:x}),e[17]=x,e[18]=i):i=e[18];let v;e[19]!==a||e[20]!==u?(v=a&&t.jsx("p",{className:"text-xs text-muted-foreground/60",children:u("common.githubRepoPicker.tryDifferentSearchTerm")}),e[19]=a,e[20]=u,e[21]=v):v=e[21];let C;return e[22]!==i||e[23]!==v?(C=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-1",children:[i,v]}),e[22]=i,e[23]=v,e[24]=C):C=e[24],C}let g;if(e[25]!==s||e[26]!==r||e[27]!==p||e[28]!==u){let x;e[30]!==s||e[31]!==r||e[32]!==u?(x=i=>t.jsxs("button",{type:"button",onClick:()=>r(i),disabled:s,className:"flex items-start gap-3 px-4 py-3 hover:bg-accent transition-colors text-left disabled:opacity-50 disabled:cursor-not-allowed",children:[t.jsx(M,{className:"size-4 text-muted-foreground mt-0.5 shrink-0"}),t.jsx("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:t.jsx("span",{className:"text-sm font-medium truncate",children:i.name})}),t.jsxs("span",{className:"flex items-center gap-1 text-xs font-medium text-muted-foreground border border-border rounded px-1.5 py-0.5 shrink-0 leading-none",children:[i.private?t.jsx(Re,{size:10}):t.jsx(Le,{size:10}),i.private?u("common.githubRepoPicker.private"):u("common.githubRepoPicker.public")]})]},i.fullName),e[30]=s,e[31]=r,e[32]=u,e[33]=x):x=e[33],g=p.map(x),e[25]=s,e[26]=r,e[27]=p,e[28]=u,e[29]=g}else g=e[29];let j;return e[34]!==g?(j=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden flex flex-col [scrollbar-gutter:stable]",children:g}),e[34]=g,e[35]=j):j=e[35],j}function We(k){return{name:k.name,fullName:k.full_name,owner:k.full_name.split("/")[0]??"",url:k.html_url,private:k.private,description:k.description,updatedAt:k.updated_at}}function ae(k){const e=q.c(51),{status:n,error:l,retry:h}=k,o=te();if(n==="error"){let C;e[0]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx("div",{className:"size-10 rounded-full bg-destructive/10 flex items-center justify-center",children:t.jsx(M,{className:"size-5 text-destructive"})}),e[0]=C):C=e[0];let S;e[1]!==o?(S=o("common.githubRepoPicker.connectionFailed"),e[1]=o,e[2]=S):S=e[2];let R;e[3]!==S?(R=t.jsx("p",{className:"text-sm font-medium",children:S}),e[3]=S,e[4]=R):R=e[4];let P;e[5]!==l||e[6]!==o?(P=l??o("common.githubRepoPicker.somethingWentWrong"),e[5]=l,e[6]=o,e[7]=P):P=e[7];let I;e[8]!==P?(I=t.jsx("p",{className:"text-xs text-muted-foreground max-w-[260px] leading-relaxed",children:P}),e[8]=P,e[9]=I):I=e[9];let T;e[10]!==R||e[11]!==I?(T=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[R,I]}),e[10]=R,e[11]=I,e[12]=T):T=e[12];let E;e[13]!==o?(E=o("common.githubRepoPicker.tryAgain"),e[13]=o,e[14]=E):E=e[14];let U;e[15]!==h||e[16]!==E?(U=t.jsx("button",{type:"button",onClick:h,className:"text-xs font-medium text-foreground border border-border rounded-md px-3 py-1.5 hover:bg-accent transition-colors",children:E}),e[15]=h,e[16]=E,e[17]=U):U=e[17];let b;return e[18]!==T||e[19]!==U?(b=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[C,T,U]}),e[18]=T,e[19]=U,e[20]=b):b=e[20],b}const a=n==="authenticating";let r;e[21]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"size-10 rounded-full bg-muted flex items-center justify-center",children:t.jsx(M,{className:"size-5 text-foreground"})}),e[21]=r):r=e[21];let s;e[22]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsxs("div",{className:"relative size-10",children:[r,t.jsx("div",{className:"absolute -bottom-0.5 -right-0.5 size-4 rounded-full bg-background flex items-center justify-center",children:t.jsx(ee,{size:12,className:"animate-spin text-muted-foreground"})})]}),e[22]=s):s=e[22];let u;e[23]!==a||e[24]!==o?(u=o(a?"common.githubRepoPicker.authenticatingGitHub":"common.githubRepoPicker.settingUpGitHub"),e[23]=a,e[24]=o,e[25]=u):u=e[25];let y;e[26]!==u?(y=t.jsx("p",{className:"text-sm font-medium",children:u}),e[26]=u,e[27]=y):y=e[27];let N;e[28]!==a||e[29]!==o?(N=o(a?"common.githubRepoPicker.completeOAuthFlow":"common.githubRepoPicker.installingGitHubConnection"),e[28]=a,e[29]=o,e[30]=N):N=e[30];let w;e[31]!==N?(w=t.jsx("p",{className:"text-xs text-muted-foreground",children:N}),e[31]=N,e[32]=w):w=e[32];let f;e[33]!==y||e[34]!==w?(f=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[y,w]}),e[33]=y,e[34]=w,e[35]=f):f=e[35];const d=a?"bg-muted-foreground/30":"bg-foreground animate-pulse";let m;e[36]!==d?(m=ue("size-1.5 rounded-full",d),e[36]=d,e[37]=m):m=e[37];let c;e[38]!==m?(c=t.jsx("span",{className:m}),e[38]=m,e[39]=c):c=e[39];const p=a?"bg-foreground animate-pulse":"bg-muted-foreground/30";let g;e[40]!==p?(g=ue("size-1.5 rounded-full",p),e[40]=p,e[41]=g):g=e[41];let j;e[42]!==g?(j=t.jsx("span",{className:g}),e[42]=g,e[43]=j):j=e[43];let x;e[44]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("span",{className:"size-1.5 rounded-full bg-muted-foreground/30"}),e[44]=x):x=e[44];let i;e[45]!==c||e[46]!==j?(i=t.jsxs("div",{className:"flex items-center gap-1.5",children:[c,j,x]}),e[45]=c,e[46]=j,e[47]=i):i=e[47];let v;return e[48]!==i||e[49]!==f?(v=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[s,f,i]}),e[48]=i,e[49]=f,e[50]=v):v=e[50],v}export{M as G,dt as a,qe as b,De as u};
1
+ import{c as q,j as t,F as me,a as ye,o as fe,r as D,$ as le,b as te,k as ee,e as ge,t as re,dS as Ne,K as se,G as ve,n as ke,m as ue,B as ce,x as Ce,y as Re}from"./index-CjF26QCG.js";import{a as we,b as Se,d as Pe,e as Ie}from"./dialog-Pi_xgHC0.js";import{C as _e}from"./collection-search-mxPX78OM.js";import{u as Te}from"./use-debounced-value-DmKXCTEI.js";import{b as he,u as Ee}from"./use-connection-CxlwOHmS.js";import{W as Ae,u as ne,S as pe}from"./use-mcp-client-BGlPrg7w.js";import{a as be}from"./authenticate-and-persist-oauth-QBHD9BB_.js";import{b as de}from"./Settings02-D-zT1K0J.js";import{n as ze}from"./LinkExternal01-CxFcmhCv.js";import{U as Le}from"./agent-icon-DCuaG5nE.js";import{u as Ge}from"./use-mcp-tools-rAYUC4rV.js";import{e as Oe}from"./extract-connection-data-DAPoTrnj.js";import{c as Fe}from"./use-navigate-to-agent-kFHXJGki.js";import{g as Ue,p as xe,f as $e}from"./provision-repo-scoped-github-connection-DWINBxtd.js";function M(k){const e=q.c(4),{size:n,className:l}=k;let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0016 8c0-4.42-3.58-8-8-8z"}),e[0]=h):h=e[0];let o;return e[1]!==l||e[2]!==n?(o=t.jsx("svg",{width:n,height:n,viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",className:l,children:h}),e[1]=l,e[2]=n,e[3]=o):o=e[3],o}function De(k,e){const n=q.c(12),{org:l}=me();let h;n[0]!==l.id?(h=Ae.REGISTRY(l.id),n[0]=l.id,n[1]=h):h=n[1];const o=h;let a;n[2]!==l.id||n[3]!==l.slug||n[4]!==o?(a={connectionId:o,orgId:l.id,orgSlug:l.slug},n[2]=l.id,n[3]=l.slug,n[4]=o,n[5]=a):a=n[5];const r=ne(a);let s;n[6]!==k?(s={name:k},n[6]=k,n[7]=s):s=n[7];const u=e?.enabled??!0;let y;return n[8]!==r||n[9]!==s||n[10]!==u?(y={client:r,toolName:"COLLECTION_REGISTRY_APP_GET",toolArguments:s,enabled:u,staleTime:3e5,select:He},n[8]=r,n[9]=s,n[10]=u,n[11]=y):y=n[11],Ge(y)}function He(k){return k.structuredContent?.item??null}const Me="deco/mcp-github";function qe(k){const{org:e}=me(),{data:n}=ye.useSession(),l=he(),h=fe(),[o,a]=D.useState("idle"),[r,s]=D.useState(null),[u,y]=D.useState(null),{data:N,isLoading:w}=De(Me,{enabled:k.enabled}),f=D.useRef(!1);k.enabled&&N&&!w&&!f.current&&n?.user?.id&&o==="idle"&&(f.current=!0,d());async function d(){if(!(!N||!n?.user?.id||!e))try{a("installing"),s(null);const c=Oe(N,e.id,n.user.id,{remoteIndex:0});if(!c.connection_url)throw new Error("Registry item is missing a remote URL for mcp-github");const{id:g}=await l.create.mutateAsync(c);a("authenticating");const j=await be({connectionId:g,orgId:e.id,orgSlug:e.slug,persistFallback:x=>l.update.mutateAsync({id:g,data:{connection_token:x}}).then(()=>{})});if(j.ran&&!j.ok){try{await l.delete.mutateAsync(g)}catch{}throw new Error(j.error&&j.error!=="no token received"?j.error:"No token received from GitHub")}le(h,e.id),y(c),a("ready")}catch(c){s(c instanceof Error?c.message:String(c)),a("error")}}function m(){a("idle"),s(null),y(null),f.current=!1}return k.enabled&&w&&o==="idle"?{status:"installing",error:null,connection:null,retry:m}:{status:o,error:r,connection:u,retry:m}}function dt(k){const e=q.c(27),{open:n,onOpenChange:l,title:h,onImportComplete:o,mode:a}=k,r=a===void 0?"agent":a,s=te();let u;e[0]!==r||e[1]!==s||e[2]!==h?(u=h??s(r==="connection"?"common.githubRepoPicker.addRepo":"common.githubRepoPicker.importFromGitHub"),e[0]=r,e[1]=s,e[2]=h,e[3]=u):u=e[3];const y=u,[N,w]=D.useState(null);let f;e[4]!==y?(f=t.jsx(we,{className:"sr-only",children:t.jsx(Se,{children:y})}),e[4]=y,e[5]=f):f=e[5];let d;e[6]!==y||e[7]!==N||e[8]!==s?(d=t.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3 shrink-0",children:N?t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:()=>w(null),className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors shrink-0","aria-label":s("common.githubRepoPicker.backToAccounts"),children:t.jsx(de,{size:16})}),t.jsx("img",{src:N.avatarUrl,alt:N.login,className:"size-5 rounded-full ring-1 ring-border shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:N.login})]}):t.jsxs(t.Fragment,{children:[t.jsx(M,{className:"size-4 text-foreground shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:y})]})}),e[6]=y,e[7]=N,e[8]=s,e[9]=d):d=e[9];let m;e[10]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(ee,{size:18,className:"animate-spin text-muted-foreground"})}),e[10]=m):m=e[10];let c;e[11]!==l?(c=()=>l(!1),e[11]=l,e[12]=c):c=e[12];let p;e[13]!==r||e[14]!==o||e[15]!==n||e[16]!==N||e[17]!==c?(p=t.jsx("div",{className:"flex-1 overflow-hidden flex flex-col min-w-0",children:t.jsx(D.Suspense,{fallback:m,children:t.jsx(Qe,{open:n,onComplete:c,selectedInstallation:N,onSelectInstallation:w,onImportComplete:o,mode:r})})}),e[13]=r,e[14]=o,e[15]=n,e[16]=N,e[17]=c,e[18]=p):p=e[18];let g;e[19]!==f||e[20]!==d||e[21]!==p?(g=t.jsxs(Pe,{className:"sm:max-w-[560px] h-[85svh] sm:h-[520px] p-0 gap-0 overflow-hidden flex flex-col",children:[f,d,p]}),e[19]=f,e[20]=d,e[21]=p,e[22]=g):g=e[22];let j;return e[23]!==l||e[24]!==n||e[25]!==g?(j=t.jsx(Ie,{open:n,onOpenChange:l,children:g}),e[23]=l,e[24]=n,e[25]=g,e[26]=j):j=e[26],j}function Qe({open:k,onComplete:e,selectedInstallation:n,onSelectInstallation:l,onImportComplete:h,mode:o="agent"}){const a=te(),{org:r}=me(),s=fe(),u=Fe(),[y,N]=D.useState(null),w=Ee({slug:"mcp-github"}),f=Ue(w),d=qe({enabled:k&&f.length===0}),m=f.length===1?f[0]??null:y,c=ne({connectionId:m?.id??"",orgId:r.id,orgSlug:r.slug}),p=ne({connectionId:pe,orgId:r.id,orgSlug:r.slug}),g=async(i,v)=>{try{const S=await c.callTool({name:"get_file_contents",arguments:{owner:i.owner,repo:i.name,path:v}});if(S.isError)return null;const P=S.content?.find(I=>I.type==="resource")?.resource?.text;if(!P)return null;try{const I=JSON.parse(P);return typeof I=="string"?I:JSON.stringify(I)}catch{return P}}catch{return null}},j=(i,v)=>{Promise.all([g(v,"AGENTS.md"),g(v,"CLAUDE.md")]).then(async([C,S])=>{const R=C??S??null;R&&(await p.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:i,data:{metadata:{instructions:R}}}}),le(s,r.id))}).catch(C=>{console.error("GitHub instructions fetch failed:",C)})},x=ge({mutationFn:async i=>{if(!m||!n)throw new Error("No GitHub connection or installation");const v=n.installationId;if(o==="connection"){const{childConnectionId:R}=await xe({orgSlug:r.slug,sourceConnection:m,installationId:v,owner:i.owner,repo:i.name,githubCallTool:P=>c.callTool(P),selfCallTool:P=>p.callTool(P),orgShared:!0});return{virtualMcpId:null,repo:i,connectionId:R,item:null}}const{childConnectionId:C}=await xe({orgSlug:r.slug,sourceConnection:m,installationId:v,owner:i.owner,repo:i.name,githubCallTool:R=>c.callTool(R),selfCallTool:R=>p.callTool(R)});let S=null;try{const R=await p.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:i.name,description:i.description||"Imported from GitHub",pinned:!1,icon:null,metadata:{githubRepo:{owner:i.owner,name:i.name,url:i.url,installationId:v,connectionId:C},instructions:null,ui:{pinnedViews:null,layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}},connections:[{connection_id:C}]}}}),P=R.structuredContent??R,I=P.item?.id;if(!P.item||!I)throw new Error("Failed to create the imported agent");return S=I,{virtualMcpId:I,repo:i,connectionId:C,item:P.item}}catch(R){throw S&&await p.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:S}}).catch(()=>{}),await p.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:C,force:!0}}).catch(()=>{}),R}},onSuccess:({virtualMcpId:i,repo:v,connectionId:C,item:S})=>{if(o==="connection"||!i||!S){le(s,r.id),Ne(s,r.id),re.success(a("common.githubRepoPicker.addedRepo",{name:v.name})),e();return}if(s.setQueryData(se.collectionItem(p,r.id,"","VIRTUAL_MCP",i),{item:S}),le(s,r.id),j(i,v),h){h({virtualMcpId:i,repo:v,connectionId:C});return}re.success(a("common.githubRepoPicker.importedRepo",{name:v.name})),e(),localStorage.setItem(ve.sidebarOpen(),JSON.stringify(!1)),u(i)},onError:i=>{re.error(a("common.githubRepoPicker.failedImport",{error:i instanceof Error?i.message:a("common.githubRepoPicker.unknownError")}))}});return d.status==="installing"||d.status==="authenticating"?t.jsx(ae,{status:d.status,error:null,retry:d.retry}):d.status==="error"?t.jsx(ae,{status:"error",error:d.error,retry:d.retry}):f.length===0&&d.status==="idle"?t.jsx(ae,{status:"installing",error:null,retry:d.retry}):f.length>1&&!m?t.jsxs("div",{className:"flex flex-col py-2",children:[t.jsx("div",{className:"px-4 py-2",children:t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:a("common.githubRepoPicker.selectConnection")})}),f.map(i=>t.jsxs("button",{type:"button",onClick:()=>N(i),className:"flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left",children:[i.icon?t.jsx("img",{src:i.icon,alt:i.title,className:"size-7 rounded-full shrink-0"}):t.jsx("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:t.jsx(M,{className:"size-3.5 text-muted-foreground"})}),t.jsx("span",{className:"text-sm font-medium",children:i.title})]},i.id))]}):m?n?t.jsx(Ke,{connectionId:m.id,orgId:r.id,orgSlug:r.slug,installation:n,onSelectRepo:i=>x.mutate(i),isSaving:x.isPending}):t.jsx(Be,{connectionId:m.id,orgId:r.id,orgSlug:r.slug,onSelect:l,showBackButton:f.length>1,onBack:()=>N(null)}):null}function Be(k){const e=q.c(126),{connectionId:n,orgId:l,orgSlug:h,onSelect:o,showBackButton:a,onBack:r}=k,s=te();let u;e[0]!==l||e[1]!==h?(u={connectionId:pe,orgId:l,orgSlug:h},e[0]=l,e[1]=h,e[2]=u):u=e[2];const y=ne(u),N=fe(),w=he();let f;e[3]!==n||e[4]!==l?(f=se.githubUserOrgs(l,n),e[3]=n,e[4]=l,e[5]=f):f=e[5];let d;e[6]!==n||e[7]!==y?(d=()=>$e(b=>y.callTool(b),n),e[6]=n,e[7]=y,e[8]=d):d=e[8];let m;e[9]!==f||e[10]!==d?(m={queryKey:f,queryFn:d},e[9]=f,e[10]=d,e[11]=m):m=e[11];const c=ke(m);let p;e[12]!==w||e[13]!==n||e[14]!==c||e[15]!==l||e[16]!==h||e[17]!==N?(p=async()=>{const b=await be({connectionId:n,orgId:l,orgSlug:h,persistFallback:A=>w.update.mutateAsync({id:n,data:{connection_token:A}}).then(Ve)});if(b.ran&&!b.ok)throw new Error(b.error??"no token received");const _=new URL(`/api/${h}/mcp/${n}`,window.location.origin);await N.invalidateQueries({queryKey:se.isMCPAuthenticated(_.href,null)}),await N.invalidateQueries({queryKey:se.mcpClientPrefix()}),await c.refetch()},e[12]=w,e[13]=n,e[14]=c,e[15]=l,e[16]=h,e[17]=N,e[18]=p):p=e[18];let g;e[19]!==s?(g=b=>{re.error(s("common.githubRepoPicker.failedReconnect",{error:b instanceof Error?b.message:s("common.githubRepoPicker.unknownError")}))},e[19]=s,e[20]=g):g=e[20];let j;e[21]!==p||e[22]!==g?(j={mutationFn:p,onError:g},e[21]=p,e[22]=g,e[23]=j):j=e[23];const x=ge(j);if(c.isLoading){let b;return e[24]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(ee,{size:18,className:"animate-spin text-muted-foreground"})}),e[24]=b):b=e[24],b}if(c.isError){let b;e[25]!==s?(b=s("common.githubRepoPicker.failedLoadAccounts"),e[25]=s,e[26]=b):b=e[26];let _;e[27]!==b?(_=t.jsx("p",{className:"text-sm text-destructive",children:b}),e[27]=b,e[28]=_):_=e[28];let A;e[29]!==s?(A=s("common.githubRepoPicker.connectionExpiredMessage"),e[29]=s,e[30]=A):A=e[30];let z;e[31]!==A?(z=t.jsx("p",{className:"text-xs text-muted-foreground max-w-[280px] leading-relaxed",children:A}),e[31]=A,e[32]=z):z=e[32];let L;e[33]!==x?(L=()=>x.mutate(),e[33]=x,e[34]=L):L=e[34];const H=x.isPending;let G;e[35]!==x.isPending?(G=x.isPending?t.jsx(ee,{size:14,className:"animate-spin"}):t.jsx(M,{className:"size-3.5"}),e[35]=x.isPending,e[36]=G):G=e[36];let O;e[37]!==s?(O=s("common.githubRepoPicker.reconnectGitHub"),e[37]=s,e[38]=O):O=e[38];let F;e[39]!==x.isPending||e[40]!==L||e[41]!==G||e[42]!==O?(F=t.jsxs(ce,{type:"button",variant:"outline",size:"sm",onClick:L,disabled:H,children:[G,O]}),e[39]=x.isPending,e[40]=L,e[41]=G,e[42]=O,e[43]=F):F=e[43];let $;return e[44]!==z||e[45]!==F||e[46]!==_?($=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-6 text-center",children:[_,z,F]}),e[44]=z,e[45]=F,e[46]=_,e[47]=$):$=e[47],$}const i=c.data;if(!i)return null;const v=i.appSlug?`https://github.com/apps/${i.appSlug}/installations/new`:"https://github.com/settings/installations";if(i.installations.length===0){let b;e[48]!==r||e[49]!==a||e[50]!==s?(b=a&&t.jsx("div",{className:"flex items-center gap-1 px-4 pt-3 pb-1 shrink-0",children:t.jsxs("button",{type:"button",onClick:r,className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[t.jsx(de,{size:12}),s("common.githubRepoPicker.changeConnection")]})}),e[48]=r,e[49]=a,e[50]=s,e[51]=b):b=e[51];let _;e[52]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx("div",{className:"size-16 rounded-2xl bg-muted flex items-center justify-center",children:t.jsx(M,{className:"size-8 text-foreground"})}),e[52]=_):_=e[52];let A;e[53]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx("span",{className:"size-1.5 rounded-full bg-success"}),e[53]=A):A=e[53];let z;e[54]!==s?(z=s("common.githubRepoPicker.githubConnected"),e[54]=s,e[55]=z):z=e[55];let L;e[56]!==z?(L=t.jsxs("div",{className:"mt-4 flex items-center gap-1.5 text-xs font-medium text-success",children:[A,z]}),e[56]=z,e[57]=L):L=e[57];let H;e[58]!==s?(H=s("common.githubRepoPicker.setupRepositoriesTitle"),e[58]=s,e[59]=H):H=e[59];let G;e[60]!==H?(G=t.jsx("h2",{className:"mt-2 text-base font-semibold text-foreground",children:H}),e[60]=H,e[61]=G):G=e[61];let O;e[62]!==s?(O=s("common.githubRepoPicker.noRepositoriesShared"),e[62]=s,e[63]=O):O=e[63];let F;e[64]!==O?(F=t.jsx("p",{className:"mt-1.5 max-w-[360px] text-xs leading-relaxed text-muted-foreground",children:O}),e[64]=O,e[65]=F):F=e[65];let $;e[66]!==s?($=s("common.githubRepoPicker.chooseRepositories"),e[66]=s,e[67]=$):$=e[67];let ie;e[68]===Symbol.for("react.memo_cache_sentinel")?(ie=t.jsx(ze,{size:14}),e[68]=ie):ie=e[68];let Q;e[69]!==v||e[70]!==$?(Q=t.jsx(ce,{asChild:!0,size:"sm",children:t.jsxs("a",{href:v,target:"_blank",rel:"noopener noreferrer",children:[$,ie]})}),e[69]=v,e[70]=$,e[71]=Q):Q=e[71];let B;e[72]!==c?(B=()=>{c.refetch()},e[72]=c,e[73]=B):B=e[73];const je=c.isFetching;let V;e[74]!==c.isFetching?(V=c.isFetching&&t.jsx(ee,{size:14,className:"animate-spin"}),e[74]=c.isFetching,e[75]=V):V=e[75];let K;e[76]!==s?(K=s("common.githubRepoPicker.checkAgain"),e[76]=s,e[77]=K):K=e[77];let J;e[78]!==c.isFetching||e[79]!==B||e[80]!==V||e[81]!==K?(J=t.jsxs(ce,{type:"button",variant:"outline",size:"sm",onClick:B,disabled:je,children:[V,K]}),e[78]=c.isFetching,e[79]=B,e[80]=V,e[81]=K,e[82]=J):J=e[82];let W;e[83]!==Q||e[84]!==J?(W=t.jsxs("div",{className:"mt-5 flex items-center gap-2",children:[Q,J]}),e[83]=Q,e[84]=J,e[85]=W):W=e[85];let Y;e[86]!==s?(Y=s("common.githubRepoPicker.repositoryAccessNote"),e[86]=s,e[87]=Y):Y=e[87];let X;e[88]!==Y?(X=t.jsx("p",{className:"mt-4 max-w-[360px] rounded-lg bg-muted/50 px-3 py-2 text-xs leading-relaxed text-muted-foreground",children:Y}),e[88]=Y,e[89]=X):X=e[89];let Z;e[90]!==L||e[91]!==G||e[92]!==F||e[93]!==W||e[94]!==X?(Z=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center px-8 py-6 text-center",children:[_,L,G,F,W,X]}),e[90]=L,e[91]=G,e[92]=F,e[93]=W,e[94]=X,e[95]=Z):Z=e[95];let oe;return e[96]!==Z||e[97]!==b?(oe=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[b,Z]}),e[96]=Z,e[97]=b,e[98]=oe):oe=e[98],oe}let C;e[99]!==r||e[100]!==a||e[101]!==s?(C=a&&t.jsx("div",{className:"flex items-center gap-1 px-4 pt-3 pb-1 shrink-0",children:t.jsxs("button",{type:"button",onClick:r,className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[t.jsx(de,{size:12}),s("common.githubRepoPicker.changeConnection")]})}),e[99]=r,e[100]=a,e[101]=s,e[102]=C):C=e[102];let S;if(e[103]!==i.installations||e[104]!==o||e[105]!==s){let b;e[107]!==o||e[108]!==s?(b=_=>t.jsxs("button",{type:"button",onClick:()=>o(_),className:"w-full flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left group",children:[t.jsx("img",{src:_.avatarUrl,alt:_.login,className:"size-7 rounded-full shrink-0 ring-1 ring-border"}),t.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[t.jsx("span",{className:"text-sm font-medium leading-none",children:_.login}),_.type==="User"&&t.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:s("common.githubRepoPicker.personalAccount")})]}),t.jsxs("span",{className:"text-xs text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity shrink-0",children:[s("common.githubRepoPicker.select")," →"]})]},_.installationId),e[107]=o,e[108]=s,e[109]=b):b=e[109],S=i.installations.map(b),e[103]=i.installations,e[104]=o,e[105]=s,e[106]=S}else S=e[106];let R;e[110]!==S?(R=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden [scrollbar-gutter:stable]",children:S}),e[110]=S,e[111]=R):R=e[111];let P;e[112]!==s?(P=s("common.githubRepoPicker.accountNotListed"),e[112]=s,e[113]=P):P=e[113];let I;e[114]!==s?(I=s("common.githubRepoPicker.installGitHubApp"),e[114]=s,e[115]=I):I=e[115];let T;e[116]!==I?(T=t.jsx("span",{className:"underline underline-offset-2",children:I}),e[116]=I,e[117]=T):T=e[117];let E;e[118]!==v||e[119]!==P||e[120]!==T?(E=t.jsx("div",{className:"px-4 py-3 border-t border-border shrink-0",children:t.jsxs("a",{href:v,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:[P," ",T]})}),e[118]=v,e[119]=P,e[120]=T,e[121]=E):E=e[121];let U;return e[122]!==R||e[123]!==E||e[124]!==C?(U=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[C,R,E]}),e[122]=R,e[123]=E,e[124]=C,e[125]=U):U=e[125],U}function Ve(){}function Ke(k){const e=q.c(23),{connectionId:n,orgId:l,orgSlug:h,installation:o,onSelectRepo:a,isSaving:r}=k,s=te(),[u,y]=D.useState(""),N=Te(u,300),w=D.useDeferredValue(N),f=u!==w;let d;e[0]!==s?(d=s("common.githubRepoPicker.searchRepositories"),e[0]=s,e[1]=d):d=e[1];let m;e[2]!==f||e[3]!==u||e[4]!==d?(m=t.jsx(_e,{placeholder:d,value:u,onChange:y,isSearching:f}),e[2]=f,e[3]=u,e[4]=d,e[5]=m):m=e[5];const c=f?"opacity-40":"opacity-100";let p;e[6]!==c?(p=ue("flex-1 overflow-hidden flex flex-col transition-opacity duration-150",c),e[6]=c,e[7]=p):p=e[7];let g;e[8]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(ee,{size:18,className:"animate-spin text-muted-foreground"})}),e[8]=g):g=e[8];let j;e[9]!==n||e[10]!==w||e[11]!==o||e[12]!==r||e[13]!==a||e[14]!==l||e[15]!==h?(j=t.jsx(D.Suspense,{fallback:g,children:t.jsx(Je,{connectionId:n,orgId:l,orgSlug:h,installation:o,query:w,onSelectRepo:a,isSaving:r})}),e[9]=n,e[10]=w,e[11]=o,e[12]=r,e[13]=a,e[14]=l,e[15]=h,e[16]=j):j=e[16];let x;e[17]!==p||e[18]!==j?(x=t.jsx("div",{className:p,children:j}),e[17]=p,e[18]=j,e[19]=x):x=e[19];let i;return e[20]!==m||e[21]!==x?(i=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[m,x]}),e[20]=m,e[21]=x,e[22]=i):i=e[22],i}function Je(k){const e=q.c(36),{connectionId:n,orgId:l,orgSlug:h,installation:o,query:a,onSelectRepo:r,isSaving:s}=k,u=te();let y;e[0]!==n||e[1]!==l||e[2]!==h?(y={connectionId:n,orgId:l,orgSlug:h},e[0]=n,e[1]=l,e[2]=h,e[3]=y):y=e[3];const N=ne(y),w=o.type==="User"?"user":"org",f=a?`${w}:${o.login} ${a} in:name`:`${w}:${o.login}`;let d;e[4]!==n||e[5]!==o.login||e[6]!==l||e[7]!==a?(d=se.githubOrgRepos(l,n,o.login,a),e[4]=n,e[5]=o.login,e[6]=l,e[7]=a,e[8]=d):d=e[8];let m;e[9]!==N||e[10]!==f?(m=async x=>{const{signal:i}=x,C=(await N.callTool({name:"search_repositories",arguments:{query:f,page:1,perPage:30}},void 0,{signal:i})).content?.[0]?.text;if(!C)throw new Error("No response from search_repositories");return(JSON.parse(C).items??[]).map(We)},e[9]=N,e[10]=f,e[11]=m):m=e[11];let c;e[12]!==d||e[13]!==m?(c={queryKey:d,queryFn:m},e[12]=d,e[13]=m,e[14]=c):c=e[14];const{data:p}=Ce(c);if(p.length===0){let x;e[15]!==u?(x=u("common.githubRepoPicker.noRepositoriesFound"),e[15]=u,e[16]=x):x=e[16];let i;e[17]!==x?(i=t.jsx("p",{className:"text-sm text-muted-foreground",children:x}),e[17]=x,e[18]=i):i=e[18];let v;e[19]!==a||e[20]!==u?(v=a&&t.jsx("p",{className:"text-xs text-muted-foreground/60",children:u("common.githubRepoPicker.tryDifferentSearchTerm")}),e[19]=a,e[20]=u,e[21]=v):v=e[21];let C;return e[22]!==i||e[23]!==v?(C=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-1",children:[i,v]}),e[22]=i,e[23]=v,e[24]=C):C=e[24],C}let g;if(e[25]!==s||e[26]!==r||e[27]!==p||e[28]!==u){let x;e[30]!==s||e[31]!==r||e[32]!==u?(x=i=>t.jsxs("button",{type:"button",onClick:()=>r(i),disabled:s,className:"flex items-start gap-3 px-4 py-3 hover:bg-accent transition-colors text-left disabled:opacity-50 disabled:cursor-not-allowed",children:[t.jsx(M,{className:"size-4 text-muted-foreground mt-0.5 shrink-0"}),t.jsx("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:t.jsx("span",{className:"text-sm font-medium truncate",children:i.name})}),t.jsxs("span",{className:"flex items-center gap-1 text-xs font-medium text-muted-foreground border border-border rounded px-1.5 py-0.5 shrink-0 leading-none",children:[i.private?t.jsx(Re,{size:10}):t.jsx(Le,{size:10}),i.private?u("common.githubRepoPicker.private"):u("common.githubRepoPicker.public")]})]},i.fullName),e[30]=s,e[31]=r,e[32]=u,e[33]=x):x=e[33],g=p.map(x),e[25]=s,e[26]=r,e[27]=p,e[28]=u,e[29]=g}else g=e[29];let j;return e[34]!==g?(j=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden flex flex-col [scrollbar-gutter:stable]",children:g}),e[34]=g,e[35]=j):j=e[35],j}function We(k){return{name:k.name,fullName:k.full_name,owner:k.full_name.split("/")[0]??"",url:k.html_url,private:k.private,description:k.description,updatedAt:k.updated_at}}function ae(k){const e=q.c(51),{status:n,error:l,retry:h}=k,o=te();if(n==="error"){let C;e[0]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx("div",{className:"size-10 rounded-full bg-destructive/10 flex items-center justify-center",children:t.jsx(M,{className:"size-5 text-destructive"})}),e[0]=C):C=e[0];let S;e[1]!==o?(S=o("common.githubRepoPicker.connectionFailed"),e[1]=o,e[2]=S):S=e[2];let R;e[3]!==S?(R=t.jsx("p",{className:"text-sm font-medium",children:S}),e[3]=S,e[4]=R):R=e[4];let P;e[5]!==l||e[6]!==o?(P=l??o("common.githubRepoPicker.somethingWentWrong"),e[5]=l,e[6]=o,e[7]=P):P=e[7];let I;e[8]!==P?(I=t.jsx("p",{className:"text-xs text-muted-foreground max-w-[260px] leading-relaxed",children:P}),e[8]=P,e[9]=I):I=e[9];let T;e[10]!==R||e[11]!==I?(T=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[R,I]}),e[10]=R,e[11]=I,e[12]=T):T=e[12];let E;e[13]!==o?(E=o("common.githubRepoPicker.tryAgain"),e[13]=o,e[14]=E):E=e[14];let U;e[15]!==h||e[16]!==E?(U=t.jsx("button",{type:"button",onClick:h,className:"text-xs font-medium text-foreground border border-border rounded-md px-3 py-1.5 hover:bg-accent transition-colors",children:E}),e[15]=h,e[16]=E,e[17]=U):U=e[17];let b;return e[18]!==T||e[19]!==U?(b=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[C,T,U]}),e[18]=T,e[19]=U,e[20]=b):b=e[20],b}const a=n==="authenticating";let r;e[21]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"size-10 rounded-full bg-muted flex items-center justify-center",children:t.jsx(M,{className:"size-5 text-foreground"})}),e[21]=r):r=e[21];let s;e[22]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsxs("div",{className:"relative size-10",children:[r,t.jsx("div",{className:"absolute -bottom-0.5 -right-0.5 size-4 rounded-full bg-background flex items-center justify-center",children:t.jsx(ee,{size:12,className:"animate-spin text-muted-foreground"})})]}),e[22]=s):s=e[22];let u;e[23]!==a||e[24]!==o?(u=o(a?"common.githubRepoPicker.authenticatingGitHub":"common.githubRepoPicker.settingUpGitHub"),e[23]=a,e[24]=o,e[25]=u):u=e[25];let y;e[26]!==u?(y=t.jsx("p",{className:"text-sm font-medium",children:u}),e[26]=u,e[27]=y):y=e[27];let N;e[28]!==a||e[29]!==o?(N=o(a?"common.githubRepoPicker.completeOAuthFlow":"common.githubRepoPicker.installingGitHubConnection"),e[28]=a,e[29]=o,e[30]=N):N=e[30];let w;e[31]!==N?(w=t.jsx("p",{className:"text-xs text-muted-foreground",children:N}),e[31]=N,e[32]=w):w=e[32];let f;e[33]!==y||e[34]!==w?(f=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[y,w]}),e[33]=y,e[34]=w,e[35]=f):f=e[35];const d=a?"bg-muted-foreground/30":"bg-foreground animate-pulse";let m;e[36]!==d?(m=ue("size-1.5 rounded-full",d),e[36]=d,e[37]=m):m=e[37];let c;e[38]!==m?(c=t.jsx("span",{className:m}),e[38]=m,e[39]=c):c=e[39];const p=a?"bg-foreground animate-pulse":"bg-muted-foreground/30";let g;e[40]!==p?(g=ue("size-1.5 rounded-full",p),e[40]=p,e[41]=g):g=e[41];let j;e[42]!==g?(j=t.jsx("span",{className:g}),e[42]=g,e[43]=j):j=e[43];let x;e[44]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("span",{className:"size-1.5 rounded-full bg-muted-foreground/30"}),e[44]=x):x=e[44];let i;e[45]!==c||e[46]!==j?(i=t.jsxs("div",{className:"flex items-center gap-1.5",children:[c,j,x]}),e[45]=c,e[46]=j,e[47]=i):i=e[47];let v;return e[48]!==i||e[49]!==f?(v=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[s,f,i]}),e[48]=i,e[49]=f,e[50]=v):v=e[50],v}export{M as G,dt as a,qe as b,De as u};
@@ -1,4 +1,4 @@
1
- import{dv as St,dw as It,ba as R,Y as c,dx as de,bg as ze,dy as Et,b9 as Tt,aH as wt,a5 as A,a4 as G,a2 as oe,X as _,bb as m,b0 as F,cp as Mt,dz as I,a3 as Ot,t as ge,c as Ee,r as W,F as At,j as Ct}from"./index-CpB-IlaU.js";import{S as Rt,u as Nt}from"./use-mcp-client-nWQQesMe.js";import{d as xt}from"./delay-CnY5UFtP.js";import{e as Pt}from"./backoff-CrEUbyZT.js";import{d as Dt,D as kt}from"./decopilot-sse-pool-DF2dyY7L.js";var re;(function(t){t.assertEqual=s=>{};function e(s){}t.assertIs=e;function a(s){throw new Error}t.assertNever=a,t.arrayToEnum=s=>{const o={};for(const i of s)o[i]=i;return o},t.getValidEnumValues=s=>{const o=t.objectKeys(s).filter(n=>typeof s[s[n]]!="number"),i={};for(const n of o)i[n]=s[n];return t.objectValues(i)},t.objectValues=s=>t.objectKeys(s).map(function(o){return s[o]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const o=[];for(const i in s)Object.prototype.hasOwnProperty.call(s,i)&&o.push(i);return o},t.find=(s,o)=>{for(const i of s)if(o(i))return i},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function r(s,o=" | "){return s.map(i=>typeof i=="string"?`'${i}'`:i).join(o)}t.joinValues=r,t.jsonStringifyReplacer=(s,o)=>typeof o=="bigint"?o.toString():o})(re||(re={}));var Oe;(function(t){t.mergeShapes=(e,a)=>({...e,...a})})(Oe||(Oe={}));re.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);re.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class ce extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const a=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,a):this.__proto__=a,this.name="ZodError",this.issues=e}format(e){const a=e||function(o){return o.message},r={_errors:[]},s=o=>{for(const i of o.issues)if(i.code==="invalid_union")i.unionErrors.map(s);else if(i.code==="invalid_return_type")s(i.returnTypeError);else if(i.code==="invalid_arguments")s(i.argumentsError);else if(i.path.length===0)r._errors.push(a(i));else{let n=r,p=0;for(;p<i.path.length;){const u=i.path[p];p===i.path.length-1?(n[u]=n[u]||{_errors:[]},n[u]._errors.push(a(i))):n[u]=n[u]||{_errors:[]},n=n[u],p++}}};return s(this),r}static assert(e){if(!(e instanceof ce))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,re.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=a=>a.message){const a=Object.create(null),r=[];for(const s of this.issues)if(s.path.length>0){const o=s.path[0];a[o]=a[o]||[],a[o].push(e(s))}else r.push(e(s));return{formErrors:r,fieldErrors:a}}get formErrors(){return this.flatten()}}ce.create=t=>new ce(t);var Ae;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(Ae||(Ae={}));var h;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(h||(h={}));var Je="vercel.ai.error",Lt=Symbol.for(Je),Ce,Re,Z=class We extends(Re=Error,Ce=Lt,Re){constructor({name:e,message:a,cause:r}){super(a),this[Ce]=!0,this.name=e,this.cause=r}static isInstance(e){return We.hasMarker(e,Je)}static hasMarker(e,a){const r=Symbol.for(a);return e!=null&&typeof e=="object"&&r in e&&typeof e[r]=="boolean"&&e[r]===!0}};function Ge(t){return t==null?"unknown error":typeof t=="string"?t:t instanceof Error?t.message:JSON.stringify(t)}var Ye="AI_InvalidArgumentError",He=`vercel.ai.error.${Ye}`,jt=Symbol.for(He),Ne,xe,Zt=class extends(xe=Z,Ne=jt,xe){constructor({message:t,cause:e,argument:a}){super({name:Ye,message:t,cause:e}),this[Ne]=!0,this.argument=a}static isInstance(t){return Z.hasMarker(t,He)}},qe="AI_JSONParseError",Xe=`vercel.ai.error.${qe}`,$t=Symbol.for(Xe),Pe,De,ke=class extends(De=Z,Pe=$t,De){constructor({text:t,cause:e}){super({name:qe,message:`JSON parsing failed: Text: ${t}.
1
+ import{dv as St,dw as It,ba as R,Y as c,dx as de,bg as ze,dy as Et,b9 as Tt,aH as wt,a5 as A,a4 as G,a2 as oe,X as _,bb as m,b0 as F,cp as Mt,dz as I,a3 as Ot,t as ge,c as Ee,r as W,F as At,j as Ct}from"./index-CjF26QCG.js";import{S as Rt,u as Nt}from"./use-mcp-client-BGlPrg7w.js";import{d as xt}from"./delay-CnY5UFtP.js";import{e as Pt}from"./backoff-CrEUbyZT.js";import{d as Dt,D as kt}from"./decopilot-sse-pool-boA36psC.js";var re;(function(t){t.assertEqual=s=>{};function e(s){}t.assertIs=e;function a(s){throw new Error}t.assertNever=a,t.arrayToEnum=s=>{const o={};for(const i of s)o[i]=i;return o},t.getValidEnumValues=s=>{const o=t.objectKeys(s).filter(n=>typeof s[s[n]]!="number"),i={};for(const n of o)i[n]=s[n];return t.objectValues(i)},t.objectValues=s=>t.objectKeys(s).map(function(o){return s[o]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const o=[];for(const i in s)Object.prototype.hasOwnProperty.call(s,i)&&o.push(i);return o},t.find=(s,o)=>{for(const i of s)if(o(i))return i},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function r(s,o=" | "){return s.map(i=>typeof i=="string"?`'${i}'`:i).join(o)}t.joinValues=r,t.jsonStringifyReplacer=(s,o)=>typeof o=="bigint"?o.toString():o})(re||(re={}));var Oe;(function(t){t.mergeShapes=(e,a)=>({...e,...a})})(Oe||(Oe={}));re.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);re.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class ce extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const a=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,a):this.__proto__=a,this.name="ZodError",this.issues=e}format(e){const a=e||function(o){return o.message},r={_errors:[]},s=o=>{for(const i of o.issues)if(i.code==="invalid_union")i.unionErrors.map(s);else if(i.code==="invalid_return_type")s(i.returnTypeError);else if(i.code==="invalid_arguments")s(i.argumentsError);else if(i.path.length===0)r._errors.push(a(i));else{let n=r,p=0;for(;p<i.path.length;){const u=i.path[p];p===i.path.length-1?(n[u]=n[u]||{_errors:[]},n[u]._errors.push(a(i))):n[u]=n[u]||{_errors:[]},n=n[u],p++}}};return s(this),r}static assert(e){if(!(e instanceof ce))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,re.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=a=>a.message){const a=Object.create(null),r=[];for(const s of this.issues)if(s.path.length>0){const o=s.path[0];a[o]=a[o]||[],a[o].push(e(s))}else r.push(e(s));return{formErrors:r,fieldErrors:a}}get formErrors(){return this.flatten()}}ce.create=t=>new ce(t);var Ae;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(Ae||(Ae={}));var h;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(h||(h={}));var Je="vercel.ai.error",Lt=Symbol.for(Je),Ce,Re,Z=class We extends(Re=Error,Ce=Lt,Re){constructor({name:e,message:a,cause:r}){super(a),this[Ce]=!0,this.name=e,this.cause=r}static isInstance(e){return We.hasMarker(e,Je)}static hasMarker(e,a){const r=Symbol.for(a);return e!=null&&typeof e=="object"&&r in e&&typeof e[r]=="boolean"&&e[r]===!0}};function Ge(t){return t==null?"unknown error":typeof t=="string"?t:t instanceof Error?t.message:JSON.stringify(t)}var Ye="AI_InvalidArgumentError",He=`vercel.ai.error.${Ye}`,jt=Symbol.for(He),Ne,xe,Zt=class extends(xe=Z,Ne=jt,xe){constructor({message:t,cause:e,argument:a}){super({name:Ye,message:t,cause:e}),this[Ne]=!0,this.argument=a}static isInstance(t){return Z.hasMarker(t,He)}},qe="AI_JSONParseError",Xe=`vercel.ai.error.${qe}`,$t=Symbol.for(Xe),Pe,De,ke=class extends(De=Z,Pe=$t,De){constructor({text:t,cause:e}){super({name:qe,message:`JSON parsing failed: Text: ${t}.
2
2
  Error message: ${Ge(e)}`,cause:e}),this[Pe]=!0,this.text=t}static isInstance(t){return Z.hasMarker(t,Xe)}},Qe="AI_TypeValidationError",Ke=`vercel.ai.error.${Qe}`,Ut=Symbol.for(Ke),Le,je,X=class ve extends(je=Z,Le=Ut,je){constructor({value:e,cause:a,context:r}){let s="Type validation failed";if(r?.field&&(s+=` for ${r.field}`),r?.entityName||r?.entityId){s+=" (";const o=[];r.entityName&&o.push(r.entityName),r.entityId&&o.push(`id: "${r.entityId}"`),s+=o.join(", "),s+=")"}super({name:Qe,message:`${s}: Value: ${JSON.stringify(e)}.
3
3
  Error message: ${Ge(a)}`,cause:a}),this[Le]=!0,this.value=e,this.context=r}static isInstance(e){return Z.hasMarker(e,Ke)}static wrap({value:e,cause:a,context:r}){var s,o,i;return ve.isInstance(a)&&a.value===e&&((s=a.context)==null?void 0:s.field)===r?.field&&((o=a.context)==null?void 0:o.entityName)===r?.entityName&&((i=a.context)==null?void 0:i.entityId)===r?.entityId?a:new ve({value:e,cause:a,context:r})}},ie=({prefix:t,size:e=16,alphabet:a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:r="-"}={})=>{const s=()=>{const o=a.length,i=new Array(e);for(let n=0;n<e;n++)i[n]=a[Math.random()*o|0];return i.join("")};if(t==null)return s;if(a.includes(r))throw new Zt({argument:"separator",message:`The separator "${r}" must not be part of the alphabet "${a}".`});return()=>`${t}${r}${s()}`};ie();var Ft=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,Bt=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function Ze(t){const e=JSON.parse(t);return e===null||typeof e!="object"||Ft.test(t)===!1&&Bt.test(t)===!1?e:Vt(e)}function Vt(t){let e=[t];for(;e.length;){const a=e;e=[];for(const r of a){if(Object.prototype.hasOwnProperty.call(r,"__proto__"))throw new SyntaxError("Object contains forbidden prototype property");if(Object.prototype.hasOwnProperty.call(r,"constructor")&&r.constructor!==null&&typeof r.constructor=="object"&&Object.prototype.hasOwnProperty.call(r.constructor,"prototype"))throw new SyntaxError("Object contains forbidden prototype property");for(const s in r){const o=r[s];o&&typeof o=="object"&&e.push(o)}}}return t}function zt(t){const{stackTraceLimit:e}=Error;try{Error.stackTraceLimit=0}catch{return Ze(t)}try{return Ze(t)}finally{Error.stackTraceLimit=e}}function Te(t){if(t.type==="object"||Array.isArray(t.type)&&t.type.includes("object")){t.additionalProperties=!1;const{properties:a}=t;if(a!=null)for(const r of Object.keys(a))a[r]=z(a[r])}t.items!=null&&(t.items=Array.isArray(t.items)?t.items.map(z):z(t.items)),t.anyOf!=null&&(t.anyOf=t.anyOf.map(z)),t.allOf!=null&&(t.allOf=t.allOf.map(z)),t.oneOf!=null&&(t.oneOf=t.oneOf.map(z));const{definitions:e}=t;if(e!=null)for(const a of Object.keys(e))e[a]=z(e[a]);return t}function z(t){return typeof t=="boolean"?t:Te(t)}var Jt=Symbol("Let zodToJsonSchema decide on which parser to use"),$e={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"},Wt=t=>typeof t=="string"?{...$e,name:t}:{...$e,...t};function N(){return{}}function Gt(t,e){var a,r,s;const o={type:"array"};return(a=t.type)!=null&&a._def&&((s=(r=t.type)==null?void 0:r._def)==null?void 0:s.typeName)!==h.ZodAny&&(o.items=b(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&(o.minItems=t.minLength.value),t.maxLength&&(o.maxItems=t.maxLength.value),t.exactLength&&(o.minItems=t.exactLength.value,o.maxItems=t.exactLength.value),o}function Yt(t){const e={type:"integer",format:"int64"};if(!t.checks)return e;for(const a of t.checks)switch(a.kind){case"min":a.inclusive?e.minimum=a.value:e.exclusiveMinimum=a.value;break;case"max":a.inclusive?e.maximum=a.value:e.exclusiveMaximum=a.value;break;case"multipleOf":e.multipleOf=a.value;break}return e}function Ht(){return{type:"boolean"}}function et(t,e){return b(t.type._def,e)}var qt=(t,e)=>b(t.innerType._def,e);function tt(t,e,a){const r=a??e.dateStrategy;if(Array.isArray(r))return{anyOf:r.map((s,o)=>tt(t,e,s))};switch(r){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return Xt(t)}}var Xt=t=>{const e={type:"integer",format:"unix-time"};for(const a of t.checks)switch(a.kind){case"min":e.minimum=a.value;break;case"max":e.maximum=a.value;break}return e};function Qt(t,e){return{...b(t.innerType._def,e),default:t.defaultValue()}}function Kt(t,e){return e.effectStrategy==="input"?b(t.schema._def,e):N()}function ea(t){return{type:"string",enum:Array.from(t.values)}}var ta=t=>"type"in t&&t.type==="string"?!1:"allOf"in t;function aa(t,e){const a=[b(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),b(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(s=>!!s),r=[];return a.forEach(s=>{if(ta(s))r.push(...s.allOf);else{let o=s;if("additionalProperties"in s&&s.additionalProperties===!1){const{additionalProperties:i,...n}=s;o=n}r.push(o)}}),r.length?{allOf:r}:void 0}function ra(t){const e=typeof t.value;return e!=="bigint"&&e!=="number"&&e!=="boolean"&&e!=="string"?{type:Array.isArray(t.value)?"array":"object"}:{type:e==="bigint"?"integer":e,const:t.value}}var me=void 0,P={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(me===void 0&&(me=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),me),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function at(t,e){const a={type:"string"};if(t.checks)for(const r of t.checks)switch(r.kind){case"min":a.minLength=typeof a.minLength=="number"?Math.max(a.minLength,r.value):r.value;break;case"max":a.maxLength=typeof a.maxLength=="number"?Math.min(a.maxLength,r.value):r.value;break;case"email":switch(e.emailStrategy){case"format:email":D(a,"email",r.message,e);break;case"format:idn-email":D(a,"idn-email",r.message,e);break;case"pattern:zod":O(a,P.email,r.message,e);break}break;case"url":D(a,"uri",r.message,e);break;case"uuid":D(a,"uuid",r.message,e);break;case"regex":O(a,r.regex,r.message,e);break;case"cuid":O(a,P.cuid,r.message,e);break;case"cuid2":O(a,P.cuid2,r.message,e);break;case"startsWith":O(a,RegExp(`^${he(r.value,e)}`),r.message,e);break;case"endsWith":O(a,RegExp(`${he(r.value,e)}$`),r.message,e);break;case"datetime":D(a,"date-time",r.message,e);break;case"date":D(a,"date",r.message,e);break;case"time":D(a,"time",r.message,e);break;case"duration":D(a,"duration",r.message,e);break;case"length":a.minLength=typeof a.minLength=="number"?Math.max(a.minLength,r.value):r.value,a.maxLength=typeof a.maxLength=="number"?Math.min(a.maxLength,r.value):r.value;break;case"includes":{O(a,RegExp(he(r.value,e)),r.message,e);break}case"ip":{r.version!=="v6"&&D(a,"ipv4",r.message,e),r.version!=="v4"&&D(a,"ipv6",r.message,e);break}case"base64url":O(a,P.base64url,r.message,e);break;case"jwt":O(a,P.jwt,r.message,e);break;case"cidr":{r.version!=="v6"&&O(a,P.ipv4Cidr,r.message,e),r.version!=="v4"&&O(a,P.ipv6Cidr,r.message,e);break}case"emoji":O(a,P.emoji(),r.message,e);break;case"ulid":{O(a,P.ulid,r.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{D(a,"binary",r.message,e);break}case"contentEncoding:base64":{a.contentEncoding="base64";break}case"pattern:zod":{O(a,P.base64,r.message,e);break}}break}case"nanoid":O(a,P.nanoid,r.message,e)}return a}function he(t,e){return e.patternStrategy==="escape"?na(t):t}var sa=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function na(t){let e="";for(let a=0;a<t.length;a++)sa.has(t[a])||(e+="\\"),e+=t[a];return e}function D(t,e,a,r){var s;t.format||(s=t.anyOf)!=null&&s.some(o=>o.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push({format:t.format}),delete t.format),t.anyOf.push({format:e,...a&&r.errorMessages&&{errorMessage:{format:a}}})):t.format=e}function O(t,e,a,r){var s;t.pattern||(s=t.allOf)!=null&&s.some(o=>o.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern}),delete t.pattern),t.allOf.push({pattern:Ue(e,r),...a&&r.errorMessages&&{errorMessage:{pattern:a}}})):t.pattern=Ue(e,r)}function Ue(t,e){var a;if(!e.applyRegexFlags||!t.flags)return t.source;const r={i:t.flags.includes("i"),m:t.flags.includes("m"),s:t.flags.includes("s")},s=r.i?t.source.toLowerCase():t.source;let o="",i=!1,n=!1,p=!1;for(let u=0;u<s.length;u++){if(i){o+=s[u],i=!1;continue}if(r.i){if(n){if(s[u].match(/[a-z]/)){p?(o+=s[u],o+=`${s[u-2]}-${s[u]}`.toUpperCase(),p=!1):s[u+1]==="-"&&((a=s[u+2])!=null&&a.match(/[a-z]/))?(o+=s[u],p=!0):o+=`${s[u]}${s[u].toUpperCase()}`;continue}}else if(s[u].match(/[a-z]/)){o+=`[${s[u]}${s[u].toUpperCase()}]`;continue}}if(r.m){if(s[u]==="^"){o+=`(^|(?<=[\r
4
4
  ]))`;continue}else if(s[u]==="$"){o+=`($|(?=[\r
@@ -1 +1 @@
1
- import{c as f,m as d,r as p,j as r}from"./index-CpB-IlaU.js";import{r as w}from"./sidebar-LfWRhUzl.js";const v=p.createContext(void 0),H=v.Provider;function N(c,e){const l=p.Children.toArray(c);for(const i of l)if(p.isValidElement(i)&&i.type===e)return i;return null}function P(c){const e=f.c(5),{children:l,className:i}=c;let s;e[0]!==i?(s=d("flex flex-col h-full w-full bg-background overflow-hidden",i),e[0]=i,e[1]=s):s=e[1];let t;return e[2]!==l||e[3]!==s?(t=r.jsx("div",{className:s,children:l}),e[2]=l,e[3]=s,e[4]=t):t=e[4],t}function C(c){const e=f.c(17),{children:l,className:i,hideSidebarTrigger:s}=c;let t;e[0]!==l?(t=N(l,j),e[0]=l,e[1]=t):t=e[1];const n=t;let a;e[2]!==l?(a=N(l,b),e[2]=l,e[3]=a):a=e[3];const o=a;let m;e[4]!==i?(m=d("shrink-0 w-full border-b border-border/50 h-11","flex items-center justify-between gap-3 pr-2 pl-2 md:pl-4",i),e[4]=i,e[5]=m):m=e[5];let x;e[6]!==s?(x=!s&&r.jsx(w,{className:"md:hidden shrink-0"}),e[6]=s,e[7]=x):x=e[7];let u;e[8]!==n||e[9]!==x?(u=r.jsxs("div",{className:"flex items-center gap-1 min-w-0 flex-1",children:[x,n]}),e[8]=n,e[9]=x,e[10]=u):u=e[10];let h;e[11]!==o?(h=r.jsx("div",{className:"flex items-center",children:o}),e[11]=o,e[12]=h):h=e[12];let g;return e[13]!==m||e[14]!==u||e[15]!==h?(g=r.jsxs("div",{className:m,children:[u,h]}),e[13]=m,e[14]=u,e[15]=h,e[16]=g):g=e[16],g}function j(c){const e=f.c(5),{children:l,className:i}=c;let s;e[0]!==i?(s=d("flex items-center gap-2 min-w-0 overflow-hidden",i),e[0]=i,e[1]=s):s=e[1];let t;return e[2]!==l||e[3]!==s?(t=r.jsx("div",{className:s,children:l}),e[2]=l,e[3]=s,e[4]=t):t=e[4],t}function b(c){const e=f.c(5),{children:l,className:i}=c;let s;e[0]!==i?(s=d("flex items-center gap-2 shrink-0 overflow-hidden",i),e[0]=i,e[1]=s):s=e[1];let t;return e[2]!==l||e[3]!==s?(t=r.jsx("div",{className:s,children:l}),e[2]=l,e[3]=s,e[4]=t):t=e[4],t}function $(c){const e=f.c(6),{children:l,className:i}=c,s=p.useContext(v);let t;e[0]!==i||e[1]!==s?(t=d("flex-1 overflow-auto",s,i),e[0]=i,e[1]=s,e[2]=t):t=e[2];let n;return e[3]!==l||e[4]!==t?(n=r.jsx("div",{className:t,children:l}),e[3]=l,e[4]=t,e[5]=n):n=e[5],n}function y(c){const e=f.c(10),{children:l,actions:i,className:s}=c;let t;e[0]!==s?(t=d("flex flex-wrap items-center justify-between gap-3",s),e[0]=s,e[1]=t):t=e[1];let n;e[2]!==l?(n=r.jsx("div",{className:"text-xl font-medium min-w-0",children:l}),e[2]=l,e[3]=n):n=e[3];let a;e[4]!==i?(a=i&&r.jsx("div",{className:"flex items-center gap-2",children:i}),e[4]=i,e[5]=a):a=e[5];let o;return e[6]!==t||e[7]!==n||e[8]!==a?(o=r.jsxs("div",{className:t,children:[n,a]}),e[6]=t,e[7]=n,e[8]=a,e[9]=o):o=e[9],o}function R(c){const e=f.c(6),{children:l,className:i,maxWidth:s}=c,t=s===void 0?"max-w-[1200px]":s;let n;e[0]!==i||e[1]!==t?(n=d("mx-auto w-full px-4 pt-8 pb-6 md:px-10 md:pt-12 md:pb-10",t,i),e[0]=i,e[1]=t,e[2]=n):n=e[2];let a;return e[3]!==l||e[4]!==n?(a=r.jsx("div",{className:n,children:l}),e[3]=l,e[4]=n,e[5]=a):a=e[5],a}const T=Object.assign(P,{Header:Object.assign(C,{Left:j,Right:b}),Content:$,Title:y,Body:R});export{T as P,H as a};
1
+ import{c as f,m as d,r as p,j as r}from"./index-CjF26QCG.js";import{r as w}from"./sidebar-C8SHXIOH.js";const v=p.createContext(void 0),H=v.Provider;function N(c,e){const l=p.Children.toArray(c);for(const i of l)if(p.isValidElement(i)&&i.type===e)return i;return null}function P(c){const e=f.c(5),{children:l,className:i}=c;let s;e[0]!==i?(s=d("flex flex-col h-full w-full bg-background overflow-hidden",i),e[0]=i,e[1]=s):s=e[1];let t;return e[2]!==l||e[3]!==s?(t=r.jsx("div",{className:s,children:l}),e[2]=l,e[3]=s,e[4]=t):t=e[4],t}function C(c){const e=f.c(17),{children:l,className:i,hideSidebarTrigger:s}=c;let t;e[0]!==l?(t=N(l,j),e[0]=l,e[1]=t):t=e[1];const n=t;let a;e[2]!==l?(a=N(l,b),e[2]=l,e[3]=a):a=e[3];const o=a;let m;e[4]!==i?(m=d("shrink-0 w-full border-b border-border/50 h-11","flex items-center justify-between gap-3 pr-2 pl-2 md:pl-4",i),e[4]=i,e[5]=m):m=e[5];let x;e[6]!==s?(x=!s&&r.jsx(w,{className:"md:hidden shrink-0"}),e[6]=s,e[7]=x):x=e[7];let u;e[8]!==n||e[9]!==x?(u=r.jsxs("div",{className:"flex items-center gap-1 min-w-0 flex-1",children:[x,n]}),e[8]=n,e[9]=x,e[10]=u):u=e[10];let h;e[11]!==o?(h=r.jsx("div",{className:"flex items-center",children:o}),e[11]=o,e[12]=h):h=e[12];let g;return e[13]!==m||e[14]!==u||e[15]!==h?(g=r.jsxs("div",{className:m,children:[u,h]}),e[13]=m,e[14]=u,e[15]=h,e[16]=g):g=e[16],g}function j(c){const e=f.c(5),{children:l,className:i}=c;let s;e[0]!==i?(s=d("flex items-center gap-2 min-w-0 overflow-hidden",i),e[0]=i,e[1]=s):s=e[1];let t;return e[2]!==l||e[3]!==s?(t=r.jsx("div",{className:s,children:l}),e[2]=l,e[3]=s,e[4]=t):t=e[4],t}function b(c){const e=f.c(5),{children:l,className:i}=c;let s;e[0]!==i?(s=d("flex items-center gap-2 shrink-0 overflow-hidden",i),e[0]=i,e[1]=s):s=e[1];let t;return e[2]!==l||e[3]!==s?(t=r.jsx("div",{className:s,children:l}),e[2]=l,e[3]=s,e[4]=t):t=e[4],t}function $(c){const e=f.c(6),{children:l,className:i}=c,s=p.useContext(v);let t;e[0]!==i||e[1]!==s?(t=d("flex-1 overflow-auto",s,i),e[0]=i,e[1]=s,e[2]=t):t=e[2];let n;return e[3]!==l||e[4]!==t?(n=r.jsx("div",{className:t,children:l}),e[3]=l,e[4]=t,e[5]=n):n=e[5],n}function y(c){const e=f.c(10),{children:l,actions:i,className:s}=c;let t;e[0]!==s?(t=d("flex flex-wrap items-center justify-between gap-3",s),e[0]=s,e[1]=t):t=e[1];let n;e[2]!==l?(n=r.jsx("div",{className:"text-xl font-medium min-w-0",children:l}),e[2]=l,e[3]=n):n=e[3];let a;e[4]!==i?(a=i&&r.jsx("div",{className:"flex items-center gap-2",children:i}),e[4]=i,e[5]=a):a=e[5];let o;return e[6]!==t||e[7]!==n||e[8]!==a?(o=r.jsxs("div",{className:t,children:[n,a]}),e[6]=t,e[7]=n,e[8]=a,e[9]=o):o=e[9],o}function R(c){const e=f.c(6),{children:l,className:i,maxWidth:s}=c,t=s===void 0?"max-w-[1200px]":s;let n;e[0]!==i||e[1]!==t?(n=d("mx-auto w-full px-4 pt-8 pb-6 md:px-10 md:pt-12 md:pb-10",t,i),e[0]=i,e[1]=t,e[2]=n):n=e[2];let a;return e[3]!==l||e[4]!==n?(a=r.jsx("div",{className:n,children:l}),e[3]=l,e[4]=n,e[5]=a):a=e[5],a}const T=Object.assign(P,{Header:Object.assign(C,{Left:j,Right:b}),Content:$,Title:y,Body:R});export{T as P,H as a};