decocms 4.513.1 → 4.513.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (400) hide show
  1. package/dist/client/assets/{ActiveShapeUtils-DLigh1zJ.js → ActiveShapeUtils-CV2gQvF0.js} +1 -1
  2. package/dist/client/assets/{AlertCircle-BGsPYuR3.js → AlertCircle-Czw3GOXM.js} +1 -1
  3. package/dist/client/assets/{AreaChart-CzXIOspF.js → AreaChart-BhM70eeA.js} +1 -1
  4. package/dist/client/assets/{ArrowLeft-BY0o9p-g.js → ArrowLeft-CBNZ6Kc8.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-BIUPa0Dd.js → ArrowUp-D1TV4x6T.js} +1 -1
  6. package/dist/client/assets/{BarChart-C93WKtUQ.js → BarChart-BV8WJLUg.js} +1 -1
  7. package/dist/client/assets/{Building02-DRJukUHS.js → Building02-BufOoi54.js} +1 -1
  8. package/dist/client/assets/{CartesianChart-Dm7PETVH.js → CartesianChart-ButQNI6T.js} +1 -1
  9. package/dist/client/assets/{CategoricalChart-71YzazvL.js → CategoricalChart-CU6wjw2Q.js} +1 -1
  10. package/dist/client/assets/{CheckCircle-BMzfjrcN.js → CheckCircle-C6kHCEBQ.js} +1 -1
  11. package/dist/client/assets/{ChevronSelectorVertical-OsgtEFsS.js → ChevronSelectorVertical-CREWgR2i.js} +1 -1
  12. package/dist/client/assets/{ChevronUp-gQvBs5Wr.js → ChevronUp-DZ6u-CDn.js} +1 -1
  13. package/dist/client/assets/{Copy01-B6uJ5A3t.js → Copy01-Br8MuAU9.js} +1 -1
  14. package/dist/client/assets/{CreditCard01-CVvsJVHy.js → CreditCard01-BLe5-9IQ.js} +1 -1
  15. package/dist/client/assets/{DotsVertical-CRoDrMwf.js → DotsVertical-DgdCLmlp.js} +1 -1
  16. package/dist/client/assets/{ErrorBarContext-B-ZKQrQu.js → ErrorBarContext-D8FHRXZQ.js} +1 -1
  17. package/dist/client/assets/{Globe04-mgILh7rR.js → Globe04-BkNwdwoM.js} +1 -1
  18. package/dist/client/assets/{Image01-D3cjfdzm.js → Image01-DxuLkpjX.js} +1 -1
  19. package/dist/client/assets/{Key01-DBuAbIfl.js → Key01-Qdm6kw39.js} +1 -1
  20. package/dist/client/assets/{Link01-BkraNRbc.js → Link01-B4M7ojFg.js} +1 -1
  21. package/dist/client/assets/{LinkBroken01-COSlZBTJ.js → LinkBroken01-CJN7aOrV.js} +1 -1
  22. package/dist/client/assets/{Monitor01-CSJlATNa.js → Monitor01-CHS3e170.js} +1 -1
  23. package/dist/client/assets/{Play-CS7ZIu7O.js → Play-Da27xlG_.js} +1 -1
  24. package/dist/client/assets/{Plus-Dam4fGJv.js → Plus-D0ucptrV.js} +1 -1
  25. package/dist/client/assets/{ReferenceLine-D2WOwhtk.js → ReferenceLine-CoS52beo.js} +1 -1
  26. package/dist/client/assets/{SearchMd-BmY7B7q3.js → SearchMd-0qnilUuy.js} +1 -1
  27. package/dist/client/assets/{Sector-BZsKaQxF.js → Sector-CKh2L0yG.js} +1 -1
  28. package/dist/client/assets/{ShoppingBag01-Di2JjyaO.js → ShoppingBag01-DV74WoBV.js} +1 -1
  29. package/dist/client/assets/{Sun-CBRr2mzj.js → Sun-D0O3J2yf.js} +1 -1
  30. package/dist/client/assets/{SwitchHorizontal01-CVhIGWzI.js → SwitchHorizontal01-Ba0pyLay.js} +1 -1
  31. package/dist/client/assets/{Tool01-C0tA6_WY.js → Tool01-C0454p2c.js} +1 -1
  32. package/dist/client/assets/{Trash01-BWvgZ-My.js → Trash01-CyxedK0n.js} +1 -1
  33. package/dist/client/assets/{Upload01-Ayc3pkY7.js → Upload01-BWpYXx52.js} +1 -1
  34. package/dist/client/assets/{User01-Cv65FqsE.js → User01-Bb04dh7g.js} +1 -1
  35. package/dist/client/assets/{UserSquare-jVbr-XG_.js → UserSquare-B_weldPC.js} +1 -1
  36. package/dist/client/assets/{Users01-C8djc4kj.js → Users01-CNd-hMC8.js} +1 -1
  37. package/dist/client/assets/{XClose-J1FWOmKL.js → XClose-BeqwQ2Ei.js} +1 -1
  38. package/dist/client/assets/{ZoomOut-DOsQL5PZ.js → ZoomOut-DWT1qHXA.js} +1 -1
  39. package/dist/client/assets/{access-gate-CSnpnsDz.js → access-gate-mycOF7cD.js} +1 -1
  40. package/dist/client/assets/{add-connection-dialog-9kRnWMWN.js → add-connection-dialog-BkWp2fK0.js} +1 -1
  41. package/dist/client/assets/{agent-analytics-BksVEHnl.js → agent-analytics-B5byH36W.js} +1 -1
  42. package/dist/client/assets/agent-app-C8Q8eJy6.js +1 -0
  43. package/dist/client/assets/{agent-assets-tvE-HIyg.js → agent-assets-pGTlMleF.js} +1 -1
  44. package/dist/client/assets/{agent-automation-V4FV4x5y.js → agent-automation-D5u89G2_.js} +1 -1
  45. package/dist/client/assets/{agent-automations-Cc2YYUR6.js → agent-automations-C4_XXiyv.js} +1 -1
  46. package/dist/client/assets/{agent-connect-sources-tJKzdDG2.js → agent-connect-sources-C5p-0QMu.js} +1 -1
  47. package/dist/client/assets/agent-deck-XMMtyHjd.js +1 -0
  48. package/dist/client/assets/{agent-e2e-DGsy6V0w.js → agent-e2e-Ce5bkH9z.js} +1 -1
  49. package/dist/client/assets/{agent-experiments-CEmVLVx7.js → agent-experiments-D4NapCfE.js} +1 -1
  50. package/dist/client/assets/agent-file-BNo94gQC.js +1 -0
  51. package/dist/client/assets/{agent-hosting-SI9CUAyr.js → agent-hosting-ftgEMkT0.js} +1 -1
  52. package/dist/client/assets/{agent-icon-BAsaPIPW.js → agent-icon-C0Cpk_fI.js} +1 -1
  53. package/dist/client/assets/agent-library-GkmC1ahU.js +1 -0
  54. package/dist/client/assets/agent-library-file-6MKr5gfE.js +1 -0
  55. package/dist/client/assets/{agent-monitor-BAD4Hlpg.js → agent-monitor-C-1u284m.js} +1 -1
  56. package/dist/client/assets/agent-overview-B5DYE-Ji.js +1 -0
  57. package/dist/client/assets/{agent-releases-BROUPRoA.js → agent-releases-aHzQJT8R.js} +1 -1
  58. package/dist/client/assets/agent-settings-5nByAqOM.js +1 -0
  59. package/dist/client/assets/{agent-site-editor-Bc4JzAtX.js → agent-site-editor-CPMVDSTZ.js} +1 -1
  60. package/dist/client/assets/agent-site-editor-code-0fxD14rb.js +2 -0
  61. package/dist/client/assets/agent-site-editor-content-BN4VoKnm.js +1 -0
  62. package/dist/client/assets/agent-site-editor-preview-BXzeSsT8.js +1 -0
  63. package/dist/client/assets/{agent-view-guard-COE0o9OW.js → agent-view-guard-DNE4CXyR.js} +1 -1
  64. package/dist/client/assets/agent-view-hlAx7Qgd.js +1 -0
  65. package/dist/client/assets/{agents-list-DsnUnijY.js → agents-list-BeohBYvm.js} +1 -1
  66. package/dist/client/assets/{ai-providers-_9Q72ibF.js → ai-providers-BYfFnvED.js} +1 -1
  67. package/dist/client/assets/{alert-dialog-BXsSwOCK.js → alert-dialog-DBOmU5EL.js} +1 -1
  68. package/dist/client/assets/{alert-DVLk8Iin.js → alert-fFwi0Rct.js} +1 -1
  69. package/dist/client/assets/{analytics-sections-CVdZcg3H.js → analytics-sections-BSFzvx60.js} +1 -1
  70. package/dist/client/assets/{api-keys-C5_mr7Dx.js → api-keys-CjBRjWKE.js} +1 -1
  71. package/dist/client/assets/api-keys-Dvm1thDW.js +1 -0
  72. package/dist/client/assets/{app-editor-CAZxpcHR.js → app-editor-9oqlCdGz.js} +1 -1
  73. package/dist/client/assets/{asset-utils-BYeUUuYD.js → asset-utils-DRLxCAgr.js} +1 -1
  74. package/dist/client/assets/{auth-BGlQUcUq.js → auth-BPJq9uZN.js} +1 -1
  75. package/dist/client/assets/{auth-catchall-B57MQTC7.js → auth-catchall-D2arJj-l.js} +1 -1
  76. package/dist/client/assets/{auth-entry-DEDwSnje.js → auth-entry-BUYS1aRG.js} +1 -1
  77. package/dist/client/assets/{auth-split-layout-Bywa1Rdj.js → auth-split-layout-B60d6um2.js} +1 -1
  78. package/dist/client/assets/{authenticate-and-persist-oauth-DawdQrNH.js → authenticate-and-persist-oauth-CEKJsXYr.js} +1 -1
  79. package/dist/client/assets/{automation-list-row-DxgABVkv.js → automation-list-row-BKl9kQg2.js} +1 -1
  80. package/dist/client/assets/{automation-runs-CiiZvO3g.js → automation-runs-Bc4ZG8Cd.js} +1 -1
  81. package/dist/client/assets/{automations-BYa97um_.js → automations-Byx2iIlC.js} +1 -1
  82. package/dist/client/assets/{autosend-C7UE5qBo.js → autosend-BRrz2Y4f.js} +1 -1
  83. package/dist/client/assets/{avatar-D92LQoMs.js → avatar--bVWjvdf.js} +1 -1
  84. package/dist/client/assets/{badge-Qo4xyqqo.js → badge-O9zNBxIS.js} +1 -1
  85. package/dist/client/assets/{block-document-skQMirff.js → block-document-EMb4OAJD.js} +1 -1
  86. package/dist/client/assets/{blocks-preview-workspace-context-C5n4-2zD.js → blocks-preview-workspace-context-CswMFv9v.js} +1 -1
  87. package/dist/client/assets/{blocks-tab-states-ZrFyRJRO.js → blocks-tab-states-CXGOEMTq.js} +3 -3
  88. package/dist/client/assets/{blog-schema-BLRxEC9n.js → blog-schema-BBgfoIQP.js} +1 -1
  89. package/dist/client/assets/{board-analytics-CUpSvAlz.js → board-analytics-BnyzhqyI.js} +1 -1
  90. package/dist/client/assets/{buckets-BJtJwr6_.js → buckets-CScAlRwn.js} +1 -1
  91. package/dist/client/assets/{build-improve-prompt-doc-8Y6fyKcx.js → build-improve-prompt-doc-DZKU2eq8.js} +1 -1
  92. package/dist/client/assets/{calendar-O9AxJqnv.js → calendar-DsjGYQg2.js} +1 -1
  93. package/dist/client/assets/{capability-load-error-CNqk0tFF.js → capability-load-error-D5sZmG67.js} +1 -1
  94. package/dist/client/assets/{category-editor-Be436pUw.js → category-editor-TdrhQc2d.js} +1 -1
  95. package/dist/client/assets/{chart-D6QCrw1j.js → chart-CdJbyFrF.js} +1 -1
  96. package/dist/client/assets/{chat-context-CHUVtsDo.js → chat-context-Dnn7Mdeu.js} +1 -1
  97. package/dist/client/assets/{chat-draft-DxqHQ-qR.js → chat-draft-QF0rnEVx.js} +1 -1
  98. package/dist/client/assets/{checkbox-D1J9YzHt.js → checkbox-_9cHZuVh.js} +1 -1
  99. package/dist/client/assets/{choose-editor-zF0EkKBL.js → choose-editor-DjeEuPt0.js} +1 -1
  100. package/dist/client/assets/{cli-auth-success-BIVUc0bz.js → cli-auth-success-s_E43D3X.js} +1 -1
  101. package/dist/client/assets/{client-icons-NYHaAc2_.js → client-icons-CnZ15Laz.js} +1 -1
  102. package/dist/client/assets/cms-settings-editor-DLURX7ZR.js +1 -0
  103. package/dist/client/assets/{collapsible-4U8s9Q7m.js → collapsible-CzHslCH_.js} +1 -1
  104. package/dist/client/assets/{collection-detail-DrU7rdOW.js → collection-detail-DRUItL6q.js} +1 -1
  105. package/dist/client/assets/{collection-display-button-BaRotray.js → collection-display-button-BLKqGGaY.js} +1 -1
  106. package/dist/client/assets/{collection-search-Da85q05W.js → collection-search-BiaY0GVT.js} +1 -1
  107. package/dist/client/assets/{collection-table-wrapper-Dnz2lweC.js → collection-table-wrapper-ymUDH0Iy.js} +1 -1
  108. package/dist/client/assets/{collection-tabs-Mlp_Rejx.js → collection-tabs-BLEBGgk-.js} +1 -1
  109. package/dist/client/assets/{column-rules-B6lY_qpw.js → column-rules-B7xl4xQZ.js} +1 -1
  110. package/dist/client/assets/{combobox-BCOMReLT.js → combobox-CdVSN4C-.js} +1 -1
  111. package/dist/client/assets/{coming-soon-page-CvYKECN2.js → coming-soon-page-DU1ARjbb.js} +1 -1
  112. package/dist/client/assets/{command-DEXvL0cT.js → command-BwFTVPCg.js} +1 -1
  113. package/dist/client/assets/{companion-mcps-section-B8jhQ1lU.js → companion-mcps-section-wyIo_eN7.js} +1 -1
  114. package/dist/client/assets/config-D3pVqIKI.js +1 -0
  115. package/dist/client/assets/{connect-CJaggTPx.js → connect-DBOmX-8C.js} +1 -1
  116. package/dist/client/assets/{connect-layout-cAlAMnNX.js → connect-layout-BI0GOmFg.js} +1 -1
  117. package/dist/client/assets/{connection-vIWlN3YD.js → connection-DdsAVMED.js} +1 -1
  118. package/dist/client/assets/{connection-card-BJdYhmjP.js → connection-card-DquRZmyq.js} +1 -1
  119. package/dist/client/assets/{connection-detail-BW1b2Mg7.js → connection-detail-C2_9jZRg.js} +1 -1
  120. package/dist/client/assets/{connection-form-helpers-CEC9pgiR.js → connection-form-helpers-CppaGv96.js} +1 -1
  121. package/dist/client/assets/{connections-DHSlk7eF.js → connections-CPYwbOBM.js} +1 -1
  122. package/dist/client/assets/{content-tab-D6dlC_eK.js → content-tab-BGK1XaKL.js} +3 -3
  123. package/dist/client/assets/{context-D9Kj70hJ.js → context-D2VrQMS2.js} +1 -1
  124. package/dist/client/assets/{context-menu-BdSGqs_f.js → context-menu-D1SjU6l-.js} +1 -1
  125. package/dist/client/assets/{context-shell-BcUuYMwr.js → context-shell-CKI9uW2C.js} +3 -3
  126. package/dist/client/assets/{core.esm-C_n7cKI9.js → core.esm-DnTbXhD8.js} +1 -1
  127. package/dist/client/assets/{create-organization-dialog-BCynjnXm.js → create-organization-dialog-BIJBsiHg.js} +1 -1
  128. package/dist/client/assets/{daily-pulse-jLaM72aD.js → daily-pulse-Drk3CnaM.js} +1 -1
  129. package/dist/client/assets/{discover-WzG-rd-A.js → discover-BDubv_ZJ.js} +1 -1
  130. package/dist/client/assets/{domain-settings-BctCKhK5.js → domain-settings-CCe7QH7l.js} +1 -1
  131. package/dist/client/assets/{drawer-PNF7GPi2.js → drawer-CTSig7Vj.js} +1 -1
  132. package/dist/client/assets/{editor-DOvs1ZAj.js → editor-B8TTVjFi.js} +1 -1
  133. package/dist/client/assets/{editor-classes-BJdm0od6.js → editor-classes-BUSqIt7e.js} +1 -1
  134. package/dist/client/assets/{empty-state-DRKp6xDi.js → empty-state-DIpCFPkI.js} +1 -1
  135. package/dist/client/assets/{empty-state-Czk_KZf6.js → empty-state-DweMe7pE.js} +1 -1
  136. package/dist/client/assets/{extract-connection-data-B-l9PdV0.js → extract-connection-data-C2M3P64h.js} +1 -1
  137. package/dist/client/assets/{feature-gate-Cfsfll5L.js → feature-gate-hxH8uzOp.js} +1 -1
  138. package/dist/client/assets/{feature-paywall-CpCMXj0j.js → feature-paywall-5JkjVbP-.js} +1 -1
  139. package/dist/client/assets/{file-explorer-B_BhjGuw.js → file-explorer-CsGruqCR.js} +1 -1
  140. package/dist/client/assets/{file-preview-BgeZG3Ut.js → file-preview-ySEcJuT1.js} +1 -1
  141. package/dist/client/assets/{file-share-button-CjByqgRv.js → file-share-button-BcJLFZEu.js} +1 -1
  142. package/dist/client/assets/{file-type-icon-DrKVTY_y.js → file-type-icon-CBmuqe9u.js} +1 -1
  143. package/dist/client/assets/flat-project-CcO2Ar9k.js +1 -0
  144. package/dist/client/assets/{folder-icon-BL3ikPej.js → folder-icon-BbG7eONI.js} +1 -1
  145. package/dist/client/assets/{form-BReygSsa.js → form-CGiGUgzW.js} +1 -1
  146. package/dist/client/assets/{general-ayENLq_6.js → general-40Wry3sr.js} +1 -1
  147. package/dist/client/assets/home-CuekDzCb.js +1 -0
  148. package/dist/client/assets/{hosted-publish-feedback-DJnIOpIA.js → hosted-publish-feedback-Dj41Gksp.js} +1 -1
  149. package/dist/client/assets/{icon-button-BMIQVqVD.js → icon-button-D0a6m1Sz.js} +1 -1
  150. package/dist/client/assets/{index-BPxS5t0S.js → index-BL53jR3y.js} +1 -1
  151. package/dist/client/assets/{index-Bf67UBtK.js → index-BgaKQ-Q-.js} +1 -1
  152. package/dist/client/assets/{index-Dg_sZbJ0.js → index-C1nhsm_w.js} +1 -1
  153. package/dist/client/assets/{index-DYoNho4Y.js → index-C5AhGK9V.js} +5 -5
  154. package/dist/client/assets/{index-CsPw2N1B.js → index-CEYZyBqV.js} +1 -1
  155. package/dist/client/assets/{index-59MGyrbA.js → index-CQodxdYF.js} +1 -1
  156. package/dist/client/assets/{index-DG1Kruym.js → index-Cn8WHbCR.js} +1 -1
  157. package/dist/client/assets/{index-DrCJgI2a.js → index-Ct79h6Jq.js} +1 -1
  158. package/dist/client/assets/{index--jYyuT9F.js → index-DMApSpFV.js} +1 -1
  159. package/dist/client/assets/{index-CPKH5oCf.js → index-DOjuGDiB.js} +1 -1
  160. package/dist/client/assets/{index-CB34n0pr.js → index-DZWoZhT5.js} +1 -1
  161. package/dist/client/assets/{index-DmRWIJlm.js → index-D_cOu6AK.js} +1 -1
  162. package/dist/client/assets/{index-IZZ1QWYx.js → index-FsB7lUoK.js} +1 -1
  163. package/dist/client/assets/{index-BqhDNSVy.js → index-YSmMnHTP.js} +1 -1
  164. package/dist/client/assets/{index-CNWJYHvX.js → index-eirpwNKj.js} +2 -2
  165. package/dist/client/assets/{index-B-_uoizr.js → index-fdN8eXM2.js} +1 -1
  166. package/dist/client/assets/index-pFm7t22i.css +1 -0
  167. package/dist/client/assets/{index-redirect-DZaEKj9N.js → index-redirect-Dk2uc0Gh.js} +1 -1
  168. package/dist/client/assets/{infiniteQueryObserver-BZJj1RTX.js → infiniteQueryObserver-47K3Cxqe.js} +1 -1
  169. package/dist/client/assets/{infra-billing-BGzk-gx3.js → infra-billing-CE_ELMRw.js} +1 -1
  170. package/dist/client/assets/{input-DQjMvdWZ.js → input-BH9IvcPC.js} +1 -1
  171. package/dist/client/assets/{input-C14RAevO.js → input-DdEOORL2.js} +3 -3
  172. package/dist/client/assets/{integration-icon-A_JAytZI.js → integration-icon-CKknGZhR.js} +1 -1
  173. package/dist/client/assets/{jira-icon-BaW-JhER.js → jira-icon-DreVKI44.js} +1 -1
  174. package/dist/client/assets/{label-DKrrhY82.js → label-BL4W2KPI.js} +1 -1
  175. package/dist/client/assets/{layout-D0vGvTyD.js → layout-B6GTwWgR.js} +1 -1
  176. package/dist/client/assets/{legacy-agents-deep-DHz8EBj2.js → legacy-agents-deep-h-k8kxkI.js} +1 -1
  177. package/dist/client/assets/{legacy-main-redirect-CXWM5YMx.js → legacy-main-redirect-D6Wq6vr4.js} +1 -1
  178. package/dist/client/assets/library-0gJacikj.js +1 -0
  179. package/dist/client/assets/{library-tab-DkG0GP2E.js → library-tab-6tliBei-.js} +1 -1
  180. package/dist/client/assets/{login-7DjR_ib1.js → login-2dWlgBxu.js} +1 -1
  181. package/dist/client/assets/{markdown-Dkv8vF7I.js → markdown-BjPIZk-u.js} +1 -1
  182. package/dist/client/assets/{mcp-app-renderer-BTmNB3HB.js → mcp-app-renderer-afmtzlAD.js} +1 -1
  183. package/dist/client/assets/{mcp-oauth-B26YcM5J.js → mcp-oauth-DJh33UXx.js} +1 -1
  184. package/dist/client/assets/{mcp-oauth-D8hJrLwY.js → mcp-oauth-DqMHjHip.js} +1 -1
  185. package/dist/client/assets/{members-E4TpKIKd.js → members-De3ITOSK.js} +1 -1
  186. package/dist/client/assets/{memory-oZaHxU5s.js → memory-Bd-agrjz.js} +1 -1
  187. package/dist/client/assets/{mini-report-page-BArv5mW4.js → mini-report-page-qugNBWyG.js} +1 -1
  188. package/dist/client/assets/{mock-board-Bwwa0M9R.js → mock-board-DsyG_BKd.js} +1 -1
  189. package/dist/client/assets/{monaco-editor-BqY_G1yM.js → monaco-editor-frZbpSC4.js} +1 -1
  190. package/dist/client/assets/monitoring-D5Nohicc.js +1 -0
  191. package/dist/client/assets/{monitoring-stats-row-DVnv34v6.js → monitoring-stats-row-CbmvtcQ8.js} +1 -1
  192. package/dist/client/assets/{multi-select-Cbl9yFmn.js → multi-select-mMhkiaxx.js} +1 -1
  193. package/dist/client/assets/{mustache-CKwi1qbg.js → mustache-BE_jNzrX.js} +1 -1
  194. package/dist/client/assets/{new-project-dialog-N-lmXyX9.js → new-project-dialog-BMxQGh6T.js} +1 -1
  195. package/dist/client/assets/{oauth-callback-CO5zT2gX.js → oauth-callback-NxseMyYt.js} +1 -1
  196. package/dist/client/assets/{oauth-callback-ai-provider-DUDQxWlr.js → oauth-callback-ai-provider-JHRZj7cm.js} +1 -1
  197. package/dist/client/assets/{onboarding-BTnElaEx.js → onboarding-BNSpsBHl.js} +1 -1
  198. package/dist/client/assets/{openai-conversation-n75eRcLs.js → openai-conversation-B9wySkKU.js} +1 -1
  199. package/dist/client/assets/{optimistic-project-sidebar-views-DQouTCdv.js → optimistic-project-sidebar-views-DqJuR4Ij.js} +1 -1
  200. package/dist/client/assets/{order-monitor-day-04mjD1ep.js → order-monitor-day-DTRXFSPm.js} +1 -1
  201. package/dist/client/assets/{organization-choice-Cp6NuWiL.js → organization-choice-D_pQMc9T.js} +1 -1
  202. package/dist/client/assets/{orgs-ClkY5PpT.js → orgs-CsIZaTyi.js} +1 -1
  203. package/dist/client/assets/{page-seo-form-CPFkTIUJ.js → page-seo-form-DAN_oC73.js} +1 -1
  204. package/dist/client/assets/{pair-B8IyaaR6.js → pair-BERDoCro.js} +1 -1
  205. package/dist/client/assets/plan-N5Xy4KXF.js +1 -0
  206. package/dist/client/assets/{plan-ladder-CsKZpYtk.js → plan-ladder-DL1JtpvS.js} +1 -1
  207. package/dist/client/assets/{popover-D5cvllcj.js → popover-oZJ3oDMA.js} +1 -1
  208. package/dist/client/assets/{post-calendar-BjbOMFj8.js → post-calendar-DfH5svUX.js} +1 -1
  209. package/dist/client/assets/{post-editor-Bkg0zAby.js → post-editor-hWgegmwE.js} +1 -1
  210. package/dist/client/assets/{preview-content-DOlR7Sto.js → preview-content-PTYjaSyC.js} +1 -1
  211. package/dist/client/assets/{preview-dialog-BFeDZCyo.js → preview-dialog-4ft9O22y.js} +1 -1
  212. package/dist/client/assets/{preview-panel-hig46M8n.js → preview-panel-DM51Fpvo.js} +1 -1
  213. package/dist/client/assets/{preview-tab-Db6Udxne.js → preview-tab-CNeiDQgU.js} +3 -3
  214. package/dist/client/assets/{product-picker-dialog-BoRMhmF_.js → product-picker-dialog-BDff_MLx.js} +1 -1
  215. package/dist/client/assets/{profile-DWc7hq2C.js → profile-_0v0w_uk.js} +1 -1
  216. package/dist/client/assets/{project-app-view-D2zjD9lX.js → project-app-view-D_QJpB96.js} +1 -1
  217. package/dist/client/assets/project-apps-BRjQ6ES3.js +1 -0
  218. package/dist/client/assets/{project-feed-rwZLZcmg.js → project-feed-CYGKnY4Q.js} +1 -1
  219. package/dist/client/assets/{project-icon-C5PSWWOk.js → project-icon-D_aSXDOt.js} +1 -1
  220. package/dist/client/assets/project-reports-s2VJkQN9.js +1 -0
  221. package/dist/client/assets/project-tasks-DqRp61Xr.js +1 -0
  222. package/dist/client/assets/{projects-yiMF0-RY.js → projects-BmIdJmG4.js} +1 -1
  223. package/dist/client/assets/{projects-empty-state-BbguoYWh.js → projects-empty-state-BdoV9-x8.js} +1 -1
  224. package/dist/client/assets/{prompts-DpUxXr6K.js → prompts-BSkHwl6y.js} +1 -1
  225. package/dist/client/assets/record-editor-BakkGf1Y.js +1 -0
  226. package/dist/client/assets/{redirect-editor-cabEvZG6.js → redirect-editor-CtFVIrY2.js} +1 -1
  227. package/dist/client/assets/{reports-B_iXvMFR.js → reports-CLhp1Pr5.js} +1 -1
  228. package/dist/client/assets/reports-DzmhhR-x.js +1 -0
  229. package/dist/client/assets/{reports-onboarding-D2u26MsR.js → reports-onboarding-C8PLHLPc.js} +1 -1
  230. package/dist/client/assets/{reports-tab-BaXzi2FM.js → reports-tab-DDrFZP3m.js} +2 -2
  231. package/dist/client/assets/repositories-6gZ6hUD8.js +1 -0
  232. package/dist/client/assets/{repositories-CLCQSYhg.js → repositories-DoNhvU-g.js} +1 -1
  233. package/dist/client/assets/{repository-binding-CGk3ZX0j.js → repository-binding-BNbbDYQQ.js} +1 -1
  234. package/dist/client/assets/{repository-import-picker-BTeoI4rZ.js → repository-import-picker-CMsE5EOk.js} +1 -1
  235. package/dist/client/assets/{repository-picker-CoWZ9iTd.js → repository-picker-DOtWfpYo.js} +1 -1
  236. package/dist/client/assets/{require-capability-D-ZlkNFz.js → require-capability-CBG6rA7o.js} +1 -1
  237. package/dist/client/assets/{required-auth-layout-BtRjrHP0.js → required-auth-layout-Dz1OowhH.js} +1 -1
  238. package/dist/client/assets/{reset-password-5BD1CHP9.js → reset-password-v_UkU5Xg.js} +1 -1
  239. package/dist/client/assets/{resizable-2vxsnemp.js → resizable-CWaYgp8D.js} +1 -1
  240. package/dist/client/assets/{resolve-tab-icon-BernL4Vf.js → resolve-tab-icon-B2EU-8BB.js} +1 -1
  241. package/dist/client/assets/{review-settings-QBVdfldx.js → review-settings-BZhzjgRq.js} +1 -1
  242. package/dist/client/assets/{roles-DOHABx88.js → roles-Y2HKVQnL.js} +1 -1
  243. package/dist/client/assets/{route-DFi5KwM0.js → route-7L_TW384.js} +1 -1
  244. package/dist/client/assets/{route-E8TOccvZ.js → route-DPCqrSJX.js} +1 -1
  245. package/dist/client/assets/route-DXMOqHVl.js +1 -0
  246. package/dist/client/assets/{sandbox-lifecycle-context-D_9evUyh.js → sandbox-lifecycle-context-Pb8-9nPA.js} +1 -1
  247. package/dist/client/assets/{schema-L6FFXvke.js → schema-C1o97tHt.js} +1 -1
  248. package/dist/client/assets/{schema-BEutq4eJ.js → schema-CviV2OeO.js} +1 -1
  249. package/dist/client/assets/{scroll-area-D7vhzfPi.js → scroll-area-D2V3l6oK.js} +1 -1
  250. package/dist/client/assets/{search-input-Dujh_El7.js → search-input-Bq9urCGV.js} +1 -1
  251. package/dist/client/assets/{search-toggle-DnvRupWM.js → search-toggle-DwZ6dTB5.js} +1 -1
  252. package/dist/client/assets/{secret-ciphertext-CQx2VEMI.js → secret-ciphertext-BkXDtxC6.js} +1 -1
  253. package/dist/client/assets/{secret-picker-CPXxDZGW.js → secret-picker-BoK4uSMi.js} +1 -1
  254. package/dist/client/assets/{secrets-DGJVx-Hd.js → secrets-C0qlLAI4.js} +1 -1
  255. package/dist/client/assets/{sections-CJqhzmZf.js → sections-CR_pzMlx.js} +1 -1
  256. package/dist/client/assets/{sections-editor-BtYUAQwb.js → sections-editor-BK3_J9sX.js} +1 -1
  257. package/dist/client/assets/{select-DZhmnwp_.js → select-C5-hj9Ts.js} +1 -1
  258. package/dist/client/assets/{select-model-CMMJURkr.js → select-model-CwXefPFG.js} +1 -1
  259. package/dist/client/assets/{seo-editor-B_llRc49.js → seo-editor-CSy5-rpo.js} +1 -1
  260. package/dist/client/assets/{separator-D1JWkxza.js → separator-BD6ld_rn.js} +1 -1
  261. package/dist/client/assets/settings-tab-DHN7ZjAa.js +1 -0
  262. package/dist/client/assets/{sheet-EBRPi3dD.js → sheet-s29eirRf.js} +1 -1
  263. package/dist/client/assets/{shell-layout-Cng6sPGR.js → shell-layout-DS0Ye6S1.js} +1 -1
  264. package/dist/client/assets/site-editor-BfEYXklV.js +1 -0
  265. package/dist/client/assets/{site-editor-toast-CB9KCYI4.js → site-editor-toast-C5e-1uEv.js} +1 -1
  266. package/dist/client/assets/{skills-t2RbhpKV.js → skills-pQpcosHp.js} +1 -1
  267. package/dist/client/assets/{slider-B1Au3IHI.js → slider-P84DbLvc.js} +1 -1
  268. package/dist/client/assets/{sortable.esm-BMPY9Sd5.js → sortable.esm-DMQ-WncJ.js} +1 -1
  269. package/dist/client/assets/{sso-BCCAXBz3.js → sso-BaZj_16B.js} +1 -1
  270. package/dist/client/assets/{suggestion-BWGM-l4J.js → suggestion-BtCYsnHk.js} +1 -1
  271. package/dist/client/assets/{switch-zkrdrMZj.js → switch-COyvKYHV.js} +1 -1
  272. package/dist/client/assets/{symbol-Dy_rO5Hd.js → symbol-DE4EJv1h.js} +1 -1
  273. package/dist/client/assets/{synced-repos-Ci3QmgG7.js → synced-repos-BchTuYeZ.js} +1 -1
  274. package/dist/client/assets/{tab-icon-glyph-RNaGE4GF.js → tab-icon-glyph-Bd77emAf.js} +1 -1
  275. package/dist/client/assets/{table-WldSmBJB.js → table-E7GbRtTD.js} +1 -1
  276. package/dist/client/assets/{tabs-D6AJgzOF.js → tabs-DWtBgLg_.js} +1 -1
  277. package/dist/client/assets/{task-assignee-avatar-DSa4iRni.js → task-assignee-avatar-DTLURih6.js} +1 -1
  278. package/dist/client/assets/{task-board-Dg8D4L_r.js → task-board-fU-Cl8m2.js} +1 -1
  279. package/dist/client/assets/{task-route-C97BcCaG.js → task-route-DuNmXwWp.js} +1 -1
  280. package/dist/client/assets/{task-status-BYiz6w3h.js → task-status-wpuxJDO5.js} +1 -1
  281. package/dist/client/assets/taskboard-analytics-jASQU8UF.js +1 -0
  282. package/dist/client/assets/{tasks-BugNujmt.js → tasks-B4X2VVxT.js} +1 -1
  283. package/dist/client/assets/tasks-DLjtcYlA.js +1 -0
  284. package/dist/client/assets/{textarea-ynJNuYy7.js → textarea-BDL4MHBS.js} +1 -1
  285. package/dist/client/assets/{thread-analytics-CRzIsQDC.js → thread-analytics-0ZqqwnzE.js} +1 -1
  286. package/dist/client/assets/{thread-intent-DEna0N6y.js → thread-intent-DzC9Ji46.js} +1 -1
  287. package/dist/client/assets/{thread-route-CKIN4nc-.js → thread-route-D0aLhRkR.js} +1 -1
  288. package/dist/client/assets/{thread-route-Bo3gwmaG.js → thread-route-DuRhXh4I.js} +1 -1
  289. package/dist/client/assets/{thread-sheet-body-By8NyP0y.js → thread-sheet-body-VXXOBFly.js} +1 -1
  290. package/dist/client/assets/{time-range-picker-CtXKDXpg.js → time-range-picker-vYJ0Kk8S.js} +1 -1
  291. package/dist/client/assets/{toggle-group-COK-wW8I.js → toggle-group-CRigS0R4.js} +1 -1
  292. package/dist/client/assets/{tool-namespace-rRU5qMc_.js → tool-namespace-DPiptzHh.js} +1 -1
  293. package/dist/client/assets/{toolbar-icon-button-BKHwq05w.js → toolbar-icon-button-uuYUYVtr.js} +1 -1
  294. package/dist/client/assets/{tooltip-BwU3TfFp.js → tooltip-DX3EibzC.js} +1 -1
  295. package/dist/client/assets/{tooltipContext-CAHajv8a.js → tooltipContext-DiSBImQr.js} +1 -1
  296. package/dist/client/assets/{track-BPoEwC0E.js → track-D-YCF_rE.js} +1 -1
  297. package/dist/client/assets/{types-DRalEM3C.js → types-BmDn-Bmr.js} +1 -1
  298. package/dist/client/assets/{url-slug-COrOe0WW.js → url-slug-BjYL2qGa.js} +1 -1
  299. package/dist/client/assets/{usage-stats-XZL_1T4w.js → usage-stats-DViGt9Z5.js} +1 -1
  300. package/dist/client/assets/{use-ai-providers-Cp5F1VcY.js → use-ai-providers-XvM2-sU7.js} +1 -1
  301. package/dist/client/assets/{use-automations-eFmS2FKe.js → use-automations-BP7Qo80Q.js} +1 -1
  302. package/dist/client/assets/{use-autosave-C9nj8WNq.js → use-autosave-DLpdlg6z.js} +1 -1
  303. package/dist/client/assets/{use-chat-layout-state-xTXMyKKk.js → use-chat-layout-state-BEn27bqi.js} +1 -1
  304. package/dist/client/assets/{use-clock-tick-Ea25VUYb.js → use-clock-tick--0G9fYV8.js} +1 -1
  305. package/dist/client/assets/{use-connect-companion-POnaAIsR.js → use-connect-companion-Byfe_uLr.js} +1 -1
  306. package/dist/client/assets/{use-connection-K9rEqDx3.js → use-connection-C4wyl2ru.js} +1 -1
  307. package/dist/client/assets/{use-content-sync-C_a-vn-B.js → use-content-sync-BdbVP04j.js} +1 -1
  308. package/dist/client/assets/{use-copy-B5Nw2ln-.js → use-copy-BS5soA37.js} +1 -1
  309. package/dist/client/assets/{use-create-virtual-mcp-BM5JgPZg.js → use-create-virtual-mcp-Bgr2d-1k.js} +1 -1
  310. package/dist/client/assets/{use-date-fns-locale-CtFSWiK4.js → use-date-fns-locale-D_SHRVT8.js} +1 -1
  311. package/dist/client/assets/{use-debounced-autosave-CpCeYixJ.js → use-debounced-autosave-CteI237O.js} +1 -1
  312. package/dist/client/assets/{use-debounced-value-BOMWTPY3.js → use-debounced-value-DGbphRsM.js} +1 -1
  313. package/dist/client/assets/{use-deco-credits-DR8-Tka6.js → use-deco-credits-B7vnPi2P.js} +1 -1
  314. package/dist/client/assets/{use-decopilot-events-Qf3fSwYr.js → use-decopilot-events-DTU6iW_4.js} +1 -1
  315. package/dist/client/assets/{use-delete-connection-BGCZqvQL.js → use-delete-connection-v7vjwrBf.js} +1 -1
  316. package/dist/client/assets/{use-deployment-admin-Bar4XffR.js → use-deployment-admin-Cr49Ea_9.js} +1 -1
  317. package/dist/client/assets/{use-ensure-project-folder-SxuhSqkI.js → use-ensure-project-folder-BiBJcIU0.js} +1 -1
  318. package/dist/client/assets/{use-fast-preview-draft-url-EV84odfX.js → use-fast-preview-draft-url-CUkbW62G.js} +1 -1
  319. package/dist/client/assets/{use-file-configs-DCrTPP04.js → use-file-configs-dTlYe09H.js} +1 -1
  320. package/dist/client/assets/{use-inbox-feed-bSceDcjX.js → use-inbox-feed-d4Pg1vDp.js} +1 -1
  321. package/dist/client/assets/{use-infinite-scroll-HwZjX02J.js → use-infinite-scroll-DYPYtqG2.js} +1 -1
  322. package/dist/client/assets/{use-join-requests-C5AvVu_b.js → use-join-requests-CgaNoIHU.js} +1 -1
  323. package/dist/client/assets/{use-main-panel-tabs-dd8MU14H.js → use-main-panel-tabs-bEgIKNUF.js} +1 -1
  324. package/dist/client/assets/{use-main-schema-v8-CEMheePi.js → use-main-schema-v8-BpRBE2if.js} +1 -1
  325. package/dist/client/assets/{use-mcp-auth-status-DijdJpV2.js → use-mcp-auth-status-XO9Yp1aB.js} +1 -1
  326. package/dist/client/assets/{use-mcp-client-BqxufeFQ.js → use-mcp-client-DA050uNw.js} +1 -1
  327. package/dist/client/assets/{use-mcp-prompts-x85qdRTs.js → use-mcp-prompts-C_C6tlAY.js} +1 -1
  328. package/dist/client/assets/{use-mcp-tools-C7RNSCm2.js → use-mcp-tools-DDRwYO6T.js} +1 -1
  329. package/dist/client/assets/{use-members-hZfDNsyQ.js → use-members-C4ay671C.js} +1 -1
  330. package/dist/client/assets/{use-mobile-B-6bodzw.js → use-mobile-BsNhhNj1.js} +1 -1
  331. package/dist/client/assets/{use-navigate-to-agent-B4nMFFrr.js → use-navigate-to-agent-y0z5Ii2q.js} +1 -1
  332. package/dist/client/assets/{use-open-billing-url-BnVW18Te.js → use-open-billing-url-B2tbuRiV.js} +1 -1
  333. package/dist/client/assets/{use-org-auth-client-DbZXNKzp.js → use-org-auth-client-Cn5Gs8uE.js} +1 -1
  334. package/dist/client/assets/{use-org-fs-DvrG4oqK.js → use-org-fs-QKl-Epzm.js} +1 -1
  335. package/dist/client/assets/{use-org-repo-syncs-BsfQ-AYu.js → use-org-repo-syncs-DkE7BEdc.js} +1 -1
  336. package/dist/client/assets/{use-org-sso-B5w9Y6-K.js → use-org-sso-fQ5NHD0A.js} +1 -1
  337. package/dist/client/assets/{use-organization-roles-DKryRiui.js → use-organization-roles-DDX-q-Qm.js} +1 -1
  338. package/dist/client/assets/{use-organization-settings-CT_gWjCV.js → use-organization-settings-BAyreMqm.js} +1 -1
  339. package/dist/client/assets/{use-panel-navigate-C5hBMKoK.js → use-panel-navigate-CYHQ9H_T.js} +1 -1
  340. package/dist/client/assets/{use-project-native-view-presence-BTvz93hM.js → use-project-native-view-presence-DG_OsicQ.js} +1 -1
  341. package/dist/client/assets/{use-project-scope-BOmNgUbL.js → use-project-scope-DTa66aFc.js} +1 -1
  342. package/dist/client/assets/{use-recent-apps-DnoPUgq-.js → use-recent-apps-BkiI05bl.js} +1 -1
  343. package/dist/client/assets/{use-releases-xYpnMQ0G.js → use-releases-3QZUJcU8.js} +1 -1
  344. package/dist/client/assets/{use-reports-diagnostic-CrPfCARR.js → use-reports-diagnostic-CFGQSOke.js} +1 -1
  345. package/dist/client/assets/{use-secrets-BK9OUQjp.js → use-secrets-CFDBcYIs.js} +1 -1
  346. package/dist/client/assets/{use-section-preview-base-D-BAP2Kx.js → use-section-preview-base-Bi0fZdk_.js} +1 -1
  347. package/dist/client/assets/{use-sidebar-collapsed-ztBUIrIJ.js → use-sidebar-collapsed-BDC4KJoA.js} +1 -1
  348. package/dist/client/assets/{use-tags-CRZAuKXI.js → use-tags-Ck-mty1R.js} +1 -1
  349. package/dist/client/assets/{use-task-board-analytics-C3khGqxr.js → use-task-board-analytics-K9XTOq2z.js} +1 -1
  350. package/dist/client/assets/{use-task-board-events-CEFK_U8B.js → use-task-board-events-Jz6kbe9R.js} +1 -1
  351. package/dist/client/assets/{use-task-board-item-prs-D_DLSRFh.js → use-task-board-item-prs-BGCAD4bx.js} +1 -1
  352. package/dist/client/assets/{use-task-metadata-DQNI_DYQ.js → use-task-metadata-CkrB-bRy.js} +1 -1
  353. package/dist/client/assets/{use-thread-analytics-CKrVTOjH.js → use-thread-analytics-BNcqqwBS.js} +1 -1
  354. package/dist/client/assets/{use-thread-outputs-fctBbSfO.js → use-thread-outputs-LnnMQYmj.js} +1 -1
  355. package/dist/client/assets/useInfiniteQuery-DhVIMVRh.js +1 -0
  356. package/dist/client/assets/{useQueries-DApBF_hk.js → useQueries-DsTjk3mN.js} +1 -1
  357. package/dist/client/assets/useSuspenseInfiniteQuery-BVpu0vkd.js +1 -0
  358. package/dist/client/assets/{users-B0WV36dy.js → users-CnjGVWpi.js} +1 -1
  359. package/dist/client/assets/{utils-DqDe2PdG.js → utils-CetO33tt.js} +1 -1
  360. package/dist/client/assets/{variant-calendar-Cw6bsyC8.js → variant-calendar-BVQKG7Pz.js} +1 -1
  361. package/dist/client/assets/{variant-draft-pointer-ybS7yl-Y.js → variant-draft-pointer-1XzXcLtg.js} +1 -1
  362. package/dist/client/assets/{view-mode-toggle-B4L0Gqe-.js → view-mode-toggle-BuqrnQGM.js} +1 -1
  363. package/dist/client/assets/{virtual-mcp-m7xS4Fyh.js → virtual-mcp-Ux8j-_02.js} +1 -1
  364. package/dist/client/assets/{watch-sse-pool-BZYzglPJ.js → watch-sse-pool-YHoQCS1I.js} +1 -1
  365. package/dist/client/index.html +2 -2
  366. package/dist/server/server.js +193 -193
  367. package/package.json +1 -1
  368. package/dist/client/assets/agent-app-BvW3NdzM.js +0 -1
  369. package/dist/client/assets/agent-deck-VsdzJHTb.js +0 -1
  370. package/dist/client/assets/agent-file-BS9xNFAD.js +0 -1
  371. package/dist/client/assets/agent-library-DGYQBCM9.js +0 -1
  372. package/dist/client/assets/agent-library-file-DewMMSvO.js +0 -1
  373. package/dist/client/assets/agent-overview-yn0Mx7V2.js +0 -1
  374. package/dist/client/assets/agent-settings-CSFW5nek.js +0 -1
  375. package/dist/client/assets/agent-site-editor-code-MU0whE6U.js +0 -2
  376. package/dist/client/assets/agent-site-editor-content-zSQpYEGg.js +0 -1
  377. package/dist/client/assets/agent-site-editor-preview-txveR_ds.js +0 -1
  378. package/dist/client/assets/agent-view-B4w7PCL8.js +0 -1
  379. package/dist/client/assets/api-keys-DZBvZYm9.js +0 -1
  380. package/dist/client/assets/cms-settings-editor-TWoAtc7Q.js +0 -1
  381. package/dist/client/assets/config-Ujr94uo2.js +0 -1
  382. package/dist/client/assets/flat-project-CoYmpFOt.js +0 -1
  383. package/dist/client/assets/home-Be7m5c5B.js +0 -1
  384. package/dist/client/assets/index-dF7Fpxre.css +0 -1
  385. package/dist/client/assets/library-DgG4D6VI.js +0 -1
  386. package/dist/client/assets/monitoring-Bbj5Lns2.js +0 -1
  387. package/dist/client/assets/plan-BlqG-PLe.js +0 -1
  388. package/dist/client/assets/project-apps-BccHfSJ8.js +0 -1
  389. package/dist/client/assets/project-reports-C5VIbCKB.js +0 -1
  390. package/dist/client/assets/project-tasks-DY-VwdNN.js +0 -1
  391. package/dist/client/assets/record-editor-CgQYmq0a.js +0 -1
  392. package/dist/client/assets/reports-CDdk6ylM.js +0 -1
  393. package/dist/client/assets/repositories-BLczkc5V.js +0 -1
  394. package/dist/client/assets/route-BJz_Tse0.js +0 -1
  395. package/dist/client/assets/settings-tab-BBqyUPly.js +0 -1
  396. package/dist/client/assets/site-editor-BGIwq6Fv.js +0 -1
  397. package/dist/client/assets/taskboard-analytics-DAGovxBg.js +0 -1
  398. package/dist/client/assets/tasks-DAULEt97.js +0 -1
  399. package/dist/client/assets/useInfiniteQuery-DYe2VDkL.js +0 -1
  400. package/dist/client/assets/useSuspenseInfiniteQuery-DrwXhpXt.js +0 -1
@@ -1,4 +1,4 @@
1
- import{c as q,b as Z,r as Q,j as t,B as te,h as it,l as ve,X as vs,T as bs,V as js,U as He,at as Ut,ar as Yt,as as Bt,t as oe,a2 as Fe,D as Xe,q as Je,s as lt,v as at,H as Ye,a3 as ys,fD as an,w as Vt,L as ws,I as ke,ak as rn,z as on,eq as tt,av as Wt,aj as cn,ep as ze,eo as Be,an as Tt,m as Ss,K as Dt,fE as dn,fF as un,fG as mn,b9 as be,fH as je,n as Ue,P as fn,d as Pt,u as pn,af as rt,o as Ns,e as hn,aM as Cs,y as _e,b1 as xn,a as gn,fI as ks,fJ as vn,aW as bn,ad as jn,aE as yn,aD as wn,a5 as Sn,fK as Nn,aL as Cn}from"./index-CNWJYHvX.js";import{g as kn}from"./extract-connection-data-B-l9PdV0.js";import{b as Mn}from"./chat-context-CHUVtsDo.js";import{U as _n,b as Vn}from"./build-improve-prompt-doc-8Y6fyKcx.js";import{E as Tn}from"./empty-state-DRKp6xDi.js";import{a as Dn}from"./shell-layout-Cng6sPGR.js";import{g as ft,n as Pn,a as Kt,e as On,u as In,f as An}from"./use-date-fns-locale-CtFSWiK4.js";import{a as $n}from"./mcp-oauth-B26YcM5J.js";import{f as Fn,e as En,b as zn,A as Rn,a as Ln,d as Un,c as Yn,g as Bn}from"./alert-dialog-BXsSwOCK.js";import{T as ut}from"./textarea-ynJNuYy7.js";import{c as Se,T as Ne,a as Ce}from"./tooltip-BwU3TfFp.js";import{a as Ot,b as Ms,u as Wn}from"./use-connection-K9rEqDx3.js";import{b as Kn,a as _s,g as Vs,f as Gn,k as qn}from"./repository-binding-CGk3ZX0j.js";import{i as Gt}from"./mcp-oauth-D8hJrLwY.js";import{bi as Hn,k as Qn,bj as Xn,bk as Jn,aN as Zn,aH as ei,aK as ti,bl as si,bm as Ts,bn as Ds,bo as ni,as as ii,bp as li,bq as jt,br as qt,A as Ht,M as ai,bs as ri,bt as oi,g as Ps,p as Qt,n as ci,w as di,v as ui,u as mi,f as Os,D as Xt,aL as fi,ag as pi,ay as hi}from"./agent-icon-BAsaPIPW.js";import{s as Pe}from"./Plus-Dam4fGJv.js";import{t as dt,a as xi}from"./Tool01-C0tA6_WY.js";import{s as It}from"./Trash01-BWvgZ-My.js";import{u as Jt}from"./use-debounced-autosave-CpCeYixJ.js";import{A as gi}from"./add-connection-dialog-9kRnWMWN.js";import{i as Ct}from"./SearchMd-BmY7B7q3.js";import{F as Zt}from"./file-type-icon-DrKVTY_y.js";import{j as vi,i as bi,n as ji,q as yi}from"./use-org-fs-DvrG4oqK.js";import{I as Ze}from"./integration-icon-A_JAytZI.js";import{C as Is}from"./checkbox-D1J9YzHt.js";import{S as wi}from"./search-input-Dujh_El7.js";import{b as Oe,a as Ie,c as we,d as Ae,S as $e}from"./select-DZhmnwp_.js";import{s as At}from"./XClose-J1FWOmKL.js";import{C as Si}from"./collection-tabs-Mlp_Rejx.js";import{T as As,u as $s}from"./use-mcp-auth-status-DijdJpV2.js";import{u as pt}from"./use-mcp-client-BqxufeFQ.js";import{a as Fs}from"./use-mcp-tools-C7RNSCm2.js";import{u as Ni}from"./use-mcp-prompts-x85qdRTs.js";import{g as Ci}from"./connection-slug-CITJ0kGN.js";import{t as kt}from"./utils-CVEq3hMx.js";import{S as ht}from"./switch-zkrdrMZj.js";import{a as Es,b as zs,P as Rs}from"./popover-D5cvllcj.js";import{S as ki}from"./scroll-area-D7vhzfPi.js";import{i as Mi}from"./Upload01-Ayc3pkY7.js";import{i as _i}from"./DotsVertical-CRoDrMwf.js";import{a as Vi}from"./Image01-D3cjfdzm.js";import{i as Ti}from"./Monitor01-CSJlATNa.js";import{g as Di}from"./types-DRalEM3C.js";import{a as Ls,d as Pi,u as Oi}from"./use-main-schema-v8-CEMheePi.js";import{a as Ii}from"./use-panel-navigate-C5hBMKoK.js";import{u as Ai,e as Mt,r as _t,p as $i,g as Fi,s as Ei,t as zi,h as Ri,a as Li}from"./use-project-native-view-presence-BTvz93hM.js";import{a as Us,u as Ui,i as Yi,o as Bi,r as es,p as Wi,w as Ki,b as ts}from"./optimistic-project-sidebar-views-DQouTCdv.js";import{P as Gi,a as qi,i as Hi}from"./sections-CJqhzmZf.js";import{i as $t}from"./Key01-DBuAbIfl.js";import{a as Qi}from"./format-time-Cq80KKvY.js";import{a as xt}from"./Copy01-B6uJ5A3t.js";import{u as Xi}from"./use-copy-B5Nw2ln-.js";import{L as ye}from"./label-DKrrhY82.js";import{s as Ys,p as Ji,f as Zi}from"./thread-intent-DEna0N6y.js";import{V as el,E as gt,r as Bs,C as tl,w as sl}from"./virtual-mcp-m7xS4Fyh.js";import{s as Ws}from"./slugify-CEUa2lfQ.js";import{b as nl,a as il,D as ll}from"./drawer-PNF7GPi2.js";import{u as al}from"./use-mobile-B-6bodzw.js";import{d as vt}from"./delay-CnY5UFtP.js";import{b as rl}from"./sandbox-url-D3mC8qhT.js";import{S as ol,a as cl,b as dl}from"./secret-picker-CPXxDZGW.js";import{u as ul,a as ml}from"./use-secrets-BK9OUQjp.js";import{o as ss}from"./omit-sandbox-map-jj4lCB2U.js";import{G as fl}from"./repository-picker-CoWZ9iTd.js";import{r as pl}from"./serial-task-queue-CGOeQgpr.js";import{t as De,c as Qe,m as hl,a as Ks}from"./differenceInSeconds-C3x8sHUj.js";function nt(l,e){const s=ft(),n=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??s.weekStartsOn??s.locale?.options?.weekStartsOn??0,i=De(l,e?.in),a=i.getDay(),c=(a<n?7:0)+a-n;return i.setDate(i.getDate()-c),i.setHours(0,0,0,0),i}function mt(l,e){return nt(l,{...e,weekStartsOn:1})}function Gs(l,e){const s=De(l,e?.in),n=s.getFullYear(),i=Qe(s,0);i.setFullYear(n+1,0,4),i.setHours(0,0,0,0);const a=mt(i),c=Qe(s,0);c.setFullYear(n,0,4),c.setHours(0,0,0,0);const r=mt(c);return s.getTime()>=a.getTime()?n+1:s.getTime()>=r.getTime()?n:n-1}function ns(l,e){const s=De(l,e?.in);return s.setHours(0,0,0,0),s}function xl(l,e,s){const[n,i]=Pn(s?.in,l,e),a=ns(n),c=ns(i),r=+a-Kt(a),p=+c-Kt(c);return Math.round((r-p)/hl)}function gl(l,e){const s=Gs(l,e),n=Qe(l,0);return n.setFullYear(s,0,4),n.setHours(0,0,0,0),mt(n)}function vl(l){return l instanceof Date||typeof l=="object"&&Object.prototype.toString.call(l)==="[object Date]"}function bl(l){return!(!vl(l)&&typeof l!="number"||isNaN(+De(l)))}function jl(l,e){const s=De(l,e?.in);return s.setFullYear(s.getFullYear(),0,1),s.setHours(0,0,0,0),s}function yl(l,e){const s=De(l,e?.in);return xl(s,jl(s))+1}function wl(l,e){const s=De(l,e?.in),n=+mt(s)-+gl(s);return Math.round(n/Ks)+1}function qs(l,e){const s=De(l,e?.in),n=s.getFullYear(),i=ft(),a=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,c=Qe(e?.in||l,0);c.setFullYear(n+1,0,a),c.setHours(0,0,0,0);const r=nt(c,e),p=Qe(e?.in||l,0);p.setFullYear(n,0,a),p.setHours(0,0,0,0);const o=nt(p,e);return+s>=+r?n+1:+s>=+o?n:n-1}function Sl(l,e){const s=ft(),n=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,i=qs(l,e),a=Qe(e?.in||l,0);return a.setFullYear(i,0,n),a.setHours(0,0,0,0),nt(a,e)}function Nl(l,e){const s=De(l,e?.in),n=+nt(s,e)-+Sl(s,e);return Math.round(n/Ks)+1}function re(l,e){const s=l<0?"-":"",n=Math.abs(l).toString().padStart(e,"0");return s+n}const Ee={y(l,e){const s=l.getFullYear(),n=s>0?s:1-s;return re(e==="yy"?n%100:n,e.length)},M(l,e){const s=l.getMonth();return e==="M"?String(s+1):re(s+1,2)},d(l,e){return re(l.getDate(),e.length)},a(l,e){const s=l.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return s.toUpperCase();case"aaa":return s;case"aaaaa":return s[0];default:return s==="am"?"a.m.":"p.m."}},h(l,e){return re(l.getHours()%12||12,e.length)},H(l,e){return re(l.getHours(),e.length)},m(l,e){return re(l.getMinutes(),e.length)},s(l,e){return re(l.getSeconds(),e.length)},S(l,e){const s=e.length,n=l.getMilliseconds(),i=Math.trunc(n*Math.pow(10,s-3));return re(i,e.length)}},qe={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},is={G:function(l,e,s){const n=l.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return s.era(n,{width:"abbreviated"});case"GGGGG":return s.era(n,{width:"narrow"});default:return s.era(n,{width:"wide"})}},y:function(l,e,s){if(e==="yo"){const n=l.getFullYear(),i=n>0?n:1-n;return s.ordinalNumber(i,{unit:"year"})}return Ee.y(l,e)},Y:function(l,e,s,n){const i=qs(l,n),a=i>0?i:1-i;if(e==="YY"){const c=a%100;return re(c,2)}return e==="Yo"?s.ordinalNumber(a,{unit:"year"}):re(a,e.length)},R:function(l,e){const s=Gs(l);return re(s,e.length)},u:function(l,e){const s=l.getFullYear();return re(s,e.length)},Q:function(l,e,s){const n=Math.ceil((l.getMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return re(n,2);case"Qo":return s.ordinalNumber(n,{unit:"quarter"});case"QQQ":return s.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return s.quarter(n,{width:"narrow",context:"formatting"});default:return s.quarter(n,{width:"wide",context:"formatting"})}},q:function(l,e,s){const n=Math.ceil((l.getMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return re(n,2);case"qo":return s.ordinalNumber(n,{unit:"quarter"});case"qqq":return s.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return s.quarter(n,{width:"narrow",context:"standalone"});default:return s.quarter(n,{width:"wide",context:"standalone"})}},M:function(l,e,s){const n=l.getMonth();switch(e){case"M":case"MM":return Ee.M(l,e);case"Mo":return s.ordinalNumber(n+1,{unit:"month"});case"MMM":return s.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return s.month(n,{width:"narrow",context:"formatting"});default:return s.month(n,{width:"wide",context:"formatting"})}},L:function(l,e,s){const n=l.getMonth();switch(e){case"L":return String(n+1);case"LL":return re(n+1,2);case"Lo":return s.ordinalNumber(n+1,{unit:"month"});case"LLL":return s.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return s.month(n,{width:"narrow",context:"standalone"});default:return s.month(n,{width:"wide",context:"standalone"})}},w:function(l,e,s,n){const i=Nl(l,n);return e==="wo"?s.ordinalNumber(i,{unit:"week"}):re(i,e.length)},I:function(l,e,s){const n=wl(l);return e==="Io"?s.ordinalNumber(n,{unit:"week"}):re(n,e.length)},d:function(l,e,s){return e==="do"?s.ordinalNumber(l.getDate(),{unit:"date"}):Ee.d(l,e)},D:function(l,e,s){const n=yl(l);return e==="Do"?s.ordinalNumber(n,{unit:"dayOfYear"}):re(n,e.length)},E:function(l,e,s){const n=l.getDay();switch(e){case"E":case"EE":case"EEE":return s.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return s.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(n,{width:"short",context:"formatting"});default:return s.day(n,{width:"wide",context:"formatting"})}},e:function(l,e,s,n){const i=l.getDay(),a=(i-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(a);case"ee":return re(a,2);case"eo":return s.ordinalNumber(a,{unit:"day"});case"eee":return s.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return s.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(i,{width:"short",context:"formatting"});default:return s.day(i,{width:"wide",context:"formatting"})}},c:function(l,e,s,n){const i=l.getDay(),a=(i-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(a);case"cc":return re(a,e.length);case"co":return s.ordinalNumber(a,{unit:"day"});case"ccc":return s.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return s.day(i,{width:"narrow",context:"standalone"});case"cccccc":return s.day(i,{width:"short",context:"standalone"});default:return s.day(i,{width:"wide",context:"standalone"})}},i:function(l,e,s){const n=l.getDay(),i=n===0?7:n;switch(e){case"i":return String(i);case"ii":return re(i,e.length);case"io":return s.ordinalNumber(i,{unit:"day"});case"iii":return s.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return s.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return s.day(n,{width:"short",context:"formatting"});default:return s.day(n,{width:"wide",context:"formatting"})}},a:function(l,e,s){const i=l.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return s.dayPeriod(i,{width:"narrow",context:"formatting"});default:return s.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(l,e,s){const n=l.getHours();let i;switch(n===12?i=qe.noon:n===0?i=qe.midnight:i=n/12>=1?"pm":"am",e){case"b":case"bb":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return s.dayPeriod(i,{width:"narrow",context:"formatting"});default:return s.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(l,e,s){const n=l.getHours();let i;switch(n>=17?i=qe.evening:n>=12?i=qe.afternoon:n>=4?i=qe.morning:i=qe.night,e){case"B":case"BB":case"BBB":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return s.dayPeriod(i,{width:"narrow",context:"formatting"});default:return s.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(l,e,s){if(e==="ho"){let n=l.getHours()%12;return n===0&&(n=12),s.ordinalNumber(n,{unit:"hour"})}return Ee.h(l,e)},H:function(l,e,s){return e==="Ho"?s.ordinalNumber(l.getHours(),{unit:"hour"}):Ee.H(l,e)},K:function(l,e,s){const n=l.getHours()%12;return e==="Ko"?s.ordinalNumber(n,{unit:"hour"}):re(n,e.length)},k:function(l,e,s){let n=l.getHours();return n===0&&(n=24),e==="ko"?s.ordinalNumber(n,{unit:"hour"}):re(n,e.length)},m:function(l,e,s){return e==="mo"?s.ordinalNumber(l.getMinutes(),{unit:"minute"}):Ee.m(l,e)},s:function(l,e,s){return e==="so"?s.ordinalNumber(l.getSeconds(),{unit:"second"}):Ee.s(l,e)},S:function(l,e){return Ee.S(l,e)},X:function(l,e,s){const n=l.getTimezoneOffset();if(n===0)return"Z";switch(e){case"X":return as(n);case"XXXX":case"XX":return Le(n);default:return Le(n,":")}},x:function(l,e,s){const n=l.getTimezoneOffset();switch(e){case"x":return as(n);case"xxxx":case"xx":return Le(n);default:return Le(n,":")}},O:function(l,e,s){const n=l.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+ls(n,":");default:return"GMT"+Le(n,":")}},z:function(l,e,s){const n=l.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+ls(n,":");default:return"GMT"+Le(n,":")}},t:function(l,e,s){const n=Math.trunc(+l/1e3);return re(n,e.length)},T:function(l,e,s){return re(+l,e.length)}};function ls(l,e=""){const s=l>0?"-":"+",n=Math.abs(l),i=Math.trunc(n/60),a=n%60;return a===0?s+String(i):s+String(i)+e+re(a,2)}function as(l,e){return l%60===0?(l>0?"-":"+")+re(Math.abs(l)/60,2):Le(l,e)}function Le(l,e=""){const s=l>0?"-":"+",n=Math.abs(l),i=re(Math.trunc(n/60),2),a=re(n%60,2);return s+i+e+a}const rs=(l,e)=>{switch(l){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}},Hs=(l,e)=>{switch(l){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}},Cl=(l,e)=>{const s=l.match(/(P+)(p+)?/)||[],n=s[1],i=s[2];if(!i)return rs(l,e);let a;switch(n){case"P":a=e.dateTime({width:"short"});break;case"PP":a=e.dateTime({width:"medium"});break;case"PPP":a=e.dateTime({width:"long"});break;default:a=e.dateTime({width:"full"});break}return a.replace("{{date}}",rs(n,e)).replace("{{time}}",Hs(i,e))},kl={p:Hs,P:Cl},Ml=/^D+$/,_l=/^Y+$/,Vl=["D","DD","YY","YYYY"];function Tl(l){return Ml.test(l)}function Dl(l){return _l.test(l)}function Pl(l,e,s){const n=Ol(l,e,s);if(console.warn(n),Vl.includes(l))throw new RangeError(n)}function Ol(l,e,s){const n=l[0]==="Y"?"years":"days of the month";return`Use \`${l.toLowerCase()}\` instead of \`${l}\` (in \`${e}\`) for formatting ${n} to the input \`${s}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Il=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Al=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,$l=/^'([^]*?)'?$/,Fl=/''/g,El=/[a-zA-Z]/;function zl(l,e,s){const n=ft(),i=s?.locale??n.locale??On,a=s?.firstWeekContainsDate??s?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,c=s?.weekStartsOn??s?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=De(l,s?.in);if(!bl(r))throw new RangeError("Invalid time value");let p=e.match(Al).map(f=>{const m=f[0];if(m==="p"||m==="P"){const u=kl[m];return u(f,i.formatLong)}return f}).join("").match(Il).map(f=>{if(f==="''")return{isToken:!1,value:"'"};const m=f[0];if(m==="'")return{isToken:!1,value:Rl(f)};if(is[m])return{isToken:!0,value:f};if(m.match(El))throw new RangeError("Format string contains an unescaped latin alphabet character `"+m+"`");return{isToken:!1,value:f}});i.localize.preprocessor&&(p=i.localize.preprocessor(r,p));const o={firstWeekContainsDate:a,weekStartsOn:c,locale:i};return p.map(f=>{if(!f.isToken)return f.value;const m=f.value;(!s?.useAdditionalWeekYearTokens&&Dl(m)||!s?.useAdditionalDayOfYearTokens&&Tl(m))&&Pl(m,e,String(l));const u=is[m[0]];return u(r,m,i.localize,o)}).join("")}function Rl(l){const e=l.match($l);return e?e[1].replace(Fl,"'"):l}const Qs=25*1024*1024,yt="home",wt="knowledge";function os(l){return l==null?"":l<1024?`${l} B`:l<1024*1024?`${(l/1024).toFixed(0)} KB`:`${(l/(1024*1024)).toFixed(1)} MB`}function Re(l){return l.split("/").pop()??l}function Ll(l){const e=q.c(64),{form:s}=l,n=Z(),{upload:i}=vi(yt),a=bi(),c=Q.useRef(null),[r,p]=Q.useState(!1),[o,f]=Q.useState(""),[m,u]=Q.useState(!1);let h;e[0]!==r?(h={enabled:r},e[0]=r,e[1]=h):h=e[1];const{data:d}=ji(60,h),x=d===void 0?[]:d;let g;e[2]!==r?(g={enabled:r},e[2]=r,e[3]=g):g=e[3];const{data:v}=yi(g),y=v===void 0?[]:v;let j;e[4]!==s?(j=()=>s.getValues("metadata.knowledge")??[],e[4]=s,e[5]=j):j=e[5];const[b,S]=Q.useState(j);let N;e[6]!==s?(N=I=>{S(I),s.setValue("metadata.knowledge",I,{shouldDirty:!0})},e[6]=s,e[7]=N):N=e[7];const k=N;let w;e[8]!==a||e[9]!==b||e[10]!==k||e[11]!==n||e[12]!==i?(w=async I=>{if(!I||I.length===0)return;const ne=Array.from(I),L=ne.filter(ql),ee=ne.filter(Gl);if(ee.length>0&&oe.warning(n("virtualMcp.filesSection.fileTooLargeTitle"),{description:n("virtualMcp.filesSection.fileTooLargeDescription",{names:ee.map(Kl).join(", ")})}),L.length!==0){try{await i.mutateAsync({dir:wt,files:L})}catch(J){const pe=J;oe.error(pe instanceof Error?pe.message:n("virtualMcp.filesSection.failedUploadFile"));return}k([...b,...L.map(J=>({id:crypto.randomUUID(),name:J.name,volume:yt,path:`${wt}/${J.name}`,url:a(yt,`${wt}/${J.name}`),contentType:J.type||null,size:J.size,addedAt:new Date().toISOString()}))])}},e[8]=a,e[9]=b,e[10]=k,e[11]=n,e[12]=i,e[13]=w):w=e[13];const C=w;let _;e[14]!==a||e[15]!==b||e[16]!==k?(_=I=>{b.some(ne=>ne.volume===I.volume&&ne.path===I.path)||(k([...b,{id:crypto.randomUUID(),name:Re(I.path),volume:I.volume,path:I.path,url:a(I.volume,I.path),contentType:null,size:I.size??null,addedAt:new Date().toISOString()}]),p(!1))},e[14]=a,e[15]=b,e[16]=k,e[17]=_):_=e[17];const T=_;let V;e[18]!==a||e[19]!==b||e[20]!==k?(V=I=>{b.some(ne=>ne.volume===I.volume&&ne.path===I.path)||(k([...b,{id:crypto.randomUUID(),name:Re(I.path),kind:"skill",volume:I.volume,path:I.path,url:a(I.volume,I.path),contentType:null,size:null,addedAt:new Date().toISOString()}]),p(!1))},e[18]=a,e[19]=b,e[20]=k,e[21]=V):V=e[21];const $=V;let D;e[22]!==b||e[23]!==k?(D=I=>{k(b.filter(ne=>ne.id!==I))},e[22]=b,e[23]=k,e[24]=D):D=e[24];const A=D;let P;e[25]===Symbol.for("react.memo_cache_sentinel")?(P=I=>{p(I),I&&f("")},e[25]=P):P=e[25];const E=P;let U;e[26]!==b?(U=new Set(b.map(Wl)),e[26]=b,e[27]=U):U=e[27];const K=U,Y=o.toLowerCase();let B;e[28]!==K?(B=I=>!K.has(`${I.volume}/${I.path}`),e[28]=K,e[29]=B):B=e[29];const z=x.filter(Bl).filter(B).filter(I=>Re(I.path).toLowerCase().includes(Y)).slice(0,5);let M;e[30]!==K?(M=I=>!K.has(`${I.volume}/${I.path}`),e[30]=K,e[31]=M):M=e[31];const O=y.filter(M).filter(I=>Re(I.path).toLowerCase().includes(Y)).slice(0,5),G=I=>t.jsxs(vs,{open:r,onOpenChange:E,children:[t.jsx(bs,{asChild:!0,children:I}),t.jsxs(js,{align:"end",className:"w-56",children:[t.jsxs(He,{onSelect:()=>{c.current?.click()},children:[t.jsx(Hn,{size:16}),n("virtualMcp.filesSection.uploadFile")]}),t.jsxs(Ut,{children:[t.jsxs(Yt,{className:"gap-2 [&_svg:not([class*='text-'])]:text-muted-foreground",children:[t.jsx(Qn,{size:16}),n("virtualMcp.filesSection.selectFileOrFolder")]}),t.jsxs(Bt,{className:"w-72 p-0",children:[t.jsxs("div",{className:"flex items-center gap-2 border-b px-3",children:[t.jsx(Ct,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsx("input",{value:o,onChange:ne=>f(ne.target.value),onKeyDown:Yl,placeholder:n("virtualMcp.filesSection.searchFilesPlaceholder"),className:"h-10 w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),t.jsx("div",{className:"max-h-64 overflow-y-auto p-1",children:z.length===0?t.jsx("p",{className:"px-2 py-3 text-center text-sm text-muted-foreground",children:n("virtualMcp.filesSection.noFilesFound")}):z.map(ne=>t.jsxs(He,{onSelect:()=>T(ne),children:[t.jsx(Zt,{filename:Re(ne.path),className:"h-5 w-4 shrink-0"}),t.jsx("span",{className:"flex-1 truncate",children:Re(ne.path)}),ne.size!=null&&t.jsx("span",{className:"text-xs text-muted-foreground",children:os(ne.size)})]},`${ne.volume}/${ne.path}`))})]})]}),t.jsxs(Ut,{children:[t.jsxs(Yt,{className:"gap-2 [&_svg:not([class*='text-'])]:text-muted-foreground",children:[t.jsx(dt,{size:16}),n("virtualMcp.filesSection.selectSkill")]}),t.jsxs(Bt,{className:"w-72 p-0",children:[t.jsxs("div",{className:"flex items-center gap-2 border-b px-3",children:[t.jsx(Ct,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsx("input",{value:o,onChange:ne=>f(ne.target.value),onKeyDown:Ul,placeholder:n("virtualMcp.filesSection.searchSkillsPlaceholder"),className:"h-10 w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),t.jsx("div",{className:"max-h-64 overflow-y-auto p-1",children:O.length===0?t.jsx("p",{className:"px-2 py-3 text-center text-sm text-muted-foreground",children:n("virtualMcp.filesSection.noSkillsFound")}):O.map(ne=>t.jsxs(He,{onSelect:()=>$(ne),children:[t.jsx(dt,{size:16,className:"shrink-0"}),t.jsx("span",{className:"flex-1 truncate",children:Re(ne.path)})]},`${ne.volume}/${ne.path}`))})]})]})]})]}),R="flex flex-col gap-3";let F;e[32]!==n?(F=n("virtualMcp.filesSection.filesAndSkills"),e[32]=n,e[33]=F):F=e[33];let W;e[34]!==F?(W=t.jsx("h2",{className:"text-sm font-medium text-foreground",children:F}),e[34]=F,e[35]=W):W=e[35];let H;e[36]!==n?(H=n("virtualMcp.filesSection.description"),e[36]=n,e[37]=H):H=e[37];let se;e[38]!==H?(se=t.jsx("p",{className:"text-sm text-muted-foreground",children:H}),e[38]=H,e[39]=se):se=e[39];let le;e[40]!==W||e[41]!==se?(le=t.jsxs("div",{className:"flex flex-col gap-1",children:[W,se]}),e[40]=W,e[41]=se,e[42]=le):le=e[42];const ce=b.length>0&&G(t.jsxs(te,{variant:"outline",size:"sm",disabled:i.isPending,children:[i.isPending?t.jsx(it,{size:"xs"}):t.jsx(Pe,{size:14}),n("virtualMcp.filesSection.add")]}));let ae;e[43]!==le||e[44]!==ce?(ae=t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[le,ce]}),e[43]=le,e[44]=ce,e[45]=ae):ae=e[45];let ie;e[46]!==C?(ie=t.jsx("input",{ref:c,type:"file",multiple:!0,className:"hidden",onChange:I=>{C(I.target.files),I.target.value=""}}),e[46]=C,e[47]=ie):ie=e[47];let X,de;e[48]===Symbol.for("react.memo_cache_sentinel")?(X=I=>{I.preventDefault(),u(!0)},de=()=>u(!1),e[48]=X,e[49]=de):(X=e[48],de=e[49]);let ue;e[50]!==C?(ue=I=>{I.preventDefault(),I.stopPropagation(),u(!1),C(I.dataTransfer.files)},e[50]=C,e[51]=ue):ue=e[51];const he=m&&"outline outline-2 outline-dashed outline-primary";let me;e[52]!==he?(me=ve("flex flex-col gap-2 rounded-lg",he),e[52]=he,e[53]=me):me=e[53];const xe=b.length===0?G(t.jsxs("button",{type:"button",className:"flex items-center gap-3 px-3 py-2.5 rounded-lg border border-dashed border-border hover:bg-accent/50 transition-colors w-full text-left cursor-pointer",children:[t.jsx("div",{className:"flex items-center justify-center size-8 rounded-md text-muted-foreground/75 border border-dashed border-border shrink-0",children:t.jsx(Pe,{size:16})}),t.jsx("span",{className:"text-sm text-muted-foreground flex-1",children:n("virtualMcp.filesSection.noFilesOrSkillsYet")})]})):b.map(I=>t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 rounded-xl border bg-card",children:[I.kind==="skill"?t.jsx("div",{className:"flex items-center justify-center h-8 w-6.5 shrink-0 rounded-md bg-muted text-muted-foreground",children:t.jsx(dt,{size:16})}):t.jsx(Zt,{filename:I.name,className:"h-8 w-6.5 shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:I.name}),t.jsx("p",{className:"text-xs text-muted-foreground",children:I.kind==="skill"?n("virtualMcp.filesSection.kindSkill"):I.size!=null?os(I.size):n("virtualMcp.filesSection.kindFile")})]}),t.jsx(te,{variant:"ghost",size:"icon",onClick:()=>A(I.id),"aria-label":n("virtualMcp.filesSection.removeAriaLabel",{name:I.name}),children:t.jsx(It,{size:16})})]},I.id));let ge;e[54]!==X||e[55]!==de||e[56]!==ue||e[57]!==me||e[58]!==xe?(ge=t.jsx("div",{onDragOver:X,onDragLeave:de,onDrop:ue,className:me,children:xe}),e[54]=X,e[55]=de,e[56]=ue,e[57]=me,e[58]=xe,e[59]=ge):ge=e[59];let fe;return e[60]!==ae||e[61]!==ie||e[62]!==ge?(fe=t.jsxs("section",{className:R,children:[ae,ie,ge]}),e[60]=ae,e[61]=ie,e[62]=ge,e[63]=fe):fe=e[63],fe}function Ul(l){return l.stopPropagation()}function Yl(l){return l.stopPropagation()}function Bl(l){return l.kind!=="dir"}function Wl(l){return`${l.volume}/${l.path}`}function Kl(l){return l.name}function Gl(l){return l.size>Qs}function ql(l){return l.size<=Qs}function Hl(l){return l==null?"all":l.length===0?"self":"selected"}function Ql(l){const e=q.c(88),{form:s,currentAgentId:n}=l,i=Z(),{org:a}=Fe(),c=Kn(),[r,p]=Q.useState(!1);let o;e[0]!==s?(o=s.getValues("metadata.subAgents")??null,e[0]=s,e[1]=o):o=e[1];const f=o;let m;e[2]!==f?(m=()=>Hl(f),e[2]=f,e[3]=m):m=e[3];const[u,h]=Q.useState(m);let d;e[4]!==f?(d=f??[],e[4]=f,e[5]=d):d=e[5];const[x,g]=Q.useState(d);let v,y,j,b,S,N;if(e[6]!==c||e[7]!==n||e[8]!==s||e[9]!==u||e[10]!==a||e[11]!==x||e[12]!==i){let _;e[19]!==n||e[20]!==a?(_=X=>X.id!==n&&X.id!==a.id&&X.status==="active",e[19]=n,e[20]=a,e[21]=_):_=e[21],v=c.filter(_);let T;e[22]!==x?(T=X=>x.includes(X.id),e[22]=x,e[23]=T):T=e[23];const V=v.filter(T);let $;e[24]!==s?($=(X,de)=>s.setValue("metadata.subAgents",X==="all"?null:X==="self"?[]:de,{shouldDirty:!0}),e[24]=s,e[25]=$):$=e[25];const D=$;let A;e[26]!==D||e[27]!==x?(A=X=>{h(X),D(X,x)},e[26]=D,e[27]=x,e[28]=A):A=e[28];const P=A;let E;e[29]!==D||e[30]!==x?(E=X=>{const de=x.includes(X)?x.filter(ue=>ue!==X):[...x,X];g(de),D("selected",de)},e[29]=D,e[30]=x,e[31]=E):E=e[31],y=E,S="flex flex-col gap-3";let U;e[32]!==i?(U=i("virtualMcp.subAgentsSection.title"),e[32]=i,e[33]=U):U=e[33];let K;e[34]!==U?(K=t.jsx("h2",{className:"text-sm font-medium text-foreground",children:U}),e[34]=U,e[35]=K):K=e[35];let Y;e[36]!==u||e[37]!==i?(Y=u==="all"&&t.jsx("p",{className:"text-sm text-muted-foreground",children:i("virtualMcp.subAgentsSection.canDelegateToAnyAgent")}),e[36]=u,e[37]=i,e[38]=Y):Y=e[38];let B;e[39]!==u||e[40]!==i?(B=u==="self"&&t.jsx("p",{className:"text-sm text-muted-foreground",children:i("virtualMcp.subAgentsSection.canOnlyDelegateToItself")}),e[39]=u,e[40]=i,e[41]=B):B=e[41];let z;e[42]!==K||e[43]!==Y||e[44]!==B?(z=t.jsxs("div",{className:"flex flex-col gap-1",children:[K,Y,B]}),e[42]=K,e[43]=Y,e[44]=B,e[45]=z):z=e[45];const M=u==="selected"&&V.length>0&&t.jsxs(te,{variant:"outline",size:"sm",onClick:()=>p(!0),children:[t.jsx(Pe,{size:14}),i("virtualMcp.subAgentsSection.addSubAgent")]});let O;e[46]!==P?(O=X=>P(X),e[46]=P,e[47]=O):O=e[47];let G;e[48]===Symbol.for("react.memo_cache_sentinel")?(G=t.jsx(Oe,{size:"sm",className:"w-auto",children:t.jsx(Ie,{})}),e[48]=G):G=e[48];let R;e[49]!==i?(R=i("virtualMcp.subAgentsSection.anyAgent"),e[49]=i,e[50]=R):R=e[50];let F;e[51]!==R?(F=t.jsx(we,{value:"all",children:R}),e[51]=R,e[52]=F):F=e[52];let W;e[53]!==i?(W=i("virtualMcp.subAgentsSection.specificAgents"),e[53]=i,e[54]=W):W=e[54];let H;e[55]!==W?(H=t.jsx(we,{value:"selected",children:W}),e[55]=W,e[56]=H):H=e[56];let se;e[57]!==i?(se=i("virtualMcp.subAgentsSection.onlyItself"),e[57]=i,e[58]=se):se=e[58];let le;e[59]!==se?(le=t.jsx(we,{value:"self",children:se}),e[59]=se,e[60]=le):le=e[60];let ce;e[61]!==F||e[62]!==H||e[63]!==le?(ce=t.jsxs(Ae,{align:"end",children:[F,H,le]}),e[61]=F,e[62]=H,e[63]=le,e[64]=ce):ce=e[64];let ae;e[65]!==u||e[66]!==O||e[67]!==ce?(ae=t.jsxs($e,{value:u,onValueChange:O,children:[G,ce]}),e[65]=u,e[66]=O,e[67]=ce,e[68]=ae):ae=e[68];let ie;e[69]!==M||e[70]!==ae?(ie=t.jsxs("div",{className:"flex items-center gap-2",children:[M,ae]}),e[69]=M,e[70]=ae,e[71]=ie):ie=e[71],e[72]!==z||e[73]!==ie?(N=t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[z,ie]}),e[72]=z,e[73]=ie,e[74]=N):N=e[74],j="flex flex-col gap-2",b=u==="selected"&&(V.length>0?V.map(X=>t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 rounded-xl border bg-background",children:[t.jsx(Ze,{icon:X.icon,name:X.title,size:"sm",className:"shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:X.title}),X.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:X.description})]}),t.jsx(te,{variant:"ghost",size:"icon",onClick:()=>y(X.id),children:t.jsx(At,{size:16})})]},X.id)):t.jsxs("button",{type:"button",onClick:()=>p(!0),className:"flex items-center gap-3 px-3 py-2.5 rounded-lg border border-dashed border-border hover:bg-accent/50 transition-colors w-full text-left cursor-pointer",children:[t.jsx("div",{className:"flex items-center justify-center size-8 rounded-md text-muted-foreground/75 border border-dashed border-border shrink-0",children:t.jsx(Pe,{size:16})}),t.jsx("span",{className:"text-sm text-muted-foreground",children:i("virtualMcp.subAgentsSection.emptyStateMessage")})]})),e[6]=c,e[7]=n,e[8]=s,e[9]=u,e[10]=a,e[11]=x,e[12]=i,e[13]=v,e[14]=y,e[15]=j,e[16]=b,e[17]=S,e[18]=N}else v=e[13],y=e[14],j=e[15],b=e[16],S=e[17],N=e[18];let k;e[75]!==j||e[76]!==b?(k=t.jsx("div",{className:j,children:b}),e[75]=j,e[76]=b,e[77]=k):k=e[77];let w;e[78]!==v||e[79]!==y||e[80]!==r||e[81]!==x?(w=t.jsx(Xl,{open:r,onOpenChange:p,candidates:v,selectedIds:x,onToggle:y}),e[78]=v,e[79]=y,e[80]=r,e[81]=x,e[82]=w):w=e[82];let C;return e[83]!==S||e[84]!==N||e[85]!==k||e[86]!==w?(C=t.jsxs("section",{className:S,children:[N,k,w]}),e[83]=S,e[84]=N,e[85]=k,e[86]=w,e[87]=C):C=e[87],C}function Xl(l){const e=q.c(39),{open:s,onOpenChange:n,candidates:i,selectedIds:a,onToggle:c}=l,r=Z(),[p,o]=Q.useState("");let f,m,u,h,d,x,g,v,y;if(e[0]!==i||e[1]!==n||e[2]!==c||e[3]!==s||e[4]!==p||e[5]!==a||e[6]!==r){const N=p.toLowerCase(),k=i.filter(_=>_.title.toLowerCase().includes(N)||_.description?.toLowerCase().includes(N));m=Xe,v=s,y=n,f=Je,d="max-w-md";let w;e[16]!==r?(w=r("virtualMcp.subAgentsSection.title"),e[16]=r,e[17]=w):w=e[17],e[18]!==w?(x=t.jsx(lt,{children:t.jsx(at,{children:w})}),e[18]=w,e[19]=x):x=e[19];let C;e[20]!==r?(C=r("virtualMcp.subAgentsSection.searchPlaceholder"),e[20]=r,e[21]=C):C=e[21],e[22]!==p||e[23]!==C?(g=t.jsx(wi,{value:p,onChange:o,placeholder:C,className:"w-full"}),e[22]=p,e[23]=C,e[24]=g):g=e[24],u="flex flex-col gap-1 max-h-80 overflow-y-auto",h=k.length===0?t.jsx("p",{className:"text-sm text-muted-foreground px-1 py-4 text-center",children:r("virtualMcp.subAgentsSection.noAgentsFound")}):k.map(_=>t.jsxs("button",{type:"button",onClick:()=>c(_.id),className:"flex items-center gap-3 px-2 py-2 rounded-lg hover:bg-accent/50 transition-colors cursor-pointer w-full text-left",children:[t.jsx(Is,{checked:a.includes(_.id),className:"pointer-events-none",tabIndex:-1}),t.jsx(Ze,{icon:_.icon,name:_.title,size:"sm",className:"shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:_.title}),_.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:_.description})]})]},_.id)),e[0]=i,e[1]=n,e[2]=c,e[3]=s,e[4]=p,e[5]=a,e[6]=r,e[7]=f,e[8]=m,e[9]=u,e[10]=h,e[11]=d,e[12]=x,e[13]=g,e[14]=v,e[15]=y}else f=e[7],m=e[8],u=e[9],h=e[10],d=e[11],x=e[12],g=e[13],v=e[14],y=e[15];let j;e[25]!==u||e[26]!==h?(j=t.jsx("div",{className:u,children:h}),e[25]=u,e[26]=h,e[27]=j):j=e[27];let b;e[28]!==f||e[29]!==d||e[30]!==x||e[31]!==g||e[32]!==j?(b=t.jsxs(f,{className:d,children:[x,g,j]}),e[28]=f,e[29]=d,e[30]=x,e[31]=g,e[32]=j,e[33]=b):b=e[33];let S;return e[34]!==m||e[35]!==v||e[36]!==y||e[37]!==b?(S=t.jsx(m,{open:v,onOpenChange:y,children:b}),e[34]=m,e[35]=v,e[36]=y,e[37]=b,e[38]=S):S=e[38],S}function st(){const l=q.c(1);let e;return l[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"flex items-center justify-center h-32",children:t.jsx(it,{className:"size-6 text-muted-foreground"})}),l[0]=e):e=l[0],e}function ct(l,e){return({error:s})=>s?.message?.includes("Method not found")||s?.code===-32601?t.jsx("div",{className:"flex-1 overflow-auto px-4 py-3 space-y-1",children:t.jsx("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:l})}):t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center h-full p-6 text-center space-y-4",children:[t.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:t.jsx(ys,{className:"h-6 w-6 text-destructive"})}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("h3",{className:"text-lg font-medium",children:e("virtualMcp.dependencySelectionDialog.somethingWentWrong")}),t.jsx("p",{className:"text-sm text-muted-foreground max-w-xs mx-auto",children:s?.message?s.message.length>200?`${s.message.slice(0,200)}...`:s.message:e("virtualMcp.dependencySelectionDialog.unexpectedError")})]})]})}function Xs(l){const e=q.c(23),{item:s,isSelected:n,onToggle:i,disabled:a}=l,c=a?"cursor-not-allowed opacity-50":"cursor-pointer",r=n?"bg-accent/25":"hover:bg-muted/50";let p;e[0]!==c||e[1]!==r?(p=ve("flex items-start gap-3 p-4 rounded-lg transition-colors",c,r),e[0]=c,e[1]=r,e[2]=p):p=e[2];let o;e[3]!==s.name?(o=t.jsx("p",{className:"text-sm font-medium leading-none truncate",children:s.name}),e[3]=s.name,e[4]=o):o=e[4];let f;e[5]!==s.tags?(f=s.tags&&t.jsx("span",{className:"shrink-0",children:s.tags}),e[5]=s.tags,e[6]=f):f=e[6];let m;e[7]!==o||e[8]!==f?(m=t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[o,f]}),e[7]=o,e[8]=f,e[9]=m):m=e[9];let u;e[10]!==s.description?(u=s.description&&t.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:s.description}),e[10]=s.description,e[11]=u):u=e[11];let h;e[12]!==m||e[13]!==u?(h=t.jsxs("div",{className:"flex-1 min-w-0 space-y-2",children:[m,u]}),e[12]=m,e[13]=u,e[14]=h):h=e[14];let d;e[15]!==a||e[16]!==n||e[17]!==i?(d=t.jsx(Is,{checked:n,onCheckedChange:i,disabled:a,className:"mt-0.5"}),e[15]=a,e[16]=n,e[17]=i,e[18]=d):d=e[18];let x;return e[19]!==p||e[20]!==h||e[21]!==d?(x=t.jsxs("label",{className:p,children:[h,d]}),e[19]=p,e[20]=h,e[21]=d,e[22]=x):x=e[22],x}function Jl(l){const e=q.c(35),{activeTab:s,onTabChange:n,showSelectAll:i,isAllSelected:a,handleSelectAll:c}=l,r=Z();let p;e[0]!==r?(p=r("virtualMcp.dependencySelectionDialog.tabTools"),e[0]=r,e[1]=p):p=e[1];let o;e[2]!==p?(o={id:"tools",label:p},e[2]=p,e[3]=o):o=e[3];let f;e[4]!==r?(f=r("virtualMcp.dependencySelectionDialog.tabActive"),e[4]=r,e[5]=f):f=e[5];let m;e[6]!==f?(m={id:"active",label:f},e[6]=f,e[7]=m):m=e[7];let u;e[8]!==r?(u=r("virtualMcp.dependencySelectionDialog.tabResources"),e[8]=r,e[9]=u):u=e[9];let h;e[10]!==u?(h={id:"resources",label:u},e[10]=u,e[11]=h):h=e[11];let d;e[12]!==r?(d=r("virtualMcp.dependencySelectionDialog.tabPrompts"),e[12]=r,e[13]=d):d=e[13];let x;e[14]!==d?(x={id:"prompts",label:d},e[14]=d,e[15]=x):x=e[15];let g;e[16]!==o||e[17]!==m||e[18]!==h||e[19]!==x?(g=[o,m,h,x],e[16]=o,e[17]=m,e[18]=h,e[19]=x,e[20]=g):g=e[20];let v;e[21]!==n?(v=S=>n(S),e[21]=n,e[22]=v):v=e[22];let y;e[23]!==s||e[24]!==v||e[25]!==g?(y=t.jsx(Si,{tabs:g,activeTab:s,onTabChange:v}),e[23]=s,e[24]=v,e[25]=g,e[26]=y):y=e[26];let j;e[27]!==c||e[28]!==a||e[29]!==i||e[30]!==r?(j=i&&t.jsx("button",{type:"button",onClick:c,className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:r(a?"virtualMcp.dependencySelectionDialog.deselectAll":"virtualMcp.dependencySelectionDialog.selectAll")}),e[27]=c,e[28]=a,e[29]=i,e[30]=r,e[31]=j):j=e[31];let b;return e[32]!==y||e[33]!==j?(b=t.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-t border-border shrink-0",children:[y,j]}),e[32]=y,e[33]=j,e[34]=b):b=e[34],b}function Ft(l){const e=q.c(13),{items:s,selections:n,onToggle:i,emptyMessage:a,disabled:c}=l;let r,p,o;if(e[0]!==c||e[1]!==a||e[2]!==s||e[3]!==i||e[4]!==n){o=Symbol.for("react.early_return_sentinel");e:{const m=s.map(Zl);if(s.length===0){let u;e[8]!==a?(u=t.jsx("div",{className:"flex-1 overflow-auto px-4 py-3 space-y-1",children:t.jsx("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:a})}),e[8]=a,e[9]=u):u=e[9],o=u;break e}r="flex-1 overflow-auto px-4 py-3 space-y-1",p=s.map(u=>t.jsx(Xs,{item:u,isSelected:n===null||n?.includes(u.id),onToggle:()=>i(u.id,m),disabled:c},u.id))}e[0]=c,e[1]=a,e[2]=s,e[3]=i,e[4]=n,e[5]=r,e[6]=p,e[7]=o}else r=e[5],p=e[6],o=e[7];if(o!==Symbol.for("react.early_return_sentinel"))return o;let f;return e[10]!==r||e[11]!==p?(f=t.jsx("div",{className:r,children:p}),e[10]=r,e[11]=p,e[12]=f):f=e[12],f}function Zl(l){return l.id}function ea(l){const e=q.c(22),{connectionId:s,toolSelections:n,onToggleTool:i}=l,a=Z(),{org:c}=Fe();let r;e[0]!==s||e[1]!==c.id||e[2]!==c.slug?(r={connectionId:s,orgId:c.id,orgSlug:c.slug},e[0]=s,e[1]=c.id,e[2]=c.slug,e[3]=r):r=e[3];const p=pt(r);let o;e[4]!==p?(o={client:p},e[4]=p,e[5]=o):o=e[5];const{data:f}=Fs(o),m=f.tools;let u,h,d;if(e[6]!==f.tools||e[7]!==i||e[8]!==a||e[9]!==n){d=Symbol.for("react.early_return_sentinel");e:{const g=m.map(sa);let v;e[13]!==n?(v=b=>n===null||n.includes(b.name),e[13]=n,e[14]=v):v=e[14];const j=f.tools.filter(v).map(ta);if(j.length===0){let b;e[15]!==a?(b=a("virtualMcp.dependencySelectionDialog.noActiveToolsSelected"),e[15]=a,e[16]=b):b=e[16];let S;e[17]!==b?(S=t.jsx("div",{className:"flex-1 overflow-auto px-4 py-3 space-y-1",children:t.jsx("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:b})}),e[17]=b,e[18]=S):S=e[18],d=S;break e}u="flex-1 overflow-auto px-4 py-3 space-y-1",h=j.map(b=>t.jsx(Xs,{item:b,isSelected:!0,onToggle:()=>i(b.id,g)},b.id))}e[6]=f.tools,e[7]=i,e[8]=a,e[9]=n,e[10]=u,e[11]=h,e[12]=d}else u=e[10],h=e[11],d=e[12];if(d!==Symbol.for("react.early_return_sentinel"))return d;let x;return e[19]!==u||e[20]!==h?(x=t.jsx("div",{className:u,children:h}),e[19]=u,e[20]=h,e[21]=x):x=e[21],x}function ta(l){return{id:l.name,name:l.name,description:l.description,tags:t.jsx(As,{annotations:l.annotations,_meta:l._meta})}}function sa(l){return l.name}function na(l){const e=q.c(16),{connectionId:s,selections:n,onToggle:i,disabled:a}=l,{org:c}=Fe();let r;e[0]!==s||e[1]!==c.id||e[2]!==c.slug?(r={connectionId:s,orgId:c.id,orgSlug:c.slug},e[0]=s,e[1]=c.id,e[2]=c.slug,e[3]=r):r=e[3];const p=pt(r);let o;e[4]!==p?(o={client:p},e[4]=p,e[5]=o):o=e[5];const{data:f}=Fs(o);let m;e[6]!==f.tools?(m=f.tools.map(ia),e[6]=f.tools,e[7]=m):m=e[7];const u=m,h=Z();let d;e[8]!==h?(d=h("virtualMcp.dependencySelectionDialog.noToolsAvailable"),e[8]=h,e[9]=d):d=e[9];let x;return e[10]!==a||e[11]!==u||e[12]!==i||e[13]!==n||e[14]!==d?(x=t.jsx(Ft,{items:u,selections:n,onToggle:i,emptyMessage:d,disabled:a}),e[10]=a,e[11]=u,e[12]=i,e[13]=n,e[14]=d,e[15]=x):x=e[15],x}function ia(l){return{id:l.name,name:l.name,description:l.description,tags:t.jsx(As,{annotations:l.annotations,_meta:l._meta})}}function la(l){const e=q.c(16),{connectionId:s,selections:n,onToggle:i,disabled:a}=l,{org:c}=Fe();let r;e[0]!==s||e[1]!==c.id||e[2]!==c.slug?(r={connectionId:s,orgId:c.id,orgSlug:c.slug},e[0]=s,e[1]=c.id,e[2]=c.slug,e[3]=r):r=e[3];const p=pt(r);let o;e[4]!==p?(o={client:p},e[4]=p,e[5]=o):o=e[5];const{data:f}=an(o);let m;e[6]!==f.resources?(m=f.resources.map(aa),e[6]=f.resources,e[7]=m):m=e[7];const u=m,h=Z();let d;e[8]!==h?(d=h("virtualMcp.dependencySelectionDialog.noResourcesAvailable"),e[8]=h,e[9]=d):d=e[9];let x;return e[10]!==a||e[11]!==u||e[12]!==i||e[13]!==n||e[14]!==d?(x=t.jsx(Ft,{items:u,selections:n,onToggle:i,emptyMessage:d,disabled:a}),e[10]=a,e[11]=u,e[12]=i,e[13]=n,e[14]=d,e[15]=x):x=e[15],x}function aa(l){return{id:l.name||l.uri,name:l.name||l.uri,description:l.description}}function ra(l){const e=q.c(16),{connectionId:s,selections:n,onToggle:i,disabled:a}=l,{org:c}=Fe();let r;e[0]!==s||e[1]!==c.id||e[2]!==c.slug?(r={connectionId:s,orgId:c.id,orgSlug:c.slug},e[0]=s,e[1]=c.id,e[2]=c.slug,e[3]=r):r=e[3];const p=pt(r);let o;e[4]!==p?(o={client:p},e[4]=p,e[5]=o):o=e[5];const{data:f}=Ni(o);let m;e[6]!==f.prompts?(m=f.prompts.map(oa),e[6]=f.prompts,e[7]=m):m=e[7];const u=m,h=Z();let d;e[8]!==h?(d=h("virtualMcp.dependencySelectionDialog.noPromptsAvailable"),e[8]=h,e[9]=d):d=e[9];let x;return e[10]!==a||e[11]!==u||e[12]!==i||e[13]!==n||e[14]!==d?(x=t.jsx(Ft,{items:u,selections:n,onToggle:i,emptyMessage:d,disabled:a}),e[10]=a,e[11]=u,e[12]=i,e[13]=n,e[14]=d,e[15]=x):x=e[15],x}function oa(l){return{id:l.name,name:l.name,description:l.description}}function ca(l){const e=q.c(58),{currentConnection:s,activeTab:n,selectedId:i,formData:a,toggleTool:c,toggleResource:r,togglePrompt:p,toggleAllTools:o,toggleAllResources:f,toggleAllPrompts:m,onTabChange:u}=l,h=Z(),d=a[i],x=n==="tools"?d?.tools===null:n==="resources"?d?.resources===null:n==="prompts"?d?.prompts===null:!1,g=n!=="active";let v;e[0]!==n||e[1]!==i||e[2]!==m||e[3]!==f||e[4]!==o?(v=()=>{n==="tools"?o(i):n==="resources"?f(i):n==="prompts"&&m(i)},e[0]=n,e[1]=i,e[2]=m,e[3]=f,e[4]=o,e[5]=v):v=e[5];const y=v;let j;e[6]!==s.icon||e[7]!==s.title?(j=t.jsx(Ze,{icon:s.icon,name:s.title,size:"sm",className:"shrink-0"}),e[6]=s.icon,e[7]=s.title,e[8]=j):j=e[8];let b;e[9]!==s.title?(b=t.jsx("h2",{className:"text-base font-semibold truncate",children:s.title}),e[9]=s.title,e[10]=b):b=e[10];let S;e[11]!==s.description?(S=s.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s.description}),e[11]=s.description,e[12]=S):S=e[12];let N;e[13]!==b||e[14]!==S?(N=t.jsxs("div",{className:"flex-1 min-w-0",children:[b,S]}),e[13]=b,e[14]=S,e[15]=N):N=e[15];let k;e[16]!==j||e[17]!==N?(k=t.jsx("div",{className:"px-6 pt-5 pb-4 shrink-0",children:t.jsxs("div",{className:"flex items-center gap-3",children:[j,N]})}),e[16]=j,e[17]=N,e[18]=k):k=e[18];let w;e[19]!==n||e[20]!==y||e[21]!==x||e[22]!==u||e[23]!==g?(w=t.jsx(Jl,{activeTab:n,onTabChange:u,showSelectAll:g,isAllSelected:x,handleSelectAll:y}),e[19]=n,e[20]=y,e[21]=x,e[22]=u,e[23]=g,e[24]=w):w=e[24];let C;e[25]!==n||e[26]!==a||e[27]!==i||e[28]!==h||e[29]!==c?(C=n==="active"&&t.jsx(Ye,{fallback:ct(h("virtualMcp.dependencySelectionDialog.toolsNotSupported"),h),children:t.jsx(Q.Suspense,{fallback:t.jsx(st,{}),children:t.jsx(ea,{connectionId:i,toolSelections:a[i]?a[i].tools:[],onToggleTool:(A,P)=>c(i,A,P)})})}),e[25]=n,e[26]=a,e[27]=i,e[28]=h,e[29]=c,e[30]=C):C=e[30];let _;e[31]!==n||e[32]!==a||e[33]!==i||e[34]!==h||e[35]!==c?(_=n==="tools"&&t.jsx(Ye,{fallback:ct(h("virtualMcp.dependencySelectionDialog.toolsNotSupported"),h),children:t.jsx(Q.Suspense,{fallback:t.jsx(st,{}),children:t.jsx(na,{connectionId:i,selections:a[i]?a[i].tools:[],onToggle:(A,P)=>c(i,A,P)})})}),e[31]=n,e[32]=a,e[33]=i,e[34]=h,e[35]=c,e[36]=_):_=e[36];let T;e[37]!==n||e[38]!==a||e[39]!==i||e[40]!==h||e[41]!==r?(T=n==="resources"&&t.jsx(Ye,{fallback:ct(h("virtualMcp.dependencySelectionDialog.resourcesNotSupported"),h),children:t.jsx(Q.Suspense,{fallback:t.jsx(st,{}),children:t.jsx(la,{connectionId:i,selections:a[i]?a[i].resources:[],onToggle:(A,P)=>r(i,A,P)})})}),e[37]=n,e[38]=a,e[39]=i,e[40]=h,e[41]=r,e[42]=T):T=e[42];let V;e[43]!==n||e[44]!==a||e[45]!==i||e[46]!==h||e[47]!==p?(V=n==="prompts"&&t.jsx(Ye,{fallback:ct(h("virtualMcp.dependencySelectionDialog.promptsNotSupported"),h),children:t.jsx(Q.Suspense,{fallback:t.jsx(st,{}),children:t.jsx(ra,{connectionId:i,selections:a[i]?a[i].prompts:[],onToggle:(A,P)=>p(i,A,P)})})}),e[43]=n,e[44]=a,e[45]=i,e[46]=h,e[47]=p,e[48]=V):V=e[48];let $;e[49]!==T||e[50]!==V||e[51]!==C||e[52]!==_?($=t.jsxs("div",{className:"flex-1 overflow-hidden flex flex-col",children:[C,_,T,V]}),e[49]=T,e[50]=V,e[51]=C,e[52]=_,e[53]=$):$=e[53];let D;return e[54]!==$||e[55]!==k||e[56]!==w?(D=t.jsxs(t.Fragment,{children:[k,w,$]}),e[54]=$,e[55]=k,e[56]=w,e[57]=D):D=e[57],D}function da(l){const e=q.c(7),{onClose:s}=l,n=Z();let i;e[0]!==s?(i=()=>s(!1),e[0]=s,e[1]=i):i=e[1];let a;e[2]!==n?(a=n("virtualMcp.dependencySelectionDialog.done"),e[2]=n,e[3]=a):a=e[3];let c;return e[4]!==i||e[5]!==a?(c=t.jsx(Vt,{className:"px-6 py-4 border-t border-border shrink-0",children:t.jsx(te,{variant:"outline",onClick:i,children:a})}),e[4]=i,e[5]=a,e[6]=c):c=e[6],c}function ua(l){const e=q.c(23),{connectionId:s,onAuthenticate:n,children:i}=l,a=Z();let c;e[0]!==s?(c={connectionId:s},e[0]=s,e[1]=c):c=e[1];const r=$s(c);if(r.supportsOAuth&&!r.isAuthenticated){let f;e[2]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx("div",{className:"flex items-center justify-center size-12 rounded-full bg-muted",children:t.jsx(Xn,{size:22,className:"text-muted-foreground"})}),e[2]=f):f=e[2];let m;e[3]!==a?(m=a("virtualMcp.dependencySelectionDialog.authorizationRequired"),e[3]=a,e[4]=m):m=e[4];let u;e[5]!==m?(u=t.jsx("p",{className:"text-sm font-medium",children:m}),e[5]=m,e[6]=u):u=e[6];let h;e[7]!==a?(h=a("virtualMcp.dependencySelectionDialog.authorizationDescription"),e[7]=a,e[8]=h):h=e[8];let d;e[9]!==h?(d=t.jsx("p",{className:"text-xs text-muted-foreground max-w-xs",children:h}),e[9]=h,e[10]=d):d=e[10];let x;e[11]!==u||e[12]!==d?(x=t.jsxs("div",{className:"space-y-1",children:[u,d]}),e[11]=u,e[12]=d,e[13]=x):x=e[13];let g;e[14]!==s||e[15]!==n||e[16]!==a?(g=n&&t.jsx(te,{variant:"outline",size:"sm",onClick:()=>n(s),children:a("virtualMcp.dependencySelectionDialog.authorize")}),e[14]=s,e[15]=n,e[16]=a,e[17]=g):g=e[17];let v;return e[18]!==x||e[19]!==g?(v=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-4 p-8 text-center",children:[f,x,g]}),e[18]=x,e[19]=g,e[20]=v):v=e[20],v}let o;return e[21]!==i?(o=t.jsx(t.Fragment,{children:i}),e[21]=i,e[22]=o):o=e[22],o}function ma(l){const e={};for(const s of l)e[s.connection_id]={tools:s.selected_tools,resources:s.selected_resources??null,prompts:s.selected_prompts??null};return e}function cs(l){return Object.entries(l).map(([e,s])=>({connection_id:e,selected_tools:s.tools,selected_resources:s.resources,selected_prompts:s.prompts}))}function ds(l,e,s,n){const i=l[e]??{tools:null,resources:null,prompts:null};return{...l,[e]:{...i,[s]:n}}}function fa(l,e){return e.type==="SET_ACTIVE_TAB"?{...l,activeTab:e.payload}:l}function pa(l){const e=q.c(49),{open:s,onOpenChange:n,selectedId:i,form:a,connections:c,onAuthenticate:r}=l;let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p={activeTab:"tools"},e[0]=p):p=e[0];const[o,f]=Q.useReducer(fa,p),m=Ot(i??"");let u;e[1]!==c?(u=c??[],e[1]=c,e[2]=u):u=e[2];let h;e[3]!==u?(h=ma(u),e[3]=u,e[4]=h):h=e[4];const d=h;let x;e[5]!==a||e[6]!==d?(x=(z,M,O,G)=>{const R=d[z]?.[M];let F;R===null?F=G.filter(W=>W!==O):R?.includes(O)?F=R.filter(W=>W!==O):(F=[...R??[],O],F.length===G.length&&(F=null)),a.setValue("connections",cs(ds(d,z,M,F)),{shouldDirty:!0,shouldTouch:!0})},e[5]=a,e[6]=d,e[7]=x):x=e[7];const g=x;let v;e[8]!==a||e[9]!==d?(v=(z,M)=>{const G=d[z]?.[M]===null?[]:null;a.setValue("connections",cs(ds(d,z,M,G)),{shouldDirty:!0,shouldTouch:!0})},e[8]=a,e[9]=d,e[10]=v):v=e[10];const y=v;let j;e[11]!==g?(j=(z,M,O)=>g(z,"tools",M,O),e[11]=g,e[12]=j):j=e[12];const b=j;let S;e[13]!==g?(S=(z,M,O)=>g(z,"resources",M,O),e[13]=g,e[14]=S):S=e[14];const N=S;let k;e[15]!==g?(k=(z,M,O)=>g(z,"prompts",M,O),e[15]=g,e[16]=k):k=e[16];const w=k;let C;e[17]!==y?(C=z=>y(z,"tools"),e[17]=y,e[18]=C):C=e[18];const _=C;let T;e[19]!==y?(T=z=>y(z,"resources"),e[19]=y,e[20]=T):T=e[20];const V=T;let $;e[21]!==y?($=z=>y(z,"prompts"),e[21]=y,e[22]=$):$=e[22];const D=$;if(!i||!m)return null;let A;e[23]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(st,{}),e[23]=A):A=e[23];let P;e[24]===Symbol.for("react.memo_cache_sentinel")?(P=z=>f({type:"SET_ACTIVE_TAB",payload:z}),e[24]=P):P=e[24];let E;e[25]!==m||e[26]!==o.activeTab||e[27]!==d||e[28]!==i||e[29]!==D||e[30]!==V||e[31]!==_||e[32]!==w||e[33]!==N||e[34]!==b?(E=t.jsx(ca,{currentConnection:m,activeTab:o.activeTab,selectedId:i,formData:d,toggleTool:b,toggleResource:N,togglePrompt:w,toggleAllTools:_,toggleAllResources:V,toggleAllPrompts:D,onTabChange:P},i),e[25]=m,e[26]=o.activeTab,e[27]=d,e[28]=i,e[29]=D,e[30]=V,e[31]=_,e[32]=w,e[33]=N,e[34]=b,e[35]=E):E=e[35];let U;e[36]!==r||e[37]!==i||e[38]!==E?(U=t.jsx(Q.Suspense,{fallback:A,children:t.jsx(ua,{connectionId:i,onAuthenticate:r,children:E})}),e[36]=r,e[37]=i,e[38]=E,e[39]=U):U=e[39];let K;e[40]!==n?(K=t.jsx(da,{onClose:n}),e[40]=n,e[41]=K):K=e[41];let Y;e[42]!==U||e[43]!==K?(Y=t.jsxs(Je,{className:"sm:max-w-2xl h-[75vh] max-h-[75vh] flex flex-col p-0 gap-0 overflow-hidden w-[95vw]",children:[U,K]}),e[42]=U,e[43]=K,e[44]=Y):Y=e[44];let B;return e[45]!==n||e[46]!==s||e[47]!==Y?(B=t.jsx(Xe,{open:s,onOpenChange:n,children:Y}),e[45]=n,e[46]=s,e[47]=Y,e[48]=B):B=e[48],B}const us="__new_instance__";function ha(l){const e=q.c(25),{connection_id:s,usedConnectionIds:n,onOpenSettings:i,onRemove:a,onAuthenticate:c,onSwitchInstance:r,onNewInstance:p}=l,o=Ot(s),{org:f}=Fe();if(!o){let g;return e[0]!==a?(g=t.jsx(ba,{onRemove:a}),e[0]=a,e[1]=g):g=e[1],g}let m;e[2]!==o?(m=Ci(o),e[2]=o,e[3]=m):m=e[3];const u=m;let h;e[4]!==s?(h=t.jsx(va,{connection_id:s}),e[4]=s,e[5]=h):h=e[5];let d;e[6]!==o.app_name||e[7]!==o.connection_type||e[8]!==o.description||e[9]!==o.icon||e[10]!==o.status||e[11]!==o.title||e[12]!==s||e[13]!==c||e[14]!==p||e[15]!==i||e[16]!==a||e[17]!==r||e[18]!==f.slug||e[19]!==u||e[20]!==n?(d=t.jsx(ga,{connection_id:s,connectionTitle:o.title,connectionDescription:o.description,connectionIcon:o.icon,connectionType:o.connection_type,connectionStatus:o.status,slug:u,orgSlug:f.slug,appName:o.app_name,usedConnectionIds:n,onOpenSettings:i,onRemove:a,onAuthenticate:c,onSwitchInstance:r,onNewInstance:p}),e[6]=o.app_name,e[7]=o.connection_type,e[8]=o.description,e[9]=o.icon,e[10]=o.status,e[11]=o.title,e[12]=s,e[13]=c,e[14]=p,e[15]=i,e[16]=a,e[17]=r,e[18]=f.slug,e[19]=u,e[20]=n,e[21]=d):d=e[21];let x;return e[22]!==h||e[23]!==d?(x=t.jsx(Q.Suspense,{fallback:h,children:d}),e[22]=h,e[23]=d,e[24]=x):x=e[24],x}function xa(l){const e=q.c(24),{appName:s,connectionId:n,usedConnectionIds:i,onSwitchInstance:a,onNewInstance:c}=l,r=Z();let p;e[0]!==s?(p={filters:[{column:"app_name",value:s}]},e[0]=s,e[1]=p):p=e[1];const o=Wn(p);if(o.length<=1&&!c)return null;let f;e[2]!==n||e[3]!==c||e[4]!==a?(f=g=>{g===us?c?.():a(n,g)},e[2]=n,e[3]=c,e[4]=a,e[5]=f):f=e[5];let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(Oe,{size:"sm",className:"w-auto text-xs gap-1 px-2 shadow-none",children:t.jsx(Ie,{})}),e[6]=m):m=e[6];let u;if(e[7]!==n||e[8]!==o||e[9]!==i){let g;e[11]!==n||e[12]!==i?(g=v=>t.jsx(we,{value:v.id,className:"text-xs",disabled:v.id!==n&&i.has(v.id),children:v.title},v.id),e[11]=n,e[12]=i,e[13]=g):g=e[13],u=o.map(g),e[7]=n,e[8]=o,e[9]=i,e[10]=u}else u=e[10];let h;e[14]!==c||e[15]!==r?(h=c&&t.jsxs(we,{value:us,className:"text-xs text-muted-foreground",children:["+ ",r("virtualMcp.connectionItem.newInstance")]}),e[14]=c,e[15]=r,e[16]=h):h=e[16];let d;e[17]!==u||e[18]!==h?(d=t.jsxs(Ae,{children:[u,h]}),e[17]=u,e[18]=h,e[19]=d):d=e[19];let x;return e[20]!==n||e[21]!==f||e[22]!==d?(x=t.jsxs($e,{value:n,onValueChange:f,children:[m,d]}),e[20]=n,e[21]=f,e[22]=d,e[23]=x):x=e[23],x}function ga({connection_id:l,connectionTitle:e,connectionDescription:s,connectionIcon:n,connectionType:i,connectionStatus:a,slug:c,orgSlug:r,appName:p,usedConnectionIds:o,onOpenSettings:f,onRemove:m,onAuthenticate:u,onSwitchInstance:h,onNewInstance:d}){const x=$s({connectionId:l}),g=Ms(),y=!(i==="VIRTUAL")&&x.supportsOAuth&&!x.isAuthenticated,j=a!=="active",b=Z(),S=async N=>{try{await g.update.mutateAsync({id:l,data:{status:N}}),oe.success(b(N==="active"?"virtualMcp.connectionItem.connectionEnabled":"virtualMcp.connectionItem.connectionDisabled"))}catch{oe.error(b("virtualMcp.connectionItem.failedToUpdateConnection"))}};return t.jsxs("div",{className:ve("rounded-xl border overflow-hidden transition-colors",y||j?"border-destructive/50 bg-destructive/5":"border-border bg-card"),children:[t.jsxs(ws,{to:"/$org/settings/connections/$appSlug",params:{org:r,appSlug:c},className:"flex items-center gap-3 px-4 py-3 cursor-pointer hover:bg-muted/50 transition-colors",children:[t.jsx(Ze,{icon:n,name:e,size:"sm",className:"shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:e}),y?t.jsx("span",{className:"text-xs text-destructive font-medium",children:b("virtualMcp.connectionItem.needsAuthorization")}):j?t.jsx("span",{className:"text-xs text-destructive font-medium",children:b(a==="error"?"virtualMcp.connectionItem.disabledError":"virtualMcp.connectionItem.disabled")}):s&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s})]}),y?t.jsx(te,{variant:"outline",size:"sm",className:"h-7 text-xs shrink-0",onClick:N=>{N.preventDefault(),N.stopPropagation(),u(l)},children:b("virtualMcp.connectionItem.authorize")}):j?t.jsxs(te,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5 shrink-0",onClick:N=>{N.preventDefault(),N.stopPropagation(),S("active")},children:[t.jsx(Jn,{size:13}),b("virtualMcp.connectionItem.enable")]}):t.jsxs(Se,{delayDuration:0,children:[t.jsx(Ne,{asChild:!0,children:t.jsx("span",{className:"inline-flex items-center justify-center rounded-md h-7 w-7 hover:bg-accent text-muted-foreground shrink-0 transition-colors",children:t.jsx(xi,{size:16})})}),t.jsx(Ce,{side:"bottom",children:b("virtualMcp.connectionItem.connectionSettings")})]})]}),t.jsxs("div",{className:"flex items-center gap-3 px-4 py-2 border-t border-border bg-muted/25",children:[p&&t.jsx(xa,{appName:p,connectionId:l,usedConnectionIds:o,onSwitchInstance:h,onNewInstance:d}),t.jsxs("div",{className:"flex items-center gap-0.5 ml-auto",children:[t.jsxs(Se,{delayDuration:0,children:[t.jsx(Ne,{asChild:!0,children:t.jsx(te,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:f,"aria-label":b("virtualMcp.connectionItem.configureResources"),children:t.jsx(Zn,{size:13})})}),t.jsx(Ce,{side:"bottom",children:b("virtualMcp.connectionItem.configureResources")})]}),!j&&t.jsxs(Se,{delayDuration:0,children:[t.jsx(Ne,{asChild:!0,children:t.jsx(te,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:()=>S("inactive"),"aria-label":b("virtualMcp.connectionItem.disableConnection"),children:t.jsx(ei,{size:13})})}),t.jsx(Ce,{side:"bottom",children:b("virtualMcp.connectionItem.disable")})]}),t.jsxs(Se,{delayDuration:0,children:[t.jsx(Ne,{asChild:!0,children:t.jsx(te,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:m,"aria-label":b("virtualMcp.connectionItem.removeConnection"),children:t.jsx(At,{size:13})})}),t.jsx(Ce,{side:"bottom",children:b("virtualMcp.connectionItem.remove")})]})]})]})]})}function va(l){const e=q.c(17),{connection_id:s}=l,n=Ot(s);if(!n){let m;return e[0]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(Js,{}),e[0]=m):m=e[0],m}let i;e[1]!==n.icon||e[2]!==n.title?(i=t.jsx(Ze,{icon:n.icon,name:n.title,size:"sm",className:"shrink-0"}),e[1]=n.icon,e[2]=n.title,e[3]=i):i=e[3];let a;e[4]!==n.title?(a=t.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[4]=n.title,e[5]=a):a=e[5];let c;e[6]!==n.description?(c=n.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:n.description}),e[6]=n.description,e[7]=c):c=e[7];let r;e[8]!==a||e[9]!==c?(r=t.jsxs("div",{className:"flex-1 min-w-0",children:[a,c]}),e[8]=a,e[9]=c,e[10]=r):r=e[10];let p;e[11]!==i||e[12]!==r?(p=t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",children:[i,r]}),e[11]=i,e[12]=r,e[13]=p):p=e[13];let o;e[14]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("div",{className:"flex items-center px-4 py-2 border-t border-border bg-muted/25",children:t.jsx("div",{className:"h-5 w-20 rounded bg-muted animate-pulse"})}),e[14]=o):o=e[14];let f;return e[15]!==p?(f=t.jsxs("div",{className:"rounded-xl border border-border overflow-hidden",children:[p,o]}),e[15]=p,e[16]=f):f=e[16],f}function ba(l){const e=q.c(20),{onRemove:s}=l,n=Z();let i;e[0]!==n?(i=n("virtualMcp.connectionItem.connectionNotFound"),e[0]=n,e[1]=i):i=e[1];let a;e[2]!==i?(a=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm text-destructive font-medium truncate",children:i})}),e[2]=i,e[3]=a):a=e[3];let c;e[4]!==n?(c=n("virtualMcp.connectionItem.removeConnection"),e[4]=n,e[5]=c):c=e[5];let r;e[6]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(At,{size:13}),e[6]=r):r=e[6];let p;e[7]!==s||e[8]!==c?(p=t.jsx(Ne,{asChild:!0,children:t.jsx(te,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive shrink-0",onClick:s,"aria-label":c,children:r})}),e[7]=s,e[8]=c,e[9]=p):p=e[9];let o;e[10]!==n?(o=n("virtualMcp.connectionItem.remove"),e[10]=n,e[11]=o):o=e[11];let f;e[12]!==o?(f=t.jsx(Ce,{side:"bottom",children:o}),e[12]=o,e[13]=f):f=e[13];let m;e[14]!==p||e[15]!==f?(m=t.jsxs(Se,{delayDuration:0,children:[p,f]}),e[14]=p,e[15]=f,e[16]=m):m=e[16];let u;return e[17]!==a||e[18]!==m?(u=t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 rounded-xl border border-destructive/50 bg-destructive/5",children:[a,m]}),e[17]=a,e[18]=m,e[19]=u):u=e[19],u}function Js(){const l=q.c(3);let e;l[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"size-8 rounded-md bg-muted animate-pulse shrink-0"}),l[0]=e):e=l[0];let s;l[1]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",children:[e,t.jsxs("div",{className:"flex-1 space-y-1.5",children:[t.jsx("div",{className:"h-4 w-32 rounded bg-muted animate-pulse"}),t.jsx("div",{className:"h-3 w-48 rounded bg-muted animate-pulse"})]})]}),l[1]=s):s=l[1];let n;return l[2]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsxs("div",{className:"rounded-xl border border-border overflow-hidden",children:[s,t.jsx("div",{className:"flex items-center px-4 py-2 border-t border-border bg-muted/25",children:t.jsx("div",{className:"h-5 w-20 rounded bg-muted animate-pulse"})})]}),l[2]=n):n=l[2],n}function Zs(l){const e=q.c(85),{value:s,onChange:n,onColorChange:i,name:a,size:c,className:r,avatarClassName:p,showHoverOverlay:o,disabled:f}=l,m=c===void 0?"lg":c,u=o===void 0?!0:o,h=f===void 0?!1:f,d=Z(),[x,g]=Q.useState(!1),[v,y]=Q.useState("icons"),[j,b]=Q.useState(""),[S,N]=Q.useState("blue");let k;e[0]!==s?(k=ti(s),e[0]=s,e[1]=k):k=e[1];const w=k,C=w.type==="icon"||w.type==="url"&&w.color?w.color:S;let _;e[2]!==n||e[3]!==C?(_=ee=>{n(jt(ee,C))},e[2]=n,e[3]=C,e[4]=_):_=e[4];const T=_;let V;e[5]!==n||e[6]!==i||e[7]!==w.name||e[8]!==w.type||e[9]!==w.url?(V=ee=>{N(ee),i?.(ee),w.type==="icon"?n(jt(w.name,ee)):w.type==="url"&&n(qt(w.url,ee))},e[5]=n,e[6]=i,e[7]=w.name,e[8]=w.type,e[9]=w.url,e[10]=V):V=e[10];const $=V;let D;e[11]!==n||e[12]!==C?(D=ee=>{n(qt(ee,C)),g(!1)},e[11]=n,e[12]=C,e[13]=D):D=e[13];const A=D;let P;e[14]!==n||e[15]!==C?(P=()=>{const ee=Ts(),J=ee[Math.floor(Math.random()*ee.length)];n(jt(J,C))},e[14]=n,e[15]=C,e[16]=P):P=e[16];const E=P,U=h?!1:x;let K;e[17]!==d?(K=d("common.iconPicker.changeIcon"),e[17]=d,e[18]=K):K=e[18];const Y=h?"cursor-default opacity-50":"cursor-pointer";let B;e[19]!==r||e[20]!==m||e[21]!==Y?(B=ve("relative group overflow-hidden",Y,si(m),r),e[19]=r,e[20]=m,e[21]=Y,e[22]=B):B=e[22];let z;e[23]!==p||e[24]!==a||e[25]!==m||e[26]!==s?(z=t.jsx(Ht,{icon:s,name:a,size:m,className:p}),e[23]=p,e[24]=a,e[25]=m,e[26]=s,e[27]=z):z=e[27];let M;e[28]!==h||e[29]!==u?(M=u&&!h&&t.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity",children:t.jsx(ai,{size:16,className:"text-white"})}),e[28]=h,e[29]=u,e[30]=M):M=e[30];let O;e[31]!==h||e[32]!==K||e[33]!==B||e[34]!==z||e[35]!==M?(O=t.jsx(Es,{asChild:!0,children:t.jsxs("button",{type:"button","data-testid":"icon-picker-trigger","aria-label":K,disabled:h,className:B,children:[z,M]})}),e[31]=h,e[32]=K,e[33]=B,e[34]=z,e[35]=M,e[36]=O):O=e[36];let G;e[37]!==a||e[38]!==s?(G=t.jsx("div",{className:"flex items-center justify-center py-4",children:t.jsx(Ht,{icon:s,name:a,size:"xl"})}),e[37]=a,e[38]=s,e[39]=G):G=e[39];let R;e[40]!==v?(R=ee=>{if(ee.key!=="ArrowLeft"&&ee.key!=="ArrowRight")return;ee.preventDefault();const J=v==="icons"?"upload":"icons";y(J),document.getElementById(`icon-picker-tab-${J}`)?.focus()},e[40]=v,e[41]=R):R=e[41];const F=v==="icons",W=v==="icons"?0:-1;let H;e[42]===Symbol.for("react.memo_cache_sentinel")?(H=()=>y("icons"),e[42]=H):H=e[42];const se=v==="icons"?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground";let le;e[43]!==se?(le=ve("px-3 py-2 text-sm font-medium border-b-2 -mb-px transition-colors",se),e[43]=se,e[44]=le):le=e[44];let ce;e[45]!==d?(ce=d("common.iconPicker.iconsTab"),e[45]=d,e[46]=ce):ce=e[46];let ae;e[47]!==F||e[48]!==W||e[49]!==le||e[50]!==ce?(ae=t.jsx("button",{id:"icon-picker-tab-icons",type:"button",role:"tab","aria-selected":F,"aria-controls":"icon-picker-panel-icons",tabIndex:W,onClick:H,className:le,children:ce}),e[47]=F,e[48]=W,e[49]=le,e[50]=ce,e[51]=ae):ae=e[51];const ie=v==="upload",X=v==="upload"?0:-1;let de;e[52]===Symbol.for("react.memo_cache_sentinel")?(de=()=>y("upload"),e[52]=de):de=e[52];const ue=v==="upload"?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground";let he;e[53]!==ue?(he=ve("px-3 py-2 text-sm font-medium border-b-2 -mb-px transition-colors",ue),e[53]=ue,e[54]=he):he=e[54];let me;e[55]!==d?(me=d("common.iconPicker.uploadTab"),e[55]=d,e[56]=me):me=e[56];let xe;e[57]!==ie||e[58]!==X||e[59]!==he||e[60]!==me?(xe=t.jsx("button",{id:"icon-picker-tab-upload",type:"button",role:"tab","aria-selected":ie,"aria-controls":"icon-picker-panel-upload",tabIndex:X,onClick:de,className:he,children:me}),e[57]=ie,e[58]=X,e[59]=he,e[60]=me,e[61]=xe):xe=e[61];let ge;e[62]===Symbol.for("react.memo_cache_sentinel")?(ge=t.jsx("div",{className:"flex-1"}),e[62]=ge):ge=e[62];let fe;e[63]!==R||e[64]!==ae||e[65]!==xe?(fe=t.jsxs("div",{role:"tablist","aria-label":"Icon source",className:"flex items-center border-b border-border px-3",onKeyDown:R,children:[ae,xe,ge]}),e[63]=R,e[64]=ae,e[65]=xe,e[66]=fe):fe=e[66];let I;e[67]!==$||e[68]!==E||e[69]!==T||e[70]!==A||e[71]!==w.name||e[72]!==w.type||e[73]!==j||e[74]!==C||e[75]!==v?(I=v==="icons"?t.jsx("div",{id:"icon-picker-panel-icons",role:"tabpanel","aria-labelledby":"icon-picker-tab-icons",children:t.jsx(Sa,{search:j,onSearchChange:b,selectedColor:C,onColorChange:$,onSelectIcon:T,onRandom:E,currentIconName:w.type==="icon"?w.name:null})}):t.jsx("div",{id:"icon-picker-panel-upload",role:"tabpanel","aria-labelledby":"icon-picker-tab-upload",children:t.jsx(Na,{onUpload:A})}),e[67]=$,e[68]=E,e[69]=T,e[70]=A,e[71]=w.name,e[72]=w.type,e[73]=j,e[74]=C,e[75]=v,e[76]=I):I=e[76];let ne;e[77]!==G||e[78]!==fe||e[79]!==I?(ne=t.jsx(zs,{align:"start",className:"w-80 p-0",onOpenAutoFocus:ja,children:t.jsxs("div",{className:"flex flex-col",children:[G,fe,I]})}),e[77]=G,e[78]=fe,e[79]=I,e[80]=ne):ne=e[80];let L;return e[81]!==O||e[82]!==ne||e[83]!==U?(L=t.jsxs(Rs,{open:U,onOpenChange:g,children:[O,ne]}),e[81]=O,e[82]=ne,e[83]=U,e[84]=L):L=e[84],L}function ja(l){return l.preventDefault()}function ya(l){const e=q.c(33),{selectedColor:s,onColorChange:n}=l,i=Z(),[a,c]=Q.useState(!1);let r,p,o,f,m,u,h;if(e[0]!==a||e[1]!==s){const S=Ds(s);p=Rs,u=a,h=c,r=Es,m=!0,o="button",f=ve("h-6 w-6 rounded-full shrink-0 ring-2 ring-offset-2 ring-offset-background transition-all cursor-pointer hover:scale-110",S.dot,"ring-foreground/20"),e[0]=a,e[1]=s,e[2]=r,e[3]=p,e[4]=o,e[5]=f,e[6]=m,e[7]=u,e[8]=h}else r=e[2],p=e[3],o=e[4],f=e[5],m=e[6],u=e[7],h=e[8];let d;e[9]!==i?(d=i("common.iconPicker.changeColor"),e[9]=i,e[10]=d):d=e[10];let x;e[11]!==i?(x=i("common.iconPicker.changeColor"),e[11]=i,e[12]=x):x=e[12];let g;e[13]!==o||e[14]!==f||e[15]!==d||e[16]!==x?(g=t.jsx("button",{type:o,className:f,title:d,"aria-label":x}),e[13]=o,e[14]=f,e[15]=d,e[16]=x,e[17]=g):g=e[17];let v;e[18]!==r||e[19]!==m||e[20]!==g?(v=t.jsx(r,{asChild:m,children:g}),e[18]=r,e[19]=m,e[20]=g,e[21]=v):v=e[21];let y;e[22]!==n||e[23]!==s?(y=oi.map(S=>t.jsx("button",{type:"button",onClick:()=>{n(S.name),c(!1)},className:ve("h-5 w-5 rounded-full transition-all shrink-0 cursor-pointer",S.dot,s===S.name?"ring-2 ring-offset-1 ring-offset-background ring-foreground/30 scale-110":"hover:scale-110"),title:S.name,"aria-label":S.name},S.name)),e[22]=n,e[23]=s,e[24]=y):y=e[24];let j;e[25]!==y?(j=t.jsx(zs,{align:"start",side:"right",sideOffset:8,className:"w-auto p-2",onOpenAutoFocus:wa,children:t.jsx("div",{className:"grid grid-cols-4 gap-1",children:y})}),e[25]=y,e[26]=j):j=e[26];let b;return e[27]!==p||e[28]!==j||e[29]!==u||e[30]!==h||e[31]!==v?(b=t.jsxs(p,{open:u,onOpenChange:h,children:[v,j]}),e[27]=p,e[28]=j,e[29]=u,e[30]=h,e[31]=v,e[32]=b):b=e[32],b}function wa(l){return l.preventDefault()}function Sa(l){const e=q.c(55),{search:s,onSearchChange:n,selectedColor:i,onColorChange:a,onSelectIcon:c,onRandom:r,currentIconName:p}=l,o=Z();let f,m,u,h,d,x,g;if(e[0]!==p||e[1]!==a||e[2]!==r||e[3]!==n||e[4]!==c||e[5]!==s||e[6]!==i||e[7]!==o){const S=Ts(),N=Ds(i);m=ni(S,s),x="flex flex-col";let k;e[15]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(Ct,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none"}),e[15]=k):k=e[15];let w;e[16]!==n?(w=P=>n(P.target.value),e[16]=n,e[17]=w):w=e[17];let C;e[18]!==o?(C=o("common.iconPicker.filterPlaceholder"),e[18]=o,e[19]=C):C=e[19];let _;e[20]!==s||e[21]!==w||e[22]!==C?(_=t.jsxs("div",{className:"relative flex-1",children:[k,t.jsx(ke,{value:s,onChange:w,placeholder:C,className:"h-8 text-xs pl-7"})]}),e[20]=s,e[21]=w,e[22]=C,e[23]=_):_=e[23];let T;e[24]!==o?(T=o("common.iconPicker.randomIcon"),e[24]=o,e[25]=T):T=e[25];let V;e[26]!==o?(V=o("common.iconPicker.randomIcon"),e[26]=o,e[27]=V):V=e[27];let $;e[28]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(ri,{size:14,className:"text-muted-foreground"}),e[28]=$):$=e[28];let D;e[29]!==r||e[30]!==T||e[31]!==V?(D=t.jsx("button",{type:"button",onClick:r,className:"h-8 w-8 flex items-center justify-center rounded-lg border border-border hover:bg-accent transition-colors shrink-0",title:T,"aria-label":V,children:$}),e[29]=r,e[30]=T,e[31]=V,e[32]=D):D=e[32];let A;e[33]!==a||e[34]!==i?(A=t.jsx(ya,{selectedColor:i,onColorChange:a}),e[33]=a,e[34]=i,e[35]=A):A=e[35],e[36]!==D||e[37]!==A||e[38]!==_?(g=t.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",children:[_,D,A]}),e[36]=D,e[37]=A,e[38]=_,e[39]=g):g=e[39],f=ki,d="h-56",u="grid grid-cols-9 gap-0.5 px-2 pb-2",h=m.map(P=>{const E=ii(P);return E?t.jsx("button",{type:"button",onClick:()=>c(P),className:ve("h-8 w-8 flex items-center justify-center rounded-lg transition-colors cursor-pointer",p===P?ve(N.bg,N.text):ve(N.text,"hover:bg-accent")),title:P,"aria-label":li(P),children:t.jsx(E,{size:18})},P):null}),e[0]=p,e[1]=a,e[2]=r,e[3]=n,e[4]=c,e[5]=s,e[6]=i,e[7]=o,e[8]=f,e[9]=m,e[10]=u,e[11]=h,e[12]=d,e[13]=x,e[14]=g}else f=e[8],m=e[9],u=e[10],h=e[11],d=e[12],x=e[13],g=e[14];let v;e[40]!==u||e[41]!==h?(v=t.jsx("div",{className:u,children:h}),e[40]=u,e[41]=h,e[42]=v):v=e[42];let y;e[43]!==m.length||e[44]!==o?(y=m.length===0&&t.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:o("common.iconPicker.noIconsFound")}),e[43]=m.length,e[44]=o,e[45]=y):y=e[45];let j;e[46]!==f||e[47]!==d||e[48]!==v||e[49]!==y?(j=t.jsxs(f,{className:d,children:[v,y]}),e[46]=f,e[47]=d,e[48]=v,e[49]=y,e[50]=j):j=e[50];let b;return e[51]!==x||e[52]!==g||e[53]!==j?(b=t.jsxs("div",{className:x,children:[g,j]}),e[51]=x,e[52]=g,e[53]=j,e[54]=b):b=e[54],b}function Na(l){const e=q.c(46),{onUpload:s}=l,n=Z(),i=Q.useRef(null);let a;e[0]!==s||e[1]!==n?(a=D=>{const A=D.target.files?.[0];if(!A)return;if(A.size>2097152){oe.error(n("common.iconPicker.imageTooLarge")),D.target.value="";return}const P=new FileReader;P.onerror=()=>{oe.error(n("common.iconPicker.failedToReadImage")),i.current&&(i.current.value="")},P.onloadend=()=>{P.readyState===FileReader.DONE&&P.result&&s(P.result),i.current&&(i.current.value="")},P.readAsDataURL(A)},e[0]=s,e[1]=n,e[2]=a):a=e[2];const c=a,[r,p]=Q.useState("");let o;e[3]!==s||e[4]!==r?(o=()=>{const D=r.trim();D&&(s(D),p(""))},e[3]=s,e[4]=r,e[5]=o):o=e[5];const f=o;let m;e[6]!==c?(m=t.jsx("input",{type:"file",ref:i,className:"hidden",accept:"image/*",onChange:c}),e[6]=c,e[7]=m):m=e[7];let u;e[8]===Symbol.for("react.memo_cache_sentinel")?(u=()=>i.current?.click(),e[8]=u):u=e[8];let h;e[9]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(Mi,{size:20}),e[9]=h):h=e[9];let d;e[10]!==n?(d=n("common.iconPicker.uploadHint"),e[10]=n,e[11]=d):d=e[11];let x;e[12]!==d?(x=t.jsxs("button",{type:"button",onClick:u,className:"h-24 rounded-lg border-2 border-dashed border-border hover:border-foreground/50 hover:bg-accent/50 transition-colors flex flex-col items-center justify-center gap-2 text-muted-foreground hover:text-foreground",children:[h,t.jsx("span",{className:"text-xs",children:d})]}),e[12]=d,e[13]=x):x=e[13];let g;e[14]!==n?(g=n("common.iconPicker.or"),e[14]=n,e[15]=g):g=e[15];let v;e[16]!==g?(v=t.jsx("span",{className:"text-xs text-muted-foreground",children:g}),e[16]=g,e[17]=v):v=e[17];let y;e[18]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx("div",{className:"flex-1 h-px bg-border"}),e[18]=y):y=e[18];let j;e[19]!==v?(j=t.jsxs("div",{className:"flex items-center gap-2",children:[v,y]}),e[19]=v,e[20]=j):j=e[20];let b;e[21]===Symbol.for("react.memo_cache_sentinel")?(b=D=>p(D.target.value),e[21]=b):b=e[21];let S;e[22]!==n?(S=n("common.iconPicker.pasteUrlPlaceholder"),e[22]=n,e[23]=S):S=e[23];let N;e[24]!==f?(N=D=>{D.key==="Enter"&&(D.preventDefault(),f())},e[24]=f,e[25]=N):N=e[25];let k;e[26]!==r||e[27]!==S||e[28]!==N?(k=t.jsx(ke,{value:r,onChange:b,placeholder:S,className:"h-8 text-xs flex-1",onKeyDown:N}),e[26]=r,e[27]=S,e[28]=N,e[29]=k):k=e[29];let w;e[30]!==r?(w=r.trim(),e[30]=r,e[31]=w):w=e[31];const C=!w;let _;e[32]!==n?(_=n("common.iconPicker.apply"),e[32]=n,e[33]=_):_=e[33];let T;e[34]!==f||e[35]!==C||e[36]!==_?(T=t.jsx(te,{variant:"outline",size:"sm",className:"h-8 px-3 text-xs shrink-0",onClick:f,disabled:C,children:_}),e[34]=f,e[35]=C,e[36]=_,e[37]=T):T=e[37];let V;e[38]!==k||e[39]!==T?(V=t.jsxs("div",{className:"flex items-center gap-1.5",children:[k,T]}),e[38]=k,e[39]=T,e[40]=V):V=e[40];let $;return e[41]!==j||e[42]!==V||e[43]!==m||e[44]!==x?($=t.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[m,x,j,V]}),e[41]=j,e[42]=V,e[43]=m,e[44]=x,e[45]=$):$=e[45],$}function Ca(l){const e=q.c(11),{viewId:s}=l;if(s==="overview"){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Ps,{size:16}),e[0]=i):i=e[0],i}if(s==="reports"){let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Qt,{size:16}),e[1]=i):i=e[1],i}if(s==="board"){let i;return e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(ci,{size:16}),e[2]=i):i=e[2],i}if(s==="site-editor"){let i;return e[3]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Ti,{size:16}),e[3]=i):i=e[3],i}if(s==="assets"){let i;return e[4]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Vi,{size:16}),e[4]=i):i=e[4],i}if(s==="releases"){let i;return e[5]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(di,{size:16}),e[5]=i):i=e[5],i}if(s==="hosting"){let i;return e[6]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(rn,{size:16}),e[6]=i):i=e[6],i}if(s==="e2e"){let i;return e[7]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(ui,{size:16}),e[7]=i):i=e[7],i}if(s==="analytics"){let i;return e[8]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Qt,{size:16}),e[8]=i):i=e[8],i}if(s==="cdn"){let i;return e[9]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(mi,{size:16}),e[9]=i):i=e[9],i}let n;return e[10]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(Os,{size:16}),e[10]=n):n=e[10],n}function ms(l){const e=q.c(51),{pinned:s,canSetMainView:n,onOpen:i,onTogglePin:a,onSetMainView:c}=l,r=Z(),p=s?"text-foreground":"text-muted-foreground/40";let o;e[0]!==p?(o=ve("size-7",p),e[0]=p,e[1]=o):o=e[1];let f;e[2]!==s||e[3]!==r?(f=r(s?"virtualMcp.settings.views.unpin":"virtualMcp.settings.views.pin"),e[2]=s,e[3]=r,e[4]=f):f=e[4];let m;e[5]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(Xt,{size:16}),e[5]=m):m=e[5];let u;e[6]!==a||e[7]!==s||e[8]!==o||e[9]!==f?(u=t.jsx(Ne,{asChild:!0,children:t.jsx(te,{variant:"ghost",size:"icon",className:o,"aria-label":f,"aria-pressed":s,onClick:a,children:m})}),e[6]=a,e[7]=s,e[8]=o,e[9]=f,e[10]=u):u=e[10];let h;e[11]!==s||e[12]!==r?(h=r(s?"virtualMcp.settings.views.unpin":"virtualMcp.settings.views.pin"),e[11]=s,e[12]=r,e[13]=h):h=e[13];let d;e[14]!==h?(d=t.jsx(Ce,{side:"top",children:h}),e[14]=h,e[15]=d):d=e[15];let x;e[16]!==u||e[17]!==d?(x=t.jsxs(Se,{delayDuration:0,children:[u,d]}),e[16]=u,e[17]=d,e[18]=x):x=e[18];let g;e[19]!==r?(g=r("virtualMcp.settings.views.rowActions"),e[19]=r,e[20]=g):g=e[20];let v;e[21]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(_i,{size:16}),e[21]=v):v=e[21];let y;e[22]!==g?(y=t.jsx(bs,{asChild:!0,children:t.jsx(te,{variant:"ghost",size:"icon",className:"size-7 text-muted-foreground","aria-label":g,children:v})}),e[22]=g,e[23]=y):y=e[23];let j;e[24]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(on,{size:14}),e[24]=j):j=e[24];let b;e[25]!==r?(b=r("virtualMcp.settings.views.open"),e[25]=r,e[26]=b):b=e[26];let S;e[27]!==i||e[28]!==b?(S=t.jsxs(He,{onClick:i,children:[j,b]}),e[27]=i,e[28]=b,e[29]=S):S=e[29];let N;e[30]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(Xt,{size:14}),e[30]=N):N=e[30];let k;e[31]!==s||e[32]!==r?(k=r(s?"virtualMcp.settings.views.unpin":"virtualMcp.settings.views.pin"),e[31]=s,e[32]=r,e[33]=k):k=e[33];let w;e[34]!==a||e[35]!==k?(w=t.jsxs(He,{onClick:a,children:[N,k]}),e[34]=a,e[35]=k,e[36]=w):w=e[36];let C;e[37]!==n||e[38]!==c||e[39]!==r?(C=n&&t.jsxs(He,{onClick:c,children:[t.jsx(Ps,{size:14}),r("virtualMcp.settings.views.setMainView")]}),e[37]=n,e[38]=c,e[39]=r,e[40]=C):C=e[40];let _;e[41]!==S||e[42]!==w||e[43]!==C?(_=t.jsxs(js,{align:"end",children:[S,w,C]}),e[41]=S,e[42]=w,e[43]=C,e[44]=_):_=e[44];let T;e[45]!==y||e[46]!==_?(T=t.jsxs(vs,{children:[y,_]}),e[45]=y,e[46]=_,e[47]=T):T=e[47];let V;return e[48]!==T||e[49]!==x?(V=t.jsxs("div",{className:"flex items-center gap-1",children:[x,T]}),e[48]=T,e[49]=x,e[50]=V):V=e[50],V}const fs=l=>l.stopPropagation();function ka(l){const e=q.c(8),{icon:s,title:n}=l;let i;e[0]!==s||e[1]!==n?(i=t.jsx(Ze,{icon:s,name:n,size:"xs",className:"shrink-0"}),e[0]=s,e[1]=n,e[2]=i):i=e[2];let a;e[3]!==n?(a=t.jsx("span",{className:"text-xs text-muted-foreground",children:n}),e[3]=n,e[4]=a):a=e[4];let c;return e[5]!==i||e[6]!==a?(c=t.jsxs("div",{className:"flex items-center gap-2 px-4 py-2.5 bg-muted/30",children:[i,a]}),e[5]=i,e[6]=a,e[7]=c):c=e[7],c}function Ma(l){const e=q.c(70),{views:s}=l,n=Z();let i;e[0]!==n?(i=n("virtualMcp.settings.views.defaults"),e[0]=n,e[1]=i):i=e[1];let a;e[2]!==n?(a=n("virtualMcp.layoutTabContent.mainView"),e[2]=n,e[3]=a):a=e[3];let c;e[4]!==n?(c=n("virtualMcp.layoutTabContent.mainViewDescription"),e[4]=n,e[5]=c):c=e[5];const r=s.defaultMainView,p=s.setMainView;let o;e[6]!==n?(o=n("virtualMcp.layoutTabContent.mainView"),e[6]=n,e[7]=o):o=e[7];let f;e[8]!==n?(f=n("virtualMcp.layoutTabContent.noMainView"),e[8]=n,e[9]=f):f=e[9];let m;e[10]!==f?(m=t.jsx(Ie,{placeholder:f}),e[10]=f,e[11]=m):m=e[11];let u;e[12]!==o||e[13]!==m?(u=t.jsx(Oe,{"aria-label":o,className:"w-36 h-8 text-sm shrink-0 @min-xl/project-settings:w-44",children:m}),e[12]=o,e[13]=m,e[14]=u):u=e[14];let h;e[15]!==s.defaultMainOptions?(h=s.defaultMainOptions.map(_a),e[15]=s.defaultMainOptions,e[16]=h):h=e[16];let d;e[17]!==h?(d=t.jsx(Ae,{children:h}),e[17]=h,e[18]=d):d=e[18];let x;e[19]!==d||e[20]!==u||e[21]!==s.defaultMainView||e[22]!==s.setMainView?(x=t.jsxs($e,{value:r,onValueChange:p,children:[u,d]}),e[19]=d,e[20]=u,e[21]=s.defaultMainView,e[22]=s.setMainView,e[23]=x):x=e[23];let g;e[24]!==x||e[25]!==a||e[26]!==c?(g=t.jsx(tt,{title:a,description:c,action:x}),e[24]=x,e[25]=a,e[26]=c,e[27]=g):g=e[27];let v;e[28]!==n?(v=n("virtualMcp.layoutTabContent.showChat"),e[28]=n,e[29]=v):v=e[29];let y;e[30]!==n?(y=n("virtualMcp.layoutTabContent.showChatDescription"),e[30]=n,e[31]=y):y=e[31];let j;e[32]!==n?(j=n("virtualMcp.layoutTabContent.showChat"),e[32]=n,e[33]=j):j=e[33];const b=s.noMainView?!0:s.chatDefaultOpen;let S;e[34]!==j||e[35]!==b||e[36]!==s.noMainView||e[37]!==s.setChatDefaultOpen?(S=t.jsx(Ne,{asChild:!0,children:t.jsx("span",{className:"shrink-0",children:t.jsx(ht,{"aria-label":j,checked:b,disabled:s.noMainView,onCheckedChange:s.setChatDefaultOpen})})}),e[34]=j,e[35]=b,e[36]=s.noMainView,e[37]=s.setChatDefaultOpen,e[38]=S):S=e[38];let N;e[39]!==n||e[40]!==s.noMainView?(N=s.noMainView&&t.jsx(Ce,{side:"top",children:n("virtualMcp.layoutTabContent.chatAlwaysShown")}),e[39]=n,e[40]=s.noMainView,e[41]=N):N=e[41];let k;e[42]!==S||e[43]!==N?(k=t.jsxs(Se,{delayDuration:0,children:[S,N]}),e[42]=S,e[43]=N,e[44]=k):k=e[44];let w;e[45]!==v||e[46]!==y||e[47]!==k?(w=t.jsx(tt,{title:v,description:y,action:k}),e[45]=v,e[46]=y,e[47]=k,e[48]=w):w=e[48];let C;e[49]!==g||e[50]!==w?(C=t.jsxs(ze,{children:[g,w]}),e[49]=g,e[50]=w,e[51]=C):C=e[51];let _;e[52]!==i||e[53]!==C?(_=t.jsx(Be,{title:i,children:C}),e[52]=i,e[53]=C,e[54]=_):_=e[54];let T;e[55]!==n?(T=n("virtualMcp.settings.views.sidebar"),e[55]=n,e[56]=T):T=e[56];let V;e[57]!==s?(V=s.projectViews.map(E=>{const U=s.pinned(E);return t.jsx(tt,{icon:t.jsx(Ca,{viewId:E}),title:s.labels[E],onClick:()=>s.openView(E),action:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(ms,{pinned:U,canSetMainView:U&&!s.isMainView(E),onOpen:()=>s.openView(E),onTogglePin:()=>s.togglePin(E,!U),onSetMainView:()=>s.setMainView(E)}),t.jsx("span",{onClick:()=>s.openView(E),className:"flex cursor-pointer items-center text-muted-foreground",children:t.jsx(Wt,{size:16})})]})},E)}),e[57]=s,e[58]=V):V=e[58];let $;e[59]!==s?($=s.connectionsData.flatMap(E=>[t.jsx(ka,{icon:E.icon,title:E.title},`${E.id}:header`),...E.uiTools.map(U=>{const K=s.pinnedAppViews.find(M=>M.connectionId===E.id&&M.toolName===U.name),Y=!!K,B=cn(E.id,U.name),z=`ext-apps:${E.id}:${U.name}`;return t.jsx(tt,{onClick:()=>s.openView(B),icon:Y?t.jsx("span",{onClick:fs,children:t.jsx(Zs,{value:K.icon??null,name:K.label||U.name,size:"xs",showHoverOverlay:!1,onChange:M=>s.setAppViewIcon(E.id,U.name,M)})}):t.jsx(Os,{size:16}),title:Y?t.jsx("span",{onClick:fs,children:t.jsx(ke,{value:K.label,onChange:M=>s.setAppViewLabel(E.id,U.name,M.target.value),onBlur:s.commitAppViewLabel,"aria-label":U.title??kt(U.name),className:"h-7 w-full max-w-52 text-sm"})}):U.title??kt(U.name),action:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(ms,{pinned:Y,canSetMainView:Y&&!s.isMainView(z),onOpen:()=>s.openView(B),onTogglePin:()=>s.toggleAppViewPin(E.id,U.name),onSetMainView:()=>s.setMainView(z)}),t.jsx("span",{onClick:()=>s.openView(B),className:"flex cursor-pointer items-center text-muted-foreground",children:t.jsx(Wt,{size:16})})]})},`${E.id}:${U.name}`)})]),e[59]=s,e[60]=$):$=e[60];let D;e[61]!==V||e[62]!==$?(D=t.jsxs(ze,{children:[V,$]}),e[61]=V,e[62]=$,e[63]=D):D=e[63];let A;e[64]!==T||e[65]!==D?(A=t.jsx(Be,{title:T,children:D}),e[64]=T,e[65]=D,e[66]=A):A=e[66];let P;return e[67]!==_||e[68]!==A?(P=t.jsxs(t.Fragment,{children:[_,A]}),e[67]=_,e[68]=A,e[69]=P):P=e[69],P}function _a(l){return t.jsx(we,{value:l.value,children:l.label},l.value)}const en="site-editor",Va=new Set([en,"content"]);function Ta({virtualMcpId:l,form:e,flushAndSave:s}){const n=Z(),i=Tt(),{openPanel:a}=Ii(),c=_s(l),r=Ai(c),p=Us(l),o=Ui(l),f=(c?.connections??[]).map(M=>M.connection_id).sort(),{data:m}=Ss({queryKey:Dt.projectConnectionDetails(l,f),enabled:f.length>0,queryFn:async()=>await Promise.all(f.map(async O=>{try{const{item:G}=await i.call("COLLECTION_CONNECTIONS_GET",{id:O}),R=(G?.tools??[]).flatMap(F=>{const W=Di(F._meta);return W?[{name:F.name,title:F.title,description:F.description,resourceUri:W}]:[]});return{fetchOk:!0,id:O,title:G?.title??O,icon:G?.icon??null,uiTools:R}}catch{return{fetchOk:!1,id:O,title:O,icon:null,uiTools:[]}}}))}),u=(m??[]).filter(M=>M.uiTools.length>0),h=new Set([...dn,...un]),d=e.watch("metadata.ui.pinnedViews")??[],x=e.watch("metadata.ui.layout")??null,g=x?.defaultMainView??null,v=x?.chatDefaultOpen??!1,y=Mt(_t({sidebarViews:e.watch("metadata.sidebarViews"),ui:{layout:x}}),e.watch("metadata.sidebarViewsVersion")),j=o??(c?Mt(_t(c.metadata),c.metadata.sidebarViewsVersion):y),b=(()=>{if(!g||g.type==="chat")return"";const M=mn(g.type);return M==="instructions"||M==="connections"||M==="layout"?"settings":Va.has(M)?en:h.has(M)?M:`${M}:${g.id??""}:${g.toolName??""}`})(),S=b==="",N=M=>{const[O,G,R]=M.split(":");return O?h.has(O)?{type:O}:O==="ext-apps"&&G?{type:"ext-apps",id:G,toolName:R||void 0}:null:null},k=M=>{e.setValue("metadata.ui.pinnedViews",M,{shouldDirty:!0})},w=M=>{e.setValue("metadata.ui.layout",{...x,...M},{shouldDirty:!0})},C=Q.useRef(!1);if(m&&m.length>0&&!C.current){C.current=!0;const M=new Set((m??[]).filter(F=>F.fetchOk).map(F=>F.id)),O=new Set(u.flatMap(F=>F.uiTools.map(W=>`${F.id}:${W.name}`))),G=new Set(f),R=d.filter(F=>G.has(F.connectionId)&&(!M.has(F.connectionId)||O.has(`${F.connectionId}:${F.toolName}`)));R.length!==d.length&&(k(R),g?.type==="ext-apps"&&!R.some(F=>F.connectionId===g.id&&F.toolName===g.toolName)&&w({defaultMainView:{type:"settings"}}))}const _=(M,O)=>{if(d.some(R=>R.connectionId===M&&R.toolName===O)){const R=d.filter(W=>!(W.connectionId===M&&W.toolName===O));k(R);const F=`ext-apps:${M}:${O}`;b===F&&w({defaultMainView:{type:"settings"}})}else{const R=u.find(F=>F.id===M)?.uiTools.find(F=>F.name===O)?.title;k([...d,{connectionId:M,toolName:O,label:R??kt(O),icon:null}])}s()},T=(M,O,G)=>{k(d.map(R=>R.connectionId===M&&R.toolName===O?{...R,label:G}:R))},V=()=>{s()},$=(M,O,G)=>{k(d.map(R=>R.connectionId===M&&R.toolName===O?{...R,icon:G}:R)),s()},D=M=>{w({defaultMainView:N(M)}),s()},A=(M,O)=>{const G=zi(j,M,O,1);e.setValue("metadata.sidebarViews",G,{shouldDirty:!0}),e.setValue("metadata.sidebarViewsVersion",1,{shouldDirty:!0}),p.stage(G,j);const R=Ri(g,M,O);R!==g&&w({defaultMainView:R})},P=Ls(c?.metadata),E=$i(P,r.presence),U=Fi(E),K=Ei(j,E,1),Y={overview:n("sidebar.navDestinations.home"),reports:n("sidebar.navDestinations.reports"),board:n("sidebar.navDestinations.tasks"),"site-editor":n("virtualMcp.layoutTabContent.siteEditor"),assets:n("common.mainPanelTabs.assets"),releases:n("common.mainPanelTabs.releases"),hosting:n("common.mainPanelTabs.hosting"),e2e:n("common.mainPanelTabs.e2e"),analytics:n("common.mainPanelTabs.analytics"),cdn:n("common.mainPanelTabs.cdn"),automations:n("virtualMcp.layoutTabContent.automations"),experiments:n("experiments.title")},B=[];for(const M of K)M!=="automations"&&B.push({value:M,label:Y[M]});for(const M of d)B.push({value:`ext-apps:${M.connectionId}:${M.toolName}`,label:M.label||M.toolName});return K.includes("automations")&&B.push({value:"automations",label:Y.automations}),B.push({value:"settings",label:n("virtualMcp.layoutTabContent.settings")}),{projectViews:U,labels:Y,pinned:M=>j.includes(M),isMainView:M=>b===M,defaultMainView:b,defaultMainOptions:B,noMainView:S,chatDefaultOpen:v,connectionsData:u,pinnedAppViews:d,openView:M=>a(M,{virtualmcpid:l}),togglePin:(M,O)=>A(M,O),setMainView:D,setChatDefaultOpen:M=>{w({chatDefaultOpen:M}),s()},toggleAppViewPin:_,setAppViewIcon:$,setAppViewLabel:T,commitAppViewLabel:V}}function Da(l){const e=q.c(55),{form:s,onCommit:n}=l,i=Z(),a=Q.useId();let c;e[0]!==i?(c=i("virtualMcp.settings.identity.icon"),e[0]=i,e[1]=c):c=e[1];let r;e[2]!==c?(r=t.jsx("p",{className:"text-sm font-medium",children:c}),e[2]=c,e[3]=r):r=e[3];let p;e[4]!==i?(p=i("virtualMcp.settings.identity.iconDescription"),e[4]=i,e[5]=p):p=e[5];let o;e[6]!==p?(o=t.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:p}),e[6]=p,e[7]=o):o=e[7];let f;e[8]!==r||e[9]!==o?(f=t.jsxs("div",{children:[r,o]}),e[8]=r,e[9]=o,e[10]=f):f=e[10];let m;e[11]!==s||e[12]!==n||e[13]!==i?(m=T=>{const{field:V}=T;return t.jsx("div",{className:"justify-self-start",children:t.jsx(Zs,{value:V.value??null,onChange:$=>{V.onChange($),n()},onColorChange:$=>{s.setValue("metadata.ui.themeColor",$,{shouldDirty:!0}),n()},name:s.watch("title")||i("virtualMcp.virtualMcp.agentNameFallback"),size:"md",avatarClassName:"[&_svg]:w-1/2 [&_svg]:h-1/2"})})},e[11]=s,e[12]=n,e[13]=i,e[14]=m):m=e[14];let u;e[15]!==s.control||e[16]!==m?(u=t.jsx(be,{name:"icon",control:s.control,render:m}),e[15]=s.control,e[16]=m,e[17]=u):u=e[17];let h;e[18]!==f||e[19]!==u?(h=t.jsxs(je,{className:"grid gap-3 @min-xl/project-settings:grid-cols-[180px_minmax(0,1fr)] @min-xl/project-settings:gap-8",children:[f,u]}),e[18]=f,e[19]=u,e[20]=h):h=e[20];const d=`${a}-name`;let x;e[21]!==i?(x=i("virtualMcp.settings.identity.name"),e[21]=i,e[22]=x):x=e[22];let g;e[23]!==x||e[24]!==d?(g=t.jsx("label",{htmlFor:d,className:"text-sm font-medium",children:x}),e[23]=x,e[24]=d,e[25]=g):g=e[25];let v;e[26]!==a||e[27]!==n||e[28]!==i?(v=T=>{const{field:V}=T;return t.jsx(ke,{...V,id:`${a}-name`,value:V.value??"",onBlur:()=>{V.onBlur(),n()},placeholder:i("virtualMcp.virtualMcp.agentNamePlaceholder")})},e[26]=a,e[27]=n,e[28]=i,e[29]=v):v=e[29];let y;e[30]!==s.control||e[31]!==v?(y=t.jsx(be,{name:"title",control:s.control,render:v}),e[30]=s.control,e[31]=v,e[32]=y):y=e[32];let j;e[33]!==g||e[34]!==y?(j=t.jsxs(je,{className:"grid gap-3 @min-xl/project-settings:grid-cols-[180px_minmax(0,1fr)] @min-xl/project-settings:gap-8",children:[g,y]}),e[33]=g,e[34]=y,e[35]=j):j=e[35];const b=`${a}-description`;let S;e[36]!==i?(S=i("virtualMcp.settings.identity.description"),e[36]=i,e[37]=S):S=e[37];let N;e[38]!==b||e[39]!==S?(N=t.jsx("label",{htmlFor:b,className:"text-sm font-medium",children:S}),e[38]=b,e[39]=S,e[40]=N):N=e[40];let k;e[41]!==a||e[42]!==n||e[43]!==i?(k=T=>{const{field:V}=T;return t.jsx(ut,{...V,id:`${a}-description`,value:V.value??"",onBlur:()=>{V.onBlur(),n()},placeholder:i("virtualMcp.virtualMcp.descriptionPlaceholder"),className:"min-h-24 resize-y"})},e[41]=a,e[42]=n,e[43]=i,e[44]=k):k=e[44];let w;e[45]!==s.control||e[46]!==k?(w=t.jsx(be,{name:"description",control:s.control,render:k}),e[45]=s.control,e[46]=k,e[47]=w):w=e[47];let C;e[48]!==N||e[49]!==w?(C=t.jsxs(je,{className:"grid gap-3 @min-xl/project-settings:grid-cols-[180px_minmax(0,1fr)] @min-xl/project-settings:gap-8",children:[N,w]}),e[48]=N,e[49]=w,e[50]=C):C=e[50];let _;return e[51]!==j||e[52]!==C||e[53]!==h?(_=t.jsxs(ze,{children:[h,j,C]}),e[51]=j,e[52]=C,e[53]=h,e[54]=_):_=e[54],_}function Pa(l){const e=q.c(8),{section:s}=l,n=Z();let i;e[0]!==n?(i=n("virtualMcp.settings.navigation"),e[0]=n,e[1]=i):i=e[1];let a;e[2]!==s||e[3]!==n?(a=Gi.map(r=>{const{titleKey:p}=qi[r];return t.jsx(Ue.Tab,{active:s===r,asChild:!0,children:t.jsx(ws,{to:".",activeOptions:{exact:!0,explicitUndefined:!0},search:o=>({...o,section:r==="general"?void 0:r}),children:n(p)})},r)}),e[2]=s,e[3]=n,e[4]=a):a=e[4];let c;if(e[5]!==i||e[6]!==a){const r=t.jsx(Ue.Tabs,{"aria-label":i,children:a});c=t.jsx(fn.Toolbar.Left.Portal,{fallback:r,children:r}),e[5]=i,e[6]=a,e[7]=c}else c=e[7];return c}function Oa(){const l=q.c(8),e=Pt();let s;l[0]===Symbol.for("react.memo_cache_sentinel")?(s={strict:!1},l[0]=s):s=l[0];const{section:n}=pn(s);let i;l[1]!==n?(i=Hi(n)?n:"general",l[1]=n,l[2]=i):i=l[2];let a;l[3]!==e?(a=r=>e({to:".",search:p=>({...p,section:r??void 0})}),l[3]=e,l[4]=a):a=l[4];let c;return l[5]!==i||l[6]!==a?(c={section:i,openSection:a},l[5]=i,l[6]=a,l[7]=c):c=l[7],c}function tn(l){const e=q.c(20),{value:s,label:n,copiedLabel:i,variant:a,size:c,className:r,copiedClassName:p}=l,o=a===void 0?"ghost":a,f=c===void 0?"icon-sm":c,{handleCopy:m,copied:u}=Xi();let h;e[0]!==m||e[1]!==s?(h=()=>{m(s).catch(Ia)},e[0]=m,e[1]=s,e[2]=h):h=e[2];const d=u&&p;let x;e[3]!==r||e[4]!==d?(x=ve(r,d),e[3]=r,e[4]=d,e[5]=x):x=e[5];let g;e[6]!==u?(g=u?t.jsx(rt,{className:"text-success"}):t.jsx(xt,{}),e[6]=u,e[7]=g):g=e[7];let v;e[8]!==n||e[9]!==f||e[10]!==h||e[11]!==x||e[12]!==g||e[13]!==o?(v=t.jsx(te,{type:"button",variant:o,size:f,"aria-label":n,onClick:h,className:x,children:g}),e[8]=n,e[9]=f,e[10]=h,e[11]=x,e[12]=g,e[13]=o,e[14]=v):v=e[14];const y=u?i:"";let j;e[15]!==y?(j=t.jsx("span",{className:"sr-only","aria-live":"polite",children:y}),e[15]=y,e[16]=j):j=e[16];let b;return e[17]!==v||e[18]!==j?(b=t.jsxs(t.Fragment,{children:[v,j]}),e[17]=v,e[18]=j,e[19]=b):b=e[19],b}function Ia(){}function Aa(l){const e=q.c(14),{id:s,value:n,copyLabel:i,copiedLabel:a,className:c}=l;let r;e[0]!==c?(r=ve("relative h-fit",c),e[0]=c,e[1]=r):r=e[1];let p;e[2]!==s||e[3]!==n?(p=t.jsx(ke,{id:s,value:n,readOnly:!0,disabled:!0,className:"pr-10 font-mono"}),e[2]=s,e[3]=n,e[4]=p):p=e[4];let o;e[5]===Symbol.for("react.memo_cache_sentinel")?(o=ve("absolute top-1/2 right-1 -translate-y-1/2 transition-opacity","opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 focus-visible:opacity-100 pointer-coarse:opacity-100"),e[5]=o):o=e[5];let f;e[6]!==a||e[7]!==i||e[8]!==n?(f=t.jsx(tn,{value:n,label:i,copiedLabel:a,className:o,copiedClassName:"opacity-100"}),e[6]=a,e[7]=i,e[8]=n,e[9]=f):f=e[9];let m;return e[10]!==r||e[11]!==p||e[12]!==f?(m=t.jsxs("div",{className:r,children:[p,f]}),e[10]=r,e[11]=p,e[12]=f,e[13]=m):m=e[13],m}async function ps(l){const e=await l.json().catch(()=>({}));if(!l.ok)throw new Error(e.error??`HTTP ${l.status}`);return e}function $a(l){const e=q.c(106),{orgSlug:s,virtualMcpId:n}=l,i=Z(),a=Ns(),c=`/api/${s}/hosted/${encodeURIComponent(n)}/site-tokens`;let r;e[0]!==s||e[1]!==n?(r=Dt.hostedSiteTokens(s,n),e[0]=s,e[1]=n,e[2]=r):r=e[2];const p=r,[o,f]=Q.useState(null),m=Q.useId();let u;e[3]!==c?(u=async()=>ps(await fetch(c)),e[3]=c,e[4]=u):u=e[4];let h;e[5]!==p||e[6]!==u?(h={queryKey:p,queryFn:u},e[5]=p,e[6]=u,e[7]=h):h=e[7];const d=Ss(h);let x;e[8]!==c?(x=async()=>ps(await fetch(c,{method:"POST"})),e[8]=c,e[9]=x):x=e[9];let g;e[10]===Symbol.for("react.memo_cache_sentinel")?(g=fe=>{const{token:I}=fe;return f(I)},e[10]=g):g=e[10];let v;e[11]!==p||e[12]!==a?(v=()=>a.invalidateQueries({queryKey:p}),e[11]=p,e[12]=a,e[13]=v):v=e[13];let y;e[14]!==x||e[15]!==v?(y={mutationFn:x,onSuccess:g,onError:Fa,onSettled:v},e[14]=x,e[15]=v,e[16]=y):y=e[16];const j=hn(y);let b;e[17]!==d.data?.tokens?(b=d.data?.tokens??[],e[17]=d.data?.tokens,e[18]=b):b=e[18];const S=b,N=d.data?.site;let k;e[19]!==i?(k=i("siteTokens.title"),e[19]=i,e[20]=k):k=e[20];let w;e[21]!==i?(w=i("siteTokens.description"),e[21]=i,e[22]=w):w=e[22];let C;e[23]!==i?(C=i("siteTokens.siteId"),e[23]=i,e[24]=C):C=e[24];let _;e[25]!==m||e[26]!==C?(_=t.jsx("label",{htmlFor:m,className:"text-sm font-medium",children:C}),e[25]=m,e[26]=C,e[27]=_):_=e[27];let T;e[28]!==i?(T=i("siteTokens.siteIdDescription"),e[28]=i,e[29]=T):T=e[29];let V;e[30]!==T?(V=t.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:T}),e[30]=T,e[31]=V):V=e[31];let $;e[32]!==N||e[33]!==m||e[34]!==i?($=N?t.jsx(Aa,{id:m,value:N,copyLabel:i("siteTokens.copySiteId"),copiedLabel:i("siteTokens.siteIdCopied"),className:"min-w-0 flex-1"}):t.jsx("p",{className:"min-w-0 flex-1 font-mono text-xs text-muted-foreground",children:"—"}),e[32]=N,e[33]=m,e[34]=i,e[35]=$):$=e[35];const D=!d.data||j.isPending;let A;e[36]!==j?(A=()=>j.mutate(),e[36]=j,e[37]=A):A=e[37];let P;e[38]!==j.isPending?(P=j.isPending?t.jsx(it,{className:"size-3.5"}):t.jsx(Pe,{size:14}),e[38]=j.isPending,e[39]=P):P=e[39];let E;e[40]!==i?(E=i("siteTokens.issue"),e[40]=i,e[41]=E):E=e[41];let U;e[42]!==D||e[43]!==A||e[44]!==P||e[45]!==E?(U=t.jsxs(te,{type:"button",size:"sm",className:"shrink-0",disabled:D,onClick:A,children:[P,E]}),e[42]=D,e[43]=A,e[44]=P,e[45]=E,e[46]=U):U=e[46];let K;e[47]!==$||e[48]!==U?(K=t.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[$,U]}),e[47]=$,e[48]=U,e[49]=K):K=e[49];let Y;e[50]!==_||e[51]!==V||e[52]!==K?(Y=t.jsxs(je,{className:"group",children:[_,V,K]}),e[50]=_,e[51]=V,e[52]=K,e[53]=Y):Y=e[53];let B;e[54]!==d.error||e[55]!==d.isError?(B=d.isError?t.jsx(je,{children:t.jsx("p",{className:"text-xs text-destructive",children:d.error.message})}):null,e[54]=d.error,e[55]=d.isError,e[56]=B):B=e[56];let z;if(e[57]!==i||e[58]!==S){let fe;e[60]!==i?(fe=I=>t.jsx(je,{children:t.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[t.jsx($t,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"truncate font-mono text-xs",children:I.kid}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("siteTokens.issuedAgo",{when:Qi(new Date(I.iat*1e3))})})]})]})},I.kid),e[60]=i,e[61]=fe):fe=e[61],z=S.map(fe),e[57]=i,e[58]=S,e[59]=z}else z=e[59];let M;e[62]!==Y||e[63]!==B||e[64]!==z?(M=t.jsxs(ze,{children:[Y,B,z]}),e[62]=Y,e[63]=B,e[64]=z,e[65]=M):M=e[65];const O=o!==null;let G;e[66]===Symbol.for("react.memo_cache_sentinel")?(G=fe=>!fe&&f(null),e[66]=G):G=e[66];let R;e[67]!==i?(R=i("siteTokens.createdTitle"),e[67]=i,e[68]=R):R=e[68];let F;e[69]!==R?(F=t.jsx(at,{children:R}),e[69]=R,e[70]=F):F=e[70];let W;e[71]!==i?(W=i("siteTokens.createdDescription"),e[71]=i,e[72]=W):W=e[72];let H;e[73]!==W?(H=t.jsx(Cs,{children:W}),e[73]=W,e[74]=H):H=e[74];let se;e[75]!==F||e[76]!==H?(se=t.jsxs(lt,{children:[F,H]}),e[75]=F,e[76]=H,e[77]=se):se=e[77];let le;e[78]!==i?(le=i("siteTokens.createdTitle"),e[78]=i,e[79]=le):le=e[79];const ce=o??"";let ae;e[80]!==le||e[81]!==ce?(ae=t.jsx(ke,{readOnly:!0,"aria-label":le,value:ce,className:"font-mono text-xs"}),e[80]=le,e[81]=ce,e[82]=ae):ae=e[82];let ie;e[83]!==o||e[84]!==i?(ie=o?t.jsx(tn,{value:o,label:i("siteTokens.copy"),copiedLabel:i("siteTokens.copied"),variant:"outline",size:"icon",className:"shrink-0"}):null,e[83]=o,e[84]=i,e[85]=ie):ie=e[85];let X;e[86]!==ae||e[87]!==ie?(X=t.jsxs("div",{className:"flex items-center gap-2",children:[ae,ie]}),e[86]=ae,e[87]=ie,e[88]=X):X=e[88];let de;e[89]===Symbol.for("react.memo_cache_sentinel")?(de=()=>f(null),e[89]=de):de=e[89];let ue;e[90]!==i?(ue=i("siteTokens.done"),e[90]=i,e[91]=ue):ue=e[91];let he;e[92]!==ue?(he=t.jsx(Vt,{children:t.jsx(te,{onClick:de,children:ue})}),e[92]=ue,e[93]=he):he=e[93];let me;e[94]!==se||e[95]!==X||e[96]!==he?(me=t.jsxs(Je,{className:"sm:max-w-lg",children:[se,X,he]}),e[94]=se,e[95]=X,e[96]=he,e[97]=me):me=e[97];let xe;e[98]!==O||e[99]!==me?(xe=t.jsx(Xe,{open:O,onOpenChange:G,children:me}),e[98]=O,e[99]=me,e[100]=xe):xe=e[100];let ge;return e[101]!==w||e[102]!==M||e[103]!==xe||e[104]!==k?(ge=t.jsxs(Be,{title:k,description:w,children:[M,xe]}),e[101]=w,e[102]=M,e[103]=xe,e[104]=k,e[105]=ge):ge=e[105],ge}function Fa(l){return oe.error(l.message)}function Ea(l){const e=q.c(8),{control:s,previewServerUrl:n}=l,i=Z();let a;e[0]!==n?(a=Ys(n),e[0]=n,e[1]=a):a=e[1];const c=!!a;let r;e[2]!==c||e[3]!==i?(r=o=>{const{field:f}=o;return t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"space-y-0.5 min-w-0",children:[t.jsx(ye,{htmlFor:"fast-preview",className:"font-normal text-foreground",children:i("sandbox.cmsSettings.fastPreview.label")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i(c?"sandbox.cmsSettings.fastPreview.description":"sandbox.cmsSettings.fastPreview.needsPreviewServerUrl")})]}),t.jsx(ht,{id:"fast-preview",className:"shrink-0",checked:!!f.value&&c,disabled:!c,onCheckedChange:m=>f.onChange(m)})]})},e[2]=c,e[3]=i,e[4]=r):r=e[4];let p;return e[5]!==s||e[6]!==r?(p=t.jsx(be,{control:s,name:"metadata.fastPreview",render:r}),e[5]=s,e[6]=r,e[7]=p):p=e[7],p}function za(l){const e=q.c(5),{control:s,fastPreview:n}=l,i=Z();if(!n)return null;let a;e[0]!==i?(a=r=>{const{field:p}=r;return t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"space-y-0.5 min-w-0",children:[t.jsx(ye,{htmlFor:"fast-preview-in-place",className:"font-normal text-foreground",children:i("sandbox.cmsSettings.fastPreviewInPlace.label")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("sandbox.cmsSettings.fastPreviewInPlace.description")})]}),t.jsx(ht,{id:"fast-preview-in-place",className:"shrink-0",checked:!!p.value,onCheckedChange:o=>p.onChange(o)})]})},e[0]=i,e[1]=a):a=e[1];let c;return e[2]!==s||e[3]!==a?(c=t.jsx(be,{control:s,name:"metadata.fastPreviewInPlace",render:a}),e[2]=s,e[3]=a,e[4]=c):c=e[4],c}function Ra(l){const e=q.c(18),{control:s,isBlocksV8:n}=l,i=n===void 0?!1:n,a=Z();let c;e[0]!==a?(c=a("sandbox.previewServerUrlField.label"),e[0]=a,e[1]=c):c=e[1];let r;e[2]!==c?(r=t.jsx(ye,{htmlFor:"preview-server-url",children:c}),e[2]=c,e[3]=r):r=e[3];let p;e[4]!==a?(p=d=>{const{field:x}=d,g=x.value??"";return t.jsx(ke,{id:"preview-server-url",type:"url",inputMode:"url",placeholder:a("sandbox.previewServerUrlField.placeholder"),value:g,onChange:v=>x.onChange(v.target.value===""?null:v.target.value),onBlur:()=>{x.onChange(Ji(g)),x.onBlur()}})},e[4]=a,e[5]=p):p=e[5];let o;e[6]!==s||e[7]!==p?(o=t.jsx(be,{control:s,name:"metadata.previewServerUrl",render:p}),e[6]=s,e[7]=p,e[8]=o):o=e[8];const f=i?"sandbox.previewServerUrlField.descriptionBlocksV8":"sandbox.previewServerUrlField.description";let m;e[9]!==a||e[10]!==f?(m=a(f),e[9]=a,e[10]=f,e[11]=m):m=e[11];let u;e[12]!==m?(u=t.jsx("p",{className:"text-xs text-muted-foreground",children:m}),e[12]=m,e[13]=u):u=e[13];let h;return e[14]!==r||e[15]!==o||e[16]!==u?(h=t.jsxs("div",{className:"space-y-2",children:[r,o,u]}),e[14]=r,e[15]=o,e[16]=u,e[17]=h):h=e[17],h}function La(l){const e=q.c(15),{control:s,isBlocksV8:n,previewServerUrl:i,fastPreview:a}=l,c=Z(),r=n||!!a;let p;e[0]!==s||e[1]!==n?(p=t.jsx(je,{children:t.jsx(Ra,{control:s,isBlocksV8:n})}),e[0]=s,e[1]=n,e[2]=p):p=e[2];let o;e[3]!==s||e[4]!==n||e[5]!==i||e[6]!==c?(o=n?!Ys(i)&&t.jsx(je,{children:t.jsx("p",{className:"text-xs text-muted-foreground",children:c("sandbox.cmsSettings.blocksV8.needsPreviewServerUrl")})}):t.jsx(je,{children:t.jsx(Ea,{control:s,previewServerUrl:i})}),e[3]=s,e[4]=n,e[5]=i,e[6]=c,e[7]=o):o=e[7];let f;e[8]!==s||e[9]!==r?(f=r&&t.jsx(je,{children:t.jsx(za,{control:s,fastPreview:r})}),e[8]=s,e[9]=r,e[10]=f):f=e[10];let m;return e[11]!==p||e[12]!==o||e[13]!==f?(m=t.jsxs(t.Fragment,{children:[p,o,f]}),e[11]=p,e[12]=o,e[13]=f,e[14]=m):m=e[14],m}const St={tools:null,resources:null,prompts:null},Ua=el.pick({status:!0,title:!0,description:!0,icon:!0,metadata:!0,connections:!0});function Ya(l){const s=new TextEncoder().encode(l),n=Array.from(s,i=>String.fromCharCode(i)).join("");return btoa(n)}function sn(l){return{"x-studio-client":l,"x-mesh-client":l}}function Ba(l){const e=q.c(15),{url:s,agentId:n}=l,i=Z(),[a,c]=Q.useState(!1);let r;e[0]!==n||e[1]!==i||e[2]!==s?(r=async()=>{_e("agent_connect_action",{agent_id:n,action:"copy_url"}),await navigator.clipboard.writeText(s),c(!0),oe.success(i("virtualMcp.virtualMcpShareModal.agentUrlCopied")),await vt(2e3),c(!1)},e[0]=n,e[1]=i,e[2]=s,e[3]=r):r=e[3];const p=r;let o;e[4]!==a?(o=a?t.jsx(rt,{size:20,className:"text-success"}):t.jsx(xt,{size:20}),e[4]=a,e[5]=o):o=e[5];let f;e[6]!==a||e[7]!==i?(f=i(a?"virtualMcp.virtualMcpShareModal.copied":"virtualMcp.virtualMcpShareModal.copyUrl"),e[6]=a,e[7]=i,e[8]=f):f=e[8];let m;e[9]!==f?(m=t.jsx("span",{className:"text-xs font-medium",children:f}),e[9]=f,e[10]=m):m=e[10];let u;return e[11]!==p||e[12]!==o||e[13]!==m?(u=t.jsxs(te,{type:"button",variant:"outline",onClick:p,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[o,m]}),e[11]=p,e[12]=o,e[13]=m,e[14]=u):u=e[14],u}function Wa(l){const e=q.c(13),{url:s,serverName:n,agentId:i}=l,a=Z();let c;e[0]!==i||e[1]!==n||e[2]!==a||e[3]!==s?(c=()=>{_e("agent_connect_action",{agent_id:i,action:"install_cursor"});const u=Ws(n),h={type:"http",url:s,headers:sn("Cursor")},d=Ya(JSON.stringify(h,null,2)),x=`cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(u)}&config=${encodeURIComponent(d)}`;window.open(x,"_blank"),oe.success(a("virtualMcp.virtualMcpShareModal.openingCursor"))},e[0]=i,e[1]=n,e[2]=a,e[3]=s,e[4]=c):c=e[4];const r=c;let p;e[5]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("img",{src:"/logos/cursor.svg",alt:"Cursor",className:"h-5 w-5",style:{filter:"brightness(0) saturate(100%) invert(11%) sepia(8%) saturate(785%) hue-rotate(1deg) brightness(95%) contrast(89%)"}}),e[5]=p):p=e[5];let o;e[6]!==a?(o=a("virtualMcp.virtualMcpShareModal.installOnCursor"),e[6]=a,e[7]=o):o=e[7];let f;e[8]!==o?(f=t.jsx("span",{className:"text-xs font-medium",children:o}),e[8]=o,e[9]=f):f=e[9];let m;return e[10]!==r||e[11]!==f?(m=t.jsxs(te,{type:"button",variant:"outline",onClick:r,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[p,f]}),e[10]=r,e[11]=f,e[12]=m):m=e[12],m}function Ka(l){const e=q.c(16),{url:s,serverName:n,agentId:i}=l,a=Z(),[c,r]=Q.useState(!1);let p;e[0]!==i||e[1]!==n||e[2]!==a||e[3]!==s?(p=async()=>{_e("agent_connect_action",{agent_id:i,action:"install_claude_code"});const d=Ws(n),x={type:"http",url:s,headers:sn("Claude Code")},g=JSON.stringify(x,null,2),v=`claude mcp add-json "${d}" '${g.replace(/'/g,"'\\''")}' --scope user`;await navigator.clipboard.writeText(v),r(!0),oe.success(a("virtualMcp.virtualMcpShareModal.claudeCodeCommandCopied")),await vt(2e3),r(!1)},e[0]=i,e[1]=n,e[2]=a,e[3]=s,e[4]=p):p=e[4];const o=p;let f;e[5]!==c?(f=c?t.jsx(rt,{size:20,className:"text-success"}):t.jsx("img",{src:"/logos/Claude Code.svg",alt:"Claude Code",className:"h-5 w-5",style:{filter:"brightness(0) saturate(100%) invert(55%) sepia(31%) saturate(1264%) hue-rotate(331deg) brightness(92%) contrast(86%)"}}),e[5]=c,e[6]=f):f=e[6];let m;e[7]!==c||e[8]!==a?(m=a(c?"virtualMcp.virtualMcpShareModal.copied":"virtualMcp.virtualMcpShareModal.installOnClaudeCode"),e[7]=c,e[8]=a,e[9]=m):m=e[9];let u;e[10]!==m?(u=t.jsx("span",{className:"text-xs font-medium",children:m}),e[10]=m,e[11]=u):u=e[11];let h;return e[12]!==o||e[13]!==f||e[14]!==u?(h=t.jsxs(te,{type:"button",variant:"outline",onClick:o,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[f,u]}),e[12]=o,e[13]=f,e[14]=u,e[15]=h):h=e[15],h}const Ga=720*60*60;function qa({virtualMcp:l}){const e=Z(),s=Tt(),[n,i]=Q.useState(null),[a,c]=Q.useState(!1),[r,p]=Q.useState(!1),o=l.id,f=l.title||`agent-${o.slice(0,8)}`,m=n?`bunx @decocms/typegen@latest --mcp ${o} --key ${n} --output client.ts`:`bunx @decocms/typegen@latest --mcp ${o} --key <api-key> --output client.ts`,u=async()=>{c(!0);try{const{key:d}=await s.call("API_KEY_CREATE",{name:`typegen-${f}`,permissions:{[o]:["*"]},expiresIn:Ga});if(!d)throw new Error("No key in response");i(d),_e("agent_typegen_key_generated",{agent_id:o})}catch{_e("agent_typegen_key_failed",{agent_id:o}),oe.error(e("virtualMcp.virtualMcpShareModal.failedGenerateApiKey"))}finally{c(!1)}},h=async()=>{_e("agent_connect_action",{agent_id:o,action:"typegen_copy_command",has_api_key:!!n}),await navigator.clipboard.writeText(m),p(!0),oe.success(e("virtualMcp.virtualMcpShareModal.commandCopied")),await vt(2e3),p(!1)};return t.jsxs("div",{className:"flex min-w-0 flex-col gap-3",children:[t.jsxs("div",{className:"flex items-start justify-between gap-3",children:[t.jsxs("div",{className:"flex flex-col gap-0.5",children:[t.jsx("h4",{className:"text-sm font-medium text-foreground",children:e("virtualMcp.virtualMcpShareModal.generateTypedClient")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:e("virtualMcp.virtualMcpShareModal.generateTypedClientDescription")})]}),!n&&t.jsxs(te,{type:"button",variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:u,disabled:a,children:[a?t.jsx(it,{className:"size-3.5"}):t.jsx($t,{size:14}),t.jsx("span",{children:e(a?"virtualMcp.virtualMcpShareModal.generating":"virtualMcp.virtualMcpShareModal.generateApiKey")})]})]}),n&&t.jsx("p",{className:"rounded-md border border-warning/20 bg-warning/10 px-3 py-2 text-xs text-warning",children:e("virtualMcp.virtualMcpShareModal.storeKeySecurely")}),t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:e("virtualMcp.virtualMcpShareModal.generateClientLabel")}),t.jsx("div",{className:"rounded-md border border-input bg-muted/50 px-3 py-2.5",children:t.jsxs("div",{className:"flex items-start gap-2",children:[t.jsx("code",{className:"min-w-0 flex-1 break-all font-mono text-xs text-muted-foreground",children:m}),t.jsx(te,{type:"button",variant:"ghost",size:"icon",className:"size-6 shrink-0",onClick:h,children:r?t.jsx(rt,{size:12,className:"text-success"}):t.jsx(xt,{size:12})})]})}),t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:e("virtualMcp.virtualMcpShareModal.runtimeVariables")}),t.jsx(Ha,{apiKey:n,agentId:o})]})}function Ha(l){const e=q.c(21),{apiKey:s,agentId:n}=l,[i,a]=Q.useState(!1),c=window.location.origin,r=s?`STUDIO_API_KEY=${s}`:"STUDIO_API_KEY=<api-key>",p=`STUDIO_BASE_URL=${c}`,o=`${r}
1
+ import{c as q,b as Z,r as Q,j as t,B as te,h as it,l as ve,X as vs,T as bs,V as js,U as He,at as Ut,ar as Yt,as as Bt,t as oe,a2 as Fe,D as Xe,q as Je,s as lt,v as at,H as Ye,a3 as ys,fD as an,w as Vt,L as ws,I as ke,ak as rn,z as on,eq as tt,av as Wt,aj as cn,ep as ze,eo as Be,an as Tt,m as Ss,K as Dt,fE as dn,fF as un,fG as mn,b9 as be,fH as je,n as Ue,P as fn,d as Pt,u as pn,af as rt,o as Ns,e as hn,aM as Cs,y as _e,b1 as xn,a as gn,fI as ks,fJ as vn,aW as bn,ad as jn,aE as yn,aD as wn,a5 as Sn,fK as Nn,aL as Cn}from"./index-eirpwNKj.js";import{g as kn}from"./extract-connection-data-C2M3P64h.js";import{b as Mn}from"./chat-context-Dnn7Mdeu.js";import{U as _n,b as Vn}from"./build-improve-prompt-doc-DZKU2eq8.js";import{E as Tn}from"./empty-state-DIpCFPkI.js";import{a as Dn}from"./shell-layout-DS0Ye6S1.js";import{g as ft,n as Pn,a as Kt,e as On,u as In,f as An}from"./use-date-fns-locale-D_SHRVT8.js";import{a as $n}from"./mcp-oauth-DJh33UXx.js";import{f as Fn,e as En,b as zn,A as Rn,a as Ln,d as Un,c as Yn,g as Bn}from"./alert-dialog-DBOmU5EL.js";import{T as ut}from"./textarea-BDL4MHBS.js";import{c as Se,T as Ne,a as Ce}from"./tooltip-DX3EibzC.js";import{a as Ot,b as Ms,u as Wn}from"./use-connection-C4wyl2ru.js";import{b as Kn,a as _s,g as Vs,f as Gn,k as qn}from"./repository-binding-BNbbDYQQ.js";import{i as Gt}from"./mcp-oauth-DqMHjHip.js";import{bi as Hn,k as Qn,bj as Xn,bk as Jn,aN as Zn,aH as ei,aK as ti,bl as si,bm as Ts,bn as Ds,bo as ni,as as ii,bp as li,bq as jt,br as qt,A as Ht,M as ai,bs as ri,bt as oi,g as Ps,p as Qt,n as ci,w as di,v as ui,u as mi,f as Os,D as Xt,aL as fi,ag as pi,ay as hi}from"./agent-icon-C0Cpk_fI.js";import{s as Pe}from"./Plus-D0ucptrV.js";import{t as dt,a as xi}from"./Tool01-C0454p2c.js";import{s as It}from"./Trash01-CyxedK0n.js";import{u as Jt}from"./use-debounced-autosave-CteI237O.js";import{A as gi}from"./add-connection-dialog-BkWp2fK0.js";import{i as Ct}from"./SearchMd-0qnilUuy.js";import{F as Zt}from"./file-type-icon-CBmuqe9u.js";import{j as vi,i as bi,n as ji,q as yi}from"./use-org-fs-QKl-Epzm.js";import{I as Ze}from"./integration-icon-CKknGZhR.js";import{C as Is}from"./checkbox-_9cHZuVh.js";import{S as wi}from"./search-input-Bq9urCGV.js";import{b as Oe,a as Ie,c as we,d as Ae,S as $e}from"./select-C5-hj9Ts.js";import{s as At}from"./XClose-BeqwQ2Ei.js";import{C as Si}from"./collection-tabs-BLEBGgk-.js";import{T as As,u as $s}from"./use-mcp-auth-status-XO9Yp1aB.js";import{u as pt}from"./use-mcp-client-DA050uNw.js";import{a as Fs}from"./use-mcp-tools-DDRwYO6T.js";import{u as Ni}from"./use-mcp-prompts-C_C6tlAY.js";import{g as Ci}from"./connection-slug-CITJ0kGN.js";import{t as kt}from"./utils-CVEq3hMx.js";import{S as ht}from"./switch-COyvKYHV.js";import{a as Es,b as zs,P as Rs}from"./popover-oZJ3oDMA.js";import{S as ki}from"./scroll-area-D2V3l6oK.js";import{i as Mi}from"./Upload01-BWpYXx52.js";import{i as _i}from"./DotsVertical-DgdCLmlp.js";import{a as Vi}from"./Image01-DxuLkpjX.js";import{i as Ti}from"./Monitor01-CHS3e170.js";import{g as Di}from"./types-BmDn-Bmr.js";import{a as Ls,d as Pi,u as Oi}from"./use-main-schema-v8-BpRBE2if.js";import{a as Ii}from"./use-panel-navigate-CYHQ9H_T.js";import{u as Ai,e as Mt,r as _t,p as $i,g as Fi,s as Ei,t as zi,h as Ri,a as Li}from"./use-project-native-view-presence-DG_OsicQ.js";import{a as Us,u as Ui,i as Yi,o as Bi,r as es,p as Wi,w as Ki,b as ts}from"./optimistic-project-sidebar-views-DqJuR4Ij.js";import{P as Gi,a as qi,i as Hi}from"./sections-CR_pzMlx.js";import{i as $t}from"./Key01-Qdm6kw39.js";import{a as Qi}from"./format-time-Cq80KKvY.js";import{a as xt}from"./Copy01-Br8MuAU9.js";import{u as Xi}from"./use-copy-BS5soA37.js";import{L as ye}from"./label-BL4W2KPI.js";import{s as Ys,p as Ji,f as Zi}from"./thread-intent-DzC9Ji46.js";import{V as el,E as gt,r as Bs,C as tl,w as sl}from"./virtual-mcp-Ux8j-_02.js";import{s as Ws}from"./slugify-CEUa2lfQ.js";import{b as nl,a as il,D as ll}from"./drawer-CTSig7Vj.js";import{u as al}from"./use-mobile-BsNhhNj1.js";import{d as vt}from"./delay-CnY5UFtP.js";import{b as rl}from"./sandbox-url-D3mC8qhT.js";import{S as ol,a as cl,b as dl}from"./secret-picker-BoK4uSMi.js";import{u as ul,a as ml}from"./use-secrets-CFDBcYIs.js";import{o as ss}from"./omit-sandbox-map-jj4lCB2U.js";import{G as fl}from"./repository-picker-DOtWfpYo.js";import{r as pl}from"./serial-task-queue-CGOeQgpr.js";import{t as De,c as Qe,m as hl,a as Ks}from"./differenceInSeconds-C3x8sHUj.js";function nt(l,e){const s=ft(),n=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??s.weekStartsOn??s.locale?.options?.weekStartsOn??0,i=De(l,e?.in),a=i.getDay(),c=(a<n?7:0)+a-n;return i.setDate(i.getDate()-c),i.setHours(0,0,0,0),i}function mt(l,e){return nt(l,{...e,weekStartsOn:1})}function Gs(l,e){const s=De(l,e?.in),n=s.getFullYear(),i=Qe(s,0);i.setFullYear(n+1,0,4),i.setHours(0,0,0,0);const a=mt(i),c=Qe(s,0);c.setFullYear(n,0,4),c.setHours(0,0,0,0);const r=mt(c);return s.getTime()>=a.getTime()?n+1:s.getTime()>=r.getTime()?n:n-1}function ns(l,e){const s=De(l,e?.in);return s.setHours(0,0,0,0),s}function xl(l,e,s){const[n,i]=Pn(s?.in,l,e),a=ns(n),c=ns(i),r=+a-Kt(a),p=+c-Kt(c);return Math.round((r-p)/hl)}function gl(l,e){const s=Gs(l,e),n=Qe(l,0);return n.setFullYear(s,0,4),n.setHours(0,0,0,0),mt(n)}function vl(l){return l instanceof Date||typeof l=="object"&&Object.prototype.toString.call(l)==="[object Date]"}function bl(l){return!(!vl(l)&&typeof l!="number"||isNaN(+De(l)))}function jl(l,e){const s=De(l,e?.in);return s.setFullYear(s.getFullYear(),0,1),s.setHours(0,0,0,0),s}function yl(l,e){const s=De(l,e?.in);return xl(s,jl(s))+1}function wl(l,e){const s=De(l,e?.in),n=+mt(s)-+gl(s);return Math.round(n/Ks)+1}function qs(l,e){const s=De(l,e?.in),n=s.getFullYear(),i=ft(),a=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,c=Qe(e?.in||l,0);c.setFullYear(n+1,0,a),c.setHours(0,0,0,0);const r=nt(c,e),p=Qe(e?.in||l,0);p.setFullYear(n,0,a),p.setHours(0,0,0,0);const o=nt(p,e);return+s>=+r?n+1:+s>=+o?n:n-1}function Sl(l,e){const s=ft(),n=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,i=qs(l,e),a=Qe(e?.in||l,0);return a.setFullYear(i,0,n),a.setHours(0,0,0,0),nt(a,e)}function Nl(l,e){const s=De(l,e?.in),n=+nt(s,e)-+Sl(s,e);return Math.round(n/Ks)+1}function re(l,e){const s=l<0?"-":"",n=Math.abs(l).toString().padStart(e,"0");return s+n}const Ee={y(l,e){const s=l.getFullYear(),n=s>0?s:1-s;return re(e==="yy"?n%100:n,e.length)},M(l,e){const s=l.getMonth();return e==="M"?String(s+1):re(s+1,2)},d(l,e){return re(l.getDate(),e.length)},a(l,e){const s=l.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return s.toUpperCase();case"aaa":return s;case"aaaaa":return s[0];default:return s==="am"?"a.m.":"p.m."}},h(l,e){return re(l.getHours()%12||12,e.length)},H(l,e){return re(l.getHours(),e.length)},m(l,e){return re(l.getMinutes(),e.length)},s(l,e){return re(l.getSeconds(),e.length)},S(l,e){const s=e.length,n=l.getMilliseconds(),i=Math.trunc(n*Math.pow(10,s-3));return re(i,e.length)}},qe={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},is={G:function(l,e,s){const n=l.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return s.era(n,{width:"abbreviated"});case"GGGGG":return s.era(n,{width:"narrow"});default:return s.era(n,{width:"wide"})}},y:function(l,e,s){if(e==="yo"){const n=l.getFullYear(),i=n>0?n:1-n;return s.ordinalNumber(i,{unit:"year"})}return Ee.y(l,e)},Y:function(l,e,s,n){const i=qs(l,n),a=i>0?i:1-i;if(e==="YY"){const c=a%100;return re(c,2)}return e==="Yo"?s.ordinalNumber(a,{unit:"year"}):re(a,e.length)},R:function(l,e){const s=Gs(l);return re(s,e.length)},u:function(l,e){const s=l.getFullYear();return re(s,e.length)},Q:function(l,e,s){const n=Math.ceil((l.getMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return re(n,2);case"Qo":return s.ordinalNumber(n,{unit:"quarter"});case"QQQ":return s.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return s.quarter(n,{width:"narrow",context:"formatting"});default:return s.quarter(n,{width:"wide",context:"formatting"})}},q:function(l,e,s){const n=Math.ceil((l.getMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return re(n,2);case"qo":return s.ordinalNumber(n,{unit:"quarter"});case"qqq":return s.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return s.quarter(n,{width:"narrow",context:"standalone"});default:return s.quarter(n,{width:"wide",context:"standalone"})}},M:function(l,e,s){const n=l.getMonth();switch(e){case"M":case"MM":return Ee.M(l,e);case"Mo":return s.ordinalNumber(n+1,{unit:"month"});case"MMM":return s.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return s.month(n,{width:"narrow",context:"formatting"});default:return s.month(n,{width:"wide",context:"formatting"})}},L:function(l,e,s){const n=l.getMonth();switch(e){case"L":return String(n+1);case"LL":return re(n+1,2);case"Lo":return s.ordinalNumber(n+1,{unit:"month"});case"LLL":return s.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return s.month(n,{width:"narrow",context:"standalone"});default:return s.month(n,{width:"wide",context:"standalone"})}},w:function(l,e,s,n){const i=Nl(l,n);return e==="wo"?s.ordinalNumber(i,{unit:"week"}):re(i,e.length)},I:function(l,e,s){const n=wl(l);return e==="Io"?s.ordinalNumber(n,{unit:"week"}):re(n,e.length)},d:function(l,e,s){return e==="do"?s.ordinalNumber(l.getDate(),{unit:"date"}):Ee.d(l,e)},D:function(l,e,s){const n=yl(l);return e==="Do"?s.ordinalNumber(n,{unit:"dayOfYear"}):re(n,e.length)},E:function(l,e,s){const n=l.getDay();switch(e){case"E":case"EE":case"EEE":return s.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return s.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(n,{width:"short",context:"formatting"});default:return s.day(n,{width:"wide",context:"formatting"})}},e:function(l,e,s,n){const i=l.getDay(),a=(i-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(a);case"ee":return re(a,2);case"eo":return s.ordinalNumber(a,{unit:"day"});case"eee":return s.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return s.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(i,{width:"short",context:"formatting"});default:return s.day(i,{width:"wide",context:"formatting"})}},c:function(l,e,s,n){const i=l.getDay(),a=(i-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(a);case"cc":return re(a,e.length);case"co":return s.ordinalNumber(a,{unit:"day"});case"ccc":return s.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return s.day(i,{width:"narrow",context:"standalone"});case"cccccc":return s.day(i,{width:"short",context:"standalone"});default:return s.day(i,{width:"wide",context:"standalone"})}},i:function(l,e,s){const n=l.getDay(),i=n===0?7:n;switch(e){case"i":return String(i);case"ii":return re(i,e.length);case"io":return s.ordinalNumber(i,{unit:"day"});case"iii":return s.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return s.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return s.day(n,{width:"short",context:"formatting"});default:return s.day(n,{width:"wide",context:"formatting"})}},a:function(l,e,s){const i=l.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return s.dayPeriod(i,{width:"narrow",context:"formatting"});default:return s.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(l,e,s){const n=l.getHours();let i;switch(n===12?i=qe.noon:n===0?i=qe.midnight:i=n/12>=1?"pm":"am",e){case"b":case"bb":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return s.dayPeriod(i,{width:"narrow",context:"formatting"});default:return s.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(l,e,s){const n=l.getHours();let i;switch(n>=17?i=qe.evening:n>=12?i=qe.afternoon:n>=4?i=qe.morning:i=qe.night,e){case"B":case"BB":case"BBB":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return s.dayPeriod(i,{width:"narrow",context:"formatting"});default:return s.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(l,e,s){if(e==="ho"){let n=l.getHours()%12;return n===0&&(n=12),s.ordinalNumber(n,{unit:"hour"})}return Ee.h(l,e)},H:function(l,e,s){return e==="Ho"?s.ordinalNumber(l.getHours(),{unit:"hour"}):Ee.H(l,e)},K:function(l,e,s){const n=l.getHours()%12;return e==="Ko"?s.ordinalNumber(n,{unit:"hour"}):re(n,e.length)},k:function(l,e,s){let n=l.getHours();return n===0&&(n=24),e==="ko"?s.ordinalNumber(n,{unit:"hour"}):re(n,e.length)},m:function(l,e,s){return e==="mo"?s.ordinalNumber(l.getMinutes(),{unit:"minute"}):Ee.m(l,e)},s:function(l,e,s){return e==="so"?s.ordinalNumber(l.getSeconds(),{unit:"second"}):Ee.s(l,e)},S:function(l,e){return Ee.S(l,e)},X:function(l,e,s){const n=l.getTimezoneOffset();if(n===0)return"Z";switch(e){case"X":return as(n);case"XXXX":case"XX":return Le(n);default:return Le(n,":")}},x:function(l,e,s){const n=l.getTimezoneOffset();switch(e){case"x":return as(n);case"xxxx":case"xx":return Le(n);default:return Le(n,":")}},O:function(l,e,s){const n=l.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+ls(n,":");default:return"GMT"+Le(n,":")}},z:function(l,e,s){const n=l.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+ls(n,":");default:return"GMT"+Le(n,":")}},t:function(l,e,s){const n=Math.trunc(+l/1e3);return re(n,e.length)},T:function(l,e,s){return re(+l,e.length)}};function ls(l,e=""){const s=l>0?"-":"+",n=Math.abs(l),i=Math.trunc(n/60),a=n%60;return a===0?s+String(i):s+String(i)+e+re(a,2)}function as(l,e){return l%60===0?(l>0?"-":"+")+re(Math.abs(l)/60,2):Le(l,e)}function Le(l,e=""){const s=l>0?"-":"+",n=Math.abs(l),i=re(Math.trunc(n/60),2),a=re(n%60,2);return s+i+e+a}const rs=(l,e)=>{switch(l){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}},Hs=(l,e)=>{switch(l){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}},Cl=(l,e)=>{const s=l.match(/(P+)(p+)?/)||[],n=s[1],i=s[2];if(!i)return rs(l,e);let a;switch(n){case"P":a=e.dateTime({width:"short"});break;case"PP":a=e.dateTime({width:"medium"});break;case"PPP":a=e.dateTime({width:"long"});break;default:a=e.dateTime({width:"full"});break}return a.replace("{{date}}",rs(n,e)).replace("{{time}}",Hs(i,e))},kl={p:Hs,P:Cl},Ml=/^D+$/,_l=/^Y+$/,Vl=["D","DD","YY","YYYY"];function Tl(l){return Ml.test(l)}function Dl(l){return _l.test(l)}function Pl(l,e,s){const n=Ol(l,e,s);if(console.warn(n),Vl.includes(l))throw new RangeError(n)}function Ol(l,e,s){const n=l[0]==="Y"?"years":"days of the month";return`Use \`${l.toLowerCase()}\` instead of \`${l}\` (in \`${e}\`) for formatting ${n} to the input \`${s}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Il=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Al=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,$l=/^'([^]*?)'?$/,Fl=/''/g,El=/[a-zA-Z]/;function zl(l,e,s){const n=ft(),i=s?.locale??n.locale??On,a=s?.firstWeekContainsDate??s?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,c=s?.weekStartsOn??s?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=De(l,s?.in);if(!bl(r))throw new RangeError("Invalid time value");let p=e.match(Al).map(f=>{const m=f[0];if(m==="p"||m==="P"){const u=kl[m];return u(f,i.formatLong)}return f}).join("").match(Il).map(f=>{if(f==="''")return{isToken:!1,value:"'"};const m=f[0];if(m==="'")return{isToken:!1,value:Rl(f)};if(is[m])return{isToken:!0,value:f};if(m.match(El))throw new RangeError("Format string contains an unescaped latin alphabet character `"+m+"`");return{isToken:!1,value:f}});i.localize.preprocessor&&(p=i.localize.preprocessor(r,p));const o={firstWeekContainsDate:a,weekStartsOn:c,locale:i};return p.map(f=>{if(!f.isToken)return f.value;const m=f.value;(!s?.useAdditionalWeekYearTokens&&Dl(m)||!s?.useAdditionalDayOfYearTokens&&Tl(m))&&Pl(m,e,String(l));const u=is[m[0]];return u(r,m,i.localize,o)}).join("")}function Rl(l){const e=l.match($l);return e?e[1].replace(Fl,"'"):l}const Qs=25*1024*1024,yt="home",wt="knowledge";function os(l){return l==null?"":l<1024?`${l} B`:l<1024*1024?`${(l/1024).toFixed(0)} KB`:`${(l/(1024*1024)).toFixed(1)} MB`}function Re(l){return l.split("/").pop()??l}function Ll(l){const e=q.c(64),{form:s}=l,n=Z(),{upload:i}=vi(yt),a=bi(),c=Q.useRef(null),[r,p]=Q.useState(!1),[o,f]=Q.useState(""),[m,u]=Q.useState(!1);let h;e[0]!==r?(h={enabled:r},e[0]=r,e[1]=h):h=e[1];const{data:d}=ji(60,h),x=d===void 0?[]:d;let g;e[2]!==r?(g={enabled:r},e[2]=r,e[3]=g):g=e[3];const{data:v}=yi(g),y=v===void 0?[]:v;let j;e[4]!==s?(j=()=>s.getValues("metadata.knowledge")??[],e[4]=s,e[5]=j):j=e[5];const[b,S]=Q.useState(j);let N;e[6]!==s?(N=I=>{S(I),s.setValue("metadata.knowledge",I,{shouldDirty:!0})},e[6]=s,e[7]=N):N=e[7];const k=N;let w;e[8]!==a||e[9]!==b||e[10]!==k||e[11]!==n||e[12]!==i?(w=async I=>{if(!I||I.length===0)return;const ne=Array.from(I),L=ne.filter(ql),ee=ne.filter(Gl);if(ee.length>0&&oe.warning(n("virtualMcp.filesSection.fileTooLargeTitle"),{description:n("virtualMcp.filesSection.fileTooLargeDescription",{names:ee.map(Kl).join(", ")})}),L.length!==0){try{await i.mutateAsync({dir:wt,files:L})}catch(J){const pe=J;oe.error(pe instanceof Error?pe.message:n("virtualMcp.filesSection.failedUploadFile"));return}k([...b,...L.map(J=>({id:crypto.randomUUID(),name:J.name,volume:yt,path:`${wt}/${J.name}`,url:a(yt,`${wt}/${J.name}`),contentType:J.type||null,size:J.size,addedAt:new Date().toISOString()}))])}},e[8]=a,e[9]=b,e[10]=k,e[11]=n,e[12]=i,e[13]=w):w=e[13];const C=w;let _;e[14]!==a||e[15]!==b||e[16]!==k?(_=I=>{b.some(ne=>ne.volume===I.volume&&ne.path===I.path)||(k([...b,{id:crypto.randomUUID(),name:Re(I.path),volume:I.volume,path:I.path,url:a(I.volume,I.path),contentType:null,size:I.size??null,addedAt:new Date().toISOString()}]),p(!1))},e[14]=a,e[15]=b,e[16]=k,e[17]=_):_=e[17];const T=_;let V;e[18]!==a||e[19]!==b||e[20]!==k?(V=I=>{b.some(ne=>ne.volume===I.volume&&ne.path===I.path)||(k([...b,{id:crypto.randomUUID(),name:Re(I.path),kind:"skill",volume:I.volume,path:I.path,url:a(I.volume,I.path),contentType:null,size:null,addedAt:new Date().toISOString()}]),p(!1))},e[18]=a,e[19]=b,e[20]=k,e[21]=V):V=e[21];const $=V;let D;e[22]!==b||e[23]!==k?(D=I=>{k(b.filter(ne=>ne.id!==I))},e[22]=b,e[23]=k,e[24]=D):D=e[24];const A=D;let P;e[25]===Symbol.for("react.memo_cache_sentinel")?(P=I=>{p(I),I&&f("")},e[25]=P):P=e[25];const E=P;let U;e[26]!==b?(U=new Set(b.map(Wl)),e[26]=b,e[27]=U):U=e[27];const K=U,Y=o.toLowerCase();let B;e[28]!==K?(B=I=>!K.has(`${I.volume}/${I.path}`),e[28]=K,e[29]=B):B=e[29];const z=x.filter(Bl).filter(B).filter(I=>Re(I.path).toLowerCase().includes(Y)).slice(0,5);let M;e[30]!==K?(M=I=>!K.has(`${I.volume}/${I.path}`),e[30]=K,e[31]=M):M=e[31];const O=y.filter(M).filter(I=>Re(I.path).toLowerCase().includes(Y)).slice(0,5),G=I=>t.jsxs(vs,{open:r,onOpenChange:E,children:[t.jsx(bs,{asChild:!0,children:I}),t.jsxs(js,{align:"end",className:"w-56",children:[t.jsxs(He,{onSelect:()=>{c.current?.click()},children:[t.jsx(Hn,{size:16}),n("virtualMcp.filesSection.uploadFile")]}),t.jsxs(Ut,{children:[t.jsxs(Yt,{className:"gap-2 [&_svg:not([class*='text-'])]:text-muted-foreground",children:[t.jsx(Qn,{size:16}),n("virtualMcp.filesSection.selectFileOrFolder")]}),t.jsxs(Bt,{className:"w-72 p-0",children:[t.jsxs("div",{className:"flex items-center gap-2 border-b px-3",children:[t.jsx(Ct,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsx("input",{value:o,onChange:ne=>f(ne.target.value),onKeyDown:Yl,placeholder:n("virtualMcp.filesSection.searchFilesPlaceholder"),className:"h-10 w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),t.jsx("div",{className:"max-h-64 overflow-y-auto p-1",children:z.length===0?t.jsx("p",{className:"px-2 py-3 text-center text-sm text-muted-foreground",children:n("virtualMcp.filesSection.noFilesFound")}):z.map(ne=>t.jsxs(He,{onSelect:()=>T(ne),children:[t.jsx(Zt,{filename:Re(ne.path),className:"h-5 w-4 shrink-0"}),t.jsx("span",{className:"flex-1 truncate",children:Re(ne.path)}),ne.size!=null&&t.jsx("span",{className:"text-xs text-muted-foreground",children:os(ne.size)})]},`${ne.volume}/${ne.path}`))})]})]}),t.jsxs(Ut,{children:[t.jsxs(Yt,{className:"gap-2 [&_svg:not([class*='text-'])]:text-muted-foreground",children:[t.jsx(dt,{size:16}),n("virtualMcp.filesSection.selectSkill")]}),t.jsxs(Bt,{className:"w-72 p-0",children:[t.jsxs("div",{className:"flex items-center gap-2 border-b px-3",children:[t.jsx(Ct,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsx("input",{value:o,onChange:ne=>f(ne.target.value),onKeyDown:Ul,placeholder:n("virtualMcp.filesSection.searchSkillsPlaceholder"),className:"h-10 w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),t.jsx("div",{className:"max-h-64 overflow-y-auto p-1",children:O.length===0?t.jsx("p",{className:"px-2 py-3 text-center text-sm text-muted-foreground",children:n("virtualMcp.filesSection.noSkillsFound")}):O.map(ne=>t.jsxs(He,{onSelect:()=>$(ne),children:[t.jsx(dt,{size:16,className:"shrink-0"}),t.jsx("span",{className:"flex-1 truncate",children:Re(ne.path)})]},`${ne.volume}/${ne.path}`))})]})]})]})]}),R="flex flex-col gap-3";let F;e[32]!==n?(F=n("virtualMcp.filesSection.filesAndSkills"),e[32]=n,e[33]=F):F=e[33];let W;e[34]!==F?(W=t.jsx("h2",{className:"text-sm font-medium text-foreground",children:F}),e[34]=F,e[35]=W):W=e[35];let H;e[36]!==n?(H=n("virtualMcp.filesSection.description"),e[36]=n,e[37]=H):H=e[37];let se;e[38]!==H?(se=t.jsx("p",{className:"text-sm text-muted-foreground",children:H}),e[38]=H,e[39]=se):se=e[39];let le;e[40]!==W||e[41]!==se?(le=t.jsxs("div",{className:"flex flex-col gap-1",children:[W,se]}),e[40]=W,e[41]=se,e[42]=le):le=e[42];const ce=b.length>0&&G(t.jsxs(te,{variant:"outline",size:"sm",disabled:i.isPending,children:[i.isPending?t.jsx(it,{size:"xs"}):t.jsx(Pe,{size:14}),n("virtualMcp.filesSection.add")]}));let ae;e[43]!==le||e[44]!==ce?(ae=t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[le,ce]}),e[43]=le,e[44]=ce,e[45]=ae):ae=e[45];let ie;e[46]!==C?(ie=t.jsx("input",{ref:c,type:"file",multiple:!0,className:"hidden",onChange:I=>{C(I.target.files),I.target.value=""}}),e[46]=C,e[47]=ie):ie=e[47];let X,de;e[48]===Symbol.for("react.memo_cache_sentinel")?(X=I=>{I.preventDefault(),u(!0)},de=()=>u(!1),e[48]=X,e[49]=de):(X=e[48],de=e[49]);let ue;e[50]!==C?(ue=I=>{I.preventDefault(),I.stopPropagation(),u(!1),C(I.dataTransfer.files)},e[50]=C,e[51]=ue):ue=e[51];const he=m&&"outline outline-2 outline-dashed outline-primary";let me;e[52]!==he?(me=ve("flex flex-col gap-2 rounded-lg",he),e[52]=he,e[53]=me):me=e[53];const xe=b.length===0?G(t.jsxs("button",{type:"button",className:"flex items-center gap-3 px-3 py-2.5 rounded-lg border border-dashed border-border hover:bg-accent/50 transition-colors w-full text-left cursor-pointer",children:[t.jsx("div",{className:"flex items-center justify-center size-8 rounded-md text-muted-foreground/75 border border-dashed border-border shrink-0",children:t.jsx(Pe,{size:16})}),t.jsx("span",{className:"text-sm text-muted-foreground flex-1",children:n("virtualMcp.filesSection.noFilesOrSkillsYet")})]})):b.map(I=>t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 rounded-xl border bg-card",children:[I.kind==="skill"?t.jsx("div",{className:"flex items-center justify-center h-8 w-6.5 shrink-0 rounded-md bg-muted text-muted-foreground",children:t.jsx(dt,{size:16})}):t.jsx(Zt,{filename:I.name,className:"h-8 w-6.5 shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:I.name}),t.jsx("p",{className:"text-xs text-muted-foreground",children:I.kind==="skill"?n("virtualMcp.filesSection.kindSkill"):I.size!=null?os(I.size):n("virtualMcp.filesSection.kindFile")})]}),t.jsx(te,{variant:"ghost",size:"icon",onClick:()=>A(I.id),"aria-label":n("virtualMcp.filesSection.removeAriaLabel",{name:I.name}),children:t.jsx(It,{size:16})})]},I.id));let ge;e[54]!==X||e[55]!==de||e[56]!==ue||e[57]!==me||e[58]!==xe?(ge=t.jsx("div",{onDragOver:X,onDragLeave:de,onDrop:ue,className:me,children:xe}),e[54]=X,e[55]=de,e[56]=ue,e[57]=me,e[58]=xe,e[59]=ge):ge=e[59];let fe;return e[60]!==ae||e[61]!==ie||e[62]!==ge?(fe=t.jsxs("section",{className:R,children:[ae,ie,ge]}),e[60]=ae,e[61]=ie,e[62]=ge,e[63]=fe):fe=e[63],fe}function Ul(l){return l.stopPropagation()}function Yl(l){return l.stopPropagation()}function Bl(l){return l.kind!=="dir"}function Wl(l){return`${l.volume}/${l.path}`}function Kl(l){return l.name}function Gl(l){return l.size>Qs}function ql(l){return l.size<=Qs}function Hl(l){return l==null?"all":l.length===0?"self":"selected"}function Ql(l){const e=q.c(88),{form:s,currentAgentId:n}=l,i=Z(),{org:a}=Fe(),c=Kn(),[r,p]=Q.useState(!1);let o;e[0]!==s?(o=s.getValues("metadata.subAgents")??null,e[0]=s,e[1]=o):o=e[1];const f=o;let m;e[2]!==f?(m=()=>Hl(f),e[2]=f,e[3]=m):m=e[3];const[u,h]=Q.useState(m);let d;e[4]!==f?(d=f??[],e[4]=f,e[5]=d):d=e[5];const[x,g]=Q.useState(d);let v,y,j,b,S,N;if(e[6]!==c||e[7]!==n||e[8]!==s||e[9]!==u||e[10]!==a||e[11]!==x||e[12]!==i){let _;e[19]!==n||e[20]!==a?(_=X=>X.id!==n&&X.id!==a.id&&X.status==="active",e[19]=n,e[20]=a,e[21]=_):_=e[21],v=c.filter(_);let T;e[22]!==x?(T=X=>x.includes(X.id),e[22]=x,e[23]=T):T=e[23];const V=v.filter(T);let $;e[24]!==s?($=(X,de)=>s.setValue("metadata.subAgents",X==="all"?null:X==="self"?[]:de,{shouldDirty:!0}),e[24]=s,e[25]=$):$=e[25];const D=$;let A;e[26]!==D||e[27]!==x?(A=X=>{h(X),D(X,x)},e[26]=D,e[27]=x,e[28]=A):A=e[28];const P=A;let E;e[29]!==D||e[30]!==x?(E=X=>{const de=x.includes(X)?x.filter(ue=>ue!==X):[...x,X];g(de),D("selected",de)},e[29]=D,e[30]=x,e[31]=E):E=e[31],y=E,S="flex flex-col gap-3";let U;e[32]!==i?(U=i("virtualMcp.subAgentsSection.title"),e[32]=i,e[33]=U):U=e[33];let K;e[34]!==U?(K=t.jsx("h2",{className:"text-sm font-medium text-foreground",children:U}),e[34]=U,e[35]=K):K=e[35];let Y;e[36]!==u||e[37]!==i?(Y=u==="all"&&t.jsx("p",{className:"text-sm text-muted-foreground",children:i("virtualMcp.subAgentsSection.canDelegateToAnyAgent")}),e[36]=u,e[37]=i,e[38]=Y):Y=e[38];let B;e[39]!==u||e[40]!==i?(B=u==="self"&&t.jsx("p",{className:"text-sm text-muted-foreground",children:i("virtualMcp.subAgentsSection.canOnlyDelegateToItself")}),e[39]=u,e[40]=i,e[41]=B):B=e[41];let z;e[42]!==K||e[43]!==Y||e[44]!==B?(z=t.jsxs("div",{className:"flex flex-col gap-1",children:[K,Y,B]}),e[42]=K,e[43]=Y,e[44]=B,e[45]=z):z=e[45];const M=u==="selected"&&V.length>0&&t.jsxs(te,{variant:"outline",size:"sm",onClick:()=>p(!0),children:[t.jsx(Pe,{size:14}),i("virtualMcp.subAgentsSection.addSubAgent")]});let O;e[46]!==P?(O=X=>P(X),e[46]=P,e[47]=O):O=e[47];let G;e[48]===Symbol.for("react.memo_cache_sentinel")?(G=t.jsx(Oe,{size:"sm",className:"w-auto",children:t.jsx(Ie,{})}),e[48]=G):G=e[48];let R;e[49]!==i?(R=i("virtualMcp.subAgentsSection.anyAgent"),e[49]=i,e[50]=R):R=e[50];let F;e[51]!==R?(F=t.jsx(we,{value:"all",children:R}),e[51]=R,e[52]=F):F=e[52];let W;e[53]!==i?(W=i("virtualMcp.subAgentsSection.specificAgents"),e[53]=i,e[54]=W):W=e[54];let H;e[55]!==W?(H=t.jsx(we,{value:"selected",children:W}),e[55]=W,e[56]=H):H=e[56];let se;e[57]!==i?(se=i("virtualMcp.subAgentsSection.onlyItself"),e[57]=i,e[58]=se):se=e[58];let le;e[59]!==se?(le=t.jsx(we,{value:"self",children:se}),e[59]=se,e[60]=le):le=e[60];let ce;e[61]!==F||e[62]!==H||e[63]!==le?(ce=t.jsxs(Ae,{align:"end",children:[F,H,le]}),e[61]=F,e[62]=H,e[63]=le,e[64]=ce):ce=e[64];let ae;e[65]!==u||e[66]!==O||e[67]!==ce?(ae=t.jsxs($e,{value:u,onValueChange:O,children:[G,ce]}),e[65]=u,e[66]=O,e[67]=ce,e[68]=ae):ae=e[68];let ie;e[69]!==M||e[70]!==ae?(ie=t.jsxs("div",{className:"flex items-center gap-2",children:[M,ae]}),e[69]=M,e[70]=ae,e[71]=ie):ie=e[71],e[72]!==z||e[73]!==ie?(N=t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[z,ie]}),e[72]=z,e[73]=ie,e[74]=N):N=e[74],j="flex flex-col gap-2",b=u==="selected"&&(V.length>0?V.map(X=>t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 rounded-xl border bg-background",children:[t.jsx(Ze,{icon:X.icon,name:X.title,size:"sm",className:"shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:X.title}),X.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:X.description})]}),t.jsx(te,{variant:"ghost",size:"icon",onClick:()=>y(X.id),children:t.jsx(At,{size:16})})]},X.id)):t.jsxs("button",{type:"button",onClick:()=>p(!0),className:"flex items-center gap-3 px-3 py-2.5 rounded-lg border border-dashed border-border hover:bg-accent/50 transition-colors w-full text-left cursor-pointer",children:[t.jsx("div",{className:"flex items-center justify-center size-8 rounded-md text-muted-foreground/75 border border-dashed border-border shrink-0",children:t.jsx(Pe,{size:16})}),t.jsx("span",{className:"text-sm text-muted-foreground",children:i("virtualMcp.subAgentsSection.emptyStateMessage")})]})),e[6]=c,e[7]=n,e[8]=s,e[9]=u,e[10]=a,e[11]=x,e[12]=i,e[13]=v,e[14]=y,e[15]=j,e[16]=b,e[17]=S,e[18]=N}else v=e[13],y=e[14],j=e[15],b=e[16],S=e[17],N=e[18];let k;e[75]!==j||e[76]!==b?(k=t.jsx("div",{className:j,children:b}),e[75]=j,e[76]=b,e[77]=k):k=e[77];let w;e[78]!==v||e[79]!==y||e[80]!==r||e[81]!==x?(w=t.jsx(Xl,{open:r,onOpenChange:p,candidates:v,selectedIds:x,onToggle:y}),e[78]=v,e[79]=y,e[80]=r,e[81]=x,e[82]=w):w=e[82];let C;return e[83]!==S||e[84]!==N||e[85]!==k||e[86]!==w?(C=t.jsxs("section",{className:S,children:[N,k,w]}),e[83]=S,e[84]=N,e[85]=k,e[86]=w,e[87]=C):C=e[87],C}function Xl(l){const e=q.c(39),{open:s,onOpenChange:n,candidates:i,selectedIds:a,onToggle:c}=l,r=Z(),[p,o]=Q.useState("");let f,m,u,h,d,x,g,v,y;if(e[0]!==i||e[1]!==n||e[2]!==c||e[3]!==s||e[4]!==p||e[5]!==a||e[6]!==r){const N=p.toLowerCase(),k=i.filter(_=>_.title.toLowerCase().includes(N)||_.description?.toLowerCase().includes(N));m=Xe,v=s,y=n,f=Je,d="max-w-md";let w;e[16]!==r?(w=r("virtualMcp.subAgentsSection.title"),e[16]=r,e[17]=w):w=e[17],e[18]!==w?(x=t.jsx(lt,{children:t.jsx(at,{children:w})}),e[18]=w,e[19]=x):x=e[19];let C;e[20]!==r?(C=r("virtualMcp.subAgentsSection.searchPlaceholder"),e[20]=r,e[21]=C):C=e[21],e[22]!==p||e[23]!==C?(g=t.jsx(wi,{value:p,onChange:o,placeholder:C,className:"w-full"}),e[22]=p,e[23]=C,e[24]=g):g=e[24],u="flex flex-col gap-1 max-h-80 overflow-y-auto",h=k.length===0?t.jsx("p",{className:"text-sm text-muted-foreground px-1 py-4 text-center",children:r("virtualMcp.subAgentsSection.noAgentsFound")}):k.map(_=>t.jsxs("button",{type:"button",onClick:()=>c(_.id),className:"flex items-center gap-3 px-2 py-2 rounded-lg hover:bg-accent/50 transition-colors cursor-pointer w-full text-left",children:[t.jsx(Is,{checked:a.includes(_.id),className:"pointer-events-none",tabIndex:-1}),t.jsx(Ze,{icon:_.icon,name:_.title,size:"sm",className:"shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:_.title}),_.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:_.description})]})]},_.id)),e[0]=i,e[1]=n,e[2]=c,e[3]=s,e[4]=p,e[5]=a,e[6]=r,e[7]=f,e[8]=m,e[9]=u,e[10]=h,e[11]=d,e[12]=x,e[13]=g,e[14]=v,e[15]=y}else f=e[7],m=e[8],u=e[9],h=e[10],d=e[11],x=e[12],g=e[13],v=e[14],y=e[15];let j;e[25]!==u||e[26]!==h?(j=t.jsx("div",{className:u,children:h}),e[25]=u,e[26]=h,e[27]=j):j=e[27];let b;e[28]!==f||e[29]!==d||e[30]!==x||e[31]!==g||e[32]!==j?(b=t.jsxs(f,{className:d,children:[x,g,j]}),e[28]=f,e[29]=d,e[30]=x,e[31]=g,e[32]=j,e[33]=b):b=e[33];let S;return e[34]!==m||e[35]!==v||e[36]!==y||e[37]!==b?(S=t.jsx(m,{open:v,onOpenChange:y,children:b}),e[34]=m,e[35]=v,e[36]=y,e[37]=b,e[38]=S):S=e[38],S}function st(){const l=q.c(1);let e;return l[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"flex items-center justify-center h-32",children:t.jsx(it,{className:"size-6 text-muted-foreground"})}),l[0]=e):e=l[0],e}function ct(l,e){return({error:s})=>s?.message?.includes("Method not found")||s?.code===-32601?t.jsx("div",{className:"flex-1 overflow-auto px-4 py-3 space-y-1",children:t.jsx("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:l})}):t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center h-full p-6 text-center space-y-4",children:[t.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:t.jsx(ys,{className:"h-6 w-6 text-destructive"})}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("h3",{className:"text-lg font-medium",children:e("virtualMcp.dependencySelectionDialog.somethingWentWrong")}),t.jsx("p",{className:"text-sm text-muted-foreground max-w-xs mx-auto",children:s?.message?s.message.length>200?`${s.message.slice(0,200)}...`:s.message:e("virtualMcp.dependencySelectionDialog.unexpectedError")})]})]})}function Xs(l){const e=q.c(23),{item:s,isSelected:n,onToggle:i,disabled:a}=l,c=a?"cursor-not-allowed opacity-50":"cursor-pointer",r=n?"bg-accent/25":"hover:bg-muted/50";let p;e[0]!==c||e[1]!==r?(p=ve("flex items-start gap-3 p-4 rounded-lg transition-colors",c,r),e[0]=c,e[1]=r,e[2]=p):p=e[2];let o;e[3]!==s.name?(o=t.jsx("p",{className:"text-sm font-medium leading-none truncate",children:s.name}),e[3]=s.name,e[4]=o):o=e[4];let f;e[5]!==s.tags?(f=s.tags&&t.jsx("span",{className:"shrink-0",children:s.tags}),e[5]=s.tags,e[6]=f):f=e[6];let m;e[7]!==o||e[8]!==f?(m=t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[o,f]}),e[7]=o,e[8]=f,e[9]=m):m=e[9];let u;e[10]!==s.description?(u=s.description&&t.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:s.description}),e[10]=s.description,e[11]=u):u=e[11];let h;e[12]!==m||e[13]!==u?(h=t.jsxs("div",{className:"flex-1 min-w-0 space-y-2",children:[m,u]}),e[12]=m,e[13]=u,e[14]=h):h=e[14];let d;e[15]!==a||e[16]!==n||e[17]!==i?(d=t.jsx(Is,{checked:n,onCheckedChange:i,disabled:a,className:"mt-0.5"}),e[15]=a,e[16]=n,e[17]=i,e[18]=d):d=e[18];let x;return e[19]!==p||e[20]!==h||e[21]!==d?(x=t.jsxs("label",{className:p,children:[h,d]}),e[19]=p,e[20]=h,e[21]=d,e[22]=x):x=e[22],x}function Jl(l){const e=q.c(35),{activeTab:s,onTabChange:n,showSelectAll:i,isAllSelected:a,handleSelectAll:c}=l,r=Z();let p;e[0]!==r?(p=r("virtualMcp.dependencySelectionDialog.tabTools"),e[0]=r,e[1]=p):p=e[1];let o;e[2]!==p?(o={id:"tools",label:p},e[2]=p,e[3]=o):o=e[3];let f;e[4]!==r?(f=r("virtualMcp.dependencySelectionDialog.tabActive"),e[4]=r,e[5]=f):f=e[5];let m;e[6]!==f?(m={id:"active",label:f},e[6]=f,e[7]=m):m=e[7];let u;e[8]!==r?(u=r("virtualMcp.dependencySelectionDialog.tabResources"),e[8]=r,e[9]=u):u=e[9];let h;e[10]!==u?(h={id:"resources",label:u},e[10]=u,e[11]=h):h=e[11];let d;e[12]!==r?(d=r("virtualMcp.dependencySelectionDialog.tabPrompts"),e[12]=r,e[13]=d):d=e[13];let x;e[14]!==d?(x={id:"prompts",label:d},e[14]=d,e[15]=x):x=e[15];let g;e[16]!==o||e[17]!==m||e[18]!==h||e[19]!==x?(g=[o,m,h,x],e[16]=o,e[17]=m,e[18]=h,e[19]=x,e[20]=g):g=e[20];let v;e[21]!==n?(v=S=>n(S),e[21]=n,e[22]=v):v=e[22];let y;e[23]!==s||e[24]!==v||e[25]!==g?(y=t.jsx(Si,{tabs:g,activeTab:s,onTabChange:v}),e[23]=s,e[24]=v,e[25]=g,e[26]=y):y=e[26];let j;e[27]!==c||e[28]!==a||e[29]!==i||e[30]!==r?(j=i&&t.jsx("button",{type:"button",onClick:c,className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:r(a?"virtualMcp.dependencySelectionDialog.deselectAll":"virtualMcp.dependencySelectionDialog.selectAll")}),e[27]=c,e[28]=a,e[29]=i,e[30]=r,e[31]=j):j=e[31];let b;return e[32]!==y||e[33]!==j?(b=t.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-t border-border shrink-0",children:[y,j]}),e[32]=y,e[33]=j,e[34]=b):b=e[34],b}function Ft(l){const e=q.c(13),{items:s,selections:n,onToggle:i,emptyMessage:a,disabled:c}=l;let r,p,o;if(e[0]!==c||e[1]!==a||e[2]!==s||e[3]!==i||e[4]!==n){o=Symbol.for("react.early_return_sentinel");e:{const m=s.map(Zl);if(s.length===0){let u;e[8]!==a?(u=t.jsx("div",{className:"flex-1 overflow-auto px-4 py-3 space-y-1",children:t.jsx("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:a})}),e[8]=a,e[9]=u):u=e[9],o=u;break e}r="flex-1 overflow-auto px-4 py-3 space-y-1",p=s.map(u=>t.jsx(Xs,{item:u,isSelected:n===null||n?.includes(u.id),onToggle:()=>i(u.id,m),disabled:c},u.id))}e[0]=c,e[1]=a,e[2]=s,e[3]=i,e[4]=n,e[5]=r,e[6]=p,e[7]=o}else r=e[5],p=e[6],o=e[7];if(o!==Symbol.for("react.early_return_sentinel"))return o;let f;return e[10]!==r||e[11]!==p?(f=t.jsx("div",{className:r,children:p}),e[10]=r,e[11]=p,e[12]=f):f=e[12],f}function Zl(l){return l.id}function ea(l){const e=q.c(22),{connectionId:s,toolSelections:n,onToggleTool:i}=l,a=Z(),{org:c}=Fe();let r;e[0]!==s||e[1]!==c.id||e[2]!==c.slug?(r={connectionId:s,orgId:c.id,orgSlug:c.slug},e[0]=s,e[1]=c.id,e[2]=c.slug,e[3]=r):r=e[3];const p=pt(r);let o;e[4]!==p?(o={client:p},e[4]=p,e[5]=o):o=e[5];const{data:f}=Fs(o),m=f.tools;let u,h,d;if(e[6]!==f.tools||e[7]!==i||e[8]!==a||e[9]!==n){d=Symbol.for("react.early_return_sentinel");e:{const g=m.map(sa);let v;e[13]!==n?(v=b=>n===null||n.includes(b.name),e[13]=n,e[14]=v):v=e[14];const j=f.tools.filter(v).map(ta);if(j.length===0){let b;e[15]!==a?(b=a("virtualMcp.dependencySelectionDialog.noActiveToolsSelected"),e[15]=a,e[16]=b):b=e[16];let S;e[17]!==b?(S=t.jsx("div",{className:"flex-1 overflow-auto px-4 py-3 space-y-1",children:t.jsx("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:b})}),e[17]=b,e[18]=S):S=e[18],d=S;break e}u="flex-1 overflow-auto px-4 py-3 space-y-1",h=j.map(b=>t.jsx(Xs,{item:b,isSelected:!0,onToggle:()=>i(b.id,g)},b.id))}e[6]=f.tools,e[7]=i,e[8]=a,e[9]=n,e[10]=u,e[11]=h,e[12]=d}else u=e[10],h=e[11],d=e[12];if(d!==Symbol.for("react.early_return_sentinel"))return d;let x;return e[19]!==u||e[20]!==h?(x=t.jsx("div",{className:u,children:h}),e[19]=u,e[20]=h,e[21]=x):x=e[21],x}function ta(l){return{id:l.name,name:l.name,description:l.description,tags:t.jsx(As,{annotations:l.annotations,_meta:l._meta})}}function sa(l){return l.name}function na(l){const e=q.c(16),{connectionId:s,selections:n,onToggle:i,disabled:a}=l,{org:c}=Fe();let r;e[0]!==s||e[1]!==c.id||e[2]!==c.slug?(r={connectionId:s,orgId:c.id,orgSlug:c.slug},e[0]=s,e[1]=c.id,e[2]=c.slug,e[3]=r):r=e[3];const p=pt(r);let o;e[4]!==p?(o={client:p},e[4]=p,e[5]=o):o=e[5];const{data:f}=Fs(o);let m;e[6]!==f.tools?(m=f.tools.map(ia),e[6]=f.tools,e[7]=m):m=e[7];const u=m,h=Z();let d;e[8]!==h?(d=h("virtualMcp.dependencySelectionDialog.noToolsAvailable"),e[8]=h,e[9]=d):d=e[9];let x;return e[10]!==a||e[11]!==u||e[12]!==i||e[13]!==n||e[14]!==d?(x=t.jsx(Ft,{items:u,selections:n,onToggle:i,emptyMessage:d,disabled:a}),e[10]=a,e[11]=u,e[12]=i,e[13]=n,e[14]=d,e[15]=x):x=e[15],x}function ia(l){return{id:l.name,name:l.name,description:l.description,tags:t.jsx(As,{annotations:l.annotations,_meta:l._meta})}}function la(l){const e=q.c(16),{connectionId:s,selections:n,onToggle:i,disabled:a}=l,{org:c}=Fe();let r;e[0]!==s||e[1]!==c.id||e[2]!==c.slug?(r={connectionId:s,orgId:c.id,orgSlug:c.slug},e[0]=s,e[1]=c.id,e[2]=c.slug,e[3]=r):r=e[3];const p=pt(r);let o;e[4]!==p?(o={client:p},e[4]=p,e[5]=o):o=e[5];const{data:f}=an(o);let m;e[6]!==f.resources?(m=f.resources.map(aa),e[6]=f.resources,e[7]=m):m=e[7];const u=m,h=Z();let d;e[8]!==h?(d=h("virtualMcp.dependencySelectionDialog.noResourcesAvailable"),e[8]=h,e[9]=d):d=e[9];let x;return e[10]!==a||e[11]!==u||e[12]!==i||e[13]!==n||e[14]!==d?(x=t.jsx(Ft,{items:u,selections:n,onToggle:i,emptyMessage:d,disabled:a}),e[10]=a,e[11]=u,e[12]=i,e[13]=n,e[14]=d,e[15]=x):x=e[15],x}function aa(l){return{id:l.name||l.uri,name:l.name||l.uri,description:l.description}}function ra(l){const e=q.c(16),{connectionId:s,selections:n,onToggle:i,disabled:a}=l,{org:c}=Fe();let r;e[0]!==s||e[1]!==c.id||e[2]!==c.slug?(r={connectionId:s,orgId:c.id,orgSlug:c.slug},e[0]=s,e[1]=c.id,e[2]=c.slug,e[3]=r):r=e[3];const p=pt(r);let o;e[4]!==p?(o={client:p},e[4]=p,e[5]=o):o=e[5];const{data:f}=Ni(o);let m;e[6]!==f.prompts?(m=f.prompts.map(oa),e[6]=f.prompts,e[7]=m):m=e[7];const u=m,h=Z();let d;e[8]!==h?(d=h("virtualMcp.dependencySelectionDialog.noPromptsAvailable"),e[8]=h,e[9]=d):d=e[9];let x;return e[10]!==a||e[11]!==u||e[12]!==i||e[13]!==n||e[14]!==d?(x=t.jsx(Ft,{items:u,selections:n,onToggle:i,emptyMessage:d,disabled:a}),e[10]=a,e[11]=u,e[12]=i,e[13]=n,e[14]=d,e[15]=x):x=e[15],x}function oa(l){return{id:l.name,name:l.name,description:l.description}}function ca(l){const e=q.c(58),{currentConnection:s,activeTab:n,selectedId:i,formData:a,toggleTool:c,toggleResource:r,togglePrompt:p,toggleAllTools:o,toggleAllResources:f,toggleAllPrompts:m,onTabChange:u}=l,h=Z(),d=a[i],x=n==="tools"?d?.tools===null:n==="resources"?d?.resources===null:n==="prompts"?d?.prompts===null:!1,g=n!=="active";let v;e[0]!==n||e[1]!==i||e[2]!==m||e[3]!==f||e[4]!==o?(v=()=>{n==="tools"?o(i):n==="resources"?f(i):n==="prompts"&&m(i)},e[0]=n,e[1]=i,e[2]=m,e[3]=f,e[4]=o,e[5]=v):v=e[5];const y=v;let j;e[6]!==s.icon||e[7]!==s.title?(j=t.jsx(Ze,{icon:s.icon,name:s.title,size:"sm",className:"shrink-0"}),e[6]=s.icon,e[7]=s.title,e[8]=j):j=e[8];let b;e[9]!==s.title?(b=t.jsx("h2",{className:"text-base font-semibold truncate",children:s.title}),e[9]=s.title,e[10]=b):b=e[10];let S;e[11]!==s.description?(S=s.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s.description}),e[11]=s.description,e[12]=S):S=e[12];let N;e[13]!==b||e[14]!==S?(N=t.jsxs("div",{className:"flex-1 min-w-0",children:[b,S]}),e[13]=b,e[14]=S,e[15]=N):N=e[15];let k;e[16]!==j||e[17]!==N?(k=t.jsx("div",{className:"px-6 pt-5 pb-4 shrink-0",children:t.jsxs("div",{className:"flex items-center gap-3",children:[j,N]})}),e[16]=j,e[17]=N,e[18]=k):k=e[18];let w;e[19]!==n||e[20]!==y||e[21]!==x||e[22]!==u||e[23]!==g?(w=t.jsx(Jl,{activeTab:n,onTabChange:u,showSelectAll:g,isAllSelected:x,handleSelectAll:y}),e[19]=n,e[20]=y,e[21]=x,e[22]=u,e[23]=g,e[24]=w):w=e[24];let C;e[25]!==n||e[26]!==a||e[27]!==i||e[28]!==h||e[29]!==c?(C=n==="active"&&t.jsx(Ye,{fallback:ct(h("virtualMcp.dependencySelectionDialog.toolsNotSupported"),h),children:t.jsx(Q.Suspense,{fallback:t.jsx(st,{}),children:t.jsx(ea,{connectionId:i,toolSelections:a[i]?a[i].tools:[],onToggleTool:(A,P)=>c(i,A,P)})})}),e[25]=n,e[26]=a,e[27]=i,e[28]=h,e[29]=c,e[30]=C):C=e[30];let _;e[31]!==n||e[32]!==a||e[33]!==i||e[34]!==h||e[35]!==c?(_=n==="tools"&&t.jsx(Ye,{fallback:ct(h("virtualMcp.dependencySelectionDialog.toolsNotSupported"),h),children:t.jsx(Q.Suspense,{fallback:t.jsx(st,{}),children:t.jsx(na,{connectionId:i,selections:a[i]?a[i].tools:[],onToggle:(A,P)=>c(i,A,P)})})}),e[31]=n,e[32]=a,e[33]=i,e[34]=h,e[35]=c,e[36]=_):_=e[36];let T;e[37]!==n||e[38]!==a||e[39]!==i||e[40]!==h||e[41]!==r?(T=n==="resources"&&t.jsx(Ye,{fallback:ct(h("virtualMcp.dependencySelectionDialog.resourcesNotSupported"),h),children:t.jsx(Q.Suspense,{fallback:t.jsx(st,{}),children:t.jsx(la,{connectionId:i,selections:a[i]?a[i].resources:[],onToggle:(A,P)=>r(i,A,P)})})}),e[37]=n,e[38]=a,e[39]=i,e[40]=h,e[41]=r,e[42]=T):T=e[42];let V;e[43]!==n||e[44]!==a||e[45]!==i||e[46]!==h||e[47]!==p?(V=n==="prompts"&&t.jsx(Ye,{fallback:ct(h("virtualMcp.dependencySelectionDialog.promptsNotSupported"),h),children:t.jsx(Q.Suspense,{fallback:t.jsx(st,{}),children:t.jsx(ra,{connectionId:i,selections:a[i]?a[i].prompts:[],onToggle:(A,P)=>p(i,A,P)})})}),e[43]=n,e[44]=a,e[45]=i,e[46]=h,e[47]=p,e[48]=V):V=e[48];let $;e[49]!==T||e[50]!==V||e[51]!==C||e[52]!==_?($=t.jsxs("div",{className:"flex-1 overflow-hidden flex flex-col",children:[C,_,T,V]}),e[49]=T,e[50]=V,e[51]=C,e[52]=_,e[53]=$):$=e[53];let D;return e[54]!==$||e[55]!==k||e[56]!==w?(D=t.jsxs(t.Fragment,{children:[k,w,$]}),e[54]=$,e[55]=k,e[56]=w,e[57]=D):D=e[57],D}function da(l){const e=q.c(7),{onClose:s}=l,n=Z();let i;e[0]!==s?(i=()=>s(!1),e[0]=s,e[1]=i):i=e[1];let a;e[2]!==n?(a=n("virtualMcp.dependencySelectionDialog.done"),e[2]=n,e[3]=a):a=e[3];let c;return e[4]!==i||e[5]!==a?(c=t.jsx(Vt,{className:"px-6 py-4 border-t border-border shrink-0",children:t.jsx(te,{variant:"outline",onClick:i,children:a})}),e[4]=i,e[5]=a,e[6]=c):c=e[6],c}function ua(l){const e=q.c(23),{connectionId:s,onAuthenticate:n,children:i}=l,a=Z();let c;e[0]!==s?(c={connectionId:s},e[0]=s,e[1]=c):c=e[1];const r=$s(c);if(r.supportsOAuth&&!r.isAuthenticated){let f;e[2]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx("div",{className:"flex items-center justify-center size-12 rounded-full bg-muted",children:t.jsx(Xn,{size:22,className:"text-muted-foreground"})}),e[2]=f):f=e[2];let m;e[3]!==a?(m=a("virtualMcp.dependencySelectionDialog.authorizationRequired"),e[3]=a,e[4]=m):m=e[4];let u;e[5]!==m?(u=t.jsx("p",{className:"text-sm font-medium",children:m}),e[5]=m,e[6]=u):u=e[6];let h;e[7]!==a?(h=a("virtualMcp.dependencySelectionDialog.authorizationDescription"),e[7]=a,e[8]=h):h=e[8];let d;e[9]!==h?(d=t.jsx("p",{className:"text-xs text-muted-foreground max-w-xs",children:h}),e[9]=h,e[10]=d):d=e[10];let x;e[11]!==u||e[12]!==d?(x=t.jsxs("div",{className:"space-y-1",children:[u,d]}),e[11]=u,e[12]=d,e[13]=x):x=e[13];let g;e[14]!==s||e[15]!==n||e[16]!==a?(g=n&&t.jsx(te,{variant:"outline",size:"sm",onClick:()=>n(s),children:a("virtualMcp.dependencySelectionDialog.authorize")}),e[14]=s,e[15]=n,e[16]=a,e[17]=g):g=e[17];let v;return e[18]!==x||e[19]!==g?(v=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-4 p-8 text-center",children:[f,x,g]}),e[18]=x,e[19]=g,e[20]=v):v=e[20],v}let o;return e[21]!==i?(o=t.jsx(t.Fragment,{children:i}),e[21]=i,e[22]=o):o=e[22],o}function ma(l){const e={};for(const s of l)e[s.connection_id]={tools:s.selected_tools,resources:s.selected_resources??null,prompts:s.selected_prompts??null};return e}function cs(l){return Object.entries(l).map(([e,s])=>({connection_id:e,selected_tools:s.tools,selected_resources:s.resources,selected_prompts:s.prompts}))}function ds(l,e,s,n){const i=l[e]??{tools:null,resources:null,prompts:null};return{...l,[e]:{...i,[s]:n}}}function fa(l,e){return e.type==="SET_ACTIVE_TAB"?{...l,activeTab:e.payload}:l}function pa(l){const e=q.c(49),{open:s,onOpenChange:n,selectedId:i,form:a,connections:c,onAuthenticate:r}=l;let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p={activeTab:"tools"},e[0]=p):p=e[0];const[o,f]=Q.useReducer(fa,p),m=Ot(i??"");let u;e[1]!==c?(u=c??[],e[1]=c,e[2]=u):u=e[2];let h;e[3]!==u?(h=ma(u),e[3]=u,e[4]=h):h=e[4];const d=h;let x;e[5]!==a||e[6]!==d?(x=(z,M,O,G)=>{const R=d[z]?.[M];let F;R===null?F=G.filter(W=>W!==O):R?.includes(O)?F=R.filter(W=>W!==O):(F=[...R??[],O],F.length===G.length&&(F=null)),a.setValue("connections",cs(ds(d,z,M,F)),{shouldDirty:!0,shouldTouch:!0})},e[5]=a,e[6]=d,e[7]=x):x=e[7];const g=x;let v;e[8]!==a||e[9]!==d?(v=(z,M)=>{const G=d[z]?.[M]===null?[]:null;a.setValue("connections",cs(ds(d,z,M,G)),{shouldDirty:!0,shouldTouch:!0})},e[8]=a,e[9]=d,e[10]=v):v=e[10];const y=v;let j;e[11]!==g?(j=(z,M,O)=>g(z,"tools",M,O),e[11]=g,e[12]=j):j=e[12];const b=j;let S;e[13]!==g?(S=(z,M,O)=>g(z,"resources",M,O),e[13]=g,e[14]=S):S=e[14];const N=S;let k;e[15]!==g?(k=(z,M,O)=>g(z,"prompts",M,O),e[15]=g,e[16]=k):k=e[16];const w=k;let C;e[17]!==y?(C=z=>y(z,"tools"),e[17]=y,e[18]=C):C=e[18];const _=C;let T;e[19]!==y?(T=z=>y(z,"resources"),e[19]=y,e[20]=T):T=e[20];const V=T;let $;e[21]!==y?($=z=>y(z,"prompts"),e[21]=y,e[22]=$):$=e[22];const D=$;if(!i||!m)return null;let A;e[23]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(st,{}),e[23]=A):A=e[23];let P;e[24]===Symbol.for("react.memo_cache_sentinel")?(P=z=>f({type:"SET_ACTIVE_TAB",payload:z}),e[24]=P):P=e[24];let E;e[25]!==m||e[26]!==o.activeTab||e[27]!==d||e[28]!==i||e[29]!==D||e[30]!==V||e[31]!==_||e[32]!==w||e[33]!==N||e[34]!==b?(E=t.jsx(ca,{currentConnection:m,activeTab:o.activeTab,selectedId:i,formData:d,toggleTool:b,toggleResource:N,togglePrompt:w,toggleAllTools:_,toggleAllResources:V,toggleAllPrompts:D,onTabChange:P},i),e[25]=m,e[26]=o.activeTab,e[27]=d,e[28]=i,e[29]=D,e[30]=V,e[31]=_,e[32]=w,e[33]=N,e[34]=b,e[35]=E):E=e[35];let U;e[36]!==r||e[37]!==i||e[38]!==E?(U=t.jsx(Q.Suspense,{fallback:A,children:t.jsx(ua,{connectionId:i,onAuthenticate:r,children:E})}),e[36]=r,e[37]=i,e[38]=E,e[39]=U):U=e[39];let K;e[40]!==n?(K=t.jsx(da,{onClose:n}),e[40]=n,e[41]=K):K=e[41];let Y;e[42]!==U||e[43]!==K?(Y=t.jsxs(Je,{className:"sm:max-w-2xl h-[75vh] max-h-[75vh] flex flex-col p-0 gap-0 overflow-hidden w-[95vw]",children:[U,K]}),e[42]=U,e[43]=K,e[44]=Y):Y=e[44];let B;return e[45]!==n||e[46]!==s||e[47]!==Y?(B=t.jsx(Xe,{open:s,onOpenChange:n,children:Y}),e[45]=n,e[46]=s,e[47]=Y,e[48]=B):B=e[48],B}const us="__new_instance__";function ha(l){const e=q.c(25),{connection_id:s,usedConnectionIds:n,onOpenSettings:i,onRemove:a,onAuthenticate:c,onSwitchInstance:r,onNewInstance:p}=l,o=Ot(s),{org:f}=Fe();if(!o){let g;return e[0]!==a?(g=t.jsx(ba,{onRemove:a}),e[0]=a,e[1]=g):g=e[1],g}let m;e[2]!==o?(m=Ci(o),e[2]=o,e[3]=m):m=e[3];const u=m;let h;e[4]!==s?(h=t.jsx(va,{connection_id:s}),e[4]=s,e[5]=h):h=e[5];let d;e[6]!==o.app_name||e[7]!==o.connection_type||e[8]!==o.description||e[9]!==o.icon||e[10]!==o.status||e[11]!==o.title||e[12]!==s||e[13]!==c||e[14]!==p||e[15]!==i||e[16]!==a||e[17]!==r||e[18]!==f.slug||e[19]!==u||e[20]!==n?(d=t.jsx(ga,{connection_id:s,connectionTitle:o.title,connectionDescription:o.description,connectionIcon:o.icon,connectionType:o.connection_type,connectionStatus:o.status,slug:u,orgSlug:f.slug,appName:o.app_name,usedConnectionIds:n,onOpenSettings:i,onRemove:a,onAuthenticate:c,onSwitchInstance:r,onNewInstance:p}),e[6]=o.app_name,e[7]=o.connection_type,e[8]=o.description,e[9]=o.icon,e[10]=o.status,e[11]=o.title,e[12]=s,e[13]=c,e[14]=p,e[15]=i,e[16]=a,e[17]=r,e[18]=f.slug,e[19]=u,e[20]=n,e[21]=d):d=e[21];let x;return e[22]!==h||e[23]!==d?(x=t.jsx(Q.Suspense,{fallback:h,children:d}),e[22]=h,e[23]=d,e[24]=x):x=e[24],x}function xa(l){const e=q.c(24),{appName:s,connectionId:n,usedConnectionIds:i,onSwitchInstance:a,onNewInstance:c}=l,r=Z();let p;e[0]!==s?(p={filters:[{column:"app_name",value:s}]},e[0]=s,e[1]=p):p=e[1];const o=Wn(p);if(o.length<=1&&!c)return null;let f;e[2]!==n||e[3]!==c||e[4]!==a?(f=g=>{g===us?c?.():a(n,g)},e[2]=n,e[3]=c,e[4]=a,e[5]=f):f=e[5];let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(Oe,{size:"sm",className:"w-auto text-xs gap-1 px-2 shadow-none",children:t.jsx(Ie,{})}),e[6]=m):m=e[6];let u;if(e[7]!==n||e[8]!==o||e[9]!==i){let g;e[11]!==n||e[12]!==i?(g=v=>t.jsx(we,{value:v.id,className:"text-xs",disabled:v.id!==n&&i.has(v.id),children:v.title},v.id),e[11]=n,e[12]=i,e[13]=g):g=e[13],u=o.map(g),e[7]=n,e[8]=o,e[9]=i,e[10]=u}else u=e[10];let h;e[14]!==c||e[15]!==r?(h=c&&t.jsxs(we,{value:us,className:"text-xs text-muted-foreground",children:["+ ",r("virtualMcp.connectionItem.newInstance")]}),e[14]=c,e[15]=r,e[16]=h):h=e[16];let d;e[17]!==u||e[18]!==h?(d=t.jsxs(Ae,{children:[u,h]}),e[17]=u,e[18]=h,e[19]=d):d=e[19];let x;return e[20]!==n||e[21]!==f||e[22]!==d?(x=t.jsxs($e,{value:n,onValueChange:f,children:[m,d]}),e[20]=n,e[21]=f,e[22]=d,e[23]=x):x=e[23],x}function ga({connection_id:l,connectionTitle:e,connectionDescription:s,connectionIcon:n,connectionType:i,connectionStatus:a,slug:c,orgSlug:r,appName:p,usedConnectionIds:o,onOpenSettings:f,onRemove:m,onAuthenticate:u,onSwitchInstance:h,onNewInstance:d}){const x=$s({connectionId:l}),g=Ms(),y=!(i==="VIRTUAL")&&x.supportsOAuth&&!x.isAuthenticated,j=a!=="active",b=Z(),S=async N=>{try{await g.update.mutateAsync({id:l,data:{status:N}}),oe.success(b(N==="active"?"virtualMcp.connectionItem.connectionEnabled":"virtualMcp.connectionItem.connectionDisabled"))}catch{oe.error(b("virtualMcp.connectionItem.failedToUpdateConnection"))}};return t.jsxs("div",{className:ve("rounded-xl border overflow-hidden transition-colors",y||j?"border-destructive/50 bg-destructive/5":"border-border bg-card"),children:[t.jsxs(ws,{to:"/$org/settings/connections/$appSlug",params:{org:r,appSlug:c},className:"flex items-center gap-3 px-4 py-3 cursor-pointer hover:bg-muted/50 transition-colors",children:[t.jsx(Ze,{icon:n,name:e,size:"sm",className:"shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:e}),y?t.jsx("span",{className:"text-xs text-destructive font-medium",children:b("virtualMcp.connectionItem.needsAuthorization")}):j?t.jsx("span",{className:"text-xs text-destructive font-medium",children:b(a==="error"?"virtualMcp.connectionItem.disabledError":"virtualMcp.connectionItem.disabled")}):s&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s})]}),y?t.jsx(te,{variant:"outline",size:"sm",className:"h-7 text-xs shrink-0",onClick:N=>{N.preventDefault(),N.stopPropagation(),u(l)},children:b("virtualMcp.connectionItem.authorize")}):j?t.jsxs(te,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5 shrink-0",onClick:N=>{N.preventDefault(),N.stopPropagation(),S("active")},children:[t.jsx(Jn,{size:13}),b("virtualMcp.connectionItem.enable")]}):t.jsxs(Se,{delayDuration:0,children:[t.jsx(Ne,{asChild:!0,children:t.jsx("span",{className:"inline-flex items-center justify-center rounded-md h-7 w-7 hover:bg-accent text-muted-foreground shrink-0 transition-colors",children:t.jsx(xi,{size:16})})}),t.jsx(Ce,{side:"bottom",children:b("virtualMcp.connectionItem.connectionSettings")})]})]}),t.jsxs("div",{className:"flex items-center gap-3 px-4 py-2 border-t border-border bg-muted/25",children:[p&&t.jsx(xa,{appName:p,connectionId:l,usedConnectionIds:o,onSwitchInstance:h,onNewInstance:d}),t.jsxs("div",{className:"flex items-center gap-0.5 ml-auto",children:[t.jsxs(Se,{delayDuration:0,children:[t.jsx(Ne,{asChild:!0,children:t.jsx(te,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:f,"aria-label":b("virtualMcp.connectionItem.configureResources"),children:t.jsx(Zn,{size:13})})}),t.jsx(Ce,{side:"bottom",children:b("virtualMcp.connectionItem.configureResources")})]}),!j&&t.jsxs(Se,{delayDuration:0,children:[t.jsx(Ne,{asChild:!0,children:t.jsx(te,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:()=>S("inactive"),"aria-label":b("virtualMcp.connectionItem.disableConnection"),children:t.jsx(ei,{size:13})})}),t.jsx(Ce,{side:"bottom",children:b("virtualMcp.connectionItem.disable")})]}),t.jsxs(Se,{delayDuration:0,children:[t.jsx(Ne,{asChild:!0,children:t.jsx(te,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:m,"aria-label":b("virtualMcp.connectionItem.removeConnection"),children:t.jsx(At,{size:13})})}),t.jsx(Ce,{side:"bottom",children:b("virtualMcp.connectionItem.remove")})]})]})]})]})}function va(l){const e=q.c(17),{connection_id:s}=l,n=Ot(s);if(!n){let m;return e[0]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(Js,{}),e[0]=m):m=e[0],m}let i;e[1]!==n.icon||e[2]!==n.title?(i=t.jsx(Ze,{icon:n.icon,name:n.title,size:"sm",className:"shrink-0"}),e[1]=n.icon,e[2]=n.title,e[3]=i):i=e[3];let a;e[4]!==n.title?(a=t.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[4]=n.title,e[5]=a):a=e[5];let c;e[6]!==n.description?(c=n.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:n.description}),e[6]=n.description,e[7]=c):c=e[7];let r;e[8]!==a||e[9]!==c?(r=t.jsxs("div",{className:"flex-1 min-w-0",children:[a,c]}),e[8]=a,e[9]=c,e[10]=r):r=e[10];let p;e[11]!==i||e[12]!==r?(p=t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",children:[i,r]}),e[11]=i,e[12]=r,e[13]=p):p=e[13];let o;e[14]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("div",{className:"flex items-center px-4 py-2 border-t border-border bg-muted/25",children:t.jsx("div",{className:"h-5 w-20 rounded bg-muted animate-pulse"})}),e[14]=o):o=e[14];let f;return e[15]!==p?(f=t.jsxs("div",{className:"rounded-xl border border-border overflow-hidden",children:[p,o]}),e[15]=p,e[16]=f):f=e[16],f}function ba(l){const e=q.c(20),{onRemove:s}=l,n=Z();let i;e[0]!==n?(i=n("virtualMcp.connectionItem.connectionNotFound"),e[0]=n,e[1]=i):i=e[1];let a;e[2]!==i?(a=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm text-destructive font-medium truncate",children:i})}),e[2]=i,e[3]=a):a=e[3];let c;e[4]!==n?(c=n("virtualMcp.connectionItem.removeConnection"),e[4]=n,e[5]=c):c=e[5];let r;e[6]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(At,{size:13}),e[6]=r):r=e[6];let p;e[7]!==s||e[8]!==c?(p=t.jsx(Ne,{asChild:!0,children:t.jsx(te,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive shrink-0",onClick:s,"aria-label":c,children:r})}),e[7]=s,e[8]=c,e[9]=p):p=e[9];let o;e[10]!==n?(o=n("virtualMcp.connectionItem.remove"),e[10]=n,e[11]=o):o=e[11];let f;e[12]!==o?(f=t.jsx(Ce,{side:"bottom",children:o}),e[12]=o,e[13]=f):f=e[13];let m;e[14]!==p||e[15]!==f?(m=t.jsxs(Se,{delayDuration:0,children:[p,f]}),e[14]=p,e[15]=f,e[16]=m):m=e[16];let u;return e[17]!==a||e[18]!==m?(u=t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 rounded-xl border border-destructive/50 bg-destructive/5",children:[a,m]}),e[17]=a,e[18]=m,e[19]=u):u=e[19],u}function Js(){const l=q.c(3);let e;l[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"size-8 rounded-md bg-muted animate-pulse shrink-0"}),l[0]=e):e=l[0];let s;l[1]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",children:[e,t.jsxs("div",{className:"flex-1 space-y-1.5",children:[t.jsx("div",{className:"h-4 w-32 rounded bg-muted animate-pulse"}),t.jsx("div",{className:"h-3 w-48 rounded bg-muted animate-pulse"})]})]}),l[1]=s):s=l[1];let n;return l[2]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsxs("div",{className:"rounded-xl border border-border overflow-hidden",children:[s,t.jsx("div",{className:"flex items-center px-4 py-2 border-t border-border bg-muted/25",children:t.jsx("div",{className:"h-5 w-20 rounded bg-muted animate-pulse"})})]}),l[2]=n):n=l[2],n}function Zs(l){const e=q.c(85),{value:s,onChange:n,onColorChange:i,name:a,size:c,className:r,avatarClassName:p,showHoverOverlay:o,disabled:f}=l,m=c===void 0?"lg":c,u=o===void 0?!0:o,h=f===void 0?!1:f,d=Z(),[x,g]=Q.useState(!1),[v,y]=Q.useState("icons"),[j,b]=Q.useState(""),[S,N]=Q.useState("blue");let k;e[0]!==s?(k=ti(s),e[0]=s,e[1]=k):k=e[1];const w=k,C=w.type==="icon"||w.type==="url"&&w.color?w.color:S;let _;e[2]!==n||e[3]!==C?(_=ee=>{n(jt(ee,C))},e[2]=n,e[3]=C,e[4]=_):_=e[4];const T=_;let V;e[5]!==n||e[6]!==i||e[7]!==w.name||e[8]!==w.type||e[9]!==w.url?(V=ee=>{N(ee),i?.(ee),w.type==="icon"?n(jt(w.name,ee)):w.type==="url"&&n(qt(w.url,ee))},e[5]=n,e[6]=i,e[7]=w.name,e[8]=w.type,e[9]=w.url,e[10]=V):V=e[10];const $=V;let D;e[11]!==n||e[12]!==C?(D=ee=>{n(qt(ee,C)),g(!1)},e[11]=n,e[12]=C,e[13]=D):D=e[13];const A=D;let P;e[14]!==n||e[15]!==C?(P=()=>{const ee=Ts(),J=ee[Math.floor(Math.random()*ee.length)];n(jt(J,C))},e[14]=n,e[15]=C,e[16]=P):P=e[16];const E=P,U=h?!1:x;let K;e[17]!==d?(K=d("common.iconPicker.changeIcon"),e[17]=d,e[18]=K):K=e[18];const Y=h?"cursor-default opacity-50":"cursor-pointer";let B;e[19]!==r||e[20]!==m||e[21]!==Y?(B=ve("relative group overflow-hidden",Y,si(m),r),e[19]=r,e[20]=m,e[21]=Y,e[22]=B):B=e[22];let z;e[23]!==p||e[24]!==a||e[25]!==m||e[26]!==s?(z=t.jsx(Ht,{icon:s,name:a,size:m,className:p}),e[23]=p,e[24]=a,e[25]=m,e[26]=s,e[27]=z):z=e[27];let M;e[28]!==h||e[29]!==u?(M=u&&!h&&t.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity",children:t.jsx(ai,{size:16,className:"text-white"})}),e[28]=h,e[29]=u,e[30]=M):M=e[30];let O;e[31]!==h||e[32]!==K||e[33]!==B||e[34]!==z||e[35]!==M?(O=t.jsx(Es,{asChild:!0,children:t.jsxs("button",{type:"button","data-testid":"icon-picker-trigger","aria-label":K,disabled:h,className:B,children:[z,M]})}),e[31]=h,e[32]=K,e[33]=B,e[34]=z,e[35]=M,e[36]=O):O=e[36];let G;e[37]!==a||e[38]!==s?(G=t.jsx("div",{className:"flex items-center justify-center py-4",children:t.jsx(Ht,{icon:s,name:a,size:"xl"})}),e[37]=a,e[38]=s,e[39]=G):G=e[39];let R;e[40]!==v?(R=ee=>{if(ee.key!=="ArrowLeft"&&ee.key!=="ArrowRight")return;ee.preventDefault();const J=v==="icons"?"upload":"icons";y(J),document.getElementById(`icon-picker-tab-${J}`)?.focus()},e[40]=v,e[41]=R):R=e[41];const F=v==="icons",W=v==="icons"?0:-1;let H;e[42]===Symbol.for("react.memo_cache_sentinel")?(H=()=>y("icons"),e[42]=H):H=e[42];const se=v==="icons"?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground";let le;e[43]!==se?(le=ve("px-3 py-2 text-sm font-medium border-b-2 -mb-px transition-colors",se),e[43]=se,e[44]=le):le=e[44];let ce;e[45]!==d?(ce=d("common.iconPicker.iconsTab"),e[45]=d,e[46]=ce):ce=e[46];let ae;e[47]!==F||e[48]!==W||e[49]!==le||e[50]!==ce?(ae=t.jsx("button",{id:"icon-picker-tab-icons",type:"button",role:"tab","aria-selected":F,"aria-controls":"icon-picker-panel-icons",tabIndex:W,onClick:H,className:le,children:ce}),e[47]=F,e[48]=W,e[49]=le,e[50]=ce,e[51]=ae):ae=e[51];const ie=v==="upload",X=v==="upload"?0:-1;let de;e[52]===Symbol.for("react.memo_cache_sentinel")?(de=()=>y("upload"),e[52]=de):de=e[52];const ue=v==="upload"?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground";let he;e[53]!==ue?(he=ve("px-3 py-2 text-sm font-medium border-b-2 -mb-px transition-colors",ue),e[53]=ue,e[54]=he):he=e[54];let me;e[55]!==d?(me=d("common.iconPicker.uploadTab"),e[55]=d,e[56]=me):me=e[56];let xe;e[57]!==ie||e[58]!==X||e[59]!==he||e[60]!==me?(xe=t.jsx("button",{id:"icon-picker-tab-upload",type:"button",role:"tab","aria-selected":ie,"aria-controls":"icon-picker-panel-upload",tabIndex:X,onClick:de,className:he,children:me}),e[57]=ie,e[58]=X,e[59]=he,e[60]=me,e[61]=xe):xe=e[61];let ge;e[62]===Symbol.for("react.memo_cache_sentinel")?(ge=t.jsx("div",{className:"flex-1"}),e[62]=ge):ge=e[62];let fe;e[63]!==R||e[64]!==ae||e[65]!==xe?(fe=t.jsxs("div",{role:"tablist","aria-label":"Icon source",className:"flex items-center border-b border-border px-3",onKeyDown:R,children:[ae,xe,ge]}),e[63]=R,e[64]=ae,e[65]=xe,e[66]=fe):fe=e[66];let I;e[67]!==$||e[68]!==E||e[69]!==T||e[70]!==A||e[71]!==w.name||e[72]!==w.type||e[73]!==j||e[74]!==C||e[75]!==v?(I=v==="icons"?t.jsx("div",{id:"icon-picker-panel-icons",role:"tabpanel","aria-labelledby":"icon-picker-tab-icons",children:t.jsx(Sa,{search:j,onSearchChange:b,selectedColor:C,onColorChange:$,onSelectIcon:T,onRandom:E,currentIconName:w.type==="icon"?w.name:null})}):t.jsx("div",{id:"icon-picker-panel-upload",role:"tabpanel","aria-labelledby":"icon-picker-tab-upload",children:t.jsx(Na,{onUpload:A})}),e[67]=$,e[68]=E,e[69]=T,e[70]=A,e[71]=w.name,e[72]=w.type,e[73]=j,e[74]=C,e[75]=v,e[76]=I):I=e[76];let ne;e[77]!==G||e[78]!==fe||e[79]!==I?(ne=t.jsx(zs,{align:"start",className:"w-80 p-0",onOpenAutoFocus:ja,children:t.jsxs("div",{className:"flex flex-col",children:[G,fe,I]})}),e[77]=G,e[78]=fe,e[79]=I,e[80]=ne):ne=e[80];let L;return e[81]!==O||e[82]!==ne||e[83]!==U?(L=t.jsxs(Rs,{open:U,onOpenChange:g,children:[O,ne]}),e[81]=O,e[82]=ne,e[83]=U,e[84]=L):L=e[84],L}function ja(l){return l.preventDefault()}function ya(l){const e=q.c(33),{selectedColor:s,onColorChange:n}=l,i=Z(),[a,c]=Q.useState(!1);let r,p,o,f,m,u,h;if(e[0]!==a||e[1]!==s){const S=Ds(s);p=Rs,u=a,h=c,r=Es,m=!0,o="button",f=ve("h-6 w-6 rounded-full shrink-0 ring-2 ring-offset-2 ring-offset-background transition-all cursor-pointer hover:scale-110",S.dot,"ring-foreground/20"),e[0]=a,e[1]=s,e[2]=r,e[3]=p,e[4]=o,e[5]=f,e[6]=m,e[7]=u,e[8]=h}else r=e[2],p=e[3],o=e[4],f=e[5],m=e[6],u=e[7],h=e[8];let d;e[9]!==i?(d=i("common.iconPicker.changeColor"),e[9]=i,e[10]=d):d=e[10];let x;e[11]!==i?(x=i("common.iconPicker.changeColor"),e[11]=i,e[12]=x):x=e[12];let g;e[13]!==o||e[14]!==f||e[15]!==d||e[16]!==x?(g=t.jsx("button",{type:o,className:f,title:d,"aria-label":x}),e[13]=o,e[14]=f,e[15]=d,e[16]=x,e[17]=g):g=e[17];let v;e[18]!==r||e[19]!==m||e[20]!==g?(v=t.jsx(r,{asChild:m,children:g}),e[18]=r,e[19]=m,e[20]=g,e[21]=v):v=e[21];let y;e[22]!==n||e[23]!==s?(y=oi.map(S=>t.jsx("button",{type:"button",onClick:()=>{n(S.name),c(!1)},className:ve("h-5 w-5 rounded-full transition-all shrink-0 cursor-pointer",S.dot,s===S.name?"ring-2 ring-offset-1 ring-offset-background ring-foreground/30 scale-110":"hover:scale-110"),title:S.name,"aria-label":S.name},S.name)),e[22]=n,e[23]=s,e[24]=y):y=e[24];let j;e[25]!==y?(j=t.jsx(zs,{align:"start",side:"right",sideOffset:8,className:"w-auto p-2",onOpenAutoFocus:wa,children:t.jsx("div",{className:"grid grid-cols-4 gap-1",children:y})}),e[25]=y,e[26]=j):j=e[26];let b;return e[27]!==p||e[28]!==j||e[29]!==u||e[30]!==h||e[31]!==v?(b=t.jsxs(p,{open:u,onOpenChange:h,children:[v,j]}),e[27]=p,e[28]=j,e[29]=u,e[30]=h,e[31]=v,e[32]=b):b=e[32],b}function wa(l){return l.preventDefault()}function Sa(l){const e=q.c(55),{search:s,onSearchChange:n,selectedColor:i,onColorChange:a,onSelectIcon:c,onRandom:r,currentIconName:p}=l,o=Z();let f,m,u,h,d,x,g;if(e[0]!==p||e[1]!==a||e[2]!==r||e[3]!==n||e[4]!==c||e[5]!==s||e[6]!==i||e[7]!==o){const S=Ts(),N=Ds(i);m=ni(S,s),x="flex flex-col";let k;e[15]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(Ct,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none"}),e[15]=k):k=e[15];let w;e[16]!==n?(w=P=>n(P.target.value),e[16]=n,e[17]=w):w=e[17];let C;e[18]!==o?(C=o("common.iconPicker.filterPlaceholder"),e[18]=o,e[19]=C):C=e[19];let _;e[20]!==s||e[21]!==w||e[22]!==C?(_=t.jsxs("div",{className:"relative flex-1",children:[k,t.jsx(ke,{value:s,onChange:w,placeholder:C,className:"h-8 text-xs pl-7"})]}),e[20]=s,e[21]=w,e[22]=C,e[23]=_):_=e[23];let T;e[24]!==o?(T=o("common.iconPicker.randomIcon"),e[24]=o,e[25]=T):T=e[25];let V;e[26]!==o?(V=o("common.iconPicker.randomIcon"),e[26]=o,e[27]=V):V=e[27];let $;e[28]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(ri,{size:14,className:"text-muted-foreground"}),e[28]=$):$=e[28];let D;e[29]!==r||e[30]!==T||e[31]!==V?(D=t.jsx("button",{type:"button",onClick:r,className:"h-8 w-8 flex items-center justify-center rounded-lg border border-border hover:bg-accent transition-colors shrink-0",title:T,"aria-label":V,children:$}),e[29]=r,e[30]=T,e[31]=V,e[32]=D):D=e[32];let A;e[33]!==a||e[34]!==i?(A=t.jsx(ya,{selectedColor:i,onColorChange:a}),e[33]=a,e[34]=i,e[35]=A):A=e[35],e[36]!==D||e[37]!==A||e[38]!==_?(g=t.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",children:[_,D,A]}),e[36]=D,e[37]=A,e[38]=_,e[39]=g):g=e[39],f=ki,d="h-56",u="grid grid-cols-9 gap-0.5 px-2 pb-2",h=m.map(P=>{const E=ii(P);return E?t.jsx("button",{type:"button",onClick:()=>c(P),className:ve("h-8 w-8 flex items-center justify-center rounded-lg transition-colors cursor-pointer",p===P?ve(N.bg,N.text):ve(N.text,"hover:bg-accent")),title:P,"aria-label":li(P),children:t.jsx(E,{size:18})},P):null}),e[0]=p,e[1]=a,e[2]=r,e[3]=n,e[4]=c,e[5]=s,e[6]=i,e[7]=o,e[8]=f,e[9]=m,e[10]=u,e[11]=h,e[12]=d,e[13]=x,e[14]=g}else f=e[8],m=e[9],u=e[10],h=e[11],d=e[12],x=e[13],g=e[14];let v;e[40]!==u||e[41]!==h?(v=t.jsx("div",{className:u,children:h}),e[40]=u,e[41]=h,e[42]=v):v=e[42];let y;e[43]!==m.length||e[44]!==o?(y=m.length===0&&t.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:o("common.iconPicker.noIconsFound")}),e[43]=m.length,e[44]=o,e[45]=y):y=e[45];let j;e[46]!==f||e[47]!==d||e[48]!==v||e[49]!==y?(j=t.jsxs(f,{className:d,children:[v,y]}),e[46]=f,e[47]=d,e[48]=v,e[49]=y,e[50]=j):j=e[50];let b;return e[51]!==x||e[52]!==g||e[53]!==j?(b=t.jsxs("div",{className:x,children:[g,j]}),e[51]=x,e[52]=g,e[53]=j,e[54]=b):b=e[54],b}function Na(l){const e=q.c(46),{onUpload:s}=l,n=Z(),i=Q.useRef(null);let a;e[0]!==s||e[1]!==n?(a=D=>{const A=D.target.files?.[0];if(!A)return;if(A.size>2097152){oe.error(n("common.iconPicker.imageTooLarge")),D.target.value="";return}const P=new FileReader;P.onerror=()=>{oe.error(n("common.iconPicker.failedToReadImage")),i.current&&(i.current.value="")},P.onloadend=()=>{P.readyState===FileReader.DONE&&P.result&&s(P.result),i.current&&(i.current.value="")},P.readAsDataURL(A)},e[0]=s,e[1]=n,e[2]=a):a=e[2];const c=a,[r,p]=Q.useState("");let o;e[3]!==s||e[4]!==r?(o=()=>{const D=r.trim();D&&(s(D),p(""))},e[3]=s,e[4]=r,e[5]=o):o=e[5];const f=o;let m;e[6]!==c?(m=t.jsx("input",{type:"file",ref:i,className:"hidden",accept:"image/*",onChange:c}),e[6]=c,e[7]=m):m=e[7];let u;e[8]===Symbol.for("react.memo_cache_sentinel")?(u=()=>i.current?.click(),e[8]=u):u=e[8];let h;e[9]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(Mi,{size:20}),e[9]=h):h=e[9];let d;e[10]!==n?(d=n("common.iconPicker.uploadHint"),e[10]=n,e[11]=d):d=e[11];let x;e[12]!==d?(x=t.jsxs("button",{type:"button",onClick:u,className:"h-24 rounded-lg border-2 border-dashed border-border hover:border-foreground/50 hover:bg-accent/50 transition-colors flex flex-col items-center justify-center gap-2 text-muted-foreground hover:text-foreground",children:[h,t.jsx("span",{className:"text-xs",children:d})]}),e[12]=d,e[13]=x):x=e[13];let g;e[14]!==n?(g=n("common.iconPicker.or"),e[14]=n,e[15]=g):g=e[15];let v;e[16]!==g?(v=t.jsx("span",{className:"text-xs text-muted-foreground",children:g}),e[16]=g,e[17]=v):v=e[17];let y;e[18]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx("div",{className:"flex-1 h-px bg-border"}),e[18]=y):y=e[18];let j;e[19]!==v?(j=t.jsxs("div",{className:"flex items-center gap-2",children:[v,y]}),e[19]=v,e[20]=j):j=e[20];let b;e[21]===Symbol.for("react.memo_cache_sentinel")?(b=D=>p(D.target.value),e[21]=b):b=e[21];let S;e[22]!==n?(S=n("common.iconPicker.pasteUrlPlaceholder"),e[22]=n,e[23]=S):S=e[23];let N;e[24]!==f?(N=D=>{D.key==="Enter"&&(D.preventDefault(),f())},e[24]=f,e[25]=N):N=e[25];let k;e[26]!==r||e[27]!==S||e[28]!==N?(k=t.jsx(ke,{value:r,onChange:b,placeholder:S,className:"h-8 text-xs flex-1",onKeyDown:N}),e[26]=r,e[27]=S,e[28]=N,e[29]=k):k=e[29];let w;e[30]!==r?(w=r.trim(),e[30]=r,e[31]=w):w=e[31];const C=!w;let _;e[32]!==n?(_=n("common.iconPicker.apply"),e[32]=n,e[33]=_):_=e[33];let T;e[34]!==f||e[35]!==C||e[36]!==_?(T=t.jsx(te,{variant:"outline",size:"sm",className:"h-8 px-3 text-xs shrink-0",onClick:f,disabled:C,children:_}),e[34]=f,e[35]=C,e[36]=_,e[37]=T):T=e[37];let V;e[38]!==k||e[39]!==T?(V=t.jsxs("div",{className:"flex items-center gap-1.5",children:[k,T]}),e[38]=k,e[39]=T,e[40]=V):V=e[40];let $;return e[41]!==j||e[42]!==V||e[43]!==m||e[44]!==x?($=t.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[m,x,j,V]}),e[41]=j,e[42]=V,e[43]=m,e[44]=x,e[45]=$):$=e[45],$}function Ca(l){const e=q.c(11),{viewId:s}=l;if(s==="overview"){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Ps,{size:16}),e[0]=i):i=e[0],i}if(s==="reports"){let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Qt,{size:16}),e[1]=i):i=e[1],i}if(s==="board"){let i;return e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(ci,{size:16}),e[2]=i):i=e[2],i}if(s==="site-editor"){let i;return e[3]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Ti,{size:16}),e[3]=i):i=e[3],i}if(s==="assets"){let i;return e[4]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Vi,{size:16}),e[4]=i):i=e[4],i}if(s==="releases"){let i;return e[5]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(di,{size:16}),e[5]=i):i=e[5],i}if(s==="hosting"){let i;return e[6]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(rn,{size:16}),e[6]=i):i=e[6],i}if(s==="e2e"){let i;return e[7]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(ui,{size:16}),e[7]=i):i=e[7],i}if(s==="analytics"){let i;return e[8]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Qt,{size:16}),e[8]=i):i=e[8],i}if(s==="cdn"){let i;return e[9]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(mi,{size:16}),e[9]=i):i=e[9],i}let n;return e[10]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(Os,{size:16}),e[10]=n):n=e[10],n}function ms(l){const e=q.c(51),{pinned:s,canSetMainView:n,onOpen:i,onTogglePin:a,onSetMainView:c}=l,r=Z(),p=s?"text-foreground":"text-muted-foreground/40";let o;e[0]!==p?(o=ve("size-7",p),e[0]=p,e[1]=o):o=e[1];let f;e[2]!==s||e[3]!==r?(f=r(s?"virtualMcp.settings.views.unpin":"virtualMcp.settings.views.pin"),e[2]=s,e[3]=r,e[4]=f):f=e[4];let m;e[5]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(Xt,{size:16}),e[5]=m):m=e[5];let u;e[6]!==a||e[7]!==s||e[8]!==o||e[9]!==f?(u=t.jsx(Ne,{asChild:!0,children:t.jsx(te,{variant:"ghost",size:"icon",className:o,"aria-label":f,"aria-pressed":s,onClick:a,children:m})}),e[6]=a,e[7]=s,e[8]=o,e[9]=f,e[10]=u):u=e[10];let h;e[11]!==s||e[12]!==r?(h=r(s?"virtualMcp.settings.views.unpin":"virtualMcp.settings.views.pin"),e[11]=s,e[12]=r,e[13]=h):h=e[13];let d;e[14]!==h?(d=t.jsx(Ce,{side:"top",children:h}),e[14]=h,e[15]=d):d=e[15];let x;e[16]!==u||e[17]!==d?(x=t.jsxs(Se,{delayDuration:0,children:[u,d]}),e[16]=u,e[17]=d,e[18]=x):x=e[18];let g;e[19]!==r?(g=r("virtualMcp.settings.views.rowActions"),e[19]=r,e[20]=g):g=e[20];let v;e[21]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(_i,{size:16}),e[21]=v):v=e[21];let y;e[22]!==g?(y=t.jsx(bs,{asChild:!0,children:t.jsx(te,{variant:"ghost",size:"icon",className:"size-7 text-muted-foreground","aria-label":g,children:v})}),e[22]=g,e[23]=y):y=e[23];let j;e[24]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(on,{size:14}),e[24]=j):j=e[24];let b;e[25]!==r?(b=r("virtualMcp.settings.views.open"),e[25]=r,e[26]=b):b=e[26];let S;e[27]!==i||e[28]!==b?(S=t.jsxs(He,{onClick:i,children:[j,b]}),e[27]=i,e[28]=b,e[29]=S):S=e[29];let N;e[30]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(Xt,{size:14}),e[30]=N):N=e[30];let k;e[31]!==s||e[32]!==r?(k=r(s?"virtualMcp.settings.views.unpin":"virtualMcp.settings.views.pin"),e[31]=s,e[32]=r,e[33]=k):k=e[33];let w;e[34]!==a||e[35]!==k?(w=t.jsxs(He,{onClick:a,children:[N,k]}),e[34]=a,e[35]=k,e[36]=w):w=e[36];let C;e[37]!==n||e[38]!==c||e[39]!==r?(C=n&&t.jsxs(He,{onClick:c,children:[t.jsx(Ps,{size:14}),r("virtualMcp.settings.views.setMainView")]}),e[37]=n,e[38]=c,e[39]=r,e[40]=C):C=e[40];let _;e[41]!==S||e[42]!==w||e[43]!==C?(_=t.jsxs(js,{align:"end",children:[S,w,C]}),e[41]=S,e[42]=w,e[43]=C,e[44]=_):_=e[44];let T;e[45]!==y||e[46]!==_?(T=t.jsxs(vs,{children:[y,_]}),e[45]=y,e[46]=_,e[47]=T):T=e[47];let V;return e[48]!==T||e[49]!==x?(V=t.jsxs("div",{className:"flex items-center gap-1",children:[x,T]}),e[48]=T,e[49]=x,e[50]=V):V=e[50],V}const fs=l=>l.stopPropagation();function ka(l){const e=q.c(8),{icon:s,title:n}=l;let i;e[0]!==s||e[1]!==n?(i=t.jsx(Ze,{icon:s,name:n,size:"xs",className:"shrink-0"}),e[0]=s,e[1]=n,e[2]=i):i=e[2];let a;e[3]!==n?(a=t.jsx("span",{className:"text-xs text-muted-foreground",children:n}),e[3]=n,e[4]=a):a=e[4];let c;return e[5]!==i||e[6]!==a?(c=t.jsxs("div",{className:"flex items-center gap-2 px-4 py-2.5 bg-muted/30",children:[i,a]}),e[5]=i,e[6]=a,e[7]=c):c=e[7],c}function Ma(l){const e=q.c(70),{views:s}=l,n=Z();let i;e[0]!==n?(i=n("virtualMcp.settings.views.defaults"),e[0]=n,e[1]=i):i=e[1];let a;e[2]!==n?(a=n("virtualMcp.layoutTabContent.mainView"),e[2]=n,e[3]=a):a=e[3];let c;e[4]!==n?(c=n("virtualMcp.layoutTabContent.mainViewDescription"),e[4]=n,e[5]=c):c=e[5];const r=s.defaultMainView,p=s.setMainView;let o;e[6]!==n?(o=n("virtualMcp.layoutTabContent.mainView"),e[6]=n,e[7]=o):o=e[7];let f;e[8]!==n?(f=n("virtualMcp.layoutTabContent.noMainView"),e[8]=n,e[9]=f):f=e[9];let m;e[10]!==f?(m=t.jsx(Ie,{placeholder:f}),e[10]=f,e[11]=m):m=e[11];let u;e[12]!==o||e[13]!==m?(u=t.jsx(Oe,{"aria-label":o,className:"w-36 h-8 text-sm shrink-0 @min-xl/project-settings:w-44",children:m}),e[12]=o,e[13]=m,e[14]=u):u=e[14];let h;e[15]!==s.defaultMainOptions?(h=s.defaultMainOptions.map(_a),e[15]=s.defaultMainOptions,e[16]=h):h=e[16];let d;e[17]!==h?(d=t.jsx(Ae,{children:h}),e[17]=h,e[18]=d):d=e[18];let x;e[19]!==d||e[20]!==u||e[21]!==s.defaultMainView||e[22]!==s.setMainView?(x=t.jsxs($e,{value:r,onValueChange:p,children:[u,d]}),e[19]=d,e[20]=u,e[21]=s.defaultMainView,e[22]=s.setMainView,e[23]=x):x=e[23];let g;e[24]!==x||e[25]!==a||e[26]!==c?(g=t.jsx(tt,{title:a,description:c,action:x}),e[24]=x,e[25]=a,e[26]=c,e[27]=g):g=e[27];let v;e[28]!==n?(v=n("virtualMcp.layoutTabContent.showChat"),e[28]=n,e[29]=v):v=e[29];let y;e[30]!==n?(y=n("virtualMcp.layoutTabContent.showChatDescription"),e[30]=n,e[31]=y):y=e[31];let j;e[32]!==n?(j=n("virtualMcp.layoutTabContent.showChat"),e[32]=n,e[33]=j):j=e[33];const b=s.noMainView?!0:s.chatDefaultOpen;let S;e[34]!==j||e[35]!==b||e[36]!==s.noMainView||e[37]!==s.setChatDefaultOpen?(S=t.jsx(Ne,{asChild:!0,children:t.jsx("span",{className:"shrink-0",children:t.jsx(ht,{"aria-label":j,checked:b,disabled:s.noMainView,onCheckedChange:s.setChatDefaultOpen})})}),e[34]=j,e[35]=b,e[36]=s.noMainView,e[37]=s.setChatDefaultOpen,e[38]=S):S=e[38];let N;e[39]!==n||e[40]!==s.noMainView?(N=s.noMainView&&t.jsx(Ce,{side:"top",children:n("virtualMcp.layoutTabContent.chatAlwaysShown")}),e[39]=n,e[40]=s.noMainView,e[41]=N):N=e[41];let k;e[42]!==S||e[43]!==N?(k=t.jsxs(Se,{delayDuration:0,children:[S,N]}),e[42]=S,e[43]=N,e[44]=k):k=e[44];let w;e[45]!==v||e[46]!==y||e[47]!==k?(w=t.jsx(tt,{title:v,description:y,action:k}),e[45]=v,e[46]=y,e[47]=k,e[48]=w):w=e[48];let C;e[49]!==g||e[50]!==w?(C=t.jsxs(ze,{children:[g,w]}),e[49]=g,e[50]=w,e[51]=C):C=e[51];let _;e[52]!==i||e[53]!==C?(_=t.jsx(Be,{title:i,children:C}),e[52]=i,e[53]=C,e[54]=_):_=e[54];let T;e[55]!==n?(T=n("virtualMcp.settings.views.sidebar"),e[55]=n,e[56]=T):T=e[56];let V;e[57]!==s?(V=s.projectViews.map(E=>{const U=s.pinned(E);return t.jsx(tt,{icon:t.jsx(Ca,{viewId:E}),title:s.labels[E],onClick:()=>s.openView(E),action:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(ms,{pinned:U,canSetMainView:U&&!s.isMainView(E),onOpen:()=>s.openView(E),onTogglePin:()=>s.togglePin(E,!U),onSetMainView:()=>s.setMainView(E)}),t.jsx("span",{onClick:()=>s.openView(E),className:"flex cursor-pointer items-center text-muted-foreground",children:t.jsx(Wt,{size:16})})]})},E)}),e[57]=s,e[58]=V):V=e[58];let $;e[59]!==s?($=s.connectionsData.flatMap(E=>[t.jsx(ka,{icon:E.icon,title:E.title},`${E.id}:header`),...E.uiTools.map(U=>{const K=s.pinnedAppViews.find(M=>M.connectionId===E.id&&M.toolName===U.name),Y=!!K,B=cn(E.id,U.name),z=`ext-apps:${E.id}:${U.name}`;return t.jsx(tt,{onClick:()=>s.openView(B),icon:Y?t.jsx("span",{onClick:fs,children:t.jsx(Zs,{value:K.icon??null,name:K.label||U.name,size:"xs",showHoverOverlay:!1,onChange:M=>s.setAppViewIcon(E.id,U.name,M)})}):t.jsx(Os,{size:16}),title:Y?t.jsx("span",{onClick:fs,children:t.jsx(ke,{value:K.label,onChange:M=>s.setAppViewLabel(E.id,U.name,M.target.value),onBlur:s.commitAppViewLabel,"aria-label":U.title??kt(U.name),className:"h-7 w-full max-w-52 text-sm"})}):U.title??kt(U.name),action:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(ms,{pinned:Y,canSetMainView:Y&&!s.isMainView(z),onOpen:()=>s.openView(B),onTogglePin:()=>s.toggleAppViewPin(E.id,U.name),onSetMainView:()=>s.setMainView(z)}),t.jsx("span",{onClick:()=>s.openView(B),className:"flex cursor-pointer items-center text-muted-foreground",children:t.jsx(Wt,{size:16})})]})},`${E.id}:${U.name}`)})]),e[59]=s,e[60]=$):$=e[60];let D;e[61]!==V||e[62]!==$?(D=t.jsxs(ze,{children:[V,$]}),e[61]=V,e[62]=$,e[63]=D):D=e[63];let A;e[64]!==T||e[65]!==D?(A=t.jsx(Be,{title:T,children:D}),e[64]=T,e[65]=D,e[66]=A):A=e[66];let P;return e[67]!==_||e[68]!==A?(P=t.jsxs(t.Fragment,{children:[_,A]}),e[67]=_,e[68]=A,e[69]=P):P=e[69],P}function _a(l){return t.jsx(we,{value:l.value,children:l.label},l.value)}const en="site-editor",Va=new Set([en,"content"]);function Ta({virtualMcpId:l,form:e,flushAndSave:s}){const n=Z(),i=Tt(),{openPanel:a}=Ii(),c=_s(l),r=Ai(c),p=Us(l),o=Ui(l),f=(c?.connections??[]).map(M=>M.connection_id).sort(),{data:m}=Ss({queryKey:Dt.projectConnectionDetails(l,f),enabled:f.length>0,queryFn:async()=>await Promise.all(f.map(async O=>{try{const{item:G}=await i.call("COLLECTION_CONNECTIONS_GET",{id:O}),R=(G?.tools??[]).flatMap(F=>{const W=Di(F._meta);return W?[{name:F.name,title:F.title,description:F.description,resourceUri:W}]:[]});return{fetchOk:!0,id:O,title:G?.title??O,icon:G?.icon??null,uiTools:R}}catch{return{fetchOk:!1,id:O,title:O,icon:null,uiTools:[]}}}))}),u=(m??[]).filter(M=>M.uiTools.length>0),h=new Set([...dn,...un]),d=e.watch("metadata.ui.pinnedViews")??[],x=e.watch("metadata.ui.layout")??null,g=x?.defaultMainView??null,v=x?.chatDefaultOpen??!1,y=Mt(_t({sidebarViews:e.watch("metadata.sidebarViews"),ui:{layout:x}}),e.watch("metadata.sidebarViewsVersion")),j=o??(c?Mt(_t(c.metadata),c.metadata.sidebarViewsVersion):y),b=(()=>{if(!g||g.type==="chat")return"";const M=mn(g.type);return M==="instructions"||M==="connections"||M==="layout"?"settings":Va.has(M)?en:h.has(M)?M:`${M}:${g.id??""}:${g.toolName??""}`})(),S=b==="",N=M=>{const[O,G,R]=M.split(":");return O?h.has(O)?{type:O}:O==="ext-apps"&&G?{type:"ext-apps",id:G,toolName:R||void 0}:null:null},k=M=>{e.setValue("metadata.ui.pinnedViews",M,{shouldDirty:!0})},w=M=>{e.setValue("metadata.ui.layout",{...x,...M},{shouldDirty:!0})},C=Q.useRef(!1);if(m&&m.length>0&&!C.current){C.current=!0;const M=new Set((m??[]).filter(F=>F.fetchOk).map(F=>F.id)),O=new Set(u.flatMap(F=>F.uiTools.map(W=>`${F.id}:${W.name}`))),G=new Set(f),R=d.filter(F=>G.has(F.connectionId)&&(!M.has(F.connectionId)||O.has(`${F.connectionId}:${F.toolName}`)));R.length!==d.length&&(k(R),g?.type==="ext-apps"&&!R.some(F=>F.connectionId===g.id&&F.toolName===g.toolName)&&w({defaultMainView:{type:"settings"}}))}const _=(M,O)=>{if(d.some(R=>R.connectionId===M&&R.toolName===O)){const R=d.filter(W=>!(W.connectionId===M&&W.toolName===O));k(R);const F=`ext-apps:${M}:${O}`;b===F&&w({defaultMainView:{type:"settings"}})}else{const R=u.find(F=>F.id===M)?.uiTools.find(F=>F.name===O)?.title;k([...d,{connectionId:M,toolName:O,label:R??kt(O),icon:null}])}s()},T=(M,O,G)=>{k(d.map(R=>R.connectionId===M&&R.toolName===O?{...R,label:G}:R))},V=()=>{s()},$=(M,O,G)=>{k(d.map(R=>R.connectionId===M&&R.toolName===O?{...R,icon:G}:R)),s()},D=M=>{w({defaultMainView:N(M)}),s()},A=(M,O)=>{const G=zi(j,M,O,1);e.setValue("metadata.sidebarViews",G,{shouldDirty:!0}),e.setValue("metadata.sidebarViewsVersion",1,{shouldDirty:!0}),p.stage(G,j);const R=Ri(g,M,O);R!==g&&w({defaultMainView:R})},P=Ls(c?.metadata),E=$i(P,r.presence),U=Fi(E),K=Ei(j,E,1),Y={overview:n("sidebar.navDestinations.home"),reports:n("sidebar.navDestinations.reports"),board:n("sidebar.navDestinations.tasks"),"site-editor":n("virtualMcp.layoutTabContent.siteEditor"),assets:n("common.mainPanelTabs.assets"),releases:n("common.mainPanelTabs.releases"),hosting:n("common.mainPanelTabs.hosting"),e2e:n("common.mainPanelTabs.e2e"),analytics:n("common.mainPanelTabs.analytics"),cdn:n("common.mainPanelTabs.cdn"),automations:n("virtualMcp.layoutTabContent.automations"),experiments:n("experiments.title")},B=[];for(const M of K)M!=="automations"&&B.push({value:M,label:Y[M]});for(const M of d)B.push({value:`ext-apps:${M.connectionId}:${M.toolName}`,label:M.label||M.toolName});return K.includes("automations")&&B.push({value:"automations",label:Y.automations}),B.push({value:"settings",label:n("virtualMcp.layoutTabContent.settings")}),{projectViews:U,labels:Y,pinned:M=>j.includes(M),isMainView:M=>b===M,defaultMainView:b,defaultMainOptions:B,noMainView:S,chatDefaultOpen:v,connectionsData:u,pinnedAppViews:d,openView:M=>a(M,{virtualmcpid:l}),togglePin:(M,O)=>A(M,O),setMainView:D,setChatDefaultOpen:M=>{w({chatDefaultOpen:M}),s()},toggleAppViewPin:_,setAppViewIcon:$,setAppViewLabel:T,commitAppViewLabel:V}}function Da(l){const e=q.c(55),{form:s,onCommit:n}=l,i=Z(),a=Q.useId();let c;e[0]!==i?(c=i("virtualMcp.settings.identity.icon"),e[0]=i,e[1]=c):c=e[1];let r;e[2]!==c?(r=t.jsx("p",{className:"text-sm font-medium",children:c}),e[2]=c,e[3]=r):r=e[3];let p;e[4]!==i?(p=i("virtualMcp.settings.identity.iconDescription"),e[4]=i,e[5]=p):p=e[5];let o;e[6]!==p?(o=t.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:p}),e[6]=p,e[7]=o):o=e[7];let f;e[8]!==r||e[9]!==o?(f=t.jsxs("div",{children:[r,o]}),e[8]=r,e[9]=o,e[10]=f):f=e[10];let m;e[11]!==s||e[12]!==n||e[13]!==i?(m=T=>{const{field:V}=T;return t.jsx("div",{className:"justify-self-start",children:t.jsx(Zs,{value:V.value??null,onChange:$=>{V.onChange($),n()},onColorChange:$=>{s.setValue("metadata.ui.themeColor",$,{shouldDirty:!0}),n()},name:s.watch("title")||i("virtualMcp.virtualMcp.agentNameFallback"),size:"md",avatarClassName:"[&_svg]:w-1/2 [&_svg]:h-1/2"})})},e[11]=s,e[12]=n,e[13]=i,e[14]=m):m=e[14];let u;e[15]!==s.control||e[16]!==m?(u=t.jsx(be,{name:"icon",control:s.control,render:m}),e[15]=s.control,e[16]=m,e[17]=u):u=e[17];let h;e[18]!==f||e[19]!==u?(h=t.jsxs(je,{className:"grid gap-3 @min-xl/project-settings:grid-cols-[180px_minmax(0,1fr)] @min-xl/project-settings:gap-8",children:[f,u]}),e[18]=f,e[19]=u,e[20]=h):h=e[20];const d=`${a}-name`;let x;e[21]!==i?(x=i("virtualMcp.settings.identity.name"),e[21]=i,e[22]=x):x=e[22];let g;e[23]!==x||e[24]!==d?(g=t.jsx("label",{htmlFor:d,className:"text-sm font-medium",children:x}),e[23]=x,e[24]=d,e[25]=g):g=e[25];let v;e[26]!==a||e[27]!==n||e[28]!==i?(v=T=>{const{field:V}=T;return t.jsx(ke,{...V,id:`${a}-name`,value:V.value??"",onBlur:()=>{V.onBlur(),n()},placeholder:i("virtualMcp.virtualMcp.agentNamePlaceholder")})},e[26]=a,e[27]=n,e[28]=i,e[29]=v):v=e[29];let y;e[30]!==s.control||e[31]!==v?(y=t.jsx(be,{name:"title",control:s.control,render:v}),e[30]=s.control,e[31]=v,e[32]=y):y=e[32];let j;e[33]!==g||e[34]!==y?(j=t.jsxs(je,{className:"grid gap-3 @min-xl/project-settings:grid-cols-[180px_minmax(0,1fr)] @min-xl/project-settings:gap-8",children:[g,y]}),e[33]=g,e[34]=y,e[35]=j):j=e[35];const b=`${a}-description`;let S;e[36]!==i?(S=i("virtualMcp.settings.identity.description"),e[36]=i,e[37]=S):S=e[37];let N;e[38]!==b||e[39]!==S?(N=t.jsx("label",{htmlFor:b,className:"text-sm font-medium",children:S}),e[38]=b,e[39]=S,e[40]=N):N=e[40];let k;e[41]!==a||e[42]!==n||e[43]!==i?(k=T=>{const{field:V}=T;return t.jsx(ut,{...V,id:`${a}-description`,value:V.value??"",onBlur:()=>{V.onBlur(),n()},placeholder:i("virtualMcp.virtualMcp.descriptionPlaceholder"),className:"min-h-24 resize-y"})},e[41]=a,e[42]=n,e[43]=i,e[44]=k):k=e[44];let w;e[45]!==s.control||e[46]!==k?(w=t.jsx(be,{name:"description",control:s.control,render:k}),e[45]=s.control,e[46]=k,e[47]=w):w=e[47];let C;e[48]!==N||e[49]!==w?(C=t.jsxs(je,{className:"grid gap-3 @min-xl/project-settings:grid-cols-[180px_minmax(0,1fr)] @min-xl/project-settings:gap-8",children:[N,w]}),e[48]=N,e[49]=w,e[50]=C):C=e[50];let _;return e[51]!==j||e[52]!==C||e[53]!==h?(_=t.jsxs(ze,{children:[h,j,C]}),e[51]=j,e[52]=C,e[53]=h,e[54]=_):_=e[54],_}function Pa(l){const e=q.c(8),{section:s}=l,n=Z();let i;e[0]!==n?(i=n("virtualMcp.settings.navigation"),e[0]=n,e[1]=i):i=e[1];let a;e[2]!==s||e[3]!==n?(a=Gi.map(r=>{const{titleKey:p}=qi[r];return t.jsx(Ue.Tab,{active:s===r,asChild:!0,children:t.jsx(ws,{to:".",activeOptions:{exact:!0,explicitUndefined:!0},search:o=>({...o,section:r==="general"?void 0:r}),children:n(p)})},r)}),e[2]=s,e[3]=n,e[4]=a):a=e[4];let c;if(e[5]!==i||e[6]!==a){const r=t.jsx(Ue.Tabs,{"aria-label":i,children:a});c=t.jsx(fn.Toolbar.Left.Portal,{fallback:r,children:r}),e[5]=i,e[6]=a,e[7]=c}else c=e[7];return c}function Oa(){const l=q.c(8),e=Pt();let s;l[0]===Symbol.for("react.memo_cache_sentinel")?(s={strict:!1},l[0]=s):s=l[0];const{section:n}=pn(s);let i;l[1]!==n?(i=Hi(n)?n:"general",l[1]=n,l[2]=i):i=l[2];let a;l[3]!==e?(a=r=>e({to:".",search:p=>({...p,section:r??void 0})}),l[3]=e,l[4]=a):a=l[4];let c;return l[5]!==i||l[6]!==a?(c={section:i,openSection:a},l[5]=i,l[6]=a,l[7]=c):c=l[7],c}function tn(l){const e=q.c(20),{value:s,label:n,copiedLabel:i,variant:a,size:c,className:r,copiedClassName:p}=l,o=a===void 0?"ghost":a,f=c===void 0?"icon-sm":c,{handleCopy:m,copied:u}=Xi();let h;e[0]!==m||e[1]!==s?(h=()=>{m(s).catch(Ia)},e[0]=m,e[1]=s,e[2]=h):h=e[2];const d=u&&p;let x;e[3]!==r||e[4]!==d?(x=ve(r,d),e[3]=r,e[4]=d,e[5]=x):x=e[5];let g;e[6]!==u?(g=u?t.jsx(rt,{className:"text-success"}):t.jsx(xt,{}),e[6]=u,e[7]=g):g=e[7];let v;e[8]!==n||e[9]!==f||e[10]!==h||e[11]!==x||e[12]!==g||e[13]!==o?(v=t.jsx(te,{type:"button",variant:o,size:f,"aria-label":n,onClick:h,className:x,children:g}),e[8]=n,e[9]=f,e[10]=h,e[11]=x,e[12]=g,e[13]=o,e[14]=v):v=e[14];const y=u?i:"";let j;e[15]!==y?(j=t.jsx("span",{className:"sr-only","aria-live":"polite",children:y}),e[15]=y,e[16]=j):j=e[16];let b;return e[17]!==v||e[18]!==j?(b=t.jsxs(t.Fragment,{children:[v,j]}),e[17]=v,e[18]=j,e[19]=b):b=e[19],b}function Ia(){}function Aa(l){const e=q.c(14),{id:s,value:n,copyLabel:i,copiedLabel:a,className:c}=l;let r;e[0]!==c?(r=ve("relative h-fit",c),e[0]=c,e[1]=r):r=e[1];let p;e[2]!==s||e[3]!==n?(p=t.jsx(ke,{id:s,value:n,readOnly:!0,disabled:!0,className:"pr-10 font-mono"}),e[2]=s,e[3]=n,e[4]=p):p=e[4];let o;e[5]===Symbol.for("react.memo_cache_sentinel")?(o=ve("absolute top-1/2 right-1 -translate-y-1/2 transition-opacity","opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 focus-visible:opacity-100 pointer-coarse:opacity-100"),e[5]=o):o=e[5];let f;e[6]!==a||e[7]!==i||e[8]!==n?(f=t.jsx(tn,{value:n,label:i,copiedLabel:a,className:o,copiedClassName:"opacity-100"}),e[6]=a,e[7]=i,e[8]=n,e[9]=f):f=e[9];let m;return e[10]!==r||e[11]!==p||e[12]!==f?(m=t.jsxs("div",{className:r,children:[p,f]}),e[10]=r,e[11]=p,e[12]=f,e[13]=m):m=e[13],m}async function ps(l){const e=await l.json().catch(()=>({}));if(!l.ok)throw new Error(e.error??`HTTP ${l.status}`);return e}function $a(l){const e=q.c(106),{orgSlug:s,virtualMcpId:n}=l,i=Z(),a=Ns(),c=`/api/${s}/hosted/${encodeURIComponent(n)}/site-tokens`;let r;e[0]!==s||e[1]!==n?(r=Dt.hostedSiteTokens(s,n),e[0]=s,e[1]=n,e[2]=r):r=e[2];const p=r,[o,f]=Q.useState(null),m=Q.useId();let u;e[3]!==c?(u=async()=>ps(await fetch(c)),e[3]=c,e[4]=u):u=e[4];let h;e[5]!==p||e[6]!==u?(h={queryKey:p,queryFn:u},e[5]=p,e[6]=u,e[7]=h):h=e[7];const d=Ss(h);let x;e[8]!==c?(x=async()=>ps(await fetch(c,{method:"POST"})),e[8]=c,e[9]=x):x=e[9];let g;e[10]===Symbol.for("react.memo_cache_sentinel")?(g=fe=>{const{token:I}=fe;return f(I)},e[10]=g):g=e[10];let v;e[11]!==p||e[12]!==a?(v=()=>a.invalidateQueries({queryKey:p}),e[11]=p,e[12]=a,e[13]=v):v=e[13];let y;e[14]!==x||e[15]!==v?(y={mutationFn:x,onSuccess:g,onError:Fa,onSettled:v},e[14]=x,e[15]=v,e[16]=y):y=e[16];const j=hn(y);let b;e[17]!==d.data?.tokens?(b=d.data?.tokens??[],e[17]=d.data?.tokens,e[18]=b):b=e[18];const S=b,N=d.data?.site;let k;e[19]!==i?(k=i("siteTokens.title"),e[19]=i,e[20]=k):k=e[20];let w;e[21]!==i?(w=i("siteTokens.description"),e[21]=i,e[22]=w):w=e[22];let C;e[23]!==i?(C=i("siteTokens.siteId"),e[23]=i,e[24]=C):C=e[24];let _;e[25]!==m||e[26]!==C?(_=t.jsx("label",{htmlFor:m,className:"text-sm font-medium",children:C}),e[25]=m,e[26]=C,e[27]=_):_=e[27];let T;e[28]!==i?(T=i("siteTokens.siteIdDescription"),e[28]=i,e[29]=T):T=e[29];let V;e[30]!==T?(V=t.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:T}),e[30]=T,e[31]=V):V=e[31];let $;e[32]!==N||e[33]!==m||e[34]!==i?($=N?t.jsx(Aa,{id:m,value:N,copyLabel:i("siteTokens.copySiteId"),copiedLabel:i("siteTokens.siteIdCopied"),className:"min-w-0 flex-1"}):t.jsx("p",{className:"min-w-0 flex-1 font-mono text-xs text-muted-foreground",children:"—"}),e[32]=N,e[33]=m,e[34]=i,e[35]=$):$=e[35];const D=!d.data||j.isPending;let A;e[36]!==j?(A=()=>j.mutate(),e[36]=j,e[37]=A):A=e[37];let P;e[38]!==j.isPending?(P=j.isPending?t.jsx(it,{className:"size-3.5"}):t.jsx(Pe,{size:14}),e[38]=j.isPending,e[39]=P):P=e[39];let E;e[40]!==i?(E=i("siteTokens.issue"),e[40]=i,e[41]=E):E=e[41];let U;e[42]!==D||e[43]!==A||e[44]!==P||e[45]!==E?(U=t.jsxs(te,{type:"button",size:"sm",className:"shrink-0",disabled:D,onClick:A,children:[P,E]}),e[42]=D,e[43]=A,e[44]=P,e[45]=E,e[46]=U):U=e[46];let K;e[47]!==$||e[48]!==U?(K=t.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[$,U]}),e[47]=$,e[48]=U,e[49]=K):K=e[49];let Y;e[50]!==_||e[51]!==V||e[52]!==K?(Y=t.jsxs(je,{className:"group",children:[_,V,K]}),e[50]=_,e[51]=V,e[52]=K,e[53]=Y):Y=e[53];let B;e[54]!==d.error||e[55]!==d.isError?(B=d.isError?t.jsx(je,{children:t.jsx("p",{className:"text-xs text-destructive",children:d.error.message})}):null,e[54]=d.error,e[55]=d.isError,e[56]=B):B=e[56];let z;if(e[57]!==i||e[58]!==S){let fe;e[60]!==i?(fe=I=>t.jsx(je,{children:t.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[t.jsx($t,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"truncate font-mono text-xs",children:I.kid}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("siteTokens.issuedAgo",{when:Qi(new Date(I.iat*1e3))})})]})]})},I.kid),e[60]=i,e[61]=fe):fe=e[61],z=S.map(fe),e[57]=i,e[58]=S,e[59]=z}else z=e[59];let M;e[62]!==Y||e[63]!==B||e[64]!==z?(M=t.jsxs(ze,{children:[Y,B,z]}),e[62]=Y,e[63]=B,e[64]=z,e[65]=M):M=e[65];const O=o!==null;let G;e[66]===Symbol.for("react.memo_cache_sentinel")?(G=fe=>!fe&&f(null),e[66]=G):G=e[66];let R;e[67]!==i?(R=i("siteTokens.createdTitle"),e[67]=i,e[68]=R):R=e[68];let F;e[69]!==R?(F=t.jsx(at,{children:R}),e[69]=R,e[70]=F):F=e[70];let W;e[71]!==i?(W=i("siteTokens.createdDescription"),e[71]=i,e[72]=W):W=e[72];let H;e[73]!==W?(H=t.jsx(Cs,{children:W}),e[73]=W,e[74]=H):H=e[74];let se;e[75]!==F||e[76]!==H?(se=t.jsxs(lt,{children:[F,H]}),e[75]=F,e[76]=H,e[77]=se):se=e[77];let le;e[78]!==i?(le=i("siteTokens.createdTitle"),e[78]=i,e[79]=le):le=e[79];const ce=o??"";let ae;e[80]!==le||e[81]!==ce?(ae=t.jsx(ke,{readOnly:!0,"aria-label":le,value:ce,className:"font-mono text-xs"}),e[80]=le,e[81]=ce,e[82]=ae):ae=e[82];let ie;e[83]!==o||e[84]!==i?(ie=o?t.jsx(tn,{value:o,label:i("siteTokens.copy"),copiedLabel:i("siteTokens.copied"),variant:"outline",size:"icon",className:"shrink-0"}):null,e[83]=o,e[84]=i,e[85]=ie):ie=e[85];let X;e[86]!==ae||e[87]!==ie?(X=t.jsxs("div",{className:"flex items-center gap-2",children:[ae,ie]}),e[86]=ae,e[87]=ie,e[88]=X):X=e[88];let de;e[89]===Symbol.for("react.memo_cache_sentinel")?(de=()=>f(null),e[89]=de):de=e[89];let ue;e[90]!==i?(ue=i("siteTokens.done"),e[90]=i,e[91]=ue):ue=e[91];let he;e[92]!==ue?(he=t.jsx(Vt,{children:t.jsx(te,{onClick:de,children:ue})}),e[92]=ue,e[93]=he):he=e[93];let me;e[94]!==se||e[95]!==X||e[96]!==he?(me=t.jsxs(Je,{className:"sm:max-w-lg",children:[se,X,he]}),e[94]=se,e[95]=X,e[96]=he,e[97]=me):me=e[97];let xe;e[98]!==O||e[99]!==me?(xe=t.jsx(Xe,{open:O,onOpenChange:G,children:me}),e[98]=O,e[99]=me,e[100]=xe):xe=e[100];let ge;return e[101]!==w||e[102]!==M||e[103]!==xe||e[104]!==k?(ge=t.jsxs(Be,{title:k,description:w,children:[M,xe]}),e[101]=w,e[102]=M,e[103]=xe,e[104]=k,e[105]=ge):ge=e[105],ge}function Fa(l){return oe.error(l.message)}function Ea(l){const e=q.c(8),{control:s,previewServerUrl:n}=l,i=Z();let a;e[0]!==n?(a=Ys(n),e[0]=n,e[1]=a):a=e[1];const c=!!a;let r;e[2]!==c||e[3]!==i?(r=o=>{const{field:f}=o;return t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"space-y-0.5 min-w-0",children:[t.jsx(ye,{htmlFor:"fast-preview",className:"font-normal text-foreground",children:i("sandbox.cmsSettings.fastPreview.label")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i(c?"sandbox.cmsSettings.fastPreview.description":"sandbox.cmsSettings.fastPreview.needsPreviewServerUrl")})]}),t.jsx(ht,{id:"fast-preview",className:"shrink-0",checked:!!f.value&&c,disabled:!c,onCheckedChange:m=>f.onChange(m)})]})},e[2]=c,e[3]=i,e[4]=r):r=e[4];let p;return e[5]!==s||e[6]!==r?(p=t.jsx(be,{control:s,name:"metadata.fastPreview",render:r}),e[5]=s,e[6]=r,e[7]=p):p=e[7],p}function za(l){const e=q.c(5),{control:s,fastPreview:n}=l,i=Z();if(!n)return null;let a;e[0]!==i?(a=r=>{const{field:p}=r;return t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"space-y-0.5 min-w-0",children:[t.jsx(ye,{htmlFor:"fast-preview-in-place",className:"font-normal text-foreground",children:i("sandbox.cmsSettings.fastPreviewInPlace.label")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("sandbox.cmsSettings.fastPreviewInPlace.description")})]}),t.jsx(ht,{id:"fast-preview-in-place",className:"shrink-0",checked:!!p.value,onCheckedChange:o=>p.onChange(o)})]})},e[0]=i,e[1]=a):a=e[1];let c;return e[2]!==s||e[3]!==a?(c=t.jsx(be,{control:s,name:"metadata.fastPreviewInPlace",render:a}),e[2]=s,e[3]=a,e[4]=c):c=e[4],c}function Ra(l){const e=q.c(18),{control:s,isBlocksV8:n}=l,i=n===void 0?!1:n,a=Z();let c;e[0]!==a?(c=a("sandbox.previewServerUrlField.label"),e[0]=a,e[1]=c):c=e[1];let r;e[2]!==c?(r=t.jsx(ye,{htmlFor:"preview-server-url",children:c}),e[2]=c,e[3]=r):r=e[3];let p;e[4]!==a?(p=d=>{const{field:x}=d,g=x.value??"";return t.jsx(ke,{id:"preview-server-url",type:"url",inputMode:"url",placeholder:a("sandbox.previewServerUrlField.placeholder"),value:g,onChange:v=>x.onChange(v.target.value===""?null:v.target.value),onBlur:()=>{x.onChange(Ji(g)),x.onBlur()}})},e[4]=a,e[5]=p):p=e[5];let o;e[6]!==s||e[7]!==p?(o=t.jsx(be,{control:s,name:"metadata.previewServerUrl",render:p}),e[6]=s,e[7]=p,e[8]=o):o=e[8];const f=i?"sandbox.previewServerUrlField.descriptionBlocksV8":"sandbox.previewServerUrlField.description";let m;e[9]!==a||e[10]!==f?(m=a(f),e[9]=a,e[10]=f,e[11]=m):m=e[11];let u;e[12]!==m?(u=t.jsx("p",{className:"text-xs text-muted-foreground",children:m}),e[12]=m,e[13]=u):u=e[13];let h;return e[14]!==r||e[15]!==o||e[16]!==u?(h=t.jsxs("div",{className:"space-y-2",children:[r,o,u]}),e[14]=r,e[15]=o,e[16]=u,e[17]=h):h=e[17],h}function La(l){const e=q.c(15),{control:s,isBlocksV8:n,previewServerUrl:i,fastPreview:a}=l,c=Z(),r=n||!!a;let p;e[0]!==s||e[1]!==n?(p=t.jsx(je,{children:t.jsx(Ra,{control:s,isBlocksV8:n})}),e[0]=s,e[1]=n,e[2]=p):p=e[2];let o;e[3]!==s||e[4]!==n||e[5]!==i||e[6]!==c?(o=n?!Ys(i)&&t.jsx(je,{children:t.jsx("p",{className:"text-xs text-muted-foreground",children:c("sandbox.cmsSettings.blocksV8.needsPreviewServerUrl")})}):t.jsx(je,{children:t.jsx(Ea,{control:s,previewServerUrl:i})}),e[3]=s,e[4]=n,e[5]=i,e[6]=c,e[7]=o):o=e[7];let f;e[8]!==s||e[9]!==r?(f=r&&t.jsx(je,{children:t.jsx(za,{control:s,fastPreview:r})}),e[8]=s,e[9]=r,e[10]=f):f=e[10];let m;return e[11]!==p||e[12]!==o||e[13]!==f?(m=t.jsxs(t.Fragment,{children:[p,o,f]}),e[11]=p,e[12]=o,e[13]=f,e[14]=m):m=e[14],m}const St={tools:null,resources:null,prompts:null},Ua=el.pick({status:!0,title:!0,description:!0,icon:!0,metadata:!0,connections:!0});function Ya(l){const s=new TextEncoder().encode(l),n=Array.from(s,i=>String.fromCharCode(i)).join("");return btoa(n)}function sn(l){return{"x-studio-client":l,"x-mesh-client":l}}function Ba(l){const e=q.c(15),{url:s,agentId:n}=l,i=Z(),[a,c]=Q.useState(!1);let r;e[0]!==n||e[1]!==i||e[2]!==s?(r=async()=>{_e("agent_connect_action",{agent_id:n,action:"copy_url"}),await navigator.clipboard.writeText(s),c(!0),oe.success(i("virtualMcp.virtualMcpShareModal.agentUrlCopied")),await vt(2e3),c(!1)},e[0]=n,e[1]=i,e[2]=s,e[3]=r):r=e[3];const p=r;let o;e[4]!==a?(o=a?t.jsx(rt,{size:20,className:"text-success"}):t.jsx(xt,{size:20}),e[4]=a,e[5]=o):o=e[5];let f;e[6]!==a||e[7]!==i?(f=i(a?"virtualMcp.virtualMcpShareModal.copied":"virtualMcp.virtualMcpShareModal.copyUrl"),e[6]=a,e[7]=i,e[8]=f):f=e[8];let m;e[9]!==f?(m=t.jsx("span",{className:"text-xs font-medium",children:f}),e[9]=f,e[10]=m):m=e[10];let u;return e[11]!==p||e[12]!==o||e[13]!==m?(u=t.jsxs(te,{type:"button",variant:"outline",onClick:p,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[o,m]}),e[11]=p,e[12]=o,e[13]=m,e[14]=u):u=e[14],u}function Wa(l){const e=q.c(13),{url:s,serverName:n,agentId:i}=l,a=Z();let c;e[0]!==i||e[1]!==n||e[2]!==a||e[3]!==s?(c=()=>{_e("agent_connect_action",{agent_id:i,action:"install_cursor"});const u=Ws(n),h={type:"http",url:s,headers:sn("Cursor")},d=Ya(JSON.stringify(h,null,2)),x=`cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(u)}&config=${encodeURIComponent(d)}`;window.open(x,"_blank"),oe.success(a("virtualMcp.virtualMcpShareModal.openingCursor"))},e[0]=i,e[1]=n,e[2]=a,e[3]=s,e[4]=c):c=e[4];const r=c;let p;e[5]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("img",{src:"/logos/cursor.svg",alt:"Cursor",className:"h-5 w-5",style:{filter:"brightness(0) saturate(100%) invert(11%) sepia(8%) saturate(785%) hue-rotate(1deg) brightness(95%) contrast(89%)"}}),e[5]=p):p=e[5];let o;e[6]!==a?(o=a("virtualMcp.virtualMcpShareModal.installOnCursor"),e[6]=a,e[7]=o):o=e[7];let f;e[8]!==o?(f=t.jsx("span",{className:"text-xs font-medium",children:o}),e[8]=o,e[9]=f):f=e[9];let m;return e[10]!==r||e[11]!==f?(m=t.jsxs(te,{type:"button",variant:"outline",onClick:r,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[p,f]}),e[10]=r,e[11]=f,e[12]=m):m=e[12],m}function Ka(l){const e=q.c(16),{url:s,serverName:n,agentId:i}=l,a=Z(),[c,r]=Q.useState(!1);let p;e[0]!==i||e[1]!==n||e[2]!==a||e[3]!==s?(p=async()=>{_e("agent_connect_action",{agent_id:i,action:"install_claude_code"});const d=Ws(n),x={type:"http",url:s,headers:sn("Claude Code")},g=JSON.stringify(x,null,2),v=`claude mcp add-json "${d}" '${g.replace(/'/g,"'\\''")}' --scope user`;await navigator.clipboard.writeText(v),r(!0),oe.success(a("virtualMcp.virtualMcpShareModal.claudeCodeCommandCopied")),await vt(2e3),r(!1)},e[0]=i,e[1]=n,e[2]=a,e[3]=s,e[4]=p):p=e[4];const o=p;let f;e[5]!==c?(f=c?t.jsx(rt,{size:20,className:"text-success"}):t.jsx("img",{src:"/logos/Claude Code.svg",alt:"Claude Code",className:"h-5 w-5",style:{filter:"brightness(0) saturate(100%) invert(55%) sepia(31%) saturate(1264%) hue-rotate(331deg) brightness(92%) contrast(86%)"}}),e[5]=c,e[6]=f):f=e[6];let m;e[7]!==c||e[8]!==a?(m=a(c?"virtualMcp.virtualMcpShareModal.copied":"virtualMcp.virtualMcpShareModal.installOnClaudeCode"),e[7]=c,e[8]=a,e[9]=m):m=e[9];let u;e[10]!==m?(u=t.jsx("span",{className:"text-xs font-medium",children:m}),e[10]=m,e[11]=u):u=e[11];let h;return e[12]!==o||e[13]!==f||e[14]!==u?(h=t.jsxs(te,{type:"button",variant:"outline",onClick:o,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[f,u]}),e[12]=o,e[13]=f,e[14]=u,e[15]=h):h=e[15],h}const Ga=720*60*60;function qa({virtualMcp:l}){const e=Z(),s=Tt(),[n,i]=Q.useState(null),[a,c]=Q.useState(!1),[r,p]=Q.useState(!1),o=l.id,f=l.title||`agent-${o.slice(0,8)}`,m=n?`bunx @decocms/typegen@latest --mcp ${o} --key ${n} --output client.ts`:`bunx @decocms/typegen@latest --mcp ${o} --key <api-key> --output client.ts`,u=async()=>{c(!0);try{const{key:d}=await s.call("API_KEY_CREATE",{name:`typegen-${f}`,permissions:{[o]:["*"]},expiresIn:Ga});if(!d)throw new Error("No key in response");i(d),_e("agent_typegen_key_generated",{agent_id:o})}catch{_e("agent_typegen_key_failed",{agent_id:o}),oe.error(e("virtualMcp.virtualMcpShareModal.failedGenerateApiKey"))}finally{c(!1)}},h=async()=>{_e("agent_connect_action",{agent_id:o,action:"typegen_copy_command",has_api_key:!!n}),await navigator.clipboard.writeText(m),p(!0),oe.success(e("virtualMcp.virtualMcpShareModal.commandCopied")),await vt(2e3),p(!1)};return t.jsxs("div",{className:"flex min-w-0 flex-col gap-3",children:[t.jsxs("div",{className:"flex items-start justify-between gap-3",children:[t.jsxs("div",{className:"flex flex-col gap-0.5",children:[t.jsx("h4",{className:"text-sm font-medium text-foreground",children:e("virtualMcp.virtualMcpShareModal.generateTypedClient")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:e("virtualMcp.virtualMcpShareModal.generateTypedClientDescription")})]}),!n&&t.jsxs(te,{type:"button",variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:u,disabled:a,children:[a?t.jsx(it,{className:"size-3.5"}):t.jsx($t,{size:14}),t.jsx("span",{children:e(a?"virtualMcp.virtualMcpShareModal.generating":"virtualMcp.virtualMcpShareModal.generateApiKey")})]})]}),n&&t.jsx("p",{className:"rounded-md border border-warning/20 bg-warning/10 px-3 py-2 text-xs text-warning",children:e("virtualMcp.virtualMcpShareModal.storeKeySecurely")}),t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:e("virtualMcp.virtualMcpShareModal.generateClientLabel")}),t.jsx("div",{className:"rounded-md border border-input bg-muted/50 px-3 py-2.5",children:t.jsxs("div",{className:"flex items-start gap-2",children:[t.jsx("code",{className:"min-w-0 flex-1 break-all font-mono text-xs text-muted-foreground",children:m}),t.jsx(te,{type:"button",variant:"ghost",size:"icon",className:"size-6 shrink-0",onClick:h,children:r?t.jsx(rt,{size:12,className:"text-success"}):t.jsx(xt,{size:12})})]})}),t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:e("virtualMcp.virtualMcpShareModal.runtimeVariables")}),t.jsx(Ha,{apiKey:n,agentId:o})]})}function Ha(l){const e=q.c(21),{apiKey:s,agentId:n}=l,[i,a]=Q.useState(!1),c=window.location.origin,r=s?`STUDIO_API_KEY=${s}`:"STUDIO_API_KEY=<api-key>",p=`STUDIO_BASE_URL=${c}`,o=`${r}
2
2
  ${p}`;let f;e[0]!==n||e[1]!==s||e[2]!==o?(f=async()=>{_e("agent_connect_action",{agent_id:n,action:"typegen_copy_env",has_api_key:!!s}),await navigator.clipboard.writeText(o),a(!0),await vt(2e3),a(!1)},e[0]=n,e[1]=s,e[2]=o,e[3]=f):f=e[3];const m=f,u=!s;let h;e[4]!==u?(h=ve({"opacity-50":u}),e[4]=u,e[5]=h):h=e[5];let d;e[6]!==r||e[7]!==h?(d=t.jsx("span",{className:h,children:r}),e[6]=r,e[7]=h,e[8]=d):d=e[8];let x,g;e[9]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("br",{}),g=t.jsx("span",{children:p}),e[9]=x,e[10]=g):(x=e[9],g=e[10]);let v;e[11]!==d?(v=t.jsxs("code",{className:"min-w-0 flex-1 font-mono text-xs text-muted-foreground",children:[d,x,g]}),e[11]=d,e[12]=v):v=e[12];let y;e[13]!==i?(y=i?t.jsx(rt,{size:12,className:"text-success"}):t.jsx(xt,{size:12}),e[13]=i,e[14]=y):y=e[14];let j;e[15]!==m||e[16]!==y?(j=t.jsx(te,{type:"button",variant:"ghost",size:"icon",className:"size-6 shrink-0",onClick:m,children:y}),e[15]=m,e[16]=y,e[17]=j):j=e[17];let b;return e[18]!==v||e[19]!==j?(b=t.jsx("div",{className:"rounded-md border border-input bg-muted/50 px-3 py-2.5",children:t.jsxs("div",{className:"flex items-start gap-2",children:[v,j]})}),e[18]=v,e[19]=j,e[20]=b):b=e[20],b}function Qa(l){const e=q.c(3),{virtualMcp:s}=l;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"h-20 animate-pulse rounded-md bg-muted"}),e[0]=n):n=e[0];let i;return e[1]!==s?(i=t.jsx(Q.Suspense,{fallback:n,children:t.jsx(qa,{virtualMcp:s})}),e[1]=s,e[2]=i):i=e[2],i}function Xa(l){const e=q.c(45),{open:s,onOpenChange:n,virtualMcp:i}=l,a=Z(),{org:c}=Fe(),r=`/api/${c.slug}/mcp/virtual-mcp/${i.id}`;let p;e[0]!==r?(p=new URL(r,window.location.origin),e[0]=r,e[1]=p):p=e[1];const o=p;let f;e[2]!==i.id||e[3]!==i.title?(f=i.title||`agent-${i.id?.slice(0,8)??"default"}`,e[2]=i.id,e[3]=i.title,e[4]=f):f=e[4];const m=f,u=al();let h;e[5]!==i.id||e[6]!==o.href?(h=t.jsx(Ba,{url:o.href,agentId:i.id}),e[5]=i.id,e[6]=o.href,e[7]=h):h=e[7];let d,x;e[8]!==m||e[9]!==i.id||e[10]!==o.href?(d=t.jsx(Wa,{url:o.href,serverName:m,agentId:i.id}),x=t.jsx(Ka,{url:o.href,serverName:m,agentId:i.id}),e[8]=m,e[9]=i.id,e[10]=o.href,e[11]=d,e[12]=x):(d=e[11],x=e[12]);let g;e[13]!==h||e[14]!==d||e[15]!==x?(g=t.jsx("div",{className:"flex flex-col gap-3 pt-2",children:t.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[h,d,x]})}),e[13]=h,e[14]=d,e[15]=x,e[16]=g):g=e[16];let v;e[17]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("div",{className:"border-t border-border"}),e[17]=v):v=e[17];let y;e[18]!==i?(y=t.jsx(Qa,{virtualMcp:i}),e[18]=i,e[19]=y):y=e[19];let j;e[20]!==g||e[21]!==y?(j=t.jsxs("div",{className:"flex flex-col gap-6",children:[g,v,y]}),e[20]=g,e[21]=y,e[22]=j):j=e[22];const b=j;if(u){let C;e[23]!==a?(C=a("virtualMcp.virtualMcpShareModal.connect"),e[23]=a,e[24]=C):C=e[24];let _;e[25]!==C?(_=t.jsx(nl,{className:"mt-4 mb-4 text-base font-semibold",children:C}),e[25]=C,e[26]=_):_=e[26];let T;e[27]!==b||e[28]!==_?(T=t.jsx(il,{children:t.jsxs("div",{className:"flex-1 overflow-y-auto px-4 pb-6 [touch-action:pan-y]",children:[_,b]})}),e[27]=b,e[28]=_,e[29]=T):T=e[29];let V;return e[30]!==n||e[31]!==s||e[32]!==T?(V=t.jsx(ll,{open:s,onOpenChange:n,children:T}),e[30]=n,e[31]=s,e[32]=T,e[33]=V):V=e[33],V}let S;e[34]!==a?(S=a("virtualMcp.virtualMcpShareModal.connect"),e[34]=a,e[35]=S):S=e[35];let N;e[36]!==S?(N=t.jsx(lt,{children:t.jsx(at,{children:S})}),e[36]=S,e[37]=N):N=e[37];let k;e[38]!==b||e[39]!==N?(k=t.jsxs(Je,{className:"max-h-[80vh] overflow-y-auto sm:max-w-2xl",children:[N,b]}),e[38]=b,e[39]=N,e[40]=k):k=e[40];let w;return e[41]!==n||e[42]!==s||e[43]!==k?(w=t.jsx(Xe,{open:s,onOpenChange:n,children:k}),e[41]=n,e[42]=s,e[43]=k,e[44]=w):w=e[44],w}const Ja=/^[A-Za-z_][A-Za-z0-9_]*$/;function Za(l){const e={},s=l.split(/\r?\n/);for(let n=0;n<s.length;n++){let i=(s[n]??"").trim();if(!i||i.startsWith("#"))continue;i.startsWith("export ")&&(i=i.slice(7).trim());const a=i.indexOf("=");if(a<0)throw new Error(`Line ${n+1}: missing '='`);const c=i.slice(0,a).trim();if(!Ja.test(c))throw new Error(`Line ${n+1}: invalid key "${c}"`);let r=i.slice(a+1).trim();r.length>=2&&(r.startsWith('"')&&r.endsWith('"')||r.startsWith("'")&&r.endsWith("'"))&&(r=r.slice(1,-1)),e[c]=r}return e}function er(l){const e=q.c(28),{control:s,form:n,virtualMcpId:i,orgSlug:a,sandboxMap:c}=l,r=Z();let p;e[0]!==r?(p=r("sandbox.envVarsField.title"),e[0]=r,e[1]=p):p=e[1];let o;e[2]!==p?(o=t.jsx("div",{className:"flex items-baseline justify-between gap-2",children:t.jsx(ye,{className:"font-normal text-foreground",children:p})}),e[2]=p,e[3]=o):o=e[3];let f;e[4]!==r?(f=r("sandbox.envVarsField.description"),e[4]=r,e[5]=f):f=e[5];let m;e[6]!==f?(m=t.jsx("p",{className:"text-xs text-muted-foreground",children:f}),e[6]=f,e[7]=m):m=e[7];let u;e[8]!==s||e[9]!==n||e[10]!==a||e[11]!==c||e[12]!==i?(u=t.jsx(tr,{control:s,form:n,virtualMcpId:i,orgSlug:a,sandboxMap:c}),e[8]=s,e[9]=n,e[10]=a,e[11]=c,e[12]=i,e[13]=u):u=e[13];let h;e[14]!==r?(h=y=>{const{error:j}=y;return t.jsx("div",{className:"rounded-md border border-destructive/40 bg-destructive/5 px-3 py-2 text-xs text-destructive",children:j?.message??r("sandbox.envVarsField.failedToLoadSecrets")})},e[14]=r,e[15]=h):h=e[15];let d;e[16]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(xn,{className:"h-9 w-full"}),e[16]=d):d=e[16];let x;e[17]!==s||e[18]!==n?(x=t.jsx(Q.Suspense,{fallback:d,children:t.jsx(nr,{control:s,form:n})}),e[17]=s,e[18]=n,e[19]=x):x=e[19];let g;e[20]!==h||e[21]!==x?(g=t.jsx(Ye,{fallback:h,children:x}),e[20]=h,e[21]=x,e[22]=g):g=e[22];let v;return e[23]!==o||e[24]!==m||e[25]!==u||e[26]!==g?(v=t.jsxs("div",{className:"space-y-2",children:[o,m,u,g]}),e[23]=o,e[24]=m,e[25]=u,e[26]=g,e[27]=v):v=e[27],v}function tr(l){const e=q.c(33),{control:s,form:n,virtualMcpId:i,orgSlug:a,sandboxMap:c}=l,r=Z(),o=gn.useSession().data?.user?.id,f="metadata.runtime.env";let m;e[0]!==n?(m=()=>JSON.stringify(hs(n.getValues(f))),e[0]=n,e[1]=m):m=e[1];const[u,h]=Q.useState(m);let d;e[2]!==s?(d={control:s,name:f},e[2]=s,e[3]=d):d=e[3];const x=ks(d);let g;e[4]!==x?(g=JSON.stringify(hs(x)),e[4]=x,e[5]=g):g=e[5];const v=g,y=v!==u;let j;e[6]!==c||e[7]!==o?(j=o?Object.keys(c?.[o]??{}):[],e[6]=c,e[7]=o,e[8]=j):j=e[8];const b=j,S=b.length>0,[N,k]=Q.useState(!1);if(!y||!S)return null;let w;e[9]!==v||e[10]!==a||e[11]!==r||e[12]!==b||e[13]!==i?(w=async()=>{k(!0);const E=await Promise.allSettled(b.map(async K=>{const Y=rl({orgSlug:a,virtualMcpId:i,branch:K,threadId:null},"setup/start"),B=await fetch(Y,{method:"POST"});if(!B.ok){const z=await B.text().catch(()=>B.statusText);throw new Error(z||B.statusText)}}));k(!1);const U=E.filter(sr).length;U===0?(h(v),oe.success(b.length===1?r("sandbox.envVarsField.restartedSingle"):r("sandbox.envVarsField.restartedMultiple",{count:b.length}))):oe.error(r("sandbox.envVarsField.restartFailed",{failed:U,total:b.length}))},e[9]=v,e[10]=a,e[11]=r,e[12]=b,e[13]=i,e[14]=w):w=e[14];const C=w;let _;e[15]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(ys,{className:"size-3.5 shrink-0"}),e[15]=_):_=e[15];let T;e[16]!==r?(T=r("sandbox.envVarsField.sandboxRunningNotice"),e[16]=r,e[17]=T):T=e[17];let V;e[18]!==T?(V=t.jsxs("div",{className:"flex min-w-0 items-center gap-2 text-warning",children:[_,t.jsx("span",{className:"truncate",children:T})]}),e[18]=T,e[19]=V):V=e[19];let $;e[20]!==N?($=N?t.jsx(it,{className:"size-3.5"}):t.jsx(bn,{className:"size-3.5"}),e[20]=N,e[21]=$):$=e[21];let D;e[22]!==N||e[23]!==r?(D=r(N?"sandbox.envVarsField.restarting":"sandbox.envVarsField.restartDev"),e[22]=N,e[23]=r,e[24]=D):D=e[24];let A;e[25]!==C||e[26]!==N||e[27]!==D||e[28]!==$?(A=t.jsxs(te,{type:"button",variant:"outline",size:"sm",onClick:C,disabled:N,className:"shrink-0",children:[$,D]}),e[25]=C,e[26]=N,e[27]=D,e[28]=$,e[29]=A):A=e[29];let P;return e[30]!==A||e[31]!==V?(P=t.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-md border border-warning/20 bg-warning/10 px-3 py-2 text-xs",children:[V,A]}),e[30]=A,e[31]=V,e[32]=P):P=e[32],P}function sr(l){return l.status==="rejected"}function nr(l){const e=q.c(62),{control:s,form:n}=l,i=Z(),a="metadata.runtime.env";let c;e[0]!==s?(c={control:s,name:a},e[0]=s,e[1]=c):c=e[1];const r=vn(c),{fields:p,append:o,remove:f}=r;let m;e[2]!==n?(m=(Y,B)=>{n.setValue(`${a}.${Y}`,B,{shouldDirty:!0,shouldTouch:!0})},e[2]=n,e[3]=m):m=e[3];const u=m,h=ul();let d;if(e[4]!==h){d=new Map;for(const Y of h)d.set(Y.id,Y);e[4]=h,e[5]=d}else d=e[5];const[x,g]=Q.useState(null);let v;e[6]!==o?(v=()=>{o({key:"",kind:"literal",value:""})},e[6]=o,e[7]=v):v=e[7];const y=v;let j;e[8]!==o||e[9]!==n||e[10]!==i?(j=async()=>{let Y;try{Y=await navigator.clipboard.readText()}catch{oe.error(i("sandbox.envVarsField.clipboardReadFailed"));return}if(!Y.trim()){oe.error(i("sandbox.envVarsField.clipboardEmpty"));return}let B;try{B=Za(Y)}catch(F){const W=F;oe.error(W.message);return}const z=Object.entries(B);if(z.length===0){oe.error(i("sandbox.envVarsField.nothingToAdd"));return}const M=n.getValues(a)??[],O=new Set;for(const F of M){const W=(F.key??"").trim();W&&O.add(W)}let G=0,R=0;for(const[F,W]of z){if(O.has(F)){R++;continue}o({key:F,kind:"literal",value:W}),O.add(F),G++}G===0&&R>0?oe.message(i("sandbox.envVarsField.allKeysExist",{count:R})):oe.success(R>0?i("sandbox.envVarsField.addedWithSkipped",{added:G,skipped:R}):i("sandbox.envVarsField.added",{added:G}))},e[8]=o,e[9]=n,e[10]=i,e[11]=j):j=e[11];const b=j;let S;if(e[12]!==s||e[13]!==p||e[14]!==n||e[15]!==f||e[16]!==d||e[17]!==h||e[18]!==u){let Y;e[20]!==s||e[21]!==n||e[22]!==f||e[23]!==d||e[24]!==h||e[25]!==u?(Y=(B,z)=>t.jsx("li",{className:"rounded-md border border-border bg-background",children:t.jsx(ir,{index:z,control:s,form:n,onUpdateEntry:u,fieldPath:a,secrets:h,secretById:d,onSaveAsSecret:(M,O)=>g({kind:"save-literal",index:z,presetKey:M,presetValue:O}),onCreateNewSecret:M=>g({kind:"create-new",index:z,presetKey:M}),onRemove:()=>f(z)})},B.id),e[20]=s,e[21]=n,e[22]=f,e[23]=d,e[24]=h,e[25]=u,e[26]=Y):Y=e[26],S=p.map(Y),e[12]=s,e[13]=p,e[14]=n,e[15]=f,e[16]=d,e[17]=h,e[18]=u,e[19]=S}else S=e[19];let N;e[27]!==S?(N=t.jsx("ul",{className:"space-y-2",children:S}),e[27]=S,e[28]=N):N=e[28];let k;e[29]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(Pe,{className:"size-3.5"}),e[29]=k):k=e[29];let w;e[30]!==i?(w=i("sandbox.envVarsField.addEnvVar"),e[30]=i,e[31]=w):w=e[31];let C;e[32]!==y||e[33]!==w?(C=t.jsxs(te,{type:"button",variant:"outline",size:"sm",onClick:y,className:"flex-1",children:[k,w]}),e[32]=y,e[33]=w,e[34]=C):C=e[34];let _;e[35]!==i?(_=i("sandbox.envVarsField.pasteDotenvAriaLabel"),e[35]=i,e[36]=_):_=e[36];let T;e[37]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(fi,{className:"size-3.5"}),e[37]=T):T=e[37];let V;e[38]!==i?(V=i("sandbox.envVarsField.pasteDotenv"),e[38]=i,e[39]=V):V=e[39];let $;e[40]!==b||e[41]!==_||e[42]!==V?($=t.jsx(Ne,{asChild:!0,children:t.jsxs(te,{type:"button",variant:"outline",size:"sm",onClick:b,"aria-label":_,children:[T,V]})}),e[40]=b,e[41]=_,e[42]=V,e[43]=$):$=e[43];let D;e[44]!==i?(D=i("sandbox.envVarsField.pasteDotenvTooltip"),e[44]=i,e[45]=D):D=e[45];let A;e[46]!==D?(A=t.jsx(Ce,{children:D}),e[46]=D,e[47]=A):A=e[47];let P;e[48]!==$||e[49]!==A?(P=t.jsxs(Se,{children:[$,A]}),e[48]=$,e[49]=A,e[50]=P):P=e[50];let E;e[51]!==P||e[52]!==C?(E=t.jsxs("div",{className:"flex items-center gap-2",children:[C,P]}),e[51]=P,e[52]=C,e[53]=E):E=e[53];let U;e[54]!==x||e[55]!==n||e[56]!==u?(U=x!==null?t.jsx(ar,{mode:x,onClose:()=>g(null),onSaved:Y=>{const B=n.getValues(`${a}.${x.index}.key`)?.trim()??"";u(x.index,{key:B,kind:"secret",secretId:Y}),g(null)}}):null,e[54]=x,e[55]=n,e[56]=u,e[57]=U):U=e[57];let K;return e[58]!==E||e[59]!==U||e[60]!==N?(K=t.jsxs("div",{className:"space-y-2",children:[N,E,U]}),e[58]=E,e[59]=U,e[60]=N,e[61]=K):K=e[61],K}function ir(l){const e=q.c(77),{index:s,control:n,form:i,onUpdateEntry:a,fieldPath:c,secrets:r,secretById:p,onSaveAsSecret:o,onCreateNewSecret:f,onRemove:m}=l,u=Z(),h=`${c}.${s}.key`,d=`${c}.${s}.value`,x=`${c}.${s}.secretId`,g=`${c}.${s}.kind`;let v;e[0]!==n||e[1]!==g?(v={control:n,name:g},e[0]=n,e[1]=g,e[2]=v):v=e[2];const j=ks(v)==="secret"?"secret":"literal";let b;e[3]!==i||e[4]!==s||e[5]!==h||e[6]!==o||e[7]!==a||e[8]!==d?(b=W=>{const H=i.getValues(h)?.trim()??"";if(W==="literal"){a(s,{key:H,kind:"literal",value:""});return}const se=i.getValues(d)??"";if(se.length>0){o(H,se);return}a(s,{key:H,kind:"secret",secretId:""})},e[3]=i,e[4]=s,e[5]=h,e[6]=o,e[7]=a,e[8]=d,e[9]=b):b=e[9];const S=b;let N;e[10]!==s||e[11]!==u?(N=W=>{const{field:H}=W,se=(H.value??"").trim(),le=se.length>0&&!gt.test(se);return t.jsxs("div",{className:"space-y-1",children:[t.jsx(ke,{...H,value:H.value??"",placeholder:u("sandbox.envVarsField.keyPlaceholder"),spellCheck:!1,autoComplete:"off",autoCapitalize:"off",autoCorrect:"off",className:ve("font-mono",le&&"border-destructive focus-visible:ring-destructive"),"aria-invalid":le,"aria-label":u("sandbox.envVarsField.envVarKeyLabel",{index:s+1}),onBlur:ce=>{const ae=ce.target.value.trim();H.onChange(ae),H.onBlur()}}),le?t.jsx("p",{className:"text-[11px] text-destructive",children:u("sandbox.envVarsField.invalidKeyMessage")}):null]})},e[10]=s,e[11]=u,e[12]=N):N=e[12];let k;e[13]!==n||e[14]!==h||e[15]!==N?(k=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx(be,{control:n,name:h,render:N})}),e[13]=n,e[14]=h,e[15]=N,e[16]=k):k=e[16];let w;e[17]!==S?(w=W=>S(W),e[17]=S,e[18]=w):w=e[18];let C;e[19]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(Oe,{className:"h-9 w-[110px]",children:t.jsx(Ie,{})}),e[19]=C):C=e[19];let _;e[20]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx($t,{className:"size-3.5"}),e[20]=_):_=e[20];let T;e[21]!==u?(T=u("sandbox.envVarsField.literal"),e[21]=u,e[22]=T):T=e[22];let V;e[23]!==T?(V=t.jsx(we,{value:"literal",children:t.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[_,T]})}),e[23]=T,e[24]=V):V=e[24];let $;e[25]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(jn,{className:"size-3.5"}),e[25]=$):$=e[25];let D;e[26]!==u?(D=u("sandbox.envVarsField.secret"),e[26]=u,e[27]=D):D=e[27];let A;e[28]!==D?(A=t.jsx(we,{value:"secret",children:t.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[$,D]})}),e[28]=D,e[29]=A):A=e[29];let P;e[30]!==A||e[31]!==V?(P=t.jsxs(Ae,{children:[V,A]}),e[30]=A,e[31]=V,e[32]=P):P=e[32];let E;e[33]!==j||e[34]!==P||e[35]!==w?(E=t.jsx("div",{className:"shrink-0",children:t.jsxs($e,{value:j,onValueChange:w,children:[C,P]})}),e[33]=j,e[34]=P,e[35]=w,e[36]=E):E=e[36];let U;e[37]!==n||e[38]!==i||e[39]!==s||e[40]!==h||e[41]!==j||e[42]!==f||e[43]!==p||e[44]!==x||e[45]!==r||e[46]!==u||e[47]!==d?(U=t.jsx("div",{className:"flex flex-[2] min-w-0 items-center gap-1",children:j==="literal"?t.jsx(be,{control:n,name:d,render:W=>{const{field:H}=W;return t.jsx(ke,{...H,value:H.value??"",type:"password",placeholder:u("sandbox.envVarsField.valuePlaceholder"),spellCheck:!1,autoComplete:"off",className:"font-mono","aria-label":u("sandbox.envVarsField.envVarValueLabel",{index:s+1}),onBlur:se=>{H.onChange(se.target.value),H.onBlur()}})}}):t.jsxs(t.Fragment,{children:[t.jsx(be,{control:n,name:x,render:W=>{const{field:H}=W;return t.jsxs($e,{value:H.value||"",onValueChange:se=>H.onChange(se),children:[t.jsx(Oe,{className:ve("h-9 w-full",!H.value&&"text-muted-foreground"),"aria-label":u("sandbox.envVarsField.secretAriaLabel",{index:s+1}),children:t.jsx(Ie,{placeholder:u("sandbox.envVarsField.pickSecretPlaceholder"),children:t.jsx(ol,{field:H,secretById:p})})}),t.jsx(Ae,{children:r.length===0?t.jsx("div",{className:"px-2 py-2 text-xs text-muted-foreground",children:u("sandbox.envVarsField.noSecretsYet")}):r.map(lr)})]})}}),t.jsxs(Se,{children:[t.jsx(Ne,{asChild:!0,children:t.jsx(te,{type:"button",variant:"ghost",size:"icon","aria-label":u("sandbox.envVarsField.createNewSecretAriaLabel"),onClick:()=>{const W=i.getValues(h)?.trim()??"";f(W)},children:t.jsx(Pe,{className:"size-3.5"})})}),t.jsx(Ce,{children:u("sandbox.envVarsField.createNewSecret")})]})]})}),e[37]=n,e[38]=i,e[39]=s,e[40]=h,e[41]=j,e[42]=f,e[43]=p,e[44]=x,e[45]=r,e[46]=u,e[47]=d,e[48]=U):U=e[48];let K;e[49]!==i||e[50]!==h||e[51]!==j||e[52]!==o||e[53]!==u||e[54]!==d?(K=j==="literal"?t.jsxs(Se,{children:[t.jsx(Ne,{asChild:!0,children:t.jsx(te,{type:"button",variant:"ghost",size:"icon","aria-label":u("sandbox.envVarsField.saveAsSecretAriaLabel"),onClick:()=>{const W=i.getValues(h)?.trim()??"",H=i.getValues(d)??"";o(W,H)},children:t.jsx(pi,{className:"size-3.5"})})}),t.jsx(Ce,{children:u("sandbox.envVarsField.saveAsSecret")})]}):null,e[49]=i,e[50]=h,e[51]=j,e[52]=o,e[53]=u,e[54]=d,e[55]=K):K=e[55];let Y;e[56]!==u?(Y=u("sandbox.envVarsField.removeEnvVarAriaLabel"),e[56]=u,e[57]=Y):Y=e[57];let B;e[58]===Symbol.for("react.memo_cache_sentinel")?(B=t.jsx(It,{className:"size-3.5"}),e[58]=B):B=e[58];let z;e[59]!==m||e[60]!==Y?(z=t.jsx(Ne,{asChild:!0,children:t.jsx(te,{type:"button",variant:"ghost",size:"icon","aria-label":Y,onClick:m,children:B})}),e[59]=m,e[60]=Y,e[61]=z):z=e[61];let M;e[62]!==u?(M=u("sandbox.envVarsField.remove"),e[62]=u,e[63]=M):M=e[63];let O;e[64]!==M?(O=t.jsx(Ce,{children:M}),e[64]=M,e[65]=O):O=e[65];let G;e[66]!==z||e[67]!==O?(G=t.jsxs(Se,{children:[z,O]}),e[66]=z,e[67]=O,e[68]=G):G=e[68];let R;e[69]!==K||e[70]!==G?(R=t.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[K,G]}),e[69]=K,e[70]=G,e[71]=R):R=e[71];let F;return e[72]!==E||e[73]!==U||e[74]!==R||e[75]!==k?(F=t.jsxs("div",{className:"flex flex-col gap-2 p-2 sm:flex-row sm:items-center",children:[k,E,U,R]}),e[72]=E,e[73]=U,e[74]=R,e[75]=k,e[76]=F):F=e[76],F}function lr(l){return t.jsx(we,{value:l.id,children:t.jsxs("span",{className:"inline-flex items-center gap-2",children:[t.jsx(dl,{scope:l.scope}),t.jsx("span",{className:"font-mono",children:l.name})]})},l.id)}function ar({mode:l,onClose:e,onSaved:s}){const n=Z(),i=l.kind==="save-literal"?l.presetValue:"",a=l.presetKey,[c,r]=Q.useState(()=>rr(a)),[p,o]=Q.useState("organization"),[f,m]=Q.useState(i),[u,h]=Q.useState(""),d=ml(),x=c.trim(),g=f.length>0&&x.length>0&&cl.test(x),v=async b=>{if(b.preventDefault(),!!g)try{const S=await d.mutateAsync({scope:p,name:x,value:f,description:u.trim()||void 0});oe.success(n("sandbox.envVarsField.secretSaved",{name:S.name})),s(S.id)}catch(S){oe.error(S instanceof Error?S.message:n("sandbox.envVarsField.failedToSaveSecret"))}},y=l.kind==="save-literal"?n("sandbox.envVarsField.saveValueAsSecretTitle"):n("sandbox.envVarsField.createNewSecretTitle"),j=l.kind==="save-literal"?n("sandbox.envVarsField.saveValueAsSecretDescription"):n("sandbox.envVarsField.createNewSecretDescription");return t.jsx(Xe,{open:!0,onOpenChange:b=>{b||e()},children:t.jsxs(Je,{className:"sm:max-w-md",children:[t.jsxs(lt,{children:[t.jsx(at,{children:y}),t.jsx(Cs,{children:j})]}),t.jsxs("form",{onSubmit:v,className:"space-y-4",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(ye,{htmlFor:"save-secret-scope",children:n("sandbox.envVarsField.scopeLabel")}),t.jsxs($e,{value:p,onValueChange:b=>o(b),children:[t.jsx(Oe,{id:"save-secret-scope",children:t.jsx(Ie,{})}),t.jsxs(Ae,{children:[t.jsx(we,{value:"organization",children:n("sandbox.envVarsField.scopeOrganization")}),t.jsx(we,{value:"user",children:n("sandbox.envVarsField.scopePrivate")})]})]})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(ye,{htmlFor:"save-secret-name",children:n("sandbox.envVarsField.nameLabel")}),t.jsx(ke,{id:"save-secret-name",value:c,onChange:b=>r(b.target.value),placeholder:n("sandbox.envVarsField.namePlaceholder"),autoComplete:"off",required:!0}),t.jsx("p",{className:"text-xs text-muted-foreground",children:n("sandbox.envVarsField.nameHelperText")})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(ye,{htmlFor:"save-secret-value",children:n("sandbox.envVarsField.valueLabel")}),t.jsx(ke,{id:"save-secret-value",type:"password",value:f,onChange:b=>m(b.target.value),placeholder:n("sandbox.envVarsField.secretValuePlaceholder"),autoComplete:"new-password",required:!0})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(ye,{htmlFor:"save-secret-description",children:n("sandbox.envVarsField.descriptionLabel")}),t.jsx(ut,{id:"save-secret-description",value:u,onChange:b=>h(b.target.value),rows:2,placeholder:n("sandbox.envVarsField.descriptionPlaceholder")})]}),t.jsxs(Vt,{children:[t.jsx(te,{type:"button",variant:"outline",onClick:e,disabled:d.isPending,children:n("sandbox.envVarsField.cancel")}),t.jsx(te,{type:"submit",disabled:!g||d.isPending,children:d.isPending?n("sandbox.envVarsField.saving"):n("sandbox.envVarsField.saveSecret")})]})]})]})})}function hs(l){if(!Array.isArray(l))return[];const e=[];for(const s of l){if(!s||typeof s!="object")continue;const n=s,i=(n.key??"").trim();if(!(!i||!gt.test(i))){if(n.kind==="literal"){e.push({key:i,kind:"literal",value:n.value??""});continue}n.kind==="secret"&&n.secretId&&e.push({key:i,kind:"secret",secretId:n.secretId})}}return e}function rr(l){const e=l.trim();return e&&gt.test(e)?e:""}function or(l){const e=q.c(21),{repo:s,className:n}=l,i=Z();let a;e[0]!==n?(a=ve("space-y-2",n),e[0]=n,e[1]=a):a=e[1];let c;e[2]!==i?(c=i("sandbox.repoRow.label"),e[2]=i,e[3]=c):c=e[3];let r;e[4]!==c?(r=t.jsx(ye,{children:c}),e[4]=c,e[5]=r):r=e[5];let p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(fl,{size:20,className:"shrink-0 text-foreground/60"}),e[6]=p):p=e[6];let o;e[7]!==s||e[8]!==i?(o=t.jsx(Ne,{asChild:!0,children:t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-border bg-background px-4 py-3",tabIndex:0,children:[p,t.jsx("div",{className:"min-w-0 flex-1",children:s?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"truncate text-sm font-medium",children:[s.owner,"/",s.name]}),t.jsx("div",{className:"truncate text-xs text-muted-foreground",children:s.url})]}):t.jsx("div",{className:"text-sm text-muted-foreground",children:i("sandbox.repoRow.noRepositoryConnected")})})]})}),e[7]=s,e[8]=i,e[9]=o):o=e[9];let f;e[10]!==i?(f=i("sandbox.repoRow.tooltipContent"),e[10]=i,e[11]=f):f=e[11];let m;e[12]!==f?(m=t.jsx(Ce,{children:f}),e[12]=f,e[13]=m):m=e[13];let u;e[14]!==o||e[15]!==m?(u=t.jsxs(Se,{children:[o,m]}),e[14]=o,e[15]=m,e[16]=u):u=e[16];let h;return e[17]!==a||e[18]!==r||e[19]!==u?(h=t.jsxs("div",{className:a,children:[r,u]}),e[17]=a,e[18]=r,e[19]=u,e[20]=h):h=e[20],h}const cr={npm:{install:"npm install",run:l=>`npm run ${l}`,runtime:"node"},pnpm:{install:"pnpm install",run:l=>`pnpm run ${l}`,runtime:"node"},yarn:{install:"yarn install",run:l=>`yarn run ${l}`,runtime:"node"},bun:{install:"bun install",run:l=>`bun run ${l}`,runtime:"bun"},deno:{install:"deno install",run:l=>`deno task ${l}`,runtime:"deno"}};function dr(l){const e=l.trim();if(e==="")return{ok:!0,value:null};if(!/^\d+$/.test(e))return{ok:!1};const s=Number(e);return s<1||s>65535?{ok:!1}:{ok:!0,value:String(s)}}const ur=Object.keys(cr),Nt="__none__";function mr(l){const e=q.c(47),{control:s}=l,n=Z(),i=Q.useRef(null);let a;e[0]!==n?(a=n("sandbox.runtimeFields.packageManager"),e[0]=n,e[1]=a):a=e[1];let c;e[2]!==a?(c=t.jsx(ye,{htmlFor:"runtime-pm",children:a}),e[2]=a,e[3]=c):c=e[3];let r;e[4]!==n?(r=w=>{const{field:C}=w;return t.jsxs($e,{value:C.value??Nt,onValueChange:_=>C.onChange(_===Nt?null:_),children:[t.jsx(Oe,{id:"runtime-pm",children:t.jsx(Ie,{placeholder:n("sandbox.runtimeFields.autoDetect")})}),t.jsxs(Ae,{children:[t.jsx(we,{value:Nt,children:n("sandbox.runtimeFields.autoDetect")}),ur.map(pr)]})]})},e[4]=n,e[5]=r):r=e[5];let p;e[6]!==s||e[7]!==r?(p=t.jsx(be,{control:s,name:"metadata.runtime.selected",render:r}),e[6]=s,e[7]=r,e[8]=p):p=e[8];let o;e[9]!==c||e[10]!==p?(o=t.jsxs("div",{className:"space-y-2",children:[c,p]}),e[9]=c,e[10]=p,e[11]=o):o=e[11];let f;e[12]!==n?(f=n("sandbox.runtimeFields.packagePath"),e[12]=n,e[13]=f):f=e[13];let m;e[14]!==f?(m=t.jsx(ye,{htmlFor:"runtime-path",children:f}),e[14]=f,e[15]=m):m=e[15];let u;e[16]!==s?(u=t.jsx(be,{control:s,name:"metadata.runtime.path",render:fr}),e[16]=s,e[17]=u):u=e[17];let h;e[18]!==n?(h=n("sandbox.runtimeFields.packagePathDescription"),e[18]=n,e[19]=h):h=e[19];let d;e[20]!==h?(d=t.jsx("p",{className:"text-xs text-muted-foreground",children:h}),e[20]=h,e[21]=d):d=e[21];let x;e[22]!==d||e[23]!==m||e[24]!==u?(x=t.jsxs("div",{className:"space-y-2",children:[m,u,d]}),e[22]=d,e[23]=m,e[24]=u,e[25]=x):x=e[25];let g;e[26]!==n?(g=n("sandbox.runtimeFields.devServerPort"),e[26]=n,e[27]=g):g=e[27];let v;e[28]!==g?(v=t.jsx(ye,{htmlFor:"runtime-port",children:g}),e[28]=g,e[29]=v):v=e[29];let y;e[30]!==n?(y=w=>{const{field:C}=w;return t.jsx(ke,{ref:i,id:"runtime-port",inputMode:"numeric",placeholder:n("sandbox.runtimeFields.auto"),defaultValue:C.value??"",onBlur:_=>{const T=dr(_.target.value);T.ok?C.onChange(T.value):i.current&&(i.current.value=C.value??"")}})},e[30]=n,e[31]=y):y=e[31];let j;e[32]!==s||e[33]!==y?(j=t.jsx(be,{control:s,name:"metadata.runtime.port",render:y}),e[32]=s,e[33]=y,e[34]=j):j=e[34];let b;e[35]!==n?(b=n("sandbox.runtimeFields.devServerPortDescription"),e[35]=n,e[36]=b):b=e[36];let S;e[37]!==b?(S=t.jsx("p",{className:"text-xs text-muted-foreground",children:b}),e[37]=b,e[38]=S):S=e[38];let N;e[39]!==v||e[40]!==j||e[41]!==S?(N=t.jsxs("div",{className:"space-y-2",children:[v,j,S]}),e[39]=v,e[40]=j,e[41]=S,e[42]=N):N=e[42];let k;return e[43]!==x||e[44]!==N||e[45]!==o?(k=t.jsxs("div",{className:"space-y-5",children:[o,x,N]}),e[43]=x,e[44]=N,e[45]=o,e[46]=k):k=e[46],k}function fr(l){const{field:e}=l;return t.jsx(ke,{id:"runtime-path",placeholder:".",defaultValue:e.value??"",onBlur:s=>{const n=s.target.value.trim();e.onChange(n===""?null:n)}})}function pr(l){return t.jsx(we,{value:l,children:l},l)}function hr(l){const e=q.c(5),{control:s}=l,n=Z();let i;e[0]!==n?(i=c=>{const{field:r}=c;return t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"space-y-0.5 min-w-0",children:[t.jsx(ye,{htmlFor:"field-description-tooltips",className:"font-normal text-foreground",children:n("sandbox.fieldDescriptionTooltipsField.label")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:n("sandbox.fieldDescriptionTooltipsField.description")})]}),t.jsx(ht,{id:"field-description-tooltips",className:"shrink-0",checked:r.value??!1,onCheckedChange:p=>r.onChange(p)})]})},e[0]=n,e[1]=i):i=e[1];let a;return e[2]!==s||e[3]!==i?(a=t.jsx(be,{control:s,name:"metadata.fieldDescriptionTooltips",render:i}),e[2]=s,e[3]=i,e[4]=a):a=e[4],a}function xr(l){const e=q.c(32),{control:s,onCommit:n}=l,i=Z();let a;e[0]!==i?(a=i("virtualMcp.virtualMcp.publishPolicySmart"),e[0]=i,e[1]=a):a=e[1];let c;e[2]!==i?(c=i("virtualMcp.virtualMcp.publishPolicySmartDescription"),e[2]=i,e[3]=c):c=e[3];let r;e[4]!==a||e[5]!==c?(r={value:"smart",label:a,description:c},e[4]=a,e[5]=c,e[6]=r):r=e[6];let p;e[7]!==i?(p=i("virtualMcp.virtualMcp.publishPolicyCodeReview"),e[7]=i,e[8]=p):p=e[8];let o;e[9]!==i?(o=i("virtualMcp.virtualMcp.publishPolicyCodeReviewDescription"),e[9]=i,e[10]=o):o=e[10];let f;e[11]!==p||e[12]!==o?(f={value:"code-review",label:p,description:o},e[11]=p,e[12]=o,e[13]=f):f=e[13];let m;e[14]!==i?(m=i("virtualMcp.virtualMcp.publishPolicyOpen"),e[14]=i,e[15]=m):m=e[15];let u;e[16]!==i?(u=i("virtualMcp.virtualMcp.publishPolicyOpenDescription"),e[16]=i,e[17]=u):u=e[17];let h;e[18]!==m||e[19]!==u?(h={value:"open",label:m,description:u},e[18]=m,e[19]=u,e[20]=h):h=e[20];let d;e[21]!==r||e[22]!==f||e[23]!==h?(d=[r,f,h],e[21]=r,e[22]=f,e[23]=h,e[24]=d):d=e[24];const x=d;let g;e[25]!==n||e[26]!==x||e[27]!==i?(g=y=>{const{field:j}=y,b=j.value??"smart";return t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"space-y-0.5 min-w-0",children:[t.jsx(ye,{htmlFor:"publish-policy",className:"font-normal text-foreground",children:i("virtualMcp.virtualMcp.publishing")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("virtualMcp.virtualMcp.publishingDescription")})]}),t.jsxs($e,{value:b,onValueChange:S=>{j.onChange(S),n()},children:[t.jsx(Oe,{id:"publish-policy",className:"w-44 shrink-0 text-sm",children:t.jsx(Ie,{})}),t.jsx(Ae,{className:"max-w-80",children:x.map(gr)})]})]})},e[25]=n,e[26]=x,e[27]=i,e[28]=g):g=e[28];let v;return e[29]!==s||e[30]!==g?(v=t.jsx(be,{name:"metadata.publishPolicy",control:s,render:g}),e[29]=s,e[30]=g,e[31]=v):v=e[31],v}function gr(l){return t.jsx(we,{value:l.value,description:l.description,children:l.label},l.value)}function vr(l){const e=q.c(24),{control:s,onCommit:n}=l,i=Z();let a;e[0]!==i?(a=i("sandbox.cmsSettings.contentEditing.off"),e[0]=i,e[1]=a):a=e[1];let c;e[2]!==i?(c=i("sandbox.cmsSettings.contentEditing.offDescription"),e[2]=i,e[3]=c):c=e[3];let r;e[4]!==a||e[5]!==c?(r={value:"off",label:a,description:c},e[4]=a,e[5]=c,e[6]=r):r=e[6];let p;e[7]!==i?(p=i("sandbox.cmsSettings.contentEditing.on"),e[7]=i,e[8]=p):p=e[8];let o;e[9]!==i?(o=i("sandbox.cmsSettings.contentEditing.onDescription"),e[9]=i,e[10]=o):o=e[10];let f;e[11]!==p||e[12]!==o?(f={value:"on",label:p,description:o},e[11]=p,e[12]=o,e[13]=f):f=e[13];let m;e[14]!==r||e[15]!==f?(m=[r,f],e[14]=r,e[15]=f,e[16]=m):m=e[16];const u=m;let h;e[17]!==n||e[18]!==u||e[19]!==i?(h=x=>{const{field:g}=x,v=g.value??null,y=Bs(v);return t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"space-y-0.5 min-w-0",children:[t.jsx(ye,{htmlFor:"content-editing-mode",className:"font-normal text-foreground",children:i("sandbox.cmsSettings.contentEditing.title")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("sandbox.cmsSettings.contentEditing.description")})]}),t.jsxs($e,{value:y,onValueChange:j=>{const b=tl.safeParse(j);b.success&&(g.onChange(sl(v,b.data)),n())},children:[t.jsx(Oe,{id:"content-editing-mode",className:"w-44 shrink-0 text-sm",children:t.jsx(Ie,{})}),t.jsx(Ae,{className:"max-w-80",children:u.map(br)})]})]})},e[17]=n,e[18]=u,e[19]=i,e[20]=h):h=e[20];let d;return e[21]!==s||e[22]!==h?(d=t.jsx(be,{name:"metadata.ui.layout",control:s,render:h}),e[21]=s,e[22]=h,e[23]=d):d=e[23],d}function br(l){return t.jsx(we,{value:l.value,description:l.description,children:l.label},l.value)}function xs(l){const e=l.metadata?.sidebarViews,s=l.metadata?.sidebarViewsVersion;return{effectiveViews:[...Mt(_t(l.metadata),s)],rawViews:e===null?null:e?[...e]:void 0,version:s}}function jr(l,e){return l===e?!0:!l||!e||l.length!==e.length?!1:l.every((s,n)=>s===e[n])}function yr(l,e){switch(e.type){case"SET_SHARE_DIALOG_OPEN":return{...l,shareDialogOpen:e.payload};case"SET_ADD_DIALOG_OPEN":return{...l,addDialogOpen:e.payload};case"OPEN_SETTINGS":return{...l,settingsDialogOpen:!0,settingsConnectionId:e.payload};case"CLOSE_SETTINGS":return{...l,settingsDialogOpen:!1,settingsConnectionId:null};default:return l}}function wr(l,e){switch(e.type){case"accumulate":{const s=l??{start:e.now,fields:new Set,saveCount:0,instructionsLength:null},n=new Set(s.fields);for(const i of e.fields)n.add(i);return{...s,fields:n,saveCount:s.saveCount+1,instructionsLength:e.instructionsLength??s.instructionsLength}}case"reset":return null}}function Sr(l){const e=l.metadata?.runtime?.env;if(!e||e.length===0)return l;const s=e.filter(n=>{if(!n||typeof n!="object")return!1;const i=(n.key??"").trim();return!i||!gt.test(i)?!1:n.kind==="literal"?!0:n.kind==="secret"?!!n.secretId:!1});return s.length===e.length?l:{...l,metadata:{...l.metadata,runtime:{...l.metadata?.runtime??{},env:s}}}}async function Nr(l,e){const s=l?.idToken??null;if(s){const i=gs(s);if(i)return i}const n=l?.userinfoEndpoint??null;if(n)try{const i=await fetch(n,{headers:{Authorization:`Bearer ${e}`}});if(i.ok){const a=await i.json(),c=typeof a.email=="string"?a.email:typeof a.upn=="string"?a.upn:typeof a.preferred_username=="string"?a.preferred_username:null;if(c)return c}}catch{}return gs(e)}function gs(l){try{const e=l.split(".");if(e.length===3&&e[1]){const s=JSON.parse(atob(e[1].replace(/-/g,"+").replace(/_/g,"/")));if(typeof s.email=="string")return s.email;if(typeof s.upn=="string")return s.upn;if(typeof s.preferred_username=="string")return s.preferred_username}}catch{}return null}function Cr({virtualMcp:l,contextSection:e}){const s=Z(),n=In(),{org:i}=Fe(),a=Gn(),{data:c}=qn([l.id]),r=c?.get(l.id)?.last_used_at,p=Ms(),o=Ns(),f=Tt(),m=Us(l.id),u=JSON.stringify([i.id,l.id]),h=Yi(l.metadata,m.snapshot()),d=yn({resolver:wn(Ua),defaultValues:{...l,metadata:{...ss(l.metadata),previewServerUrl:Zi(l.metadata),...h}}}),x=d.watch("connections"),g=Pi(l),v=Ls(l?.metadata),y=v&&Bs(d.watch("metadata.ui.layout"))==="off",j=Vs(l),b=j?{owner:j.owner,name:j.name,url:j.url}:null,[S,N]=Q.useReducer(yr,{shareDialogOpen:!1,addDialogOpen:!1,settingsDialogOpen:!1,settingsConnectionId:null}),[k,w]=Q.useState(!1),[C,_]=Q.useState(!1),{openSidePanel:T}=Dn(),{sendMessage:V}=Mn(),$=async()=>{if(C)return;const L=d.getValues("metadata.instructions");if(L?.trim()){_(!0);try{U(),_e("agent_instructions_improve_clicked",{agent_id:l.id,instructions_length:L.length}),T();const ee=Cn(i.id);await V({tiptapDoc:Vn({managerAgentId:ee.id,managerName:ee.title,kind:"agent",id:l.id,instructions:L})})}finally{_(!1)}}},[D,A]=Q.useReducer(wr,null),P=()=>{D!==null&&(_e("agent_updated",{agent_id:l.id,fields:Array.from(D.fields),instructions_length:D.instructionsLength,save_count:D.saveCount,edit_duration_ms:Date.now()-D.start}),A({type:"reset"}))},{schedule:E,flush:U}=Jt({delayMs:3e4,save:async()=>P()}),K=async()=>{const L=m.snapshot(),ee={predicate:Ve=>ts(Ve.queryKey,i.id)},J=async()=>(await o.invalidateQueries({predicate:Ve=>ts(Ve.queryKey,i.id),refetchType:"all"}),es(o,i.id,l.id)),pe=(Ve,Ge)=>{if(Ve){jr(d.getValues("metadata.sidebarViews"),Ve.rawViews)||d.setValue("metadata.sidebarViews",Ve.rawViews,{shouldDirty:!1}),d.getValues("metadata.sidebarViewsVersion")!==Ve.version&&d.setValue("metadata.sidebarViewsVersion",Ve.version,{shouldDirty:!1});return}Ge!==null&&(d.setValue("metadata.sidebarViews",[...Ge],{shouldDirty:!1}),d.setValue("metadata.sidebarViewsVersion",Li,{shouldDirty:!1}))},Me=Bi(L),Te=Object.keys(d.control._formState.dirtyFields);if(Te.length===0&&!Me){await m.settle({snapshot:L,saved:!0,authoritativeViews:L?.persistedViews});return}const We=Te.length>0?Te:["metadata"],ot=We.includes("metadata"),Ke=d.getValues();d.reset(Ke,{keepValues:!0});const et=Sr(Ke),nn=es(o,i.id,l.id),ln=Wi({sidebarViews:et.metadata?.sidebarViews,sidebarViewsVersion:et.metadata?.sidebarViewsVersion},L,nn?.metadata);et.metadata={...ss(et.metadata),...ln};let bt;try{bt=await a.update.mutateAsync({id:l.id,data:et})}catch(Ve){let Ge=null;try{Ge=await J()}catch{}const Rt=Ge?xs(Ge):null,Lt=await m.settle({snapshot:L,saved:!1,authoritativeViews:Rt?.effectiveViews});throw Lt.settledLatest&&pe(Rt,Lt.reconciledViews),Ve}await o.cancelQueries(ee),Ki(o,i.id,bt);const Et=xs(bt),zt=await m.settle({snapshot:L,saved:!0,authoritativeViews:Et.effectiveViews});zt.settledLatest&&pe(Et,zt.reconciledViews),A({type:"accumulate",now:Date.now(),fields:We,instructionsLength:ot?Ke.metadata?.instructions?.length??0:null}),E()},Y=()=>pl(u,K),{schedule:B,flush:z}=Jt({save:Y});Q.useEffect(()=>{const L=d.watch(()=>B());return()=>L.unsubscribe()},[]);const M=()=>{_e("connections_dialog_opened",{source:"agent_settings",mode:"add"}),N({type:"SET_ADD_DIALOG_OPEN",payload:!0})},O=async L=>{const ee=d.getValues("connections");if(ee.some(Me=>Me.connection_id===L))return;d.setValue("connections",[...ee,{connection_id:L,selected_tools:St.tools,selected_resources:St.resources,selected_prompts:St.prompts}],{shouldDirty:!0}),N({type:"SET_ADD_DIALOG_OPEN",payload:!1});const J=new URL(`/api/${i.slug}/mcp/${L}`,window.location.origin),pe=await Gt({url:J.href,token:null,orgId:i.id});pe.supportsOAuth&&!pe.isAuthenticated&&await H(L)},G=L=>{const J=d.getValues("connections").filter(pe=>pe.connection_id!==L);d.setValue("connections",J,{shouldDirty:!0})},R=(L,ee)=>{const J=d.getValues("connections");if(J.some(pe=>pe.connection_id===ee)){oe.error(s("virtualMcp.virtualMcp.instanceAlreadyAdded"));return}d.setValue("connections",J.map(pe=>pe.connection_id===L?{...pe,connection_id:ee}:pe),{shouldDirty:!0})},F=async L=>{if(d.getValues("connections").find(J=>J.connection_id===L))try{const{item:J}=await f.call("COLLECTION_CONNECTIONS_GET",{id:L});if(!J)return;const pe=J.title.replace(/\s*\(.*?\)\s*$/,""),Me=kn("conn"),Te=`${pe} (${Date.now().toString(36).slice(-4)})`;await p.create.mutateAsync({id:Me,title:Te,description:J.description??null,connection_type:J.connection_type,connection_url:J.connection_url??null,connection_token:null,icon:J.icon??null,app_name:J.app_name??null,app_id:J.app_id??null,connection_headers:J.connection_headers??null});const We=new URL(`/api/${i.slug}/mcp/${Me}`,window.location.origin),ot=await Gt({url:We.href,token:null,orgId:i.id});if(ot.supportsOAuth&&!ot.isAuthenticated){const Ke=await H(Me);if(!Ke){await p.delete.mutateAsync(Me);return}await p.update.mutateAsync({id:Me,data:{title:`${pe} (${Ke})`}})}R(L,Me),oe.success(s("virtualMcp.virtualMcp.newInstanceCreated"))}catch(J){console.error("Failed to create instance:",J),oe.error(s("virtualMcp.virtualMcp.failedToCreateInstance"))}},W=L=>{N({type:"OPEN_SETTINGS",payload:L})},H=async L=>{const{token:ee,tokenInfo:J,error:pe}=await $n({connectionId:L,orgSlug:i.slug,scope:"offline_access"});if(pe||!ee)return oe.error(s("virtualMcp.virtualMcp.authenticationFailed",{error:pe??""})),null;if(J)try{const Te=await fetch(`/api/${i.slug}/connections/${L}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:J.accessToken,refreshToken:J.refreshToken,expiresIn:J.expiresIn,scope:J.scope,clientId:J.clientId,clientSecret:J.clientSecret,tokenEndpoint:J.tokenEndpoint})});if(!Te.ok)console.error("Failed to save OAuth token:",await Te.text()),await p.update.mutateAsync({id:L,data:{connection_token:ee}});else try{await p.update.mutateAsync({id:L,data:{}})}catch(We){console.warn("Failed to refresh connection tools after OAuth:",We)}}catch(Te){console.error("Error saving OAuth token:",Te),await p.update.mutateAsync({id:L,data:{connection_token:ee}})}else await p.update.mutateAsync({id:L,data:{connection_token:ee}});const Me=new URL(`/api/${i.slug}/mcp/${L}`,window.location.origin);return await o.invalidateQueries({queryKey:Dt.isMCPAuthenticated(Me.href,null)}),oe.success(s("virtualMcp.virtualMcp.authenticationSuccessful")),Nr(J,ee)},se=()=>{const L=d.getValues("metadata.instructions")??"",ee=s("virtualMcp.virtualMcp.promptTemplateContent"),J=L.trim()?`${L}
3
3
 
4
4
  ${ee}`:ee;d.setValue("metadata.instructions",J,{shouldDirty:!0})},le=new Set(x.map(L=>L.connection_id)),{section:ce}=Oa(),ae=e!==null,ie=e==="instructions"?null:e??ce,X=ie==="general",de=ae?e==="instructions":X,ue=Oi(l.id)==="v8",he=Ta({virtualMcpId:l.id,form:d,flushAndSave:z}),me=Pt(),[xe,ge]=Q.useState(!1),fe=async()=>{U();try{await a.delete.mutateAsync(l.id),_e("agent_deleted",{agent_id:l.id,source:"agent_detail"}),oe.success(s("virtualMcp.virtualMcp.agentDeleted",{title:l.title})),me({to:"/$org",params:{org:i.slug}})}catch{}},I=t.jsxs(te,{variant:"outline",size:"sm",onClick:()=>{_e("agent_connect_modal_opened",{agent_id:l.id}),N({type:"SET_SHARE_DIALOG_OPEN",payload:!0})},children:[t.jsx(Sn,{size:14}),s("virtualMcp.virtualMcp.connect")]}),ne=t.jsxs("div",{className:"flex items-center gap-2",children:[!d.watch("metadata.instructions")?.trim()&&t.jsx(te,{variant:"outline",size:"sm",onClick:se,children:s("virtualMcp.virtualMcp.promptTemplate")}),t.jsxs(te,{variant:"outline",size:"sm",disabled:C||!d.watch("metadata.instructions")?.trim(),onClick:$,children:[t.jsx(dt,{size:13}),s("virtualMcp.virtualMcp.improve")]})]});return t.jsxs(Ue,{children:[t.jsxs(t.Fragment,{children:[!ae&&t.jsxs(t.Fragment,{children:[t.jsx(Ue.Title,{children:s("virtualMcp.settings.title")}),t.jsx(Pa,{section:ie??"general"})]}),t.jsx(Ue.Actions,{secondary:ie==="connections"?I:void 0,children:ie==="connections"?t.jsxs(te,{size:"sm",onClick:M,children:[t.jsx(Pe,{size:14}),s("virtualMcp.virtualMcp.addConnection")]}):I}),t.jsx(Ue.Content,{children:t.jsx(Ue.Container,{width:"standard",className:"@container/project-settings",children:t.jsxs(Nn,{children:[X&&t.jsx(Ma,{views:he}),X&&t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(Da,{form:d,onCommit:z}),t.jsxs("div",{className:"flex flex-wrap items-center gap-2 px-4 text-xs text-muted-foreground",children:[t.jsx(_n,{id:l.created_by,size:"2xs",className:"text-sm text-muted-foreground"}),t.jsx("span",{className:"text-muted-foreground/50",children:"·"}),t.jsxs("span",{children:[s("virtualMcp.virtualMcp.created")," ",zl(new Date(l.created_at),"PP",{locale:n})]}),t.jsx("span",{className:"text-muted-foreground/50",children:"·"}),t.jsx("span",{children:r?s("virtualMcp.virtualMcp.lastUsed",{time:An(new Date(r),{addSuffix:!0,locale:n})}):s("virtualMcp.virtualMcp.neverUsed")})]})]}),ie==="connections"&&t.jsx("section",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:x.length===0?t.jsxs("button",{type:"button",onClick:M,className:"flex items-center gap-3 px-3 py-2.5 rounded-lg border border-dashed border-border hover:bg-accent/50 transition-colors w-full text-left cursor-pointer",children:[t.jsx("div",{className:"flex items-center justify-center size-8 rounded-md text-muted-foreground/75 border border-dashed border-border shrink-0",children:t.jsx(Pe,{size:16})}),t.jsx("span",{className:"text-sm text-muted-foreground",children:s("virtualMcp.virtualMcp.noConnectionsYet")})]}):x.map(L=>t.jsx(Ye,{fallback:()=>null,children:t.jsx(Q.Suspense,{fallback:t.jsx(Js,{}),children:t.jsx(ha,{connection_id:L.connection_id,usedConnectionIds:le,onOpenSettings:()=>W(L.connection_id),onRemove:()=>G(L.connection_id),onAuthenticate:H,onSwitchInstance:R,onNewInstance:()=>F(L.connection_id)})})},L.connection_id))})}),de&&t.jsxs("section",{className:"flex flex-col gap-3",children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsx("h2",{className:"text-sm font-medium text-foreground",children:s("virtualMcp.virtualMcp.instructions")}),ne]}),t.jsx(be,{name:"metadata.instructions",control:d.control,render:({field:L})=>t.jsxs("div",{className:"relative rounded-xl card-shadow bg-card focus-within:ring-1 focus-within:ring-ring",children:[t.jsx(ut,{...L,value:L.value??"",onChange:ee=>{L.onChange(ee)},onBlur:()=>{L.onBlur(),z()},placeholder:s("virtualMcp.virtualMcp.instructionsPlaceholder"),className:"min-h-[200px] max-h-[360px] overflow-auto resize-none text-base text-muted-foreground placeholder:text-muted-foreground/40 leading-relaxed border-0 shadow-none px-4 py-3 pr-11 focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent",style:{boxShadow:"none"}}),t.jsxs(Se,{delayDuration:0,children:[t.jsx(Ne,{asChild:!0,children:t.jsx(te,{type:"button",variant:"ghost",size:"icon",className:"absolute top-2 right-2 h-7 w-7 text-muted-foreground",onClick:()=>w(!0),"aria-label":s("virtualMcp.virtualMcp.openFullscreenEditor"),children:t.jsx(hi,{size:14})})}),t.jsx(Ce,{side:"left",children:s("virtualMcp.virtualMcp.fullscreen")})]})]})})]}),de&&t.jsx(Ll,{form:d}),X&&t.jsx(Ye,{fallback:()=>null,children:t.jsx(Q.Suspense,{fallback:t.jsxs("section",{className:"flex flex-col gap-3",children:[t.jsx("h2",{className:"text-sm font-medium text-foreground",children:s("virtualMcp.virtualMcp.subAgents")}),t.jsx("div",{className:"h-16 rounded-lg border border-dashed border-border animate-pulse"})]}),children:t.jsx(Ql,{form:d,currentAgentId:l.id})})}),ie==="site"&&v&&t.jsx(Be,{title:s("sandbox.cmsSettings.title"),children:t.jsxs(ze,{children:[t.jsx(je,{children:t.jsx(vr,{control:d.control,onCommit:z})}),!y&&t.jsx(je,{children:t.jsx(hr,{control:d.control})}),!y&&g&&t.jsx(je,{children:t.jsx(xr,{control:d.control,onCommit:z})})]})}),ie==="site"&&!y&&t.jsx(Be,{title:s("sandbox.cmsSettings.preview.title"),description:s("sandbox.cmsSettings.preview.description"),children:t.jsx(ze,{children:t.jsx(La,{control:d.control,isBlocksV8:ue,previewServerUrl:d.watch("metadata.previewServerUrl"),fastPreview:d.watch("metadata.fastPreview")})})}),ie==="site"&&ue&&g&&t.jsx($a,{orgSlug:i.slug,virtualMcpId:l.id}),ie==="site"&&t.jsx(Be,{title:s("virtualMcp.virtualMcp.sandbox"),children:t.jsxs(ze,{children:[t.jsx(je,{children:t.jsx(or,{repo:b})}),t.jsx(je,{children:t.jsx(mr,{control:d.control})}),t.jsx(je,{children:t.jsx(er,{control:d.control,form:d,virtualMcpId:l.id,orgSlug:i.slug,sandboxMap:l.metadata.sandboxMap})})]})}),X&&t.jsx(Be,{title:s("virtualMcp.settings.groups.advanced"),children:t.jsx(ze,{children:t.jsx(tt,{title:s("virtualMcp.virtualMcp.deleteAgent"),description:s("virtualMcp.virtualMcp.deleteAgentDescription"),action:t.jsxs(te,{variant:"outline",size:"sm",className:"text-destructive hover:bg-destructive/10 hover:text-destructive",onClick:()=>ge(!0),children:[t.jsx(It,{size:14}),s("virtualMcp.virtualMcp.deleteAgent")]})})})})]})})},e??ie)]}),t.jsx(Fn,{open:xe,onOpenChange:ge,children:t.jsxs(En,{children:[t.jsxs(zn,{children:[t.jsx(Rn,{children:s("virtualMcp.virtualMcp.deleteAgentConfirm")}),t.jsx(Ln,{children:s("virtualMcp.virtualMcp.deleteAgentConfirmDescription",{title:l.title})})]}),t.jsxs(Un,{children:[t.jsx(Yn,{children:s("virtualMcp.virtualMcp.cancel")}),t.jsx(Bn,{onClick:fe,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:s("virtualMcp.virtualMcp.delete")})]})]})}),t.jsx(gi,{open:S.addDialogOpen,onOpenChange:L=>N({type:"SET_ADD_DIALOG_OPEN",payload:L}),agentId:l.id,addedConnectionIds:le,onAdd:O}),t.jsx(pa,{open:S.settingsDialogOpen,onOpenChange:L=>{L||N({type:"CLOSE_SETTINGS"})},selectedId:S.settingsConnectionId,form:d,connections:x,onAuthenticate:H}),t.jsx(Xa,{open:S.shareDialogOpen,onOpenChange:L=>N({type:"SET_SHARE_DIALOG_OPEN",payload:L}),virtualMcp:l}),t.jsx(Xe,{open:k,onOpenChange:w,children:t.jsxs(Je,{className:"w-[90vw] sm:max-w-6xl h-[85vh] flex flex-col p-0 gap-0",children:[t.jsx(lt,{className:"px-6 pt-6 pb-3 border-b border-border shrink-0",children:t.jsx(at,{children:s("virtualMcp.virtualMcp.instructions")})}),t.jsx("div",{className:"flex-1 min-h-0 p-6",children:t.jsx(be,{name:"metadata.instructions",control:d.control,render:({field:L})=>t.jsx(ut,{...L,value:L.value??"",onChange:ee=>{L.onChange(ee)},onBlur:()=>{L.onBlur(),z()},placeholder:s("virtualMcp.virtualMcp.instructionsPlaceholder"),className:"w-full h-full resize-none text-base text-muted-foreground placeholder:text-muted-foreground/40 leading-relaxed rounded-xl card-shadow px-4 py-3 focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-0 bg-card border-0",style:{boxShadow:"none"}})})})]})})]})}function zo(l){const e=q.c(22),{virtualMcpId:s,contextSection:n}=l,i=n===void 0?null:n,a=Z(),c=Pt(),{org:r}=Fe(),p=_s(s);if(!p){let u;e[0]!==a?(u=a("virtualMcp.virtualMcp.spaceNotFound"),e[0]=a,e[1]=u):u=e[1];let h;e[2]!==a?(h=a("virtualMcp.virtualMcp.spaceNotFoundDescription"),e[2]=a,e[3]=h):h=e[3];let d;e[4]!==c||e[5]!==r.slug?(d=()=>c({to:"/$org",params:{org:r.slug}}),e[4]=c,e[5]=r.slug,e[6]=d):d=e[6];let x;e[7]!==a?(x=a("virtualMcp.virtualMcp.backToSpaces"),e[7]=a,e[8]=x):x=e[8];let g;e[9]!==d||e[10]!==x?(g=t.jsx(te,{variant:"outline",onClick:d,children:x}),e[9]=d,e[10]=x,e[11]=g):g=e[11];let v;return e[12]!==u||e[13]!==h||e[14]!==g?(v=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Tn,{title:u,description:h,actions:g})}),e[12]=u,e[13]=h,e[14]=g,e[15]=v):v=e[15],v}let o;e[16]!==p?(o=Vs(p)?.connectionId??"",e[16]=p,e[17]=o):o=e[17];const f=`${p.id}:${o}`;let m;return e[18]!==i||e[19]!==f||e[20]!==p?(m=t.jsx(Cr,{virtualMcp:p,contextSection:i},f),e[18]=i,e[19]=f,e[20]=p,e[21]=m):m=e[21],m}export{zo as V};