decocms 4.518.2 → 4.518.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 (415) hide show
  1. package/dist/client/assets/{ActiveShapeUtils-EYkJV7tD.js → ActiveShapeUtils-Docp8wLu.js} +1 -1
  2. package/dist/client/assets/{AlertCircle-CzTXJ0ax.js → AlertCircle-DbgHFTtO.js} +1 -1
  3. package/dist/client/assets/{AreaChart-8lCOmLfE.js → AreaChart-CcL-fFKM.js} +1 -1
  4. package/dist/client/assets/{ArrowLeft-BQThfb60.js → ArrowLeft-B24gv2xe.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-DUhCibLH.js → ArrowUp-CgN1Qhsf.js} +1 -1
  6. package/dist/client/assets/{BarChart-2wCpTPJ2.js → BarChart-CCFGMu0H.js} +1 -1
  7. package/dist/client/assets/{Building02-BOLEL9nK.js → Building02-DBmpU4M6.js} +1 -1
  8. package/dist/client/assets/{CartesianChart-CmRg3x8T.js → CartesianChart-DHq2iPiU.js} +1 -1
  9. package/dist/client/assets/{CategoricalChart-BtQQT8Ex.js → CategoricalChart-Do09x_e5.js} +1 -1
  10. package/dist/client/assets/{CheckCircle-OCgBlAwW.js → CheckCircle-Cqp__I1R.js} +1 -1
  11. package/dist/client/assets/{ChevronSelectorVertical-DaDJpoIU.js → ChevronSelectorVertical-Bg2KdIAv.js} +1 -1
  12. package/dist/client/assets/{ChevronUp-DtSKb4be.js → ChevronUp-BJfOFayd.js} +1 -1
  13. package/dist/client/assets/{Copy01-DVWv3lef.js → Copy01-C8oI3ru2.js} +1 -1
  14. package/dist/client/assets/{CreditCard01-Bw5uGiku.js → CreditCard01-DBg0t5KK.js} +1 -1
  15. package/dist/client/assets/{DotsVertical-CEoX1VVK.js → DotsVertical-MgtYn_XR.js} +1 -1
  16. package/dist/client/assets/{ErrorBarContext-i8geYMQV.js → ErrorBarContext-Bjgx2BpF.js} +1 -1
  17. package/dist/client/assets/{Globe04-CMBPkECo.js → Globe04-8XNa-DGn.js} +1 -1
  18. package/dist/client/assets/{Image01-D_y3XkIW.js → Image01-BYSI_JTy.js} +1 -1
  19. package/dist/client/assets/{Key01-p2EsnMlr.js → Key01-CVBy3Esl.js} +1 -1
  20. package/dist/client/assets/{Link01-D28gAr0F.js → Link01-1YHKCfLl.js} +1 -1
  21. package/dist/client/assets/{LinkBroken01-Dz2vlPBe.js → LinkBroken01-D8vKURBw.js} +1 -1
  22. package/dist/client/assets/{Minus-DNpWuD14.js → Minus-D7Nn8Jj1.js} +1 -1
  23. package/dist/client/assets/{Monitor01-CYm-wjzD.js → Monitor01-th-leB7u.js} +1 -1
  24. package/dist/client/assets/{Play-cNq95jJS.js → Play-B3knqxcb.js} +1 -1
  25. package/dist/client/assets/{Plus-C4rGoU1F.js → Plus-Bf8vM3Sx.js} +1 -1
  26. package/dist/client/assets/{ReferenceLine-BvmA07RC.js → ReferenceLine-DevuDJh8.js} +1 -1
  27. package/dist/client/assets/{SearchMd-BYCOzBqa.js → SearchMd-C1vd4NNy.js} +1 -1
  28. package/dist/client/assets/{Sector-23KRNcXn.js → Sector-CjducGVR.js} +1 -1
  29. package/dist/client/assets/{ShoppingBag01-DvN3FHxE.js → ShoppingBag01-Bkku1Te9.js} +1 -1
  30. package/dist/client/assets/{Sun-DFIh8Vd-.js → Sun-C_rfv84K.js} +1 -1
  31. package/dist/client/assets/{SwitchHorizontal01-D6mwjnXs.js → SwitchHorizontal01-DsxrRdFb.js} +1 -1
  32. package/dist/client/assets/{Tool01-_CVpzZpk.js → Tool01-XzMXqYKz.js} +1 -1
  33. package/dist/client/assets/{Trash01-CgNTH-jr.js → Trash01-C68DqBe-.js} +1 -1
  34. package/dist/client/assets/{Upload01-CiTZ5ZQQ.js → Upload01-D4h8lLWj.js} +1 -1
  35. package/dist/client/assets/{User01-vLr2BfmM.js → User01-BKJMa06q.js} +1 -1
  36. package/dist/client/assets/{UserSquare-B7fe7FYj.js → UserSquare-ezkB_C7H.js} +1 -1
  37. package/dist/client/assets/{Users01-BgSWeeD_.js → Users01-sQ3Jopve.js} +1 -1
  38. package/dist/client/assets/{XClose-B_rQyiiY.js → XClose-5-Y_ZVDY.js} +1 -1
  39. package/dist/client/assets/{ZoomOut-DzrH576O.js → ZoomOut-CTwXyALk.js} +1 -1
  40. package/dist/client/assets/{access-gate-CjdHb0j3.js → access-gate-BAeTdIKF.js} +1 -1
  41. package/dist/client/assets/{add-connection-dialog-DyCA7E5B.js → add-connection-dialog-CzGzxkZf.js} +1 -1
  42. package/dist/client/assets/agent-analytics-CyvLQ78l.js +1 -0
  43. package/dist/client/assets/agent-app-CNlTu6Xl.js +1 -0
  44. package/dist/client/assets/{agent-assets-AUU4xJcf.js → agent-assets-CDrWVXsZ.js} +1 -1
  45. package/dist/client/assets/{agent-automation-H4qJ1HOM.js → agent-automation-CANuyesn.js} +3 -3
  46. package/dist/client/assets/agent-automations-FCLkmptj.js +1 -0
  47. package/dist/client/assets/agent-calendar-ChKa8nwx.js +1 -0
  48. package/dist/client/assets/{agent-connect-sources-DO6Zn3Mx.js → agent-connect-sources-DPRFzy_W.js} +1 -1
  49. package/dist/client/assets/agent-deck-DgzTTX-H.js +1 -0
  50. package/dist/client/assets/{agent-e2e-BswlcjA7.js → agent-e2e-CGsydJDk.js} +1 -1
  51. package/dist/client/assets/agent-experiments-g1fOqVOr.js +1 -0
  52. package/dist/client/assets/agent-file-DZxHfHqj.js +1 -0
  53. package/dist/client/assets/{agent-hosting-CgIJCVf2.js → agent-hosting-DLdgWaMb.js} +1 -1
  54. package/dist/client/assets/{agent-icon-BVqmbz-P.js → agent-icon-Bl0Q4nDQ.js} +1 -1
  55. package/dist/client/assets/agent-library-T0msL9vO.js +1 -0
  56. package/dist/client/assets/agent-library-file-Dc6tLUFf.js +1 -0
  57. package/dist/client/assets/agent-monitor-64lw2Ndx.js +1 -0
  58. package/dist/client/assets/{agent-overview-BnCn329o.js → agent-overview-DmbW8VOm.js} +1 -1
  59. package/dist/client/assets/{agent-releases-PaWDRDlN.js → agent-releases-DJsbXDlS.js} +1 -1
  60. package/dist/client/assets/agent-settings-BEGX73lw.js +1 -0
  61. package/dist/client/assets/{agent-site-editor-Dgv9OUYF.js → agent-site-editor-Dn7we51s.js} +1 -1
  62. package/dist/client/assets/agent-site-editor-code-MGF1GSqb.js +2 -0
  63. package/dist/client/assets/agent-site-editor-content-KSRD36m4.js +1 -0
  64. package/dist/client/assets/agent-site-editor-preview-jNYBd5Qs.js +1 -0
  65. package/dist/client/assets/agent-view-Cmt42rZM.js +1 -0
  66. package/dist/client/assets/{agent-view-guard-CIz__L_S.js → agent-view-guard-B0aDsWRb.js} +1 -1
  67. package/dist/client/assets/{agents-list-B9ydQIh8.js → agents-list-lOOhfuKV.js} +1 -1
  68. package/dist/client/assets/{ai-providers-BvGFGpkW.js → ai-providers-Bm7atoS5.js} +1 -1
  69. package/dist/client/assets/{alert-dialog-Bbqu21pF.js → alert-dialog-SFY1grIM.js} +2 -2
  70. package/dist/client/assets/alert-fsJICKf8.js +1 -0
  71. package/dist/client/assets/{analytics-sections-CXA9Djw5.js → analytics-sections-KGMek742.js} +1 -1
  72. package/dist/client/assets/{analytics-tab-CNbGVSyT.js → analytics-tab-DrPnNwhC.js} +1 -1
  73. package/dist/client/assets/{api-keys-zMWE0eW-.js → api-keys-DGMEM3Pu.js} +1 -1
  74. package/dist/client/assets/api-keys-DxiLI10z.js +1 -0
  75. package/dist/client/assets/{app-editor-BnLt2HBc.js → app-editor-6m_ygtwU.js} +1 -1
  76. package/dist/client/assets/{asset-utils-CQBKR3VN.js → asset-utils-DJKQ3jqO.js} +1 -1
  77. package/dist/client/assets/{auth-catchall-BeibfVV0.js → auth-catchall-BDasxET4.js} +1 -1
  78. package/dist/client/assets/{auth-entry-DgsnWxp_.js → auth-entry-CIp781XC.js} +1 -1
  79. package/dist/client/assets/{auth-BypL5L1O.js → auth-k-50r1Jm.js} +1 -1
  80. package/dist/client/assets/{auth-split-layout-Daxd6Ypw.js → auth-split-layout-DKyMuscv.js} +1 -1
  81. package/dist/client/assets/{authenticate-and-persist-oauth-ClTAD7nN.js → authenticate-and-persist-oauth-Citp3_ku.js} +1 -1
  82. package/dist/client/assets/{automation-list-row-CvwYuhxk.js → automation-list-row-DCYvqhb1.js} +1 -1
  83. package/dist/client/assets/{automation-runs-CApbL_Sf.js → automation-runs-Bv01EPr_.js} +1 -1
  84. package/dist/client/assets/{automations-Di1Er6hW.js → automations-CMa4N4ws.js} +1 -1
  85. package/dist/client/assets/{autosend-B4f5gabb.js → autosend-BUGExBM4.js} +1 -1
  86. package/dist/client/assets/{avatar-CFO-sRGJ.js → avatar-DZp2nksb.js} +1 -1
  87. package/dist/client/assets/badge-B8Ivcb6S.js +1 -0
  88. package/dist/client/assets/{block-document-C4MOQYjr.js → block-document-t9Z4rWQI.js} +1 -1
  89. package/dist/client/assets/{blocks-preview-workspace-context-Bq9hpUEB.js → blocks-preview-workspace-context-guMABPcp.js} +1 -1
  90. package/dist/client/assets/{blocks-tab-states-CwfYFgj9.js → blocks-tab-states-Ch0bvZWI.js} +1 -1
  91. package/dist/client/assets/{blog-schema-CgYPJyE9.js → blog-schema-DGhK3ld9.js} +1 -1
  92. package/dist/client/assets/{buckets-DoEfEinO.js → buckets-PCZkbjVY.js} +1 -1
  93. package/dist/client/assets/{build-improve-prompt-doc-BByi4O7Q.js → build-improve-prompt-doc-Ba28GGJ7.js} +1 -1
  94. package/dist/client/assets/{calendar-AEesHfNc.js → calendar-BDnGPQeR.js} +1 -1
  95. package/dist/client/assets/{campaigns-view-DTbZCmg6.js → campaigns-view-BzxbPG_g.js} +1 -1
  96. package/dist/client/assets/{capability-load-error-BfKRzvUM.js → capability-load-error-h9GaAVI2.js} +1 -1
  97. package/dist/client/assets/{category-editor-sR05FPNS.js → category-editor-BCaNtr8G.js} +1 -1
  98. package/dist/client/assets/{cdn-tab-9RYVl35J.js → cdn-tab-BxlHc73J.js} +1 -1
  99. package/dist/client/assets/{chart-D7lvPdFx.js → chart-CF2951Pl.js} +1 -1
  100. package/dist/client/assets/{chat-context-DqNUlJMY.js → chat-context-C_P788VD.js} +6 -6
  101. package/dist/client/assets/{chat-draft-DeylAkNb.js → chat-draft-Cd62GOk3.js} +1 -1
  102. package/dist/client/assets/{checkbox-JO6XiJJq.js → checkbox-D_LpTCuo.js} +1 -1
  103. package/dist/client/assets/{choose-editor-CQPIEsfr.js → choose-editor-CB85FQ98.js} +1 -1
  104. package/dist/client/assets/{cli-auth-success-DksDQz1c.js → cli-auth-success-6cvMKGqI.js} +1 -1
  105. package/dist/client/assets/{client-icons-DbBtP136.js → client-icons-CwlNIvVS.js} +1 -1
  106. package/dist/client/assets/cms-settings-editor-CoBhi6-0.js +1 -0
  107. package/dist/client/assets/{collapsible-CXUiqrZ3.js → collapsible-BHKr0Yuy.js} +1 -1
  108. package/dist/client/assets/{collection-detail-BXm00G6J.js → collection-detail--pNpxuBG.js} +1 -1
  109. package/dist/client/assets/{collection-display-button-BYX1WGsT.js → collection-display-button-CmGqnHZR.js} +1 -1
  110. package/dist/client/assets/{collection-search-CVvFJ5Bb.js → collection-search-BfeTverb.js} +1 -1
  111. package/dist/client/assets/{collection-table-wrapper-_tytodYv.js → collection-table-wrapper-DbYcMpOp.js} +1 -1
  112. package/dist/client/assets/{collection-tabs-8dvqqnDR.js → collection-tabs-BCwnkCTo.js} +1 -1
  113. package/dist/client/assets/{column-rules-iw7Orhw0.js → column-rules-cuIMwEgL.js} +1 -1
  114. package/dist/client/assets/{combobox-CS_HItwQ.js → combobox-Br3ekqoF.js} +1 -1
  115. package/dist/client/assets/{command-C9iGFbUT.js → command-9a3EU_B7.js} +1 -1
  116. package/dist/client/assets/{companion-mcps-section-DuvDeify.js → companion-mcps-section-Bict1-Py.js} +1 -1
  117. package/dist/client/assets/{config-Ba5RPb40.js → config-HnMhGwJ8.js} +1 -1
  118. package/dist/client/assets/{connect-Q-Yb-tbQ.js → connect-CPP1LzMI.js} +1 -1
  119. package/dist/client/assets/{connect-layout-BsURWVqR.js → connect-layout-CoCuwn0R.js} +1 -1
  120. package/dist/client/assets/{connect-source-dialog-Cugh2Kwq.js → connect-source-dialog-tW0_dVgF.js} +1 -1
  121. package/dist/client/assets/{connection-y8T_LUE4.js → connection-DA0DdtmE.js} +1 -1
  122. package/dist/client/assets/{connection-card-C_97TUuR.js → connection-card-D6khbIvi.js} +1 -1
  123. package/dist/client/assets/{connection-detail-B2pboQAc.js → connection-detail-3DINZ9Ps.js} +1 -1
  124. package/dist/client/assets/{connection-form-helpers-B61Y3llL.js → connection-form-helpers-CD1Glq-b.js} +1 -1
  125. package/dist/client/assets/{connections-BtM211zd.js → connections-5zgE9hOg.js} +1 -1
  126. package/dist/client/assets/{content-tab-6aM6SPfn.js → content-tab-DsX079ZZ.js} +3 -3
  127. package/dist/client/assets/{context-Dhzbo3rE.js → context-D_yEBKdV.js} +1 -1
  128. package/dist/client/assets/{context-menu-DvfYSbOF.js → context-menu-CQmIAsNX.js} +1 -1
  129. package/dist/client/assets/{context-shell-DQlTMTgZ.js → context-shell-Cm9pkJeZ.js} +3 -3
  130. package/dist/client/assets/{core.esm-Bnj1keGH.js → core.esm-KXf7B9P5.js} +1 -1
  131. package/dist/client/assets/{create-organization-dialog-BJw0GqGQ.js → create-organization-dialog-CU3HQ3J9.js} +1 -1
  132. package/dist/client/assets/{daily-pulse-ambOqGdx.js → daily-pulse-BTMsF03t.js} +1 -1
  133. package/dist/client/assets/{discover-BaCG_0h-.js → discover-CF8v9Owa.js} +1 -1
  134. package/dist/client/assets/{domain-settings-DvRELpY-.js → domain-settings-BE6GV0Yp.js} +1 -1
  135. package/dist/client/assets/{drawer-txFUQcqx.js → drawer-BTNZfEU6.js} +1 -1
  136. package/dist/client/assets/{editor-classes-C__SrxMV.js → editor-classes-DQrtem9w.js} +1 -1
  137. package/dist/client/assets/{editor-DxbkHv3R.js → editor-swke_0an.js} +1 -1
  138. package/dist/client/assets/{empty-state-bJzQYitF.js → empty-state-CkRk6emt.js} +1 -1
  139. package/dist/client/assets/{empty-state-BCgDvmX-.js → empty-state-DjnYxJoJ.js} +1 -1
  140. package/dist/client/assets/experiments-tab-6fYgjeCj.js +1 -0
  141. package/dist/client/assets/experiments-tab-choice-DLYJ3Xgw.js +1 -0
  142. package/dist/client/assets/{extract-connection-data-DrQExIK1.js → extract-connection-data-BcSeYo2b.js} +1 -1
  143. package/dist/client/assets/{feature-gate-Q2dMtYpF.js → feature-gate-DnDfxxPc.js} +1 -1
  144. package/dist/client/assets/{feature-paywall-XpETcjbv.js → feature-paywall-DbYyln6a.js} +1 -1
  145. package/dist/client/assets/{file-explorer-CfVYwLoJ.js → file-explorer-CmXZRbDC.js} +1 -1
  146. package/dist/client/assets/{file-preview-Dd06GGvy.js → file-preview-CB-QuWoi.js} +1 -1
  147. package/dist/client/assets/{file-share-button-BxZcqmJb.js → file-share-button-5DKLtCO8.js} +2 -2
  148. package/dist/client/assets/{file-type-icon-CIdo5ojc.js → file-type-icon-BlPndn8R.js} +1 -1
  149. package/dist/client/assets/{folder-icon-EiO3M0UC.js → folder-icon-50i43Zdi.js} +2 -2
  150. package/dist/client/assets/{form-uqsH1s-y.js → form-CWlPjOiE.js} +1 -1
  151. package/dist/client/assets/{general-Vd-hJfIm.js → general-DiUoRhmp.js} +1 -1
  152. package/dist/client/assets/{home-HWe4c99-.js → home-DgNlH8AE.js} +1 -1
  153. package/dist/client/assets/{icon-button-BUDG7R_U.js → icon-button-BjI92SlL.js} +1 -1
  154. package/dist/client/assets/{index-C_7vDyVA.js → index-AzZxgAUy.js} +1 -1
  155. package/dist/client/assets/{index-BtufcGJ5.js → index-BT89s1_n.js} +1 -1
  156. package/dist/client/assets/{index-v9zzzqiT.js → index-BiGgRVLA.js} +1 -1
  157. package/dist/client/assets/{index-kjyiSPIZ.js → index-BzTLQsHh.js} +1 -1
  158. package/dist/client/assets/{index-BphI8pNH.js → index-CImJlq71.js} +38 -38
  159. package/dist/client/assets/{index-B7PBSrog.js → index-ChO_KP9v.js} +1 -1
  160. package/dist/client/assets/{index-BP0spIbU.js → index-D5TlKaB4.js} +1 -1
  161. package/dist/client/assets/index-D8VCkLtE.js +1 -0
  162. package/dist/client/assets/{index-C5xgscqu.js → index-DQ2PXCBR.js} +1 -1
  163. package/dist/client/assets/{index-BCGh3XTH.js → index-DYNe4TdA.js} +1 -1
  164. package/dist/client/assets/{index-7jvcir73.js → index-DfzKVEQZ.js} +1 -1
  165. package/dist/client/assets/{index-CW0mTKOH.js → index-UjSXE0Iy.js} +1 -1
  166. package/dist/client/assets/{index-Codsxxmu.js → index-YTcaUBCs.js} +1 -1
  167. package/dist/client/assets/{index-B4zmwgCj.js → index-YVO_Peic.js} +1 -1
  168. package/dist/client/assets/{index-unPBFo0y.js → index-YbD_X2Sg.js} +1 -1
  169. package/dist/client/assets/{index-redirect-TlUNx3Dt.js → index-redirect-DDzvngbU.js} +1 -1
  170. package/dist/client/assets/{infiniteQueryObserver-CD6zPv_B.js → infiniteQueryObserver-BPnYbZuQ.js} +1 -1
  171. package/dist/client/assets/{infra-billing-gJ1Pxkhj.js → infra-billing-BqdikAj2.js} +1 -1
  172. package/dist/client/assets/{input-otZYQGEr.js → input-BHFkZ3T9.js} +3 -3
  173. package/dist/client/assets/{input-DeNGl9cT.js → input-Cs9OOIz-.js} +1 -1
  174. package/dist/client/assets/{integration-icon-C-_9oW7G.js → integration-icon-B9snkXuC.js} +1 -1
  175. package/dist/client/assets/{jira-icon-7kZdJvHs.js → jira-icon-DIYO8jdA.js} +1 -1
  176. package/dist/client/assets/{label-BXumUTqC.js → label-CfvfFl3x.js} +1 -1
  177. package/dist/client/assets/{layout-Ba0KZf90.js → layout-BRYkue1F.js} +1 -1
  178. package/dist/client/assets/{legacy-agents-deep-D4pxgM1l.js → legacy-agents-deep-Sb6HNynM.js} +1 -1
  179. package/dist/client/assets/{legacy-main-redirect-BQ_7LpiD.js → legacy-main-redirect-DxGhnvQi.js} +1 -1
  180. package/dist/client/assets/library-BWuIS4mc.js +1 -0
  181. package/dist/client/assets/{login-CtcB6JMd.js → login-BoKhcWPb.js} +1 -1
  182. package/dist/client/assets/{markdown-Bqq3R66p.js → markdown-BDnIqP7U.js} +1 -1
  183. package/dist/client/assets/{mcp-app-renderer-tCfKhIA1.js → mcp-app-renderer-vmvnP_G4.js} +1 -1
  184. package/dist/client/assets/{mcp-oauth-ZxlBJ_T6.js → mcp-oauth-Bf1ymd_L.js} +1 -1
  185. package/dist/client/assets/{mcp-oauth-CaTRnuQU.js → mcp-oauth-De4zWGdY.js} +1 -1
  186. package/dist/client/assets/{members-Ds3beXMQ.js → members-C_49FqGn.js} +1 -1
  187. package/dist/client/assets/{memory-CgI9n1je.js → memory-DB-8JkBQ.js} +1 -1
  188. package/dist/client/assets/{mini-report-page-C4CjzrcA.js → mini-report-page-UFZ1_IfA.js} +1 -1
  189. package/dist/client/assets/{mock-board-x9OA1kIr.js → mock-board-uI6Kjr1q.js} +3 -3
  190. package/dist/client/assets/{monaco-editor-DZ2Rp_C7.js → monaco-editor-FMQP-sIq.js} +2 -2
  191. package/dist/client/assets/{monitoring-BkpBpvIZ.js → monitoring-D8MQ-E4C.js} +1 -1
  192. package/dist/client/assets/{monitoring-stats-row-tdOtylzh.js → monitoring-stats-row-BGPZUteu.js} +1 -1
  193. package/dist/client/assets/{multi-select-BnYAqN90.js → multi-select-CjpZ72b0.js} +1 -1
  194. package/dist/client/assets/{mustache-DuPMqXPT.js → mustache-wrPcgRSJ.js} +1 -1
  195. package/dist/client/assets/{named-rule-uses-BFHY2QY4.js → named-rule-uses-DUhhItNP.js} +1 -1
  196. package/dist/client/assets/{named-rule-view-DHbEzjpv.js → named-rule-view-DuazhL5D.js} +1 -1
  197. package/dist/client/assets/{new-project-dialog-Cs8HMQlb.js → new-project-dialog-CEUx8Wuz.js} +1 -1
  198. package/dist/client/assets/{oauth-callback-DSM8XE33.js → oauth-callback-VCDp4Mdt.js} +1 -1
  199. package/dist/client/assets/{oauth-callback-ai-provider-DgCpBfDW.js → oauth-callback-ai-provider-DA8fj9mx.js} +1 -1
  200. package/dist/client/assets/{onboarding-DeVuIfK9.js → onboarding-CNAboKGM.js} +1 -1
  201. package/dist/client/assets/{openai-conversation-CXYNFSGC.js → openai-conversation-DzWEkMFW.js} +2 -2
  202. package/dist/client/assets/{optimistic-project-sidebar-views-VOTXYU3D.js → optimistic-project-sidebar-views-DtUy3pl1.js} +1 -1
  203. package/dist/client/assets/{order-monitor-day-Bxp4gXEu.js → order-monitor-day-AyxJmcAH.js} +1 -1
  204. package/dist/client/assets/{organization-choice-BhCIGMjr.js → organization-choice-BQVJgGgg.js} +1 -1
  205. package/dist/client/assets/{orgs-BPDKksL2.js → orgs-D0MWQorV.js} +1 -1
  206. package/dist/client/assets/{page-seo-form-WBlhJY38.js → page-seo-form-Dbm_mNqs.js} +1 -1
  207. package/dist/client/assets/{pair-DRaIXAj-.js → pair-CNR7-_qK.js} +8 -8
  208. package/dist/client/assets/{parse-sections-ClqXxi6i.js → parse-sections-BYTdQHxf.js} +1 -1
  209. package/dist/client/assets/{plan-DVQ6L_2j.js → plan-CEyzI8hm.js} +1 -1
  210. package/dist/client/assets/{plan-ladder-BJOn0tjJ.js → plan-ladder-Chib98li.js} +1 -1
  211. package/dist/client/assets/{popover-D-MLGIKG.js → popover-BqGcOxqn.js} +1 -1
  212. package/dist/client/assets/{post-calendar-Ywpfpf68.js → post-calendar-2c7rIKCZ.js} +1 -1
  213. package/dist/client/assets/{post-editor-tA48ONL1.js → post-editor-CRPwAV6k.js} +2 -2
  214. package/dist/client/assets/{preview-content-0nJULLLy.js → preview-content-C3GD-BQD.js} +1 -1
  215. package/dist/client/assets/{preview-dialog-DweVJd_n.js → preview-dialog-vLTpbCc0.js} +1 -1
  216. package/dist/client/assets/{preview-panel-BJ3KrhDy.js → preview-panel-C6xrnpJj.js} +1 -1
  217. package/dist/client/assets/{preview-tab-C3IiVwf1.js → preview-tab-CBRKeC1b.js} +3 -3
  218. package/dist/client/assets/{product-picker-dialog-CCIg354O.js → product-picker-dialog-DHVGLlrb.js} +1 -1
  219. package/dist/client/assets/{profile-ZCnKsIdj.js → profile-C5h78yhG.js} +1 -1
  220. package/dist/client/assets/project-app-view-C3iPvweM.js +1 -0
  221. package/dist/client/assets/{project-apps-FJ0TrEc6.js → project-apps-D7YctFcN.js} +1 -1
  222. package/dist/client/assets/{project-feed-CZ6ECbBu.js → project-feed-CpfPTWDh.js} +1 -1
  223. package/dist/client/assets/{project-icon-J_TfV9WN.js → project-icon-B-MVviOF.js} +1 -1
  224. package/dist/client/assets/project-reports-qKDYuHCF.js +1 -0
  225. package/dist/client/assets/project-tasks-C08bqxWt.js +1 -0
  226. package/dist/client/assets/{projects-BGlrrPvQ.js → projects-DrGNXye1.js} +1 -1
  227. package/dist/client/assets/{projects-empty-state-B699jX9t.js → projects-empty-state-B6Ieq7wG.js} +1 -1
  228. package/dist/client/assets/{prompts-CL3pb_We.js → prompts-DszjlGng.js} +1 -1
  229. package/dist/client/assets/record-editor-zoDoy66N.js +1 -0
  230. package/dist/client/assets/{redirect-editor-DwpwMdsP.js → redirect-editor-D4gU7n0c.js} +1 -1
  231. package/dist/client/assets/{releases-api-DX2L3yOb.js → releases-api-CK0jSLYO.js} +1 -1
  232. package/dist/client/assets/reports-CalnjK7E.js +1 -0
  233. package/dist/client/assets/{reports-fz3ShzPV.js → reports-CjnzDShS.js} +1 -1
  234. package/dist/client/assets/{reports-onboarding-mTQFH_iA.js → reports-onboarding-C81Upwj7.js} +1 -1
  235. package/dist/client/assets/{reports-tab-Bon4oiNK.js → reports-tab-DJdkQM-o.js} +2 -2
  236. package/dist/client/assets/repositories-C7NPKiSj.js +1 -0
  237. package/dist/client/assets/{repositories-Pjwn0cqi.js → repositories-IyZ5mwlx.js} +1 -1
  238. package/dist/client/assets/{repository-binding-CqjA7Tko.js → repository-binding-wXpkgUS5.js} +1 -1
  239. package/dist/client/assets/{repository-import-picker-DRcn5MCM.js → repository-import-picker-DWw4DnKc.js} +1 -1
  240. package/dist/client/assets/{repository-picker-BL6xlIly.js → repository-picker-fHOvHVjl.js} +1 -1
  241. package/dist/client/assets/{require-capability-gPmNE28i.js → require-capability-B4IJOpH-.js} +1 -1
  242. package/dist/client/assets/{required-auth-layout-BA3Gxw_5.js → required-auth-layout-p9wTtbkA.js} +1 -1
  243. package/dist/client/assets/{reset-password-qyVzV1QI.js → reset-password-CpXnMk-E.js} +1 -1
  244. package/dist/client/assets/{resizable-Bu3AyxKl.js → resizable-CykEr2xO.js} +1 -1
  245. package/dist/client/assets/{resolve-tab-icon-DXt8FU1X.js → resolve-tab-icon-dNyXGxcc.js} +1 -1
  246. package/dist/client/assets/{review-settings-O8K_mvh6.js → review-settings-D36VxF8a.js} +1 -1
  247. package/dist/client/assets/{roles-CCLRm2p0.js → roles-DPB4O14g.js} +1 -1
  248. package/dist/client/assets/{route-DaeLPCnk.js → route-CH9GHNDj.js} +1 -1
  249. package/dist/client/assets/route-DsIfFih1.js +1 -0
  250. package/dist/client/assets/route-rXh3k9jX.js +1 -0
  251. package/dist/client/assets/{runnable-block-editor-DXVt1mRj.js → runnable-block-editor-CvNZGRDu.js} +6 -6
  252. package/dist/client/assets/{sandbox-lifecycle-context-CAD11jz7.js → sandbox-lifecycle-context-CsnW_1kh.js} +1 -1
  253. package/dist/client/assets/{schema-Ddw2ah-q.js → schema-BXcU44Bp.js} +1 -1
  254. package/dist/client/assets/{schema-BKLQwKnK.js → schema-BjLtWzT5.js} +1 -1
  255. package/dist/client/assets/{scroll-area-GNWuujdQ.js → scroll-area-BZP0xkZ2.js} +1 -1
  256. package/dist/client/assets/{search-input-i8DAXvnS.js → search-input-CLbrLBK4.js} +1 -1
  257. package/dist/client/assets/{search-toggle-C2BWIs4O.js → search-toggle-Bz--u_u6.js} +1 -1
  258. package/dist/client/assets/{secret-ciphertext-BA15G7qe.js → secret-ciphertext-DZQPZkTr.js} +1 -1
  259. package/dist/client/assets/{secret-picker-CwZHe4Yx.js → secret-picker-r4BGxMfM.js} +1 -1
  260. package/dist/client/assets/{secrets-BWNDO0aL.js → secrets-CzuDVgfq.js} +1 -1
  261. package/dist/client/assets/{sections-DhRieK41.js → sections-DE80daGy.js} +1 -1
  262. package/dist/client/assets/{sections-editor-TqSLQIU8.js → sections-editor-C5rNMLKQ.js} +1 -1
  263. package/dist/client/assets/{select-BAxIwkW7.js → select-CO-KeEXe.js} +1 -1
  264. package/dist/client/assets/{select-model-DKcSOpKv.js → select-model-B9aWAF7v.js} +1 -1
  265. package/dist/client/assets/{seo-editor-BhgypNCN.js → seo-editor-C5HGby9p.js} +1 -1
  266. package/dist/client/assets/{separator-gKWGw3ec.js → separator-Dr93-tcp.js} +1 -1
  267. package/dist/client/assets/settings-tab-OQ9gNE2t.js +1 -0
  268. package/dist/client/assets/{sheet-Dy9d78N0.js → sheet-DYqe447t.js} +1 -1
  269. package/dist/client/assets/shell-layout-Bmd6dXD4.js +1 -0
  270. package/dist/client/assets/{site-draft-actions-BjAr6xi6.js → site-draft-actions-CNazOyJI.js} +1 -1
  271. package/dist/client/assets/site-draft-view-CaiajxbQ.js +2 -0
  272. package/dist/client/assets/site-editor-BC9YFkDH.js +1 -0
  273. package/dist/client/assets/{site-editor-toast-n7tT-SpR.js → site-editor-toast-Ckx512no.js} +1 -1
  274. package/dist/client/assets/{skills-C-lfUnzb.js → skills-Dq2dQBym.js} +1 -1
  275. package/dist/client/assets/{slider-DMzP4oef.js → slider-Dm9m4Zom.js} +1 -1
  276. package/dist/client/assets/{sortable.esm-BEpH5tbt.js → sortable.esm-PpUBUYvN.js} +1 -1
  277. package/dist/client/assets/{sso-Bdl8tzvn.js → sso-et00F2-M.js} +1 -1
  278. package/dist/client/assets/{suggestion-BfzPP8A_.js → suggestion-CaGvyBH6.js} +1 -1
  279. package/dist/client/assets/{switch-B0lPkF5_.js → switch-DGiOaGRn.js} +1 -1
  280. package/dist/client/assets/{symbol-CcauWbN2.js → symbol-ZVON6uKU.js} +1 -1
  281. package/dist/client/assets/{synced-repos-cKAzeg2x.js → synced-repos-CKQ3x7oT.js} +1 -1
  282. package/dist/client/assets/{tab-icon-glyph-C2nHjzae.js → tab-icon-glyph-DLj4dmeB.js} +1 -1
  283. package/dist/client/assets/{table-CeULXNQ2.js → table-DcqK9CO1.js} +1 -1
  284. package/dist/client/assets/{tabs-fkqYJpP8.js → tabs-CU2NQvm6.js} +1 -1
  285. package/dist/client/assets/{task-assignee-avatar-BuSQPIHq.js → task-assignee-avatar-Cs9bBLeR.js} +1 -1
  286. package/dist/client/assets/{task-board-Cv7D_3uN.js → task-board-CRvOV9zQ.js} +1 -1
  287. package/dist/client/assets/{task-route-dMm35uIv.js → task-route-BPQ9h0t-.js} +1 -1
  288. package/dist/client/assets/{task-status-D3EaEAgF.js → task-status-k_KZvqi3.js} +1 -1
  289. package/dist/client/assets/{taskboard-analytics-C2Yib8gP.js → taskboard-analytics-DXKp_Xl8.js} +1 -1
  290. package/dist/client/assets/{tasks-Cx6Zd4fY.js → tasks-CJWFfvRo.js} +1 -1
  291. package/dist/client/assets/tasks-DfOAe8MK.js +1 -0
  292. package/dist/client/assets/{textarea-aGNI5bvN.js → textarea-Bp989dUN.js} +1 -1
  293. package/dist/client/assets/{thread-analytics-B9HcTgTh.js → thread-analytics-CMG9NspT.js} +1 -1
  294. package/dist/client/assets/{thread-intent-BQGp3MKl.js → thread-intent-DXY7orZh.js} +1 -1
  295. package/dist/client/assets/{thread-route-BEIPJEss.js → thread-route-B1rrIJuw.js} +1 -1
  296. package/dist/client/assets/{thread-route-D147zL8e.js → thread-route-ChN9O-1A.js} +1 -1
  297. package/dist/client/assets/{thread-sheet-body-i2u8ULqW.js → thread-sheet-body-D-x-TABK.js} +1 -1
  298. package/dist/client/assets/{time-range-picker-0kVuNsQb.js → time-range-picker-B10kjTj_.js} +1 -1
  299. package/dist/client/assets/{toggle-group-DaYieoyW.js → toggle-group-K25Bl_Tm.js} +1 -1
  300. package/dist/client/assets/{tool-namespace-DqsoHKmd.js → tool-namespace-ln4cIuCt.js} +1 -1
  301. package/dist/client/assets/{toolbar-icon-button-3blDPoB6.js → toolbar-icon-button-NAoOtagz.js} +1 -1
  302. package/dist/client/assets/{tooltip-2YCPx1DM.js → tooltip-BB8x2ajM.js} +1 -1
  303. package/dist/client/assets/{tooltipContext-CgeI21sB.js → tooltipContext-DG-hvJrr.js} +1 -1
  304. package/dist/client/assets/{track-DO9rvMbw.js → track-DwVNsvWy.js} +1 -1
  305. package/dist/client/assets/{types-6BxgL_uJ.js → types-D4eFbg3n.js} +2 -2
  306. package/dist/client/assets/{url-slug-DxJ8K4M_.js → url-slug-Ck137SN4.js} +1 -1
  307. package/dist/client/assets/{usage-stats-BHO2m1GZ.js → usage-stats-DpZZQ75-.js} +1 -1
  308. package/dist/client/assets/{use-ai-providers-D11veeve.js → use-ai-providers-Cng_Zcqq.js} +1 -1
  309. package/dist/client/assets/{use-apply-named-rule-B4OGys4b.js → use-apply-named-rule-5US13ud-.js} +1 -1
  310. package/dist/client/assets/{use-automations-tbwaowTj.js → use-automations-BV-J2Ily.js} +1 -1
  311. package/dist/client/assets/{use-autosave-DfMGkaud.js → use-autosave-By6DVzfK.js} +1 -1
  312. package/dist/client/assets/{use-chat-layout-state-CIyU-XxO.js → use-chat-layout-state-CNkklJiF.js} +1 -1
  313. package/dist/client/assets/{use-clock-tick-DRqivY5H.js → use-clock-tick-D95T8222.js} +1 -1
  314. package/dist/client/assets/{use-connect-companion-pRfQU03M.js → use-connect-companion-BRWaN5AJ.js} +1 -1
  315. package/dist/client/assets/{use-connection-hBtWetVy.js → use-connection-CAJy9ePc.js} +1 -1
  316. package/dist/client/assets/{use-content-sync-DTts1O7D.js → use-content-sync-3FE60C_P.js} +1 -1
  317. package/dist/client/assets/{use-copy-Ctyjo3u8.js → use-copy-CvMH5zdo.js} +1 -1
  318. package/dist/client/assets/{use-create-virtual-mcp-BoVnWYo_.js → use-create-virtual-mcp-DTJ0zfpe.js} +1 -1
  319. package/dist/client/assets/{use-date-fns-locale-BL151nA9.js → use-date-fns-locale-D3Iz1MzV.js} +1 -1
  320. package/dist/client/assets/{use-debounced-autosave-XfpamUxh.js → use-debounced-autosave-CGLCHS8I.js} +1 -1
  321. package/dist/client/assets/{use-debounced-value-DppuiHxU.js → use-debounced-value-DvzjOUVw.js} +1 -1
  322. package/dist/client/assets/{use-deco-credits-DAnq8bae.js → use-deco-credits-D1dKlqXc.js} +1 -1
  323. package/dist/client/assets/{use-decopilot-events-CmWo-JmL.js → use-decopilot-events-DvJkZDam.js} +1 -1
  324. package/dist/client/assets/{use-delete-connection-D4L5Nbwc.js → use-delete-connection-D1ttYwJz.js} +1 -1
  325. package/dist/client/assets/{use-deployment-admin-CqRFItVm.js → use-deployment-admin-BpF0owio.js} +1 -1
  326. package/dist/client/assets/{use-fast-preview-draft-url-6n7ATrzr.js → use-fast-preview-draft-url-C_TDHMYN.js} +1 -1
  327. package/dist/client/assets/{use-file-configs-BukUB2a7.js → use-file-configs-Bf0fhL21.js} +1 -1
  328. package/dist/client/assets/{use-inbox-feed-DWwwp0yB.js → use-inbox-feed-DFw-YlJH.js} +1 -1
  329. package/dist/client/assets/{use-infinite-scroll-CAGEOw6T.js → use-infinite-scroll-CwPqy0HC.js} +1 -1
  330. package/dist/client/assets/{use-join-requests-C5RVOca9.js → use-join-requests-Z3CFtAeL.js} +1 -1
  331. package/dist/client/assets/{use-main-panel-tabs-C_SiePFc.js → use-main-panel-tabs-Cp-duvYv.js} +1 -1
  332. package/dist/client/assets/{use-mcp-auth-status-CPaTWfZe.js → use-mcp-auth-status-Db86wDh0.js} +1 -1
  333. package/dist/client/assets/{use-mcp-client-DsrOnW9o.js → use-mcp-client-BT3MLYTJ.js} +1 -1
  334. package/dist/client/assets/{use-mcp-prompts-B5RvuVy4.js → use-mcp-prompts-DvHpjECx.js} +1 -1
  335. package/dist/client/assets/{use-mcp-tools-oOqD73aG.js → use-mcp-tools-DY3R7rf0.js} +1 -1
  336. package/dist/client/assets/{use-members-DQZYP7Cb.js → use-members-DrsTuCTp.js} +1 -1
  337. package/dist/client/assets/{use-mobile-DruvZ2zF.js → use-mobile-Nz4my9ZZ.js} +1 -1
  338. package/dist/client/assets/{use-move-blocks-C7t8R0hh.js → use-move-blocks-Ck3YCWT9.js} +1 -1
  339. package/dist/client/assets/{use-navigate-to-agent-CfXi671z.js → use-navigate-to-agent-DqXhqPI9.js} +1 -1
  340. package/dist/client/assets/{use-open-billing-url-0u6Rqj8b.js → use-open-billing-url-BPZ_x4uz.js} +1 -1
  341. package/dist/client/assets/{use-org-auth-client-CSFZu3Wj.js → use-org-auth-client-BVmUiQl1.js} +1 -1
  342. package/dist/client/assets/{use-org-fs-Bndw9m25.js → use-org-fs-qBxAqXun.js} +1 -1
  343. package/dist/client/assets/{use-org-repo-syncs-DgWzYW9F.js → use-org-repo-syncs-C4sXoqIp.js} +1 -1
  344. package/dist/client/assets/{use-org-sso-B7o6rhq2.js → use-org-sso-B4zmaZVL.js} +1 -1
  345. package/dist/client/assets/{use-organization-roles-DPfq-0hG.js → use-organization-roles-CfuwXcGJ.js} +1 -1
  346. package/dist/client/assets/{use-organization-settings-B2e749tN.js → use-organization-settings-DKJZVR_x.js} +1 -1
  347. package/dist/client/assets/{use-panel-navigate-C-ip5ing.js → use-panel-navigate-D57HPY2x.js} +1 -1
  348. package/dist/client/assets/use-project-native-view-presence-C3HlYZwC.js +1 -0
  349. package/dist/client/assets/{use-project-scope-DN9qkINS.js → use-project-scope-CnnlA-du.js} +1 -1
  350. package/dist/client/assets/{use-recent-apps-Dieru2LM.js → use-recent-apps-CeorMBvV.js} +1 -1
  351. package/dist/client/assets/{use-releases-DJrTmfLZ.js → use-releases-fI9YxkQH.js} +1 -1
  352. package/dist/client/assets/{use-reports-diagnostic-BdDNwhZy.js → use-reports-diagnostic-J_fRdq7J.js} +1 -1
  353. package/dist/client/assets/{use-sandbox-events-B-rKhgAE.js → use-sandbox-events-CioMqxnO.js} +1 -1
  354. package/dist/client/assets/{use-secrets-C3hSYvUx.js → use-secrets-OlxyEwyb.js} +1 -1
  355. package/dist/client/assets/{use-section-preview-base-NrYdhHI5.js → use-section-preview-base-C3ZuHMr0.js} +1 -1
  356. package/dist/client/assets/{use-session-runtime-RS_ZeJDS.js → use-session-runtime-DfVwDDov.js} +1 -1
  357. package/dist/client/assets/{use-sidebar-collapsed-C9KH2wzy.js → use-sidebar-collapsed-D3qR_zRH.js} +1 -1
  358. package/dist/client/assets/{use-tags-DBJgOg0Z.js → use-tags-CxN5zuRZ.js} +1 -1
  359. package/dist/client/assets/{use-task-board-analytics-Bl-3jKgS.js → use-task-board-analytics-C-0VTjUE.js} +1 -1
  360. package/dist/client/assets/{use-task-board-events-CemAfTjA.js → use-task-board-events-BH7aE_i8.js} +1 -1
  361. package/dist/client/assets/{use-task-board-item-prs-83sFKoAa.js → use-task-board-item-prs-BLDfRR9k.js} +1 -1
  362. package/dist/client/assets/{use-task-metadata-DYSGuNJN.js → use-task-metadata-xGzNCL2M.js} +1 -1
  363. package/dist/client/assets/{use-thread-analytics-B-gfPcTz.js → use-thread-analytics-DJdxAjR-.js} +1 -1
  364. package/dist/client/assets/{use-thread-outputs-9KkInEd1.js → use-thread-outputs-D8VLF1dw.js} +1 -1
  365. package/dist/client/assets/useInfiniteQuery-BwyrFPWF.js +1 -0
  366. package/dist/client/assets/{useQueries-BRUig2bT.js → useQueries-1QlJ0aQr.js} +1 -1
  367. package/dist/client/assets/useSuspenseInfiniteQuery-DJXxpWPx.js +1 -0
  368. package/dist/client/assets/{users-zGj6iqQJ.js → users-C4R4jnJb.js} +1 -1
  369. package/dist/client/assets/{utils-DnxtSQ0E.js → utils-Dc05pOUY.js} +1 -1
  370. package/dist/client/assets/{variant-calendar-DzngKeid.js → variant-calendar-B48hMXng.js} +1 -1
  371. package/dist/client/assets/{variant-matcher-override-BvLc7beb.js → variant-matcher-override-f1vt09fC.js} +1 -1
  372. package/dist/client/assets/{virtual-mcp-CKcyAjRE.js → virtual-mcp-CP4uoCBU.js} +1 -1
  373. package/dist/client/assets/{watch-sse-pool-B6MhK1l7.js → watch-sse-pool-HKRMih-U.js} +1 -1
  374. package/dist/client/index.html +1 -1
  375. package/dist/server/server.js +1 -1
  376. package/package.json +1 -1
  377. package/dist/client/assets/agent-analytics-C_1r2ktq.js +0 -1
  378. package/dist/client/assets/agent-app-DADhKCUS.js +0 -1
  379. package/dist/client/assets/agent-automations-BCHMa4q1.js +0 -1
  380. package/dist/client/assets/agent-calendar-BIC31eZQ.js +0 -1
  381. package/dist/client/assets/agent-deck-DfcsXmVh.js +0 -1
  382. package/dist/client/assets/agent-experiments-DacDH6n9.js +0 -1
  383. package/dist/client/assets/agent-file-DvvjQBtI.js +0 -1
  384. package/dist/client/assets/agent-library-D07m5-2P.js +0 -1
  385. package/dist/client/assets/agent-library-file-CKXkh_Ag.js +0 -1
  386. package/dist/client/assets/agent-monitor-T2Kisepj.js +0 -1
  387. package/dist/client/assets/agent-settings-CtpQVMq0.js +0 -1
  388. package/dist/client/assets/agent-site-editor-code-DEyTlk7z.js +0 -2
  389. package/dist/client/assets/agent-site-editor-content-CO78zdWN.js +0 -1
  390. package/dist/client/assets/agent-site-editor-preview-C8DxePtH.js +0 -1
  391. package/dist/client/assets/agent-view-zDoYJpqf.js +0 -1
  392. package/dist/client/assets/alert-COKmPgNZ.js +0 -1
  393. package/dist/client/assets/api-keys-rvaVQMbg.js +0 -1
  394. package/dist/client/assets/badge-CYEiaJVw.js +0 -1
  395. package/dist/client/assets/cms-settings-editor-CD6Fhdzj.js +0 -1
  396. package/dist/client/assets/experiments-tab-DmhKoZxz.js +0 -1
  397. package/dist/client/assets/experiments-tab-choice-Ie5k_O6x.js +0 -1
  398. package/dist/client/assets/index-DDtLrgkt.js +0 -1
  399. package/dist/client/assets/library-1V2C8s_K.js +0 -1
  400. package/dist/client/assets/project-app-view-BLZBQKeL.js +0 -1
  401. package/dist/client/assets/project-reports-IwgSFkuk.js +0 -1
  402. package/dist/client/assets/project-tasks-DIh-1w8l.js +0 -1
  403. package/dist/client/assets/record-editor-v6loIaK5.js +0 -1
  404. package/dist/client/assets/reports-VklqwHN4.js +0 -1
  405. package/dist/client/assets/repositories-DVBlDnPs.js +0 -1
  406. package/dist/client/assets/route-DMrkbv9t.js +0 -1
  407. package/dist/client/assets/route-jSSJr7H8.js +0 -1
  408. package/dist/client/assets/settings-tab-Cp66Lx0x.js +0 -1
  409. package/dist/client/assets/shell-layout-DPflSDI7.js +0 -1
  410. package/dist/client/assets/site-draft-view-Bpwq-4Im.js +0 -2
  411. package/dist/client/assets/site-editor-CP2FSMmX.js +0 -1
  412. package/dist/client/assets/tasks-5wUjot9O.js +0 -1
  413. package/dist/client/assets/use-project-native-view-presence-iEIqgCZR.js +0 -1
  414. package/dist/client/assets/useInfiniteQuery-Ctv8zOi3.js +0 -1
  415. package/dist/client/assets/useSuspenseInfiniteQuery-DRLUIOlU.js +0 -1
@@ -1,4 +1,4 @@
1
- import{c as q,b as Z,r as H,j as t,B as se,h as it,l as ve,X as js,T as ys,V as ws,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 at,v as lt,H as Ye,a3 as Ss,fF as on,w as Vt,L as Ns,I as Me,ak as cn,z as dn,ey as tt,av as Wt,aj as un,ex as ze,ew as Be,an as Tt,m as Cs,K as Dt,fG as mn,fH as fn,fI as pn,b5 as be,fJ as je,n as Ue,P as hn,d as Pt,u as xn,af as rt,o as ks,e as gn,aM as Ms,y as Ve,b1 as vn,a as bn,fK as _s,fL as jn,aV as yn,ad as wn,aE as Sn,aD as Nn,a5 as Cn,fM as kn,aL as Mn}from"./index-BphI8pNH.js";import{g as _n}from"./extract-connection-data-DrQExIK1.js";import{b as Vn}from"./chat-context-DqNUlJMY.js";import{U as Tn,b as Dn}from"./build-improve-prompt-doc-BByi4O7Q.js";import{E as Pn}from"./empty-state-bJzQYitF.js";import{a as On}from"./shell-layout-DPflSDI7.js";import{g as ft,n as In,a as Kt,e as An,u as $n,f as Fn}from"./use-date-fns-locale-BL151nA9.js";import{a as En}from"./mcp-oauth-ZxlBJ_T6.js";import{f as zn,e as Rn,b as Ln,A as Un,a as Yn,d as Bn,c as Wn,g as Kn}from"./alert-dialog-Bbqu21pF.js";import{T as ut}from"./textarea-aGNI5bvN.js";import{c as Ne,T as Ce,a as ke}from"./tooltip-2YCPx1DM.js";import{a as Ot,b as Vs,u as Gn}from"./use-connection-hBtWetVy.js";import{b as qn,a as Ts,g as Ds,d as Hn,k as Qn}from"./repository-binding-CqjA7Tko.js";import{i as Gt}from"./mcp-oauth-CaTRnuQU.js";import{bg as Xn,k as Jn,bh as Zn,bi as ei,aT as ti,aD as si,aG as ni,bj as ii,bk as Ps,bl as Os,bm as ai,aq as li,bn as ri,bo as jt,bp as qt,A as Ht,N as oi,bq as ci,br as di,g as Is,p as Qt,n as ui,x as mi,w as fi,v as pi,u as hi,r as xi,f as As,E as Xt,aQ as gi,ae as vi,aw as bi}from"./agent-icon-BVqmbz-P.js";import{s as Pe}from"./Plus-C4rGoU1F.js";import{t as dt,a as ji}from"./Tool01-_CVpzZpk.js";import{s as It}from"./Trash01-CgNTH-jr.js";import{u as Jt}from"./use-debounced-autosave-XfpamUxh.js";import{A as yi}from"./add-connection-dialog-DyCA7E5B.js";import{i as Ct}from"./SearchMd-BYCOzBqa.js";import{F as Zt}from"./file-type-icon-CIdo5ojc.js";import{i as wi,j as Si,k as Ni,l as Ci}from"./use-org-fs-Bndw9m25.js";import{I as Ze}from"./integration-icon-C-_9oW7G.js";import{C as $s}from"./checkbox-JO6XiJJq.js";import{S as ki}from"./search-input-i8DAXvnS.js";import{b as Oe,a as Ie,c as we,d as Ae,S as $e}from"./select-BAxIwkW7.js";import{s as At}from"./XClose-B_rQyiiY.js";import{C as Mi}from"./collection-tabs-8dvqqnDR.js";import{T as Fs,u as Es}from"./use-mcp-auth-status-CPaTWfZe.js";import{u as pt}from"./use-mcp-client-DsrOnW9o.js";import{a as zs}from"./use-mcp-tools-oOqD73aG.js";import{u as _i}from"./use-mcp-prompts-B5RvuVy4.js";import{g as Vi}from"./connection-slug-CITJ0kGN.js";import{t as kt}from"./utils-CVEq3hMx.js";import{S as ht}from"./switch-B0lPkF5_.js";import{a as Rs,b as Ls,P as Us}from"./popover-D-MLGIKG.js";import{S as Ti}from"./scroll-area-GNWuujdQ.js";import{i as Di}from"./Upload01-CiTZ5ZQQ.js";import{i as Pi}from"./DotsVertical-CEoX1VVK.js";import{a as Oi}from"./Image01-D_y3XkIW.js";import{i as Ii}from"./Monitor01-CYm-wjzD.js";import{g as Ai}from"./types-6BxgL_uJ.js";import{a as Ys,f as $i,u as Fi}from"./experiments-tab-choice-Ie5k_O6x.js";import{a as Ei}from"./use-panel-navigate-C-ip5ing.js";import{u as zi,e as Mt,o as es,r as _t,p as Ri,g as Li,s as Ui,t as Yi,h as Bi,i as Wi,a as Ki}from"./use-project-native-view-presence-iEIqgCZR.js";import{a as Bs,u as Gi,i as qi,o as Hi,r as ts,p as Qi,w as Xi,b as ss}from"./optimistic-project-sidebar-views-VOTXYU3D.js";import{P as Ji,a as Zi,i as ea}from"./sections-DhRieK41.js";import{i as $t}from"./Key01-p2EsnMlr.js";import{a as ta}from"./format-time-Cq80KKvY.js";import{a as xt}from"./Copy01-DVWv3lef.js";import{u as sa}from"./use-copy-Ctyjo3u8.js";import{L as ye}from"./label-BXumUTqC.js";import{s as Ws,n as na,r as ia}from"./thread-intent-BQGp3MKl.js";import{V as aa,E as gt,r as Ks,C as la,w as ra}from"./virtual-mcp-CKcyAjRE.js";import{s as Gs}from"./slugify-CEUa2lfQ.js";import{b as oa,a as ca,D as da}from"./drawer-txFUQcqx.js";import{u as ua}from"./use-mobile-DruvZ2zF.js";import{d as vt}from"./delay-CnY5UFtP.js";import{b as ma}from"./sandbox-url-D3mC8qhT.js";import{S as fa,a as pa,b as ha}from"./secret-picker-CwZHe4Yx.js";import{u as xa,a as ga}from"./use-secrets-C3hSYvUx.js";import{o as ns}from"./omit-sandbox-map-jj4lCB2U.js";import{G as va}from"./repository-picker-BL6xlIly.js";import{r as ba}from"./serial-task-queue-CGOeQgpr.js";import{t as De,c as Qe,m as ja,a as qs}from"./differenceInSeconds-C3x8sHUj.js";function nt(a,e){const s=ft(),n=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??s.weekStartsOn??s.locale?.options?.weekStartsOn??0,i=De(a,e?.in),l=i.getDay(),r=(l<n?7:0)+l-n;return i.setDate(i.getDate()-r),i.setHours(0,0,0,0),i}function mt(a,e){return nt(a,{...e,weekStartsOn:1})}function Hs(a,e){const s=De(a,e?.in),n=s.getFullYear(),i=Qe(s,0);i.setFullYear(n+1,0,4),i.setHours(0,0,0,0);const l=mt(i),r=Qe(s,0);r.setFullYear(n,0,4),r.setHours(0,0,0,0);const o=mt(r);return s.getTime()>=l.getTime()?n+1:s.getTime()>=o.getTime()?n:n-1}function is(a,e){const s=De(a,e?.in);return s.setHours(0,0,0,0),s}function ya(a,e,s){const[n,i]=In(s?.in,a,e),l=is(n),r=is(i),o=+l-Kt(l),p=+r-Kt(r);return Math.round((o-p)/ja)}function wa(a,e){const s=Hs(a,e),n=Qe(a,0);return n.setFullYear(s,0,4),n.setHours(0,0,0,0),mt(n)}function Sa(a){return a instanceof Date||typeof a=="object"&&Object.prototype.toString.call(a)==="[object Date]"}function Na(a){return!(!Sa(a)&&typeof a!="number"||isNaN(+De(a)))}function Ca(a,e){const s=De(a,e?.in);return s.setFullYear(s.getFullYear(),0,1),s.setHours(0,0,0,0),s}function ka(a,e){const s=De(a,e?.in);return ya(s,Ca(s))+1}function Ma(a,e){const s=De(a,e?.in),n=+mt(s)-+wa(s);return Math.round(n/qs)+1}function Qs(a,e){const s=De(a,e?.in),n=s.getFullYear(),i=ft(),l=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,r=Qe(e?.in||a,0);r.setFullYear(n+1,0,l),r.setHours(0,0,0,0);const o=nt(r,e),p=Qe(e?.in||a,0);p.setFullYear(n,0,l),p.setHours(0,0,0,0);const c=nt(p,e);return+s>=+o?n+1:+s>=+c?n:n-1}function _a(a,e){const s=ft(),n=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,i=Qs(a,e),l=Qe(e?.in||a,0);return l.setFullYear(i,0,n),l.setHours(0,0,0,0),nt(l,e)}function Va(a,e){const s=De(a,e?.in),n=+nt(s,e)-+_a(s,e);return Math.round(n/qs)+1}function re(a,e){const s=a<0?"-":"",n=Math.abs(a).toString().padStart(e,"0");return s+n}const Ee={y(a,e){const s=a.getFullYear(),n=s>0?s:1-s;return re(e==="yy"?n%100:n,e.length)},M(a,e){const s=a.getMonth();return e==="M"?String(s+1):re(s+1,2)},d(a,e){return re(a.getDate(),e.length)},a(a,e){const s=a.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(a,e){return re(a.getHours()%12||12,e.length)},H(a,e){return re(a.getHours(),e.length)},m(a,e){return re(a.getMinutes(),e.length)},s(a,e){return re(a.getSeconds(),e.length)},S(a,e){const s=e.length,n=a.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"},as={G:function(a,e,s){const n=a.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(a,e,s){if(e==="yo"){const n=a.getFullYear(),i=n>0?n:1-n;return s.ordinalNumber(i,{unit:"year"})}return Ee.y(a,e)},Y:function(a,e,s,n){const i=Qs(a,n),l=i>0?i:1-i;if(e==="YY"){const r=l%100;return re(r,2)}return e==="Yo"?s.ordinalNumber(l,{unit:"year"}):re(l,e.length)},R:function(a,e){const s=Hs(a);return re(s,e.length)},u:function(a,e){const s=a.getFullYear();return re(s,e.length)},Q:function(a,e,s){const n=Math.ceil((a.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(a,e,s){const n=Math.ceil((a.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(a,e,s){const n=a.getMonth();switch(e){case"M":case"MM":return Ee.M(a,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(a,e,s){const n=a.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(a,e,s,n){const i=Va(a,n);return e==="wo"?s.ordinalNumber(i,{unit:"week"}):re(i,e.length)},I:function(a,e,s){const n=Ma(a);return e==="Io"?s.ordinalNumber(n,{unit:"week"}):re(n,e.length)},d:function(a,e,s){return e==="do"?s.ordinalNumber(a.getDate(),{unit:"date"}):Ee.d(a,e)},D:function(a,e,s){const n=ka(a);return e==="Do"?s.ordinalNumber(n,{unit:"dayOfYear"}):re(n,e.length)},E:function(a,e,s){const n=a.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(a,e,s,n){const i=a.getDay(),l=(i-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(l);case"ee":return re(l,2);case"eo":return s.ordinalNumber(l,{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(a,e,s,n){const i=a.getDay(),l=(i-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(l);case"cc":return re(l,e.length);case"co":return s.ordinalNumber(l,{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(a,e,s){const n=a.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(a,e,s){const i=a.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(a,e,s){const n=a.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(a,e,s){const n=a.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(a,e,s){if(e==="ho"){let n=a.getHours()%12;return n===0&&(n=12),s.ordinalNumber(n,{unit:"hour"})}return Ee.h(a,e)},H:function(a,e,s){return e==="Ho"?s.ordinalNumber(a.getHours(),{unit:"hour"}):Ee.H(a,e)},K:function(a,e,s){const n=a.getHours()%12;return e==="Ko"?s.ordinalNumber(n,{unit:"hour"}):re(n,e.length)},k:function(a,e,s){let n=a.getHours();return n===0&&(n=24),e==="ko"?s.ordinalNumber(n,{unit:"hour"}):re(n,e.length)},m:function(a,e,s){return e==="mo"?s.ordinalNumber(a.getMinutes(),{unit:"minute"}):Ee.m(a,e)},s:function(a,e,s){return e==="so"?s.ordinalNumber(a.getSeconds(),{unit:"second"}):Ee.s(a,e)},S:function(a,e){return Ee.S(a,e)},X:function(a,e,s){const n=a.getTimezoneOffset();if(n===0)return"Z";switch(e){case"X":return rs(n);case"XXXX":case"XX":return Le(n);default:return Le(n,":")}},x:function(a,e,s){const n=a.getTimezoneOffset();switch(e){case"x":return rs(n);case"xxxx":case"xx":return Le(n);default:return Le(n,":")}},O:function(a,e,s){const n=a.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+ls(n,":");default:return"GMT"+Le(n,":")}},z:function(a,e,s){const n=a.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+ls(n,":");default:return"GMT"+Le(n,":")}},t:function(a,e,s){const n=Math.trunc(+a/1e3);return re(n,e.length)},T:function(a,e,s){return re(+a,e.length)}};function ls(a,e=""){const s=a>0?"-":"+",n=Math.abs(a),i=Math.trunc(n/60),l=n%60;return l===0?s+String(i):s+String(i)+e+re(l,2)}function rs(a,e){return a%60===0?(a>0?"-":"+")+re(Math.abs(a)/60,2):Le(a,e)}function Le(a,e=""){const s=a>0?"-":"+",n=Math.abs(a),i=re(Math.trunc(n/60),2),l=re(n%60,2);return s+i+e+l}const os=(a,e)=>{switch(a){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"})}},Xs=(a,e)=>{switch(a){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"})}},Ta=(a,e)=>{const s=a.match(/(P+)(p+)?/)||[],n=s[1],i=s[2];if(!i)return os(a,e);let l;switch(n){case"P":l=e.dateTime({width:"short"});break;case"PP":l=e.dateTime({width:"medium"});break;case"PPP":l=e.dateTime({width:"long"});break;default:l=e.dateTime({width:"full"});break}return l.replace("{{date}}",os(n,e)).replace("{{time}}",Xs(i,e))},Da={p:Xs,P:Ta},Pa=/^D+$/,Oa=/^Y+$/,Ia=["D","DD","YY","YYYY"];function Aa(a){return Pa.test(a)}function $a(a){return Oa.test(a)}function Fa(a,e,s){const n=Ea(a,e,s);if(console.warn(n),Ia.includes(a))throw new RangeError(n)}function Ea(a,e,s){const n=a[0]==="Y"?"years":"days of the month";return`Use \`${a.toLowerCase()}\` instead of \`${a}\` (in \`${e}\`) for formatting ${n} to the input \`${s}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const za=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Ra=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,La=/^'([^]*?)'?$/,Ua=/''/g,Ya=/[a-zA-Z]/;function Ba(a,e,s){const n=ft(),i=s?.locale??n.locale??An,l=s?.firstWeekContainsDate??s?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,r=s?.weekStartsOn??s?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=De(a,s?.in);if(!Na(o))throw new RangeError("Invalid time value");let p=e.match(Ra).map(f=>{const m=f[0];if(m==="p"||m==="P"){const u=Da[m];return u(f,i.formatLong)}return f}).join("").match(za).map(f=>{if(f==="''")return{isToken:!1,value:"'"};const m=f[0];if(m==="'")return{isToken:!1,value:Wa(f)};if(as[m])return{isToken:!0,value:f};if(m.match(Ya))throw new RangeError("Format string contains an unescaped latin alphabet character `"+m+"`");return{isToken:!1,value:f}});i.localize.preprocessor&&(p=i.localize.preprocessor(o,p));const c={firstWeekContainsDate:l,weekStartsOn:r,locale:i};return p.map(f=>{if(!f.isToken)return f.value;const m=f.value;(!s?.useAdditionalWeekYearTokens&&$a(m)||!s?.useAdditionalDayOfYearTokens&&Aa(m))&&Fa(m,e,String(a));const u=as[m[0]];return u(o,m,i.localize,c)}).join("")}function Wa(a){const e=a.match(La);return e?e[1].replace(Ua,"'"):a}const Js=25*1024*1024,yt="home",wt="knowledge";function cs(a){return a==null?"":a<1024?`${a} B`:a<1024*1024?`${(a/1024).toFixed(0)} KB`:`${(a/(1024*1024)).toFixed(1)} MB`}function Re(a){return a.split("/").pop()??a}function Ka(a){const e=q.c(64),{form:s}=a,n=Z(),{upload:i}=wi(yt),l=Si(),r=H.useRef(null),[o,p]=H.useState(!1),[c,f]=H.useState(""),[m,u]=H.useState(!1);let h;e[0]!==o?(h={enabled:o},e[0]=o,e[1]=h):h=e[1];const{data:d}=Ni(60,h),x=d===void 0?[]:d;let g;e[2]!==o?(g={enabled:o},e[2]=o,e[3]=g):g=e[3];const{data:v}=Ci(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,w]=H.useState(j);let S;e[6]!==s?(S=A=>{w(A),s.setValue("metadata.knowledge",A,{shouldDirty:!0})},e[6]=s,e[7]=S):S=e[7];const M=S;let N;e[8]!==l||e[9]!==b||e[10]!==M||e[11]!==n||e[12]!==i?(N=async A=>{if(!A||A.length===0)return;const ne=Array.from(A),R=ne.filter(Za),te=ne.filter(Ja);if(te.length>0&&oe.warning(n("virtualMcp.filesSection.fileTooLargeTitle"),{description:n("virtualMcp.filesSection.fileTooLargeDescription",{names:te.map(Xa).join(", ")})}),R.length!==0){try{await i.mutateAsync({dir:wt,files:R})}catch(J){const pe=J;oe.error(pe instanceof Error?pe.message:n("virtualMcp.filesSection.failedUploadFile"));return}M([...b,...R.map(J=>({id:crypto.randomUUID(),name:J.name,volume:yt,path:`${wt}/${J.name}`,url:l(yt,`${wt}/${J.name}`),contentType:J.type||null,size:J.size,addedAt:new Date().toISOString()}))])}},e[8]=l,e[9]=b,e[10]=M,e[11]=n,e[12]=i,e[13]=N):N=e[13];const C=N;let k;e[14]!==l||e[15]!==b||e[16]!==M?(k=A=>{b.some(ne=>ne.volume===A.volume&&ne.path===A.path)||(M([...b,{id:crypto.randomUUID(),name:Re(A.path),volume:A.volume,path:A.path,url:l(A.volume,A.path),contentType:null,size:A.size??null,addedAt:new Date().toISOString()}]),p(!1))},e[14]=l,e[15]=b,e[16]=M,e[17]=k):k=e[17];const V=k;let _;e[18]!==l||e[19]!==b||e[20]!==M?(_=A=>{b.some(ne=>ne.volume===A.volume&&ne.path===A.path)||(M([...b,{id:crypto.randomUUID(),name:Re(A.path),kind:"skill",volume:A.volume,path:A.path,url:l(A.volume,A.path),contentType:null,size:null,addedAt:new Date().toISOString()}]),p(!1))},e[18]=l,e[19]=b,e[20]=M,e[21]=_):_=e[21];const E=_;let D;e[22]!==b||e[23]!==M?(D=A=>{M(b.filter(ne=>ne.id!==A))},e[22]=b,e[23]=M,e[24]=D):D=e[24];const $=D;let I;e[25]===Symbol.for("react.memo_cache_sentinel")?(I=A=>{p(A),A&&f("")},e[25]=I):I=e[25];const L=I;let U;e[26]!==b?(U=new Set(b.map(Qa)),e[26]=b,e[27]=U):U=e[27];const K=U,W=c.toLowerCase();let G;e[28]!==K?(G=A=>!K.has(`${A.volume}/${A.path}`),e[28]=K,e[29]=G):G=e[29];const F=x.filter(Ha).filter(G).filter(A=>Re(A.path).toLowerCase().includes(W)).slice(0,5);let Y;e[30]!==K?(Y=A=>!K.has(`${A.volume}/${A.path}`),e[30]=K,e[31]=Y):Y=e[31];const X=y.filter(Y).filter(A=>Re(A.path).toLowerCase().includes(W)).slice(0,5),T=A=>t.jsxs(js,{open:o,onOpenChange:L,children:[t.jsx(ys,{asChild:!0,children:A}),t.jsxs(ws,{align:"end",className:"w-56",children:[t.jsxs(He,{onSelect:()=>{r.current?.click()},children:[t.jsx(Xn,{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(Jn,{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:c,onChange:ne=>f(ne.target.value),onKeyDown:qa,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:F.length===0?t.jsx("p",{className:"px-2 py-3 text-center text-sm text-muted-foreground",children:n("virtualMcp.filesSection.noFilesFound")}):F.map(ne=>t.jsxs(He,{onSelect:()=>V(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:cs(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:c,onChange:ne=>f(ne.target.value),onKeyDown:Ga,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:X.length===0?t.jsx("p",{className:"px-2 py-3 text-center text-sm text-muted-foreground",children:n("virtualMcp.filesSection.noSkillsFound")}):X.map(ne=>t.jsxs(He,{onSelect:()=>E(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}`))})]})]})]})]}),z="flex flex-col gap-3";let B;e[32]!==n?(B=n("virtualMcp.filesSection.filesAndSkills"),e[32]=n,e[33]=B):B=e[33];let P;e[34]!==B?(P=t.jsx("h2",{className:"text-sm font-medium text-foreground",children:B}),e[34]=B,e[35]=P):P=e[35];let O;e[36]!==n?(O=n("virtualMcp.filesSection.description"),e[36]=n,e[37]=O):O=e[37];let ee;e[38]!==O?(ee=t.jsx("p",{className:"text-sm text-muted-foreground",children:O}),e[38]=O,e[39]=ee):ee=e[39];let ae;e[40]!==P||e[41]!==ee?(ae=t.jsxs("div",{className:"flex flex-col gap-1",children:[P,ee]}),e[40]=P,e[41]=ee,e[42]=ae):ae=e[42];const ce=b.length>0&&T(t.jsxs(se,{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 le;e[43]!==ae||e[44]!==ce?(le=t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[ae,ce]}),e[43]=ae,e[44]=ce,e[45]=le):le=e[45];let ie;e[46]!==C?(ie=t.jsx("input",{ref:r,type:"file",multiple:!0,className:"hidden",onChange:A=>{C(A.target.files),A.target.value=""}}),e[46]=C,e[47]=ie):ie=e[47];let Q,de;e[48]===Symbol.for("react.memo_cache_sentinel")?(Q=A=>{A.preventDefault(),u(!0)},de=()=>u(!1),e[48]=Q,e[49]=de):(Q=e[48],de=e[49]);let ue;e[50]!==C?(ue=A=>{A.preventDefault(),A.stopPropagation(),u(!1),C(A.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?T(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 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(A=>t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 surface",children:[A.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:A.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:A.name}),t.jsx("p",{className:"text-xs text-muted-foreground",children:A.kind==="skill"?n("virtualMcp.filesSection.kindSkill"):A.size!=null?cs(A.size):n("virtualMcp.filesSection.kindFile")})]}),t.jsx(se,{variant:"ghost",size:"icon",onClick:()=>$(A.id),"aria-label":n("virtualMcp.filesSection.removeAriaLabel",{name:A.name}),children:t.jsx(It,{size:16})})]},A.id));let ge;e[54]!==Q||e[55]!==de||e[56]!==ue||e[57]!==me||e[58]!==xe?(ge=t.jsx("div",{onDragOver:Q,onDragLeave:de,onDrop:ue,className:me,children:xe}),e[54]=Q,e[55]=de,e[56]=ue,e[57]=me,e[58]=xe,e[59]=ge):ge=e[59];let fe;return e[60]!==le||e[61]!==ie||e[62]!==ge?(fe=t.jsxs("section",{className:z,children:[le,ie,ge]}),e[60]=le,e[61]=ie,e[62]=ge,e[63]=fe):fe=e[63],fe}function Ga(a){return a.stopPropagation()}function qa(a){return a.stopPropagation()}function Ha(a){return a.kind!=="dir"}function Qa(a){return`${a.volume}/${a.path}`}function Xa(a){return a.name}function Ja(a){return a.size>Js}function Za(a){return a.size<=Js}function el(a){return a==null?"all":a.length===0?"self":"selected"}function tl(a){const e=q.c(88),{form:s,currentAgentId:n}=a,i=Z(),{org:l}=Fe(),r=qn(),[o,p]=H.useState(!1);let c;e[0]!==s?(c=s.getValues("metadata.subAgents")??null,e[0]=s,e[1]=c):c=e[1];const f=c;let m;e[2]!==f?(m=()=>el(f),e[2]=f,e[3]=m):m=e[3];const[u,h]=H.useState(m);let d;e[4]!==f?(d=f??[],e[4]=f,e[5]=d):d=e[5];const[x,g]=H.useState(d);let v,y,j,b,w,S;if(e[6]!==r||e[7]!==n||e[8]!==s||e[9]!==u||e[10]!==l||e[11]!==x||e[12]!==i){let k;e[19]!==n||e[20]!==l?(k=Q=>Q.id!==n&&Q.id!==l.id&&Q.status==="active",e[19]=n,e[20]=l,e[21]=k):k=e[21],v=r.filter(k);let V;e[22]!==x?(V=Q=>x.includes(Q.id),e[22]=x,e[23]=V):V=e[23];const _=v.filter(V);let E;e[24]!==s?(E=(Q,de)=>s.setValue("metadata.subAgents",Q==="all"?null:Q==="self"?[]:de,{shouldDirty:!0}),e[24]=s,e[25]=E):E=e[25];const D=E;let $;e[26]!==D||e[27]!==x?($=Q=>{h(Q),D(Q,x)},e[26]=D,e[27]=x,e[28]=$):$=e[28];const I=$;let L;e[29]!==D||e[30]!==x?(L=Q=>{const de=x.includes(Q)?x.filter(ue=>ue!==Q):[...x,Q];g(de),D("selected",de)},e[29]=D,e[30]=x,e[31]=L):L=e[31],y=L,w="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 W;e[36]!==u||e[37]!==i?(W=u==="all"&&t.jsx("p",{className:"text-sm text-muted-foreground",children:i("virtualMcp.subAgentsSection.canDelegateToAnyAgent")}),e[36]=u,e[37]=i,e[38]=W):W=e[38];let G;e[39]!==u||e[40]!==i?(G=u==="self"&&t.jsx("p",{className:"text-sm text-muted-foreground",children:i("virtualMcp.subAgentsSection.canOnlyDelegateToItself")}),e[39]=u,e[40]=i,e[41]=G):G=e[41];let F;e[42]!==K||e[43]!==W||e[44]!==G?(F=t.jsxs("div",{className:"flex flex-col gap-1",children:[K,W,G]}),e[42]=K,e[43]=W,e[44]=G,e[45]=F):F=e[45];const Y=u==="selected"&&_.length>0&&t.jsxs(se,{variant:"outline",size:"sm",onClick:()=>p(!0),children:[t.jsx(Pe,{size:14}),i("virtualMcp.subAgentsSection.addSubAgent")]});let X;e[46]!==I?(X=Q=>I(Q),e[46]=I,e[47]=X):X=e[47];let T;e[48]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(Oe,{size:"sm",className:"w-auto",children:t.jsx(Ie,{})}),e[48]=T):T=e[48];let z;e[49]!==i?(z=i("virtualMcp.subAgentsSection.anyAgent"),e[49]=i,e[50]=z):z=e[50];let B;e[51]!==z?(B=t.jsx(we,{value:"all",children:z}),e[51]=z,e[52]=B):B=e[52];let P;e[53]!==i?(P=i("virtualMcp.subAgentsSection.specificAgents"),e[53]=i,e[54]=P):P=e[54];let O;e[55]!==P?(O=t.jsx(we,{value:"selected",children:P}),e[55]=P,e[56]=O):O=e[56];let ee;e[57]!==i?(ee=i("virtualMcp.subAgentsSection.onlyItself"),e[57]=i,e[58]=ee):ee=e[58];let ae;e[59]!==ee?(ae=t.jsx(we,{value:"self",children:ee}),e[59]=ee,e[60]=ae):ae=e[60];let ce;e[61]!==B||e[62]!==O||e[63]!==ae?(ce=t.jsxs(Ae,{align:"end",children:[B,O,ae]}),e[61]=B,e[62]=O,e[63]=ae,e[64]=ce):ce=e[64];let le;e[65]!==u||e[66]!==X||e[67]!==ce?(le=t.jsxs($e,{value:u,onValueChange:X,children:[T,ce]}),e[65]=u,e[66]=X,e[67]=ce,e[68]=le):le=e[68];let ie;e[69]!==Y||e[70]!==le?(ie=t.jsxs("div",{className:"flex items-center gap-2",children:[Y,le]}),e[69]=Y,e[70]=le,e[71]=ie):ie=e[71],e[72]!==F||e[73]!==ie?(S=t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[F,ie]}),e[72]=F,e[73]=ie,e[74]=S):S=e[74],j="flex flex-col gap-2",b=u==="selected"&&(_.length>0?_.map(Q=>t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 surface",children:[t.jsx(Ze,{icon:Q.icon,name:Q.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:Q.title}),Q.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:Q.description})]}),t.jsx(se,{variant:"ghost",size:"icon",onClick:()=>y(Q.id),children:t.jsx(At,{size:16})})]},Q.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 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]=r,e[7]=n,e[8]=s,e[9]=u,e[10]=l,e[11]=x,e[12]=i,e[13]=v,e[14]=y,e[15]=j,e[16]=b,e[17]=w,e[18]=S}else v=e[13],y=e[14],j=e[15],b=e[16],w=e[17],S=e[18];let M;e[75]!==j||e[76]!==b?(M=t.jsx("div",{className:j,children:b}),e[75]=j,e[76]=b,e[77]=M):M=e[77];let N;e[78]!==v||e[79]!==y||e[80]!==o||e[81]!==x?(N=t.jsx(sl,{open:o,onOpenChange:p,candidates:v,selectedIds:x,onToggle:y}),e[78]=v,e[79]=y,e[80]=o,e[81]=x,e[82]=N):N=e[82];let C;return e[83]!==w||e[84]!==S||e[85]!==M||e[86]!==N?(C=t.jsxs("section",{className:w,children:[S,M,N]}),e[83]=w,e[84]=S,e[85]=M,e[86]=N,e[87]=C):C=e[87],C}function sl(a){const e=q.c(39),{open:s,onOpenChange:n,candidates:i,selectedIds:l,onToggle:r}=a,o=Z(),[p,c]=H.useState("");let f,m,u,h,d,x,g,v,y;if(e[0]!==i||e[1]!==n||e[2]!==r||e[3]!==s||e[4]!==p||e[5]!==l||e[6]!==o){const S=p.toLowerCase(),M=i.filter(k=>k.title.toLowerCase().includes(S)||k.description?.toLowerCase().includes(S));m=Xe,v=s,y=n,f=Je,d="max-w-md";let N;e[16]!==o?(N=o("virtualMcp.subAgentsSection.title"),e[16]=o,e[17]=N):N=e[17],e[18]!==N?(x=t.jsx(at,{children:t.jsx(lt,{children:N})}),e[18]=N,e[19]=x):x=e[19];let C;e[20]!==o?(C=o("virtualMcp.subAgentsSection.searchPlaceholder"),e[20]=o,e[21]=C):C=e[21],e[22]!==p||e[23]!==C?(g=t.jsx(ki,{value:p,onChange:c,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=M.length===0?t.jsx("p",{className:"text-sm text-muted-foreground px-1 py-4 text-center",children:o("virtualMcp.subAgentsSection.noAgentsFound")}):M.map(k=>t.jsxs("button",{type:"button",onClick:()=>r(k.id),className:"flex items-center gap-3 px-2 py-2 rounded-lg hover:bg-accent transition-colors cursor-pointer w-full text-left",children:[t.jsx($s,{checked:l.includes(k.id),className:"pointer-events-none",tabIndex:-1}),t.jsx(Ze,{icon:k.icon,name:k.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:k.title}),k.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:k.description})]})]},k.id)),e[0]=i,e[1]=n,e[2]=r,e[3]=s,e[4]=p,e[5]=l,e[6]=o,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 w;return e[34]!==m||e[35]!==v||e[36]!==y||e[37]!==b?(w=t.jsx(m,{open:v,onOpenChange:y,children:b}),e[34]=m,e[35]=v,e[36]=y,e[37]=b,e[38]=w):w=e[38],w}function st(){const a=q.c(1);let e;return a[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"})}),a[0]=e):e=a[0],e}function ct(a,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:a})}):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(Ss,{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 Zs(a){const e=q.c(23),{item:s,isSelected:n,onToggle:i,disabled:l}=a,r=l?"cursor-not-allowed opacity-50":"cursor-pointer",o=n?"bg-accent/25":"hover:bg-accent";let p;e[0]!==r||e[1]!==o?(p=ve("flex items-start gap-3 p-4 rounded-lg transition-colors",r,o),e[0]=r,e[1]=o,e[2]=p):p=e[2];let c;e[3]!==s.name?(c=t.jsx("p",{className:"text-sm font-medium leading-none truncate",children:s.name}),e[3]=s.name,e[4]=c):c=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]!==c||e[8]!==f?(m=t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[c,f]}),e[7]=c,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]!==l||e[16]!==n||e[17]!==i?(d=t.jsx($s,{checked:n,onCheckedChange:i,disabled:l,className:"mt-0.5"}),e[15]=l,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 nl(a){const e=q.c(35),{activeTab:s,onTabChange:n,showSelectAll:i,isAllSelected:l,handleSelectAll:r}=a,o=Z();let p;e[0]!==o?(p=o("virtualMcp.dependencySelectionDialog.tabTools"),e[0]=o,e[1]=p):p=e[1];let c;e[2]!==p?(c={id:"tools",label:p},e[2]=p,e[3]=c):c=e[3];let f;e[4]!==o?(f=o("virtualMcp.dependencySelectionDialog.tabActive"),e[4]=o,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]!==o?(u=o("virtualMcp.dependencySelectionDialog.tabResources"),e[8]=o,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]!==o?(d=o("virtualMcp.dependencySelectionDialog.tabPrompts"),e[12]=o,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]!==c||e[17]!==m||e[18]!==h||e[19]!==x?(g=[c,m,h,x],e[16]=c,e[17]=m,e[18]=h,e[19]=x,e[20]=g):g=e[20];let v;e[21]!==n?(v=w=>n(w),e[21]=n,e[22]=v):v=e[22];let y;e[23]!==s||e[24]!==v||e[25]!==g?(y=t.jsx(Mi,{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]!==r||e[28]!==l||e[29]!==i||e[30]!==o?(j=i&&t.jsx("button",{type:"button",onClick:r,className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:o(l?"virtualMcp.dependencySelectionDialog.deselectAll":"virtualMcp.dependencySelectionDialog.selectAll")}),e[27]=r,e[28]=l,e[29]=i,e[30]=o,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(a){const e=q.c(13),{items:s,selections:n,onToggle:i,emptyMessage:l,disabled:r}=a;let o,p,c;if(e[0]!==r||e[1]!==l||e[2]!==s||e[3]!==i||e[4]!==n){c=Symbol.for("react.early_return_sentinel");e:{const m=s.map(il);if(s.length===0){let u;e[8]!==l?(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:l})}),e[8]=l,e[9]=u):u=e[9],c=u;break e}o="flex-1 overflow-auto px-4 py-3 space-y-1",p=s.map(u=>t.jsx(Zs,{item:u,isSelected:n===null||n?.includes(u.id),onToggle:()=>i(u.id,m),disabled:r},u.id))}e[0]=r,e[1]=l,e[2]=s,e[3]=i,e[4]=n,e[5]=o,e[6]=p,e[7]=c}else o=e[5],p=e[6],c=e[7];if(c!==Symbol.for("react.early_return_sentinel"))return c;let f;return e[10]!==o||e[11]!==p?(f=t.jsx("div",{className:o,children:p}),e[10]=o,e[11]=p,e[12]=f):f=e[12],f}function il(a){return a.id}function al(a){const e=q.c(22),{connectionId:s,toolSelections:n,onToggleTool:i}=a,l=Z(),{org:r}=Fe();let o;e[0]!==s||e[1]!==r.id||e[2]!==r.slug?(o={connectionId:s,orgId:r.id,orgSlug:r.slug},e[0]=s,e[1]=r.id,e[2]=r.slug,e[3]=o):o=e[3];const p=pt(o);let c;e[4]!==p?(c={client:p},e[4]=p,e[5]=c):c=e[5];const{data:f}=zs(c),m=f.tools;let u,h,d;if(e[6]!==f.tools||e[7]!==i||e[8]!==l||e[9]!==n){d=Symbol.for("react.early_return_sentinel");e:{const g=m.map(rl);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(ll);if(j.length===0){let b;e[15]!==l?(b=l("virtualMcp.dependencySelectionDialog.noActiveToolsSelected"),e[15]=l,e[16]=b):b=e[16];let w;e[17]!==b?(w=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]=w):w=e[18],d=w;break e}u="flex-1 overflow-auto px-4 py-3 space-y-1",h=j.map(b=>t.jsx(Zs,{item:b,isSelected:!0,onToggle:()=>i(b.id,g)},b.id))}e[6]=f.tools,e[7]=i,e[8]=l,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 ll(a){return{id:a.name,name:a.name,description:a.description,tags:t.jsx(Fs,{annotations:a.annotations,_meta:a._meta})}}function rl(a){return a.name}function ol(a){const e=q.c(16),{connectionId:s,selections:n,onToggle:i,disabled:l}=a,{org:r}=Fe();let o;e[0]!==s||e[1]!==r.id||e[2]!==r.slug?(o={connectionId:s,orgId:r.id,orgSlug:r.slug},e[0]=s,e[1]=r.id,e[2]=r.slug,e[3]=o):o=e[3];const p=pt(o);let c;e[4]!==p?(c={client:p},e[4]=p,e[5]=c):c=e[5];const{data:f}=zs(c);let m;e[6]!==f.tools?(m=f.tools.map(cl),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]!==l||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:l}),e[10]=l,e[11]=u,e[12]=i,e[13]=n,e[14]=d,e[15]=x):x=e[15],x}function cl(a){return{id:a.name,name:a.name,description:a.description,tags:t.jsx(Fs,{annotations:a.annotations,_meta:a._meta})}}function dl(a){const e=q.c(16),{connectionId:s,selections:n,onToggle:i,disabled:l}=a,{org:r}=Fe();let o;e[0]!==s||e[1]!==r.id||e[2]!==r.slug?(o={connectionId:s,orgId:r.id,orgSlug:r.slug},e[0]=s,e[1]=r.id,e[2]=r.slug,e[3]=o):o=e[3];const p=pt(o);let c;e[4]!==p?(c={client:p},e[4]=p,e[5]=c):c=e[5];const{data:f}=on(c);let m;e[6]!==f.resources?(m=f.resources.map(ul),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]!==l||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:l}),e[10]=l,e[11]=u,e[12]=i,e[13]=n,e[14]=d,e[15]=x):x=e[15],x}function ul(a){return{id:a.name||a.uri,name:a.name||a.uri,description:a.description}}function ml(a){const e=q.c(16),{connectionId:s,selections:n,onToggle:i,disabled:l}=a,{org:r}=Fe();let o;e[0]!==s||e[1]!==r.id||e[2]!==r.slug?(o={connectionId:s,orgId:r.id,orgSlug:r.slug},e[0]=s,e[1]=r.id,e[2]=r.slug,e[3]=o):o=e[3];const p=pt(o);let c;e[4]!==p?(c={client:p},e[4]=p,e[5]=c):c=e[5];const{data:f}=_i(c);let m;e[6]!==f.prompts?(m=f.prompts.map(fl),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]!==l||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:l}),e[10]=l,e[11]=u,e[12]=i,e[13]=n,e[14]=d,e[15]=x):x=e[15],x}function fl(a){return{id:a.name,name:a.name,description:a.description}}function pl(a){const e=q.c(58),{currentConnection:s,activeTab:n,selectedId:i,formData:l,toggleTool:r,toggleResource:o,togglePrompt:p,toggleAllTools:c,toggleAllResources:f,toggleAllPrompts:m,onTabChange:u}=a,h=Z(),d=l[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]!==c?(v=()=>{n==="tools"?c(i):n==="resources"?f(i):n==="prompts"&&m(i)},e[0]=n,e[1]=i,e[2]=m,e[3]=f,e[4]=c,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 w;e[11]!==s.description?(w=s.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s.description}),e[11]=s.description,e[12]=w):w=e[12];let S;e[13]!==b||e[14]!==w?(S=t.jsxs("div",{className:"flex-1 min-w-0",children:[b,w]}),e[13]=b,e[14]=w,e[15]=S):S=e[15];let M;e[16]!==j||e[17]!==S?(M=t.jsx("div",{className:"px-6 pt-5 pb-4 shrink-0",children:t.jsxs("div",{className:"flex items-center gap-3",children:[j,S]})}),e[16]=j,e[17]=S,e[18]=M):M=e[18];let N;e[19]!==n||e[20]!==y||e[21]!==x||e[22]!==u||e[23]!==g?(N=t.jsx(nl,{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]=N):N=e[24];let C;e[25]!==n||e[26]!==l||e[27]!==i||e[28]!==h||e[29]!==r?(C=n==="active"&&t.jsx(Ye,{fallback:ct(h("virtualMcp.dependencySelectionDialog.toolsNotSupported"),h),children:t.jsx(H.Suspense,{fallback:t.jsx(st,{}),children:t.jsx(al,{connectionId:i,toolSelections:l[i]?l[i].tools:[],onToggleTool:($,I)=>r(i,$,I)})})}),e[25]=n,e[26]=l,e[27]=i,e[28]=h,e[29]=r,e[30]=C):C=e[30];let k;e[31]!==n||e[32]!==l||e[33]!==i||e[34]!==h||e[35]!==r?(k=n==="tools"&&t.jsx(Ye,{fallback:ct(h("virtualMcp.dependencySelectionDialog.toolsNotSupported"),h),children:t.jsx(H.Suspense,{fallback:t.jsx(st,{}),children:t.jsx(ol,{connectionId:i,selections:l[i]?l[i].tools:[],onToggle:($,I)=>r(i,$,I)})})}),e[31]=n,e[32]=l,e[33]=i,e[34]=h,e[35]=r,e[36]=k):k=e[36];let V;e[37]!==n||e[38]!==l||e[39]!==i||e[40]!==h||e[41]!==o?(V=n==="resources"&&t.jsx(Ye,{fallback:ct(h("virtualMcp.dependencySelectionDialog.resourcesNotSupported"),h),children:t.jsx(H.Suspense,{fallback:t.jsx(st,{}),children:t.jsx(dl,{connectionId:i,selections:l[i]?l[i].resources:[],onToggle:($,I)=>o(i,$,I)})})}),e[37]=n,e[38]=l,e[39]=i,e[40]=h,e[41]=o,e[42]=V):V=e[42];let _;e[43]!==n||e[44]!==l||e[45]!==i||e[46]!==h||e[47]!==p?(_=n==="prompts"&&t.jsx(Ye,{fallback:ct(h("virtualMcp.dependencySelectionDialog.promptsNotSupported"),h),children:t.jsx(H.Suspense,{fallback:t.jsx(st,{}),children:t.jsx(ml,{connectionId:i,selections:l[i]?l[i].prompts:[],onToggle:($,I)=>p(i,$,I)})})}),e[43]=n,e[44]=l,e[45]=i,e[46]=h,e[47]=p,e[48]=_):_=e[48];let E;e[49]!==V||e[50]!==_||e[51]!==C||e[52]!==k?(E=t.jsxs("div",{className:"flex-1 overflow-hidden flex flex-col",children:[C,k,V,_]}),e[49]=V,e[50]=_,e[51]=C,e[52]=k,e[53]=E):E=e[53];let D;return e[54]!==E||e[55]!==M||e[56]!==N?(D=t.jsxs(t.Fragment,{children:[M,N,E]}),e[54]=E,e[55]=M,e[56]=N,e[57]=D):D=e[57],D}function hl(a){const e=q.c(7),{onClose:s}=a,n=Z();let i;e[0]!==s?(i=()=>s(!1),e[0]=s,e[1]=i):i=e[1];let l;e[2]!==n?(l=n("virtualMcp.dependencySelectionDialog.done"),e[2]=n,e[3]=l):l=e[3];let r;return e[4]!==i||e[5]!==l?(r=t.jsx(Vt,{className:"px-6 py-4 border-t border-border shrink-0",children:t.jsx(se,{variant:"outline",onClick:i,children:l})}),e[4]=i,e[5]=l,e[6]=r):r=e[6],r}function xl(a){const e=q.c(23),{connectionId:s,onAuthenticate:n,children:i}=a,l=Z();let r;e[0]!==s?(r={connectionId:s},e[0]=s,e[1]=r):r=e[1];const o=Es(r);if(o.supportsOAuth&&!o.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(Zn,{size:22,className:"text-muted-foreground"})}),e[2]=f):f=e[2];let m;e[3]!==l?(m=l("virtualMcp.dependencySelectionDialog.authorizationRequired"),e[3]=l,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]!==l?(h=l("virtualMcp.dependencySelectionDialog.authorizationDescription"),e[7]=l,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]!==l?(g=n&&t.jsx(se,{variant:"outline",size:"sm",onClick:()=>n(s),children:l("virtualMcp.dependencySelectionDialog.authorize")}),e[14]=s,e[15]=n,e[16]=l,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 c;return e[21]!==i?(c=t.jsx(t.Fragment,{children:i}),e[21]=i,e[22]=c):c=e[22],c}function gl(a){const e={};for(const s of a)e[s.connection_id]={tools:s.selected_tools,resources:s.selected_resources??null,prompts:s.selected_prompts??null};return e}function ds(a){return Object.entries(a).map(([e,s])=>({connection_id:e,selected_tools:s.tools,selected_resources:s.resources,selected_prompts:s.prompts}))}function us(a,e,s,n){const i=a[e]??{tools:null,resources:null,prompts:null};return{...a,[e]:{...i,[s]:n}}}function vl(a,e){return e.type==="SET_ACTIVE_TAB"?{...a,activeTab:e.payload}:a}function bl(a){const e=q.c(49),{open:s,onOpenChange:n,selectedId:i,form:l,connections:r,onAuthenticate:o}=a;let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p={activeTab:"tools"},e[0]=p):p=e[0];const[c,f]=H.useReducer(vl,p),m=Ot(i??"");let u;e[1]!==r?(u=r??[],e[1]=r,e[2]=u):u=e[2];let h;e[3]!==u?(h=gl(u),e[3]=u,e[4]=h):h=e[4];const d=h;let x;e[5]!==l||e[6]!==d?(x=(F,Y,X,T)=>{const z=d[F]?.[Y];let B;z===null?B=T.filter(P=>P!==X):z?.includes(X)?B=z.filter(P=>P!==X):(B=[...z??[],X],B.length===T.length&&(B=null)),l.setValue("connections",ds(us(d,F,Y,B)),{shouldDirty:!0,shouldTouch:!0})},e[5]=l,e[6]=d,e[7]=x):x=e[7];const g=x;let v;e[8]!==l||e[9]!==d?(v=(F,Y)=>{const T=d[F]?.[Y]===null?[]:null;l.setValue("connections",ds(us(d,F,Y,T)),{shouldDirty:!0,shouldTouch:!0})},e[8]=l,e[9]=d,e[10]=v):v=e[10];const y=v;let j;e[11]!==g?(j=(F,Y,X)=>g(F,"tools",Y,X),e[11]=g,e[12]=j):j=e[12];const b=j;let w;e[13]!==g?(w=(F,Y,X)=>g(F,"resources",Y,X),e[13]=g,e[14]=w):w=e[14];const S=w;let M;e[15]!==g?(M=(F,Y,X)=>g(F,"prompts",Y,X),e[15]=g,e[16]=M):M=e[16];const N=M;let C;e[17]!==y?(C=F=>y(F,"tools"),e[17]=y,e[18]=C):C=e[18];const k=C;let V;e[19]!==y?(V=F=>y(F,"resources"),e[19]=y,e[20]=V):V=e[20];const _=V;let E;e[21]!==y?(E=F=>y(F,"prompts"),e[21]=y,e[22]=E):E=e[22];const D=E;if(!i||!m)return null;let $;e[23]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(st,{}),e[23]=$):$=e[23];let I;e[24]===Symbol.for("react.memo_cache_sentinel")?(I=F=>f({type:"SET_ACTIVE_TAB",payload:F}),e[24]=I):I=e[24];let L;e[25]!==m||e[26]!==c.activeTab||e[27]!==d||e[28]!==i||e[29]!==D||e[30]!==_||e[31]!==k||e[32]!==N||e[33]!==S||e[34]!==b?(L=t.jsx(pl,{currentConnection:m,activeTab:c.activeTab,selectedId:i,formData:d,toggleTool:b,toggleResource:S,togglePrompt:N,toggleAllTools:k,toggleAllResources:_,toggleAllPrompts:D,onTabChange:I},i),e[25]=m,e[26]=c.activeTab,e[27]=d,e[28]=i,e[29]=D,e[30]=_,e[31]=k,e[32]=N,e[33]=S,e[34]=b,e[35]=L):L=e[35];let U;e[36]!==o||e[37]!==i||e[38]!==L?(U=t.jsx(H.Suspense,{fallback:$,children:t.jsx(xl,{connectionId:i,onAuthenticate:o,children:L})}),e[36]=o,e[37]=i,e[38]=L,e[39]=U):U=e[39];let K;e[40]!==n?(K=t.jsx(hl,{onClose:n}),e[40]=n,e[41]=K):K=e[41];let W;e[42]!==U||e[43]!==K?(W=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]=W):W=e[44];let G;return e[45]!==n||e[46]!==s||e[47]!==W?(G=t.jsx(Xe,{open:s,onOpenChange:n,children:W}),e[45]=n,e[46]=s,e[47]=W,e[48]=G):G=e[48],G}const ms="__new_instance__";function jl(a){const e=q.c(25),{connection_id:s,usedConnectionIds:n,onOpenSettings:i,onRemove:l,onAuthenticate:r,onSwitchInstance:o,onNewInstance:p}=a,c=Ot(s),{org:f}=Fe();if(!c){let g;return e[0]!==l?(g=t.jsx(Nl,{onRemove:l}),e[0]=l,e[1]=g):g=e[1],g}let m;e[2]!==c?(m=Vi(c),e[2]=c,e[3]=m):m=e[3];const u=m;let h;e[4]!==s?(h=t.jsx(Sl,{connection_id:s}),e[4]=s,e[5]=h):h=e[5];let d;e[6]!==c.app_name||e[7]!==c.connection_type||e[8]!==c.description||e[9]!==c.icon||e[10]!==c.status||e[11]!==c.title||e[12]!==s||e[13]!==r||e[14]!==p||e[15]!==i||e[16]!==l||e[17]!==o||e[18]!==f.slug||e[19]!==u||e[20]!==n?(d=t.jsx(wl,{connection_id:s,connectionTitle:c.title,connectionDescription:c.description,connectionIcon:c.icon,connectionType:c.connection_type,connectionStatus:c.status,slug:u,orgSlug:f.slug,appName:c.app_name,usedConnectionIds:n,onOpenSettings:i,onRemove:l,onAuthenticate:r,onSwitchInstance:o,onNewInstance:p}),e[6]=c.app_name,e[7]=c.connection_type,e[8]=c.description,e[9]=c.icon,e[10]=c.status,e[11]=c.title,e[12]=s,e[13]=r,e[14]=p,e[15]=i,e[16]=l,e[17]=o,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(H.Suspense,{fallback:h,children:d}),e[22]=h,e[23]=d,e[24]=x):x=e[24],x}function yl(a){const e=q.c(24),{appName:s,connectionId:n,usedConnectionIds:i,onSwitchInstance:l,onNewInstance:r}=a,o=Z();let p;e[0]!==s?(p={filters:[{column:"app_name",value:s}]},e[0]=s,e[1]=p):p=e[1];const c=Gn(p);if(c.length<=1&&!r)return null;let f;e[2]!==n||e[3]!==r||e[4]!==l?(f=g=>{g===ms?r?.():l(n,g)},e[2]=n,e[3]=r,e[4]=l,e[5]=f):f=e[5];let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(Oe,{size:"xs",className:"w-auto gap-1 shadow-none",children:t.jsx(Ie,{})}),e[6]=m):m=e[6];let u;if(e[7]!==n||e[8]!==c||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=c.map(g),e[7]=n,e[8]=c,e[9]=i,e[10]=u}else u=e[10];let h;e[14]!==r||e[15]!==o?(h=r&&t.jsxs(we,{value:ms,className:"text-xs text-muted-foreground",children:["+ ",o("virtualMcp.connectionItem.newInstance")]}),e[14]=r,e[15]=o,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 wl({connection_id:a,connectionTitle:e,connectionDescription:s,connectionIcon:n,connectionType:i,connectionStatus:l,slug:r,orgSlug:o,appName:p,usedConnectionIds:c,onOpenSettings:f,onRemove:m,onAuthenticate:u,onSwitchInstance:h,onNewInstance:d}){const x=Es({connectionId:a}),g=Vs(),y=!(i==="VIRTUAL")&&x.supportsOAuth&&!x.isAuthenticated,j=l!=="active",b=Z(),w=async S=>{try{await g.update.mutateAsync({id:a,data:{status:S}}),oe.success(b(S==="active"?"virtualMcp.connectionItem.connectionEnabled":"virtualMcp.connectionItem.connectionDisabled"))}catch{oe.error(b("virtualMcp.connectionItem.failedToUpdateConnection"))}};return t.jsxs("div",{className:ve("surface overflow-hidden transition-colors",(y||j)&&"shadow-edge-destructive bg-destructive/5"),children:[t.jsxs(Ns,{to:"/$org/settings/connections/$appSlug",params:{org:o,appSlug:r},className:"flex items-center gap-3 px-4 py-3 cursor-pointer hover:bg-accent 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(l==="error"?"virtualMcp.connectionItem.disabledError":"virtualMcp.connectionItem.disabled")}):s&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s})]}),y?t.jsx(se,{variant:"outline",size:"sm",className:"shrink-0",onClick:S=>{S.preventDefault(),S.stopPropagation(),u(a)},children:b("virtualMcp.connectionItem.authorize")}):j?t.jsxs(se,{variant:"outline",size:"sm",className:"gap-1.5 shrink-0",onClick:S=>{S.preventDefault(),S.stopPropagation(),w("active")},children:[t.jsx(ei,{size:13}),b("virtualMcp.connectionItem.enable")]}):t.jsxs(Ne,{delayDuration:0,children:[t.jsx(Ce,{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(ji,{size:16})})}),t.jsx(ke,{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(yl,{appName:p,connectionId:a,usedConnectionIds:c,onSwitchInstance:h,onNewInstance:d}),t.jsxs("div",{className:"flex items-center gap-0.5 ml-auto",children:[t.jsxs(Ne,{delayDuration:0,children:[t.jsx(Ce,{asChild:!0,children:t.jsx(se,{variant:"ghost",size:"icon-sm",onClick:f,"aria-label":b("virtualMcp.connectionItem.configureResources"),children:t.jsx(ti,{size:13})})}),t.jsx(ke,{side:"bottom",children:b("virtualMcp.connectionItem.configureResources")})]}),!j&&t.jsxs(Ne,{delayDuration:0,children:[t.jsx(Ce,{asChild:!0,children:t.jsx(se,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground",onClick:()=>w("inactive"),"aria-label":b("virtualMcp.connectionItem.disableConnection"),children:t.jsx(si,{size:13})})}),t.jsx(ke,{side:"bottom",children:b("virtualMcp.connectionItem.disable")})]}),t.jsxs(Ne,{delayDuration:0,children:[t.jsx(Ce,{asChild:!0,children:t.jsx(se,{variant:"ghost-destructive",size:"icon-sm",onClick:m,"aria-label":b("virtualMcp.connectionItem.removeConnection"),children:t.jsx(At,{size:13})})}),t.jsx(ke,{side:"bottom",children:b("virtualMcp.connectionItem.remove")})]})]})]})]})}function Sl(a){const e=q.c(17),{connection_id:s}=a,n=Ot(s);if(!n){let m;return e[0]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(en,{}),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 l;e[4]!==n.title?(l=t.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[4]=n.title,e[5]=l):l=e[5];let r;e[6]!==n.description?(r=n.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:n.description}),e[6]=n.description,e[7]=r):r=e[7];let o;e[8]!==l||e[9]!==r?(o=t.jsxs("div",{className:"flex-1 min-w-0",children:[l,r]}),e[8]=l,e[9]=r,e[10]=o):o=e[10];let p;e[11]!==i||e[12]!==o?(p=t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",children:[i,o]}),e[11]=i,e[12]=o,e[13]=p):p=e[13];let c;e[14]===Symbol.for("react.memo_cache_sentinel")?(c=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]=c):c=e[14];let f;return e[15]!==p?(f=t.jsxs("div",{className:"surface overflow-hidden",children:[p,c]}),e[15]=p,e[16]=f):f=e[16],f}function Nl(a){const e=q.c(20),{onRemove:s}=a,n=Z();let i;e[0]!==n?(i=n("virtualMcp.connectionItem.connectionNotFound"),e[0]=n,e[1]=i):i=e[1];let l;e[2]!==i?(l=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]=l):l=e[3];let r;e[4]!==n?(r=n("virtualMcp.connectionItem.removeConnection"),e[4]=n,e[5]=r):r=e[5];let o;e[6]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(At,{size:13}),e[6]=o):o=e[6];let p;e[7]!==s||e[8]!==r?(p=t.jsx(Ce,{asChild:!0,children:t.jsx(se,{variant:"ghost-destructive",size:"icon-sm",className:"shrink-0",onClick:s,"aria-label":r,children:o})}),e[7]=s,e[8]=r,e[9]=p):p=e[9];let c;e[10]!==n?(c=n("virtualMcp.connectionItem.remove"),e[10]=n,e[11]=c):c=e[11];let f;e[12]!==c?(f=t.jsx(ke,{side:"bottom",children:c}),e[12]=c,e[13]=f):f=e[13];let m;e[14]!==p||e[15]!==f?(m=t.jsxs(Ne,{delayDuration:0,children:[p,f]}),e[14]=p,e[15]=f,e[16]=m):m=e[16];let u;return e[17]!==l||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:[l,m]}),e[17]=l,e[18]=m,e[19]=u):u=e[19],u}function en(){const a=q.c(3);let e;a[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"size-8 rounded-md bg-muted animate-pulse shrink-0"}),a[0]=e):e=a[0];let s;a[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"})]})]}),a[1]=s):s=a[1];let n;return a[2]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsxs("div",{className:"surface 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"})})]}),a[2]=n):n=a[2],n}function tn(a){const e=q.c(85),{value:s,onChange:n,onColorChange:i,name:l,size:r,className:o,avatarClassName:p,showHoverOverlay:c,disabled:f}=a,m=r===void 0?"lg":r,u=c===void 0?!0:c,h=f===void 0?!1:f,d=Z(),[x,g]=H.useState(!1),[v,y]=H.useState("icons"),[j,b]=H.useState(""),[w,S]=H.useState("blue");let M;e[0]!==s?(M=ni(s),e[0]=s,e[1]=M):M=e[1];const N=M,C=N.type==="icon"||N.type==="url"&&N.color?N.color:w;let k;e[2]!==n||e[3]!==C?(k=te=>{n(jt(te,C))},e[2]=n,e[3]=C,e[4]=k):k=e[4];const V=k;let _;e[5]!==n||e[6]!==i||e[7]!==N.name||e[8]!==N.type||e[9]!==N.url?(_=te=>{S(te),i?.(te),N.type==="icon"?n(jt(N.name,te)):N.type==="url"&&n(qt(N.url,te))},e[5]=n,e[6]=i,e[7]=N.name,e[8]=N.type,e[9]=N.url,e[10]=_):_=e[10];const E=_;let D;e[11]!==n||e[12]!==C?(D=te=>{n(qt(te,C)),g(!1)},e[11]=n,e[12]=C,e[13]=D):D=e[13];const $=D;let I;e[14]!==n||e[15]!==C?(I=()=>{const te=Ps(),J=te[Math.floor(Math.random()*te.length)];n(jt(J,C))},e[14]=n,e[15]=C,e[16]=I):I=e[16];const L=I,U=h?!1:x;let K;e[17]!==d?(K=d("common.iconPicker.changeIcon"),e[17]=d,e[18]=K):K=e[18];const W=h?"cursor-default opacity-50":"cursor-pointer";let G;e[19]!==o||e[20]!==m||e[21]!==W?(G=ve("relative group overflow-hidden",W,ii(m),o),e[19]=o,e[20]=m,e[21]=W,e[22]=G):G=e[22];let F;e[23]!==p||e[24]!==l||e[25]!==m||e[26]!==s?(F=t.jsx(Ht,{icon:s,name:l,size:m,className:p}),e[23]=p,e[24]=l,e[25]=m,e[26]=s,e[27]=F):F=e[27];let Y;e[28]!==h||e[29]!==u?(Y=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(oi,{size:16,className:"text-white"})}),e[28]=h,e[29]=u,e[30]=Y):Y=e[30];let X;e[31]!==h||e[32]!==K||e[33]!==G||e[34]!==F||e[35]!==Y?(X=t.jsx(Rs,{asChild:!0,children:t.jsxs("button",{type:"button","data-testid":"icon-picker-trigger","aria-label":K,disabled:h,className:G,children:[F,Y]})}),e[31]=h,e[32]=K,e[33]=G,e[34]=F,e[35]=Y,e[36]=X):X=e[36];let T;e[37]!==l||e[38]!==s?(T=t.jsx("div",{className:"flex items-center justify-center py-4",children:t.jsx(Ht,{icon:s,name:l,size:"xl"})}),e[37]=l,e[38]=s,e[39]=T):T=e[39];let z;e[40]!==v?(z=te=>{if(te.key!=="ArrowLeft"&&te.key!=="ArrowRight")return;te.preventDefault();const J=v==="icons"?"upload":"icons";y(J),document.getElementById(`icon-picker-tab-${J}`)?.focus()},e[40]=v,e[41]=z):z=e[41];const B=v==="icons",P=v==="icons"?0:-1;let O;e[42]===Symbol.for("react.memo_cache_sentinel")?(O=()=>y("icons"),e[42]=O):O=e[42];const ee=v==="icons"?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground";let ae;e[43]!==ee?(ae=ve("px-3 py-2 text-sm font-medium border-b-2 -mb-px transition-colors",ee),e[43]=ee,e[44]=ae):ae=e[44];let ce;e[45]!==d?(ce=d("common.iconPicker.iconsTab"),e[45]=d,e[46]=ce):ce=e[46];let le;e[47]!==B||e[48]!==P||e[49]!==ae||e[50]!==ce?(le=t.jsx("button",{id:"icon-picker-tab-icons",type:"button",role:"tab","aria-selected":B,"aria-controls":"icon-picker-panel-icons",tabIndex:P,onClick:O,className:ae,children:ce}),e[47]=B,e[48]=P,e[49]=ae,e[50]=ce,e[51]=le):le=e[51];const ie=v==="upload",Q=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]!==Q||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:Q,onClick:de,className:he,children:me}),e[57]=ie,e[58]=Q,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]!==z||e[64]!==le||e[65]!==xe?(fe=t.jsxs("div",{role:"tablist","aria-label":"Icon source",className:"flex items-center border-b border-border px-3",onKeyDown:z,children:[le,xe,ge]}),e[63]=z,e[64]=le,e[65]=xe,e[66]=fe):fe=e[66];let A;e[67]!==E||e[68]!==L||e[69]!==V||e[70]!==$||e[71]!==N.name||e[72]!==N.type||e[73]!==j||e[74]!==C||e[75]!==v?(A=v==="icons"?t.jsx("div",{id:"icon-picker-panel-icons",role:"tabpanel","aria-labelledby":"icon-picker-tab-icons",children:t.jsx(_l,{search:j,onSearchChange:b,selectedColor:C,onColorChange:E,onSelectIcon:V,onRandom:L,currentIconName:N.type==="icon"?N.name:null})}):t.jsx("div",{id:"icon-picker-panel-upload",role:"tabpanel","aria-labelledby":"icon-picker-tab-upload",children:t.jsx(Vl,{onUpload:$})}),e[67]=E,e[68]=L,e[69]=V,e[70]=$,e[71]=N.name,e[72]=N.type,e[73]=j,e[74]=C,e[75]=v,e[76]=A):A=e[76];let ne;e[77]!==T||e[78]!==fe||e[79]!==A?(ne=t.jsx(Ls,{align:"start",className:"w-80 p-0",onOpenAutoFocus:Cl,children:t.jsxs("div",{className:"flex flex-col",children:[T,fe,A]})}),e[77]=T,e[78]=fe,e[79]=A,e[80]=ne):ne=e[80];let R;return e[81]!==X||e[82]!==ne||e[83]!==U?(R=t.jsxs(Us,{open:U,onOpenChange:g,children:[X,ne]}),e[81]=X,e[82]=ne,e[83]=U,e[84]=R):R=e[84],R}function Cl(a){return a.preventDefault()}function kl(a){const e=q.c(33),{selectedColor:s,onColorChange:n}=a,i=Z(),[l,r]=H.useState(!1);let o,p,c,f,m,u,h;if(e[0]!==l||e[1]!==s){const w=Os(s);p=Us,u=l,h=r,o=Rs,m=!0,c="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",w.dot,"ring-foreground/20"),e[0]=l,e[1]=s,e[2]=o,e[3]=p,e[4]=c,e[5]=f,e[6]=m,e[7]=u,e[8]=h}else o=e[2],p=e[3],c=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]!==c||e[14]!==f||e[15]!==d||e[16]!==x?(g=t.jsx("button",{type:c,className:f,title:d,"aria-label":x}),e[13]=c,e[14]=f,e[15]=d,e[16]=x,e[17]=g):g=e[17];let v;e[18]!==o||e[19]!==m||e[20]!==g?(v=t.jsx(o,{asChild:m,children:g}),e[18]=o,e[19]=m,e[20]=g,e[21]=v):v=e[21];let y;e[22]!==n||e[23]!==s?(y=di.map(w=>t.jsx("button",{type:"button",onClick:()=>{n(w.name),r(!1)},className:ve("h-5 w-5 rounded-full transition-all shrink-0 cursor-pointer",w.dot,s===w.name?"ring-2 ring-offset-1 ring-offset-background ring-foreground/30 scale-110":"hover:scale-110"),title:w.name,"aria-label":w.name},w.name)),e[22]=n,e[23]=s,e[24]=y):y=e[24];let j;e[25]!==y?(j=t.jsx(Ls,{align:"start",side:"right",sideOffset:8,className:"w-auto p-2",onOpenAutoFocus:Ml,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 Ml(a){return a.preventDefault()}function _l(a){const e=q.c(55),{search:s,onSearchChange:n,selectedColor:i,onColorChange:l,onSelectIcon:r,onRandom:o,currentIconName:p}=a,c=Z();let f,m,u,h,d,x,g;if(e[0]!==p||e[1]!==l||e[2]!==o||e[3]!==n||e[4]!==r||e[5]!==s||e[6]!==i||e[7]!==c){const w=Ps(),S=Os(i);m=ai(w,s),x="flex flex-col";let M;e[15]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsx(Ct,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none"}),e[15]=M):M=e[15];let N;e[16]!==n?(N=I=>n(I.target.value),e[16]=n,e[17]=N):N=e[17];let C;e[18]!==c?(C=c("common.iconPicker.filterPlaceholder"),e[18]=c,e[19]=C):C=e[19];let k;e[20]!==s||e[21]!==N||e[22]!==C?(k=t.jsxs("div",{className:"relative flex-1",children:[M,t.jsx(Me,{value:s,onChange:N,placeholder:C,size:"sm",className:"text-xs pl-7"})]}),e[20]=s,e[21]=N,e[22]=C,e[23]=k):k=e[23];let V;e[24]!==c?(V=c("common.iconPicker.randomIcon"),e[24]=c,e[25]=V):V=e[25];let _;e[26]!==c?(_=c("common.iconPicker.randomIcon"),e[26]=c,e[27]=_):_=e[27];let E;e[28]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(ci,{className:"size-3.5 text-muted-foreground"}),e[28]=E):E=e[28];let D;e[29]!==o||e[30]!==V||e[31]!==_?(D=t.jsx(se,{type:"button",variant:"outline",size:"icon",onClick:o,className:"shrink-0",title:V,"aria-label":_,children:E}),e[29]=o,e[30]=V,e[31]=_,e[32]=D):D=e[32];let $;e[33]!==l||e[34]!==i?($=t.jsx(kl,{selectedColor:i,onColorChange:l}),e[33]=l,e[34]=i,e[35]=$):$=e[35],e[36]!==D||e[37]!==$||e[38]!==k?(g=t.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",children:[k,D,$]}),e[36]=D,e[37]=$,e[38]=k,e[39]=g):g=e[39],f=Ti,d="h-56",u="grid grid-cols-9 gap-0.5 px-2 pb-2",h=m.map(I=>{const L=li(I);return L?t.jsx("button",{type:"button",onClick:()=>r(I),className:ve("h-8 w-8 flex items-center justify-center rounded-lg transition-colors cursor-pointer",p===I?ve(S.bg,S.text):ve(S.text,"hover:bg-accent")),title:I,"aria-label":ri(I),children:t.jsx(L,{size:18})},I):null}),e[0]=p,e[1]=l,e[2]=o,e[3]=n,e[4]=r,e[5]=s,e[6]=i,e[7]=c,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]!==c?(y=m.length===0&&t.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:c("common.iconPicker.noIconsFound")}),e[43]=m.length,e[44]=c,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 Vl(a){const e=q.c(46),{onUpload:s}=a,n=Z(),i=H.useRef(null);let l;e[0]!==s||e[1]!==n?(l=D=>{const $=D.target.files?.[0];if(!$)return;if($.size>2097152){oe.error(n("common.iconPicker.imageTooLarge")),D.target.value="";return}const I=new FileReader;I.onerror=()=>{oe.error(n("common.iconPicker.failedToReadImage")),i.current&&(i.current.value="")},I.onloadend=()=>{I.readyState===FileReader.DONE&&I.result&&s(I.result),i.current&&(i.current.value="")},I.readAsDataURL($)},e[0]=s,e[1]=n,e[2]=l):l=e[2];const r=l,[o,p]=H.useState("");let c;e[3]!==s||e[4]!==o?(c=()=>{const D=o.trim();D&&(s(D),p(""))},e[3]=s,e[4]=o,e[5]=c):c=e[5];const f=c;let m;e[6]!==r?(m=t.jsx("input",{type:"file",ref:i,className:"hidden",accept:"image/*",onChange:r}),e[6]=r,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(Di,{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 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 w;e[22]!==n?(w=n("common.iconPicker.pasteUrlPlaceholder"),e[22]=n,e[23]=w):w=e[23];let S;e[24]!==f?(S=D=>{D.key==="Enter"&&(D.preventDefault(),f())},e[24]=f,e[25]=S):S=e[25];let M;e[26]!==o||e[27]!==w||e[28]!==S?(M=t.jsx(Me,{value:o,onChange:b,placeholder:w,className:"h-8 text-xs flex-1",onKeyDown:S}),e[26]=o,e[27]=w,e[28]=S,e[29]=M):M=e[29];let N;e[30]!==o?(N=o.trim(),e[30]=o,e[31]=N):N=e[31];const C=!N;let k;e[32]!==n?(k=n("common.iconPicker.apply"),e[32]=n,e[33]=k):k=e[33];let V;e[34]!==f||e[35]!==C||e[36]!==k?(V=t.jsx(se,{variant:"outline",className:"shrink-0",onClick:f,disabled:C,children:k}),e[34]=f,e[35]=C,e[36]=k,e[37]=V):V=e[37];let _;e[38]!==M||e[39]!==V?(_=t.jsxs("div",{className:"flex items-center gap-1.5",children:[M,V]}),e[38]=M,e[39]=V,e[40]=_):_=e[40];let E;return e[41]!==j||e[42]!==_||e[43]!==m||e[44]!==x?(E=t.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[m,x,j,_]}),e[41]=j,e[42]=_,e[43]=m,e[44]=x,e[45]=E):E=e[45],E}function Tl(a){const e=q.c(13),{viewId:s,blocksSite:n}=a,i=n===void 0?!1:n;if(s==="overview"){let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Is,{size:16}),e[0]=r):r=e[0],r}if(s==="reports"){let r;return e[1]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Qt,{size:16}),e[1]=r):r=e[1],r}if(s==="board"){let r;return e[2]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(ui,{size:16}),e[2]=r):r=e[2],r}if(s==="site-editor"){let r;return e[3]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Ii,{size:16}),e[3]=r):r=e[3],r}if(s==="assets"){let r;return e[4]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Oi,{size:16}),e[4]=r):r=e[4],r}if(s==="releases"){let r;return e[5]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(mi,{size:16}),e[5]=r):r=e[5],r}if(s==="hosting"){let r;return e[6]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(cn,{size:16}),e[6]=r):r=e[6],r}if(s==="e2e"){let r;return e[7]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(fi,{size:16}),e[7]=r):r=e[7],r}if(s==="analytics"){let r;return e[8]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Qt,{size:16}),e[8]=r):r=e[8],r}if(s==="cdn"){let r;return e[9]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(pi,{size:16}),e[9]=r):r=e[9],r}if(s==="experiments"&&i){let r;return e[10]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(hi,{size:16}),e[10]=r):r=e[10],r}if(s==="calendar"){let r;return e[11]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(xi,{size:16}),e[11]=r):r=e[11],r}let l;return e[12]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(As,{size:16}),e[12]=l):l=e[12],l}function fs(a){const e=q.c(51),{pinned:s,canSetMainView:n,onOpen:i,onTogglePin:l,onSetMainView:r}=a,o=Z(),p=s?"text-foreground":"text-muted-foreground/40";let c;e[0]!==p?(c=ve("size-7",p),e[0]=p,e[1]=c):c=e[1];let f;e[2]!==s||e[3]!==o?(f=o(s?"virtualMcp.settings.views.unpin":"virtualMcp.settings.views.pin"),e[2]=s,e[3]=o,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]!==l||e[7]!==s||e[8]!==c||e[9]!==f?(u=t.jsx(Ce,{asChild:!0,children:t.jsx(se,{variant:"ghost",size:"icon",className:c,"aria-label":f,"aria-pressed":s,onClick:l,children:m})}),e[6]=l,e[7]=s,e[8]=c,e[9]=f,e[10]=u):u=e[10];let h;e[11]!==s||e[12]!==o?(h=o(s?"virtualMcp.settings.views.unpin":"virtualMcp.settings.views.pin"),e[11]=s,e[12]=o,e[13]=h):h=e[13];let d;e[14]!==h?(d=t.jsx(ke,{side:"top",children:h}),e[14]=h,e[15]=d):d=e[15];let x;e[16]!==u||e[17]!==d?(x=t.jsxs(Ne,{delayDuration:0,children:[u,d]}),e[16]=u,e[17]=d,e[18]=x):x=e[18];let g;e[19]!==o?(g=o("virtualMcp.settings.views.rowActions"),e[19]=o,e[20]=g):g=e[20];let v;e[21]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(Pi,{size:16}),e[21]=v):v=e[21];let y;e[22]!==g?(y=t.jsx(ys,{asChild:!0,children:t.jsx(se,{variant:"ghost",size:"icon-sm",className:"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(dn,{size:14}),e[24]=j):j=e[24];let b;e[25]!==o?(b=o("virtualMcp.settings.views.open"),e[25]=o,e[26]=b):b=e[26];let w;e[27]!==i||e[28]!==b?(w=t.jsxs(He,{onClick:i,children:[j,b]}),e[27]=i,e[28]=b,e[29]=w):w=e[29];let S;e[30]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(Xt,{size:14}),e[30]=S):S=e[30];let M;e[31]!==s||e[32]!==o?(M=o(s?"virtualMcp.settings.views.unpin":"virtualMcp.settings.views.pin"),e[31]=s,e[32]=o,e[33]=M):M=e[33];let N;e[34]!==l||e[35]!==M?(N=t.jsxs(He,{onClick:l,children:[S,M]}),e[34]=l,e[35]=M,e[36]=N):N=e[36];let C;e[37]!==n||e[38]!==r||e[39]!==o?(C=n&&t.jsxs(He,{onClick:r,children:[t.jsx(Is,{size:14}),o("virtualMcp.settings.views.setMainView")]}),e[37]=n,e[38]=r,e[39]=o,e[40]=C):C=e[40];let k;e[41]!==w||e[42]!==N||e[43]!==C?(k=t.jsxs(ws,{align:"end",children:[w,N,C]}),e[41]=w,e[42]=N,e[43]=C,e[44]=k):k=e[44];let V;e[45]!==y||e[46]!==k?(V=t.jsxs(js,{children:[y,k]}),e[45]=y,e[46]=k,e[47]=V):V=e[47];let _;return e[48]!==V||e[49]!==x?(_=t.jsxs("div",{className:"flex items-center gap-1",children:[x,V]}),e[48]=V,e[49]=x,e[50]=_):_=e[50],_}const ps=a=>a.stopPropagation();function Dl(a){const e=q.c(8),{icon:s,title:n}=a;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 l;e[3]!==n?(l=t.jsx("span",{className:"text-xs text-muted-foreground",children:n}),e[3]=n,e[4]=l):l=e[4];let r;return e[5]!==i||e[6]!==l?(r=t.jsxs("div",{className:"flex items-center gap-2 px-4 py-2.5 bg-muted/30",children:[i,l]}),e[5]=i,e[6]=l,e[7]=r):r=e[7],r}function Pl(a){const e=q.c(70),{views:s}=a,n=Z();let i;e[0]!==n?(i=n("virtualMcp.settings.views.defaults"),e[0]=n,e[1]=i):i=e[1];let l;e[2]!==n?(l=n("virtualMcp.layoutTabContent.mainView"),e[2]=n,e[3]=l):l=e[3];let r;e[4]!==n?(r=n("virtualMcp.layoutTabContent.mainViewDescription"),e[4]=n,e[5]=r):r=e[5];const o=s.defaultMainView,p=s.setMainView;let c;e[6]!==n?(c=n("virtualMcp.layoutTabContent.mainView"),e[6]=n,e[7]=c):c=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]!==c||e[13]!==m?(u=t.jsx(Oe,{"aria-label":c,size:"sm",className:"w-36 shrink-0 @min-xl/project-settings:w-44",children:m}),e[12]=c,e[13]=m,e[14]=u):u=e[14];let h;e[15]!==s.defaultMainOptions?(h=s.defaultMainOptions.map(Ol),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:o,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]!==l||e[26]!==r?(g=t.jsx(tt,{title:l,description:r,action:x}),e[24]=x,e[25]=l,e[26]=r,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 w;e[34]!==j||e[35]!==b||e[36]!==s.noMainView||e[37]!==s.setChatDefaultOpen?(w=t.jsx(Ce,{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]=w):w=e[38];let S;e[39]!==n||e[40]!==s.noMainView?(S=s.noMainView&&t.jsx(ke,{side:"top",children:n("virtualMcp.layoutTabContent.chatAlwaysShown")}),e[39]=n,e[40]=s.noMainView,e[41]=S):S=e[41];let M;e[42]!==w||e[43]!==S?(M=t.jsxs(Ne,{delayDuration:0,children:[w,S]}),e[42]=w,e[43]=S,e[44]=M):M=e[44];let N;e[45]!==v||e[46]!==y||e[47]!==M?(N=t.jsx(tt,{title:v,description:y,action:M}),e[45]=v,e[46]=y,e[47]=M,e[48]=N):N=e[48];let C;e[49]!==g||e[50]!==N?(C=t.jsxs(ze,{children:[g,N]}),e[49]=g,e[50]=N,e[51]=C):C=e[51];let k;e[52]!==i||e[53]!==C?(k=t.jsx(Be,{title:i,children:C}),e[52]=i,e[53]=C,e[54]=k):k=e[54];let V;e[55]!==n?(V=n("virtualMcp.settings.views.sidebar"),e[55]=n,e[56]=V):V=e[56];let _;e[57]!==s?(_=s.projectViews.map(L=>{const U=s.pinned(L);return t.jsx(tt,{icon:t.jsx(Tl,{viewId:L,blocksSite:s.blocksSite}),title:s.labels[L],onClick:()=>s.openView(L),action:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(fs,{pinned:U,canSetMainView:U&&!s.isMainView(L),onOpen:()=>s.openView(L),onTogglePin:()=>s.togglePin(L,!U),onSetMainView:()=>s.setMainView(L)}),t.jsx("span",{onClick:()=>s.openView(L),className:"flex cursor-pointer items-center text-muted-foreground",children:t.jsx(Wt,{size:16})})]})},L)}),e[57]=s,e[58]=_):_=e[58];let E;e[59]!==s?(E=s.connectionsData.flatMap(L=>[t.jsx(Dl,{icon:L.icon,title:L.title},`${L.id}:header`),...L.uiTools.map(U=>{const K=s.pinnedAppViews.find(Y=>Y.connectionId===L.id&&Y.toolName===U.name),W=!!K,G=un(L.id,U.name),F=`ext-apps:${L.id}:${U.name}`;return t.jsx(tt,{onClick:()=>s.openView(G),icon:W?t.jsx("span",{onClick:ps,children:t.jsx(tn,{value:K.icon??null,name:K.label||U.name,size:"xs",showHoverOverlay:!1,onChange:Y=>s.setAppViewIcon(L.id,U.name,Y)})}):t.jsx(As,{size:16}),title:W?t.jsx("span",{onClick:ps,children:t.jsx(Me,{value:K.label,onChange:Y=>s.setAppViewLabel(L.id,U.name,Y.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(fs,{pinned:W,canSetMainView:W&&!s.isMainView(F),onOpen:()=>s.openView(G),onTogglePin:()=>s.toggleAppViewPin(L.id,U.name),onSetMainView:()=>s.setMainView(F)}),t.jsx("span",{onClick:()=>s.openView(G),className:"flex cursor-pointer items-center text-muted-foreground",children:t.jsx(Wt,{size:16})})]})},`${L.id}:${U.name}`)})]),e[59]=s,e[60]=E):E=e[60];let D;e[61]!==_||e[62]!==E?(D=t.jsxs(ze,{children:[_,E]}),e[61]=_,e[62]=E,e[63]=D):D=e[63];let $;e[64]!==V||e[65]!==D?($=t.jsx(Be,{title:V,children:D}),e[64]=V,e[65]=D,e[66]=$):$=e[66];let I;return e[67]!==k||e[68]!==$?(I=t.jsxs(t.Fragment,{children:[k,$]}),e[67]=k,e[68]=$,e[69]=I):I=e[69],I}function Ol(a){return t.jsx(we,{value:a.value,children:a.label},a.value)}const sn="site-editor",Il=new Set([sn,"content"]);function Al({virtualMcpId:a,form:e,flushAndSave:s}){const n=Z(),i=Tt(),{openPanel:l}=Ei(),r=Ts(a),o=zi(r),p=Bs(a),c=Gi(a),f=(r?.connections??[]).map(T=>T.connection_id).sort(),{data:m}=Cs({queryKey:Dt.projectConnectionDetails(a,f),enabled:f.length>0,queryFn:async()=>await Promise.all(f.map(async z=>{try{const{item:B}=await i.call("COLLECTION_CONNECTIONS_GET",{id:z}),P=(B?.tools??[]).flatMap(O=>{const ee=Ai(O._meta);return ee?[{name:O.name,title:O.title,description:O.description,resourceUri:ee}]:[]});return{fetchOk:!0,id:z,title:B?.title??z,icon:B?.icon??null,uiTools:P}}catch{return{fetchOk:!1,id:z,title:z,icon:null,uiTools:[]}}}))}),u=(m??[]).filter(T=>T.uiTools.length>0),h=new Set([...mn,...fn]),d=e.watch("metadata.ui.pinnedViews")??[],x=e.watch("metadata.ui.layout")??null,g=x?.defaultMainView??null,v=x?.chatDefaultOpen??!1,y=o.presence.calendar,j=e.watch("metadata.sidebarViewsSeen"),b=Mt(_t({sidebarViews:e.watch("metadata.sidebarViews"),ui:{layout:x}}),e.watch("metadata.sidebarViewsVersion"),es(j,y)),w=c??(r?Mt(_t(r.metadata),r.metadata.sidebarViewsVersion,es(r.metadata.sidebarViewsSeen,y)):b),S=(()=>{if(!g||g.type==="chat")return"";const T=pn(g.type);return T==="instructions"||T==="connections"||T==="layout"?"settings":Il.has(T)?sn:h.has(T)?T:`${T}:${g.id??""}:${g.toolName??""}`})(),M=S==="",N=T=>{const[z,B,P]=T.split(":");return z?h.has(z)?{type:z}:z==="ext-apps"&&B?{type:"ext-apps",id:B,toolName:P||void 0}:null:null},C=T=>{e.setValue("metadata.ui.pinnedViews",T,{shouldDirty:!0})},k=T=>{e.setValue("metadata.ui.layout",{...x,...T},{shouldDirty:!0})},V=H.useRef(!1);if(m&&m.length>0&&!V.current){V.current=!0;const T=new Set((m??[]).filter(O=>O.fetchOk).map(O=>O.id)),z=new Set(u.flatMap(O=>O.uiTools.map(ee=>`${O.id}:${ee.name}`))),B=new Set(f),P=d.filter(O=>B.has(O.connectionId)&&(!T.has(O.connectionId)||z.has(`${O.connectionId}:${O.toolName}`)));P.length!==d.length&&(C(P),g?.type==="ext-apps"&&!P.some(O=>O.connectionId===g.id&&O.toolName===g.toolName)&&k({defaultMainView:{type:"settings"}}))}const _=(T,z)=>{if(d.some(P=>P.connectionId===T&&P.toolName===z)){const P=d.filter(ee=>!(ee.connectionId===T&&ee.toolName===z));C(P);const O=`ext-apps:${T}:${z}`;S===O&&k({defaultMainView:{type:"settings"}})}else{const P=u.find(O=>O.id===T)?.uiTools.find(O=>O.name===z)?.title;C([...d,{connectionId:T,toolName:z,label:P??kt(z),icon:null}])}s()},E=(T,z,B)=>{C(d.map(P=>P.connectionId===T&&P.toolName===z?{...P,label:B}:P))},D=()=>{s()},$=(T,z,B)=>{C(d.map(P=>P.connectionId===T&&P.toolName===z?{...P,icon:B}:P)),s()},I=T=>{k({defaultMainView:N(T)}),s()},L=(T,z)=>{const B=Yi(w,T,z,1);e.setValue("metadata.sidebarViews",B,{shouldDirty:!0}),e.setValue("metadata.sidebarViewsVersion",1,{shouldDirty:!0}),y&&e.setValue("metadata.sidebarViewsSeen",Bi(r?.metadata.sidebarViewsSeen??j,y),{shouldDirty:!0}),p.stage(B,w);const P=Wi(g,T,z);P!==g&&k({defaultMainView:P})},U=Ys(r?.metadata),K=Ri(U,o.presence),W=Li(K),G=Ui(w,K,1),F={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"),calendar:n("common.mainPanelTabs.calendar")},Y=[];for(const T of G)T!=="automations"&&Y.push({value:T,label:F[T]});for(const T of d)Y.push({value:`ext-apps:${T.connectionId}:${T.toolName}`,label:T.label||T.toolName});return G.includes("automations")&&Y.push({value:"automations",label:F.automations}),Y.push({value:"settings",label:n("virtualMcp.layoutTabContent.settings")}),{projectViews:W,blocksSite:y,labels:F,pinned:T=>w.includes(T),isMainView:T=>S===T,defaultMainView:S,defaultMainOptions:Y,noMainView:M,chatDefaultOpen:v,connectionsData:u,pinnedAppViews:d,openView:T=>l(T,{virtualmcpid:a}),togglePin:(T,z)=>L(T,z),setMainView:I,setChatDefaultOpen:T=>{k({chatDefaultOpen:T}),s()},toggleAppViewPin:_,setAppViewIcon:$,setAppViewLabel:E,commitAppViewLabel:D}}function $l(a){const e=q.c(55),{form:s,onCommit:n}=a,i=Z(),l=H.useId();let r;e[0]!==i?(r=i("virtualMcp.settings.identity.icon"),e[0]=i,e[1]=r):r=e[1];let o;e[2]!==r?(o=t.jsx("p",{className:"text-sm font-medium",children:r}),e[2]=r,e[3]=o):o=e[3];let p;e[4]!==i?(p=i("virtualMcp.settings.identity.iconDescription"),e[4]=i,e[5]=p):p=e[5];let c;e[6]!==p?(c=t.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:p}),e[6]=p,e[7]=c):c=e[7];let f;e[8]!==o||e[9]!==c?(f=t.jsxs("div",{children:[o,c]}),e[8]=o,e[9]=c,e[10]=f):f=e[10];let m;e[11]!==s||e[12]!==n||e[13]!==i?(m=V=>{const{field:_}=V;return t.jsx("div",{className:"justify-self-start",children:t.jsx(tn,{value:_.value??null,onChange:E=>{_.onChange(E),n()},onColorChange:E=>{s.setValue("metadata.ui.themeColor",E,{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=`${l}-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]!==l||e[27]!==n||e[28]!==i?(v=V=>{const{field:_}=V;return t.jsx(Me,{..._,id:`${l}-name`,value:_.value??"",onBlur:()=>{_.onBlur(),n()},placeholder:i("virtualMcp.virtualMcp.agentNamePlaceholder")})},e[26]=l,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=`${l}-description`;let w;e[36]!==i?(w=i("virtualMcp.settings.identity.description"),e[36]=i,e[37]=w):w=e[37];let S;e[38]!==b||e[39]!==w?(S=t.jsx("label",{htmlFor:b,className:"text-sm font-medium",children:w}),e[38]=b,e[39]=w,e[40]=S):S=e[40];let M;e[41]!==l||e[42]!==n||e[43]!==i?(M=V=>{const{field:_}=V;return t.jsx(ut,{..._,id:`${l}-description`,value:_.value??"",onBlur:()=>{_.onBlur(),n()},placeholder:i("virtualMcp.virtualMcp.descriptionPlaceholder"),className:"min-h-24 resize-y"})},e[41]=l,e[42]=n,e[43]=i,e[44]=M):M=e[44];let N;e[45]!==s.control||e[46]!==M?(N=t.jsx(be,{name:"description",control:s.control,render:M}),e[45]=s.control,e[46]=M,e[47]=N):N=e[47];let C;e[48]!==S||e[49]!==N?(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:[S,N]}),e[48]=S,e[49]=N,e[50]=C):C=e[50];let k;return e[51]!==j||e[52]!==C||e[53]!==h?(k=t.jsxs(ze,{children:[h,j,C]}),e[51]=j,e[52]=C,e[53]=h,e[54]=k):k=e[54],k}function Fl(a){const e=q.c(8),{section:s}=a,n=Z();let i;e[0]!==n?(i=n("virtualMcp.settings.navigation"),e[0]=n,e[1]=i):i=e[1];let l;e[2]!==s||e[3]!==n?(l=Ji.map(o=>{const{titleKey:p}=Zi[o];return t.jsx(Ue.Tab,{active:s===o,asChild:!0,children:t.jsx(Ns,{to:".",activeOptions:{exact:!0,explicitUndefined:!0},search:c=>({...c,section:o==="general"?void 0:o}),children:n(p)})},o)}),e[2]=s,e[3]=n,e[4]=l):l=e[4];let r;if(e[5]!==i||e[6]!==l){const o=t.jsx(Ue.Tabs,{"aria-label":i,children:l});r=t.jsx(hn.Toolbar.Left.Portal,{fallback:o,children:o}),e[5]=i,e[6]=l,e[7]=r}else r=e[7];return r}function El(){const a=q.c(8),e=Pt();let s;a[0]===Symbol.for("react.memo_cache_sentinel")?(s={strict:!1},a[0]=s):s=a[0];const{section:n}=xn(s);let i;a[1]!==n?(i=ea(n)?n:"general",a[1]=n,a[2]=i):i=a[2];let l;a[3]!==e?(l=o=>e({to:".",search:p=>({...p,section:o??void 0})}),a[3]=e,a[4]=l):l=a[4];let r;return a[5]!==i||a[6]!==l?(r={section:i,openSection:l},a[5]=i,a[6]=l,a[7]=r):r=a[7],r}function nn(a){const e=q.c(20),{value:s,label:n,copiedLabel:i,variant:l,size:r,className:o,copiedClassName:p}=a,c=l===void 0?"ghost":l,f=r===void 0?"icon-sm":r,{handleCopy:m,copied:u}=sa();let h;e[0]!==m||e[1]!==s?(h=()=>{m(s).catch(zl)},e[0]=m,e[1]=s,e[2]=h):h=e[2];const d=u&&p;let x;e[3]!==o||e[4]!==d?(x=ve(o,d),e[3]=o,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]!==c?(v=t.jsx(se,{type:"button",variant:c,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]=c,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 zl(){}function Rl(a){const e=q.c(14),{id:s,value:n,copyLabel:i,copiedLabel:l,className:r}=a;let o;e[0]!==r?(o=ve("relative h-fit",r),e[0]=r,e[1]=o):o=e[1];let p;e[2]!==s||e[3]!==n?(p=t.jsx(Me,{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 c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=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]=c):c=e[5];let f;e[6]!==l||e[7]!==i||e[8]!==n?(f=t.jsx(nn,{value:n,label:i,copiedLabel:l,className:c,copiedClassName:"opacity-100"}),e[6]=l,e[7]=i,e[8]=n,e[9]=f):f=e[9];let m;return e[10]!==o||e[11]!==p||e[12]!==f?(m=t.jsxs("div",{className:o,children:[p,f]}),e[10]=o,e[11]=p,e[12]=f,e[13]=m):m=e[13],m}async function hs(a){const e=await a.json().catch(()=>({}));if(!a.ok)throw new Error(e.error??`HTTP ${a.status}`);return e}function Ll(a){const e=q.c(106),{orgSlug:s,virtualMcpId:n}=a,i=Z(),l=ks(),r=`/api/${s}/hosted/${encodeURIComponent(n)}/site-tokens`;let o;e[0]!==s||e[1]!==n?(o=Dt.hostedSiteTokens(s,n),e[0]=s,e[1]=n,e[2]=o):o=e[2];const p=o,[c,f]=H.useState(null),m=H.useId();let u;e[3]!==r?(u=async()=>hs(await fetch(r)),e[3]=r,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=Cs(h);let x;e[8]!==r?(x=async()=>hs(await fetch(r,{method:"POST"})),e[8]=r,e[9]=x):x=e[9];let g;e[10]===Symbol.for("react.memo_cache_sentinel")?(g=fe=>{const{token:A}=fe;return f(A)},e[10]=g):g=e[10];let v;e[11]!==p||e[12]!==l?(v=()=>l.invalidateQueries({queryKey:p}),e[11]=p,e[12]=l,e[13]=v):v=e[13];let y;e[14]!==x||e[15]!==v?(y={mutationFn:x,onSuccess:g,onError:Ul,onSettled:v},e[14]=x,e[15]=v,e[16]=y):y=e[16];const j=gn(y);let b;e[17]!==d.data?.tokens?(b=d.data?.tokens??[],e[17]=d.data?.tokens,e[18]=b):b=e[18];const w=b,S=d.data?.site;let M;e[19]!==i?(M=i("siteTokens.title"),e[19]=i,e[20]=M):M=e[20];let N;e[21]!==i?(N=i("siteTokens.description"),e[21]=i,e[22]=N):N=e[22];let C;e[23]!==i?(C=i("siteTokens.siteId"),e[23]=i,e[24]=C):C=e[24];let k;e[25]!==m||e[26]!==C?(k=t.jsx("label",{htmlFor:m,className:"text-sm font-medium",children:C}),e[25]=m,e[26]=C,e[27]=k):k=e[27];let V;e[28]!==i?(V=i("siteTokens.siteIdDescription"),e[28]=i,e[29]=V):V=e[29];let _;e[30]!==V?(_=t.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:V}),e[30]=V,e[31]=_):_=e[31];let E;e[32]!==S||e[33]!==m||e[34]!==i?(E=S?t.jsx(Rl,{id:m,value:S,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]=S,e[33]=m,e[34]=i,e[35]=E):E=e[35];const D=!d.data||j.isPending;let $;e[36]!==j?($=()=>j.mutate(),e[36]=j,e[37]=$):$=e[37];let I;e[38]!==j.isPending?(I=j.isPending?t.jsx(it,{className:"size-3.5"}):t.jsx(Pe,{size:14}),e[38]=j.isPending,e[39]=I):I=e[39];let L;e[40]!==i?(L=i("siteTokens.issue"),e[40]=i,e[41]=L):L=e[41];let U;e[42]!==D||e[43]!==$||e[44]!==I||e[45]!==L?(U=t.jsxs(se,{type:"button",size:"sm",className:"shrink-0",disabled:D,onClick:$,children:[I,L]}),e[42]=D,e[43]=$,e[44]=I,e[45]=L,e[46]=U):U=e[46];let K;e[47]!==E||e[48]!==U?(K=t.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[E,U]}),e[47]=E,e[48]=U,e[49]=K):K=e[49];let W;e[50]!==k||e[51]!==_||e[52]!==K?(W=t.jsxs(je,{className:"group",children:[k,_,K]}),e[50]=k,e[51]=_,e[52]=K,e[53]=W):W=e[53];let G;e[54]!==d.error||e[55]!==d.isError?(G=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]=G):G=e[56];let F;if(e[57]!==i||e[58]!==w){let fe;e[60]!==i?(fe=A=>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:A.kid}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("siteTokens.issuedAgo",{when:ta(new Date(A.iat*1e3))})})]})]})},A.kid),e[60]=i,e[61]=fe):fe=e[61],F=w.map(fe),e[57]=i,e[58]=w,e[59]=F}else F=e[59];let Y;e[62]!==W||e[63]!==G||e[64]!==F?(Y=t.jsxs(ze,{children:[W,G,F]}),e[62]=W,e[63]=G,e[64]=F,e[65]=Y):Y=e[65];const X=c!==null;let T;e[66]===Symbol.for("react.memo_cache_sentinel")?(T=fe=>!fe&&f(null),e[66]=T):T=e[66];let z;e[67]!==i?(z=i("siteTokens.createdTitle"),e[67]=i,e[68]=z):z=e[68];let B;e[69]!==z?(B=t.jsx(lt,{children:z}),e[69]=z,e[70]=B):B=e[70];let P;e[71]!==i?(P=i("siteTokens.createdDescription"),e[71]=i,e[72]=P):P=e[72];let O;e[73]!==P?(O=t.jsx(Ms,{children:P}),e[73]=P,e[74]=O):O=e[74];let ee;e[75]!==B||e[76]!==O?(ee=t.jsxs(at,{children:[B,O]}),e[75]=B,e[76]=O,e[77]=ee):ee=e[77];let ae;e[78]!==i?(ae=i("siteTokens.createdTitle"),e[78]=i,e[79]=ae):ae=e[79];const ce=c??"";let le;e[80]!==ae||e[81]!==ce?(le=t.jsx(Me,{readOnly:!0,"aria-label":ae,value:ce,className:"font-mono text-xs"}),e[80]=ae,e[81]=ce,e[82]=le):le=e[82];let ie;e[83]!==c||e[84]!==i?(ie=c?t.jsx(nn,{value:c,label:i("siteTokens.copy"),copiedLabel:i("siteTokens.copied"),variant:"outline",size:"icon",className:"shrink-0"}):null,e[83]=c,e[84]=i,e[85]=ie):ie=e[85];let Q;e[86]!==le||e[87]!==ie?(Q=t.jsxs("div",{className:"flex items-center gap-2",children:[le,ie]}),e[86]=le,e[87]=ie,e[88]=Q):Q=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(se,{onClick:de,children:ue})}),e[92]=ue,e[93]=he):he=e[93];let me;e[94]!==ee||e[95]!==Q||e[96]!==he?(me=t.jsxs(Je,{className:"sm:max-w-lg",children:[ee,Q,he]}),e[94]=ee,e[95]=Q,e[96]=he,e[97]=me):me=e[97];let xe;e[98]!==X||e[99]!==me?(xe=t.jsx(Xe,{open:X,onOpenChange:T,children:me}),e[98]=X,e[99]=me,e[100]=xe):xe=e[100];let ge;return e[101]!==N||e[102]!==Y||e[103]!==xe||e[104]!==M?(ge=t.jsxs(Be,{title:M,description:N,children:[Y,xe]}),e[101]=N,e[102]=Y,e[103]=xe,e[104]=M,e[105]=ge):ge=e[105],ge}function Ul(a){return oe.error(a.message)}function Yl(a){const e=q.c(8),{control:s,previewServerUrl:n}=a,i=Z();let l;e[0]!==n?(l=Ws(n),e[0]=n,e[1]=l):l=e[1];const r=!!l;let o;e[2]!==r||e[3]!==i?(o=c=>{const{field:f}=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:"fast-preview",className:"font-normal text-foreground",children:i("sandbox.cmsSettings.fastPreview.label")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i(r?"sandbox.cmsSettings.fastPreview.description":"sandbox.cmsSettings.fastPreview.needsPreviewServerUrl")})]}),t.jsx(ht,{id:"fast-preview",className:"shrink-0",checked:!!f.value&&r,disabled:!r,onCheckedChange:m=>f.onChange(m)})]})},e[2]=r,e[3]=i,e[4]=o):o=e[4];let p;return e[5]!==s||e[6]!==o?(p=t.jsx(be,{control:s,name:"metadata.fastPreview",render:o}),e[5]=s,e[6]=o,e[7]=p):p=e[7],p}function Bl(a){const e=q.c(5),{control:s,fastPreview:n}=a,i=Z();if(!n)return null;let l;e[0]!==i?(l=o=>{const{field:p}=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-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:c=>p.onChange(c)})]})},e[0]=i,e[1]=l):l=e[1];let r;return e[2]!==s||e[3]!==l?(r=t.jsx(be,{control:s,name:"metadata.fastPreviewInPlace",render:l}),e[2]=s,e[3]=l,e[4]=r):r=e[4],r}function Wl(a){const e=q.c(18),{control:s,isBlocksV8:n}=a,i=n===void 0?!1:n,l=Z();let r;e[0]!==l?(r=l("sandbox.previewServerUrlField.label"),e[0]=l,e[1]=r):r=e[1];let o;e[2]!==r?(o=t.jsx(ye,{htmlFor:"preview-server-url",children:r}),e[2]=r,e[3]=o):o=e[3];let p;e[4]!==l?(p=d=>{const{field:x}=d,g=x.value??"";return t.jsx(Me,{id:"preview-server-url",type:"url",inputMode:"url",placeholder:l("sandbox.previewServerUrlField.placeholder"),value:g,onChange:v=>x.onChange(v.target.value===""?null:v.target.value),onBlur:()=>{x.onChange(na(g)),x.onBlur()}})},e[4]=l,e[5]=p):p=e[5];let c;e[6]!==s||e[7]!==p?(c=t.jsx(be,{control:s,name:"metadata.previewServerUrl",render:p}),e[6]=s,e[7]=p,e[8]=c):c=e[8];const f=i?"sandbox.previewServerUrlField.descriptionBlocksV8":"sandbox.previewServerUrlField.description";let m;e[9]!==l||e[10]!==f?(m=l(f),e[9]=l,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]!==o||e[15]!==c||e[16]!==u?(h=t.jsxs("div",{className:"space-y-2",children:[o,c,u]}),e[14]=o,e[15]=c,e[16]=u,e[17]=h):h=e[17],h}function Kl(a){const e=q.c(15),{control:s,isBlocksV8:n,previewServerUrl:i,fastPreview:l}=a,r=Z(),o=n||!!l;let p;e[0]!==s||e[1]!==n?(p=t.jsx(je,{children:t.jsx(Wl,{control:s,isBlocksV8:n})}),e[0]=s,e[1]=n,e[2]=p):p=e[2];let c;e[3]!==s||e[4]!==n||e[5]!==i||e[6]!==r?(c=n?!Ws(i)&&t.jsx(je,{children:t.jsx("p",{className:"text-xs text-muted-foreground",children:r("sandbox.cmsSettings.blocksV8.needsPreviewServerUrl")})}):t.jsx(je,{children:t.jsx(Yl,{control:s,previewServerUrl:i})}),e[3]=s,e[4]=n,e[5]=i,e[6]=r,e[7]=c):c=e[7];let f;e[8]!==s||e[9]!==o?(f=o&&t.jsx(je,{children:t.jsx(Bl,{control:s,fastPreview:o})}),e[8]=s,e[9]=o,e[10]=f):f=e[10];let m;return e[11]!==p||e[12]!==c||e[13]!==f?(m=t.jsxs(t.Fragment,{children:[p,c,f]}),e[11]=p,e[12]=c,e[13]=f,e[14]=m):m=e[14],m}const St={tools:null,resources:null,prompts:null},Gl=aa.pick({status:!0,title:!0,description:!0,icon:!0,metadata:!0,connections:!0});function ql(a){const s=new TextEncoder().encode(a),n=Array.from(s,i=>String.fromCharCode(i)).join("");return btoa(n)}function an(a){return{"x-studio-client":a,"x-mesh-client":a}}function Hl(a){const e=q.c(15),{url:s,agentId:n}=a,i=Z(),[l,r]=H.useState(!1);let o;e[0]!==n||e[1]!==i||e[2]!==s?(o=async()=>{Ve("agent_connect_action",{agent_id:n,action:"copy_url"}),await navigator.clipboard.writeText(s),r(!0),oe.success(i("virtualMcp.virtualMcpShareModal.agentUrlCopied")),await vt(2e3),r(!1)},e[0]=n,e[1]=i,e[2]=s,e[3]=o):o=e[3];const p=o;let c;e[4]!==l?(c=l?t.jsx(rt,{size:20,className:"text-success"}):t.jsx(xt,{size:20}),e[4]=l,e[5]=c):c=e[5];let f;e[6]!==l||e[7]!==i?(f=i(l?"virtualMcp.virtualMcpShareModal.copied":"virtualMcp.virtualMcpShareModal.copyUrl"),e[6]=l,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]!==c||e[13]!==m?(u=t.jsxs(se,{type:"button",variant:"outline",onClick:p,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[c,m]}),e[11]=p,e[12]=c,e[13]=m,e[14]=u):u=e[14],u}function Ql(a){const e=q.c(13),{url:s,serverName:n,agentId:i}=a,l=Z();let r;e[0]!==i||e[1]!==n||e[2]!==l||e[3]!==s?(r=()=>{Ve("agent_connect_action",{agent_id:i,action:"install_cursor"});const u=Gs(n),h={type:"http",url:s,headers:an("Cursor")},d=ql(JSON.stringify(h,null,2)),x=`cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(u)}&config=${encodeURIComponent(d)}`;window.open(x,"_blank"),oe.success(l("virtualMcp.virtualMcpShareModal.openingCursor"))},e[0]=i,e[1]=n,e[2]=l,e[3]=s,e[4]=r):r=e[4];const o=r;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 c;e[6]!==l?(c=l("virtualMcp.virtualMcpShareModal.installOnCursor"),e[6]=l,e[7]=c):c=e[7];let f;e[8]!==c?(f=t.jsx("span",{className:"text-xs font-medium",children:c}),e[8]=c,e[9]=f):f=e[9];let m;return e[10]!==o||e[11]!==f?(m=t.jsxs(se,{type:"button",variant:"outline",onClick:o,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[p,f]}),e[10]=o,e[11]=f,e[12]=m):m=e[12],m}function Xl(a){const e=q.c(16),{url:s,serverName:n,agentId:i}=a,l=Z(),[r,o]=H.useState(!1);let p;e[0]!==i||e[1]!==n||e[2]!==l||e[3]!==s?(p=async()=>{Ve("agent_connect_action",{agent_id:i,action:"install_claude_code"});const d=Gs(n),x={type:"http",url:s,headers:an("Claude Code")},g=JSON.stringify(x,null,2),v=`claude mcp add-json "${d}" '${g.replace(/'/g,"'\\''")}' --scope user`;await navigator.clipboard.writeText(v),o(!0),oe.success(l("virtualMcp.virtualMcpShareModal.claudeCodeCommandCopied")),await vt(2e3),o(!1)},e[0]=i,e[1]=n,e[2]=l,e[3]=s,e[4]=p):p=e[4];const c=p;let f;e[5]!==r?(f=r?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]=r,e[6]=f):f=e[6];let m;e[7]!==r||e[8]!==l?(m=l(r?"virtualMcp.virtualMcpShareModal.copied":"virtualMcp.virtualMcpShareModal.installOnClaudeCode"),e[7]=r,e[8]=l,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]!==c||e[13]!==f||e[14]!==u?(h=t.jsxs(se,{type:"button",variant:"outline",onClick:c,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[f,u]}),e[12]=c,e[13]=f,e[14]=u,e[15]=h):h=e[15],h}const Jl=720*60*60;function Zl({virtualMcp:a}){const e=Z(),s=Tt(),[n,i]=H.useState(null),[l,r]=H.useState(!1),[o,p]=H.useState(!1),c=a.id,f=a.title||`agent-${c.slice(0,8)}`,m=n?`bunx @decocms/typegen@latest --mcp ${c} --key ${n} --output client.ts`:`bunx @decocms/typegen@latest --mcp ${c} --key <api-key> --output client.ts`,u=async()=>{r(!0);try{const{key:d}=await s.call("API_KEY_CREATE",{name:`typegen-${f}`,permissions:{[c]:["*"]},expiresIn:Jl});if(!d)throw new Error("No key in response");i(d),Ve("agent_typegen_key_generated",{agent_id:c})}catch{Ve("agent_typegen_key_failed",{agent_id:c}),oe.error(e("virtualMcp.virtualMcpShareModal.failedGenerateApiKey"))}finally{r(!1)}},h=async()=>{Ve("agent_connect_action",{agent_id:c,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(se,{type:"button",variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:u,disabled:l,children:[l?t.jsx(it,{className:"size-3.5"}):t.jsx($t,{size:14}),t.jsx("span",{children:e(l?"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(se,{type:"button",variant:"ghost",size:"icon-xs",className:"shrink-0",onClick:h,children:o?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(er,{apiKey:n,agentId:c})]})}function er(a){const e=q.c(21),{apiKey:s,agentId:n}=a,[i,l]=H.useState(!1),r=window.location.origin,o=s?`STUDIO_API_KEY=${s}`:"STUDIO_API_KEY=<api-key>",p=`STUDIO_BASE_URL=${r}`,c=`${o}
1
+ import{c as q,b as Z,r as H,j as t,B as se,h as it,l as ve,X as js,T as ys,V as ws,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 at,v as lt,H as Ye,a3 as Ss,fF as on,w as Vt,L as Ns,I as Me,ak as cn,z as dn,ey as tt,av as Wt,aj as un,ex as ze,ew as Be,an as Tt,m as Cs,K as Dt,fG as mn,fH as fn,fI as pn,b6 as be,fJ as je,n as Ue,P as hn,d as Pt,u as xn,af as rt,o as ks,e as gn,aN as Ms,y as Ve,b2 as vn,a as bn,fK as _s,fL as jn,aX as yn,ad as wn,aF as Sn,aE as Nn,a5 as Cn,fM as kn,aM as Mn}from"./index-CImJlq71.js";import{g as _n}from"./extract-connection-data-BcSeYo2b.js";import{b as Vn}from"./chat-context-C_P788VD.js";import{U as Tn,b as Dn}from"./build-improve-prompt-doc-Ba28GGJ7.js";import{E as Pn}from"./empty-state-CkRk6emt.js";import{a as On}from"./shell-layout-Bmd6dXD4.js";import{g as ft,n as In,a as Kt,e as An,u as $n,f as Fn}from"./use-date-fns-locale-D3Iz1MzV.js";import{a as En}from"./mcp-oauth-Bf1ymd_L.js";import{f as zn,e as Rn,b as Ln,A as Un,a as Yn,d as Bn,c as Wn,g as Kn}from"./alert-dialog-SFY1grIM.js";import{T as ut}from"./textarea-Bp989dUN.js";import{c as Ne,T as Ce,a as ke}from"./tooltip-BB8x2ajM.js";import{a as Ot,b as Vs,u as Gn}from"./use-connection-CAJy9ePc.js";import{b as qn,a as Ts,g as Ds,d as Hn,k as Qn}from"./repository-binding-wXpkgUS5.js";import{i as Gt}from"./mcp-oauth-De4zWGdY.js";import{bg as Xn,k as Jn,bh as Zn,bi as ei,aT as ti,aD as si,aG as ni,bj as ii,bk as Ps,bl as Os,bm as ai,aq as li,bn as ri,bo as jt,bp as qt,A as Ht,N as oi,bq as ci,br as di,g as Is,p as Qt,n as ui,x as mi,w as fi,v as pi,u as hi,r as xi,f as As,E as Xt,aQ as gi,ae as vi,aw as bi}from"./agent-icon-Bl0Q4nDQ.js";import{s as Pe}from"./Plus-Bf8vM3Sx.js";import{t as dt,a as ji}from"./Tool01-XzMXqYKz.js";import{s as It}from"./Trash01-C68DqBe-.js";import{u as Jt}from"./use-debounced-autosave-CGLCHS8I.js";import{A as yi}from"./add-connection-dialog-CzGzxkZf.js";import{i as Ct}from"./SearchMd-C1vd4NNy.js";import{F as Zt}from"./file-type-icon-BlPndn8R.js";import{i as wi,j as Si,k as Ni,l as Ci}from"./use-org-fs-qBxAqXun.js";import{I as Ze}from"./integration-icon-B9snkXuC.js";import{C as $s}from"./checkbox-D_LpTCuo.js";import{S as ki}from"./search-input-CLbrLBK4.js";import{b as Oe,a as Ie,c as we,d as Ae,S as $e}from"./select-CO-KeEXe.js";import{s as At}from"./XClose-5-Y_ZVDY.js";import{C as Mi}from"./collection-tabs-BCwnkCTo.js";import{T as Fs,u as Es}from"./use-mcp-auth-status-Db86wDh0.js";import{u as pt}from"./use-mcp-client-BT3MLYTJ.js";import{a as zs}from"./use-mcp-tools-DY3R7rf0.js";import{u as _i}from"./use-mcp-prompts-DvHpjECx.js";import{g as Vi}from"./connection-slug-CITJ0kGN.js";import{t as kt}from"./utils-CVEq3hMx.js";import{S as ht}from"./switch-DGiOaGRn.js";import{a as Rs,b as Ls,P as Us}from"./popover-BqGcOxqn.js";import{S as Ti}from"./scroll-area-BZP0xkZ2.js";import{i as Di}from"./Upload01-D4h8lLWj.js";import{i as Pi}from"./DotsVertical-MgtYn_XR.js";import{a as Oi}from"./Image01-BYSI_JTy.js";import{i as Ii}from"./Monitor01-th-leB7u.js";import{g as Ai}from"./types-D4eFbg3n.js";import{a as Ys,g as $i,u as Fi}from"./experiments-tab-choice-DLYJ3Xgw.js";import{a as Ei}from"./use-panel-navigate-D57HPY2x.js";import{u as zi,e as Mt,o as es,r as _t,p as Ri,g as Li,s as Ui,t as Yi,h as Bi,i as Wi,a as Ki}from"./use-project-native-view-presence-C3HlYZwC.js";import{a as Bs,u as Gi,i as qi,o as Hi,r as ts,p as Qi,w as Xi,b as ss}from"./optimistic-project-sidebar-views-DtUy3pl1.js";import{P as Ji,a as Zi,i as ea}from"./sections-DE80daGy.js";import{i as $t}from"./Key01-CVBy3Esl.js";import{a as ta}from"./format-time-Cq80KKvY.js";import{a as xt}from"./Copy01-C8oI3ru2.js";import{u as sa}from"./use-copy-CvMH5zdo.js";import{L as ye}from"./label-CfvfFl3x.js";import{s as Ws,n as na,r as ia}from"./thread-intent-DXY7orZh.js";import{V as aa,E as gt,r as Ks,C as la,w as ra}from"./virtual-mcp-CP4uoCBU.js";import{s as Gs}from"./slugify-CEUa2lfQ.js";import{b as oa,a as ca,D as da}from"./drawer-BTNZfEU6.js";import{u as ua}from"./use-mobile-Nz4my9ZZ.js";import{d as vt}from"./delay-CnY5UFtP.js";import{b as ma}from"./sandbox-url-D3mC8qhT.js";import{S as fa,a as pa,b as ha}from"./secret-picker-r4BGxMfM.js";import{u as xa,a as ga}from"./use-secrets-OlxyEwyb.js";import{o as ns}from"./omit-sandbox-map-jj4lCB2U.js";import{G as va}from"./repository-picker-fHOvHVjl.js";import{r as ba}from"./serial-task-queue-CGOeQgpr.js";import{t as De,c as Qe,m as ja,a as qs}from"./differenceInSeconds-C3x8sHUj.js";function nt(a,e){const s=ft(),n=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??s.weekStartsOn??s.locale?.options?.weekStartsOn??0,i=De(a,e?.in),l=i.getDay(),r=(l<n?7:0)+l-n;return i.setDate(i.getDate()-r),i.setHours(0,0,0,0),i}function mt(a,e){return nt(a,{...e,weekStartsOn:1})}function Hs(a,e){const s=De(a,e?.in),n=s.getFullYear(),i=Qe(s,0);i.setFullYear(n+1,0,4),i.setHours(0,0,0,0);const l=mt(i),r=Qe(s,0);r.setFullYear(n,0,4),r.setHours(0,0,0,0);const o=mt(r);return s.getTime()>=l.getTime()?n+1:s.getTime()>=o.getTime()?n:n-1}function is(a,e){const s=De(a,e?.in);return s.setHours(0,0,0,0),s}function ya(a,e,s){const[n,i]=In(s?.in,a,e),l=is(n),r=is(i),o=+l-Kt(l),p=+r-Kt(r);return Math.round((o-p)/ja)}function wa(a,e){const s=Hs(a,e),n=Qe(a,0);return n.setFullYear(s,0,4),n.setHours(0,0,0,0),mt(n)}function Sa(a){return a instanceof Date||typeof a=="object"&&Object.prototype.toString.call(a)==="[object Date]"}function Na(a){return!(!Sa(a)&&typeof a!="number"||isNaN(+De(a)))}function Ca(a,e){const s=De(a,e?.in);return s.setFullYear(s.getFullYear(),0,1),s.setHours(0,0,0,0),s}function ka(a,e){const s=De(a,e?.in);return ya(s,Ca(s))+1}function Ma(a,e){const s=De(a,e?.in),n=+mt(s)-+wa(s);return Math.round(n/qs)+1}function Qs(a,e){const s=De(a,e?.in),n=s.getFullYear(),i=ft(),l=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,r=Qe(e?.in||a,0);r.setFullYear(n+1,0,l),r.setHours(0,0,0,0);const o=nt(r,e),p=Qe(e?.in||a,0);p.setFullYear(n,0,l),p.setHours(0,0,0,0);const c=nt(p,e);return+s>=+o?n+1:+s>=+c?n:n-1}function _a(a,e){const s=ft(),n=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,i=Qs(a,e),l=Qe(e?.in||a,0);return l.setFullYear(i,0,n),l.setHours(0,0,0,0),nt(l,e)}function Va(a,e){const s=De(a,e?.in),n=+nt(s,e)-+_a(s,e);return Math.round(n/qs)+1}function re(a,e){const s=a<0?"-":"",n=Math.abs(a).toString().padStart(e,"0");return s+n}const Ee={y(a,e){const s=a.getFullYear(),n=s>0?s:1-s;return re(e==="yy"?n%100:n,e.length)},M(a,e){const s=a.getMonth();return e==="M"?String(s+1):re(s+1,2)},d(a,e){return re(a.getDate(),e.length)},a(a,e){const s=a.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(a,e){return re(a.getHours()%12||12,e.length)},H(a,e){return re(a.getHours(),e.length)},m(a,e){return re(a.getMinutes(),e.length)},s(a,e){return re(a.getSeconds(),e.length)},S(a,e){const s=e.length,n=a.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"},as={G:function(a,e,s){const n=a.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(a,e,s){if(e==="yo"){const n=a.getFullYear(),i=n>0?n:1-n;return s.ordinalNumber(i,{unit:"year"})}return Ee.y(a,e)},Y:function(a,e,s,n){const i=Qs(a,n),l=i>0?i:1-i;if(e==="YY"){const r=l%100;return re(r,2)}return e==="Yo"?s.ordinalNumber(l,{unit:"year"}):re(l,e.length)},R:function(a,e){const s=Hs(a);return re(s,e.length)},u:function(a,e){const s=a.getFullYear();return re(s,e.length)},Q:function(a,e,s){const n=Math.ceil((a.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(a,e,s){const n=Math.ceil((a.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(a,e,s){const n=a.getMonth();switch(e){case"M":case"MM":return Ee.M(a,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(a,e,s){const n=a.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(a,e,s,n){const i=Va(a,n);return e==="wo"?s.ordinalNumber(i,{unit:"week"}):re(i,e.length)},I:function(a,e,s){const n=Ma(a);return e==="Io"?s.ordinalNumber(n,{unit:"week"}):re(n,e.length)},d:function(a,e,s){return e==="do"?s.ordinalNumber(a.getDate(),{unit:"date"}):Ee.d(a,e)},D:function(a,e,s){const n=ka(a);return e==="Do"?s.ordinalNumber(n,{unit:"dayOfYear"}):re(n,e.length)},E:function(a,e,s){const n=a.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(a,e,s,n){const i=a.getDay(),l=(i-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(l);case"ee":return re(l,2);case"eo":return s.ordinalNumber(l,{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(a,e,s,n){const i=a.getDay(),l=(i-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(l);case"cc":return re(l,e.length);case"co":return s.ordinalNumber(l,{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(a,e,s){const n=a.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(a,e,s){const i=a.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(a,e,s){const n=a.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(a,e,s){const n=a.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(a,e,s){if(e==="ho"){let n=a.getHours()%12;return n===0&&(n=12),s.ordinalNumber(n,{unit:"hour"})}return Ee.h(a,e)},H:function(a,e,s){return e==="Ho"?s.ordinalNumber(a.getHours(),{unit:"hour"}):Ee.H(a,e)},K:function(a,e,s){const n=a.getHours()%12;return e==="Ko"?s.ordinalNumber(n,{unit:"hour"}):re(n,e.length)},k:function(a,e,s){let n=a.getHours();return n===0&&(n=24),e==="ko"?s.ordinalNumber(n,{unit:"hour"}):re(n,e.length)},m:function(a,e,s){return e==="mo"?s.ordinalNumber(a.getMinutes(),{unit:"minute"}):Ee.m(a,e)},s:function(a,e,s){return e==="so"?s.ordinalNumber(a.getSeconds(),{unit:"second"}):Ee.s(a,e)},S:function(a,e){return Ee.S(a,e)},X:function(a,e,s){const n=a.getTimezoneOffset();if(n===0)return"Z";switch(e){case"X":return rs(n);case"XXXX":case"XX":return Le(n);default:return Le(n,":")}},x:function(a,e,s){const n=a.getTimezoneOffset();switch(e){case"x":return rs(n);case"xxxx":case"xx":return Le(n);default:return Le(n,":")}},O:function(a,e,s){const n=a.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+ls(n,":");default:return"GMT"+Le(n,":")}},z:function(a,e,s){const n=a.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+ls(n,":");default:return"GMT"+Le(n,":")}},t:function(a,e,s){const n=Math.trunc(+a/1e3);return re(n,e.length)},T:function(a,e,s){return re(+a,e.length)}};function ls(a,e=""){const s=a>0?"-":"+",n=Math.abs(a),i=Math.trunc(n/60),l=n%60;return l===0?s+String(i):s+String(i)+e+re(l,2)}function rs(a,e){return a%60===0?(a>0?"-":"+")+re(Math.abs(a)/60,2):Le(a,e)}function Le(a,e=""){const s=a>0?"-":"+",n=Math.abs(a),i=re(Math.trunc(n/60),2),l=re(n%60,2);return s+i+e+l}const os=(a,e)=>{switch(a){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"})}},Xs=(a,e)=>{switch(a){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"})}},Ta=(a,e)=>{const s=a.match(/(P+)(p+)?/)||[],n=s[1],i=s[2];if(!i)return os(a,e);let l;switch(n){case"P":l=e.dateTime({width:"short"});break;case"PP":l=e.dateTime({width:"medium"});break;case"PPP":l=e.dateTime({width:"long"});break;default:l=e.dateTime({width:"full"});break}return l.replace("{{date}}",os(n,e)).replace("{{time}}",Xs(i,e))},Da={p:Xs,P:Ta},Pa=/^D+$/,Oa=/^Y+$/,Ia=["D","DD","YY","YYYY"];function Aa(a){return Pa.test(a)}function $a(a){return Oa.test(a)}function Fa(a,e,s){const n=Ea(a,e,s);if(console.warn(n),Ia.includes(a))throw new RangeError(n)}function Ea(a,e,s){const n=a[0]==="Y"?"years":"days of the month";return`Use \`${a.toLowerCase()}\` instead of \`${a}\` (in \`${e}\`) for formatting ${n} to the input \`${s}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const za=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Ra=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,La=/^'([^]*?)'?$/,Ua=/''/g,Ya=/[a-zA-Z]/;function Ba(a,e,s){const n=ft(),i=s?.locale??n.locale??An,l=s?.firstWeekContainsDate??s?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,r=s?.weekStartsOn??s?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=De(a,s?.in);if(!Na(o))throw new RangeError("Invalid time value");let p=e.match(Ra).map(f=>{const m=f[0];if(m==="p"||m==="P"){const u=Da[m];return u(f,i.formatLong)}return f}).join("").match(za).map(f=>{if(f==="''")return{isToken:!1,value:"'"};const m=f[0];if(m==="'")return{isToken:!1,value:Wa(f)};if(as[m])return{isToken:!0,value:f};if(m.match(Ya))throw new RangeError("Format string contains an unescaped latin alphabet character `"+m+"`");return{isToken:!1,value:f}});i.localize.preprocessor&&(p=i.localize.preprocessor(o,p));const c={firstWeekContainsDate:l,weekStartsOn:r,locale:i};return p.map(f=>{if(!f.isToken)return f.value;const m=f.value;(!s?.useAdditionalWeekYearTokens&&$a(m)||!s?.useAdditionalDayOfYearTokens&&Aa(m))&&Fa(m,e,String(a));const u=as[m[0]];return u(o,m,i.localize,c)}).join("")}function Wa(a){const e=a.match(La);return e?e[1].replace(Ua,"'"):a}const Js=25*1024*1024,yt="home",wt="knowledge";function cs(a){return a==null?"":a<1024?`${a} B`:a<1024*1024?`${(a/1024).toFixed(0)} KB`:`${(a/(1024*1024)).toFixed(1)} MB`}function Re(a){return a.split("/").pop()??a}function Ka(a){const e=q.c(64),{form:s}=a,n=Z(),{upload:i}=wi(yt),l=Si(),r=H.useRef(null),[o,p]=H.useState(!1),[c,f]=H.useState(""),[m,u]=H.useState(!1);let h;e[0]!==o?(h={enabled:o},e[0]=o,e[1]=h):h=e[1];const{data:d}=Ni(60,h),x=d===void 0?[]:d;let g;e[2]!==o?(g={enabled:o},e[2]=o,e[3]=g):g=e[3];const{data:v}=Ci(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,w]=H.useState(j);let S;e[6]!==s?(S=A=>{w(A),s.setValue("metadata.knowledge",A,{shouldDirty:!0})},e[6]=s,e[7]=S):S=e[7];const M=S;let N;e[8]!==l||e[9]!==b||e[10]!==M||e[11]!==n||e[12]!==i?(N=async A=>{if(!A||A.length===0)return;const ne=Array.from(A),R=ne.filter(Za),te=ne.filter(Ja);if(te.length>0&&oe.warning(n("virtualMcp.filesSection.fileTooLargeTitle"),{description:n("virtualMcp.filesSection.fileTooLargeDescription",{names:te.map(Xa).join(", ")})}),R.length!==0){try{await i.mutateAsync({dir:wt,files:R})}catch(J){const pe=J;oe.error(pe instanceof Error?pe.message:n("virtualMcp.filesSection.failedUploadFile"));return}M([...b,...R.map(J=>({id:crypto.randomUUID(),name:J.name,volume:yt,path:`${wt}/${J.name}`,url:l(yt,`${wt}/${J.name}`),contentType:J.type||null,size:J.size,addedAt:new Date().toISOString()}))])}},e[8]=l,e[9]=b,e[10]=M,e[11]=n,e[12]=i,e[13]=N):N=e[13];const C=N;let k;e[14]!==l||e[15]!==b||e[16]!==M?(k=A=>{b.some(ne=>ne.volume===A.volume&&ne.path===A.path)||(M([...b,{id:crypto.randomUUID(),name:Re(A.path),volume:A.volume,path:A.path,url:l(A.volume,A.path),contentType:null,size:A.size??null,addedAt:new Date().toISOString()}]),p(!1))},e[14]=l,e[15]=b,e[16]=M,e[17]=k):k=e[17];const V=k;let _;e[18]!==l||e[19]!==b||e[20]!==M?(_=A=>{b.some(ne=>ne.volume===A.volume&&ne.path===A.path)||(M([...b,{id:crypto.randomUUID(),name:Re(A.path),kind:"skill",volume:A.volume,path:A.path,url:l(A.volume,A.path),contentType:null,size:null,addedAt:new Date().toISOString()}]),p(!1))},e[18]=l,e[19]=b,e[20]=M,e[21]=_):_=e[21];const E=_;let D;e[22]!==b||e[23]!==M?(D=A=>{M(b.filter(ne=>ne.id!==A))},e[22]=b,e[23]=M,e[24]=D):D=e[24];const $=D;let I;e[25]===Symbol.for("react.memo_cache_sentinel")?(I=A=>{p(A),A&&f("")},e[25]=I):I=e[25];const L=I;let U;e[26]!==b?(U=new Set(b.map(Qa)),e[26]=b,e[27]=U):U=e[27];const K=U,W=c.toLowerCase();let G;e[28]!==K?(G=A=>!K.has(`${A.volume}/${A.path}`),e[28]=K,e[29]=G):G=e[29];const F=x.filter(Ha).filter(G).filter(A=>Re(A.path).toLowerCase().includes(W)).slice(0,5);let Y;e[30]!==K?(Y=A=>!K.has(`${A.volume}/${A.path}`),e[30]=K,e[31]=Y):Y=e[31];const X=y.filter(Y).filter(A=>Re(A.path).toLowerCase().includes(W)).slice(0,5),T=A=>t.jsxs(js,{open:o,onOpenChange:L,children:[t.jsx(ys,{asChild:!0,children:A}),t.jsxs(ws,{align:"end",className:"w-56",children:[t.jsxs(He,{onSelect:()=>{r.current?.click()},children:[t.jsx(Xn,{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(Jn,{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:c,onChange:ne=>f(ne.target.value),onKeyDown:qa,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:F.length===0?t.jsx("p",{className:"px-2 py-3 text-center text-sm text-muted-foreground",children:n("virtualMcp.filesSection.noFilesFound")}):F.map(ne=>t.jsxs(He,{onSelect:()=>V(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:cs(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:c,onChange:ne=>f(ne.target.value),onKeyDown:Ga,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:X.length===0?t.jsx("p",{className:"px-2 py-3 text-center text-sm text-muted-foreground",children:n("virtualMcp.filesSection.noSkillsFound")}):X.map(ne=>t.jsxs(He,{onSelect:()=>E(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}`))})]})]})]})]}),z="flex flex-col gap-3";let B;e[32]!==n?(B=n("virtualMcp.filesSection.filesAndSkills"),e[32]=n,e[33]=B):B=e[33];let P;e[34]!==B?(P=t.jsx("h2",{className:"text-sm font-medium text-foreground",children:B}),e[34]=B,e[35]=P):P=e[35];let O;e[36]!==n?(O=n("virtualMcp.filesSection.description"),e[36]=n,e[37]=O):O=e[37];let ee;e[38]!==O?(ee=t.jsx("p",{className:"text-sm text-muted-foreground",children:O}),e[38]=O,e[39]=ee):ee=e[39];let ae;e[40]!==P||e[41]!==ee?(ae=t.jsxs("div",{className:"flex flex-col gap-1",children:[P,ee]}),e[40]=P,e[41]=ee,e[42]=ae):ae=e[42];const ce=b.length>0&&T(t.jsxs(se,{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 le;e[43]!==ae||e[44]!==ce?(le=t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[ae,ce]}),e[43]=ae,e[44]=ce,e[45]=le):le=e[45];let ie;e[46]!==C?(ie=t.jsx("input",{ref:r,type:"file",multiple:!0,className:"hidden",onChange:A=>{C(A.target.files),A.target.value=""}}),e[46]=C,e[47]=ie):ie=e[47];let Q,de;e[48]===Symbol.for("react.memo_cache_sentinel")?(Q=A=>{A.preventDefault(),u(!0)},de=()=>u(!1),e[48]=Q,e[49]=de):(Q=e[48],de=e[49]);let ue;e[50]!==C?(ue=A=>{A.preventDefault(),A.stopPropagation(),u(!1),C(A.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?T(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 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(A=>t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 surface",children:[A.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:A.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:A.name}),t.jsx("p",{className:"text-xs text-muted-foreground",children:A.kind==="skill"?n("virtualMcp.filesSection.kindSkill"):A.size!=null?cs(A.size):n("virtualMcp.filesSection.kindFile")})]}),t.jsx(se,{variant:"ghost",size:"icon",onClick:()=>$(A.id),"aria-label":n("virtualMcp.filesSection.removeAriaLabel",{name:A.name}),children:t.jsx(It,{size:16})})]},A.id));let ge;e[54]!==Q||e[55]!==de||e[56]!==ue||e[57]!==me||e[58]!==xe?(ge=t.jsx("div",{onDragOver:Q,onDragLeave:de,onDrop:ue,className:me,children:xe}),e[54]=Q,e[55]=de,e[56]=ue,e[57]=me,e[58]=xe,e[59]=ge):ge=e[59];let fe;return e[60]!==le||e[61]!==ie||e[62]!==ge?(fe=t.jsxs("section",{className:z,children:[le,ie,ge]}),e[60]=le,e[61]=ie,e[62]=ge,e[63]=fe):fe=e[63],fe}function Ga(a){return a.stopPropagation()}function qa(a){return a.stopPropagation()}function Ha(a){return a.kind!=="dir"}function Qa(a){return`${a.volume}/${a.path}`}function Xa(a){return a.name}function Ja(a){return a.size>Js}function Za(a){return a.size<=Js}function el(a){return a==null?"all":a.length===0?"self":"selected"}function tl(a){const e=q.c(88),{form:s,currentAgentId:n}=a,i=Z(),{org:l}=Fe(),r=qn(),[o,p]=H.useState(!1);let c;e[0]!==s?(c=s.getValues("metadata.subAgents")??null,e[0]=s,e[1]=c):c=e[1];const f=c;let m;e[2]!==f?(m=()=>el(f),e[2]=f,e[3]=m):m=e[3];const[u,h]=H.useState(m);let d;e[4]!==f?(d=f??[],e[4]=f,e[5]=d):d=e[5];const[x,g]=H.useState(d);let v,y,j,b,w,S;if(e[6]!==r||e[7]!==n||e[8]!==s||e[9]!==u||e[10]!==l||e[11]!==x||e[12]!==i){let k;e[19]!==n||e[20]!==l?(k=Q=>Q.id!==n&&Q.id!==l.id&&Q.status==="active",e[19]=n,e[20]=l,e[21]=k):k=e[21],v=r.filter(k);let V;e[22]!==x?(V=Q=>x.includes(Q.id),e[22]=x,e[23]=V):V=e[23];const _=v.filter(V);let E;e[24]!==s?(E=(Q,de)=>s.setValue("metadata.subAgents",Q==="all"?null:Q==="self"?[]:de,{shouldDirty:!0}),e[24]=s,e[25]=E):E=e[25];const D=E;let $;e[26]!==D||e[27]!==x?($=Q=>{h(Q),D(Q,x)},e[26]=D,e[27]=x,e[28]=$):$=e[28];const I=$;let L;e[29]!==D||e[30]!==x?(L=Q=>{const de=x.includes(Q)?x.filter(ue=>ue!==Q):[...x,Q];g(de),D("selected",de)},e[29]=D,e[30]=x,e[31]=L):L=e[31],y=L,w="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 W;e[36]!==u||e[37]!==i?(W=u==="all"&&t.jsx("p",{className:"text-sm text-muted-foreground",children:i("virtualMcp.subAgentsSection.canDelegateToAnyAgent")}),e[36]=u,e[37]=i,e[38]=W):W=e[38];let G;e[39]!==u||e[40]!==i?(G=u==="self"&&t.jsx("p",{className:"text-sm text-muted-foreground",children:i("virtualMcp.subAgentsSection.canOnlyDelegateToItself")}),e[39]=u,e[40]=i,e[41]=G):G=e[41];let F;e[42]!==K||e[43]!==W||e[44]!==G?(F=t.jsxs("div",{className:"flex flex-col gap-1",children:[K,W,G]}),e[42]=K,e[43]=W,e[44]=G,e[45]=F):F=e[45];const Y=u==="selected"&&_.length>0&&t.jsxs(se,{variant:"outline",size:"sm",onClick:()=>p(!0),children:[t.jsx(Pe,{size:14}),i("virtualMcp.subAgentsSection.addSubAgent")]});let X;e[46]!==I?(X=Q=>I(Q),e[46]=I,e[47]=X):X=e[47];let T;e[48]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(Oe,{size:"sm",className:"w-auto",children:t.jsx(Ie,{})}),e[48]=T):T=e[48];let z;e[49]!==i?(z=i("virtualMcp.subAgentsSection.anyAgent"),e[49]=i,e[50]=z):z=e[50];let B;e[51]!==z?(B=t.jsx(we,{value:"all",children:z}),e[51]=z,e[52]=B):B=e[52];let P;e[53]!==i?(P=i("virtualMcp.subAgentsSection.specificAgents"),e[53]=i,e[54]=P):P=e[54];let O;e[55]!==P?(O=t.jsx(we,{value:"selected",children:P}),e[55]=P,e[56]=O):O=e[56];let ee;e[57]!==i?(ee=i("virtualMcp.subAgentsSection.onlyItself"),e[57]=i,e[58]=ee):ee=e[58];let ae;e[59]!==ee?(ae=t.jsx(we,{value:"self",children:ee}),e[59]=ee,e[60]=ae):ae=e[60];let ce;e[61]!==B||e[62]!==O||e[63]!==ae?(ce=t.jsxs(Ae,{align:"end",children:[B,O,ae]}),e[61]=B,e[62]=O,e[63]=ae,e[64]=ce):ce=e[64];let le;e[65]!==u||e[66]!==X||e[67]!==ce?(le=t.jsxs($e,{value:u,onValueChange:X,children:[T,ce]}),e[65]=u,e[66]=X,e[67]=ce,e[68]=le):le=e[68];let ie;e[69]!==Y||e[70]!==le?(ie=t.jsxs("div",{className:"flex items-center gap-2",children:[Y,le]}),e[69]=Y,e[70]=le,e[71]=ie):ie=e[71],e[72]!==F||e[73]!==ie?(S=t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[F,ie]}),e[72]=F,e[73]=ie,e[74]=S):S=e[74],j="flex flex-col gap-2",b=u==="selected"&&(_.length>0?_.map(Q=>t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 surface",children:[t.jsx(Ze,{icon:Q.icon,name:Q.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:Q.title}),Q.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:Q.description})]}),t.jsx(se,{variant:"ghost",size:"icon",onClick:()=>y(Q.id),children:t.jsx(At,{size:16})})]},Q.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 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]=r,e[7]=n,e[8]=s,e[9]=u,e[10]=l,e[11]=x,e[12]=i,e[13]=v,e[14]=y,e[15]=j,e[16]=b,e[17]=w,e[18]=S}else v=e[13],y=e[14],j=e[15],b=e[16],w=e[17],S=e[18];let M;e[75]!==j||e[76]!==b?(M=t.jsx("div",{className:j,children:b}),e[75]=j,e[76]=b,e[77]=M):M=e[77];let N;e[78]!==v||e[79]!==y||e[80]!==o||e[81]!==x?(N=t.jsx(sl,{open:o,onOpenChange:p,candidates:v,selectedIds:x,onToggle:y}),e[78]=v,e[79]=y,e[80]=o,e[81]=x,e[82]=N):N=e[82];let C;return e[83]!==w||e[84]!==S||e[85]!==M||e[86]!==N?(C=t.jsxs("section",{className:w,children:[S,M,N]}),e[83]=w,e[84]=S,e[85]=M,e[86]=N,e[87]=C):C=e[87],C}function sl(a){const e=q.c(39),{open:s,onOpenChange:n,candidates:i,selectedIds:l,onToggle:r}=a,o=Z(),[p,c]=H.useState("");let f,m,u,h,d,x,g,v,y;if(e[0]!==i||e[1]!==n||e[2]!==r||e[3]!==s||e[4]!==p||e[5]!==l||e[6]!==o){const S=p.toLowerCase(),M=i.filter(k=>k.title.toLowerCase().includes(S)||k.description?.toLowerCase().includes(S));m=Xe,v=s,y=n,f=Je,d="max-w-md";let N;e[16]!==o?(N=o("virtualMcp.subAgentsSection.title"),e[16]=o,e[17]=N):N=e[17],e[18]!==N?(x=t.jsx(at,{children:t.jsx(lt,{children:N})}),e[18]=N,e[19]=x):x=e[19];let C;e[20]!==o?(C=o("virtualMcp.subAgentsSection.searchPlaceholder"),e[20]=o,e[21]=C):C=e[21],e[22]!==p||e[23]!==C?(g=t.jsx(ki,{value:p,onChange:c,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=M.length===0?t.jsx("p",{className:"text-sm text-muted-foreground px-1 py-4 text-center",children:o("virtualMcp.subAgentsSection.noAgentsFound")}):M.map(k=>t.jsxs("button",{type:"button",onClick:()=>r(k.id),className:"flex items-center gap-3 px-2 py-2 rounded-lg hover:bg-accent transition-colors cursor-pointer w-full text-left",children:[t.jsx($s,{checked:l.includes(k.id),className:"pointer-events-none",tabIndex:-1}),t.jsx(Ze,{icon:k.icon,name:k.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:k.title}),k.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:k.description})]})]},k.id)),e[0]=i,e[1]=n,e[2]=r,e[3]=s,e[4]=p,e[5]=l,e[6]=o,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 w;return e[34]!==m||e[35]!==v||e[36]!==y||e[37]!==b?(w=t.jsx(m,{open:v,onOpenChange:y,children:b}),e[34]=m,e[35]=v,e[36]=y,e[37]=b,e[38]=w):w=e[38],w}function st(){const a=q.c(1);let e;return a[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"})}),a[0]=e):e=a[0],e}function ct(a,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:a})}):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(Ss,{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 Zs(a){const e=q.c(23),{item:s,isSelected:n,onToggle:i,disabled:l}=a,r=l?"cursor-not-allowed opacity-50":"cursor-pointer",o=n?"bg-accent/25":"hover:bg-accent";let p;e[0]!==r||e[1]!==o?(p=ve("flex items-start gap-3 p-4 rounded-lg transition-colors",r,o),e[0]=r,e[1]=o,e[2]=p):p=e[2];let c;e[3]!==s.name?(c=t.jsx("p",{className:"text-sm font-medium leading-none truncate",children:s.name}),e[3]=s.name,e[4]=c):c=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]!==c||e[8]!==f?(m=t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[c,f]}),e[7]=c,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]!==l||e[16]!==n||e[17]!==i?(d=t.jsx($s,{checked:n,onCheckedChange:i,disabled:l,className:"mt-0.5"}),e[15]=l,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 nl(a){const e=q.c(35),{activeTab:s,onTabChange:n,showSelectAll:i,isAllSelected:l,handleSelectAll:r}=a,o=Z();let p;e[0]!==o?(p=o("virtualMcp.dependencySelectionDialog.tabTools"),e[0]=o,e[1]=p):p=e[1];let c;e[2]!==p?(c={id:"tools",label:p},e[2]=p,e[3]=c):c=e[3];let f;e[4]!==o?(f=o("virtualMcp.dependencySelectionDialog.tabActive"),e[4]=o,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]!==o?(u=o("virtualMcp.dependencySelectionDialog.tabResources"),e[8]=o,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]!==o?(d=o("virtualMcp.dependencySelectionDialog.tabPrompts"),e[12]=o,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]!==c||e[17]!==m||e[18]!==h||e[19]!==x?(g=[c,m,h,x],e[16]=c,e[17]=m,e[18]=h,e[19]=x,e[20]=g):g=e[20];let v;e[21]!==n?(v=w=>n(w),e[21]=n,e[22]=v):v=e[22];let y;e[23]!==s||e[24]!==v||e[25]!==g?(y=t.jsx(Mi,{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]!==r||e[28]!==l||e[29]!==i||e[30]!==o?(j=i&&t.jsx("button",{type:"button",onClick:r,className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:o(l?"virtualMcp.dependencySelectionDialog.deselectAll":"virtualMcp.dependencySelectionDialog.selectAll")}),e[27]=r,e[28]=l,e[29]=i,e[30]=o,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(a){const e=q.c(13),{items:s,selections:n,onToggle:i,emptyMessage:l,disabled:r}=a;let o,p,c;if(e[0]!==r||e[1]!==l||e[2]!==s||e[3]!==i||e[4]!==n){c=Symbol.for("react.early_return_sentinel");e:{const m=s.map(il);if(s.length===0){let u;e[8]!==l?(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:l})}),e[8]=l,e[9]=u):u=e[9],c=u;break e}o="flex-1 overflow-auto px-4 py-3 space-y-1",p=s.map(u=>t.jsx(Zs,{item:u,isSelected:n===null||n?.includes(u.id),onToggle:()=>i(u.id,m),disabled:r},u.id))}e[0]=r,e[1]=l,e[2]=s,e[3]=i,e[4]=n,e[5]=o,e[6]=p,e[7]=c}else o=e[5],p=e[6],c=e[7];if(c!==Symbol.for("react.early_return_sentinel"))return c;let f;return e[10]!==o||e[11]!==p?(f=t.jsx("div",{className:o,children:p}),e[10]=o,e[11]=p,e[12]=f):f=e[12],f}function il(a){return a.id}function al(a){const e=q.c(22),{connectionId:s,toolSelections:n,onToggleTool:i}=a,l=Z(),{org:r}=Fe();let o;e[0]!==s||e[1]!==r.id||e[2]!==r.slug?(o={connectionId:s,orgId:r.id,orgSlug:r.slug},e[0]=s,e[1]=r.id,e[2]=r.slug,e[3]=o):o=e[3];const p=pt(o);let c;e[4]!==p?(c={client:p},e[4]=p,e[5]=c):c=e[5];const{data:f}=zs(c),m=f.tools;let u,h,d;if(e[6]!==f.tools||e[7]!==i||e[8]!==l||e[9]!==n){d=Symbol.for("react.early_return_sentinel");e:{const g=m.map(rl);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(ll);if(j.length===0){let b;e[15]!==l?(b=l("virtualMcp.dependencySelectionDialog.noActiveToolsSelected"),e[15]=l,e[16]=b):b=e[16];let w;e[17]!==b?(w=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]=w):w=e[18],d=w;break e}u="flex-1 overflow-auto px-4 py-3 space-y-1",h=j.map(b=>t.jsx(Zs,{item:b,isSelected:!0,onToggle:()=>i(b.id,g)},b.id))}e[6]=f.tools,e[7]=i,e[8]=l,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 ll(a){return{id:a.name,name:a.name,description:a.description,tags:t.jsx(Fs,{annotations:a.annotations,_meta:a._meta})}}function rl(a){return a.name}function ol(a){const e=q.c(16),{connectionId:s,selections:n,onToggle:i,disabled:l}=a,{org:r}=Fe();let o;e[0]!==s||e[1]!==r.id||e[2]!==r.slug?(o={connectionId:s,orgId:r.id,orgSlug:r.slug},e[0]=s,e[1]=r.id,e[2]=r.slug,e[3]=o):o=e[3];const p=pt(o);let c;e[4]!==p?(c={client:p},e[4]=p,e[5]=c):c=e[5];const{data:f}=zs(c);let m;e[6]!==f.tools?(m=f.tools.map(cl),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]!==l||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:l}),e[10]=l,e[11]=u,e[12]=i,e[13]=n,e[14]=d,e[15]=x):x=e[15],x}function cl(a){return{id:a.name,name:a.name,description:a.description,tags:t.jsx(Fs,{annotations:a.annotations,_meta:a._meta})}}function dl(a){const e=q.c(16),{connectionId:s,selections:n,onToggle:i,disabled:l}=a,{org:r}=Fe();let o;e[0]!==s||e[1]!==r.id||e[2]!==r.slug?(o={connectionId:s,orgId:r.id,orgSlug:r.slug},e[0]=s,e[1]=r.id,e[2]=r.slug,e[3]=o):o=e[3];const p=pt(o);let c;e[4]!==p?(c={client:p},e[4]=p,e[5]=c):c=e[5];const{data:f}=on(c);let m;e[6]!==f.resources?(m=f.resources.map(ul),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]!==l||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:l}),e[10]=l,e[11]=u,e[12]=i,e[13]=n,e[14]=d,e[15]=x):x=e[15],x}function ul(a){return{id:a.name||a.uri,name:a.name||a.uri,description:a.description}}function ml(a){const e=q.c(16),{connectionId:s,selections:n,onToggle:i,disabled:l}=a,{org:r}=Fe();let o;e[0]!==s||e[1]!==r.id||e[2]!==r.slug?(o={connectionId:s,orgId:r.id,orgSlug:r.slug},e[0]=s,e[1]=r.id,e[2]=r.slug,e[3]=o):o=e[3];const p=pt(o);let c;e[4]!==p?(c={client:p},e[4]=p,e[5]=c):c=e[5];const{data:f}=_i(c);let m;e[6]!==f.prompts?(m=f.prompts.map(fl),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]!==l||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:l}),e[10]=l,e[11]=u,e[12]=i,e[13]=n,e[14]=d,e[15]=x):x=e[15],x}function fl(a){return{id:a.name,name:a.name,description:a.description}}function pl(a){const e=q.c(58),{currentConnection:s,activeTab:n,selectedId:i,formData:l,toggleTool:r,toggleResource:o,togglePrompt:p,toggleAllTools:c,toggleAllResources:f,toggleAllPrompts:m,onTabChange:u}=a,h=Z(),d=l[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]!==c?(v=()=>{n==="tools"?c(i):n==="resources"?f(i):n==="prompts"&&m(i)},e[0]=n,e[1]=i,e[2]=m,e[3]=f,e[4]=c,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 w;e[11]!==s.description?(w=s.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s.description}),e[11]=s.description,e[12]=w):w=e[12];let S;e[13]!==b||e[14]!==w?(S=t.jsxs("div",{className:"flex-1 min-w-0",children:[b,w]}),e[13]=b,e[14]=w,e[15]=S):S=e[15];let M;e[16]!==j||e[17]!==S?(M=t.jsx("div",{className:"px-6 pt-5 pb-4 shrink-0",children:t.jsxs("div",{className:"flex items-center gap-3",children:[j,S]})}),e[16]=j,e[17]=S,e[18]=M):M=e[18];let N;e[19]!==n||e[20]!==y||e[21]!==x||e[22]!==u||e[23]!==g?(N=t.jsx(nl,{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]=N):N=e[24];let C;e[25]!==n||e[26]!==l||e[27]!==i||e[28]!==h||e[29]!==r?(C=n==="active"&&t.jsx(Ye,{fallback:ct(h("virtualMcp.dependencySelectionDialog.toolsNotSupported"),h),children:t.jsx(H.Suspense,{fallback:t.jsx(st,{}),children:t.jsx(al,{connectionId:i,toolSelections:l[i]?l[i].tools:[],onToggleTool:($,I)=>r(i,$,I)})})}),e[25]=n,e[26]=l,e[27]=i,e[28]=h,e[29]=r,e[30]=C):C=e[30];let k;e[31]!==n||e[32]!==l||e[33]!==i||e[34]!==h||e[35]!==r?(k=n==="tools"&&t.jsx(Ye,{fallback:ct(h("virtualMcp.dependencySelectionDialog.toolsNotSupported"),h),children:t.jsx(H.Suspense,{fallback:t.jsx(st,{}),children:t.jsx(ol,{connectionId:i,selections:l[i]?l[i].tools:[],onToggle:($,I)=>r(i,$,I)})})}),e[31]=n,e[32]=l,e[33]=i,e[34]=h,e[35]=r,e[36]=k):k=e[36];let V;e[37]!==n||e[38]!==l||e[39]!==i||e[40]!==h||e[41]!==o?(V=n==="resources"&&t.jsx(Ye,{fallback:ct(h("virtualMcp.dependencySelectionDialog.resourcesNotSupported"),h),children:t.jsx(H.Suspense,{fallback:t.jsx(st,{}),children:t.jsx(dl,{connectionId:i,selections:l[i]?l[i].resources:[],onToggle:($,I)=>o(i,$,I)})})}),e[37]=n,e[38]=l,e[39]=i,e[40]=h,e[41]=o,e[42]=V):V=e[42];let _;e[43]!==n||e[44]!==l||e[45]!==i||e[46]!==h||e[47]!==p?(_=n==="prompts"&&t.jsx(Ye,{fallback:ct(h("virtualMcp.dependencySelectionDialog.promptsNotSupported"),h),children:t.jsx(H.Suspense,{fallback:t.jsx(st,{}),children:t.jsx(ml,{connectionId:i,selections:l[i]?l[i].prompts:[],onToggle:($,I)=>p(i,$,I)})})}),e[43]=n,e[44]=l,e[45]=i,e[46]=h,e[47]=p,e[48]=_):_=e[48];let E;e[49]!==V||e[50]!==_||e[51]!==C||e[52]!==k?(E=t.jsxs("div",{className:"flex-1 overflow-hidden flex flex-col",children:[C,k,V,_]}),e[49]=V,e[50]=_,e[51]=C,e[52]=k,e[53]=E):E=e[53];let D;return e[54]!==E||e[55]!==M||e[56]!==N?(D=t.jsxs(t.Fragment,{children:[M,N,E]}),e[54]=E,e[55]=M,e[56]=N,e[57]=D):D=e[57],D}function hl(a){const e=q.c(7),{onClose:s}=a,n=Z();let i;e[0]!==s?(i=()=>s(!1),e[0]=s,e[1]=i):i=e[1];let l;e[2]!==n?(l=n("virtualMcp.dependencySelectionDialog.done"),e[2]=n,e[3]=l):l=e[3];let r;return e[4]!==i||e[5]!==l?(r=t.jsx(Vt,{className:"px-6 py-4 border-t border-border shrink-0",children:t.jsx(se,{variant:"outline",onClick:i,children:l})}),e[4]=i,e[5]=l,e[6]=r):r=e[6],r}function xl(a){const e=q.c(23),{connectionId:s,onAuthenticate:n,children:i}=a,l=Z();let r;e[0]!==s?(r={connectionId:s},e[0]=s,e[1]=r):r=e[1];const o=Es(r);if(o.supportsOAuth&&!o.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(Zn,{size:22,className:"text-muted-foreground"})}),e[2]=f):f=e[2];let m;e[3]!==l?(m=l("virtualMcp.dependencySelectionDialog.authorizationRequired"),e[3]=l,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]!==l?(h=l("virtualMcp.dependencySelectionDialog.authorizationDescription"),e[7]=l,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]!==l?(g=n&&t.jsx(se,{variant:"outline",size:"sm",onClick:()=>n(s),children:l("virtualMcp.dependencySelectionDialog.authorize")}),e[14]=s,e[15]=n,e[16]=l,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 c;return e[21]!==i?(c=t.jsx(t.Fragment,{children:i}),e[21]=i,e[22]=c):c=e[22],c}function gl(a){const e={};for(const s of a)e[s.connection_id]={tools:s.selected_tools,resources:s.selected_resources??null,prompts:s.selected_prompts??null};return e}function ds(a){return Object.entries(a).map(([e,s])=>({connection_id:e,selected_tools:s.tools,selected_resources:s.resources,selected_prompts:s.prompts}))}function us(a,e,s,n){const i=a[e]??{tools:null,resources:null,prompts:null};return{...a,[e]:{...i,[s]:n}}}function vl(a,e){return e.type==="SET_ACTIVE_TAB"?{...a,activeTab:e.payload}:a}function bl(a){const e=q.c(49),{open:s,onOpenChange:n,selectedId:i,form:l,connections:r,onAuthenticate:o}=a;let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p={activeTab:"tools"},e[0]=p):p=e[0];const[c,f]=H.useReducer(vl,p),m=Ot(i??"");let u;e[1]!==r?(u=r??[],e[1]=r,e[2]=u):u=e[2];let h;e[3]!==u?(h=gl(u),e[3]=u,e[4]=h):h=e[4];const d=h;let x;e[5]!==l||e[6]!==d?(x=(F,Y,X,T)=>{const z=d[F]?.[Y];let B;z===null?B=T.filter(P=>P!==X):z?.includes(X)?B=z.filter(P=>P!==X):(B=[...z??[],X],B.length===T.length&&(B=null)),l.setValue("connections",ds(us(d,F,Y,B)),{shouldDirty:!0,shouldTouch:!0})},e[5]=l,e[6]=d,e[7]=x):x=e[7];const g=x;let v;e[8]!==l||e[9]!==d?(v=(F,Y)=>{const T=d[F]?.[Y]===null?[]:null;l.setValue("connections",ds(us(d,F,Y,T)),{shouldDirty:!0,shouldTouch:!0})},e[8]=l,e[9]=d,e[10]=v):v=e[10];const y=v;let j;e[11]!==g?(j=(F,Y,X)=>g(F,"tools",Y,X),e[11]=g,e[12]=j):j=e[12];const b=j;let w;e[13]!==g?(w=(F,Y,X)=>g(F,"resources",Y,X),e[13]=g,e[14]=w):w=e[14];const S=w;let M;e[15]!==g?(M=(F,Y,X)=>g(F,"prompts",Y,X),e[15]=g,e[16]=M):M=e[16];const N=M;let C;e[17]!==y?(C=F=>y(F,"tools"),e[17]=y,e[18]=C):C=e[18];const k=C;let V;e[19]!==y?(V=F=>y(F,"resources"),e[19]=y,e[20]=V):V=e[20];const _=V;let E;e[21]!==y?(E=F=>y(F,"prompts"),e[21]=y,e[22]=E):E=e[22];const D=E;if(!i||!m)return null;let $;e[23]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(st,{}),e[23]=$):$=e[23];let I;e[24]===Symbol.for("react.memo_cache_sentinel")?(I=F=>f({type:"SET_ACTIVE_TAB",payload:F}),e[24]=I):I=e[24];let L;e[25]!==m||e[26]!==c.activeTab||e[27]!==d||e[28]!==i||e[29]!==D||e[30]!==_||e[31]!==k||e[32]!==N||e[33]!==S||e[34]!==b?(L=t.jsx(pl,{currentConnection:m,activeTab:c.activeTab,selectedId:i,formData:d,toggleTool:b,toggleResource:S,togglePrompt:N,toggleAllTools:k,toggleAllResources:_,toggleAllPrompts:D,onTabChange:I},i),e[25]=m,e[26]=c.activeTab,e[27]=d,e[28]=i,e[29]=D,e[30]=_,e[31]=k,e[32]=N,e[33]=S,e[34]=b,e[35]=L):L=e[35];let U;e[36]!==o||e[37]!==i||e[38]!==L?(U=t.jsx(H.Suspense,{fallback:$,children:t.jsx(xl,{connectionId:i,onAuthenticate:o,children:L})}),e[36]=o,e[37]=i,e[38]=L,e[39]=U):U=e[39];let K;e[40]!==n?(K=t.jsx(hl,{onClose:n}),e[40]=n,e[41]=K):K=e[41];let W;e[42]!==U||e[43]!==K?(W=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]=W):W=e[44];let G;return e[45]!==n||e[46]!==s||e[47]!==W?(G=t.jsx(Xe,{open:s,onOpenChange:n,children:W}),e[45]=n,e[46]=s,e[47]=W,e[48]=G):G=e[48],G}const ms="__new_instance__";function jl(a){const e=q.c(25),{connection_id:s,usedConnectionIds:n,onOpenSettings:i,onRemove:l,onAuthenticate:r,onSwitchInstance:o,onNewInstance:p}=a,c=Ot(s),{org:f}=Fe();if(!c){let g;return e[0]!==l?(g=t.jsx(Nl,{onRemove:l}),e[0]=l,e[1]=g):g=e[1],g}let m;e[2]!==c?(m=Vi(c),e[2]=c,e[3]=m):m=e[3];const u=m;let h;e[4]!==s?(h=t.jsx(Sl,{connection_id:s}),e[4]=s,e[5]=h):h=e[5];let d;e[6]!==c.app_name||e[7]!==c.connection_type||e[8]!==c.description||e[9]!==c.icon||e[10]!==c.status||e[11]!==c.title||e[12]!==s||e[13]!==r||e[14]!==p||e[15]!==i||e[16]!==l||e[17]!==o||e[18]!==f.slug||e[19]!==u||e[20]!==n?(d=t.jsx(wl,{connection_id:s,connectionTitle:c.title,connectionDescription:c.description,connectionIcon:c.icon,connectionType:c.connection_type,connectionStatus:c.status,slug:u,orgSlug:f.slug,appName:c.app_name,usedConnectionIds:n,onOpenSettings:i,onRemove:l,onAuthenticate:r,onSwitchInstance:o,onNewInstance:p}),e[6]=c.app_name,e[7]=c.connection_type,e[8]=c.description,e[9]=c.icon,e[10]=c.status,e[11]=c.title,e[12]=s,e[13]=r,e[14]=p,e[15]=i,e[16]=l,e[17]=o,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(H.Suspense,{fallback:h,children:d}),e[22]=h,e[23]=d,e[24]=x):x=e[24],x}function yl(a){const e=q.c(24),{appName:s,connectionId:n,usedConnectionIds:i,onSwitchInstance:l,onNewInstance:r}=a,o=Z();let p;e[0]!==s?(p={filters:[{column:"app_name",value:s}]},e[0]=s,e[1]=p):p=e[1];const c=Gn(p);if(c.length<=1&&!r)return null;let f;e[2]!==n||e[3]!==r||e[4]!==l?(f=g=>{g===ms?r?.():l(n,g)},e[2]=n,e[3]=r,e[4]=l,e[5]=f):f=e[5];let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(Oe,{size:"xs",className:"w-auto gap-1 shadow-none",children:t.jsx(Ie,{})}),e[6]=m):m=e[6];let u;if(e[7]!==n||e[8]!==c||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=c.map(g),e[7]=n,e[8]=c,e[9]=i,e[10]=u}else u=e[10];let h;e[14]!==r||e[15]!==o?(h=r&&t.jsxs(we,{value:ms,className:"text-xs text-muted-foreground",children:["+ ",o("virtualMcp.connectionItem.newInstance")]}),e[14]=r,e[15]=o,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 wl({connection_id:a,connectionTitle:e,connectionDescription:s,connectionIcon:n,connectionType:i,connectionStatus:l,slug:r,orgSlug:o,appName:p,usedConnectionIds:c,onOpenSettings:f,onRemove:m,onAuthenticate:u,onSwitchInstance:h,onNewInstance:d}){const x=Es({connectionId:a}),g=Vs(),y=!(i==="VIRTUAL")&&x.supportsOAuth&&!x.isAuthenticated,j=l!=="active",b=Z(),w=async S=>{try{await g.update.mutateAsync({id:a,data:{status:S}}),oe.success(b(S==="active"?"virtualMcp.connectionItem.connectionEnabled":"virtualMcp.connectionItem.connectionDisabled"))}catch{oe.error(b("virtualMcp.connectionItem.failedToUpdateConnection"))}};return t.jsxs("div",{className:ve("surface overflow-hidden transition-colors",(y||j)&&"shadow-edge-destructive bg-destructive/5"),children:[t.jsxs(Ns,{to:"/$org/settings/connections/$appSlug",params:{org:o,appSlug:r},className:"flex items-center gap-3 px-4 py-3 cursor-pointer hover:bg-accent 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(l==="error"?"virtualMcp.connectionItem.disabledError":"virtualMcp.connectionItem.disabled")}):s&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s})]}),y?t.jsx(se,{variant:"outline",size:"sm",className:"shrink-0",onClick:S=>{S.preventDefault(),S.stopPropagation(),u(a)},children:b("virtualMcp.connectionItem.authorize")}):j?t.jsxs(se,{variant:"outline",size:"sm",className:"gap-1.5 shrink-0",onClick:S=>{S.preventDefault(),S.stopPropagation(),w("active")},children:[t.jsx(ei,{size:13}),b("virtualMcp.connectionItem.enable")]}):t.jsxs(Ne,{delayDuration:0,children:[t.jsx(Ce,{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(ji,{size:16})})}),t.jsx(ke,{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(yl,{appName:p,connectionId:a,usedConnectionIds:c,onSwitchInstance:h,onNewInstance:d}),t.jsxs("div",{className:"flex items-center gap-0.5 ml-auto",children:[t.jsxs(Ne,{delayDuration:0,children:[t.jsx(Ce,{asChild:!0,children:t.jsx(se,{variant:"ghost",size:"icon-sm",onClick:f,"aria-label":b("virtualMcp.connectionItem.configureResources"),children:t.jsx(ti,{size:13})})}),t.jsx(ke,{side:"bottom",children:b("virtualMcp.connectionItem.configureResources")})]}),!j&&t.jsxs(Ne,{delayDuration:0,children:[t.jsx(Ce,{asChild:!0,children:t.jsx(se,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground",onClick:()=>w("inactive"),"aria-label":b("virtualMcp.connectionItem.disableConnection"),children:t.jsx(si,{size:13})})}),t.jsx(ke,{side:"bottom",children:b("virtualMcp.connectionItem.disable")})]}),t.jsxs(Ne,{delayDuration:0,children:[t.jsx(Ce,{asChild:!0,children:t.jsx(se,{variant:"ghost-destructive",size:"icon-sm",onClick:m,"aria-label":b("virtualMcp.connectionItem.removeConnection"),children:t.jsx(At,{size:13})})}),t.jsx(ke,{side:"bottom",children:b("virtualMcp.connectionItem.remove")})]})]})]})]})}function Sl(a){const e=q.c(17),{connection_id:s}=a,n=Ot(s);if(!n){let m;return e[0]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(en,{}),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 l;e[4]!==n.title?(l=t.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[4]=n.title,e[5]=l):l=e[5];let r;e[6]!==n.description?(r=n.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:n.description}),e[6]=n.description,e[7]=r):r=e[7];let o;e[8]!==l||e[9]!==r?(o=t.jsxs("div",{className:"flex-1 min-w-0",children:[l,r]}),e[8]=l,e[9]=r,e[10]=o):o=e[10];let p;e[11]!==i||e[12]!==o?(p=t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",children:[i,o]}),e[11]=i,e[12]=o,e[13]=p):p=e[13];let c;e[14]===Symbol.for("react.memo_cache_sentinel")?(c=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]=c):c=e[14];let f;return e[15]!==p?(f=t.jsxs("div",{className:"surface overflow-hidden",children:[p,c]}),e[15]=p,e[16]=f):f=e[16],f}function Nl(a){const e=q.c(20),{onRemove:s}=a,n=Z();let i;e[0]!==n?(i=n("virtualMcp.connectionItem.connectionNotFound"),e[0]=n,e[1]=i):i=e[1];let l;e[2]!==i?(l=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]=l):l=e[3];let r;e[4]!==n?(r=n("virtualMcp.connectionItem.removeConnection"),e[4]=n,e[5]=r):r=e[5];let o;e[6]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(At,{size:13}),e[6]=o):o=e[6];let p;e[7]!==s||e[8]!==r?(p=t.jsx(Ce,{asChild:!0,children:t.jsx(se,{variant:"ghost-destructive",size:"icon-sm",className:"shrink-0",onClick:s,"aria-label":r,children:o})}),e[7]=s,e[8]=r,e[9]=p):p=e[9];let c;e[10]!==n?(c=n("virtualMcp.connectionItem.remove"),e[10]=n,e[11]=c):c=e[11];let f;e[12]!==c?(f=t.jsx(ke,{side:"bottom",children:c}),e[12]=c,e[13]=f):f=e[13];let m;e[14]!==p||e[15]!==f?(m=t.jsxs(Ne,{delayDuration:0,children:[p,f]}),e[14]=p,e[15]=f,e[16]=m):m=e[16];let u;return e[17]!==l||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:[l,m]}),e[17]=l,e[18]=m,e[19]=u):u=e[19],u}function en(){const a=q.c(3);let e;a[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"size-8 rounded-md bg-muted animate-pulse shrink-0"}),a[0]=e):e=a[0];let s;a[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"})]})]}),a[1]=s):s=a[1];let n;return a[2]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsxs("div",{className:"surface 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"})})]}),a[2]=n):n=a[2],n}function tn(a){const e=q.c(85),{value:s,onChange:n,onColorChange:i,name:l,size:r,className:o,avatarClassName:p,showHoverOverlay:c,disabled:f}=a,m=r===void 0?"lg":r,u=c===void 0?!0:c,h=f===void 0?!1:f,d=Z(),[x,g]=H.useState(!1),[v,y]=H.useState("icons"),[j,b]=H.useState(""),[w,S]=H.useState("blue");let M;e[0]!==s?(M=ni(s),e[0]=s,e[1]=M):M=e[1];const N=M,C=N.type==="icon"||N.type==="url"&&N.color?N.color:w;let k;e[2]!==n||e[3]!==C?(k=te=>{n(jt(te,C))},e[2]=n,e[3]=C,e[4]=k):k=e[4];const V=k;let _;e[5]!==n||e[6]!==i||e[7]!==N.name||e[8]!==N.type||e[9]!==N.url?(_=te=>{S(te),i?.(te),N.type==="icon"?n(jt(N.name,te)):N.type==="url"&&n(qt(N.url,te))},e[5]=n,e[6]=i,e[7]=N.name,e[8]=N.type,e[9]=N.url,e[10]=_):_=e[10];const E=_;let D;e[11]!==n||e[12]!==C?(D=te=>{n(qt(te,C)),g(!1)},e[11]=n,e[12]=C,e[13]=D):D=e[13];const $=D;let I;e[14]!==n||e[15]!==C?(I=()=>{const te=Ps(),J=te[Math.floor(Math.random()*te.length)];n(jt(J,C))},e[14]=n,e[15]=C,e[16]=I):I=e[16];const L=I,U=h?!1:x;let K;e[17]!==d?(K=d("common.iconPicker.changeIcon"),e[17]=d,e[18]=K):K=e[18];const W=h?"cursor-default opacity-50":"cursor-pointer";let G;e[19]!==o||e[20]!==m||e[21]!==W?(G=ve("relative group overflow-hidden",W,ii(m),o),e[19]=o,e[20]=m,e[21]=W,e[22]=G):G=e[22];let F;e[23]!==p||e[24]!==l||e[25]!==m||e[26]!==s?(F=t.jsx(Ht,{icon:s,name:l,size:m,className:p}),e[23]=p,e[24]=l,e[25]=m,e[26]=s,e[27]=F):F=e[27];let Y;e[28]!==h||e[29]!==u?(Y=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(oi,{size:16,className:"text-white"})}),e[28]=h,e[29]=u,e[30]=Y):Y=e[30];let X;e[31]!==h||e[32]!==K||e[33]!==G||e[34]!==F||e[35]!==Y?(X=t.jsx(Rs,{asChild:!0,children:t.jsxs("button",{type:"button","data-testid":"icon-picker-trigger","aria-label":K,disabled:h,className:G,children:[F,Y]})}),e[31]=h,e[32]=K,e[33]=G,e[34]=F,e[35]=Y,e[36]=X):X=e[36];let T;e[37]!==l||e[38]!==s?(T=t.jsx("div",{className:"flex items-center justify-center py-4",children:t.jsx(Ht,{icon:s,name:l,size:"xl"})}),e[37]=l,e[38]=s,e[39]=T):T=e[39];let z;e[40]!==v?(z=te=>{if(te.key!=="ArrowLeft"&&te.key!=="ArrowRight")return;te.preventDefault();const J=v==="icons"?"upload":"icons";y(J),document.getElementById(`icon-picker-tab-${J}`)?.focus()},e[40]=v,e[41]=z):z=e[41];const B=v==="icons",P=v==="icons"?0:-1;let O;e[42]===Symbol.for("react.memo_cache_sentinel")?(O=()=>y("icons"),e[42]=O):O=e[42];const ee=v==="icons"?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground";let ae;e[43]!==ee?(ae=ve("px-3 py-2 text-sm font-medium border-b-2 -mb-px transition-colors",ee),e[43]=ee,e[44]=ae):ae=e[44];let ce;e[45]!==d?(ce=d("common.iconPicker.iconsTab"),e[45]=d,e[46]=ce):ce=e[46];let le;e[47]!==B||e[48]!==P||e[49]!==ae||e[50]!==ce?(le=t.jsx("button",{id:"icon-picker-tab-icons",type:"button",role:"tab","aria-selected":B,"aria-controls":"icon-picker-panel-icons",tabIndex:P,onClick:O,className:ae,children:ce}),e[47]=B,e[48]=P,e[49]=ae,e[50]=ce,e[51]=le):le=e[51];const ie=v==="upload",Q=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]!==Q||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:Q,onClick:de,className:he,children:me}),e[57]=ie,e[58]=Q,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]!==z||e[64]!==le||e[65]!==xe?(fe=t.jsxs("div",{role:"tablist","aria-label":"Icon source",className:"flex items-center border-b border-border px-3",onKeyDown:z,children:[le,xe,ge]}),e[63]=z,e[64]=le,e[65]=xe,e[66]=fe):fe=e[66];let A;e[67]!==E||e[68]!==L||e[69]!==V||e[70]!==$||e[71]!==N.name||e[72]!==N.type||e[73]!==j||e[74]!==C||e[75]!==v?(A=v==="icons"?t.jsx("div",{id:"icon-picker-panel-icons",role:"tabpanel","aria-labelledby":"icon-picker-tab-icons",children:t.jsx(_l,{search:j,onSearchChange:b,selectedColor:C,onColorChange:E,onSelectIcon:V,onRandom:L,currentIconName:N.type==="icon"?N.name:null})}):t.jsx("div",{id:"icon-picker-panel-upload",role:"tabpanel","aria-labelledby":"icon-picker-tab-upload",children:t.jsx(Vl,{onUpload:$})}),e[67]=E,e[68]=L,e[69]=V,e[70]=$,e[71]=N.name,e[72]=N.type,e[73]=j,e[74]=C,e[75]=v,e[76]=A):A=e[76];let ne;e[77]!==T||e[78]!==fe||e[79]!==A?(ne=t.jsx(Ls,{align:"start",className:"w-80 p-0",onOpenAutoFocus:Cl,children:t.jsxs("div",{className:"flex flex-col",children:[T,fe,A]})}),e[77]=T,e[78]=fe,e[79]=A,e[80]=ne):ne=e[80];let R;return e[81]!==X||e[82]!==ne||e[83]!==U?(R=t.jsxs(Us,{open:U,onOpenChange:g,children:[X,ne]}),e[81]=X,e[82]=ne,e[83]=U,e[84]=R):R=e[84],R}function Cl(a){return a.preventDefault()}function kl(a){const e=q.c(33),{selectedColor:s,onColorChange:n}=a,i=Z(),[l,r]=H.useState(!1);let o,p,c,f,m,u,h;if(e[0]!==l||e[1]!==s){const w=Os(s);p=Us,u=l,h=r,o=Rs,m=!0,c="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",w.dot,"ring-foreground/20"),e[0]=l,e[1]=s,e[2]=o,e[3]=p,e[4]=c,e[5]=f,e[6]=m,e[7]=u,e[8]=h}else o=e[2],p=e[3],c=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]!==c||e[14]!==f||e[15]!==d||e[16]!==x?(g=t.jsx("button",{type:c,className:f,title:d,"aria-label":x}),e[13]=c,e[14]=f,e[15]=d,e[16]=x,e[17]=g):g=e[17];let v;e[18]!==o||e[19]!==m||e[20]!==g?(v=t.jsx(o,{asChild:m,children:g}),e[18]=o,e[19]=m,e[20]=g,e[21]=v):v=e[21];let y;e[22]!==n||e[23]!==s?(y=di.map(w=>t.jsx("button",{type:"button",onClick:()=>{n(w.name),r(!1)},className:ve("h-5 w-5 rounded-full transition-all shrink-0 cursor-pointer",w.dot,s===w.name?"ring-2 ring-offset-1 ring-offset-background ring-foreground/30 scale-110":"hover:scale-110"),title:w.name,"aria-label":w.name},w.name)),e[22]=n,e[23]=s,e[24]=y):y=e[24];let j;e[25]!==y?(j=t.jsx(Ls,{align:"start",side:"right",sideOffset:8,className:"w-auto p-2",onOpenAutoFocus:Ml,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 Ml(a){return a.preventDefault()}function _l(a){const e=q.c(55),{search:s,onSearchChange:n,selectedColor:i,onColorChange:l,onSelectIcon:r,onRandom:o,currentIconName:p}=a,c=Z();let f,m,u,h,d,x,g;if(e[0]!==p||e[1]!==l||e[2]!==o||e[3]!==n||e[4]!==r||e[5]!==s||e[6]!==i||e[7]!==c){const w=Ps(),S=Os(i);m=ai(w,s),x="flex flex-col";let M;e[15]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsx(Ct,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none"}),e[15]=M):M=e[15];let N;e[16]!==n?(N=I=>n(I.target.value),e[16]=n,e[17]=N):N=e[17];let C;e[18]!==c?(C=c("common.iconPicker.filterPlaceholder"),e[18]=c,e[19]=C):C=e[19];let k;e[20]!==s||e[21]!==N||e[22]!==C?(k=t.jsxs("div",{className:"relative flex-1",children:[M,t.jsx(Me,{value:s,onChange:N,placeholder:C,size:"sm",className:"text-xs pl-7"})]}),e[20]=s,e[21]=N,e[22]=C,e[23]=k):k=e[23];let V;e[24]!==c?(V=c("common.iconPicker.randomIcon"),e[24]=c,e[25]=V):V=e[25];let _;e[26]!==c?(_=c("common.iconPicker.randomIcon"),e[26]=c,e[27]=_):_=e[27];let E;e[28]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(ci,{className:"size-3.5 text-muted-foreground"}),e[28]=E):E=e[28];let D;e[29]!==o||e[30]!==V||e[31]!==_?(D=t.jsx(se,{type:"button",variant:"outline",size:"icon",onClick:o,className:"shrink-0",title:V,"aria-label":_,children:E}),e[29]=o,e[30]=V,e[31]=_,e[32]=D):D=e[32];let $;e[33]!==l||e[34]!==i?($=t.jsx(kl,{selectedColor:i,onColorChange:l}),e[33]=l,e[34]=i,e[35]=$):$=e[35],e[36]!==D||e[37]!==$||e[38]!==k?(g=t.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",children:[k,D,$]}),e[36]=D,e[37]=$,e[38]=k,e[39]=g):g=e[39],f=Ti,d="h-56",u="grid grid-cols-9 gap-0.5 px-2 pb-2",h=m.map(I=>{const L=li(I);return L?t.jsx("button",{type:"button",onClick:()=>r(I),className:ve("h-8 w-8 flex items-center justify-center rounded-lg transition-colors cursor-pointer",p===I?ve(S.bg,S.text):ve(S.text,"hover:bg-accent")),title:I,"aria-label":ri(I),children:t.jsx(L,{size:18})},I):null}),e[0]=p,e[1]=l,e[2]=o,e[3]=n,e[4]=r,e[5]=s,e[6]=i,e[7]=c,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]!==c?(y=m.length===0&&t.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:c("common.iconPicker.noIconsFound")}),e[43]=m.length,e[44]=c,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 Vl(a){const e=q.c(46),{onUpload:s}=a,n=Z(),i=H.useRef(null);let l;e[0]!==s||e[1]!==n?(l=D=>{const $=D.target.files?.[0];if(!$)return;if($.size>2097152){oe.error(n("common.iconPicker.imageTooLarge")),D.target.value="";return}const I=new FileReader;I.onerror=()=>{oe.error(n("common.iconPicker.failedToReadImage")),i.current&&(i.current.value="")},I.onloadend=()=>{I.readyState===FileReader.DONE&&I.result&&s(I.result),i.current&&(i.current.value="")},I.readAsDataURL($)},e[0]=s,e[1]=n,e[2]=l):l=e[2];const r=l,[o,p]=H.useState("");let c;e[3]!==s||e[4]!==o?(c=()=>{const D=o.trim();D&&(s(D),p(""))},e[3]=s,e[4]=o,e[5]=c):c=e[5];const f=c;let m;e[6]!==r?(m=t.jsx("input",{type:"file",ref:i,className:"hidden",accept:"image/*",onChange:r}),e[6]=r,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(Di,{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 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 w;e[22]!==n?(w=n("common.iconPicker.pasteUrlPlaceholder"),e[22]=n,e[23]=w):w=e[23];let S;e[24]!==f?(S=D=>{D.key==="Enter"&&(D.preventDefault(),f())},e[24]=f,e[25]=S):S=e[25];let M;e[26]!==o||e[27]!==w||e[28]!==S?(M=t.jsx(Me,{value:o,onChange:b,placeholder:w,className:"h-8 text-xs flex-1",onKeyDown:S}),e[26]=o,e[27]=w,e[28]=S,e[29]=M):M=e[29];let N;e[30]!==o?(N=o.trim(),e[30]=o,e[31]=N):N=e[31];const C=!N;let k;e[32]!==n?(k=n("common.iconPicker.apply"),e[32]=n,e[33]=k):k=e[33];let V;e[34]!==f||e[35]!==C||e[36]!==k?(V=t.jsx(se,{variant:"outline",className:"shrink-0",onClick:f,disabled:C,children:k}),e[34]=f,e[35]=C,e[36]=k,e[37]=V):V=e[37];let _;e[38]!==M||e[39]!==V?(_=t.jsxs("div",{className:"flex items-center gap-1.5",children:[M,V]}),e[38]=M,e[39]=V,e[40]=_):_=e[40];let E;return e[41]!==j||e[42]!==_||e[43]!==m||e[44]!==x?(E=t.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[m,x,j,_]}),e[41]=j,e[42]=_,e[43]=m,e[44]=x,e[45]=E):E=e[45],E}function Tl(a){const e=q.c(13),{viewId:s,blocksSite:n}=a,i=n===void 0?!1:n;if(s==="overview"){let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Is,{size:16}),e[0]=r):r=e[0],r}if(s==="reports"){let r;return e[1]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Qt,{size:16}),e[1]=r):r=e[1],r}if(s==="board"){let r;return e[2]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(ui,{size:16}),e[2]=r):r=e[2],r}if(s==="site-editor"){let r;return e[3]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Ii,{size:16}),e[3]=r):r=e[3],r}if(s==="assets"){let r;return e[4]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Oi,{size:16}),e[4]=r):r=e[4],r}if(s==="releases"){let r;return e[5]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(mi,{size:16}),e[5]=r):r=e[5],r}if(s==="hosting"){let r;return e[6]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(cn,{size:16}),e[6]=r):r=e[6],r}if(s==="e2e"){let r;return e[7]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(fi,{size:16}),e[7]=r):r=e[7],r}if(s==="analytics"){let r;return e[8]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Qt,{size:16}),e[8]=r):r=e[8],r}if(s==="cdn"){let r;return e[9]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(pi,{size:16}),e[9]=r):r=e[9],r}if(s==="experiments"&&i){let r;return e[10]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(hi,{size:16}),e[10]=r):r=e[10],r}if(s==="calendar"){let r;return e[11]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(xi,{size:16}),e[11]=r):r=e[11],r}let l;return e[12]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(As,{size:16}),e[12]=l):l=e[12],l}function fs(a){const e=q.c(51),{pinned:s,canSetMainView:n,onOpen:i,onTogglePin:l,onSetMainView:r}=a,o=Z(),p=s?"text-foreground":"text-muted-foreground/40";let c;e[0]!==p?(c=ve("size-7",p),e[0]=p,e[1]=c):c=e[1];let f;e[2]!==s||e[3]!==o?(f=o(s?"virtualMcp.settings.views.unpin":"virtualMcp.settings.views.pin"),e[2]=s,e[3]=o,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]!==l||e[7]!==s||e[8]!==c||e[9]!==f?(u=t.jsx(Ce,{asChild:!0,children:t.jsx(se,{variant:"ghost",size:"icon",className:c,"aria-label":f,"aria-pressed":s,onClick:l,children:m})}),e[6]=l,e[7]=s,e[8]=c,e[9]=f,e[10]=u):u=e[10];let h;e[11]!==s||e[12]!==o?(h=o(s?"virtualMcp.settings.views.unpin":"virtualMcp.settings.views.pin"),e[11]=s,e[12]=o,e[13]=h):h=e[13];let d;e[14]!==h?(d=t.jsx(ke,{side:"top",children:h}),e[14]=h,e[15]=d):d=e[15];let x;e[16]!==u||e[17]!==d?(x=t.jsxs(Ne,{delayDuration:0,children:[u,d]}),e[16]=u,e[17]=d,e[18]=x):x=e[18];let g;e[19]!==o?(g=o("virtualMcp.settings.views.rowActions"),e[19]=o,e[20]=g):g=e[20];let v;e[21]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(Pi,{size:16}),e[21]=v):v=e[21];let y;e[22]!==g?(y=t.jsx(ys,{asChild:!0,children:t.jsx(se,{variant:"ghost",size:"icon-sm",className:"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(dn,{size:14}),e[24]=j):j=e[24];let b;e[25]!==o?(b=o("virtualMcp.settings.views.open"),e[25]=o,e[26]=b):b=e[26];let w;e[27]!==i||e[28]!==b?(w=t.jsxs(He,{onClick:i,children:[j,b]}),e[27]=i,e[28]=b,e[29]=w):w=e[29];let S;e[30]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(Xt,{size:14}),e[30]=S):S=e[30];let M;e[31]!==s||e[32]!==o?(M=o(s?"virtualMcp.settings.views.unpin":"virtualMcp.settings.views.pin"),e[31]=s,e[32]=o,e[33]=M):M=e[33];let N;e[34]!==l||e[35]!==M?(N=t.jsxs(He,{onClick:l,children:[S,M]}),e[34]=l,e[35]=M,e[36]=N):N=e[36];let C;e[37]!==n||e[38]!==r||e[39]!==o?(C=n&&t.jsxs(He,{onClick:r,children:[t.jsx(Is,{size:14}),o("virtualMcp.settings.views.setMainView")]}),e[37]=n,e[38]=r,e[39]=o,e[40]=C):C=e[40];let k;e[41]!==w||e[42]!==N||e[43]!==C?(k=t.jsxs(ws,{align:"end",children:[w,N,C]}),e[41]=w,e[42]=N,e[43]=C,e[44]=k):k=e[44];let V;e[45]!==y||e[46]!==k?(V=t.jsxs(js,{children:[y,k]}),e[45]=y,e[46]=k,e[47]=V):V=e[47];let _;return e[48]!==V||e[49]!==x?(_=t.jsxs("div",{className:"flex items-center gap-1",children:[x,V]}),e[48]=V,e[49]=x,e[50]=_):_=e[50],_}const ps=a=>a.stopPropagation();function Dl(a){const e=q.c(8),{icon:s,title:n}=a;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 l;e[3]!==n?(l=t.jsx("span",{className:"text-xs text-muted-foreground",children:n}),e[3]=n,e[4]=l):l=e[4];let r;return e[5]!==i||e[6]!==l?(r=t.jsxs("div",{className:"flex items-center gap-2 px-4 py-2.5 bg-muted/30",children:[i,l]}),e[5]=i,e[6]=l,e[7]=r):r=e[7],r}function Pl(a){const e=q.c(70),{views:s}=a,n=Z();let i;e[0]!==n?(i=n("virtualMcp.settings.views.defaults"),e[0]=n,e[1]=i):i=e[1];let l;e[2]!==n?(l=n("virtualMcp.layoutTabContent.mainView"),e[2]=n,e[3]=l):l=e[3];let r;e[4]!==n?(r=n("virtualMcp.layoutTabContent.mainViewDescription"),e[4]=n,e[5]=r):r=e[5];const o=s.defaultMainView,p=s.setMainView;let c;e[6]!==n?(c=n("virtualMcp.layoutTabContent.mainView"),e[6]=n,e[7]=c):c=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]!==c||e[13]!==m?(u=t.jsx(Oe,{"aria-label":c,size:"sm",className:"w-36 shrink-0 @min-xl/project-settings:w-44",children:m}),e[12]=c,e[13]=m,e[14]=u):u=e[14];let h;e[15]!==s.defaultMainOptions?(h=s.defaultMainOptions.map(Ol),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:o,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]!==l||e[26]!==r?(g=t.jsx(tt,{title:l,description:r,action:x}),e[24]=x,e[25]=l,e[26]=r,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 w;e[34]!==j||e[35]!==b||e[36]!==s.noMainView||e[37]!==s.setChatDefaultOpen?(w=t.jsx(Ce,{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]=w):w=e[38];let S;e[39]!==n||e[40]!==s.noMainView?(S=s.noMainView&&t.jsx(ke,{side:"top",children:n("virtualMcp.layoutTabContent.chatAlwaysShown")}),e[39]=n,e[40]=s.noMainView,e[41]=S):S=e[41];let M;e[42]!==w||e[43]!==S?(M=t.jsxs(Ne,{delayDuration:0,children:[w,S]}),e[42]=w,e[43]=S,e[44]=M):M=e[44];let N;e[45]!==v||e[46]!==y||e[47]!==M?(N=t.jsx(tt,{title:v,description:y,action:M}),e[45]=v,e[46]=y,e[47]=M,e[48]=N):N=e[48];let C;e[49]!==g||e[50]!==N?(C=t.jsxs(ze,{children:[g,N]}),e[49]=g,e[50]=N,e[51]=C):C=e[51];let k;e[52]!==i||e[53]!==C?(k=t.jsx(Be,{title:i,children:C}),e[52]=i,e[53]=C,e[54]=k):k=e[54];let V;e[55]!==n?(V=n("virtualMcp.settings.views.sidebar"),e[55]=n,e[56]=V):V=e[56];let _;e[57]!==s?(_=s.projectViews.map(L=>{const U=s.pinned(L);return t.jsx(tt,{icon:t.jsx(Tl,{viewId:L,blocksSite:s.blocksSite}),title:s.labels[L],onClick:()=>s.openView(L),action:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(fs,{pinned:U,canSetMainView:U&&!s.isMainView(L),onOpen:()=>s.openView(L),onTogglePin:()=>s.togglePin(L,!U),onSetMainView:()=>s.setMainView(L)}),t.jsx("span",{onClick:()=>s.openView(L),className:"flex cursor-pointer items-center text-muted-foreground",children:t.jsx(Wt,{size:16})})]})},L)}),e[57]=s,e[58]=_):_=e[58];let E;e[59]!==s?(E=s.connectionsData.flatMap(L=>[t.jsx(Dl,{icon:L.icon,title:L.title},`${L.id}:header`),...L.uiTools.map(U=>{const K=s.pinnedAppViews.find(Y=>Y.connectionId===L.id&&Y.toolName===U.name),W=!!K,G=un(L.id,U.name),F=`ext-apps:${L.id}:${U.name}`;return t.jsx(tt,{onClick:()=>s.openView(G),icon:W?t.jsx("span",{onClick:ps,children:t.jsx(tn,{value:K.icon??null,name:K.label||U.name,size:"xs",showHoverOverlay:!1,onChange:Y=>s.setAppViewIcon(L.id,U.name,Y)})}):t.jsx(As,{size:16}),title:W?t.jsx("span",{onClick:ps,children:t.jsx(Me,{value:K.label,onChange:Y=>s.setAppViewLabel(L.id,U.name,Y.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(fs,{pinned:W,canSetMainView:W&&!s.isMainView(F),onOpen:()=>s.openView(G),onTogglePin:()=>s.toggleAppViewPin(L.id,U.name),onSetMainView:()=>s.setMainView(F)}),t.jsx("span",{onClick:()=>s.openView(G),className:"flex cursor-pointer items-center text-muted-foreground",children:t.jsx(Wt,{size:16})})]})},`${L.id}:${U.name}`)})]),e[59]=s,e[60]=E):E=e[60];let D;e[61]!==_||e[62]!==E?(D=t.jsxs(ze,{children:[_,E]}),e[61]=_,e[62]=E,e[63]=D):D=e[63];let $;e[64]!==V||e[65]!==D?($=t.jsx(Be,{title:V,children:D}),e[64]=V,e[65]=D,e[66]=$):$=e[66];let I;return e[67]!==k||e[68]!==$?(I=t.jsxs(t.Fragment,{children:[k,$]}),e[67]=k,e[68]=$,e[69]=I):I=e[69],I}function Ol(a){return t.jsx(we,{value:a.value,children:a.label},a.value)}const sn="site-editor",Il=new Set([sn,"content"]);function Al({virtualMcpId:a,form:e,flushAndSave:s}){const n=Z(),i=Tt(),{openPanel:l}=Ei(),r=Ts(a),o=zi(r),p=Bs(a),c=Gi(a),f=(r?.connections??[]).map(T=>T.connection_id).sort(),{data:m}=Cs({queryKey:Dt.projectConnectionDetails(a,f),enabled:f.length>0,queryFn:async()=>await Promise.all(f.map(async z=>{try{const{item:B}=await i.call("COLLECTION_CONNECTIONS_GET",{id:z}),P=(B?.tools??[]).flatMap(O=>{const ee=Ai(O._meta);return ee?[{name:O.name,title:O.title,description:O.description,resourceUri:ee}]:[]});return{fetchOk:!0,id:z,title:B?.title??z,icon:B?.icon??null,uiTools:P}}catch{return{fetchOk:!1,id:z,title:z,icon:null,uiTools:[]}}}))}),u=(m??[]).filter(T=>T.uiTools.length>0),h=new Set([...mn,...fn]),d=e.watch("metadata.ui.pinnedViews")??[],x=e.watch("metadata.ui.layout")??null,g=x?.defaultMainView??null,v=x?.chatDefaultOpen??!1,y=o.presence.calendar,j=e.watch("metadata.sidebarViewsSeen"),b=Mt(_t({sidebarViews:e.watch("metadata.sidebarViews"),ui:{layout:x}}),e.watch("metadata.sidebarViewsVersion"),es(j,y)),w=c??(r?Mt(_t(r.metadata),r.metadata.sidebarViewsVersion,es(r.metadata.sidebarViewsSeen,y)):b),S=(()=>{if(!g||g.type==="chat")return"";const T=pn(g.type);return T==="instructions"||T==="connections"||T==="layout"?"settings":Il.has(T)?sn:h.has(T)?T:`${T}:${g.id??""}:${g.toolName??""}`})(),M=S==="",N=T=>{const[z,B,P]=T.split(":");return z?h.has(z)?{type:z}:z==="ext-apps"&&B?{type:"ext-apps",id:B,toolName:P||void 0}:null:null},C=T=>{e.setValue("metadata.ui.pinnedViews",T,{shouldDirty:!0})},k=T=>{e.setValue("metadata.ui.layout",{...x,...T},{shouldDirty:!0})},V=H.useRef(!1);if(m&&m.length>0&&!V.current){V.current=!0;const T=new Set((m??[]).filter(O=>O.fetchOk).map(O=>O.id)),z=new Set(u.flatMap(O=>O.uiTools.map(ee=>`${O.id}:${ee.name}`))),B=new Set(f),P=d.filter(O=>B.has(O.connectionId)&&(!T.has(O.connectionId)||z.has(`${O.connectionId}:${O.toolName}`)));P.length!==d.length&&(C(P),g?.type==="ext-apps"&&!P.some(O=>O.connectionId===g.id&&O.toolName===g.toolName)&&k({defaultMainView:{type:"settings"}}))}const _=(T,z)=>{if(d.some(P=>P.connectionId===T&&P.toolName===z)){const P=d.filter(ee=>!(ee.connectionId===T&&ee.toolName===z));C(P);const O=`ext-apps:${T}:${z}`;S===O&&k({defaultMainView:{type:"settings"}})}else{const P=u.find(O=>O.id===T)?.uiTools.find(O=>O.name===z)?.title;C([...d,{connectionId:T,toolName:z,label:P??kt(z),icon:null}])}s()},E=(T,z,B)=>{C(d.map(P=>P.connectionId===T&&P.toolName===z?{...P,label:B}:P))},D=()=>{s()},$=(T,z,B)=>{C(d.map(P=>P.connectionId===T&&P.toolName===z?{...P,icon:B}:P)),s()},I=T=>{k({defaultMainView:N(T)}),s()},L=(T,z)=>{const B=Yi(w,T,z,1);e.setValue("metadata.sidebarViews",B,{shouldDirty:!0}),e.setValue("metadata.sidebarViewsVersion",1,{shouldDirty:!0}),y&&e.setValue("metadata.sidebarViewsSeen",Bi(r?.metadata.sidebarViewsSeen??j,y),{shouldDirty:!0}),p.stage(B,w);const P=Wi(g,T,z);P!==g&&k({defaultMainView:P})},U=Ys(r?.metadata),K=Ri(U,o.presence),W=Li(K),G=Ui(w,K,1),F={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"),calendar:n("common.mainPanelTabs.calendar")},Y=[];for(const T of G)T!=="automations"&&Y.push({value:T,label:F[T]});for(const T of d)Y.push({value:`ext-apps:${T.connectionId}:${T.toolName}`,label:T.label||T.toolName});return G.includes("automations")&&Y.push({value:"automations",label:F.automations}),Y.push({value:"settings",label:n("virtualMcp.layoutTabContent.settings")}),{projectViews:W,blocksSite:y,labels:F,pinned:T=>w.includes(T),isMainView:T=>S===T,defaultMainView:S,defaultMainOptions:Y,noMainView:M,chatDefaultOpen:v,connectionsData:u,pinnedAppViews:d,openView:T=>l(T,{virtualmcpid:a}),togglePin:(T,z)=>L(T,z),setMainView:I,setChatDefaultOpen:T=>{k({chatDefaultOpen:T}),s()},toggleAppViewPin:_,setAppViewIcon:$,setAppViewLabel:E,commitAppViewLabel:D}}function $l(a){const e=q.c(55),{form:s,onCommit:n}=a,i=Z(),l=H.useId();let r;e[0]!==i?(r=i("virtualMcp.settings.identity.icon"),e[0]=i,e[1]=r):r=e[1];let o;e[2]!==r?(o=t.jsx("p",{className:"text-sm font-medium",children:r}),e[2]=r,e[3]=o):o=e[3];let p;e[4]!==i?(p=i("virtualMcp.settings.identity.iconDescription"),e[4]=i,e[5]=p):p=e[5];let c;e[6]!==p?(c=t.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:p}),e[6]=p,e[7]=c):c=e[7];let f;e[8]!==o||e[9]!==c?(f=t.jsxs("div",{children:[o,c]}),e[8]=o,e[9]=c,e[10]=f):f=e[10];let m;e[11]!==s||e[12]!==n||e[13]!==i?(m=V=>{const{field:_}=V;return t.jsx("div",{className:"justify-self-start",children:t.jsx(tn,{value:_.value??null,onChange:E=>{_.onChange(E),n()},onColorChange:E=>{s.setValue("metadata.ui.themeColor",E,{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=`${l}-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]!==l||e[27]!==n||e[28]!==i?(v=V=>{const{field:_}=V;return t.jsx(Me,{..._,id:`${l}-name`,value:_.value??"",onBlur:()=>{_.onBlur(),n()},placeholder:i("virtualMcp.virtualMcp.agentNamePlaceholder")})},e[26]=l,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=`${l}-description`;let w;e[36]!==i?(w=i("virtualMcp.settings.identity.description"),e[36]=i,e[37]=w):w=e[37];let S;e[38]!==b||e[39]!==w?(S=t.jsx("label",{htmlFor:b,className:"text-sm font-medium",children:w}),e[38]=b,e[39]=w,e[40]=S):S=e[40];let M;e[41]!==l||e[42]!==n||e[43]!==i?(M=V=>{const{field:_}=V;return t.jsx(ut,{..._,id:`${l}-description`,value:_.value??"",onBlur:()=>{_.onBlur(),n()},placeholder:i("virtualMcp.virtualMcp.descriptionPlaceholder"),className:"min-h-24 resize-y"})},e[41]=l,e[42]=n,e[43]=i,e[44]=M):M=e[44];let N;e[45]!==s.control||e[46]!==M?(N=t.jsx(be,{name:"description",control:s.control,render:M}),e[45]=s.control,e[46]=M,e[47]=N):N=e[47];let C;e[48]!==S||e[49]!==N?(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:[S,N]}),e[48]=S,e[49]=N,e[50]=C):C=e[50];let k;return e[51]!==j||e[52]!==C||e[53]!==h?(k=t.jsxs(ze,{children:[h,j,C]}),e[51]=j,e[52]=C,e[53]=h,e[54]=k):k=e[54],k}function Fl(a){const e=q.c(8),{section:s}=a,n=Z();let i;e[0]!==n?(i=n("virtualMcp.settings.navigation"),e[0]=n,e[1]=i):i=e[1];let l;e[2]!==s||e[3]!==n?(l=Ji.map(o=>{const{titleKey:p}=Zi[o];return t.jsx(Ue.Tab,{active:s===o,asChild:!0,children:t.jsx(Ns,{to:".",activeOptions:{exact:!0,explicitUndefined:!0},search:c=>({...c,section:o==="general"?void 0:o}),children:n(p)})},o)}),e[2]=s,e[3]=n,e[4]=l):l=e[4];let r;if(e[5]!==i||e[6]!==l){const o=t.jsx(Ue.Tabs,{"aria-label":i,children:l});r=t.jsx(hn.Toolbar.Left.Portal,{fallback:o,children:o}),e[5]=i,e[6]=l,e[7]=r}else r=e[7];return r}function El(){const a=q.c(8),e=Pt();let s;a[0]===Symbol.for("react.memo_cache_sentinel")?(s={strict:!1},a[0]=s):s=a[0];const{section:n}=xn(s);let i;a[1]!==n?(i=ea(n)?n:"general",a[1]=n,a[2]=i):i=a[2];let l;a[3]!==e?(l=o=>e({to:".",search:p=>({...p,section:o??void 0})}),a[3]=e,a[4]=l):l=a[4];let r;return a[5]!==i||a[6]!==l?(r={section:i,openSection:l},a[5]=i,a[6]=l,a[7]=r):r=a[7],r}function nn(a){const e=q.c(20),{value:s,label:n,copiedLabel:i,variant:l,size:r,className:o,copiedClassName:p}=a,c=l===void 0?"ghost":l,f=r===void 0?"icon-sm":r,{handleCopy:m,copied:u}=sa();let h;e[0]!==m||e[1]!==s?(h=()=>{m(s).catch(zl)},e[0]=m,e[1]=s,e[2]=h):h=e[2];const d=u&&p;let x;e[3]!==o||e[4]!==d?(x=ve(o,d),e[3]=o,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]!==c?(v=t.jsx(se,{type:"button",variant:c,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]=c,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 zl(){}function Rl(a){const e=q.c(14),{id:s,value:n,copyLabel:i,copiedLabel:l,className:r}=a;let o;e[0]!==r?(o=ve("relative h-fit",r),e[0]=r,e[1]=o):o=e[1];let p;e[2]!==s||e[3]!==n?(p=t.jsx(Me,{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 c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=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]=c):c=e[5];let f;e[6]!==l||e[7]!==i||e[8]!==n?(f=t.jsx(nn,{value:n,label:i,copiedLabel:l,className:c,copiedClassName:"opacity-100"}),e[6]=l,e[7]=i,e[8]=n,e[9]=f):f=e[9];let m;return e[10]!==o||e[11]!==p||e[12]!==f?(m=t.jsxs("div",{className:o,children:[p,f]}),e[10]=o,e[11]=p,e[12]=f,e[13]=m):m=e[13],m}async function hs(a){const e=await a.json().catch(()=>({}));if(!a.ok)throw new Error(e.error??`HTTP ${a.status}`);return e}function Ll(a){const e=q.c(106),{orgSlug:s,virtualMcpId:n}=a,i=Z(),l=ks(),r=`/api/${s}/hosted/${encodeURIComponent(n)}/site-tokens`;let o;e[0]!==s||e[1]!==n?(o=Dt.hostedSiteTokens(s,n),e[0]=s,e[1]=n,e[2]=o):o=e[2];const p=o,[c,f]=H.useState(null),m=H.useId();let u;e[3]!==r?(u=async()=>hs(await fetch(r)),e[3]=r,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=Cs(h);let x;e[8]!==r?(x=async()=>hs(await fetch(r,{method:"POST"})),e[8]=r,e[9]=x):x=e[9];let g;e[10]===Symbol.for("react.memo_cache_sentinel")?(g=fe=>{const{token:A}=fe;return f(A)},e[10]=g):g=e[10];let v;e[11]!==p||e[12]!==l?(v=()=>l.invalidateQueries({queryKey:p}),e[11]=p,e[12]=l,e[13]=v):v=e[13];let y;e[14]!==x||e[15]!==v?(y={mutationFn:x,onSuccess:g,onError:Ul,onSettled:v},e[14]=x,e[15]=v,e[16]=y):y=e[16];const j=gn(y);let b;e[17]!==d.data?.tokens?(b=d.data?.tokens??[],e[17]=d.data?.tokens,e[18]=b):b=e[18];const w=b,S=d.data?.site;let M;e[19]!==i?(M=i("siteTokens.title"),e[19]=i,e[20]=M):M=e[20];let N;e[21]!==i?(N=i("siteTokens.description"),e[21]=i,e[22]=N):N=e[22];let C;e[23]!==i?(C=i("siteTokens.siteId"),e[23]=i,e[24]=C):C=e[24];let k;e[25]!==m||e[26]!==C?(k=t.jsx("label",{htmlFor:m,className:"text-sm font-medium",children:C}),e[25]=m,e[26]=C,e[27]=k):k=e[27];let V;e[28]!==i?(V=i("siteTokens.siteIdDescription"),e[28]=i,e[29]=V):V=e[29];let _;e[30]!==V?(_=t.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:V}),e[30]=V,e[31]=_):_=e[31];let E;e[32]!==S||e[33]!==m||e[34]!==i?(E=S?t.jsx(Rl,{id:m,value:S,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]=S,e[33]=m,e[34]=i,e[35]=E):E=e[35];const D=!d.data||j.isPending;let $;e[36]!==j?($=()=>j.mutate(),e[36]=j,e[37]=$):$=e[37];let I;e[38]!==j.isPending?(I=j.isPending?t.jsx(it,{className:"size-3.5"}):t.jsx(Pe,{size:14}),e[38]=j.isPending,e[39]=I):I=e[39];let L;e[40]!==i?(L=i("siteTokens.issue"),e[40]=i,e[41]=L):L=e[41];let U;e[42]!==D||e[43]!==$||e[44]!==I||e[45]!==L?(U=t.jsxs(se,{type:"button",size:"sm",className:"shrink-0",disabled:D,onClick:$,children:[I,L]}),e[42]=D,e[43]=$,e[44]=I,e[45]=L,e[46]=U):U=e[46];let K;e[47]!==E||e[48]!==U?(K=t.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[E,U]}),e[47]=E,e[48]=U,e[49]=K):K=e[49];let W;e[50]!==k||e[51]!==_||e[52]!==K?(W=t.jsxs(je,{className:"group",children:[k,_,K]}),e[50]=k,e[51]=_,e[52]=K,e[53]=W):W=e[53];let G;e[54]!==d.error||e[55]!==d.isError?(G=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]=G):G=e[56];let F;if(e[57]!==i||e[58]!==w){let fe;e[60]!==i?(fe=A=>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:A.kid}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("siteTokens.issuedAgo",{when:ta(new Date(A.iat*1e3))})})]})]})},A.kid),e[60]=i,e[61]=fe):fe=e[61],F=w.map(fe),e[57]=i,e[58]=w,e[59]=F}else F=e[59];let Y;e[62]!==W||e[63]!==G||e[64]!==F?(Y=t.jsxs(ze,{children:[W,G,F]}),e[62]=W,e[63]=G,e[64]=F,e[65]=Y):Y=e[65];const X=c!==null;let T;e[66]===Symbol.for("react.memo_cache_sentinel")?(T=fe=>!fe&&f(null),e[66]=T):T=e[66];let z;e[67]!==i?(z=i("siteTokens.createdTitle"),e[67]=i,e[68]=z):z=e[68];let B;e[69]!==z?(B=t.jsx(lt,{children:z}),e[69]=z,e[70]=B):B=e[70];let P;e[71]!==i?(P=i("siteTokens.createdDescription"),e[71]=i,e[72]=P):P=e[72];let O;e[73]!==P?(O=t.jsx(Ms,{children:P}),e[73]=P,e[74]=O):O=e[74];let ee;e[75]!==B||e[76]!==O?(ee=t.jsxs(at,{children:[B,O]}),e[75]=B,e[76]=O,e[77]=ee):ee=e[77];let ae;e[78]!==i?(ae=i("siteTokens.createdTitle"),e[78]=i,e[79]=ae):ae=e[79];const ce=c??"";let le;e[80]!==ae||e[81]!==ce?(le=t.jsx(Me,{readOnly:!0,"aria-label":ae,value:ce,className:"font-mono text-xs"}),e[80]=ae,e[81]=ce,e[82]=le):le=e[82];let ie;e[83]!==c||e[84]!==i?(ie=c?t.jsx(nn,{value:c,label:i("siteTokens.copy"),copiedLabel:i("siteTokens.copied"),variant:"outline",size:"icon",className:"shrink-0"}):null,e[83]=c,e[84]=i,e[85]=ie):ie=e[85];let Q;e[86]!==le||e[87]!==ie?(Q=t.jsxs("div",{className:"flex items-center gap-2",children:[le,ie]}),e[86]=le,e[87]=ie,e[88]=Q):Q=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(se,{onClick:de,children:ue})}),e[92]=ue,e[93]=he):he=e[93];let me;e[94]!==ee||e[95]!==Q||e[96]!==he?(me=t.jsxs(Je,{className:"sm:max-w-lg",children:[ee,Q,he]}),e[94]=ee,e[95]=Q,e[96]=he,e[97]=me):me=e[97];let xe;e[98]!==X||e[99]!==me?(xe=t.jsx(Xe,{open:X,onOpenChange:T,children:me}),e[98]=X,e[99]=me,e[100]=xe):xe=e[100];let ge;return e[101]!==N||e[102]!==Y||e[103]!==xe||e[104]!==M?(ge=t.jsxs(Be,{title:M,description:N,children:[Y,xe]}),e[101]=N,e[102]=Y,e[103]=xe,e[104]=M,e[105]=ge):ge=e[105],ge}function Ul(a){return oe.error(a.message)}function Yl(a){const e=q.c(8),{control:s,previewServerUrl:n}=a,i=Z();let l;e[0]!==n?(l=Ws(n),e[0]=n,e[1]=l):l=e[1];const r=!!l;let o;e[2]!==r||e[3]!==i?(o=c=>{const{field:f}=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:"fast-preview",className:"font-normal text-foreground",children:i("sandbox.cmsSettings.fastPreview.label")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i(r?"sandbox.cmsSettings.fastPreview.description":"sandbox.cmsSettings.fastPreview.needsPreviewServerUrl")})]}),t.jsx(ht,{id:"fast-preview",className:"shrink-0",checked:!!f.value&&r,disabled:!r,onCheckedChange:m=>f.onChange(m)})]})},e[2]=r,e[3]=i,e[4]=o):o=e[4];let p;return e[5]!==s||e[6]!==o?(p=t.jsx(be,{control:s,name:"metadata.fastPreview",render:o}),e[5]=s,e[6]=o,e[7]=p):p=e[7],p}function Bl(a){const e=q.c(5),{control:s,fastPreview:n}=a,i=Z();if(!n)return null;let l;e[0]!==i?(l=o=>{const{field:p}=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-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:c=>p.onChange(c)})]})},e[0]=i,e[1]=l):l=e[1];let r;return e[2]!==s||e[3]!==l?(r=t.jsx(be,{control:s,name:"metadata.fastPreviewInPlace",render:l}),e[2]=s,e[3]=l,e[4]=r):r=e[4],r}function Wl(a){const e=q.c(18),{control:s,isBlocksV8:n}=a,i=n===void 0?!1:n,l=Z();let r;e[0]!==l?(r=l("sandbox.previewServerUrlField.label"),e[0]=l,e[1]=r):r=e[1];let o;e[2]!==r?(o=t.jsx(ye,{htmlFor:"preview-server-url",children:r}),e[2]=r,e[3]=o):o=e[3];let p;e[4]!==l?(p=d=>{const{field:x}=d,g=x.value??"";return t.jsx(Me,{id:"preview-server-url",type:"url",inputMode:"url",placeholder:l("sandbox.previewServerUrlField.placeholder"),value:g,onChange:v=>x.onChange(v.target.value===""?null:v.target.value),onBlur:()=>{x.onChange(na(g)),x.onBlur()}})},e[4]=l,e[5]=p):p=e[5];let c;e[6]!==s||e[7]!==p?(c=t.jsx(be,{control:s,name:"metadata.previewServerUrl",render:p}),e[6]=s,e[7]=p,e[8]=c):c=e[8];const f=i?"sandbox.previewServerUrlField.descriptionBlocksV8":"sandbox.previewServerUrlField.description";let m;e[9]!==l||e[10]!==f?(m=l(f),e[9]=l,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]!==o||e[15]!==c||e[16]!==u?(h=t.jsxs("div",{className:"space-y-2",children:[o,c,u]}),e[14]=o,e[15]=c,e[16]=u,e[17]=h):h=e[17],h}function Kl(a){const e=q.c(15),{control:s,isBlocksV8:n,previewServerUrl:i,fastPreview:l}=a,r=Z(),o=n||!!l;let p;e[0]!==s||e[1]!==n?(p=t.jsx(je,{children:t.jsx(Wl,{control:s,isBlocksV8:n})}),e[0]=s,e[1]=n,e[2]=p):p=e[2];let c;e[3]!==s||e[4]!==n||e[5]!==i||e[6]!==r?(c=n?!Ws(i)&&t.jsx(je,{children:t.jsx("p",{className:"text-xs text-muted-foreground",children:r("sandbox.cmsSettings.blocksV8.needsPreviewServerUrl")})}):t.jsx(je,{children:t.jsx(Yl,{control:s,previewServerUrl:i})}),e[3]=s,e[4]=n,e[5]=i,e[6]=r,e[7]=c):c=e[7];let f;e[8]!==s||e[9]!==o?(f=o&&t.jsx(je,{children:t.jsx(Bl,{control:s,fastPreview:o})}),e[8]=s,e[9]=o,e[10]=f):f=e[10];let m;return e[11]!==p||e[12]!==c||e[13]!==f?(m=t.jsxs(t.Fragment,{children:[p,c,f]}),e[11]=p,e[12]=c,e[13]=f,e[14]=m):m=e[14],m}const St={tools:null,resources:null,prompts:null},Gl=aa.pick({status:!0,title:!0,description:!0,icon:!0,metadata:!0,connections:!0});function ql(a){const s=new TextEncoder().encode(a),n=Array.from(s,i=>String.fromCharCode(i)).join("");return btoa(n)}function an(a){return{"x-studio-client":a,"x-mesh-client":a}}function Hl(a){const e=q.c(15),{url:s,agentId:n}=a,i=Z(),[l,r]=H.useState(!1);let o;e[0]!==n||e[1]!==i||e[2]!==s?(o=async()=>{Ve("agent_connect_action",{agent_id:n,action:"copy_url"}),await navigator.clipboard.writeText(s),r(!0),oe.success(i("virtualMcp.virtualMcpShareModal.agentUrlCopied")),await vt(2e3),r(!1)},e[0]=n,e[1]=i,e[2]=s,e[3]=o):o=e[3];const p=o;let c;e[4]!==l?(c=l?t.jsx(rt,{size:20,className:"text-success"}):t.jsx(xt,{size:20}),e[4]=l,e[5]=c):c=e[5];let f;e[6]!==l||e[7]!==i?(f=i(l?"virtualMcp.virtualMcpShareModal.copied":"virtualMcp.virtualMcpShareModal.copyUrl"),e[6]=l,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]!==c||e[13]!==m?(u=t.jsxs(se,{type:"button",variant:"outline",onClick:p,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[c,m]}),e[11]=p,e[12]=c,e[13]=m,e[14]=u):u=e[14],u}function Ql(a){const e=q.c(13),{url:s,serverName:n,agentId:i}=a,l=Z();let r;e[0]!==i||e[1]!==n||e[2]!==l||e[3]!==s?(r=()=>{Ve("agent_connect_action",{agent_id:i,action:"install_cursor"});const u=Gs(n),h={type:"http",url:s,headers:an("Cursor")},d=ql(JSON.stringify(h,null,2)),x=`cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(u)}&config=${encodeURIComponent(d)}`;window.open(x,"_blank"),oe.success(l("virtualMcp.virtualMcpShareModal.openingCursor"))},e[0]=i,e[1]=n,e[2]=l,e[3]=s,e[4]=r):r=e[4];const o=r;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 c;e[6]!==l?(c=l("virtualMcp.virtualMcpShareModal.installOnCursor"),e[6]=l,e[7]=c):c=e[7];let f;e[8]!==c?(f=t.jsx("span",{className:"text-xs font-medium",children:c}),e[8]=c,e[9]=f):f=e[9];let m;return e[10]!==o||e[11]!==f?(m=t.jsxs(se,{type:"button",variant:"outline",onClick:o,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[p,f]}),e[10]=o,e[11]=f,e[12]=m):m=e[12],m}function Xl(a){const e=q.c(16),{url:s,serverName:n,agentId:i}=a,l=Z(),[r,o]=H.useState(!1);let p;e[0]!==i||e[1]!==n||e[2]!==l||e[3]!==s?(p=async()=>{Ve("agent_connect_action",{agent_id:i,action:"install_claude_code"});const d=Gs(n),x={type:"http",url:s,headers:an("Claude Code")},g=JSON.stringify(x,null,2),v=`claude mcp add-json "${d}" '${g.replace(/'/g,"'\\''")}' --scope user`;await navigator.clipboard.writeText(v),o(!0),oe.success(l("virtualMcp.virtualMcpShareModal.claudeCodeCommandCopied")),await vt(2e3),o(!1)},e[0]=i,e[1]=n,e[2]=l,e[3]=s,e[4]=p):p=e[4];const c=p;let f;e[5]!==r?(f=r?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]=r,e[6]=f):f=e[6];let m;e[7]!==r||e[8]!==l?(m=l(r?"virtualMcp.virtualMcpShareModal.copied":"virtualMcp.virtualMcpShareModal.installOnClaudeCode"),e[7]=r,e[8]=l,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]!==c||e[13]!==f||e[14]!==u?(h=t.jsxs(se,{type:"button",variant:"outline",onClick:c,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[f,u]}),e[12]=c,e[13]=f,e[14]=u,e[15]=h):h=e[15],h}const Jl=720*60*60;function Zl({virtualMcp:a}){const e=Z(),s=Tt(),[n,i]=H.useState(null),[l,r]=H.useState(!1),[o,p]=H.useState(!1),c=a.id,f=a.title||`agent-${c.slice(0,8)}`,m=n?`bunx @decocms/typegen@latest --mcp ${c} --key ${n} --output client.ts`:`bunx @decocms/typegen@latest --mcp ${c} --key <api-key> --output client.ts`,u=async()=>{r(!0);try{const{key:d}=await s.call("API_KEY_CREATE",{name:`typegen-${f}`,permissions:{[c]:["*"]},expiresIn:Jl});if(!d)throw new Error("No key in response");i(d),Ve("agent_typegen_key_generated",{agent_id:c})}catch{Ve("agent_typegen_key_failed",{agent_id:c}),oe.error(e("virtualMcp.virtualMcpShareModal.failedGenerateApiKey"))}finally{r(!1)}},h=async()=>{Ve("agent_connect_action",{agent_id:c,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(se,{type:"button",variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:u,disabled:l,children:[l?t.jsx(it,{className:"size-3.5"}):t.jsx($t,{size:14}),t.jsx("span",{children:e(l?"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(se,{type:"button",variant:"ghost",size:"icon-xs",className:"shrink-0",onClick:h,children:o?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(er,{apiKey:n,agentId:c})]})}function er(a){const e=q.c(21),{apiKey:s,agentId:n}=a,[i,l]=H.useState(!1),r=window.location.origin,o=s?`STUDIO_API_KEY=${s}`:"STUDIO_API_KEY=<api-key>",p=`STUDIO_BASE_URL=${r}`,c=`${o}
2
2
  ${p}`;let f;e[0]!==n||e[1]!==s||e[2]!==c?(f=async()=>{Ve("agent_connect_action",{agent_id:n,action:"typegen_copy_env",has_api_key:!!s}),await navigator.clipboard.writeText(c),l(!0),await vt(2e3),l(!1)},e[0]=n,e[1]=s,e[2]=c,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]!==o||e[7]!==h?(d=t.jsx("span",{className:h,children:o}),e[6]=o,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(se,{type:"button",variant:"ghost",size:"icon-xs",className:"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 tr(a){const e=q.c(3),{virtualMcp:s}=a;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(H.Suspense,{fallback:n,children:t.jsx(Zl,{virtualMcp:s})}),e[1]=s,e[2]=i):i=e[2],i}function sr(a){const e=q.c(45),{open:s,onOpenChange:n,virtualMcp:i}=a,l=Z(),{org:r}=Fe(),o=`/api/${r.slug}/mcp/virtual-mcp/${i.id}`;let p;e[0]!==o?(p=new URL(o,window.location.origin),e[0]=o,e[1]=p):p=e[1];const c=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=ua();let h;e[5]!==i.id||e[6]!==c.href?(h=t.jsx(Hl,{url:c.href,agentId:i.id}),e[5]=i.id,e[6]=c.href,e[7]=h):h=e[7];let d,x;e[8]!==m||e[9]!==i.id||e[10]!==c.href?(d=t.jsx(Ql,{url:c.href,serverName:m,agentId:i.id}),x=t.jsx(Xl,{url:c.href,serverName:m,agentId:i.id}),e[8]=m,e[9]=i.id,e[10]=c.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(tr,{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]!==l?(C=l("virtualMcp.virtualMcpShareModal.connect"),e[23]=l,e[24]=C):C=e[24];let k;e[25]!==C?(k=t.jsx(oa,{className:"mt-4 mb-4 text-base font-semibold",children:C}),e[25]=C,e[26]=k):k=e[26];let V;e[27]!==b||e[28]!==k?(V=t.jsx(ca,{children:t.jsxs("div",{className:"flex-1 overflow-y-auto px-4 pb-6 [touch-action:pan-y]",children:[k,b]})}),e[27]=b,e[28]=k,e[29]=V):V=e[29];let _;return e[30]!==n||e[31]!==s||e[32]!==V?(_=t.jsx(da,{open:s,onOpenChange:n,children:V}),e[30]=n,e[31]=s,e[32]=V,e[33]=_):_=e[33],_}let w;e[34]!==l?(w=l("virtualMcp.virtualMcpShareModal.connect"),e[34]=l,e[35]=w):w=e[35];let S;e[36]!==w?(S=t.jsx(at,{children:t.jsx(lt,{children:w})}),e[36]=w,e[37]=S):S=e[37];let M;e[38]!==b||e[39]!==S?(M=t.jsxs(Je,{className:"max-h-[80vh] overflow-y-auto sm:max-w-2xl",children:[S,b]}),e[38]=b,e[39]=S,e[40]=M):M=e[40];let N;return e[41]!==n||e[42]!==s||e[43]!==M?(N=t.jsx(Xe,{open:s,onOpenChange:n,children:M}),e[41]=n,e[42]=s,e[43]=M,e[44]=N):N=e[44],N}const nr=/^[A-Za-z_][A-Za-z0-9_]*$/;function ir(a){const e={},s=a.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 l=i.indexOf("=");if(l<0)throw new Error(`Line ${n+1}: missing '='`);const r=i.slice(0,l).trim();if(!nr.test(r))throw new Error(`Line ${n+1}: invalid key "${r}"`);let o=i.slice(l+1).trim();o.length>=2&&(o.startsWith('"')&&o.endsWith('"')||o.startsWith("'")&&o.endsWith("'"))&&(o=o.slice(1,-1)),e[r]=o}return e}function ar(a){const e=q.c(28),{control:s,form:n,virtualMcpId:i,orgSlug:l,sandboxMap:r}=a,o=Z();let p;e[0]!==o?(p=o("sandbox.envVarsField.title"),e[0]=o,e[1]=p):p=e[1];let c;e[2]!==p?(c=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]=c):c=e[3];let f;e[4]!==o?(f=o("sandbox.envVarsField.description"),e[4]=o,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]!==l||e[11]!==r||e[12]!==i?(u=t.jsx(lr,{control:s,form:n,virtualMcpId:i,orgSlug:l,sandboxMap:r}),e[8]=s,e[9]=n,e[10]=l,e[11]=r,e[12]=i,e[13]=u):u=e[13];let h;e[14]!==o?(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??o("sandbox.envVarsField.failedToLoadSecrets")})},e[14]=o,e[15]=h):h=e[15];let d;e[16]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(vn,{className:"h-9 w-full"}),e[16]=d):d=e[16];let x;e[17]!==s||e[18]!==n?(x=t.jsx(H.Suspense,{fallback:d,children:t.jsx(or,{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]!==c||e[24]!==m||e[25]!==u||e[26]!==g?(v=t.jsxs("div",{className:"space-y-2",children:[c,m,u,g]}),e[23]=c,e[24]=m,e[25]=u,e[26]=g,e[27]=v):v=e[27],v}function lr(a){const e=q.c(33),{control:s,form:n,virtualMcpId:i,orgSlug:l,sandboxMap:r}=a,o=Z(),c=bn.useSession().data?.user?.id,f="metadata.runtime.env";let m;e[0]!==n?(m=()=>JSON.stringify(xs(n.getValues(f))),e[0]=n,e[1]=m):m=e[1];const[u,h]=H.useState(m);let d;e[2]!==s?(d={control:s,name:f},e[2]=s,e[3]=d):d=e[3];const x=_s(d);let g;e[4]!==x?(g=JSON.stringify(xs(x)),e[4]=x,e[5]=g):g=e[5];const v=g,y=v!==u;let j;e[6]!==r||e[7]!==c?(j=c?Object.keys(r?.[c]??{}):[],e[6]=r,e[7]=c,e[8]=j):j=e[8];const b=j,w=b.length>0,[S,M]=H.useState(!1);if(!y||!w)return null;let N;e[9]!==v||e[10]!==l||e[11]!==o||e[12]!==b||e[13]!==i?(N=async()=>{M(!0);const L=await Promise.allSettled(b.map(async K=>{const W=ma({orgSlug:l,virtualMcpId:i,branch:K,threadId:null},"setup/start"),G=await fetch(W,{method:"POST"});if(!G.ok){const F=await G.text().catch(()=>G.statusText);throw new Error(F||G.statusText)}}));M(!1);const U=L.filter(rr).length;U===0?(h(v),oe.success(b.length===1?o("sandbox.envVarsField.restartedSingle"):o("sandbox.envVarsField.restartedMultiple",{count:b.length}))):oe.error(o("sandbox.envVarsField.restartFailed",{failed:U,total:b.length}))},e[9]=v,e[10]=l,e[11]=o,e[12]=b,e[13]=i,e[14]=N):N=e[14];const C=N;let k;e[15]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(Ss,{className:"size-3.5 shrink-0"}),e[15]=k):k=e[15];let V;e[16]!==o?(V=o("sandbox.envVarsField.sandboxRunningNotice"),e[16]=o,e[17]=V):V=e[17];let _;e[18]!==V?(_=t.jsxs("div",{className:"flex min-w-0 items-center gap-2 text-warning",children:[k,t.jsx("span",{className:"truncate",children:V})]}),e[18]=V,e[19]=_):_=e[19];let E;e[20]!==S?(E=S?t.jsx(it,{className:"size-3.5"}):t.jsx(yn,{className:"size-3.5"}),e[20]=S,e[21]=E):E=e[21];let D;e[22]!==S||e[23]!==o?(D=o(S?"sandbox.envVarsField.restarting":"sandbox.envVarsField.restartDev"),e[22]=S,e[23]=o,e[24]=D):D=e[24];let $;e[25]!==C||e[26]!==S||e[27]!==D||e[28]!==E?($=t.jsxs(se,{type:"button",variant:"outline",size:"sm",onClick:C,disabled:S,className:"shrink-0",children:[E,D]}),e[25]=C,e[26]=S,e[27]=D,e[28]=E,e[29]=$):$=e[29];let I;return e[30]!==$||e[31]!==_?(I=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:[_,$]}),e[30]=$,e[31]=_,e[32]=I):I=e[32],I}function rr(a){return a.status==="rejected"}function or(a){const e=q.c(62),{control:s,form:n}=a,i=Z(),l="metadata.runtime.env";let r;e[0]!==s?(r={control:s,name:l},e[0]=s,e[1]=r):r=e[1];const o=jn(r),{fields:p,append:c,remove:f}=o;let m;e[2]!==n?(m=(W,G)=>{n.setValue(`${l}.${W}`,G,{shouldDirty:!0,shouldTouch:!0})},e[2]=n,e[3]=m):m=e[3];const u=m,h=xa();let d;if(e[4]!==h){d=new Map;for(const W of h)d.set(W.id,W);e[4]=h,e[5]=d}else d=e[5];const[x,g]=H.useState(null);let v;e[6]!==c?(v=()=>{c({key:"",kind:"literal",value:""})},e[6]=c,e[7]=v):v=e[7];const y=v;let j;e[8]!==c||e[9]!==n||e[10]!==i?(j=async()=>{let W;try{W=await navigator.clipboard.readText()}catch{oe.error(i("sandbox.envVarsField.clipboardReadFailed"));return}if(!W.trim()){oe.error(i("sandbox.envVarsField.clipboardEmpty"));return}let G;try{G=ir(W)}catch(B){const P=B;oe.error(P.message);return}const F=Object.entries(G);if(F.length===0){oe.error(i("sandbox.envVarsField.nothingToAdd"));return}const Y=n.getValues(l)??[],X=new Set;for(const B of Y){const P=(B.key??"").trim();P&&X.add(P)}let T=0,z=0;for(const[B,P]of F){if(X.has(B)){z++;continue}c({key:B,kind:"literal",value:P}),X.add(B),T++}T===0&&z>0?oe.message(i("sandbox.envVarsField.allKeysExist",{count:z})):oe.success(z>0?i("sandbox.envVarsField.addedWithSkipped",{added:T,skipped:z}):i("sandbox.envVarsField.added",{added:T}))},e[8]=c,e[9]=n,e[10]=i,e[11]=j):j=e[11];const b=j;let w;if(e[12]!==s||e[13]!==p||e[14]!==n||e[15]!==f||e[16]!==d||e[17]!==h||e[18]!==u){let W;e[20]!==s||e[21]!==n||e[22]!==f||e[23]!==d||e[24]!==h||e[25]!==u?(W=(G,F)=>t.jsx("li",{className:"rounded-md border border-border bg-background",children:t.jsx(cr,{index:F,control:s,form:n,onUpdateEntry:u,fieldPath:l,secrets:h,secretById:d,onSaveAsSecret:(Y,X)=>g({kind:"save-literal",index:F,presetKey:Y,presetValue:X}),onCreateNewSecret:Y=>g({kind:"create-new",index:F,presetKey:Y}),onRemove:()=>f(F)})},G.id),e[20]=s,e[21]=n,e[22]=f,e[23]=d,e[24]=h,e[25]=u,e[26]=W):W=e[26],w=p.map(W),e[12]=s,e[13]=p,e[14]=n,e[15]=f,e[16]=d,e[17]=h,e[18]=u,e[19]=w}else w=e[19];let S;e[27]!==w?(S=t.jsx("ul",{className:"space-y-2",children:w}),e[27]=w,e[28]=S):S=e[28];let M;e[29]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsx(Pe,{className:"size-3.5"}),e[29]=M):M=e[29];let N;e[30]!==i?(N=i("sandbox.envVarsField.addEnvVar"),e[30]=i,e[31]=N):N=e[31];let C;e[32]!==y||e[33]!==N?(C=t.jsxs(se,{type:"button",variant:"outline",size:"sm",onClick:y,className:"flex-1",children:[M,N]}),e[32]=y,e[33]=N,e[34]=C):C=e[34];let k;e[35]!==i?(k=i("sandbox.envVarsField.pasteDotenvAriaLabel"),e[35]=i,e[36]=k):k=e[36];let V;e[37]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsx(gi,{className:"size-3.5"}),e[37]=V):V=e[37];let _;e[38]!==i?(_=i("sandbox.envVarsField.pasteDotenv"),e[38]=i,e[39]=_):_=e[39];let E;e[40]!==b||e[41]!==k||e[42]!==_?(E=t.jsx(Ce,{asChild:!0,children:t.jsxs(se,{type:"button",variant:"outline",size:"sm",onClick:b,"aria-label":k,children:[V,_]})}),e[40]=b,e[41]=k,e[42]=_,e[43]=E):E=e[43];let D;e[44]!==i?(D=i("sandbox.envVarsField.pasteDotenvTooltip"),e[44]=i,e[45]=D):D=e[45];let $;e[46]!==D?($=t.jsx(ke,{children:D}),e[46]=D,e[47]=$):$=e[47];let I;e[48]!==E||e[49]!==$?(I=t.jsxs(Ne,{children:[E,$]}),e[48]=E,e[49]=$,e[50]=I):I=e[50];let L;e[51]!==I||e[52]!==C?(L=t.jsxs("div",{className:"flex items-center gap-2",children:[C,I]}),e[51]=I,e[52]=C,e[53]=L):L=e[53];let U;e[54]!==x||e[55]!==n||e[56]!==u?(U=x!==null?t.jsx(ur,{mode:x,onClose:()=>g(null),onSaved:W=>{const G=n.getValues(`${l}.${x.index}.key`)?.trim()??"";u(x.index,{key:G,kind:"secret",secretId:W}),g(null)}}):null,e[54]=x,e[55]=n,e[56]=u,e[57]=U):U=e[57];let K;return e[58]!==L||e[59]!==U||e[60]!==S?(K=t.jsxs("div",{className:"space-y-2",children:[S,L,U]}),e[58]=L,e[59]=U,e[60]=S,e[61]=K):K=e[61],K}function cr(a){const e=q.c(77),{index:s,control:n,form:i,onUpdateEntry:l,fieldPath:r,secrets:o,secretById:p,onSaveAsSecret:c,onCreateNewSecret:f,onRemove:m}=a,u=Z(),h=`${r}.${s}.key`,d=`${r}.${s}.value`,x=`${r}.${s}.secretId`,g=`${r}.${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=_s(v)==="secret"?"secret":"literal";let b;e[3]!==i||e[4]!==s||e[5]!==h||e[6]!==c||e[7]!==l||e[8]!==d?(b=P=>{const O=i.getValues(h)?.trim()??"";if(P==="literal"){l(s,{key:O,kind:"literal",value:""});return}const ee=i.getValues(d)??"";if(ee.length>0){c(O,ee);return}l(s,{key:O,kind:"secret",secretId:""})},e[3]=i,e[4]=s,e[5]=h,e[6]=c,e[7]=l,e[8]=d,e[9]=b):b=e[9];const w=b;let S;e[10]!==s||e[11]!==u?(S=P=>{const{field:O}=P,ee=(O.value??"").trim(),ae=ee.length>0&&!gt.test(ee);return t.jsxs("div",{className:"space-y-1",children:[t.jsx(Me,{...O,value:O.value??"",placeholder:u("sandbox.envVarsField.keyPlaceholder"),spellCheck:!1,autoComplete:"off",autoCapitalize:"off",autoCorrect:"off",className:ve("font-mono",ae&&"border-destructive focus-visible:ring-destructive"),"aria-invalid":ae,"aria-label":u("sandbox.envVarsField.envVarKeyLabel",{index:s+1}),onBlur:ce=>{const le=ce.target.value.trim();O.onChange(le),O.onBlur()}}),ae?t.jsx("p",{className:"text-2xs text-destructive",children:u("sandbox.envVarsField.invalidKeyMessage")}):null]})},e[10]=s,e[11]=u,e[12]=S):S=e[12];let M;e[13]!==n||e[14]!==h||e[15]!==S?(M=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx(be,{control:n,name:h,render:S})}),e[13]=n,e[14]=h,e[15]=S,e[16]=M):M=e[16];let N;e[17]!==w?(N=P=>w(P),e[17]=w,e[18]=N):N=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 k;e[20]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx($t,{className:"size-3.5"}),e[20]=k):k=e[20];let V;e[21]!==u?(V=u("sandbox.envVarsField.literal"),e[21]=u,e[22]=V):V=e[22];let _;e[23]!==V?(_=t.jsx(we,{value:"literal",children:t.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[k,V]})}),e[23]=V,e[24]=_):_=e[24];let E;e[25]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(wn,{className:"size-3.5"}),e[25]=E):E=e[25];let D;e[26]!==u?(D=u("sandbox.envVarsField.secret"),e[26]=u,e[27]=D):D=e[27];let $;e[28]!==D?($=t.jsx(we,{value:"secret",children:t.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[E,D]})}),e[28]=D,e[29]=$):$=e[29];let I;e[30]!==$||e[31]!==_?(I=t.jsxs(Ae,{children:[_,$]}),e[30]=$,e[31]=_,e[32]=I):I=e[32];let L;e[33]!==j||e[34]!==I||e[35]!==N?(L=t.jsx("div",{className:"shrink-0",children:t.jsxs($e,{value:j,onValueChange:N,children:[C,I]})}),e[33]=j,e[34]=I,e[35]=N,e[36]=L):L=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]!==o||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:P=>{const{field:O}=P;return t.jsx(Me,{...O,value:O.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:ee=>{O.onChange(ee.target.value),O.onBlur()}})}}):t.jsxs(t.Fragment,{children:[t.jsx(be,{control:n,name:x,render:P=>{const{field:O}=P;return t.jsxs($e,{value:O.value||"",onValueChange:ee=>O.onChange(ee),children:[t.jsx(Oe,{className:ve("h-9 w-full",!O.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(fa,{field:O,secretById:p})})}),t.jsx(Ae,{children:o.length===0?t.jsx("div",{className:"px-2 py-2 text-xs text-muted-foreground",children:u("sandbox.envVarsField.noSecretsYet")}):o.map(dr)})]})}}),t.jsxs(Ne,{children:[t.jsx(Ce,{asChild:!0,children:t.jsx(se,{type:"button",variant:"ghost",size:"icon","aria-label":u("sandbox.envVarsField.createNewSecretAriaLabel"),onClick:()=>{const P=i.getValues(h)?.trim()??"";f(P)},children:t.jsx(Pe,{className:"size-3.5"})})}),t.jsx(ke,{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]=o,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]!==c||e[53]!==u||e[54]!==d?(K=j==="literal"?t.jsxs(Ne,{children:[t.jsx(Ce,{asChild:!0,children:t.jsx(se,{type:"button",variant:"ghost",size:"icon","aria-label":u("sandbox.envVarsField.saveAsSecretAriaLabel"),onClick:()=>{const P=i.getValues(h)?.trim()??"",O=i.getValues(d)??"";c(P,O)},children:t.jsx(vi,{className:"size-3.5"})})}),t.jsx(ke,{children:u("sandbox.envVarsField.saveAsSecret")})]}):null,e[49]=i,e[50]=h,e[51]=j,e[52]=c,e[53]=u,e[54]=d,e[55]=K):K=e[55];let W;e[56]!==u?(W=u("sandbox.envVarsField.removeEnvVarAriaLabel"),e[56]=u,e[57]=W):W=e[57];let G;e[58]===Symbol.for("react.memo_cache_sentinel")?(G=t.jsx(It,{className:"size-3.5"}),e[58]=G):G=e[58];let F;e[59]!==m||e[60]!==W?(F=t.jsx(Ce,{asChild:!0,children:t.jsx(se,{type:"button",variant:"ghost",size:"icon","aria-label":W,onClick:m,children:G})}),e[59]=m,e[60]=W,e[61]=F):F=e[61];let Y;e[62]!==u?(Y=u("sandbox.envVarsField.remove"),e[62]=u,e[63]=Y):Y=e[63];let X;e[64]!==Y?(X=t.jsx(ke,{children:Y}),e[64]=Y,e[65]=X):X=e[65];let T;e[66]!==F||e[67]!==X?(T=t.jsxs(Ne,{children:[F,X]}),e[66]=F,e[67]=X,e[68]=T):T=e[68];let z;e[69]!==K||e[70]!==T?(z=t.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[K,T]}),e[69]=K,e[70]=T,e[71]=z):z=e[71];let B;return e[72]!==L||e[73]!==U||e[74]!==z||e[75]!==M?(B=t.jsxs("div",{className:"flex flex-col gap-2 p-2 sm:flex-row sm:items-center",children:[M,L,U,z]}),e[72]=L,e[73]=U,e[74]=z,e[75]=M,e[76]=B):B=e[76],B}function dr(a){return t.jsx(we,{value:a.id,children:t.jsxs("span",{className:"inline-flex items-center gap-2",children:[t.jsx(ha,{scope:a.scope}),t.jsx("span",{className:"font-mono",children:a.name})]})},a.id)}function ur({mode:a,onClose:e,onSaved:s}){const n=Z(),i=a.kind==="save-literal"?a.presetValue:"",l=a.presetKey,[r,o]=H.useState(()=>mr(l)),[p,c]=H.useState("organization"),[f,m]=H.useState(i),[u,h]=H.useState(""),d=ga(),x=r.trim(),g=f.length>0&&x.length>0&&pa.test(x),v=async b=>{if(b.preventDefault(),!!g)try{const w=await d.mutateAsync({scope:p,name:x,value:f,description:u.trim()||void 0});oe.success(n("sandbox.envVarsField.secretSaved",{name:w.name})),s(w.id)}catch(w){oe.error(w instanceof Error?w.message:n("sandbox.envVarsField.failedToSaveSecret"))}},y=a.kind==="save-literal"?n("sandbox.envVarsField.saveValueAsSecretTitle"):n("sandbox.envVarsField.createNewSecretTitle"),j=a.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(at,{children:[t.jsx(lt,{children:y}),t.jsx(Ms,{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=>c(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(Me,{id:"save-secret-name",value:r,onChange:b=>o(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(Me,{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(se,{type:"button",variant:"outline",onClick:e,disabled:d.isPending,children:n("sandbox.envVarsField.cancel")}),t.jsx(se,{type:"submit",disabled:!g||d.isPending,children:d.isPending?n("sandbox.envVarsField.saving"):n("sandbox.envVarsField.saveSecret")})]})]})]})})}function xs(a){if(!Array.isArray(a))return[];const e=[];for(const s of a){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 mr(a){const e=a.trim();return e&&gt.test(e)?e:""}function fr(a){const e=q.c(21),{repo:s,className:n}=a,i=Z();let l;e[0]!==n?(l=ve("space-y-2",n),e[0]=n,e[1]=l):l=e[1];let r;e[2]!==i?(r=i("sandbox.repoRow.label"),e[2]=i,e[3]=r):r=e[3];let o;e[4]!==r?(o=t.jsx(ye,{children:r}),e[4]=r,e[5]=o):o=e[5];let p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(va,{size:20,className:"shrink-0 text-foreground/60"}),e[6]=p):p=e[6];let c;e[7]!==s||e[8]!==i?(c=t.jsx(Ce,{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]=c):c=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(ke,{children:f}),e[12]=f,e[13]=m):m=e[13];let u;e[14]!==c||e[15]!==m?(u=t.jsxs(Ne,{children:[c,m]}),e[14]=c,e[15]=m,e[16]=u):u=e[16];let h;return e[17]!==l||e[18]!==o||e[19]!==u?(h=t.jsxs("div",{className:l,children:[o,u]}),e[17]=l,e[18]=o,e[19]=u,e[20]=h):h=e[20],h}const pr={npm:{install:"npm install",run:a=>`npm run ${a}`,runtime:"node"},pnpm:{install:"pnpm install",run:a=>`pnpm run ${a}`,runtime:"node"},yarn:{install:"yarn install",run:a=>`yarn run ${a}`,runtime:"node"},bun:{install:"bun install",run:a=>`bun run ${a}`,runtime:"bun"},deno:{install:"deno install",run:a=>`deno task ${a}`,runtime:"deno"}};function hr(a){const e=a.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 xr=Object.keys(pr),Nt="__none__";function gr(a){const e=q.c(47),{control:s}=a,n=Z(),i=H.useRef(null);let l;e[0]!==n?(l=n("sandbox.runtimeFields.packageManager"),e[0]=n,e[1]=l):l=e[1];let r;e[2]!==l?(r=t.jsx(ye,{htmlFor:"runtime-pm",children:l}),e[2]=l,e[3]=r):r=e[3];let o;e[4]!==n?(o=N=>{const{field:C}=N;return t.jsxs($e,{value:C.value??Nt,onValueChange:k=>C.onChange(k===Nt?null:k),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")}),xr.map(br)]})]})},e[4]=n,e[5]=o):o=e[5];let p;e[6]!==s||e[7]!==o?(p=t.jsx(be,{control:s,name:"metadata.runtime.selected",render:o}),e[6]=s,e[7]=o,e[8]=p):p=e[8];let c;e[9]!==r||e[10]!==p?(c=t.jsxs("div",{className:"space-y-2",children:[r,p]}),e[9]=r,e[10]=p,e[11]=c):c=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:vr}),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=N=>{const{field:C}=N;return t.jsx(Me,{ref:i,id:"runtime-port",inputMode:"numeric",placeholder:n("sandbox.runtimeFields.auto"),defaultValue:C.value??"",onBlur:k=>{const V=hr(k.target.value);V.ok?C.onChange(V.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 w;e[37]!==b?(w=t.jsx("p",{className:"text-xs text-muted-foreground",children:b}),e[37]=b,e[38]=w):w=e[38];let S;e[39]!==v||e[40]!==j||e[41]!==w?(S=t.jsxs("div",{className:"space-y-2",children:[v,j,w]}),e[39]=v,e[40]=j,e[41]=w,e[42]=S):S=e[42];let M;return e[43]!==x||e[44]!==S||e[45]!==c?(M=t.jsxs("div",{className:"space-y-5",children:[c,x,S]}),e[43]=x,e[44]=S,e[45]=c,e[46]=M):M=e[46],M}function vr(a){const{field:e}=a;return t.jsx(Me,{id:"runtime-path",placeholder:".",defaultValue:e.value??"",onBlur:s=>{const n=s.target.value.trim();e.onChange(n===""?null:n)}})}function br(a){return t.jsx(we,{value:a,children:a},a)}function jr(a){const e=q.c(5),{control:s}=a,n=Z();let i;e[0]!==n?(i=r=>{const{field:o}=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:"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:o.value??!1,onCheckedChange:p=>o.onChange(p)})]})},e[0]=n,e[1]=i):i=e[1];let l;return e[2]!==s||e[3]!==i?(l=t.jsx(be,{control:s,name:"metadata.fieldDescriptionTooltips",render:i}),e[2]=s,e[3]=i,e[4]=l):l=e[4],l}function yr(a){const e=q.c(32),{control:s,onCommit:n}=a,i=Z();let l;e[0]!==i?(l=i("virtualMcp.virtualMcp.publishPolicySmart"),e[0]=i,e[1]=l):l=e[1];let r;e[2]!==i?(r=i("virtualMcp.virtualMcp.publishPolicySmartDescription"),e[2]=i,e[3]=r):r=e[3];let o;e[4]!==l||e[5]!==r?(o={value:"smart",label:l,description:r},e[4]=l,e[5]=r,e[6]=o):o=e[6];let p;e[7]!==i?(p=i("virtualMcp.virtualMcp.publishPolicyCodeReview"),e[7]=i,e[8]=p):p=e[8];let c;e[9]!==i?(c=i("virtualMcp.virtualMcp.publishPolicyCodeReviewDescription"),e[9]=i,e[10]=c):c=e[10];let f;e[11]!==p||e[12]!==c?(f={value:"code-review",label:p,description:c},e[11]=p,e[12]=c,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]!==o||e[22]!==f||e[23]!==h?(d=[o,f,h],e[21]=o,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:w=>{j.onChange(w),n()},children:[t.jsx(Oe,{id:"publish-policy",className:"w-44 shrink-0",children:t.jsx(Ie,{})}),t.jsx(Ae,{className:"max-w-80",children:x.map(wr)})]})]})},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 wr(a){return t.jsx(we,{value:a.value,description:a.description,children:a.label},a.value)}function Sr(a){const e=q.c(24),{control:s,onCommit:n}=a,i=Z();let l;e[0]!==i?(l=i("sandbox.cmsSettings.contentEditing.off"),e[0]=i,e[1]=l):l=e[1];let r;e[2]!==i?(r=i("sandbox.cmsSettings.contentEditing.offDescription"),e[2]=i,e[3]=r):r=e[3];let o;e[4]!==l||e[5]!==r?(o={value:"off",label:l,description:r},e[4]=l,e[5]=r,e[6]=o):o=e[6];let p;e[7]!==i?(p=i("sandbox.cmsSettings.contentEditing.on"),e[7]=i,e[8]=p):p=e[8];let c;e[9]!==i?(c=i("sandbox.cmsSettings.contentEditing.onDescription"),e[9]=i,e[10]=c):c=e[10];let f;e[11]!==p||e[12]!==c?(f={value:"on",label:p,description:c},e[11]=p,e[12]=c,e[13]=f):f=e[13];let m;e[14]!==o||e[15]!==f?(m=[o,f],e[14]=o,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=Ks(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=la.safeParse(j);b.success&&(g.onChange(ra(v,b.data)),n())},children:[t.jsx(Oe,{id:"content-editing-mode",className:"w-44 shrink-0",children:t.jsx(Ie,{})}),t.jsx(Ae,{className:"max-w-80",children:u.map(Nr)})]})]})},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 Nr(a){return t.jsx(we,{value:a.value,description:a.description,children:a.label},a.value)}function gs(a){const e=a.metadata?.sidebarViews,s=a.metadata?.sidebarViewsVersion;return{effectiveViews:[...Mt(_t(a.metadata),s)],rawViews:e===null?null:e?[...e]:void 0,version:s,seen:a.metadata?.sidebarViewsSeen??void 0}}function vs(a,e){return a===e?!0:!a||!e||a.length!==e.length?!1:a.every((s,n)=>s===e[n])}function Cr(a,e){switch(e.type){case"SET_SHARE_DIALOG_OPEN":return{...a,shareDialogOpen:e.payload};case"SET_ADD_DIALOG_OPEN":return{...a,addDialogOpen:e.payload};case"OPEN_SETTINGS":return{...a,settingsDialogOpen:!0,settingsConnectionId:e.payload};case"CLOSE_SETTINGS":return{...a,settingsDialogOpen:!1,settingsConnectionId:null};default:return a}}function kr(a,e){switch(e.type){case"accumulate":{const s=a??{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 Mr(a){const e=a.metadata?.runtime?.env;if(!e||e.length===0)return a;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?a:{...a,metadata:{...a.metadata,runtime:{...a.metadata?.runtime??{},env:s}}}}async function _r(a,e){const s=a?.idToken??null;if(s){const i=bs(s);if(i)return i}const n=a?.userinfoEndpoint??null;if(n)try{const i=await fetch(n,{headers:{Authorization:`Bearer ${e}`}});if(i.ok){const l=await i.json(),r=typeof l.email=="string"?l.email:typeof l.upn=="string"?l.upn:typeof l.preferred_username=="string"?l.preferred_username:null;if(r)return r}}catch{}return bs(e)}function bs(a){try{const e=a.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 Vr({virtualMcp:a,contextSection:e}){const s=Z(),n=$n(),{org:i}=Fe(),l=Hn(),{data:r}=Qn([a.id]),o=r?.get(a.id)?.last_used_at,p=Vs(),c=ks(),f=Tt(),m=Bs(a.id),u=JSON.stringify([i.id,a.id]),h=qi(a.metadata,m.snapshot()),d=Sn({resolver:Nn(Gl),defaultValues:{...a,metadata:{...ns(a.metadata),previewServerUrl:ia(a.metadata),...h}}}),x=d.watch("connections"),g=$i(a),v=Ys(a?.metadata),y=v&&Ks(d.watch("metadata.ui.layout"))==="off",j=Ds(a),b=j?{owner:j.owner,name:j.name,url:j.url}:null,[w,S]=H.useReducer(Cr,{shareDialogOpen:!1,addDialogOpen:!1,settingsDialogOpen:!1,settingsConnectionId:null}),[M,N]=H.useState(!1),[C,k]=H.useState(!1),{openSidePanel:V}=On(),{sendMessage:_}=Vn(),E=async()=>{if(C)return;const R=d.getValues("metadata.instructions");if(R?.trim()){k(!0);try{U(),Ve("agent_instructions_improve_clicked",{agent_id:a.id,instructions_length:R.length}),V();const te=Mn(i.id);await _({tiptapDoc:Dn({managerAgentId:te.id,managerName:te.title,kind:"agent",id:a.id,instructions:R})})}finally{k(!1)}}},[D,$]=H.useReducer(kr,null),I=()=>{D!==null&&(Ve("agent_updated",{agent_id:a.id,fields:Array.from(D.fields),instructions_length:D.instructionsLength,save_count:D.saveCount,edit_duration_ms:Date.now()-D.start}),$({type:"reset"}))},{schedule:L,flush:U}=Jt({delayMs:3e4,save:async()=>I()}),K=async()=>{const R=m.snapshot(),te={predicate:Se=>ss(Se.queryKey,i.id)},J=async()=>(await c.invalidateQueries({predicate:Se=>ss(Se.queryKey,i.id),refetchType:"all"}),ts(c,i.id,a.id)),pe=(Se,Ge)=>{if(Se){vs(d.getValues("metadata.sidebarViews"),Se.rawViews)||d.setValue("metadata.sidebarViews",Se.rawViews,{shouldDirty:!1}),d.getValues("metadata.sidebarViewsVersion")!==Se.version&&d.setValue("metadata.sidebarViewsVersion",Se.version,{shouldDirty:!1}),vs(d.getValues("metadata.sidebarViewsSeen"),Se.seen)||d.setValue("metadata.sidebarViewsSeen",Se.seen,{shouldDirty:!1});return}Ge!==null&&(d.setValue("metadata.sidebarViews",[...Ge],{shouldDirty:!1}),d.setValue("metadata.sidebarViewsVersion",Ki,{shouldDirty:!1}))},_e=Hi(R),Te=Object.keys(d.control._formState.dirtyFields);if(Te.length===0&&!_e){await m.settle({snapshot:R,saved:!0,authoritativeViews:R?.persistedViews});return}const We=Te.length>0?Te:["metadata"],ot=We.includes("metadata"),Ke=d.getValues();d.reset(Ke,{keepValues:!0});const et=Mr(Ke),ln=ts(c,i.id,a.id),rn=Qi({sidebarViews:et.metadata?.sidebarViews,sidebarViewsVersion:et.metadata?.sidebarViewsVersion},R,ln?.metadata);et.metadata={...ns(et.metadata),...rn};let bt;try{bt=await l.update.mutateAsync({id:a.id,data:et})}catch(Se){let Ge=null;try{Ge=await J()}catch{}const Rt=Ge?gs(Ge):null,Lt=await m.settle({snapshot:R,saved:!1,authoritativeViews:Rt?.effectiveViews});throw Lt.settledLatest&&pe(Rt,Lt.reconciledViews),Se}await c.cancelQueries(te),Xi(c,i.id,bt);const Et=gs(bt),zt=await m.settle({snapshot:R,saved:!0,authoritativeViews:Et.effectiveViews});zt.settledLatest&&pe(Et,zt.reconciledViews),$({type:"accumulate",now:Date.now(),fields:We,instructionsLength:ot?Ke.metadata?.instructions?.length??0:null}),L()},W=()=>ba(u,K),{schedule:G,flush:F}=Jt({save:W});H.useEffect(()=>{const R=d.watch(()=>G());return()=>R.unsubscribe()},[]);const Y=()=>{Ve("connections_dialog_opened",{source:"agent_settings",mode:"add"}),S({type:"SET_ADD_DIALOG_OPEN",payload:!0})},X=async R=>{const te=d.getValues("connections");if(te.some(_e=>_e.connection_id===R))return;d.setValue("connections",[...te,{connection_id:R,selected_tools:St.tools,selected_resources:St.resources,selected_prompts:St.prompts}],{shouldDirty:!0}),S({type:"SET_ADD_DIALOG_OPEN",payload:!1});const J=new URL(`/api/${i.slug}/mcp/${R}`,window.location.origin),pe=await Gt({url:J.href,token:null,orgId:i.id});pe.supportsOAuth&&!pe.isAuthenticated&&await O(R)},T=R=>{const J=d.getValues("connections").filter(pe=>pe.connection_id!==R);d.setValue("connections",J,{shouldDirty:!0})},z=(R,te)=>{const J=d.getValues("connections");if(J.some(pe=>pe.connection_id===te)){oe.error(s("virtualMcp.virtualMcp.instanceAlreadyAdded"));return}d.setValue("connections",J.map(pe=>pe.connection_id===R?{...pe,connection_id:te}:pe),{shouldDirty:!0})},B=async R=>{if(d.getValues("connections").find(J=>J.connection_id===R))try{const{item:J}=await f.call("COLLECTION_CONNECTIONS_GET",{id:R});if(!J)return;const pe=J.title.replace(/\s*\(.*?\)\s*$/,""),_e=_n("conn"),Te=`${pe} (${Date.now().toString(36).slice(-4)})`;await p.create.mutateAsync({id:_e,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/${_e}`,window.location.origin),ot=await Gt({url:We.href,token:null,orgId:i.id});if(ot.supportsOAuth&&!ot.isAuthenticated){const Ke=await O(_e);if(!Ke){await p.delete.mutateAsync(_e);return}await p.update.mutateAsync({id:_e,data:{title:`${pe} (${Ke})`}})}z(R,_e),oe.success(s("virtualMcp.virtualMcp.newInstanceCreated"))}catch(J){console.error("Failed to create instance:",J),oe.error(s("virtualMcp.virtualMcp.failedToCreateInstance"))}},P=R=>{S({type:"OPEN_SETTINGS",payload:R})},O=async R=>{const{token:te,tokenInfo:J,error:pe}=await En({connectionId:R,orgSlug:i.slug,scope:"offline_access"});if(pe||!te)return oe.error(s("virtualMcp.virtualMcp.authenticationFailed",{error:pe??""})),null;if(J)try{const Te=await fetch(`/api/${i.slug}/connections/${R}/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:R,data:{connection_token:te}});else try{await p.update.mutateAsync({id:R,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:R,data:{connection_token:te}})}else await p.update.mutateAsync({id:R,data:{connection_token:te}});const _e=new URL(`/api/${i.slug}/mcp/${R}`,window.location.origin);return await c.invalidateQueries({queryKey:Dt.isMCPAuthenticated(_e.href,null)}),oe.success(s("virtualMcp.virtualMcp.authenticationSuccessful")),_r(J,te)},ee=()=>{const R=d.getValues("metadata.instructions")??"",te=s("virtualMcp.virtualMcp.promptTemplateContent"),J=R.trim()?`${R}
3
3
 
4
4
  ${te}`:te;d.setValue("metadata.instructions",J,{shouldDirty:!0})},ae=new Set(x.map(R=>R.connection_id)),{section:ce}=El(),le=e!==null,ie=e==="instructions"?null:e??ce,Q=ie==="general",de=le?e==="instructions":Q,ue=Fi(a.id)==="v8",he=Al({virtualMcpId:a.id,form:d,flushAndSave:F}),me=Pt(),[xe,ge]=H.useState(!1),fe=async()=>{U();try{await l.delete.mutateAsync(a.id),Ve("agent_deleted",{agent_id:a.id,source:"agent_detail"}),oe.success(s("virtualMcp.virtualMcp.agentDeleted",{title:a.title})),me({to:"/$org",params:{org:i.slug}})}catch{}},A=t.jsxs(se,{variant:"outline",size:"sm",onClick:()=>{Ve("agent_connect_modal_opened",{agent_id:a.id}),S({type:"SET_SHARE_DIALOG_OPEN",payload:!0})},children:[t.jsx(Cn,{size:14}),s("virtualMcp.virtualMcp.connect")]}),ne=t.jsxs("div",{className:"flex items-center gap-2",children:[!d.watch("metadata.instructions")?.trim()&&t.jsx(se,{variant:"outline",size:"sm",onClick:ee,children:s("virtualMcp.virtualMcp.promptTemplate")}),t.jsxs(se,{variant:"outline",size:"sm",disabled:C||!d.watch("metadata.instructions")?.trim(),onClick:E,children:[t.jsx(dt,{size:13}),s("virtualMcp.virtualMcp.improve")]})]});return t.jsxs(Ue,{children:[t.jsxs(t.Fragment,{children:[!le&&t.jsxs(t.Fragment,{children:[t.jsx(Ue.Title,{children:s("virtualMcp.settings.title")}),t.jsx(Fl,{section:ie??"general"})]}),t.jsx(Ue.Actions,{secondary:ie==="connections"?A:void 0,children:ie==="connections"?t.jsxs(se,{size:"sm",onClick:Y,children:[t.jsx(Pe,{size:14}),s("virtualMcp.virtualMcp.addConnection")]}):A}),t.jsx(Ue.Content,{children:t.jsx(Ue.Container,{width:"standard",className:"@container/project-settings",children:t.jsxs(kn,{children:[Q&&t.jsx(Pl,{views:he}),Q&&t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx($l,{form:d,onCommit:F}),t.jsxs("div",{className:"flex flex-wrap items-center gap-2 px-4 text-xs text-muted-foreground",children:[t.jsx(Tn,{id:a.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")," ",Ba(new Date(a.created_at),"PP",{locale:n})]}),t.jsx("span",{className:"text-muted-foreground/50",children:"·"}),t.jsx("span",{children:o?s("virtualMcp.virtualMcp.lastUsed",{time:Fn(new Date(o),{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:Y,className:"flex items-center gap-3 px-3 py-2.5 rounded-lg border border-dashed border-border hover:bg-accent 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(R=>t.jsx(Ye,{fallback:()=>null,children:t.jsx(H.Suspense,{fallback:t.jsx(en,{}),children:t.jsx(jl,{connection_id:R.connection_id,usedConnectionIds:ae,onOpenSettings:()=>P(R.connection_id),onRemove:()=>T(R.connection_id),onAuthenticate:O,onSwitchInstance:z,onNewInstance:()=>B(R.connection_id)})})},R.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:R})=>t.jsxs("div",{className:"relative rounded-xl shadow-edge bg-card focus-within-ring",children:[t.jsx(ut,{...R,value:R.value??"",onChange:te=>{R.onChange(te)},onBlur:()=>{R.onBlur(),F()},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(Ne,{delayDuration:0,children:[t.jsx(Ce,{asChild:!0,children:t.jsx(se,{type:"button",variant:"ghost",size:"icon-sm",className:"absolute top-2 right-2 text-muted-foreground",onClick:()=>N(!0),"aria-label":s("virtualMcp.virtualMcp.openFullscreenEditor"),children:t.jsx(bi,{size:14})})}),t.jsx(ke,{side:"left",children:s("virtualMcp.virtualMcp.fullscreen")})]})]})})]}),de&&t.jsx(Ka,{form:d}),Q&&t.jsx(Ye,{fallback:()=>null,children:t.jsx(H.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(tl,{form:d,currentAgentId:a.id})})}),ie==="site"&&v&&t.jsx(Be,{title:s("sandbox.cmsSettings.title"),children:t.jsxs(ze,{children:[t.jsx(je,{children:t.jsx(Sr,{control:d.control,onCommit:F})}),!y&&t.jsx(je,{children:t.jsx(jr,{control:d.control})}),!y&&g&&t.jsx(je,{children:t.jsx(yr,{control:d.control,onCommit:F})})]})}),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(Kl,{control:d.control,isBlocksV8:ue,previewServerUrl:d.watch("metadata.previewServerUrl"),fastPreview:d.watch("metadata.fastPreview")})})}),ie==="site"&&ue&&g&&t.jsx(Ll,{orgSlug:i.slug,virtualMcpId:a.id}),ie==="site"&&t.jsx(Be,{title:s("virtualMcp.virtualMcp.sandbox"),children:t.jsxs(ze,{children:[t.jsx(je,{children:t.jsx(fr,{repo:b})}),t.jsx(je,{children:t.jsx(gr,{control:d.control})}),t.jsx(je,{children:t.jsx(ar,{control:d.control,form:d,virtualMcpId:a.id,orgSlug:i.slug,sandboxMap:a.metadata.sandboxMap})})]})}),Q&&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(se,{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(zn,{open:xe,onOpenChange:ge,children:t.jsxs(Rn,{children:[t.jsxs(Ln,{children:[t.jsx(Un,{children:s("virtualMcp.virtualMcp.deleteAgentConfirm")}),t.jsx(Yn,{children:s("virtualMcp.virtualMcp.deleteAgentConfirmDescription",{title:a.title})})]}),t.jsxs(Bn,{children:[t.jsx(Wn,{children:s("virtualMcp.virtualMcp.cancel")}),t.jsx(Kn,{onClick:fe,variant:"destructive",children:s("virtualMcp.virtualMcp.delete")})]})]})}),t.jsx(yi,{open:w.addDialogOpen,onOpenChange:R=>S({type:"SET_ADD_DIALOG_OPEN",payload:R}),agentId:a.id,addedConnectionIds:ae,onAdd:X}),t.jsx(bl,{open:w.settingsDialogOpen,onOpenChange:R=>{R||S({type:"CLOSE_SETTINGS"})},selectedId:w.settingsConnectionId,form:d,connections:x,onAuthenticate:O}),t.jsx(sr,{open:w.shareDialogOpen,onOpenChange:R=>S({type:"SET_SHARE_DIALOG_OPEN",payload:R}),virtualMcp:a}),t.jsx(Xe,{open:M,onOpenChange:N,children:t.jsxs(Je,{className:"w-[90vw] sm:max-w-6xl h-[85vh] flex flex-col p-0 gap-0",children:[t.jsx(at,{className:"px-6 pt-6 pb-3 border-b border-border shrink-0",children:t.jsx(lt,{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:R})=>t.jsx(ut,{...R,value:R.value??"",onChange:te=>{R.onChange(te)},onBlur:()=>{R.onBlur(),F()},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 shadow-edge px-4 py-3 focus-ring bg-card border-0",style:{boxShadow:"none"}})})})]})})]})}function Yo(a){const e=q.c(22),{virtualMcpId:s,contextSection:n}=a,i=n===void 0?null:n,l=Z(),r=Pt(),{org:o}=Fe(),p=Ts(s);if(!p){let u;e[0]!==l?(u=l("virtualMcp.virtualMcp.spaceNotFound"),e[0]=l,e[1]=u):u=e[1];let h;e[2]!==l?(h=l("virtualMcp.virtualMcp.spaceNotFoundDescription"),e[2]=l,e[3]=h):h=e[3];let d;e[4]!==r||e[5]!==o.slug?(d=()=>r({to:"/$org",params:{org:o.slug}}),e[4]=r,e[5]=o.slug,e[6]=d):d=e[6];let x;e[7]!==l?(x=l("virtualMcp.virtualMcp.backToSpaces"),e[7]=l,e[8]=x):x=e[8];let g;e[9]!==d||e[10]!==x?(g=t.jsx(se,{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(Pn,{title:u,description:h,actions:g})}),e[12]=u,e[13]=h,e[14]=g,e[15]=v):v=e[15],v}let c;e[16]!==p?(c=Ds(p)?.connectionId??"",e[16]=p,e[17]=c):c=e[17];const f=`${p.id}:${c}`;let m;return e[18]!==i||e[19]!==f||e[20]!==p?(m=t.jsx(Vr,{virtualMcp:p,contextSection:i},f),e[18]=i,e[19]=f,e[20]=p,e[21]=m):m=e[21],m}export{Yo as V};