decocms 4.308.0 → 4.309.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (277) hide show
  1. package/dist/client/assets/{AlertCircle-BTlJp8pf.js → AlertCircle-DjJuKNpT.js} +1 -1
  2. package/dist/client/assets/{AreaChart-dJjxY072.js → AreaChart-kZvNKRet.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-BwagOJkb.js → ArrowLeft-C_Y8Bely.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-CVoISkQ4.js → ArrowUp-BYrhsenq.js} +1 -1
  5. package/dist/client/assets/{Check-D5PKBQ5I.js → Check-ZUPvSIY1.js} +1 -1
  6. package/dist/client/assets/{CheckCircle-teyxVGFp.js → CheckCircle-dmPxKm6Q.js} +1 -1
  7. package/dist/client/assets/{ChevronDown-Csfjhwpm.js → ChevronDown-B5h3xBzG.js} +1 -1
  8. package/dist/client/assets/{ChevronRight-DUmHQrD7.js → ChevronRight-B7yQJpqe.js} +1 -1
  9. package/dist/client/assets/{ChevronSelectorVertical-CuAhXy3x.js → ChevronSelectorVertical-BKocJeEl.js} +1 -1
  10. package/dist/client/assets/{ChevronUp-Dlj_U0qV.js → ChevronUp-mam1pcOG.js} +1 -1
  11. package/dist/client/assets/{Copy01-CsNpp9jr.js → Copy01-Bi-8gnDf.js} +1 -1
  12. package/dist/client/assets/{CreditCard01-YCHpZ00A.js → CreditCard01-2q1G626x.js} +1 -1
  13. package/dist/client/assets/{DotsVertical-CpVcGDJ_.js → DotsVertical-CweDntTS.js} +1 -1
  14. package/dist/client/assets/{Download01-BN9BT9cL.js → Download01-O-pqsN1Z.js} +1 -1
  15. package/dist/client/assets/{Eye-DgiSa7UT.js → Eye-B11wsTiv.js} +1 -1
  16. package/dist/client/assets/{FilterLines-Db8-uWfr.js → FilterLines-DWRi50MF.js} +1 -1
  17. package/dist/client/assets/GitBranch01-BTBkNwkA.js +1 -0
  18. package/dist/client/assets/{Globe01-CV-16mwB.js → Globe01-DwDaYvYx.js} +1 -1
  19. package/dist/client/assets/{Globe04-D3O2XfOT.js → Globe04-CVhg83Sy.js} +1 -1
  20. package/dist/client/assets/{HardDrive-CWvDYc59.js → HardDrive-B_rUJ_6M.js} +1 -1
  21. package/dist/client/assets/Image01-KKf4o3Nq.js +1 -0
  22. package/dist/client/assets/{Key01-D4srNqPO.js → Key01-C-JhvDG5.js} +1 -1
  23. package/dist/client/assets/{LinkExternal01-CIL2SNWf.js → LinkExternal01-CSb7QkDd.js} +1 -1
  24. package/dist/client/assets/{LockUnlocked01-BpeKJGM4.js → LockUnlocked01-Bv3So7k2.js} +1 -1
  25. package/dist/client/assets/{LogOut01-qWWgaWbQ.js → LogOut01-DjC5EdoY.js} +1 -1
  26. package/dist/client/assets/{Monitor01-uq-dlf-u.js → Monitor01-wprytgTE.js} +1 -1
  27. package/dist/client/assets/Package-DMwvlEmW.js +1 -0
  28. package/dist/client/assets/{Palette-Cv68Zggp.js → Palette-tGNNpIug.js} +1 -1
  29. package/dist/client/assets/{Play-C9xK8clC.js → Play-DNNjmI0u.js} +1 -1
  30. package/dist/client/assets/{Plus-CPkR-QLd.js → Plus-DCy4MeWK.js} +1 -1
  31. package/dist/client/assets/{SearchLg-8daQliv2.js → SearchLg-DgOOjbgd.js} +1 -1
  32. package/dist/client/assets/{SearchMd-ClTH3fiN.js → SearchMd-CLw08zqm.js} +1 -1
  33. package/dist/client/assets/{Settings02-BMcJFHpd.js → Settings02-D7sfyUmR.js} +1 -1
  34. package/dist/client/assets/{Share07-CPDrxQV8.js → Share07-C56F3Gg7.js} +1 -1
  35. package/dist/client/assets/{Shield01-C9M_jcOJ.js → Shield01-CqA0iXsO.js} +1 -1
  36. package/dist/client/assets/{Stars01-BzEDQnsl.js → Stars01-DMmYT0fx.js} +1 -1
  37. package/dist/client/assets/{Stars02-DZNA1z2-.js → Stars02-DLV5S20i.js} +1 -1
  38. package/dist/client/assets/{Sun-BBWjOwQE.js → Sun-BA4C3T_x.js} +1 -1
  39. package/dist/client/assets/{SwitchHorizontal01-CSyGO1HX.js → SwitchHorizontal01-jUbzzC0z.js} +1 -1
  40. package/dist/client/assets/Tool01-Cq1KgOCX.js +1 -0
  41. package/dist/client/assets/{Tool02-jKKU1_dM.js → Tool02-BC_NjMLE.js} +1 -1
  42. package/dist/client/assets/{Trash01-Dp-QTpAR.js → Trash01-sUPXJwby.js} +1 -1
  43. package/dist/client/assets/{TrendUp01-DikSDrNg.js → TrendUp01-DKwxv6x5.js} +1 -1
  44. package/dist/client/assets/{Upload01-DxCHPffq.js → Upload01-DcDcb9rh.js} +1 -1
  45. package/dist/client/assets/{User01-DJ_BO2EX.js → User01-BeBX7mHS.js} +1 -1
  46. package/dist/client/assets/UserSquare-ClrWk75C.js +1 -0
  47. package/dist/client/assets/{Users01-B2wc_Wgl.js → Users01-Wyh0NzMp.js} +1 -1
  48. package/dist/client/assets/{Users03-BUoBV4mB.js → Users03-BmoLDMiu.js} +1 -1
  49. package/dist/client/assets/{XCircle-CVbKXkpd.js → XCircle-DAPVrZS5.js} +1 -1
  50. package/dist/client/assets/{XClose-CTv0nnSb.js → XClose-DpmiJyhV.js} +1 -1
  51. package/dist/client/assets/{YAxis-DxhC7uB4.js → YAxis-Chl8mkhq.js} +1 -1
  52. package/dist/client/assets/{Zap-MbQ2aiA8.js → Zap-Dd_sTqLD.js} +1 -1
  53. package/dist/client/assets/{ZapSquare-BZzRAQpm.js → ZapSquare-oLl79jhp.js} +1 -1
  54. package/dist/client/assets/ZoomOut-C8IyIWyv.js +1 -0
  55. package/dist/client/assets/{access-gate-BZ6Xc62y.js → access-gate-DZeapkSG.js} +1 -1
  56. package/dist/client/assets/agent-icon-Cf-ubcXW.js +1 -0
  57. package/dist/client/assets/agents-list-CHpqALWD.js +1 -0
  58. package/dist/client/assets/{ai-providers-PPaiM-vM.js → ai-providers-Dg-3WcPx.js} +2 -2
  59. package/dist/client/assets/{alert-CIFaGTb_.js → alert-DZ0e79vM.js} +1 -1
  60. package/dist/client/assets/{alert-dialog-Dh9zsaCy.js → alert-dialog-b0E3aJVR.js} +1 -1
  61. package/dist/client/assets/{api-keys-B5Q1NcTU.js → api-keys-PtXolhjU.js} +1 -1
  62. package/dist/client/assets/app-editor-BJ3x5fhn.js +1 -0
  63. package/dist/client/assets/{auth-D8IdOmGw.js → auth-Cae4y-0o.js} +1 -1
  64. package/dist/client/assets/{auth-catchall-PSQzhhPS.js → auth-catchall-CwXL0leV.js} +1 -1
  65. package/dist/client/assets/{auth-entry-DZQ7ulSa.js → auth-entry-C0AuTVoj.js} +1 -1
  66. package/dist/client/assets/{auth-split-layout-D4SJJOXB.js → auth-split-layout-D6d3VTLu.js} +1 -1
  67. package/dist/client/assets/{authenticate-and-persist-oauth-DY_hbkIG.js → authenticate-and-persist-oauth-BggiffQp.js} +1 -1
  68. package/dist/client/assets/{automation-list-row-CLAw5ACh.js → automation-list-row-UmgnHCCX.js} +1 -1
  69. package/dist/client/assets/automation-runs-BZxuxKnQ.js +187 -0
  70. package/dist/client/assets/automations-BxiRiby5.js +1 -0
  71. package/dist/client/assets/{avatar-D-QkiqIH.js → avatar-BPJyv_yp.js} +1 -1
  72. package/dist/client/assets/{badge-DX3_GQsO.js → badge-DYayppBi.js} +1 -1
  73. package/dist/client/assets/{block-document-D0mVcltx.js → block-document-g3Xu-Yyy.js} +2 -2
  74. package/dist/client/assets/{breadcrumb-Clut3vXk.js → breadcrumb-C0oEMh1_.js} +1 -1
  75. package/dist/client/assets/{buckets-CNyoBCui.js → buckets-yzHKHE-P.js} +1 -1
  76. package/dist/client/assets/bulk-category-panel-BmQqUgQl.js +1 -0
  77. package/dist/client/assets/{capability-load-error-BtIV807c.js → capability-load-error-CEZm3Rty.js} +1 -1
  78. package/dist/client/assets/cards-CQcoFp8K.js +8 -0
  79. package/dist/client/assets/category-editor-DJgTtbgj.js +1 -0
  80. package/dist/client/assets/{chart-BS94Bf-2.js → chart-CMkD0KRw.js} +3 -3
  81. package/dist/client/assets/chat-context-By9g0pMv.js +35 -0
  82. package/dist/client/assets/{checkbox-Gg7TSWGl.js → checkbox-Dj1W7iKN.js} +1 -1
  83. package/dist/client/assets/choose-editor-CC7UTJ07.js +1 -0
  84. package/dist/client/assets/{cli-auth-success-DMKVkxdU.js → cli-auth-success-DVoGs8GQ.js} +1 -1
  85. package/dist/client/assets/collection-detail-BQBEKUzV.js +1 -0
  86. package/dist/client/assets/{collection-display-button-jLXxSVGC.js → collection-display-button-8EhZbHh8.js} +1 -1
  87. package/dist/client/assets/{collection-search-0N-i_PHL.js → collection-search-D5Jm79GZ.js} +1 -1
  88. package/dist/client/assets/{collection-table-wrapper-CMhDJ32A.js → collection-table-wrapper-B63M1DMH.js} +1 -1
  89. package/dist/client/assets/{collection-tabs-PM6yowhG.js → collection-tabs-DDz6-tV8.js} +1 -1
  90. package/dist/client/assets/{command-JNsPUZwg.js → command-DgcmgCwM.js} +1 -1
  91. package/dist/client/assets/commerce-onboarding-CFRouO_K.js +1 -0
  92. package/dist/client/assets/{config-DFqhM__G.js → config-BG9lp5Ie.js} +1 -1
  93. package/dist/client/assets/{connect-CpvsClHG.js → connect-r-sErQKS.js} +1 -1
  94. package/dist/client/assets/{connection-CUtGFjSN.js → connection-B4FMHKiF.js} +1 -1
  95. package/dist/client/assets/{connection-card-B1T5pd1c.js → connection-card-Dzq4GEyY.js} +1 -1
  96. package/dist/client/assets/connection-detail-r6grJ79A.js +1 -0
  97. package/dist/client/assets/{connection-form-helpers-CYKg-GvJ.js → connection-form-helpers-CeLJ06vB.js} +1 -1
  98. package/dist/client/assets/connections-C2iSPc_1.js +1 -0
  99. package/dist/client/assets/{decopilot-sse-pool-BN-M5EUb.js → decopilot-sse-pool-C9fas7Vk.js} +1 -1
  100. package/dist/client/assets/{dialog-BI8UUwqv.js → dialog-B5Dwp711.js} +1 -1
  101. package/dist/client/assets/{domain-settings-D4HjDgqu.js → domain-settings-CRMwTS13.js} +1 -1
  102. package/dist/client/assets/{drawer-BR22I8_f.js → drawer-Tjt4C6S1.js} +1 -1
  103. package/dist/client/assets/{dropdown-menu-wKA_-hY5.js → dropdown-menu-7qTT1CWl.js} +1 -1
  104. package/dist/client/assets/editor-C9Tecalh.js +11 -0
  105. package/dist/client/assets/{empty-state-DAYLBxJ6.js → empty-state-DyGa8RH-.js} +1 -1
  106. package/dist/client/assets/{extract-connection-data-6cVSTGuY.js → extract-connection-data-cywUSCzT.js} +1 -1
  107. package/dist/client/assets/file-explorer-CdfPHZ9s.js +2 -0
  108. package/dist/client/assets/{file-type-icon-QfVGs4d0.js → file-type-icon-Ba1IUiXw.js} +1 -1
  109. package/dist/client/assets/folder-icon-XSSu5IpM.js +2 -0
  110. package/dist/client/assets/{form-DauSI86Q.js → form-BG9VOij0.js} +1 -1
  111. package/dist/client/assets/general-BwmmanPv.js +1 -0
  112. package/dist/client/assets/{github-repo-picker-sKX6qrmQ.js → github-repo-picker-CtpLpFkt.js} +1 -1
  113. package/dist/client/assets/{hooks-DQmp7LHz.js → hooks-CIXp5r-O.js} +6 -6
  114. package/dist/client/assets/index-BFgc8ZC7.css +1 -0
  115. package/dist/client/assets/{index-BdFaTbMe.js → index-BduQMnBH.js} +67 -70
  116. package/dist/client/assets/{index-B9iOsEIc.js → index-Bpjqwflb.js} +1 -1
  117. package/dist/client/assets/{index-De-kCEdQ.js → index-CN_9lpLS.js} +1 -1
  118. package/dist/client/assets/{index-q2Rm7O_h.js → index-CwxzUISD.js} +1 -1
  119. package/dist/client/assets/{index-Ci8azyOE.js → index-D1nhmf1Q.js} +47 -47
  120. package/dist/client/assets/{index-DKFNY2Yv.js → index-Dc_4GJkg.js} +1 -1
  121. package/dist/client/assets/{index-BYBf2qjQ.js → index-Dd4VT4PK.js} +1 -1
  122. package/dist/client/assets/index-DrfWMe2_.js +1 -0
  123. package/dist/client/assets/{index-BMBPxk-z.js → index-mBM2IXZW.js} +2 -2
  124. package/dist/client/assets/{index-redirect-DVfxG1gJ.js → index-redirect-ia2R20RS.js} +1 -1
  125. package/dist/client/assets/{infra-billing-BEtRM-w8.js → infra-billing-BD1CW7CR.js} +1 -1
  126. package/dist/client/assets/{input-Bwz-dTwg.js → input-CNoT6UPP.js} +1 -1
  127. package/dist/client/assets/{integration-icon-CGnrGZxM.js → integration-icon-CoEwUt3R.js} +1 -1
  128. package/dist/client/assets/{invite-member-dialog-D8XHQ0du.js → invite-member-dialog-CKmQ1zCK.js} +1 -1
  129. package/dist/client/assets/{label-C1OhLpvf.js → label-Bh-QPCS-.js} +1 -1
  130. package/dist/client/assets/{layout-DdQ7AbmJ.js → layout-CLwoInAC.js} +1 -1
  131. package/dist/client/assets/location-oTTXFrSF.js +1 -0
  132. package/dist/client/assets/{login-CaBX2Zyr.js → login-QAXGHnIi.js} +1 -1
  133. package/dist/client/assets/markdown-rou3FpXf.js +94 -0
  134. package/dist/client/assets/{mcp-oauth-GWhqBwu1.js → mcp-oauth-CE5hKicF.js} +1 -1
  135. package/dist/client/assets/{members-CoSugncV.js → members-B8o9jnvz.js} +1 -1
  136. package/dist/client/assets/monaco-editor-DN5vmqgz.js +9 -0
  137. package/dist/client/assets/{monitoring-stats-row-BKiTJqu0.js → monitoring-stats-row-DDwBOJYJ.js} +1 -1
  138. package/dist/client/assets/{multi-select-CIx6xi2O.js → multi-select-PmQQKBEJ.js} +1 -1
  139. package/dist/client/assets/{oauth-callback-D_4qsGLU.js → oauth-callback-BTwkETTY.js} +1 -1
  140. package/dist/client/assets/{oauth-callback-ai-provider-N2nxuW4H.js → oauth-callback-ai-provider-B36m2PdR.js} +1 -1
  141. package/dist/client/assets/{onboarding-c1-zuWRK.js → onboarding-B7UiVZMe.js} +1 -1
  142. package/dist/client/assets/{org-layout-D7r6nyax.js → org-layout-Cta6KhVE.js} +1 -1
  143. package/dist/client/assets/{organization-choice-DZuaojdz.js → organization-choice-DsVuGX_V.js} +1 -1
  144. package/dist/client/assets/{orgs-_zNVp-L6.js → orgs-S1ZvAnwW.js} +1 -1
  145. package/dist/client/assets/page-seo-form-DWU9_oLp.js +1 -0
  146. package/dist/client/assets/{popover-ClwD_xra.js → popover-CSROd4Pq.js} +1 -1
  147. package/dist/client/assets/post-calendar-DnBcHCrt.js +1 -0
  148. package/dist/client/assets/post-editor-Dy5KQxk9.js +1 -0
  149. package/dist/client/assets/{primitives-BKjHT0m_.js → primitives-CN6snzkm.js} +1 -1
  150. package/dist/client/assets/{profile-fPJ06K0g.js → profile-nuS6Yk5T.js} +1 -1
  151. package/dist/client/assets/project-app-view-C_jy-ABo.js +1 -0
  152. package/dist/client/assets/{prompts-BiA_3uUl.js → prompts-BCNUssxD.js} +1 -1
  153. package/dist/client/assets/record-editor-CfXTz8BC.js +1 -0
  154. package/dist/client/assets/redirect-editor-DLlB67fs.js +1 -0
  155. package/dist/client/assets/registry-BqWXEeDm.js +2 -0
  156. package/dist/client/assets/{registry-layout-C3aeIwiX.js → registry-layout-EKuJfy7J.js} +1 -1
  157. package/dist/client/assets/{reports-ZfNOoqaN.js → reports-4CXjspNj.js} +2 -2
  158. package/dist/client/assets/{require-capability-cxyKBT59.js → require-capability-BhVqfFum.js} +1 -1
  159. package/dist/client/assets/{required-auth-layout-CUQaC9Hr.js → required-auth-layout-C8d0oW7e.js} +1 -1
  160. package/dist/client/assets/{reset-password-ipLYYDOf.js → reset-password-DCS_OBA1.js} +1 -1
  161. package/dist/client/assets/review-settings-DLji_woR.js +1 -0
  162. package/dist/client/assets/roles-CxDg8XGc.js +1 -0
  163. package/dist/client/assets/{scroll-area-RteS0-Yk.js → scroll-area-Biplguze.js} +1 -1
  164. package/dist/client/assets/{search-input-CevwWux3.js → search-input-D7l-IL8-.js} +1 -1
  165. package/dist/client/assets/{secrets-ojCsqN5b.js → secrets-CdQE1y1N.js} +1 -1
  166. package/dist/client/assets/sections-editor-D6DEbCwS.js +2 -0
  167. package/dist/client/assets/{select-C7Q2VGxk.js → select-XohvCz94.js} +1 -1
  168. package/dist/client/assets/{select-model-C03zAz7l.js → select-model-DR-3F_PJ.js} +2 -2
  169. package/dist/client/assets/{self-tool-result-BSLlHbcp.js → self-tool-result-Bwv5npAG.js} +1 -1
  170. package/dist/client/assets/seo-editor-pMQb_Xzr.js +1 -0
  171. package/dist/client/assets/settings-layout-D_ayBbtJ.js +1 -0
  172. package/dist/client/assets/{shell-controls-BMTxwot2.js → shell-controls-CDj8s28i.js} +1 -1
  173. package/dist/client/assets/shell-layout-1GlczZzE.js +1 -0
  174. package/dist/client/assets/skill-preview-BFC0MmFr.js +4 -0
  175. package/dist/client/assets/skills-z7Ay-Seh.js +1 -0
  176. package/dist/client/assets/{spinner-B9x-ViPH.js → spinner-DoWdooyo.js} +1 -1
  177. package/dist/client/assets/{sso-9kD1uEp6.js → sso-CFWWagSe.js} +1 -1
  178. package/dist/client/assets/{store-DVSsps0V.js → store-pxFG_Ntd.js} +1 -1
  179. package/dist/client/assets/store-registry-exZfMLJK.js +2 -0
  180. package/dist/client/assets/super-agent-icon-CqDeROSm.js +1 -0
  181. package/dist/client/assets/{switch-BuJnEOUw.js → switch-wsucwW9_.js} +1 -1
  182. package/dist/client/assets/synced-repos-Bjdq7U5H.js +1 -0
  183. package/dist/client/assets/{table-oIbRw7Yk.js → table-CLp_oiC_.js} +1 -1
  184. package/dist/client/assets/{tabs-CFhQLpsD.js → tabs-uFCnOWIo.js} +1 -1
  185. package/dist/client/assets/{task-board-Cz-fiaKF.js → task-board-BWv9Grjq.js} +1 -1
  186. package/dist/client/assets/tasks-D2tIVghW.js +1 -0
  187. package/dist/client/assets/{textarea-CMpN0SgX.js → textarea-C2acFNIs.js} +1 -1
  188. package/dist/client/assets/thread-route-xzCED6O0.js +1 -0
  189. package/dist/client/assets/{toggle-group-ClOqwWDq.js → toggle-group-BXusQXp8.js} +1 -1
  190. package/dist/client/assets/{toolbar-KH-9Bre4.js → toolbar-21jqQEeK.js} +1 -1
  191. package/dist/client/assets/{track-DXtvDI_s.js → track-CjpC-d64.js} +1 -1
  192. package/dist/client/assets/{types-BGVeElFe.js → types-CQ8RViPH.js} +1 -1
  193. package/dist/client/assets/{use-ai-providers-DlWIkMD-.js → use-ai-providers-fDwPI_r7.js} +1 -1
  194. package/dist/client/assets/{use-api-keys-D0NAsvsx.js → use-api-keys-pH2tUsCP.js} +1 -1
  195. package/dist/client/assets/{use-automations-CWqvHqj2.js → use-automations-BrEd1HS7.js} +1 -1
  196. package/dist/client/assets/{use-autosave-D1zPEM1D.js → use-autosave-CrHqx062.js} +1 -1
  197. package/dist/client/assets/{use-connection-gqhqm1hO.js → use-connection-DY8ejT4K.js} +1 -1
  198. package/dist/client/assets/{use-copy-BY1mlr6R.js → use-copy-lu2XtDcW.js} +1 -1
  199. package/dist/client/assets/{use-create-virtual-mcp-Dzmlrw8C.js → use-create-virtual-mcp-DLVdkwU0.js} +1 -1
  200. package/dist/client/assets/{use-debounced-autosave-j0VBccs2.js → use-debounced-autosave-v8vHMC8M.js} +1 -1
  201. package/dist/client/assets/{use-debounced-value-BENALn-i.js → use-debounced-value-CpWnVjpN.js} +1 -1
  202. package/dist/client/assets/{use-decopilot-events-CqU7DunK.js → use-decopilot-events-Bb9JzQxj.js} +1 -1
  203. package/dist/client/assets/{use-delete-connection-BwHeDNps.js → use-delete-connection-B4PKULFK.js} +1 -1
  204. package/dist/client/assets/{use-deployment-admin-CQiRFTsL.js → use-deployment-admin-etxLracY.js} +1 -1
  205. package/dist/client/assets/{use-destination-route-d8wgPDBu.js → use-destination-route-Dke-BCSN.js} +1 -1
  206. package/dist/client/assets/{use-file-configs-BAUKJMmN.js → use-file-configs-k1SljoDC.js} +1 -1
  207. package/dist/client/assets/{use-infinite-scroll-Cw7R-QWe.js → use-infinite-scroll-FPrsNBWO.js} +1 -1
  208. package/dist/client/assets/{use-join-requests-CBEK68HB.js → use-join-requests-CcGL_7R0.js} +1 -1
  209. package/dist/client/assets/{use-mcp-auth-status-7KFU7IPU.js → use-mcp-auth-status-B7JYyzah.js} +1 -1
  210. package/dist/client/assets/{use-mcp-client-DP2onozC.js → use-mcp-client-DGIxZdqr.js} +2 -2
  211. package/dist/client/assets/{use-mcp-tools-B7yHzu9T.js → use-mcp-tools-0Gmx3Go4.js} +1 -1
  212. package/dist/client/assets/{use-members-IwrDPxqz.js → use-members-DOoZZCC8.js} +1 -1
  213. package/dist/client/assets/{use-navigate-to-agent-mrg2_DxJ.js → use-navigate-to-agent-BYMKlpeP.js} +1 -1
  214. package/dist/client/assets/{use-org-auth-client-HXTuHVWD.js → use-org-auth-client-DFlTPB6z.js} +1 -1
  215. package/dist/client/assets/{use-org-repo-syncs-rlkQHsUF.js → use-org-repo-syncs-Di8krs9u.js} +1 -1
  216. package/dist/client/assets/{use-org-sso-C-uWWD5m.js → use-org-sso-DnJHJ0ab.js} +1 -1
  217. package/dist/client/assets/{use-organization-roles-CQ2UVvkm.js → use-organization-roles-CRZSYOKW.js} +1 -1
  218. package/dist/client/assets/{use-organization-settings-BAFLKQ3y.js → use-organization-settings-CbtAN2yQ.js} +1 -1
  219. package/dist/client/assets/use-panel-navigate-Cy7dVYfh.js +1 -0
  220. package/dist/client/assets/{use-registry-connections-DghvIzKh.js → use-registry-connections-LtvlJMIF.js} +1 -1
  221. package/dist/client/assets/{use-secrets-CvibJ_Hx.js → use-secrets-AR7RAzOL.js} +1 -1
  222. package/dist/client/assets/{use-section-preview-base-DTnA68XU.js → use-section-preview-base-CtbnouVn.js} +1 -1
  223. package/dist/client/assets/{use-status-sounds-kx6TUHpf.js → use-status-sounds-B4oWCXWI.js} +1 -1
  224. package/dist/client/assets/{use-tags-CGJ43yMs.js → use-tags-J8qdyedc.js} +1 -1
  225. package/dist/client/assets/{use-view-mode-Bn3--gRi.js → use-view-mode-O997mo4M.js} +1 -1
  226. package/dist/client/assets/{use-virtual-mcp-Dj0wXB98.js → use-virtual-mcp-DiC7BmKe.js} +1 -1
  227. package/dist/client/assets/useInfiniteQuery-aiOGy3p0.js +1 -0
  228. package/dist/client/assets/useSuspenseInfiniteQuery-CThWEWzr.js +1 -0
  229. package/dist/client/assets/{users-B_7Qs-RF.js → users-D-_GZOQV.js} +1 -1
  230. package/dist/client/assets/variant-calendar-BXPwySCy.js +1 -0
  231. package/dist/client/assets/{view-mode-toggle-CcmqoSVC.js → view-mode-toggle-CYp_M5Ic.js} +1 -1
  232. package/dist/client/index.html +2 -2
  233. package/dist/server/cli.js +1 -1
  234. package/dist/server/server.js +1 -1
  235. package/package.json +1 -1
  236. package/dist/client/assets/Tool01-va49aYq9.js +0 -1
  237. package/dist/client/assets/UserSquare-CwU4sG2o.js +0 -1
  238. package/dist/client/assets/agent-icon-DCM1Bdl8.js +0 -1
  239. package/dist/client/assets/agents-list-BblEB_Yy.js +0 -1
  240. package/dist/client/assets/app-editor-I_aUhOen.js +0 -1
  241. package/dist/client/assets/automation-runs-GCI7uxIE.js +0 -280
  242. package/dist/client/assets/automations-BQ1HpMVH.js +0 -1
  243. package/dist/client/assets/bulk-category-panel-CsF_6FI0.js +0 -1
  244. package/dist/client/assets/cards-4fPEe6ST.js +0 -9
  245. package/dist/client/assets/category-editor-D5nV2a1F.js +0 -1
  246. package/dist/client/assets/chat-context-CmwZXAhQ.js +0 -35
  247. package/dist/client/assets/choose-editor-2zkSgPsA.js +0 -1
  248. package/dist/client/assets/collection-detail-DHWV_lB6.js +0 -1
  249. package/dist/client/assets/commerce-onboarding-BAlSxXoB.js +0 -1
  250. package/dist/client/assets/connection-detail-DZEeMz2b.js +0 -1
  251. package/dist/client/assets/connections-Cd3u8u7a.js +0 -1
  252. package/dist/client/assets/file-explorer-hutSgELN.js +0 -2
  253. package/dist/client/assets/general-BmUVO2yQ.js +0 -1
  254. package/dist/client/assets/index-D3IpXIE1.js +0 -1
  255. package/dist/client/assets/index-DJSuP9VA.css +0 -1
  256. package/dist/client/assets/monaco-editor-CQbDSum8.js +0 -19
  257. package/dist/client/assets/page-seo-form-kQ_gqmTd.js +0 -1
  258. package/dist/client/assets/post-calendar-DJZelBC2.js +0 -1
  259. package/dist/client/assets/post-editor-C5Ee-UkR.js +0 -1
  260. package/dist/client/assets/project-app-view-DZuDq3zQ.js +0 -1
  261. package/dist/client/assets/record-editor-DGXTnpF6.js +0 -1
  262. package/dist/client/assets/redirect-editor-V6SQ4gS6.js +0 -1
  263. package/dist/client/assets/registry-BYqWHQgR.js +0 -2
  264. package/dist/client/assets/review-settings-kV6Wbxhl.js +0 -1
  265. package/dist/client/assets/roles-Dcj4t-Mv.js +0 -1
  266. package/dist/client/assets/sections-editor-VI00Nblu.js +0 -2
  267. package/dist/client/assets/seo-editor-CObQJqAB.js +0 -1
  268. package/dist/client/assets/settings-layout-Bbbz4btQ.js +0 -1
  269. package/dist/client/assets/shell-layout-i3nUAnDL.js +0 -1
  270. package/dist/client/assets/store-registry-BiGqjfDg.js +0 -2
  271. package/dist/client/assets/super-agent-icon-DbGhAnlL.js +0 -1
  272. package/dist/client/assets/synced-repos-XSy5K1eb.js +0 -1
  273. package/dist/client/assets/tasks-D-zkYbxa.js +0 -1
  274. package/dist/client/assets/use-panel-navigate-BsVeEWlx.js +0 -1
  275. package/dist/client/assets/useInfiniteQuery-DjjzlWAZ.js +0 -1
  276. package/dist/client/assets/useSuspenseInfiniteQuery-Ci5SesMe.js +0 -1
  277. package/dist/client/assets/variant-calendar-BdYlnVxu.js +0 -1
@@ -1,2 +0,0 @@
1
- import{c as st,b as Dt,r as w,n as Ue,j as n,aH as Zn,B as tt,ab as wt,a8 as kt,a9 as Tt,k as es,p as Aa,t as q,K as Ca}from"./index-Ci8azyOE.js";import{b as Pa}from"./chat-context-CmwZXAhQ.js";import{au as ts,av as Ma,aw as La,ax as Ka,ay as Ba,ab as ns,ac as Xt,az as ss,aA as as,ad as os,ae as is,aB as rs,aC as Ia,al as ls,am as cs,aD as Oa,aE as Fa,aF as us,P as $a,af as ds,ag as Lt,aj as ms,ak as fs,ah as ps,ar as gs,aG as za,aH as Kt,aI as hs,aJ as Ha,aK as Ua,aL as Ga,aM as qa,aN as Wa,F as Ja,G as Ya,aO as Qa,aP as Xa,aQ as Za,aR as eo,aS as Bn,aT as to,aU as no,aV as so,ap as qt,aW as ao,aX as oo,aY as Wt,aZ as io,a_ as St,a$ as Ct,b0 as ro,b1 as lo,b2 as nt,b3 as In,b4 as co,H as uo,b5 as On,b6 as mo,b7 as fo,b8 as Pt,b9 as Jt,ba as Fn,bb as po,bc as fn,bd as go,be as ht,bf as Et,bg as ho,bh as vo,bi as bo,bj as So,bk as yo,bl as yt,bm as xo,bn as _o,bo as jo,J as Eo,bp as $n,bq as Mt,br as zn,bs as Hn,bt as Ro,bu as wo,bv as ko,bw as To,bx as pn,by as Un,bz as Gn,bA as Rt,bB as Yt,bC as qn,bD as Do,bE as gn,bF as Vo,bG as No,bH as Ao,bI as Co,bJ as Po,bK as Mo}from"./index-BdFaTbMe.js";import{t as Lo}from"./ChevronDown-Csfjhwpm.js";import{af as vn,u as Ko,S as vs,C as Bo,r as Io,am as Oo,o as Fo}from"./agent-icon-DCM1Bdl8.js";import{i as $o}from"./ChevronRight-DUmHQrD7.js";import{n as zo}from"./ChevronUp-Dlj_U0qV.js";import{i as Ho}from"./Globe01-CV-16mwB.js";import{S as Qt}from"./scroll-area-RteS0-Yk.js";import{b as Uo,h as Go,a as qo,c as Wo,d as Jo,e as Yo}from"./dialog-BI8UUwqv.js";import{I as Qo}from"./input-Bwz-dTwg.js";import{a as bs}from"./Copy01-CsNpp9jr.js";import{i as Xo}from"./Settings02-BMcJFHpd.js";import{s as Zo}from"./Eye-DgiSa7UT.js";import{s as ei}from"./TrendUp01-DikSDrNg.js";import{s as bn}from"./Plus-CPkR-QLd.js";import{s as Ss}from"./Trash01-Dp-QTpAR.js";import{i as ti}from"./Zap-MbQ2aiA8.js";import{D as ys,a as vt,c as xs,b as _s,i as ni}from"./dropdown-menu-wKA_-hY5.js";import{a as si,P as ai,b as oi}from"./page-seo-form-kQ_gqmTd.js";import{b as ii}from"./Tool01-va49aYq9.js";import{u as ri,A as li}from"./use-section-preview-base-DTnA68XU.js";import"./use-panel-navigate-BsVeEWlx.js";import"./Check-D5PKBQ5I.js";import"./Download01-BN9BT9cL.js";import"./use-destination-route-d8wgPDBu.js";import"./constants-dLUUoWH7.js";import"./session-runtime-C-KTDVeQ.js";import"./slugify-CEUa2lfQ.js";import"./hooks-DQmp7LHz.js";import"./use-mcp-client-DP2onozC.js";import"./auth-D8IdOmGw.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-BN-M5EUb.js";import"./task-board-Cz-fiaKF.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-Dj0wXB98.js";import"./use-ai-providers-DlWIkMD-.js";import"./use-decopilot-events-CqU7DunK.js";import"./use-organization-settings-BAFLKQ3y.js";import"./ArrowUp-CVoISkQ4.js";import"./automation-runs-GCI7uxIE.js";import"./useInfiniteQuery-DjjzlWAZ.js";import"./use-infinite-scroll-Cw7R-QWe.js";import"./use-connection-gqhqm1hO.js";import"./table-oIbRw7Yk.js";import"./empty-state-DAYLBxJ6.js";import"./use-members-IwrDPxqz.js";import"./use-org-auth-client-HXTuHVWD.js";import"./AlertCircle-BTlJp8pf.js";import"./CheckCircle-teyxVGFp.js";import"./DotsVertical-CpVcGDJ_.js";import"./XCircle-CVbKXkpd.js";import"./use-automations-CWqvHqj2.js";import"./useSuspenseInfiniteQuery-Ci5SesMe.js";import"./avatar-D-QkiqIH.js";import"./User01-DJ_BO2EX.js";import"./Tool02-jKKU1_dM.js";import"./Stars01-BzEDQnsl.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-BY1mlr6R.js";import"./monaco-editor-CQbDSum8.js";import"./spinner-B9x-ViPH.js";import"./types-BGVeElFe.js";import"./XClose-CTv0nnSb.js";import"./Share07-CPDrxQV8.js";import"./SearchMd-ClTH3fiN.js";import"./shell-layout-i3nUAnDL.js";import"./Users03-BUoBV4mB.js";import"./SearchLg-8daQliv2.js";import"./Stars02-DZNA1z2-.js";import"./FilterLines-Db8-uWfr.js";import"./Monitor01-uq-dlf-u.js";import"./required-auth-layout-CUQaC9Hr.js";import"./use-org-sso-C-uWWD5m.js";import"./LinkExternal01-CIL2SNWf.js";import"./integration-icon-CGnrGZxM.js";import"./Palette-Cv68Zggp.js";import"./use-navigate-to-agent-mrg2_DxJ.js";import"./chart-BS94Bf-2.js";import"./index-De-kCEdQ.js";import"./form-DauSI86Q.js";import"./label-C1OhLpvf.js";import"./file-type-icon-QfVGs4d0.js";import"./drawer-BR22I8_f.js";import"./collection-search-0N-i_PHL.js";import"./Upload01-DxCHPffq.js";import"./select-C7Q2VGxk.js";import"./UserSquare-CwU4sG2o.js";import"./ArrowLeft-BwagOJkb.js";import"./tabs-CFhQLpsD.js";import"./toggle-group-ClOqwWDq.js";import"./super-agent-icon-DbGhAnlL.js";import"./self-tool-result-BSLlHbcp.js";import"./alert-dialog-Dh9zsaCy.js";import"./extract-connection-data-6cVSTGuY.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-CMPWtdMv.js";import"./use-debounced-value-BENALn-i.js";import"./authenticate-and-persist-oauth-DY_hbkIG.js";import"./mcp-oauth-GWhqBwu1.js";import"./track-DXtvDI_s.js";import"./popover-ClwD_xra.js";import"./toolbar-KH-9Bre4.js";import"./github-repo-picker-sKX6qrmQ.js";import"./LockUnlocked01-BpeKJGM4.js";import"./use-mcp-tools-B7yHzu9T.js";import"./agent-capabilities-B52k7xCe.js";import"./connection-card-B1T5pd1c.js";import"./use-registry-connections-DghvIzKh.js";import"./retry-CErkP7V6.js";import"./connection-slug-CITJ0kGN.js";import"./textarea-CMpN0SgX.js";import"./connection-form-helpers-CYKg-GvJ.js";import"./collection-tabs-PM6yowhG.js";import"./badge-DX3_GQsO.js";import"./select-model-C03zAz7l.js";import"./checkbox-Gg7TSWGl.js";import"./ChevronSelectorVertical-CuAhXy3x.js";import"./Key01-D4srNqPO.js";import"./ai-providers-logos-DD3qZ33J.js";import"./cards-4fPEe6ST.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-kx6TUHpf.js";import"./ZapSquare-BZzRAQpm.js";import"./use-file-configs-BAUKJMmN.js";import"./pt-BR-CLy76QW2.js";import"./Play-C9xK8clC.js";import"./use-debounced-autosave-j0VBccs2.js";import"./search-input-CevwWux3.js";import"./use-mcp-auth-status-7KFU7IPU.js";import"./switch-BuJnEOUw.js";import"./Users01-B2wc_Wgl.js";import"./use-secrets-CvibJ_Hx.js";import"./AreaChart-dJjxY072.js";import"./config-DFqhM__G.js";import"./Shield01-C9M_jcOJ.js";import"./command-JNsPUZwg.js";import"./index-BYBf2qjQ.js";import"./get-initials-D-f_fDFw.js";import"./breadcrumb-Clut3vXk.js";import"./SwitchHorizontal01-CSyGO1HX.js";import"./use-tags-CGJ43yMs.js";import"./automation-list-row-CLAw5ACh.js";import"./site-error--i37Vnuw.js";import"./use-org-repo-syncs-rlkQHsUF.js";import"./CreditCard01-YCHpZ00A.js";import"./Globe04-D3O2XfOT.js";import"./HardDrive-CWvDYc59.js";import"./LogOut01-qWWgaWbQ.js";import"./Sun-BBWjOwQE.js";function ci(d){return d.schema?.definitions??d.schema?.$defs??{}}function js(d,e){const o=ci(e),u=o[btoa(d)];if(!u)return[];const p=[u];if(Array.isArray(u.allOf)){const x=u.allOf.find(j=>typeof j.$ref=="string")?.$ref;if(typeof x=="string"){const j=o[x.replace("#/definitions/","")];j&&p.push(j)}}return p}function ui(d,e){for(const o of js(d,e)){const u=typeof o.image=="string"?o.image:void 0;if(u?.includes("{{{"))return u}}function di(d,e){if(!e)return;const o=ts(d);if(!o)return;const u=ui(o.resolveType,e);if(!u)return;const p=Ma(u,o.data);if(p)return La(p)}const mi={escape:Ba};function fi(d,e){for(const o of js(d,e)){const u=typeof o.title=="string"?o.title:void 0;if(u?.includes("{{"))return u}}function pi(d,e){if(!e)return;const o=ts(d);if(o)try{const u=fi(o.resolveType,e);return u&&Ka.render(u,o.data,{},mi).trim()||void 0}catch{return}}const gi="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",hi="text-global-section-fg focus:bg-global-section/12 focus:text-global-section-fg dark:text-global-section-fg-dark dark:focus:bg-global-section/15 dark:focus:text-global-section-fg-dark [&_svg]:!text-global-section";function Wn(d){return Array.from({length:d},(e,o)=>({id:crypto.randomUUID(),index:o}))}function Es(d){return d.map((e,o)=>({...e,index:o}))}function vi(d,e){if(e===d.length)return d;if(e<d.length)return Es(d.slice(0,e));const o=Array.from({length:e-d.length},(u,p)=>({id:crypto.randomUUID(),index:d.length+p}));return[...d,...o]}function Rs(d){const e=st.c(25),{section:o,raw:u,meta:p}=d,x=o.isSavedBlock===!0,j=o.isMultivariate===!0;let v;e[0]!==p||e[1]!==u?(v=u&&p?di(u,p):void 0,e[0]=p,e[1]=u,e[2]=v):v=e[2];const y=v;let g;e[3]!==p||e[4]!==j||e[5]!==u||e[6]!==x?(g=u&&p&&!x&&!j?pi(u,p):void 0,e[3]=p,e[4]=j,e[5]=u,e[6]=x,e[7]=g):g=e[7];const k=g;let K;e[8]===Symbol.for("react.memo_cache_sentinel")?(K=n.jsx(Ko,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[8]=K):K=e[8];let M;e[9]!==y?(M=y&&n.jsx("img",{src:y,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[9]=y,e[10]=M):M=e[10];let D;e[11]!==j||e[12]!==x?(D=x?{color:$a}:j?{color:"oklch(0.65 0.15 160)"}:void 0,e[11]=j,e[12]=x,e[13]=D):D=e[13];let c;e[14]!==D?(c=n.jsx(vn,{className:"h-4 w-4 shrink-0",style:D}),e[14]=D,e[15]=c):c=e[15];const S=o.isHidden&&"line-through opacity-50";let R;e[16]!==S?(R=Ue("min-w-0 flex-1 truncate text-sm font-medium",S),e[16]=S,e[17]=R):R=e[17];const l=k??o.label;let V;e[18]!==R||e[19]!==l?(V=n.jsx("span",{className:R,children:l}),e[18]=R,e[19]=l,e[20]=V):V=e[20];let i;return e[21]!==V||e[22]!==M||e[23]!==c?(i=n.jsxs(n.Fragment,{children:[K,M,c,V]}),e[21]=V,e[22]=M,e[23]=c,e[24]=i):i=e[24],i}const bi="w-7 ml-0 opacity-100 [transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]",Si="w-0 -ml-2 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:ml-0 group-hover:w-7 group-hover:opacity-100 group-hover:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms] group-has-[:focus-visible]:ml-0 group-has-[:focus-visible]:w-7 group-has-[:focus-visible]:opacity-100 group-has-[:focus-visible]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]",yi="w-7 ml-0 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:opacity-100 group-has-[:focus-visible]:opacity-100";function hn(d,e){return Ue("h-7 shrink-0 overflow-hidden",e?bi:d?yi:Si)}function ws(d,e){const o=d.isSavedBlock===!0,u=d.isMultivariate===!0;return Ue("group flex select-none items-center gap-2 rounded-md px-2 py-2.5",e?"bg-accent text-accent-foreground":o?gi:u?us:"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function xi(d){const e=st.c(82),{section:o,raw:u,meta:p,sortableId:x,selected:j,onSelect:v,onDelete:y,onDuplicate:g,onMakeReusable:k,onToggleHidden:K,onToggleLazy:M,onAddVariant:D,onDetach:c}=d,S=Dt(),R=u?rs(u.__resolveType??""):!1,l=o.isHidden===!0,V=R||l;let i;e[0]!==o?(i=Ia(o),e[0]=o,e[1]=i):i=e[1];const J=i;let U;e[2]!==x?(U={id:x,animateLayoutChanges:wi},e[2]=x,e[3]=U):U=e[3];const{attributes:Le,listeners:Y,setNodeRef:m,transform:P,isDragging:we}=ls(U);let N;e[4]!==P?(N=cs.Transform.toString(P?{...P,x:0}:null),e[4]=P,e[5]=N):N=e[5];const Z=we?0:void 0;let T;e[6]!==N||e[7]!==Z?(T={transform:N,opacity:Z},e[6]=N,e[7]=Z,e[8]=T):T=e[8];const oe=T;let B;e[9]!==o?(B=Oa(o),e[9]=o,e[10]=B):B=e[10];const Ce=B;let ee;e[11]!==v?(ee=_=>{(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),v())},e[11]=v,e[12]=ee):ee=e[12];const de=we?"cursor-grabbing":"cursor-pointer";let Q;e[13]!==o||e[14]!==j||e[15]!==de?(Q=Ue("touch-none transition-colors",de,ws(o,j)),e[13]=o,e[14]=j,e[15]=de,e[16]=Q):Q=e[16];let ie;e[17]!==p||e[18]!==u||e[19]!==o?(ie=n.jsx(Rs,{section:o,raw:u,meta:p}),e[17]=p,e[18]=u,e[19]=o,e[20]=ie):ie=e[20];let ye;e[21]!==l||e[22]!==S?(ye=S(l?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),e[21]=l,e[22]=S,e[23]=ye):ye=e[23];let re;e[24]!==K?(re=_=>{_.stopPropagation(),K()},e[24]=K,e[25]=re):re=e[25];let L;e[26]!==l?(L=l?n.jsx(Xo,{className:"h-3.5 w-3.5"}):n.jsx(Zo,{className:"h-3.5 w-3.5"}),e[26]=l,e[27]=L):L=e[27];let qe;e[28]!==l||e[29]!==S?(qe=S(l?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),e[28]=l,e[29]=S,e[30]=qe):qe=e[30];let Ke;e[31]!==qe?(Ke=n.jsx(Tt,{side:"bottom",children:qe}),e[31]=qe,e[32]=Ke):Ke=e[32];const Ie=xs,ke=ys,F=!0,te=tt,Oe="button",Pe="ghost",xe="icon";let ne;e[33]!==S?(ne=S("sectionsEditor.sectionList.sectionActionsMenu"),e[33]=S,e[34]=ne):ne=e[34];const me=Ue(hn(V,!1),"data-[state=open]:ml-0 data-[state=open]:w-7 data-[state=open]:opacity-100 data-[state=open]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]");let _e;e[35]===Symbol.for("react.memo_cache_sentinel")?(_e=n.jsx(vs,{className:"h-3.5 w-3.5"}),e[35]=_e):_e=e[35];let fe;e[36]!==te||e[37]!==ne||e[38]!==me?(fe=n.jsx(te,{type:Oe,variant:Pe,size:xe,"aria-label":ne,className:me,onClick:ji,onPointerDown:_i,children:_e}),e[36]=te,e[37]=ne,e[38]=me,e[39]=fe):fe=e[39];let pe;e[40]!==ke||e[41]!==fe?(pe=n.jsx(ke,{asChild:F,children:fe}),e[40]=ke,e[41]=fe,e[42]=pe):pe=e[42];let se;e[43]!==g?(se=_=>{_.stopPropagation(),g()},e[43]=g,e[44]=se):se=e[44];let Me;e[45]===Symbol.for("react.memo_cache_sentinel")?(Me=n.jsx(bs,{className:"h-4 w-4"}),e[45]=Me):Me=e[45];let je;e[46]!==S?(je=S("sectionsEditor.sectionList.duplicateMenuItem"),e[46]=S,e[47]=je):je=e[47];let le;e[48]!==se||e[49]!==je?(le=n.jsxs(vt,{onClick:se,children:[Me,je]}),e[48]=se,e[49]=je,e[50]=le):le=e[50];let I;e[51]!==J||e[52]!==D||e[53]!==S?(I=J&&n.jsxs(vt,{className:Fa,onClick:_=>{_.stopPropagation(),D()},children:[n.jsx(ei,{className:"h-4 w-4"}),S("sectionsEditor.sectionList.addVariantMenuItem")]}),e[51]=J,e[52]=D,e[53]=S,e[54]=I):I=e[54];let Ee;e[55]!==Ce||e[56]!==k||e[57]!==S?(Ee=Ce&&n.jsxs(vt,{className:hi,onClick:_=>{_.stopPropagation(),k()},children:[n.jsx(vn,{className:"h-4 w-4"}),S("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[55]=Ce,e[56]=k,e[57]=S,e[58]=Ee):Ee=e[58];let ge;e[59]!==c||e[60]!==o.isMultivariate||e[61]!==o.isSavedBlock||e[62]!==S?(ge=o.isSavedBlock===!0&&!o.isMultivariate&&n.jsxs(vt,{onClick:_=>{_.stopPropagation(),c()},children:[n.jsx(vn,{className:"h-4 w-4"}),S("sectionsEditor.sectionList.detachMenuItem")]}),e[59]=c,e[60]=o.isMultivariate,e[61]=o.isSavedBlock,e[62]=S,e[63]=ge):ge=e[63];let ce;e[64]!==y?(ce=_=>{_.stopPropagation(),y()},e[64]=y,e[65]=ce):ce=e[65];let he;e[66]===Symbol.for("react.memo_cache_sentinel")?(he=n.jsx(Ss,{className:"h-4 w-4"}),e[66]=he):he=e[66];let X;e[67]!==S?(X=S("sectionsEditor.sectionList.deleteMenuItem"),e[67]=S,e[68]=X):X=e[68];let ue;e[69]!==ce||e[70]!==X?(ue=n.jsxs(vt,{className:"text-destructive focus:text-destructive",onClick:ce,children:[he,X]}),e[69]=ce,e[70]=X,e[71]=ue):ue=e[71];let ve;e[72]!==le||e[73]!==I||e[74]!==Ee||e[75]!==ge||e[76]!==ue?(ve=n.jsxs(_s,{align:"end",className:"w-44",children:[le,I,Ee,ge,ue]}),e[72]=le,e[73]=I,e[74]=Ee,e[75]=ge,e[76]=ue,e[77]=ve):ve=e[77];let Te;return e[78]!==Ie||e[79]!==pe||e[80]!==ve?(Te=n.jsxs(Ie,{children:[pe,ve]}),e[78]=Ie,e[79]=pe,e[80]=ve,e[81]=Te):Te=e[81],n.jsxs("div",{ref:m,style:oe,...Le,...Y,role:"button",tabIndex:0,onClick:v,onKeyDown:ee,className:Q,children:[ie,!o.isMultivariate&&n.jsxs(wt,{children:[n.jsx(kt,{asChild:!0,children:n.jsx(tt,{type:"button",variant:"ghost",size:"icon","aria-label":S(R?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:Ue(hn(V,R)),onClick:_=>{_.stopPropagation(),M()},onPointerDown:Ri,children:n.jsx(ti,{className:Ue("h-3.5 w-3.5",R&&"text-yellow-500")})})}),n.jsx(Tt,{side:"bottom",children:S(R?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]}),n.jsxs(wt,{children:[n.jsx(kt,{asChild:!0,children:n.jsx(tt,{type:"button",variant:"ghost",size:"icon","aria-label":ye,className:Ue(hn(V,l)),onClick:re,onPointerDown:Ei,children:L})}),Ke]}),Te]})}function _i(d){return d.stopPropagation()}function ji(d){return d.stopPropagation()}function Ei(d){return d.stopPropagation()}function Ri(d){return d.stopPropagation()}function wi(){return!1}function ki(d){const e=st.c(104),{listKey:o,rawSections:u,sections:p,meta:x,selectedIndex:j,onSelect:v,onReorder:y,onDelete:g,onDuplicate:k,onMakeReusable:K,onToggleHidden:M,onToggleLazy:D,onAddVariant:c,onDetach:S,onAddSection:R,canAddSection:l}=d,V=l===void 0?!0:l,i=Dt();let J;e[0]!==p.length?(J=()=>Wn(p.length),e[0]=p.length,e[1]=J):J=e[1];const[U,Le]=w.useState(J),[Y,m]=w.useState(null),[P,we]=w.useState(o),[N,Z]=w.useState(p.length),T=w.useRef(!1);P!==o?(we(o),Z(p.length),Le(Wn(p.length))):N!==p.length&&(Z(p.length),Le(Te=>vi(Te,p.length)));let oe;e[2]===Symbol.for("react.memo_cache_sentinel")?(oe={activationConstraint:{distance:8}},e[2]=oe):oe=e[2];let B;e[3]===Symbol.for("react.memo_cache_sentinel")?(B={coordinateGetter:ds},e[3]=B):B=e[3];const Ce=ns(Xt(is,oe),Xt(os,B));let ee;e[4]!==U?(ee=U.map(Ti),e[4]=U,e[5]=ee):ee=e[5];const de=ee;let Q;e[6]===Symbol.for("react.memo_cache_sentinel")?(Q=Te=>{m(String(Te.active.id))},e[6]=Q):Q=e[6];const ie=Q;let ye;e[7]!==de||e[8]!==y?(ye=Te=>{m(null);const{active:_,over:be}=Te;if(!be||_.id===be.id)return;const ae=de.indexOf(String(_.id)),De=de.indexOf(String(be.id));ae===-1||De===-1||(Le(Fe=>Es(Lt([...Fe],ae,De))),T.current=!0,requestAnimationFrame(()=>{T.current=!1}),y?.(ae,De))},e[7]=de,e[8]=y,e[9]=ye):ye=e[9];const re=ye;let L;e[10]===Symbol.for("react.memo_cache_sentinel")?(L=()=>{m(null)},e[10]=L):L=e[10];const qe=L;let Ke,Ie,ke,F,te,Oe,Pe,xe,ne,me,_e,fe,pe,se,Me;if(e[11]!==Y||e[12]!==V||e[13]!==U||e[14]!==de||e[15]!==re||e[16]!==x||e[17]!==R||e[18]!==c||e[19]!==g||e[20]!==S||e[21]!==k||e[22]!==K||e[23]!==v||e[24]!==M||e[25]!==D||e[26]!==u||e[27]!==p||e[28]!==j||e[29]!==Ce||e[30]!==i){se=Symbol.for("react.early_return_sentinel");e:{const Te=_=>{T.current||v(_)};if(e[46]!==Y||e[47]!==V||e[48]!==U||e[49]!==R||e[50]!==u||e[51]!==p||e[52]!==i){const _=Y?U.find(be=>be.id===Y):null;if(F=_!=null?p[_.index]:null,ke=_!=null?u[_.index]:void 0,U.length===0){let be;e[56]!==i?(be=i("sectionsEditor.sectionList.noSections"),e[56]=i,e[57]=be):be=e[57];let ae;e[58]!==be?(ae=n.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:be}),e[58]=be,e[59]=ae):ae=e[59];const De=!V;let Fe;e[60]===Symbol.for("react.memo_cache_sentinel")?(Fe=n.jsx(bn,{size:14}),e[60]=Fe):Fe=e[60];let ct;e[61]!==i?(ct=i("sectionsEditor.sectionList.addSectionButton"),e[61]=i,e[62]=ct):ct=e[62];let Ve;e[63]!==R||e[64]!==De||e[65]!==ct?(Ve=n.jsxs(tt,{type:"button",variant:"outline",size:"sm",className:"w-full",disabled:De,onClick:R,children:[Fe,ct]}),e[63]=R,e[64]=De,e[65]=ct,e[66]=Ve):Ve=e[66];let Xe;e[67]!==ae||e[68]!==Ve?(Xe=n.jsxs("div",{className:"space-y-2",children:[ae,Ve]}),e[67]=ae,e[68]=Ve,e[69]=Xe):Xe=e[69],se=Xe;break e}pe=Ue(_&&"cursor-grabbing"),e[46]=Y,e[47]=V,e[48]=U,e[49]=R,e[50]=u,e[51]=p,e[52]=i,e[53]=ke,e[54]=F,e[55]=pe}else ke=e[53],F=e[54],pe=e[55];Ie=ms,xe=Ce,ne=fs,me=ie,_e=re,fe=qe,Ke=ps,Oe=de,Pe=gs,Me="space-y-1",te=U.map(_=>{const be=p[_.index];return be?n.jsx(xi,{sortableId:_.id,section:be,raw:u[_.index],meta:x,selected:j===_.index,onSelect:()=>Te(_.index),onDelete:()=>g(_.index),onDuplicate:()=>k(_.index),onMakeReusable:()=>K(_.index),onToggleHidden:()=>M(_.index),onToggleLazy:()=>D(_.index),onAddVariant:()=>c(_.index),onDetach:()=>S(_.index)},_.id):null})}e[11]=Y,e[12]=V,e[13]=U,e[14]=de,e[15]=re,e[16]=x,e[17]=R,e[18]=c,e[19]=g,e[20]=S,e[21]=k,e[22]=K,e[23]=v,e[24]=M,e[25]=D,e[26]=u,e[27]=p,e[28]=j,e[29]=Ce,e[30]=i,e[31]=Ke,e[32]=Ie,e[33]=ke,e[34]=F,e[35]=te,e[36]=Oe,e[37]=Pe,e[38]=xe,e[39]=ne,e[40]=me,e[41]=_e,e[42]=fe,e[43]=pe,e[44]=se,e[45]=Me}else Ke=e[31],Ie=e[32],ke=e[33],F=e[34],te=e[35],Oe=e[36],Pe=e[37],xe=e[38],ne=e[39],me=e[40],_e=e[41],fe=e[42],pe=e[43],se=e[44],Me=e[45];if(se!==Symbol.for("react.early_return_sentinel"))return se;let je;e[70]!==te||e[71]!==Me?(je=n.jsx("div",{className:Me,children:te}),e[70]=te,e[71]=Me,e[72]=je):je=e[72];let le;e[73]!==Ke||e[74]!==Oe||e[75]!==Pe||e[76]!==je?(le=n.jsx(Ke,{items:Oe,strategy:Pe,children:je}),e[73]=Ke,e[74]=Oe,e[75]=Pe,e[76]=je,e[77]=le):le=e[77];let I;e[78]!==ke||e[79]!==F||e[80]!==x?(I=F?n.jsx("div",{className:Ue("cursor-grabbing shadow-lg ring-1 ring-border/60",ws(F,!1)),children:n.jsx(Rs,{section:F,raw:ke,meta:x})}):null,e[78]=ke,e[79]=F,e[80]=x,e[81]=I):I=e[81];let Ee;e[82]!==I?(Ee=Zn.createPortal(n.jsx(ss,{dropAnimation:as,children:I}),document.body),e[82]=I,e[83]=Ee):Ee=e[83];let ge;e[84]!==Ie||e[85]!==xe||e[86]!==ne||e[87]!==me||e[88]!==_e||e[89]!==fe||e[90]!==le||e[91]!==Ee?(ge=n.jsxs(Ie,{sensors:xe,collisionDetection:ne,onDragStart:me,onDragEnd:_e,onDragCancel:fe,children:[le,Ee]}),e[84]=Ie,e[85]=xe,e[86]=ne,e[87]=me,e[88]=_e,e[89]=fe,e[90]=le,e[91]=Ee,e[92]=ge):ge=e[92];const ce=!V;let he;e[93]===Symbol.for("react.memo_cache_sentinel")?(he=n.jsx(bn,{size:14}),e[93]=he):he=e[93];let X;e[94]!==i?(X=i("sectionsEditor.sectionList.addSectionButton"),e[94]=i,e[95]=X):X=e[95];let ue;e[96]!==R||e[97]!==ce||e[98]!==X?(ue=n.jsxs(tt,{type:"button",variant:"outline",size:"sm",className:"mt-2 w-full",disabled:ce,onClick:R,children:[he,X]}),e[96]=R,e[97]=ce,e[98]=X,e[99]=ue):ue=e[99];let ve;return e[100]!==pe||e[101]!==ge||e[102]!==ue?(ve=n.jsxs("div",{className:pe,children:[ge,ue]}),e[100]=pe,e[101]=ge,e[102]=ue,e[103]=ve):ve=e[103],ve}function Ti(d){return d.id}function Jn(d){const e=st.c(57),{open:o,initialName:u,autoLabel:p,isPending:x,onSubmit:j,onOpenChange:v}=d,y=x===void 0?!1:x,g=Dt(),[k,K]=w.useState(u),[M,D]=w.useState(o);o!==M&&(D(o),o&&K(u));let c;e[0]!==y||e[1]!==v?(c=ie=>{!ie&&!y&&v(!1)},e[0]=y,e[1]=v,e[2]=c):c=e[2];const S=c;let R;e[3]!==y||e[4]!==k||e[5]!==j?(R=async ie=>{ie.preventDefault(),!y&&await j(k.trim())},e[3]=y,e[4]=k,e[5]=j,e[6]=R):R=e[6];const l=R;let V;e[7]!==g?(V=g("sectionsEditor.variantRenameDialog.title"),e[7]=g,e[8]=V):V=e[8];let i;e[9]!==V?(i=n.jsx(Uo,{children:V}),e[9]=V,e[10]=i):i=e[10];let J;e[11]!==p||e[12]!==g?(J=g("sectionsEditor.variantRenameDialog.description",{fallback:p||g("sectionsEditor.variantRenameDialog.defaultFallback")}),e[11]=p,e[12]=g,e[13]=J):J=e[13];let U;e[14]!==J?(U=n.jsx(Go,{children:J}),e[14]=J,e[15]=U):U=e[15];let Le;e[16]!==i||e[17]!==U?(Le=n.jsxs(qo,{children:[i,U]}),e[16]=i,e[17]=U,e[18]=Le):Le=e[18];let Y;e[19]!==g?(Y=g("sectionsEditor.variantRenameDialog.nameLabel"),e[19]=g,e[20]=Y):Y=e[20];let m;e[21]!==Y?(m=n.jsx("label",{htmlFor:"variant-rename-name",className:"text-xs font-medium text-muted-foreground",children:Y}),e[21]=Y,e[22]=m):m=e[22];let P;e[23]===Symbol.for("react.memo_cache_sentinel")?(P=ie=>K(ie.target.value),e[23]=P):P=e[23];let we;e[24]!==p||e[25]!==y||e[26]!==k?(we=n.jsx(Qo,{id:"variant-rename-name",value:k,onChange:P,placeholder:p,autoFocus:!0,disabled:y}),e[24]=p,e[25]=y,e[26]=k,e[27]=we):we=e[27];let N;e[28]!==m||e[29]!==we?(N=n.jsxs("div",{className:"space-y-1.5 py-4",children:[m,we]}),e[28]=m,e[29]=we,e[30]=N):N=e[30];let Z;e[31]!==v?(Z=()=>v(!1),e[31]=v,e[32]=Z):Z=e[32];let T;e[33]!==g?(T=g("sectionsEditor.variantRenameDialog.cancel"),e[33]=g,e[34]=T):T=e[34];let oe;e[35]!==y||e[36]!==Z||e[37]!==T?(oe=n.jsx(tt,{type:"button",variant:"outline",onClick:Z,disabled:y,children:T}),e[35]=y,e[36]=Z,e[37]=T,e[38]=oe):oe=e[38];let B;e[39]!==y||e[40]!==g?(B=y?n.jsxs(n.Fragment,{children:[n.jsx(es,{size:14,className:"animate-spin"}),g("sectionsEditor.variantRenameDialog.saving")]}):g("sectionsEditor.variantRenameDialog.save"),e[39]=y,e[40]=g,e[41]=B):B=e[41];let Ce;e[42]!==y||e[43]!==B?(Ce=n.jsx(tt,{type:"submit",disabled:y,children:B}),e[42]=y,e[43]=B,e[44]=Ce):Ce=e[44];let ee;e[45]!==oe||e[46]!==Ce?(ee=n.jsxs(Wo,{children:[oe,Ce]}),e[45]=oe,e[46]=Ce,e[47]=ee):ee=e[47];let de;e[48]!==l||e[49]!==N||e[50]!==ee||e[51]!==Le?(de=n.jsx(Jo,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:l,children:[Le,N,ee]})}),e[48]=l,e[49]=N,e[50]=ee,e[51]=Le,e[52]=de):de=e[52];let Q;return e[53]!==S||e[54]!==o||e[55]!==de?(Q=n.jsx(Yo,{open:o,onOpenChange:S,children:de}),e[53]=S,e[54]=o,e[55]=de,e[56]=Q):Q=e[56],Q}function ks(d){const e=st.c(5),{rule:o,matchers:u}=d,p=o?.__resolveType??"";let x;if(e[0]!==u||e[1]!==p){const g=u.find(k=>k.resolveType===p)?.iconName??za(p);x=Bo(g),e[0]=u,e[1]=p,e[2]=x}else x=e[2];const j=x;if(!j)return null;let v;return e[3]!==j?(v=n.jsx(j,{size:14,className:"shrink-0"}),e[3]=j,e[4]=v):v=e[4],v}function Yn(d){return d.map(e=>`${e.label}|${e.rule?.__resolveType??""}`).join(`
2
- `)}function Qn(d){return d.map((e,o)=>({id:crypto.randomUUID(),index:o,variant:e}))}function Di(d,e){const o=new Map;for(const u of d){const p=o.get(u.variant.label);p?p.push(u):o.set(u.variant.label,[u])}return e.map((u,p)=>({id:o.get(u.label)?.shift()?.id??crypto.randomUUID(),index:p,variant:u}))}function Vi(d){return d.map((e,o)=>({...e,index:o}))}function Ts(d){const e=st.c(17),{label:o,effectiveRule:u,matchers:p,canDelete:x,dragging:j,onRename:v,onDuplicate:y,onDelete:g}=d,k=Dt();let K;e[0]!==u||e[1]!==p?(K=n.jsx(ks,{rule:u,matchers:p}),e[0]=u,e[1]=p,e[2]=K):K=e[2];let M;e[3]!==o?(M=n.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:o}),e[3]=o,e[4]=M):M=e[4];let D;e[5]!==x||e[6]!==j||e[7]!==o||e[8]!==g||e[9]!==y||e[10]!==v||e[11]!==k?(D=!j&&n.jsxs(xs,{children:[n.jsx(ys,{asChild:!0,children:n.jsx(tt,{type:"button",variant:"ghost",size:"icon","aria-label":k("sectionsEditor.pageVariantTabs.actionsAriaLabel",{label:o}),className:"size-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100 data-[state=open]:opacity-100",onClick:Ai,onPointerDown:Ni,children:n.jsx(vs,{size:14})})}),n.jsxs(_s,{align:"end",className:"w-36",children:[n.jsxs(vt,{onClick:S=>{S.stopPropagation(),v?.()},children:[n.jsx(ii,{size:14}),k("sectionsEditor.pageVariantTabs.renameAction")]}),n.jsxs(vt,{onClick:S=>{S.stopPropagation(),y?.()},children:[n.jsx(bs,{size:14}),k("sectionsEditor.pageVariantTabs.duplicateAction")]}),n.jsx(ni,{}),n.jsxs(vt,{variant:"destructive",disabled:!x,onClick:S=>{S.stopPropagation(),g?.()},children:[n.jsx(Ss,{size:14}),k("sectionsEditor.pageVariantTabs.deleteAction")]})]})]}),e[5]=x,e[6]=j,e[7]=o,e[8]=g,e[9]=y,e[10]=v,e[11]=k,e[12]=D):D=e[12];let c;return e[13]!==K||e[14]!==M||e[15]!==D?(c=n.jsxs(n.Fragment,{children:[K,M,D]}),e[13]=K,e[14]=M,e[15]=D,e[16]=c):c=e[16],c}function Ni(d){return d.stopPropagation()}function Ai(d){return d.stopPropagation()}function Ci(d){const e=st.c(33),{entry:o,isActive:u,canDelete:p,decofile:x,meta:j,matchers:v,onSelect:y,onRename:g,onDuplicate:k,onDelete:K}=d;let M;e[0]!==o.id?(M={id:o.id,animateLayoutChanges:Pi},e[0]=o.id,e[1]=M):M=e[1];const{attributes:D,listeners:c,setNodeRef:S,transform:R,isDragging:l}=ls(M);let V;e[2]!==R?(V=cs.Transform.toString(R?{...R,x:0}:null),e[2]=R,e[3]=V):V=e[3];const i=l?0:void 0;let J;e[4]!==V||e[5]!==i?(J={transform:V,opacity:i},e[4]=V,e[5]=i,e[6]=J):J=e[6];const U=J,Le=j??void 0;let Y;e[7]!==x||e[8]!==o.variant.rule||e[9]!==Le?(Y=Kt(o.variant.rule,x,Le),e[7]=x,e[8]=o.variant.rule,e[9]=Le,e[10]=Y):Y=e[10];const m=Y;let P;e[11]!==y?(P=B=>{B.target===B.currentTarget&&(B.key==="Enter"||B.key===" ")&&(B.preventDefault(),y())},e[11]=y,e[12]=P):P=e[12];const we=l?"cursor-grabbing":"cursor-pointer active:cursor-grabbing",N=u?hs:us;let Z;e[13]!==we||e[14]!==N?(Z=Ue("group flex select-none items-center gap-2 rounded-md px-2 py-2.5 transition-colors touch-none",we,N),e[13]=we,e[14]=N,e[15]=Z):Z=e[15];let T;e[16]!==p||e[17]!==m||e[18]!==o.variant.label||e[19]!==v||e[20]!==K||e[21]!==k||e[22]!==g?(T=n.jsx(Ts,{label:o.variant.label,effectiveRule:m,matchers:v,canDelete:p,onRename:g,onDuplicate:k,onDelete:K}),e[16]=p,e[17]=m,e[18]=o.variant.label,e[19]=v,e[20]=K,e[21]=k,e[22]=g,e[23]=T):T=e[23];let oe;return e[24]!==D||e[25]!==c||e[26]!==y||e[27]!==S||e[28]!==U||e[29]!==Z||e[30]!==T||e[31]!==P?(oe=n.jsx("div",{ref:S,style:U,...D,...c,onClick:y,onKeyDown:P,className:Z,children:T}),e[24]=D,e[25]=c,e[26]=y,e[27]=S,e[28]=U,e[29]=Z,e[30]=T,e[31]=P,e[32]=oe):oe=e[32],oe}function Pi(){return!1}function Mi(d){const e=st.c(9),{variant:o,decofile:u,meta:p,matchers:x}=d,j=p??void 0;let v;e[0]!==u||e[1]!==j||e[2]!==o.rule?(v=Kt(o.rule,u,j),e[0]=u,e[1]=j,e[2]=o.rule,e[3]=v):v=e[3];const y=v;let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=Ue("flex items-center gap-2 rounded-md px-2 py-2.5 shadow-lg ring-1 ring-border/60 cursor-grabbing",hs),e[4]=g):g=e[4];let k;return e[5]!==y||e[6]!==x||e[7]!==o.label?(k=n.jsx("div",{className:g,children:n.jsx(Ts,{label:o.label,effectiveRule:y,matchers:x,canDelete:!1,dragging:!0})}),e[5]=y,e[6]=x,e[7]=o.label,e[8]=k):k=e[8],k}function Li(d){const e=st.c(91),{listKey:o,variants:u,activeIndex:p,decofile:x,meta:j,matchers:v,onSelect:y,onReorder:g,onRename:k,onDuplicate:K,onDelete:M,onAdd:D}=d,c=Dt();let S;e[0]!==u?(S=()=>Qn(u),e[0]=u,e[1]=S):S=e[1];const[R,l]=w.useState(S),[V,i]=w.useState(null),[J,U]=w.useState(o),[Le,Y]=w.useState(u.length);let m;e[2]!==u?(m=()=>Yn(u),e[2]=u,e[3]=m):m=e[3];const[P,we]=w.useState(m),N=w.useRef(!1),Z=Yn(u);J!==o?(U(o),Y(u.length),we(Z),l(Qn(u))):(Le!==u.length||P!==Z)&&(Y(u.length),we(Z),l(ge=>Di(ge,u)));let T;e[4]===Symbol.for("react.memo_cache_sentinel")?(T={activationConstraint:{distance:8}},e[4]=T):T=e[4];let oe;e[5]===Symbol.for("react.memo_cache_sentinel")?(oe={coordinateGetter:ds},e[5]=oe):oe=e[5];const B=ns(Xt(is,T),Xt(os,oe));let Ce;e[6]!==R?(Ce=R.map(Ki),e[6]=R,e[7]=Ce):Ce=e[7];const ee=Ce,de=u.length>1;let Q;e[8]!==R?(Q=ge=>{const ce=String(ge.active.id);i(R.find(he=>he.id===ce)??null)},e[8]=R,e[9]=Q):Q=e[9];const ie=Q;let ye;e[10]!==ee||e[11]!==g?(ye=ge=>{i(null);const{active:ce,over:he}=ge;if(!he||ce.id===he.id)return;const X=ee.indexOf(String(ce.id)),ue=ee.indexOf(String(he.id));X===-1||ue===-1||(l(ve=>Vi(Lt([...ve],X,ue))),N.current=!0,requestAnimationFrame(()=>{N.current=!1}),g(X,ue))},e[10]=ee,e[11]=g,e[12]=ye):ye=e[12];const re=ye;let L;e[13]===Symbol.for("react.memo_cache_sentinel")?(L=()=>{i(null)},e[13]=L):L=e[13];const qe=L;let Ke,Ie,ke,F,te,Oe,Pe,xe,ne,me,_e,fe,pe;if(e[14]!==p||e[15]!==de||e[16]!==x||e[17]!==R||e[18]!==ee||e[19]!==re||e[20]!==ie||e[21]!==v||e[22]!==j||e[23]!==D||e[24]!==M||e[25]!==K||e[26]!==k||e[27]!==y||e[28]!==B||e[29]!==c){const ge=ae=>{N.current||y(ae)};_e="space-y-1 border-b p-2";let ce;e[43]!==c?(ce=c("sectionsEditor.pageVariantTabs.variantsLabel"),e[43]=c,e[44]=ce):ce=e[44];let he;e[45]!==ce?(he=n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:ce}),e[45]=ce,e[46]=he):he=e[46];let X;e[47]!==c?(X=c("sectionsEditor.pageVariantTabs.addVariantAriaLabel"),e[47]=c,e[48]=X):X=e[48];let ue;e[49]===Symbol.for("react.memo_cache_sentinel")?(ue=n.jsx(bn,{size:14}),e[49]=ue):ue=e[49];let ve;e[50]!==D||e[51]!==X?(ve=n.jsx(kt,{asChild:!0,children:n.jsx(tt,{type:"button",variant:"ghost",size:"icon","aria-label":X,className:"size-6",onClick:D,children:ue})}),e[50]=D,e[51]=X,e[52]=ve):ve=e[52];let Te;e[53]!==c?(Te=c("sectionsEditor.pageVariantTabs.addVariantTooltip"),e[53]=c,e[54]=Te):Te=e[54];let _;e[55]!==Te?(_=n.jsx(Tt,{children:Te}),e[55]=Te,e[56]=_):_=e[56];let be;e[57]!==ve||e[58]!==_?(be=n.jsxs(wt,{children:[ve,_]}),e[57]=ve,e[58]=_,e[59]=be):be=e[59],e[60]!==he||e[61]!==be?(fe=n.jsxs("div",{className:"flex items-center justify-between",children:[he,be]}),e[60]=he,e[61]=be,e[62]=fe):fe=e[62],Ie=ms,Oe=B,Pe=fs,xe=ie,ne=re,me=qe,Ke=ps,F=ee,te=gs,pe="space-y-0.5",ke=R.map(ae=>n.jsx(Ci,{entry:ae,isActive:ae.index===p,canDelete:de,decofile:x,meta:j,matchers:v,onSelect:()=>ge(ae.index),onRename:()=>k(ae.index),onDuplicate:()=>K(ae.index),onDelete:()=>M(ae.index)},ae.id)),e[14]=p,e[15]=de,e[16]=x,e[17]=R,e[18]=ee,e[19]=re,e[20]=ie,e[21]=v,e[22]=j,e[23]=D,e[24]=M,e[25]=K,e[26]=k,e[27]=y,e[28]=B,e[29]=c,e[30]=Ke,e[31]=Ie,e[32]=ke,e[33]=F,e[34]=te,e[35]=Oe,e[36]=Pe,e[37]=xe,e[38]=ne,e[39]=me,e[40]=_e,e[41]=fe,e[42]=pe}else Ke=e[30],Ie=e[31],ke=e[32],F=e[33],te=e[34],Oe=e[35],Pe=e[36],xe=e[37],ne=e[38],me=e[39],_e=e[40],fe=e[41],pe=e[42];let se;e[63]!==ke||e[64]!==pe?(se=n.jsx("div",{className:pe,children:ke}),e[63]=ke,e[64]=pe,e[65]=se):se=e[65];let Me;e[66]!==Ke||e[67]!==F||e[68]!==te||e[69]!==se?(Me=n.jsx(Ke,{items:F,strategy:te,children:se}),e[66]=Ke,e[67]=F,e[68]=te,e[69]=se,e[70]=Me):Me=e[70];let je;e[71]!==V||e[72]!==x||e[73]!==v||e[74]!==j?(je=V?n.jsx(Mi,{variant:V.variant,decofile:x,meta:j,matchers:v}):null,e[71]=V,e[72]=x,e[73]=v,e[74]=j,e[75]=je):je=e[75];let le;e[76]!==je?(le=Zn.createPortal(n.jsx(ss,{dropAnimation:as,children:je}),document.body),e[76]=je,e[77]=le):le=e[77];let I;e[78]!==Ie||e[79]!==Oe||e[80]!==Pe||e[81]!==xe||e[82]!==ne||e[83]!==me||e[84]!==Me||e[85]!==le?(I=n.jsxs(Ie,{sensors:Oe,collisionDetection:Pe,onDragStart:xe,onDragEnd:ne,onDragCancel:me,children:[Me,le]}),e[78]=Ie,e[79]=Oe,e[80]=Pe,e[81]=xe,e[82]=ne,e[83]=me,e[84]=Me,e[85]=le,e[86]=I):I=e[86];let Ee;return e[87]!==_e||e[88]!==fe||e[89]!==I?(Ee=n.jsxs("div",{className:_e,children:[fe,I]}),e[87]=_e,e[88]=fe,e[89]=I,e[90]=Ee):Ee=e[90],Ee}function Ki(d){return d.id}function Xn(d){const e=st.c(21),{currentRt:o,currentLabel:u,currentGlobalKey:p,matchers:x,globals:j,onSelect:v,onSelectGlobal:y,schema:g,formValue:k,onChange:K,formKey:M,formWrapperClassName:D,meta:c,decofile:S,onSaveReferencedBlock:R,sandbox:l}=d;let V;e[0]!==p||e[1]!==u||e[2]!==o||e[3]!==j||e[4]!==x||e[5]!==v||e[6]!==y?(V=n.jsx(Ha,{currentRt:o,currentLabel:u,currentGlobalKey:p,matchers:x,globals:j,onSelect:v,onSelectGlobal:y}),e[0]=p,e[1]=u,e[2]=o,e[3]=j,e[4]=x,e[5]=v,e[6]=y,e[7]=V):V=e[7];let i;e[8]!==S||e[9]!==M||e[10]!==k||e[11]!==D||e[12]!==c||e[13]!==K||e[14]!==R||e[15]!==l||e[16]!==g?(i=g&&k&&n.jsx("div",{className:D,children:n.jsx(Ua,{schema:g,value:k,onChange:K,meta:c,decofile:S,onSaveReferencedBlock:R,sandbox:l},M)}),e[8]=S,e[9]=M,e[10]=k,e[11]=D,e[12]=c,e[13]=K,e[14]=R,e[15]=l,e[16]=g,e[17]=i):i=e[17];let J;return e[18]!==V||e[19]!==i?(J=n.jsxs(n.Fragment,{children:[V,i]}),e[18]=V,e[19]=i,e[20]=J):J=e[20],J}function Dc({orgSlug:d,virtualMcpId:e,branch:o,previewReady:u=!0,previewUrl:p,currentPath:x,activePageBlockKey:j=null,activeGlobalBlockKey:v=null,externalSelection:y,onSaved:g,initialEditSeo:k=!1,onExitSeo:K,onViewJsonFile:M,onVariantPreviewOverride:D}){const c=Dt(),S=Pa()?.taskId??null,R=u?{orgSlug:d,virtualMcpId:e,branch:o,threadId:S,previewUrl:p}:null,{data:l,isLoading:V}=Ga(R),{data:i,isLoading:J}=qa(R),U=Wa(),Le=U?.entity?.id===e?U.entity.metadata?.siteSlug??null:null,Y=ri({virtualMcpId:e,sandboxUrl:p}),[m,P]=w.useState(null),[we,N]=w.useState(null),[Z,T]=w.useState(null),[oe,B]=w.useState(0),[Ce,ee]=w.useState(void 0),[de,Q]=w.useState(null),[ie,ye]=w.useState(null),[re,L]=w.useState([]),qe=w.useRef(null),[Ke,Ie]=w.useState(re.length);Ke!==re.length&&(Ie(re.length),requestAnimationFrame(()=>{qe.current&&(qe.current.scrollTop=0)}));const[ke,F]=w.useState(0),[te,Oe]=w.useState(null),[Pe,xe]=w.useState(null),[ne,me]=w.useState(null),[_e,fe]=w.useState(!0),[pe,se]=w.useState(!1),[Me,je]=w.useState(!1),le=w.useRef(null),[I,Ee]=w.useState(k),[ge,ce]=w.useState(k);k&&!ge&&(ce(!0),Ee(!0),P(null),N(null),T(null),L([])),!k&&ge&&ce(!1);const[he,X]=w.useState(null),[ue,ve]=w.useState(void 0),[Te,_]=w.useState([]),[be,ae]=w.useState(0),[De,Fe]=w.useState(0),[ct,Ve]=w.useState(null),[Xe,We]=w.useState(null),[Sn,yn]=w.useState(null),Ds=Aa(),Vs=`${d}/${e}/${o}`,Zt=Ja({orgSlug:d,virtualMcpId:e,branch:o}),[Ns,As]=w.useState(x),[Cs,Ps]=w.useState(j),[Ms,Ls]=w.useState(v);(Ns!==x||Cs!==j||Ms!==v)&&(queueMicrotask(()=>Zt.flush()),As(x),Ps(j),Ls(v),P(null),N(null),T(null),B(0),Q(null),ye(null),Fe(0),Ve(null),We(null),L([]),F(t=>t+1),Ee(!1),X(null),ve(void 0),_([]),ae(t=>t+1));const Ne=Ya({orgSlug:d,virtualMcpId:e,branch:o}),Bt=Eo((t,s)=>{Ne.mutate({blockKey:t,data:s},{onSuccess:()=>g?.(),onError:a=>q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:a.message}))})}),en=Qa({orgSlug:d,virtualMcpId:e,branch:o}),[Vt,It]=w.useState(!1),ze=w.useRef(null),at=w.useRef(null),ot=w.useRef(null),tn=w.useRef({}),Ze=w.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null});if(!u||V||J)return n.jsx("div",{className:"h-full w-full flex items-center justify-center",children:n.jsx(es,{size:20,className:"animate-spin text-muted-foreground"})});if(!l||!i)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.couldNotLoadSiteData")});const Ks=Xa(l),Ae=!!v,Je=Ae?null:Za(Ks,x,j),E=Ae?v:Je?.key??null,nn=Ae&&v?l[v]:void 0,xn=Ae&&v&&nn?eo(v,nn):Ae&&v?v:"",Ot=!Ae&&E&&l[E]?l[E]:null,sn=I&&l&&i&&E&&Je?Bn(l,{kind:"page",pageKey:E,pageName:String(Je.name??""),path:String(Je.path??"")},i):null,Bs=I?Ot?.seo:void 0,an=ue!==void 0?ue:Bs,Is=I?to(an):void 0,Os=sn?.seoTypeOptions??[],Fs=I&&i?no(i):"",_n=he??Is??{},on=I&&sn?si(_n,sn):null,$s=I&&on&&so(an)?qt(on,i):null,zs=I?ao(l,i)?.seoData:void 0,Ge=Ae?[{label:"Default",sections:[{__resolveType:v}]}]:oo(Ot?.sections,l??{}),Ft=Ge.length>1,$e=Math.min(oe,Ge.length-1),ut=Ge[$e],H=ut?.sections??[],He=Wt(H,l),jn=!Ae&&io(Ot?.sections);if(Ae&&v&&Sn!==v){yn(v);const t=H[0],s=He[0];if(t&&s){P(0),Fe(0),L([]);const a=St(t,s,l);a&&(N(a.data),T(a.resolveType),We(null),Ve(null))}}!Ae&&Sn!==null&&yn(null),Ze.current={rawSections:H,parsedSections:He,decofile:l??{},activePageKey:E,pageVariants:Ge,variantIndex:$e,sectionVariantIndex:De,selectedSectionIndex:m};const Hs=()=>({multivariate:jn,index:$e,variants:Ge.map(t=>({rule:t.rule}))}),En=(t,s)=>{if(!D)return;if(!E||!jn||t.length<=1){D(null);return}const a=qn(E,{multivariate:!0,index:s,variants:t},l,i);D(a.length>0?a:null)},xt=(t,s,a)=>{if(!D)return;if(!E){D(null);return}const r=Hs(),f=qn(E,r,l,i);if(!t||s<0){D(f.length>0?f:null);return}const b=Do({pageKey:E,page:r,sectionIndex:s,sectionLazy:He[s]?.isLazy??!1,mvObj:t,selectedVariantIndex:a,decofile:l,meta:i}),h=[...f,...b];D(h.length>0?h:null)},dt=(t,s,a,r=m??-1,f=!1)=>{const b=nt(t,s);if(!b){N(null),T(null),We(null),Ve(null),f&&xt(null,r,a);return}const A=In(b,ht)[a];if(!A){N(null),T(null),We(null),Ve(null),f&&xt(null,r,a);return}const W=ho(A.value,l);N(W?.data??null),T(W?.resolveType??null);const{resolveType:C,formValue:O}=Ct(A.rule,l,i??void 0);We(C),Ve(O),f&&xt(b,r,a)},Nt=y?.index;if(y!==void 0&&(y?.seq??null)!==Ce&&(ee(y?.seq??null),typeof Nt=="number")){const t=H[Nt],s=He[Nt];if(t&&s)if(P(Nt),Fe(0),L([]),F(a=>a+1),s.isMultivariate)dt(t,s,0,Nt);else{const a=St(t,s,l);a?(N(a.data),T(a.resolveType)):(N(null),T(null)),We(null),Ve(null)}}const $t={orgSlug:d,virtualMcpId:e,branch:o,threadId:S,previewUrl:p??void 0,siteSlug:Le},rn=Z&&i?qt(Z,i):null,Ye=(t,s)=>{if(!E)return;ze.current&&(clearTimeout(ze.current),ze.current=null),ot.current&&(clearTimeout(ot.current),ot.current=null),at.current&&(clearTimeout(at.current),at.current=null);const a=Mt(l,E,t,$e,Ge);Ne.mutate({blockKey:E,data:a},{onSuccess:()=>s?.onSuccess?.()??g?.(),onError:r=>q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:r.message}))})},_t=()=>{P(null),N(null),T(null),Fe(0),Ve(null),We(null),L([]),F(t=>t+1)},Us=(t,s)=>{ze.current&&clearTimeout(ze.current);const a=Ze.current.sectionVariantIndex;ze.current=setTimeout(()=>{const{rawSections:r,parsedSections:f,decofile:b,activePageKey:h,pageVariants:A,variantIndex:W}=Ze.current,C=r[s];if(!C)return;const O=f[s];if(!O)return;if(O.isSavedBlock){const z=No(C,O);if(!z)return;Ne.mutate({blockKey:z,data:t},{onSuccess:()=>g?.(),onError:G=>q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:G.message}))});return}if(!h)return;const $={...b[h]},Re=[...r];if(O.isMultivariate){const z=nt(C,O);if(!z||!h)return;const G=Ao(z,a,t);Re[s]=yt(C,O,G)}else if(O.isHidden){const z=rs(C.__resolveType),G=z?{...C.section}:{...C},Be=Array.isArray(G.variants)?[...G.variants]:[];Be[0]&&(Be[0]={...Be[0],value:t}),G.variants=Be,z?Re[s]={...C,section:G}:Re[s]=G}else O.isLazy?Re[s]={...C,section:t}:Re[s]=t;if(A.length>1){const z=$.sections,G=[...z?.variants??[]];G[W]&&(G[W]={...G[W],value:Re}),$.sections={...z,variants:G}}else $.sections=Re;Ne.mutate({blockKey:h,data:$},{onSuccess:()=>g?.(),onError:z=>q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:z.message}))})},gn)},Gs=t=>{P(t),Fe(0),L([]),F(f=>f+1);const s=H[t],a=He[t];if(!s||!a)return;if(a.isMultivariate){dt(s,a,0,t);return}const r=St(s,a,l);if(!r){N(null),T(null),We(null),Ve(null),xt(null,t,0);return}N(r.data),T(r.resolveType),We(null),Ve(null),xt(null,t,0)},Rn=t=>{const s=t;N(s),m!==null&&Us(s,m)},ln=t=>{if(!E||!l||!i||!Je)return;const s={kind:"page",pageKey:E,pageName:String(Je.name??""),path:String(Je.path??"")},a=Bn(l,s,i);a&&Zt.save(E,()=>{const r=Ds.getQueryData(Ca.decofile(Vs))?.[E];if(!r||typeof r!="object"||r===null||Array.isArray(r))return null;const f={...r,...tn.current};return tn.current={},t?.raw!==void 0?{...f,seo:t.raw}:t?.inner!==void 0?oi(s,a,f,t.inner):f})},qs=(t,s)=>{E&&(tn.current[t]=s,ln())},Ws=(t,s)=>{if(!E)return;const a=Lt([...H],t,s);m!==null&&(m===t?P(s):t<m&&s>=m?P(m-1):t>m&&s<=m&&P(m+1)),Ye(a)},Js=t=>{if(!E)return;const s=H.filter((a,r)=>r!==t);m===t?_t():m!==null&&m>t&&P(m-1),Ye(s)},Ys=t=>{if(!E)return;const s=H[t];if(!s)return;const a=[...H];a.splice(t+1,0,To(s)),m!==null&&m>t&&P(m+1),Ye(a)},Qs=t=>{if(!E)return;const s=H[t],a=He[t];if(!s||!a)return;const r=a.isHidden?wo(s):ko(s);if(!r)return;const f=[...H];f[t]=r,m===t&&_t(),Ye(f)},Xs=t=>{if(!E)return;const s=H[t],a=He[t];if(!s||!a||a.isMultivariate)return;const r=Ro(s);if(!r)return;const f=[...H];f[t]=r,m===t&&_t(),Ye(f)},Zs=t=>{if(!E)return;const s=H[t],a=He[t];if(!s||!a?.isSavedBlock)return;const r=St(s,a,l);if(!r?.data)return;const{name:f,...b}=r.data,h=[...H];a.isLazy?h[t]={...s,section:b}:h[t]=b,m===t&&_t(),Ye(h)},ea=t=>{if(!E)return;const s=[...H,{__resolveType:t.resolveType}],a=s.length-1;Ye(s,{onSuccess:()=>{se(!1),P(a),Fe(0),L([]),F(h=>h+1);const r=s[a],f=Wt(s,l)[a];if(!r||!f)return;if(f.isMultivariate){dt(r,f,0);return}const b=St(r,f,l);if(!b){N(null),T(null),We(null),Ve(null);return}N(b.data),T(b.resolveType),We(null),Ve(null)}})},wn=t=>{le.current=t.append,se(!0)},ta=t=>{const s=le.current;if(!s){ea(t);return}s({__resolveType:t.resolveType}),se(!1),le.current=null},na=t=>{if(m===null)return;const s=H[m],a=He[m];!s||!a?.isMultivariate||(Fe(t),L([]),F(r=>r+1),dt(s,a,t,m,!0))},sa=t=>{if(m===null||!E)return;const s=H[m],a=He[m];if(!s||!a?.isMultivariate)return;const r=nt(s,a);if(!r)return;const f=_o(r,t);if(!f){q.error(c("sectionsEditor.sectionsEditor.cannotDeleteOnlyVariant"));return}const b=[...H];b[m]=yt(s,a,f);const h=f.variants;let A=De;t===De?A=Math.min(t,h.length-1):t<De&&(A=De-1),Fe(A),L([]),F(W=>W+1),dt(b[m],a,A),Ye(b)},aa=t=>{if(m===null||!E)return;const s=H[m],a=He[m];if(!s||!a?.isMultivariate)return;const r=nt(s,a);if(!r)return;const f=jo(r,t),b=[...H];b[m]=yt(s,a,f);const h=t+1;Fe(h),L([]),F(A=>A+1),dt(b[m],a,h),Ye(b)},oa=(t,s)=>{if(m===null||!E||t===s)return;const a=H[m],r=He[m];if(!a||!r?.isMultivariate)return;const f=nt(a,r);if(!f)return;const b=yo(f,t,s),h=[...H];h[m]=yt(a,r,b);let A=De;De===t?A=s:t<De&&s>=De?A=De-1:t>De&&s<=De&&(A=De+1),Fe(A),dt(h[m],r,A),Ye(h)},cn=t=>{const s=t??m;if(s===null||!E)return;const a=H[s],r=He[s];if(!a||!r)return;const f=vo(a,r);if(!f){q.error(c("sectionsEditor.sectionsEditor.sectionCannotHaveVariants"));return}const b=[...H];b[s]=f.section;const h=Wt(b,l)[s];if(!h?.isMultivariate){q.error(c("sectionsEditor.sectionsEditor.couldNotAddVariant"));return}P(s),Fe(f.newVariantIndex),L([]),F(A=>A+1),dt(f.section,h,f.newVariantIndex,s),Ye(b)},ia=()=>{if(m===null||!E)return;const t=H[m],s=He[m];if(!t||!s?.isMultivariate)return;const a=nt(t,s);if(!a)return;const r=xo(t,s,a);if(!r){q.error(c("sectionsEditor.sectionsEditor.couldNotRemoveVariants"));return}const f=[...H];f[m]=r;const b=Wt(f,l)[m];if(!b)return;Fe(0),We(null),Ve(null),L([]),F(A=>A+1);const h=St(r,b,l);h?(N(h.data),T(h.resolveType)):(N(null),T(null)),xt(null,m,0),Ye(f)},ra=async t=>{if(te===null||!E)return;const s=pn(t,l);if(s){q.error(s);return}const a=H[te],r=He[te];if(!a||!r)return;const f=St(a,r,l);if(!f){q.error(c("sectionsEditor.sectionsEditor.sectionCannotBeSavedAsGlobal"));return}const b={...f.data,name:t};try{await Ne.mutateAsync({blockKey:t,data:b});const h=[...H];h[te]={__resolveType:t},await Ne.mutateAsync({blockKey:E,data:Mt(l,E,h,$e,Ge)}),m===te&&_t(),Oe(null),q.success(c("sectionsEditor.sectionsEditor.savedGlobalBlock",{blockId:t})),g?.()}catch(h){q.error(h instanceof Error?h.message:c("sectionsEditor.sectionsEditor.failedToSaveGlobalBlock"))}},kn=ut?.rule;if(Ft&&m===null&&ie===null&&kn){const{resolveType:t,formValue:s}=Ct(kn,l??{},i??void 0);ye(t),Q(s)}const zt=i?ro(i):[],Tn=i&&l?lo(i,l):[],la=!Ae&&!!(Y&&i&&l),ca=ie&&i?qt(ie,i):null,jt=()=>{at.current&&(clearTimeout(at.current),at.current=null),ot.current&&(clearTimeout(ot.current),ot.current=null)},At=async(t,s)=>{if(!(Vo(s,t,i)>0))try{await en.mutateAsync({blockKey:t})}catch(a){q.error(a instanceof Error?a.message:c("sectionsEditor.sectionsEditor.couldNotDeleteMatcherBlock"))}},Dn=t=>{at.current&&clearTimeout(at.current),at.current=setTimeout(()=>{const{activePageKey:s,decofile:a,variantIndex:r}=Ze.current;if(!s)return;const f={...a[s]},b={...f.sections},h=[...b.variants??[]],A=h[r],W=A?.rule;if(Et(W,a,i)){const C=W?.__resolveType??"",O=a[C],$=typeof O?.name=="string"?O.name:C,{__resolveType:Re,...z}=t;Ne.mutate({blockKey:C,data:Rt(Re??"",z,$)},{onSuccess:()=>g?.(),onError:G=>q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:G.message}))});return}A&&(h[r]={...A,rule:t}),f.sections={...b,variants:h},Ne.mutate({blockKey:s,data:f},{onSuccess:()=>g?.(),onError:C=>q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:C.message}))})},gn)},ua=t=>{ye(t);const s=t?zn(t,i):{__resolveType:Hn};Q(t?s:{}),Dn(s)},da=t=>{const s=t;Q(s);const a=ie?{__resolveType:ie,...s}:{...s};Dn(a)},ma=async t=>{jt();const{activePageKey:s,decofile:a,variantIndex:r}=Ze.current;if(!s)return;const f=a[s],b=f?.sections;if(!b||typeof b!="object"||Array.isArray(b))return;const h=b;if(!Array.isArray(h.variants))return;const A=[...h.variants],W=A[r];if(!W)return;const C=Pt(W.rule,a,i),O=Yt(t);A[r]={...W,rule:O};const $={...a,[s]:{...f,sections:{...h,variants:A}}},{resolveType:Re,formValue:z}=Ct(O,$,i??void 0);ye(Re),Q(z);try{await Ne.mutateAsync({blockKey:s,data:$[s]}),C&&C!==t&&await At(C,$),g?.()}catch(G){q.error(G instanceof Error?G.message:c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}},Vn=t=>{ot.current&&clearTimeout(ot.current);const{selectedSectionIndex:s,sectionVariantIndex:a}=Ze.current;s!==null&&(ot.current=setTimeout(()=>{const{rawSections:r,parsedSections:f,decofile:b,activePageKey:h,pageVariants:A,variantIndex:W}=Ze.current;if(!h)return;const C=r[s],O=f[s];if(!C||!O?.isMultivariate)return;const $=nt(C,O);if(!$)return;const z=($.variants??[])[a]?.rule;if(Et(z,b,i)){const Se=z?.__resolveType??"",Qe=b[Se],rt=typeof Qe?.name=="string"?Qe.name:Se,{__resolveType:pt,...lt}=t;Ne.mutate({blockKey:Se,data:Rt(pt??"",lt,rt)},{onSuccess:()=>g?.(),onError:gt=>q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:gt.message}))});return}const G=$n($,a,t),Be=[...r];Be[s]=yt(C,O,G);const et=Mt(b,h,Be,W,A);Ne.mutate({blockKey:h,data:et},{onSuccess:()=>g?.(),onError:Se=>q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:Se.message}))})},gn))},fa=t=>{We(t);const s=t?zn(t,i):{__resolveType:Hn};Ve(t?s:{}),Vn(s)},pa=t=>{const s=t;Ve(s);const a=Xe?{__resolveType:Xe,...s}:{...s};Vn(a)},ga=async t=>{jt();const{selectedSectionIndex:s,sectionVariantIndex:a,rawSections:r,parsedSections:f,decofile:b,activePageKey:h,pageVariants:A,variantIndex:W}=Ze.current;if(s===null||!h)return;const C=r[s],O=f[s];if(!C||!O?.isMultivariate)return;const $=nt(C,O);if(!$)return;const Re=$.variants??[],z=Pt(Re[a]?.rule,b,i),G=Yt(t),Be=$n($,a,G),et=[...r];et[s]=yt(C,O,Be);const Se=Mt(b,h,et,W,A),Qe={...b,[h]:Se},{resolveType:rt,formValue:pt}=Ct(G,Qe,i??void 0);We(rt),Ve(pt);try{await Ne.mutateAsync({blockKey:h,data:Se}),z&&z!==t&&await At(z,Qe),g?.()}catch(lt){q.error(lt instanceof Error?lt.message:c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}};if(!Ae&&!Je)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.noPageFound",{currentPath:x})});if(Ae&&!nn)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.globalBlockNotFound")});const mt=m!==null?He[m]??null:null,Nn=m!==null?H[m]:null,An=Nn&&mt?.isMultivariate?nt(Nn,mt):null,bt=An?In(An,ht):[],un=Math.min(De,Math.max(bt.length-1,0)),Ht=bt[un]??null,ft=mt?.isMultivariate===!0,Cn=m!==null&&mt!==null,Ut=Cn&&(ft||!!(rn&&we)),ha=Ut&&!Ae&&mt?.isSavedBlock===!0,it=Ae||ha,va=Ae?xn:mt?.label??"",ba=Xe&&i?qt(Xe,i):null,dn=Ut&&(!Ae||re.length>0)?Ae?[xn,...re]:[Je.name,mt.label,...ft&&Ht?[Ht.label]:[],...re]:[],Sa=I&&Je?[Je.name,"SEO",...Te]:[],Gt=I?Sa:it?dn.length>0?dn:[va]:dn,ya=!I&&!Ae&&ft&&re.length===0,Pn=()=>{if(!E)return;jt(),ze.current&&(clearTimeout(ze.current),ze.current=null);const t=l[E],s=bo(t.sections,H);if(!s)return;const a=So(s);Ne.mutate({blockKey:E,data:{...t,sections:s}},{onSuccess:()=>{B(a),P(null),N(null),T(null),L([]),Q(null),ye(null)},onError:r=>q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:r.message}))})},mn=(t,s,a)=>{if(!E)return;jt(),ze.current&&(clearTimeout(ze.current),ze.current=null);const r=l[E],f=r.sections;if(!f||typeof f!="object"||Array.isArray(f))return;const b=f;if(!Array.isArray(b.variants))return;const h=t([...b.variants]);if(!h)return;const A=Co(b,h),W={...l,[E]:{...r,sections:A}};Ne.mutate({blockKey:E,data:W[E]},{onSuccess:()=>{s?.(),a&&At(a,W)},onError:C=>q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:C.message}))})},xa=t=>{xe(null),B(t),P(null),N(null),T(null),L([]);const s=Ge[t]?.rule,{resolveType:a,formValue:r}=Ct(s,l??{},i??void 0);ye(a),Q(r),En(Ge.map(f=>({rule:f.rule})),t)},_a=(t,s)=>{if(t===s)return;let a=$e;$e===t?a=s:t<$e&&s>=$e?a=$e-1:t>$e&&s<=$e&&(a=$e+1),B(a);const r=Lt(Ge.map(f=>({rule:f.rule})),t,s);En(r,a),mn(f=>Lt(f,t,s))},ja=t=>{const s=Ge[t]?.rule,a=Pt(s,l??{},i??void 0);mn(r=>r.length<=1?null:(r.splice(t,1),r),()=>{Ge.length-1===1?B(0):t<$e?B($e-1):t===$e&&B(Math.max(0,t-1)),P(null),N(null),T(null),L([]),Q(null),ye(null)},a)},Ea=t=>{mn(s=>Po(s,t),()=>{B(t+1),P(null),N(null),T(null),L([]),Q(null),ye(null)})},Ra=async(t,s)=>{jt(),ze.current&&(clearTimeout(ze.current),ze.current=null);const a=Ze.current.activePageKey,r=Ze.current.decofile;if(!a)return;const f=r[a],b=f.sections;if(!b||typeof b!="object"||Array.isArray(b))return;const h=b;if(!Array.isArray(h.variants))return;const A=[...h.variants],W=A[t];if(!W?.rule||typeof W.rule!="object"){q.error(c("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const C=W.rule,O=s.trim();It(!0);try{if(!O){if(!Et(C,r,i)){xe(null);return}const et=C.__resolveType??"";A[t]={...W,rule:Un(C,r,i)};const Se={...r,[a]:{...f,sections:{...h,variants:A}}};await Ne.mutateAsync({blockKey:a,data:Se[a]}),await At(et,Se),xe(null),g?.();return}const $=Gn(C,r,i);if(!$){q.error(c("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if($.blockKey){await Ne.mutateAsync({blockKey:$.blockKey,data:Rt($.resolveType,$.data,O)}),xe(null),g?.();return}const Re=fn(O),z=pn(Re,r);if(z){q.error(z);return}const G=Rt($.resolveType,$.data,O);let Be=null;try{await Ne.mutateAsync({blockKey:Re,data:G}),Be=Re,A[t]={...W,rule:Yt(Re)},await Ne.mutateAsync({blockKey:a,data:{...f,sections:{...h,variants:A}}}),Be=null}catch(et){throw Be&&await en.mutateAsync({blockKey:Be}).catch(()=>{}),et}xe(null),q.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:O})),g?.()}catch($){q.error($ instanceof Error?$.message:c("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{It(!1)}},wa=async(t,s)=>{jt(),ze.current&&(clearTimeout(ze.current),ze.current=null);const{selectedSectionIndex:a,rawSections:r,parsedSections:f,decofile:b,activePageKey:h,pageVariants:A,variantIndex:W}=Ze.current;if(a===null||!h)return;const C=r[a],O=f[a];if(!C||!O?.isMultivariate)return;const $=nt(C,O);if(!$)return;const Re=$.variants??[],z=Re[t];if(!z?.rule||typeof z.rule!="object"){q.error(c("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const G=z.rule,Be=s.trim();It(!0);const et=async Se=>{const Qe={...$,variants:Se},rt=[...r];rt[a]=yt(C,O,Qe);const pt=Mt(b,h,rt,W,A);return await Ne.mutateAsync({blockKey:h,data:pt}),{...b,[h]:pt}};try{if(!Be){if(!Et(G,b,i)){me(null);return}const gt=G.__resolveType??"",Kn=[...Re];Kn[t]={...z,rule:Un(G,b,i)};const Na=await et(Kn);await At(gt,Na),me(null),g?.();return}const Se=Gn(G,b,i);if(!Se){q.error(c("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(Se.blockKey){await Ne.mutateAsync({blockKey:Se.blockKey,data:Rt(Se.resolveType,Se.data,Be)}),me(null),g?.();return}const Qe=fn(Be),rt=pn(Qe,b);if(rt){q.error(rt);return}const pt=Rt(Se.resolveType,Se.data,Be);let lt=null;try{await Ne.mutateAsync({blockKey:Qe,data:pt}),lt=Qe;const gt=[...Re];gt[t]={...z,rule:Yt(Qe)},await et(gt),lt=null}catch(gt){throw lt&&await en.mutateAsync({blockKey:lt}).catch(()=>{}),gt}me(null),q.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:Be})),g?.()}catch(Se){q.error(Se instanceof Error?Se.message:c("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{It(!1)}},Mn=()=>{_t()},ka=t=>{X(t),ln({inner:t})},Ta=t=>{ve(t),ln({raw:t})},Da=()=>{X(null),_([])},Va=()=>ae(t=>t+1),Ln=t=>{if(I){if(t===0){Zt.flush(),Ee(!1),X(null),ve(void 0),_([]),ae(a=>a+1),K?.();return}if(t===1){_([]),ae(a=>a+1);return}_(Te.slice(0,t-1)),ae(a=>a+1);return}if(Ae){L(re.slice(0,t)),F(a=>a+1);return}if(t===0){Mn();return}if(t===1){L([]),F(a=>a+1);return}if(ft&&t===2){L([]),F(a=>a+1);return}const s=ft?2:1;L(re.slice(0,t-s))};return n.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[n.jsx("div",{className:"shrink-0",children:it||Ut||I?n.jsxs("div",{className:Ue("border-b px-3 py-2.5",it&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[n.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[Gt.length>1&&n.jsx("button",{type:"button",onClick:()=>Ln(Mo(Gt.length,{isMultivariateSectionTop:ya})),title:c("sectionsEditor.sectionsEditor.back"),"aria-label":c("sectionsEditor.sectionsEditor.back"),className:Ue("shrink-0 inline-flex size-6 items-center justify-center rounded-md transition-colors",it?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:n.jsx(Io,{className:"size-4"})}),!Ae&&Ft&&ut&&n.jsxs("button",{type:"button",onClick:Mn,title:c("sectionsEditor.sectionsEditor.editingInVariant",{variant:ut.label}),className:Ue("shrink-0 inline-flex items-center gap-1 rounded-md h-6 px-1.5 text-xs font-medium cursor-pointer transition-opacity hover:opacity-80",co),children:[n.jsx(ks,{rule:Kt(ut.rule,l??{},i??void 0),matchers:zt}),n.jsx("span",{className:"max-w-[160px] truncate",children:ut.label})]}),n.jsx("nav",{"aria-label":c("sectionsEditor.sectionsEditor.editingBreadcrumb"),className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:Gt.map((t,s)=>{const a=s===Gt.length-1,r=uo(t);return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[s>0&&n.jsx($o,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>Ln(s),title:r,className:Ue("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",a?it?"font-semibold text-global-section-fg dark:text-global-section-fg-dark":"font-medium text-foreground":it?"text-foreground/80":"text-muted-foreground",it?"hover:bg-global-section/15":"hover:bg-accent hover:text-accent-foreground"),children:r})]},`${r}-${s}`)})}),it&&n.jsxs(wt,{children:[n.jsx(kt,{asChild:!0,children:n.jsx("span",{className:"shrink-0 cursor-help",children:n.jsx(Ho,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),n.jsx(Tt,{side:"bottom",className:"max-w-[260px]",children:c("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),Cn&&!ft&&!mt?.isHidden&&E&&n.jsx(On,{onClick:()=>cn()})]}),it&&n.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:c("sectionsEditor.sectionsEditor.globalSectionBanner")})]}):n.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[n.jsx("div",{className:"flex-1 min-w-0",children:n.jsx(mo,{pageKey:E,initialName:Je.name,initialPath:Je.path,onFieldChange:qs})}),n.jsxs(wt,{children:[n.jsx(kt,{asChild:!0,children:n.jsx(tt,{type:"button",variant:"ghost",size:"icon","aria-label":c("sectionsEditor.sectionsEditor.editSeo"),className:"size-7 shrink-0",onClick:()=>Ee(!0),children:n.jsx(Oo,{size:14})})}),n.jsx(Tt,{side:"bottom",children:c("sectionsEditor.sectionsEditor.editSeo")})]}),n.jsxs(wt,{children:[n.jsx(kt,{asChild:!0,children:n.jsx(tt,{type:"button",variant:"ghost",size:"icon","aria-label":c("sectionsEditor.sectionsEditor.viewJson"),className:"size-7 shrink-0",onClick:()=>M&&E?M():je(!0),children:n.jsx(Fo,{size:14})})}),n.jsx(Tt,{side:"bottom",children:c("sectionsEditor.sectionsEditor.viewJson")})]}),n.jsx(On,{onClick:Pn})]})}),I?n.jsx(Qt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsx("div",{className:"mx-auto max-w-2xl",children:Ot&&E?n.jsx(ai,{rawSeo:an,innerSeo:_n,defaultResolveType:Fs,seoSchema:$s,activeResolveType:on,seoTypeOptions:Os,formResetKey:be,siteDefaultSeo:zs,onBreadcrumbChange:_,onPersistRaw:Ta,onInnerChange:ka,onClearForm:Da,onBumpFormKey:Va}):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:c("sectionsEditor.sectionsEditor.seoSchemaNotFound")})})})},"editor-seo"):Ut?n.jsxs(Qt,{viewportRef:qe,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[ft&&bt.length>0&&re.length===0&&n.jsxs(n.Fragment,{children:[n.jsx(fo,{listKey:`${E??""}:${m??""}`,variants:bt.map((t,s)=>({index:s,label:t.label})),selectedIndex:un,onSelect:na,onRename:me,onDuplicate:aa,onDelete:sa,onRemoveAll:ia,onReorder:oa,onAdd:()=>cn()}),ft&&n.jsxs("div",{className:"px-3 py-3 border-b space-y-2",children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:c("sectionsEditor.sectionsEditor.variantRule")}),n.jsx(Xn,{currentRt:Xe??"",currentLabel:Jt(Ht?.rule,l??{},ht,i??void 0),currentGlobalKey:Pt(Ht?.rule,l??{},i??void 0)??void 0,matchers:zt,globals:Tn,onSelect:fa,onSelectGlobal:ga,schema:ba,formValue:ct,onChange:pa,formKey:`${m??"none"}:${un}:${Xe??""}`,formWrapperClassName:"pt-1",meta:i??void 0,decofile:l,onSaveReferencedBlock:Bt,sandbox:$t})]})]}),n.jsx(Fn,{activeSchema:rn,formValue:we,formResetKey:ke,onFormChange:Rn,onBreadcrumbChange:L,breadcrumbPath:re,emptyMessage:c("sectionsEditor.sectionsEditor.noEditableFieldsForVariant"),meta:i,decofile:l,onSaveReferencedBlock:Bt,sandbox:$t,previewBaseUrl:Y,onRequestAddSection:wn})]},"editor-section-form"):Ae?n.jsx(Qt,{viewportRef:qe,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx(Fn,{activeSchema:rn,formValue:we,formResetKey:ke,onFormChange:Rn,onBreadcrumbChange:L,breadcrumbPath:re,emptyMessage:c("sectionsEditor.sectionsEditor.noEditableFieldsForGlobalBlock"),meta:i,decofile:l,onSaveReferencedBlock:Bt,sandbox:$t,previewBaseUrl:Y,onRequestAddSection:wn})},"editor-global-block"):n.jsxs(Qt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[Ft&&E&&n.jsx(Li,{listKey:E,variants:Ge,activeIndex:$e,decofile:l??{},meta:i,matchers:zt,onSelect:xa,onReorder:_a,onRename:xe,onDuplicate:Ea,onDelete:ja,onAdd:Pn}),Ft&&ie!==null&&n.jsxs("div",{className:Ue("px-3 border-b",_e?"pt-3 pb-5 space-y-3":"py-2"),children:[n.jsxs("button",{type:"button",onClick:()=>fe(t=>!t),className:"flex w-full items-center justify-between gap-2 text-left cursor-pointer rounded-sm py-0.5 hover:bg-muted/40","aria-expanded":_e,children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:c("sectionsEditor.sectionsEditor.variantRule")}),_e?n.jsx(zo,{className:"size-3.5 shrink-0 text-muted-foreground"}):n.jsx(Lo,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),_e&&n.jsx("div",{className:Ue("space-y-3",Vt&&"pointer-events-none opacity-50"),children:n.jsx(Xn,{currentRt:ie,currentLabel:Jt(ut?.rule,l??{},ht,i??void 0),currentGlobalKey:Pt(ut?.rule,l??{},i??void 0)??void 0,matchers:zt,globals:Tn,onSelect:ua,onSelectGlobal:ma,schema:ca,formValue:de,onChange:da,formKey:`${$e}:${ie??""}`,formWrapperClassName:"space-y-3",meta:i??void 0,decofile:l,onSaveReferencedBlock:Bt,sandbox:$t})})]}),n.jsx("div",{className:"p-2 pt-3",children:n.jsx(ki,{listKey:`${E??""}-${$e}`,rawSections:H,sections:He,meta:i,selectedIndex:m,onSelect:Gs,onReorder:Ws,onDelete:Js,onDuplicate:Ys,onMakeReusable:Oe,onToggleHidden:Qs,onToggleLazy:Xs,onAddVariant:cn,onDetach:Zs,onAddSection:()=>se(!0),canAddSection:la})})]},"editor-section-list"),n.jsx(po,{open:te!==null,onOpenChange:t=>{t||Oe(null)},defaultBlockId:te!==null?fn(He[te]?.label??""):"",isPending:Ne.isPending,onSubmit:ra}),Y&&n.jsx(li,{open:pe,onOpenChange:t=>{se(t),t||(le.current=null)},meta:i,decofile:l,previewBaseUrl:Y,onSelect:ta}),Me&&E&&l&&n.jsx(go,{open:Me,onOpenChange:je,pageKey:E,decofile:l}),Pe!==null&&n.jsx(Jn,{open:!0,initialName:Et(Ge[Pe]?.rule,l??{},i??void 0)?Jt(Ge[Pe]?.rule,l??{},ht,i??void 0):"",autoLabel:ht(Kt(Ge[Pe]?.rule,l??{},i??void 0)),isPending:Vt,onSubmit:async t=>{await Ra(Pe,t)},onOpenChange:t=>{!t&&!Vt&&xe(null)}}),ne!==null&&n.jsx(Jn,{open:!0,initialName:Et(bt[ne]?.rule,l??{},i??void 0)?Jt(bt[ne]?.rule,l??{},ht,i??void 0):"",autoLabel:ht(Kt(bt[ne]?.rule,l??{},i??void 0)),isPending:Vt,onSubmit:async t=>{await wa(ne,t)},onOpenChange:t=>{!t&&!Vt&&me(null)}})]})}export{Dc as SectionsEditor};
@@ -1 +0,0 @@
1
- import{c as T,b as ve,j as o,r as ee,B as je,k as Se}from"./index-Ci8azyOE.js";import{i as ke}from"./ChevronRight-DUmHQrD7.js";import{am as fe}from"./agent-icon-DCM1Bdl8.js";import{S as xe}from"./scroll-area-RteS0-Yk.js";import{aw as ue,aS as Ne,aT as we,aV as _e,ap as Ee,aU as Pe,aW as Te,bO as Fe}from"./index-BdFaTbMe.js";import{u as Re,a as Ce,P as Ke}from"./page-seo-form-kQ_gqmTd.js";import{a as ye}from"./Tool01-va49aYq9.js";import"./AlertCircle-BTlJp8pf.js";import"./UserSquare-CwU4sG2o.js";import"./ArrowUp-CVoISkQ4.js";import"./ArrowLeft-BwagOJkb.js";import"./Tool02-jKKU1_dM.js";import"./XCircle-CVbKXkpd.js";import"./TrendUp01-DikSDrNg.js";import"./ZapSquare-BZzRAQpm.js";import"./Users03-BUoBV4mB.js";import"./CheckCircle-teyxVGFp.js";import"./Check-D5PKBQ5I.js";import"./ChevronDown-Csfjhwpm.js";import"./ChevronSelectorVertical-CuAhXy3x.js";import"./ChevronUp-Dlj_U0qV.js";import"./DotsVertical-CpVcGDJ_.js";import"./Stars02-DZNA1z2-.js";import"./Copy01-CsNpp9jr.js";import"./CreditCard01-YCHpZ00A.js";import"./Download01-BN9BT9cL.js";import"./Settings02-BMcJFHpd.js";import"./Eye-DgiSa7UT.js";import"./FilterLines-Db8-uWfr.js";import"./Share07-CPDrxQV8.js";import"./Globe01-CV-16mwB.js";import"./Globe04-D3O2XfOT.js";import"./SwitchHorizontal01-CSyGO1HX.js";import"./HardDrive-CWvDYc59.js";import"./Key01-D4srNqPO.js";import"./LinkExternal01-CIL2SNWf.js";import"./LockUnlocked01-BpeKJGM4.js";import"./LogOut01-qWWgaWbQ.js";import"./Monitor01-uq-dlf-u.js";import"./Sun-BBWjOwQE.js";import"./Palette-Cv68Zggp.js";import"./Play-C9xK8clC.js";import"./Plus-CPkR-QLd.js";import"./SearchLg-8daQliv2.js";import"./SearchMd-ClTH3fiN.js";import"./Shield01-C9M_jcOJ.js";import"./Stars01-BzEDQnsl.js";import"./Trash01-Dp-QTpAR.js";import"./Upload01-DxCHPffq.js";import"./User01-DJ_BO2EX.js";import"./Users01-B2wc_Wgl.js";import"./XClose-CTv0nnSb.js";import"./Zap-MbQ2aiA8.js";import"./select-C7Q2VGxk.js";import"./chat-context-CmwZXAhQ.js";import"./use-panel-navigate-BsVeEWlx.js";import"./dialog-BI8UUwqv.js";import"./use-destination-route-d8wgPDBu.js";import"./constants-dLUUoWH7.js";import"./session-runtime-C-KTDVeQ.js";import"./slugify-CEUa2lfQ.js";import"./hooks-DQmp7LHz.js";import"./use-mcp-client-DP2onozC.js";import"./auth-D8IdOmGw.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-BN-M5EUb.js";import"./task-board-Cz-fiaKF.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-Dj0wXB98.js";import"./use-ai-providers-DlWIkMD-.js";import"./use-decopilot-events-CqU7DunK.js";import"./use-organization-settings-BAFLKQ3y.js";import"./automation-runs-GCI7uxIE.js";import"./useInfiniteQuery-DjjzlWAZ.js";import"./use-infinite-scroll-Cw7R-QWe.js";import"./use-connection-gqhqm1hO.js";import"./table-oIbRw7Yk.js";import"./empty-state-DAYLBxJ6.js";import"./use-members-IwrDPxqz.js";import"./use-org-auth-client-HXTuHVWD.js";import"./use-automations-CWqvHqj2.js";import"./useSuspenseInfiniteQuery-Ci5SesMe.js";import"./avatar-D-QkiqIH.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-BY1mlr6R.js";import"./monaco-editor-CQbDSum8.js";import"./spinner-B9x-ViPH.js";import"./types-BGVeElFe.js";import"./shell-layout-i3nUAnDL.js";import"./required-auth-layout-CUQaC9Hr.js";import"./use-org-sso-C-uWWD5m.js";import"./integration-icon-CGnrGZxM.js";import"./use-navigate-to-agent-mrg2_DxJ.js";import"./chart-BS94Bf-2.js";import"./index-De-kCEdQ.js";import"./form-DauSI86Q.js";import"./label-C1OhLpvf.js";import"./input-Bwz-dTwg.js";import"./file-type-icon-QfVGs4d0.js";import"./drawer-BR22I8_f.js";import"./collection-search-0N-i_PHL.js";import"./tabs-CFhQLpsD.js";import"./toggle-group-ClOqwWDq.js";import"./super-agent-icon-DbGhAnlL.js";import"./self-tool-result-BSLlHbcp.js";import"./alert-dialog-Dh9zsaCy.js";import"./extract-connection-data-6cVSTGuY.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-CMPWtdMv.js";import"./use-debounced-value-BENALn-i.js";import"./authenticate-and-persist-oauth-DY_hbkIG.js";import"./mcp-oauth-GWhqBwu1.js";import"./track-DXtvDI_s.js";import"./popover-ClwD_xra.js";import"./toolbar-KH-9Bre4.js";import"./github-repo-picker-sKX6qrmQ.js";import"./use-mcp-tools-B7yHzu9T.js";import"./agent-capabilities-B52k7xCe.js";import"./connection-card-B1T5pd1c.js";import"./use-registry-connections-DghvIzKh.js";import"./retry-CErkP7V6.js";import"./connection-slug-CITJ0kGN.js";import"./textarea-CMpN0SgX.js";import"./connection-form-helpers-CYKg-GvJ.js";import"./collection-tabs-PM6yowhG.js";import"./badge-DX3_GQsO.js";import"./select-model-C03zAz7l.js";import"./checkbox-Gg7TSWGl.js";import"./ai-providers-logos-DD3qZ33J.js";import"./cards-4fPEe6ST.js";import"./dropdown-menu-wKA_-hY5.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-kx6TUHpf.js";import"./use-file-configs-BAUKJMmN.js";import"./pt-BR-CLy76QW2.js";import"./use-debounced-autosave-j0VBccs2.js";import"./search-input-CevwWux3.js";import"./use-mcp-auth-status-7KFU7IPU.js";import"./switch-BuJnEOUw.js";import"./use-secrets-CvibJ_Hx.js";import"./AreaChart-dJjxY072.js";import"./config-DFqhM__G.js";import"./command-JNsPUZwg.js";import"./index-BYBf2qjQ.js";import"./get-initials-D-f_fDFw.js";import"./breadcrumb-Clut3vXk.js";import"./use-tags-CGJ43yMs.js";import"./automation-list-row-CLAw5ACh.js";import"./site-error--i37Vnuw.js";import"./use-org-repo-syncs-rlkQHsUF.js";function A(d){return typeof d=="string"&&d.trim()?d:void 0}function he(d,e){if(d){if(e)try{const t=new URL(d,e).href;return ue(t)}catch{return}return ue(d)}}function ze(d){if(!d)return{};const e=A(d.title),t=A(d.titleTemplate);return{title:e&&t?.includes("%s")?t.replace(/%s/g,e):e,description:A(d.description),image:A(d.image),favicon:A(d.favicon)}}function De(d){if(!d)return"example.com";try{return new URL(d).host}catch{return"example.com"}}const $e=[{id:"google",labelKey:"sectionsEditor.seoPreview.platformGoogle",color:"#4285F4",layout:"search"},{id:"facebook",labelKey:"sectionsEditor.seoPreview.platformFacebook",color:"#1877F2",layout:"card"},{id:"twitter",labelKey:"sectionsEditor.seoPreview.platformTwitter",color:"#0f1419",layout:"card"},{id:"linkedin",labelKey:"sectionsEditor.seoPreview.platformLinkedin",color:"#0A66C2",layout:"card"},{id:"whatsapp",labelKey:"sectionsEditor.seoPreview.platformWhatsapp",color:"#25D366",layout:"chat"},{id:"telegram",labelKey:"sectionsEditor.seoPreview.platformTelegram",color:"#229ED9",layout:"chat"},{id:"slack",labelKey:"sectionsEditor.seoPreview.platformSlack",color:"#611f69",layout:"attachment"},{id:"discord",labelKey:"sectionsEditor.seoPreview.platformDiscord",color:"#5865F2",layout:"attachment"}];function de(d){const e=T.c(10),{src:t,className:c,iconSize:v}=d,r=v===void 0?20:v;if(t){let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m={objectFit:"cover"},e[0]=m):m=e[0];let p;return e[1]!==c||e[2]!==t?(p=o.jsx("img",{src:t,alt:"",referrerPolicy:"no-referrer",className:c,style:m}),e[1]=c,e[2]=t,e[3]=p):p=e[3],p}let s;e[4]===Symbol.for("react.memo_cache_sentinel")?(s={display:"flex",alignItems:"center",justifyContent:"center",background:"#e5e7eb",color:"#9ca3af"},e[4]=s):s=e[4];let i;e[5]!==r?(i=o.jsx(ye,{size:r}),e[5]=r,e[6]=i):i=e[6];let n;return e[7]!==c||e[8]!==i?(n=o.jsx("div",{className:c,style:s,children:i}),e[7]=c,e[8]=i,e[9]=n):n=e[9],n}function Ie(d){const e=T.c(33),{seo:t,host:c,path:v,t:r}=d;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={background:"#fff",border:"1px solid #dadce0"},e[0]=s):s=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i={background:"#f1f3f4"},e[1]=i):i=e[1];let n;e[2]!==t.favicon?(n=o.jsx("div",{className:"flex size-6 shrink-0 items-center justify-center overflow-hidden rounded-full",style:i,children:t.favicon?o.jsx("img",{src:t.favicon,alt:"",className:"size-full object-cover"}):o.jsx(ye,{size:12,color:"#9aa0a6"})}),e[2]=t.favicon,e[3]=n):n=e[3];let m;e[4]===Symbol.for("react.memo_cache_sentinel")?(m={color:"#202124"},e[4]=m):m=e[4];let p;e[5]!==c?(p=o.jsx("div",{className:"truncate text-[13px] leading-tight",style:m,children:c}),e[5]=c,e[6]=p):p=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f={color:"#4d5156"},e[7]=f):f=e[7];let l;e[8]!==c||e[9]!==v?(l=o.jsxs("div",{className:"truncate text-[12px] leading-tight",style:f,children:[c,v]}),e[8]=c,e[9]=v,e[10]=l):l=e[10];let a;e[11]!==p||e[12]!==l?(a=o.jsxs("div",{className:"min-w-0",children:[p,l]}),e[11]=p,e[12]=l,e[13]=a):a=e[13];let h;e[14]!==n||e[15]!==a?(h=o.jsxs("div",{className:"flex items-center gap-2",children:[n,a]}),e[14]=n,e[15]=a,e[16]=h):h=e[16];let x;e[17]===Symbol.for("react.memo_cache_sentinel")?(x={color:"#1a0dab"},e[17]=x):x=e[17];let y;e[18]!==t.title||e[19]!==r?(y=t.title??r("sectionsEditor.seoPreview.fallbackTitle"),e[18]=t.title,e[19]=r,e[20]=y):y=e[20];let u;e[21]!==y?(u=o.jsx("div",{className:"mt-1.5 truncate text-[18px] leading-snug",style:x,children:y}),e[21]=y,e[22]=u):u=e[22];let S;e[23]===Symbol.for("react.memo_cache_sentinel")?(S={color:"#4d5156"},e[23]=S):S=e[23];let g;e[24]!==t.description||e[25]!==r?(g=t.description??r("sectionsEditor.seoPreview.fallbackDescription"),e[24]=t.description,e[25]=r,e[26]=g):g=e[26];let b;e[27]!==g?(b=o.jsx("div",{className:"mt-0.5 line-clamp-2 text-[13px] leading-snug",style:S,children:g}),e[27]=g,e[28]=b):b=e[28];let j;return e[29]!==u||e[30]!==b||e[31]!==h?(j=o.jsxs("div",{className:"rounded-lg p-3 text-left",style:s,children:[h,u,b]}),e[29]=u,e[30]=b,e[31]=h,e[32]=j):j=e[32],j}function Le(d){const e=T.c(26),{seo:t,host:c,t:v}=d;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={background:"#fff",border:"1px solid #e2e8f0"},e[0]=r):r=e[0];let s;e[1]!==t.image?(s=o.jsx(de,{src:t.image,className:"h-40 w-full"}),e[1]=t.image,e[2]=s):s=e[2];let i;e[3]===Symbol.for("react.memo_cache_sentinel")?(i={borderTop:"1px solid #e2e8f0"},e[3]=i):i=e[3];let n;e[4]===Symbol.for("react.memo_cache_sentinel")?(n={color:"#8a9099"},e[4]=n):n=e[4];let m;e[5]!==c?(m=o.jsx("div",{className:"truncate text-[11px]",style:n,children:c}),e[5]=c,e[6]=m):m=e[6];let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p={color:"#1c2024"},e[7]=p):p=e[7];let f;e[8]!==t.title||e[9]!==v?(f=t.title??v("sectionsEditor.seoPreview.fallbackTitle"),e[8]=t.title,e[9]=v,e[10]=f):f=e[10];let l;e[11]!==f?(l=o.jsx("div",{className:"line-clamp-1 text-[14px] font-semibold",style:p,children:f}),e[11]=f,e[12]=l):l=e[12];let a;e[13]===Symbol.for("react.memo_cache_sentinel")?(a={color:"#60666c"},e[13]=a):a=e[13];let h;e[14]!==t.description||e[15]!==v?(h=t.description??v("sectionsEditor.seoPreview.fallbackDescription"),e[14]=t.description,e[15]=v,e[16]=h):h=e[16];let x;e[17]!==h?(x=o.jsx("div",{className:"line-clamp-2 text-[12px]",style:a,children:h}),e[17]=h,e[18]=x):x=e[18];let y;e[19]!==x||e[20]!==m||e[21]!==l?(y=o.jsxs("div",{className:"px-3 py-2",style:i,children:[m,l,x]}),e[19]=x,e[20]=m,e[21]=l,e[22]=y):y=e[22];let u;return e[23]!==y||e[24]!==s?(u=o.jsxs("div",{className:"overflow-hidden rounded-lg text-left",style:r,children:[s,y]}),e[23]=y,e[24]=s,e[25]=u):u=e[25],u}function Oe(d){const e=T.c(36),{seo:t,host:c,accent:v,t:r}=d;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={background:"#f0f2f5"},e[0]=s):s=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i={color:"#3b4045"},e[1]=i):i=e[1];let n;e[2]!==r?(n=r("sectionsEditor.seoPreview.chatCardHint"),e[2]=r,e[3]=n):n=e[3];let m;e[4]!==n?(m=o.jsx("p",{className:"px-1 pb-1.5 text-[12px]",style:i,children:n}),e[4]=n,e[5]=m):m=e[5];const p=`3px solid ${v}`;let f;e[6]!==p?(f={background:"#fff",borderLeft:p},e[6]=p,e[7]=f):f=e[7];let l;e[8]!==t.image?(l=o.jsx(de,{src:t.image,className:"h-28 w-full",iconSize:18}),e[8]=t.image,e[9]=l):l=e[9];let a;e[10]===Symbol.for("react.memo_cache_sentinel")?(a={color:"#1c2024"},e[10]=a):a=e[10];let h;e[11]!==t.title||e[12]!==r?(h=t.title??r("sectionsEditor.seoPreview.fallbackTitle"),e[11]=t.title,e[12]=r,e[13]=h):h=e[13];let x;e[14]!==h?(x=o.jsx("div",{className:"line-clamp-1 text-[12px] font-semibold",style:a,children:h}),e[14]=h,e[15]=x):x=e[15];let y;e[16]===Symbol.for("react.memo_cache_sentinel")?(y={color:"#60666c"},e[16]=y):y=e[16];let u;e[17]!==t.description||e[18]!==r?(u=t.description??r("sectionsEditor.seoPreview.fallbackDescription"),e[17]=t.description,e[18]=r,e[19]=u):u=e[19];let S;e[20]!==u?(S=o.jsx("div",{className:"line-clamp-2 text-[11px]",style:y,children:u}),e[20]=u,e[21]=S):S=e[21];let g;e[22]===Symbol.for("react.memo_cache_sentinel")?(g={color:"#8a9099"},e[22]=g):g=e[22];let b;e[23]!==c?(b=o.jsx("div",{className:"mt-0.5 text-[10px]",style:g,children:c}),e[23]=c,e[24]=b):b=e[24];let j;e[25]!==x||e[26]!==S||e[27]!==b?(j=o.jsxs("div",{className:"px-2.5 py-1.5",children:[x,S,b]}),e[25]=x,e[26]=S,e[27]=b,e[28]=j):j=e[28];let k;e[29]!==j||e[30]!==f||e[31]!==l?(k=o.jsxs("div",{className:"overflow-hidden rounded-md",style:f,children:[l,j]}),e[29]=j,e[30]=f,e[31]=l,e[32]=k):k=e[32];let N;return e[33]!==k||e[34]!==m?(N=o.jsxs("div",{className:"rounded-lg p-2 text-left",style:s,children:[m,k]}),e[33]=k,e[34]=m,e[35]=N):N=e[35],N}function Ue(d){const e=T.c(39),{seo:t,host:c,accent:v,dark:r,t:s}=d,i=r?"#2b2d31":"#fff",n=r?"#00a8fc":"#1264a3",m=r?"#dbdee1":"#3b4045",p=r?"#949ba4":"#8a9099",f=r?"none":"1px solid #e2e8f0";let l;e[0]!==i||e[1]!==f?(l={background:i,border:f},e[0]=i,e[1]=f,e[2]=l):l=e[2];const a=`3px solid ${v}`;let h;e[3]!==a?(h={borderLeft:a,borderRadius:2},e[3]=a,e[4]=h):h=e[4];let x;e[5]!==p?(x={color:p},e[5]=p,e[6]=x):x=e[6];let y;e[7]!==c||e[8]!==x?(y=o.jsx("div",{className:"text-[10px]",style:x,children:c}),e[7]=c,e[8]=x,e[9]=y):y=e[9];let u;e[10]!==n?(u={color:n},e[10]=n,e[11]=u):u=e[11];let S;e[12]!==t.title||e[13]!==s?(S=t.title??s("sectionsEditor.seoPreview.fallbackTitle"),e[12]=t.title,e[13]=s,e[14]=S):S=e[14];let g;e[15]!==u||e[16]!==S?(g=o.jsx("div",{className:"line-clamp-1 text-[13px] font-semibold",style:u,children:S}),e[15]=u,e[16]=S,e[17]=g):g=e[17];let b;e[18]!==m?(b={color:m},e[18]=m,e[19]=b):b=e[19];let j;e[20]!==t.description||e[21]!==s?(j=t.description??s("sectionsEditor.seoPreview.fallbackDescription"),e[20]=t.description,e[21]=s,e[22]=j):j=e[22];let k;e[23]!==b||e[24]!==j?(k=o.jsx("div",{className:"line-clamp-2 text-[12px]",style:b,children:j}),e[23]=b,e[24]=j,e[25]=k):k=e[25];let N;e[26]!==k||e[27]!==y||e[28]!==g?(N=o.jsxs("div",{className:"min-w-0 flex-1",children:[y,g,k]}),e[26]=k,e[27]=y,e[28]=g,e[29]=N):N=e[29];let w;e[30]!==t.image?(w=o.jsx(de,{src:t.image,className:"size-14 shrink-0 rounded",iconSize:16}),e[30]=t.image,e[31]=w):w=e[31];let _;e[32]!==N||e[33]!==w||e[34]!==h?(_=o.jsxs("div",{className:"flex gap-2.5 pl-2.5",style:h,children:[N,w]}),e[32]=N,e[33]=w,e[34]=h,e[35]=_):_=e[35];let P;return e[36]!==_||e[37]!==l?(P=o.jsx("div",{className:"rounded-lg p-2.5 text-left",style:l,children:_}),e[36]=_,e[37]=l,e[38]=P):P=e[38],P}function Be(d){const e=T.c(21),{platform:t,seo:c,host:v,path:r,t:s}=d;let i;e[0]!==v||e[1]!==r||e[2]!==t.color||e[3]!==t.id||e[4]!==t.layout||e[5]!==c||e[6]!==s?(i=t.layout==="search"?o.jsx(Ie,{seo:c,host:v,path:r,t:s}):t.layout==="card"?o.jsx(Le,{seo:c,host:v,path:r,t:s}):t.layout==="chat"?o.jsx(Oe,{seo:c,host:v,path:r,accent:t.color,t:s}):o.jsx(Ue,{seo:c,host:v,path:r,accent:t.color,dark:t.id==="discord",t:s}),e[0]=v,e[1]=r,e[2]=t.color,e[3]=t.id,e[4]=t.layout,e[5]=c,e[6]=s,e[7]=i):i=e[7];const n=i;let m;e[8]!==t.color?(m=o.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{background:t.color}}),e[8]=t.color,e[9]=m):m=e[9];let p;e[10]!==t.labelKey||e[11]!==s?(p=s(t.labelKey),e[10]=t.labelKey,e[11]=s,e[12]=p):p=e[12];let f;e[13]!==p?(f=o.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:p}),e[13]=p,e[14]=f):f=e[14];let l;e[15]!==m||e[16]!==f?(l=o.jsxs("div",{className:"mb-1.5 flex items-center gap-1.5",children:[m,f]}),e[15]=m,e[16]=f,e[17]=l):l=e[17];let a;return e[18]!==n||e[19]!==l?(a=o.jsxs("div",{children:[l,n]}),e[18]=n,e[19]=l,e[20]=a):a=e[20],a}function Ae(d){const e=T.c(18),{seo:t,url:c,path:v}=d,r=v===void 0?"/":v,s=ve();let i,n,m;if(e[0]!==t||e[1]!==c){const u=ze(t);i=u,n=he(u.image,c),m=he(u.favicon,c),e[0]=t,e[1]=c,e[2]=i,e[3]=n,e[4]=m}else i=e[2],n=e[3],m=e[4];let p;e[5]!==i||e[6]!==n||e[7]!==m?(p={...i,image:n,favicon:m},e[5]=i,e[6]=n,e[7]=m,e[8]=p):p=e[8];const f=p;let l;e[9]!==c?(l=De(c),e[9]=c,e[10]=l):l=e[10];const a=l,h=r==="/"?"":r;let x;e[11]!==h||e[12]!==a||e[13]!==s||e[14]!==f?(x=$e.map(u=>o.jsx(Be,{platform:u,seo:f,host:a,path:h,t:s},u.id)),e[11]=h,e[12]=a,e[13]=s,e[14]=f,e[15]=x):x=e[15];let y;return e[16]!==x?(y=o.jsx("div",{className:"grid grid-cols-1 gap-4 @2xl:grid-cols-2",children:x}),e[16]=x,e[17]=y):y=e[17],y}function Li(d){const e=T.c(70),{orgSlug:t,virtualMcpId:c,branch:v,decofile:r,meta:s,target:i,previewBaseUrl:n,onSaved:m,onEditDefaultSeo:p,onBack:f}=d,l=ve(),a=Ne(r,i,s),h=a?.seoData,x=i.kind==="site"?"site":i.pageKey,[y,u]=ee.useState(x),[S,g]=ee.useState(null),[b,j]=ee.useState(0),[k,N]=ee.useState(void 0);y!==x&&(u(x),g(null),N(void 0),j(Ve));const{persistSeo:w,persistRawSeo:_,flush:P,isPending:te}=Re({orgSlug:t,virtualMcpId:c,branch:v,target:i,resolved:a,onSaved:m}),M=i.kind==="page",ge=M?a?.rawSeoData:void 0,B=k!==void 0?k:ge,be=M?we(B)??void 0:void 0,E=S??be??h??{},F=a?Ce(E,a):null,K=F&&(!M||_e(B))?Ee(F,s):null;let V;e[0]!==s?(V=Pe(s),e[0]=s,e[1]=V):V=e[1];const oe=V;let R,G;e[2]!==r||e[3]!==E||e[4]!==s||e[5]!==i.kind?(R=i.kind==="page"?Te(r,s)?.seoData??{}:{},G=i.kind==="page"?He(R,E):E,e[2]=r,e[3]=E,e[4]=s,e[5]=i.kind,e[6]=R,e[7]=G):(R=e[6],G=e[7]);const ie=G;let H;e[8]!==w||e[9]!==a||e[10]!==g?(H=C=>{if(!a)return;const pe=C;g(pe),w(pe)},e[8]=w,e[9]=a,e[10]=g,e[11]=H):H=e[11];const se=H;let W;e[12]!==g?(W=()=>g(null),e[12]=g,e[13]=W):W=e[13];const le=W;let q;e[14]!==j?(q=()=>j(Me),e[14]=j,e[15]=q):q=e[15];const re=q;let J;e[16]!==P||e[17]!==f?(J=()=>{P(),f?.()},e[16]=P,e[17]=f,e[18]=J):J=e[18];const ae=J,z=i.kind==="page"?i.path:"/";let Q;e[19]!==z||e[20]!==n||e[21]!==i.kind?(Q=i.kind==="page"&&n?Ge(z,n):n??null,e[19]=z,e[20]=n,e[21]=i.kind,e[22]=Q):Q=e[22];const ce=Q;let X;e[23]!==a||e[24]!==l||e[25]!==i.kind?(X=i.kind==="site"?l("sectionsEditor.seoEditor.noSiteSeoBlock"):l(a?"sectionsEditor.seoEditor.noSeoSchema":"sectionsEditor.seoEditor.couldNotLoadSeo"),e[23]=a,e[24]=l,e[25]=i.kind,e[26]=X):X=e[26];const ne=X,Y=M&&a,me=i.kind==="site"&&a&&K;let D;e[27]!==ae||e[28]!==l||e[29]!==i.kind||e[30]!==i.pageName?(D=i.kind==="page"?o.jsxs("nav",{className:"flex min-w-0 items-center gap-1 text-sm",children:[o.jsx("button",{type:"button",onClick:ae,title:i.pageName,className:"min-w-0 truncate rounded-md px-1 py-0.5 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground",children:i.pageName}),o.jsx(ke,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("span",{className:"px-1 py-0.5 font-medium text-foreground",children:"SEO"})]}):o.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[o.jsx(fe,{size:16,className:"shrink-0 text-muted-foreground"}),o.jsx("span",{className:"text-sm font-medium",children:l("sectionsEditor.seoEditor.defaultSeoLabel")}),o.jsxs("span",{className:"hidden truncate text-xs text-muted-foreground sm:inline",children:["· ",l("sectionsEditor.seoEditor.appliedToEveryPage")]})]}),e[27]=ae,e[28]=l,e[29]=i.kind,e[30]=i.pageName,e[31]=D):D=e[31];let $;e[32]!==te?($=te&&o.jsx(Se,{size:14,className:"animate-spin text-muted-foreground"}),e[32]=te,e[33]=$):$=e[33];let I;e[34]!==p||e[35]!==l||e[36]!==i.kind?(I=i.kind==="page"&&p&&o.jsxs(je,{type:"button",variant:"outline",size:"sm",onClick:p,children:[o.jsx(fe,{size:14}),l("sectionsEditor.seoEditor.editDefaultSeoButton")]}),e[34]=p,e[35]=l,e[36]=i.kind,e[37]=I):I=e[37];let L;e[38]!==$||e[39]!==I?(L=o.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:[$,I]}),e[38]=$,e[39]=I,e[40]=L):L=e[40];let O;e[41]!==L||e[42]!==D?(O=o.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-2 border-b px-4",children:[D,L]}),e[41]=L,e[42]=D,e[43]=O):O=e[43];let U;e[44]!==F||e[45]!==re||e[46]!==le||e[47]!==oe||e[48]!==B||e[49]!==E||e[50]!==ne||e[51]!==b||e[52]!==se||e[53]!==z||e[54]!==_||e[55]!==w||e[56]!==ie||e[57]!==ce||e[58]!==a||e[59]!==K||e[60]!==g||e[61]!==N||e[62]!==Y||e[63]!==me||e[64]!==R||e[65]!==l?(U=!a||!Y&&!me?o.jsx("div",{className:"flex flex-1 items-center justify-center px-6 text-center text-sm text-muted-foreground",children:ne}):o.jsxs("div",{className:"flex min-h-0 flex-1",children:[o.jsx(xe,{className:"w-full max-w-md shrink-0 border-r [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"px-5 py-4",children:Y?o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"mb-3 text-xs text-muted-foreground",children:l("sectionsEditor.seoEditor.emptyFieldsHint")}),o.jsx(Ke,{rawSeo:B,innerSeo:E,defaultResolveType:oe,seoSchema:K,activeResolveType:F,seoTypeOptions:a.seoTypeOptions,formResetKey:b,siteDefaultSeo:R,onPersistRaw:C=>{N(C),_(C)},onInnerChange:C=>{g(C),w(C)},onClearForm:le,onBumpFormKey:re})]}):K&&F&&o.jsx(Fe,{schema:K,resolveType:F,value:E,formResetKey:b,onChange:se})})}),o.jsx(xe,{className:"min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"@container px-5 py-4",children:o.jsx(Ae,{seo:ie,url:ce,path:z})})})]}),e[44]=F,e[45]=re,e[46]=le,e[47]=oe,e[48]=B,e[49]=E,e[50]=ne,e[51]=b,e[52]=se,e[53]=z,e[54]=_,e[55]=w,e[56]=ie,e[57]=ce,e[58]=a,e[59]=K,e[60]=g,e[61]=N,e[62]=Y,e[63]=me,e[64]=R,e[65]=l,e[66]=U):U=e[66];let Z;return e[67]!==O||e[68]!==U?(Z=o.jsxs("div",{className:"flex h-full w-full flex-col",children:[O,U]}),e[67]=O,e[68]=U,e[69]=Z):Z=e[69],Z}function Me(d){return d+1}function Ve(d){return d+1}function Ge(d,e){try{return new URL(d,e).href}catch{return e}}function He(d,e){const t=e.__resolveType,c=d.__resolveType;if(typeof t=="string"&&typeof c=="string"&&t!==c)return{...e};const v={...d};for(const[r,s]of Object.entries(e))r!=="__resolveType"&&s!=null&&(typeof s=="string"&&s.trim()===""||(v[r]=s));return v}export{Li as SeoEditor};
@@ -1 +0,0 @@
1
- import{c as j,a5 as P,b as k,j as t,ae as D,af as J,ag as Q,c1 as U,c2 as V,C as X,f as Z,m as F,r as T,H as K,n as _,c3 as Y,U as z,W as C,X as w,_ as q,Z as O,L,q as N,a1 as ee,a2 as se,a7 as R,a as A,k as te,c4 as ne,O as le}from"./index-Ci8azyOE.js";import{n as ie,a as ae,b as oe,c as re}from"./ZapSquare-BZzRAQpm.js";import{t as ce,a as M}from"./Users03-BUoBV4mB.js";import{t as me}from"./ChevronDown-Csfjhwpm.js";import{i as de}from"./ChevronRight-DUmHQrD7.js";import{i as fe}from"./CreditCard01-YCHpZ00A.js";import{i as ge}from"./HardDrive-CWvDYc59.js";import{i as ue}from"./Key01-D4srNqPO.js";import{n as xe}from"./LinkExternal01-CIL2SNWf.js";import{i as I}from"./LogOut01-qWWgaWbQ.js";import{s as be}from"./User01-DJ_BO2EX.js";import{i as pe}from"./Zap-MbQ2aiA8.js";import{u as he}from"./use-join-requests-CBEK68HB.js";import{u as je}from"./use-status-sounds-kx6TUHpf.js";import{a as S}from"./toolbar-KH-9Bre4.js";import{S as ve,M as ye}from"./shell-controls-BMTxwot2.js";import"./question-004-sINsf4GQ.js";import"./use-decopilot-events-CqU7DunK.js";import"./decopilot-sse-pool-BN-M5EUb.js";import"./task-board-Cz-fiaKF.js";import"./backoff-CrEUbyZT.js";function G(){const e=j.c(8),s=k(),{capabilities:n,isPrivileged:l,loading:a,error:o}=U(),r=he().length,i=V();let f;return e[0]!==n||e[1]!==o||e[2]!==l||e[3]!==r||e[4]!==a||e[5]!==s||e[6]!==i?(f=[{key:"account",label:"",items:[{key:"profile",label:s("settings.nav.profile"),icon:t.jsx(be,{size:14}),to:"/$org/settings/profile"}]},{key:"organization",label:s("settings.nav.organization"),items:[{key:"general",label:s("settings.nav.general"),icon:t.jsx(ce,{size:14}),to:"/$org/settings/general",requires:"org:manage"},{key:"billing",label:s("settings.nav.billing"),icon:t.jsx(fe,{size:14}),to:"/$org/settings/ai-providers",group:"billing"},{key:"connect",label:s("settings.nav.connect"),icon:t.jsx(xe,{size:14}),to:"/$org/settings/connect",group:"connect"},{key:"tasks",label:s("settings.nav.tasks"),icon:t.jsx(ie,{size:14}),to:"/$org/settings/task-board",requires:"org:manage"}]},{key:"build",label:s("settings.nav.build"),items:[{key:"connections",label:s("settings.nav.connections"),icon:t.jsx(ae,{size:14}),to:"/$org/settings/connections"},{key:"agents",label:s("settings.nav.agents"),icon:t.jsx(M,{size:14}),to:"/$org/settings/agents"},{key:"automations",label:s("settings.nav.automations"),icon:t.jsx(pe,{size:14}),to:"/$org/settings/automations",requires:"automations:manage"}]},{key:"manage",label:s("settings.nav.manage"),items:[{key:"monitor",label:s("settings.nav.monitor"),icon:t.jsx(oe,{size:14}),to:"/$org/settings/monitor",requires:"monitoring:view"},{key:"members",label:s("settings.nav.members"),icon:t.jsx(M,{size:14}),to:"/$org/settings/members",group:"members",badge:r}]},{key:"advanced",label:s("settings.nav.advanced"),collapsible:!0,items:[{key:"secrets",label:s("settings.nav.secrets"),icon:t.jsx(ue,{size:14}),to:"/$org/settings/secrets",requires:"secrets:manage"},{key:"storage",label:s("settings.nav.storage"),icon:t.jsx(ge,{size:14}),to:"/$org/settings/buckets",group:"storage"},{key:"store",label:s("settings.nav.store"),icon:t.jsx(re,{size:14}),to:"/$org/settings/store",requires:"registry:manage"},{key:"sso",label:s("settings.nav.security"),icon:t.jsx(X,{size:14}),to:"/$org/settings/sso",requires:"org:manage"}]}].map(d=>({...d,items:d.items.flatMap(c=>{if(c.group){const[g]=i[c.group];return g?[{...c,to:g.to}]:[]}return a||o?[c]:c.privilegedOnly?l?[c]:[]:c.requires?l||n[c.requires]?[c]:[]:[c]})})).filter(Se),e[0]=n,e[1]=o,e[2]=l,e[3]=r,e[4]=a,e[5]=s,e[6]=i,e[7]=f):f=e[7],f}function Se(e){return e.items.length>0}function E(e){const s=j.c(5),{icon:n,badge:l}=e;let a;s[0]!==l?(a=l?t.jsx("span",{className:"absolute -right-1 -top-1 size-2 rounded-full bg-destructive pointer-events-none"}):null,s[0]=l,s[1]=a):a=s[1];let o;return s[2]!==n||s[3]!==a?(o=t.jsxs("span",{className:"relative shrink-0",children:[n,a]}),s[2]=n,s[3]=a,s[4]=o):o=s[4],o}function $(){const e=j.c(8);let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org"},e[0]=s):s=e[0];const{org:n}=Z(s);let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l={select:_e},e[1]=l):l=e[1];const a=F(l);let o;if(e[2]!==n||e[3]!==a){const f=m=>{const d=m.replace("$org",n);return a===d||a.startsWith(`${d}/`)};o=m=>(m.group?Y(m.group):[m.to]).some(f),e[2]=n,e[3]=a,e[4]=o}else o=e[4];const r=o;let i;return e[5]!==r||e[6]!==n?(i={org:n,isActive:r},e[5]=r,e[6]=n,e[7]=i):i=e[7],i}function _e(e){return e.location.pathname}function H(){const e=j.c(9),{isActive:s}=$();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={},e[0]=n):n=e[0];const[l,a]=T.useState(n);let o;e[1]!==s||e[2]!==l?(o=d=>l[d.key]??(!d.collapsible||d.items.some(s)),e[1]=s,e[2]=l,e[3]=o):o=e[3];const r=o;let i;e[4]!==r?(i=d=>a(c=>({...c,[d.key]:!r(d)})),e[4]=r,e[5]=i):i=e[5];const f=i;let m;return e[6]!==r||e[7]!==f?(m={isOpen:r,toggle:f},e[6]=r,e[7]=f,e[8]=m):m=e[8],m}function B(e){const s=j.c(21),{group:n,open:l,onToggle:a,className:o}=e;let r,i,f,m,d;if(s[0]!==o||s[1]!==n.collapsible||s[2]!==n.label||s[3]!==a||s[4]!==l){d=Symbol.for("react.early_return_sentinel");e:{const b=_("text-xs font-medium text-muted-foreground/60 truncate",o);if(!n.collapsible){d=t.jsx("p",{className:b,children:n.label});break e}r="button",i=a,f=l,m=_("flex w-full items-center gap-1 rounded-md hover:text-muted-foreground",b)}s[0]=o,s[1]=n.collapsible,s[2]=n.label,s[3]=a,s[4]=l,s[5]=r,s[6]=i,s[7]=f,s[8]=m,s[9]=d}else r=s[5],i=s[6],f=s[7],m=s[8],d=s[9];if(d!==Symbol.for("react.early_return_sentinel"))return d;let c;s[10]!==l?(c=l?t.jsx(me,{size:12}):t.jsx(de,{size:12}),s[10]=l,s[11]=c):c=s[11];let g;s[12]!==n.label?(g=t.jsx("span",{className:"truncate",children:n.label}),s[12]=n.label,s[13]=g):g=s[13];let u;return s[14]!==r||s[15]!==i||s[16]!==f||s[17]!==m||s[18]!==c||s[19]!==g?(u=t.jsxs("button",{type:r,onClick:i,"aria-expanded":f,className:m,children:[c,g]}),s[14]=r,s[15]=i,s[16]=f,s[17]=m,s[18]=c,s[19]=g,s[20]=u):u=s[20],u}function ke(){const e=j.c(23),s=k(),n=G(),{org:l,isActive:a}=$(),{isOpen:o,toggle:r}=H();let i;if(e[0]!==n||e[1]!==a||e[2]!==o||e[3]!==l||e[4]!==r){let h;e[6]!==a||e[7]!==o||e[8]!==l||e[9]!==r?(h=(p,v)=>t.jsxs(z,{className:"pt-0 pr-0 pb-0 pl-0",children:[p.label&&t.jsx(B,{group:p,open:o(p),onToggle:()=>r(p),className:_("px-2 pt-1.5 pb-0.5",v>0&&"mt-3")}),o(p)&&t.jsx(C,{children:t.jsx(w,{className:"gap-0.5",children:p.items.map(x=>t.jsx(q,{children:t.jsx(O,{asChild:!0,isActive:a(x),children:t.jsxs(L,{to:x.to,params:{org:l},onClick:()=>N("settings_nav_clicked",{section_key:x.key,group_key:p.key}),className:"flex items-center gap-2.5 text-sm",children:[t.jsx(E,{icon:x.icon,badge:x.badge}),t.jsx("span",{className:"truncate",children:x.label})]})})},x.key))})})]},p.key),e[6]=a,e[7]=o,e[8]=l,e[9]=r,e[10]=h):h=e[10],i=n.map(h),e[0]=n,e[1]=a,e[2]=o,e[3]=l,e[4]=r,e[5]=i}else i=e[5];let f;e[11]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx("div",{className:"mx-2 my-2 border-t border-border/50"}),e[11]=f):f=e[11];let m;e[12]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("span",{className:"shrink-0",children:t.jsx(I,{size:14})}),e[12]=m):m=e[12];let d;e[13]!==s?(d=s("settings.nav.signOut"),e[13]=s,e[14]=d):d=e[14];let c;e[15]!==d?(c=t.jsxs(z,{className:"mt-auto pt-0 pr-0 pb-0 pl-0",children:[f,t.jsx(C,{children:t.jsx(w,{className:"gap-0.5",children:t.jsx(q,{children:t.jsxs(O,{onClick:Ne,className:"flex items-center gap-2.5 text-sm",children:[m,t.jsx("span",{className:"truncate",children:d})]})})})})]}),e[15]=d,e[16]=c):c=e[16];let g;e[17]!==i||e[18]!==c?(g=t.jsxs(ee,{className:"flex flex-col flex-1 mt-2 px-2 pb-2 gap-0 overflow-y-auto",children:[i,c]}),e[17]=i,e[18]=c,e[19]=g):g=e[19];let u;e[20]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("div",{className:"mt-auto px-4 pb-1",children:t.jsxs("span",{className:"text-xs text-muted-foreground/50",children:["v","4.308.0"]})}),e[20]=u):u=e[20];let b;return e[21]!==g?(b=t.jsxs(se,{variant:"sidebar",children:[g,u]}),e[21]=g,e[22]=b):b=e[22],b}function Ne(){N("signed_out",{source:"settings_sidebar"}),R(),A.signOut()}function $e(e){const s=j.c(25),{onClose:n}=e,l=k(),a=G(),{org:o,isActive:r}=$(),{isOpen:i,toggle:f}=H();let m;if(s[0]!==a||s[1]!==r||s[2]!==i||s[3]!==n||s[4]!==o||s[5]!==f){let v;s[7]!==r||s[8]!==i||s[9]!==n||s[10]!==o||s[11]!==f?(v=(x,W)=>t.jsxs("div",{className:"flex flex-col gap-0.5",children:[x.label&&t.jsx(B,{group:x,open:i(x),onToggle:()=>f(x),className:_("px-3 pt-1.5 pb-0.5",W>0&&"mt-3")}),i(x)&&x.items.map(y=>t.jsxs(L,{to:y.to,params:{org:o},onClick:n,className:_("flex items-center gap-3 w-full px-3 py-2.5 rounded-lg transition-colors text-sm",r(y)?"bg-sidebar-accent text-sidebar-accent-foreground font-medium":"text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground"),children:[t.jsx(E,{icon:y.icon,badge:y.badge}),t.jsx("span",{className:"truncate",children:y.label})]},y.key))]},x.key),s[7]=r,s[8]=i,s[9]=n,s[10]=o,s[11]=f,s[12]=v):v=s[12],m=a.map(v),s[0]=a,s[1]=r,s[2]=i,s[3]=n,s[4]=o,s[5]=f,s[6]=m}else m=s[6];let d;s[13]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("div",{className:"h-px bg-border/50 my-2"}),s[13]=d):d=s[13];let c;s[14]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("span",{className:"shrink-0",children:t.jsx(I,{size:14})}),s[14]=c):c=s[14];let g;s[15]!==l?(g=l("settings.nav.signOut"),s[15]=l,s[16]=g):g=s[16];let u;s[17]!==g?(u=t.jsxs("div",{className:"mt-auto flex flex-col gap-0.5",children:[d,t.jsxs("button",{type:"button",onClick:ze,className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-lg transition-colors text-sm text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground",children:[c,t.jsx("span",{className:"truncate",children:g})]})]}),s[17]=g,s[18]=u):u=s[18];let b;s[19]!==m||s[20]!==u?(b=t.jsxs("div",{className:"flex flex-col flex-1 overflow-y-auto px-2 py-2 gap-0.5",children:[m,u]}),s[19]=m,s[20]=u,s[21]=b):b=s[21];let h;s[22]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("div",{className:"px-4 pb-3 pt-1 border-t border-border/50",children:t.jsxs("span",{className:"text-xs text-muted-foreground/50",children:["v","4.308.0"]})}),s[22]=h):h=s[22];let p;return s[23]!==b?(p=t.jsxs("div",{className:"flex flex-col h-full bg-sidebar",children:[b,h]}),s[23]=b,s[24]=p):p=s[24],p}function ze(){N("signed_out",{source:"settings_sidebar"}),R(),A.signOut()}function Ce(){const e=j.c(4),s=P(),{org:n}=K();je(n.slug);let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(te,{size:20,className:"animate-spin text-muted-foreground"})}),e[0]=l):l=e[0];let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(T.Suspense,{fallback:l,children:t.jsx("div",{className:"flex flex-1 items-center overflow-hidden rounded-[inherit]",children:t.jsx(ne,{value:"p-0",children:t.jsx("div",{className:"flex-1 min-w-0 overflow-hidden h-full",children:t.jsx(le,{})})})})}),e[1]=a):a=e[1];const o=a;if(s){let i;return e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("div",{className:"flex flex-col flex-1 bg-background min-h-0 overflow-hidden",children:o}),e[2]=i):i=e[2],i}let r;return e[3]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"flex-1 min-h-0 p-1",children:t.jsx("div",{className:_("flex flex-col h-full min-h-0 bg-background overflow-hidden","card-shadow","rounded-[0.75rem]"),children:o})}),e[3]=r):r=e[3],r}function Fe(){const e=j.c(21),s=P();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(S.LogoLink,{}),e[0]=n):n=e[0];let l;e[1]!==s?(l=s&&t.jsx(ve,{}),e[1]=s,e[2]=l):l=e[2];let a;e[3]!==l?(a=t.jsxs(S.LeftColumn,{children:[n,l]}),e[3]=l,e[4]=a):a=e[4];let o;e[5]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(S.CenterSlot,{}),e[5]=o):o=e[5];let r;e[6]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(S.RightColumn,{children:t.jsx("span",{})}),e[6]=r):r=e[6];let i;e[7]!==a?(i=t.jsxs(S.Header,{children:[a,o,r]}),e[7]=a,e[8]=i):i=e[8];let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f={"--sidebar-width-icon":"3.125rem"},e[9]=f):f=e[9];let m;e[10]!==s?(m=!s&&t.jsx(ke,{}),e[10]=s,e[11]=m):m=e[11];let d;e[12]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(D,{className:"flex flex-col",style:{background:"transparent",containerType:"inline-size"},children:t.jsx(Ce,{})}),e[12]=d):d=e[12];let c;e[13]!==m?(c=t.jsxs(J,{className:"flex-1 bg-sidebar min-h-0",style:f,children:[m,d]}),e[13]=m,e[14]=c):c=e[14];let g;e[15]!==s?(g=s&&t.jsx(ye,{renderSidebar:we}),e[15]=s,e[16]=g):g=e[16];let u;return e[17]!==g||e[18]!==i||e[19]!==c?(u=t.jsx(S.Provider,{children:t.jsx(Q,{defaultOpen:!0,children:t.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[i,c,g]})})}),e[17]=g,e[18]=i,e[19]=c,e[20]=u):u=e[20],u}function we(e){const{onClose:s}=e;return t.jsx($e,{onClose:s})}export{ke as SettingsSidebar,$e as SettingsSidebarMobile,Fe as default};
@@ -1 +0,0 @@
1
- import{c as D,b as H,e as te,j as n,B as $,t as ee,cT as Z,C as je,a as X,y as Me,z as ke,K as le,cU as ze,cV as Fe,I as Y,n as de,r as B,o as ae,bb as ge,x as qe,cW as Be,q as he,cX as He,cY as Ue,cZ as Je,c_ as Ke,d as Ge,H as Ve,u as We,a4 as Qe,cd as Ye,c$ as Xe,d0 as pe,d1 as Ze,m as et,d2 as tt,S as nt,O as st,d3 as ot}from"./index-Ci8azyOE.js";import{A as ce}from"./avatar-D-QkiqIH.js";import{t as Ne,a as it}from"./Users03-BUoBV4mB.js";import{i as at}from"./SearchLg-8daQliv2.js";import{i as rt,s as lt,a as U,b as ct,n as dt}from"./Stars02-DZNA1z2-.js";import{s as ut}from"./XClose-CTv0nnSb.js";import{D as mt,e as ft,c as gt,f as ht,b as pt,g as bt,d as yt,A as xt}from"./use-panel-navigate-BsVeEWlx.js";import{i as J}from"./CheckCircle-teyxVGFp.js";import{i as be}from"./FilterLines-Db8-uWfr.js";import{i as ye}from"./Monitor01-uq-dlf-u.js";import{i as K}from"./Zap-MbQ2aiA8.js";import{a as Ae,b as _e,d as Te,e as Oe,h as wt,c as St}from"./dialog-BI8UUwqv.js";import{u as vt}from"./use-is-desktop-app-BNujXJc_.js";import{R as jt}from"./required-auth-layout-CUQaC9Hr.js";import{m as kt}from"./use-mcp-client-DP2onozC.js";import{a as Nt,S as At}from"./constants-dLUUoWH7.js";import{u as _t}from"./hooks-DQmp7LHz.js";import{h as Tt}from"./use-organization-settings-BAFLKQ3y.js";import{u as Ot}from"./use-org-sso-C-uWWD5m.js";function Ct(t){const e=D.c(49),{orgName:s,orgSlug:o,orgLogo:l,domain:r}=t,i=H();let a;e[0]!==o||e[1]!==i?(a=async()=>{const _=await fetch("/api/auth/custom/domain-join",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationSlug:o})}),O=await _.json();if(!_.ok||!O.success)throw new Error(O.error??i("common.autoDomainJoinScreen.joinError"));return O},e[0]=o,e[1]=i,e[2]=a):a=e[2];let d;e[3]!==o?(d=_=>{window.location.href=`/${_.slug??o}`},e[3]=o,e[4]=d):d=e[4];let u;e[5]!==i?(u=_=>{ee.error(_ instanceof Error?_.message:i("common.autoDomainJoinScreen.joinError"))},e[5]=i,e[6]=u):u=e[6];let x;e[7]!==a||e[8]!==d||e[9]!==u?(x={mutationFn:a,onSuccess:d,onError:u},e[7]=a,e[8]=d,e[9]=u,e[10]=x):x=e[10];const c=te(x),v=It;let g;e[11]!==l||e[12]!==s?(g=l?n.jsx(ce,{url:l,fallback:s.charAt(0).toUpperCase(),shape:"square",size:"base",className:"h-12 w-12"}):n.jsx("div",{className:"bg-primary/10 p-3 rounded-full",children:n.jsx(Ne,{className:"h-6 w-6 text-primary"})}),e[11]=l,e[12]=s,e[13]=g):g=e[13];let w;e[14]!==s||e[15]!==i?(w=i("common.autoDomainJoinScreen.joinPrompt",{orgName:s}),e[14]=s,e[15]=i,e[16]=w):w=e[16];let f;e[17]!==w?(f=n.jsx("h3",{className:"text-lg font-medium",children:w}),e[17]=w,e[18]=f):f=e[18];let m;e[19]!==r||e[20]!==i?(m=i("common.autoDomainJoinScreen.joinDescription",{domain:r}),e[19]=r,e[20]=i,e[21]=m):m=e[21];let b;e[22]!==m?(b=n.jsx("p",{className:"text-sm text-muted-foreground",children:m}),e[22]=m,e[23]=b):b=e[23];let h;e[24]!==f||e[25]!==b?(h=n.jsxs("div",{className:"space-y-2",children:[f,b]}),e[24]=f,e[25]=b,e[26]=h):h=e[26];let p;e[27]!==c?(p=()=>c.mutate(),e[27]=c,e[28]=p):p=e[28];let S;e[29]!==c.isPending||e[30]!==s||e[31]!==i?(S=c.isPending?i("common.autoDomainJoinScreen.joining"):i("common.autoDomainJoinScreen.enterOrg",{orgName:s}),e[29]=c.isPending,e[30]=s,e[31]=i,e[32]=S):S=e[32];let k;e[33]!==c.isPending||e[34]!==p||e[35]!==S?(k=n.jsx($,{onClick:p,disabled:c.isPending,children:S}),e[33]=c.isPending,e[34]=p,e[35]=S,e[36]=k):k=e[36];const j=c.isPending;let y;e[37]!==i?(y=i("common.autoDomainJoinScreen.goHome"),e[37]=i,e[38]=y):y=e[38];let N;e[39]!==c.isPending||e[40]!==y?(N=n.jsx($,{variant:"ghost",onClick:v,disabled:j,children:y}),e[39]=c.isPending,e[40]=y,e[41]=N):N=e[41];let T;e[42]!==k||e[43]!==N?(T=n.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[k,N]}),e[42]=k,e[43]=N,e[44]=T):T=e[44];let A;return e[45]!==h||e[46]!==T||e[47]!==g?(A=n.jsxs(Z,{children:[g,h,T]}),e[45]=h,e[46]=T,e[47]=g,e[48]=A):A=e[48],A}function It(){window.location.href="/"}function xe(t){const e=D.c(25),{orgSlug:s,orgName:o,reason:l}=t,r=H(),i=Et,a=l==="not-found",d=a?at:je;let u;e[0]!==a||e[1]!==r?(u=r(a?"common.noAccessScreen.organizationNotFound":"common.noAccessScreen.noAccess"),e[0]=a,e[1]=r,e[2]=u):u=e[2];const x=u;let c;e[3]!==a||e[4]!==o||e[5]!==s||e[6]!==r?(c=a?n.jsxs(n.Fragment,{children:[r("common.noAccessScreen.couldNotFind")," ",n.jsx("strong",{children:s}),"."]}):n.jsxs(n.Fragment,{children:[r("common.noAccessScreen.noAccessTo")," ",n.jsx("strong",{children:o??s}),".",n.jsx("br",{}),r("common.noAccessScreen.askAdminToInvite")]}),e[3]=a,e[4]=o,e[5]=s,e[6]=r,e[7]=c):c=e[7];const v=c;let g;e[8]!==d?(g=n.jsx("div",{className:"bg-muted p-3 rounded-full",children:n.jsx(d,{className:"h-6 w-6 text-muted-foreground"})}),e[8]=d,e[9]=g):g=e[9];let w;e[10]!==x?(w=n.jsx("h3",{className:"text-lg font-medium",children:x}),e[10]=x,e[11]=w):w=e[11];let f;e[12]!==v?(f=n.jsx("p",{className:"text-sm text-muted-foreground",children:v}),e[12]=v,e[13]=f):f=e[13];let m;e[14]!==w||e[15]!==f?(m=n.jsxs("div",{className:"space-y-2",children:[w,f]}),e[14]=w,e[15]=f,e[16]=m):m=e[16];let b;e[17]!==r?(b=r("common.noAccessScreen.goToHome"),e[17]=r,e[18]=b):b=e[18];let h;e[19]!==b?(h=n.jsx($,{onClick:i,children:b}),e[19]=b,e[20]=h):h=e[20];let p;return e[21]!==g||e[22]!==m||e[23]!==h?(p=n.jsxs(Z,{children:[g,m,h]}),e[21]=g,e[22]=m,e[23]=h,e[24]=p):p=e[24],p}function Et(){window.location.href="/"}function Lt(t){const e=D.c(59),{invitationId:s,orgName:o,orgSlug:l,orgLogo:r}=t,i=H();let a;e[0]!==s?(a=async()=>{const E=await X.organization.acceptInvitation({invitationId:s});if(E.error)throw new Error(E.error.message);return E.data},e[0]=s,e[1]=a):a=e[1];let d;e[2]!==l?(d=()=>{Me(),window.location.href=`/${l}`},e[2]=l,e[3]=d):d=e[3];let u;e[4]!==i?(u=E=>{ee.error(E instanceof Error?E.message:i("common.pendingInviteScreen.failedToAccept"))},e[4]=i,e[5]=u):u=e[5];let x;e[6]!==a||e[7]!==d||e[8]!==u?(x={mutationFn:a,onSuccess:d,onError:u},e[6]=a,e[7]=d,e[8]=u,e[9]=x):x=e[9];const c=te(x);let v;e[10]!==s?(v=async()=>{const E=await X.organization.rejectInvitation({invitationId:s});if(E.error)throw new Error(E.error.message);return E.data},e[10]=s,e[11]=v):v=e[11];let g,w;e[12]!==i?(g=()=>{ee.success(i("common.pendingInviteScreen.invitationDeclined")),window.location.href="/"},w=E=>{ee.error(E instanceof Error?E.message:i("common.pendingInviteScreen.failedToDecline"))},e[12]=i,e[13]=g,e[14]=w):(g=e[13],w=e[14]);let f;e[15]!==v||e[16]!==g||e[17]!==w?(f={mutationFn:v,onSuccess:g,onError:w},e[15]=v,e[16]=g,e[17]=w,e[18]=f):f=e[18];const m=te(f),b=c.isPending||m.isPending;let h;e[19]!==r||e[20]!==o?(h=r?n.jsx(ce,{url:r,fallback:o.charAt(0).toUpperCase(),shape:"square",size:"base",className:"h-12 w-12"}):n.jsx("div",{className:"bg-primary/10 p-3 rounded-full",children:n.jsx(rt,{className:"h-6 w-6 text-primary"})}),e[19]=r,e[20]=o,e[21]=h):h=e[21];let p;e[22]!==o||e[23]!==i?(p=i("common.pendingInviteScreen.invitedTo",{orgName:o}),e[22]=o,e[23]=i,e[24]=p):p=e[24];let S;e[25]!==p?(S=n.jsx("h3",{className:"text-lg font-medium",children:p}),e[25]=p,e[26]=S):S=e[26];let k;e[27]!==i?(k=i("common.pendingInviteScreen.acceptDescription"),e[27]=i,e[28]=k):k=e[28];let j;e[29]!==k?(j=n.jsx("p",{className:"text-sm text-muted-foreground",children:k}),e[29]=k,e[30]=j):j=e[30];let y;e[31]!==S||e[32]!==j?(y=n.jsxs("div",{className:"space-y-2",children:[S,j]}),e[31]=S,e[32]=j,e[33]=y):y=e[33];let N;e[34]!==c?(N=()=>c.mutate(),e[34]=c,e[35]=N):N=e[35];let T;e[36]!==c.isPending||e[37]!==i?(T=c.isPending?i("common.pendingInviteScreen.acceptingButton"):i("common.pendingInviteScreen.acceptButton"),e[36]=c.isPending,e[37]=i,e[38]=T):T=e[38];let A;e[39]!==b||e[40]!==N||e[41]!==T?(A=n.jsx($,{onClick:N,disabled:b,children:T}),e[39]=b,e[40]=N,e[41]=T,e[42]=A):A=e[42];let _;e[43]!==m?(_=()=>m.mutate(),e[43]=m,e[44]=_):_=e[44];let O;e[45]!==m.isPending||e[46]!==i?(O=m.isPending?i("common.pendingInviteScreen.decliningButton"):i("common.pendingInviteScreen.declineButton"),e[45]=m.isPending,e[46]=i,e[47]=O):O=e[47];let C;e[48]!==b||e[49]!==_||e[50]!==O?(C=n.jsx($,{variant:"ghost",onClick:_,disabled:b,children:O}),e[48]=b,e[49]=_,e[50]=O,e[51]=C):C=e[51];let I;e[52]!==A||e[53]!==C?(I=n.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[A,C]}),e[52]=A,e[53]=C,e[54]=I):I=e[54];let L;return e[55]!==y||e[56]!==I||e[57]!==h?(L=n.jsxs(Z,{children:[h,y,I]}),e[55]=y,e[56]=I,e[57]=h,e[58]=L):L=e[58],L}function Pt(t){const e=D.c(23),{orgName:s,orgLogo:o}=t,l=H();let r;e[0]!==o||e[1]!==s?(r=o?n.jsx(ce,{url:o,fallback:s.charAt(0).toUpperCase(),shape:"square",size:"base",className:"h-12 w-12"}):n.jsx("div",{className:"bg-primary/10 p-3 rounded-full",children:n.jsx(lt,{className:"h-6 w-6 text-primary"})}),e[0]=o,e[1]=s,e[2]=r):r=e[2];let i;e[3]!==l?(i=l("common.requestPendingScreen.title"),e[3]=l,e[4]=i):i=e[4];let a;e[5]!==i?(a=n.jsx("h3",{className:"text-lg font-medium",children:i}),e[5]=i,e[6]=a):a=e[6];let d;e[7]!==s||e[8]!==l?(d=l("common.requestPendingScreen.description",{orgName:s}),e[7]=s,e[8]=l,e[9]=d):d=e[9];let u;e[10]!==d?(u=n.jsx("p",{className:"text-sm text-muted-foreground",children:d}),e[10]=d,e[11]=u):u=e[11];let x;e[12]!==a||e[13]!==u?(x=n.jsxs("div",{className:"space-y-2",children:[a,u]}),e[12]=a,e[13]=u,e[14]=x):x=e[14];let c;e[15]!==l?(c=l("common.requestPendingScreen.goHome"),e[15]=l,e[16]=c):c=e[16];let v;e[17]!==c?(v=n.jsx($,{variant:"ghost",onClick:Dt,children:c}),e[17]=c,e[18]=v):v=e[18];let g;return e[19]!==r||e[20]!==x||e[21]!==v?(g=n.jsxs(Z,{children:[r,x,v]}),e[19]=r,e[20]=x,e[21]=v,e[22]=g):g=e[22],g}function Dt(){window.location.href="/"}function $t(t){const e=D.c(45),{orgName:s,orgSlug:o,orgLogo:l,domain:r}=t,i=H();let a;e[0]!==o?(a=async()=>{const A=await fetch("/api/auth/custom/domain-request-join",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationSlug:o})}),_=await A.json();if(!A.ok||!_.success)throw new Error(_.error??"Failed to request access");return _},e[0]=o,e[1]=a):a=e[1];let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=Mt,e[2]=d):d=e[2];let u;e[3]!==i?(u=A=>{ee.error(A instanceof Error?A.message:i("common.requestToJoinScreen.failedToRequest"))},e[3]=i,e[4]=u):u=e[4];let x;e[5]!==a||e[6]!==u?(x={mutationFn:a,onSuccess:d,onError:u},e[5]=a,e[6]=u,e[7]=x):x=e[7];const c=te(x);let v;e[8]!==l||e[9]!==s?(v=l?n.jsx(ce,{url:l,fallback:s.charAt(0).toUpperCase(),shape:"square",size:"base",className:"h-12 w-12"}):n.jsx("div",{className:"bg-primary/10 p-3 rounded-full",children:n.jsx(Ne,{className:"h-6 w-6 text-primary"})}),e[8]=l,e[9]=s,e[10]=v):v=e[10];let g;e[11]!==s||e[12]!==i?(g=i("common.requestToJoinScreen.title",{orgName:s}),e[11]=s,e[12]=i,e[13]=g):g=e[13];let w;e[14]!==g?(w=n.jsx("h3",{className:"text-lg font-medium",children:g}),e[14]=g,e[15]=w):w=e[15];let f;e[16]!==r||e[17]!==i?(f=i("common.requestToJoinScreen.description",{domain:r}),e[16]=r,e[17]=i,e[18]=f):f=e[18];let m;e[19]!==f?(m=n.jsx("p",{className:"text-sm text-muted-foreground",children:f}),e[19]=f,e[20]=m):m=e[20];let b;e[21]!==w||e[22]!==m?(b=n.jsxs("div",{className:"space-y-2",children:[w,m]}),e[21]=w,e[22]=m,e[23]=b):b=e[23];let h;e[24]!==c?(h=()=>c.mutate(),e[24]=c,e[25]=h):h=e[25];let p;e[26]!==c.isPending||e[27]!==i?(p=c.isPending?i("common.requestToJoinScreen.requesting"):i("common.requestToJoinScreen.requestButton"),e[26]=c.isPending,e[27]=i,e[28]=p):p=e[28];let S;e[29]!==c.isPending||e[30]!==h||e[31]!==p?(S=n.jsx($,{onClick:h,disabled:c.isPending,children:p}),e[29]=c.isPending,e[30]=h,e[31]=p,e[32]=S):S=e[32];const k=c.isPending;let j;e[33]!==i?(j=i("common.requestToJoinScreen.goToHome"),e[33]=i,e[34]=j):j=e[34];let y;e[35]!==c.isPending||e[36]!==j?(y=n.jsx($,{variant:"ghost",onClick:Rt,disabled:k,children:j}),e[35]=c.isPending,e[36]=j,e[37]=y):y=e[37];let N;e[38]!==S||e[39]!==y?(N=n.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[S,y]}),e[38]=S,e[39]=y,e[40]=N):N=e[40];let T;return e[41]!==b||e[42]!==N||e[43]!==v?(T=n.jsxs(Z,{children:[v,b,N]}),e[41]=b,e[42]=N,e[43]=v,e[44]=T):T=e[44],T}function Rt(){window.location.href="/"}function Mt(t){if(t.alreadyMember&&t.slug){window.location.href=`/${t.slug}`;return}window.location.reload()}function zt(t){const e=D.c(7);let s;e[0]!==t?(s=le.orgAccessStatus(t),e[0]=t,e[1]=s):s=e[1];let o;e[2]!==t?(o=async()=>{const r=await fetch(`/api/auth/custom/org-access-status/${encodeURIComponent(t)}`,{credentials:"include"});if(!r.ok)throw new Error(`org-access-status failed (${r.status})`);return await r.json()},e[2]=t,e[3]=o):o=e[3];let l;return e[4]!==s||e[5]!==o?(l={queryKey:s,queryFn:o,refetchOnWindowFocus:!1},e[4]=s,e[5]=o,e[6]=l):l=e[6],ke(l)}function Ft({orgSlug:t}){const{data:e}=zt(t);if(e.status!=="member"){ze()?.org===t&&Fe();const s=localStorage.getItem(Y.lastOrgSlug())===t;if(s&&localStorage.removeItem(Y.lastOrgSlug()),s&&(e.status==="not-found"||e.status==="no-access"))return window.location.href="/",null}return e.status==="not-found"?n.jsx(xe,{orgSlug:t,reason:"not-found"}):e.status==="pending-invite"?n.jsx(Lt,{invitationId:e.invitation.id,orgName:e.organization.name,orgSlug:e.organization.slug,orgLogo:e.organization.logo}):e.status==="auto-domain-join"?n.jsx(Ct,{orgName:e.organization.name,orgSlug:e.organization.slug,orgLogo:e.organization.logo,domain:e.organization.domain??""}):e.status==="can-request"?n.jsx($t,{orgName:e.organization.name,orgSlug:e.organization.slug,orgLogo:e.organization.logo,domain:e.organization.domain??""}):e.status==="request-pending"?n.jsx(Pt,{orgName:e.organization.name,orgLogo:e.organization.logo}):e.status==="member"?(window.location.reload(),null):n.jsx(xe,{orgSlug:t,orgName:e.organization.name,reason:"no-access"})}function Ce(t){const e=D.c(42),{ariaLabel:s,dismissLabel:o,eyebrow:l,title:r,description:i,icon:a,children:d,footerLeading:u,actions:x,onDismiss:c,tone:v}=t,g=v===void 0?"neutral":v,w=u||x;let f;e[0]!==g?(f=g==="system"&&n.jsx("div",{className:"h-0.5 bg-special"}),e[0]=g,e[1]=f):f=e[1];let m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(ut,{size:14}),e[2]=m):m=e[2];let b;e[3]!==o||e[4]!==c?(b=n.jsx($,{size:"icon-sm",variant:"ghost","aria-label":o,className:"absolute right-2 top-2 z-10 text-muted-foreground",onClick:c,children:m}),e[3]=o,e[4]=c,e[5]=b):b=e[5];const h=a&&"flex items-start gap-3",p=d&&"pb-3";let S;e[6]!==h||e[7]!==p?(S=de("p-4 pr-11",h,p),e[6]=h,e[7]=p,e[8]=S):S=e[8];let k;e[9]!==a?(k=a&&n.jsx("div",{className:"flex size-8 shrink-0 items-center justify-center rounded-lg bg-special/10 text-special",children:a}),e[9]=a,e[10]=k):k=e[10];let j;e[11]!==l?(j=l&&n.jsx("p",{className:"text-xs text-muted-foreground",children:l}),e[11]=l,e[12]=j):j=e[12];let y;e[13]!==r?(y=n.jsx("h3",{className:"text-base font-semibold text-foreground",children:r}),e[13]=r,e[14]=y):y=e[14];let N;e[15]!==i?(N=i&&n.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:i}),e[15]=i,e[16]=N):N=e[16];let T;e[17]!==y||e[18]!==N||e[19]!==j?(T=n.jsxs("div",{children:[j,y,N]}),e[17]=y,e[18]=N,e[19]=j,e[20]=T):T=e[20];let A;e[21]!==d?(A=d&&n.jsx("div",{className:"mt-3",children:d}),e[21]=d,e[22]=A):A=e[22];let _;e[23]!==T||e[24]!==A?(_=n.jsxs("div",{className:"min-w-0 flex-1",children:[T,A]}),e[23]=T,e[24]=A,e[25]=_):_=e[25];let O;e[26]!==_||e[27]!==S||e[28]!==k?(O=n.jsxs("div",{className:S,children:[k,_]}),e[26]=_,e[27]=S,e[28]=k,e[29]=O):O=e[29];let C;e[30]!==x||e[31]!==u||e[32]!==w||e[33]!==g?(C=w&&n.jsxs("div",{className:de("flex items-center justify-between gap-3 px-4 py-2.5",g==="system"?"border-t border-border bg-muted/50":"pt-0"),children:[n.jsx("div",{className:"min-w-0 text-xs text-muted-foreground",children:u}),n.jsx("div",{className:"flex shrink-0 items-center gap-2",children:x})]}),e[30]=x,e[31]=u,e[32]=w,e[33]=g,e[34]=C):C=e[34];let I;return e[35]!==s||e[36]!==O||e[37]!==C||e[38]!==f||e[39]!==b||e[40]!==g?(I=n.jsxs("div",{role:"dialog","aria-label":s,"data-slot":"announcement-card","data-tone":g,className:"relative w-full overflow-hidden rounded-lg border border-border bg-background shadow-lg animate-in fade-in slide-in-from-bottom-2 duration-300",children:[f,b,O,C]}),e[35]=s,e[36]=O,e[37]=C,e[38]=f,e[39]=b,e[40]=g,e[41]=I):I=e[41],I}const qt=[{id:"native-app-linux-beta",date:"2026-08-20",eyebrow:"Now Available",title:"Studio for Linux is now in beta",bullets:[{icon:ye,title:"Native Linux desktop app",body:"Studio now ships as an AppImage for 64-bit x86 Linux, bringing the local desktop workflow to Linux."},{icon:J,title:"Verified, no-root install",body:"The installer verifies the download, installs Studio to ~/.local/bin, and adds it to your application launcher without sudo."},{icon:K,title:"Beta today, broader support next",body:"We're validating more distributions and desktop environments. Arm builds are not available yet, and your feedback will shape general availability."}],cta:{label:"Install Studio",action:"download-app"},learnMoreHref:"https://github.com/decocms/studio/releases/tag/native-v4.242.0"},{id:"native-app-macos",date:"2026-07-30",eyebrow:"Now Available",title:"New beta studio app",bullets:[{icon:K,title:"Faster CMS previews",body:"Every draft gets its own git worktree on your machine, so previews render instantly as you edit."},{icon:U,title:"Native Claude Code & Codex support",body:"State-of-the-art coding agents, running natively against your local files."},{icon:ct,title:"Boosted performance",body:"Entirely rewritten in Rust with a smaller memory footprint than the Bun-based runtime — fast even on modest machines."},{icon:ye,title:"Apple Silicon only — Windows coming soon",body:"Today's builds target macOS on Apple Silicon; Windows is next."}],cta:{label:"Install on Mac",action:"download-app"},learnMoreHref:"https://github.com/decocms/studio/releases"},{id:"codex-gpt-5-6-defaults",date:"2026-07-13",eyebrow:"Now Available",title:"Codex defaults move to GPT-5.6",bullets:[{icon:U,title:"Sol leads Thinking",body:"Codex Thinking now defaults to `gpt-5.6-sol` for deeper coding and reasoning work."},{icon:J,title:"Terra balances Smart",body:"The Smart tier now uses `gpt-5.6-terra`, replacing GPT-5.4 as the default balanced Codex model."},{icon:K,title:"Luna speeds up Fast",body:"The Fast tier and lightweight Codex title generation now use `gpt-5.6-luna`. Existing threads that reference older GPT-5.4 or GPT-5.5 model IDs remain supported."}]},{id:"claude-sonnet-5",date:"2026-06-30",eyebrow:"Now Available",title:"Claude Sonnet 5 powers the Smart tier",bullets:[{icon:U,title:"More agentic coding",body:"Sonnet 5 is Anthropic's strongest Sonnet model yet, with improved reasoning, tool use, coding, and knowledge work compared with Sonnet 4.6."},{icon:J,title:"Available in Claude Code",body:"The Claude Code harness now pins the Smart tier to the new `claude-sonnet-5` model id so new sessions use Sonnet 5 by default."},{icon:K,title:"Nothing to change",body:"Existing Smart-tier chats and agents pick up Sonnet 5 automatically. Thinking remains on Opus 4.8 1M."}],learnMoreHref:"https://www.anthropic.com/news/claude-sonnet-5"},{id:"fable-5-suspension",date:"2026-06-13",eyebrow:"Important Update",title:"Fable 5 & Mythos 5 suspended — Opus 4.8 takes over",bullets:[{icon:J,title:"US government directive",body:"Anthropic received an export control directive requiring the suspension of Fable 5 and Mythos 5 access for all users, citing national security concerns. Anthropic is complying while it works to resolve the matter."},{icon:U,title:"Opus 4.8 steps in as the Thinking tier",body:"The Thinking tier now runs on Claude Opus 4.8, which remains fully operational. Performance on most tasks is comparable, and Anthropic reports more than 95% of sessions were unaffected by the Fable 5 classifiers anyway."},{icon:K,title:"Nothing to change",body:"The switch is automatic — any chat or agent already using the Thinking tier is now served by Opus 4.8. Anthropic will share further details within 24 hours."}],learnMoreHref:"https://www.anthropic.com/news/fable-mythos-access"},{id:"claude-fable-5",date:"2026-06-09",eyebrow:"Now Available",title:"Claude Fable 5 leads the Thinking tier",bullets:[{icon:U,title:"State-of-the-art reasoning",body:"Fable 5 takes the Thinking tier, posting top scores across software engineering, knowledge work, and vision — and outperforming Opus 4.8 on nearly every benchmark Anthropic tested."},{icon:J,title:"Safety without the slowdown",body:"New classifiers route the small slice of high-risk requests (cybersecurity, bio/chem) back to Opus 4.8. Anthropic reports more than 95% of sessions never trigger a fallback."},{icon:K,title:"Nothing to change",body:"Chats and agents pick up Fable 5 automatically wherever the Thinking tier is selected. Opus 4.8 stays available as the safety fallback."}],learnMoreHref:"https://www.anthropic.com/news/claude-fable-5-mythos-5"},{id:"claude-opus-4-8",date:"2026-05-28",eyebrow:"Now Available",title:"Claude Opus 4.8 is the new default",bullets:[{icon:U,title:"Smarter thinking, same price",body:"Opus 4.8 now leads the Thinking and Smarter tiers, outperforming Opus 4.7 on coding, reasoning, and agent tasks at the same cost."},{icon:J,title:"More honest answers",body:"It's about 4× less likely to let a code flaw slip through unflagged, and surfaces uncertainty instead of making unsupported claims."},{icon:K,title:"Nothing to change",body:"Chats and agents pick up Opus 4.8 automatically wherever the Thinking or Smarter tier is selected."}],learnMoreHref:"https://www.anthropic.com/news/claude-opus-4-8"},{id:"enhanced-sidebar",date:"2026-05-28",eyebrow:"Now Available",title:"Enhanced sidebar",bullets:[{icon:U,title:"A clearer view of what's running",body:"See every task in your organization at a glance, with each agent and status group laid out so you can spot active work without hunting for it."},{icon:be,title:"Browse one group at a time",body:"Expand the groups you care about and pull in more results on demand — no more endless scrolling to find an older conversation."},{icon:J,title:"Polished and steadier",body:"Several sidebar bugs are fixed, including empty agent groups showing the right action and status filters returning the right tasks."}]},{id:"smarter-task-delegation",date:"2026-05-27",eyebrow:"Now Available",title:"Smarter task delegation",bullets:[{icon:it,title:"Real results from delegated agents",body:"When one agent hands work to another, you'll see the full report inline — no more empty replies hiding the work that was done."},{icon:K,title:"Same powers, top to bottom",body:"Delegated agents now work with the same tools, context, and memory as the agent that called them, so complex multi-agent investigations finish on the first try."},{icon:J,title:"Clearer progress signals",body:"When a delegated task hits its limit or runs into a problem, you get a plain-language message instead of a silent stall."}]},{id:"sidebar-task-groups",date:"2026-05-27",eyebrow:"Now Available",title:"Redesigned sidebar",bullets:[{icon:U,title:"Group by agent or status",body:"Switch the task list between grouping by agent or by status — pick whichever matches how you're working right now."},{icon:be,title:"Sharper filters",body:"Narrow the list to your tasks, manual chats, or automations from a compact filter row above the groups."}]},{id:"release-channel",date:"2026-05-26",eyebrow:"Now Available",title:"Release announcements",bullets:[{icon:U,title:"Heads-up when features ship",body:"New releases surface in a corner card the first time you see them, then stick around in your inbox."},{icon:dt,title:"Unified inbox",body:"Org invitations and product updates now share one chronological feed in the sidebar."}]}],Ie=qt,re="studio.release-feed.v1",ue=new Set;let V="",W={},me=!1;function Bt(){if(me)return V||"{}";try{return localStorage.getItem(re)??"{}"}catch{return V||"{}"}}function Ee(t){try{const e=JSON.parse(t);return e&&typeof e=="object"?e:{}}catch{return{}}}function we(){const t=Bt();return t!==V&&(V=t,W=Ee(t)),W}function Ht(t){ue.add(t);const e=s=>{if(!(s.key!==re&&s.key!==null)){try{const o=localStorage.getItem(re)??"{}",r={...Ee(o),...W};W=r,V=JSON.stringify(r)}catch{}t()}};return window.addEventListener("storage",e),()=>{ue.delete(t),window.removeEventListener("storage",e)}}function Ut(t){W=t,V=JSON.stringify(t);try{localStorage.setItem(re,V),me=!1}catch{me=!0}ue.forEach(e=>e())}function Jt(){const t=D.c(7),e=B.useSyncExternalStore(Ht,we,we);let s;t[0]!==e?(s=d=>!!e[d],t[0]=e,t[1]=s):s=t[1];const o=s,l=Kt;let r;t[2]!==e?(r=Ie.reduce((d,u)=>e[u.id]?d:d+1,0),t[2]=e,t[3]=r):r=t[3];const i=r;let a;return t[4]!==o||t[5]!==i?(a={isSeen:o,markSeen:l,unseenCount:i},t[4]=o,t[5]=i,t[6]=a):a=t[6],a}function Kt(t){W[t]||Ut({...W,[t]:{seenAt:new Date().toISOString()}})}const Gt=720*60*60*1e3,Vt=10080*60*1e3;function Wt(t){const[e,s,o]=t.split("-").map(Number);return!e||!s||!o?new Date(t).getTime():new Date(e,s-1,o).getTime()}function Qt(t){const e=Ie[0];if(!e)return null;const s=Wt(e.date),o=t-s;return o<0||o>Gt?null:e}function Yt(t){if(t instanceof Date)return t.getTime();if(typeof t=="string"||typeof t=="number"){const e=new Date(t).getTime();return Number.isFinite(e)?e:null}return null}function Xt(t,e){const s=Yt(t);return s===null?!1:e-s>=Vt}function Zt(){const t=D.c(41),e=H(),{data:s}=X.useSession(),{isSeen:o,markSeen:l}=Jt(),[r,i]=B.useState(!1);let a,d,u;if(t[0]!==o||t[1]!==s?.user?.createdAt){u=Symbol.for("react.early_return_sentinel");e:{const j=Date.now();if(a=Qt(j),!a){u=null;break e}if(!Xt(s?.user?.createdAt,j)){u=null;break e}d=o(a.id)}t[0]=o,t[1]=s?.user?.createdAt,t[2]=a,t[3]=d,t[4]=u}else a=t[2],d=t[3],u=t[4];if(u!==Symbol.for("react.early_return_sentinel"))return u;if(d)return null;let x;t[5]!==e?(x=e("announcements.release.ariaLabel"),t[5]=e,t[6]=x):x=t[6];let c;t[7]!==e?(c=e("announcements.release.dismiss"),t[7]=e,t[8]=c):c=t[8];const v=a.eyebrow,g=a.title;let w;t[9]!==a.id||t[10]!==l?(w=()=>l(a.id),t[9]=a.id,t[10]=l,t[11]=w):w=t[11];let f;t[12]!==a.id||t[13]!==a.learnMoreHref||t[14]!==l||t[15]!==e?(f=a.learnMoreHref?n.jsx("a",{href:a.learnMoreHref,target:"_blank",rel:"noreferrer",onClick:()=>l(a.id),className:"underline-offset-2 hover:text-foreground hover:underline",children:e("announcements.release.learnMore")}):null,t[12]=a.id,t[13]=a.learnMoreHref,t[14]=l,t[15]=e,t[16]=f):f=t[16];let m;t[17]!==a.cta||t[18]!==a.id||t[19]!==l?(m=a.cta?"href"in a.cta?n.jsx($,{asChild:!0,size:"sm",onClick:()=>l(a.id),children:n.jsx("a",{href:a.cta.href,children:a.cta.label})}):n.jsx($,{size:"sm",onClick:()=>i(!0),children:a.cta.label}):null,t[17]=a.cta,t[18]=a.id,t[19]=l,t[20]=m):m=t[20];let b;t[21]!==a.bullets?(b=a.bullets.map(en),t[21]=a.bullets,t[22]=b):b=t[22];let h;t[23]!==b?(h=n.jsx("ul",{className:"flex flex-col gap-3",children:b}),t[23]=b,t[24]=h):h=t[24];let p;t[25]!==a.id||t[26]!==l?(p=j=>{i(j),j||l(a.id)},t[25]=a.id,t[26]=l,t[27]=p):p=t[27];let S;t[28]!==r||t[29]!==p?(S=n.jsx(mt,{open:r,onOpenChange:p}),t[28]=r,t[29]=p,t[30]=S):S=t[30];let k;return t[31]!==a.eyebrow||t[32]!==a.title||t[33]!==h||t[34]!==S||t[35]!==x||t[36]!==c||t[37]!==w||t[38]!==f||t[39]!==m?(k=n.jsxs(Ce,{ariaLabel:x,dismissLabel:c,eyebrow:v,title:g,onDismiss:w,footerLeading:f,actions:m,children:[h,S]}),t[31]=a.eyebrow,t[32]=a.title,t[33]=h,t[34]=S,t[35]=x,t[36]=c,t[37]=w,t[38]=f,t[39]=m,t[40]=k):k=t[40],k}function en(t,e){return n.jsxs("li",{className:"flex items-start gap-3",children:[n.jsx(t.icon,{size:20,className:"mt-0.5 shrink-0 text-muted-foreground"}),n.jsxs("div",{className:"min-w-0",children:[n.jsx("p",{className:"text-sm font-medium text-foreground",children:t.title}),n.jsx("p",{className:"text-xs text-muted-foreground",children:t.body})]})]},e)}const Le=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform),G=Le?"⌘":"Ctrl",F={keyboardShortcuts:{keys:[G,"K"],description:"Keyboard shortcuts"},back:{keys:[G,"["],description:"Back to previous"},focusChatInput:{keys:[G,"L"],description:"Focus chat input"},saveAndFormat:{keys:[G,"S"],description:"Save & format"},sendMessage:{keys:["Enter"],description:"Send message"},newLine:{keys:["Shift","Enter"],description:"New line"},selectOption:{keys:["1-9"],description:"Select option"},applyFilter:{keys:[G,"Enter"],description:"Apply filter"},togglePlanMode:{keys:[G,"Shift","L"],description:"Toggle plan mode"},newTask:{keys:["Shift",G,"S"],description:"New task"},toggleDaemon:{keys:[G,"D"],description:"Toggle daemon logs"}},tn=[{label:"General",shortcuts:[F.keyboardShortcuts,F.back,F.newTask,F.toggleDaemon]},{label:"Editor",shortcuts:[F.saveAndFormat]},{label:"Chat",shortcuts:[F.focusChatInput,F.togglePlanMode,F.sendMessage,F.newLine]},{label:"Questions",shortcuts:[F.selectOption]},{label:"Monitoring",shortcuts:[F.applyFilter]}];function Se(t){return Le?t.metaKey:t.ctrlKey}function nn(t){const e=D.c(11),{open:s,onOpenChange:o}=t,l=H();let r;e[0]!==l?(r=l("common.keyboardShortcutsDialog.title"),e[0]=l,e[1]=r):r=e[1];let i;e[2]!==r?(i=n.jsx(Ae,{children:n.jsx(_e,{children:r})}),e[2]=r,e[3]=i):i=e[3];let a;e[4]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx("div",{className:"flex flex-col gap-4",children:tn.map(sn)}),e[4]=a):a=e[4];let d;e[5]!==i?(d=n.jsxs(Te,{className:"sm:max-w-md",children:[i,a]}),e[5]=i,e[6]=d):d=e[6];let u;return e[7]!==o||e[8]!==s||e[9]!==d?(u=n.jsx(Oe,{open:s,onOpenChange:o,children:d}),e[7]=o,e[8]=s,e[9]=d,e[10]=u):u=e[10],u}function sn(t){return n.jsxs("div",{children:[n.jsx("h3",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-2",children:t.label}),n.jsx("div",{className:"flex flex-col gap-1.5",children:t.shortcuts.map(on)})]},t.label)}function on(t){return n.jsxs("div",{className:"flex items-center justify-between py-1",children:[n.jsx("span",{className:"text-sm",children:t.description}),n.jsx("div",{className:"flex items-center gap-1",children:t.keys.map(an)})]},t.description)}function an(t){return n.jsx("kbd",{className:"inline-flex items-center justify-center min-w-6 h-6 px-1.5 rounded-sm border border-border bg-muted text-muted-foreground text-xs font-mono",children:t},t)}const rn=300*1e3,ln=2;function cn(t,e,s){return!e||e===s?{version:null,count:0}:t.version===e?{version:e,count:t.count+1}:{version:e,count:1}}function dn(t,e){return t.count>=ln&&t.version!==null&&t.version!==e}function un(){const t=D.c(43),e=H(),s=vt();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={mutationFn:fn},t[0]=o):o=t[0];const l=te(o);let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r={queryKey:le.appVersionCheck(),queryFn:mn,refetchInterval:rn,refetchIntervalInBackground:!0,staleTime:0},t[1]=r):r=t[1];const{data:i,dataUpdatedAt:a}=ae(r),[d,u]=B.useState(0);let x;t[2]===Symbol.for("react.memo_cache_sentinel")?(x={version:null,count:0},t[2]=x):x=t[2];const[c,v]=B.useState(x);a!==d&&(u(a),v(M=>cn(M,i,"4.308.0")));const[g,w]=B.useState(null),f=s;let m;t[3]!==s||t[4]!==l?(m=()=>window.location.reload(),t[3]=s,t[4]=l,t[5]=m):m=t[5];const b=m,h="announcements.version.refresh";if(!dn(c,g))return null;let p;t[6]!==e?(p=e("announcements.version.ariaLabel"),t[6]=e,t[7]=p):p=t[7];let S;t[8]!==e?(S=e("announcements.version.dismiss"),t[8]=e,t[9]=S):S=t[9];let k;t[10]!==e?(k=e("announcements.version.eyebrow"),t[10]=e,t[11]=k):k=t[11];let j;t[12]!==e?(j=e("announcements.version.title"),t[12]=e,t[13]=j):j=t[13];const y="announcements.version.description";let N;t[14]!==e||t[15]!==y?(N=e(y),t[14]=e,t[15]=y,t[16]=N):N=t[16];let T;t[17]===Symbol.for("react.memo_cache_sentinel")?(T=n.jsx(ge,{size:16}),t[17]=T):T=t[17];let A;t[18]!==c.version?(A=()=>w(c.version),t[18]=c.version,t[19]=A):A=t[19];let _;t[20]!==e?(_=e("announcements.version.currentSession",{version:"4.308.0"}),t[20]=e,t[21]=_):_=t[21];let O;t[22]!==h||t[23]!==e?(O=e(h),t[22]=h,t[23]=e,t[24]=O):O=t[24];const C=f;let I;t[25]!==C?(I=de(C),t[25]=C,t[26]=I):I=t[26];let L;t[27]!==I?(L=n.jsx(ge,{size:14,className:I}),t[27]=I,t[28]=L):L=t[28];let E;t[29]!==b||t[30]!==f||t[31]!==O||t[32]!==L?(E=n.jsxs($,{size:"sm",disabled:f,onClick:b,children:[O,L]}),t[29]=b,t[30]=f,t[31]=O,t[32]=L,t[33]=E):E=t[33];let R;return t[34]!==A||t[35]!==_||t[36]!==E||t[37]!==p||t[38]!==S||t[39]!==k||t[40]!==j||t[41]!==N?(R=n.jsx(Ce,{ariaLabel:p,dismissLabel:S,eyebrow:k,title:j,description:N,icon:T,tone:"system",onDismiss:A,footerLeading:_,actions:E}),t[34]=A,t[35]=_,t[36]=E,t[37]=p,t[38]=S,t[39]=k,t[40]=j,t[41]=N,t[42]=R):R=t[42],R}async function mn(){const t=await fetch("/api/config",{cache:"no-store"}),{config:e}=await t.json();return e.version}async function fn(){const t=await fetch("/_local/update/restart",{method:"POST"});if(!t.ok)throw new Error(`restart failed: ${t.status}`)}function gn(t){return{has(){try{return localStorage.getItem(t)==="1"}catch{return!1}},mark(){try{localStorage.setItem(t,"1")}catch{}}}}const hn=Date.parse("2026-07-21T00:00:00Z"),ve=t=>gn(Y.ptBrAnnouncementSeen(t));function pn(){const t=D.c(35),e=H(),[s,o]=qe(),{data:l,isPending:r}=X.useSession(),i=l?.user,a=i?.id,d=i?.createdAt,u=d!=null&&new Date(d).getTime()<hn,x=Be()==="pt-BR",c=!r&&!!a&&u&&x&&s.language==="en"&&!ve(a).has(),[v,g]=B.useState(!1),[w,f]=B.useState(!1);!v&&!r&&(g(!0),c&&a&&(ve(a).mark(),o(yn),f(!0),he("pt_br_auto_switch_shown")));let m;t[0]===Symbol.for("react.memo_cache_sentinel")?(m=q=>{he("pt_br_auto_switch_closed",{action:q}),f(!1)},t[0]=m):m=t[0];const b=m;let h;t[1]!==o?(h=()=>{o(bn),b("switch-back")},t[1]=o,t[2]=h):h=t[2];const p=h;let S;t[3]===Symbol.for("react.memo_cache_sentinel")?(S=q=>!q&&b("dismiss"),t[3]=S):S=t[3];let k;t[4]===Symbol.for("react.memo_cache_sentinel")?(k=n.jsx("div",{className:"text-4xl","aria-hidden":"true",children:"🇧🇷"}),t[4]=k):k=t[4];let j;t[5]!==e?(j=e("announcements.ptBr.title"),t[5]=e,t[6]=j):j=t[6];let y;t[7]!==j?(y=n.jsx(_e,{children:j}),t[7]=j,t[8]=y):y=t[8];let N;t[9]!==e?(N=e("announcements.ptBr.description"),t[9]=e,t[10]=N):N=t[10];let T;t[11]!==N?(T=n.jsx(wt,{children:N}),t[11]=N,t[12]=T):T=t[12];let A;t[13]!==y||t[14]!==T?(A=n.jsxs(Ae,{children:[y,T]}),t[13]=y,t[14]=T,t[15]=A):A=t[15];let _;t[16]!==e?(_=e("announcements.ptBr.switchBack"),t[16]=e,t[17]=_):_=t[17];let O;t[18]!==p||t[19]!==_?(O=n.jsx($,{variant:"outline",onClick:p,children:_}),t[18]=p,t[19]=_,t[20]=O):O=t[20];let C;t[21]===Symbol.for("react.memo_cache_sentinel")?(C=()=>b("ok"),t[21]=C):C=t[21];let I;t[22]!==e?(I=e("announcements.ptBr.ok"),t[22]=e,t[23]=I):I=t[23];let L;t[24]!==I?(L=n.jsx($,{onClick:C,children:I}),t[24]=I,t[25]=L):L=t[25];let E;t[26]!==O||t[27]!==L?(E=n.jsxs(St,{children:[O,L]}),t[26]=O,t[27]=L,t[28]=E):E=t[28];let R;t[29]!==E||t[30]!==A?(R=n.jsxs(Te,{className:"sm:max-w-md",children:[k,A,E]}),t[29]=E,t[30]=A,t[31]=R):R=t[31];let M;return t[32]!==w||t[33]!==R?(M=n.jsx(Oe,{open:w,onOpenChange:S,children:R}),t[32]=w,t[33]=R,t[34]=M):M=t[34],M}function bn(t){return{...t,language:"en"}}function yn(t){return{...t,language:"pt-BR"}}function xn(t){const e=He(t);return typeof e=="string"?e:void 0}function wn(){return xn("experiment-pipeline-check"),null}function Sn(t){const e=D.c(1),{activeOrg:s}=t;if(!s)return null;Ue(s.id,{name:s.name??void 0,slug:s.slug??void 0}),Je();let o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(wn,{}),e[0]=o):o=e[0],o}function vn(t){const{prev:e,virtualMcpId:s,decopilotId:o,savedLayout:l,opts:r,autosendValue:i}=t,a={mainpanel:void 0};s?a.virtualmcpid=s:e.virtualmcpid&&(a.virtualmcpid=e.virtualmcpid);const d=typeof e.virtualmcpid=="string"?e.virtualmcpid:o,x=(s??d)!==d;let c,v;return r?.panel?v=r.panel:l?(v=l.tab,l.sidepanel!==void 0&&(c=l.sidepanel),l.mainpanel!==void 0&&(a.mainpanel=l.mainpanel)):!x&&e.tabId&&!Ke(e.tabId)&&(v=e.tabId),c!==void 0&&(a.sidepanel=c),r?.autosend&&(a.autosend=i),{tabId:v,search:a}}const Pe="studio:thread-layout:v3",jn=50;function De(t){const e={};return t===null||typeof t!="object"||(typeof t.tab=="string"&&(e.tab=t.tab),typeof t.mainpanel=="boolean"&&(e.mainpanel=t.mainpanel),typeof t.sidepanel=="boolean"&&(e.sidepanel=t.sidepanel)),e}function kn(t,e,s,o=jn){const l=t.filter(([r])=>r!==e);for(l.push([e,De(s)]);l.length>o;)l.shift();return l}function fe(){try{const t=sessionStorage.getItem(Pe);if(!t)return[];const e=JSON.parse(t);return Array.isArray(e)?e.filter(s=>Array.isArray(s)&&s.length===2&&typeof s[0]=="string"):[]}catch{return[]}}function $e(t){try{sessionStorage.setItem(Pe,JSON.stringify(t))}catch{}}function Nn(t,e){t&&$e(kn(fe(),t,e))}function An(t){if(!t)return null;const e=fe().find(([s])=>s===t);return e?De(e[1]):null}function ns(t){if(!t)return;const e=fe(),s=e.filter(([o])=>o!==t);s.length!==e.length&&$e(s)}function Re(t){return{queryKey:le.homeNextActions(t),queryFn:async()=>{const e=await fetch(`/api/${t}/home-next-actions`,{cache:"no-store"});if(!e.ok)throw new Error("Failed to load home next actions");return await e.json()},staleTime:0,refetchOnWindowFocus:"always"}}function ss(t){const e=D.c(10);let s;e[0]!==t?(s=Re(t),e[0]=t,e[1]=s):s=e[1];const o=ae(s);let l;e[2]!==o.data?.prompts?(l=o.data?.prompts??[],e[2]=o.data?.prompts,e[3]=l):l=e[3];let r;e[4]!==o.data?.tiles?(r=o.data?.tiles??[],e[4]=o.data?.tiles,e[5]=r):r=e[5];let i;return e[6]!==o.isLoading||e[7]!==l||e[8]!==r?(i={isLoading:o.isLoading,prompts:l,tiles:r},e[6]=o.isLoading,e[7]=l,e[8]=r,e[9]=i):i=e[9],i}function _n(t){const e=D.c(31),{orgSlug:s,orgName:o,domain:l}=t,r=H();let i;e[0]!==s?(i=()=>{window.location.href=`/api/${encodeURIComponent(s)}/sso/authorize`},e[0]=s,e[1]=i):i=e[1];const a=i,d=Tn;let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx("div",{className:"bg-primary/10 p-3 rounded-full",children:n.jsx(je,{className:"h-6 w-6 text-primary"})}),e[2]=u):u=e[2];let x;e[3]!==r?(x=r("common.ssoRequiredScreen.title"),e[3]=r,e[4]=x):x=e[4];let c;e[5]!==x?(c=n.jsx("h3",{className:"text-lg font-medium",children:x}),e[5]=x,e[6]=c):c=e[6];let v;e[7]!==l||e[8]!==o||e[9]!==r?(v=o?n.jsxs(n.Fragment,{children:[n.jsx("strong",{children:o})," ",r("common.ssoRequiredScreen.requiresSsoAuth"),l?` ${r("common.ssoRequiredScreen.via",{domain:l})}`:"","."]}):r("common.ssoRequiredScreen.orgRequiresSsoAuth"),e[7]=l,e[8]=o,e[9]=r,e[10]=v):v=e[10];let g;e[11]!==v?(g=n.jsx("p",{className:"text-sm text-muted-foreground",children:v}),e[11]=v,e[12]=g):g=e[12];let w;e[13]!==c||e[14]!==g?(w=n.jsxs("div",{className:"space-y-2",children:[c,g]}),e[13]=c,e[14]=g,e[15]=w):w=e[15];let f;e[16]!==r?(f=r("common.ssoRequiredScreen.signInWithSso"),e[16]=r,e[17]=f):f=e[17];let m;e[18]!==a||e[19]!==f?(m=n.jsx($,{onClick:a,children:f}),e[18]=a,e[19]=f,e[20]=m):m=e[20];let b;e[21]!==r?(b=r("common.ssoRequiredScreen.goBack"),e[21]=r,e[22]=b):b=e[22];let h;e[23]!==b?(h=n.jsx($,{variant:"ghost",onClick:d,children:b}),e[23]=b,e[24]=h):h=e[24];let p;e[25]!==h||e[26]!==m?(p=n.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[m,h]}),e[25]=h,e[26]=m,e[27]=p):p=e[27];let S;return e[28]!==p||e[29]!==w?(S=n.jsxs(Z,{children:[u,w,p]}),e[28]=p,e[29]=w,e[30]=S):S=e[30],S}function Tn(){window.location.href="/"}function On(t){const e=D.c(8),{org:s,children:o}=t,r=Tt(s.id,s.slug)?.enabled_plugins??null;let i;e[0]!==s.id||e[1]!==s.name||e[2]!==r?(i={id:s.id,organizationId:s.id,slug:"_org",name:s.name,enabledPlugins:r,ui:null},e[0]=s.id,e[1]=s.name,e[2]=r,e[3]=i):i=e[3];const a=i;let d;return e[4]!==o||e[5]!==s||e[6]!==a?(d=n.jsx(ot,{org:s,project:a,children:o}),e[4]=o,e[5]=s,e[6]=a,e[7]=d):d=e[7],d}function Cn(){const t=Ge(),e=_t(),{org:s}=Ve(),o=We({strict:!1}),l=ft(),{openPanel:r,closePanel:i}=gt(),a=ht(),d=pt(),u=bt(),x=yt(),c=(f,m=!0)=>t({to:".",search:f,replace:m}),v=()=>c(f=>({...f,sidepanel:!0})),g=(f,m,b)=>{const h=!!d&&d===f;d&&!h&&Nn(d,{tab:l,mainpanel:o.mainpanel,sidepanel:o.sidepanel});const p=h?null:An(f),S=Nt(s.id).id,k=vn({prev:{virtualmcpid:a,tabId:l},virtualMcpId:m,decopilotId:S,savedLayout:p,opts:b,autosendValue:xt});return x(f,()=>k.search,{virtualMcpId:m,view:{tabId:k.tabId}})};return{openSidePanel:v,setTaskId:g,createNewTask:async(f,m,b)=>{const h=crypto.randomUUID(),p=f??u;try{await e?.create({id:h,virtual_mcp_id:p,...m?{branch:m}:{}})}catch{}g(h,p,b)},openTab:r,closeTab:i}}const In=new Set(["/$org/","/$org/home"]);function En(){const t=D.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e={select:Ln},t[0]=e):e=t[0],et(e)}function Ln(t){const e=t.matches.at(-1)?.fullPath;return e!==void 0&&In.has(e)}function Pn(){const t=D.c(52);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org",shouldThrow:!1},t[0]=e):e=t[0];const o=Qe(e)?.params.org,[l,r]=B.useState(!1),i=Ye(),a=En(),d=o??"";let u;t[1]!==d?(u=Re(d),t[1]=d,t[2]=u):u=t[2];const x=!!o&&a;let c;t[3]!==u||t[4]!==x?(c={...u,enabled:x},t[3]=u,t[4]=x,t[5]=c):c=t[5],ae(c);const{data:v}=X.useSession(),g=v?.user?.id;let w;t[6]!==o||t[7]!==g?(w=o&&g?Xe(g,o):null,t[6]=o,t[7]=g,t[8]=w):w=t[8];const f=w;let m,b;t[9]!==i?(m=()=>{const P=z=>{if(Se(z)&&z.code==="KeyK"){z.preventDefault(),r(!0);return}Se(z)&&z.code==="BracketLeft"&&i.history.canGoBack()&&(z.preventDefault(),i.history.back())};return document.addEventListener("keydown",P),()=>document.removeEventListener("keydown",P)},b=[i],t[9]=i,t[10]=m,t[11]=b):(m=t[10],b=t[11]),B.useEffect(m,b);let h;t[12]!==o?(h=le.activeOrganization(o),t[12]=o,t[13]=h):h=t[13];let p;t[14]!==o||t[15]!==g?(p=async()=>{if(!o)return null;performance.mark("mesh:active-org-fetch:start");const{data:P}=await X.organization.getFullOrganization({query:{organizationSlug:o}}).finally(Dn),z=pe(P);return P&&!z&&localStorage.setItem(Y.lastOrgSlug(),o),g&&P&&tt(g,o,P),P},t[14]=o,t[15]=g,t[16]=p):p=t[16];const S=f?f.data:void 0,k=f?.updatedAt;let j;t[17]!==S||t[18]!==k||t[19]!==h||t[20]!==p?(j={queryKey:h,queryFn:p,initialData:S,initialDataUpdatedAt:k,gcTime:1/0,refetchOnWindowFocus:!1},t[17]=S,t[18]=k,t[19]=h,t[20]=p,t[21]=j):j=t[21];const{data:y}=ke(j),N=y?.id,T=y?.slug,{data:A}=Ot(N,T),_=N??"",O=T??"";let C;t[22]!==_||t[23]!==O?(C=kt({connectionId:At,orgId:_,orgSlug:O}),t[22]=_,t[23]=O,t[24]=C):C=t[24];const I=!!N&&!!T;let L;if(t[25]!==C||t[26]!==I?(L={...C,enabled:I},t[25]=C,t[26]=I,t[27]=L):L=t[27],ae(L),!y){let P;t[28]===Symbol.for("react.memo_cache_sentinel")?(P=n.jsx(nt,{}),t[28]=P):P=t[28];let z;return t[29]!==o?(z=n.jsx(B.Suspense,{fallback:P,children:n.jsx(Ft,{orgSlug:o})}),t[29]=o,t[30]=z):z=t[30],z}if(pe(y)){localStorage.getItem(Y.lastOrgSlug())===o&&localStorage.removeItem(Y.lastOrgSlug());let P;return t[31]!==y.name?(P=n.jsx(Ze,{orgName:y.name}),t[31]=y.name,t[32]=P):P=t[32],P}if(A?.ssoRequired&&!A.authenticated){let P;return t[33]!==y.id||t[34]!==y.name||t[35]!==y.slug||t[36]!==A.domain?(P=n.jsx(_n,{orgId:y.id,orgSlug:y.slug,orgName:y.name,domain:A.domain}),t[33]=y.id,t[34]=y.name,t[35]=y.slug,t[36]=A.domain,t[37]=P):P=t[37],P}const R=y.logo??null;let M;t[38]!==y||t[39]!==R?(M={...y,logo:R},t[38]=y,t[39]=R,t[40]=M):M=t[40];let q;t[41]!==y?(q=n.jsx(Sn,{activeOrg:y}),t[41]=y,t[42]=q):q=t[42];let ne;t[43]===Symbol.for("react.memo_cache_sentinel")?(ne=n.jsx(st,{}),t[43]=ne):ne=t[43];let se;t[44]===Symbol.for("react.memo_cache_sentinel")?(se=n.jsxs("div",{className:"fixed bottom-6 right-6 z-50 flex w-[min(360px,calc(100vw-3rem))] flex-col gap-3",children:[n.jsx(Zt,{}),n.jsx(un,{})]}),t[44]=se):se=t[44];let Q;t[45]!==l?(Q=n.jsx(nn,{open:l,onOpenChange:r}),t[45]=l,t[46]=Q):Q=t[46];let oe;t[47]===Symbol.for("react.memo_cache_sentinel")?(oe=n.jsx(pn,{}),t[47]=oe):oe=t[47];let ie;return t[48]!==M||t[49]!==q||t[50]!==Q?(ie=n.jsxs(On,{org:M,children:[q,ne,se,Q,oe]}),t[48]=M,t[49]=q,t[50]=Q,t[51]=ie):ie=t[51],ie}function Dn(){performance.mark("mesh:active-org-fetch:end"),performance.measure("mesh:active-org-fetch","mesh:active-org-fetch:start","mesh:active-org-fetch:end")}function $n(){const t=D.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(jt,{children:n.jsx(Pn,{})}),t[0]=e):e=t[0],e}const os=Object.freeze(Object.defineProperty({__proto__:null,default:$n,usePanelActions:Cn},Symbol.toStringTag,{value:"Module"}));export{F as K,ss as a,ns as f,Se as i,gn as m,os as s,Cn as u};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/registry-layout-C3aeIwiX.js","assets/index-Ci8azyOE.js","assets/index-DJSuP9VA.css","assets/Tool02-jKKU1_dM.js","assets/CheckCircle-teyxVGFp.js","assets/Settings02-BMcJFHpd.js","assets/use-mcp-client-DP2onozC.js","assets/constants-dLUUoWH7.js","assets/auth-D8IdOmGw.js","assets/useInfiniteQuery-DjjzlWAZ.js","assets/use-infinite-scroll-Cw7R-QWe.js","assets/badge-DX3_GQsO.js","assets/input-Bwz-dTwg.js","assets/dropdown-menu-wKA_-hY5.js","assets/Check-D5PKBQ5I.js","assets/ChevronRight-DUmHQrD7.js","assets/DotsVertical-CpVcGDJ_.js","assets/table-oIbRw7Yk.js","assets/toggle-group-ClOqwWDq.js","assets/use-view-mode-Bn3--gRi.js","assets/FilterLines-Db8-uWfr.js","assets/Globe01-CV-16mwB.js","assets/SearchMd-ClTH3fiN.js","assets/dialog-BI8UUwqv.js","assets/AlertCircle-BTlJp8pf.js","assets/Download01-BN9BT9cL.js","assets/Upload01-DxCHPffq.js","assets/metadata-dUsYcpuu.js","assets/alert-dialog-Dh9zsaCy.js","assets/Trash01-Dp-QTpAR.js","assets/label-C1OhLpvf.js","assets/select-C7Q2VGxk.js","assets/ChevronDown-Csfjhwpm.js","assets/ChevronUp-Dlj_U0qV.js","assets/switch-BuJnEOUw.js","assets/textarea-CMpN0SgX.js","assets/ArrowLeft-BwagOJkb.js","assets/XCircle-CVbKXkpd.js","assets/checkbox-Gg7TSWGl.js","assets/Eye-DgiSa7UT.js","assets/LinkExternal01-CIL2SNWf.js","assets/use-copy-BY1mlr6R.js","assets/Copy01-CsNpp9jr.js","assets/Key01-D4srNqPO.js","assets/Plus-CPkR-QLd.js","assets/mcp-oauth-GWhqBwu1.js","assets/Play-C9xK8clC.js"])))=>i.map(i=>d[i]);
2
- import{c as n,d as c,f as m,j as t,k as f,r as l,bp as p}from"./index-Ci8azyOE.js";import{R as u}from"./require-capability-cxyKBT59.js";import"./access-gate-BZ6Xc62y.js";import"./capability-load-error-BtIV807c.js";const g=l.lazy(()=>p(()=>import("./registry-layout-C3aeIwiX.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46])));function h(){const e=n.c(5),i=c();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org"},e[0]=s):s=e[0];const{org:o}=m(s);let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"h-full flex items-center justify-center",children:t.jsx(f,{size:20,className:"animate-spin text-muted-foreground"})}),e[1]=r):r=e[1];let a;return e[2]!==i||e[3]!==o?(a=t.jsx(u,{capability:"registry:manage",area:"the registry",children:t.jsx(l.Suspense,{fallback:r,children:t.jsx(g,{onBack:()=>i({to:"/$org/settings/store",params:{org:o}})})})}),e[2]=i,e[3]=o,e[4]=a):a=e[4],a}export{h as default};
@@ -1 +0,0 @@
1
- import{c as O,H as oe,o as ke,K as Ae,b as F,j as t,C as Gt,av as Xt,B as te,r as R,bO as Qt,d as ot,w as Wt,n as U,a as re,t as K,y as Yt,k as Ie,a5 as gt,M as ht,q as B,_ as pt,Z as xt,Y as Jt,a8 as Ce,a9 as ye,ab as Ne,L as Zt,G as en,aw as tn,ax as nn,R as sn,I as on,p as an,ac as ln}from"./index-Ci8azyOE.js";import{m as ct,u as cn}from"./use-mcp-client-DP2onozC.js";import{C as jt,g as rn,W as dn,S as vt,a as bt,i as un,d as mn,f as fn}from"./constants-dLUUoWH7.js";import{D as gn}from"./use-destination-route-d8wgPDBu.js";import{d as rt,C as hn}from"./self-tool-result-BSLlHbcp.js";import{i as pn}from"./ChevronRight-DUmHQrD7.js";import{aJ as xn,P as jn,A as Ct,K as vn,s as Ze}from"./agent-icon-DCM1Bdl8.js";import{b as yt,f as bn,g as Nt}from"./use-panel-navigate-BsVeEWlx.js";import{t as wt}from"./ChevronDown-Csfjhwpm.js";import{u as _t,a as Cn}from"./use-virtual-mcp-Dj0wXB98.js";import{a as Re,b as St,P as Dt}from"./popover-ClwD_xra.js";import{i as Ve}from"./Check-D5PKBQ5I.js";import{s as we}from"./Plus-CPkR-QLd.js";import{i as kt}from"./SearchMd-ClTH3fiN.js";import{s as It}from"./XClose-CTv0nnSb.js";import{T as At}from"./toolbar-KH-9Bre4.js";import{D as Tt,a as Pt,b as Ot,c as yn,g as Nn,e as wn,f as _n}from"./drawer-BR22I8_f.js";import{a as Sn,G as Dn}from"./github-repo-picker-sKX6qrmQ.js";import{g as kn,a as In,b as zt}from"./hooks-DQmp7LHz.js";import{u as An,g as Tn,a as Pn,b as On,f as zn}from"./use-navigate-to-agent-mrg2_DxJ.js";import{g as Mn,a as Mt}from"./agent-capabilities-B52k7xCe.js";import{u as $t}from"./shell-layout-i3nUAnDL.js";import{d as $n}from"./session-runtime-C-KTDVeQ.js";import{C as Fn}from"./collection-search-0N-i_PHL.js";import{g as Ln,a as En,b as Bn,e as Rn}from"./extract-connection-data-6cVSTGuY.js";import{u as Ft,a as Lt,g as Vn,C as et}from"./connection-card-B1T5pd1c.js";import{e as Et,d as Bt,a as Rt,b as Vt,h as Kn,c as Un}from"./dialog-BI8UUwqv.js";import{d as W,a as Y,e as J,b as Z,c as ee,F as dt}from"./form-DauSI86Q.js";import{I as ce}from"./input-Bwz-dTwg.js";import{S as Hn,a as qn,b as Gn,c as Xn,d as De}from"./select-C7Q2VGxk.js";import{T as Qn}from"./textarea-CMpN0SgX.js";import{b as Kt}from"./use-connection-gqhqm1hO.js";import{n as Be,i as tt}from"./Tool02-jKKU1_dM.js";import{f as Wn}from"./UserSquare-CwU4sG2o.js";import{c as Yn,i as Le,a as ut,E as Jn,p as Zn,b as es,d as ts}from"./connection-form-helpers-CYKg-GvJ.js";import{a as nt}from"./authenticate-and-persist-oauth-DY_hbkIG.js";import{g as ns}from"./connection-slug-CITJ0kGN.js";import{C as ss}from"./collection-tabs-PM6yowhG.js";import{u as mt}from"./use-infinite-scroll-Cw7R-QWe.js";import{B as Ee}from"./badge-DX3_GQsO.js";import{u as os}from"./useSuspenseInfiniteQuery-Ci5SesMe.js";import{g as Ke}from"./metadata-dUsYcpuu.js";import{u as is}from"./use-ai-providers-DlWIkMD-.js";function as(n){return n?n.run_in_progress?"generating":n.scanned_at?"ready":"none":"none"}const ls=2e4;function cs(n){if(typeof n!="string"||!n)return null;try{return new URL(n).hostname||null}catch{return null}}function Go(){const n=O.c(19),{org:e}=oe(),s=dn.COMMERCE_DISCOVERY(e.id);let o;n[0]!==e.id||n[1]!==e.slug?(o=ct({connectionId:vt,orgId:e.id,orgSlug:e.slug}),n[0]=e.id,n[1]=e.slug,n[2]=o):o=n[2];const{data:a}=ke(o),i=ke({queryKey:Ae.commerceDiscoveryConnection(e.id,s),enabled:!!a,retry:!1,staleTime:6e4,queryFn:async()=>{if(!a)throw new Error("selfClient not ready");const S=await a.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:s}});return rt(S)}}),l=i.data?.item??null,{data:c}=ke({...ct({connectionId:s,orgId:e.id,orgSlug:e.slug}),enabled:!!l}),r=Ae.commerceDiscoveryDiagnostic(e.id,s),u=!!c;let m;n[3]!==c?(m=async()=>{if(!c)throw new Error("cdClient not ready");const S=await c.callTool({name:jt,arguments:{}});return rt(S).diagnostic??null},n[3]=c,n[4]=m):m=n[4];let f;n[5]!==r||n[6]!==u||n[7]!==m?(f={queryKey:r,enabled:u,retry:1,refetchInterval:rs,queryFn:m},n[5]=r,n[6]=u,n[7]=m,n[8]=f):f=n[8];const d=ke(f),g=l?.metadata?.siteUrl,b=d.data??null,h=d.isSuccess,p=i.isPending||!!l&&d.isPending,j=typeof g=="string"&&g?g:null;let v;n[9]!==g?(v=cs(g),n[9]=g,n[10]=v):v=n[10];const C=c??null;let _;return n[11]!==s||n[12]!==d.isSuccess||n[13]!==C||n[14]!==b||n[15]!==p||n[16]!==j||n[17]!==v?(_={diagnostic:b,isSuccess:h,isLoading:p,siteUrl:j,host:v,connectionId:s,cdClient:C},n[11]=s,n[12]=d.isSuccess,n[13]=C,n[14]=b,n[15]=p,n[16]=j,n[17]=v,n[18]=_):_=n[18],_}function rs(n){return n.state.status!=="error"&&as(n.state.data)==="generating"?ls:!1}function Xo(n,e){return{to:gn.agents,params:{org:n.slug,project:rn(n.id),panel:"app"},search:{connection:e,tool:jt}}}const ds="https://decoims.com/image?src=decocms%2F06b54678-5335-4671-b63a-e13d9e541155%2Fagataesteves.png&quality=original&fit=cover&width=160&height=160";function us(){const n=O.c(13),e=F();let s;n[0]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("img",{src:"/logos/summit/monte-carlo.svg",alt:"Monte Carlo",className:"h-14 w-[112px] shrink-0 self-start object-contain object-left brightness-0 invert"}),n[0]=s):s=n[0];let o;n[1]!==e?(o=e("routes.commerceOnboarding.connectModal.quote"),n[1]=e,n[2]=o):o=n[2];let a;n[3]!==o?(a=t.jsxs("blockquote",{className:"text-lg font-medium leading-[1.45] lg:text-xl",children:["“",o,"”"]}),n[3]=o,n[4]=a):a=n[4];let i;n[5]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("img",{src:ds,alt:"",className:"size-10 shrink-0 rounded-full object-cover",loading:"lazy"}),n[5]=i):i=n[5];let l;n[6]!==e?(l=e("routes.commerceOnboarding.connectModal.quoteAuthor"),n[6]=e,n[7]=l):l=n[7];let c;n[8]!==l?(c=t.jsxs("figcaption",{className:"flex items-center gap-2.5",children:[i,t.jsx("span",{className:"text-base font-medium",children:l})]}),n[8]=l,n[9]=c):c=n[9];let r;return n[10]!==a||n[11]!==c?(r=t.jsxs("div",{className:"relative flex flex-col gap-8 text-white",children:[s,a,c]}),n[10]=a,n[11]=c,n[12]=r):r=n[12],r}function ms(){const n=O.c(19),e=F();let s;n[0]!==e?(s=e("routes.commerceOnboarding.connectModal.trustRevoke"),n[0]=e,n[1]=s):s=n[1];let o;n[2]!==s?(o={Icon:xn,label:s},n[2]=s,n[3]=o):o=n[3];let a;n[4]!==e?(a=e("routes.commerceOnboarding.connectModal.trustEncrypted"),n[4]=e,n[5]=a):a=n[5];let i;n[6]!==a?(i={Icon:Gt,label:a},n[6]=a,n[7]=i):i=n[7];let l;n[8]!==e?(l=e("routes.commerceOnboarding.connectModal.trustNeverSold"),n[8]=e,n[9]=l):l=n[9];let c;n[10]!==l?(c={Icon:jn,label:l},n[10]=l,n[11]=c):c=n[11];let r;n[12]!==o||n[13]!==i||n[14]!==c?(r=[o,i,c],n[12]=o,n[13]=i,n[14]=c,n[15]=r):r=n[15];const u=r;let m;n[16]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("div",{className:"h-px w-full bg-white/15"}),n[16]=m):m=n[16];let f;return n[17]!==u?(f=t.jsxs("div",{className:"relative flex flex-col gap-2.5 text-white",children:[m,t.jsx("ul",{className:"mt-1 flex flex-col gap-2.5",children:u.map(fs)})]}),n[17]=u,n[18]=f):f=n[18],f}function fs(n){const{Icon:e,label:s}=n;return t.jsxs("li",{className:"flex items-center gap-2.5 text-[13px] leading-tight text-white/70",children:[t.jsx(e,{className:"size-4 shrink-0 opacity-85"}),s]},s)}function Qo(n){const e=O.c(22),{siteHost:s,footer:o,onClose:a,children:i}=n,l=F(),c=s?`https://www.google.com/s2/favicons?domain=${s}&sz=128`:null;let r;e[0]!==a||e[1]!==l?(r=a&&t.jsx("button",{type:"button",onClick:a,"aria-label":l("routes.commerceOnboarding.connectModal.close"),className:"absolute right-3 top-3 z-10 flex size-9 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-black/10 hover:text-foreground lg:text-white/80 lg:hover:bg-white/15 lg:hover:text-white",children:t.jsx(Xt,{size:18})}),e[0]=a,e[1]=l,e[2]=r):r=e[2];let u,m;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"size-7 shrink-0 dark:hidden"}),m=t.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"hidden size-7 shrink-0 dark:block"}),e[3]=u,e[4]=m):(u=e[3],m=e[4]);let f;e[5]!==c||e[6]!==s?(f=s&&t.jsxs(t.Fragment,{children:[t.jsx(pn,{size:16,className:"shrink-0 text-foreground/25"}),c&&t.jsx("span",{className:"flex size-4 shrink-0 items-center justify-center overflow-hidden rounded bg-white",children:t.jsx("img",{src:c,alt:"",className:"size-full"})}),t.jsx("span",{className:"truncate text-[15px] leading-tight text-muted-foreground",children:s})]}),e[5]=c,e[6]=s,e[7]=f):f=e[7];let d;e[8]!==f?(d=t.jsxs("div",{className:"flex items-center gap-2",children:[u,m,f]}),e[8]=f,e[9]=d):d=e[9];let g;e[10]!==o?(g=t.jsx("div",{className:"flex shrink-0 flex-col gap-3",children:o}),e[10]=o,e[11]=g):g=e[11];let b;e[12]!==i||e[13]!==d||e[14]!==g?(b=t.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-8 bg-background p-6 lg:p-8",children:[d,i,g]}),e[12]=i,e[13]=d,e[14]=g,e[15]=b):b=e[15];let h,p;e[16]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("img",{src:"https://decoims.com/image?src=decocms%2F8191643a-1947-4c30-afb4-36b8073c90fb%2Fbg-quote.png&quality=original&fit=cover&width=880",alt:"",className:"absolute inset-0 size-full object-cover"}),p=t.jsx("div",{className:"absolute inset-0 bg-black/20"}),e[16]=h,e[17]=p):(h=e[16],p=e[17]);let j;e[18]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsxs("aside",{className:"relative hidden shrink-0 overflow-hidden lg:flex lg:w-[440px] lg:flex-col lg:p-14",children:[h,p,t.jsxs("div",{className:"relative z-10 flex h-full flex-col",children:[t.jsx("div",{className:"flex-1"}),t.jsx(us,{}),t.jsx("div",{className:"flex-1"}),t.jsx(ms,{})]})]}),e[18]=j):j=e[18];let v;return e[19]!==r||e[20]!==b?(v=t.jsxs("div",{className:"relative flex min-h-0 flex-1 flex-col lg:flex-row",children:[r,b,j]}),e[19]=r,e[20]=b,e[21]=v):v=e[21],v}function Wo(n){const e=O.c(5),{ready:s,pending:o,label:a,onClick:i,children:l}=n,c=o||!s,r=s&&!o?l:null;let u;return e[0]!==a||e[1]!==i||e[2]!==c||e[3]!==r?(u=t.jsxs(te,{type:"button",size:"lg",className:"h-auto min-h-12 w-full whitespace-normal rounded-lg py-3 text-center text-base font-medium leading-tight",onClick:i,disabled:c,children:[a,r]}),e[0]=a,e[1]=i,e[2]=c,e[3]=r,e[4]=u):u=e[4],u}function Ut(){const n=R.useContext(Qt),{data:e,refetch:s}=n.hooks.useListUserInvitations();return{invitations:(e??[]).filter(a=>a.status==="pending"&&new Date(a.expiresAt)>new Date),refetch:()=>s?.()}}function gs(n){let e=0;for(let o=0;o<n.length;o++)e=n.charCodeAt(o)+((e<<5)-e);const s=Math.abs(e)%360;return{backgroundColor:`hsl(${s} 55% 70%)`,color:`hsl(${s} 55% 20%)`}}function it(n){const e=O.c(13),{org:s,size:o}=n,a=o===void 0?"sm":o,i=a==="xs"?"size-5":"size-6",l=a==="xs"?"text-[9px]":"text-xs";let c;e[0]!==i?(c=U(i,"shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=i,e[1]=c):c=e[1];let r;e[2]!==s.logo||e[3]!==s.name?(r=s.logo?void 0:gs(s.name),e[2]=s.logo,e[3]=s.name,e[4]=r):r=e[4];let u;e[5]!==s.logo||e[6]!==s.name||e[7]!==l?(u=s.logo?t.jsx("img",{src:s.logo,alt:"",className:"size-full object-cover"}):t.jsx("span",{className:U("font-semibold leading-none",l),children:s.name.slice(0,2).toUpperCase()}),e[5]=s.logo,e[6]=s.name,e[7]=l,e[8]=u):u=e[8];let m;return e[9]!==c||e[10]!==r||e[11]!==u?(m=t.jsx("div",{className:c,style:r,children:u}),e[9]=c,e[10]=r,e[11]=u,e[12]=m):m=e[12],m}function hs({invitation:n,onChanged:e}){const s=F(),[o,a]=R.useState(!1),i=n.organizationName??s("header.orgSwitcher.unknownOrganization"),l=async()=>{a(!0);try{const u=await re.organization.acceptInvitation({invitationId:n.id});if(u.error){K.error(u.error.message),a(!1);return}}catch{K.error(s("header.orgSwitcher.failedToAcceptInvitation")),a(!1);return}K.success(s("header.orgSwitcher.joined",{name:i})),Yt();let r;try{r=(await re.organization.getFullOrganization({query:{organizationId:n.organizationId}}))?.data?.slug}catch{}window.location.href=r?`/${r}`:"/"},c=async()=>{a(!0);try{const r=await re.organization.rejectInvitation({invitationId:n.id});if(r.error){K.error(r.error.message),a(!1);return}K.success(s("header.orgSwitcher.invitationDeclined")),a(!1),e()}catch{K.error(s("header.orgSwitcher.failedToDeclineInvitation")),a(!1)}};return t.jsxs("div",{className:"flex items-center gap-3 rounded-md border border-dashed border-border px-3 py-2.5",children:[t.jsx(it,{org:{name:i},size:"sm"}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("p",{className:"truncate text-sm font-medium",children:i}),t.jsx("p",{className:"truncate text-xs text-muted-foreground",children:s("header.orgSwitcher.invitedToJoin")})]}),t.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[t.jsx(te,{size:"sm",variant:"default",className:"h-7 text-xs",onClick:l,disabled:o,children:s("header.orgSwitcher.accept")}),t.jsx(te,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground",onClick:c,disabled:o,"aria-label":s("header.orgSwitcher.declineInvitationTo",{name:i}),children:t.jsx(It,{size:14})})]})]})}function ps(n){const e=O.c(32),{orgParam:s,onSelectOrg:o,onCreateOrg:a}=n,i=F(),{data:l}=Wt(),{invitations:c,refetch:r}=Ut();let u;e[0]!==s?(u=(k,A)=>k.slug===s?-1:A.slug===s?1:k.name.localeCompare(A.name),e[0]=s,e[1]=u):u=e[1];const m=[...l??[]].sort(u),[f,d]=R.useState(""),g=f.toLowerCase(),b=g?m.filter(k=>k.name.toLowerCase().includes(g)||k.slug.toLowerCase().includes(g)):m;let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(kt,{size:16,className:"shrink-0 text-muted-foreground/60"}),e[2]=h):h=e[2];let p;e[3]===Symbol.for("react.memo_cache_sentinel")?(p=k=>d(k.target.value),e[3]=p):p=e[3];let j;e[4]!==f?(j=k=>k.key==="Escape"&&f&&d(""),e[4]=f,e[5]=j):j=e[5];let v;e[6]!==i?(v=i("header.orgSwitcher.searchOrganizations"),e[6]=i,e[7]=v):v=e[7];let C;e[8]!==f||e[9]!==j||e[10]!==v?(C=t.jsx("input",{"data-org-switcher-search":!0,autoFocus:!0,type:"text",value:f,onChange:p,onKeyDown:j,placeholder:v,className:"flex-1 min-w-0 bg-transparent text-sm outline-none placeholder:text-muted-foreground/60"}),e[8]=f,e[9]=j,e[10]=v,e[11]=C):C=e[11];let _;e[12]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(we,{size:16}),e[12]=_):_=e[12];let S;e[13]!==a?(S=t.jsx("button",{type:"button",onClick:a,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:_}),e[13]=a,e[14]=S):S=e[14];let I;e[15]!==C||e[16]!==S?(I=t.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5 border-b border-border/50",children:[h,C,S]}),e[15]=C,e[16]=S,e[17]=I):I=e[17];const L="flex-1 min-h-0 overflow-y-auto p-1.5 flex flex-col gap-1";let x;e[18]!==c||e[19]!==f||e[20]!==r?(x=!f&&c.map(k=>t.jsx(hs,{invitation:k,onChanged:r},k.id)),e[18]=c,e[19]=f,e[20]=r,e[21]=x):x=e[21];const D=b.length===0&&t.jsx("p",{className:"px-3 py-4 text-sm text-muted-foreground/60 text-center",children:f?i("header.orgSwitcher.noOrganizationsMatch",{query:f}):i("header.orgSwitcher.noOrganizationsAvailable")});let P;e[22]!==o||e[23]!==s?(P=k=>t.jsxs("button",{type:"button",onClick:()=>o(k.slug),className:U("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",k.slug===s?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50"),children:[t.jsx(it,{org:k,size:"sm"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:k.name}),t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:k.slug})]}),k.slug===s&&t.jsx(Ve,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},k.id),e[22]=o,e[23]=s,e[24]=P):P=e[24];const N=b.map(P);let y;e[25]!==x||e[26]!==D||e[27]!==N?(y=t.jsxs("div",{className:L,children:[x,D,N]}),e[25]=x,e[26]=D,e[27]=N,e[28]=y):y=e[28];let T;return e[29]!==y||e[30]!==I?(T=t.jsxs(t.Fragment,{children:[I,y]}),e[29]=y,e[30]=I,e[31]=T):T=e[31],T}function xs(n){const e=O.c(22),{trigger:s,orgParam:o,align:a,side:i}=n,l=a===void 0?"start":a,c=i===void 0?"bottom":i,r=ot(),[u,m]=R.useState(!1),[f,d]=R.useState(!1);let g;e[0]!==s?(g=t.jsx(Re,{asChild:!0,children:s}),e[0]=s,e[1]=g):g=e[1];const b=String(u);let h;e[2]!==r?(h=I=>{m(!1),r({to:"/$org",params:{org:I}})},e[2]=r,e[3]=h):h=e[3];let p;e[4]===Symbol.for("react.memo_cache_sentinel")?(p=()=>{m(!1),d(!0)},e[4]=p):p=e[4];let j;e[5]!==o||e[6]!==b||e[7]!==h?(j=t.jsx(ps,{orgParam:o,onSelectOrg:h,onCreateOrg:p},b),e[5]=o,e[6]=b,e[7]=h,e[8]=j):j=e[8];let v;e[9]!==l||e[10]!==c||e[11]!==j?(v=t.jsx(St,{side:c,align:l,sideOffset:8,collisionPadding:16,className:"w-[300px] p-0 flex flex-col max-h-[440px]",onOpenAutoFocus:vs,onCloseAutoFocus:js,children:j}),e[9]=l,e[10]=c,e[11]=j,e[12]=v):v=e[12];let C;e[13]!==u||e[14]!==g||e[15]!==v?(C=t.jsxs(Dt,{open:u,onOpenChange:m,children:[g,v]}),e[13]=u,e[14]=g,e[15]=v,e[16]=C):C=e[16];let _;e[17]!==f?(_=t.jsx(hn,{open:f,onOpenChange:d}),e[17]=f,e[18]=_):_=e[18];let S;return e[19]!==_||e[20]!==C?(S=t.jsxs(t.Fragment,{children:[C,_]}),e[19]=_,e[20]=C,e[21]=S):S=e[21],S}function js(n){return n.preventDefault()}function vs(n){n.preventDefault(),n.currentTarget?.querySelector("[data-org-switcher-search]")?.focus()}function bs(n){const e=O.c(21),{value:s,onChange:o,placeholder:a,onKeyDown:i,className:l,isSearching:c,disabled:r}=n,u=a===void 0?"Search...":a;let m;e[0]!==l?(m=U("shrink-0 w-full border-b border-border h-12",l),e[0]=l,e[1]=m):m=e[1];const f=r?"cursor-not-allowed opacity-50":"cursor-text";let d;e[2]!==f?(d=U("flex items-center gap-2.5 h-12 px-4",f),e[2]=f,e[3]=d):d=e[3];let g;e[4]!==c?(g=c?t.jsx(Ie,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):t.jsx(kt,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=c,e[5]=g):g=e[5];let b;e[6]!==o?(b=v=>o(v.target.value),e[6]=o,e[7]=b):b=e[7];let h;e[8]!==r||e[9]!==i||e[10]!==u||e[11]!==b||e[12]!==s?(h=t.jsx("input",{type:"text",value:s,onChange:b,onKeyDown:i,placeholder:u,disabled:r,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=r,e[9]=i,e[10]=u,e[11]=b,e[12]=s,e[13]=h):h=e[13];let p;e[14]!==d||e[15]!==g||e[16]!==h?(p=t.jsxs("label",{className:d,children:[g,h]}),e[14]=d,e[15]=g,e[16]=h,e[17]=p):p=e[17];let j;return e[18]!==m||e[19]!==p?(j=t.jsx("div",{className:m,children:p}),e[18]=m,e[19]=p,e[20]=j):j=e[20],j}function Cs(n,e,s){if(!s)return null;const o=kn(n,e);return o?o.threads.get().find(i=>i.id===s)?.branch??null:null}function ys(n){const e=O.c(6),{value:s,onChange:o}=n,a=F();let i;e[0]!==a?(i=a("sidebar.agentsSection.searchAgents"),e[0]=a,e[1]=i):i=e[1];let l;return e[2]!==o||e[3]!==i||e[4]!==s?(l=t.jsx(bs,{value:s,onChange:o,placeholder:i}),e[2]=o,e[3]=i,e[4]=s,e[5]=l):l=e[5],l}function Ns(){const n=O.c(4),e=F();let s;n[0]!==e?(s=e("sidebar.agentsSection.noAgentsFound"),n[0]=e,n[1]=s):s=n[1];let o;return n[2]!==s?(o=t.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:s}),n[2]=s,n[3]=o):o=n[3],o}function ws(n){const e=O.c(10),{org:s,onClose:o}=n,a=F();let i;e[0]!==s.slug?(i={org:s.slug},e[0]=s.slug,e[1]=i):i=e[1];let l;e[2]!==o?(l=()=>o(),e[2]=o,e[3]=l):l=e[3];let c;e[4]!==a?(c=a("sidebar.agentsSection.seeAllAgents"),e[4]=a,e[5]=c):c=e[5];let r;return e[6]!==i||e[7]!==l||e[8]!==c?(r=t.jsx("div",{className:"border-t border-border px-3 py-2.5",children:t.jsx(Zt,{to:"/$org/settings/agents",params:i,onClick:l,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:c})}),e[6]=i,e[7]=l,e[8]=c,e[9]=r):r=e[9],r}function _s(){const n=O.c(4),e=F();let s;n[0]!==e?(s=e("sidebar.agentsSection.agents"),n[0]=e,n[1]=s):s=n[1];let o;return n[2]!==s?(o=t.jsx(Ht,{children:s}),n[2]=s,n[3]=o):o=n[3],o}function Ss(n){const e=O.c(11),{onImportFromGithub:s}=n,o=F();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(Dn,{className:"size-3.5"}),e[0]=a):a=e[0];let i;e[1]!==o?(i=o("sidebar.agentsSection.import"),e[1]=o,e[2]=i):i=e[2];let l;e[3]!==s||e[4]!==i?(l=t.jsxs("button",{type:"button",onClick:s,className:"flex items-center gap-1.5 rounded-md px-2 py-1 text-xs font-medium text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground",children:[a,i]}),e[3]=s,e[4]=i,e[5]=l):l=e[5];let c;e[6]!==o?(c=o("sidebar.agentsSection.codeAgents"),e[6]=o,e[7]=c):c=e[7];let r;return e[8]!==l||e[9]!==c?(r=t.jsx(Ht,{action:l,children:c}),e[8]=l,e[9]=c,e[10]=r):r=e[10],r}function Ds(n){const e=O.c(11),{setOpen:s,emptyCtaClass:o}=n,a=F();let i;e[0]!==a?(i=a("sidebar.agentsSection.browseAgents"),e[0]=a,e[1]=i):i=e[1];let l;e[2]!==o?(l=U(o),e[2]=o,e[3]=l):l=e[3];let c;e[4]!==s?(c=()=>{B("agent_browser_opened",{surface:"mobile_drawer"}),s(!0)},e[4]=s,e[5]=c):c=e[5];let r;e[6]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(we,{className:"size-4"}),e[6]=r):r=e[6];let u;return e[7]!==i||e[8]!==l||e[9]!==c?(u=t.jsx(At,{"aria-label":i,className:l,onClick:c,children:r}),e[7]=i,e[8]=l,e[9]=c,e[10]=u):u=e[10],u}function ks(n){const e=O.c(17),{setOpen:s,highlightEmpty:o,emptyCtaClass:a}=n,i=F();let l;e[0]!==o||e[1]!==i?(l=o?void 0:i("sidebar.agentsSection.browseAgents"),e[0]=o,e[1]=i,e[2]=l):l=e[2];let c;e[3]!==a?(c=U(a),e[3]=a,e[4]=c):c=e[4];let r;e[5]!==s?(r=()=>{B("agent_browser_opened",{surface:"mobile_drawer"}),s(!0)},e[5]=s,e[6]=r):r=e[6];let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(we,{}),e[7]=u):u=e[7];let m;e[8]!==i?(m=i("sidebar.agentsSection.newAgent"),e[8]=i,e[9]=m):m=e[9];let f;e[10]!==m?(f=t.jsx("span",{children:m}),e[10]=m,e[11]=f):f=e[11];let d;return e[12]!==l||e[13]!==c||e[14]!==r||e[15]!==f?(d=t.jsx(pt,{children:t.jsxs(xt,{tooltip:l,className:c,onClick:r,children:[u,f]})}),e[12]=l,e[13]=c,e[14]=r,e[15]=f,e[16]=d):d=e[16],d}function Is(){const n=O.c(4),e=F();let s;n[0]!==e?(s=e("sidebar.agentsSection.browseAgents"),n[0]=e,n[1]=s):s=n[1];let o;return n[2]!==s?(o=t.jsx(Ot,{className:"sr-only",children:s}),n[2]=s,n[3]=o):o=n[3],o}function As(n){const e=O.c(8),{emptyCtaClass:s}=n,o=F();let a;e[0]!==o?(a=o("sidebar.agentsSection.browseAgents"),e[0]=o,e[1]=a):a=e[1];let i;e[2]!==s?(i=U(s),e[2]=s,e[3]=i):i=e[3];let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(we,{className:"size-4"}),e[4]=l):l=e[4];let c;return e[5]!==a||e[6]!==i?(c=t.jsx(At,{"aria-label":a,className:i,children:l}),e[5]=a,e[6]=i,e[7]=c):c=e[7],c}function Ts(n){const e=O.c(19),{wrapEmptyHint:s,highlightEmpty:o,emptyCtaClass:a}=n,i=F();let l;e[0]!==o||e[1]!==i?(l=o?void 0:i("sidebar.agentsSection.browseAgents"),e[0]=o,e[1]=i,e[2]=l):l=e[2];let c;e[3]!==a?(c=U(a),e[3]=a,e[4]=c):c=e[4];let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(we,{}),e[5]=r):r=e[5];let u;e[6]!==i?(u=i("sidebar.agentsSection.newAgent"),e[6]=i,e[7]=u):u=e[7];let m;e[8]!==u?(m=t.jsx("span",{children:u}),e[8]=u,e[9]=m):m=e[9];let f;e[10]!==l||e[11]!==c||e[12]!==m?(f=t.jsx(Re,{asChild:!0,children:t.jsxs(xt,{tooltip:l,className:c,children:[r,m]})}),e[10]=l,e[11]=c,e[12]=m,e[13]=f):f=e[13];let d;e[14]!==f||e[15]!==s?(d=s(f),e[14]=f,e[15]=s,e[16]=d):d=e[16];let g;return e[17]!==d?(g=t.jsx(pt,{children:d}),e[17]=d,e[18]=g):g=e[18],g}function Ps(n){const e=O.c(9),{children:s}=n,o=F();let a;e[0]!==s?(a=t.jsx(Ce,{asChild:!0,children:s}),e[0]=s,e[1]=a):a=e[1];let i;e[2]!==o?(i=o("sidebar.agentsSection.selectAnExistingAgent"),e[2]=o,e[3]=i):i=e[3];let l;e[4]!==i?(l=t.jsx(ye,{side:"right",sideOffset:8,children:i}),e[4]=i,e[5]=l):l=e[5];let c;return e[6]!==a||e[7]!==l?(c=t.jsxs(Ne,{defaultOpen:!0,delayDuration:0,children:[a,l]}),e[6]=a,e[7]=l,e[8]=c):c=e[8],c}function Os(n){const e=ot(),{create:s}=In(),{locator:o}=oe(),a=yt(),i=bn();return async l=>{const c=crypto.randomUUID(),r=l===i?Cs(n,o,a??""):null;try{await s({id:c,virtual_mcp_id:l,...r?{branch:r}:{}})}catch{}e({to:"/$org/$taskId",params:{org:n,taskId:c},search:{virtualmcpid:l}})}}function st(n){const e=O.c(20),{agent:s,selected:o,onClick:a}=n,i=o?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50";let l;e[0]!==i?(l=U("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",i),e[0]=i,e[1]=l):l=e[1];let c;e[2]!==s.icon||e[3]!==s.title?(c=t.jsx(Ct,{icon:s.icon,name:s.title,size:"xs",className:"shrink-0"}),e[2]=s.icon,e[3]=s.title,e[4]=c):c=e[4];let r;e[5]!==s.title?(r=t.jsx("p",{className:"text-sm font-medium truncate",children:s.title}),e[5]=s.title,e[6]=r):r=e[6];let u;e[7]!==s.description?(u=s.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s.description}),e[7]=s.description,e[8]=u):u=e[8];let m;e[9]!==r||e[10]!==u?(m=t.jsxs("div",{className:"flex-1 min-w-0",children:[r,u]}),e[9]=r,e[10]=u,e[11]=m):m=e[11];let f;e[12]!==o?(f=o&&t.jsx(Ve,{size:14,className:"ml-auto text-muted-foreground shrink-0"}),e[12]=o,e[13]=f):f=e[13];let d;return e[14]!==a||e[15]!==l||e[16]!==c||e[17]!==m||e[18]!==f?(d=t.jsxs("button",{type:"button",onClick:a,className:l,children:[c,m,f]}),e[14]=a,e[15]=l,e[16]=c,e[17]=m,e[18]=f,e[19]=d):d=e[19],d}function Ht(n){const e=O.c(5),{children:s,action:o}=n;let a;e[0]!==s?(a=t.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:s}),e[0]=s,e[1]=a):a=e[1];let i;return e[2]!==o||e[3]!==a?(i=t.jsxs("div",{className:"flex items-center justify-between px-3 pb-1 pt-2",children:[a,o]}),e[2]=o,e[3]=a,e[4]=i):i=e[4],i}function zs(n){const e=O.c(23),{onClose:s,onSelectAgent:o,selectedAgentId:a,onImportFromGithub:i}=n,[l,c]=R.useState(""),r=_t(),u=r??[],{org:m}=oe(),{data:f}=re.useSession(),d=f?.user?.id??"anon",g=Tn(r),b=Pn(),h=Os(m.slug),p=Mn(r),j=l.toLowerCase(),v=u.filter(Ls).filter($=>!p.has($.id)).filter(Fs).filter($=>!l||$.title.toLowerCase().includes(j)),C=v.filter($s),_=v.filter(Ms),S=bt(m.id),I=!l||S.title.toLowerCase().includes(j),L=!!(o&&I);let x;e[0]!==s||e[1]!==o?(x=()=>{o?.(null),s(),c("")},e[0]=s,e[1]=o,e[2]=x):x=e[2];const D=x,P=$=>{if(o){o($.id),s(),c("");return}On({orgId:m.id,userId:d},$.id,g),b(),s(),c(""),h($.id)},N="flex flex-col max-h-[min(640px,80dvh)]";let y;e[3]!==l?(y=t.jsx(ys,{value:l,onChange:c}),e[3]=l,e[4]=y):y=e[4];const T="overflow-y-auto flex-1 min-h-0 p-1.5 flex flex-col gap-0.5",k=o&&I&&S&&t.jsx(st,{agent:S,selected:!a||a===S.id,onClick:D}),A=(C.length>0||!l)&&t.jsx(Ss,{onImportFromGithub:i}),z=C.map($=>t.jsx(st,{agent:$,selected:o?a===$.id:void 0,onClick:()=>P($)},$.id)),V=_.length>0&&t.jsx(_s,{}),X=_.map($=>t.jsx(st,{agent:$,selected:o?a===$.id:void 0,onClick:()=>P($)},$.id));let E;e[5]!==L||e[6]!==l||e[7]!==v.length?(E=v.length===0&&!L&&l&&t.jsx(Ns,{}),e[5]=L,e[6]=l,e[7]=v.length,e[8]=E):E=e[8];let ne;e[9]!==E||e[10]!==k||e[11]!==A||e[12]!==z||e[13]!==V||e[14]!==X?(ne=t.jsxs("div",{className:T,children:[k,A,z,V,X,E]}),e[9]=E,e[10]=k,e[11]=A,e[12]=z,e[13]=V,e[14]=X,e[15]=ne):ne=e[15];let q;e[16]!==s||e[17]!==m?(q=t.jsx(ws,{org:m,onClose:s}),e[16]=s,e[17]=m,e[18]=q):q=e[18];let de;return e[19]!==ne||e[20]!==q||e[21]!==y?(de=t.jsxs("div",{className:N,children:[y,ne,q]}),e[19]=ne,e[20]=q,e[21]=y,e[22]=de):de=e[22],de}function Ms(n){return!Mt(n.metadata)}function $s(n){return Mt(n.metadata)}function Fs(n){return!mn(n.id)}function Ls(n){return!un(n.id)}function Es(n){const e=O.c(31);let s;e[0]!==n?(s=n===void 0?{}:n,e[0]=n,e[1]=s):s=e[1];const{compact:o,trigger:a,onSelectAgent:i,selectedAgentId:l,side:c,align:r}=s,u=o===void 0?!1:o,m=c===void 0?"right":c,f=r===void 0?"start":r,[d,g]=R.useState(!1),[b,h]=R.useState(!1),p=gt(),{setOpenMobile:j}=ht(),v=An(),C=v?"border border-border":void 0;let _;e[2]!==v?(_=A=>v?t.jsx(Ps,{children:A}):A,e[2]=v,e[3]=_):_=e[3];const S=_;let I;e[4]!==p||e[5]!==j?(I=()=>{g(!1),p&&j(!1)},e[4]=p,e[5]=j,e[6]=I):I=e[6];const L=I;let x;e[7]!==L?(x=()=>{L(),h(!0)},e[7]=L,e[8]=x):x=e[8];const D=x;let P;e[9]!==L||e[10]!==D||e[11]!==i||e[12]!==d||e[13]!==l?(P=d&&t.jsx(R.Suspense,{fallback:t.jsx("div",{className:"flex items-center justify-center py-8",children:t.jsx(Jt,{className:"h-4 w-24"})}),children:t.jsx(zs,{onClose:L,onSelectAgent:i,selectedAgentId:l,onImportFromGithub:D})}),e[9]=L,e[10]=D,e[11]=i,e[12]=d,e[13]=l,e[14]=P):P=e[14];const N=P;let y;e[15]!==f||e[16]!==u||e[17]!==C||e[18]!==v||e[19]!==p||e[20]!==d||e[21]!==N||e[22]!==m||e[23]!==a||e[24]!==S?(y=p?t.jsxs(t.Fragment,{children:[a?t.jsx("button",{type:"button",onClick:()=>g(!0),className:"contents",children:a}):u?S(t.jsx(Ds,{setOpen:g,emptyCtaClass:C})):t.jsx(ks,{setOpen:g,highlightEmpty:v,emptyCtaClass:C}),t.jsx(Tt,{open:d,onOpenChange:g,direction:"bottom",children:t.jsxs(Pt,{className:"max-h-[85dvh] p-0",children:[t.jsx(Is,{}),N]})})]}):t.jsxs(Dt,{open:d,onOpenChange:A=>{A&&!d&&B("agent_browser_opened",{surface:"desktop_popover"}),g(A)},children:[a?t.jsx(Re,{asChild:!0,children:a}):u?S(t.jsx(Re,{asChild:!0,children:t.jsx(As,{emptyCtaClass:C})})):t.jsx(Ts,{wrapEmptyHint:S,highlightEmpty:v,emptyCtaClass:C}),t.jsx(St,{className:"w-[380px] p-0 overflow-hidden",side:m,align:f,children:N})]}),e[15]=f,e[16]=u,e[17]=C,e[18]=v,e[19]=p,e[20]=d,e[21]=N,e[22]=m,e[23]=a,e[24]=S,e[25]=y):y=e[25];let T;e[26]!==b?(T=t.jsx(Sn,{open:b,onOpenChange:h,mode:"agent"}),e[26]=b,e[27]=T):T=e[27];let k;return e[28]!==T||e[29]!==y?(k=t.jsxs(t.Fragment,{children:[y,T]}),e[28]=T,e[29]=y,e[30]=k):k=e[30],k}function Bs(){const n=O.c(2),e=_t()??[];let s;return n[0]!==e?(s=o=>{if(!o)return;const a=e.find(i=>i.id===o);return a?$n(a.metadata):void 0},n[0]=e,n[1]=s):s=n[1],s}const Rs="inline-flex items-center gap-1.5 min-w-0 rounded-md pl-1 pr-2 py-1.5 text-sm text-foreground hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50";function Vs(n){const e=O.c(29),{agentId:s,fallback:o,onOpenHome:a,onPick:i}=n,l=F(),c=Cn(s)??o??null;let r,u,m,f,d;e[0]!==c?.title||e[1]!==a||e[2]!==l?(d=c?.title??l("header.shellBreadcrumb.superAgentDefaultName"),f="flex min-w-0 items-center gap-0",r="button",u=a,m=l("header.shellBreadcrumb.openAgentHome",{name:d}),e[0]=c?.title,e[1]=a,e[2]=l,e[3]=r,e[4]=u,e[5]=m,e[6]=f,e[7]=d):(r=e[3],u=e[4],m=e[5],f=e[6],d=e[7]);const g=c?.icon??null;let b;e[8]!==g||e[9]!==d?(b=t.jsx(Ct,{icon:g,name:d,size:"xs"}),e[8]=g,e[9]=d,e[10]=b):b=e[10];let h;e[11]!==r||e[12]!==u||e[13]!==m||e[14]!==b?(h=t.jsx("button",{type:r,onClick:u,"aria-label":m,className:"flex items-center shrink-0 rounded-md p-1 hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:b}),e[11]=r,e[12]=u,e[13]=m,e[14]=b,e[15]=h):h=e[15];let p;e[16]!==d?(p=t.jsx("span",{className:"truncate font-medium max-w-[8rem]",children:d}),e[16]=d,e[17]=p):p=e[17];let j;e[18]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(wt,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[18]=j):j=e[18];let v;e[19]!==p?(v=t.jsxs("button",{type:"button",className:Rs,children:[p,j]}),e[19]=p,e[20]=v):v=e[20];let C;e[21]!==s||e[22]!==i||e[23]!==v?(C=t.jsx(Es,{side:"bottom",align:"start",selectedAgentId:s,onSelectAgent:i,trigger:v}),e[21]=s,e[22]=i,e[23]=v,e[24]=C):C=e[24];let _;return e[25]!==C||e[26]!==f||e[27]!==h?(_=t.jsxs("div",{className:f,children:[h,C]}),e[25]=C,e[26]=f,e[27]=h,e[28]=_):_=e[28],_}function Yo(n){const e=O.c(30);let s;e[0]!==n?(s=n===void 0?{}:n,e[0]=n,e[1]=s):s=e[1];const{showName:o}=s,a=F(),{org:i}=oe(),{state:l,isMobile:c}=ht(),r=Ut().invitations.length>0,u=l==="collapsed"||c;let m;e[2]!==r||e[3]!==i.name||e[4]!==a?(m=r?a("header.shellBreadcrumb.switchOrganizationPendingInvitation",{name:i.name}):a("header.shellBreadcrumb.switchOrganization",{name:i.name}),e[2]=r,e[3]=i.name,e[4]=a,e[5]=m):m=e[5];let f;e[6]!==i?(f=t.jsx(it,{org:i,size:"sm"}),e[6]=i,e[7]=f):f=e[7];let d;e[8]!==r||e[9]!==u?(d=r&&t.jsx("span",{className:U("absolute -right-1 size-2.5 rounded-full bg-destructive ring-2 ring-background",u?"-top-1":"top-1/2 -translate-y-1/2")}),e[8]=r,e[9]=u,e[10]=d):d=e[10];let g;e[11]!==f||e[12]!==d?(g=t.jsxs("span",{className:"relative inline-flex",children:[f,d]}),e[11]=f,e[12]=d,e[13]=g):g=e[13];let b;e[14]!==i.name||e[15]!==o?(b=o&&t.jsx("span",{className:"truncate text-sm font-medium text-foreground max-w-[10rem]",children:i.name}),e[14]=i.name,e[15]=o,e[16]=b):b=e[16];let h;e[17]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(wt,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[17]=h):h=e[17];let p;e[18]!==m||e[19]!==g||e[20]!==b?(p=t.jsx(Ce,{asChild:!0,children:t.jsxs("button",{type:"button","aria-label":m,className:"flex items-center gap-1.5 shrink-0 rounded-lg pl-[5px] pr-1.5 py-1.5 hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:[g,b,h]})}),e[18]=m,e[19]=g,e[20]=b,e[21]=p):p=e[21];let j;e[22]!==i.slug||e[23]!==p?(j=t.jsx(xs,{orgParam:i.slug,trigger:p}),e[22]=i.slug,e[23]=p,e[24]=j):j=e[24];let v;e[25]!==i.name?(v=t.jsx(ye,{side:"bottom",children:i.name}),e[25]=i.name,e[26]=v):v=e[26];let C;return e[27]!==v||e[28]!==j?(C=t.jsxs(Ne,{children:[j,v]}),e[27]=v,e[28]=j,e[29]=C):C=e[29],C}function Jo(n){const e=O.c(21);let s;e[0]!==n?(s=n===void 0?{}:n,e[0]=n,e[1]=s):s=e[1];const{onNavigate:o}=s,{org:a}=oe(),{threads:i}=zt(),{data:l}=re.useSession(),{setTaskId:c,createNewTask:r}=$t(),u=Bs();let m;e[2]!==a.id?(m=bt(a.id),e[2]=a.id,e[3]=m):m=e[3];const f=m,d=f.id,g=Nt();let b;e[4]!==r||e[5]!==d||e[6]!==o||e[7]!==u||e[8]!==l?.user?.id||e[9]!==c||e[10]!==i?(b=_=>{const S=_??d,I=zn(i,S,l?.user?.id,u(S));I?c(I.id,S):r(S),o?.()},e[4]=r,e[5]=d,e[6]=o,e[7]=u,e[8]=l?.user?.id,e[9]=c,e[10]=i,e[11]=b):b=e[11];const h=b;let p;e[12]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("span",{className:"h-5 w-24 rounded bg-muted animate-pulse"}),e[12]=p):p=e[12];const j=g===d?f:void 0;let v;e[13]!==g||e[14]!==h?(v=()=>h(g),e[13]=g,e[14]=h,e[15]=v):v=e[15];let C;return e[16]!==g||e[17]!==h||e[18]!==j||e[19]!==v?(C=t.jsx(R.Suspense,{fallback:p,children:t.jsx(Vs,{agentId:g,fallback:j,onOpenHome:v,onPick:h})}),e[16]=g,e[17]=h,e[18]=j,e[19]=v,e[20]=C):C=e[20],C}function Zo(){const n=O.c(20),e=F(),{threads:s}=zt(),{createNewTask:o}=$t(),a=Nt(),i=yt();let l;n[0]!==i||n[1]!==s?(l=s.find(p=>p.id===i)?.branch??null,n[0]=i,n[1]=s,n[2]=l):l=n[2];const c=l;let r;n[3]!==a||n[4]!==o||n[5]!==c?(r=()=>{o(a,c)},n[3]=a,n[4]=o,n[5]=c,n[6]=r):r=n[6];const u=r;let m;n[7]!==e?(m=e("sidebar.taskGroupsList.newChat"),n[7]=e,n[8]=m):m=n[8];let f;n[9]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(vn,{size:16}),n[9]=f):f=n[9];let d;n[10]!==u||n[11]!==m?(d=t.jsx(Ce,{asChild:!0,children:t.jsx("button",{type:"button",onClick:u,"aria-label":m,className:"flex shrink-0 items-center rounded-md p-1.5 text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:f})}),n[10]=u,n[11]=m,n[12]=d):d=n[12];let g;n[13]!==e?(g=e("sidebar.taskGroupsList.newChat"),n[13]=e,n[14]=g):g=n[14];let b;n[15]!==g?(b=t.jsx(ye,{side:"bottom",children:g}),n[15]=g,n[16]=b):b=n[16];let h;return n[17]!==d||n[18]!==b?(h=t.jsxs(Ne,{children:[d,b]}),n[17]=d,n[18]=b,n[19]=h):h=n[19],h}function Ks({open:n,onOpenChange:e,onCreated:s}){const o=F(),{org:a}=oe(),{data:i}=re.useSession(),{stdioEnabled:l}=en(),c=gt(),r=Kt(),u=Ft(),f=Lt(u,"").items,d=tn({resolver:nn(Yn),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),g=d.watch("ui_type"),b=d.watch("connection_url"),h=d.watch("npx_package"),p=Le({uiType:g,connectionUrl:b??"",npxPackage:h??""})??ut({uiType:g,connectionUrl:b??"",registryItems:f}),j=x=>{const D=x.trim();if(!D)return;const P=!!d.formState.dirtyFields.title,N=!!d.formState.dirtyFields.description,y=!!d.formState.dirtyFields.env_vars,T=A=>{if(A&&(!P&&!d.getValues("title").trim()&&A.title&&d.setValue("title",A.title,{shouldDirty:!1}),!N&&!(d.getValues("description")??"").trim()&&A.description&&d.setValue("description",A.description,{shouldDirty:!1}),!y&&A.envVarKeys?.length)){const z=d.getValues("env_vars")??[],V=new Set(z.map(E=>E.key)),X=A.envVarKeys.filter(E=>!V.has(E));X.length>0&&d.setValue("env_vars",[...z,...X.map(E=>({key:E,value:""}))],{shouldDirty:!0})}},k=Zn(D);if(k&&l){d.setValue("ui_type","NPX",{shouldDirty:!0}),d.setValue("npx_package",k.packageName,{shouldDirty:!0}),d.setValue("connection_url","",{shouldDirty:!0}),d.setValue("connection_token",null,{shouldDirty:!0}),T(Le({uiType:"NPX",npxPackage:k.packageName}));return}if(D.startsWith("http://")||D.startsWith("https://")){const A=g==="HTTP"||g==="SSE"||g==="Websocket"?g:"HTTP";d.setValue("ui_type",A,{shouldDirty:!0}),d.setValue("connection_url",D,{shouldDirty:!0}),T(Le({uiType:A,connectionUrl:D})??ut({uiType:A,connectionUrl:D,registryItems:f}));return}g==="NPX"&&T(Le({uiType:"NPX",npxPackage:D}))},v=x=>{x||d.reset(),e(x)},C=async x=>{let D,P=null,N=null,y=null;x.ui_type==="NPX"?(D="STDIO",P="",y=es(x.npx_package||"",x.env_vars||[])):x.ui_type==="STDIO"?(D="STDIO",P="",y=ts(x.stdio_command||"",x.stdio_args||"",x.stdio_cwd,x.env_vars||[])):(D=x.ui_type,P=x.connection_url||"",N=x.connection_token||null);const T=Ln("conn");try{await r.create.mutateAsync({id:T,title:x.title,description:x.description||null,connection_type:D,connection_url:P,connection_token:N,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:i?.user?.id||"system",organization_id:a.id,icon:x.icon??null,app_name:null,app_id:null,connection_headers:y,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),d.reset(),e(!1),s?.(T)}catch{K.error(o("connections.createConnectionDialog.failedToCreateConnection"))}},_=o("connections.createConnectionDialog.title"),S=o("connections.createConnectionDialog.description"),I=d.formState.isSubmitting?o("connections.createConnectionDialog.saving"):o("connections.createConnectionDialog.createButton"),L=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(W,{control:d.control,name:"ui_type",render:({field:x})=>t.jsxs(Y,{children:[t.jsx(J,{children:o("connections.createConnectionDialog.typeLabel")}),t.jsxs(Hn,{value:x.value,onValueChange:x.onChange,children:[t.jsx(Z,{children:t.jsx(qn,{children:t.jsx(Gn,{})})}),t.jsxs(Xn,{children:[t.jsx(De,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ze,{className:"w-4 h-4"}),o("connections.createConnectionDialog.httpType")]})}),t.jsx(De,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ze,{className:"w-4 h-4"}),o("connections.createConnectionDialog.sseType")]})}),t.jsx(De,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ze,{className:"w-4 h-4"}),o("connections.createConnectionDialog.websocketType")]})}),l&&t.jsxs(t.Fragment,{children:[t.jsx(De,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Be,{className:"w-4 h-4"}),o("connections.createConnectionDialog.npxPackageType")]})}),t.jsx(De,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Wn,{className:"w-4 h-4"}),o("connections.createConnectionDialog.customCommandType")]})})]})]})]}),t.jsx(ee,{})]})}),g==="NPX"&&t.jsx(W,{control:d.control,name:"npx_package",render:({field:x})=>t.jsxs(Y,{children:[t.jsx(J,{children:o("connections.createConnectionDialog.npmPackageLabel")}),t.jsx(Z,{children:t.jsx(ce,{placeholder:o("connections.createConnectionDialog.npmPackagePlaceholder"),...x,value:x.value??"",onPaste:D=>{const P=D.clipboardData.getData("text");P&&(D.preventDefault(),d.setValue("npx_package",P.trim(),{shouldDirty:!0}),j(P))},onBlur:D=>{j(D.target.value),x.onBlur()}})}),t.jsx(ee,{})]})}),g==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(W,{control:d.control,name:"stdio_command",render:({field:x})=>t.jsxs(Y,{children:[t.jsx(J,{children:o("connections.createConnectionDialog.commandLabel")}),t.jsx(Z,{children:t.jsx(ce,{placeholder:o("connections.createConnectionDialog.commandPlaceholder"),...x,value:x.value??""})}),t.jsx(ee,{})]})}),t.jsx(W,{control:d.control,name:"stdio_args",render:({field:x})=>t.jsxs(Y,{children:[t.jsx(J,{children:o("connections.createConnectionDialog.argumentsLabel")}),t.jsx(Z,{children:t.jsx(ce,{placeholder:o("connections.createConnectionDialog.argumentsPlaceholder"),...x,value:x.value??""})}),t.jsx(ee,{})]})})]}),t.jsx(W,{control:d.control,name:"stdio_cwd",render:({field:x})=>t.jsxs(Y,{children:[t.jsx(J,{children:o("connections.createConnectionDialog.workingDirectoryLabel")}),t.jsx(Z,{children:t.jsx(ce,{placeholder:o("connections.createConnectionDialog.workingDirectoryPlaceholder"),...x,value:x.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:o("connections.createConnectionDialog.workingDirectoryDescription")}),t.jsx(ee,{})]})})]}),(g==="NPX"||g==="STDIO")&&t.jsx(W,{control:d.control,name:"env_vars",render:({field:x})=>t.jsxs(Y,{children:[t.jsx(J,{children:o("connections.createConnectionDialog.environmentVariablesLabel")}),t.jsx(Z,{children:t.jsx(Jn,{value:x.value??[],onChange:x.onChange})}),t.jsx(ee,{})]})}),g!=="NPX"&&g!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(W,{control:d.control,name:"connection_url",render:({field:x})=>t.jsxs(Y,{children:[t.jsx(J,{children:o("connections.createConnectionDialog.urlLabel")}),t.jsx(Z,{children:t.jsx(ce,{placeholder:o("connections.createConnectionDialog.urlPlaceholder"),...x,value:x.value??"",onPaste:D=>{const P=D.clipboardData.getData("text");P&&(D.preventDefault(),d.setValue("connection_url",P.trim(),{shouldDirty:!0}),j(P))},onBlur:D=>{j(D.target.value),x.onBlur()}})}),t.jsx(ee,{})]})}),t.jsx(W,{control:d.control,name:"connection_token",render:({field:x})=>t.jsxs(Y,{children:[t.jsx(J,{children:p?.token?.label??o("connections.createConnectionDialog.tokenLabelDefault")}),t.jsx(Z,{children:t.jsx(ce,{type:"password",placeholder:p?.token?.placeholder??o("connections.createConnectionDialog.tokenPlaceholderDefault"),className:"ph-no-capture",...x,value:x.value??""})}),p?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[p.token.helperText,p.id==="github"&&t.jsxs(t.Fragment,{children:[" ","·"," ",t.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:o("connections.createConnectionDialog.openGitHubPatSettings")})]})]}),t.jsx(ee,{})]})})]}),t.jsx(W,{control:d.control,name:"title",render:({field:x})=>t.jsxs(Y,{children:[t.jsx(J,{children:o("connections.createConnectionDialog.nameLabel")}),t.jsx(Z,{children:t.jsx(ce,{placeholder:o("connections.createConnectionDialog.namePlaceholder"),...x})}),t.jsx(ee,{})]})}),t.jsx(W,{control:d.control,name:"description",render:({field:x})=>t.jsxs(Y,{children:[t.jsx(J,{children:o("connections.createConnectionDialog.descriptionLabel")}),t.jsx(Z,{children:t.jsx(Qn,{placeholder:o("connections.createConnectionDialog.descriptionPlaceholder"),rows:3,...x,value:x.value??""})}),t.jsx(ee,{})]})})]});return c?t.jsx(Tt,{open:n,onOpenChange:v,children:t.jsxs(Pt,{className:"max-h-[90vh]",children:[t.jsx(yn,{className:"pb-2",children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"flex-1 text-left",children:[t.jsx(Ot,{children:_}),t.jsx(Nn,{className:"mt-1",children:S})]}),t.jsx(wn,{asChild:!0,children:t.jsx(te,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:t.jsx(It,{size:16})})})]})}),t.jsx(dt,{...d,children:t.jsxs("form",{onSubmit:d.handleSubmit(C),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:L}),t.jsx(_n,{children:t.jsx(te,{type:"submit",disabled:d.formState.isSubmitting,className:"w-full",children:I})})]})})]})}):t.jsx(Et,{open:n,onOpenChange:v,children:t.jsxs(Bt,{className:"sm:max-w-[525px]",children:[t.jsxs(Rt,{children:[t.jsx(Vt,{children:_}),t.jsx(Kn,{children:S})]}),t.jsx(dt,{...d,children:t.jsxs("form",{onSubmit:d.handleSubmit(C),children:[t.jsx("div",{className:"py-4",children:L}),t.jsxs(Un,{children:[t.jsx(te,{type:"button",variant:"outline",onClick:()=>v(!1),children:o("connections.createConnectionDialog.cancelButton")}),t.jsx(te,{type:"submit",disabled:d.formState.isSubmitting,className:"min-w-40",children:I})]})]})})]})})}function Us(n){const e=O.c(72),{mode:s,agentId:o,addedConnectionIds:a,onAdd:i,onCloneAndAdd:l,onConnectAndAdd:c,connectingItemId:r,search:u,onCreateConnection:m,onBrowseNavigate:f,defaultTab:d}=n,g=s===void 0?"add":s,b=d===void 0?"connected":d,h=F(),{org:p}=oe(),j=R.useDeferredValue(u),v=u!==j;let C;e[0]!==j?(C=j.trim().toLowerCase(),e[0]=j,e[1]=C):C=e[1];const _=C;let S;e[2]!==b?(S=w=>w??b,e[2]=b,e[3]=S):S=e[3];const[I,L]=sn(on.connectionsTab(p.slug)+(b==="all"?":home-modal":":agent-modal"),S);let x;e[4]!==I||e[5]!==L?(x=w=>{w!==I&&B("connections_dialog_tab_changed",{to_tab:w}),L(w)},e[4]=I,e[5]=L,e[6]=x):x=e[6];const D=x;let P;e[7]!==p.id||e[8]!==p.slug?(P={connectionId:vt,orgId:p.id,orgSlug:p.slug},e[7]=p.id,e[8]=p.slug,e[9]=P):P=e[9];const N=cn(P),y=j?.trim().split(/\s+/).filter(Boolean)??[],T=y.length>0?{operator:"or",conditions:y.flatMap(Js)}:void 0,k={...T&&{where:T},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:0},A=JSON.stringify(k),{data:z,fetchNextPage:V,hasNextPage:X,isFetchingNextPage:E}=os({queryKey:Ae.collectionListInfinite(N,p.id,"","CONNECTIONS",A),queryFn:async w=>{const{pageParam:M}=w,se=M===void 0?0:M;return(await N.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...T&&{where:T},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:se}})).structuredContent},initialPageParam:0,getNextPageParam:Ws,staleTime:3e4}),ne=z?.pages.flatMap(Qs)??[],q=Vn(ne),de=new Set(ne.filter(Xs).map(Gs)),$=Ft(),ie=Lt($,j),Ue=mt(ie.loadMore,ie.hasMore,ie.isLoadingMore),He=mt(V,X??!1,E),G=I==="all"||!!_,at=G?ie.items.filter(w=>{const M=En(w);if(M&&de.has(M))return!1;if(!_)return!0;const se=Ke(w._meta),ae=[w.title,w.description,w.name,w.server?.title,w.server?.description,w.server?.name,se?.friendly_name,se?.friendlyName].filter(Boolean).join(" ").toLowerCase();return y.some(Q=>ae.includes(Q.toLowerCase()))}):[],_e=at.filter(qs),Se=at.filter(Hs);let Te;e[10]!==a?(Te=w=>w.some(M=>a.has(M.id)),e[10]=a,e[11]=Te):Te=e[11];const qe=Te;let Pe;e[12]!==a||e[13]!==o||e[14]!==r||e[15]!==qe||e[16]!==g||e[17]!==i||e[18]!==f||e[19]!==l||e[20]!==h?(Pe=(w,M,se,ae,Q)=>{const Fe=qe(Q),be=Q.find(le=>!a.has(le.id)),H=Q[0];if(g==="browse"){const le=ns(H);return t.jsx(et,{connection:{title:M,icon:se,description:Q.length>1?`${Q.length} instances`:ae??void 0},fallbackIcon:t.jsx(Be,{}),headerActionsAlwaysVisible:!0,headerActions:t.jsxs(Ee,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[t.jsx(Ve,{size:11})," ",h("virtualMcp.connectionDialogContent.connected")]}),onClick:()=>{B("connection_browse_clicked",{app_name:H.app_name??null,connection_id:H.id,instances_count:Q.length}),f?.(le)}},w)}return t.jsx(et,{connection:{title:M,icon:se,description:ae},fallbackIcon:t.jsx(Be,{}),headerActionsAlwaysVisible:!0,headerActions:t.jsxs("div",{className:"flex items-center gap-1.5",children:[Fe&&t.jsxs(Ee,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[t.jsx(Ve,{size:11})," ",h("virtualMcp.connectionDialogContent.added")]}),t.jsx(te,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:r!==null,onClick:le=>{le.stopPropagation(),be?(B("connection_add_clicked",{action:"use_existing",app_name:H.app_name??null,connection_id:be.id}),o&&B("agent_connection_attached",{agent_id:o,connection_id:be.id,app_name:H.app_name??null,mode:"existing"}),i(be.id)):(B("connection_add_clicked",{action:"clone",app_name:H.app_name??null,base_connection_id:H.id}),l(H))},children:h("virtualMcp.connectionDialogContent.add")})]})},w)},e[12]=a,e[13]=o,e[14]=r,e[15]=qe,e[16]=g,e[17]=i,e[18]=f,e[19]=l,e[20]=h,e[21]=Pe):Pe=e[21];const Oe=Pe;let ze;e[22]!==r||e[23]!==g||e[24]!==c||e[25]!==h?(ze=w=>{const M=Ke(w._meta),se=M?.friendlyName||M?.friendly_name||w.server?.title||w.title||w.server?.name||w.name||w.id||"",ae=w.server?.description||w.description||null,Q=w.server?.icons?.[0]?.src||Bn(w.server?.repository)||null,Fe=M?.official===!0,be=M?.verified===!0,H=M?.owner==="deco";return t.jsx(et,{connection:{title:se,description:ae,icon:Q},fallbackIcon:t.jsx(Be,{}),headerActionsAlwaysVisible:!0,headerActions:t.jsxs("div",{className:"flex items-center gap-1.5",children:[H&&t.jsxs(Ne,{children:[t.jsx(Ce,{asChild:!0,children:t.jsx("span",{className:"inline-flex items-center justify-center size-5 rounded-md bg-muted shrink-0",children:t.jsx("img",{src:"/logos/deco logo.svg",alt:h("virtualMcp.connectionDialogContent.madeByDeco"),className:"size-3"})})}),t.jsx(ye,{children:h("virtualMcp.connectionDialogContent.builtByDeco")})]}),!H&&Fe&&t.jsxs(Ne,{children:[t.jsx(Ce,{asChild:!0,children:t.jsx(Ee,{variant:"outline",size:"icon",children:t.jsx(tt,{})})}),t.jsx(ye,{children:h("virtualMcp.connectionDialogContent.builtByOfficial")})]}),!H&&!Fe&&be&&t.jsxs(Ne,{children:[t.jsx(Ce,{asChild:!0,children:t.jsx(Ee,{variant:"outline",size:"icon",children:t.jsx(tt,{})})}),t.jsx(ye,{children:h("virtualMcp.connectionDialogContent.verifiedByDeco")})]}),t.jsx(te,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:r!==null,onClick:le=>{le.stopPropagation(),B("connection_add_clicked",{action:"connect_new",registry_item_id:w.id,app_name:M?.friendlyName||w.server?.name||w.name||null}),c(w)},children:r===w.id?t.jsx(Ie,{size:14,className:"animate-spin"}):h(g==="browse"?"virtualMcp.connectionDialogContent.connect":"virtualMcp.connectionDialogContent.add")})]})},`catalog-${w.id}`)},e[22]=r,e[23]=g,e[24]=c,e[25]=h,e[26]=ze):ze=e[26];const lt=ze;let ue;e[27]!==I||e[28]!==D||e[29]!==m||e[30]!==_||e[31]!==h?(ue=!_&&t.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border shrink-0",children:[t.jsx(ss,{tabs:[{id:"all",label:h("virtualMcp.connectionDialogContent.tabAll")},{id:"connected",label:h("virtualMcp.connectionDialogContent.tabConnected")}],activeTab:I,onTabChange:w=>D(w)}),t.jsxs(te,{variant:"outline",size:"sm",className:"h-7 px-2 text-sm",onClick:()=>{B("connections_dialog_custom_clicked"),m()},children:[t.jsx(we,{size:12}),h("virtualMcp.connectionDialogContent.customConnection")]})]}),e[27]=I,e[28]=D,e[29]=m,e[30]=_,e[31]=h,e[32]=ue):ue=e[32];const Ge=v&&"opacity-50 pointer-events-none";let me;e[33]!==Ge?(me=U("flex-1 overflow-auto p-5 transition-opacity duration-150",Ge),e[33]=Ge,e[34]=me):me=e[34];const qt="grid grid-cols-[repeat(auto-fill,minmax(260px,1fr))] gap-4";let Me;e[35]!==Oe?(Me=w=>{if(w.type==="group")return Oe(w.key,w.title,w.icon,null,w.connections);const M=w.connection;return Oe(M.id,M.title,M.icon,M.description??null,[M])},e[35]=Oe,e[36]=Me):Me=e[36];const Xe=q.map(Me);let fe;e[37]!==He?(fe=t.jsx("div",{ref:He,className:"col-span-full h-1"}),e[37]=He,e[38]=fe):fe=e[38];let ge;e[39]!==E?(ge=E&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(Ie,{size:24,className:"animate-spin text-muted-foreground"})}),e[39]=E,e[40]=ge):ge=e[40];const Qe=G&&_e.length>0&&t.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[t.jsx(tt,{size:13,className:"text-muted-foreground shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:h("virtualMcp.connectionDialogContent.sectionVerified")}),t.jsx("div",{className:"flex-1 h-px bg-border"})]}),We=G&&_e.map(lt),Ye=G&&Se.length>0&&t.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[t.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:h("virtualMcp.connectionDialogContent.sectionAllConnections")}),t.jsx("div",{className:"flex-1 h-px bg-border"})]}),Je=G&&Se.map(lt);let he;e[41]!==Ue||e[42]!==$||e[43]!==G?(he=G&&$.length>0&&t.jsx("div",{ref:Ue,className:"col-span-full h-1"}),e[41]=Ue,e[42]=$,e[43]=G,e[44]=he):he=e[44];let pe;e[45]!==ie.isLoadingMore||e[46]!==G?(pe=G&&ie.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(Ie,{size:24,className:"animate-spin text-muted-foreground"})}),e[45]=ie.isLoadingMore,e[46]=G,e[47]=pe):pe=e[47];let xe;e[48]!==Xe||e[49]!==fe||e[50]!==ge||e[51]!==Qe||e[52]!==We||e[53]!==Ye||e[54]!==Je||e[55]!==he||e[56]!==pe?(xe=t.jsxs("div",{className:qt,children:[Xe,fe,ge,Qe,We,Ye,Je,he,pe]}),e[48]=Xe,e[49]=fe,e[50]=ge,e[51]=Qe,e[52]=We,e[53]=Ye,e[54]=Je,e[55]=he,e[56]=pe,e[57]=xe):xe=e[57];let je;e[58]!==I||e[59]!==q.length||e[60]!==Se||e[61]!==u||e[62]!==h||e[63]!==_e?(je=q.length===0&&_e.length===0&&Se.length===0&&t.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:u?h("virtualMcp.connectionDialogContent.emptyStateSearchNoMatch",{search:u}):h(I==="connected"?"virtualMcp.connectionDialogContent.emptyStateNoConnectionsYet":"virtualMcp.connectionDialogContent.emptyStateNoConnectionsAvailable")}),e[58]=I,e[59]=q.length,e[60]=Se,e[61]=u,e[62]=h,e[63]=_e,e[64]=je):je=e[64];let ve;e[65]!==me||e[66]!==xe||e[67]!==je?(ve=t.jsxs("div",{className:me,children:[xe,je]}),e[65]=me,e[66]=xe,e[67]=je,e[68]=ve):ve=e[68];let $e;return e[69]!==ue||e[70]!==ve?($e=t.jsxs(t.Fragment,{children:[ue,ve]}),e[69]=ue,e[70]=ve,e[71]=$e):$e=e[71],$e}function Hs(n){return!n.verified&&!Ke(n._meta)?.verified&&!n.meta?.verified}function qs(n){return n.verified||Ke(n._meta)?.verified||n.meta?.verified}function Gs(n){return n.app_name}function Xs(n){return n.app_name}function Qs(n){return n?.items??[]}function Ws(n,e){if(n?.hasMore)return e.reduce(Ys,0)}function Ys(n,e){return n+(e?.items?.length??0)}function Js(n){return[{field:["title"],operator:"contains",value:n},{field:["description"],operator:"contains",value:n}]}function ei({open:n,onOpenChange:e,defaultTab:s,initialSearch:o="",...a}){const i=F(),l=a.mode??"add",c="agentId"in a?a.agentId:void 0,r="addedConnectionIds"in a?a.addedConnectionIds??new Set:new Set,u="onAdd"in a&&a.onAdd?a.onAdd:N=>{},m=(N,y,T)=>{c&&B("agent_connection_attached",{agent_id:c,connection_id:N,app_name:y,mode:T})},[f,d]=R.useState(null),[g,b]=R.useState(o),[h,p]=R.useState(!1),{org:j}=oe(),{data:v}=re.useSession(),C=Kt(),_=an(),S=ot(),I=N=>{e(!1),S({to:"/$org/settings/connections/$appSlug",params:{org:j.slug,appSlug:N}})},L=()=>{_.invalidateQueries({predicate:N=>{const y=N.queryKey;return y[1]===j.id&&y[3]==="collection"&&y[4]==="CONNECTIONS"}})},x=async(N,y)=>{B("connection_oauth_succeeded",{connection_id:N,flow:y});const T=new URL(`/api/${j.slug}/mcp/${N}`,window.location.origin);await _.invalidateQueries({queryKey:Ae.isMCPAuthenticated(T.href,null)}),L()},D=async N=>{d(N.app_name??N.id);try{const T=`${N.title.replace(/\s*\(\d+\)\s*$/,"")} (${Date.now().toString(36).slice(-4)})`,A=(await C.create.mutateAsync({title:T,description:N.description??null,connection_type:N.connection_type,connection_url:N.connection_url??null,connection_token:null,icon:N.icon??null,app_name:N.app_name??null,app_id:N.app_id??null,connection_headers:N.connection_headers??null})).id,z=await nt({connectionId:A,orgId:j.id,orgSlug:j.slug,persistFallback:V=>C.update.mutateAsync({id:A,data:{connection_token:V}}).then(()=>{})});if(z.ran&&!z.ok){B("connection_oauth_failed",{connection_id:A,flow:"clone",error:z.error??"no_token"}),K.error(i("virtualMcp.addConnectionDialog.authenticationFailedError",{error:z.error??"no token received"})),await C.delete.mutateAsync(A);return}z.ran&&await x(A,"clone"),m(A,N.app_name??null,"clone"),u(A)}catch(y){console.error("Failed to add connection:",y),K.error(i("virtualMcp.addConnectionDialog.failedToAddConnection"))}finally{d(null)}},P=async N=>{if(!(!j||!v?.user?.id)){d(N.id);try{const y=Rn(N,j.id,v.user.id,{remoteIndex:0}),T=y.connection_type==="STDIO",k=!!y.connection_url,A=T&&y.connection_headers&&typeof y.connection_headers=="object"&&"command"in y.connection_headers;if(!k&&!A){K.error(i("virtualMcp.addConnectionDialog.mcpServerConnectionError")),d(null);return}const{id:z}=await C.create.mutateAsync(y),V=await nt({connectionId:z,orgId:j.id,orgSlug:j.slug,persistFallback:X=>C.update.mutateAsync({id:z,data:{connection_token:X}}).then(()=>{})});if(V.ran&&!V.ok){B("connection_oauth_failed",{connection_id:z,flow:"connect_new",error:V.error??"no_token"}),K.warning(i("virtualMcp.addConnectionDialog.signInFailedTitle"),{description:i("virtualMcp.addConnectionDialog.signInFailedDescription",{error:V.error??"no token received"})}),m(z,y.app_name??null,"new"),u(z);return}V.ran?(await x(z,"connect_new"),K.success(i("virtualMcp.addConnectionDialog.connectedAuthenticated"))):K.success(i("virtualMcp.addConnectionDialog.connected")),m(z,y.app_name??null,"new"),u(z)}catch(y){console.error("Failed to connect:",y),K.error(i("virtualMcp.addConnectionDialog.failedToConnect"))}finally{d(null)}}};return t.jsxs(Et,{open:n,onOpenChange:e,children:[t.jsxs(Bt,{className:"sm:max-w-5xl h-[85vh] max-h-[85vh] flex flex-col p-0 gap-0 overflow-hidden w-[95vw]",children:[t.jsx(Rt,{className:"px-6 pt-5 pb-0 shrink-0",children:t.jsx(Vt,{className:"text-base font-semibold",children:i(l==="browse"?"virtualMcp.addConnectionDialog.connectionsTitle":"virtualMcp.addConnectionDialog.addConnectionTitle")})}),t.jsx("div",{className:"pt-3 shrink-0",children:t.jsx(Fn,{value:g,onChange:b,placeholder:i("virtualMcp.addConnectionDialog.searchConnectionsPlaceholder")})}),t.jsx(R.Suspense,{fallback:t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(Ie,{size:24,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Us,{mode:l,agentId:c,addedConnectionIds:r,onAdd:u,onCloneAndAdd:D,onConnectAndAdd:P,connectingItemId:f,search:g,onCreateConnection:()=>p(!0),onBrowseNavigate:I,defaultTab:s})})]}),t.jsx(Ks,{open:h,onOpenChange:p,onCreated:async N=>{p(!1);const y=await nt({connectionId:N,orgId:j.id,orgSlug:j.slug,persistFallback:T=>C.update.mutateAsync({id:N,data:{connection_token:T}}).then(()=>{})});if(y.ran&&!y.ok){B("connection_oauth_failed",{connection_id:N,flow:"custom_create",error:y.error??"no_token"}),K.warning(i("virtualMcp.addConnectionDialog.signInFailedTitle"),{description:i("virtualMcp.addConnectionDialog.signInFailedDescription",{error:y.error??"no token received"})}),m(N,null,"custom"),u(N),e(!1);return}y.ran&&await x(N,"custom_create"),m(N,null,"custom"),u(N),e(!1)}})]})}const ft=new Map;function ti(){const{org:n}=oe(),e=ln(),s=is(),o=s.find(p=>p.providerId==="deco"),{data:a,isLoading:i,refetch:l,isFetching:c}=ke({queryKey:Ae.aiProviderCredits(n.id,"deco"),enabled:!!o,staleTime:6e4,queryFn:async()=>{try{return await e.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}}}),r=a?.balanceCents??null,u=r!=null?r/100:null,m=R.useRef(new Map);if(r!=null){const p=ft.get(n.id);m.current.get(n.id)&&p!=null&&r>p&&B("credits_topped_up_detected",{organization_id:n.id,delta_cents:r-p,previous_balance_cents:p,new_balance_cents:r}),ft.set(n.id,r),m.current.set(n.id,!0)}const f=!!o,d=r!=null&&r>0,g=r!=null&&r===0,b=r!=null&&r===200,h=s.length>0&&s.every(p=>p.providerId==="deco");return{hasDecoKey:f,decoKeyId:o?.id??null,balanceCents:r,balanceDollars:u,hasCredits:d,isZeroBalance:g,isInitialFreeCredit:b,hasOnlyDecoProvider:h,isLoading:i,isFetching:c,refetch:l}}const Zs=4,eo="TASK";function to(n){return n.replace(/[^a-zA-Z]/g,"").toUpperCase().slice(0,Zs)||eo}function ni(n,e,s){const o=s?.trim();return o||(e==null?null:`${to(n)}-${String(e).padStart(2,"0")}`)}const no=/^(?:[a-z]{1,8}-)?0*(\d+)$/i;function si(n){const e=no.exec(n.trim())?.[1];return e===void 0?null:Number(e)}function oi(n){const e=O.c(8),{size:s,className:o}=n,a=s===void 0?16:s;let i;e[0]!==a?(i={width:a,height:a},e[0]=a,e[1]=i):i=e[1];let l;e[2]!==o?(l=U("shrink-0 rounded-full object-cover",o),e[2]=o,e[3]=l):l=e[3];let c;return e[4]!==a||e[5]!==i||e[6]!==l?(c=t.jsx("img",{src:fn,alt:"Super Agent",width:a,height:a,style:i,className:l}),e[4]=a,e[5]=i,e[6]=l,e[7]=c):c=e[7],c}export{Jo as A,Qo as C,Zo as N,Yo as O,oi as S,Wo as a,ei as b,Xo as c,xs as d,it as e,Go as f,as as g,Bs as h,si as p,ni as t,ti as u};
@@ -1 +0,0 @@
1
- import{c as te,j as s,dy as ye,b as ue,r as ce,B as ee,n as je,t as ae,Y as be}from"./index-Ci8azyOE.js";import{s as ge}from"./Plus-CPkR-QLd.js";import{c as Re,d as ve,b as Se,f as Ne,g as De,e as _e,a as Ce,A as Pe}from"./alert-dialog-Dh9zsaCy.js";import{b as Ae,h as ke,a as we,c as Oe,d as ze,e as Ee}from"./dialog-BI8UUwqv.js";import{I as Ie}from"./input-Bwz-dTwg.js";import{G as xe,a as $e}from"./github-repo-picker-sKX6qrmQ.js";import{u as Fe,b as Te,c as Ge}from"./use-org-repo-syncs-rlkQHsUF.js";import{t as He}from"./cards-4fPEe6ST.js";import{R as Be}from"./require-capability-cxyKBT59.js";import"./collection-search-0N-i_PHL.js";import"./SearchMd-ClTH3fiN.js";import"./use-debounced-value-BENALn-i.js";import"./use-connection-gqhqm1hO.js";import"./use-mcp-client-DP2onozC.js";import"./constants-dLUUoWH7.js";import"./auth-D8IdOmGw.js";import"./authenticate-and-persist-oauth-DY_hbkIG.js";import"./mcp-oauth-GWhqBwu1.js";import"./ArrowLeft-BwagOJkb.js";import"./LinkExternal01-CIL2SNWf.js";import"./LockUnlocked01-BpeKJGM4.js";import"./use-mcp-tools-B7yHzu9T.js";import"./extract-connection-data-6cVSTGuY.js";import"./metadata-dUsYcpuu.js";import"./use-navigate-to-agent-mrg2_DxJ.js";import"./use-destination-route-d8wgPDBu.js";import"./use-virtual-mcp-Dj0wXB98.js";import"./hooks-DQmp7LHz.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-BN-M5EUb.js";import"./task-board-Cz-fiaKF.js";import"./session-runtime-C-KTDVeQ.js";import"./slugify-CEUa2lfQ.js";import"./provision-repo-scoped-github-connection-CMPWtdMv.js";import"./DotsVertical-CpVcGDJ_.js";import"./Download01-BN9BT9cL.js";import"./Share07-CPDrxQV8.js";import"./Globe01-CV-16mwB.js";import"./Key01-D4srNqPO.js";import"./Palette-Cv68Zggp.js";import"./Trash01-Dp-QTpAR.js";import"./Zap-MbQ2aiA8.js";import"./dropdown-menu-wKA_-hY5.js";import"./Check-D5PKBQ5I.js";import"./ChevronRight-DUmHQrD7.js";import"./file-type-icon-QfVGs4d0.js";import"./Eye-DgiSa7UT.js";import"./access-gate-BZ6Xc62y.js";import"./capability-load-error-BtIV807c.js";function qe(e){return e.toLowerCase().replace(/[^a-z0-9_.-]+/g,"-").replace(/^[.-]+|[.-]+$/g,"").slice(0,128)}function Le(e,t){return e.lastSyncError?{label:e.lastSyncError,error:!0}:e.lastSyncedAt?{label:t("library.syncedRepos.syncedAgo",{ago:He(e.lastSyncedAt)}),error:!1}:{label:t("library.syncedRepos.waitingFirstSync"),error:!1}}function Ve(e){const t=te.c(32),{config:l,onRemove:i}=e,c=ue();let u;t[0]!==l||t[1]!==c?(u=Le(l,c),t[0]=l,t[1]=c,t[2]=u):u=t[2];const p=u;let o;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:s.jsx(xe,{size:16,className:"text-muted-foreground"})}),t[3]=o):o=t[3];let a;t[4]!==l.repoName||t[5]!==l.repoOwner?(a=s.jsxs("span",{className:"font-medium text-sm truncate",children:[l.repoOwner,"/",l.repoName]}),t[4]=l.repoName,t[5]=l.repoOwner,t[6]=a):a=t[6];let n;t[7]!==l.ref?(n=s.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:["@",l.ref]}),t[7]=l.ref,t[8]=n):n=t[8];let g;t[9]!==a||t[10]!==n?(g=s.jsxs("div",{className:"flex items-center gap-2",children:[a,n]}),t[9]=a,t[10]=n,t[11]=g):g=t[11];const m=p.error?"text-destructive":"text-muted-foreground";let d;t[12]!==m?(d=je("text-xs mt-0.5 truncate",m),t[12]=m,t[13]=d):d=t[13];let f;t[14]!==l.volume||t[15]!==c?(f=c("settings.syncedRepos.rowSubtitle",{volume:l.volume}),t[14]=l.volume,t[15]=c,t[16]=f):f=t[16];let y;t[17]!==p.label||t[18]!==d||t[19]!==f?(y=s.jsxs("p",{className:d,children:[f," ·"," ",p.label]}),t[17]=p.label,t[18]=d,t[19]=f,t[20]=y):y=t[20];let x;t[21]!==g||t[22]!==y?(x=s.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[o,s.jsxs("div",{className:"min-w-0",children:[g,y]})]}),t[21]=g,t[22]=y,t[23]=x):x=t[23];let j;t[24]!==c?(j=c("settings.syncedRepos.remove"),t[24]=c,t[25]=j):j=t[25];let h;t[26]!==i||t[27]!==j?(h=s.jsx(ee,{variant:"outline",size:"sm",onClick:i,children:j}),t[26]=i,t[27]=j,t[28]=h):h=t[28];let b;return t[29]!==x||t[30]!==h?(b=s.jsxs("div",{className:"flex items-center justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[x,h]}),t[29]=x,t[30]=h,t[31]=b):b=t[31],b}function Ye(e){const t=te.c(21),{onAdd:l}=e,i=ue();let c;t[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:s.jsx(xe,{size:20,className:"text-muted-foreground"})}),t[0]=c):c=t[0];let u;t[1]!==i?(u=i("settings.syncedRepos.emptyTitle"),t[1]=i,t[2]=u):u=t[2];let p;t[3]!==u?(p=s.jsx("p",{className:"font-medium text-sm",children:u}),t[3]=u,t[4]=p):p=t[4];let o;t[5]!==i?(o=i("settings.syncedRepos.emptyDescription"),t[5]=i,t[6]=o):o=t[6];let a;t[7]!==o?(a=s.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:o}),t[7]=o,t[8]=a):a=t[8];let n;t[9]!==p||t[10]!==a?(n=s.jsxs("div",{children:[p,a]}),t[9]=p,t[10]=a,t[11]=n):n=t[11];let g;t[12]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(ge,{size:14}),t[12]=g):g=t[12];let m;t[13]!==i?(m=i("settings.syncedRepos.addRepo"),t[13]=i,t[14]=m):m=t[14];let d;t[15]!==l||t[16]!==m?(d=s.jsxs(ee,{onClick:l,size:"sm",className:"mt-2",children:[g,m]}),t[15]=l,t[16]=m,t[17]=d):d=t[17];let f;return t[18]!==n||t[19]!==d?(f=s.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[c,n,d]}),t[18]=n,t[19]=d,t[20]=f):f=t[20],f}function Je(){const e=te.c(107),t=ue(),l=Fe(),i=Te(),c=Ge(),[u,p]=ce.useState(!1),[o,a]=ce.useState(null),[n,g]=ce.useState(""),[m,d]=ce.useState(null);let f;e[0]!==i||e[1]!==o||e[2]!==t||e[3]!==n?(f=function(){!o||!n.trim()||i.mutate({connectionId:o.connectionId,volume:n.trim()},{onSuccess:R=>{a(null),ae.success(t("settings.syncedRepos.created",{volume:R.volume}))},onError:R=>{ae.error(R instanceof Error?R.message:t("settings.syncedRepos.failed"))}})},e[0]=i,e[1]=o,e[2]=t,e[3]=n,e[4]=f):f=e[4];const y=f;let x;e[5]!==m||e[6]!==c||e[7]!==t?(x=function(){m&&c.mutate(m.id,{onSuccess:()=>ae.success(t("settings.syncedRepos.removed")),onError:R=>ae.error(R instanceof Error?R.message:t("settings.syncedRepos.failed")),onSettled:()=>d(null)})},e[5]=m,e[6]=c,e[7]=t,e[8]=x):x=e[8];const j=x;if(l.isPending){let r;return e[9]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(be,{className:"h-32 w-full"}),e[9]=r):r=e[9],r}let h;e[10]!==l.data?(h=l.data??[],e[10]=l.data,e[11]=h):h=e[11];const b=h;let v;e[12]!==t?(v=t("settings.syncedRepos.pageDescription"),e[12]=t,e[13]=v):v=e[13];let S;e[14]!==v?(S=s.jsx("p",{className:"text-sm text-muted-foreground",children:v}),e[14]=v,e[15]=S):S=e[15];let N;e[16]!==b||e[17]!==t?(N=b.length===0?s.jsx(Ye,{onAdd:()=>p(!0)}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"flex items-center justify-end",children:s.jsxs(ee,{onClick:()=>p(!0),size:"sm",children:[s.jsx(ge,{size:14}),t("settings.syncedRepos.addRepo")]})}),s.jsx("section",{className:"rounded-2xl border border-border/60 bg-background px-5 py-2",children:b.map(r=>s.jsx(Ve,{config:r,onRemove:()=>d(r)},r.id))})]}),e[16]=b,e[17]=t,e[18]=N):N=e[18];let D;e[19]!==t?(D=t("settings.syncedRepos.pickerTitle"),e[19]=t,e[20]=D):D=e[20];let se;e[21]===Symbol.for("react.memo_cache_sentinel")?(se=r=>{p(!1),a(r),g(qe(r.repo.name))},e[21]=se):se=e[21];let _;e[22]!==u||e[23]!==D?(_=s.jsx($e,{mode:"connection",open:u,onOpenChange:p,title:D,onImportComplete:se}),e[22]=u,e[23]=D,e[24]=_):_=e[24];const me=o!==null;let ie;e[25]===Symbol.for("react.memo_cache_sentinel")?(ie=r=>{r||a(null)},e[25]=ie):ie=e[25];let C;e[26]!==t?(C=t("settings.syncedRepos.nameDialogTitle"),e[26]=t,e[27]=C):C=e[27];let P;e[28]!==C?(P=s.jsx(Ae,{children:C}),e[28]=C,e[29]=P):P=e[29];const de=o?`${o.repo.owner}/${o.repo.name}`:"";let A;e[30]!==t||e[31]!==de?(A=t("settings.syncedRepos.nameDialogDescription",{repo:de}),e[30]=t,e[31]=de,e[32]=A):A=e[32];let k;e[33]!==A?(k=s.jsx(ke,{children:A}),e[33]=A,e[34]=k):k=e[34];let w;e[35]!==P||e[36]!==k?(w=s.jsxs(we,{children:[P,k]}),e[35]=P,e[36]=k,e[37]=w):w=e[37];let le;e[38]===Symbol.for("react.memo_cache_sentinel")?(le=r=>g(r.target.value),e[38]=le):le=e[38];let O;e[39]!==t?(O=t("settings.syncedRepos.namePlaceholder"),e[39]=t,e[40]=O):O=e[40];let z;e[41]!==O||e[42]!==n?(z=s.jsx(Ie,{value:n,onChange:le,placeholder:O,autoFocus:!0}),e[41]=O,e[42]=n,e[43]=z):z=e[43];let ne;e[44]===Symbol.for("react.memo_cache_sentinel")?(ne=()=>a(null),e[44]=ne):ne=e[44];const he=i.isPending;let E;e[45]!==t?(E=t("settings.syncedRepos.cancel"),e[45]=t,e[46]=E):E=e[46];let I;e[47]!==i.isPending||e[48]!==E?(I=s.jsx(ee,{variant:"outline",onClick:ne,disabled:he,children:E}),e[47]=i.isPending,e[48]=E,e[49]=I):I=e[49];let $;e[50]!==i.isPending||e[51]!==n?($=!n.trim()||i.isPending,e[50]=i.isPending,e[51]=n,e[52]=$):$=e[52];let F;e[53]!==i.isPending||e[54]!==t?(F=i.isPending?t("settings.syncedRepos.creating"):t("settings.syncedRepos.create"),e[53]=i.isPending,e[54]=t,e[55]=F):F=e[55];let T;e[56]!==y||e[57]!==$||e[58]!==F?(T=s.jsx(ee,{disabled:$,onClick:y,children:F}),e[56]=y,e[57]=$,e[58]=F,e[59]=T):T=e[59];let G;e[60]!==I||e[61]!==T?(G=s.jsxs(Oe,{children:[I,T]}),e[60]=I,e[61]=T,e[62]=G):G=e[62];let H;e[63]!==w||e[64]!==z||e[65]!==G?(H=s.jsxs(ze,{className:"sm:max-w-sm",children:[w,z,G]}),e[63]=w,e[64]=z,e[65]=G,e[66]=H):H=e[66];let B;e[67]!==H||e[68]!==me?(B=s.jsx(Ee,{open:me,onOpenChange:ie,children:H}),e[67]=H,e[68]=me,e[69]=B):B=e[69];const pe=m!==null;let oe;e[70]===Symbol.for("react.memo_cache_sentinel")?(oe=r=>{r||d(null)},e[70]=oe):oe=e[70];const fe=m?.volume??"";let q;e[71]!==t||e[72]!==fe?(q=t("settings.syncedRepos.removeTitle",{volume:fe}),e[71]=t,e[72]=fe,e[73]=q):q=e[73];let L;e[74]!==q?(L=s.jsx(Re,{children:q}),e[74]=q,e[75]=L):L=e[75];let V;e[76]!==t?(V=t("settings.syncedRepos.removeDescription"),e[76]=t,e[77]=V):V=e[77];let Y;e[78]!==V?(Y=s.jsx(ve,{children:V}),e[78]=V,e[79]=Y):Y=e[79];let J;e[80]!==L||e[81]!==Y?(J=s.jsxs(Se,{children:[L,Y]}),e[80]=L,e[81]=Y,e[82]=J):J=e[82];let K;e[83]!==t?(K=t("settings.syncedRepos.cancel"),e[83]=t,e[84]=K):K=e[84];let M;e[85]!==K?(M=s.jsx(Ne,{children:K}),e[85]=K,e[86]=M):M=e[86];let Q;e[87]!==t?(Q=t("settings.syncedRepos.remove"),e[87]=t,e[88]=Q):Q=e[88];let U;e[89]!==j||e[90]!==Q?(U=s.jsx(De,{onClick:j,children:Q}),e[89]=j,e[90]=Q,e[91]=U):U=e[91];let W;e[92]!==M||e[93]!==U?(W=s.jsxs(_e,{children:[M,U]}),e[92]=M,e[93]=U,e[94]=W):W=e[94];let X;e[95]!==J||e[96]!==W?(X=s.jsxs(Ce,{children:[J,W]}),e[95]=J,e[96]=W,e[97]=X):X=e[97];let Z;e[98]!==pe||e[99]!==X?(Z=s.jsx(Pe,{open:pe,onOpenChange:oe,children:X}),e[98]=pe,e[99]=X,e[100]=Z):Z=e[100];let re;return e[101]!==B||e[102]!==S||e[103]!==Z||e[104]!==N||e[105]!==_?(re=s.jsxs(s.Fragment,{children:[S,N,_,B,Z]}),e[101]=B,e[102]=S,e[103]=Z,e[104]=N,e[105]=_,e[106]=re):re=e[106],re}function Ke(){const e=te.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(ye,{group:"storage",children:s.jsx(Je,{})}),e[0]=t):t=e[0],t}function Vt(){const e=te.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(Be,{capability:"file-configs:manage",area:"files",children:s.jsx(Ke,{})}),e[0]=t):t=e[0],t}export{Vt as default};